@osano/osano-cmp-react-native 0.1.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.
- package/LICENSE +20 -0
- package/README.dev.md +58 -0
- package/README.md +1 -0
- package/android/build.gradle +94 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +72 -0
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKPackage.kt +17 -0
- package/ios/OsanoCmpSDK.mm +43 -0
- package/ios/OsanoCmpSdk.h +12 -0
- package/lib/commonjs/ConsentManager.js +529 -0
- package/lib/commonjs/ConsentManager.js.map +1 -0
- package/lib/commonjs/ConsentUiBuilder.js +75 -0
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -0
- package/lib/commonjs/components/Button.js +222 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +75 -0
- package/lib/commonjs/components/Checkbox.js.map +1 -0
- package/lib/commonjs/components/Divider.js +22 -0
- package/lib/commonjs/components/Divider.js.map +1 -0
- package/lib/commonjs/components/ExpansionPanel.js +70 -0
- package/lib/commonjs/components/ExpansionPanel.js.map +1 -0
- package/lib/commonjs/components/Link.js +51 -0
- package/lib/commonjs/components/Link.js.map +1 -0
- package/lib/commonjs/components/List.js +36 -0
- package/lib/commonjs/components/List.js.map +1 -0
- package/lib/commonjs/components/Locale.js +28 -0
- package/lib/commonjs/components/Locale.js.map +1 -0
- package/lib/commonjs/components/StoragePolicyLink.js +32 -0
- package/lib/commonjs/components/StoragePolicyLink.js.map +1 -0
- package/lib/commonjs/components/Toggle.js +113 -0
- package/lib/commonjs/components/Toggle.js.map +1 -0
- package/lib/commonjs/constants.js +37 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/context.js +40 -0
- package/lib/commonjs/context.js.map +1 -0
- package/lib/commonjs/flavors/five.json +11 -0
- package/lib/commonjs/flavors/four.json +11 -0
- package/lib/commonjs/flavors/index.js +32 -0
- package/lib/commonjs/flavors/index.js.map +1 -0
- package/lib/commonjs/flavors/one.json +11 -0
- package/lib/commonjs/flavors/six.json +12 -0
- package/lib/commonjs/flavors/three.json +11 -0
- package/lib/commonjs/flavors/two.json +11 -0
- package/lib/commonjs/hooks/useBoundCallback.js +32 -0
- package/lib/commonjs/hooks/useBoundCallback.js.map +1 -0
- package/lib/commonjs/hooks/useDeviceOrientation.js +20 -0
- package/lib/commonjs/hooks/useDeviceOrientation.js.map +1 -0
- package/lib/commonjs/hooks/usePrevious.js +15 -0
- package/lib/commonjs/hooks/usePrevious.js.map +1 -0
- package/lib/commonjs/hooks/useThunkReducer.js +62 -0
- package/lib/commonjs/hooks/useThunkReducer.js.map +1 -0
- package/lib/commonjs/iab/constants.js +8 -0
- package/lib/commonjs/iab/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/api.js +226 -0
- package/lib/commonjs/iab/gpp/api.js.map +1 -0
- package/lib/commonjs/iab/gpp/consent.js +99 -0
- package/lib/commonjs/iab/gpp/consent.js.map +1 -0
- package/lib/commonjs/iab/gpp/constants.js +56 -0
- package/lib/commonjs/iab/gpp/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.js +139 -0
- package/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/BooleanEncoder.js +47 -0
- package/lib/commonjs/iab/gpp/encoders/BooleanEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.js +49 -0
- package/lib/commonjs/iab/gpp/encoders/CompressedBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.js +48 -0
- package/lib/commonjs/iab/gpp/encoders/DatetimeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.js +184 -0
- package/lib/commonjs/iab/gpp/encoders/EncodableOptimizedFixedRange.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.js +81 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js +104 -0
- package/lib/commonjs/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.js +56 -0
- package/lib/commonjs/iab/gpp/encoders/FixedBitfieldEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.js +27 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIdBitMapEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js +62 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.js +71 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerListEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.js +88 -0
- package/lib/commonjs/iab/gpp/encoders/FixedIntegerRangeEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.js +68 -0
- package/lib/commonjs/iab/gpp/encoders/FixedStringEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js +46 -0
- package/lib/commonjs/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/errors.js +42 -0
- package/lib/commonjs/iab/gpp/encoders/errors.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/index.js +105 -0
- package/lib/commonjs/iab/gpp/encoders/index.js.map +1 -0
- package/lib/commonjs/iab/gpp/encoders/types.js +2 -0
- package/lib/commonjs/iab/gpp/encoders/types.js.map +1 -0
- package/lib/commonjs/iab/gpp/index.js +16 -0
- package/lib/commonjs/iab/gpp/index.js.map +1 -0
- package/lib/commonjs/iab/gpp/reducer.js +12 -0
- package/lib/commonjs/iab/gpp/reducer.js.map +1 -0
- package/lib/commonjs/iab/gpp/selectors.js +25 -0
- package/lib/commonjs/iab/gpp/selectors.js.map +1 -0
- package/lib/commonjs/iab/gpp/types.js +2 -0
- package/lib/commonjs/iab/gpp/types.js.map +1 -0
- package/lib/commonjs/iab/gpp/v1/constants.js +16 -0
- package/lib/commonjs/iab/gpp/v1/constants.js.map +1 -0
- package/lib/commonjs/iab/gpp/v1/index.js +73 -0
- package/lib/commonjs/iab/gpp/v1/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/actions.js +20 -0
- package/lib/commonjs/iab/tcf/actions.js.map +1 -0
- package/lib/commonjs/iab/tcf/consent.js +306 -0
- package/lib/commonjs/iab/tcf/consent.js.map +1 -0
- package/lib/commonjs/iab/tcf/constants.js +44 -0
- package/lib/commonjs/iab/tcf/constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +14 -0
- package/lib/commonjs/iab/tcf/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/reducer.js +57 -0
- package/lib/commonjs/iab/tcf/reducer.js.map +1 -0
- package/lib/commonjs/iab/tcf/selectors.js +158 -0
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -0
- package/lib/commonjs/iab/tcf/tcfcav1-api.js +41 -0
- package/lib/commonjs/iab/tcf/tcfcav1-api.js.map +1 -0
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js +256 -0
- package/lib/commonjs/iab/tcf/tcfeuv2-api.js.map +1 -0
- package/lib/commonjs/iab/tcf/types.js +6 -0
- package/lib/commonjs/iab/tcf/types.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/encoders.js +39 -0
- package/lib/commonjs/iab/tcf/v2.0/encoders.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/formatters.js +21 -0
- package/lib/commonjs/iab/tcf/v2.0/formatters.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/helpers.js +25 -0
- package/lib/commonjs/iab/tcf/v2.0/helpers.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/index.js +39 -0
- package/lib/commonjs/iab/tcf/v2.0/index.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/middleware.js +80 -0
- package/lib/commonjs/iab/tcf/v2.0/middleware.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/reducer.js +318 -0
- package/lib/commonjs/iab/tcf/v2.0/reducer.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +22 -0
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js +63 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js +92 -0
- package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -0
- package/lib/commonjs/iab/types.js +6 -0
- package/lib/commonjs/iab/types.js.map +1 -0
- package/lib/commonjs/iab/usp/api.js +59 -0
- package/lib/commonjs/iab/usp/api.js.map +1 -0
- package/lib/commonjs/iab/usp/consent.js +140 -0
- package/lib/commonjs/iab/usp/consent.js.map +1 -0
- package/lib/commonjs/iab/usp/constants.js +46 -0
- package/lib/commonjs/iab/usp/constants.js.map +1 -0
- package/lib/commonjs/iab/usp/index.js +16 -0
- package/lib/commonjs/iab/usp/index.js.map +1 -0
- package/lib/commonjs/iab/usp/reducer.js +121 -0
- package/lib/commonjs/iab/usp/reducer.js.map +1 -0
- package/lib/commonjs/iab/usp/selectors.js +35 -0
- package/lib/commonjs/iab/usp/selectors.js.map +1 -0
- package/lib/commonjs/iab/usp/types.js +2 -0
- package/lib/commonjs/iab/usp/types.js.map +1 -0
- package/lib/commonjs/iab/usp/v1/constants.js +16 -0
- package/lib/commonjs/iab/usp/v1/constants.js.map +1 -0
- package/lib/commonjs/iab/usp/v1/index.js +58 -0
- package/lib/commonjs/iab/usp/v1/index.js.map +1 -0
- package/lib/commonjs/iab/utilities.js +16 -0
- package/lib/commonjs/iab/utilities.js.map +1 -0
- package/lib/commonjs/index.js +129 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/locale/af.json +306 -0
- package/lib/commonjs/locale/ar.json +306 -0
- package/lib/commonjs/locale/bg.json +306 -0
- package/lib/commonjs/locale/ca.json +306 -0
- package/lib/commonjs/locale/cs.json +306 -0
- package/lib/commonjs/locale/da.json +306 -0
- package/lib/commonjs/locale/de-at.json +306 -0
- package/lib/commonjs/locale/de.json +306 -0
- package/lib/commonjs/locale/el.json +306 -0
- package/lib/commonjs/locale/en-au.json +306 -0
- package/lib/commonjs/locale/en-ca.json +306 -0
- package/lib/commonjs/locale/en-gb.json +306 -0
- package/lib/commonjs/locale/en.json +306 -0
- package/lib/commonjs/locale/es-mx.json +306 -0
- package/lib/commonjs/locale/es.json +306 -0
- package/lib/commonjs/locale/et.json +306 -0
- package/lib/commonjs/locale/fa.json +306 -0
- package/lib/commonjs/locale/fi.json +306 -0
- package/lib/commonjs/locale/fr-ca.json +306 -0
- package/lib/commonjs/locale/fr.json +306 -0
- package/lib/commonjs/locale/gd.json +306 -0
- package/lib/commonjs/locale/he.json +306 -0
- package/lib/commonjs/locale/hi.json +306 -0
- package/lib/commonjs/locale/hr.json +306 -0
- package/lib/commonjs/locale/hu.json +306 -0
- package/lib/commonjs/locale/hy.json +306 -0
- package/lib/commonjs/locale/id.json +306 -0
- package/lib/commonjs/locale/index.js +427 -0
- package/lib/commonjs/locale/index.js.map +1 -0
- package/lib/commonjs/locale/is.json +306 -0
- package/lib/commonjs/locale/it.json +306 -0
- package/lib/commonjs/locale/ja.json +306 -0
- package/lib/commonjs/locale/kk.json +306 -0
- package/lib/commonjs/locale/ko.json +306 -0
- package/lib/commonjs/locale/lt.json +306 -0
- package/lib/commonjs/locale/lv.json +306 -0
- package/lib/commonjs/locale/mi.json +306 -0
- package/lib/commonjs/locale/ms.json +306 -0
- package/lib/commonjs/locale/nb.json +306 -0
- package/lib/commonjs/locale/nl-be.json +306 -0
- package/lib/commonjs/locale/nl.json +306 -0
- package/lib/commonjs/locale/nn.json +306 -0
- package/lib/commonjs/locale/no.json +306 -0
- package/lib/commonjs/locale/pl.json +306 -0
- package/lib/commonjs/locale/pt-br.json +306 -0
- package/lib/commonjs/locale/pt.json +306 -0
- package/lib/commonjs/locale/ro.json +306 -0
- package/lib/commonjs/locale/ru.json +306 -0
- package/lib/commonjs/locale/sk.json +306 -0
- package/lib/commonjs/locale/sl.json +306 -0
- package/lib/commonjs/locale/sq.json +306 -0
- package/lib/commonjs/locale/sr.json +306 -0
- package/lib/commonjs/locale/sv.json +306 -0
- package/lib/commonjs/locale/th.json +306 -0
- package/lib/commonjs/locale/tl.json +306 -0
- package/lib/commonjs/locale/tr.json +306 -0
- package/lib/commonjs/locale/uk.json +306 -0
- package/lib/commonjs/locale/vi.json +306 -0
- package/lib/commonjs/locale/zh-hk.json +306 -0
- package/lib/commonjs/locale/zh-tw.json +306 -0
- package/lib/commonjs/locale/zh.json +306 -0
- package/lib/commonjs/locale/zu.json +306 -0
- package/lib/commonjs/native/OsanoCmp.js +33 -0
- package/lib/commonjs/native/OsanoCmp.js.map +1 -0
- package/lib/commonjs/services/consent.js +134 -0
- package/lib/commonjs/services/consent.js.map +1 -0
- package/lib/commonjs/services/disclosures.js +25 -0
- package/lib/commonjs/services/disclosures.js.map +1 -0
- package/lib/commonjs/services/locale.js +40 -0
- package/lib/commonjs/services/locale.js.map +1 -0
- package/lib/commonjs/store.js +558 -0
- package/lib/commonjs/store.js.map +1 -0
- package/lib/commonjs/styles.js +186 -0
- package/lib/commonjs/styles.js.map +1 -0
- package/lib/commonjs/types/consent-config.d.js +6 -0
- package/lib/commonjs/types/consent-config.d.js.map +1 -0
- package/lib/commonjs/types/env.d.js +2 -0
- package/lib/commonjs/types/env.d.js.map +1 -0
- package/lib/commonjs/types/index.d.js +6 -0
- package/lib/commonjs/types/index.d.js.map +1 -0
- package/lib/commonjs/types/store.d.js +6 -0
- package/lib/commonjs/types/store.d.js.map +1 -0
- package/lib/commonjs/utils/API.js +43 -0
- package/lib/commonjs/utils/API.js.map +1 -0
- package/lib/commonjs/utils/Color.js +99 -0
- package/lib/commonjs/utils/Color.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +53 -0
- package/lib/commonjs/utils/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/Translator.js +222 -0
- package/lib/commonjs/utils/Translator.js.map +1 -0
- package/lib/commonjs/utils/index.js +116 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/views/Dialog/Buttons.js +76 -0
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -0
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js +44 -0
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js.map +1 -0
- package/lib/commonjs/views/Dialog/Message.js +30 -0
- package/lib/commonjs/views/Dialog/Message.js.map +1 -0
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +46 -0
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -0
- package/lib/commonjs/views/Dialog/index.js +314 -0
- package/lib/commonjs/views/Dialog/index.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +627 -0
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Header.js +120 -0
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +311 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +458 -0
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -0
- package/lib/commonjs/views/Drawer/index.js +208 -0
- package/lib/commonjs/views/Drawer/index.js.map +1 -0
- package/lib/module/ConsentManager.js +520 -0
- package/lib/module/ConsentManager.js.map +1 -0
- package/lib/module/ConsentUiBuilder.js +66 -0
- package/lib/module/ConsentUiBuilder.js.map +1 -0
- package/lib/module/components/Button.js +205 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Checkbox.js +65 -0
- package/lib/module/components/Checkbox.js.map +1 -0
- package/lib/module/components/Divider.js +14 -0
- package/lib/module/components/Divider.js.map +1 -0
- package/lib/module/components/ExpansionPanel.js +60 -0
- package/lib/module/components/ExpansionPanel.js.map +1 -0
- package/lib/module/components/Link.js +42 -0
- package/lib/module/components/Link.js.map +1 -0
- package/lib/module/components/List.js +28 -0
- package/lib/module/components/List.js.map +1 -0
- package/lib/module/components/Locale.js +21 -0
- package/lib/module/components/Locale.js.map +1 -0
- package/lib/module/components/StoragePolicyLink.js +24 -0
- package/lib/module/components/StoragePolicyLink.js.map +1 -0
- package/lib/module/components/Toggle.js +103 -0
- package/lib/module/components/Toggle.js.map +1 -0
- package/lib/module/constants.js +31 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/context.js +33 -0
- package/lib/module/context.js.map +1 -0
- package/lib/module/flavors/five.json +11 -0
- package/lib/module/flavors/four.json +11 -0
- package/lib/module/flavors/index.js +26 -0
- package/lib/module/flavors/index.js.map +1 -0
- package/lib/module/flavors/one.json +11 -0
- package/lib/module/flavors/six.json +12 -0
- package/lib/module/flavors/three.json +11 -0
- package/lib/module/flavors/two.json +11 -0
- package/lib/module/hooks/useBoundCallback.js +25 -0
- package/lib/module/hooks/useBoundCallback.js.map +1 -0
- package/lib/module/hooks/useDeviceOrientation.js +13 -0
- package/lib/module/hooks/useDeviceOrientation.js.map +1 -0
- package/lib/module/hooks/usePrevious.js +9 -0
- package/lib/module/hooks/usePrevious.js.map +1 -0
- package/lib/module/hooks/useThunkReducer.js +54 -0
- package/lib/module/hooks/useThunkReducer.js.map +1 -0
- package/lib/module/iab/constants.js +2 -0
- package/lib/module/iab/constants.js.map +1 -0
- package/lib/module/iab/gpp/api.js +220 -0
- package/lib/module/iab/gpp/api.js.map +1 -0
- package/lib/module/iab/gpp/consent.js +89 -0
- package/lib/module/iab/gpp/consent.js.map +1 -0
- package/lib/module/iab/gpp/constants.js +50 -0
- package/lib/module/iab/gpp/constants.js.map +1 -0
- package/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.js +132 -0
- package/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/BooleanEncoder.js +39 -0
- package/lib/module/iab/gpp/encoders/BooleanEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.js +38 -0
- package/lib/module/iab/gpp/encoders/CompressedBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/DatetimeEncoder.js +40 -0
- package/lib/module/iab/gpp/encoders/DatetimeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.js +177 -0
- package/lib/module/iab/gpp/encoders/EncodableOptimizedFixedRange.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.js +73 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js +96 -0
- package/lib/module/iab/gpp/encoders/FibonacciIntegerRangeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.js +48 -0
- package/lib/module/iab/gpp/encoders/FixedBitfieldEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.js +21 -0
- package/lib/module/iab/gpp/encoders/FixedIdBitMapEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js +55 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.js +63 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerListEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.js +80 -0
- package/lib/module/iab/gpp/encoders/FixedIntegerRangeEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/FixedStringEncoder.js +60 -0
- package/lib/module/iab/gpp/encoders/FixedStringEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js +35 -0
- package/lib/module/iab/gpp/encoders/TraditionalBase64UrlEncoder.js.map +1 -0
- package/lib/module/iab/gpp/encoders/errors.js +31 -0
- package/lib/module/iab/gpp/encoders/errors.js.map +1 -0
- package/lib/module/iab/gpp/encoders/index.js +15 -0
- package/lib/module/iab/gpp/encoders/index.js.map +1 -0
- package/lib/module/iab/gpp/encoders/types.js +2 -0
- package/lib/module/iab/gpp/encoders/types.js.map +1 -0
- package/lib/module/iab/gpp/index.js +9 -0
- package/lib/module/iab/gpp/index.js.map +1 -0
- package/lib/module/iab/gpp/reducer.js +6 -0
- package/lib/module/iab/gpp/reducer.js.map +1 -0
- package/lib/module/iab/gpp/selectors.js +14 -0
- package/lib/module/iab/gpp/selectors.js.map +1 -0
- package/lib/module/iab/gpp/types.js +2 -0
- package/lib/module/iab/gpp/types.js.map +1 -0
- package/lib/module/iab/gpp/v1/constants.js +10 -0
- package/lib/module/iab/gpp/v1/constants.js.map +1 -0
- package/lib/module/iab/gpp/v1/index.js +65 -0
- package/lib/module/iab/gpp/v1/index.js.map +1 -0
- package/lib/module/iab/tcf/actions.js +14 -0
- package/lib/module/iab/tcf/actions.js.map +1 -0
- package/lib/module/iab/tcf/consent.js +293 -0
- package/lib/module/iab/tcf/consent.js.map +1 -0
- package/lib/module/iab/tcf/constants.js +37 -0
- package/lib/module/iab/tcf/constants.js.map +1 -0
- package/lib/module/iab/tcf/index.js +7 -0
- package/lib/module/iab/tcf/index.js.map +1 -0
- package/lib/module/iab/tcf/reducer.js +51 -0
- package/lib/module/iab/tcf/reducer.js.map +1 -0
- package/lib/module/iab/tcf/selectors.js +124 -0
- package/lib/module/iab/tcf/selectors.js.map +1 -0
- package/lib/module/iab/tcf/tcfcav1-api.js +35 -0
- package/lib/module/iab/tcf/tcfcav1-api.js.map +1 -0
- package/lib/module/iab/tcf/tcfeuv2-api.js +251 -0
- package/lib/module/iab/tcf/tcfeuv2-api.js.map +1 -0
- package/lib/module/iab/tcf/types.js +2 -0
- package/lib/module/iab/tcf/types.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/encoders.js +28 -0
- package/lib/module/iab/tcf/v2.0/encoders.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/formatters.js +12 -0
- package/lib/module/iab/tcf/v2.0/formatters.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/helpers.js +18 -0
- package/lib/module/iab/tcf/v2.0/helpers.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/index.js +33 -0
- package/lib/module/iab/tcf/v2.0/index.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/middleware.js +74 -0
- package/lib/module/iab/tcf/v2.0/middleware.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/reducer.js +311 -0
- package/lib/module/iab/tcf/v2.0/reducer.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/shared-constants.js +16 -0
- package/lib/module/iab/tcf/v2.0/shared-constants.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js +57 -0
- package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -0
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js +85 -0
- package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -0
- package/lib/module/iab/types.js +2 -0
- package/lib/module/iab/types.js.map +1 -0
- package/lib/module/iab/usp/api.js +53 -0
- package/lib/module/iab/usp/api.js.map +1 -0
- package/lib/module/iab/usp/consent.js +129 -0
- package/lib/module/iab/usp/consent.js.map +1 -0
- package/lib/module/iab/usp/constants.js +38 -0
- package/lib/module/iab/usp/constants.js.map +1 -0
- package/lib/module/iab/usp/index.js +9 -0
- package/lib/module/iab/usp/index.js.map +1 -0
- package/lib/module/iab/usp/reducer.js +115 -0
- package/lib/module/iab/usp/reducer.js.map +1 -0
- package/lib/module/iab/usp/selectors.js +25 -0
- package/lib/module/iab/usp/selectors.js.map +1 -0
- package/lib/module/iab/usp/types.js +2 -0
- package/lib/module/iab/usp/types.js.map +1 -0
- package/lib/module/iab/usp/v1/constants.js +10 -0
- package/lib/module/iab/usp/v1/constants.js.map +1 -0
- package/lib/module/iab/usp/v1/index.js +51 -0
- package/lib/module/iab/usp/v1/index.js.map +1 -0
- package/lib/module/iab/utilities.js +9 -0
- package/lib/module/iab/utilities.js.map +1 -0
- package/lib/module/index.js +114 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/locale/af.json +306 -0
- package/lib/module/locale/ar.json +306 -0
- package/lib/module/locale/bg.json +306 -0
- package/lib/module/locale/ca.json +306 -0
- package/lib/module/locale/cs.json +306 -0
- package/lib/module/locale/da.json +306 -0
- package/lib/module/locale/de-at.json +306 -0
- package/lib/module/locale/de.json +306 -0
- package/lib/module/locale/el.json +306 -0
- package/lib/module/locale/en-au.json +306 -0
- package/lib/module/locale/en-ca.json +306 -0
- package/lib/module/locale/en-gb.json +306 -0
- package/lib/module/locale/en.json +306 -0
- package/lib/module/locale/es-mx.json +306 -0
- package/lib/module/locale/es.json +306 -0
- package/lib/module/locale/et.json +306 -0
- package/lib/module/locale/fa.json +306 -0
- package/lib/module/locale/fi.json +306 -0
- package/lib/module/locale/fr-ca.json +306 -0
- package/lib/module/locale/fr.json +306 -0
- package/lib/module/locale/gd.json +306 -0
- package/lib/module/locale/he.json +306 -0
- package/lib/module/locale/hi.json +306 -0
- package/lib/module/locale/hr.json +306 -0
- package/lib/module/locale/hu.json +306 -0
- package/lib/module/locale/hy.json +306 -0
- package/lib/module/locale/id.json +306 -0
- package/lib/module/locale/index.js +61 -0
- package/lib/module/locale/index.js.map +1 -0
- package/lib/module/locale/is.json +306 -0
- package/lib/module/locale/it.json +306 -0
- package/lib/module/locale/ja.json +306 -0
- package/lib/module/locale/kk.json +306 -0
- package/lib/module/locale/ko.json +306 -0
- package/lib/module/locale/lt.json +306 -0
- package/lib/module/locale/lv.json +306 -0
- package/lib/module/locale/mi.json +306 -0
- package/lib/module/locale/ms.json +306 -0
- package/lib/module/locale/nb.json +306 -0
- package/lib/module/locale/nl-be.json +306 -0
- package/lib/module/locale/nl.json +306 -0
- package/lib/module/locale/nn.json +306 -0
- package/lib/module/locale/no.json +306 -0
- package/lib/module/locale/pl.json +306 -0
- package/lib/module/locale/pt-br.json +306 -0
- package/lib/module/locale/pt.json +306 -0
- package/lib/module/locale/ro.json +306 -0
- package/lib/module/locale/ru.json +306 -0
- package/lib/module/locale/sk.json +306 -0
- package/lib/module/locale/sl.json +306 -0
- package/lib/module/locale/sq.json +306 -0
- package/lib/module/locale/sr.json +306 -0
- package/lib/module/locale/sv.json +306 -0
- package/lib/module/locale/th.json +306 -0
- package/lib/module/locale/tl.json +306 -0
- package/lib/module/locale/tr.json +306 -0
- package/lib/module/locale/uk.json +306 -0
- package/lib/module/locale/vi.json +306 -0
- package/lib/module/locale/zh-hk.json +306 -0
- package/lib/module/locale/zh-tw.json +306 -0
- package/lib/module/locale/zh.json +306 -0
- package/lib/module/locale/zu.json +306 -0
- package/lib/module/native/OsanoCmp.js +24 -0
- package/lib/module/native/OsanoCmp.js.map +1 -0
- package/lib/module/services/consent.js +123 -0
- package/lib/module/services/consent.js.map +1 -0
- package/lib/module/services/disclosures.js +18 -0
- package/lib/module/services/disclosures.js.map +1 -0
- package/lib/module/services/locale.js +32 -0
- package/lib/module/services/locale.js.map +1 -0
- package/lib/module/store.js +520 -0
- package/lib/module/store.js.map +1 -0
- package/lib/module/styles.js +178 -0
- package/lib/module/styles.js.map +1 -0
- package/lib/module/types/consent-config.d.js +2 -0
- package/lib/module/types/consent-config.d.js.map +1 -0
- package/lib/module/types/env.d.js +2 -0
- package/lib/module/types/env.d.js.map +1 -0
- package/lib/module/types/index.d.js +2 -0
- package/lib/module/types/index.d.js.map +1 -0
- package/lib/module/types/store.d.js +2 -0
- package/lib/module/types/store.d.js.map +1 -0
- package/lib/module/utils/API.js +37 -0
- package/lib/module/utils/API.js.map +1 -0
- package/lib/module/utils/Color.js +82 -0
- package/lib/module/utils/Color.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +45 -0
- package/lib/module/utils/EventEmitter.js.map +1 -0
- package/lib/module/utils/Translator.js +215 -0
- package/lib/module/utils/Translator.js.map +1 -0
- package/lib/module/utils/index.js +107 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/views/Dialog/Buttons.js +67 -0
- package/lib/module/views/Dialog/Buttons.js.map +1 -0
- package/lib/module/views/Dialog/FirstLayerUsage.js +34 -0
- package/lib/module/views/Dialog/FirstLayerUsage.js.map +1 -0
- package/lib/module/views/Dialog/Message.js +20 -0
- package/lib/module/views/Dialog/Message.js.map +1 -0
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js +36 -0
- package/lib/module/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -0
- package/lib/module/views/Dialog/index.js +304 -0
- package/lib/module/views/Dialog/index.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js +617 -0
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Header.js +110 -0
- package/lib/module/views/Drawer/Drawer.Header.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +301 -0
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -0
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js +448 -0
- package/lib/module/views/Drawer/Drawer.Iab.Vendors.js.map +1 -0
- package/lib/module/views/Drawer/index.js +198 -0
- package/lib/module/views/Drawer/index.js.map +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +123 -0
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -0
- package/lib/typescript/src/ConsentUiBuilder.d.ts +13 -0
- package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -0
- package/lib/typescript/src/components/Button.d.ts +22 -0
- package/lib/typescript/src/components/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Checkbox.d.ts +12 -0
- package/lib/typescript/src/components/Checkbox.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider.d.ts +9 -0
- package/lib/typescript/src/components/Divider.d.ts.map +1 -0
- package/lib/typescript/src/components/ExpansionPanel.d.ts +10 -0
- package/lib/typescript/src/components/ExpansionPanel.d.ts.map +1 -0
- package/lib/typescript/src/components/Link.d.ts +9 -0
- package/lib/typescript/src/components/Link.d.ts.map +1 -0
- package/lib/typescript/src/components/List.d.ts +10 -0
- package/lib/typescript/src/components/List.d.ts.map +1 -0
- package/lib/typescript/src/components/Locale.d.ts +10 -0
- package/lib/typescript/src/components/Locale.d.ts.map +1 -0
- package/lib/typescript/src/components/StoragePolicyLink.d.ts +4 -0
- package/lib/typescript/src/components/StoragePolicyLink.d.ts.map +1 -0
- package/lib/typescript/src/components/Toggle.d.ts +12 -0
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +17 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/context.d.ts +34 -0
- package/lib/typescript/src/context.d.ts.map +1 -0
- package/lib/typescript/src/flavors/index.d.ts +21 -0
- package/lib/typescript/src/flavors/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useBoundCallback.d.ts +17 -0
- package/lib/typescript/src/hooks/useBoundCallback.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useDeviceOrientation.d.ts +4 -0
- package/lib/typescript/src/hooks/useDeviceOrientation.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePrevious.d.ts +2 -0
- package/lib/typescript/src/hooks/usePrevious.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useThunkReducer.d.ts +23 -0
- package/lib/typescript/src/hooks/useThunkReducer.d.ts.map +1 -0
- package/lib/typescript/src/iab/constants.d.ts +2 -0
- package/lib/typescript/src/iab/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts +34 -0
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/CompressedBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts +16 -0
- package/lib/typescript/src/iab/gpp/encoders/EncodableOptimizedFixedRange.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts +6 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIdBitMapEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts +28 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts +26 -0
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts +26 -0
- package/lib/typescript/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/errors.d.ts +19 -0
- package/lib/typescript/src/iab/gpp/encoders/errors.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/index.d.ts +16 -0
- package/lib/typescript/src/iab/gpp/encoders/index.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/encoders/types.d.ts +5 -0
- package/lib/typescript/src/iab/gpp/encoders/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/gpp/types.d.ts +3 -0
- package/lib/typescript/src/iab/gpp/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts +20 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/types.d.ts +12 -0
- package/lib/typescript/src/iab/tcf/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts +8 -0
- package/lib/typescript/src/iab/tcf/v2.0/encoders.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts +5 -0
- package/lib/typescript/src/iab/tcf/v2.0/helpers.d.ts.map +1 -0
- package/lib/typescript/src/iab/types.d.ts +63 -0
- package/lib/typescript/src/iab/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/usp/types.d.ts +5 -0
- package/lib/typescript/src/iab/usp/types.d.ts.map +1 -0
- package/lib/typescript/src/iab/utilities.d.ts +3 -0
- package/lib/typescript/src/iab/utilities.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts +5 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -0
- package/lib/typescript/src/services/consent.d.ts +17 -0
- package/lib/typescript/src/services/consent.d.ts.map +1 -0
- package/lib/typescript/src/services/disclosures.d.ts +2 -0
- package/lib/typescript/src/services/disclosures.d.ts.map +1 -0
- package/lib/typescript/src/services/locale.d.ts +4 -0
- package/lib/typescript/src/services/locale.d.ts.map +1 -0
- package/lib/typescript/src/store.d.ts +55 -0
- package/lib/typescript/src/store.d.ts.map +1 -0
- package/lib/typescript/src/styles.d.ts +141 -0
- package/lib/typescript/src/styles.d.ts.map +1 -0
- package/lib/typescript/src/utils/API.d.ts +6 -0
- package/lib/typescript/src/utils/API.d.ts.map +1 -0
- package/lib/typescript/src/utils/Color.d.ts +12 -0
- package/lib/typescript/src/utils/Color.d.ts.map +1 -0
- package/lib/typescript/src/utils/EventEmitter.d.ts +15 -0
- package/lib/typescript/src/utils/EventEmitter.d.ts.map +1 -0
- package/lib/typescript/src/utils/Translator.d.ts +61 -0
- package/lib/typescript/src/utils/Translator.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +5 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/Buttons.d.ts +5 -0
- package/lib/typescript/src/views/Dialog/Buttons.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/FirstLayerUsage.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/FirstLayerUsage.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/Message.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/Message.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts +4 -0
- package/lib/typescript/src/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/index.d.ts +5 -0
- package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts +10 -0
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts +4 -0
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -0
- package/lib/typescript/src/views/Drawer/index.d.ts +5 -0
- package/lib/typescript/src/views/Drawer/index.d.ts.map +1 -0
- package/osano-cmp-sdk.podspec +41 -0
- package/package.json +158 -0
- package/src/ConsentManager.ts +622 -0
- package/src/ConsentUiBuilder.tsx +117 -0
- package/src/components/Button.tsx +204 -0
- package/src/components/Checkbox.tsx +86 -0
- package/src/components/Divider.tsx +20 -0
- package/src/components/ExpansionPanel.tsx +72 -0
- package/src/components/Link.tsx +49 -0
- package/src/components/List.tsx +39 -0
- package/src/components/Locale.tsx +38 -0
- package/src/components/StoragePolicyLink.tsx +24 -0
- package/src/components/Toggle.tsx +165 -0
- package/src/constants.ts +34 -0
- package/src/context.ts +79 -0
- package/src/flavors/five.json +11 -0
- package/src/flavors/four.json +11 -0
- package/src/flavors/index.ts +38 -0
- package/src/flavors/one.json +11 -0
- package/src/flavors/six.json +12 -0
- package/src/flavors/three.json +11 -0
- package/src/flavors/two.json +11 -0
- package/src/hooks/useBoundCallback.ts +32 -0
- package/src/hooks/useDeviceOrientation.ts +14 -0
- package/src/hooks/usePrevious.ts +9 -0
- package/src/hooks/useThunkReducer.ts +124 -0
- package/src/iab/constants.ts +1 -0
- package/src/iab/gpp/api.js +253 -0
- package/src/iab/gpp/consent.js +114 -0
- package/src/iab/gpp/constants.js +49 -0
- package/src/iab/gpp/encoders/AbstractBase64UrlEncoder.ts +89 -0
- package/src/iab/gpp/encoders/BooleanEncoder.ts +39 -0
- package/src/iab/gpp/encoders/CompressedBase64UrlEncoder.ts +41 -0
- package/src/iab/gpp/encoders/DatetimeEncoder.ts +46 -0
- package/src/iab/gpp/encoders/EncodableOptimizedFixedRange.ts +213 -0
- package/src/iab/gpp/encoders/FibonacciIntegerEncoder.ts +81 -0
- package/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.ts +122 -0
- package/src/iab/gpp/encoders/FixedBitfieldEncoder.ts +59 -0
- package/src/iab/gpp/encoders/FixedIdBitMapEncoder.ts +30 -0
- package/src/iab/gpp/encoders/FixedIntegerEncoder.ts +61 -0
- package/src/iab/gpp/encoders/FixedIntegerListEncoder.ts +87 -0
- package/src/iab/gpp/encoders/FixedIntegerRangeEncoder.ts +102 -0
- package/src/iab/gpp/encoders/FixedStringEncoder.ts +74 -0
- package/src/iab/gpp/encoders/LICENSE-IABTechLab +176 -0
- package/src/iab/gpp/encoders/TraditionalBase64UrlEncoder.ts +39 -0
- package/src/iab/gpp/encoders/errors.ts +41 -0
- package/src/iab/gpp/encoders/index.ts +15 -0
- package/src/iab/gpp/encoders/types.ts +5 -0
- package/src/iab/gpp/index.js +9 -0
- package/src/iab/gpp/reducer.js +7 -0
- package/src/iab/gpp/selectors.js +21 -0
- package/src/iab/gpp/types.ts +3 -0
- package/src/iab/gpp/v1/constants.js +7 -0
- package/src/iab/gpp/v1/index.js +73 -0
- package/src/iab/tcf/actions.js +52 -0
- package/src/iab/tcf/consent.js +345 -0
- package/src/iab/tcf/constants.ts +51 -0
- package/src/iab/tcf/index.js +7 -0
- package/src/iab/tcf/reducer.js +59 -0
- package/src/iab/tcf/selectors.js +151 -0
- package/src/iab/tcf/tcfcav1-api.js +39 -0
- package/src/iab/tcf/tcfeuv2-api.js +264 -0
- package/src/iab/tcf/types.ts +13 -0
- package/src/iab/tcf/v2.0/encoders.ts +37 -0
- package/src/iab/tcf/v2.0/formatters.js +14 -0
- package/src/iab/tcf/v2.0/helpers.ts +23 -0
- package/src/iab/tcf/v2.0/index.js +36 -0
- package/src/iab/tcf/v2.0/middleware.js +72 -0
- package/src/iab/tcf/v2.0/reducer.js +327 -0
- package/src/iab/tcf/v2.0/shared-constants.js +17 -0
- package/src/iab/tcf/v2.0/tcfcav1-constants.js +115 -0
- package/src/iab/tcf/v2.0/tcfeuv2-constants.js +117 -0
- package/src/iab/types.ts +67 -0
- package/src/iab/usp/api.js +56 -0
- package/src/iab/usp/consent.js +150 -0
- package/src/iab/usp/constants.js +40 -0
- package/src/iab/usp/index.js +9 -0
- package/src/iab/usp/reducer.js +107 -0
- package/src/iab/usp/selectors.js +31 -0
- package/src/iab/usp/types.ts +4 -0
- package/src/iab/usp/v1/constants.js +10 -0
- package/src/iab/usp/v1/index.js +54 -0
- package/src/iab/utilities.ts +17 -0
- package/src/index.tsx +128 -0
- package/src/locale/af.json +306 -0
- package/src/locale/ar.json +306 -0
- package/src/locale/bg.json +306 -0
- package/src/locale/ca.json +306 -0
- package/src/locale/cs.json +306 -0
- package/src/locale/da.json +306 -0
- package/src/locale/de-at.json +306 -0
- package/src/locale/de.json +306 -0
- package/src/locale/el.json +306 -0
- package/src/locale/en-au.json +306 -0
- package/src/locale/en-ca.json +306 -0
- package/src/locale/en-gb.json +306 -0
- package/src/locale/en.json +306 -0
- package/src/locale/es-mx.json +306 -0
- package/src/locale/es.json +306 -0
- package/src/locale/et.json +306 -0
- package/src/locale/fa.json +306 -0
- package/src/locale/fi.json +306 -0
- package/src/locale/fr-ca.json +306 -0
- package/src/locale/fr.json +306 -0
- package/src/locale/gd.json +306 -0
- package/src/locale/he.json +306 -0
- package/src/locale/hi.json +306 -0
- package/src/locale/hr.json +306 -0
- package/src/locale/hu.json +306 -0
- package/src/locale/hy.json +306 -0
- package/src/locale/id.json +306 -0
- package/src/locale/index.js +60 -0
- package/src/locale/is.json +306 -0
- package/src/locale/it.json +306 -0
- package/src/locale/ja.json +306 -0
- package/src/locale/kk.json +306 -0
- package/src/locale/ko.json +306 -0
- package/src/locale/lt.json +306 -0
- package/src/locale/lv.json +306 -0
- package/src/locale/mi.json +306 -0
- package/src/locale/ms.json +306 -0
- package/src/locale/nb.json +306 -0
- package/src/locale/nl-be.json +306 -0
- package/src/locale/nl.json +306 -0
- package/src/locale/nn.json +306 -0
- package/src/locale/no.json +306 -0
- package/src/locale/pl.json +306 -0
- package/src/locale/pt-br.json +306 -0
- package/src/locale/pt.json +306 -0
- package/src/locale/ro.json +306 -0
- package/src/locale/ru.json +306 -0
- package/src/locale/sk.json +306 -0
- package/src/locale/sl.json +306 -0
- package/src/locale/sq.json +306 -0
- package/src/locale/sr.json +306 -0
- package/src/locale/sv.json +306 -0
- package/src/locale/th.json +306 -0
- package/src/locale/tl.json +306 -0
- package/src/locale/tr.json +306 -0
- package/src/locale/uk.json +306 -0
- package/src/locale/vi.json +306 -0
- package/src/locale/zh-hk.json +306 -0
- package/src/locale/zh-tw.json +306 -0
- package/src/locale/zh.json +306 -0
- package/src/locale/zu.json +306 -0
- package/src/native/OsanoCmp.ts +32 -0
- package/src/services/consent.ts +164 -0
- package/src/services/disclosures.ts +25 -0
- package/src/services/locale.ts +43 -0
- package/src/store.ts +602 -0
- package/src/styles.ts +203 -0
- package/src/types/consent-config.d.ts +72 -0
- package/src/types/env.d.ts +2 -0
- package/src/types/index.d.ts +18 -0
- package/src/types/store.d.ts +43 -0
- package/src/utils/API.ts +47 -0
- package/src/utils/Color.ts +127 -0
- package/src/utils/EventEmitter.ts +54 -0
- package/src/utils/Translator.ts +326 -0
- package/src/utils/index.ts +133 -0
- package/src/views/Dialog/Buttons.tsx +71 -0
- package/src/views/Dialog/FirstLayerUsage.tsx +33 -0
- package/src/views/Dialog/Message.tsx +37 -0
- package/src/views/Dialog/PreferenceManagementDeepLinks.tsx +33 -0
- package/src/views/Dialog/index.tsx +442 -0
- package/src/views/Drawer/Drawer.ConsentCategories.tsx +689 -0
- package/src/views/Drawer/Drawer.Header.tsx +138 -0
- package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +386 -0
- package/src/views/Drawer/Drawer.Iab.Vendors.tsx +552 -0
- package/src/views/Drawer/index.tsx +294 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from IABTechLab's GPP JavaScript Reference Implementation
|
|
3
|
+
*
|
|
4
|
+
* https://github.com/IABTechLab/iabgpp-es/blob/42060d7ac2b6d0ee70fc1b5bcd33fc447bf5123c/modules/cmpapi/src/encoder/datatype/encoder/TraditionalBase64UrlEncoder.ts
|
|
5
|
+
*
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2023 IABTechLab
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
10
|
+
* use this file except in compliance with the License. You may obtain a copy of
|
|
11
|
+
* the License at
|
|
12
|
+
*
|
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
17
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
18
|
+
* License for the specific language governing permissions and limitations under
|
|
19
|
+
* the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { decode, makeEncode } from './AbstractBase64UrlEncoder';
|
|
23
|
+
const pad = bitString => {
|
|
24
|
+
while (bitString.length % 24 > 0) {
|
|
25
|
+
bitString += '0';
|
|
26
|
+
}
|
|
27
|
+
return bitString;
|
|
28
|
+
};
|
|
29
|
+
export const encode = makeEncode(pad);
|
|
30
|
+
export { decode } from './AbstractBase64UrlEncoder';
|
|
31
|
+
export default {
|
|
32
|
+
decode,
|
|
33
|
+
encode
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TraditionalBase64UrlEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decode","makeEncode","pad","bitString","length","encode"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/TraditionalBase64UrlEncoder.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,EAAEC,UAAU,QAAQ,4BAA4B;AAG/D,MAAMC,GAAG,GAAIC,SAAiB,IAAK;EAClC,OAAOA,SAAS,CAACC,MAAM,GAAG,EAAE,GAAG,CAAC,EAAE;IACjCD,SAAS,IAAI,GAAG;EACjB;EACA,OAAOA,SAAS;AACjB,CAAC;AAED,OAAO,MAAME,MAAM,GAAGJ,UAAU,CAACC,GAAG,CAAC;AAErC,SAASF,MAAM,QAAQ,4BAA4B;AAEnD,eAAe;EACdA,MAAM;EACNK;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class InvalidBitStringError extends Error {
|
|
2
|
+
constructor(value) {
|
|
3
|
+
super(value);
|
|
4
|
+
this.name = 'InvalidBitStringError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class InvalidBase64UrlError extends Error {
|
|
8
|
+
constructor(value) {
|
|
9
|
+
super(value);
|
|
10
|
+
this.name = 'InvalidBase64UrlError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class InvalidSizeError extends Error {
|
|
14
|
+
constructor(value, bits) {
|
|
15
|
+
super(`Value ${value} does not fit in ${bits} bits`);
|
|
16
|
+
this.name = 'InvalidSizeError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class BitStringParametersMatchError extends Error {
|
|
20
|
+
constructor(bitString, parameters) {
|
|
21
|
+
super(`'${bitString}' does not match given parameters ${JSON.stringify(parameters)}`);
|
|
22
|
+
this.name = 'BitStringParameterMatchError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class InvalidStringCharacterError extends Error {
|
|
26
|
+
constructor(value) {
|
|
27
|
+
super(value);
|
|
28
|
+
this.name = 'InvalidStringCharacterError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InvalidBitStringError","Error","constructor","value","name","InvalidBase64UrlError","InvalidSizeError","bits","BitStringParametersMatchError","bitString","parameters","JSON","stringify","InvalidStringCharacterError"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/errors.ts"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,SAASC,KAAK,CAAC;EAChDC,WAAWA,CAACC,KAAyB,EAAE;IACtC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,IAAI,GAAG,uBAAuB;EACpC;AACD;AAEA,OAAO,MAAMC,qBAAqB,SAASJ,KAAK,CAAC;EAChDC,WAAWA,CAACC,KAAyB,EAAE;IACtC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,IAAI,GAAG,uBAAuB;EACpC;AACD;AAEA,OAAO,MAAME,gBAAgB,SAASL,KAAK,CAAC;EAC3CC,WAAWA,CAACC,KAAa,EAAEI,IAAY,EAAE;IACxC,KAAK,CAAE,SAAQJ,KAAM,oBAAmBI,IAAK,OAAM,CAAC;IACpD,IAAI,CAACH,IAAI,GAAG,kBAAkB;EAC/B;AACD;AAEA,OAAO,MAAMI,6BAA6B,SAASP,KAAK,CAAC;EACxDC,WAAWA,CACVO,SAAiB,EACjBC,UAAmE,EAClE;IACD,KAAK,CACH,IAAGD,SAAU,qCAAoCE,IAAI,CAACC,SAAS,CAC/DF,UACD,CAAE,EACH,CAAC;IACD,IAAI,CAACN,IAAI,GAAG,8BAA8B;EAC3C;AACD;AAEA,OAAO,MAAMS,2BAA2B,SAASZ,KAAK,CAAC;EACtDC,WAAWA,CAACC,KAAyB,EAAE;IACtC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,IAAI,GAAG,6BAA6B;EAC1C;AACD","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as AbstractBase64UrlEncoder } from './AbstractBase64UrlEncoder';
|
|
2
|
+
export { default as BooleanEncoder } from './BooleanEncoder';
|
|
3
|
+
export { default as CompressedBase64UrlEncoder } from './CompressedBase64UrlEncoder';
|
|
4
|
+
export { default as DatetimeEncoder } from './DatetimeEncoder';
|
|
5
|
+
export { default as EncodableOptimizedFixedRange } from './EncodableOptimizedFixedRange';
|
|
6
|
+
export { default as FibonacciIntegerEncoder } from './FibonacciIntegerEncoder';
|
|
7
|
+
export { default as FibonacciIntegerRangeEncoder } from './FibonacciIntegerRangeEncoder';
|
|
8
|
+
export { default as FixedBitfieldEncoder } from './FixedBitfieldEncoder';
|
|
9
|
+
export { default as FixedIdBitMapEncoder } from './FixedIdBitMapEncoder';
|
|
10
|
+
export { default as FixedIntegerEncoder } from './FixedIntegerEncoder';
|
|
11
|
+
export { default as FixedIntegerListEncoder } from './FixedIntegerListEncoder';
|
|
12
|
+
export { default as FixedIntegerRangeEncoder } from './FixedIntegerRangeEncoder';
|
|
13
|
+
export { default as FixedStringEncoder } from './FixedStringEncoder';
|
|
14
|
+
export { default as TraditionalBase64UrlEncoder } from './TraditionalBase64UrlEncoder';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","AbstractBase64UrlEncoder","BooleanEncoder","CompressedBase64UrlEncoder","DatetimeEncoder","EncodableOptimizedFixedRange","FibonacciIntegerEncoder","FibonacciIntegerRangeEncoder","FixedBitfieldEncoder","FixedIdBitMapEncoder","FixedIntegerEncoder","FixedIntegerListEncoder","FixedIntegerRangeEncoder","FixedStringEncoder","TraditionalBase64UrlEncoder"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/index.ts"],"mappings":"AACA,SAASA,OAAO,IAAIC,wBAAwB,QAAQ,4BAA4B;AAChF,SAASD,OAAO,IAAIE,cAAc,QAAQ,kBAAkB;AAC5D,SAASF,OAAO,IAAIG,0BAA0B,QAAQ,8BAA8B;AACpF,SAASH,OAAO,IAAII,eAAe,QAAQ,mBAAmB;AAC9D,SAASJ,OAAO,IAAIK,4BAA4B,QAAQ,gCAAgC;AACxF,SAASL,OAAO,IAAIM,uBAAuB,QAAQ,2BAA2B;AAC9E,SAASN,OAAO,IAAIO,4BAA4B,QAAQ,gCAAgC;AACxF,SAASP,OAAO,IAAIQ,oBAAoB,QAAQ,wBAAwB;AACxE,SAASR,OAAO,IAAIS,oBAAoB,QAAQ,wBAAwB;AACxE,SAAST,OAAO,IAAIU,mBAAmB,QAAQ,uBAAuB;AACtE,SAASV,OAAO,IAAIW,uBAAuB,QAAQ,2BAA2B;AAC9E,SAASX,OAAO,IAAIY,wBAAwB,QAAQ,4BAA4B;AAChF,SAASZ,OAAO,IAAIa,kBAAkB,QAAQ,sBAAsB;AACpE,SAASb,OAAO,IAAIc,2BAA2B,QAAQ,+BAA+B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reducer","v1_0","versions"],"sourceRoot":"../../../../src","sources":["iab/gpp/index.js"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,IAAI,MAAM,MAAM;AAEvB,eAAe;EACdD,OAAO;EACPE,QAAQ,EAAE;IACTD;EACD;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["genericReducer","initialState","iab"],"sourceRoot":"../../../../src","sources":["iab/gpp/reducer.js"],"mappings":"AAAA,SAASA,cAAc,QAAQ,qBAAqB;AAEpD,OAAO,MAAMC,YAAY,GAAG;EAC3BC,GAAG,EAAE,CAAC;AACP,CAAC;AAED,eAAeF,cAAc,CAACC,YAAY,EAAE,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SECTIONS } from './constants';
|
|
2
|
+
import { ScreenIds } from '../../constants';
|
|
3
|
+
import { get } from '../../utils';
|
|
4
|
+
export const isUiVisible = state => get(state, 'ui.currentScreen', ScreenIds.None) !== ScreenIds.None;
|
|
5
|
+
export const getSupportedApis = state =>
|
|
6
|
+
// We check state to filter out any unloaded section (e.g. if this is the
|
|
7
|
+
// non-IAB build then 'tcfeuv2' should not be returned because it's not
|
|
8
|
+
// available) and then use the SECTIONS constant to filter out any
|
|
9
|
+
// consentStrings that aren't in the spec.
|
|
10
|
+
Object.keys(get(state, 'iab.consentStrings', {})).filter(section => !!SECTIONS[`${section}`]);
|
|
11
|
+
export const doesGDPRApply = state => get(state, 'config.gdprApplies', false).toString() === 'true';
|
|
12
|
+
export const isBrowsingFrom = (state, jurisdiction) => get(state, 'config.jurisdiction', '').substring(0, jurisdiction.length) === jurisdiction;
|
|
13
|
+
export const getConsentString = (state, section) => get(state, `iab.consentStrings.${section}`, undefined);
|
|
14
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SECTIONS","ScreenIds","get","isUiVisible","state","None","getSupportedApis","Object","keys","filter","section","doesGDPRApply","toString","isBrowsingFrom","jurisdiction","substring","length","getConsentString","undefined"],"sourceRoot":"../../../../src","sources":["iab/gpp/selectors.js"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,GAAG,QAAQ,aAAa;AAEjC,OAAO,MAAMC,WAAW,GAAGC,KAAK,IAC/BF,GAAG,CAACE,KAAK,EAAE,kBAAkB,EAAEH,SAAS,CAACI,IAAI,CAAC,KAAKJ,SAAS,CAACI,IAAI;AAClE,OAAO,MAAMC,gBAAgB,GAAGF,KAAK;AACpC;AACA;AACA;AACA;AACAG,MAAM,CAACC,IAAI,CAACN,GAAG,CAACE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,CAAC,CAACK,MAAM,CACvDC,OAAO,IAAI,CAAC,CAACV,QAAQ,CAAE,GAAEU,OAAQ,EAAC,CACnC,CAAC;AACF,OAAO,MAAMC,aAAa,GAAGP,KAAK,IACjCF,GAAG,CAACE,KAAK,EAAE,oBAAoB,EAAE,KAAK,CAAC,CAACQ,QAAQ,CAAC,CAAC,KAAK,MAAM;AAC9D,OAAO,MAAMC,cAAc,GAAGA,CAACT,KAAK,EAAEU,YAAY,KACjDZ,GAAG,CAACE,KAAK,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAACW,SAAS,CAAC,CAAC,EAAED,YAAY,CAACE,MAAM,CAAC,KACvEF,YAAY;AACb,OAAO,MAAMG,gBAAgB,GAAGA,CAACb,KAAK,EAAEM,OAAO,KAC9CR,GAAG,CAACE,KAAK,EAAG,sBAAqBM,OAAQ,EAAC,EAAEQ,SAAS,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["iab/gpp/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const apiName = '__gpp';
|
|
2
|
+
// gppSection is the key in redux state that stores the consent string.
|
|
3
|
+
export const gppSection = 'gpp';
|
|
4
|
+
export const iframeName = '__gppLocator';
|
|
5
|
+
export const version = '1.0';
|
|
6
|
+
export const initOptions = {
|
|
7
|
+
gppSection,
|
|
8
|
+
version
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["apiName","gppSection","iframeName","version","initOptions"],"sourceRoot":"../../../../../src","sources":["iab/gpp/v1/constants.js"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,OAAO;AAC9B;AACA,OAAO,MAAMC,UAAU,GAAG,KAAK;AAC/B,OAAO,MAAMC,UAAU,GAAG,cAAc;AACxC,OAAO,MAAMC,OAAO,GAAG,KAAK;AAE5B,OAAO,MAAMC,WAAW,GAAG;EAAEH,UAAU;EAAEE;AAAQ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { apiName, gppSection, iframeName, initOptions } from './constants';
|
|
2
|
+
import { getConsentString, getSupportedApis, isUiVisible } from '../selectors';
|
|
3
|
+
import { types as ActionTypes } from '../../../redux/actions';
|
|
4
|
+
import { EventNames } from '../constants';
|
|
5
|
+
import makeApi from '../api';
|
|
6
|
+
import { makeFormatPingData } from '../consent';
|
|
7
|
+
import postMessageEventHandler from '../../iframe';
|
|
8
|
+
import { setConsentData } from '../../actions';
|
|
9
|
+
const formatPingData = makeFormatPingData(initOptions);
|
|
10
|
+
export function createMiddleware({
|
|
11
|
+
dispatchEvent
|
|
12
|
+
} = {}) {
|
|
13
|
+
return store => next => action => {
|
|
14
|
+
const previousState = store.getState();
|
|
15
|
+
const result = next(action);
|
|
16
|
+
const {
|
|
17
|
+
payload,
|
|
18
|
+
type
|
|
19
|
+
} = action;
|
|
20
|
+
const newState = store.getState();
|
|
21
|
+
const pingData = formatPingData(newState);
|
|
22
|
+
switch (type) {
|
|
23
|
+
case setConsentData.type:
|
|
24
|
+
{
|
|
25
|
+
const sectionIsSupported = getSupportedApis(newState).includes(payload.gppSection);
|
|
26
|
+
if (dispatchEvent && sectionIsSupported && getConsentString(previousState, payload.gppSection) !== payload.value) {
|
|
27
|
+
dispatchEvent({
|
|
28
|
+
eventName: EventNames.SECTION_CHANGED,
|
|
29
|
+
data: payload.gppSection,
|
|
30
|
+
pingData
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case ActionTypes.showDialog:
|
|
36
|
+
case ActionTypes.showDrawer:
|
|
37
|
+
case ActionTypes.showDoNotSell:
|
|
38
|
+
case ActionTypes.hideDialog:
|
|
39
|
+
case ActionTypes.hideDrawer:
|
|
40
|
+
case ActionTypes.hideDoNotSell:
|
|
41
|
+
case ActionTypes.hideAll:
|
|
42
|
+
{
|
|
43
|
+
if (dispatchEvent && isUiVisible(previousState) !== isUiVisible(newState)) {
|
|
44
|
+
dispatchEvent({
|
|
45
|
+
eventName: EventNames.CMP_DISPLAY_STATUS_CHANGED,
|
|
46
|
+
data: pingData.cmpDisplayStatus,
|
|
47
|
+
pingData
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const v1 = {
|
|
57
|
+
api: makeApi(initOptions),
|
|
58
|
+
apiName,
|
|
59
|
+
createMiddleware,
|
|
60
|
+
gppSection,
|
|
61
|
+
iframeName,
|
|
62
|
+
postMessageEventHandler: postMessageEventHandler(apiName)
|
|
63
|
+
};
|
|
64
|
+
export default v1;
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["apiName","gppSection","iframeName","initOptions","getConsentString","getSupportedApis","isUiVisible","types","ActionTypes","EventNames","makeApi","makeFormatPingData","postMessageEventHandler","setConsentData","formatPingData","createMiddleware","dispatchEvent","store","next","action","previousState","getState","result","payload","type","newState","pingData","sectionIsSupported","includes","value","eventName","SECTION_CHANGED","data","showDialog","showDrawer","showDoNotSell","hideDialog","hideDrawer","hideDoNotSell","hideAll","CMP_DISPLAY_STATUS_CHANGED","cmpDisplayStatus","v1","api"],"sourceRoot":"../../../../../src","sources":["iab/gpp/v1/index.js"],"mappings":"AAAA,SAASA,OAAO,EAAEC,UAAU,EAAEC,UAAU,EAAEC,WAAW,QAAQ,aAAa;AAC1E,SAASC,gBAAgB,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,cAAc;AAE9E,SAASC,KAAK,IAAIC,WAAW,QAAQ,wBAAwB;AAC7D,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,OAAO,MAAM,QAAQ;AAC5B,SAASC,kBAAkB,QAAQ,YAAY;AAC/C,OAAOC,uBAAuB,MAAM,cAAc;AAClD,SAASC,cAAc,QAAQ,eAAe;AAE9C,MAAMC,cAAc,GAAGH,kBAAkB,CAACR,WAAW,CAAC;AAEtD,OAAO,SAASY,gBAAgBA,CAAC;EAAEC;AAAc,CAAC,GAAG,CAAC,CAAC,EAAE;EACxD,OAAOC,KAAK,IAAIC,IAAI,IAAIC,MAAM,IAAI;IACjC,MAAMC,aAAa,GAAGH,KAAK,CAACI,QAAQ,CAAC,CAAC;IACtC,MAAMC,MAAM,GAAGJ,IAAI,CAACC,MAAM,CAAC;IAC3B,MAAM;MAAEI,OAAO;MAAEC;IAAK,CAAC,GAAGL,MAAM;IAChC,MAAMM,QAAQ,GAAGR,KAAK,CAACI,QAAQ,CAAC,CAAC;IACjC,MAAMK,QAAQ,GAAGZ,cAAc,CAACW,QAAQ,CAAC;IAEzC,QAAQD,IAAI;MACX,KAAKX,cAAc,CAACW,IAAI;QAAE;UACzB,MAAMG,kBAAkB,GAAGtB,gBAAgB,CAACoB,QAAQ,CAAC,CAACG,QAAQ,CAC7DL,OAAO,CAACtB,UACT,CAAC;UAED,IACCe,aAAa,IACbW,kBAAkB,IAClBvB,gBAAgB,CAACgB,aAAa,EAAEG,OAAO,CAACtB,UAAU,CAAC,KAAKsB,OAAO,CAACM,KAAK,EACpE;YACDb,aAAa,CAAC;cACbc,SAAS,EAAErB,UAAU,CAACsB,eAAe;cACrCC,IAAI,EAAET,OAAO,CAACtB,UAAU;cACxByB;YACD,CAAC,CAAC;UACH;UACA;QACD;MACA,KAAKlB,WAAW,CAACyB,UAAU;MAC3B,KAAKzB,WAAW,CAAC0B,UAAU;MAC3B,KAAK1B,WAAW,CAAC2B,aAAa;MAC9B,KAAK3B,WAAW,CAAC4B,UAAU;MAC3B,KAAK5B,WAAW,CAAC6B,UAAU;MAC3B,KAAK7B,WAAW,CAAC8B,aAAa;MAC9B,KAAK9B,WAAW,CAAC+B,OAAO;QAAE;UACzB,IACCvB,aAAa,IACbV,WAAW,CAACc,aAAa,CAAC,KAAKd,WAAW,CAACmB,QAAQ,CAAC,EACnD;YACDT,aAAa,CAAC;cACbc,SAAS,EAAErB,UAAU,CAAC+B,0BAA0B;cAChDR,IAAI,EAAEN,QAAQ,CAACe,gBAAgB;cAC/Bf;YACD,CAAC,CAAC;UACH;UACA;QACD;IACD;IACA,OAAOJ,MAAM;EACd,CAAC;AACF;AAEA,MAAMoB,EAAE,GAAG;EACVC,GAAG,EAAEjC,OAAO,CAACP,WAAW,CAAC;EACzBH,OAAO;EACPe,gBAAgB;EAChBd,UAAU;EACVC,UAAU;EACVU,uBAAuB,EAAEA,uBAAuB,CAACZ,OAAO;AACzD,CAAC;AAED,eAAe0C,EAAE","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createActionCreator, namedParameters, noParameters, singleParameter } from '../../redux/helpers';
|
|
2
|
+
const prefix = 'OsanoCMP_IAB-TCF';
|
|
3
|
+
export const setPurposeConsent = createActionCreator(`${prefix}/SET_PURPOSE_CONSENT`, namedParameters('purposeId', 'acceptOrDeny'));
|
|
4
|
+
export const setAllPurposeConsent = createActionCreator(`${prefix}/SET_ALL_PURPOSE_CONSENT`, namedParameters('acceptOrDeny'));
|
|
5
|
+
export const setVendorConsent = createActionCreator(`${prefix}/SET_VENDOR_CONSENT`, namedParameters('vendorId', 'acceptOrDeny'));
|
|
6
|
+
export const setAllVendorConsent = createActionCreator(`${prefix}/SET_ALL_VENDOR_CONSENT`, namedParameters('acceptOrDeny'));
|
|
7
|
+
export const setSpecialFeatureConsent = createActionCreator(`${prefix}/SET_SPECIAL_FEATURE_CONSENT`, namedParameters('specialFeatureId', 'acceptOrDeny'));
|
|
8
|
+
export const setAllSpecialFeatureConsent = createActionCreator(`${prefix}/SET_ALL_SPECIAL_FEATURE_CONSENT`, namedParameters('acceptOrDeny'));
|
|
9
|
+
export const setGdprApplies = createActionCreator(`${prefix}/SET_GDPR_APPLIES`, singleParameter);
|
|
10
|
+
export const updatePurposeList = createActionCreator(`${prefix}/UPDATE_PURPOSE_LIST`, namedParameters('purposeList', 'language'));
|
|
11
|
+
export const updateVendorListBegin = createActionCreator(`${prefix}/UPDATE_VENDOR_LIST_BEGIN`, noParameters);
|
|
12
|
+
export const updateVendorListSuccess = createActionCreator(`${prefix}/UPDATE_VENDOR_LIST_SUCCESS`, singleParameter);
|
|
13
|
+
export const updateVendorListFailure = createActionCreator(`${prefix}/UPDATE_VENDOR_LIST_FAILURE`, singleParameter);
|
|
14
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createActionCreator","namedParameters","noParameters","singleParameter","prefix","setPurposeConsent","setAllPurposeConsent","setVendorConsent","setAllVendorConsent","setSpecialFeatureConsent","setAllSpecialFeatureConsent","setGdprApplies","updatePurposeList","updateVendorListBegin","updateVendorListSuccess","updateVendorListFailure"],"sourceRoot":"../../../../src","sources":["iab/tcf/actions.js"],"mappings":"AAAA,SACCA,mBAAmB,EACnBC,eAAe,EACfC,YAAY,EACZC,eAAe,QACT,qBAAqB;AAE5B,MAAMC,MAAM,GAAG,kBAAkB;AACjC,OAAO,MAAMC,iBAAiB,GAAGL,mBAAmB,CAClD,GAAEI,MAAO,sBAAqB,EAC/BH,eAAe,CAAC,WAAW,EAAE,cAAc,CAC5C,CAAC;AACD,OAAO,MAAMK,oBAAoB,GAAGN,mBAAmB,CACrD,GAAEI,MAAO,0BAAyB,EACnCH,eAAe,CAAC,cAAc,CAC/B,CAAC;AACD,OAAO,MAAMM,gBAAgB,GAAGP,mBAAmB,CACjD,GAAEI,MAAO,qBAAoB,EAC9BH,eAAe,CAAC,UAAU,EAAE,cAAc,CAC3C,CAAC;AACD,OAAO,MAAMO,mBAAmB,GAAGR,mBAAmB,CACpD,GAAEI,MAAO,yBAAwB,EAClCH,eAAe,CAAC,cAAc,CAC/B,CAAC;AACD,OAAO,MAAMQ,wBAAwB,GAAGT,mBAAmB,CACzD,GAAEI,MAAO,8BAA6B,EACvCH,eAAe,CAAC,kBAAkB,EAAE,cAAc,CACnD,CAAC;AACD,OAAO,MAAMS,2BAA2B,GAAGV,mBAAmB,CAC5D,GAAEI,MAAO,kCAAiC,EAC3CH,eAAe,CAAC,cAAc,CAC/B,CAAC;AACD,OAAO,MAAMU,cAAc,GAAGX,mBAAmB,CAC/C,GAAEI,MAAO,mBAAkB,EAC5BD,eACD,CAAC;AACD,OAAO,MAAMS,iBAAiB,GAAGZ,mBAAmB,CAClD,GAAEI,MAAO,sBAAqB,EAC/BH,eAAe,CAAC,aAAa,EAAE,UAAU,CAC1C,CAAC;AACD,OAAO,MAAMY,qBAAqB,GAAGb,mBAAmB,CACtD,GAAEI,MAAO,2BAA0B,EACpCF,YACD,CAAC;AACD,OAAO,MAAMY,uBAAuB,GAAGd,mBAAmB,CACxD,GAAEI,MAAO,6BAA4B,EACtCD,eACD,CAAC;AACD,OAAO,MAAMY,uBAAuB,GAAGf,mBAAmB,CACxD,GAAEI,MAAO,6BAA4B,EACtCD,eACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { CMPEventStatus, CMPStatusCodes, DisplayStatusCodes, consentToPurpose } from './constants';
|
|
2
|
+
import { Locale, ScreenIds } from '../../constants';
|
|
3
|
+
import { doesGDPRApply, getConsentString, getCurrentScreen, getPublisherCountryCode, getPurposeConsents, getPurposeOptOuts, getPurposesLITransparency, getSpecialFeatureOptIns, getStore, getVendorListVersion, getVendorOptOuts, getVendors, hasActed } from './selectors';
|
|
4
|
+
import { get, merge, set } from '../../utils';
|
|
5
|
+
import { getConsent, getSavedConsent, isConsentReady, isSaved } from '../../redux/selectors';
|
|
6
|
+
export const commonConsent = {
|
|
7
|
+
consentLanguage: 'en',
|
|
8
|
+
cmpLoaded: true,
|
|
9
|
+
cmpStatus: CMPStatusCodes.LOADED,
|
|
10
|
+
// TODO: async CMP load
|
|
11
|
+
eventStatus: CMPEventStatus.TC_LOADED,
|
|
12
|
+
// TODO: async CMP load
|
|
13
|
+
isServiceSpecific: true,
|
|
14
|
+
useNonStandardStacks: true,
|
|
15
|
+
purposeOneTreatment: false
|
|
16
|
+
};
|
|
17
|
+
export const getVendorConsents = (state, apiVersion) => {
|
|
18
|
+
const vendors = getVendors(state, apiVersion);
|
|
19
|
+
/*
|
|
20
|
+
* Unless a user has specifically opted out of a vendor, the consent
|
|
21
|
+
* is determined by purposes and specialFeatures.
|
|
22
|
+
*/
|
|
23
|
+
const optOutVendors = getVendorOptOuts(state, apiVersion);
|
|
24
|
+
/*
|
|
25
|
+
* Vendors may process your information based on purpose consent.
|
|
26
|
+
* If the user has consented to any vendor's purposes the consent
|
|
27
|
+
* is marked as true.
|
|
28
|
+
*/
|
|
29
|
+
const purposeConsent = consentToPurpose(getSavedConsent(state) || getConsent(state), apiVersion);
|
|
30
|
+
const consents = Object.entries(vendors).reduce((vendorConsents, [vendorId, {
|
|
31
|
+
purposes = [],
|
|
32
|
+
deletedDate
|
|
33
|
+
} = {}]) => {
|
|
34
|
+
// We also need to apply IAB rules found here:
|
|
35
|
+
// https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
|
|
36
|
+
// These may need to be updated from time to time.
|
|
37
|
+
|
|
38
|
+
// Note that flexiblePurposes only matter if we support publisher
|
|
39
|
+
// restrictions, which we currently do not. They must have a vendor
|
|
40
|
+
// default (the purpose must be in either consents or
|
|
41
|
+
// legitimateInterests as well as flexiblePurposes) so we will
|
|
42
|
+
// respect that default.
|
|
43
|
+
|
|
44
|
+
// If the vendor has been deleted or the user has opted out of the
|
|
45
|
+
// vendor then the vendor should not be included in consents.
|
|
46
|
+
if (!deletedDate && !optOutVendors[`${vendorId}`]) {
|
|
47
|
+
const vendorHasConsent =
|
|
48
|
+
// If all indicated purposes have been consented to
|
|
49
|
+
purposes.length > 0 && purposes.every(purposeId => purposeConsent[`${purposeId}`]);
|
|
50
|
+
if (vendorHasConsent) {
|
|
51
|
+
vendorConsents[`${vendorId}`] = !optOutVendors[`${vendorId}`];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return vendorConsents;
|
|
55
|
+
}, {});
|
|
56
|
+
return consents;
|
|
57
|
+
};
|
|
58
|
+
export const getVendorLegitimateInterests = (state, apiVersion) => {
|
|
59
|
+
/*
|
|
60
|
+
* Unless a use has specifically opted out of a vendor, the consent
|
|
61
|
+
* is determined by LI.
|
|
62
|
+
*/
|
|
63
|
+
const optOutVendors = getVendorOptOuts(state, apiVersion);
|
|
64
|
+
/*
|
|
65
|
+
* Vendors may have specific legitimate interest purposes.
|
|
66
|
+
* If the user has not objected to the LI purpose, it is
|
|
67
|
+
* marked as true.
|
|
68
|
+
*/
|
|
69
|
+
const optOutPurposes = getPurposeOptOuts(state, apiVersion);
|
|
70
|
+
const vendors = getVendors(state, apiVersion);
|
|
71
|
+
const vendorLegitimateInterests = {};
|
|
72
|
+
Object.entries(vendors).forEach(([vendorId, {
|
|
73
|
+
legIntPurposes = [],
|
|
74
|
+
purposes = [],
|
|
75
|
+
specialPurposes = [],
|
|
76
|
+
deletedDate
|
|
77
|
+
} = {}]) => {
|
|
78
|
+
// We also need to apply IAB rules found here:
|
|
79
|
+
// https://github.com/InteractiveAdvertisingBureau/iabtcf-es/blob/dfc427d015d63d1f5d745c41e77eaae6c5dec2d4/modules/core/src/encoder/SemanticPreEncoder.ts
|
|
80
|
+
// These may need to be updated from time to time.
|
|
81
|
+
|
|
82
|
+
// Note that flexiblePurposes only matter if we support publisher
|
|
83
|
+
// restrictions, which we currently do not. They must have a vendor
|
|
84
|
+
// default (the purpose must be in either consents or
|
|
85
|
+
// legitimateInterests as well as flexiblePurposes) so we will
|
|
86
|
+
// respect that default.
|
|
87
|
+
|
|
88
|
+
// If the vendor has been deleted or the user has opted out of the
|
|
89
|
+
// vendor then the vendor should not be included in LI.
|
|
90
|
+
if (!deletedDate && !optOutVendors[`${vendorId}`]) {
|
|
91
|
+
const vendorHasLegitimateInterest =
|
|
92
|
+
// If any legIntPurposes is not opted out
|
|
93
|
+
legIntPurposes && legIntPurposes.some(purposeId => !optOutPurposes[`${purposeId}`]) || (
|
|
94
|
+
/**
|
|
95
|
+
* Per June 2021 Policy change, Vendors declaring only
|
|
96
|
+
* Special Purposes must have their legitimate interest
|
|
97
|
+
* Vendor bit set if they have been disclosed.
|
|
98
|
+
*/
|
|
99
|
+
purposes.length === 0 && legIntPurposes.length === 0 && specialPurposes.length > 0);
|
|
100
|
+
if (vendorHasLegitimateInterest) {
|
|
101
|
+
vendorLegitimateInterests[`${vendorId}`] = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return vendorLegitimateInterests;
|
|
106
|
+
};
|
|
107
|
+
export const makeParseConsentString = initOptions => tcString => {
|
|
108
|
+
const {
|
|
109
|
+
encoder: {
|
|
110
|
+
decode
|
|
111
|
+
},
|
|
112
|
+
coreFieldSequence,
|
|
113
|
+
version,
|
|
114
|
+
cmpId,
|
|
115
|
+
cmpVersion,
|
|
116
|
+
specFieldMode = false
|
|
117
|
+
} = initOptions;
|
|
118
|
+
const segments = tcString.split('.');
|
|
119
|
+
const coreSegment = decode(segments[0]);
|
|
120
|
+
const tcData = specFieldMode ? {} : {
|
|
121
|
+
...commonConsent,
|
|
122
|
+
cmpId,
|
|
123
|
+
cmpVersion,
|
|
124
|
+
consentLanguage: Locale.locale.slice(0, 2).toUpperCase(),
|
|
125
|
+
tcfPolicyVersion: parseInt(version, 10)
|
|
126
|
+
};
|
|
127
|
+
coreFieldSequence.reduce((startBit, [field, numBits, {
|
|
128
|
+
decode: decodeField
|
|
129
|
+
}, dataField]) => {
|
|
130
|
+
const value = isFinite(numBits) ? coreSegment.slice(startBit, startBit + numBits) :
|
|
131
|
+
// It's a non-fixed vector, so we need to use rest of the segment
|
|
132
|
+
coreSegment.slice(startBit);
|
|
133
|
+
const {
|
|
134
|
+
bitLength,
|
|
135
|
+
value: decodedValue
|
|
136
|
+
} = decodeField(value, numBits);
|
|
137
|
+
|
|
138
|
+
// The TCF string spec uses PascalCase names for fields, but the TCData object uses camelCase
|
|
139
|
+
// Reference: https://github.com/IABTechLab/iabgpp-es/blob/42060d7ac2b6d0ee70fc1b5bcd33fc447bf5123c/modules/cmpapi/src/encoder/field/TcfEuV2Field.ts
|
|
140
|
+
const fieldName = specFieldMode ? field[0].toUpperCase() + field.substring(1) // Capitalize first letter
|
|
141
|
+
: dataField || field;
|
|
142
|
+
set(tcData, fieldName, decodedValue);
|
|
143
|
+
return startBit + bitLength;
|
|
144
|
+
}, 0);
|
|
145
|
+
return tcData;
|
|
146
|
+
};
|
|
147
|
+
export const makeGetField = initOptions => {
|
|
148
|
+
const parseConsentString = makeParseConsentString({
|
|
149
|
+
...initOptions,
|
|
150
|
+
specFieldMode: true
|
|
151
|
+
});
|
|
152
|
+
return (tcString, requestedField) => get(tcString ? parseConsentString(tcString) : {}, requestedField);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* TCFAPI consentFromOptions implementation
|
|
157
|
+
* @function
|
|
158
|
+
* @param {import('./constants').IABInitOptions} initOptions
|
|
159
|
+
* @returns {import('./constants').TCDataDeterminateField} Properly formatted TCData object
|
|
160
|
+
*/
|
|
161
|
+
export const makeConsentFromOptions = ({
|
|
162
|
+
version = '2.0',
|
|
163
|
+
cmpId,
|
|
164
|
+
cmpVersion,
|
|
165
|
+
fallbackGvlVersion,
|
|
166
|
+
gppSection,
|
|
167
|
+
staticFields,
|
|
168
|
+
dynamicFields = {}
|
|
169
|
+
}) => (data = {}, state) => {
|
|
170
|
+
const {
|
|
171
|
+
gdprApplies
|
|
172
|
+
} = merge(getStore(state), data);
|
|
173
|
+
const publisherCC = getPublisherCountryCode(state);
|
|
174
|
+
const currentScreen = getCurrentScreen(state);
|
|
175
|
+
const isShowingUi = currentScreen !== ScreenIds.None;
|
|
176
|
+
const willShowUi = !isSaved(state) || isShowingUi;
|
|
177
|
+
const cmpStatus = isConsentReady(state) ? CMPStatusCodes.LOADED : CMPStatusCodes.STUB;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The vendor list version should be in the customer's config because
|
|
181
|
+
* it's tied to their selected vendors. If it's not there, we don't have
|
|
182
|
+
* a way to know what it should be. The TCF spec doesn't cover this case
|
|
183
|
+
* and we can't encode 'undefined', so we'll use a fallback version.
|
|
184
|
+
*/
|
|
185
|
+
const gvlVersion = getVendorListVersion(state, version) || fallbackGvlVersion;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Since `consentFromOptions` is used for multiple callbacks, all TCDataDeterminateField
|
|
189
|
+
* values should be set here.
|
|
190
|
+
*/
|
|
191
|
+
const dynamicConsent = Object.entries(dynamicFields).reduce((acc, [field, getter]) => {
|
|
192
|
+
acc[`${field}`] = getter(data, state);
|
|
193
|
+
return acc;
|
|
194
|
+
}, {});
|
|
195
|
+
return {
|
|
196
|
+
version: staticFields.version,
|
|
197
|
+
...commonConsent,
|
|
198
|
+
...dynamicConsent,
|
|
199
|
+
cmpLoaded: cmpStatus === CMPStatusCodes.LOADED,
|
|
200
|
+
cmpStatus,
|
|
201
|
+
eventStatus: willShowUi ? CMPEventStatus.CMP_UI_SHOWN : hasActed(state, gppSection) ? CMPEventStatus.USER_ACTION_COMPLETE : CMPEventStatus.TC_LOADED,
|
|
202
|
+
currentScreen,
|
|
203
|
+
displayStatus: isShowingUi ? DisplayStatusCodes.VISIBLE : DisplayStatusCodes.HIDDEN,
|
|
204
|
+
cmpId,
|
|
205
|
+
cmpVersion,
|
|
206
|
+
gvlVersion,
|
|
207
|
+
consentLanguage: Locale.locale.slice(0, 2).toUpperCase(),
|
|
208
|
+
publisherCC,
|
|
209
|
+
tcfPolicyVersion: staticFields.tcfPolicyVersion,
|
|
210
|
+
gdprApplies: gdprApplies !== undefined ? gdprApplies : doesGDPRApply(state),
|
|
211
|
+
vendor: {
|
|
212
|
+
consents: getVendorConsents(state, version),
|
|
213
|
+
legitimateInterests: getVendorLegitimateInterests(state, version)
|
|
214
|
+
},
|
|
215
|
+
specialFeatureOptins: getSpecialFeatureOptIns(state, version),
|
|
216
|
+
purpose: {
|
|
217
|
+
consents: getPurposeConsents(state, version),
|
|
218
|
+
legitimateInterests: getPurposesLITransparency(state, version)
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* TCFAPI formatConsentString implementation
|
|
225
|
+
* @function
|
|
226
|
+
* @param {Object} data
|
|
227
|
+
* @returns {string} Properly formatted TCFData string
|
|
228
|
+
*/
|
|
229
|
+
export const makeFormatConsentString = initOptions => (data, state) => {
|
|
230
|
+
const {
|
|
231
|
+
encoder: {
|
|
232
|
+
encode
|
|
233
|
+
},
|
|
234
|
+
coreFieldSequence,
|
|
235
|
+
staticFields
|
|
236
|
+
} = initOptions;
|
|
237
|
+
const tcData = makeConsentFromOptions(initOptions)(data, state);
|
|
238
|
+
const segments = getConsentString(state, initOptions).split('.');
|
|
239
|
+
// Only update the CORE string
|
|
240
|
+
segments.shift();
|
|
241
|
+
const [bitFields] = coreFieldSequence.reduce(([bitString, startBit], [key, numBits, {
|
|
242
|
+
encode: encodeField
|
|
243
|
+
}, dataField = key]) => {
|
|
244
|
+
let value;
|
|
245
|
+
if (Object.hasOwnProperty.call(staticFields, dataField)) {
|
|
246
|
+
// We should skip this field
|
|
247
|
+
const staticValue = staticFields[`${dataField}`];
|
|
248
|
+
value = staticValue;
|
|
249
|
+
} else {
|
|
250
|
+
value = get(tcData, dataField);
|
|
251
|
+
}
|
|
252
|
+
const encodedValue = encodeField(value, numBits);
|
|
253
|
+
return [bitString + encodedValue, startBit + encodedValue.length];
|
|
254
|
+
}, ['', 0]);
|
|
255
|
+
const newCoreString = encode(bitFields);
|
|
256
|
+
segments.unshift(newCoreString);
|
|
257
|
+
return segments.join('.');
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* TCFAPI getConsentDataObject implementation
|
|
262
|
+
* @function
|
|
263
|
+
* @param {number} version
|
|
264
|
+
* @returns {import('./constants').TCData} Properly formatted TCData object
|
|
265
|
+
*/
|
|
266
|
+
export const makeGetConsentDataObject = initOptions => state => {
|
|
267
|
+
const {
|
|
268
|
+
defaultTimestamp,
|
|
269
|
+
version
|
|
270
|
+
} = initOptions;
|
|
271
|
+
switch (parseInt(version, 10)) {
|
|
272
|
+
// Supported versions
|
|
273
|
+
case 2:
|
|
274
|
+
{
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
default:
|
|
278
|
+
{
|
|
279
|
+
throw new Error('Unsupported version');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// `defaultTimestamp` will be used for the created and lastUpdated fields if
|
|
284
|
+
// a consent timestamp is not available yet.
|
|
285
|
+
const data = {
|
|
286
|
+
defaultTimestamp
|
|
287
|
+
};
|
|
288
|
+
return {
|
|
289
|
+
...makeConsentFromOptions(initOptions)(data, state),
|
|
290
|
+
tcString: makeFormatConsentString(initOptions)(data, state)
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
//# sourceMappingURL=consent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CMPEventStatus","CMPStatusCodes","DisplayStatusCodes","consentToPurpose","Locale","ScreenIds","doesGDPRApply","getConsentString","getCurrentScreen","getPublisherCountryCode","getPurposeConsents","getPurposeOptOuts","getPurposesLITransparency","getSpecialFeatureOptIns","getStore","getVendorListVersion","getVendorOptOuts","getVendors","hasActed","get","merge","set","getConsent","getSavedConsent","isConsentReady","isSaved","commonConsent","consentLanguage","cmpLoaded","cmpStatus","LOADED","eventStatus","TC_LOADED","isServiceSpecific","useNonStandardStacks","purposeOneTreatment","getVendorConsents","state","apiVersion","vendors","optOutVendors","purposeConsent","consents","Object","entries","reduce","vendorConsents","vendorId","purposes","deletedDate","vendorHasConsent","length","every","purposeId","getVendorLegitimateInterests","optOutPurposes","vendorLegitimateInterests","forEach","legIntPurposes","specialPurposes","vendorHasLegitimateInterest","some","makeParseConsentString","initOptions","tcString","encoder","decode","coreFieldSequence","version","cmpId","cmpVersion","specFieldMode","segments","split","coreSegment","tcData","locale","slice","toUpperCase","tcfPolicyVersion","parseInt","startBit","field","numBits","decodeField","dataField","value","isFinite","bitLength","decodedValue","fieldName","substring","makeGetField","parseConsentString","requestedField","makeConsentFromOptions","fallbackGvlVersion","gppSection","staticFields","dynamicFields","data","gdprApplies","publisherCC","currentScreen","isShowingUi","None","willShowUi","STUB","gvlVersion","dynamicConsent","acc","getter","CMP_UI_SHOWN","USER_ACTION_COMPLETE","displayStatus","VISIBLE","HIDDEN","undefined","vendor","legitimateInterests","specialFeatureOptins","purpose","makeFormatConsentString","encode","shift","bitFields","bitString","key","encodeField","hasOwnProperty","call","staticValue","encodedValue","newCoreString","unshift","join","makeGetConsentDataObject","defaultTimestamp","Error"],"sourceRoot":"../../../../src","sources":["iab/tcf/consent.js"],"mappings":"AAAA,SACCA,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,gBAAgB,QACV,aAAa;AACpB,SAASC,MAAM,EAAEC,SAAS,QAAQ,iBAAiB;AACnD,SACCC,aAAa,EACbC,gBAAgB,EAChBC,gBAAgB,EAChB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0 +1,37 @@
|
|
|
1
|
+
import { ConsentCategory } from '../../constants';
|
|
2
|
+
export const CMPEventStatus = {
|
|
3
|
+
TC_LOADED: 'tcloaded',
|
|
4
|
+
CMP_UI_SHOWN: 'cmpuishown',
|
|
5
|
+
USER_ACTION_COMPLETE: 'useractioncomplete'
|
|
6
|
+
};
|
|
7
|
+
export const CMPStatusCodes = {
|
|
8
|
+
STUB: 'stub',
|
|
9
|
+
LOADED: 'loaded',
|
|
10
|
+
ERROR: 'error'
|
|
11
|
+
};
|
|
12
|
+
export const DisplayStatusCodes = {
|
|
13
|
+
VISIBLE: 'visible',
|
|
14
|
+
HIDDEN: 'hidden',
|
|
15
|
+
DISABLED: 'disabled'
|
|
16
|
+
};
|
|
17
|
+
export const purposeIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
18
|
+
export const purposeMap = {
|
|
19
|
+
[ConsentCategory.ESSENTIAL]: [],
|
|
20
|
+
[ConsentCategory.ANALYTICS]: [8, 10],
|
|
21
|
+
[ConsentCategory.STORAGE]: [1],
|
|
22
|
+
[ConsentCategory.MARKETING]: [2, 7, 9],
|
|
23
|
+
[ConsentCategory.PERSONALIZATION]: [3, 4, 5, 6],
|
|
24
|
+
[ConsentCategory.OPT_OUT]: []
|
|
25
|
+
};
|
|
26
|
+
export const consentToPurpose = (consent = {}, apiVersion = '2') => {
|
|
27
|
+
if (parseInt(apiVersion, 10) <= 2) {
|
|
28
|
+
return Object.entries(purposeMap).reduce((consents, [category, purposes]) => {
|
|
29
|
+
purposes.forEach(purpose => {
|
|
30
|
+
consents[`${purpose}`] = !!consent[`${category}`];
|
|
31
|
+
});
|
|
32
|
+
return consents;
|
|
33
|
+
}, {});
|
|
34
|
+
}
|
|
35
|
+
return {};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ConsentCategory","CMPEventStatus","TC_LOADED","CMP_UI_SHOWN","USER_ACTION_COMPLETE","CMPStatusCodes","STUB","LOADED","ERROR","DisplayStatusCodes","VISIBLE","HIDDEN","DISABLED","purposeIds","purposeMap","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,SAECA,eAAe,QACT,iBAAiB;AAExB,OAAO,MAAMC,cAAc,GAAG;EAC7BC,SAAS,EAAE,UAAU;EACrBC,YAAY,EAAE,YAAY;EAC1BC,oBAAoB,EAAE;AACvB,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE;AACR,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG;EACjCC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AACzD,OAAO,MAAMC,UAAiD,GAAG;EAChE,CAACd,eAAe,CAACe,SAAS,GAAG,EAAE;EAC/B,CAACf,eAAe,CAACgB,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;EACpC,CAAChB,eAAe,CAACiB,OAAO,GAAG,CAAC,CAAC,CAAC;EAC9B,CAACjB,eAAe,CAACkB,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACtC,CAAClB,eAAe,CAACmB,eAAe,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EAC/C,CAACnB,eAAe,CAACoB,OAAO,GAAG;AAC5B,CAAC;AAED,OAAO,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,CAACZ,UAAU,CAAC,CAACa,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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reducer","versions"],"sourceRoot":"../../../../src","sources":["iab/tcf/index.js"],"mappings":"AAAA,OAAOA,OAAO,MAAM,WAAW;AAC/B,OAAOC,QAAQ,MAAM,QAAQ;AAE7B,eAAe;EACdD,OAAO;EACPC;AACD,CAAC","ignoreList":[]}
|