@osano/osano-cmp-react-native 0.1.0 → 0.2.0

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 (821) hide show
  1. package/README.md +251 -0
  2. package/lib/commonjs/ConsentManager.js +209 -69
  3. package/lib/commonjs/ConsentManager.js.map +1 -1
  4. package/lib/commonjs/ConsentUiBuilder.js +2 -2
  5. package/lib/commonjs/ConsentUiBuilder.js.map +1 -1
  6. package/lib/commonjs/actions.js +84 -0
  7. package/lib/commonjs/actions.js.map +1 -0
  8. package/lib/commonjs/commands.js +63 -0
  9. package/lib/commonjs/commands.js.map +1 -0
  10. package/lib/commonjs/components/Button.js +35 -25
  11. package/lib/commonjs/components/Button.js.map +1 -1
  12. package/lib/commonjs/components/Locale.js +5 -3
  13. package/lib/commonjs/components/Locale.js.map +1 -1
  14. package/lib/commonjs/context.js +4 -3
  15. package/lib/commonjs/context.js.map +1 -1
  16. package/lib/commonjs/flavors/index.js +1 -1
  17. package/lib/commonjs/hooks/usePrevious.js +1 -1
  18. package/lib/commonjs/hooks/usePrevious.js.map +1 -1
  19. package/lib/commonjs/hooks/useThunkReducer.js +40 -15
  20. package/lib/commonjs/hooks/useThunkReducer.js.map +1 -1
  21. package/lib/commonjs/iab/actions.js +17 -0
  22. package/lib/commonjs/iab/actions.js.map +1 -0
  23. package/lib/commonjs/iab/constants.js +3 -1
  24. package/lib/commonjs/iab/constants.js.map +1 -1
  25. package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js +1 -1
  26. package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -1
  27. package/lib/commonjs/iab/index.js +33 -0
  28. package/lib/commonjs/iab/index.js.map +1 -0
  29. package/lib/commonjs/iab/reducer.js +46 -0
  30. package/lib/commonjs/iab/reducer.js.map +1 -0
  31. package/lib/commonjs/iab/tcf/actions.js +74 -14
  32. package/lib/commonjs/iab/tcf/actions.js.map +1 -1
  33. package/lib/commonjs/iab/tcf/consent.js +51 -87
  34. package/lib/commonjs/iab/tcf/consent.js.map +1 -1
  35. package/lib/commonjs/iab/tcf/constants.js +5 -5
  36. package/lib/commonjs/iab/tcf/constants.js.map +1 -1
  37. package/lib/commonjs/iab/tcf/helpers.js +72 -0
  38. package/lib/commonjs/iab/tcf/helpers.js.map +1 -0
  39. package/lib/commonjs/iab/tcf/index.js +5 -3
  40. package/lib/commonjs/iab/tcf/index.js.map +1 -1
  41. package/lib/commonjs/iab/tcf/middleware.js +172 -0
  42. package/lib/commonjs/iab/tcf/middleware.js.map +1 -0
  43. package/lib/commonjs/iab/tcf/reducer.js +225 -40
  44. package/lib/commonjs/iab/tcf/reducer.js.map +1 -1
  45. package/lib/commonjs/iab/tcf/selectors.js +60 -69
  46. package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
  47. package/lib/commonjs/iab/tcf/v2.0/encoders.js +0 -8
  48. package/lib/commonjs/iab/tcf/v2.0/encoders.js.map +1 -1
  49. package/lib/commonjs/iab/tcf/v2.0/formatters.js +5 -7
  50. package/lib/commonjs/iab/tcf/v2.0/formatters.js.map +1 -1
  51. package/lib/commonjs/iab/tcf/v2.0/index.js +18 -16
  52. package/lib/commonjs/iab/tcf/v2.0/index.js.map +1 -1
  53. package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +19 -3
  54. package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -1
  55. package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js +2 -14
  56. package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
  57. package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js +2 -13
  58. package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
  59. package/lib/commonjs/index.js +77 -30
  60. package/lib/commonjs/index.js.map +1 -1
  61. package/lib/commonjs/reducer.js +366 -0
  62. package/lib/commonjs/reducer.js.map +1 -0
  63. package/lib/commonjs/selectors.js +83 -0
  64. package/lib/commonjs/selectors.js.map +1 -0
  65. package/lib/commonjs/services/consent.js +20 -4
  66. package/lib/commonjs/services/consent.js.map +1 -1
  67. package/lib/commonjs/styles.js +1 -1
  68. package/lib/commonjs/styles.js.map +1 -1
  69. package/lib/commonjs/utils/Translator.js +4 -2
  70. package/lib/commonjs/utils/Translator.js.map +1 -1
  71. package/lib/commonjs/utils/index.js +3 -16
  72. package/lib/commonjs/utils/index.js.map +1 -1
  73. package/lib/commonjs/utils/types.js +2 -0
  74. package/lib/commonjs/utils/types.js.map +1 -0
  75. package/lib/commonjs/views/Dialog/Buttons.js +2 -2
  76. package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
  77. package/lib/commonjs/views/Dialog/Message.js +1 -1
  78. package/lib/commonjs/views/Dialog/Message.js.map +1 -1
  79. package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +5 -5
  80. package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
  81. package/lib/commonjs/views/Dialog/index.js +15 -9
  82. package/lib/commonjs/views/Dialog/index.js.map +1 -1
  83. package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +50 -22
  84. package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
  85. package/lib/commonjs/views/Drawer/Drawer.Header.js +1 -0
  86. package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
  87. package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +26 -14
  88. package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
  89. package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +60 -36
  90. package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
  91. package/lib/commonjs/views/Drawer/index.js +11 -10
  92. package/lib/commonjs/views/Drawer/index.js.map +1 -1
  93. package/lib/module/ConsentManager.js +209 -71
  94. package/lib/module/ConsentManager.js.map +1 -1
  95. package/lib/module/ConsentUiBuilder.js +1 -1
  96. package/lib/module/ConsentUiBuilder.js.map +1 -1
  97. package/lib/module/actions.js +66 -0
  98. package/lib/module/actions.js.map +1 -0
  99. package/lib/module/commands.js +55 -0
  100. package/lib/module/commands.js.map +1 -0
  101. package/lib/module/components/Button.js +30 -20
  102. package/lib/module/components/Button.js.map +1 -1
  103. package/lib/module/components/Locale.js +5 -3
  104. package/lib/module/components/Locale.js.map +1 -1
  105. package/lib/module/context.js +3 -2
  106. package/lib/module/context.js.map +1 -1
  107. package/lib/module/flavors/index.js +1 -1
  108. package/lib/module/hooks/usePrevious.js +1 -1
  109. package/lib/module/hooks/usePrevious.js.map +1 -1
  110. package/lib/module/hooks/useThunkReducer.js +40 -16
  111. package/lib/module/hooks/useThunkReducer.js.map +1 -1
  112. package/lib/module/iab/actions.js +10 -0
  113. package/lib/module/iab/actions.js.map +1 -0
  114. package/lib/module/iab/constants.js +2 -0
  115. package/lib/module/iab/constants.js.map +1 -1
  116. package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js +1 -1
  117. package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -1
  118. package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -1
  119. package/lib/module/iab/index.js +26 -0
  120. package/lib/module/iab/index.js.map +1 -0
  121. package/lib/module/iab/reducer.js +39 -0
  122. package/lib/module/iab/reducer.js.map +1 -0
  123. package/lib/module/iab/tcf/actions.js +63 -13
  124. package/lib/module/iab/tcf/actions.js.map +1 -1
  125. package/lib/module/iab/tcf/consent.js +47 -84
  126. package/lib/module/iab/tcf/consent.js.map +1 -1
  127. package/lib/module/iab/tcf/constants.js +5 -5
  128. package/lib/module/iab/tcf/constants.js.map +1 -1
  129. package/lib/module/iab/tcf/helpers.js +62 -0
  130. package/lib/module/iab/tcf/helpers.js.map +1 -0
  131. package/lib/module/iab/tcf/index.js +3 -3
  132. package/lib/module/iab/tcf/index.js.map +1 -1
  133. package/lib/module/iab/tcf/middleware.js +164 -0
  134. package/lib/module/iab/tcf/middleware.js.map +1 -0
  135. package/lib/module/iab/tcf/reducer.js +223 -40
  136. package/lib/module/iab/tcf/reducer.js.map +1 -1
  137. package/lib/module/iab/tcf/selectors.js +45 -57
  138. package/lib/module/iab/tcf/selectors.js.map +1 -1
  139. package/lib/module/iab/tcf/v2.0/encoders.js +0 -9
  140. package/lib/module/iab/tcf/v2.0/encoders.js.map +1 -1
  141. package/lib/module/iab/tcf/v2.0/formatters.js +5 -7
  142. package/lib/module/iab/tcf/v2.0/formatters.js.map +1 -1
  143. package/lib/module/iab/tcf/v2.0/index.js +18 -16
  144. package/lib/module/iab/tcf/v2.0/index.js.map +1 -1
  145. package/lib/module/iab/tcf/v2.0/shared-constants.js +17 -3
  146. package/lib/module/iab/tcf/v2.0/shared-constants.js.map +1 -1
  147. package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js +2 -14
  148. package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
  149. package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js +2 -13
  150. package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
  151. package/lib/module/index.js +77 -29
  152. package/lib/module/index.js.map +1 -1
  153. package/lib/module/{store.js → reducer.js} +76 -238
  154. package/lib/module/reducer.js.map +1 -0
  155. package/lib/module/selectors.js +60 -0
  156. package/lib/module/selectors.js.map +1 -0
  157. package/lib/module/services/consent.js +20 -4
  158. package/lib/module/services/consent.js.map +1 -1
  159. package/lib/module/styles.js +1 -1
  160. package/lib/module/styles.js.map +1 -1
  161. package/lib/module/utils/Translator.js +4 -2
  162. package/lib/module/utils/Translator.js.map +1 -1
  163. package/lib/module/utils/index.js +3 -16
  164. package/lib/module/utils/index.js.map +1 -1
  165. package/lib/module/utils/types.js +2 -0
  166. package/lib/module/utils/types.js.map +1 -0
  167. package/lib/module/views/Dialog/Buttons.js +1 -1
  168. package/lib/module/views/Dialog/Buttons.js.map +1 -1
  169. package/lib/module/views/Dialog/Message.js +1 -1
  170. package/lib/module/views/Dialog/Message.js.map +1 -1
  171. package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js +4 -4
  172. package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
  173. package/lib/module/views/Dialog/index.js +11 -5
  174. package/lib/module/views/Dialog/index.js.map +1 -1
  175. package/lib/module/views/Drawer/Drawer.ConsentCategories.js +41 -12
  176. package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
  177. package/lib/module/views/Drawer/Drawer.Header.js +1 -0
  178. package/lib/module/views/Drawer/Drawer.Header.js.map +1 -1
  179. package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +24 -12
  180. package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
  181. package/lib/module/views/Drawer/Drawer.Iab.Vendors.js +55 -31
  182. package/lib/module/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
  183. package/lib/module/views/Drawer/index.js +3 -1
  184. package/lib/module/views/Drawer/index.js.map +1 -1
  185. package/lib/typescript/babel.config.d.ts +2 -0
  186. package/lib/typescript/babel.config.d.ts.map +1 -0
  187. package/lib/typescript/documentation/babel.config.d.ts +2 -0
  188. package/lib/typescript/documentation/babel.config.d.ts.map +1 -0
  189. package/lib/typescript/documentation/docusaurus.config.d.ts +4 -0
  190. package/lib/typescript/documentation/docusaurus.config.d.ts.map +1 -0
  191. package/lib/typescript/lib/commonjs/ConsentManager.d.ts +190 -0
  192. package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -0
  193. package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts +3 -0
  194. package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts.map +1 -0
  195. package/lib/typescript/lib/commonjs/actions.d.ts +66 -0
  196. package/lib/typescript/lib/commonjs/actions.d.ts.map +1 -0
  197. package/lib/typescript/lib/commonjs/commands.d.ts +4 -0
  198. package/lib/typescript/lib/commonjs/commands.d.ts.map +1 -0
  199. package/lib/typescript/lib/commonjs/components/Button.d.ts +11 -0
  200. package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -0
  201. package/lib/typescript/lib/commonjs/components/Checkbox.d.ts +4 -0
  202. package/lib/typescript/lib/commonjs/components/Checkbox.d.ts.map +1 -0
  203. package/lib/typescript/lib/commonjs/components/Divider.d.ts +3 -0
  204. package/lib/typescript/lib/commonjs/components/Divider.d.ts.map +1 -0
  205. package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts +8 -0
  206. package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts.map +1 -0
  207. package/lib/typescript/lib/commonjs/components/Link.d.ts +3 -0
  208. package/lib/typescript/lib/commonjs/components/Link.d.ts.map +1 -0
  209. package/lib/typescript/lib/commonjs/components/List.d.ts +3 -0
  210. package/lib/typescript/lib/commonjs/components/List.d.ts.map +1 -0
  211. package/lib/typescript/lib/commonjs/components/Locale.d.ts +6 -0
  212. package/lib/typescript/lib/commonjs/components/Locale.d.ts.map +1 -0
  213. package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts +4 -0
  214. package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts.map +1 -0
  215. package/lib/typescript/lib/commonjs/components/Toggle.d.ts +4 -0
  216. package/lib/typescript/lib/commonjs/components/Toggle.d.ts.map +1 -0
  217. package/lib/typescript/lib/commonjs/constants.d.ts +20 -0
  218. package/lib/typescript/lib/commonjs/constants.d.ts.map +1 -0
  219. package/lib/typescript/lib/commonjs/context.d.ts +4 -0
  220. package/lib/typescript/lib/commonjs/context.d.ts.map +1 -0
  221. package/lib/typescript/lib/commonjs/flavors/index.d.ts +122 -0
  222. package/lib/typescript/lib/commonjs/flavors/index.d.ts.map +1 -0
  223. package/lib/typescript/lib/commonjs/hooks/useBoundCallback.d.ts +18 -0
  224. package/lib/typescript/lib/commonjs/hooks/useBoundCallback.d.ts.map +1 -0
  225. package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts +4 -0
  226. package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts.map +1 -0
  227. package/lib/typescript/lib/commonjs/hooks/usePrevious.d.ts +3 -0
  228. package/lib/typescript/lib/commonjs/hooks/usePrevious.d.ts.map +1 -0
  229. package/lib/typescript/lib/commonjs/hooks/useThunkReducer.d.ts +8 -0
  230. package/lib/typescript/lib/commonjs/hooks/useThunkReducer.d.ts.map +1 -0
  231. package/lib/typescript/lib/commonjs/iab/actions.d.ts +10 -0
  232. package/lib/typescript/lib/commonjs/iab/actions.d.ts.map +1 -0
  233. package/lib/typescript/lib/commonjs/iab/constants.d.ts +5 -0
  234. package/lib/typescript/lib/commonjs/iab/constants.d.ts.map +1 -0
  235. package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts +30 -0
  236. package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts.map +1 -0
  237. package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts +25 -0
  238. package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts.map +1 -0
  239. package/lib/typescript/lib/commonjs/iab/gpp/constants.d.ts +26 -0
  240. package/lib/typescript/lib/commonjs/iab/gpp/constants.d.ts.map +1 -0
  241. package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +9 -0
  242. package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
  243. package/lib/typescript/lib/commonjs/iab/gpp/encoders/BooleanEncoder.d.ts +32 -0
  244. package/lib/typescript/lib/commonjs/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
  245. package/lib/typescript/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +10 -0
  246. package/lib/typescript/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
  247. package/lib/typescript/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.d.ts +29 -0
  248. package/lib/typescript/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
  249. package/lib/typescript/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +19 -0
  250. package/lib/typescript/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
  251. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +29 -0
  252. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
  253. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +29 -0
  254. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
  255. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +29 -0
  256. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
  257. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +7 -0
  258. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
  259. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.d.ts +29 -0
  260. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
  261. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +29 -0
  262. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
  263. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +29 -0
  264. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
  265. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.d.ts +29 -0
  266. package/lib/typescript/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
  267. package/lib/typescript/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +10 -0
  268. package/lib/typescript/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
  269. package/lib/typescript/lib/commonjs/iab/gpp/encoders/errors.d.ts +17 -0
  270. package/lib/typescript/lib/commonjs/iab/gpp/encoders/errors.d.ts.map +1 -0
  271. package/lib/typescript/lib/commonjs/iab/gpp/encoders/index.d.ts +16 -0
  272. package/lib/typescript/lib/commonjs/iab/gpp/encoders/index.d.ts.map +1 -0
  273. package/lib/typescript/lib/commonjs/iab/gpp/encoders/types.d.ts +1 -0
  274. package/lib/typescript/lib/commonjs/iab/gpp/encoders/types.d.ts.map +1 -0
  275. package/lib/typescript/lib/commonjs/iab/gpp/index.d.ts +9 -0
  276. package/lib/typescript/lib/commonjs/iab/gpp/index.d.ts.map +1 -0
  277. package/lib/typescript/lib/commonjs/iab/gpp/reducer.d.ts +7 -0
  278. package/lib/typescript/lib/commonjs/iab/gpp/reducer.d.ts.map +1 -0
  279. package/lib/typescript/lib/commonjs/iab/gpp/selectors.d.ts +7 -0
  280. package/lib/typescript/lib/commonjs/iab/gpp/selectors.d.ts.map +1 -0
  281. package/lib/typescript/lib/commonjs/iab/gpp/types.d.ts +1 -0
  282. package/lib/typescript/lib/commonjs/iab/gpp/types.d.ts.map +1 -0
  283. package/lib/typescript/lib/commonjs/iab/gpp/v1/constants.d.ts +13 -0
  284. package/lib/typescript/lib/commonjs/iab/gpp/v1/constants.d.ts.map +1 -0
  285. package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts +14 -0
  286. package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts.map +1 -0
  287. package/lib/typescript/lib/commonjs/iab/index.d.ts +3 -0
  288. package/lib/typescript/lib/commonjs/iab/index.d.ts.map +1 -0
  289. package/lib/typescript/lib/commonjs/iab/reducer.d.ts +6 -0
  290. package/lib/typescript/lib/commonjs/iab/reducer.d.ts.map +1 -0
  291. package/lib/typescript/lib/commonjs/iab/tcf/actions.d.ts +64 -0
  292. package/lib/typescript/lib/commonjs/iab/tcf/actions.d.ts.map +1 -0
  293. package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts +59 -0
  294. package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -0
  295. package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts +22 -0
  296. package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts.map +1 -0
  297. package/lib/typescript/lib/commonjs/iab/tcf/helpers.d.ts +9 -0
  298. package/lib/typescript/lib/commonjs/iab/tcf/helpers.d.ts.map +1 -0
  299. package/lib/typescript/lib/commonjs/iab/tcf/index.d.ts +4 -0
  300. package/lib/typescript/lib/commonjs/iab/tcf/index.d.ts.map +1 -0
  301. package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts +4 -0
  302. package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts.map +1 -0
  303. package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts +22 -0
  304. package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -0
  305. package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +48 -0
  306. package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -0
  307. package/lib/typescript/lib/commonjs/iab/tcf/types.d.ts +2 -0
  308. package/lib/typescript/lib/commonjs/iab/tcf/types.d.ts.map +1 -0
  309. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/encoders.d.ts +14 -0
  310. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/encoders.d.ts.map +1 -0
  311. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/formatters.d.ts +5 -0
  312. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/formatters.d.ts.map +1 -0
  313. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts +191 -0
  314. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts.map +1 -0
  315. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts +32 -0
  316. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
  317. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.d.ts +43 -0
  318. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
  319. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.d.ts +48 -0
  320. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
  321. package/lib/typescript/lib/commonjs/iab/types.d.ts +2 -0
  322. package/lib/typescript/lib/commonjs/iab/types.d.ts.map +1 -0
  323. package/lib/typescript/lib/commonjs/iab/usp/api.d.ts +6 -0
  324. package/lib/typescript/lib/commonjs/iab/usp/api.d.ts.map +1 -0
  325. package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts +27 -0
  326. package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts.map +1 -0
  327. package/lib/typescript/lib/commonjs/iab/usp/constants.d.ts +109 -0
  328. package/lib/typescript/lib/commonjs/iab/usp/constants.d.ts.map +1 -0
  329. package/lib/typescript/lib/commonjs/iab/usp/index.d.ts +9 -0
  330. package/lib/typescript/lib/commonjs/iab/usp/index.d.ts.map +1 -0
  331. package/lib/typescript/lib/commonjs/iab/usp/reducer.d.ts +14 -0
  332. package/lib/typescript/lib/commonjs/iab/usp/reducer.d.ts.map +1 -0
  333. package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts +10 -0
  334. package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts.map +1 -0
  335. package/lib/typescript/lib/commonjs/iab/usp/types.d.ts +1 -0
  336. package/lib/typescript/lib/commonjs/iab/usp/types.d.ts.map +1 -0
  337. package/lib/typescript/lib/commonjs/iab/usp/v1/constants.d.ts +13 -0
  338. package/lib/typescript/lib/commonjs/iab/usp/v1/constants.d.ts.map +1 -0
  339. package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts +12 -0
  340. package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts.map +1 -0
  341. package/lib/typescript/lib/commonjs/iab/utilities.d.ts +3 -0
  342. package/lib/typescript/lib/commonjs/iab/utilities.d.ts.map +1 -0
  343. package/lib/typescript/lib/commonjs/index.d.ts +4 -0
  344. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
  345. package/lib/typescript/lib/commonjs/locale/index.d.ts +62 -0
  346. package/lib/typescript/lib/commonjs/locale/index.d.ts.map +1 -0
  347. package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts +6 -0
  348. package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -0
  349. package/lib/typescript/lib/commonjs/reducer.d.ts +29 -0
  350. package/lib/typescript/lib/commonjs/reducer.d.ts.map +1 -0
  351. package/lib/typescript/lib/commonjs/selectors.d.ts +16 -0
  352. package/lib/typescript/lib/commonjs/selectors.d.ts.map +1 -0
  353. package/lib/typescript/lib/commonjs/services/consent.d.ts +6 -0
  354. package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -0
  355. package/lib/typescript/lib/commonjs/services/disclosures.d.ts +3 -0
  356. package/lib/typescript/lib/commonjs/services/disclosures.d.ts.map +1 -0
  357. package/lib/typescript/lib/commonjs/services/locale.d.ts +4 -0
  358. package/lib/typescript/lib/commonjs/services/locale.d.ts.map +1 -0
  359. package/lib/typescript/lib/commonjs/styles.d.ts +141 -0
  360. package/lib/typescript/lib/commonjs/styles.d.ts.map +1 -0
  361. package/lib/typescript/lib/commonjs/types/consent-config.d.d.ts +2 -0
  362. package/lib/typescript/lib/commonjs/types/consent-config.d.d.ts.map +1 -0
  363. package/lib/typescript/lib/commonjs/types/env.d.d.ts +1 -0
  364. package/lib/typescript/lib/commonjs/types/env.d.d.ts.map +1 -0
  365. package/lib/typescript/lib/commonjs/types/index.d.d.ts +2 -0
  366. package/lib/typescript/lib/commonjs/types/index.d.d.ts.map +1 -0
  367. package/lib/typescript/lib/commonjs/types/store.d.d.ts +2 -0
  368. package/lib/typescript/lib/commonjs/types/store.d.d.ts.map +1 -0
  369. package/lib/typescript/lib/commonjs/utils/API.d.ts +7 -0
  370. package/lib/typescript/lib/commonjs/utils/API.d.ts.map +1 -0
  371. package/lib/typescript/lib/commonjs/utils/Color.d.ts +13 -0
  372. package/lib/typescript/lib/commonjs/utils/Color.d.ts.map +1 -0
  373. package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts +16 -0
  374. package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts.map +1 -0
  375. package/lib/typescript/lib/commonjs/utils/Translator.d.ts +54 -0
  376. package/lib/typescript/lib/commonjs/utils/Translator.d.ts.map +1 -0
  377. package/lib/typescript/lib/commonjs/utils/index.d.ts +6 -0
  378. package/lib/typescript/lib/commonjs/utils/index.d.ts.map +1 -0
  379. package/lib/typescript/lib/commonjs/utils/types.d.ts +1 -0
  380. package/lib/typescript/lib/commonjs/utils/types.d.ts.map +1 -0
  381. package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts +4 -0
  382. package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -0
  383. package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts +4 -0
  384. package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
  385. package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts +4 -0
  386. package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts.map +1 -0
  387. package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts +4 -0
  388. package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
  389. package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts +4 -0
  390. package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -0
  391. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts +4 -0
  392. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
  393. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts +4 -0
  394. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts.map +1 -0
  395. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts +4 -0
  396. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
  397. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts +4 -0
  398. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
  399. package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts +3 -0
  400. package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -0
  401. package/lib/typescript/lib/module/ConsentManager.d.ts +347 -0
  402. package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -0
  403. package/lib/typescript/lib/module/ConsentUiBuilder.d.ts +174 -0
  404. package/lib/typescript/lib/module/ConsentUiBuilder.d.ts.map +1 -0
  405. package/lib/typescript/lib/module/actions.d.ts +65 -0
  406. package/lib/typescript/lib/module/actions.d.ts.map +1 -0
  407. package/lib/typescript/lib/module/commands.d.ts +3 -0
  408. package/lib/typescript/lib/module/commands.d.ts.map +1 -0
  409. package/lib/typescript/lib/module/components/Button.d.ts +11 -0
  410. package/lib/typescript/lib/module/components/Button.d.ts.map +1 -0
  411. package/lib/typescript/lib/module/components/Checkbox.d.ts +4 -0
  412. package/lib/typescript/lib/module/components/Checkbox.d.ts.map +1 -0
  413. package/lib/typescript/lib/module/components/Divider.d.ts +4 -0
  414. package/lib/typescript/lib/module/components/Divider.d.ts.map +1 -0
  415. package/lib/typescript/lib/module/components/ExpansionPanel.d.ts +9 -0
  416. package/lib/typescript/lib/module/components/ExpansionPanel.d.ts.map +1 -0
  417. package/lib/typescript/lib/module/components/Link.d.ts +4 -0
  418. package/lib/typescript/lib/module/components/Link.d.ts.map +1 -0
  419. package/lib/typescript/lib/module/components/List.d.ts +4 -0
  420. package/lib/typescript/lib/module/components/List.d.ts.map +1 -0
  421. package/lib/typescript/lib/module/components/Locale.d.ts +5 -0
  422. package/lib/typescript/lib/module/components/Locale.d.ts.map +1 -0
  423. package/lib/typescript/lib/module/components/StoragePolicyLink.d.ts +4 -0
  424. package/lib/typescript/lib/module/components/StoragePolicyLink.d.ts.map +1 -0
  425. package/lib/typescript/lib/module/components/Toggle.d.ts +4 -0
  426. package/lib/typescript/lib/module/components/Toggle.d.ts.map +1 -0
  427. package/lib/typescript/lib/module/constants.d.ts +19 -0
  428. package/lib/typescript/lib/module/constants.d.ts.map +1 -0
  429. package/lib/typescript/lib/module/context.d.ts +185 -0
  430. package/lib/typescript/lib/module/context.d.ts.map +1 -0
  431. package/lib/typescript/lib/module/flavors/index.d.ts +17 -0
  432. package/lib/typescript/lib/module/flavors/index.d.ts.map +1 -0
  433. package/lib/typescript/lib/module/hooks/useBoundCallback.d.ts +17 -0
  434. package/lib/typescript/lib/module/hooks/useBoundCallback.d.ts.map +1 -0
  435. package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts +3 -0
  436. package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts.map +1 -0
  437. package/lib/typescript/lib/module/hooks/usePrevious.d.ts +2 -0
  438. package/lib/typescript/lib/module/hooks/usePrevious.d.ts.map +1 -0
  439. package/lib/typescript/lib/module/hooks/useThunkReducer.d.ts +7 -0
  440. package/lib/typescript/lib/module/hooks/useThunkReducer.d.ts.map +1 -0
  441. package/lib/typescript/lib/module/iab/actions.d.ts +9 -0
  442. package/lib/typescript/lib/module/iab/actions.d.ts.map +1 -0
  443. package/lib/typescript/lib/module/iab/constants.d.ts +4 -0
  444. package/lib/typescript/lib/module/iab/constants.d.ts.map +1 -0
  445. package/lib/typescript/lib/module/iab/gpp/api.d.ts +28 -0
  446. package/lib/typescript/lib/module/iab/gpp/api.d.ts.map +1 -0
  447. package/lib/typescript/lib/module/iab/gpp/consent.d.ts +24 -0
  448. package/lib/typescript/lib/module/iab/gpp/consent.d.ts.map +1 -0
  449. package/lib/typescript/lib/module/iab/gpp/constants.d.ts +37 -0
  450. package/lib/typescript/lib/module/iab/gpp/constants.d.ts.map +1 -0
  451. package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +8 -0
  452. package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
  453. package/lib/typescript/lib/module/iab/gpp/encoders/BooleanEncoder.d.ts +8 -0
  454. package/lib/typescript/lib/module/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
  455. package/lib/typescript/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +9 -0
  456. package/lib/typescript/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
  457. package/lib/typescript/lib/module/iab/gpp/encoders/DatetimeEncoder.d.ts +8 -0
  458. package/lib/typescript/lib/module/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
  459. package/lib/typescript/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +18 -0
  460. package/lib/typescript/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
  461. package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +8 -0
  462. package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
  463. package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +8 -0
  464. package/lib/typescript/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
  465. package/lib/typescript/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +8 -0
  466. package/lib/typescript/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
  467. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +6 -0
  468. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
  469. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerEncoder.d.ts +8 -0
  470. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
  471. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +8 -0
  472. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
  473. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +8 -0
  474. package/lib/typescript/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
  475. package/lib/typescript/lib/module/iab/gpp/encoders/FixedStringEncoder.d.ts +8 -0
  476. package/lib/typescript/lib/module/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
  477. package/lib/typescript/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +9 -0
  478. package/lib/typescript/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
  479. package/lib/typescript/lib/module/iab/gpp/encoders/errors.d.ts +16 -0
  480. package/lib/typescript/lib/module/iab/gpp/encoders/errors.d.ts.map +1 -0
  481. package/lib/typescript/lib/module/iab/gpp/encoders/index.d.ts +15 -0
  482. package/lib/typescript/lib/module/iab/gpp/encoders/index.d.ts.map +1 -0
  483. package/lib/typescript/lib/module/iab/gpp/encoders/types.d.ts +1 -0
  484. package/lib/typescript/lib/module/iab/gpp/encoders/types.d.ts.map +1 -0
  485. package/lib/typescript/lib/module/iab/gpp/index.d.ts +10 -0
  486. package/lib/typescript/lib/module/iab/gpp/index.d.ts.map +1 -0
  487. package/lib/typescript/lib/module/iab/gpp/reducer.d.ts +6 -0
  488. package/lib/typescript/lib/module/iab/gpp/reducer.d.ts.map +1 -0
  489. package/lib/typescript/lib/module/iab/gpp/selectors.d.ts +6 -0
  490. package/lib/typescript/lib/module/iab/gpp/selectors.d.ts.map +1 -0
  491. package/lib/typescript/lib/module/iab/gpp/types.d.ts +1 -0
  492. package/lib/typescript/lib/module/iab/gpp/types.d.ts.map +1 -0
  493. package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts +9 -0
  494. package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts.map +1 -0
  495. package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts +19 -0
  496. package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts.map +1 -0
  497. package/lib/typescript/lib/module/iab/index.d.ts +2 -0
  498. package/lib/typescript/lib/module/iab/index.d.ts.map +1 -0
  499. package/lib/typescript/lib/module/iab/reducer.d.ts +5 -0
  500. package/lib/typescript/lib/module/iab/reducer.d.ts.map +1 -0
  501. package/lib/typescript/lib/module/iab/tcf/actions.d.ts +63 -0
  502. package/lib/typescript/lib/module/iab/tcf/actions.d.ts.map +1 -0
  503. package/lib/typescript/lib/module/iab/tcf/consent.d.ts +58 -0
  504. package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -0
  505. package/lib/typescript/lib/module/iab/tcf/constants.d.ts +21 -0
  506. package/lib/typescript/lib/module/iab/tcf/constants.d.ts.map +1 -0
  507. package/lib/typescript/lib/module/iab/tcf/helpers.d.ts +8 -0
  508. package/lib/typescript/lib/module/iab/tcf/helpers.d.ts.map +1 -0
  509. package/lib/typescript/lib/module/iab/tcf/index.d.ts +303 -0
  510. package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -0
  511. package/lib/typescript/lib/module/iab/tcf/middleware.d.ts +3 -0
  512. package/lib/typescript/lib/module/iab/tcf/middleware.d.ts.map +1 -0
  513. package/lib/typescript/lib/module/iab/tcf/reducer.d.ts +20 -0
  514. package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -0
  515. package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +47 -0
  516. package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -0
  517. package/lib/typescript/lib/module/iab/tcf/types.d.ts +2 -0
  518. package/lib/typescript/lib/module/iab/tcf/types.d.ts.map +1 -0
  519. package/lib/typescript/lib/module/iab/tcf/v2.0/encoders.d.ts +13 -0
  520. package/lib/typescript/lib/module/iab/tcf/v2.0/encoders.d.ts.map +1 -0
  521. package/lib/typescript/lib/module/iab/tcf/v2.0/formatters.d.ts +4 -0
  522. package/lib/typescript/lib/module/iab/tcf/v2.0/formatters.d.ts.map +1 -0
  523. package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +308 -0
  524. package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -0
  525. package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +80 -0
  526. package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
  527. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +104 -0
  528. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
  529. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +103 -0
  530. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
  531. package/lib/typescript/lib/module/iab/types.d.ts +2 -0
  532. package/lib/typescript/lib/module/iab/types.d.ts.map +1 -0
  533. package/lib/typescript/lib/module/iab/usp/api.d.ts +4 -0
  534. package/lib/typescript/lib/module/iab/usp/api.d.ts.map +1 -0
  535. package/lib/typescript/lib/module/iab/usp/consent.d.ts +13 -0
  536. package/lib/typescript/lib/module/iab/usp/consent.d.ts.map +1 -0
  537. package/lib/typescript/lib/module/iab/usp/constants.d.ts +77 -0
  538. package/lib/typescript/lib/module/iab/usp/constants.d.ts.map +1 -0
  539. package/lib/typescript/lib/module/iab/usp/index.d.ts +10 -0
  540. package/lib/typescript/lib/module/iab/usp/index.d.ts.map +1 -0
  541. package/lib/typescript/lib/module/iab/usp/reducer.d.ts +13 -0
  542. package/lib/typescript/lib/module/iab/usp/reducer.d.ts.map +1 -0
  543. package/lib/typescript/lib/module/iab/usp/selectors.d.ts +9 -0
  544. package/lib/typescript/lib/module/iab/usp/selectors.d.ts.map +1 -0
  545. package/lib/typescript/lib/module/iab/usp/types.d.ts +1 -0
  546. package/lib/typescript/lib/module/iab/usp/types.d.ts.map +1 -0
  547. package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts +9 -0
  548. package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts.map +1 -0
  549. package/lib/typescript/lib/module/iab/usp/v1/index.d.ts +16 -0
  550. package/lib/typescript/lib/module/iab/usp/v1/index.d.ts.map +1 -0
  551. package/lib/typescript/lib/module/iab/utilities.d.ts +2 -0
  552. package/lib/typescript/lib/module/iab/utilities.d.ts.map +1 -0
  553. package/lib/typescript/lib/module/index.d.ts +4 -0
  554. package/lib/typescript/lib/module/index.d.ts.map +1 -0
  555. package/lib/typescript/lib/module/locale/index.d.ts +61 -0
  556. package/lib/typescript/lib/module/locale/index.d.ts.map +1 -0
  557. package/lib/typescript/lib/module/native/OsanoCmp.d.ts +5 -0
  558. package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -0
  559. package/lib/typescript/lib/module/reducer.d.ts +28 -0
  560. package/lib/typescript/lib/module/reducer.d.ts.map +1 -0
  561. package/lib/typescript/lib/module/selectors.d.ts +15 -0
  562. package/lib/typescript/lib/module/selectors.d.ts.map +1 -0
  563. package/lib/typescript/lib/module/services/consent.d.ts +5 -0
  564. package/lib/typescript/lib/module/services/consent.d.ts.map +1 -0
  565. package/lib/typescript/lib/module/services/disclosures.d.ts +2 -0
  566. package/lib/typescript/lib/module/services/disclosures.d.ts.map +1 -0
  567. package/lib/typescript/lib/module/services/locale.d.ts +3 -0
  568. package/lib/typescript/lib/module/services/locale.d.ts.map +1 -0
  569. package/lib/typescript/lib/module/styles.d.ts +140 -0
  570. package/lib/typescript/lib/module/styles.d.ts.map +1 -0
  571. package/lib/typescript/lib/module/types/consent-config.d.d.ts +2 -0
  572. package/lib/typescript/lib/module/types/consent-config.d.d.ts.map +1 -0
  573. package/lib/typescript/lib/module/types/env.d.d.ts +1 -0
  574. package/lib/typescript/lib/module/types/env.d.d.ts.map +1 -0
  575. package/lib/typescript/lib/module/types/index.d.d.ts +2 -0
  576. package/lib/typescript/lib/module/types/index.d.d.ts.map +1 -0
  577. package/lib/typescript/lib/module/types/store.d.d.ts +2 -0
  578. package/lib/typescript/lib/module/types/store.d.d.ts.map +1 -0
  579. package/lib/typescript/lib/module/utils/API.d.ts +6 -0
  580. package/lib/typescript/lib/module/utils/API.d.ts.map +1 -0
  581. package/lib/typescript/lib/module/utils/Color.d.ts +12 -0
  582. package/lib/typescript/lib/module/utils/Color.d.ts.map +1 -0
  583. package/lib/typescript/lib/module/utils/EventEmitter.d.ts +15 -0
  584. package/lib/typescript/lib/module/utils/EventEmitter.d.ts.map +1 -0
  585. package/lib/typescript/lib/module/utils/Translator.d.ts +52 -0
  586. package/lib/typescript/lib/module/utils/Translator.d.ts.map +1 -0
  587. package/lib/typescript/lib/module/utils/index.d.ts +5 -0
  588. package/lib/typescript/lib/module/utils/index.d.ts.map +1 -0
  589. package/lib/typescript/lib/module/utils/types.d.ts +1 -0
  590. package/lib/typescript/lib/module/utils/types.d.ts.map +1 -0
  591. package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts +5 -0
  592. package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts.map +1 -0
  593. package/lib/typescript/lib/module/views/Dialog/FirstLayerUsage.d.ts +5 -0
  594. package/lib/typescript/lib/module/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
  595. package/lib/typescript/lib/module/views/Dialog/Message.d.ts +4 -0
  596. package/lib/typescript/lib/module/views/Dialog/Message.d.ts.map +1 -0
  597. package/lib/typescript/lib/module/views/Dialog/PreferenceManagementDeepLinks.d.ts +6 -0
  598. package/lib/typescript/lib/module/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
  599. package/lib/typescript/lib/module/views/Dialog/index.d.ts +5 -0
  600. package/lib/typescript/lib/module/views/Dialog/index.d.ts.map +1 -0
  601. package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts +5 -0
  602. package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
  603. package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts +5 -0
  604. package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts.map +1 -0
  605. package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts +5 -0
  606. package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
  607. package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Vendors.d.ts +5 -0
  608. package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
  609. package/lib/typescript/lib/module/views/Drawer/index.d.ts +4 -0
  610. package/lib/typescript/lib/module/views/Drawer/index.d.ts.map +1 -0
  611. package/lib/typescript/scripts/updateLocalization.d.ts +2 -0
  612. package/lib/typescript/scripts/updateLocalization.d.ts.map +1 -0
  613. package/lib/typescript/src/ConsentManager.d.ts +31 -16
  614. package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
  615. package/lib/typescript/src/ConsentUiBuilder.d.ts +1 -1
  616. package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -1
  617. package/lib/typescript/src/actions.d.ts +42 -0
  618. package/lib/typescript/src/actions.d.ts.map +1 -0
  619. package/lib/typescript/src/commands.d.ts +14 -0
  620. package/lib/typescript/src/commands.d.ts.map +1 -0
  621. package/lib/typescript/src/components/Button.d.ts +1 -1
  622. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  623. package/lib/typescript/src/components/Locale.d.ts +1 -0
  624. package/lib/typescript/src/components/Locale.d.ts.map +1 -1
  625. package/lib/typescript/src/context.d.ts +3 -3
  626. package/lib/typescript/src/context.d.ts.map +1 -1
  627. package/lib/typescript/src/flavors/index.d.ts +1 -1
  628. package/lib/typescript/src/hooks/usePrevious.d.ts +1 -1
  629. package/lib/typescript/src/hooks/usePrevious.d.ts.map +1 -1
  630. package/lib/typescript/src/hooks/useThunkReducer.d.ts +6 -8
  631. package/lib/typescript/src/hooks/useThunkReducer.d.ts.map +1 -1
  632. package/lib/typescript/src/iab/actions.d.ts +7 -0
  633. package/lib/typescript/src/iab/actions.d.ts.map +1 -0
  634. package/lib/typescript/src/iab/constants.d.ts +2 -0
  635. package/lib/typescript/src/iab/constants.d.ts.map +1 -1
  636. package/lib/typescript/src/iab/gpp/api.d.ts +28 -0
  637. package/lib/typescript/src/iab/gpp/api.d.ts.map +1 -0
  638. package/lib/typescript/src/iab/gpp/consent.d.ts +24 -0
  639. package/lib/typescript/src/iab/gpp/consent.d.ts.map +1 -0
  640. package/lib/typescript/src/iab/gpp/constants.d.ts +37 -0
  641. package/lib/typescript/src/iab/gpp/constants.d.ts.map +1 -0
  642. package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
  643. package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts +2 -2
  644. package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +4 -2
  645. package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -1
  646. package/lib/typescript/src/iab/gpp/index.d.ts +10 -0
  647. package/lib/typescript/src/iab/gpp/index.d.ts.map +1 -0
  648. package/lib/typescript/src/iab/gpp/reducer.d.ts +6 -0
  649. package/lib/typescript/src/iab/gpp/reducer.d.ts.map +1 -0
  650. package/lib/typescript/src/iab/gpp/selectors.d.ts +6 -0
  651. package/lib/typescript/src/iab/gpp/selectors.d.ts.map +1 -0
  652. package/lib/typescript/src/iab/gpp/v1/constants.d.ts +9 -0
  653. package/lib/typescript/src/iab/gpp/v1/constants.d.ts.map +1 -0
  654. package/lib/typescript/src/iab/gpp/v1/index.d.ts +19 -0
  655. package/lib/typescript/src/iab/gpp/v1/index.d.ts.map +1 -0
  656. package/lib/typescript/src/iab/index.d.ts +5 -0
  657. package/lib/typescript/src/iab/index.d.ts.map +1 -0
  658. package/lib/typescript/src/iab/reducer.d.ts +6 -0
  659. package/lib/typescript/src/iab/reducer.d.ts.map +1 -0
  660. package/lib/typescript/src/iab/tcf/actions.d.ts +35 -0
  661. package/lib/typescript/src/iab/tcf/actions.d.ts.map +1 -0
  662. package/lib/typescript/src/iab/tcf/consent.d.ts +25 -0
  663. package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -0
  664. package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -1
  665. package/lib/typescript/src/iab/tcf/helpers.d.ts +15 -0
  666. package/lib/typescript/src/iab/tcf/helpers.d.ts.map +1 -0
  667. package/lib/typescript/src/iab/tcf/index.d.ts +8 -0
  668. package/lib/typescript/src/iab/tcf/index.d.ts.map +1 -0
  669. package/lib/typescript/src/iab/tcf/middleware.d.ts +4 -0
  670. package/lib/typescript/src/iab/tcf/middleware.d.ts.map +1 -0
  671. package/lib/typescript/src/iab/tcf/reducer.d.ts +59 -0
  672. package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -0
  673. package/lib/typescript/src/iab/tcf/selectors.d.ts +52 -0
  674. package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -0
  675. package/lib/typescript/src/iab/tcf/types.d.ts +82 -4
  676. package/lib/typescript/src/iab/tcf/types.d.ts.map +1 -1
  677. package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts +35 -6
  678. package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts.map +1 -1
  679. package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts +4 -0
  680. package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts.map +1 -0
  681. package/lib/typescript/src/iab/tcf/v2.0/index.d.ts +7 -0
  682. package/lib/typescript/src/iab/tcf/v2.0/index.d.ts.map +1 -0
  683. package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts +60 -0
  684. package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -0
  685. package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts +77 -0
  686. package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -0
  687. package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts +82 -0
  688. package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -0
  689. package/lib/typescript/src/iab/types.d.ts +14 -5
  690. package/lib/typescript/src/iab/types.d.ts.map +1 -1
  691. package/lib/typescript/src/iab/usp/api.d.ts +4 -0
  692. package/lib/typescript/src/iab/usp/api.d.ts.map +1 -0
  693. package/lib/typescript/src/iab/usp/consent.d.ts +13 -0
  694. package/lib/typescript/src/iab/usp/consent.d.ts.map +1 -0
  695. package/lib/typescript/src/iab/usp/constants.d.ts +77 -0
  696. package/lib/typescript/src/iab/usp/constants.d.ts.map +1 -0
  697. package/lib/typescript/src/iab/usp/index.d.ts +10 -0
  698. package/lib/typescript/src/iab/usp/index.d.ts.map +1 -0
  699. package/lib/typescript/src/iab/usp/reducer.d.ts +13 -0
  700. package/lib/typescript/src/iab/usp/reducer.d.ts.map +1 -0
  701. package/lib/typescript/src/iab/usp/selectors.d.ts +9 -0
  702. package/lib/typescript/src/iab/usp/selectors.d.ts.map +1 -0
  703. package/lib/typescript/src/iab/usp/v1/constants.d.ts +9 -0
  704. package/lib/typescript/src/iab/usp/v1/constants.d.ts.map +1 -0
  705. package/lib/typescript/src/iab/usp/v1/index.d.ts +16 -0
  706. package/lib/typescript/src/iab/usp/v1/index.d.ts.map +1 -0
  707. package/lib/typescript/src/index.d.ts.map +1 -1
  708. package/lib/typescript/src/locale/index.d.ts +61 -0
  709. package/lib/typescript/src/locale/index.d.ts.map +1 -0
  710. package/lib/typescript/src/reducer.d.ts +7 -0
  711. package/lib/typescript/src/reducer.d.ts.map +1 -0
  712. package/lib/typescript/src/selectors.d.ts +19 -0
  713. package/lib/typescript/src/selectors.d.ts.map +1 -0
  714. package/lib/typescript/src/services/consent.d.ts.map +1 -1
  715. package/lib/typescript/src/styles.d.ts +2 -2
  716. package/lib/typescript/src/styles.d.ts.map +1 -1
  717. package/lib/typescript/src/utils/Translator.d.ts +1 -1
  718. package/lib/typescript/src/utils/Translator.d.ts.map +1 -1
  719. package/lib/typescript/src/utils/index.d.ts +2 -1
  720. package/lib/typescript/src/utils/index.d.ts.map +1 -1
  721. package/lib/typescript/src/utils/types.d.ts +5 -0
  722. package/lib/typescript/src/utils/types.d.ts.map +1 -0
  723. package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -1
  724. package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -1
  725. package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
  726. package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -1
  727. package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
  728. package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -1
  729. package/package.json +18 -38
  730. package/src/ConsentManager.ts +325 -120
  731. package/src/ConsentUiBuilder.tsx +2 -2
  732. package/src/actions.ts +80 -0
  733. package/src/commands.ts +96 -0
  734. package/src/components/Button.tsx +34 -27
  735. package/src/components/Locale.tsx +30 -16
  736. package/src/context.ts +12 -12
  737. package/src/flavors/index.ts +1 -1
  738. package/src/hooks/usePrevious.ts +1 -1
  739. package/src/hooks/useThunkReducer.ts +86 -54
  740. package/src/iab/actions.ts +19 -0
  741. package/src/iab/constants.ts +2 -0
  742. package/src/iab/gpp/encoders/FixedIntegerEncoder.ts +1 -1
  743. package/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.ts +1 -2
  744. package/src/iab/index.ts +34 -0
  745. package/src/iab/reducer.ts +38 -0
  746. package/src/iab/tcf/actions.ts +116 -0
  747. package/src/iab/tcf/{consent.js → consent.ts} +143 -164
  748. package/src/iab/tcf/constants.ts +6 -6
  749. package/src/iab/tcf/helpers.ts +95 -0
  750. package/src/iab/tcf/index.ts +8 -0
  751. package/src/iab/tcf/middleware.ts +217 -0
  752. package/src/iab/tcf/reducer.ts +250 -0
  753. package/src/iab/tcf/selectors.ts +192 -0
  754. package/src/iab/tcf/types.ts +108 -4
  755. package/src/iab/tcf/v2.0/encoders.ts +7 -16
  756. package/src/iab/tcf/v2.0/formatters.ts +18 -0
  757. package/src/iab/tcf/v2.0/index.ts +40 -0
  758. package/src/iab/tcf/v2.0/shared-constants.ts +53 -0
  759. package/src/iab/tcf/v2.0/{tcfcav1-constants.js → tcfcav1-constants.ts} +4 -15
  760. package/src/iab/tcf/v2.0/{tcfeuv2-constants.js → tcfeuv2-constants.ts} +4 -14
  761. package/src/iab/types.ts +21 -5
  762. package/src/index.tsx +184 -99
  763. package/src/reducer.ts +416 -0
  764. package/src/selectors.ts +109 -0
  765. package/src/services/consent.ts +35 -12
  766. package/src/styles.ts +3 -5
  767. package/src/types/consent-config.d.ts +16 -12
  768. package/src/types/index.d.ts +21 -5
  769. package/src/types/store.d.ts +14 -4
  770. package/src/utils/Translator.ts +47 -43
  771. package/src/utils/index.ts +23 -27
  772. package/src/utils/types.ts +35 -0
  773. package/src/views/Dialog/Buttons.tsx +2 -2
  774. package/src/views/Dialog/Message.tsx +1 -1
  775. package/src/views/Dialog/PreferenceManagementDeepLinks.tsx +7 -5
  776. package/src/views/Dialog/index.tsx +22 -38
  777. package/src/views/Drawer/Drawer.ConsentCategories.tsx +84 -41
  778. package/src/views/Drawer/Drawer.Header.tsx +3 -2
  779. package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +71 -41
  780. package/src/views/Drawer/Drawer.Iab.Vendors.tsx +78 -37
  781. package/src/views/Drawer/index.tsx +8 -8
  782. package/lib/commonjs/iab/tcf/tcfcav1-api.js +0 -41
  783. package/lib/commonjs/iab/tcf/tcfcav1-api.js.map +0 -1
  784. package/lib/commonjs/iab/tcf/tcfeuv2-api.js +0 -256
  785. package/lib/commonjs/iab/tcf/tcfeuv2-api.js.map +0 -1
  786. package/lib/commonjs/iab/tcf/v2.0/helpers.js +0 -25
  787. package/lib/commonjs/iab/tcf/v2.0/helpers.js.map +0 -1
  788. package/lib/commonjs/iab/tcf/v2.0/middleware.js +0 -80
  789. package/lib/commonjs/iab/tcf/v2.0/middleware.js.map +0 -1
  790. package/lib/commonjs/iab/tcf/v2.0/reducer.js +0 -318
  791. package/lib/commonjs/iab/tcf/v2.0/reducer.js.map +0 -1
  792. package/lib/commonjs/store.js +0 -558
  793. package/lib/commonjs/store.js.map +0 -1
  794. package/lib/module/iab/tcf/tcfcav1-api.js +0 -35
  795. package/lib/module/iab/tcf/tcfcav1-api.js.map +0 -1
  796. package/lib/module/iab/tcf/tcfeuv2-api.js +0 -251
  797. package/lib/module/iab/tcf/tcfeuv2-api.js.map +0 -1
  798. package/lib/module/iab/tcf/v2.0/helpers.js +0 -18
  799. package/lib/module/iab/tcf/v2.0/helpers.js.map +0 -1
  800. package/lib/module/iab/tcf/v2.0/middleware.js +0 -74
  801. package/lib/module/iab/tcf/v2.0/middleware.js.map +0 -1
  802. package/lib/module/iab/tcf/v2.0/reducer.js +0 -311
  803. package/lib/module/iab/tcf/v2.0/reducer.js.map +0 -1
  804. package/lib/module/store.js.map +0 -1
  805. package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts +0 -5
  806. package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts.map +0 -1
  807. package/lib/typescript/src/store.d.ts +0 -55
  808. package/lib/typescript/src/store.d.ts.map +0 -1
  809. package/src/iab/tcf/actions.js +0 -52
  810. package/src/iab/tcf/index.js +0 -7
  811. package/src/iab/tcf/reducer.js +0 -59
  812. package/src/iab/tcf/selectors.js +0 -151
  813. package/src/iab/tcf/tcfcav1-api.js +0 -39
  814. package/src/iab/tcf/tcfeuv2-api.js +0 -264
  815. package/src/iab/tcf/v2.0/formatters.js +0 -14
  816. package/src/iab/tcf/v2.0/helpers.ts +0 -23
  817. package/src/iab/tcf/v2.0/index.js +0 -36
  818. package/src/iab/tcf/v2.0/middleware.js +0 -72
  819. package/src/iab/tcf/v2.0/reducer.js +0 -327
  820. package/src/iab/tcf/v2.0/shared-constants.js +0 -17
  821. package/src/store.ts +0 -602
@@ -3,12 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.makeParseConsentString = exports.makeGetField = exports.makeGetConsentDataObject = exports.makeFormatConsentString = exports.makeConsentFromOptions = exports.getVendorLegitimateInterests = exports.getVendorConsents = exports.commonConsent = void 0;
6
+ exports.makeReadFromStorage = exports.makeParseConsentString = exports.makeGetField = exports.makeFormatConsentString = exports.makeConsentFromOptions = exports.getVendorLegitimateInterests = exports.getVendorConsents = exports.commonConsent = void 0;
7
7
  var _constants = require("./constants");
8
- var _constants2 = require("../../constants");
9
- var _selectors = require("./selectors");
10
8
  var _utils = require("../../utils");
11
- var _selectors2 = require("../../redux/selectors");
9
+ var _selectors = require("./selectors");
10
+ // TODO: Look at these
11
+ // import { Locale, ScreenIds } from '../../constants';
12
+
12
13
  const commonConsent = exports.commonConsent = {
13
14
  consentLanguage: 'en',
14
15
  cmpLoaded: true,
@@ -20,8 +21,8 @@ const commonConsent = exports.commonConsent = {
20
21
  useNonStandardStacks: true,
21
22
  purposeOneTreatment: false
22
23
  };
23
- const getVendorConsents = (state, apiVersion) => {
24
- const vendors = (0, _selectors.getVendors)(state, apiVersion);
24
+ const getVendorConsents = (config, state, apiVersion) => {
25
+ const vendors = config.getVendors();
25
26
  /*
26
27
  * Unless a user has specifically opted out of a vendor, the consent
27
28
  * is determined by purposes and specialFeatures.
@@ -32,10 +33,10 @@ const getVendorConsents = (state, apiVersion) => {
32
33
  * If the user has consented to any vendor's purposes the consent
33
34
  * is marked as true.
34
35
  */
35
- const purposeConsent = (0, _constants.consentToPurpose)((0, _selectors2.getSavedConsent)(state) || (0, _selectors2.getConsent)(state), apiVersion);
36
+ const purposeConsent = (0, _constants.consentToPurpose)((0, _selectors.getSavedConsent)(state) || (0, _selectors.getConsent)(state), apiVersion);
36
37
  const consents = Object.entries(vendors).reduce((vendorConsents, [vendorId, {
37
38
  purposes = [],
38
- deletedDate
39
+ deletedDate = ''
39
40
  } = {}]) => {
40
41
  // We also need to apply IAB rules found here:
41
42
  // https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
@@ -62,7 +63,7 @@ const getVendorConsents = (state, apiVersion) => {
62
63
  return consents;
63
64
  };
64
65
  exports.getVendorConsents = getVendorConsents;
65
- const getVendorLegitimateInterests = (state, apiVersion) => {
66
+ const getVendorLegitimateInterests = (config, state, apiVersion) => {
66
67
  /*
67
68
  * Unless a use has specifically opted out of a vendor, the consent
68
69
  * is determined by LI.
@@ -74,13 +75,13 @@ const getVendorLegitimateInterests = (state, apiVersion) => {
74
75
  * marked as true.
75
76
  */
76
77
  const optOutPurposes = (0, _selectors.getPurposeOptOuts)(state, apiVersion);
77
- const vendors = (0, _selectors.getVendors)(state, apiVersion);
78
+ const vendors = config.getVendors();
78
79
  const vendorLegitimateInterests = {};
79
80
  Object.entries(vendors).forEach(([vendorId, {
80
81
  legIntPurposes = [],
81
82
  purposes = [],
82
83
  specialPurposes = [],
83
- deletedDate
84
+ deletedDate = ''
84
85
  } = {}]) => {
85
86
  // We also need to apply IAB rules found here:
86
87
  // https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
@@ -120,16 +121,14 @@ const makeParseConsentString = initOptions => tcString => {
120
121
  coreFieldSequence,
121
122
  version,
122
123
  cmpId,
123
- cmpVersion,
124
- specFieldMode = false
124
+ cmpVersion
125
125
  } = initOptions;
126
126
  const segments = tcString.split('.');
127
127
  const coreSegment = decode(segments[0]);
128
- const tcData = specFieldMode ? {} : {
128
+ const tcData = {
129
129
  ...commonConsent,
130
130
  cmpId,
131
131
  cmpVersion,
132
- consentLanguage: _constants2.Locale.locale.slice(0, 2).toUpperCase(),
133
132
  tcfPolicyVersion: parseInt(version, 10)
134
133
  };
135
134
  coreFieldSequence.reduce((startBit, [field, numBits, {
@@ -142,11 +141,7 @@ const makeParseConsentString = initOptions => tcString => {
142
141
  bitLength,
143
142
  value: decodedValue
144
143
  } = decodeField(value, numBits);
145
-
146
- // The TCF string spec uses PascalCase names for fields, but the TCData object uses camelCase
147
- // Reference: https://github.com/IABTechLab/iabgpp-es/blob/42060d7ac2b6d0ee70fc1b5bcd33fc447bf5123c/modules/cmpapi/src/encoder/field/TcfEuV2Field.ts
148
- const fieldName = specFieldMode ? field[0].toUpperCase() + field.substring(1) // Capitalize first letter
149
- : dataField || field;
144
+ const fieldName = dataField || field;
150
145
  (0, _utils.set)(tcData, fieldName, decodedValue);
151
146
  return startBit + bitLength;
152
147
  }, 0);
@@ -160,31 +155,25 @@ const makeGetField = initOptions => {
160
155
  });
161
156
  return (tcString, requestedField) => (0, _utils.get)(tcString ? parseConsentString(tcString) : {}, requestedField);
162
157
  };
163
-
164
- /**
165
- * TCFAPI consentFromOptions implementation
166
- * @function
167
- * @param {import('./constants').IABInitOptions} initOptions
168
- * @returns {import('./constants').TCDataDeterminateField} Properly formatted TCData object
169
- */
170
158
  exports.makeGetField = makeGetField;
171
- const makeConsentFromOptions = ({
172
- version = '2.0',
173
- cmpId,
174
- cmpVersion,
175
- fallbackGvlVersion,
176
- gppSection,
177
- staticFields,
178
- dynamicFields = {}
179
- }) => (data = {}, state) => {
159
+ const makeConsentFromOptions = initOptions => (config, state) => {
160
+ const {
161
+ version = '2.0',
162
+ cmpId,
163
+ cmpVersion,
164
+ fallbackGvlVersion,
165
+ gppSection,
166
+ staticFields,
167
+ dynamicFields = {}
168
+ } = initOptions;
180
169
  const {
181
170
  gdprApplies
182
- } = (0, _utils.merge)((0, _selectors.getStore)(state), data);
183
- const publisherCC = (0, _selectors.getPublisherCountryCode)(state);
171
+ } = config;
172
+ const publisherCC = config.country;
184
173
  const currentScreen = (0, _selectors.getCurrentScreen)(state);
185
- const isShowingUi = currentScreen !== _constants2.ScreenIds.None;
186
- const willShowUi = !(0, _selectors2.isSaved)(state) || isShowingUi;
187
- const cmpStatus = (0, _selectors2.isConsentReady)(state) ? _constants.CMPStatusCodes.LOADED : _constants.CMPStatusCodes.STUB;
174
+ const isShowingUi = currentScreen !== 0;
175
+ const willShowUi = !(0, _selectors.isSaved)(state) || isShowingUi;
176
+ const cmpStatus = _constants.CMPStatusCodes.LOADED;
188
177
 
189
178
  /**
190
179
  * The vendor list version should be in the customer's config because
@@ -192,14 +181,14 @@ const makeConsentFromOptions = ({
192
181
  * a way to know what it should be. The TCF spec doesn't cover this case
193
182
  * and we can't encode 'undefined', so we'll use a fallback version.
194
183
  */
195
- const gvlVersion = (0, _selectors.getVendorListVersion)(state, version) || fallbackGvlVersion;
184
+ const gvlVersion = config.vendorListVersion || fallbackGvlVersion;
196
185
 
197
186
  /**
198
187
  * Since `consentFromOptions` is used for multiple callbacks, all TCDataDeterminateField
199
188
  * values should be set here.
200
189
  */
201
190
  const dynamicConsent = Object.entries(dynamicFields).reduce((acc, [field, getter]) => {
202
- acc[`${field}`] = getter(data, state);
191
+ acc[`${field}`] = getter(initOptions, state);
203
192
  return acc;
204
193
  }, {});
205
194
  return {
@@ -214,13 +203,13 @@ const makeConsentFromOptions = ({
214
203
  cmpId,
215
204
  cmpVersion,
216
205
  gvlVersion,
217
- consentLanguage: _constants2.Locale.locale.slice(0, 2).toUpperCase(),
206
+ consentLanguage: config.language.slice(0, 2).toUpperCase(),
218
207
  publisherCC,
219
208
  tcfPolicyVersion: staticFields.tcfPolicyVersion,
220
- gdprApplies: gdprApplies !== undefined ? gdprApplies : (0, _selectors.doesGDPRApply)(state),
209
+ gdprApplies,
221
210
  vendor: {
222
- consents: getVendorConsents(state, version),
223
- legitimateInterests: getVendorLegitimateInterests(state, version)
211
+ consents: getVendorConsents(config, state, version),
212
+ legitimateInterests: getVendorLegitimateInterests(config, state, version)
224
213
  },
225
214
  specialFeatureOptins: (0, _selectors.getSpecialFeatureOptIns)(state, version),
226
215
  purpose: {
@@ -229,24 +218,18 @@ const makeConsentFromOptions = ({
229
218
  }
230
219
  };
231
220
  };
232
-
233
- /**
234
- * TCFAPI formatConsentString implementation
235
- * @function
236
- * @param {Object} data
237
- * @returns {string} Properly formatted TCFData string
238
- */
239
221
  exports.makeConsentFromOptions = makeConsentFromOptions;
240
- const makeFormatConsentString = initOptions => (data, state) => {
222
+ const makeFormatConsentString = initOptions => (config, state) => {
241
223
  const {
242
224
  encoder: {
243
225
  encode
244
226
  },
245
227
  coreFieldSequence,
246
- staticFields
228
+ staticFields,
229
+ tcString
247
230
  } = initOptions;
248
- const tcData = makeConsentFromOptions(initOptions)(data, state);
249
- const segments = (0, _selectors.getConsentString)(state, initOptions).split('.');
231
+ const tcData = makeConsentFromOptions(initOptions)(config, state);
232
+ const segments = `${tcString}`.split('.').filter(Boolean);
250
233
  // Only update the CORE string
251
234
  segments.shift();
252
235
  const [bitFields] = coreFieldSequence.reduce(([bitString, startBit], [key, numBits, {
@@ -260,6 +243,9 @@ const makeFormatConsentString = initOptions => (data, state) => {
260
243
  } else {
261
244
  value = (0, _utils.get)(tcData, dataField);
262
245
  }
246
+ if (process.env.NODE_ENV === 'development') {
247
+ console.log(`TCString encode: ${dataField} -> ${JSON.stringify(value)} :: ${numBits} bits`);
248
+ }
263
249
  const encodedValue = encodeField(value, numBits);
264
250
  return [bitString + encodedValue, startBit + encodedValue.length];
265
251
  }, ['', 0]);
@@ -267,40 +253,18 @@ const makeFormatConsentString = initOptions => (data, state) => {
267
253
  segments.unshift(newCoreString);
268
254
  return segments.join('.');
269
255
  };
270
-
271
- /**
272
- * TCFAPI getConsentDataObject implementation
273
- * @function
274
- * @param {number} version
275
- * @returns {import('./constants').TCData} Properly formatted TCData object
276
- */
277
256
  exports.makeFormatConsentString = makeFormatConsentString;
278
- const makeGetConsentDataObject = initOptions => state => {
257
+ const makeReadFromStorage = initOptions => {
279
258
  const {
280
- defaultTimestamp,
281
259
  version
282
260
  } = initOptions;
283
- switch (parseInt(version, 10)) {
284
- // Supported versions
285
- case 2:
286
- {
287
- break;
261
+ return storage => {
262
+ return {
263
+ tcf: {
264
+ [`v${parseInt(version, 10)}`]: storage ?? {}
288
265
  }
289
- default:
290
- {
291
- throw new Error('Unsupported version');
292
- }
293
- }
294
-
295
- // `defaultTimestamp` will be used for the created and lastUpdated fields if
296
- // a consent timestamp is not available yet.
297
- const data = {
298
- defaultTimestamp
299
- };
300
- return {
301
- ...makeConsentFromOptions(initOptions)(data, state),
302
- tcString: makeFormatConsentString(initOptions)(data, state)
266
+ };
303
267
  };
304
268
  };
305
- exports.makeGetConsentDataObject = makeGetConsentDataObject;
269
+ exports.makeReadFromStorage = makeReadFromStorage;
306
270
  //# sourceMappingURL=consent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_constants2","_selectors","_utils","_selectors2","commonConsent","exports","consentLanguage","cmpLoaded","cmpStatus","CMPStatusCodes","LOADED","eventStatus","CMPEventStatus","TC_LOADED","isServiceSpecific","useNonStandardStacks","purposeOneTreatment","getVendorConsents","state","apiVersion","vendors","getVendors","optOutVendors","getVendorOptOuts","purposeConsent","consentToPurpose","getSavedConsent","getConsent","consents","Object","entries","reduce","vendorConsents","vendorId","purposes","deletedDate","vendorHasConsent","length","every","purposeId","getVendorLegitimateInterests","optOutPurposes","getPurposeOptOuts","vendorLegitimateInterests","forEach","legIntPurposes","specialPurposes","vendorHasLegitimateInterest","some","makeParseConsentString","initOptions","tcString","encoder","decode","coreFieldSequence","version","cmpId","cmpVersion","specFieldMode","segments","split","coreSegment","tcData","Locale","locale","slice","toUpperCase","tcfPolicyVersion","parseInt","startBit","field","numBits","decodeField","dataField","value","isFinite","bitLength","decodedValue","fieldName","substring","set","makeGetField","parseConsentString","requestedField","get","makeConsentFromOptions","fallbackGvlVersion","gppSection","staticFields","dynamicFields","data","gdprApplies","merge","getStore","publisherCC","getPublisherCountryCode","currentScreen","getCurrentScreen","isShowingUi","ScreenIds","None","willShowUi","isSaved","isConsentReady","STUB","gvlVersion","getVendorListVersion","dynamicConsent","acc","getter","CMP_UI_SHOWN","hasActed","USER_ACTION_COMPLETE","displayStatus","DisplayStatusCodes","VISIBLE","HIDDEN","undefined","doesGDPRApply","vendor","legitimateInterests","specialFeatureOptins","getSpecialFeatureOptIns","purpose","getPurposeConsents","getPurposesLITransparency","makeFormatConsentString","encode","getConsentString","shift","bitFields","bitString","key","encodeField","hasOwnProperty","call","staticValue","encodedValue","newCoreString","unshift","join","makeGetConsentDataObject","defaultTimestamp","Error"],"sourceRoot":"../../../../src","sources":["iab/tcf/consent.js"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAeA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAOO,MAAMK,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,eAAe,EAAE,IAAI;EACrBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAEC,yBAAc,CAACC,MAAM;EAAE;EAClCC,WAAW,EAAEC,yBAAc,CAACC,SAAS;EAAE;EACvCC,iBAAiB,EAAE,IAAI;EACvBC,oBAAoB,EAAE,IAAI;EAC1BC,mBAAmB,EAAE;AACtB,CAAC;AAEM,MAAMC,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,UAAU,KAAK;EACvD,MAAMC,OAAO,GAAG,IAAAC,qBAAU,EAACH,KAAK,EAAEC,UAAU,CAAC;EAC7C;AACD;AACA;AACA;EACC,MAAMG,aAAa,GAAG,IAAAC,2BAAgB,EAACL,KAAK,EAAEC,UAAU,CAAC;EACzD;AACD;AACA;AACA;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,MAAMqG,aAAa,GAAGX,MAAM,CAACG,SAAS,CAAC;EACvCvE,QAAQ,CAACgF,OAAO,CAACD,aAAa,CAAC;EAC/B,OAAO/E,QAAQ,CAACiF,IAAI,CAAC,GAAG,CAAC;AAC1B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALAvI,OAAA,CAAAyH,uBAAA,GAAAA,uBAAA;AAMO,MAAMe,wBAAwB,GAAG3F,WAAW,IAAIhC,KAAK,IAAI;EAC/D,MAAM;IAAE4H,gBAAgB;IAAEvF;EAAQ,CAAC,GAAGL,WAAW;EACjD,QAAQkB,QAAQ,CAACb,OAAO,EAAE,EAAE,CAAC;IAC5B;IACA,KAAK,CAAC;MAAE;QACP;MACD;IAEA;MAAS;QACR,MAAM,IAAIwF,KAAK,CAAC,qBAAqB,CAAC;MACvC;EACD;;EAEA;EACA;EACA,MAAMrD,IAAI,GAAG;IAAEoD;EAAiB,CAAC;EAEjC,OAAO;IACN,GAAGzD,sBAAsB,CAACnC,WAAW,CAAC,CAACwC,IAAI,EAAExE,KAAK,CAAC;IACnDiC,QAAQ,EAAE2E,uBAAuB,CAAC5E,WAAW,CAAC,CAACwC,IAAI,EAAExE,KAAK;EAC3D,CAAC;AACF,CAAC;AAACb,OAAA,CAAAwI,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","_utils","_selectors","commonConsent","exports","consentLanguage","cmpLoaded","cmpStatus","CMPStatusCodes","LOADED","eventStatus","CMPEventStatus","TC_LOADED","isServiceSpecific","useNonStandardStacks","purposeOneTreatment","getVendorConsents","config","state","apiVersion","vendors","getVendors","optOutVendors","getVendorOptOuts","purposeConsent","consentToPurpose","getSavedConsent","getConsent","consents","Object","entries","reduce","vendorConsents","vendorId","purposes","deletedDate","vendorHasConsent","length","every","purposeId","getVendorLegitimateInterests","optOutPurposes","getPurposeOptOuts","vendorLegitimateInterests","forEach","legIntPurposes","specialPurposes","vendorHasLegitimateInterest","some","makeParseConsentString","initOptions","tcString","encoder","decode","coreFieldSequence","version","cmpId","cmpVersion","segments","split","coreSegment","tcData","tcfPolicyVersion","parseInt","startBit","field","numBits","decodeField","dataField","value","isFinite","slice","bitLength","decodedValue","fieldName","set","makeGetField","parseConsentString","specFieldMode","requestedField","get","makeConsentFromOptions","fallbackGvlVersion","gppSection","staticFields","dynamicFields","gdprApplies","publisherCC","country","currentScreen","getCurrentScreen","isShowingUi","willShowUi","isSaved","gvlVersion","vendorListVersion","dynamicConsent","acc","getter","CMP_UI_SHOWN","hasActed","USER_ACTION_COMPLETE","displayStatus","DisplayStatusCodes","VISIBLE","HIDDEN","language","toUpperCase","vendor","legitimateInterests","specialFeatureOptins","getSpecialFeatureOptIns","purpose","getPurposeConsents","getPurposesLITransparency","makeFormatConsentString","encode","filter","Boolean","shift","bitFields","bitString","key","encodeField","hasOwnProperty","call","staticValue","process","env","NODE_ENV","console","log","JSON","stringify","encodedValue","newCoreString","unshift","join","makeReadFromStorage","storage","tcf"],"sourceRoot":"../../../../src","sources":["iab/tcf/consent.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AAFA;AACA;;AAkBO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC5BE,eAAe,EAAE,IAAI;EACrBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAEC,yBAAc,CAACC,MAAM;EAAE;EAClCC,WAAW,EAAEC,yBAAc,CAACC,SAAS;EAAE;EACvCC,iBAAiB,EAAE,IAAI;EACvBC,oBAAoB,EAAE,IAAI;EAC1BC,mBAAmB,EAAE;AACtB,CAAC;AAEM,MAAMC,iBAAiB,GAAGA,CAChCC,MAAqB,EACrBC,KAA4B,EAC5BC,UAA0B,KACtB;EACJ,MAAMC,OAAO,GAAGH,MAAM,CAACI,UAAU,CAAC,CAAC;EACnC;AACD;AACA;AACA;EACC,MAAMC,aAAa,G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,CAAC,GAAGL,WAAW;EAC/B,OAAQyF,OAAwB,IAAK;IACpC,OAAO;MACNC,GAAG,EAAE;QACJ,CAAE,IAAG7E,QAAQ,CAACR,OAAO,EAAE,EAAE,CAAE,EAAC,GAAGoF,OAAO,IAAI,CAAC;MAC5C;IACD,CAAC;EACF,CAAC;AACF,CAAC;AAACvI,OAAA,CAAAsI,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -20,13 +20,13 @@ const DisplayStatusCodes = exports.DisplayStatusCodes = {
20
20
  HIDDEN: 'hidden',
21
21
  DISABLED: 'disabled'
22
22
  };
23
- const purposeIds = exports.purposeIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
23
+ const purposeIds = exports.purposeIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
24
24
  const purposeMap = exports.purposeMap = {
25
- [_constants.ConsentCategory.ESSENTIAL]: [],
26
- [_constants.ConsentCategory.ANALYTICS]: [8, 10],
25
+ [_constants.ConsentCategory.ESSENTIAL]: [1],
26
+ [_constants.ConsentCategory.ANALYTICS]: [7, 8, 9, 10],
27
27
  [_constants.ConsentCategory.STORAGE]: [1],
28
- [_constants.ConsentCategory.MARKETING]: [2, 7, 9],
29
- [_constants.ConsentCategory.PERSONALIZATION]: [3, 4, 5, 6],
28
+ [_constants.ConsentCategory.MARKETING]: [2, 3, 4],
29
+ [_constants.ConsentCategory.PERSONALIZATION]: [5, 6, 11],
30
30
  [_constants.ConsentCategory.OPT_OUT]: []
31
31
  };
32
32
  const consentToPurpose = (consent = {}, apiVersion = '2') => {
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","CMPEventStatus","exports","TC_LOADED","CMP_UI_SHOWN","USER_ACTION_COMPLETE","CMPStatusCodes","STUB","LOADED","ERROR","DisplayStatusCodes","VISIBLE","HIDDEN","DISABLED","purposeIds","purposeMap","ConsentCategory","ESSENTIAL","ANALYTICS","STORAGE","MARKETING","PERSONALIZATION","OPT_OUT","consentToPurpose","consent","apiVersion","parseInt","Object","entries","reduce","consents","category","purposes","forEach","purpose"],"sourceRoot":"../../../../src","sources":["iab/tcf/constants.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAKO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC7BE,SAAS,EAAE,UAAU;EACrBC,YAAY,EAAE,YAAY;EAC1BC,oBAAoB,EAAE;AACvB,CAAC;AAEM,MAAMC,cAAc,GAAAJ,OAAA,CAAAI,cAAA,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE;AACR,CAAC;AAEM,MAAMC,kBAAkB,GAAAR,OAAA,CAAAQ,kBAAA,GAAG;EACjCC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE;AACX,CAAC;AAEM,MAAMC,UAAU,GAAAZ,OAAA,CAAAY,UAAA,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAClD,MAAMC,UAAiD,GAAAb,OAAA,CAAAa,UAAA,GAAG;EAChE,CAACC,0BAAe,CAACC,SAAS,GAAG,EAAE;EAC/B,CAACD,0BAAe,CAACE,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;EACpC,CAACF,0BAAe,CAACG,OAAO,GAAG,CAAC,CAAC,CAAC;EAC9B,CAACH,0BAAe,CAACI,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACtC,CAACJ,0BAAe,CAACK,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EAC/C,CAACL,0BAAe,CAACM,OAAO,GAAG;AAC5B,CAAC;AAEM,MAAMC,gBAAgB,GAAGA,CAC/BC,OAAsD,GAAG,CAAC,CAAC,EAC3DC,UAAU,GAAG,GAAG,KACZ;EACJ,IAAIC,QAAQ,CAACD,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;IAClC,OAAOE,MAAM,CAACC,OAAO,CAACb,UAAU,CAAC,CAACc,MAAM,CACvC,CAACC,QAAQ,EAAE,CAACC,QAAQ,EAAEC,QAAQ,CAAC,KAAK;MACnCA,QAAQ,CAACC,OAAO,CAACC,OAAO,IAAI;QAC3BJ,QAAQ,CAAE,GAAEI,OAAQ,EAAC,CAAC,GACrB,CAAC,CAACV,OAAO,CAAE,GAAEO,QAAgC,EAAC,CAAC;MACjD,CAAC,CAAC;MACF,OAAOD,QAAQ;IAChB,CAAC,EACD,CAAC,CACF,CAAC;EACF;EACA,OAAO,CAAC,CAAC;AACV,CAAC;AAAC5B,OAAA,CAAAqB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","CMPEventStatus","exports","TC_LOADED","CMP_UI_SHOWN","USER_ACTION_COMPLETE","CMPStatusCodes","STUB","LOADED","ERROR","DisplayStatusCodes","VISIBLE","HIDDEN","DISABLED","purposeIds","purposeMap","ConsentCategory","ESSENTIAL","ANALYTICS","STORAGE","MARKETING","PERSONALIZATION","OPT_OUT","consentToPurpose","consent","apiVersion","parseInt","Object","entries","reduce","consents","category","purposes","forEach","purpose"],"sourceRoot":"../../../../src","sources":["iab/tcf/constants.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAKO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC7BE,SAAS,EAAE,UAAU;EACrBC,YAAY,EAAE,YAAY;EAC1BC,oBAAoB,EAAE;AACvB,CAAC;AAEM,MAAMC,cAAc,GAAAJ,OAAA,CAAAI,cAAA,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE;AACR,CAAC;AAEM,MAAMC,kBAAkB,GAAAR,OAAA,CAAAQ,k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;IAChB,CAAC,EACD,CAAC,CACF,CAAC;EACF;EACA,OAAO,CAAC,CAAC;AACV,CAAC;AAAC5B,OAAA,CAAAqB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updateVendorOptOuts = exports.updateSpecialFeatureOptIns = exports.updatePurposeOptOuts = exports.idRecordToBinaryString = exports.createUTCTimestampInDeciseconds = void 0;
7
+ var _selectors = require("./selectors");
8
+ var _formatters = require("./v2.0/formatters");
9
+ var _selectors2 = require("../../selectors");
10
+ /*
11
+ * TCF Amendment - 21 December 2021
12
+ * Created and LastUpdated fields have been updated to have the same value
13
+ * corresponding to the ** day-level ** timestamp of when the TC String
14
+ * was last updated. Timestamp should maintain 36bit depth (deciseconds),
15
+ * but hours, minutes, seconds and milliseconds should be 0.
16
+ */
17
+
18
+ const createUTCTimestampInDeciseconds = ({
19
+ defaultTimestamp = 0
20
+ }, state) => {
21
+ const consentDate = new Date((0, _selectors2.getConsentTimestamp)(state) || defaultTimestamp);
22
+ const utc = Date.UTC(consentDate.getUTCFullYear(), consentDate.getUTCMonth(), consentDate.getUTCDate());
23
+ // Make sure the timestamp is > 0 otherwise the TCF Int parser fails
24
+ return Math.round(Math.max(0, utc) / 100);
25
+ };
26
+ exports.createUTCTimestampInDeciseconds = createUTCTimestampInDeciseconds;
27
+ const idRecordToBinaryString = records => (0, _formatters.fixedValuesArrayFormatter)(records, Object.keys(records).map(key => parseInt(key, 10)).reduce((a, b) => Math.max(a, b), 0)).map(value => value ? '1' : '0').join('');
28
+ exports.idRecordToBinaryString = idRecordToBinaryString;
29
+ const updateSpecialFeatureOptIns = (state, version, specialFeatureIds, acceptOrDeny) => {
30
+ const specialFeatureOptins = {
31
+ ...(0, _selectors.getSpecialFeatureOptIns)(state, version)
32
+ };
33
+ for (const specialFeatureId of specialFeatureIds) {
34
+ if (acceptOrDeny) {
35
+ specialFeatureOptins[`${specialFeatureId}`] = true;
36
+ } else {
37
+ delete specialFeatureOptins[`${specialFeatureId}`];
38
+ }
39
+ }
40
+ return specialFeatureOptins;
41
+ };
42
+ exports.updateSpecialFeatureOptIns = updateSpecialFeatureOptIns;
43
+ const updatePurposeOptOuts = (state, version, purposeIds, acceptOrDeny) => {
44
+ const purposeOptOuts = {
45
+ ...(0, _selectors.getPurposeOptOuts)(state, version)
46
+ };
47
+ // ACCEPT on "I Object" means OptOut is TRUE
48
+ for (const purposeId of purposeIds) {
49
+ if (acceptOrDeny) {
50
+ purposeOptOuts[`${purposeId}`] = true;
51
+ } else {
52
+ delete purposeOptOuts[`${purposeId}`];
53
+ }
54
+ }
55
+ return purposeOptOuts;
56
+ };
57
+ exports.updatePurposeOptOuts = updatePurposeOptOuts;
58
+ const updateVendorOptOuts = (state, version, vendorIds, acceptOrDeny) => {
59
+ const vendorOptOuts = {
60
+ ...(0, _selectors.getVendorOptOuts)(state, version)
61
+ };
62
+ for (const vendorId of vendorIds) {
63
+ if (acceptOrDeny === false) {
64
+ vendorOptOuts[`${vendorId}`] = true;
65
+ } else {
66
+ delete vendorOptOuts[`${vendorId}`];
67
+ }
68
+ }
69
+ return vendorOptOuts;
70
+ };
71
+ exports.updateVendorOptOuts = updateVendorOptOuts;
72
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_selectors","require","_formatters","_selectors2","createUTCTimestampInDeciseconds","defaultTimestamp","state","consentDate","Date","getConsentTimestamp","utc","UTC","getUTCFullYear","getUTCMonth","getUTCDate","Math","round","max","exports","idRecordToBinaryString","records","fixedValuesArrayFormatter","Object","keys","map","key","parseInt","reduce","a","b","value","join","updateSpecialFeatureOptIns","version","specialFeatureIds","acceptOrDeny","specialFeatureOptins","getSpecialFeatureOptIns","specialFeatureId","updatePurposeOptOuts","purposeIds","purposeOptOuts","getPurposeOptOuts","purposeId","updateVendorOptOuts","vendorIds","vendorOptOuts","getVendorOptO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AAC,MAAM;MACN,OAAOF,aAAa,CAAE,GAAEE,QAAS,EAAC,CAAC;IACpC;EACD;EACA,OAAOF,aAAa;AACrB,CAAC;AAAC5B,OAAA,CAAA0B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _reducer = _interopRequireDefault(require("./reducer"));
7
+ var selectors = _interopRequireWildcard(require("./selectors"));
8
8
  var _v = _interopRequireDefault(require("./v2.0"));
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
12
  var _default = exports.default = {
11
- reducer: _reducer.default,
12
- versions: _v.default
13
+ ..._v.default,
14
+ selectors
13
15
  };
14
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reducer","_interopRequireDefault","require","_v","obj","__esModule","default","_default","exports","reducer","versions"],"sourceRoot":"../../../../src","sources":["iab/tcf/index.js"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,EAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA8B,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEf;EACdG,OAAO,EAAPA,gBAAO;EACPC,QAAQ,EAARA;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["selectors","_interopRequireWildcard","require","_v","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_default","exports","versions"],"sourceRoot":"../../../../src","sources":["iab/tcf/index.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,EAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8B,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAd,CAAA,EAAAY,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAX,CAAA,EAAAY,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAZ,CAAA,CAAAY,CAAA,YAAAN,CAAA,CAAAR,OAAA,GAAAE,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAa,GAAA,CAAAhB,CAAA,EAAAM,CAAA,GAAAA,CAAA;AAAA,IAAAW,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEf;EACd,GAAGqB,UAAQ;EACX5B;AACD,CAAC","ignoreList":[]}
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeMiddleware = exports.default = void 0;
7
+ var _actions = require("../../actions");
8
+ var _actions2 = require("./actions");
9
+ var _actions3 = require("../actions");
10
+ var _OsanoCmp = require("../../native/OsanoCmp");
11
+ var _selectors = require("./selectors");
12
+ var _helpers = require("./helpers");
13
+ var _consent = require("./consent");
14
+ var _reactNative = require("react-native");
15
+ // @ts-nocheck
16
+
17
+ const makeMiddleware = initOptions => {
18
+ const {
19
+ createConsentPayload,
20
+ gppSection,
21
+ version
22
+ } = initOptions;
23
+ const parseConsentString = (0, _consent.makeParseConsentString)(initOptions);
24
+ const formatConsentString = (0, _consent.makeFormatConsentString)(initOptions);
25
+ return store => next => action => {
26
+ const oldState = store.getState();
27
+ const newState = next(action);
28
+ const {
29
+ type,
30
+ payload
31
+ } = action;
32
+ const {
33
+ config,
34
+ configId
35
+ } = newState;
36
+ newState.iab.tcf = newState.iab.tcf || {};
37
+ newState.iab.tcf.v2 = newState.iab.tcf.v2 || {};
38
+ switch (type) {
39
+ case _actions.RELOAD:
40
+ case _actions.SET_CONFIG:
41
+ {
42
+ const {
43
+ config
44
+ } = payload;
45
+ const resConsent = jsonString => {
46
+ let payload = createConsentPayload();
47
+ if (jsonString) {
48
+ try {
49
+ payload = JSON.parse(jsonString);
50
+ // Store the TcString
51
+ store.dispatch((0, _actions3.setConsentData)(gppSection, formatConsentString(config, newState)));
52
+ } catch (e) {
53
+ payload = createConsentPayload();
54
+ }
55
+ }
56
+ store.dispatch((0, _actions2.setConsent)(payload));
57
+ };
58
+ switch (_reactNative.Platform.OS) {
59
+ case 'ios':
60
+ case 'android':
61
+ (0, _OsanoCmp.getStorage)(`${gppSection}_${configId}`).then(resConsent).catch(() => {
62
+ // Consent not found
63
+ (0, _OsanoCmp.clearStorage)(`${gppSection}_${configId}`);
64
+ });
65
+ break;
66
+ default:
67
+ try {
68
+ resConsent(window.localStorage.getItem(`${gppSection}_${configId}`));
69
+ } catch (e) {
70
+ window.localStorage.removeItem(`${gppSection}_${configId}`);
71
+ }
72
+ break;
73
+ }
74
+ break;
75
+ }
76
+ case _actions.CLEAR_CONSENT:
77
+ {
78
+ switch (_reactNative.Platform.OS) {
79
+ case 'ios':
80
+ case 'android':
81
+ (0, _OsanoCmp.clearStorage)(`${gppSection}_${configId}`);
82
+ break;
83
+ default:
84
+ try {
85
+ window.localStorage.removeItem(`${gppSection}_${configId}`);
86
+ } catch {}
87
+ break;
88
+ }
89
+ store.dispatch((0, _actions3.setConsentData)(gppSection, ''));
90
+ break;
91
+ }
92
+ case _actions2.SET_ALL_PURPOSE_CONSENT:
93
+ {
94
+ const acceptOrDeny = payload;
95
+ const purposeIds = (0, _selectors.getPurposeIds)();
96
+ newState.iab.tcf.v2.purposeOptouts = (0, _helpers.updatePurposeOptOuts)(newState, version, purposeIds, acceptOrDeny);
97
+ break;
98
+ }
99
+ case _actions2.SET_ALL_SPECIAL_FEATURE_CONSENT:
100
+ {
101
+ const acceptOrDeny = payload;
102
+ const specialFeatureIds = new Set(Object.values(config?.getVendors() || {}).map(vendor => vendor.specialPurposes).reduce((acc, ids) => acc.concat(ids), []));
103
+ newState.iab.tcf.v2.specialFeatureOptins = (0, _helpers.updateSpecialFeatureOptIns)(newState, version, Array.from(specialFeatureIds), acceptOrDeny);
104
+ break;
105
+ }
106
+ case _actions2.SET_ALL_VENDOR_CONSENT:
107
+ {
108
+ const acceptOrDeny = payload;
109
+ const vendorIds = config?.getVendorIds() ?? [];
110
+ newState.iab.tcf.v2.vendorOptouts = (0, _helpers.updateVendorOptOuts)(newState, version, vendorIds, acceptOrDeny);
111
+ break;
112
+ }
113
+ case _actions.CLOSE:
114
+ {
115
+ const {
116
+ config
117
+ } = payload;
118
+ store.dispatch((0, _actions3.setConsentData)(gppSection, formatConsentString(config, newState)));
119
+ break;
120
+ }
121
+ case _actions3.SET_CONSENT_DATA:
122
+ {
123
+ // by the time we get here in the middleware, the reducers should have already set the tcString
124
+ const {
125
+ gppSection,
126
+ value
127
+ } = action.payload;
128
+ if (gppSection === initOptions.gppSection) {
129
+ const {
130
+ cmpId,
131
+ cmpVersion,
132
+ storageKey
133
+ } = initOptions;
134
+ const currentTcString = (0, _selectors.getConsentString)(oldState, initOptions);
135
+ if (value === currentTcString) {
136
+ // no change
137
+ break;
138
+ }
139
+ console.log(`\nSetting new consent string\n -> ${value}`);
140
+ const consent = parseConsentString(value);
141
+ (0, _OsanoCmp.setStorage)(storageKey, value);
142
+ (0, _OsanoCmp.setStorage)('IABTCF_CmpSdkID', cmpId.toString());
143
+ (0, _OsanoCmp.setStorage)('IABTCF_CmpSdkVersion', cmpVersion.toString());
144
+ (0, _OsanoCmp.setStorage)('IABTCF_PolicyVersion', version);
145
+ (0, _OsanoCmp.setStorage)('IABTCF_PublisherCC', consent.publisherCC);
146
+ (0, _OsanoCmp.setStorage)('IABTCF_gdprApplies', consent.gdprApplies ? '1' : '0');
147
+ (0, _OsanoCmp.setStorage)('IABTCF_PurposeOneTreatment', consent.purposeOneTreatment ? '1' : '0');
148
+ (0, _OsanoCmp.setStorage)('IABTCF_UseNonStandardTexts', consent.useNonStandardStacks ? '1' : '0');
149
+
150
+ // The following all have to be binary strings
151
+ (0, _OsanoCmp.setStorage)('IABTCF_VendorConsents', (0, _helpers.idRecordToBinaryString)(consent.vendor.consents));
152
+ (0, _OsanoCmp.setStorage)('IABTCF_VendorLegitimateInterests', (0, _helpers.idRecordToBinaryString)(consent.vendor.legitimateInterests));
153
+ (0, _OsanoCmp.setStorage)('IABTCF_PurposeConsents', (0, _helpers.idRecordToBinaryString)(consent.purpose.consents));
154
+ (0, _OsanoCmp.setStorage)('IABTCF_PurposeLegitimateInterests', (0, _helpers.idRecordToBinaryString)(consent.purpose.legitimateInterests));
155
+ (0, _OsanoCmp.setStorage)('IABTCF_SpecialFeaturesOptIns', (0, _helpers.idRecordToBinaryString)(consent.specialFeatureOptins));
156
+ // Publisher restrictions are not yet supported
157
+ /*
158
+ 'IABTCF_PublisherRestrictions',
159
+ 'IABTCF_PublisherConsent'
160
+ 'IABTCF_PublisherLegitimateInterests'
161
+ 'IABTCF_PublisherCustomPurposesConsents'
162
+ 'IABTCF_PublisherCustomPurposesLegitimateInterests'
163
+ */
164
+ }
165
+ }
166
+ }
167
+ return newState;
168
+ };
169
+ };
170
+ exports.makeMiddleware = makeMiddleware;
171
+ var _default = exports.default = makeMiddleware;
172
+ //# sourceMappingURL=middleware.js.map