jclic 2.1.21 → 2.1.23

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 (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/jclic-node.js +9 -8
  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 +4 -4
  7. package/src/GlobalData.js +1 -1
  8. package/src/JClicPlayer.js +2 -2
  9. package/src/bags/MediaBag.js +6 -5
  10. package/dist/1078.jclic-node.js +0 -282
  11. package/dist/1078.jclic-node.js.map +0 -1
  12. package/dist/1196.jclic-node.js +0 -808
  13. package/dist/1196.jclic-node.js.map +0 -1
  14. package/dist/1253.jclic-node.js +0 -1432
  15. package/dist/1253.jclic-node.js.map +0 -1
  16. package/dist/13.jclic-node.js +0 -103
  17. package/dist/13.jclic-node.js.map +0 -1
  18. package/dist/1567.jclic-node.js +0 -2313
  19. package/dist/1567.jclic-node.js.map +0 -1
  20. package/dist/1588.jclic-node.js +0 -602
  21. package/dist/1588.jclic-node.js.map +0 -1
  22. package/dist/1725.jclic-node.js +0 -836
  23. package/dist/1725.jclic-node.js.map +0 -1
  24. package/dist/1731.jclic-node.js +0 -438
  25. package/dist/1731.jclic-node.js.map +0 -1
  26. package/dist/1842.jclic-node.js +0 -651
  27. package/dist/1842.jclic-node.js.map +0 -1
  28. package/dist/2160.jclic-node.js +0 -1016
  29. package/dist/2160.jclic-node.js.map +0 -1
  30. package/dist/222.jclic-node.js +0 -129
  31. package/dist/222.jclic-node.js.map +0 -1
  32. package/dist/2316.jclic-node.js +0 -949
  33. package/dist/2316.jclic-node.js.map +0 -1
  34. package/dist/2355.jclic-node.js +0 -371
  35. package/dist/2355.jclic-node.js.map +0 -1
  36. package/dist/2366.jclic-node.js +0 -431
  37. package/dist/2366.jclic-node.js.map +0 -1
  38. package/dist/2379.jclic-node.js +0 -202
  39. package/dist/2379.jclic-node.js.map +0 -1
  40. package/dist/2437.jclic-node.js +0 -450
  41. package/dist/2437.jclic-node.js.map +0 -1
  42. package/dist/2531.jclic-node.js +0 -869
  43. package/dist/2531.jclic-node.js.map +0 -1
  44. package/dist/2608.jclic-node.js +0 -160
  45. package/dist/2608.jclic-node.js.map +0 -1
  46. package/dist/2715.jclic-node.js +0 -554
  47. package/dist/2715.jclic-node.js.map +0 -1
  48. package/dist/277.jclic-node.js +0 -22
  49. package/dist/277.jclic-node.js.map +0 -1
  50. package/dist/2921.jclic-node.js +0 -660
  51. package/dist/2921.jclic-node.js.map +0 -1
  52. package/dist/2952.jclic-node.js +0 -101
  53. package/dist/2952.jclic-node.js.map +0 -1
  54. package/dist/3018.jclic-node.js +0 -421
  55. package/dist/3018.jclic-node.js.map +0 -1
  56. package/dist/3019.jclic-node.js +0 -682
  57. package/dist/3019.jclic-node.js.map +0 -1
  58. package/dist/3231.jclic-node.js +0 -274
  59. package/dist/3231.jclic-node.js.map +0 -1
  60. package/dist/331.jclic-node.js +0 -115
  61. package/dist/331.jclic-node.js.map +0 -1
  62. package/dist/3391.jclic-node.js +0 -276
  63. package/dist/3391.jclic-node.js.map +0 -1
  64. package/dist/3502.jclic-node.js +0 -671
  65. package/dist/3502.jclic-node.js.map +0 -1
  66. package/dist/3653.jclic-node.js +0 -982
  67. package/dist/3653.jclic-node.js.map +0 -1
  68. package/dist/371.jclic.min.js +0 -2
  69. package/dist/371.jclic.min.js.map +0 -1
  70. package/dist/3856.jclic-node.js +0 -575
  71. package/dist/3856.jclic-node.js.map +0 -1
  72. package/dist/4112.jclic-node.js +0 -659
  73. package/dist/4112.jclic-node.js.map +0 -1
  74. package/dist/4123.jclic-node.js +0 -910
  75. package/dist/4123.jclic-node.js.map +0 -1
  76. package/dist/427.jclic-node.js +0 -894
  77. package/dist/427.jclic-node.js.map +0 -1
  78. package/dist/4483.jclic-node.js +0 -327
  79. package/dist/4483.jclic-node.js.map +0 -1
  80. package/dist/4548.jclic-node.js +0 -1078
  81. package/dist/4548.jclic-node.js.map +0 -1
  82. package/dist/466.jclic-node.js +0 -99
  83. package/dist/466.jclic-node.js.map +0 -1
  84. package/dist/485.jclic-node.js +0 -783
  85. package/dist/485.jclic-node.js.map +0 -1
  86. package/dist/4921.jclic-node.js +0 -500
  87. package/dist/4921.jclic-node.js.map +0 -1
  88. package/dist/5091.jclic-node.js +0 -239
  89. package/dist/5091.jclic-node.js.map +0 -1
  90. package/dist/520.jclic-node.js +0 -550
  91. package/dist/520.jclic-node.js.map +0 -1
  92. package/dist/5312.jclic-node.js +0 -1126
  93. package/dist/5312.jclic-node.js.map +0 -1
  94. package/dist/5338.jclic-node.js +0 -212
  95. package/dist/5338.jclic-node.js.map +0 -1
  96. package/dist/5344.jclic-node.js +0 -229
  97. package/dist/5344.jclic-node.js.map +0 -1
  98. package/dist/5550.jclic-node.js +0 -238
  99. package/dist/5550.jclic-node.js.map +0 -1
  100. package/dist/5626.jclic-node.js +0 -614
  101. package/dist/5626.jclic-node.js.map +0 -1
  102. package/dist/5977.jclic-node.js +0 -1081
  103. package/dist/5977.jclic-node.js.map +0 -1
  104. package/dist/6148.jclic-node.js +0 -345
  105. package/dist/6148.jclic-node.js.map +0 -1
  106. package/dist/6176.jclic-node.js +0 -481
  107. package/dist/6176.jclic-node.js.map +0 -1
  108. package/dist/6221.jclic-node.js +0 -1072
  109. package/dist/6221.jclic-node.js.map +0 -1
  110. package/dist/6238.jclic-node.js +0 -718
  111. package/dist/6238.jclic-node.js.map +0 -1
  112. package/dist/6454.jclic-node.js +0 -1413
  113. package/dist/6454.jclic-node.js.map +0 -1
  114. package/dist/6565.jclic-node.js +0 -294
  115. package/dist/6565.jclic-node.js.map +0 -1
  116. package/dist/6579.jclic-node.js +0 -719
  117. package/dist/6579.jclic-node.js.map +0 -1
  118. package/dist/6715.jclic-node.js +0 -148
  119. package/dist/6715.jclic-node.js.map +0 -1
  120. package/dist/6777.jclic-node.js +0 -171
  121. package/dist/6777.jclic-node.js.map +0 -1
  122. package/dist/6782.jclic-node.js +0 -1611
  123. package/dist/6782.jclic-node.js.map +0 -1
  124. package/dist/6847.jclic-node.js +0 -601
  125. package/dist/6847.jclic-node.js.map +0 -1
  126. package/dist/6856.jclic-node.js +0 -252
  127. package/dist/6856.jclic-node.js.map +0 -1
  128. package/dist/696.jclic-node.js +0 -1821
  129. package/dist/696.jclic-node.js.map +0 -1
  130. package/dist/698.jclic-node.js +0 -583
  131. package/dist/698.jclic-node.js.map +0 -1
  132. package/dist/704.jclic-node.js +0 -80
  133. package/dist/704.jclic-node.js.map +0 -1
  134. package/dist/7046.jclic-node.js +0 -735
  135. package/dist/7046.jclic-node.js.map +0 -1
  136. package/dist/7220.jclic-node.js +0 -156
  137. package/dist/7220.jclic-node.js.map +0 -1
  138. package/dist/7257.jclic-node.js +0 -931
  139. package/dist/7257.jclic-node.js.map +0 -1
  140. package/dist/743.jclic-node.js +0 -583
  141. package/dist/743.jclic-node.js.map +0 -1
  142. package/dist/757.jclic-node.js +0 -1072
  143. package/dist/757.jclic-node.js.map +0 -1
  144. package/dist/7781.jclic-node.js +0 -202
  145. package/dist/7781.jclic-node.js.map +0 -1
  146. package/dist/7912.jclic-node.js +0 -2103
  147. package/dist/7912.jclic-node.js.map +0 -1
  148. package/dist/827.jclic-node.js +0 -708
  149. package/dist/827.jclic-node.js.map +0 -1
  150. package/dist/8276.jclic-node.js +0 -409
  151. package/dist/8276.jclic-node.js.map +0 -1
  152. package/dist/8322.jclic-node.js +0 -498
  153. package/dist/8322.jclic-node.js.map +0 -1
  154. package/dist/8641.jclic-node.js +0 -360
  155. package/dist/8641.jclic-node.js.map +0 -1
  156. package/dist/8837.jclic-node.js +0 -651
  157. package/dist/8837.jclic-node.js.map +0 -1
  158. package/dist/8895.jclic-node.js +0 -151
  159. package/dist/8895.jclic-node.js.map +0 -1
  160. package/dist/9072.jclic-node.js +0 -1285
  161. package/dist/9072.jclic-node.js.map +0 -1
  162. package/dist/9078.jclic-node.js +0 -935
  163. package/dist/9078.jclic-node.js.map +0 -1
  164. package/dist/9103.jclic-node.js +0 -718
  165. package/dist/9103.jclic-node.js.map +0 -1
  166. package/dist/9359.jclic-node.js +0 -145
  167. package/dist/9359.jclic-node.js.map +0 -1
  168. package/dist/9409.jclic-node.js +0 -921
  169. package/dist/9409.jclic-node.js.map +0 -1
  170. package/dist/9513.jclic-node.js +0 -720
  171. package/dist/9513.jclic-node.js.map +0 -1
  172. package/dist/9704.jclic-node.js +0 -81
  173. package/dist/9704.jclic-node.js.map +0 -1
  174. package/dist/9950.jclic-node.js +0 -827
  175. package/dist/9950.jclic-node.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"2316.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;;AAEuB;AACc;AAC8B;AACN;AACxB;;AAErC;AACA;AACA,IAAI,4DAA4D;AAChE,IAAI,0FAA0F;AAC9F;AACA;AACO;AACP;AACA;AACA,aAAa,0CAA0C;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,oEAAoE,mEAAuB,iBAAiB,6CAAC;AAC7G;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA,8CAA8C,mEAAuB;AACrE;AACA;;AAEA;AACA;AACA,aAAa,6DAA6D;AAC1E,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,6DAA6D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,6DAA6D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,6DAA6D;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ,iCAAiC,wFAAwF;AAChJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA,aAAa,iCAAiC;AAC9C;AACA,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oDAAQ;AAC7B,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,2FAA2F;AAChH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,6DAA6D;AAC5E;AACA;AACA;AACA;AACA,sBAAsB,6CAA6C;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA,gBAAgB,mEAAuB;AACvC;AACA,wBAAwB,gEAAoB;AAC5C,yBAAyB,gEAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,2FAA2F;AACrH;AACA,YAAY,+DAA+D;AAC3E;AACA;AACA;AACA;AACA,YAAY,0CAA0C;AACtD;AACA;AACA,qBAAqB,2FAA2F;AAChH;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,gBAAgB,EAAC;;;;;;;;;;;;;;;;AC7ThC;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;AACsC;AACO;;AAEpE;AACA;AACA,yCAAyC,sEAAsE;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;;AAEA;AACA,IAAI,gEAAW;AACf;AACA;AACA,wBAAwB,2DAAM;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,sBAAsB,gEAAoB,iBAAiB,6CAAC;AAC5D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;;AAEL;AACA;AACA,wBAAwB,gEAAoB;AAC5C;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,wDAAwD,qEAAqE;AAC7H;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,kBAAkB,yCAAyC;AAC3D;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,uDAAuD;AACnE;AACA;AACA;AACA;AACA,YAAY,uDAAuD;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,uBAAuB,EAAC;;;;;;;;;;;;;;;;;AChKvC;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;AACc;AACsB;AACrB;;AAEtC;AACA,8BAA8B,6CAA6C,gBAAgB,2FAA2F;AACtL;AACA;AACA;AACA,2DAA2D,+EAA+E;AAC1I;AACA;AACA;AACA;AACO,mCAAmC,oDAAQ;AAClD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,+DAAmB,iBAAiB,6CAAC;AAC/D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,+DAAmB;AAC1C,KAAK;;AAEL;AACA;;;AAGA;AACA,oBAAoB,8CAA8C;AAClE;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA;AACA;AACA;AACA,YAAY,qDAAqD;AACjE;AACA,CAAC;;AAED,iEAAe,oBAAoB,EAAC;;;;;;;;;;;;;;AC3IpC;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;;AAEqC;AACU;;AAE/C;AACA,yBAAyB,8CAA8C,YAAY,kFAAkF;AACrK;AACA;AACA;AACA,gCAAgC,8CAA8C;AAC9E;AACA;AACA;AACA,IAAI,kFAAkF;AACtF;AACA;AACO,kCAAkC,oDAAQ;AACjD;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA,aAAa,QAAQ;AACrB;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gDAAgD,4DAAO;AACvD;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,mBAAmB,EAAC;;;;;;;;;;;;;AChHnC;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;;AAEuD;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,SAAS;AACT;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAM;AAC5B;AACA,yBAAyB,2DAAM;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA,WAAW,4DAAO;AAClB;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;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,iEAAe,QAAQ,EAAC","sources":["webpack://jclic/./src/bags/ActivitySequence.js","webpack://jclic/./src/bags/ActivitySequenceElement.js","webpack://jclic/./src/bags/ActivitySequenceJump.js","webpack://jclic/./src/bags/ConditionalJumpInfo.js","webpack://jclic/./src/bags/JumpInfo.js"],"sourcesContent":["/**\n * File : bags/ActivitySequence.js\n * Created : 05/04/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\nimport $ from 'jquery';\nimport JumpInfo from './JumpInfo.js';\nimport ActivitySequenceElement from './ActivitySequenceElement.js';\nimport ActivitySequenceJump from './ActivitySequenceJump.js';\nimport { nSlash } from '../Utils.js';\n\n/**\n * This class stores the definition of the sequence to follow to show the activities of a\n * {@link module:project/JClicProject.JClicProject JClicProject}. The sequence are formed by an ordered list of objects of type\n * {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement}.\n * It stores also a transient pointer to the current sequence element.\n */\nexport class ActivitySequence {\n /**\n * ActivitySequence constructor\n * @param {module:project/JClicProject.JClicProject} project - The JClic project to which this ActivitySequence belongs\n */\n constructor(project) {\n this.project = project;\n this.elements = [];\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n $xml.children('item').each((_i, data) => this.elements.push(new ActivitySequenceElement().setProperties($(data))));\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return this.elements.map(el => el.getAttributes());\n }\n\n /**\n * Loads the object settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n data.forEach(el => this.elements.push(new ActivitySequenceElement().setAttributes(el)));\n return this;\n }\n\n /**\n * Returns the index of the specified element in the sequence.\n * @param {module:bags/ActivitySequenceElement.ActivitySequenceElement} ase - The element to search.\n * @returns {number} - The requested index, or `null` if not found.\n */\n getElementIndex(ase) {\n return ase === null ? -1 : this.elements.indexOf(ase);\n }\n\n /**\n * Returns the nth element of the sequence.\n * @param {number} n - Index of the requested element\n * @param {boolean} updateCurrentAct - when `true`, the `currentAct` index will be updated.\n * @returns {module:bags/ActivitySequenceElement.ActivitySequenceElement} - The requested element, or `null` if out of range.\n */\n getElement(n, updateCurrentAct) {\n let result = null;\n if (n >= 0 && n < this.elements.length) {\n result = this.elements[n];\n if (updateCurrentAct)\n this.currentAct = n;\n }\n return result;\n }\n\n /**\n * Search into the sequence for a element with the provided tag\n * @param {string} tag - The tag to search\n * @param {boolean} updateCurrentAct - when `true`, the `currentAct` index will be updated.\n * @returns {module:bags/ActivitySequenceElement.ActivitySequenceElement} - The requested element, or `null` if not found.\n */\n getElementByTag(tag, updateCurrentAct) {\n let\n result = null,\n resultIndex = -1;\n if (tag) {\n tag = nSlash(tag);\n this.elements.some((el, index) => {\n if (el.tag === tag) {\n result = el;\n resultIndex = index;\n }\n return resultIndex !== -1;\n });\n if (resultIndex !== -1 && updateCurrentAct)\n this.currentAct = resultIndex;\n }\n return result;\n }\n\n /**\n * Gets the sequence element pointed by the `currentAct` member.\n * @returns {module:bags/ActivitySequenceElement.ActivitySequenceElement} - The current sequence element, or `null` if not set.\n */\n getCurrentAct() {\n return this.getElement(this.currentAct, false);\n }\n\n /**\n * Checks if it's possible to go forward from the current position in the sequence.\n * @param {boolean} hasReturn - Indicates whether the history of jumps done since the beginning\n * of the JClic session is empty or not. When not empty, a `RETURN` action is still possible.\n * @returns {boolean} - `true` when the user is allowed to go ahead to a next activity,\n * `false` otherwise. */\n hasNextAct(hasReturn) {\n let result = false;\n const ase = this.getCurrentAct();\n if (ase) {\n if (ase.fwdJump === null)\n result = true;\n else\n switch (ase.fwdJump.action) {\n case 'STOP':\n break;\n case 'RETURN':\n result = hasReturn;\n break;\n default:\n result = true;\n }\n }\n return result;\n }\n\n /**\n * Checks if it's possible to go back from the current position in the sequence.\n * @param {boolean} hasReturn - Indicates whether the history of jumps done since the beginning\n * of the JClic session is empty or not. When not empty, a `RETURN` action is still possible.\n * @returns {boolean} - `true` when the user is allowed to go back to a previous activity,\n * `false` otherwise. */\n hasPrevAct(hasReturn) {\n let result = false;\n const ase = this.getCurrentAct();\n if (ase) {\n if (ase.backJump === null)\n result = true;\n else\n switch (ase.backJump.action) {\n case 'STOP':\n break;\n case 'RETURN':\n result = hasReturn;\n break;\n default:\n result = true;\n }\n }\n return result;\n }\n\n /**\n * Gets the current state for the 'next' and 'prev' buttons.\n * @returns {string} - One of the possible values of {@link module:bags/ActivitySequenceElement.ActivitySequenceElement#navButtons navButtons},\n * thus: `none`, `fwd`, `back` or `both`\n */\n getNavButtonsFlag() {\n let flag = 'none';\n const ase = this.getCurrentAct();\n if (ase)\n flag = ase.navButtons;\n return flag;\n }\n\n /**\n * Computes the jump to perform from the current position on the sequence\n * @param {boolean} back - When `true`, the request is for the 'go back' button. Otherwise, is\n * for the 'next' one.\n * @param {module:report/Reporter.Reporter} reporter - The reporting engine that will provide values about score average\n * and time spend on the activities, used only to compute conditional jumps.\n * @returns {module:bags/JumpInfo.JumpInfo} - The jump info if a valid jump is possible, `null` otherwise.\n */\n getJump(back, reporter) {\n const ase = this.getCurrentAct();\n let result = null;\n if (ase) {\n const asj = back ? ase.backJump : ase.fwdJump;\n if (asj === null) {\n let i = this.currentAct + (back ? -1 : 1);\n if (i >= this.elements.length || i < 0)\n i = 0;\n result = new JumpInfo('JUMP', i);\n } else {\n let\n rating = -1,\n time = -1;\n if (reporter !== null) {\n const seqRegInfo = reporter.getCurrentSequenceInfo();\n if (seqRegInfo !== null) {\n rating = Math.round(seqRegInfo.tScore);\n time = Math.round(seqRegInfo.tTime / 1000);\n }\n }\n result = asj.resolveJump(rating, time);\n }\n }\n return result;\n }\n\n /**\n * Finds the nearest sequence element with a valid 'tag', looking back in the `elements` list.\n * @param {number} num - The point of the sequence from which to start looking back.\n * @returns {string} - The nearest 'tag', or `null` if not found.\n */\n getSequenceForElement(num) {\n let tag = null;\n if (num >= 0 && num < this.elements.length)\n for (let i = num; tag === null && i >= 0; i--) {\n tag = this.getElement(i, false).tag;\n }\n return tag;\n }\n\n /**\n * Gets the first {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} in the `elements` list pointing to the\n * specified activity name.\n * The search is always case-insensitive.\n * @param {string} activity - The name of the activity to search for.\n * @returns {module:bags/ActivitySequenceElement.ActivitySequenceElement} The requested element or `null` if not found.\n */\n getElementByActivityName(activity) {\n let result = null;\n if (activity !== null) {\n for (let i = 0; result === null && i < this.elements.length; i++) {\n const ase = this.getElement(i, false);\n if (ase.activity.toLowerCase() === activity.toLowerCase())\n result = ase;\n }\n }\n return result;\n }\n\n /**\n * Utility function to check if the current sequence element corresponds to the specified\n * activity. If negative, the `currentAct` will be accordingly set.\n * @param {string} activity - The name of the activity to check\n */\n checkCurrentActivity(activity) {\n let ase = this.getCurrentAct();\n if (ase === null || ase.activity.toUpperCase() !== activity.toUpperCase()) {\n for (let i = 0; i < this.elements.length; i++) {\n if (this.getElement(i, false).activity.toUpperCase() === activity.toUpperCase()) {\n this.currentAct = i;\n return false;\n }\n }\n ase = new ActivitySequenceElement();\n ase.activity = activity;\n ase.fwdJump = new ActivitySequenceJump('STOP');\n ase.backJump = new ActivitySequenceJump('STOP');\n this.elements.push(ase);\n this.currentAct = this.elements.length - 1;\n return false;\n }\n return true;\n }\n}\n\nObject.assign(ActivitySequence.prototype, {\n /**\n * The ordered list of {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects\n * @name module:bags/ActivitySequence.ActivitySequence#elements\n * @type {module:bags/ActivitySequenceElement.ActivitySequenceElement[]} */\n elements: null,\n /**\n * The JClic project to which this ActivitySequence belongs.\n * @name module:bags/ActivitySequence.ActivitySequence#project\n * @type {module:project/JClicProject.JClicProject} */\n project: null,\n /**\n * Pointer to the {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} currently running (points inside\n * the `elements` array).\n * @name module:bags/ActivitySequence.ActivitySequence#currentAct\n * @type {number} */\n currentAct: -1,\n});\n\nexport default ActivitySequence;\n","/**\n * File : bags/ActivitySequenceElement.js\n * Created : 05/04/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\nimport $ from 'jquery';\nimport ActivitySequenceJump from './ActivitySequenceJump.js';\nimport { attrForEach, nSlash, getAttr, isEmpty } from '../Utils.js';\n\n/**\n *\n * This class is the basic component of {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence} objects. It represents a specific\n * point in the project's sequence of JClic activities.\n *\n * For each point of the sequence, some options can be set:\n * - What activity must run at this point\n * - What to do or where to jump when the activity finishes\n * - The behavior of the \"next\" button\n * - The behavior of the \"prev\" button\n *\n * Sequence points can also have a \"tag\", used to refer to them with a unique name.\n */\nexport class ActivitySequenceElement {\n constructor() {\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml\n */\n setProperties($xml) {\n\n // Iterate on all provided attributes\n attrForEach($xml.get(0).attributes, (name, val) => {\n switch (name) {\n case 'id':\n this['tag'] = nSlash(val);\n break;\n case 'name':\n this['activity'] = val;\n break;\n case 'description':\n // possible navButtons values are: `none`, `fwd`, `back` or `both`\n case 'navButtons':\n this[name] = val;\n break;\n case 'delay':\n this[name] = Number(val);\n break;\n }\n });\n\n // Iterate on 'jump' elements to load fwdJump and/or backJump\n $xml.children('jump').each((_n, data) => {\n const jmp = new ActivitySequenceJump().setProperties($(data));\n if (jmp.id === 'forward')\n this.fwdJump = jmp;\n else if (jmp.id === 'back')\n this.backJump = jmp;\n });\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return getAttr(this, ['tag', 'description', 'activity', 'fwdJump', 'backJump', 'navButtons', 'delay']);\n }\n\n /**\n * Loads sequence element settings from a data object\n * @param {object} data\n */\n setAttributes(data) {\n ['tag', 'description', 'activity', 'navButtons', 'delay'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n\n ['fwdJump', 'backJump'].forEach(jmp => {\n if (data[jmp]) {\n this[jmp] = new ActivitySequenceJump().setAttributes(data[jmp]);\n }\n });\n return this;\n }\n}\n\nObject.assign(ActivitySequenceElement.prototype, {\n /**\n * Optional unique identifier of this element in the {@link module:bags/ActivitySequence.ActivitySequence ActivitySequence}.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#tag\n * @type {string} */\n tag: null,\n /**\n * Optional description of this sequence element.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#description\n * @type {string} */\n description: null,\n /**\n * Name of the {@link module:Activity.Activity Activity} pointed by this element.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#activity\n * @type {string} */\n activity: '',\n /**\n * Jump to be processed by the 'next' button action\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#fwdJump\n * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */\n fwdJump: null,\n /**\n * Jump to be processed by the 'prev' button action.\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#backJump\n * @type {module:bags/ActivitySequenceJump.ActivitySequenceJump} */\n backJump: null,\n /**\n * What buttons should be active at this point of the sequence. Valid values are:\n * - 'none'\n * - 'fwd'\n * - 'back'\n * - 'both'\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#navButtons\n * @type {string} */\n navButtons: 'both',\n /**\n * Time delay (in seconds) before passing to the next/prev activity\n * @name module:bags/ActivitySequenceElement.ActivitySequenceElement#delay\n * @type {number} */\n delay: 0,\n});\n\nexport default ActivitySequenceElement;\n","/**\n * File : bags/ActivitySequenceJump.js\n * Created : 05/04/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 JumpInfo from './JumpInfo.js';\nimport ConditionalJumpInfo from './ConditionalJumpInfo.js';\nimport { getAttr } from '../Utils.js';\n\n/**\n * This is a special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo}, used only in {@link module:bags/ActivitySequenceElement.ActivitySequenceElement ActivitySequenceElement} objects.\n * Sequence elements can contain up to two ActivitySequenceJump objects: one to be processed\n * when the user clicks on the \"next\" button (or when the activity finishes, if in automatic mode),\n * and the other used with the \"prev\" button. ActivitySequenceJump objects define a default jump\n * or action to be performed, but can also have up to two {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo} objects. These\n * define alternative jumps that are performed only when score or time are below or over a specific\n * threshold.\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ActivitySequenceJump extends JumpInfo {\n /**\n * ActivitySequenceJump constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n super(action, sq);\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element.\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n\n // Read conditional jumps\n $xml.children('jump').each((_n, child) => {\n const condJmp = new ConditionalJumpInfo().setProperties($(child));\n if (condJmp.id === 'upper')\n this.upperJump = condJmp;\n else if (condJmp.id === 'lower')\n this.lowerJump = condJmp;\n });\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return Object.assign(super.getAttributes(), getAttr(this, ['upperJump', 'lowerJump']));\n }\n\n /**\n * Loads the jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n\n ['upperJump', 'lowerJump'].forEach(cj => {\n if (data[cj])\n this[cj] = new ConditionalJumpInfo().setAttributes(data[cj]);\n });\n\n return this;\n }\n\n\n /**\n * Resolves what {@link module:bags/JumpInfo.JumpInfo JumpInfo} must be taken, based on a done time and average rating obtained\n * in activities.\n * @param {number} rating - Average rating obtained by the user in the activities done during the\n * last sequence stretch.\n * @param {number} time - Total time spend doing the activities.\n * @returns {module:bags/JumpInfo.JumpInfo}\n */\n resolveJump(rating, time) {\n let result = this;\n if (rating >= 0 && time >= 0) {\n if (this.upperJump !== null &&\n rating > this.upperJump.threshold &&\n (this.upperJump.time <= 0 || time < this.upperJump.time)) {\n result = this.upperJump;\n } else if (this.lowerJump !== null &&\n (rating < this.lowerJump.threshold ||\n this.lowerJump.time > 0 && time > this.lowerJump.time)) {\n result = this.lowerJump;\n }\n }\n return result;\n }\n}\n\nObject.assign(ActivitySequenceJump.prototype, {\n /**\n * Optional jump to be performed when the results (score and time) are above a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#upperJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n upperJump: null,\n /**\n * Optional jump to be performed when the results (score or time) are below a specific threshold.\n * @name module:bags/ActivitySequenceJump.ActivitySequenceJump#lowerJump\n * @type {module:bags/ConditionalJumpInfo.ConditionalJumpInfo} */\n lowerJump: null,\n});\n\nexport default ActivitySequenceJump;\n","/**\n * File : bags/ConditionalJumpInfo.js\n * Created : 05/04/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 JumpInfo from './JumpInfo.js';\nimport { getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This special case of {@link module:bags/JumpInfo.JumpInfo JumpInfo} is used in {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} objects to decide\n * the type of jump or action to be performed, based on the results obtained by the user when\n * playing previous JClic activities.\n *\n * In addition to the standard {@link module:bags/JumpInfo.JumpInfo JumpInfo} fields and methods, this class has two public\n * members where score and time thresholds are stored.\n *\n * The exact meaning of this members will depend on the type of `ConditionalJumpInfo` in the\n * {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump} (it can be `upperJump` or `lowerJump`).\n * @extends module:bags/JumpInfo.JumpInfo\n */\nexport class ConditionalJumpInfo extends JumpInfo {\n /**\n * ConditionalJumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n * @param {number} [threshold] - Threshold above or below which the action will be triggered,\n * depending on the type of JumpInfo.\n * @param {number} [time] - Delay to be applied in automatic jumps.\n */\n constructor(action, sq, threshold, time) {\n super(action, sq);\n this.threshold = typeof threshold === 'number' ? threshold : -1;\n this.time = typeof threshold === 'number' ? time : -1;\n }\n\n /**\n * Loads this object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n super.setProperties($xml);\n if ($xml.attr('threshold') !== undefined)\n this.threshold = $xml.attr('threshold');\n if ($xml.attr('time') !== undefined)\n this.time = $xml.attr('time');\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return Object.assign(super.getAttributes(), getAttr(this, ['threshold', 'time']));\n }\n\n /**\n * Loads this conditional jump settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n super.setAttributes(data);\n ['threshold', 'time'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(ConditionalJumpInfo.prototype, {\n /**\n * Threshold above or below which the action will be triggered, depending on the type of JumpInfo.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#threshold\n * @type {number} */\n threshold: -1,\n /**\n * Delay to be applied in automatic jumps.\n * @name module:bags/ConditionalJumpInfo.ConditionalJumpInfo#time\n * @type {number} */\n time: -1,\n});\n\nexport default ConditionalJumpInfo;\n","/**\n * File : bags/JumpInfo.js\n * Created : 05/04/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 { nSlash, getAttr, isEmpty } from '../Utils.js';\n\n/**\n * This class contains information about what things JClic sequence manager has to do in certain\n * circumstances, such as:\n * - an activity finishes\n * - the user clicks on the \"next\" or \"prev\" buttons\n * - the user clicks or a cell with special \"active content\"\n *\n * Different kinds of actions are possible for each of these events:\n * - RETURN: to go back to a previous point in the sequence.\n * - EXIT: to exit the program (thus navigating to another URL)\n * - STOP: to do nothing.\n * - JUMP: to jump to a specific point in the sequence of activities, or to another JClic project.\n * @see {@link module:bags/ActivitySequenceJump.ActivitySequenceJump ActivitySequenceJump}\n * @see {@link module:bags/ConditionalJumpInfo.ConditionalJumpInfo ConditionalJumpInfo}\n */\nexport class JumpInfo {\n /**\n * JumpInfo constructor\n * @param {string} action - Must be one of the described actions.\n * @param {number|string} [sq] - Can be the tag of the sequence element to jump to, or its\n * cardinal number in the list.\n */\n constructor(action, sq) {\n this.action = action;\n switch (typeof sq) {\n case 'string':\n this.sequence = sq;\n break;\n case 'number':\n this.actNum = sq;\n break;\n }\n }\n\n /**\n * Loads the object settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element to parse\n */\n setProperties($xml) {\n this.id = $xml.attr('id');\n this.action = $xml.attr('action') || 'JUMP';\n if ($xml.attr('tag'))\n this.sequence = nSlash($xml.attr('tag'));\n if ($xml.attr('project'))\n this.projectPath = nSlash($xml.attr('project'));\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return getAttr(this, ['id', 'action', 'actNum', 'sequence', 'projectPath']);\n }\n\n /**\n * Loads the object settings from a data object\n * @param {object} data - The data object to parse\n */\n setAttributes(data) {\n ['id', 'action', 'actNum', 'sequence', 'projectPath'].forEach(t => {\n if (!isEmpty(data[t]))\n this[t] = data[t];\n });\n return this;\n }\n}\n\nObject.assign(JumpInfo.prototype, {\n /**\n * The JumpInfo identifier\n * - For regular jumps: 'forward', 'back'\n * - For conditional jumps: 'upper', 'lower'\n * @name module:bags/JumpInfo.JumpInfo#id\n * @type {string} */\n id: null,\n /**\n * The current action.\n * Possible values are: `JUMP`, `STOP`, `RETURN` and `EXIT`.\n * @name module:bags/JumpInfo.JumpInfo#action\n * @type {string} */\n action: null,\n /**\n * Activity number in the sequence list\n * @name module:bags/JumpInfo.JumpInfo#actNum\n * @type {number} */\n actNum: -1,\n /**\n * Current sequence tag\n * @name module:bags/JumpInfo.JumpInfo#sequence\n * @type {string} */\n sequence: null,\n /**\n * Path of another JClic project to jump to\n * @name module:bags/JumpInfo.JumpInfo#projectPath\n * @type {string} */\n projectPath: null,\n});\n\nexport default JumpInfo;\n"],"names":[],"sourceRoot":""}
@@ -1,371 +0,0 @@
1
- "use strict";
2
- exports.id = 2355;
3
- exports.ids = [2355];
4
- exports.modules = {
5
-
6
- /***/ 2355:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "default": () => (/* binding */ media_MediaContent)
13
- });
14
-
15
- // UNUSED EXPORTS: MediaContent
16
-
17
- // EXTERNAL MODULE: external "jquery"
18
- var external_jquery_ = __webpack_require__(7750);
19
- var external_jquery_default = /*#__PURE__*/__webpack_require__.n(external_jquery_);
20
- // EXTERNAL MODULE: ./src/AWT.js
21
- var AWT = __webpack_require__(7912);
22
- // EXTERNAL MODULE: ./src/Utils.js
23
- var Utils = __webpack_require__(1253);
24
- ;// ./src/media/icons/generic.svg
25
- const generic_namespaceObject = "<svg height=\"48\" viewBox=\"0 0 48 48\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M28.8 12L28 8H10v34h4V28h11.2l.8 4h14V12z\" />\n</svg>\n";
26
- ;// ./src/media/icons/audio.svg
27
- const audio_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\" />\n</svg>\n";
28
- ;// ./src/media/icons/mic.svg
29
- const mic_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z\" />\n</svg>\n";
30
- ;// ./src/media/icons/movie.svg
31
- const movie_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z\" />\n</svg>\n";
32
- ;// ./src/media/icons/music.svg
33
- const music_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z\" />\n</svg>\n";
34
- ;// ./src/media/icons/url.svg
35
- const url_namespaceObject = "<svg fill=\"#000000\" height=\"48\" viewBox=\"0 0 24 24\" width=\"48\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z\" />\n</svg>\n";
36
- ;// ./src/media/MediaContent.js
37
- /**
38
- * File : media/MediaContent.js
39
- * Created : 13/04/2015
40
- * By : Francesc Busquets <francesc@gmail.com>
41
- *
42
- * JClic.js
43
- * An HTML5 player of JClic activities
44
- * https://projectestac.github.io/jclic.js
45
- *
46
- * @source https://github.com/projectestac/jclic.js
47
- *
48
- * @license EUPL-1.2
49
- * @licstart
50
- * (c) 2000-2020 Educational Telematic Network of Catalonia (XTEC)
51
- *
52
- * Licensed under the EUPL, Version 1.1 or -as soon they will be approved by
53
- * the European Commission- subsequent versions of the EUPL (the "Licence");
54
- * You may not use this work except in compliance with the Licence.
55
- *
56
- * You may obtain a copy of the Licence at:
57
- * https://joinup.ec.europa.eu/software/page/eupl
58
- *
59
- * Unless required by applicable law or agreed to in writing, software
60
- * distributed under the Licence is distributed on an "AS IS" basis, WITHOUT
61
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
62
- * Licence for the specific language governing permissions and limitations
63
- * under the Licence.
64
- * @licend
65
- * @module
66
- */
67
-
68
- /* global Image */
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- /**
82
- * This object contains a description of any multimedia content (sound, video, MIDI, voice
83
- * recording..) or special actions (jump to another point in the sequence, link to an URL, etc.)
84
- * associated to an {@link module:boxes/ActiveBox.ActiveBox ActiveBox} object.
85
- */
86
- class MediaContent {
87
- /**
88
- * MediaContent constructor
89
- * @param {string} type - The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,
90
- * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,
91
- * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`
92
- * @param {string} [file] - Optional parameter indicating the media file name
93
- */
94
- constructor(type, file) {
95
- this.type = type;
96
- if (file)
97
- this.file = file;
98
- }
99
-
100
- /**
101
- * Loads the MediaContent settings from a specific JQuery XML element
102
- * @param {external:jQuery} $xml
103
- */
104
- setProperties($xml) {
105
- (0,Utils/* attrForEach */.GM)($xml.get(0).attributes, (name, val) => {
106
- switch (name) {
107
- case 'type':
108
- this.type = val;
109
- break;
110
- case 'file':
111
- this.file = (0,Utils/* nSlash */.c4)(val);
112
- break;
113
- case 'params':
114
- this.externalParam = (0,Utils/* nSlash */.c4)(val);
115
- break;
116
-
117
- case 'pFrom':
118
- this.absLocationFrom = val;
119
- break;
120
-
121
- case 'buffer':
122
- this.recBuffer = Number(val);
123
- break;
124
- case 'level':
125
- case 'from':
126
- case 'to':
127
- case 'length':
128
- this[name] = Number(val);
129
- break;
130
-
131
- case 'px':
132
- case 'py':
133
- if (this.absLocation === null)
134
- this.absLocation = new AWT/* Point */.bR(0, 0);
135
- if (name === 'px')
136
- this.absLocation.x = Number(val);
137
- else
138
- this.absLocation.y = Number(val);
139
- break;
140
-
141
- case 'stretch':
142
- case 'free':
143
- case 'catchMouseEvents':
144
- case 'loop':
145
- case 'autostart':
146
- this[name] = (0,Utils/* getBoolean */.pW)(val);
147
- break;
148
- }
149
- });
150
- return this;
151
- }
152
-
153
- /**
154
- * Gets a object with the basic attributes needed to rebuild this instance excluding functions,
155
- * parent references, constants and also attributes retaining the default value.
156
- * The resulting object is commonly usued to serialize elements in JSON format.
157
- * @returns {object} - The resulting object, with minimal attrributes
158
- */
159
- getAttributes() {
160
- return (0,Utils/* getAttr */.iu)(this, [
161
- 'type', 'file', 'externalParam',
162
- 'absLocation', // -> AWT.Point
163
- 'absLocationFrom', 'recBuffer',
164
- 'level|1', 'from', 'to', 'length',
165
- 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart'
166
- ]);
167
- }
168
-
169
- /**
170
- * Reads the properties of this MediaContent from a data object
171
- * @param {object} data - The data object to be parsed
172
- * @returns {module:media/MediaContent.MediaContent}
173
- */
174
- setAttributes(data) {
175
- return (0,Utils/* setAttr */.ob)(this, data, [
176
- 'type', 'file', 'externalParam',
177
- { key: 'absLocation', fn: AWT/* Point */.bR },
178
- 'absLocationFrom', 'recBuffer',
179
- 'level', 'from', 'to', 'length',
180
- 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart',
181
- ]);
182
- }
183
-
184
- /**
185
- * Compares this object with another MediaContent.
186
- * @param {module:media/MediaContent.MediaContent} mc - The Media Content to compare against to.
187
- * @returns {boolean} - `true` when both objects are equivalent.
188
- */
189
- isEquivalent(mc) {
190
- return this.type === mc.type &&
191
- (this.file === mc.file ||
192
- this.file !== null && mc.file !== null &&
193
- this.file.toLocaleLowerCase() === mc.file.toLocaleLowerCase()) &&
194
- this.from === mc.from &&
195
- this.to === mc.to &&
196
- this.recBuffer === mc.recBuffer;
197
- }
198
-
199
- /**
200
- * Gets a string representing this media content, useful for checking if two different elements
201
- * are equivalent.
202
- * @returns {string}
203
- */
204
- getDescription() {
205
- let result = `${this.type}`;
206
- if (this.file)
207
- result = `${result} ${this.file}${this.from >= 0 ? ` from:${this.from}` : ''}${this.to >= 0 ? ` to:${this.to}` : ''}`;
208
- else if (this.externalParam)
209
- result = `${result} ${this.externalParam}`;
210
- return result;
211
- }
212
-
213
- /**
214
- * Returns a simplified description of this media content. Useful for accessibility methods.
215
- * @returns {string}
216
- */
217
- toString() {
218
- return `${this.type}${this.file ? ` ${this.file}` : ''}`;
219
- }
220
-
221
- /**
222
- * Returns an image to be used as icon for representing this media content.
223
- * @returns {external:HTMLImageElement}
224
- */
225
- getIcon() {
226
- let icon = null;
227
- switch (this.type) {
228
- case 'PLAY_AUDIO':
229
- case 'PLAY_RECORDED_AUDIO':
230
- icon = 'audio';
231
- break;
232
- case 'RECORD_AUDIO':
233
- icon = 'mic';
234
- break;
235
- case 'PLAY_VIDEO':
236
- icon = 'movie';
237
- break;
238
- case 'PLAY_MIDI':
239
- icon = 'music';
240
- break;
241
- case 'URL':
242
- icon = 'url';
243
- break;
244
- default:
245
- icon = 'generic';
246
- break;
247
- }
248
- return icon ? MediaContent.ICONS[icon] : null;
249
- }
250
- }
251
-
252
- Object.assign(MediaContent.prototype, {
253
- /**
254
- * The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,
255
- * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,
256
- * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`
257
- * @name module:media/MediaContent.MediaContent#type
258
- * @type {string} */
259
- type: 'UNKNOWN',
260
- /**
261
- * The priority level is important when different medias want to play together. Objects with
262
- * highest priority level can mute lower ones.
263
- * @name module:media/MediaContent.MediaContent#level
264
- * @type {number} */
265
- level: 1,
266
- /**
267
- * Media file name
268
- * @name module:media/MediaContent.MediaContent#file
269
- * @type {string} */
270
- file: null,
271
- /**
272
- * Optional parameters passed to external calls
273
- * @name module:media/MediaContent.MediaContent#externalParams
274
- * @type {string} */
275
- externalParam: null,
276
- /**
277
- * Special setting used to play only a fragment of media. `-1` means not used (plays full
278
- * length, from the beginning)
279
- * @name module:media/MediaContent.MediaContent#from
280
- * @type {number} */
281
- from: -1,
282
- /**
283
- * Special setting used to play only a fragment of media. `-1` means not used (plays to the end
284
- * of the media)
285
- * @name module:media/MediaContent.MediaContent#to
286
- * @type {number} */
287
- to: -1,
288
- /**
289
- * When `type` is `RECORD_AUDIO`, this member stores the maximum length of the recorded
290
- * sound, in seconds.
291
- * @name module:media/MediaContent.MediaContent#length
292
- * @type {number} */
293
- length: 3,
294
- /**
295
- * When `type` is `RECORD_AUDIO`, this member stores the buffer ID where the recording
296
- * will be stored.
297
- * @name module:media/MediaContent.MediaContent#recBuffer
298
- * @type {number} */
299
- recBuffer: 0,
300
- /**
301
- * Whether to stretch or not the video size to fit the cell space.
302
- * @name module:media/MediaContent.MediaContent#stretch
303
- * @type {boolean} */
304
- stretch: false,
305
- /**
306
- * When `true`, the video plays out of the cell, centered on the activity window.
307
- * @name module:media/MediaContent.MediaContent#free
308
- * @type {boolean} */
309
- free: false,
310
- /**
311
- * Places the video window at a specific location.
312
- * @name module:media/MediaContent.MediaContent#absLocation
313
- * @type {module:AWT.Point} */
314
- absLocation: null,
315
- /**
316
- * When {@link module:media/MediaContent.MediaContent#absLocation} is not `null`, this field indicates from where to
317
- * measure its coordinates. Valid values are: `BOX`, `WINDOW` or `FRAME`.
318
- * @name module:media/MediaContent.MediaContent#absLocationFrom
319
- * @type {string} */
320
- absLocationFrom: null,
321
- /**
322
- * `true` when the video window must catch mouse clicks.
323
- * @name module:media/MediaContent.MediaContent#catchMouseEvents
324
- * @type {boolean} */
325
- catchMouseEvents: false,
326
- /**
327
- * Whether to repeat the media in loop, or just one time.
328
- * @name module:media/MediaContent.MediaContent#loop
329
- * @type {boolean} */
330
- loop: false,
331
- /**
332
- * When `true`, the media will automatically start playing when the associated {@link module:boxes/ActiveBox.ActiveBox ActiveBox}
333
- * become active.
334
- * @name module:media/MediaContent.MediaContent#autoStart
335
- * @type {boolean} */
336
- autoStart: false,
337
- });
338
-
339
- /**
340
- * Default icons for media types.
341
- * @type {object} */
342
- const ICONS = {
343
- generic: generic_namespaceObject,
344
- audio: audio_namespaceObject,
345
- movie: movie_namespaceObject,
346
- mic: mic_namespaceObject,
347
- music: music_namespaceObject,
348
- url: url_namespaceObject,
349
- };
350
-
351
- /**
352
- * Collection of icon {@link external:HTMLImageElement} objects
353
- * @name module:media/MediaContent.MediaContent.ICONS
354
- * @type {object} */
355
- MediaContent.ICONS = {};
356
-
357
- // Load the icons
358
- external_jquery_default().each(ICONS, (key, value) => {
359
- const img = new Image();
360
- img.src = (0,Utils/* svgToURI */.g8)(value);
361
- MediaContent.ICONS[key] = img;
362
- });
363
-
364
- /* harmony default export */ const media_MediaContent = (MediaContent);
365
-
366
-
367
- /***/ })
368
-
369
- };
370
- ;
371
- //# sourceMappingURL=2355.jclic-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"2355.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;AACwD;;AAEhD;AACJ;AACJ;AACI;AACA;AACJ;;AAElC;AACA;AACA;AACA,qBAAqB,kDAAkD;AACvE;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,IAAI,6BAAW;AACf;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAM;AAC5B;AACA;AACA,+BAA+B,wBAAM;AACrC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,iBAAK;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAAU;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,WAAW,yBAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,WAAW,yBAAO;AAClB;AACA,QAAQ,wBAAwB,iBAAK,EAAE;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,wCAAwC;AACrD,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA,kBAAkB,QAAQ,EAAE,UAAU,EAAE,0BAA0B,UAAU,OAAO,EAAE,sBAAsB,QAAQ,OAAO;AAC1H;AACA,kBAAkB,QAAQ,EAAE,mBAAmB;AAC/C;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,cAAc,UAAU,EAAE,gBAAgB,UAAU,OAAO;AAC3D;;AAEA;AACA;AACA,eAAe;AACf;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;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;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;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA,WAAW,0DAA0D;AACrE;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA,kFAAkF;AAClF;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA;AACA,UAAU,QAAQ;AAClB;AACA,SAAS;AACT,OAAO;AACP,OAAO;AACP,KAAK;AACL,OAAO;AACP,KAAK;AACL;;AAEA;AACA,uBAAuB,iCAAiC;AACxD;AACA,UAAU,QAAQ;AAClB;;AAEA;AACA,8BAAM;AACN;AACA,YAAY,0BAAQ;AACpB;AACA,CAAC;;AAED,yDAAe,YAAY,EAAC","sources":["webpack://jclic/./src/media/MediaContent.js"],"sourcesContent":["/**\n * File : media/MediaContent.js\n * Created : 13/04/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/* global Image */\n\nimport $ from 'jquery';\nimport { Point } from '../AWT.js';\nimport { nSlash, attrForEach, getBoolean, getAttr, setAttr, svgToURI } from '../Utils.js';\n\nimport generic from './icons/generic.svg';\nimport audio from './icons/audio.svg';\nimport mic from './icons/mic.svg';\nimport movie from './icons/movie.svg';\nimport music from './icons/music.svg';\nimport url from './icons/url.svg';\n\n/**\n * This object contains a description of any multimedia content (sound, video, MIDI, voice\n * recording..) or special actions (jump to another point in the sequence, link to an URL, etc.)\n * associated to an {@link module:boxes/ActiveBox.ActiveBox ActiveBox} object.\n */\nexport class MediaContent {\n /**\n * MediaContent constructor\n * @param {string} type - The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,\n * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,\n * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`\n * @param {string} [file] - Optional parameter indicating the media file name\n */\n constructor(type, file) {\n this.type = type;\n if (file)\n this.file = file;\n }\n\n /**\n * Loads the MediaContent settings from a specific JQuery XML element\n * @param {external:jQuery} $xml\n */\n setProperties($xml) {\n attrForEach($xml.get(0).attributes, (name, val) => {\n switch (name) {\n case 'type':\n this.type = val;\n break;\n case 'file':\n this.file = nSlash(val);\n break;\n case 'params':\n this.externalParam = nSlash(val);\n break;\n\n case 'pFrom':\n this.absLocationFrom = val;\n break;\n\n case 'buffer':\n this.recBuffer = Number(val);\n break;\n case 'level':\n case 'from':\n case 'to':\n case 'length':\n this[name] = Number(val);\n break;\n\n case 'px':\n case 'py':\n if (this.absLocation === null)\n this.absLocation = new Point(0, 0);\n if (name === 'px')\n this.absLocation.x = Number(val);\n else\n this.absLocation.y = Number(val);\n break;\n\n case 'stretch':\n case 'free':\n case 'catchMouseEvents':\n case 'loop':\n case 'autostart':\n this[name] = getBoolean(val);\n break;\n }\n });\n return this;\n }\n\n /**\n * Gets a object with the basic attributes needed to rebuild this instance excluding functions,\n * parent references, constants and also attributes retaining the default value.\n * The resulting object is commonly usued to serialize elements in JSON format.\n * @returns {object} - The resulting object, with minimal attrributes\n */\n getAttributes() {\n return getAttr(this, [\n 'type', 'file', 'externalParam',\n 'absLocation', // -> AWT.Point\n 'absLocationFrom', 'recBuffer',\n 'level|1', 'from', 'to', 'length',\n 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart'\n ]);\n }\n\n /**\n * Reads the properties of this MediaContent from a data object\n * @param {object} data - The data object to be parsed\n * @returns {module:media/MediaContent.MediaContent}\n */\n setAttributes(data) {\n return setAttr(this, data, [\n 'type', 'file', 'externalParam',\n { key: 'absLocation', fn: Point },\n 'absLocationFrom', 'recBuffer',\n 'level', 'from', 'to', 'length',\n 'stretch', 'free', 'catchMouseEvents', 'loop', 'autostart',\n ]);\n }\n\n /**\n * Compares this object with another MediaContent.\n * @param {module:media/MediaContent.MediaContent} mc - The Media Content to compare against to.\n * @returns {boolean} - `true` when both objects are equivalent.\n */\n isEquivalent(mc) {\n return this.type === mc.type &&\n (this.file === mc.file ||\n this.file !== null && mc.file !== null &&\n this.file.toLocaleLowerCase() === mc.file.toLocaleLowerCase()) &&\n this.from === mc.from &&\n this.to === mc.to &&\n this.recBuffer === mc.recBuffer;\n }\n\n /**\n * Gets a string representing this media content, useful for checking if two different elements\n * are equivalent.\n * @returns {string}\n */\n getDescription() {\n let result = `${this.type}`;\n if (this.file)\n result = `${result} ${this.file}${this.from >= 0 ? ` from:${this.from}` : ''}${this.to >= 0 ? ` to:${this.to}` : ''}`;\n else if (this.externalParam)\n result = `${result} ${this.externalParam}`;\n return result;\n }\n\n /**\n * Returns a simplified description of this media content. Useful for accessibility methods.\n * @returns {string}\n */\n toString() {\n return `${this.type}${this.file ? ` ${this.file}` : ''}`;\n }\n\n /**\n * Returns an image to be used as icon for representing this media content.\n * @returns {external:HTMLImageElement}\n */\n getIcon() {\n let icon = null;\n switch (this.type) {\n case 'PLAY_AUDIO':\n case 'PLAY_RECORDED_AUDIO':\n icon = 'audio';\n break;\n case 'RECORD_AUDIO':\n icon = 'mic';\n break;\n case 'PLAY_VIDEO':\n icon = 'movie';\n break;\n case 'PLAY_MIDI':\n icon = 'music';\n break;\n case 'URL':\n icon = 'url';\n break;\n default:\n icon = 'generic';\n break;\n }\n return icon ? MediaContent.ICONS[icon] : null;\n }\n}\n\nObject.assign(MediaContent.prototype, {\n /**\n * The type of media. Valid values are: `UNKNOWN`, `PLAY_AUDIO`, `PLAY_VIDEO`,\n * `PLAY_MIDI`, `PLAY_CDAUDIO`, `RECORD_AUDIO`, `PLAY_RECORDED_AUDIO`, `RUN_CLIC_ACTIVITY`,\n * `RUN_CLIC_PACKAGE`, `RUN_EXTERNAL`, `URL`, `EXIT` and `RETURN`\n * @name module:media/MediaContent.MediaContent#type\n * @type {string} */\n type: 'UNKNOWN',\n /**\n * The priority level is important when different medias want to play together. Objects with\n * highest priority level can mute lower ones.\n * @name module:media/MediaContent.MediaContent#level\n * @type {number} */\n level: 1,\n /**\n * Media file name\n * @name module:media/MediaContent.MediaContent#file\n * @type {string} */\n file: null,\n /**\n * Optional parameters passed to external calls\n * @name module:media/MediaContent.MediaContent#externalParams\n * @type {string} */\n externalParam: null,\n /**\n * Special setting used to play only a fragment of media. `-1` means not used (plays full\n * length, from the beginning)\n * @name module:media/MediaContent.MediaContent#from\n * @type {number} */\n from: -1,\n /**\n * Special setting used to play only a fragment of media. `-1` means not used (plays to the end\n * of the media)\n * @name module:media/MediaContent.MediaContent#to\n * @type {number} */\n to: -1,\n /**\n * When `type` is `RECORD_AUDIO`, this member stores the maximum length of the recorded\n * sound, in seconds.\n * @name module:media/MediaContent.MediaContent#length\n * @type {number} */\n length: 3,\n /**\n * When `type` is `RECORD_AUDIO`, this member stores the buffer ID where the recording\n * will be stored.\n * @name module:media/MediaContent.MediaContent#recBuffer\n * @type {number} */\n recBuffer: 0,\n /**\n * Whether to stretch or not the video size to fit the cell space.\n * @name module:media/MediaContent.MediaContent#stretch\n * @type {boolean} */\n stretch: false,\n /**\n * When `true`, the video plays out of the cell, centered on the activity window.\n * @name module:media/MediaContent.MediaContent#free\n * @type {boolean} */\n free: false,\n /**\n * Places the video window at a specific location.\n * @name module:media/MediaContent.MediaContent#absLocation\n * @type {module:AWT.Point} */\n absLocation: null,\n /**\n * When {@link module:media/MediaContent.MediaContent#absLocation} is not `null`, this field indicates from where to\n * measure its coordinates. Valid values are: `BOX`, `WINDOW` or `FRAME`.\n * @name module:media/MediaContent.MediaContent#absLocationFrom\n * @type {string} */\n absLocationFrom: null,\n /**\n * `true` when the video window must catch mouse clicks.\n * @name module:media/MediaContent.MediaContent#catchMouseEvents\n * @type {boolean} */\n catchMouseEvents: false,\n /**\n * Whether to repeat the media in loop, or just one time.\n * @name module:media/MediaContent.MediaContent#loop\n * @type {boolean} */\n loop: false,\n /**\n * When `true`, the media will automatically start playing when the associated {@link module:boxes/ActiveBox.ActiveBox ActiveBox}\n * become active.\n * @name module:media/MediaContent.MediaContent#autoStart\n * @type {boolean} */\n autoStart: false,\n});\n\n/**\n * Default icons for media types.\n * @type {object} */\nconst ICONS = {\n generic,\n audio,\n movie,\n mic,\n music,\n url,\n};\n\n/**\n * Collection of icon {@link external:HTMLImageElement} objects\n * @name module:media/MediaContent.MediaContent.ICONS\n * @type {object} */\nMediaContent.ICONS = {};\n\n// Load the icons\n$.each(ICONS, (key, value) => {\n const img = new Image();\n img.src = svgToURI(value);\n MediaContent.ICONS[key] = img;\n});\n\nexport default MediaContent;\n"],"names":[],"sourceRoot":""}