@ankhorage/zora 27.10.4 → 27.10.6

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 (265) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/dist/features/carousel/Carousel.js +3 -1
  4. package/dist/features/carousel/Carousel.js.map +1 -1
  5. package/dist/features/carousel/useCarouselPlayback.d.ts.map +1 -1
  6. package/dist/features/carousel/useCarouselPlayback.js +2 -1
  7. package/dist/features/carousel/useCarouselPlayback.js.map +1 -1
  8. package/dist/features/color/ColorHexField.d.ts +9 -0
  9. package/dist/features/color/ColorHexField.d.ts.map +1 -0
  10. package/dist/features/color/ColorHexField.js +17 -0
  11. package/dist/features/color/ColorHexField.js.map +1 -0
  12. package/dist/features/color/ColorHorizontalPointerProxy.d.ts +9 -0
  13. package/dist/features/color/ColorHorizontalPointerProxy.d.ts.map +1 -0
  14. package/dist/features/color/ColorHorizontalPointerProxy.js +2 -0
  15. package/dist/features/color/ColorHorizontalPointerProxy.js.map +1 -0
  16. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts +4 -0
  17. package/dist/features/color/ColorHorizontalPointerProxy.native.d.ts.map +1 -0
  18. package/dist/features/color/ColorHorizontalPointerProxy.native.js +5 -0
  19. package/dist/features/color/ColorHorizontalPointerProxy.native.js.map +1 -0
  20. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts +5 -0
  21. package/dist/features/color/ColorHorizontalPointerProxy.web.d.ts.map +1 -0
  22. package/dist/features/color/ColorHorizontalPointerProxy.web.js +26 -0
  23. package/dist/features/color/ColorHorizontalPointerProxy.web.js.map +1 -0
  24. package/dist/features/color/ColorHueScale.d.ts.map +1 -1
  25. package/dist/features/color/ColorHueScale.js +18 -7
  26. package/dist/features/color/ColorHueScale.js.map +1 -1
  27. package/dist/features/color/ColorPicker.d.ts.map +1 -1
  28. package/dist/features/color/ColorPicker.js +37 -10
  29. package/dist/features/color/ColorPicker.js.map +1 -1
  30. package/dist/features/color/ColorSpectrumSlider.d.ts +9 -0
  31. package/dist/features/color/ColorSpectrumSlider.d.ts.map +1 -0
  32. package/dist/features/color/ColorSpectrumSlider.js +38 -0
  33. package/dist/features/color/ColorSpectrumSlider.js.map +1 -0
  34. package/dist/features/color/ColorTone.d.ts.map +1 -1
  35. package/dist/features/color/ColorTone.js +71 -12
  36. package/dist/features/color/ColorTone.js.map +1 -1
  37. package/dist/features/color/ColorWheel.d.ts.map +1 -1
  38. package/dist/features/color/ColorWheel.js +64 -36
  39. package/dist/features/color/ColorWheel.js.map +1 -1
  40. package/dist/features/color/ColorWheelPointerProxy.d.ts +10 -0
  41. package/dist/features/color/ColorWheelPointerProxy.d.ts.map +1 -0
  42. package/dist/features/color/ColorWheelPointerProxy.js +2 -0
  43. package/dist/features/color/ColorWheelPointerProxy.js.map +1 -0
  44. package/dist/features/color/ColorWheelPointerProxy.native.d.ts +4 -0
  45. package/dist/features/color/ColorWheelPointerProxy.native.d.ts.map +1 -0
  46. package/dist/features/color/ColorWheelPointerProxy.native.js +5 -0
  47. package/dist/features/color/ColorWheelPointerProxy.native.js.map +1 -0
  48. package/dist/features/color/ColorWheelPointerProxy.web.d.ts +5 -0
  49. package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -0
  50. package/dist/features/color/ColorWheelPointerProxy.web.js +26 -0
  51. package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -0
  52. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
  53. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +14 -2
  54. package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
  55. package/dist/types/color.d.ts +2 -0
  56. package/dist/types/color.d.ts.map +1 -1
  57. package/dist/types/color.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/features/carousel/Carousel.test.ts +1 -0
  60. package/src/features/carousel/Carousel.tsx +3 -1
  61. package/src/features/carousel/useCarouselPlayback.ts +2 -1
  62. package/src/features/color/ColorHexField.tsx +45 -0
  63. package/src/features/color/ColorHorizontalPointerProxy.native.tsx +6 -0
  64. package/src/features/color/ColorHorizontalPointerProxy.tsx +10 -0
  65. package/src/features/color/ColorHorizontalPointerProxy.web.tsx +45 -0
  66. package/src/features/color/ColorHueScale.tsx +48 -29
  67. package/src/features/color/ColorPicker.layout.test.tsx +72 -0
  68. package/src/features/color/ColorPicker.tsx +74 -20
  69. package/src/features/color/ColorSpectrumSlider.tsx +79 -0
  70. package/src/features/color/ColorTone.tsx +138 -21
  71. package/src/features/color/ColorWheel.tsx +173 -92
  72. package/src/features/color/ColorWheelPointerProxy.native.tsx +6 -0
  73. package/src/features/color/ColorWheelPointerProxy.tsx +11 -0
  74. package/src/features/color/ColorWheelPointerProxy.web.tsx +51 -0
  75. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +18 -0
  76. package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +18 -2
  77. package/src/types/color.ts +2 -0
  78. package/web-dist/chunks/{Accordion-mxad79vq.js → Accordion-0kr0h68p.js} +4568 -669
  79. package/web-dist/chunks/{Accordion-0jkpvxwd.js → Accordion-1etqb3cj.js} +2 -2
  80. package/web-dist/chunks/{Accordion-jr0201qc.js → Accordion-1mxnyexh.js} +17 -17
  81. package/web-dist/chunks/{Accordion-9kkfz7s8.js → Accordion-3ecnh8d0.js} +4 -4
  82. package/web-dist/chunks/{Accordion-jsapannb.js → Accordion-3jkeydhb.js} +4 -4
  83. package/web-dist/chunks/{Accordion-r6gwemh9.js → Accordion-3wkd5x2q.js} +3 -3
  84. package/web-dist/chunks/{Accordion-0bgzetnd.js → Accordion-3zw817fr.js} +6 -6
  85. package/web-dist/chunks/{Accordion-91v243pz.js → Accordion-49w9bc2f.js} +2 -2
  86. package/web-dist/chunks/{Accordion-8vw4k0s6.js → Accordion-4g54je0w.js} +2 -2
  87. package/web-dist/chunks/{Accordion-1andv7gg.js → Accordion-5vs1k81g.js} +8 -8
  88. package/web-dist/chunks/{Accordion-ttjyk97v.js → Accordion-6m3k4avp.js} +2 -2
  89. package/web-dist/chunks/{Accordion-dnfrzbpb.js → Accordion-6nrpdbmb.js} +7 -7
  90. package/web-dist/chunks/{Accordion-y524ph0g.js → Accordion-6yv4beha.js} +1 -1
  91. package/web-dist/chunks/{Accordion-9cpm8x92.js → Accordion-705yrq6w.js} +1 -1
  92. package/web-dist/chunks/{Accordion-th8pkeqc.js → Accordion-8g9c7890.js} +4 -4
  93. package/web-dist/chunks/{Accordion-6qesggn9.js → Accordion-9c63jn3m.js} +4 -4
  94. package/web-dist/chunks/{Accordion-1mjn0atk.js → Accordion-aws0caav.js} +3 -3
  95. package/web-dist/chunks/{Accordion-hha54x4c.js → Accordion-bd6q61s1.js} +5 -5
  96. package/web-dist/chunks/{Accordion-8rkwd0wx.js → Accordion-c0a7mhq3.js} +2 -2
  97. package/web-dist/chunks/{Accordion-j5wsx41j.js → Accordion-c3nna2bz.js} +1 -1
  98. package/web-dist/chunks/{Accordion-r6mc7qtj.js → Accordion-dfq04q82.js} +9 -9
  99. package/web-dist/chunks/{Accordion-nbje2ywp.js → Accordion-e3r3573t.js} +3 -3
  100. package/web-dist/chunks/{Accordion-hqg1zbxk.js → Accordion-e5jr9ahb.js} +1 -1
  101. package/web-dist/chunks/{Accordion-pkbvsn5y.js → Accordion-eak89n4n.js} +6 -6
  102. package/web-dist/chunks/{Accordion-7e0mb55z.js → Accordion-f60g73bp.js} +6 -6
  103. package/web-dist/chunks/{Accordion-grtf75xt.js → Accordion-g451f3g9.js} +4 -4
  104. package/web-dist/chunks/{Accordion-27rxpbvf.js → Accordion-gezcm372.js} +4 -4
  105. package/web-dist/chunks/{Accordion-45tbe5v0.js → Accordion-h0e95qxp.js} +9 -9
  106. package/web-dist/chunks/{Accordion-m7jt3c87.js → Accordion-h2nd5y0z.js} +5 -5
  107. package/web-dist/chunks/{Accordion-f6k281sv.js → Accordion-j0zhpq4s.js} +7 -7
  108. package/web-dist/chunks/{Accordion-q6xnm1k4.js → Accordion-jbwey4za.js} +17 -17
  109. package/web-dist/chunks/{Accordion-vdqc8rxv.js → Accordion-jd26f516.js} +3 -3
  110. package/web-dist/chunks/{Accordion-1k7pyxdd.js → Accordion-ne91vwkd.js} +2 -2
  111. package/web-dist/chunks/{Accordion-k058095e.js → Accordion-p29kmwh9.js} +1 -1
  112. package/web-dist/chunks/{Accordion-0pbcs0xf.js → Accordion-pcj256bc.js} +5 -5
  113. package/web-dist/chunks/{Accordion-8wq38d9b.js → Accordion-phtyg3k4.js} +7 -7
  114. package/web-dist/chunks/{Accordion-b991pn6e.js → Accordion-pmfdf08d.js} +1 -1
  115. package/web-dist/chunks/{Accordion-xp2t3pkj.js → Accordion-q1tdazgq.js} +8 -8
  116. package/web-dist/chunks/{Accordion-v21vz0cg.js → Accordion-qhn8z92r.js} +3 -3
  117. package/web-dist/chunks/Accordion-r1wkgt7c.js +1074 -0
  118. package/web-dist/chunks/{Accordion-ctcxh9pk.js → Accordion-rzf52xq8.js} +2 -2
  119. package/web-dist/chunks/{Accordion-hrxdchkq.js → Accordion-vewhx028.js} +8 -8
  120. package/web-dist/chunks/{Accordion-jsdjgfn2.js → Accordion-vk2v1zwv.js} +2 -2
  121. package/web-dist/chunks/{Accordion-19zt3dyq.js → Accordion-vnrqvfca.js} +1 -1
  122. package/web-dist/chunks/{Accordion-rt4jfq2r.js → Accordion-x0p3wxfp.js} +2 -2
  123. package/web-dist/chunks/{Accordion-w1ag7sr4.js → Accordion-x7ynjdv7.js} +1 -1
  124. package/web-dist/chunks/{Accordion-ga82tcs9.js → Accordion-xb174981.js} +10 -10
  125. package/web-dist/chunks/{Accordion-yskcfahv.js → Accordion-xwstve3k.js} +2 -2
  126. package/web-dist/chunks/{Accordion-xb2nj0q6.js → Accordion-ysmzrvhn.js} +3 -3
  127. package/web-dist/chunks/{Accordion-tnq8bt8v.js → Accordion-z4qakakw.js} +2 -2
  128. package/web-dist/chunks/{Accordion-w9vbdg9r.js → Accordion-z8ryq8cb.js} +11 -11
  129. package/web-dist/chunks/{Accordion-x3em7tpd.js → Accordion-zx8gmww4.js} +9 -9
  130. package/web-dist/components/accordion/Accordion.js +10 -10
  131. package/web-dist/components/accordion-item/AccordionItem.js +10 -10
  132. package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
  133. package/web-dist/components/app-bar/AppBar.js +15 -16
  134. package/web-dist/components/app-header/AppHeader.js +15 -16
  135. package/web-dist/components/app-shell/AppShell.js +4 -4
  136. package/web-dist/components/auth-screen/AuthScreen.js +20 -21
  137. package/web-dist/components/avatar/Avatar.js +10 -10
  138. package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
  139. package/web-dist/components/badge/Badge.js +5 -5
  140. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -19
  141. package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
  142. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
  143. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
  144. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
  145. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
  146. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
  147. package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -16
  148. package/web-dist/components/button/Button.js +13 -14
  149. package/web-dist/components/button-group/ButtonGroup.js +11 -12
  150. package/web-dist/components/calendar/Calendar.js +12 -13
  151. package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -19
  152. package/web-dist/components/card/Card.js +17 -18
  153. package/web-dist/components/card-back/CardBack.js +4 -4
  154. package/web-dist/components/card-hand/CardHand.js +4 -4
  155. package/web-dist/components/carousel/Carousel.js +7 -4
  156. package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
  157. package/web-dist/components/checkbox/Checkbox.js +10 -10
  158. package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
  159. package/web-dist/components/chess-board/ChessBoard.js +4 -4
  160. package/web-dist/components/chip/Chip.js +11 -11
  161. package/web-dist/components/chip-group/ChipGroup.js +11 -11
  162. package/web-dist/components/collection-editor/CollectionEditor.js +21 -22
  163. package/web-dist/components/color-hue-scale/ColorHueScale.js +15 -14
  164. package/web-dist/components/color-picker/ColorPicker.js +15 -14
  165. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +2 -0
  166. package/web-dist/components/color-tone/ColorTone.js +15 -14
  167. package/web-dist/components/color-wheel/ColorWheel.js +15 -14
  168. package/web-dist/components/content-rail/ContentRail.js +13 -14
  169. package/web-dist/components/data-table/DataTable.js +27 -28
  170. package/web-dist/components/date-picker/DatePicker.js +19 -20
  171. package/web-dist/components/dialog/Dialog.js +9 -9
  172. package/web-dist/components/divider/Divider.js +4 -4
  173. package/web-dist/components/empty-state/EmptyState.js +18 -19
  174. package/web-dist/components/explorer/Explorer.js +11 -11
  175. package/web-dist/components/field/Field.js +10 -10
  176. package/web-dist/components/file-explorer/FileExplorer.js +11 -11
  177. package/web-dist/components/flat-list/FlatList.js +11 -11
  178. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +20 -21
  179. package/web-dist/components/form/Form.js +14 -15
  180. package/web-dist/components/form-actions/FormActions.js +14 -15
  181. package/web-dist/components/form-error/FormError.js +14 -15
  182. package/web-dist/components/game/Game.js +5 -5
  183. package/web-dist/components/game-entity/GameEntity.js +5 -5
  184. package/web-dist/components/game-field/GameField.js +5 -5
  185. package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
  186. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
  187. package/web-dist/components/game-overlay/GameOverlay.js +5 -5
  188. package/web-dist/components/gradient/Gradient.js +5 -5
  189. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
  190. package/web-dist/components/graph-view/GraphView.js +9 -2
  191. package/web-dist/components/grid/Grid.js +4 -4
  192. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
  193. package/web-dist/components/grid-ruler/GridRuler.js +4 -4
  194. package/web-dist/components/heading/Heading.js +5 -5
  195. package/web-dist/components/hero/Hero.js +20 -21
  196. package/web-dist/components/icon/Icon.js +4 -4
  197. package/web-dist/components/icon-button/IconButton.js +11 -12
  198. package/web-dist/components/image/Image.js +8 -8
  199. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
  200. package/web-dist/components/list/List.js +11 -11
  201. package/web-dist/components/list-item/ListItem.js +11 -11
  202. package/web-dist/components/list-section/ListSection.js +11 -11
  203. package/web-dist/components/master-detail/MasterDetail.js +4 -4
  204. package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
  205. package/web-dist/components/media-card/MediaCard.js +17 -18
  206. package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
  207. package/web-dist/components/message-bubble/MessageBubble.js +14 -14
  208. package/web-dist/components/metric-card/MetricCard.js +17 -18
  209. package/web-dist/components/missing-element/MissingElement.js +9 -9
  210. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +20 -21
  211. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +20 -21
  212. package/web-dist/components/opening-book/OpeningBook.js +4 -4
  213. package/web-dist/components/otp-form/OtpForm.js +20 -21
  214. package/web-dist/components/pagination/Pagination.js +18 -19
  215. package/web-dist/components/palette-item/PaletteItem.js +17 -18
  216. package/web-dist/components/playing-card/PlayingCard.js +4 -4
  217. package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
  218. package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
  219. package/web-dist/components/post-card/PostCard.js +17 -18
  220. package/web-dist/components/product-card/ProductCard.js +17 -18
  221. package/web-dist/components/progress/Progress.js +8 -8
  222. package/web-dist/components/progress-ring/ProgressRing.js +8 -8
  223. package/web-dist/components/radio/Radio.js +12 -12
  224. package/web-dist/components/radio-group/RadioGroup.js +12 -12
  225. package/web-dist/components/rating/Rating.js +7 -7
  226. package/web-dist/components/reader/Reader.js +20 -21
  227. package/web-dist/components/scan-overlay/ScanOverlay.js +18 -19
  228. package/web-dist/components/screen/Screen.js +4 -4
  229. package/web-dist/components/screen-section/ScreenSection.js +8 -8
  230. package/web-dist/components/scroll-view/ScrollView.js +4 -4
  231. package/web-dist/components/search-input/SearchInput.js +12 -13
  232. package/web-dist/components/section-header/SectionHeader.js +8 -8
  233. package/web-dist/components/section-list/SectionList.js +11 -11
  234. package/web-dist/components/select/Select.js +16 -17
  235. package/web-dist/components/selectable-item/SelectableItem.js +3 -3
  236. package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
  237. package/web-dist/components/sign-in-form/SignInForm.js +20 -21
  238. package/web-dist/components/sign-up-form/SignUpForm.js +20 -21
  239. package/web-dist/components/skeleton/Skeleton.js +20 -21
  240. package/web-dist/components/skeleton-card/SkeletonCard.js +20 -21
  241. package/web-dist/components/skeleton-list/SkeletonList.js +20 -21
  242. package/web-dist/components/skeleton-text/SkeletonText.js +20 -21
  243. package/web-dist/components/surface/Surface.js +5 -5
  244. package/web-dist/components/switch/Switch.js +5 -5
  245. package/web-dist/components/tab/Tab.js +5 -5
  246. package/web-dist/components/tab-list/TabList.js +5 -5
  247. package/web-dist/components/tab-panel/TabPanel.js +5 -5
  248. package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
  249. package/web-dist/components/tabs/Tabs.js +5 -5
  250. package/web-dist/components/text/Text.js +5 -5
  251. package/web-dist/components/text-input/TextInput.js +12 -13
  252. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +12 -13
  253. package/web-dist/components/time-picker/TimePicker.js +19 -20
  254. package/web-dist/components/timeline/Timeline.js +10 -10
  255. package/web-dist/components/toast/Toast.js +7 -7
  256. package/web-dist/components/toast-provider/ToastProvider.js +7 -7
  257. package/web-dist/components/toolbar/Toolbar.js +17 -18
  258. package/web-dist/components/tree-item/TreeItem.js +17 -18
  259. package/web-dist/components/uploader/Uploader.js +26 -27
  260. package/web-dist/components/view/View.js +4 -4
  261. package/web-dist/manifest.json +1417 -1459
  262. package/web-dist/runtime/ZoraProvider.js +6 -6
  263. package/web-dist/chunks/Accordion-fjnb7anx.js +0 -548
  264. package/web-dist/chunks/Accordion-ztcmb44y.js +0 -3928
  265. package/web-dist/chunks/{Accordion-ng79nxzz.js → Accordion-an5prgty.js} +18 -18
@@ -1,3928 +0,0 @@
1
- 'use client';
2
- import {
3
- Icon3
4
- } from "./Accordion-b991pn6e.js";
5
- import {
6
- useTheme
7
- } from "./Accordion-ng79nxzz.js";
8
- import {
9
- View3
10
- } from "./Accordion-w1ag7sr4.js";
11
- import {
12
- Pressable
13
- } from "./Accordion-ctcxh9pk.js";
14
- import {
15
- Text2
16
- } from "./Accordion-9cpm8x92.js";
17
- import {
18
- resolveControlSize,
19
- resolveIconSize2,
20
- resolveButtonColors
21
- } from "./Accordion-6ec4gxv2.js";
22
- import {
23
- require_cjs
24
- } from "./Accordion-xgpzh4wq.js";
25
- import {
26
- __toESM,
27
- __commonJS
28
- } from "./Accordion-nh0cs9hq.js";
29
-
30
- // node_modules/react-native-svg/lib/module/lib/extract/transform.js
31
- var require_transform = __commonJS(function(exports, module) {
32
- function peg$subclass(child, parent) {
33
- function ctor() {
34
- this.constructor = child;
35
- }
36
- ctor.prototype = parent.prototype;
37
- child.prototype = new ctor;
38
- }
39
- function peg$SyntaxError(message, expected, found, location) {
40
- this.message = message;
41
- this.expected = expected;
42
- this.found = found;
43
- this.location = location;
44
- this.name = "SyntaxError";
45
- if (typeof Error.captureStackTrace === "function") {
46
- Error.captureStackTrace(this, peg$SyntaxError);
47
- }
48
- }
49
- peg$subclass(peg$SyntaxError, Error);
50
- peg$SyntaxError.buildMessage = function(expected, found) {
51
- var DESCRIBE_EXPECTATION_FNS = {
52
- literal: function(expectation) {
53
- return '"' + literalEscape(expectation.text) + '"';
54
- },
55
- class: function(expectation) {
56
- var escapedParts = "", i;
57
- for (i = 0;i < expectation.parts.length; i++) {
58
- escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
59
- }
60
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
61
- },
62
- any: function(expectation) {
63
- return "any character";
64
- },
65
- end: function(expectation) {
66
- return "end of input";
67
- },
68
- other: function(expectation) {
69
- return expectation.description;
70
- }
71
- };
72
- function hex(ch) {
73
- return ch.charCodeAt(0).toString(16).toUpperCase();
74
- }
75
- function literalEscape(s) {
76
- return s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
77
- return "\\x0" + hex(ch);
78
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
79
- return "\\x" + hex(ch);
80
- });
81
- }
82
- function classEscape(s) {
83
- return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
84
- return "\\x0" + hex(ch);
85
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
86
- return "\\x" + hex(ch);
87
- });
88
- }
89
- function describeExpectation(expectation) {
90
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
91
- }
92
- function describeExpected(expected) {
93
- var descriptions = new Array(expected.length), i, j;
94
- for (i = 0;i < expected.length; i++) {
95
- descriptions[i] = describeExpectation(expected[i]);
96
- }
97
- descriptions.sort();
98
- if (descriptions.length > 0) {
99
- for (i = 1, j = 1;i < descriptions.length; i++) {
100
- if (descriptions[i - 1] !== descriptions[i]) {
101
- descriptions[j] = descriptions[i];
102
- j++;
103
- }
104
- }
105
- descriptions.length = j;
106
- }
107
- switch (descriptions.length) {
108
- case 1:
109
- return descriptions[0];
110
- case 2:
111
- return descriptions[0] + " or " + descriptions[1];
112
- default:
113
- return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
114
- }
115
- }
116
- function describeFound(found) {
117
- return found ? '"' + literalEscape(found) + '"' : "end of input";
118
- }
119
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
120
- };
121
- function peg$parse(input, options) {
122
- options = options !== undefined ? options : {};
123
- var peg$FAILED = {}, peg$startRuleFunctions = {
124
- transformList: peg$parsetransformList
125
- }, peg$startRuleFunction = peg$parsetransformList, peg$c0 = function(ts) {
126
- return ts;
127
- }, peg$c1 = function(t, ts) {
128
- return multiply_matrices(t, ts);
129
- }, peg$c2 = "matrix", peg$c3 = peg$literalExpectation("matrix", false), peg$c4 = "(", peg$c5 = peg$literalExpectation("(", false), peg$c6 = ")", peg$c7 = peg$literalExpectation(")", false), peg$c8 = function(a, b, c, d, e, f) {
130
- return [a, c, e, b, d, f];
131
- }, peg$c9 = "translate", peg$c10 = peg$literalExpectation("translate", false), peg$c11 = function(tx, ty) {
132
- return [1, 0, tx, 0, 1, ty || 0];
133
- }, peg$c12 = "scale", peg$c13 = peg$literalExpectation("scale", false), peg$c14 = function(sx, sy) {
134
- return [sx, 0, 0, 0, sy === null ? sx : sy, 0];
135
- }, peg$c15 = "rotate", peg$c16 = peg$literalExpectation("rotate", false), peg$c17 = function(angle, c) {
136
- var cos = Math.cos(deg2rad * angle);
137
- var sin = Math.sin(deg2rad * angle);
138
- if (c !== null) {
139
- var x = c[0];
140
- var y = c[1];
141
- return [cos, -sin, cos * -x + -sin * -y + x, sin, cos, sin * -x + cos * -y + y];
142
- }
143
- return [cos, -sin, 0, sin, cos, 0];
144
- }, peg$c18 = "skewX", peg$c19 = peg$literalExpectation("skewX", false), peg$c20 = function(angle) {
145
- return [1, Math.tan(deg2rad * angle), 0, 0, 1, 0];
146
- }, peg$c21 = "skewY", peg$c22 = peg$literalExpectation("skewY", false), peg$c23 = function(angle) {
147
- return [1, 0, 0, Math.tan(deg2rad * angle), 1, 0];
148
- }, peg$c24 = function(f) {
149
- return parseFloat(f.join(""));
150
- }, peg$c25 = function(i) {
151
- return parseInt(i.join(""));
152
- }, peg$c26 = function(n) {
153
- return n;
154
- }, peg$c27 = function(n1, n2) {
155
- return [n1, n2];
156
- }, peg$c28 = ",", peg$c29 = peg$literalExpectation(",", false), peg$c30 = function(ds) {
157
- return ds.join("");
158
- }, peg$c31 = function(f) {
159
- return f.join("");
160
- }, peg$c32 = function(d) {
161
- return d.join("");
162
- }, peg$c33 = peg$otherExpectation("fractionalConstant"), peg$c34 = ".", peg$c35 = peg$literalExpectation(".", false), peg$c36 = function(d1, d2) {
163
- return [d1 ? d1.join("") : null, ".", d2.join("")].join("");
164
- }, peg$c37 = /^[eE]/, peg$c38 = peg$classExpectation(["e", "E"], false, false), peg$c39 = function(e) {
165
- return [e[0], e[1], e[2].join("")].join("");
166
- }, peg$c40 = /^[+\-]/, peg$c41 = peg$classExpectation(["+", "-"], false, false), peg$c42 = /^[0-9]/, peg$c43 = peg$classExpectation([["0", "9"]], false, false), peg$c44 = /^[ \t\r\n]/, peg$c45 = peg$classExpectation([" ", "\t", "\r", `
167
- `], false, false), peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{
168
- line: 1,
169
- column: 1
170
- }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result;
171
- if ("startRule" in options) {
172
- if (!(options.startRule in peg$startRuleFunctions)) {
173
- throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
174
- }
175
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
176
- }
177
- function text() {
178
- return input.substring(peg$savedPos, peg$currPos);
179
- }
180
- function location() {
181
- return peg$computeLocation(peg$savedPos, peg$currPos);
182
- }
183
- function expected(description, location) {
184
- location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
185
- throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
186
- }
187
- function error(message, location) {
188
- location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
189
- throw peg$buildSimpleError(message, location);
190
- }
191
- function peg$literalExpectation(text, ignoreCase) {
192
- return {
193
- type: "literal",
194
- text,
195
- ignoreCase
196
- };
197
- }
198
- function peg$classExpectation(parts, inverted, ignoreCase) {
199
- return {
200
- type: "class",
201
- parts,
202
- inverted,
203
- ignoreCase
204
- };
205
- }
206
- function peg$anyExpectation() {
207
- return {
208
- type: "any"
209
- };
210
- }
211
- function peg$endExpectation() {
212
- return {
213
- type: "end"
214
- };
215
- }
216
- function peg$otherExpectation(description) {
217
- return {
218
- type: "other",
219
- description
220
- };
221
- }
222
- function peg$computePosDetails(pos) {
223
- var details = peg$posDetailsCache[pos], p;
224
- if (details) {
225
- return details;
226
- } else {
227
- p = pos - 1;
228
- while (!peg$posDetailsCache[p]) {
229
- p--;
230
- }
231
- details = peg$posDetailsCache[p];
232
- details = {
233
- line: details.line,
234
- column: details.column
235
- };
236
- while (p < pos) {
237
- if (input.charCodeAt(p) === 10) {
238
- details.line++;
239
- details.column = 1;
240
- } else {
241
- details.column++;
242
- }
243
- p++;
244
- }
245
- peg$posDetailsCache[pos] = details;
246
- return details;
247
- }
248
- }
249
- function peg$computeLocation(startPos, endPos) {
250
- var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos);
251
- return {
252
- start: {
253
- offset: startPos,
254
- line: startPosDetails.line,
255
- column: startPosDetails.column
256
- },
257
- end: {
258
- offset: endPos,
259
- line: endPosDetails.line,
260
- column: endPosDetails.column
261
- }
262
- };
263
- }
264
- function peg$fail(expected) {
265
- if (peg$currPos < peg$maxFailPos) {
266
- return;
267
- }
268
- if (peg$currPos > peg$maxFailPos) {
269
- peg$maxFailPos = peg$currPos;
270
- peg$maxFailExpected = [];
271
- }
272
- peg$maxFailExpected.push(expected);
273
- }
274
- function peg$buildSimpleError(message, location) {
275
- return new peg$SyntaxError(message, null, null, location);
276
- }
277
- function peg$buildStructuredError(expected, found, location) {
278
- return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
279
- }
280
- function peg$parsetransformList() {
281
- var s0, s1, s2, s3, s4;
282
- s0 = peg$currPos;
283
- s1 = [];
284
- s2 = peg$parsewsp();
285
- while (s2 !== peg$FAILED) {
286
- s1.push(s2);
287
- s2 = peg$parsewsp();
288
- }
289
- if (s1 !== peg$FAILED) {
290
- s2 = peg$parsetransforms();
291
- if (s2 === peg$FAILED) {
292
- s2 = null;
293
- }
294
- if (s2 !== peg$FAILED) {
295
- s3 = [];
296
- s4 = peg$parsewsp();
297
- while (s4 !== peg$FAILED) {
298
- s3.push(s4);
299
- s4 = peg$parsewsp();
300
- }
301
- if (s3 !== peg$FAILED) {
302
- peg$savedPos = s0;
303
- s1 = peg$c0(s2);
304
- s0 = s1;
305
- } else {
306
- peg$currPos = s0;
307
- s0 = peg$FAILED;
308
- }
309
- } else {
310
- peg$currPos = s0;
311
- s0 = peg$FAILED;
312
- }
313
- } else {
314
- peg$currPos = s0;
315
- s0 = peg$FAILED;
316
- }
317
- return s0;
318
- }
319
- function peg$parsetransforms() {
320
- var s0, s1, s2, s3;
321
- s0 = peg$currPos;
322
- s1 = peg$parsetransform();
323
- if (s1 !== peg$FAILED) {
324
- s2 = [];
325
- s3 = peg$parsecommaWsp();
326
- while (s3 !== peg$FAILED) {
327
- s2.push(s3);
328
- s3 = peg$parsecommaWsp();
329
- }
330
- if (s2 !== peg$FAILED) {
331
- s3 = peg$parsetransforms();
332
- if (s3 !== peg$FAILED) {
333
- peg$savedPos = s0;
334
- s1 = peg$c1(s1, s3);
335
- s0 = s1;
336
- } else {
337
- peg$currPos = s0;
338
- s0 = peg$FAILED;
339
- }
340
- } else {
341
- peg$currPos = s0;
342
- s0 = peg$FAILED;
343
- }
344
- } else {
345
- peg$currPos = s0;
346
- s0 = peg$FAILED;
347
- }
348
- if (s0 === peg$FAILED) {
349
- s0 = peg$parsetransform();
350
- }
351
- return s0;
352
- }
353
- function peg$parsetransform() {
354
- var s0;
355
- s0 = peg$parsematrix();
356
- if (s0 === peg$FAILED) {
357
- s0 = peg$parsetranslate();
358
- if (s0 === peg$FAILED) {
359
- s0 = peg$parsescale();
360
- if (s0 === peg$FAILED) {
361
- s0 = peg$parserotate();
362
- if (s0 === peg$FAILED) {
363
- s0 = peg$parseskewX();
364
- if (s0 === peg$FAILED) {
365
- s0 = peg$parseskewY();
366
- }
367
- }
368
- }
369
- }
370
- }
371
- return s0;
372
- }
373
- function peg$parsematrix() {
374
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
375
- s0 = peg$currPos;
376
- if (input.substr(peg$currPos, 6) === peg$c2) {
377
- s1 = peg$c2;
378
- peg$currPos += 6;
379
- } else {
380
- s1 = peg$FAILED;
381
- if (peg$silentFails === 0) {
382
- peg$fail(peg$c3);
383
- }
384
- }
385
- if (s1 !== peg$FAILED) {
386
- s2 = [];
387
- s3 = peg$parsewsp();
388
- while (s3 !== peg$FAILED) {
389
- s2.push(s3);
390
- s3 = peg$parsewsp();
391
- }
392
- if (s2 !== peg$FAILED) {
393
- if (input.charCodeAt(peg$currPos) === 40) {
394
- s3 = peg$c4;
395
- peg$currPos++;
396
- } else {
397
- s3 = peg$FAILED;
398
- if (peg$silentFails === 0) {
399
- peg$fail(peg$c5);
400
- }
401
- }
402
- if (s3 !== peg$FAILED) {
403
- s4 = [];
404
- s5 = peg$parsewsp();
405
- while (s5 !== peg$FAILED) {
406
- s4.push(s5);
407
- s5 = peg$parsewsp();
408
- }
409
- if (s4 !== peg$FAILED) {
410
- s5 = peg$parsenumber();
411
- if (s5 !== peg$FAILED) {
412
- s6 = peg$parsecommaWsp();
413
- if (s6 !== peg$FAILED) {
414
- s7 = peg$parsenumber();
415
- if (s7 !== peg$FAILED) {
416
- s8 = peg$parsecommaWsp();
417
- if (s8 !== peg$FAILED) {
418
- s9 = peg$parsenumber();
419
- if (s9 !== peg$FAILED) {
420
- s10 = peg$parsecommaWsp();
421
- if (s10 !== peg$FAILED) {
422
- s11 = peg$parsenumber();
423
- if (s11 !== peg$FAILED) {
424
- s12 = peg$parsecommaWsp();
425
- if (s12 !== peg$FAILED) {
426
- s13 = peg$parsenumber();
427
- if (s13 !== peg$FAILED) {
428
- s14 = peg$parsecommaWsp();
429
- if (s14 !== peg$FAILED) {
430
- s15 = peg$parsenumber();
431
- if (s15 !== peg$FAILED) {
432
- s16 = [];
433
- s17 = peg$parsewsp();
434
- while (s17 !== peg$FAILED) {
435
- s16.push(s17);
436
- s17 = peg$parsewsp();
437
- }
438
- if (s16 !== peg$FAILED) {
439
- if (input.charCodeAt(peg$currPos) === 41) {
440
- s17 = peg$c6;
441
- peg$currPos++;
442
- } else {
443
- s17 = peg$FAILED;
444
- if (peg$silentFails === 0) {
445
- peg$fail(peg$c7);
446
- }
447
- }
448
- if (s17 !== peg$FAILED) {
449
- peg$savedPos = s0;
450
- s1 = peg$c8(s5, s7, s9, s11, s13, s15);
451
- s0 = s1;
452
- } else {
453
- peg$currPos = s0;
454
- s0 = peg$FAILED;
455
- }
456
- } else {
457
- peg$currPos = s0;
458
- s0 = peg$FAILED;
459
- }
460
- } else {
461
- peg$currPos = s0;
462
- s0 = peg$FAILED;
463
- }
464
- } else {
465
- peg$currPos = s0;
466
- s0 = peg$FAILED;
467
- }
468
- } else {
469
- peg$currPos = s0;
470
- s0 = peg$FAILED;
471
- }
472
- } else {
473
- peg$currPos = s0;
474
- s0 = peg$FAILED;
475
- }
476
- } else {
477
- peg$currPos = s0;
478
- s0 = peg$FAILED;
479
- }
480
- } else {
481
- peg$currPos = s0;
482
- s0 = peg$FAILED;
483
- }
484
- } else {
485
- peg$currPos = s0;
486
- s0 = peg$FAILED;
487
- }
488
- } else {
489
- peg$currPos = s0;
490
- s0 = peg$FAILED;
491
- }
492
- } else {
493
- peg$currPos = s0;
494
- s0 = peg$FAILED;
495
- }
496
- } else {
497
- peg$currPos = s0;
498
- s0 = peg$FAILED;
499
- }
500
- } else {
501
- peg$currPos = s0;
502
- s0 = peg$FAILED;
503
- }
504
- } else {
505
- peg$currPos = s0;
506
- s0 = peg$FAILED;
507
- }
508
- } else {
509
- peg$currPos = s0;
510
- s0 = peg$FAILED;
511
- }
512
- } else {
513
- peg$currPos = s0;
514
- s0 = peg$FAILED;
515
- }
516
- } else {
517
- peg$currPos = s0;
518
- s0 = peg$FAILED;
519
- }
520
- return s0;
521
- }
522
- function peg$parsetranslate() {
523
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
524
- s0 = peg$currPos;
525
- if (input.substr(peg$currPos, 9) === peg$c9) {
526
- s1 = peg$c9;
527
- peg$currPos += 9;
528
- } else {
529
- s1 = peg$FAILED;
530
- if (peg$silentFails === 0) {
531
- peg$fail(peg$c10);
532
- }
533
- }
534
- if (s1 !== peg$FAILED) {
535
- s2 = [];
536
- s3 = peg$parsewsp();
537
- while (s3 !== peg$FAILED) {
538
- s2.push(s3);
539
- s3 = peg$parsewsp();
540
- }
541
- if (s2 !== peg$FAILED) {
542
- if (input.charCodeAt(peg$currPos) === 40) {
543
- s3 = peg$c4;
544
- peg$currPos++;
545
- } else {
546
- s3 = peg$FAILED;
547
- if (peg$silentFails === 0) {
548
- peg$fail(peg$c5);
549
- }
550
- }
551
- if (s3 !== peg$FAILED) {
552
- s4 = [];
553
- s5 = peg$parsewsp();
554
- while (s5 !== peg$FAILED) {
555
- s4.push(s5);
556
- s5 = peg$parsewsp();
557
- }
558
- if (s4 !== peg$FAILED) {
559
- s5 = peg$parsenumber();
560
- if (s5 !== peg$FAILED) {
561
- s6 = peg$parsecommaWspNumber();
562
- if (s6 === peg$FAILED) {
563
- s6 = null;
564
- }
565
- if (s6 !== peg$FAILED) {
566
- s7 = [];
567
- s8 = peg$parsewsp();
568
- while (s8 !== peg$FAILED) {
569
- s7.push(s8);
570
- s8 = peg$parsewsp();
571
- }
572
- if (s7 !== peg$FAILED) {
573
- if (input.charCodeAt(peg$currPos) === 41) {
574
- s8 = peg$c6;
575
- peg$currPos++;
576
- } else {
577
- s8 = peg$FAILED;
578
- if (peg$silentFails === 0) {
579
- peg$fail(peg$c7);
580
- }
581
- }
582
- if (s8 !== peg$FAILED) {
583
- peg$savedPos = s0;
584
- s1 = peg$c11(s5, s6);
585
- s0 = s1;
586
- } else {
587
- peg$currPos = s0;
588
- s0 = peg$FAILED;
589
- }
590
- } else {
591
- peg$currPos = s0;
592
- s0 = peg$FAILED;
593
- }
594
- } else {
595
- peg$currPos = s0;
596
- s0 = peg$FAILED;
597
- }
598
- } else {
599
- peg$currPos = s0;
600
- s0 = peg$FAILED;
601
- }
602
- } else {
603
- peg$currPos = s0;
604
- s0 = peg$FAILED;
605
- }
606
- } else {
607
- peg$currPos = s0;
608
- s0 = peg$FAILED;
609
- }
610
- } else {
611
- peg$currPos = s0;
612
- s0 = peg$FAILED;
613
- }
614
- } else {
615
- peg$currPos = s0;
616
- s0 = peg$FAILED;
617
- }
618
- return s0;
619
- }
620
- function peg$parsescale() {
621
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
622
- s0 = peg$currPos;
623
- if (input.substr(peg$currPos, 5) === peg$c12) {
624
- s1 = peg$c12;
625
- peg$currPos += 5;
626
- } else {
627
- s1 = peg$FAILED;
628
- if (peg$silentFails === 0) {
629
- peg$fail(peg$c13);
630
- }
631
- }
632
- if (s1 !== peg$FAILED) {
633
- s2 = [];
634
- s3 = peg$parsewsp();
635
- while (s3 !== peg$FAILED) {
636
- s2.push(s3);
637
- s3 = peg$parsewsp();
638
- }
639
- if (s2 !== peg$FAILED) {
640
- if (input.charCodeAt(peg$currPos) === 40) {
641
- s3 = peg$c4;
642
- peg$currPos++;
643
- } else {
644
- s3 = peg$FAILED;
645
- if (peg$silentFails === 0) {
646
- peg$fail(peg$c5);
647
- }
648
- }
649
- if (s3 !== peg$FAILED) {
650
- s4 = [];
651
- s5 = peg$parsewsp();
652
- while (s5 !== peg$FAILED) {
653
- s4.push(s5);
654
- s5 = peg$parsewsp();
655
- }
656
- if (s4 !== peg$FAILED) {
657
- s5 = peg$parsenumber();
658
- if (s5 !== peg$FAILED) {
659
- s6 = peg$parsecommaWspNumber();
660
- if (s6 === peg$FAILED) {
661
- s6 = null;
662
- }
663
- if (s6 !== peg$FAILED) {
664
- s7 = [];
665
- s8 = peg$parsewsp();
666
- while (s8 !== peg$FAILED) {
667
- s7.push(s8);
668
- s8 = peg$parsewsp();
669
- }
670
- if (s7 !== peg$FAILED) {
671
- if (input.charCodeAt(peg$currPos) === 41) {
672
- s8 = peg$c6;
673
- peg$currPos++;
674
- } else {
675
- s8 = peg$FAILED;
676
- if (peg$silentFails === 0) {
677
- peg$fail(peg$c7);
678
- }
679
- }
680
- if (s8 !== peg$FAILED) {
681
- peg$savedPos = s0;
682
- s1 = peg$c14(s5, s6);
683
- s0 = s1;
684
- } else {
685
- peg$currPos = s0;
686
- s0 = peg$FAILED;
687
- }
688
- } else {
689
- peg$currPos = s0;
690
- s0 = peg$FAILED;
691
- }
692
- } else {
693
- peg$currPos = s0;
694
- s0 = peg$FAILED;
695
- }
696
- } else {
697
- peg$currPos = s0;
698
- s0 = peg$FAILED;
699
- }
700
- } else {
701
- peg$currPos = s0;
702
- s0 = peg$FAILED;
703
- }
704
- } else {
705
- peg$currPos = s0;
706
- s0 = peg$FAILED;
707
- }
708
- } else {
709
- peg$currPos = s0;
710
- s0 = peg$FAILED;
711
- }
712
- } else {
713
- peg$currPos = s0;
714
- s0 = peg$FAILED;
715
- }
716
- return s0;
717
- }
718
- function peg$parserotate() {
719
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
720
- s0 = peg$currPos;
721
- if (input.substr(peg$currPos, 6) === peg$c15) {
722
- s1 = peg$c15;
723
- peg$currPos += 6;
724
- } else {
725
- s1 = peg$FAILED;
726
- if (peg$silentFails === 0) {
727
- peg$fail(peg$c16);
728
- }
729
- }
730
- if (s1 !== peg$FAILED) {
731
- s2 = [];
732
- s3 = peg$parsewsp();
733
- while (s3 !== peg$FAILED) {
734
- s2.push(s3);
735
- s3 = peg$parsewsp();
736
- }
737
- if (s2 !== peg$FAILED) {
738
- if (input.charCodeAt(peg$currPos) === 40) {
739
- s3 = peg$c4;
740
- peg$currPos++;
741
- } else {
742
- s3 = peg$FAILED;
743
- if (peg$silentFails === 0) {
744
- peg$fail(peg$c5);
745
- }
746
- }
747
- if (s3 !== peg$FAILED) {
748
- s4 = [];
749
- s5 = peg$parsewsp();
750
- while (s5 !== peg$FAILED) {
751
- s4.push(s5);
752
- s5 = peg$parsewsp();
753
- }
754
- if (s4 !== peg$FAILED) {
755
- s5 = peg$parsenumber();
756
- if (s5 !== peg$FAILED) {
757
- s6 = peg$parsecommaWspTwoNumbers();
758
- if (s6 === peg$FAILED) {
759
- s6 = null;
760
- }
761
- if (s6 !== peg$FAILED) {
762
- s7 = [];
763
- s8 = peg$parsewsp();
764
- while (s8 !== peg$FAILED) {
765
- s7.push(s8);
766
- s8 = peg$parsewsp();
767
- }
768
- if (s7 !== peg$FAILED) {
769
- if (input.charCodeAt(peg$currPos) === 41) {
770
- s8 = peg$c6;
771
- peg$currPos++;
772
- } else {
773
- s8 = peg$FAILED;
774
- if (peg$silentFails === 0) {
775
- peg$fail(peg$c7);
776
- }
777
- }
778
- if (s8 !== peg$FAILED) {
779
- peg$savedPos = s0;
780
- s1 = peg$c17(s5, s6);
781
- s0 = s1;
782
- } else {
783
- peg$currPos = s0;
784
- s0 = peg$FAILED;
785
- }
786
- } else {
787
- peg$currPos = s0;
788
- s0 = peg$FAILED;
789
- }
790
- } else {
791
- peg$currPos = s0;
792
- s0 = peg$FAILED;
793
- }
794
- } else {
795
- peg$currPos = s0;
796
- s0 = peg$FAILED;
797
- }
798
- } else {
799
- peg$currPos = s0;
800
- s0 = peg$FAILED;
801
- }
802
- } else {
803
- peg$currPos = s0;
804
- s0 = peg$FAILED;
805
- }
806
- } else {
807
- peg$currPos = s0;
808
- s0 = peg$FAILED;
809
- }
810
- } else {
811
- peg$currPos = s0;
812
- s0 = peg$FAILED;
813
- }
814
- return s0;
815
- }
816
- function peg$parseskewX() {
817
- var s0, s1, s2, s3, s4, s5, s6, s7;
818
- s0 = peg$currPos;
819
- if (input.substr(peg$currPos, 5) === peg$c18) {
820
- s1 = peg$c18;
821
- peg$currPos += 5;
822
- } else {
823
- s1 = peg$FAILED;
824
- if (peg$silentFails === 0) {
825
- peg$fail(peg$c19);
826
- }
827
- }
828
- if (s1 !== peg$FAILED) {
829
- s2 = [];
830
- s3 = peg$parsewsp();
831
- while (s3 !== peg$FAILED) {
832
- s2.push(s3);
833
- s3 = peg$parsewsp();
834
- }
835
- if (s2 !== peg$FAILED) {
836
- if (input.charCodeAt(peg$currPos) === 40) {
837
- s3 = peg$c4;
838
- peg$currPos++;
839
- } else {
840
- s3 = peg$FAILED;
841
- if (peg$silentFails === 0) {
842
- peg$fail(peg$c5);
843
- }
844
- }
845
- if (s3 !== peg$FAILED) {
846
- s4 = [];
847
- s5 = peg$parsewsp();
848
- while (s5 !== peg$FAILED) {
849
- s4.push(s5);
850
- s5 = peg$parsewsp();
851
- }
852
- if (s4 !== peg$FAILED) {
853
- s5 = peg$parsenumber();
854
- if (s5 !== peg$FAILED) {
855
- s6 = [];
856
- s7 = peg$parsewsp();
857
- while (s7 !== peg$FAILED) {
858
- s6.push(s7);
859
- s7 = peg$parsewsp();
860
- }
861
- if (s6 !== peg$FAILED) {
862
- if (input.charCodeAt(peg$currPos) === 41) {
863
- s7 = peg$c6;
864
- peg$currPos++;
865
- } else {
866
- s7 = peg$FAILED;
867
- if (peg$silentFails === 0) {
868
- peg$fail(peg$c7);
869
- }
870
- }
871
- if (s7 !== peg$FAILED) {
872
- peg$savedPos = s0;
873
- s1 = peg$c20(s5);
874
- s0 = s1;
875
- } else {
876
- peg$currPos = s0;
877
- s0 = peg$FAILED;
878
- }
879
- } else {
880
- peg$currPos = s0;
881
- s0 = peg$FAILED;
882
- }
883
- } else {
884
- peg$currPos = s0;
885
- s0 = peg$FAILED;
886
- }
887
- } else {
888
- peg$currPos = s0;
889
- s0 = peg$FAILED;
890
- }
891
- } else {
892
- peg$currPos = s0;
893
- s0 = peg$FAILED;
894
- }
895
- } else {
896
- peg$currPos = s0;
897
- s0 = peg$FAILED;
898
- }
899
- } else {
900
- peg$currPos = s0;
901
- s0 = peg$FAILED;
902
- }
903
- return s0;
904
- }
905
- function peg$parseskewY() {
906
- var s0, s1, s2, s3, s4, s5, s6, s7;
907
- s0 = peg$currPos;
908
- if (input.substr(peg$currPos, 5) === peg$c21) {
909
- s1 = peg$c21;
910
- peg$currPos += 5;
911
- } else {
912
- s1 = peg$FAILED;
913
- if (peg$silentFails === 0) {
914
- peg$fail(peg$c22);
915
- }
916
- }
917
- if (s1 !== peg$FAILED) {
918
- s2 = [];
919
- s3 = peg$parsewsp();
920
- while (s3 !== peg$FAILED) {
921
- s2.push(s3);
922
- s3 = peg$parsewsp();
923
- }
924
- if (s2 !== peg$FAILED) {
925
- if (input.charCodeAt(peg$currPos) === 40) {
926
- s3 = peg$c4;
927
- peg$currPos++;
928
- } else {
929
- s3 = peg$FAILED;
930
- if (peg$silentFails === 0) {
931
- peg$fail(peg$c5);
932
- }
933
- }
934
- if (s3 !== peg$FAILED) {
935
- s4 = [];
936
- s5 = peg$parsewsp();
937
- while (s5 !== peg$FAILED) {
938
- s4.push(s5);
939
- s5 = peg$parsewsp();
940
- }
941
- if (s4 !== peg$FAILED) {
942
- s5 = peg$parsenumber();
943
- if (s5 !== peg$FAILED) {
944
- s6 = [];
945
- s7 = peg$parsewsp();
946
- while (s7 !== peg$FAILED) {
947
- s6.push(s7);
948
- s7 = peg$parsewsp();
949
- }
950
- if (s6 !== peg$FAILED) {
951
- if (input.charCodeAt(peg$currPos) === 41) {
952
- s7 = peg$c6;
953
- peg$currPos++;
954
- } else {
955
- s7 = peg$FAILED;
956
- if (peg$silentFails === 0) {
957
- peg$fail(peg$c7);
958
- }
959
- }
960
- if (s7 !== peg$FAILED) {
961
- peg$savedPos = s0;
962
- s1 = peg$c23(s5);
963
- s0 = s1;
964
- } else {
965
- peg$currPos = s0;
966
- s0 = peg$FAILED;
967
- }
968
- } else {
969
- peg$currPos = s0;
970
- s0 = peg$FAILED;
971
- }
972
- } else {
973
- peg$currPos = s0;
974
- s0 = peg$FAILED;
975
- }
976
- } else {
977
- peg$currPos = s0;
978
- s0 = peg$FAILED;
979
- }
980
- } else {
981
- peg$currPos = s0;
982
- s0 = peg$FAILED;
983
- }
984
- } else {
985
- peg$currPos = s0;
986
- s0 = peg$FAILED;
987
- }
988
- } else {
989
- peg$currPos = s0;
990
- s0 = peg$FAILED;
991
- }
992
- return s0;
993
- }
994
- function peg$parsenumber() {
995
- var s0, s1, s2, s3;
996
- s0 = peg$currPos;
997
- s1 = peg$currPos;
998
- s2 = peg$parsesign();
999
- if (s2 === peg$FAILED) {
1000
- s2 = null;
1001
- }
1002
- if (s2 !== peg$FAILED) {
1003
- s3 = peg$parsefloatingPointConstant();
1004
- if (s3 !== peg$FAILED) {
1005
- s2 = [s2, s3];
1006
- s1 = s2;
1007
- } else {
1008
- peg$currPos = s1;
1009
- s1 = peg$FAILED;
1010
- }
1011
- } else {
1012
- peg$currPos = s1;
1013
- s1 = peg$FAILED;
1014
- }
1015
- if (s1 !== peg$FAILED) {
1016
- peg$savedPos = s0;
1017
- s1 = peg$c24(s1);
1018
- }
1019
- s0 = s1;
1020
- if (s0 === peg$FAILED) {
1021
- s0 = peg$currPos;
1022
- s1 = peg$currPos;
1023
- s2 = peg$parsesign();
1024
- if (s2 === peg$FAILED) {
1025
- s2 = null;
1026
- }
1027
- if (s2 !== peg$FAILED) {
1028
- s3 = peg$parseintegerConstant();
1029
- if (s3 !== peg$FAILED) {
1030
- s2 = [s2, s3];
1031
- s1 = s2;
1032
- } else {
1033
- peg$currPos = s1;
1034
- s1 = peg$FAILED;
1035
- }
1036
- } else {
1037
- peg$currPos = s1;
1038
- s1 = peg$FAILED;
1039
- }
1040
- if (s1 !== peg$FAILED) {
1041
- peg$savedPos = s0;
1042
- s1 = peg$c25(s1);
1043
- }
1044
- s0 = s1;
1045
- }
1046
- return s0;
1047
- }
1048
- function peg$parsecommaWspNumber() {
1049
- var s0, s1, s2;
1050
- s0 = peg$currPos;
1051
- s1 = peg$parsecommaWsp();
1052
- if (s1 !== peg$FAILED) {
1053
- s2 = peg$parsenumber();
1054
- if (s2 !== peg$FAILED) {
1055
- peg$savedPos = s0;
1056
- s1 = peg$c26(s2);
1057
- s0 = s1;
1058
- } else {
1059
- peg$currPos = s0;
1060
- s0 = peg$FAILED;
1061
- }
1062
- } else {
1063
- peg$currPos = s0;
1064
- s0 = peg$FAILED;
1065
- }
1066
- return s0;
1067
- }
1068
- function peg$parsecommaWspTwoNumbers() {
1069
- var s0, s1, s2, s3, s4;
1070
- s0 = peg$currPos;
1071
- s1 = peg$parsecommaWsp();
1072
- if (s1 !== peg$FAILED) {
1073
- s2 = peg$parsenumber();
1074
- if (s2 !== peg$FAILED) {
1075
- s3 = peg$parsecommaWsp();
1076
- if (s3 !== peg$FAILED) {
1077
- s4 = peg$parsenumber();
1078
- if (s4 !== peg$FAILED) {
1079
- peg$savedPos = s0;
1080
- s1 = peg$c27(s2, s4);
1081
- s0 = s1;
1082
- } else {
1083
- peg$currPos = s0;
1084
- s0 = peg$FAILED;
1085
- }
1086
- } else {
1087
- peg$currPos = s0;
1088
- s0 = peg$FAILED;
1089
- }
1090
- } else {
1091
- peg$currPos = s0;
1092
- s0 = peg$FAILED;
1093
- }
1094
- } else {
1095
- peg$currPos = s0;
1096
- s0 = peg$FAILED;
1097
- }
1098
- return s0;
1099
- }
1100
- function peg$parsecommaWsp() {
1101
- var s0, s1, s2, s3, s4;
1102
- s0 = peg$currPos;
1103
- s1 = [];
1104
- s2 = peg$parsewsp();
1105
- if (s2 !== peg$FAILED) {
1106
- while (s2 !== peg$FAILED) {
1107
- s1.push(s2);
1108
- s2 = peg$parsewsp();
1109
- }
1110
- } else {
1111
- s1 = peg$FAILED;
1112
- }
1113
- if (s1 !== peg$FAILED) {
1114
- s2 = peg$parsecomma();
1115
- if (s2 === peg$FAILED) {
1116
- s2 = null;
1117
- }
1118
- if (s2 !== peg$FAILED) {
1119
- s3 = [];
1120
- s4 = peg$parsewsp();
1121
- while (s4 !== peg$FAILED) {
1122
- s3.push(s4);
1123
- s4 = peg$parsewsp();
1124
- }
1125
- if (s3 !== peg$FAILED) {
1126
- s1 = [s1, s2, s3];
1127
- s0 = s1;
1128
- } else {
1129
- peg$currPos = s0;
1130
- s0 = peg$FAILED;
1131
- }
1132
- } else {
1133
- peg$currPos = s0;
1134
- s0 = peg$FAILED;
1135
- }
1136
- } else {
1137
- peg$currPos = s0;
1138
- s0 = peg$FAILED;
1139
- }
1140
- if (s0 === peg$FAILED) {
1141
- s0 = peg$currPos;
1142
- s1 = peg$parsecomma();
1143
- if (s1 !== peg$FAILED) {
1144
- s2 = [];
1145
- s3 = peg$parsewsp();
1146
- while (s3 !== peg$FAILED) {
1147
- s2.push(s3);
1148
- s3 = peg$parsewsp();
1149
- }
1150
- if (s2 !== peg$FAILED) {
1151
- s1 = [s1, s2];
1152
- s0 = s1;
1153
- } else {
1154
- peg$currPos = s0;
1155
- s0 = peg$FAILED;
1156
- }
1157
- } else {
1158
- peg$currPos = s0;
1159
- s0 = peg$FAILED;
1160
- }
1161
- }
1162
- return s0;
1163
- }
1164
- function peg$parsecomma() {
1165
- var s0;
1166
- if (input.charCodeAt(peg$currPos) === 44) {
1167
- s0 = peg$c28;
1168
- peg$currPos++;
1169
- } else {
1170
- s0 = peg$FAILED;
1171
- if (peg$silentFails === 0) {
1172
- peg$fail(peg$c29);
1173
- }
1174
- }
1175
- return s0;
1176
- }
1177
- function peg$parseintegerConstant() {
1178
- var s0, s1;
1179
- s0 = peg$currPos;
1180
- s1 = peg$parsedigitSequence();
1181
- if (s1 !== peg$FAILED) {
1182
- peg$savedPos = s0;
1183
- s1 = peg$c30(s1);
1184
- }
1185
- s0 = s1;
1186
- return s0;
1187
- }
1188
- function peg$parsefloatingPointConstant() {
1189
- var s0, s1, s2, s3;
1190
- s0 = peg$currPos;
1191
- s1 = peg$currPos;
1192
- s2 = peg$parsefractionalConstant();
1193
- if (s2 !== peg$FAILED) {
1194
- s3 = peg$parseexponent();
1195
- if (s3 === peg$FAILED) {
1196
- s3 = null;
1197
- }
1198
- if (s3 !== peg$FAILED) {
1199
- s2 = [s2, s3];
1200
- s1 = s2;
1201
- } else {
1202
- peg$currPos = s1;
1203
- s1 = peg$FAILED;
1204
- }
1205
- } else {
1206
- peg$currPos = s1;
1207
- s1 = peg$FAILED;
1208
- }
1209
- if (s1 !== peg$FAILED) {
1210
- peg$savedPos = s0;
1211
- s1 = peg$c31(s1);
1212
- }
1213
- s0 = s1;
1214
- if (s0 === peg$FAILED) {
1215
- s0 = peg$currPos;
1216
- s1 = peg$currPos;
1217
- s2 = peg$parsedigitSequence();
1218
- if (s2 !== peg$FAILED) {
1219
- s3 = peg$parseexponent();
1220
- if (s3 !== peg$FAILED) {
1221
- s2 = [s2, s3];
1222
- s1 = s2;
1223
- } else {
1224
- peg$currPos = s1;
1225
- s1 = peg$FAILED;
1226
- }
1227
- } else {
1228
- peg$currPos = s1;
1229
- s1 = peg$FAILED;
1230
- }
1231
- if (s1 !== peg$FAILED) {
1232
- peg$savedPos = s0;
1233
- s1 = peg$c32(s1);
1234
- }
1235
- s0 = s1;
1236
- }
1237
- return s0;
1238
- }
1239
- function peg$parsefractionalConstant() {
1240
- var s0, s1, s2, s3;
1241
- peg$silentFails++;
1242
- s0 = peg$currPos;
1243
- s1 = peg$parsedigitSequence();
1244
- if (s1 === peg$FAILED) {
1245
- s1 = null;
1246
- }
1247
- if (s1 !== peg$FAILED) {
1248
- if (input.charCodeAt(peg$currPos) === 46) {
1249
- s2 = peg$c34;
1250
- peg$currPos++;
1251
- } else {
1252
- s2 = peg$FAILED;
1253
- if (peg$silentFails === 0) {
1254
- peg$fail(peg$c35);
1255
- }
1256
- }
1257
- if (s2 !== peg$FAILED) {
1258
- s3 = peg$parsedigitSequence();
1259
- if (s3 !== peg$FAILED) {
1260
- peg$savedPos = s0;
1261
- s1 = peg$c36(s1, s3);
1262
- s0 = s1;
1263
- } else {
1264
- peg$currPos = s0;
1265
- s0 = peg$FAILED;
1266
- }
1267
- } else {
1268
- peg$currPos = s0;
1269
- s0 = peg$FAILED;
1270
- }
1271
- } else {
1272
- peg$currPos = s0;
1273
- s0 = peg$FAILED;
1274
- }
1275
- if (s0 === peg$FAILED) {
1276
- s0 = peg$currPos;
1277
- s1 = peg$parsedigitSequence();
1278
- if (s1 !== peg$FAILED) {
1279
- if (input.charCodeAt(peg$currPos) === 46) {
1280
- s2 = peg$c34;
1281
- peg$currPos++;
1282
- } else {
1283
- s2 = peg$FAILED;
1284
- if (peg$silentFails === 0) {
1285
- peg$fail(peg$c35);
1286
- }
1287
- }
1288
- if (s2 !== peg$FAILED) {
1289
- peg$savedPos = s0;
1290
- s1 = peg$c32(s1);
1291
- s0 = s1;
1292
- } else {
1293
- peg$currPos = s0;
1294
- s0 = peg$FAILED;
1295
- }
1296
- } else {
1297
- peg$currPos = s0;
1298
- s0 = peg$FAILED;
1299
- }
1300
- }
1301
- peg$silentFails--;
1302
- if (s0 === peg$FAILED) {
1303
- s1 = peg$FAILED;
1304
- if (peg$silentFails === 0) {
1305
- peg$fail(peg$c33);
1306
- }
1307
- }
1308
- return s0;
1309
- }
1310
- function peg$parseexponent() {
1311
- var s0, s1, s2, s3, s4;
1312
- s0 = peg$currPos;
1313
- s1 = peg$currPos;
1314
- if (peg$c37.test(input.charAt(peg$currPos))) {
1315
- s2 = input.charAt(peg$currPos);
1316
- peg$currPos++;
1317
- } else {
1318
- s2 = peg$FAILED;
1319
- if (peg$silentFails === 0) {
1320
- peg$fail(peg$c38);
1321
- }
1322
- }
1323
- if (s2 !== peg$FAILED) {
1324
- s3 = peg$parsesign();
1325
- if (s3 === peg$FAILED) {
1326
- s3 = null;
1327
- }
1328
- if (s3 !== peg$FAILED) {
1329
- s4 = peg$parsedigitSequence();
1330
- if (s4 !== peg$FAILED) {
1331
- s2 = [s2, s3, s4];
1332
- s1 = s2;
1333
- } else {
1334
- peg$currPos = s1;
1335
- s1 = peg$FAILED;
1336
- }
1337
- } else {
1338
- peg$currPos = s1;
1339
- s1 = peg$FAILED;
1340
- }
1341
- } else {
1342
- peg$currPos = s1;
1343
- s1 = peg$FAILED;
1344
- }
1345
- if (s1 !== peg$FAILED) {
1346
- peg$savedPos = s0;
1347
- s1 = peg$c39(s1);
1348
- }
1349
- s0 = s1;
1350
- return s0;
1351
- }
1352
- function peg$parsesign() {
1353
- var s0;
1354
- if (peg$c40.test(input.charAt(peg$currPos))) {
1355
- s0 = input.charAt(peg$currPos);
1356
- peg$currPos++;
1357
- } else {
1358
- s0 = peg$FAILED;
1359
- if (peg$silentFails === 0) {
1360
- peg$fail(peg$c41);
1361
- }
1362
- }
1363
- return s0;
1364
- }
1365
- function peg$parsedigitSequence() {
1366
- var s0, s1;
1367
- s0 = [];
1368
- s1 = peg$parsedigit();
1369
- if (s1 !== peg$FAILED) {
1370
- while (s1 !== peg$FAILED) {
1371
- s0.push(s1);
1372
- s1 = peg$parsedigit();
1373
- }
1374
- } else {
1375
- s0 = peg$FAILED;
1376
- }
1377
- return s0;
1378
- }
1379
- function peg$parsedigit() {
1380
- var s0;
1381
- if (peg$c42.test(input.charAt(peg$currPos))) {
1382
- s0 = input.charAt(peg$currPos);
1383
- peg$currPos++;
1384
- } else {
1385
- s0 = peg$FAILED;
1386
- if (peg$silentFails === 0) {
1387
- peg$fail(peg$c43);
1388
- }
1389
- }
1390
- return s0;
1391
- }
1392
- function peg$parsewsp() {
1393
- var s0;
1394
- if (peg$c44.test(input.charAt(peg$currPos))) {
1395
- s0 = input.charAt(peg$currPos);
1396
- peg$currPos++;
1397
- } else {
1398
- s0 = peg$FAILED;
1399
- if (peg$silentFails === 0) {
1400
- peg$fail(peg$c45);
1401
- }
1402
- }
1403
- return s0;
1404
- }
1405
- var deg2rad = Math.PI / 180;
1406
- function multiply_matrices(l, r) {
1407
- var al = l[0];
1408
- var cl = l[1];
1409
- var el = l[2];
1410
- var bl = l[3];
1411
- var dl = l[4];
1412
- var fl = l[5];
1413
- var ar = r[0];
1414
- var cr = r[1];
1415
- var er = r[2];
1416
- var br = r[3];
1417
- var dr = r[4];
1418
- var fr = r[5];
1419
- var a = al * ar + cl * br;
1420
- var c = al * cr + cl * dr;
1421
- var e = al * er + cl * fr + el;
1422
- var b = bl * ar + dl * br;
1423
- var d = bl * cr + dl * dr;
1424
- var f = bl * er + dl * fr + fl;
1425
- return [a, c, e, b, d, f];
1426
- }
1427
- peg$result = peg$startRuleFunction();
1428
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
1429
- return peg$result;
1430
- } else {
1431
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
1432
- peg$fail(peg$endExpectation());
1433
- }
1434
- throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
1435
- }
1436
- }
1437
- module.exports = {
1438
- SyntaxError: peg$SyntaxError,
1439
- parse: peg$parse
1440
- };
1441
- });
1442
-
1443
- // node_modules/react-native-svg/lib/module/lib/extract/transformToRn.js
1444
- var require_transformToRn = __commonJS(function(exports, module) {
1445
- function peg$subclass(child, parent) {
1446
- function C() {
1447
- this.constructor = child;
1448
- }
1449
- C.prototype = parent.prototype;
1450
- child.prototype = new C;
1451
- }
1452
- function peg$SyntaxError(message, expected, found, location) {
1453
- var self = Error.call(this, message);
1454
- if (Object.setPrototypeOf) {
1455
- Object.setPrototypeOf(self, peg$SyntaxError.prototype);
1456
- }
1457
- self.expected = expected;
1458
- self.found = found;
1459
- self.location = location;
1460
- self.name = "SyntaxError";
1461
- return self;
1462
- }
1463
- peg$subclass(peg$SyntaxError, Error);
1464
- function peg$padEnd(str, targetLength, padString) {
1465
- padString = padString || " ";
1466
- if (str.length > targetLength) {
1467
- return str;
1468
- }
1469
- targetLength -= str.length;
1470
- padString += padString.repeat(targetLength);
1471
- return str + padString.slice(0, targetLength);
1472
- }
1473
- peg$SyntaxError.prototype.format = function(sources) {
1474
- var str = "Error: " + this.message;
1475
- if (this.location) {
1476
- var src = null;
1477
- var k;
1478
- for (k = 0;k < sources.length; k++) {
1479
- if (sources[k].source === this.location.source) {
1480
- src = sources[k].text.split(/\r\n|\n|\r/g);
1481
- break;
1482
- }
1483
- }
1484
- var s = this.location.start;
1485
- var offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
1486
- var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
1487
- if (src) {
1488
- var e = this.location.end;
1489
- var filler = peg$padEnd("", offset_s.line.toString().length, " ");
1490
- var line = src[s.line - 1];
1491
- var last = s.line === e.line ? e.column : line.length + 1;
1492
- var hatLen = last - s.column || 1;
1493
- str += `
1494
- --> ` + loc + `
1495
- ` + filler + ` |
1496
- ` + offset_s.line + " | " + line + `
1497
- ` + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^");
1498
- } else {
1499
- str += `
1500
- at ` + loc;
1501
- }
1502
- }
1503
- return str;
1504
- };
1505
- peg$SyntaxError.buildMessage = function(expected, found) {
1506
- var DESCRIBE_EXPECTATION_FNS = {
1507
- literal: function(expectation) {
1508
- return '"' + literalEscape(expectation.text) + '"';
1509
- },
1510
- class: function(expectation) {
1511
- var escapedParts = expectation.parts.map(function(part) {
1512
- return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
1513
- });
1514
- return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
1515
- },
1516
- any: function() {
1517
- return "any character";
1518
- },
1519
- end: function() {
1520
- return "end of input";
1521
- },
1522
- other: function(expectation) {
1523
- return expectation.description;
1524
- }
1525
- };
1526
- function hex(ch) {
1527
- return ch.charCodeAt(0).toString(16).toUpperCase();
1528
- }
1529
- function literalEscape(s) {
1530
- return s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
1531
- return "\\x0" + hex(ch);
1532
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
1533
- return "\\x" + hex(ch);
1534
- });
1535
- }
1536
- function classEscape(s) {
1537
- return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
1538
- return "\\x0" + hex(ch);
1539
- }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
1540
- return "\\x" + hex(ch);
1541
- });
1542
- }
1543
- function describeExpectation(expectation) {
1544
- return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
1545
- }
1546
- function describeExpected(expected) {
1547
- var descriptions = expected.map(describeExpectation);
1548
- var i, j;
1549
- descriptions.sort();
1550
- if (descriptions.length > 0) {
1551
- for (i = 1, j = 1;i < descriptions.length; i++) {
1552
- if (descriptions[i - 1] !== descriptions[i]) {
1553
- descriptions[j] = descriptions[i];
1554
- j++;
1555
- }
1556
- }
1557
- descriptions.length = j;
1558
- }
1559
- switch (descriptions.length) {
1560
- case 1:
1561
- return descriptions[0];
1562
- case 2:
1563
- return descriptions[0] + " or " + descriptions[1];
1564
- default:
1565
- return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
1566
- }
1567
- }
1568
- function describeFound(found) {
1569
- return found ? '"' + literalEscape(found) + '"' : "end of input";
1570
- }
1571
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
1572
- };
1573
- function peg$parse(input, options) {
1574
- options = options !== undefined ? options : {};
1575
- var peg$FAILED = {};
1576
- var peg$source = options.grammarSource;
1577
- var peg$startRuleFunctions = {
1578
- start: peg$parsestart
1579
- };
1580
- var peg$startRuleFunction = peg$parsestart;
1581
- var peg$c0 = "matrix(";
1582
- var peg$c1 = ")";
1583
- var peg$c2 = "translate(";
1584
- var peg$c3 = "scale(";
1585
- var peg$c4 = "rotate(";
1586
- var peg$c5 = "skewX(";
1587
- var peg$c6 = "skewY(";
1588
- var peg$c7 = ".";
1589
- var peg$c8 = "e";
1590
- var peg$r0 = /^[ \t\n\r,]/;
1591
- var peg$r1 = /^[ \t\n\r]/;
1592
- var peg$r2 = /^[+\-]/;
1593
- var peg$r3 = /^[0-9]/;
1594
- var peg$e0 = peg$otherExpectation("transform functions");
1595
- var peg$e1 = peg$otherExpectation("transformFunctions");
1596
- var peg$e2 = peg$otherExpectation("transform function");
1597
- var peg$e3 = peg$otherExpectation("matrix");
1598
- var peg$e4 = peg$literalExpectation("matrix(", false);
1599
- var peg$e5 = peg$literalExpectation(")", false);
1600
- var peg$e6 = peg$otherExpectation("translate");
1601
- var peg$e7 = peg$literalExpectation("translate(", false);
1602
- var peg$e8 = peg$otherExpectation("scale");
1603
- var peg$e9 = peg$literalExpectation("scale(", false);
1604
- var peg$e10 = peg$otherExpectation("rotate");
1605
- var peg$e11 = peg$literalExpectation("rotate(", false);
1606
- var peg$e12 = peg$otherExpectation("x, y");
1607
- var peg$e13 = peg$otherExpectation("skewX");
1608
- var peg$e14 = peg$literalExpectation("skewX(", false);
1609
- var peg$e15 = peg$otherExpectation("skewY");
1610
- var peg$e16 = peg$literalExpectation("skewY(", false);
1611
- var peg$e17 = peg$otherExpectation("space or comma");
1612
- var peg$e18 = peg$classExpectation([" ", "\t", `
1613
- `, "\r", ","], false, false);
1614
- var peg$e19 = peg$otherExpectation("whitespace");
1615
- var peg$e20 = peg$classExpectation([" ", "\t", `
1616
- `, "\r"], false, false);
1617
- var peg$e21 = peg$classExpectation(["+", "-"], false, false);
1618
- var peg$e22 = peg$classExpectation([["0", "9"]], false, false);
1619
- var peg$e23 = peg$literalExpectation(".", false);
1620
- var peg$e24 = peg$literalExpectation("e", false);
1621
- var peg$f0 = function(head, tail) {
1622
- const results = Array.isArray(head) ? head : [head];
1623
- tail.forEach((element) => {
1624
- if (Array.isArray(element[1])) {
1625
- results.push(...element[1]);
1626
- } else {
1627
- results.push(element[1]);
1628
- }
1629
- });
1630
- return results;
1631
- };
1632
- var peg$f1 = function(a, b, c, d, e, f, g, h, i) {
1633
- return {
1634
- matrix: [a, b, c, d, e, f, g, h, i]
1635
- };
1636
- };
1637
- var peg$f2 = function(x, y) {
1638
- if (y == undefined) {
1639
- return {
1640
- translate: x
1641
- };
1642
- }
1643
- return {
1644
- translate: [x, y]
1645
- };
1646
- };
1647
- var peg$f3 = function(x, y) {
1648
- if (y == undefined) {
1649
- return {
1650
- scale: x
1651
- };
1652
- }
1653
- return [{
1654
- scaleX: x
1655
- }, {
1656
- scaleY: y
1657
- }];
1658
- };
1659
- var peg$f4 = function(x, yz) {
1660
- if (yz !== null) {
1661
- return {
1662
- rotate: `${x}deg`
1663
- };
1664
- }
1665
- return [{
1666
- rotate: `${x}deg`
1667
- }];
1668
- };
1669
- var peg$f5 = function(y, z) {
1670
- return [y, z];
1671
- };
1672
- var peg$f6 = function(x) {
1673
- return [{
1674
- skewX: `${x}deg`
1675
- }];
1676
- };
1677
- var peg$f7 = function(y) {
1678
- return [{
1679
- skewY: `${y}deg`
1680
- }];
1681
- };
1682
- var peg$f8 = function() {
1683
- return parseFloat(text());
1684
- };
1685
- var peg$currPos = options.peg$currPos | 0;
1686
- var peg$savedPos = peg$currPos;
1687
- var peg$posDetailsCache = [{
1688
- line: 1,
1689
- column: 1
1690
- }];
1691
- var peg$maxFailPos = peg$currPos;
1692
- var peg$maxFailExpected = options.peg$maxFailExpected || [];
1693
- var peg$silentFails = options.peg$silentFails | 0;
1694
- var peg$result;
1695
- if (options.startRule) {
1696
- if (!(options.startRule in peg$startRuleFunctions)) {
1697
- throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
1698
- }
1699
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
1700
- }
1701
- function text() {
1702
- return input.substring(peg$savedPos, peg$currPos);
1703
- }
1704
- function offset() {
1705
- return peg$savedPos;
1706
- }
1707
- function range() {
1708
- return {
1709
- source: peg$source,
1710
- start: peg$savedPos,
1711
- end: peg$currPos
1712
- };
1713
- }
1714
- function location() {
1715
- return peg$computeLocation(peg$savedPos, peg$currPos);
1716
- }
1717
- function expected(description, location) {
1718
- location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
1719
- throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
1720
- }
1721
- function error(message, location) {
1722
- location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
1723
- throw peg$buildSimpleError(message, location);
1724
- }
1725
- function peg$literalExpectation(text, ignoreCase) {
1726
- return {
1727
- type: "literal",
1728
- text,
1729
- ignoreCase
1730
- };
1731
- }
1732
- function peg$classExpectation(parts, inverted, ignoreCase) {
1733
- return {
1734
- type: "class",
1735
- parts,
1736
- inverted,
1737
- ignoreCase
1738
- };
1739
- }
1740
- function peg$anyExpectation() {
1741
- return {
1742
- type: "any"
1743
- };
1744
- }
1745
- function peg$endExpectation() {
1746
- return {
1747
- type: "end"
1748
- };
1749
- }
1750
- function peg$otherExpectation(description) {
1751
- return {
1752
- type: "other",
1753
- description
1754
- };
1755
- }
1756
- function peg$computePosDetails(pos) {
1757
- var details = peg$posDetailsCache[pos];
1758
- var p;
1759
- if (details) {
1760
- return details;
1761
- } else {
1762
- if (pos >= peg$posDetailsCache.length) {
1763
- p = peg$posDetailsCache.length - 1;
1764
- } else {
1765
- p = pos;
1766
- while (!peg$posDetailsCache[--p]) {}
1767
- }
1768
- details = peg$posDetailsCache[p];
1769
- details = {
1770
- line: details.line,
1771
- column: details.column
1772
- };
1773
- while (p < pos) {
1774
- if (input.charCodeAt(p) === 10) {
1775
- details.line++;
1776
- details.column = 1;
1777
- } else {
1778
- details.column++;
1779
- }
1780
- p++;
1781
- }
1782
- peg$posDetailsCache[pos] = details;
1783
- return details;
1784
- }
1785
- }
1786
- function peg$computeLocation(startPos, endPos, offset) {
1787
- var startPosDetails = peg$computePosDetails(startPos);
1788
- var endPosDetails = peg$computePosDetails(endPos);
1789
- var res = {
1790
- source: peg$source,
1791
- start: {
1792
- offset: startPos,
1793
- line: startPosDetails.line,
1794
- column: startPosDetails.column
1795
- },
1796
- end: {
1797
- offset: endPos,
1798
- line: endPosDetails.line,
1799
- column: endPosDetails.column
1800
- }
1801
- };
1802
- if (offset && peg$source && typeof peg$source.offset === "function") {
1803
- res.start = peg$source.offset(res.start);
1804
- res.end = peg$source.offset(res.end);
1805
- }
1806
- return res;
1807
- }
1808
- function peg$fail(expected) {
1809
- if (peg$currPos < peg$maxFailPos) {
1810
- return;
1811
- }
1812
- if (peg$currPos > peg$maxFailPos) {
1813
- peg$maxFailPos = peg$currPos;
1814
- peg$maxFailExpected = [];
1815
- }
1816
- peg$maxFailExpected.push(expected);
1817
- }
1818
- function peg$buildSimpleError(message, location) {
1819
- return new peg$SyntaxError(message, null, null, location);
1820
- }
1821
- function peg$buildStructuredError(expected, found, location) {
1822
- return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
1823
- }
1824
- function peg$parsestart() {
1825
- var s0, s1;
1826
- peg$silentFails++;
1827
- s0 = peg$parsetransformFunctions();
1828
- peg$silentFails--;
1829
- if (s0 === peg$FAILED) {
1830
- s1 = peg$FAILED;
1831
- if (peg$silentFails === 0) {
1832
- peg$fail(peg$e0);
1833
- }
1834
- }
1835
- return s0;
1836
- }
1837
- function peg$parsetransformFunctions() {
1838
- var s0, s1, s2, s3, s4, s5;
1839
- peg$silentFails++;
1840
- s0 = peg$currPos;
1841
- s1 = peg$parsefunction();
1842
- if (s1 !== peg$FAILED) {
1843
- s2 = [];
1844
- s3 = peg$currPos;
1845
- s4 = peg$parse_();
1846
- s5 = peg$parsefunction();
1847
- if (s5 !== peg$FAILED) {
1848
- s4 = [s4, s5];
1849
- s3 = s4;
1850
- } else {
1851
- peg$currPos = s3;
1852
- s3 = peg$FAILED;
1853
- }
1854
- while (s3 !== peg$FAILED) {
1855
- s2.push(s3);
1856
- s3 = peg$currPos;
1857
- s4 = peg$parse_();
1858
- s5 = peg$parsefunction();
1859
- if (s5 !== peg$FAILED) {
1860
- s4 = [s4, s5];
1861
- s3 = s4;
1862
- } else {
1863
- peg$currPos = s3;
1864
- s3 = peg$FAILED;
1865
- }
1866
- }
1867
- peg$savedPos = s0;
1868
- s0 = peg$f0(s1, s2);
1869
- } else {
1870
- peg$currPos = s0;
1871
- s0 = peg$FAILED;
1872
- }
1873
- peg$silentFails--;
1874
- if (s0 === peg$FAILED) {
1875
- s1 = peg$FAILED;
1876
- if (peg$silentFails === 0) {
1877
- peg$fail(peg$e1);
1878
- }
1879
- }
1880
- return s0;
1881
- }
1882
- function peg$parsefunction() {
1883
- var s0, s1;
1884
- peg$silentFails++;
1885
- s0 = peg$parsematrix();
1886
- if (s0 === peg$FAILED) {
1887
- s0 = peg$parsetranslate();
1888
- if (s0 === peg$FAILED) {
1889
- s0 = peg$parsescale();
1890
- if (s0 === peg$FAILED) {
1891
- s0 = peg$parserotate();
1892
- if (s0 === peg$FAILED) {
1893
- s0 = peg$parseskewX();
1894
- if (s0 === peg$FAILED) {
1895
- s0 = peg$parseskewY();
1896
- }
1897
- }
1898
- }
1899
- }
1900
- }
1901
- peg$silentFails--;
1902
- if (s0 === peg$FAILED) {
1903
- s1 = peg$FAILED;
1904
- if (peg$silentFails === 0) {
1905
- peg$fail(peg$e2);
1906
- }
1907
- }
1908
- return s0;
1909
- }
1910
- function peg$parsematrix() {
1911
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23;
1912
- peg$silentFails++;
1913
- s0 = peg$currPos;
1914
- s1 = peg$parse_();
1915
- if (input.substr(peg$currPos, 7) === peg$c0) {
1916
- s2 = peg$c0;
1917
- peg$currPos += 7;
1918
- } else {
1919
- s2 = peg$FAILED;
1920
- if (peg$silentFails === 0) {
1921
- peg$fail(peg$e4);
1922
- }
1923
- }
1924
- if (s2 !== peg$FAILED) {
1925
- s3 = peg$parse_();
1926
- s4 = peg$parseNUM();
1927
- if (s4 !== peg$FAILED) {
1928
- s5 = peg$parsespaceOrComma();
1929
- s6 = peg$parseNUM();
1930
- if (s6 !== peg$FAILED) {
1931
- s7 = peg$parsespaceOrComma();
1932
- s8 = peg$parseNUM();
1933
- if (s8 !== peg$FAILED) {
1934
- s9 = peg$parsespaceOrComma();
1935
- s10 = peg$parseNUM();
1936
- if (s10 !== peg$FAILED) {
1937
- s11 = peg$parsespaceOrComma();
1938
- s12 = peg$parseNUM();
1939
- if (s12 !== peg$FAILED) {
1940
- s13 = peg$parsespaceOrComma();
1941
- s14 = peg$parseNUM();
1942
- if (s14 !== peg$FAILED) {
1943
- s15 = peg$parsespaceOrComma();
1944
- s16 = peg$parseNUM();
1945
- if (s16 !== peg$FAILED) {
1946
- s17 = peg$parsespaceOrComma();
1947
- s18 = peg$parseNUM();
1948
- if (s18 !== peg$FAILED) {
1949
- s19 = peg$parsespaceOrComma();
1950
- s20 = peg$parseNUM();
1951
- if (s20 !== peg$FAILED) {
1952
- s21 = peg$parse_();
1953
- if (input.charCodeAt(peg$currPos) === 41) {
1954
- s22 = peg$c1;
1955
- peg$currPos++;
1956
- } else {
1957
- s22 = peg$FAILED;
1958
- if (peg$silentFails === 0) {
1959
- peg$fail(peg$e5);
1960
- }
1961
- }
1962
- if (s22 !== peg$FAILED) {
1963
- s23 = peg$parse_();
1964
- peg$savedPos = s0;
1965
- s0 = peg$f1(s4, s6, s8, s10, s12, s14, s16, s18, s20);
1966
- } else {
1967
- peg$currPos = s0;
1968
- s0 = peg$FAILED;
1969
- }
1970
- } else {
1971
- peg$currPos = s0;
1972
- s0 = peg$FAILED;
1973
- }
1974
- } else {
1975
- peg$currPos = s0;
1976
- s0 = peg$FAILED;
1977
- }
1978
- } else {
1979
- peg$currPos = s0;
1980
- s0 = peg$FAILED;
1981
- }
1982
- } else {
1983
- peg$currPos = s0;
1984
- s0 = peg$FAILED;
1985
- }
1986
- } else {
1987
- peg$currPos = s0;
1988
- s0 = peg$FAILED;
1989
- }
1990
- } else {
1991
- peg$currPos = s0;
1992
- s0 = peg$FAILED;
1993
- }
1994
- } else {
1995
- peg$currPos = s0;
1996
- s0 = peg$FAILED;
1997
- }
1998
- } else {
1999
- peg$currPos = s0;
2000
- s0 = peg$FAILED;
2001
- }
2002
- } else {
2003
- peg$currPos = s0;
2004
- s0 = peg$FAILED;
2005
- }
2006
- } else {
2007
- peg$currPos = s0;
2008
- s0 = peg$FAILED;
2009
- }
2010
- peg$silentFails--;
2011
- if (s0 === peg$FAILED) {
2012
- s1 = peg$FAILED;
2013
- if (peg$silentFails === 0) {
2014
- peg$fail(peg$e3);
2015
- }
2016
- }
2017
- return s0;
2018
- }
2019
- function peg$parsetranslate() {
2020
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
2021
- peg$silentFails++;
2022
- s0 = peg$currPos;
2023
- s1 = peg$parse_();
2024
- if (input.substr(peg$currPos, 10) === peg$c2) {
2025
- s2 = peg$c2;
2026
- peg$currPos += 10;
2027
- } else {
2028
- s2 = peg$FAILED;
2029
- if (peg$silentFails === 0) {
2030
- peg$fail(peg$e7);
2031
- }
2032
- }
2033
- if (s2 !== peg$FAILED) {
2034
- s3 = peg$parse_();
2035
- s4 = peg$parseNUM();
2036
- if (s4 !== peg$FAILED) {
2037
- s5 = peg$parsespaceOrComma();
2038
- s6 = peg$parseNUM();
2039
- if (s6 === peg$FAILED) {
2040
- s6 = null;
2041
- }
2042
- s7 = peg$parse_();
2043
- if (input.charCodeAt(peg$currPos) === 41) {
2044
- s8 = peg$c1;
2045
- peg$currPos++;
2046
- } else {
2047
- s8 = peg$FAILED;
2048
- if (peg$silentFails === 0) {
2049
- peg$fail(peg$e5);
2050
- }
2051
- }
2052
- if (s8 !== peg$FAILED) {
2053
- s9 = peg$parse_();
2054
- peg$savedPos = s0;
2055
- s0 = peg$f2(s4, s6);
2056
- } else {
2057
- peg$currPos = s0;
2058
- s0 = peg$FAILED;
2059
- }
2060
- } else {
2061
- peg$currPos = s0;
2062
- s0 = peg$FAILED;
2063
- }
2064
- } else {
2065
- peg$currPos = s0;
2066
- s0 = peg$FAILED;
2067
- }
2068
- peg$silentFails--;
2069
- if (s0 === peg$FAILED) {
2070
- s1 = peg$FAILED;
2071
- if (peg$silentFails === 0) {
2072
- peg$fail(peg$e6);
2073
- }
2074
- }
2075
- return s0;
2076
- }
2077
- function peg$parsescale() {
2078
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
2079
- peg$silentFails++;
2080
- s0 = peg$currPos;
2081
- s1 = peg$parse_();
2082
- if (input.substr(peg$currPos, 6) === peg$c3) {
2083
- s2 = peg$c3;
2084
- peg$currPos += 6;
2085
- } else {
2086
- s2 = peg$FAILED;
2087
- if (peg$silentFails === 0) {
2088
- peg$fail(peg$e9);
2089
- }
2090
- }
2091
- if (s2 !== peg$FAILED) {
2092
- s3 = peg$parse_();
2093
- s4 = peg$parseNUM();
2094
- if (s4 !== peg$FAILED) {
2095
- s5 = peg$parsespaceOrComma();
2096
- s6 = peg$parseNUM();
2097
- if (s6 === peg$FAILED) {
2098
- s6 = null;
2099
- }
2100
- s7 = peg$parse_();
2101
- if (input.charCodeAt(peg$currPos) === 41) {
2102
- s8 = peg$c1;
2103
- peg$currPos++;
2104
- } else {
2105
- s8 = peg$FAILED;
2106
- if (peg$silentFails === 0) {
2107
- peg$fail(peg$e5);
2108
- }
2109
- }
2110
- if (s8 !== peg$FAILED) {
2111
- s9 = peg$parse_();
2112
- peg$savedPos = s0;
2113
- s0 = peg$f3(s4, s6);
2114
- } else {
2115
- peg$currPos = s0;
2116
- s0 = peg$FAILED;
2117
- }
2118
- } else {
2119
- peg$currPos = s0;
2120
- s0 = peg$FAILED;
2121
- }
2122
- } else {
2123
- peg$currPos = s0;
2124
- s0 = peg$FAILED;
2125
- }
2126
- peg$silentFails--;
2127
- if (s0 === peg$FAILED) {
2128
- s1 = peg$FAILED;
2129
- if (peg$silentFails === 0) {
2130
- peg$fail(peg$e8);
2131
- }
2132
- }
2133
- return s0;
2134
- }
2135
- function peg$parserotate() {
2136
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
2137
- peg$silentFails++;
2138
- s0 = peg$currPos;
2139
- s1 = peg$parse_();
2140
- if (input.substr(peg$currPos, 7) === peg$c4) {
2141
- s2 = peg$c4;
2142
- peg$currPos += 7;
2143
- } else {
2144
- s2 = peg$FAILED;
2145
- if (peg$silentFails === 0) {
2146
- peg$fail(peg$e11);
2147
- }
2148
- }
2149
- if (s2 !== peg$FAILED) {
2150
- s3 = peg$parse_();
2151
- s4 = peg$parseNUM();
2152
- if (s4 !== peg$FAILED) {
2153
- s5 = peg$parsetwoNumbers();
2154
- if (s5 === peg$FAILED) {
2155
- s5 = null;
2156
- }
2157
- s6 = peg$parse_();
2158
- if (input.charCodeAt(peg$currPos) === 41) {
2159
- s7 = peg$c1;
2160
- peg$currPos++;
2161
- } else {
2162
- s7 = peg$FAILED;
2163
- if (peg$silentFails === 0) {
2164
- peg$fail(peg$e5);
2165
- }
2166
- }
2167
- if (s7 !== peg$FAILED) {
2168
- s8 = peg$parse_();
2169
- peg$savedPos = s0;
2170
- s0 = peg$f4(s4, s5);
2171
- } else {
2172
- peg$currPos = s0;
2173
- s0 = peg$FAILED;
2174
- }
2175
- } else {
2176
- peg$currPos = s0;
2177
- s0 = peg$FAILED;
2178
- }
2179
- } else {
2180
- peg$currPos = s0;
2181
- s0 = peg$FAILED;
2182
- }
2183
- peg$silentFails--;
2184
- if (s0 === peg$FAILED) {
2185
- s1 = peg$FAILED;
2186
- if (peg$silentFails === 0) {
2187
- peg$fail(peg$e10);
2188
- }
2189
- }
2190
- return s0;
2191
- }
2192
- function peg$parsetwoNumbers() {
2193
- var s0, s1, s2, s3, s4;
2194
- peg$silentFails++;
2195
- s0 = peg$currPos;
2196
- s1 = peg$parsespaceOrComma();
2197
- s2 = peg$parseNUM();
2198
- if (s2 !== peg$FAILED) {
2199
- s3 = peg$parsespaceOrComma();
2200
- s4 = peg$parseNUM();
2201
- if (s4 !== peg$FAILED) {
2202
- peg$savedPos = s0;
2203
- s0 = peg$f5(s2, s4);
2204
- } else {
2205
- peg$currPos = s0;
2206
- s0 = peg$FAILED;
2207
- }
2208
- } else {
2209
- peg$currPos = s0;
2210
- s0 = peg$FAILED;
2211
- }
2212
- peg$silentFails--;
2213
- if (s0 === peg$FAILED) {
2214
- s1 = peg$FAILED;
2215
- if (peg$silentFails === 0) {
2216
- peg$fail(peg$e12);
2217
- }
2218
- }
2219
- return s0;
2220
- }
2221
- function peg$parseskewX() {
2222
- var s0, s1, s2, s3, s4, s5, s6, s7;
2223
- peg$silentFails++;
2224
- s0 = peg$currPos;
2225
- s1 = peg$parse_();
2226
- if (input.substr(peg$currPos, 6) === peg$c5) {
2227
- s2 = peg$c5;
2228
- peg$currPos += 6;
2229
- } else {
2230
- s2 = peg$FAILED;
2231
- if (peg$silentFails === 0) {
2232
- peg$fail(peg$e14);
2233
- }
2234
- }
2235
- if (s2 !== peg$FAILED) {
2236
- s3 = peg$parse_();
2237
- s4 = peg$parseNUM();
2238
- if (s4 !== peg$FAILED) {
2239
- s5 = peg$parse_();
2240
- if (input.charCodeAt(peg$currPos) === 41) {
2241
- s6 = peg$c1;
2242
- peg$currPos++;
2243
- } else {
2244
- s6 = peg$FAILED;
2245
- if (peg$silentFails === 0) {
2246
- peg$fail(peg$e5);
2247
- }
2248
- }
2249
- if (s6 !== peg$FAILED) {
2250
- s7 = peg$parse_();
2251
- peg$savedPos = s0;
2252
- s0 = peg$f6(s4);
2253
- } else {
2254
- peg$currPos = s0;
2255
- s0 = peg$FAILED;
2256
- }
2257
- } else {
2258
- peg$currPos = s0;
2259
- s0 = peg$FAILED;
2260
- }
2261
- } else {
2262
- peg$currPos = s0;
2263
- s0 = peg$FAILED;
2264
- }
2265
- peg$silentFails--;
2266
- if (s0 === peg$FAILED) {
2267
- s1 = peg$FAILED;
2268
- if (peg$silentFails === 0) {
2269
- peg$fail(peg$e13);
2270
- }
2271
- }
2272
- return s0;
2273
- }
2274
- function peg$parseskewY() {
2275
- var s0, s1, s2, s3, s4, s5, s6, s7;
2276
- peg$silentFails++;
2277
- s0 = peg$currPos;
2278
- s1 = peg$parse_();
2279
- if (input.substr(peg$currPos, 6) === peg$c6) {
2280
- s2 = peg$c6;
2281
- peg$currPos += 6;
2282
- } else {
2283
- s2 = peg$FAILED;
2284
- if (peg$silentFails === 0) {
2285
- peg$fail(peg$e16);
2286
- }
2287
- }
2288
- if (s2 !== peg$FAILED) {
2289
- s3 = peg$parse_();
2290
- s4 = peg$parseNUM();
2291
- if (s4 !== peg$FAILED) {
2292
- s5 = peg$parse_();
2293
- if (input.charCodeAt(peg$currPos) === 41) {
2294
- s6 = peg$c1;
2295
- peg$currPos++;
2296
- } else {
2297
- s6 = peg$FAILED;
2298
- if (peg$silentFails === 0) {
2299
- peg$fail(peg$e5);
2300
- }
2301
- }
2302
- if (s6 !== peg$FAILED) {
2303
- s7 = peg$parse_();
2304
- peg$savedPos = s0;
2305
- s0 = peg$f7(s4);
2306
- } else {
2307
- peg$currPos = s0;
2308
- s0 = peg$FAILED;
2309
- }
2310
- } else {
2311
- peg$currPos = s0;
2312
- s0 = peg$FAILED;
2313
- }
2314
- } else {
2315
- peg$currPos = s0;
2316
- s0 = peg$FAILED;
2317
- }
2318
- peg$silentFails--;
2319
- if (s0 === peg$FAILED) {
2320
- s1 = peg$FAILED;
2321
- if (peg$silentFails === 0) {
2322
- peg$fail(peg$e15);
2323
- }
2324
- }
2325
- return s0;
2326
- }
2327
- function peg$parsespaceOrComma() {
2328
- var s0, s1;
2329
- peg$silentFails++;
2330
- s0 = [];
2331
- s1 = input.charAt(peg$currPos);
2332
- if (peg$r0.test(s1)) {
2333
- peg$currPos++;
2334
- } else {
2335
- s1 = peg$FAILED;
2336
- if (peg$silentFails === 0) {
2337
- peg$fail(peg$e18);
2338
- }
2339
- }
2340
- while (s1 !== peg$FAILED) {
2341
- s0.push(s1);
2342
- s1 = input.charAt(peg$currPos);
2343
- if (peg$r0.test(s1)) {
2344
- peg$currPos++;
2345
- } else {
2346
- s1 = peg$FAILED;
2347
- if (peg$silentFails === 0) {
2348
- peg$fail(peg$e18);
2349
- }
2350
- }
2351
- }
2352
- peg$silentFails--;
2353
- s1 = peg$FAILED;
2354
- if (peg$silentFails === 0) {
2355
- peg$fail(peg$e17);
2356
- }
2357
- return s0;
2358
- }
2359
- function peg$parse_() {
2360
- var s0, s1;
2361
- peg$silentFails++;
2362
- s0 = [];
2363
- s1 = input.charAt(peg$currPos);
2364
- if (peg$r1.test(s1)) {
2365
- peg$currPos++;
2366
- } else {
2367
- s1 = peg$FAILED;
2368
- if (peg$silentFails === 0) {
2369
- peg$fail(peg$e20);
2370
- }
2371
- }
2372
- while (s1 !== peg$FAILED) {
2373
- s0.push(s1);
2374
- s1 = input.charAt(peg$currPos);
2375
- if (peg$r1.test(s1)) {
2376
- peg$currPos++;
2377
- } else {
2378
- s1 = peg$FAILED;
2379
- if (peg$silentFails === 0) {
2380
- peg$fail(peg$e20);
2381
- }
2382
- }
2383
- }
2384
- peg$silentFails--;
2385
- s1 = peg$FAILED;
2386
- if (peg$silentFails === 0) {
2387
- peg$fail(peg$e19);
2388
- }
2389
- return s0;
2390
- }
2391
- function peg$parseNUM() {
2392
- var s0, s1, s2, s3, s4, s5, s6, s7;
2393
- s0 = peg$currPos;
2394
- s1 = input.charAt(peg$currPos);
2395
- if (peg$r2.test(s1)) {
2396
- peg$currPos++;
2397
- } else {
2398
- s1 = peg$FAILED;
2399
- if (peg$silentFails === 0) {
2400
- peg$fail(peg$e21);
2401
- }
2402
- }
2403
- if (s1 === peg$FAILED) {
2404
- s1 = null;
2405
- }
2406
- s2 = peg$currPos;
2407
- s3 = [];
2408
- s4 = input.charAt(peg$currPos);
2409
- if (peg$r3.test(s4)) {
2410
- peg$currPos++;
2411
- } else {
2412
- s4 = peg$FAILED;
2413
- if (peg$silentFails === 0) {
2414
- peg$fail(peg$e22);
2415
- }
2416
- }
2417
- while (s4 !== peg$FAILED) {
2418
- s3.push(s4);
2419
- s4 = input.charAt(peg$currPos);
2420
- if (peg$r3.test(s4)) {
2421
- peg$currPos++;
2422
- } else {
2423
- s4 = peg$FAILED;
2424
- if (peg$silentFails === 0) {
2425
- peg$fail(peg$e22);
2426
- }
2427
- }
2428
- }
2429
- if (input.charCodeAt(peg$currPos) === 46) {
2430
- s4 = peg$c7;
2431
- peg$currPos++;
2432
- } else {
2433
- s4 = peg$FAILED;
2434
- if (peg$silentFails === 0) {
2435
- peg$fail(peg$e23);
2436
- }
2437
- }
2438
- if (s4 !== peg$FAILED) {
2439
- s5 = [];
2440
- s6 = input.charAt(peg$currPos);
2441
- if (peg$r3.test(s6)) {
2442
- peg$currPos++;
2443
- } else {
2444
- s6 = peg$FAILED;
2445
- if (peg$silentFails === 0) {
2446
- peg$fail(peg$e22);
2447
- }
2448
- }
2449
- if (s6 !== peg$FAILED) {
2450
- while (s6 !== peg$FAILED) {
2451
- s5.push(s6);
2452
- s6 = input.charAt(peg$currPos);
2453
- if (peg$r3.test(s6)) {
2454
- peg$currPos++;
2455
- } else {
2456
- s6 = peg$FAILED;
2457
- if (peg$silentFails === 0) {
2458
- peg$fail(peg$e22);
2459
- }
2460
- }
2461
- }
2462
- } else {
2463
- s5 = peg$FAILED;
2464
- }
2465
- if (s5 !== peg$FAILED) {
2466
- s3 = [s3, s4, s5];
2467
- s2 = s3;
2468
- } else {
2469
- peg$currPos = s2;
2470
- s2 = peg$FAILED;
2471
- }
2472
- } else {
2473
- peg$currPos = s2;
2474
- s2 = peg$FAILED;
2475
- }
2476
- if (s2 === peg$FAILED) {
2477
- s2 = [];
2478
- s3 = input.charAt(peg$currPos);
2479
- if (peg$r3.test(s3)) {
2480
- peg$currPos++;
2481
- } else {
2482
- s3 = peg$FAILED;
2483
- if (peg$silentFails === 0) {
2484
- peg$fail(peg$e22);
2485
- }
2486
- }
2487
- if (s3 !== peg$FAILED) {
2488
- while (s3 !== peg$FAILED) {
2489
- s2.push(s3);
2490
- s3 = input.charAt(peg$currPos);
2491
- if (peg$r3.test(s3)) {
2492
- peg$currPos++;
2493
- } else {
2494
- s3 = peg$FAILED;
2495
- if (peg$silentFails === 0) {
2496
- peg$fail(peg$e22);
2497
- }
2498
- }
2499
- }
2500
- } else {
2501
- s2 = peg$FAILED;
2502
- }
2503
- }
2504
- if (s2 !== peg$FAILED) {
2505
- s3 = peg$currPos;
2506
- if (input.charCodeAt(peg$currPos) === 101) {
2507
- s4 = peg$c8;
2508
- peg$currPos++;
2509
- } else {
2510
- s4 = peg$FAILED;
2511
- if (peg$silentFails === 0) {
2512
- peg$fail(peg$e24);
2513
- }
2514
- }
2515
- if (s4 !== peg$FAILED) {
2516
- s5 = input.charAt(peg$currPos);
2517
- if (peg$r2.test(s5)) {
2518
- peg$currPos++;
2519
- } else {
2520
- s5 = peg$FAILED;
2521
- if (peg$silentFails === 0) {
2522
- peg$fail(peg$e21);
2523
- }
2524
- }
2525
- if (s5 === peg$FAILED) {
2526
- s5 = null;
2527
- }
2528
- s6 = [];
2529
- s7 = input.charAt(peg$currPos);
2530
- if (peg$r3.test(s7)) {
2531
- peg$currPos++;
2532
- } else {
2533
- s7 = peg$FAILED;
2534
- if (peg$silentFails === 0) {
2535
- peg$fail(peg$e22);
2536
- }
2537
- }
2538
- if (s7 !== peg$FAILED) {
2539
- while (s7 !== peg$FAILED) {
2540
- s6.push(s7);
2541
- s7 = input.charAt(peg$currPos);
2542
- if (peg$r3.test(s7)) {
2543
- peg$currPos++;
2544
- } else {
2545
- s7 = peg$FAILED;
2546
- if (peg$silentFails === 0) {
2547
- peg$fail(peg$e22);
2548
- }
2549
- }
2550
- }
2551
- } else {
2552
- s6 = peg$FAILED;
2553
- }
2554
- if (s6 !== peg$FAILED) {
2555
- s4 = [s4, s5, s6];
2556
- s3 = s4;
2557
- } else {
2558
- peg$currPos = s3;
2559
- s3 = peg$FAILED;
2560
- }
2561
- } else {
2562
- peg$currPos = s3;
2563
- s3 = peg$FAILED;
2564
- }
2565
- if (s3 === peg$FAILED) {
2566
- s3 = null;
2567
- }
2568
- peg$savedPos = s0;
2569
- s0 = peg$f8();
2570
- } else {
2571
- peg$currPos = s0;
2572
- s0 = peg$FAILED;
2573
- }
2574
- return s0;
2575
- }
2576
- peg$result = peg$startRuleFunction();
2577
- if (options.peg$library) {
2578
- return {
2579
- peg$result,
2580
- peg$currPos,
2581
- peg$FAILED,
2582
- peg$maxFailExpected,
2583
- peg$maxFailPos
2584
- };
2585
- }
2586
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
2587
- return peg$result;
2588
- } else {
2589
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
2590
- peg$fail(peg$endExpectation());
2591
- }
2592
- throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
2593
- }
2594
- }
2595
- module.exports = {
2596
- StartRules: ["start"],
2597
- SyntaxError: peg$SyntaxError,
2598
- parse: peg$parse
2599
- };
2600
- });
2601
-
2602
- // node_modules/@react-native/assets-registry/registry.js
2603
- var require_registry = __commonJS(function(exports, module) {
2604
- var assets = [];
2605
- function registerAsset(asset) {
2606
- return assets.push(asset);
2607
- }
2608
- function getAssetByID(assetId) {
2609
- return assets[assetId - 1];
2610
- }
2611
- module.exports = { registerAsset, getAssetByID };
2612
- });
2613
-
2614
- // node_modules/@ankhorage/surface/src/features/button/adapters/inbound/ButtonPresentation.tsx
2615
- var import_react_native = __toESM(require_cjs(), 1);
2616
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2617
- function ButtonPresentation({ Icon, ...props }) {
2618
- const {
2619
- children,
2620
- variant = "solid",
2621
- color = "primary",
2622
- size = "m",
2623
- labelWeight = "semiBold",
2624
- disabled = false,
2625
- loading = false,
2626
- leadingIcon,
2627
- trailingIcon,
2628
- fullWidth = false,
2629
- onPress,
2630
- testID,
2631
- ...pressableProps
2632
- } = props;
2633
- const { theme } = useTheme();
2634
- const controlSize = resolveControlSize(theme, size);
2635
- return /* @__PURE__ */ jsx(Pressable, {
2636
- ...pressableProps,
2637
- disabled: disabled || loading,
2638
- onPress,
2639
- style: resolvePressableStyle(fullWidth),
2640
- testID,
2641
- children: (state) => /* @__PURE__ */ jsx(ButtonContent, {
2642
- Icon,
2643
- color,
2644
- controlSize,
2645
- fullWidth,
2646
- leadingIcon,
2647
- labelWeight,
2648
- loading,
2649
- size,
2650
- state,
2651
- theme,
2652
- trailingIcon,
2653
- variant,
2654
- children
2655
- })
2656
- });
2657
- }
2658
- function ButtonContent({
2659
- Icon,
2660
- children,
2661
- color,
2662
- controlSize,
2663
- fullWidth,
2664
- leadingIcon,
2665
- labelWeight,
2666
- loading,
2667
- size,
2668
- state,
2669
- theme,
2670
- trailingIcon,
2671
- variant
2672
- }) {
2673
- const colors = resolveButtonColors(theme, { variant, color, state });
2674
- const iconSize = resolveIconSize2(theme, size);
2675
- return /* @__PURE__ */ jsx(View3, {
2676
- px: controlSize.paddingHorizontal,
2677
- py: controlSize.paddingVertical,
2678
- radius: controlSize.borderRadius,
2679
- style: resolveButtonContentStyle(controlSize, colors, fullWidth, variant),
2680
- children: loading ? /* @__PURE__ */ jsx(import_react_native.ActivityIndicator, {
2681
- color: colors.contentColor,
2682
- size: "small"
2683
- }) : /* @__PURE__ */ jsxs(Fragment, {
2684
- children: [
2685
- leadingIcon ? /* @__PURE__ */ jsx(import_react_native.View, {
2686
- style: resolveAccessoryStyle(theme.spacing.s, "leading"),
2687
- children: /* @__PURE__ */ jsx(Icon, {
2688
- ...leadingIcon,
2689
- color: colors.contentColor,
2690
- size: iconSize
2691
- })
2692
- }) : null,
2693
- /* @__PURE__ */ jsx(Text2, {
2694
- style: { color: colors.contentColor },
2695
- variant: controlSize.textVariant,
2696
- weight: labelWeight,
2697
- children
2698
- }),
2699
- trailingIcon ? /* @__PURE__ */ jsx(import_react_native.View, {
2700
- style: resolveAccessoryStyle(theme.spacing.s, "trailing"),
2701
- children: /* @__PURE__ */ jsx(Icon, {
2702
- ...trailingIcon,
2703
- color: colors.contentColor,
2704
- size: iconSize
2705
- })
2706
- }) : null
2707
- ]
2708
- })
2709
- });
2710
- }
2711
- function resolvePressableStyle(fullWidth) {
2712
- return { alignSelf: fullWidth ? "stretch" : "flex-start" };
2713
- }
2714
- function resolveButtonContentStyle(controlSize, colors, fullWidth, variant) {
2715
- return {
2716
- alignItems: "center",
2717
- backgroundColor: colors.backgroundColor,
2718
- borderColor: colors.borderColor,
2719
- borderWidth: variant === "solid" ? 0 : 1,
2720
- flexDirection: "row",
2721
- justifyContent: "center",
2722
- minHeight: controlSize.minHeight,
2723
- opacity: colors.opacity,
2724
- width: fullWidth ? "100%" : undefined
2725
- };
2726
- }
2727
- function resolveAccessoryStyle(spacing, position) {
2728
- return position === "leading" ? { marginRight: spacing } : { marginLeft: spacing };
2729
- }
2730
-
2731
- // node_modules/@ankhorage/surface/src/features/button/adapters/inbound/Button.web.tsx
2732
- import { jsx as jsx2 } from "react/jsx-runtime";
2733
- function Button3(props) {
2734
- return /* @__PURE__ */ jsx2(ButtonPresentation, {
2735
- ...props,
2736
- Icon: Icon3
2737
- });
2738
- }
2739
-
2740
- // node_modules/react-native-svg/lib/module/web/utils/index.js
2741
- var camelCaseToDashed = (camelCase) => {
2742
- return camelCase.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
2743
- };
2744
- var getBoundingClientRect = (node) => {
2745
- if (node) {
2746
- const isElement = node.nodeType === 1;
2747
- if (isElement && typeof node.getBoundingClientRect === "function") {
2748
- return node.getBoundingClientRect();
2749
- }
2750
- }
2751
- throw new Error("Can not get boundingClientRect of " + node || "undefined");
2752
- };
2753
- var measureLayout = (node, callback) => {
2754
- const relativeNode = node === null || node === undefined ? undefined : node.parentNode;
2755
- if (relativeNode) {
2756
- setTimeout(() => {
2757
- const relativeRect = getBoundingClientRect(relativeNode);
2758
- const {
2759
- height,
2760
- left,
2761
- top,
2762
- width
2763
- } = getBoundingClientRect(node);
2764
- const x = left - relativeRect.left;
2765
- const y = top - relativeRect.top;
2766
- callback(x, y, width, height, left, top);
2767
- }, 0);
2768
- }
2769
- };
2770
- function remeasure() {
2771
- const tag = this.state.touchable.responderID;
2772
- if (tag === null) {
2773
- return;
2774
- }
2775
- measureLayout(tag, this._handleQueryLayout);
2776
- }
2777
- function encodeSvg(svgString) {
2778
- return svgString.replace("<svg", ~svgString.indexOf("xmlns") ? "<svg" : '<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/{/g, "%7B").replace(/}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
2779
- }
2780
- var KEEP_CAMEL_CASE = new Set(["stdDeviation", "edgeMode", "kernelMatrix", "kernelUnitLength", "preserveAlpha", "baseFrequency", "targetX", "targetY", "numOctaves", "stitchTiles", "filterUnits", "primitiveUnits", "pathLength", "gradientUnits", "gradientTransform", "spreadMethod", "markerHeight", "markerUnits", "markerWidth", "viewBox", "refX", "refY", "maskContentUnits", "maskUnits", "patternContentUnits", "patternTransform", "patternUnits", "textLength", "lengthAdjust", "startOffset", "clipPathUnits"]);
2781
- var getAttributeName = (attr) => {
2782
- return KEEP_CAMEL_CASE.has(attr) ? attr : camelCaseToDashed(attr);
2783
- };
2784
-
2785
- // node_modules/react-native-svg/lib/module/web/WebShape.js
2786
- var import_react_native5 = __toESM(require_cjs());
2787
- import React from "react";
2788
-
2789
- // node_modules/react-native-svg/lib/module/web/utils/hasProperty.js
2790
- function hasTouchableProperty(props) {
2791
- return !!(props.onPress || props.onPressIn || props.onPressOut || props.onLongPress);
2792
- }
2793
-
2794
- // node_modules/react-native-svg/lib/module/lib/Matrix2D.js
2795
- var DEG_TO_RAD = Math.PI / 180;
2796
-
2797
- // node_modules/react-native-svg/lib/module/lib/extract/extractTransform.js
2798
- var import_transform = __toESM(require_transform());
2799
- var import_transformToRn = __toESM(require_transformToRn());
2800
- var getAngleValueInDeg = (angle) => {
2801
- if (angle.endsWith("rad")) {
2802
- return parseFloat(angle) * (180 / Math.PI);
2803
- }
2804
- if (angle.endsWith("deg")) {
2805
- return parseFloat(angle);
2806
- }
2807
- };
2808
- function stringifyTransformArrayProps(transformArray) {
2809
- if (!transformArray) {
2810
- return "";
2811
- }
2812
- return transformArray.map((transform) => {
2813
- const [key, value] = Object.entries(transform)[0];
2814
- switch (key) {
2815
- case "translateX":
2816
- return `translate(${value}, 0)`;
2817
- case "translateY":
2818
- return `translate(0, ${value})`;
2819
- case "rotate":
2820
- return `rotate(${getAngleValueInDeg(value)})`;
2821
- case "scale":
2822
- return `scale(${value})`;
2823
- case "scaleX":
2824
- return `scale(${value}, 1)`;
2825
- case "scaleY":
2826
- return `scale(1, ${value})`;
2827
- case "skewX":
2828
- return `skewX(${getAngleValueInDeg(value)})`;
2829
- case "skewY":
2830
- return `skewY(${getAngleValueInDeg(value)})`;
2831
- case "matrix":
2832
- return `matrix(${value.join(", ")})`;
2833
- default:
2834
- return "";
2835
- }
2836
- }).join(" ");
2837
- }
2838
-
2839
- // node_modules/react-native-svg/lib/module/web/utils/parseTransform.js
2840
- function parseTransformProp(transform, props) {
2841
- const transformArray = [];
2842
- props && transformArray.push(...stringifyTransformProps(props));
2843
- if (Array.isArray(transform)) {
2844
- if (typeof transform[0] === "number") {
2845
- transformArray.push(`matrix(${transform.join(" ")})`);
2846
- } else {
2847
- const stringifiedProps = stringifyTransformArrayProps(transform).split(" ");
2848
- transformArray.push(...stringifiedProps);
2849
- }
2850
- } else if (typeof transform === "string") {
2851
- transformArray.push(transform);
2852
- }
2853
- return transformArray.length ? transformArray.join(" ") : undefined;
2854
- }
2855
- function stringifyTransformProps(transformProps) {
2856
- const transformArray = [];
2857
- if (transformProps.translate != null) {
2858
- transformArray.push(`translate(${transformProps.translate})`);
2859
- }
2860
- if (transformProps.translateX != null || transformProps.translateY != null) {
2861
- transformArray.push(`translate(${transformProps.translateX || 0}, ${transformProps.translateY || 0})`);
2862
- }
2863
- if (transformProps.scale != null) {
2864
- transformArray.push(`scale(${transformProps.scale})`);
2865
- }
2866
- if (transformProps.scaleX != null || transformProps.scaleY != null) {
2867
- transformArray.push(`scale(${transformProps.scaleX || 1}, ${transformProps.scaleY || 1})`);
2868
- }
2869
- if (transformProps.rotation != null) {
2870
- transformArray.push(`rotate(${transformProps.rotation})`);
2871
- }
2872
- if (transformProps.skewX != null) {
2873
- transformArray.push(`skewX(${transformProps.skewX})`);
2874
- }
2875
- if (transformProps.skewY != null) {
2876
- transformArray.push(`skewY(${transformProps.skewY})`);
2877
- }
2878
- return transformArray;
2879
- }
2880
-
2881
- // node_modules/react-native-svg/lib/module/lib/resolve.js
2882
- var import_react_native2 = __toESM(require_cjs());
2883
- function resolve(styleProp, cleanedProps) {
2884
- if (styleProp) {
2885
- return import_react_native2.StyleSheet ? [styleProp, cleanedProps] : styleProp[Symbol.iterator] ? Object.assign({}, ...styleProp, cleanedProps) : Object.assign({}, styleProp, cleanedProps);
2886
- } else {
2887
- return cleanedProps;
2888
- }
2889
- }
2890
-
2891
- // node_modules/react-native-svg/lib/module/lib/resolveAssetUri.js
2892
- var import_react_native3 = __toESM(require_cjs());
2893
- var import_registry = __toESM(require_registry());
2894
- var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
2895
- function resolveAssetUri(source) {
2896
- let src = {};
2897
- if (typeof source === "number") {
2898
- const asset = import_registry.getAssetByID(source);
2899
- if (asset == null) {
2900
- throw new Error(`Image: asset with ID "${source}" could not be found. Please check the image source or packager.`);
2901
- }
2902
- src = {
2903
- width: asset.width,
2904
- height: asset.height,
2905
- scale: asset.scales[0]
2906
- };
2907
- if (asset.scales.length > 1) {
2908
- const preferredScale = import_react_native3.PixelRatio.get();
2909
- src.scale = asset.scales.reduce((prev, curr) => Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev);
2910
- }
2911
- const scaleSuffix = src.scale !== 1 ? `@${src.scale}x` : "";
2912
- src.uri = asset ? `${asset.httpServerLocation}/${asset.name}${scaleSuffix}.${asset.type}` : "";
2913
- } else if (typeof source === "string") {
2914
- src.uri = source;
2915
- } else if (source && !Array.isArray(source) && typeof source.uri === "string") {
2916
- src.uri = source.uri;
2917
- }
2918
- if (src.uri) {
2919
- var _src;
2920
- const match = (_src = src) === null || _src === undefined || (_src = _src.uri) === null || _src === undefined ? undefined : _src.match(svgDataUriPattern);
2921
- if (match) {
2922
- const [, prefix, svg] = match;
2923
- const encodedSvg = encodeURIComponent(svg);
2924
- src.uri = `${prefix}${encodedSvg}`;
2925
- return src;
2926
- }
2927
- }
2928
- return src;
2929
- }
2930
-
2931
- // node_modules/react-native-svg/lib/module/web/utils/prepare.js
2932
- var prepare = (self, props = self.props) => {
2933
- const {
2934
- transform,
2935
- origin,
2936
- originX,
2937
- originY,
2938
- fontFamily,
2939
- fontSize,
2940
- fontWeight,
2941
- fontStyle,
2942
- style,
2943
- forwardedRef,
2944
- gradientTransform,
2945
- patternTransform,
2946
- onPress,
2947
- ...rest
2948
- } = props;
2949
- const clean = {
2950
- ...hasTouchableProperty(props) ? {
2951
- onStartShouldSetResponder: self.touchableHandleStartShouldSetResponder,
2952
- onResponderTerminationRequest: self.touchableHandleResponderTerminationRequest,
2953
- onResponderGrant: self.touchableHandleResponderGrant,
2954
- onResponderMove: self.touchableHandleResponderMove,
2955
- onResponderRelease: self.touchableHandleResponderRelease,
2956
- onResponderTerminate: self.touchableHandleResponderTerminate
2957
- } : null,
2958
- ...rest
2959
- };
2960
- if (origin != null) {
2961
- clean["transform-origin"] = origin.toString().replace(",", " ");
2962
- } else if (originX != null || originY != null) {
2963
- clean["transform-origin"] = `${originX || 0} ${originY || 0}`;
2964
- }
2965
- const parsedTransform = parseTransformProp(transform, props);
2966
- if (parsedTransform) {
2967
- clean.transform = parsedTransform;
2968
- }
2969
- const parsedGradientTransform = parseTransformProp(gradientTransform);
2970
- if (parsedGradientTransform) {
2971
- clean.gradientTransform = parsedGradientTransform;
2972
- }
2973
- const parsedPatternTransform = parseTransformProp(patternTransform);
2974
- if (parsedPatternTransform) {
2975
- clean.patternTransform = parsedPatternTransform;
2976
- }
2977
- clean.ref = (el) => {
2978
- self.elementRef.current = el;
2979
- if (typeof forwardedRef === "function") {
2980
- forwardedRef(el);
2981
- } else if (forwardedRef) {
2982
- forwardedRef.current = el;
2983
- }
2984
- };
2985
- const styles = {};
2986
- if (fontFamily != null) {
2987
- styles.fontFamily = fontFamily;
2988
- }
2989
- if (fontSize != null) {
2990
- styles.fontSize = fontSize;
2991
- }
2992
- if (fontWeight != null) {
2993
- styles.fontWeight = fontWeight;
2994
- }
2995
- if (fontStyle != null) {
2996
- styles.fontStyle = fontStyle;
2997
- }
2998
- clean.style = resolve(style, styles);
2999
- if (onPress !== null) {
3000
- clean.onClick = props.onPress;
3001
- }
3002
- if (props.href !== null && props.href !== undefined) {
3003
- var _resolveAssetUri;
3004
- clean.href = (_resolveAssetUri = resolveAssetUri(props.href)) === null || _resolveAssetUri === undefined ? undefined : _resolveAssetUri.uri;
3005
- }
3006
- return clean;
3007
- };
3008
-
3009
- // node_modules/react-native-svg/lib/module/web/utils/convertInt32Color.js
3010
- function convertInt32ColorToRGBA(color) {
3011
- const r = color >> 16 & 255;
3012
- const g = color >> 8 & 255;
3013
- const b = color & 255;
3014
- const a = (color >> 24 & 255) / 255;
3015
- const alpha = a.toFixed(2);
3016
- return `rgba(${r},${g},${b},${alpha})`;
3017
- }
3018
-
3019
- // node_modules/react-native-svg/lib/module/lib/SvgTouchableMixin.js
3020
- var import_react_native4 = __toESM(require_cjs());
3021
- var PRESS_RETENTION_OFFSET = {
3022
- top: 20,
3023
- left: 20,
3024
- right: 20,
3025
- bottom: 30
3026
- };
3027
- var {
3028
- Mixin
3029
- } = import_react_native4.Touchable;
3030
- var {
3031
- touchableHandleStartShouldSetResponder,
3032
- touchableHandleResponderTerminationRequest,
3033
- touchableHandleResponderGrant,
3034
- touchableHandleResponderMove,
3035
- touchableHandleResponderRelease,
3036
- touchableHandleResponderTerminate,
3037
- touchableGetInitialState
3038
- } = Mixin;
3039
- var SvgTouchableMixin = {
3040
- ...Mixin,
3041
- touchableHandleStartShouldSetResponder(e) {
3042
- const {
3043
- onStartShouldSetResponder
3044
- } = this.props;
3045
- if (onStartShouldSetResponder) {
3046
- return onStartShouldSetResponder(e);
3047
- } else {
3048
- return touchableHandleStartShouldSetResponder.call(this, e);
3049
- }
3050
- },
3051
- touchableHandleResponderTerminationRequest(e) {
3052
- const {
3053
- onResponderTerminationRequest
3054
- } = this.props;
3055
- if (onResponderTerminationRequest) {
3056
- return onResponderTerminationRequest(e);
3057
- } else {
3058
- return touchableHandleResponderTerminationRequest.call(this, e);
3059
- }
3060
- },
3061
- touchableHandleResponderGrant(e) {
3062
- const {
3063
- onResponderGrant
3064
- } = this.props;
3065
- if (onResponderGrant) {
3066
- return onResponderGrant(e);
3067
- } else {
3068
- return touchableHandleResponderGrant.call(this, e);
3069
- }
3070
- },
3071
- touchableHandleResponderMove(e) {
3072
- const {
3073
- onResponderMove
3074
- } = this.props;
3075
- if (onResponderMove) {
3076
- return onResponderMove(e);
3077
- } else {
3078
- return touchableHandleResponderMove.call(this, e);
3079
- }
3080
- },
3081
- touchableHandleResponderRelease(e) {
3082
- const {
3083
- onResponderRelease
3084
- } = this.props;
3085
- if (onResponderRelease) {
3086
- return onResponderRelease(e);
3087
- } else {
3088
- return touchableHandleResponderRelease.call(this, e);
3089
- }
3090
- },
3091
- touchableHandleResponderTerminate(e) {
3092
- const {
3093
- onResponderTerminate
3094
- } = this.props;
3095
- if (onResponderTerminate) {
3096
- return onResponderTerminate(e);
3097
- } else {
3098
- return touchableHandleResponderTerminate.call(this, e);
3099
- }
3100
- },
3101
- touchableHandlePress(e) {
3102
- const {
3103
- onPress
3104
- } = this.props;
3105
- onPress && onPress(e);
3106
- },
3107
- touchableHandleActivePressIn(e) {
3108
- const {
3109
- onPressIn
3110
- } = this.props;
3111
- onPressIn && onPressIn(e);
3112
- },
3113
- touchableHandleActivePressOut(e) {
3114
- const {
3115
- onPressOut
3116
- } = this.props;
3117
- onPressOut && onPressOut(e);
3118
- },
3119
- touchableHandleLongPress(e) {
3120
- const {
3121
- onLongPress
3122
- } = this.props;
3123
- onLongPress && onLongPress(e);
3124
- },
3125
- touchableGetPressRectOffset() {
3126
- const {
3127
- pressRetentionOffset
3128
- } = this.props;
3129
- return pressRetentionOffset || PRESS_RETENTION_OFFSET;
3130
- },
3131
- touchableGetHitSlop() {
3132
- const {
3133
- hitSlop
3134
- } = this.props;
3135
- return hitSlop;
3136
- },
3137
- touchableGetHighlightDelayMS() {
3138
- const {
3139
- delayPressIn
3140
- } = this.props;
3141
- return delayPressIn || 0;
3142
- },
3143
- touchableGetLongPressDelayMS() {
3144
- const {
3145
- delayLongPress
3146
- } = this.props;
3147
- return delayLongPress === 0 ? 0 : delayLongPress || 500;
3148
- },
3149
- touchableGetPressOutDelayMS() {
3150
- const {
3151
- delayPressOut
3152
- } = this.props;
3153
- return delayPressOut || 0;
3154
- }
3155
- };
3156
- var touchKeys = Object.keys(SvgTouchableMixin);
3157
- var touchVals = touchKeys.map((key) => SvgTouchableMixin[key]);
3158
- var numTouchKeys = touchKeys.length;
3159
- var SvgTouchableMixin_default = (target) => {
3160
- for (let i = 0;i < numTouchKeys; i++) {
3161
- const key = touchKeys[i];
3162
- const val = touchVals[i];
3163
- if (typeof val === "function") {
3164
- target[key] = val.bind(target);
3165
- } else {
3166
- target[key] = val;
3167
- }
3168
- }
3169
- target.state = touchableGetInitialState();
3170
- };
3171
-
3172
- // node_modules/react-native-svg/lib/module/web/WebShape.js
3173
- class WebShape extends React.Component {
3174
- prepareProps(props) {
3175
- return props;
3176
- }
3177
- elementRef = /* @__PURE__ */ React.createRef();
3178
- lastMergedProps = {};
3179
- setNativeProps(props) {
3180
- const merged = Object.assign({}, this.props, this.lastMergedProps, props.style);
3181
- this.lastMergedProps = merged;
3182
- const clean = prepare(this, this.prepareProps(merged));
3183
- const current = this.elementRef.current;
3184
- if (current) {
3185
- for (const cleanAttribute of Object.keys(clean)) {
3186
- const cleanValue = clean[cleanAttribute];
3187
- switch (cleanAttribute) {
3188
- case "ref":
3189
- case "children":
3190
- break;
3191
- case "style":
3192
- for (const partialStyle of [].concat(clean.style ?? [])) {
3193
- Object.assign(current.style, partialStyle);
3194
- }
3195
- break;
3196
- case "fill":
3197
- if (cleanValue && typeof cleanValue === "object") {
3198
- const value = cleanValue;
3199
- current.setAttribute("fill", convertInt32ColorToRGBA(value.payload));
3200
- }
3201
- break;
3202
- case "stroke":
3203
- if (cleanValue && typeof cleanValue === "object") {
3204
- const value = cleanValue;
3205
- current.setAttribute("stroke", convertInt32ColorToRGBA(value.payload));
3206
- }
3207
- break;
3208
- default:
3209
- current.setAttribute(getAttributeName(cleanAttribute), cleanValue);
3210
- break;
3211
- }
3212
- }
3213
- }
3214
- }
3215
- constructor(props) {
3216
- super(props);
3217
- if (hasTouchableProperty(props)) {
3218
- SvgTouchableMixin_default(this);
3219
- }
3220
- this._remeasureMetricsOnActivation = remeasure.bind(this);
3221
- }
3222
- render() {
3223
- if (!this.tag) {
3224
- throw new Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");
3225
- }
3226
- this.lastMergedProps = {};
3227
- return import_react_native5.unstable_createElement(this.tag, prepare(this, this.prepareProps(this.props)));
3228
- }
3229
- }
3230
-
3231
- // node_modules/react-native-svg/lib/module/elements.web.js
3232
- class Circle extends WebShape {
3233
- tag = "circle";
3234
- }
3235
-
3236
- class ClipPath extends WebShape {
3237
- tag = "clipPath";
3238
- }
3239
-
3240
- class Defs extends WebShape {
3241
- tag = "defs";
3242
- }
3243
-
3244
- class Ellipse extends WebShape {
3245
- tag = "ellipse";
3246
- }
3247
-
3248
- class FeBlend extends WebShape {
3249
- tag = "feBlend";
3250
- }
3251
-
3252
- class FeColorMatrix extends WebShape {
3253
- tag = "feColorMatrix";
3254
- }
3255
-
3256
- class FeComponentTransfer extends WebShape {
3257
- tag = "feComponentTransfer";
3258
- }
3259
-
3260
- class FeComposite extends WebShape {
3261
- tag = "feComposite";
3262
- }
3263
-
3264
- class FeConvolveMatrix extends WebShape {
3265
- tag = "feConvolveMatrix";
3266
- }
3267
-
3268
- class FeDiffuseLighting extends WebShape {
3269
- tag = "feDiffuseLighting";
3270
- }
3271
-
3272
- class FeDisplacementMap extends WebShape {
3273
- tag = "feDisplacementMap";
3274
- }
3275
-
3276
- class FeDistantLight extends WebShape {
3277
- tag = "feDistantLight";
3278
- }
3279
-
3280
- class FeDropShadow extends WebShape {
3281
- tag = "feDropShadow";
3282
- }
3283
-
3284
- class FeFlood extends WebShape {
3285
- tag = "feFlood";
3286
- }
3287
- class FeGaussianBlur extends WebShape {
3288
- tag = "feGaussianBlur";
3289
- }
3290
-
3291
- class FeImage extends WebShape {
3292
- tag = "feImage";
3293
- }
3294
-
3295
- class FeMerge extends WebShape {
3296
- tag = "feMerge";
3297
- }
3298
-
3299
- class FeMergeNode extends WebShape {
3300
- tag = "feMergeNode";
3301
- }
3302
-
3303
- class FeMorphology extends WebShape {
3304
- tag = "feMorphology";
3305
- }
3306
-
3307
- class FeOffset extends WebShape {
3308
- tag = "feOffset";
3309
- }
3310
-
3311
- class FePointLight extends WebShape {
3312
- tag = "fePointLight";
3313
- }
3314
-
3315
- class FeSpecularLighting extends WebShape {
3316
- tag = "feSpecularLighting";
3317
- }
3318
-
3319
- class FeSpotLight extends WebShape {
3320
- tag = "feSpotLight";
3321
- }
3322
-
3323
- class FeTile extends WebShape {
3324
- tag = "feTile";
3325
- }
3326
-
3327
- class FeTurbulence extends WebShape {
3328
- tag = "feTurbulence";
3329
- }
3330
-
3331
- class Filter extends WebShape {
3332
- tag = "filter";
3333
- }
3334
-
3335
- class ForeignObject extends WebShape {
3336
- tag = "foreignObject";
3337
- }
3338
-
3339
- class G extends WebShape {
3340
- tag = "g";
3341
- prepareProps(props) {
3342
- const {
3343
- x,
3344
- y,
3345
- ...rest
3346
- } = props;
3347
- if ((x || y) && !rest.translate) {
3348
- rest.translate = `${x || 0}, ${y || 0}`;
3349
- }
3350
- return rest;
3351
- }
3352
- }
3353
-
3354
- class Image extends WebShape {
3355
- tag = "image";
3356
- }
3357
-
3358
- class Line extends WebShape {
3359
- tag = "line";
3360
- }
3361
-
3362
- class LinearGradient extends WebShape {
3363
- tag = "linearGradient";
3364
- }
3365
-
3366
- class Marker extends WebShape {
3367
- tag = "marker";
3368
- }
3369
-
3370
- class Mask extends WebShape {
3371
- tag = "mask";
3372
- }
3373
-
3374
- class Path extends WebShape {
3375
- tag = "path";
3376
- }
3377
-
3378
- class Pattern extends WebShape {
3379
- tag = "pattern";
3380
- }
3381
-
3382
- class Polygon extends WebShape {
3383
- tag = "polygon";
3384
- }
3385
-
3386
- class Polyline extends WebShape {
3387
- tag = "polyline";
3388
- }
3389
-
3390
- class RadialGradient extends WebShape {
3391
- tag = "radialGradient";
3392
- }
3393
-
3394
- class Rect extends WebShape {
3395
- tag = "rect";
3396
- }
3397
-
3398
- class Stop extends WebShape {
3399
- tag = "stop";
3400
- }
3401
-
3402
- class Svg extends WebShape {
3403
- tag = "svg";
3404
- toDataURL(callback, options = {}) {
3405
- const ref = this.elementRef.current;
3406
- if (ref === null) {
3407
- return;
3408
- }
3409
- const rect = getBoundingClientRect(ref);
3410
- const width = Number(options.width) || rect.width;
3411
- const height = Number(options.height) || rect.height;
3412
- const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3413
- svg.setAttribute("viewBox", `0 0 ${rect.width} ${rect.height}`);
3414
- svg.setAttribute("width", String(width));
3415
- svg.setAttribute("height", String(height));
3416
- svg.appendChild(ref.cloneNode(true));
3417
- const img = new window.Image;
3418
- img.onload = () => {
3419
- const canvas = document.createElement("canvas");
3420
- canvas.width = width;
3421
- canvas.height = height;
3422
- const context = canvas.getContext("2d");
3423
- context === null || context === undefined || context.drawImage(img, 0, 0);
3424
- callback(canvas.toDataURL().replace("data:image/png;base64,", ""));
3425
- };
3426
- img.src = `data:image/svg+xml;utf8,${encodeSvg(new window.XMLSerializer().serializeToString(svg))}`;
3427
- }
3428
- }
3429
-
3430
- class Symbol2 extends WebShape {
3431
- tag = "symbol";
3432
- }
3433
-
3434
- class TSpan extends WebShape {
3435
- tag = "tspan";
3436
- }
3437
-
3438
- class Text extends WebShape {
3439
- tag = "text";
3440
- }
3441
-
3442
- class TextPath extends WebShape {
3443
- tag = "textPath";
3444
- }
3445
-
3446
- class Use extends WebShape {
3447
- tag = "use";
3448
- }
3449
-
3450
- // node_modules/react-native-svg/lib/module/xml.js
3451
- import * as React2 from "react";
3452
- import { Component, useEffect, useMemo, useState } from "react";
3453
-
3454
- // node_modules/react-native-svg/lib/module/utils/fetchData.js
3455
- var import_react_native6 = __toESM(require_cjs());
3456
- async function fetchText(uri) {
3457
- if (!uri) {
3458
- return null;
3459
- }
3460
- if (uri.startsWith("data:image/svg+xml;utf8") && import_react_native6.Platform.OS === "android") {
3461
- return dataUriToXml(uri);
3462
- } else if (uri.startsWith("data:image/svg+xml;base64")) {
3463
- return decodeBase64Image(uri);
3464
- } else {
3465
- return fetchUriData(uri);
3466
- }
3467
- }
3468
- var decodeBase64Image = (uri) => {
3469
- const decoded = decodeURIComponent(uri);
3470
- const splitContent = decoded.split(";")[1].split(",");
3471
- const content = splitContent.slice(1).join(",");
3472
- return atob(content);
3473
- };
3474
- function dataUriToXml(uri) {
3475
- try {
3476
- return decodeURIComponent(uri).split(",").slice(1).join(",");
3477
- } catch (error) {
3478
- throw new Error(`Decoding ${uri} failed with error: ${error}`);
3479
- }
3480
- }
3481
- async function fetchUriData(uri) {
3482
- const response = await fetch(uri);
3483
- if (response.ok || response.status === 0 && uri.startsWith("file://")) {
3484
- return await response.text();
3485
- }
3486
- throw new Error(`Fetching ${uri} failed with status ${response.status}`);
3487
- }
3488
-
3489
- // node_modules/react-native-svg/lib/module/xmlTags.js
3490
- var tags = {
3491
- circle: Circle,
3492
- clipPath: ClipPath,
3493
- defs: Defs,
3494
- ellipse: Ellipse,
3495
- filter: Filter,
3496
- feBlend: FeBlend,
3497
- feColorMatrix: FeColorMatrix,
3498
- feComponentTransfer: FeComponentTransfer,
3499
- feComposite: FeComposite,
3500
- feConvolveMatrix: FeConvolveMatrix,
3501
- feDiffuseLighting: FeDiffuseLighting,
3502
- feDisplacementMap: FeDisplacementMap,
3503
- feDistantLight: FeDistantLight,
3504
- feDropShadow: FeDropShadow,
3505
- feFlood: FeFlood,
3506
- feGaussianBlur: FeGaussianBlur,
3507
- feImage: FeImage,
3508
- feMerge: FeMerge,
3509
- feMergeNode: FeMergeNode,
3510
- feMorphology: FeMorphology,
3511
- feOffset: FeOffset,
3512
- fePointLight: FePointLight,
3513
- feSpecularLighting: FeSpecularLighting,
3514
- feSpotLight: FeSpotLight,
3515
- feTile: FeTile,
3516
- feTurbulence: FeTurbulence,
3517
- foreignObject: ForeignObject,
3518
- g: G,
3519
- image: Image,
3520
- line: Line,
3521
- linearGradient: LinearGradient,
3522
- marker: Marker,
3523
- mask: Mask,
3524
- path: Path,
3525
- pattern: Pattern,
3526
- polygon: Polygon,
3527
- polyline: Polyline,
3528
- radialGradient: RadialGradient,
3529
- rect: Rect,
3530
- stop: Stop,
3531
- svg: Svg,
3532
- symbol: Symbol2,
3533
- text: Text,
3534
- textPath: TextPath,
3535
- tspan: TSpan,
3536
- use: Use
3537
- };
3538
-
3539
- // node_modules/react-native-svg/lib/module/xml.js
3540
- function _extends() {
3541
- return _extends = Object.assign ? Object.assign.bind() : function(n) {
3542
- for (var e = 1;e < arguments.length; e++) {
3543
- var t = arguments[e];
3544
- for (var r in t)
3545
- ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
3546
- }
3547
- return n;
3548
- }, _extends.apply(null, arguments);
3549
- }
3550
- function missingTag() {
3551
- return null;
3552
- }
3553
- function SvgAst({
3554
- ast,
3555
- override
3556
- }) {
3557
- if (!ast) {
3558
- return null;
3559
- }
3560
- const {
3561
- props,
3562
- children
3563
- } = ast;
3564
- const Svg = tags.svg;
3565
- return /* @__PURE__ */ React2.createElement(Svg, _extends({}, props, override), children);
3566
- }
3567
- var err = console.error.bind(console);
3568
- function SvgXml(props) {
3569
- const {
3570
- onError = err,
3571
- xml,
3572
- override,
3573
- fallback
3574
- } = props;
3575
- try {
3576
- const ast = useMemo(() => xml !== null ? parse2(xml) : null, [xml]);
3577
- return /* @__PURE__ */ React2.createElement(SvgAst, {
3578
- ast,
3579
- override: override || props
3580
- });
3581
- } catch (error) {
3582
- onError(error);
3583
- return fallback ?? null;
3584
- }
3585
- }
3586
- function SvgUri(props) {
3587
- const {
3588
- onError = err,
3589
- uri,
3590
- onLoad,
3591
- fallback
3592
- } = props;
3593
- const [xml, setXml] = useState(null);
3594
- const [isError, setIsError] = useState(false);
3595
- useEffect(() => {
3596
- uri ? fetchText(uri).then((data) => {
3597
- setXml(data);
3598
- isError && setIsError(false);
3599
- onLoad === null || onLoad === undefined || onLoad();
3600
- }).catch((e) => {
3601
- onError(e);
3602
- setIsError(true);
3603
- }) : setXml(null);
3604
- }, [onError, uri, onLoad]);
3605
- if (isError) {
3606
- return fallback ?? null;
3607
- }
3608
- return /* @__PURE__ */ React2.createElement(SvgXml, {
3609
- xml,
3610
- override: props,
3611
- fallback
3612
- });
3613
- }
3614
- var upperCase = (_match, letter) => letter.toUpperCase();
3615
- var camelCase = (phrase) => phrase.replace(/[:-]([a-z])/g, upperCase);
3616
- function getStyle(string) {
3617
- const style = {};
3618
- const declarations = string.split(";").filter((v) => v.trim());
3619
- const {
3620
- length
3621
- } = declarations;
3622
- for (let i = 0;i < length; i++) {
3623
- const declaration = declarations[i];
3624
- if (declaration.length !== 0) {
3625
- const split = declaration.split(":");
3626
- const property = split[0];
3627
- const value = split[1];
3628
- style[camelCase(property.trim())] = value.trim();
3629
- }
3630
- }
3631
- return style;
3632
- }
3633
- function astToReact(value, index) {
3634
- if (typeof value === "object") {
3635
- const {
3636
- Tag,
3637
- props,
3638
- children
3639
- } = value;
3640
- if (props !== null && props !== undefined && props.class) {
3641
- props.className = props.class;
3642
- delete props.class;
3643
- }
3644
- return /* @__PURE__ */ React2.createElement(Tag, _extends({
3645
- key: index
3646
- }, props), children.map(astToReact));
3647
- }
3648
- return value;
3649
- }
3650
- function repeat(str, i) {
3651
- let result = "";
3652
- while (i--) {
3653
- result += str;
3654
- }
3655
- return result;
3656
- }
3657
- var toSpaces = (tabs) => repeat(" ", tabs.length);
3658
- function locate(source, i) {
3659
- const lines = source.split(`
3660
- `);
3661
- const nLines = lines.length;
3662
- let column = i;
3663
- let line = 0;
3664
- for (;line < nLines; line++) {
3665
- const {
3666
- length
3667
- } = lines[line];
3668
- if (column >= length) {
3669
- column -= length;
3670
- } else {
3671
- break;
3672
- }
3673
- }
3674
- const before = source.slice(0, i).replace(/^\t+/, toSpaces);
3675
- const beforeExec = /(^|\n).*$/.exec(before);
3676
- const beforeLine = beforeExec && beforeExec[0] || "";
3677
- const after = source.slice(i);
3678
- const afterExec = /.*(\n|$)/.exec(after);
3679
- const afterLine = afterExec && afterExec[0];
3680
- const pad = repeat(" ", beforeLine.length);
3681
- const snippet = `${beforeLine}${afterLine}
3682
- ${pad}^`;
3683
- return {
3684
- line,
3685
- column,
3686
- snippet
3687
- };
3688
- }
3689
- var validNameCharacters = /[a-zA-Z0-9:_-]/;
3690
- var commentStart = /<!--/;
3691
- var whitespace = /[\s\t\r\n]/;
3692
- var quotemarks = /['"]/;
3693
- function parse2(source, middleware) {
3694
- const length = source.length;
3695
- let currentElement = null;
3696
- let state = metadata;
3697
- let children = null;
3698
- let root;
3699
- const stack = [];
3700
- function error(message) {
3701
- const {
3702
- line,
3703
- column,
3704
- snippet
3705
- } = locate(source, i);
3706
- throw new Error(`${message} (${line}:${column}). If this is valid SVG, it's probably a bug. Please raise an issue
3707
-
3708
- ${snippet}`);
3709
- }
3710
- function metadata() {
3711
- while (i + 1 < length && (source[i] !== "<" || !(validNameCharacters.test(source[i + 1]) || commentStart.test(source.slice(i, i + 4))))) {
3712
- i++;
3713
- }
3714
- return neutral();
3715
- }
3716
- function neutral() {
3717
- let text = "";
3718
- let char;
3719
- while (i < length && (char = source[i]) !== "<") {
3720
- text += char;
3721
- i += 1;
3722
- }
3723
- if (/\S/.test(text)) {
3724
- children.push(text);
3725
- }
3726
- if (source[i] === "<") {
3727
- return openingTag;
3728
- }
3729
- return neutral;
3730
- }
3731
- function openingTag() {
3732
- const char = source[i];
3733
- if (char === "?") {
3734
- return neutral;
3735
- }
3736
- if (char === "!") {
3737
- const start = i + 1;
3738
- if (source.slice(start, i + 3) === "--") {
3739
- return comment;
3740
- }
3741
- const end = i + 8;
3742
- if (source.slice(start, end) === "[CDATA[") {
3743
- return cdata;
3744
- }
3745
- if (/doctype/i.test(source.slice(start, end))) {
3746
- return doctype;
3747
- }
3748
- }
3749
- if (char === "/") {
3750
- return closingTag;
3751
- }
3752
- const tag = getName();
3753
- const props = {};
3754
- const element = {
3755
- tag,
3756
- props,
3757
- children: [],
3758
- parent: currentElement,
3759
- Tag: tags[tag] || missingTag
3760
- };
3761
- if (currentElement) {
3762
- children.push(element);
3763
- } else {
3764
- root = element;
3765
- }
3766
- getAttributes(props);
3767
- const {
3768
- style
3769
- } = props;
3770
- if (typeof style === "string") {
3771
- element.styles = style;
3772
- props.style = getStyle(style);
3773
- }
3774
- let selfClosing = false;
3775
- if (source[i] === "/") {
3776
- i += 1;
3777
- selfClosing = true;
3778
- }
3779
- if (source[i] !== ">") {
3780
- error("Expected >");
3781
- }
3782
- if (!selfClosing) {
3783
- currentElement = element;
3784
- ({
3785
- children
3786
- } = element);
3787
- stack.push(element);
3788
- }
3789
- return neutral;
3790
- }
3791
- function comment() {
3792
- const index = source.indexOf("-->", i);
3793
- if (!~index) {
3794
- error("expected -->");
3795
- }
3796
- i = index + 2;
3797
- return neutral;
3798
- }
3799
- function cdata() {
3800
- const index = source.indexOf("]]>", i);
3801
- if (!~index) {
3802
- error("expected ]]>");
3803
- }
3804
- children.push(source.slice(i + 7, index));
3805
- i = index + 2;
3806
- return neutral;
3807
- }
3808
- function doctype() {
3809
- const index = source.indexOf(">", i);
3810
- if (index === -1) {
3811
- error("expected >");
3812
- }
3813
- i = index;
3814
- return neutral;
3815
- }
3816
- function closingTag() {
3817
- const tag = getName();
3818
- if (!tag) {
3819
- error("Expected tag name");
3820
- }
3821
- if (currentElement && tag !== currentElement.tag) {
3822
- error(`Expected closing tag </${tag}> to match opening tag <${currentElement.tag}>`);
3823
- }
3824
- allowSpaces();
3825
- if (source[i] !== ">") {
3826
- error("Expected >");
3827
- }
3828
- stack.pop();
3829
- currentElement = stack[stack.length - 1];
3830
- if (currentElement) {
3831
- ({
3832
- children
3833
- } = currentElement);
3834
- }
3835
- return neutral;
3836
- }
3837
- function getName() {
3838
- let name = "";
3839
- let char;
3840
- while (i < length && validNameCharacters.test(char = source[i])) {
3841
- name += char;
3842
- i += 1;
3843
- }
3844
- return name;
3845
- }
3846
- function getAttributes(props) {
3847
- while (i < length) {
3848
- if (!whitespace.test(source[i])) {
3849
- return;
3850
- }
3851
- allowSpaces();
3852
- const name = getName();
3853
- if (!name) {
3854
- return;
3855
- }
3856
- let value = true;
3857
- allowSpaces();
3858
- if (source[i] === "=") {
3859
- i += 1;
3860
- allowSpaces();
3861
- value = getAttributeValue();
3862
- if (name !== "id" && !isNaN(+value) && value.trim() !== "") {
3863
- value = +value;
3864
- }
3865
- }
3866
- props[camelCase(name)] = value;
3867
- }
3868
- }
3869
- function getAttributeValue() {
3870
- return quotemarks.test(source[i]) ? getQuotedAttributeValue() : getUnquotedAttributeValue();
3871
- }
3872
- function getUnquotedAttributeValue() {
3873
- let value = "";
3874
- do {
3875
- const char = source[i];
3876
- if (char === " " || char === ">" || char === "/") {
3877
- return value;
3878
- }
3879
- value += char;
3880
- i += 1;
3881
- } while (i < length);
3882
- return value;
3883
- }
3884
- function getQuotedAttributeValue() {
3885
- const quotemark = source[i++];
3886
- let value = "";
3887
- let escaped = false;
3888
- while (i < length) {
3889
- const char = source[i++];
3890
- if (char === quotemark && !escaped) {
3891
- return value;
3892
- }
3893
- if (char === "\\" && !escaped) {
3894
- escaped = true;
3895
- }
3896
- value += escaped ? `\\${char}` : char;
3897
- escaped = false;
3898
- }
3899
- return value;
3900
- }
3901
- function allowSpaces() {
3902
- while (i < length && whitespace.test(source[i])) {
3903
- i += 1;
3904
- }
3905
- }
3906
- let i = 0;
3907
- while (i < length) {
3908
- if (!state) {
3909
- error("Unexpected character");
3910
- }
3911
- state = state();
3912
- i += 1;
3913
- }
3914
- if (state !== neutral) {
3915
- error("Unexpected end of input");
3916
- }
3917
- if (root) {
3918
- const xml = (middleware ? middleware(root) : root) || root;
3919
- const ast = xml.children.map(astToReact);
3920
- const jsx = xml;
3921
- jsx.children = ast;
3922
- return jsx;
3923
- }
3924
- return null;
3925
- }
3926
- // node_modules/react-native-svg/lib/module/index.js
3927
-
3928
- export { Button3, require_registry, Circle, Line, Path, Polygon, Svg, SvgUri };