@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,50 @@
|
|
|
1
|
+
// Comment-out the sections that we do not implement as they aren't necessary
|
|
2
|
+
// for functionality.
|
|
3
|
+
export const SECTIONS = {
|
|
4
|
+
// tcfeuv1: 1,
|
|
5
|
+
tcfeuv2: 2,
|
|
6
|
+
// GPP header section is ID 3
|
|
7
|
+
// GPP signal integrity section is ID 4
|
|
8
|
+
tcfcav1: 5,
|
|
9
|
+
uspv1: 6
|
|
10
|
+
// usnatv1: 7,
|
|
11
|
+
// uscav1: 8,
|
|
12
|
+
// usvav1: 9,
|
|
13
|
+
// uscov1: 10,
|
|
14
|
+
// usutv1: 11,
|
|
15
|
+
// usctv1: 12,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* GPP's defined CMP status codes
|
|
20
|
+
* @enum {string}
|
|
21
|
+
*/
|
|
22
|
+
export const CmpStatusCodes = {
|
|
23
|
+
STUB: 'stub',
|
|
24
|
+
LOADED: 'loaded',
|
|
25
|
+
ERROR: 'error'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* GPP's defined CMP display status codes
|
|
30
|
+
* @enum {string}
|
|
31
|
+
*/
|
|
32
|
+
export const CmpDisplayStatusCodes = {
|
|
33
|
+
VISIBLE: 'visible',
|
|
34
|
+
HIDDEN: 'hidden',
|
|
35
|
+
DISABLED: 'disabled'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The GPP API's events
|
|
40
|
+
* @enum {string}
|
|
41
|
+
*/
|
|
42
|
+
export const EventNames = {
|
|
43
|
+
LISTENER_REGISTERED: 'listenerRegistered',
|
|
44
|
+
LISTENER_REMOVED: 'listenerRemoved',
|
|
45
|
+
CMP_STATUS_CHANGED: 'cmpStatus',
|
|
46
|
+
CMP_DISPLAY_STATUS_CHANGED: 'cmpDisplayStatus',
|
|
47
|
+
ERROR: 'error',
|
|
48
|
+
SECTION_CHANGED: 'sectionChange'
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SECTIONS","tcfeuv2","tcfcav1","uspv1","CmpStatusCodes","STUB","LOADED","ERROR","CmpDisplayStatusCodes","VISIBLE","HIDDEN","DISABLED","EventNames","LISTENER_REGISTERED","LISTENER_REMOVED","CMP_STATUS_CHANGED","CMP_DISPLAY_STATUS_CHANGED","SECTION_CHANGED"],"sourceRoot":"../../../../src","sources":["iab/gpp/constants.js"],"mappings":"AAAA;AACA;AACA,OAAO,MAAMA,QAAQ,GAAG;EACvB;EACAC,OAAO,EAAE,CAAC;EACV;EACA;EACAC,OAAO,EAAE,CAAC;EACVC,KAAK,EAAE;EACP;EACA;EACA;EACA;EACA;EACA;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG;EAC7BC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAG;EACpCC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG;EACzBC,mBAAmB,EAAE,oBAAoB;EACzCC,gBAAgB,EAAE,iBAAiB;EACnCC,kBAAkB,EAAE,WAAW;EAC/BC,0BAA0B,EAAE,kBAAkB;EAC9CT,KAAK,EAAE,OAAO;EACdU,eAAe,EAAE;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
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/AbstractBase64UrlEncoder.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 { InvalidBase64UrlError, InvalidBitStringError } from './errors';
|
|
23
|
+
import { decode as intDecode, encode as intEncode } from './FixedIntegerEncoder';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Base 64 URL character set. Different from standard Base64 char set in that
|
|
27
|
+
* '+' and '/' are replaced with '-' and '_'.
|
|
28
|
+
*/
|
|
29
|
+
const DICT = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
|
|
30
|
+
// prettier-ignore
|
|
31
|
+
const REVERSE_DICT = Object.freeze({
|
|
32
|
+
0: 52,
|
|
33
|
+
1: 53,
|
|
34
|
+
2: 54,
|
|
35
|
+
3: 55,
|
|
36
|
+
4: 56,
|
|
37
|
+
5: 57,
|
|
38
|
+
6: 58,
|
|
39
|
+
7: 59,
|
|
40
|
+
8: 60,
|
|
41
|
+
9: 61,
|
|
42
|
+
A: 0,
|
|
43
|
+
B: 1,
|
|
44
|
+
C: 2,
|
|
45
|
+
D: 3,
|
|
46
|
+
E: 4,
|
|
47
|
+
F: 5,
|
|
48
|
+
G: 6,
|
|
49
|
+
H: 7,
|
|
50
|
+
I: 8,
|
|
51
|
+
J: 9,
|
|
52
|
+
K: 10,
|
|
53
|
+
L: 11,
|
|
54
|
+
M: 12,
|
|
55
|
+
N: 13,
|
|
56
|
+
O: 14,
|
|
57
|
+
P: 15,
|
|
58
|
+
Q: 16,
|
|
59
|
+
R: 17,
|
|
60
|
+
S: 18,
|
|
61
|
+
T: 19,
|
|
62
|
+
U: 20,
|
|
63
|
+
V: 21,
|
|
64
|
+
W: 22,
|
|
65
|
+
X: 23,
|
|
66
|
+
Y: 24,
|
|
67
|
+
Z: 25,
|
|
68
|
+
a: 26,
|
|
69
|
+
b: 27,
|
|
70
|
+
c: 28,
|
|
71
|
+
d: 29,
|
|
72
|
+
e: 30,
|
|
73
|
+
f: 31,
|
|
74
|
+
g: 32,
|
|
75
|
+
h: 33,
|
|
76
|
+
i: 34,
|
|
77
|
+
j: 35,
|
|
78
|
+
k: 36,
|
|
79
|
+
l: 37,
|
|
80
|
+
m: 38,
|
|
81
|
+
n: 39,
|
|
82
|
+
o: 40,
|
|
83
|
+
p: 41,
|
|
84
|
+
q: 42,
|
|
85
|
+
r: 43,
|
|
86
|
+
s: 44,
|
|
87
|
+
t: 45,
|
|
88
|
+
u: 46,
|
|
89
|
+
v: 47,
|
|
90
|
+
w: 48,
|
|
91
|
+
x: 49,
|
|
92
|
+
y: 50,
|
|
93
|
+
z: 51,
|
|
94
|
+
'-': 62,
|
|
95
|
+
_: 63
|
|
96
|
+
});
|
|
97
|
+
export const makeEncode = pad => bitString => {
|
|
98
|
+
// should only be 0 or 1
|
|
99
|
+
if (!/^[01]*$/.test(bitString)) {
|
|
100
|
+
throw new InvalidBitStringError(bitString);
|
|
101
|
+
}
|
|
102
|
+
bitString = pad(bitString);
|
|
103
|
+
let str = '';
|
|
104
|
+
let index = 0;
|
|
105
|
+
while (index <= bitString.length - 6) {
|
|
106
|
+
const s = bitString.substring(index, index + 6);
|
|
107
|
+
const n = intDecode(s);
|
|
108
|
+
const c = DICT.charAt(n);
|
|
109
|
+
str += c;
|
|
110
|
+
index += 6;
|
|
111
|
+
}
|
|
112
|
+
return str;
|
|
113
|
+
};
|
|
114
|
+
export const decode = str => {
|
|
115
|
+
// should contain only characters from the base64url set
|
|
116
|
+
if (!/^[A-Za-z0-9\-_]*$/.test(str)) {
|
|
117
|
+
throw new InvalidBase64UrlError(str);
|
|
118
|
+
}
|
|
119
|
+
let bitString = '';
|
|
120
|
+
for (let i = 0; i < str.length; i++) {
|
|
121
|
+
const c = str.charAt(i);
|
|
122
|
+
const n = REVERSE_DICT[`${c}`];
|
|
123
|
+
const s = intEncode(n, 6);
|
|
124
|
+
bitString += s;
|
|
125
|
+
}
|
|
126
|
+
return bitString;
|
|
127
|
+
};
|
|
128
|
+
export default {
|
|
129
|
+
decode,
|
|
130
|
+
makeEncode
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=AbstractBase64UrlEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InvalidBase64UrlError","InvalidBitStringError","decode","intDecode","encode","intEncode","DICT","REVERSE_DICT","Object","freeze","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","_","makeEncode","pad","bitString","test","str","index","length","substring","charAt"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/AbstractBase64UrlEncoder.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,qBAAqB,EAAEC,qBAAqB,QAAQ,UAAU;AACvE,SACCC,MAAM,IAAIC,SAAS,EACnBC,MAAM,IAAIC,SAAS,QACb,uBAAuB;;AAE9B;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAG,kEAAkE;AAC/E;AACA,MAAMC,YAAmC,GAAGC,MAAM,CAACC,MAAM,CAAC;EACtD,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAE,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,CAAC;EAC1EC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EACzEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAEC,CAAC,EAAE,EAAE;EAAE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EA,KAAK,GAAG,CAAC,CAAC;IAC/C,MAAMnB,CAAC,GAAG9C,SAAS,CAACmD,CAAC,CAAC;IACtB,MAAMhB,CAAC,GAAGhC,IAAI,CAACiE,MAAM,CAACtB,CAAC,CAAC;IACxBkB,GAAG,IAAI7B,CAAC;IAER8B,KAAK,IAAI,CAAC;EACX;EAEA,OAAOD,GAAG;AACX,CAAC;AAEF,OAAO,MAAMjE,MAAM,GAAIiE,GAAW,IAAK;EACtC;EACA,IAAI,CAAC,mBAAmB,CAACD,IAAI,CAACC,GAAG,CAAC,EAAE;IACnC,MAAM,IAAInE,qBAAqB,CAACmE,GAAG,CAAC;EACrC;EAEA,IAAIF,SAAS,GAAG,EAAE;EAElB,KAAK,IAAIrB,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGuB,GAAG,CAACE,MAAM,EAAEzB,CAAC,EAAE,EAAE;IACpC,MAAMN,CAAC,GAAG6B,GAAG,CAACI,MAAM,CAAC3B,CAAC,CAAC;IAEvB,MAAMK,CAAC,GAAG1C,YAAY,CAAE,GAAE+B,CAAE,EAAC,CAAE;IAC/B,MAAMgB,CAAC,GAAGjD,SAAS,CAAC4C,CAAC,EAAE,CAAC,CAAC;IACzBgB,SAAS,IAAIX,CAAC;EACf;EAEA,OAAOW,SAAS;AACjB,CAAC;AAED,eAAe;EACd/D,MAAM;EACN6D;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
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/BooleanEncoder.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
|
+
/**
|
|
23
|
+
* encode a TCString boolean
|
|
24
|
+
*/
|
|
25
|
+
export const encode = bool => {
|
|
26
|
+
return bool ? '1' : '0';
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* decode a TCString boolean
|
|
30
|
+
*/
|
|
31
|
+
export const decode = bitString => {
|
|
32
|
+
// fewer operations than !!parseInt(value, 2)
|
|
33
|
+
return bitString === '1';
|
|
34
|
+
};
|
|
35
|
+
export default {
|
|
36
|
+
decode,
|
|
37
|
+
encode
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=BooleanEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["encode","bool","decode","bitString"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/BooleanEncoder.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMA,MAAM,GAAIC,IAAa,IAAK;EACxC,OAAOA,IAAI,GAAG,GAAG,GAAG,GAAG;AACxB,CAAC;AACD;AACA;AACA;AACA,OAAO,MAAMC,MAAM,GAAIC,SAAiB,IAAK;EAC5C;EACA,OAAOA,SAAS,KAAK,GAAG;AACzB,CAAC;AAED,eAAe;EACdD,MAAM;EACNF;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
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/CompressedBase64UrlEncoder.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 % 8 > 0) {
|
|
25
|
+
bitString += '0';
|
|
26
|
+
}
|
|
27
|
+
while (bitString.length % 6 > 0) {
|
|
28
|
+
bitString += '0';
|
|
29
|
+
}
|
|
30
|
+
return bitString;
|
|
31
|
+
};
|
|
32
|
+
export const encode = makeEncode(pad);
|
|
33
|
+
export { decode } from './AbstractBase64UrlEncoder';
|
|
34
|
+
export default {
|
|
35
|
+
decode,
|
|
36
|
+
encode
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=CompressedBase64UrlEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decode","makeEncode","pad","bitString","length","encode"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/CompressedBase64UrlEncoder.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;AAE/D,MAAMC,GAAG,GAAIC,SAAiB,IAAK;EAClC,OAAOA,SAAS,CAACC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;IAChCD,SAAS,IAAI,GAAG;EACjB;EACA,OAAOA,SAAS,CAACC,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE;IAChCD,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,40 @@
|
|
|
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/DatetimeEncoder.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 as intDecode, encode as intEncode } from './FixedIntegerEncoder';
|
|
23
|
+
export const encode = (date, numBits = 36) => {
|
|
24
|
+
let deciseconds;
|
|
25
|
+
if (date instanceof Date) {
|
|
26
|
+
deciseconds = Math.round(date.getTime() / 100);
|
|
27
|
+
} else {
|
|
28
|
+
deciseconds = date;
|
|
29
|
+
}
|
|
30
|
+
return intEncode(deciseconds, numBits);
|
|
31
|
+
};
|
|
32
|
+
export const decode = bitString => {
|
|
33
|
+
const date = new Date(intDecode(bitString) * 100);
|
|
34
|
+
return date;
|
|
35
|
+
};
|
|
36
|
+
export default {
|
|
37
|
+
decode,
|
|
38
|
+
encode
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=DatetimeEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decode","intDecode","encode","intEncode","date","numBits","deciseconds","Date","Math","round","getTime","bitString"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/DatetimeEncoder.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACCA,MAAM,IAAIC,SAAS,EACnBC,MAAM,IAAIC,SAAS,QACb,uBAAuB;AAE9B,OAAO,MAAMD,MAAM,GAAGA,CAACE,IAAmB,EAAEC,OAAe,GAAG,EAAE,KAAK;EACpE,IAAIC,WAAmB;EACvB,IAAIF,IAAI,YAAYG,IAAI,EAAE;IACzBD,WAAW,GAAGE,IAAI,CAACC,KAAK,CAACL,IAAI,CAACM,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC;EAC/C,CAAC,MAAM;IACNJ,WAAW,GAAGF,IAAI;EACnB;EACA,OAAOD,SAAS,CAACG,WAAW,EAAED,OAAO,CAAC;AACvC,CAAC;AAED,OAAO,MAAML,MAAM,GAAIW,SAAiB,IAAK;EAC5C,MAAMP,IAAI,GAAG,IAAIG,IAAI,CAACN,SAAS,CAACU,SAAS,CAAC,GAAG,GAAG,CAAC;EAEjD,OAAOP,IAAI;AACZ,CAAC;AAED,eAAe;EACdJ,MAAM;EACNE;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// This is our own implementation but is analogous to
|
|
2
|
+
// https://github.com/IABTechLab/iabgpp-es/blob/42060d7ac2b6d0ee70fc1b5bcd33fc447bf5123c/modules/cmpapi/src/encoder/datatype/EncodableOptimizedFixedRange.ts
|
|
3
|
+
|
|
4
|
+
import BooleanEncoder from './BooleanEncoder';
|
|
5
|
+
import { default as FixedIdBitMapEncoder } from './FixedIdBitMapEncoder';
|
|
6
|
+
import IntEncoder from './FixedIntegerEncoder';
|
|
7
|
+
export const BitLength = {
|
|
8
|
+
encodingType: 1,
|
|
9
|
+
maxId: 16,
|
|
10
|
+
numEntries: 12,
|
|
11
|
+
singleOrRange: 1,
|
|
12
|
+
vendorId: 16
|
|
13
|
+
};
|
|
14
|
+
const HEADER_LENGTH = BitLength.maxId + BitLength.encodingType;
|
|
15
|
+
const RANGE_MINIMUM_LENGTH = BitLength.vendorId + BitLength.singleOrRange + BitLength.numEntries;
|
|
16
|
+
const ENCODING_TYPE = {
|
|
17
|
+
FIELD: 0,
|
|
18
|
+
RANGE: 1
|
|
19
|
+
};
|
|
20
|
+
const buildRangeEncoding = ranges => {
|
|
21
|
+
// describe the number of entries to follow
|
|
22
|
+
const numEntries = ranges.length;
|
|
23
|
+
let rangeString = IntEncoder.encode(numEntries, BitLength.numEntries);
|
|
24
|
+
|
|
25
|
+
// each range
|
|
26
|
+
ranges.forEach((range /*: number[]*/) => {
|
|
27
|
+
// is this range a single?
|
|
28
|
+
const single = range.length === 1;
|
|
29
|
+
|
|
30
|
+
// first is the indicator of whether this is a single id or range (two)
|
|
31
|
+
// 0 is single and range is 1
|
|
32
|
+
rangeString += BooleanEncoder.encode(!single);
|
|
33
|
+
|
|
34
|
+
// second is the first (or only) vendorId
|
|
35
|
+
rangeString += IntEncoder.encode(`${range[0]}`, BitLength.vendorId);
|
|
36
|
+
if (!single) {
|
|
37
|
+
// add the second id if it exists
|
|
38
|
+
rangeString += IntEncoder.encode(`${range[1]}`, BitLength.vendorId);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return rangeString;
|
|
42
|
+
};
|
|
43
|
+
const encode = value => {
|
|
44
|
+
// Filter out any falsey values and convert the keys to numbers
|
|
45
|
+
const vendorIds = Object.entries(value).filter(([, v]) => !!v).map(([id]) => {
|
|
46
|
+
const parsedId = parseInt(id, 10);
|
|
47
|
+
if (isNaN(parsedId) || parsedId < 1 || /^\d+$/.test(id) === false) {
|
|
48
|
+
throw new Error(`Invalid vendor ID: ${id}`);
|
|
49
|
+
}
|
|
50
|
+
return parsedId;
|
|
51
|
+
});
|
|
52
|
+
const vendorSet = new Set(vendorIds);
|
|
53
|
+
const maxId = Math.max(0, ...vendorIds);
|
|
54
|
+
// collectors for range encoding
|
|
55
|
+
const ranges = []; // : number[][]
|
|
56
|
+
let range = []; // : number[]
|
|
57
|
+
|
|
58
|
+
// bit field will be just the encoded value of the ID corresponding to the
|
|
59
|
+
// position in the bit field
|
|
60
|
+
let bitField = '';
|
|
61
|
+
// A range is a minimum of 29 bits, so if the max vendor ID in this value
|
|
62
|
+
// is less than that then we know that a bitfield encoding will be shorter
|
|
63
|
+
// than any range encoding.
|
|
64
|
+
let rangeIsSmaller = maxId > RANGE_MINIMUM_LENGTH;
|
|
65
|
+
const bitFieldLength = HEADER_LENGTH + maxId;
|
|
66
|
+
|
|
67
|
+
// grows as we add to the range
|
|
68
|
+
let rangeLength = HEADER_LENGTH + BitLength.numEntries;
|
|
69
|
+
for (let vendorId = 1; vendorId <= maxId; vendorId++) {
|
|
70
|
+
const vendorIsOn = vendorSet.has(vendorId);
|
|
71
|
+
|
|
72
|
+
// build our bitfield no matter what
|
|
73
|
+
bitField += BooleanEncoder.encode(vendorIsOn);
|
|
74
|
+
|
|
75
|
+
// For each vendor ID up to maxId, we're re-evaluating whether the range
|
|
76
|
+
// grows larger than the bitfield. If it does, we'll abandon building
|
|
77
|
+
// the range
|
|
78
|
+
rangeIsSmaller = rangeIsSmaller && rangeLength < bitFieldLength;
|
|
79
|
+
if (rangeIsSmaller && vendorIsOn) {
|
|
80
|
+
const isEndOfRange = !vendorSet.has(vendorId + 1);
|
|
81
|
+
if (isEndOfRange) {
|
|
82
|
+
range.push(vendorId);
|
|
83
|
+
|
|
84
|
+
// add to the range length the additional vendorId
|
|
85
|
+
rangeLength += BitLength.vendorId;
|
|
86
|
+
|
|
87
|
+
// store the array in our bigger array
|
|
88
|
+
ranges.push(range);
|
|
89
|
+
|
|
90
|
+
// clear the array for the next range
|
|
91
|
+
range = [];
|
|
92
|
+
} else if (range.length === 0) {
|
|
93
|
+
// this is the first value for this range
|
|
94
|
+
range.push(vendorId);
|
|
95
|
+
|
|
96
|
+
// update our count with new range overhead
|
|
97
|
+
rangeLength += BitLength.singleOrRange;
|
|
98
|
+
rangeLength += BitLength.vendorId;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
rangeIsSmaller = rangeIsSmaller && rangeLength < bitFieldLength;
|
|
103
|
+
|
|
104
|
+
// since both encodings need the maxId, start with that
|
|
105
|
+
const encodedMaxId = IntEncoder.encode(maxId, BitLength.maxId);
|
|
106
|
+
return encodedMaxId + (rangeIsSmaller ? ENCODING_TYPE.RANGE.toString() + buildRangeEncoding(ranges) : ENCODING_TYPE.FIELD.toString() + bitField);
|
|
107
|
+
};
|
|
108
|
+
const decode = bitString => {
|
|
109
|
+
if (!bitString) {
|
|
110
|
+
return {
|
|
111
|
+
bitLength: 0,
|
|
112
|
+
value: {}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
let index = 0;
|
|
116
|
+
const maxId = IntEncoder.decode(bitString.substr(index, BitLength.maxId), BitLength.maxId);
|
|
117
|
+
index += BitLength.maxId;
|
|
118
|
+
const encodingType = IntEncoder.decode(bitString.charAt(index), BitLength.encodingType);
|
|
119
|
+
index += BitLength.encodingType;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Range is handled in batches so we'll need a different decoding scheme
|
|
123
|
+
*/
|
|
124
|
+
if (encodingType === ENCODING_TYPE.RANGE) {
|
|
125
|
+
const vendorIds = new Set();
|
|
126
|
+
const numEntries = IntEncoder.decode(bitString.substr(index, BitLength.numEntries), BitLength.numEntries);
|
|
127
|
+
index += BitLength.numEntries;
|
|
128
|
+
|
|
129
|
+
// loop through each group of entries
|
|
130
|
+
for (let i = 0; i < numEntries; i++) {
|
|
131
|
+
// Ranges can represent a single id or a range of ids.
|
|
132
|
+
const isIdRange = BooleanEncoder.decode(bitString.charAt(index));
|
|
133
|
+
index += BitLength.singleOrRange;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* regardless of whether or not it's a single entry or range, the next
|
|
137
|
+
* set of bits is a vendor ID
|
|
138
|
+
*/
|
|
139
|
+
const firstId = IntEncoder.decode(bitString.substr(index, BitLength.vendorId), BitLength.vendorId);
|
|
140
|
+
index += BitLength.vendorId;
|
|
141
|
+
|
|
142
|
+
// if it's a range, the next set of bits is the second id
|
|
143
|
+
if (isIdRange) {
|
|
144
|
+
const secondId = IntEncoder.decode(bitString.substr(index, BitLength.vendorId), BitLength.vendorId);
|
|
145
|
+
index += BitLength.vendorId;
|
|
146
|
+
|
|
147
|
+
// we'll need to set or unset all the vendor ids between the first and second
|
|
148
|
+
for (let j = firstId; j <= secondId; j++) {
|
|
149
|
+
vendorIds.add(j);
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
vendorIds.add(firstId);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const decodedValue = {};
|
|
156
|
+
for (let vendorId = 1; vendorId <= maxId; vendorId++) {
|
|
157
|
+
decodedValue[vendorId] = vendorIds.has(vendorId);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
bitLength: index,
|
|
161
|
+
value: decodedValue
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Bitfield decoding
|
|
166
|
+
const bitField = bitString.substr(index, maxId);
|
|
167
|
+
index += maxId;
|
|
168
|
+
return {
|
|
169
|
+
bitLength: index,
|
|
170
|
+
value: FixedIdBitMapEncoder.decode(bitField, maxId)
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export default {
|
|
174
|
+
decode,
|
|
175
|
+
encode
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=EncodableOptimizedFixedRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BooleanEncoder","default","FixedIdBitMapEncoder","IntEncoder","BitLength","encodingType","maxId","numEntries","singleOrRange","vendorId","HEADER_LENGTH","RANGE_MINIMUM_LENGTH","ENCODING_TYPE","FIELD","RANGE","buildRangeEncoding","ranges","length","rangeString","encode","forEach","range","single","value","vendorIds","Object","entries","filter","v","map","id","parsedId","parseInt","isNaN","test","Error","vendorSet","Set","Math","max","bitField","rangeIsSmaller","bitFieldLength","rangeLength","vendorIsOn","has","isEndOfRange","push","encodedMaxId","toString","decode","bitString","bitLength","index","substr","charAt","i","isIdRange","firstId","secondId","j","add","decodedValue"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/EncodableOptimizedFixedRange.ts"],"mappings":"AAAA;AACA;;AAEA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,SAASC,OAAO,IAAIC,oBAAoB,QAAQ,wBAAwB;AACxE,OAAOC,UAAU,MAAM,uBAAuB;AAE9C,OAAO,MAAMC,SAAS,GAAG;EACxBC,YAAY,EAAE,CAAC;EACfC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,EAAE;EACdC,aAAa,EAAE,CAAC;EAChBC,QAAQ,EAAE;AACX,CAAC;AAED,MAAMC,aAAa,GAAGN,SAAS,CAACE,KAAK,GAAGF,SAAS,CAACC,YAAY;AAC9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AK,EAAEG,QAAQ,EAAE,EAAE;MACrDqD,YAAY,CAACrD,QAAQ,CAAC,GAAGe,SAAS,CAACqB,GAAG,CAACpC,QAAQ,CAAC;IACjD;IACA,OAAO;MAAE2C,SAAS,EAAEC,KAAK;MAAE9B,KAAK,EAAEuC;IAAa,CAAC;EACjD;;EAEA;EACA,MAAMtB,QAAQ,GAAGW,SAAS,CAACG,MAAM,CAACD,KAAK,EAAE/C,KAAK,CAAC;EAE/C+C,KAAK,IAAI/C,KAAK;EACd,OAAO;IACN8C,SAAS,EAAEC,KAAK;IAChB9B,KAAK,EAAErB,oBAAoB,CAACgD,MAAM,CAACV,QAAQ,EAAElC,KAAK;EACnD,CAAC;AACF,CAAC;AAED,eAAe;EACd4C,MAAM;EACN/B;AACD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
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/FibonacciIntegerEncoder.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
|
+
export const encode = value => {
|
|
23
|
+
const fib = [];
|
|
24
|
+
if (value >= 1) {
|
|
25
|
+
fib.push(1);
|
|
26
|
+
if (value >= 2) {
|
|
27
|
+
fib.push(2);
|
|
28
|
+
let i = 2;
|
|
29
|
+
while (value >= fib[i - 1] + fib[i - 2]) {
|
|
30
|
+
fib.push(fib[i - 1] + fib[i - 2]);
|
|
31
|
+
i++;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let bitString = '1';
|
|
36
|
+
for (let i = fib.length - 1; i >= 0; i--) {
|
|
37
|
+
const f = fib[i];
|
|
38
|
+
if (value >= f) {
|
|
39
|
+
bitString = '1' + bitString;
|
|
40
|
+
value -= f;
|
|
41
|
+
} else {
|
|
42
|
+
bitString = '0' + bitString;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return bitString;
|
|
46
|
+
};
|
|
47
|
+
export const decode = bitString => {
|
|
48
|
+
if (!/^[01]*11$/.test(bitString)) {
|
|
49
|
+
throw new Error('Invalid bit string');
|
|
50
|
+
}
|
|
51
|
+
let value = 0;
|
|
52
|
+
const fib = [];
|
|
53
|
+
for (let i = 0; i < bitString.length - 1; i++) {
|
|
54
|
+
if (i === 0) {
|
|
55
|
+
fib.push(1);
|
|
56
|
+
} else if (i === 1) {
|
|
57
|
+
fib.push(2);
|
|
58
|
+
} else {
|
|
59
|
+
fib.push(fib[i - 1] + fib[i - 2]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (let i = 0; i < bitString.length - 1; i++) {
|
|
63
|
+
if (bitString.charAt(i) === '1') {
|
|
64
|
+
value += fib[i];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
};
|
|
69
|
+
export default {
|
|
70
|
+
decode,
|
|
71
|
+
encode
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=FibonacciIntegerEncoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["encode","value","fib","push","i","bitString","length","f","decode","test","Error","charAt"],"sourceRoot":"../../../../../src","sources":["iab/gpp/encoders/FibonacciIntegerEncoder.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,MAAM,GAAIC,KAAa,IAAK;EACxC,MAAMC,GAAG,GAAG,EAAE;EACd,IAAID,KAAK,IAAI,CAAC,EAAE;IACfC,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAIF,KAAK,IAAI,CAAC,EAAE;MACfC,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;MAEX,IAAIC,CAAC,GAAG,CAAC;MACT,OAAOH,KAAK,IAAIC,GAAG,CAACE,CAAC,GAAG,CAAC,CAAC,GAAIF,GAAG,CAACE,CAAC,GAAG,CAAC,CAAE,EAAE;QAC1CF,GAAG,CAACC,IAAI,CAACD,GAAG,CAACE,CAAC,GAAG,CAAC,CAAC,GAAIF,GAAG,CAACE,CAAC,GAAG,CAAC,CAAE,CAAC;QACnCA,CAAC,EAAE;MACJ;IACD;EACD;EAEA,IAAIC,SAAS,GAAG,GAAG;EACnB,KAAK,IAAID,CAAC,GAAGF,GAAG,CAACI,MAAM,GAAG,CAAC,EAAEF,CAAC,IAAI,CAAC,EAAEA,CAAC,EAAE,EAAE;IACzC,MAAMG,CAAC,GAAGL,GAAG,CAACE,CAAC,CAAE;IACjB,IAAIH,KAAK,IAAIM,CAAC,EAAE;MACfF,SAAS,GAAG,GAAG,GAAGA,SAAS;MAC3BJ,KAAK,IAAIM,CAAC;IACX,CAAC,MAAM;MACNF,SAAS,GAAG,GAAG,GAAGA,SAAS;IAC5B;EACD;EAEA,OAAOA,SAAS;AACjB,CAAC;AAED,OAAO,MAAMG,MAAM,GAAIH,SAAiB,IAAK;EAC5C,IAAI,CAAC,WAAW,CAACI,IAAI,CAACJ,SAAS,CAAC,EAAE;IACjC,MAAM,IAA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