@ezuikit/player-theme 3.1.4-beta.1 → 3.1.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constant.js +2 -2
- package/dist/index.cjs +401 -514
- package/dist/index.esm.js +401 -514
- package/dist/index.umd.js +628 -1085
- package/dist/style.css +3 -2
- package/dist/style.js +2 -3
- package/dist/types/index.d.ts +40 -57
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v3.1.4-beta.
|
|
3
|
-
* Copyright (c) 2026-08-
|
|
2
|
+
* @ezuikit/player-theme v3.1.4-beta.2
|
|
3
|
+
* Copyright (c) 2026-08-27 19:42:35 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(
|
|
8
|
-
typeof define === 'function' && define.amd ? define(
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Theme = factory(
|
|
10
|
-
})(this, (function (
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Theme = factory());
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
11
|
|
|
12
12
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
13
13
|
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
var eventemitter3
|
|
18
|
+
var eventemitter3 = {exports: {}};
|
|
19
19
|
|
|
20
|
-
var hasRequiredEventemitter3
|
|
20
|
+
var hasRequiredEventemitter3;
|
|
21
21
|
|
|
22
|
-
function requireEventemitter3
|
|
23
|
-
if (hasRequiredEventemitter3
|
|
24
|
-
hasRequiredEventemitter3
|
|
22
|
+
function requireEventemitter3 () {
|
|
23
|
+
if (hasRequiredEventemitter3) return eventemitter3.exports;
|
|
24
|
+
hasRequiredEventemitter3 = 1;
|
|
25
25
|
(function (module) {
|
|
26
26
|
|
|
27
27
|
var has = Object.prototype.hasOwnProperty
|
|
@@ -358,16 +358,16 @@
|
|
|
358
358
|
{
|
|
359
359
|
module.exports = EventEmitter;
|
|
360
360
|
}
|
|
361
|
-
} (eventemitter3
|
|
362
|
-
return eventemitter3
|
|
361
|
+
} (eventemitter3));
|
|
362
|
+
return eventemitter3.exports;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
var eventemitter3Exports
|
|
366
|
-
var EventEmitter
|
|
365
|
+
var eventemitter3Exports = requireEventemitter3();
|
|
366
|
+
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
369
|
* 播放器的类名前缀
|
|
370
|
-
*/ var PREFIX_CLASS = 'ezplayer';
|
|
370
|
+
*/ var PREFIX_CLASS$1 = 'ezplayer';
|
|
371
371
|
/** 填充模式 */ var THEME_SCALE_MODE_TYPE = {
|
|
372
372
|
/** 画面完全填充canvas区域,画面会被拉伸 */ full: 0,
|
|
373
373
|
/** 画面做等比缩放后,高或宽对齐canvas区域,画面不被拉伸,但有黑边 */ auto: 1,
|
|
@@ -654,17 +654,17 @@
|
|
|
654
654
|
return first.toLowerCase();
|
|
655
655
|
}) : '';
|
|
656
656
|
_this.$container = document.createElement(options.tagName || 'span');
|
|
657
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-control"); // 默认隐藏
|
|
657
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-control"); // 默认隐藏
|
|
658
658
|
if ((options == null ? void 0 : options.controlType) === 'text') {
|
|
659
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-control-text");
|
|
659
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-control-text");
|
|
660
660
|
} else if ((options == null ? void 0 : options.controlType) === 'block') {
|
|
661
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-control-block"); // 块
|
|
661
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-control-block"); // 块
|
|
662
662
|
} else {
|
|
663
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-control-btn"); // 默认隐藏
|
|
663
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-control-btn"); // 默认隐藏
|
|
664
664
|
}
|
|
665
665
|
if (options == null ? void 0 : options.classNameSuffix) {
|
|
666
666
|
// prettier-ignore
|
|
667
|
-
_this.$container.classList.add(PREFIX_CLASS + "-control-" + (options == null ? void 0 : options.classNameSuffix));
|
|
667
|
+
_this.$container.classList.add(PREFIX_CLASS$1 + "-control-" + (options == null ? void 0 : options.classNameSuffix));
|
|
668
668
|
}
|
|
669
669
|
if (options == null ? void 0 : options.className) {
|
|
670
670
|
_this.$container.classList.add(options.className);
|
|
@@ -723,7 +723,7 @@
|
|
|
723
723
|
*/ _proto.hide = function hide() {
|
|
724
724
|
if (this.$container) {
|
|
725
725
|
this.$container.style.display = 'none';
|
|
726
|
-
this.$container.classList.add("" + PREFIX_CLASS + "-hide");
|
|
726
|
+
this.$container.classList.add("" + PREFIX_CLASS$1 + "-hide");
|
|
727
727
|
}
|
|
728
728
|
};
|
|
729
729
|
/**
|
|
@@ -749,19 +749,19 @@
|
|
|
749
749
|
_proto._updateDisabledState = function _updateDisabledState(disabled) {
|
|
750
750
|
if (disabled) {
|
|
751
751
|
var _this_$container;
|
|
752
|
-
(_this_$container = this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS + "-disabled");
|
|
752
|
+
(_this_$container = this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS$1 + "-disabled");
|
|
753
753
|
} else {
|
|
754
754
|
var _this_$container1;
|
|
755
|
-
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS + "-disabled");
|
|
755
|
+
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS$1 + "-disabled");
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
758
|
_proto._updateActiveState = function _updateActiveState(active) {
|
|
759
759
|
if (active) {
|
|
760
760
|
var _this_$container;
|
|
761
|
-
(_this_$container = this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS + "-active");
|
|
761
|
+
(_this_$container = this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
762
762
|
} else {
|
|
763
763
|
var _this_$container1;
|
|
764
|
-
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS + "-active");
|
|
764
|
+
(_this_$container1 = this.$container) == null ? void 0 : _this_$container1.classList.remove("" + PREFIX_CLASS$1 + "-active");
|
|
765
765
|
}
|
|
766
766
|
};
|
|
767
767
|
/**
|
|
@@ -772,7 +772,7 @@
|
|
|
772
772
|
this._onClickHandler = function(e) {
|
|
773
773
|
var _this_$container;
|
|
774
774
|
// prettier-ignore
|
|
775
|
-
if (!((_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.contains("" + PREFIX_CLASS + "-disabled"))) {
|
|
775
|
+
if (!((_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.contains("" + PREFIX_CLASS$1 + "-disabled"))) {
|
|
776
776
|
// _onControlClick 来源自子类中
|
|
777
777
|
_this._onControlClick == null ? void 0 : _this._onControlClick.call(_this, e);
|
|
778
778
|
}
|
|
@@ -822,17 +822,13 @@
|
|
|
822
822
|
}
|
|
823
823
|
]);
|
|
824
824
|
return Control;
|
|
825
|
-
}(EventEmitter
|
|
825
|
+
}(EventEmitter);
|
|
826
826
|
|
|
827
827
|
function _extends$B() {
|
|
828
|
-
_extends$B = Object.assign || function(target) {
|
|
828
|
+
_extends$B = Object.assign || function assign(target) {
|
|
829
829
|
for(var i = 1; i < arguments.length; i++){
|
|
830
830
|
var source = arguments[i];
|
|
831
|
-
for(var key in source)
|
|
832
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
833
|
-
target[key] = source[key];
|
|
834
|
-
}
|
|
835
|
-
}
|
|
831
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
836
832
|
}
|
|
837
833
|
return target;
|
|
838
834
|
};
|
|
@@ -873,7 +869,7 @@
|
|
|
873
869
|
classNameSuffix: 'loading'
|
|
874
870
|
}))) || this;
|
|
875
871
|
_this._options = Object.assign({}, options);
|
|
876
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-loading", "" + PREFIX_CLASS + "-hide"); // 默认隐藏
|
|
872
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-loading", "" + PREFIX_CLASS$1 + "-hide"); // 默认隐藏
|
|
877
873
|
_this._html();
|
|
878
874
|
return _this;
|
|
879
875
|
}
|
|
@@ -883,7 +879,7 @@
|
|
|
883
879
|
this.$container.innerHTML = this._options.render();
|
|
884
880
|
} else {
|
|
885
881
|
var _this_locale;
|
|
886
|
-
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + "-loading-dot " + PREFIX_CLASS + '-loading-dot-load">\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS + '-loading-dot-item"></i>\n </span>\n <div class="' + PREFIX_CLASS + '-loading-text">' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.LOADING) || 'loading...') + "</div>\n ";
|
|
882
|
+
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS$1 + "-loading-dot " + PREFIX_CLASS$1 + '-loading-dot-load">\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n <i class="' + PREFIX_CLASS$1 + '-loading-dot-item"></i>\n </span>\n <div class="' + PREFIX_CLASS$1 + '-loading-text">' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.LOADING) || 'loading...') + "</div>\n ";
|
|
887
883
|
}
|
|
888
884
|
};
|
|
889
885
|
/**
|
|
@@ -893,27 +889,23 @@
|
|
|
893
889
|
if (html) this.$container.innerHTML = html;
|
|
894
890
|
// 初始化, 出流再等待中(回放出流结束不包括)
|
|
895
891
|
this.$container.style.display = 'flex';
|
|
896
|
-
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
897
|
-
this.$popupContainer.classList.add("" + PREFIX_CLASS + "-has-loading");
|
|
892
|
+
this.$container.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
893
|
+
this.$popupContainer.classList.add("" + PREFIX_CLASS$1 + "-has-loading");
|
|
898
894
|
};
|
|
899
895
|
/**
|
|
900
896
|
* 隐藏动画
|
|
901
897
|
*/ _proto.hide = function hide() {
|
|
902
898
|
Control.prototype.hide.call(this);
|
|
903
|
-
this.$popupContainer.classList.remove("" + PREFIX_CLASS + "-has-loading");
|
|
899
|
+
this.$popupContainer.classList.remove("" + PREFIX_CLASS$1 + "-has-loading");
|
|
904
900
|
};
|
|
905
901
|
return Loading;
|
|
906
902
|
}(Control);
|
|
907
903
|
|
|
908
904
|
function _extends$A() {
|
|
909
|
-
_extends$A = Object.assign || function(target) {
|
|
905
|
+
_extends$A = Object.assign || function assign(target) {
|
|
910
906
|
for(var i = 1; i < arguments.length; i++){
|
|
911
907
|
var source = arguments[i];
|
|
912
|
-
for(var key in source)
|
|
913
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
914
|
-
target[key] = source[key];
|
|
915
|
-
}
|
|
916
|
-
}
|
|
908
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
917
909
|
}
|
|
918
910
|
return target;
|
|
919
911
|
};
|
|
@@ -959,7 +951,7 @@
|
|
|
959
951
|
classNameSuffix: 'poster'
|
|
960
952
|
}))) || this;
|
|
961
953
|
_this._options = Object.assign({}, POSTER_OPTIONS, options);
|
|
962
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-poster", "" + PREFIX_CLASS + "-hide");
|
|
954
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-poster", "" + PREFIX_CLASS$1 + "-hide");
|
|
963
955
|
_this._imgLoadErrorEvent = _this._imgLoadErrorEvent.bind(_this);
|
|
964
956
|
if (_this._options.poster) {
|
|
965
957
|
_this.setPoster(_this._options.poster);
|
|
@@ -988,15 +980,15 @@
|
|
|
988
980
|
this.$container.innerHTML = '';
|
|
989
981
|
return;
|
|
990
982
|
}
|
|
991
|
-
this.$container.innerHTML = '<img class="' + PREFIX_CLASS + '-poster-img" src="' + poster + '" />';
|
|
992
|
-
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
983
|
+
this.$container.innerHTML = '<img class="' + PREFIX_CLASS$1 + '-poster-img" src="' + poster + '" />';
|
|
984
|
+
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS$1 + "-poster-img")) == null ? void 0 : _this_$container_querySelector.addEventListener("error", this._imgLoadErrorEvent);
|
|
993
985
|
};
|
|
994
986
|
/**
|
|
995
987
|
* 展示封面 这里不对 poster 进行缓存, 如果有值优先使用, 如果没有值优先使用 初始化传入的值
|
|
996
988
|
*/ _proto.show = function show() {
|
|
997
989
|
if (this.$container) {
|
|
998
990
|
this.$container.style.display = 'flex';
|
|
999
|
-
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
991
|
+
this.$container.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
1000
992
|
}
|
|
1001
993
|
};
|
|
1002
994
|
/**
|
|
@@ -1005,7 +997,7 @@
|
|
|
1005
997
|
var // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
1006
998
|
_this_$container_querySelector, _this_$container;
|
|
1007
999
|
Control.prototype.hide.call(this);
|
|
1008
|
-
(_this_$container = this.$container) == null ? void 0 : (_this_$container_querySelector = _this_$container.querySelector("." + PREFIX_CLASS + "-poster-img")) == null ? void 0 : _this_$container_querySelector.removeEventListener('error', this._imgLoadErrorEvent);
|
|
1000
|
+
(_this_$container = this.$container) == null ? void 0 : (_this_$container_querySelector = _this_$container.querySelector("." + PREFIX_CLASS$1 + "-poster-img")) == null ? void 0 : _this_$container_querySelector.removeEventListener('error', this._imgLoadErrorEvent);
|
|
1009
1001
|
};
|
|
1010
1002
|
/**
|
|
1011
1003
|
* 销毁
|
|
@@ -1019,7 +1011,7 @@
|
|
|
1019
1011
|
var Icons = {
|
|
1020
1012
|
/** 播放 */ 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>',
|
|
1021
1013
|
/** 暂停 */ 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>',
|
|
1022
|
-
/** 音量 */ volume: function(prefix) {
|
|
1014
|
+
/** 音量 */ volume: function volume(prefix) {
|
|
1023
1015
|
return '<svg width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" fill="none" focusable="false" aria-hidden="true" data-icon="volume">\n <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 <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 <!-- 音低 -->\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 <!-- 音高 -->\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 <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 <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>';
|
|
1024
1016
|
},
|
|
1025
1017
|
/** 全屏 */ 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>',
|
|
@@ -1045,7 +1037,7 @@
|
|
|
1045
1037
|
/** 录制/摄像机 */ 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>',
|
|
1046
1038
|
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 <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 ',
|
|
1047
1039
|
/** 对讲 */ talk: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="talk">\n <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>',
|
|
1048
|
-
talkGrowth: function(prefix) {
|
|
1040
|
+
talkGrowth: function talkGrowth(prefix) {
|
|
1049
1041
|
return '<svg width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="talk-growth">\n <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>';
|
|
1050
1042
|
},
|
|
1051
1043
|
/** 语音广播 */ broadcast: '\n <svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" stroke="none" focusable="false" aria-hidden="true" data-icon="broadcast">\n <g>\n <path id="矢量 1" d="m8.52109,6.76609l6.17823,-2.91335c0.2485,-0.11718 0.5027,-0.19531 0.7627,-0.2351c0.2034,-0.03077 0.4104,-0.03809 0.6211,-0.02173c0.2092,0.01636 0.4116,0.05493 0.6069,0.11621c0.2278,0.07129 0.4461,0.1731 0.6548,0.30542c0.2087,0.13232 0.394,0.28638 0.5557,0.46216l0.0002,0l0,0c0.1384,0.15064 0.2598,0.31714 0.3638,0.49951c0.1047,0.18335 0.1865,0.37354 0.2451,0.57081c0.0752,0.25219 0.1128,0.51562 0.1128,0.79004l0,10.64651c0,0.2744 -0.0376,0.5379 -0.1128,0.7901l0,0c-0.0586,0.197 -0.1404,0.3874 -0.2451,0.5708c-0.104,0.1823 -0.2254,0.3488 -0.364,0.4995c-0.1617,0.1758 -0.347,0.3298 -0.5557,0.4621c-0.2087,0.1324 -0.427,0.2342 -0.6548,0.3054c-0.1953,0.0611 -0.3977,0.0999 -0.6069,0.1163c-0.2107,0.0163 -0.4175,0.009 -0.6209,-0.0218c-0.2602,-0.0398 -0.5144,-0.1181 -0.7629,-0.2351l-5.45044,-2.5703l0,2.759c0,0.1036 -0.01831,0.1995 -0.05494,0.2879c-0.03662,0.0886 -0.09155,0.1692 -0.16479,0.2424c-0.14624,0.1465 -0.32324,0.2197 -0.53027,0.2197l-2,0c-0.14209,0 -0.27344,-0.0373 -0.39429,-0.112c-0.12085,-0.0745 -0.21289,-0.1756 -0.27661,-0.3025l-1.99268,-3.9856c-0.06225,-0.0234 -0.12402,-0.0481 -0.18555,-0.074c-0.26953,-0.114 -0.52417,-0.2502 -0.7644,-0.4084c-0.26636,-0.1758 -0.51489,-0.3789 -0.74512,-0.6094c-0.23047,-0.2302 -0.43359,-0.4788 -0.60937,-0.7451c-0.1582,-0.2403 -0.29444,-0.4949 -0.40845,-0.7644c-0.11328,-0.2679 -0.20068,-0.5413 -0.26245,-0.8206l0,0c-0.07398,-0.3347 -0.11108,-0.6775 -0.11108,-1.0286c0,-0.351 0.0371,-0.6938 0.11108,-1.0285c0.06177,-0.2793 0.14917,-0.5528 0.26245,-0.8206c0.11401,-0.26953 0.25025,-0.52417 0.40845,-0.7644c0.17578,-0.26636 0.3789,-0.5149 0.60937,-0.74512c0.23023,-0.23047 0.47876,-0.4336 0.74512,-0.60938l0,0c0.24023,-0.1582 0.49487,-0.29444 0.7644,-0.40845c0.26783,-0.11328 0.54126,-0.20068 0.82056,-0.26245l0,0l0,0l0,0c0.33472,-0.07398 0.67749,-0.11109 1.02857,-0.11109l2.93872,0c0.02636,-0.0166 0.05444,-0.03198 0.08349,-0.04589zm0.72876,8.47948l6.08937,2.8716c0.1287,0.0606 0.2598,0.0987 0.3935,0.114c0.0772,0.0088 0.1551,0.0103 0.2337,0.0042c0.0857,-0.0068 0.1687,-0.0217 0.2495,-0.0452c0.1133,-0.0329 0.2219,-0.0822 0.3257,-0.1479c0.104,-0.0659 0.1948,-0.1431 0.2729,-0.2317c0.0554,-0.063 0.1045,-0.1318 0.147,-0.2063c0.0393,-0.0686 0.0713,-0.1397 0.0962,-0.2131c0.043,-0.1277 0.0647,-0.2625 0.0647,-0.4046l0,-10.64651c0,-0.14209 -0.0217,-0.2771 -0.0647,-0.40454c-0.0249,-0.07349 -0.0569,-0.14454 -0.0962,-0.21314c-0.0425,-0.07471 -0.0916,-0.14331 -0.147,-0.2063c-0.0781,-0.08862 -0.1689,-0.16577 -0.2729,-0.23169c-0.1038,-0.06567 -0.2124,-0.11523 -0.3257,-0.14795c-0.0808,-0.02344 -0.1638,-0.03833 -0.2495,-0.04517c-0.0786,-0.0061 -0.1565,-0.00463 -0.2337,0.00415c-0.1337,0.01539 -0.2648,0.05347 -0.3935,0.11402l-6.09034,2.87208l0.00097,7.16405zm13.58447,-7.9121l-2,1c-0.3757,0.18775 -0.8184,0.04029 -1.0063,-0.33545c-0.0552,-0.11035 -0.0813,-0.22656 -0.0813,-0.34033c0,-0.27344 0.1516,-0.53321 0.4167,-0.66602l2,-1c0.3757,-0.18775 0.8186,-0.04004 1.0064,0.33545c0.0551,0.11035 0.0813,0.22656 0.0813,0.34033c0,0.27368 -0.1514,0.53345 -0.4168,0.66602zm-15.08544,8.9785l-2.08667,0l1.30029,2.6006l0.78638,0l0,-2.6006zm0,-7.99998l-2.25,0c-0.24976,0 -0.49317,0.02734 -0.73023,0.08179c-0.18188,0.04174 -0.36011,0.09961 -0.53467,0.17334c-0.17944,0.07593 -0.34961,0.1665 -0.51049,0.27124c-0.18702,0.12231 -0.36133,0.26416 -0.52271,0.42554c-0.16138,0.16137 -0.30322,0.33569 -0.42554,0.52267c-0.10473,0.1609 -0.19531,0.3311 -0.27124,0.5105c-0.07373,0.1746 -0.13159,0.3528 -0.17334,0.5347c-0.05444,0.2371 -0.08178,0.4805 -0.08178,0.7302c0,0.2498 0.02734,0.4932 0.08178,0.7303c0.04175,0.1818 0.09961,0.3601 0.17334,0.5346c0.07593,0.1795 0.16651,0.3496 0.27124,0.5105c0.12232,0.187 0.26416,0.3614 0.42554,0.5227c0.16138,0.1614 0.33569,0.3033 0.52271,0.4256c0.16088,0.1047 0.33105,0.1953 0.51049,0.2712c0.17456,0.0737 0.35279,0.1316 0.53467,0.1734c0.23706,0.0544 0.48047,0.0817 0.73023,0.0817l2.25097,0l-0.00097,-6.49998zm12.75004,2.60058l2,0c0.4199,0 0.75,0.3301 0.75,0.75c0,0.4199 -0.3301,0.75 -0.75,0.75l-2,0c-0.42,0 -0.75,-0.3301 -0.75,-0.75c0,-0.4199 0.33,-0.75 0.75,-0.75zm0.3354,4.0791l2,1c0.2654,0.1326 0.4168,0.3924 0.4168,0.6661c0,0.1137 -0.0262,0.2299 -0.0813,0.3403c-0.1878,0.3755 -0.6307,0.5232 -1.0064,0.3354l-2,-1c-0.2651,-0.1328 -0.4167,-0.3925 -0.4167,-0.666c0,-0.1138 0.0261,-0.23 0.0813,-0.3403c0.1879,-0.3758 0.6306,-0.5232 1.0063,-0.3355z" fill-rule="evenodd"/>\n </g>\n</svg>',
|
|
@@ -1084,176 +1076,172 @@
|
|
|
1084
1076
|
if (!(attr[key] === undefined || attr[key] === null)) attrStr += key + '="' + attr[key] + '"';
|
|
1085
1077
|
});
|
|
1086
1078
|
}
|
|
1087
|
-
return '<span class="' + PREFIX_CLASS + "-icon " + PREFIX_CLASS + "-icon-" + type + '" ' + attrStr + ">" + svg + "</span>";
|
|
1079
|
+
return '<span class="' + PREFIX_CLASS$1 + "-icon " + PREFIX_CLASS$1 + "-icon-" + type + '" ' + attrStr + ">" + svg + "</span>";
|
|
1088
1080
|
}
|
|
1089
1081
|
var IconComponents = {
|
|
1090
|
-
/** 播放 */ play: function(attr) {
|
|
1082
|
+
/** 播放 */ play: function play(attr) {
|
|
1091
1083
|
if (attr === void 0) attr = {};
|
|
1092
1084
|
return createIcon(Icons.play, 'play', attr);
|
|
1093
1085
|
},
|
|
1094
|
-
/** 暂停 */ pause: function(attr) {
|
|
1086
|
+
/** 暂停 */ pause: function pause(attr) {
|
|
1095
1087
|
if (attr === void 0) attr = {};
|
|
1096
1088
|
return createIcon(Icons.pause, 'pause', attr);
|
|
1097
1089
|
},
|
|
1098
|
-
volume: function(attr) {
|
|
1090
|
+
volume: function volume(attr) {
|
|
1099
1091
|
if (attr === void 0) attr = {};
|
|
1100
|
-
return createIcon(Icons.volume(PREFIX_CLASS), 'volume', attr);
|
|
1092
|
+
return createIcon(Icons.volume(PREFIX_CLASS$1), 'volume', attr);
|
|
1101
1093
|
},
|
|
1102
|
-
mobileFullscreen: function(attr) {
|
|
1094
|
+
mobileFullscreen: function mobileFullscreen(attr) {
|
|
1103
1095
|
if (attr === void 0) attr = {};
|
|
1104
1096
|
return createIcon(Icons.mobileFullscreen, 'mobile-fullscreen', attr);
|
|
1105
1097
|
},
|
|
1106
|
-
exitFullscreen: function(attr) {
|
|
1098
|
+
exitFullscreen: function exitFullscreen(attr) {
|
|
1107
1099
|
if (attr === void 0) attr = {};
|
|
1108
1100
|
return createIcon(Icons.exitFullscreen, 'exit-fullscreen', attr);
|
|
1109
1101
|
},
|
|
1110
|
-
fullscreen: function(attr) {
|
|
1102
|
+
fullscreen: function fullscreen(attr) {
|
|
1111
1103
|
if (attr === void 0) attr = {};
|
|
1112
1104
|
return createIcon(Icons.fullscreen, 'fullscreen', attr);
|
|
1113
1105
|
},
|
|
1114
|
-
exitGlobalFullscreen: function(attr) {
|
|
1106
|
+
exitGlobalFullscreen: function exitGlobalFullscreen(attr) {
|
|
1115
1107
|
if (attr === void 0) attr = {};
|
|
1116
1108
|
return createIcon(Icons.exitGlobalFullscreen, 'exit-global-fullscreen', attr);
|
|
1117
1109
|
},
|
|
1118
|
-
globalFullscreen: function(attr) {
|
|
1110
|
+
globalFullscreen: function globalFullscreen(attr) {
|
|
1119
1111
|
if (attr === void 0) attr = {};
|
|
1120
1112
|
return createIcon(Icons.globalFullscreen, 'global-fullscreen', attr);
|
|
1121
1113
|
},
|
|
1122
|
-
capturePicture: function(attr) {
|
|
1114
|
+
capturePicture: function capturePicture(attr) {
|
|
1123
1115
|
if (attr === void 0) attr = {};
|
|
1124
1116
|
return createIcon(Icons.capturePicture, 'capture-picture', attr);
|
|
1125
1117
|
},
|
|
1126
|
-
ptz: function(attr) {
|
|
1118
|
+
ptz: function ptz(attr) {
|
|
1127
1119
|
if (attr === void 0) attr = {};
|
|
1128
1120
|
return createIcon(Icons.ptz, 'ptz', attr);
|
|
1129
1121
|
},
|
|
1130
|
-
record: function(attr) {
|
|
1122
|
+
record: function record(attr) {
|
|
1131
1123
|
if (attr === void 0) attr = {};
|
|
1132
1124
|
return createIcon(Icons.record, 'record', attr);
|
|
1133
1125
|
},
|
|
1134
|
-
recordCircle: function(attr) {
|
|
1126
|
+
recordCircle: function recordCircle(attr) {
|
|
1135
1127
|
if (attr === void 0) attr = {};
|
|
1136
1128
|
return createIcon(Icons.recordCircle, 'record-circle', attr);
|
|
1137
1129
|
},
|
|
1138
|
-
talk: function(attr) {
|
|
1130
|
+
talk: function talk(attr) {
|
|
1139
1131
|
if (attr === void 0) attr = {};
|
|
1140
1132
|
return createIcon(Icons.talk, 'talk', attr);
|
|
1141
1133
|
},
|
|
1142
|
-
broadcast: function(attr) {
|
|
1134
|
+
broadcast: function broadcast(attr) {
|
|
1143
1135
|
if (attr === void 0) attr = {};
|
|
1144
1136
|
return createIcon(Icons.broadcast, 'broadcast', attr);
|
|
1145
1137
|
},
|
|
1146
|
-
aiChat: function(attr) {
|
|
1138
|
+
aiChat: function aiChat(attr) {
|
|
1147
1139
|
if (attr === void 0) attr = {};
|
|
1148
1140
|
return createIcon(Icons.aiChat, 'aiChat', attr);
|
|
1149
1141
|
},
|
|
1150
|
-
talkGrowth: function(attr) {
|
|
1142
|
+
talkGrowth: function talkGrowth(attr) {
|
|
1151
1143
|
if (attr === void 0) attr = {};
|
|
1152
|
-
return createIcon(Icons.talkGrowth(PREFIX_CLASS), 'talk-growth', attr);
|
|
1144
|
+
return createIcon(Icons.talkGrowth(PREFIX_CLASS$1), 'talk-growth', attr);
|
|
1153
1145
|
},
|
|
1154
|
-
zoom: function(attr) {
|
|
1146
|
+
zoom: function zoom(attr) {
|
|
1155
1147
|
if (attr === void 0) attr = {};
|
|
1156
1148
|
return createIcon(Icons.zoom, 'zoom', attr);
|
|
1157
1149
|
},
|
|
1158
|
-
more: function(attr) {
|
|
1150
|
+
more: function more(attr) {
|
|
1159
1151
|
if (attr === void 0) attr = {};
|
|
1160
1152
|
return createIcon(Icons.more, 'more', attr);
|
|
1161
1153
|
},
|
|
1162
|
-
moreDot: function(attr) {
|
|
1154
|
+
moreDot: function moreDot(attr) {
|
|
1163
1155
|
if (attr === void 0) attr = {};
|
|
1164
1156
|
return createIcon(Icons.moreDot, 'more-dot', attr);
|
|
1165
1157
|
},
|
|
1166
|
-
minusCircle: function(attr) {
|
|
1158
|
+
minusCircle: function minusCircle(attr) {
|
|
1167
1159
|
if (attr === void 0) attr = {};
|
|
1168
1160
|
return createIcon(Icons.minusCircle, 'minus-circle', attr);
|
|
1169
1161
|
},
|
|
1170
|
-
plusCircle: function(attr) {
|
|
1162
|
+
plusCircle: function plusCircle(attr) {
|
|
1171
1163
|
if (attr === void 0) attr = {};
|
|
1172
1164
|
return createIcon(Icons.plusCircle, 'plus-circle', attr);
|
|
1173
1165
|
},
|
|
1174
|
-
sdk: function(attr) {
|
|
1166
|
+
sdk: function sdk(attr) {
|
|
1175
1167
|
if (attr === void 0) attr = {};
|
|
1176
1168
|
return createIcon(Icons.sdk, 'sdk', attr);
|
|
1177
1169
|
},
|
|
1178
|
-
cloudRec: function(attr) {
|
|
1170
|
+
cloudRec: function cloudRec(attr) {
|
|
1179
1171
|
if (attr === void 0) attr = {};
|
|
1180
1172
|
return createIcon(Icons.cloudRec, 'cloud-rec', attr);
|
|
1181
1173
|
},
|
|
1182
|
-
cloudRecord: function(attr) {
|
|
1174
|
+
cloudRecord: function cloudRecord(attr) {
|
|
1183
1175
|
if (attr === void 0) attr = {};
|
|
1184
1176
|
return createIcon(Icons.cloudRecord, 'cloud-record', attr);
|
|
1185
1177
|
},
|
|
1186
|
-
error: function(attr) {
|
|
1178
|
+
error: function error(attr) {
|
|
1187
1179
|
if (attr === void 0) attr = {};
|
|
1188
1180
|
return createIcon(Icons.error, 'error', attr);
|
|
1189
1181
|
},
|
|
1190
|
-
info: function(attr) {
|
|
1182
|
+
info: function info(attr) {
|
|
1191
1183
|
if (attr === void 0) attr = {};
|
|
1192
1184
|
return createIcon(Icons.info, 'info', attr);
|
|
1193
1185
|
},
|
|
1194
|
-
close: function(attr) {
|
|
1186
|
+
close: function close(attr) {
|
|
1195
1187
|
if (attr === void 0) attr = {};
|
|
1196
1188
|
return createIcon(Icons.close, 'close', attr);
|
|
1197
1189
|
},
|
|
1198
|
-
closeCircleOutLined: function(attr) {
|
|
1190
|
+
closeCircleOutLined: function closeCircleOutLined(attr) {
|
|
1199
1191
|
if (attr === void 0) attr = {};
|
|
1200
1192
|
return createIcon(Icons.closeCircleOutLined, 'close-circle', attr);
|
|
1201
1193
|
},
|
|
1202
|
-
warnCircleOutLined: function(attr) {
|
|
1194
|
+
warnCircleOutLined: function warnCircleOutLined(attr) {
|
|
1203
1195
|
if (attr === void 0) attr = {};
|
|
1204
1196
|
return createIcon(Icons.warnCircleOutLined, 'warn-circle', attr);
|
|
1205
1197
|
},
|
|
1206
|
-
infoCircleOutLined: function(attr) {
|
|
1198
|
+
infoCircleOutLined: function infoCircleOutLined(attr) {
|
|
1207
1199
|
if (attr === void 0) attr = {};
|
|
1208
1200
|
return createIcon(Icons.infoCircleOutLined, 'info-circle', attr);
|
|
1209
1201
|
},
|
|
1210
|
-
date: function(attr) {
|
|
1202
|
+
date: function date(attr) {
|
|
1211
1203
|
if (attr === void 0) attr = {};
|
|
1212
1204
|
return createIcon(Icons.date, 'date', attr);
|
|
1213
1205
|
},
|
|
1214
|
-
filter: function(attr) {
|
|
1206
|
+
filter: function filter(attr) {
|
|
1215
1207
|
if (attr === void 0) attr = {};
|
|
1216
1208
|
return createIcon(Icons.filter, 'filter', attr);
|
|
1217
1209
|
},
|
|
1218
|
-
add: function(attr) {
|
|
1210
|
+
add: function add(attr) {
|
|
1219
1211
|
if (attr === void 0) attr = {};
|
|
1220
1212
|
return createIcon(Icons.add, 'add', attr);
|
|
1221
1213
|
},
|
|
1222
|
-
reduce: function(attr) {
|
|
1214
|
+
reduce: function reduce(attr) {
|
|
1223
1215
|
if (attr === void 0) attr = {};
|
|
1224
1216
|
return createIcon(Icons.reduce, 'reduce', attr);
|
|
1225
1217
|
},
|
|
1226
|
-
/** 直播 */ live: function(attr) {
|
|
1218
|
+
/** 直播 */ live: function live(attr) {
|
|
1227
1219
|
if (attr === void 0) attr = {};
|
|
1228
1220
|
return createIcon(Icons.live, 'live', attr);
|
|
1229
1221
|
},
|
|
1230
|
-
/** 回放 */ recDropdown: function(attr) {
|
|
1222
|
+
/** 回放 */ recDropdown: function recDropdown(attr) {
|
|
1231
1223
|
if (attr === void 0) attr = {};
|
|
1232
1224
|
return createIcon(Icons.recDropdown, 'rec-dropdown', attr);
|
|
1233
1225
|
},
|
|
1234
|
-
/** 录像列表 */ recList: function(attr) {
|
|
1226
|
+
/** 录像列表 */ recList: function recList(attr) {
|
|
1235
1227
|
if (attr === void 0) attr = {};
|
|
1236
1228
|
return createIcon(Icons.list, 'rec-list', attr);
|
|
1237
1229
|
},
|
|
1238
|
-
/** 消息 */ alarmMessage: function(attr) {
|
|
1230
|
+
/** 消息 */ alarmMessage: function alarmMessage(attr) {
|
|
1239
1231
|
if (attr === void 0) attr = {};
|
|
1240
1232
|
return createIcon(Icons.alarmMessage, 'alarm-message', attr);
|
|
1241
1233
|
},
|
|
1242
|
-
time: function(attr) {
|
|
1234
|
+
time: function time(attr) {
|
|
1243
1235
|
if (attr === void 0) attr = {};
|
|
1244
1236
|
return createIcon(Icons.time, 'time', attr);
|
|
1245
1237
|
}
|
|
1246
1238
|
};
|
|
1247
1239
|
|
|
1248
1240
|
function _extends$z() {
|
|
1249
|
-
_extends$z = Object.assign || function(target) {
|
|
1241
|
+
_extends$z = Object.assign || function assign(target) {
|
|
1250
1242
|
for(var i = 1; i < arguments.length; i++){
|
|
1251
1243
|
var source = arguments[i];
|
|
1252
|
-
for(var key in source)
|
|
1253
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1254
|
-
target[key] = source[key];
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1244
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
1257
1245
|
}
|
|
1258
1246
|
return target;
|
|
1259
1247
|
};
|
|
@@ -1293,7 +1281,7 @@
|
|
|
1293
1281
|
controlType: 'block'
|
|
1294
1282
|
}))) || this, _this._$toast = null;
|
|
1295
1283
|
_this.options = Object.assign({}, MESSAGE_DEFAULT_OPTIONS, options);
|
|
1296
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-message", "" + PREFIX_CLASS + "-hide"); // 默认隐藏 `${PREFIX_CLASS}-hide`
|
|
1284
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-message", "" + PREFIX_CLASS$1 + "-hide"); // 默认隐藏 `${PREFIX_CLASS}-hide`
|
|
1297
1285
|
return _this;
|
|
1298
1286
|
}
|
|
1299
1287
|
var _proto = Message.prototype;
|
|
@@ -1327,7 +1315,7 @@
|
|
|
1327
1315
|
* @param {number=} duration 认自动关闭延时,单位秒, 默认 0 不关闭, 需手动 调用 hide()
|
|
1328
1316
|
*/ _proto.error = function error(msg, duration) {
|
|
1329
1317
|
if (duration === void 0) duration = 0;
|
|
1330
|
-
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
1318
|
+
this._show(this._getIcon('error') + '<div class="' + PREFIX_CLASS$1 + '-message-msg">' + (msg || '') + "</div>", duration, 'error');
|
|
1331
1319
|
};
|
|
1332
1320
|
_proto._toast = function _toast(msg, type, duration) {
|
|
1333
1321
|
var _this = this;
|
|
@@ -1338,9 +1326,9 @@
|
|
|
1338
1326
|
if (this.options.rootContainer) {
|
|
1339
1327
|
if (!this._$toast) {
|
|
1340
1328
|
this._$toast = document.createElement('div');
|
|
1341
|
-
this._$toast.classList.add("" + PREFIX_CLASS + "-toast");
|
|
1329
|
+
this._$toast.classList.add("" + PREFIX_CLASS$1 + "-toast");
|
|
1342
1330
|
}
|
|
1343
|
-
this._$toast.innerHTML = '<div class="' + PREFIX_CLASS + '-toast-content">' + this._getIcon(type) + '<span class="' + PREFIX_CLASS + "-toast-msg " + PREFIX_CLASS + "-toast-" + type + '">' + (msg || '') + "</span></div>";
|
|
1331
|
+
this._$toast.innerHTML = '<div class="' + PREFIX_CLASS$1 + '-toast-content">' + this._getIcon(type) + '<span class="' + PREFIX_CLASS$1 + "-toast-msg " + PREFIX_CLASS$1 + "-toast-" + type + '">' + (msg || '') + "</span></div>";
|
|
1344
1332
|
this.options.rootContainer.appendChild(this._$toast);
|
|
1345
1333
|
if (duration > 0) {
|
|
1346
1334
|
this._toastTimer = setTimeout(function() {
|
|
@@ -1367,16 +1355,16 @@
|
|
|
1367
1355
|
clearTimeout(this._timer);
|
|
1368
1356
|
this._timer = null;
|
|
1369
1357
|
}
|
|
1370
|
-
this.$popupContainer.classList.add("" + PREFIX_CLASS + "-has-message", PREFIX_CLASS + "-has-message-" + type);
|
|
1358
|
+
this.$popupContainer.classList.add("" + PREFIX_CLASS$1 + "-has-message", PREFIX_CLASS$1 + "-has-message-" + type);
|
|
1371
1359
|
if (typeof this.options.render === 'function') {
|
|
1372
1360
|
//
|
|
1373
1361
|
this.$container.innerHTML = this.options.render(msg, duration, type);
|
|
1374
1362
|
} else {
|
|
1375
|
-
this.$container.innerHTML = '<div class="' + PREFIX_CLASS + "-message-content " + PREFIX_CLASS + "-message-" + type + '">' + (msg || '') + "</div>";
|
|
1363
|
+
this.$container.innerHTML = '<div class="' + PREFIX_CLASS$1 + "-message-content " + PREFIX_CLASS$1 + "-message-" + type + '">' + (msg || '') + "</div>";
|
|
1376
1364
|
}
|
|
1377
1365
|
//
|
|
1378
1366
|
this.$container.style.display = 'flex';
|
|
1379
|
-
this.$container.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
1367
|
+
this.$container.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
1380
1368
|
if (duration > 0) {
|
|
1381
1369
|
this._timer = setTimeout(function() {
|
|
1382
1370
|
_this.hide();
|
|
@@ -1408,7 +1396,7 @@
|
|
|
1408
1396
|
// 每次隐藏都清空内 消息内容
|
|
1409
1397
|
this.$container.innerHTML = '';
|
|
1410
1398
|
Array.from(this.$popupContainer.classList).forEach(function(className) {
|
|
1411
|
-
var regex = new RegExp("^" + PREFIX_CLASS + "-has-message", 'ig');
|
|
1399
|
+
var regex = new RegExp("^" + PREFIX_CLASS$1 + "-has-message", 'ig');
|
|
1412
1400
|
if (regex.test(className)) {
|
|
1413
1401
|
_this.$popupContainer.classList.remove(className);
|
|
1414
1402
|
}
|
|
@@ -1446,14 +1434,10 @@
|
|
|
1446
1434
|
return Constructor;
|
|
1447
1435
|
}
|
|
1448
1436
|
function _extends$y() {
|
|
1449
|
-
_extends$y = Object.assign || function(target) {
|
|
1437
|
+
_extends$y = Object.assign || function assign(target) {
|
|
1450
1438
|
for(var i = 1; i < arguments.length; i++){
|
|
1451
1439
|
var source = arguments[i];
|
|
1452
|
-
for(var key in source)
|
|
1453
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1454
|
-
target[key] = source[key];
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1440
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
1457
1441
|
}
|
|
1458
1442
|
return target;
|
|
1459
1443
|
};
|
|
@@ -2474,14 +2458,6 @@
|
|
|
2474
2458
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2475
2459
|
return arr2;
|
|
2476
2460
|
}
|
|
2477
|
-
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
2478
|
-
if (!o) return;
|
|
2479
|
-
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
2480
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2481
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2482
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2483
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
2484
|
-
}
|
|
2485
2461
|
function _create_for_of_iterator_helper_loose$3(o, allowArrayLike) {
|
|
2486
2462
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
2487
2463
|
if (it) return (it = it.call(o)).next.bind(it);
|
|
@@ -2489,18 +2465,24 @@
|
|
|
2489
2465
|
if (it) o = it;
|
|
2490
2466
|
var i = 0;
|
|
2491
2467
|
return function() {
|
|
2492
|
-
if (i >= o.length) {
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
};
|
|
2496
|
-
}
|
|
2468
|
+
if (i >= o.length) return {
|
|
2469
|
+
done: true
|
|
2470
|
+
};
|
|
2497
2471
|
return {
|
|
2498
2472
|
done: false,
|
|
2499
2473
|
value: o[i++]
|
|
2500
2474
|
};
|
|
2501
2475
|
};
|
|
2502
2476
|
}
|
|
2503
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance
|
|
2477
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2478
|
+
}
|
|
2479
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
2480
|
+
if (!o) return;
|
|
2481
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
2482
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2483
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2484
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2485
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
2504
2486
|
}
|
|
2505
2487
|
/**
|
|
2506
2488
|
* 工具类
|
|
@@ -2527,7 +2509,7 @@
|
|
|
2527
2509
|
*/ // prettier-ignore
|
|
2528
2510
|
Utils.orientationEventListener = function orientationEventListener(change) {
|
|
2529
2511
|
var _orientationTimer = null;
|
|
2530
|
-
var getOrientation = function() {
|
|
2512
|
+
var getOrientation = function getOrientation() {
|
|
2531
2513
|
var _screen, _window;
|
|
2532
2514
|
// 现代浏览器方案
|
|
2533
2515
|
if ((_screen = screen) == null ? void 0 : _screen.orientation) {
|
|
@@ -2564,7 +2546,7 @@
|
|
|
2564
2546
|
};
|
|
2565
2547
|
var orientation = getOrientation();
|
|
2566
2548
|
// 监听变化(兼容写法)
|
|
2567
|
-
var onOrientationChange = function() {
|
|
2549
|
+
var onOrientationChange = function onOrientationChange() {
|
|
2568
2550
|
var newOrientation = getOrientation == null ? void 0 : getOrientation();
|
|
2569
2551
|
// console.log("onOrientationChange", newOrientation, orientation)
|
|
2570
2552
|
// prettier-ignore
|
|
@@ -2573,7 +2555,7 @@
|
|
|
2573
2555
|
orientation = newOrientation;
|
|
2574
2556
|
}
|
|
2575
2557
|
};
|
|
2576
|
-
var onResize = function() {
|
|
2558
|
+
var onResize = function onResize() {
|
|
2577
2559
|
// 防抖处理
|
|
2578
2560
|
if (_orientationTimer) clearTimeout(_orientationTimer);
|
|
2579
2561
|
if (onOrientationChange) _orientationTimer = setTimeout(onOrientationChange, 200);
|
|
@@ -2628,7 +2610,7 @@
|
|
|
2628
2610
|
*/ // prettier-ignore
|
|
2629
2611
|
Utils.resizeObserver = function resizeObserver(node, callback) {
|
|
2630
2612
|
// prettier-ignore
|
|
2631
|
-
var observerFn = function(entries, observer) {
|
|
2613
|
+
var observerFn = function observerFn(entries, observer) {
|
|
2632
2614
|
for(var _iterator = _create_for_of_iterator_helper_loose$3(entries), _step; !(_step = _iterator()).done;){
|
|
2633
2615
|
var entry = _step.value;
|
|
2634
2616
|
if (entry.target === node) {
|
|
@@ -2692,9 +2674,9 @@
|
|
|
2692
2674
|
showPlus: false,
|
|
2693
2675
|
showMinus: false,
|
|
2694
2676
|
isRotated: false,
|
|
2695
|
-
onChange: function() {
|
|
2677
|
+
onChange: function onChange() {
|
|
2696
2678
|
/* no-op */ },
|
|
2697
|
-
renderText: function(_, percent) {
|
|
2679
|
+
renderText: function renderText(_, percent) {
|
|
2698
2680
|
return (percent * 100).toFixed(0);
|
|
2699
2681
|
}
|
|
2700
2682
|
};
|
|
@@ -2717,6 +2699,7 @@
|
|
|
2717
2699
|
* })
|
|
2718
2700
|
*/ var Progress = /*#__PURE__*/ function() {
|
|
2719
2701
|
function Progress(options) {
|
|
2702
|
+
var _this_options_defaultValue;
|
|
2720
2703
|
var _this_options_range;
|
|
2721
2704
|
this._percent = 0;
|
|
2722
2705
|
this._value = 0;
|
|
@@ -2738,7 +2721,6 @@
|
|
|
2738
2721
|
this.$container = options.container;
|
|
2739
2722
|
this._render();
|
|
2740
2723
|
this._eventListeners();
|
|
2741
|
-
var _this_options_defaultValue;
|
|
2742
2724
|
var value = (_this_options_defaultValue = this.options.defaultValue) != null ? _this_options_defaultValue : this.options.range[0]; // 设置默认值
|
|
2743
2725
|
this._value = +value.toFixed(2); // 保留两位小数
|
|
2744
2726
|
// prettier-ignore
|
|
@@ -2811,38 +2793,38 @@
|
|
|
2811
2793
|
this._percent = +((value - this.options.range[0]) / (this.options.range[1] - this.options.range[0])).toFixed(2);
|
|
2812
2794
|
};
|
|
2813
2795
|
_proto._render = function _render() {
|
|
2814
|
-
this.$content = document.createElement('div');
|
|
2815
2796
|
var _this_options_className;
|
|
2816
|
-
this.$content
|
|
2817
|
-
this.$content.
|
|
2797
|
+
this.$content = document.createElement('div');
|
|
2798
|
+
this.$content.className = PREFIX_CLASS$1 + "-progress " + ((_this_options_className = this.options.className) != null ? _this_options_className : '');
|
|
2799
|
+
this.$content.innerHTML = (this.options.showPercent ? '<div class="' + PREFIX_CLASS$1 + '-progress-text">' + (this.options.renderText == null ? void 0 : this.options.renderText.call(this.options, this._value, this._percent, this.options.range)) + "</div>" : '') + "\n " + (this.options.showPlus ? '<div class="' + PREFIX_CLASS$1 + '-progress-plus">\n ' + IconComponents.plusCircle() + "\n </div>" : '') + '\n <div class="' + PREFIX_CLASS$1 + '-progress-slider">\n <div class="' + PREFIX_CLASS$1 + '-progress-slider-fill"></div>\n <div class="' + PREFIX_CLASS$1 + '-progress-slider-handle" style="top: 100%"></div>\n </div>\n ' + (this.options.showMinus ? '<div class="' + PREFIX_CLASS$1 + '-progress-minus">\n ' + IconComponents.minusCircle() + "\n </div>" : '');
|
|
2818
2800
|
this.$container.appendChild(this.$content);
|
|
2819
2801
|
};
|
|
2820
2802
|
_proto._updateUI = function _updateUI() {
|
|
2821
2803
|
var $progress = this.$content;
|
|
2822
2804
|
$progress == null ? void 0 : $progress.setAttribute('data-value', this._value + '');
|
|
2823
2805
|
// prettier-ignore
|
|
2824
|
-
if ($progress.querySelector("." + PREFIX_CLASS + "-progress-slider-fill")) {
|
|
2806
|
+
if ($progress.querySelector("." + PREFIX_CLASS$1 + "-progress-slider-fill")) {
|
|
2825
2807
|
var percent = +(this._percent * 100).toFixed(0);
|
|
2826
2808
|
if (this.options.showPercent) {
|
|
2827
|
-
$progress.querySelector("." + PREFIX_CLASS + "-progress-text").innerHTML = this.options.renderText == null ? void 0 : this.options.renderText.call(this.options, this._value, this._percent, this.options.range);
|
|
2809
|
+
$progress.querySelector("." + PREFIX_CLASS$1 + "-progress-text").innerHTML = this.options.renderText == null ? void 0 : this.options.renderText.call(this.options, this._value, this._percent, this.options.range);
|
|
2828
2810
|
}
|
|
2829
|
-
$progress.querySelector("." + PREFIX_CLASS + "-progress-slider-fill").style.height = percent + '%';
|
|
2830
|
-
$progress.querySelector("." + PREFIX_CLASS + "-progress-slider-handle").style.top = 100 - percent + '%';
|
|
2811
|
+
$progress.querySelector("." + PREFIX_CLASS$1 + "-progress-slider-fill").style.height = percent + '%';
|
|
2812
|
+
$progress.querySelector("." + PREFIX_CLASS$1 + "-progress-slider-handle").style.top = 100 - percent + '%';
|
|
2831
2813
|
}
|
|
2832
2814
|
};
|
|
2833
2815
|
_proto._eventListeners = function _eventListeners() {
|
|
2834
2816
|
var _this = this;
|
|
2835
2817
|
var mousedownName = window.PointerEvent ? 'pointerdown' : 'mousedown';
|
|
2836
2818
|
// prettier-ignore
|
|
2837
|
-
this._delegateSliderMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider", mousedownName, function(e) {
|
|
2819
|
+
this._delegateSliderMouseDown = delegate(this.$content, "." + PREFIX_CLASS$1 + "-progress-slider", mousedownName, function(e) {
|
|
2838
2820
|
var // 垂直方向Y轴是反的,所以用高度减去点击位置
|
|
2839
2821
|
_this_options_onProgressClick, _this_options;
|
|
2840
2822
|
e.stopPropagation();
|
|
2841
|
-
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2823
|
+
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS$1 + "-disabled") || _this._disabled) {
|
|
2842
2824
|
return;
|
|
2843
2825
|
}
|
|
2844
2826
|
// prettier-ignore
|
|
2845
|
-
var rect = _this.$content.querySelector("." + PREFIX_CLASS + "-progress-slider").getBoundingClientRect();
|
|
2827
|
+
var rect = _this.$content.querySelector("." + PREFIX_CLASS$1 + "-progress-slider").getBoundingClientRect();
|
|
2846
2828
|
var percent = 0;
|
|
2847
2829
|
// 兼容移动端节点旋转 90度角
|
|
2848
2830
|
if (Utils.isMobile && _this._isRotated) {
|
|
@@ -2859,17 +2841,17 @@
|
|
|
2859
2841
|
_this.percent = percent;
|
|
2860
2842
|
});
|
|
2861
2843
|
// prettier-ignore
|
|
2862
|
-
this._delegateSliderHandleMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider-handle", mousedownName, function(e) {
|
|
2844
|
+
this._delegateSliderHandleMouseDown = delegate(this.$content, "." + PREFIX_CLASS$1 + "-progress-slider-handle", mousedownName, function(e) {
|
|
2863
2845
|
e.stopPropagation();
|
|
2864
2846
|
if (!_this.options.draggable) {
|
|
2865
2847
|
return;
|
|
2866
2848
|
}
|
|
2867
|
-
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2849
|
+
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS$1 + "-disabled") || _this._disabled) {
|
|
2868
2850
|
return;
|
|
2869
2851
|
}
|
|
2870
2852
|
var startY = _this._isRotated ? e.clientX : e.clientY;
|
|
2871
|
-
var startHeight = _this.$content.querySelector("." + PREFIX_CLASS + "-progress-slider-fill").offsetHeight;
|
|
2872
|
-
var sliderHeight = _this.$content.querySelector("." + PREFIX_CLASS + "-progress-slider").offsetHeight;
|
|
2853
|
+
var startHeight = _this.$content.querySelector("." + PREFIX_CLASS$1 + "-progress-slider-fill").offsetHeight;
|
|
2854
|
+
var sliderHeight = _this.$content.querySelector("." + PREFIX_CLASS$1 + "-progress-slider").offsetHeight;
|
|
2873
2855
|
var handleMouseMove = throttle(function(e) {
|
|
2874
2856
|
e.stopPropagation();
|
|
2875
2857
|
if (!_this.options.draggable || _this._disabled) {
|
|
@@ -2899,9 +2881,9 @@
|
|
|
2899
2881
|
// plug
|
|
2900
2882
|
if (this.options.showPlus) {
|
|
2901
2883
|
var clickName = window.PointerEvent ? 'pointerdown' : 'click';
|
|
2902
|
-
this._delegatePlusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-plus", clickName, function(e) {
|
|
2884
|
+
this._delegatePlusClick = delegate(this.$content, "." + PREFIX_CLASS$1 + "-progress-plus", clickName, function(e) {
|
|
2903
2885
|
e.stopPropagation();
|
|
2904
|
-
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2886
|
+
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS$1 + "-disabled") || _this._disabled) {
|
|
2905
2887
|
return;
|
|
2906
2888
|
}
|
|
2907
2889
|
var value = _this._value + _this.options.step;
|
|
@@ -2917,9 +2899,9 @@
|
|
|
2917
2899
|
if (this.options.showMinus) {
|
|
2918
2900
|
var clickName1 = window.PointerEvent ? 'pointerdown' : 'click';
|
|
2919
2901
|
// prettier-ignore
|
|
2920
|
-
this._delegateMinusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-minus", clickName1, function(e) {
|
|
2902
|
+
this._delegateMinusClick = delegate(this.$content, "." + PREFIX_CLASS$1 + "-progress-minus", clickName1, function(e) {
|
|
2921
2903
|
e.stopPropagation();
|
|
2922
|
-
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
|
|
2904
|
+
if (e.delegateTarget.classList.contains("" + PREFIX_CLASS$1 + "-disabled") || _this._disabled) {
|
|
2923
2905
|
return;
|
|
2924
2906
|
}
|
|
2925
2907
|
var value = _this._value - _this.options.step;
|
|
@@ -2937,7 +2919,7 @@
|
|
|
2937
2919
|
'touchmove',
|
|
2938
2920
|
'dblclick'
|
|
2939
2921
|
].forEach(function(name) {
|
|
2940
|
-
delegate(_this.$container, "." + PREFIX_CLASS + "-progress", name, function(e) {
|
|
2922
|
+
delegate(_this.$container, "." + PREFIX_CLASS$1 + "-progress", name, function(e) {
|
|
2941
2923
|
e.stopPropagation();
|
|
2942
2924
|
e.preventDefault(); // 阻止默认的触摸行为
|
|
2943
2925
|
});
|
|
@@ -3005,14 +2987,10 @@
|
|
|
3005
2987
|
return Constructor;
|
|
3006
2988
|
}
|
|
3007
2989
|
function _extends$x() {
|
|
3008
|
-
_extends$x = Object.assign || function(target) {
|
|
2990
|
+
_extends$x = Object.assign || function assign(target) {
|
|
3009
2991
|
for(var i = 1; i < arguments.length; i++){
|
|
3010
2992
|
var source = arguments[i];
|
|
3011
|
-
for(var key in source)
|
|
3012
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3013
|
-
target[key] = source[key];
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
2993
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
3016
2994
|
}
|
|
3017
2995
|
return target;
|
|
3018
2996
|
};
|
|
@@ -3043,8 +3021,8 @@
|
|
|
3043
3021
|
muted: false,
|
|
3044
3022
|
open: false,
|
|
3045
3023
|
trigger: 'hover',
|
|
3046
|
-
onOpenChange: function() {},
|
|
3047
|
-
onChange: function() {}
|
|
3024
|
+
onOpenChange: function onOpenChange() {},
|
|
3025
|
+
onChange: function onChange() {}
|
|
3048
3026
|
};
|
|
3049
3027
|
/**
|
|
3050
3028
|
* 音量调节控件
|
|
@@ -3072,7 +3050,7 @@
|
|
|
3072
3050
|
if (!(Utils.isMobile || _this._options.PLAY_TYPE === 'ezopen' || _this._options.PLAY_TYPE === 'ezhls')) {
|
|
3073
3051
|
var _this__options_props4, _this__options_props5;
|
|
3074
3052
|
_this.picker = new Picker(_this.$container, {
|
|
3075
|
-
getPopupContainer: function() {
|
|
3053
|
+
getPopupContainer: function getPopupContainer() {
|
|
3076
3054
|
return _this.$container;
|
|
3077
3055
|
},
|
|
3078
3056
|
trigger: _this._options.trigger,
|
|
@@ -3083,7 +3061,7 @@
|
|
|
3083
3061
|
-10
|
|
3084
3062
|
],
|
|
3085
3063
|
placement: 'top',
|
|
3086
|
-
onOpenChange: function(open) {
|
|
3064
|
+
onOpenChange: function onOpenChange(open) {
|
|
3087
3065
|
_this._options.onOpenChange == null ? void 0 : _this._options.onOpenChange.call(_this._options, open, _this._muted ? _this._lastVolume : _this.volume, _this._muted);
|
|
3088
3066
|
// prettier-ignore
|
|
3089
3067
|
_this.emit(EVENTS$2.control.volumePanelOpenChange, open, _this._lastVolume, _this._muted);
|
|
@@ -3098,12 +3076,12 @@
|
|
|
3098
3076
|
],
|
|
3099
3077
|
step: 0.1,
|
|
3100
3078
|
showPercent: true,
|
|
3101
|
-
className: "" + PREFIX_CLASS + "-volume-progress",
|
|
3079
|
+
className: "" + PREFIX_CLASS$1 + "-volume-progress",
|
|
3102
3080
|
// 为了解决点击进度调取消静音
|
|
3103
|
-
onProgressClick: function() {
|
|
3081
|
+
onProgressClick: function onProgressClick() {
|
|
3104
3082
|
_this.muted = false;
|
|
3105
3083
|
},
|
|
3106
|
-
onChange: function(value) {
|
|
3084
|
+
onChange: function onChange(value) {
|
|
3107
3085
|
if (value !== _this._volume) _this.volume = value;
|
|
3108
3086
|
}
|
|
3109
3087
|
});
|
|
@@ -3151,26 +3129,26 @@
|
|
|
3151
3129
|
}
|
|
3152
3130
|
};
|
|
3153
3131
|
_proto._updateUI = function _updateUI() {
|
|
3154
|
-
this._$content.classList.remove(PREFIX_CLASS + '-icon-volume-muted');
|
|
3155
|
-
this._$content.classList.remove(PREFIX_CLASS + '-icon-volume-zero');
|
|
3156
|
-
this._$content.classList.remove(PREFIX_CLASS + '-icon-volume-low');
|
|
3157
|
-
this._$content.classList.remove(PREFIX_CLASS + '-icon-volume-high');
|
|
3132
|
+
this._$content.classList.remove(PREFIX_CLASS$1 + '-icon-volume-muted');
|
|
3133
|
+
this._$content.classList.remove(PREFIX_CLASS$1 + '-icon-volume-zero');
|
|
3134
|
+
this._$content.classList.remove(PREFIX_CLASS$1 + '-icon-volume-low');
|
|
3135
|
+
this._$content.classList.remove(PREFIX_CLASS$1 + '-icon-volume-high');
|
|
3158
3136
|
if (this._muted) {
|
|
3159
3137
|
var // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
3160
3138
|
_this_locale, _this;
|
|
3161
3139
|
this._volume = 0;
|
|
3162
|
-
this._$content.classList.add(PREFIX_CLASS + '-icon-volume-muted');
|
|
3140
|
+
this._$content.classList.add(PREFIX_CLASS$1 + '-icon-volume-muted');
|
|
3163
3141
|
this._$content.setAttribute('title', ((_this = this) == null ? void 0 : (_this_locale = _this.locale) == null ? void 0 : _this_locale.BTN_MUTED) || 'muted');
|
|
3164
3142
|
} else {
|
|
3165
3143
|
var // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
3166
3144
|
_this_locale1, _this1;
|
|
3167
|
-
this._$content.classList.remove(PREFIX_CLASS + '-icon-volume-muted');
|
|
3145
|
+
this._$content.classList.remove(PREFIX_CLASS$1 + '-icon-volume-muted');
|
|
3168
3146
|
if (this._volume === 0) {
|
|
3169
|
-
this._$content.classList.add(PREFIX_CLASS + '-icon-volume-zero');
|
|
3147
|
+
this._$content.classList.add(PREFIX_CLASS$1 + '-icon-volume-zero');
|
|
3170
3148
|
} else if (this._volume <= 0.5) {
|
|
3171
|
-
this._$content.classList.add(PREFIX_CLASS + '-icon-volume-low');
|
|
3149
|
+
this._$content.classList.add(PREFIX_CLASS$1 + '-icon-volume-low');
|
|
3172
3150
|
} else {
|
|
3173
|
-
this._$content.classList.add(PREFIX_CLASS + '-icon-volume-high');
|
|
3151
|
+
this._$content.classList.add(PREFIX_CLASS$1 + '-icon-volume-high');
|
|
3174
3152
|
}
|
|
3175
3153
|
this._$content.setAttribute('title', ((_this1 = this) == null ? void 0 : (_this_locale1 = _this1.locale) == null ? void 0 : _this_locale1.BTN_VOLUME) || 'volume');
|
|
3176
3154
|
}
|
|
@@ -3190,8 +3168,8 @@
|
|
|
3190
3168
|
var _this = this;
|
|
3191
3169
|
// 这里不要用 click 事件,因为拖动音量大小时鼠标移动到图标上会触发 click
|
|
3192
3170
|
// prettier-ignore
|
|
3193
|
-
delegate(this.$container, "." + PREFIX_CLASS + "-control-volume", "mousedown", function() {
|
|
3194
|
-
if (!_this.$container.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
3171
|
+
delegate(this.$container, "." + PREFIX_CLASS$1 + "-control-volume", "mousedown", function() {
|
|
3172
|
+
if (!_this.$container.classList.contains("" + PREFIX_CLASS$1 + "-disabled")) {
|
|
3195
3173
|
_this._toggleMute();
|
|
3196
3174
|
}
|
|
3197
3175
|
});
|
|
@@ -3265,7 +3243,7 @@
|
|
|
3265
3243
|
key: "_$content",
|
|
3266
3244
|
get: function get() {
|
|
3267
3245
|
// prettier-ignore
|
|
3268
|
-
return this.$container.querySelector("." + PREFIX_CLASS + "-icon-volume");
|
|
3246
|
+
return this.$container.querySelector("." + PREFIX_CLASS$1 + "-icon-volume");
|
|
3269
3247
|
}
|
|
3270
3248
|
}
|
|
3271
3249
|
]);
|
|
@@ -3479,11 +3457,8 @@
|
|
|
3479
3457
|
reject(error);
|
|
3480
3458
|
return;
|
|
3481
3459
|
}
|
|
3482
|
-
if (info.done)
|
|
3483
|
-
|
|
3484
|
-
} else {
|
|
3485
|
-
Promise.resolve(value).then(_next, _throw);
|
|
3486
|
-
}
|
|
3460
|
+
if (info.done) resolve(value);
|
|
3461
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
3487
3462
|
}
|
|
3488
3463
|
function _async_to_generator$8(fn) {
|
|
3489
3464
|
return function() {
|
|
@@ -3509,9 +3484,17 @@
|
|
|
3509
3484
|
},
|
|
3510
3485
|
trys: [],
|
|
3511
3486
|
ops: []
|
|
3512
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
3513
|
-
return
|
|
3514
|
-
|
|
3487
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
3488
|
+
return d(g, "next", {
|
|
3489
|
+
value: verb(0)
|
|
3490
|
+
}), d(g, "throw", {
|
|
3491
|
+
value: verb(1)
|
|
3492
|
+
}), d(g, "return", {
|
|
3493
|
+
value: verb(2)
|
|
3494
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
3495
|
+
value: function() {
|
|
3496
|
+
return this;
|
|
3497
|
+
}
|
|
3515
3498
|
}), g;
|
|
3516
3499
|
function verb(n) {
|
|
3517
3500
|
return function(v) {
|
|
@@ -3915,14 +3898,10 @@
|
|
|
3915
3898
|
}();
|
|
3916
3899
|
|
|
3917
3900
|
function _extends$w() {
|
|
3918
|
-
_extends$w = Object.assign || function(target) {
|
|
3901
|
+
_extends$w = Object.assign || function assign(target) {
|
|
3919
3902
|
for(var i = 1; i < arguments.length; i++){
|
|
3920
3903
|
var source = arguments[i];
|
|
3921
|
-
for(var key in source)
|
|
3922
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3923
|
-
target[key] = source[key];
|
|
3924
|
-
}
|
|
3925
|
-
}
|
|
3904
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
3926
3905
|
}
|
|
3927
3906
|
return target;
|
|
3928
3907
|
};
|
|
@@ -4022,14 +4001,10 @@
|
|
|
4022
4001
|
}(Control);
|
|
4023
4002
|
|
|
4024
4003
|
function _extends$v() {
|
|
4025
|
-
_extends$v = Object.assign || function(target) {
|
|
4004
|
+
_extends$v = Object.assign || function assign(target) {
|
|
4026
4005
|
for(var i = 1; i < arguments.length; i++){
|
|
4027
4006
|
var source = arguments[i];
|
|
4028
|
-
for(var key in source)
|
|
4029
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
4030
|
-
target[key] = source[key];
|
|
4031
|
-
}
|
|
4032
|
-
}
|
|
4007
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
4033
4008
|
}
|
|
4034
4009
|
return target;
|
|
4035
4010
|
};
|
|
@@ -4120,30 +4095,30 @@
|
|
|
4120
4095
|
}
|
|
4121
4096
|
};
|
|
4122
4097
|
_proto._activeIcon = function _activeIcon(type) {
|
|
4123
|
-
var $list = this.$container.querySelectorAll("." + PREFIX_CLASS + "-icon");
|
|
4098
|
+
var $list = this.$container.querySelectorAll("." + PREFIX_CLASS$1 + "-icon");
|
|
4124
4099
|
$list.forEach(function($item) {
|
|
4125
|
-
$item.classList.remove("" + PREFIX_CLASS + "-active");
|
|
4100
|
+
$item.classList.remove("" + PREFIX_CLASS$1 + "-active");
|
|
4126
4101
|
});
|
|
4127
4102
|
switch(type){
|
|
4128
4103
|
case 'rec':
|
|
4129
4104
|
var _this_$container_querySelector;
|
|
4130
|
-
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS + "-icon-sdk")) == null ? void 0 : _this_$container_querySelector.classList.add("" + PREFIX_CLASS + "-active");
|
|
4105
|
+
(_this_$container_querySelector = this.$container.querySelector("." + PREFIX_CLASS$1 + "-icon-sdk")) == null ? void 0 : _this_$container_querySelector.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
4131
4106
|
break;
|
|
4132
4107
|
case 'cloudRec':
|
|
4133
4108
|
var _this_$container_querySelector1;
|
|
4134
|
-
(_this_$container_querySelector1 = this.$container.querySelector("." + PREFIX_CLASS + "-icon-cloud-rec")) == null ? void 0 : _this_$container_querySelector1.classList.add("" + PREFIX_CLASS + "-active");
|
|
4109
|
+
(_this_$container_querySelector1 = this.$container.querySelector("." + PREFIX_CLASS$1 + "-icon-cloud-rec")) == null ? void 0 : _this_$container_querySelector1.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
4135
4110
|
break;
|
|
4136
4111
|
case 'cloudRecord':
|
|
4137
4112
|
var _this_$container_querySelector2;
|
|
4138
|
-
(_this_$container_querySelector2 = this.$container.querySelector("." + PREFIX_CLASS + "-icon-cloud-record")) == null ? void 0 : _this_$container_querySelector2.classList.add("" + PREFIX_CLASS + "-active");
|
|
4113
|
+
(_this_$container_querySelector2 = this.$container.querySelector("." + PREFIX_CLASS$1 + "-icon-cloud-record")) == null ? void 0 : _this_$container_querySelector2.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
4139
4114
|
break;
|
|
4140
4115
|
}
|
|
4141
4116
|
};
|
|
4142
4117
|
_proto._onClickIcon = function _onClickIcon() {
|
|
4143
4118
|
var _this = this;
|
|
4144
|
-
this._delegation = delegate(this.$container, "." + PREFIX_CLASS + "-icon", 'click', function(e) {
|
|
4119
|
+
this._delegation = delegate(this.$container, "." + PREFIX_CLASS$1 + "-icon", 'click', function(e) {
|
|
4145
4120
|
var target = e.delegateTarget;
|
|
4146
|
-
if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
4121
|
+
if (!target.classList.contains("" + PREFIX_CLASS$1 + "-disabled")) {
|
|
4147
4122
|
var type = target.getAttribute('data-type');
|
|
4148
4123
|
if (_this.recType !== type) {
|
|
4149
4124
|
_this.recType = type;
|
|
@@ -5487,11 +5462,11 @@
|
|
|
5487
5462
|
_this.options = options;
|
|
5488
5463
|
_this._scaleMode = options.scaleMode || 0;
|
|
5489
5464
|
_this.$wrapper = document.createElement('div');
|
|
5490
|
-
_this.$wrapper.className = "" + PREFIX_CLASS + "-content-wrapper";
|
|
5465
|
+
_this.$wrapper.className = "" + PREFIX_CLASS$1 + "-content-wrapper";
|
|
5491
5466
|
_this.$content = document.createElement('div');
|
|
5492
|
-
_this.$content.className = "" + PREFIX_CLASS + "-content";
|
|
5467
|
+
_this.$content.className = "" + PREFIX_CLASS$1 + "-content";
|
|
5493
5468
|
_this.$video = document.createElement('div');
|
|
5494
|
-
_this.$video.className = "" + PREFIX_CLASS + "-content-video";
|
|
5469
|
+
_this.$video.className = "" + PREFIX_CLASS$1 + "-content-video";
|
|
5495
5470
|
_this.$content.appendChild(_this.$video);
|
|
5496
5471
|
_this.$wrapper.appendChild(_this.$content);
|
|
5497
5472
|
if (typeof options.getContainer === 'function') {
|
|
@@ -5593,17 +5568,13 @@
|
|
|
5593
5568
|
this.removeAllListeners();
|
|
5594
5569
|
};
|
|
5595
5570
|
return Content;
|
|
5596
|
-
}(EventEmitter
|
|
5571
|
+
}(EventEmitter);
|
|
5597
5572
|
|
|
5598
5573
|
function _extends$u() {
|
|
5599
|
-
_extends$u = Object.assign || function(target) {
|
|
5574
|
+
_extends$u = Object.assign || function assign(target) {
|
|
5600
5575
|
for(var i = 1; i < arguments.length; i++){
|
|
5601
5576
|
var source = arguments[i];
|
|
5602
|
-
for(var key in source)
|
|
5603
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5604
|
-
target[key] = source[key];
|
|
5605
|
-
}
|
|
5606
|
-
}
|
|
5577
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
5607
5578
|
}
|
|
5608
5579
|
return target;
|
|
5609
5580
|
};
|
|
@@ -5655,11 +5626,11 @@
|
|
|
5655
5626
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_MORE
|
|
5656
5627
|
});
|
|
5657
5628
|
this.picker = new Picker(this.$container, {
|
|
5658
|
-
getPopupContainer: function() {
|
|
5629
|
+
getPopupContainer: function getPopupContainer() {
|
|
5659
5630
|
return _this.$container;
|
|
5660
5631
|
},
|
|
5661
5632
|
trigger: Utils.isMobile ? 'click' : 'hover',
|
|
5662
|
-
wrapClassName: PREFIX_CLASS + "-more " + this.options.wrapClassName,
|
|
5633
|
+
wrapClassName: PREFIX_CLASS$1 + "-more " + this.options.wrapClassName,
|
|
5663
5634
|
open: !!this.options.open,
|
|
5664
5635
|
isMobile: false,
|
|
5665
5636
|
offset: this.options.offset || [
|
|
@@ -5671,7 +5642,7 @@
|
|
|
5671
5642
|
});
|
|
5672
5643
|
if (this.picker.$body) {
|
|
5673
5644
|
this.$panel = document.createElement('div');
|
|
5674
|
-
this.$panel.classList.add("" + PREFIX_CLASS + "-more-panel");
|
|
5645
|
+
this.$panel.classList.add("" + PREFIX_CLASS$1 + "-more-panel");
|
|
5675
5646
|
this.picker.$body.appendChild(this.$panel);
|
|
5676
5647
|
this.picker.$body.addEventListener('dblclick', this._onDBlClick);
|
|
5677
5648
|
}
|
|
@@ -6394,14 +6365,10 @@
|
|
|
6394
6365
|
return Constructor;
|
|
6395
6366
|
}
|
|
6396
6367
|
function _extends$t() {
|
|
6397
|
-
_extends$t = Object.assign || function(target) {
|
|
6368
|
+
_extends$t = Object.assign || function assign(target) {
|
|
6398
6369
|
for(var i = 1; i < arguments.length; i++){
|
|
6399
6370
|
var source = arguments[i];
|
|
6400
|
-
for(var key in source)
|
|
6401
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6402
|
-
target[key] = source[key];
|
|
6403
|
-
}
|
|
6404
|
-
}
|
|
6371
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
6405
6372
|
}
|
|
6406
6373
|
return target;
|
|
6407
6374
|
};
|
|
@@ -6460,7 +6427,7 @@
|
|
|
6460
6427
|
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_ZOOM
|
|
6461
6428
|
});
|
|
6462
6429
|
this._$zoomPanel = document.createElement('div');
|
|
6463
|
-
this._$zoomPanel.className = PREFIX_CLASS + "-zoom-panel " + PREFIX_CLASS + "-hide";
|
|
6430
|
+
this._$zoomPanel.className = PREFIX_CLASS$1 + "-zoom-panel " + PREFIX_CLASS$1 + "-hide";
|
|
6464
6431
|
(_this__options_rootContainer = this._options.rootContainer) == null ? void 0 : _this__options_rootContainer.appendChild(this._$zoomPanel);
|
|
6465
6432
|
// 最大值小于1 默认为 8 倍数, 最大值向下取整
|
|
6466
6433
|
var max = this._options.max <= 1 ? 8 : Math.floor(this._options.max);
|
|
@@ -6480,14 +6447,14 @@
|
|
|
6480
6447
|
showPlus: true,
|
|
6481
6448
|
showPercent: true,
|
|
6482
6449
|
isRotated: this._isRotated,
|
|
6483
|
-
onChange: function(value, percent, range) {
|
|
6450
|
+
onChange: function onChange(value, percent, range) {
|
|
6484
6451
|
if (value !== _this._value) {
|
|
6485
6452
|
_this._value = value;
|
|
6486
6453
|
_this._options.onChange == null ? void 0 : _this._options.onChange.call(_this._options, value, percent, range);
|
|
6487
6454
|
_this.emit(EVENTS$2.control.zoomChange, value, percent, range);
|
|
6488
6455
|
}
|
|
6489
6456
|
},
|
|
6490
|
-
renderText: function(value) {
|
|
6457
|
+
renderText: function renderText(value) {
|
|
6491
6458
|
return "" + value + "X";
|
|
6492
6459
|
}
|
|
6493
6460
|
});
|
|
@@ -6495,7 +6462,7 @@
|
|
|
6495
6462
|
_proto.reset = function reset(hide) {
|
|
6496
6463
|
if (this.active) {
|
|
6497
6464
|
var _this__$zoomPanel_classList, _this__$zoomPanel;
|
|
6498
|
-
(_this__$zoomPanel = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList = _this__$zoomPanel.classList) == null ? void 0 : _this__$zoomPanel_classList.add("" + PREFIX_CLASS + "-hide");
|
|
6465
|
+
(_this__$zoomPanel = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList = _this__$zoomPanel.classList) == null ? void 0 : _this__$zoomPanel_classList.add("" + PREFIX_CLASS$1 + "-hide");
|
|
6499
6466
|
this._progress.value = 1;
|
|
6500
6467
|
this.active = false;
|
|
6501
6468
|
Control.prototype.reset.call(this, hide);
|
|
@@ -6541,11 +6508,11 @@
|
|
|
6541
6508
|
this._updateActiveState(active);
|
|
6542
6509
|
if (this.active) {
|
|
6543
6510
|
var _this__$zoomPanel_classList, _this__$zoomPanel;
|
|
6544
|
-
(_this__$zoomPanel = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList = _this__$zoomPanel.classList) == null ? void 0 : _this__$zoomPanel_classList.remove("" + PREFIX_CLASS + "-hide");
|
|
6511
|
+
(_this__$zoomPanel = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList = _this__$zoomPanel.classList) == null ? void 0 : _this__$zoomPanel_classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
6545
6512
|
this.emit(EVENTS$2.control.zoomPanelOpenChange, true);
|
|
6546
6513
|
} else {
|
|
6547
6514
|
var _this__$zoomPanel_classList1, _this__$zoomPanel1;
|
|
6548
|
-
(_this__$zoomPanel1 = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList1 = _this__$zoomPanel1.classList) == null ? void 0 : _this__$zoomPanel_classList1.add("" + PREFIX_CLASS + "-hide");
|
|
6515
|
+
(_this__$zoomPanel1 = this._$zoomPanel) == null ? void 0 : (_this__$zoomPanel_classList1 = _this__$zoomPanel1.classList) == null ? void 0 : _this__$zoomPanel_classList1.add("" + PREFIX_CLASS$1 + "-hide");
|
|
6549
6516
|
this._progress.value = 1;
|
|
6550
6517
|
this.emit(EVENTS$2.control.zoomPanelOpenChange, false);
|
|
6551
6518
|
}
|
|
@@ -6574,14 +6541,10 @@
|
|
|
6574
6541
|
function _create_class$f(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var ZOOM_DEFAULT_POSITION=[0,0],DefaultOptions$1={initialZoom:1,defaultCursor:"pointer",scrollVelocity:.1,animDuration:.25,allowZoom:true,allowPan:true,onChange:function(){},onTranslateChange:function(){},onTap:function(){},max:8,min:1,zoomStep:.1,allowTouchEvents:false,allowWheel:true,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750},Zoom=function(){function Zoom(container,options){var _this=this;this._dragging=false,this.destroy=function(){_this.setAllowZoom(false),_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]<-0.5*(_this.zoom-1)?-0.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]<-0.5*(_this.zoom-1)?-0.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$1.max;_this.setZoom(null!=zoom?zoom:DefaultOptions$1.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,true):(_this.lastTouchTime=touchTime,false)},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,true),_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=true,_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=false;},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$1,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=false,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:false})),null==refCurrentValue||refCurrentValue.addEventListener("mousedown",this.handleMouseStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mousemove",this.handleMouseMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseup",this.handleMouseStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("mouseleave",this.handleMouseStop,{passive:false})):(null==refCurrentValue||refCurrentValue.addEventListener("touchstart",this.handleTouchStart,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchmove",this.handleTouchMove,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchend",this.handleTouchStop,{passive:false}),null==refCurrentValue||refCurrentValue.addEventListener("touchcancel",this.handleTouchStop,{passive:false}));},_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$f(Zoom,[{key:"pos",get:function(){return [this.container.clientWidth*this.percentPos[0],this.container.clientHeight*this.percentPos[1]]}}]),Zoom}();Zoom.VERSION="1.0.0-beta.2";
|
|
6575
6542
|
|
|
6576
6543
|
function _extends$s() {
|
|
6577
|
-
_extends$s = Object.assign || function(target) {
|
|
6544
|
+
_extends$s = Object.assign || function assign(target) {
|
|
6578
6545
|
for(var i = 1; i < arguments.length; i++){
|
|
6579
6546
|
var source = arguments[i];
|
|
6580
|
-
for(var key in source)
|
|
6581
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6582
|
-
target[key] = source[key];
|
|
6583
|
-
}
|
|
6584
|
-
}
|
|
6547
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
6585
6548
|
}
|
|
6586
6549
|
return target;
|
|
6587
6550
|
};
|
|
@@ -6590,14 +6553,14 @@
|
|
|
6590
6553
|
function __zoom(theme, container, options) {
|
|
6591
6554
|
theme.zoomUtil = new Zoom(container, _extends$s({}, options || {}, {
|
|
6592
6555
|
min: 1,
|
|
6593
|
-
onChange: function(zoom, reset) {
|
|
6556
|
+
onChange: function onChange(zoom, reset) {
|
|
6594
6557
|
if (zoom !== theme._zoom) {
|
|
6595
6558
|
var _options_onChange;
|
|
6596
6559
|
theme.zoom = zoom;
|
|
6597
6560
|
options == null ? void 0 : (_options_onChange = options.onChange) == null ? void 0 : _options_onChange.call(options, zoom, reset);
|
|
6598
6561
|
}
|
|
6599
6562
|
},
|
|
6600
|
-
onTranslateChange: function(pos) {
|
|
6563
|
+
onTranslateChange: function onTranslateChange(pos) {
|
|
6601
6564
|
var _options_onTranslateChange;
|
|
6602
6565
|
theme.emit(EVENTS$2.zoomTranslateChange, pos);
|
|
6603
6566
|
options == null ? void 0 : (_options_onTranslateChange = options.onTranslateChange) == null ? void 0 : _options_onTranslateChange.call(options, pos);
|
|
@@ -6614,11 +6577,8 @@
|
|
|
6614
6577
|
reject(error);
|
|
6615
6578
|
return;
|
|
6616
6579
|
}
|
|
6617
|
-
if (info.done)
|
|
6618
|
-
|
|
6619
|
-
} else {
|
|
6620
|
-
Promise.resolve(value).then(_next, _throw);
|
|
6621
|
-
}
|
|
6580
|
+
if (info.done) resolve(value);
|
|
6581
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
6622
6582
|
}
|
|
6623
6583
|
function _async_to_generator$7(fn) {
|
|
6624
6584
|
return function() {
|
|
@@ -6644,9 +6604,17 @@
|
|
|
6644
6604
|
},
|
|
6645
6605
|
trys: [],
|
|
6646
6606
|
ops: []
|
|
6647
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
6648
|
-
return
|
|
6649
|
-
|
|
6607
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
6608
|
+
return d(g, "next", {
|
|
6609
|
+
value: verb(0)
|
|
6610
|
+
}), d(g, "throw", {
|
|
6611
|
+
value: verb(1)
|
|
6612
|
+
}), d(g, "return", {
|
|
6613
|
+
value: verb(2)
|
|
6614
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
6615
|
+
value: function() {
|
|
6616
|
+
return this;
|
|
6617
|
+
}
|
|
6650
6618
|
}), g;
|
|
6651
6619
|
function verb(n) {
|
|
6652
6620
|
return function(v) {
|
|
@@ -6802,11 +6770,8 @@
|
|
|
6802
6770
|
reject(error);
|
|
6803
6771
|
return;
|
|
6804
6772
|
}
|
|
6805
|
-
if (info.done)
|
|
6806
|
-
|
|
6807
|
-
} else {
|
|
6808
|
-
Promise.resolve(value).then(_next, _throw);
|
|
6809
|
-
}
|
|
6773
|
+
if (info.done) resolve(value);
|
|
6774
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
6810
6775
|
}
|
|
6811
6776
|
function _async_to_generator$6(fn) {
|
|
6812
6777
|
return function() {
|
|
@@ -6824,14 +6789,10 @@
|
|
|
6824
6789
|
};
|
|
6825
6790
|
}
|
|
6826
6791
|
function _extends$r() {
|
|
6827
|
-
_extends$r = Object.assign || function(target) {
|
|
6792
|
+
_extends$r = Object.assign || function assign(target) {
|
|
6828
6793
|
for(var i = 1; i < arguments.length; i++){
|
|
6829
6794
|
var source = arguments[i];
|
|
6830
|
-
for(var key in source)
|
|
6831
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6832
|
-
target[key] = source[key];
|
|
6833
|
-
}
|
|
6834
|
-
}
|
|
6795
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
6835
6796
|
}
|
|
6836
6797
|
return target;
|
|
6837
6798
|
};
|
|
@@ -6846,9 +6807,17 @@
|
|
|
6846
6807
|
},
|
|
6847
6808
|
trys: [],
|
|
6848
6809
|
ops: []
|
|
6849
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
6850
|
-
return
|
|
6851
|
-
|
|
6810
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
6811
|
+
return d(g, "next", {
|
|
6812
|
+
value: verb(0)
|
|
6813
|
+
}), d(g, "throw", {
|
|
6814
|
+
value: verb(1)
|
|
6815
|
+
}), d(g, "return", {
|
|
6816
|
+
value: verb(2)
|
|
6817
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
6818
|
+
value: function() {
|
|
6819
|
+
return this;
|
|
6820
|
+
}
|
|
6852
6821
|
}), g;
|
|
6853
6822
|
function verb(n) {
|
|
6854
6823
|
return function(v) {
|
|
@@ -6941,10 +6910,10 @@
|
|
|
6941
6910
|
* @param {IThemeData} themeData 主题数据
|
|
6942
6911
|
* @returns
|
|
6943
6912
|
*/ function _filterControls(themeData) {
|
|
6913
|
+
var _ref;
|
|
6944
6914
|
var _themeData_header, _themeData_footer;
|
|
6945
6915
|
var data = {};
|
|
6946
|
-
|
|
6947
|
-
data.autoFocus = (_themeData_autoFocus = themeData == null ? void 0 : themeData.autoFocus) != null ? _themeData_autoFocus : 3; // 3s
|
|
6916
|
+
data.autoFocus = (_ref = themeData == null ? void 0 : themeData.autoFocus) != null ? _ref : 3; // 3s
|
|
6948
6917
|
data.poster = (themeData == null ? void 0 : themeData.poster) || ''; //
|
|
6949
6918
|
var deviceControls = [];
|
|
6950
6919
|
var recControls = [];
|
|
@@ -7193,7 +7162,7 @@
|
|
|
7193
7162
|
if (options === void 0) options = {};
|
|
7194
7163
|
this._options = options;
|
|
7195
7164
|
this.$container = document.createElement('div');
|
|
7196
|
-
this._defaultClass = PREFIX_CLASS + "-" + this._options.cType;
|
|
7165
|
+
this._defaultClass = PREFIX_CLASS$1 + "-" + this._options.cType;
|
|
7197
7166
|
if (this._options.cType) {
|
|
7198
7167
|
this.$container.classList.add(this._defaultClass);
|
|
7199
7168
|
}
|
|
@@ -7204,10 +7173,10 @@
|
|
|
7204
7173
|
// 兼容老版本和平台配置的主题
|
|
7205
7174
|
// -------------------------------------
|
|
7206
7175
|
if (options == null ? void 0 : options.color) {
|
|
7207
|
-
this.$container.style.cssText += "--" + PREFIX_CLASS + "-default-color: " + options.color + ";";
|
|
7176
|
+
this.$container.style.cssText += "--" + PREFIX_CLASS$1 + "-default-color: " + options.color + ";";
|
|
7208
7177
|
}
|
|
7209
7178
|
if (options == null ? void 0 : options.activeColor) {
|
|
7210
|
-
this.$container.style.cssText += "--" + PREFIX_CLASS + "-active-color: " + options.activeColor + ";";
|
|
7179
|
+
this.$container.style.cssText += "--" + PREFIX_CLASS$1 + "-active-color: " + options.activeColor + ";";
|
|
7211
7180
|
}
|
|
7212
7181
|
//
|
|
7213
7182
|
if (options == null ? void 0 : options.backgroundColor) {
|
|
@@ -7249,14 +7218,10 @@
|
|
|
7249
7218
|
}();
|
|
7250
7219
|
|
|
7251
7220
|
function _extends$q() {
|
|
7252
|
-
_extends$q = Object.assign || function(target) {
|
|
7221
|
+
_extends$q = Object.assign || function assign(target) {
|
|
7253
7222
|
for(var i = 1; i < arguments.length; i++){
|
|
7254
7223
|
var source = arguments[i];
|
|
7255
|
-
for(var key in source)
|
|
7256
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7257
|
-
target[key] = source[key];
|
|
7258
|
-
}
|
|
7259
|
-
}
|
|
7224
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7260
7225
|
}
|
|
7261
7226
|
return target;
|
|
7262
7227
|
};
|
|
@@ -7294,14 +7259,10 @@
|
|
|
7294
7259
|
}(Component);
|
|
7295
7260
|
|
|
7296
7261
|
function _extends$p() {
|
|
7297
|
-
_extends$p = Object.assign || function(target) {
|
|
7262
|
+
_extends$p = Object.assign || function assign(target) {
|
|
7298
7263
|
for(var i = 1; i < arguments.length; i++){
|
|
7299
7264
|
var source = arguments[i];
|
|
7300
|
-
for(var key in source)
|
|
7301
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7302
|
-
target[key] = source[key];
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7265
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7305
7266
|
}
|
|
7306
7267
|
return target;
|
|
7307
7268
|
};
|
|
@@ -7351,60 +7312,60 @@
|
|
|
7351
7312
|
var _timer = null;
|
|
7352
7313
|
var _open = false;
|
|
7353
7314
|
var _alwaysDisplay = false;
|
|
7354
|
-
var _$header = $container.querySelector("." + PREFIX_CLASS + "-header");
|
|
7355
|
-
var _$footer = $container.querySelector("." + PREFIX_CLASS + "-footer");
|
|
7356
|
-
var _clearTimeout = function() {
|
|
7315
|
+
var _$header = $container.querySelector("." + PREFIX_CLASS$1 + "-header");
|
|
7316
|
+
var _$footer = $container.querySelector("." + PREFIX_CLASS$1 + "-footer");
|
|
7317
|
+
var _clearTimeout = function _clearTimeout() {
|
|
7357
7318
|
if (_timer) {
|
|
7358
7319
|
clearTimeout(_timer);
|
|
7359
7320
|
_timer = null;
|
|
7360
7321
|
}
|
|
7361
7322
|
};
|
|
7362
|
-
var _show = function() {
|
|
7323
|
+
var _show = function _show() {
|
|
7363
7324
|
_clearTimeout == null ? void 0 : _clearTimeout();
|
|
7364
|
-
_$header == null ? void 0 : _$header.classList.remove("" + PREFIX_CLASS + "-hide-transition");
|
|
7365
|
-
_$footer == null ? void 0 : _$footer.classList.remove("" + PREFIX_CLASS + "-hide-transition");
|
|
7325
|
+
_$header == null ? void 0 : _$header.classList.remove("" + PREFIX_CLASS$1 + "-hide-transition");
|
|
7326
|
+
_$footer == null ? void 0 : _$footer.classList.remove("" + PREFIX_CLASS$1 + "-hide-transition");
|
|
7366
7327
|
if (!_open) {
|
|
7367
7328
|
// eslint-disable-next-line n/no-callback-literal
|
|
7368
7329
|
callback(true);
|
|
7369
7330
|
}
|
|
7370
7331
|
_open = true;
|
|
7371
7332
|
};
|
|
7372
|
-
var _hide = function() {
|
|
7333
|
+
var _hide = function _hide() {
|
|
7373
7334
|
if (_alwaysDisplay) {
|
|
7374
7335
|
return;
|
|
7375
7336
|
}
|
|
7376
7337
|
_clearTimeout == null ? void 0 : _clearTimeout();
|
|
7377
7338
|
// 暂停状态 footer 不隐藏
|
|
7378
|
-
if ($container.classList.contains("" + PREFIX_CLASS + "-player-pause")) return;
|
|
7379
|
-
_$header == null ? void 0 : _$header.classList.add("" + PREFIX_CLASS + "-hide-transition");
|
|
7380
|
-
_$footer == null ? void 0 : _$footer.classList.add("" + PREFIX_CLASS + "-hide-transition");
|
|
7339
|
+
if ($container.classList.contains("" + PREFIX_CLASS$1 + "-player-pause")) return;
|
|
7340
|
+
_$header == null ? void 0 : _$header.classList.add("" + PREFIX_CLASS$1 + "-hide-transition");
|
|
7341
|
+
_$footer == null ? void 0 : _$footer.classList.add("" + PREFIX_CLASS$1 + "-hide-transition");
|
|
7381
7342
|
if (_open) {
|
|
7382
7343
|
// eslint-disable-next-line n/no-callback-literal
|
|
7383
7344
|
callback(false);
|
|
7384
7345
|
}
|
|
7385
7346
|
_open = false;
|
|
7386
7347
|
};
|
|
7387
|
-
var _setTimeoutShow = function() {
|
|
7348
|
+
var _setTimeoutShow = function _setTimeoutShow() {
|
|
7388
7349
|
_show == null ? void 0 : _show();
|
|
7389
7350
|
_timer = setTimeout(function() {
|
|
7390
7351
|
_clearTimeout == null ? void 0 : _clearTimeout();
|
|
7391
7352
|
_hide == null ? void 0 : _hide();
|
|
7392
7353
|
}, second);
|
|
7393
7354
|
};
|
|
7394
|
-
var _headerFooterMousemove = function(e) {
|
|
7355
|
+
var _headerFooterMousemove = function _headerFooterMousemove(e) {
|
|
7395
7356
|
var // 鼠标在header footer 移动, 不允许消失及不要冒泡
|
|
7396
7357
|
_e_stopPropagation;
|
|
7397
7358
|
e == null ? void 0 : (_e_stopPropagation = e.stopPropagation) == null ? void 0 : _e_stopPropagation.call(e);
|
|
7398
7359
|
_clearTimeout == null ? void 0 : _clearTimeout();
|
|
7399
7360
|
};
|
|
7400
|
-
var _touchStart = function() {
|
|
7361
|
+
var _touchStart = function _touchStart() {
|
|
7401
7362
|
if (_open) {
|
|
7402
7363
|
_hide == null ? void 0 : _hide();
|
|
7403
7364
|
} else {
|
|
7404
7365
|
_setTimeoutShow == null ? void 0 : _setTimeoutShow();
|
|
7405
7366
|
}
|
|
7406
7367
|
};
|
|
7407
|
-
var _headerFooterTouchStart = function(e) {
|
|
7368
|
+
var _headerFooterTouchStart = function _headerFooterTouchStart(e) {
|
|
7408
7369
|
var // 移动端特殊处理, 点击 header footer不允许消失及不要冒泡
|
|
7409
7370
|
_e_stopPropagation;
|
|
7410
7371
|
e == null ? void 0 : (_e_stopPropagation = e.stopPropagation) == null ? void 0 : _e_stopPropagation.call(e);
|
|
@@ -7441,7 +7402,7 @@
|
|
|
7441
7402
|
}
|
|
7442
7403
|
/**
|
|
7443
7404
|
* 销毁
|
|
7444
|
-
*/ var cleanup = function() {
|
|
7405
|
+
*/ var cleanup = function cleanup() {
|
|
7445
7406
|
if ($container) {
|
|
7446
7407
|
if (Utils.isMobile && _touchStart) {
|
|
7447
7408
|
var eventName = "click";
|
|
@@ -7485,11 +7446,11 @@
|
|
|
7485
7446
|
};
|
|
7486
7447
|
return {
|
|
7487
7448
|
cleanup: cleanup,
|
|
7488
|
-
clearTimeout: function() {
|
|
7449
|
+
clearTimeout: function clearTimeout1() {
|
|
7489
7450
|
_clearTimeout == null ? void 0 : _clearTimeout();
|
|
7490
7451
|
_alwaysDisplay = true;
|
|
7491
7452
|
},
|
|
7492
|
-
setTimeoutShow: function() {
|
|
7453
|
+
setTimeoutShow: function setTimeoutShow() {
|
|
7493
7454
|
_setTimeoutShow == null ? void 0 : _setTimeoutShow();
|
|
7494
7455
|
_alwaysDisplay = false;
|
|
7495
7456
|
},
|
|
@@ -7498,14 +7459,10 @@
|
|
|
7498
7459
|
}
|
|
7499
7460
|
|
|
7500
7461
|
function _extends$o() {
|
|
7501
|
-
_extends$o = Object.assign || function(target) {
|
|
7462
|
+
_extends$o = Object.assign || function assign(target) {
|
|
7502
7463
|
for(var i = 1; i < arguments.length; i++){
|
|
7503
7464
|
var source = arguments[i];
|
|
7504
|
-
for(var key in source)
|
|
7505
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7506
|
-
target[key] = source[key];
|
|
7507
|
-
}
|
|
7508
|
-
}
|
|
7465
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7509
7466
|
}
|
|
7510
7467
|
return target;
|
|
7511
7468
|
};
|
|
@@ -7556,13 +7513,13 @@
|
|
|
7556
7513
|
* 点击 Control 会触发
|
|
7557
7514
|
*/ _proto._onControlClick = function _onControlClick() {
|
|
7558
7515
|
// 网页全屏的情况下 还可以执行全局全屏
|
|
7559
|
-
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS + "-global-fullscreen")) {
|
|
7516
|
+
if (this.isCurrentFullscreen && this._$rootContainer.classList.contains("" + PREFIX_CLASS$1 + "-global-fullscreen")) {
|
|
7560
7517
|
var _this__fullscreenUtil;
|
|
7561
|
-
this._$rootContainer.classList.remove("" + PREFIX_CLASS + "-global-fullscreen");
|
|
7518
|
+
this._$rootContainer.classList.remove("" + PREFIX_CLASS$1 + "-global-fullscreen");
|
|
7562
7519
|
(_this__fullscreenUtil = this._fullscreenUtil) == null ? void 0 : _this__fullscreenUtil.exitFullscreen();
|
|
7563
7520
|
} else {
|
|
7564
7521
|
var _this__fullscreenUtil1;
|
|
7565
|
-
this._$rootContainer.classList.add("" + PREFIX_CLASS + "-global-fullscreen");
|
|
7522
|
+
this._$rootContainer.classList.add("" + PREFIX_CLASS$1 + "-global-fullscreen");
|
|
7566
7523
|
(_this__fullscreenUtil1 = this._fullscreenUtil) == null ? void 0 : _this__fullscreenUtil1.fullscreen();
|
|
7567
7524
|
}
|
|
7568
7525
|
};
|
|
@@ -7570,14 +7527,10 @@
|
|
|
7570
7527
|
}(Fullscreen);
|
|
7571
7528
|
|
|
7572
7529
|
function _extends$n() {
|
|
7573
|
-
_extends$n = Object.assign || function(target) {
|
|
7530
|
+
_extends$n = Object.assign || function assign(target) {
|
|
7574
7531
|
for(var i = 1; i < arguments.length; i++){
|
|
7575
7532
|
var source = arguments[i];
|
|
7576
|
-
for(var key in source)
|
|
7577
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7578
|
-
target[key] = source[key];
|
|
7579
|
-
}
|
|
7580
|
-
}
|
|
7533
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7581
7534
|
}
|
|
7582
7535
|
return target;
|
|
7583
7536
|
};
|
|
@@ -7640,8 +7593,8 @@
|
|
|
7640
7593
|
* 点击 Control 会触发
|
|
7641
7594
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
7642
7595
|
var _this = this;
|
|
7643
|
-
this.active = true;
|
|
7644
7596
|
var _this_options_type, _this_options_cloudRecUpload;
|
|
7597
|
+
this.active = true;
|
|
7645
7598
|
this.emit(EVENTS$2.control.capturePicture, {
|
|
7646
7599
|
type: (_this_options_type = this.options.type) != null ? _this_options_type : 'download',
|
|
7647
7600
|
quality: this.options.quality || 0.9,
|
|
@@ -7684,14 +7637,10 @@
|
|
|
7684
7637
|
return Constructor;
|
|
7685
7638
|
}
|
|
7686
7639
|
function _extends$m() {
|
|
7687
|
-
_extends$m = Object.assign || function(target) {
|
|
7640
|
+
_extends$m = Object.assign || function assign(target) {
|
|
7688
7641
|
for(var i = 1; i < arguments.length; i++){
|
|
7689
7642
|
var source = arguments[i];
|
|
7690
|
-
for(var key in source)
|
|
7691
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7692
|
-
target[key] = source[key];
|
|
7693
|
-
}
|
|
7694
|
-
}
|
|
7643
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7695
7644
|
}
|
|
7696
7645
|
return target;
|
|
7697
7646
|
};
|
|
@@ -7761,10 +7710,10 @@
|
|
|
7761
7710
|
_proto._renderPanel = function _renderPanel() {
|
|
7762
7711
|
if (this._options.rootContainer) {
|
|
7763
7712
|
this.$panel = document.createElement('div');
|
|
7764
|
-
this.$panel.classList.add("" + PREFIX_CLASS + "-ptz-panel", "" + PREFIX_CLASS + "-hide");
|
|
7713
|
+
this.$panel.classList.add("" + PREFIX_CLASS$1 + "-ptz-panel", "" + PREFIX_CLASS$1 + "-hide");
|
|
7765
7714
|
this._options.rootContainer.appendChild(this.$panel);
|
|
7766
7715
|
this.$turntable = document.createElement('div');
|
|
7767
|
-
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
7716
|
+
this.$turntable.classList.add("" + PREFIX_CLASS$1 + "-ptz-turntable");
|
|
7768
7717
|
this.$panel.appendChild(this.$turntable);
|
|
7769
7718
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7770
7719
|
this._ptzControl = new Ptz$1(this.$turntable, _extends$m({}, this._options, {
|
|
@@ -7845,9 +7794,9 @@
|
|
|
7845
7794
|
this._active = active;
|
|
7846
7795
|
this._updateActiveState(active);
|
|
7847
7796
|
if (this._active) {
|
|
7848
|
-
this.$panel.classList.remove("" + PREFIX_CLASS + "-hide");
|
|
7797
|
+
this.$panel.classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
7849
7798
|
} else {
|
|
7850
|
-
this.$panel.classList.add("" + PREFIX_CLASS + "-hide");
|
|
7799
|
+
this.$panel.classList.add("" + PREFIX_CLASS$1 + "-hide");
|
|
7851
7800
|
}
|
|
7852
7801
|
}
|
|
7853
7802
|
}
|
|
@@ -7860,7 +7809,7 @@
|
|
|
7860
7809
|
var hours = Math.floor(seconds / 3600);
|
|
7861
7810
|
var minutes = Math.floor(seconds % 3600 / 60);
|
|
7862
7811
|
var secs = seconds % 60;
|
|
7863
|
-
var pad = function(num) {
|
|
7812
|
+
var pad = function pad(num) {
|
|
7864
7813
|
return num.toString().padStart(2, '0');
|
|
7865
7814
|
};
|
|
7866
7815
|
return format.replace('HH', pad(hours)).replace('MM', pad(minutes)).replace('SS', pad(secs));
|
|
@@ -7880,14 +7829,10 @@
|
|
|
7880
7829
|
return Constructor;
|
|
7881
7830
|
}
|
|
7882
7831
|
function _extends$l() {
|
|
7883
|
-
_extends$l = Object.assign || function(target) {
|
|
7832
|
+
_extends$l = Object.assign || function assign(target) {
|
|
7884
7833
|
for(var i = 1; i < arguments.length; i++){
|
|
7885
7834
|
var source = arguments[i];
|
|
7886
|
-
for(var key in source)
|
|
7887
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7888
|
-
target[key] = source[key];
|
|
7889
|
-
}
|
|
7890
|
-
}
|
|
7835
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
7891
7836
|
}
|
|
7892
7837
|
return target;
|
|
7893
7838
|
};
|
|
@@ -7952,10 +7897,10 @@
|
|
|
7952
7897
|
var _this = this;
|
|
7953
7898
|
var _this__options_rootContainer, _this__options;
|
|
7954
7899
|
this._timerNode = document.createElement('span');
|
|
7955
|
-
this._timerNode.className = "" + PREFIX_CLASS + "-record-timer";
|
|
7900
|
+
this._timerNode.className = "" + PREFIX_CLASS$1 + "-record-timer";
|
|
7956
7901
|
(_this__options = this._options) == null ? void 0 : (_this__options_rootContainer = _this__options.rootContainer) == null ? void 0 : _this__options_rootContainer.appendChild(this._timerNode);
|
|
7957
|
-
this._timerNode.innerHTML = IconComponents.recordCircle() + '<span class="' + PREFIX_CLASS + '-record-timer-time">' + formatTime(this._seconds) + "<span>";
|
|
7958
|
-
var $time = this._timerNode.querySelector("." + PREFIX_CLASS + "-record-timer-time");
|
|
7902
|
+
this._timerNode.innerHTML = IconComponents.recordCircle() + '<span class="' + PREFIX_CLASS$1 + '-record-timer-time">' + formatTime(this._seconds) + "<span>";
|
|
7903
|
+
var $time = this._timerNode.querySelector("." + PREFIX_CLASS$1 + "-record-timer-time");
|
|
7959
7904
|
this._timer = setInterval(function() {
|
|
7960
7905
|
_this._seconds++;
|
|
7961
7906
|
if (_this._seconds >= _this._options.maxDuration) {
|
|
@@ -8035,11 +7980,8 @@
|
|
|
8035
7980
|
reject(error);
|
|
8036
7981
|
return;
|
|
8037
7982
|
}
|
|
8038
|
-
if (info.done)
|
|
8039
|
-
|
|
8040
|
-
} else {
|
|
8041
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8042
|
-
}
|
|
7983
|
+
if (info.done) resolve(value);
|
|
7984
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
8043
7985
|
}
|
|
8044
7986
|
function _async_to_generator$4(fn) {
|
|
8045
7987
|
return function() {
|
|
@@ -8070,14 +8012,10 @@
|
|
|
8070
8012
|
return Constructor;
|
|
8071
8013
|
}
|
|
8072
8014
|
function _extends$k() {
|
|
8073
|
-
_extends$k = Object.assign || function(target) {
|
|
8015
|
+
_extends$k = Object.assign || function assign(target) {
|
|
8074
8016
|
for(var i = 1; i < arguments.length; i++){
|
|
8075
8017
|
var source = arguments[i];
|
|
8076
|
-
for(var key in source)
|
|
8077
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8078
|
-
target[key] = source[key];
|
|
8079
|
-
}
|
|
8080
|
-
}
|
|
8018
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
8081
8019
|
}
|
|
8082
8020
|
return target;
|
|
8083
8021
|
};
|
|
@@ -8112,9 +8050,17 @@
|
|
|
8112
8050
|
},
|
|
8113
8051
|
trys: [],
|
|
8114
8052
|
ops: []
|
|
8115
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8116
|
-
return
|
|
8117
|
-
|
|
8053
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
8054
|
+
return d(g, "next", {
|
|
8055
|
+
value: verb(0)
|
|
8056
|
+
}), d(g, "throw", {
|
|
8057
|
+
value: verb(1)
|
|
8058
|
+
}), d(g, "return", {
|
|
8059
|
+
value: verb(2)
|
|
8060
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
8061
|
+
value: function() {
|
|
8062
|
+
return this;
|
|
8063
|
+
}
|
|
8118
8064
|
}), g;
|
|
8119
8065
|
function verb(n) {
|
|
8120
8066
|
return function(v) {
|
|
@@ -8255,7 +8201,7 @@
|
|
|
8255
8201
|
/**
|
|
8256
8202
|
* 点击 Control 会触发
|
|
8257
8203
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8258
|
-
var _this = this, _superprop_get__onControlClick = function() {
|
|
8204
|
+
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8259
8205
|
return Control.prototype._onControlClick;
|
|
8260
8206
|
};
|
|
8261
8207
|
return _async_to_generator$4(function() {
|
|
@@ -8300,10 +8246,10 @@
|
|
|
8300
8246
|
gainType = 'deafening';
|
|
8301
8247
|
}
|
|
8302
8248
|
var className = Array.from(this.$container.classList).find(function(className) {
|
|
8303
|
-
return className.startsWith("" + PREFIX_CLASS + "-talk-gain-");
|
|
8249
|
+
return className.startsWith("" + PREFIX_CLASS$1 + "-talk-gain-");
|
|
8304
8250
|
});
|
|
8305
8251
|
if (className) this.$container.classList.remove(className);
|
|
8306
|
-
this.$container.classList.add(PREFIX_CLASS + "-talk-gain-" + gainType);
|
|
8252
|
+
this.$container.classList.add(PREFIX_CLASS$1 + "-talk-gain-" + gainType);
|
|
8307
8253
|
}
|
|
8308
8254
|
}
|
|
8309
8255
|
]);
|
|
@@ -8318,11 +8264,8 @@
|
|
|
8318
8264
|
reject(error);
|
|
8319
8265
|
return;
|
|
8320
8266
|
}
|
|
8321
|
-
if (info.done)
|
|
8322
|
-
|
|
8323
|
-
} else {
|
|
8324
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8325
|
-
}
|
|
8267
|
+
if (info.done) resolve(value);
|
|
8268
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
8326
8269
|
}
|
|
8327
8270
|
function _async_to_generator$3(fn) {
|
|
8328
8271
|
return function() {
|
|
@@ -8340,14 +8283,10 @@
|
|
|
8340
8283
|
};
|
|
8341
8284
|
}
|
|
8342
8285
|
function _extends$j() {
|
|
8343
|
-
_extends$j = Object.assign || function(target) {
|
|
8286
|
+
_extends$j = Object.assign || function assign(target) {
|
|
8344
8287
|
for(var i = 1; i < arguments.length; i++){
|
|
8345
8288
|
var source = arguments[i];
|
|
8346
|
-
for(var key in source)
|
|
8347
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8348
|
-
target[key] = source[key];
|
|
8349
|
-
}
|
|
8350
|
-
}
|
|
8289
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
8351
8290
|
}
|
|
8352
8291
|
return target;
|
|
8353
8292
|
};
|
|
@@ -8382,9 +8321,17 @@
|
|
|
8382
8321
|
},
|
|
8383
8322
|
trys: [],
|
|
8384
8323
|
ops: []
|
|
8385
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8386
|
-
return
|
|
8387
|
-
|
|
8324
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
8325
|
+
return d(g, "next", {
|
|
8326
|
+
value: verb(0)
|
|
8327
|
+
}), d(g, "throw", {
|
|
8328
|
+
value: verb(1)
|
|
8329
|
+
}), d(g, "return", {
|
|
8330
|
+
value: verb(2)
|
|
8331
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
8332
|
+
value: function() {
|
|
8333
|
+
return this;
|
|
8334
|
+
}
|
|
8388
8335
|
}), g;
|
|
8389
8336
|
function verb(n) {
|
|
8390
8337
|
return function(v) {
|
|
@@ -8520,7 +8467,7 @@
|
|
|
8520
8467
|
/**
|
|
8521
8468
|
* 点击 Control 会触发
|
|
8522
8469
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8523
|
-
var _this = this, _superprop_get__onControlClick = function() {
|
|
8470
|
+
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8524
8471
|
return Control.prototype._onControlClick;
|
|
8525
8472
|
};
|
|
8526
8473
|
return _async_to_generator$3(function() {
|
|
@@ -8548,11 +8495,8 @@
|
|
|
8548
8495
|
reject(error);
|
|
8549
8496
|
return;
|
|
8550
8497
|
}
|
|
8551
|
-
if (info.done)
|
|
8552
|
-
|
|
8553
|
-
} else {
|
|
8554
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8555
|
-
}
|
|
8498
|
+
if (info.done) resolve(value);
|
|
8499
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
8556
8500
|
}
|
|
8557
8501
|
function _async_to_generator$2(fn) {
|
|
8558
8502
|
return function() {
|
|
@@ -8570,14 +8514,10 @@
|
|
|
8570
8514
|
};
|
|
8571
8515
|
}
|
|
8572
8516
|
function _extends$i() {
|
|
8573
|
-
_extends$i = Object.assign || function(target) {
|
|
8517
|
+
_extends$i = Object.assign || function assign(target) {
|
|
8574
8518
|
for(var i = 1; i < arguments.length; i++){
|
|
8575
8519
|
var source = arguments[i];
|
|
8576
|
-
for(var key in source)
|
|
8577
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8578
|
-
target[key] = source[key];
|
|
8579
|
-
}
|
|
8580
|
-
}
|
|
8520
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
8581
8521
|
}
|
|
8582
8522
|
return target;
|
|
8583
8523
|
};
|
|
@@ -8612,9 +8552,17 @@
|
|
|
8612
8552
|
},
|
|
8613
8553
|
trys: [],
|
|
8614
8554
|
ops: []
|
|
8615
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8616
|
-
return
|
|
8617
|
-
|
|
8555
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
8556
|
+
return d(g, "next", {
|
|
8557
|
+
value: verb(0)
|
|
8558
|
+
}), d(g, "throw", {
|
|
8559
|
+
value: verb(1)
|
|
8560
|
+
}), d(g, "return", {
|
|
8561
|
+
value: verb(2)
|
|
8562
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
8563
|
+
value: function() {
|
|
8564
|
+
return this;
|
|
8565
|
+
}
|
|
8618
8566
|
}), g;
|
|
8619
8567
|
function verb(n) {
|
|
8620
8568
|
return function(v) {
|
|
@@ -8751,7 +8699,7 @@
|
|
|
8751
8699
|
/**
|
|
8752
8700
|
* 点击 Control 会触发
|
|
8753
8701
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
8754
|
-
var _this = this, _superprop_get__onControlClick = function() {
|
|
8702
|
+
var _this = this, _superprop_get__onControlClick = function _superprop_get__onControlClick() {
|
|
8755
8703
|
return Control.prototype._onControlClick;
|
|
8756
8704
|
};
|
|
8757
8705
|
return _async_to_generator$2(function() {
|
|
@@ -8772,14 +8720,10 @@
|
|
|
8772
8720
|
}(Control);
|
|
8773
8721
|
|
|
8774
8722
|
function _extends$h() {
|
|
8775
|
-
_extends$h = Object.assign || function(target) {
|
|
8723
|
+
_extends$h = Object.assign || function assign(target) {
|
|
8776
8724
|
for(var i = 1; i < arguments.length; i++){
|
|
8777
8725
|
var source = arguments[i];
|
|
8778
|
-
for(var key in source)
|
|
8779
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8780
|
-
target[key] = source[key];
|
|
8781
|
-
}
|
|
8782
|
-
}
|
|
8726
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
8783
8727
|
}
|
|
8784
8728
|
return target;
|
|
8785
8729
|
};
|
|
@@ -8867,14 +8811,10 @@
|
|
|
8867
8811
|
}(Control);
|
|
8868
8812
|
|
|
8869
8813
|
function _extends$g() {
|
|
8870
|
-
_extends$g = Object.assign || function(target) {
|
|
8814
|
+
_extends$g = Object.assign || function assign(target) {
|
|
8871
8815
|
for(var i = 1; i < arguments.length; i++){
|
|
8872
8816
|
var source = arguments[i];
|
|
8873
|
-
for(var key in source)
|
|
8874
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8875
|
-
target[key] = source[key];
|
|
8876
|
-
}
|
|
8877
|
-
}
|
|
8817
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
8878
8818
|
}
|
|
8879
8819
|
return target;
|
|
8880
8820
|
};
|
|
@@ -8957,12 +8897,12 @@
|
|
|
8957
8897
|
_proto._initPicker = function _initPicker() {
|
|
8958
8898
|
var _this = this;
|
|
8959
8899
|
this._picker = new Picker(this.$container, {
|
|
8960
|
-
getPopupContainer: function() {
|
|
8900
|
+
getPopupContainer: function getPopupContainer() {
|
|
8961
8901
|
return Utils.isMobile ? _this.__options.rootContainer : _this.$container;
|
|
8962
8902
|
},
|
|
8963
8903
|
trigger: Utils.isMobile ? 'click' : 'hover',
|
|
8964
8904
|
isMobile: Utils.isMobile,
|
|
8965
|
-
wrapClassName: "" + PREFIX_CLASS + "-rec-dropdown-picker",
|
|
8905
|
+
wrapClassName: "" + PREFIX_CLASS$1 + "-rec-dropdown-picker",
|
|
8966
8906
|
placement: 'bottom',
|
|
8967
8907
|
offset: [
|
|
8968
8908
|
0,
|
|
@@ -8978,11 +8918,11 @@
|
|
|
8978
8918
|
var cloudRecLabel = ((_this_locale = this.locale) == null ? void 0 : _this_locale.REC_DROPDOWN_CLOUD_REC) || '云存储';
|
|
8979
8919
|
var cloudRecordLabel = ((_this_locale1 = this.locale) == null ? void 0 : _this_locale1.REC_DROPDOWN_CLOUD_RECORD) || '云录制';
|
|
8980
8920
|
var localRecLabel = ((_this_locale2 = this.locale) == null ? void 0 : _this_locale2.REC_DROPDOWN_LOCAL_REC) || '本地回放';
|
|
8981
|
-
return '<div class="' + PREFIX_CLASS + '-rec-dropdown-panel">\n <ul class="' + PREFIX_CLASS + '-rec-dropdown-list">\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="cloudRec">\n <span>' + cloudRecLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="cloudRecord">\n <span>' + cloudRecordLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS + '-rec-dropdown-item" data-type="rec">\n <span>' + localRecLabel + "</span>\n </li>\n </ul>\n </div>";
|
|
8921
|
+
return '<div class="' + PREFIX_CLASS$1 + '-rec-dropdown-panel">\n <ul class="' + PREFIX_CLASS$1 + '-rec-dropdown-list">\n <li class="' + PREFIX_CLASS$1 + '-rec-dropdown-item" data-type="cloudRec">\n <span>' + cloudRecLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS$1 + '-rec-dropdown-item" data-type="cloudRecord">\n <span>' + cloudRecordLabel + '</span>\n </li>\n <li class="' + PREFIX_CLASS$1 + '-rec-dropdown-item" data-type="rec">\n <span>' + localRecLabel + "</span>\n </li>\n </ul>\n </div>";
|
|
8982
8922
|
};
|
|
8983
8923
|
_proto._bindPanelEvents = function _bindPanelEvents() {
|
|
8984
8924
|
var _this = this;
|
|
8985
|
-
this._delegation = delegate(this._picker.$body, "." + PREFIX_CLASS + "-rec-dropdown-item", 'click', function(e) {
|
|
8925
|
+
this._delegation = delegate(this._picker.$body, "." + PREFIX_CLASS$1 + "-rec-dropdown-item", 'click', function(e) {
|
|
8986
8926
|
e.stopPropagation();
|
|
8987
8927
|
var type = e.delegateTarget.getAttribute('data-type');
|
|
8988
8928
|
if (type) {
|
|
@@ -9000,12 +8940,12 @@
|
|
|
9000
8940
|
_proto._activeOption = function _activeOption(type) {
|
|
9001
8941
|
var _this__picker;
|
|
9002
8942
|
if ((_this__picker = this._picker) == null ? void 0 : _this__picker.$body) {
|
|
9003
|
-
var items = this._picker.$body.querySelectorAll("." + PREFIX_CLASS + "-rec-dropdown-item");
|
|
8943
|
+
var items = this._picker.$body.querySelectorAll("." + PREFIX_CLASS$1 + "-rec-dropdown-item");
|
|
9004
8944
|
items.forEach(function(item) {
|
|
9005
|
-
item.classList.remove("" + PREFIX_CLASS + "-active");
|
|
8945
|
+
item.classList.remove("" + PREFIX_CLASS$1 + "-active");
|
|
9006
8946
|
});
|
|
9007
|
-
var target = this._picker.$body.querySelector("." + PREFIX_CLASS + '-rec-dropdown-item[data-type="' + type + '"]');
|
|
9008
|
-
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS + "-active");
|
|
8947
|
+
var target = this._picker.$body.querySelector("." + PREFIX_CLASS$1 + '-rec-dropdown-item[data-type="' + type + '"]');
|
|
8948
|
+
target == null ? void 0 : target.classList.add("" + PREFIX_CLASS$1 + "-active");
|
|
9009
8949
|
}
|
|
9010
8950
|
};
|
|
9011
8951
|
/**
|
|
@@ -9030,386 +8970,32 @@
|
|
|
9030
8970
|
return RecDropdown;
|
|
9031
8971
|
}(Control);
|
|
9032
8972
|
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
if (hasRequiredEventemitter3) return eventemitter3.exports;
|
|
9039
|
-
hasRequiredEventemitter3 = 1;
|
|
9040
|
-
(function (module) {
|
|
9041
|
-
|
|
9042
|
-
var has = Object.prototype.hasOwnProperty
|
|
9043
|
-
, prefix = '~';
|
|
9044
|
-
|
|
9045
|
-
/**
|
|
9046
|
-
* Constructor to create a storage for our `EE` objects.
|
|
9047
|
-
* An `Events` instance is a plain object whose properties are event names.
|
|
9048
|
-
*
|
|
9049
|
-
* @constructor
|
|
9050
|
-
* @private
|
|
9051
|
-
*/
|
|
9052
|
-
function Events() {}
|
|
9053
|
-
|
|
9054
|
-
//
|
|
9055
|
-
// We try to not inherit from `Object.prototype`. In some engines creating an
|
|
9056
|
-
// instance in this way is faster than calling `Object.create(null)` directly.
|
|
9057
|
-
// If `Object.create(null)` is not supported we prefix the event names with a
|
|
9058
|
-
// character to make sure that the built-in object properties are not
|
|
9059
|
-
// overridden or used as an attack vector.
|
|
9060
|
-
//
|
|
9061
|
-
if (Object.create) {
|
|
9062
|
-
Events.prototype = Object.create(null);
|
|
9063
|
-
|
|
9064
|
-
//
|
|
9065
|
-
// This hack is needed because the `__proto__` property is still inherited in
|
|
9066
|
-
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
|
|
9067
|
-
//
|
|
9068
|
-
if (!new Events().__proto__) prefix = false;
|
|
9069
|
-
}
|
|
9070
|
-
|
|
9071
|
-
/**
|
|
9072
|
-
* Representation of a single event listener.
|
|
9073
|
-
*
|
|
9074
|
-
* @param {Function} fn The listener function.
|
|
9075
|
-
* @param {*} context The context to invoke the listener with.
|
|
9076
|
-
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
9077
|
-
* @constructor
|
|
9078
|
-
* @private
|
|
9079
|
-
*/
|
|
9080
|
-
function EE(fn, context, once) {
|
|
9081
|
-
this.fn = fn;
|
|
9082
|
-
this.context = context;
|
|
9083
|
-
this.once = once || false;
|
|
9084
|
-
}
|
|
9085
|
-
|
|
9086
|
-
/**
|
|
9087
|
-
* Add a listener for a given event.
|
|
9088
|
-
*
|
|
9089
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
9090
|
-
* @param {(String|Symbol)} event The event name.
|
|
9091
|
-
* @param {Function} fn The listener function.
|
|
9092
|
-
* @param {*} context The context to invoke the listener with.
|
|
9093
|
-
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
9094
|
-
* @returns {EventEmitter}
|
|
9095
|
-
* @private
|
|
9096
|
-
*/
|
|
9097
|
-
function addListener(emitter, event, fn, context, once) {
|
|
9098
|
-
if (typeof fn !== 'function') {
|
|
9099
|
-
throw new TypeError('The listener must be a function');
|
|
9100
|
-
}
|
|
9101
|
-
|
|
9102
|
-
var listener = new EE(fn, context || emitter, once)
|
|
9103
|
-
, evt = prefix ? prefix + event : event;
|
|
9104
|
-
|
|
9105
|
-
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
9106
|
-
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
9107
|
-
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
9108
|
-
|
|
9109
|
-
return emitter;
|
|
9110
|
-
}
|
|
9111
|
-
|
|
9112
|
-
/**
|
|
9113
|
-
* Clear event by name.
|
|
9114
|
-
*
|
|
9115
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
9116
|
-
* @param {(String|Symbol)} evt The Event name.
|
|
9117
|
-
* @private
|
|
9118
|
-
*/
|
|
9119
|
-
function clearEvent(emitter, evt) {
|
|
9120
|
-
if (--emitter._eventsCount === 0) emitter._events = new Events();
|
|
9121
|
-
else delete emitter._events[evt];
|
|
9122
|
-
}
|
|
9123
|
-
|
|
9124
|
-
/**
|
|
9125
|
-
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
9126
|
-
* `EventEmitter` interface.
|
|
9127
|
-
*
|
|
9128
|
-
* @constructor
|
|
9129
|
-
* @public
|
|
9130
|
-
*/
|
|
9131
|
-
function EventEmitter() {
|
|
9132
|
-
this._events = new Events();
|
|
9133
|
-
this._eventsCount = 0;
|
|
9134
|
-
}
|
|
9135
|
-
|
|
9136
|
-
/**
|
|
9137
|
-
* Return an array listing the events for which the emitter has registered
|
|
9138
|
-
* listeners.
|
|
9139
|
-
*
|
|
9140
|
-
* @returns {Array}
|
|
9141
|
-
* @public
|
|
9142
|
-
*/
|
|
9143
|
-
EventEmitter.prototype.eventNames = function eventNames() {
|
|
9144
|
-
var names = []
|
|
9145
|
-
, events
|
|
9146
|
-
, name;
|
|
9147
|
-
|
|
9148
|
-
if (this._eventsCount === 0) return names;
|
|
9149
|
-
|
|
9150
|
-
for (name in (events = this._events)) {
|
|
9151
|
-
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
9152
|
-
}
|
|
9153
|
-
|
|
9154
|
-
if (Object.getOwnPropertySymbols) {
|
|
9155
|
-
return names.concat(Object.getOwnPropertySymbols(events));
|
|
9156
|
-
}
|
|
9157
|
-
|
|
9158
|
-
return names;
|
|
9159
|
-
};
|
|
8973
|
+
/*
|
|
8974
|
+
* @ezuikit/control-modal v0.0.1
|
|
8975
|
+
* Copyright (c) 2026-07-06 Ezviz-OpenBiz
|
|
8976
|
+
* Released under the MIT License.
|
|
8977
|
+
*/
|
|
8978
|
+
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_class$a(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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:true}:{done:false,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 ModalProvider=function(){function ModalProvider(){this._instances=new Set,this._zIndexCounter=1e3;}var _proto=ModalProvider.prototype;return _proto.register=function(modal,minZIndex){this._instances.add(modal);var base=Math.max(this._zIndexCounter,minZIndex||1e3);return this._zIndexCounter=base+2,base},_proto.unregister=function(modal){this._instances.delete(modal);},_proto.bringToTop=function(){var base=this._zIndexCounter;return this._zIndexCounter+=2,base},_proto.getInstances=function(){return Array.from(this._instances)},_proto.destroyAll=function(){for(var _step,_iterator=_create_for_of_iterator_helper_loose$2(this.getInstances());!(_step=_iterator()).done;){var modal=_step.value;modal._destroyed||modal.destroy();}},ModalProvider.getInstance=function(){return ModalProvider._instance||(ModalProvider._instance=new ModalProvider),ModalProvider._instance},ModalProvider.resetInstance=function(){ModalProvider._instance&&(ModalProvider._instance._instances.clear(),ModalProvider._instance._zIndexCounter=1e3,ModalProvider._instance=null);},_create_class$a(ModalProvider,[{key:"count",get:function(){return this._instances.size}}]),ModalProvider}();ModalProvider._instance=null;var EVENTS$1={open:"open",close:"close",dragStart:"dragStart",dragging:"dragging",dragEnd:"dragEnd"},_$MODAL_LOCALES$_={zh:{close:"关闭"},en:{close:"Close"}},__$MODAL_DEFAULT_OPTIONS$__={width:420,position:"center",draggable:true,showMask:true,maskClosable:true,showHeader:true,showClose:true,closeOnEscape:true,open:false,zIndex:1e3,language:"zh"};var Modal=function(){function Modal(container,options){this._$mask=null,this._$header=null,this._$title=null,this._$close=null,this._visible=false,this._dragging=false,this._dragOffset={x:0,y:0},this._destroyed=false,this._dragBounds={maxLeft:0,maxTop:0},this._dragPoint=null,this._dragRafId=null,this._pos={x:0,y:0},this.options=deepmerge(__$MODAL_DEFAULT_OPTIONS$__,null!=options?options:{},{clone:false}),this._eventEmitter=new EventEmitter,this._i18n=new I18n(deepmerge(_$MODAL_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._container=this._resolveContainer(container),this._baseZIndex=ModalProvider.getInstance().register(this,this.options.zIndex),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onDragFrame=this._onDragFrame.bind(this),this._onHeaderPointerDown=this._onHeaderPointerDown.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onMaskClick=this._onMaskClick.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onWindowResize=this._onWindowResize.bind(this),this._onModalPointerDown=this._onModalPointerDown.bind(this),this._onWrapDblClick=this._onWrapDblClick.bind(this),this._render(),this._bindEvents(),this.options.open&&this.open();}var _proto=Modal.prototype;return _proto.open=function(){this._destroyed||this._visible||(this._visible=true,this._$mask&&this._$mask.classList.remove("emodal-hidden"),this._$wrap.classList.remove("emodal-hidden"),this._applyInitialPosition(),window.addEventListener("resize",this._onWindowResize),this.options.closeOnEscape&&document.addEventListener("keydown",this._onKeydown),this._eventEmitter.emit(EVENTS$1.open),null==this.options.onOpen||this.options.onOpen.call(this.options));},_proto.close=function(){!this._destroyed&&this._visible&&(this._visible=false,this._$mask&&this._$mask.classList.add("emodal-hidden"),this._$wrap.classList.add("emodal-hidden"),this._stopDragging(),window.removeEventListener("resize",this._onWindowResize),document.removeEventListener("keydown",this._onKeydown),this._eventEmitter.emit(EVENTS$1.close),null==this.options.onClose||this.options.onClose.call(this.options));},_proto.isVisible=function(){return this._visible},_proto.bringToTop=function(){this._destroyed||(this._baseZIndex=ModalProvider.getInstance().bringToTop(),this._$mask&&(this._$mask.style.zIndex=""+this._baseZIndex),this._$wrap.style.zIndex=""+(this._baseZIndex+1));},_proto.setTitle=function(title){this.options.title=title,this._$title&&this._mount(this._$title,title);},_proto.setContent=function(content){this.options.content=content,this._mount(this._$body,content);},_proto.updateOptions=function(options){this.options=deepmerge(this.options,options,{clone:false}),(options.language||options.locales)&&(this._i18n=new I18n(deepmerge(_$MODAL_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"})),this._stopDragging();var wasVisible=this._visible;this._teardownDom(),this._render(),this._bindEvents(),wasVisible&&(this._visible=false,this.open());},_proto.on=function(event,callback){this._eventEmitter.on(event,callback);},_proto.off=function(event,callback){this._eventEmitter.off(event,callback);},_proto.setPosition=function(left,top,bounds){var _ref=bounds||this._bounds(),maxLeft=_ref.maxLeft,maxTop=_ref.maxTop,x=Math.max(0,Math.min(left,maxLeft)),y=Math.max(0,Math.min(top,maxTop));return this._setTranslate(x,y),{x:x,y:y}},_proto.destroy=function(){this._destroyed||(this._stopDragging(),window.removeEventListener("resize",this._onWindowResize),document.removeEventListener("keydown",this._onKeydown),this._teardownDom(),this._eventEmitter.removeAllListeners(),this._destroyed=true,ModalProvider.getInstance().unregister(this));},_proto._resolveContainer=function(container){return "string"==typeof container?document.querySelector(container)||document.body:container||document.body},_proto._toSize=function(value){return null==value||""===value?null:"number"==typeof value?value+"px":value},_proto._render=function(){this.options.showMask&&(this._$mask=document.createElement("div"),this._$mask.className="emodal-mask emodal-hidden",this._$mask.style.zIndex=""+this._baseZIndex,this._container.appendChild(this._$mask)),this._$wrap=document.createElement("div"),this._$wrap.className="emodal-wrap emodal-hidden",this.options.draggable&&this._$wrap.classList.add("emodal-draggable"),this.options.className&&this._$wrap.classList.add(this.options.className),this._$wrap.style.zIndex=""+(this._baseZIndex+1);var w=this._toSize(this.options.width);w&&(this._$wrap.style.width=w);var h=this._toSize(this.options.height);h&&(this._$wrap.style.height=h),this.options.showHeader?(this._$header=document.createElement("div"),this._$header.className="emodal-header",this._$title=document.createElement("div"),this._$title.className="emodal-title",void 0!==this.options.title&&this._mount(this._$title,this.options.title),this._$header.appendChild(this._$title),this.options.showClose&&(this._$close=document.createElement("button"),this._$close.type="button",this._$close.className="emodal-close",this._$close.setAttribute("aria-label",String(this._i18n.t("close"))),this._$close.innerHTML='<svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true">\n <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 <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>',this._$header.appendChild(this._$close)),this._$wrap.appendChild(this._$header)):(this._$header=null,this._$title=null,this._$close=null),this._$body=document.createElement("div"),this._$body.className="emodal-body",void 0!==this.options.content&&this._mount(this._$body,this.options.content),this._$wrap.appendChild(this._$body),this._container.appendChild(this._$wrap);},_proto._mount=function(target,content){var left,right;left=content,(null!=(right=HTMLElement)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?(target.innerHTML="",target.appendChild(content)):target.innerHTML=null!=content?content:"";},_proto._teardownDom=function(){var _this__$mask;this._$wrap.parentNode&&this._$wrap.parentNode.removeChild(this._$wrap),(null==(_this__$mask=this._$mask)?void 0:_this__$mask.parentNode)&&this._$mask.parentNode.removeChild(this._$mask),this._$mask=null,this._$header=null,this._$title=null,this._$close=null;},_proto._bindEvents=function(){var _this__$close,_this__$mask,_this__$mask1;(null==(_this__$close=this._$close)||_this__$close.addEventListener("click",this._onCloseClick),this.options.showMask&&this.options.maskClosable)&&(null==(_this__$mask1=this._$mask)||_this__$mask1.addEventListener("click",this._onMaskClick));this.options.draggable&&this._$header&&(this._$header.addEventListener("mousedown",this._onHeaderPointerDown),this._$header.addEventListener("touchstart",this._onHeaderPointerDown,{passive:false})),this._$wrap.addEventListener("pointerdown",this._onModalPointerDown),this._$wrap.addEventListener("dblclick",this._onWrapDblClick),null==(_this__$mask=this._$mask)||_this__$mask.addEventListener("pointerdown",this._onModalPointerDown);},_proto._onCloseClick=function(e){e.stopPropagation(),this.close();},_proto._onMaskClick=function(){this.close();},_proto._onModalPointerDown=function(){this.bringToTop();},_proto._onWrapDblClick=function(e){e.stopPropagation();},_proto._onKeydown=function(e){"Escape"!==e.key&&"Esc"!==e.key||this.close();},_proto._onWindowResize=function(){if(this._dragging)return this._dragBounds=this._bounds(),void this.setPosition(this._pos.x,this._pos.y,this._dragBounds);this.setPosition(this._pos.x,this._pos.y);},_proto._getPoint=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return {x:t.clientX,y:t.clientY}}return {x:e.clientX,y:e.clientY}},_proto._onHeaderPointerDown=function(e){if(this.options.draggable){var target=e.target;if(!(this._$close&&(target===this._$close||this._$close.contains(target))||"button"in e&&0!==e.button)){var point=this._getPoint(e),rect=this._$wrap.getBoundingClientRect();this._dragOffset={x:point.x-rect.left,y:point.y-rect.top},this._dragBounds=this._bounds(),this._dragging=true,this._$wrap.style.willChange="transform",document.body.classList.add("emodal-dragging"),document.addEventListener("mousemove",this._onPointerMove),document.addEventListener("mouseup",this._onPointerUp),document.addEventListener("touchmove",this._onPointerMove,{passive:false}),document.addEventListener("touchend",this._onPointerUp),document.addEventListener("touchcancel",this._onPointerUp),this._eventEmitter.emit(EVENTS$1.dragStart);}}},_proto._onPointerMove=function(e){this._dragging&&(e.cancelable&&e.preventDefault(),this._dragPoint=this._getPoint(e),null===this._dragRafId&&(this._dragRafId=requestAnimationFrame(this._onDragFrame)));},_proto._onDragFrame=function(){if(this._dragRafId=null,this._dragging&&this._dragPoint){var left=this._dragPoint.x-this._dragOffset.x,top=this._dragPoint.y-this._dragOffset.y,_this__dragBounds=this._dragBounds,maxLeft=_this__dragBounds.maxLeft,maxTop=_this__dragBounds.maxTop,x=Math.max(0,Math.min(left,maxLeft)),y=Math.max(0,Math.min(top,maxTop));this._setTranslate(x,y),this._eventEmitter.emit(EVENTS$1.dragging,{x:x,y:y});}},_proto._onPointerUp=function(){this._dragging&&(this._stopDragging(),this._eventEmitter.emit(EVENTS$1.dragEnd,{left:this._pos.x,top:this._pos.y}));},_proto._stopDragging=function(){null!==this._dragRafId&&(cancelAnimationFrame(this._dragRafId),this._dragRafId=null),this._dragPoint=null,this._dragging?(this._dragging=false,this._$wrap&&(this._$wrap.style.willChange=""),document.body.classList.remove("emodal-dragging"),document.removeEventListener("mousemove",this._onPointerMove),document.removeEventListener("mouseup",this._onPointerUp),document.removeEventListener("touchmove",this._onPointerMove),document.removeEventListener("touchend",this._onPointerUp),document.removeEventListener("touchcancel",this._onPointerUp)):document.body.classList.remove("emodal-dragging");},_proto._bounds=function(){var vw=document.documentElement.clientWidth,vh=document.documentElement.clientHeight,w=this._$wrap.offsetWidth,h=this._$wrap.offsetHeight;return {maxLeft:Math.max(0,vw-w),maxTop:Math.max(0,vh-h)}},_proto._setTranslate=function(x,y){this._pos={x:x,y:y},this._$wrap.style.transform="translate3d("+x+"px, "+y+"px, 0)";},_proto._center=function(){var vw=document.documentElement.clientWidth,vh=document.documentElement.clientHeight,w=this._$wrap.offsetWidth,h=this._$wrap.offsetHeight;this.setPosition((vw-w)/2,(vh-h)/2);},_proto._applyInitialPosition=function(){var obj,position=this.options.position;position&&"object"==(void 0===position?"undefined":(obj=position)&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj)?this.setPosition(position.x,position.y):this._center();},Modal}();Modal.VERSION="0.0.1",Modal.EVENTS=EVENTS$1;
|
|
9160
8979
|
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
*/
|
|
9168
|
-
EventEmitter.prototype.listeners = function listeners(event) {
|
|
9169
|
-
var evt = prefix ? prefix + event : event
|
|
9170
|
-
, handlers = this._events[evt];
|
|
8980
|
+
/*
|
|
8981
|
+
* @ezuikit/control-virtual-scroll v0.0.1
|
|
8982
|
+
* Copyright (c) 2026-06-29 Ezviz-OpenBiz
|
|
8983
|
+
* Released under the MIT License.
|
|
8984
|
+
*/
|
|
8985
|
+
var EVENTS={render:"render",scroll:"scroll",reachTop:"reachTop",reachBottom:"reachBottom"},DefaultOptions={itemHeight:40,buffer:5,smooth:true};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _OVERWRITE_MERGE_={clone:false,arrayMerge:function(_dest,src){return src}},VirtualScroll=function(){function VirtualScroll(container,options){this._active=new Map,this._pool=[],this._containerHeight=0,this._startIndex=-1,this._endIndex=-1,this._ticking=false,this._destroyed=false,this._resizeObserver=null,this._eventEmitter=new EventEmitter,this.options=deepmerge(DefaultOptions,null!=options?options:{},_OVERWRITE_MERGE_),this._wrapper=this._resolveContainer(null!=container?container:this.options.container),this._onScroll=this._onScroll.bind(this),this._onResize=this._onResize.bind(this),this._wrapper.classList.add("evscroll-wrapper"),"static"===getComputedStyle(this._wrapper).position&&(this._wrapper.style.position="relative"),this._wrapper.style.overflowY="auto",this._$content=document.createElement("div"),this._$content.className="evscroll-content",this._$viewport=document.createElement("div"),this._$viewport.className="evscroll-viewport",this._$content.appendChild(this._$viewport),this._wrapper.appendChild(this._$content),this._containerHeight=this._wrapper.clientHeight,this._wrapper.addEventListener("scroll",this._onScroll,{passive:true}),this._setupResizeObserver(),this._syncContentHeight(),this._compute(true);}var _proto=VirtualScroll.prototype;return _proto.getTotalCount=function(){return this.options.data?this.options.data.length:this.options.total||0},_proto.getCurrentRange=function(){return {startIndex:this._startIndex,endIndex:this._endIndex}},_proto.scrollToIndex=function(index,smooth){var total=this.getTotalCount();if(index<0||index>=total)return false;var top=index*(this.options.itemHeight||DefaultOptions.itemHeight),useSmooth=void 0===smooth?this.options.smooth:smooth;return "function"==typeof this._wrapper.scrollTo?this._wrapper.scrollTo({top:top,behavior:useSmooth?"smooth":"auto"}):this._wrapper.scrollTop=top,true},_proto.scrollToTop=function(smooth){this.scrollToIndex(0,smooth);},_proto.scrollToBottom=function(smooth){var total=this.getTotalCount();total>0&&this.scrollToIndex(total-1,smooth);},_proto.setData=function(data){this.options.data=data,this.refresh();},_proto.setTotal=function(total){this.options.total=total,this.options.data=void 0,this.refresh();},_proto.refresh=function(){this._reset(),this._syncContentHeight(),this._compute(true);},_proto.updateOptions=function(options){this.options=deepmerge(this.options,options,_OVERWRITE_MERGE_),this.refresh();},_proto.on=function(event,callback){this._eventEmitter.on(event,callback);},_proto.off=function(event,callback){this._eventEmitter.off(event,callback);},_proto.destroy=function(){this._destroyed||(this._wrapper.removeEventListener("scroll",this._onScroll),this._resizeObserver?(this._resizeObserver.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onResize),this._reset(),this._$content.parentNode===this._wrapper&&this._wrapper.removeChild(this._$content),this._wrapper.classList.remove("evscroll-wrapper"),this._eventEmitter.removeAllListeners(),this._destroyed=true);},_proto._resolveContainer=function(container){var el="string"==typeof container?document.querySelector(container):container;if(!el)throw new Error("[VirtualScroll] container not found: "+String(container));return el},_proto._syncContentHeight=function(){this._$content.style.height=this.getTotalCount()*this._itemHeight+"px";},_proto._onScroll=function(){var _this=this;this._eventEmitter.emit(EVENTS.scroll,this._wrapper.scrollTop),null==this.options.onScroll||this.options.onScroll.call(this.options,this._wrapper.scrollTop),this._ticking||(this._ticking=true,requestAnimationFrame(function(){_this._compute(false),_this._ticking=false;}));},_proto._setupResizeObserver=function(){var _this=this;"undefined"!=typeof ResizeObserver?(this._resizeObserver=new ResizeObserver(function(){return _this._onResize()}),this._resizeObserver.observe(this._wrapper)):window.addEventListener("resize",this._onResize);},_proto._onResize=function(){var h=this._wrapper.clientHeight;h!==this._containerHeight&&(this._containerHeight=h,this._compute(true));},_proto._compute=function(force){if(!this._destroyed){var total=this.getTotalCount();if(0!==total&&0!==this._containerHeight||(this._containerHeight=this._wrapper.clientHeight,0!==total)){var scrollTop=this._wrapper.scrollTop,itemHeight=this._itemHeight,buffer=this._buffer,rawStart=Math.floor(scrollTop/itemHeight),start=Math.max(0,rawStart-buffer),rawEnd=rawStart+Math.ceil(this._containerHeight/itemHeight)-1,end=Math.min(total-1,rawEnd+buffer);if(force||start!==this._startIndex||end!==this._endIndex){this._startIndex=start,this._endIndex=end,this._updateRange(start,end);var range={startIndex:start,endIndex:end};this._eventEmitter.emit(EVENTS.render,range),null==this.options.onRender||this.options.onRender.call(this.options,range),0===start&&this._eventEmitter.emit(EVENTS.reachTop),end===total-1&&this._eventEmitter.emit(EVENTS.reachBottom);}}else this._reset();}},_proto._updateRange=function(start,end){var _this=this,itemHeight=this._itemHeight,toRecycle=[];this._active.forEach(function(_el,idx){(idx<start||idx>end)&&toRecycle.push(idx);}),toRecycle.forEach(function(idx){var el=_this._active.get(idx);el&&(el.style.display="none",_this._pool.push(el)),_this._active.delete(idx);});for(var i=start;i<=end;i++)if(!this._active.has(i)){var el=this._pool.pop()||this._createItemEl();el.style.display="",el.style.top=i*itemHeight+"px",el.style.height=itemHeight+"px",el.setAttribute("data-index",String(i)),this._fillItem(el,i),el.parentNode!==this._$viewport&&this._$viewport.appendChild(el),this._active.set(i,el);}},_proto._createItemEl=function(){var el=document.createElement("div");return el.className="evscroll-item",el},_proto._fillItem=function(el,index){var left,right,item=this.options.data?this.options.data[index]:void 0,content=this.options.renderItem(index,item);left=content,(null!=(right=HTMLElement)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?el.replaceChildren(content):el.innerHTML=null!=content?content:"";},_proto._reset=function(){this._active.clear(),this._pool=[],this._$viewport.replaceChildren(),this._startIndex=-1,this._endIndex=-1;},_create_class$9(VirtualScroll,[{key:"_itemHeight",get:function(){return this.options.itemHeight||DefaultOptions.itemHeight}},{key:"_buffer",get:function(){var _this_options_buffer;return null!=(_this_options_buffer=this.options.buffer)?_this_options_buffer:DefaultOptions.buffer}}]),VirtualScroll}();VirtualScroll.VERSION="0.0.1",VirtualScroll.EVENTS=EVENTS;
|
|
9171
8986
|
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
}
|
|
9178
|
-
|
|
9179
|
-
return ee;
|
|
9180
|
-
};
|
|
9181
|
-
|
|
9182
|
-
/**
|
|
9183
|
-
* Return the number of listeners listening to a given event.
|
|
9184
|
-
*
|
|
9185
|
-
* @param {(String|Symbol)} event The event name.
|
|
9186
|
-
* @returns {Number} The number of listeners.
|
|
9187
|
-
* @public
|
|
9188
|
-
*/
|
|
9189
|
-
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
9190
|
-
var evt = prefix ? prefix + event : event
|
|
9191
|
-
, listeners = this._events[evt];
|
|
9192
|
-
|
|
9193
|
-
if (!listeners) return 0;
|
|
9194
|
-
if (listeners.fn) return 1;
|
|
9195
|
-
return listeners.length;
|
|
9196
|
-
};
|
|
9197
|
-
|
|
9198
|
-
/**
|
|
9199
|
-
* Calls each of the listeners registered for a given event.
|
|
9200
|
-
*
|
|
9201
|
-
* @param {(String|Symbol)} event The event name.
|
|
9202
|
-
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
9203
|
-
* @public
|
|
9204
|
-
*/
|
|
9205
|
-
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
9206
|
-
var evt = prefix ? prefix + event : event;
|
|
9207
|
-
|
|
9208
|
-
if (!this._events[evt]) return false;
|
|
9209
|
-
|
|
9210
|
-
var listeners = this._events[evt]
|
|
9211
|
-
, len = arguments.length
|
|
9212
|
-
, args
|
|
9213
|
-
, i;
|
|
9214
|
-
|
|
9215
|
-
if (listeners.fn) {
|
|
9216
|
-
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
9217
|
-
|
|
9218
|
-
switch (len) {
|
|
9219
|
-
case 1: return listeners.fn.call(listeners.context), true;
|
|
9220
|
-
case 2: return listeners.fn.call(listeners.context, a1), true;
|
|
9221
|
-
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
|
9222
|
-
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
9223
|
-
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
9224
|
-
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
9225
|
-
}
|
|
9226
|
-
|
|
9227
|
-
for (i = 1, args = new Array(len -1); i < len; i++) {
|
|
9228
|
-
args[i - 1] = arguments[i];
|
|
9229
|
-
}
|
|
9230
|
-
|
|
9231
|
-
listeners.fn.apply(listeners.context, args);
|
|
9232
|
-
} else {
|
|
9233
|
-
var length = listeners.length
|
|
9234
|
-
, j;
|
|
9235
|
-
|
|
9236
|
-
for (i = 0; i < length; i++) {
|
|
9237
|
-
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
9238
|
-
|
|
9239
|
-
switch (len) {
|
|
9240
|
-
case 1: listeners[i].fn.call(listeners[i].context); break;
|
|
9241
|
-
case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
|
9242
|
-
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
|
9243
|
-
case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
|
9244
|
-
default:
|
|
9245
|
-
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
|
9246
|
-
args[j - 1] = arguments[j];
|
|
9247
|
-
}
|
|
9248
|
-
|
|
9249
|
-
listeners[i].fn.apply(listeners[i].context, args);
|
|
9250
|
-
}
|
|
9251
|
-
}
|
|
9252
|
-
}
|
|
9253
|
-
|
|
9254
|
-
return true;
|
|
9255
|
-
};
|
|
9256
|
-
|
|
9257
|
-
/**
|
|
9258
|
-
* Add a listener for a given event.
|
|
9259
|
-
*
|
|
9260
|
-
* @param {(String|Symbol)} event The event name.
|
|
9261
|
-
* @param {Function} fn The listener function.
|
|
9262
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
9263
|
-
* @returns {EventEmitter} `this`.
|
|
9264
|
-
* @public
|
|
9265
|
-
*/
|
|
9266
|
-
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
9267
|
-
return addListener(this, event, fn, context, false);
|
|
9268
|
-
};
|
|
9269
|
-
|
|
9270
|
-
/**
|
|
9271
|
-
* Add a one-time listener for a given event.
|
|
9272
|
-
*
|
|
9273
|
-
* @param {(String|Symbol)} event The event name.
|
|
9274
|
-
* @param {Function} fn The listener function.
|
|
9275
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
9276
|
-
* @returns {EventEmitter} `this`.
|
|
9277
|
-
* @public
|
|
9278
|
-
*/
|
|
9279
|
-
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
9280
|
-
return addListener(this, event, fn, context, true);
|
|
9281
|
-
};
|
|
9282
|
-
|
|
9283
|
-
/**
|
|
9284
|
-
* Remove the listeners of a given event.
|
|
9285
|
-
*
|
|
9286
|
-
* @param {(String|Symbol)} event The event name.
|
|
9287
|
-
* @param {Function} fn Only remove the listeners that match this function.
|
|
9288
|
-
* @param {*} context Only remove the listeners that have this context.
|
|
9289
|
-
* @param {Boolean} once Only remove one-time listeners.
|
|
9290
|
-
* @returns {EventEmitter} `this`.
|
|
9291
|
-
* @public
|
|
9292
|
-
*/
|
|
9293
|
-
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
9294
|
-
var evt = prefix ? prefix + event : event;
|
|
9295
|
-
|
|
9296
|
-
if (!this._events[evt]) return this;
|
|
9297
|
-
if (!fn) {
|
|
9298
|
-
clearEvent(this, evt);
|
|
9299
|
-
return this;
|
|
9300
|
-
}
|
|
9301
|
-
|
|
9302
|
-
var listeners = this._events[evt];
|
|
9303
|
-
|
|
9304
|
-
if (listeners.fn) {
|
|
9305
|
-
if (
|
|
9306
|
-
listeners.fn === fn &&
|
|
9307
|
-
(!once || listeners.once) &&
|
|
9308
|
-
(!context || listeners.context === context)
|
|
9309
|
-
) {
|
|
9310
|
-
clearEvent(this, evt);
|
|
9311
|
-
}
|
|
9312
|
-
} else {
|
|
9313
|
-
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
9314
|
-
if (
|
|
9315
|
-
listeners[i].fn !== fn ||
|
|
9316
|
-
(once && !listeners[i].once) ||
|
|
9317
|
-
(context && listeners[i].context !== context)
|
|
9318
|
-
) {
|
|
9319
|
-
events.push(listeners[i]);
|
|
9320
|
-
}
|
|
9321
|
-
}
|
|
9322
|
-
|
|
9323
|
-
//
|
|
9324
|
-
// Reset the array, or remove it completely if we have no more listeners.
|
|
9325
|
-
//
|
|
9326
|
-
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
9327
|
-
else clearEvent(this, evt);
|
|
9328
|
-
}
|
|
9329
|
-
|
|
9330
|
-
return this;
|
|
9331
|
-
};
|
|
9332
|
-
|
|
9333
|
-
/**
|
|
9334
|
-
* Remove all listeners, or those of the specified event.
|
|
9335
|
-
*
|
|
9336
|
-
* @param {(String|Symbol)} [event] The event name.
|
|
9337
|
-
* @returns {EventEmitter} `this`.
|
|
9338
|
-
* @public
|
|
9339
|
-
*/
|
|
9340
|
-
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
9341
|
-
var evt;
|
|
9342
|
-
|
|
9343
|
-
if (event) {
|
|
9344
|
-
evt = prefix ? prefix + event : event;
|
|
9345
|
-
if (this._events[evt]) clearEvent(this, evt);
|
|
9346
|
-
} else {
|
|
9347
|
-
this._events = new Events();
|
|
9348
|
-
this._eventsCount = 0;
|
|
9349
|
-
}
|
|
9350
|
-
|
|
9351
|
-
return this;
|
|
9352
|
-
};
|
|
9353
|
-
|
|
9354
|
-
//
|
|
9355
|
-
// Alias methods names because people roll like that.
|
|
9356
|
-
//
|
|
9357
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
9358
|
-
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
9359
|
-
|
|
9360
|
-
//
|
|
9361
|
-
// Expose the prefix.
|
|
9362
|
-
//
|
|
9363
|
-
EventEmitter.prefixed = prefix;
|
|
9364
|
-
|
|
9365
|
-
//
|
|
9366
|
-
// Allow `EventEmitter` to be imported as module namespace.
|
|
9367
|
-
//
|
|
9368
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
9369
|
-
|
|
9370
|
-
//
|
|
9371
|
-
// Expose the module.
|
|
9372
|
-
//
|
|
9373
|
-
{
|
|
9374
|
-
module.exports = EventEmitter;
|
|
9375
|
-
}
|
|
9376
|
-
} (eventemitter3));
|
|
9377
|
-
return eventemitter3.exports;
|
|
9378
|
-
}
|
|
9379
|
-
|
|
9380
|
-
var eventemitter3Exports = requireEventemitter3();
|
|
9381
|
-
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
9382
|
-
|
|
9383
|
-
/*
|
|
9384
|
-
* @ezuikit/control-modal v0.0.1
|
|
9385
|
-
* Copyright (c) 2026-07-06 Ezviz-OpenBiz
|
|
9386
|
-
* Released under the MIT License.
|
|
9387
|
-
*/
|
|
9388
|
-
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_class$a(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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:true}:{done:false,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 ModalProvider=function(){function ModalProvider(){this._instances=new Set,this._zIndexCounter=1e3;}var _proto=ModalProvider.prototype;return _proto.register=function(modal,minZIndex){this._instances.add(modal);var base=Math.max(this._zIndexCounter,minZIndex||1e3);return this._zIndexCounter=base+2,base},_proto.unregister=function(modal){this._instances.delete(modal);},_proto.bringToTop=function(){var base=this._zIndexCounter;return this._zIndexCounter+=2,base},_proto.getInstances=function(){return Array.from(this._instances)},_proto.destroyAll=function(){for(var _step,_iterator=_create_for_of_iterator_helper_loose$2(this.getInstances());!(_step=_iterator()).done;){var modal=_step.value;modal._destroyed||modal.destroy();}},ModalProvider.getInstance=function(){return ModalProvider._instance||(ModalProvider._instance=new ModalProvider),ModalProvider._instance},ModalProvider.resetInstance=function(){ModalProvider._instance&&(ModalProvider._instance._instances.clear(),ModalProvider._instance._zIndexCounter=1e3,ModalProvider._instance=null);},_create_class$a(ModalProvider,[{key:"count",get:function(){return this._instances.size}}]),ModalProvider}();ModalProvider._instance=null;var EVENTS$1={open:"open",close:"close",dragStart:"dragStart",dragging:"dragging",dragEnd:"dragEnd"},_$MODAL_LOCALES$_={zh:{close:"关闭"},en:{close:"Close"}},__$MODAL_DEFAULT_OPTIONS$__={width:420,position:"center",draggable:true,showMask:true,maskClosable:true,showHeader:true,showClose:true,closeOnEscape:true,open:false,zIndex:1e3,language:"zh"};var Modal=function(){function Modal(container,options){this._$mask=null,this._$header=null,this._$title=null,this._$close=null,this._visible=false,this._dragging=false,this._dragOffset={x:0,y:0},this._destroyed=false,this._dragBounds={maxLeft:0,maxTop:0},this._dragPoint=null,this._dragRafId=null,this._pos={x:0,y:0},this.options=deepmerge(__$MODAL_DEFAULT_OPTIONS$__,null!=options?options:{},{clone:false}),this._eventEmitter=new EventEmitter,this._i18n=new I18n(deepmerge(_$MODAL_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._container=this._resolveContainer(container),this._baseZIndex=ModalProvider.getInstance().register(this,this.options.zIndex),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onDragFrame=this._onDragFrame.bind(this),this._onHeaderPointerDown=this._onHeaderPointerDown.bind(this),this._onCloseClick=this._onCloseClick.bind(this),this._onMaskClick=this._onMaskClick.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onWindowResize=this._onWindowResize.bind(this),this._onModalPointerDown=this._onModalPointerDown.bind(this),this._onWrapDblClick=this._onWrapDblClick.bind(this),this._render(),this._bindEvents(),this.options.open&&this.open();}var _proto=Modal.prototype;return _proto.open=function(){this._destroyed||this._visible||(this._visible=true,this._$mask&&this._$mask.classList.remove("emodal-hidden"),this._$wrap.classList.remove("emodal-hidden"),this._applyInitialPosition(),window.addEventListener("resize",this._onWindowResize),this.options.closeOnEscape&&document.addEventListener("keydown",this._onKeydown),this._eventEmitter.emit(EVENTS$1.open),null==this.options.onOpen||this.options.onOpen.call(this.options));},_proto.close=function(){!this._destroyed&&this._visible&&(this._visible=false,this._$mask&&this._$mask.classList.add("emodal-hidden"),this._$wrap.classList.add("emodal-hidden"),this._stopDragging(),window.removeEventListener("resize",this._onWindowResize),document.removeEventListener("keydown",this._onKeydown),this._eventEmitter.emit(EVENTS$1.close),null==this.options.onClose||this.options.onClose.call(this.options));},_proto.isVisible=function(){return this._visible},_proto.bringToTop=function(){this._destroyed||(this._baseZIndex=ModalProvider.getInstance().bringToTop(),this._$mask&&(this._$mask.style.zIndex=""+this._baseZIndex),this._$wrap.style.zIndex=""+(this._baseZIndex+1));},_proto.setTitle=function(title){this.options.title=title,this._$title&&this._mount(this._$title,title);},_proto.setContent=function(content){this.options.content=content,this._mount(this._$body,content);},_proto.updateOptions=function(options){this.options=deepmerge(this.options,options,{clone:false}),(options.language||options.locales)&&(this._i18n=new I18n(deepmerge(_$MODAL_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"})),this._stopDragging();var wasVisible=this._visible;this._teardownDom(),this._render(),this._bindEvents(),wasVisible&&(this._visible=false,this.open());},_proto.on=function(event,callback){this._eventEmitter.on(event,callback);},_proto.off=function(event,callback){this._eventEmitter.off(event,callback);},_proto.setPosition=function(left,top,bounds){var _ref=bounds||this._bounds(),maxLeft=_ref.maxLeft,maxTop=_ref.maxTop,x=Math.max(0,Math.min(left,maxLeft)),y=Math.max(0,Math.min(top,maxTop));return this._setTranslate(x,y),{x:x,y:y}},_proto.destroy=function(){this._destroyed||(this._stopDragging(),window.removeEventListener("resize",this._onWindowResize),document.removeEventListener("keydown",this._onKeydown),this._teardownDom(),this._eventEmitter.removeAllListeners(),this._destroyed=true,ModalProvider.getInstance().unregister(this));},_proto._resolveContainer=function(container){return "string"==typeof container?document.querySelector(container)||document.body:container||document.body},_proto._toSize=function(value){return null==value||""===value?null:"number"==typeof value?value+"px":value},_proto._render=function(){this.options.showMask&&(this._$mask=document.createElement("div"),this._$mask.className="emodal-mask emodal-hidden",this._$mask.style.zIndex=""+this._baseZIndex,this._container.appendChild(this._$mask)),this._$wrap=document.createElement("div"),this._$wrap.className="emodal-wrap emodal-hidden",this.options.draggable&&this._$wrap.classList.add("emodal-draggable"),this.options.className&&this._$wrap.classList.add(this.options.className),this._$wrap.style.zIndex=""+(this._baseZIndex+1);var w=this._toSize(this.options.width);w&&(this._$wrap.style.width=w);var h=this._toSize(this.options.height);h&&(this._$wrap.style.height=h),this.options.showHeader?(this._$header=document.createElement("div"),this._$header.className="emodal-header",this._$title=document.createElement("div"),this._$title.className="emodal-title",void 0!==this.options.title&&this._mount(this._$title,this.options.title),this._$header.appendChild(this._$title),this.options.showClose&&(this._$close=document.createElement("button"),this._$close.type="button",this._$close.className="emodal-close",this._$close.setAttribute("aria-label",String(this._i18n.t("close"))),this._$close.innerHTML='<svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true">\n <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 <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>',this._$header.appendChild(this._$close)),this._$wrap.appendChild(this._$header)):(this._$header=null,this._$title=null,this._$close=null),this._$body=document.createElement("div"),this._$body.className="emodal-body",void 0!==this.options.content&&this._mount(this._$body,this.options.content),this._$wrap.appendChild(this._$body),this._container.appendChild(this._$wrap);},_proto._mount=function(target,content){var left,right;left=content,(null!=(right=HTMLElement)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?(target.innerHTML="",target.appendChild(content)):target.innerHTML=null!=content?content:"";},_proto._teardownDom=function(){var _this__$mask;this._$wrap.parentNode&&this._$wrap.parentNode.removeChild(this._$wrap),(null==(_this__$mask=this._$mask)?void 0:_this__$mask.parentNode)&&this._$mask.parentNode.removeChild(this._$mask),this._$mask=null,this._$header=null,this._$title=null,this._$close=null;},_proto._bindEvents=function(){var _this__$close,_this__$mask,_this__$mask1;(null==(_this__$close=this._$close)||_this__$close.addEventListener("click",this._onCloseClick),this.options.showMask&&this.options.maskClosable)&&(null==(_this__$mask1=this._$mask)||_this__$mask1.addEventListener("click",this._onMaskClick));this.options.draggable&&this._$header&&(this._$header.addEventListener("mousedown",this._onHeaderPointerDown),this._$header.addEventListener("touchstart",this._onHeaderPointerDown,{passive:false})),this._$wrap.addEventListener("pointerdown",this._onModalPointerDown),this._$wrap.addEventListener("dblclick",this._onWrapDblClick),null==(_this__$mask=this._$mask)||_this__$mask.addEventListener("pointerdown",this._onModalPointerDown);},_proto._onCloseClick=function(e){e.stopPropagation(),this.close();},_proto._onMaskClick=function(){this.close();},_proto._onModalPointerDown=function(){this.bringToTop();},_proto._onWrapDblClick=function(e){e.stopPropagation();},_proto._onKeydown=function(e){"Escape"!==e.key&&"Esc"!==e.key||this.close();},_proto._onWindowResize=function(){if(this._dragging)return this._dragBounds=this._bounds(),void this.setPosition(this._pos.x,this._pos.y,this._dragBounds);this.setPosition(this._pos.x,this._pos.y);},_proto._getPoint=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return {x:t.clientX,y:t.clientY}}return {x:e.clientX,y:e.clientY}},_proto._onHeaderPointerDown=function(e){if(this.options.draggable){var target=e.target;if(!(this._$close&&(target===this._$close||this._$close.contains(target))||"button"in e&&0!==e.button)){var point=this._getPoint(e),rect=this._$wrap.getBoundingClientRect();this._dragOffset={x:point.x-rect.left,y:point.y-rect.top},this._dragBounds=this._bounds(),this._dragging=true,this._$wrap.style.willChange="transform",document.body.classList.add("emodal-dragging"),document.addEventListener("mousemove",this._onPointerMove),document.addEventListener("mouseup",this._onPointerUp),document.addEventListener("touchmove",this._onPointerMove,{passive:false}),document.addEventListener("touchend",this._onPointerUp),document.addEventListener("touchcancel",this._onPointerUp),this._eventEmitter.emit(EVENTS$1.dragStart);}}},_proto._onPointerMove=function(e){this._dragging&&(e.cancelable&&e.preventDefault(),this._dragPoint=this._getPoint(e),null===this._dragRafId&&(this._dragRafId=requestAnimationFrame(this._onDragFrame)));},_proto._onDragFrame=function(){if(this._dragRafId=null,this._dragging&&this._dragPoint){var left=this._dragPoint.x-this._dragOffset.x,top=this._dragPoint.y-this._dragOffset.y,_this__dragBounds=this._dragBounds,maxLeft=_this__dragBounds.maxLeft,maxTop=_this__dragBounds.maxTop,x=Math.max(0,Math.min(left,maxLeft)),y=Math.max(0,Math.min(top,maxTop));this._setTranslate(x,y),this._eventEmitter.emit(EVENTS$1.dragging,{x:x,y:y});}},_proto._onPointerUp=function(){this._dragging&&(this._stopDragging(),this._eventEmitter.emit(EVENTS$1.dragEnd,{left:this._pos.x,top:this._pos.y}));},_proto._stopDragging=function(){null!==this._dragRafId&&(cancelAnimationFrame(this._dragRafId),this._dragRafId=null),this._dragPoint=null,this._dragging?(this._dragging=false,this._$wrap&&(this._$wrap.style.willChange=""),document.body.classList.remove("emodal-dragging"),document.removeEventListener("mousemove",this._onPointerMove),document.removeEventListener("mouseup",this._onPointerUp),document.removeEventListener("touchmove",this._onPointerMove),document.removeEventListener("touchend",this._onPointerUp),document.removeEventListener("touchcancel",this._onPointerUp)):document.body.classList.remove("emodal-dragging");},_proto._bounds=function(){var vw=document.documentElement.clientWidth,vh=document.documentElement.clientHeight,w=this._$wrap.offsetWidth,h=this._$wrap.offsetHeight;return {maxLeft:Math.max(0,vw-w),maxTop:Math.max(0,vh-h)}},_proto._setTranslate=function(x,y){this._pos={x:x,y:y},this._$wrap.style.transform="translate3d("+x+"px, "+y+"px, 0)";},_proto._center=function(){var vw=document.documentElement.clientWidth,vh=document.documentElement.clientHeight,w=this._$wrap.offsetWidth,h=this._$wrap.offsetHeight;this.setPosition((vw-w)/2,(vh-h)/2);},_proto._applyInitialPosition=function(){var obj,position=this.options.position;position&&"object"==(void 0===position?"undefined":(obj=position)&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj)?this.setPosition(position.x,position.y):this._center();},Modal}();Modal.VERSION="0.0.1",Modal.EVENTS=EVENTS$1;
|
|
9389
|
-
|
|
9390
|
-
/*
|
|
9391
|
-
* @ezuikit/control-virtual-scroll v0.0.1
|
|
9392
|
-
* Copyright (c) 2026-06-29 Ezviz-OpenBiz
|
|
9393
|
-
* Released under the MIT License.
|
|
9394
|
-
*/
|
|
9395
|
-
var EVENTS={render:"render",scroll:"scroll",reachTop:"reachTop",reachBottom:"reachBottom"},DefaultOptions={itemHeight:40,buffer:5,smooth:true};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _OVERWRITE_MERGE_={clone:false,arrayMerge:function(_dest,src){return src}},VirtualScroll=function(){function VirtualScroll(container,options){this._active=new Map,this._pool=[],this._containerHeight=0,this._startIndex=-1,this._endIndex=-1,this._ticking=false,this._destroyed=false,this._resizeObserver=null,this._eventEmitter=new EventEmitter,this.options=deepmerge(DefaultOptions,null!=options?options:{},_OVERWRITE_MERGE_),this._wrapper=this._resolveContainer(null!=container?container:this.options.container),this._onScroll=this._onScroll.bind(this),this._onResize=this._onResize.bind(this),this._wrapper.classList.add("evscroll-wrapper"),"static"===getComputedStyle(this._wrapper).position&&(this._wrapper.style.position="relative"),this._wrapper.style.overflowY="auto",this._$content=document.createElement("div"),this._$content.className="evscroll-content",this._$viewport=document.createElement("div"),this._$viewport.className="evscroll-viewport",this._$content.appendChild(this._$viewport),this._wrapper.appendChild(this._$content),this._containerHeight=this._wrapper.clientHeight,this._wrapper.addEventListener("scroll",this._onScroll,{passive:true}),this._setupResizeObserver(),this._syncContentHeight(),this._compute(true);}var _proto=VirtualScroll.prototype;return _proto.getTotalCount=function(){return this.options.data?this.options.data.length:this.options.total||0},_proto.getCurrentRange=function(){return {startIndex:this._startIndex,endIndex:this._endIndex}},_proto.scrollToIndex=function(index,smooth){var total=this.getTotalCount();if(index<0||index>=total)return false;var top=index*(this.options.itemHeight||DefaultOptions.itemHeight),useSmooth=void 0===smooth?this.options.smooth:smooth;return "function"==typeof this._wrapper.scrollTo?this._wrapper.scrollTo({top:top,behavior:useSmooth?"smooth":"auto"}):this._wrapper.scrollTop=top,true},_proto.scrollToTop=function(smooth){this.scrollToIndex(0,smooth);},_proto.scrollToBottom=function(smooth){var total=this.getTotalCount();total>0&&this.scrollToIndex(total-1,smooth);},_proto.setData=function(data){this.options.data=data,this.refresh();},_proto.setTotal=function(total){this.options.total=total,this.options.data=void 0,this.refresh();},_proto.refresh=function(){this._reset(),this._syncContentHeight(),this._compute(true);},_proto.updateOptions=function(options){this.options=deepmerge(this.options,options,_OVERWRITE_MERGE_),this.refresh();},_proto.on=function(event,callback){this._eventEmitter.on(event,callback);},_proto.off=function(event,callback){this._eventEmitter.off(event,callback);},_proto.destroy=function(){this._destroyed||(this._wrapper.removeEventListener("scroll",this._onScroll),this._resizeObserver?(this._resizeObserver.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onResize),this._reset(),this._$content.parentNode===this._wrapper&&this._wrapper.removeChild(this._$content),this._wrapper.classList.remove("evscroll-wrapper"),this._eventEmitter.removeAllListeners(),this._destroyed=true);},_proto._resolveContainer=function(container){var el="string"==typeof container?document.querySelector(container):container;if(!el)throw new Error("[VirtualScroll] container not found: "+String(container));return el},_proto._syncContentHeight=function(){this._$content.style.height=this.getTotalCount()*this._itemHeight+"px";},_proto._onScroll=function(){var _this=this;this._eventEmitter.emit(EVENTS.scroll,this._wrapper.scrollTop),null==this.options.onScroll||this.options.onScroll.call(this.options,this._wrapper.scrollTop),this._ticking||(this._ticking=true,requestAnimationFrame(function(){_this._compute(false),_this._ticking=false;}));},_proto._setupResizeObserver=function(){var _this=this;"undefined"!=typeof ResizeObserver?(this._resizeObserver=new ResizeObserver(function(){return _this._onResize()}),this._resizeObserver.observe(this._wrapper)):window.addEventListener("resize",this._onResize);},_proto._onResize=function(){var h=this._wrapper.clientHeight;h!==this._containerHeight&&(this._containerHeight=h,this._compute(true));},_proto._compute=function(force){if(!this._destroyed){var total=this.getTotalCount();if(0!==total&&0!==this._containerHeight||(this._containerHeight=this._wrapper.clientHeight,0!==total)){var scrollTop=this._wrapper.scrollTop,itemHeight=this._itemHeight,buffer=this._buffer,rawStart=Math.floor(scrollTop/itemHeight),start=Math.max(0,rawStart-buffer),rawEnd=rawStart+Math.ceil(this._containerHeight/itemHeight)-1,end=Math.min(total-1,rawEnd+buffer);if(force||start!==this._startIndex||end!==this._endIndex){this._startIndex=start,this._endIndex=end,this._updateRange(start,end);var range={startIndex:start,endIndex:end};this._eventEmitter.emit(EVENTS.render,range),null==this.options.onRender||this.options.onRender.call(this.options,range),0===start&&this._eventEmitter.emit(EVENTS.reachTop),end===total-1&&this._eventEmitter.emit(EVENTS.reachBottom);}}else this._reset();}},_proto._updateRange=function(start,end){var _this=this,itemHeight=this._itemHeight,toRecycle=[];this._active.forEach(function(_el,idx){(idx<start||idx>end)&&toRecycle.push(idx);}),toRecycle.forEach(function(idx){var el=_this._active.get(idx);el&&(el.style.display="none",_this._pool.push(el)),_this._active.delete(idx);});for(var i=start;i<=end;i++)if(!this._active.has(i)){var el=this._pool.pop()||this._createItemEl();el.style.display="",el.style.top=i*itemHeight+"px",el.style.height=itemHeight+"px",el.setAttribute("data-index",String(i)),this._fillItem(el,i),el.parentNode!==this._$viewport&&this._$viewport.appendChild(el),this._active.set(i,el);}},_proto._createItemEl=function(){var el=document.createElement("div");return el.className="evscroll-item",el},_proto._fillItem=function(el,index){var left,right,item=this.options.data?this.options.data[index]:void 0,content=this.options.renderItem(index,item);left=content,(null!=(right=HTMLElement)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?el.replaceChildren(content):el.innerHTML=null!=content?content:"";},_proto._reset=function(){this._active.clear(),this._pool=[],this._$viewport.replaceChildren(),this._startIndex=-1,this._endIndex=-1;},_create_class$9(VirtualScroll,[{key:"_itemHeight",get:function(){return this.options.itemHeight||DefaultOptions.itemHeight}},{key:"_buffer",get:function(){var _this_options_buffer;return null!=(_this_options_buffer=this.options.buffer)?_this_options_buffer:DefaultOptions.buffer}}]),VirtualScroll}();VirtualScroll.VERSION="0.0.1",VirtualScroll.EVENTS=EVENTS;
|
|
9396
|
-
|
|
9397
|
-
/*
|
|
9398
|
-
* @ezuikit/control-rec-list-modal v0.0.1
|
|
9399
|
-
* Copyright (c) 2026-08-03 09:25:39 Ezviz-OpenBiz
|
|
9400
|
-
* Released under the MIT License.
|
|
9401
|
-
*/
|
|
9402
|
-
var __$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__$1={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",dwell:200,onLoadError:function(){}},ImageLazyLoader$1=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this._pendingTimers=new Map,this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__$1,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var target=entry.target;if(entry.isIntersecting){if(_this._pendingTimers.has(target))return;var timer=setTimeout(function(){var _this__observer;_this._pendingTimers.delete(target),_this._loadImage(target),null==(_this__observer=_this._observer)||_this__observer.unobserve(target);},_this.options.dwell);_this._pendingTimers.set(target,timer);}else {var timer1=_this._pendingTimers.get(target);void 0!==timer1&&(clearTimeout(timer1),_this._pendingTimers.delete(target));}});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._pendingTimers.forEach(function(timer){return clearTimeout(timer)}),this._pendingTimers.clear(),this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();function _create_class$1$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}ImageLazyLoader$1.isSupported="IntersectionObserver"in window;var _PREFIX_$1="ez-rec-list-modal-checkbox",Checkbox=function(){function Checkbox(options){var _options_checked,_options_disabled,_options_label,_options_size;void 0===options&&(options={}),this._$label=null,this._destroyed=false,this.options={checked:null!=(_options_checked=options.checked)&&_options_checked,disabled:null!=(_options_disabled=options.disabled)&&_options_disabled,label:null!=(_options_label=options.label)?_options_label:"",size:null!=(_options_size=options.size)?_options_size:16,onChange:options.onChange},this._onChange=this._onChange.bind(this),this._$root=document.createElement("label"),this._$root.className=_PREFIX_$1,this._$root.style.setProperty("--ez-rec-list-modal-checkbox-size",this.options.size+"px"),this._$input=document.createElement("input"),this._$input.type="checkbox",this._$input.className=_PREFIX_$1+"-input",this._$input.checked=this.options.checked,this._$input.disabled=this.options.disabled,this._$input.addEventListener("change",this._onChange),this._$root.appendChild(this._$input),this._$box=document.createElement("span"),this._$box.className=_PREFIX_$1+"-box",this._$box.innerHTML='<span class="'+_PREFIX_$1+'-check"><svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3.5 8.4 6.4 11.3 12.5 4.9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></span>',this._$root.appendChild(this._$box),this.options.label&&(this._$label=document.createElement("span"),this._$label.className=_PREFIX_$1+"-label",this._$label.textContent=this.options.label,this._$root.appendChild(this._$label)),this._syncState();}var _proto=Checkbox.prototype;return _proto.setChecked=function(checked,emit){ void 0===emit&&(emit=false),this._$input.checked!==checked&&(this._$input.checked=checked,this._syncState(),emit&&(null==this.options.onChange||this.options.onChange.call(this.options,checked)));},_proto.setDisabled=function(disabled){this.options.disabled=disabled,this._$input.disabled=disabled,this._syncState();},_proto.setLabel=function(label){this.options.label=label,label?(this._$label||(this._$label=document.createElement("span"),this._$label.className=_PREFIX_$1+"-label",this._$root.appendChild(this._$label)),this._$label.textContent=label):this._$label&&(this._$label.remove(),this._$label=null);},_proto.destroy=function(){this._destroyed||(this._destroyed=true,this._$input.removeEventListener("change",this._onChange),this._$root.remove());},_proto._onChange=function(){this._syncState(),null==this.options.onChange||this.options.onChange.call(this.options,this._$input.checked);},_proto._syncState=function(){this._$root.classList.toggle(_PREFIX_$1+"-checked",this._$input.checked),this._$root.classList.toggle(_PREFIX_$1+"-disabled",this.options.disabled);},_create_class$1$2(Checkbox,[{key:"el",get:function(){return this._$root}},{key:"checked",get:function(){return this._$input.checked}}]),Checkbox}(),_$REC_EVENT_ICONS$__playing='<svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="playing">\n <rect x="1.5" y="7" width="3" height="7.5" rx="1.5"/>\n <rect x="6.5" y="3" width="3" height="11.5" rx="1.5"/>\n <rect x="11" y="5.5" width="3" height="9" rx="1.5"/>\n </svg>',_$REC_EVENT_ICONS$__humanDetection='<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="humanDetection">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.42689 10.122L5.78846 9.81738C5.5102 9.68459 5.33301 9.4037 5.33301 9.09537V6.6667C5.33301 6.22487 5.69118 5.8667 6.13301 5.8667H9.86634C10.3082 5.8667 10.6663 6.22487 10.6663 6.6667V9.10694C10.6663 9.40926 10.4959 9.68576 10.2258 9.82162L9.62858 10.122H6.42689Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00039 2.1333C8.88405 2.1333 9.60039 2.84965 9.60039 3.7333C9.60039 4.61696 8.88405 5.3333 8.00039 5.3333C7.11674 5.3333 6.40039 4.61696 6.40039 3.7333C6.40039 2.84965 7.11674 2.1333 8.00039 2.1333Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.80039 9.06689C9.24222 9.06689 9.60039 9.42507 9.60039 9.8669V13.0669C9.60039 13.5087 9.24222 13.8669 8.80039 13.8669H7.20039C6.75856 13.8669 6.40039 13.5087 6.40039 13.0669V9.8669C6.40039 9.42507 6.75856 9.06689 7.20039 9.06689H8.80039Z" fill="currentColor"/>\n <path d="M4.26628 2.6665H2.93294C2.19694 2.6665 1.59961 3.26325 1.59961 3.99984V5.33317" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M1.59961 10.6665V11.9998C1.59961 12.7358 2.19694 13.3332 2.93294 13.3332H4.26628" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M11.7334 13.3332H13.0667C13.8033 13.3332 14.4001 12.7358 14.4001 11.9998V10.6665" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M14.4001 5.33317V3.99984C14.4001 3.26325 13.8033 2.6665 13.0667 2.6665H11.7334" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>',_$REC_EVENT_ICONS$__vehicleDetection='<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="vehicleDetection">\n <path d="M14.2522 6.62695L12.6147 7.25195" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M3.39233 7.25L1.74854 6.625" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M12.6116 7.25L12.0872 4.7425C11.9354 4.01875 11.2972 3.5 10.5572 3.5H5.50722C4.7816 3.5 4.15098 4 3.98598 4.70687L3.3916 7.25" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M12.375 7.25098C13.4106 7.25098 14.25 8.09035 14.25 9.12598V12.1523C14.247 12.3407 11.125 11.9375 11.125 11.9375H4.875C4.875 11.9375 1.7522 12.4275 1.75 12.2822V9.12598C1.75 8.09035 2.58938 7.25098 3.625 7.25098H12.375ZM4.09375 9.28125L4.03027 9.28516C3.80148 9.3162 3.625 9.51269 3.625 9.75C3.625 10.0089 3.83487 10.2188 4.09375 10.2188H5.65625L5.71973 10.2148C5.94852 10.1838 6.125 9.98731 6.125 9.75C6.125 9.49112 5.91513 9.28125 5.65625 9.28125H4.09375ZM10.2803 9.28516C10.0515 9.3162 9.875 9.51269 9.875 9.75C9.875 10.0089 10.0849 10.2188 10.3438 10.2188H11.9062L11.9697 10.2148C12.1985 10.1838 12.375 9.98731 12.375 9.75C12.375 9.49112 12.1651 9.28125 11.9062 9.28125H10.3438L10.2803 9.28516Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 9.125C14.25 8.08938 13.4106 7.25 12.375 7.25H3.625C2.58938 7.25 1.75 8.08938 1.75 9.125V12.0373H14.25V9.125V9.125Z" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.5625 13.4998C5.08 13.4998 5.5 13.0798 5.5 12.5623V11.9373L2.375 11.875V12.7185C2.375 13.1498 2.725 13.4998 3.15625 13.4998H4.5625Z" fill="currentColor" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M12.6877 13.4998C13.2052 13.4998 13.6252 13.0798 13.6252 12.5623V11.9373L10.5002 11.875V12.7185C10.5002 13.1498 10.8502 13.4998 11.2815 13.4998H12.6877Z" fill="currentColor" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>',_$REC_EVENT_ICONS$__picture='\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 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 ',_$REC_LIST_MODAL_LOCALES$_={zh:{title:"录像片段",empty:"暂无录像",eventFilter:"事件片段"},en:{title:"Recordings",empty:"No recordings",eventFilter:"Event"}};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _PREFIX_="ez-rec-list-modal",_ICON_EVENT_='<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M11.5 1.5H4.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1Zm0 1.1v10.8h-7V2.6h7ZM6 5.2h4v-1H6v1Zm0 2.3h4v-1H6v1Zm0 2.3h2.7v-1H6v1Z"/></svg>',_REC_EVENT_ICONS_={1:_ICON_EVENT_,2:_ICON_EVENT_,3:_$REC_EVENT_ICONS$__humanDetection,4:'<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="faceDetection">\n <path d="M4.26628 2.66602H2.93294C2.19694 2.66602 1.59961 3.26276 1.59961 3.99935V5.33268" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M1.59961 10.666V11.9993C1.59961 12.7353 2.19694 13.3327 2.93294 13.3327H4.26628" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M11.7334 13.3327H13.0667C13.8033 13.3327 14.4001 12.7353 14.4001 11.9993V10.666" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M14.4001 5.33268V3.99935C14.4001 3.26276 13.8033 2.66602 13.0667 2.66602H11.7334" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.26636 8.53273C4.26636 8.53273 3.74805 8.7145 3.74805 9.32262C3.74805 9.93074 4.12968 10.4493 4.62191 10.4493C4.73317 10.9272 5.97651 13.0867 8.08858 13.0867C10.0905 13.0867 11.5552 10.3969 11.5552 10.3969C11.5552 10.3969 12.2716 10.1395 12.2518 9.32262C12.2325 8.69788 11.7965 8.53273 11.7965 8.53273C11.7965 8.53273 12.1055 5.56552 9.99785 4.3185C7.89022 3.07148 6.36571 4.5319 6.36571 4.5319C6.36571 4.5319 4.11766 4.87602 4.2222 7.69628" fill="currentColor"/>\n </svg>',5:_$REC_EVENT_ICONS$__vehicleDetection,6:'<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="petDetection">\n <path d="M10.134 2.66309C11.9012 2.66316 13.3341 4.09615 13.3342 5.86328V10.6641C13.334 12.4311 11.9011 13.8632 10.134 13.8633H5.86743C4.10029 13.8633 2.6675 12.4311 2.66724 10.6641V5.86328C2.66739 4.09611 4.10022 2.66309 5.86743 2.66309H10.134ZM7.97583 7.95312C7.5222 7.95327 7.15454 8.32075 7.15454 8.77441C7.15459 9.07899 7.32174 9.34112 7.56763 9.4834C7.5526 9.52337 7.54321 9.56694 7.54321 9.6123C7.54296 10.2798 6.9996 10.8223 6.33228 10.8223C6.13114 10.8224 5.96802 10.9863 5.96802 11.1875C5.96822 11.3882 6.13127 11.5516 6.33228 11.5518C7.0251 11.5518 7.63284 11.185 7.97583 10.6367C8.31908 11.1851 8.92713 11.5518 9.62036 11.5518C9.82129 11.5516 9.98442 11.3881 9.98462 11.1875C9.98462 10.9864 9.8214 10.8225 9.62036 10.8223C8.95273 10.8223 8.4087 10.2798 8.40845 9.6123C8.40845 9.56694 8.39906 9.52337 8.38403 9.4834C8.63004 9.34115 8.79805 9.07907 8.7981 8.77441C8.7981 8.32066 8.42989 7.95312 7.97583 7.95312ZM5.06665 5.87207C4.62483 5.87226 4.26685 6.23032 4.26685 6.67188C4.26708 7.11353 4.62497 7.47149 5.06665 7.47168C5.50818 7.47168 5.86622 7.11365 5.86646 6.67188C5.86646 6.2302 5.50832 5.87207 5.06665 5.87207ZM10.9338 5.87207C10.492 5.87226 10.134 6.23032 10.134 6.67188C10.1343 7.11353 10.4922 7.47149 10.9338 7.47168C11.3754 7.47168 11.7334 7.11365 11.7336 6.67188C11.7336 6.2302 11.3755 5.87207 10.9338 5.87207Z" fill="currentColor"/>\n <path d="M12.8 4.08984C12.9449 4.28499 13.0671 4.49562 13.1633 4.71777L15.1584 8.09668C15.4833 8.64759 15.5543 9.28148 15.3577 9.88086C15.1613 10.4797 14.7204 10.9735 14.1174 11.2705C13.8537 11.4002 13.4576 11.4741 13.1633 11.5137C13.0759 11.7889 12.9522 12.0484 12.8 12.2891V4.08984Z" fill="currentColor" fill-opacity="0.6"/>\n <path d="M3.19946 12.4372C3.05452 12.242 2.93249 12.0315 2.83618 11.8093L0.841064 8.43039C0.51612 7.87943 0.44519 7.24568 0.641846 6.64621C0.838188 6.04713 1.27893 5.5536 1.88208 5.25656C2.14581 5.12684 2.54188 5.05303 2.83618 5.0134C2.92354 4.73812 3.04729 4.47872 3.19946 4.23801L3.19946 12.4372Z" fill="currentColor" fill-opacity="0.6"/>\n </svg>',ALRAM:_ICON_EVENT_,TIMIING:_ICON_EVENT_,CAR:_$REC_EVENT_ICONS$__vehicleDetection,HD:_$REC_EVENT_ICONS$__humanDetection},_$REC_LIST_MODAL_DEFAULT_OPTIONS$_={width:260,height:490,buffer:5,startTimeFormat:"HH:mm",groupTitleFormat:"HH:00",showEventFilter:false,showCardTypeIcon:false,eventFilterChecked:false},RecListModal=function(Modal){function RecListModal(container,options){var _this,_ref,_ref1,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9;(_this=Modal.call(this,container,RecListModal._mergeModalOptions(options))||this)._$titleWrap=null,_this._eventCheckbox=null,_this._virtualScroll=null,_this._lazyLoader=null,_this._rows=[],_this._sortedSections=[],_this._eventOnly=false,_this._vsInited=false,_this._recordDestroyed=false,_this._activeIndex=-1,_this._userInteracting=false,_this._userScrollTimer=null;var def=_$REC_LIST_MODAL_DEFAULT_OPTIONS$_;return _this._recI18n=new I18n(deepmerge(_$REC_LIST_MODAL_LOCALES$_,_this.options.locales||{},{clone:false}),{defaultLocale:_this.options.language||"zh"}),_this.recordOptions={sections:null!=(_ref=null==options?void 0:options.sections)?_ref:[],buffer:null!=(_ref1=null==options?void 0:options.buffer)?_ref1:def.buffer,coverQuery:null!=(_ref2=null==options?void 0:options.coverQuery)?_ref2:"",startTimeFormat:null!=(_ref3=null==options?void 0:options.startTimeFormat)?_ref3:def.startTimeFormat,groupTitleFormat:null!=(_ref4=null==options?void 0:options.groupTitleFormat)?_ref4:def.groupTitleFormat,emptyText:null!=(_ref5=null==options?void 0:options.emptyText)?_ref5:String(_this._recI18n.t("empty")),showEventFilter:null!=(_ref6=null==options?void 0:options.showEventFilter)?_ref6:def.showEventFilter,eventFilterText:null!=(_ref7=null==options?void 0:options.eventFilterText)?_ref7:String(_this._recI18n.t("eventFilter")),eventFilterChecked:null!=(_ref8=null==options?void 0:options.eventFilterChecked)?_ref8:def.eventFilterChecked,showCardTypeIcon:null!=(_ref9=null==options?void 0:options.showCardTypeIcon)?_ref9:def.showCardTypeIcon,isEvent:null==options?void 0:options.isEvent,renderCardIcon:null==options?void 0:options.renderCardIcon,onCardClick:null==options?void 0:options.onCardClick},_this._eventOnly=_this.recordOptions.eventFilterChecked,_this._activeTime="number"==typeof(null==options?void 0:options.activeTime)?options.activeTime:void 0,_this._titleText="string"==typeof(null==options?void 0:options.title)?options.title:String(_this._recI18n.t("title")),_this.setTitle(_this._buildHeaderTitle()),_this._$listRoot=document.createElement("div"),_this._$listRoot.className=_PREFIX_+"-list",_this._$empty=document.createElement("div"),_this._$empty.className=_PREFIX_+"-empty",_this._$empty.textContent=_this.recordOptions.emptyText,_this._$empty.style.display="none",_this._$listRoot.appendChild(_this._$empty),_this.setContent(_this._$listRoot),_this._onListClick=_this._onListClick.bind(_this),_this._onUserScroll=_this._onUserScroll.bind(_this),_this._$listRoot.addEventListener("click",_this._onListClick),_this._buildRows(),_this.isVisible()&&_this._ensureVirtualScroll(),_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:true,configurable:true}}),superClass&&_set_prototype_of$g(subClass,superClass);}(RecListModal,Modal);var _proto=RecListModal.prototype;return _proto.open=function(){Modal.prototype.open.call(this),this._$listRoot&&(this._ensureVirtualScroll(),this._userInteracting=false,this._userScrollTimer&&(clearTimeout(this._userScrollTimer),this._userScrollTimer=null),this._scrollToActive(true));},_proto.setSections=function(sections){this.recordOptions.sections=sections||[],this._buildRows(),this._virtualScroll?this._virtualScroll.setData(this._rows):this.isVisible()&&this._ensureVirtualScroll(),this._toggleEmpty();},_proto.setActiveTime=function(time){this._activeTime="number"==typeof time?time:void 0,this._refreshActiveState(),this._scrollToActive();},_proto.showEventFilter=function(show){var _this=this;if(this.recordOptions.showEventFilter=show,show){var _this__$titleWrap;if(this._eventCheckbox)return;var checkbox=new Checkbox({label:this.recordOptions.eventFilterText,checked:this._eventOnly,onChange:function(checked){return _this._onEventFilterChange(checked)}});checkbox.el.addEventListener("mousedown",function(e){return e.stopPropagation()}),checkbox.el.addEventListener("touchstart",function(e){return e.stopPropagation()}),null==(_this__$titleWrap=this._$titleWrap)||_this__$titleWrap.appendChild(checkbox.el),this._eventCheckbox=checkbox;}else {if(!this._eventCheckbox)return;this._eventCheckbox.destroy(),this._eventCheckbox=null;}},_proto.destroy=function(){var _this__eventCheckbox,_this__virtualScroll,_this__lazyLoader;this._recordDestroyed||(this._recordDestroyed=true,null==(_this__eventCheckbox=this._eventCheckbox)||_this__eventCheckbox.destroy(),this._eventCheckbox=null,this._userScrollTimer&&(clearTimeout(this._userScrollTimer),this._userScrollTimer=null),this._$listRoot.removeEventListener("click",this._onListClick),this._$listRoot.removeEventListener("wheel",this._onUserScroll),this._$listRoot.removeEventListener("touchmove",this._onUserScroll),null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.destroy(),this._virtualScroll=null,null==(_this__lazyLoader=this._lazyLoader)||_this__lazyLoader.destroy(),this._lazyLoader=null),Modal.prototype.destroy.call(this);},_proto._rowHeight=function(row){return row&&"header"===row.type?28:this._cardRowHeight},_proto._buildHeaderTitle=function(){var _this=this,wrap=document.createElement("div");wrap.className=_PREFIX_+"-title",this._$titleWrap=wrap;var text=document.createElement("span");if(text.className=_PREFIX_+"-title-text",text.textContent=this._titleText,wrap.appendChild(text),this.recordOptions.showEventFilter){var checkbox=new Checkbox({label:this.recordOptions.eventFilterText,checked:this._eventOnly,onChange:function(checked){return _this._onEventFilterChange(checked)}});checkbox.el.addEventListener("mousedown",function(e){return e.stopPropagation()}),checkbox.el.addEventListener("touchstart",function(e){return e.stopPropagation()}),wrap.appendChild(checkbox.el),this._eventCheckbox=checkbox;}return wrap},_proto._onEventFilterChange=function(checked){var _this__virtualScroll;this._eventOnly=checked,this._buildRows(),null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.setData(this._rows),this._toggleEmpty();},_proto._ensureVirtualScroll=function(){var _this__virtualScroll,_this=this;this._recordDestroyed||(this._toggleEmpty(),this._vsInited?(null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.refresh(),this._observeVisibleImages()):(this._vsInited=true,this._lazyLoader=new ImageLazyLoader$1({root:this._$listRoot}),this._virtualScroll=new VirtualScroll(this._$listRoot,{data:this._rows,itemHeight:function(_index,row){return _this._rowHeight(row)},buffer:this.recordOptions.buffer,renderItem:function(index,item){return _this._renderRow(index,item)},onRender:function(){return _this._observeVisibleImages()}}),this._observeVisibleImages(),this._$listRoot.addEventListener("wheel",this._onUserScroll,{passive:true}),this._$listRoot.addEventListener("touchmove",this._onUserScroll,{passive:true}),this._scrollToActive(true)));},_proto._toggleEmpty=function(){this._$empty&&(this._$empty.style.display=0===this._rows.length?"":"none");},_proto._isEvent=function(section){return "function"==typeof this.recordOptions.isEvent?this.recordOptions.isEvent(section):!!_REC_EVENT_ICONS_[section.EVENT_TYPE]},_proto._buildRows=function(){var _this=this;this._activeIndex=-1;var sorted=(this.recordOptions.sections||[]).filter(function(s){return s&&"number"==typeof s.startTime&&"number"==typeof s.endTime}).filter(function(s){return !_this._eventOnly||_this._isEvent(s)}).slice().reverse();this._sortedSections=sorted;for(var rows=[],groups=new Map,i=0;i<sorted.length;i++){var section=sorted[i],key=distExports$3.DateTime.format(section.startTime,"YYYY-MM-DD HH"),bucket=groups.get(key);bucket||(bucket=[],groups.set(key,bucket)),bucket.push({section:section,index:i});}groups.forEach(function(bucket){rows.push({type:"header",title:distExports$3.DateTime.format(bucket[0].section.startTime,_this.recordOptions.groupTitleFormat),count:bucket.length});for(var i=0;i<bucket.length;i+=2)rows.push({type:"cards",items:bucket.slice(i,i+2)});}),this._rows=rows;},_proto._renderRow=function(_index,row){var _this=this;if(!row)return "";if("header"===row.type)return '<div class="'+_PREFIX_+'-group">\n <span class="'+_PREFIX_+'-group-title">'+this._escape(row.title)+"</span>\n </div>";var cards=row.items.map(function(it){return _this._renderCard(it.section,it.index)}).join("");return '<div class="'+_PREFIX_+'-row">'+cards+"</div>"},_proto._renderCard=function(section,index){var start,end,_DateTime_toDate,_DateTime_toDate1,secondNum,second,minute,startText=distExports$3.DateTime.format(section.startTime,this.recordOptions.startTimeFormat),durationText=(start=section.startTime,end=section.endTime,secondNum=Math.floor((null==(_DateTime_toDate=distExports$3.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=distExports$3.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,((minute=Math.floor(secondNum/60))>0?distExports$3.DateTime.fillZero(minute)+"'":"0'")+distExports$3.DateTime.fillZero(second)+"''"),cover=section.coverPic?""+section.coverPic+this.recordOptions.coverQuery:"",media=cover?'<img class="'+_PREFIX_+'-card-img ez-lazy-image" data-src="'+this._setImageScr(this._escape(cover))+'" alt="" />':'<div class="'+_PREFIX_+'-card-placeholder">'+_$REC_EVENT_ICONS$__picture+"</div>",icon=this._renderCardIcon(section),activeCls=this._isActive(section)?" "+_PREFIX_+"-card-active":"";return '<div class="'+_PREFIX_+"-card"+activeCls+'" data-card-index="'+index+'">\n <div class="'+_PREFIX_+'-card-thumb">\n '+media+'\n <span class="'+_PREFIX_+'-card-start">'+this._escape(startText)+'</span>\n <span class="'+_PREFIX_+'-card-duration">'+this._escape(durationText)+'</span>\n <span class="'+_PREFIX_+'-card-playing">'+_$REC_EVENT_ICONS$__playing+"</span>\n "+icon+"\n </div>\n </div>"},_proto._isActive=function(section){var t=this._activeTime;return "number"==typeof t&&t>=section.startTime&&t<=section.endTime},_proto._refreshActiveState=function(){var _this=this;this._$listRoot.querySelectorAll("."+_PREFIX_+"-card").forEach(function(card){var idx=Number(card.getAttribute("data-card-index")),section=_this._sortedSections[idx];card.classList.toggle(_PREFIX_+"-card-active",!!section&&_this._isActive(section));});},_proto._findActiveIndex=function(){if("number"!=typeof this._activeTime)return -1;for(var i=0;i<this._sortedSections.length;i++)if(this._isActive(this._sortedSections[i]))return i;return -1},_proto._rowIndexOfSection=function(sectionIndex){for(var i=0;i<this._rows.length;i++){var row=this._rows[i];if("cards"===row.type&&row.items.some(function(it){return it.index===sectionIndex}))return i}return -1},_proto._scrollToActive=function(force){ void 0===force&&(force=false);var idx=this._findActiveIndex();if((force||idx!==this._activeIndex)&&(this._activeIndex=idx,!(idx<0||!this._virtualScroll||!force&&this._userInteracting))){var rowIndex=this._rowIndexOfSection(idx);rowIndex>=0&&this._virtualScroll.scrollToIndex(rowIndex,true);}},_proto._onUserScroll=function(){var _this=this;this._userInteracting=true,this._userScrollTimer&&clearTimeout(this._userScrollTimer),this._userScrollTimer=setTimeout(function(){_this._userInteracting=false,_this._userScrollTimer=null;},3e3);},_proto._renderCardIcon=function(section){return ""},_proto._observeVisibleImages=function(){if(this._lazyLoader){var imgs=this._$listRoot.querySelectorAll("img[data-src]");imgs.length&&this._lazyLoader.addImages(Array.from(imgs));}},_proto._onListClick=function(e){var onCardClick=this.recordOptions.onCardClick;if(onCardClick){var target=e.target,card=null==target?void 0:target.closest("."+_PREFIX_+"-card");if(card){var idx=Number(card.getAttribute("data-card-index")),section=this._sortedSections[idx];section&&onCardClick(section,idx,this._sortedSections);}}},_proto._escape=function(text){return String(text).replace(/[&<>"']/g,function(ch){switch(ch){case "&":return "&";case "<":return "<";case ">":return ">";case '"':return """;default:return "'"}})},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},RecListModal._mergeModalOptions=function(options){var _ref,_ref1;return _extends$f({},options,{width:null!=(_ref=null==options?void 0:options.width)?_ref:_$REC_LIST_MODAL_DEFAULT_OPTIONS$_.width,height:null!=(_ref1=null==options?void 0:options.height)?_ref1:_$REC_LIST_MODAL_DEFAULT_OPTIONS$_.height,content:"",title:""})},_create_class$8(RecListModal,[{key:"_cardRowHeight",get:function(){return 70}}]),RecListModal}(Modal);RecListModal.VERSION="0.0.1";
|
|
8987
|
+
/*
|
|
8988
|
+
* @ezuikit/control-rec-list-modal v0.0.1
|
|
8989
|
+
* Copyright (c) 2026-08-03 09:25:39 Ezviz-OpenBiz
|
|
8990
|
+
* Released under the MIT License.
|
|
8991
|
+
*/
|
|
8992
|
+
var __$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__$1={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",dwell:200,onLoadError:function(){}},ImageLazyLoader$1=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this._pendingTimers=new Map,this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__$1,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var target=entry.target;if(entry.isIntersecting){if(_this._pendingTimers.has(target))return;var timer=setTimeout(function(){var _this__observer;_this._pendingTimers.delete(target),_this._loadImage(target),null==(_this__observer=_this._observer)||_this__observer.unobserve(target);},_this.options.dwell);_this._pendingTimers.set(target,timer);}else {var timer1=_this._pendingTimers.get(target);void 0!==timer1&&(clearTimeout(timer1),_this._pendingTimers.delete(target));}});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._pendingTimers.forEach(function(timer){return clearTimeout(timer)}),this._pendingTimers.clear(),this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();function _create_class$1$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}ImageLazyLoader$1.isSupported="IntersectionObserver"in window;var _PREFIX_$1="ez-rec-list-modal-checkbox",Checkbox=function(){function Checkbox(options){var _options_checked,_options_disabled,_options_label,_options_size;void 0===options&&(options={}),this._$label=null,this._destroyed=false,this.options={checked:null!=(_options_checked=options.checked)&&_options_checked,disabled:null!=(_options_disabled=options.disabled)&&_options_disabled,label:null!=(_options_label=options.label)?_options_label:"",size:null!=(_options_size=options.size)?_options_size:16,onChange:options.onChange},this._onChange=this._onChange.bind(this),this._$root=document.createElement("label"),this._$root.className=_PREFIX_$1,this._$root.style.setProperty("--ez-rec-list-modal-checkbox-size",this.options.size+"px"),this._$input=document.createElement("input"),this._$input.type="checkbox",this._$input.className=_PREFIX_$1+"-input",this._$input.checked=this.options.checked,this._$input.disabled=this.options.disabled,this._$input.addEventListener("change",this._onChange),this._$root.appendChild(this._$input),this._$box=document.createElement("span"),this._$box.className=_PREFIX_$1+"-box",this._$box.innerHTML='<span class="'+_PREFIX_$1+'-check"><svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3.5 8.4 6.4 11.3 12.5 4.9" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></span>',this._$root.appendChild(this._$box),this.options.label&&(this._$label=document.createElement("span"),this._$label.className=_PREFIX_$1+"-label",this._$label.textContent=this.options.label,this._$root.appendChild(this._$label)),this._syncState();}var _proto=Checkbox.prototype;return _proto.setChecked=function(checked,emit){ void 0===emit&&(emit=false),this._$input.checked!==checked&&(this._$input.checked=checked,this._syncState(),emit&&(null==this.options.onChange||this.options.onChange.call(this.options,checked)));},_proto.setDisabled=function(disabled){this.options.disabled=disabled,this._$input.disabled=disabled,this._syncState();},_proto.setLabel=function(label){this.options.label=label,label?(this._$label||(this._$label=document.createElement("span"),this._$label.className=_PREFIX_$1+"-label",this._$root.appendChild(this._$label)),this._$label.textContent=label):this._$label&&(this._$label.remove(),this._$label=null);},_proto.destroy=function(){this._destroyed||(this._destroyed=true,this._$input.removeEventListener("change",this._onChange),this._$root.remove());},_proto._onChange=function(){this._syncState(),null==this.options.onChange||this.options.onChange.call(this.options,this._$input.checked);},_proto._syncState=function(){this._$root.classList.toggle(_PREFIX_$1+"-checked",this._$input.checked),this._$root.classList.toggle(_PREFIX_$1+"-disabled",this.options.disabled);},_create_class$1$3(Checkbox,[{key:"el",get:function(){return this._$root}},{key:"checked",get:function(){return this._$input.checked}}]),Checkbox}(),_$REC_EVENT_ICONS$__playing='<svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="playing">\n <rect x="1.5" y="7" width="3" height="7.5" rx="1.5"/>\n <rect x="6.5" y="3" width="3" height="11.5" rx="1.5"/>\n <rect x="11" y="5.5" width="3" height="9" rx="1.5"/>\n </svg>',_$REC_EVENT_ICONS$__humanDetection='<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="humanDetection">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.42689 10.122L5.78846 9.81738C5.5102 9.68459 5.33301 9.4037 5.33301 9.09537V6.6667C5.33301 6.22487 5.69118 5.8667 6.13301 5.8667H9.86634C10.3082 5.8667 10.6663 6.22487 10.6663 6.6667V9.10694C10.6663 9.40926 10.4959 9.68576 10.2258 9.82162L9.62858 10.122H6.42689Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00039 2.1333C8.88405 2.1333 9.60039 2.84965 9.60039 3.7333C9.60039 4.61696 8.88405 5.3333 8.00039 5.3333C7.11674 5.3333 6.40039 4.61696 6.40039 3.7333C6.40039 2.84965 7.11674 2.1333 8.00039 2.1333Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8.80039 9.06689C9.24222 9.06689 9.60039 9.42507 9.60039 9.8669V13.0669C9.60039 13.5087 9.24222 13.8669 8.80039 13.8669H7.20039C6.75856 13.8669 6.40039 13.5087 6.40039 13.0669V9.8669C6.40039 9.42507 6.75856 9.06689 7.20039 9.06689H8.80039Z" fill="currentColor"/>\n <path d="M4.26628 2.6665H2.93294C2.19694 2.6665 1.59961 3.26325 1.59961 3.99984V5.33317" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M1.59961 10.6665V11.9998C1.59961 12.7358 2.19694 13.3332 2.93294 13.3332H4.26628" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M11.7334 13.3332H13.0667C13.8033 13.3332 14.4001 12.7358 14.4001 11.9998V10.6665" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M14.4001 5.33317V3.99984C14.4001 3.26325 13.8033 2.6665 13.0667 2.6665H11.7334" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>',_$REC_EVENT_ICONS$__vehicleDetection='<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="vehicleDetection">\n <path d="M14.2522 6.62695L12.6147 7.25195" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M3.39233 7.25L1.74854 6.625" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M12.6116 7.25L12.0872 4.7425C11.9354 4.01875 11.2972 3.5 10.5572 3.5H5.50722C4.7816 3.5 4.15098 4 3.98598 4.70687L3.3916 7.25" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M12.375 7.25098C13.4106 7.25098 14.25 8.09035 14.25 9.12598V12.1523C14.247 12.3407 11.125 11.9375 11.125 11.9375H4.875C4.875 11.9375 1.7522 12.4275 1.75 12.2822V9.12598C1.75 8.09035 2.58938 7.25098 3.625 7.25098H12.375ZM4.09375 9.28125L4.03027 9.28516C3.80148 9.3162 3.625 9.51269 3.625 9.75C3.625 10.0089 3.83487 10.2188 4.09375 10.2188H5.65625L5.71973 10.2148C5.94852 10.1838 6.125 9.98731 6.125 9.75C6.125 9.49112 5.91513 9.28125 5.65625 9.28125H4.09375ZM10.2803 9.28516C10.0515 9.3162 9.875 9.51269 9.875 9.75C9.875 10.0089 10.0849 10.2188 10.3438 10.2188H11.9062L11.9697 10.2148C12.1985 10.1838 12.375 9.98731 12.375 9.75C12.375 9.49112 12.1651 9.28125 11.9062 9.28125H10.3438L10.2803 9.28516Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 9.125C14.25 8.08938 13.4106 7.25 12.375 7.25H3.625C2.58938 7.25 1.75 8.08938 1.75 9.125V12.0373H14.25V9.125V9.125Z" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.5625 13.4998C5.08 13.4998 5.5 13.0798 5.5 12.5623V11.9373L2.375 11.875V12.7185C2.375 13.1498 2.725 13.4998 3.15625 13.4998H4.5625Z" fill="currentColor" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M12.6877 13.4998C13.2052 13.4998 13.6252 13.0798 13.6252 12.5623V11.9373L10.5002 11.875V12.7185C10.5002 13.1498 10.8502 13.4998 11.2815 13.4998H12.6877Z" fill="currentColor" stroke="currentColor" stroke-width="0.9375" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>',_$REC_EVENT_ICONS$__picture='\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 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 ',_$REC_LIST_MODAL_LOCALES$_={zh:{title:"录像片段",empty:"暂无录像",eventFilter:"事件片段"},en:{title:"Recordings",empty:"No recordings",eventFilter:"Event"}};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _PREFIX_="ez-rec-list-modal",_ICON_EVENT_='<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><path d="M11.5 1.5H4.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1Zm0 1.1v10.8h-7V2.6h7ZM6 5.2h4v-1H6v1Zm0 2.3h4v-1H6v1Zm0 2.3h2.7v-1H6v1Z"/></svg>',_REC_EVENT_ICONS_={1:_ICON_EVENT_,2:_ICON_EVENT_,3:_$REC_EVENT_ICONS$__humanDetection,4:'<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="faceDetection">\n <path d="M4.26628 2.66602H2.93294C2.19694 2.66602 1.59961 3.26276 1.59961 3.99935V5.33268" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M1.59961 10.666V11.9993C1.59961 12.7353 2.19694 13.3327 2.93294 13.3327H4.26628" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M11.7334 13.3327H13.0667C13.8033 13.3327 14.4001 12.7353 14.4001 11.9993V10.666" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M14.4001 5.33268V3.99935C14.4001 3.26276 13.8033 2.66602 13.0667 2.66602H11.7334" stroke="currentColor" stroke-opacity="0.6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.26636 8.53273C4.26636 8.53273 3.74805 8.7145 3.74805 9.32262C3.74805 9.93074 4.12968 10.4493 4.62191 10.4493C4.73317 10.9272 5.97651 13.0867 8.08858 13.0867C10.0905 13.0867 11.5552 10.3969 11.5552 10.3969C11.5552 10.3969 12.2716 10.1395 12.2518 9.32262C12.2325 8.69788 11.7965 8.53273 11.7965 8.53273C11.7965 8.53273 12.1055 5.56552 9.99785 4.3185C7.89022 3.07148 6.36571 4.5319 6.36571 4.5319C6.36571 4.5319 4.11766 4.87602 4.2222 7.69628" fill="currentColor"/>\n </svg>',5:_$REC_EVENT_ICONS$__vehicleDetection,6:'<svg viewBox="0 0 16 16" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="petDetection">\n <path d="M10.134 2.66309C11.9012 2.66316 13.3341 4.09615 13.3342 5.86328V10.6641C13.334 12.4311 11.9011 13.8632 10.134 13.8633H5.86743C4.10029 13.8633 2.6675 12.4311 2.66724 10.6641V5.86328C2.66739 4.09611 4.10022 2.66309 5.86743 2.66309H10.134ZM7.97583 7.95312C7.5222 7.95327 7.15454 8.32075 7.15454 8.77441C7.15459 9.07899 7.32174 9.34112 7.56763 9.4834C7.5526 9.52337 7.54321 9.56694 7.54321 9.6123C7.54296 10.2798 6.9996 10.8223 6.33228 10.8223C6.13114 10.8224 5.96802 10.9863 5.96802 11.1875C5.96822 11.3882 6.13127 11.5516 6.33228 11.5518C7.0251 11.5518 7.63284 11.185 7.97583 10.6367C8.31908 11.1851 8.92713 11.5518 9.62036 11.5518C9.82129 11.5516 9.98442 11.3881 9.98462 11.1875C9.98462 10.9864 9.8214 10.8225 9.62036 10.8223C8.95273 10.8223 8.4087 10.2798 8.40845 9.6123C8.40845 9.56694 8.39906 9.52337 8.38403 9.4834C8.63004 9.34115 8.79805 9.07907 8.7981 8.77441C8.7981 8.32066 8.42989 7.95312 7.97583 7.95312ZM5.06665 5.87207C4.62483 5.87226 4.26685 6.23032 4.26685 6.67188C4.26708 7.11353 4.62497 7.47149 5.06665 7.47168C5.50818 7.47168 5.86622 7.11365 5.86646 6.67188C5.86646 6.2302 5.50832 5.87207 5.06665 5.87207ZM10.9338 5.87207C10.492 5.87226 10.134 6.23032 10.134 6.67188C10.1343 7.11353 10.4922 7.47149 10.9338 7.47168C11.3754 7.47168 11.7334 7.11365 11.7336 6.67188C11.7336 6.2302 11.3755 5.87207 10.9338 5.87207Z" fill="currentColor"/>\n <path d="M12.8 4.08984C12.9449 4.28499 13.0671 4.49562 13.1633 4.71777L15.1584 8.09668C15.4833 8.64759 15.5543 9.28148 15.3577 9.88086C15.1613 10.4797 14.7204 10.9735 14.1174 11.2705C13.8537 11.4002 13.4576 11.4741 13.1633 11.5137C13.0759 11.7889 12.9522 12.0484 12.8 12.2891V4.08984Z" fill="currentColor" fill-opacity="0.6"/>\n <path d="M3.19946 12.4372C3.05452 12.242 2.93249 12.0315 2.83618 11.8093L0.841064 8.43039C0.51612 7.87943 0.44519 7.24568 0.641846 6.64621C0.838188 6.04713 1.27893 5.5536 1.88208 5.25656C2.14581 5.12684 2.54188 5.05303 2.83618 5.0134C2.92354 4.73812 3.04729 4.47872 3.19946 4.23801L3.19946 12.4372Z" fill="currentColor" fill-opacity="0.6"/>\n </svg>',ALRAM:_ICON_EVENT_,TIMIING:_ICON_EVENT_,CAR:_$REC_EVENT_ICONS$__vehicleDetection,HD:_$REC_EVENT_ICONS$__humanDetection},_$REC_LIST_MODAL_DEFAULT_OPTIONS$_={width:260,height:490,buffer:5,startTimeFormat:"HH:mm",groupTitleFormat:"HH:00",showEventFilter:false,showCardTypeIcon:false,eventFilterChecked:false},RecListModal=function(Modal){function RecListModal(container,options){var _this,_ref,_ref1,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9;(_this=Modal.call(this,container,RecListModal._mergeModalOptions(options))||this)._$titleWrap=null,_this._eventCheckbox=null,_this._virtualScroll=null,_this._lazyLoader=null,_this._rows=[],_this._sortedSections=[],_this._eventOnly=false,_this._vsInited=false,_this._recordDestroyed=false,_this._activeIndex=-1,_this._userInteracting=false,_this._userScrollTimer=null;var def=_$REC_LIST_MODAL_DEFAULT_OPTIONS$_;return _this._recI18n=new I18n(deepmerge(_$REC_LIST_MODAL_LOCALES$_,_this.options.locales||{},{clone:false}),{defaultLocale:_this.options.language||"zh"}),_this.recordOptions={sections:null!=(_ref=null==options?void 0:options.sections)?_ref:[],buffer:null!=(_ref1=null==options?void 0:options.buffer)?_ref1:def.buffer,coverQuery:null!=(_ref2=null==options?void 0:options.coverQuery)?_ref2:"",startTimeFormat:null!=(_ref3=null==options?void 0:options.startTimeFormat)?_ref3:def.startTimeFormat,groupTitleFormat:null!=(_ref4=null==options?void 0:options.groupTitleFormat)?_ref4:def.groupTitleFormat,emptyText:null!=(_ref5=null==options?void 0:options.emptyText)?_ref5:String(_this._recI18n.t("empty")),showEventFilter:null!=(_ref6=null==options?void 0:options.showEventFilter)?_ref6:def.showEventFilter,eventFilterText:null!=(_ref7=null==options?void 0:options.eventFilterText)?_ref7:String(_this._recI18n.t("eventFilter")),eventFilterChecked:null!=(_ref8=null==options?void 0:options.eventFilterChecked)?_ref8:def.eventFilterChecked,showCardTypeIcon:null!=(_ref9=null==options?void 0:options.showCardTypeIcon)?_ref9:def.showCardTypeIcon,isEvent:null==options?void 0:options.isEvent,renderCardIcon:null==options?void 0:options.renderCardIcon,onCardClick:null==options?void 0:options.onCardClick},_this._eventOnly=_this.recordOptions.eventFilterChecked,_this._activeTime="number"==typeof(null==options?void 0:options.activeTime)?options.activeTime:void 0,_this._titleText="string"==typeof(null==options?void 0:options.title)?options.title:String(_this._recI18n.t("title")),_this.setTitle(_this._buildHeaderTitle()),_this._$listRoot=document.createElement("div"),_this._$listRoot.className=_PREFIX_+"-list",_this._$empty=document.createElement("div"),_this._$empty.className=_PREFIX_+"-empty",_this._$empty.textContent=_this.recordOptions.emptyText,_this._$empty.style.display="none",_this._$listRoot.appendChild(_this._$empty),_this.setContent(_this._$listRoot),_this._onListClick=_this._onListClick.bind(_this),_this._onUserScroll=_this._onUserScroll.bind(_this),_this._$listRoot.addEventListener("click",_this._onListClick),_this._buildRows(),_this.isVisible()&&_this._ensureVirtualScroll(),_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:true,configurable:true}}),superClass&&_set_prototype_of$g(subClass,superClass);}(RecListModal,Modal);var _proto=RecListModal.prototype;return _proto.open=function(){Modal.prototype.open.call(this),this._$listRoot&&(this._ensureVirtualScroll(),this._userInteracting=false,this._userScrollTimer&&(clearTimeout(this._userScrollTimer),this._userScrollTimer=null),this._scrollToActive(true));},_proto.setSections=function(sections){this.recordOptions.sections=sections||[],this._buildRows(),this._virtualScroll?this._virtualScroll.setData(this._rows):this.isVisible()&&this._ensureVirtualScroll(),this._toggleEmpty();},_proto.setActiveTime=function(time){this._activeTime="number"==typeof time?time:void 0,this._refreshActiveState(),this._scrollToActive();},_proto.showEventFilter=function(show){var _this=this;if(this.recordOptions.showEventFilter=show,show){var _this__$titleWrap;if(this._eventCheckbox)return;var checkbox=new Checkbox({label:this.recordOptions.eventFilterText,checked:this._eventOnly,onChange:function(checked){return _this._onEventFilterChange(checked)}});checkbox.el.addEventListener("mousedown",function(e){return e.stopPropagation()}),checkbox.el.addEventListener("touchstart",function(e){return e.stopPropagation()}),null==(_this__$titleWrap=this._$titleWrap)||_this__$titleWrap.appendChild(checkbox.el),this._eventCheckbox=checkbox;}else {if(!this._eventCheckbox)return;this._eventCheckbox.destroy(),this._eventCheckbox=null;}},_proto.destroy=function(){var _this__eventCheckbox,_this__virtualScroll,_this__lazyLoader;this._recordDestroyed||(this._recordDestroyed=true,null==(_this__eventCheckbox=this._eventCheckbox)||_this__eventCheckbox.destroy(),this._eventCheckbox=null,this._userScrollTimer&&(clearTimeout(this._userScrollTimer),this._userScrollTimer=null),this._$listRoot.removeEventListener("click",this._onListClick),this._$listRoot.removeEventListener("wheel",this._onUserScroll),this._$listRoot.removeEventListener("touchmove",this._onUserScroll),null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.destroy(),this._virtualScroll=null,null==(_this__lazyLoader=this._lazyLoader)||_this__lazyLoader.destroy(),this._lazyLoader=null),Modal.prototype.destroy.call(this);},_proto._rowHeight=function(row){return row&&"header"===row.type?28:this._cardRowHeight},_proto._buildHeaderTitle=function(){var _this=this,wrap=document.createElement("div");wrap.className=_PREFIX_+"-title",this._$titleWrap=wrap;var text=document.createElement("span");if(text.className=_PREFIX_+"-title-text",text.textContent=this._titleText,wrap.appendChild(text),this.recordOptions.showEventFilter){var checkbox=new Checkbox({label:this.recordOptions.eventFilterText,checked:this._eventOnly,onChange:function(checked){return _this._onEventFilterChange(checked)}});checkbox.el.addEventListener("mousedown",function(e){return e.stopPropagation()}),checkbox.el.addEventListener("touchstart",function(e){return e.stopPropagation()}),wrap.appendChild(checkbox.el),this._eventCheckbox=checkbox;}return wrap},_proto._onEventFilterChange=function(checked){var _this__virtualScroll;this._eventOnly=checked,this._buildRows(),null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.setData(this._rows),this._toggleEmpty();},_proto._ensureVirtualScroll=function(){var _this__virtualScroll,_this=this;this._recordDestroyed||(this._toggleEmpty(),this._vsInited?(null==(_this__virtualScroll=this._virtualScroll)||_this__virtualScroll.refresh(),this._observeVisibleImages()):(this._vsInited=true,this._lazyLoader=new ImageLazyLoader$1({root:this._$listRoot}),this._virtualScroll=new VirtualScroll(this._$listRoot,{data:this._rows,itemHeight:function(_index,row){return _this._rowHeight(row)},buffer:this.recordOptions.buffer,renderItem:function(index,item){return _this._renderRow(index,item)},onRender:function(){return _this._observeVisibleImages()}}),this._observeVisibleImages(),this._$listRoot.addEventListener("wheel",this._onUserScroll,{passive:true}),this._$listRoot.addEventListener("touchmove",this._onUserScroll,{passive:true}),this._scrollToActive(true)));},_proto._toggleEmpty=function(){this._$empty&&(this._$empty.style.display=0===this._rows.length?"":"none");},_proto._isEvent=function(section){return "function"==typeof this.recordOptions.isEvent?this.recordOptions.isEvent(section):!!_REC_EVENT_ICONS_[section.EVENT_TYPE]},_proto._buildRows=function(){var _this=this;this._activeIndex=-1;var sorted=(this.recordOptions.sections||[]).filter(function(s){return s&&"number"==typeof s.startTime&&"number"==typeof s.endTime}).filter(function(s){return !_this._eventOnly||_this._isEvent(s)}).slice().reverse();this._sortedSections=sorted;for(var rows=[],groups=new Map,i=0;i<sorted.length;i++){var section=sorted[i],key=distExports$3.DateTime.format(section.startTime,"YYYY-MM-DD HH"),bucket=groups.get(key);bucket||(bucket=[],groups.set(key,bucket)),bucket.push({section:section,index:i});}groups.forEach(function(bucket){rows.push({type:"header",title:distExports$3.DateTime.format(bucket[0].section.startTime,_this.recordOptions.groupTitleFormat),count:bucket.length});for(var i=0;i<bucket.length;i+=2)rows.push({type:"cards",items:bucket.slice(i,i+2)});}),this._rows=rows;},_proto._renderRow=function(_index,row){var _this=this;if(!row)return "";if("header"===row.type)return '<div class="'+_PREFIX_+'-group">\n <span class="'+_PREFIX_+'-group-title">'+this._escape(row.title)+"</span>\n </div>";var cards=row.items.map(function(it){return _this._renderCard(it.section,it.index)}).join("");return '<div class="'+_PREFIX_+'-row">'+cards+"</div>"},_proto._renderCard=function(section,index){var start,end,_DateTime_toDate,_DateTime_toDate1,secondNum,second,minute,startText=distExports$3.DateTime.format(section.startTime,this.recordOptions.startTimeFormat),durationText=(start=section.startTime,end=section.endTime,secondNum=Math.floor((null==(_DateTime_toDate=distExports$3.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=distExports$3.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,((minute=Math.floor(secondNum/60))>0?distExports$3.DateTime.fillZero(minute)+"'":"0'")+distExports$3.DateTime.fillZero(second)+"''"),cover=section.coverPic?""+section.coverPic+this.recordOptions.coverQuery:"",media=cover?'<img class="'+_PREFIX_+'-card-img ez-lazy-image" data-src="'+this._setImageScr(this._escape(cover))+'" alt="" />':'<div class="'+_PREFIX_+'-card-placeholder">'+_$REC_EVENT_ICONS$__picture+"</div>",icon=this._renderCardIcon(section),activeCls=this._isActive(section)?" "+_PREFIX_+"-card-active":"";return '<div class="'+_PREFIX_+"-card"+activeCls+'" data-card-index="'+index+'">\n <div class="'+_PREFIX_+'-card-thumb">\n '+media+'\n <span class="'+_PREFIX_+'-card-start">'+this._escape(startText)+'</span>\n <span class="'+_PREFIX_+'-card-duration">'+this._escape(durationText)+'</span>\n <span class="'+_PREFIX_+'-card-playing">'+_$REC_EVENT_ICONS$__playing+"</span>\n "+icon+"\n </div>\n </div>"},_proto._isActive=function(section){var t=this._activeTime;return "number"==typeof t&&t>=section.startTime&&t<=section.endTime},_proto._refreshActiveState=function(){var _this=this;this._$listRoot.querySelectorAll("."+_PREFIX_+"-card").forEach(function(card){var idx=Number(card.getAttribute("data-card-index")),section=_this._sortedSections[idx];card.classList.toggle(_PREFIX_+"-card-active",!!section&&_this._isActive(section));});},_proto._findActiveIndex=function(){if("number"!=typeof this._activeTime)return -1;for(var i=0;i<this._sortedSections.length;i++)if(this._isActive(this._sortedSections[i]))return i;return -1},_proto._rowIndexOfSection=function(sectionIndex){for(var i=0;i<this._rows.length;i++){var row=this._rows[i];if("cards"===row.type&&row.items.some(function(it){return it.index===sectionIndex}))return i}return -1},_proto._scrollToActive=function(force){ void 0===force&&(force=false);var idx=this._findActiveIndex();if((force||idx!==this._activeIndex)&&(this._activeIndex=idx,!(idx<0||!this._virtualScroll||!force&&this._userInteracting))){var rowIndex=this._rowIndexOfSection(idx);rowIndex>=0&&this._virtualScroll.scrollToIndex(rowIndex,true);}},_proto._onUserScroll=function(){var _this=this;this._userInteracting=true,this._userScrollTimer&&clearTimeout(this._userScrollTimer),this._userScrollTimer=setTimeout(function(){_this._userInteracting=false,_this._userScrollTimer=null;},3e3);},_proto._renderCardIcon=function(section){return ""},_proto._observeVisibleImages=function(){if(this._lazyLoader){var imgs=this._$listRoot.querySelectorAll("img[data-src]");imgs.length&&this._lazyLoader.addImages(Array.from(imgs));}},_proto._onListClick=function(e){var onCardClick=this.recordOptions.onCardClick;if(onCardClick){var target=e.target,card=null==target?void 0:target.closest("."+_PREFIX_+"-card");if(card){var idx=Number(card.getAttribute("data-card-index")),section=this._sortedSections[idx];section&&onCardClick(section,idx,this._sortedSections);}}},_proto._escape=function(text){return String(text).replace(/[&<>"']/g,function(ch){switch(ch){case "&":return "&";case "<":return "<";case ">":return ">";case '"':return """;default:return "'"}})},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return ""},RecListModal._mergeModalOptions=function(options){var _ref,_ref1;return _extends$f({},options,{width:null!=(_ref=null==options?void 0:options.width)?_ref:_$REC_LIST_MODAL_DEFAULT_OPTIONS$_.width,height:null!=(_ref1=null==options?void 0:options.height)?_ref1:_$REC_LIST_MODAL_DEFAULT_OPTIONS$_.height,content:"",title:""})},_create_class$8(RecListModal,[{key:"_cardRowHeight",get:function(){return 70}}]),RecListModal}(Modal);RecListModal.VERSION="0.0.1";
|
|
9403
8993
|
|
|
9404
8994
|
function _extends$e() {
|
|
9405
|
-
_extends$e = Object.assign || function(target) {
|
|
8995
|
+
_extends$e = Object.assign || function assign(target) {
|
|
9406
8996
|
for(var i = 1; i < arguments.length; i++){
|
|
9407
8997
|
var source = arguments[i];
|
|
9408
|
-
for(var key in source)
|
|
9409
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9410
|
-
target[key] = source[key];
|
|
9411
|
-
}
|
|
9412
|
-
}
|
|
8998
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
9413
8999
|
}
|
|
9414
9000
|
return target;
|
|
9415
9001
|
};
|
|
@@ -9462,10 +9048,10 @@
|
|
|
9462
9048
|
showEventFilter: false,
|
|
9463
9049
|
showCardTypeIcon: false,
|
|
9464
9050
|
sections: [],
|
|
9465
|
-
onCardClick: function(section, index, sections) {
|
|
9051
|
+
onCardClick: function onCardClick(section, index, sections) {
|
|
9466
9052
|
_this.emit(EVENTS$2.control.recListCardClick, section, index, sections);
|
|
9467
9053
|
},
|
|
9468
|
-
onClose: function() {
|
|
9054
|
+
onClose: function onClose() {
|
|
9469
9055
|
var _this__options_onClose, _this__options;
|
|
9470
9056
|
_this._panelOpen = false;
|
|
9471
9057
|
_this.active = false;
|
|
@@ -9554,14 +9140,10 @@
|
|
|
9554
9140
|
}(Control);
|
|
9555
9141
|
|
|
9556
9142
|
function _extends$d() {
|
|
9557
|
-
_extends$d = Object.assign || function(target) {
|
|
9143
|
+
_extends$d = Object.assign || function assign(target) {
|
|
9558
9144
|
for(var i = 1; i < arguments.length; i++){
|
|
9559
9145
|
var source = arguments[i];
|
|
9560
|
-
for(var key in source)
|
|
9561
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9562
|
-
target[key] = source[key];
|
|
9563
|
-
}
|
|
9564
|
-
}
|
|
9146
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
9565
9147
|
}
|
|
9566
9148
|
return target;
|
|
9567
9149
|
};
|
|
@@ -9650,14 +9232,10 @@
|
|
|
9650
9232
|
return Constructor;
|
|
9651
9233
|
}
|
|
9652
9234
|
function _extends$c() {
|
|
9653
|
-
_extends$c = Object.assign || function(target) {
|
|
9235
|
+
_extends$c = Object.assign || function assign(target) {
|
|
9654
9236
|
for(var i = 1; i < arguments.length; i++){
|
|
9655
9237
|
var source = arguments[i];
|
|
9656
|
-
for(var key in source)
|
|
9657
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9658
|
-
target[key] = source[key];
|
|
9659
|
-
}
|
|
9660
|
-
}
|
|
9238
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
9661
9239
|
}
|
|
9662
9240
|
return target;
|
|
9663
9241
|
};
|
|
@@ -9688,11 +9266,11 @@
|
|
|
9688
9266
|
label: 'label',
|
|
9689
9267
|
value: 'value'
|
|
9690
9268
|
},
|
|
9691
|
-
renderLabel: function(label) {
|
|
9269
|
+
renderLabel: function renderLabel(label) {
|
|
9692
9270
|
return "<span>" + (label || '') + "</span>";
|
|
9693
9271
|
},
|
|
9694
|
-
onChange: function() {},
|
|
9695
|
-
onOpenChange: function() {}
|
|
9272
|
+
onChange: function onChange() {},
|
|
9273
|
+
onOpenChange: function onOpenChange() {}
|
|
9696
9274
|
};
|
|
9697
9275
|
/**
|
|
9698
9276
|
* 选择器切换 (支持PC/Mobile)
|
|
@@ -9746,6 +9324,7 @@
|
|
|
9746
9324
|
_inherits$b(Select, Control);
|
|
9747
9325
|
function Select(options) {
|
|
9748
9326
|
var _this;
|
|
9327
|
+
var _ref;
|
|
9749
9328
|
var _this__options_fieldNames, _this__picker_$body;
|
|
9750
9329
|
_this = Control.call(this, _extends$c({
|
|
9751
9330
|
tagName: 'span',
|
|
@@ -9759,16 +9338,15 @@
|
|
|
9759
9338
|
if (options.value !== undefined || options.value !== null) {
|
|
9760
9339
|
_this._value = options.value + '';
|
|
9761
9340
|
}
|
|
9762
|
-
var
|
|
9763
|
-
var valueKey = (_this__options_fieldNames_value = (_this__options_fieldNames = _this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _this__options_fieldNames_value : 'value';
|
|
9341
|
+
var valueKey = (_ref = (_this__options_fieldNames = _this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _ref : 'value';
|
|
9764
9342
|
_this._picker = new Picker(_this.$container, {
|
|
9765
9343
|
// 由于某些原因, 移动端强制渲染在 body 上
|
|
9766
|
-
getPopupContainer: function() {
|
|
9344
|
+
getPopupContainer: function getPopupContainer() {
|
|
9767
9345
|
return Utils.isMobile ? options.rootContainer : _this.$container;
|
|
9768
9346
|
},
|
|
9769
9347
|
trigger: Utils.isMobile ? 'click' : 'hover',
|
|
9770
9348
|
isMobile: Utils.isMobile,
|
|
9771
|
-
wrapClassName: PREFIX_CLASS + "-select-picker " + PREFIX_CLASS + "-select-" + options.classNameSuffix,
|
|
9349
|
+
wrapClassName: PREFIX_CLASS$1 + "-select-picker " + PREFIX_CLASS$1 + "-select-" + options.classNameSuffix,
|
|
9772
9350
|
open: _this._options.open,
|
|
9773
9351
|
offset: [
|
|
9774
9352
|
0,
|
|
@@ -9776,7 +9354,7 @@
|
|
|
9776
9354
|
],
|
|
9777
9355
|
placement: 'top',
|
|
9778
9356
|
// zIndex: 10000,
|
|
9779
|
-
onOpenChange: function(open) {
|
|
9357
|
+
onOpenChange: function onOpenChange(open) {
|
|
9780
9358
|
var item = _this.list.find(function(item) {
|
|
9781
9359
|
return item[valueKey] + '' === _this.value;
|
|
9782
9360
|
});
|
|
@@ -9800,14 +9378,13 @@
|
|
|
9800
9378
|
var _this = this;
|
|
9801
9379
|
if (list === void 0) list = [];
|
|
9802
9380
|
if ((list == null ? void 0 : list.length) > 0 && this._picker) {
|
|
9381
|
+
var _ref, _ref1;
|
|
9803
9382
|
var _this__options_fieldNames, _this__options_fieldNames1, _this_locale, _this__picker;
|
|
9804
|
-
var
|
|
9805
|
-
var
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
(
|
|
9809
|
-
return '\n <li class="' + PREFIX_CLASS + "-select-option " + (+item[valueKey] === _this.value ? "" + PREFIX_CLASS + "-active" : '') + '" data-value="' + item[valueKey] + '">\n <span>' + item[labelKey] + "</span>\n </li>\n ";
|
|
9810
|
-
}).join('') + "\n </ul>\n " + (Utils.isMobile ? '<div class="' + PREFIX_CLASS + '-select-cancel">\n <span>' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.cancel) || '取消') + "</span>\n </div>" : '') + "\n " + (Utils.isMobile ? '<span class="' + PREFIX_CLASS + '-select-close">' + IconComponents.close() + "</span>" : '') + "\n <div>");
|
|
9383
|
+
var labelKey = (_ref = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.label) != null ? _ref : 'label';
|
|
9384
|
+
var valueKey = (_ref1 = (_this__options_fieldNames1 = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames1.value) != null ? _ref1 : 'value';
|
|
9385
|
+
(_this__picker = this._picker) == null ? void 0 : _this__picker.innerHTML('<div class="' + PREFIX_CLASS$1 + '-select-panel">\n <ul class="' + PREFIX_CLASS$1 + '-select-list">\n ' + list.map(function(item) {
|
|
9386
|
+
return '\n <li class="' + PREFIX_CLASS$1 + "-select-option " + (+item[valueKey] === _this.value ? "" + PREFIX_CLASS$1 + "-active" : '') + '" data-value="' + item[valueKey] + '">\n <span>' + item[labelKey] + "</span>\n </li>\n ";
|
|
9387
|
+
}).join('') + "\n </ul>\n " + (Utils.isMobile ? '<div class="' + PREFIX_CLASS$1 + '-select-cancel">\n <span>' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.cancel) || '取消') + "</span>\n </div>" : '') + "\n " + (Utils.isMobile ? '<span class="' + PREFIX_CLASS$1 + '-select-close">' + IconComponents.close() + "</span>" : '') + "\n <div>");
|
|
9811
9388
|
this.list = list;
|
|
9812
9389
|
this._activeOption();
|
|
9813
9390
|
} else if ((list == null ? void 0 : list.length) === 0) {
|
|
@@ -9816,17 +9393,17 @@
|
|
|
9816
9393
|
}
|
|
9817
9394
|
};
|
|
9818
9395
|
_proto._render = function _render(item) {
|
|
9396
|
+
var _ref;
|
|
9819
9397
|
var _this__options_fieldNames;
|
|
9820
9398
|
if (this.list.length === 0) {
|
|
9821
9399
|
return;
|
|
9822
9400
|
}
|
|
9823
|
-
var
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
this.$container.querySelector("." + PREFIX_CLASS + "-select-btn").innerHTML = this._options.renderLabel == null ? void 0 : this._options.renderLabel.call(this._options, item == null ? void 0 : item[labelKey], item, this.list);
|
|
9401
|
+
var labelKey = (_ref = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.label) != null ? _ref : 'label';
|
|
9402
|
+
if (this.$container.querySelector("." + PREFIX_CLASS$1 + "-select-btn")) {
|
|
9403
|
+
this.$container.querySelector("." + PREFIX_CLASS$1 + "-select-btn").innerHTML = this._options.renderLabel == null ? void 0 : this._options.renderLabel.call(this._options, item == null ? void 0 : item[labelKey], item, this.list);
|
|
9827
9404
|
} else {
|
|
9828
9405
|
var $span = document.createElement('span');
|
|
9829
|
-
$span.classList.add("" + PREFIX_CLASS + "-btn", "" + PREFIX_CLASS + "-select-btn");
|
|
9406
|
+
$span.classList.add("" + PREFIX_CLASS$1 + "-btn", "" + PREFIX_CLASS$1 + "-select-btn");
|
|
9830
9407
|
$span.innerHTML = this._options.renderLabel == null ? void 0 : this._options.renderLabel.call(this._options, item == null ? void 0 : item[labelKey], item, this.list); // `<span>${item?.[labelKey] || ''}</span>` as string;
|
|
9831
9408
|
this.$container.appendChild($span);
|
|
9832
9409
|
if (this._options.title) {
|
|
@@ -9837,13 +9414,13 @@
|
|
|
9837
9414
|
_proto._activeOption = function _activeOption() {
|
|
9838
9415
|
var _this = this;
|
|
9839
9416
|
if (this._picker) {
|
|
9417
|
+
var _ref;
|
|
9840
9418
|
var _this__options_fieldNames, _this__picker_$body, _this__picker_$body1;
|
|
9841
|
-
var
|
|
9842
|
-
var
|
|
9843
|
-
|
|
9844
|
-
$
|
|
9845
|
-
|
|
9846
|
-
$target == null ? void 0 : $target.classList.add(PREFIX_CLASS + '-active');
|
|
9419
|
+
var valueKey = (_ref = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _ref : 'value';
|
|
9420
|
+
var $active = (_this__picker_$body = this._picker.$body) == null ? void 0 : _this__picker_$body.querySelector("." + PREFIX_CLASS$1 + "-active");
|
|
9421
|
+
$active == null ? void 0 : $active.classList.remove(PREFIX_CLASS$1 + '-active');
|
|
9422
|
+
var $target = (_this__picker_$body1 = this._picker.$body) == null ? void 0 : _this__picker_$body1.querySelector("." + PREFIX_CLASS$1 + '-select-option[data-value="' + this.value + '"]');
|
|
9423
|
+
$target == null ? void 0 : $target.classList.add(PREFIX_CLASS$1 + '-active');
|
|
9847
9424
|
var target = this.list.find(function(item) {
|
|
9848
9425
|
return item[valueKey] + '' === _this.value;
|
|
9849
9426
|
});
|
|
@@ -9853,13 +9430,13 @@
|
|
|
9853
9430
|
_proto._onSelectChange = function _onSelectChange() {
|
|
9854
9431
|
var _this = this;
|
|
9855
9432
|
if (this._picker) {
|
|
9433
|
+
var _ref;
|
|
9856
9434
|
var _this__options_fieldNames;
|
|
9857
|
-
var
|
|
9858
|
-
|
|
9859
|
-
this._delegationOption = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-option", 'click', function(e) {
|
|
9435
|
+
var valueKey = (_ref = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _ref : 'value';
|
|
9436
|
+
this._delegationOption = delegate(this._picker.$body, "." + PREFIX_CLASS$1 + "-select-option", 'click', function(e) {
|
|
9860
9437
|
var target = e.delegateTarget;
|
|
9861
9438
|
e.stopPropagation();
|
|
9862
|
-
if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
|
|
9439
|
+
if (!target.classList.contains("" + PREFIX_CLASS$1 + "-disabled")) {
|
|
9863
9440
|
var value = target.getAttribute('data-value');
|
|
9864
9441
|
if (_this.value !== value) {
|
|
9865
9442
|
_this.value = value;
|
|
@@ -9871,11 +9448,11 @@
|
|
|
9871
9448
|
}
|
|
9872
9449
|
}
|
|
9873
9450
|
});
|
|
9874
|
-
this._delegationClose = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-close", 'click', function(e) {
|
|
9451
|
+
this._delegationClose = delegate(this._picker.$body, "." + PREFIX_CLASS$1 + "-select-close", 'click', function(e) {
|
|
9875
9452
|
e.stopPropagation();
|
|
9876
9453
|
_this._picker.open = false;
|
|
9877
9454
|
});
|
|
9878
|
-
this._delegationCancel = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-cancel", 'click', function(e) {
|
|
9455
|
+
this._delegationCancel = delegate(this._picker.$body, "." + PREFIX_CLASS$1 + "-select-cancel", 'click', function(e) {
|
|
9879
9456
|
e.stopPropagation();
|
|
9880
9457
|
_this._picker.open = false;
|
|
9881
9458
|
});
|
|
@@ -9940,20 +9517,14 @@
|
|
|
9940
9517
|
}(Control);
|
|
9941
9518
|
|
|
9942
9519
|
function _assert_this_initialized$1(self) {
|
|
9943
|
-
if (self === void 0)
|
|
9944
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9945
|
-
}
|
|
9520
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9946
9521
|
return self;
|
|
9947
9522
|
}
|
|
9948
9523
|
function _extends$b() {
|
|
9949
|
-
_extends$b = Object.assign || function(target) {
|
|
9524
|
+
_extends$b = Object.assign || function assign(target) {
|
|
9950
9525
|
for(var i = 1; i < arguments.length; i++){
|
|
9951
9526
|
var source = arguments[i];
|
|
9952
|
-
for(var key in source)
|
|
9953
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9954
|
-
target[key] = source[key];
|
|
9955
|
-
}
|
|
9956
|
-
}
|
|
9527
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
9957
9528
|
}
|
|
9958
9529
|
return target;
|
|
9959
9530
|
};
|
|
@@ -10043,7 +9614,7 @@
|
|
|
10043
9614
|
title: options == null ? void 0 : (_options_locales_options_language = options.locales[options.language]) == null ? void 0 : _options_locales_options_language.BTN_HD,
|
|
10044
9615
|
controlType: 'button',
|
|
10045
9616
|
classNameSuffix: 'definition',
|
|
10046
|
-
renderLabel: function(label, item, list) {
|
|
9617
|
+
renderLabel: function renderLabel(label, item, list) {
|
|
10047
9618
|
var _list_;
|
|
10048
9619
|
if ((item == null ? void 0 : item.level) === 'auto') {
|
|
10049
9620
|
var _options_locales_options_language;
|
|
@@ -10055,7 +9626,7 @@
|
|
|
10055
9626
|
// 如果 label 不存在,则不显示label,直接显示list的第一个label, 一般自定义清晰度列表可能会出现
|
|
10056
9627
|
return "<span>" + (label || ((_list_ = list[0]) == null ? void 0 : _list_.name) || '') + "</span>";
|
|
10057
9628
|
},
|
|
10058
|
-
onChange: function(value, item) {
|
|
9629
|
+
onChange: function onChange(value, item) {
|
|
10059
9630
|
var _options_onChange;
|
|
10060
9631
|
options == null ? void 0 : (_options_onChange = options.onChange) == null ? void 0 : _options_onChange.call(options, value, item);
|
|
10061
9632
|
if (value === 'auto') {
|
|
@@ -10065,7 +9636,7 @@
|
|
|
10065
9636
|
_assert_this_initialized$1(_this).emit(EVENTS$2.control.definitionChange, value, item);
|
|
10066
9637
|
}
|
|
10067
9638
|
},
|
|
10068
|
-
onOpenChange: function(open, value, item) {
|
|
9639
|
+
onOpenChange: function onOpenChange(open, value, item) {
|
|
10069
9640
|
var _options_onOpenChange;
|
|
10070
9641
|
options == null ? void 0 : (_options_onOpenChange = options.onOpenChange) == null ? void 0 : _options_onOpenChange.call(options, open, value, item);
|
|
10071
9642
|
_assert_this_initialized$1(_this).emit(EVENTS$2.control.definitionPanelOpenChange, open, value, item);
|
|
@@ -10083,7 +9654,7 @@
|
|
|
10083
9654
|
var realItem = _this.list.find(function(it) {
|
|
10084
9655
|
return it.level === _this._level;
|
|
10085
9656
|
});
|
|
10086
|
-
_this.$container.querySelector("." + PREFIX_CLASS + "-select-btn").innerHTML = "\n <span>" + (options == null ? void 0 : (_options_locales_options_language = options.locales[options.language]) == null ? void 0 : _options_locales_options_language.VIDEO_LEVEL_AUTO) + "(" + ((realItem == null ? void 0 : realItem.name) || '') + ")</span>\n ";
|
|
9657
|
+
_this.$container.querySelector("." + PREFIX_CLASS$1 + "-select-btn").innerHTML = "\n <span>" + (options == null ? void 0 : (_options_locales_options_language = options.locales[options.language]) == null ? void 0 : _options_locales_options_language.VIDEO_LEVEL_AUTO) + "(" + ((realItem == null ? void 0 : realItem.name) || '') + ")</span>\n ";
|
|
10087
9658
|
} else {
|
|
10088
9659
|
if (_this.value !== _this._level + '') _this.value = _this._level + '';
|
|
10089
9660
|
}
|
|
@@ -10101,20 +9672,14 @@
|
|
|
10101
9672
|
}(Select);
|
|
10102
9673
|
|
|
10103
9674
|
function _assert_this_initialized(self) {
|
|
10104
|
-
if (self === void 0)
|
|
10105
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10106
|
-
}
|
|
9675
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10107
9676
|
return self;
|
|
10108
9677
|
}
|
|
10109
9678
|
function _extends$a() {
|
|
10110
|
-
_extends$a = Object.assign || function(target) {
|
|
9679
|
+
_extends$a = Object.assign || function assign(target) {
|
|
10111
9680
|
for(var i = 1; i < arguments.length; i++){
|
|
10112
9681
|
var source = arguments[i];
|
|
10113
|
-
for(var key in source)
|
|
10114
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10115
|
-
target[key] = source[key];
|
|
10116
|
-
}
|
|
10117
|
-
}
|
|
9682
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
10118
9683
|
}
|
|
10119
9684
|
return target;
|
|
10120
9685
|
};
|
|
@@ -10181,13 +9746,13 @@
|
|
|
10181
9746
|
classNameSuffix: 'speed',
|
|
10182
9747
|
controlType: 'button',
|
|
10183
9748
|
title: options == null ? void 0 : (_options_locales = options.locales) == null ? void 0 : (_options_locales_options_language = _options_locales[options.language]) == null ? void 0 : _options_locales_options_language.BTN_SPEED,
|
|
10184
|
-
onChange: function(value, item) {
|
|
9749
|
+
onChange: function onChange(value, item) {
|
|
10185
9750
|
var _options_onChange;
|
|
10186
9751
|
value = +value;
|
|
10187
9752
|
options == null ? void 0 : (_options_onChange = options.onChange) == null ? void 0 : _options_onChange.call(options, value, item);
|
|
10188
9753
|
_assert_this_initialized(_this).emit(EVENTS$2.control.speedChange, value, item);
|
|
10189
9754
|
},
|
|
10190
|
-
onOpenChange: function(open, value, item) {
|
|
9755
|
+
onOpenChange: function onOpenChange(open, value, item) {
|
|
10191
9756
|
var _options_onOpenChange;
|
|
10192
9757
|
value = +value;
|
|
10193
9758
|
options == null ? void 0 : (_options_onOpenChange = options.onOpenChange) == null ? void 0 : _options_onOpenChange.call(options, open, value, item);
|
|
@@ -10237,21 +9802,17 @@
|
|
|
10237
9802
|
}(Select);
|
|
10238
9803
|
|
|
10239
9804
|
/*
|
|
10240
|
-
* @ezuikit/control-date-picker v2.1.1
|
|
10241
|
-
* Copyright (c) 2026-08-
|
|
9805
|
+
* @ezuikit/control-date-picker v2.1.2-beta.1
|
|
9806
|
+
* Copyright (c) 2026-08-19 15:54:10 Ezviz-OpenBiz
|
|
10242
9807
|
* Released under the MIT License.
|
|
10243
9808
|
*/
|
|
10244
|
-
var Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){ void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day));}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",now:"Now",cancel:"Cancel",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",now:"此刻",cancel:"取消",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\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>',renderHeaderOkIcon:function(locale){return '<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this._delegations=[],this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:false}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners();}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""));},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html;}},_proto.destroy=function(){for(var i=0;i<this._delegations.length;i++)try{this._delegations[i].destroy();}catch(e){}this._delegations=[],this.$header&&(this.$header.remove(),this.$header=null);},_proto._eventListeners=function(){var _this=this;_this.$header&&(_this._delegations.push(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault());})),_this._delegations.push(delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault());})));},Header}();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)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:true},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this._delegations=[],this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:false}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$3$1({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container);}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh;}else this.locale=this.options.locales.zh;},_proto._delegate=function(el,selector,type,cb,useCapture){var d=delegate(el,selector,type,cb,useCapture);return d&&"function"==typeof d.destroy&&this._delegations.push(d),d},_proto.destroy=function(){for(var _this_$container,i=0;i<this._delegations.length;i++)try{this._delegations[i].destroy();}catch(e){}this._delegations=[],this.header&&"function"==typeof this.header.destroy&&this.header.destroy(),(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null,this.$panel=null,this.$body=null;},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale;},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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$5$1(o,p){return _set_prototype_of$5$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$5$1(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return (_this=Container.call(this,container,_extends$2$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,false),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,false),_this._onHeader(),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$5$1(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?distExports$3.DateTime.toDate(date):date,(!this._current||distExports$3.DateTime.format(date,"YYYY-MM-DD")!==distExports$3.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,distExports$3.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=distExports$3.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected");}this._setRenderCurrent(this._current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto.updateBadges=function(badges){this._updateBadges(badges);},_proto._updateBadges=function(badges,rerender){ void 0===rerender&&(rerender=true),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return distExports$3.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&distExports$3.DateTime.format(this._renderCurrent,"YYYY-MM")!==distExports$3.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,distExports$3.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault();});},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onHeader=function(){var _this=this;this._delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),this._delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return "<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body);},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=distExports$3.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return "<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(distExports$3.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return '<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("");}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$5(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$4$1(o,p){return _set_prototype_of$4$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$4$1(o,p)}Calendar.DateTime=distExports$3.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_this._onHeaderTitle(),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$4$1(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=distExports$3.DateTime.toDate(d));var current=d;this._current&&distExports$3.DateTime.format(current,"YYYY-MM-DD")===distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,distExports$3.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&distExports$3.DateTime.format(date,"YYYY")!==distExports$3.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=distExports$3.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected");}this._setHeader();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=distExports$3.DateTime.toDate(distExports$3.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$3.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=distExports$3.DateTime.toDate(year+distExports$3.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=distExports$3.DateTime.toDate(year+distExports$3.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent);},_proto._onHeaderTitle=function(){var _this=this;this._delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>";}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=distExports$3.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+distExports$3.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,distExports$3.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled");}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return "<tr>\n "+month.map(function(m,i){return '<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(distExports$3.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled();},_create_class$4(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$3$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$3$1(o,p){return _set_prototype_of$3$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{prefixCls:"eyear",showPrevIcon:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$3$1(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){ void 0===change&&(change=true);var left,right,_year="number"==typeof year?distExports$3.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&distExports$3.DateTime.format(_year,"YYYY-MM-DD")===distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=distExports$3.DateTime.toDate(distExports$3.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$3.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault();});},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return "<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return +y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(distExports$3.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(distExports$3.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$3$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class$2$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1$2(){return _extends$1$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$1$2.apply(this,arguments)}function _set_prototype_of$2$1(o,p){return _set_prototype_of$2$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2$1(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0],wrapClassName:""},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:false}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:false}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_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:true,configurable:true}}),superClass&&_set_prototype_of$2$1(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges));},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this);},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=true),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change);},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top");},_proto.hide=function(){this.open=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,false)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode);},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM-DD")===distExports$3.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk);}})));},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM")===distExports$3.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk);},onYear:this._onYear.bind(this)})));},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY")===distExports$3.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk);}})));},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide();},_proto._onClose=function(){this.hide();},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,true);},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&distExports$3.DateTime.format(date,"YYYY-MM-DD")!==distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode();},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode());},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode();},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode();},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode);},_create_class$2$1(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker),DEFAULT_FOOTER_OPTIONS_locale={today:"Today",ok:"Ok",now:"Now",cancel:"Cancel"};function Footer(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{}),$footer=document.createElement("div");$footer.classList.add("edate-footer"),options.className&&$footer.classList.add(options.className);var html="";return "string"!=typeof(html="function"==typeof options.renderContent?options.renderContent():void 0)&&(html="",html+='<div class="edate-footer-left">\n '+(options.showToday?'<span class="edate-today">'+((null==locale?void 0:locale.today)||"Today")+"</span>":"")+"\n "+(options.showNow?'<span class="edate-now">'+((null==locale?void 0:locale.now)||"Now")+"</span>":"")+"\n </div>",html+='<div class="edate-footer-right">\n '+(options.showCancel?function(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{});return '<button class="edate-btn edate-btn-cancel '+(options.disabledOk?"edate-btn-disabled":"")+'">'+((null==locale?void 0:locale.cancel)||"Cancel")+"</button>"}({locale:options.locale}):"")+(options.showOk?function(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{});return '<button class="edate-btn edate-btn-primary edate-btn-ok '+(options.disabledOk?"edate-btn-disabled":"")+'">'+((null==locale?void 0:locale.ok)||"Ok")+"</button>"}({disabledOk:options.disabledOk,locale:options.locale}):"")+"\n </div>"),html?($footer.innerHTML=html,delegate($footer,".edate-today","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onToday||options.onToday.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-now","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onNow||options.onNow.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-btn-cancel","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onCancel||options.onCancel.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-btn-ok","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onOk||options.onOk.call(options),event.stopPropagation(),event.preventDefault());}),$footer):null}function _create_class$1$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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)}function _set_prototype_of$1$2(o,p){return _set_prototype_of$1$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$2(o,p)}var TIME_DEFAULT_OPTIONS={showHeader:true,current:"",cellHeight:30,columnHeight:208,width:160,showCancel:false,showOk:false},Time=function(Container){function Time(container,options){var _this;return (_this=Container.call(this,container,_extends$9({showHeader:TIME_DEFAULT_OPTIONS.showHeader||options.showHeader},options,{prefixCls:"etime"}))||this)._panCleanups=[],_this.options=Object.assign({},TIME_DEFAULT_OPTIONS,options||{}),_this._checkTimeFmt(_this.options.current)?_this._current=_this.options.current:_this._current=TIME_DEFAULT_OPTIONS.current,_this._render(),_this._events(),_this._bindPanEvents(),_this.activeItem("auto"),_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:true,configurable:true}}),superClass&&_set_prototype_of$1$2(subClass,superClass);}(Time,Container);var _proto=Time.prototype;return _proto.setCurrent=function(time){time&&this._checkTimeFmt(time)&&(this._current="string"==typeof time?time:null==time?void 0:time.join(":"),this.activeItem());},_proto.destroy=function(){for(var i=0;i<this._panCleanups.length;i++)try{this._panCleanups[i]();}catch(e){}this._panCleanups=[],Container.prototype.destroy.call(this);},_proto._events=function(){var _this=this;this.$body.querySelector(".etime-cell")&&delegate(this.$body,".etime-cell","click",function(event){var target=event.delegateTarget,type=null==target?void 0:target.getAttribute("data-type"),value=null==target?void 0:target.getAttribute("data-title"),currentTimes=_this._currentTimes;switch(type){case "hour":currentTimes[0]=value;break;case "minute":currentTimes[1]=value;break;case "second":currentTimes[2]=value;}for(var i=0;i<currentTimes.length;i++)""===currentTimes[i]&&(currentTimes[i]="00");null==_this.options.onCell||_this.options.onCell.call(_this.options,type,currentTimes.join(":"),currentTimes),_this._panCellToTop(target,true),(null==target?void 0:target.classList.contains("edate-disabled"))||_this._current!==currentTimes.join(":")&&(_this._current=currentTimes.join(":"),_this.activeItem(),null==_this.options.onChange||_this.options.onChange.call(_this.options,type,_this._current,_this._currentTimes));},false);},_proto._trackOf=function(column){return column.querySelector(".etime-track")},_proto._measureCellHeight=function(track){var first=track.querySelector(".etime-cell"),h=first?first.offsetHeight:0;return h>0?h:this.options.cellHeight||26},_proto._maxIndex=function(track){var cells=track.querySelectorAll(".etime-cell");return Math.max(0,cells.length-1)},_proto._clamp=function(value,min,max){return Math.min(max,Math.max(min,value))},_proto._getTrackOffset=function(track){var v=track._etimeOffset;return "number"==typeof v?v:0},_proto._setTrackOffset=function(track,offset,smooth){var cellH=this._measureCellHeight(track),min=-this._maxIndex(track)*cellH,clamped=this._clamp(offset,min,0);return track._etimeOffset=clamped,track.style.transition=smooth?"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1)":"none",track.style.transform="translateY("+clamped+"px)",clamped},_proto._panCellToTop=function(cell,smooth){var track=cell.parentElement;if(track){var index=Array.prototype.slice.call(track.querySelectorAll(".etime-cell")).indexOf(cell);if(!(index<0)){var cellH=this._measureCellHeight(track);this._setTrackOffset(track,-index*cellH,smooth);}}},_proto._snapColumn=function(track,smooth){var cellH=this._measureCellHeight(track),offset=this._getTrackOffset(track),index=Math.round(-offset/cellH);index=this._clamp(index,0,this._maxIndex(track)),this._setTrackOffset(track,-index*cellH,smooth);},_proto.activeItem=function(behavior){ void 0===behavior&&(behavior="smooth");for(var smooth="auto"!==behavior,times=this._currentTimes,cols=[{idx:0,cls:"etime-hour"},{idx:1,cls:"etime-minute"},{idx:2,cls:"etime-second"}],i=0;i<cols.length;i++){var _this_$body,_cols_i=cols[i],idx=_cols_i.idx,cls=_cols_i.cls;if(times[idx]){var cell=null==(_this_$body=this.$body)?void 0:_this_$body.querySelector("."+cls+'[data-title="'+times[idx]+'"]');if(cell){var track=cell.parentElement,prev=track?track.querySelector(".etime-cell-selected"):null;prev&&prev.classList.remove("etime-cell-selected"),cell.classList.add("etime-cell-selected"),this._panCellToTop(cell,smooth);}}}this.header&&this.header.renderContent(this._current?"<span>"+this._current+"</span>":"");},_proto._supportsPassive=function(){var supported=false;try{if("undefined"==typeof window)return !1;var opts=Object.defineProperty({},"passive",{get:function(){return supported=!0,!0}}),noop=function(){};window.addEventListener("etime-passive-test",noop,opts),window.removeEventListener("etime-passive-test",noop,opts);}catch(e){supported=false;}return supported},_proto._bindPanEvents=function(){for(var columns=this._columns,listenerOpts=!!this._supportsPassive()&&{passive:false},i=0;i<columns.length;i++)this._bindColumnWheel(columns[i],listenerOpts),this._bindColumnTouch(columns[i],listenerOpts);},_proto._bindColumnWheel=function(column,listenerOpts){var _this=this,track=this._trackOf(column);if(track){var snapTimer=null,onWheel=function(e){e.cancelable&&e.preventDefault();var cellH=_this._measureCellHeight(track),unit=1;1===e.deltaMode?unit=cellH:2===e.deltaMode&&(unit=column.clientHeight||cellH);var next=_this._getTrackOffset(track)-e.deltaY*unit*.5;_this._setTrackOffset(track,next,false),snapTimer&&clearTimeout(snapTimer),snapTimer=setTimeout(function(){_this._snapColumn(track,true);},120);};column.addEventListener("wheel",onWheel,listenerOpts),this._panCleanups.push(function(){snapTimer&&clearTimeout(snapTimer),column.removeEventListener("wheel",onWheel,listenerOpts);});}},_proto._bindColumnTouch=function(column,listenerOpts){var _this=this,track=this._trackOf(column);if(track){var startY=0,startOffset=0,lastY=0,lastT=0,velocity=0,dragging=false,onStart=function(e){e.touches&&0!==e.touches.length&&(dragging=true,startY=lastY=e.touches[0].clientY,startOffset=_this._getTrackOffset(track),lastT=Date.now(),velocity=0,track.style.transition="none");},onMove=function(e){if(dragging&&e.touches&&0!==e.touches.length){e.cancelable&&e.preventDefault();var y=e.touches[0].clientY,now=Date.now(),dt=now-lastT;dt>0&&(velocity=(y-lastY)/dt),lastY=y,lastT=now,_this._setTrackOffset(track,startOffset+(y-startY),false);}},onEnd=function(){if(dragging){dragging=false;var cellH=_this._measureCellHeight(track),projected=_this._getTrackOffset(track)+140*velocity,index=Math.round(-projected/cellH);index=_this._clamp(index,0,_this._maxIndex(track)),_this._setTrackOffset(track,-index*cellH,true);}};column.addEventListener("touchstart",onStart,listenerOpts),column.addEventListener("touchmove",onMove,listenerOpts),column.addEventListener("touchend",onEnd),column.addEventListener("touchcancel",onEnd),this._panCleanups.push(function(){column.removeEventListener("touchstart",onStart,listenerOpts),column.removeEventListener("touchmove",onMove,listenerOpts),column.removeEventListener("touchend",onEnd),column.removeEventListener("touchcancel",onEnd);});}},_proto._render=function(){this._renderTimeBody(),this.$panel.appendChild(this.$body),this.options.showFooter&&this._renderFooter();},_proto._renderFooter=function(){var _this=this,showCancel=!!this.options.showCancel,showOk=!!this.options.showOk;if(showCancel||showOk){var locale=this.locale||{},onOk=this.options.onOk,footer=Footer({className:"etime-footer",showCancel:showCancel,showOk:showOk,locale:{ok:locale.ok,cancel:locale.cancel},onCancel:function(){null==_this.options.onCancel||_this.options.onCancel.call(_this.options);},onOk:function(){null==onOk||onOk(_this._current);}});footer&&this.$panel.appendChild(footer);}},_proto._renderTimeBody=function(){this.$body.innerHTML=this._generateList("hour",Util.generateHours())+"\n "+this._generateList("minute",Util.generateMinutesOrSeconds())+"\n "+this._generateList("second",Util.generateMinutesOrSeconds());},_proto._generateList=function(type,times){var _this=this,columnH=this.options.columnHeight+"px",cellH=this.options.cellHeight+"px";return '<div class="etime-column etime-column-'+type+'" data-type="'+type+'" style="height:'+columnH+';">\n <ul class="etime-track" style="padding-bottom: calc('+columnH+" - "+cellH+');">\n '+times.map(function(s){var disabled=false;return "hour"===type?disabled=!!(null==_this.options.disabledHour?void 0:_this.options.disabledHour.call(_this.options,+s)):"minute"===type?disabled=!!(null==_this.options.disabledMinute?void 0:_this.options.disabledMinute.call(_this.options,+s)):"second"===type&&(disabled=!!(null==_this.options.disabledSecond?void 0:_this.options.disabledSecond.call(_this.options,+s))),'<li class="etime-cell etime-'+type+" "+(disabled?"edate-disabled":"")+'" style="height:'+cellH+";line-height: "+cellH+'" data-title="'+s+"\" data-type='"+type+'\'>\n <div class="etime-cell-inner">'+s+"</div>\n </li>"}).join("")+"\n </ul>\n </div>"},_proto._checkTimeFmt=function(time){var times="string"==typeof time?time.split(":"):time;return 3===times.length||+times[0]>=0&&+times[0]<=23&&+times[1]>=0&&+times[1]<=59&&+times[2]>=0&&+times[2]<=59},_create_class$1$1(Time,[{key:"_currentTimes",get:function(){var _this__current;return this._current?null==(_this__current=this._current)?void 0:_this__current.split(":"):["","",""]}},{key:"current",get:function(){return this._current}},{key:"_columns",get:function(){return Array.prototype.slice.call(this.$body.querySelectorAll(".etime-column"))}}]),Time}(Container);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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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)}var DEFAULT_TIME_PICKER_OPTIONS={getPopupContainer:function(){return document.body},current:"00:00:00",open:false,showCancel:true,showOk:true,showHeader:true,showFooter:true,wrapClassName:"etime-picker"},TimePicker=function(Picker){function TimePicker(container,options){var _this;return (_this=Picker.call(this,container,Object.assign({},DEFAULT_TIME_PICKER_OPTIONS,options||{},{wrapClassName:options.wrapClassName?(DEFAULT_TIME_PICKER_OPTIONS.wrapClassName+" "+options.wrapClassName).trim():DEFAULT_TIME_PICKER_OPTIONS.wrapClassName}))||this).time=null,_this._current="00:00:00",_this.options=Object.assign({},DEFAULT_TIME_PICKER_OPTIONS,options||{}),_this.options.current&&(_this._current=_this.options.current),_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:true,configurable:true}}),superClass&&_set_prototype_of$a(subClass,superClass);}(TimePicker,Picker);var _proto=TimePicker.prototype;return _proto.setCurrent=function(time){this.time&&time&&(this.time.setCurrent(time),this._current="string"==typeof time?time:null==time?void 0:time.join(":"));},_proto.hide=function(){this.open=false;},_proto.destroy=function(){this.time&&(this.time.destroy(),this.time=null),Picker.prototype.destroy.call(this);},_proto._onOpenChange=function(open){var _this=this;if(Picker.prototype._onOpenChange.call(this,open),open)if(this.time)this.current&&this.current!==this.time.current&&this.time.setCurrent(this.current);else {var timeOptions=Object.assign({},this.options,{wrapClassName:"",onChange:function(type,time,times){_this.options.showFooter&&_this.options.showOk||time===_this.current||null==_this.options.onChange||_this.options.onChange.call(_this.options,time,times);},onOk:function(time){time!==_this.current&&(null==_this.options.onChange||_this.options.onChange.call(_this.options,time,time.split(":"))),_this._current=time,null==_this.options.onOk||_this.options.onOk.call(_this.options,time),_this.hide();},onCancel:function(){null==_this.options.onCancel||_this.options.onCancel.call(_this.options),_this.hide();}});this.time=new Time(function(){return _this.$body},timeOptions);}},_create_class$6(TimePicker,[{key:"current",get:function(){return this._current}}]),TimePicker}(Picker);
|
|
9809
|
+
var Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){ void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day));}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",now:"Now",cancel:"Cancel",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",now:"此刻",cancel:"取消",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\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>',renderHeaderOkIcon:function(locale){return '<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this._delegations=[],this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:false}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners();}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""));},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html;}},_proto.destroy=function(){for(var i=0;i<this._delegations.length;i++)try{this._delegations[i].destroy();}catch(e){}this._delegations=[],this.$header&&(this.$header.remove(),this.$header=null);},_proto._eventListeners=function(){var _this=this;_this.$header&&(_this._delegations.push(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options);})),_this._delegations.push(delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault());})),_this._delegations.push(delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault());})));},Header}();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)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:true},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this._delegations=[],this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:false}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$3$1({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container);}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh;}else this.locale=this.options.locales.zh;},_proto._delegate=function(el,selector,type,cb,useCapture){var d=delegate(el,selector,type,cb,useCapture);return d&&"function"==typeof d.destroy&&this._delegations.push(d),d},_proto.destroy=function(){for(var _this_$container,i=0;i<this._delegations.length;i++)try{this._delegations[i].destroy();}catch(e){}this._delegations=[],this.header&&"function"==typeof this.header.destroy&&this.header.destroy(),(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null,this.$panel=null,this.$body=null;},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale;},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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$5$1(o,p){return _set_prototype_of$5$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$5$1(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return (_this=Container.call(this,container,_extends$2$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,false),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,false),_this._onHeader(),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$5$1(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?distExports$3.DateTime.toDate(date):date,(!this._current||distExports$3.DateTime.format(date,"YYYY-MM-DD")!==distExports$3.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,distExports$3.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=distExports$3.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected");}this._setRenderCurrent(this._current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto.updateBadges=function(badges){this._updateBadges(badges);},_proto._updateBadges=function(badges,rerender){ void 0===rerender&&(rerender=true),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return distExports$3.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&distExports$3.DateTime.format(this._renderCurrent,"YYYY-MM")!==distExports$3.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,distExports$3.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault();});},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent);},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent);},_proto._onHeader=function(){var _this=this;this._delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),this._delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return "<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body);},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=distExports$3.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return "<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(distExports$3.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return '<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("");}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$5(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$4$1(o,p){return _set_prototype_of$4$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$4$1(o,p)}Calendar.DateTime=distExports$3.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_this._onHeaderTitle(),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$4$1(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=distExports$3.DateTime.toDate(d));var current=d;this._current&&distExports$3.DateTime.format(current,"YYYY-MM-DD")===distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,distExports$3.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current);}catch(error){this._setRenderCurrent(new Date);}else this._setRenderCurrent(new Date);var left,right;},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&distExports$3.DateTime.format(date,"YYYY")!==distExports$3.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=distExports$3.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected");}this._setHeader();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=distExports$3.DateTime.toDate(distExports$3.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$3.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=distExports$3.DateTime.toDate(year+distExports$3.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent);},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=distExports$3.DateTime.toDate(year+distExports$3.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent);},_proto._onHeaderTitle=function(){var _this=this;this._delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent);});},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>";}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=distExports$3.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+distExports$3.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,distExports$3.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled");}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return "<tr>\n "+month.map(function(m,i){return '<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(distExports$3.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled();},_create_class$4(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$3$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$3$1(o,p){return _set_prototype_of$3$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{prefixCls:"eyear",showPrevIcon:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_this._onCell(),_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:true,configurable:true}}),superClass&&_set_prototype_of$3$1(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){ void 0===change&&(change=true);var left,right,_year="number"==typeof year?distExports$3.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&distExports$3.DateTime.format(_year,"YYYY-MM-DD")===distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList();},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current);},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current);},_proto._onCell=function(){var _this=this;this._delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=distExports$3.DateTime.toDate(distExports$3.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$3.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault();});},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList();},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body);},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return "<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return +y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(distExports$3.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(distExports$3.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$3$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class$2$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends$1$2(){return _extends$1$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$1$2.apply(this,arguments)}function _set_prototype_of$2$1(o,p){return _set_prototype_of$2$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2$1(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0],wrapClassName:""},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:false}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:false}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_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:true,configurable:true}}),superClass&&_set_prototype_of$2$1(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this.current=date,this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges));},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this);},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=true),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change);},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top");},_proto.hide=function(){this.open=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,false)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode);},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM-DD")===distExports$3.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk);}})));},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY-MM")===distExports$3.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk);},onYear:this._onYear.bind(this)})));},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends$1$2({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&distExports$3.DateTime.format(_this._current,"YYYY")===distExports$3.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk);}})));},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide();},_proto._onClose=function(){this.hide();},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,true);},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&distExports$3.DateTime.format(date,"YYYY-MM-DD")!==distExports$3.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode();},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode());},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode();},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode();},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode);},_create_class$2$1(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker),DEFAULT_FOOTER_OPTIONS_locale={today:"Today",ok:"Ok",now:"Now",cancel:"Cancel"};function Footer(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{}),$footer=document.createElement("div");$footer.classList.add("edate-footer"),options.className&&$footer.classList.add(options.className);var html="";return "string"!=typeof(html="function"==typeof options.renderContent?options.renderContent():void 0)&&(html="",html+='<div class="edate-footer-left">\n '+(options.showToday?'<span class="edate-today">'+((null==locale?void 0:locale.today)||"Today")+"</span>":"")+"\n "+(options.showNow?'<span class="edate-now">'+((null==locale?void 0:locale.now)||"Now")+"</span>":"")+"\n </div>",html+='<div class="edate-footer-right">\n '+(options.showCancel?function(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{});return '<button class="edate-btn edate-btn-cancel '+(options.disabledOk?"edate-btn-disabled":"")+'">'+((null==locale?void 0:locale.cancel)||"Cancel")+"</button>"}({locale:options.locale}):"")+(options.showOk?function(options){var locale=Object.assign({},DEFAULT_FOOTER_OPTIONS_locale,options.locale||{});return '<button class="edate-btn edate-btn-primary edate-btn-ok '+(options.disabledOk?"edate-btn-disabled":"")+'">'+((null==locale?void 0:locale.ok)||"Ok")+"</button>"}({disabledOk:options.disabledOk,locale:options.locale}):"")+"\n </div>"),html?($footer.innerHTML=html,delegate($footer,".edate-today","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onToday||options.onToday.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-now","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onNow||options.onNow.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-btn-cancel","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onCancel||options.onCancel.call(options),event.stopPropagation(),event.preventDefault());}),delegate($footer,".edate-btn-ok","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==options.onOk||options.onOk.call(options),event.stopPropagation(),event.preventDefault());}),$footer):null}function _create_class$1$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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)}function _set_prototype_of$1$2(o,p){return _set_prototype_of$1$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$2(o,p)}var TIME_DEFAULT_OPTIONS={showHeader:true,current:"",cellHeight:30,columnHeight:208,width:160,showCancel:false,showOk:false},Time=function(Container){function Time(container,options){var _this;return (_this=Container.call(this,container,_extends$9({showHeader:TIME_DEFAULT_OPTIONS.showHeader||options.showHeader},options,{prefixCls:"etime"}))||this)._panCleanups=[],_this.options=Object.assign({},TIME_DEFAULT_OPTIONS,options||{}),_this._checkTimeFmt(_this.options.current)?_this._current=_this.options.current:_this._current=TIME_DEFAULT_OPTIONS.current,_this._render(),_this._events(),_this._bindPanEvents(),_this.activeItem("auto"),_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:true,configurable:true}}),superClass&&_set_prototype_of$1$2(subClass,superClass);}(Time,Container);var _proto=Time.prototype;return _proto.setCurrent=function(time){time&&this._checkTimeFmt(time)&&(this._current="string"==typeof time?time:null==time?void 0:time.join(":"),this.activeItem());},_proto.destroy=function(){for(var i=0;i<this._panCleanups.length;i++)try{this._panCleanups[i]();}catch(e){}this._panCleanups=[],Container.prototype.destroy.call(this);},_proto._events=function(){var _this=this;this.$body.querySelector(".etime-cell")&&delegate(this.$body,".etime-cell","click",function(event){var target=event.delegateTarget,type=null==target?void 0:target.getAttribute("data-type"),value=null==target?void 0:target.getAttribute("data-title"),currentTimes=_this._currentTimes;switch(type){case "hour":currentTimes[0]=value;break;case "minute":currentTimes[1]=value;break;case "second":currentTimes[2]=value;}for(var i=0;i<currentTimes.length;i++)""===currentTimes[i]&&(currentTimes[i]="00");null==_this.options.onCell||_this.options.onCell.call(_this.options,type,currentTimes.join(":"),currentTimes),_this._panCellToTop(target,true),(null==target?void 0:target.classList.contains("edate-disabled"))||_this._current!==currentTimes.join(":")&&(_this._current=currentTimes.join(":"),_this.activeItem(),null==_this.options.onChange||_this.options.onChange.call(_this.options,type,_this._current,_this._currentTimes));},false);},_proto._trackOf=function(column){return column.querySelector(".etime-track")},_proto._measureCellHeight=function(track){var first=track.querySelector(".etime-cell"),h=first?first.offsetHeight:0;return h>0?h:this.options.cellHeight||26},_proto._maxIndex=function(track){var cells=track.querySelectorAll(".etime-cell");return Math.max(0,cells.length-1)},_proto._clamp=function(value,min,max){return Math.min(max,Math.max(min,value))},_proto._getTrackOffset=function(track){var v=track._etimeOffset;return "number"==typeof v?v:0},_proto._setTrackOffset=function(track,offset,smooth){var cellH=this._measureCellHeight(track),min=-this._maxIndex(track)*cellH,clamped=this._clamp(offset,min,0);return track._etimeOffset=clamped,track.style.transition=smooth?"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1)":"none",track.style.transform="translateY("+clamped+"px)",clamped},_proto._panCellToTop=function(cell,smooth){var track=cell.parentElement;if(track){var index=Array.prototype.slice.call(track.querySelectorAll(".etime-cell")).indexOf(cell);if(!(index<0)){var cellH=this._measureCellHeight(track);this._setTrackOffset(track,-index*cellH,smooth);}}},_proto._snapColumn=function(track,smooth){var cellH=this._measureCellHeight(track),offset=this._getTrackOffset(track),index=Math.round(-offset/cellH);index=this._clamp(index,0,this._maxIndex(track)),this._setTrackOffset(track,-index*cellH,smooth);},_proto.activeItem=function(behavior){ void 0===behavior&&(behavior="smooth");for(var smooth="auto"!==behavior,times=this._currentTimes,cols=[{idx:0,cls:"etime-hour"},{idx:1,cls:"etime-minute"},{idx:2,cls:"etime-second"}],i=0;i<cols.length;i++){var _this_$body,_cols_i=cols[i],idx=_cols_i.idx,cls=_cols_i.cls;if(times[idx]){var cell=null==(_this_$body=this.$body)?void 0:_this_$body.querySelector("."+cls+'[data-title="'+times[idx]+'"]');if(cell){var track=cell.parentElement,prev=track?track.querySelector(".etime-cell-selected"):null;prev&&prev.classList.remove("etime-cell-selected"),cell.classList.add("etime-cell-selected"),this._panCellToTop(cell,smooth);}}}this.header&&this.header.renderContent(this._current?"<span>"+this._current+"</span>":"");},_proto._supportsPassive=function(){var supported=false;try{if("undefined"==typeof window)return !1;var opts=Object.defineProperty({},"passive",{get:function(){return supported=!0,!0}}),noop=function(){};window.addEventListener("etime-passive-test",noop,opts),window.removeEventListener("etime-passive-test",noop,opts);}catch(e){supported=false;}return supported},_proto._bindPanEvents=function(){for(var columns=this._columns,listenerOpts=!!this._supportsPassive()&&{passive:false},i=0;i<columns.length;i++)this._bindColumnWheel(columns[i],listenerOpts),this._bindColumnTouch(columns[i],listenerOpts);},_proto._bindColumnWheel=function(column,listenerOpts){var _this=this,track=this._trackOf(column);if(track){var snapTimer=null,onWheel=function(e){e.cancelable&&e.preventDefault();var cellH=_this._measureCellHeight(track),unit=1;1===e.deltaMode?unit=cellH:2===e.deltaMode&&(unit=column.clientHeight||cellH);var next=_this._getTrackOffset(track)-e.deltaY*unit*.5;_this._setTrackOffset(track,next,false),snapTimer&&clearTimeout(snapTimer),snapTimer=setTimeout(function(){_this._snapColumn(track,true);},120);};column.addEventListener("wheel",onWheel,listenerOpts),this._panCleanups.push(function(){snapTimer&&clearTimeout(snapTimer),column.removeEventListener("wheel",onWheel,listenerOpts);});}},_proto._bindColumnTouch=function(column,listenerOpts){var _this=this,track=this._trackOf(column);if(track){var startY=0,startOffset=0,lastY=0,lastT=0,velocity=0,dragging=false,onStart=function(e){e.touches&&0!==e.touches.length&&(dragging=true,startY=lastY=e.touches[0].clientY,startOffset=_this._getTrackOffset(track),lastT=Date.now(),velocity=0,track.style.transition="none");},onMove=function(e){if(dragging&&e.touches&&0!==e.touches.length){e.cancelable&&e.preventDefault();var y=e.touches[0].clientY,now=Date.now(),dt=now-lastT;dt>0&&(velocity=(y-lastY)/dt),lastY=y,lastT=now,_this._setTrackOffset(track,startOffset+(y-startY),false);}},onEnd=function(){if(dragging){dragging=false;var cellH=_this._measureCellHeight(track),projected=_this._getTrackOffset(track)+140*velocity,index=Math.round(-projected/cellH);index=_this._clamp(index,0,_this._maxIndex(track)),_this._setTrackOffset(track,-index*cellH,true);}};column.addEventListener("touchstart",onStart,listenerOpts),column.addEventListener("touchmove",onMove,listenerOpts),column.addEventListener("touchend",onEnd),column.addEventListener("touchcancel",onEnd),this._panCleanups.push(function(){column.removeEventListener("touchstart",onStart,listenerOpts),column.removeEventListener("touchmove",onMove,listenerOpts),column.removeEventListener("touchend",onEnd),column.removeEventListener("touchcancel",onEnd);});}},_proto._render=function(){this._renderTimeBody(),this.$panel.appendChild(this.$body),this.options.showFooter&&this._renderFooter();},_proto._renderFooter=function(){var _this=this,showCancel=!!this.options.showCancel,showOk=!!this.options.showOk;if(showCancel||showOk){var locale=this.locale||{},onOk=this.options.onOk,footer=Footer({className:"etime-footer",showCancel:showCancel,showOk:showOk,locale:{ok:locale.ok,cancel:locale.cancel},onCancel:function(){null==_this.options.onCancel||_this.options.onCancel.call(_this.options);},onOk:function(){null==onOk||onOk(_this._current);}});footer&&this.$panel.appendChild(footer);}},_proto._renderTimeBody=function(){this.$body.innerHTML=this._generateList("hour",Util.generateHours())+"\n "+this._generateList("minute",Util.generateMinutesOrSeconds())+"\n "+this._generateList("second",Util.generateMinutesOrSeconds());},_proto._generateList=function(type,times){var _this=this,columnH=this.options.columnHeight+"px",cellH=this.options.cellHeight+"px";return '<div class="etime-column etime-column-'+type+'" data-type="'+type+'" style="height:'+columnH+';">\n <ul class="etime-track" style="padding-bottom: calc('+columnH+" - "+cellH+');">\n '+times.map(function(s){var disabled=false;return "hour"===type?disabled=!!(null==_this.options.disabledHour?void 0:_this.options.disabledHour.call(_this.options,+s)):"minute"===type?disabled=!!(null==_this.options.disabledMinute?void 0:_this.options.disabledMinute.call(_this.options,+s)):"second"===type&&(disabled=!!(null==_this.options.disabledSecond?void 0:_this.options.disabledSecond.call(_this.options,+s))),'<li class="etime-cell etime-'+type+" "+(disabled?"edate-disabled":"")+'" style="height:'+cellH+";line-height: "+cellH+'" data-title="'+s+"\" data-type='"+type+'\'>\n <div class="etime-cell-inner">'+s+"</div>\n </li>"}).join("")+"\n </ul>\n </div>"},_proto._checkTimeFmt=function(time){var times="string"==typeof time?time.split(":"):time;return 3===times.length||+times[0]>=0&&+times[0]<=23&&+times[1]>=0&&+times[1]<=59&&+times[2]>=0&&+times[2]<=59},_create_class$1$2(Time,[{key:"_currentTimes",get:function(){var _this__current;return this._current?null==(_this__current=this._current)?void 0:_this__current.split(":"):["","",""]}},{key:"current",get:function(){return this._current}},{key:"_columns",get:function(){return Array.prototype.slice.call(this.$body.querySelectorAll(".etime-column"))}}]),Time}(Container);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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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)}var DEFAULT_TIME_PICKER_OPTIONS={getPopupContainer:function(){return document.body},current:"00:00:00",open:false,showCancel:true,showOk:true,showHeader:true,showFooter:true,wrapClassName:"etime-picker"},TimePicker=function(Picker){function TimePicker(container,options){var _this;return (_this=Picker.call(this,container,Object.assign({},DEFAULT_TIME_PICKER_OPTIONS,options||{},{wrapClassName:options.wrapClassName?(DEFAULT_TIME_PICKER_OPTIONS.wrapClassName+" "+options.wrapClassName).trim():DEFAULT_TIME_PICKER_OPTIONS.wrapClassName}))||this).time=null,_this._current="00:00:00",_this.options=Object.assign({},DEFAULT_TIME_PICKER_OPTIONS,options||{}),_this.options.current&&(_this._current=_this.options.current),_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:true,configurable:true}}),superClass&&_set_prototype_of$a(subClass,superClass);}(TimePicker,Picker);var _proto=TimePicker.prototype;return _proto.setCurrent=function(time){this.time&&time&&(this.time.setCurrent(time),this._current="string"==typeof time?time:null==time?void 0:time.join(":"));},_proto.hide=function(){this.open=false;},_proto.destroy=function(){this.time&&(this.time.destroy(),this.time=null),Picker.prototype.destroy.call(this);},_proto._onOpenChange=function(open){var _this=this;if(Picker.prototype._onOpenChange.call(this,open),open)if(this.time)this.current&&this.current!==this.time.current&&this.time.setCurrent(this.current);else {var timeOptions=Object.assign({},this.options,{wrapClassName:"",onChange:function(type,time,times){_this.options.showFooter&&_this.options.showOk||time===_this.current||null==_this.options.onChange||_this.options.onChange.call(_this.options,time,times);},onOk:function(time){time!==_this.current&&(null==_this.options.onChange||_this.options.onChange.call(_this.options,time,time.split(":"))),_this._current=time,null==_this.options.onOk||_this.options.onOk.call(_this.options,time),_this.hide();},onCancel:function(){null==_this.options.onCancel||_this.options.onCancel.call(_this.options),_this.hide();}});this.time=new Time(function(){return _this.$body},timeOptions);}},_create_class$6(TimePicker,[{key:"current",get:function(){return this._current}}]),TimePicker}(Picker);
|
|
10245
9810
|
|
|
10246
9811
|
function _extends$8() {
|
|
10247
|
-
_extends$8 = Object.assign || function(target) {
|
|
9812
|
+
_extends$8 = Object.assign || function assign(target) {
|
|
10248
9813
|
for(var i = 1; i < arguments.length; i++){
|
|
10249
9814
|
var source = arguments[i];
|
|
10250
|
-
for(var key in source)
|
|
10251
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10252
|
-
target[key] = source[key];
|
|
10253
|
-
}
|
|
10254
|
-
}
|
|
9815
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
10255
9816
|
}
|
|
10256
9817
|
return target;
|
|
10257
9818
|
};
|
|
@@ -10309,7 +9870,7 @@
|
|
|
10309
9870
|
var isMobile1 = distExports$3.isMobile();
|
|
10310
9871
|
if (isMobile1) {
|
|
10311
9872
|
var _this_locale;
|
|
10312
|
-
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
|
|
9873
|
+
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS$1 + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS$1 + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
|
|
10313
9874
|
} else {
|
|
10314
9875
|
var _this_locale1;
|
|
10315
9876
|
this.$container.innerHTML = IconComponents.date({
|
|
@@ -10328,33 +9889,33 @@
|
|
|
10328
9889
|
current: distExports$3.DateTime.toDate(this._value),
|
|
10329
9890
|
placement: 'tr',
|
|
10330
9891
|
triggerClose: true,
|
|
10331
|
-
disabledDate: function(date) {
|
|
9892
|
+
disabledDate: function disabledDate(date) {
|
|
10332
9893
|
return date.getTime() > (_this.options.maxDate || new Date()).getTime();
|
|
10333
9894
|
}
|
|
10334
9895
|
}, this.options || {}, {
|
|
10335
9896
|
// 不支持自定义
|
|
10336
|
-
getPopupContainer: function() {
|
|
9897
|
+
getPopupContainer: function getPopupContainer() {
|
|
10337
9898
|
return _this.$container;
|
|
10338
9899
|
},
|
|
10339
9900
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10340
|
-
onOk: function(date, _mode) {
|
|
9901
|
+
onOk: function onOk(date, _mode) {
|
|
10341
9902
|
if (date && _this._value !== distExports$3.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
|
|
10342
9903
|
_this._value = distExports$3.DateTime.format(date, 'YYYY-MM-DD');
|
|
10343
9904
|
_this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
|
|
10344
9905
|
_this.emit(EVENTS$2.control.dateChange, date);
|
|
10345
|
-
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
10346
|
-
_this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
9906
|
+
if (date && _this.$container.querySelector("." + PREFIX_CLASS$1 + "-mobile-date-filter-value")) {
|
|
9907
|
+
_this.$container.querySelector("." + PREFIX_CLASS$1 + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
10347
9908
|
}
|
|
10348
9909
|
}
|
|
10349
9910
|
},
|
|
10350
|
-
onChange: function(date, mode) {
|
|
9911
|
+
onChange: function onChange(date, mode) {
|
|
10351
9912
|
if (date && _this._value !== distExports$3.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
|
|
10352
9913
|
_this._value = distExports$3.DateTime.format(date, 'YYYY-MM-DD');
|
|
10353
9914
|
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
10354
9915
|
_this.emit(EVENTS$2.control.dateChange, date);
|
|
10355
9916
|
}
|
|
10356
9917
|
},
|
|
10357
|
-
onOpenChange: function(open) {
|
|
9918
|
+
onOpenChange: function onOpenChange(open) {
|
|
10358
9919
|
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
|
|
10359
9920
|
_this.emit(EVENTS$2.control.datePanelOpenChange, open, _this.datePicker.current);
|
|
10360
9921
|
}
|
|
@@ -10370,8 +9931,8 @@
|
|
|
10370
9931
|
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
10371
9932
|
if (date && !change && this._value !== distExports$3.DateTime.format(date, 'YYYY-MM-DD')) {
|
|
10372
9933
|
this._value = distExports$3.DateTime.format(date, 'YYYY-MM-DD');
|
|
10373
|
-
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
10374
|
-
this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
9934
|
+
if (date && this.$container.querySelector("." + PREFIX_CLASS$1 + "-mobile-date-filter-value")) {
|
|
9935
|
+
this.$container.querySelector("." + PREFIX_CLASS$1 + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
10375
9936
|
}
|
|
10376
9937
|
}
|
|
10377
9938
|
};
|
|
@@ -10404,14 +9965,10 @@
|
|
|
10404
9965
|
}(Control);
|
|
10405
9966
|
|
|
10406
9967
|
function _extends$7() {
|
|
10407
|
-
_extends$7 = Object.assign || function(target) {
|
|
9968
|
+
_extends$7 = Object.assign || function assign(target) {
|
|
10408
9969
|
for(var i = 1; i < arguments.length; i++){
|
|
10409
9970
|
var source = arguments[i];
|
|
10410
|
-
for(var key in source)
|
|
10411
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10412
|
-
target[key] = source[key];
|
|
10413
|
-
}
|
|
10414
|
-
}
|
|
9971
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
10415
9972
|
}
|
|
10416
9973
|
return target;
|
|
10417
9974
|
};
|
|
@@ -10485,17 +10042,17 @@
|
|
|
10485
10042
|
triggerClose: true
|
|
10486
10043
|
}, this.options || {}, {
|
|
10487
10044
|
// 不支持自定义
|
|
10488
|
-
getPopupContainer: function() {
|
|
10045
|
+
getPopupContainer: function getPopupContainer() {
|
|
10489
10046
|
return _this.$container;
|
|
10490
10047
|
},
|
|
10491
|
-
onChange: function(time, _times) {
|
|
10048
|
+
onChange: function onChange(time, _times) {
|
|
10492
10049
|
if (time && _this._value !== time) {
|
|
10493
10050
|
_this._value = time;
|
|
10494
10051
|
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, time, _times);
|
|
10495
10052
|
_this.emit(EVENTS$2.control.timeChange, time);
|
|
10496
10053
|
}
|
|
10497
10054
|
},
|
|
10498
|
-
onOpenChange: function(open) {
|
|
10055
|
+
onOpenChange: function onOpenChange(open) {
|
|
10499
10056
|
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.timePicker.current);
|
|
10500
10057
|
_this.emit(EVENTS$2.control.timePanelOpenChange, open, _this.timePicker.current);
|
|
10501
10058
|
}
|
|
@@ -10509,7 +10066,7 @@
|
|
|
10509
10066
|
(_this_timePicker = this.timePicker) == null ? void 0 : _this_timePicker.setCurrent(time);
|
|
10510
10067
|
if (time && this._value !== time) {
|
|
10511
10068
|
this._value = time;
|
|
10512
|
-
var valueEl = this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value");
|
|
10069
|
+
var valueEl = this.$container.querySelector("." + PREFIX_CLASS$1 + "-mobile-date-filter-value");
|
|
10513
10070
|
if (valueEl) {
|
|
10514
10071
|
valueEl.innerHTML = this._getTimeStr();
|
|
10515
10072
|
}
|
|
@@ -11004,17 +10561,13 @@
|
|
|
11004
10561
|
* Copyright (c) 2026-08-03 09:24:08 Ezviz-OpenBiz
|
|
11005
10562
|
* Released under the MIT License.
|
|
11006
10563
|
*/
|
|
11007
|
-
var _$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#FFF",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",hoverTipBgColor:"rgba(0, 0, 0, 0.75)",hoverTipColor:"#FFFFFF",hoverLineColor:"rgba(255, 255, 255, 0.8)",opBtnBorderColor:"rgba(153, 153, 153, 1)",opBtnActiveColor:"rgba(54, 159, 255, 1)",opBtnDisabledBorderColor:"rgba(222, 222, 222, 1)",pickerHeaderColor:"rgba(44, 44, 44, 1)",pickerCloseColor:"#20262c",pickerCloseActiveColor:"rgba(240, 87, 87, 1)",pickerItemTitleColor:"rgba(102, 102, 102, 1)",coverFoldPlaceholderBackColor:"#cccccc",coverFoldPlaceholderFrontColor:"#ededed",coverFoldOverlayColor:"rgba(0, 0, 0, 0.3)",itemCoverPlaceholderStartColor:"rgb(183, 195, 207)",itemCoverPlaceholderEndColor:"rgb(212, 209, 209)",timeTextFontSize:12,timeTextFontFamily:"serif",scaleLineWidth:1,onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),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(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _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=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{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}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return 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.tranTimeToString=function(start,end){var _DateTime_toDate,_DateTime_toDate1,secondNum=Math.floor((null==(_DateTime_toDate=distExports$3.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=distExports$3.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?distExports$3.DateTime.fillZero(minute)+"'":"0'")+distExports$3.DateTime.fillZero(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__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>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" 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-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__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 ',_$TIMELINE_ICONS$__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 ',_$TIMELINE_ICONS$__picture='\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 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 ',_$TIMELINE_ICONS$__event='\n <svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="event">\n <path d="M14.074 2.91669C15.4547 2.91669 16.574 4.03597 16.574 5.41669V15.8334C16.574 17.2141 15.4547 18.3334 14.074 18.3334H5.32968C3.94897 18.3334 2.82968 17.2141 2.82968 15.8334V5.41669C2.82968 4.03597 3.94897 2.91669 5.32968 2.91669H14.074ZM5.32968 4.16669C4.63933 4.16669 4.07968 4.72633 4.07968 5.41669V15.8334C4.07968 16.5237 4.63933 17.0834 5.32968 17.0834H14.074C14.7644 17.0834 15.324 16.5237 15.324 15.8334V5.41669C15.324 4.72633 14.7644 4.16669 14.074 4.16669H5.32968Z"/>\n <path d="M11.7228 8.54169C12.068 8.54169 12.3478 8.82151 12.3478 9.16669C12.3478 9.51186 12.068 9.79169 11.7228 9.79169H6.56897C6.22379 9.79169 5.94397 9.51186 5.94397 9.16669C5.94397 8.82151 6.22379 8.54169 6.56897 8.54169H11.7228Z"/>\n <path d="M9.14659 11.875C9.49165 11.8751 9.77159 12.1549 9.77159 12.5C9.77159 12.8451 9.49165 13.1249 9.14659 13.125H6.56927C6.2241 13.125 5.94427 12.8452 5.94427 12.5C5.94427 12.1548 6.2241 11.875 6.56927 11.875H9.14659Z"/>\n <path d="M7.09341 4.46613C7.09341 4.8113 6.81359 5.09113 6.46841 5.09113C6.12324 5.09113 5.84341 4.8113 5.84341 4.46613V2.47394C5.84341 2.12876 6.12324 1.84894 6.46841 1.84894C6.81359 1.84894 7.09341 2.12876 7.09341 2.47394V4.46613Z"/>\n <path d="M13.5607 4.46613C13.5607 4.8113 13.2809 5.09113 12.9357 5.09113C12.5905 5.09113 12.3107 4.8113 12.3107 4.46613V2.47394C12.3107 2.12876 12.5905 1.84894 12.9357 1.84894C13.2809 1.84894 13.5607 2.12876 13.5607 2.47394V4.46613Z"/>\n </svg>\n ',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小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _set_prototype_of$1$1(o,p){return _set_prototype_of$1$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$1(o,p)}ImageLazyLoader.isSupported="IntersectionObserver"in window;var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true,showCoverFold:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_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._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this._applyCssVars(),_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:true,configurable:true}}),superClass&&_set_prototype_of$1$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto._applyCssVars=function(){var opts,_this=this,vars=(opts=this.options,{"--ez-time-line-axis-border-color":String(opts.timeAxisBgColor),"--ez-time-line-section-color":String(opts.timeSectionColor),"--ez-time-line-text-color":String(opts.timeTextColor),"--ez-time-line-point-color":String(opts.timePointColor),"--ez-time-line-current-bg":String(opts.currentTimeBgColor),"--ez-time-line-current-color":String(opts.currentTimeColor),"--ez-time-line-op-btn-border":String(opts.opBtnBorderColor),"--ez-time-line-op-btn-active":String(opts.opBtnActiveColor),"--ez-time-line-op-btn-disabled-border":String(opts.opBtnDisabledBorderColor),"--ez-time-line-picker-header":String(opts.pickerHeaderColor),"--ez-time-line-picker-close":String(opts.pickerCloseColor),"--ez-time-line-picker-close-active":String(opts.pickerCloseActiveColor),"--ez-time-line-picker-item-title":String(opts.pickerItemTitleColor),"--ez-time-line-cover-fold-placeholder-back":String(opts.coverFoldPlaceholderBackColor),"--ez-time-line-cover-fold-placeholder-front":String(opts.coverFoldPlaceholderFrontColor),"--ez-time-line-cover-fold-overlay":String(opts.coverFoldOverlayColor),"--ez-time-line-item-cover-placeholder-start":String(opts.itemCoverPlaceholderStartColor),"--ez-time-line-item-cover-placeholder-end":String(opts.itemCoverPlaceholderEndColor),"--ez-time-line-hover-tip-bg":String(opts.hoverTipBgColor),"--ez-time-line-hover-tip-color":String(opts.hoverTipColor)});Object.entries(vars).forEach(function(param){var name=param[0],value=param[1];return _this.$container.style.setProperty(name,value)});},_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$1({},record,{startTime:distExports$3.DateTime.format(record.startTime,"HH:mm:ss"),endTime:distExports$3.DateTime.format(record.endTime,"HH:mm:ss")})});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:distExports$3.DateTime.format(this.current||(new Date).getTime(),"HH:mm:ss")}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:distExports$3.DateTime.format(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(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._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=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(distExports$3.DateTime.format((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+"T"+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;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,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: "+String(_this.options.timeAxisBgColor)+";",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&&_this.options.showCoverFold&&(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 data-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"}):""+distExports$3.DateTime.format(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">'+_$TIMELINE_ICONS$__pause+"</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:"+String(_this.options.timeSectionColor)+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+String(_this.options.timeTextColor)+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(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,false);}},_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: '+String(this.options.currentTimeBgColor)+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+String(this.options.timePointColor)+';"></span>\n <div class="ez-time-line-current-value" style="color: '+String(this.options.currentTimeColor)+'">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:true,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">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this.options.showCoverFold&&(this._picker=new Picker(null,{isMobile:true,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._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),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,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_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=distExports$3.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1$1({},item,{_index:index})):obj[+hour]=[_extends$1$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(distExports$3.DateTime.format(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__imageLazyLoaderPicker,_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">'+_$TIMELINE_ICONS$__close+"</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="'+distExports$3.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+distExports$3.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+distExports$3.DateTime.format(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" data-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)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.setAttribute("data-error","true"),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_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=false),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=true);},_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,distExports$3.DateTime.fillZero(Math.floor(second/3600))+":"+distExports$3.DateTime.fillZero(Math.floor(second%3600/60))+":"+distExports$3.DateTime.fillZero(second%60)]},_create_class$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function isOverlap(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)}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)}function getTouchDistance(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)}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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _REC_EVENT_KEYS_=[1,2,3,4,5,6,"ALRAM","TIMIING","CAR","HD"],_$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,readOnly:false,scaleOffsetTop:4,showYearMonthDay:true,showHoverTip:true,hoverTipPlacement:"follow",enabledClickToSeek:true,enabledWheelZoom:true,showSectionIcon:false,sectionIconColor:"#FFFFFF",sectionIconSize:14,showSectionCount:true,sectionCountColor:"#FFFFFF",sectionCountBgColor:"#FF4D4F"},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._lastTouchDist=0,_this._$hoverTip=null,_this._hoverRafId=null,_this._hoverX=0,_this._hoverY=0,_this._hoverActive=false,_this._hoverLineX=0,_this._dragMoved=false,_this._containerRect=null,_this._drawRafId=null,_this._$sectionIconLayer=null,_this._sectionIconPool=[],_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._containerWheelFun=_this._containerWheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._clickFun=_this._clickFun.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:true,configurable:true}}),superClass&&_set_prototype_of$7(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cursor="pointer"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._initSectionIconLayer(),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._initHoverTip(),this._applyHoverTipVars(),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.width=this.width+"px"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.height=this.height+"px"),this._$sectionIconLayer&&(this._$sectionIconLayer.style.width=this.width+"px",this._$sectionIconLayer.style.height=this.height+"px"),this._containerRect=null,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:distExports$3.DateTime.toDate(time)});},_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,function(timeSections){if(0===timeSections.length)return timeSections;for(var normalized=timeSections.map(function(item){var startTime=item.startTime,endTime=item.endTime;return 10===(startTime+"").length&&(startTime*=1e3),10===(endTime+"").length&&(endTime*=1e3),_extends$6({},item,{startTime:startTime,endTime:endTime})}),merged=[normalized[0]],i=1;i<normalized.length;i++){var prev=merged[merged.length-1],curr=normalized[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged}(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(),this._hoverActive&&this._$hoverTip&&!this._isMouseDown&&this._showHoverTip(this._hoverX,this._hoverY);},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cursor=readOnly?"not-allowed":"pointer");},_proto.destroy=function(){this._removeEventListener(),this._hideHoverTip(),null!=this._drawRafId&&(cancelAnimationFrame(this._drawRafId),this._drawRafId=null),this._$hoverTip&&this._$hoverTip.remove(),this._$hoverTip=null,this._$sectionIconLayer&&this._$sectionIconLayer.remove(),this._$sectionIconLayer=null,this._sectionIconPool=[],this._$canvas&&this._$canvas.remove(),this._$canvas=null,this._ctx=null,this._containerRect=null,BaseTimeLine.prototype.destroy.call(this);},_proto._initSectionIconLayer=function(){var _this=this;if(this.options.showSectionIcon){var layer=document.createElement("div");layer.className="ez-time-line-section-icon-layer",layer.style.width=this.width+"px",layer.style.height=this.height+"px",this.$container.appendChild(layer),this._$sectionIconLayer=layer,delegate(layer,".ez-time-line-section-icon","click",function(event){event.stopImmediatePropagation(),event.stopPropagation(),event.preventDefault();var el=event.delegateTarget,startTime=Number(el.dataset.start),count=Number(el.dataset.count),index=Number(el.dataset.index);Number.isNaN(startTime)||null==_this.options.onSectionIconClick||_this.options.onSectionIconClick.call(_this.options,{startTime:startTime,count:Number.isNaN(count)?0:count,index:Number.isNaN(index)?-1:index});});}},_proto._isEventSection=function(section){var type=section.EVENT_TYPE;return void 0!==type&&_REC_EVENT_KEYS_.includes(type)},_proto._collectSectionIcons=function(offsetTop,sectionHeight){var _this_options_sectionIconSize,_this=this,renders=[];if(!this.options.showSectionIcon)return renders;var timeArr=this.timeSections||[],intervalSec=this._timeWidthArray[0];if(!intervalSec)return renders;for(var intervalMs=1e3*intervalSec,buckets=new Map,i=0;i<timeArr.length;i++){var section=timeArr[i];if(section&&"number"==typeof section.startTime&&this._isEventSection(section)){var idx=Math.floor(section.startTime/intervalMs),bucket=buckets.get(idx);bucket?(bucket.count+=1,section.startTime<bucket.startTime&&(bucket.startTime=section.startTime,bucket.index=i)):buckets.set(idx,{count:1,startTime:section.startTime,index:i});}}var dpr=this.options.dpr,iconSizePx=null!=(_this_options_sectionIconSize=this.options.sectionIconSize)?_this_options_sectionIconSize:14,sectionHeightPx=sectionHeight/dpr,offsetTopCss=offsetTop/dpr,size=Math.min(iconSizePx,sectionHeightPx),canvasWidthDpr=this.width*dpr;return buckets.forEach(function(bucket,idx){var bucketStart=idx*intervalMs,position=_this._findPosition({startTime:bucketStart,endTime:bucketStart+intervalMs});if(isOverlap(0,canvasWidthDpr,position.x1,position.x2)){var bucketWidthPx=(position.x2-position.x1)/dpr;renders.push({left:position.x1/dpr+(bucketWidthPx-size)/2,top:offsetTopCss+(sectionHeightPx-size)/2,size:size,count:bucket.count,startTime:bucket.startTime,index:bucket.index});}}),renders},_proto._createSectionIconEl=function(){var _this_options_sectionIconColor,_this_options_sectionCountColor,_this_options_sectionCountBgColor,span=document.createElement("span");span.className="ez-time-line-section-icon",span.style.color=null!=(_this_options_sectionIconColor=this.options.sectionIconColor)?_this_options_sectionIconColor:"#FFFFFF",span.innerHTML=_$TIMELINE_ICONS$__event;var count=document.createElement("span");return count.className="ez-time-line-section-icon-count",count.style.color=null!=(_this_options_sectionCountColor=this.options.sectionCountColor)?_this_options_sectionCountColor:"#FFFFFF",count.style.backgroundColor=null!=(_this_options_sectionCountBgColor=this.options.sectionCountBgColor)?_this_options_sectionCountBgColor:"#FF4D4F",count.style.display="none",span.appendChild(count),span},_proto._renderSectionIcons=function(renders){var layer=this._$sectionIconLayer;if(layer&&this.options.showSectionIcon){for(var pool=this._sectionIconPool,showCount=this.options.showSectionCount,i=0;i<renders.length;i++){var r=renders[i],el=pool[i];el||(el=this._createSectionIconEl(),layer.appendChild(el),pool.push(el)),el.style.display="",el.style.left=r.left+"px",el.style.bottom="0px",el.dataset.start=String(r.startTime),el.dataset.count=String(r.count),el.dataset.index=String(r.index);var countEl=el.lastElementChild;showCount&&r.count>0?(countEl.textContent=r.count>99?"99+":String(r.count),countEl.style.display=""):countEl.style.display="none";}for(;i<pool.length;i++)pool[i].style.display="none";}},_proto._initHoverTip=function(){if(this.options.showHoverTip){var tip=document.createElement("div");tip.className="ez-time-line-hover-tip",this.$container.appendChild(tip),this._$hoverTip=tip,this._applyHoverTipVars();}},_proto._applyHoverTipVars=function(){this.$container.style.setProperty("--ez-time-line-hover-tip-bg",String(this.options.hoverTipBgColor)),this.$container.style.setProperty("--ez-time-line-hover-tip-color",String(this.options.hoverTipColor));},_proto._hoverTimeAt=function(x){var seconds=(x-this.width/2)/this._curScaleSpacing*this._timeWidthArray[0];return new Date(this.current.getTime()+Math.round(1e3*seconds))},_proto._localDayStartSec=function(sec){var d=new Date(1e3*sec);return d.setHours(0,0,0,0),Math.floor(d.getTime()/1e3)},_proto._getContainerRect=function(){return this._containerRect||(this._containerRect=this.$container.getBoundingClientRect()),this._containerRect},_proto._scheduleDraw=function(){var _this=this;null==this._drawRafId&&(this._drawRafId=requestAnimationFrame(function(){_this._drawRafId=null,_this._draw();}));},_proto._formatHoverTime=function(date){if("function"==typeof this.options.renderHoverTip)return this.options.renderHoverTip(date);var fmt=this.options.hoverTipFormat||"yyyy-MM-dd HH:mm:ss";return distExports$3.DateTime.format(date,fmt)},_proto._showHoverTip=function(x,y){var _this=this;this._$hoverTip&&(this._hoverX=x,this._hoverY=y,null==this._hoverRafId&&(this._hoverRafId=requestAnimationFrame(function(){_this._hoverRafId=null,_this._renderHoverTip();})));},_proto._renderHoverTip=function(){var tip=this._$hoverTip;if(tip){var width=this.width,tx=Math.max(0,Math.min(this._hoverX,width)),date=this._hoverTimeAt(tx),content=this._formatHoverTime(date);"function"==typeof this.options.renderHoverTip?tip.innerHTML=content:tip.textContent=content,tip.style.display="inline-flex",tip.style.opacity="1";var left,top,tipW=tip.offsetWidth;if("top"===this.options.hoverTipPlacement)(left=this._hoverX-tipW/2)+tipW>width&&(left=width-tipW),left<0&&(left=0),top=-tip.offsetHeight-2;else {(left=this._hoverX+14)+tipW>width&&(left=this._hoverX-14-tipW),left<0&&(left=0),top=this._hoverY+16;}tip.style.left=left+"px",tip.style.top=top+"px";}},_proto._hideHoverTip=function(){null!=this._hoverRafId&&(cancelAnimationFrame(this._hoverRafId),this._hoverRafId=null),this._$hoverTip&&(this._$hoverTip.style.display="none",this._$hoverTip.style.opacity="0");},_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(),this._drawHoverLine();},_proto._drawHoverLine=function(){if(this._hoverActive&&!this._isMouseDown&&this._ctx){var dpr=this.options.dpr,x=Math.max(0,Math.min(this._hoverLineX,this.width))*dpr,lineWidth=this.options.scaleLineWidth*dpr;this._drawSolidLine(x,0,x,this.height*dpr,lineWidth,this.options.hoverLineColor);}},_proto._drawScale=function(){var lineWidth=this.options.scaleLineWidth*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-this._localDayStartSec(curScaleTime))%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-this._localDayStartSec(leftLastScaleTime))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$3.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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-this._localDayStartSec(rightLastScaleTime))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$3.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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._drawCenterIndicator(centerPosition.x,centerPosition.y);},_proto._drawCenterIndicator=function(centerX,totalHeight){if(this._ctx){var dpr=this.options.dpr,lineW=2*dpr,triH=3*dpr,baseW=6*dpr,baseH=5*dpr,x=centerX;this._ctx.save(),this._ctx.fillStyle=this.options.timePointColor,this._ctx.fillRect(x-lineW/2,0,lineW,totalHeight),this._ctx.beginPath(),this._ctx.moveTo(x-baseW/2,0),this._ctx.lineTo(x+baseW/2,0),this._ctx.lineTo(x+baseW/2,baseH),this._ctx.lineTo(x,baseH+triH),this._ctx.lineTo(x-baseW/2,baseH),this._ctx.closePath(),this._ctx.fill(),this._ctx.beginPath(),this._ctx.moveTo(x-baseW/2,totalHeight),this._ctx.lineTo(x+baseW/2,totalHeight),this._ctx.lineTo(x+baseW/2,totalHeight-baseH),this._ctx.lineTo(x,totalHeight-baseH-triH),this._ctx.lineTo(x-baseW/2,totalHeight-baseH),this._ctx.closePath(),this._ctx.fill(),this._ctx.restore();}},_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=(opts=this.options,dpr=this.options.dpr,(null!=(_opts_timeTextFontSize=opts.timeTextFontSize)?_opts_timeTextFontSize:12)*(dpr||1)+"px "+(null!=(_opts_timeTextFontFamily=opts.timeTextFontFamily)?_opts_timeTextFontFamily:"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));}var opts,dpr,_opts_timeTextFontSize,_opts_timeTextFontFamily;},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],dpr=this.options.dpr,_ref=this.options.timeSectionOffset||[],tmp=_ref[0],offsetTopPx=void 0===tmp?0:tmp,tmp1=_ref[1],offsetTop=offsetTopPx*dpr,offsetBottom=(void 0===tmp1?0:tmp1)*dpr,sectionHeight=this.height*dpr-offsetTop-offsetBottom,i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,offsetTop,position.x2-position.x1,sectionHeight));}this._renderSectionIcons(this._collectSectionIcons(offsetTop,sectionHeight));},_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._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("click",this._clickFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",this._containerWheelFun,{passive:false}),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_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("click",this._clickFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this.$container.removeEventListener("wheel",this._containerWheelFun),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=true,this._mousePosition=e.pageX,this._oldTime=this.current,this._dragMoved=false,this._hideHoverTip(),this._hoverActive=false,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true,this._containerRect=this.$container.getBoundingClientRect());},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._containerRect=null,this._hideHoverTip(),this._hoverActive=false,this._draw(),this._moveEndOrTouchEndFun(e));},_proto._containerWheelFun=function(e){this.options.enabledWheelZoom&&e.target===this._$canvas&&e.preventDefault();},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._clickFun=function(e){if(!this.readOnly&&this.options.enabledClickToSeek)if(this._dragMoved)this._dragMoved=false;else {var rect=this._getContainerRect(),x=e.clientX-rect.left,date=this._hoverTimeAt(x);this._update({current:date}),null==this.options.onClickSeek||this.options.onClickSeek.call(this.options,date);}},_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;var rect=this._getContainerRect();this._hoverActive=true,this._hoverLineX=e.clientX-rect.left,this._scheduleDraw(),this._showHoverTip(e.clientX-rect.left,e.clientY-rect.top);}},_proto._mousewheelFun=function(e){if(this.options.enabledWheelZoom)if(e.preventDefault(),e.deltaY>0){if(this.timeWidth<=0)return;this.setTimeWidth(this.timeWidth-1);}else this.setTimeWidth(this.timeWidth+1);},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=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._lastTouchDist=getTouchDistance(e.touches));},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,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=true,this._dragMoved=true;}},_create_class$3(TimeLine,[{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))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH;
|
|
10564
|
+
var _$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}};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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}var _$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:false,className:"",timeWidth:0,width:"100%",timePointColor:"#FFF",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",hoverTipBgColor:"rgba(0, 0, 0, 0.75)",hoverTipColor:"#FFFFFF",hoverLineColor:"rgba(255, 255, 255, 0.8)",opBtnBorderColor:"rgba(153, 153, 153, 1)",opBtnActiveColor:"rgba(54, 159, 255, 1)",opBtnDisabledBorderColor:"rgba(222, 222, 222, 1)",pickerHeaderColor:"rgba(44, 44, 44, 1)",pickerCloseColor:"#20262c",pickerCloseActiveColor:"rgba(240, 87, 87, 1)",pickerItemTitleColor:"rgba(102, 102, 102, 1)",coverFoldPlaceholderBackColor:"#cccccc",coverFoldPlaceholderFrontColor:"#ededed",coverFoldOverlayColor:"rgba(0, 0, 0, 0.3)",itemCoverPlaceholderStartColor:"rgb(183, 195, 207)",itemCoverPlaceholderEndColor:"rgb(212, 209, 209)",timeTextFontSize:12,timeTextFontFamily:"serif",scaleLineWidth:1,onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=false,this._width=0,this._height=0,this._destroyed=false,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}),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(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:false}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height);}var _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=false,this._destroyed=true;},_create_class$2(BaseTimeLine,[{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}}]),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return 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.tranTimeToString=function(start,end){var _DateTime_toDate,_DateTime_toDate1,secondNum=Math.floor((null==(_DateTime_toDate=distExports$3.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=distExports$3.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?distExports$3.DateTime.fillZero(minute)+"'":"0'")+distExports$3.DateTime.fillZero(second)+"''"},TimeLineUtil}(),_$TIMELINE_ICONS$__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>',_$TIMELINE_ICONS$__plus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" 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-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" stroke="currentColor" fill="none" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__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 ',_$TIMELINE_ICONS$__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 ',_$TIMELINE_ICONS$__picture='\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 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 ',_$TIMELINE_ICONS$__event='\n <svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="event">\n <path d="M14.074 2.91669C15.4547 2.91669 16.574 4.03597 16.574 5.41669V15.8334C16.574 17.2141 15.4547 18.3334 14.074 18.3334H5.32968C3.94897 18.3334 2.82968 17.2141 2.82968 15.8334V5.41669C2.82968 4.03597 3.94897 2.91669 5.32968 2.91669H14.074ZM5.32968 4.16669C4.63933 4.16669 4.07968 4.72633 4.07968 5.41669V15.8334C4.07968 16.5237 4.63933 17.0834 5.32968 17.0834H14.074C14.7644 17.0834 15.324 16.5237 15.324 15.8334V5.41669C15.324 4.72633 14.7644 4.16669 14.074 4.16669H5.32968Z"/>\n <path d="M11.7228 8.54169C12.068 8.54169 12.3478 8.82151 12.3478 9.16669C12.3478 9.51186 12.068 9.79169 11.7228 9.79169H6.56897C6.22379 9.79169 5.94397 9.51186 5.94397 9.16669C5.94397 8.82151 6.22379 8.54169 6.56897 8.54169H11.7228Z"/>\n <path d="M9.14659 11.875C9.49165 11.8751 9.77159 12.1549 9.77159 12.5C9.77159 12.8451 9.49165 13.1249 9.14659 13.125H6.56927C6.2241 13.125 5.94427 12.8452 5.94427 12.5C5.94427 12.1548 6.2241 11.875 6.56927 11.875H9.14659Z"/>\n <path d="M7.09341 4.46613C7.09341 4.8113 6.81359 5.09113 6.46841 5.09113C6.12324 5.09113 5.84341 4.8113 5.84341 4.46613V2.47394C5.84341 2.12876 6.12324 1.84894 6.46841 1.84894C6.81359 1.84894 7.09341 2.12876 7.09341 2.47394V4.46613Z"/>\n <path d="M13.5607 4.46613C13.5607 4.8113 13.2809 5.09113 12.9357 5.09113C12.5905 5.09113 12.3107 4.8113 12.3107 4.46613V2.47394C12.3107 2.12876 12.5905 1.84894 12.9357 1.84894C13.2809 1.84894 13.5607 2.12876 13.5607 2.47394V4.46613Z"/>\n </svg>\n ',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小时"]],__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__={targets:[],root:null,rootMargin:"0px",threshold:.1,loadingClass:"ez-lazy-image-loading",loadedClass:"ez-lazy-image-loaded",loadedErrorClass:"ez-lazy-image-error",onLoadError:function(){}},ImageLazyLoader=function(){function ImageLazyLoader(options){ void 0===options&&(options={}),this.options=Object.assign({},__$IMAGE_LAZY_LOADER_DEFAULT_OPTIONS$__,options),this._observer=null,this._init();}var _proto=ImageLazyLoader.prototype;return _proto._init=function(){var _this=this;ImageLazyLoader.isSupported&&(this._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){var _this__observer;entry.isIntersecting&&(_this._loadImage(entry.target),null==(_this__observer=_this._observer)||_this__observer.unobserve(entry.target));});},this.options)),this.addImages(this.options.targets);},_proto._loadImage=function(img){var _img_classList,_img_classList1,_img_classList2,_this=this;if(img&&!(null==(_img_classList=img.classList)?void 0:_img_classList.contains(this.options.loadingClass))&&!(null==(_img_classList1=img.classList)?void 0:_img_classList1.contains(this.options.loadedClass))&&!(null==(_img_classList2=img.classList)?void 0:_img_classList2.contains(this.options.loadedErrorClass))&&img.hasAttribute("data-src")){var _this1=this;img.classList.add(this.options.loadingClass);var tempImg=new Image;tempImg.onload=function(){img.src=img.dataset.src,img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedClass),img.dispatchEvent(new Event("lazyloaded"));},tempImg.onerror=function(e){img.classList.remove(_this.options.loadingClass),img.classList.add(_this.options.loadedErrorClass),null==_this1.options.onLoadError||_this1.options.onLoadError.call(_this1.options,img);},tempImg.src=img.dataset.src;}},_proto.addImages=function(targets){var _this=this;(null==targets?void 0:targets.length)&&targets.forEach(function(target){var _this__observer;(null==target?void 0:target.hasAttribute("data-src"))&&(ImageLazyLoader.isSupported&&_this._observer?null==(_this__observer=_this._observer)||_this__observer.observe(target):_this._loadImage(target));});},_proto.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null);},ImageLazyLoader}();function _create_class$1$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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _set_prototype_of$1$1(o,p){return _set_prototype_of$1$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1$1(o,p)}ImageLazyLoader.isSupported="IntersectionObserver"in window;var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:false,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:true,showCoverFold:true}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:false}))||this)._isTouchStart=false,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this._imageLazyLoader=null,_this._imageLazyLoaderPicker=null,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._onImageError=_this._onImageError.bind(_this),_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._imageLazyLoader=new ImageLazyLoader({root:_this.$container,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}}),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this._applyCssVars(),_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:true,configurable:true}}),superClass&&_set_prototype_of$1$1(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto._applyCssVars=function(){var opts,_this=this,vars=(opts=this.options,{"--ez-time-line-axis-border-color":String(opts.timeAxisBgColor),"--ez-time-line-section-color":String(opts.timeSectionColor),"--ez-time-line-text-color":String(opts.timeTextColor),"--ez-time-line-point-color":String(opts.timePointColor),"--ez-time-line-current-bg":String(opts.currentTimeBgColor),"--ez-time-line-current-color":String(opts.currentTimeColor),"--ez-time-line-op-btn-border":String(opts.opBtnBorderColor),"--ez-time-line-op-btn-active":String(opts.opBtnActiveColor),"--ez-time-line-op-btn-disabled-border":String(opts.opBtnDisabledBorderColor),"--ez-time-line-picker-header":String(opts.pickerHeaderColor),"--ez-time-line-picker-close":String(opts.pickerCloseColor),"--ez-time-line-picker-close-active":String(opts.pickerCloseActiveColor),"--ez-time-line-picker-item-title":String(opts.pickerItemTitleColor),"--ez-time-line-cover-fold-placeholder-back":String(opts.coverFoldPlaceholderBackColor),"--ez-time-line-cover-fold-placeholder-front":String(opts.coverFoldPlaceholderFrontColor),"--ez-time-line-cover-fold-overlay":String(opts.coverFoldOverlayColor),"--ez-time-line-item-cover-placeholder-start":String(opts.itemCoverPlaceholderStartColor),"--ez-time-line-item-cover-placeholder-end":String(opts.itemCoverPlaceholderEndColor),"--ez-time-line-hover-tip-bg":String(opts.hoverTipBgColor),"--ez-time-line-hover-tip-color":String(opts.hoverTipColor)});Object.entries(vars).forEach(function(param){var name=param[0],value=param[1];return _this.$container.style.setProperty(name,value)});},_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$1({},record,{startTime:distExports$3.DateTime.format(record.startTime,"HH:mm:ss"),endTime:distExports$3.DateTime.format(record.endTime,"HH:mm:ss")})});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:distExports$3.DateTime.format(this.current||(new Date).getTime(),"HH:mm:ss")}),this._matchTimeDot();},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:distExports$3.DateTime.format(time,"HH:mm:ss")}),this._currentOffsetH());},_proto.destroy=function(){var _this__dragScroll;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null;}catch(error){}if(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._picker.destroy(),this._picker=null),this._imageLazyLoader&&(this._imageLazyLoader.destroy(),this._imageLazyLoader=null),this._imageLazyLoaderPicker&&(this._imageLazyLoaderPicker.destroy(),this._imageLazyLoaderPicker=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(distExports$3.DateTime.format((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+"T"+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;container.innerHTML="",timeArr.forEach(function(item,index){var _this__imageLazyLoader,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: "+String(_this.options.timeAxisBgColor)+";",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&&_this.options.showCoverFold&&(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 data-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"}):""+distExports$3.DateTime.format(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">'+_$TIMELINE_ICONS$__pause+"</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:"+String(_this.options.timeSectionColor)+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+String(_this.options.timeTextColor)+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),item.coverArr.length&&_this.options.showCoverFold&&(null==(_this__imageLazyLoader=_this._imageLazyLoader)||_this__imageLazyLoader.addImages(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,false);}},_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: '+String(this.options.currentTimeBgColor)+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+String(this.options.timePointColor)+';"></span>\n <div class="ez-time-line-current-value" style="color: '+String(this.options.currentTimeColor)+'">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:true,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">'+_$TIMELINE_ICONS$__plus+'</span> <span class="ez-time-line-icon-minus">'+_$TIMELINE_ICONS$__minus+"</span></span>",this.$container.appendChild(this._$op)),this.options.showCoverFold&&(this._picker=new Picker(null,{isMobile:true,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._imageLazyLoaderPicker=new ImageLazyLoader({root:this._picker.$body,onLoadError:function(img){null==_this._onImageError||_this._onImageError.call(_this,img);}})),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,false),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,false));this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,false),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,false),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,false));},_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=distExports$3.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1$1({},item,{_index:index})):obj[+hour]=[_extends$1$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(distExports$3.DateTime.format(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__imageLazyLoaderPicker,_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">'+_$TIMELINE_ICONS$__close+"</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="'+distExports$3.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+distExports$3.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+distExports$3.DateTime.format(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" data-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)&&(null==(_this__imageLazyLoaderPicker=this._imageLazyLoaderPicker)||_this__imageLazyLoaderPicker.addImages((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[]));},_proto._onImageError=function(img){if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML=""+_$TIMELINE_ICONS$__picture,null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.setAttribute("data-error","true"),img.remove();}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=false);},_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=false),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=true);},_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,distExports$3.DateTime.fillZero(Math.floor(second/3600))+":"+distExports$3.DateTime.fillZero(Math.floor(second%3600/60))+":"+distExports$3.DateTime.fillZero(second%60)]},_create_class$1$1(MobileTimeLine,[{key:"_scaleWidth",get:function(){return (MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}]),MobileTimeLine}(BaseTimeLine);function isOverlap(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)}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)}function getTouchDistance(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)}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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}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 _REC_EVENT_KEYS_=[1,2,3,4,5,6,"ALRAM","TIMIING","CAR","HD"],_$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,readOnly:false,scaleOffsetTop:4,showYearMonthDay:true,showHoverTip:true,hoverTipPlacement:"follow",enabledClickToSeek:true,enabledWheelZoom:true,showSectionIcon:false,sectionIconColor:"#FFFFFF",sectionIconSize:14,showSectionCount:true,sectionCountColor:"#FFFFFF",sectionCountBgColor:"#FF4D4F"},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return (_this=BaseTimeLine.call(this,container,deepmerge(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:true}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=false,_this._mousePosition=0,_this._oldTime=null,_this._isOver=false,_this._moved=false,_this._lastTouchDist=0,_this._$hoverTip=null,_this._hoverRafId=null,_this._hoverX=0,_this._hoverY=0,_this._hoverActive=false,_this._hoverLineX=0,_this._dragMoved=false,_this._containerRect=null,_this._drawRafId=null,_this._$sectionIconLayer=null,_this._sectionIconPool=[],_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._containerWheelFun=_this._containerWheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._clickFun=_this._clickFun.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:true,configurable:true}}),superClass&&_set_prototype_of$7(subClass,superClass);}(TimeLine,BaseTimeLine);var _proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cursor="pointer"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._initSectionIconLayer(),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._initHoverTip(),this._applyHoverTipVars(),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.width=this.width+"px"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.height=this.height+"px"),this._$sectionIconLayer&&(this._$sectionIconLayer.style.width=this.width+"px",this._$sectionIconLayer.style.height=this.height+"px"),this._containerRect=null,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:distExports$3.DateTime.toDate(time)});},_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,function(timeSections){if(0===timeSections.length)return timeSections;for(var normalized=timeSections.map(function(item){var startTime=item.startTime,endTime=item.endTime;return 10===(startTime+"").length&&(startTime*=1e3),10===(endTime+"").length&&(endTime*=1e3),_extends$6({},item,{startTime:startTime,endTime:endTime})}),merged=[normalized[0]],i=1;i<normalized.length;i++){var prev=merged[merged.length-1],curr=normalized[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged}(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(),this._hoverActive&&this._$hoverTip&&!this._isMouseDown&&this._showHoverTip(this._hoverX,this._hoverY);},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cursor=readOnly?"not-allowed":"pointer");},_proto.destroy=function(){this._removeEventListener(),this._hideHoverTip(),null!=this._drawRafId&&(cancelAnimationFrame(this._drawRafId),this._drawRafId=null),this._$hoverTip&&this._$hoverTip.remove(),this._$hoverTip=null,this._$sectionIconLayer&&this._$sectionIconLayer.remove(),this._$sectionIconLayer=null,this._sectionIconPool=[],this._$canvas&&this._$canvas.remove(),this._$canvas=null,this._ctx=null,this._containerRect=null,BaseTimeLine.prototype.destroy.call(this);},_proto._initSectionIconLayer=function(){var _this=this;if(this.options.showSectionIcon){var layer=document.createElement("div");layer.className="ez-time-line-section-icon-layer",layer.style.width=this.width+"px",layer.style.height=this.height+"px",this.$container.appendChild(layer),this._$sectionIconLayer=layer,delegate(layer,".ez-time-line-section-icon","click",function(event){event.stopImmediatePropagation(),event.stopPropagation(),event.preventDefault();var el=event.delegateTarget,startTime=Number(el.dataset.start),count=Number(el.dataset.count),index=Number(el.dataset.index);Number.isNaN(startTime)||null==_this.options.onSectionIconClick||_this.options.onSectionIconClick.call(_this.options,{startTime:startTime,count:Number.isNaN(count)?0:count,index:Number.isNaN(index)?-1:index});});}},_proto._isEventSection=function(section){var type=section.EVENT_TYPE;return void 0!==type&&_REC_EVENT_KEYS_.includes(type)},_proto._collectSectionIcons=function(offsetTop,sectionHeight){var _this_options_sectionIconSize,_this=this,renders=[];if(!this.options.showSectionIcon)return renders;var timeArr=this.timeSections||[],intervalSec=this._timeWidthArray[0];if(!intervalSec)return renders;for(var intervalMs=1e3*intervalSec,buckets=new Map,i=0;i<timeArr.length;i++){var section=timeArr[i];if(section&&"number"==typeof section.startTime&&this._isEventSection(section)){var idx=Math.floor(section.startTime/intervalMs),bucket=buckets.get(idx);bucket?(bucket.count+=1,section.startTime<bucket.startTime&&(bucket.startTime=section.startTime,bucket.index=i)):buckets.set(idx,{count:1,startTime:section.startTime,index:i});}}var dpr=this.options.dpr,iconSizePx=null!=(_this_options_sectionIconSize=this.options.sectionIconSize)?_this_options_sectionIconSize:14,sectionHeightPx=sectionHeight/dpr,offsetTopCss=offsetTop/dpr,size=Math.min(iconSizePx,sectionHeightPx),canvasWidthDpr=this.width*dpr;return buckets.forEach(function(bucket,idx){var bucketStart=idx*intervalMs,position=_this._findPosition({startTime:bucketStart,endTime:bucketStart+intervalMs});if(isOverlap(0,canvasWidthDpr,position.x1,position.x2)){var bucketWidthPx=(position.x2-position.x1)/dpr;renders.push({left:position.x1/dpr+(bucketWidthPx-size)/2,top:offsetTopCss+(sectionHeightPx-size)/2,size:size,count:bucket.count,startTime:bucket.startTime,index:bucket.index});}}),renders},_proto._createSectionIconEl=function(){var _this_options_sectionIconColor,_this_options_sectionCountColor,_this_options_sectionCountBgColor,span=document.createElement("span");span.className="ez-time-line-section-icon",span.style.color=null!=(_this_options_sectionIconColor=this.options.sectionIconColor)?_this_options_sectionIconColor:"#FFFFFF",span.innerHTML=_$TIMELINE_ICONS$__event;var count=document.createElement("span");return count.className="ez-time-line-section-icon-count",count.style.color=null!=(_this_options_sectionCountColor=this.options.sectionCountColor)?_this_options_sectionCountColor:"#FFFFFF",count.style.backgroundColor=null!=(_this_options_sectionCountBgColor=this.options.sectionCountBgColor)?_this_options_sectionCountBgColor:"#FF4D4F",count.style.display="none",span.appendChild(count),span},_proto._renderSectionIcons=function(renders){var layer=this._$sectionIconLayer;if(layer&&this.options.showSectionIcon){for(var pool=this._sectionIconPool,showCount=this.options.showSectionCount,i=0;i<renders.length;i++){var r=renders[i],el=pool[i];el||(el=this._createSectionIconEl(),layer.appendChild(el),pool.push(el)),el.style.display="",el.style.left=r.left+"px",el.style.bottom="0px",el.dataset.start=String(r.startTime),el.dataset.count=String(r.count),el.dataset.index=String(r.index);var countEl=el.lastElementChild;showCount&&r.count>0?(countEl.textContent=r.count>99?"99+":String(r.count),countEl.style.display=""):countEl.style.display="none";}for(;i<pool.length;i++)pool[i].style.display="none";}},_proto._initHoverTip=function(){if(this.options.showHoverTip){var tip=document.createElement("div");tip.className="ez-time-line-hover-tip",this.$container.appendChild(tip),this._$hoverTip=tip,this._applyHoverTipVars();}},_proto._applyHoverTipVars=function(){this.$container.style.setProperty("--ez-time-line-hover-tip-bg",String(this.options.hoverTipBgColor)),this.$container.style.setProperty("--ez-time-line-hover-tip-color",String(this.options.hoverTipColor));},_proto._hoverTimeAt=function(x){var seconds=(x-this.width/2)/this._curScaleSpacing*this._timeWidthArray[0];return new Date(this.current.getTime()+Math.round(1e3*seconds))},_proto._localDayStartSec=function(sec){var d=new Date(1e3*sec);return d.setHours(0,0,0,0),Math.floor(d.getTime()/1e3)},_proto._getContainerRect=function(){return this._containerRect||(this._containerRect=this.$container.getBoundingClientRect()),this._containerRect},_proto._scheduleDraw=function(){var _this=this;null==this._drawRafId&&(this._drawRafId=requestAnimationFrame(function(){_this._drawRafId=null,_this._draw();}));},_proto._formatHoverTime=function(date){if("function"==typeof this.options.renderHoverTip)return this.options.renderHoverTip(date);var fmt=this.options.hoverTipFormat||"yyyy-MM-dd HH:mm:ss";return distExports$3.DateTime.format(date,fmt)},_proto._showHoverTip=function(x,y){var _this=this;this._$hoverTip&&(this._hoverX=x,this._hoverY=y,null==this._hoverRafId&&(this._hoverRafId=requestAnimationFrame(function(){_this._hoverRafId=null,_this._renderHoverTip();})));},_proto._renderHoverTip=function(){var tip=this._$hoverTip;if(tip){var width=this.width,tx=Math.max(0,Math.min(this._hoverX,width)),date=this._hoverTimeAt(tx),content=this._formatHoverTime(date);"function"==typeof this.options.renderHoverTip?tip.innerHTML=content:tip.textContent=content,tip.style.display="inline-flex",tip.style.opacity="1";var left,top,tipW=tip.offsetWidth;if("top"===this.options.hoverTipPlacement)(left=this._hoverX-tipW/2)+tipW>width&&(left=width-tipW),left<0&&(left=0),top=-tip.offsetHeight-2;else {(left=this._hoverX+14)+tipW>width&&(left=this._hoverX-14-tipW),left<0&&(left=0),top=this._hoverY+16;}tip.style.left=left+"px",tip.style.top=top+"px";}},_proto._hideHoverTip=function(){null!=this._hoverRafId&&(cancelAnimationFrame(this._hoverRafId),this._hoverRafId=null),this._$hoverTip&&(this._$hoverTip.style.display="none",this._$hoverTip.style.opacity="0");},_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(),this._drawHoverLine();},_proto._drawHoverLine=function(){if(this._hoverActive&&!this._isMouseDown&&this._ctx){var dpr=this.options.dpr,x=Math.max(0,Math.min(this._hoverLineX,this.width))*dpr,lineWidth=this.options.scaleLineWidth*dpr;this._drawSolidLine(x,0,x,this.height*dpr,lineWidth,this.options.hoverLineColor);}},_proto._drawScale=function(){var lineWidth=this.options.scaleLineWidth*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-this._localDayStartSec(curScaleTime))%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-this._localDayStartSec(leftLastScaleTime))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$3.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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-this._localDayStartSec(rightLastScaleTime))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(distExports$3.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD HH:mm:ss"),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._drawCenterIndicator(centerPosition.x,centerPosition.y);},_proto._drawCenterIndicator=function(centerX,totalHeight){if(this._ctx){var dpr=this.options.dpr,lineW=2*dpr,triH=3*dpr,baseW=6*dpr,baseH=5*dpr,x=centerX;this._ctx.save(),this._ctx.fillStyle=this.options.timePointColor,this._ctx.fillRect(x-lineW/2,0,lineW,totalHeight),this._ctx.beginPath(),this._ctx.moveTo(x-baseW/2,0),this._ctx.lineTo(x+baseW/2,0),this._ctx.lineTo(x+baseW/2,baseH),this._ctx.lineTo(x,baseH+triH),this._ctx.lineTo(x-baseW/2,baseH),this._ctx.closePath(),this._ctx.fill(),this._ctx.beginPath(),this._ctx.moveTo(x-baseW/2,totalHeight),this._ctx.lineTo(x+baseW/2,totalHeight),this._ctx.lineTo(x+baseW/2,totalHeight-baseH),this._ctx.lineTo(x,totalHeight-baseH-triH),this._ctx.lineTo(x-baseW/2,totalHeight-baseH),this._ctx.closePath(),this._ctx.fill(),this._ctx.restore();}},_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=(opts=this.options,dpr=this.options.dpr,(null!=(_opts_timeTextFontSize=opts.timeTextFontSize)?_opts_timeTextFontSize:12)*(dpr||1)+"px "+(null!=(_opts_timeTextFontFamily=opts.timeTextFontFamily)?_opts_timeTextFontFamily:"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));}var opts,dpr,_opts_timeTextFontSize,_opts_timeTextFontFamily;},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],dpr=this.options.dpr,_ref=this.options.timeSectionOffset||[],tmp=_ref[0],offsetTopPx=void 0===tmp?0:tmp,tmp1=_ref[1],offsetTop=offsetTopPx*dpr,offsetBottom=(void 0===tmp1?0:tmp1)*dpr,sectionHeight=this.height*dpr-offsetTop-offsetBottom,i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,offsetTop,position.x2-position.x1,sectionHeight));}this._renderSectionIcons(this._collectSectionIcons(offsetTop,sectionHeight));},_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._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("click",this._clickFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",this._containerWheelFun,{passive:false}),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:false}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:false}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:false}));},_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("click",this._clickFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this.$container.removeEventListener("wheel",this._containerWheelFun),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=true,this._mousePosition=e.pageX,this._oldTime=this.current,this._dragMoved=false,this._hideHoverTip(),this._hoverActive=false,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true,this._containerRect=this.$container.getBoundingClientRect());},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._containerRect=null,this._hideHoverTip(),this._hoverActive=false,this._draw(),this._moveEndOrTouchEndFun(e));},_proto._containerWheelFun=function(e){this.options.enabledWheelZoom&&e.target===this._$canvas&&e.preventDefault();},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._clickFun=function(e){if(!this.readOnly&&this.options.enabledClickToSeek)if(this._dragMoved)this._dragMoved=false;else {var rect=this._getContainerRect(),x=e.clientX-rect.left,date=this._hoverTimeAt(x);this._update({current:date}),null==this.options.onClickSeek||this.options.onClickSeek.call(this.options,date);}},_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;var rect=this._getContainerRect();this._hoverActive=true,this._hoverLineX=e.clientX-rect.left,this._scheduleDraw(),this._showHoverTip(e.clientX-rect.left,e.clientY-rect.top);}},_proto._mousewheelFun=function(e){if(this.options.enabledWheelZoom)if(e.preventDefault(),e.deltaY>0){if(this.timeWidth<=0)return;this.setTimeWidth(this.timeWidth-1);}else this.setTimeWidth(this.timeWidth+1);},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=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._lastTouchDist=getTouchDistance(e.touches));},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=false,this._moved&&(this._moved=false,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=true,this._dragMoved=true;}},_create_class$3(TimeLine,[{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))}}]),TimeLine}(BaseTimeLine);TimeLine.TIME_WIDTH=TIME_WIDTH;
|
|
11008
10565
|
|
|
11009
10566
|
function _extends$5() {
|
|
11010
|
-
_extends$5 = Object.assign || function(target) {
|
|
10567
|
+
_extends$5 = Object.assign || function assign(target) {
|
|
11011
10568
|
for(var i = 1; i < arguments.length; i++){
|
|
11012
10569
|
var source = arguments[i];
|
|
11013
|
-
for(var key in source)
|
|
11014
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11015
|
-
target[key] = source[key];
|
|
11016
|
-
}
|
|
11017
|
-
}
|
|
10570
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
11018
10571
|
}
|
|
11019
10572
|
return target;
|
|
11020
10573
|
};
|
|
@@ -11083,8 +10636,8 @@
|
|
|
11083
10636
|
var _proto = TimeLineControl.prototype;
|
|
11084
10637
|
_proto._render = function _render() {
|
|
11085
10638
|
var _this = this;
|
|
11086
|
-
var _this_timeLineUtil_updateTimeSections, _this_timeLineUtil;
|
|
11087
10639
|
var _this__options_showTimeWidthBtn, _this__options_showCoverFold;
|
|
10640
|
+
var _this_timeLineUtil_updateTimeSections, _this_timeLineUtil;
|
|
11088
10641
|
var _timeLineOptions = _extends$5({
|
|
11089
10642
|
language: this._options.language || 'zh',
|
|
11090
10643
|
coverQuery: this._options.coverQuery || '',
|
|
@@ -11093,19 +10646,19 @@
|
|
|
11093
10646
|
hoverTipPlacement: 'top'
|
|
11094
10647
|
}, this._options || {}, {
|
|
11095
10648
|
showSectionIcon: false,
|
|
11096
|
-
onClickSeek: function(date) {
|
|
10649
|
+
onClickSeek: function onClickSeek(date) {
|
|
11097
10650
|
if (date == null ? void 0 : date.getTime()) {
|
|
11098
10651
|
_this._options.onClickSeek == null ? void 0 : _this._options.onClickSeek.call(_this._options, date);
|
|
11099
10652
|
_this.emit(EVENTS$2.control.timeLineChange, date);
|
|
11100
10653
|
}
|
|
11101
10654
|
},
|
|
11102
|
-
onChange: function(date) {
|
|
10655
|
+
onChange: function onChange(date) {
|
|
11103
10656
|
if (_this._currentTime !== (date == null ? void 0 : date.getTime())) {
|
|
11104
10657
|
_this._options.onChange == null ? void 0 : _this._options.onChange.call(_this._options, date);
|
|
11105
10658
|
_this.emit(EVENTS$2.control.timeLineChange, date);
|
|
11106
10659
|
}
|
|
11107
10660
|
},
|
|
11108
|
-
onDragEnd: function(date, isOver) {
|
|
10661
|
+
onDragEnd: function onDragEnd(date, isOver) {
|
|
11109
10662
|
var _this__options_props_playbackRange, _this__options_props, _this__options;
|
|
11110
10663
|
_this._options.onDragEnd == null ? void 0 : _this._options.onDragEnd.call(_this._options, date, isOver);
|
|
11111
10664
|
// 松手时鼠标已移出时间轴容器(isOver 为 false):控件把这种拖动视为取消,
|
|
@@ -11124,11 +10677,11 @@
|
|
|
11124
10677
|
_this.emit(EVENTS$2.control.timeLineChange, date);
|
|
11125
10678
|
}
|
|
11126
10679
|
},
|
|
11127
|
-
onPickerOpenChange: function(open) {
|
|
10680
|
+
onPickerOpenChange: function onPickerOpenChange(open) {
|
|
11128
10681
|
_this.emit(EVENTS$2.control.timeLinePanelOpenChange, open);
|
|
11129
10682
|
},
|
|
11130
10683
|
// 2025-10-27 仅移动端支持
|
|
11131
|
-
onPickerSelect: function(item) {
|
|
10684
|
+
onPickerSelect: function onPickerSelect(item) {
|
|
11132
10685
|
var date = null;
|
|
11133
10686
|
try {
|
|
11134
10687
|
if ((item.startTime + '').length === 10) date = new Date(item.startTime * 1000);
|
|
@@ -11139,7 +10692,7 @@
|
|
|
11139
10692
|
} catch (error) {
|
|
11140
10693
|
}
|
|
11141
10694
|
},
|
|
11142
|
-
onSectionIconClick: function(result) {
|
|
10695
|
+
onSectionIconClick: function onSectionIconClick(result) {
|
|
11143
10696
|
_this.emit('TimeLine.onSectionIconClick', result);
|
|
11144
10697
|
}
|
|
11145
10698
|
});
|
|
@@ -11158,7 +10711,7 @@
|
|
|
11158
10711
|
_proto._renderAddReduce = function _renderAddReduce() {
|
|
11159
10712
|
var _this = this;
|
|
11160
10713
|
this._$add = document.createElement('span');
|
|
11161
|
-
this._$add.classList.add("" + PREFIX_CLASS + "-time-line-zoom-add");
|
|
10714
|
+
this._$add.classList.add("" + PREFIX_CLASS$1 + "-time-line-zoom-add");
|
|
11162
10715
|
this._$add.innerHTML = IconComponents.add();
|
|
11163
10716
|
this._$add.addEventListener('click', function() {
|
|
11164
10717
|
if (_this.timeLineUtil) {
|
|
@@ -11167,7 +10720,7 @@
|
|
|
11167
10720
|
}
|
|
11168
10721
|
});
|
|
11169
10722
|
this._$reduce = document.createElement('span');
|
|
11170
|
-
this._$reduce.classList.add("" + PREFIX_CLASS + "-time-line-zoom-sub");
|
|
10723
|
+
this._$reduce.classList.add("" + PREFIX_CLASS$1 + "-time-line-zoom-sub");
|
|
11171
10724
|
this._$reduce.innerHTML = IconComponents.reduce();
|
|
11172
10725
|
this._$reduce.addEventListener('click', function() {
|
|
11173
10726
|
if (_this.timeLineUtil) {
|
|
@@ -11176,7 +10729,7 @@
|
|
|
11176
10729
|
}
|
|
11177
10730
|
});
|
|
11178
10731
|
this._$scaleWrapper = document.createElement('span');
|
|
11179
|
-
this._$scaleWrapper.classList.add("" + PREFIX_CLASS + "-time-line-zoom");
|
|
10732
|
+
this._$scaleWrapper.classList.add("" + PREFIX_CLASS$1 + "-time-line-zoom");
|
|
11180
10733
|
this._$scaleWrapper.appendChild(this._$add);
|
|
11181
10734
|
this._$scaleWrapper.appendChild(this._$reduce);
|
|
11182
10735
|
this.$container.appendChild(this._$scaleWrapper);
|
|
@@ -11209,15 +10762,17 @@
|
|
|
11209
10762
|
return TimeLineControl;
|
|
11210
10763
|
}(Control);
|
|
11211
10764
|
|
|
10765
|
+
/*
|
|
10766
|
+
* @ezuikit/control-segment-progress v0.0.1
|
|
10767
|
+
* Copyright (c) 2026-08-14 18:22:56 Ezviz-OpenBiz
|
|
10768
|
+
* Released under the MIT License.
|
|
10769
|
+
*/var PREFIX_CLASS="ez-segment-progress";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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function formatDuration(duration){var safe=Number.isFinite(duration)&&duration>0?duration:0,totalSeconds=Math.floor(safe/1e3),seconds=totalSeconds%60,minutes=Math.floor(totalSeconds/60)%60,hours=Math.floor(totalSeconds/3600),pad=function(value){return String(value).padStart(2,"0")};return safe>=36e5?pad(hours)+":"+pad(minutes)+":"+pad(seconds):pad(minutes)+":"+pad(seconds)}var SegmentProgress=function(){function SegmentProgress(container,options){var _options_begin,_options_end,_options_current,_this=this;void 0===options&&(options={}),this._begin=0,this._end=0,this._current=0,this._dragMs=null,this._disabled=false,this._rafId=0,this._destroyed=false,this._onStart=function(e){_this._disabled||_this._end<=_this._begin||(e.stopPropagation(),e.preventDefault(),_this._dragMs=_this._positionToTime(e),_this.$root.classList.add(PREFIX_CLASS+"-dragging"),null==_this._options.onDragStart||_this._options.onDragStart.call(_this._options),document.addEventListener("touchmove",_this._onMove,{passive:false}),document.addEventListener("mousemove",_this._onMove),document.addEventListener("touchend",_this._onEnd),document.addEventListener("touchcancel",_this._onEnd),document.addEventListener("mouseup",_this._onEnd),_this._render());},this._onMove=function(e){null!==_this._dragMs&&(e.preventDefault(),_this._dragMs=_this._positionToTime(e),_this._scheduleRender());},this._onEnd=function(){if(null!==_this._dragMs){var target=_this._dragMs;document.removeEventListener("touchmove",_this._onMove),document.removeEventListener("mousemove",_this._onMove),document.removeEventListener("touchend",_this._onEnd),document.removeEventListener("touchcancel",_this._onEnd),document.removeEventListener("mouseup",_this._onEnd),_this._dragMs=null,_this._current=target,_this.$root.classList.remove(PREFIX_CLASS+"-dragging"),_this._render(),null==_this._options.onDragEnd||_this._options.onDragEnd.call(_this._options),null==_this._options.onChange||_this._options.onChange.call(_this._options,new Date(target));}},this._options=options,this._begin=null!=(_options_begin=options.begin)?_options_begin:0,this._end=null!=(_options_end=options.end)?_options_end:0,this._current=null!=(_options_current=options.current)?_options_current:this._begin,this._disabled=!!options.disabled,this.$root=document.createElement("div"),this.$root.className=PREFIX_CLASS,this.$currentTime=document.createElement("span"),this.$currentTime.className=PREFIX_CLASS+"-time "+PREFIX_CLASS+"-time-current",this.$totalTime=document.createElement("span"),this.$totalTime.className=PREFIX_CLASS+"-time "+PREFIX_CLASS+"-time-total",this.$track=document.createElement("div"),this.$track.className=PREFIX_CLASS+"-track",this.$track.setAttribute("role","slider"),this.$track.setAttribute("tabindex","0"),this.$track.setAttribute("aria-label","playback progress"),this.$played=document.createElement("div"),this.$played.className=PREFIX_CLASS+"-played",this.$thumb=document.createElement("div"),this.$thumb.className=PREFIX_CLASS+"-thumb",this.$track.appendChild(this.$played),this.$track.appendChild(this.$thumb),this.$root.appendChild(this.$currentTime),this.$root.appendChild(this.$track),this.$root.appendChild(this.$totalTime),container.appendChild(this.$root),this._bindEvents(),this._render();}var _proto=SegmentProgress.prototype;return _proto.setSegment=function(begin,end){!Number.isFinite(begin)||!Number.isFinite(end)||end<=begin||(this._begin=begin,this._end=end,this._current=Math.min(Math.max(this._current,begin),end),this._dragMs=null,this._render());},_proto.setCurrent=function(timeMs){Number.isFinite(timeMs)&&null===this._dragMs&&(this._current=this._clamp(timeMs),this._scheduleRender());},_proto.setDisabled=function(disabled){this._disabled=disabled,this.$root.classList.toggle(PREFIX_CLASS+"-disabled",disabled),this.$track.setAttribute("aria-disabled",String(disabled));},_proto.destroy=function(){this._destroyed=true,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=0),this.$track.removeEventListener("touchstart",this._onStart),this.$track.removeEventListener("mousedown",this._onStart),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("touchend",this._onEnd),document.removeEventListener("touchcancel",this._onEnd),document.removeEventListener("mouseup",this._onEnd),this.$root.remove();},_proto._bindEvents=function(){this.$track.addEventListener("touchstart",this._onStart,{passive:false}),this.$track.addEventListener("mousedown",this._onStart);},_proto._positionToTime=function(e){var _ref,_ref1,_e_touches_,_e_changedTouches_,_e_changedTouches,rect=this.$track.getBoundingClientRect(),clientX="touches"in e?null!=(_ref=null!=(_ref1=null==(_e_touches_=e.touches[0])?void 0:_e_touches_.clientX)?_ref1:null==(_e_changedTouches=e.changedTouches)||null==(_e_changedTouches_=_e_changedTouches[0])?void 0:_e_changedTouches_.clientX)?_ref:0:e.clientX,ratio=rect.width>0?(clientX-rect.left)/rect.width:0;return this._clamp(this._begin+Math.min(Math.max(ratio,0),1)*(this._end-this._begin))},_proto._clamp=function(ms){return this._end<=this._begin?this._begin:Math.min(Math.max(ms,this._begin),this._end)},_proto._scheduleRender=function(){var _this=this;this._rafId||this._destroyed||(this._rafId=requestAnimationFrame(function(){_this._rafId=0,_this._render();}));},_proto._render=function(){var _this__dragMs;if(!this._destroyed){var duration=this._end-this._begin,displayMs=null!=(_this__dragMs=this._dragMs)?_this__dragMs:this._current,elapsed=duration>0?Math.min(Math.max(displayMs-this._begin,0),duration):0,percent=(100*(duration>0?elapsed/duration:0)).toFixed(3)+"%";this.$played.style.width=percent,this.$thumb.style.transform="translate(-50%, -50%)",this.$thumb.style.left=percent,this.$currentTime.textContent=formatDuration(elapsed),this.$totalTime.textContent=formatDuration(duration),this.$track.setAttribute("aria-valuemin","0"),this.$track.setAttribute("aria-valuemax",String(Math.floor(duration/1e3))),this.$track.setAttribute("aria-valuenow",String(Math.floor(elapsed/1e3))),this.$track.setAttribute("aria-valuetext",formatDuration(elapsed));}},_create_class$1(SegmentProgress,[{key:"$container",get:function(){return this.$root}}]),SegmentProgress}();
|
|
10770
|
+
|
|
11212
10771
|
function _extends$4() {
|
|
11213
|
-
_extends$4 = Object.assign || function(target) {
|
|
10772
|
+
_extends$4 = Object.assign || function assign(target) {
|
|
11214
10773
|
for(var i = 1; i < arguments.length; i++){
|
|
11215
10774
|
var source = arguments[i];
|
|
11216
|
-
for(var key in source)
|
|
11217
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11218
|
-
target[key] = source[key];
|
|
11219
|
-
}
|
|
11220
|
-
}
|
|
10775
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
11221
10776
|
}
|
|
11222
10777
|
return target;
|
|
11223
10778
|
};
|
|
@@ -11262,8 +10817,8 @@
|
|
|
11262
10817
|
* @param seg 录像片段
|
|
11263
10818
|
* @param which 取起点还是终点
|
|
11264
10819
|
*/ function segMs(seg, which) {
|
|
11265
|
-
var
|
|
11266
|
-
var value = which === 'start' ? (
|
|
10820
|
+
var _ref, _ref1;
|
|
10821
|
+
var value = which === 'start' ? (_ref = seg == null ? void 0 : seg.startTime) != null ? _ref : seg == null ? void 0 : seg.begin : (_ref1 = seg == null ? void 0 : seg.endTime) != null ? _ref1 : seg == null ? void 0 : seg.end;
|
|
11267
10822
|
if (value === undefined || value === null || value === '') return NaN;
|
|
11268
10823
|
if (typeof value === 'number') return value < 1e12 ? value * 1000 : value;
|
|
11269
10824
|
return distExports$3.DateTime.toDate(value).getTime();
|
|
@@ -11324,17 +10879,17 @@
|
|
|
11324
10879
|
_proto._render = function _render() {
|
|
11325
10880
|
var _this = this;
|
|
11326
10881
|
this._progress = new SegmentProgress(this.$container, {
|
|
11327
|
-
onChange: function(date) {
|
|
10882
|
+
onChange: function onChange(date) {
|
|
11328
10883
|
// 用户主动定位即视为重新开始播放,立即解除结束静默,否则静默期内的回写被丢弃、
|
|
11329
10884
|
// 进度条会停住不动
|
|
11330
10885
|
_this._silenceUntil = 0;
|
|
11331
10886
|
_this._options.onChange == null ? void 0 : _this._options.onChange.call(_this._options, date);
|
|
11332
10887
|
_this.emit(EVENTS$2.control.timeLineChange, date);
|
|
11333
10888
|
},
|
|
11334
|
-
onDragStart: function() {
|
|
10889
|
+
onDragStart: function onDragStart() {
|
|
11335
10890
|
_this._isDragging = true;
|
|
11336
10891
|
},
|
|
11337
|
-
onDragEnd: function() {
|
|
10892
|
+
onDragEnd: function onDragEnd() {
|
|
11338
10893
|
_this._isDragging = false;
|
|
11339
10894
|
}
|
|
11340
10895
|
});
|
|
@@ -11427,14 +10982,10 @@
|
|
|
11427
10982
|
}(Control);
|
|
11428
10983
|
|
|
11429
10984
|
function _extends$3() {
|
|
11430
|
-
_extends$3 = Object.assign || function(target) {
|
|
10985
|
+
_extends$3 = Object.assign || function assign(target) {
|
|
11431
10986
|
for(var i = 1; i < arguments.length; i++){
|
|
11432
10987
|
var source = arguments[i];
|
|
11433
|
-
for(var key in source)
|
|
11434
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11435
|
-
target[key] = source[key];
|
|
11436
|
-
}
|
|
11437
|
-
}
|
|
10988
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
11438
10989
|
}
|
|
11439
10990
|
return target;
|
|
11440
10991
|
};
|
|
@@ -11478,15 +11029,15 @@
|
|
|
11478
11029
|
var _proto = Device.prototype;
|
|
11479
11030
|
_proto._render = function _render() {
|
|
11480
11031
|
var _this___options_props_urlInfo, _this___options_props;
|
|
11481
|
-
this.$container.innerHTML = '<span class="' + PREFIX_CLASS + "-text " + PREFIX_CLASS + '-text-device">' + this._splicingString(this.__options.deviceName, (_this___options_props = this.__options.props) == null ? void 0 : (_this___options_props_urlInfo = _this___options_props.urlInfo) == null ? void 0 : _this___options_props_urlInfo.deviceSerial) + "</span>";
|
|
11032
|
+
this.$container.innerHTML = '<span class="' + PREFIX_CLASS$1 + "-text " + PREFIX_CLASS$1 + '-text-device">' + this._splicingString(this.__options.deviceName, (_this___options_props = this.__options.props) == null ? void 0 : (_this___options_props_urlInfo = _this___options_props.urlInfo) == null ? void 0 : _this___options_props_urlInfo.deviceSerial) + "</span>";
|
|
11482
11033
|
};
|
|
11483
11034
|
/**
|
|
11484
11035
|
* 更新设备序列号
|
|
11485
11036
|
* @param deviceSerial - 设备序列号
|
|
11486
11037
|
* @param deviceName - 设备名称
|
|
11487
11038
|
*/ _proto.update = function update(deviceName, deviceSerial) {
|
|
11488
|
-
if (this.$container.querySelector("." + PREFIX_CLASS + "-text-device")) {
|
|
11489
|
-
var $span = this.$container.querySelector("." + PREFIX_CLASS + "-text-device");
|
|
11039
|
+
if (this.$container.querySelector("." + PREFIX_CLASS$1 + "-text-device")) {
|
|
11040
|
+
var $span = this.$container.querySelector("." + PREFIX_CLASS$1 + "-text-device");
|
|
11490
11041
|
var text = this._splicingString(deviceName, deviceSerial);
|
|
11491
11042
|
$span == null ? void 0 : $span.setAttribute('title', text);
|
|
11492
11043
|
$span.innerHTML = text;
|
|
@@ -11524,7 +11075,7 @@
|
|
|
11524
11075
|
segmentProgress: SegmentProgressControl
|
|
11525
11076
|
};
|
|
11526
11077
|
|
|
11527
|
-
|
|
11078
|
+
function _inherits$3(subClass, superClass) {
|
|
11528
11079
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
11529
11080
|
throw new TypeError("Super expression must either be null or a function");
|
|
11530
11081
|
}
|
|
@@ -11555,25 +11106,25 @@
|
|
|
11555
11106
|
_this.options = options;
|
|
11556
11107
|
_this.$container = container;
|
|
11557
11108
|
_this.$popupContainer = document.createElement('div');
|
|
11558
|
-
_this.$popupContainer.classList.add("" + PREFIX_CLASS + "-rec-footer");
|
|
11109
|
+
_this.$popupContainer.classList.add("" + PREFIX_CLASS$1 + "-rec-footer");
|
|
11559
11110
|
_this.$container.appendChild(_this.$popupContainer);
|
|
11560
11111
|
_this.$timeLineContainer = document.createElement('div');
|
|
11561
|
-
_this.$timeLineContainer.classList.add("" + PREFIX_CLASS + "-rec-footer-time-line");
|
|
11112
|
+
_this.$timeLineContainer.classList.add("" + PREFIX_CLASS$1 + "-rec-footer-time-line");
|
|
11562
11113
|
if (_this.options.hasDatePicker || _this.options.hasTimePicker) {
|
|
11563
11114
|
_this.$popupContainer.appendChild(_this.$timeLineContainer);
|
|
11564
11115
|
// 右侧容器: 放置时间选择器和日期选择器
|
|
11565
11116
|
_this.$rightContainer = document.createElement('div');
|
|
11566
|
-
_this.$rightContainer.classList.add("" + PREFIX_CLASS + "-rec-footer-right");
|
|
11117
|
+
_this.$rightContainer.classList.add("" + PREFIX_CLASS$1 + "-rec-footer-right");
|
|
11567
11118
|
_this.$popupContainer.appendChild(_this.$rightContainer);
|
|
11568
11119
|
}
|
|
11569
11120
|
if (_this.options.hasTimePicker) {
|
|
11570
11121
|
_this.$timePickerContainer = document.createElement('div');
|
|
11571
|
-
_this.$timePickerContainer.classList.add("" + PREFIX_CLASS + "-rec-footer-btn", "" + PREFIX_CLASS + "-rec-footer-time-picker");
|
|
11122
|
+
_this.$timePickerContainer.classList.add("" + PREFIX_CLASS$1 + "-rec-footer-btn", "" + PREFIX_CLASS$1 + "-rec-footer-time-picker");
|
|
11572
11123
|
_this.$rightContainer.appendChild(_this.$timePickerContainer);
|
|
11573
11124
|
}
|
|
11574
11125
|
if (_this.options.hasDatePicker) {
|
|
11575
11126
|
_this.$datePickerContainer = document.createElement('div');
|
|
11576
|
-
_this.$datePickerContainer.classList.add("" + PREFIX_CLASS + "-rec-footer-btn", "" + PREFIX_CLASS + "-rec-footer-date-picker");
|
|
11127
|
+
_this.$datePickerContainer.classList.add("" + PREFIX_CLASS$1 + "-rec-footer-btn", "" + PREFIX_CLASS$1 + "-rec-footer-date-picker");
|
|
11577
11128
|
_this.$rightContainer.appendChild(_this.$datePickerContainer);
|
|
11578
11129
|
}
|
|
11579
11130
|
_this.$popupContainer.addEventListener('dblclick', function(e) {
|
|
@@ -11609,7 +11160,7 @@
|
|
|
11609
11160
|
this.emit(EVENTS$2.theme.recFooterDestroy);
|
|
11610
11161
|
};
|
|
11611
11162
|
return RecFooter;
|
|
11612
|
-
}(EventEmitter
|
|
11163
|
+
}(EventEmitter);
|
|
11613
11164
|
|
|
11614
11165
|
function _inherits$2(subClass, superClass) {
|
|
11615
11166
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -11656,27 +11207,27 @@
|
|
|
11656
11207
|
_proto.render = function render() {
|
|
11657
11208
|
if (!this.$container) {
|
|
11658
11209
|
this.$container = document.createElement('div');
|
|
11659
|
-
this.$container.classList.add("" + PREFIX_CLASS + "-mobile-extend");
|
|
11210
|
+
this.$container.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend");
|
|
11660
11211
|
this._$siblingContainer.insertAdjacentElement == null ? void 0 : this._$siblingContainer.insertAdjacentElement.call(this._$siblingContainer, 'afterend', this.$container);
|
|
11661
11212
|
// 移动端扩展面板容器
|
|
11662
11213
|
this.$controlPanel = document.createElement('div');
|
|
11663
|
-
this.$controlPanel.classList.add("" + PREFIX_CLASS + "-mobile-extend-control-panel");
|
|
11214
|
+
this.$controlPanel.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-control-panel");
|
|
11664
11215
|
this.$container.appendChild(this.$controlPanel);
|
|
11665
11216
|
this.$content = document.createElement('div');
|
|
11666
|
-
this.$content.classList.add("" + PREFIX_CLASS + "-mobile-extend-control-content");
|
|
11217
|
+
this.$content.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-control-content");
|
|
11667
11218
|
this.$controlPanel.appendChild(this.$content);
|
|
11668
11219
|
// 片段进度条紧贴播放控件下方,位于日期/回放类型那一行之前
|
|
11669
11220
|
this.$segmentProgress = document.createElement('div');
|
|
11670
|
-
this.$segmentProgress.classList.add("" + PREFIX_CLASS + "-mobile-extend-segment-progress");
|
|
11221
|
+
this.$segmentProgress.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-segment-progress");
|
|
11671
11222
|
this.$content.appendChild(this.$segmentProgress);
|
|
11672
11223
|
this.$top = document.createElement('div');
|
|
11673
|
-
this.$top.classList.add("" + PREFIX_CLASS + "-mobile-extend-control-top");
|
|
11224
|
+
this.$top.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-control-top");
|
|
11674
11225
|
this.$content.appendChild(this.$top);
|
|
11675
11226
|
this.$topLeft = document.createElement('div');
|
|
11676
|
-
this.$topLeft.classList.add("" + PREFIX_CLASS + "-mobile-extend-control-top-left");
|
|
11227
|
+
this.$topLeft.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-control-top-left");
|
|
11677
11228
|
this.$top.appendChild(this.$topLeft);
|
|
11678
11229
|
this.$topRight = document.createElement('div');
|
|
11679
|
-
this.$topRight.classList.add("" + PREFIX_CLASS + "-mobile-extend-control-top-right");
|
|
11230
|
+
this.$topRight.classList.add("" + PREFIX_CLASS$1 + "-mobile-extend-control-top-right");
|
|
11680
11231
|
this.$top.appendChild(this.$topRight);
|
|
11681
11232
|
}
|
|
11682
11233
|
};
|
|
@@ -11686,17 +11237,13 @@
|
|
|
11686
11237
|
this.emit(EVENTS$2.theme.mobileExtendDestroy);
|
|
11687
11238
|
};
|
|
11688
11239
|
return MobileExtend;
|
|
11689
|
-
}(EventEmitter
|
|
11240
|
+
}(EventEmitter);
|
|
11690
11241
|
|
|
11691
11242
|
function _extends$2() {
|
|
11692
|
-
_extends$2 = Object.assign || function(target) {
|
|
11243
|
+
_extends$2 = Object.assign || function assign(target) {
|
|
11693
11244
|
for(var i = 1; i < arguments.length; i++){
|
|
11694
11245
|
var source = arguments[i];
|
|
11695
|
-
for(var key in source)
|
|
11696
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11697
|
-
target[key] = source[key];
|
|
11698
|
-
}
|
|
11699
|
-
}
|
|
11246
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
11700
11247
|
}
|
|
11701
11248
|
return target;
|
|
11702
11249
|
};
|
|
@@ -11737,7 +11284,7 @@
|
|
|
11737
11284
|
classNameSuffix: 'pause'
|
|
11738
11285
|
}))) || this, _this._timer = null, _this._timer2 = null, _this._timer3 = null, _this._firstFlag = false;
|
|
11739
11286
|
_this._options = Object.assign({}, PAUSE_DEFAULT_OPTIONS, options);
|
|
11740
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-pause", "" + PREFIX_CLASS + "-hide");
|
|
11287
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-pause", "" + PREFIX_CLASS$1 + "-hide");
|
|
11741
11288
|
return _this;
|
|
11742
11289
|
}
|
|
11743
11290
|
var _proto = Pause.prototype;
|
|
@@ -11753,9 +11300,9 @@
|
|
|
11753
11300
|
this.$container.style.cssText += "pointer-events: none;";
|
|
11754
11301
|
}
|
|
11755
11302
|
if (playing) {
|
|
11756
|
-
this.$container.innerHTML = '<div class="' + PREFIX_CLASS + '-pause-circle">' + IconComponents.play() + "</div>";
|
|
11303
|
+
this.$container.innerHTML = '<div class="' + PREFIX_CLASS$1 + '-pause-circle">' + IconComponents.play() + "</div>";
|
|
11757
11304
|
} else {
|
|
11758
|
-
this.$container.innerHTML = '<div class="' + PREFIX_CLASS + '-pause-circle">' + IconComponents.pause() + "</div>";
|
|
11305
|
+
this.$container.innerHTML = '<div class="' + PREFIX_CLASS$1 + '-pause-circle">' + IconComponents.pause() + "</div>";
|
|
11759
11306
|
}
|
|
11760
11307
|
if (this._timer) {
|
|
11761
11308
|
clearTimeout(this._timer);
|
|
@@ -11765,7 +11312,7 @@
|
|
|
11765
11312
|
clearTimeout(this._timer2);
|
|
11766
11313
|
this._timer2 = null;
|
|
11767
11314
|
}
|
|
11768
|
-
(_this_$container = this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.remove("" + PREFIX_CLASS + "-hide");
|
|
11315
|
+
(_this_$container = this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.remove("" + PREFIX_CLASS$1 + "-hide");
|
|
11769
11316
|
this._timer = setTimeout(function() {
|
|
11770
11317
|
var _this_$container_classList, _this_$container;
|
|
11771
11318
|
if (_this._timer) {
|
|
@@ -11775,15 +11322,15 @@
|
|
|
11775
11322
|
if (always) {
|
|
11776
11323
|
return;
|
|
11777
11324
|
}
|
|
11778
|
-
(_this_$container = _this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.add("" + PREFIX_CLASS + "-pause-transform");
|
|
11325
|
+
(_this_$container = _this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.add("" + PREFIX_CLASS$1 + "-pause-transform");
|
|
11779
11326
|
_this._timer2 = setTimeout(function() {
|
|
11780
11327
|
var _this_$container_classList, _this_$container, _this_$container_classList1, _this_$container1;
|
|
11781
11328
|
if (_this._timer2) {
|
|
11782
11329
|
clearTimeout(_this._timer2);
|
|
11783
11330
|
_this._timer2 = null;
|
|
11784
11331
|
}
|
|
11785
|
-
(_this_$container = _this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.add("" + PREFIX_CLASS + "-hide");
|
|
11786
|
-
(_this_$container1 = _this.$container) == null ? void 0 : (_this_$container_classList1 = _this_$container1.classList) == null ? void 0 : _this_$container_classList1.remove("" + PREFIX_CLASS + "-pause-transform");
|
|
11332
|
+
(_this_$container = _this.$container) == null ? void 0 : (_this_$container_classList = _this_$container.classList) == null ? void 0 : _this_$container_classList.add("" + PREFIX_CLASS$1 + "-hide");
|
|
11333
|
+
(_this_$container1 = _this.$container) == null ? void 0 : (_this_$container_classList1 = _this_$container1.classList) == null ? void 0 : _this_$container_classList1.remove("" + PREFIX_CLASS$1 + "-pause-transform");
|
|
11787
11334
|
}, 300);
|
|
11788
11335
|
}, 10);
|
|
11789
11336
|
};
|
|
@@ -11828,7 +11375,7 @@
|
|
|
11828
11375
|
return Pause;
|
|
11829
11376
|
}(Control);
|
|
11830
11377
|
|
|
11831
|
-
var _unmountedControls = function(theme) {
|
|
11378
|
+
var _unmountedControls = function _unmountedControls(theme) {
|
|
11832
11379
|
if (!theme.controls) {
|
|
11833
11380
|
return;
|
|
11834
11381
|
}
|
|
@@ -11915,11 +11462,8 @@
|
|
|
11915
11462
|
reject(error);
|
|
11916
11463
|
return;
|
|
11917
11464
|
}
|
|
11918
|
-
if (info.done)
|
|
11919
|
-
|
|
11920
|
-
} else {
|
|
11921
|
-
Promise.resolve(value).then(_next, _throw);
|
|
11922
|
-
}
|
|
11465
|
+
if (info.done) resolve(value);
|
|
11466
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
11923
11467
|
}
|
|
11924
11468
|
function _async_to_generator$1(fn) {
|
|
11925
11469
|
return function() {
|
|
@@ -11936,28 +11480,6 @@
|
|
|
11936
11480
|
});
|
|
11937
11481
|
};
|
|
11938
11482
|
}
|
|
11939
|
-
function _extends$1() {
|
|
11940
|
-
_extends$1 = Object.assign || function(target) {
|
|
11941
|
-
for(var i = 1; i < arguments.length; i++){
|
|
11942
|
-
var source = arguments[i];
|
|
11943
|
-
for(var key in source){
|
|
11944
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11945
|
-
target[key] = source[key];
|
|
11946
|
-
}
|
|
11947
|
-
}
|
|
11948
|
-
}
|
|
11949
|
-
return target;
|
|
11950
|
-
};
|
|
11951
|
-
return _extends$1.apply(this, arguments);
|
|
11952
|
-
}
|
|
11953
|
-
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
11954
|
-
if (!o) return;
|
|
11955
|
-
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
11956
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
11957
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
11958
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
11959
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
11960
|
-
}
|
|
11961
11483
|
function _create_for_of_iterator_helper_loose$1(o, allowArrayLike) {
|
|
11962
11484
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
11963
11485
|
if (it) return (it = it.call(o)).next.bind(it);
|
|
@@ -11965,18 +11487,26 @@
|
|
|
11965
11487
|
if (it) o = it;
|
|
11966
11488
|
var i = 0;
|
|
11967
11489
|
return function() {
|
|
11968
|
-
if (i >= o.length) {
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
};
|
|
11972
|
-
}
|
|
11490
|
+
if (i >= o.length) return {
|
|
11491
|
+
done: true
|
|
11492
|
+
};
|
|
11973
11493
|
return {
|
|
11974
11494
|
done: false,
|
|
11975
11495
|
value: o[i++]
|
|
11976
11496
|
};
|
|
11977
11497
|
};
|
|
11978
11498
|
}
|
|
11979
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance
|
|
11499
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
11500
|
+
}
|
|
11501
|
+
function _extends$1() {
|
|
11502
|
+
_extends$1 = Object.assign || function assign(target) {
|
|
11503
|
+
for(var i = 1; i < arguments.length; i++){
|
|
11504
|
+
var source = arguments[i];
|
|
11505
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
11506
|
+
}
|
|
11507
|
+
return target;
|
|
11508
|
+
};
|
|
11509
|
+
return _extends$1.apply(this, arguments);
|
|
11980
11510
|
}
|
|
11981
11511
|
function _ts_generator$1(thisArg, body) {
|
|
11982
11512
|
var f, y, t, _ = {
|
|
@@ -11987,9 +11517,17 @@
|
|
|
11987
11517
|
},
|
|
11988
11518
|
trys: [],
|
|
11989
11519
|
ops: []
|
|
11990
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
11991
|
-
return
|
|
11992
|
-
|
|
11520
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
11521
|
+
return d(g, "next", {
|
|
11522
|
+
value: verb(0)
|
|
11523
|
+
}), d(g, "throw", {
|
|
11524
|
+
value: verb(1)
|
|
11525
|
+
}), d(g, "return", {
|
|
11526
|
+
value: verb(2)
|
|
11527
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
11528
|
+
value: function() {
|
|
11529
|
+
return this;
|
|
11530
|
+
}
|
|
11993
11531
|
}), g;
|
|
11994
11532
|
function verb(n) {
|
|
11995
11533
|
return function(v) {
|
|
@@ -12069,6 +11607,14 @@
|
|
|
12069
11607
|
};
|
|
12070
11608
|
}
|
|
12071
11609
|
}
|
|
11610
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
11611
|
+
if (!o) return;
|
|
11612
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
11613
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
11614
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
11615
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
11616
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
11617
|
+
}
|
|
12072
11618
|
// 需要权限的控件
|
|
12073
11619
|
var AUTH_KEY = [
|
|
12074
11620
|
'ptz',
|
|
@@ -12107,7 +11653,7 @@
|
|
|
12107
11653
|
// eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
|
|
12108
11654
|
theme.controls["deviceControl"] = new Controls["device"](_extends$1({
|
|
12109
11655
|
rootContainer: theme.$container,
|
|
12110
|
-
getPopupContainer: function() {
|
|
11656
|
+
getPopupContainer: function getPopupContainer() {
|
|
12111
11657
|
return $container;
|
|
12112
11658
|
},
|
|
12113
11659
|
recType: theme.recType,
|
|
@@ -12130,7 +11676,7 @@
|
|
|
12130
11676
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12131
11677
|
theme.controls["" + item.iconId + "Control"] = new Controls[item.iconId](_extends$1({
|
|
12132
11678
|
rootContainer: theme.$container,
|
|
12133
|
-
getPopupContainer: function() {
|
|
11679
|
+
getPopupContainer: function getPopupContainer() {
|
|
12134
11680
|
return $container;
|
|
12135
11681
|
},
|
|
12136
11682
|
language: theme.options.language || "zh",
|
|
@@ -12157,7 +11703,7 @@
|
|
|
12157
11703
|
}
|
|
12158
11704
|
function _renderTheme(theme, data) {
|
|
12159
11705
|
return _async_to_generator$1(function() {
|
|
12160
|
-
var _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_urlInfo, _theme_playbackRange, _theme_playbackRange1, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1,
|
|
11706
|
+
var _ref, _theme_posterControl, _filterThemeData_header, _filterThemeData_footer, _theme_urlInfo, _theme_playbackRange, _theme_playbackRange1, _theme_options_mobileExtendOptions_controls, _theme_options_mobileExtendOptions, themeData, filterThemeData, props, _$_filterLeftRightControls, leftBtns, rightBtns, _theme_controls, _theme_controls1, _$_filterLeftRightControls1, leftBtns1, rightBtns1, list, _needTimeLine, _hasPlaybackRange, _needDatePicker, hasPtz, _theme_options_mobileExtendOptions1, _theme_options_mobileExtendOptions2, _theme_options_mobileExtendOptions3, _theme_options_mobileExtendOptions4, _theme_controls2, _theme_options_mobileExtendOptions5, _theme_options_mobileExtendOptions_controls1, _theme_options_mobileExtendOptions6, _ref1, _filterThemeData_header1, _filterThemeData_footer1, _theme_options;
|
|
12161
11707
|
return _ts_generator$1(this, function(_state) {
|
|
12162
11708
|
switch(_state.label){
|
|
12163
11709
|
case 0:
|
|
@@ -12183,7 +11729,7 @@
|
|
|
12183
11729
|
language: theme.options.language,
|
|
12184
11730
|
locales: theme.i18n.translations
|
|
12185
11731
|
}, theme.options.loadingOptions || {}, {
|
|
12186
|
-
getPopupContainer: function() {
|
|
11732
|
+
getPopupContainer: function getPopupContainer() {
|
|
12187
11733
|
return theme.$container;
|
|
12188
11734
|
}
|
|
12189
11735
|
}));
|
|
@@ -12193,7 +11739,7 @@
|
|
|
12193
11739
|
language: theme.options.language,
|
|
12194
11740
|
locales: theme.i18n.translations
|
|
12195
11741
|
}, theme.options.pauseOptions || {}, {
|
|
12196
|
-
getPopupContainer: function() {
|
|
11742
|
+
getPopupContainer: function getPopupContainer() {
|
|
12197
11743
|
return theme.contentControl.$wrapper;
|
|
12198
11744
|
}
|
|
12199
11745
|
}));
|
|
@@ -12205,14 +11751,14 @@
|
|
|
12205
11751
|
theme.messageControl = new Message(_extends$1({
|
|
12206
11752
|
rootContainer: theme.$container
|
|
12207
11753
|
}, theme.options.messageOptions || {}, {
|
|
12208
|
-
getPopupContainer: function() {
|
|
11754
|
+
getPopupContainer: function getPopupContainer() {
|
|
12209
11755
|
return theme.contentControl.$wrapper;
|
|
12210
11756
|
}
|
|
12211
11757
|
}));
|
|
12212
11758
|
}
|
|
12213
11759
|
if (theme.options.posterOptions !== null) {
|
|
12214
11760
|
theme.posterControl = new Poster(_extends$1({}, theme.options.posterOptions || {}, {
|
|
12215
|
-
getPopupContainer: function() {
|
|
11761
|
+
getPopupContainer: function getPopupContainer() {
|
|
12216
11762
|
return theme.contentControl.$video;
|
|
12217
11763
|
}
|
|
12218
11764
|
}));
|
|
@@ -12242,7 +11788,7 @@
|
|
|
12242
11788
|
}
|
|
12243
11789
|
if (filterThemeData.header) {
|
|
12244
11790
|
theme._header = new Header$1({
|
|
12245
|
-
getPopupContainer: function() {
|
|
11791
|
+
getPopupContainer: function getPopupContainer() {
|
|
12246
11792
|
return theme.$container;
|
|
12247
11793
|
},
|
|
12248
11794
|
color: filterThemeData.header.color,
|
|
@@ -12257,7 +11803,7 @@
|
|
|
12257
11803
|
if (filterThemeData.footer) {
|
|
12258
11804
|
// prettier-ignore
|
|
12259
11805
|
theme._footer = new Footer$1({
|
|
12260
|
-
getPopupContainer: function() {
|
|
11806
|
+
getPopupContainer: function getPopupContainer() {
|
|
12261
11807
|
return theme.$container;
|
|
12262
11808
|
},
|
|
12263
11809
|
color: filterThemeData.footer.color,
|
|
@@ -12303,14 +11849,14 @@
|
|
|
12303
11849
|
_renderControls(theme, theme._footer.$left, leftBtns1, props);
|
|
12304
11850
|
_renderControls(theme, theme._footer.$right, rightBtns1, props);
|
|
12305
11851
|
}
|
|
12306
|
-
list = [].concat(((_filterThemeData_header = filterThemeData.header) == null ? void 0 : _filterThemeData_header.btnList) || [], (
|
|
11852
|
+
list = [].concat(((_filterThemeData_header = filterThemeData.header) == null ? void 0 : _filterThemeData_header.btnList) || [], (_ref = (_filterThemeData_footer = filterThemeData.footer) == null ? void 0 : _filterThemeData_footer.btnList) != null ? _ref : []);
|
|
12307
11853
|
// FIXME: 这个逻辑实际上是有问题的
|
|
12308
11854
|
_needTimeLine = list.some(function(item) {
|
|
12309
11855
|
return REC_GROUP.includes(item.iconId) || item.iconId === 'recDropdown';
|
|
12310
11856
|
}) && ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.type) === 'rec';
|
|
12311
11857
|
_hasPlaybackRange = !!((_theme_playbackRange = theme.playbackRange) == null ? void 0 : _theme_playbackRange.begin) && !!((_theme_playbackRange1 = theme.playbackRange) == null ? void 0 : _theme_playbackRange1.end);
|
|
12312
11858
|
_needDatePicker = theme.options.dateOptions !== null;
|
|
12313
|
-
theme.$container.classList.remove("" + PREFIX_CLASS + "-has-time-line");
|
|
11859
|
+
theme.$container.classList.remove("" + PREFIX_CLASS$1 + "-has-time-line");
|
|
12314
11860
|
// PC 单独渲染timeLine
|
|
12315
11861
|
if (!Utils.isMobile && !(theme.options.timeLineOptions === null || theme.options.disabledTimeLine) && _needTimeLine) {
|
|
12316
11862
|
theme._recFooter = new RecFooter(theme.$container, {
|
|
@@ -12328,7 +11874,7 @@
|
|
|
12328
11874
|
_renderTimeLine(theme, theme._recFooter.$timeLineContainer, props);
|
|
12329
11875
|
if (theme._footer) {
|
|
12330
11876
|
theme._footer.$container.style.cssText += "bottom: 36px;";
|
|
12331
|
-
theme.$container.classList.add("" + PREFIX_CLASS + "-has-time-line");
|
|
11877
|
+
theme.$container.classList.add("" + PREFIX_CLASS$1 + "-has-time-line");
|
|
12332
11878
|
}
|
|
12333
11879
|
}
|
|
12334
11880
|
// 移动端扩展
|
|
@@ -12350,7 +11896,7 @@
|
|
|
12350
11896
|
}
|
|
12351
11897
|
// 回放类型切换正常渲染,用户点击后由 SDK 层在 recDropdownChange 事件中自行处理
|
|
12352
11898
|
if (theme.options.recOptions !== null && ((_theme_options_mobileExtendOptions4 = theme.options.mobileExtendOptions) == null ? void 0 : _theme_options_mobileExtendOptions4.controls.includes('rec')) && _needTimeLine) {
|
|
12353
|
-
[].concat(((_filterThemeData_header1 = filterThemeData.header) == null ? void 0 : _filterThemeData_header1.btnList) || [], (
|
|
11899
|
+
[].concat(((_filterThemeData_header1 = filterThemeData.header) == null ? void 0 : _filterThemeData_header1.btnList) || [], (_ref1 = (_filterThemeData_footer1 = filterThemeData.footer) == null ? void 0 : _filterThemeData_footer1.btnList) != null ? _ref1 : []).forEach(function(item) {
|
|
12354
11900
|
var _theme__mobileExtend;
|
|
12355
11901
|
if (REC_GROUP.includes(item.iconId)) _renderRecType(theme, (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight, item.iconId, props);
|
|
12356
11902
|
});
|
|
@@ -12360,7 +11906,7 @@
|
|
|
12360
11906
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12361
11907
|
theme.controls['alarmMessageControl'] = new Controls['alarmMessage'](_extends$1({
|
|
12362
11908
|
rootContainer: theme.$container,
|
|
12363
|
-
getPopupContainer: function() {
|
|
11909
|
+
getPopupContainer: function getPopupContainer() {
|
|
12364
11910
|
var _theme__mobileExtend;
|
|
12365
11911
|
return (_theme__mobileExtend = theme._mobileExtend) == null ? void 0 : _theme__mobileExtend.$topRight;
|
|
12366
11912
|
},
|
|
@@ -12394,33 +11940,33 @@
|
|
|
12394
11940
|
});
|
|
12395
11941
|
})();
|
|
12396
11942
|
}
|
|
12397
|
-
var _renderTimeLine = function(theme, container, props) {
|
|
11943
|
+
var _renderTimeLine = function _renderTimeLine(theme, container, props) {
|
|
12398
11944
|
if (props === void 0) props = {};
|
|
12399
11945
|
if (!theme.controls.timeLineControl && theme.options.timeLineOptions !== null) {
|
|
11946
|
+
var _ref;
|
|
12400
11947
|
var _theme_urlInfo, _theme_urlInfo1, _theme_options, _theme_options1, _this, _theme_options2;
|
|
12401
|
-
var _showSectionIcon;
|
|
12402
11948
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12403
11949
|
theme.controls.timeLineControl = new Controls['timeLine'](_extends$1({
|
|
12404
|
-
getPopupContainer: function() {
|
|
11950
|
+
getPopupContainer: function getPopupContainer() {
|
|
12405
11951
|
return container;
|
|
12406
11952
|
},
|
|
12407
11953
|
language: theme.options.language,
|
|
12408
11954
|
locales: theme.i18n.translations,
|
|
12409
11955
|
coverQuery: ((_theme_urlInfo = theme.urlInfo) == null ? void 0 : _theme_urlInfo.validateCode) ? "decodekey=" + ((_theme_urlInfo1 = theme.urlInfo) == null ? void 0 : _theme_urlInfo1.validateCode) : ''
|
|
12410
11956
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["timeLineOptions"]) || {}, {
|
|
12411
|
-
showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (
|
|
11957
|
+
showSectionIcon: ((_theme_options1 = theme.options) == null ? void 0 : _theme_options1["recListOptions"]) !== null ? (_ref = (_this = ((_theme_options2 = theme.options) == null ? void 0 : _theme_options2["timeLineOptions"]) || {}) == null ? void 0 : _this.showSectionIcon) != null ? _ref : true : true,
|
|
12412
11958
|
props: props
|
|
12413
11959
|
}));
|
|
12414
11960
|
}
|
|
12415
11961
|
};
|
|
12416
|
-
var _renderSegmentProgress = function(theme, container, props) {
|
|
11962
|
+
var _renderSegmentProgress = function _renderSegmentProgress(theme, container, props) {
|
|
12417
11963
|
if (props === void 0) props = {};
|
|
12418
11964
|
if (!theme.controls.segmentProgressControl && theme.options.segmentProgressOptions !== null) {
|
|
12419
11965
|
var _theme_options;
|
|
12420
11966
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12421
11967
|
theme.controls.segmentProgressControl = new Controls['segmentProgress'](_extends$1({
|
|
12422
11968
|
rootContainer: theme.$container,
|
|
12423
|
-
getPopupContainer: function() {
|
|
11969
|
+
getPopupContainer: function getPopupContainer() {
|
|
12424
11970
|
return container;
|
|
12425
11971
|
},
|
|
12426
11972
|
language: theme.options.language,
|
|
@@ -12430,13 +11976,13 @@
|
|
|
12430
11976
|
}));
|
|
12431
11977
|
}
|
|
12432
11978
|
};
|
|
12433
|
-
var _renderDatePicker = function(theme, container, props) {
|
|
11979
|
+
var _renderDatePicker = function _renderDatePicker(theme, container, props) {
|
|
12434
11980
|
if (props === void 0) props = {};
|
|
12435
11981
|
if (!theme.controls.dateControl && theme.options.dateOptions !== null) {
|
|
12436
11982
|
var _theme_options;
|
|
12437
11983
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12438
11984
|
theme.controls.dateControl = new Controls['date'](_extends$1({
|
|
12439
|
-
getPopupContainer: function() {
|
|
11985
|
+
getPopupContainer: function getPopupContainer() {
|
|
12440
11986
|
return container;
|
|
12441
11987
|
},
|
|
12442
11988
|
language: theme.options.language,
|
|
@@ -12446,13 +11992,13 @@
|
|
|
12446
11992
|
}));
|
|
12447
11993
|
}
|
|
12448
11994
|
};
|
|
12449
|
-
var _renderTimePicker = function(theme, container, props) {
|
|
11995
|
+
var _renderTimePicker = function _renderTimePicker(theme, container, props) {
|
|
12450
11996
|
if (props === void 0) props = {};
|
|
12451
11997
|
if (!theme.controls.timeControl && theme.options.timeOptions !== null) {
|
|
12452
11998
|
var _theme_options;
|
|
12453
11999
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
12454
12000
|
theme.controls.timeControl = new Controls['time'](_extends$1({
|
|
12455
|
-
getPopupContainer: function() {
|
|
12001
|
+
getPopupContainer: function getPopupContainer() {
|
|
12456
12002
|
return container;
|
|
12457
12003
|
},
|
|
12458
12004
|
language: theme.options.language,
|
|
@@ -12462,14 +12008,14 @@
|
|
|
12462
12008
|
}));
|
|
12463
12009
|
}
|
|
12464
12010
|
};
|
|
12465
|
-
var _renderRecType = function(theme, container, recType, props) {
|
|
12011
|
+
var _renderRecType = function _renderRecType(theme, container, recType, props) {
|
|
12466
12012
|
if (props === void 0) props = {};
|
|
12467
12013
|
var _theme_controls, _theme_controls1, _theme_controls2;
|
|
12468
12014
|
if (!((_theme_controls = theme.controls) == null ? void 0 : _theme_controls['recControl']) && theme.options.recOptions !== null && container) {
|
|
12469
12015
|
var _theme_options;
|
|
12470
12016
|
// eslint-disable-next-line @typescript-eslint/dot-notation, new-cap, @typescript-eslint/no-unsafe-argument
|
|
12471
12017
|
theme.controls['recControl'] = new Controls['rec'](_extends$1({
|
|
12472
|
-
getPopupContainer: function() {
|
|
12018
|
+
getPopupContainer: function getPopupContainer() {
|
|
12473
12019
|
return container;
|
|
12474
12020
|
},
|
|
12475
12021
|
recType: theme.recType,
|
|
@@ -12573,7 +12119,7 @@
|
|
|
12573
12119
|
return width - leftWidth - rightWidth > offset;
|
|
12574
12120
|
}
|
|
12575
12121
|
|
|
12576
|
-
|
|
12122
|
+
function _array_like_to_array(arr, len) {
|
|
12577
12123
|
if (len == null || len > arr.length) len = arr.length;
|
|
12578
12124
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
12579
12125
|
return arr2;
|
|
@@ -12586,11 +12132,8 @@
|
|
|
12586
12132
|
reject(error);
|
|
12587
12133
|
return;
|
|
12588
12134
|
}
|
|
12589
|
-
if (info.done)
|
|
12590
|
-
|
|
12591
|
-
} else {
|
|
12592
|
-
Promise.resolve(value).then(_next, _throw);
|
|
12593
|
-
}
|
|
12135
|
+
if (info.done) resolve(value);
|
|
12136
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
12594
12137
|
}
|
|
12595
12138
|
function _async_to_generator(fn) {
|
|
12596
12139
|
return function() {
|
|
@@ -12620,15 +12163,29 @@
|
|
|
12620
12163
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
12621
12164
|
return Constructor;
|
|
12622
12165
|
}
|
|
12166
|
+
function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
12167
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
12168
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
12169
|
+
if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike) {
|
|
12170
|
+
if (it) o = it;
|
|
12171
|
+
var i = 0;
|
|
12172
|
+
return function() {
|
|
12173
|
+
if (i >= o.length) return {
|
|
12174
|
+
done: true
|
|
12175
|
+
};
|
|
12176
|
+
return {
|
|
12177
|
+
done: false,
|
|
12178
|
+
value: o[i++]
|
|
12179
|
+
};
|
|
12180
|
+
};
|
|
12181
|
+
}
|
|
12182
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
12183
|
+
}
|
|
12623
12184
|
function _extends() {
|
|
12624
|
-
_extends = Object.assign || function(target) {
|
|
12185
|
+
_extends = Object.assign || function assign(target) {
|
|
12625
12186
|
for(var i = 1; i < arguments.length; i++){
|
|
12626
12187
|
var source = arguments[i];
|
|
12627
|
-
for(var key in source)
|
|
12628
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12629
|
-
target[key] = source[key];
|
|
12630
|
-
}
|
|
12631
|
-
}
|
|
12188
|
+
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
12632
12189
|
}
|
|
12633
12190
|
return target;
|
|
12634
12191
|
};
|
|
@@ -12654,34 +12211,6 @@
|
|
|
12654
12211
|
};
|
|
12655
12212
|
return _set_prototype_of(o, p);
|
|
12656
12213
|
}
|
|
12657
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
12658
|
-
if (!o) return;
|
|
12659
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
12660
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
12661
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
12662
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
12663
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
12664
|
-
}
|
|
12665
|
-
function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
12666
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
12667
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
12668
|
-
if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike) {
|
|
12669
|
-
if (it) o = it;
|
|
12670
|
-
var i = 0;
|
|
12671
|
-
return function() {
|
|
12672
|
-
if (i >= o.length) {
|
|
12673
|
-
return {
|
|
12674
|
-
done: true
|
|
12675
|
-
};
|
|
12676
|
-
}
|
|
12677
|
-
return {
|
|
12678
|
-
done: false,
|
|
12679
|
-
value: o[i++]
|
|
12680
|
-
};
|
|
12681
|
-
};
|
|
12682
|
-
}
|
|
12683
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
12684
|
-
}
|
|
12685
12214
|
function _ts_generator(thisArg, body) {
|
|
12686
12215
|
var f, y, t, _ = {
|
|
12687
12216
|
label: 0,
|
|
@@ -12691,9 +12220,17 @@
|
|
|
12691
12220
|
},
|
|
12692
12221
|
trys: [],
|
|
12693
12222
|
ops: []
|
|
12694
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12695
|
-
return
|
|
12696
|
-
|
|
12223
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
12224
|
+
return d(g, "next", {
|
|
12225
|
+
value: verb(0)
|
|
12226
|
+
}), d(g, "throw", {
|
|
12227
|
+
value: verb(1)
|
|
12228
|
+
}), d(g, "return", {
|
|
12229
|
+
value: verb(2)
|
|
12230
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
12231
|
+
value: function() {
|
|
12232
|
+
return this;
|
|
12233
|
+
}
|
|
12697
12234
|
}), g;
|
|
12698
12235
|
function verb(n) {
|
|
12699
12236
|
return function(v) {
|
|
@@ -12773,6 +12310,14 @@
|
|
|
12773
12310
|
};
|
|
12774
12311
|
}
|
|
12775
12312
|
}
|
|
12313
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
12314
|
+
if (!o) return;
|
|
12315
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
12316
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
12317
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
12318
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
12319
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
12320
|
+
}
|
|
12776
12321
|
var THEME_DEFAULT_OPTIONS = {
|
|
12777
12322
|
dblClickFullscreen: true,
|
|
12778
12323
|
language: 'zh',
|
|
@@ -12826,6 +12371,7 @@
|
|
|
12826
12371
|
_inherits(Theme, EventEmitter);
|
|
12827
12372
|
function Theme(options) {
|
|
12828
12373
|
var _this;
|
|
12374
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
12829
12375
|
var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_urlInfo_searchParams, _this_urlInfo, _this_options, _this_options1;
|
|
12830
12376
|
_this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
|
|
12831
12377
|
* @since 0.0.1
|
|
@@ -12891,7 +12437,7 @@
|
|
|
12891
12437
|
_this._initClassName();
|
|
12892
12438
|
// 画布需要渲染在 this.contentControl.$content 内
|
|
12893
12439
|
_this.contentControl = new Content({
|
|
12894
|
-
getContainer: function() {
|
|
12440
|
+
getContainer: function getContainer() {
|
|
12895
12441
|
return _this.$container;
|
|
12896
12442
|
},
|
|
12897
12443
|
scaleMode: _this.scaleMode
|
|
@@ -12901,18 +12447,15 @@
|
|
|
12901
12447
|
});
|
|
12902
12448
|
// zoom utils
|
|
12903
12449
|
__zoom(_this, _this.contentControl.$content, _extends({}, _this.options.zoomOptions || {}, {
|
|
12904
|
-
onTap: function() {
|
|
12450
|
+
onTap: function onTap() {
|
|
12905
12451
|
var _this__interactiveResult_setTimeoutShow, _this__interactiveResult;
|
|
12906
12452
|
(_this__interactiveResult = _this._interactiveResult) == null ? void 0 : (_this__interactiveResult_setTimeoutShow = _this__interactiveResult.setTimeoutShow) == null ? void 0 : _this__interactiveResult_setTimeoutShow.call(_this__interactiveResult);
|
|
12907
12453
|
}
|
|
12908
12454
|
}));
|
|
12909
|
-
|
|
12910
|
-
_this.
|
|
12911
|
-
var _this_options_volumeOptions_muted, _ref1;
|
|
12912
|
-
_this._muted = (_ref1 = (_this_options_volumeOptions_muted = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _this_options_volumeOptions_muted : _this.options.muted) != null ? _ref1 : false;
|
|
12913
|
-
var _this_options_speedOptions_value, _ref2;
|
|
12455
|
+
_this._volume = (_ref = (_ref1 = (_this_options_volumeOptions = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions.volume) != null ? _ref1 : _this.options.volume) != null ? _ref : 0.8;
|
|
12456
|
+
_this._muted = (_ref2 = (_ref3 = (_this_options_volumeOptions1 = _this.options.volumeOptions) == null ? void 0 : _this_options_volumeOptions1.muted) != null ? _ref3 : _this.options.muted) != null ? _ref2 : false;
|
|
12914
12457
|
// playbackSpeed 是 萤石标准流倍速字段
|
|
12915
|
-
_this._speed = +((
|
|
12458
|
+
_this._speed = +((_ref4 = (_ref5 = (_this_options_speedOptions = _this.options.speedOptions) == null ? void 0 : _this_options_speedOptions.value) != null ? _ref5 : (_this_urlInfo = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams = _this_urlInfo.searchParams) == null ? void 0 : _this_urlInfo_searchParams.playbackSpeed) != null ? _ref4 : 1);
|
|
12916
12459
|
_this._mobileInnerWidthHeight = _this._mobileInnerWidthHeight.bind(_this);
|
|
12917
12460
|
_this._throttleMobileInnerWidthHeight = throttle(_this._mobileInnerWidthHeight, 20).bind(_this);
|
|
12918
12461
|
_this._onDblClickFullscreen = debounce(_this._onDblClickFullscreen, 20).bind(_this);
|
|
@@ -12940,9 +12483,9 @@
|
|
|
12940
12483
|
// flv / mp4:支持自定义 themeData,未传时回退到标准直播模板 LiveTemplate(2026-01-19 起支持自定义)
|
|
12941
12484
|
initialThemeData = themeData !== undefined ? themeData : LiveTemplate;
|
|
12942
12485
|
} else {
|
|
12943
|
-
var
|
|
12486
|
+
var _ref6;
|
|
12944
12487
|
// 其余类型(如 ezopen 私有流):template 优先级高于 themeData,二者都未设置时为 null
|
|
12945
|
-
initialThemeData = (
|
|
12488
|
+
initialThemeData = (_ref6 = template != null ? template : themeData) != null ? _ref6 : null;
|
|
12946
12489
|
}
|
|
12947
12490
|
_this._renderTheme(initialThemeData);
|
|
12948
12491
|
_this._addEventListener();
|
|
@@ -13093,16 +12636,16 @@
|
|
|
13093
12636
|
var classList = this.$container.classList;
|
|
13094
12637
|
for(var _iterator = _create_for_of_iterator_helper_loose(classList), _step; !(_step = _iterator()).done;){
|
|
13095
12638
|
var item = _step.value;
|
|
13096
|
-
if (item.startsWith("" + PREFIX_CLASS + "-scale-mode-")) {
|
|
12639
|
+
if (item.startsWith("" + PREFIX_CLASS$1 + "-scale-mode-")) {
|
|
13097
12640
|
classList.remove(item);
|
|
13098
12641
|
}
|
|
13099
12642
|
}
|
|
13100
12643
|
if (this.scaleMode === 0) {
|
|
13101
|
-
this.$container.classList.add("" + PREFIX_CLASS + "-scale-mode-full");
|
|
12644
|
+
this.$container.classList.add("" + PREFIX_CLASS$1 + "-scale-mode-full");
|
|
13102
12645
|
} else if (this.scaleMode === 1) {
|
|
13103
|
-
this.$container.classList.add("" + PREFIX_CLASS + "-scale-mode-auto");
|
|
12646
|
+
this.$container.classList.add("" + PREFIX_CLASS$1 + "-scale-mode-auto");
|
|
13104
12647
|
} else if (this.scaleMode === 2) {
|
|
13105
|
-
this.$container.classList.add("" + PREFIX_CLASS + "-scale-mode-full-auto");
|
|
12648
|
+
this.$container.classList.add("" + PREFIX_CLASS$1 + "-scale-mode-full-auto");
|
|
13106
12649
|
}
|
|
13107
12650
|
} else {
|
|
13108
12651
|
var _this_logger;
|
|
@@ -13143,12 +12686,12 @@
|
|
|
13143
12686
|
}
|
|
13144
12687
|
// 清除样式类名
|
|
13145
12688
|
Array.from(((_this_$container = this.$container) == null ? void 0 : _this_$container.classList) || []).forEach(function(className) {
|
|
13146
|
-
var regex = new RegExp("^" + PREFIX_CLASS + "-", 'g');
|
|
12689
|
+
var regex = new RegExp("^" + PREFIX_CLASS$1 + "-", 'g');
|
|
13147
12690
|
if (regex.test(className)) {
|
|
13148
12691
|
_this.$container.classList.remove(className);
|
|
13149
12692
|
}
|
|
13150
12693
|
});
|
|
13151
|
-
this.$container.classList.remove("" + PREFIX_CLASS);
|
|
12694
|
+
this.$container.classList.remove("" + PREFIX_CLASS$1);
|
|
13152
12695
|
this._themeData = null;
|
|
13153
12696
|
if (this.i18n) this.i18n = null;
|
|
13154
12697
|
this.recType = '';
|
|
@@ -13231,20 +12774,20 @@
|
|
|
13231
12774
|
*/ _proto._initClassName = function _initClassName() {
|
|
13232
12775
|
var _this_options, _this_options1;
|
|
13233
12776
|
// prettier-ignore
|
|
13234
|
-
this.$container.classList.add(PREFIX_CLASS, Utils.isMobile ? PREFIX_CLASS + "-mobile" : PREFIX_CLASS + "-pc");
|
|
12777
|
+
this.$container.classList.add(PREFIX_CLASS$1, Utils.isMobile ? PREFIX_CLASS$1 + "-mobile" : PREFIX_CLASS$1 + "-pc");
|
|
13235
12778
|
if ([
|
|
13236
12779
|
'ezopen',
|
|
13237
12780
|
'flv',
|
|
13238
12781
|
'hls',
|
|
13239
12782
|
'mp4'
|
|
13240
12783
|
].includes(this.options.type)) {
|
|
13241
|
-
this.$container.classList.add(PREFIX_CLASS + "-" + this.options.type);
|
|
12784
|
+
this.$container.classList.add(PREFIX_CLASS$1 + "-" + this.options.type);
|
|
13242
12785
|
}
|
|
13243
12786
|
if ([
|
|
13244
12787
|
'en',
|
|
13245
12788
|
'zh'
|
|
13246
12789
|
].includes(this.options.language || 'zh')) {
|
|
13247
|
-
this.$container.classList.add(PREFIX_CLASS + "-lang-" + (this.options.language || 'zh'));
|
|
12790
|
+
this.$container.classList.add(PREFIX_CLASS$1 + "-lang-" + (this.options.language || 'zh'));
|
|
13248
12791
|
}
|
|
13249
12792
|
if (typeof this.options.className === 'string') {
|
|
13250
12793
|
this.$container.classList.add(this.options.className);
|
|
@@ -13281,8 +12824,8 @@
|
|
|
13281
12824
|
// 获取屏幕可视区域, 防止被窗口被覆盖
|
|
13282
12825
|
var height = Math.floor(window.innerHeight);
|
|
13283
12826
|
var width = Math.floor(window.innerWidth);
|
|
13284
|
-
(_this_$container = this.$container) == null ? void 0 : (_this_$container_style = _this_$container.style) == null ? void 0 : _this_$container_style.setProperty("--" + PREFIX_CLASS + "-mobile-inner-height", "" + height + "px");
|
|
13285
|
-
(_this_$container1 = this.$container) == null ? void 0 : (_this_$container_style1 = _this_$container1.style) == null ? void 0 : _this_$container_style1.setProperty("--" + PREFIX_CLASS + "-mobile-inner-width", "" + width + "px");
|
|
12827
|
+
(_this_$container = this.$container) == null ? void 0 : (_this_$container_style = _this_$container.style) == null ? void 0 : _this_$container_style.setProperty("--" + PREFIX_CLASS$1 + "-mobile-inner-height", "" + height + "px");
|
|
12828
|
+
(_this_$container1 = this.$container) == null ? void 0 : (_this_$container_style1 = _this_$container1.style) == null ? void 0 : _this_$container_style1.setProperty("--" + PREFIX_CLASS$1 + "-mobile-inner-width", "" + width + "px");
|
|
13286
12829
|
}
|
|
13287
12830
|
};
|
|
13288
12831
|
/**
|
|
@@ -13291,9 +12834,9 @@
|
|
|
13291
12834
|
var _this = this;
|
|
13292
12835
|
// ------------------------------ 全屏 -----------------------------
|
|
13293
12836
|
this._fullscreen = new Fullscreen$1(this.$container, {
|
|
13294
|
-
prefix: PREFIX_CLASS,
|
|
12837
|
+
prefix: PREFIX_CLASS$1,
|
|
13295
12838
|
// 全屏变化
|
|
13296
|
-
onChange: function(info) {
|
|
12839
|
+
onChange: function onChange(info) {
|
|
13297
12840
|
if (info.isCurrentFullscreen) {
|
|
13298
12841
|
_this.emit(EVENTS$2.fullscreen);
|
|
13299
12842
|
} else if (_this._isCurrentFullscreen) {
|
|
@@ -13311,26 +12854,26 @@
|
|
|
13311
12854
|
}
|
|
13312
12855
|
});
|
|
13313
12856
|
// ------------------------------ 旋转方向 -----------------------------
|
|
13314
|
-
var rotateOrientation = function(orientation) {
|
|
12857
|
+
var rotateOrientation = function rotateOrientation(orientation) {
|
|
13315
12858
|
if (_this.$container) {
|
|
13316
12859
|
var // 重置移除旋转角度
|
|
13317
12860
|
_this_$container_classList;
|
|
13318
|
-
(_this_$container_classList = _this.$container.classList) == null ? void 0 : _this_$container_classList.remove("" + PREFIX_CLASS + "-angle-0", "" + PREFIX_CLASS + "-angle-90", "" + PREFIX_CLASS + "-angle-180", "" + PREFIX_CLASS + "-angle-270");
|
|
12861
|
+
(_this_$container_classList = _this.$container.classList) == null ? void 0 : _this_$container_classList.remove("" + PREFIX_CLASS$1 + "-angle-0", "" + PREFIX_CLASS$1 + "-angle-90", "" + PREFIX_CLASS$1 + "-angle-180", "" + PREFIX_CLASS$1 + "-angle-270");
|
|
13319
12862
|
// 屏幕旋转并是全屏的状态下
|
|
13320
12863
|
// orientation.angle = 0 或 orientation.angle = 180 播放窗口旋转 90 度, 全屏充满
|
|
13321
12864
|
// orientation.angle = 90 或 orientation.angle = 270 播放窗口旋转 0 度, 全屏充满
|
|
13322
12865
|
switch(orientation.angle){
|
|
13323
12866
|
case 0:
|
|
13324
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-angle-0");
|
|
12867
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-angle-0");
|
|
13325
12868
|
break;
|
|
13326
12869
|
case 90:
|
|
13327
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-angle-90");
|
|
12870
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-angle-90");
|
|
13328
12871
|
break;
|
|
13329
12872
|
case 180:
|
|
13330
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-angle-180");
|
|
12873
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-angle-180");
|
|
13331
12874
|
break;
|
|
13332
12875
|
case 270:
|
|
13333
|
-
_this.$container.classList.add("" + PREFIX_CLASS + "-angle-270");
|
|
12876
|
+
_this.$container.classList.add("" + PREFIX_CLASS$1 + "-angle-270");
|
|
13334
12877
|
break;
|
|
13335
12878
|
}
|
|
13336
12879
|
if (_this.orientationAngle !== orientation.angle) {
|
|
@@ -13362,7 +12905,7 @@
|
|
|
13362
12905
|
var width = Math.floor(_this.$container.clientWidth);
|
|
13363
12906
|
var height = Math.floor(_this.$container.clientHeight);
|
|
13364
12907
|
// 响应式档位类名(纯逻辑见 ./Theme/overflow computeSizeClasses)
|
|
13365
|
-
var sizeClasses = computeSizeClasses(width, height, PREFIX_CLASS);
|
|
12908
|
+
var sizeClasses = computeSizeClasses(width, height, PREFIX_CLASS$1);
|
|
13366
12909
|
sizeClasses.add.forEach(function(c) {
|
|
13367
12910
|
return _this.$container.classList.add(c);
|
|
13368
12911
|
});
|
|
@@ -13383,14 +12926,14 @@
|
|
|
13383
12926
|
_this._height = height;
|
|
13384
12927
|
if ((_this_controls = _this.controls) == null ? void 0 : _this_controls.timeLineControl) {
|
|
13385
12928
|
var _this_$container_querySelector;
|
|
13386
|
-
var rcFooterRightWidth = ((_this_$container_querySelector = _this.$container.querySelector("." + PREFIX_CLASS + "-rec-footer-right")) == null ? void 0 : _this_$container_querySelector.clientWidth) || 0;
|
|
12929
|
+
var rcFooterRightWidth = ((_this_$container_querySelector = _this.$container.querySelector("." + PREFIX_CLASS$1 + "-rec-footer-right")) == null ? void 0 : _this_$container_querySelector.clientWidth) || 0;
|
|
13387
12930
|
_this.controls.timeLineControl.setWidth(width - rcFooterRightWidth);
|
|
13388
12931
|
}
|
|
13389
12932
|
// header 和 footer 使用防抖去实现, 避免频繁触发,
|
|
13390
12933
|
_this._headerMoreControlShow();
|
|
13391
12934
|
_this._footerMoreControlShow();
|
|
13392
12935
|
}
|
|
13393
|
-
(_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS + "-overflow-hidden");
|
|
12936
|
+
(_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.add("" + PREFIX_CLASS$1 + "-overflow-hidden");
|
|
13394
12937
|
if (_this._resizeOverflowTimer) {
|
|
13395
12938
|
clearTimeout(_this._resizeOverflowTimer);
|
|
13396
12939
|
_this._resizeOverflowTimer = null;
|
|
@@ -13402,7 +12945,7 @@
|
|
|
13402
12945
|
clearTimeout(_this._resizeOverflowTimer);
|
|
13403
12946
|
_this._resizeOverflowTimer = null;
|
|
13404
12947
|
}
|
|
13405
|
-
(_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.remove("" + PREFIX_CLASS + "-overflow-hidden");
|
|
12948
|
+
(_this_$container = _this.$container) == null ? void 0 : _this_$container.classList.remove("" + PREFIX_CLASS$1 + "-overflow-hidden");
|
|
13406
12949
|
}, 200);
|
|
13407
12950
|
}, 20));
|
|
13408
12951
|
// dblClickFullscreen
|
|
@@ -13434,7 +12977,7 @@
|
|
|
13434
12977
|
language: this.options.language,
|
|
13435
12978
|
locales: this.i18n.translations,
|
|
13436
12979
|
rootContainer: this.$container,
|
|
13437
|
-
getPopupContainer: function() {
|
|
12980
|
+
getPopupContainer: function getPopupContainer() {
|
|
13438
12981
|
var _this__header;
|
|
13439
12982
|
return (_this__header = _this._header) == null ? void 0 : _this__header.$right;
|
|
13440
12983
|
},
|
|
@@ -13445,8 +12988,8 @@
|
|
|
13445
12988
|
0,
|
|
13446
12989
|
8
|
|
13447
12990
|
],
|
|
13448
|
-
wrapClassName: "" + PREFIX_CLASS + "-header-more",
|
|
13449
|
-
onOpenChange: function(open) {
|
|
12991
|
+
wrapClassName: "" + PREFIX_CLASS$1 + "-header-more",
|
|
12992
|
+
onOpenChange: function onOpenChange(open) {
|
|
13450
12993
|
_this.emit(EVENTS$2.control.headerMorePanelOpenChange, open);
|
|
13451
12994
|
}
|
|
13452
12995
|
});
|
|
@@ -13489,7 +13032,7 @@
|
|
|
13489
13032
|
language: this.options.language,
|
|
13490
13033
|
locales: this.i18n.translations,
|
|
13491
13034
|
rootContainer: this.$container,
|
|
13492
|
-
getPopupContainer: function() {
|
|
13035
|
+
getPopupContainer: function getPopupContainer() {
|
|
13493
13036
|
var _this__footer;
|
|
13494
13037
|
return (_this__footer = _this._footer) == null ? void 0 : _this__footer.$right;
|
|
13495
13038
|
},
|
|
@@ -13500,8 +13043,8 @@
|
|
|
13500
13043
|
0,
|
|
13501
13044
|
-8
|
|
13502
13045
|
],
|
|
13503
|
-
wrapClassName: "" + PREFIX_CLASS + "-footer-more",
|
|
13504
|
-
onOpenChange: function(open) {
|
|
13046
|
+
wrapClassName: "" + PREFIX_CLASS$1 + "-footer-more",
|
|
13047
|
+
onOpenChange: function onOpenChange(open) {
|
|
13505
13048
|
_this.emit(EVENTS$2.control.footerMorePanelOpenChange, open);
|
|
13506
13049
|
}
|
|
13507
13050
|
});
|
|
@@ -14020,6 +13563,7 @@
|
|
|
14020
13563
|
* theme.on(Theme.EVENTS.zoomChange, (zoom: number) => {})
|
|
14021
13564
|
* ```
|
|
14022
13565
|
*/ function set(zoom) {
|
|
13566
|
+
var _ref;
|
|
14023
13567
|
var _this_options_zoomOptions;
|
|
14024
13568
|
if (!this._zooming) {
|
|
14025
13569
|
var _this_messageControl_info, _this_messageControl, _this_logger;
|
|
@@ -14028,8 +13572,7 @@
|
|
|
14028
13572
|
return;
|
|
14029
13573
|
}
|
|
14030
13574
|
zoom = +zoom.toFixed(1);
|
|
14031
|
-
var
|
|
14032
|
-
var ZOOM_MAX = (_this_options_zoomOptions_max = (_this_options_zoomOptions = this.options.zoomOptions) == null ? void 0 : _this_options_zoomOptions.max) != null ? _this_options_zoomOptions_max : ZOOM_DEFAULT_OPTIONS.max;
|
|
13575
|
+
var ZOOM_MAX = (_ref = (_this_options_zoomOptions = this.options.zoomOptions) == null ? void 0 : _this_options_zoomOptions.max) != null ? _ref : ZOOM_DEFAULT_OPTIONS.max;
|
|
14033
13576
|
if (zoom > ZOOM_MAX) {
|
|
14034
13577
|
var _this_messageControl_info1, _this_messageControl1, _this_logger1;
|
|
14035
13578
|
(_this_messageControl1 = this.messageControl) == null ? void 0 : (_this_messageControl_info1 = _this_messageControl1.info) == null ? void 0 : _this_messageControl_info1.call(_this_messageControl1, this.i18n.t('ZOOM_LIMIT_MAX', {
|
|
@@ -14226,14 +13769,14 @@
|
|
|
14226
13769
|
}
|
|
14227
13770
|
]);
|
|
14228
13771
|
return Theme;
|
|
14229
|
-
}(EventEmitter
|
|
13772
|
+
}(EventEmitter);
|
|
14230
13773
|
/** 所有私有流的模板 @since 0.0.1 */ Theme.TEMPLATES = TEMPLATES;
|
|
14231
13774
|
/** 事件名称 @since 0.0.1 */ Theme.EVENTS = EVENTS$2;
|
|
14232
13775
|
/** 语言包 @since 0.0.1 */ Theme.LOCALES = {
|
|
14233
13776
|
zh: zh,
|
|
14234
13777
|
en: en
|
|
14235
13778
|
};
|
|
14236
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.4-beta.
|
|
13779
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '3.1.4-beta.2';
|
|
14237
13780
|
|
|
14238
13781
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
14239
13782
|
|