@treasuredata/tdx 2026.3.25 → 2026.3.26
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/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x20fde9,_0x5e7cd3){const _0x15a377=a125_0x10a8,_0x5e5f0e=_0x20fde9();while(!![]){try{const _0x3c29b7=parseInt(_0x15a377(0x183))/0x1*(-parseInt(_0x15a377(0x18a))/0x2)+-parseInt(_0x15a377(0x18c))/0x3*(parseInt(_0x15a377(0x195))/0x4)+-parseInt(_0x15a377(0x19b))/0x5+parseInt(_0x15a377(0x189))/0x6*(parseInt(_0x15a377(0x187))/0x7)+-parseInt(_0x15a377(0x18f))/0x8*(parseInt(_0x15a377(0x198))/0x9)+parseInt(_0x15a377(0x191))/0xa*(-parseInt(_0x15a377(0x19d))/0xb)+parseInt(_0x15a377(0x185))/0xc*(parseInt(_0x15a377(0x199))/0xd);if(_0x3c29b7===_0x5e7cd3)break;else _0x5e5f0e['push'](_0x5e5f0e['shift']());}catch(_0x7e85a6){_0x5e5f0e['push'](_0x5e5f0e['shift']());}}}(a125_0x4bea,0x1da79));function a125_0x10a8(_0x396f35,_0x5b33fe){_0x396f35=_0x396f35-0x183;const _0x4bea41=a125_0x4bea();let _0x10a8f2=_0x4bea41[_0x396f35];return _0x10a8f2;}export const MODEL_PRICING={'claude-opus-4-6':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-opus-4-5-20251101':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'opus':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'opus[1m]':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-sonnet-4-5-20250929':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'sonnet':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'sonnet[1m]':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'claude-haiku-4-5-20251001':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1},'haiku':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1}};export const EXTENDED_CONTEXT_PRICING={'inputPricePerMTok':0x6,'outputPricePerMTok':22.5,'cacheWritePricePerMTok':7.5,'cacheReadPricePerMTok':0.6};export const USD_PER_AI_CREDIT=54.24;export const CONTEXT_LIMITS={'sonnet':0xf4240,'sonnet[1m]':0xf4240,'haiku':0x30d40,'opus':0xf4240,'opus[1m]':0xf4240,'default':0x30d40};export function getModelPricing(_0x42143b){const _0x584cce=a125_0x10a8;if(MODEL_PRICING[_0x42143b])return MODEL_PRICING[_0x42143b];const _0x4414b0=_0x42143b[_0x584cce(0x18e)]();if(_0x4414b0[_0x584cce(0x197)](_0x584cce(0x194)))return MODEL_PRICING[_0x584cce(0x194)];if(_0x4414b0[_0x584cce(0x197)](_0x584cce(0x18d)))return MODEL_PRICING[_0x584cce(0x18d)];if(_0x4414b0['includes'](_0x584cce(0x184)))return MODEL_PRICING[_0x584cce(0x184)];return MODEL_PRICING[_0x584cce(0x18d)];}export function calculateTokenCost(_0x40415c,_0x5b576d,_0x2bfd0a,_0xa7ded,_0x14e923){const _0x2c8f57=a125_0x10a8,_0x4f5b36=0xf4240;return _0x40415c*_0x14e923[_0x2c8f57(0x192)]/_0x4f5b36+_0x5b576d*_0x14e923['outputPricePerMTok']/_0x4f5b36+_0x2bfd0a*_0x14e923[_0x2c8f57(0x19a)]/_0x4f5b36+_0xa7ded*_0x14e923[_0x2c8f57(0x188)]/_0x4f5b36;}export function usdToAiCredits(_0x198009){return _0x198009/USD_PER_AI_CREDIT;}export function calculateCreditsFromTokens(_0xb38cf2,_0x1c6288,_0x3b45f2,_0x2dba68,_0x341530){const _0x5003be=getModelPricing(_0x341530),_0x41a407=calculateTokenCost(_0xb38cf2,_0x1c6288,_0x3b45f2,_0x2dba68,_0x5003be);return usdToAiCredits(_0x41a407);}export function getContextLimit(_0x347631){const _0x6aa9e5=a125_0x10a8;if(CONTEXT_LIMITS[_0x347631])return CONTEXT_LIMITS[_0x347631];const _0x48aafe=_0x347631[_0x6aa9e5(0x18e)]();if(_0x48aafe[_0x6aa9e5(0x197)]('opus'))return CONTEXT_LIMITS[_0x6aa9e5(0x194)];if(_0x48aafe[_0x6aa9e5(0x197)]('sonnet'))return CONTEXT_LIMITS['sonnet'];if(_0x48aafe['includes'](_0x6aa9e5(0x184)))return CONTEXT_LIMITS[_0x6aa9e5(0x184)];return CONTEXT_LIMITS['default'];}export function getModelDisplayName(_0x18a62d){const _0x25455a=a125_0x10a8,_0x2f311a=_0x18a62d[_0x25455a(0x18e)]();if(_0x2f311a[_0x25455a(0x197)](_0x25455a(0x18d))){if(_0x2f311a['includes'](_0x25455a(0x186))||_0x2f311a[_0x25455a(0x197)]('4.5'))return'Sonnet\x204.5';return _0x25455a(0x190);}if(_0x2f311a['includes']('haiku')){if(_0x2f311a['includes'](_0x25455a(0x186))||_0x2f311a[_0x25455a(0x197)]('4.5'))return _0x25455a(0x19c);return _0x25455a(0x1a1);}if(_0x2f311a[_0x25455a(0x197)]('opus')){if(_0x2f311a[_0x25455a(0x197)](_0x25455a(0x193))||_0x2f311a['includes']('4.6'))return'Opus\x204.6';if(_0x2f311a['includes'](_0x25455a(0x186))||_0x2f311a[_0x25455a(0x197)](_0x25455a(0x19e)))return _0x25455a(0x18b);return _0x25455a(0x19f);}return'Claude';}function a125_0x4bea(){const _0x3da822=['193776NxWSTr','57534lNQTJk','Opus\x204.5','3zTLkrp','sonnet','toLowerCase','488htYfCS','Sonnet\x204','12350xkCORk','inputPricePerMTok','4-6','opus','708604LMIlyG','toLocaleString','includes','31086AoqOib','19045ikBuzo','cacheWritePricePerMTok','625120GGUuzq','Haiku\x204.5','748GOHAhp','4.5','Opus\x204','en-US','Haiku\x204','3HzaqZZ','haiku','5268BqRrOX','4-5','35GCVRaV','cacheReadPricePerMTok'];a125_0x4bea=function(){return _0x3da822;};return a125_0x4bea();}export function formatTokenCount(_0x59a2be){const _0x1d8aa9=a125_0x10a8;return _0x59a2be[_0x1d8aa9(0x196)](_0x1d8aa9(0x1a0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x1658f5=a126_0x23ba;(function(_0xcb9e1a,_0x43f484){const _0x2adde1=a126_0x23ba,_0x172c0f=_0xcb9e1a();while(!![]){try{const _0x8efffb=parseInt(_0x2adde1(0xdc))/0x1*(-parseInt(_0x2adde1(0xeb))/0x2)+parseInt(_0x2adde1(0xdd))/0x3+parseInt(_0x2adde1(0xe4))/0x4*(-parseInt(_0x2adde1(0xd9))/0x5)+parseInt(_0x2adde1(0xd6))/0x6*(parseInt(_0x2adde1(0xe5))/0x7)+parseInt(_0x2adde1(0xd8))/0x8+-parseInt(_0x2adde1(0xe3))/0x9+-parseInt(_0x2adde1(0xda))/0xa;if(_0x8efffb===_0x43f484)break;else _0x172c0f['push'](_0x172c0f['shift']());}catch(_0x4b640e){_0x172c0f['push'](_0x172c0f['shift']());}}}(a126_0x351f,0xb43e7));import{HTTPClient}from'./client/http-client.js';import{getEndpoint}from'./client/endpoints.js';function a126_0x23ba(_0x2c235f,_0x1facec){_0x2c235f=_0x2c235f-0xd0;const _0x351f99=a126_0x351f();let _0x23bad8=_0x351f99[_0x2c235f];return _0x23bad8;}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class PersonalizationSDK{[a126_0x1658f5(0xe9)];constructor(_0x1540d1){const _0x4bf87a=a126_0x1658f5,_0x471ae4=getEndpoint(_0x1540d1['site'],_0x4bf87a(0xd4)),_0x34e5f6=toHeaderRecord(getAuthHeaders(_0x1540d1[_0x4bf87a(0xdb)],_0x1540d1[_0x4bf87a(0xe8)],_0x1540d1[_0x4bf87a(0xdf)]));this[_0x4bf87a(0xe9)]=new HTTPClient(_0x471ae4,{..._0x34e5f6,'Accept':_0x4bf87a(0xd0),'Content-Type':'application/json'},{'proxy':_0x1540d1['proxy']});}async[a126_0x1658f5(0xe2)](_0x423188){const _0x5131c3=a126_0x1658f5,_0x343360=await this[_0x5131c3(0xe9)]['request']('GET',_0x5131c3(0xe0)+_0x423188+_0x5131c3(0xd1));return Array['isArray'](_0x343360)?_0x343360:_0x343360['data']||[];}async['get'](_0x42e656,_0x310903){const _0x15b87d=a126_0x1658f5,_0x1df24d=await this['httpClient'][_0x15b87d(0xde)](_0x15b87d(0xd3),_0x15b87d(0xe0)+_0x42e656+_0x15b87d(0xd2)+_0x310903);return _0x1df24d||{};}async[a126_0x1658f5(0xec)](_0x5d21db,_0x2d152c){const _0x6e19dd=a126_0x1658f5,_0x2fdd5f=await this[_0x6e19dd(0xe9)][_0x6e19dd(0xde)](_0x6e19dd(0xd7),'/audiences/'+_0x5d21db+_0x6e19dd(0xe7),{'body':_0x2d152c});return _0x2fdd5f||{};}async[a126_0x1658f5(0xea)](_0x38e544,_0x1a3e8d,_0x8496f0){const _0xd33cf8=a126_0x1658f5,_0x47aa4c=await this[_0xd33cf8(0xe9)]['request'](_0xd33cf8(0xd5),_0xd33cf8(0xe0)+_0x38e544+'/realtime_personalization_services/'+_0x1a3e8d,{'body':_0x8496f0});return _0x47aa4c||{};}async[a126_0x1658f5(0xe6)](_0x30faba,_0x483a4c){const _0x3f117e=a126_0x1658f5;await this[_0x3f117e(0xe9)][_0x3f117e(0xde)](_0x3f117e(0xe1),_0x3f117e(0xe0)+_0x30faba+_0x3f117e(0xd2)+_0x483a4c);}}function a126_0x351f(){const _0x233f70=['/realtime_personalization_services?page[size]=100','/realtime_personalization_services/','GET','cdp','PUT','38064jritck','POST','5218088mMLugJ','6079985zRTBMk','649570VqHwzY','site','6VMhRpw','2808741BZqFLp','request','accessToken','/audiences/','DELETE','list','1696743CeWmnB','4EVLgIX','1064HPxWVO','delete','/realtime_personalization_services','apiKey','httpClient','update','115012jWQcGm','create','application/vnd.treasuredata.v1+json'];a126_0x351f=function(){return _0x233f70;};return a126_0x351f();}
|
package/dist/sdk/policy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x5a5358=a127_0xcc97;(function(_0x112844,_0x2b50cf){const _0x590cb1=a127_0xcc97,_0x54e719=_0x112844();while(!![]){try{const _0x14f59a=parseInt(_0x590cb1(0xca))/0x1*(-parseInt(_0x590cb1(0xcd))/0x2)+parseInt(_0x590cb1(0xb8))/0x3+parseInt(_0x590cb1(0xbe))/0x4+-parseInt(_0x590cb1(0xb9))/0x5+parseInt(_0x590cb1(0xc1))/0x6+parseInt(_0x590cb1(0xb7))/0x7*(-parseInt(_0x590cb1(0xb1))/0x8)+-parseInt(_0x590cb1(0xb2))/0x9;if(_0x14f59a===_0x2b50cf)break;else _0x54e719['push'](_0x54e719['shift']());}catch(_0x3b0851){_0x54e719['push'](_0x54e719['shift']());}}}(a127_0x15a8,0x74695));import{HTTPClient}from'./client/http-client.js';function a127_0x15a8(){const _0x1d476f=['proxy','GET','getPolicy','toLowerCase','294NknmbF','1831794dUchZu','1893325nysfit','accessToken','/v3/access_control/policies','getMyPermissions','httpClient','1371224nvAjOv','request','/permissions','2427348gYLeAt','find','/users','userSDK','NOT_FOUND','getUserPolicies','/v3/access_control/users/','listPolicies','/v3/access_control/policies/','29PrlRZi','site','apiKey','17194fKOMQC','Policy\x20not\x20found:\x20','name','8968tEIlrX','1854729JUzWLG'];a127_0x15a8=function(){return _0x1d476f;};return a127_0x15a8();}import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{UserSDK}from'./user.js';function a127_0xcc97(_0x26fd65,_0x329c5b){_0x26fd65=_0x26fd65-0xb1;const _0x15a856=a127_0x15a8();let _0xcc97e5=_0x15a856[_0x26fd65];return _0xcc97e5;}import{SDKError,ErrorCode}from'./errors.js';export class PolicySDK{[a127_0x5a5358(0xbd)];[a127_0x5a5358(0xc4)];constructor(_0x587420){const _0x5b8b2b=a127_0x5a5358,_0x24a574=getEndpoint(_0x587420[_0x5b8b2b(0xcb)],'td'),_0xb1dd72=toHeaderRecord(getAuthHeaders(_0x587420[_0x5b8b2b(0xcb)],_0x587420[_0x5b8b2b(0xcc)],_0x587420[_0x5b8b2b(0xba)]));this['httpClient']=new HTTPClient(_0x24a574,_0xb1dd72,{'proxy':_0x587420[_0x5b8b2b(0xb3)]}),this[_0x5b8b2b(0xc4)]=new UserSDK(_0x587420);}async[a127_0x5a5358(0xbc)](){const _0x40ea5d=a127_0x5a5358,_0x12e826=await this[_0x40ea5d(0xc4)]['getCurrent']();return await this[_0x40ea5d(0xbd)][_0x40ea5d(0xbf)](_0x40ea5d(0xb4),_0x40ea5d(0xc7)+_0x12e826['id']);}async[a127_0x5a5358(0xc6)](_0x5d9fb8){const _0x425da1=a127_0x5a5358;return await this[_0x425da1(0xbd)][_0x425da1(0xbf)](_0x425da1(0xb4),_0x425da1(0xc7)+encodeURIComponent(_0x5d9fb8)+'/policies');}async['listPolicies'](){const _0x591d4d=a127_0x5a5358;return await this[_0x591d4d(0xbd)]['request'](_0x591d4d(0xb4),_0x591d4d(0xbb));}async[a127_0x5a5358(0xb5)](_0x268a07){const _0x2e2893=a127_0x5a5358,_0xe1bd78=await this[_0x2e2893(0xc8)](),_0x3c7394=parseInt(_0x268a07,0xa),_0x2c0942=!isNaN(_0x3c7394)?_0xe1bd78['find'](_0x915321=>_0x915321['id']===_0x3c7394):_0xe1bd78[_0x2e2893(0xc2)](_0x14f10e=>_0x14f10e[_0x2e2893(0xcf)][_0x2e2893(0xb6)]()===_0x268a07[_0x2e2893(0xb6)]());if(!_0x2c0942)throw new SDKError(ErrorCode[_0x2e2893(0xc5)],_0x2e2893(0xce)+_0x268a07);return _0x2c0942;}async['getPolicyPermissions'](_0xda4913){const _0x5df6c5=a127_0x5a5358,_0xfba8d4=await this[_0x5df6c5(0xbd)][_0x5df6c5(0xbf)](_0x5df6c5(0xb4),'/v3/access_control/policies/'+encodeURIComponent(_0xda4913)+_0x5df6c5(0xc0));return{'policy_id':_0xda4913,'permissions':_0xfba8d4};}async['getPolicyUsers'](_0x3290e6){const _0x4439cb=a127_0x5a5358;return await this[_0x4439cb(0xbd)][_0x4439cb(0xbf)]('GET',_0x4439cb(0xc9)+encodeURIComponent(_0x3290e6)+_0x4439cb(0xc3));}}
|
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x454ba7=a128_0x9f9d;(function(_0x15fd7c,_0xd35eaf){const _0x395a57=a128_0x9f9d,_0x18d683=_0x15fd7c();while(!![]){try{const _0x4bcec8=parseInt(_0x395a57(0x1eb))/0x1+parseInt(_0x395a57(0x1e2))/0x2*(-parseInt(_0x395a57(0x1de))/0x3)+-parseInt(_0x395a57(0x1f0))/0x4+parseInt(_0x395a57(0x1f7))/0x5*(parseInt(_0x395a57(0x1d7))/0x6)+-parseInt(_0x395a57(0x1d5))/0x7+-parseInt(_0x395a57(0x1e8))/0x8+parseInt(_0x395a57(0x1f8))/0x9;if(_0x4bcec8===_0xd35eaf)break;else _0x18d683['push'](_0x18d683['shift']());}catch(_0x133137){_0x18d683['push'](_0x18d683['shift']());}}}(a128_0x3ca2,0xe4a7f));import{TrinoApiClient}from'../client/trino-api-client.js';import{escapeStringLiteral,buildLikePattern}from'../../utils/string-utils.js';import{SDKError,ErrorCode}from'../errors.js';import{DEFAULT_LISTING_LIMIT}from'../../core/constants.js';function a128_0x9f9d(_0x439ea2,_0x54b174){_0x439ea2=_0x439ea2-0x1cb;const _0x3ca29e=a128_0x3ca2();let _0x9f9dd7=_0x3ca29e[_0x439ea2];return _0x9f9dd7;}function a128_0x3ca2(){const _0x7f1985=['\x0a\x20\x20AND\x20schema_name\x20LIKE\x20','MISSING_ARGUMENT','Table\x20name\x20is\x20required','Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only','3863116YgtLle','Limit\x20must\x20be\x20a\x20positive\x20integer','trim','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.','100ZrjbgE','19396476aRRaYP','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20schema_name\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20schema_name\x20AS\x20database_name\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20','Usage:\x20tdx\x20show\x20<database.table>','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','\x0a\x20\x20\x20\x20','slice','length','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','\x0a\x20\x20AND\x20table_schema\x20LIKE\x20','Usage:\x20tdx\x20describe\x20<database.table>','\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20','INVALID_ARGUMENT','SELECT\x20*\x20FROM\x20','5039076GDZCLh','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','147660fBBOUm','\x20ESCAPE\x20\x27\x5c\x27','Limit\x20must\x20be\x20a\x20positive\x20number','\x0a\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20column_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20data_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20is_nullable\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.columns\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','trinoApiClient','SQL\x20query\x20is\x20required','showTable','12XaYNnl','listDatabases','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_schema\x20AS\x20database_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','529020JVzLQM','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','describeTable','executeQuery','Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.','data','4243448ZdtGzE','Database\x20name\x20is\x20required','listTables','1563329SyCiuF'];a128_0x3ca2=function(){return _0x7f1985;};return a128_0x3ca2();}export class QuerySDK{[a128_0x454ba7(0x1db)];constructor(_0x6b8607){const _0x29d76b=a128_0x454ba7;this[_0x29d76b(0x1db)]=new TrinoApiClient(_0x6b8607);}async['execute'](_0x21d969,_0x5291d9){const _0x205393=a128_0x454ba7;if(!_0x21d969||_0x21d969['trim']()[_0x205393(0x1ce)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x205393(0x1dc),undefined,{'helpText':_0x205393(0x1e6)});return await this[_0x205393(0x1db)]['executeQuery'](_0x21d969,_0x5291d9);}async[a128_0x454ba7(0x1df)](_0x2a44e8,_0x460490=DEFAULT_LISTING_LIMIT){const _0x3dc7ab=a128_0x454ba7;if(_0x2a44e8!==undefined&&_0x2a44e8[_0x3dc7ab(0x1f2)]()[_0x3dc7ab(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x3dc7ab(0x1d3)],'Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x3dc7ab(0x1cb)});if(_0x460490<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3dc7ab(0x1d9),undefined,{'helpText':'Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).'});let _0x1ca4a5=_0x3dc7ab(0x1fb);_0x2a44e8&&(_0x1ca4a5+=_0x3dc7ab(0x1ec)+buildLikePattern(_0x2a44e8)+_0x3dc7ab(0x1d8));_0x1ca4a5+=_0x3dc7ab(0x1e3)+_0x460490;const _0x1c9462=await this[_0x3dc7ab(0x1db)][_0x3dc7ab(0x1e5)](_0x1ca4a5[_0x3dc7ab(0x1f2)]());return _0x1c9462['data'];}async[a128_0x454ba7(0x1ea)](_0x11f31a,_0x5dae92,_0x29444c,_0x4d0478=DEFAULT_LISTING_LIMIT){const _0x4d57e2=a128_0x454ba7;if(_0x11f31a!==undefined&&_0x11f31a[_0x4d57e2(0x1f2)]()[_0x4d57e2(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x4d57e2(0x1d3)],_0x4d57e2(0x1ef),undefined,{'helpText':'Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.'});if(_0x5dae92!==undefined&&_0x5dae92[_0x4d57e2(0x1f2)]()[_0x4d57e2(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x4d57e2(0x1d3)],'Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':'Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.'});if(_0x29444c!==undefined&&_0x29444c[_0x4d57e2(0x1f2)]()[_0x4d57e2(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x4d57e2(0x1d3)],'Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x4d57e2(0x1f6)});if(_0x4d0478<=0x0)throw new SDKError(ErrorCode[_0x4d57e2(0x1d3)],_0x4d57e2(0x1d9),undefined,{'helpText':'Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).'});let _0x592647;_0x11f31a?(_0x592647=_0x4d57e2(0x1e1)+escapeStringLiteral(_0x11f31a)+_0x4d57e2(0x1fa),_0x5dae92&&(_0x592647+=_0x4d57e2(0x1d6)+buildLikePattern(_0x5dae92)+_0x4d57e2(0x1d8)),_0x592647+=_0x4d57e2(0x1f3)+_0x4d0478):(_0x592647=_0x4d57e2(0x1e0),_0x29444c&&(_0x592647+=_0x4d57e2(0x1d0)+buildLikePattern(_0x29444c)+_0x4d57e2(0x1d8)),_0x5dae92&&(_0x592647+=_0x4d57e2(0x1d6)+buildLikePattern(_0x5dae92)+_0x4d57e2(0x1d8)),_0x592647+=_0x4d57e2(0x1d2)+_0x4d0478);const _0x43b718=await this[_0x4d57e2(0x1db)][_0x4d57e2(0x1e5)](_0x592647['trim']());return _0x43b718['data'];}async['validateDatabase'](_0x584b4c){const _0x11837a=a128_0x454ba7,_0xb9b70e=(_0x11837a(0x1f9)+escapeStringLiteral(_0x584b4c)+_0x11837a(0x1cc))[_0x11837a(0x1f2)](),_0x510e77=await this['trinoApiClient'][_0x11837a(0x1e5)](_0xb9b70e);return _0x510e77[_0x11837a(0x1e7)][_0x11837a(0x1ce)]>0x0;}async['validateTable'](_0xa164e8,_0x542ed2){const _0x10fa17=a128_0x454ba7,_0x1c1ecf=('\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20'+escapeStringLiteral(_0xa164e8)+_0x10fa17(0x1cf)+escapeStringLiteral(_0x542ed2)+'\x0a\x20\x20\x20\x20')[_0x10fa17(0x1f2)](),_0x1e9f6a=await this['trinoApiClient'][_0x10fa17(0x1e5)](_0x1c1ecf);return _0x1e9f6a[_0x10fa17(0x1e7)][_0x10fa17(0x1ce)]>0x0;}async[a128_0x454ba7(0x1e4)](_0x4d9f0d,_0x3022c9){const _0x2a0910=a128_0x454ba7;if(!_0x4d9f0d||_0x4d9f0d[_0x2a0910(0x1f2)]()[_0x2a0910(0x1ce)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2a0910(0x1e9),undefined,{'helpText':_0x2a0910(0x1d1)});if(!_0x3022c9||_0x3022c9[_0x2a0910(0x1f2)]()[_0x2a0910(0x1ce)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2a0910(0x1ee),undefined,{'helpText':_0x2a0910(0x1d1)});const _0x522cdd=(_0x2a0910(0x1da)+escapeStringLiteral(_0x4d9f0d)+_0x2a0910(0x1cf)+escapeStringLiteral(_0x3022c9)+_0x2a0910(0x1f5))['trim'](),_0x10421c=await this[_0x2a0910(0x1db)]['executeQuery'](_0x522cdd);return _0x10421c[_0x2a0910(0x1e7)];}async[a128_0x454ba7(0x1dd)](_0x23194c,_0x1ffdb7,_0x30251c=0x28,_0xc0dfdc){const _0x1f2c26=a128_0x454ba7;if(!_0x23194c||_0x23194c['trim']()[_0x1f2c26(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x1f2c26(0x1ed)],'Database\x20name\x20is\x20required',undefined,{'helpText':_0x1f2c26(0x1fc)});if(!_0x1ffdb7||_0x1ffdb7[_0x1f2c26(0x1f2)]()[_0x1f2c26(0x1ce)]===0x0)throw new SDKError(ErrorCode[_0x1f2c26(0x1ed)],_0x1f2c26(0x1ee),undefined,{'helpText':_0x1f2c26(0x1fc)});if(!Number['isInteger'](_0x30251c)||_0x30251c<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1f2c26(0x1f1),undefined,{'helpText':_0x1f2c26(0x1f4)});const _0x32288b=escapeStringLiteral(_0x23194c)[_0x1f2c26(0x1cd)](0x1,-0x1)+'.'+escapeStringLiteral(_0x1ffdb7)['slice'](0x1,-0x1),_0x3efb86=_0x1f2c26(0x1d4)+_0x32288b+'\x20LIMIT\x20'+_0x30251c,_0x4e0671=await this['trinoApiClient']['executeQuery'](_0x3efb86,{'catalog':_0xc0dfdc,'schema':_0x23194c});return _0x4e0671;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a129_0x57df(){const _0x1b4974=['1AmFaVf','toLowerCase','length','filter','line','15127884PJUFaq','7164VzkZKk','4754720oOPvsl','36890yLBJRd','File\x20\x27','stdin','1047088kVAYrJ','21ePLUIb','close','message','replace','join','5VRKAFD','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','5657874oMNzJp','map','stdin\x20','52tObrUS','1600SMIruD','32201ixbQoh','11nBNzRR','264867zeAsiR','trim','error','Error\x20reading\x20from\x20stdin:\x20','push'];a129_0x57df=function(){return _0x1b4974;};return a129_0x57df();}(function(_0x4c2c2c,_0x575e69){const _0x35fb11=a129_0x1bdc,_0x19fd79=_0x4c2c2c();while(!![]){try{const _0x2db2fc=parseInt(_0x35fb11(0x15e))/0x1*(-parseInt(_0x35fb11(0x169))/0x2)+parseInt(_0x35fb11(0x159))/0x3*(-parseInt(_0x35fb11(0x155))/0x4)+parseInt(_0x35fb11(0x16f))/0x5*(-parseInt(_0x35fb11(0x171))/0x6)+parseInt(_0x35fb11(0x16a))/0x7*(-parseInt(_0x35fb11(0x165))/0x8)+parseInt(_0x35fb11(0x164))/0x9*(parseInt(_0x35fb11(0x156))/0xa)+parseInt(_0x35fb11(0x158))/0xb*(-parseInt(_0x35fb11(0x163))/0xc)+parseInt(_0x35fb11(0x157))/0xd*(parseInt(_0x35fb11(0x166))/0xe);if(_0x2db2fc===_0x575e69)break;else _0x19fd79['push'](_0x19fd79['shift']());}catch(_0x6a82c3){_0x19fd79['push'](_0x19fd79['shift']());}}}(a129_0x57df,0xf33ca));import{createInterface}from'readline';import{readFileContent}from'../../utils/file-reader.js';export function stripSqlComments(_0x2d4140){const _0x287593=a129_0x1bdc;let _0x3c873b=_0x2d4140[_0x287593(0x16d)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x3c873b=_0x3c873b[_0x287593(0x16d)](/--.*$/gm,''),_0x3c873b[_0x287593(0x15a)]();}function isEscaped(_0x1a4680,_0x50a82b){let _0x5085c4=0x0;for(let _0x2c65ca=_0x50a82b-0x1;_0x2c65ca>=0x0&&_0x1a4680[_0x2c65ca]==='\x5c';_0x2c65ca--){_0x5085c4++;}return _0x5085c4%0x2===0x1;}export function splitSqlStatements(_0x432a91){const _0x2ad678=a129_0x1bdc,_0x2b62e7=stripSqlComments(_0x432a91);if(!_0x2b62e7)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');const _0x4200ff=[];let _0x5d2dd9='',_0x19e7ac=![],_0x3a0faf=![],_0x2a3b16=![];for(let _0x33d1a1=0x0;_0x33d1a1<_0x432a91[_0x2ad678(0x160)];_0x33d1a1++){const _0x5ade6a=_0x432a91[_0x33d1a1];if(_0x5ade6a==='\x27'&&!isEscaped(_0x432a91,_0x33d1a1)&&!_0x3a0faf&&!_0x2a3b16)_0x19e7ac=!_0x19e7ac;else{if(_0x5ade6a==='\x22'&&!isEscaped(_0x432a91,_0x33d1a1)&&!_0x19e7ac&&!_0x2a3b16)_0x3a0faf=!_0x3a0faf;else _0x5ade6a==='`'&&!isEscaped(_0x432a91,_0x33d1a1)&&!_0x19e7ac&&!_0x3a0faf&&(_0x2a3b16=!_0x2a3b16);}if(_0x5ade6a===';'&&!_0x19e7ac&&!_0x3a0faf&&!_0x2a3b16){const _0x1982cd=_0x5d2dd9['trim']();_0x1982cd&&_0x4200ff[_0x2ad678(0x15d)](_0x1982cd),_0x5d2dd9='';}else _0x5d2dd9+=_0x5ade6a;}const _0x26aed8=_0x5d2dd9[_0x2ad678(0x15a)]();_0x26aed8&&_0x4200ff[_0x2ad678(0x15d)](_0x26aed8);const _0x3d1609=_0x4200ff[_0x2ad678(0x172)](_0x338d52=>_0x338d52[_0x2ad678(0x15a)]())[_0x2ad678(0x161)](_0x3c55ac=>{const _0x4b778e=_0x2ad678,_0x5b299b=stripSqlComments(_0x3c55ac);return _0x5b299b[_0x4b778e(0x160)]>0x0;});if(_0x3d1609[_0x2ad678(0x160)]===0x0)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');return _0x3d1609;}function a129_0x1bdc(_0x37e23a,_0x25565c){_0x37e23a=_0x37e23a-0x155;const _0x57df37=a129_0x57df();let _0x1bdce8=_0x57df37[_0x37e23a];return _0x1bdce8;}export function readSqlStatementsFromFile(_0x16ae76){const _0x380e01=a129_0x1bdc,_0x2cb7b7=readFileContent(_0x16ae76);try{return splitSqlStatements(_0x2cb7b7);}catch(_0x3e9365){throw new Error(_0x380e01(0x167)+_0x16ae76+'\x27\x20'+_0x3e9365[_0x380e01(0x16c)][_0x380e01(0x15f)]());}}export async function readStdinContent(){const _0x279b36=a129_0x1bdc;if(process[_0x279b36(0x168)]['isTTY'])throw new Error(_0x279b36(0x170));return new Promise((_0x5aaca1,_0x5d5f87)=>{const _0x4a2de2=_0x279b36,_0x854f08=[],_0x4f699d=createInterface({'input':process[_0x4a2de2(0x168)],'terminal':![]});_0x4f699d['on'](_0x4a2de2(0x162),_0x15620b=>{const _0x16614a=_0x4a2de2;_0x854f08[_0x16614a(0x15d)](_0x15620b);}),_0x4f699d['on'](_0x4a2de2(0x16b),()=>{const _0x38aa16=_0x4a2de2;_0x5aaca1(_0x854f08[_0x38aa16(0x16e)]('\x0a'));}),_0x4f699d['on'](_0x4a2de2(0x15b),_0x5df853=>{const _0x393c8b=_0x4a2de2;_0x4f699d[_0x393c8b(0x16b)](),_0x5d5f87(new Error(_0x393c8b(0x15c)+_0x5df853[_0x393c8b(0x16c)]));});});}export async function readSqlStatementsFromStdin(){const _0x373ecc=a129_0x1bdc,_0x118293=await readStdinContent();try{return splitSqlStatements(_0x118293);}catch(_0x1d39d8){throw new Error(_0x373ecc(0x173)+_0x1d39d8[_0x373ecc(0x16c)][_0x373ecc(0x15f)]());}}export function isSqlFilePath(_0x3bc970){return/\w\.sql$/['test'](_0x3bc970);}
|
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x3a3f49=a130_0x5765;(function(_0x19eeaa,_0x416bb7){const _0x23b04a=a130_0x5765,_0x4ed80a=_0x19eeaa();while(!![]){try{const _0x5aa717=parseInt(_0x23b04a(0x6f))/0x1+-parseInt(_0x23b04a(0x80))/0x2*(-parseInt(_0x23b04a(0x6b))/0x3)+parseInt(_0x23b04a(0x75))/0x4*(parseInt(_0x23b04a(0x7c))/0x5)+parseInt(_0x23b04a(0x6e))/0x6*(-parseInt(_0x23b04a(0x85))/0x7)+-parseInt(_0x23b04a(0x6a))/0x8+parseInt(_0x23b04a(0x6d))/0x9*(parseInt(_0x23b04a(0x7f))/0xa)+-parseInt(_0x23b04a(0x81))/0xb*(parseInt(_0x23b04a(0x76))/0xc);if(_0x5aa717===_0x416bb7)break;else _0x4ed80a['push'](_0x4ed80a['shift']());}catch(_0x264744){_0x4ed80a['push'](_0x4ed80a['shift']());}}}(a130_0x35eb,0x44a01));import{HTTPClient}from'./client/http-client.js';function a130_0x5765(_0x2abb1f,_0x325a00){_0x2abb1f=_0x2abb1f-0x64;const _0x35ebde=a130_0x35eb();let _0x57656c=_0x35ebde[_0x2abb1f];return _0x57656c;}import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class RealtimeSDK{['httpClient'];[a130_0x3a3f49(0x79)];constructor(_0x11a8fc){const _0x4a3a4e=a130_0x3a3f49,_0x4a61fb=getEndpoint(_0x11a8fc[_0x4a3a4e(0x7e)],'cdp'),_0x42e64f=toHeaderRecord(getAuthHeaders(_0x11a8fc['site'],_0x11a8fc[_0x4a3a4e(0x84)],_0x11a8fc[_0x4a3a4e(0x66)]));this['httpClient']=new HTTPClient(_0x4a61fb,{..._0x42e64f,'Accept':_0x4a3a4e(0x69),'Content-Type':'application/json'},{'proxy':_0x11a8fc[_0x4a3a4e(0x89)]}),this[_0x4a3a4e(0x79)]=new CDPApiClient(_0x11a8fc);}async['isEnabled'](_0x5d1460){const _0x4f1f14=a130_0x3a3f49;try{const _0x3c15e4=await this['httpClient'][_0x4f1f14(0x74)](_0x4f1f14(0x7b),_0x4f1f14(0x7a)+_0x5d1460+_0x4f1f14(0x6c));return _0x3c15e4!==null;}catch{return![];}}async[a130_0x3a3f49(0x87)](_0x1978a5){const _0x341850=a130_0x3a3f49,_0x6463f1=await this[_0x341850(0x79)]['getParentSegment'](_0x1978a5);let _0x3ec6e3=![],_0x1f2275=![];try{const _0x459f08=await this[_0x341850(0x8a)]['request'](_0x341850(0x7b),_0x341850(0x7a)+_0x1978a5+_0x341850(0x6c));_0x3ec6e3=!![],_0x1f2275=!!(_0x459f08&&typeof _0x459f08===_0x341850(0x73)&&Object[_0x341850(0x71)](_0x459f08)[_0x341850(0x7d)]>0x0);}catch{_0x3ec6e3=![],_0x1f2275=![];}return{'parent_segment_id':_0x1978a5,'parent_segment_name':_0x6463f1['attributes'][_0x341850(0x82)],'realtime_enabled':_0x3ec6e3,'realtime_config_exists':_0x1f2275,'status':_0x3ec6e3?_0x341850(0x70):'disabled'};}async[a130_0x3a3f49(0x64)](_0x27db4a){const _0x4b51a1=a130_0x3a3f49,_0x1868c5=await this['httpClient'][_0x4b51a1(0x74)](_0x4b51a1(0x7b),_0x4b51a1(0x7a)+_0x27db4a+_0x4b51a1(0x6c));return _0x1868c5||{};}async[a130_0x3a3f49(0x77)](_0x25bb71,_0x31f284){const _0x4d2e82=a130_0x3a3f49,_0x30884c=await this[_0x4d2e82(0x8a)][_0x4d2e82(0x74)](_0x4d2e82(0x68),_0x4d2e82(0x7a)+_0x25bb71+_0x4d2e82(0x6c),{'body':_0x31f284});return _0x30884c||{};}async[a130_0x3a3f49(0x88)](){const _0xdd437b=a130_0x3a3f49,_0x42a0c5=await this[_0xdd437b(0x79)]['listParentSegments'](),_0x2b5053=await Promise[_0xdd437b(0x86)](_0x42a0c5[_0xdd437b(0x78)](async _0x68d019=>{const _0x22c7de=_0xdd437b,_0x1c4fa5=await this['isEnabled'](_0x68d019['id']);return{'id':_0x68d019['id'],'name':_0x68d019[_0x22c7de(0x83)]['name'],'population':_0x68d019[_0x22c7de(0x83)][_0x22c7de(0x65)],'realtime_enabled':_0x1c4fa5,'schedule_type':_0x68d019[_0x22c7de(0x83)][_0x22c7de(0x67)],'updated_at':_0x68d019[_0x22c7de(0x83)][_0x22c7de(0x72)]};}));return _0x2b5053;}}function a130_0x35eb(){const _0x572721=['accessToken','scheduleType','PUT','application/vnd.treasuredata.v1+json','2399768NmCdbB','646803WtRyfs','/realtime_setting','81nsdUKt','12CODRRj','202834MyYWpZ','enabled','keys','updatedAt','object','request','4VGVqTj','12wwCUGX','updateConfig','map','cdpClient','/audiences/','GET','2385940cYuHmS','length','site','446990ikOGWP','2KIojHp','7751678ToMwEQ','name','attributes','apiKey','42546watAMl','all','getStatus','list','proxy','httpClient','getConfig','population'];a130_0x35eb=function(){return _0x572721;};return a130_0x35eb();}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x51ba27=a131_0x4062;(function(_0x154c5a,_0x1b75d5){const _0x36a2f3=a131_0x4062,_0x586812=_0x154c5a();while(!![]){try{const _0xff784c=parseInt(_0x36a2f3(0x151))/0x1*(parseInt(_0x36a2f3(0x154))/0x2)+-parseInt(_0x36a2f3(0x150))/0x3+-parseInt(_0x36a2f3(0x167))/0x4*(-parseInt(_0x36a2f3(0x13a))/0x5)+-parseInt(_0x36a2f3(0x157))/0x6*(parseInt(_0x36a2f3(0x15e))/0x7)+-parseInt(_0x36a2f3(0x14e))/0x8*(parseInt(_0x36a2f3(0x140))/0x9)+-parseInt(_0x36a2f3(0x135))/0xa*(-parseInt(_0x36a2f3(0x130))/0xb)+-parseInt(_0x36a2f3(0x143))/0xc*(-parseInt(_0x36a2f3(0x12a))/0xd);if(_0xff784c===_0x1b75d5)break;else _0x586812['push'](_0x586812['shift']());}catch(_0x2fbb33){_0x586812['push'](_0x586812['shift']());}}}(a131_0x1c14,0x8ca14));function a131_0x1c14(){const _0x5b57fc=['now','created_at','4940844MgeONS','num','update','INVALID_ARGUMENT','deleteSchedule','Type\x20is\x20required','createSchedule','\x20UTC','type','map','database','376niHzrr','history','605874HZinvn','576151SnOAXi','filter','cron','2pGIIFV','client','floor','6LZgPNF','Schedule\x20name\x20is\x20required','query','find','has_next_page','NOT_FOUND','test','7476091BTnYxH','getTime','listSchedules','time','runSchedule','replace','create','limit','updated_at','995828TzVHFP','listQueries','queries','13CaEaam','list','\x5c$&','slice','length','Schedule\x20not\x20found:\x20','11MEjngw','getScheduleHistory','run','end_at','desc','1950330mlIiYI','name','Database\x20is\x20required','scheduled','push','15KtChLY','start_at','num\x20must\x20be\x20between\x201\x20and\x2010','pattern','pagination','Invalid\x20time\x20format:\x20','16047ACkCRJ'];a131_0x1c14=function(){return _0x5b57fc;};return a131_0x1c14();}import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x3a0ba3){const _0x514136=a131_0x4062;if(!_0x3a0ba3)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x514136(0x15d)](_0x3a0ba3))return _0x3a0ba3;return _0x3a0ba3['replace'](_0x514136(0x14a),'Z')['replace']('\x20','T');}function a131_0x4062(_0x3484f7,_0xd48437){_0x3484f7=_0x3484f7-0x12a;const _0x1c1429=a131_0x1c14();let _0x406270=_0x1c1429[_0x3484f7];return _0x406270;}export class ScheduleSDK{[a131_0x51ba27(0x155)];constructor(_0x349371){const _0x1939aa=a131_0x51ba27;this[_0x1939aa(0x155)]=new TDApiClient(_0x349371);}async[a131_0x51ba27(0x12b)](_0x313c4e){const _0x5b769e=a131_0x51ba27,_0x502f15=await this[_0x5b769e(0x155)]['listSchedules'](),_0x5e5cbb=_0x502f15['map'](_0x34a690=>({..._0x34a690,'created_at':normalizeTimestamp(_0x34a690[_0x5b769e(0x142)])??_0x34a690[_0x5b769e(0x142)]}));if(_0x313c4e?.[_0x5b769e(0x165)]&&_0x313c4e['limit']>0x0)return _0x5e5cbb[_0x5b769e(0x12d)](0x0,_0x313c4e[_0x5b769e(0x165)]);return _0x5e5cbb;}async[a131_0x51ba27(0x168)](_0x5bb91d){const _0x4ef00d=a131_0x51ba27,_0x348151=0x64,_0x2c7d91=_0x5bb91d?.['limit'],_0x3b1e3f=[];let _0x26d0c9=!![],_0x343d23,_0x5e9376,_0x29a6d8;if(_0x5bb91d?.[_0x4ef00d(0x13d)]){const _0x5ca3dc=_0x5bb91d[_0x4ef00d(0x13d)][_0x4ef00d(0x163)](/[.+^${}()|[\]\\]/g,_0x4ef00d(0x12c)),_0x36d082=_0x5ca3dc[_0x4ef00d(0x163)](/\*/g,'.*')[_0x4ef00d(0x163)](/\?/g,'.');_0x29a6d8=new RegExp('^'+_0x36d082+'$','i');}while(_0x26d0c9&&(!_0x2c7d91||_0x3b1e3f['length']<_0x2c7d91)){const _0x47a524=await this[_0x4ef00d(0x155)][_0x4ef00d(0x168)]({'anchor_column':_0x4ef00d(0x166),'sort_direction':_0x4ef00d(0x134),'page_size':_0x348151,'anchor_id':_0x343d23,'anchor_value':_0x5e9376});let _0x24cc78=_0x47a524['queries'];_0x5bb91d?.[_0x4ef00d(0x138)]&&(_0x24cc78=_0x24cc78[_0x4ef00d(0x152)](_0x33d2e0=>_0x33d2e0[_0x4ef00d(0x153)]!==null));_0x29a6d8&&(_0x24cc78=_0x24cc78[_0x4ef00d(0x152)](_0x360299=>_0x360299[_0x4ef00d(0x136)]&&_0x29a6d8[_0x4ef00d(0x15d)](_0x360299[_0x4ef00d(0x136)])));_0x3b1e3f[_0x4ef00d(0x139)](..._0x24cc78),_0x26d0c9=_0x47a524[_0x4ef00d(0x13e)][_0x4ef00d(0x15b)];if(_0x26d0c9&&_0x47a524[_0x4ef00d(0x169)]['length']>0x0){const _0x16cbb0=_0x47a524[_0x4ef00d(0x169)][_0x47a524[_0x4ef00d(0x169)][_0x4ef00d(0x12e)]-0x1];_0x343d23=_0x16cbb0['id'],_0x5e9376=_0x16cbb0[_0x4ef00d(0x166)];}}const _0x4f9b64=_0x2c7d91?_0x3b1e3f[_0x4ef00d(0x12d)](0x0,_0x2c7d91):_0x3b1e3f;return{'queries':_0x4f9b64,'pagination':{'has_next_page':_0x26d0c9||(_0x2c7d91?_0x3b1e3f[_0x4ef00d(0x12e)]>_0x2c7d91:![])}};}async['show'](_0x549cdf){const _0x4b6a37=a131_0x51ba27,_0x1e5486=await this[_0x4b6a37(0x155)][_0x4b6a37(0x160)](),_0x388537=_0x1e5486[_0x4b6a37(0x15a)](_0x587b41=>_0x587b41['name']===_0x549cdf);if(!_0x388537)throw new SDKError(ErrorCode[_0x4b6a37(0x15c)],_0x4b6a37(0x12f)+_0x549cdf);return{..._0x388537,'created_at':normalizeTimestamp(_0x388537[_0x4b6a37(0x142)])??_0x388537[_0x4b6a37(0x142)]};}async[a131_0x51ba27(0x164)](_0x59ee39,_0x1a1a88){const _0x303244=a131_0x51ba27;if(!_0x59ee39)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x303244(0x158));if(!_0x1a1a88[_0x303244(0x14d)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x303244(0x137));if(!_0x1a1a88[_0x303244(0x159)])throw new SDKError(ErrorCode[_0x303244(0x146)],'Query\x20is\x20required');if(!_0x1a1a88[_0x303244(0x14b)])throw new SDKError(ErrorCode[_0x303244(0x146)],_0x303244(0x148));return await this['client'][_0x303244(0x149)](_0x59ee39,_0x1a1a88);}async[a131_0x51ba27(0x145)](_0x3d1fe7,_0xf1e2a6){const _0x6fd71d=a131_0x51ba27;if(!_0x3d1fe7)throw new SDKError(ErrorCode[_0x6fd71d(0x146)],_0x6fd71d(0x158));return await this[_0x6fd71d(0x155)]['updateSchedule'](_0x3d1fe7,_0xf1e2a6);}async['delete'](_0x451413){const _0x2d63ca=a131_0x51ba27;if(!_0x451413)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2d63ca(0x158));return await this[_0x2d63ca(0x155)][_0x2d63ca(0x147)](_0x451413);}async[a131_0x51ba27(0x132)](_0x53b35d,_0x54b990){const _0x5a7c2c=a131_0x51ba27;if(!_0x53b35d)throw new SDKError(ErrorCode[_0x5a7c2c(0x146)],_0x5a7c2c(0x158));let _0x1253ca;if(_0x54b990?.[_0x5a7c2c(0x161)]){const _0x40e2c5=typeof _0x54b990[_0x5a7c2c(0x161)]==='string'?new Date(_0x54b990[_0x5a7c2c(0x161)]):_0x54b990['time'];if(isNaN(_0x40e2c5[_0x5a7c2c(0x15f)]()))throw new SDKError(ErrorCode[_0x5a7c2c(0x146)],_0x5a7c2c(0x13f)+_0x54b990[_0x5a7c2c(0x161)]);_0x1253ca=Math[_0x5a7c2c(0x156)](_0x40e2c5[_0x5a7c2c(0x15f)]()/0x3e8);}else _0x1253ca=Math['floor'](Date[_0x5a7c2c(0x141)]()/0x3e8);if(_0x54b990?.[_0x5a7c2c(0x144)]!==undefined){if(_0x54b990['num']<0x1||_0x54b990[_0x5a7c2c(0x144)]>0xa)throw new SDKError(ErrorCode[_0x5a7c2c(0x146)],_0x5a7c2c(0x13c));}return await this[_0x5a7c2c(0x155)][_0x5a7c2c(0x162)](_0x53b35d,_0x1253ca,_0x54b990?.[_0x5a7c2c(0x144)]);}async[a131_0x51ba27(0x14f)](_0x8f24,_0xf632ea){const _0x20373e=a131_0x51ba27;if(!_0x8f24)throw new SDKError(ErrorCode[_0x20373e(0x146)],_0x20373e(0x158));const _0x5cd848=await this[_0x20373e(0x155)][_0x20373e(0x131)](_0x8f24,_0xf632ea);return{..._0x5cd848,'history':_0x5cd848[_0x20373e(0x14f)][_0x20373e(0x14c)](_0x233d57=>({..._0x233d57,'created_at':normalizeTimestamp(_0x233d57['created_at']),'start_at':normalizeTimestamp(_0x233d57[_0x20373e(0x13b)]),'end_at':normalizeTimestamp(_0x233d57[_0x20373e(0x133)])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a132_0x30178c=a132_0x533b;(function(_0xdfb95a,_0x2158d3){const _0x28a0e8=a132_0x533b,_0x27bc30=_0xdfb95a();while(!![]){try{const _0x380ed0=parseInt(_0x28a0e8(0x84))/0x1+-parseInt(_0x28a0e8(0xcb))/0x2+parseInt(_0x28a0e8(0x93))/0x3+parseInt(_0x28a0e8(0xef))/0x4*(-parseInt(_0x28a0e8(0xd6))/0x5)+parseInt(_0x28a0e8(0x10d))/0x6*(-parseInt(_0x28a0e8(0xc1))/0x7)+-parseInt(_0x28a0e8(0x114))/0x8+parseInt(_0x28a0e8(0xe8))/0x9*(-parseInt(_0x28a0e8(0xb4))/0xa);if(_0x380ed0===_0x2158d3)break;else _0x27bc30['push'](_0x27bc30['shift']());}catch(_0x475f16){_0x27bc30['push'](_0x27bc30['shift']());}}}(a132_0x541c,0xedd24));import*as a132_0x9b0620 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x19252e){return _0x19252e;}function ruleDefAsFilterRule(_0x51c3d4){return _0x51c3d4;}export function segmentResponseToDefSync(_0x1ac718,_0x2886b1){const _0x510323=a132_0x533b,_0x249583=_0x1ac718[_0x510323(0xc3)]&&_0x510323(0xf5)in _0x1ac718['rule']&&_0x1ac718[_0x510323(0xc3)]['type'];return{'type':_0x510323(0xac),'name':_0x1ac718[_0x510323(0xee)],..._0x1ac718[_0x510323(0xce)]&&{'description':_0x1ac718[_0x510323(0xce)]},..._0x2886b1&&{'folder':_0x2886b1},..._0x249583&&{'rule':apiRuleToYaml(_0x1ac718[_0x510323(0xc3)])},..._0x1ac718[_0x510323(0xf3)]!==undefined&&{'kind':_0x1ac718[_0x510323(0xf3)]===0x0?_0x510323(0xa3):_0x1ac718[_0x510323(0xf3)]===0x1?_0x510323(0xb9):_0x510323(0xc9)},..._0x1ac718[_0x510323(0xb5)]!==undefined&&{'visible':_0x1ac718[_0x510323(0xb5)]}};}export async function segmentResponseToDef(_0x34a04c,_0x13d435,_0xeafa8f){const _0x4f029a=a132_0x533b,_0x53dfef=segmentResponseToDefSync(_0x34a04c,_0xeafa8f);if(!_0x13d435||!_0x13d435[_0x4f029a(0x101)])return _0x53dfef;return _0x53dfef[_0x4f029a(0xc3)]&&(_0x53dfef[_0x4f029a(0xc3)]=await resolveRuleSegmentRefs(_0x53dfef['rule'],_0x13d435[_0x4f029a(0x101)])),_0x53dfef;}export function apiRuleToYaml(_0x17a700){const _0x328353=a132_0x533b,_0x3053e4=(_0x17a700['conditions']||[])[_0x328353(0xbe)](apiConditionToYaml);if(_0x3053e4['length']===0x1&&!_0x17a700[_0x328353(0xce)]&&'type'in _0x3053e4[0x0]&&(_0x3053e4[0x0]['type']===_0x328353(0xa0)||_0x3053e4[0x0][_0x328353(0xf5)]==='Or')){const _0x4122a7=_0x3053e4[0x0];if(_0x4122a7[_0x328353(0xf5)]===_0x17a700[_0x328353(0xf5)]&&_0x4122a7[_0x328353(0xfe)])return{'type':_0x17a700['type'],'conditions':_0x4122a7[_0x328353(0xfe)],..._0x4122a7[_0x328353(0xce)]&&{'description':_0x4122a7['description']}};}return{'type':_0x17a700['type'],'conditions':_0x3053e4,..._0x17a700[_0x328353(0xce)]&&{'description':_0x17a700['description']}};}export async function resolveRuleSegmentRefs(_0x2c790a,_0x1099e1){const _0x27d494=a132_0x533b;return transformRuleSegmentRefs(_0x2c790a,_0x1099e1,_0x489237=>/^\d+$/[_0x27d494(0xe0)](_0x489237));}async function transformConditionSegmentRefs(_0x328cef,_0x23b307,_0x1a5492,_0x397a4f){const _0x4ccd27=a132_0x533b;if('segment'in _0x328cef&&(_0x328cef[_0x4ccd27(0xf5)]===_0x4ccd27(0x83)||_0x328cef[_0x4ccd27(0xf5)]===_0x4ccd27(0xc6))){const _0x358951=_0x328cef;if(_0x1a5492(_0x358951[_0x4ccd27(0xac)]))return{..._0x358951,'segment':await _0x23b307(_0x358951[_0x4ccd27(0xac)])};return _0x328cef;}if(_0x4ccd27(0xfe)in _0x328cef&&_0x328cef[_0x4ccd27(0xfe)]){const _0x1ef2c2=_0x328cef,_0x42e81f=await Promise[_0x4ccd27(0xf2)](_0x1ef2c2[_0x4ccd27(0xfe)][_0x4ccd27(0xbe)](_0x1111b0=>transformConditionSegmentRefs(_0x1111b0,_0x23b307,_0x1a5492,_0x397a4f)));return{..._0x1ef2c2,'conditions':_0x42e81f};}if(_0x4ccd27(0x105)in _0x328cef&&_0x328cef[_0x4ccd27(0x105)]){const _0xc87bc8=_0x328cef,_0x4e0d9d=await _0x397a4f(filterRuleAsRuleDef(_0xc87bc8[_0x4ccd27(0x105)]),_0x23b307);return{..._0xc87bc8,'filter':ruleDefAsFilterRule(_0x4e0d9d)};}return _0x328cef;}async function transformRuleSegmentRefs(_0x4b16d1,_0xbe4935,_0x1017f8){const _0x4c402a=a132_0x533b,_0xc99ca5=(_0x5c4118,_0x1f6f19)=>transformRuleSegmentRefs(_0x5c4118,_0x1f6f19,_0x1017f8),_0x43bf03=await Promise[_0x4c402a(0xf2)](_0x4b16d1[_0x4c402a(0xfe)]['map'](_0x22f235=>transformConditionSegmentRefs(_0x22f235,_0xbe4935,_0x1017f8,_0xc99ca5)));return{..._0x4b16d1,'conditions':_0x43bf03};}export async function resolveRuleSegmentIds(_0x1cbdfa,_0x1506ec){const _0x52c634=a132_0x533b;return transformRuleSegmentRefs(_0x1cbdfa,_0x1506ec,_0x18c70f=>!/^\d+$/[_0x52c634(0xe0)](_0x18c70f));}function isBehaviorApiCondition(_0x383d06){const _0x548a21=a132_0x533b;if(!_0x383d06[_0x548a21(0xae)]?.[_0x548a21(0x92)]?.[_0x548a21(0xee)])return![];return!![];}function apiConditionToYaml(_0x25ed11){const _0x5f22d3=a132_0x533b;if(_0x25ed11[_0x5f22d3(0xf5)]===_0x5f22d3(0xa0)||_0x25ed11[_0x5f22d3(0xf5)]==='Or'){if(_0x25ed11[_0x5f22d3(0xfe)]){const _0x2a5f4d=_0x25ed11[_0x5f22d3(0xfe)]['map'](apiConditionToYaml);if(_0x2a5f4d['length']===0x1&&!_0x25ed11['description'])return _0x2a5f4d[0x0];return{'type':_0x25ed11['type'],'conditions':_0x2a5f4d,..._0x25ed11[_0x5f22d3(0xce)]&&{'description':_0x25ed11[_0x5f22d3(0xce)]}};}}if(_0x25ed11[_0x5f22d3(0xf5)]===_0x5f22d3(0xfb)&&_0x25ed11[_0x5f22d3(0xae)]&&_0x25ed11['operator']){const _0x1795a5=_0x25ed11[_0x5f22d3(0xae)]['aggregation']?buildAggregationDefFromApi(_0x25ed11[_0x5f22d3(0xae)][_0x5f22d3(0xd2)]):undefined;if(isBehaviorApiCondition(_0x25ed11)){const _0x4ff526=_0x25ed11[_0x5f22d3(0xae)][_0x5f22d3(0x92)]['name'];return{'type':'Behavior','attribute':'','operator':apiOperatorToYaml(_0x25ed11[_0x5f22d3(0x79)]),..._0x25ed11[_0x5f22d3(0x94)]&&_0x25ed11[_0x5f22d3(0x94)]!==_0x5f22d3(0x106)?{'arrayMatching':_0x25ed11[_0x5f22d3(0x94)]}:{},..._0x25ed11[_0x5f22d3(0xc6)]?{'exclude':_0x25ed11['exclude']}:{},..._0x1795a5?{'aggregation':_0x1795a5}:{},'source':_0x4ff526,..._0x25ed11['leftValue'][_0x5f22d3(0x105)]?{'filter':apiRuleToYaml(_0x25ed11[_0x5f22d3(0xae)]['filter'])}:{},..._0x25ed11['limit']!==undefined&&_0x25ed11[_0x5f22d3(0x10e)]!==null?{'limit':_0x25ed11[_0x5f22d3(0x10e)]}:{}};}return{'type':_0x5f22d3(0xfb),'attribute':_0x25ed11[_0x5f22d3(0xae)]['name']||'','operator':apiOperatorToYaml(_0x25ed11['operator']),..._0x25ed11[_0x5f22d3(0x94)]&&_0x25ed11[_0x5f22d3(0x94)]!=='any'?{'arrayMatching':_0x25ed11[_0x5f22d3(0x94)]}:{},..._0x25ed11[_0x5f22d3(0xc6)]?{'exclude':_0x25ed11['exclude']}:{},..._0x1795a5?{'aggregation':_0x1795a5}:{},..._0x25ed11[_0x5f22d3(0xae)]['filter']?{'filter':apiRuleToYaml(_0x25ed11['leftValue'][_0x5f22d3(0x105)])}:{},..._0x25ed11['limit']!==undefined&&_0x25ed11['limit']!==null?{'limit':_0x25ed11[_0x5f22d3(0x10e)]}:{}};}if(_0x25ed11[_0x5f22d3(0xf5)]==='Column'&&_0x25ed11[_0x5f22d3(0x9f)]&&_0x25ed11[_0x5f22d3(0x79)])return{'type':'Column','column':_0x25ed11[_0x5f22d3(0x9f)],'operator':apiOperatorToYaml(_0x25ed11['operator'])};if(_0x25ed11['type']===_0x5f22d3(0x107)&&_0x25ed11['id'])return{'type':_0x25ed11[_0x5f22d3(0xc6)]?_0x5f22d3(0xc6):_0x5f22d3(0x83),'segment':_0x25ed11['id']};return{'type':_0x5f22d3(0xa0),'conditions':[]};}function isTemporalOperator(_0x47cae6){const _0x68034c=a132_0x533b;return _0x47cae6===_0x68034c(0x113)||_0x47cae6===_0x68034c(0xff);}function isBetweenOperator(_0x124c8c){return _0x124c8c==='Between';}function getEffectiveValue(_0x7f68d7){const _0x239f60=a132_0x533b,_0x306041=_0x7f68d7[_0x239f60(0xb7)];return _0x7f68d7[_0x239f60(0xcc)]??_0x306041;}function parseNumericValue(_0x285c62){const _0x2bd712=a132_0x533b;if(typeof _0x285c62===_0x2bd712(0x95)&&_0x285c62!==null)return _0x285c62;if(_0x285c62==='')return _0x285c62;const _0x449e61=Number(_0x285c62);return Number['isFinite'](_0x449e61)?_0x449e61:_0x285c62;}function apiOperatorToYaml(_0x3df5bd){const _0x1f5de9=a132_0x533b;if(isBetweenOperator(_0x3df5bd['type']))return{'type':mapApiOperatorType(_0x3df5bd[_0x1f5de9(0xf5)]),..._0x3df5bd[_0x1f5de9(0x7b)]!==undefined&&{'not':_0x3df5bd[_0x1f5de9(0x7b)]},..._0x3df5bd[_0x1f5de9(0xe5)]!==undefined&&{'min':parseNumericValue(_0x3df5bd[_0x1f5de9(0xe5)])},..._0x3df5bd[_0x1f5de9(0x10f)]!==undefined&&{'max':parseNumericValue(_0x3df5bd[_0x1f5de9(0x10f)])}};if(_0x3df5bd[_0x1f5de9(0xf5)]===_0x1f5de9(0x104))return{'type':_0x1f5de9(0x104),..._0x3df5bd[_0x1f5de9(0x7b)]!==undefined&&{'not':_0x3df5bd[_0x1f5de9(0x7b)]},..._0x3df5bd[_0x1f5de9(0x99)]!==undefined&&{'duration':_0x3df5bd['duration']},..._0x3df5bd[_0x1f5de9(0xbc)]!==undefined&&{'from':_0x3df5bd[_0x1f5de9(0xbc)]},..._0x3df5bd[_0x1f5de9(0x8f)]!==undefined&&{'reverse':_0x3df5bd[_0x1f5de9(0x8f)]}};let _0x3410f7;if(_0x3df5bd['rightValues']&&_0x3df5bd[_0x1f5de9(0x110)][_0x1f5de9(0xfc)]>0x0)_0x3410f7=_0x3df5bd['rightValues'];else{if(_0x3df5bd['rightValue']!==undefined)_0x3410f7=_0x3df5bd[_0x1f5de9(0xd1)];else isTemporalOperator(_0x3df5bd[_0x1f5de9(0xf5)])&&_0x3df5bd[_0x1f5de9(0xcc)]!==undefined&&(_0x3410f7=_0x3df5bd[_0x1f5de9(0xcc)]);}return{'type':mapApiOperatorType(_0x3df5bd[_0x1f5de9(0xf5)]),..._0x3df5bd[_0x1f5de9(0x7b)]!==undefined&&{'not':_0x3df5bd[_0x1f5de9(0x7b)]},..._0x3410f7!==undefined&&{'value':_0x3410f7},..._0x3df5bd['unit']!==undefined&&{'unit':_0x3df5bd[_0x1f5de9(0x8b)]}};}function mapApiOperatorType(_0x3c592e){return _0x3c592e;}export function segmentDefToCreateRequest(_0x15d010,_0x43b5b1){const _0x2f6692=a132_0x533b,_0x597bbf={'name':_0x15d010[_0x2f6692(0xee)]};return _0x15d010[_0x2f6692(0xce)]&&(_0x597bbf['description']=_0x15d010['description']),_0x15d010[_0x2f6692(0xc3)]&&(_0x597bbf[_0x2f6692(0xc3)]=yamlRuleToApi(_0x15d010['rule'])),_0x15d010[_0x2f6692(0xf3)]&&(_0x597bbf['kind']=_0x15d010[_0x2f6692(0xf3)]===_0x2f6692(0xa3)?0x0:_0x15d010[_0x2f6692(0xf3)]===_0x2f6692(0xb9)?0x1:0x2),_0x15d010['visible']!==undefined&&(_0x597bbf[_0x2f6692(0xb5)]=_0x15d010[_0x2f6692(0x81)]),_0x43b5b1&&(_0x597bbf[_0x2f6692(0xe7)]=_0x43b5b1),_0x597bbf;}export function segmentDefToUpdateRequest(_0x3b2b51){const _0x2d3a22=a132_0x533b,_0x3b3b2d={'name':_0x3b2b51[_0x2d3a22(0xee)]};return _0x3b2b51['description']!==undefined&&(_0x3b3b2d['description']=_0x3b2b51['description']),_0x3b2b51[_0x2d3a22(0xc3)]&&(_0x3b3b2d[_0x2d3a22(0xc3)]=yamlRuleToApi(_0x3b2b51[_0x2d3a22(0xc3)])),_0x3b2b51[_0x2d3a22(0xf3)]&&(_0x3b3b2d[_0x2d3a22(0xf3)]=_0x3b2b51[_0x2d3a22(0xf3)]===_0x2d3a22(0xa3)?0x0:_0x3b2b51['kind']===_0x2d3a22(0xb9)?0x1:0x2),_0x3b3b2d;}export function yamlRuleToApi(_0x340107,_0x5013b4=![]){const _0x158a00=a132_0x533b,_0x10ad5d=_0x340107[_0x158a00(0xfe)][_0x158a00(0xbe)](yamlConditionToApi);if(_0x5013b4){const _0x10b0f6=_0x10ad5d['every'](_0x766a6e=>_0x766a6e['type']===_0x158a00(0xa0)||_0x766a6e[_0x158a00(0xf5)]==='Or');if(!_0x10b0f6&&_0x10ad5d[_0x158a00(0xfc)]>0x0)return{'type':_0x340107['type'],'conditions':[{'type':_0x158a00(0xa0),'description':_0x340107[_0x158a00(0xce)]||'','conditions':_0x10ad5d}]};}return{'type':_0x340107[_0x158a00(0xf5)],'conditions':_0x10ad5d,..._0x340107[_0x158a00(0xce)]&&{'description':_0x340107[_0x158a00(0xce)]}};}function yamlConditionToApi(_0xadea5){const _0x51b11e=a132_0x533b;if('segment'in _0xadea5&&(_0xadea5['type']==='include'||_0xadea5[_0x51b11e(0xf5)]==='exclude')){const _0x540a9c=_0xadea5;return{'type':_0x51b11e(0x107),'id':_0x540a9c[_0x51b11e(0xac)],'exclude':_0x540a9c[_0x51b11e(0xf5)]===_0x51b11e(0xc6)};}if(_0x51b11e(0xf5)in _0xadea5&&(_0xadea5['type']===_0x51b11e(0xa0)||_0xadea5[_0x51b11e(0xf5)]==='Or')){const _0xeacc9f=_0xadea5;return{'type':_0xeacc9f[_0x51b11e(0xf5)],'conditions':_0xeacc9f[_0x51b11e(0xfe)][_0x51b11e(0xbe)](yamlConditionToApi),..._0xeacc9f[_0x51b11e(0xce)]&&{'description':_0xeacc9f[_0x51b11e(0xce)]}};}if(_0x51b11e(0x9f)in _0xadea5&&_0xadea5[_0x51b11e(0xf5)]===_0x51b11e(0xb3)){const _0x68b501=_0xadea5;return{'type':_0x51b11e(0xb3),'column':_0x68b501[_0x51b11e(0x9f)],'operator':yamlOperatorToApi(_0x68b501[_0x51b11e(0x79)])};}const _0x39c2b3=_0xadea5,_0x370d51={'type':_0x51b11e(0xfb),'leftValue':buildLeftValue(_0x39c2b3),'operator':yamlOperatorToApi(_0x39c2b3['operator']),'exclude':_0x39c2b3[_0x51b11e(0xc6)]??![],'arrayMatching':_0x39c2b3[_0x51b11e(0x94)]??'any'};return _0x39c2b3[_0x51b11e(0x10e)]!==undefined&&(_0x370d51[_0x51b11e(0x10e)]=_0x39c2b3[_0x51b11e(0x10e)]),_0x370d51;}function buildAggregationDefFromApi(_0x3bf32b){const _0x271a9d=a132_0x533b,_0x5efd2b=_0x3bf32b[_0x271a9d(0xf5)];if(_0x5efd2b===_0x271a9d(0x10c))return{'type':_0x5efd2b,'columns':_0x3bf32b[_0x271a9d(0xc7)]??[]};if(_0x5efd2b===_0x271a9d(0xbf)||_0x5efd2b===_0x271a9d(0xa8))return{'type':_0x5efd2b,'column':_0x3bf32b['column']??'','orderColumn':_0x3bf32b['orderColumn']??'',..._0x3bf32b['groupingColumns']&&{'groupingColumns':_0x3bf32b[_0x271a9d(0xd3)]}};if(_0x5efd2b===_0x271a9d(0x78))return{'type':_0x5efd2b,..._0x3bf32b['groupingColumns']&&{'groupingColumns':_0x3bf32b['groupingColumns']}};return{'type':_0x5efd2b,'column':_0x3bf32b['column']??'',..._0x3bf32b[_0x271a9d(0xd3)]&&{'groupingColumns':_0x3bf32b[_0x271a9d(0xd3)]}};}function buildLeftValue(_0x4d47df){const _0x8f8d67=a132_0x533b,_0x51df44={};_0x4d47df[_0x8f8d67(0xea)]&&_0x4d47df[_0x8f8d67(0xf5)]!=='Behavior'&&(_0x51df44[_0x8f8d67(0xee)]=_0x4d47df[_0x8f8d67(0xea)]);if(_0x4d47df[_0x8f8d67(0xd2)]){const _0x570875=_0x4d47df['aggregation'];if(_0x570875[_0x8f8d67(0xf5)]==='CountDistinct')_0x51df44[_0x8f8d67(0xd2)]={'type':_0x8f8d67(0x10c),'columns':_0x570875[_0x8f8d67(0xc7)]};else{if(_0x570875[_0x8f8d67(0xf5)]===_0x8f8d67(0xbf)||_0x570875[_0x8f8d67(0xf5)]===_0x8f8d67(0xa8))_0x51df44['aggregation']={'type':_0x570875['type'],'column':_0x570875[_0x8f8d67(0x9f)],'orderColumn':_0x570875[_0x8f8d67(0xca)],..._0x570875[_0x8f8d67(0xd3)]&&{'groupingColumns':_0x570875[_0x8f8d67(0xd3)]}};else _0x570875[_0x8f8d67(0xf5)]===_0x8f8d67(0x78)?_0x51df44[_0x8f8d67(0xd2)]={'type':_0x8f8d67(0x78),..._0x570875[_0x8f8d67(0xd3)]&&{'groupingColumns':_0x570875[_0x8f8d67(0xd3)]}}:_0x51df44[_0x8f8d67(0xd2)]={'type':_0x570875[_0x8f8d67(0xf5)],'column':_0x570875[_0x8f8d67(0x9f)],..._0x570875['groupingColumns']&&{'groupingColumns':_0x570875[_0x8f8d67(0xd3)]}};}}return _0x4d47df[_0x8f8d67(0x92)]&&(_0x51df44['source']={'name':_0x4d47df['source']}),_0x4d47df[_0x8f8d67(0x105)]&&(_0x51df44['filter']=yamlRuleToApi(filterRuleAsRuleDef(_0x4d47df[_0x8f8d67(0x105)]))),_0x51df44;}function yamlOperatorToApi(_0x41f20d){const _0x21745d=a132_0x533b,_0x14471a={'type':mapYamlOperatorType(_0x41f20d[_0x21745d(0xf5)]),'not':_0x41f20d[_0x21745d(0x7b)]??![]};if(isBetweenOperator(_0x41f20d[_0x21745d(0xf5)]))return _0x41f20d['min']!==undefined&&(_0x14471a[_0x21745d(0xe5)]=typeof _0x41f20d[_0x21745d(0x7a)]===_0x21745d(0x95)?_0x41f20d['min']:String(_0x41f20d['min'])),_0x41f20d[_0x21745d(0x10a)]!==undefined&&(_0x14471a[_0x21745d(0x10f)]=typeof _0x41f20d[_0x21745d(0x10a)]===_0x21745d(0x95)?_0x41f20d[_0x21745d(0x10a)]:String(_0x41f20d['max'])),_0x14471a;if(_0x41f20d[_0x21745d(0xf5)]===_0x21745d(0x104))return _0x41f20d[_0x21745d(0x99)]&&(_0x14471a['duration']=_0x41f20d[_0x21745d(0x99)]),_0x41f20d[_0x21745d(0xbc)]&&(_0x14471a['from']=_0x41f20d[_0x21745d(0xbc)]),_0x41f20d[_0x21745d(0x8f)]!==undefined&&(_0x14471a[_0x21745d(0x8f)]=_0x41f20d[_0x21745d(0x8f)]),_0x14471a;const _0xe10ab4=getEffectiveValue(_0x41f20d);if(_0xe10ab4!==undefined){if(Array['isArray'](_0xe10ab4))_0x14471a[_0x21745d(0x110)]=_0xe10ab4;else isTemporalOperator(_0x41f20d['type'])?_0x14471a[_0x21745d(0xcc)]=_0xe10ab4:_0x14471a['rightValue']=_0xe10ab4;}return _0x41f20d[_0x21745d(0x8b)]&&(_0x14471a[_0x21745d(0x8b)]=_0x41f20d['unit']),_0x14471a;}function mapYamlOperatorType(_0xba8b7){return _0xba8b7;}export function toYamlString(_0x28b12c){const _0x21fe54=a132_0x533b,_0xd154c5=JSON[_0x21fe54(0xc4)](JSON[_0x21fe54(0xc5)](_0x28b12c)),_0x10401e=a132_0x9b0620[_0x21fe54(0xc5)](_0xd154c5,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x21fe54(0xcd)}),_0x4e1d3b=[_0x21fe54(0x8c)];let _0x1c1063=_0x10401e;for(const _0x2db9ba of _0x4e1d3b){_0x1c1063=_0x1c1063[_0x21fe54(0x9c)](new RegExp('^('+_0x2db9ba+')','m'),(_0x493faa,_0x101fdb,_0x5bf62f)=>{if(_0x5bf62f===0x0||_0x1c1063[_0x5bf62f-0x1]==='\x0a'&&_0x1c1063[_0x5bf62f-0x2]==='\x0a')return _0x101fdb;return'\x0a'+_0x101fdb;});}return _0x1c1063;}export function parseYamlString(_0xe8c2c){return parseSegmentYamlFile(_0xe8c2c);}export function isSegmentYaml(_0x5b1110){const _0x49abab=a132_0x533b;if(typeof _0x5b1110!==_0x49abab(0x95)||_0x5b1110===null)return![];const _0x451ce0=_0x5b1110;return _0x451ce0[_0x49abab(0xf5)]===_0x49abab(0xac)||_0x451ce0[_0x49abab(0xf5)]===undefined;}export function generateTemplate(_0x23ae2c=a132_0x30178c(0x7d)){const _0x52fe6a=a132_0x30178c,_0x4347c8={'type':_0x52fe6a(0xac),'name':_0x23ae2c,'description':_0x52fe6a(0xf6),'rule':{'type':_0x52fe6a(0xa0),'conditions':[{'type':_0x52fe6a(0xfb),'attribute':'attribute_name','operator':{'type':'Equal','value':_0x52fe6a(0xcc)}}]}};return toYamlString(_0x4347c8);}export function segmentToYamlString(_0x50ab72){const _0x3b8977=a132_0x30178c,_0x4fabd7=JSON[_0x3b8977(0xc4)](JSON[_0x3b8977(0xc5)](_0x50ab72)),_0x45e6ca=a132_0x9b0620[_0x3b8977(0xc5)](_0x4fabd7,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3b8977(0xcd)}),_0x31e558=[_0x3b8977(0x8c),_0x3b8977(0xd4)];let _0x3fa29c=_0x45e6ca;for(const _0x2bb43f of _0x31e558){_0x3fa29c=_0x3fa29c['replace'](new RegExp('^('+_0x2bb43f+')','m'),(_0x20162a,_0x10ff46,_0x2526bd)=>{if(_0x2526bd===0x0||_0x3fa29c[_0x2526bd-0x1]==='\x0a'&&_0x3fa29c[_0x2526bd-0x2]==='\x0a')return _0x10ff46;return'\x0a'+_0x10ff46;});}return _0x3fa29c;}export function parseSegmentYamlFile(_0x591f67){return safeParseYaml(_0x591f67,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x4119db){const _0x56f0f5=a132_0x30178c;return{'type':_0x56f0f5(0xac),'name':_0x4119db[_0x56f0f5(0xee)],..._0x4119db[_0x56f0f5(0xce)]!==undefined&&{'description':_0x4119db['description']},..._0x4119db['folder']!==undefined&&{'folder':_0x4119db[_0x56f0f5(0xe6)]},..._0x4119db[_0x56f0f5(0xc3)]&&{'rule':normalizeRule(_0x4119db[_0x56f0f5(0xc3)])},..._0x4119db[_0x56f0f5(0xf3)]!==undefined&&{'kind':_0x4119db[_0x56f0f5(0xf3)]},..._0x4119db[_0x56f0f5(0x81)]!==undefined&&{'visible':_0x4119db[_0x56f0f5(0x81)]},..._0x4119db[_0x56f0f5(0xeb)]&&{'activations':_0x4119db[_0x56f0f5(0xeb)][_0x56f0f5(0xbe)](normalizeActivation)}};}export function normalizeRule(_0x4abc9f){const _0x1746b4=a132_0x30178c;return{'type':_0x4abc9f[_0x1746b4(0xf5)],'conditions':_0x4abc9f[_0x1746b4(0xfe)][_0x1746b4(0xbe)](normalizeCondition),..._0x4abc9f[_0x1746b4(0xce)]!==undefined&&{'description':_0x4abc9f[_0x1746b4(0xce)]}};}function normalizeCondition(_0x39b134){const _0x820f9=a132_0x30178c;if(_0x820f9(0xac)in _0x39b134&&(_0x39b134[_0x820f9(0xf5)]===_0x820f9(0x83)||_0x39b134[_0x820f9(0xf5)]===_0x820f9(0xc6))){const _0x5ce901=_0x39b134;return{'type':_0x5ce901[_0x820f9(0xf5)],'segment':_0x5ce901[_0x820f9(0xac)]};}if('type'in _0x39b134&&(_0x39b134[_0x820f9(0xf5)]==='And'||_0x39b134[_0x820f9(0xf5)]==='Or')){const _0x5edabf=_0x39b134;return{'type':_0x5edabf[_0x820f9(0xf5)],'conditions':_0x5edabf[_0x820f9(0xfe)][_0x820f9(0xbe)](normalizeCondition),..._0x5edabf['description']!==undefined&&{'description':_0x5edabf['description']}};}if(_0x820f9(0x9f)in _0x39b134&&_0x39b134[_0x820f9(0xf5)]===_0x820f9(0xb3)){const _0x282e0c=_0x39b134;return{'type':'Column','column':_0x282e0c[_0x820f9(0x9f)],'operator':normalizeOperator(_0x282e0c[_0x820f9(0x79)])};}const _0x4950e5=_0x39b134;return{'type':_0x820f9(0xfb),'attribute':_0x4950e5['attribute'],'operator':normalizeOperator(_0x4950e5['operator']),..._0x4950e5[_0x820f9(0x94)]!==undefined&&{'arrayMatching':_0x4950e5[_0x820f9(0x94)]},..._0x4950e5[_0x820f9(0xc6)]!==undefined&&{'exclude':_0x4950e5[_0x820f9(0xc6)]},..._0x4950e5[_0x820f9(0xd2)]!==undefined&&{'aggregation':_0x4950e5['aggregation']},..._0x4950e5['source']!==undefined&&{'source':_0x4950e5['source']},..._0x4950e5[_0x820f9(0x105)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4950e5[_0x820f9(0x105)])))},..._0x4950e5[_0x820f9(0x10e)]!==undefined&&{'limit':_0x4950e5[_0x820f9(0x10e)]}};}function normalizeOperator(_0x866f8d){const _0x414d87=a132_0x30178c;if(isBetweenOperator(_0x866f8d['type']))return{'type':_0x866f8d[_0x414d87(0xf5)],..._0x866f8d[_0x414d87(0x7b)]!==undefined&&{'not':_0x866f8d[_0x414d87(0x7b)]},..._0x866f8d[_0x414d87(0x7a)]!==undefined&&{'min':_0x866f8d['min']},..._0x866f8d['max']!==undefined&&{'max':_0x866f8d[_0x414d87(0x10a)]}};const _0x3f8264=getEffectiveValue(_0x866f8d);return{'type':_0x866f8d['type'],..._0x866f8d[_0x414d87(0x7b)]!==undefined&&{'not':_0x866f8d[_0x414d87(0x7b)]},..._0x3f8264!==undefined&&{'value':_0x3f8264},..._0x866f8d['unit']!==undefined&&{'unit':_0x866f8d[_0x414d87(0x8b)]},..._0x866f8d[_0x414d87(0x99)]!==undefined&&{'duration':_0x866f8d[_0x414d87(0x99)]},..._0x866f8d[_0x414d87(0xbc)]!==undefined&&{'from':_0x866f8d[_0x414d87(0xbc)]},..._0x866f8d['reverse']!==undefined&&{'reverse':_0x866f8d[_0x414d87(0x8f)]}};}function normalizeActivation(_0x3150e6){const _0x11b95b=a132_0x30178c;return{'name':_0x3150e6[_0x11b95b(0xee)],'connection':_0x3150e6['connection'],..._0x3150e6[_0x11b95b(0xce)]!==undefined&&{'description':_0x3150e6[_0x11b95b(0xce)]},..._0x3150e6[_0x11b95b(0xc2)]!==undefined&&{'all_columns':_0x3150e6['all_columns']},..._0x3150e6[_0x11b95b(0xc7)]!==undefined&&{'columns':_0x3150e6[_0x11b95b(0xc7)]},..._0x3150e6[_0x11b95b(0xa4)]!==undefined&&{'behavior':_0x3150e6[_0x11b95b(0xa4)]},..._0x3150e6[_0x11b95b(0x7f)]!==undefined&&{'schedule':_0x3150e6[_0x11b95b(0x7f)]},..._0x3150e6[_0x11b95b(0xa6)]!==undefined&&{'notification':_0x3150e6['notification']},..._0x3150e6['connector_config']!==undefined&&{'connector_config':_0x3150e6['connector_config']},..._0x3150e6[_0x11b95b(0xe1)]!==undefined&&{'activation_template_id':_0x3150e6[_0x11b95b(0xe1)]}};}export function activationResponseToDef(_0x4fd305,_0x4dfd3b,_0x32c0f1){const _0x4ff3cc=a132_0x30178c,_0x2b6443=_0x4fd305[_0x4ff3cc(0xf1)]||'',_0x3988d2=_0x32c0f1?.['get'](_0x2b6443)??_0x2b6443,_0x15e41d={'name':_0x4fd305[_0x4ff3cc(0xee)],'connection':_0x3988d2};_0x4fd305[_0x4ff3cc(0xce)]&&(_0x15e41d[_0x4ff3cc(0xce)]=_0x4fd305[_0x4ff3cc(0xce)]);let _0x106b49=[];_0x4fd305[_0x4ff3cc(0xc7)]&&_0x4fd305[_0x4ff3cc(0xc7)][_0x4ff3cc(0xfc)]>0x0&&(_0x106b49=_0x4fd305['columns']['filter'](_0x25a4d4=>_0x25a4d4&&_0x25a4d4[_0x4ff3cc(0xee)])[_0x4ff3cc(0xbe)](_0x4da927=>{const _0x7fe4ee=_0x4ff3cc;if(_0x4da927[_0x7fe4ee(0xf5)]||_0x4da927['visibility'])return{'name':_0x4da927['name'],..._0x4da927[_0x7fe4ee(0xf5)]&&{'type':_0x4da927['type']},..._0x4da927[_0x7fe4ee(0xba)]&&{'visibility':_0x4da927[_0x7fe4ee(0xba)]}};return _0x4da927['name'];}));_0x106b49[_0x4ff3cc(0xfc)]>0x0&&(_0x15e41d[_0x4ff3cc(0xc7)]=_0x106b49);_0x4fd305[_0x4ff3cc(0xdf)]!==undefined&&(_0x4fd305[_0x4ff3cc(0xdf)]===![]&&_0x106b49['length']===0x0?_0x15e41d[_0x4ff3cc(0xc2)]=!![]:_0x15e41d[_0x4ff3cc(0xc2)]=_0x4fd305[_0x4ff3cc(0xdf)]);const _0xb30c9c={};let _0xdc6afa=![];_0x4fd305['scheduleType']&&(_0xb30c9c[_0x4ff3cc(0xf5)]=_0x4fd305[_0x4ff3cc(0xc8)],_0xdc6afa=!![]);_0x4fd305[_0x4ff3cc(0xb2)]&&(_0xb30c9c['repeat_unit']=_0x4fd305[_0x4ff3cc(0xb2)],_0xdc6afa=!![]);_0x4fd305['repeatFrequency']!==undefined&&_0x4fd305[_0x4ff3cc(0x96)]!==null&&(_0xb30c9c[_0x4ff3cc(0xa5)]=_0x4fd305[_0x4ff3cc(0x96)],_0xdc6afa=!![]);_0x4fd305[_0x4ff3cc(0xa2)]&&_0x4fd305[_0x4ff3cc(0xa2)][_0x4ff3cc(0xfc)]>0x0&&(_0xb30c9c[_0x4ff3cc(0xd8)]=_0x4fd305['repeatSubFrequency'],_0xdc6afa=!![]);_0x4fd305[_0x4ff3cc(0xad)]!==undefined&&(_0xb30c9c['start_at']=_0x4fd305[_0x4ff3cc(0xad)],_0xdc6afa=!![]);_0x4fd305[_0x4ff3cc(0xb6)]!==undefined&&(_0xb30c9c[_0x4ff3cc(0xcf)]=_0x4fd305[_0x4ff3cc(0xb6)],_0xdc6afa=!![]);_0x4fd305['timezone']&&(_0xb30c9c[_0x4ff3cc(0xf7)]=_0x4fd305['timezone'],_0xdc6afa=!![]);_0xdc6afa&&(_0x15e41d[_0x4ff3cc(0x7f)]=_0xb30c9c);(_0x4fd305[_0x4ff3cc(0x87)]&&_0x4fd305[_0x4ff3cc(0x87)][_0x4ff3cc(0xfc)]>0x0||_0x4fd305['emailRecipients']&&_0x4fd305[_0x4ff3cc(0xe9)][_0x4ff3cc(0xfc)]>0x0)&&(_0x15e41d[_0x4ff3cc(0xa6)]={},_0x4fd305[_0x4ff3cc(0x87)]&&_0x4fd305[_0x4ff3cc(0x87)][_0x4ff3cc(0xfc)]>0x0&&(_0x15e41d['notification'][_0x4ff3cc(0xe4)]=_0x4fd305[_0x4ff3cc(0x87)]),_0x4fd305['emailRecipients']&&_0x4fd305[_0x4ff3cc(0xe9)][_0x4ff3cc(0xfc)]>0x0&&(_0x15e41d[_0x4ff3cc(0xa6)][_0x4ff3cc(0xdc)]=_0x4fd305['emailRecipients'][_0x4ff3cc(0xbe)](_0x5b1bcb=>{const _0x3245cd=_0x4dfd3b?.['get'](_0x5b1bcb);return _0x3245cd??String(_0x5b1bcb);})));_0x4fd305[_0x4ff3cc(0x80)]&&Object[_0x4ff3cc(0xa9)](_0x4fd305['connectorConfig'])[_0x4ff3cc(0xfc)]>0x0&&(_0x15e41d[_0x4ff3cc(0xe3)]=normalizeConnectorConfigForYaml(_0x4fd305[_0x4ff3cc(0x80)]));_0x4fd305[_0x4ff3cc(0x9d)]&&(_0x15e41d[_0x4ff3cc(0xe1)]=_0x4fd305[_0x4ff3cc(0x9d)]);if(_0x4fd305[_0x4ff3cc(0xde)]){const _0x2b6fa3={},_0x13e654=_0x4fd305[_0x4ff3cc(0xde)];_0x13e654[_0x4ff3cc(0xc7)]&&_0x13e654['columns'][_0x4ff3cc(0xfc)]>0x0&&(_0x2b6fa3[_0x4ff3cc(0xc7)]=_0x13e654[_0x4ff3cc(0xc7)][_0x4ff3cc(0x105)](_0x2d29a1=>_0x2d29a1&&_0x2d29a1[_0x4ff3cc(0xee)])[_0x4ff3cc(0xbe)](_0x42015d=>({'name':_0x42015d[_0x4ff3cc(0xee)],..._0x42015d[_0x4ff3cc(0xf5)]&&{'type':_0x42015d[_0x4ff3cc(0xf5)]},..._0x42015d[_0x4ff3cc(0xba)]&&{'visibility':_0x42015d[_0x4ff3cc(0xba)]}}))),_0x13e654[_0x4ff3cc(0x77)]&&(_0x2b6fa3[_0x4ff3cc(0xed)]=_0x13e654[_0x4ff3cc(0x77)]),_0x13e654[_0x4ff3cc(0x9a)]!==undefined&&(_0x2b6fa3[_0x4ff3cc(0xe2)]=_0x13e654['joinRow']),_0x13e654[_0x4ff3cc(0xb1)]&&(_0x2b6fa3[_0x4ff3cc(0xf0)]=_0x13e654[_0x4ff3cc(0xb1)]),_0x13e654[_0x4ff3cc(0xab)]&&(_0x2b6fa3[_0x4ff3cc(0xab)]=_0x13e654[_0x4ff3cc(0xab)]),_0x13e654[_0x4ff3cc(0x8e)]&&_0x13e654[_0x4ff3cc(0x8e)][_0x4ff3cc(0xfc)]>0x0&&(_0x2b6fa3[_0x4ff3cc(0x8d)]=_0x13e654[_0x4ff3cc(0x8e)]),Object[_0x4ff3cc(0xa9)](_0x2b6fa3)[_0x4ff3cc(0xfc)]>0x0&&(_0x15e41d[_0x4ff3cc(0xa4)]=_0x2b6fa3);}return _0x15e41d;}export function journeyActivationStepToYaml(_0x1eaf8e,_0x253ee4,_0x2fd67a){const _0x1a7d58=a132_0x30178c,_0x27fbb8=_0x1eaf8e[_0x1a7d58(0x8a)][_0x1a7d58(0xa7)],_0x1bfc6e=_0x27fbb8['connectionId']||'',_0x4528bb=_0x2fd67a?.['get'](_0x1bfc6e)??_0x1bfc6e,_0x1cce47={'name':_0x27fbb8[_0x1a7d58(0xee)]||'','connection':_0x4528bb};_0x1eaf8e[_0x1a7d58(0x8a)][_0x1a7d58(0xf4)]&&(_0x1cce47[_0x1a7d58(0xd0)]=!![]);_0x27fbb8[_0x1a7d58(0xce)]&&(_0x1cce47['description']=_0x27fbb8[_0x1a7d58(0xce)]);let _0x25722a=[];_0x27fbb8[_0x1a7d58(0xc7)]&&_0x27fbb8[_0x1a7d58(0xc7)][_0x1a7d58(0xfc)]>0x0&&(_0x25722a=_0x27fbb8[_0x1a7d58(0xc7)][_0x1a7d58(0x105)](_0x1d410e=>_0x1d410e&&_0x1d410e[_0x1a7d58(0xee)])[_0x1a7d58(0xbe)](_0x2f7978=>{const _0x5af623=_0x1a7d58;if(_0x2f7978[_0x5af623(0xf5)]||_0x2f7978[_0x5af623(0xba)])return{'name':_0x2f7978[_0x5af623(0xee)],..._0x2f7978[_0x5af623(0xf5)]&&{'type':_0x2f7978[_0x5af623(0xf5)]},..._0x2f7978[_0x5af623(0xba)]&&{'visibility':_0x2f7978[_0x5af623(0xba)]}};return _0x2f7978[_0x5af623(0xee)];}));_0x25722a[_0x1a7d58(0xfc)]>0x0&&(_0x1cce47[_0x1a7d58(0xc7)]=_0x25722a);_0x27fbb8[_0x1a7d58(0xdf)]!==undefined&&(_0x27fbb8[_0x1a7d58(0xdf)]===![]&&_0x25722a[_0x1a7d58(0xfc)]===0x0?_0x1cce47[_0x1a7d58(0xc2)]=!![]:_0x1cce47['all_columns']=_0x27fbb8[_0x1a7d58(0xdf)]);const _0x291255={};let _0x1178c4=![];_0x27fbb8[_0x1a7d58(0xc8)]&&(_0x291255[_0x1a7d58(0xf5)]=_0x27fbb8[_0x1a7d58(0xc8)],_0x1178c4=!![]);_0x27fbb8[_0x1a7d58(0xb2)]&&(_0x291255[_0x1a7d58(0xaf)]=_0x27fbb8[_0x1a7d58(0xb2)],_0x1178c4=!![]);_0x27fbb8[_0x1a7d58(0x96)]!==undefined&&_0x27fbb8[_0x1a7d58(0x96)]!==null&&(_0x291255[_0x1a7d58(0xa5)]=_0x27fbb8['repeatFrequency'],_0x1178c4=!![]);_0x27fbb8[_0x1a7d58(0xad)]!==undefined&&(_0x291255[_0x1a7d58(0xaa)]=_0x27fbb8[_0x1a7d58(0xad)],_0x1178c4=!![]);_0x27fbb8['endOn']!==undefined&&(_0x291255['end_on']=_0x27fbb8[_0x1a7d58(0xb6)],_0x1178c4=!![]);_0x27fbb8['timezone']&&(_0x291255[_0x1a7d58(0xf7)]=_0x27fbb8[_0x1a7d58(0xf7)],_0x1178c4=!![]);_0x1178c4&&(_0x1cce47['schedule']=_0x291255);(_0x27fbb8[_0x1a7d58(0x87)]&&_0x27fbb8['notifyOn']['length']>0x0||_0x27fbb8[_0x1a7d58(0xe9)]&&_0x27fbb8[_0x1a7d58(0xe9)][_0x1a7d58(0xfc)]>0x0)&&(_0x1cce47['notification']={},_0x27fbb8[_0x1a7d58(0x87)]&&_0x27fbb8[_0x1a7d58(0x87)][_0x1a7d58(0xfc)]>0x0&&(_0x1cce47[_0x1a7d58(0xa6)]['notify_on']=_0x27fbb8[_0x1a7d58(0x87)]),_0x27fbb8[_0x1a7d58(0xe9)]&&_0x27fbb8[_0x1a7d58(0xe9)]['length']>0x0&&(_0x1cce47[_0x1a7d58(0xa6)][_0x1a7d58(0xdc)]=_0x27fbb8[_0x1a7d58(0xe9)]['map'](_0x1af758=>{const _0x2cd59b=_0x1a7d58,_0x5b3bab=_0x253ee4?.[_0x2cd59b(0xd5)](_0x1af758);return _0x5b3bab??String(_0x1af758);})));_0x27fbb8[_0x1a7d58(0x80)]&&Object[_0x1a7d58(0xa9)](_0x27fbb8[_0x1a7d58(0x80)])[_0x1a7d58(0xfc)]>0x0&&(_0x1cce47[_0x1a7d58(0xe3)]=normalizeConnectorConfigForYaml(_0x27fbb8[_0x1a7d58(0x80)]));_0x27fbb8[_0x1a7d58(0x9d)]&&(_0x1cce47[_0x1a7d58(0xe1)]=_0x27fbb8[_0x1a7d58(0x9d)]);if(_0x27fbb8[_0x1a7d58(0xde)]){const _0x2f59f0={},_0x57a25f=_0x27fbb8[_0x1a7d58(0xde)];_0x57a25f[_0x1a7d58(0xc7)]&&_0x57a25f['columns'][_0x1a7d58(0xfc)]>0x0&&(_0x2f59f0[_0x1a7d58(0xc7)]=_0x57a25f[_0x1a7d58(0xc7)][_0x1a7d58(0x105)](_0x2e4bdf=>_0x2e4bdf&&_0x2e4bdf[_0x1a7d58(0xee)])[_0x1a7d58(0xbe)](_0x819cd6=>({'name':_0x819cd6['name'],..._0x819cd6['type']&&{'type':_0x819cd6[_0x1a7d58(0xf5)]},..._0x819cd6['visibility']&&{'visibility':_0x819cd6[_0x1a7d58(0xba)]}}))),_0x57a25f[_0x1a7d58(0x77)]&&(_0x2f59f0[_0x1a7d58(0xed)]=_0x57a25f[_0x1a7d58(0x77)]),_0x57a25f[_0x1a7d58(0x9a)]!==undefined&&(_0x2f59f0['join_row']=_0x57a25f[_0x1a7d58(0x9a)]),_0x57a25f[_0x1a7d58(0xb1)]&&(_0x2f59f0[_0x1a7d58(0xf0)]=_0x57a25f[_0x1a7d58(0xb1)]),_0x57a25f['formatting']&&(_0x2f59f0[_0x1a7d58(0xab)]=_0x57a25f[_0x1a7d58(0xab)]),_0x57a25f[_0x1a7d58(0x8e)]&&_0x57a25f['orderBy'][_0x1a7d58(0xfc)]>0x0&&(_0x2f59f0[_0x1a7d58(0x8d)]=_0x57a25f['orderBy']),Object[_0x1a7d58(0xa9)](_0x2f59f0)[_0x1a7d58(0xfc)]>0x0&&(_0x1cce47[_0x1a7d58(0xa4)]=_0x2f59f0);}return _0x1cce47;}export function segmentWithActivationsToYaml(_0x2ff589,_0x5b660b,_0x4a444e,_0x5dc4da,_0x19c7b3){const _0x2fa9db=a132_0x30178c,_0x5c0416=segmentResponseToDefSync(_0x2ff589,_0x4a444e);return _0x5b660b[_0x2fa9db(0xfc)]>0x0&&(_0x5c0416[_0x2fa9db(0xeb)]=_0x5b660b[_0x2fa9db(0xbe)](_0x4f7a15=>activationResponseToDef(_0x4f7a15,_0x5dc4da,_0x19c7b3))),_0x5c0416;}function normalizeColumn(_0x11222b){const _0x4ad961=a132_0x30178c;if(typeof _0x11222b===_0x4ad961(0xf9))return{'name':_0x11222b};return{'name':_0x11222b['name'],..._0x11222b[_0x4ad961(0xf5)]&&{'type':_0x11222b['type']},..._0x11222b[_0x4ad961(0xba)]&&{'visibility':_0x11222b[_0x4ad961(0xba)]}};}export async function activationDefToCreateRequest(_0x2c4c24,_0x4b1f82){const _0x3a50d3=a132_0x30178c,_0x105b5f=_0x4b1f82?.['emailToIdMap'],_0x1049a8=_0x4b1f82?.[_0x3a50d3(0x9b)],_0x556939=_0x2c4c24[_0x3a50d3(0x100)];let _0xca5bc0;const _0x45a790=parseInt(_0x556939,0xa);if(!isNaN(_0x45a790)&&String(_0x45a790)===_0x556939)_0xca5bc0=_0x45a790;else{const _0x1f385e=_0x1049a8?.[_0x3a50d3(0xd5)](_0x556939);if(_0x1f385e===undefined)throw new SDKError(ErrorCode[_0x3a50d3(0xa1)],_0x3a50d3(0xfd)+_0x556939,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0xca5bc0=_0x1f385e;}const _0x557313={'name':_0x2c4c24['name'],'connectionId':_0xca5bc0};_0x2c4c24[_0x3a50d3(0xce)]&&(_0x557313['description']=_0x2c4c24[_0x3a50d3(0xce)]);let _0x2aa30c=[];_0x2c4c24[_0x3a50d3(0xc7)]&&_0x2c4c24['columns'][_0x3a50d3(0xfc)]>0x0&&(_0x2aa30c=_0x2c4c24['columns'][_0x3a50d3(0x105)](_0x4d2f8e=>_0x4d2f8e!=null)['map'](normalizeColumn));_0x2aa30c['length']>0x0&&(_0x557313['columns']=_0x2aa30c);_0x2c4c24[_0x3a50d3(0xc2)]!==undefined&&(_0x2c4c24['all_columns']===![]&&_0x2aa30c[_0x3a50d3(0xfc)]===0x0?_0x557313[_0x3a50d3(0xdf)]=!![]:_0x557313['allColumns']=_0x2c4c24['all_columns']);if(_0x2c4c24[_0x3a50d3(0x7f)]){const _0x489fa0=_0x2c4c24['schedule'];_0x489fa0['type']&&(_0x557313[_0x3a50d3(0xc8)]=_0x489fa0['type']),_0x489fa0['repeat_unit']&&(_0x557313[_0x3a50d3(0xb2)]=_0x489fa0[_0x3a50d3(0xaf)]),_0x489fa0[_0x3a50d3(0xa5)]!==undefined&&(_0x557313[_0x3a50d3(0x96)]=_0x489fa0['repeat_frequency']),_0x489fa0[_0x3a50d3(0xd8)]&&(_0x557313[_0x3a50d3(0xa2)]=_0x489fa0['repeat_sub_frequency']),_0x489fa0[_0x3a50d3(0xaa)]!==undefined&&(_0x557313['startAt']=_0x489fa0[_0x3a50d3(0xaa)]),_0x489fa0['end_on']!==undefined&&(_0x557313[_0x3a50d3(0xb6)]=_0x489fa0[_0x3a50d3(0xcf)]),_0x489fa0[_0x3a50d3(0xf7)]&&(_0x557313[_0x3a50d3(0xf7)]=_0x489fa0[_0x3a50d3(0xf7)]);}_0x2c4c24[_0x3a50d3(0xa6)]&&(_0x2c4c24[_0x3a50d3(0xa6)]['notify_on']&&(_0x557313['notifyOn']=_0x2c4c24[_0x3a50d3(0xa6)][_0x3a50d3(0xe4)]),_0x2c4c24['notification'][_0x3a50d3(0xdc)]&&(_0x557313[_0x3a50d3(0xe9)]=_0x2c4c24[_0x3a50d3(0xa6)][_0x3a50d3(0xdc)]['map'](_0x551005=>{const _0x3fea0f=_0x3a50d3,_0x42a823=Number(_0x551005);if(!isNaN(_0x42a823)&&String(_0x42a823)===_0x551005)return _0x42a823;const _0x1a7c03=_0x105b5f?.[_0x3fea0f(0xd5)](_0x551005[_0x3fea0f(0x108)]());if(_0x1a7c03===undefined)throw new SDKError(ErrorCode[_0x3fea0f(0xda)],'Unknown\x20email\x20recipient:\x20'+_0x551005+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x1a7c03;})));if(_0x2c4c24['connector_config']){const _0x2b5c82=_0x4b1f82?.[_0x3a50d3(0x85)]?.[_0x3a50d3(0xd5)](_0x556939);if(_0x2b5c82&&_0x4b1f82?.[_0x3a50d3(0x82)])try{const _0xf42129=await _0x4b1f82['getSchema'](_0x2b5c82),_0x239949=validateConnectorConfig(_0x2c4c24[_0x3a50d3(0xe3)],_0xf42129);if(!_0x239949[_0x3a50d3(0x103)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0x3a50d3(0xd7)+_0x2c4c24[_0x3a50d3(0xee)]+_0x3a50d3(0xfa)+formatValidationErrors(_0x239949[_0x3a50d3(0x89)]),undefined,{'helpText':'Connector:\x20'+_0x2b5c82+_0x3a50d3(0xec)+formatSchemaAsHelp(_0xf42129)});if(_0x239949[_0x3a50d3(0xf8)][_0x3a50d3(0xfc)]>0x0){const _0x17cf67=formatValidationWarnings(_0x239949[_0x3a50d3(0xf8)]);console[_0x3a50d3(0xc0)](_0x3a50d3(0x7c)+_0x2c4c24[_0x3a50d3(0xee)]+_0x3a50d3(0xfa)+_0x17cf67);}_0x557313[_0x3a50d3(0x80)]=transformConfigToLegacy(_0x2c4c24[_0x3a50d3(0xe3)],_0xf42129);}catch(_0x33694c){if(_0x33694c instanceof SDKError&&_0x33694c[_0x3a50d3(0x112)]===ErrorCode[_0x3a50d3(0x88)])_0x557313[_0x3a50d3(0x80)]=_0x2c4c24[_0x3a50d3(0xe3)];else throw _0x33694c;}else _0x557313[_0x3a50d3(0x80)]=_0x2c4c24[_0x3a50d3(0xe3)];}_0x2c4c24[_0x3a50d3(0xe1)]!==undefined&&(_0x557313[_0x3a50d3(0x9d)]=_0x2c4c24[_0x3a50d3(0xe1)]);if(_0x2c4c24[_0x3a50d3(0xa4)]){const _0x410bd3=_0x2c4c24[_0x3a50d3(0xa4)],_0x19dc63={};if(_0x410bd3['columns']&&_0x410bd3[_0x3a50d3(0xc7)][_0x3a50d3(0xfc)]>0x0){const _0x2e39c5=_0x410bd3[_0x3a50d3(0xc7)][_0x3a50d3(0x105)](_0x5a8ea8=>_0x5a8ea8&&_0x5a8ea8[_0x3a50d3(0xee)]);_0x2e39c5[_0x3a50d3(0xfc)]>0x0&&(_0x19dc63[_0x3a50d3(0xc7)]=_0x2e39c5);}_0x410bd3[_0x3a50d3(0xed)]&&(_0x19dc63[_0x3a50d3(0x77)]=_0x410bd3[_0x3a50d3(0xed)]),_0x410bd3[_0x3a50d3(0xe2)]!==undefined&&(_0x19dc63[_0x3a50d3(0x9a)]=_0x410bd3[_0x3a50d3(0xe2)]),_0x410bd3['join_strategy']&&(_0x19dc63[_0x3a50d3(0xb1)]=_0x410bd3[_0x3a50d3(0xf0)]),_0x410bd3[_0x3a50d3(0xab)]&&(_0x19dc63[_0x3a50d3(0xab)]=_0x410bd3[_0x3a50d3(0xab)]),_0x410bd3['order_by']&&(_0x19dc63[_0x3a50d3(0x8e)]=_0x410bd3[_0x3a50d3(0x8d)]),_0x557313[_0x3a50d3(0xde)]=_0x19dc63;}return _0x557313;}export async function activationDefToUpdateRequest(_0x716adc,_0x8f7c9a){return activationDefToCreateRequest(_0x716adc,_0x8f7c9a);}export function deepSortObject(_0x38ecc4){const _0x624e6f=a132_0x30178c;if(_0x38ecc4===null||typeof _0x38ecc4!=='object')return _0x38ecc4;if(Array[_0x624e6f(0x10b)](_0x38ecc4))return _0x38ecc4[_0x624e6f(0xbe)](deepSortObject)[_0x624e6f(0x7e)]((_0x49a5fe,_0x5a4010)=>JSON[_0x624e6f(0xc5)](_0x49a5fe)[_0x624e6f(0x97)](JSON['stringify'](_0x5a4010)));const _0x4ed632={};for(const _0x4a834b of Object['keys'](_0x38ecc4)[_0x624e6f(0x7e)]()){_0x4ed632[_0x4a834b]=deepSortObject(_0x38ecc4[_0x4a834b]);}return _0x4ed632;}function a132_0x533b(_0x3dd50e,_0x584216){_0x3dd50e=_0x3dd50e-0x77;const _0x541caa=a132_0x541c();let _0x533bbb=_0x541caa[_0x3dd50e];return _0x533bbb;}export function serializeRule(_0x4274f1){const _0x45c4ea=a132_0x30178c;return JSON[_0x45c4ea(0xc5)](deepSortObject(_0x4274f1));}export function normalizeRuleForMatching(_0x2fb966){return normalizeConditionsForMatching(_0x2fb966);}function normalizeConditionsForMatching(_0x3319e7){const _0x3f11f2=a132_0x30178c;if(_0x3319e7===null||typeof _0x3319e7!==_0x3f11f2(0x95))return _0x3319e7;if(Array[_0x3f11f2(0x10b)](_0x3319e7))return _0x3319e7['map'](normalizeConditionsForMatching);const _0x5dc57a=_0x3319e7;if((_0x5dc57a['type']===_0x3f11f2(0x83)||_0x5dc57a[_0x3f11f2(0xf5)]===_0x3f11f2(0xc6))&&typeof _0x5dc57a[_0x3f11f2(0xac)]===_0x3f11f2(0xf9))return{..._0x5dc57a,'segment':_0x3f11f2(0xdb)};const _0x5ab08e={};for(const _0x4971fb of Object[_0x3f11f2(0xa9)](_0x5dc57a)){_0x5ab08e[_0x4971fb]=normalizeConditionsForMatching(_0x5dc57a[_0x4971fb]);}return _0x5ab08e;}export function serializeRuleForMatching(_0x5ed80f){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x5ed80f)));}export function expandSegmentReferences(_0x1b8d41,_0x3e8961,_0x406193=new Set()){return expandConditions(_0x1b8d41,_0x3e8961,_0x406193);}function expandConditions(_0x344a93,_0x46b291,_0x244727){const _0x163cfa=a132_0x30178c;if(_0x344a93===null||typeof _0x344a93!==_0x163cfa(0x95))return _0x344a93;if(Array[_0x163cfa(0x10b)](_0x344a93))return _0x344a93[_0x163cfa(0xbe)](_0x566ebc=>expandConditions(_0x566ebc,_0x46b291,_0x244727));const _0x4a7b9c=_0x344a93;if((_0x4a7b9c[_0x163cfa(0xf5)]===_0x163cfa(0x83)||_0x4a7b9c[_0x163cfa(0xf5)]===_0x163cfa(0xc6))&&typeof _0x4a7b9c[_0x163cfa(0xac)]==='string'){const _0x3e755a=_0x4a7b9c['segment'],_0x30a706=_0x46b291['get'](_0x3e755a);if(_0x30a706&&!_0x244727['has'](_0x3e755a)){const _0x89bd82=new Set(_0x244727);_0x89bd82[_0x163cfa(0x111)](_0x3e755a);const _0x5b7c0b=expandConditions(_0x30a706,_0x46b291,_0x89bd82);return{'type':_0x4a7b9c[_0x163cfa(0xf5)],'expanded_rule':_0x5b7c0b};}return{'type':_0x4a7b9c['type'],'expanded_rule':_0x163cfa(0x86)};}const _0x397c11={};for(const _0x14bf61 of Object[_0x163cfa(0xa9)](_0x4a7b9c)){_0x397c11[_0x14bf61]=expandConditions(_0x4a7b9c[_0x14bf61],_0x46b291,_0x244727);}return _0x397c11;}export function serializeExpandedRule(_0x1ca06b,_0x46119b){const _0x4b8ce0=a132_0x30178c,_0x240e91=expandSegmentReferences(_0x1ca06b,_0x46119b);return JSON[_0x4b8ce0(0xc5)](deepSortObject(_0x240e91));}export function createSegmentNameContext(_0x4b23a6){const _0x269566=a132_0x30178c,_0x417a0b=new Set(),_0x3a19b1=new Map(),_0x5b6331=new Map();if(_0x4b23a6)for(const [_0x17a2d4,_0x293faf]of Object[_0x269566(0xb0)](_0x4b23a6)){if(_0x293faf[_0x269566(0xc3)]){const _0x5c2a7a=serializeRule(_0x293faf[_0x269566(0xc3)]);_0x5b6331[_0x269566(0xbd)](_0x5c2a7a,_0x17a2d4),_0x417a0b['add'](_0x17a2d4);}}return{'usedNames':_0x417a0b,'ruleHashToName':_0x3a19b1,'localRuleToName':_0x4b23a6?_0x5b6331:undefined};}export function resolveSegmentName(_0x2b66a9,_0x4fe7ac,_0x4df3c9,_0x553d01){const _0x59872e=a132_0x30178c,_0x8d66b1=serializeRule(_0x4fe7ac);if(_0x4df3c9[_0x59872e(0x90)]){const _0x4225ff=_0x4df3c9['localRuleToName'][_0x59872e(0xd5)](_0x8d66b1);if(_0x4225ff)return{'name':_0x4225ff,'isDuplicate':![],'isLocalMatch':!![]};}const _0x4f4ce7=_0x4df3c9[_0x59872e(0x98)][_0x59872e(0xd5)](_0x8d66b1);if(_0x4f4ce7)return{'name':_0x4f4ce7,'isDuplicate':!![],'isLocalMatch':![]};const _0xa6ca09=_0x553d01(_0x2b66a9);let _0x458e31=_0xa6ca09||_0x2b66a9,_0x19e130=_0x458e31,_0x2c1330=0x2;while(_0x4df3c9[_0x59872e(0x102)]['has'](_0x19e130)){_0x19e130=_0x458e31+'_'+_0x2c1330,_0x2c1330++;}return _0x4df3c9[_0x59872e(0x102)][_0x59872e(0x111)](_0x19e130),_0x4df3c9['ruleHashToName'][_0x59872e(0xbd)](_0x8d66b1,_0x19e130),{'name':_0x19e130,'isDuplicate':![],'isLocalMatch':![]};}function a132_0x541c(){const _0x380e37=['duration','joinRow','connectionNameToIdMap','replace','activationTemplateId','JOURNEY_SYNTAX_ERROR','column','And','CONNECTION_NOT_FOUND','repeatSubFrequency','batch','behavior','repeat_frequency','notification','activationParams','Last','keys','start_at','formatting','segment','startAt','leftValue','repeat_unit','entries','joinStrategy','repeatUnit','Column','76810qERBwI','isVisible','endOn','values','].attribute\x20cannot\x20be\x20empty.\x0a','realtime','visibility','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','from','set','map','First','warn','7PnyPEl','all_columns','rule','parse','stringify','exclude','columns','scheduleType','funnel_stage','orderColumn','238278JRKKaX','value','null','description','end_on','run_after_journey_refresh','rightValue','aggregation','groupingColumns','activations:','get','919035BAYtYQ','Invalid\x20connector_config\x20for\x20activation\x20\x22','repeat_sub_frequency','Please\x20specify\x20a\x20valid\x20attribute\x20name.','INVALID_ARGUMENT','__SEGMENT_REF__','email_recipients','push','syndicationBehavior','allColumns','test','activation_template_id','join_row','connector_config','notify_on','minValue','folder','segmentFolderId','1386eARFGe','emailRecipients','attribute','activations','\x0a\x0aAvailable\x20fields:\x0a','behavior_table','name','4sGPtVT','join_strategy','connectionId','all','kind','runAfterJourneyRefresh','type','Segment\x20description','timezone','warnings','string','\x22:\x0a','Value','length','Unknown\x20connection:\x20','conditions','TimeWithinNext','connection','resolveSegmentName','usedNames','valid','TimeRange','filter','any','Reference','toLowerCase','conditions[','max','isArray','CountDistinct','899526HDzmtM','limit','maxValue','rightValues','add','code','TimeWithinPast','1821592vwmKXV','behaviorTableName','Count','operator','min','not','connector_config\x20for\x20activation\x20\x22','New\x20Segment','sort','schedule','connectorConfig','visible','getSchema','include','1625530UwXBap','connectionNameToTypeMap','__UNRESOLVED__','notifyOn','CONNECTOR_SCHEMA_NOT_FOUND','errors','attributes','unit','rule:','order_by','orderBy','reverse','localRuleToName','\x27:\x20','source','3636078dmdsio','arrayMatching','object','repeatFrequency','localeCompare','ruleHashToName'];a132_0x541c=function(){return _0x380e37;};return a132_0x541c();}export function collectSegmentRefsFromRule(_0x4bb6c4){const _0x4f2450=[],_0x4ccec7=_0x5cb1b8=>{const _0x4d9c72=a132_0x533b;if(!_0x5cb1b8||typeof _0x5cb1b8!==_0x4d9c72(0x95))return;if(Array['isArray'](_0x5cb1b8)){_0x5cb1b8['forEach'](_0x4ccec7);return;}const _0x33f2f4=_0x5cb1b8;(_0x33f2f4['type']===_0x4d9c72(0x83)||_0x33f2f4[_0x4d9c72(0xf5)]===_0x4d9c72(0xc6))&&typeof _0x33f2f4[_0x4d9c72(0xac)]===_0x4d9c72(0xf9)&&_0x4f2450[_0x4d9c72(0xdd)](_0x33f2f4[_0x4d9c72(0xac)]);for(const _0x53cef2 of Object['values'](_0x33f2f4)){_0x4ccec7(_0x53cef2);}};return _0x4ccec7(_0x4bb6c4),_0x4f2450;}export function validateSegmentRule(_0x824638,_0x43d5e9){const _0x229a10=a132_0x30178c;if(!_0x43d5e9||!_0x43d5e9[_0x229a10(0xfe)])return;for(let _0x4b9477=0x0;_0x4b9477<_0x43d5e9[_0x229a10(0xfe)]['length'];_0x4b9477++){const _0x25c1d2=_0x43d5e9[_0x229a10(0xfe)][_0x4b9477];if(_0x229a10(0xf5)in _0x25c1d2&&_0x25c1d2[_0x229a10(0xf5)]==='Value'){const _0x347d8e=_0x25c1d2,_0x2f6e47=_0x347d8e[_0x229a10(0x92)]||_0x347d8e[_0x229a10(0xd2)];if((!_0x347d8e['attribute']||_0x347d8e[_0x229a10(0xea)]==='')&&!_0x2f6e47)throw new SDKError(ErrorCode[_0x229a10(0x9e)],_0x229a10(0xbb)+_0x824638+_0x229a10(0x91)+(_0x229a10(0x109)+_0x4b9477+_0x229a10(0xb8))+_0x229a10(0xd9));}}}
|
|
1
|
+
const a132_0x1637e4=a132_0x6fdb;(function(_0x11995b,_0x3766e5){const _0xae9c6f=a132_0x6fdb,_0x3baaeb=_0x11995b();while(!![]){try{const _0x791d7a=-parseInt(_0xae9c6f(0x1de))/0x1*(-parseInt(_0xae9c6f(0x19e))/0x2)+parseInt(_0xae9c6f(0x1cc))/0x3+parseInt(_0xae9c6f(0x21a))/0x4+-parseInt(_0xae9c6f(0x227))/0x5+parseInt(_0xae9c6f(0x1a6))/0x6+-parseInt(_0xae9c6f(0x1fc))/0x7+-parseInt(_0xae9c6f(0x1f1))/0x8;if(_0x791d7a===_0x3766e5)break;else _0x3baaeb['push'](_0x3baaeb['shift']());}catch(_0x45120c){_0x3baaeb['push'](_0x3baaeb['shift']());}}}(a132_0x4cbe,0x9b364));import*as a132_0x1fe593 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x433d54){return _0x433d54;}function ruleDefAsFilterRule(_0x1eb209){return _0x1eb209;}export function segmentResponseToDefSync(_0x44e670,_0x50c916){const _0x520d70=a132_0x6fdb,_0x5aae5e=_0x44e670[_0x520d70(0x21b)]&&'type'in _0x44e670['rule']&&_0x44e670['rule']['type'];return{'type':_0x520d70(0x1e2),'name':_0x44e670[_0x520d70(0x21c)],..._0x44e670['description']&&{'description':_0x44e670['description']},..._0x50c916&&{'folder':_0x50c916},..._0x5aae5e&&{'rule':apiRuleToYaml(_0x44e670[_0x520d70(0x21b)])},..._0x44e670[_0x520d70(0x213)]!==undefined&&{'kind':_0x44e670[_0x520d70(0x213)]===0x0?_0x520d70(0x238):_0x44e670[_0x520d70(0x213)]===0x1?_0x520d70(0x1b9):_0x520d70(0x1b5)},..._0x44e670[_0x520d70(0x1d1)]!==undefined&&{'visible':_0x44e670[_0x520d70(0x1d1)]}};}export async function segmentResponseToDef(_0x3ae47b,_0x35fd7b,_0x42770d){const _0x1dec46=a132_0x6fdb,_0x4bad20=segmentResponseToDefSync(_0x3ae47b,_0x42770d);if(!_0x35fd7b||!_0x35fd7b[_0x1dec46(0x200)])return _0x4bad20;return _0x4bad20[_0x1dec46(0x21b)]&&(_0x4bad20[_0x1dec46(0x21b)]=await resolveRuleSegmentRefs(_0x4bad20['rule'],_0x35fd7b[_0x1dec46(0x200)])),_0x4bad20;}export function apiRuleToYaml(_0x3a6a64){const _0x156145=a132_0x6fdb,_0x1a576a=(_0x3a6a64['conditions']||[])[_0x156145(0x1d7)](apiConditionToYaml);if(_0x1a576a[_0x156145(0x198)]===0x1&&!_0x3a6a64[_0x156145(0x1b0)]&&_0x156145(0x1cb)in _0x1a576a[0x0]&&(_0x1a576a[0x0][_0x156145(0x1cb)]==='And'||_0x1a576a[0x0][_0x156145(0x1cb)]==='Or')){const _0x4ea5a2=_0x1a576a[0x0];if(_0x4ea5a2[_0x156145(0x1cb)]===_0x3a6a64[_0x156145(0x1cb)]&&_0x4ea5a2[_0x156145(0x1ea)])return{'type':_0x3a6a64[_0x156145(0x1cb)],'conditions':_0x4ea5a2['conditions'],..._0x4ea5a2[_0x156145(0x1b0)]&&{'description':_0x4ea5a2['description']}};}return{'type':_0x3a6a64[_0x156145(0x1cb)],'conditions':_0x1a576a,..._0x3a6a64[_0x156145(0x1b0)]&&{'description':_0x3a6a64[_0x156145(0x1b0)]}};}export async function resolveRuleSegmentRefs(_0x148aa6,_0x858d1f){const _0x4591be=a132_0x6fdb;return transformRuleSegmentRefs(_0x148aa6,_0x858d1f,_0xf4720c=>/^\d+$/[_0x4591be(0x205)](_0xf4720c));}function a132_0x6fdb(_0x237ecf,_0xa75521){_0x237ecf=_0x237ecf-0x197;const _0x4cbe80=a132_0x4cbe();let _0x6fdba2=_0x4cbe80[_0x237ecf];return _0x6fdba2;}function a132_0x4cbe(){const _0x478fb7=['operator','repeatUnit','connector_config','6275670GHVZQn','arrayMatching','activation_template_id','from','string','warn','orderBy','activationParams','source','toLowerCase','schedule','New\x20Segment','runAfterJourneyRefresh','get','valid','CountDistinct','visibility','batch','INVALID_ARGUMENT','And','notifyOn','length','emailRecipients','code','end_on','all','activations','2RTcfeZ','stringify','endOn','TimeWithinPast','startAt','order_by','repeatSubFrequency','start_at','6706824tSTgaB','Value','Last','max','unit','value','join_strategy','keys','min','Connector:\x20','description','repeat_sub_frequency','__SEGMENT_REF__','aggregation','values','funnel_stage','TimeRange','connector_config\x20for\x20activation\x20\x22','Segment\x20description','realtime','Behavior','connectorConfig','all_columns','rightValues','\x22:\x0a','push','leftValue','rightValue','columns','groupingColumns','localeCompare','formatting','orderColumn','errors','Count','syndicationBehavior','duration','type','2337699uDhjGD','isArray','Reference','].attribute\x20cannot\x20be\x20empty.\x0a','limit','isVisible','joinStrategy','rule:','any','attribute_name','folder','map','JOURNEY_SYNTAX_ERROR','null','reverse','Unknown\x20connection:\x20','every','connectionNameToIdMap','189743kUaMBU','scheduleType','connectionId','exclude','segment','email_recipients','notify_on','attributes','repeatFrequency','emailToIdMap','column','set','conditions','parse','usedNames','localRuleToName','attribute','not','joinRow','8895272qSFzyz','behavior','add','filter','\x0a\x0aAvailable\x20fields:\x0a','segmentFolderId','ruleHashToName','Column','TimeWithinNext','sort','CONNECTOR_SCHEMA_NOT_FOUND','1368283escbiP','Equal','connection','activationTemplateId','resolveSegmentName','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','behavior_table','Invalid\x20connector_config\x20for\x20activation\x20\x22','getSchema','test','include','__UNRESOLVED__','isFinite','visible','repeat_unit','First','Unknown\x20email\x20recipient:\x20','warnings','replace','activations:','object','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','notification','kind','Between','join_row','behaviorTableName','has','connectionNameToTypeMap','repeat_frequency','4445920VecRzE','rule','name','entries','minValue','maxValue','timezone','allColumns','CONNECTOR_INVALID_CONFIG','forEach'];a132_0x4cbe=function(){return _0x478fb7;};return a132_0x4cbe();}async function transformConditionSegmentRefs(_0xe7e921,_0xcd9027,_0x27c579,_0x137082){const _0x3201f6=a132_0x6fdb;if('segment'in _0xe7e921&&(_0xe7e921['type']==='include'||_0xe7e921['type']==='exclude')){const _0x4e7176=_0xe7e921;if(_0x27c579(_0x4e7176[_0x3201f6(0x1e2)]))return{..._0x4e7176,'segment':await _0xcd9027(_0x4e7176['segment'])};return _0xe7e921;}if('conditions'in _0xe7e921&&_0xe7e921[_0x3201f6(0x1ea)]){const _0x3b8fc5=_0xe7e921,_0x2ba290=await Promise[_0x3201f6(0x19c)](_0x3b8fc5[_0x3201f6(0x1ea)][_0x3201f6(0x1d7)](_0x367c36=>transformConditionSegmentRefs(_0x367c36,_0xcd9027,_0x27c579,_0x137082)));return{..._0x3b8fc5,'conditions':_0x2ba290};}if(_0x3201f6(0x1f4)in _0xe7e921&&_0xe7e921[_0x3201f6(0x1f4)]){const _0x1b2030=_0xe7e921,_0xc14e0=await _0x137082(filterRuleAsRuleDef(_0x1b2030[_0x3201f6(0x1f4)]),_0xcd9027);return{..._0x1b2030,'filter':ruleDefAsFilterRule(_0xc14e0)};}return _0xe7e921;}async function transformRuleSegmentRefs(_0x54eddd,_0x44249c,_0x80862f){const _0x207ae6=a132_0x6fdb,_0x1b58ae=(_0x373617,_0x2fb11f)=>transformRuleSegmentRefs(_0x373617,_0x2fb11f,_0x80862f),_0x59662f=await Promise[_0x207ae6(0x19c)](_0x54eddd[_0x207ae6(0x1ea)][_0x207ae6(0x1d7)](_0x3c0980=>transformConditionSegmentRefs(_0x3c0980,_0x44249c,_0x80862f,_0x1b58ae)));return{..._0x54eddd,'conditions':_0x59662f};}export async function resolveRuleSegmentIds(_0x47bed5,_0x1a9d55){const _0x197a23=a132_0x6fdb;return transformRuleSegmentRefs(_0x47bed5,_0x1a9d55,_0x2c0b93=>!/^\d+$/[_0x197a23(0x205)](_0x2c0b93));}function isBehaviorApiCondition(_0x57ba77){const _0x44a7f0=a132_0x6fdb;if(!_0x57ba77[_0x44a7f0(0x1c0)]?.[_0x44a7f0(0x22f)]?.['name'])return![];return!![];}function apiConditionToYaml(_0x40d6cf){const _0x27d8e5=a132_0x6fdb;if(_0x40d6cf['type']===_0x27d8e5(0x23a)||_0x40d6cf[_0x27d8e5(0x1cb)]==='Or'){if(_0x40d6cf[_0x27d8e5(0x1ea)]){const _0x598518=_0x40d6cf[_0x27d8e5(0x1ea)][_0x27d8e5(0x1d7)](apiConditionToYaml);if(_0x598518[_0x27d8e5(0x198)]===0x1&&!_0x40d6cf[_0x27d8e5(0x1b0)])return _0x598518[0x0];return{'type':_0x40d6cf[_0x27d8e5(0x1cb)],'conditions':_0x598518,..._0x40d6cf[_0x27d8e5(0x1b0)]&&{'description':_0x40d6cf['description']}};}}if(_0x40d6cf['type']===_0x27d8e5(0x1a7)&&_0x40d6cf[_0x27d8e5(0x1c0)]&&_0x40d6cf[_0x27d8e5(0x224)]){const _0x225730=_0x40d6cf[_0x27d8e5(0x1c0)][_0x27d8e5(0x1b3)]?buildAggregationDefFromApi(_0x40d6cf[_0x27d8e5(0x1c0)]['aggregation']):undefined;if(isBehaviorApiCondition(_0x40d6cf)){const _0x78af38=_0x40d6cf[_0x27d8e5(0x1c0)]['source']['name'];return{'type':_0x27d8e5(0x1ba),'attribute':'','operator':apiOperatorToYaml(_0x40d6cf[_0x27d8e5(0x224)]),..._0x40d6cf[_0x27d8e5(0x228)]&&_0x40d6cf[_0x27d8e5(0x228)]!=='any'?{'arrayMatching':_0x40d6cf[_0x27d8e5(0x228)]}:{},..._0x40d6cf[_0x27d8e5(0x1e1)]?{'exclude':_0x40d6cf[_0x27d8e5(0x1e1)]}:{},..._0x225730?{'aggregation':_0x225730}:{},'source':_0x78af38,..._0x40d6cf[_0x27d8e5(0x1c0)]['filter']?{'filter':apiRuleToYaml(_0x40d6cf[_0x27d8e5(0x1c0)][_0x27d8e5(0x1f4)])}:{},..._0x40d6cf[_0x27d8e5(0x1d0)]!==undefined&&_0x40d6cf[_0x27d8e5(0x1d0)]!==null?{'limit':_0x40d6cf['limit']}:{}};}return{'type':_0x27d8e5(0x1a7),'attribute':_0x40d6cf[_0x27d8e5(0x1c0)][_0x27d8e5(0x21c)]||'','operator':apiOperatorToYaml(_0x40d6cf['operator']),..._0x40d6cf[_0x27d8e5(0x228)]&&_0x40d6cf[_0x27d8e5(0x228)]!==_0x27d8e5(0x1d4)?{'arrayMatching':_0x40d6cf[_0x27d8e5(0x228)]}:{},..._0x40d6cf[_0x27d8e5(0x1e1)]?{'exclude':_0x40d6cf[_0x27d8e5(0x1e1)]}:{},..._0x225730?{'aggregation':_0x225730}:{},..._0x40d6cf[_0x27d8e5(0x1c0)]['filter']?{'filter':apiRuleToYaml(_0x40d6cf['leftValue'][_0x27d8e5(0x1f4)])}:{},..._0x40d6cf[_0x27d8e5(0x1d0)]!==undefined&&_0x40d6cf[_0x27d8e5(0x1d0)]!==null?{'limit':_0x40d6cf[_0x27d8e5(0x1d0)]}:{}};}if(_0x40d6cf[_0x27d8e5(0x1cb)]===_0x27d8e5(0x1f8)&&_0x40d6cf[_0x27d8e5(0x1e8)]&&_0x40d6cf[_0x27d8e5(0x224)])return{'type':_0x27d8e5(0x1f8),'column':_0x40d6cf[_0x27d8e5(0x1e8)],'operator':apiOperatorToYaml(_0x40d6cf[_0x27d8e5(0x224)])};if(_0x40d6cf[_0x27d8e5(0x1cb)]===_0x27d8e5(0x1ce)&&_0x40d6cf['id'])return{'type':_0x40d6cf['exclude']?_0x27d8e5(0x1e1):_0x27d8e5(0x206),'segment':_0x40d6cf['id']};return{'type':_0x27d8e5(0x23a),'conditions':[]};}function isTemporalOperator(_0x1d900d){const _0x21350f=a132_0x6fdb;return _0x1d900d===_0x21350f(0x1a1)||_0x1d900d===_0x21350f(0x1f9);}function isBetweenOperator(_0x2cdd4a){const _0x4f5769=a132_0x6fdb;return _0x2cdd4a===_0x4f5769(0x214);}function getEffectiveValue(_0x16c0e3){const _0x1593be=a132_0x6fdb,_0x412f85=_0x16c0e3[_0x1593be(0x1b4)];return _0x16c0e3[_0x1593be(0x1ab)]??_0x412f85;}function parseNumericValue(_0x31123d){const _0x5625b4=a132_0x6fdb;if(typeof _0x31123d===_0x5625b4(0x210)&&_0x31123d!==null)return _0x31123d;if(_0x31123d==='')return _0x31123d;const _0x301572=Number(_0x31123d);return Number[_0x5625b4(0x208)](_0x301572)?_0x301572:_0x31123d;}function apiOperatorToYaml(_0x2476dc){const _0x42397b=a132_0x6fdb;if(isBetweenOperator(_0x2476dc[_0x42397b(0x1cb)]))return{'type':mapApiOperatorType(_0x2476dc['type']),..._0x2476dc[_0x42397b(0x1ef)]!==undefined&&{'not':_0x2476dc['not']},..._0x2476dc[_0x42397b(0x21e)]!==undefined&&{'min':parseNumericValue(_0x2476dc[_0x42397b(0x21e)])},..._0x2476dc[_0x42397b(0x21f)]!==undefined&&{'max':parseNumericValue(_0x2476dc[_0x42397b(0x21f)])}};if(_0x2476dc[_0x42397b(0x1cb)]==='TimeRange')return{'type':'TimeRange',..._0x2476dc[_0x42397b(0x1ef)]!==undefined&&{'not':_0x2476dc['not']},..._0x2476dc[_0x42397b(0x1ca)]!==undefined&&{'duration':_0x2476dc[_0x42397b(0x1ca)]},..._0x2476dc[_0x42397b(0x22a)]!==undefined&&{'from':_0x2476dc[_0x42397b(0x22a)]},..._0x2476dc[_0x42397b(0x1da)]!==undefined&&{'reverse':_0x2476dc[_0x42397b(0x1da)]}};let _0x3190e3;if(_0x2476dc[_0x42397b(0x1bd)]&&_0x2476dc[_0x42397b(0x1bd)][_0x42397b(0x198)]>0x0)_0x3190e3=_0x2476dc[_0x42397b(0x1bd)];else{if(_0x2476dc['rightValue']!==undefined)_0x3190e3=_0x2476dc[_0x42397b(0x1c1)];else isTemporalOperator(_0x2476dc['type'])&&_0x2476dc[_0x42397b(0x1ab)]!==undefined&&(_0x3190e3=_0x2476dc[_0x42397b(0x1ab)]);}return{'type':mapApiOperatorType(_0x2476dc[_0x42397b(0x1cb)]),..._0x2476dc[_0x42397b(0x1ef)]!==undefined&&{'not':_0x2476dc['not']},..._0x3190e3!==undefined&&{'value':_0x3190e3},..._0x2476dc[_0x42397b(0x1aa)]!==undefined&&{'unit':_0x2476dc[_0x42397b(0x1aa)]}};}function mapApiOperatorType(_0x3ddab1){return _0x3ddab1;}export function segmentDefToCreateRequest(_0x3ff4b4,_0x416275){const _0x377888=a132_0x6fdb,_0x2bfc86={'name':_0x3ff4b4['name']};return _0x3ff4b4[_0x377888(0x1b0)]&&(_0x2bfc86[_0x377888(0x1b0)]=_0x3ff4b4[_0x377888(0x1b0)]),_0x3ff4b4[_0x377888(0x21b)]&&(_0x2bfc86[_0x377888(0x21b)]=yamlRuleToApi(_0x3ff4b4['rule'])),_0x3ff4b4[_0x377888(0x213)]&&(_0x2bfc86[_0x377888(0x213)]=_0x3ff4b4[_0x377888(0x213)]===_0x377888(0x238)?0x0:_0x3ff4b4['kind']===_0x377888(0x1b9)?0x1:0x2),_0x3ff4b4['visible']!==undefined&&(_0x2bfc86[_0x377888(0x1d1)]=_0x3ff4b4[_0x377888(0x209)]),_0x416275&&(_0x2bfc86[_0x377888(0x1f6)]=_0x416275),_0x2bfc86;}export function segmentDefToUpdateRequest(_0x4d7065){const _0x2dbeb5=a132_0x6fdb,_0x316f20={'name':_0x4d7065[_0x2dbeb5(0x21c)]};return _0x4d7065[_0x2dbeb5(0x1b0)]!==undefined&&(_0x316f20[_0x2dbeb5(0x1b0)]=_0x4d7065[_0x2dbeb5(0x1b0)]),_0x4d7065[_0x2dbeb5(0x21b)]&&(_0x316f20['rule']=yamlRuleToApi(_0x4d7065[_0x2dbeb5(0x21b)])),_0x4d7065[_0x2dbeb5(0x213)]&&(_0x316f20[_0x2dbeb5(0x213)]=_0x4d7065[_0x2dbeb5(0x213)]===_0x2dbeb5(0x238)?0x0:_0x4d7065[_0x2dbeb5(0x213)]===_0x2dbeb5(0x1b9)?0x1:0x2),_0x316f20;}export function yamlRuleToApi(_0x58184b,_0x21156c=![]){const _0x3ce943=a132_0x6fdb,_0x5576e0=_0x58184b[_0x3ce943(0x1ea)][_0x3ce943(0x1d7)](yamlConditionToApi);if(_0x21156c){const _0x9da901=_0x5576e0[_0x3ce943(0x1dc)](_0x258098=>_0x258098[_0x3ce943(0x1cb)]==='And'||_0x258098['type']==='Or');if(!_0x9da901&&_0x5576e0[_0x3ce943(0x198)]>0x0)return{'type':_0x58184b[_0x3ce943(0x1cb)],'conditions':[{'type':_0x3ce943(0x23a),'description':_0x58184b['description']||'','conditions':_0x5576e0}]};}return{'type':_0x58184b[_0x3ce943(0x1cb)],'conditions':_0x5576e0,..._0x58184b[_0x3ce943(0x1b0)]&&{'description':_0x58184b[_0x3ce943(0x1b0)]}};}function yamlConditionToApi(_0x4f0756){const _0x5e8a86=a132_0x6fdb;if(_0x5e8a86(0x1e2)in _0x4f0756&&(_0x4f0756[_0x5e8a86(0x1cb)]===_0x5e8a86(0x206)||_0x4f0756['type']===_0x5e8a86(0x1e1))){const _0xdc21f4=_0x4f0756;return{'type':_0x5e8a86(0x1ce),'id':_0xdc21f4['segment'],'exclude':_0xdc21f4['type']==='exclude'};}if(_0x5e8a86(0x1cb)in _0x4f0756&&(_0x4f0756[_0x5e8a86(0x1cb)]===_0x5e8a86(0x23a)||_0x4f0756[_0x5e8a86(0x1cb)]==='Or')){const _0x2e3101=_0x4f0756;return{'type':_0x2e3101[_0x5e8a86(0x1cb)],'conditions':_0x2e3101['conditions']['map'](yamlConditionToApi),..._0x2e3101[_0x5e8a86(0x1b0)]&&{'description':_0x2e3101[_0x5e8a86(0x1b0)]}};}if('column'in _0x4f0756&&_0x4f0756['type']==='Column'){const _0x1df9bb=_0x4f0756;return{'type':_0x5e8a86(0x1f8),'column':_0x1df9bb[_0x5e8a86(0x1e8)],'operator':yamlOperatorToApi(_0x1df9bb[_0x5e8a86(0x224)])};}const _0x37311e=_0x4f0756,_0x1951ec={'type':_0x5e8a86(0x1a7),'leftValue':buildLeftValue(_0x37311e),'operator':yamlOperatorToApi(_0x37311e[_0x5e8a86(0x224)]),'exclude':_0x37311e['exclude']??![],'arrayMatching':_0x37311e[_0x5e8a86(0x228)]??_0x5e8a86(0x1d4)};return _0x37311e[_0x5e8a86(0x1d0)]!==undefined&&(_0x1951ec[_0x5e8a86(0x1d0)]=_0x37311e[_0x5e8a86(0x1d0)]),_0x1951ec;}function buildAggregationDefFromApi(_0x1059f7){const _0x270f02=a132_0x6fdb,_0x4adf7a=_0x1059f7[_0x270f02(0x1cb)];if(_0x4adf7a===_0x270f02(0x236))return{'type':_0x4adf7a,'columns':_0x1059f7['columns']??[]};if(_0x4adf7a===_0x270f02(0x20b)||_0x4adf7a===_0x270f02(0x1a8))return{'type':_0x4adf7a,'column':_0x1059f7[_0x270f02(0x1e8)]??'','orderColumn':_0x1059f7[_0x270f02(0x1c6)]??'',..._0x1059f7[_0x270f02(0x1c3)]&&{'groupingColumns':_0x1059f7['groupingColumns']}};if(_0x4adf7a===_0x270f02(0x1c8))return{'type':_0x4adf7a,..._0x1059f7[_0x270f02(0x1c3)]&&{'groupingColumns':_0x1059f7[_0x270f02(0x1c3)]}};return{'type':_0x4adf7a,'column':_0x1059f7[_0x270f02(0x1e8)]??'',..._0x1059f7['groupingColumns']&&{'groupingColumns':_0x1059f7['groupingColumns']}};}function buildLeftValue(_0x22c5b2){const _0x498927=a132_0x6fdb,_0x4eae16={};_0x22c5b2['attribute']&&_0x22c5b2['type']!==_0x498927(0x1ba)&&(_0x4eae16[_0x498927(0x21c)]=_0x22c5b2[_0x498927(0x1ee)]);if(_0x22c5b2[_0x498927(0x1b3)]){const _0x4b7457=_0x22c5b2[_0x498927(0x1b3)];if(_0x4b7457[_0x498927(0x1cb)]==='CountDistinct')_0x4eae16[_0x498927(0x1b3)]={'type':'CountDistinct','columns':_0x4b7457[_0x498927(0x1c2)]};else{if(_0x4b7457['type']===_0x498927(0x20b)||_0x4b7457[_0x498927(0x1cb)]==='Last')_0x4eae16[_0x498927(0x1b3)]={'type':_0x4b7457['type'],'column':_0x4b7457['column'],'orderColumn':_0x4b7457[_0x498927(0x1c6)],..._0x4b7457[_0x498927(0x1c3)]&&{'groupingColumns':_0x4b7457[_0x498927(0x1c3)]}};else _0x4b7457[_0x498927(0x1cb)]===_0x498927(0x1c8)?_0x4eae16[_0x498927(0x1b3)]={'type':'Count',..._0x4b7457[_0x498927(0x1c3)]&&{'groupingColumns':_0x4b7457[_0x498927(0x1c3)]}}:_0x4eae16[_0x498927(0x1b3)]={'type':_0x4b7457[_0x498927(0x1cb)],'column':_0x4b7457['column'],..._0x4b7457[_0x498927(0x1c3)]&&{'groupingColumns':_0x4b7457[_0x498927(0x1c3)]}};}}return _0x22c5b2['source']&&(_0x4eae16['source']={'name':_0x22c5b2[_0x498927(0x22f)]}),_0x22c5b2[_0x498927(0x1f4)]&&(_0x4eae16[_0x498927(0x1f4)]=yamlRuleToApi(filterRuleAsRuleDef(_0x22c5b2[_0x498927(0x1f4)]))),_0x4eae16;}function yamlOperatorToApi(_0x8fbe88){const _0x1b4ef1=a132_0x6fdb,_0x1428ef={'type':mapYamlOperatorType(_0x8fbe88[_0x1b4ef1(0x1cb)]),'not':_0x8fbe88[_0x1b4ef1(0x1ef)]??![]};if(isBetweenOperator(_0x8fbe88[_0x1b4ef1(0x1cb)]))return _0x8fbe88[_0x1b4ef1(0x1ae)]!==undefined&&(_0x1428ef[_0x1b4ef1(0x21e)]=typeof _0x8fbe88[_0x1b4ef1(0x1ae)]===_0x1b4ef1(0x210)?_0x8fbe88[_0x1b4ef1(0x1ae)]:String(_0x8fbe88[_0x1b4ef1(0x1ae)])),_0x8fbe88[_0x1b4ef1(0x1a9)]!==undefined&&(_0x1428ef[_0x1b4ef1(0x21f)]=typeof _0x8fbe88[_0x1b4ef1(0x1a9)]===_0x1b4ef1(0x210)?_0x8fbe88[_0x1b4ef1(0x1a9)]:String(_0x8fbe88[_0x1b4ef1(0x1a9)])),_0x1428ef;if(_0x8fbe88[_0x1b4ef1(0x1cb)]===_0x1b4ef1(0x1b6))return _0x8fbe88[_0x1b4ef1(0x1ca)]&&(_0x1428ef[_0x1b4ef1(0x1ca)]=_0x8fbe88[_0x1b4ef1(0x1ca)]),_0x8fbe88[_0x1b4ef1(0x22a)]&&(_0x1428ef[_0x1b4ef1(0x22a)]=_0x8fbe88[_0x1b4ef1(0x22a)]),_0x8fbe88[_0x1b4ef1(0x1da)]!==undefined&&(_0x1428ef[_0x1b4ef1(0x1da)]=_0x8fbe88[_0x1b4ef1(0x1da)]),_0x1428ef;const _0x946255=getEffectiveValue(_0x8fbe88);if(_0x946255!==undefined){if(Array[_0x1b4ef1(0x1cd)](_0x946255))_0x1428ef['rightValues']=_0x946255;else isTemporalOperator(_0x8fbe88[_0x1b4ef1(0x1cb)])?_0x1428ef[_0x1b4ef1(0x1ab)]=_0x946255:_0x1428ef[_0x1b4ef1(0x1c1)]=_0x946255;}return _0x8fbe88[_0x1b4ef1(0x1aa)]&&(_0x1428ef[_0x1b4ef1(0x1aa)]=_0x8fbe88[_0x1b4ef1(0x1aa)]),_0x1428ef;}function mapYamlOperatorType(_0x5af0db){return _0x5af0db;}export function toYamlString(_0x3c35dc){const _0x394555=a132_0x6fdb,_0x4a2442=JSON[_0x394555(0x1eb)](JSON[_0x394555(0x19f)](_0x3c35dc)),_0x48f69b=a132_0x1fe593[_0x394555(0x19f)](_0x4a2442,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x394555(0x1d9)}),_0x48fab6=['rule:'];let _0x4f213b=_0x48f69b;for(const _0x4a43d8 of _0x48fab6){_0x4f213b=_0x4f213b[_0x394555(0x20e)](new RegExp('^('+_0x4a43d8+')','m'),(_0x38240d,_0x5de516,_0x2d37de)=>{if(_0x2d37de===0x0||_0x4f213b[_0x2d37de-0x1]==='\x0a'&&_0x4f213b[_0x2d37de-0x2]==='\x0a')return _0x5de516;return'\x0a'+_0x5de516;});}return _0x4f213b;}export function parseYamlString(_0x202adf){return parseSegmentYamlFile(_0x202adf);}export function isSegmentYaml(_0x5c373e){const _0x442daa=a132_0x6fdb;if(typeof _0x5c373e!==_0x442daa(0x210)||_0x5c373e===null)return![];const _0x535f8b=_0x5c373e;return _0x535f8b[_0x442daa(0x1cb)]===_0x442daa(0x1e2)||_0x535f8b['type']===undefined;}export function generateTemplate(_0x7fd5cc=a132_0x1637e4(0x232)){const _0x4164f9=a132_0x1637e4,_0x5ebabe={'type':_0x4164f9(0x1e2),'name':_0x7fd5cc,'description':_0x4164f9(0x1b8),'rule':{'type':_0x4164f9(0x23a),'conditions':[{'type':'Value','attribute':_0x4164f9(0x1d5),'operator':{'type':_0x4164f9(0x1fd),'value':_0x4164f9(0x1ab)}}]}};return toYamlString(_0x5ebabe);}export function segmentToYamlString(_0xe35a12){const _0x3201d1=a132_0x1637e4,_0x3a53ec=JSON[_0x3201d1(0x1eb)](JSON[_0x3201d1(0x19f)](_0xe35a12)),_0xf6dcf=a132_0x1fe593[_0x3201d1(0x19f)](_0x3a53ec,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3201d1(0x1d9)}),_0x35bd85=[_0x3201d1(0x1d3),_0x3201d1(0x20f)];let _0x3758b3=_0xf6dcf;for(const _0x536f4d of _0x35bd85){_0x3758b3=_0x3758b3['replace'](new RegExp('^('+_0x536f4d+')','m'),(_0x547b22,_0x1d0976,_0x341483)=>{if(_0x341483===0x0||_0x3758b3[_0x341483-0x1]==='\x0a'&&_0x3758b3[_0x341483-0x2]==='\x0a')return _0x1d0976;return'\x0a'+_0x1d0976;});}return _0x3758b3;}export function parseSegmentYamlFile(_0x546a14){return safeParseYaml(_0x546a14,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x4a9e53){const _0x5d9385=a132_0x1637e4;return{'type':_0x5d9385(0x1e2),'name':_0x4a9e53[_0x5d9385(0x21c)],..._0x4a9e53[_0x5d9385(0x1b0)]!==undefined&&{'description':_0x4a9e53[_0x5d9385(0x1b0)]},..._0x4a9e53[_0x5d9385(0x1d6)]!==undefined&&{'folder':_0x4a9e53[_0x5d9385(0x1d6)]},..._0x4a9e53[_0x5d9385(0x21b)]&&{'rule':normalizeRule(_0x4a9e53[_0x5d9385(0x21b)])},..._0x4a9e53['kind']!==undefined&&{'kind':_0x4a9e53[_0x5d9385(0x213)]},..._0x4a9e53[_0x5d9385(0x209)]!==undefined&&{'visible':_0x4a9e53[_0x5d9385(0x209)]},..._0x4a9e53['activations']&&{'activations':_0x4a9e53[_0x5d9385(0x19d)][_0x5d9385(0x1d7)](normalizeActivation)}};}export function normalizeRule(_0x359b8e){const _0x391765=a132_0x1637e4;return{'type':_0x359b8e[_0x391765(0x1cb)],'conditions':_0x359b8e[_0x391765(0x1ea)][_0x391765(0x1d7)](normalizeCondition),..._0x359b8e['description']!==undefined&&{'description':_0x359b8e[_0x391765(0x1b0)]}};}function normalizeCondition(_0x39f00d){const _0x1ca97e=a132_0x1637e4;if(_0x1ca97e(0x1e2)in _0x39f00d&&(_0x39f00d['type']===_0x1ca97e(0x206)||_0x39f00d[_0x1ca97e(0x1cb)]===_0x1ca97e(0x1e1))){const _0x3d698f=_0x39f00d;return{'type':_0x3d698f['type'],'segment':_0x3d698f['segment']};}if('type'in _0x39f00d&&(_0x39f00d['type']==='And'||_0x39f00d[_0x1ca97e(0x1cb)]==='Or')){const _0x526bf7=_0x39f00d;return{'type':_0x526bf7['type'],'conditions':_0x526bf7['conditions'][_0x1ca97e(0x1d7)](normalizeCondition),..._0x526bf7[_0x1ca97e(0x1b0)]!==undefined&&{'description':_0x526bf7[_0x1ca97e(0x1b0)]}};}if(_0x1ca97e(0x1e8)in _0x39f00d&&_0x39f00d[_0x1ca97e(0x1cb)]==='Column'){const _0x41c52b=_0x39f00d;return{'type':_0x1ca97e(0x1f8),'column':_0x41c52b[_0x1ca97e(0x1e8)],'operator':normalizeOperator(_0x41c52b['operator'])};}const _0x480fe8=_0x39f00d;return{'type':'Value','attribute':_0x480fe8['attribute'],'operator':normalizeOperator(_0x480fe8[_0x1ca97e(0x224)]),..._0x480fe8[_0x1ca97e(0x228)]!==undefined&&{'arrayMatching':_0x480fe8[_0x1ca97e(0x228)]},..._0x480fe8['exclude']!==undefined&&{'exclude':_0x480fe8[_0x1ca97e(0x1e1)]},..._0x480fe8[_0x1ca97e(0x1b3)]!==undefined&&{'aggregation':_0x480fe8['aggregation']},..._0x480fe8[_0x1ca97e(0x22f)]!==undefined&&{'source':_0x480fe8['source']},..._0x480fe8[_0x1ca97e(0x1f4)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x480fe8['filter'])))},..._0x480fe8['limit']!==undefined&&{'limit':_0x480fe8['limit']}};}function normalizeOperator(_0x1f2bbd){const _0x5e4d98=a132_0x1637e4;if(isBetweenOperator(_0x1f2bbd[_0x5e4d98(0x1cb)]))return{'type':_0x1f2bbd['type'],..._0x1f2bbd[_0x5e4d98(0x1ef)]!==undefined&&{'not':_0x1f2bbd[_0x5e4d98(0x1ef)]},..._0x1f2bbd[_0x5e4d98(0x1ae)]!==undefined&&{'min':_0x1f2bbd[_0x5e4d98(0x1ae)]},..._0x1f2bbd[_0x5e4d98(0x1a9)]!==undefined&&{'max':_0x1f2bbd[_0x5e4d98(0x1a9)]}};const _0x24a0f7=getEffectiveValue(_0x1f2bbd);return{'type':_0x1f2bbd[_0x5e4d98(0x1cb)],..._0x1f2bbd['not']!==undefined&&{'not':_0x1f2bbd[_0x5e4d98(0x1ef)]},..._0x24a0f7!==undefined&&{'value':_0x24a0f7},..._0x1f2bbd[_0x5e4d98(0x1aa)]!==undefined&&{'unit':_0x1f2bbd[_0x5e4d98(0x1aa)]},..._0x1f2bbd[_0x5e4d98(0x1ca)]!==undefined&&{'duration':_0x1f2bbd['duration']},..._0x1f2bbd[_0x5e4d98(0x22a)]!==undefined&&{'from':_0x1f2bbd[_0x5e4d98(0x22a)]},..._0x1f2bbd[_0x5e4d98(0x1da)]!==undefined&&{'reverse':_0x1f2bbd[_0x5e4d98(0x1da)]}};}function normalizeActivation(_0x2b1221){const _0x158fcd=a132_0x1637e4;return{'name':_0x2b1221[_0x158fcd(0x21c)],'connection':_0x2b1221[_0x158fcd(0x1fe)],..._0x2b1221[_0x158fcd(0x1b0)]!==undefined&&{'description':_0x2b1221[_0x158fcd(0x1b0)]},..._0x2b1221['all_columns']!==undefined&&{'all_columns':_0x2b1221[_0x158fcd(0x1bc)]},..._0x2b1221[_0x158fcd(0x1c2)]!==undefined&&{'columns':_0x2b1221[_0x158fcd(0x1c2)]},..._0x2b1221[_0x158fcd(0x1f2)]!==undefined&&{'behavior':_0x2b1221['behavior']},..._0x2b1221[_0x158fcd(0x231)]!==undefined&&{'schedule':_0x2b1221[_0x158fcd(0x231)]},..._0x2b1221[_0x158fcd(0x212)]!==undefined&&{'notification':_0x2b1221[_0x158fcd(0x212)]},..._0x2b1221[_0x158fcd(0x226)]!==undefined&&{'connector_config':_0x2b1221[_0x158fcd(0x226)]},..._0x2b1221[_0x158fcd(0x229)]!==undefined&&{'activation_template_id':_0x2b1221[_0x158fcd(0x229)]}};}export function activationResponseToDef(_0x42bcc9,_0x2be6f9,_0x52d039){const _0x1db7da=a132_0x1637e4,_0x3abd04=_0x42bcc9[_0x1db7da(0x1e0)]||'',_0xe4dcf2=_0x52d039?.[_0x1db7da(0x234)](_0x3abd04)??_0x3abd04,_0x5877a0={'name':_0x42bcc9[_0x1db7da(0x21c)],'connection':_0xe4dcf2};_0x42bcc9['description']&&(_0x5877a0[_0x1db7da(0x1b0)]=_0x42bcc9['description']);let _0x49f78a=[];_0x42bcc9[_0x1db7da(0x1c2)]&&_0x42bcc9[_0x1db7da(0x1c2)][_0x1db7da(0x198)]>0x0&&(_0x49f78a=_0x42bcc9[_0x1db7da(0x1c2)][_0x1db7da(0x1f4)](_0x2d8814=>_0x2d8814&&_0x2d8814[_0x1db7da(0x21c)])[_0x1db7da(0x1d7)](_0xc85622=>{const _0x565c3d=_0x1db7da;if(_0xc85622[_0x565c3d(0x1cb)]||_0xc85622[_0x565c3d(0x237)])return{'name':_0xc85622[_0x565c3d(0x21c)],..._0xc85622[_0x565c3d(0x1cb)]&&{'type':_0xc85622['type']},..._0xc85622[_0x565c3d(0x237)]&&{'visibility':_0xc85622[_0x565c3d(0x237)]}};return _0xc85622['name'];}));_0x49f78a['length']>0x0&&(_0x5877a0[_0x1db7da(0x1c2)]=_0x49f78a);_0x42bcc9[_0x1db7da(0x221)]!==undefined&&(_0x42bcc9[_0x1db7da(0x221)]===![]&&_0x49f78a[_0x1db7da(0x198)]===0x0?_0x5877a0[_0x1db7da(0x1bc)]=!![]:_0x5877a0[_0x1db7da(0x1bc)]=_0x42bcc9[_0x1db7da(0x221)]);const _0x499aa6={};let _0x3ef1eb=![];_0x42bcc9[_0x1db7da(0x1df)]&&(_0x499aa6[_0x1db7da(0x1cb)]=_0x42bcc9[_0x1db7da(0x1df)],_0x3ef1eb=!![]);_0x42bcc9[_0x1db7da(0x225)]&&(_0x499aa6[_0x1db7da(0x20a)]=_0x42bcc9['repeatUnit'],_0x3ef1eb=!![]);_0x42bcc9['repeatFrequency']!==undefined&&_0x42bcc9[_0x1db7da(0x1e6)]!==null&&(_0x499aa6[_0x1db7da(0x219)]=_0x42bcc9[_0x1db7da(0x1e6)],_0x3ef1eb=!![]);_0x42bcc9['repeatSubFrequency']&&_0x42bcc9[_0x1db7da(0x1a4)][_0x1db7da(0x198)]>0x0&&(_0x499aa6['repeat_sub_frequency']=_0x42bcc9['repeatSubFrequency'],_0x3ef1eb=!![]);_0x42bcc9['startAt']!==undefined&&(_0x499aa6[_0x1db7da(0x1a5)]=_0x42bcc9[_0x1db7da(0x1a2)],_0x3ef1eb=!![]);_0x42bcc9['endOn']!==undefined&&(_0x499aa6['end_on']=_0x42bcc9[_0x1db7da(0x1a0)],_0x3ef1eb=!![]);_0x42bcc9[_0x1db7da(0x220)]&&(_0x499aa6['timezone']=_0x42bcc9[_0x1db7da(0x220)],_0x3ef1eb=!![]);_0x3ef1eb&&(_0x5877a0[_0x1db7da(0x231)]=_0x499aa6);(_0x42bcc9[_0x1db7da(0x197)]&&_0x42bcc9[_0x1db7da(0x197)][_0x1db7da(0x198)]>0x0||_0x42bcc9[_0x1db7da(0x199)]&&_0x42bcc9['emailRecipients'][_0x1db7da(0x198)]>0x0)&&(_0x5877a0['notification']={},_0x42bcc9[_0x1db7da(0x197)]&&_0x42bcc9[_0x1db7da(0x197)]['length']>0x0&&(_0x5877a0[_0x1db7da(0x212)][_0x1db7da(0x1e4)]=_0x42bcc9[_0x1db7da(0x197)]),_0x42bcc9['emailRecipients']&&_0x42bcc9[_0x1db7da(0x199)][_0x1db7da(0x198)]>0x0&&(_0x5877a0[_0x1db7da(0x212)]['email_recipients']=_0x42bcc9[_0x1db7da(0x199)][_0x1db7da(0x1d7)](_0x1498eb=>{const _0x27709b=_0x1db7da,_0x406060=_0x2be6f9?.[_0x27709b(0x234)](_0x1498eb);return _0x406060??String(_0x1498eb);})));_0x42bcc9[_0x1db7da(0x1bb)]&&Object[_0x1db7da(0x1ad)](_0x42bcc9[_0x1db7da(0x1bb)])[_0x1db7da(0x198)]>0x0&&(_0x5877a0[_0x1db7da(0x226)]=normalizeConnectorConfigForYaml(_0x42bcc9[_0x1db7da(0x1bb)]));_0x42bcc9['activationTemplateId']&&(_0x5877a0[_0x1db7da(0x229)]=_0x42bcc9[_0x1db7da(0x1ff)]);if(_0x42bcc9[_0x1db7da(0x1c9)]){const _0x2c06b1={},_0x1f67f6=_0x42bcc9[_0x1db7da(0x1c9)];_0x1f67f6['columns']&&_0x1f67f6[_0x1db7da(0x1c2)][_0x1db7da(0x198)]>0x0&&(_0x2c06b1[_0x1db7da(0x1c2)]=_0x1f67f6[_0x1db7da(0x1c2)][_0x1db7da(0x1f4)](_0x5c6010=>_0x5c6010&&_0x5c6010[_0x1db7da(0x21c)])[_0x1db7da(0x1d7)](_0x9cd80e=>({'name':_0x9cd80e[_0x1db7da(0x21c)],..._0x9cd80e[_0x1db7da(0x1cb)]&&{'type':_0x9cd80e[_0x1db7da(0x1cb)]},..._0x9cd80e['visibility']&&{'visibility':_0x9cd80e[_0x1db7da(0x237)]}}))),_0x1f67f6['behaviorTableName']&&(_0x2c06b1[_0x1db7da(0x202)]=_0x1f67f6[_0x1db7da(0x216)]),_0x1f67f6['joinRow']!==undefined&&(_0x2c06b1['join_row']=_0x1f67f6['joinRow']),_0x1f67f6['joinStrategy']&&(_0x2c06b1[_0x1db7da(0x1ac)]=_0x1f67f6[_0x1db7da(0x1d2)]),_0x1f67f6[_0x1db7da(0x1c5)]&&(_0x2c06b1[_0x1db7da(0x1c5)]=_0x1f67f6[_0x1db7da(0x1c5)]),_0x1f67f6[_0x1db7da(0x22d)]&&_0x1f67f6[_0x1db7da(0x22d)][_0x1db7da(0x198)]>0x0&&(_0x2c06b1[_0x1db7da(0x1a3)]=_0x1f67f6[_0x1db7da(0x22d)]),Object[_0x1db7da(0x1ad)](_0x2c06b1)[_0x1db7da(0x198)]>0x0&&(_0x5877a0[_0x1db7da(0x1f2)]=_0x2c06b1);}return _0x5877a0;}export function journeyActivationStepToYaml(_0x338e88,_0x5d1419,_0xadc770){const _0x1221d9=a132_0x1637e4,_0x5b6dfe=_0x338e88[_0x1221d9(0x1e5)][_0x1221d9(0x22e)],_0x46beea=_0x5b6dfe[_0x1221d9(0x1e0)]||'',_0x21c8ed=_0xadc770?.[_0x1221d9(0x234)](_0x46beea)??_0x46beea,_0x2339af={'name':_0x5b6dfe[_0x1221d9(0x21c)]||'','connection':_0x21c8ed};_0x338e88['attributes'][_0x1221d9(0x233)]&&(_0x2339af['run_after_journey_refresh']=!![]);_0x5b6dfe['description']&&(_0x2339af[_0x1221d9(0x1b0)]=_0x5b6dfe['description']);let _0x231545=[];_0x5b6dfe['columns']&&_0x5b6dfe['columns']['length']>0x0&&(_0x231545=_0x5b6dfe[_0x1221d9(0x1c2)][_0x1221d9(0x1f4)](_0x54081c=>_0x54081c&&_0x54081c[_0x1221d9(0x21c)])[_0x1221d9(0x1d7)](_0x5eb1dd=>{const _0x410000=_0x1221d9;if(_0x5eb1dd[_0x410000(0x1cb)]||_0x5eb1dd[_0x410000(0x237)])return{'name':_0x5eb1dd[_0x410000(0x21c)],..._0x5eb1dd[_0x410000(0x1cb)]&&{'type':_0x5eb1dd['type']},..._0x5eb1dd[_0x410000(0x237)]&&{'visibility':_0x5eb1dd[_0x410000(0x237)]}};return _0x5eb1dd[_0x410000(0x21c)];}));_0x231545['length']>0x0&&(_0x2339af[_0x1221d9(0x1c2)]=_0x231545);_0x5b6dfe['allColumns']!==undefined&&(_0x5b6dfe['allColumns']===![]&&_0x231545['length']===0x0?_0x2339af[_0x1221d9(0x1bc)]=!![]:_0x2339af['all_columns']=_0x5b6dfe[_0x1221d9(0x221)]);const _0x4dc472={};let _0x470946=![];_0x5b6dfe[_0x1221d9(0x1df)]&&(_0x4dc472[_0x1221d9(0x1cb)]=_0x5b6dfe[_0x1221d9(0x1df)],_0x470946=!![]);_0x5b6dfe[_0x1221d9(0x225)]&&(_0x4dc472['repeat_unit']=_0x5b6dfe['repeatUnit'],_0x470946=!![]);_0x5b6dfe[_0x1221d9(0x1e6)]!==undefined&&_0x5b6dfe[_0x1221d9(0x1e6)]!==null&&(_0x4dc472[_0x1221d9(0x219)]=_0x5b6dfe[_0x1221d9(0x1e6)],_0x470946=!![]);_0x5b6dfe['startAt']!==undefined&&(_0x4dc472['start_at']=_0x5b6dfe['startAt'],_0x470946=!![]);_0x5b6dfe[_0x1221d9(0x1a0)]!==undefined&&(_0x4dc472[_0x1221d9(0x19b)]=_0x5b6dfe['endOn'],_0x470946=!![]);_0x5b6dfe['timezone']&&(_0x4dc472[_0x1221d9(0x220)]=_0x5b6dfe['timezone'],_0x470946=!![]);_0x470946&&(_0x2339af[_0x1221d9(0x231)]=_0x4dc472);(_0x5b6dfe[_0x1221d9(0x197)]&&_0x5b6dfe['notifyOn'][_0x1221d9(0x198)]>0x0||_0x5b6dfe[_0x1221d9(0x199)]&&_0x5b6dfe['emailRecipients'][_0x1221d9(0x198)]>0x0)&&(_0x2339af[_0x1221d9(0x212)]={},_0x5b6dfe[_0x1221d9(0x197)]&&_0x5b6dfe[_0x1221d9(0x197)][_0x1221d9(0x198)]>0x0&&(_0x2339af[_0x1221d9(0x212)][_0x1221d9(0x1e4)]=_0x5b6dfe[_0x1221d9(0x197)]),_0x5b6dfe['emailRecipients']&&_0x5b6dfe['emailRecipients'][_0x1221d9(0x198)]>0x0&&(_0x2339af[_0x1221d9(0x212)]['email_recipients']=_0x5b6dfe[_0x1221d9(0x199)][_0x1221d9(0x1d7)](_0x19e66d=>{const _0x398a39=_0x1221d9,_0x2d7333=_0x5d1419?.[_0x398a39(0x234)](_0x19e66d);return _0x2d7333??String(_0x19e66d);})));_0x5b6dfe[_0x1221d9(0x1bb)]&&Object['keys'](_0x5b6dfe[_0x1221d9(0x1bb)])[_0x1221d9(0x198)]>0x0&&(_0x2339af[_0x1221d9(0x226)]=normalizeConnectorConfigForYaml(_0x5b6dfe[_0x1221d9(0x1bb)]));_0x5b6dfe[_0x1221d9(0x1ff)]&&(_0x2339af[_0x1221d9(0x229)]=_0x5b6dfe['activationTemplateId']);if(_0x5b6dfe[_0x1221d9(0x1c9)]){const _0x4b2613={},_0xfd7c43=_0x5b6dfe[_0x1221d9(0x1c9)];_0xfd7c43[_0x1221d9(0x1c2)]&&_0xfd7c43['columns']['length']>0x0&&(_0x4b2613[_0x1221d9(0x1c2)]=_0xfd7c43[_0x1221d9(0x1c2)][_0x1221d9(0x1f4)](_0x33b056=>_0x33b056&&_0x33b056[_0x1221d9(0x21c)])[_0x1221d9(0x1d7)](_0x3960a8=>({'name':_0x3960a8[_0x1221d9(0x21c)],..._0x3960a8[_0x1221d9(0x1cb)]&&{'type':_0x3960a8['type']},..._0x3960a8[_0x1221d9(0x237)]&&{'visibility':_0x3960a8[_0x1221d9(0x237)]}}))),_0xfd7c43[_0x1221d9(0x216)]&&(_0x4b2613[_0x1221d9(0x202)]=_0xfd7c43[_0x1221d9(0x216)]),_0xfd7c43[_0x1221d9(0x1f0)]!==undefined&&(_0x4b2613['join_row']=_0xfd7c43[_0x1221d9(0x1f0)]),_0xfd7c43['joinStrategy']&&(_0x4b2613['join_strategy']=_0xfd7c43[_0x1221d9(0x1d2)]),_0xfd7c43[_0x1221d9(0x1c5)]&&(_0x4b2613[_0x1221d9(0x1c5)]=_0xfd7c43[_0x1221d9(0x1c5)]),_0xfd7c43['orderBy']&&_0xfd7c43[_0x1221d9(0x22d)][_0x1221d9(0x198)]>0x0&&(_0x4b2613[_0x1221d9(0x1a3)]=_0xfd7c43[_0x1221d9(0x22d)]),Object[_0x1221d9(0x1ad)](_0x4b2613)[_0x1221d9(0x198)]>0x0&&(_0x2339af[_0x1221d9(0x1f2)]=_0x4b2613);}return _0x2339af;}export function segmentWithActivationsToYaml(_0x3ff4ab,_0xe8db5,_0x3edde6,_0x58b7a6,_0x52c224){const _0x1e1528=a132_0x1637e4,_0x345bf2=segmentResponseToDefSync(_0x3ff4ab,_0x3edde6);return _0xe8db5[_0x1e1528(0x198)]>0x0&&(_0x345bf2['activations']=_0xe8db5['map'](_0x9a92b0=>activationResponseToDef(_0x9a92b0,_0x58b7a6,_0x52c224))),_0x345bf2;}function normalizeColumn(_0x3fa66d){const _0x65c65a=a132_0x1637e4;if(typeof _0x3fa66d==='string')return{'name':_0x3fa66d};return{'name':_0x3fa66d[_0x65c65a(0x21c)],..._0x3fa66d[_0x65c65a(0x1cb)]&&{'type':_0x3fa66d['type']},..._0x3fa66d[_0x65c65a(0x237)]&&{'visibility':_0x3fa66d['visibility']}};}export async function activationDefToCreateRequest(_0x41bb8f,_0x10392b){const _0x1e7174=a132_0x1637e4,_0x3d8a12=_0x10392b?.[_0x1e7174(0x1e7)],_0xbd670a=_0x10392b?.[_0x1e7174(0x1dd)],_0x33afe8=_0x41bb8f[_0x1e7174(0x1fe)];let _0x24fb59;const _0x1eee48=parseInt(_0x33afe8,0xa);if(!isNaN(_0x1eee48)&&String(_0x1eee48)===_0x33afe8)_0x24fb59=_0x1eee48;else{const _0x22f3f7=_0xbd670a?.[_0x1e7174(0x234)](_0x33afe8);if(_0x22f3f7===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x1e7174(0x1db)+_0x33afe8,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x24fb59=_0x22f3f7;}const _0x4a556c={'name':_0x41bb8f[_0x1e7174(0x21c)],'connectionId':_0x24fb59};_0x41bb8f['description']&&(_0x4a556c[_0x1e7174(0x1b0)]=_0x41bb8f['description']);let _0x2949d0=[];_0x41bb8f['columns']&&_0x41bb8f[_0x1e7174(0x1c2)][_0x1e7174(0x198)]>0x0&&(_0x2949d0=_0x41bb8f[_0x1e7174(0x1c2)][_0x1e7174(0x1f4)](_0xf6a819=>_0xf6a819!=null)[_0x1e7174(0x1d7)](normalizeColumn));_0x2949d0[_0x1e7174(0x198)]>0x0&&(_0x4a556c[_0x1e7174(0x1c2)]=_0x2949d0);_0x41bb8f['all_columns']!==undefined&&(_0x41bb8f['all_columns']===![]&&_0x2949d0[_0x1e7174(0x198)]===0x0?_0x4a556c['allColumns']=!![]:_0x4a556c[_0x1e7174(0x221)]=_0x41bb8f[_0x1e7174(0x1bc)]);if(_0x41bb8f[_0x1e7174(0x231)]){const _0x503de7=_0x41bb8f['schedule'];_0x503de7['type']&&(_0x4a556c['scheduleType']=_0x503de7[_0x1e7174(0x1cb)]),_0x503de7[_0x1e7174(0x20a)]&&(_0x4a556c[_0x1e7174(0x225)]=_0x503de7['repeat_unit']),_0x503de7['repeat_frequency']!==undefined&&(_0x4a556c[_0x1e7174(0x1e6)]=_0x503de7[_0x1e7174(0x219)]),_0x503de7[_0x1e7174(0x1b1)]&&(_0x4a556c[_0x1e7174(0x1a4)]=_0x503de7[_0x1e7174(0x1b1)]),_0x503de7['start_at']!==undefined&&(_0x4a556c[_0x1e7174(0x1a2)]=_0x503de7['start_at']),_0x503de7[_0x1e7174(0x19b)]!==undefined&&(_0x4a556c[_0x1e7174(0x1a0)]=_0x503de7[_0x1e7174(0x19b)]),_0x503de7[_0x1e7174(0x220)]&&(_0x4a556c[_0x1e7174(0x220)]=_0x503de7[_0x1e7174(0x220)]);}_0x41bb8f[_0x1e7174(0x212)]&&(_0x41bb8f['notification'][_0x1e7174(0x1e4)]&&(_0x4a556c[_0x1e7174(0x197)]=_0x41bb8f[_0x1e7174(0x212)][_0x1e7174(0x1e4)]),_0x41bb8f[_0x1e7174(0x212)]['email_recipients']&&(_0x4a556c['emailRecipients']=_0x41bb8f[_0x1e7174(0x212)][_0x1e7174(0x1e3)][_0x1e7174(0x1d7)](_0x4fe108=>{const _0x121da0=_0x1e7174,_0x50b634=Number(_0x4fe108);if(!isNaN(_0x50b634)&&String(_0x50b634)===_0x4fe108)return _0x50b634;const _0x5ded55=_0x3d8a12?.['get'](_0x4fe108[_0x121da0(0x230)]());if(_0x5ded55===undefined)throw new SDKError(ErrorCode[_0x121da0(0x239)],_0x121da0(0x20c)+_0x4fe108+_0x121da0(0x201));return _0x5ded55;})));if(_0x41bb8f[_0x1e7174(0x226)]){const _0x534003=_0x10392b?.[_0x1e7174(0x218)]?.[_0x1e7174(0x234)](_0x33afe8);if(_0x534003&&_0x10392b?.[_0x1e7174(0x204)])try{const _0x4b60fc=await _0x10392b['getSchema'](_0x534003),_0x4eac43=validateConnectorConfig(_0x41bb8f[_0x1e7174(0x226)],_0x4b60fc);if(!_0x4eac43[_0x1e7174(0x235)])throw new SDKError(ErrorCode[_0x1e7174(0x222)],_0x1e7174(0x203)+_0x41bb8f[_0x1e7174(0x21c)]+'\x22:\x0a'+formatValidationErrors(_0x4eac43[_0x1e7174(0x1c7)]),undefined,{'helpText':_0x1e7174(0x1af)+_0x534003+_0x1e7174(0x1f5)+formatSchemaAsHelp(_0x4b60fc)});if(_0x4eac43[_0x1e7174(0x20d)][_0x1e7174(0x198)]>0x0){const _0x216e5d=formatValidationWarnings(_0x4eac43['warnings']);console[_0x1e7174(0x22c)](_0x1e7174(0x1b7)+_0x41bb8f[_0x1e7174(0x21c)]+_0x1e7174(0x1be)+_0x216e5d);}_0x4a556c[_0x1e7174(0x1bb)]=transformConfigToLegacy(_0x41bb8f[_0x1e7174(0x226)],_0x4b60fc);}catch(_0x5de355){if(_0x5de355 instanceof SDKError&&_0x5de355[_0x1e7174(0x19a)]===ErrorCode[_0x1e7174(0x1fb)])_0x4a556c['connectorConfig']=_0x41bb8f['connector_config'];else throw _0x5de355;}else _0x4a556c[_0x1e7174(0x1bb)]=_0x41bb8f[_0x1e7174(0x226)];}_0x41bb8f[_0x1e7174(0x229)]!==undefined&&(_0x4a556c[_0x1e7174(0x1ff)]=_0x41bb8f[_0x1e7174(0x229)]);if(_0x41bb8f[_0x1e7174(0x1f2)]){const _0x18a65c=_0x41bb8f['behavior'],_0x5a0a8b={};if(_0x18a65c[_0x1e7174(0x1c2)]&&_0x18a65c[_0x1e7174(0x1c2)]['length']>0x0){const _0x36def8=_0x18a65c['columns'][_0x1e7174(0x1f4)](_0x5c2213=>_0x5c2213&&_0x5c2213[_0x1e7174(0x21c)]);_0x36def8[_0x1e7174(0x198)]>0x0&&(_0x5a0a8b[_0x1e7174(0x1c2)]=_0x36def8);}_0x18a65c['behavior_table']&&(_0x5a0a8b['behaviorTableName']=_0x18a65c[_0x1e7174(0x202)]),_0x18a65c[_0x1e7174(0x215)]!==undefined&&(_0x5a0a8b['joinRow']=_0x18a65c[_0x1e7174(0x215)]),_0x18a65c[_0x1e7174(0x1ac)]&&(_0x5a0a8b[_0x1e7174(0x1d2)]=_0x18a65c['join_strategy']),_0x18a65c[_0x1e7174(0x1c5)]&&(_0x5a0a8b[_0x1e7174(0x1c5)]=_0x18a65c[_0x1e7174(0x1c5)]),_0x18a65c[_0x1e7174(0x1a3)]&&(_0x5a0a8b[_0x1e7174(0x22d)]=_0x18a65c[_0x1e7174(0x1a3)]),_0x4a556c['syndicationBehavior']=_0x5a0a8b;}return _0x4a556c;}export async function activationDefToUpdateRequest(_0x58465e,_0x20715c){return activationDefToCreateRequest(_0x58465e,_0x20715c);}export function deepSortObject(_0x232763){const _0x541d39=a132_0x1637e4;if(_0x232763===null||typeof _0x232763!==_0x541d39(0x210))return _0x232763;if(Array['isArray'](_0x232763))return _0x232763[_0x541d39(0x1d7)](deepSortObject)[_0x541d39(0x1fa)]((_0x44b22f,_0x1f15b3)=>JSON[_0x541d39(0x19f)](_0x44b22f)[_0x541d39(0x1c4)](JSON['stringify'](_0x1f15b3)));const _0x41b8ce={};for(const _0x436e64 of Object[_0x541d39(0x1ad)](_0x232763)['sort']()){_0x41b8ce[_0x436e64]=deepSortObject(_0x232763[_0x436e64]);}return _0x41b8ce;}export function serializeRule(_0x155511){const _0x45925c=a132_0x1637e4;return JSON[_0x45925c(0x19f)](deepSortObject(_0x155511));}export function normalizeRuleForMatching(_0x47bf0f){return normalizeConditionsForMatching(_0x47bf0f);}function normalizeConditionsForMatching(_0x1ebc87){const _0x137902=a132_0x1637e4;if(_0x1ebc87===null||typeof _0x1ebc87!==_0x137902(0x210))return _0x1ebc87;if(Array[_0x137902(0x1cd)](_0x1ebc87))return _0x1ebc87['map'](normalizeConditionsForMatching);const _0x43787d=_0x1ebc87;if((_0x43787d[_0x137902(0x1cb)]===_0x137902(0x206)||_0x43787d[_0x137902(0x1cb)]===_0x137902(0x1e1))&&typeof _0x43787d[_0x137902(0x1e2)]===_0x137902(0x22b))return{..._0x43787d,'segment':_0x137902(0x1b2)};const _0x37c9a2={};for(const _0x35832f of Object[_0x137902(0x1ad)](_0x43787d)){_0x37c9a2[_0x35832f]=normalizeConditionsForMatching(_0x43787d[_0x35832f]);}return _0x37c9a2;}export function serializeRuleForMatching(_0x40f589){const _0x27509f=a132_0x1637e4;return JSON[_0x27509f(0x19f)](deepSortObject(normalizeRuleForMatching(_0x40f589)));}export function expandSegmentReferences(_0x1ec584,_0x179324,_0x329ad3=new Set()){return expandConditions(_0x1ec584,_0x179324,_0x329ad3);}function expandConditions(_0x55ceef,_0x2e010e,_0x35c890){const _0x891619=a132_0x1637e4;if(_0x55ceef===null||typeof _0x55ceef!==_0x891619(0x210))return _0x55ceef;if(Array['isArray'](_0x55ceef))return _0x55ceef[_0x891619(0x1d7)](_0x251aa9=>expandConditions(_0x251aa9,_0x2e010e,_0x35c890));const _0x2c514c=_0x55ceef;if((_0x2c514c[_0x891619(0x1cb)]===_0x891619(0x206)||_0x2c514c[_0x891619(0x1cb)]===_0x891619(0x1e1))&&typeof _0x2c514c['segment']===_0x891619(0x22b)){const _0x125705=_0x2c514c[_0x891619(0x1e2)],_0x1e911e=_0x2e010e[_0x891619(0x234)](_0x125705);if(_0x1e911e&&!_0x35c890[_0x891619(0x217)](_0x125705)){const _0x5f5a0d=new Set(_0x35c890);_0x5f5a0d['add'](_0x125705);const _0x2bb34c=expandConditions(_0x1e911e,_0x2e010e,_0x5f5a0d);return{'type':_0x2c514c[_0x891619(0x1cb)],'expanded_rule':_0x2bb34c};}return{'type':_0x2c514c[_0x891619(0x1cb)],'expanded_rule':_0x891619(0x207)};}const _0x428935={};for(const _0x129043 of Object['keys'](_0x2c514c)){_0x428935[_0x129043]=expandConditions(_0x2c514c[_0x129043],_0x2e010e,_0x35c890);}return _0x428935;}export function serializeExpandedRule(_0x260080,_0x53e087){const _0x3e5eb0=a132_0x1637e4,_0x11e9e8=expandSegmentReferences(_0x260080,_0x53e087);return JSON[_0x3e5eb0(0x19f)](deepSortObject(_0x11e9e8));}export function createSegmentNameContext(_0x47da4e){const _0x97a1c5=a132_0x1637e4,_0x1ba263=new Set(),_0x2609fd=new Map(),_0x39810a=new Map();if(_0x47da4e)for(const [_0x14fceb,_0x2a1d73]of Object[_0x97a1c5(0x21d)](_0x47da4e)){if(_0x2a1d73['rule']){const _0x5ea02e=serializeRule(_0x2a1d73['rule']);_0x39810a[_0x97a1c5(0x1e9)](_0x5ea02e,_0x14fceb),_0x1ba263[_0x97a1c5(0x1f3)](_0x14fceb);}}return{'usedNames':_0x1ba263,'ruleHashToName':_0x2609fd,'localRuleToName':_0x47da4e?_0x39810a:undefined};}export function resolveSegmentName(_0x490dba,_0x1688e1,_0x56dc62,_0x4f3159){const _0x2dbaaf=a132_0x1637e4,_0x2fcae5=serializeRule(_0x1688e1);if(_0x56dc62[_0x2dbaaf(0x1ed)]){const _0x4aa665=_0x56dc62[_0x2dbaaf(0x1ed)][_0x2dbaaf(0x234)](_0x2fcae5);if(_0x4aa665)return{'name':_0x4aa665,'isDuplicate':![],'isLocalMatch':!![]};}const _0x5b145e=_0x56dc62[_0x2dbaaf(0x1f7)][_0x2dbaaf(0x234)](_0x2fcae5);if(_0x5b145e)return{'name':_0x5b145e,'isDuplicate':!![],'isLocalMatch':![]};const _0x144ec9=_0x4f3159(_0x490dba);let _0x2d91a7=_0x144ec9||_0x490dba,_0x1f804f=_0x2d91a7,_0x448260=0x2;while(_0x56dc62[_0x2dbaaf(0x1ec)][_0x2dbaaf(0x217)](_0x1f804f)){_0x1f804f=_0x2d91a7+'_'+_0x448260,_0x448260++;}return _0x56dc62['usedNames'][_0x2dbaaf(0x1f3)](_0x1f804f),_0x56dc62['ruleHashToName'][_0x2dbaaf(0x1e9)](_0x2fcae5,_0x1f804f),{'name':_0x1f804f,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x4ab57a){const _0x15299d=[],_0x1cbddf=_0x17f8b6=>{const _0x2fb352=a132_0x6fdb;if(!_0x17f8b6||typeof _0x17f8b6!==_0x2fb352(0x210))return;if(Array[_0x2fb352(0x1cd)](_0x17f8b6)){_0x17f8b6[_0x2fb352(0x223)](_0x1cbddf);return;}const _0x16135e=_0x17f8b6;(_0x16135e['type']===_0x2fb352(0x206)||_0x16135e['type']===_0x2fb352(0x1e1))&&typeof _0x16135e[_0x2fb352(0x1e2)]===_0x2fb352(0x22b)&&_0x15299d[_0x2fb352(0x1bf)](_0x16135e[_0x2fb352(0x1e2)]);for(const _0x130d5b of Object[_0x2fb352(0x1b4)](_0x16135e)){_0x1cbddf(_0x130d5b);}};return _0x1cbddf(_0x4ab57a),_0x15299d;}export function validateSegmentRule(_0x32af3a,_0x86dd0a){const _0x40469a=a132_0x1637e4;if(!_0x86dd0a||!_0x86dd0a[_0x40469a(0x1ea)])return;for(let _0x4710ac=0x0;_0x4710ac<_0x86dd0a[_0x40469a(0x1ea)][_0x40469a(0x198)];_0x4710ac++){const _0x33a8c8=_0x86dd0a[_0x40469a(0x1ea)][_0x4710ac];if(_0x40469a(0x1cb)in _0x33a8c8&&_0x33a8c8['type']===_0x40469a(0x1a7)){const _0x3bfaf7=_0x33a8c8,_0x243fa2=_0x3bfaf7[_0x40469a(0x22f)]||_0x3bfaf7[_0x40469a(0x1b3)];if((!_0x3bfaf7[_0x40469a(0x1ee)]||_0x3bfaf7['attribute']==='')&&!_0x243fa2)throw new SDKError(ErrorCode[_0x40469a(0x1d8)],_0x40469a(0x211)+_0x32af3a+'\x27:\x20'+('conditions['+_0x4710ac+_0x40469a(0x1cf))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|