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":"9409.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;AACY;AACkB;AACX;AACJ;AACoD;;AAE1F;AACA,qCAAqC,uEAAuE;AAC5G,sEAAsE,0CAA0C;AAChH,+CAA+C,iDAAiD,WAAW,4CAA4C;AACvJ;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,+BAA+B;AAC5C;AACA;AACA;AACA,IAAI,gEAAW;AACf;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+DAAU;AAClC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,6CAAC;AACrB;AACA;AACA,2BAA2B,mDAAO;AAClC;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAAM;AAC9B;AACA;AACA;AACA;AACA;AACA,mDAAmD,oBAAoB,4DAAgB,eAAe;AACtG;AACA;AACA,8BAA8B,4DAAgB;AAC9C;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;;AAEA;AACA;AACA,oCAAoC,+CAA+C;;AAEnF;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,+BAA+B;AAC5C,eAAe;AACf;AACA;AACA,IAAI,4DAAO;AACX;AACA;AACA;AACA,QAAQ,kBAAkB,mDAAO,EAAE;AACnC,QAAQ,mBAAmB,0DAAM,EAAE;AACnC;AACA,QAAQ,kBAAkB,4DAAgB,sCAAsC;AAChF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8CAA8C;AAC/F;;AAEA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,+CAA+C;;AAEjF;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa,gCAAgC,mBAAmB;AAChE;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,2CAA2C;AAC/D,eAAe;AACf;AACA;AACA;AACA,oBAAoB,0DAAM;AAC1B;AACA;;AAEA;AACA,oBAAoB,4CAA4C;AAChE,eAAe;AACf;AACA;AACA;AACA,uBAAuB,mDAAO;AAC9B;AACA;;AAEA;AACA,iBAAiB,uEAAuE;AACxF,aAAa,gDAAgD;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,uEAAuE;AAC1F,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C,4BAA4B,4DAAgB;AAC5C;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,+BAA+B;AAC5C,aAAa,8BAA8B;AAC3C,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA,kBAAkB,wDAAS;AAC3B,oBAAoB,wBAAwB;AAC5C;;AAEA;AACA,mCAAmC,4DAAgB;AACnD;AACA;AACA;;AAEA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;;AAEA;AACA,oCAAoC,uEAAuE;AAC3G,aAAa,UAAU;AACvB;AACA;AACA,oBAAoB,yCAAyC;AAC7D;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,KAAK;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,uEAAuE;AAC7G;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA,uCAAuC,qBAAqB;AAC5D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,2BAA2B;AACvC;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,KAAK,yDAAQ;AACb;AACA;AACA;AACA,YAAY,QAAQ;AACpB,KAAK,yDAAQ;AACb;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA,YAAY,gDAAgD;AAC5D;AACA;AACA,wBAAwB,uEAAuE;AAC/F;AACA,YAAY,kDAAkD;AAC9D;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA,CAAC;;AAED,iEAAe,gBAAgB,EAAC;;;;;;;;;;;;;;;;AC7ehC;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;AACsD;AACL;;AAExE;AACA;AACA,UAAU,kDAAkD;AAC5D;AACA;AACO;AACP;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,MAAM,wDAAG,6BAA6B,UAAU;AAChD;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC,8BAA8B,oDAAK;AACnC;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,IAAI,gEAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+DAAU;AACjC;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,MAAM,6CAAC;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,IAAI,kDAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,wDAAS;AAChC;AACA;AACA,uBAAuB,sDAAO;AAC9B;AACA;AACA;AACA,uBAAuB,yDAAU;AACjC;AACA;AACA,KAAK;;AAEL,2CAA2C,mDAAI;AAC/C;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,WAAW,4DAAO;AAClB;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,IAAI,4DAAO;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,sBAAsB,oDAAK,EAAE;AACrC,QAAQ,sBAAsB,oDAAK,kBAAkB;AACrD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe,wDAAS;AACxB;;AAEA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA2C,wDAAS;AACpD,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,0CAA0C;AACnD;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,SAAS,uCAAuC;AAChD;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,uCAAuC;AAChD;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA,SAAS,uCAAuC;AAChD;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA,SAAS,uCAAuC;AAChD;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA,CAAC;;AAED;AACA;AACA;AACA,UAAU,QAAQ;AAClB;;AAEA,iEAAe,MAAM,EAAC","sources":["webpack://jclic/./src/boxes/ActiveBagContent.js","webpack://jclic/./src/shapers/Shaper.js"],"sourcesContent":["/**\n * File : boxes/ActiveBagContent.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\nimport $ from 'jquery';\nimport BoxBase from './BoxBase.js';\nimport ActiveBoxContent from './ActiveBoxContent.js';\nimport Shaper from '../shapers/Shaper.js';\nimport { Rectangle } from '../AWT.js';\nimport { settings, attrForEach, nSlash, getBoolean, getAttr, setAttr } from '../Utils.js';\n\n/**\n * This class packs a collection of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} objects and provides methods to access\n * and manage it. The two main members of `ActiveBagContent` are the {@link module:shapers/Shaper.Shaper Shaper}, responsible for\n * determining the position and shape of each {@link module:boxes/ActiveBox.ActiveBox ActiveBox}, and the {@link module:boxes/BoxBase.BoxBase BoxBase} (field `style`),\n * provider of a common visual style.\n */\nexport class ActiveBagContent {\n /**\n * ActiveBagContent constructor\n * @param {string} [id] - An optional text tag identifying this ActiveBagContent\n * @param {number} ncw - In grid-based distributions, number of columns.\n * @param {number} nch - In grid-based distributions, number of rows.\n */\n constructor(id, ncw, nch) {\n if (id)\n this.id = id;\n this.cells = [];\n this.ncw = Math.max(1, ncw);\n this.nch = Math.max(1, nch);\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 * @param {module:bags/MediaBag.MediaBag} mediaBag - The project's MediaBag\n */\n setProperties($xml, mediaBag) {\n let bug = false;\n attrForEach($xml.get(0).attributes, (name, val) => {\n switch (name) {\n case 'id':\n this.id = val;\n break;\n case 'image':\n this.image = nSlash(val);\n break;\n // Bug in JClic beta 1: \"columns\" is number of rows, and \"rows\" is number of columns.\n // Was corrected in beta 2: If \"cols\" is specified, \"rows\" are rows and \"cols\" are columns.\n case 'rows':\n this.nch = Number(val);\n break;\n case 'columns':\n bug = true;\n /* falls through */\n case 'cols':\n this.ncw = Number(val);\n break;\n case 'cellWidth':\n this.w = Number(val);\n break;\n case 'cellHeight':\n this.h = Number(val);\n break;\n case 'border':\n this.border = getBoolean(val);\n break;\n }\n });\n\n if (bug) {\n let n = this.ncw;\n this.ncw = this.nch;\n this.nch = n;\n }\n\n $xml.children().each((_n, child) => {\n const $node = $(child);\n switch (child.nodeName) {\n case 'style':\n this.style = new BoxBase(null).setProperties($node);\n break;\n case 'shaper':\n const shaperClassName = $node.attr('class'),\n nCols = Math.max(1, $node.attr('cols')),\n nRows = Math.max(1, $node.attr('rows'));\n this.shaper = Shaper.getShaper(shaperClassName, nCols, nRows);\n this.shaper.setProperties($node);\n break;\n case 'ids':\n // Used in special cases where all cells have empty content with only 'ids'\n this.ids = child.textContent;\n this.ids.split(' ').forEach((id, i) => { this.cells[i] = new ActiveBoxContent(Number(id)); });\n break;\n case 'cell':\n this.cells.push(new ActiveBoxContent().setProperties($node, mediaBag));\n break;\n }\n });\n\n let n = this.cells.length;\n\n // Create cells when `cells` is empty\n if (n === 0 && this.shaper && this.shaper.nCells > 0) {\n this.initiallyEmptyCells = true;\n n = this.shaper.nCells;\n this.getActiveBoxContent(n - 1);\n }\n\n // Assign ids when cells have empty content (they are just shapes)\n if (n > 0) {\n let empty = true;\n for (let i = 0; i < n; i++) {\n const bxc = this.getActiveBoxContent(i);\n if (bxc.id !== -1 || bxc.item !== -1 || !bxc.isEmpty()) {\n empty = false;\n break;\n }\n }\n if (empty) {\n for (let i = 0; i < n; i++)\n this.getActiveBoxContent(i).id = i;\n }\n }\n\n // Link [BoxBase](BoxBase.html) objects of `cells` elements to `style`\n if (this.style)\n this.cells.forEach((abc) => { if (abc.style) abc.style.parent = this.style; });\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 const fields = [\n 'id', 'image',\n 'ncw', 'nch',\n 'w', 'h', 'border',\n 'style', // BoxBase\n 'shaper', // Shaper\n ];\n if (!this.initiallyEmptyCells)\n fields.push(this.ids ? 'ids' : 'cells'); // ActiveBoxContent\n return getAttr(this, fields);\n }\n\n /**\n * Reads the properties of this ActiveBagContent from a data object\n * @param {object} data - The data object to be parsed\n * @param {module:bags/MediaBag.MediaBag} mediaBag - The project's MediaBag\n * @returns {module:boxes/ActiveBagContent.ActiveBagContent}\n */\n setAttributes(data, mediaBag) {\n setAttr(this, data, [\n 'id', 'image',\n 'ncw', 'nch',\n 'w', 'h', 'border',\n { key: 'style', fn: BoxBase },\n { key: 'shaper', fn: Shaper },\n 'ids',\n { key: 'cells', fn: ActiveBoxContent, group: 'array', params: [mediaBag] },\n ]);\n\n let n = this.cells.length;\n\n // Create cells when `cells` is empty\n if (n === 0 && this.shaper && this.shaper.nCells > 0) {\n this.initiallyEmptyCells = true;\n n = this.shaper.nCells;\n this.getActiveBoxContent(n - 1);\n if (this.ids)\n this.ids.split(' ').forEach((id, i) => { this.getActiveBoxContent(i).id = Number(id); });\n }\n\n // Assign ids when cells have empty content (they are just shapes)\n if (n > 0) {\n let empty = true;\n for (let i = 0; i < n; i++) {\n const bxc = this.getActiveBoxContent(i);\n if (bxc.id !== -1 || bxc.item !== -1 || !bxc.isEmpty()) {\n empty = false;\n break;\n }\n }\n if (empty) {\n for (let i = 0; i < n; i++)\n this.getActiveBoxContent(i).id = i;\n }\n }\n\n // Link [BoxBase](BoxBase.html) objects of `cells` elements to `style`\n if (this.style)\n this.cells.forEach(abc => { if (abc.style) abc.style.parent = this.style; });\n\n if (mediaBag)\n this.cells.forEach(abc => abc.realizeContent(mediaBag));\n\n return this;\n }\n\n /**\n * Prepares the media content of all elements\n * @param {module:JClicPlayer.JClicPlayer} playStation - The {@link module:JClicPlayer.JClicPlayer JClicPlayer}\n */\n prepareMedia(playStation) {\n this.cells.forEach(abc => abc.prepareMedia(playStation));\n }\n\n /**\n * Gets the estimated total width of this content bag\n * @returns {number}\n */\n getTotalWidth() {\n return this.w * this.ncw;\n }\n\n /**\n * Gets the estimated total height of this bag\n * @returns {number}\n */\n getTotalHeight() {\n return this.h * this.nch;\n }\n\n /**\n * Gets the total number of cells of this bag\n * @returns {number}\n */\n getNumCells() {\n return this.cells.length;\n }\n\n /**\n * Checks if the bag is empty\n * @returns {boolean}\n */\n isEmpty() {\n return this.cells.length === 0;\n }\n\n /**\n * Retrieves the {@link module:shapers/Shaper.Shaper Shaper} of this bag, creating a new one if it was _null_\n * @returns {module:shapers/Shaper.Shaper}\n */\n getShaper() {\n if (this.shaper === null)\n this.shaper = Shaper.getShaper('@Rectangular', this.ncw, this.nch);\n return this.shaper;\n }\n\n /**\n * Retrieves the {@link module:boxes/BoxBase.BoxBase BoxBase} of this bag, creating a new one if it was _null_\n * @returns {module:boxes/BoxBase.BoxBase}\n */\n getBoxBase() {\n if (this.style === null)\n this.style = new BoxBase();\n return this.style;\n }\n\n /**\n * Adds a new {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} to this bag\n * @param {module:boxes/ActiveBoxContent.ActiveBoxContent} ab - The ActiveBoxContent to add\n */\n addActiveBoxContent(ab) {\n this.cells.push(ab);\n if (this.ncw === 0 || this.nch === 0) {\n this.ncw = this.nch = 1;\n }\n }\n\n /**\n * Gets the nth {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} in `cells`\n * @param {number} i - The index of the content to be retrieved\n * @returns {module:boxes/ActiveBoxContent.ActiveBoxContent}\n */\n getActiveBoxContent(i) {\n if (i >= this.cells.length) {\n for (let j = this.cells.length; j <= i; j++)\n this.cells.push(new ActiveBoxContent());\n }\n return this.cells[i];\n }\n\n /**\n * Finds the ActiveBoxContent with specific `id` and `item` values\n * @param {number} id\n * @param {number} item\n * @returns {module:boxes/ActiveBoxContent.ActiveBoxContent}\n */\n getActiveBoxContentWith(id, item) {\n return this.cells.find(bxc => bxc.id === id && bxc.item === item);\n }\n\n /**\n * Sets the content of the cells based on a image spliced by a shaper\n * @param {module:bags/MediaBag.MediaBag} mb - The MediaBag used to retrieve the image\n * @param {module:shapers/Shaper.Shaper} sh - The Shaper used to splice the image\n * @param {boolean} roundSizes - When `true`, the size and coordinates of cells will be rounded\n * to the nearest integer values.\n */\n setImgContent(mb, sh, roundSizes) {\n if (sh)\n this.setShaper(sh);\n\n if (this.shaper.className === '@Holes')\n this.shaper.hasRemainder = true;\n\n this.ncw = this.shaper.nCols;\n this.nch = this.shaper.nRows;\n const mbe = mb.elements[this.image];\n if (mb && this.image && mbe && mbe.ready) {\n this.img = mbe.data;\n if (mbe.animated)\n this.animatedGifFile = mbe.getFullPath();\n this.w = this.img.width / this.ncw;\n this.h = this.img.height / this.nch;\n if (roundSizes) {\n this.w = Math.round(this.w);\n this.h = Math.round(this.h);\n }\n } else {\n this.img = null;\n this.w = Math.max(this.w, 10);\n this.h = Math.max(this.h, 10);\n }\n\n const r = new Rectangle(0, 0, this.w * this.ncw, this.h * this.nch);\n for (let i = 0; i < this.shaper.nCells; i++)\n this.getActiveBoxContent(i).setImgContent(this.img, this.shaper.getShape(i, r), this.animatedGifFile);\n\n if (this.shaper.hasRemainder) {\n this.backgroundContent = new ActiveBoxContent();\n this.backgroundContent.setImgContent(this.img, this.shaper.getRemainderShape(r));\n }\n }\n\n /**\n * Sets the content of this bag based on an array of strings\n * @param {string[]} txt - The array of strings to be used as content.\n * @param {number} setNcw - Number of columns\n * @param {number} setNch - Number of rows\n */\n setTextContent(txt, setNcw, setNch) {\n this.ncw = Math.max(1, setNcw);\n this.nch = Math.max(1, setNch);\n const n = this.ncw * this.nch;\n for (let i = 0; i < n; i++)\n this.getActiveBoxContent(i).setTextContent(i >= txt.length || txt[i] === null ? '' : txt[i]);\n }\n\n /**\n * Sets `id` values to a all the {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} elements of his bag.\n * @param {number[]} ids -Array of numeric identifiers\n */\n setIds(ids) {\n for (let i = 0; i < ids.length && i < this.cells.length; i++)\n this.getActiveBoxContent(i).id = ids[i];\n }\n\n /**\n * Sets `value` to the `key` attribute of all cells\n * @param {string} key - The key where the value will be stored\n * @param {any} value - The supplied value. Can be of any type.\n */\n setCellsAttribute(key, value) {\n this.cells.forEach(abc => abc[key] = value);\n }\n\n /**\n *\n * Cheks if the `id` values of all {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} objects are -1 and, if true,\n * sets new ids to them, with values between 0 and `maxId`\n * @param {number} maxId - The maximum value of identifiers\n */\n avoidAllIdsNull(maxId) {\n if (this.cells.every(abc => abc.id === -1)) {\n maxId = Math.max(1, maxId);\n this.cells.forEach((abc, n) => { abc.id = n % maxId; });\n }\n }\n}\n\nObject.assign(ActiveBagContent.prototype, {\n /**\n * The global identifier of this object: `primary`, `secondary`...\n * @name module:boxes/ActiveBagContent.ActiveBagContent#id\n * @type {string} */\n id: 'primary',\n /**\n * The name of the image file used as a common image of this bag\n * @name module:boxes/ActiveBagContent.ActiveBagContent#image\n * @type {string} */\n image: null,\n /**\n * The built image object\n * @name module:boxes/ActiveBagContent.ActiveBagContent#img\n * @type {external:HTMLImageElement} */\n img: null,\n /**\n * Name of the img source when is an animated GIF\n * @name module:boxes/ActiveBagContent.ActiveBagContent#animatedGifFile\n * @type {string} */\n animatedGifFile: null,\n /**\n * Number of columns when cells are distributed in a grid\n * @name module:boxes/ActiveBagContent.ActiveBagContent#ncw\n * @type {number} */\n ncw: 1,\n /**\n * Number of rows when cells are distributed in a grid\n * @name module:boxes/ActiveBagContent.ActiveBagContent#nch\n * @type {number} */\n nch: 1,\n /**\n * Optimal cell width\n * @name module:boxes/ActiveBagContent.ActiveBagContent#w\n * @type {number} */\n w: settings.DEFAULT_GRID_ELEMENT_SIZE,\n /**\n * Optimal cell height\n * @name module:boxes/ActiveBagContent.ActiveBagContent#h\n * @type {number} */\n h: settings.DEFAULT_GRID_ELEMENT_SIZE,\n /**\n * Whether the cells must have a border or not\n * @name module:boxes/ActiveBagContent.ActiveBagContent#border\n * @type {boolean} */\n border: true,\n /**\n * The BoxBase used for this bag of cell contents\n * @name module:boxes/ActiveBagContent.ActiveBagContent#style\n * @type {module:boxes/BoxBase.BoxBase} */\n style: null,\n /**\n * The Shaper used to define the specific shape of each cell\n * @name module:boxes/ActiveBagContent.ActiveBagContent#shaper\n * @type {module:shapers/Shaper.Shaper} */\n shaper: null,\n /**\n * An optional ActiveBoxContent object with background settings.\n * @name module:boxes/ActiveBagContent.ActiveBagContent#backgroundContent\n * @type {module:boxes/ActiveBoxContent.ActiveBoxContent} */\n backgroundContent: null,\n /**\n * The main Array of {@link module:boxes/ActiveBoxContent.ActiveBoxContent ActiveBoxContent} objects\n * @name module:boxes/ActiveBagContent.ActiveBagContent#cells\n * @type {module:boxes/ActiveBoxContent.ActiveBoxContent[]} */\n cells: null,\n /**\n * The default value to be assigned at the 'id' field of children\n * @name module:boxes/ActiveBagContent.ActiveBagContent#defaultIdValue\n * @type {number} */\n defaultIdValue: -1,\n /**\n * Used in special cases where all cells have empty content with only numeric identifiers\n * @name module:boxes/ActiveBagContent.ActiveBagContent#ids\n * @type {string} */\n ids: null,\n});\n\nexport default ActiveBagContent;\n","/**\n * File : shapers/Shaper.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\nimport $ from 'jquery';\nimport { log, attrForEach, getBoolean, getAttr, setAttr } from '../Utils.js';\nimport { Shape, Rectangle, Ellipse, PathStroke, Path } from '../AWT.js';\n\n/**\n * The function of this class and its subclasses is to draw a set of \"shapes\" that will be used to\n * place {@link module:boxes/ActiveBox.ActiveBox ActiveBox} objects at a specific position, and to determine its dimension and\n * appearance.\n */\nexport class Shaper {\n /**\n * Shaper constructor\n * @param {number} nx - Number of columns (in grid-based shapers)\n * @param {number} ny - Number of rows (in grid-based shapers)\n */\n constructor(nx, ny) {\n this.reset(nx, ny);\n }\n\n /**\n * Registers a new type of shaper\n * @param {string} shaperName - The name used to identify this shaper\n * @param {function} shaperClass - The shaper class, usually extending Shaper\n * @returns {module:shapers/Shaper.Shaper} - The provided shaper class\n */\n static registerClass(shaperName, shaperClass) {\n Shaper.CLASSES[shaperName] = shaperClass;\n return shaperClass;\n }\n\n /**\n * Factory constructor that returns a Shaper of the requested class.\n * @param {string} className - The class name of the requested Shaper.\n * @param {number} nx - Number of columns (in grid-based shapers)\n * @param {number} ny - Number of rows (in grid-based shapers)\n * @returns {module:shapers/Shaper.Shaper}\n */\n static getShaper(className, nx, ny) {\n const cl = Shaper.CLASSES[(className || '').replace(/^edu\\.xtec\\.jclic\\.shapers\\./, '@')];\n if (!cl)\n log('error', `Unknown shaper: ${className}`);\n return cl ? new cl(nx, ny) : null;\n }\n\n /**\n * Initializes this Shaper to default values\n * @param {number} nCols - Number of columns\n * @param {number} nRows - Number of rows\n */\n reset(nCols, nRows) {\n this.nCols = nCols;\n this.nRows = nRows;\n this.nCells = nRows * nCols;\n this.initiated = false;\n this.shapeData = [];\n for (let i = 0; i < this.nCells; i++)\n this.shapeData[i] = new Shape();\n }\n\n /**\n * Loads this shaper settings from a specific JQuery XML element\n * @param {external:jQuery} $xml - The XML element with the shaper data\n */\n setProperties($xml) {\n attrForEach($xml.get(0).attributes, (name, value) => {\n switch (name) {\n case 'class':\n this.className = value;\n break;\n case 'cols':\n this.nCols = Number(value);\n break;\n case 'rows':\n this.nRows = Number(value);\n break;\n case 'baseWidthFactor':\n case 'toothHeightFactor':\n case 'scaleX':\n case 'scaleY':\n this[name] = Number(value);\n break;\n case 'randomLines':\n case 'showEnclosure':\n this[name] = getBoolean(value, true);\n break;\n }\n });\n\n // Reads the 'enclosing'\n // (main shape area where the other shape elements are placed)\n $xml.children('enclosing:first').each((_n, child) => {\n $(child).children('shape:first').each((_n, child2) => {\n let sh = Shaper.readShapeData(child2, this.scaleX, this.scaleY);\n this.enclosing = sh;\n this.showEnclosure = true;\n this.hasRemainder = true;\n });\n });\n\n // Read the shape elements\n $xml.children('shape').each((n, child) => {\n this.shapeData[n] = Shaper.readShapeData(child, this.scaleX, this.scaleY);\n });\n\n // Correction needed for '@Holes' shaper\n if (this.shapeData.length > 0 /* && this.shapeData.length !== this.nRows * this.nCols */) {\n //this.nRows = this.shapeData.length\n //this.nCols = 1\n //this.nCells = this.nCols * this.nRows\n this.nCells = this.shapeData.length;\n }\n return this;\n }\n\n /**\n * Reads an individual shape from an XML element.\n * Shapes are arrays of `stroke` objects.\n * Each `stroke` has an `action` (_move to_, _line to_, _quad to_...) and associated `data`.\n * @param {external:jQuery} $xml - The XML element with the shape data\n * @param {number} scaleX\n * @param {number} scaleY\n * @returns {module:AWT.Shape}\n */\n static readShapeData(xml, scaleX, scaleY) {\n const shd = [];\n let result = null;\n $.each(xml.textContent.split('|'), (_n, txt) => {\n const sd = txt.split(':');\n // Possible strokes are: `rectangle`, `ellipse`, `M`, `L`, `Q`, `B`, `X`\n // Also possible, but not currently used in JClic: `roundRectangle` and `pie`\n let data = sd.length > 1 ? sd[1].split(',') : null;\n //\n // Data should be always divided by the scale (X or Y)\n if (data)\n data = data.map((d, n) => d / (n % 2 ? scaleY : scaleX));\n\n switch (sd[0]) {\n case 'rectangle':\n result = new Rectangle(data[0], data[1], data[2], data[3]);\n break;\n case 'ellipse':\n result = new Ellipse(data[0], data[1], data[2], data[3]);\n break;\n default:\n // It's an `AWT.PathStroke`\n shd.push(new PathStroke(sd[0], data));\n break;\n }\n });\n\n return !result && shd.length > 0 ? new Path(shd) : result;\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 const fields = [\n 'className', 'nCols', 'nRows',\n 'baseWidthFactor', 'toothHeightFactor',\n 'scaleX', 'scaleY',\n 'randomLines',\n ];\n\n if (this.customShapes) {\n ['showEnclosure', 'hasRemainder',\n 'enclosing', 'shapeData', // Array of AWT.Rectangle, AWT.Ellipse or (AWT.Path -> AWT.PathStroke)\n ].forEach(f => fields.push(f));\n }\n\n return getAttr(this, fields);\n }\n\n /**\n * Builds a new shaper, based on the properties specified in a data object\n * @param {object} data - The data object to be parsed\n * @returns {module:shapers/Shaper.Shaper}\n */\n static factory(data) {\n const result = Shaper.getShaper(data.className, data.nCols, data.nRows);\n setAttr(result, data, [\n 'className', 'nCols', 'nRows',\n 'baseWidthFactor', 'toothHeightFactor',\n 'scaleX', 'scaleY',\n 'randomLines',\n 'showEnclosure', 'hasRemainder',\n { key: 'enclosing', fn: Shape },\n { key: 'shapeData', fn: Shape, group: 'array' },\n ]);\n\n result.nCells = result.shapeData.length || result.nCols * result.nRows;\n\n return result;\n }\n\n /**\n * Builds the individual shapes that will form this Shaper\n */\n buildShapes() {\n }\n\n /**\n * Gets a clone of the nth Shape object, scaled and located inside a Rectangle\n * @param {number} n\n * @param {module:AWT.Rectangle} rect\n * @returns {module:AWT.Shape}\n */\n getShape(n, rect) {\n if (!this.initiated)\n this.buildShapes();\n if (n >= this.nCells || this.shapeData[n] === null)\n return null;\n return this.shapeData[n].getShape(rect);\n }\n\n /**\n * Gets the nth Shape data object\n * @param {number} n\n * @returns {object}\n */\n getShapeData(n) {\n return n >= 0 && n < this.shapeData.length ? this.shapeData[n] : null;\n }\n\n /**\n * Gets the AWT.Rectangle that contains all shapes of this Shaper.\n * @returns {module:AWT.Rectangle}\n */\n getEnclosingShapeData() {\n return new Rectangle(0, 0, 1, 1);\n }\n\n /**\n * When `hasRemainder` is true, this method gets the rectangle containing the full surface where\n * the Shaper develops.\n * @param {module:AWT.Rectangle} rect - The frame where to move and scale all the shapes\n * @returns {module:AWT.Rectangle}\n */\n getRemainderShape(rect) {\n if (!this.hasRemainder)\n return null;\n\n if (!this.initiated)\n this.buildShapes();\n\n const sh = this.getEnclosingShapeData();\n const r = sh ? sh.getShape(rect) : new Rectangle();\n for (let i = 0; i < this.nCells; i++) {\n if (this.shapeData[i])\n r.add(this.shapeData[i].getShape(rect), false);\n }\n return r;\n }\n}\n\nObject.assign(Shaper.prototype, {\n /**\n * This shaper class name\n * @name module:shapers/Shaper.Shaper#className\n * @type {string} */\n className: 'Shaper',\n /**\n * Number of columns (useful in grid-based shapers)\n * @name module:shapers/Shaper.Shaper#nCols\n * @type {number} */\n nCols: 0,\n /**\n * Number of rows (useful in grid-based shapers)\n * @name module:shapers/Shaper.Shaper#nRows\n * @type {number} */\n nRows: 0,\n /**\n * Number of cells managed by this shaper\n * @name module:shapers/Shaper.Shaper#nCells\n * @type {number} */\n nCells: 0,\n /**\n * Contains the specific definition of each shape\n * @name module:shapers/Shaper.Shaper#shapeData\n * @type {object} */\n shapeData: null,\n /**\n * Flag used to check if the `Shaper` has been initialized against a real surface\n * @name module:shapers/Shaper.Shaper#initiated\n * @type {boolean} */\n initiated: false,\n //\n // Fields used only in JigSaw shapers\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, ratio between the base width of the tooth and the total length of the side.\n * @name module:shapers/Shaper.Shaper#baseWidthFactor\n * @type {number} */\n baseWidthFactor: 1.0 / 3,\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, ratio between the tooth height and the total length of the side.\n * @name module:shapers/Shaper.Shaper#toothHeightFactor\n * @type {number} */\n toothHeightFactor: 1.0 / 6,\n /**\n * In {@link module:shapers/JigSaw.JigSaw JigSaw}, whether the tooths take random directions or not\n * @name module:shapers/Shaper.Shaper#randomLines\n * @type {boolean} */\n randomLines: false,\n //\n // Fields used only in the `Holes` shaper\n /**\n * In {@link module:shapers/Holes.Holes Holes}, scale to be applied to horizontal positions and lengths to achieve the real\n * value of the shape placed on a real surface.\n * @name module:shapers/Shaper.Shaper#scaleX\n * @type {number} */\n scaleX: 1.0,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, scale to be applied to vertical positions and lengths to achieve the real\n * value of the shape placed on a real surface.\n * @name module:shapers/Shaper.Shaper#scaleY\n * @type {number} */\n scaleY: 1.0,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, the enclosing area where all shapes are placed.\n * @name module:shapers/Shaper.Shaper#enclosing\n * @type {module:AWT.Shape} */\n enclosing: null,\n /**\n * In {@link module:shapers/Holes.Holes Holes}, when `true`, the enclosing area will be drawn\n * @name module:shapers/Shaper.Shaper#showEnclosure\n * @type {boolean} */\n showEnclosure: false,\n /**\n * Flag indicating if this shaper organizes its cells in rows and columns\n * @name module:shapers/Shaper.Shaper#rectangularShapes\n * @type {boolean} */\n rectangularShapes: false,\n /**\n * Flag indicating if this Shaper deploys over a surface biggest than the rectangle enclosing\n * all its shapes\n * @name module:shapers/Shaper.Shaper#hasRemainder\n * @type {boolean} */\n hasRemainder: false,\n /**\n * Only the `Holes` shaper has this flag activated\n * @name module:shapers/Shaper.Shaper#customShapes\n * @type {boolean} */\n customShapes: false,\n});\n\n/**\n * List of known classes derived from Shaper. It should be filled by real shaper classes at\n * declaration time.\n * @type {object} */\nShaper.CLASSES = {};\n\nexport default Shaper;\n"],"names":[],"sourceRoot":""}