@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,622 @@
|
|
|
1
|
+
import { type Config, type Mode, type Palette } from './types/consent-config';
|
|
2
|
+
import { EventEmitter, EventSubscription } from './utils/EventEmitter';
|
|
3
|
+
import { type GvlVendor_v2, type GvlVendor_v3, type Iab } from './iab/types';
|
|
4
|
+
import { NativeModules, Platform } from 'react-native';
|
|
5
|
+
import { fetchConfig, fetchConsent } from './services/consent';
|
|
6
|
+
import flavors, { type Flavor } from './flavors';
|
|
7
|
+
import { get, merge } from './utils';
|
|
8
|
+
import { type OsanoOverrides } from './types';
|
|
9
|
+
import { type Tcf_v2 } from './iab/tcf/types';
|
|
10
|
+
import Translator from './utils/Translator';
|
|
11
|
+
import { type ConsentCategory, mappedJurisdictions } from './constants';
|
|
12
|
+
import { getDeviceId } from './native/OsanoCmp';
|
|
13
|
+
|
|
14
|
+
const CONFIG_ID_ERROR = new Error('customerId and configId must be set');
|
|
15
|
+
const CONFIG_NOT_FOUND_ERROR = new Error('Config not found');
|
|
16
|
+
|
|
17
|
+
export const DEFAULT_CONFIG: Config = {
|
|
18
|
+
allowTimeout: false,
|
|
19
|
+
categories: [
|
|
20
|
+
'ESSENTIAL' as ConsentCategory,
|
|
21
|
+
'MARKETING' as ConsentCategory,
|
|
22
|
+
'PERSONALIZATION' as ConsentCategory,
|
|
23
|
+
'ANALYTICS' as ConsentCategory,
|
|
24
|
+
],
|
|
25
|
+
type: flavors.one,
|
|
26
|
+
palette: {
|
|
27
|
+
borderless: true,
|
|
28
|
+
dialogType: 'bar',
|
|
29
|
+
displayPosition: 'bottom',
|
|
30
|
+
infoDialogPosition: 'right',
|
|
31
|
+
widgetPosition: 'right',
|
|
32
|
+
buttonBackgroundColor: '#fff',
|
|
33
|
+
buttonForegroundColor: '#000',
|
|
34
|
+
buttonDenyBackgroundColor: '#989',
|
|
35
|
+
buttonDenyForegroundColor: '#fff',
|
|
36
|
+
dialogBackgroundColor: '#000',
|
|
37
|
+
dialogForegroundColor: '#fff',
|
|
38
|
+
infoDialogOverlayColor: 'rgba(0,0,0,0.45)',
|
|
39
|
+
infoDialogBackgroundColor: '#fff',
|
|
40
|
+
infoDialogForegroundColor: '#000',
|
|
41
|
+
linkColor: '#29246a',
|
|
42
|
+
toggleOffBackgroundColor: '#d2cfff',
|
|
43
|
+
toggleButtonOffColor: '#ffffff',
|
|
44
|
+
toggleOnBackgroundColor: '#37cd8f',
|
|
45
|
+
toggleButtonOnColor: '#f4f4f4',
|
|
46
|
+
widgetColor: '#37cd8f',
|
|
47
|
+
widgetOutlineColor: '#29246a',
|
|
48
|
+
widgetFillColor: '#fff',
|
|
49
|
+
},
|
|
50
|
+
gpcSupport: false,
|
|
51
|
+
ccpaRelaxed: false,
|
|
52
|
+
crossDomain: false,
|
|
53
|
+
ccpaApplies: false,
|
|
54
|
+
forceManagePreferences: false,
|
|
55
|
+
forceReconsent: undefined,
|
|
56
|
+
googleConsent: false,
|
|
57
|
+
iframeBlocking: '',
|
|
58
|
+
scriptBlocking: '',
|
|
59
|
+
timeoutSeconds: 0,
|
|
60
|
+
storagePolicyHref: '',
|
|
61
|
+
policyLinkText: '',
|
|
62
|
+
policyLinkInDrawer: false,
|
|
63
|
+
forcedClassifyEnabled: false,
|
|
64
|
+
managePreferencesEnabled: false,
|
|
65
|
+
customerId: '',
|
|
66
|
+
configId: '',
|
|
67
|
+
mode: 'production',
|
|
68
|
+
noTattle: false,
|
|
69
|
+
domains: [],
|
|
70
|
+
remoteConsent: false,
|
|
71
|
+
variant: 'one',
|
|
72
|
+
country: 'us',
|
|
73
|
+
region: '',
|
|
74
|
+
iab: {
|
|
75
|
+
enabled: undefined,
|
|
76
|
+
notified: false,
|
|
77
|
+
signatory: false,
|
|
78
|
+
hideOptOut: false,
|
|
79
|
+
gpp: undefined,
|
|
80
|
+
tcf: undefined,
|
|
81
|
+
usp: undefined,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const migrateIabConfig = (config: Iab): Iab => {
|
|
86
|
+
const { eu, tcf, ...remain } = config;
|
|
87
|
+
const { enabled, v2 } = eu ?? {};
|
|
88
|
+
return {
|
|
89
|
+
...remain,
|
|
90
|
+
tcf: {
|
|
91
|
+
...tcf,
|
|
92
|
+
enabled: enabled ?? false,
|
|
93
|
+
v2: {
|
|
94
|
+
gdprApplies: false,
|
|
95
|
+
...v2,
|
|
96
|
+
...tcf?.v2,
|
|
97
|
+
purposeOptouts: {},
|
|
98
|
+
specialFeatureOptouts: {},
|
|
99
|
+
vendorOptouts: {},
|
|
100
|
+
vendorListVersion:
|
|
101
|
+
v2?.vendorListVersion ?? tcf?.v2?.vendorListVersion ?? 0,
|
|
102
|
+
vendors: {
|
|
103
|
+
...tcf?.v2?.vendors,
|
|
104
|
+
...v2?.vendors,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const emptyArray: never[] = [];
|
|
112
|
+
|
|
113
|
+
export class ConsentConfig extends EventEmitter {
|
|
114
|
+
private _config: Config;
|
|
115
|
+
private _customerId: string;
|
|
116
|
+
private _configId: string;
|
|
117
|
+
|
|
118
|
+
constructor(customerId?: string, configId?: string) {
|
|
119
|
+
super();
|
|
120
|
+
this._config = merge({}, DEFAULT_CONFIG) as Config;
|
|
121
|
+
this._customerId = customerId ?? '';
|
|
122
|
+
this._configId = configId ?? '';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
load() {
|
|
126
|
+
if (!this._customerId || !this._configId) {
|
|
127
|
+
this.emit('loadFailure', CONFIG_ID_ERROR);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
return fetchConfig(this._customerId, this._configId)
|
|
131
|
+
.then((config: Config | null) => {
|
|
132
|
+
if (!config || Object.keys(config).length === 0) {
|
|
133
|
+
throw CONFIG_NOT_FOUND_ERROR;
|
|
134
|
+
}
|
|
135
|
+
config.iab = migrateIabConfig(config.iab);
|
|
136
|
+
// Handle IAB override
|
|
137
|
+
config.iab.enabled = this._config.iab.enabled || config.iab.enabled;
|
|
138
|
+
config.palette = Object.fromEntries(
|
|
139
|
+
Object.entries(config.palette).filter(([, value]) => !!value),
|
|
140
|
+
) as Palette;
|
|
141
|
+
this._config = merge(this._config, config) as Config;
|
|
142
|
+
this.emit('loadSuccess', this._config);
|
|
143
|
+
})
|
|
144
|
+
.catch(err => {
|
|
145
|
+
this.emit('loadFailure', err);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
set customerId(value: string) {
|
|
149
|
+
this._customerId = value || this._customerId;
|
|
150
|
+
}
|
|
151
|
+
get customerId(): string {
|
|
152
|
+
return this._customerId;
|
|
153
|
+
}
|
|
154
|
+
set configId(value: string) {
|
|
155
|
+
this._configId = value || this._configId;
|
|
156
|
+
}
|
|
157
|
+
get configId(): string {
|
|
158
|
+
return this._configId;
|
|
159
|
+
}
|
|
160
|
+
get allowTimeout(): boolean {
|
|
161
|
+
return this._config.allowTimeout;
|
|
162
|
+
}
|
|
163
|
+
get gpcSupport(): boolean {
|
|
164
|
+
return this._config.gpcSupport;
|
|
165
|
+
}
|
|
166
|
+
get categories(): ConsentCategory[] {
|
|
167
|
+
return this._config.categories || emptyArray;
|
|
168
|
+
}
|
|
169
|
+
get jurisdiction(): string {
|
|
170
|
+
return (
|
|
171
|
+
mappedJurisdictions[`${this.country}`.toLowerCase()] ||
|
|
172
|
+
`${this.country}${this.region ? `-${this.region}` : ''}`
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
get ccpaRelaxed(): boolean {
|
|
176
|
+
return this._config.ccpaRelaxed;
|
|
177
|
+
}
|
|
178
|
+
get crossDomain(): boolean {
|
|
179
|
+
return this._config.crossDomain;
|
|
180
|
+
}
|
|
181
|
+
get ccpaApplies(): boolean {
|
|
182
|
+
return this._config.ccpaApplies;
|
|
183
|
+
}
|
|
184
|
+
get forceManagePreferences(): boolean {
|
|
185
|
+
return this._config.forceManagePreferences;
|
|
186
|
+
}
|
|
187
|
+
get forceReconsent(): Date | undefined {
|
|
188
|
+
return this._config.forceReconsent;
|
|
189
|
+
}
|
|
190
|
+
get googleConsent(): boolean {
|
|
191
|
+
return this._config.googleConsent;
|
|
192
|
+
}
|
|
193
|
+
get iframeBlocking(): Mode {
|
|
194
|
+
return this._config.iframeBlocking;
|
|
195
|
+
}
|
|
196
|
+
get scriptBlocking(): Mode {
|
|
197
|
+
return this._config.scriptBlocking;
|
|
198
|
+
}
|
|
199
|
+
get timeoutSeconds(): number {
|
|
200
|
+
return this._config.timeoutSeconds;
|
|
201
|
+
}
|
|
202
|
+
get storagePolicyHref(): string {
|
|
203
|
+
return this._config.storagePolicyHref;
|
|
204
|
+
}
|
|
205
|
+
get policyLinkText(): string {
|
|
206
|
+
return this._config.policyLinkText;
|
|
207
|
+
}
|
|
208
|
+
get policyLinkInDrawer(): boolean {
|
|
209
|
+
return this._config.policyLinkInDrawer;
|
|
210
|
+
}
|
|
211
|
+
get forcedClassifyEnabled(): boolean {
|
|
212
|
+
return this._config.forcedClassifyEnabled;
|
|
213
|
+
}
|
|
214
|
+
get managePreferencesEnabled(): boolean {
|
|
215
|
+
return this._config.managePreferencesEnabled;
|
|
216
|
+
}
|
|
217
|
+
get mode(): Mode {
|
|
218
|
+
return this._config.mode;
|
|
219
|
+
}
|
|
220
|
+
get noTattle(): boolean {
|
|
221
|
+
return this._config.noTattle;
|
|
222
|
+
}
|
|
223
|
+
get domains(): Array<string> {
|
|
224
|
+
return this._config.domains;
|
|
225
|
+
}
|
|
226
|
+
get remoteConsent(): boolean {
|
|
227
|
+
return this._config.remoteConsent;
|
|
228
|
+
}
|
|
229
|
+
get type(): Flavor {
|
|
230
|
+
// Favor flavor overrides
|
|
231
|
+
return this._config.type ?? flavors[this._config.variant] ?? flavors.one;
|
|
232
|
+
}
|
|
233
|
+
set type(value: keyof typeof flavors) {
|
|
234
|
+
if (value && flavors[value]) {
|
|
235
|
+
this._config.type = flavors[value];
|
|
236
|
+
} else {
|
|
237
|
+
this._config.type = undefined;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
get variant(): 'one' | 'two' | 'three' | 'four' | 'five' | 'six' {
|
|
241
|
+
return this._config.variant;
|
|
242
|
+
}
|
|
243
|
+
get country(): string {
|
|
244
|
+
return this._config.country;
|
|
245
|
+
}
|
|
246
|
+
get region(): string {
|
|
247
|
+
return this._config.region;
|
|
248
|
+
}
|
|
249
|
+
get iab(): Iab {
|
|
250
|
+
return this._config.iab;
|
|
251
|
+
}
|
|
252
|
+
get palette(): Palette {
|
|
253
|
+
return this._config.palette;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
isBrowsingFromCountry(country: string) {
|
|
257
|
+
return this._config.country.toLowerCase() === country.toLowerCase();
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
get browsingFromUS() {
|
|
261
|
+
return this.isBrowsingFromCountry('us');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
get isConsentImplied() {
|
|
265
|
+
return !!this.type.timer;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
get dialogCloseButtonRequired() {
|
|
269
|
+
return this.type.canDismissDialog;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
get firstLayerCategoriesRequired() {
|
|
273
|
+
return this.type.categories;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
get firstLayerUsageRequired() {
|
|
277
|
+
return this.type.firstLayerUsage;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
get managePreferencesRequired() {
|
|
281
|
+
return this.type.managePreferences;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
get forceManagePreferencesButton() {
|
|
285
|
+
return this._config.forceManagePreferences;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
get rejectAllRequired() {
|
|
289
|
+
return this.type.rejectAll;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// IAB
|
|
293
|
+
private _iabEnabled?: boolean;
|
|
294
|
+
get iabEnabled(): boolean {
|
|
295
|
+
return (
|
|
296
|
+
this._iabEnabled ||
|
|
297
|
+
(this._config.iab.tcf?.enabled ?? this._config.iab.enabled ?? false)
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
set iabEnabled(value: boolean | undefined) {
|
|
301
|
+
this._iabEnabled = value;
|
|
302
|
+
}
|
|
303
|
+
get iabCategories(): ConsentCategory[] {
|
|
304
|
+
return ['STORAGE', ...this.categories].filter(
|
|
305
|
+
category => category !== 'ESSENTIAL',
|
|
306
|
+
) as ConsentCategory[];
|
|
307
|
+
}
|
|
308
|
+
get gdprApplies(): boolean {
|
|
309
|
+
return (
|
|
310
|
+
this._iabEnabled === true ||
|
|
311
|
+
(this._config.iab.tcf?.v2?.gdprApplies ?? false)
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
get shouldRenderOptOut(): boolean {
|
|
315
|
+
return (
|
|
316
|
+
!this._config.iab.hideOptOut &&
|
|
317
|
+
!!(this._config.iab.usp?.ccpaApplies ?? this.browsingFromUS)
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
get iabVendorCount(): number {
|
|
321
|
+
return Object.keys(this._config.iab.tcf?.v2?.vendors ?? {}).length;
|
|
322
|
+
}
|
|
323
|
+
get nonEssentialCategories(): ConsentCategory[] {
|
|
324
|
+
return this.categories.filter(category => category !== 'ESSENTIAL');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
isIabSpecialFeatureAccepted(specialFeatureId: string) {
|
|
328
|
+
return (
|
|
329
|
+
this._config.iab.tcf?.v2?.specialFeatureOptouts[
|
|
330
|
+
parseInt(specialFeatureId, 10)
|
|
331
|
+
] !== false
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
isIabPurposeOptedOut(purposeId: number) {
|
|
335
|
+
return this._config.iab.tcf?.v2?.purposeOptouts[purposeId] === true;
|
|
336
|
+
}
|
|
337
|
+
isIabVendorOptedOut(vendorId: string) {
|
|
338
|
+
return (
|
|
339
|
+
this._config.iab.tcf?.v2?.vendorOptouts[parseInt(vendorId, 10)] !== false
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
getApiData(apiVersion: number | string = 2): Tcf_v2 | undefined {
|
|
344
|
+
const apiData = get(
|
|
345
|
+
this._config.iab.tcf,
|
|
346
|
+
`v${parseInt(`${apiVersion}`, 10)}`,
|
|
347
|
+
);
|
|
348
|
+
return apiData;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
getVendors(
|
|
352
|
+
apiVersion?: number | string,
|
|
353
|
+
): Record<number, GvlVendor_v2 | GvlVendor_v3> {
|
|
354
|
+
const tcf = this.getApiData(apiVersion);
|
|
355
|
+
return tcf?.vendors ?? {};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
getVendorIds(apiVersion?: number) {
|
|
359
|
+
return Object.keys(this.getVendors(apiVersion))
|
|
360
|
+
.map(vendorId => parseInt(vendorId, 10))
|
|
361
|
+
.filter(Boolean);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
getVendorData(
|
|
365
|
+
vendorId: number,
|
|
366
|
+
apiVersion?: string | number,
|
|
367
|
+
): GvlVendor_v2 | GvlVendor_v3 | undefined {
|
|
368
|
+
return this.getVendors(apiVersion)[vendorId];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// UI Requirements
|
|
372
|
+
get showFirstLayerCategories() {
|
|
373
|
+
return !this.managePreferencesEnabled && this.firstLayerCategoriesRequired;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
get showManagePreferencesButtonInDialog() {
|
|
377
|
+
return this.firstLayerCategoriesRequired
|
|
378
|
+
? this.managePreferencesEnabled
|
|
379
|
+
: this.managePreferencesRequired || this.forceManagePreferencesButton;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
get isButtonGroupTwo() {
|
|
383
|
+
return this.managePreferencesRequired || this.firstLayerCategoriesRequired;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
get showManagePreferencesLinkInDialog() {
|
|
387
|
+
return (
|
|
388
|
+
this.managePreferencesRequired &&
|
|
389
|
+
this.showFirstLayerCategories &&
|
|
390
|
+
!this.showManagePreferencesButtonInDialog &&
|
|
391
|
+
(this.isConsentImplied ||
|
|
392
|
+
this.isButtonGroupTwo ||
|
|
393
|
+
!this.forceManagePreferencesButton)
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
get tcfIsApplicable() {
|
|
398
|
+
return (
|
|
399
|
+
(this.gdprApplies || this.isBrowsingFromCountry('ca')) && this.iabEnabled
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export class ConsentManager {
|
|
405
|
+
private _config: ConsentConfig = new ConsentConfig();
|
|
406
|
+
private _extUsrData = '';
|
|
407
|
+
private _locale: string = Translator.DEFAULT_LANGUAGE;
|
|
408
|
+
private _consent?: ConsentCategory[];
|
|
409
|
+
private _translator: Translator = new Translator(this);
|
|
410
|
+
|
|
411
|
+
private _deviceId = '';
|
|
412
|
+
public get deviceId(): string {
|
|
413
|
+
return this._deviceId;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
public get customerId(): string {
|
|
417
|
+
return this._config.customerId;
|
|
418
|
+
}
|
|
419
|
+
public set customerId(value: string) {
|
|
420
|
+
this._config.customerId = value;
|
|
421
|
+
}
|
|
422
|
+
public get configId(): string {
|
|
423
|
+
return this._config.configId;
|
|
424
|
+
}
|
|
425
|
+
public set configId(value: string) {
|
|
426
|
+
this._config.configId = value;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
public get extUsrData(): string {
|
|
430
|
+
return this._extUsrData;
|
|
431
|
+
}
|
|
432
|
+
public set extUsrData(value: string) {
|
|
433
|
+
this._extUsrData = value;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
public get translator(): Translator {
|
|
437
|
+
return this._translator;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
public get config(): ConsentConfig {
|
|
441
|
+
return this._config;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
constructor(options?: OsanoOverrides) {
|
|
445
|
+
const { locale, flavor, iabEnabled } = options || {};
|
|
446
|
+
this._config.iabEnabled = iabEnabled ?? undefined;
|
|
447
|
+
this._config.type = flavor as keyof typeof flavors;
|
|
448
|
+
const setDeviceId = (deviceId: string | null | undefined) => {
|
|
449
|
+
this._deviceId = deviceId ?? '';
|
|
450
|
+
};
|
|
451
|
+
switch (Platform.OS) {
|
|
452
|
+
case 'android': {
|
|
453
|
+
try {
|
|
454
|
+
getDeviceId().then(setDeviceId);
|
|
455
|
+
} catch (err) {
|
|
456
|
+
console.log(`Error getting device id: ${err}`);
|
|
457
|
+
}
|
|
458
|
+
this._locale = NativeModules.I18nManager.localeIdentifier;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
case 'ios': {
|
|
462
|
+
try {
|
|
463
|
+
getDeviceId().then(setDeviceId);
|
|
464
|
+
} catch (err) {
|
|
465
|
+
console.log(`Error getting device id: ${err}`);
|
|
466
|
+
}
|
|
467
|
+
this._locale =
|
|
468
|
+
NativeModules.SettingsManager.settings.AppleLanguages[0] || //iOS 13
|
|
469
|
+
NativeModules.SettingsManager.settings.AppleLocale;
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
default: {
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (locale) {
|
|
477
|
+
this._locale = locale;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
private _loaded = false;
|
|
482
|
+
private _loading?: Promise<{
|
|
483
|
+
customerId: string;
|
|
484
|
+
configId: string;
|
|
485
|
+
locale: string;
|
|
486
|
+
consent?: ConsentCategory[];
|
|
487
|
+
}>;
|
|
488
|
+
private _cancelLoading?: () => void;
|
|
489
|
+
private _configLoadSuccessSubscription?: EventSubscription;
|
|
490
|
+
private _configLoadFailureSubscription?: EventSubscription;
|
|
491
|
+
load(args?: { customerId?: string; configId?: string , onConfigLoadSuccess?: ()=>void, onConfigLoadFailure?: ()=>void, onLangLoadSuccess?: ()=>void, onLangLoadFailure?:()=>void}) {
|
|
492
|
+
const { customerId, configId, onConfigLoadFailure, onConfigLoadSuccess, onLangLoadSuccess, onLangLoadFailure } = args || {};
|
|
493
|
+
if (!customerId || !configId) {
|
|
494
|
+
return Promise.reject(CONFIG_ID_ERROR);
|
|
495
|
+
}
|
|
496
|
+
if (this.customerId === customerId && this.configId === configId) {
|
|
497
|
+
return (
|
|
498
|
+
this._loading ??
|
|
499
|
+
Promise.resolve({
|
|
500
|
+
customerId,
|
|
501
|
+
configId,
|
|
502
|
+
locale: this._translator.locale,
|
|
503
|
+
consent: this.consent,
|
|
504
|
+
})
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
// Remove any existing listeners before a potential cancel
|
|
508
|
+
if (this._configLoadSuccessSubscription) {
|
|
509
|
+
this._configLoadSuccessSubscription.remove();
|
|
510
|
+
}
|
|
511
|
+
if (this._configLoadFailureSubscription) {
|
|
512
|
+
this._configLoadFailureSubscription.remove();
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (this._loading && this._cancelLoading) {
|
|
516
|
+
try {
|
|
517
|
+
this._cancelLoading();
|
|
518
|
+
if (this._cancelLoading) {
|
|
519
|
+
delete this._cancelLoading;
|
|
520
|
+
}
|
|
521
|
+
if (this._loading) {
|
|
522
|
+
delete this._loading;
|
|
523
|
+
}
|
|
524
|
+
} catch (err) {
|
|
525
|
+
// Do nothing
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
this._loaded = false;
|
|
529
|
+
this._loading = new Promise((resolveLoadConfig, rejectLoadConfig) => {
|
|
530
|
+
this._cancelLoading = rejectLoadConfig;
|
|
531
|
+
|
|
532
|
+
const handleConfigLoadSuccess = () => {
|
|
533
|
+
this._configLoadSuccessSubscription?.remove();
|
|
534
|
+
this._configLoadFailureSubscription?.remove();
|
|
535
|
+
const locale = this._locale;
|
|
536
|
+
resolveLoadConfig(
|
|
537
|
+
new Promise((resolve, reject) => {
|
|
538
|
+
this._cancelLoading = reject;
|
|
539
|
+
fetchConsent(this)
|
|
540
|
+
.catch(() => {
|
|
541
|
+
// Consent not found
|
|
542
|
+
return Promise.resolve([]);
|
|
543
|
+
})
|
|
544
|
+
.then(consent => {
|
|
545
|
+
this.consent = consent;
|
|
546
|
+
return this._translator.load(locale, onLangLoadSuccess, onLangLoadFailure).then(results => {
|
|
547
|
+
delete this._cancelLoading;
|
|
548
|
+
delete this._loading;
|
|
549
|
+
const globalResult = results[0];
|
|
550
|
+
// As long as the global locale is loaded, we can render the CMP
|
|
551
|
+
if (globalResult?.status === 'fulfilled') {
|
|
552
|
+
this._loaded = true;
|
|
553
|
+
const globalLocale = globalResult?.value || locale;
|
|
554
|
+
resolve({
|
|
555
|
+
customerId,
|
|
556
|
+
configId,
|
|
557
|
+
locale: globalLocale,
|
|
558
|
+
consent,
|
|
559
|
+
});
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
// If the global locale failed to load, we can't render the CMP
|
|
563
|
+
reject(new Error(globalResult?.reason));
|
|
564
|
+
});
|
|
565
|
+
});
|
|
566
|
+
}),
|
|
567
|
+
);
|
|
568
|
+
onConfigLoadSuccess && onConfigLoadSuccess();
|
|
569
|
+
};
|
|
570
|
+
const handleConfigLoadFailure = (err: Error) => {
|
|
571
|
+
this._loaded = false;
|
|
572
|
+
delete this._cancelLoading;
|
|
573
|
+
delete this._loading;
|
|
574
|
+
this._configLoadSuccessSubscription?.remove();
|
|
575
|
+
this._configLoadFailureSubscription?.remove();
|
|
576
|
+
onConfigLoadFailure && onConfigLoadFailure();
|
|
577
|
+
rejectLoadConfig(err);
|
|
578
|
+
};
|
|
579
|
+
this._configLoadSuccessSubscription = this._config.on(
|
|
580
|
+
'loadSuccess',
|
|
581
|
+
handleConfigLoadSuccess,
|
|
582
|
+
);
|
|
583
|
+
this._configLoadFailureSubscription = this._config.on(
|
|
584
|
+
'loadFailure',
|
|
585
|
+
handleConfigLoadFailure,
|
|
586
|
+
);
|
|
587
|
+
this.config.customerId = customerId;
|
|
588
|
+
this.config.configId = configId;
|
|
589
|
+
this._config.load();
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
return this._loading;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
public get consent(): ConsentCategory[] | undefined {
|
|
596
|
+
return this._consent ? [...this._consent] : undefined;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public set consent(value: ConsentCategory[] | undefined) {
|
|
600
|
+
this._consent = value;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
public hasConsent(category: ConsentCategory): boolean {
|
|
604
|
+
return this._consent?.includes(category) ?? false;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
public get loaded(): boolean {
|
|
608
|
+
return this._loaded;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
public get loading(): boolean {
|
|
612
|
+
return !!this._loading;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
private _consentingDomain: string | undefined;
|
|
616
|
+
public get consentingDomain(): string {
|
|
617
|
+
return this._consentingDomain ?? this._config.domains[0] ?? '';
|
|
618
|
+
}
|
|
619
|
+
public set consentingDomain(value: string) {
|
|
620
|
+
this._consentingDomain = value || undefined;
|
|
621
|
+
}
|
|
622
|
+
}
|