jclic 2.1.21 → 2.1.22

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 (173) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/jclic-node.js +1 -1
  3. package/dist/jclic-node.js.map +1 -1
  4. package/dist/jclic.min.js +2 -2
  5. package/dist/jclic.min.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/GlobalData.js +1 -1
  8. package/dist/1078.jclic-node.js +0 -282
  9. package/dist/1078.jclic-node.js.map +0 -1
  10. package/dist/1196.jclic-node.js +0 -808
  11. package/dist/1196.jclic-node.js.map +0 -1
  12. package/dist/1253.jclic-node.js +0 -1432
  13. package/dist/1253.jclic-node.js.map +0 -1
  14. package/dist/13.jclic-node.js +0 -103
  15. package/dist/13.jclic-node.js.map +0 -1
  16. package/dist/1567.jclic-node.js +0 -2313
  17. package/dist/1567.jclic-node.js.map +0 -1
  18. package/dist/1588.jclic-node.js +0 -602
  19. package/dist/1588.jclic-node.js.map +0 -1
  20. package/dist/1725.jclic-node.js +0 -836
  21. package/dist/1725.jclic-node.js.map +0 -1
  22. package/dist/1731.jclic-node.js +0 -438
  23. package/dist/1731.jclic-node.js.map +0 -1
  24. package/dist/1842.jclic-node.js +0 -651
  25. package/dist/1842.jclic-node.js.map +0 -1
  26. package/dist/2160.jclic-node.js +0 -1016
  27. package/dist/2160.jclic-node.js.map +0 -1
  28. package/dist/222.jclic-node.js +0 -129
  29. package/dist/222.jclic-node.js.map +0 -1
  30. package/dist/2316.jclic-node.js +0 -949
  31. package/dist/2316.jclic-node.js.map +0 -1
  32. package/dist/2355.jclic-node.js +0 -371
  33. package/dist/2355.jclic-node.js.map +0 -1
  34. package/dist/2366.jclic-node.js +0 -431
  35. package/dist/2366.jclic-node.js.map +0 -1
  36. package/dist/2379.jclic-node.js +0 -202
  37. package/dist/2379.jclic-node.js.map +0 -1
  38. package/dist/2437.jclic-node.js +0 -450
  39. package/dist/2437.jclic-node.js.map +0 -1
  40. package/dist/2531.jclic-node.js +0 -869
  41. package/dist/2531.jclic-node.js.map +0 -1
  42. package/dist/2608.jclic-node.js +0 -160
  43. package/dist/2608.jclic-node.js.map +0 -1
  44. package/dist/2715.jclic-node.js +0 -554
  45. package/dist/2715.jclic-node.js.map +0 -1
  46. package/dist/277.jclic-node.js +0 -22
  47. package/dist/277.jclic-node.js.map +0 -1
  48. package/dist/2921.jclic-node.js +0 -660
  49. package/dist/2921.jclic-node.js.map +0 -1
  50. package/dist/2952.jclic-node.js +0 -101
  51. package/dist/2952.jclic-node.js.map +0 -1
  52. package/dist/3018.jclic-node.js +0 -421
  53. package/dist/3018.jclic-node.js.map +0 -1
  54. package/dist/3019.jclic-node.js +0 -682
  55. package/dist/3019.jclic-node.js.map +0 -1
  56. package/dist/3231.jclic-node.js +0 -274
  57. package/dist/3231.jclic-node.js.map +0 -1
  58. package/dist/331.jclic-node.js +0 -115
  59. package/dist/331.jclic-node.js.map +0 -1
  60. package/dist/3391.jclic-node.js +0 -276
  61. package/dist/3391.jclic-node.js.map +0 -1
  62. package/dist/3502.jclic-node.js +0 -671
  63. package/dist/3502.jclic-node.js.map +0 -1
  64. package/dist/3653.jclic-node.js +0 -982
  65. package/dist/3653.jclic-node.js.map +0 -1
  66. package/dist/371.jclic.min.js +0 -2
  67. package/dist/371.jclic.min.js.map +0 -1
  68. package/dist/3856.jclic-node.js +0 -575
  69. package/dist/3856.jclic-node.js.map +0 -1
  70. package/dist/4112.jclic-node.js +0 -659
  71. package/dist/4112.jclic-node.js.map +0 -1
  72. package/dist/4123.jclic-node.js +0 -910
  73. package/dist/4123.jclic-node.js.map +0 -1
  74. package/dist/427.jclic-node.js +0 -894
  75. package/dist/427.jclic-node.js.map +0 -1
  76. package/dist/4483.jclic-node.js +0 -327
  77. package/dist/4483.jclic-node.js.map +0 -1
  78. package/dist/4548.jclic-node.js +0 -1078
  79. package/dist/4548.jclic-node.js.map +0 -1
  80. package/dist/466.jclic-node.js +0 -99
  81. package/dist/466.jclic-node.js.map +0 -1
  82. package/dist/485.jclic-node.js +0 -783
  83. package/dist/485.jclic-node.js.map +0 -1
  84. package/dist/4921.jclic-node.js +0 -500
  85. package/dist/4921.jclic-node.js.map +0 -1
  86. package/dist/5091.jclic-node.js +0 -239
  87. package/dist/5091.jclic-node.js.map +0 -1
  88. package/dist/520.jclic-node.js +0 -550
  89. package/dist/520.jclic-node.js.map +0 -1
  90. package/dist/5312.jclic-node.js +0 -1126
  91. package/dist/5312.jclic-node.js.map +0 -1
  92. package/dist/5338.jclic-node.js +0 -212
  93. package/dist/5338.jclic-node.js.map +0 -1
  94. package/dist/5344.jclic-node.js +0 -229
  95. package/dist/5344.jclic-node.js.map +0 -1
  96. package/dist/5550.jclic-node.js +0 -238
  97. package/dist/5550.jclic-node.js.map +0 -1
  98. package/dist/5626.jclic-node.js +0 -614
  99. package/dist/5626.jclic-node.js.map +0 -1
  100. package/dist/5977.jclic-node.js +0 -1081
  101. package/dist/5977.jclic-node.js.map +0 -1
  102. package/dist/6148.jclic-node.js +0 -345
  103. package/dist/6148.jclic-node.js.map +0 -1
  104. package/dist/6176.jclic-node.js +0 -481
  105. package/dist/6176.jclic-node.js.map +0 -1
  106. package/dist/6221.jclic-node.js +0 -1072
  107. package/dist/6221.jclic-node.js.map +0 -1
  108. package/dist/6238.jclic-node.js +0 -718
  109. package/dist/6238.jclic-node.js.map +0 -1
  110. package/dist/6454.jclic-node.js +0 -1413
  111. package/dist/6454.jclic-node.js.map +0 -1
  112. package/dist/6565.jclic-node.js +0 -294
  113. package/dist/6565.jclic-node.js.map +0 -1
  114. package/dist/6579.jclic-node.js +0 -719
  115. package/dist/6579.jclic-node.js.map +0 -1
  116. package/dist/6715.jclic-node.js +0 -148
  117. package/dist/6715.jclic-node.js.map +0 -1
  118. package/dist/6777.jclic-node.js +0 -171
  119. package/dist/6777.jclic-node.js.map +0 -1
  120. package/dist/6782.jclic-node.js +0 -1611
  121. package/dist/6782.jclic-node.js.map +0 -1
  122. package/dist/6847.jclic-node.js +0 -601
  123. package/dist/6847.jclic-node.js.map +0 -1
  124. package/dist/6856.jclic-node.js +0 -252
  125. package/dist/6856.jclic-node.js.map +0 -1
  126. package/dist/696.jclic-node.js +0 -1821
  127. package/dist/696.jclic-node.js.map +0 -1
  128. package/dist/698.jclic-node.js +0 -583
  129. package/dist/698.jclic-node.js.map +0 -1
  130. package/dist/704.jclic-node.js +0 -80
  131. package/dist/704.jclic-node.js.map +0 -1
  132. package/dist/7046.jclic-node.js +0 -735
  133. package/dist/7046.jclic-node.js.map +0 -1
  134. package/dist/7220.jclic-node.js +0 -156
  135. package/dist/7220.jclic-node.js.map +0 -1
  136. package/dist/7257.jclic-node.js +0 -931
  137. package/dist/7257.jclic-node.js.map +0 -1
  138. package/dist/743.jclic-node.js +0 -583
  139. package/dist/743.jclic-node.js.map +0 -1
  140. package/dist/757.jclic-node.js +0 -1072
  141. package/dist/757.jclic-node.js.map +0 -1
  142. package/dist/7781.jclic-node.js +0 -202
  143. package/dist/7781.jclic-node.js.map +0 -1
  144. package/dist/7912.jclic-node.js +0 -2103
  145. package/dist/7912.jclic-node.js.map +0 -1
  146. package/dist/827.jclic-node.js +0 -708
  147. package/dist/827.jclic-node.js.map +0 -1
  148. package/dist/8276.jclic-node.js +0 -409
  149. package/dist/8276.jclic-node.js.map +0 -1
  150. package/dist/8322.jclic-node.js +0 -498
  151. package/dist/8322.jclic-node.js.map +0 -1
  152. package/dist/8641.jclic-node.js +0 -360
  153. package/dist/8641.jclic-node.js.map +0 -1
  154. package/dist/8837.jclic-node.js +0 -651
  155. package/dist/8837.jclic-node.js.map +0 -1
  156. package/dist/8895.jclic-node.js +0 -151
  157. package/dist/8895.jclic-node.js.map +0 -1
  158. package/dist/9072.jclic-node.js +0 -1285
  159. package/dist/9072.jclic-node.js.map +0 -1
  160. package/dist/9078.jclic-node.js +0 -935
  161. package/dist/9078.jclic-node.js.map +0 -1
  162. package/dist/9103.jclic-node.js +0 -718
  163. package/dist/9103.jclic-node.js.map +0 -1
  164. package/dist/9359.jclic-node.js +0 -145
  165. package/dist/9359.jclic-node.js.map +0 -1
  166. package/dist/9409.jclic-node.js +0 -921
  167. package/dist/9409.jclic-node.js.map +0 -1
  168. package/dist/9513.jclic-node.js +0 -720
  169. package/dist/9513.jclic-node.js.map +0 -1
  170. package/dist/9704.jclic-node.js +0 -81
  171. package/dist/9704.jclic-node.js.map +0 -1
  172. package/dist/9950.jclic-node.js +0 -827
  173. package/dist/9950.jclic-node.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"6454.jclic-node.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGyC;AACJ;AAC8C;;AAEnF;AACA,8BAA8B,4FAA4F;AAC1H;AACA;AACA;AACO,iCAAiC,6EAAiB;AACzD;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA,QAAQ,mDAAmD,OAAO,+FAA+F;AACjK;AACA;AACO,sCAAsC,kFAAsB;AACnE;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F,aAAa,gCAAgC;AAC7C;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B,eAAe,SAAS;AACxB,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,oDAAK;AAC7D,QAAQ;AACR;AACA;AACA;AACA;AACA,gBAAgB,oDAAK;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,WAAW;AACvB;AACA,CAAC;;AAED;AACA,qDAAqD;AACrD,UAAU,OAAO;AACjB;;AAEA;AACA,iEAAe,oDAAQ,sEAAsE,EAAC;;;;;;;;;;;;;;;;;;;;;AChU9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEuB;AACqC;AACH;AACd;AACY;AACP;AACR;;AAExC;AACA,kBAAkB,yCAAyC;AAC3D,IAAI,kDAAkD,oCAAoC,uEAAuE;AACjK;AACA,iFAAiF;AACjF;AACA;AACA;AACA;AACO,gCAAgC,2DAAQ;AAC/C;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA,QAAQ,mDAAmD,OAAO,4FAA4F;AAC9J;AACA;AACO,qCAAqC,gEAAa;AACzD;AACA;AACA,aAAa,0BAA0B,WAAW,yCAAyC;AAC3F,aAAa,gCAAgC;AAC7C;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B,6CAAC;AAC9B,uCAAuC,qBAAqB;AAC5D;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA,8BAA8B,6CAAC;AAC/B,uCAAuC,qBAAqB;AAC5D;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,+DAAa;AAC9B,iBAAiB,+DAAa;;AAE9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC,2DAAM;AACtC,gCAAgC,2DAAM;;AAEtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,mCAAmC;AACzE;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,wDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA,MAAM,wDAAM;AACZ;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,6CAAC,mBAAmB,eAAe,YAAY,gBAAgB;AACpF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iBAAiB,KAAK,kBAAkB;AACxE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB,KAAK,mBAAmB;AAC1E,SAAS;AACT;AACA;;AAEA;AACA,oBAAoB,8DAAY;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B,eAAe,SAAS;AACxB,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,oDAAK;AAC7D;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAK;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,2DAA2D;AACrE;AACA,YAAY,wCAAwC;AACpD;AACA;AACA,UAAU,2DAA2D;AACrE;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA,CAAC;;AAED;AACA,qDAAqD;AACrD,UAAU,OAAO;AACjB;;AAEA;AACA,iEAAe,2DAAQ,oEAAoE,EAAC;;;;;;;;;;;;;;;;ACtgB5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6C;AACN;AACiB;AACR;;AAEhD;AACA,uBAAuB,2DAA2D;AAClF,IAAI,2CAA2C,uBAAuB,iDAAiD;AACvH;AACA;AACA;AACA;AACO,4BAA4B,wDAAY;AAC/C;AACA;AACA,aAAa,sCAAsC;AACnD,aAAa,sBAAsB;AACnC,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,wDAAS;AAC3B,UAAU,oDAAK;AACf,UAAU,wDAAS;AACnB;AACA;;AAEA;AACA;AACA,oBAAoB,eAAe;AACnC;AACA;AACA,iBAAiB,qDAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,uEAAuE;AAC7E,aAAa,sCAAsC;AACnD,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,gDAAgD;AAC7D,aAAa,8BAA8B;AAC3C,aAAa,8BAA8B;AAC3C;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB,MAAM,yDAAQ;AACd,MAAM,yDAAQ;AACd;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB,MAAM,4DAAO;AACb,MAAM,4DAAO;AACb;;AAEA;AACA,sDAAsD,iDAAiD;AACvG;AACA;AACA,aAAa,kCAAkC;AAC/C,eAAe;AACf;AACA;AACA,eAAe,oDAAK;AACpB;;AAEA;AACA,kDAAkD,kDAAkD;AACpG;AACA;AACA,aAAa,kCAAkC;AAC/C,aAAa,kCAAkC;AAC/C,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAK;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,aAAa,EAAC;;;;;;;;;;;;;AClL7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEwD;;AAExD;;AAEA;AACA,sDAAsD,kDAAkD;AACxG,IAAI,kDAAkD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,sBAAsB;AACnC,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA,kDAAkD,0BAA0B;AAC5E,mBAAmB,wDAAS;AAC5B,sBAAsB,oDAAK;AAC3B,oBAAoB,oDAAK;AACzB,2BAA2B,oDAAK;AAChC;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA,gBAAgB,wDAAK;AACrB;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;;AAEA;AACA;AACA,oBAAoB,oDAAK;AACzB,sBAAsB,wDAAS,kCAAkC,wDAAS;AAC1E;AACA,oBAAoB,oDAAK;AACzB,wBAAwB,wDAAS,kCAAkC,wDAAS;AAC5E;AACA;;AAEA;AACA;AACA,yBAAyB,oDAAK;AAC9B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,kBAAkB;AAC/B,aAAa,kCAAkC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,oDAAK;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,2BAA2B;AACvC;AACA;AACA,uBAAuB,mDAAmD;AAC1E;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,YAAY,QAAQ;AACpB;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA,YAAY,kCAAkC;AAC9C;AACA;AACA;AACA;AACA,YAAY,mCAAmC;AAC/C;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,YAAY,EAAC","sources":["webpack://jclic/./src/activities/associations/ComplexAssociation.js","webpack://jclic/./src/activities/associations/SimpleAssociation.js","webpack://jclic/./src/boxes/ActiveBoxGrid.js","webpack://jclic/./src/boxes/BoxConnector.js"],"sourcesContent":["/**\n * File : activities/associations/ComplexAssociation.js\n * Created : 03/06/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n\nimport Activity from '../../Activity.js';\nimport { Point } from '../../AWT.js';\nimport { SimpleAssociation, SimpleAssociationPanel } from './SimpleAssociation.js';\n\n/**\n * This is a special case of {@link module:activities/associations/SimpleAssociation.SimpleAssociation SimpleAssociation} where the elements of the 'secondary' panel\n * can have zero, one or more associated elements in the 'primary' panel.\n * @extends module:activities/associations/SimpleAssociation.SimpleAssociation\n */\nexport class ComplexAssociation extends SimpleAssociation {\n /**\n * ComplexAssociation constructor\n * @param {module:project/JClicProject.JClicProject} project - The JClic project to which this activity belongs\n */\n constructor(project) {\n super(project);\n this.useIdAss = true;\n }\n\n /**\n * Loads this object settings from an XML element\n * @override\n * @param {external:jQuery} $xml - The jQuery XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n this.abc['primary'].avoidAllIdsNull(this.abc['secondary'].getNumCells());\n }\n\n /**\n * Retrieves the minimum number of actions needed to solve this activity.\n * @override\n * @returns {number}\n */\n getMinNumActions() {\n if (this.invAss)\n return this.abc['secondary'].getNumCells();\n else\n return this.abc['primary'].getNumCells() - this.nonAssignedCells;\n }\n}\n\nObject.assign(ComplexAssociation.prototype, {\n /**\n * Number of unassigned cells\n * @name module:activities/associations/ComplexAssociation.ComplexAssociation#nonAssignedCells\n * @type {number} */\n nonAssignedCells: 0,\n /**\n * Uses cell's `idAss` field to check if pairings match\n * @name module:activities/associations/ComplexAssociation.ComplexAssociation#useIdAss\n * @type {boolean} */\n useIdAss: false,\n});\n\n/**\n * The {@link module:Activity.ActivityPanel ActivityPanel} where {@link module:activities/associations/ComplexAssociation.ComplexAssociation ComplexAssociation} activities are played.\n * @extends module:activities/associations/SimpleAssociation.SimpleAssociationPanel\n */\nexport class ComplexAssociationPanel extends SimpleAssociationPanel {\n /**\n * ComplexAssociationPanel prototype\n * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs\n * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the\n * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.\n * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy\n */\n constructor(act, ps, $div) {\n super(act, ps, $div);\n }\n\n /**\n * Prepares the visual components of the activity\n * @override\n */\n buildVisualComponents() {\n super.buildVisualComponents();\n\n const\n abcA = this.act.abc['primary'],\n abcB = this.act.abc['secondary'];\n\n if (abcA && abcB) {\n if (this.act.invAss)\n this.invAssCheck = Array(abcB.getNumCells()).fill(false);\n this.bgA.setDefaultIdAss();\n this.act.nonAssignedCells = 0;\n this.bgA.cells.forEach(bx => {\n if (bx.idAss === -1) {\n this.act.nonAssignedCells++;\n bx.switchToAlt(this.ps);\n }\n });\n }\n }\n\n /**\n * Checks if all inverse associations are done\n * @returns {boolean}\n */\n checkInvAss() {\n if (!this.act.invAss || !this.invAssCheck)\n return false;\n return this.invAssCheck.every(chk => chk);\n }\n\n /**\n * Main handler used to process mouse, touch, keyboard and edit events\n * @override\n * @param {external:Event} event - The HTML event to be processed\n * @returns {boolean} - When this event handler returns `false`, jQuery will stop its\n * propagation through the DOM tree. See: {@link http://api.jquery.com/on}\n */\n processEvent(event) {\n if (this.bc && this.playing) {\n //\n // The [AWT.Point](AWT.html#Point) where the mouse or touch event has been originated\n // and two [ActiveBox](ActiveBox.html) pointers used for the [BoxConnector](BoxConnector.html)\n // `origin` and `dest` points.\n let p = null, bx1, bx2;\n\n //\n // _touchend_ event don't provide pageX nor pageY information\n if (event.type === 'touchend') {\n p = this.bc.active ? this.bc.dest.clone() : new Point();\n } else {\n // Touch events can have more than one touch, so `pageX` must be obtained from `touches[0]`\n let\n x = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX,\n y = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY;\n p = new Point(x - this.$div.offset().left, y - this.$div.offset().top);\n }\n\n let\n // Flag for tracking `mouseup` events\n up = false,\n // Flag for assuring that only one media plays per event (avoid event sounds overlapping\n // cell's media sounds)\n m = false,\n // Flag for tracking clicks on the background of grid A\n clickOnBg0 = false,\n // Array to be filled with actions to be executed at the end of event processing\n delayedActions = [];\n\n switch (event.type) {\n case 'touchcancel':\n // Canvel movement\n if (this.bc.active)\n this.bc.end();\n break;\n\n case 'mouseup':\n // Don't consider drag moves below 3 pixels. Can be a \"trembling click\"\n if (this.bc.active && p.distanceTo(this.bc.origin) <= 3) {\n break;\n }\n up = true;\n /* falls through */\n case 'touchend':\n case 'touchstart':\n case 'mousedown':\n if (!this.bc.active) {\n // New pairing starts\n //\n // Pairings can never start with a `mouseup` event\n if (up)\n break;\n\n this.ps.stopMedia(1);\n // Determine if click was done on panel A or panel B\n bx1 = this.bgA ? this.bgA.findActiveBox(p) : null;\n bx2 = this.bgB ? this.bgB.findActiveBox(p) : null;\n if (bx1 && bx1.idAss !== -1 && (!this.act.useOrder || bx1.idOrder === this.currentItem) ||\n !this.act.useOrder && bx2) {\n // Start the [BoxConnector](BoxConnector.html)\n if (this.act.dragCells)\n this.bc.begin(p, bx1 || bx2);\n else\n this.bc.begin(p);\n // Play cell media or event sound\n m = m || (bx1 || bx2).playMedia(this.ps, delayedActions);\n if (!m)\n this.playEvent('click');\n }\n\n // Move the focus to the opposite accessible group\n let bg = bx1 ? this.bgA : this.bgB;\n if (bg && bg.$accessibleDiv) {\n bg = bx1 ? this.bgB : this.bgA;\n if (bg && bg.$accessibleDiv)\n bg.$accessibleDiv.focus();\n }\n } else {\n this.ps.stopMedia(1);\n // Pairing completed\n //\n // Find the active boxes behind `bc.origin` and `p`\n const origin = this.bc.origin;\n this.bc.end();\n bx1 = this.bgA ? this.bgA.findActiveBox(origin) : null;\n if (bx1) {\n bx2 = this.bgB ? this.bgB.findActiveBox(p) : null;\n } else {\n bx2 = this.bgB ? this.bgB.findActiveBox(origin) : null;\n if (bx2) {\n bx1 = this.bgA ? this.bgA.findActiveBox(p) : null;\n clickOnBg0 = true;\n }\n }\n // Check if the pairing was correct\n if (bx1 && bx2 && bx1.idAss !== -1 && !bx2.isInactive() && this.act.abc['secondary']) {\n const\n src = bx1.getDescription(),\n dest = bx2.getDescription(),\n matchingDest = this.act.abc['secondary'].getActiveBoxContent(bx1.idAss);\n let ok = false;\n\n if (bx1.idAss === bx2.idOrder || bx2.getContent().isEquivalent(matchingDest, true)) {\n // Pairing was OK. Play media and disable involved cells\n ok = true;\n bx1.idAss = -1;\n if (this.act.abc['solvedPrimary']) {\n bx1.switchToAlt(this.ps);\n m = m || bx1.playMedia(this.ps, delayedActions);\n } else {\n if (clickOnBg0)\n m = m || bx1.playMedia(this.ps, delayedActions);\n else\n m = m || bx2.playMedia(this.ps, delayedActions);\n bx1.clear();\n }\n if (this.act.invAss) {\n this.invAssCheck[bx2.idOrder] = true;\n bx2.clear();\n }\n if (this.act.useOrder && this.bgA)\n // Load next item\n this.currentItem = this.bgA.getNextItem(this.currentItem);\n }\n // Check results and notify action\n if (this.bgA) {\n const cellsPlaced = this.bgA.countCellsWithIdAss(-1);\n this.ps.reportNewAction(this.act, 'MATCH', src, dest, ok, cellsPlaced - this.act.nonAssignedCells);\n // End activity or play event sound\n if (ok && (this.checkInvAss() || cellsPlaced === this.bgA.getNumCells()))\n this.finishActivity(true);\n else if (!m)\n this.playEvent(ok ? 'actionOk' : 'actionError');\n }\n } else if (this.bgB && (clickOnBg0 && this.bgA && this.bgA.contains(p) || !clickOnBg0 && this.bgB.contains(p))) {\n // click on grid, out of cell\n const srcOut = bx1 ? bx1.getDescription() : bx2 ? bx2.getDescription() : 'null';\n this.ps.reportNewAction(this.act, 'MATCH', srcOut, 'null', false, this.bgB.countCellsWithIdAss(-1));\n this.playEvent('actionError');\n }\n this.update();\n\n // Move the focus to the `source` accessible group\n if (this.bgA && this.bgA.$accessibleDiv)\n this.bgA.$accessibleDiv.focus();\n }\n break;\n\n case 'mousemove':\n case 'touchmove':\n this.bc.moveTo(p);\n break;\n }\n delayedActions.forEach(action => action());\n event.preventDefault();\n }\n }\n}\n\nObject.assign(ComplexAssociationPanel.prototype, {\n /**\n * Array for storing checked associations\n * @name module:activities/associations/ComplexAssociation.ComplexAssociationPanel#invAssCheck\n * @type {boolean[]} */\n invAssCheck: null,\n});\n\n/**\n * Panel class associated to this type of activity: {@link module:activities/associations/ComplexAssociation.ComplexAssociationPanel ComplexAssociationPanel}\n * @type {class} */\nComplexAssociation.Panel = ComplexAssociationPanel;\n\n// Register activity class\nexport default Activity.registerClass('@associations.ComplexAssociation', ComplexAssociation);\n","/**\n * File : activities/associations/SimpleAssociation.js\n * Created : 02/06/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport $ from 'jquery';\nimport { Activity, ActivityPanel } from '../../Activity.js';\nimport ActiveBoxGrid from '../../boxes/ActiveBoxGrid.js';\nimport BoxBag from '../../boxes/BoxBag.js';\nimport BoxConnector from '../../boxes/BoxConnector.js';\nimport { Rectangle, Point } from '../../AWT.js';\nimport { getMsg } from '../../Utils.js';\n\n/**\n * This class of {@link module:Activity.Activity Activity} uses two panels (`primary` and `secondary`) formed by\n * {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects filled with data stored in {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} repositories.\n *\n * Both panels have the same number of elements, associated one-to-one. A third {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent}\n * can be used as alternative content, that will be revealed in the `primary` panel as the pairings\n * of its cells are solved.\n * @extends module:Activity.Activity\n */\nexport class SimpleAssociation extends Activity {\n /**\n * SimpleAssociation constructor\n * @param {module:project/JClicProject.JClicProject} project - The JClic project to which this activity belongs\n */\n constructor(project) {\n super(project);\n }\n\n /**\n * Retrieves the minimum number of actions needed to solve this activity.\n * @override\n * @returns {number}\n */\n getMinNumActions() {\n return this.abc.primary.getNumCells();\n }\n\n /**\n * Whether or not the activity uses random to shuffle internal components\n * @override\n * @returns {boolean}\n */\n hasRandom() {\n return true;\n }\n\n /**\n * When `true`, the activity must always be shuffled\n * @override\n * @returns {boolean}\n */\n shuffleAlways() {\n return true;\n }\n\n /**\n * Whether the activity allows the user to request help.\n * @override\n * @returns {boolean}\n */\n helpSolutionAllowed() {\n return true;\n }\n}\n\nObject.assign(SimpleAssociation.prototype, {\n /**\n * When `true`, the cell's `idAss` field will be used to check pairing matches.\n * @name module:activities/associations/SimpleAssociation.SimpleAssociation#useIdAss\n * @type {boolean} */\n useIdAss: false,\n});\n\n/**\n * The {@link module:Activity.ActivityPanel ActivityPanel} where {@link module:activities/associations/SimpleAssociation.SimpleAssociation SimpleAssociation} activities are played.\n * @extends module:Activity.ActivityPanel ActivityPanel\n */\nexport class SimpleAssociationPanel extends ActivityPanel {\n /**\n * SimpleAssociationPanel constructor\n * @param {module:Activity.Activity} act - The {@link module:Activity.Activity Activity} to which this Panel belongs\n * @param {module:JClicPlayer.JClicPlayer} ps - Any object implementing the methods defined in the\n * [PlayStation](http://projectestac.github.io/jclic/apidoc/edu/xtec/jclic/PlayStation.html) Java interface.\n * @param {external:jQuery} [$div] - The jQuery DOM element where this Panel will deploy\n */\n constructor(act, ps, $div) {\n super(act, ps, $div);\n }\n\n /**\n * Performs miscellaneous cleaning operations\n * @override\n */\n clear() {\n if (this.bgA) {\n this.bgA.end();\n this.bgA = null;\n }\n if (this.bgB) {\n this.bgB.end();\n this.bgB = null;\n }\n }\n\n /**\n * Prepares the visual components of the activity\n * @override\n */\n buildVisualComponents() {\n if (this.firstRun)\n super.buildVisualComponents();\n\n this.clear();\n\n const\n abcA = this.act.abc['primary'],\n abcB = this.act.abc['secondary'],\n solved = this.act.abc['solvedPrimary'];\n\n if (abcA && abcB) {\n if (abcA.image) {\n abcA.setImgContent(this.act.project.mediaBag, null, false);\n if (abcA.animatedGifFile && !abcA.shaper.rectangularShapes && !this.act.shuffleA)\n this.$animatedBg = $('<span/>').css({\n 'background-image': `url(${abcA.animatedGifFile})`,\n 'background-position': 'center',\n 'background-repeat': 'no-repeat',\n position: 'absolute'\n }).appendTo(this.$div);\n }\n\n if (abcB.image) {\n abcB.setImgContent(this.act.project.mediaBag, null, false);\n if (abcB.animatedGifFile && !abcB.shaper.rectangularShapes && !this.act.shuffleB)\n this.$animatedBgB = $('<span/>').css({\n 'background-image': `url(${abcB.animatedGifFile})`,\n 'background-position': 'center',\n 'background-repeat': 'no-repeat',\n position: 'absolute'\n }).appendTo(this.$div);\n }\n\n if (solved && solved.image)\n solved.setImgContent(this.act.project.mediaBag, null, false);\n\n if (this.act.acp !== null) {\n const contentKit = [abcA, abcB];\n if (solved)\n contentKit.push(solved);\n this.act.acp.generateContent(abcA.nch, abcA.ncw, contentKit, false);\n }\n\n this.bgA = ActiveBoxGrid.createEmptyGrid(null, this, this.act.margin, this.act.margin, abcA);\n this.bgB = ActiveBoxGrid.createEmptyGrid(null, this, this.act.margin, this.act.margin, abcB);\n\n this.bgA.setContent(abcA, solved ? solved : null);\n if (this.$animatedBg)\n this.bgA.setCellAttr('tmpTrans', true);\n\n this.bgB.setContent(abcB);\n if (this.$animatedBgB)\n this.bgB.setCellAttr('tmpTrans', true);\n\n this.bgA.accessibleText = getMsg('source');\n this.bgB.accessibleText = getMsg('target');\n\n this.bgA.setVisible(true);\n this.bgB.setVisible(true);\n }\n }\n\n /**\n * Basic initialization procedure\n * @override\n */\n initActivity() {\n super.initActivity();\n if (!this.firstRun)\n this.buildVisualComponents();\n else\n this.firstRun = false;\n\n if (this.bgA && this.bgB) {\n // Scramble cells\n const shuffleArray = [];\n if (this.act.shuffleA)\n shuffleArray.push(this.bgA);\n if (this.act.shuffleB)\n shuffleArray.push(this.bgB);\n if (shuffleArray.length > 0) {\n this.shuffle(shuffleArray, true, true);\n }\n\n if (this.useOrder)\n this.currentItem = this.bgA.getNextItem(-1);\n\n this.invalidate().update();\n this.setAndPlayMsg('initial', 'start');\n this.playing = true;\n }\n }\n\n /**\n * Updates the graphic content of this panel.\n * This method will be called from {@link module:AWT.Container#update} when needed.\n * @override\n * @param {module:AWT.Rectangle} dirtyRegion - Specifies the area to be updated. When `null`,\n * it's the whole panel.\n */\n updateContent(dirtyRegion) {\n super.updateContent(dirtyRegion);\n if (this.bgA && this.bgB && this.$canvas) {\n const\n canvas = this.$canvas.get(-1),\n ctx = canvas.getContext('2d');\n if (!dirtyRegion)\n dirtyRegion = new Rectangle(0, 0, canvas.width, canvas.height);\n ctx.clearRect(dirtyRegion.pos.x, dirtyRegion.pos.y, dirtyRegion.dim.width, dirtyRegion.dim.height);\n this.bgA.update(ctx, dirtyRegion);\n this.bgB.update(ctx, dirtyRegion);\n }\n return this;\n }\n\n /**\n * Sets the real dimension of this panel.\n * @override\n * @param {module:AWT.Dimension} preferredMaxSize - The maximum surface available for the activity panel\n * @returns {module:AWT.Dimension}\n */\n setDimension(preferredMaxSize) {\n return !this.bgA || !this.bgB || this.getBounds().equals(preferredMaxSize) ?\n preferredMaxSize :\n BoxBag.layoutDouble(preferredMaxSize, this.bgA, this.bgB, this.act.boxGridPos, this.act.margin);\n }\n\n /**\n * Sets the size and position of this activity panel\n * @override\n * @param {module:AWT.Rectangle} rect\n */\n setBounds(rect) {\n if (this.$canvas)\n this.$canvas.remove();\n\n super.setBounds(rect);\n if (this.bgA || this.bgB) {\n // Create the main canvas\n this.$canvas = $(`<canvas width=\"${rect.dim.width}\" height=\"${rect.dim.height}\"/>`).css({\n position: 'absolute',\n top: 0,\n left: 0\n });\n // Resize animated gif background A\n if (this.$animatedBg && this.bgA) {\n const bgRect = this.bgA.getBounds();\n this.$animatedBg.css({\n left: bgRect.pos.x,\n top: bgRect.pos.y,\n width: bgRect.dim.width + 'px',\n height: bgRect.dim.height + 'px',\n 'background-size': `${bgRect.dim.width}px ${bgRect.dim.height}px`\n });\n }\n // Resize animated gif background B\n if (this.$animatedBgB && this.bgB) {\n const bgRectB = this.bgB.getBounds();\n this.$animatedBgB.css({\n left: bgRectB.pos.x,\n top: bgRectB.pos.y,\n width: bgRectB.dim.width + 'px',\n height: bgRectB.dim.height + 'px',\n 'background-size': `${bgRectB.dim.width}px ${bgRectB.dim.height}px`\n });\n }\n this.$div.append(this.$canvas);\n\n // Create a [BoxConnector](BoxConnector.html) and attach it to the canvas context\n this.bc = new BoxConnector(this, this.$canvas);\n\n // Repaint all\n this.invalidate().update();\n }\n }\n\n /**\n * Builds the accessible components needed for this ActivityPanel\n * This method is called when all main elements are placed and visible, when the activity is ready\n * to start or when resized.\n * @override\n */\n buildAccessibleComponents() {\n if (this.$canvas && this.accessibleCanvas) {\n super.buildAccessibleComponents();\n if (this.bgA)\n this.bgA.buildAccessibleElements(this.$canvas, this.$div, 'mousedown');\n if (this.bgB)\n this.bgB.buildAccessibleElements(this.$canvas, this.$div, 'mousedown');\n }\n }\n\n /**\n * Main handler used to process mouse, touch, keyboard and edit events\n * @override\n * @param {external:Event} event - The HTML event to be processed\n * @returns {boolean} - When this event handler returns `false`, jQuery will stop its\n * propagation through the DOM tree. See: {@link http://api.jquery.com/on}\n */\n processEvent(event) {\n if (this.bc && this.playing) {\n //\n // The [AWT.Point](AWT.html#Point) where the mouse or touch event has been originated\n // and two [ActiveBox](ActiveBox.html) pointers used for the [BoxConnector](BoxConnector.html)\n // `origin` and `dest` points.\n let p = null, bx1, bx2;\n //\n // _touchend_ event don't provide pageX nor pageY information\n if (event.type === 'touchend')\n p = this.bc.active ? this.bc.dest.clone() : new Point();\n else {\n // Touch events can have more than one touch, so `pageX` must be obtained from `touches[0]`\n const\n x = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX,\n y = event.originalEvent && event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY;\n p = new Point(x - this.$div.offset().left, y - this.$div.offset().top);\n }\n\n // Flag for tracking `mouseup` events\n let up = false,\n // Flag for assuring that only one media plays per event (avoid event sounds overlapping\n // cell's media sounds)\n m = false,\n // Flag for tracking clicks on the background of grid A\n clickOnBg0 = false,\n // Array to be filled with actions to be executed at the end of event processing\n delayedActions = [];\n\n switch (event.type) {\n case 'touchcancel':\n // Canvel movement\n if (this.bc.active)\n this.bc.end();\n break;\n\n case 'mouseup':\n // Don't consider drag moves below 3 pixels. Can be a \"trembling click\"\n if (this.bc.active && p.distanceTo(this.bc.origin) <= 3) {\n break;\n }\n up = true;\n /* falls through */\n case 'touchend':\n case 'touchstart':\n case 'mousedown':\n if (!this.bc.active) {\n // A new pairing starts\n //\n // Pairings can never start with a `mouseup` event\n if (up)\n break;\n\n this.ps.stopMedia(1);\n //\n // Determine if click was done on panel A or panel B\n bx1 = this.bgA ? this.bgA.findActiveBox(p) : null;\n bx2 = this.bgB ? this.bgB.findActiveBox(p) : null;\n if (bx1 && (!this.act.useOrder || bx1.idOrder === this.currentItem) ||\n !this.act.useOrder && bx2 && bx2.idAss !== -1) {\n // Start the [BoxConnector](BoxConnector.html)\n if (this.act.dragCells)\n this.bc.begin(p, bx1 || bx2);\n else\n this.bc.begin(p);\n // Play cell media or event sound\n m = m || (bx1 || bx2).playMedia(this.ps, delayedActions);\n if (!m)\n this.playEvent('click');\n\n // Move the focus to the opposite accessible group\n let bg = bx1 ? this.bgA : this.bgB;\n if (bg && bg.$accessibleDiv) {\n bg = bx1 ? this.bgB : this.bgA;\n if (bg && bg.$accessibleDiv)\n bg.$accessibleDiv.focus();\n }\n }\n } else {\n this.ps.stopMedia(1);\n // Pairing completed\n //\n // Find the active boxes behind `bc.origin` and `p`\n const origin = this.bc.origin;\n this.bc.end();\n bx1 = this.bgA ? this.bgA.findActiveBox(origin) : null;\n if (bx1) {\n bx2 = this.bgB ? this.bgB.findActiveBox(p) : null;\n } else {\n bx2 = this.bgB ? this.bgB.findActiveBox(origin) : null;\n if (bx2) {\n bx1 = this.bgA ? this.bgA.findActiveBox(p) : null;\n clickOnBg0 = true;\n }\n }\n // Check if the pairing was correct\n if (bx1 && bx2 && bx1.idAss !== -1 && bx2.idAss !== -1 && this.act.abc['secondary']) {\n let ok = false;\n const\n src = bx1.getDescription(),\n dest = bx2.getDescription(),\n matchingDest = this.act.abc['secondary'].getActiveBoxContent(bx1.idOrder);\n if (bx1.idOrder === bx2.idOrder || bx2.getContent().isEquivalent(matchingDest, true)) {\n // Pairing is OK. Play media and disable involved cells\n ok = true;\n bx1.idAss = -1;\n bx2.idAss = -1;\n if (this.act.abc['solvedPrimary']) {\n bx1.switchToAlt(this.ps);\n m = m || bx1.playMedia(this.ps, delayedActions);\n } else {\n if (clickOnBg0)\n m = m || bx1.playMedia(this.ps, delayedActions);\n else\n m = m || bx2.playMedia(this.ps, delayedActions);\n bx1.clear();\n }\n bx2.clear();\n\n if (this.act.useOrder && this.bgA)\n // Load next item\n this.currentItem = this.bgA.getNextItem(this.currentItem);\n }\n // Check results and notify action\n const cellsPlaced = this.bgB ? this.bgB.countCellsWithIdAss(-1) : 0;\n this.ps.reportNewAction(this.act, 'MATCH', src, dest, ok, cellsPlaced);\n // End activity or play event sound\n if (ok && cellsPlaced === this.bgB.getNumCells())\n this.finishActivity(true);\n else if (!m)\n this.playEvent(ok ? 'actionOk' : 'actionError');\n }\n this.update();\n\n // Move the focus to the `source` accessible group\n if (this.bgA && this.bgA.$accessibleDiv)\n this.bgA.$accessibleDiv.focus();\n }\n break;\n\n case 'mousemove':\n case 'touchmove':\n this.bc.moveTo(p);\n break;\n }\n delayedActions.forEach(action => action());\n event.preventDefault();\n }\n }\n}\n\nObject.assign(SimpleAssociationPanel.prototype, {\n /**\n * The {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} object containing the information to be displayed in the `primary` panel\n * @name module:activities/associations/SimpleAssociation.SimpleAssociationPanel#bgA\n * @type {module:boxes/ActiveBoxBag.ActiveBoxBag} */\n bgA: null,\n /**\n * The {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} object containing the information to be displayed in the `secondary` panel\n * @name module:activities/associations/SimpleAssociation.SimpleAssociationPanel#bgB\n * @type {module:boxes/ActiveBoxBag.ActiveBoxBag} */\n bgB: null,\n /**\n * The box connector\n * @name module:activities/associations/SimpleAssociation.SimpleAssociationPanel#bc\n * @type {module:boxes/BoxConnector.BoxConnector} */\n bc: null,\n /**\n * List of mouse, touch and keyboard events intercepted by this panel\n * @override\n * @name module:activities/associations/SimpleAssociation.SimpleAssociationPanel#events\n * @type {string[]} */\n events: ['mousedown', 'mouseup', 'mousemove', 'touchstart', 'touchend', 'touchmove', 'touchcancel'],\n});\n\n/**\n * Panel class associated to this type of activity: {@link module:activities/associations/SimpleAssociation.SimpleAssociationPanel SimpleAssociationPanel}\n * @type {class} */\nSimpleAssociation.Panel = SimpleAssociationPanel;\n\n// Register activity class\nexport default Activity.registerClass('@associations.SimpleAssociation', SimpleAssociation);\n","/**\n * File : boxes/ActiveBoxGrid.js\n * Created : 19/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport ActiveBoxBag from './ActiveBoxBag.js';\nimport ActiveBox from './ActiveBox.js';\nimport { Rectangle, Dimension, Point } from '../AWT.js';\nimport { settings, roundTo } from '../Utils.js';\n\n/**\n * This class extends {@link module:boxes/ActiveBoxbag.ActiveBoxBag ActiveBoxBag} with constructors that take an argument of type\n * {@link module:shapers/Shaper.Shaper Shaper} used to build all its {@link module:boxes/ActiveBox.ActiveBox ActiveBox}components. It also maintains information\n * about the number of \"rows\" and \"columns\", useful to compute valid (integer) values when\n * resizing or moving its components.\n * @extends module:boxes/ActiveBoxBag.ActiveBoxBag\n */\nexport class ActiveBoxGrid extends ActiveBoxBag {\n /**\n * ActiveBxGrid constructor\n * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs\n * @param {module:AWT.Container} container - The container where this box grid is placed.\n * @param {module:boxes/BoxBase} boxBase - The object where colors, fonts, border and other graphic properties\n * @param {number} px - `X` coordinate of the upper left corner of this box grid\n * @param {number} py - `Y` coordinate of the upper left corner of this box grid\n * @param {number} setWidth - Total width of the box grid\n * @param {number} setHeight - Total height of the box grid\n * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects\n */\n constructor(parent, container, boxBase, px, py, setWidth, setHeight, sh) {\n // ActiveBoxGrid derives from ActiveBoxBag\n super(parent, container, boxBase);\n\n this.nCols = sh.nCols;\n this.nRows = sh.nRows;\n\n // This will be the enclosing rectangle of this ActiveBox bag\n const r = new Rectangle(\n new Point(px, py),\n new Dimension(\n Math.round(setWidth / this.nCols) * this.nCols,\n Math.round(setHeight / this.nRows) * this.nRows));\n\n // Create all the [ActiveBox](ActiveBox.html) objects based on the\n // shapes provided by the [Shaper](Shaper.html)\n for (let i = 0; i < sh.nCells; i++) {\n const\n tmpSh = sh.getShape(i, r),\n bx = new ActiveBox(this, container, boxBase, i, tmpSh.getBounds());\n if (!sh.rectangularShapes)\n bx.setShape(tmpSh);\n this.addActiveBox(bx);\n }\n\n // If the Shaper has `remainder` (extra space), set the background box of this\n // [BoxBag](BoxBag.html)\n if (sh.hasRemainder) {\n const\n tmpSh = sh.getRemainderShape(r),\n bx = new ActiveBox(this, container, boxBase, 0, tmpSh.getBounds());\n bx.setShape(tmpSh);\n this.setBackgroundBox(bx);\n }\n }\n\n /**\n * This factory constructor creates a new empty grid with the number of cells indicated by the\n * {@link module:boxes/ActiveBagContent.ActiveBagContent ActiveBagContent} `abc`, not filling the cells with any content.\n * @param {module:boxes/AbstractBox.AbstractBox} parent - The AbstractBox to which this box grid belongs\n * @param {module:AWT.Container} container - The container where this box grid is placed.\n * @param {number} px - `X` coordinate of the upper left corner of this box grid\n * @param {number} py - `Y` coordinate of the upper left corner of this box grid\n * @param {module:boxes/ActiveBagContent.ActiveBagContent} abc - Used only to get the number of cells and the shaper (when `sh` is `null`)\n * @param {module:shapers/Shaper.Shaper} sh - Shaper used to build the ActiveBox objects\n * @param {module:boxes/BoxBase.BoxBase} boxBase - The object where colors, fonts, border and other graphic properties\n * of this box grid are defined.\n * @returns {module:boxes/ActiveBoxGrid.ActiveBoxGrid}\n */\n static createEmptyGrid(parent, container, px, py, abc, sh, boxBase) {\n const result = abc ? new ActiveBoxGrid(parent, container,\n boxBase || abc.style,\n px, py,\n abc.getTotalWidth(), abc.getTotalHeight(),\n sh || abc.getShaper()) : null;\n\n if (result)\n result.setBorder(abc.border);\n\n return result;\n }\n\n /**\n * Gets the minimum size of this grid\n * @returns {module:AWT.Dimension}\n */\n getMinimumSize() {\n return new Dimension(\n settings.MIN_CELL_SIZE * this.nCols,\n settings.MIN_CELL_SIZE * this.nRows);\n }\n\n /**\n * Gets a scaled size of this grid, rounded to the nearest integer values\n * @param {number} scale - The scale factor\n * @returns {module:AWT.Dimension}\n */\n getScaledSize(scale) {\n return new Dimension(\n roundTo(scale * this.preferredBounds.dim.width, this.nCols),\n roundTo(scale * this.preferredBounds.dim.height, this.nRows));\n }\n\n /**\n * Returns the logical coordinates of the provided {@link module:boxes/ActiveBox.ActiveBox ActiveBox}.\n * The units of the result are not pixels, but ordinal numbers (relative positions) of columns\n * and rows in the grid.\n * @param {module:boxes/ActiveBox.ActiveBox} bx - The box to process\n * @returns {module:AWT.Point}\n */\n getCoord(bx) {\n return new Point(bx.idLoc % this.nCols, Math.floor(bx.idLoc / this.nCols));\n }\n\n /**\n * Calculates the logical distance between two {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects.\n * Resulting units are not pixels, but ordinal numbers (relative positions) of columns and rows\n * in the grid.\n * @param {module:boxes/ActiveBox.ActiveBox} src - First box\n * @param {module:boxes/ActiveBox.ActiveBox} dest - Second box\n * @returns {module:AWT.Point}\n */\n getCoordDist(src, dest) {\n const\n ptSrc = this.getCoord(src),\n ptDest = this.getCoord(dest);\n return new Point(ptDest.x - ptSrc.x, ptDest.y - ptSrc.y);\n }\n}\n\nObject.assign(ActiveBoxGrid.prototype, {\n /**\n * Number of columns of this box grid\n * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nCols\n * @type {number} */\n nCols: 1,\n /**\n * Number of rows of this box grid\n * @name module:boxes/ActiveBoxGrid.ActiveBoxGrid#nRows\n * @type {number} */\n nRows: 1,\n});\n\nexport default ActiveBoxGrid;\n","/**\n * File : boxes/BoxConnector.js\n * Created : 26/05/2015\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Catalan Educational Telematic Network (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\nimport { Point, Dimension, Rectangle } from '../AWT.js';\n\nconst DEFAULT_COMPOSITE_OP = 'source-over';\n\n/**\n * BoxConnector allows users to visually connect two {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects of an\n * {@link module:Activity.ActivityPanel ActivityPanel}. There are two modes of operation:\n *\n * - Drawing a line between an origin point (usually the point where the user clicks on) and a\n * destination point.\n * - Dragging the ActiveBox from one location to another.\n *\n * The connecting lines can have arrowheads at its endings.\n */\nexport class BoxConnector {\n /**\n * BoxConnector constructor\n * @param {module:AWT.Container} parent - The Container to which this BoxConnector belongs\n * @param {external:jQuery} $canvas - The HTML `canvas` element where this BoxConnector will draw.\n */\n constructor(parent, $canvas) {\n this.parent = parent;\n this.ctx = $canvas.get(-1).getContext('2d', { willReadFrequently: true });\n this.dim = new Dimension(this.ctx.canvas.width, this.ctx.canvas.height);\n this.origin = new Point();\n this.dest = new Point();\n this.relativePos = new Point();\n }\n\n /**\n * Displaces the ending point of the connector\n * @param {number} dx - Displacement on the X axis\n * @param {number} dy - Displacement on the Y axis\n */\n moveBy(dx, dy) {\n this.moveTo(Point(this.dest.x + dx, this.dest.y + dy));\n }\n\n /**\n * Moves the ending point of the connector to a new position\n * @param {module:AWT.Point} pt - The new position\n * @param {boolean} forcePaint - When `true`, forces the repaint of all the area also if there is\n * no movement at all.\n */\n moveTo(pt, forcePaint) {\n if (!this.active || !forcePaint && this.dest.equals(pt))\n return;\n\n // Restore the background\n if (this.bgRect) {\n if (this.bgImg) {\n this.ctx.putImageData(\n this.bgImg,\n 0, 0,\n this.bgRect.pos.x, this.bgRect.pos.y,\n this.bgRect.dim.width, this.bgRect.dim.height);\n } else if (this.parent)\n this.parent.updateContent();\n }\n\n this.dest.moveTo(pt);\n\n // Calculate the bounds of the invalidated area after the move:\n // Start with the origin point or box area\n const pt1 = new Point(this.origin.x - this.relativePos.x, this.origin.y - this.relativePos.y);\n this.bgRect = new Rectangle(pt1, this.bx ? this.bx.dim : new Dimension());\n // Add the destination point or box area\n const pt2 = new Point(pt.x - this.relativePos.x, pt.y - this.relativePos.y);\n this.bgRect.add(new Rectangle(pt2, this.bx ? this.bx.dim : new Dimension()));\n // Add a generous border around the area\n this.bgRect.grow(10, 10);\n\n if (this.bx !== null) {\n // Move the ActiveBox\n this.bx.moveTo(new Point(pt.x - this.relativePos.x, pt.y - this.relativePos.y));\n this.bx.setTemporaryHidden(false);\n this.bx.update(this.ctx, null);\n this.bx.setTemporaryHidden(true);\n } else {\n // Draw the connecting line\n this.drawLine();\n this.linePainted = true;\n }\n }\n\n /**\n * Starts the box connector operation\n * @param {module:AWT.Point} pt - Starting point\n * @param {module:boxes/ActiveBox.ActiveBox} [box] - Passed only when the BoxConnector runs in drag&drop mode\n */\n begin(pt, box) {\n if (this.active)\n this.end();\n this.origin.moveTo(pt);\n this.dest.moveTo(pt);\n this.linePainted = false;\n this.active = true;\n\n if (box) {\n // Remember what box will be moved, hide it from the panel and repaint all\n this.bx = box;\n this.relativePos.moveTo(pt.x - box.pos.x, pt.y - box.pos.y);\n this.bx.setFocused(true);\n this.bx.setTemporaryHidden(true);\n this.linePainted = false;\n this.parent.invalidate().update();\n }\n\n // Save the full image currently displayed on the panel (with the box hidden)\n try {\n this.bgImg = this.ctx.getImageData(0, 0, this.dim.width, this.dim.height);\n } catch (_ex) {\n // Avoid \"canvas tainted by cross-origin data\" errors\n // Setting bgImg to null is less efficient, but works\n this.bgImg = null;\n }\n this.bgRect = null;\n\n // Make a first movement to make the box appear\n if (box)\n this.moveTo(pt, true);\n }\n\n /**\n * Finalizes the operation of this box connector until a new call to `begin`\n */\n end() {\n if (!this.active)\n return;\n\n this.active = false;\n this.linePainted = false;\n this.bgRect = null;\n this.bgImg = null;\n\n if (this.bx) {\n // Restore the original position and attributes of the box\n this.bx.setFocused(false);\n this.bx.moveTo(this.origin.x - this.relativePos.x, this.origin.y - this.relativePos.y);\n this.bx.setTemporaryHidden(false);\n this.bx = null;\n this.relativePos.moveTo(0, 0);\n }\n\n // Repaint all\n this.ctx.clearRect(0, 0, this.dim.width, this.dim.height);\n this.parent.invalidate().update();\n }\n\n /**\n * Strokes a line between `origin` and `dest`, optionally ended with an arrowhead.\n */\n drawLine() {\n if (this.compositeOp !== DEFAULT_COMPOSITE_OP) {\n this.ctx.strokeStyle = this.xorColor;\n this.ctx.globalCompositeOperation = this.compositeOp;\n } else\n this.ctx.strokeStyle = this.lineColor;\n\n this.ctx.lineWidth = this.lineWidth;\n\n this.ctx.beginPath();\n this.ctx.moveTo(this.origin.x, this.origin.y);\n this.ctx.lineTo(this.dest.x, this.dest.y);\n this.ctx.stroke();\n\n if (this.arrow) {\n // Draws the arrow head\n const\n beta = Math.atan2(this.origin.x - this.dest.x, this.dest.x - this.origin.x),\n arp = new Point(this.dest.x - this.arrowLength * Math.cos(beta + this.arrowAngle),\n this.dest.y + this.arrowLength * Math.sin(beta + this.arrowAngle));\n this.ctx.beginPath();\n this.ctx.moveTo(this.dest.x, this.dest.y);\n this.ctx.lineTo(arp.x, arp.y);\n this.ctx.stroke();\n\n arp.moveTo(this.dest.x - this.arrowLength * Math.cos(beta - this.arrowAngle),\n this.dest.y + this.arrowLength * Math.sin(beta - this.arrowAngle));\n this.ctx.beginPath();\n this.ctx.moveTo(this.dest.x, this.dest.y);\n this.ctx.lineTo(arp.x, arp.y);\n this.ctx.stroke();\n }\n if (this.compositeOp !== DEFAULT_COMPOSITE_OP) {\n // reset default settings\n this.ctx.globalCompositeOperation = DEFAULT_COMPOSITE_OP;\n }\n }\n}\n\nObject.assign(BoxConnector.prototype, {\n /**\n * The background image, saved and redrawn on each movement\n * @name module:boxes/BoxConnector.BoxConnector#bgImg\n * @type {external:HTMLImageElement} */\n bgImg: null,\n /**\n * The rectangle of {@link module:Activity.ActivityPanel ActivityPanel} saved in `bgImg`\n * @name module:boxes/BoxConnector.BoxConnector#bgRect\n * @type {module:AWT.Rectangle} */\n bgRect: null,\n /**\n * Initial position of the connector\n * @name module:boxes/BoxConnector.BoxConnector#origin\n * @type {module:AWT.Point} */\n origin: null,\n /**\n * Current (while moving) and final position of the connector\n * @name module:boxes/BoxConnector.BoxConnector#dest\n * @type {module:AWT.Point} */\n dest: null,\n /**\n * When `true`, the connector must end on arrowhead\n * @name module:boxes/BoxConnector.BoxConnector#arrow\n * @type {boolean} */\n arrow: false,\n /**\n * `true` while the connector is active\n * @name module:boxes/BoxConnector.BoxConnector#active\n * @type {boolean} */\n active: false,\n /**\n * `true` while the line has already been painted (used for XOR expressions)\n * @name module:boxes/BoxConnector.BoxConnector#linePainted\n * @type {boolean} */\n linePainted: false,\n /**\n * The arrowhead length (in pixels)\n * @name module:boxes/BoxConnector.BoxConnector#arrowLength\n * @type {number} */\n arrowLength: 10,\n /**\n * The arrowhead angle\n * @name module:boxes/BoxConnector.BoxConnector#arrowAngle\n * @type {number} */\n arrowAngle: Math.PI / 6,\n /**\n * The main color used in XOR operations\n * @name module:boxes/BoxConnector.BoxConnector#lineColor\n * @type {string} */\n lineColor: 'black',\n /**\n * The complementary color used in XOR operations\n * @name module:boxes/BoxConnector.BoxConnector#xorColor\n * @type {string} */\n xorColor: 'white',\n /**\n * The global composite operator used when drawing in XOR mode. Default is \"difference\".\n * For a list of possible values see:\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation}\n * @name module:boxes/BoxConnector.BoxConnector#compositeOp\n * @type {string} */\n compositeOp: 'difference',\n /**\n * The default {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation composite operator}\n * (\"source-over\").\n * @name module:boxes/BoxConnector.BoxConnector#DEFAULT_COMPOSITE_OP\n * @static\n * @type {string} */\n DEFAULT_COMPOSITE_OP: DEFAULT_COMPOSITE_OP,\n /**\n * Relative position of point B regarding A\n * @name module:boxes/BoxConnector.BoxConnector#relativePos\n * @type {module:AWT.Point} */\n relativePos: null,\n /**\n * The ActiveBox to connect or move\n * @name module:boxes/BoxConnector.BoxConnector#bx\n * @type {module:boxes/ActiveBox.ActiveBox} */\n bx: null,\n /**\n * The Graphics context where the BoxConnector will paint\n * @name module:boxes/BoxConnector.BoxConnector#ctx\n * @type {external:CanvasRenderingContext2D} */\n ctx: null,\n /**\n * The dimension of the HTML canvas where to draw\n * @name module:boxes/BoxConnector.BoxConnector#dim\n * @type {module:AWT.Dimension} */\n dim: null,\n /**\n * The container to which this connector belongs\n * @name module:boxes/BoxConnector.BoxConnector#parent\n * @type {module:AWT.Container} */\n parent: null,\n /**\n * Width of the connector line\n * @name module:boxes/BoxConnector.BoxConnector#lineWidth\n * @type {number} */\n lineWidth: 1.5,\n});\n\nexport default BoxConnector;\n"],"names":[],"sourceRoot":""}
@@ -1,294 +0,0 @@
1
- "use strict";
2
- exports.id = 6565;
3
- exports.ids = [6565];
4
- exports.modules = {
5
-
6
- /***/ 6565:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
11
- /* harmony export */ });
12
- /* unused harmony export SCORM */
13
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7750);
14
- /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1253);
16
- /**
17
- * File : report/SCORM.js
18
- * Created : 18/07/2016
19
- * By : Francesc Busquets <francesc@gmail.com>
20
- *
21
- * JClic.js
22
- * An HTML5 player of JClic activities
23
- * https://projectestac.github.io/jclic.js
24
- *
25
- * @source https://github.com/projectestac/jclic.js
26
- *
27
- * @license EUPL-1.2
28
- * @licstart
29
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
30
- *
31
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
32
- * the European Commission- subsequent versions of the EUPL (the "Licence");
33
- * You may not use this work except in compliance with the Licence.
34
- *
35
- * You may obtain a copy of the Licence at:
36
- * https://joinup.ec.europa.eu/software/page/eupl
37
- *
38
- * Unless required by applicable law or agreed to in writing, software
39
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
40
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
41
- * Licence for the specific language governing permissions and limitations
42
- * under the Licence.
43
- * @licend
44
- * @module
45
- */
46
-
47
- /* global window */
48
-
49
-
50
-
51
-
52
- /**
53
- * This class detects if JClic.js is running in an SCORM environment and, if true,
54
- * exposes the methods needed to notify the results of activities.
55
- * Both SCORM 1.2 and 2004 are supported.
56
- */
57
- class SCORM {
58
- /**
59
- * SCORM constructor
60
- * @param {object} API - The global SCORM API object
61
- * @param {module:report/Reporter.Reporter} reporter - The {@link module:Reporter.Reporter Reporter} associated to this SCORM object
62
- */
63
- constructor(API, reporter) {
64
- this.API = API;
65
- // Check if 'API' has a function named 'Initialized'
66
- if (typeof API.Initialize === 'function')
67
- this.is2004 = true;
68
- else {
69
- // SCORM 1.2
70
- this.prefix = 'LMS';
71
- this.core = 'cmi.core.';
72
- }
73
- this.reporter = reporter;
74
- }
75
-
76
- /**
77
- * Recursive function used to find the SCORM "API" object
78
- * @param {object} win - The 'window' object to scan for global SCORM API objects
79
- * @param {number} tries - Recursive attempts currently achieved
80
- * @returns {object} - The global SCORM API object, or `null` if not found
81
- */
82
- static scanForAPI(win, tries) {
83
- if (win.API_1484_11 && win.API_1184_11.Initialize && win.API_1184_11.SetValue && win.API_1184_11.Commit)
84
- return win.API_1184_11;
85
- else if (win.API && win.API.LMSInitialize && win.API.LMSSetValue && win.API.LMSCommit)
86
- return win.API;
87
- else if (win.parent && win.parent !== win && tries++ < SCORM.DISCOVER_MAX_TRIES)
88
- return SCORM.scanForAPI(win.parent, tries);
89
- else
90
- return null;
91
- }
92
-
93
- /**
94
- * Checks for the presence of a SCORM API on the current browser session.
95
- * @param {module:report/Reporter.Reporter} reporter - The {@link module:Reporter.Reporter Reporter} linked to the requested SCORM object
96
- * @returns {module:report/SCORM.SCORM} - A valid SCORM object, or `null` if no SCORM API was found.
97
- */
98
- static getSCORM(reporter) {
99
- let result = null;
100
- try {
101
- let api = SCORM.scanForAPI(window, 0);
102
- if (api === null && window.opener)
103
- api = SCORM.scanForAPI(window.opener, 0);
104
-
105
- if (api) {
106
- result = new SCORM(api, reporter);
107
- if (!result.initialize())
108
- result = null;
109
- }
110
- } catch (ex) {
111
- result = null;
112
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('warn', 'Unable to use SCORM: %s', ex.toString());
113
- }
114
- return result;
115
- }
116
-
117
- /**
118
- * Initializes communication with the SCORM API
119
- * @returns {boolean}
120
- */
121
- initialize() {
122
- let result = false;
123
- try {
124
- result = this.API[this.prefix + 'Initialize']('');
125
- if (result) {
126
- this.studentId = this.getValue(this.core + (this.is2004 ? 'learner_id' : 'student_id'));
127
- this.studentName = this.getValue(this.core + (this.is2004 ? 'learner_name' : 'student_name'));
128
- this.setValue(this.core + 'score.min', 0);
129
- this.setValue(this.core + 'score.max', 100);
130
- jquery__WEBPACK_IMPORTED_MODULE_0___default()(window).on('unload', () => {
131
- this.commitInfo();
132
- this.terminate();
133
- this.API = null;
134
- });
135
- }
136
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('debug', 'SCORM initialized');
137
- } catch (ex) {
138
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('error', `Error initializing SCORM API: ${ex.message}`);
139
- }
140
- return result;
141
- }
142
-
143
- /**
144
- * Terminates communication with the SCORM API
145
- * @returns {boolean}
146
- */
147
- terminate() {
148
- let result = false;
149
- try {
150
- result = this.API[this.is2004 ? 'Terminate' : 'LMSFinish']('');
151
- } catch (ex) {
152
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('error', `Error terminating SCORM API: ${ex.message}`);
153
- }
154
- return result;
155
- }
156
-
157
- /**
158
- * Commits the current information to the SCORM API
159
- */
160
- commitInfo() {
161
- const
162
- info = this.reporter.getInfo(),
163
- score = Math.round(info.globalScore * 100),
164
- time = this.getTimeExpression(info.tTime);
165
-
166
- this.setValue(this.core + 'score.raw', score);
167
- this.setValue(this.core + 'session_time', time);
168
- this.commit();
169
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('debug', `SCORM results reported: ${score} (${time})`);
170
- }
171
-
172
- /**
173
- * Commits current pending data to the SCORM API
174
- * @returns {boolean}
175
- */
176
- commit() {
177
- let result = false;
178
- try {
179
- result = this.API[this.prefix + 'Commit']('');
180
- } catch (ex) {
181
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('error', `Error commiting data to the SCORM API: ${ex.message}`);
182
- }
183
- return result;
184
- }
185
-
186
- /**
187
- * Sends a specific value to the SCORM API
188
- * @param {string} key - A SCORM valid key
189
- * @param {string|number} value - The value associated with this key
190
- * @returns {string}
191
- */
192
- setValue(key, value) {
193
- let result = false;
194
- try {
195
- result = this.API[this.prefix + 'SetValue'](key, value);
196
- } catch (ex) {
197
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('error', `Error setting value "${value}" to "${key}" in SCORM API: ${ex.message}`);
198
- }
199
- return result;
200
- }
201
-
202
- /**
203
- * Gets a specific value from the SCORM API
204
- * @param {string} key - A SCORM valid key
205
- * @returns {string} - The value associated with the provided key, or `null` if not found
206
- */
207
- getValue(key) {
208
- let result = false;
209
- try {
210
- result = this.API[this.prefix + 'GetValue'](key);
211
- } catch (ex) {
212
- (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__/* .log */ .Rm)('error', `Error retrieving "${key}" from SCORM API: ${ex.message}`);
213
- }
214
- return result;
215
- }
216
-
217
- /**
218
- * Gets a string expression of the given time (in milliseconds) suitable for a SCORM transaction.
219
- * @see {@link http://www.ostyn.com/standards/scorm/samples/ISOTimeForSCORM.htm}
220
- * @param {number} millis - The amount of time, in milliseconds
221
- * @returns {string} - An ISO8601 valid expression
222
- */
223
- getTimeExpression(millis) {
224
- const
225
- d = new Date(millis),
226
- h = d.getUTCHours(),
227
- m = d.getUTCMinutes(),
228
- s = d.getUTCSeconds();
229
-
230
- return this.is2004 ?
231
- `PT${h}H${m}M${s}S` :
232
- `${('0000' + h).slice(-4)}:${('00' + m).slice(-2)}:${('00' + s).slice(-2)}`;
233
- }
234
-
235
- /**
236
- * Gets the SCORM type of this SCORM object
237
- * @returns {string}
238
- */
239
- getScormType() {
240
- return `SCORM ${this.is2004 ? '2004' : '1.2'}`;
241
- }
242
- }
243
-
244
- Object.assign(SCORM.prototype, {
245
- /**
246
- * True when the API is of type SCORM 2004, false for SCORM 1.2
247
- * @name module:report/SCORM.SCORM#is2004
248
- * @type {boolean} */
249
- is2004: false,
250
- /**
251
- * The Reporter associated to this SCORM object
252
- * @name module:report/SCORM.SCORM#reporter
253
- * @type {module:report/Reporter.Reporter} */
254
- reporter: null,
255
- /**
256
- * Prefix to be used in SCORM function names. Should be 'LMS' for SCORM 1.2
257
- * @name module:report/SCORM.SCORM#prefix
258
- * @type {string} */
259
- prefix: '',
260
- /**
261
- * Prefix used in core SCORM keys. Should be 'cmi.core.' for 1.2 and 'cmi.' for 2004
262
- * @name module:report/SCORM.SCORM#core
263
- * @type {string} */
264
- core: 'cmi.',
265
- /**
266
- * SCORM API object used to communicate with the LMS
267
- * @name module:report/SCORM.SCORM#API
268
- * @type {object} */
269
- API: null,
270
- /**
271
- * The student ID retrieved from the SCORM API
272
- * @name module:report/SCORM.SCORM#studentId
273
- * @type {string} */
274
- studentId: '',
275
- /**
276
- * The student name retrieved from the SCORM API
277
- * @name module:report/SCORM.SCORM#studentName
278
- * @type {string} */
279
- studentName: '',
280
- });
281
-
282
- /**
283
- * Maximum recursive attempts allowed to find the global SCORM API object
284
- * @type {number} */
285
- SCORM.DISCOVER_MAX_TRIES = 50;
286
-
287
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SCORM);
288
-
289
-
290
- /***/ })
291
-
292
- };
293
- ;
294
- //# sourceMappingURL=6565.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"6565.jclic-node.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEuB;AACW;;AAElC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,iCAAiC,gBAAgB,yCAAyC;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iCAAiC,gBAAgB,yCAAyC;AACvG,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM,wDAAG;AACT;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6CAAC;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,MAAM,wDAAG;AACT,MAAM;AACN,MAAM,wDAAG,2CAA2C,WAAW;AAC/D;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,wDAAG,0CAA0C,WAAW;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,wDAAG,qCAAqC,OAAO,GAAG,KAAK;AAC3D;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,wDAAG,oDAAoD,WAAW;AACxE;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,wDAAG,kCAAkC,MAAM,QAAQ,IAAI,kBAAkB,WAAW;AAC1F;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,wDAAG,+BAA+B,IAAI,oBAAoB,WAAW;AAC3E;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE;AACvB,SAAS,uBAAuB,GAAG,qBAAqB,GAAG,qBAAqB;AAChF;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,iCAAiC;AAC7C;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED;AACA;AACA,UAAU,QAAQ;AAClB;;AAEA,iEAAe,KAAK,EAAC","sources":["webpack://jclic/./src/report/SCORM.js"],"sourcesContent":["/**\n * File : report/SCORM.js\n * Created : 18/07/2016\n * By : Francesc Busquets <francesc@gmail.com>\n *\n * JClic.js\n * An HTML5 player of JClic activities\n * https://projectestac.github.io/jclic.js\n *\n * @source https://github.com/projectestac/jclic.js\n *\n * @license EUPL-1.2\n * @licstart\n * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)\n *\n * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by\n * the European Commission- subsequent versions of the EUPL (the \"Licence\");\n * You may not use this work except in compliance with the Licence.\n *\n * You may obtain a copy of the Licence at:\n * https://joinup.ec.europa.eu/software/page/eupl\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the Licence is distributed on an \"AS IS\" basis, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * Licence for the specific language governing permissions and limitations\n * under the Licence.\n * @licend\n * @module\n */\n\n/* global window */\n\nimport $ from 'jquery';\nimport { log } from '../Utils.js';\n\n/**\n * This class detects if JClic.js is running in an SCORM environment and, if true,\n * exposes the methods needed to notify the results of activities.\n * Both SCORM 1.2 and 2004 are supported.\n */\nexport class SCORM {\n /**\n * SCORM constructor\n * @param {object} API - The global SCORM API object\n * @param {module:report/Reporter.Reporter} reporter - The {@link module:Reporter.Reporter Reporter} associated to this SCORM object\n */\n constructor(API, reporter) {\n this.API = API;\n // Check if 'API' has a function named 'Initialized'\n if (typeof API.Initialize === 'function')\n this.is2004 = true;\n else {\n // SCORM 1.2\n this.prefix = 'LMS';\n this.core = 'cmi.core.';\n }\n this.reporter = reporter;\n }\n\n /**\n * Recursive function used to find the SCORM \"API\" object\n * @param {object} win - The 'window' object to scan for global SCORM API objects\n * @param {number} tries - Recursive attempts currently achieved\n * @returns {object} - The global SCORM API object, or `null` if not found\n */\n static scanForAPI(win, tries) {\n if (win.API_1484_11 && win.API_1184_11.Initialize && win.API_1184_11.SetValue && win.API_1184_11.Commit)\n return win.API_1184_11;\n else if (win.API && win.API.LMSInitialize && win.API.LMSSetValue && win.API.LMSCommit)\n return win.API;\n else if (win.parent && win.parent !== win && tries++ < SCORM.DISCOVER_MAX_TRIES)\n return SCORM.scanForAPI(win.parent, tries);\n else\n return null;\n }\n\n /**\n * Checks for the presence of a SCORM API on the current browser session.\n * @param {module:report/Reporter.Reporter} reporter - The {@link module:Reporter.Reporter Reporter} linked to the requested SCORM object\n * @returns {module:report/SCORM.SCORM} - A valid SCORM object, or `null` if no SCORM API was found.\n */\n static getSCORM(reporter) {\n let result = null;\n try {\n let api = SCORM.scanForAPI(window, 0);\n if (api === null && window.opener)\n api = SCORM.scanForAPI(window.opener, 0);\n\n if (api) {\n result = new SCORM(api, reporter);\n if (!result.initialize())\n result = null;\n }\n } catch (ex) {\n result = null;\n log('warn', 'Unable to use SCORM: %s', ex.toString());\n }\n return result;\n }\n\n /**\n * Initializes communication with the SCORM API\n * @returns {boolean}\n */\n initialize() {\n let result = false;\n try {\n result = this.API[this.prefix + 'Initialize']('');\n if (result) {\n this.studentId = this.getValue(this.core + (this.is2004 ? 'learner_id' : 'student_id'));\n this.studentName = this.getValue(this.core + (this.is2004 ? 'learner_name' : 'student_name'));\n this.setValue(this.core + 'score.min', 0);\n this.setValue(this.core + 'score.max', 100);\n $(window).on('unload', () => {\n this.commitInfo();\n this.terminate();\n this.API = null;\n });\n }\n log('debug', 'SCORM initialized');\n } catch (ex) {\n log('error', `Error initializing SCORM API: ${ex.message}`);\n }\n return result;\n }\n\n /**\n * Terminates communication with the SCORM API\n * @returns {boolean}\n */\n terminate() {\n let result = false;\n try {\n result = this.API[this.is2004 ? 'Terminate' : 'LMSFinish']('');\n } catch (ex) {\n log('error', `Error terminating SCORM API: ${ex.message}`);\n }\n return result;\n }\n\n /**\n * Commits the current information to the SCORM API\n */\n commitInfo() {\n const\n info = this.reporter.getInfo(),\n score = Math.round(info.globalScore * 100),\n time = this.getTimeExpression(info.tTime);\n\n this.setValue(this.core + 'score.raw', score);\n this.setValue(this.core + 'session_time', time);\n this.commit();\n log('debug', `SCORM results reported: ${score} (${time})`);\n }\n\n /**\n * Commits current pending data to the SCORM API\n * @returns {boolean}\n */\n commit() {\n let result = false;\n try {\n result = this.API[this.prefix + 'Commit']('');\n } catch (ex) {\n log('error', `Error commiting data to the SCORM API: ${ex.message}`);\n }\n return result;\n }\n\n /**\n * Sends a specific value to the SCORM API\n * @param {string} key - A SCORM valid key\n * @param {string|number} value - The value associated with this key\n * @returns {string}\n */\n setValue(key, value) {\n let result = false;\n try {\n result = this.API[this.prefix + 'SetValue'](key, value);\n } catch (ex) {\n log('error', `Error setting value \"${value}\" to \"${key}\" in SCORM API: ${ex.message}`);\n }\n return result;\n }\n\n /**\n * Gets a specific value from the SCORM API\n * @param {string} key - A SCORM valid key\n * @returns {string} - The value associated with the provided key, or `null` if not found\n */\n getValue(key) {\n let result = false;\n try {\n result = this.API[this.prefix + 'GetValue'](key);\n } catch (ex) {\n log('error', `Error retrieving \"${key}\" from SCORM API: ${ex.message}`);\n }\n return result;\n }\n\n /**\n * Gets a string expression of the given time (in milliseconds) suitable for a SCORM transaction.\n * @see {@link http://www.ostyn.com/standards/scorm/samples/ISOTimeForSCORM.htm}\n * @param {number} millis - The amount of time, in milliseconds\n * @returns {string} - An ISO8601 valid expression\n */\n getTimeExpression(millis) {\n const\n d = new Date(millis),\n h = d.getUTCHours(),\n m = d.getUTCMinutes(),\n s = d.getUTCSeconds();\n\n return this.is2004 ?\n `PT${h}H${m}M${s}S` :\n `${('0000' + h).slice(-4)}:${('00' + m).slice(-2)}:${('00' + s).slice(-2)}`;\n }\n\n /**\n * Gets the SCORM type of this SCORM object\n * @returns {string}\n */\n getScormType() {\n return `SCORM ${this.is2004 ? '2004' : '1.2'}`;\n }\n}\n\nObject.assign(SCORM.prototype, {\n /**\n * True when the API is of type SCORM 2004, false for SCORM 1.2\n * @name module:report/SCORM.SCORM#is2004\n * @type {boolean} */\n is2004: false,\n /**\n * The Reporter associated to this SCORM object\n * @name module:report/SCORM.SCORM#reporter\n * @type {module:report/Reporter.Reporter} */\n reporter: null,\n /**\n * Prefix to be used in SCORM function names. Should be 'LMS' for SCORM 1.2\n * @name module:report/SCORM.SCORM#prefix\n * @type {string} */\n prefix: '',\n /**\n * Prefix used in core SCORM keys. Should be 'cmi.core.' for 1.2 and 'cmi.' for 2004\n * @name module:report/SCORM.SCORM#core\n * @type {string} */\n core: 'cmi.',\n /**\n * SCORM API object used to communicate with the LMS\n * @name module:report/SCORM.SCORM#API\n * @type {object} */\n API: null,\n /**\n * The student ID retrieved from the SCORM API\n * @name module:report/SCORM.SCORM#studentId\n * @type {string} */\n studentId: '',\n /**\n * The student name retrieved from the SCORM API\n * @name module:report/SCORM.SCORM#studentName\n * @type {string} */\n studentName: '',\n});\n\n/**\n * Maximum recursive attempts allowed to find the global SCORM API object\n * @type {number} */\nSCORM.DISCOVER_MAX_TRIES = 50;\n\nexport default SCORM;\n"],"names":[],"sourceRoot":""}