@amplitude/rrweb-player 2.0.0-alpha.24 → 2.0.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/style.css CHANGED
@@ -1 +1,81 @@
1
- @import 'rrweb/dist/rrweb.min.css';.rr-player{position:relative;background:white;float:left;border-radius:5px;box-shadow:0 24px 48px rgba(17, 16, 62, 0.12)}.rr-player__frame{overflow:hidden}.replayer-wrapper{float:left;clear:both;transform-origin:top left;left:50%;top:50%}.replayer-wrapper>iframe{border:none}.rr-controller.svelte-19ke1iv.svelte-19ke1iv{width:100%;height:80px;background:#fff;display:flex;flex-direction:column;justify-content:space-around;align-items:center;border-radius:0 0 5px 5px}.rr-timeline.svelte-19ke1iv.svelte-19ke1iv{width:80%;display:flex;align-items:center}.rr-timeline__time.svelte-19ke1iv.svelte-19ke1iv{display:inline-block;width:100px;text-align:center;color:#11103e}.rr-progress.svelte-19ke1iv.svelte-19ke1iv{flex:1;height:12px;background:#eee;position:relative;border-radius:3px;cursor:pointer;box-sizing:border-box;border-top:solid 4px #fff;border-bottom:solid 4px #fff}.rr-progress.disabled.svelte-19ke1iv.svelte-19ke1iv{cursor:not-allowed}.rr-progress__step.svelte-19ke1iv.svelte-19ke1iv{height:100%;position:absolute;left:0;top:0;background:#e0e1fe}.rr-progress__handler.svelte-19ke1iv.svelte-19ke1iv{width:20px;height:20px;border-radius:10px;position:absolute;top:2px;transform:translate(-50%, -50%);background:rgb(73, 80, 246)}.rr-controller__btns.svelte-19ke1iv.svelte-19ke1iv{display:flex;align-items:center;justify-content:center;font-size:13px}.rr-controller__btns.svelte-19ke1iv button.svelte-19ke1iv{width:32px;height:32px;display:flex;padding:0;align-items:center;justify-content:center;background:none;border:none;border-radius:50%;cursor:pointer}.rr-controller__btns.svelte-19ke1iv button.svelte-19ke1iv:active{background:#e0e1fe}.rr-controller__btns.svelte-19ke1iv button.active.svelte-19ke1iv{color:#fff;background:rgb(73, 80, 246)}.rr-controller__btns.svelte-19ke1iv button.svelte-19ke1iv:disabled{cursor:not-allowed}.switch.svelte-9brlez.svelte-9brlez.svelte-9brlez{height:1em;display:flex;align-items:center}.switch.disabled.svelte-9brlez.svelte-9brlez.svelte-9brlez{opacity:0.5}.label.svelte-9brlez.svelte-9brlez.svelte-9brlez{margin:0 8px}.switch.svelte-9brlez input[type='checkbox'].svelte-9brlez.svelte-9brlez{position:absolute;opacity:0}.switch.svelte-9brlez label.svelte-9brlez.svelte-9brlez{width:2em;height:1em;position:relative;cursor:pointer;display:block}.switch.disabled.svelte-9brlez label.svelte-9brlez.svelte-9brlez{cursor:not-allowed}.switch.svelte-9brlez label.svelte-9brlez.svelte-9brlez:before{content:'';position:absolute;width:2em;height:1em;left:0.1em;transition:background 0.1s ease;background:rgba(73, 80, 246, 0.5);border-radius:50px}.switch.svelte-9brlez label.svelte-9brlez.svelte-9brlez:after{content:'';position:absolute;width:1em;height:1em;border-radius:50px;left:0;transition:all 0.2s ease;box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.3);background:#fcfff4;animation:switch-off 0.2s ease-out;z-index:2}.switch.svelte-9brlez input[type='checkbox'].svelte-9brlez:checked+label.svelte-9brlez:before{background:rgb(73, 80, 246)}.switch.svelte-9brlez input[type='checkbox'].svelte-9brlez:checked+label.svelte-9brlez:after{animation:switch-on 0.2s ease-out;left:1.1em}
1
+ .switch.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{height:1em;display:flex;align-items:center}.switch.disabled.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{opacity:0.5}.label.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{margin:0 8px}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7.svelte-a6h7w7{position:absolute;opacity:0}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{width:2em;height:1em;position:relative;cursor:pointer;display:block}.switch.disabled.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{cursor:not-allowed}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:before{content:'';position:absolute;width:2em;height:1em;left:0.1em;transition:background 0.1s ease;background:rgba(73, 80, 246, 0.5);border-radius:50px}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:after{content:'';position:absolute;width:1em;height:1em;border-radius:50px;left:0;transition:all 0.2s ease;box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.3);background:#fcfff4;animation:switch-off 0.2s ease-out;z-index:2}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7:checked+label.svelte-a6h7w7:before{background:rgb(73, 80, 246)}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7:checked+label.svelte-a6h7w7:after{animation:switch-on 0.2s ease-out;left:1.1em}.rr-controller.svelte-189zk2r.svelte-189zk2r{width:100%;height:80px;background:#fff;display:flex;flex-direction:column;justify-content:space-around;align-items:center;border-radius:0 0 5px 5px}.rr-timeline.svelte-189zk2r.svelte-189zk2r{width:80%;display:flex;align-items:center}.rr-timeline__time.svelte-189zk2r.svelte-189zk2r{display:inline-block;width:100px;text-align:center;color:#11103e}.rr-progress.svelte-189zk2r.svelte-189zk2r{flex:1;height:12px;background:#eee;position:relative;border-radius:3px;cursor:pointer;box-sizing:border-box;border-top:solid 4px #fff;border-bottom:solid 4px #fff}.rr-progress.disabled.svelte-189zk2r.svelte-189zk2r{cursor:not-allowed}.rr-progress__step.svelte-189zk2r.svelte-189zk2r{height:100%;position:absolute;left:0;top:0;background:#e0e1fe}.rr-progress__handler.svelte-189zk2r.svelte-189zk2r{width:20px;height:20px;border-radius:10px;position:absolute;top:2px;transform:translate(-50%, -50%);background:rgb(73, 80, 246)}.rr-controller__btns.svelte-189zk2r.svelte-189zk2r{display:flex;align-items:center;justify-content:center;font-size:13px}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r{width:32px;height:32px;display:flex;padding:0;align-items:center;justify-content:center;background:none;border:none;border-radius:50%;cursor:pointer}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:active{background:#e0e1fe}.rr-controller__btns.svelte-189zk2r button.active.svelte-189zk2r{color:#fff;background:rgb(73, 80, 246)}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:disabled{cursor:not-allowed}.replayer-wrapper {
2
+ position: relative;
3
+ }
4
+ .replayer-mouse {
5
+ position: absolute;
6
+ width: 20px;
7
+ height: 20px;
8
+ transition: left 0.05s linear, top 0.05s linear;
9
+ background-size: contain;
10
+ background-position: center center;
11
+ background-repeat: no-repeat;
12
+ background-image: url('data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==');
13
+ border-color: transparent; /* otherwise we transition from black when .touch-device class is added */
14
+ }
15
+ .replayer-mouse::after {
16
+ content: '';
17
+ display: inline-block;
18
+ width: 20px;
19
+ height: 20px;
20
+ background: rgb(73, 80, 246);
21
+ border-radius: 100%;
22
+ transform: translate(-50%, -50%);
23
+ opacity: 0.3;
24
+ }
25
+ .replayer-mouse.active::after {
26
+ animation: click 0.2s ease-in-out 1;
27
+ }
28
+ .replayer-mouse.touch-device {
29
+ background-image: none; /* there's no passive cursor on touch-only screens */
30
+ width: 70px;
31
+ height: 70px;
32
+ border-width: 4px;
33
+ border-style: solid;
34
+ border-radius: 100%;
35
+ margin-left: -37px;
36
+ margin-top: -37px;
37
+ border-color: rgba(73, 80, 246, 0);
38
+ transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;
39
+ }
40
+ .replayer-mouse.touch-device.touch-active {
41
+ border-color: rgba(73, 80, 246, 1);
42
+ transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;
43
+ }
44
+ .replayer-mouse.touch-device::after {
45
+ opacity: 0; /* there's no passive cursor on touch-only screens */
46
+ }
47
+ .replayer-mouse.touch-device.active::after {
48
+ animation: touch-click 0.2s ease-in-out 1;
49
+ }
50
+ .replayer-mouse-tail {
51
+ position: absolute;
52
+ pointer-events: none;
53
+ }
54
+ @keyframes click {
55
+ 0% {
56
+ opacity: 0.3;
57
+ width: 20px;
58
+ height: 20px;
59
+ }
60
+ 50% {
61
+ opacity: 0.5;
62
+ width: 10px;
63
+ height: 10px;
64
+ }
65
+ }
66
+ @keyframes touch-click {
67
+ 0% {
68
+ opacity: 0;
69
+ width: 20px;
70
+ height: 20px;
71
+ }
72
+ 50% {
73
+ opacity: 0.5;
74
+ width: 10px;
75
+ height: 10px;
76
+ }
77
+ }
78
+ .rr-player{position:relative;background:white;float:left;border-radius:5px;box-shadow:0 24px 48px rgba(17, 16, 62, 0.12)}
79
+ .rr-player__frame{overflow:hidden}
80
+ .replayer-wrapper{float:left;clear:both;transform-origin:top left;left:50%;top:50%}
81
+ .replayer-wrapper>iframe{border:none}
@@ -0,0 +1,2 @@
1
+ .switch.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{height:1em;display:flex;align-items:center}.switch.disabled.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{opacity:.5}.label.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{margin:0 8px}.switch.svelte-a6h7w7 input[type=checkbox].svelte-a6h7w7.svelte-a6h7w7{position:absolute;opacity:0}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{width:2em;height:1em;position:relative;cursor:pointer;display:block}.switch.disabled.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{cursor:not-allowed}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:before{content:"";position:absolute;width:2em;height:1em;left:.1em;transition:background .1s ease;background:#4950f680;border-radius:50px}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:after{content:"";position:absolute;width:1em;height:1em;border-radius:50px;left:0;transition:all .2s ease;box-shadow:0 2px 5px #0000004d;background:#fcfff4;animation:switch-off .2s ease-out;z-index:2}.switch.svelte-a6h7w7 input[type=checkbox].svelte-a6h7w7:checked+label.svelte-a6h7w7:before{background:#4950f6}.switch.svelte-a6h7w7 input[type=checkbox].svelte-a6h7w7:checked+label.svelte-a6h7w7:after{animation:switch-on .2s ease-out;left:1.1em}.rr-controller.svelte-189zk2r.svelte-189zk2r{width:100%;height:80px;background:#fff;display:flex;flex-direction:column;justify-content:space-around;align-items:center;border-radius:0 0 5px 5px}.rr-timeline.svelte-189zk2r.svelte-189zk2r{width:80%;display:flex;align-items:center}.rr-timeline__time.svelte-189zk2r.svelte-189zk2r{display:inline-block;width:100px;text-align:center;color:#11103e}.rr-progress.svelte-189zk2r.svelte-189zk2r{flex:1;height:12px;background:#eee;position:relative;border-radius:3px;cursor:pointer;box-sizing:border-box;border-top:solid 4px #fff;border-bottom:solid 4px #fff}.rr-progress.disabled.svelte-189zk2r.svelte-189zk2r{cursor:not-allowed}.rr-progress__step.svelte-189zk2r.svelte-189zk2r{height:100%;position:absolute;left:0;top:0;background:#e0e1fe}.rr-progress__handler.svelte-189zk2r.svelte-189zk2r{width:20px;height:20px;border-radius:10px;position:absolute;top:2px;transform:translate(-50%,-50%);background:#4950f6}.rr-controller__btns.svelte-189zk2r.svelte-189zk2r{display:flex;align-items:center;justify-content:center;font-size:13px}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r{width:32px;height:32px;display:flex;padding:0;align-items:center;justify-content:center;background:none;border:none;border-radius:50%;cursor:pointer}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:active{background:#e0e1fe}.rr-controller__btns.svelte-189zk2r button.active.svelte-189zk2r{color:#fff;background:#4950f6}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:disabled{cursor:not-allowed}.replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:center center;background-repeat:no-repeat;background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==);border-color:transparent}.replayer-mouse:after{content:"";display:inline-block;width:20px;height:20px;background:#4950f6;border-radius:100%;transform:translate(-50%,-50%);opacity:.3}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-width:4px;border-style:solid;border-radius:100%;margin-left:-37px;margin-top:-37px;border-color:#4950f600;transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}.rr-player{position:relative;background:#fff;float:left;border-radius:5px;box-shadow:0 24px 48px #11103e1f}.rr-player__frame{overflow:hidden}.replayer-wrapper{float:left;clear:both;transform-origin:top left;left:50%;top:50%}.replayer-wrapper>iframe{border:none}
2
+ /*# sourceMappingURL=style.min.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["style.css"],
4
+ "sourcesContent": [".switch.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{height:1em;display:flex;align-items:center}.switch.disabled.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{opacity:0.5}.label.svelte-a6h7w7.svelte-a6h7w7.svelte-a6h7w7{margin:0 8px}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7.svelte-a6h7w7{position:absolute;opacity:0}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{width:2em;height:1em;position:relative;cursor:pointer;display:block}.switch.disabled.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7{cursor:not-allowed}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:before{content:'';position:absolute;width:2em;height:1em;left:0.1em;transition:background 0.1s ease;background:rgba(73, 80, 246, 0.5);border-radius:50px}.switch.svelte-a6h7w7 label.svelte-a6h7w7.svelte-a6h7w7:after{content:'';position:absolute;width:1em;height:1em;border-radius:50px;left:0;transition:all 0.2s ease;box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.3);background:#fcfff4;animation:switch-off 0.2s ease-out;z-index:2}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7:checked+label.svelte-a6h7w7:before{background:rgb(73, 80, 246)}.switch.svelte-a6h7w7 input[type='checkbox'].svelte-a6h7w7:checked+label.svelte-a6h7w7:after{animation:switch-on 0.2s ease-out;left:1.1em}.rr-controller.svelte-189zk2r.svelte-189zk2r{width:100%;height:80px;background:#fff;display:flex;flex-direction:column;justify-content:space-around;align-items:center;border-radius:0 0 5px 5px}.rr-timeline.svelte-189zk2r.svelte-189zk2r{width:80%;display:flex;align-items:center}.rr-timeline__time.svelte-189zk2r.svelte-189zk2r{display:inline-block;width:100px;text-align:center;color:#11103e}.rr-progress.svelte-189zk2r.svelte-189zk2r{flex:1;height:12px;background:#eee;position:relative;border-radius:3px;cursor:pointer;box-sizing:border-box;border-top:solid 4px #fff;border-bottom:solid 4px #fff}.rr-progress.disabled.svelte-189zk2r.svelte-189zk2r{cursor:not-allowed}.rr-progress__step.svelte-189zk2r.svelte-189zk2r{height:100%;position:absolute;left:0;top:0;background:#e0e1fe}.rr-progress__handler.svelte-189zk2r.svelte-189zk2r{width:20px;height:20px;border-radius:10px;position:absolute;top:2px;transform:translate(-50%, -50%);background:rgb(73, 80, 246)}.rr-controller__btns.svelte-189zk2r.svelte-189zk2r{display:flex;align-items:center;justify-content:center;font-size:13px}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r{width:32px;height:32px;display:flex;padding:0;align-items:center;justify-content:center;background:none;border:none;border-radius:50%;cursor:pointer}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:active{background:#e0e1fe}.rr-controller__btns.svelte-189zk2r button.active.svelte-189zk2r{color:#fff;background:rgb(73, 80, 246)}.rr-controller__btns.svelte-189zk2r button.svelte-189zk2r:disabled{cursor:not-allowed}.replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n.replayer-mouse::after {\n content: '';\n display: inline-block;\n width: 20px;\n height: 20px;\n background: rgb(73, 80, 246);\n border-radius: 100%;\n transform: translate(-50%, -50%);\n opacity: 0.3;\n}\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n.rr-player{position:relative;background:white;float:left;border-radius:5px;box-shadow:0 24px 48px rgba(17, 16, 62, 0.12)}\n.rr-player__frame{overflow:hidden}\n.replayer-wrapper{float:left;clear:both;transform-origin:top left;left:50%;top:50%}\n.replayer-wrapper>iframe{border:none}"],
5
+ "mappings": "AAAA,CAAC,MAAM,CAAC,aAAa,CAAb,aAA2B,CAA3B,cAA0C,OAAO,IAAI,QAAQ,KAAK,YAAY,MAAM,CAAC,CAA5F,MAAmG,CAAC,QAAQ,CAArG,aAAmH,CAAnH,aAAiI,CAAjI,cAAgJ,QAAQ,EAAG,CAAC,CAAC,KAAK,CAAlK,aAAgL,CAAhL,aAA8L,CAA9L,cAAR,OAA4N,EAAE,GAAG,CAAC,CAAjO,MAAwO,CAAjO,cAAgP,KAAK,CAAC,cAAgB,CAAtQ,aAAoR,CAApR,cAAmS,SAAS,SAAS,QAAQ,CAAC,CAAC,CAAtU,MAA6U,CAAtU,cAAqV,KAAK,CAA1V,aAAwW,CAAxW,cAAuX,MAAM,IAAI,OAAO,IAAI,SAAS,SAAS,OAAO,QAAQ,QAAQ,KAAK,CAAC,CAAlc,MAAyc,CAArW,QAA8W,CAA3c,cAA0d,KAAK,CAA/d,aAA6e,CAA7e,cAA4f,OAAO,WAAW,CAAC,CAAthB,MAA6hB,CAAthB,cAAqiB,KAAK,CAA1iB,aAAwjB,CAAxjB,aAAskB,QAAQ,QAAQ,GAAG,SAAS,SAAS,MAAM,IAAI,OAAO,IAAI,KAAK,KAAM,WAAW,WAAW,IAAK,KAAK,WAAW,UAA9rB,cAAmuB,IAAI,CAAC,CAAvuB,MAA8uB,CAAvuB,cAAsvB,KAAK,CAA3vB,aAAywB,CAAzwB,aAAuxB,OAAO,QAAQ,GAAG,SAAS,SAAS,MAAM,IAAI,OAAO,IAAp1B,cAAs2B,KAAK,KAAK,EAAE,WAAW,IAAI,IAAK,KAAK,WAAW,EAAI,IAAI,IAAQ,UAAmB,WAAW,QAAQ,UAAU,WAAW,IAAK,SAAS,QAAQ,CAAC,CAAC,CAAx/B,MAA+/B,CAAx/B,cAAugC,KAAK,CAAC,cAAgB,CAA7hC,aAA2iC,QAAQ,CAAC,KAAK,CAAzjC,aAAukC,QAAQ,WAAW,OAAgB,CAAC,CAAlnC,MAAynC,CAAlnC,cAAioC,KAAK,CAAC,cAAgB,CAAvpC,aAAqqC,QAAQ,CAAC,KAAK,CAAnrC,aAAisC,OAAO,UAAU,UAAU,IAAK,SAAS,KAAK,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAd,eAA8B,MAAM,KAAK,OAAO,KAAK,WAAW,KAAK,QAAQ,KAAK,eAAe,OAAO,gBAAgB,aAAa,YAAY,OAA75C,cAAk7C,EAAE,EAAE,IAAI,GAAG,CAAC,CAAC,WAAW,CAA9L,cAA6M,CAA7M,eAA6N,MAAM,IAAI,QAAQ,KAAK,YAAY,MAAM,CAAC,CAAC,iBAAiB,CAAzR,cAAwS,CAAxS,eAAwT,QAAQ,aAAa,MAAM,MAAM,WAAW,OAAO,MAAM,OAAO,CAAC,CAAC,WAAW,CAArY,cAAoZ,CAApZ,eAAoa,KAAK,EAAE,OAAO,KAAK,WAAW,KAAK,SAAS,SAA5tD,cAAmvD,IAAI,OAAO,QAAQ,WAAW,WAAW,WAAW,MAAM,IAAI,KAAK,cAAc,MAAM,IAAI,IAAI,CAAC,CAA7M,WAAyN,CAA1vD,QAAmwD,CAA5lB,cAA2mB,CAA3mB,eAA2nB,OAAO,WAAW,CAAC,CAAC,iBAAiB,CAAhqB,cAA+qB,CAA/qB,eAA+rB,OAAO,KAAK,SAAS,SAAS,KAAK,EAAE,IAAI,EAAE,WAAW,OAAO,CAAC,CAAC,oBAAoB,CAAlxB,cAAiyB,CAAjyB,eAAizB,MAAM,KAAK,OAAO,KAA/kE,cAAkmE,KAAK,SAAS,SAAS,IAAI,IAAI,UAAU,UAAU,IAAI,CAAE,MAAM,WAAW,OAAgB,CAAC,CAAC,mBAAmB,CAAr8B,cAAo9B,CAAp9B,eAAo+B,QAAQ,KAAK,YAAY,OAAO,gBAAgB,OAAO,UAAU,IAAI,CAAC,CAAxH,mBAA4I,CAA9jC,eAA8kC,MAAM,CAAplC,eAAomC,MAAM,KAAK,OAAO,KAAK,QAAQ,KAA/4E,QAA45E,EAAE,YAAY,OAAO,gBAAgB,OAAO,WAAW,KAAK,OAAO,KAA/9E,cAAk/E,IAAI,OAAO,OAAO,CAAC,CAAvU,mBAA2V,CAA7wC,eAA6xC,MAAM,CAAnyC,cAAkzC,QAAQ,WAAW,OAAO,CAAC,CAA3Z,mBAA+a,CAAj2C,eAAi3C,MAAM,CAAC,MAAM,CAA93C,eAA84C,MAAM,KAAK,WAAW,OAAgB,CAAC,CAAngB,mBAAuhB,CAAz8C,eAAy9C,MAAM,CAA/9C,cAA8+C,UAAU,OAAO,WAAW,CAAC,CAAC,iBACtxF,SAAU,QACZ,CACA,CAAC,eACC,SAAU,SACV,MAAO,KACP,OAAQ,KACR,WAAY,KAAK,KAAM,MAAM,CAAE,IAAI,KAAM,OACzC,gBAAiB,QACjB,oBAAqB,OAAO,OAC5B,kBAAmB,UACnB,iBAAkB,4pBAClB,aAAc,WAChB,CACA,CAXC,cAWc,OACb,QAAS,GACT,QAAS,aACT,MAAO,KACP,OAAQ,KACR,WAAY,QAnBd,cAoBiB,KACf,UAAW,UAAU,IAAI,CAAE,MAC3B,QAAS,EACX,CACA,CArBC,cAqBc,CAxBqnF,MAwB9mF,OACpB,UAAW,MAAM,IAAK,YAAY,CACpC,CACA,CAxBC,cAwBc,CAAC,aACd,iBAAkB,KAClB,MAAO,KACP,OAAQ,KACR,aAAc,IACd,aAAc,MAhChB,cAiCiB,KACf,YAAa,MACb,WAAY,MACZ,aAAc,UACd,WAAY,KAAK,GAAG,MAAM,CAAE,IAAI,GAAG,MAAM,CAAE,aAAa,IAAK,WAC/D,CACA,CApCC,cAoCc,CAZC,YAYY,CAAC,aAC3B,aAAc,QACd,WAAY,KAAK,KAAM,MAAM,CAAE,IAAI,KAAM,MAAM,CAAE,aAAa,IAAK,WACrE,CACA,CAxCC,cAwCc,CAhBC,YAgBY,OAC1B,QAAS,CACX,CACA,CA3CC,cA2Cc,CAnBC,YAmBY,CA9CwmF,MA8CjmF,OACjC,UAAW,YAAY,IAAK,YAAY,CAC1C,CACA,CAAC,oBACC,SAAU,SACV,eAAgB,IAClB,CACA,WA5Ba,MA6BX,GACE,QAAS,GACT,MAAO,KACP,OAAQ,IACV,CACA,IACE,QAAS,GACT,MAAO,KACP,OAAQ,IACV,CACF,CACA,WAlBa,YAmBX,GACE,QAAS,EACT,MAAO,KACP,OAAQ,IACV,CACA,IACE,QAAS,GACT,MAAO,KACP,OAAQ,IACV,CACF,CACA,CAAC,UAAU,SAAS,SAAS,WAAW,KAAM,MAAM,KA7EpD,cA6EuE,IAAI,WAAW,EAAE,KAAK,KAAK,SAAsB,CACxH,CAAC,iBAAiB,SAAS,MAAM,CACjC,CA/EwxF,iBA+EtwF,MAAM,KAAK,MAAM,KAAK,iBAAiB,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,CAClF,CAhFwxF,gBAgFvwF,CAAC,OAAO,OAAO,IAAI",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,50 +1,59 @@
1
1
  {
2
2
  "name": "@amplitude/rrweb-player",
3
- "version": "2.0.0-alpha.24",
3
+ "version": "2.0.0-alpha.26",
4
4
  "devDependencies": {
5
- "@amplitude/rrweb-types": "^2.0.0-alpha.24",
6
- "@rollup/plugin-commonjs": "^22.0.0",
7
- "@rollup/plugin-node-resolve": "^13.2.1",
8
- "@types/offscreencanvas": "^2019.6.4",
9
- "eslint-config-google": "^0.14.0",
10
- "eslint-plugin-svelte3": "^4.0.0",
11
- "postcss-easy-import": "^3.0.0",
12
- "rollup": "^2.71.1",
13
- "rollup-plugin-css-only": "^3.1.0",
14
- "rollup-plugin-livereload": "^2.0.0",
15
- "rollup-plugin-svelte": "^7.1.0",
16
- "rollup-plugin-terser": "^7.0.2",
17
- "rollup-plugin-typescript2": "^0.31.2",
18
- "rollup-plugin-web-worker-loader": "^1.6.1",
19
- "sirv-cli": "^0.4.4",
20
- "svelte": "^3.59.2",
21
- "svelte-check": "^3.0.1",
22
- "svelte-preprocess": "^5.0.0",
23
- "tslib": "^2.0.0"
5
+ "@amplitude/rrweb-types": "^2.0.0-alpha.26",
6
+ "@sveltejs/adapter-auto": "^3.0.0",
7
+ "@sveltejs/kit": "^2.0.0",
8
+ "@sveltejs/package": "^2.0.0",
9
+ "@sveltejs/vite-plugin-svelte": "^3.0.0",
10
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
11
+ "@typescript-eslint/parser": "^7.0.0",
12
+ "eslint-plugin-svelte": "^2.37.0",
13
+ "prettier-plugin-svelte": "^3.1.2",
14
+ "svelte": "^4.2.14",
15
+ "svelte-check": "^3.4.3",
16
+ "svelte-preprocess": "^5.0.3",
17
+ "svelte2tsx": "^0.7.6",
18
+ "tslib": "^2.0.0",
19
+ "vite": "^5.3.1"
24
20
  },
25
21
  "dependencies": {
26
22
  "@tsconfig/svelte": "^1.0.0",
27
- "@amplitude/rrweb": "^2.0.0-alpha.24"
23
+ "@amplitude/rrweb-replay": "^2.0.0-alpha.26",
24
+ "@amplitude/rrweb-packer": "^2.0.0-alpha.26"
28
25
  },
29
26
  "scripts": {
30
- "build": "rollup -c",
31
- "dev": "rollup -c -w",
27
+ "dev": "vite build --watch",
28
+ "build": "vite build",
32
29
  "prepublishOnly": "yarn build",
33
- "start": "sirv public",
34
- "validate": "svelte-check",
30
+ "start": "vite",
31
+ "check-types": "svelte-check --tsconfig ./tsconfig.json",
35
32
  "prepublish": "yarn build",
36
33
  "lint": "yarn eslint src/**/*.ts"
37
34
  },
38
35
  "description": "rrweb's replayer UI",
39
- "main": "lib/index.cjs",
40
- "module": "dist/index.mjs",
41
- "unpkg": "dist/index.js",
36
+ "main": "./dist/rrweb-player.umd.cjs",
37
+ "module": "./dist/rrweb-player.js",
38
+ "unpkg": "./dist/rrweb-player.umd.cjs",
39
+ "typings": "dist/rrweb-player.d.ts",
40
+ "exports": {
41
+ ".": {
42
+ "import": {
43
+ "types": "./dist/rrweb-player.d.ts",
44
+ "default": "./dist/rrweb-player.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/rrweb-player.d.cts",
48
+ "default": "./dist/rrweb-player.cjs"
49
+ }
50
+ },
51
+ "./dist/style.css": "./dist/style.css"
52
+ },
42
53
  "files": [
43
- "lib",
44
54
  "dist",
45
- "typings"
55
+ "package.json"
46
56
  ],
47
- "typings": "typings/index.d.ts",
48
57
  "type": "module",
49
58
  "repository": {
50
59
  "type": "git",
package/dist/index.js DELETED
@@ -1,30 +0,0 @@
1
- var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function i(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function m(e){return document.createTextNode(e)}function f(){return m(" ")}function g(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function b(e,t,n,i){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function w(e,t,n){e.classList[n?"add":"remove"](t)}let E;function N(e){E=e}function T(){if(!E)throw new Error("Function called outside component initialization");return E}function S(e){T().$$.on_mount.push(e)}function M(e){T().$$.on_destroy.push(e)}function D(){const e=T();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=function(e,t,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,i,t),o}(t,n,{cancelable:i});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}const C=[],x=[];let R=[];const k=[],A=Promise.resolve();let I=!1;function O(e){R.push(e)}const _=new Set;let $=0;function L(){if(0!==$)return;const e=E;do{try{for(;$<C.length;){const e=C[$];$++,N(e),F(e.$$)}}catch(e){throw C.length=0,$=0,e}for(N(null),C.length=0,$=0;x.length;)x.pop()();for(let e=0;e<R.length;e+=1){const t=R[e];_.has(t)||(_.add(t),t())}R.length=0}while(C.length);for(;k.length;)k.pop()();I=!1,_.clear(),N(e)}function F(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(O)}}const P=new Set;let U;function B(){U={r:0,c:[],p:U}}function j(){U.r||o(U.c),U=U.p}function V(e,t){e&&e.i&&(P.delete(e),e.i(t))}function W(e,t,n,i){if(e&&e.o){if(P.has(e))return;P.add(e),U.c.push((()=>{P.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function z(e){e&&e.c()}function G(e,t,i,r){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,i),r||O((()=>{const t=e.$$.on_mount.map(n).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...t):o(t),e.$$.on_mount=[]})),l.forEach(O)}function H(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];R.forEach((i=>-1===e.indexOf(i)?t.push(i):n.push(i))),n.forEach((e=>e())),R=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(e,t){-1===e.$$.dirty[0]&&(C.push(e),I||(I=!0,A.then(L)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,n,s,r,a,l,c,d=[-1]){const h=E;N(t);const p=t.$$={fragment:null,ctx:[],props:l,update:e,not_equal:a,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(h?h.$$.context:[])),callbacks:i(),dirty:d,skip_bound:!1,root:n.target||h.$$.root};c&&c(p.root);let m=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return p.ctx&&a(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),m&&Y(t,e)),n})):[],p.update(),m=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&V(t.$$.fragment),G(t,n.target,n.anchor,n.customElement),L()}N(h)}class X{$destroy(){H(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const e=i.indexOf(n);-1!==e&&i.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Q;function J(e){return e.nodeType===e.ELEMENT_NODE}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Q||(Q={}));class Z{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function K(){return new Z}const ee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function te(e,t={}){let n=1,i=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");i=-1===o?i+e.length:e.length-o}function s(){const e={line:n,column:i};return t=>(t.position=new r(e),p(),t)}class r{constructor(e){this.start=e,this.end={line:n,column:i},this.source=t.source}}r.prototype.content=e;const a=[];function l(o){const s=new Error(`${t.source||""}:${n}:${i}: ${o}`);if(s.reason=o,s.filename=t.source,s.line=n,s.column=i,s.source=e,!t.silent)throw s;a.push(s)}function c(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=M()||D());)t&&(n.push(t),m(n));return n}function h(t){const n=t.exec(e);if(!n)return;const i=n[0];return o(i),e=e.slice(i.length),n}function p(){h(/^\s*/)}function m(e=[]){let t;for(;t=f();)t&&e.push(t),t=f();return e}function f(){const t=s();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const r=e.slice(2,n-2);return i+=2,o(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}const g=new RegExp("^(("+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^{]"].join("|")+")+)");function y(){for(p();"}"==e[0];)l("extra closing bracket"),e=e.slice(1),p();const t=h(g);if(!t)return;const n=t[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌")));return function(e){const t=[];let n="",i=0,o=0,s=null;for(const r of e){const e=n.endsWith("\\");s?s!==r||e||(s=null):"("===r?i++:")"===r?i--:"["===r?o++:"]"===r?o--:"'\"".includes(r)&&(s=r),","===r&&0===i&&0===o?(t.push(n),n=""):n+=r}n&&t.push(n);return t}(n).map((e=>e.replace(/\u200C/g,",").trim()))}function v(){const e=s(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=ne(t[0]);if(!h(/^:\s*/))return l("property missing ':'");const i=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(ee,""),value:i?ne(i[0]).replace(ee,""):""});return h(/^[;\s]*/),o}function b(){const e=[];if(!c())return l("missing '{'");let t;for(m(e);t=v();)!1!==t&&(e.push(t),m(e)),t=v();return u()?e:l("missing '}'")}function w(){let e;const t=[],n=s();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const E=S("import"),N=S("charset"),T=S("namespace");function S(e){const t=new RegExp("^@"+e+"\\s*((?:"+[/[^\\]"(?:\\"|[^"])*"/.source,/[^\\]'(?:\\'|[^'])*'/.source,"[^;]"].join("|")+")+);");return()=>{const n=s(),i=h(t);if(!i)return;const o={type:e};return o[e]=i[1].trim(),n(o)}}function M(){if("@"===e[0])return function(){const e=s();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const i=t[1];if(!c())return l("@keyframes missing '{'");let o,r=m();for(;o=w();)r.push(o),r=r.concat(m());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:r}):l("@keyframes missing '}'")}()||function(){const e=s(),t=h(/^@media *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@media missing '{'");const i=m().concat(d());return u()?e({type:"media",media:n,rules:i}):l("@media missing '}'")}()||function(){const e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){const e=s(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=ne(t[1]);if(!c())return l("@supports missing '{'");const i=m().concat(d());return u()?e({type:"supports",supports:n,rules:i}):l("@supports missing '}'")}()||E()||N()||T()||function(){const e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=ne(t[1]),i=ne(t[2]);if(!c())return l("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:i,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=s();if(!h(/^@page */))return;const t=y()||[];if(!c())return l("@page missing '{'");let n,i=m();for(;n=v();)i.push(n),i=i.concat(m());return u()?e({type:"page",selectors:t,declarations:i}):l("@page missing '}'")}()||function(){const e=s();if(!h(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=s();if(!h(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=m();for(;t=v();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function D(){const e=s(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):l("selector missing")}return ie(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}function ie(e,t){const n=e&&"string"==typeof e.type,i=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{ie(e,i)})):n&&"object"==typeof n&&ie(n,i)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const oe={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const re=/(max|min)-device-(width|height)/,ae=new RegExp(re.source,"g"),le=/([^\\]):hover/,ce=new RegExp(le.source,"g");function ue(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const i=te(e,{silent:!0});if(!i.stylesheet)return e;const o=[],s=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{le.test(e)&&o.push(e)})),"media"in t&&t.media&&re.test(t.media)&&s.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(i.stylesheet);let r=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>{const t=e.replace(ce,"$1.\\:hover");return`${e}, ${t}`}))}if(s.length>0){const e=new RegExp(s.filter(((e,t)=>s.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>se(e))).join("|"),"g");r=r.replace(e,(e=>e.replace(ae,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,r),r}function de(){return{stylesWithHoverClass:new Map}}function he(e,t){var n;const{doc:i,hackCss:o,cache:s}=t;switch(e.type){case Q.Document:return i.implementation.createDocument(null,"",null);case Q.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:{const t=function(e){let t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let r;e.isSVG?r=i.createElementNS("http://www.w3.org/2000/svg",t):(e.isCustom&&(null===(n=i.defaultView)||void 0===n?void 0:n.customElements)&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),r=i.createElement(t));const a={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;let l=e.attributes[n];if("option"===t&&"selected"===n&&!1===l)continue;if(null===l)continue;if(!0===l&&(l=""),n.startsWith("rr_")){a[n]=l;continue}const c="textarea"===t&&"value"===n,u="style"===t&&"_cssText"===n;if(u&&o&&"string"==typeof l&&(l=ue(l,s)),!c&&!u||"string"!=typeof l)try{if(e.isSVG&&"xlink:href"===n)r.setAttributeNS("http://www.w3.org/1999/xlink",n,l.toString());else if("onload"===n||"onclick"===n||"onmouse"===n.substring(0,7))r.setAttribute("_"+n,l.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===n){r.setAttribute("csp-content",l.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?r.setAttribute("rrweb-original-srcset",e.attributes.srcset):r.setAttribute(n,l.toString())))}}catch(e){}else r.appendChild(i.createTextNode(l)),e.childNodes=[]}for(const n in a){const o=a[n];if("canvas"===t&&"rr_dataURL"===n){const e=i.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.toString(),r.RRNodeType&&(r.rr_dataURL=o.toString())}else if("img"===t&&"rr_dataURL"===n){const t=r;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=o.toString())}if("rr_width"===n)r.style.width=o.toString();else if("rr_height"===n)r.style.height=o.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof o)r.currentTime=o;else if("rr_mediaState"===n)switch(o){case"played":r.play().catch((e=>console.warn("media playback error",e)));break;case"paused":r.pause()}else"rr_mediaPlaybackRate"===n&&"number"==typeof o?r.playbackRate=o:"rr_mediaMuted"===n&&"boolean"==typeof o?r.muted=o:"rr_mediaLoop"===n&&"boolean"==typeof o?r.loop=o:"rr_mediaVolume"===n&&"number"==typeof o&&(r.volume=o)}if(e.isShadowHost)if(r.shadowRoot)for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.firstChild);else r.attachShadow({mode:"open"});return r}case Q.Text:return i.createTextNode(e.isStyle&&o?ue(e.textContent,s):e.textContent);case Q.CDATA:return i.createCDATASection(e.textContent);case Q.Comment:return i.createComment(e.textContent);default:return null}}function pe(e,t){const{doc:n,mirror:i,skipChild:o=!1,hackCss:s=!0,afterAppend:r,cache:a}=t;if(i.has(e.id)){const t=i.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===Q.Document?e.compatMode===t.compatMode:e.type===Q.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===Q.Comment||e.type===Q.Text||e.type===Q.CDATA?e.textContent===t.textContent:e.type===Q.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(i.getMeta(t),e))return i.getNode(e.id)}let l=he(e,{doc:n,hackCss:s,cache:a});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==n&&i.replace(e.rootId,n),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=n),i.add(l,e),(e.type===Q.Document||e.type===Q.Element)&&!o)for(const t of e.childNodes){const o=pe(t,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:r,cache:a});if(o){if(t.isShadow&&J(l)&&l.shadowRoot)l.shadowRoot.appendChild(o);else if(e.type===Q.Document&&t.type==Q.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),l.appendChild(o),e.appendChild(t)):l.appendChild(o)}else l.appendChild(o);r&&r(o,t.id)}else console.warn("Failed to rebuild",t)}return l}function me(e,t){const{doc:n,onVisit:i,hackCss:o=!0,afterAppend:s,cache:r,mirror:a=new Z}=t,l=pe(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:s,cache:r});return function(e,t){for(const i of e.getIds())e.has(i)&&(n=e.getNode(i),t(n));var n}(a,(e=>{i&&i(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==Q.Element)return;const i=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(i.scrollLeft=t),"rr_scrollTop"===e&&(i.scrollTop=t)}}(e,a)})),l}var fe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(fe||{}),ge=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ge||{}),ye=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ye||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),be=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(be||{});const we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ee={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function Ne(e){const t={},n=(e,n)=>{const i={value:e,parent:n,children:[]};return t[e.node.id]=i,i},i=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=i.indexOf(s);i.splice(e,0,n(o,null))}}else if(s in t){const e=t[s];e.children.push(n(o,e))}else i.push(n(o,null))}return i}function Te(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Te(e.children[n],t)}function Se(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){var n,i;const o=null===(i=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===i?void 0:i.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),r=Me(o,t),a=s.height/o.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function De(e){return Boolean(null==e?void 0:e.shadowRoot)}function Ce(e,t){const n=e[t[0]];return 1===t.length?n:Ce(n.cssRules[t[1]].cssRules,t.slice(2))}function xe(e){const t=[...e],n=t.pop();return{positions:t,index:n}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ee=new Proxy(Ee,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());class Re{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function ke(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ie="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;Oe<Ae.length;Oe++)Ie[Ae.charCodeAt(Oe)]=Oe;var _e,$e;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null===(_e=e.contentWindow)||void 0===_e?void 0:_e.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}K(),function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}($e||($e={}));class Le{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Fe(e){const t=[];for(const n in e){const i=e[n];if("string"!=typeof i)continue;const o=Ve(n);t.push(`${o}: ${i};`)}return t.join(" ")}const Pe=/-([a-z])/g,Ue=/^--[a-zA-Z0-9-]+$/,Be=e=>Ue.test(e)?e:e.replace(Pe,((e,t)=>t?t.toUpperCase():"")),je=/\B([A-Z])/g,Ve=e=>e.replace(je,"-$1").toLowerCase();class We{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=Ke.ELEMENT_NODE,this.TEXT_NODE=Ke.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof We))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function ze(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Ke.DOCUMENT_TYPE_NODE,this.RRNodeType=$e.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function Ge(e){return class extends e{constructor(e){super(),this.nodeType=Ke.ELEMENT_NODE,this.RRNodeType=$e.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Xe(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const i=e.split(n);i.length>1&&(t[Be(i[0].trim())]=i[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,i,o)=>{if(t.test(n))return;const s=Be(n);i?e[s]=i:delete e[s],"important"===o&&(e[s]+=" !important"),this.attributes.style=Fe(e)},e.removeProperty=n=>{if(t.test(n))return"";const i=Be(n),o=e[i]||"";return delete e[i],this.attributes.style=Fe(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Qe(this,e)}insertBefore(e,t){return Je(this,e,t)}removeChild(e){return Ze(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function He(e){return class extends e{constructor(e){super(),this.nodeType=Ke.TEXT_NODE,this.nodeName="#text",this.RRNodeType=$e.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Ye(e){return class extends e{constructor(e){super(),this.nodeType=Ke.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=$e.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function qe(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Ke.CDATA_SECTION_NODE,this.RRNodeType=$e.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Xe{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function Qe(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Je(e,t,n){if(!n)return Qe(e,t);if(n.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Ze(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Ke;!function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Ke||(Ke={}));const et={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},tt={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let nt=null;function it(e,t,n,i=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,i){var o;n.afterAppend&&!nt&&(nt=new WeakSet,setTimeout((()=>{nt=null}),0));if(!rt(e,t)){const s=st(t,n.mirror,i);null===(o=e.parentNode)||void 0===o||o.replaceChild(s,e),e=s}switch(t.RRNodeType){case $e.Document:if(!at(e,t,n.mirror,i)){const o=i.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==nt||nt.add(e))}break;case $e.Element:{const o=e,s=t;switch(s.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;it(o,t.contentDocument,n,i);break}}s.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),ot(o.shadowRoot,s.shadowRoot,n,i)),function(e,t,n){const i=e.attributes,o=t.attributes;for(const i in o){const s=o[i],r=n.getMeta(t);if((null==r?void 0:r.isSVG)&&et[i])e.setAttributeNS(et[i],i,s);else if("CANVAS"===t.tagName&&"rr_dataURL"===i){const t=document.createElement("img");t.src=s,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===i)continue;e.setAttribute(i,s)}}for(const{name:t}of Array.from(i))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,s,i);break}}return e}(e,t,n,i),ot(e,t,n,i),function(e,t,n){var i;switch(t.RRNodeType){case $e.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case $e.Element:{const i=e,o=t;switch(o.scrollData&&n.applyScroll(o.scrollData,!0),o.inputData&&n.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const t=e,n=o;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate),void 0!==n.loop&&(t.loop=n.loop);break}case"CANVAS":{const o=t;if(null!==o.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=i.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.rr_dataURL}o.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=i.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case $e.Text:case $e.Comment:case $e.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==nt?void 0:nt.has(e))&&(nt.delete(e),null===(i=n.afterAppend)||void 0===i||i.call(n,e,n.mirror.getId(e)))}(e,t,n)}function ot(e,t,n,i){const o=Array.from(e.childNodes),s=t.childNodes;if(0===o.length&&0===s.length)return;let r,a,l=0,c=o.length-1,u=0,d=s.length-1,h=o[l],p=o[c],m=s[u],f=s[d];for(;l<=c&&u<=d;)if(void 0===h)h=o[++l];else if(void 0===p)p=o[--c];else if(at(h,m,n.mirror,i))h=o[++l],m=s[++u];else if(at(p,f,n.mirror,i))p=o[--c],f=s[--d];else if(at(h,f,n.mirror,i)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++l],f=s[--d]}else if(at(p,m,n.mirror,i)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--c],m=s[++u]}else{if(!r){r={};for(let e=l;e<=c;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(r[n.mirror.getId(t)]=e)}}a=r[i.getId(m)];const t=o[a];if(void 0!==a&&t&&at(t,m,n.mirror,i)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=st(m,n.mirror,i);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++l]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}m=s[++u]}if(l>c){const t=s[d+1];let o=null;for(t&&(o=n.mirror.getNode(i.getId(t)));u<=d;++u){const t=st(s[u],n.mirror,i);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;l<=c;l++){const t=o[l];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)it(g,y,n,i),g=g.nextSibling,y=y.nextSibling}function st(e,t,n){const i=n.getId(e),o=n.getMeta(e);let s=null;if(i>-1&&(s=t.getNode(i)),null!==s&&rt(s,e))return s;switch(e.RRNodeType){case $e.Document:s=new Document;break;case $e.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $e.Element:{let t=e.tagName.toLowerCase();t=tt[t]||t,s=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(et.svg,t):document.createElement(e.tagName);break}case $e.Text:s=document.createTextNode(e.data);break;case $e.Comment:s=document.createComment(e.data);break;case $e.CDATA:s=document.createCDATASection(e.data)}o&&t.add(s,Object.assign({},o));try{null==nt||nt.add(s)}catch(e){}return s}function rt(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function at(e,t,n,i){const o=n.getId(e),s=i.getId(t);return-1!==o&&o===s&&rt(e,t)}class lt extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=Ke.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=$e.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===$e.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===$e.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===$e.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===$e.Element||t===$e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===$e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=Qe(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===$e.Element||n===$e.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===$e.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Je(this,e,t);return i.parentElement=null,i}removeChild(e){return Ze(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,i){return new t}createDocumentType(e,t,n){const i=new(ze(We))(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=new(Ge(We))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(He(We))(e);return t.ownerDocument=this,t}createComment(e){const t=new(Ye(We))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(qe(We))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(We)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new wt,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new lt}createDocumentType(e,t,n){const i=new ct(e,t,n);return i.ownerDocument=this,i}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new dt(t);break;case"IFRAME":n=new mt(t,this.mirror);break;case"CANVAS":n=new ht(t);break;case"STYLE":n=new pt(t);break;default:n=new ut(t)}return n.ownerDocument=this,n}createComment(e){const t=new gt(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new yt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new ft(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const ct=ze(We);class ut extends(Ge(We)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class dt extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(ut)){}class ht extends ut{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class pt extends ut{constructor(){super(...arguments),this.rules=[]}}class mt extends ut{constructor(e,t){super(e),this.contentDocument=new lt,this.contentDocument.mirror=t}}const ft=He(We),gt=Ye(We),yt=qe(We);function vt(e,t,n,i){let o;switch(e.nodeType){case Ke.DOCUMENT_NODE:i&&"IFRAME"===i.nodeName?o=i.contentDocument:(o=t,o.compatMode=e.compatMode);break;case Ke.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Ke.ELEMENT_NODE:{const n=e,i=function(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}(n);o=t.createElement(i);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Ke.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case Ke.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case Ke.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case Ke.DOCUMENT_FRAGMENT_NODE:o=i.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof lt&&(s||(s=Et(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function bt(e,t=function(){return new Le}(),n=new lt){return function e(i,o){const s=vt(i,n,t,o);if(null!==s)if("IFRAME"!==(null==o?void 0:o.nodeName)&&i.nodeType!==Ke.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(s),s.parentNode=o,s.parentElement=o),"IFRAME"===i.nodeName){const t=i.contentDocument;t&&e(t,s)}else i.nodeType!==Ke.DOCUMENT_NODE&&i.nodeType!==Ke.ELEMENT_NODE&&i.nodeType!==Ke.DOCUMENT_FRAGMENT_NODE||(i.nodeType===Ke.ELEMENT_NODE&&i.shadowRoot&&e(i.shadowRoot,s),i.childNodes.forEach((t=>e(t,s))))}(e,null),n}class wt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Et(e,t){switch(e.RRNodeType){case $e.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $e.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case $e.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $e.Text:case $e.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $e.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Nt=Uint8Array,Tt=Uint16Array,St=Uint32Array,Mt=new Nt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Dt=new Nt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new Nt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xt=function(e,t){for(var n=new Tt(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var o=new St(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]},Rt=xt(Mt,2),kt=Rt[0],At=Rt[1];kt[28]=258,At[258]=28;for(var It=xt(Dt,0)[0],Ot=new Tt(32768),_t=0;_t<32768;++_t){var $t=(43690&_t)>>>1|(21845&_t)<<1;$t=(61680&($t=(52428&$t)>>>2|(13107&$t)<<2))>>>4|(3855&$t)<<4,Ot[_t]=((65280&$t)>>>8|(255&$t)<<8)>>>1}var Lt=function(e,t,n){for(var i=e.length,o=0,s=new Tt(t);o<i;++o)++s[e[o]-1];var r,a=new Tt(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new Tt(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=a[e[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)r[Ot[d]>>>l]=c}else for(r=new Tt(i),o=0;o<i;++o)r[o]=Ot[a[e[o]-1]++]>>>15-e[o];return r},Ft=new Nt(288);for(_t=0;_t<144;++_t)Ft[_t]=8;for(_t=144;_t<256;++_t)Ft[_t]=9;for(_t=256;_t<280;++_t)Ft[_t]=7;for(_t=280;_t<288;++_t)Ft[_t]=8;var Pt=new Nt(32);for(_t=0;_t<32;++_t)Pt[_t]=5;var Ut=Lt(Ft,9,1),Bt=Lt(Pt,5,1),jt=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Vt=function(e,t,n){var i=t/8>>0;return(e[i]|e[i+1]<<8)>>>(7&t)&n},Wt=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},zt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Tt?Tt:e instanceof St?St:Nt)(n-t);return i.set(e.subarray(t,n)),i};function Gt(e,t){return function(e,t,n){var i=e.length,o=!t||n,s=!n||n.i;n||(n={}),t||(t=new Nt(3*i));var r,a=function(e){var n=t.length;if(e>n){var i=new Nt(Math.max(2*n,e));i.set(t),t=i}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,h=n.d,p=n.m,m=n.n,f=8*i;do{if(!d){n.f=l=Vt(e,c,1);var g=Vt(e,c+1,3);if(c+=3,!g){var y=e[(x=((r=c)/8>>0)+(7&r&&1)+4)-4]|e[x-3]<<8,v=x+y;if(v>i){if(s)throw"unexpected EOF";break}o&&a(u+y),t.set(e.subarray(x,v),u),n.b=u+=y,n.p=c=8*v;continue}if(1==g)d=Ut,h=Bt,p=9,m=5;else{if(2!=g)throw"invalid block type";var b=Vt(e,c,31)+257,w=Vt(e,c+10,15)+4,E=b+Vt(e,c+5,31)+1;c+=14;for(var N=new Nt(E),T=new Nt(19),S=0;S<w;++S)T[Ct[S]]=Vt(e,c+3*S,7);c+=3*w;var M=jt(T),D=(1<<M)-1;if(!s&&c+E*(M+7)>f)break;var C=Lt(T,M,1);for(S=0;S<E;){var x,R=C[Vt(e,c,D)];if(c+=15&R,(x=R>>>4)<16)N[S++]=x;else{var k=0,A=0;for(16==x?(A=3+Vt(e,c,3),c+=2,k=N[S-1]):17==x?(A=3+Vt(e,c,7),c+=3):18==x&&(A=11+Vt(e,c,127),c+=7);A--;)N[S++]=k}}var I=N.subarray(0,b),O=N.subarray(b);p=jt(I),m=jt(O),d=Lt(I,p,1),h=Lt(O,m,1)}if(c>f)throw"unexpected EOF"}o&&a(u+131072);for(var _=(1<<p)-1,$=(1<<m)-1,L=p+m+18;s||c+L<f;){var F=(k=d[Wt(e,c)&_])>>>4;if((c+=15&k)>f)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(F<256)t[u++]=F;else{if(256==F){d=null;break}var P=F-254;if(F>264){var U=Mt[S=F-257];P=Vt(e,c,(1<<U)-1)+kt[S],c+=U}var B=h[Wt(e,c)&$],j=B>>>4;if(!B)throw"invalid distance";if(c+=15&B,O=It[j],j>3&&(U=Dt[j],O+=Wt(e,c)&(1<<U)-1,c+=U),c>f)throw"unexpected EOF";o&&a(u+131072);for(var V=u+P;u<V;u+=4)t[u]=t[u-O],t[u+1]=t[u+1-O],t[u+2]=t[u+2-O],t[u+3]=t[u+3-O];u=V}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=h,n.n=m)}while(!l);return u==t.length?t:zt(t,0,u)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}const Ht=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var i=0;i<e.length;){var o=e[i++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[i++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[i++])<<6|63&e[i++]):(o=((15&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(Gt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Nt(e.length+(e.length>>>1)),o=0,s=function(e){i[o++]=e},r=0;r<n;++r){if(o+5>i.length){var a=new Nt(o+8+(n-r<<1));a.set(i),i=a}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++r))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return zt(i,0,o)}(e,!0))));if("v1"===t.v)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}},Yt=new Map;function qt(e,t){let n=Yt.get(e);return n||(n=new Map,Yt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Xt(e,t,n){return i=>ke(this,void 0,void 0,(function*(){if(i&&"object"==typeof i&&"rr_type"in i){if(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i){const o=yield Xt(e,t,n)(i.args);return yield createImageBitmap.apply(null,o)}if("index"in i){if(n||null===t)return i;const{rr_type:e,index:o}=i;return qt(t,e)[o]}if("args"in i){const{rr_type:o,args:s}=i;return new(0,window[o])(...yield Promise.all(s.map(Xt(e,t,n))))}if("base64"in i)return function(e){var t,n,i,o,s,r=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);var c=new ArrayBuffer(r),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=Ie[e.charCodeAt(t)],i=Ie[e.charCodeAt(t+1)],o=Ie[e.charCodeAt(t+2)],s=Ie[e.charCodeAt(t+3)],u[l++]=n<<2|i>>4,u[l++]=(15&i)<<4|o>>2,u[l++]=(3&o)<<6|63&s;return c}(i.base64);if("src"in i){const t=e.get(i.src);if(t)return t;{const t=new Image;return t.src=i.src,e.set(i.src,t),t}}if("data"in i&&"Blob"===i.rr_type){const o=yield Promise.all(i.data.map(Xt(e,t,n)));return new Blob(o,{type:i.type})}}else if(Array.isArray(i)){return yield Promise.all(i.map(Xt(e,t,n)))}return i}))}const Qt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Jt({mutation:e,target:t,type:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const s=o[e.property],r=yield Promise.all(e.args.map(Xt(i,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!Qt.includes(n))return;const i=qt(e,n);i.includes(t)||i.push(t)}(o,s.apply(o,r))}catch(t){o(e,t)}}))}function Zt({event:e,mutation:t,target:n,imageMap:i,canvasEventMap:o,errorHandler:s}){return ke(this,void 0,void 0,(function*(){try{const r=o.get(e)||t,a="commands"in r?r.commands:[r];if([ve.WebGL,ve.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const o=a[e];yield Jt({mutation:o,type:t.type,target:n,imageMap:i,errorHandler:s})}return}yield function({event:e,mutations:t,target:n,imageMap:i,errorHandler:o}){return ke(this,void 0,void 0,(function*(){const s=n.getContext("2d");if(!s)return void o(t[0],new Error("Canvas context is null"));const r=t.map((e=>ke(this,void 0,void 0,(function*(){return Promise.all(e.args.map(Xt(i,s)))}))));(yield Promise.all(r)).forEach(((n,r)=>{const a=t[r];try{if(a.setter)return void(s[a.property]=a.args[0]);const t=s[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(i.get(e),t.apply(s,a.args)):t.apply(s,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:i,errorHandler:s})}catch(e){s(t,e)}}))}function Kt(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map((function(e){e(n)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,n)}))}}}var en,tn=Object.freeze({__proto__:null,default:Kt});
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */function nn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(en||(en={}));var on={type:"xstate.init"};function sn(e){return void 0===e?[]:[].concat(e)}function rn(e){return{type:"xstate.assign",assignment:e}}function an(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function ln(e){return function(t){return e===t}}function cn(e){return"string"==typeof e?{type:e}:e}function un(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ln(e)}}function dn(e,t,n){var i=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},i);return"function"==typeof e.assignment?t=e.assignment(i,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](i,n):e.assignment[o]})),i=t,!1}return!0})),i,o]}function hn(e,t){void 0===t&&(t={});var n=nn(dn(sn(e.states[e.initial].entry).map((function(e){return an(e,t.actions)})),e.context,on),2),i=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:i,context:o,matches:ln(e.initial)},transition:function(t,n){var i,o,r="string"==typeof t?{value:t,context:e.context}:t,a=r.value,l=r.context,c=cn(n),u=e.states[a];if(u.on){var d=sn(u.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var m=p.value;if(void 0===m)return un(a,l);var f="string"==typeof m?{target:m}:m,g=f.target,y=f.actions,v=void 0===y?[]:y,b=f.cond,w=void 0===b?function(){return!0}:b,E=void 0===g,N=null!=g?g:a,T=e.states[N];if(w(l,c)){var S=nn(dn((E?sn(v):[].concat(u.exit,v,T.entry).filter((function(e){return e}))).map((function(e){return an(e,s._options.actions)})),l,c),3),M=S[0],D=S[1],C=S[2],x=null!=g?g:a;return{value:x,context:D,actions:M,changed:g!==a||M.length>0||C,matches:ln(x)}}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}return un(a,l)}};return s}var pn=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function mn(e){var t=e.initialState,n=en.NotStarted,i=new Set,o={_machine:e,send:function(o){n===en.Running&&(t=e.transition(t,o),pn(t,cn(o)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(i){if(i){var s="object"==typeof i?i:{context:e.config.context,value:i};t={value:s.value,actions:[],context:s.context,matches:ln(s.value)}}return n=en.Running,pn(t,on),o},stop:function(){return n=en.Stopped,i.clear(),o},get state(){return t},get status(){return n}};return o}class fn{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i+1;n=i-1}}return t}}function gn(e,t){if(e.type===fe.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}function yn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:i}){const o=hn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:rn({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:rn(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:s,events:r,baselineTime:a,lastPlayedEvent:l}=e;s.clear();for(const e of r)gn(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.type===fe.Meta&&i.timestamp<=t)return e.slice(n)}return e}(r,a);let u=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===fe.IncrementalSnapshot&&l.data.source===ge.MouseMove&&(u=l.timestamp+(null===(o=l.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&i.emit(be.PlayBack);const d=new Array;for(const e of c)if(!(u&&u<a&&(e.timestamp<=u||e===l)))if(e.timestamp<a)d.push(e);else{const n=t(e,!1);s.addAction({doAction:()=>{n()},delay:e.delay})}n(d),i.emit(be.Flush),s.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:rn((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:rn({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:rn(((e,n)=>{const{baselineTime:i,timer:o,events:s}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;gn(e,i);let r=s.length-1;if(!s[r]||s[r].timestamp<=e.timestamp)s.push(e);else{let t=-1,n=0;for(;n<=r;){const t=Math.floor((n+r)/2);s[t].timestamp<=e.timestamp?n=t+1:r=t-1}-1===t&&(t=n),s.splice(t,0,e)}const a=e.timestamp<i,l=t(e,a);a?l():o.isActive()&&o.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:s})}))}});return mn(o)}function vn(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function u(t,n){const i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function d(e){const t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){let n,i,s,r=(o()-t.startTime)/468;var a;r=r>1?1:r,a=r,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,s),i===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function m(n,s,r){let l,c,u,d;const h=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=a),p({scrollable:l,method:d,startTime:h,startX:c,startY:u,x:s,y:r})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?m.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0===arguments[0])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=h(this),o=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+s.left-o.left,n.scrollTop+s.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}}class bn{constructor(e){this.mediaMap=new Map,this.metadataCallbackMap=new Map,this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(be.Start,this.start.bind(this)),this.emitter.on(be.SkipStart,this.start.bind(this)),this.emitter.on(be.Pause,this.pause.bind(this)),this.emitter.on(be.Finish,this.pause.bind(this)),this.speedService.subscribe((()=>{this.syncAllMediaElements()}))}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach(((t,n)=>{this.syncTargetWithState(n),e.pause&&n.pause()}))}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:n}){if(n.isPlaying){const i=(e-n.lastInteractionTimeOffset)/1e3*n.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o))return void this.waitForMetadata(t);let s=n.currentTimeAtLastInteraction+i;t.loop&&!1!==o&&(s%=o),t.currentTime=s}else t.pause(),t.currentTime=n.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e))return;if(!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const t=this.mediaMap.get(e);t&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:n}){var i,o,s,r,a;const l=this.mediaMap.get(e),{type:c,playbackRate:u,currentTime:d,muted:h,volume:p,loop:m}=n;return{isPlaying:0===c||1!==c&&((null==l?void 0:l.isPlaying)||null!==e.getAttribute("autoplay")),currentTimeAtLastInteraction:null!==(i=null!=d?d:null==l?void 0:l.currentTimeAtLastInteraction)&&void 0!==i?i:0,lastInteractionTimeOffset:t,playbackRate:null!==(o=null!=u?u:null==l?void 0:l.playbackRate)&&void 0!==o?o:1,volume:null!==(s=null!=p?p:null==l?void 0:l.volume)&&void 0!==s?s:1,muted:null!==(r=null!=h?h:null==l?void 0:l.muted)&&void 0!==r?r:null===e.getAttribute("muted"),loop:null!==(a=null!=m?m:null==l?void 0:l.loop)&&void 0!==a?a:null===e.getAttribute("loop")}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:n,loop:i,volume:o,isPlaying:s}=t,r=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==o&&(e.volume=o),e.muted=n,e.loop=i,e.playbackRate!==a&&(e.playbackRate=a),s&&!r?e.play():e.pause()}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}}addMediaElements(e,t,n){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=n.getMeta(i);if(!o||!("attributes"in o))return;const s=this.service.state.matches("paused"),r=o.attributes;let a=!1;a=r.rr_mediaState?"played"===r.rr_mediaState:null!==i.getAttribute("autoplay"),a&&s&&i.pause();let l=1;"number"==typeof r.rr_mediaPlaybackRate&&(l=r.rr_mediaPlaybackRate);let c=!1;c="boolean"==typeof r.rr_mediaMuted?r.rr_mediaMuted:null!==i.getAttribute("muted");let u=!1;u="boolean"==typeof r.rr_mediaLoop?r.rr_mediaLoop:null!==i.getAttribute("loop");let d=1;"number"==typeof r.rr_mediaVolume&&(d=r.rr_mediaVolume);let h=0;"number"==typeof r.rr_mediaCurrentTime&&(h=r.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:a,currentTimeAtLastInteraction:h,lastInteractionTimeOffset:t,playbackRate:l,volume:d,muted:c,loop:u}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:n}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:n})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}const wn=Kt||tn,En="[replayer]",Nn={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Tn(e){return e.type==fe.IncrementalSnapshot&&(e.data.source==ge.TouchMove||e.data.source==ge.MouseInteraction&&e.data.type==ye.TouchStart)}class Sn{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new lt,this.mouseTail=null,this.tailPositions=[],this.emitter=wn(),this.legacy_missingNodeRetryMap={},this.cache=de(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=K(),this.styleMirror=new Re,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case fe.DomContentLoaded:case fe.Load:case fe.Custom:continue;case fe.FullSnapshot:case fe.Meta:case fe.Plugin:case fe.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case fe.DomContentLoaded:case fe.Load:break;case fe.Custom:n=()=>{this.emitter.emit(be.CustomEvent,e)};break;case fe.Meta:n=()=>this.emitter.emit(be.Resize,{width:e.data.width,height:e.data.height});break;case fe.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset)};break;case fe.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&this.config.skipInactive&&!this.nextUserInteractionEvent){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay;this.play(this.getCurrentTime()+t),this.nextUserInteractionEvent=null}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const i=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[i]){const t=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(be.Finish))};let n=50;e.type===fe.IncrementalSnapshot&&e.data.source===ge.MouseMove&&e.data.positions.length&&(n+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,n)}this.emitter.emit(be.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:1e4,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Nn,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(be.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(be.Flush,(()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Zt({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{it(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],i=st(n.node,this.mirror,this.virtualDom.mirror);it(i,n.node,e,this.virtualDom.mirror),n.node=i}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(be.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()}));const i=new fn([],{speed:this.config.speed});this.service=yn({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>e.timestamp-t.timestamp)),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((e=>{this.emitter.emit(be.StateChange,{player:e})})),this.speedService=mn(hn({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:rn({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(be.StateChange,{speed:e})})),this.mediaManager=new bn({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find((e=>e.type===fe.Meta)),s=this.service.state.context.events.find((e=>e.type===fe.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(be.Resize,{width:e,height:t})}),0)}s&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(Tn)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(be.Start)}pause(e){var t,n;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(be.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(be.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(be.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Tn(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event:t}})))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=de()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(vn(this.iframe.contentWindow,this.iframe.contentDocument),function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],i=(t,i)=>{if(this.collectIframeAndAttachDocument(n,t),this.mediaManager.isSupportedMediaElement(t)){const{events:n}=this.service.state.context;this.mediaManager.addMediaElements(t,e.timestamp-n[0].timestamp,this.mirror)}for(const e of this.config.plugins||[])e.onBuild&&e.onBuild(t,{id:i,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),me(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(be.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const i=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Et(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:ge.StyleSheetRule,adds:i.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e<i.length;e++)null===(n=o.sheet)||void 0===n||n.insertRule(i[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(e,o)=>{this.collectIframeAndAttachDocument(i,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===Q.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};pe(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of i)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Se(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,i=this.service.state;const o=()=>{i=this.service.state};this.emitter.on(be.Start,o),this.emitter.on(be.Pause,o);const s=()=>{this.emitter.off(be.Start,o),this.emitter.off(be.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(be.LoadStylesheetEnd),n&&clearTimeout(n),s())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(be.LoadStylesheetStart),n=setTimeout((()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}}preloadAllImages(){return ke(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(be.Start,e),this.emitter.on(be.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===fe.IncrementalSnapshot&&e.data.source===ge.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),i=null==n?void 0:n.createImageData(t.width,t.height);null==i||i.data,JSON.parse(e.args[0]),null==n||n.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return ke(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map((e=>ke(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(Xt(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Xt(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:i}))}}}))}applyIncremental(e,t){var n,i,o;const{data:s}=e;switch(s.source){case ge.Mutation:try{this.applyMutation(s,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,s)}break;case ge.Drag:case ge.TouchMove:case ge.MouseMove:if(t){const e=s.positions[s.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:s}}else s.positions.forEach((n=>{const i={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,s)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(i)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=s.positions[0])||void 0===n?void 0:n.timeOffset)});break;case ge.MouseInteraction:{if(-1===s.id)break;const e=new Event(ye[s.type].toLowerCase()),n=this.mirror.getNode(s.id);if(!n)return this.debugNodeNotFound(s,s.id);this.emitter.emit(be.MouseInteraction,{type:s.type,target:n});const{triggerFocus:i}=this.config;switch(s.type){case ye.Blur:"blur"in n&&n.blur();break;case ye.Focus:i&&n.focus&&n.focus({preventScroll:!0});break;case ye.Click:case ye.TouchStart:case ye.TouchEnd:case ye.MouseDown:case ye.MouseUp:t?(s.type===ye.TouchStart?this.touchActive=!0:s.type===ye.TouchEnd&&(this.touchActive=!1),s.type===ye.MouseDown?this.lastMouseDownEvent=[n,e]:s.type===ye.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x||0,y:s.y||0,id:s.id,debugData:s}):(s.type===ye.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x||0,s.y||0,s.id,t,s),s.type===ye.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ye.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ye.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case ye.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case ge.Scroll:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.scrollData=s;break}this.applyScroll(s,t);break;case ge.ViewportResize:this.emitter.emit(be.Resize,{width:s.width,height:s.height});break;case ge.Input:if(-1===s.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(s.id);if(!e)return this.debugNodeNotFound(s,s.id);e.inputData=s;break}this.applyInput(s);break;case ge.MediaInteraction:{const t=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);const n=t,{events:i}=this.service.state.context;this.mediaManager.mediaMutation({target:n,timeOffset:e.timestamp-i[0].timestamp,mutation:s});break}case ge.StyleSheetRule:case ge.StyleDeclaration:this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&(null===(i=this.virtualDom.mirror.getNode(s.id))||void 0===i||i.rules.push(s)):this.applyStyleSheetMutation(s);break;case ge.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);t.canvasMutations.push({event:e,mutation:s})}else{const t=this.mirror.getNode(s.id);if(!t)return this.debugNodeNotFound(s,s.id);Zt({event:e,mutation:s,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case ge.Font:try{const e=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case ge.Selection:if(t){this.lastSelectionData=s;break}this.applySelection(s);break;case ge.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,bt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=vt(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o)return;let s=n.getNode(t.parentId);if(!s)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&De(s)&&(s=s.shadowRoot),n.removeNodeFromMap(o),s)try{s.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",s,o,e)}}));const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=e=>{var t,s;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let r=n.getNode(e.parentId);if(!r)return e.node.type===Q.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(De(r)||r.attachShadow({mode:"open"}),r=r.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Se(r,n))return void this.attachDocumentToIframe(e,r);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=pe(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(i[e.node.id]={node:d,mutation:e});const h=n.getMeta(r);if(h&&h.type===Q.Element&&"textarea"===h.tagName&&e.node.type===Q.Text){const e=Array.isArray(r.childNodes)?r.childNodes:Array.from(r.childNodes);for(const t of e)t.nodeType===r.TEXT_NODE&&r.removeChild(t)}else if((null==h?void 0:h.type)===Q.Document){const n=r;e.node.type===Q.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?r.insertBefore(d,a.nextSibling):l&&l.parentNode?r.contains(l)?r.insertBefore(d,l):r.insertBefore(d,null):r.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===r.nodeName&&(null===(s=r.rules)||void 0===s?void 0:s.length)>0&&(r.rules=[]),Se(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(i,r,d,e)};e.adds.forEach((e=>{s(e)}));const r=Date.now();for(;o.length;){const e=Ne(o);if(o.length=0,Date.now()-r>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?Te(t,(e=>{s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),function(e){const t=new Set,n=[];for(let i=e.length;i--;){const o=e[i];t.has(o.id)||(n.push(o),t.add(o.id))}return n}(e.texts).forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(i=null==e?void 0:e.rules)||void 0===i?void 0:i.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{var i;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const s=t.attributes[e];if(null===s)o.removeAttribute(e);else if("string"==typeof s)try{if("_cssText"===e&&("LINK"===o.nodeName||"STYLE"===o.nodeName))try{const e=n.getMeta(o);Object.assign(e.attributes,t.attributes);const i=pe(e,{doc:o.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),s=o.nextSibling,r=o.parentNode;if(i&&r){r.removeChild(o),r.insertBefore(i,s),n.replace(t.id,i);break}}catch(e){}if("value"===e&&"TEXTAREA"===o.nodeName){const e=o;e.childNodes.forEach((t=>e.removeChild(t)));const t=null===(i=o.ownerDocument)||void 0===i?void 0:i.createTextNode(s);t&&e.appendChild(t)}else o.setAttribute(e,s)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=s,t=o;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const i=e[n];t.style.setProperty(n,i[0],i[1])}else{const i=e[n];t.style.setProperty(n,i)}}}}))}applyScroll(e,t){var n,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===Q.Document)null===(i=o.defaultView)||void 0===i||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:i,endOffset:o})=>{const s=this.mirror.getNode(e),r=this.mirror.getNode(i);if(!s||!r)return;const a=new Range;a.setStart(s,n),a.setEnd(r,o);const l=s.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===ge.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===ge.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,i,o,s;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:i,index:o}=xe(n);Ce(t.cssRules,i).insertRule(e,o)}else{const i=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,i)}}catch(e){}})),null===(i=e.removes)||void 0===i||i.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:i}=xe(e);Ce(t.cssRules,n).deleteRule(i||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(s=t.replaceSync)||void 0===s||s.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Ce(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Ce(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let i=null,o=null;if(De(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{i=new o.CSSStyleSheet,this.styleMirror.add(i,e.styleId),this.applyStyleSheetRule({source:ge.StyleSheetRule,adds:e.rules},i)}catch(e){}}));let i=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));De(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&i<10&&(setTimeout((()=>o(e,t)),0+100*i),i++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,i){const{previousId:o,nextId:s}=i,r=o&&e[o],a=s&&e[s];if(r){const{node:i,mutation:o}=r;t.insertBefore(i,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}if(a){const{node:i,mutation:o}=a;t.insertBefore(i,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,i,o)}}moveAndHover(e,t,n,i,o){const s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);const r=Me(s,this.iframe),a=e*r.absoluteScale+r.x,l=t*r.absoluteScale+r.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:a,y:l}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:i,duration:o}=!0===this.config.mouseTail?Nn:Object.assign({},Nn,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=i,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),s(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),s()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===fe.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(be.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(En,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(En,...e)}}function Mn(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function Dn(e,t=2){let n=String(e);const i=Math.pow(10,t-1);if(e<i)for(;String(i).length>n.length;)n=`0${e}`;return n}const Cn=6e4,xn=36e5;function Rn(e){if(e<=0)return"00:00";const t=Math.floor(e/xn);e%=xn;const n=Math.floor(e/Cn);e%=Cn;const i=Math.floor(e/1e3);return t?`${Dn(t)}:${Dn(n)}:${Dn(i)}`:`${Dn(n)}:${Dn(i)}`}function kn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach((t=>{t in document&&(e=e||Boolean(document[t]))})),e}function An(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function In(e){return e.type===fe.IncrementalSnapshot&&(e.data.source>ge.Mutation&&e.data.source<=ge.Input)}function On(t){let n,i,o,s,r,a,d,p,b;return{c(){n=h("div"),i=h("input"),o=f(),s=h("label"),r=f(),a=h("span"),d=m(t[3]),y(i,"type","checkbox"),y(i,"id",t[2]),i.disabled=t[1],y(i,"class","svelte-9brlez"),y(s,"for",t[2]),y(s,"class","svelte-9brlez"),y(a,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),w(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,i),i.checked=t[0],l(n,o),l(n,s),l(n,r),l(n,a),l(a,d),p||(b=g(i,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(i,"id",e[2]),2&t&&(i.disabled=e[1]),1&t&&(i.checked=e[0]),4&t&&y(s,"for",e[2]),8&t&&v(d,e[3]),2&t&&w(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,b()}}}function _n(e,t,n){let{disabled:i}=t,{checked:o}=t,{id:s}=t,{label:r}=t;return e.$$set=e=>{"disabled"in e&&n(1,i=e.disabled),"checked"in e&&n(0,o=e.checked),"id"in e&&n(2,s=e.id),"label"in e&&n(3,r=e.label)},[o,i,s,r,function(){o=this.checked,n(0,o)}]}class $n extends X{constructor(e){super(),q(this,e,_n,On,r,{disabled:1,checked:0,id:2,label:3})}}function Ln(e,t,n){const i=e.slice();return i[39]=t[n],i}function Fn(e,t,n){const i=e.slice();return i[42]=t[n],i}function Pn(e,t,n){const i=e.slice();return i[45]=t[n],i}function Un(e){let t,n,i,s,r,a,p,E,N,T,S,M,D,C,R,A,I,O,_,$,L,F,P,U,B,j,Y=Rn(e[6])+"",q=Rn(e[8].totalTime)+"",X=e[14],Q=[];for(let t=0;t<X.length;t+=1)Q[t]=Bn(Pn(e,X,t));let J=e[9],Z=[];for(let t=0;t<J.length;t+=1)Z[t]=jn(Fn(e,J,t));function K(e,t){return"playing"===e[7]?Wn:Vn}let ee=K(e),te=ee(e),ne=e[3],ie=[];for(let t=0;t<ne.length;t+=1)ie[t]=zn(Ln(e,ne,t));function oe(t){e[30](t)}let se={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(se.checked=e[0]),$=new $n({props:se}),x.push((()=>function(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}($,"checked",oe))),{c(){t=h("div"),n=h("div"),i=h("span"),s=m(Y),r=f(),a=h("div"),p=h("div"),E=f();for(let e=0;e<Q.length;e+=1)Q[e].c();N=f();for(let e=0;e<Z.length;e+=1)Z[e].c();T=f(),S=h("div"),M=f(),D=h("span"),C=m(q),R=f(),A=h("div"),I=h("button"),te.c(),O=f();for(let e=0;e<ie.length;e+=1)ie[e].c();_=f(),z($.$$.fragment),F=f(),P=h("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(i,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),b(p,"width",e[13]),y(S,"class","rr-progress__handler svelte-19ke1iv"),b(S,"left",e[13]),y(a,"class","rr-progress svelte-19ke1iv"),w(a,"disabled","skipping"===e[10]),y(D,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(I,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(A,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(o,u){c(o,t,u),l(t,n),l(n,i),l(i,s),l(n,r),l(n,a),l(a,p),e[27](p),l(a,E);for(let e=0;e<Q.length;e+=1)Q[e]&&Q[e].m(a,null);l(a,N);for(let e=0;e<Z.length;e+=1)Z[e]&&Z[e].m(a,null);l(a,T),l(a,S),e[28](a),l(n,M),l(n,D),l(D,C),l(t,R),l(t,A),l(A,I),te.m(I,null),l(A,O);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(A,null);l(A,_),G($,A,null),l(A,F),l(A,P),U=!0,B||(j=[g(a,"click",e[16]),g(I,"click",e[4]),g(P,"click",e[31])],B=!0)},p(e,t){if((!U||64&t[0])&&Y!==(Y=Rn(e[6])+"")&&v(s,Y),(!U||8192&t[0])&&b(p,"width",e[13]),16384&t[0]){let n;for(X=e[14],n=0;n<X.length;n+=1){const i=Pn(e,X,n);Q[n]?Q[n].p(i,t):(Q[n]=Bn(i),Q[n].c(),Q[n].m(a,N))}for(;n<Q.length;n+=1)Q[n].d(1);Q.length=X.length}if(512&t[0]){let n;for(J=e[9],n=0;n<J.length;n+=1){const i=Fn(e,J,n);Z[n]?Z[n].p(i,t):(Z[n]=jn(i),Z[n].c(),Z[n].m(a,T))}for(;n<Z.length;n+=1)Z[n].d(1);Z.length=J.length}if((!U||8192&t[0])&&b(S,"left",e[13]),(!U||1024&t[0])&&w(a,"disabled","skipping"===e[10]),(!U||256&t[0])&&q!==(q=Rn(e[8].totalTime)+"")&&v(C,q),ee!==(ee=K(e))&&(te.d(1),te=ee(e),te&&(te.c(),te.m(I,null))),1066&t[0]){let n;for(ne=e[3],n=0;n<ne.length;n+=1){const i=Ln(e,ne,n);ie[n]?ie[n].p(i,t):(ie[n]=zn(i),ie[n].c(),ie[n].m(A,_))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=ne.length}const n={};var i;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],i=()=>L=!1,k.push(i)),$.$set(n)},i(e){U||(V($.$$.fragment,e),U=!0)},o(e){W($.$$.fragment,e),U=!1},d(n){n&&u(t),e[27](null),d(Q,n),d(Z,n),e[28](null),te.d(),d(ie,n),H($),B=!1,o(j)}}}function Bn(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[45].name),b(t,"width",e[45].width),b(t,"height","4px"),b(t,"position","absolute"),b(t,"background",e[45].background),b(t,"left",e[45].position)},m(e,n){c(e,t,n)},p(e,i){16384&i[0]&&n!==(n=e[45].name)&&y(t,"title",n),16384&i[0]&&b(t,"width",e[45].width),16384&i[0]&&b(t,"background",e[45].background),16384&i[0]&&b(t,"left",e[45].position)},d(e){e&&u(t)}}}function jn(e){let t,n;return{c(){t=h("div"),y(t,"title",n=e[42].name),b(t,"width","10px"),b(t,"height","5px"),b(t,"position","absolute"),b(t,"top","2px"),b(t,"transform","translate(-50%, -50%)"),b(t,"background",e[42].background),b(t,"left",e[42].position)},m(e,n){c(e,t,n)},p(e,i){512&i[0]&&n!==(n=e[42].name)&&y(t,"title",n),512&i[0]&&b(t,"background",e[42].background),512&i[0]&&b(t,"left",e[42].position)},d(e){e&&u(t)}}}function Vn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function Wn(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,i){c(e,t,i),l(t,n)},d(e){e&&u(t)}}}function zn(e){let t,n,i,o,s,r,a=e[39]+"";function d(){return e[29](e[39])}return{c(){t=h("button"),n=m(a),i=m("x"),t.disabled=o="skipping"===e[10],y(t,"class","svelte-19ke1iv"),w(t,"active",e[39]===e[1]&&"skipping"!==e[10])},m(e,o){c(e,t,o),l(t,n),l(t,i),s||(r=g(t,"click",d),s=!0)},p(i,s){e=i,8&s[0]&&a!==(a=e[39]+"")&&v(n,a),1024&s[0]&&o!==(o="skipping"===e[10])&&(t.disabled=o),1034&s[0]&&w(t,"active",e[39]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),s=!1,r()}}}function Gn(e){let t,n,i=e[2]&&Un(e);return{c(){i&&i.c(),t=m("")},m(e,o){i&&i.m(e,o),c(e,t,o),n=!0},p(e,n){e[2]?i?(i.p(e,n),4&n[0]&&V(i,1)):(i=Un(e),i.c(),V(i,1),i.m(t.parentNode,t)):i&&(B(),W(i,1,1,(()=>{i=null})),j())},i(e){n||(V(i),n=!0)},o(e){W(i),n=!1},d(e){i&&i.d(e),e&&u(t)}}}function Hn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Yn(e,t,n){const i=D();let o,s,r,a,l,c,u,d,h,p,{replayer:m}=t,{showController:f}=t,{autoPlay:g}=t,{skipInactive:y}=t,{speedOption:v}=t,{speed:b=(v.length?v[0]:1)}=t,{tags:w={}}=t,{inactiveColor:E}=t,N=0,C=null,R=!1,k=null;const A=()=>{C&&(cancelAnimationFrame(C),C=null)},I=()=>{"paused"===o&&(l?(m.play(),l=!1):m.play(N))},O=()=>{"playing"===o&&(m.pause(),R=!1)},_=(e,t)=>{n(6,N=e),R=!1,l=!1;("boolean"==typeof t?t:"playing"===o)?m.play(e):m.pause(e)},$=(e,t,i=!1,o)=>{k=i?{start:e,end:t}:null,n(6,N=e),R=t,c=o,m.play(e)},L=e=>{let t="playing"===o;n(1,b=e),t&&m.pause(),m.setConfig({speed:b}),t&&m.play(N)};var F;S((()=>{n(7,o=m.service.state.value),n(10,s=m.speedService.state.value),m.on("state-change",(e=>{const{player:t,speed:i}=e;if((null==t?void 0:t.value)&&o!==t.value)switch(n(7,o=t.value),o){case"playing":A(),C=requestAnimationFrame((function e(){n(6,N=m.getCurrentTime()),R&&N>=R&&(k?$(k.start,k.end,!0,void 0):(m.pause(),c&&(c(),c=null))),N<u.totalTime&&(C=requestAnimationFrame(e))}));break;case"paused":A()}(null==i?void 0:i.value)&&s!==i.value&&n(10,s=i.value)})),m.on("finish",(()=>{l=!0,c&&(c(),c=null)})),g&&m.play()})),F=()=>{y!==m.config.skipInactive&&m.setConfig({skipInactive:y})},T().$$.after_update.push(F),M((()=>{m.pause(),A()}));return e.$$set=e=>{"replayer"in e&&n(17,m=e.replayer),"showController"in e&&n(2,f=e.showController),"autoPlay"in e&&n(18,g=e.autoPlay),"skipInactive"in e&&n(0,y=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,b=e.speed),"tags"in e&&n(19,w=e.tags),"inactiveColor"in e&&n(20,E=e.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&i("ui-update-current-time",{payload:N}),128&e.$$.dirty[0]&&i("ui-update-player-state",{payload:o}),131072&e.$$.dirty[0]&&n(8,u=m.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,N/u.totalTime);n(13,d=100*e+"%"),i("ui-update-progress",{payload:e})}655360&e.$$.dirty[0]&&n(9,h=(()=>{const{context:e}=m.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=[];return e.events.forEach((e=>{if(e.type===fe.Custom){const t={name:e.data.tag,background:w[e.data.tag]||"rgb(73, 80, 246)",position:`${Hn(n,i,e.timestamp)}%`};o.push(t)}})),o})()),1179648&e.$$.dirty[0]&&n(14,p=(()=>{try{const{context:e}=m.service.state,t=e.events.length,n=e.events[0].timestamp,i=e.events[t-1].timestamp,o=function(e,t){const n=[];let i=e[0].timestamp;for(const o of e)In(o)&&(o.timestamp-i>t&&n.push([i,o.timestamp]),i=o.timestamp);return n}(e.events,m.config.inactivePeriodThreshold),s=(e,t,n,i)=>((i-n)/(t-e)*100).toFixed(2);return o.map((e=>({name:"inactive period",background:E,position:`${Hn(n,i,e[0])}%`,width:`${s(n,i,e[0],e[1])}%`})))}catch(e){return[]}})())},[y,b,f,v,()=>{switch(o){case"playing":O();break;case"paused":I()}},L,N,o,u,h,s,r,a,d,p,i,e=>{if("skipping"===s)return;const t=r.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const i=u.totalTime*n;_(i)},m,g,w,E,I,O,_,$,()=>{n(0,y=!y)},()=>Promise.resolve().then((()=>{n(8,u=m.getMetaData())})),function(e){x[e?"unshift":"push"]((()=>{a=e,n(12,a)}))},function(e){x[e?"unshift":"push"]((()=>{r=e,n(11,r)}))},e=>L(e),function(e){y=e,n(0,y)},()=>i("fullscreen")]}class qn extends X{constructor(e){super(),q(this,e,Yn,Gn,r,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}}function Xn(e){let t,n,i={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new qn({props:i}),e[32](t),t.$on("fullscreen",e[33]),{c(){z(t.$$.fragment)},m(e,i){G(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.replayer=e[7]),8&n[0]&&(i.showController=e[3]),2&n[0]&&(i.autoPlay=e[1]),4&n[0]&&(i.speedOption=e[2]),1&n[0]&&(i.skipInactive=e[0]),16&n[0]&&(i.tags=e[4]),32&n[0]&&(i.inactiveColor=e[5]),t.$set(i)},i(e){n||(V(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(n){e[32](null),H(t,n)}}}function Qn(e){let t,n,i,o,s=e[7]&&Xn(e);return{c(){t=h("div"),n=h("div"),i=f(),s&&s.c(),y(n,"class","rr-player__frame"),y(n,"style",e[11]),y(t,"class","rr-player"),y(t,"style",e[12])},m(r,a){c(r,t,a),l(t,n),e[31](n),l(t,i),s&&s.m(t,null),e[34](t),o=!0},p(e,i){(!o||2048&i[0])&&y(n,"style",e[11]),e[7]?s?(s.p(e,i),128&i[0]&&V(s,1)):(s=Xn(e),s.c(),V(s,1),s.m(t,null)):s&&(B(),W(s,1,1,(()=>{s=null})),j()),(!o||4096&i[0])&&y(t,"style",e[12])},i(e){o||(V(s),o=!0)},o(e){W(s),o=!1},d(n){n&&u(t),e[31](null),s&&s.d(),e[34](null)}}}function Jn(e,n,i){let o,{width:s=1024}=n,{height:r=576}=n,{maxScale:l=1}=n,{events:c=[]}=n,{skipInactive:u=!0}=n,{autoPlay:d=!0}=n,{speedOption:h=[1,2,4,8]}=n,{speed:p=1}=n,{showController:m=!0}=n,{tags:f={}}=n,{inactiveColor:g="#D4D4D4"}=n;let y,v,b,w,E,N,T=s,D=r;const C=(e,t)=>{const n=[s/t.width,r/t.height];l&&n.push(l),e.style.transform=`scale(${Math.min(...n)})translate(-50%, -50%)`},R=()=>{var e;y&&(kn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=y).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};S((()=>{if(void 0!==h&&"array"!==An(h))throw new Error("speedOption must be array");if(h.forEach((e=>{if("number"!==An(e))throw new Error("item of speedOption must be number")})),h.indexOf(p)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${p},\n speedOption: [${h.toString()}]\n ...\n }\n `);var e;i(7,o=new Sn(c,Object.assign({speed:p,root:v,unpackFn:Ht},n))),o.on("resize",(e=>{C(o.wrapper,e)})),e=()=>{kn()?setTimeout((()=>{T=s,D=r,i(13,s=y.offsetWidth),i(14,r=y.offsetHeight-(m?80:0)),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})}),0):(i(13,s=T),i(14,r=D),C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),b=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),M((()=>{b&&b()}));return e.$$set=e=>{i(39,n=t(t({},n),a(e))),"width"in e&&i(13,s=e.width),"height"in e&&i(14,r=e.height),"maxScale"in e&&i(15,l=e.maxScale),"events"in e&&i(16,c=e.events),"skipInactive"in e&&i(0,u=e.skipInactive),"autoPlay"in e&&i(1,d=e.autoPlay),"speedOption"in e&&i(2,h=e.speedOption),"speed"in e&&i(17,p=e.speed),"showController"in e&&i(3,m=e.showController),"tags"in e&&i(4,f=e.tags),"inactiveColor"in e&&i(5,g=e.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&i(11,E=Mn({width:`${s}px`,height:`${r}px`})),24584&e.$$.dirty[0]&&i(12,N=Mn({width:`${s}px`,height:`${r+(m?80:0)}px`}))},n=a(n),[u,d,h,m,f,g,R,o,y,v,w,E,N,s,r,l,c,p,()=>o.getMirror(),()=>{C(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(e,t)=>{switch(o.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":w.$on(e,(({detail:e})=>t(e)))}},e=>{o.addEvent(e),w.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{w.toggle()},e=>{w.setSpeed(e)},()=>{w.toggleSkipInactive()},()=>{w.play()},()=>{w.pause()},(e,t)=>{w.goto(e,t)},(e,t,n=!1,i)=>{w.playRange(e,t,n,i)},function(e){x[e?"unshift":"push"]((()=>{v=e,i(9,v)}))},function(e){x[e?"unshift":"push"]((()=>{w=e,i(10,w)}))},()=>R(),function(e){x[e?"unshift":"push"]((()=>{y=e,i(8,y)}))}]}class Zn extends X{constructor(e){super(),q(this,e,Jn,Qn,r,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}}return class extends Zn{constructor(e){super({target:e.target,props:e.data||e.props})}}}();
30
- //# sourceMappingURL=index.js.map