lido-player 0.0.2-alpha-49 → 0.0.2-alpha-43-dev

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.
Files changed (159) hide show
  1. package/dist/cjs/{index-fe562525.js → index-6a69c33a.js} +36 -3
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/{lido-avatar_19.cjs.entry.js → lido-avatar_21.cjs.entry.js} +431 -180
  4. package/dist/cjs/lido-player.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{utils-96ce5641.js → utils-079a5e7d.js} +1032 -165
  7. package/dist/collection/collection-manifest.json +2 -0
  8. package/dist/collection/components/calculator/lido-calculator.css +87 -0
  9. package/dist/collection/components/calculator/lido-calculator.js +321 -0
  10. package/dist/collection/components/cell/lido-cell.js +1 -1
  11. package/dist/collection/components/column/lido-col.js +1 -1
  12. package/dist/collection/components/container/lido-container.js +20 -1
  13. package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
  14. package/dist/collection/components/float/lido-float.js +1 -1
  15. package/dist/collection/components/home/lido-home.js +9 -29
  16. package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
  17. package/dist/collection/components/mathMatrix/lido-math-matrix.css +10 -2
  18. package/dist/collection/components/mathMatrix/lido-math-matrix.js +226 -20
  19. package/dist/collection/components/position/lido-pos.js +1 -1
  20. package/dist/collection/components/random/lido-random.js +1 -1
  21. package/dist/collection/components/row/lido-row.js +1 -1
  22. package/dist/collection/components/scale/lido-balance.css +114 -0
  23. package/dist/collection/components/scale/lido-balance.js +549 -0
  24. package/dist/collection/components/shape/lido-shape.js +1 -1
  25. package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
  26. package/dist/collection/components/text/lido-text.js +1 -1
  27. package/dist/collection/components/trace/lido-trace.js +49 -128
  28. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  29. package/dist/collection/css/animation.css +21 -0
  30. package/dist/collection/css/index.css +45 -0
  31. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +24 -25
  32. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +0 -3
  33. package/dist/collection/stories/Templates/balancing/balancing.stories.js +67 -0
  34. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +156 -0
  35. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +49 -0
  36. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +66 -0
  37. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +65 -0
  38. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +105 -0
  39. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +92 -0
  40. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +47 -0
  41. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +59 -0
  42. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +93 -0
  43. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +100 -0
  44. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +212 -0
  45. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +6 -7
  46. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +6 -7
  47. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +158 -0
  48. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +102 -0
  49. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +94 -0
  50. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +184 -0
  51. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +213 -0
  52. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +109 -0
  53. package/dist/collection/stories/Templates/total/total.stories.js +59 -0
  54. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +96 -0
  55. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +55 -0
  56. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +5 -6
  57. package/dist/collection/utils/utils.js +439 -81
  58. package/dist/collection/utils/utilsHandlers/clickHandler.js +21 -25
  59. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +95 -42
  60. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +67 -0
  61. package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +94 -0
  62. package/dist/collection/utils/utilsHandlers/matrixHandler.js +298 -0
  63. package/dist/collection/utils/utilsHandlers/slideHandler.js +4 -2
  64. package/dist/collection/utils/utilsHandlers/sortHandler.js +21 -12
  65. package/dist/components/index.js +1 -1
  66. package/dist/components/lido-avatar.js +1 -1
  67. package/dist/components/lido-balance.d.ts +11 -0
  68. package/dist/components/lido-balance.js +6 -0
  69. package/dist/components/lido-calculator.d.ts +11 -0
  70. package/dist/components/lido-calculator.js +6 -0
  71. package/dist/components/lido-cell.js +1 -1
  72. package/dist/components/lido-col.js +1 -1
  73. package/dist/components/lido-container.js +1 -1
  74. package/dist/components/lido-flash-card.js +1 -1
  75. package/dist/components/lido-float.js +1 -1
  76. package/dist/components/lido-home.js +1 -1
  77. package/dist/components/lido-image.js +1 -1
  78. package/dist/components/lido-keyboard.js +1 -1
  79. package/dist/components/lido-math-matrix.js +1 -1
  80. package/dist/components/lido-pos.js +1 -1
  81. package/dist/components/lido-random.js +1 -1
  82. package/dist/components/lido-root.js +32 -20
  83. package/dist/components/lido-row.js +1 -1
  84. package/dist/components/lido-shape.js +1 -1
  85. package/dist/components/lido-slide-fill.js +1 -1
  86. package/dist/components/lido-text.js +1 -1
  87. package/dist/components/lido-trace.js +1 -1
  88. package/dist/components/lido-wrap.js +1 -1
  89. package/dist/components/p-08d0deab.js +254 -0
  90. package/dist/components/{p-b5b6ad27.js → p-15971ede.js} +1 -1
  91. package/dist/components/{p-0bf92c7f.js → p-1fbdb431.js} +2 -2
  92. package/dist/components/{p-b43ce4e1.js → p-29bdd953.js} +2 -2
  93. package/dist/components/{p-b8af26e6.js → p-322acda6.js} +40 -48
  94. package/dist/components/{p-51943db6.js → p-3f406017.js} +2 -2
  95. package/dist/components/p-44808985.js +186 -0
  96. package/dist/components/{p-4cabbf28.js → p-52844fa4.js} +2 -2
  97. package/dist/components/{p-4882df37.js → p-73e31a86.js} +2 -2
  98. package/dist/components/{p-af54a485.js → p-74849cdd.js} +4 -4
  99. package/dist/components/{p-9c56f378.js → p-7f7e5672.js} +2 -2
  100. package/dist/components/{p-4dbae73b.js → p-835b973d.js} +2 -2
  101. package/dist/components/{p-b55af747.js → p-90465904.js} +50 -129
  102. package/dist/components/{p-cae021c6.js → p-904711c8.js} +2 -2
  103. package/dist/components/{p-e735dce9.js → p-9be56729.js} +5 -3
  104. package/dist/components/{p-cac6c8bf.js → p-afbc196f.js} +2 -2
  105. package/dist/components/{p-cfa2aec8.js → p-bed94c37.js} +1047 -164
  106. package/dist/components/{p-7f11a624.js → p-cbac3cbc.js} +1 -1
  107. package/dist/components/{p-61d97438.js → p-d37ab4dc.js} +2 -2
  108. package/dist/components/p-e36ddcc1.js +166 -0
  109. package/dist/components/{p-03e4cafe.js → p-e4e42677.js} +2 -2
  110. package/dist/esm/{index-f47852d4.js → index-170e58c7.js} +36 -4
  111. package/dist/esm/index.js +2 -2
  112. package/dist/esm/{lido-avatar_19.entry.js → lido-avatar_21.entry.js} +430 -181
  113. package/dist/esm/lido-player.js +3 -3
  114. package/dist/esm/loader.js +3 -3
  115. package/dist/esm/{utils-9ce243d8.js → utils-5df09162.js} +1031 -164
  116. package/dist/lido-player/index.esm.js +1 -1
  117. package/dist/lido-player/lido-player.css +1 -1
  118. package/dist/lido-player/lido-player.esm.js +1 -1
  119. package/dist/lido-player/p-137c99ce.js +2 -0
  120. package/dist/lido-player/p-7556e652.js +9 -0
  121. package/dist/lido-player/p-eb956325.entry.js +1 -0
  122. package/dist/types/components/calculator/lido-calculator.d.ts +40 -0
  123. package/dist/types/components/container/lido-container.d.ts +4 -0
  124. package/dist/types/components/home/lido-home.d.ts +0 -1
  125. package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +24 -4
  126. package/dist/types/components/scale/lido-balance.d.ts +160 -0
  127. package/dist/types/components/trace/lido-trace.d.ts +0 -1
  128. package/dist/types/components.d.ts +342 -14
  129. package/dist/types/stories/Templates/balancing/balancing.stories.d.ts +4 -0
  130. package/dist/types/stories/Templates/checker-block/checkerBlock.stories.d.ts +4 -0
  131. package/dist/types/stories/Templates/checkerBlock/checkerBlock.stories.d.ts +4 -0
  132. package/dist/types/stories/Templates/fillAnswer/fill-answer.stories.d.ts +4 -0
  133. package/dist/types/stories/Templates/foodJar/food-jar.stories.d.ts +4 -0
  134. package/dist/types/stories/Templates/matchBox/matchBox.stories.d.ts +4 -0
  135. package/dist/types/stories/Templates/matchBox/matchBox2.stories.d.ts +4 -0
  136. package/dist/types/stories/Templates/matchingCard/matching-card.stories.d.ts +4 -0
  137. package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +9 -0
  138. package/dist/types/stories/Templates/nimbleTable/nimbleTable.stories.d.ts +4 -0
  139. package/dist/types/stories/Templates/numberBoardTwo/numberBoardTwo.stories.d.ts +4 -0
  140. package/dist/types/stories/Templates/numberPair/numberPair.stories.d.ts +4 -0
  141. package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +15 -0
  142. package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +11 -0
  143. package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +11 -0
  144. package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +4 -0
  145. package/dist/types/stories/Templates/shapeTractor/shape-tractor.stories.d.ts +12 -0
  146. package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +11 -0
  147. package/dist/types/stories/Templates/total/total.stories.d.ts +4 -0
  148. package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +13 -0
  149. package/dist/types/stories/Templates/writeSet/writeSet.stories.d.ts +4 -0
  150. package/dist/types/utils/utils.d.ts +8 -2
  151. package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +4 -0
  152. package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +2 -0
  153. package/dist/types/utils/utilsHandlers/lidoCalculatorHandler.d.ts +1 -0
  154. package/dist/types/utils/utilsHandlers/matrixHandler.d.ts +1 -0
  155. package/package.json +1 -1
  156. package/dist/components/p-a8ab771b.js +0 -160
  157. package/dist/lido-player/p-90212aa9.js +0 -9
  158. package/dist/lido-player/p-d3911ee1.entry.js +0 -1
  159. package/dist/lido-player/p-ddf627b0.js +0 -2
@@ -0,0 +1,186 @@
1
+ import { p as proxyCustomElement, H, i as initEventsForElement, k as parseProp, h, j as Host } from './p-bed94c37.js';
2
+
3
+ const lidoBalanceCss = "#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^=\"M78.9414\"]{fill:white}";
4
+ const LidoBalanceStyle0 = lidoBalanceCss;
5
+
6
+ const LidoBalance = /*@__PURE__*/ proxyCustomElement(class LidoBalance extends H {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.currentAngle = 0;
11
+ this.pivotimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg';
12
+ this.scaleimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg';
13
+ this.handlerimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg';
14
+ this.fill = 'brown';
15
+ this.tilt = 0;
16
+ this.maxTilt = 9.5;
17
+ this.onEntry = '';
18
+ this.height = 'auto';
19
+ this.width = 'auto';
20
+ this.x = '0px';
21
+ this.y = '0px';
22
+ this.z = '0';
23
+ this.visible = false;
24
+ this.margin = '';
25
+ this.padding = '';
26
+ this.balanceSymbol = '=';
27
+ this.showSymbol = false;
28
+ this.operation = 'count';
29
+ this.pivotSvg = '';
30
+ this.scaleSvg = '';
31
+ this.handlerSvg = '';
32
+ this.style = {};
33
+ this.tiltf = 0;
34
+ this.leftVal = 0;
35
+ this.rightVal = 0;
36
+ }
37
+ async revealSymbol() {
38
+ this.showSymbol = true;
39
+ }
40
+ async hideSymbol() {
41
+ this.showSymbol = false;
42
+ }
43
+ async componentWillLoad() {
44
+ this.updateStyles();
45
+ this.pivotSvg = await this.fetchAndApplyFill(this.pivotimage);
46
+ this.scaleSvg = await this.fetchAndApplyFill(this.scaleimage);
47
+ this.handlerSvg = await this.fetchAndApplyFill(this.handlerimage);
48
+ }
49
+ componentDidLoad() {
50
+ setTimeout(() => {
51
+ this.animateBalance();
52
+ }, 4000);
53
+ this.leftParentEl = document.getElementById("leftparent");
54
+ this.rightParentEl = document.getElementById("rightparent");
55
+ initEventsForElement(this.el);
56
+ }
57
+ disconnectedCallback() {
58
+ if (this.animationFrameId != null)
59
+ cancelAnimationFrame(this.animationFrameId);
60
+ }
61
+ async fetchAndApplyFill(url) {
62
+ try {
63
+ const res = await fetch(url);
64
+ if (!res.ok)
65
+ return '';
66
+ let svg = await res.text();
67
+ svg = svg.replace(/fill="[^"]*"/g, '');
68
+ svg = svg.replace(/stroke="[^"]*"/g, '');
69
+ svg = svg.replace(/<svg([^>]*)>/, `<svg$1 fill="${this.fill}" stroke="${this.fill}">`);
70
+ return svg;
71
+ }
72
+ catch (e) {
73
+ console.error('SVG fetch failed:', e);
74
+ return '';
75
+ }
76
+ }
77
+ tiltChanged(newValue) {
78
+ this.tiltf = newValue;
79
+ }
80
+ async updateTilt(leftVal, rightVal) {
81
+ const diff = rightVal - leftVal;
82
+ const newTilt = Math.max(-5, Math.min(5, diff));
83
+ this.tiltf = newTilt;
84
+ }
85
+ animateBalance() {
86
+ const rotate = () => {
87
+ let targetAngle = (this.tiltf / 5) * this.maxTilt;
88
+ if (targetAngle > this.maxTilt)
89
+ targetAngle = this.maxTilt;
90
+ if (targetAngle < -this.maxTilt)
91
+ targetAngle = -this.maxTilt;
92
+ this.currentAngle += (targetAngle - this.currentAngle) * 0.1;
93
+ if (this.currentAngle > this.maxTilt)
94
+ this.currentAngle = this.maxTilt;
95
+ if (this.currentAngle < -this.maxTilt)
96
+ this.currentAngle = -this.maxTilt;
97
+ if (this.scaleEl) {
98
+ this.scaleEl.style.transform = `rotate(${this.currentAngle}deg)`;
99
+ this.scaleEl.style.transformOrigin = '50% 80%';
100
+ }
101
+ if (this.leftParentEl && this.rightParentEl) {
102
+ const maxOffset = 60;
103
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
104
+ this.leftParentEl.style.transform = `translateY(${-offset}px)`;
105
+ this.rightParentEl.style.transform = `translateY(${offset}px)`;
106
+ }
107
+ if (this.leftHandleEl && this.rightHandleEl) {
108
+ const isPortrait = window.innerHeight > window.innerWidth;
109
+ const maxOffset = isPortrait ? 40 : 60;
110
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
111
+ this.leftHandleEl.style.transform = `translateY(${-offset}px)`;
112
+ this.rightHandleEl.style.transform = `translateY(${offset}px)`;
113
+ }
114
+ this.animationFrameId = requestAnimationFrame(rotate);
115
+ };
116
+ rotate();
117
+ }
118
+ updateStyles() {
119
+ const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
120
+ this.style = {
121
+ height: parseProp(this.height, orientation),
122
+ width: parseProp(this.width, orientation),
123
+ top: parseProp(this.y, orientation),
124
+ left: parseProp(this.x, orientation),
125
+ zIndex: this.z,
126
+ display: parseProp(`${this.visible}`, orientation) === "true" ? 'flex' : 'none',
127
+ margin: parseProp(this.margin, orientation),
128
+ padding: parseProp(this.padding, orientation),
129
+ };
130
+ }
131
+ render() {
132
+ return (h(Host, { key: '868cc05ae503a6e04039c615815102470eb402d4', id: "lido-balance", onEntry: this.onEntry, class: "lido-balance", tilt: this.tilt.toString(), style: this.style, operation: this.operation.toString() }, h("div", { key: '2627a49d1ad5045bd9a3ac217354c9be98f1f52b', innerHTML: this.pivotSvg, id: "pivotimg", class: "pivot" }), h("div", { key: 'c5b2432f5e3c62ebbb7f17146f18e22e7e2b29bb', innerHTML: this.scaleSvg, id: "scaleimg", class: "scale", ref: (el) => (this.scaleEl = el) }), h("div", { key: 'd5e8051aedb784189f19a1e7b0dfd645e95ed4a5', innerHTML: this.handlerSvg, id: "handlerimg", class: "handler", ref: (el) => (this.leftHandleEl = el) }), h("div", { key: '3779886d4fc8dfadc0791f69cb87df78d5f843c8', innerHTML: this.handlerSvg, id: "handimg", class: "hand", ref: (el) => (this.rightHandleEl = el) }), h("div", { key: 'df5d4094c302548bf64f166643a3f05d262d95b1', id: "balanceSymbol", class: "lido-balance-symbol", "aria-hidden": !this.showSymbol }, this.showSymbol ? this.balanceSymbol : '')));
133
+ }
134
+ get el() { return this; }
135
+ static get watchers() { return {
136
+ "tilt": ["tiltChanged"]
137
+ }; }
138
+ static get style() { return LidoBalanceStyle0; }
139
+ }, [0, "lido-balance", {
140
+ "pivotimage": [1],
141
+ "scaleimage": [1],
142
+ "handlerimage": [1],
143
+ "fill": [1],
144
+ "tilt": [2],
145
+ "maxTilt": [2, "max-tilt"],
146
+ "onEntry": [1, "on-entry"],
147
+ "height": [1],
148
+ "width": [1],
149
+ "x": [1],
150
+ "y": [1],
151
+ "z": [1],
152
+ "visible": [8],
153
+ "margin": [1],
154
+ "padding": [1],
155
+ "balanceSymbol": [1537, "balance-symbol"],
156
+ "showSymbol": [1540, "show-symbol"],
157
+ "operation": [1],
158
+ "pivotSvg": [32],
159
+ "scaleSvg": [32],
160
+ "handlerSvg": [32],
161
+ "style": [32],
162
+ "tiltf": [32],
163
+ "leftVal": [32],
164
+ "rightVal": [32],
165
+ "revealSymbol": [64],
166
+ "hideSymbol": [64],
167
+ "updateTilt": [64]
168
+ }, undefined, {
169
+ "tilt": ["tiltChanged"]
170
+ }]);
171
+ function defineCustomElement() {
172
+ if (typeof customElements === "undefined") {
173
+ return;
174
+ }
175
+ const components = ["lido-balance"];
176
+ components.forEach(tagName => { switch (tagName) {
177
+ case "lido-balance":
178
+ if (!customElements.get(tagName)) {
179
+ customElements.define(tagName, LidoBalance);
180
+ }
181
+ break;
182
+ } });
183
+ }
184
+ defineCustomElement();
185
+
186
+ export { LidoBalance as L, defineCustomElement as d };
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, i as initEventsForElement, k as handlingChildElements, l as attachSpeakIcon, e as convertUrlToRelative, m as parseProp, h, j as Host } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, e as convertUrlToRelative, k as parseProp, h, j as Host } from './p-bed94c37.js';
2
2
 
3
3
  const lidoColCss = ".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}";
4
4
  const LidoColStyle0 = lidoColCss;
@@ -80,7 +80,7 @@ const LidoCol = /*@__PURE__*/ proxyCustomElement(class LidoCol extends H {
80
80
  };
81
81
  }
82
82
  render() {
83
- return (h(Host, { key: '753487ca4817b020aaf7e34dadff00a61c826dfc', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'a9d9f0f2c30dc02e6468e597b5a02e032d786538' })));
83
+ return (h(Host, { key: '1cf21bb1e817c9078213312aa7165423eaf54ea7', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'c3bc168ccccacf1425b5d93853bc27ab2962436f' })));
84
84
  }
85
85
  get el() { return this; }
86
86
  static get style() { return LidoColStyle0; }
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, e as convertUrlToRelative, d as setVisibilityWithDelay, i as initEventsForElement, m as parseProp, T as fraction, h, j as Host } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, e as convertUrlToRelative, d as setVisibilityWithDelay, i as initEventsForElement, k as parseProp, U as fraction, h, j as Host } from './p-bed94c37.js';
2
2
 
3
3
  const lidoSlideFillCss = ".svg-element,svg{width:100%;height:100%}";
4
4
  const LidoSlideFillStyle0 = lidoSlideFillCss;
@@ -194,7 +194,7 @@ const LidoSlideFill = /*@__PURE__*/ proxyCustomElement(class LidoSlideFill exten
194
194
  }
195
195
  }
196
196
  render() {
197
- return (h(Host, { key: 'a7be214e99b8917ebe3d4ae0275036e77967d3b7', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, h("div", { key: 'e3210823de751a3fdff90b54bf93fc13890ca28a', innerHTML: this.svgContent, class: "svg-element" })));
197
+ return (h(Host, { key: '57ee54a6a0e7d3bbac893ce535a3375ea529e75a', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, h("div", { key: '386330e0562851f2f00aba169018c23bf5ffa4b7', innerHTML: this.svgContent, class: "svg-element" })));
198
198
  }
199
199
  get el() { return this; }
200
200
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
- import { p as proxyCustomElement, H, S as SelectedValuesKey, L as LidoContainer, I as executeActions, F as triggerNextContainer, o as handleFloatElementPosition, O as storingEachActivityScore, Q as DropAction, m as parseProp, h, j as Host } from './p-cfa2aec8.js';
2
- import { d as defineCustomElement$1 } from './p-cac6c8bf.js';
1
+ import { p as proxyCustomElement, H, S as SelectedValuesKey, L as LidoContainer, o as executeActions, O as triggerNextContainer, u as handleFloatElementPosition, n as storingEachActivityScore, Q as DropAction, k as parseProp, h, j as Host } from './p-bed94c37.js';
2
+ import { d as defineCustomElement$1 } from './p-afbc196f.js';
3
3
 
4
4
  const lidoKeyboardCss = ".lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type=\"text\"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}";
5
5
  const LidoKeyboardStyle0 = lidoKeyboardCss;
@@ -118,10 +118,10 @@ const LidoKeyboard = /*@__PURE__*/ proxyCustomElement(class LidoKeyboard extends
118
118
  const keysArray = this.keys.split(',').map(k => k.trim());
119
119
  const container = document.getElementById(LidoContainer);
120
120
  const showCheck = container.getAttribute('show-check') === 'true';
121
- return (h(Host, { key: 'b01d3c5bab495def25c14239a3c94e9f6af15b4f', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '1e475df899a9e8cead3d4ee313d6e0b09a1e766f', class: "input-area" }, h("input", { key: '1d27787a42dc81ba97d5045718d726683bf8f32a', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), h("lido-text", { key: '5695c9662b22bd7c3d7c7dfc49481641e795b290', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
121
+ return (h(Host, { key: 'e4cd1fc51d8d3c87ed011120f13454bbef1883b3', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '114224c18345951e749db6f1eba242cc1179431f', class: "input-area" }, h("input", { key: '14741df7dc29f51420c1164ddebf60fd464fade4', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), h("lido-text", { key: '3bb801fbcab03b58a628c4c365f46113e9829fdc', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
122
122
  this.inputString = this.inputString.slice(0, -1);
123
123
  this.inputValidation(event);
124
- } }), h("lido-text", { key: 'd1a786e8f4015c7aeaeffe7a677f1f7e106b3691', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: 'bdd01380b832949bf2abbe4481ac000c1f3a358f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: 'd54959bfe639803c7e048d5112514a7dccbf9dc4', class: "keyboard-wrapper", style: {
124
+ } }), h("lido-text", { key: '46212bcfe4e5c22744d13d8235d82bdb73bce802', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: 'a886ac1d7ceadda37eadd4bed59bd5096d46619f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: '5238d1dc1bafda2ffab63932d1f5d29ef449bf4b', class: "keyboard-wrapper", style: {
125
125
  display: 'flex',
126
126
  flexWrap: 'wrap',
127
127
  justifyContent: 'center',
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, i as initEventsForElement, k as handlingChildElements, l as attachSpeakIcon, m as parseProp, h, j as Host } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-bed94c37.js';
2
2
 
3
3
  const lidoRowCss = ".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";
4
4
  const LidoRowStyle0 = lidoRowCss;
@@ -77,7 +77,7 @@ const LidoRow = /*@__PURE__*/ proxyCustomElement(class LidoRow extends H {
77
77
  };
78
78
  }
79
79
  render() {
80
- return (h(Host, { key: '03f15dcfc2abc394d0313d4b40dd6465a19dc34a', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: 'fbb5e6ce6b8436d718c043561e0d92908baaabdc' })));
80
+ return (h(Host, { key: '4c1f45afe8866df81a6a798afe348e03fa1f4292', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: '194de56621025a4b1a4fdb6ccae347f34dc19fdb' })));
81
81
  }
82
82
  get el() { return this; }
83
83
  static get style() { return LidoRowStyle0; }
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, i as initEventsForElement, k as handlingChildElements, l as attachSpeakIcon, m as parseProp, h, j as Host } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-bed94c37.js';
2
2
 
3
3
  const lidoWrapCss = ".lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;background-color:var(--child-bg-color, #f0f0f0);box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}";
4
4
  const LidoWrapStyle0 = lidoWrapCss;
@@ -78,7 +78,7 @@ const LidoWrap = /*@__PURE__*/ proxyCustomElement(class LidoWrap extends H {
78
78
  };
79
79
  }
80
80
  render() {
81
- return (h(Host, { key: '8f9a578e3bf8c491373b7564b93c05de92a3e1a7', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, h("slot", { key: '0dbba1d2c88bac9a29bb81340698f5f3cb36c7be' })));
81
+ return (h(Host, { key: '7e2bb4af31b5aff0f063a9f6c3cab96cdd25f31f', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, h("slot", { key: '03179b28e45692e61aff0bf3634ef0a72bab0726' })));
82
82
  }
83
83
  get el() { return this; }
84
84
  static get style() { return LidoWrapStyle0; }
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, U as TraceMode, e as convertUrlToRelative, d as setVisibilityWithDelay, V as speakIcon, I as executeActions, F as triggerNextContainer, L as LidoContainer, m as parseProp, h, j as Host, W as fingerUrl } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, V as TraceMode, e as convertUrlToRelative, d as setVisibilityWithDelay, W as speakIcon, o as executeActions, O as triggerNextContainer, L as LidoContainer, k as parseProp, h, j as Host, X as fingerUrl } from './p-bed94c37.js';
2
2
 
3
3
  const lidoTraceCss = ":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}";
4
4
  const LidoTraceStyle0 = lidoTraceCss;
@@ -36,7 +36,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
36
36
  this.fileIndex = -1;
37
37
  this.isDragging = false;
38
38
  this.activePointerId = null;
39
- this.freeTraceUpdateCounter = 0;
40
39
  this.idleTimer = null;
41
40
  this.fingerImg = null;
42
41
  }
@@ -53,8 +52,8 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
53
52
  circle: null,
54
53
  paths: [],
55
54
  svg: null,
56
- proximityThreshold: 375, // Increased general proximity threshold (was 100)
57
- freeTraceProximityThreshold: 350, // Increased proximity for free trace (was 50)
55
+ proximityThreshold: 100, // General proximity threshold
56
+ freeTraceProximityThreshold: 50, // Reduced proximity threshold for free trace
58
57
  rafId: null,
59
58
  pointerMoveEvent: null,
60
59
  activePointerId: null,
@@ -390,7 +389,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
390
389
  }
391
390
  // Modified handlePointerMove function
392
391
  handlePointerMove(state) {
393
- var _a, _b, _c, _d, _e, _f;
392
+ var _a, _b, _c, _d;
394
393
  if (!state.isDragging)
395
394
  return;
396
395
  if (!state.circle || !state.paths || state.paths.length === 0)
@@ -402,15 +401,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
402
401
  x: parseFloat(state.circle.getAttribute('cx')),
403
402
  y: parseFloat(state.circle.getAttribute('cy')),
404
403
  };
405
- // Only update if pointer moved a minimum distance (to reduce unnecessary updates)
406
- const MOVE_THRESHOLD = 1; // px
407
- if (state.lastPointerPos) {
408
- const dx = pointerPos.x - state.lastPointerPos.x;
409
- const dy = pointerPos.y - state.lastPointerPos.y;
410
- if (dx * dx + dy * dy < MOVE_THRESHOLD * MOVE_THRESHOLD) {
411
- return;
412
- }
413
- }
414
404
  const currentPath = state.paths[state.currentPathIndex];
415
405
  if (!currentPath) {
416
406
  console.error('No valid path found at the current index');
@@ -438,76 +428,48 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
438
428
  }
439
429
  // For free trace mode and blind free trace mode, allow free drawing only if within the reduced proximity threshold
440
430
  if (state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace) {
441
- // Throttle: Only update every 2nd event (for reducing excessive dom updates)
442
- this.freeTraceUpdateCounter = (this.freeTraceUpdateCounter || 0) + 1;
443
- if (this.freeTraceUpdateCounter % 2 !== 0) {
444
- return;
445
- }
446
431
  // Initialize the currentFreePath array if it's not created
447
432
  if (!state.currentFreePath) {
448
433
  state.currentFreePath = [];
449
434
  }
450
- // Create a new polyline element if it's the first trace for the current path index
435
+ // Create a new path element if it's the first trace for the current path index
451
436
  if (!state.currentFreePath[state.currentPathIndex]) {
452
- const newPolyline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
437
+ const newPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
438
+ // newPath.setAttribute('stroke', 'green');
453
439
  const strokeWidth = state.paths[state.currentPathIndex].style['stroke-width'] || state.paths[state.currentPathIndex].getAttribute('stroke-width');
454
- newPolyline.setAttribute('stroke-width', strokeWidth);
455
- newPolyline.setAttribute('fill', 'none');
456
- newPolyline.setAttribute('stroke-linecap', 'round');
457
- newPolyline.setAttribute('stroke', 'lightgreen');
458
- newPolyline.setAttribute('points', `${pointerPos.x},${pointerPos.y}`);
459
- (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPolyline);
460
- state.currentFreePath[state.currentPathIndex] = newPolyline;
461
- // Store points array for this polyline
462
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
463
- state.currentFreePolylinePoints[state.currentPathIndex] = [
464
- { x: pointerPos.x, y: pointerPos.y }
465
- ];
440
+ newPath.setAttribute('stroke-width', strokeWidth);
441
+ newPath.setAttribute('fill', 'none');
442
+ newPath.setAttribute('stroke-linecap', 'round');
443
+ newPath.setAttribute('stroke', 'lightgreen');
444
+ // Start the new path at the current pointer position
445
+ newPath.setAttribute('d', `M${pointerPos.x},${pointerPos.y}`);
446
+ (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPath);
447
+ state.currentFreePath[state.currentPathIndex] = newPath;
466
448
  // Reset lastPointerPos for the new path
467
449
  state.lastPointerPos = pointerPos;
468
- // Add a points counter to limit path growth
469
- state.freeTracePointsCount = 1;
470
450
  }
471
- // Limit the number of points in the free trace path for performance
472
- const MAX_FREE_TRACE_POINTS = 10;
473
- state.freeTracePointsCount = (state.freeTracePointsCount || 1) + 1;
474
- if (state.freeTracePointsCount > MAX_FREE_TRACE_POINTS) {
475
- // If limit reached, skip adding more points
476
- return;
477
- }
478
- // Add the new point to the polyline's points array
479
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
480
- let pointsArr = state.currentFreePolylinePoints[state.currentPathIndex] || [];
481
- pointsArr.push({ x: pointerPos.x, y: pointerPos.y });
482
- state.currentFreePolylinePoints[state.currentPathIndex] = pointsArr;
483
- // Update the polyline's points attribute
484
- const pointsStr = pointsArr.map(pt => `${pt.x},${pt.y}`).join(' ');
485
- state.currentFreePath[state.currentPathIndex].setAttribute('points', pointsStr);
451
+ // Get the previous position to draw a smooth curve
452
+ const previousPos = state.lastPointerPos || pointerPos;
453
+ // Create a quadratic curve from the previous point to the current point
454
+ const newPathData = state.currentFreePath[state.currentPathIndex].getAttribute('d');
455
+ const midPointX = (previousPos.x + pointerPos.x) / 2;
456
+ const midPointY = (previousPos.y + pointerPos.y) / 2;
457
+ const updatedPathData = `${newPathData} Q ${previousPos.x},${previousPos.y} ${midPointX},${midPointY}`;
458
+ // Update the path's 'd' attribute with the new curve
459
+ state.currentFreePath[state.currentPathIndex].setAttribute('d', updatedPathData);
486
460
  // Move the draggable circle with the freehand trace
487
461
  state.circle.setAttribute('cx', pointerPos.x.toString());
488
462
  state.circle.setAttribute('cy', pointerPos.y.toString());
489
- // Only re-append if not already children list
490
- const childNodes = (_b = state.svg) === null || _b === void 0 ? void 0 : _b.childNodes;
491
- let circleFound = false;
492
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
493
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
494
- if (child && child.tagName === 'circle') {
495
- circleFound = true;
496
- break; // No need to continue once found
497
- }
498
- }
499
- // If not found, append the circle
500
- if (!circleFound && state.circle) {
501
- (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle);
502
- }
463
+ // Make sure the red dot (circle) is always on top
464
+ (_b = state.svg) === null || _b === void 0 ? void 0 : _b.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
503
465
  // Update the last pointer position
504
466
  state.lastPointerPos = pointerPos;
505
- // For polyline, estimate the end by number of points (not path length)
506
- if (pointsArr.length >= MAX_FREE_TRACE_POINTS) {
467
+ const currentPathLength = currentPath.getTotalLength();
468
+ const distanceToEnd = currentPathLength - closestPoint.length;
469
+ // If close to the end of the path, move to the next path
470
+ if (distanceToEnd < 5) {
507
471
  this.moveToNextPath(state);
508
472
  state.currentFreePath[state.currentPathIndex] = null; // Reset free path for next path
509
- state.currentFreePolylinePoints[state.currentPathIndex] = [];
510
- state.freeTracePointsCount = 0;
511
473
  }
512
474
  // this.resetIdleTimer(state); // ← keep timer alive
513
475
  return; // Exit early since we're in free trace or blind free trace mode
@@ -515,62 +477,24 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
515
477
  // In normal modes, allow movement and drawing only within the general proximity threshold
516
478
  if (state.isDragging && closestPoint.length >= state.lastLength) {
517
479
  state.lastLength = closestPoint.length;
518
- // Only update the circle if it moved enough
519
- if (Math.abs(closestPoint.x - circlePos.x) > MOVE_THRESHOLD || Math.abs(closestPoint.y - circlePos.y) > MOVE_THRESHOLD) {
520
- state.circle.setAttribute('cx', closestPoint.x.toString());
521
- state.circle.setAttribute('cy', closestPoint.y.toString());
522
- }
523
- // Only re-append if not already children list
524
- const childNodes = (_d = state.svg) === null || _d === void 0 ? void 0 : _d.childNodes;
525
- let circleFound = false;
526
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
527
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
528
- if (child && child.tagName === 'circle') {
529
- circleFound = true;
530
- break; // No need to continue once found
531
- }
532
- }
533
- // If not found, append the circle
534
- if (!circleFound && state.circle) {
535
- (_e = state.svg) === null || _e === void 0 ? void 0 : _e.appendChild(state.circle);
536
- }
537
- (_f = currentPath.greenPath) === null || _f === void 0 ? void 0 : _f.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
538
- // Completion logic for closed paths: only allow completion if almost all points are traced
539
- const COMPLETION_THRESHOLD = 0.90; // 90% of the path must be traced
540
- let percentComplete = state.lastLength / state.totalPathLength;
541
- let startPoint = currentPath.getPointAtLength(0);
542
- let endPoint = currentPath.getPointAtLength(currentPath.getTotalLength());
543
- let pathIsClosed = this.getDistanceSquared(startPoint, endPoint) < 200; // threshold for overlap
544
- console.log('lastLength, totalPathLength', state.lastLength, state.totalPathLength);
545
- console.log('percentComplete', percentComplete);
546
- console.log('startPoint, endPoint', startPoint, endPoint);
547
- console.log('distance squared between start & end:', this.getDistanceSquared(startPoint, endPoint));
548
- console.log('pathIsClosed:', pathIsClosed);
549
- if (pathIsClosed && state.totalPathLength > 50) {
550
- if (percentComplete >= COMPLETION_THRESHOLD) {
551
- if (state.currentPathIndex < state.paths.length - 1) {
552
- this.moveToNextPath(state);
553
- }
554
- else if (state.currentPathIndex === state.paths.length - 1) {
555
- this.moveToNextContainer();
556
- }
557
- }
558
- }
559
- else {
560
- // For open paths, allow completion if near the end
561
- if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
562
- this.moveToNextPath(state);
563
- }
564
- else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
565
- this.moveToNextContainer();
566
- }
567
- }
480
+ state.circle.setAttribute('cx', closestPoint.x.toString());
481
+ state.circle.setAttribute('cy', closestPoint.y.toString());
482
+ // Make sure the red dot (circle) is always on top
483
+ (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
484
+ (_d = currentPath.greenPath) === null || _d === void 0 ? void 0 : _d.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
485
+ }
486
+ // Check if the current path is completed
487
+ if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
488
+ this.moveToNextPath(state);
489
+ }
490
+ else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
491
+ // this.loadAnotherSVG(state, true);
492
+ this.moveToNextContainer();
568
493
  }
569
494
  // this.resetIdleTimer(state); // ← keep timer alive
570
495
  }
571
496
  // Move to the next container after completing the current SVG
572
497
  async moveToNextContainer() {
573
- this.isDragging = false;
574
498
  if (this.moving)
575
499
  return; // Prevent multiple calls
576
500
  this.moving = true; // Set moving to true to prevent re-entrance
@@ -581,19 +505,17 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
581
505
  await this.playTraceAnimation();
582
506
  }
583
507
  console.log(`Moving to next container after SVG index: ${this.currentSvgIndex}`);
584
- console.log('Total SVGs:', this.svgUrls.length);
508
+ const delay = 1000; // milliseconds
585
509
  if (this.currentSvgIndex < this.svgUrls.length - 1) {
510
+ await new Promise(resolve => setTimeout(resolve, delay));
586
511
  this.currentSvgIndex++;
587
512
  await this.initializeSVG();
588
513
  this.moving = false;
589
514
  return;
590
515
  }
591
- console.log('onCorrect:', this.onCorrect);
592
- console.log('el :', this.el);
593
516
  if (this.el && this.onCorrect) {
594
517
  await executeActions(this.onCorrect, this.el);
595
518
  }
596
- console.log('All SVGs completed, hiding component.');
597
519
  triggerNextContainer();
598
520
  }
599
521
  // Get the pointer position relative to the SVG
@@ -611,13 +533,13 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
611
533
  const dy = p1.y - p2.y;
612
534
  return dx * dx + dy * dy;
613
535
  }
614
- // Find the closest point on the given path to the specified point using two-pass sampling (optimized)
536
+ // Find the closest point on the given path to the specified point using two-pass sampling
615
537
  getClosestPointOnPath(pathNode, point) {
616
538
  const pathLength = pathNode.getTotalLength();
617
539
  let closestPoint = { x: 0, y: 0, length: 0 };
618
540
  let minDistanceSquared = Infinity;
619
- // Optimized: Increase coarse steps for better performance
620
- const coarseStep = 40; // was 20
541
+ // First pass: coarse sampling
542
+ const coarseStep = 20; // Increased step for better performance
621
543
  let coarseClosestPoint = { x: 0, y: 0, length: 0 };
622
544
  let coarseMinDistanceSquared = Infinity;
623
545
  for (let i = 0; i <= pathLength; i += coarseStep) {
@@ -633,7 +555,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
633
555
  }
634
556
  }
635
557
  // Second pass: fine sampling around coarseClosestPoint
636
- const fineStep = 6; // was 2
558
+ const fineStep = 2; // Increased step to reduce computations
637
559
  const searchStart = Math.max(coarseClosestPoint.length - coarseStep, 0);
638
560
  const searchEnd = Math.min(coarseClosestPoint.length + coarseStep, pathLength);
639
561
  for (let i = searchStart; i <= searchEnd; i += fineStep) {
@@ -793,7 +715,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
793
715
  };
794
716
  }
795
717
  render() {
796
- return (h(Host, { key: 'ca50ce7efcc822c69b8bd673993dace0b7ccad75', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: 'e473c6c488d952be730ee0a659d216afe41d34a2', style: this.style, id: "lido-svgContainer" })));
718
+ return (h(Host, { key: '6be6d97477a80afc0275eef5b17718a5f43ce358', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '4e650d7142c61549aec021fd2a8da4e592eaf94e', style: this.style, id: "lido-svgContainer" })));
797
719
  }
798
720
  static get assetsDirs() { return ["svg", "images"]; }
799
721
  get el() { return this; }
@@ -832,7 +754,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
832
754
  "fileIndex": [32],
833
755
  "isDragging": [32],
834
756
  "activePointerId": [32],
835
- "freeTraceUpdateCounter": [32],
836
757
  "idleTimer": [32],
837
758
  "fingerImg": [32]
838
759
  }, undefined, {
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, d as setVisibilityWithDelay, i as initEventsForElement, h, j as Host } from './p-cfa2aec8.js';
1
+ import { p as proxyCustomElement, H, d as setVisibilityWithDelay, i as initEventsForElement, h, j as Host } from './p-bed94c37.js';
2
2
 
3
3
  const lidoShapeCss = ".lido-shape{position:absolute;top:var(--y);left:var(--x);display:var(--display);z-index:var(--z)}.lido-rectangle{border-radius:0}.lido-circle{width:var(--width);height:var(--width);border-radius:50%;background-color:var(--bgColor)}.lido-ellipse{width:var(--width);height:var(--height);border-radius:50%;background-color:var(--bgColor)}.lido-triangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(50% 0%, 100% 100%, 0% 100%)}.lido-rightTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(100% 0%, 100% 100%, 0% 100%)}.lido-leftTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--triangleBgColor);clip-path:polygon(0% 0%, 100% 100%, 0% 100%)}.lido-parallelogram{width:var(--paralleWidth);height:var(--paralleHeight);transform:skew(20deg)}.lido-star{width:var(--starWidth);height:var(--starHeight);background-color:var(--starBgColor);clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)}.lido-pentagon{width:var(--pentagonWidth);height:var(--pentagonHeight);background-color:var(--pentagonBgColor);clip-path:polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)}.lido-heptagon{width:var(--heptagonWidth);height:var(--heptagonHeight);background-color:var(--heptagonBgColor);clip-path:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)}.lido-octagon{width:var(--octagonWidth);height:var(--octagonHeight);background-color:var(--octagonBgColor);clip-path:polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%)}.lido-rhombus{width:var(--rhombusWidth);height:var(--rhombusHeight);background-color:var(--rhombusBgColor);clip-path:polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)}.lido-heart{height:var(--heartHeight);width:var(--heartWidth);border-image:radial-gradient(var(--heartBgColor) 69%, #0000 70%) 84.5%/50%;clip-path:polygon(-41% 0, 50% 91%, 141% 0)}";
4
4
  const LidoShapeStyle0 = lidoShapeCss;
@@ -52,7 +52,7 @@ const LidoShape = /*@__PURE__*/ proxyCustomElement(class LidoShape extends H {
52
52
  backgroundColor: this.shapeType !== 'polygon' ? this.bgColor : 'transparent', // Apply background only if not a polygon
53
53
  margin: this.margin,
54
54
  };
55
- return (h(Host, { key: '887f02445ef694f84ebc85e05e4dfb740d0bc78b', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
55
+ return (h(Host, { key: '6712d974e85c5d82dabb5ed0d482ece4b18af16a', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
56
56
  }
57
57
  get el() { return this; }
58
58
  static get style() { return LidoShapeStyle0; }