@ezuikit/player-theme 2.1.0-beta.9 → 2.1.1-beta.1
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/README.md +1 -40
- package/dist/constant.js +8 -2
- package/dist/index.js +1062 -508
- package/dist/index.mjs +1062 -508
- package/dist/index.umd.js +1143 -553
- package/dist/style.css +3 -1
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +59 -20
- package/package.json +2 -11
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.1.
|
|
3
|
-
* Copyright (c) 2026-
|
|
2
|
+
* @ezuikit/player-theme v2.1.1-beta.1
|
|
3
|
+
* Copyright (c) 2026-02-05 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -488,6 +488,8 @@
|
|
|
488
488
|
/** 控件开始录制 */ recordingChange: 'recordingChange',
|
|
489
489
|
/** 对讲状态变化 */ talkingChange: 'talkingChange',
|
|
490
490
|
/** 麦克风音量变化 */ talkVolumeChange: 'talkVolumeChange',
|
|
491
|
+
/** 语音广播状态变化 */ broadcastChange: 'broadcastChange',
|
|
492
|
+
/** AI对话框状态变化 */ aichatChange: 'aichatChange',
|
|
491
493
|
/** 动态切换日志配置 */ setLoggerOptions: 'setLoggerOptions',
|
|
492
494
|
records: 'records',
|
|
493
495
|
ptzSpeedChange: 'ptzSpeedChange',
|
|
@@ -531,6 +533,10 @@
|
|
|
531
533
|
/** 开始对讲 */ talkingChange: 'Control.talkingChange',
|
|
532
534
|
/** 对讲错误, 一般是麦克风权限被拒绝 */ talkError: 'Control.talkError',
|
|
533
535
|
/** 对讲控件销毁 */ talkDestroy: 'Control.talkDestroy',
|
|
536
|
+
/** 语音广播状态变化 */ broadcastChange: 'Control.broadcastChange',
|
|
537
|
+
/** 语音广播控件销毁 */ broadcastDestroy: 'Control.broadcastDestroy',
|
|
538
|
+
/** AI对话框状态变化 */ aichatChange: 'Control.aichatChange',
|
|
539
|
+
/** AI对话框控件销毁 */ aichatDestroy: 'Control.aichatDestroy',
|
|
534
540
|
/** 缩放比例改变 */ zoomChange: 'Control.zoomChange',
|
|
535
541
|
/** 音量调节面板 展示隐藏变换 */ zoomPanelOpenChange: 'Control.zoomPanelOpenChange',
|
|
536
542
|
/** 缩放控件销毁 */ zoomDestroy: 'Control.zoomDestroy',
|
|
@@ -582,7 +588,7 @@
|
|
|
582
588
|
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
583
589
|
return Constructor;
|
|
584
590
|
}
|
|
585
|
-
function _inherits$
|
|
591
|
+
function _inherits$t(subClass, superClass) {
|
|
586
592
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
587
593
|
throw new TypeError("Super expression must either be null or a function");
|
|
588
594
|
}
|
|
@@ -593,14 +599,14 @@
|
|
|
593
599
|
configurable: true
|
|
594
600
|
}
|
|
595
601
|
});
|
|
596
|
-
if (superClass) _set_prototype_of$
|
|
602
|
+
if (superClass) _set_prototype_of$t(subClass, superClass);
|
|
597
603
|
}
|
|
598
|
-
function _set_prototype_of$
|
|
599
|
-
_set_prototype_of$
|
|
604
|
+
function _set_prototype_of$t(o, p) {
|
|
605
|
+
_set_prototype_of$t = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
600
606
|
o.__proto__ = p;
|
|
601
607
|
return o;
|
|
602
608
|
};
|
|
603
|
-
return _set_prototype_of$
|
|
609
|
+
return _set_prototype_of$t(o, p);
|
|
604
610
|
}
|
|
605
611
|
/**
|
|
606
612
|
* 控件基类
|
|
@@ -614,7 +620,7 @@
|
|
|
614
620
|
* const myControl = new MyControl({})
|
|
615
621
|
* ```
|
|
616
622
|
*/ var Control = /*#__PURE__*/ function(EventEmitter) {
|
|
617
|
-
_inherits$
|
|
623
|
+
_inherits$t(Control, EventEmitter);
|
|
618
624
|
function Control(options) {
|
|
619
625
|
var _this;
|
|
620
626
|
var _this___options;
|
|
@@ -789,8 +795,8 @@
|
|
|
789
795
|
return Control;
|
|
790
796
|
}(EventEmitter);
|
|
791
797
|
|
|
792
|
-
function _extends$
|
|
793
|
-
_extends$
|
|
798
|
+
function _extends$s() {
|
|
799
|
+
_extends$s = Object.assign || function(target) {
|
|
794
800
|
for(var i = 1; i < arguments.length; i++){
|
|
795
801
|
var source = arguments[i];
|
|
796
802
|
for(var key in source){
|
|
@@ -801,9 +807,9 @@
|
|
|
801
807
|
}
|
|
802
808
|
return target;
|
|
803
809
|
};
|
|
804
|
-
return _extends$
|
|
810
|
+
return _extends$s.apply(this, arguments);
|
|
805
811
|
}
|
|
806
|
-
function _inherits$
|
|
812
|
+
function _inherits$s(subClass, superClass) {
|
|
807
813
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
808
814
|
throw new TypeError("Super expression must either be null or a function");
|
|
809
815
|
}
|
|
@@ -814,25 +820,25 @@
|
|
|
814
820
|
configurable: true
|
|
815
821
|
}
|
|
816
822
|
});
|
|
817
|
-
if (superClass) _set_prototype_of$
|
|
823
|
+
if (superClass) _set_prototype_of$s(subClass, superClass);
|
|
818
824
|
}
|
|
819
|
-
function _set_prototype_of$
|
|
820
|
-
_set_prototype_of$
|
|
825
|
+
function _set_prototype_of$s(o, p) {
|
|
826
|
+
_set_prototype_of$s = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
821
827
|
o.__proto__ = p;
|
|
822
828
|
return o;
|
|
823
829
|
};
|
|
824
|
-
return _set_prototype_of$
|
|
830
|
+
return _set_prototype_of$s(o, p);
|
|
825
831
|
}
|
|
826
832
|
var LOADING_DEFAULT_OPTIONS = {};
|
|
827
833
|
/**
|
|
828
834
|
* 加载动画控件
|
|
829
835
|
* @category Control
|
|
830
836
|
*/ var Loading = /*#__PURE__*/ function(Control) {
|
|
831
|
-
_inherits$
|
|
837
|
+
_inherits$s(Loading, Control);
|
|
832
838
|
function Loading(options) {
|
|
833
839
|
if (options === void 0) options = {};
|
|
834
840
|
var _this;
|
|
835
|
-
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$
|
|
841
|
+
_this = Control.call(this, Object.assign({}, LOADING_DEFAULT_OPTIONS, _extends$s({}, options, {
|
|
836
842
|
tagName: 'div',
|
|
837
843
|
controlType: 'block',
|
|
838
844
|
classNameSuffix: 'loading'
|
|
@@ -870,8 +876,8 @@
|
|
|
870
876
|
return Loading;
|
|
871
877
|
}(Control);
|
|
872
878
|
|
|
873
|
-
function _extends$
|
|
874
|
-
_extends$
|
|
879
|
+
function _extends$r() {
|
|
880
|
+
_extends$r = Object.assign || function(target) {
|
|
875
881
|
for(var i = 1; i < arguments.length; i++){
|
|
876
882
|
var source = arguments[i];
|
|
877
883
|
for(var key in source){
|
|
@@ -882,9 +888,9 @@
|
|
|
882
888
|
}
|
|
883
889
|
return target;
|
|
884
890
|
};
|
|
885
|
-
return _extends$
|
|
891
|
+
return _extends$r.apply(this, arguments);
|
|
886
892
|
}
|
|
887
|
-
function _inherits$
|
|
893
|
+
function _inherits$r(subClass, superClass) {
|
|
888
894
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
889
895
|
throw new TypeError("Super expression must either be null or a function");
|
|
890
896
|
}
|
|
@@ -895,14 +901,14 @@
|
|
|
895
901
|
configurable: true
|
|
896
902
|
}
|
|
897
903
|
});
|
|
898
|
-
if (superClass) _set_prototype_of$
|
|
904
|
+
if (superClass) _set_prototype_of$r(subClass, superClass);
|
|
899
905
|
}
|
|
900
|
-
function _set_prototype_of$
|
|
901
|
-
_set_prototype_of$
|
|
906
|
+
function _set_prototype_of$r(o, p) {
|
|
907
|
+
_set_prototype_of$r = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
902
908
|
o.__proto__ = p;
|
|
903
909
|
return o;
|
|
904
910
|
};
|
|
905
|
-
return _set_prototype_of$
|
|
911
|
+
return _set_prototype_of$r(o, p);
|
|
906
912
|
}
|
|
907
913
|
// 不放在服务器上 是因为有可能http加载失败
|
|
908
914
|
// prettier-ignore
|
|
@@ -914,11 +920,11 @@
|
|
|
914
920
|
* 封面控件
|
|
915
921
|
* @category Control
|
|
916
922
|
*/ var Poster = /*#__PURE__*/ function(Control) {
|
|
917
|
-
_inherits$
|
|
923
|
+
_inherits$r(Poster, Control);
|
|
918
924
|
function Poster(options) {
|
|
919
925
|
if (options === void 0) options = {};
|
|
920
926
|
var _this;
|
|
921
|
-
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$
|
|
927
|
+
_this = Control.call(this, Object.assign({}, POSTER_OPTIONS, _extends$r({}, options, {
|
|
922
928
|
tagName: 'div',
|
|
923
929
|
controlType: 'block',
|
|
924
930
|
classNameSuffix: 'poster'
|
|
@@ -1013,6 +1019,8 @@
|
|
|
1013
1019
|
talkGrowth: function(prefix) {
|
|
1014
1020
|
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>';
|
|
1015
1021
|
},
|
|
1022
|
+
/** 语音广播 */ 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>',
|
|
1023
|
+
/** AI对话 */ aiChat: '\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n <defs>\n <linearGradient id="gradient0" x1="10.667" x2="10.667" y1="0.667" y2="20.667">\n <stop stop-color="#33D9FF" offset="0.354"/>\n <stop stop-color="#CE77FF" offset="1"/>\n </linearGradient>\n <linearGradient id="gradient1" x1="8.318" x2="8.318" y1="0" y2="18.001">\n <stop stop-color="#33D9FF" offset="0.354"/>\n <stop stop-color="#CE77FF" offset="1"/>\n </linearGradient>\n </defs>\n \n <g transform="scale(1.2) translate(-3, -0.5)">\n <path d="M6.917 0C8.776 0 10.52 0.738 11.808 2.026C12.45 2.668 12.961 3.43 13.309 4.269C13.442 4.588 13.29 4.954 12.971 5.086C12.653 5.218 12.287 5.067 12.155 4.748C11.87 4.061 11.451 3.436 10.925 2.91C9.868 1.854 8.441 1.25 6.917 1.25C3.787 1.25 1.25 3.787 1.25 6.917C1.25 10.047 3.787 12.584 6.917 12.584C8.441 12.584 9.868 11.981 10.925 10.925C11.169 10.681 11.564 10.681 11.808 10.925C12.052 11.169 12.052 11.565 11.808 11.809C10.666 12.951 9.164 13.661 7.542 13.807L7.542 17.376C7.542 17.721 7.262 18.001 6.917 18.001C6.572 18.001 6.292 17.721 6.292 17.376L6.292 13.807C2.765 13.49 0 10.527 0 6.917C0 3.097 3.097 0 6.917 0ZM11.051 6.495C11.295 6.739 11.295 7.135 11.051 7.379L7.547 10.882C7.303 11.126 6.908 11.126 6.664 10.882C6.42 10.638 6.42 10.242 6.664 9.998L10.167 6.495C10.411 6.251 10.807 6.251 11.051 6.495ZM8.566 4.559L6.501 9.5C6.368 9.818 6.002 9.969 5.684 9.836C5.365 9.703 5.215 9.336 5.348 9.018L5.712 8.147L4.094 6.529L3.198 6.884C2.904 7.001 2.575 6.878 2.424 6.61C2.297 6.289 2.418 5.849 2.739 5.722L7.76 3.736C8.274 3.533 8.779 4.049 8.566 4.559ZM16.614 6.171C16.642 6.236 16.642 6.309 16.614 6.373L15.964 7.848C15.936 7.912 15.936 7.986 15.964 8.05L16.614 9.525C16.67 9.651 16.613 9.799 16.486 9.855C16.422 9.883 16.349 9.883 16.285 9.855L14.809 9.205C14.745 9.176 14.672 9.176 14.608 9.205L13.133 9.855C13.006 9.911 12.859 9.853 12.803 9.727C12.775 9.662 12.775 9.589 12.803 9.525L13.453 8.05C13.482 7.986 13.482 7.912 13.453 7.848L12.803 6.373C12.747 6.247 12.805 6.099 12.931 6.043C12.995 6.015 13.068 6.015 13.133 6.043L14.608 6.694C14.672 6.722 14.745 6.722 14.809 6.694L16.285 6.043C16.411 5.988 16.558 6.045 16.614 6.171ZM6.841 5.443L5.361 6.028L6.233 6.9L6.841 5.443Z" fill="url(#gradient1)" transform="matrix(0.707 -0.707 0.707 0.707 0.085 9.868)"/>\n </g>\n </svg>\n ',
|
|
1016
1024
|
/** 相机/截图 */ capturePicture: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="capture-picture">\n <path d="M6.94 7.51C7.34 7.51 7.7 7.28 7.86 6.91L8.43 5.6C8.59 5.23 8.95 5 9.35 5L14.69 5C15.04 5 15.37 5.18 15.55 5.49L16.45 7.02C16.63 7.33 16.96 7.51 17.31 7.51L18.5 7.51C19.6 7.51 20.5 8.41 20.5 9.51L20.5 17C20.5 18.1 19.6 19 18.5 19L5.5 19C4.39 19 3.5 18.1 3.5 17L3.5 9.51C3.5 8.41 4.39 7.51 5.5 7.51L6.94 7.51Z" stroke-width="1.5"/>\n <circle cx="12" cy="12.525146" r="3.068097" stroke-width="1.5"/>\n </svg>',
|
|
1017
1025
|
/** 电子放大 */ zoom: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="zoom">\n <ellipse cx="10.914795" cy="11.25" rx="8.004043" ry="8.25" stroke-width="1.5"/>\n <path d="M14.31 11.04L8.05 11.14" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M11.13 14.22L11.23 7.95" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M16.45 17.83L19.36 20.83" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',
|
|
1018
1026
|
/** 隐私遮蔽 */ privacyMasking: '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="privacy-masking">\n <path d="M12 19C11.15 19 10.31 18.82 9.49 18.5" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M20.88 12.46C18.98 15.96 15.49 19 11.99 19" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M19.07 8.92C19.76 9.72 20.38 10.61 20.88 11.53C21.03 11.82 21.03 12.17 20.88 12.46" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M5 19L19 5" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M9.77 14.22C8.54 12.99 8.54 11 9.77 9.77C11 8.54 12.99 8.54 14.22 9.77" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M17.04 6.95C15.49 5.75 13.74 5 12 5C8.5 5 5.01 8.03 3.11 11.53C2.96 11.82 2.96 12.17 3.11 12.46C4.06 14.21 5.41 15.84 6.95 17.04" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',
|
|
@@ -1097,6 +1105,14 @@
|
|
|
1097
1105
|
if (attr === void 0) attr = {};
|
|
1098
1106
|
return createIcon(Icons.talk, 'talk', attr);
|
|
1099
1107
|
},
|
|
1108
|
+
broadcast: function(attr) {
|
|
1109
|
+
if (attr === void 0) attr = {};
|
|
1110
|
+
return createIcon(Icons.broadcast, 'broadcast', attr);
|
|
1111
|
+
},
|
|
1112
|
+
aiChat: function(attr) {
|
|
1113
|
+
if (attr === void 0) attr = {};
|
|
1114
|
+
return createIcon(Icons.aiChat, 'aiChat', attr);
|
|
1115
|
+
},
|
|
1100
1116
|
talkGrowth: function(attr) {
|
|
1101
1117
|
if (attr === void 0) attr = {};
|
|
1102
1118
|
return createIcon(Icons.talkGrowth(PREFIX_CLASS), 'talk-growth', attr);
|
|
@@ -1175,8 +1191,8 @@
|
|
|
1175
1191
|
}
|
|
1176
1192
|
};
|
|
1177
1193
|
|
|
1178
|
-
function _extends$
|
|
1179
|
-
_extends$
|
|
1194
|
+
function _extends$q() {
|
|
1195
|
+
_extends$q = Object.assign || function(target) {
|
|
1180
1196
|
for(var i = 1; i < arguments.length; i++){
|
|
1181
1197
|
var source = arguments[i];
|
|
1182
1198
|
for(var key in source){
|
|
@@ -1187,9 +1203,9 @@
|
|
|
1187
1203
|
}
|
|
1188
1204
|
return target;
|
|
1189
1205
|
};
|
|
1190
|
-
return _extends$
|
|
1206
|
+
return _extends$q.apply(this, arguments);
|
|
1191
1207
|
}
|
|
1192
|
-
function _inherits$
|
|
1208
|
+
function _inherits$q(subClass, superClass) {
|
|
1193
1209
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1194
1210
|
throw new TypeError("Super expression must either be null or a function");
|
|
1195
1211
|
}
|
|
@@ -1200,25 +1216,25 @@
|
|
|
1200
1216
|
configurable: true
|
|
1201
1217
|
}
|
|
1202
1218
|
});
|
|
1203
|
-
if (superClass) _set_prototype_of$
|
|
1219
|
+
if (superClass) _set_prototype_of$q(subClass, superClass);
|
|
1204
1220
|
}
|
|
1205
|
-
function _set_prototype_of$
|
|
1206
|
-
_set_prototype_of$
|
|
1221
|
+
function _set_prototype_of$q(o, p) {
|
|
1222
|
+
_set_prototype_of$q = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1207
1223
|
o.__proto__ = p;
|
|
1208
1224
|
return o;
|
|
1209
1225
|
};
|
|
1210
|
-
return _set_prototype_of$
|
|
1226
|
+
return _set_prototype_of$q(o, p);
|
|
1211
1227
|
}
|
|
1212
1228
|
var MESSAGE_DEFAULT_OPTIONS = {};
|
|
1213
1229
|
/**
|
|
1214
1230
|
* 消息控件
|
|
1215
1231
|
* @category Control
|
|
1216
1232
|
*/ var Message = /*#__PURE__*/ function(Control) {
|
|
1217
|
-
_inherits$
|
|
1233
|
+
_inherits$q(Message, Control);
|
|
1218
1234
|
function Message(options) {
|
|
1219
1235
|
if (options === void 0) options = {};
|
|
1220
1236
|
var _this;
|
|
1221
|
-
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$
|
|
1237
|
+
_this = Control.call(this, Object.assign({}, MESSAGE_DEFAULT_OPTIONS, _extends$q({}, options, {
|
|
1222
1238
|
tagName: 'div',
|
|
1223
1239
|
controlType: 'block'
|
|
1224
1240
|
}))) || this;
|
|
@@ -1371,8 +1387,8 @@
|
|
|
1371
1387
|
if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
|
|
1372
1388
|
return Constructor;
|
|
1373
1389
|
}
|
|
1374
|
-
function _extends$
|
|
1375
|
-
_extends$
|
|
1390
|
+
function _extends$p() {
|
|
1391
|
+
_extends$p = Object.assign || function(target) {
|
|
1376
1392
|
for(var i = 1; i < arguments.length; i++){
|
|
1377
1393
|
var source = arguments[i];
|
|
1378
1394
|
for(var key in source){
|
|
@@ -1383,9 +1399,9 @@
|
|
|
1383
1399
|
}
|
|
1384
1400
|
return target;
|
|
1385
1401
|
};
|
|
1386
|
-
return _extends$
|
|
1402
|
+
return _extends$p.apply(this, arguments);
|
|
1387
1403
|
}
|
|
1388
|
-
function _inherits$
|
|
1404
|
+
function _inherits$p(subClass, superClass) {
|
|
1389
1405
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
1390
1406
|
throw new TypeError("Super expression must either be null or a function");
|
|
1391
1407
|
}
|
|
@@ -1396,23 +1412,23 @@
|
|
|
1396
1412
|
configurable: true
|
|
1397
1413
|
}
|
|
1398
1414
|
});
|
|
1399
|
-
if (superClass) _set_prototype_of$
|
|
1415
|
+
if (superClass) _set_prototype_of$p(subClass, superClass);
|
|
1400
1416
|
}
|
|
1401
|
-
function _set_prototype_of$
|
|
1402
|
-
_set_prototype_of$
|
|
1417
|
+
function _set_prototype_of$p(o, p) {
|
|
1418
|
+
_set_prototype_of$p = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
1403
1419
|
o.__proto__ = p;
|
|
1404
1420
|
return o;
|
|
1405
1421
|
};
|
|
1406
|
-
return _set_prototype_of$
|
|
1422
|
+
return _set_prototype_of$p(o, p);
|
|
1407
1423
|
}
|
|
1408
1424
|
/**
|
|
1409
1425
|
* 播放/暂停控件
|
|
1410
1426
|
* @category Control
|
|
1411
1427
|
*/ var Play = /*#__PURE__*/ function(Control) {
|
|
1412
|
-
_inherits$
|
|
1428
|
+
_inherits$p(Play, Control);
|
|
1413
1429
|
function Play(options) {
|
|
1414
1430
|
var _this;
|
|
1415
|
-
_this = Control.call(this, _extends$
|
|
1431
|
+
_this = Control.call(this, _extends$p({}, options, {
|
|
1416
1432
|
tagName: 'span',
|
|
1417
1433
|
controlType: 'button',
|
|
1418
1434
|
classNameSuffix: 'play'
|
|
@@ -1473,12 +1489,12 @@
|
|
|
1473
1489
|
* LICENSE file in the root directory of this source tree.
|
|
1474
1490
|
*/
|
|
1475
1491
|
|
|
1476
|
-
var dist$
|
|
1477
|
-
var hasRequiredDist$
|
|
1492
|
+
var dist$a;
|
|
1493
|
+
var hasRequiredDist$a;
|
|
1478
1494
|
|
|
1479
|
-
function requireDist$
|
|
1480
|
-
if (hasRequiredDist$
|
|
1481
|
-
hasRequiredDist$
|
|
1495
|
+
function requireDist$a () {
|
|
1496
|
+
if (hasRequiredDist$a) return dist$a;
|
|
1497
|
+
hasRequiredDist$a = 1;
|
|
1482
1498
|
|
|
1483
1499
|
function _array_like_to_array(arr, len) {
|
|
1484
1500
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -2055,11 +2071,11 @@
|
|
|
2055
2071
|
*/
|
|
2056
2072
|
Picker.VERSION = '1.1.7';
|
|
2057
2073
|
|
|
2058
|
-
dist$
|
|
2059
|
-
return dist$
|
|
2074
|
+
dist$a = Picker;
|
|
2075
|
+
return dist$a;
|
|
2060
2076
|
}
|
|
2061
2077
|
|
|
2062
|
-
var distExports$7 = requireDist$
|
|
2078
|
+
var distExports$7 = requireDist$a();
|
|
2063
2079
|
var Picker = /*@__PURE__*/getDefaultExportFromCjs(distExports$7);
|
|
2064
2080
|
|
|
2065
2081
|
var delegate$2 = {exports: {}};
|
|
@@ -2345,25 +2361,25 @@
|
|
|
2345
2361
|
var cjsExports = requireCjs();
|
|
2346
2362
|
var deepmerge = /*@__PURE__*/getDefaultExportFromCjs(cjsExports);
|
|
2347
2363
|
|
|
2348
|
-
var dist$
|
|
2364
|
+
var dist$9 = {};
|
|
2349
2365
|
|
|
2350
2366
|
/*
|
|
2351
2367
|
* @ezuikit/utils-tools v2.0.2
|
|
2352
2368
|
* tools utils
|
|
2353
|
-
* Copyright (c) 2026-01-
|
|
2369
|
+
* Copyright (c) 2026-01-07 Ezviz-OpenBiz
|
|
2354
2370
|
* Released under the MIT License.
|
|
2355
2371
|
*/
|
|
2356
2372
|
|
|
2357
|
-
var hasRequiredDist$
|
|
2373
|
+
var hasRequiredDist$9;
|
|
2358
2374
|
|
|
2359
|
-
function requireDist$
|
|
2360
|
-
if (hasRequiredDist$
|
|
2361
|
-
hasRequiredDist$
|
|
2362
|
-
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done: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 DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$
|
|
2363
|
-
return dist$
|
|
2375
|
+
function requireDist$9 () {
|
|
2376
|
+
if (hasRequiredDist$9) return dist$9;
|
|
2377
|
+
hasRequiredDist$9 = 1;
|
|
2378
|
+
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done: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 DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$9.DateTime=DateTime,dist$9.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter(function(item){return !/^vc=\d?/.test(item)}).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$9.getQuery=getQuery,dist$9.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$9.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$9.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$9.isRealMobile=function(agent){var _navigator,ua=(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent).toLowerCase();if(/ipad|tablet|playbook|silk|android(?!.*mobile)/i.test(ua))return false;var hasTouch="ontouchstart"in window||navigator.maxTouchPoints>0;return /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua)&&hasTouch},dist$9.parseEzopenUrl=parseEzopenUrl,dist$9.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$9.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
2379
|
+
return dist$9;
|
|
2364
2380
|
}
|
|
2365
2381
|
|
|
2366
|
-
var distExports$6 = requireDist$
|
|
2382
|
+
var distExports$6 = requireDist$9();
|
|
2367
2383
|
|
|
2368
2384
|
/**
|
|
2369
2385
|
* 节流函数
|
|
@@ -2930,8 +2946,8 @@
|
|
|
2930
2946
|
if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
|
|
2931
2947
|
return Constructor;
|
|
2932
2948
|
}
|
|
2933
|
-
function _extends$
|
|
2934
|
-
_extends$
|
|
2949
|
+
function _extends$o() {
|
|
2950
|
+
_extends$o = Object.assign || function(target) {
|
|
2935
2951
|
for(var i = 1; i < arguments.length; i++){
|
|
2936
2952
|
var source = arguments[i];
|
|
2937
2953
|
for(var key in source){
|
|
@@ -2942,9 +2958,9 @@
|
|
|
2942
2958
|
}
|
|
2943
2959
|
return target;
|
|
2944
2960
|
};
|
|
2945
|
-
return _extends$
|
|
2961
|
+
return _extends$o.apply(this, arguments);
|
|
2946
2962
|
}
|
|
2947
|
-
function _inherits$
|
|
2963
|
+
function _inherits$o(subClass, superClass) {
|
|
2948
2964
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
2949
2965
|
throw new TypeError("Super expression must either be null or a function");
|
|
2950
2966
|
}
|
|
@@ -2955,14 +2971,14 @@
|
|
|
2955
2971
|
configurable: true
|
|
2956
2972
|
}
|
|
2957
2973
|
});
|
|
2958
|
-
if (superClass) _set_prototype_of$
|
|
2974
|
+
if (superClass) _set_prototype_of$o(subClass, superClass);
|
|
2959
2975
|
}
|
|
2960
|
-
function _set_prototype_of$
|
|
2961
|
-
_set_prototype_of$
|
|
2976
|
+
function _set_prototype_of$o(o, p) {
|
|
2977
|
+
_set_prototype_of$o = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
2962
2978
|
o.__proto__ = p;
|
|
2963
2979
|
return o;
|
|
2964
2980
|
};
|
|
2965
|
-
return _set_prototype_of$
|
|
2981
|
+
return _set_prototype_of$o(o, p);
|
|
2966
2982
|
}
|
|
2967
2983
|
var VOLUME_DEFAULT_OPTIONS = {
|
|
2968
2984
|
volume: 0.8,
|
|
@@ -2976,12 +2992,12 @@
|
|
|
2976
2992
|
* 音量调节控件
|
|
2977
2993
|
* @category Control
|
|
2978
2994
|
*/ var Volume = /*#__PURE__*/ function(Control) {
|
|
2979
|
-
_inherits$
|
|
2995
|
+
_inherits$o(Volume, Control);
|
|
2980
2996
|
function Volume(options) {
|
|
2981
2997
|
if (options === void 0) options = {};
|
|
2982
2998
|
var _this;
|
|
2983
2999
|
var _this__options_props, _this__options_props1, _this__options_props2, _this__options_props3;
|
|
2984
|
-
_this = Control.call(this, _extends$
|
|
3000
|
+
_this = Control.call(this, _extends$o({}, options, {
|
|
2985
3001
|
tagName: 'span',
|
|
2986
3002
|
classNameSuffix: 'volume',
|
|
2987
3003
|
controlType: 'button'
|
|
@@ -3396,7 +3412,7 @@
|
|
|
3396
3412
|
var screenfullExports = requireScreenfull();
|
|
3397
3413
|
var screenfull = /*@__PURE__*/getDefaultExportFromCjs(screenfullExports);
|
|
3398
3414
|
|
|
3399
|
-
function asyncGeneratorStep$
|
|
3415
|
+
function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3400
3416
|
try {
|
|
3401
3417
|
var info = gen[key](arg);
|
|
3402
3418
|
var value = info.value;
|
|
@@ -3410,22 +3426,22 @@
|
|
|
3410
3426
|
Promise.resolve(value).then(_next, _throw);
|
|
3411
3427
|
}
|
|
3412
3428
|
}
|
|
3413
|
-
function _async_to_generator$
|
|
3429
|
+
function _async_to_generator$7(fn) {
|
|
3414
3430
|
return function() {
|
|
3415
3431
|
var self = this, args = arguments;
|
|
3416
3432
|
return new Promise(function(resolve, reject) {
|
|
3417
3433
|
var gen = fn.apply(self, args);
|
|
3418
3434
|
function _next(value) {
|
|
3419
|
-
asyncGeneratorStep$
|
|
3435
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
|
|
3420
3436
|
}
|
|
3421
3437
|
function _throw(err) {
|
|
3422
|
-
asyncGeneratorStep$
|
|
3438
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3423
3439
|
}
|
|
3424
3440
|
_next(undefined);
|
|
3425
3441
|
});
|
|
3426
3442
|
};
|
|
3427
3443
|
}
|
|
3428
|
-
function _ts_generator$
|
|
3444
|
+
function _ts_generator$7(thisArg, body) {
|
|
3429
3445
|
var f, y, t, _ = {
|
|
3430
3446
|
label: 0,
|
|
3431
3447
|
sent: function() {
|
|
@@ -3639,8 +3655,8 @@
|
|
|
3639
3655
|
* 全屏
|
|
3640
3656
|
* @returns Promise<void>
|
|
3641
3657
|
*/ _proto.fullscreen = function fullscreen() {
|
|
3642
|
-
return _async_to_generator$
|
|
3643
|
-
return _ts_generator$
|
|
3658
|
+
return _async_to_generator$7(function() {
|
|
3659
|
+
return _ts_generator$7(this, function(_state) {
|
|
3644
3660
|
switch(_state.label){
|
|
3645
3661
|
case 0:
|
|
3646
3662
|
if (!Utils.isMobile) return [
|
|
@@ -3675,8 +3691,8 @@
|
|
|
3675
3691
|
* 退出全屏
|
|
3676
3692
|
* @returns Promise<void>
|
|
3677
3693
|
*/ _proto.exitFullscreen = function exitFullscreen() {
|
|
3678
|
-
return _async_to_generator$
|
|
3679
|
-
return _ts_generator$
|
|
3694
|
+
return _async_to_generator$7(function() {
|
|
3695
|
+
return _ts_generator$7(this, function(_state) {
|
|
3680
3696
|
switch(_state.label){
|
|
3681
3697
|
case 0:
|
|
3682
3698
|
if (!Utils.isMobile) return [
|
|
@@ -3715,8 +3731,8 @@
|
|
|
3715
3731
|
* 全屏切换
|
|
3716
3732
|
* @returns Promise<void>
|
|
3717
3733
|
*/ _proto.toggle = function toggle() {
|
|
3718
|
-
return _async_to_generator$
|
|
3719
|
-
return _ts_generator$
|
|
3734
|
+
return _async_to_generator$7(function() {
|
|
3735
|
+
return _ts_generator$7(this, function(_state) {
|
|
3720
3736
|
switch(_state.label){
|
|
3721
3737
|
case 0:
|
|
3722
3738
|
if (!Utils.isMobile) return [
|
|
@@ -3839,8 +3855,8 @@
|
|
|
3839
3855
|
return Fullscreen;
|
|
3840
3856
|
}();
|
|
3841
3857
|
|
|
3842
|
-
function _extends$
|
|
3843
|
-
_extends$
|
|
3858
|
+
function _extends$n() {
|
|
3859
|
+
_extends$n = Object.assign || function(target) {
|
|
3844
3860
|
for(var i = 1; i < arguments.length; i++){
|
|
3845
3861
|
var source = arguments[i];
|
|
3846
3862
|
for(var key in source){
|
|
@@ -3851,9 +3867,9 @@
|
|
|
3851
3867
|
}
|
|
3852
3868
|
return target;
|
|
3853
3869
|
};
|
|
3854
|
-
return _extends$
|
|
3870
|
+
return _extends$n.apply(this, arguments);
|
|
3855
3871
|
}
|
|
3856
|
-
function _inherits$
|
|
3872
|
+
function _inherits$n(subClass, superClass) {
|
|
3857
3873
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3858
3874
|
throw new TypeError("Super expression must either be null or a function");
|
|
3859
3875
|
}
|
|
@@ -3864,24 +3880,24 @@
|
|
|
3864
3880
|
configurable: true
|
|
3865
3881
|
}
|
|
3866
3882
|
});
|
|
3867
|
-
if (superClass) _set_prototype_of$
|
|
3883
|
+
if (superClass) _set_prototype_of$n(subClass, superClass);
|
|
3868
3884
|
}
|
|
3869
|
-
function _set_prototype_of$
|
|
3870
|
-
_set_prototype_of$
|
|
3885
|
+
function _set_prototype_of$n(o, p) {
|
|
3886
|
+
_set_prototype_of$n = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3871
3887
|
o.__proto__ = p;
|
|
3872
3888
|
return o;
|
|
3873
3889
|
};
|
|
3874
|
-
return _set_prototype_of$
|
|
3890
|
+
return _set_prototype_of$n(o, p);
|
|
3875
3891
|
}
|
|
3876
3892
|
/**
|
|
3877
3893
|
* 全屏控件
|
|
3878
3894
|
* @category Control
|
|
3879
3895
|
*/ var Fullscreen = /*#__PURE__*/ function(Control) {
|
|
3880
|
-
_inherits$
|
|
3896
|
+
_inherits$n(Fullscreen, Control);
|
|
3881
3897
|
function Fullscreen(options) {
|
|
3882
3898
|
var _this;
|
|
3883
3899
|
var _options_props, _this_options;
|
|
3884
|
-
_this = Control.call(this, _extends$
|
|
3900
|
+
_this = Control.call(this, _extends$n({
|
|
3885
3901
|
tagName: 'span',
|
|
3886
3902
|
classNameSuffix: 'fullscreen',
|
|
3887
3903
|
controlType: 'button'
|
|
@@ -3946,8 +3962,8 @@
|
|
|
3946
3962
|
return Fullscreen;
|
|
3947
3963
|
}(Control);
|
|
3948
3964
|
|
|
3949
|
-
function _extends$
|
|
3950
|
-
_extends$
|
|
3965
|
+
function _extends$m() {
|
|
3966
|
+
_extends$m = Object.assign || function(target) {
|
|
3951
3967
|
for(var i = 1; i < arguments.length; i++){
|
|
3952
3968
|
var source = arguments[i];
|
|
3953
3969
|
for(var key in source){
|
|
@@ -3958,9 +3974,9 @@
|
|
|
3958
3974
|
}
|
|
3959
3975
|
return target;
|
|
3960
3976
|
};
|
|
3961
|
-
return _extends$
|
|
3977
|
+
return _extends$m.apply(this, arguments);
|
|
3962
3978
|
}
|
|
3963
|
-
function _inherits$
|
|
3979
|
+
function _inherits$m(subClass, superClass) {
|
|
3964
3980
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
3965
3981
|
throw new TypeError("Super expression must either be null or a function");
|
|
3966
3982
|
}
|
|
@@ -3971,24 +3987,24 @@
|
|
|
3971
3987
|
configurable: true
|
|
3972
3988
|
}
|
|
3973
3989
|
});
|
|
3974
|
-
if (superClass) _set_prototype_of$
|
|
3990
|
+
if (superClass) _set_prototype_of$m(subClass, superClass);
|
|
3975
3991
|
}
|
|
3976
|
-
function _set_prototype_of$
|
|
3977
|
-
_set_prototype_of$
|
|
3992
|
+
function _set_prototype_of$m(o, p) {
|
|
3993
|
+
_set_prototype_of$m = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
3978
3994
|
o.__proto__ = p;
|
|
3979
3995
|
return o;
|
|
3980
3996
|
};
|
|
3981
|
-
return _set_prototype_of$
|
|
3997
|
+
return _set_prototype_of$m(o, p);
|
|
3982
3998
|
}
|
|
3983
3999
|
/**
|
|
3984
4000
|
* 回放类型切换(本地回放(sdk 卡), 云存储回放, 云录制回放)控件
|
|
3985
4001
|
* @category Control
|
|
3986
4002
|
*/ var Rec = /*#__PURE__*/ function(Control) {
|
|
3987
|
-
_inherits$
|
|
4003
|
+
_inherits$m(Rec, Control);
|
|
3988
4004
|
function Rec(options) {
|
|
3989
4005
|
var _this;
|
|
3990
4006
|
var _options_props;
|
|
3991
|
-
_this = Control.call(this, _extends$
|
|
4007
|
+
_this = Control.call(this, _extends$m({}, options, {
|
|
3992
4008
|
tagName: 'div',
|
|
3993
4009
|
controlType: 'block',
|
|
3994
4010
|
classNameSuffix: 'rec'
|
|
@@ -4080,13 +4096,13 @@
|
|
|
4080
4096
|
return Rec;
|
|
4081
4097
|
}(Control);
|
|
4082
4098
|
|
|
4083
|
-
var dist$
|
|
4099
|
+
var dist$8 = {exports: {}};
|
|
4084
4100
|
|
|
4085
|
-
var hasRequiredDist$
|
|
4101
|
+
var hasRequiredDist$8;
|
|
4086
4102
|
|
|
4087
|
-
function requireDist$
|
|
4088
|
-
if (hasRequiredDist$
|
|
4089
|
-
hasRequiredDist$
|
|
4103
|
+
function requireDist$8 () {
|
|
4104
|
+
if (hasRequiredDist$8) return dist$8.exports;
|
|
4105
|
+
hasRequiredDist$8 = 1;
|
|
4090
4106
|
|
|
4091
4107
|
var deepmerge = requireCjs();
|
|
4092
4108
|
|
|
@@ -4158,19 +4174,19 @@
|
|
|
4158
4174
|
} ]), I18n;
|
|
4159
4175
|
}();
|
|
4160
4176
|
|
|
4161
|
-
I18n.VERSION = "2.0.0", dist$
|
|
4162
|
-
return dist$
|
|
4177
|
+
I18n.VERSION = "2.0.0", dist$8.exports = I18n;
|
|
4178
|
+
return dist$8.exports;
|
|
4163
4179
|
}
|
|
4164
4180
|
|
|
4165
|
-
var distExports$5 = requireDist$
|
|
4181
|
+
var distExports$5 = requireDist$8();
|
|
4166
4182
|
var I18n = /*@__PURE__*/getDefaultExportFromCjs(distExports$5);
|
|
4167
4183
|
|
|
4168
|
-
var dist$
|
|
4169
|
-
var hasRequiredDist$
|
|
4184
|
+
var dist$7;
|
|
4185
|
+
var hasRequiredDist$7;
|
|
4170
4186
|
|
|
4171
|
-
function requireDist$
|
|
4172
|
-
if (hasRequiredDist$
|
|
4173
|
-
hasRequiredDist$
|
|
4187
|
+
function requireDist$7 () {
|
|
4188
|
+
if (hasRequiredDist$7) return dist$7;
|
|
4189
|
+
hasRequiredDist$7 = 1;
|
|
4174
4190
|
|
|
4175
4191
|
var _$LoggerStyle$_ = {
|
|
4176
4192
|
info: "",
|
|
@@ -4235,7 +4251,7 @@
|
|
|
4235
4251
|
|
|
4236
4252
|
var __$list$__ = [ "info", "log", "warn", "error" ];
|
|
4237
4253
|
|
|
4238
|
-
dist$
|
|
4254
|
+
dist$7 = function(options) {
|
|
4239
4255
|
var logger = new LoggerCls(options);
|
|
4240
4256
|
return new Proxy(logger, {
|
|
4241
4257
|
get: function(target, prop) {
|
|
@@ -4254,10 +4270,10 @@
|
|
|
4254
4270
|
}
|
|
4255
4271
|
});
|
|
4256
4272
|
};
|
|
4257
|
-
return dist$
|
|
4273
|
+
return dist$7;
|
|
4258
4274
|
}
|
|
4259
4275
|
|
|
4260
|
-
var distExports$4 = requireDist$
|
|
4276
|
+
var distExports$4 = requireDist$7();
|
|
4261
4277
|
var Logger = /*@__PURE__*/getDefaultExportFromCjs(distExports$4);
|
|
4262
4278
|
|
|
4263
4279
|
var zh = {
|
|
@@ -4443,6 +4459,8 @@
|
|
|
4443
4459
|
BTN_RECORDVIDEO: '录屏',
|
|
4444
4460
|
BTN_CAPTURE: '截图',
|
|
4445
4461
|
BTN_TALK: '对讲',
|
|
4462
|
+
BTN_BROADCAST: '语音广播',
|
|
4463
|
+
BTN_AICHAT: 'AI对话',
|
|
4446
4464
|
BTN_ZOOM: '电子放大',
|
|
4447
4465
|
BTN_3D_ZOOM: '3D定位',
|
|
4448
4466
|
BTN_PTZ: '云台控制',
|
|
@@ -4713,6 +4731,8 @@
|
|
|
4713
4731
|
BTN_RECORDVIDEO: 'Screen recording',
|
|
4714
4732
|
BTN_CAPTURE: 'Screenshot',
|
|
4715
4733
|
BTN_TALK: 'Intercom',
|
|
4734
|
+
BTN_BROADCAST: 'Voice broadcast',
|
|
4735
|
+
BTN_AICHAT: 'AI Chat',
|
|
4716
4736
|
BTN_ZOOM: 'Electronic zoom',
|
|
4717
4737
|
BTN_3D_ZOOM: '3D positioning',
|
|
4718
4738
|
BTN_PTZ: 'PTZ control',
|
|
@@ -4899,6 +4919,11 @@
|
|
|
4899
4919
|
part: 'left',
|
|
4900
4920
|
isrender: 1
|
|
4901
4921
|
},
|
|
4922
|
+
{
|
|
4923
|
+
iconId: 'broadcast',
|
|
4924
|
+
part: 'left',
|
|
4925
|
+
isrender: 1
|
|
4926
|
+
},
|
|
4902
4927
|
{
|
|
4903
4928
|
iconId: 'zoom',
|
|
4904
4929
|
part: 'left',
|
|
@@ -5002,6 +5027,12 @@
|
|
|
5002
5027
|
defaultActive: 0,
|
|
5003
5028
|
isrender: 1
|
|
5004
5029
|
},
|
|
5030
|
+
{
|
|
5031
|
+
iconId: 'aiChat',
|
|
5032
|
+
part: 'left',
|
|
5033
|
+
defaultActive: 0,
|
|
5034
|
+
isrender: 1
|
|
5035
|
+
},
|
|
5005
5036
|
{
|
|
5006
5037
|
iconId: 'speed',
|
|
5007
5038
|
part: 'right',
|
|
@@ -5085,6 +5116,12 @@
|
|
|
5085
5116
|
defaultActive: 0,
|
|
5086
5117
|
isrender: 1
|
|
5087
5118
|
},
|
|
5119
|
+
{
|
|
5120
|
+
iconId: 'broadcast',
|
|
5121
|
+
part: 'left',
|
|
5122
|
+
defaultActive: 0,
|
|
5123
|
+
isrender: 1
|
|
5124
|
+
},
|
|
5088
5125
|
{
|
|
5089
5126
|
iconId: 'zoom',
|
|
5090
5127
|
part: 'left',
|
|
@@ -5180,6 +5217,12 @@
|
|
|
5180
5217
|
defaultActive: 0,
|
|
5181
5218
|
isrender: 1
|
|
5182
5219
|
},
|
|
5220
|
+
{
|
|
5221
|
+
iconId: 'aiChat',
|
|
5222
|
+
part: 'left',
|
|
5223
|
+
defaultActive: 0,
|
|
5224
|
+
isrender: 1
|
|
5225
|
+
},
|
|
5183
5226
|
{
|
|
5184
5227
|
iconId: 'speed',
|
|
5185
5228
|
part: 'right',
|
|
@@ -5340,7 +5383,7 @@
|
|
|
5340
5383
|
voice: voice
|
|
5341
5384
|
};
|
|
5342
5385
|
|
|
5343
|
-
function _inherits$
|
|
5386
|
+
function _inherits$l(subClass, superClass) {
|
|
5344
5387
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5345
5388
|
throw new TypeError("Super expression must either be null or a function");
|
|
5346
5389
|
}
|
|
@@ -5351,20 +5394,20 @@
|
|
|
5351
5394
|
configurable: true
|
|
5352
5395
|
}
|
|
5353
5396
|
});
|
|
5354
|
-
if (superClass) _set_prototype_of$
|
|
5397
|
+
if (superClass) _set_prototype_of$l(subClass, superClass);
|
|
5355
5398
|
}
|
|
5356
|
-
function _set_prototype_of$
|
|
5357
|
-
_set_prototype_of$
|
|
5399
|
+
function _set_prototype_of$l(o, p) {
|
|
5400
|
+
_set_prototype_of$l = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5358
5401
|
o.__proto__ = p;
|
|
5359
5402
|
return o;
|
|
5360
5403
|
};
|
|
5361
|
-
return _set_prototype_of$
|
|
5404
|
+
return _set_prototype_of$l(o, p);
|
|
5362
5405
|
}
|
|
5363
5406
|
/**
|
|
5364
5407
|
* 截图控件
|
|
5365
5408
|
* @category Content
|
|
5366
5409
|
*/ var Content = /*#__PURE__*/ function(EventEmitter) {
|
|
5367
|
-
_inherits$
|
|
5410
|
+
_inherits$l(Content, EventEmitter);
|
|
5368
5411
|
function Content(options) {
|
|
5369
5412
|
var _this;
|
|
5370
5413
|
_this = EventEmitter.call(this) || this, _this._scaleMode = 0, _this._cleanUpResizeObserver = null, _this._originWidth = 0, _this._originHeight = 0, _this._width = 0, _this._height = 0;
|
|
@@ -5421,7 +5464,7 @@
|
|
|
5421
5464
|
if (this._scaleMode === THEME_SCALE_MODE_TYPE.fullAuto) {
|
|
5422
5465
|
objectFill = 'cover';
|
|
5423
5466
|
}
|
|
5424
|
-
//
|
|
5467
|
+
//
|
|
5425
5468
|
if (width > 0 && height > 0 && this._originWidth > 0 && this._originHeight > 0 && this.$video) {
|
|
5426
5469
|
var left = (width - this._originWidth) / 2;
|
|
5427
5470
|
var top = (height - this._originHeight) / 2;
|
|
@@ -5456,7 +5499,8 @@
|
|
|
5456
5499
|
_proto.destroy = function destroy() {
|
|
5457
5500
|
var _this_$wrapper;
|
|
5458
5501
|
if (this._cleanUpResizeObserver) {
|
|
5459
|
-
this._cleanUpResizeObserver.unobserve
|
|
5502
|
+
this._cleanUpResizeObserver.unobserve();
|
|
5503
|
+
// this._cleanUpResizeObserver.disconnect();
|
|
5460
5504
|
this._cleanUpResizeObserver = null;
|
|
5461
5505
|
}
|
|
5462
5506
|
if (this.$video) {
|
|
@@ -5478,8 +5522,8 @@
|
|
|
5478
5522
|
return Content;
|
|
5479
5523
|
}(EventEmitter);
|
|
5480
5524
|
|
|
5481
|
-
function _extends$
|
|
5482
|
-
_extends$
|
|
5525
|
+
function _extends$l() {
|
|
5526
|
+
_extends$l = Object.assign || function(target) {
|
|
5483
5527
|
for(var i = 1; i < arguments.length; i++){
|
|
5484
5528
|
var source = arguments[i];
|
|
5485
5529
|
for(var key in source){
|
|
@@ -5490,9 +5534,9 @@
|
|
|
5490
5534
|
}
|
|
5491
5535
|
return target;
|
|
5492
5536
|
};
|
|
5493
|
-
return _extends$
|
|
5537
|
+
return _extends$l.apply(this, arguments);
|
|
5494
5538
|
}
|
|
5495
|
-
function _inherits$
|
|
5539
|
+
function _inherits$k(subClass, superClass) {
|
|
5496
5540
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
5497
5541
|
throw new TypeError("Super expression must either be null or a function");
|
|
5498
5542
|
}
|
|
@@ -5503,23 +5547,23 @@
|
|
|
5503
5547
|
configurable: true
|
|
5504
5548
|
}
|
|
5505
5549
|
});
|
|
5506
|
-
if (superClass) _set_prototype_of$
|
|
5550
|
+
if (superClass) _set_prototype_of$k(subClass, superClass);
|
|
5507
5551
|
}
|
|
5508
|
-
function _set_prototype_of$
|
|
5509
|
-
_set_prototype_of$
|
|
5552
|
+
function _set_prototype_of$k(o, p) {
|
|
5553
|
+
_set_prototype_of$k = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5510
5554
|
o.__proto__ = p;
|
|
5511
5555
|
return o;
|
|
5512
5556
|
};
|
|
5513
|
-
return _set_prototype_of$
|
|
5557
|
+
return _set_prototype_of$k(o, p);
|
|
5514
5558
|
}
|
|
5515
5559
|
/**
|
|
5516
5560
|
* 更多控件
|
|
5517
5561
|
* @category Control
|
|
5518
5562
|
*/ var More = /*#__PURE__*/ function(Control) {
|
|
5519
|
-
_inherits$
|
|
5563
|
+
_inherits$k(More, Control);
|
|
5520
5564
|
function More(options) {
|
|
5521
5565
|
var _this;
|
|
5522
|
-
_this = Control.call(this, _extends$
|
|
5566
|
+
_this = Control.call(this, _extends$l({}, options, {
|
|
5523
5567
|
tagName: 'span',
|
|
5524
5568
|
controlType: 'button',
|
|
5525
5569
|
classNameSuffix: 'more'
|
|
@@ -5563,11 +5607,13 @@
|
|
|
5563
5607
|
/**
|
|
5564
5608
|
* 添加
|
|
5565
5609
|
* @param control
|
|
5566
|
-
*/ _proto.add = function add(key, part, control) {
|
|
5610
|
+
*/ _proto.add = function add(key, part, control, props) {
|
|
5567
5611
|
this.list.unshift({
|
|
5568
5612
|
part: part,
|
|
5569
5613
|
key: key,
|
|
5570
|
-
control: control
|
|
5614
|
+
control: control,
|
|
5615
|
+
width: props.width,
|
|
5616
|
+
height: props.height
|
|
5571
5617
|
});
|
|
5572
5618
|
};
|
|
5573
5619
|
/**
|
|
@@ -5713,6 +5759,26 @@
|
|
|
5713
5759
|
(_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls.talkControl) == null ? void 0 : (_theme_controls_talkControl_emit = _theme_controls_talkControl.emit) == null ? void 0 : _theme_controls_talkControl_emit.call(_theme_controls_talkControl, EVENTS.talkVolumeChange, value);
|
|
5714
5760
|
});
|
|
5715
5761
|
// =======================================================
|
|
5762
|
+
// 语音广播
|
|
5763
|
+
// =======================================================
|
|
5764
|
+
theme.on(EVENTS.broadcastChange, function(active) {
|
|
5765
|
+
var _theme_controls, _theme_controls_broadcastControl, _theme_controls1;
|
|
5766
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.broadcastControl) && active !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_broadcastControl = _theme_controls1.broadcastControl) == null ? void 0 : _theme_controls_broadcastControl.active)) {
|
|
5767
|
+
var _theme_controls_broadcastControl1, _theme_controls2;
|
|
5768
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_broadcastControl1 = _theme_controls2.broadcastControl) == null ? void 0 : _theme_controls_broadcastControl1.emit(EVENTS.broadcastChange, active);
|
|
5769
|
+
}
|
|
5770
|
+
});
|
|
5771
|
+
// =======================================================
|
|
5772
|
+
// AI对话框
|
|
5773
|
+
// =======================================================
|
|
5774
|
+
theme.on(EVENTS.aichatChange, function(active) {
|
|
5775
|
+
var _theme_controls, _theme_controls_aiChatControl, _theme_controls1;
|
|
5776
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.aiChatControl) && active !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_aiChatControl = _theme_controls1.aiChatControl) == null ? void 0 : _theme_controls_aiChatControl.active)) {
|
|
5777
|
+
var _theme_controls_aiChatControl1, _theme_controls2;
|
|
5778
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_aiChatControl1 = _theme_controls2.aiChatControl) == null ? void 0 : _theme_controls_aiChatControl1.emit(EVENTS.aichatChange, active);
|
|
5779
|
+
}
|
|
5780
|
+
});
|
|
5781
|
+
// =======================================================
|
|
5716
5782
|
// 录制
|
|
5717
5783
|
// =======================================================
|
|
5718
5784
|
theme.on(EVENTS.recordingChange, function(recording) {
|
|
@@ -5808,7 +5874,7 @@
|
|
|
5808
5874
|
*
|
|
5809
5875
|
* @param theme - Theme
|
|
5810
5876
|
*/ function _controlEventemitter(theme) {
|
|
5811
|
-
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14;
|
|
5877
|
+
var _theme_controls, _theme_controls1, _theme_controls2, _theme_controls3, _theme_controls4, _theme_controls5, _theme_controls6, _theme_controls7, _theme_controls8, _theme_controls9, _theme_controls10, _theme_controls11, _theme_controls12, _theme_controls13, _theme_controls14, _theme_controls15, _theme_controls16;
|
|
5812
5878
|
// Controls
|
|
5813
5879
|
if (theme._recFooter) {
|
|
5814
5880
|
theme._recFooter.on(EVENTS.theme.recFooterDestroy, function() {
|
|
@@ -5901,8 +5967,26 @@
|
|
|
5901
5967
|
theme.emit(EVENTS.control.talkDestroy);
|
|
5902
5968
|
});
|
|
5903
5969
|
}
|
|
5970
|
+
// 语音广播控件
|
|
5971
|
+
if ((_theme_controls5 = theme.controls) == null ? void 0 : _theme_controls5.broadcastControl) {
|
|
5972
|
+
theme.controls.broadcastControl.on(EVENTS.control.broadcastChange, function(active) {
|
|
5973
|
+
theme.emit(EVENTS.control.broadcastChange, active);
|
|
5974
|
+
});
|
|
5975
|
+
theme.controls.broadcastControl.on(EVENTS.control.broadcastDestroy, function() {
|
|
5976
|
+
theme.emit(EVENTS.control.broadcastDestroy);
|
|
5977
|
+
});
|
|
5978
|
+
}
|
|
5979
|
+
// AI对话框
|
|
5980
|
+
if ((_theme_controls6 = theme.controls) == null ? void 0 : _theme_controls6.aiChatControl) {
|
|
5981
|
+
theme.controls.aiChatControl.on(EVENTS.control.aichatChange, function(active) {
|
|
5982
|
+
theme.emit(EVENTS.control.aichatChange, active);
|
|
5983
|
+
});
|
|
5984
|
+
theme.controls.aiChatControl.on(EVENTS.control.aichatDestroy, function() {
|
|
5985
|
+
theme.emit(EVENTS.control.aichatDestroy);
|
|
5986
|
+
});
|
|
5987
|
+
}
|
|
5904
5988
|
// 缩放控件
|
|
5905
|
-
if ((
|
|
5989
|
+
if ((_theme_controls7 = theme.controls) == null ? void 0 : _theme_controls7.zoomControl) {
|
|
5906
5990
|
theme.controls.zoomControl.on(EVENTS.control.zoomChange, function(value, _percent, _range) {
|
|
5907
5991
|
if (theme.zoom !== value) {
|
|
5908
5992
|
theme.zoom = value;
|
|
@@ -5924,7 +6008,7 @@
|
|
|
5924
6008
|
});
|
|
5925
6009
|
}
|
|
5926
6010
|
// 清晰度控件
|
|
5927
|
-
if ((
|
|
6011
|
+
if ((_theme_controls8 = theme.controls) == null ? void 0 : _theme_controls8.definitionControl) {
|
|
5928
6012
|
theme.controls.definitionControl.on(EVENTS.control.definitionPanelOpenChange, function(open, definition, item) {
|
|
5929
6013
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, definition);
|
|
5930
6014
|
theme.emit(EVENTS.control.definitionPanelOpenChange, open, definition, item);
|
|
@@ -5937,7 +6021,7 @@
|
|
|
5937
6021
|
});
|
|
5938
6022
|
}
|
|
5939
6023
|
// 倍速控件
|
|
5940
|
-
if ((
|
|
6024
|
+
if ((_theme_controls9 = theme.controls) == null ? void 0 : _theme_controls9.speedControl) {
|
|
5941
6025
|
theme.controls.speedControl.on(EVENTS.control.speedPanelOpenChange, function(open, speed, item) {
|
|
5942
6026
|
theme.emit(CLEAR_TIMER_HEADER_FOOTER_ANIMATION, open, speed);
|
|
5943
6027
|
theme.emit(EVENTS.control.speedPanelOpenChange, open, speed, item);
|
|
@@ -5950,7 +6034,7 @@
|
|
|
5950
6034
|
});
|
|
5951
6035
|
}
|
|
5952
6036
|
// 截图控件
|
|
5953
|
-
if ((
|
|
6037
|
+
if ((_theme_controls10 = theme.controls) == null ? void 0 : _theme_controls10.capturePictureControl) {
|
|
5954
6038
|
theme.controls.capturePictureControl.on(EVENTS.control.capturePicture, function(options) {
|
|
5955
6039
|
theme.emit(EVENTS.control.capturePicture, options);
|
|
5956
6040
|
});
|
|
@@ -5959,25 +6043,25 @@
|
|
|
5959
6043
|
});
|
|
5960
6044
|
}
|
|
5961
6045
|
// 全屏控件
|
|
5962
|
-
if ((
|
|
6046
|
+
if ((_theme_controls11 = theme.controls) == null ? void 0 : _theme_controls11.fullscreenControl) {
|
|
5963
6047
|
theme.controls.fullscreenControl.on(EVENTS.control.fullscreenDestroy, function() {
|
|
5964
6048
|
theme.emit(EVENTS.control.fullscreenDestroy);
|
|
5965
6049
|
});
|
|
5966
6050
|
}
|
|
5967
6051
|
// 全局全屏控件
|
|
5968
|
-
if ((
|
|
6052
|
+
if ((_theme_controls12 = theme.controls) == null ? void 0 : _theme_controls12.globalFullscreenControl) {
|
|
5969
6053
|
theme.controls.globalFullscreenControl.on(EVENTS.control.globalFullscreenDestroy, function() {
|
|
5970
6054
|
theme.emit(EVENTS.control.globalFullscreenDestroy);
|
|
5971
6055
|
});
|
|
5972
6056
|
}
|
|
5973
6057
|
// 设备信息控件
|
|
5974
|
-
if ((
|
|
6058
|
+
if ((_theme_controls13 = theme.controls) == null ? void 0 : _theme_controls13.deviceControl) {
|
|
5975
6059
|
theme.controls.deviceControl.on(EVENTS.control.deviceDestroy, function() {
|
|
5976
6060
|
theme.emit(EVENTS.control.deviceDestroy);
|
|
5977
6061
|
});
|
|
5978
6062
|
}
|
|
5979
6063
|
// 回放类型切换控件
|
|
5980
|
-
if ((
|
|
6064
|
+
if ((_theme_controls14 = theme.controls) == null ? void 0 : _theme_controls14.recControl) {
|
|
5981
6065
|
// prettier-ignore
|
|
5982
6066
|
theme.controls.recControl.on(EVENTS.control.recTypeChange, function(type) {
|
|
5983
6067
|
if (theme.recType !== type) {
|
|
@@ -5998,7 +6082,7 @@
|
|
|
5998
6082
|
});
|
|
5999
6083
|
}
|
|
6000
6084
|
// 时间轴控件
|
|
6001
|
-
if ((
|
|
6085
|
+
if ((_theme_controls15 = theme.controls) == null ? void 0 : _theme_controls15.timeLineControl) {
|
|
6002
6086
|
theme.controls.timeLineControl.on(EVENTS.control.timeLineChange, function(date) {
|
|
6003
6087
|
theme.emit(EVENTS.control.timeLineChange, date);
|
|
6004
6088
|
});
|
|
@@ -6015,7 +6099,7 @@
|
|
|
6015
6099
|
});
|
|
6016
6100
|
}
|
|
6017
6101
|
// 日历控件
|
|
6018
|
-
if ((
|
|
6102
|
+
if ((_theme_controls16 = theme.controls) == null ? void 0 : _theme_controls16.dateControl) {
|
|
6019
6103
|
theme.controls.dateControl.on(EVENTS.control.datePanelOpenChange, function(open, date) {
|
|
6020
6104
|
theme.emit(EVENTS.control.datePanelOpenChange, open, date);
|
|
6021
6105
|
});
|
|
@@ -6110,8 +6194,8 @@
|
|
|
6110
6194
|
if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
|
|
6111
6195
|
return Constructor;
|
|
6112
6196
|
}
|
|
6113
|
-
function _extends$
|
|
6114
|
-
_extends$
|
|
6197
|
+
function _extends$k() {
|
|
6198
|
+
_extends$k = Object.assign || function(target) {
|
|
6115
6199
|
for(var i = 1; i < arguments.length; i++){
|
|
6116
6200
|
var source = arguments[i];
|
|
6117
6201
|
for(var key in source){
|
|
@@ -6122,9 +6206,9 @@
|
|
|
6122
6206
|
}
|
|
6123
6207
|
return target;
|
|
6124
6208
|
};
|
|
6125
|
-
return _extends$
|
|
6209
|
+
return _extends$k.apply(this, arguments);
|
|
6126
6210
|
}
|
|
6127
|
-
function _inherits$
|
|
6211
|
+
function _inherits$j(subClass, superClass) {
|
|
6128
6212
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
6129
6213
|
throw new TypeError("Super expression must either be null or a function");
|
|
6130
6214
|
}
|
|
@@ -6135,14 +6219,14 @@
|
|
|
6135
6219
|
configurable: true
|
|
6136
6220
|
}
|
|
6137
6221
|
});
|
|
6138
|
-
if (superClass) _set_prototype_of$
|
|
6222
|
+
if (superClass) _set_prototype_of$j(subClass, superClass);
|
|
6139
6223
|
}
|
|
6140
|
-
function _set_prototype_of$
|
|
6141
|
-
_set_prototype_of$
|
|
6224
|
+
function _set_prototype_of$j(o, p) {
|
|
6225
|
+
_set_prototype_of$j = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
6142
6226
|
o.__proto__ = p;
|
|
6143
6227
|
return o;
|
|
6144
6228
|
};
|
|
6145
|
-
return _set_prototype_of$
|
|
6229
|
+
return _set_prototype_of$j(o, p);
|
|
6146
6230
|
}
|
|
6147
6231
|
var ZOOM_DEFAULT_OPTIONS = {
|
|
6148
6232
|
open: false,
|
|
@@ -6152,10 +6236,10 @@
|
|
|
6152
6236
|
* 电子放大控件
|
|
6153
6237
|
* @category Control
|
|
6154
6238
|
*/ var Zoom$1 = /*#__PURE__*/ function(Control) {
|
|
6155
|
-
_inherits$
|
|
6239
|
+
_inherits$j(Zoom, Control);
|
|
6156
6240
|
function Zoom(options) {
|
|
6157
6241
|
var _this;
|
|
6158
|
-
_this = Control.call(this, _extends$
|
|
6242
|
+
_this = Control.call(this, _extends$k({}, options, {
|
|
6159
6243
|
tagName: 'span',
|
|
6160
6244
|
controlType: 'button',
|
|
6161
6245
|
classNameSuffix: 'zoom'
|
|
@@ -6289,12 +6373,12 @@
|
|
|
6289
6373
|
* Released under the MIT License.
|
|
6290
6374
|
*/
|
|
6291
6375
|
|
|
6292
|
-
var dist$
|
|
6293
|
-
var hasRequiredDist$
|
|
6376
|
+
var dist$6;
|
|
6377
|
+
var hasRequiredDist$6;
|
|
6294
6378
|
|
|
6295
|
-
function requireDist$
|
|
6296
|
-
if (hasRequiredDist$
|
|
6297
|
-
hasRequiredDist$
|
|
6379
|
+
function requireDist$6 () {
|
|
6380
|
+
if (hasRequiredDist$6) return dist$6;
|
|
6381
|
+
hasRequiredDist$6 = 1;
|
|
6298
6382
|
|
|
6299
6383
|
/**
|
|
6300
6384
|
* Zoom position
|
|
@@ -7001,15 +7085,15 @@
|
|
|
7001
7085
|
}();
|
|
7002
7086
|
Zoom.VERSION = '0.0.2';
|
|
7003
7087
|
|
|
7004
|
-
dist$
|
|
7005
|
-
return dist$
|
|
7088
|
+
dist$6 = Zoom;
|
|
7089
|
+
return dist$6;
|
|
7006
7090
|
}
|
|
7007
7091
|
|
|
7008
|
-
var distExports$3 = requireDist$
|
|
7092
|
+
var distExports$3 = requireDist$6();
|
|
7009
7093
|
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$3);
|
|
7010
7094
|
|
|
7011
|
-
function _extends$
|
|
7012
|
-
_extends$
|
|
7095
|
+
function _extends$j() {
|
|
7096
|
+
_extends$j = Object.assign || function(target) {
|
|
7013
7097
|
for(var i = 1; i < arguments.length; i++){
|
|
7014
7098
|
var source = arguments[i];
|
|
7015
7099
|
for(var key in source){
|
|
@@ -7020,10 +7104,10 @@
|
|
|
7020
7104
|
}
|
|
7021
7105
|
return target;
|
|
7022
7106
|
};
|
|
7023
|
-
return _extends$
|
|
7107
|
+
return _extends$j.apply(this, arguments);
|
|
7024
7108
|
}
|
|
7025
7109
|
function __zoom(theme, container, options) {
|
|
7026
|
-
theme.zoomUtil = new Zoom(container, _extends$
|
|
7110
|
+
theme.zoomUtil = new Zoom(container, _extends$j({}, options || {}, {
|
|
7027
7111
|
min: 1,
|
|
7028
7112
|
onChange: function(zoom, reset) {
|
|
7029
7113
|
if (zoom !== theme._zoom) {
|
|
@@ -7041,7 +7125,7 @@
|
|
|
7041
7125
|
}));
|
|
7042
7126
|
}
|
|
7043
7127
|
|
|
7044
|
-
function asyncGeneratorStep$
|
|
7128
|
+
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7045
7129
|
try {
|
|
7046
7130
|
var info = gen[key](arg);
|
|
7047
7131
|
var value = info.value;
|
|
@@ -7055,22 +7139,22 @@
|
|
|
7055
7139
|
Promise.resolve(value).then(_next, _throw);
|
|
7056
7140
|
}
|
|
7057
7141
|
}
|
|
7058
|
-
function _async_to_generator$
|
|
7142
|
+
function _async_to_generator$6(fn) {
|
|
7059
7143
|
return function() {
|
|
7060
7144
|
var self = this, args = arguments;
|
|
7061
7145
|
return new Promise(function(resolve, reject) {
|
|
7062
7146
|
var gen = fn.apply(self, args);
|
|
7063
7147
|
function _next(value) {
|
|
7064
|
-
asyncGeneratorStep$
|
|
7148
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
7065
7149
|
}
|
|
7066
7150
|
function _throw(err) {
|
|
7067
|
-
asyncGeneratorStep$
|
|
7151
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7068
7152
|
}
|
|
7069
7153
|
_next(undefined);
|
|
7070
7154
|
});
|
|
7071
7155
|
};
|
|
7072
7156
|
}
|
|
7073
|
-
function _ts_generator$
|
|
7157
|
+
function _ts_generator$6(thisArg, body) {
|
|
7074
7158
|
var f, y, t, _ = {
|
|
7075
7159
|
label: 0,
|
|
7076
7160
|
sent: function() {
|
|
@@ -7162,9 +7246,9 @@
|
|
|
7162
7246
|
}
|
|
7163
7247
|
}
|
|
7164
7248
|
function getThemeDataByTemplate(theme, id) {
|
|
7165
|
-
return _async_to_generator$
|
|
7249
|
+
return _async_to_generator$6(function() {
|
|
7166
7250
|
var _theme_options_token_httpToken, _theme_options_token, url;
|
|
7167
|
-
return _ts_generator$
|
|
7251
|
+
return _ts_generator$6(this, function(_state) {
|
|
7168
7252
|
switch(_state.label){
|
|
7169
7253
|
case 0:
|
|
7170
7254
|
url = theme.options.env.domain + "/api/service/media/template/getDetail?accessToken=" + (theme.options.accessToken || ((_theme_options_token = theme.options.token) == null ? void 0 : (_theme_options_token_httpToken = _theme_options_token.httpToken) == null ? void 0 : _theme_options_token_httpToken.url)) + "&id=" + id;
|
|
@@ -7173,8 +7257,8 @@
|
|
|
7173
7257
|
fetch(url, {
|
|
7174
7258
|
method: 'GET'
|
|
7175
7259
|
}).then(function(response) {
|
|
7176
|
-
return _async_to_generator$
|
|
7177
|
-
return _ts_generator$
|
|
7260
|
+
return _async_to_generator$6(function() {
|
|
7261
|
+
return _ts_generator$6(this, function(_state) {
|
|
7178
7262
|
switch(_state.label){
|
|
7179
7263
|
case 0:
|
|
7180
7264
|
return [
|
|
@@ -7219,7 +7303,7 @@
|
|
|
7219
7303
|
})();
|
|
7220
7304
|
}
|
|
7221
7305
|
|
|
7222
|
-
function asyncGeneratorStep$
|
|
7306
|
+
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7223
7307
|
try {
|
|
7224
7308
|
var info = gen[key](arg);
|
|
7225
7309
|
var value = info.value;
|
|
@@ -7233,23 +7317,23 @@
|
|
|
7233
7317
|
Promise.resolve(value).then(_next, _throw);
|
|
7234
7318
|
}
|
|
7235
7319
|
}
|
|
7236
|
-
function _async_to_generator$
|
|
7320
|
+
function _async_to_generator$5(fn) {
|
|
7237
7321
|
return function() {
|
|
7238
7322
|
var self = this, args = arguments;
|
|
7239
7323
|
return new Promise(function(resolve, reject) {
|
|
7240
7324
|
var gen = fn.apply(self, args);
|
|
7241
7325
|
function _next(value) {
|
|
7242
|
-
asyncGeneratorStep$
|
|
7326
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
7243
7327
|
}
|
|
7244
7328
|
function _throw(err) {
|
|
7245
|
-
asyncGeneratorStep$
|
|
7329
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
7246
7330
|
}
|
|
7247
7331
|
_next(undefined);
|
|
7248
7332
|
});
|
|
7249
7333
|
};
|
|
7250
7334
|
}
|
|
7251
|
-
function _extends$
|
|
7252
|
-
_extends$
|
|
7335
|
+
function _extends$i() {
|
|
7336
|
+
_extends$i = Object.assign || function(target) {
|
|
7253
7337
|
for(var i = 1; i < arguments.length; i++){
|
|
7254
7338
|
var source = arguments[i];
|
|
7255
7339
|
for(var key in source){
|
|
@@ -7260,9 +7344,9 @@
|
|
|
7260
7344
|
}
|
|
7261
7345
|
return target;
|
|
7262
7346
|
};
|
|
7263
|
-
return _extends$
|
|
7347
|
+
return _extends$i.apply(this, arguments);
|
|
7264
7348
|
}
|
|
7265
|
-
function _ts_generator$
|
|
7349
|
+
function _ts_generator$5(thisArg, body) {
|
|
7266
7350
|
var f, y, t, _ = {
|
|
7267
7351
|
label: 0,
|
|
7268
7352
|
sent: function() {
|
|
@@ -7388,7 +7472,7 @@
|
|
|
7388
7472
|
}
|
|
7389
7473
|
if (item.isrender === 1 && REC_GROUP.includes(item.iconId)) {
|
|
7390
7474
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7391
|
-
recControls.push(recControls[0] ? _extends$
|
|
7475
|
+
recControls.push(recControls[0] ? _extends$i({}, item, {
|
|
7392
7476
|
part: recControls[0].part
|
|
7393
7477
|
}) : item);
|
|
7394
7478
|
return false;
|
|
@@ -7411,7 +7495,7 @@
|
|
|
7411
7495
|
}
|
|
7412
7496
|
if (item.isrender === 1 && REC_GROUP.includes(item.iconId)) {
|
|
7413
7497
|
// TODO: 因为回放是一组, 位置以第一个位置为准
|
|
7414
|
-
recControls.push(recControls[0] ? _extends$
|
|
7498
|
+
recControls.push(recControls[0] ? _extends$i({}, item, {
|
|
7415
7499
|
part: recControls[0].part
|
|
7416
7500
|
}) : item);
|
|
7417
7501
|
return false;
|
|
@@ -7473,9 +7557,9 @@
|
|
|
7473
7557
|
* @param data
|
|
7474
7558
|
* @returns
|
|
7475
7559
|
*/ function getThemeData(theme, data) {
|
|
7476
|
-
return _async_to_generator$
|
|
7560
|
+
return _async_to_generator$5(function() {
|
|
7477
7561
|
var themeData, _theme_logger, template;
|
|
7478
|
-
return _ts_generator$
|
|
7562
|
+
return _ts_generator$5(this, function(_state) {
|
|
7479
7563
|
switch(_state.label){
|
|
7480
7564
|
case 0:
|
|
7481
7565
|
themeData = data;
|
|
@@ -7666,9 +7750,9 @@
|
|
|
7666
7750
|
return Component;
|
|
7667
7751
|
}();
|
|
7668
7752
|
|
|
7669
|
-
function _extends$
|
|
7670
|
-
_extends$
|
|
7671
|
-
for(var i = 1; i < arguments.length; i++){
|
|
7753
|
+
function _extends$h() {
|
|
7754
|
+
_extends$h = Object.assign || function(target) {
|
|
7755
|
+
for(var i = 1; i < arguments.length; i++){
|
|
7672
7756
|
var source = arguments[i];
|
|
7673
7757
|
for(var key in source){
|
|
7674
7758
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
@@ -7678,9 +7762,9 @@
|
|
|
7678
7762
|
}
|
|
7679
7763
|
return target;
|
|
7680
7764
|
};
|
|
7681
|
-
return _extends$
|
|
7765
|
+
return _extends$h.apply(this, arguments);
|
|
7682
7766
|
}
|
|
7683
|
-
function _inherits$
|
|
7767
|
+
function _inherits$i(subClass, superClass) {
|
|
7684
7768
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7685
7769
|
throw new TypeError("Super expression must either be null or a function");
|
|
7686
7770
|
}
|
|
@@ -7691,28 +7775,28 @@
|
|
|
7691
7775
|
configurable: true
|
|
7692
7776
|
}
|
|
7693
7777
|
});
|
|
7694
|
-
if (superClass) _set_prototype_of$
|
|
7778
|
+
if (superClass) _set_prototype_of$i(subClass, superClass);
|
|
7695
7779
|
}
|
|
7696
|
-
function _set_prototype_of$
|
|
7697
|
-
_set_prototype_of$
|
|
7780
|
+
function _set_prototype_of$i(o, p) {
|
|
7781
|
+
_set_prototype_of$i = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7698
7782
|
o.__proto__ = p;
|
|
7699
7783
|
return o;
|
|
7700
7784
|
};
|
|
7701
|
-
return _set_prototype_of$
|
|
7785
|
+
return _set_prototype_of$i(o, p);
|
|
7702
7786
|
}
|
|
7703
7787
|
var Footer = /*#__PURE__*/ function(Component) {
|
|
7704
|
-
_inherits$
|
|
7788
|
+
_inherits$i(Footer, Component);
|
|
7705
7789
|
function Footer(options) {
|
|
7706
7790
|
if (options === void 0) options = {};
|
|
7707
|
-
return Component.call(this, _extends$
|
|
7791
|
+
return Component.call(this, _extends$h({}, options, {
|
|
7708
7792
|
cType: 'footer'
|
|
7709
7793
|
})) || this;
|
|
7710
7794
|
}
|
|
7711
7795
|
return Footer;
|
|
7712
7796
|
}(Component);
|
|
7713
7797
|
|
|
7714
|
-
function _extends$
|
|
7715
|
-
_extends$
|
|
7798
|
+
function _extends$g() {
|
|
7799
|
+
_extends$g = Object.assign || function(target) {
|
|
7716
7800
|
for(var i = 1; i < arguments.length; i++){
|
|
7717
7801
|
var source = arguments[i];
|
|
7718
7802
|
for(var key in source){
|
|
@@ -7723,9 +7807,9 @@
|
|
|
7723
7807
|
}
|
|
7724
7808
|
return target;
|
|
7725
7809
|
};
|
|
7726
|
-
return _extends$
|
|
7810
|
+
return _extends$g.apply(this, arguments);
|
|
7727
7811
|
}
|
|
7728
|
-
function _inherits$
|
|
7812
|
+
function _inherits$h(subClass, superClass) {
|
|
7729
7813
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7730
7814
|
throw new TypeError("Super expression must either be null or a function");
|
|
7731
7815
|
}
|
|
@@ -7736,20 +7820,20 @@
|
|
|
7736
7820
|
configurable: true
|
|
7737
7821
|
}
|
|
7738
7822
|
});
|
|
7739
|
-
if (superClass) _set_prototype_of$
|
|
7823
|
+
if (superClass) _set_prototype_of$h(subClass, superClass);
|
|
7740
7824
|
}
|
|
7741
|
-
function _set_prototype_of$
|
|
7742
|
-
_set_prototype_of$
|
|
7825
|
+
function _set_prototype_of$h(o, p) {
|
|
7826
|
+
_set_prototype_of$h = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7743
7827
|
o.__proto__ = p;
|
|
7744
7828
|
return o;
|
|
7745
7829
|
};
|
|
7746
|
-
return _set_prototype_of$
|
|
7830
|
+
return _set_prototype_of$h(o, p);
|
|
7747
7831
|
}
|
|
7748
7832
|
var Header = /*#__PURE__*/ function(Component) {
|
|
7749
|
-
_inherits$
|
|
7833
|
+
_inherits$h(Header, Component);
|
|
7750
7834
|
function Header(options) {
|
|
7751
7835
|
if (options === void 0) options = {};
|
|
7752
|
-
return Component.call(this, _extends$
|
|
7836
|
+
return Component.call(this, _extends$g({}, options, {
|
|
7753
7837
|
cType: 'header'
|
|
7754
7838
|
})) || this;
|
|
7755
7839
|
}
|
|
@@ -7915,8 +7999,8 @@
|
|
|
7915
7999
|
};
|
|
7916
8000
|
}
|
|
7917
8001
|
|
|
7918
|
-
function _extends$
|
|
7919
|
-
_extends$
|
|
8002
|
+
function _extends$f() {
|
|
8003
|
+
_extends$f = Object.assign || function(target) {
|
|
7920
8004
|
for(var i = 1; i < arguments.length; i++){
|
|
7921
8005
|
var source = arguments[i];
|
|
7922
8006
|
for(var key in source){
|
|
@@ -7927,9 +8011,9 @@
|
|
|
7927
8011
|
}
|
|
7928
8012
|
return target;
|
|
7929
8013
|
};
|
|
7930
|
-
return _extends$
|
|
8014
|
+
return _extends$f.apply(this, arguments);
|
|
7931
8015
|
}
|
|
7932
|
-
function _inherits$
|
|
8016
|
+
function _inherits$g(subClass, superClass) {
|
|
7933
8017
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
7934
8018
|
throw new TypeError("Super expression must either be null or a function");
|
|
7935
8019
|
}
|
|
@@ -7940,23 +8024,23 @@
|
|
|
7940
8024
|
configurable: true
|
|
7941
8025
|
}
|
|
7942
8026
|
});
|
|
7943
|
-
if (superClass) _set_prototype_of$
|
|
8027
|
+
if (superClass) _set_prototype_of$g(subClass, superClass);
|
|
7944
8028
|
}
|
|
7945
|
-
function _set_prototype_of$
|
|
7946
|
-
_set_prototype_of$
|
|
8029
|
+
function _set_prototype_of$g(o, p) {
|
|
8030
|
+
_set_prototype_of$g = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
7947
8031
|
o.__proto__ = p;
|
|
7948
8032
|
return o;
|
|
7949
8033
|
};
|
|
7950
|
-
return _set_prototype_of$
|
|
8034
|
+
return _set_prototype_of$g(o, p);
|
|
7951
8035
|
}
|
|
7952
8036
|
/**
|
|
7953
8037
|
* 全局全屏
|
|
7954
8038
|
* 主题和播放器不提供全局全屏的api, 如果开发者想要可以参考这个组件自己实现
|
|
7955
8039
|
* @category Control
|
|
7956
8040
|
*/ var GlobalFullscreen = /*#__PURE__*/ function(Fullscreen) {
|
|
7957
|
-
_inherits$
|
|
8041
|
+
_inherits$g(GlobalFullscreen, Fullscreen);
|
|
7958
8042
|
function GlobalFullscreen(options) {
|
|
7959
|
-
return Fullscreen.call(this, _extends$
|
|
8043
|
+
return Fullscreen.call(this, _extends$f({}, options, {
|
|
7960
8044
|
controlType: 'button',
|
|
7961
8045
|
classNameSuffix: 'global-fullscreen'
|
|
7962
8046
|
})) || this;
|
|
@@ -7987,8 +8071,8 @@
|
|
|
7987
8071
|
return GlobalFullscreen;
|
|
7988
8072
|
}(Fullscreen);
|
|
7989
8073
|
|
|
7990
|
-
function _extends$
|
|
7991
|
-
_extends$
|
|
8074
|
+
function _extends$e() {
|
|
8075
|
+
_extends$e = Object.assign || function(target) {
|
|
7992
8076
|
for(var i = 1; i < arguments.length; i++){
|
|
7993
8077
|
var source = arguments[i];
|
|
7994
8078
|
for(var key in source){
|
|
@@ -7999,9 +8083,9 @@
|
|
|
7999
8083
|
}
|
|
8000
8084
|
return target;
|
|
8001
8085
|
};
|
|
8002
|
-
return _extends$
|
|
8086
|
+
return _extends$e.apply(this, arguments);
|
|
8003
8087
|
}
|
|
8004
|
-
function _inherits$
|
|
8088
|
+
function _inherits$f(subClass, superClass) {
|
|
8005
8089
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
8006
8090
|
throw new TypeError("Super expression must either be null or a function");
|
|
8007
8091
|
}
|
|
@@ -8012,23 +8096,23 @@
|
|
|
8012
8096
|
configurable: true
|
|
8013
8097
|
}
|
|
8014
8098
|
});
|
|
8015
|
-
if (superClass) _set_prototype_of$
|
|
8099
|
+
if (superClass) _set_prototype_of$f(subClass, superClass);
|
|
8016
8100
|
}
|
|
8017
|
-
function _set_prototype_of$
|
|
8018
|
-
_set_prototype_of$
|
|
8101
|
+
function _set_prototype_of$f(o, p) {
|
|
8102
|
+
_set_prototype_of$f = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
8019
8103
|
o.__proto__ = p;
|
|
8020
8104
|
return o;
|
|
8021
8105
|
};
|
|
8022
|
-
return _set_prototype_of$
|
|
8106
|
+
return _set_prototype_of$f(o, p);
|
|
8023
8107
|
}
|
|
8024
8108
|
/**
|
|
8025
8109
|
* 截图控件,点击后会触发截图事件, 截图数据会通过 onCapture 回调函数返回
|
|
8026
8110
|
* @category Control
|
|
8027
8111
|
*/ var CapturePicture = /*#__PURE__*/ function(Control) {
|
|
8028
|
-
_inherits$
|
|
8112
|
+
_inherits$f(CapturePicture, Control);
|
|
8029
8113
|
function CapturePicture(options) {
|
|
8030
8114
|
var _this;
|
|
8031
|
-
_this = Control.call(this, _extends$
|
|
8115
|
+
_this = Control.call(this, _extends$e({}, options, {
|
|
8032
8116
|
tagName: 'span',
|
|
8033
8117
|
classNameSuffix: 'capture-picture'
|
|
8034
8118
|
})) || this, _this._timer = null;
|
|
@@ -8081,7 +8165,25 @@
|
|
|
8081
8165
|
return CapturePicture;
|
|
8082
8166
|
}(Control);
|
|
8083
8167
|
|
|
8084
|
-
var dist$
|
|
8168
|
+
var dist$5 = {};
|
|
8169
|
+
|
|
8170
|
+
var dist$4 = {};
|
|
8171
|
+
|
|
8172
|
+
/*
|
|
8173
|
+
* @ezuikit/utils-tools v2.0.1
|
|
8174
|
+
* tools utils
|
|
8175
|
+
* Copyright (c) 2025-12-02 Ezviz-OpenBiz
|
|
8176
|
+
* Released under the MIT License.
|
|
8177
|
+
*/
|
|
8178
|
+
|
|
8179
|
+
var hasRequiredDist$5;
|
|
8180
|
+
|
|
8181
|
+
function requireDist$5 () {
|
|
8182
|
+
if (hasRequiredDist$5) return dist$4;
|
|
8183
|
+
hasRequiredDist$5 = 1;
|
|
8184
|
+
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done: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 DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(str+"T00:00:00"):/^\d{8}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T00:00:00")):/^\d{14}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T"+str.slice(8,10)+":"+str.slice(10,12)+":"+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$4.DateTime=DateTime,dist$4.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce((function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)}),0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter((function(item){return !/^vc=\d?/.test(item)})).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$4.getQuery=getQuery,dist$4.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$4.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$4.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$4.parseEzopenUrl=parseEzopenUrl,dist$4.pick=function(obj,keys){return Object.entries(obj).reduce((function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc}),{})},dist$4.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce((function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"}),"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
8185
|
+
return dist$4;
|
|
8186
|
+
}
|
|
8085
8187
|
|
|
8086
8188
|
/*
|
|
8087
8189
|
* @ezuikit/control-ptz v0.0.1
|
|
@@ -8089,14 +8191,14 @@
|
|
|
8089
8191
|
* Released under the MIT License.
|
|
8090
8192
|
*/
|
|
8091
8193
|
|
|
8092
|
-
var hasRequiredDist$
|
|
8194
|
+
var hasRequiredDist$4;
|
|
8093
8195
|
|
|
8094
|
-
function requireDist$
|
|
8095
|
-
if (hasRequiredDist$
|
|
8096
|
-
hasRequiredDist$
|
|
8196
|
+
function requireDist$4 () {
|
|
8197
|
+
if (hasRequiredDist$4) return dist$5;
|
|
8198
|
+
hasRequiredDist$4 = 1;
|
|
8097
8199
|
|
|
8098
8200
|
var deepmerge = requireCjs();
|
|
8099
|
-
var utilsTools = requireDist$
|
|
8201
|
+
var utilsTools = requireDist$5();
|
|
8100
8202
|
|
|
8101
8203
|
var en_US = {
|
|
8102
8204
|
GET_PTZ_STATUS: 'Get current PTZ status',
|
|
@@ -9016,13 +9118,13 @@
|
|
|
9016
9118
|
return Ptz;
|
|
9017
9119
|
}(BasePtz);
|
|
9018
9120
|
|
|
9019
|
-
dist$
|
|
9020
|
-
dist$
|
|
9021
|
-
dist$
|
|
9022
|
-
return dist$
|
|
9121
|
+
dist$5.BasePtz = BasePtz;
|
|
9122
|
+
dist$5.MobilePtz = MobilePtz;
|
|
9123
|
+
dist$5.Ptz = Ptz;
|
|
9124
|
+
return dist$5;
|
|
9023
9125
|
}
|
|
9024
9126
|
|
|
9025
|
-
var distExports$2 = requireDist$
|
|
9127
|
+
var distExports$2 = requireDist$4();
|
|
9026
9128
|
|
|
9027
9129
|
function _defineProperties$4(target, props) {
|
|
9028
9130
|
for(var i = 0; i < props.length; i++){
|
|
@@ -9037,8 +9139,8 @@
|
|
|
9037
9139
|
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
9038
9140
|
return Constructor;
|
|
9039
9141
|
}
|
|
9040
|
-
function _extends$
|
|
9041
|
-
_extends$
|
|
9142
|
+
function _extends$d() {
|
|
9143
|
+
_extends$d = Object.assign || function(target) {
|
|
9042
9144
|
for(var i = 1; i < arguments.length; i++){
|
|
9043
9145
|
var source = arguments[i];
|
|
9044
9146
|
for(var key in source){
|
|
@@ -9049,9 +9151,9 @@
|
|
|
9049
9151
|
}
|
|
9050
9152
|
return target;
|
|
9051
9153
|
};
|
|
9052
|
-
return _extends$
|
|
9154
|
+
return _extends$d.apply(this, arguments);
|
|
9053
9155
|
}
|
|
9054
|
-
function _inherits$
|
|
9156
|
+
function _inherits$e(subClass, superClass) {
|
|
9055
9157
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9056
9158
|
throw new TypeError("Super expression must either be null or a function");
|
|
9057
9159
|
}
|
|
@@ -9062,23 +9164,23 @@
|
|
|
9062
9164
|
configurable: true
|
|
9063
9165
|
}
|
|
9064
9166
|
});
|
|
9065
|
-
if (superClass) _set_prototype_of$
|
|
9167
|
+
if (superClass) _set_prototype_of$e(subClass, superClass);
|
|
9066
9168
|
}
|
|
9067
|
-
function _set_prototype_of$
|
|
9068
|
-
_set_prototype_of$
|
|
9169
|
+
function _set_prototype_of$e(o, p) {
|
|
9170
|
+
_set_prototype_of$e = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9069
9171
|
o.__proto__ = p;
|
|
9070
9172
|
return o;
|
|
9071
9173
|
};
|
|
9072
|
-
return _set_prototype_of$
|
|
9174
|
+
return _set_prototype_of$e(o, p);
|
|
9073
9175
|
}
|
|
9074
9176
|
/**
|
|
9075
9177
|
* 云台控件
|
|
9076
9178
|
* @category Control
|
|
9077
9179
|
*/ var Ptz = /*#__PURE__*/ function(Control) {
|
|
9078
|
-
_inherits$
|
|
9180
|
+
_inherits$e(Ptz, Control);
|
|
9079
9181
|
function Ptz(options) {
|
|
9080
9182
|
var _this;
|
|
9081
|
-
_this = Control.call(this, _extends$
|
|
9183
|
+
_this = Control.call(this, _extends$d({}, options, {
|
|
9082
9184
|
tagName: 'span',
|
|
9083
9185
|
controlType: 'button',
|
|
9084
9186
|
classNameSuffix: 'ptz'
|
|
@@ -9121,7 +9223,7 @@
|
|
|
9121
9223
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
9122
9224
|
this.$panel.appendChild(this.$turntable);
|
|
9123
9225
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9124
|
-
this._ptzControl = new distExports$2.Ptz(this.$turntable, _extends$
|
|
9226
|
+
this._ptzControl = new distExports$2.Ptz(this.$turntable, _extends$d({}, this._options, {
|
|
9125
9227
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9126
9228
|
onDirection: this._onDirection.bind(this)
|
|
9127
9229
|
}));
|
|
@@ -9130,7 +9232,7 @@
|
|
|
9130
9232
|
};
|
|
9131
9233
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
9132
9234
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9133
|
-
if (!this._ptzControl1) this._ptzControl1 = new distExports$2.MobilePtz($container, _extends$
|
|
9235
|
+
if (!this._ptzControl1) this._ptzControl1 = new distExports$2.MobilePtz($container, _extends$d({}, this._options, {
|
|
9134
9236
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
9135
9237
|
onDirection: this._onDirection.bind(this)
|
|
9136
9238
|
}));
|
|
@@ -9233,8 +9335,8 @@
|
|
|
9233
9335
|
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
9234
9336
|
return Constructor;
|
|
9235
9337
|
}
|
|
9236
|
-
function _extends$
|
|
9237
|
-
_extends$
|
|
9338
|
+
function _extends$c() {
|
|
9339
|
+
_extends$c = Object.assign || function(target) {
|
|
9238
9340
|
for(var i = 1; i < arguments.length; i++){
|
|
9239
9341
|
var source = arguments[i];
|
|
9240
9342
|
for(var key in source){
|
|
@@ -9245,9 +9347,9 @@
|
|
|
9245
9347
|
}
|
|
9246
9348
|
return target;
|
|
9247
9349
|
};
|
|
9248
|
-
return _extends$
|
|
9350
|
+
return _extends$c.apply(this, arguments);
|
|
9249
9351
|
}
|
|
9250
|
-
function _inherits$
|
|
9352
|
+
function _inherits$d(subClass, superClass) {
|
|
9251
9353
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
9252
9354
|
throw new TypeError("Super expression must either be null or a function");
|
|
9253
9355
|
}
|
|
@@ -9258,14 +9360,14 @@
|
|
|
9258
9360
|
configurable: true
|
|
9259
9361
|
}
|
|
9260
9362
|
});
|
|
9261
|
-
if (superClass) _set_prototype_of$
|
|
9363
|
+
if (superClass) _set_prototype_of$d(subClass, superClass);
|
|
9262
9364
|
}
|
|
9263
|
-
function _set_prototype_of$
|
|
9264
|
-
_set_prototype_of$
|
|
9365
|
+
function _set_prototype_of$d(o, p) {
|
|
9366
|
+
_set_prototype_of$d = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9265
9367
|
o.__proto__ = p;
|
|
9266
9368
|
return o;
|
|
9267
9369
|
};
|
|
9268
|
-
return _set_prototype_of$
|
|
9370
|
+
return _set_prototype_of$d(o, p);
|
|
9269
9371
|
}
|
|
9270
9372
|
var RECORD_DEFAULT_OPTIONS = {
|
|
9271
9373
|
maxDuration: 3600
|
|
@@ -9279,10 +9381,10 @@
|
|
|
9279
9381
|
* 2. 录制时间很短可能会因为浏览器的限制或没有I帧而无法生成有效的视频文件
|
|
9280
9382
|
* @category Control
|
|
9281
9383
|
*/ var Record = /*#__PURE__*/ function(Control) {
|
|
9282
|
-
_inherits$
|
|
9384
|
+
_inherits$d(Record, Control);
|
|
9283
9385
|
function Record(options) {
|
|
9284
9386
|
var _this;
|
|
9285
|
-
_this = Control.call(this, _extends$
|
|
9387
|
+
_this = Control.call(this, _extends$c({}, options, {
|
|
9286
9388
|
tagName: 'span',
|
|
9287
9389
|
controlType: 'button',
|
|
9288
9390
|
classNameSuffix: 'record'
|
|
@@ -9291,94 +9393,602 @@
|
|
|
9291
9393
|
_this._render();
|
|
9292
9394
|
return _this;
|
|
9293
9395
|
}
|
|
9294
|
-
var _proto = Record.prototype;
|
|
9295
|
-
/**
|
|
9296
|
-
* 渲染图标
|
|
9297
|
-
*/ _proto._render = function _render() {
|
|
9396
|
+
var _proto = Record.prototype;
|
|
9397
|
+
/**
|
|
9398
|
+
* 渲染图标
|
|
9399
|
+
*/ _proto._render = function _render() {
|
|
9400
|
+
var _this_locale;
|
|
9401
|
+
this.$container.innerHTML = IconComponents.record({
|
|
9402
|
+
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_RECORDVIDEO
|
|
9403
|
+
});
|
|
9404
|
+
};
|
|
9405
|
+
/**
|
|
9406
|
+
* 渲染计时器
|
|
9407
|
+
*/ _proto._renderTimer = function _renderTimer() {
|
|
9408
|
+
var _this = this;
|
|
9409
|
+
var _this__options_rootContainer, _this__options;
|
|
9410
|
+
this._timerNode = document.createElement('span');
|
|
9411
|
+
this._timerNode.className = "" + PREFIX_CLASS + "-record-timer";
|
|
9412
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_rootContainer = _this__options.rootContainer) == null ? void 0 : _this__options_rootContainer.appendChild(this._timerNode);
|
|
9413
|
+
this._timerNode.innerHTML = IconComponents.recordCircle() + '<span class="' + PREFIX_CLASS + '-record-timer-time">' + formatTime(this._seconds) + "<span>";
|
|
9414
|
+
var $time = this._timerNode.querySelector("." + PREFIX_CLASS + "-record-timer-time");
|
|
9415
|
+
this._timer = setInterval(function() {
|
|
9416
|
+
_this._seconds++;
|
|
9417
|
+
if (_this._seconds >= _this._options.maxDuration) {
|
|
9418
|
+
// 录制时长不能超过一个小时, 因为录制的数据需要占用浏览器内存
|
|
9419
|
+
_this._destroyTimer();
|
|
9420
|
+
return;
|
|
9421
|
+
}
|
|
9422
|
+
if ($time) $time.innerHTML = "" + formatTime(_this._seconds);
|
|
9423
|
+
}, 1000);
|
|
9424
|
+
};
|
|
9425
|
+
_proto.reset = function reset() {
|
|
9426
|
+
if (this.active) {
|
|
9427
|
+
this.active = false;
|
|
9428
|
+
Control.prototype.reset.call(this);
|
|
9429
|
+
}
|
|
9430
|
+
};
|
|
9431
|
+
_proto.destroy = function destroy() {
|
|
9432
|
+
this._destroyTimer();
|
|
9433
|
+
Control.prototype.destroy.call(this);
|
|
9434
|
+
};
|
|
9435
|
+
/**
|
|
9436
|
+
* 销毁定时器和销毁节点
|
|
9437
|
+
*/ _proto._destroyTimer = function _destroyTimer() {
|
|
9438
|
+
this._seconds = 0;
|
|
9439
|
+
if (this._timer) {
|
|
9440
|
+
clearInterval(this._timer);
|
|
9441
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9442
|
+
this._timer = null;
|
|
9443
|
+
}
|
|
9444
|
+
if (this._timerNode) {
|
|
9445
|
+
this._timerNode.remove();
|
|
9446
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9447
|
+
this._timerNode = null;
|
|
9448
|
+
}
|
|
9449
|
+
this._active = false;
|
|
9450
|
+
};
|
|
9451
|
+
/**
|
|
9452
|
+
* 点击 Control 会触发
|
|
9453
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9454
|
+
this.active = !this.active;
|
|
9455
|
+
Control.prototype._onControlClick.call(this, e);
|
|
9456
|
+
};
|
|
9457
|
+
_create_class$3(Record, [
|
|
9458
|
+
{
|
|
9459
|
+
key: "active",
|
|
9460
|
+
get: /**
|
|
9461
|
+
* 是否激活
|
|
9462
|
+
*/ function get() {
|
|
9463
|
+
return this._active;
|
|
9464
|
+
},
|
|
9465
|
+
set: function set(active) {
|
|
9466
|
+
if (this._disabled && !this._active) {
|
|
9467
|
+
// 不允许禁用情况下激活
|
|
9468
|
+
return;
|
|
9469
|
+
}
|
|
9470
|
+
if (this._active !== active) {
|
|
9471
|
+
this._active = active;
|
|
9472
|
+
this._updateActiveState(active);
|
|
9473
|
+
if (this.active) {
|
|
9474
|
+
this._renderTimer();
|
|
9475
|
+
} else {
|
|
9476
|
+
this._destroyTimer();
|
|
9477
|
+
}
|
|
9478
|
+
this.emit(EVENTS.control.recordingChange, this._active);
|
|
9479
|
+
}
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
]);
|
|
9483
|
+
return Record;
|
|
9484
|
+
}(Control);
|
|
9485
|
+
|
|
9486
|
+
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9487
|
+
try {
|
|
9488
|
+
var info = gen[key](arg);
|
|
9489
|
+
var value = info.value;
|
|
9490
|
+
} catch (error) {
|
|
9491
|
+
reject(error);
|
|
9492
|
+
return;
|
|
9493
|
+
}
|
|
9494
|
+
if (info.done) {
|
|
9495
|
+
resolve(value);
|
|
9496
|
+
} else {
|
|
9497
|
+
Promise.resolve(value).then(_next, _throw);
|
|
9498
|
+
}
|
|
9499
|
+
}
|
|
9500
|
+
function _async_to_generator$4(fn) {
|
|
9501
|
+
return function() {
|
|
9502
|
+
var self = this, args = arguments;
|
|
9503
|
+
return new Promise(function(resolve, reject) {
|
|
9504
|
+
var gen = fn.apply(self, args);
|
|
9505
|
+
function _next(value) {
|
|
9506
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
|
|
9507
|
+
}
|
|
9508
|
+
function _throw(err) {
|
|
9509
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9510
|
+
}
|
|
9511
|
+
_next(undefined);
|
|
9512
|
+
});
|
|
9513
|
+
};
|
|
9514
|
+
}
|
|
9515
|
+
function _defineProperties$2(target, props) {
|
|
9516
|
+
for(var i = 0; i < props.length; i++){
|
|
9517
|
+
var descriptor = props[i];
|
|
9518
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
9519
|
+
descriptor.configurable = true;
|
|
9520
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
9521
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9522
|
+
}
|
|
9523
|
+
}
|
|
9524
|
+
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
9525
|
+
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
9526
|
+
return Constructor;
|
|
9527
|
+
}
|
|
9528
|
+
function _extends$b() {
|
|
9529
|
+
_extends$b = Object.assign || function(target) {
|
|
9530
|
+
for(var i = 1; i < arguments.length; i++){
|
|
9531
|
+
var source = arguments[i];
|
|
9532
|
+
for(var key in source){
|
|
9533
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9534
|
+
target[key] = source[key];
|
|
9535
|
+
}
|
|
9536
|
+
}
|
|
9537
|
+
}
|
|
9538
|
+
return target;
|
|
9539
|
+
};
|
|
9540
|
+
return _extends$b.apply(this, arguments);
|
|
9541
|
+
}
|
|
9542
|
+
function _inherits$c(subClass, superClass) {
|
|
9543
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
9544
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
9545
|
+
}
|
|
9546
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
9547
|
+
constructor: {
|
|
9548
|
+
value: subClass,
|
|
9549
|
+
writable: true,
|
|
9550
|
+
configurable: true
|
|
9551
|
+
}
|
|
9552
|
+
});
|
|
9553
|
+
if (superClass) _set_prototype_of$c(subClass, superClass);
|
|
9554
|
+
}
|
|
9555
|
+
function _set_prototype_of$c(o, p) {
|
|
9556
|
+
_set_prototype_of$c = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9557
|
+
o.__proto__ = p;
|
|
9558
|
+
return o;
|
|
9559
|
+
};
|
|
9560
|
+
return _set_prototype_of$c(o, p);
|
|
9561
|
+
}
|
|
9562
|
+
function _ts_generator$4(thisArg, body) {
|
|
9563
|
+
var f, y, t, _ = {
|
|
9564
|
+
label: 0,
|
|
9565
|
+
sent: function() {
|
|
9566
|
+
if (t[0] & 1) throw t[1];
|
|
9567
|
+
return t[1];
|
|
9568
|
+
},
|
|
9569
|
+
trys: [],
|
|
9570
|
+
ops: []
|
|
9571
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
9572
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
9573
|
+
return this;
|
|
9574
|
+
}), g;
|
|
9575
|
+
function verb(n) {
|
|
9576
|
+
return function(v) {
|
|
9577
|
+
return step([
|
|
9578
|
+
n,
|
|
9579
|
+
v
|
|
9580
|
+
]);
|
|
9581
|
+
};
|
|
9582
|
+
}
|
|
9583
|
+
function step(op) {
|
|
9584
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
9585
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
9586
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
9587
|
+
if (y = 0, t) op = [
|
|
9588
|
+
op[0] & 2,
|
|
9589
|
+
t.value
|
|
9590
|
+
];
|
|
9591
|
+
switch(op[0]){
|
|
9592
|
+
case 0:
|
|
9593
|
+
case 1:
|
|
9594
|
+
t = op;
|
|
9595
|
+
break;
|
|
9596
|
+
case 4:
|
|
9597
|
+
_.label++;
|
|
9598
|
+
return {
|
|
9599
|
+
value: op[1],
|
|
9600
|
+
done: false
|
|
9601
|
+
};
|
|
9602
|
+
case 5:
|
|
9603
|
+
_.label++;
|
|
9604
|
+
y = op[1];
|
|
9605
|
+
op = [
|
|
9606
|
+
0
|
|
9607
|
+
];
|
|
9608
|
+
continue;
|
|
9609
|
+
case 7:
|
|
9610
|
+
op = _.ops.pop();
|
|
9611
|
+
_.trys.pop();
|
|
9612
|
+
continue;
|
|
9613
|
+
default:
|
|
9614
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
9615
|
+
_ = 0;
|
|
9616
|
+
continue;
|
|
9617
|
+
}
|
|
9618
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
9619
|
+
_.label = op[1];
|
|
9620
|
+
break;
|
|
9621
|
+
}
|
|
9622
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
9623
|
+
_.label = t[1];
|
|
9624
|
+
t = op;
|
|
9625
|
+
break;
|
|
9626
|
+
}
|
|
9627
|
+
if (t && _.label < t[2]) {
|
|
9628
|
+
_.label = t[2];
|
|
9629
|
+
_.ops.push(op);
|
|
9630
|
+
break;
|
|
9631
|
+
}
|
|
9632
|
+
if (t[2]) _.ops.pop();
|
|
9633
|
+
_.trys.pop();
|
|
9634
|
+
continue;
|
|
9635
|
+
}
|
|
9636
|
+
op = body.call(thisArg, _);
|
|
9637
|
+
} catch (e) {
|
|
9638
|
+
op = [
|
|
9639
|
+
6,
|
|
9640
|
+
e
|
|
9641
|
+
];
|
|
9642
|
+
y = 0;
|
|
9643
|
+
} finally{
|
|
9644
|
+
f = t = 0;
|
|
9645
|
+
}
|
|
9646
|
+
if (op[0] & 5) throw op[1];
|
|
9647
|
+
return {
|
|
9648
|
+
value: op[0] ? op[1] : void 0,
|
|
9649
|
+
done: true
|
|
9650
|
+
};
|
|
9651
|
+
}
|
|
9652
|
+
}
|
|
9653
|
+
/**
|
|
9654
|
+
* 对讲控件
|
|
9655
|
+
*
|
|
9656
|
+
* navigator.mediaDevices.getUserMedia {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia} 返回一个 Promise 对象,
|
|
9657
|
+
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
9658
|
+
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
9659
|
+
*
|
|
9660
|
+
* @category Control
|
|
9661
|
+
*/ var Talk = /*#__PURE__*/ function(Control) {
|
|
9662
|
+
_inherits$c(Talk, Control);
|
|
9663
|
+
function Talk(options) {
|
|
9664
|
+
var _this;
|
|
9665
|
+
_this = Control.call(this, _extends$b({}, options, {
|
|
9666
|
+
tagName: 'span',
|
|
9667
|
+
controlType: 'button',
|
|
9668
|
+
classNameSuffix: 'talk'
|
|
9669
|
+
})) || this, _this._value = 0;
|
|
9670
|
+
_this._options = options;
|
|
9671
|
+
_this._render();
|
|
9672
|
+
_this.on(EVENTS.talkingChange, function(talking) {
|
|
9673
|
+
if (_this.active !== talking) {
|
|
9674
|
+
_this.active = talking;
|
|
9675
|
+
_this._render();
|
|
9676
|
+
}
|
|
9677
|
+
});
|
|
9678
|
+
_this.on(EVENTS.talkVolumeChange, function(value) {
|
|
9679
|
+
var _this__options_onChange, _this__options;
|
|
9680
|
+
_this.value = value;
|
|
9681
|
+
(_this__options = _this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, value);
|
|
9682
|
+
});
|
|
9683
|
+
return _this;
|
|
9684
|
+
}
|
|
9685
|
+
var _proto = Talk.prototype;
|
|
9686
|
+
_proto._render = function _render() {
|
|
9687
|
+
var _this_locale, _this_locale1;
|
|
9688
|
+
this.$container.innerHTML = this.active ? IconComponents.talkGrowth({
|
|
9689
|
+
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_TALK
|
|
9690
|
+
}) : IconComponents.talk({
|
|
9691
|
+
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_TALK
|
|
9692
|
+
});
|
|
9693
|
+
};
|
|
9694
|
+
_proto.reset = function reset(hide) {
|
|
9695
|
+
if (this.active) {
|
|
9696
|
+
this._value = 0;
|
|
9697
|
+
this.active = false;
|
|
9698
|
+
this._render();
|
|
9699
|
+
this.emit(EVENTS.control.talkingChange, false);
|
|
9700
|
+
Control.prototype.reset.call(this, hide);
|
|
9701
|
+
}
|
|
9702
|
+
};
|
|
9703
|
+
/**
|
|
9704
|
+
* 销毁对讲
|
|
9705
|
+
*/ _proto.destroy = function destroy() {
|
|
9706
|
+
if (this.active) {
|
|
9707
|
+
this.reset();
|
|
9708
|
+
}
|
|
9709
|
+
Control.prototype.destroy.call(this);
|
|
9710
|
+
};
|
|
9711
|
+
/**
|
|
9712
|
+
* 点击 Control 会触发
|
|
9713
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9714
|
+
var _this = this, _superprop_get__onControlClick = function() {
|
|
9715
|
+
return Control.prototype._onControlClick;
|
|
9716
|
+
};
|
|
9717
|
+
return _async_to_generator$4(function() {
|
|
9718
|
+
return _ts_generator$4(this, function(_state) {
|
|
9719
|
+
_superprop_get__onControlClick().call(_this, e);
|
|
9720
|
+
this.active = !this.active;
|
|
9721
|
+
this.emit(EVENTS.control.talkingChange, this.active);
|
|
9722
|
+
this._render();
|
|
9723
|
+
return [
|
|
9724
|
+
2
|
|
9725
|
+
];
|
|
9726
|
+
});
|
|
9727
|
+
}).call(this);
|
|
9728
|
+
};
|
|
9729
|
+
_create_class$2(Talk, [
|
|
9730
|
+
{
|
|
9731
|
+
key: "value",
|
|
9732
|
+
get: /**
|
|
9733
|
+
* 获取当前值
|
|
9734
|
+
*/ function get() {
|
|
9735
|
+
return this._value;
|
|
9736
|
+
},
|
|
9737
|
+
set: /**
|
|
9738
|
+
* 设置当前值 [0-1]
|
|
9739
|
+
*/ function set(value) {
|
|
9740
|
+
// 没有激活状态,则不处理
|
|
9741
|
+
if (!this.active) {
|
|
9742
|
+
return;
|
|
9743
|
+
}
|
|
9744
|
+
if (value < 0 || value > 1) {
|
|
9745
|
+
return;
|
|
9746
|
+
}
|
|
9747
|
+
this._value = value;
|
|
9748
|
+
var gainType = 'silent';
|
|
9749
|
+
if (value > 0 && value < 0.25) {
|
|
9750
|
+
gainType = 'low';
|
|
9751
|
+
} else if (value >= 0.25 && value < 0.5) {
|
|
9752
|
+
gainType = 'normal';
|
|
9753
|
+
} else if (value >= 0.5 && value < 0.75) {
|
|
9754
|
+
gainType = 'high';
|
|
9755
|
+
} else if (value >= 0.75) {
|
|
9756
|
+
gainType = 'deafening';
|
|
9757
|
+
}
|
|
9758
|
+
var className = Array.from(this.$container.classList).find(function(className) {
|
|
9759
|
+
return className.startsWith("" + PREFIX_CLASS + "-talk-gain-");
|
|
9760
|
+
});
|
|
9761
|
+
if (className) this.$container.classList.remove(className);
|
|
9762
|
+
this.$container.classList.add(PREFIX_CLASS + "-talk-gain-" + gainType);
|
|
9763
|
+
}
|
|
9764
|
+
}
|
|
9765
|
+
]);
|
|
9766
|
+
return Talk;
|
|
9767
|
+
}(Control);
|
|
9768
|
+
|
|
9769
|
+
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9770
|
+
try {
|
|
9771
|
+
var info = gen[key](arg);
|
|
9772
|
+
var value = info.value;
|
|
9773
|
+
} catch (error) {
|
|
9774
|
+
reject(error);
|
|
9775
|
+
return;
|
|
9776
|
+
}
|
|
9777
|
+
if (info.done) {
|
|
9778
|
+
resolve(value);
|
|
9779
|
+
} else {
|
|
9780
|
+
Promise.resolve(value).then(_next, _throw);
|
|
9781
|
+
}
|
|
9782
|
+
}
|
|
9783
|
+
function _async_to_generator$3(fn) {
|
|
9784
|
+
return function() {
|
|
9785
|
+
var self = this, args = arguments;
|
|
9786
|
+
return new Promise(function(resolve, reject) {
|
|
9787
|
+
var gen = fn.apply(self, args);
|
|
9788
|
+
function _next(value) {
|
|
9789
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
9790
|
+
}
|
|
9791
|
+
function _throw(err) {
|
|
9792
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9793
|
+
}
|
|
9794
|
+
_next(undefined);
|
|
9795
|
+
});
|
|
9796
|
+
};
|
|
9797
|
+
}
|
|
9798
|
+
function _extends$a() {
|
|
9799
|
+
_extends$a = Object.assign || function(target) {
|
|
9800
|
+
for(var i = 1; i < arguments.length; i++){
|
|
9801
|
+
var source = arguments[i];
|
|
9802
|
+
for(var key in source){
|
|
9803
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
9804
|
+
target[key] = source[key];
|
|
9805
|
+
}
|
|
9806
|
+
}
|
|
9807
|
+
}
|
|
9808
|
+
return target;
|
|
9809
|
+
};
|
|
9810
|
+
return _extends$a.apply(this, arguments);
|
|
9811
|
+
}
|
|
9812
|
+
function _inherits$b(subClass, superClass) {
|
|
9813
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
9814
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
9815
|
+
}
|
|
9816
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
9817
|
+
constructor: {
|
|
9818
|
+
value: subClass,
|
|
9819
|
+
writable: true,
|
|
9820
|
+
configurable: true
|
|
9821
|
+
}
|
|
9822
|
+
});
|
|
9823
|
+
if (superClass) _set_prototype_of$b(subClass, superClass);
|
|
9824
|
+
}
|
|
9825
|
+
function _set_prototype_of$b(o, p) {
|
|
9826
|
+
_set_prototype_of$b = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
9827
|
+
o.__proto__ = p;
|
|
9828
|
+
return o;
|
|
9829
|
+
};
|
|
9830
|
+
return _set_prototype_of$b(o, p);
|
|
9831
|
+
}
|
|
9832
|
+
function _ts_generator$3(thisArg, body) {
|
|
9833
|
+
var f, y, t, _ = {
|
|
9834
|
+
label: 0,
|
|
9835
|
+
sent: function() {
|
|
9836
|
+
if (t[0] & 1) throw t[1];
|
|
9837
|
+
return t[1];
|
|
9838
|
+
},
|
|
9839
|
+
trys: [],
|
|
9840
|
+
ops: []
|
|
9841
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
9842
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
9843
|
+
return this;
|
|
9844
|
+
}), g;
|
|
9845
|
+
function verb(n) {
|
|
9846
|
+
return function(v) {
|
|
9847
|
+
return step([
|
|
9848
|
+
n,
|
|
9849
|
+
v
|
|
9850
|
+
]);
|
|
9851
|
+
};
|
|
9852
|
+
}
|
|
9853
|
+
function step(op) {
|
|
9854
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
9855
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
9856
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
9857
|
+
if (y = 0, t) op = [
|
|
9858
|
+
op[0] & 2,
|
|
9859
|
+
t.value
|
|
9860
|
+
];
|
|
9861
|
+
switch(op[0]){
|
|
9862
|
+
case 0:
|
|
9863
|
+
case 1:
|
|
9864
|
+
t = op;
|
|
9865
|
+
break;
|
|
9866
|
+
case 4:
|
|
9867
|
+
_.label++;
|
|
9868
|
+
return {
|
|
9869
|
+
value: op[1],
|
|
9870
|
+
done: false
|
|
9871
|
+
};
|
|
9872
|
+
case 5:
|
|
9873
|
+
_.label++;
|
|
9874
|
+
y = op[1];
|
|
9875
|
+
op = [
|
|
9876
|
+
0
|
|
9877
|
+
];
|
|
9878
|
+
continue;
|
|
9879
|
+
case 7:
|
|
9880
|
+
op = _.ops.pop();
|
|
9881
|
+
_.trys.pop();
|
|
9882
|
+
continue;
|
|
9883
|
+
default:
|
|
9884
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
9885
|
+
_ = 0;
|
|
9886
|
+
continue;
|
|
9887
|
+
}
|
|
9888
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
9889
|
+
_.label = op[1];
|
|
9890
|
+
break;
|
|
9891
|
+
}
|
|
9892
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
9893
|
+
_.label = t[1];
|
|
9894
|
+
t = op;
|
|
9895
|
+
break;
|
|
9896
|
+
}
|
|
9897
|
+
if (t && _.label < t[2]) {
|
|
9898
|
+
_.label = t[2];
|
|
9899
|
+
_.ops.push(op);
|
|
9900
|
+
break;
|
|
9901
|
+
}
|
|
9902
|
+
if (t[2]) _.ops.pop();
|
|
9903
|
+
_.trys.pop();
|
|
9904
|
+
continue;
|
|
9905
|
+
}
|
|
9906
|
+
op = body.call(thisArg, _);
|
|
9907
|
+
} catch (e) {
|
|
9908
|
+
op = [
|
|
9909
|
+
6,
|
|
9910
|
+
e
|
|
9911
|
+
];
|
|
9912
|
+
y = 0;
|
|
9913
|
+
} finally{
|
|
9914
|
+
f = t = 0;
|
|
9915
|
+
}
|
|
9916
|
+
if (op[0] & 5) throw op[1];
|
|
9917
|
+
return {
|
|
9918
|
+
value: op[0] ? op[1] : void 0,
|
|
9919
|
+
done: true
|
|
9920
|
+
};
|
|
9921
|
+
}
|
|
9922
|
+
}
|
|
9923
|
+
/**
|
|
9924
|
+
* 语音广播控件
|
|
9925
|
+
*
|
|
9926
|
+
* 用于触发语音广播功能的按钮控件
|
|
9927
|
+
*
|
|
9928
|
+
* @category Control
|
|
9929
|
+
*/ var Broadcast = /*#__PURE__*/ function(Control) {
|
|
9930
|
+
_inherits$b(Broadcast, Control);
|
|
9931
|
+
function Broadcast(options) {
|
|
9932
|
+
var _this;
|
|
9933
|
+
_this = Control.call(this, _extends$a({}, options, {
|
|
9934
|
+
tagName: 'span',
|
|
9935
|
+
controlType: 'button',
|
|
9936
|
+
classNameSuffix: 'broadcast'
|
|
9937
|
+
})) || this;
|
|
9938
|
+
_this._options = options;
|
|
9939
|
+
_this._render();
|
|
9940
|
+
_this.on(EVENTS.broadcastChange, function(active) {
|
|
9941
|
+
if (_this.active !== active) {
|
|
9942
|
+
_this.active = active;
|
|
9943
|
+
_this._render();
|
|
9944
|
+
}
|
|
9945
|
+
});
|
|
9946
|
+
return _this;
|
|
9947
|
+
}
|
|
9948
|
+
var _proto = Broadcast.prototype;
|
|
9949
|
+
_proto._render = function _render() {
|
|
9298
9950
|
var _this_locale;
|
|
9299
|
-
this.$container.innerHTML = IconComponents.
|
|
9300
|
-
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.
|
|
9951
|
+
this.$container.innerHTML = IconComponents.broadcast({
|
|
9952
|
+
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_BROADCAST
|
|
9301
9953
|
});
|
|
9302
9954
|
};
|
|
9303
|
-
|
|
9304
|
-
* 渲染计时器
|
|
9305
|
-
*/ _proto._renderTimer = function _renderTimer() {
|
|
9306
|
-
var _this = this;
|
|
9307
|
-
var _this__options_rootContainer, _this__options;
|
|
9308
|
-
this._timerNode = document.createElement('span');
|
|
9309
|
-
this._timerNode.className = "" + PREFIX_CLASS + "-record-timer";
|
|
9310
|
-
(_this__options = this._options) == null ? void 0 : (_this__options_rootContainer = _this__options.rootContainer) == null ? void 0 : _this__options_rootContainer.appendChild(this._timerNode);
|
|
9311
|
-
this._timerNode.innerHTML = IconComponents.recordCircle() + '<span class="' + PREFIX_CLASS + '-record-timer-time">' + formatTime(this._seconds) + "<span>";
|
|
9312
|
-
var $time = this._timerNode.querySelector("." + PREFIX_CLASS + "-record-timer-time");
|
|
9313
|
-
this._timer = setInterval(function() {
|
|
9314
|
-
_this._seconds++;
|
|
9315
|
-
if (_this._seconds >= _this._options.maxDuration) {
|
|
9316
|
-
// 录制时长不能超过一个小时, 因为录制的数据需要占用浏览器内存
|
|
9317
|
-
_this._destroyTimer();
|
|
9318
|
-
return;
|
|
9319
|
-
}
|
|
9320
|
-
if ($time) $time.innerHTML = "" + formatTime(_this._seconds);
|
|
9321
|
-
}, 1000);
|
|
9322
|
-
};
|
|
9323
|
-
_proto.reset = function reset() {
|
|
9955
|
+
_proto.reset = function reset(hide) {
|
|
9324
9956
|
if (this.active) {
|
|
9325
9957
|
this.active = false;
|
|
9326
|
-
|
|
9958
|
+
this._render();
|
|
9959
|
+
this.emit(EVENTS.control.broadcastChange, false);
|
|
9960
|
+
Control.prototype.reset.call(this, hide);
|
|
9327
9961
|
}
|
|
9328
9962
|
};
|
|
9329
|
-
_proto.destroy = function destroy() {
|
|
9330
|
-
this._destroyTimer();
|
|
9331
|
-
Control.prototype.destroy.call(this);
|
|
9332
|
-
};
|
|
9333
9963
|
/**
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
this.
|
|
9337
|
-
|
|
9338
|
-
clearInterval(this._timer);
|
|
9339
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9340
|
-
this._timer = null;
|
|
9341
|
-
}
|
|
9342
|
-
if (this._timerNode) {
|
|
9343
|
-
this._timerNode.remove();
|
|
9344
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9345
|
-
this._timerNode = null;
|
|
9964
|
+
* 销毁语音广播控件
|
|
9965
|
+
*/ _proto.destroy = function destroy() {
|
|
9966
|
+
if (this.active) {
|
|
9967
|
+
this.reset();
|
|
9346
9968
|
}
|
|
9347
|
-
this
|
|
9969
|
+
Control.prototype.destroy.call(this);
|
|
9348
9970
|
};
|
|
9349
9971
|
/**
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
this
|
|
9353
|
-
|
|
9972
|
+
* 点击 Control 会触发
|
|
9973
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9974
|
+
var _this = this, _superprop_get__onControlClick = function() {
|
|
9975
|
+
return Control.prototype._onControlClick;
|
|
9976
|
+
};
|
|
9977
|
+
return _async_to_generator$3(function() {
|
|
9978
|
+
var _this__options_onChange, _this__options;
|
|
9979
|
+
return _ts_generator$3(this, function(_state) {
|
|
9980
|
+
_superprop_get__onControlClick().call(_this, e);
|
|
9981
|
+
this.active = !this.active;
|
|
9982
|
+
this.emit(EVENTS.control.broadcastChange, this.active);
|
|
9983
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, this.active);
|
|
9984
|
+
this._render();
|
|
9985
|
+
return [
|
|
9986
|
+
2
|
|
9987
|
+
];
|
|
9988
|
+
});
|
|
9989
|
+
}).call(this);
|
|
9354
9990
|
};
|
|
9355
|
-
|
|
9356
|
-
{
|
|
9357
|
-
key: "active",
|
|
9358
|
-
get: /**
|
|
9359
|
-
* 是否激活
|
|
9360
|
-
*/ function get() {
|
|
9361
|
-
return this._active;
|
|
9362
|
-
},
|
|
9363
|
-
set: function set(active) {
|
|
9364
|
-
if (this._disabled && !this._active) {
|
|
9365
|
-
// 不允许禁用情况下激活
|
|
9366
|
-
return;
|
|
9367
|
-
}
|
|
9368
|
-
if (this._active !== active) {
|
|
9369
|
-
this._active = active;
|
|
9370
|
-
this._updateActiveState(active);
|
|
9371
|
-
if (this.active) {
|
|
9372
|
-
this._renderTimer();
|
|
9373
|
-
} else {
|
|
9374
|
-
this._destroyTimer();
|
|
9375
|
-
}
|
|
9376
|
-
this.emit(EVENTS.control.recordingChange, this._active);
|
|
9377
|
-
}
|
|
9378
|
-
}
|
|
9379
|
-
}
|
|
9380
|
-
]);
|
|
9381
|
-
return Record;
|
|
9991
|
+
return Broadcast;
|
|
9382
9992
|
}(Control);
|
|
9383
9993
|
|
|
9384
9994
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -9410,19 +10020,6 @@
|
|
|
9410
10020
|
});
|
|
9411
10021
|
};
|
|
9412
10022
|
}
|
|
9413
|
-
function _defineProperties$2(target, props) {
|
|
9414
|
-
for(var i = 0; i < props.length; i++){
|
|
9415
|
-
var descriptor = props[i];
|
|
9416
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
9417
|
-
descriptor.configurable = true;
|
|
9418
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
9419
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
9420
|
-
}
|
|
9421
|
-
}
|
|
9422
|
-
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
9423
|
-
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
9424
|
-
return Constructor;
|
|
9425
|
-
}
|
|
9426
10023
|
function _extends$9() {
|
|
9427
10024
|
_extends$9 = Object.assign || function(target) {
|
|
9428
10025
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -9549,74 +10146,66 @@
|
|
|
9549
10146
|
}
|
|
9550
10147
|
}
|
|
9551
10148
|
/**
|
|
9552
|
-
*
|
|
10149
|
+
* AI对话框控件
|
|
9553
10150
|
*
|
|
9554
|
-
*
|
|
9555
|
-
* 成功后会resolve回调一个 MediaStream 对象。若用户拒绝了使用权限,或者需要的媒体源不可用,
|
|
9556
|
-
* promise会reject回调一个 PermissionDeniedError 或者 NotFoundError 。
|
|
10151
|
+
* 用于触发AI对话框功能的按钮控件
|
|
9557
10152
|
*
|
|
9558
10153
|
* @category Control
|
|
9559
|
-
*/ var
|
|
9560
|
-
_inherits$a(
|
|
9561
|
-
function
|
|
10154
|
+
*/ var AIChat = /*#__PURE__*/ function(Control) {
|
|
10155
|
+
_inherits$a(AIChat, Control);
|
|
10156
|
+
function AIChat(options) {
|
|
9562
10157
|
var _this;
|
|
9563
10158
|
_this = Control.call(this, _extends$9({}, options, {
|
|
9564
10159
|
tagName: 'span',
|
|
9565
10160
|
controlType: 'button',
|
|
9566
|
-
classNameSuffix: '
|
|
9567
|
-
})) || this
|
|
10161
|
+
classNameSuffix: 'aichat'
|
|
10162
|
+
})) || this;
|
|
9568
10163
|
_this._options = options;
|
|
9569
10164
|
_this._render();
|
|
9570
|
-
_this.on(EVENTS.
|
|
9571
|
-
if (_this.active !==
|
|
9572
|
-
_this.active =
|
|
10165
|
+
_this.on(EVENTS.aichatChange, function(active) {
|
|
10166
|
+
if (_this.active !== active) {
|
|
10167
|
+
_this.active = active;
|
|
9573
10168
|
_this._render();
|
|
9574
10169
|
}
|
|
9575
10170
|
});
|
|
9576
|
-
_this.on(EVENTS.talkVolumeChange, function(value) {
|
|
9577
|
-
var _this__options_onChange, _this__options;
|
|
9578
|
-
_this.value = value;
|
|
9579
|
-
(_this__options = _this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, value);
|
|
9580
|
-
});
|
|
9581
10171
|
return _this;
|
|
9582
10172
|
}
|
|
9583
|
-
var _proto =
|
|
10173
|
+
var _proto = AIChat.prototype;
|
|
9584
10174
|
_proto._render = function _render() {
|
|
9585
|
-
var _this_locale
|
|
9586
|
-
this.$container.innerHTML =
|
|
9587
|
-
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.
|
|
9588
|
-
}) : IconComponents.talk({
|
|
9589
|
-
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_TALK
|
|
10175
|
+
var _this_locale;
|
|
10176
|
+
this.$container.innerHTML = IconComponents.aiChat({
|
|
10177
|
+
title: (_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_AICHAT
|
|
9590
10178
|
});
|
|
9591
10179
|
};
|
|
9592
10180
|
_proto.reset = function reset(hide) {
|
|
9593
10181
|
if (this.active) {
|
|
9594
|
-
this._value = 0;
|
|
9595
10182
|
this.active = false;
|
|
9596
10183
|
this._render();
|
|
9597
|
-
this.emit(EVENTS.control.
|
|
10184
|
+
this.emit(EVENTS.control.aichatChange, false);
|
|
9598
10185
|
Control.prototype.reset.call(this, hide);
|
|
9599
10186
|
}
|
|
9600
10187
|
};
|
|
9601
10188
|
/**
|
|
9602
|
-
|
|
9603
|
-
|
|
10189
|
+
* 销毁AI对话框控件
|
|
10190
|
+
*/ _proto.destroy = function destroy() {
|
|
9604
10191
|
if (this.active) {
|
|
9605
10192
|
this.reset();
|
|
9606
10193
|
}
|
|
9607
10194
|
Control.prototype.destroy.call(this);
|
|
9608
10195
|
};
|
|
9609
10196
|
/**
|
|
9610
|
-
|
|
9611
|
-
|
|
10197
|
+
* 点击 Control 会触发
|
|
10198
|
+
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9612
10199
|
var _this = this, _superprop_get__onControlClick = function() {
|
|
9613
10200
|
return Control.prototype._onControlClick;
|
|
9614
10201
|
};
|
|
9615
10202
|
return _async_to_generator$2(function() {
|
|
10203
|
+
var _this__options_onChange, _this__options;
|
|
9616
10204
|
return _ts_generator$2(this, function(_state) {
|
|
9617
10205
|
_superprop_get__onControlClick().call(_this, e);
|
|
9618
10206
|
this.active = !this.active;
|
|
9619
|
-
this.emit(EVENTS.control.
|
|
10207
|
+
this.emit(EVENTS.control.aichatChange, this.active);
|
|
10208
|
+
(_this__options = this._options) == null ? void 0 : (_this__options_onChange = _this__options.onChange) == null ? void 0 : _this__options_onChange.call(_this__options, this.active);
|
|
9620
10209
|
this._render();
|
|
9621
10210
|
return [
|
|
9622
10211
|
2
|
|
@@ -9624,44 +10213,7 @@
|
|
|
9624
10213
|
});
|
|
9625
10214
|
}).call(this);
|
|
9626
10215
|
};
|
|
9627
|
-
|
|
9628
|
-
{
|
|
9629
|
-
key: "value",
|
|
9630
|
-
get: /**
|
|
9631
|
-
* 获取当前值
|
|
9632
|
-
*/ function get() {
|
|
9633
|
-
return this._value;
|
|
9634
|
-
},
|
|
9635
|
-
set: /**
|
|
9636
|
-
* 设置当前值 [0-1]
|
|
9637
|
-
*/ function set(value) {
|
|
9638
|
-
// 没有激活状态,则不处理
|
|
9639
|
-
if (!this.active) {
|
|
9640
|
-
return;
|
|
9641
|
-
}
|
|
9642
|
-
if (value < 0 || value > 1) {
|
|
9643
|
-
return;
|
|
9644
|
-
}
|
|
9645
|
-
this._value = value;
|
|
9646
|
-
var gainType = 'silent';
|
|
9647
|
-
if (value > 0 && value < 0.25) {
|
|
9648
|
-
gainType = 'low';
|
|
9649
|
-
} else if (value >= 0.25 && value < 0.5) {
|
|
9650
|
-
gainType = 'normal';
|
|
9651
|
-
} else if (value >= 0.5 && value < 0.75) {
|
|
9652
|
-
gainType = 'high';
|
|
9653
|
-
} else if (value >= 0.75) {
|
|
9654
|
-
gainType = 'deafening';
|
|
9655
|
-
}
|
|
9656
|
-
var className = Array.from(this.$container.classList).find(function(className) {
|
|
9657
|
-
return className.startsWith("" + PREFIX_CLASS + "-talk-gain-");
|
|
9658
|
-
});
|
|
9659
|
-
if (className) this.$container.classList.remove(className);
|
|
9660
|
-
this.$container.classList.add(PREFIX_CLASS + "-talk-gain-" + gainType);
|
|
9661
|
-
}
|
|
9662
|
-
}
|
|
9663
|
-
]);
|
|
9664
|
-
return Talk;
|
|
10216
|
+
return AIChat;
|
|
9665
10217
|
}(Control);
|
|
9666
10218
|
|
|
9667
10219
|
function _defineProperties$1(target, props) {
|
|
@@ -10258,8 +10810,26 @@
|
|
|
10258
10810
|
return Speed;
|
|
10259
10811
|
}(Select);
|
|
10260
10812
|
|
|
10813
|
+
var dist$3 = {};
|
|
10814
|
+
|
|
10261
10815
|
var dist$2 = {};
|
|
10262
10816
|
|
|
10817
|
+
/*
|
|
10818
|
+
* @ezuikit/utils-tools v2.0.2
|
|
10819
|
+
* tools utils
|
|
10820
|
+
* Copyright (c) 2026-01-05 Ezviz-OpenBiz
|
|
10821
|
+
* Released under the MIT License.
|
|
10822
|
+
*/
|
|
10823
|
+
|
|
10824
|
+
var hasRequiredDist$3;
|
|
10825
|
+
|
|
10826
|
+
function requireDist$3 () {
|
|
10827
|
+
if (hasRequiredDist$3) return dist$2;
|
|
10828
|
+
hasRequiredDist$3 = 1;
|
|
10829
|
+
var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1]);}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","");}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return {}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return (it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return "Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done: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 DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else {if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"");}for(var _step,result=format,_iterator=_create_for_of_iterator_helper_loose([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return (date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn);}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return /^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){ void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return "second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();dist$2.DateTime=DateTime,dist$2.addVc=function(url,codecs){ void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return query=(query||"").split("&").filter(function(item){return !/^vc=\d?/.test(item)}).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$2.getQuery=getQuery,dist$2.getStaticPath=function(path,base){ void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return "";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$2.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$2.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$2.isRealMobile=function(agent){var _navigator,ua=(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent).toLowerCase();if(/ipad|tablet|playbook|silk|android(?!.*mobile)/i.test(ua))return false;var hasTouch="ontouchstart"in window||navigator.maxTouchPoints>0;return /android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua)&&hasTouch},dist$2.parseEzopenUrl=parseEzopenUrl,dist$2.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$2.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return ""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"");}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search};
|
|
10830
|
+
return dist$2;
|
|
10831
|
+
}
|
|
10832
|
+
|
|
10263
10833
|
/*
|
|
10264
10834
|
* @ezuikit/control-date-picker v1.0.5
|
|
10265
10835
|
* Copyright (c) 2026-01-05 Ezviz-OpenBiz
|
|
@@ -10269,10 +10839,10 @@
|
|
|
10269
10839
|
var hasRequiredDist$2;
|
|
10270
10840
|
|
|
10271
10841
|
function requireDist$2 () {
|
|
10272
|
-
if (hasRequiredDist$2) return dist$
|
|
10842
|
+
if (hasRequiredDist$2) return dist$3;
|
|
10273
10843
|
hasRequiredDist$2 = 1;
|
|
10274
|
-
var delegate=requireDelegate(),utilsTools=requireDist$7(),deepmerge=requireCjs(),Picker=requireDist$8(),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",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",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.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(){this.$header&&this.$header.remove();},_proto._eventListeners=function(){var _this=this;_this.$header&&(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);}),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);}),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);}),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);}),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());}),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$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$2.apply(this,arguments)}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.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$2({},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.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=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$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 _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _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$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$3(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?utilsTools.DateTime.toDate(date):date,(!this._current||utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,utilsTools.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=utilsTools.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 utilsTools.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&utilsTools.DateTime.format(this._renderCurrent,"YYYY-MM")!==utilsTools.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _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,utilsTools.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;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),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=utilsTools.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&&utilsTools.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(utilsTools.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$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);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}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=utilsTools.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$2(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=utilsTools.DateTime.toDate(d));var current=d;this._current&&utilsTools.DateTime.format(current,"YYYY-MM-DD")===utilsTools.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,utilsTools.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&&utilsTools.DateTime.format(date,"YYYY")!==utilsTools.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=utilsTools.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;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=utilsTools.DateTime.toDate(utilsTools.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,utilsTools.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=utilsTools.DateTime.toDate(year+utilsTools.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=utilsTools.DateTime.toDate(year+utilsTools.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;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=utilsTools.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+utilsTools.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,utilsTools.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(utilsTools.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$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);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 _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{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$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?utilsTools.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&&utilsTools.DateTime.format(_year,"YYYY-MM-DD")===utilsTools.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;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=utilsTools.DateTime.toDate(utilsTools.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,utilsTools.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(utilsTools.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(utilsTools.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((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(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({},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&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===utilsTools.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({},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&&utilsTools.DateTime.format(_this._current,"YYYY-MM")===utilsTools.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({},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&&utilsTools.DateTime.format(_this._current,"YYYY")===utilsTools.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&&utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.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(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);dist$2.Calendar=Calendar,dist$2.DatePicker=DatePicker,dist$2.Header=Header,dist$2.Month=Month,dist$2.Year=Year;
|
|
10275
|
-
return dist$
|
|
10844
|
+
var delegate=requireDelegate(),utilsTools=requireDist$3(),deepmerge=requireCjs(),Picker=requireDist$a(),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",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",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.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(){this.$header&&this.$header.remove();},_proto._eventListeners=function(){var _this=this;_this.$header&&(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);}),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);}),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);}),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);}),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());}),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$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$2.apply(this,arguments)}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.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$2({},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.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=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$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 _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _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$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$3(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?utilsTools.DateTime.toDate(date):date,(!this._current||utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,utilsTools.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=utilsTools.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 utilsTools.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate());},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&utilsTools.DateTime.format(this._renderCurrent,"YYYY-MM")!==utilsTools.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate());},_proto._onCell=function(){var _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,utilsTools.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;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent);}),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=utilsTools.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&&utilsTools.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(utilsTools.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$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);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}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=utilsTools.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$2(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=utilsTools.DateTime.toDate(d));var current=d;this._current&&utilsTools.DateTime.format(current,"YYYY-MM-DD")===utilsTools.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,utilsTools.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&&utilsTools.DateTime.format(date,"YYYY")!==utilsTools.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=utilsTools.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;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=utilsTools.DateTime.toDate(utilsTools.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,utilsTools.DateTime.format(newDate,"YYYY-MM"),disabled);});},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=utilsTools.DateTime.toDate(year+utilsTools.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=utilsTools.DateTime.toDate(year+utilsTools.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;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=utilsTools.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+utilsTools.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,utilsTools.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(utilsTools.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$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);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 _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{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$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?utilsTools.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&&utilsTools.DateTime.format(_year,"YYYY-MM-DD")===utilsTools.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;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=utilsTools.DateTime.toDate(utilsTools.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,utilsTools.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(utilsTools.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(utilsTools.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ");},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:false,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return (_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((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(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({},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&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===utilsTools.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({},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&&utilsTools.DateTime.format(_this._current,"YYYY-MM")===utilsTools.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({},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&&utilsTools.DateTime.format(_this._current,"YYYY")===utilsTools.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&&utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.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(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);dist$3.Calendar=Calendar,dist$3.DatePicker=DatePicker,dist$3.Header=Header,dist$3.Month=Month,dist$3.Year=Year;
|
|
10845
|
+
return dist$3;
|
|
10276
10846
|
}
|
|
10277
10847
|
|
|
10278
10848
|
var distExports$1 = requireDist$2();
|
|
@@ -10902,7 +11472,7 @@
|
|
|
10902
11472
|
function requireDist () {
|
|
10903
11473
|
if (hasRequiredDist) return dist$1;
|
|
10904
11474
|
hasRequiredDist = 1;
|
|
10905
|
-
var deepmerge=requireCjs(),I18n=requireDist$6(),Picker=requireDist$8(),utilsTools=requireDist$7(),DragScroll=requireDist$1(),delegate=requireDelegate(),_$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:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=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=utilsTools.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=utilsTools.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?utilsTools.DateTime.fillZero(minute)+"'":"0'")+utilsTools.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" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$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 xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',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(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}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}!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(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1({},record,{startTime:utilsTools.DateTime.format(record.startTime,"HH:mm:ss"),endTime:utilsTools.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:utilsTools.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:utilsTools.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(utilsTools.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: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&_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"}):""+utilsTools.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:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),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: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar: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=utilsTools.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(utilsTools.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="'+utilsTools.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+utilsTools.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+utilsTools.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,utilsTools.DateTime.fillZero(Math.floor(second/3600))+":"+utilsTools.DateTime.fillZero(Math.floor(second%3600/60))+":"+utilsTools.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 _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},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._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(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.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:utilsTools.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,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*curScaleTime),"YYYY-MM-DD")).getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.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-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.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._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,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("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=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;}},_create_class(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,dist$1.BaseTimeLine=BaseTimeLine,dist$1.MobileTimeLine=MobileTimeLine,dist$1.TimeLine=TimeLine;
|
|
11475
|
+
var deepmerge=requireCjs(),I18n=requireDist$8(),Picker=requireDist$a(),utilsTools=requireDist$3(),DragScroll=requireDist$1(),delegate=requireDelegate(),_$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:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=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=utilsTools.DateTime.toDate(end))?void 0:_DateTime_toDate.getTime())-(null==(_DateTime_toDate1=utilsTools.DateTime.toDate(start))?void 0:_DateTime_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return (minute>0?utilsTools.DateTime.fillZero(minute)+"'":"0'")+utilsTools.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" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$TIMELINE_ICONS$__minus='\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n ',_$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 xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',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(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}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}!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(subClass,superClass);}(MobileTimeLine,BaseTimeLine);var _proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly);},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot());},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map(function(record){return _extends$1({},record,{startTime:utilsTools.DateTime.format(record.startTime,"HH:mm:ss"),endTime:utilsTools.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:utilsTools.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:utilsTools.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(utilsTools.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: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&_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"}):""+utilsTools.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:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>';}),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),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: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip">'+_$TIMELINE_ICONS$__tip+'</span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar: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=utilsTools.DateTime.format(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})];}),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return [];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter(function(item){var _$start=TimeLineUtil.timeToSecond(utilsTools.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="'+utilsTools.DateTime.format(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+utilsTools.DateTime.format(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+utilsTools.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,utilsTools.DateTime.fillZero(Math.floor(second/3600))+":"+utilsTools.DateTime.fillZero(Math.floor(second%3600/60))+":"+utilsTools.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 _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),Object.defineProperty(target,descriptor.key,descriptor);}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key]);}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:true},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._isCtrlKeyDown=false,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}}),superClass&&_set_prototype_of(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.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener();},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw();},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth});},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections});},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:utilsTools.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,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray)&&(this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])));this._draw();},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"));},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null;}catch(e){}BaseTimeLine.prototype.destroy.call(this);},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale();},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*curScaleTime),"YYYY-MM-DD")).getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing){0===(leftLastScaleTime-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.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-Math.floor(utilsTools.DateTime.toDate(utilsTools.DateTime.format(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")).getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(utilsTools.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._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor);},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore());},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!==86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr));}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr));}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return {x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map(function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})}))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr);}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",function(e){e.preventDefault();},{passive:false}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,false),document.addEventListener("keyup",this._ctrlKeyUpFun,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("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun));},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=true,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current));},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=true);},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=false,this._moveEndOrTouchEndFun(e));},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e);},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else {var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update();}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly;},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=true);},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=false);},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=true,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=true,this._mousePosition=touch.clientX;}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches));},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX);}else if(2===e.touches.length){this._getTouchDistance(e.touches);this._lastTouchDist;}},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e);},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=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;}},_create_class(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,dist$1.BaseTimeLine=BaseTimeLine,dist$1.MobileTimeLine=MobileTimeLine,dist$1.TimeLine=TimeLine;
|
|
10906
11476
|
return dist$1;
|
|
10907
11477
|
}
|
|
10908
11478
|
|
|
@@ -11146,6 +11716,8 @@
|
|
|
11146
11716
|
ptz: Ptz,
|
|
11147
11717
|
record: Record,
|
|
11148
11718
|
talk: Talk,
|
|
11719
|
+
broadcast: Broadcast,
|
|
11720
|
+
aiChat: AIChat,
|
|
11149
11721
|
zoom: Zoom$1,
|
|
11150
11722
|
definition: Definition,
|
|
11151
11723
|
fullscreen: Fullscreen,
|
|
@@ -12253,7 +12825,7 @@
|
|
|
12253
12825
|
_inherits(Theme, EventEmitter);
|
|
12254
12826
|
function Theme(options) {
|
|
12255
12827
|
var _this;
|
|
12256
|
-
var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1;
|
|
12828
|
+
var _this_options_volumeOptions, _this_options_volumeOptions1, _this_options_speedOptions, _this_options, _this_options1, _this_options2, _this_options3;
|
|
12257
12829
|
_this = EventEmitter.call(this) || this, /** 播放器配置项 */ _this.options = THEME_DEFAULT_OPTIONS, _this.staticPath = '', /** 所有控件列表, 所有控件名称规则(`${iconId}Control`), 如音量控件 this.controls["volumeControl"] @since 0.0.1 */ _this.controls = {}, /**
|
|
12258
12830
|
* @since 0.0.1
|
|
12259
12831
|
* @private
|
|
@@ -12304,7 +12876,7 @@
|
|
|
12304
12876
|
_this.playing = true;
|
|
12305
12877
|
}
|
|
12306
12878
|
_this._initClassName();
|
|
12307
|
-
// 画布需要渲染在 this.contentControl.$
|
|
12879
|
+
// 画布需要渲染在 this.contentControl.$content 内
|
|
12308
12880
|
_this.contentControl = new Content({
|
|
12309
12881
|
getContainer: function() {
|
|
12310
12882
|
return _this.$container;
|
|
@@ -12339,7 +12911,8 @@
|
|
|
12339
12911
|
'flv',
|
|
12340
12912
|
'hls',
|
|
12341
12913
|
'mp4'
|
|
12342
|
-
].includes(options.type) ?
|
|
12914
|
+
].includes(options.type) ? ((_this_options = _this.options) == null ? void 0 : _this_options.themeData) !== undefined ? (_this_options1 = _this.options) == null ? void 0 : _this_options1.themeData : LiveTemplate // 标准流仅支持 null 和 LiveTemplate (支持自定义 2026-01-19)
|
|
12915
|
+
: (_ref3 = (_this_options_template = (_this_options2 = _this.options) == null ? void 0 : _this_options2.template) != null ? _this_options_template : (_this_options3 = _this.options) == null ? void 0 : _this_options3.themeData) != null ? _ref3 : null);
|
|
12343
12916
|
_this._addEventListener();
|
|
12344
12917
|
_themeEventemitter(_this);
|
|
12345
12918
|
return _this;
|
|
@@ -12864,138 +13437,153 @@
|
|
|
12864
13437
|
* 尺寸变化结束时 进行判断,为了节省开销
|
|
12865
13438
|
* @WARN:这里会闪一下, 原因:需要控件渲染后才知是否需要放置到 More 中,
|
|
12866
13439
|
*/ _proto._footerMoreControlShow = function _footerMoreControlShow() {
|
|
13440
|
+
this._displayMore();
|
|
13441
|
+
};
|
|
13442
|
+
_proto._displayMore = function _displayMore() {
|
|
12867
13443
|
var _this = this;
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
12897
|
-
}
|
|
12898
|
-
});
|
|
12899
|
-
}
|
|
12900
|
-
//
|
|
12901
|
-
var list = (((_this__themeData = _this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
12902
|
-
var _this__footerMoreControl;
|
|
12903
|
-
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
12904
|
-
var _this_controls;
|
|
12905
|
-
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
12906
|
-
});
|
|
12907
|
-
return index === -1;
|
|
12908
|
-
});
|
|
12909
|
-
if (list.length <= 0) {
|
|
12910
|
-
return;
|
|
12911
|
-
}
|
|
12912
|
-
if (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
12913
|
-
// 为什么是两个, 因为More 也占用一个位置
|
|
12914
|
-
var popList = [
|
|
12915
|
-
list.pop(),
|
|
12916
|
-
list.pop()
|
|
12917
|
-
];
|
|
12918
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
12919
|
-
var item = _step.value;
|
|
12920
|
-
if (item) {
|
|
12921
|
-
var _this_controls_key_resetPopupContainer, _this_controls_key, _this_controls, _this_controls1, _this__footerMoreControl2;
|
|
12922
|
-
var key = "" + item.iconId + "Control";
|
|
12923
|
-
(_this_controls = _this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key, _this._footerMoreControl.$panel, 'prepend');
|
|
12924
|
-
(_this__footerMoreControl2 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls1 = _this.controls) == null ? void 0 : _this_controls1[key]);
|
|
12925
|
-
}
|
|
13444
|
+
if (this._footer) {
|
|
13445
|
+
var _this__footer_$left, _this__footer_$right;
|
|
13446
|
+
// 判断 footer 的控件是否能放置的下, 否则隐藏暂时 more 按钮
|
|
13447
|
+
var leftWidth = ((_this__footer_$left = this._footer.$left) == null ? void 0 : _this__footer_$left.clientWidth) || 0;
|
|
13448
|
+
var rightWidth = ((_this__footer_$right = this._footer.$right) == null ? void 0 : _this__footer_$right.clientWidth) || 0;
|
|
13449
|
+
// 当footer 中 left 和 right 宽度之和大于 footer 宽度,则 footer more 显示
|
|
13450
|
+
var collapseControl = this._width - leftWidth - rightWidth < 16; // 收拢控件到 More 中
|
|
13451
|
+
if (collapseControl) {
|
|
13452
|
+
var _this__footer, _this__themeData_footer, _this__themeData, _this__footerMoreControl_list, _this__footerMoreControl, _this__footerMoreControl_list1, _this__footerMoreControl1;
|
|
13453
|
+
if (!this._footerMoreControl && ((_this__footer = this._footer) == null ? void 0 : _this__footer.$right)) {
|
|
13454
|
+
this._footerMoreControl = new More({
|
|
13455
|
+
language: this.options.language,
|
|
13456
|
+
locales: this.i18n.translations,
|
|
13457
|
+
rootContainer: this.$container,
|
|
13458
|
+
getPopupContainer: function() {
|
|
13459
|
+
var _this__footer;
|
|
13460
|
+
return (_this__footer = _this._footer) == null ? void 0 : _this__footer.$right;
|
|
13461
|
+
},
|
|
13462
|
+
placement: 'tr',
|
|
13463
|
+
controls: this.controls,
|
|
13464
|
+
open: false,
|
|
13465
|
+
offset: [
|
|
13466
|
+
0,
|
|
13467
|
+
-8
|
|
13468
|
+
],
|
|
13469
|
+
wrapClassName: "" + PREFIX_CLASS + "-footer-more",
|
|
13470
|
+
onOpenChange: function(open) {
|
|
13471
|
+
_this.emit(EVENTS.control.footerMorePanelOpenChange, open);
|
|
12926
13472
|
}
|
|
12927
|
-
}
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
13473
|
+
});
|
|
13474
|
+
}
|
|
13475
|
+
//
|
|
13476
|
+
var list = (((_this__themeData = this._themeData) == null ? void 0 : (_this__themeData_footer = _this__themeData.footer) == null ? void 0 : _this__themeData_footer.btnList) || []).filter(function(item) {
|
|
13477
|
+
var _this__footerMoreControl;
|
|
13478
|
+
var index = (((_this__footerMoreControl = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl.list) || []).findIndex(function(item1) {
|
|
13479
|
+
var _this_controls;
|
|
13480
|
+
return item1.control === ((_this_controls = _this.controls) == null ? void 0 : _this_controls["" + item.iconId + "Control"]);
|
|
13481
|
+
});
|
|
13482
|
+
return index === -1;
|
|
13483
|
+
});
|
|
13484
|
+
if (list.length <= 0) return;
|
|
13485
|
+
if (((_this__footerMoreControl = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list = _this__footerMoreControl.list) == null ? void 0 : _this__footerMoreControl_list.length) === 0) {
|
|
13486
|
+
// 为什么是两个, 因为More 也占用一个位置
|
|
13487
|
+
var popList = [
|
|
13488
|
+
list.pop(),
|
|
13489
|
+
list.pop()
|
|
13490
|
+
];
|
|
13491
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(popList), _step; !(_step = _iterator()).done;){
|
|
13492
|
+
var item = _step.value;
|
|
13493
|
+
if (item) {
|
|
13494
|
+
var _this_controls_key_$container, _this_controls_key, _this_controls, _this_controls_key_$container1, _this_controls_key1, _this_controls1, _this_controls_key_resetPopupContainer, _this_controls_key2, _this_controls2, _this_controls3, _this__footerMoreControl2;
|
|
13495
|
+
var key = "" + item.iconId + "Control";
|
|
13496
|
+
var width = ((_this_controls = this.controls) == null ? void 0 : (_this_controls_key = _this_controls[key]) == null ? void 0 : (_this_controls_key_$container = _this_controls_key.$container) == null ? void 0 : _this_controls_key_$container.clientWidth) || 0;
|
|
13497
|
+
var height = ((_this_controls1 = this.controls) == null ? void 0 : (_this_controls_key1 = _this_controls1[key]) == null ? void 0 : (_this_controls_key_$container1 = _this_controls_key1.$container) == null ? void 0 : _this_controls_key_$container1.clientHeight) || 0;
|
|
13498
|
+
(_this_controls2 = this.controls) == null ? void 0 : (_this_controls_key2 = _this_controls2[key]) == null ? void 0 : (_this_controls_key_resetPopupContainer = _this_controls_key2.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer.call(_this_controls_key2, this._footerMoreControl.$panel, 'prepend');
|
|
13499
|
+
(_this__footerMoreControl2 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl2.add(key, item.part, (_this_controls3 = this.controls) == null ? void 0 : _this_controls3[key], {
|
|
13500
|
+
width: width,
|
|
13501
|
+
height: height
|
|
13502
|
+
});
|
|
12936
13503
|
}
|
|
12937
13504
|
}
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
13505
|
+
} else if (this._footerMoreControl) {
|
|
13506
|
+
var item1 = list.pop();
|
|
13507
|
+
if (item1) {
|
|
13508
|
+
var _this_controls_key_$container2, _this_controls_key3, _this_controls4, _this_controls_key_$container3, _this_controls_key4, _this_controls5, _this_controls_key_resetPopupContainer1, _this_controls_key5, _this_controls6, _this_controls7, _this__footerMoreControl3;
|
|
13509
|
+
var key1 = "" + item1.iconId + "Control";
|
|
13510
|
+
var width1 = ((_this_controls4 = this.controls) == null ? void 0 : (_this_controls_key3 = _this_controls4[key1]) == null ? void 0 : (_this_controls_key_$container2 = _this_controls_key3.$container) == null ? void 0 : _this_controls_key_$container2.clientWidth) || 0;
|
|
13511
|
+
var height1 = ((_this_controls5 = this.controls) == null ? void 0 : (_this_controls_key4 = _this_controls5[key1]) == null ? void 0 : (_this_controls_key_$container3 = _this_controls_key4.$container) == null ? void 0 : _this_controls_key_$container3.clientHeight) || 0;
|
|
13512
|
+
(_this_controls6 = this.controls) == null ? void 0 : (_this_controls_key5 = _this_controls6[key1]) == null ? void 0 : (_this_controls_key_resetPopupContainer1 = _this_controls_key5.resetPopupContainer) == null ? void 0 : _this_controls_key_resetPopupContainer1.call(_this_controls_key5, this._footerMoreControl.$panel, 'prepend');
|
|
13513
|
+
(_this__footerMoreControl3 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl3.add(key1, item1.part, (_this_controls7 = this.controls) == null ? void 0 : _this_controls7[key1], {
|
|
13514
|
+
width: width1,
|
|
13515
|
+
height: height1
|
|
13516
|
+
});
|
|
13517
|
+
} else {
|
|
13518
|
+
return;
|
|
12945
13519
|
}
|
|
12946
|
-
}
|
|
12947
|
-
|
|
13520
|
+
}
|
|
13521
|
+
// prettier-ignore
|
|
13522
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl1 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list1 = _this__footerMoreControl1.list) == null ? void 0 : _this__footerMoreControl_list1.map(function(item) {
|
|
13523
|
+
return item.key;
|
|
13524
|
+
}));
|
|
13525
|
+
if (this._footerMoreControl) {
|
|
13526
|
+
// 防止 More 不存在导致死循环
|
|
13527
|
+
this._displayMore();
|
|
13528
|
+
}
|
|
13529
|
+
} else {
|
|
13530
|
+
var _this__footerMoreControl_list2, _this__footerMoreControl5, _this__footerMoreControl_list3, _this__footerMoreControl6;
|
|
13531
|
+
var offset = 50;
|
|
13532
|
+
// if (this._footerMoreControl?.list?.length && this._footerMoreControl?.list?.length > 2) {
|
|
13533
|
+
// offset = 16;
|
|
13534
|
+
// }
|
|
13535
|
+
if ((_this__footerMoreControl5 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list2 = _this__footerMoreControl5.list) == null ? void 0 : _this__footerMoreControl_list2.length) {
|
|
13536
|
+
offset = offset + this._footerMoreControl.list[0].width || 0;
|
|
13537
|
+
}
|
|
13538
|
+
if (((_this__footerMoreControl6 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list3 = _this__footerMoreControl6.list) == null ? void 0 : _this__footerMoreControl_list3.length) && this._width - leftWidth - rightWidth > offset) {
|
|
13539
|
+
var _this__footerMoreControl7, _this__footerMoreControl_list4, _this__footerMoreControl8, _this__footerMoreControl_list5, _this__footerMoreControl9;
|
|
12948
13540
|
// 110 是为了保住个别控件的宽度超出已知的值, 如英文下 按钮的宽度
|
|
12949
13541
|
// 从 More 中一次移除一个控件到 header/footer 中
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
var
|
|
12954
|
-
if (item2) {
|
|
12955
|
-
var
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
var
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
var _item_control_resetPopupContainer2, _item_control2;
|
|
12966
|
-
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, _this._footer.$right, 'before', _this._footerMoreControl.$container);
|
|
12967
|
-
}
|
|
13542
|
+
//
|
|
13543
|
+
var item2 = (_this__footerMoreControl7 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl7.list.shift();
|
|
13544
|
+
if (item2) {
|
|
13545
|
+
var _this__footerMoreControl10;
|
|
13546
|
+
if (item2.part === 'left') {
|
|
13547
|
+
var _item_control_resetPopupContainer, _item_control;
|
|
13548
|
+
(_item_control = item2.control) == null ? void 0 : (_item_control_resetPopupContainer = _item_control.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer.call(_item_control, this._footer.$left, 'append');
|
|
13549
|
+
} else if (item2.part === 'right') {
|
|
13550
|
+
var _this__footerMoreControl_list6, _this__footerMoreControl11;
|
|
13551
|
+
if (((_this__footerMoreControl11 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list6 = _this__footerMoreControl11.list) == null ? void 0 : _this__footerMoreControl_list6.length) === 0) {
|
|
13552
|
+
var _item_control_resetPopupContainer1, _item_control1;
|
|
13553
|
+
(_item_control1 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer1 = _item_control1.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer1.call(_item_control1, this._footer.$right, 'append');
|
|
13554
|
+
} else {
|
|
13555
|
+
var _item_control_resetPopupContainer2, _item_control2;
|
|
13556
|
+
(_item_control2 = item2.control) == null ? void 0 : (_item_control_resetPopupContainer2 = _item_control2.resetPopupContainer) == null ? void 0 : _item_control_resetPopupContainer2.call(_item_control2, this._footer.$right, 'before', this._footerMoreControl.$container);
|
|
12968
13557
|
}
|
|
12969
|
-
(_this__footerMoreControl8 = _this._footerMoreControl) == null ? void 0 : _this__footerMoreControl8.remove(item2.control);
|
|
12970
13558
|
}
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
(
|
|
13559
|
+
(_this__footerMoreControl10 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl10.remove(item2.control);
|
|
13560
|
+
}
|
|
13561
|
+
if (((_this__footerMoreControl8 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list4 = _this__footerMoreControl8.list) == null ? void 0 : _this__footerMoreControl_list4.length) === 1) {
|
|
13562
|
+
var _this__footerMoreControl12, _this__footerMoreControl_destroy, _this__footerMoreControl13;
|
|
13563
|
+
// 最后一个, 移除 More
|
|
13564
|
+
var item11 = (_this__footerMoreControl12 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl12.list.shift();
|
|
13565
|
+
if (item11) {
|
|
13566
|
+
var _this__footerMoreControl14;
|
|
13567
|
+
if (item11.part === 'left') {
|
|
13568
|
+
var _item1_control_resetPopupContainer, _item1_control;
|
|
13569
|
+
(_item1_control = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer = _item1_control.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer.call(_item1_control, this._footer.$left, 'append');
|
|
13570
|
+
} else if (item11.part === 'right') {
|
|
13571
|
+
var _item1_control_resetPopupContainer1, _item1_control1;
|
|
13572
|
+
(_item1_control1 = item11.control) == null ? void 0 : (_item1_control_resetPopupContainer1 = _item1_control1.resetPopupContainer) == null ? void 0 : _item1_control_resetPopupContainer1.call(_item1_control1, this._footer.$right, 'append');
|
|
12985
13573
|
}
|
|
12986
|
-
(
|
|
12987
|
-
_this._footerMoreControl = null;
|
|
13574
|
+
(_this__footerMoreControl14 = this._footerMoreControl) == null ? void 0 : _this__footerMoreControl14.remove(item11.control);
|
|
12988
13575
|
}
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
return item.key;
|
|
12992
|
-
}));
|
|
12993
|
-
displayMore();
|
|
13576
|
+
(_this__footerMoreControl13 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_destroy = _this__footerMoreControl13.destroy) == null ? void 0 : _this__footerMoreControl_destroy.call(_this__footerMoreControl13);
|
|
13577
|
+
this._footerMoreControl = null;
|
|
12994
13578
|
}
|
|
13579
|
+
// prettier-ignore
|
|
13580
|
+
this.emit(Theme.EVENTS.control.footerMoreShowControlsChange, !!this._footerMoreControl, (_this__footerMoreControl9 = this._footerMoreControl) == null ? void 0 : (_this__footerMoreControl_list5 = _this__footerMoreControl9.list) == null ? void 0 : _this__footerMoreControl_list5.map(function(item) {
|
|
13581
|
+
return item.key;
|
|
13582
|
+
}));
|
|
13583
|
+
this._displayMore();
|
|
12995
13584
|
}
|
|
12996
13585
|
}
|
|
12997
|
-
}
|
|
12998
|
-
displayMore();
|
|
13586
|
+
}
|
|
12999
13587
|
};
|
|
13000
13588
|
/**
|
|
13001
13589
|
* 移除事件
|
|
@@ -13073,6 +13661,7 @@
|
|
|
13073
13661
|
[
|
|
13074
13662
|
'ptz',
|
|
13075
13663
|
'talk',
|
|
13664
|
+
'broadcast',
|
|
13076
13665
|
'record',
|
|
13077
13666
|
'speed'
|
|
13078
13667
|
].forEach(function(key) {
|
|
@@ -13150,6 +13739,7 @@
|
|
|
13150
13739
|
[
|
|
13151
13740
|
'ptz',
|
|
13152
13741
|
'talk',
|
|
13742
|
+
'broadcast',
|
|
13153
13743
|
'record'
|
|
13154
13744
|
].forEach(function(key) {
|
|
13155
13745
|
var _this_controls;
|
|
@@ -13510,7 +14100,7 @@
|
|
|
13510
14100
|
zh: zh,
|
|
13511
14101
|
en: en
|
|
13512
14102
|
};
|
|
13513
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.
|
|
14103
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.1.1-beta.1';
|
|
13514
14104
|
|
|
13515
14105
|
// 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
|
|
13516
14106
|
|