{"version":3,"file":"__federation_expose_PromoKuDetails-BQcZ85gB.js","sources":["../../src/configs/featuresFlag.ts","../../src/hooks/flagging/useFlagging.ts","../../src/features/PromoKu/components/PromoDetailModal/index.tsx","../../src/features/PromoKu/pages/Detail/tracker.ts","../../src/features/PromoKu/pages/Detail/PromoKuDetails.tsx","../../src/features/PromoKu/pages/Detail/index.tsx","../../src/features/PromoKu/constants/index.ts","../../src/features/PromoKu/pages/List/tracker.ts","../../src/features/PromoKu/pages/List/PromoKuPageNonAuthorized.tsx","../../src/features/PromoKu/pages/List/index.tsx","../../src/features/PromoKu/components/CodeInput/index.tsx","../../src/assets/images/empty_promo.svg","../../src/features/PromoKu/components/EmptyPromo/index.tsx","../../src/assets/icons/ic_promo.svg","../../src/features/PromoKu/utils/string.ts","../../src/features/PromoKu/components/PromoCard/index.tsx","../../node_modules/react-icons/fa6/index.mjs","../../src/features/PromoKu/components/PromoCardV2/index.tsx","../../src/assets/images/img_default.svg","../../src/features/PromoKu/components/PromoDetail/TransactionLimit.tsx","../../src/features/PromoKu/components/PromoDetail/index.tsx","../../src/features/PromoKu/components/PromoList/index.tsx","../../src/features/PromoKu/components/PromoListV2/index.tsx","../../src/features/PromoKu/components/RibbonFlag/index.tsx","../../src/features/PromoKu/pages/List/PromoKuPageAuthorized.tsx"],"sourcesContent":["/** \n Give to flagID from flagging service\n Recommended to add all the environment\n e.g. [staging, uat, productio]\n\n if you only provide one flagID on the array,\n we assume you provide a staging environment flagId\n so,the other flagID (uat and production) will behandled by useFlagging hooks\n */\nexport const FLAGGING_SERVICE = {\n FEATURE_PROMO_REVAMP_V2: [2212, 2213, 2214],\n FEATURE_PROMOKU_REFERRAL: [2386, 2387, 2388],\n};\n","import { useEffect, useState } from \"react\";\nimport { ENV } from \"src/configs/env\";\nimport { SERVICE } from \"src/configs/service\";\nimport { axiosInstance } from \"src/utils\";\n\nimport {\n FlagEvalObject,\n FlaggingOptions,\n FlaggingPayload,\n FlaggingResponseData,\n} from \"./type\";\n\nexport const useFlagging = (flagsOptions: FlaggingOptions[]) => {\n const reducedData = flagsOptions.reduce(\n (flagEvalObject: FlagEvalObject, flagOption) => {\n const { flag, entityId, entityType, entityContext, defaultValue } =\n flagOption;\n const [stagingFlag, uatFlag, prodFlag] = flag;\n const flagId = () => {\n switch (ENV.APP_ENV) {\n case \"production\":\n return prodFlag || stagingFlag + 2;\n case \"uat\":\n return uatFlag || stagingFlag + 1;\n default:\n return stagingFlag;\n }\n };\n\n const payload: FlaggingPayload = {\n entityID: entityId || `micro_belut_${flagId()}`,\n flagID: flagId(),\n entityType,\n entityContext,\n enableDebug: ENV.APP_ENV !== \"production\",\n };\n\n const defaultResult: FlaggingResponseData = {\n flagID: flagId(),\n flagKey: \"default_result\",\n flagSnapshotID: 0,\n segmentID: 0,\n timestamp: new Date().toISOString(),\n variantAttachment: {},\n variantID: 0,\n variantKey: \"default\",\n evalContext: {\n flagID: flagId(),\n entityID: entityId || `micro_belut_${flagId()}`,\n entityType,\n entityContext,\n flagKey: \"default_result\",\n },\n evalDebugLog: {\n segmentDebugLogs: [],\n },\n ...defaultValue,\n };\n\n const promise = axiosInstance.post(\n `${SERVICE.FLAGGING}/api/v1/evaluation`,\n payload\n );\n flagEvalObject.promisses.push(promise);\n flagEvalObject.defaultResults.push(defaultResult);\n return flagEvalObject;\n },\n { promisses: [], defaultResults: [] }\n );\n const [data, setData] = useState test