easyproctor 2.3.5 → 2.4.0
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 +2 -0
- package/esm/index.js +320 -50
- package/index.js +320 -50
- package/new-flow/checkers/DeviceCheckerService.d.ts +2 -0
- package/package.json +1 -1
- package/unpkg/easyproctor.min.js +220 -35
- package/utils/browserInformations.d.ts +1 -0
package/README.md
CHANGED
package/esm/index.js
CHANGED
|
@@ -9546,6 +9546,35 @@ var getDefaultProctoringVideoOptions = {
|
|
|
9546
9546
|
minHeight: 480
|
|
9547
9547
|
};
|
|
9548
9548
|
|
|
9549
|
+
// src/utils/browserInformations.ts
|
|
9550
|
+
function fnBrowserDetect() {
|
|
9551
|
+
const userAgent = navigator.userAgent;
|
|
9552
|
+
let browserName;
|
|
9553
|
+
if (userAgent.match(/chrome|chromium|crios/i)) {
|
|
9554
|
+
browserName = "chrome";
|
|
9555
|
+
} else if (userAgent.match(/firefox|fxios/i)) {
|
|
9556
|
+
browserName = "firefox";
|
|
9557
|
+
} else if (userAgent.match(/safari/i)) {
|
|
9558
|
+
browserName = "safari";
|
|
9559
|
+
} else if (userAgent.match(/opr\//i)) {
|
|
9560
|
+
browserName = "opera";
|
|
9561
|
+
} else if (userAgent.match(/edg/i)) {
|
|
9562
|
+
browserName = "edge";
|
|
9563
|
+
} else {
|
|
9564
|
+
browserName = "No browser detection";
|
|
9565
|
+
}
|
|
9566
|
+
return browserName;
|
|
9567
|
+
}
|
|
9568
|
+
function isMobileDevice() {
|
|
9569
|
+
if ("userAgentData" in navigator) {
|
|
9570
|
+
const navUAData = navigator.userAgentData;
|
|
9571
|
+
const mobile = navUAData.mobile || false;
|
|
9572
|
+
const platform = navUAData.platform || "";
|
|
9573
|
+
return mobile || /Android|iOS/i.test(platform);
|
|
9574
|
+
}
|
|
9575
|
+
return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
9576
|
+
}
|
|
9577
|
+
|
|
9549
9578
|
// src/plugins/insights.ts
|
|
9550
9579
|
var backendService;
|
|
9551
9580
|
var init = (backend) => {
|
|
@@ -10094,7 +10123,7 @@ var CameraRecorder = class {
|
|
|
10094
10123
|
}
|
|
10095
10124
|
}
|
|
10096
10125
|
async startRecording(options) {
|
|
10097
|
-
var _a2, _b, _c2, _d, _e3, _f, _g;
|
|
10126
|
+
var _a2, _b, _c2, _d, _e3, _f, _g, _h;
|
|
10098
10127
|
if ((((_a2 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _a2.detectPerson) || ((_b = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _b.detectCellPhone) || ((_c2 = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _c2.detectFace)) && !(options == null ? void 0 : options.retry)) {
|
|
10099
10128
|
await this.initializeDetectors();
|
|
10100
10129
|
}
|
|
@@ -10140,9 +10169,26 @@ var CameraRecorder = class {
|
|
|
10140
10169
|
this.recordingStart();
|
|
10141
10170
|
const tracks = this.cameraStream.getVideoTracks();
|
|
10142
10171
|
const settings = tracks[0].getSettings();
|
|
10143
|
-
|
|
10172
|
+
let { width = 0, height = 0 } = settings;
|
|
10173
|
+
const isPortrait = (_d = screen.orientation) == null ? void 0 : _d.type.includes("portrait");
|
|
10174
|
+
if (isPortrait && isMobileDevice()) {
|
|
10175
|
+
if (this.videoOptions.width == height && this.videoOptions.height == width) {
|
|
10176
|
+
[width, height] = [height, width];
|
|
10177
|
+
}
|
|
10178
|
+
}
|
|
10179
|
+
console.log("isPortrait -> ", isPortrait);
|
|
10180
|
+
console.log("this.isMobileDevice() -> ", isMobileDevice());
|
|
10181
|
+
console.log("width -> ", width);
|
|
10182
|
+
console.log("height -> ", height);
|
|
10183
|
+
console.log("minWidth -> ", this.videoOptions.minWidth);
|
|
10184
|
+
console.log("minHeight -> ", this.videoOptions.minHeight);
|
|
10185
|
+
console.log("this.videoOptions.width -> ", this.videoOptions.width);
|
|
10186
|
+
console.log("this.videoOptions.height -> ", this.videoOptions.height);
|
|
10187
|
+
console.log("settings.width -> ", settings.width);
|
|
10188
|
+
console.log("settings.height -> ", settings.height);
|
|
10189
|
+
if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
|
|
10144
10190
|
throw STREAM_UNDER_MINIMUM_PERMITTED;
|
|
10145
|
-
} else if (this.videoOptions.width !==
|
|
10191
|
+
} else if (this.videoOptions.width !== width || this.videoOptions.height !== height) {
|
|
10146
10192
|
trackers.registerAnotherStream(
|
|
10147
10193
|
this.proctoringId,
|
|
10148
10194
|
`Maybe have another stream active
|
|
@@ -10155,11 +10201,11 @@ Setting: ${JSON.stringify(settings, null, 2)}`
|
|
|
10155
10201
|
);
|
|
10156
10202
|
throw ANOTHER_STREAM_ACTIVE;
|
|
10157
10203
|
}
|
|
10158
|
-
((
|
|
10159
|
-
if ((
|
|
10204
|
+
((_e3 = this.paramsConfig.imageBehaviourParameters) == null ? void 0 : _e3.useUploadImage) && this.options.proctoringType == "IMAGE" && this.photoShotsCycle();
|
|
10205
|
+
if ((_f = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _f.detectFace) {
|
|
10160
10206
|
await this.faceDetection.enableCam(this.cameraStream);
|
|
10161
10207
|
}
|
|
10162
|
-
if (((
|
|
10208
|
+
if (((_g = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _g.detectPerson) || ((_h = this.paramsConfig.videoBehaviourParameters) == null ? void 0 : _h.detectCellPhone)) {
|
|
10163
10209
|
await this.objectDetection.enableCam(this.cameraStream);
|
|
10164
10210
|
}
|
|
10165
10211
|
this.filesToUpload = [];
|
|
@@ -10397,11 +10443,17 @@ var DeviceCheckerUI = class {
|
|
|
10397
10443
|
display: inline-block;
|
|
10398
10444
|
width: 22px;
|
|
10399
10445
|
height: 22px;
|
|
10446
|
+
min-width: 22px;
|
|
10447
|
+
max-width: 22px;
|
|
10448
|
+
min-height: 22px;
|
|
10449
|
+
max-height: 22px;
|
|
10450
|
+
flex-shrink: 0;
|
|
10400
10451
|
-ms-transform: rotate(45deg); /* IE 9 */
|
|
10401
10452
|
-webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
|
|
10402
10453
|
transform: rotate(45deg);
|
|
10403
10454
|
border: 1px solid #16A34A;
|
|
10404
10455
|
border-radius: 22px;
|
|
10456
|
+
box-sizing: border-box;
|
|
10405
10457
|
}
|
|
10406
10458
|
|
|
10407
10459
|
.checkmark_stem {
|
|
@@ -10426,11 +10478,17 @@ var DeviceCheckerUI = class {
|
|
|
10426
10478
|
display: inline-block;
|
|
10427
10479
|
width: 22px;
|
|
10428
10480
|
height: 22px;
|
|
10481
|
+
min-width: 22px;
|
|
10482
|
+
max-width: 22px;
|
|
10483
|
+
min-height: 22px;
|
|
10484
|
+
max-height: 22px;
|
|
10485
|
+
flex-shrink: 0;
|
|
10429
10486
|
-ms-transform: rotate(45deg); /* IE 9 */
|
|
10430
10487
|
-webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
|
|
10431
10488
|
transform: rotate(45deg);
|
|
10432
10489
|
border: 1px solid #FF0000;
|
|
10433
10490
|
border-radius: 22px;
|
|
10491
|
+
box-sizing: border-box;
|
|
10434
10492
|
}
|
|
10435
10493
|
|
|
10436
10494
|
.checkmark_stem_error {
|
|
@@ -10481,6 +10539,179 @@ var DeviceCheckerUI = class {
|
|
|
10481
10539
|
left: 5px;
|
|
10482
10540
|
top: 2px;
|
|
10483
10541
|
}
|
|
10542
|
+
|
|
10543
|
+
/* Responsive styles */
|
|
10544
|
+
#checkDevices .modal-responsive {
|
|
10545
|
+
box-sizing: border-box !important;
|
|
10546
|
+
}
|
|
10547
|
+
|
|
10548
|
+
#checkDevices .modal-responsive * {
|
|
10549
|
+
box-sizing: border-box;
|
|
10550
|
+
}
|
|
10551
|
+
|
|
10552
|
+
/* Desktop screens - maintain gap between checks and camera */
|
|
10553
|
+
@media (min-width: 769px) {
|
|
10554
|
+
#checkDevices .modal-responsive .camera-container-responsive {
|
|
10555
|
+
gap: 20px !important;
|
|
10556
|
+
}
|
|
10557
|
+
}
|
|
10558
|
+
|
|
10559
|
+
@media (max-width: 768px) {
|
|
10560
|
+
#checkDevices .modal-responsive {
|
|
10561
|
+
width: 95% !important;
|
|
10562
|
+
max-width: 95% !important;
|
|
10563
|
+
margin: 10px !important;
|
|
10564
|
+
}
|
|
10565
|
+
|
|
10566
|
+
#checkDevices .modal-responsive h3 {
|
|
10567
|
+
font-size: 18px !important;
|
|
10568
|
+
padding: 15px 0px !important;
|
|
10569
|
+
}
|
|
10570
|
+
|
|
10571
|
+
#checkDevices .modal-responsive .camera-header-responsive,
|
|
10572
|
+
#checkDevices .modal-responsive .mic-header-responsive {
|
|
10573
|
+
flex-direction: column !important;
|
|
10574
|
+
gap: 10px !important;
|
|
10575
|
+
align-items: flex-start !important;
|
|
10576
|
+
}
|
|
10577
|
+
|
|
10578
|
+
#checkDevices .modal-responsive .camera-header-responsive select,
|
|
10579
|
+
#checkDevices .modal-responsive .mic-header-responsive select {
|
|
10580
|
+
max-width: 100% !important;
|
|
10581
|
+
width: 100% !important;
|
|
10582
|
+
}
|
|
10583
|
+
|
|
10584
|
+
#checkDevices .modal-responsive .camera-container-responsive {
|
|
10585
|
+
flex-direction: row !important;
|
|
10586
|
+
align-items: flex-start !important;
|
|
10587
|
+
gap: 15px !important;
|
|
10588
|
+
padding-left: 10px !important;
|
|
10589
|
+
padding-right: 10px !important;
|
|
10590
|
+
}
|
|
10591
|
+
|
|
10592
|
+
#checkDevices .modal-responsive .video-responsive {
|
|
10593
|
+
width: auto !important;
|
|
10594
|
+
max-width: 320px !important;
|
|
10595
|
+
flex-shrink: 0 !important;
|
|
10596
|
+
max-height: 240px !important;
|
|
10597
|
+
}
|
|
10598
|
+
|
|
10599
|
+
#checkDevices .modal-responsive .video-responsive video {
|
|
10600
|
+
width: 100% !important;
|
|
10601
|
+
max-width: 320px !important;
|
|
10602
|
+
max-height: 200px !important;
|
|
10603
|
+
height: auto !important;
|
|
10604
|
+
object-fit: contain !important;
|
|
10605
|
+
}
|
|
10606
|
+
|
|
10607
|
+
#checkDevices .modal-responsive .mic-container-responsive {
|
|
10608
|
+
flex-direction: column !important;
|
|
10609
|
+
padding: 0px 20px !important;
|
|
10610
|
+
}
|
|
10611
|
+
|
|
10612
|
+
#checkDevices .modal-responsive .mic-meter-responsive {
|
|
10613
|
+
width: 100% !important;
|
|
10614
|
+
}
|
|
10615
|
+
|
|
10616
|
+
#checkDevices .modal-responsive .range-responsive {
|
|
10617
|
+
width: 100% !important;
|
|
10618
|
+
}
|
|
10619
|
+
|
|
10620
|
+
#checkDevices .modal-responsive .pronounce-responsive {
|
|
10621
|
+
margin-left: 10px !important;
|
|
10622
|
+
margin-right: 10px !important;
|
|
10623
|
+
width: calc(100% - 20px) !important;
|
|
10624
|
+
}
|
|
10625
|
+
|
|
10626
|
+
#checkDevices .modal-responsive .button-responsive {
|
|
10627
|
+
height: 60px !important;
|
|
10628
|
+
font-size: 14px !important;
|
|
10629
|
+
}
|
|
10630
|
+
|
|
10631
|
+
#checkDevices .modal-responsive .divider-responsive {
|
|
10632
|
+
height: 60px !important;
|
|
10633
|
+
}
|
|
10634
|
+
}
|
|
10635
|
+
|
|
10636
|
+
@media (max-width: 480px) {
|
|
10637
|
+
#checkDevices .modal-responsive {
|
|
10638
|
+
width: 98% !important;
|
|
10639
|
+
max-width: 98% !important;
|
|
10640
|
+
border-radius: 8px !important;
|
|
10641
|
+
margin: 5px !important;
|
|
10642
|
+
}
|
|
10643
|
+
|
|
10644
|
+
#checkDevices .modal-responsive .camera-header-responsive,
|
|
10645
|
+
#checkDevices .modal-responsive .mic-header-responsive {
|
|
10646
|
+
gap: 0px !important;
|
|
10647
|
+
}
|
|
10648
|
+
|
|
10649
|
+
#checkDevices .modal-responsive .camera-header-responsive h3,
|
|
10650
|
+
#checkDevices .modal-responsive .mic-header-responsive h3 {
|
|
10651
|
+
margin: 0 !important;
|
|
10652
|
+
margin-top: 0 !important;
|
|
10653
|
+
margin-bottom: 0 !important;
|
|
10654
|
+
margin-left: 0 !important;
|
|
10655
|
+
margin-right: 0 !important;
|
|
10656
|
+
padding: 0 !important;
|
|
10657
|
+
padding-top: 0 !important;
|
|
10658
|
+
padding-bottom: 0 !important;
|
|
10659
|
+
}
|
|
10660
|
+
|
|
10661
|
+
#checkDevices .modal-responsive .camera-header-responsive select,
|
|
10662
|
+
#checkDevices .modal-responsive .mic-header-responsive select {
|
|
10663
|
+
margin: 0 !important;
|
|
10664
|
+
margin-top: 0 !important;
|
|
10665
|
+
margin-bottom: 0 !important;
|
|
10666
|
+
margin-left: 0 !important;
|
|
10667
|
+
margin-right: 0 !important;
|
|
10668
|
+
padding-top: 0 !important;
|
|
10669
|
+
}
|
|
10670
|
+
|
|
10671
|
+
#checkDevices .modal-responsive .camera-container-responsive {
|
|
10672
|
+
flex-direction: row !important;
|
|
10673
|
+
gap: 10px !important;
|
|
10674
|
+
padding-left: 5px !important;
|
|
10675
|
+
padding-right: 5px !important;
|
|
10676
|
+
}
|
|
10677
|
+
|
|
10678
|
+
#checkDevices .modal-responsive .video-responsive {
|
|
10679
|
+
max-width: 200px !important;
|
|
10680
|
+
max-height: 150px !important;
|
|
10681
|
+
}
|
|
10682
|
+
|
|
10683
|
+
#checkDevices .modal-responsive .video-responsive video {
|
|
10684
|
+
max-width: 200px !important;
|
|
10685
|
+
max-height: 150px !important;
|
|
10686
|
+
}
|
|
10687
|
+
|
|
10688
|
+
#checkDevices .modal-responsive .pronounce-responsive {
|
|
10689
|
+
margin-left: 5px !important;
|
|
10690
|
+
margin-right: 5px !important;
|
|
10691
|
+
width: calc(100% - 10px) !important;
|
|
10692
|
+
padding: 0 5px !important;
|
|
10693
|
+
}
|
|
10694
|
+
|
|
10695
|
+
#checkDevices .modal-responsive h3 {
|
|
10696
|
+
font-size: 16px !important;
|
|
10697
|
+
padding: 12px 0px !important;
|
|
10698
|
+
margin-bottom: 10px !important;
|
|
10699
|
+
}
|
|
10700
|
+
|
|
10701
|
+
#checkDevices .modal-responsive .camera-header-responsive h3,
|
|
10702
|
+
#checkDevices .modal-responsive .mic-header-responsive h3 {
|
|
10703
|
+
font-size: 14px !important;
|
|
10704
|
+
}
|
|
10705
|
+
|
|
10706
|
+
#checkDevices .modal-responsive .button-responsive {
|
|
10707
|
+
height: 50px !important;
|
|
10708
|
+
font-size: 13px !important;
|
|
10709
|
+
}
|
|
10710
|
+
|
|
10711
|
+
#checkDevices .modal-responsive .divider-responsive {
|
|
10712
|
+
height: 50px !important;
|
|
10713
|
+
}
|
|
10714
|
+
}
|
|
10484
10715
|
`;
|
|
10485
10716
|
document.getElementsByTagName("head")[0].appendChild(style);
|
|
10486
10717
|
const fullBg = document.createElement("div");
|
|
@@ -10493,24 +10724,31 @@ var DeviceCheckerUI = class {
|
|
|
10493
10724
|
left: "0",
|
|
10494
10725
|
height: "100vh",
|
|
10495
10726
|
width: "100%",
|
|
10727
|
+
maxWidth: "100vw",
|
|
10496
10728
|
display: "flex",
|
|
10497
10729
|
alignItems: "center",
|
|
10498
|
-
justifyContent: "center"
|
|
10730
|
+
justifyContent: "center",
|
|
10731
|
+
overflow: "auto",
|
|
10732
|
+
boxSizing: "border-box"
|
|
10499
10733
|
};
|
|
10500
10734
|
this.applyStyles(fullBg, fullBgStyles);
|
|
10501
10735
|
const modal = document.createElement("div");
|
|
10736
|
+
modal.setAttribute("class", "modal-responsive");
|
|
10502
10737
|
const modalStyles = {
|
|
10503
10738
|
backgroundColor: "#fff",
|
|
10504
10739
|
zIndex: "1001",
|
|
10505
|
-
width: "
|
|
10740
|
+
width: "90%",
|
|
10741
|
+
maxWidth: "600px",
|
|
10506
10742
|
borderRadius: "10px",
|
|
10507
10743
|
display: "flex",
|
|
10508
10744
|
flexDirection: "column",
|
|
10509
|
-
alignItems: "center"
|
|
10745
|
+
alignItems: "center",
|
|
10746
|
+
boxSizing: "border-box",
|
|
10747
|
+
overflow: "hidden"
|
|
10510
10748
|
};
|
|
10511
10749
|
this.applyStyles(modal, modalStyles);
|
|
10512
10750
|
const h3 = document.createElement("h3");
|
|
10513
|
-
h3.innerText = "
|
|
10751
|
+
h3.innerText = "Checagem de dispositivos";
|
|
10514
10752
|
const h3Styles = {
|
|
10515
10753
|
color: "rgba(0, 0, 0, .7)",
|
|
10516
10754
|
fontWeight: "bold",
|
|
@@ -10524,6 +10762,7 @@ var DeviceCheckerUI = class {
|
|
|
10524
10762
|
this.applyStyles(h3, h3Styles);
|
|
10525
10763
|
modal.appendChild(h3);
|
|
10526
10764
|
const divCameraHeader = document.createElement("div");
|
|
10765
|
+
divCameraHeader.setAttribute("class", "camera-header-responsive");
|
|
10527
10766
|
const h3Camera = document.createElement("h3");
|
|
10528
10767
|
const selectCamera = document.createElement("select");
|
|
10529
10768
|
selectCamera.setAttribute("id", "cameraSelect");
|
|
@@ -10543,33 +10782,46 @@ var DeviceCheckerUI = class {
|
|
|
10543
10782
|
};
|
|
10544
10783
|
this.applyStyles(h3Camera, h3CameraStyles);
|
|
10545
10784
|
selectCamera.style.maxWidth = "400px";
|
|
10785
|
+
selectCamera.style.minWidth = "150px";
|
|
10786
|
+
selectCamera.style.width = "100%";
|
|
10787
|
+
selectCamera.style.boxSizing = "border-box";
|
|
10546
10788
|
divCameraHeader.appendChild(h3Camera);
|
|
10547
10789
|
divCameraHeader.appendChild(selectCamera);
|
|
10548
10790
|
modal.appendChild(divCameraHeader);
|
|
10549
10791
|
const divCamera = document.createElement("div");
|
|
10550
10792
|
divCamera.setAttribute("id", "liveCheckDevices");
|
|
10793
|
+
divCamera.setAttribute("class", "camera-container-responsive");
|
|
10551
10794
|
const videoDiv = document.createElement("div");
|
|
10795
|
+
videoDiv.setAttribute("class", "video-responsive");
|
|
10552
10796
|
const video = document.createElement("video");
|
|
10553
10797
|
const center = document.createElement("div");
|
|
10554
10798
|
video.setAttribute("id", "cameraStream");
|
|
10555
10799
|
video.muted = true;
|
|
10556
10800
|
const divCameraStyles = {
|
|
10557
|
-
width: "
|
|
10801
|
+
width: "100%",
|
|
10558
10802
|
display: "flex",
|
|
10559
10803
|
justifyContent: "space-between",
|
|
10804
|
+
gap: "20px",
|
|
10560
10805
|
borderBottom: "2px solid rgba(0, 0, 0, .1)",
|
|
10561
10806
|
paddingBottom: "15px",
|
|
10807
|
+
paddingLeft: "20px",
|
|
10808
|
+
paddingRight: "20px",
|
|
10809
|
+
boxSizing: "border-box",
|
|
10562
10810
|
transform: "rotateY(180deg)"
|
|
10563
10811
|
};
|
|
10564
10812
|
this.applyStyles(divCamera, divCameraStyles);
|
|
10565
10813
|
const videoStyles = {
|
|
10566
|
-
width: "
|
|
10814
|
+
width: "100%",
|
|
10815
|
+
maxWidth: "320px",
|
|
10816
|
+
height: "auto",
|
|
10817
|
+
maxHeight: "240px",
|
|
10818
|
+
objectFit: "contain",
|
|
10567
10819
|
backgroundColor: "#000",
|
|
10568
10820
|
borderRadius: "10px",
|
|
10569
10821
|
marginBottom: "15px"
|
|
10570
10822
|
};
|
|
10571
10823
|
this.applyStyles(video, videoStyles);
|
|
10572
|
-
this.applyStyles(videoDiv, { position: "relative" });
|
|
10824
|
+
this.applyStyles(videoDiv, { position: "relative", width: "100%", maxWidth: "320px", maxHeight: "240px", boxSizing: "border-box" });
|
|
10573
10825
|
const alertDivResolution = document.createElement("div");
|
|
10574
10826
|
alertDivResolution.setAttribute("class", "alert-div");
|
|
10575
10827
|
alertDivResolution.setAttribute("id", "alertDivResolution");
|
|
@@ -10663,12 +10915,17 @@ var DeviceCheckerUI = class {
|
|
|
10663
10915
|
alertDivSpyCam.appendChild(checkmark_SpyCam);
|
|
10664
10916
|
alertDivSpyCam.appendChild(SpyCamAlert);
|
|
10665
10917
|
center.style.transform = "rotateY(180deg)";
|
|
10918
|
+
center.style.display = "flex";
|
|
10919
|
+
center.style.flexDirection = "column";
|
|
10920
|
+
center.style.flex = "1";
|
|
10921
|
+
center.style.minWidth = "0";
|
|
10666
10922
|
center.appendChild(alertDivResolution);
|
|
10667
10923
|
center.appendChild(alertDivFacePosition);
|
|
10668
10924
|
center.appendChild(alertDivAmbientVerify);
|
|
10669
10925
|
center.appendChild(alertDivSpyCam);
|
|
10670
10926
|
divCamera.appendChild(center);
|
|
10671
10927
|
videoDiv.appendChild(video);
|
|
10928
|
+
videoDiv.style.flexShrink = "0";
|
|
10672
10929
|
divCamera.appendChild(videoDiv);
|
|
10673
10930
|
const mask = document.createElement("div");
|
|
10674
10931
|
mask.setAttribute("class", "facial-biometry__mask");
|
|
@@ -10691,6 +10948,7 @@ var DeviceCheckerUI = class {
|
|
|
10691
10948
|
videoDiv.appendChild(frame);
|
|
10692
10949
|
modal.appendChild(divCamera);
|
|
10693
10950
|
const divMicHeader = document.createElement("div");
|
|
10951
|
+
divMicHeader.setAttribute("class", "mic-header-responsive");
|
|
10694
10952
|
const h3Mic = document.createElement("h3");
|
|
10695
10953
|
const selectMic = document.createElement("select");
|
|
10696
10954
|
selectMic.setAttribute("id", "micSelect");
|
|
@@ -10710,18 +10968,24 @@ var DeviceCheckerUI = class {
|
|
|
10710
10968
|
};
|
|
10711
10969
|
this.applyStyles(h3Mic, h3MicStyles);
|
|
10712
10970
|
selectMic.style.maxWidth = "400px";
|
|
10971
|
+
selectMic.style.minWidth = "150px";
|
|
10972
|
+
selectMic.style.width = "100%";
|
|
10973
|
+
selectMic.style.boxSizing = "border-box";
|
|
10713
10974
|
divMicHeader.appendChild(h3Mic);
|
|
10714
10975
|
divMicHeader.appendChild(selectMic);
|
|
10715
10976
|
modal.appendChild(divMicHeader);
|
|
10716
10977
|
const divMic = document.createElement("div");
|
|
10978
|
+
divMic.setAttribute("class", "mic-container-responsive");
|
|
10717
10979
|
const divMicStyles = {
|
|
10718
10980
|
width: "100%",
|
|
10719
|
-
padding: "0px
|
|
10720
|
-
display: "flex"
|
|
10981
|
+
padding: "0px 20px",
|
|
10982
|
+
display: "flex",
|
|
10983
|
+
boxSizing: "border-box"
|
|
10721
10984
|
// justifyContent: "space-between",
|
|
10722
10985
|
};
|
|
10723
10986
|
this.applyStyles(divMic, divMicStyles);
|
|
10724
10987
|
const divMicMeter = document.createElement("div");
|
|
10988
|
+
divMicMeter.setAttribute("class", "mic-meter-responsive");
|
|
10725
10989
|
const divMicMeterStyles = {
|
|
10726
10990
|
// width: "calc(100% - 40px)",
|
|
10727
10991
|
display: "flex",
|
|
@@ -10750,13 +11014,16 @@ var DeviceCheckerUI = class {
|
|
|
10750
11014
|
divMeter.appendChild(pill);
|
|
10751
11015
|
}
|
|
10752
11016
|
const divRange = document.createElement("div");
|
|
11017
|
+
divRange.setAttribute("class", "range-responsive");
|
|
10753
11018
|
const pRange0 = document.createElement("p");
|
|
10754
11019
|
const pRange50 = document.createElement("p");
|
|
10755
11020
|
const pRange100 = document.createElement("p");
|
|
10756
11021
|
const divRangeStyles = {
|
|
10757
|
-
width: "
|
|
11022
|
+
width: "100%",
|
|
11023
|
+
maxWidth: "250px",
|
|
10758
11024
|
display: "flex",
|
|
10759
|
-
justifyContent: "space-between"
|
|
11025
|
+
justifyContent: "space-between",
|
|
11026
|
+
boxSizing: "border-box"
|
|
10760
11027
|
};
|
|
10761
11028
|
this.applyStyles(divRange, divRangeStyles);
|
|
10762
11029
|
pRange0.innerText = "0";
|
|
@@ -10769,10 +11036,10 @@ var DeviceCheckerUI = class {
|
|
|
10769
11036
|
alertDivMicrophone.setAttribute("class", "alert-div");
|
|
10770
11037
|
alertDivMicrophone.setAttribute("id", "alertDivMicrophone");
|
|
10771
11038
|
const alertDivMicrophoneStyles = {
|
|
10772
|
-
|
|
10773
|
-
alignItems: "
|
|
10774
|
-
justifyContent: "
|
|
10775
|
-
width: "
|
|
11039
|
+
display: "flex",
|
|
11040
|
+
alignItems: "center",
|
|
11041
|
+
justifyContent: "center",
|
|
11042
|
+
width: "100%"
|
|
10776
11043
|
};
|
|
10777
11044
|
this.applyStyles(alertDivMicrophone, alertDivMicrophoneStyles);
|
|
10778
11045
|
const microphoneAlert = document.createElement("error");
|
|
@@ -10792,12 +11059,16 @@ var DeviceCheckerUI = class {
|
|
|
10792
11059
|
divMicMeter.appendChild(divMeter);
|
|
10793
11060
|
divMicMeter.appendChild(divRange);
|
|
10794
11061
|
const pronunceMic = document.createElement("p");
|
|
10795
|
-
pronunceMic.
|
|
11062
|
+
pronunceMic.setAttribute("class", "pronounce-responsive");
|
|
11063
|
+
pronunceMic.innerText = 'Pronuncie em voz alta: "Testando..."';
|
|
10796
11064
|
pronunceMic.style.textAlign = "start";
|
|
10797
11065
|
const pronunceMicStyles = {
|
|
10798
|
-
width: "100%",
|
|
10799
|
-
marginLeft: "
|
|
10800
|
-
|
|
11066
|
+
width: "calc(100% - 40px)",
|
|
11067
|
+
marginLeft: "20px",
|
|
11068
|
+
marginRight: "20px",
|
|
11069
|
+
marginBottom: "15px",
|
|
11070
|
+
boxSizing: "border-box",
|
|
11071
|
+
padding: "0 10px"
|
|
10801
11072
|
};
|
|
10802
11073
|
this.applyStyles(pronunceMic, pronunceMicStyles);
|
|
10803
11074
|
divMic.appendChild(divMicMeter);
|
|
@@ -10810,11 +11081,13 @@ var DeviceCheckerUI = class {
|
|
|
10810
11081
|
display: "flex",
|
|
10811
11082
|
alignItems: "center",
|
|
10812
11083
|
justifyContent: "center",
|
|
10813
|
-
borderTop: "2px solid rgba(0, 0, 0, .1)"
|
|
11084
|
+
borderTop: "2px solid rgba(0, 0, 0, .1)",
|
|
11085
|
+
boxSizing: "border-box"
|
|
10814
11086
|
};
|
|
10815
11087
|
this.applyStyles(divBtn, divBtnStyles);
|
|
10816
11088
|
const buttonCancel = document.createElement("button");
|
|
10817
11089
|
buttonCancel.setAttribute("id", "cancelBtn");
|
|
11090
|
+
buttonCancel.setAttribute("class", "button-responsive");
|
|
10818
11091
|
buttonCancel.innerText = "Cancelar";
|
|
10819
11092
|
const buttonCancelStyles = {
|
|
10820
11093
|
width: "100%",
|
|
@@ -10829,6 +11102,7 @@ var DeviceCheckerUI = class {
|
|
|
10829
11102
|
};
|
|
10830
11103
|
this.applyStyles(buttonCancel, buttonCancelStyles);
|
|
10831
11104
|
const divider = document.createElement("span");
|
|
11105
|
+
divider.setAttribute("class", "divider-responsive");
|
|
10832
11106
|
const dividerStyles = {
|
|
10833
11107
|
width: "3px",
|
|
10834
11108
|
height: "70px",
|
|
@@ -10839,6 +11113,7 @@ var DeviceCheckerUI = class {
|
|
|
10839
11113
|
const button = document.createElement("button");
|
|
10840
11114
|
button.innerText = "Continuar";
|
|
10841
11115
|
button.setAttribute("id", "confirmBtn");
|
|
11116
|
+
button.setAttribute("class", "button-responsive");
|
|
10842
11117
|
const buttonStyles = {
|
|
10843
11118
|
width: "100%",
|
|
10844
11119
|
height: "70px",
|
|
@@ -11163,6 +11438,7 @@ Para iniciar um exame utilize uma outra c\xE2mera.`);
|
|
|
11163
11438
|
// src/new-flow/checkers/DeviceCheckerService.ts
|
|
11164
11439
|
var _DeviceCheckerService = class _DeviceCheckerService {
|
|
11165
11440
|
constructor(context) {
|
|
11441
|
+
this.deviceCheckResult = null;
|
|
11166
11442
|
this.videoOptions = {
|
|
11167
11443
|
width: 1080,
|
|
11168
11444
|
height: 720,
|
|
@@ -11193,6 +11469,9 @@ var _DeviceCheckerService = class _DeviceCheckerService {
|
|
|
11193
11469
|
token: context.token
|
|
11194
11470
|
});
|
|
11195
11471
|
}
|
|
11472
|
+
getDeviceCheckResult() {
|
|
11473
|
+
return this.deviceCheckResult;
|
|
11474
|
+
}
|
|
11196
11475
|
async runCheckDevicesFlow(options, _videoOptions, onModalConfirm, onModalCancel, onUpdate) {
|
|
11197
11476
|
if (_DeviceCheckerService.isModalOpen) {
|
|
11198
11477
|
return Promise.reject("Modal j\xE1 est\xE1 aberto");
|
|
@@ -11241,6 +11520,7 @@ var _DeviceCheckerService = class _DeviceCheckerService {
|
|
|
11241
11520
|
});
|
|
11242
11521
|
}
|
|
11243
11522
|
);
|
|
11523
|
+
this.deviceCheckResult = { ...returnData, result: resultPromise };
|
|
11244
11524
|
return { ...returnData, result: resultPromise };
|
|
11245
11525
|
} catch (error) {
|
|
11246
11526
|
this.closeCheckDevices();
|
|
@@ -11286,7 +11566,7 @@ var _DeviceCheckerService = class _DeviceCheckerService {
|
|
|
11286
11566
|
await this.checkSpyScan();
|
|
11287
11567
|
const { cameraId, microphoneId, result } = await this.DeviceCheckerUI.modalActions(() => this.closeCheckDevices());
|
|
11288
11568
|
return new Promise((resolve) => {
|
|
11289
|
-
|
|
11569
|
+
const response = {
|
|
11290
11570
|
result,
|
|
11291
11571
|
cameraId,
|
|
11292
11572
|
microphoneId,
|
|
@@ -11297,7 +11577,9 @@ var _DeviceCheckerService = class _DeviceCheckerService {
|
|
|
11297
11577
|
allowedMicrophone: this.allowedMicrophone,
|
|
11298
11578
|
allowedSpyScan: this.allowedSpyScan,
|
|
11299
11579
|
faceDetectionAlerts: this.faceDetectionAlerts
|
|
11300
|
-
}
|
|
11580
|
+
};
|
|
11581
|
+
this.deviceCheckResult = response;
|
|
11582
|
+
resolve(response);
|
|
11301
11583
|
});
|
|
11302
11584
|
} catch (error) {
|
|
11303
11585
|
this.closeCheckDevices();
|
|
@@ -11306,8 +11588,16 @@ var _DeviceCheckerService = class _DeviceCheckerService {
|
|
|
11306
11588
|
}
|
|
11307
11589
|
}
|
|
11308
11590
|
isUnderResolution() {
|
|
11591
|
+
var _a2;
|
|
11309
11592
|
const settings = this.cameraRecorder.cameraStream.getVideoTracks()[0].getSettings();
|
|
11310
|
-
|
|
11593
|
+
let { width = 0, height = 0 } = settings;
|
|
11594
|
+
const isPortrait = (_a2 = screen.orientation) == null ? void 0 : _a2.type.includes("portrait");
|
|
11595
|
+
if (isPortrait && isMobileDevice()) {
|
|
11596
|
+
if (this.videoOptions.width == height && this.videoOptions.height == width) {
|
|
11597
|
+
[width, height] = [height, width];
|
|
11598
|
+
}
|
|
11599
|
+
}
|
|
11600
|
+
if (this.videoOptions.minWidth > width || this.videoOptions.minHeight > height) {
|
|
11311
11601
|
this.allowedResolution = false;
|
|
11312
11602
|
} else {
|
|
11313
11603
|
this.allowedResolution = true;
|
|
@@ -14706,26 +14996,6 @@ var IndexDbSessionRepository = class {
|
|
|
14706
14996
|
}
|
|
14707
14997
|
};
|
|
14708
14998
|
|
|
14709
|
-
// src/utils/browserInformations.ts
|
|
14710
|
-
function fnBrowserDetect() {
|
|
14711
|
-
const userAgent = navigator.userAgent;
|
|
14712
|
-
let browserName;
|
|
14713
|
-
if (userAgent.match(/chrome|chromium|crios/i)) {
|
|
14714
|
-
browserName = "chrome";
|
|
14715
|
-
} else if (userAgent.match(/firefox|fxios/i)) {
|
|
14716
|
-
browserName = "firefox";
|
|
14717
|
-
} else if (userAgent.match(/safari/i)) {
|
|
14718
|
-
browserName = "safari";
|
|
14719
|
-
} else if (userAgent.match(/opr\//i)) {
|
|
14720
|
-
browserName = "opera";
|
|
14721
|
-
} else if (userAgent.match(/edg/i)) {
|
|
14722
|
-
browserName = "edge";
|
|
14723
|
-
} else {
|
|
14724
|
-
browserName = "No browser detection";
|
|
14725
|
-
}
|
|
14726
|
-
return browserName;
|
|
14727
|
-
}
|
|
14728
|
-
|
|
14729
14999
|
// src/utils/geolocation.ts
|
|
14730
15000
|
function getGeolocation() {
|
|
14731
15001
|
return new Promise((resolve, reject) => {
|
|
@@ -18797,7 +19067,7 @@ Error: ` + error
|
|
|
18797
19067
|
}
|
|
18798
19068
|
async verifyBrowser() {
|
|
18799
19069
|
const browserName = await fnBrowserDetect();
|
|
18800
|
-
if (browserName !== "chrome" && browserName !== "firefox") {
|
|
19070
|
+
if (browserName !== "chrome" && browserName !== "firefox" && !isMobileDevice()) {
|
|
18801
19071
|
trackers.registerBrowserNotSupported(
|
|
18802
19072
|
this.proctoringId,
|
|
18803
19073
|
`Browser n\xE3o suportado:
|