@govbr-ds/webcomponents 2.0.0-next.22 → 2.0.0-next.24

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 (400) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +99 -90
  3. package/package.json +15 -51
  4. package/dist/cjs/app-globals-77a217c6.js +0 -11
  5. package/dist/cjs/app-globals-77a217c6.js.map +0 -1
  6. package/dist/cjs/br-avatar.cjs.entry.js +0 -77
  7. package/dist/cjs/br-avatar.cjs.entry.js.map +0 -1
  8. package/dist/cjs/br-button_2.cjs.entry.js +0 -2610
  9. package/dist/cjs/br-button_2.cjs.entry.js.map +0 -1
  10. package/dist/cjs/br-checkbox.cjs.entry.js +0 -76
  11. package/dist/cjs/br-checkbox.cjs.entry.js.map +0 -1
  12. package/dist/cjs/br-checkgroup.cjs.entry.js +0 -101
  13. package/dist/cjs/br-checkgroup.cjs.entry.js.map +0 -1
  14. package/dist/cjs/br-dropdown.cjs.entry.js +0 -100
  15. package/dist/cjs/br-dropdown.cjs.entry.js.map +0 -1
  16. package/dist/cjs/br-input_3.cjs.entry.js +0 -284
  17. package/dist/cjs/br-input_3.cjs.entry.js.map +0 -1
  18. package/dist/cjs/br-item.cjs.entry.js +0 -166
  19. package/dist/cjs/br-item.cjs.entry.js.map +0 -1
  20. package/dist/cjs/br-loading.cjs.entry.js +0 -43
  21. package/dist/cjs/br-loading.cjs.entry.js.map +0 -1
  22. package/dist/cjs/br-message.cjs.entry.js +0 -68
  23. package/dist/cjs/br-message.cjs.entry.js.map +0 -1
  24. package/dist/cjs/br-select.cjs.entry.js +0 -281
  25. package/dist/cjs/br-select.cjs.entry.js.map +0 -1
  26. package/dist/cjs/br-switch.cjs.entry.js +0 -84
  27. package/dist/cjs/br-switch.cjs.entry.js.map +0 -1
  28. package/dist/cjs/br-tag.cjs.entry.js +0 -88
  29. package/dist/cjs/br-tag.cjs.entry.js.map +0 -1
  30. package/dist/cjs/br-textarea.cjs.entry.js +0 -102
  31. package/dist/cjs/br-textarea.cjs.entry.js.map +0 -1
  32. package/dist/cjs/br-upload.cjs.entry.js +0 -168
  33. package/dist/cjs/br-upload.cjs.entry.js.map +0 -1
  34. package/dist/cjs/index-4fc1aab1.js +0 -2091
  35. package/dist/cjs/index-4fc1aab1.js.map +0 -1
  36. package/dist/cjs/index.cjs.js +0 -8
  37. package/dist/cjs/index.cjs.js.map +0 -1
  38. package/dist/cjs/inherited-attributes-16f7d388.js +0 -107
  39. package/dist/cjs/inherited-attributes-16f7d388.js.map +0 -1
  40. package/dist/cjs/loader.cjs.js +0 -21
  41. package/dist/cjs/loader.cjs.js.map +0 -1
  42. package/dist/cjs/v4-2a0fe526.js +0 -74
  43. package/dist/cjs/v4-2a0fe526.js.map +0 -1
  44. package/dist/cjs/webcomponents.cjs.js +0 -52
  45. package/dist/cjs/webcomponents.cjs.js.map +0 -1
  46. package/dist/collection/collection-manifest.json +0 -28
  47. package/dist/collection/components/avatar/avatar.css +0 -548
  48. package/dist/collection/components/avatar/avatar.js +0 -238
  49. package/dist/collection/components/avatar/avatar.js.map +0 -1
  50. package/dist/collection/components/button/button.css +0 -810
  51. package/dist/collection/components/button/button.js +0 -254
  52. package/dist/collection/components/button/button.js.map +0 -1
  53. package/dist/collection/components/checkbox/checkbox.css +0 -605
  54. package/dist/collection/components/checkbox/checkbox.js +0 -297
  55. package/dist/collection/components/checkbox/checkbox.js.map +0 -1
  56. package/dist/collection/components/checkgroup/checkgroup.css +0 -605
  57. package/dist/collection/components/checkgroup/checkgroup.js +0 -197
  58. package/dist/collection/components/checkgroup/checkgroup.js.map +0 -1
  59. package/dist/collection/components/dropdown/dropdown.css +0 -475
  60. package/dist/collection/components/dropdown/dropdown.js +0 -187
  61. package/dist/collection/components/dropdown/dropdown.js.map +0 -1
  62. package/dist/collection/components/icon/icon.css +0 -460
  63. package/dist/collection/components/icon/icon.js +0 -190
  64. package/dist/collection/components/icon/icon.js.map +0 -1
  65. package/dist/collection/components/input/input.css +0 -681
  66. package/dist/collection/components/input/input.js +0 -626
  67. package/dist/collection/components/input/input.js.map +0 -1
  68. package/dist/collection/components/item/item.css +0 -670
  69. package/dist/collection/components/item/item.js +0 -422
  70. package/dist/collection/components/item/item.js.map +0 -1
  71. package/dist/collection/components/list/list.css +0 -572
  72. package/dist/collection/components/list/list.js +0 -144
  73. package/dist/collection/components/list/list.js.map +0 -1
  74. package/dist/collection/components/loading/loading.css +0 -661
  75. package/dist/collection/components/loading/loading.js +0 -127
  76. package/dist/collection/components/loading/loading.js.map +0 -1
  77. package/dist/collection/components/message/message.css +0 -608
  78. package/dist/collection/components/message/message.js +0 -225
  79. package/dist/collection/components/message/message.js.map +0 -1
  80. package/dist/collection/components/radio/radio.css +0 -560
  81. package/dist/collection/components/radio/radio.js +0 -263
  82. package/dist/collection/components/radio/radio.js.map +0 -1
  83. package/dist/collection/components/select/select.css +0 -865
  84. package/dist/collection/components/select/select.js +0 -509
  85. package/dist/collection/components/select/select.js.map +0 -1
  86. package/dist/collection/components/switch/switch.css +0 -631
  87. package/dist/collection/components/switch/switch.js +0 -345
  88. package/dist/collection/components/switch/switch.js.map +0 -1
  89. package/dist/collection/components/tag/tag.css +0 -653
  90. package/dist/collection/components/tag/tag.js +0 -272
  91. package/dist/collection/components/tag/tag.js.map +0 -1
  92. package/dist/collection/components/textarea/textarea.css +0 -526
  93. package/dist/collection/components/textarea/textarea.js +0 -316
  94. package/dist/collection/components/textarea/textarea.js.map +0 -1
  95. package/dist/collection/components/upload/upload.css +0 -570
  96. package/dist/collection/components/upload/upload.js +0 -479
  97. package/dist/collection/components/upload/upload.js.map +0 -1
  98. package/dist/collection/index.js +0 -2
  99. package/dist/collection/index.js.map +0 -1
  100. package/dist/collection/pages/components/button/index.js +0 -18
  101. package/dist/collection/pages/components/checkbox/index.js +0 -18
  102. package/dist/collection/pages/components/checkgroup/index.js +0 -20
  103. package/dist/collection/pages/components/dropdown/index.js +0 -18
  104. package/dist/collection/pages/components/icon/index.js +0 -18
  105. package/dist/collection/pages/components/input/index.js +0 -27
  106. package/dist/collection/pages/components/item/index.js +0 -18
  107. package/dist/collection/pages/components/list/index.js +0 -19
  108. package/dist/collection/pages/components/message/index.js +0 -18
  109. package/dist/collection/pages/components/radio/index.js +0 -18
  110. package/dist/collection/pages/components/select/index.js +0 -18
  111. package/dist/collection/pages/components/switch/index.js +0 -18
  112. package/dist/collection/pages/components/tag/index.js +0 -18
  113. package/dist/collection/pages/components/textarea/index.js +0 -19
  114. package/dist/collection/pages/components/upload/index.js +0 -19
  115. package/dist/collection/pages/scripts/menu.js +0 -241
  116. package/dist/collection/pages/scripts/pageLoader.js +0 -180
  117. package/dist/collection/utils/inherited-attributes.js +0 -102
  118. package/dist/collection/utils/inherited-attributes.js.map +0 -1
  119. package/dist/collection/utils/interfaces.js +0 -2
  120. package/dist/collection/utils/interfaces.js.map +0 -1
  121. package/dist/collection/utils/unique-id-generator.js +0 -13
  122. package/dist/collection/utils/unique-id-generator.js.map +0 -1
  123. package/dist/components/br-avatar.d.ts +0 -11
  124. package/dist/components/br-avatar.js +0 -6
  125. package/dist/components/br-avatar.js.map +0 -1
  126. package/dist/components/br-button.d.ts +0 -11
  127. package/dist/components/br-button.js +0 -6
  128. package/dist/components/br-button.js.map +0 -1
  129. package/dist/components/br-checkbox.d.ts +0 -11
  130. package/dist/components/br-checkbox.js +0 -6
  131. package/dist/components/br-checkbox.js.map +0 -1
  132. package/dist/components/br-checkgroup.d.ts +0 -11
  133. package/dist/components/br-checkgroup.js +0 -6
  134. package/dist/components/br-checkgroup.js.map +0 -1
  135. package/dist/components/br-dropdown.d.ts +0 -11
  136. package/dist/components/br-dropdown.js +0 -6
  137. package/dist/components/br-dropdown.js.map +0 -1
  138. package/dist/components/br-icon.d.ts +0 -11
  139. package/dist/components/br-icon.js +0 -6
  140. package/dist/components/br-icon.js.map +0 -1
  141. package/dist/components/br-input.d.ts +0 -11
  142. package/dist/components/br-input.js +0 -6
  143. package/dist/components/br-input.js.map +0 -1
  144. package/dist/components/br-item.d.ts +0 -11
  145. package/dist/components/br-item.js +0 -6
  146. package/dist/components/br-item.js.map +0 -1
  147. package/dist/components/br-list.d.ts +0 -11
  148. package/dist/components/br-list.js +0 -6
  149. package/dist/components/br-list.js.map +0 -1
  150. package/dist/components/br-loading.d.ts +0 -11
  151. package/dist/components/br-loading.js +0 -6
  152. package/dist/components/br-loading.js.map +0 -1
  153. package/dist/components/br-message.d.ts +0 -11
  154. package/dist/components/br-message.js +0 -6
  155. package/dist/components/br-message.js.map +0 -1
  156. package/dist/components/br-radio.d.ts +0 -11
  157. package/dist/components/br-radio.js +0 -6
  158. package/dist/components/br-radio.js.map +0 -1
  159. package/dist/components/br-select.d.ts +0 -11
  160. package/dist/components/br-select.js +0 -6
  161. package/dist/components/br-select.js.map +0 -1
  162. package/dist/components/br-switch.d.ts +0 -11
  163. package/dist/components/br-switch.js +0 -6
  164. package/dist/components/br-switch.js.map +0 -1
  165. package/dist/components/br-tag.d.ts +0 -11
  166. package/dist/components/br-tag.js +0 -6
  167. package/dist/components/br-tag.js.map +0 -1
  168. package/dist/components/br-textarea.d.ts +0 -11
  169. package/dist/components/br-textarea.js +0 -6
  170. package/dist/components/br-textarea.js.map +0 -1
  171. package/dist/components/br-upload.d.ts +0 -11
  172. package/dist/components/br-upload.js +0 -6
  173. package/dist/components/br-upload.js.map +0 -1
  174. package/dist/components/index.d.ts +0 -33
  175. package/dist/components/index.js +0 -6
  176. package/dist/components/index.js.map +0 -1
  177. package/dist/components/p-126ad66d.js +0 -17
  178. package/dist/components/p-126ad66d.js.map +0 -1
  179. package/dist/components/p-184a3074.js +0 -6
  180. package/dist/components/p-184a3074.js.map +0 -1
  181. package/dist/components/p-5cb170a7.js +0 -6
  182. package/dist/components/p-5cb170a7.js.map +0 -1
  183. package/dist/components/p-65616dbd.js +0 -7
  184. package/dist/components/p-65616dbd.js.map +0 -1
  185. package/dist/components/p-65c54cc8.js +0 -6
  186. package/dist/components/p-65c54cc8.js.map +0 -1
  187. package/dist/components/p-74a4eb38.js +0 -6
  188. package/dist/components/p-74a4eb38.js.map +0 -1
  189. package/dist/components/p-a6dcabb0.js +0 -6
  190. package/dist/components/p-a6dcabb0.js.map +0 -1
  191. package/dist/components/p-ace62688.js +0 -6
  192. package/dist/components/p-ace62688.js.map +0 -1
  193. package/dist/components/p-d5a8d30c.js +0 -6
  194. package/dist/components/p-d5a8d30c.js.map +0 -1
  195. package/dist/esm/app-globals-72548b13.js +0 -9
  196. package/dist/esm/app-globals-72548b13.js.map +0 -1
  197. package/dist/esm/br-avatar.entry.js +0 -73
  198. package/dist/esm/br-avatar.entry.js.map +0 -1
  199. package/dist/esm/br-button_2.entry.js +0 -2605
  200. package/dist/esm/br-button_2.entry.js.map +0 -1
  201. package/dist/esm/br-checkbox.entry.js +0 -72
  202. package/dist/esm/br-checkbox.entry.js.map +0 -1
  203. package/dist/esm/br-checkgroup.entry.js +0 -97
  204. package/dist/esm/br-checkgroup.entry.js.map +0 -1
  205. package/dist/esm/br-dropdown.entry.js +0 -96
  206. package/dist/esm/br-dropdown.entry.js.map +0 -1
  207. package/dist/esm/br-input_3.entry.js +0 -278
  208. package/dist/esm/br-input_3.entry.js.map +0 -1
  209. package/dist/esm/br-item.entry.js +0 -162
  210. package/dist/esm/br-item.entry.js.map +0 -1
  211. package/dist/esm/br-loading.entry.js +0 -39
  212. package/dist/esm/br-loading.entry.js.map +0 -1
  213. package/dist/esm/br-message.entry.js +0 -64
  214. package/dist/esm/br-message.entry.js.map +0 -1
  215. package/dist/esm/br-select.entry.js +0 -277
  216. package/dist/esm/br-select.entry.js.map +0 -1
  217. package/dist/esm/br-switch.entry.js +0 -80
  218. package/dist/esm/br-switch.entry.js.map +0 -1
  219. package/dist/esm/br-tag.entry.js +0 -84
  220. package/dist/esm/br-tag.entry.js.map +0 -1
  221. package/dist/esm/br-textarea.entry.js +0 -98
  222. package/dist/esm/br-textarea.entry.js.map +0 -1
  223. package/dist/esm/br-upload.entry.js +0 -164
  224. package/dist/esm/br-upload.entry.js.map +0 -1
  225. package/dist/esm/index-45af9b53.js +0 -2061
  226. package/dist/esm/index-45af9b53.js.map +0 -1
  227. package/dist/esm/index.js +0 -6
  228. package/dist/esm/index.js.map +0 -1
  229. package/dist/esm/inherited-attributes-553a7c36.js +0 -105
  230. package/dist/esm/inherited-attributes-553a7c36.js.map +0 -1
  231. package/dist/esm/loader.js +0 -17
  232. package/dist/esm/loader.js.map +0 -1
  233. package/dist/esm/polyfills/core-js.js +0 -11
  234. package/dist/esm/polyfills/dom.js +0 -79
  235. package/dist/esm/polyfills/es5-html-element.js +0 -1
  236. package/dist/esm/polyfills/index.js +0 -34
  237. package/dist/esm/polyfills/system.js +0 -6
  238. package/dist/esm/v4-c99c1585.js +0 -72
  239. package/dist/esm/v4-c99c1585.js.map +0 -1
  240. package/dist/esm/webcomponents.js +0 -47
  241. package/dist/esm/webcomponents.js.map +0 -1
  242. package/dist/esm-es5/app-globals-72548b13.js +0 -6
  243. package/dist/esm-es5/app-globals-72548b13.js.map +0 -1
  244. package/dist/esm-es5/br-avatar.entry.js +0 -6
  245. package/dist/esm-es5/br-avatar.entry.js.map +0 -1
  246. package/dist/esm-es5/br-button_2.entry.js +0 -17
  247. package/dist/esm-es5/br-button_2.entry.js.map +0 -1
  248. package/dist/esm-es5/br-checkbox.entry.js +0 -6
  249. package/dist/esm-es5/br-checkbox.entry.js.map +0 -1
  250. package/dist/esm-es5/br-checkgroup.entry.js +0 -6
  251. package/dist/esm-es5/br-checkgroup.entry.js.map +0 -1
  252. package/dist/esm-es5/br-dropdown.entry.js +0 -6
  253. package/dist/esm-es5/br-dropdown.entry.js.map +0 -1
  254. package/dist/esm-es5/br-input_3.entry.js +0 -6
  255. package/dist/esm-es5/br-input_3.entry.js.map +0 -1
  256. package/dist/esm-es5/br-item.entry.js +0 -6
  257. package/dist/esm-es5/br-item.entry.js.map +0 -1
  258. package/dist/esm-es5/br-loading.entry.js +0 -6
  259. package/dist/esm-es5/br-loading.entry.js.map +0 -1
  260. package/dist/esm-es5/br-message.entry.js +0 -6
  261. package/dist/esm-es5/br-message.entry.js.map +0 -1
  262. package/dist/esm-es5/br-select.entry.js +0 -6
  263. package/dist/esm-es5/br-select.entry.js.map +0 -1
  264. package/dist/esm-es5/br-switch.entry.js +0 -6
  265. package/dist/esm-es5/br-switch.entry.js.map +0 -1
  266. package/dist/esm-es5/br-tag.entry.js +0 -6
  267. package/dist/esm-es5/br-tag.entry.js.map +0 -1
  268. package/dist/esm-es5/br-textarea.entry.js +0 -6
  269. package/dist/esm-es5/br-textarea.entry.js.map +0 -1
  270. package/dist/esm-es5/br-upload.entry.js +0 -6
  271. package/dist/esm-es5/br-upload.entry.js.map +0 -1
  272. package/dist/esm-es5/index-45af9b53.js +0 -6
  273. package/dist/esm-es5/index-45af9b53.js.map +0 -1
  274. package/dist/esm-es5/index.js +0 -5
  275. package/dist/esm-es5/index.js.map +0 -1
  276. package/dist/esm-es5/inherited-attributes-553a7c36.js +0 -6
  277. package/dist/esm-es5/inherited-attributes-553a7c36.js.map +0 -1
  278. package/dist/esm-es5/loader.js +0 -6
  279. package/dist/esm-es5/loader.js.map +0 -1
  280. package/dist/esm-es5/v4-c99c1585.js +0 -6
  281. package/dist/esm-es5/v4-c99c1585.js.map +0 -1
  282. package/dist/esm-es5/webcomponents.js +0 -6
  283. package/dist/esm-es5/webcomponents.js.map +0 -1
  284. package/dist/index.cjs.js +0 -1
  285. package/dist/index.js +0 -1
  286. package/dist/types/components/avatar/avatar.d.ts +0 -60
  287. package/dist/types/components/button/button.d.ts +0 -64
  288. package/dist/types/components/checkbox/checkbox.d.ts +0 -78
  289. package/dist/types/components/checkgroup/checkgroup.d.ts +0 -52
  290. package/dist/types/components/dropdown/dropdown.d.ts +0 -64
  291. package/dist/types/components/icon/icon.d.ts +0 -58
  292. package/dist/types/components/input/input.d.ts +0 -151
  293. package/dist/types/components/item/item.d.ts +0 -98
  294. package/dist/types/components/list/list.d.ts +0 -34
  295. package/dist/types/components/loading/loading.d.ts +0 -34
  296. package/dist/types/components/message/message.d.ts +0 -62
  297. package/dist/types/components/radio/radio.d.ts +0 -75
  298. package/dist/types/components/select/select.d.ts +0 -98
  299. package/dist/types/components/switch/switch.d.ts +0 -79
  300. package/dist/types/components/tag/tag.d.ts +0 -73
  301. package/dist/types/components/textarea/textarea.d.ts +0 -66
  302. package/dist/types/components/upload/upload.d.ts +0 -160
  303. package/dist/types/components.d.ts +0 -1847
  304. package/dist/types/index.d.ts +0 -10
  305. package/dist/types/stencil-public-runtime.d.ts +0 -1680
  306. package/dist/types/utils/inherited-attributes.d.ts +0 -20
  307. package/dist/types/utils/interfaces.d.ts +0 -3
  308. package/dist/types/utils/unique-id-generator.d.ts +0 -1
  309. package/dist/webcomponents/index.esm.js +0 -6
  310. package/dist/webcomponents/index.esm.js.map +0 -1
  311. package/dist/webcomponents/p-04a3d24e.system.entry.js +0 -6
  312. package/dist/webcomponents/p-04a3d24e.system.entry.js.map +0 -1
  313. package/dist/webcomponents/p-057dcb7c.system.entry.js +0 -6
  314. package/dist/webcomponents/p-057dcb7c.system.entry.js.map +0 -1
  315. package/dist/webcomponents/p-19b77f11.entry.js +0 -6
  316. package/dist/webcomponents/p-19b77f11.entry.js.map +0 -1
  317. package/dist/webcomponents/p-1acbc680.entry.js +0 -6
  318. package/dist/webcomponents/p-1acbc680.entry.js.map +0 -1
  319. package/dist/webcomponents/p-254a2b7c.js +0 -6
  320. package/dist/webcomponents/p-254a2b7c.js.map +0 -1
  321. package/dist/webcomponents/p-25d82c85.system.entry.js +0 -6
  322. package/dist/webcomponents/p-25d82c85.system.entry.js.map +0 -1
  323. package/dist/webcomponents/p-27b820ac.system.entry.js +0 -6
  324. package/dist/webcomponents/p-27b820ac.system.entry.js.map +0 -1
  325. package/dist/webcomponents/p-2b0430f4.entry.js +0 -6
  326. package/dist/webcomponents/p-2b0430f4.entry.js.map +0 -1
  327. package/dist/webcomponents/p-2ff5f694.system.entry.js +0 -6
  328. package/dist/webcomponents/p-2ff5f694.system.entry.js.map +0 -1
  329. package/dist/webcomponents/p-357e1105.system.entry.js +0 -6
  330. package/dist/webcomponents/p-357e1105.system.entry.js.map +0 -1
  331. package/dist/webcomponents/p-35f07e4b.entry.js +0 -6
  332. package/dist/webcomponents/p-35f07e4b.entry.js.map +0 -1
  333. package/dist/webcomponents/p-3e449bd5.system.entry.js +0 -6
  334. package/dist/webcomponents/p-3e449bd5.system.entry.js.map +0 -1
  335. package/dist/webcomponents/p-46a75920.system.js +0 -6
  336. package/dist/webcomponents/p-46a75920.system.js.map +0 -1
  337. package/dist/webcomponents/p-491cdd00.entry.js +0 -6
  338. package/dist/webcomponents/p-491cdd00.entry.js.map +0 -1
  339. package/dist/webcomponents/p-52e5bcdd.entry.js +0 -6
  340. package/dist/webcomponents/p-52e5bcdd.entry.js.map +0 -1
  341. package/dist/webcomponents/p-60879543.system.entry.js +0 -6
  342. package/dist/webcomponents/p-60879543.system.entry.js.map +0 -1
  343. package/dist/webcomponents/p-6bfb8eb6.entry.js +0 -6
  344. package/dist/webcomponents/p-6bfb8eb6.entry.js.map +0 -1
  345. package/dist/webcomponents/p-6d0d2846.system.js +0 -7
  346. package/dist/webcomponents/p-6d0d2846.system.js.map +0 -1
  347. package/dist/webcomponents/p-6e286eba.system.js +0 -6
  348. package/dist/webcomponents/p-6e286eba.system.js.map +0 -1
  349. package/dist/webcomponents/p-74a4eb38.js +0 -6
  350. package/dist/webcomponents/p-74a4eb38.js.map +0 -1
  351. package/dist/webcomponents/p-7c3554a7.system.entry.js +0 -17
  352. package/dist/webcomponents/p-7c3554a7.system.entry.js.map +0 -1
  353. package/dist/webcomponents/p-8fd11f97.system.entry.js +0 -6
  354. package/dist/webcomponents/p-8fd11f97.system.entry.js.map +0 -1
  355. package/dist/webcomponents/p-907fab5d.entry.js +0 -6
  356. package/dist/webcomponents/p-907fab5d.entry.js.map +0 -1
  357. package/dist/webcomponents/p-90e2e623.system.js +0 -6
  358. package/dist/webcomponents/p-90e2e623.system.js.map +0 -1
  359. package/dist/webcomponents/p-929db2b8.entry.js +0 -17
  360. package/dist/webcomponents/p-929db2b8.entry.js.map +0 -1
  361. package/dist/webcomponents/p-98e6f0c1.system.entry.js +0 -6
  362. package/dist/webcomponents/p-98e6f0c1.system.entry.js.map +0 -1
  363. package/dist/webcomponents/p-9b0f20d7.entry.js +0 -6
  364. package/dist/webcomponents/p-9b0f20d7.entry.js.map +0 -1
  365. package/dist/webcomponents/p-a71689a5.system.js +0 -6
  366. package/dist/webcomponents/p-a71689a5.system.js.map +0 -1
  367. package/dist/webcomponents/p-ad5a7b8b.system.entry.js +0 -6
  368. package/dist/webcomponents/p-ad5a7b8b.system.entry.js.map +0 -1
  369. package/dist/webcomponents/p-c3811f09.js +0 -7
  370. package/dist/webcomponents/p-c3811f09.js.map +0 -1
  371. package/dist/webcomponents/p-c6a9c8ac.entry.js +0 -6
  372. package/dist/webcomponents/p-c6a9c8ac.entry.js.map +0 -1
  373. package/dist/webcomponents/p-d46495d5.system.entry.js +0 -6
  374. package/dist/webcomponents/p-d46495d5.system.entry.js.map +0 -1
  375. package/dist/webcomponents/p-d5a8d30c.js +0 -6
  376. package/dist/webcomponents/p-d5a8d30c.js.map +0 -1
  377. package/dist/webcomponents/p-dc3d284a.entry.js +0 -6
  378. package/dist/webcomponents/p-dc3d284a.entry.js.map +0 -1
  379. package/dist/webcomponents/p-e751c991.system.js +0 -6
  380. package/dist/webcomponents/p-e751c991.system.js.map +0 -1
  381. package/dist/webcomponents/p-e98418a4.entry.js +0 -6
  382. package/dist/webcomponents/p-e98418a4.entry.js.map +0 -1
  383. package/dist/webcomponents/p-ef89bcc9.system.entry.js +0 -6
  384. package/dist/webcomponents/p-ef89bcc9.system.entry.js.map +0 -1
  385. package/dist/webcomponents/p-fc11eac9.entry.js +0 -6
  386. package/dist/webcomponents/p-fc11eac9.entry.js.map +0 -1
  387. package/dist/webcomponents/webcomponents.esm.js +0 -6
  388. package/dist/webcomponents/webcomponents.esm.js.map +0 -1
  389. package/dist/webcomponents/webcomponents.js +0 -127
  390. package/hydrate/index.d.ts +0 -242
  391. package/hydrate/index.js +0 -22909
  392. package/hydrate/index.mjs +0 -22901
  393. package/hydrate/package.json +0 -12
  394. package/loader/cdn.js +0 -6
  395. package/loader/index.cjs.js +0 -6
  396. package/loader/index.d.ts +0 -24
  397. package/loader/index.es2017.js +0 -6
  398. package/loader/index.js +0 -7
  399. package/loader/package.json +0 -11
  400. package/vscode-data.json +0 -985
@@ -1,2610 +0,0 @@
1
- /*!
2
- * Construído com @govbr-ds/webcomponents
3
- * Padrão Digital de Governo.
4
- */
5
- 'use strict';
6
-
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
-
9
- const index = require('./index-4fc1aab1.js');
10
- const inheritedAttributes = require('./inherited-attributes-16f7d388.js');
11
-
12
- const buttonCss = "*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;-moz-appearance:button;appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}[hidden]{display:none}.d-flex{display:-ms-flexbox !important;display:flex !important}.align-items-center{-ms-flex-align:center !important;align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter) * 0.5);padding-right:calc(var(--grid-gutter) * 0.5);width:100%}.col{-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.container{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter) * -0.5);margin-right:calc(var(--grid-gutter) * -0.5)}@media (min-width: 576px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width: 992px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width: 1600px){.container{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.mr-2{margin-right:var(--spacing-scale-base) !important}.mr-n2{margin-right:calc(var(--spacing-scale-base) * -1) !important}.ml-2{margin-left:var(--spacing-scale-base) !important}.mb-3{margin-bottom:var(--spacing-scale-2x) !important}.mr-auto{margin-right:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.py-3{padding-bottom:var(--spacing-scale-2x) !important;padding-top:var(--spacing-scale-2x) !important}.py-4{padding-bottom:var(--spacing-scale-3x) !important;padding-top:var(--spacing-scale-3x) !important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}:-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.text-pure-0{color:var(--pure-0) !important}.text-primary-default{color:var(--color-primary-default) !important}.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-support-01) !important}.text-nowrap{white-space:nowrap !important}.text-base{font-size:var(--font-size-scale-base) !important}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear, left top, left bottom, from(var(--status-highlight-overlay)), to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.br-button{--button-radius:100em;--button-xsmall:24px;--button-small:32px;--button-medium:40px;--button-large:48px;--button-size:var(--button-medium);-ms-flex-align:center;align-items:center;background-color:transparent;border:0;border-radius:var(--button-radius);color:var(--interactive);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);height:var(--button-size);-ms-flex-pack:center;justify-content:center;overflow:hidden;padding:0 var(--spacing-scale-3x);position:relative;text-align:center;vertical-align:middle;white-space:nowrap;width:auto}.br-button.block{width:100%}.br-button.circle,.br-button[circle]{border-radius:50%;padding:0;width:var(--button-size)}.br-button.small,.br-button[small]{--button-size:var(--button-small)}.br-button.medium,.br-button[medium],.br-button.is-medium{--button-size:var(--button-medium)}.br-button.large,.br-button[large]{--button-size:var(--button-large)}.br-button.primary,.br-button[primary]{--interactive-rgb:var(--color-dark-rgb);background-color:var(--interactive-light);color:var(--color-dark)}.br-button.secondary,.br-button[secondary]{background-color:var(--background-light);border:1px solid var(--interactive)}.br-button.danger,.br-button[danger]{background-color:var(--danger);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button.success,.br-button[success]{background-color:var(--success);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button.warning,.br-button[warning]{background-color:var(--warning);--interactive-rgb:var(--color-light-rgb);color:var(--color-light)}.br-button.info,.br-button[info]{background-color:var(--info);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button:disabled{cursor:not-allowed}.br-button:not(:disabled){--focus-offset:var(--spacing-scale-half)}.br-button:not(:disabled):focus{outline:none}.br-button:not(:disabled):focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}.br-button:not(:disabled):not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-button:not(:disabled):not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}.br-button.active,.br-button.is-active,.br-button[active]{--hover:var(--hover-dark);background-color:var(--active);color:var(--color-dark)}.br-button.loading{color:transparent !important;cursor:progress}.br-button.loading:not(:disabled):hover{background-image:none}.br-button.loading::before{border-color:var(--interactive) var(--interactive) transparent;border-style:solid}.br-button.loading.primary::before,.br-button.loading.danger::before,.br-button.loading.success::before,.br-button.loading.info::before{border-color:var(--background) var(--background) transparent}.br-button.dark-mode{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);color:var(--interactive-dark)}.br-button.dark-mode.primary,.br-button.dark-mode[primary]{--interactive-rgb:var(--background-dark-rgb);background-color:var(--interactive-dark);color:var(--background-dark)}.br-button.dark-mode.secondary,.br-button.dark-mode[secondary]{background-color:var(--background-dark)}.br-button.dark-mode.active{--hover:var(--hover-light);--interactive-rgb:var(--active-rgb);background-color:var(--background-light);color:var(--active)}a.br-button{font-weight:var(--font-weight-semi-bold);text-decoration:none !important}.loading,.br-loading{--loading-size:var(--loading-indetermined-diameter-sm);--loading-diameter:84px;--loading-stroke:5px;--loading-indetermined-color:var(--interactive);--loading-indetermined-diameter-md:44px;--loading-indetermined-diameter-sm:24px;position:relative;z-index:var(--z-index-layer-4)}.loading[data-progress]:not(:empty),.br-loading[data-progress]:not(:empty){background-color:var(--border-color);border-radius:50%}.loading[data-progress]:not(:empty)::before,.br-loading[data-progress]:not(:empty)::before{content:none}.loading[data-progress]::after,.br-loading[data-progress]::after{--loading-size:calc(var(--loading-diameter) - var(--loading-stroke) * 2);background:var(--background);border-radius:50%;color:var(--interactive);content:attr(data-progress) \"%\";font-size:var(--font-size-scale-up-02);font-weight:var(--font-weight-semi-bold);height:var(--loading-size);line-height:var(--loading-size);margin:var(--loading-stroke);position:absolute;text-align:center;width:var(--loading-size)}.loading[data-progress] .br-loading-mask,.loading[data-progress] .br-loading-fill,.br-loading[data-progress] .br-loading-mask,.br-loading[data-progress] .br-loading-fill{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;clip:rect(0, var(--loading-diameter), var(--loading-diameter), calc(var(--loading-diameter) * 0.5));height:var(--loading-diameter);overflow:hidden;position:absolute;width:var(--loading-diameter)}.loading[data-progress] .br-loading-fill,.br-loading[data-progress] .br-loading-fill{background:var(--interactive);clip:rect(0, calc(var(--loading-diameter) * 0.5), var(--loading-diameter), 0)}.loading::before,.br-loading::before{-webkit-animation:spinAround 1.3s infinite linear;animation:spinAround 1.3s infinite linear;border:2px solid var(--loading-indetermined-color);border-radius:50%;border-right-color:transparent;content:\"\";display:block;height:var(--loading-size);left:calc(50% - var(--loading-size) * 0.5);position:absolute;top:calc(50% - var(--loading-size) * 0.5);width:var(--loading-size)}.loading:not(.br-button),.br-loading:not(.br-button){height:var(--loading-size);width:var(--loading-size)}.loading:not(.br-button).medium,.br-loading:not(.br-button).medium{--loading-size:var(--loading-indetermined-diameter-md)}.loading:not(.br-button).medium::before,.br-loading:not(.br-button).medium::before{border-width:4px}.loading:not(.br-button)[data-progress],.br-loading:not(.br-button)[data-progress]{--loading-size:var(--loading-diameter)}.loading:not(.br-button)[data-progress]::before,.br-loading:not(.br-button)[data-progress]::before{border-width:var(--loading-stroke)}.loading[data-progress=\"1\"] .br-loading-mask.full,.loading[data-progress=\"1\"] .br-loading-fill,.br-loading[data-progress=\"1\"] .br-loading-mask.full,.br-loading[data-progress=\"1\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(1.8deg);transform:rotate(1.8deg)}.loading[data-progress=\"2\"] .br-loading-mask.full,.loading[data-progress=\"2\"] .br-loading-fill,.br-loading[data-progress=\"2\"] .br-loading-mask.full,.br-loading[data-progress=\"2\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(3.6deg);transform:rotate(3.6deg)}.loading[data-progress=\"3\"] .br-loading-mask.full,.loading[data-progress=\"3\"] .br-loading-fill,.br-loading[data-progress=\"3\"] .br-loading-mask.full,.br-loading[data-progress=\"3\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(5.4deg);transform:rotate(5.4deg)}.loading[data-progress=\"5\"] .br-loading-mask.full,.loading[data-progress=\"5\"] .br-loading-fill,.br-loading[data-progress=\"5\"] .br-loading-mask.full,.br-loading[data-progress=\"5\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(9deg);transform:rotate(9deg)}.loading[data-progress=\"10\"] .br-loading-mask.full,.loading[data-progress=\"10\"] .br-loading-fill,.br-loading[data-progress=\"10\"] .br-loading-mask.full,.br-loading[data-progress=\"10\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(18deg);transform:rotate(18deg)}.loading[data-progress=\"16\"] .br-loading-mask.full,.loading[data-progress=\"16\"] .br-loading-fill,.br-loading[data-progress=\"16\"] .br-loading-mask.full,.br-loading[data-progress=\"16\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(28.8deg);transform:rotate(28.8deg)}.loading[data-progress=\"20\"] .br-loading-mask.full,.loading[data-progress=\"20\"] .br-loading-fill,.br-loading[data-progress=\"20\"] .br-loading-mask.full,.br-loading[data-progress=\"20\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(36deg);transform:rotate(36deg)}.loading[data-progress=\"24\"] .br-loading-mask.full,.loading[data-progress=\"24\"] .br-loading-fill,.br-loading[data-progress=\"24\"] .br-loading-mask.full,.br-loading[data-progress=\"24\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(43.2deg);transform:rotate(43.2deg)}.loading[data-progress=\"48\"] .br-loading-mask.full,.loading[data-progress=\"48\"] .br-loading-fill,.br-loading[data-progress=\"48\"] .br-loading-mask.full,.br-loading[data-progress=\"48\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(86.4deg);transform:rotate(86.4deg)}.loading[data-progress=\"50\"] .br-loading-mask.full,.loading[data-progress=\"50\"] .br-loading-fill,.br-loading[data-progress=\"50\"] .br-loading-mask.full,.br-loading[data-progress=\"50\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.loading[data-progress=\"70\"] .br-loading-mask.full,.loading[data-progress=\"70\"] .br-loading-fill,.br-loading[data-progress=\"70\"] .br-loading-mask.full,.br-loading[data-progress=\"70\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(126deg);transform:rotate(126deg)}.loading[data-progress=\"72\"] .br-loading-mask.full,.loading[data-progress=\"72\"] .br-loading-fill,.br-loading[data-progress=\"72\"] .br-loading-mask.full,.br-loading[data-progress=\"72\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(129.6deg);transform:rotate(129.6deg)}.loading[data-progress=\"100\"] .br-loading-mask.full,.loading[data-progress=\"100\"] .br-loading-fill,.br-loading[data-progress=\"100\"] .br-loading-mask.full,.br-loading[data-progress=\"100\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(180deg);transform:rotate(180deg)}@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes fill{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fill{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}:host{display:block}button{display:-ms-flexbox;display:flex}button.icon-right{-ms-flex-direction:row-reverse;flex-direction:row-reverse}button.icon-left{-ms-flex-direction:row;flex-direction:row}";
13
- const BrButtonStyle0 = buttonCss;
14
-
15
- const Button = class {
16
- constructor(hostRef) {
17
- index.registerInstance(this, hostRef);
18
- if (hostRef.$hostElement$["s-ei"]) {
19
- this.elementInternals = hostRef.$hostElement$["s-ei"];
20
- }
21
- else {
22
- this.elementInternals = hostRef.$hostElement$.attachInternals();
23
- hostRef.$hostElement$["s-ei"] = this.elementInternals;
24
- }
25
- this.handleClick = () => {
26
- if (this.type === 'submit') {
27
- const submitEvent = new SubmitEvent('submit', {
28
- submitter: this.elementInternals.form,
29
- composed: true,
30
- cancelable: true,
31
- bubbles: true,
32
- });
33
- this.elementInternals.form.dispatchEvent(submitEvent);
34
- }
35
- if (this.type === 'reset') {
36
- this.elementInternals.form.reset();
37
- }
38
- };
39
- this.inheritedAttributes = {};
40
- this.colorMode = undefined;
41
- this.density = 'medium';
42
- this.disabled = false;
43
- this.emphasis = undefined;
44
- this.isActive = false;
45
- this.isLoading = false;
46
- this.shape = undefined;
47
- this.type = undefined;
48
- this.value = undefined;
49
- }
50
- componentWillLoad() {
51
- this.inheritedAttributes = inheritedAttributes.inheritAriaAttributes(this.el);
52
- }
53
- getCssClassMap() {
54
- return {
55
- 'br-button': true,
56
- primary: this.emphasis === 'primary',
57
- secondary: this.emphasis === 'secondary',
58
- large: this.density === 'large',
59
- small: this.density === 'small',
60
- block: this.shape === 'block',
61
- circle: this.shape === 'circle',
62
- active: this.isActive,
63
- loading: this.isLoading,
64
- 'dark-mode': this.colorMode === 'dark',
65
- };
66
- }
67
- render() {
68
- return (index.h(index.Host, { key: '163d419411ac143f3743228d16fe833aa1b71c30', "aria-disabled": this.disabled ? 'true' : null }, index.h("button", Object.assign({ key: 'b461c13bea0b05b7c20dcc62ecbb74c96b9d5097', class: this.getCssClassMap(), type: this.type, disabled: this.disabled, value: this.value, onClick: this.handleClick }, this.inheritedAttributes), index.h("slot", { key: '50e37710881cb6c421184e5fede1888985c19e64' }))));
69
- }
70
- static get formAssociated() { return true; }
71
- get el() { return index.getElement(this); }
72
- };
73
- Button.style = BrButtonStyle0;
74
-
75
- /**
76
- * (c) Iconify
77
- *
78
- * For the full copyright and license information, please view the license.txt
79
- * files at https://github.com/iconify/iconify
80
- *
81
- * Licensed under MIT.
82
- *
83
- * @license MIT
84
- * @version 2.2.0
85
- */
86
- const defaultIconDimensions = Object.freeze(
87
- {
88
- left: 0,
89
- top: 0,
90
- width: 16,
91
- height: 16
92
- }
93
- );
94
- const defaultIconTransformations = Object.freeze({
95
- rotate: 0,
96
- vFlip: false,
97
- hFlip: false
98
- });
99
- const defaultIconProps = Object.freeze({
100
- ...defaultIconDimensions,
101
- ...defaultIconTransformations
102
- });
103
- const defaultExtendedIconProps = Object.freeze({
104
- ...defaultIconProps,
105
- body: "",
106
- hidden: false
107
- });
108
-
109
- const defaultIconSizeCustomisations = Object.freeze({
110
- width: null,
111
- height: null
112
- });
113
- const defaultIconCustomisations = Object.freeze({
114
- // Dimensions
115
- ...defaultIconSizeCustomisations,
116
- // Transformations
117
- ...defaultIconTransformations
118
- });
119
-
120
- function rotateFromString(value, defaultValue = 0) {
121
- const units = value.replace(/^-?[0-9.]*/, "");
122
- function cleanup(value2) {
123
- while (value2 < 0) {
124
- value2 += 4;
125
- }
126
- return value2 % 4;
127
- }
128
- if (units === "") {
129
- const num = parseInt(value);
130
- return isNaN(num) ? 0 : cleanup(num);
131
- } else if (units !== value) {
132
- let split = 0;
133
- switch (units) {
134
- case "%":
135
- split = 25;
136
- break;
137
- case "deg":
138
- split = 90;
139
- }
140
- if (split) {
141
- let num = parseFloat(value.slice(0, value.length - units.length));
142
- if (isNaN(num)) {
143
- return 0;
144
- }
145
- num = num / split;
146
- return num % 1 === 0 ? cleanup(num) : 0;
147
- }
148
- }
149
- return defaultValue;
150
- }
151
-
152
- const separator = /[\s,]+/;
153
- function flipFromString(custom, flip) {
154
- flip.split(separator).forEach((str) => {
155
- const value = str.trim();
156
- switch (value) {
157
- case "horizontal":
158
- custom.hFlip = true;
159
- break;
160
- case "vertical":
161
- custom.vFlip = true;
162
- break;
163
- }
164
- });
165
- }
166
-
167
- const defaultCustomisations = {
168
- ...defaultIconCustomisations,
169
- preserveAspectRatio: '',
170
- };
171
- /**
172
- * Get customisations
173
- */
174
- function getCustomisations(node) {
175
- const customisations = {
176
- ...defaultCustomisations,
177
- };
178
- const attr = (key, def) => node.getAttribute(key) || def;
179
- // Dimensions
180
- customisations.width = attr('width', null);
181
- customisations.height = attr('height', null);
182
- // Rotation
183
- customisations.rotate = rotateFromString(attr('rotate', ''));
184
- // Flip
185
- flipFromString(customisations, attr('flip', ''));
186
- // SVG attributes
187
- customisations.preserveAspectRatio = attr('preserveAspectRatio', attr('preserveaspectratio', ''));
188
- return customisations;
189
- }
190
- /**
191
- * Check if customisations have been updated
192
- */
193
- function haveCustomisationsChanged(value1, value2) {
194
- for (const key in defaultCustomisations) {
195
- if (value1[key] !== value2[key]) {
196
- return true;
197
- }
198
- }
199
- return false;
200
- }
201
-
202
- const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
203
- const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
204
- const colonSeparated = value.split(":");
205
- if (value.slice(0, 1) === "@") {
206
- if (colonSeparated.length < 2 || colonSeparated.length > 3) {
207
- return null;
208
- }
209
- provider = colonSeparated.shift().slice(1);
210
- }
211
- if (colonSeparated.length > 3 || !colonSeparated.length) {
212
- return null;
213
- }
214
- if (colonSeparated.length > 1) {
215
- const name2 = colonSeparated.pop();
216
- const prefix = colonSeparated.pop();
217
- const result = {
218
- // Allow provider without '@': "provider:prefix:name"
219
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
220
- prefix,
221
- name: name2
222
- };
223
- return validate && !validateIconName(result) ? null : result;
224
- }
225
- const name = colonSeparated[0];
226
- const dashSeparated = name.split("-");
227
- if (dashSeparated.length > 1) {
228
- const result = {
229
- provider,
230
- prefix: dashSeparated.shift(),
231
- name: dashSeparated.join("-")
232
- };
233
- return validate && !validateIconName(result) ? null : result;
234
- }
235
- if (allowSimpleName && provider === "") {
236
- const result = {
237
- provider,
238
- prefix: "",
239
- name
240
- };
241
- return validate && !validateIconName(result, allowSimpleName) ? null : result;
242
- }
243
- return null;
244
- };
245
- const validateIconName = (icon, allowSimpleName) => {
246
- if (!icon) {
247
- return false;
248
- }
249
- return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
250
- // Check name: cannot be empty
251
- ((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
252
- };
253
-
254
- function mergeIconTransformations(obj1, obj2) {
255
- const result = {};
256
- if (!obj1.hFlip !== !obj2.hFlip) {
257
- result.hFlip = true;
258
- }
259
- if (!obj1.vFlip !== !obj2.vFlip) {
260
- result.vFlip = true;
261
- }
262
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
263
- if (rotate) {
264
- result.rotate = rotate;
265
- }
266
- return result;
267
- }
268
-
269
- function mergeIconData(parent, child) {
270
- const result = mergeIconTransformations(parent, child);
271
- for (const key in defaultExtendedIconProps) {
272
- if (key in defaultIconTransformations) {
273
- if (key in parent && !(key in result)) {
274
- result[key] = defaultIconTransformations[key];
275
- }
276
- } else if (key in child) {
277
- result[key] = child[key];
278
- } else if (key in parent) {
279
- result[key] = parent[key];
280
- }
281
- }
282
- return result;
283
- }
284
-
285
- function getIconsTree(data, names) {
286
- const icons = data.icons;
287
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
288
- const resolved = /* @__PURE__ */ Object.create(null);
289
- function resolve(name) {
290
- if (icons[name]) {
291
- return resolved[name] = [];
292
- }
293
- if (!(name in resolved)) {
294
- resolved[name] = null;
295
- const parent = aliases[name] && aliases[name].parent;
296
- const value = parent && resolve(parent);
297
- if (value) {
298
- resolved[name] = [parent].concat(value);
299
- }
300
- }
301
- return resolved[name];
302
- }
303
- (Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
304
- return resolved;
305
- }
306
-
307
- function internalGetIconData(data, name, tree) {
308
- const icons = data.icons;
309
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
310
- let currentProps = {};
311
- function parse(name2) {
312
- currentProps = mergeIconData(
313
- icons[name2] || aliases[name2],
314
- currentProps
315
- );
316
- }
317
- parse(name);
318
- tree.forEach(parse);
319
- return mergeIconData(data, currentProps);
320
- }
321
-
322
- function parseIconSet(data, callback) {
323
- const names = [];
324
- if (typeof data !== "object" || typeof data.icons !== "object") {
325
- return names;
326
- }
327
- if (data.not_found instanceof Array) {
328
- data.not_found.forEach((name) => {
329
- callback(name, null);
330
- names.push(name);
331
- });
332
- }
333
- const tree = getIconsTree(data);
334
- for (const name in tree) {
335
- const item = tree[name];
336
- if (item) {
337
- callback(name, internalGetIconData(data, name, item));
338
- names.push(name);
339
- }
340
- }
341
- return names;
342
- }
343
-
344
- const optionalPropertyDefaults = {
345
- provider: "",
346
- aliases: {},
347
- not_found: {},
348
- ...defaultIconDimensions
349
- };
350
- function checkOptionalProps(item, defaults) {
351
- for (const prop in defaults) {
352
- if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
353
- return false;
354
- }
355
- }
356
- return true;
357
- }
358
- function quicklyValidateIconSet(obj) {
359
- if (typeof obj !== "object" || obj === null) {
360
- return null;
361
- }
362
- const data = obj;
363
- if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
364
- return null;
365
- }
366
- if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
367
- return null;
368
- }
369
- const icons = data.icons;
370
- for (const name in icons) {
371
- const icon = icons[name];
372
- if (
373
- // Name cannot be empty
374
- !name || // Must have body
375
- typeof icon.body !== "string" || // Check other props
376
- !checkOptionalProps(
377
- icon,
378
- defaultExtendedIconProps
379
- )
380
- ) {
381
- return null;
382
- }
383
- }
384
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
385
- for (const name in aliases) {
386
- const icon = aliases[name];
387
- const parent = icon.parent;
388
- if (
389
- // Name cannot be empty
390
- !name || // Parent must be set and point to existing icon
391
- typeof parent !== "string" || !icons[parent] && !aliases[parent] || // Check other props
392
- !checkOptionalProps(
393
- icon,
394
- defaultExtendedIconProps
395
- )
396
- ) {
397
- return null;
398
- }
399
- }
400
- return data;
401
- }
402
-
403
- const dataStorage = /* @__PURE__ */ Object.create(null);
404
- function newStorage(provider, prefix) {
405
- return {
406
- provider,
407
- prefix,
408
- icons: /* @__PURE__ */ Object.create(null),
409
- missing: /* @__PURE__ */ new Set()
410
- };
411
- }
412
- function getStorage(provider, prefix) {
413
- const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
414
- return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
415
- }
416
- function addIconSet(storage, data) {
417
- if (!quicklyValidateIconSet(data)) {
418
- return [];
419
- }
420
- return parseIconSet(data, (name, icon) => {
421
- if (icon) {
422
- storage.icons[name] = icon;
423
- } else {
424
- storage.missing.add(name);
425
- }
426
- });
427
- }
428
- function addIconToStorage(storage, name, icon) {
429
- try {
430
- if (typeof icon.body === "string") {
431
- storage.icons[name] = { ...icon };
432
- return true;
433
- }
434
- } catch (err) {
435
- }
436
- return false;
437
- }
438
- function listIcons$1(provider, prefix) {
439
- let allIcons = [];
440
- const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
441
- providers.forEach((provider2) => {
442
- const prefixes = typeof provider2 === "string" && typeof prefix === "string" ? [prefix] : Object.keys(dataStorage[provider2] || {});
443
- prefixes.forEach((prefix2) => {
444
- const storage = getStorage(provider2, prefix2);
445
- allIcons = allIcons.concat(
446
- Object.keys(storage.icons).map(
447
- (name) => (provider2 !== "" ? "@" + provider2 + ":" : "") + prefix2 + ":" + name
448
- )
449
- );
450
- });
451
- });
452
- return allIcons;
453
- }
454
-
455
- let simpleNames = false;
456
- function allowSimpleNames(allow) {
457
- if (typeof allow === "boolean") {
458
- simpleNames = allow;
459
- }
460
- return simpleNames;
461
- }
462
- function getIconData(name) {
463
- const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
464
- if (icon) {
465
- const storage = getStorage(icon.provider, icon.prefix);
466
- const iconName = icon.name;
467
- return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
468
- }
469
- }
470
- function addIcon$1(name, data) {
471
- const icon = stringToIcon(name, true, simpleNames);
472
- if (!icon) {
473
- return false;
474
- }
475
- const storage = getStorage(icon.provider, icon.prefix);
476
- if (data) {
477
- return addIconToStorage(storage, icon.name, data);
478
- } else {
479
- storage.missing.add(icon.name);
480
- return true;
481
- }
482
- }
483
- function addCollection$1(data, provider) {
484
- if (typeof data !== "object") {
485
- return false;
486
- }
487
- if (typeof provider !== "string") {
488
- provider = data.provider || "";
489
- }
490
- if (simpleNames && !provider && !data.prefix) {
491
- let added = false;
492
- if (quicklyValidateIconSet(data)) {
493
- data.prefix = "";
494
- parseIconSet(data, (name, icon) => {
495
- if (addIcon$1(name, icon)) {
496
- added = true;
497
- }
498
- });
499
- }
500
- return added;
501
- }
502
- const prefix = data.prefix;
503
- if (!validateIconName({
504
- provider,
505
- prefix,
506
- name: "a"
507
- })) {
508
- return false;
509
- }
510
- const storage = getStorage(provider, prefix);
511
- return !!addIconSet(storage, data);
512
- }
513
- function iconLoaded$1(name) {
514
- return !!getIconData(name);
515
- }
516
- function getIcon$1(name) {
517
- const result = getIconData(name);
518
- return result ? {
519
- ...defaultIconProps,
520
- ...result
521
- } : result;
522
- }
523
-
524
- function sortIcons(icons) {
525
- const result = {
526
- loaded: [],
527
- missing: [],
528
- pending: []
529
- };
530
- const storage = /* @__PURE__ */ Object.create(null);
531
- icons.sort((a, b) => {
532
- if (a.provider !== b.provider) {
533
- return a.provider.localeCompare(b.provider);
534
- }
535
- if (a.prefix !== b.prefix) {
536
- return a.prefix.localeCompare(b.prefix);
537
- }
538
- return a.name.localeCompare(b.name);
539
- });
540
- let lastIcon = {
541
- provider: "",
542
- prefix: "",
543
- name: ""
544
- };
545
- icons.forEach((icon) => {
546
- if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
547
- return;
548
- }
549
- lastIcon = icon;
550
- const provider = icon.provider;
551
- const prefix = icon.prefix;
552
- const name = icon.name;
553
- const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
554
- const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
555
- let list;
556
- if (name in localStorage.icons) {
557
- list = result.loaded;
558
- } else if (prefix === "" || localStorage.missing.has(name)) {
559
- list = result.missing;
560
- } else {
561
- list = result.pending;
562
- }
563
- const item = {
564
- provider,
565
- prefix,
566
- name
567
- };
568
- list.push(item);
569
- });
570
- return result;
571
- }
572
-
573
- function removeCallback(storages, id) {
574
- storages.forEach((storage) => {
575
- const items = storage.loaderCallbacks;
576
- if (items) {
577
- storage.loaderCallbacks = items.filter((row) => row.id !== id);
578
- }
579
- });
580
- }
581
- function updateCallbacks(storage) {
582
- if (!storage.pendingCallbacksFlag) {
583
- storage.pendingCallbacksFlag = true;
584
- setTimeout(() => {
585
- storage.pendingCallbacksFlag = false;
586
- const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
587
- if (!items.length) {
588
- return;
589
- }
590
- let hasPending = false;
591
- const provider = storage.provider;
592
- const prefix = storage.prefix;
593
- items.forEach((item) => {
594
- const icons = item.icons;
595
- const oldLength = icons.pending.length;
596
- icons.pending = icons.pending.filter((icon) => {
597
- if (icon.prefix !== prefix) {
598
- return true;
599
- }
600
- const name = icon.name;
601
- if (storage.icons[name]) {
602
- icons.loaded.push({
603
- provider,
604
- prefix,
605
- name
606
- });
607
- } else if (storage.missing.has(name)) {
608
- icons.missing.push({
609
- provider,
610
- prefix,
611
- name
612
- });
613
- } else {
614
- hasPending = true;
615
- return true;
616
- }
617
- return false;
618
- });
619
- if (icons.pending.length !== oldLength) {
620
- if (!hasPending) {
621
- removeCallback([storage], item.id);
622
- }
623
- item.callback(
624
- icons.loaded.slice(0),
625
- icons.missing.slice(0),
626
- icons.pending.slice(0),
627
- item.abort
628
- );
629
- }
630
- });
631
- });
632
- }
633
- }
634
- let idCounter = 0;
635
- function storeCallback(callback, icons, pendingSources) {
636
- const id = idCounter++;
637
- const abort = removeCallback.bind(null, pendingSources, id);
638
- if (!icons.pending.length) {
639
- return abort;
640
- }
641
- const item = {
642
- id,
643
- icons,
644
- callback,
645
- abort
646
- };
647
- pendingSources.forEach((storage) => {
648
- (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
649
- });
650
- return abort;
651
- }
652
-
653
- const storage = /* @__PURE__ */ Object.create(null);
654
- function setAPIModule(provider, item) {
655
- storage[provider] = item;
656
- }
657
- function getAPIModule(provider) {
658
- return storage[provider] || storage[""];
659
- }
660
-
661
- function listToIcons(list, validate = true, simpleNames = false) {
662
- const result = [];
663
- list.forEach((item) => {
664
- const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
665
- if (icon) {
666
- result.push(icon);
667
- }
668
- });
669
- return result;
670
- }
671
-
672
- // src/config.ts
673
- var defaultConfig = {
674
- resources: [],
675
- index: 0,
676
- timeout: 2e3,
677
- rotate: 750,
678
- random: false,
679
- dataAfterTimeout: false
680
- };
681
-
682
- // src/query.ts
683
- function sendQuery(config, payload, query, done) {
684
- const resourcesCount = config.resources.length;
685
- const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
686
- let resources;
687
- if (config.random) {
688
- let list = config.resources.slice(0);
689
- resources = [];
690
- while (list.length > 1) {
691
- const nextIndex = Math.floor(Math.random() * list.length);
692
- resources.push(list[nextIndex]);
693
- list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
694
- }
695
- resources = resources.concat(list);
696
- } else {
697
- resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
698
- }
699
- const startTime = Date.now();
700
- let status = "pending";
701
- let queriesSent = 0;
702
- let lastError;
703
- let timer = null;
704
- let queue = [];
705
- let doneCallbacks = [];
706
- if (typeof done === "function") {
707
- doneCallbacks.push(done);
708
- }
709
- function resetTimer() {
710
- if (timer) {
711
- clearTimeout(timer);
712
- timer = null;
713
- }
714
- }
715
- function abort() {
716
- if (status === "pending") {
717
- status = "aborted";
718
- }
719
- resetTimer();
720
- queue.forEach((item) => {
721
- if (item.status === "pending") {
722
- item.status = "aborted";
723
- }
724
- });
725
- queue = [];
726
- }
727
- function subscribe(callback, overwrite) {
728
- if (overwrite) {
729
- doneCallbacks = [];
730
- }
731
- if (typeof callback === "function") {
732
- doneCallbacks.push(callback);
733
- }
734
- }
735
- function getQueryStatus() {
736
- return {
737
- startTime,
738
- payload,
739
- status,
740
- queriesSent,
741
- queriesPending: queue.length,
742
- subscribe,
743
- abort
744
- };
745
- }
746
- function failQuery() {
747
- status = "failed";
748
- doneCallbacks.forEach((callback) => {
749
- callback(void 0, lastError);
750
- });
751
- }
752
- function clearQueue() {
753
- queue.forEach((item) => {
754
- if (item.status === "pending") {
755
- item.status = "aborted";
756
- }
757
- });
758
- queue = [];
759
- }
760
- function moduleResponse(item, response, data) {
761
- const isError = response !== "success";
762
- queue = queue.filter((queued) => queued !== item);
763
- switch (status) {
764
- case "pending":
765
- break;
766
- case "failed":
767
- if (isError || !config.dataAfterTimeout) {
768
- return;
769
- }
770
- break;
771
- default:
772
- return;
773
- }
774
- if (response === "abort") {
775
- lastError = data;
776
- failQuery();
777
- return;
778
- }
779
- if (isError) {
780
- lastError = data;
781
- if (!queue.length) {
782
- if (!resources.length) {
783
- failQuery();
784
- } else {
785
- execNext();
786
- }
787
- }
788
- return;
789
- }
790
- resetTimer();
791
- clearQueue();
792
- if (!config.random) {
793
- const index = config.resources.indexOf(item.resource);
794
- if (index !== -1 && index !== config.index) {
795
- config.index = index;
796
- }
797
- }
798
- status = "completed";
799
- doneCallbacks.forEach((callback) => {
800
- callback(data);
801
- });
802
- }
803
- function execNext() {
804
- if (status !== "pending") {
805
- return;
806
- }
807
- resetTimer();
808
- const resource = resources.shift();
809
- if (resource === void 0) {
810
- if (queue.length) {
811
- timer = setTimeout(() => {
812
- resetTimer();
813
- if (status === "pending") {
814
- clearQueue();
815
- failQuery();
816
- }
817
- }, config.timeout);
818
- return;
819
- }
820
- failQuery();
821
- return;
822
- }
823
- const item = {
824
- status: "pending",
825
- resource,
826
- callback: (status2, data) => {
827
- moduleResponse(item, status2, data);
828
- }
829
- };
830
- queue.push(item);
831
- queriesSent++;
832
- timer = setTimeout(execNext, config.rotate);
833
- query(resource, payload, item.callback);
834
- }
835
- setTimeout(execNext);
836
- return getQueryStatus;
837
- }
838
-
839
- // src/index.ts
840
- function initRedundancy(cfg) {
841
- const config = {
842
- ...defaultConfig,
843
- ...cfg
844
- };
845
- let queries = [];
846
- function cleanup() {
847
- queries = queries.filter((item) => item().status === "pending");
848
- }
849
- function query(payload, queryCallback, doneCallback) {
850
- const query2 = sendQuery(
851
- config,
852
- payload,
853
- queryCallback,
854
- (data, error) => {
855
- cleanup();
856
- if (doneCallback) {
857
- doneCallback(data, error);
858
- }
859
- }
860
- );
861
- queries.push(query2);
862
- return query2;
863
- }
864
- function find(callback) {
865
- return queries.find((value) => {
866
- return callback(value);
867
- }) || null;
868
- }
869
- const instance = {
870
- query,
871
- find,
872
- setIndex: (index) => {
873
- config.index = index;
874
- },
875
- getIndex: () => config.index,
876
- cleanup
877
- };
878
- return instance;
879
- }
880
-
881
- function createAPIConfig(source) {
882
- let resources;
883
- if (typeof source.resources === "string") {
884
- resources = [source.resources];
885
- } else {
886
- resources = source.resources;
887
- if (!(resources instanceof Array) || !resources.length) {
888
- return null;
889
- }
890
- }
891
- const result = {
892
- // API hosts
893
- resources,
894
- // Root path
895
- path: source.path || "/",
896
- // URL length limit
897
- maxURL: source.maxURL || 500,
898
- // Timeout before next host is used.
899
- rotate: source.rotate || 750,
900
- // Timeout before failing query.
901
- timeout: source.timeout || 5e3,
902
- // Randomise default API end point.
903
- random: source.random === true,
904
- // Start index
905
- index: source.index || 0,
906
- // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
907
- dataAfterTimeout: source.dataAfterTimeout !== false
908
- };
909
- return result;
910
- }
911
- const configStorage = /* @__PURE__ */ Object.create(null);
912
- const fallBackAPISources = [
913
- "https://api.simplesvg.com",
914
- "https://api.unisvg.com"
915
- ];
916
- const fallBackAPI = [];
917
- while (fallBackAPISources.length > 0) {
918
- if (fallBackAPISources.length === 1) {
919
- fallBackAPI.push(fallBackAPISources.shift());
920
- } else {
921
- if (Math.random() > 0.5) {
922
- fallBackAPI.push(fallBackAPISources.shift());
923
- } else {
924
- fallBackAPI.push(fallBackAPISources.pop());
925
- }
926
- }
927
- }
928
- configStorage[""] = createAPIConfig({
929
- resources: ["https://api.iconify.design"].concat(fallBackAPI)
930
- });
931
- function addAPIProvider$1(provider, customConfig) {
932
- const config = createAPIConfig(customConfig);
933
- if (config === null) {
934
- return false;
935
- }
936
- configStorage[provider] = config;
937
- return true;
938
- }
939
- function getAPIConfig(provider) {
940
- return configStorage[provider];
941
- }
942
- function listAPIProviders() {
943
- return Object.keys(configStorage);
944
- }
945
-
946
- function emptyCallback$1() {
947
- }
948
- const redundancyCache = /* @__PURE__ */ Object.create(null);
949
- function getRedundancyCache(provider) {
950
- if (!redundancyCache[provider]) {
951
- const config = getAPIConfig(provider);
952
- if (!config) {
953
- return;
954
- }
955
- const redundancy = initRedundancy(config);
956
- const cachedReundancy = {
957
- config,
958
- redundancy
959
- };
960
- redundancyCache[provider] = cachedReundancy;
961
- }
962
- return redundancyCache[provider];
963
- }
964
- function sendAPIQuery(target, query, callback) {
965
- let redundancy;
966
- let send;
967
- if (typeof target === "string") {
968
- const api = getAPIModule(target);
969
- if (!api) {
970
- callback(void 0, 424);
971
- return emptyCallback$1;
972
- }
973
- send = api.send;
974
- const cached = getRedundancyCache(target);
975
- if (cached) {
976
- redundancy = cached.redundancy;
977
- }
978
- } else {
979
- const config = createAPIConfig(target);
980
- if (config) {
981
- redundancy = initRedundancy(config);
982
- const moduleKey = target.resources ? target.resources[0] : "";
983
- const api = getAPIModule(moduleKey);
984
- if (api) {
985
- send = api.send;
986
- }
987
- }
988
- }
989
- if (!redundancy || !send) {
990
- callback(void 0, 424);
991
- return emptyCallback$1;
992
- }
993
- return redundancy.query(query, send, callback)().abort;
994
- }
995
-
996
- const browserCacheVersion = "iconify2";
997
- const browserCachePrefix = "iconify";
998
- const browserCacheCountKey = browserCachePrefix + "-count";
999
- const browserCacheVersionKey = browserCachePrefix + "-version";
1000
- const browserStorageHour = 36e5;
1001
- const browserStorageCacheExpiration = 168;
1002
- const browserStorageLimit = 50;
1003
-
1004
- function getStoredItem(func, key) {
1005
- try {
1006
- return func.getItem(key);
1007
- } catch (err) {
1008
- }
1009
- }
1010
- function setStoredItem(func, key, value) {
1011
- try {
1012
- func.setItem(key, value);
1013
- return true;
1014
- } catch (err) {
1015
- }
1016
- }
1017
- function removeStoredItem(func, key) {
1018
- try {
1019
- func.removeItem(key);
1020
- } catch (err) {
1021
- }
1022
- }
1023
-
1024
- function setBrowserStorageItemsCount(storage, value) {
1025
- return setStoredItem(storage, browserCacheCountKey, value.toString());
1026
- }
1027
- function getBrowserStorageItemsCount(storage) {
1028
- return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
1029
- }
1030
-
1031
- const browserStorageConfig = {
1032
- local: true,
1033
- session: true
1034
- };
1035
- const browserStorageEmptyItems = {
1036
- local: /* @__PURE__ */ new Set(),
1037
- session: /* @__PURE__ */ new Set()
1038
- };
1039
- let browserStorageStatus = false;
1040
- function setBrowserStorageStatus(status) {
1041
- browserStorageStatus = status;
1042
- }
1043
-
1044
- let _window = typeof window === "undefined" ? {} : window;
1045
- function getBrowserStorage(key) {
1046
- const attr = key + "Storage";
1047
- try {
1048
- if (_window && _window[attr] && typeof _window[attr].length === "number") {
1049
- return _window[attr];
1050
- }
1051
- } catch (err) {
1052
- }
1053
- browserStorageConfig[key] = false;
1054
- }
1055
-
1056
- function iterateBrowserStorage(key, callback) {
1057
- const func = getBrowserStorage(key);
1058
- if (!func) {
1059
- return;
1060
- }
1061
- const version = getStoredItem(func, browserCacheVersionKey);
1062
- if (version !== browserCacheVersion) {
1063
- if (version) {
1064
- const total2 = getBrowserStorageItemsCount(func);
1065
- for (let i = 0; i < total2; i++) {
1066
- removeStoredItem(func, browserCachePrefix + i.toString());
1067
- }
1068
- }
1069
- setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
1070
- setBrowserStorageItemsCount(func, 0);
1071
- return;
1072
- }
1073
- const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
1074
- const parseItem = (index) => {
1075
- const name = browserCachePrefix + index.toString();
1076
- const item = getStoredItem(func, name);
1077
- if (typeof item !== "string") {
1078
- return;
1079
- }
1080
- try {
1081
- const data = JSON.parse(item);
1082
- if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
1083
- callback(data, index)) {
1084
- return true;
1085
- }
1086
- } catch (err) {
1087
- }
1088
- removeStoredItem(func, name);
1089
- };
1090
- let total = getBrowserStorageItemsCount(func);
1091
- for (let i = total - 1; i >= 0; i--) {
1092
- if (!parseItem(i)) {
1093
- if (i === total - 1) {
1094
- total--;
1095
- setBrowserStorageItemsCount(func, total);
1096
- } else {
1097
- browserStorageEmptyItems[key].add(i);
1098
- }
1099
- }
1100
- }
1101
- }
1102
-
1103
- function initBrowserStorage() {
1104
- if (browserStorageStatus) {
1105
- return;
1106
- }
1107
- setBrowserStorageStatus(true);
1108
- for (const key in browserStorageConfig) {
1109
- iterateBrowserStorage(key, (item) => {
1110
- const iconSet = item.data;
1111
- const provider = item.provider;
1112
- const prefix = iconSet.prefix;
1113
- const storage = getStorage(
1114
- provider,
1115
- prefix
1116
- );
1117
- if (!addIconSet(storage, iconSet).length) {
1118
- return false;
1119
- }
1120
- const lastModified = iconSet.lastModified || -1;
1121
- storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
1122
- return true;
1123
- });
1124
- }
1125
- }
1126
-
1127
- function updateLastModified(storage, lastModified) {
1128
- const lastValue = storage.lastModifiedCached;
1129
- if (
1130
- // Matches or newer
1131
- lastValue && lastValue >= lastModified
1132
- ) {
1133
- return lastValue === lastModified;
1134
- }
1135
- storage.lastModifiedCached = lastModified;
1136
- if (lastValue) {
1137
- for (const key in browserStorageConfig) {
1138
- iterateBrowserStorage(key, (item) => {
1139
- const iconSet = item.data;
1140
- return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
1141
- });
1142
- }
1143
- }
1144
- return true;
1145
- }
1146
- function storeInBrowserStorage(storage, data) {
1147
- if (!browserStorageStatus) {
1148
- initBrowserStorage();
1149
- }
1150
- function store(key) {
1151
- let func;
1152
- if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
1153
- return;
1154
- }
1155
- const set = browserStorageEmptyItems[key];
1156
- let index;
1157
- if (set.size) {
1158
- set.delete(index = Array.from(set).shift());
1159
- } else {
1160
- index = getBrowserStorageItemsCount(func);
1161
- if (index >= browserStorageLimit || !setBrowserStorageItemsCount(func, index + 1)) {
1162
- return;
1163
- }
1164
- }
1165
- const item = {
1166
- cached: Math.floor(Date.now() / browserStorageHour),
1167
- provider: storage.provider,
1168
- data
1169
- };
1170
- return setStoredItem(
1171
- func,
1172
- browserCachePrefix + index.toString(),
1173
- JSON.stringify(item)
1174
- );
1175
- }
1176
- if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
1177
- return;
1178
- }
1179
- if (!Object.keys(data.icons).length) {
1180
- return;
1181
- }
1182
- if (data.not_found) {
1183
- data = Object.assign({}, data);
1184
- delete data.not_found;
1185
- }
1186
- if (!store("local")) {
1187
- store("session");
1188
- }
1189
- }
1190
-
1191
- function emptyCallback() {
1192
- }
1193
- function loadedNewIcons(storage) {
1194
- if (!storage.iconsLoaderFlag) {
1195
- storage.iconsLoaderFlag = true;
1196
- setTimeout(() => {
1197
- storage.iconsLoaderFlag = false;
1198
- updateCallbacks(storage);
1199
- });
1200
- }
1201
- }
1202
- function checkIconNamesForAPI(icons) {
1203
- const valid = [];
1204
- const invalid = [];
1205
- icons.forEach((name) => {
1206
- (name.match(matchIconName) ? valid : invalid).push(name);
1207
- });
1208
- return {
1209
- valid,
1210
- invalid
1211
- };
1212
- }
1213
- function parseLoaderResponse(storage, icons, data, isAPIResponse) {
1214
- function checkMissing() {
1215
- const pending = storage.pendingIcons;
1216
- icons.forEach((name) => {
1217
- if (pending) {
1218
- pending.delete(name);
1219
- }
1220
- if (!storage.icons[name]) {
1221
- storage.missing.add(name);
1222
- }
1223
- });
1224
- }
1225
- if (data && typeof data === "object") {
1226
- try {
1227
- const parsed = addIconSet(storage, data);
1228
- if (!parsed.length) {
1229
- checkMissing();
1230
- return;
1231
- }
1232
- if (isAPIResponse) {
1233
- storeInBrowserStorage(storage, data);
1234
- }
1235
- } catch (err) {
1236
- console.error(err);
1237
- }
1238
- }
1239
- checkMissing();
1240
- loadedNewIcons(storage);
1241
- }
1242
- function parsePossiblyAsyncResponse(response, callback) {
1243
- if (response instanceof Promise) {
1244
- response.then((data) => {
1245
- callback(data);
1246
- }).catch(() => {
1247
- callback(null);
1248
- });
1249
- } else {
1250
- callback(response);
1251
- }
1252
- }
1253
- function loadNewIcons(storage, icons) {
1254
- if (!storage.iconsToLoad) {
1255
- storage.iconsToLoad = icons;
1256
- } else {
1257
- storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
1258
- }
1259
- if (!storage.iconsQueueFlag) {
1260
- storage.iconsQueueFlag = true;
1261
- setTimeout(() => {
1262
- storage.iconsQueueFlag = false;
1263
- const { provider, prefix } = storage;
1264
- const icons2 = storage.iconsToLoad;
1265
- delete storage.iconsToLoad;
1266
- if (!icons2 || !icons2.length) {
1267
- return;
1268
- }
1269
- const customIconLoader = storage.loadIcon;
1270
- if (storage.loadIcons && (icons2.length > 1 || !customIconLoader)) {
1271
- parsePossiblyAsyncResponse(
1272
- storage.loadIcons(icons2, prefix, provider),
1273
- (data) => {
1274
- parseLoaderResponse(storage, icons2, data, false);
1275
- }
1276
- );
1277
- return;
1278
- }
1279
- if (customIconLoader) {
1280
- icons2.forEach((name) => {
1281
- const response = customIconLoader(name, prefix, provider);
1282
- parsePossiblyAsyncResponse(response, (data) => {
1283
- const iconSet = data ? {
1284
- prefix,
1285
- icons: {
1286
- [name]: data
1287
- }
1288
- } : null;
1289
- parseLoaderResponse(storage, [name], iconSet, false);
1290
- });
1291
- });
1292
- return;
1293
- }
1294
- const { valid, invalid } = checkIconNamesForAPI(icons2);
1295
- if (invalid.length) {
1296
- parseLoaderResponse(storage, invalid, null, false);
1297
- }
1298
- if (!valid.length) {
1299
- return;
1300
- }
1301
- const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
1302
- if (!api) {
1303
- parseLoaderResponse(storage, valid, null, false);
1304
- return;
1305
- }
1306
- const params = api.prepare(provider, prefix, valid);
1307
- params.forEach((item) => {
1308
- sendAPIQuery(provider, item, (data) => {
1309
- parseLoaderResponse(storage, item.icons, data, true);
1310
- });
1311
- });
1312
- });
1313
- }
1314
- }
1315
- const loadIcons$1 = (icons, callback) => {
1316
- const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1317
- const sortedIcons = sortIcons(cleanedIcons);
1318
- if (!sortedIcons.pending.length) {
1319
- let callCallback = true;
1320
- if (callback) {
1321
- setTimeout(() => {
1322
- if (callCallback) {
1323
- callback(
1324
- sortedIcons.loaded,
1325
- sortedIcons.missing,
1326
- sortedIcons.pending,
1327
- emptyCallback
1328
- );
1329
- }
1330
- });
1331
- }
1332
- return () => {
1333
- callCallback = false;
1334
- };
1335
- }
1336
- const newIcons = /* @__PURE__ */ Object.create(null);
1337
- const sources = [];
1338
- let lastProvider, lastPrefix;
1339
- sortedIcons.pending.forEach((icon) => {
1340
- const { provider, prefix } = icon;
1341
- if (prefix === lastPrefix && provider === lastProvider) {
1342
- return;
1343
- }
1344
- lastProvider = provider;
1345
- lastPrefix = prefix;
1346
- sources.push(getStorage(provider, prefix));
1347
- const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1348
- if (!providerNewIcons[prefix]) {
1349
- providerNewIcons[prefix] = [];
1350
- }
1351
- });
1352
- sortedIcons.pending.forEach((icon) => {
1353
- const { provider, prefix, name } = icon;
1354
- const storage = getStorage(provider, prefix);
1355
- const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
1356
- if (!pendingQueue.has(name)) {
1357
- pendingQueue.add(name);
1358
- newIcons[provider][prefix].push(name);
1359
- }
1360
- });
1361
- sources.forEach((storage) => {
1362
- const list = newIcons[storage.provider][storage.prefix];
1363
- if (list.length) {
1364
- loadNewIcons(storage, list);
1365
- }
1366
- });
1367
- return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1368
- };
1369
- const loadIcon$1 = (icon) => {
1370
- return new Promise((fulfill, reject) => {
1371
- const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1372
- if (!iconObj) {
1373
- reject(icon);
1374
- return;
1375
- }
1376
- loadIcons$1([iconObj || icon], (loaded) => {
1377
- if (loaded.length && iconObj) {
1378
- const data = getIconData(iconObj);
1379
- if (data) {
1380
- fulfill({
1381
- ...defaultIconProps,
1382
- ...data
1383
- });
1384
- return;
1385
- }
1386
- }
1387
- reject(icon);
1388
- });
1389
- });
1390
- };
1391
-
1392
- /**
1393
- * Test icon string
1394
- */
1395
- function testIconObject(value) {
1396
- try {
1397
- const obj = typeof value === 'string' ? JSON.parse(value) : value;
1398
- if (typeof obj.body === 'string') {
1399
- return {
1400
- ...obj,
1401
- };
1402
- }
1403
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1404
- }
1405
- catch (err) {
1406
- //
1407
- }
1408
- }
1409
-
1410
- /**
1411
- * Parse icon value, load if needed
1412
- */
1413
- function parseIconValue(value, onload) {
1414
- if (typeof value === 'object') {
1415
- const data = testIconObject(value);
1416
- return {
1417
- data,
1418
- value,
1419
- };
1420
- }
1421
- if (typeof value !== 'string') {
1422
- // Invalid value
1423
- return {
1424
- value,
1425
- };
1426
- }
1427
- // Check for JSON
1428
- if (value.includes('{')) {
1429
- const data = testIconObject(value);
1430
- if (data) {
1431
- return {
1432
- data,
1433
- value,
1434
- };
1435
- }
1436
- }
1437
- // Parse icon name
1438
- const name = stringToIcon(value, true, true);
1439
- if (!name) {
1440
- return {
1441
- value,
1442
- };
1443
- }
1444
- // Valid icon name: check if data is available
1445
- const data = getIconData(name);
1446
- // Icon data exists or icon has no prefix. Do not load icon from API if icon has no prefix
1447
- if (data !== undefined || !name.prefix) {
1448
- return {
1449
- value,
1450
- name,
1451
- data, // could be 'null' -> icon is missing
1452
- };
1453
- }
1454
- // Load icon
1455
- const loading = loadIcons$1([name], () => onload(value, name, getIconData(name)));
1456
- return {
1457
- value,
1458
- name,
1459
- loading,
1460
- };
1461
- }
1462
-
1463
- // Check for Safari
1464
- let isBuggedSafari = false;
1465
- try {
1466
- isBuggedSafari = navigator.vendor.indexOf('Apple') === 0;
1467
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1468
- }
1469
- catch (err) {
1470
- //
1471
- }
1472
- /**
1473
- * Get render mode
1474
- */
1475
- function getRenderMode(body, mode) {
1476
- switch (mode) {
1477
- // Force mode
1478
- case 'svg':
1479
- case 'bg':
1480
- case 'mask':
1481
- return mode;
1482
- }
1483
- // Check for animation, use 'style' for animated icons, unless browser is Safari
1484
- // (only <a>, which should be ignored or animations start with '<a')
1485
- if (mode !== 'style' &&
1486
- (isBuggedSafari || body.indexOf('<a') === -1)) {
1487
- // Render <svg>
1488
- return 'svg';
1489
- }
1490
- // Use background or mask
1491
- return body.indexOf('currentColor') === -1 ? 'bg' : 'mask';
1492
- }
1493
-
1494
- const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
1495
- const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
1496
- function calculateSize$1(size, ratio, precision) {
1497
- if (ratio === 1) {
1498
- return size;
1499
- }
1500
- precision = precision || 100;
1501
- if (typeof size === "number") {
1502
- return Math.ceil(size * ratio * precision) / precision;
1503
- }
1504
- if (typeof size !== "string") {
1505
- return size;
1506
- }
1507
- const oldParts = size.split(unitsSplit);
1508
- if (oldParts === null || !oldParts.length) {
1509
- return size;
1510
- }
1511
- const newParts = [];
1512
- let code = oldParts.shift();
1513
- let isNumber = unitsTest.test(code);
1514
- while (true) {
1515
- if (isNumber) {
1516
- const num = parseFloat(code);
1517
- if (isNaN(num)) {
1518
- newParts.push(code);
1519
- } else {
1520
- newParts.push(Math.ceil(num * ratio * precision) / precision);
1521
- }
1522
- } else {
1523
- newParts.push(code);
1524
- }
1525
- code = oldParts.shift();
1526
- if (code === void 0) {
1527
- return newParts.join("");
1528
- }
1529
- isNumber = !isNumber;
1530
- }
1531
- }
1532
-
1533
- function splitSVGDefs(content, tag = "defs") {
1534
- let defs = "";
1535
- const index = content.indexOf("<" + tag);
1536
- while (index >= 0) {
1537
- const start = content.indexOf(">", index);
1538
- const end = content.indexOf("</" + tag);
1539
- if (start === -1 || end === -1) {
1540
- break;
1541
- }
1542
- const endEnd = content.indexOf(">", end);
1543
- if (endEnd === -1) {
1544
- break;
1545
- }
1546
- defs += content.slice(start + 1, end).trim();
1547
- content = content.slice(0, index).trim() + content.slice(endEnd + 1);
1548
- }
1549
- return {
1550
- defs,
1551
- content
1552
- };
1553
- }
1554
- function mergeDefsAndContent(defs, content) {
1555
- return defs ? "<defs>" + defs + "</defs>" + content : content;
1556
- }
1557
- function wrapSVGContent(body, start, end) {
1558
- const split = splitSVGDefs(body);
1559
- return mergeDefsAndContent(split.defs, start + split.content + end);
1560
- }
1561
-
1562
- const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
1563
- function iconToSVG(icon, customisations) {
1564
- const fullIcon = {
1565
- ...defaultIconProps,
1566
- ...icon
1567
- };
1568
- const fullCustomisations = {
1569
- ...defaultIconCustomisations,
1570
- ...customisations
1571
- };
1572
- const box = {
1573
- left: fullIcon.left,
1574
- top: fullIcon.top,
1575
- width: fullIcon.width,
1576
- height: fullIcon.height
1577
- };
1578
- let body = fullIcon.body;
1579
- [fullIcon, fullCustomisations].forEach((props) => {
1580
- const transformations = [];
1581
- const hFlip = props.hFlip;
1582
- const vFlip = props.vFlip;
1583
- let rotation = props.rotate;
1584
- if (hFlip) {
1585
- if (vFlip) {
1586
- rotation += 2;
1587
- } else {
1588
- transformations.push(
1589
- "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
1590
- );
1591
- transformations.push("scale(-1 1)");
1592
- box.top = box.left = 0;
1593
- }
1594
- } else if (vFlip) {
1595
- transformations.push(
1596
- "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
1597
- );
1598
- transformations.push("scale(1 -1)");
1599
- box.top = box.left = 0;
1600
- }
1601
- let tempValue;
1602
- if (rotation < 0) {
1603
- rotation -= Math.floor(rotation / 4) * 4;
1604
- }
1605
- rotation = rotation % 4;
1606
- switch (rotation) {
1607
- case 1:
1608
- tempValue = box.height / 2 + box.top;
1609
- transformations.unshift(
1610
- "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
1611
- );
1612
- break;
1613
- case 2:
1614
- transformations.unshift(
1615
- "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
1616
- );
1617
- break;
1618
- case 3:
1619
- tempValue = box.width / 2 + box.left;
1620
- transformations.unshift(
1621
- "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
1622
- );
1623
- break;
1624
- }
1625
- if (rotation % 2 === 1) {
1626
- if (box.left !== box.top) {
1627
- tempValue = box.left;
1628
- box.left = box.top;
1629
- box.top = tempValue;
1630
- }
1631
- if (box.width !== box.height) {
1632
- tempValue = box.width;
1633
- box.width = box.height;
1634
- box.height = tempValue;
1635
- }
1636
- }
1637
- if (transformations.length) {
1638
- body = wrapSVGContent(
1639
- body,
1640
- '<g transform="' + transformations.join(" ") + '">',
1641
- "</g>"
1642
- );
1643
- }
1644
- });
1645
- const customisationsWidth = fullCustomisations.width;
1646
- const customisationsHeight = fullCustomisations.height;
1647
- const boxWidth = box.width;
1648
- const boxHeight = box.height;
1649
- let width;
1650
- let height;
1651
- if (customisationsWidth === null) {
1652
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
1653
- width = calculateSize$1(height, boxWidth / boxHeight);
1654
- } else {
1655
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
1656
- height = customisationsHeight === null ? calculateSize$1(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
1657
- }
1658
- const attributes = {};
1659
- const setAttr = (prop, value) => {
1660
- if (!isUnsetKeyword(value)) {
1661
- attributes[prop] = value.toString();
1662
- }
1663
- };
1664
- setAttr("width", width);
1665
- setAttr("height", height);
1666
- const viewBox = [box.left, box.top, boxWidth, boxHeight];
1667
- attributes.viewBox = viewBox.join(" ");
1668
- return {
1669
- attributes,
1670
- viewBox,
1671
- body
1672
- };
1673
- }
1674
-
1675
- function iconToHTML$1(body, attributes) {
1676
- let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1677
- for (const attr in attributes) {
1678
- renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
1679
- }
1680
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1681
- }
1682
-
1683
- function encodeSVGforURL(svg) {
1684
- return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1685
- }
1686
- function svgToData(svg) {
1687
- return "data:image/svg+xml," + encodeSVGforURL(svg);
1688
- }
1689
- function svgToURL$1(svg) {
1690
- return 'url("' + svgToData(svg) + '")';
1691
- }
1692
-
1693
- const detectFetch = () => {
1694
- let callback;
1695
- try {
1696
- callback = fetch;
1697
- if (typeof callback === "function") {
1698
- return callback;
1699
- }
1700
- } catch (err) {
1701
- }
1702
- };
1703
- let fetchModule = detectFetch();
1704
- function setFetch(fetch2) {
1705
- fetchModule = fetch2;
1706
- }
1707
- function getFetch() {
1708
- return fetchModule;
1709
- }
1710
- function calculateMaxLength(provider, prefix) {
1711
- const config = getAPIConfig(provider);
1712
- if (!config) {
1713
- return 0;
1714
- }
1715
- let result;
1716
- if (!config.maxURL) {
1717
- result = 0;
1718
- } else {
1719
- let maxHostLength = 0;
1720
- config.resources.forEach((item) => {
1721
- const host = item;
1722
- maxHostLength = Math.max(maxHostLength, host.length);
1723
- });
1724
- const url = prefix + ".json?icons=";
1725
- result = config.maxURL - maxHostLength - config.path.length - url.length;
1726
- }
1727
- return result;
1728
- }
1729
- function shouldAbort(status) {
1730
- return status === 404;
1731
- }
1732
- const prepare = (provider, prefix, icons) => {
1733
- const results = [];
1734
- const maxLength = calculateMaxLength(provider, prefix);
1735
- const type = "icons";
1736
- let item = {
1737
- type,
1738
- provider,
1739
- prefix,
1740
- icons: []
1741
- };
1742
- let length = 0;
1743
- icons.forEach((name, index) => {
1744
- length += name.length + 1;
1745
- if (length >= maxLength && index > 0) {
1746
- results.push(item);
1747
- item = {
1748
- type,
1749
- provider,
1750
- prefix,
1751
- icons: []
1752
- };
1753
- length = name.length;
1754
- }
1755
- item.icons.push(name);
1756
- });
1757
- results.push(item);
1758
- return results;
1759
- };
1760
- function getPath(provider) {
1761
- if (typeof provider === "string") {
1762
- const config = getAPIConfig(provider);
1763
- if (config) {
1764
- return config.path;
1765
- }
1766
- }
1767
- return "/";
1768
- }
1769
- const send = (host, params, callback) => {
1770
- if (!fetchModule) {
1771
- callback("abort", 424);
1772
- return;
1773
- }
1774
- let path = getPath(params.provider);
1775
- switch (params.type) {
1776
- case "icons": {
1777
- const prefix = params.prefix;
1778
- const icons = params.icons;
1779
- const iconsList = icons.join(",");
1780
- const urlParams = new URLSearchParams({
1781
- icons: iconsList
1782
- });
1783
- path += prefix + ".json?" + urlParams.toString();
1784
- break;
1785
- }
1786
- case "custom": {
1787
- const uri = params.uri;
1788
- path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
1789
- break;
1790
- }
1791
- default:
1792
- callback("abort", 400);
1793
- return;
1794
- }
1795
- let defaultError = 503;
1796
- fetchModule(host + path).then((response) => {
1797
- const status = response.status;
1798
- if (status !== 200) {
1799
- setTimeout(() => {
1800
- callback(shouldAbort(status) ? "abort" : "next", status);
1801
- });
1802
- return;
1803
- }
1804
- defaultError = 501;
1805
- return response.json();
1806
- }).then((data) => {
1807
- if (typeof data !== "object" || data === null) {
1808
- setTimeout(() => {
1809
- if (data === 404) {
1810
- callback("abort", data);
1811
- } else {
1812
- callback("next", defaultError);
1813
- }
1814
- });
1815
- return;
1816
- }
1817
- setTimeout(() => {
1818
- callback("success", data);
1819
- });
1820
- }).catch(() => {
1821
- callback("next", defaultError);
1822
- });
1823
- };
1824
- const fetchAPIModule = {
1825
- prepare,
1826
- send
1827
- };
1828
-
1829
- function setCustomIconsLoader$1(loader, prefix, provider) {
1830
- getStorage(provider || "", prefix).loadIcons = loader;
1831
- }
1832
- function setCustomIconLoader$1(loader, prefix, provider) {
1833
- getStorage(provider || "", prefix).loadIcon = loader;
1834
- }
1835
-
1836
- function toggleBrowserCache(storage, value) {
1837
- switch (storage) {
1838
- case "local":
1839
- case "session":
1840
- browserStorageConfig[storage] = value;
1841
- break;
1842
- case "all":
1843
- for (const key in browserStorageConfig) {
1844
- browserStorageConfig[key] = value;
1845
- }
1846
- break;
1847
- }
1848
- }
1849
-
1850
- /**
1851
- * Attribute to add
1852
- */
1853
- const nodeAttr = 'data-style';
1854
- /**
1855
- * Custom style to add to each node
1856
- */
1857
- let customStyle = '';
1858
- /**
1859
- * Set custom style to add to all components
1860
- *
1861
- * Affects only components rendered after function call
1862
- */
1863
- function appendCustomStyle(style) {
1864
- customStyle = style;
1865
- }
1866
- /**
1867
- * Add/update style node
1868
- */
1869
- function updateStyle(parent, inline) {
1870
- // Get node, create if needed
1871
- let styleNode = Array.from(parent.childNodes).find((node) => node.hasAttribute &&
1872
- node.hasAttribute(nodeAttr));
1873
- if (!styleNode) {
1874
- styleNode = document.createElement('style');
1875
- styleNode.setAttribute(nodeAttr, nodeAttr);
1876
- parent.appendChild(styleNode);
1877
- }
1878
- // Update content
1879
- styleNode.textContent =
1880
- ':host{display:inline-block;vertical-align:' +
1881
- (inline ? '-0.125em' : '0') +
1882
- '}span,svg{display:block;margin:auto}' +
1883
- customStyle;
1884
- }
1885
-
1886
- // Core
1887
- /**
1888
- * Get functions and initialise stuff
1889
- */
1890
- function exportFunctions() {
1891
- /**
1892
- * Initialise stuff
1893
- */
1894
- // Set API module
1895
- setAPIModule('', fetchAPIModule);
1896
- // Allow simple icon names
1897
- allowSimpleNames(true);
1898
- let _window;
1899
- try {
1900
- _window = window;
1901
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1902
- }
1903
- catch (err) {
1904
- //
1905
- }
1906
- if (_window) {
1907
- // Set cache and load existing cache
1908
- initBrowserStorage();
1909
- // Load icons from global "IconifyPreload"
1910
- if (_window.IconifyPreload !== void 0) {
1911
- const preload = _window.IconifyPreload;
1912
- const err = 'Invalid IconifyPreload syntax.';
1913
- if (typeof preload === 'object' && preload !== null) {
1914
- (preload instanceof Array ? preload : [preload]).forEach((item) => {
1915
- try {
1916
- if (
1917
- // Check if item is an object and not null/array
1918
- typeof item !== 'object' ||
1919
- item === null ||
1920
- item instanceof Array ||
1921
- // Check for 'icons' and 'prefix'
1922
- typeof item.icons !== 'object' ||
1923
- typeof item.prefix !== 'string' ||
1924
- // Add icon set
1925
- !addCollection$1(item)) {
1926
- console.error(err);
1927
- }
1928
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1929
- }
1930
- catch (e) {
1931
- console.error(err);
1932
- }
1933
- });
1934
- }
1935
- }
1936
- // Set API from global "IconifyProviders"
1937
- if (_window.IconifyProviders !== void 0) {
1938
- const providers = _window.IconifyProviders;
1939
- if (typeof providers === 'object' && providers !== null) {
1940
- for (const key in providers) {
1941
- const err = 'IconifyProviders[' + key + '] is invalid.';
1942
- try {
1943
- const value = providers[key];
1944
- if (typeof value !== 'object' ||
1945
- !value ||
1946
- value.resources === void 0) {
1947
- continue;
1948
- }
1949
- if (!addAPIProvider$1(key, value)) {
1950
- console.error(err);
1951
- }
1952
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1953
- }
1954
- catch (e) {
1955
- console.error(err);
1956
- }
1957
- }
1958
- }
1959
- }
1960
- }
1961
- const _api = {
1962
- getAPIConfig,
1963
- setAPIModule,
1964
- sendAPIQuery,
1965
- setFetch,
1966
- getFetch,
1967
- listAPIProviders,
1968
- };
1969
- return {
1970
- enableCache: (storage) => toggleBrowserCache(storage, true),
1971
- disableCache: (storage) => toggleBrowserCache(storage, false),
1972
- iconLoaded: iconLoaded$1,
1973
- iconExists: iconLoaded$1, // deprecated, kept to avoid breaking changes
1974
- getIcon: getIcon$1,
1975
- listIcons: listIcons$1,
1976
- addIcon: addIcon$1,
1977
- addCollection: addCollection$1,
1978
- calculateSize: calculateSize$1,
1979
- buildIcon: iconToSVG,
1980
- iconToHTML: iconToHTML$1,
1981
- svgToURL: svgToURL$1,
1982
- loadIcons: loadIcons$1,
1983
- loadIcon: loadIcon$1,
1984
- addAPIProvider: addAPIProvider$1,
1985
- setCustomIconLoader: setCustomIconLoader$1,
1986
- setCustomIconsLoader: setCustomIconsLoader$1,
1987
- appendCustomStyle,
1988
- _api,
1989
- };
1990
- }
1991
-
1992
- // List of properties to apply
1993
- const monotoneProps = {
1994
- 'background-color': 'currentColor',
1995
- };
1996
- const coloredProps = {
1997
- 'background-color': 'transparent',
1998
- };
1999
- // Dynamically add common props to variables above
2000
- const propsToAdd = {
2001
- image: 'var(--svg)',
2002
- repeat: 'no-repeat',
2003
- size: '100% 100%',
2004
- };
2005
- const propsToAddTo = {
2006
- '-webkit-mask': monotoneProps,
2007
- 'mask': monotoneProps,
2008
- 'background': coloredProps,
2009
- };
2010
- for (const prefix in propsToAddTo) {
2011
- const list = propsToAddTo[prefix];
2012
- for (const prop in propsToAdd) {
2013
- list[prefix + '-' + prop] = propsToAdd[prop];
2014
- }
2015
- }
2016
- /**
2017
- * Fix size: add 'px' to numbers
2018
- */
2019
- function fixSize(value) {
2020
- return value ? value + (value.match(/^[-0-9.]+$/) ? 'px' : '') : 'inherit';
2021
- }
2022
- /**
2023
- * Render node as <span>
2024
- */
2025
- function renderSPAN(data, icon, useMask) {
2026
- const node = document.createElement('span');
2027
- // Body
2028
- let body = data.body;
2029
- if (body.indexOf('<a') !== -1) {
2030
- // Animated SVG: add something to fix timing bug
2031
- body += '<!-- ' + Date.now() + ' -->';
2032
- }
2033
- // Generate SVG as URL
2034
- const renderAttribs = data.attributes;
2035
- const html = iconToHTML$1(body, {
2036
- ...renderAttribs,
2037
- width: icon.width + '',
2038
- height: icon.height + '',
2039
- });
2040
- const url = svgToURL$1(html);
2041
- // Generate style
2042
- const svgStyle = node.style;
2043
- const styles = {
2044
- '--svg': url,
2045
- 'width': fixSize(renderAttribs.width),
2046
- 'height': fixSize(renderAttribs.height),
2047
- ...(useMask ? monotoneProps : coloredProps),
2048
- };
2049
- // Apply style
2050
- for (const prop in styles) {
2051
- svgStyle.setProperty(prop, styles[prop]);
2052
- }
2053
- return node;
2054
- }
2055
-
2056
- let policy;
2057
- function createPolicy() {
2058
- try {
2059
- policy = window.trustedTypes.createPolicy("iconify", {
2060
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
2061
- createHTML: (s) => s
2062
- });
2063
- } catch (err) {
2064
- policy = null;
2065
- }
2066
- }
2067
- function cleanUpInnerHTML(html) {
2068
- if (policy === void 0) {
2069
- createPolicy();
2070
- }
2071
- return policy ? policy.createHTML(html) : html;
2072
- }
2073
-
2074
- /**
2075
- * Render node as <svg>
2076
- */
2077
- function renderSVG(data) {
2078
- const node = document.createElement('span');
2079
- // Add style if needed
2080
- const attr = data.attributes;
2081
- let style = '';
2082
- if (!attr.width) {
2083
- style = 'width: inherit;';
2084
- }
2085
- if (!attr.height) {
2086
- style += 'height: inherit;';
2087
- }
2088
- if (style) {
2089
- attr.style = style;
2090
- }
2091
- // Generate SVG
2092
- const html = iconToHTML$1(data.body, attr);
2093
- node.innerHTML = cleanUpInnerHTML(html);
2094
- return node.firstChild;
2095
- }
2096
-
2097
- /**
2098
- * Find icon node
2099
- */
2100
- function findIconElement(parent) {
2101
- return Array.from(parent.childNodes).find((node) => {
2102
- const tag = node.tagName &&
2103
- node.tagName.toUpperCase();
2104
- return tag === 'SPAN' || tag === 'SVG';
2105
- });
2106
- }
2107
- /**
2108
- * Render icon
2109
- */
2110
- function renderIcon(parent, state) {
2111
- const iconData = state.icon.data;
2112
- const customisations = state.customisations;
2113
- // Render icon
2114
- const renderData = iconToSVG(iconData, customisations);
2115
- if (customisations.preserveAspectRatio) {
2116
- renderData.attributes['preserveAspectRatio'] =
2117
- customisations.preserveAspectRatio;
2118
- }
2119
- const mode = state.renderedMode;
2120
- let node;
2121
- switch (mode) {
2122
- case 'svg':
2123
- node = renderSVG(renderData);
2124
- break;
2125
- default:
2126
- node = renderSPAN(renderData, {
2127
- ...defaultIconProps,
2128
- ...iconData,
2129
- }, mode === 'mask');
2130
- }
2131
- // Set element
2132
- const oldNode = findIconElement(parent);
2133
- if (oldNode) {
2134
- // Replace old element
2135
- if (node.tagName === 'SPAN' && oldNode.tagName === node.tagName) {
2136
- // Swap style instead of whole node
2137
- oldNode.setAttribute('style', node.getAttribute('style'));
2138
- }
2139
- else {
2140
- parent.replaceChild(node, oldNode);
2141
- }
2142
- }
2143
- else {
2144
- // Add new element
2145
- parent.appendChild(node);
2146
- }
2147
- }
2148
-
2149
- /**
2150
- * Set state to PendingState
2151
- */
2152
- function setPendingState(icon, inline, lastState) {
2153
- const lastRender = lastState &&
2154
- (lastState.rendered
2155
- ? lastState
2156
- : lastState.lastRender);
2157
- return {
2158
- rendered: false,
2159
- inline,
2160
- icon,
2161
- lastRender,
2162
- };
2163
- }
2164
-
2165
- /**
2166
- * Register 'iconify-icon' component, if it does not exist
2167
- */
2168
- function defineIconifyIcon(name = 'iconify-icon') {
2169
- // Check for custom elements registry and HTMLElement
2170
- let customElements;
2171
- let ParentClass;
2172
- try {
2173
- customElements = window.customElements;
2174
- ParentClass = window.HTMLElement;
2175
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2176
- }
2177
- catch (err) {
2178
- return;
2179
- }
2180
- // Make sure registry and HTMLElement exist
2181
- if (!customElements || !ParentClass) {
2182
- return;
2183
- }
2184
- // Check for duplicate
2185
- const ConflictingClass = customElements.get(name);
2186
- if (ConflictingClass) {
2187
- return ConflictingClass;
2188
- }
2189
- // All attributes
2190
- const attributes = [
2191
- // Icon
2192
- 'icon',
2193
- // Mode
2194
- 'mode',
2195
- 'inline',
2196
- 'noobserver',
2197
- // Customisations
2198
- 'width',
2199
- 'height',
2200
- 'rotate',
2201
- 'flip',
2202
- ];
2203
- /**
2204
- * Component class
2205
- */
2206
- const IconifyIcon = class extends ParentClass {
2207
- // Root
2208
- _shadowRoot;
2209
- // Initialised
2210
- _initialised = false;
2211
- // Icon state
2212
- _state;
2213
- // Attributes check queued
2214
- _checkQueued = false;
2215
- // Connected
2216
- _connected = false;
2217
- // Observer
2218
- _observer = null;
2219
- _visible = true;
2220
- /**
2221
- * Constructor
2222
- */
2223
- constructor() {
2224
- super();
2225
- // Attach shadow DOM
2226
- const root = (this._shadowRoot = this.attachShadow({
2227
- mode: 'open',
2228
- }));
2229
- // Add style
2230
- const inline = this.hasAttribute('inline');
2231
- updateStyle(root, inline);
2232
- // Create empty state
2233
- this._state = setPendingState({
2234
- value: '',
2235
- }, inline);
2236
- // Queue icon render
2237
- this._queueCheck();
2238
- }
2239
- /**
2240
- * Connected to DOM
2241
- */
2242
- connectedCallback() {
2243
- this._connected = true;
2244
- this.startObserver();
2245
- }
2246
- /**
2247
- * Disconnected from DOM
2248
- */
2249
- disconnectedCallback() {
2250
- this._connected = false;
2251
- this.stopObserver();
2252
- }
2253
- /**
2254
- * Observed attributes
2255
- */
2256
- static get observedAttributes() {
2257
- return attributes.slice(0);
2258
- }
2259
- /**
2260
- * Observed properties that are different from attributes
2261
- *
2262
- * Experimental! Need to test with various frameworks that support it
2263
- */
2264
- /*
2265
- static get properties() {
2266
- return {
2267
- inline: {
2268
- type: Boolean,
2269
- reflect: true,
2270
- },
2271
- // Not listing other attributes because they are strings or combination
2272
- // of string and another type. Cannot have multiple types
2273
- };
2274
- }
2275
- */
2276
- /**
2277
- * Attribute has changed
2278
- */
2279
- attributeChangedCallback(name) {
2280
- switch (name) {
2281
- case 'inline': {
2282
- // Update immediately: not affected by other attributes
2283
- const newInline = this.hasAttribute('inline');
2284
- const state = this._state;
2285
- if (newInline !== state.inline) {
2286
- // Update style if inline mode changed
2287
- state.inline = newInline;
2288
- updateStyle(this._shadowRoot, newInline);
2289
- }
2290
- break;
2291
- }
2292
- case 'noobserver': {
2293
- const value = this.hasAttribute('noobserver');
2294
- if (value) {
2295
- this.startObserver();
2296
- }
2297
- else {
2298
- this.stopObserver();
2299
- }
2300
- break;
2301
- }
2302
- default:
2303
- // Queue check for other attributes
2304
- this._queueCheck();
2305
- }
2306
- }
2307
- /**
2308
- * Get/set icon
2309
- */
2310
- get icon() {
2311
- const value = this.getAttribute('icon');
2312
- if (value && value.slice(0, 1) === '{') {
2313
- try {
2314
- return JSON.parse(value);
2315
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2316
- }
2317
- catch (err) {
2318
- //
2319
- }
2320
- }
2321
- return value;
2322
- }
2323
- set icon(value) {
2324
- if (typeof value === 'object') {
2325
- value = JSON.stringify(value);
2326
- }
2327
- this.setAttribute('icon', value);
2328
- }
2329
- /**
2330
- * Get/set inline
2331
- */
2332
- get inline() {
2333
- return this.hasAttribute('inline');
2334
- }
2335
- set inline(value) {
2336
- if (value) {
2337
- this.setAttribute('inline', 'true');
2338
- }
2339
- else {
2340
- this.removeAttribute('inline');
2341
- }
2342
- }
2343
- /**
2344
- * Get/set observer
2345
- */
2346
- get observer() {
2347
- return this.hasAttribute('observer');
2348
- }
2349
- set observer(value) {
2350
- if (value) {
2351
- this.setAttribute('observer', 'true');
2352
- }
2353
- else {
2354
- this.removeAttribute('observer');
2355
- }
2356
- }
2357
- /**
2358
- * Restart animation
2359
- */
2360
- restartAnimation() {
2361
- const state = this._state;
2362
- if (state.rendered) {
2363
- const root = this._shadowRoot;
2364
- if (state.renderedMode === 'svg') {
2365
- // Update root node
2366
- try {
2367
- root.lastChild.setCurrentTime(0);
2368
- return;
2369
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2370
- }
2371
- catch (err) {
2372
- // Failed: setCurrentTime() is not supported
2373
- }
2374
- }
2375
- renderIcon(root, state);
2376
- }
2377
- }
2378
- /**
2379
- * Get status
2380
- */
2381
- get status() {
2382
- const state = this._state;
2383
- return state.rendered
2384
- ? 'rendered'
2385
- : state.icon.data === null
2386
- ? 'failed'
2387
- : 'loading';
2388
- }
2389
- /**
2390
- * Queue attributes re-check
2391
- */
2392
- _queueCheck() {
2393
- if (!this._checkQueued) {
2394
- this._checkQueued = true;
2395
- setTimeout(() => {
2396
- this._check();
2397
- });
2398
- }
2399
- }
2400
- /**
2401
- * Check for changes
2402
- */
2403
- _check() {
2404
- if (!this._checkQueued) {
2405
- return;
2406
- }
2407
- this._checkQueued = false;
2408
- const state = this._state;
2409
- // Get icon
2410
- const newIcon = this.getAttribute('icon');
2411
- if (newIcon !== state.icon.value) {
2412
- this._iconChanged(newIcon);
2413
- return;
2414
- }
2415
- // Ignore other attributes if icon is not rendered
2416
- if (!state.rendered || !this._visible) {
2417
- return;
2418
- }
2419
- // Check for mode and attribute changes
2420
- const mode = this.getAttribute('mode');
2421
- const customisations = getCustomisations(this);
2422
- if (state.attrMode !== mode ||
2423
- haveCustomisationsChanged(state.customisations, customisations) ||
2424
- !findIconElement(this._shadowRoot)) {
2425
- this._renderIcon(state.icon, customisations, mode);
2426
- }
2427
- }
2428
- /**
2429
- * Icon value has changed
2430
- */
2431
- _iconChanged(newValue) {
2432
- const icon = parseIconValue(newValue, (value, name, data) => {
2433
- // Asynchronous callback: re-check values to make sure stuff wasn't changed
2434
- const state = this._state;
2435
- if (state.rendered || this.getAttribute('icon') !== value) {
2436
- // Icon data is already available or icon attribute was changed
2437
- return;
2438
- }
2439
- // Change icon
2440
- const icon = {
2441
- value,
2442
- name,
2443
- data,
2444
- };
2445
- if (icon.data) {
2446
- // Render icon
2447
- this._gotIconData(icon);
2448
- }
2449
- else {
2450
- // Nothing to render: update icon in state
2451
- state.icon = icon;
2452
- }
2453
- });
2454
- if (icon.data) {
2455
- // Icon is ready to render
2456
- this._gotIconData(icon);
2457
- }
2458
- else {
2459
- // Pending icon
2460
- this._state = setPendingState(icon, this._state.inline, this._state);
2461
- }
2462
- }
2463
- /**
2464
- * Force render icon on state change
2465
- */
2466
- _forceRender() {
2467
- if (!this._visible) {
2468
- // Remove icon
2469
- const node = findIconElement(this._shadowRoot);
2470
- if (node) {
2471
- this._shadowRoot.removeChild(node);
2472
- }
2473
- return;
2474
- }
2475
- // Re-render icon
2476
- this._queueCheck();
2477
- }
2478
- /**
2479
- * Got new icon data, icon is ready to (re)render
2480
- */
2481
- _gotIconData(icon) {
2482
- this._checkQueued = false;
2483
- this._renderIcon(icon, getCustomisations(this), this.getAttribute('mode'));
2484
- }
2485
- /**
2486
- * Re-render based on icon data
2487
- */
2488
- _renderIcon(icon, customisations, attrMode) {
2489
- // Get mode
2490
- const renderedMode = getRenderMode(icon.data.body, attrMode);
2491
- // Inline was not changed
2492
- const inline = this._state.inline;
2493
- // Set state and render
2494
- renderIcon(this._shadowRoot, (this._state = {
2495
- rendered: true,
2496
- icon,
2497
- inline,
2498
- customisations,
2499
- attrMode,
2500
- renderedMode,
2501
- }));
2502
- }
2503
- /**
2504
- * Start observer
2505
- */
2506
- startObserver() {
2507
- if (!this._observer && !this.hasAttribute('noobserver')) {
2508
- try {
2509
- this._observer = new IntersectionObserver((entries) => {
2510
- const intersecting = entries.some((entry) => entry.isIntersecting);
2511
- if (intersecting !== this._visible) {
2512
- this._visible = intersecting;
2513
- this._forceRender();
2514
- }
2515
- });
2516
- this._observer.observe(this);
2517
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2518
- }
2519
- catch (err) {
2520
- // Something went wrong, possibly observer is not supported
2521
- if (this._observer) {
2522
- try {
2523
- this._observer.disconnect();
2524
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2525
- }
2526
- catch (err) {
2527
- //
2528
- }
2529
- this._observer = null;
2530
- }
2531
- }
2532
- }
2533
- }
2534
- /**
2535
- * Stop observer
2536
- */
2537
- stopObserver() {
2538
- if (this._observer) {
2539
- this._observer.disconnect();
2540
- this._observer = null;
2541
- this._visible = true;
2542
- if (this._connected) {
2543
- // Render icon
2544
- this._forceRender();
2545
- }
2546
- }
2547
- }
2548
- };
2549
- // Add getters and setters
2550
- attributes.forEach((attr) => {
2551
- if (!(attr in IconifyIcon.prototype)) {
2552
- Object.defineProperty(IconifyIcon.prototype, attr, {
2553
- get: function () {
2554
- return this.getAttribute(attr);
2555
- },
2556
- set: function (value) {
2557
- if (value !== null) {
2558
- this.setAttribute(attr, value);
2559
- }
2560
- else {
2561
- this.removeAttribute(attr);
2562
- }
2563
- },
2564
- });
2565
- }
2566
- });
2567
- // Add exported functions: both as static and instance methods
2568
- const functions = exportFunctions();
2569
- for (const key in functions) {
2570
- IconifyIcon[key] = IconifyIcon.prototype[key] = functions[key];
2571
- }
2572
- // Define new component
2573
- customElements.define(name, IconifyIcon);
2574
- return IconifyIcon;
2575
- }
2576
-
2577
- /**
2578
- * Create exported data: either component instance or functions
2579
- */
2580
- defineIconifyIcon() || exportFunctions();
2581
-
2582
- const iconCss = "*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;-moz-appearance:button;appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}[hidden]{display:none}.d-flex{display:-ms-flexbox !important;display:flex !important}.align-items-center{-ms-flex-align:center !important;align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter) * 0.5);padding-right:calc(var(--grid-gutter) * 0.5);width:100%}.col{-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.container{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter) * -0.5);margin-right:calc(var(--grid-gutter) * -0.5)}@media (min-width: 576px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width: 992px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width: 1600px){.container{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.mr-2{margin-right:var(--spacing-scale-base) !important}.mr-n2{margin-right:calc(var(--spacing-scale-base) * -1) !important}.ml-2{margin-left:var(--spacing-scale-base) !important}.mb-3{margin-bottom:var(--spacing-scale-2x) !important}.mr-auto{margin-right:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.py-3{padding-bottom:var(--spacing-scale-2x) !important;padding-top:var(--spacing-scale-2x) !important}.py-4{padding-bottom:var(--spacing-scale-3x) !important;padding-top:var(--spacing-scale-3x) !important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}:-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.text-pure-0{color:var(--pure-0) !important}.text-primary-default{color:var(--color-primary-default) !important}.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-support-01) !important}.text-nowrap{white-space:nowrap !important}.text-base{font-size:var(--font-size-scale-base) !important}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear, left top, left bottom, from(var(--status-highlight-overlay)), to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}:host{margin:var(--spacing-scale-base)}";
2583
- const BrIconStyle0 = iconCss;
2584
-
2585
- const Icon = class {
2586
- constructor(hostRef) {
2587
- index.registerInstance(this, hostRef);
2588
- this.inheritedAttributes = {};
2589
- this.iconName = undefined;
2590
- this.height = '16';
2591
- this.width = '24';
2592
- this.cssClasses = undefined;
2593
- this.isInline = false;
2594
- this.rotate = undefined;
2595
- this.flip = undefined;
2596
- }
2597
- componentWillLoad() {
2598
- this.inheritedAttributes = inheritedAttributes.inheritAriaAttributes(this.el);
2599
- }
2600
- render() {
2601
- return (index.h(index.Host, { key: '8f8bfea88c86a9b917adf9921f95a3eb7b58a8ab' }, index.h("iconify-icon", Object.assign({ key: 'ec5a2e4483d871624730e48b63d323617863d821', flip: this.flip, width: this.width, class: this.cssClasses, icon: this.iconName, inline: this.isInline, height: this.height, rotate: this.rotate }, this.inheritedAttributes))));
2602
- }
2603
- get el() { return index.getElement(this); }
2604
- };
2605
- Icon.style = BrIconStyle0;
2606
-
2607
- exports.br_button = Button;
2608
- exports.br_icon = Icon;
2609
-
2610
- //# sourceMappingURL=br-button_2.cjs.entry.js.map