@velora-dex/widget 0.7.3 → 0.7.4-dev.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/dist/core/state/configAtom.js +2 -2
- package/dist/core/state/configAtom.js.map +1 -1
- package/dist/lib/web3/privy/config.js +1 -1
- package/dist/lib/web3/privy/config.js.map +1 -1
- package/dist/lib/web3/wagmi/config.d.ts.map +1 -1
- package/dist/lib/web3/wagmi/config.js +6 -10
- package/dist/lib/web3/wagmi/config.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,8 +9,8 @@ var c = {
|
|
|
9
9
|
theme: o(),
|
|
10
10
|
enableDelta: !0,
|
|
11
11
|
enableCrossChain: !0,
|
|
12
|
-
privyAppId:
|
|
13
|
-
privyClientId:
|
|
12
|
+
privyAppId: "cmb549ngz00omi90lifm9ifv5",
|
|
13
|
+
privyClientId: "client-WY6LzDz2oxeGCDsUEdenrY8z7Qf7WHMmUKVbxSXZ31RqT",
|
|
14
14
|
debug: !1,
|
|
15
15
|
widgetMode: "standalone",
|
|
16
16
|
enableDegenMode: !0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configAtom.js","names":["atom","useAtomValue","WidgetElements","WidgetConfig","DevURLs","PartnerConfig","ReferrerConfig","MarkRequired","SupportedChainId","emptyArray","emptyObject","atomWithCompare","constructPropertiesEqual","unorderedShallowEqual","TradeMode","getDefaultTheme","PrimitiveConfig","Pick","IterableConfig","PrimitiveConfigState","defaultWidgetConfig","theme","enableDelta","enableCrossChain","privyAppId","import","meta","env","VITE_PRIVY_APP_ID","privyClientId","VITE_PRIVY_CLIENT_ID","debug","widgetMode","enableDegenMode","const","widgetConfigAtom","useWidgetConfig","defaultSubConfig","tokenLists","srcChains","destChains","tradeModes","excludeUI","devURLs","partnerConfig","referrerConfig","tokenListsAtom","srcChainsAtom","destChainsAtom","tradeModesAtom","excludeUIAtom","devURLsAtom","partnerConfigAtom","debugLabel","referrerConfigAtom"],"sources":["../../../src/core/state/configAtom.ts"],"sourcesContent":["import { atom } from \"jotai\";\nimport { useAtomValue } from \"@/core/store\";\nimport type {\n WidgetElements,\n WidgetConfig,\n DevURLs,\n PartnerConfig,\n ReferrerConfig,\n} from \"../types\";\nimport type { MarkRequired } from \"ts-essentials\";\nimport type { SupportedChainId } from \"@/lib/web3/wagmi/types\";\nimport { emptyArray, emptyObject } from \"@/lib/constants\";\nimport { atomWithCompare } from \"@/lib/utils/atomWithCompare\";\nimport { constructPropertiesEqual, unorderedShallowEqual } from \"@/lib/utils\";\nimport { type TradeMode } from \"./tradeModeAtom\";\nimport { getDefaultTheme } from \"@/lib/utils/theme\";\n\nexport type PrimitiveConfig = Pick<\n WidgetConfig,\n | \"theme\"\n | \"enableDelta\"\n | \"enableCrossChain\"\n | \"privyAppId\"\n | \"privyClientId\"\n | \"debug\"\n | \"widgetMode\"\n | \"enableDegenMode\"\n>;\n\nexport type IterableConfig = Pick<\n WidgetConfig,\n | \"srcChains\"\n | \"destChains\"\n | \"tokenLists\"\n | \"tradeModes\"\n | \"excludeUI\"\n | \"devURLs\"\n | \"partnerConfig\"\n | \"referrerConfig\"\n>;\n\ntype PrimitiveConfigState = MarkRequired<\n PrimitiveConfig,\n | \"theme\"\n | \"enableDelta\"\n | \"enableCrossChain\"\n | \"privyAppId\"\n | \"privyClientId\"\n | \"debug\"\n | \"widgetMode\"\n | \"enableDegenMode\"\n>;\n\nexport const defaultWidgetConfig = {\n theme: getDefaultTheme(),\n enableDelta: true,\n enableCrossChain: true,\n privyAppId: import.meta.env.VITE_PRIVY_APP_ID,\n privyClientId: import.meta.env.VITE_PRIVY_CLIENT_ID,\n debug: false,\n widgetMode: \"standalone\",\n enableDegenMode: true,\n} as const satisfies PrimitiveConfig;\n\nexport const widgetConfigAtom = atom<PrimitiveConfigState>(defaultWidgetConfig);\n\nexport const useWidgetConfig = () => {\n return useAtomValue(widgetConfigAtom);\n};\n\nexport const defaultSubConfig = {\n tokenLists: emptyArray,\n srcChains: emptyArray,\n destChains: emptyArray,\n tradeModes: emptyArray,\n excludeUI: emptyArray,\n devURLs: emptyObject,\n partnerConfig: emptyObject,\n referrerConfig: emptyObject,\n} as const satisfies IterableConfig;\n\n// independent atoms for each iterable config property\n// with comparison to avoid unnecessary re-renders\nexport const tokenListsAtom = atomWithCompare<string[]>(\n defaultSubConfig.tokenLists,\n unorderedShallowEqual\n);\nexport const srcChainsAtom = atomWithCompare<SupportedChainId[]>(\n defaultSubConfig.srcChains,\n unorderedShallowEqual\n);\nexport const destChainsAtom = atomWithCompare<SupportedChainId[]>(\n defaultSubConfig.destChains,\n unorderedShallowEqual\n);\n\nexport const tradeModesAtom = atomWithCompare<TradeMode[]>(\n defaultSubConfig.tradeModes,\n unorderedShallowEqual\n);\n\nexport const excludeUIAtom = atomWithCompare<WidgetElements[]>(\n defaultSubConfig.excludeUI,\n unorderedShallowEqual\n);\n\nexport const devURLsAtom = atomWithCompare<DevURLs>(\n defaultSubConfig.devURLs,\n // known properties only comparison\n constructPropertiesEqual([\"apiProxyURL\", \"apiURL\", \"explorerURL\"])\n);\n\nexport const partnerConfigAtom = atomWithCompare<PartnerConfig>(\n defaultSubConfig.partnerConfig,\n constructPropertiesEqual([\n \"partner\",\n \"partnerAddress\",\n \"partnerFeeBps\",\n \"partnerTakesSurplus\",\n ])\n);\n\npartnerConfigAtom.debugLabel = \"partnerConfigAtom\";\n\nexport const referrerConfigAtom = atomWithCompare<ReferrerConfig>(\n defaultSubConfig.referrerConfig,\n constructPropertiesEqual([\"referrerAddress\"])\n);\n\nreferrerConfigAtom.debugLabel = \"referrerConfigAtom\";\n"],"mappings":";;;;;;;AAqDA,IAAaoB,IAAsB;CACjCC,OAAON,GAAiB;CACxBO,aAAa;CACbC,kBAAkB;CAClBC,YAAAA
|
|
1
|
+
{"version":3,"file":"configAtom.js","names":["atom","useAtomValue","WidgetElements","WidgetConfig","DevURLs","PartnerConfig","ReferrerConfig","MarkRequired","SupportedChainId","emptyArray","emptyObject","atomWithCompare","constructPropertiesEqual","unorderedShallowEqual","TradeMode","getDefaultTheme","PrimitiveConfig","Pick","IterableConfig","PrimitiveConfigState","defaultWidgetConfig","theme","enableDelta","enableCrossChain","privyAppId","import","meta","env","VITE_PRIVY_APP_ID","privyClientId","VITE_PRIVY_CLIENT_ID","debug","widgetMode","enableDegenMode","const","widgetConfigAtom","useWidgetConfig","defaultSubConfig","tokenLists","srcChains","destChains","tradeModes","excludeUI","devURLs","partnerConfig","referrerConfig","tokenListsAtom","srcChainsAtom","destChainsAtom","tradeModesAtom","excludeUIAtom","devURLsAtom","partnerConfigAtom","debugLabel","referrerConfigAtom"],"sources":["../../../src/core/state/configAtom.ts"],"sourcesContent":["import { atom } from \"jotai\";\nimport { useAtomValue } from \"@/core/store\";\nimport type {\n WidgetElements,\n WidgetConfig,\n DevURLs,\n PartnerConfig,\n ReferrerConfig,\n} from \"../types\";\nimport type { MarkRequired } from \"ts-essentials\";\nimport type { SupportedChainId } from \"@/lib/web3/wagmi/types\";\nimport { emptyArray, emptyObject } from \"@/lib/constants\";\nimport { atomWithCompare } from \"@/lib/utils/atomWithCompare\";\nimport { constructPropertiesEqual, unorderedShallowEqual } from \"@/lib/utils\";\nimport { type TradeMode } from \"./tradeModeAtom\";\nimport { getDefaultTheme } from \"@/lib/utils/theme\";\n\nexport type PrimitiveConfig = Pick<\n WidgetConfig,\n | \"theme\"\n | \"enableDelta\"\n | \"enableCrossChain\"\n | \"privyAppId\"\n | \"privyClientId\"\n | \"debug\"\n | \"widgetMode\"\n | \"enableDegenMode\"\n>;\n\nexport type IterableConfig = Pick<\n WidgetConfig,\n | \"srcChains\"\n | \"destChains\"\n | \"tokenLists\"\n | \"tradeModes\"\n | \"excludeUI\"\n | \"devURLs\"\n | \"partnerConfig\"\n | \"referrerConfig\"\n>;\n\ntype PrimitiveConfigState = MarkRequired<\n PrimitiveConfig,\n | \"theme\"\n | \"enableDelta\"\n | \"enableCrossChain\"\n | \"privyAppId\"\n | \"privyClientId\"\n | \"debug\"\n | \"widgetMode\"\n | \"enableDegenMode\"\n>;\n\nexport const defaultWidgetConfig = {\n theme: getDefaultTheme(),\n enableDelta: true,\n enableCrossChain: true,\n privyAppId: import.meta.env.VITE_PRIVY_APP_ID,\n privyClientId: import.meta.env.VITE_PRIVY_CLIENT_ID,\n debug: false,\n widgetMode: \"standalone\",\n enableDegenMode: true,\n} as const satisfies PrimitiveConfig;\n\nexport const widgetConfigAtom = atom<PrimitiveConfigState>(defaultWidgetConfig);\n\nexport const useWidgetConfig = () => {\n return useAtomValue(widgetConfigAtom);\n};\n\nexport const defaultSubConfig = {\n tokenLists: emptyArray,\n srcChains: emptyArray,\n destChains: emptyArray,\n tradeModes: emptyArray,\n excludeUI: emptyArray,\n devURLs: emptyObject,\n partnerConfig: emptyObject,\n referrerConfig: emptyObject,\n} as const satisfies IterableConfig;\n\n// independent atoms for each iterable config property\n// with comparison to avoid unnecessary re-renders\nexport const tokenListsAtom = atomWithCompare<string[]>(\n defaultSubConfig.tokenLists,\n unorderedShallowEqual\n);\nexport const srcChainsAtom = atomWithCompare<SupportedChainId[]>(\n defaultSubConfig.srcChains,\n unorderedShallowEqual\n);\nexport const destChainsAtom = atomWithCompare<SupportedChainId[]>(\n defaultSubConfig.destChains,\n unorderedShallowEqual\n);\n\nexport const tradeModesAtom = atomWithCompare<TradeMode[]>(\n defaultSubConfig.tradeModes,\n unorderedShallowEqual\n);\n\nexport const excludeUIAtom = atomWithCompare<WidgetElements[]>(\n defaultSubConfig.excludeUI,\n unorderedShallowEqual\n);\n\nexport const devURLsAtom = atomWithCompare<DevURLs>(\n defaultSubConfig.devURLs,\n // known properties only comparison\n constructPropertiesEqual([\"apiProxyURL\", \"apiURL\", \"explorerURL\"])\n);\n\nexport const partnerConfigAtom = atomWithCompare<PartnerConfig>(\n defaultSubConfig.partnerConfig,\n constructPropertiesEqual([\n \"partner\",\n \"partnerAddress\",\n \"partnerFeeBps\",\n \"partnerTakesSurplus\",\n ])\n);\n\npartnerConfigAtom.debugLabel = \"partnerConfigAtom\";\n\nexport const referrerConfigAtom = atomWithCompare<ReferrerConfig>(\n defaultSubConfig.referrerConfig,\n constructPropertiesEqual([\"referrerAddress\"])\n);\n\nreferrerConfigAtom.debugLabel = \"referrerConfigAtom\";\n"],"mappings":";;;;;;;AAqDA,IAAaoB,IAAsB;CACjCC,OAAON,GAAiB;CACxBO,aAAa;CACbC,kBAAkB;CAClBC,YAAAA;CACAK,eAAAA;CACAE,OAAO;CACPC,YAAY;CACZC,iBAAiB;CAClB,EAEYE,IAAmBnC,EAA2BoB,EAAoB,EAElEgB,UACJnC,EAAakC,EAAiB,EAG1BE,IAAmB;CAC9BC,YAAY7B;CACZ8B,WAAW9B;CACX+B,YAAY/B;CACZgC,YAAYhC;CACZiC,WAAWjC;CACXkC,SAASjC;CACTkC,eAAelC;CACfmC,gBAAgBnC;CACjB,EAIYoC,IAAiBnC,EAC5B0B,EAAiBC,YACjBzB,EACD,EACYkC,IAAgBpC,EAC3B0B,EAAiBE,WACjB1B,EACD,EACYmC,IAAiBrC,EAC5B0B,EAAiBG,YACjB3B,EACD,EAEYoC,IAAiBtC,EAC5B0B,EAAiBI,YACjB5B,EACD,EAEYqC,IAAgBvC,EAC3B0B,EAAiBK,WACjB7B,EACD,EAEYsC,IAAcxC,EACzB0B,EAAiBM,SAEjB/B,EAAyB;CAAC;CAAe;CAAU;CAAc,CACnE,CAAC,EAEYwC,IAAoBzC,EAC/B0B,EAAiBO,eACjBhC,EAAyB;CACvB;CACA;CACA;CACA;CACD,CACH,CAAC;AAEDwC,EAAkBC,aAAa;AAE/B,IAAaC,IAAqB3C,EAChC0B,EAAiBQ,gBACjBjC,EAAyB,CAAC,kBAAkB,CAC9C,CAAC;AAED0C,EAAmBD,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["chains","PrivyClientConfig","Mutable","privyConfig","loginMethods","embeddedWallets","ethereum","createOnLogin","externalWallets","disableAllExternalWallets","walletConnect","enabled","walletConnectCloudProjectId","import","meta","env","VITE_WALLET_CONNECT_ID","supportedChains"],"sources":["../../../../src/lib/web3/privy/config.ts"],"sourcesContent":["import { chains } from \"@/lib/web3/wagmi/constants\";\nimport { type PrivyClientConfig } from \"@privy-io/react-auth\";\nimport type { Mutable } from \"viem\";\n\nexport const privyConfig: PrivyClientConfig = {\n // appearance: {\n // // showWalletLoginFirst: true,\n // walletChainType: \"ethereum-only\",\n // // @TODO customize theming\n // },\n // loginMethods: [\"wallet\", \"email\"],\n loginMethods: [\"email\"],\n // loginMethodsAndOrder: {\n // primary: [\"metamask\", \"wallet_connect\", \"email\", \"rainbow\"],\n // // overflow: [\"wallet\", \"email\"],\n // }, // can be used to reorder wallets in Connect Wallet Privy modal\n // Create embedded wallets for users who don't have a wallet\n embeddedWallets: {\n ethereum: {\n createOnLogin: \"users-without-wallets\",\n },\n },\n externalWallets: {\n disableAllExternalWallets: true,\n walletConnect: {\n // this doesn't do anything\n enabled: false,\n },\n },\n // another option is to give an invalid ID,\n // but then it retries indefinitely\n walletConnectCloudProjectId: import.meta.env.VITE_WALLET_CONNECT_ID,\n // Privy doesn't accept const Chain[]\n supportedChains: chains as Mutable<typeof chains>,\n // defaultChain: chains[0], @TODO set to App's selected chain\n};\n"],"mappings":";;;AAIA,IAAaG,IAAiC;CAO5CC,cAAc,CAAC,QAAQ;CAMvBC,iBAAiB,EACfC,UAAU,EACRC,eAAe,yBACjB,EACD;CACDC,iBAAiB;EACfC,2BAA2B;EAC3BC,eAAe,EAEbC,SAAS,IACX;EACD;CAGDC,6BAAAA
|
|
1
|
+
{"version":3,"file":"config.js","names":["chains","PrivyClientConfig","Mutable","privyConfig","loginMethods","embeddedWallets","ethereum","createOnLogin","externalWallets","disableAllExternalWallets","walletConnect","enabled","walletConnectCloudProjectId","import","meta","env","VITE_WALLET_CONNECT_ID","supportedChains"],"sources":["../../../../src/lib/web3/privy/config.ts"],"sourcesContent":["import { chains } from \"@/lib/web3/wagmi/constants\";\nimport { type PrivyClientConfig } from \"@privy-io/react-auth\";\nimport type { Mutable } from \"viem\";\n\nexport const privyConfig: PrivyClientConfig = {\n // appearance: {\n // // showWalletLoginFirst: true,\n // walletChainType: \"ethereum-only\",\n // // @TODO customize theming\n // },\n // loginMethods: [\"wallet\", \"email\"],\n loginMethods: [\"email\"],\n // loginMethodsAndOrder: {\n // primary: [\"metamask\", \"wallet_connect\", \"email\", \"rainbow\"],\n // // overflow: [\"wallet\", \"email\"],\n // }, // can be used to reorder wallets in Connect Wallet Privy modal\n // Create embedded wallets for users who don't have a wallet\n embeddedWallets: {\n ethereum: {\n createOnLogin: \"users-without-wallets\",\n },\n },\n externalWallets: {\n disableAllExternalWallets: true,\n walletConnect: {\n // this doesn't do anything\n enabled: false,\n },\n },\n // another option is to give an invalid ID,\n // but then it retries indefinitely\n walletConnectCloudProjectId: import.meta.env.VITE_WALLET_CONNECT_ID,\n // Privy doesn't accept const Chain[]\n supportedChains: chains as Mutable<typeof chains>,\n // defaultChain: chains[0], @TODO set to App's selected chain\n};\n"],"mappings":";;;AAIA,IAAaG,IAAiC;CAO5CC,cAAc,CAAC,QAAQ;CAMvBC,iBAAiB,EACfC,UAAU,EACRC,eAAe,yBACjB,EACD;CACDC,iBAAiB;EACfC,2BAA2B;EAC3BC,eAAe,EAEbC,SAAS,IACX;EACD;CAGDC,6BAAAA;CAEAK,iBAAiBjB;CAElB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/web3/wagmi/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAoC5E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC5B;CACF"}
|
|
@@ -3,26 +3,22 @@ import { LOCAL_STORAGE_PREFIX as t } from "../../constants/storage.js";
|
|
|
3
3
|
import { chains as n } from "./constants.js";
|
|
4
4
|
import { transports as r } from "./transports.js";
|
|
5
5
|
import { createConfig as i, createStorage as a } from "wagmi";
|
|
6
|
-
import { coinbaseWallet as o, injected as s, safe as c
|
|
6
|
+
import { coinbaseWallet as o, injected as s, safe as c } from "wagmi/connectors";
|
|
7
7
|
//#region src/lib/web3/wagmi/config.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o()
|
|
12
|
-
];
|
|
13
|
-
e && u.unshift(c());
|
|
14
|
-
var d = i({
|
|
8
|
+
var l = [s(), o()];
|
|
9
|
+
e && l.unshift(c());
|
|
10
|
+
var u = i({
|
|
15
11
|
storage: a({
|
|
16
12
|
storage: typeof window < "u" ? window.localStorage : void 0,
|
|
17
13
|
key: `${t}_wagmi`
|
|
18
14
|
}),
|
|
19
15
|
chains: n,
|
|
20
|
-
connectors:
|
|
16
|
+
connectors: l,
|
|
21
17
|
transports: r,
|
|
22
18
|
syncConnectedChain: !1,
|
|
23
19
|
batch: { multicall: { wait: 20 } }
|
|
24
20
|
});
|
|
25
21
|
//#endregion
|
|
26
|
-
export {
|
|
22
|
+
export { u as wagmiConfig };
|
|
27
23
|
|
|
28
24
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["createConfig","createStorage","CreateConnectorFn","injected","safe","
|
|
1
|
+
{"version":3,"file":"config.js","names":["createConfig","createStorage","CreateConnectorFn","injected","safe","coinbaseWallet","chains","transports","isInIframe","LOCAL_STORAGE_PREFIX","connectors","unshift","wagmiConfig","storage","window","localStorage","undefined","key","syncConnectedChain","batch","multicall","wait","Register","config"],"sources":["../../../../src/lib/web3/wagmi/config.ts"],"sourcesContent":["import { createConfig, createStorage, type CreateConnectorFn } from \"wagmi\";\nimport {\n injected,\n // metaMask,\n safe,\n // walletConnect,\n coinbaseWallet,\n} from \"wagmi/connectors\";\nimport { chains } from \"./constants\";\nimport { transports } from \"./transports\";\nimport { isInIframe } from \"./isInIframe\";\nimport { LOCAL_STORAGE_PREFIX } from \"@/lib/constants/storage\";\n\n// can add more connectors to cover wallets Privy doesn't support, but need to change UI to allow connection\nconst connectors = [\n // walletConnect({\n // projectId: import.meta.env.VITE_WALLET_CONNECT_ID,\n // }) as CreateConnectorFn,\n injected() as CreateConnectorFn,\n // metaMask() as CreateConnectorFn, // injected() detects metamask already\n coinbaseWallet() as CreateConnectorFn,\n // raw returned types result in\n // The inferred type of 'config' cannot be named without a reference to '.pnpm/@safe-global+safe-apps-provider@0.18.6_typescript@5.8.3/node_modules/@safe-global/safe-apps-provider'. This is likely not portable. A type annotation is necessary.\n\n // getPrivyWalletConnector(), // only CorssApp Privy connector is available, not our use case\n];\n// @TODO see how we can implement Ledger connector, borrow it from rainbowkit?\n\nif (isInIframe) {\n // when widget is in an App inside iframe, chances are we are in Safe web app,\n // allow Safe connector to be used.\n // we can't know if we are inside specifically Safe iframe until we try to connect, though.\n // A check for that is in isInsideSafeIframe.ts\n connectors.unshift(safe());\n}\n\nexport const wagmiConfig = createConfig({\n storage: createStorage({\n storage: typeof window !== \"undefined\" ? window.localStorage : undefined,\n key: `${LOCAL_STORAGE_PREFIX}_wagmi`,\n }),\n chains,\n connectors,\n transports,\n syncConnectedChain: false,\n batch: {\n multicall: {\n wait: 20,\n },\n },\n});\n\ndeclare module \"wagmi\" {\n interface Register {\n config: typeof wagmiConfig;\n }\n}\n"],"mappings":";;;;;;;AAcA,IAAMU,IAAa,CAIjBP,GAAU,EAEVE,GAAgB,CAKjB;AAGGG,KAKFE,EAAWC,QAAQP,GAAM,CAAC;AAG5B,IAAaQ,IAAcZ,EAAa;CACtCa,SAASZ,EAAc;EACrBY,SAAS,OAAOC,SAAW,MAAcA,OAAOC,eAAeC,KAAAA;EAC/DC,KAAK,GAAGR,EAAoB;EAC7B,CAAC;CACFH;CACAI;CACAH;CACAW,oBAAoB;CACpBC,OAAO,EACLC,WAAW,EACTC,MAAM,IACR,EACF;CACD,CAAC"}
|