@treasuredata/tdx 2026.3.23 → 2026.3.25
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.js +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(_0x8f5a05,_0x41ce62){const _0x3ab0c6=a125_0x2545,_0x4bcfa0=_0x8f5a05();while(!![]){try{const _0x962732=-parseInt(_0x3ab0c6(0x1a9))/0x1+parseInt(_0x3ab0c6(0x1ab))/0x2+-parseInt(_0x3ab0c6(0x1a7))/0x3+parseInt(_0x3ab0c6(0x19c))/0x4*(-parseInt(_0x3ab0c6(0x195))/0x5)+-parseInt(_0x3ab0c6(0x1a4))/0x6+-parseInt(_0x3ab0c6(0x1a2))/0x7*(-parseInt(_0x3ab0c6(0x196))/0x8)+parseInt(_0x3ab0c6(0x1ad))/0x9;if(_0x962732===_0x41ce62)break;else _0x4bcfa0['push'](_0x4bcfa0['shift']());}catch(_0x3567a5){_0x4bcfa0['push'](_0x4bcfa0['shift']());}}}(a125_0x2185,0x9ae02));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(_0x8b15c0){const _0x546715=a125_0x2545;if(MODEL_PRICING[_0x8b15c0])return MODEL_PRICING[_0x8b15c0];const _0x53a936=_0x8b15c0[_0x546715(0x199)]();if(_0x53a936[_0x546715(0x19e)](_0x546715(0x1a6)))return MODEL_PRICING[_0x546715(0x1a6)];if(_0x53a936[_0x546715(0x19e)](_0x546715(0x1ac)))return MODEL_PRICING['sonnet'];if(_0x53a936[_0x546715(0x19e)](_0x546715(0x19d)))return MODEL_PRICING[_0x546715(0x19d)];return MODEL_PRICING['sonnet'];}export function calculateTokenCost(_0x153481,_0x23a38a,_0xd97ad9,_0x321239,_0x24f353){const _0xe22332=a125_0x2545,_0x368b9c=0xf4240;return _0x153481*_0x24f353[_0xe22332(0x19a)]/_0x368b9c+_0x23a38a*_0x24f353['outputPricePerMTok']/_0x368b9c+_0xd97ad9*_0x24f353['cacheWritePricePerMTok']/_0x368b9c+_0x321239*_0x24f353['cacheReadPricePerMTok']/_0x368b9c;}export function usdToAiCredits(_0x1ab0da){return _0x1ab0da/USD_PER_AI_CREDIT;}export function calculateCreditsFromTokens(_0x3b408e,_0x1710f3,_0x26c632,_0x203e9b,_0x2b740b){const _0x1fc6d3=getModelPricing(_0x2b740b),_0x416bba=calculateTokenCost(_0x3b408e,_0x1710f3,_0x26c632,_0x203e9b,_0x1fc6d3);return usdToAiCredits(_0x416bba);}export function getContextLimit(_0x525c2e){const _0x21bbb8=a125_0x2545;if(CONTEXT_LIMITS[_0x525c2e])return CONTEXT_LIMITS[_0x525c2e];const _0x29f6a3=_0x525c2e[_0x21bbb8(0x199)]();if(_0x29f6a3[_0x21bbb8(0x19e)](_0x21bbb8(0x1a6)))return CONTEXT_LIMITS[_0x21bbb8(0x1a6)];if(_0x29f6a3[_0x21bbb8(0x19e)](_0x21bbb8(0x1ac)))return CONTEXT_LIMITS[_0x21bbb8(0x1ac)];if(_0x29f6a3[_0x21bbb8(0x19e)](_0x21bbb8(0x19d)))return CONTEXT_LIMITS[_0x21bbb8(0x19d)];return CONTEXT_LIMITS[_0x21bbb8(0x19f)];}export function getModelDisplayName(_0x292058){const _0x511276=a125_0x2545,_0xd42aa0=_0x292058[_0x511276(0x199)]();if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x1ac))){if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x198))||_0xd42aa0[_0x511276(0x19e)]('4.5'))return _0x511276(0x1a5);return'Sonnet\x204';}if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x19d))){if(_0xd42aa0['includes'](_0x511276(0x198))||_0xd42aa0[_0x511276(0x19e)](_0x511276(0x1a8)))return _0x511276(0x19b);return'Haiku\x204';}if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x1a6))){if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x1aa))||_0xd42aa0[_0x511276(0x19e)](_0x511276(0x197)))return _0x511276(0x1a0);if(_0xd42aa0[_0x511276(0x19e)](_0x511276(0x198))||_0xd42aa0[_0x511276(0x19e)](_0x511276(0x1a8)))return _0x511276(0x1a3);return'Opus\x204';}return _0x511276(0x1a1);}export function formatTokenCount(_0xfd17){return _0xfd17['toLocaleString']('en-US');}function a125_0x2545(_0x10264f,_0x2f097c){_0x10264f=_0x10264f-0x195;const _0x2185ac=a125_0x2185();let _0x2545bd=_0x2185ac[_0x10264f];return _0x2545bd;}function a125_0x2185(){const _0x1181e9=['5407590agNOkJ','Sonnet\x204.5','opus','717612QSoqMr','4.5','83770XmrtcA','4-6','1665472WUwpaN','sonnet','8760276Ttsvgw','1865225NzGeuB','16XvzAGe','4.6','4-5','toLowerCase','inputPricePerMTok','Haiku\x204.5','4ssjEFh','haiku','includes','default','Opus\x204.6','Claude','1489439lhazxS','Opus\x204.5'];a125_0x2185=function(){return _0x1181e9;};return a125_0x2185();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x1df074=a126_0x44e5;function a126_0x33a6(){const _0x4147da=['1105861JyKyqk','/realtime_personalization_services','cdp','update','site','accessToken','/realtime_personalization_services/','109985JbinUX','3367026PZAjlO','request','1692jgoXbH','apiKey','proxy','get','application/json','187992aGjjTV','4597076ZKbSwW','list','create','data','39144mcPKzM','PUT','33403070OqWnbZ','/audiences/','httpClient','isArray','2YXOHoE','30MWYXra','GET','POST'];a126_0x33a6=function(){return _0x4147da;};return a126_0x33a6();}(function(_0x3583b8,_0xf02074){const _0x2b3608=a126_0x44e5,_0x302d73=_0x3583b8();while(!![]){try{const _0x3d8493=-parseInt(_0x2b3608(0x202))/0x1*(parseInt(_0x2b3608(0x1fe))/0x2)+-parseInt(_0x2b3608(0x1ec))/0x3+-parseInt(_0x2b3608(0x1f4))/0x4+-parseInt(_0x2b3608(0x209))/0x5+-parseInt(_0x2b3608(0x1ff))/0x6*(-parseInt(_0x2b3608(0x1f3))/0x7)+parseInt(_0x2b3608(0x1f8))/0x8*(parseInt(_0x2b3608(0x1ee))/0x9)+parseInt(_0x2b3608(0x1fa))/0xa;if(_0x3d8493===_0xf02074)break;else _0x302d73['push'](_0x302d73['shift']());}catch(_0xd58b7f){_0x302d73['push'](_0x302d73['shift']());}}}(a126_0x33a6,0xf2eba));import{HTTPClient}from'./client/http-client.js';function a126_0x44e5(_0x2b2074,_0x28d0dc){_0x2b2074=_0x2b2074-0x1ec;const _0x33a6fa=a126_0x33a6();let _0x44e5fd=_0x33a6fa[_0x2b2074];return _0x44e5fd;}import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class PersonalizationSDK{[a126_0x1df074(0x1fc)];constructor(_0x56756e){const _0x194adc=a126_0x1df074,_0x35ec95=getEndpoint(_0x56756e[_0x194adc(0x206)],_0x194adc(0x204)),_0x4a9a7f=toHeaderRecord(getAuthHeaders(_0x56756e[_0x194adc(0x206)],_0x56756e[_0x194adc(0x1ef)],_0x56756e[_0x194adc(0x207)]));this[_0x194adc(0x1fc)]=new HTTPClient(_0x35ec95,{..._0x4a9a7f,'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x194adc(0x1f2)},{'proxy':_0x56756e[_0x194adc(0x1f0)]});}async[a126_0x1df074(0x1f5)](_0x2d9f82){const _0x2d812c=a126_0x1df074,_0x337872=await this[_0x2d812c(0x1fc)][_0x2d812c(0x1ed)]('GET','/audiences/'+_0x2d9f82+'/realtime_personalization_services?page[size]=100');return Array[_0x2d812c(0x1fd)](_0x337872)?_0x337872:_0x337872[_0x2d812c(0x1f7)]||[];}async[a126_0x1df074(0x1f1)](_0x29582b,_0x2e62e6){const _0xb9adf7=a126_0x1df074,_0x5e0a9f=await this[_0xb9adf7(0x1fc)][_0xb9adf7(0x1ed)](_0xb9adf7(0x200),_0xb9adf7(0x1fb)+_0x29582b+'/realtime_personalization_services/'+_0x2e62e6);return _0x5e0a9f||{};}async[a126_0x1df074(0x1f6)](_0x4d036d,_0x1882c0){const _0x3caf94=a126_0x1df074,_0x360060=await this['httpClient']['request'](_0x3caf94(0x201),_0x3caf94(0x1fb)+_0x4d036d+_0x3caf94(0x203),{'body':_0x1882c0});return _0x360060||{};}async[a126_0x1df074(0x205)](_0x230baa,_0x5997da,_0x59af91){const _0x3c5a89=a126_0x1df074,_0x31f1b9=await this[_0x3c5a89(0x1fc)][_0x3c5a89(0x1ed)](_0x3c5a89(0x1f9),'/audiences/'+_0x230baa+_0x3c5a89(0x208)+_0x5997da,{'body':_0x59af91});return _0x31f1b9||{};}async['delete'](_0x2b4ab5,_0x473f85){const _0x56cdb3=a126_0x1df074;await this[_0x56cdb3(0x1fc)][_0x56cdb3(0x1ed)]('DELETE',_0x56cdb3(0x1fb)+_0x2b4ab5+_0x56cdb3(0x208)+_0x473f85);}}
|
package/dist/sdk/policy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x2a1f35=a127_0x1796;(function(_0x9304a4,_0x474a49){const _0x5f1757=a127_0x1796,_0x4bc6c0=_0x9304a4();while(!![]){try{const _0x46461d=-parseInt(_0x5f1757(0x182))/0x1*(-parseInt(_0x5f1757(0x17b))/0x2)+-parseInt(_0x5f1757(0x174))/0x3+parseInt(_0x5f1757(0x177))/0x4*(parseInt(_0x5f1757(0x170))/0x5)+-parseInt(_0x5f1757(0x173))/0x6+parseInt(_0x5f1757(0x16d))/0x7*(-parseInt(_0x5f1757(0x184))/0x8)+parseInt(_0x5f1757(0x178))/0x9+parseInt(_0x5f1757(0x168))/0xa;if(_0x46461d===_0x474a49)break;else _0x4bc6c0['push'](_0x4bc6c0['shift']());}catch(_0x1fc0d1){_0x4bc6c0['push'](_0x4bc6c0['shift']());}}}(a127_0x23db,0x6a7d7));import{HTTPClient}from'./client/http-client.js';function a127_0x1796(_0x507f87,_0x2df153){_0x507f87=_0x507f87-0x167;const _0x23dba3=a127_0x23db();let _0x17969f=_0x23dba3[_0x507f87];return _0x17969f;}import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';import{UserSDK}from'./user.js';function a127_0x23db(){const _0x30b6a4=['8NuIUMt','toLowerCase','accessToken','2780730HczlrR','GET','request','httpClient','site','3919601EyiAbm','getCurrent','getPolicy','5sZafUE','/policies','getPolicyUsers','1551918BbmBmC','636690BFSsmN','proxy','Policy\x20not\x20found:\x20','865284oIUzki','6326811hunfpE','find','getPolicyPermissions','134818TmHxrv','name','/v3/access_control/policies/','userSDK','apiKey','listPolicies','NOT_FOUND','4cLjQff','/v3/access_control/policies'];a127_0x23db=function(){return _0x30b6a4;};return a127_0x23db();}import{SDKError,ErrorCode}from'./errors.js';export class PolicySDK{[a127_0x2a1f35(0x16b)];['userSDK'];constructor(_0x4c5619){const _0x3fad0c=a127_0x2a1f35,_0x3aed58=getEndpoint(_0x4c5619['site'],'td'),_0x399a0d=toHeaderRecord(getAuthHeaders(_0x4c5619[_0x3fad0c(0x16c)],_0x4c5619[_0x3fad0c(0x17f)],_0x4c5619[_0x3fad0c(0x167)]));this[_0x3fad0c(0x16b)]=new HTTPClient(_0x3aed58,_0x399a0d,{'proxy':_0x4c5619[_0x3fad0c(0x175)]}),this[_0x3fad0c(0x17e)]=new UserSDK(_0x4c5619);}async['getMyPermissions'](){const _0x8e902f=a127_0x2a1f35,_0x205a6d=await this[_0x8e902f(0x17e)][_0x8e902f(0x16e)]();return await this[_0x8e902f(0x16b)]['request']('GET','/v3/access_control/users/'+_0x205a6d['id']);}async['getUserPolicies'](_0x1be891){const _0x3ddf48=a127_0x2a1f35;return await this[_0x3ddf48(0x16b)][_0x3ddf48(0x16a)](_0x3ddf48(0x169),'/v3/access_control/users/'+encodeURIComponent(_0x1be891)+_0x3ddf48(0x171));}async[a127_0x2a1f35(0x180)](){const _0x13f9d4=a127_0x2a1f35;return await this['httpClient'][_0x13f9d4(0x16a)](_0x13f9d4(0x169),_0x13f9d4(0x183));}async[a127_0x2a1f35(0x16f)](_0x6b36ef){const _0x34606a=a127_0x2a1f35,_0x25017a=await this[_0x34606a(0x180)](),_0x2a638a=parseInt(_0x6b36ef,0xa),_0x1ae001=!isNaN(_0x2a638a)?_0x25017a['find'](_0x155485=>_0x155485['id']===_0x2a638a):_0x25017a[_0x34606a(0x179)](_0x280710=>_0x280710[_0x34606a(0x17c)][_0x34606a(0x185)]()===_0x6b36ef[_0x34606a(0x185)]());if(!_0x1ae001)throw new SDKError(ErrorCode[_0x34606a(0x181)],_0x34606a(0x176)+_0x6b36ef);return _0x1ae001;}async[a127_0x2a1f35(0x17a)](_0x3ed7c1){const _0x2e6806=a127_0x2a1f35,_0x455c24=await this['httpClient']['request'](_0x2e6806(0x169),_0x2e6806(0x17d)+encodeURIComponent(_0x3ed7c1)+'/permissions');return{'policy_id':_0x3ed7c1,'permissions':_0x455c24};}async[a127_0x2a1f35(0x172)](_0x2fef91){const _0x5e16f0=a127_0x2a1f35;return await this[_0x5e16f0(0x16b)][_0x5e16f0(0x16a)](_0x5e16f0(0x169),_0x5e16f0(0x17d)+encodeURIComponent(_0x2fef91)+'/users');}}
|
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x3b00a2=a128_0x5c95;(function(_0x30db8a,_0x310acc){const _0x4dfab2=a128_0x5c95,_0x52f474=_0x30db8a();while(!![]){try{const _0x585543=-parseInt(_0x4dfab2(0x125))/0x1*(-parseInt(_0x4dfab2(0x10a))/0x2)+parseInt(_0x4dfab2(0xfd))/0x3*(-parseInt(_0x4dfab2(0xfa))/0x4)+-parseInt(_0x4dfab2(0x115))/0x5*(-parseInt(_0x4dfab2(0x122))/0x6)+-parseInt(_0x4dfab2(0x10d))/0x7*(parseInt(_0x4dfab2(0x10e))/0x8)+-parseInt(_0x4dfab2(0xfc))/0x9*(parseInt(_0x4dfab2(0x124))/0xa)+parseInt(_0x4dfab2(0xf7))/0xb+parseInt(_0x4dfab2(0x111))/0xc;if(_0x585543===_0x310acc)break;else _0x52f474['push'](_0x52f474['shift']());}catch(_0x30d3b6){_0x52f474['push'](_0x52f474['shift']());}}}(a128_0x21ed,0x59b77));import{TrinoApiClient}from'../client/trino-api-client.js';import{escapeStringLiteral,buildLikePattern}from'../../utils/string-utils.js';function a128_0x5c95(_0x293be9,_0x1fe97c){_0x293be9=_0x293be9-0xf6;const _0x21ed8e=a128_0x21ed();let _0x5c958c=_0x21ed8e[_0x293be9];return _0x5c958c;}import{SDKError,ErrorCode}from'../errors.js';function a128_0x21ed(){const _0x48280a=['\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','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','\x0a\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20show\x20<database.table>','\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','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','SQL\x20query\x20is\x20required','\x20ESCAPE\x20\x27\x5c\x27','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','Usage:\x20tdx\x20describe\x20<database.table>','6kuFbeH','executeQuery','51050KZtRPS','425175NtQSdy','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','isInteger','slice','Limit\x20must\x20be\x20a\x20positive\x20integer','Limit\x20must\x20be\x20a\x20positive\x20number','1145012KRGmJy','\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','validateTable','76204TvvuPp','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.','603NTGWhy','39AZbAGS','data','Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','MISSING_ARGUMENT','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','showTable','\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20','\x0a\x20\x20\x20\x20','length','validateDatabase','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','trim','2jkIKqC','trinoApiClient','describeTable','3339cIbjJO','296qViILG','INVALID_ARGUMENT','\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','3272040vXMupf','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','Table\x20name\x20is\x20required','Database\x20name\x20is\x20required','864445AemSkf'];a128_0x21ed=function(){return _0x48280a;};return a128_0x21ed();}import{DEFAULT_LISTING_LIMIT}from'../../core/constants.js';export class QuerySDK{['trinoApiClient'];constructor(_0xf89457){const _0x4f0b78=a128_0x5c95;this[_0x4f0b78(0x10b)]=new TrinoApiClient(_0xf89457);}async['execute'](_0x32d07e,_0x41daea){const _0x2fd18a=a128_0x5c95;if(!_0x32d07e||_0x32d07e[_0x2fd18a(0x109)]()[_0x2fd18a(0x106)]===0x0)throw new SDKError(ErrorCode[_0x2fd18a(0x101)],_0x2fd18a(0x11c),undefined,{'helpText':'Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.'});return await this[_0x2fd18a(0x10b)][_0x2fd18a(0x123)](_0x32d07e,_0x41daea);}async['listDatabases'](_0x2000de,_0x79d5f3=DEFAULT_LISTING_LIMIT){const _0x165a5b=a128_0x5c95;if(_0x2000de!==undefined&&_0x2000de['trim']()[_0x165a5b(0x106)]===0x0)throw new SDKError(ErrorCode[_0x165a5b(0x10f)],'Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x165a5b(0x11e)});if(_0x79d5f3<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x165a5b(0xf6),undefined,{'helpText':_0x165a5b(0xff)});let _0x11cb32=_0x165a5b(0x11a);_0x2000de&&(_0x11cb32+='\x0a\x20\x20AND\x20schema_name\x20LIKE\x20'+buildLikePattern(_0x2000de)+_0x165a5b(0x11d));_0x11cb32+=_0x165a5b(0x11b)+_0x79d5f3;const _0x136069=await this['trinoApiClient'][_0x165a5b(0x123)](_0x11cb32[_0x165a5b(0x109)]());return _0x136069['data'];}async['listTables'](_0x27849e,_0x42cb65,_0xd6770a,_0x128b3f=DEFAULT_LISTING_LIMIT){const _0x5b706c=a128_0x5c95;if(_0x27849e!==undefined&&_0x27849e[_0x5b706c(0x109)]()[_0x5b706c(0x106)]===0x0)throw new SDKError(ErrorCode[_0x5b706c(0x10f)],'Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':'Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.'});if(_0x42cb65!==undefined&&_0x42cb65[_0x5b706c(0x109)]()[_0x5b706c(0x106)]===0x0)throw new SDKError(ErrorCode[_0x5b706c(0x10f)],_0x5b706c(0x108),undefined,{'helpText':_0x5b706c(0x120)});if(_0xd6770a!==undefined&&_0xd6770a[_0x5b706c(0x109)]()[_0x5b706c(0x106)]===0x0)throw new SDKError(ErrorCode[_0x5b706c(0x10f)],_0x5b706c(0x126),undefined,{'helpText':_0x5b706c(0xfb)});if(_0x128b3f<=0x0)throw new SDKError(ErrorCode[_0x5b706c(0x10f)],_0x5b706c(0xf6),undefined,{'helpText':_0x5b706c(0xff)});let _0x9f3a5e;_0x27849e?(_0x9f3a5e=_0x5b706c(0xf8)+escapeStringLiteral(_0x27849e)+_0x5b706c(0x118),_0x42cb65&&(_0x9f3a5e+='\x0a\x20\x20AND\x20table_name\x20LIKE\x20'+buildLikePattern(_0x42cb65)+_0x5b706c(0x11d)),_0x9f3a5e+=_0x5b706c(0x11f)+_0x128b3f):(_0x9f3a5e='\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',_0xd6770a&&(_0x9f3a5e+='\x0a\x20\x20AND\x20table_schema\x20LIKE\x20'+buildLikePattern(_0xd6770a)+'\x20ESCAPE\x20\x27\x5c\x27'),_0x42cb65&&(_0x9f3a5e+=_0x5b706c(0x112)+buildLikePattern(_0x42cb65)+_0x5b706c(0x11d)),_0x9f3a5e+=_0x5b706c(0x104)+_0x128b3f);const _0x136bb3=await this[_0x5b706c(0x10b)][_0x5b706c(0x123)](_0x9f3a5e[_0x5b706c(0x109)]());return _0x136bb3[_0x5b706c(0xfe)];}async[a128_0x3b00a2(0x107)](_0x3ab551){const _0x34127b=a128_0x3b00a2,_0x23b298=('\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'+escapeStringLiteral(_0x3ab551)+_0x34127b(0x105))[_0x34127b(0x109)](),_0x21b8fe=await this[_0x34127b(0x10b)]['executeQuery'](_0x23b298);return _0x21b8fe[_0x34127b(0xfe)][_0x34127b(0x106)]>0x0;}async[a128_0x3b00a2(0xf9)](_0x292718,_0x888ae7){const _0x5a626a=a128_0x3b00a2,_0xe4a2bc=(_0x5a626a(0x110)+escapeStringLiteral(_0x292718)+_0x5a626a(0x102)+escapeStringLiteral(_0x888ae7)+_0x5a626a(0x105))['trim'](),_0x290f1b=await this[_0x5a626a(0x10b)]['executeQuery'](_0xe4a2bc);return _0x290f1b['data']['length']>0x0;}async[a128_0x3b00a2(0x10c)](_0x1bd28f,_0x1147fe){const _0x2b2e66=a128_0x3b00a2;if(!_0x1bd28f||_0x1bd28f['trim']()[_0x2b2e66(0x106)]===0x0)throw new SDKError(ErrorCode[_0x2b2e66(0x101)],_0x2b2e66(0x114),undefined,{'helpText':_0x2b2e66(0x121)});if(!_0x1147fe||_0x1147fe['trim']()['length']===0x0)throw new SDKError(ErrorCode[_0x2b2e66(0x101)],_0x2b2e66(0x113),undefined,{'helpText':_0x2b2e66(0x121)});const _0x51da7b=(_0x2b2e66(0x116)+escapeStringLiteral(_0x1bd28f)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20'+escapeStringLiteral(_0x1147fe)+_0x2b2e66(0x100))[_0x2b2e66(0x109)](),_0xa9fef2=await this['trinoApiClient'][_0x2b2e66(0x123)](_0x51da7b);return _0xa9fef2['data'];}async[a128_0x3b00a2(0x103)](_0x5daae4,_0x47a7fc,_0x19189c=0x28,_0x298a9b){const _0x53fa19=a128_0x3b00a2;if(!_0x5daae4||_0x5daae4[_0x53fa19(0x109)]()[_0x53fa19(0x106)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'Database\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20show\x20<database.table>'});if(!_0x47a7fc||_0x47a7fc[_0x53fa19(0x109)]()[_0x53fa19(0x106)]===0x0)throw new SDKError(ErrorCode[_0x53fa19(0x101)],_0x53fa19(0x113),undefined,{'helpText':_0x53fa19(0x119)});if(!Number[_0x53fa19(0x127)](_0x19189c)||_0x19189c<=0x0)throw new SDKError(ErrorCode[_0x53fa19(0x10f)],_0x53fa19(0x129),undefined,{'helpText':_0x53fa19(0x117)});const _0x217ad4=escapeStringLiteral(_0x5daae4)[_0x53fa19(0x128)](0x1,-0x1)+'.'+escapeStringLiteral(_0x47a7fc)[_0x53fa19(0x128)](0x1,-0x1),_0x2c128b='SELECT\x20*\x20FROM\x20'+_0x217ad4+'\x20LIMIT\x20'+_0x19189c,_0x12c420=await this[_0x53fa19(0x10b)][_0x53fa19(0x123)](_0x2c128b,{'catalog':_0x298a9b,'schema':_0x5daae4});return _0x12c420;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x19d049,_0x542227){const _0x5f4621=a129_0x5db0,_0x1079cd=_0x19d049();while(!![]){try{const _0x5d641c=parseInt(_0x5f4621(0x142))/0x1*(parseInt(_0x5f4621(0x13d))/0x2)+parseInt(_0x5f4621(0x13c))/0x3*(parseInt(_0x5f4621(0x14c))/0x4)+-parseInt(_0x5f4621(0x140))/0x5*(parseInt(_0x5f4621(0x13e))/0x6)+parseInt(_0x5f4621(0x135))/0x7+parseInt(_0x5f4621(0x151))/0x8*(-parseInt(_0x5f4621(0x14b))/0x9)+parseInt(_0x5f4621(0x141))/0xa*(-parseInt(_0x5f4621(0x149))/0xb)+parseInt(_0x5f4621(0x14f))/0xc*(parseInt(_0x5f4621(0x13a))/0xd);if(_0x5d641c===_0x542227)break;else _0x1079cd['push'](_0x1079cd['shift']());}catch(_0x4f264c){_0x1079cd['push'](_0x1079cd['shift']());}}}(a129_0x5197,0xb4f05));import{createInterface}from'readline';import{readFileContent}from'../../utils/file-reader.js';function a129_0x5197(){const _0x128861=['close','message','1097965yGmZtv','error','27PPGnHB','4skQTog','Error\x20reading\x20from\x20stdin:\x20','trim','3636kjhiuv','isTTY','2224216HIreqj','replace','push','stdin\x20','toLowerCase','5569151eBIGUC','File\x20\x27','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','map','filter','37258PLXGpa','Content\x20contains\x20no\x20SQL\x20statements','807189FzqYgq','2zSbWNL','330198NNaund','stdin','95eGSgbQ','60CWHsqy','1286669UbFQxX','join','line','length','test'];a129_0x5197=function(){return _0x128861;};return a129_0x5197();}export function stripSqlComments(_0x23d22d){const _0x3cac15=a129_0x5db0;let _0x353161=_0x23d22d[_0x3cac15(0x131)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x353161=_0x353161[_0x3cac15(0x131)](/--.*$/gm,''),_0x353161[_0x3cac15(0x14e)]();}function a129_0x5db0(_0x9572b8,_0x1e3548){_0x9572b8=_0x9572b8-0x131;const _0x5197eb=a129_0x5197();let _0x5db0a4=_0x5197eb[_0x9572b8];return _0x5db0a4;}function isEscaped(_0xad9974,_0x1e1450){let _0x45a7b3=0x0;for(let _0x2aeae9=_0x1e1450-0x1;_0x2aeae9>=0x0&&_0xad9974[_0x2aeae9]==='\x5c';_0x2aeae9--){_0x45a7b3++;}return _0x45a7b3%0x2===0x1;}export function splitSqlStatements(_0x199c28){const _0x13a692=a129_0x5db0,_0x39655a=stripSqlComments(_0x199c28);if(!_0x39655a)throw new Error(_0x13a692(0x13b));const _0x498bd1=[];let _0xdbc95d='',_0x5e19f9=![],_0x1d63a6=![],_0x3fbbd6=![];for(let _0x41690f=0x0;_0x41690f<_0x199c28[_0x13a692(0x145)];_0x41690f++){const _0x4c1ed4=_0x199c28[_0x41690f];if(_0x4c1ed4==='\x27'&&!isEscaped(_0x199c28,_0x41690f)&&!_0x1d63a6&&!_0x3fbbd6)_0x5e19f9=!_0x5e19f9;else{if(_0x4c1ed4==='\x22'&&!isEscaped(_0x199c28,_0x41690f)&&!_0x5e19f9&&!_0x3fbbd6)_0x1d63a6=!_0x1d63a6;else _0x4c1ed4==='`'&&!isEscaped(_0x199c28,_0x41690f)&&!_0x5e19f9&&!_0x1d63a6&&(_0x3fbbd6=!_0x3fbbd6);}if(_0x4c1ed4===';'&&!_0x5e19f9&&!_0x1d63a6&&!_0x3fbbd6){const _0x160053=_0xdbc95d[_0x13a692(0x14e)]();_0x160053&&_0x498bd1['push'](_0x160053),_0xdbc95d='';}else _0xdbc95d+=_0x4c1ed4;}const _0x101c2f=_0xdbc95d[_0x13a692(0x14e)]();_0x101c2f&&_0x498bd1[_0x13a692(0x132)](_0x101c2f);const _0x442097=_0x498bd1[_0x13a692(0x138)](_0x158c59=>_0x158c59[_0x13a692(0x14e)]())[_0x13a692(0x139)](_0x5589d5=>{const _0x52eaa2=stripSqlComments(_0x5589d5);return _0x52eaa2['length']>0x0;});if(_0x442097[_0x13a692(0x145)]===0x0)throw new Error(_0x13a692(0x13b));return _0x442097;}export function readSqlStatementsFromFile(_0x2dfbfc){const _0x3a74e9=a129_0x5db0,_0x3f267a=readFileContent(_0x2dfbfc);try{return splitSqlStatements(_0x3f267a);}catch(_0x51f345){throw new Error(_0x3a74e9(0x136)+_0x2dfbfc+'\x27\x20'+_0x51f345[_0x3a74e9(0x148)][_0x3a74e9(0x134)]());}}export async function readStdinContent(){const _0x3f2856=a129_0x5db0;if(process[_0x3f2856(0x13f)][_0x3f2856(0x150)])throw new Error(_0x3f2856(0x137));return new Promise((_0x21e990,_0x432450)=>{const _0x19c785=_0x3f2856,_0x28b908=[],_0x5c4dd4=createInterface({'input':process['stdin'],'terminal':![]});_0x5c4dd4['on'](_0x19c785(0x144),_0x47a15d=>{const _0x1b5423=_0x19c785;_0x28b908[_0x1b5423(0x132)](_0x47a15d);}),_0x5c4dd4['on'](_0x19c785(0x147),()=>{const _0x117222=_0x19c785;_0x21e990(_0x28b908[_0x117222(0x143)]('\x0a'));}),_0x5c4dd4['on'](_0x19c785(0x14a),_0x2275ef=>{const _0x199ba8=_0x19c785;_0x5c4dd4[_0x199ba8(0x147)](),_0x432450(new Error(_0x199ba8(0x14d)+_0x2275ef[_0x199ba8(0x148)]));});});}export async function readSqlStatementsFromStdin(){const _0x387c8f=a129_0x5db0,_0x4e0db7=await readStdinContent();try{return splitSqlStatements(_0x4e0db7);}catch(_0x242b45){throw new Error(_0x387c8f(0x133)+_0x242b45[_0x387c8f(0x148)][_0x387c8f(0x134)]());}}export function isSqlFilePath(_0x329b1d){const _0x5815ff=a129_0x5db0;return/\w\.sql$/[_0x5815ff(0x146)](_0x329b1d);}
|
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x2ab989=a130_0x5117;(function(_0xa2f91a,_0x3489d5){const _0x30c438=a130_0x5117,_0x5e8548=_0xa2f91a();while(!![]){try{const _0x2795a2=parseInt(_0x30c438(0x1a3))/0x1+-parseInt(_0x30c438(0x19b))/0x2*(parseInt(_0x30c438(0x18c))/0x3)+parseInt(_0x30c438(0x195))/0x4*(parseInt(_0x30c438(0x19f))/0x5)+parseInt(_0x30c438(0x192))/0x6*(-parseInt(_0x30c438(0x196))/0x7)+-parseInt(_0x30c438(0x18a))/0x8*(-parseInt(_0x30c438(0x19c))/0x9)+parseInt(_0x30c438(0x1a0))/0xa+-parseInt(_0x30c438(0x1a1))/0xb;if(_0x2795a2===_0x3489d5)break;else _0x5e8548['push'](_0x5e8548['shift']());}catch(_0x2837fb){_0x5e8548['push'](_0x5e8548['shift']());}}}(a130_0x5df1,0x67d90));import{HTTPClient}from'./client/http-client.js';import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';function a130_0x5df1(){const _0x4afc44=['scheduleType','name','disabled','264ffdPVZ','/realtime_setting','3aJGPkf','site','/audiences/','request','attributes','list','90MWNSnf','application/json','length','96DQqjth','62405lFJpWK','getStatus','cdp','keys','httpClient','908738nZcyMW','52812vViCJV','cdpClient','accessToken','176865KNCzma','787660LEBXuZ','8920802UwZqNW','getParentSegment','703074kzFLVe','GET','listParentSegments','getConfig','proxy','isEnabled'];a130_0x5df1=function(){return _0x4afc44;};return a130_0x5df1();}function a130_0x5117(_0x1aed49,_0x1a2bdb){_0x1aed49=_0x1aed49-0x187;const _0x5df14c=a130_0x5df1();let _0x511740=_0x5df14c[_0x1aed49];return _0x511740;}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class RealtimeSDK{['httpClient'];[a130_0x2ab989(0x19d)];constructor(_0x2737ee){const _0x2ddf81=a130_0x2ab989,_0x145708=getEndpoint(_0x2737ee[_0x2ddf81(0x18d)],_0x2ddf81(0x198)),_0x39cc62=toHeaderRecord(getAuthHeaders(_0x2737ee[_0x2ddf81(0x18d)],_0x2737ee['apiKey'],_0x2737ee[_0x2ddf81(0x19e)]));this['httpClient']=new HTTPClient(_0x145708,{..._0x39cc62,'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x2ddf81(0x193)},{'proxy':_0x2737ee[_0x2ddf81(0x1a7)]}),this[_0x2ddf81(0x19d)]=new CDPApiClient(_0x2737ee);}async[a130_0x2ab989(0x1a8)](_0x43a7b5){const _0x19f62a=a130_0x2ab989;try{const _0x2e92c0=await this[_0x19f62a(0x19a)][_0x19f62a(0x18f)](_0x19f62a(0x1a4),_0x19f62a(0x18e)+_0x43a7b5+'/realtime_setting');return _0x2e92c0!==null;}catch{return![];}}async[a130_0x2ab989(0x197)](_0x290233){const _0x36328f=a130_0x2ab989,_0x3b68bc=await this[_0x36328f(0x19d)][_0x36328f(0x1a2)](_0x290233);let _0xb33884=![],_0x5bd02d=![];try{const _0x3a6013=await this[_0x36328f(0x19a)][_0x36328f(0x18f)](_0x36328f(0x1a4),_0x36328f(0x18e)+_0x290233+_0x36328f(0x18b));_0xb33884=!![],_0x5bd02d=!!(_0x3a6013&&typeof _0x3a6013==='object'&&Object[_0x36328f(0x199)](_0x3a6013)[_0x36328f(0x194)]>0x0);}catch{_0xb33884=![],_0x5bd02d=![];}return{'parent_segment_id':_0x290233,'parent_segment_name':_0x3b68bc[_0x36328f(0x190)][_0x36328f(0x188)],'realtime_enabled':_0xb33884,'realtime_config_exists':_0x5bd02d,'status':_0xb33884?'enabled':_0x36328f(0x189)};}async[a130_0x2ab989(0x1a6)](_0x569765){const _0x5bebda=a130_0x2ab989,_0xb40c1b=await this['httpClient'][_0x5bebda(0x18f)](_0x5bebda(0x1a4),_0x5bebda(0x18e)+_0x569765+_0x5bebda(0x18b));return _0xb40c1b||{};}async['updateConfig'](_0xa6e90a,_0x36742c){const _0x3420fc=a130_0x2ab989,_0x11ba23=await this[_0x3420fc(0x19a)][_0x3420fc(0x18f)]('PUT',_0x3420fc(0x18e)+_0xa6e90a+_0x3420fc(0x18b),{'body':_0x36742c});return _0x11ba23||{};}async[a130_0x2ab989(0x191)](){const _0x225f2f=a130_0x2ab989,_0x28712f=await this[_0x225f2f(0x19d)][_0x225f2f(0x1a5)](),_0xb57807=await Promise['all'](_0x28712f['map'](async _0x1b04ad=>{const _0x569a57=_0x225f2f,_0x446455=await this[_0x569a57(0x1a8)](_0x1b04ad['id']);return{'id':_0x1b04ad['id'],'name':_0x1b04ad['attributes'][_0x569a57(0x188)],'population':_0x1b04ad[_0x569a57(0x190)]['population'],'realtime_enabled':_0x446455,'schedule_type':_0x1b04ad['attributes'][_0x569a57(0x187)],'updated_at':_0x1b04ad[_0x569a57(0x190)]['updatedAt']};}));return _0xb57807;}}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x3d85ee=a131_0x3bab;(function(_0x177346,_0x3eb062){const _0x3e6f22=a131_0x3bab,_0x573083=_0x177346();while(!![]){try{const _0x41a5a7=-parseInt(_0x3e6f22(0x194))/0x1*(parseInt(_0x3e6f22(0x1a7))/0x2)+parseInt(_0x3e6f22(0x1a4))/0x3*(-parseInt(_0x3e6f22(0x19f))/0x4)+parseInt(_0x3e6f22(0x185))/0x5*(parseInt(_0x3e6f22(0x19b))/0x6)+-parseInt(_0x3e6f22(0x1a3))/0x7*(-parseInt(_0x3e6f22(0x1ae))/0x8)+-parseInt(_0x3e6f22(0x1a6))/0x9*(-parseInt(_0x3e6f22(0x1aa))/0xa)+parseInt(_0x3e6f22(0x1b1))/0xb+parseInt(_0x3e6f22(0x1af))/0xc*(-parseInt(_0x3e6f22(0x189))/0xd);if(_0x41a5a7===_0x3eb062)break;else _0x573083['push'](_0x573083['shift']());}catch(_0x1421d6){_0x573083['push'](_0x573083['shift']());}}}(a131_0x20a8,0x5f5a6));function a131_0x3bab(_0x520a49,_0xd9a178){_0x520a49=_0x520a49-0x181;const _0x20a83d=a131_0x20a8();let _0x3babfd=_0x20a83d[_0x520a49];return _0x3babfd;}import{TDApiClient}from'./client/td-api-client.js';function a131_0x20a8(){const _0x26ee16=['num\x20must\x20be\x20between\x201\x20and\x2010','Database\x20is\x20required','time','9868lNTRUu','num','name','cron','413UliOoq','831rcpNZo','Invalid\x20time\x20format:\x20','27ECFaJZ','296722wQngrk','create','limit','1713050ratSjw','getTime','test','deleteSchedule','24520jsGBQA','24TAXBdS','type','3204300HSaXuL','floor','now','INVALID_ARGUMENT','end_at','push','\x5c$&','updated_at','createSchedule','start_at','update','Query\x20is\x20required','runSchedule','listQueries','created_at','run','delete','446140ufTZXr','scheduled','replace','string','784394ouafxA','history','listSchedules','queries','database','has_next_page','slice','Schedule\x20name\x20is\x20required','updateSchedule','filter','\x20UTC','1zrwskr','list','client','length','pattern','getScheduleHistory','map','24QWteMc'];a131_0x20a8=function(){return _0x26ee16;};return a131_0x20a8();}import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x259a39){const _0x2755f6=a131_0x3bab;if(!_0x259a39)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x2755f6(0x1ac)](_0x259a39))return _0x259a39;return _0x259a39[_0x2755f6(0x187)](_0x2755f6(0x193),'Z')['replace']('\x20','T');}export class ScheduleSDK{[a131_0x3d85ee(0x196)];constructor(_0x5a4604){this['client']=new TDApiClient(_0x5a4604);}async[a131_0x3d85ee(0x195)](_0x504e1b){const _0x3ad350=a131_0x3d85ee,_0x4e4294=await this[_0x3ad350(0x196)][_0x3ad350(0x18b)](),_0x3079f1=_0x4e4294['map'](_0x3efb58=>({..._0x3efb58,'created_at':normalizeTimestamp(_0x3efb58[_0x3ad350(0x182)])??_0x3efb58[_0x3ad350(0x182)]}));if(_0x504e1b?.[_0x3ad350(0x1a9)]&&_0x504e1b[_0x3ad350(0x1a9)]>0x0)return _0x3079f1[_0x3ad350(0x18f)](0x0,_0x504e1b['limit']);return _0x3079f1;}async[a131_0x3d85ee(0x181)](_0x421b3a){const _0x28e54e=a131_0x3d85ee,_0x59c6e5=0x64,_0x4dc8b5=_0x421b3a?.[_0x28e54e(0x1a9)],_0x3f741f=[];let _0x496434=!![],_0x4bae05,_0x252608,_0x17c938;if(_0x421b3a?.[_0x28e54e(0x198)]){const _0x468f97=_0x421b3a['pattern'][_0x28e54e(0x187)](/[.+^${}()|[\]\\]/g,_0x28e54e(0x1b7)),_0x542dbc=_0x468f97[_0x28e54e(0x187)](/\*/g,'.*')[_0x28e54e(0x187)](/\?/g,'.');_0x17c938=new RegExp('^'+_0x542dbc+'$','i');}while(_0x496434&&(!_0x4dc8b5||_0x3f741f[_0x28e54e(0x197)]<_0x4dc8b5)){const _0xd4782c=await this[_0x28e54e(0x196)]['listQueries']({'anchor_column':'updated_at','sort_direction':'desc','page_size':_0x59c6e5,'anchor_id':_0x4bae05,'anchor_value':_0x252608});let _0x3496f1=_0xd4782c[_0x28e54e(0x18c)];_0x421b3a?.[_0x28e54e(0x186)]&&(_0x3496f1=_0x3496f1[_0x28e54e(0x192)](_0x1f66a1=>_0x1f66a1[_0x28e54e(0x1a2)]!==null));_0x17c938&&(_0x3496f1=_0x3496f1[_0x28e54e(0x192)](_0x136125=>_0x136125[_0x28e54e(0x1a1)]&&_0x17c938[_0x28e54e(0x1ac)](_0x136125[_0x28e54e(0x1a1)])));_0x3f741f[_0x28e54e(0x1b6)](..._0x3496f1),_0x496434=_0xd4782c['pagination'][_0x28e54e(0x18e)];if(_0x496434&&_0xd4782c[_0x28e54e(0x18c)]['length']>0x0){const _0x23b31d=_0xd4782c[_0x28e54e(0x18c)][_0xd4782c[_0x28e54e(0x18c)][_0x28e54e(0x197)]-0x1];_0x4bae05=_0x23b31d['id'],_0x252608=_0x23b31d[_0x28e54e(0x1b8)];}}const _0x399137=_0x4dc8b5?_0x3f741f[_0x28e54e(0x18f)](0x0,_0x4dc8b5):_0x3f741f;return{'queries':_0x399137,'pagination':{'has_next_page':_0x496434||(_0x4dc8b5?_0x3f741f[_0x28e54e(0x197)]>_0x4dc8b5:![])}};}async['show'](_0x509c9a){const _0x4d8665=a131_0x3d85ee,_0x1e5816=await this['client'][_0x4d8665(0x18b)](),_0x59f89a=_0x1e5816['find'](_0x580dcf=>_0x580dcf[_0x4d8665(0x1a1)]===_0x509c9a);if(!_0x59f89a)throw new SDKError(ErrorCode['NOT_FOUND'],'Schedule\x20not\x20found:\x20'+_0x509c9a);return{..._0x59f89a,'created_at':normalizeTimestamp(_0x59f89a[_0x4d8665(0x182)])??_0x59f89a[_0x4d8665(0x182)]};}async[a131_0x3d85ee(0x1a8)](_0x4de865,_0x3530a0){const _0x36de02=a131_0x3d85ee;if(!_0x4de865)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x36de02(0x190));if(!_0x3530a0[_0x36de02(0x18d)])throw new SDKError(ErrorCode[_0x36de02(0x1b4)],_0x36de02(0x19d));if(!_0x3530a0['query'])throw new SDKError(ErrorCode[_0x36de02(0x1b4)],_0x36de02(0x1bc));if(!_0x3530a0[_0x36de02(0x1b0)])throw new SDKError(ErrorCode[_0x36de02(0x1b4)],'Type\x20is\x20required');return await this[_0x36de02(0x196)][_0x36de02(0x1b9)](_0x4de865,_0x3530a0);}async[a131_0x3d85ee(0x1bb)](_0x28dfec,_0x429082){const _0x49f0d1=a131_0x3d85ee;if(!_0x28dfec)throw new SDKError(ErrorCode[_0x49f0d1(0x1b4)],_0x49f0d1(0x190));return await this[_0x49f0d1(0x196)][_0x49f0d1(0x191)](_0x28dfec,_0x429082);}async[a131_0x3d85ee(0x184)](_0x5da379){const _0x54ed70=a131_0x3d85ee;if(!_0x5da379)throw new SDKError(ErrorCode[_0x54ed70(0x1b4)],_0x54ed70(0x190));return await this[_0x54ed70(0x196)][_0x54ed70(0x1ad)](_0x5da379);}async[a131_0x3d85ee(0x183)](_0x34df31,_0x1f4b34){const _0xd59594=a131_0x3d85ee;if(!_0x34df31)throw new SDKError(ErrorCode[_0xd59594(0x1b4)],_0xd59594(0x190));let _0x83c807;if(_0x1f4b34?.[_0xd59594(0x19e)]){const _0x2c7086=typeof _0x1f4b34['time']===_0xd59594(0x188)?new Date(_0x1f4b34[_0xd59594(0x19e)]):_0x1f4b34[_0xd59594(0x19e)];if(isNaN(_0x2c7086[_0xd59594(0x1ab)]()))throw new SDKError(ErrorCode[_0xd59594(0x1b4)],_0xd59594(0x1a5)+_0x1f4b34[_0xd59594(0x19e)]);_0x83c807=Math['floor'](_0x2c7086[_0xd59594(0x1ab)]()/0x3e8);}else _0x83c807=Math[_0xd59594(0x1b2)](Date[_0xd59594(0x1b3)]()/0x3e8);if(_0x1f4b34?.['num']!==undefined){if(_0x1f4b34[_0xd59594(0x1a0)]<0x1||_0x1f4b34[_0xd59594(0x1a0)]>0xa)throw new SDKError(ErrorCode[_0xd59594(0x1b4)],_0xd59594(0x19c));}return await this[_0xd59594(0x196)][_0xd59594(0x1bd)](_0x34df31,_0x83c807,_0x1f4b34?.[_0xd59594(0x1a0)]);}async[a131_0x3d85ee(0x18a)](_0x4aec64,_0xdb5aad){const _0x271d10=a131_0x3d85ee;if(!_0x4aec64)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Schedule\x20name\x20is\x20required');const _0x1a401d=await this[_0x271d10(0x196)][_0x271d10(0x199)](_0x4aec64,_0xdb5aad);return{..._0x1a401d,'history':_0x1a401d[_0x271d10(0x18a)][_0x271d10(0x19a)](_0x5a93c3=>({..._0x5a93c3,'created_at':normalizeTimestamp(_0x5a93c3[_0x271d10(0x182)]),'start_at':normalizeTimestamp(_0x5a93c3[_0x271d10(0x1ba)]),'end_at':normalizeTimestamp(_0x5a93c3[_0x271d10(0x1b5)])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3ecc2f,_0x5bad7a){const _0x16f724=a132_0x42a3,_0x31b667=_0x3ecc2f();while(!![]){try{const _0x328ff5=-parseInt(_0x16f724(0x16e))/0x1*(parseInt(_0x16f724(0x169))/0x2)+parseInt(_0x16f724(0x13b))/0x3*(parseInt(_0x16f724(0x10c))/0x4)+-parseInt(_0x16f724(0x125))/0x5*(-parseInt(_0x16f724(0x140))/0x6)+parseInt(_0x16f724(0xfe))/0x7+parseInt(_0x16f724(0x170))/0x8*(-parseInt(_0x16f724(0x16f))/0x9)+-parseInt(_0x16f724(0xf9))/0xa+-parseInt(_0x16f724(0xec))/0xb*(-parseInt(_0x16f724(0x165))/0xc);if(_0x328ff5===_0x5bad7a)break;else _0x31b667['push'](_0x31b667['shift']());}catch(_0x4b248b){_0x31b667['push'](_0x31b667['shift']());}}}(a132_0x5ed8,0xf06ad));import*as a132_0x5bc1c0 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(_0x3b999f){return _0x3b999f;}function ruleDefAsFilterRule(_0x5b86a3){return _0x5b86a3;}export function segmentResponseToDefSync(_0x3aea53,_0x3397c3){const _0x3d4907=a132_0x42a3,_0x3a46dc=_0x3aea53[_0x3d4907(0x143)]&&_0x3d4907(0x17a)in _0x3aea53[_0x3d4907(0x143)]&&_0x3aea53['rule'][_0x3d4907(0x17a)];return{'type':_0x3d4907(0xdf),'name':_0x3aea53[_0x3d4907(0x16c)],..._0x3aea53[_0x3d4907(0x14c)]&&{'description':_0x3aea53[_0x3d4907(0x14c)]},..._0x3397c3&&{'folder':_0x3397c3},..._0x3a46dc&&{'rule':apiRuleToYaml(_0x3aea53[_0x3d4907(0x143)])},..._0x3aea53['kind']!==undefined&&{'kind':_0x3aea53[_0x3d4907(0xeb)]===0x0?'batch':_0x3aea53[_0x3d4907(0xeb)]===0x1?_0x3d4907(0x152):_0x3d4907(0x10a)},..._0x3aea53[_0x3d4907(0xfc)]!==undefined&&{'visible':_0x3aea53[_0x3d4907(0xfc)]}};}export async function segmentResponseToDef(_0x1e2f82,_0x2f7c66,_0xba31c6){const _0x1160b7=a132_0x42a3,_0x52e4b1=segmentResponseToDefSync(_0x1e2f82,_0xba31c6);if(!_0x2f7c66||!_0x2f7c66[_0x1160b7(0xf1)])return _0x52e4b1;return _0x52e4b1[_0x1160b7(0x143)]&&(_0x52e4b1[_0x1160b7(0x143)]=await resolveRuleSegmentRefs(_0x52e4b1[_0x1160b7(0x143)],_0x2f7c66[_0x1160b7(0xf1)])),_0x52e4b1;}export function apiRuleToYaml(_0x3430ae){const _0x32c25a=a132_0x42a3,_0x20f5ee=(_0x3430ae[_0x32c25a(0x137)]||[])[_0x32c25a(0x11e)](apiConditionToYaml);if(_0x20f5ee[_0x32c25a(0x163)]===0x1&&!_0x3430ae[_0x32c25a(0x14c)]&&_0x32c25a(0x17a)in _0x20f5ee[0x0]&&(_0x20f5ee[0x0][_0x32c25a(0x17a)]==='And'||_0x20f5ee[0x0][_0x32c25a(0x17a)]==='Or')){const _0x1d5c69=_0x20f5ee[0x0];if(_0x1d5c69[_0x32c25a(0x17a)]===_0x3430ae[_0x32c25a(0x17a)]&&_0x1d5c69[_0x32c25a(0x137)])return{'type':_0x3430ae[_0x32c25a(0x17a)],'conditions':_0x1d5c69[_0x32c25a(0x137)],..._0x1d5c69[_0x32c25a(0x14c)]&&{'description':_0x1d5c69[_0x32c25a(0x14c)]}};}return{'type':_0x3430ae[_0x32c25a(0x17a)],'conditions':_0x20f5ee,..._0x3430ae['description']&&{'description':_0x3430ae['description']}};}export async function resolveRuleSegmentRefs(_0x41f32e,_0x1a8a6c){const _0x320ce5=a132_0x42a3;return transformRuleSegmentRefs(_0x41f32e,_0x1a8a6c,_0x227e90=>/^\d+$/[_0x320ce5(0x116)](_0x227e90));}async function transformConditionSegmentRefs(_0x2b266c,_0xfcb458,_0x30f5b3,_0x3e327d){const _0x18b900=a132_0x42a3;if(_0x18b900(0xdf)in _0x2b266c&&(_0x2b266c[_0x18b900(0x17a)]===_0x18b900(0x102)||_0x2b266c[_0x18b900(0x17a)]===_0x18b900(0x13f))){const _0x4ea068=_0x2b266c;if(_0x30f5b3(_0x4ea068['segment']))return{..._0x4ea068,'segment':await _0xfcb458(_0x4ea068[_0x18b900(0xdf)])};return _0x2b266c;}if(_0x18b900(0x137)in _0x2b266c&&_0x2b266c['conditions']){const _0xedddc9=_0x2b266c,_0x31c19f=await Promise[_0x18b900(0x110)](_0xedddc9[_0x18b900(0x137)]['map'](_0x372558=>transformConditionSegmentRefs(_0x372558,_0xfcb458,_0x30f5b3,_0x3e327d)));return{..._0xedddc9,'conditions':_0x31c19f};}if(_0x18b900(0x11f)in _0x2b266c&&_0x2b266c[_0x18b900(0x11f)]){const _0x5c4124=_0x2b266c,_0x51f684=await _0x3e327d(filterRuleAsRuleDef(_0x5c4124[_0x18b900(0x11f)]),_0xfcb458);return{..._0x5c4124,'filter':ruleDefAsFilterRule(_0x51f684)};}return _0x2b266c;}function a132_0x42a3(_0x145ca8,_0x5de886){_0x145ca8=_0x145ca8-0xdd;const _0x5ed87e=a132_0x5ed8();let _0x42a36d=_0x5ed87e[_0x145ca8];return _0x42a36d;}async function transformRuleSegmentRefs(_0x2f10fa,_0x27826d,_0x1d768d){const _0x49c43b=a132_0x42a3,_0x2ca870=(_0xfb2a25,_0x3bf8b0)=>transformRuleSegmentRefs(_0xfb2a25,_0x3bf8b0,_0x1d768d),_0x48d0c4=await Promise['all'](_0x2f10fa[_0x49c43b(0x137)][_0x49c43b(0x11e)](_0x7b02f5=>transformConditionSegmentRefs(_0x7b02f5,_0x27826d,_0x1d768d,_0x2ca870)));return{..._0x2f10fa,'conditions':_0x48d0c4};}export async function resolveRuleSegmentIds(_0x3ddc11,_0xfe61){const _0x53c157=a132_0x42a3;return transformRuleSegmentRefs(_0x3ddc11,_0xfe61,_0x1f13aa=>!/^\d+$/[_0x53c157(0x116)](_0x1f13aa));}function isBehaviorApiCondition(_0x45c847){const _0x571e5a=a132_0x42a3;if(!_0x45c847[_0x571e5a(0x12e)]?.[_0x571e5a(0x16d)]?.[_0x571e5a(0x16c)])return![];return!![];}function apiConditionToYaml(_0x3d2b65){const _0x2a7b3e=a132_0x42a3;if(_0x3d2b65[_0x2a7b3e(0x17a)]===_0x2a7b3e(0x173)||_0x3d2b65['type']==='Or'){if(_0x3d2b65['conditions']){const _0x2e888a=_0x3d2b65['conditions'][_0x2a7b3e(0x11e)](apiConditionToYaml);if(_0x2e888a[_0x2a7b3e(0x163)]===0x1&&!_0x3d2b65[_0x2a7b3e(0x14c)])return _0x2e888a[0x0];return{'type':_0x3d2b65[_0x2a7b3e(0x17a)],'conditions':_0x2e888a,..._0x3d2b65[_0x2a7b3e(0x14c)]&&{'description':_0x3d2b65['description']}};}}if(_0x3d2b65['type']==='Value'&&_0x3d2b65['leftValue']&&_0x3d2b65['operator']){const _0x138215=_0x3d2b65[_0x2a7b3e(0x12e)]['aggregation']?buildAggregationDefFromApi(_0x3d2b65[_0x2a7b3e(0x12e)][_0x2a7b3e(0x101)]):undefined;if(isBehaviorApiCondition(_0x3d2b65)){const _0x370aa0=_0x3d2b65[_0x2a7b3e(0x12e)][_0x2a7b3e(0x16d)][_0x2a7b3e(0x16c)];return{'type':_0x2a7b3e(0x15b),'attribute':'','operator':apiOperatorToYaml(_0x3d2b65['operator']),..._0x3d2b65[_0x2a7b3e(0x178)]&&_0x3d2b65[_0x2a7b3e(0x178)]!==_0x2a7b3e(0x148)?{'arrayMatching':_0x3d2b65[_0x2a7b3e(0x178)]}:{},..._0x3d2b65['exclude']?{'exclude':_0x3d2b65['exclude']}:{},..._0x138215?{'aggregation':_0x138215}:{},'source':_0x370aa0,..._0x3d2b65[_0x2a7b3e(0x12e)]['filter']?{'filter':apiRuleToYaml(_0x3d2b65[_0x2a7b3e(0x12e)][_0x2a7b3e(0x11f)])}:{},..._0x3d2b65['limit']!==undefined&&_0x3d2b65[_0x2a7b3e(0x157)]!==null?{'limit':_0x3d2b65['limit']}:{}};}return{'type':'Value','attribute':_0x3d2b65['leftValue'][_0x2a7b3e(0x16c)]||'','operator':apiOperatorToYaml(_0x3d2b65[_0x2a7b3e(0x17d)]),..._0x3d2b65[_0x2a7b3e(0x178)]&&_0x3d2b65[_0x2a7b3e(0x178)]!==_0x2a7b3e(0x148)?{'arrayMatching':_0x3d2b65[_0x2a7b3e(0x178)]}:{},..._0x3d2b65[_0x2a7b3e(0x13f)]?{'exclude':_0x3d2b65[_0x2a7b3e(0x13f)]}:{},..._0x138215?{'aggregation':_0x138215}:{},..._0x3d2b65[_0x2a7b3e(0x12e)]['filter']?{'filter':apiRuleToYaml(_0x3d2b65[_0x2a7b3e(0x12e)]['filter'])}:{},..._0x3d2b65[_0x2a7b3e(0x157)]!==undefined&&_0x3d2b65['limit']!==null?{'limit':_0x3d2b65[_0x2a7b3e(0x157)]}:{}};}if(_0x3d2b65[_0x2a7b3e(0x17a)]==='Column'&&_0x3d2b65[_0x2a7b3e(0x11b)]&&_0x3d2b65[_0x2a7b3e(0x17d)])return{'type':_0x2a7b3e(0xf5),'column':_0x3d2b65[_0x2a7b3e(0x11b)],'operator':apiOperatorToYaml(_0x3d2b65['operator'])};if(_0x3d2b65['type']===_0x2a7b3e(0x132)&&_0x3d2b65['id'])return{'type':_0x3d2b65[_0x2a7b3e(0x13f)]?_0x2a7b3e(0x13f):_0x2a7b3e(0x102),'segment':_0x3d2b65['id']};return{'type':_0x2a7b3e(0x173),'conditions':[]};}function isTemporalOperator(_0x191937){const _0x1b6f7a=a132_0x42a3;return _0x191937==='TimeWithinPast'||_0x191937===_0x1b6f7a(0x172);}function isBetweenOperator(_0x317630){const _0x141c17=a132_0x42a3;return _0x317630===_0x141c17(0x177);}function getEffectiveValue(_0x4d15e9){const _0x596190=a132_0x42a3,_0x558438=_0x4d15e9[_0x596190(0x142)];return _0x4d15e9[_0x596190(0x104)]??_0x558438;}function parseNumericValue(_0x7d81ab){if(typeof _0x7d81ab==='object'&&_0x7d81ab!==null)return _0x7d81ab;if(_0x7d81ab==='')return _0x7d81ab;const _0x1f5a00=Number(_0x7d81ab);return Number['isFinite'](_0x1f5a00)?_0x1f5a00:_0x7d81ab;}function apiOperatorToYaml(_0x31ff24){const _0x24f1b2=a132_0x42a3;if(isBetweenOperator(_0x31ff24['type']))return{'type':mapApiOperatorType(_0x31ff24['type']),..._0x31ff24['not']!==undefined&&{'not':_0x31ff24[_0x24f1b2(0x13e)]},..._0x31ff24[_0x24f1b2(0x11d)]!==undefined&&{'min':parseNumericValue(_0x31ff24[_0x24f1b2(0x11d)])},..._0x31ff24[_0x24f1b2(0x16b)]!==undefined&&{'max':parseNumericValue(_0x31ff24[_0x24f1b2(0x16b)])}};if(_0x31ff24[_0x24f1b2(0x17a)]===_0x24f1b2(0xed))return{'type':_0x24f1b2(0xed),..._0x31ff24[_0x24f1b2(0x13e)]!==undefined&&{'not':_0x31ff24['not']},..._0x31ff24[_0x24f1b2(0x14b)]!==undefined&&{'duration':_0x31ff24[_0x24f1b2(0x14b)]},..._0x31ff24[_0x24f1b2(0x160)]!==undefined&&{'from':_0x31ff24[_0x24f1b2(0x160)]},..._0x31ff24[_0x24f1b2(0x15a)]!==undefined&&{'reverse':_0x31ff24[_0x24f1b2(0x15a)]}};let _0x51bdc1;if(_0x31ff24[_0x24f1b2(0x17c)]&&_0x31ff24[_0x24f1b2(0x17c)][_0x24f1b2(0x163)]>0x0)_0x51bdc1=_0x31ff24[_0x24f1b2(0x17c)];else{if(_0x31ff24[_0x24f1b2(0x121)]!==undefined)_0x51bdc1=_0x31ff24[_0x24f1b2(0x121)];else isTemporalOperator(_0x31ff24['type'])&&_0x31ff24[_0x24f1b2(0x104)]!==undefined&&(_0x51bdc1=_0x31ff24[_0x24f1b2(0x104)]);}return{'type':mapApiOperatorType(_0x31ff24[_0x24f1b2(0x17a)]),..._0x31ff24[_0x24f1b2(0x13e)]!==undefined&&{'not':_0x31ff24[_0x24f1b2(0x13e)]},..._0x51bdc1!==undefined&&{'value':_0x51bdc1},..._0x31ff24[_0x24f1b2(0x103)]!==undefined&&{'unit':_0x31ff24[_0x24f1b2(0x103)]}};}function mapApiOperatorType(_0x556737){return _0x556737;}export function segmentDefToCreateRequest(_0x2c7b77,_0x1fdb7d){const _0x13825d=a132_0x42a3,_0x1539f5={'name':_0x2c7b77['name']};return _0x2c7b77[_0x13825d(0x14c)]&&(_0x1539f5['description']=_0x2c7b77['description']),_0x2c7b77[_0x13825d(0x143)]&&(_0x1539f5[_0x13825d(0x143)]=yamlRuleToApi(_0x2c7b77['rule'])),_0x2c7b77[_0x13825d(0xeb)]&&(_0x1539f5[_0x13825d(0xeb)]=_0x2c7b77[_0x13825d(0xeb)]==='batch'?0x0:_0x2c7b77['kind']==='realtime'?0x1:0x2),_0x2c7b77[_0x13825d(0x12a)]!==undefined&&(_0x1539f5['isVisible']=_0x2c7b77[_0x13825d(0x12a)]),_0x1fdb7d&&(_0x1539f5['segmentFolderId']=_0x1fdb7d),_0x1539f5;}export function segmentDefToUpdateRequest(_0x172729){const _0x4cb020=a132_0x42a3,_0x572e87={'name':_0x172729[_0x4cb020(0x16c)]};return _0x172729[_0x4cb020(0x14c)]!==undefined&&(_0x572e87[_0x4cb020(0x14c)]=_0x172729['description']),_0x172729[_0x4cb020(0x143)]&&(_0x572e87[_0x4cb020(0x143)]=yamlRuleToApi(_0x172729[_0x4cb020(0x143)])),_0x172729['kind']&&(_0x572e87[_0x4cb020(0xeb)]=_0x172729['kind']===_0x4cb020(0x145)?0x0:_0x172729[_0x4cb020(0xeb)]==='realtime'?0x1:0x2),_0x572e87;}export function yamlRuleToApi(_0x2b860f,_0x1f2579=![]){const _0x1d7229=a132_0x42a3,_0xcac5=_0x2b860f[_0x1d7229(0x137)]['map'](yamlConditionToApi);if(_0x1f2579){const _0x136a70=_0xcac5['every'](_0x44305c=>_0x44305c[_0x1d7229(0x17a)]===_0x1d7229(0x173)||_0x44305c[_0x1d7229(0x17a)]==='Or');if(!_0x136a70&&_0xcac5[_0x1d7229(0x163)]>0x0)return{'type':_0x2b860f[_0x1d7229(0x17a)],'conditions':[{'type':_0x1d7229(0x173),'description':_0x2b860f[_0x1d7229(0x14c)]||'','conditions':_0xcac5}]};}return{'type':_0x2b860f[_0x1d7229(0x17a)],'conditions':_0xcac5,..._0x2b860f[_0x1d7229(0x14c)]&&{'description':_0x2b860f[_0x1d7229(0x14c)]}};}function a132_0x5ed8(){const _0x5a7fb4=['rule','timezone','batch','getSchema','behaviorTableName','any','activationTemplateId','CONNECTION_NOT_FOUND','duration','description','has','notify_on','visibility','activation_template_id','errors','realtime','usedNames','repeatUnit','Value','Unknown\x20connection:\x20','limit','__UNRESOLVED__','CONNECTOR_INVALID_CONFIG','reverse','Behavior','replace','null','emailRecipients','valid','from','notification','parse','length','connectionId','1460364fDxJsH','push','connectorConfig','order_by','2RkvPIU','Count','maxValue','name','source','176461rZpIiK','90117ahaLyo','1208Chyain','joinStrategy','TimeWithinNext','And','connector_config','start_at','emailToIdMap','Between','arrayMatching','run_after_journey_refresh','type','connectionNameToIdMap','rightValues','operator','conditions[','endOn','localRuleToName','segment','sort','code','orderBy','\x22:\x0a','CountDistinct','end_on','localeCompare','rule:','\x27:\x20','activations','scheduleType','kind','77sPvCUB','TimeRange','formatting','all_columns','runAfterJourneyRefresh','resolveSegmentName','CONNECTOR_SCHEMA_NOT_FOUND','behavior','schedule','Column','get','Connector:\x20','\x0a\x0aAvailable\x20fields:\x0a','12468740thbQoc','Last','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','isVisible','repeat_frequency','10725897pAzAqm','behavior_table','repeat_sub_frequency','aggregation','include','unit','value','Please\x20specify\x20a\x20valid\x20attribute\x20name.','repeatFrequency','columns','folder','set','funnel_stage','activationParams','2195360pXDqKW','forEach','min','connection','all','isArray','Invalid\x20connector_config\x20for\x20activation\x20\x22','attribute','join_strategy','Equal','test','orderColumn','join_row','object','repeatSubFrequency','column','warnings','minValue','map','filter','toLowerCase','rightValue','string','startAt','__SEGMENT_REF__','4935285aSRRLF','INVALID_ARGUMENT','connectionNameToTypeMap','email_recipients','joinRow','visible','connector_config\x20for\x20activation\x20\x22','syndicationBehavior','attributes','leftValue','ruleHashToName','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','allColumns','Reference','max','Unknown\x20email\x20recipient:\x20','warn','groupingColumns','conditions','attribute_name','First','repeat_unit','3ZdTkCF','notifyOn','keys','not','exclude','6XMMXbZ','stringify','values'];a132_0x5ed8=function(){return _0x5a7fb4;};return a132_0x5ed8();}function yamlConditionToApi(_0x415b8c){const _0x533ba0=a132_0x42a3;if(_0x533ba0(0xdf)in _0x415b8c&&(_0x415b8c[_0x533ba0(0x17a)]===_0x533ba0(0x102)||_0x415b8c[_0x533ba0(0x17a)]===_0x533ba0(0x13f))){const _0x3325dc=_0x415b8c;return{'type':_0x533ba0(0x132),'id':_0x3325dc['segment'],'exclude':_0x3325dc[_0x533ba0(0x17a)]===_0x533ba0(0x13f)};}if(_0x533ba0(0x17a)in _0x415b8c&&(_0x415b8c[_0x533ba0(0x17a)]===_0x533ba0(0x173)||_0x415b8c['type']==='Or')){const _0x27063e=_0x415b8c;return{'type':_0x27063e[_0x533ba0(0x17a)],'conditions':_0x27063e[_0x533ba0(0x137)][_0x533ba0(0x11e)](yamlConditionToApi),..._0x27063e[_0x533ba0(0x14c)]&&{'description':_0x27063e[_0x533ba0(0x14c)]}};}if(_0x533ba0(0x11b)in _0x415b8c&&_0x415b8c['type']===_0x533ba0(0xf5)){const _0x3a85c6=_0x415b8c;return{'type':'Column','column':_0x3a85c6[_0x533ba0(0x11b)],'operator':yamlOperatorToApi(_0x3a85c6[_0x533ba0(0x17d)])};}const _0x31d8e9=_0x415b8c,_0x52c30c={'type':_0x533ba0(0x155),'leftValue':buildLeftValue(_0x31d8e9),'operator':yamlOperatorToApi(_0x31d8e9[_0x533ba0(0x17d)]),'exclude':_0x31d8e9[_0x533ba0(0x13f)]??![],'arrayMatching':_0x31d8e9[_0x533ba0(0x178)]??_0x533ba0(0x148)};return _0x31d8e9['limit']!==undefined&&(_0x52c30c[_0x533ba0(0x157)]=_0x31d8e9[_0x533ba0(0x157)]),_0x52c30c;}function buildAggregationDefFromApi(_0x4bdb8c){const _0x31e673=a132_0x42a3,_0x2a0656=_0x4bdb8c[_0x31e673(0x17a)];if(_0x2a0656===_0x31e673(0xe4))return{'type':_0x2a0656,'columns':_0x4bdb8c['columns']??[]};if(_0x2a0656==='First'||_0x2a0656===_0x31e673(0xfa))return{'type':_0x2a0656,'column':_0x4bdb8c[_0x31e673(0x11b)]??'','orderColumn':_0x4bdb8c[_0x31e673(0x117)]??'',..._0x4bdb8c[_0x31e673(0x136)]&&{'groupingColumns':_0x4bdb8c[_0x31e673(0x136)]}};if(_0x2a0656===_0x31e673(0x16a))return{'type':_0x2a0656,..._0x4bdb8c[_0x31e673(0x136)]&&{'groupingColumns':_0x4bdb8c[_0x31e673(0x136)]}};return{'type':_0x2a0656,'column':_0x4bdb8c['column']??'',..._0x4bdb8c['groupingColumns']&&{'groupingColumns':_0x4bdb8c['groupingColumns']}};}function buildLeftValue(_0x75fff6){const _0x95d625=a132_0x42a3,_0x60d6f7={};_0x75fff6[_0x95d625(0x113)]&&_0x75fff6['type']!==_0x95d625(0x15b)&&(_0x60d6f7['name']=_0x75fff6['attribute']);if(_0x75fff6[_0x95d625(0x101)]){const _0x26264e=_0x75fff6['aggregation'];if(_0x26264e[_0x95d625(0x17a)]==='CountDistinct')_0x60d6f7[_0x95d625(0x101)]={'type':'CountDistinct','columns':_0x26264e['columns']};else{if(_0x26264e[_0x95d625(0x17a)]===_0x95d625(0x139)||_0x26264e[_0x95d625(0x17a)]===_0x95d625(0xfa))_0x60d6f7['aggregation']={'type':_0x26264e['type'],'column':_0x26264e[_0x95d625(0x11b)],'orderColumn':_0x26264e[_0x95d625(0x117)],..._0x26264e[_0x95d625(0x136)]&&{'groupingColumns':_0x26264e[_0x95d625(0x136)]}};else _0x26264e['type']==='Count'?_0x60d6f7[_0x95d625(0x101)]={'type':_0x95d625(0x16a),..._0x26264e[_0x95d625(0x136)]&&{'groupingColumns':_0x26264e[_0x95d625(0x136)]}}:_0x60d6f7['aggregation']={'type':_0x26264e[_0x95d625(0x17a)],'column':_0x26264e['column'],..._0x26264e['groupingColumns']&&{'groupingColumns':_0x26264e['groupingColumns']}};}}return _0x75fff6['source']&&(_0x60d6f7[_0x95d625(0x16d)]={'name':_0x75fff6['source']}),_0x75fff6[_0x95d625(0x11f)]&&(_0x60d6f7[_0x95d625(0x11f)]=yamlRuleToApi(filterRuleAsRuleDef(_0x75fff6[_0x95d625(0x11f)]))),_0x60d6f7;}function yamlOperatorToApi(_0xee2bb6){const _0x30ee1d=a132_0x42a3,_0x44ecfb={'type':mapYamlOperatorType(_0xee2bb6[_0x30ee1d(0x17a)]),'not':_0xee2bb6[_0x30ee1d(0x13e)]??![]};if(isBetweenOperator(_0xee2bb6[_0x30ee1d(0x17a)]))return _0xee2bb6[_0x30ee1d(0x10e)]!==undefined&&(_0x44ecfb[_0x30ee1d(0x11d)]=typeof _0xee2bb6['min']==='object'?_0xee2bb6[_0x30ee1d(0x10e)]:String(_0xee2bb6[_0x30ee1d(0x10e)])),_0xee2bb6[_0x30ee1d(0x133)]!==undefined&&(_0x44ecfb[_0x30ee1d(0x16b)]=typeof _0xee2bb6[_0x30ee1d(0x133)]===_0x30ee1d(0x119)?_0xee2bb6[_0x30ee1d(0x133)]:String(_0xee2bb6[_0x30ee1d(0x133)])),_0x44ecfb;if(_0xee2bb6['type']===_0x30ee1d(0xed))return _0xee2bb6[_0x30ee1d(0x14b)]&&(_0x44ecfb[_0x30ee1d(0x14b)]=_0xee2bb6['duration']),_0xee2bb6[_0x30ee1d(0x160)]&&(_0x44ecfb['from']=_0xee2bb6[_0x30ee1d(0x160)]),_0xee2bb6[_0x30ee1d(0x15a)]!==undefined&&(_0x44ecfb[_0x30ee1d(0x15a)]=_0xee2bb6[_0x30ee1d(0x15a)]),_0x44ecfb;const _0x1f0766=getEffectiveValue(_0xee2bb6);if(_0x1f0766!==undefined){if(Array[_0x30ee1d(0x111)](_0x1f0766))_0x44ecfb[_0x30ee1d(0x17c)]=_0x1f0766;else isTemporalOperator(_0xee2bb6[_0x30ee1d(0x17a)])?_0x44ecfb[_0x30ee1d(0x104)]=_0x1f0766:_0x44ecfb[_0x30ee1d(0x121)]=_0x1f0766;}return _0xee2bb6[_0x30ee1d(0x103)]&&(_0x44ecfb['unit']=_0xee2bb6['unit']),_0x44ecfb;}function mapYamlOperatorType(_0x26911c){return _0x26911c;}export function toYamlString(_0x162cab){const _0xd0dc5=a132_0x42a3,_0x227af3=JSON[_0xd0dc5(0x162)](JSON[_0xd0dc5(0x141)](_0x162cab)),_0x35ecc9=a132_0x5bc1c0['stringify'](_0x227af3,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xd0dc5(0x15d)}),_0x2d8df5=[_0xd0dc5(0xe7)];let _0x2f38bb=_0x35ecc9;for(const _0x16b326 of _0x2d8df5){_0x2f38bb=_0x2f38bb[_0xd0dc5(0x15c)](new RegExp('^('+_0x16b326+')','m'),(_0x4ce791,_0x3c051f,_0x55833)=>{if(_0x55833===0x0||_0x2f38bb[_0x55833-0x1]==='\x0a'&&_0x2f38bb[_0x55833-0x2]==='\x0a')return _0x3c051f;return'\x0a'+_0x3c051f;});}return _0x2f38bb;}export function parseYamlString(_0x5cf637){return parseSegmentYamlFile(_0x5cf637);}export function isSegmentYaml(_0x243fc0){const _0x318a5b=a132_0x42a3;if(typeof _0x243fc0!=='object'||_0x243fc0===null)return![];const _0x1a1835=_0x243fc0;return _0x1a1835['type']===_0x318a5b(0xdf)||_0x1a1835[_0x318a5b(0x17a)]===undefined;}export function generateTemplate(_0x42c863='New\x20Segment'){const _0x262386=a132_0x42a3,_0x4d4c12={'type':_0x262386(0xdf),'name':_0x42c863,'description':'Segment\x20description','rule':{'type':_0x262386(0x173),'conditions':[{'type':'Value','attribute':_0x262386(0x138),'operator':{'type':_0x262386(0x115),'value':_0x262386(0x104)}}]}};return toYamlString(_0x4d4c12);}export function segmentToYamlString(_0x340ee3){const _0x5cc9cd=a132_0x42a3,_0x5da1e5=JSON['parse'](JSON[_0x5cc9cd(0x141)](_0x340ee3)),_0x42b5aa=a132_0x5bc1c0[_0x5cc9cd(0x141)](_0x5da1e5,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5cc9cd(0x15d)}),_0xc4861f=[_0x5cc9cd(0xe7),'activations:'];let _0x133588=_0x42b5aa;for(const _0x366589 of _0xc4861f){_0x133588=_0x133588[_0x5cc9cd(0x15c)](new RegExp('^('+_0x366589+')','m'),(_0x394cbf,_0x1ef062,_0x59d9c5)=>{if(_0x59d9c5===0x0||_0x133588[_0x59d9c5-0x1]==='\x0a'&&_0x133588[_0x59d9c5-0x2]==='\x0a')return _0x1ef062;return'\x0a'+_0x1ef062;});}return _0x133588;}export function parseSegmentYamlFile(_0x5f3810){return safeParseYaml(_0x5f3810,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x2499e5){const _0x33a267=a132_0x42a3;return{'type':_0x33a267(0xdf),'name':_0x2499e5['name'],..._0x2499e5['description']!==undefined&&{'description':_0x2499e5['description']},..._0x2499e5[_0x33a267(0x108)]!==undefined&&{'folder':_0x2499e5[_0x33a267(0x108)]},..._0x2499e5['rule']&&{'rule':normalizeRule(_0x2499e5[_0x33a267(0x143)])},..._0x2499e5[_0x33a267(0xeb)]!==undefined&&{'kind':_0x2499e5['kind']},..._0x2499e5['visible']!==undefined&&{'visible':_0x2499e5['visible']},..._0x2499e5[_0x33a267(0xe9)]&&{'activations':_0x2499e5[_0x33a267(0xe9)][_0x33a267(0x11e)](normalizeActivation)}};}export function normalizeRule(_0x4647c3){const _0x1f78c3=a132_0x42a3;return{'type':_0x4647c3[_0x1f78c3(0x17a)],'conditions':_0x4647c3[_0x1f78c3(0x137)][_0x1f78c3(0x11e)](normalizeCondition),..._0x4647c3[_0x1f78c3(0x14c)]!==undefined&&{'description':_0x4647c3[_0x1f78c3(0x14c)]}};}function normalizeCondition(_0x4e182d){const _0x477ef9=a132_0x42a3;if(_0x477ef9(0xdf)in _0x4e182d&&(_0x4e182d['type']===_0x477ef9(0x102)||_0x4e182d['type']==='exclude')){const _0x373703=_0x4e182d;return{'type':_0x373703[_0x477ef9(0x17a)],'segment':_0x373703[_0x477ef9(0xdf)]};}if('type'in _0x4e182d&&(_0x4e182d['type']===_0x477ef9(0x173)||_0x4e182d[_0x477ef9(0x17a)]==='Or')){const _0x2c4bd6=_0x4e182d;return{'type':_0x2c4bd6[_0x477ef9(0x17a)],'conditions':_0x2c4bd6[_0x477ef9(0x137)][_0x477ef9(0x11e)](normalizeCondition),..._0x2c4bd6['description']!==undefined&&{'description':_0x2c4bd6[_0x477ef9(0x14c)]}};}if(_0x477ef9(0x11b)in _0x4e182d&&_0x4e182d['type']===_0x477ef9(0xf5)){const _0x4ad0ae=_0x4e182d;return{'type':'Column','column':_0x4ad0ae[_0x477ef9(0x11b)],'operator':normalizeOperator(_0x4ad0ae['operator'])};}const _0x2a7730=_0x4e182d;return{'type':_0x477ef9(0x155),'attribute':_0x2a7730[_0x477ef9(0x113)],'operator':normalizeOperator(_0x2a7730['operator']),..._0x2a7730['arrayMatching']!==undefined&&{'arrayMatching':_0x2a7730['arrayMatching']},..._0x2a7730[_0x477ef9(0x13f)]!==undefined&&{'exclude':_0x2a7730[_0x477ef9(0x13f)]},..._0x2a7730['aggregation']!==undefined&&{'aggregation':_0x2a7730[_0x477ef9(0x101)]},..._0x2a7730[_0x477ef9(0x16d)]!==undefined&&{'source':_0x2a7730[_0x477ef9(0x16d)]},..._0x2a7730['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x2a7730[_0x477ef9(0x11f)])))},..._0x2a7730[_0x477ef9(0x157)]!==undefined&&{'limit':_0x2a7730['limit']}};}function normalizeOperator(_0x277355){const _0x2edac3=a132_0x42a3;if(isBetweenOperator(_0x277355['type']))return{'type':_0x277355['type'],..._0x277355[_0x2edac3(0x13e)]!==undefined&&{'not':_0x277355[_0x2edac3(0x13e)]},..._0x277355[_0x2edac3(0x10e)]!==undefined&&{'min':_0x277355[_0x2edac3(0x10e)]},..._0x277355['max']!==undefined&&{'max':_0x277355[_0x2edac3(0x133)]}};const _0x28b8cc=getEffectiveValue(_0x277355);return{'type':_0x277355[_0x2edac3(0x17a)],..._0x277355[_0x2edac3(0x13e)]!==undefined&&{'not':_0x277355[_0x2edac3(0x13e)]},..._0x28b8cc!==undefined&&{'value':_0x28b8cc},..._0x277355['unit']!==undefined&&{'unit':_0x277355[_0x2edac3(0x103)]},..._0x277355[_0x2edac3(0x14b)]!==undefined&&{'duration':_0x277355[_0x2edac3(0x14b)]},..._0x277355[_0x2edac3(0x160)]!==undefined&&{'from':_0x277355[_0x2edac3(0x160)]},..._0x277355[_0x2edac3(0x15a)]!==undefined&&{'reverse':_0x277355[_0x2edac3(0x15a)]}};}function normalizeActivation(_0x499285){const _0x2d6ba3=a132_0x42a3;return{'name':_0x499285[_0x2d6ba3(0x16c)],'connection':_0x499285[_0x2d6ba3(0x10f)],..._0x499285[_0x2d6ba3(0x14c)]!==undefined&&{'description':_0x499285[_0x2d6ba3(0x14c)]},..._0x499285['all_columns']!==undefined&&{'all_columns':_0x499285[_0x2d6ba3(0xef)]},..._0x499285[_0x2d6ba3(0x107)]!==undefined&&{'columns':_0x499285[_0x2d6ba3(0x107)]},..._0x499285[_0x2d6ba3(0xf3)]!==undefined&&{'behavior':_0x499285[_0x2d6ba3(0xf3)]},..._0x499285[_0x2d6ba3(0xf4)]!==undefined&&{'schedule':_0x499285[_0x2d6ba3(0xf4)]},..._0x499285['notification']!==undefined&&{'notification':_0x499285[_0x2d6ba3(0x161)]},..._0x499285[_0x2d6ba3(0x174)]!==undefined&&{'connector_config':_0x499285['connector_config']},..._0x499285[_0x2d6ba3(0x150)]!==undefined&&{'activation_template_id':_0x499285[_0x2d6ba3(0x150)]}};}export function activationResponseToDef(_0x464536,_0x3a49d6,_0x2c303c){const _0x5dc103=a132_0x42a3,_0x2a9f0f=_0x464536[_0x5dc103(0x164)]||'',_0x7c0be5=_0x2c303c?.[_0x5dc103(0xf6)](_0x2a9f0f)??_0x2a9f0f,_0x1745cd={'name':_0x464536[_0x5dc103(0x16c)],'connection':_0x7c0be5};_0x464536['description']&&(_0x1745cd[_0x5dc103(0x14c)]=_0x464536['description']);let _0x2620db=[];_0x464536[_0x5dc103(0x107)]&&_0x464536[_0x5dc103(0x107)]['length']>0x0&&(_0x2620db=_0x464536['columns'][_0x5dc103(0x11f)](_0xda7aac=>_0xda7aac&&_0xda7aac[_0x5dc103(0x16c)])[_0x5dc103(0x11e)](_0x39567f=>{const _0xc5bc2e=_0x5dc103;if(_0x39567f[_0xc5bc2e(0x17a)]||_0x39567f[_0xc5bc2e(0x14f)])return{'name':_0x39567f['name'],..._0x39567f['type']&&{'type':_0x39567f[_0xc5bc2e(0x17a)]},..._0x39567f[_0xc5bc2e(0x14f)]&&{'visibility':_0x39567f[_0xc5bc2e(0x14f)]}};return _0x39567f[_0xc5bc2e(0x16c)];}));_0x2620db[_0x5dc103(0x163)]>0x0&&(_0x1745cd[_0x5dc103(0x107)]=_0x2620db);_0x464536[_0x5dc103(0x131)]!==undefined&&(_0x464536['allColumns']===![]&&_0x2620db[_0x5dc103(0x163)]===0x0?_0x1745cd[_0x5dc103(0xef)]=!![]:_0x1745cd[_0x5dc103(0xef)]=_0x464536[_0x5dc103(0x131)]);const _0x2f1d5f={};let _0x355be3=![];_0x464536['scheduleType']&&(_0x2f1d5f[_0x5dc103(0x17a)]=_0x464536[_0x5dc103(0xea)],_0x355be3=!![]);_0x464536['repeatUnit']&&(_0x2f1d5f['repeat_unit']=_0x464536[_0x5dc103(0x154)],_0x355be3=!![]);_0x464536['repeatFrequency']!==undefined&&_0x464536[_0x5dc103(0x106)]!==null&&(_0x2f1d5f['repeat_frequency']=_0x464536[_0x5dc103(0x106)],_0x355be3=!![]);_0x464536[_0x5dc103(0x11a)]&&_0x464536[_0x5dc103(0x11a)]['length']>0x0&&(_0x2f1d5f['repeat_sub_frequency']=_0x464536['repeatSubFrequency'],_0x355be3=!![]);_0x464536[_0x5dc103(0x123)]!==undefined&&(_0x2f1d5f[_0x5dc103(0x175)]=_0x464536[_0x5dc103(0x123)],_0x355be3=!![]);_0x464536['endOn']!==undefined&&(_0x2f1d5f[_0x5dc103(0xe5)]=_0x464536['endOn'],_0x355be3=!![]);_0x464536[_0x5dc103(0x144)]&&(_0x2f1d5f['timezone']=_0x464536[_0x5dc103(0x144)],_0x355be3=!![]);_0x355be3&&(_0x1745cd[_0x5dc103(0xf4)]=_0x2f1d5f);(_0x464536[_0x5dc103(0x13c)]&&_0x464536[_0x5dc103(0x13c)][_0x5dc103(0x163)]>0x0||_0x464536[_0x5dc103(0x15e)]&&_0x464536[_0x5dc103(0x15e)][_0x5dc103(0x163)]>0x0)&&(_0x1745cd[_0x5dc103(0x161)]={},_0x464536['notifyOn']&&_0x464536[_0x5dc103(0x13c)]['length']>0x0&&(_0x1745cd[_0x5dc103(0x161)]['notify_on']=_0x464536[_0x5dc103(0x13c)]),_0x464536['emailRecipients']&&_0x464536[_0x5dc103(0x15e)][_0x5dc103(0x163)]>0x0&&(_0x1745cd['notification']['email_recipients']=_0x464536[_0x5dc103(0x15e)][_0x5dc103(0x11e)](_0x1fecae=>{const _0x12230c=_0x5dc103,_0x120154=_0x3a49d6?.[_0x12230c(0xf6)](_0x1fecae);return _0x120154??String(_0x1fecae);})));_0x464536[_0x5dc103(0x167)]&&Object[_0x5dc103(0x13d)](_0x464536[_0x5dc103(0x167)])[_0x5dc103(0x163)]>0x0&&(_0x1745cd[_0x5dc103(0x174)]=normalizeConnectorConfigForYaml(_0x464536[_0x5dc103(0x167)]));_0x464536[_0x5dc103(0x149)]&&(_0x1745cd[_0x5dc103(0x150)]=_0x464536[_0x5dc103(0x149)]);if(_0x464536[_0x5dc103(0x12c)]){const _0x38248a={},_0x1b6018=_0x464536[_0x5dc103(0x12c)];_0x1b6018[_0x5dc103(0x107)]&&_0x1b6018[_0x5dc103(0x107)][_0x5dc103(0x163)]>0x0&&(_0x38248a[_0x5dc103(0x107)]=_0x1b6018['columns'][_0x5dc103(0x11f)](_0x4cd403=>_0x4cd403&&_0x4cd403['name'])[_0x5dc103(0x11e)](_0x264f5d=>({'name':_0x264f5d['name'],..._0x264f5d['type']&&{'type':_0x264f5d[_0x5dc103(0x17a)]},..._0x264f5d[_0x5dc103(0x14f)]&&{'visibility':_0x264f5d[_0x5dc103(0x14f)]}}))),_0x1b6018[_0x5dc103(0x147)]&&(_0x38248a[_0x5dc103(0xff)]=_0x1b6018[_0x5dc103(0x147)]),_0x1b6018[_0x5dc103(0x129)]!==undefined&&(_0x38248a['join_row']=_0x1b6018['joinRow']),_0x1b6018['joinStrategy']&&(_0x38248a[_0x5dc103(0x114)]=_0x1b6018[_0x5dc103(0x171)]),_0x1b6018[_0x5dc103(0xee)]&&(_0x38248a[_0x5dc103(0xee)]=_0x1b6018[_0x5dc103(0xee)]),_0x1b6018[_0x5dc103(0xe2)]&&_0x1b6018[_0x5dc103(0xe2)][_0x5dc103(0x163)]>0x0&&(_0x38248a[_0x5dc103(0x168)]=_0x1b6018[_0x5dc103(0xe2)]),Object[_0x5dc103(0x13d)](_0x38248a)['length']>0x0&&(_0x1745cd['behavior']=_0x38248a);}return _0x1745cd;}export function journeyActivationStepToYaml(_0x46d96d,_0x3f4de1,_0x54638c){const _0x4070a9=a132_0x42a3,_0x437692=_0x46d96d[_0x4070a9(0x12d)][_0x4070a9(0x10b)],_0x13998a=_0x437692[_0x4070a9(0x164)]||'',_0x369193=_0x54638c?.[_0x4070a9(0xf6)](_0x13998a)??_0x13998a,_0x122009={'name':_0x437692[_0x4070a9(0x16c)]||'','connection':_0x369193};_0x46d96d[_0x4070a9(0x12d)][_0x4070a9(0xf0)]&&(_0x122009[_0x4070a9(0x179)]=!![]);_0x437692[_0x4070a9(0x14c)]&&(_0x122009[_0x4070a9(0x14c)]=_0x437692[_0x4070a9(0x14c)]);let _0x1b40c0=[];_0x437692['columns']&&_0x437692[_0x4070a9(0x107)][_0x4070a9(0x163)]>0x0&&(_0x1b40c0=_0x437692['columns']['filter'](_0xef0379=>_0xef0379&&_0xef0379[_0x4070a9(0x16c)])[_0x4070a9(0x11e)](_0x3e3d60=>{const _0x1eddca=_0x4070a9;if(_0x3e3d60[_0x1eddca(0x17a)]||_0x3e3d60['visibility'])return{'name':_0x3e3d60[_0x1eddca(0x16c)],..._0x3e3d60[_0x1eddca(0x17a)]&&{'type':_0x3e3d60['type']},..._0x3e3d60[_0x1eddca(0x14f)]&&{'visibility':_0x3e3d60[_0x1eddca(0x14f)]}};return _0x3e3d60[_0x1eddca(0x16c)];}));_0x1b40c0['length']>0x0&&(_0x122009[_0x4070a9(0x107)]=_0x1b40c0);_0x437692[_0x4070a9(0x131)]!==undefined&&(_0x437692['allColumns']===![]&&_0x1b40c0[_0x4070a9(0x163)]===0x0?_0x122009[_0x4070a9(0xef)]=!![]:_0x122009[_0x4070a9(0xef)]=_0x437692[_0x4070a9(0x131)]);const _0x248927={};let _0x5d37c3=![];_0x437692[_0x4070a9(0xea)]&&(_0x248927[_0x4070a9(0x17a)]=_0x437692[_0x4070a9(0xea)],_0x5d37c3=!![]);_0x437692[_0x4070a9(0x154)]&&(_0x248927['repeat_unit']=_0x437692['repeatUnit'],_0x5d37c3=!![]);_0x437692[_0x4070a9(0x106)]!==undefined&&_0x437692[_0x4070a9(0x106)]!==null&&(_0x248927['repeat_frequency']=_0x437692['repeatFrequency'],_0x5d37c3=!![]);_0x437692[_0x4070a9(0x123)]!==undefined&&(_0x248927[_0x4070a9(0x175)]=_0x437692['startAt'],_0x5d37c3=!![]);_0x437692[_0x4070a9(0xdd)]!==undefined&&(_0x248927['end_on']=_0x437692[_0x4070a9(0xdd)],_0x5d37c3=!![]);_0x437692[_0x4070a9(0x144)]&&(_0x248927['timezone']=_0x437692[_0x4070a9(0x144)],_0x5d37c3=!![]);_0x5d37c3&&(_0x122009[_0x4070a9(0xf4)]=_0x248927);(_0x437692[_0x4070a9(0x13c)]&&_0x437692[_0x4070a9(0x13c)][_0x4070a9(0x163)]>0x0||_0x437692[_0x4070a9(0x15e)]&&_0x437692['emailRecipients'][_0x4070a9(0x163)]>0x0)&&(_0x122009[_0x4070a9(0x161)]={},_0x437692[_0x4070a9(0x13c)]&&_0x437692[_0x4070a9(0x13c)][_0x4070a9(0x163)]>0x0&&(_0x122009[_0x4070a9(0x161)][_0x4070a9(0x14e)]=_0x437692['notifyOn']),_0x437692[_0x4070a9(0x15e)]&&_0x437692['emailRecipients'][_0x4070a9(0x163)]>0x0&&(_0x122009[_0x4070a9(0x161)][_0x4070a9(0x128)]=_0x437692[_0x4070a9(0x15e)][_0x4070a9(0x11e)](_0x3240e4=>{const _0x15836f=_0x3f4de1?.['get'](_0x3240e4);return _0x15836f??String(_0x3240e4);})));_0x437692[_0x4070a9(0x167)]&&Object[_0x4070a9(0x13d)](_0x437692[_0x4070a9(0x167)])['length']>0x0&&(_0x122009['connector_config']=normalizeConnectorConfigForYaml(_0x437692[_0x4070a9(0x167)]));_0x437692[_0x4070a9(0x149)]&&(_0x122009[_0x4070a9(0x150)]=_0x437692[_0x4070a9(0x149)]);if(_0x437692['syndicationBehavior']){const _0x4c14c1={},_0x14c2e0=_0x437692[_0x4070a9(0x12c)];_0x14c2e0[_0x4070a9(0x107)]&&_0x14c2e0[_0x4070a9(0x107)][_0x4070a9(0x163)]>0x0&&(_0x4c14c1[_0x4070a9(0x107)]=_0x14c2e0[_0x4070a9(0x107)][_0x4070a9(0x11f)](_0x2f15d6=>_0x2f15d6&&_0x2f15d6[_0x4070a9(0x16c)])[_0x4070a9(0x11e)](_0xae12dc=>({'name':_0xae12dc[_0x4070a9(0x16c)],..._0xae12dc['type']&&{'type':_0xae12dc['type']},..._0xae12dc[_0x4070a9(0x14f)]&&{'visibility':_0xae12dc[_0x4070a9(0x14f)]}}))),_0x14c2e0[_0x4070a9(0x147)]&&(_0x4c14c1['behavior_table']=_0x14c2e0[_0x4070a9(0x147)]),_0x14c2e0[_0x4070a9(0x129)]!==undefined&&(_0x4c14c1[_0x4070a9(0x118)]=_0x14c2e0['joinRow']),_0x14c2e0[_0x4070a9(0x171)]&&(_0x4c14c1['join_strategy']=_0x14c2e0['joinStrategy']),_0x14c2e0['formatting']&&(_0x4c14c1[_0x4070a9(0xee)]=_0x14c2e0[_0x4070a9(0xee)]),_0x14c2e0[_0x4070a9(0xe2)]&&_0x14c2e0[_0x4070a9(0xe2)]['length']>0x0&&(_0x4c14c1[_0x4070a9(0x168)]=_0x14c2e0[_0x4070a9(0xe2)]),Object[_0x4070a9(0x13d)](_0x4c14c1)['length']>0x0&&(_0x122009['behavior']=_0x4c14c1);}return _0x122009;}export function segmentWithActivationsToYaml(_0xc7e158,_0x154db7,_0x1b2a4c,_0x27dc53,_0x2bbd3f){const _0x6f4371=a132_0x42a3,_0x49382d=segmentResponseToDefSync(_0xc7e158,_0x1b2a4c);return _0x154db7[_0x6f4371(0x163)]>0x0&&(_0x49382d[_0x6f4371(0xe9)]=_0x154db7[_0x6f4371(0x11e)](_0x519996=>activationResponseToDef(_0x519996,_0x27dc53,_0x2bbd3f))),_0x49382d;}function normalizeColumn(_0x43688e){const _0x115100=a132_0x42a3;if(typeof _0x43688e==='string')return{'name':_0x43688e};return{'name':_0x43688e[_0x115100(0x16c)],..._0x43688e[_0x115100(0x17a)]&&{'type':_0x43688e['type']},..._0x43688e['visibility']&&{'visibility':_0x43688e[_0x115100(0x14f)]}};}export async function activationDefToCreateRequest(_0x2bf9f8,_0x2d43aa){const _0x20c8d1=a132_0x42a3,_0x34a642=_0x2d43aa?.[_0x20c8d1(0x176)],_0x2e7a63=_0x2d43aa?.[_0x20c8d1(0x17b)],_0x277459=_0x2bf9f8[_0x20c8d1(0x10f)];let _0xc74b49;const _0x50e1bc=parseInt(_0x277459,0xa);if(!isNaN(_0x50e1bc)&&String(_0x50e1bc)===_0x277459)_0xc74b49=_0x50e1bc;else{const _0x8ec6ad=_0x2e7a63?.[_0x20c8d1(0xf6)](_0x277459);if(_0x8ec6ad===undefined)throw new SDKError(ErrorCode[_0x20c8d1(0x14a)],_0x20c8d1(0x156)+_0x277459,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0xc74b49=_0x8ec6ad;}const _0x317b8a={'name':_0x2bf9f8['name'],'connectionId':_0xc74b49};_0x2bf9f8['description']&&(_0x317b8a[_0x20c8d1(0x14c)]=_0x2bf9f8[_0x20c8d1(0x14c)]);let _0x4ef39c=[];_0x2bf9f8['columns']&&_0x2bf9f8[_0x20c8d1(0x107)][_0x20c8d1(0x163)]>0x0&&(_0x4ef39c=_0x2bf9f8['columns'][_0x20c8d1(0x11f)](_0x7c66a5=>_0x7c66a5!=null)[_0x20c8d1(0x11e)](normalizeColumn));_0x4ef39c[_0x20c8d1(0x163)]>0x0&&(_0x317b8a[_0x20c8d1(0x107)]=_0x4ef39c);_0x2bf9f8[_0x20c8d1(0xef)]!==undefined&&(_0x2bf9f8[_0x20c8d1(0xef)]===![]&&_0x4ef39c['length']===0x0?_0x317b8a[_0x20c8d1(0x131)]=!![]:_0x317b8a[_0x20c8d1(0x131)]=_0x2bf9f8[_0x20c8d1(0xef)]);if(_0x2bf9f8[_0x20c8d1(0xf4)]){const _0x16ac3d=_0x2bf9f8[_0x20c8d1(0xf4)];_0x16ac3d[_0x20c8d1(0x17a)]&&(_0x317b8a[_0x20c8d1(0xea)]=_0x16ac3d[_0x20c8d1(0x17a)]),_0x16ac3d[_0x20c8d1(0x13a)]&&(_0x317b8a['repeatUnit']=_0x16ac3d['repeat_unit']),_0x16ac3d['repeat_frequency']!==undefined&&(_0x317b8a[_0x20c8d1(0x106)]=_0x16ac3d[_0x20c8d1(0xfd)]),_0x16ac3d[_0x20c8d1(0x100)]&&(_0x317b8a[_0x20c8d1(0x11a)]=_0x16ac3d[_0x20c8d1(0x100)]),_0x16ac3d[_0x20c8d1(0x175)]!==undefined&&(_0x317b8a[_0x20c8d1(0x123)]=_0x16ac3d[_0x20c8d1(0x175)]),_0x16ac3d[_0x20c8d1(0xe5)]!==undefined&&(_0x317b8a[_0x20c8d1(0xdd)]=_0x16ac3d[_0x20c8d1(0xe5)]),_0x16ac3d[_0x20c8d1(0x144)]&&(_0x317b8a[_0x20c8d1(0x144)]=_0x16ac3d[_0x20c8d1(0x144)]);}_0x2bf9f8['notification']&&(_0x2bf9f8['notification'][_0x20c8d1(0x14e)]&&(_0x317b8a[_0x20c8d1(0x13c)]=_0x2bf9f8[_0x20c8d1(0x161)]['notify_on']),_0x2bf9f8['notification'][_0x20c8d1(0x128)]&&(_0x317b8a[_0x20c8d1(0x15e)]=_0x2bf9f8['notification']['email_recipients'][_0x20c8d1(0x11e)](_0x58b326=>{const _0x224936=_0x20c8d1,_0x22d60a=Number(_0x58b326);if(!isNaN(_0x22d60a)&&String(_0x22d60a)===_0x58b326)return _0x22d60a;const _0xf1cc85=_0x34a642?.['get'](_0x58b326[_0x224936(0x120)]());if(_0xf1cc85===undefined)throw new SDKError(ErrorCode[_0x224936(0x126)],_0x224936(0x134)+_0x58b326+_0x224936(0x130));return _0xf1cc85;})));if(_0x2bf9f8[_0x20c8d1(0x174)]){const _0x5d27cd=_0x2d43aa?.[_0x20c8d1(0x127)]?.[_0x20c8d1(0xf6)](_0x277459);if(_0x5d27cd&&_0x2d43aa?.[_0x20c8d1(0x146)])try{const _0x3d0bda=await _0x2d43aa[_0x20c8d1(0x146)](_0x5d27cd),_0x231a06=validateConnectorConfig(_0x2bf9f8['connector_config'],_0x3d0bda);if(!_0x231a06[_0x20c8d1(0x15f)])throw new SDKError(ErrorCode[_0x20c8d1(0x159)],_0x20c8d1(0x112)+_0x2bf9f8['name']+_0x20c8d1(0xe3)+formatValidationErrors(_0x231a06[_0x20c8d1(0x151)]),undefined,{'helpText':_0x20c8d1(0xf7)+_0x5d27cd+_0x20c8d1(0xf8)+formatSchemaAsHelp(_0x3d0bda)});if(_0x231a06[_0x20c8d1(0x11c)][_0x20c8d1(0x163)]>0x0){const _0x2f1ea1=formatValidationWarnings(_0x231a06[_0x20c8d1(0x11c)]);console[_0x20c8d1(0x135)](_0x20c8d1(0x12b)+_0x2bf9f8['name']+'\x22:\x0a'+_0x2f1ea1);}_0x317b8a[_0x20c8d1(0x167)]=transformConfigToLegacy(_0x2bf9f8[_0x20c8d1(0x174)],_0x3d0bda);}catch(_0x4d8c03){if(_0x4d8c03 instanceof SDKError&&_0x4d8c03[_0x20c8d1(0xe1)]===ErrorCode[_0x20c8d1(0xf2)])_0x317b8a[_0x20c8d1(0x167)]=_0x2bf9f8[_0x20c8d1(0x174)];else throw _0x4d8c03;}else _0x317b8a[_0x20c8d1(0x167)]=_0x2bf9f8['connector_config'];}_0x2bf9f8['activation_template_id']!==undefined&&(_0x317b8a['activationTemplateId']=_0x2bf9f8[_0x20c8d1(0x150)]);if(_0x2bf9f8['behavior']){const _0x55bd89=_0x2bf9f8[_0x20c8d1(0xf3)],_0x3a5469={};if(_0x55bd89['columns']&&_0x55bd89[_0x20c8d1(0x107)]['length']>0x0){const _0x11436a=_0x55bd89['columns'][_0x20c8d1(0x11f)](_0x2bbec9=>_0x2bbec9&&_0x2bbec9['name']);_0x11436a[_0x20c8d1(0x163)]>0x0&&(_0x3a5469['columns']=_0x11436a);}_0x55bd89[_0x20c8d1(0xff)]&&(_0x3a5469[_0x20c8d1(0x147)]=_0x55bd89[_0x20c8d1(0xff)]),_0x55bd89[_0x20c8d1(0x118)]!==undefined&&(_0x3a5469['joinRow']=_0x55bd89[_0x20c8d1(0x118)]),_0x55bd89[_0x20c8d1(0x114)]&&(_0x3a5469['joinStrategy']=_0x55bd89['join_strategy']),_0x55bd89[_0x20c8d1(0xee)]&&(_0x3a5469['formatting']=_0x55bd89[_0x20c8d1(0xee)]),_0x55bd89[_0x20c8d1(0x168)]&&(_0x3a5469['orderBy']=_0x55bd89['order_by']),_0x317b8a[_0x20c8d1(0x12c)]=_0x3a5469;}return _0x317b8a;}export async function activationDefToUpdateRequest(_0x1a558c,_0x1e62ed){return activationDefToCreateRequest(_0x1a558c,_0x1e62ed);}export function deepSortObject(_0x5d86fb){const _0xb94ae4=a132_0x42a3;if(_0x5d86fb===null||typeof _0x5d86fb!==_0xb94ae4(0x119))return _0x5d86fb;if(Array[_0xb94ae4(0x111)](_0x5d86fb))return _0x5d86fb['map'](deepSortObject)[_0xb94ae4(0xe0)]((_0x2244b7,_0x81a9fa)=>JSON[_0xb94ae4(0x141)](_0x2244b7)[_0xb94ae4(0xe6)](JSON['stringify'](_0x81a9fa)));const _0x4918b4={};for(const _0x5c5ab3 of Object['keys'](_0x5d86fb)[_0xb94ae4(0xe0)]()){_0x4918b4[_0x5c5ab3]=deepSortObject(_0x5d86fb[_0x5c5ab3]);}return _0x4918b4;}export function serializeRule(_0x844951){return JSON['stringify'](deepSortObject(_0x844951));}export function normalizeRuleForMatching(_0x158bd6){return normalizeConditionsForMatching(_0x158bd6);}function normalizeConditionsForMatching(_0x22c51f){const _0x56123f=a132_0x42a3;if(_0x22c51f===null||typeof _0x22c51f!=='object')return _0x22c51f;if(Array[_0x56123f(0x111)](_0x22c51f))return _0x22c51f[_0x56123f(0x11e)](normalizeConditionsForMatching);const _0x43240a=_0x22c51f;if((_0x43240a[_0x56123f(0x17a)]===_0x56123f(0x102)||_0x43240a['type']==='exclude')&&typeof _0x43240a[_0x56123f(0xdf)]===_0x56123f(0x122))return{..._0x43240a,'segment':_0x56123f(0x124)};const _0x19e4ab={};for(const _0x326534 of Object[_0x56123f(0x13d)](_0x43240a)){_0x19e4ab[_0x326534]=normalizeConditionsForMatching(_0x43240a[_0x326534]);}return _0x19e4ab;}export function serializeRuleForMatching(_0x561755){const _0x598d40=a132_0x42a3;return JSON[_0x598d40(0x141)](deepSortObject(normalizeRuleForMatching(_0x561755)));}export function expandSegmentReferences(_0x26ed20,_0x4b6e98,_0xc1052a=new Set()){return expandConditions(_0x26ed20,_0x4b6e98,_0xc1052a);}function expandConditions(_0x59f7fe,_0x31553b,_0x599a50){const _0xb3b4c4=a132_0x42a3;if(_0x59f7fe===null||typeof _0x59f7fe!==_0xb3b4c4(0x119))return _0x59f7fe;if(Array[_0xb3b4c4(0x111)](_0x59f7fe))return _0x59f7fe[_0xb3b4c4(0x11e)](_0x4acf1a=>expandConditions(_0x4acf1a,_0x31553b,_0x599a50));const _0x549154=_0x59f7fe;if((_0x549154[_0xb3b4c4(0x17a)]===_0xb3b4c4(0x102)||_0x549154[_0xb3b4c4(0x17a)]===_0xb3b4c4(0x13f))&&typeof _0x549154[_0xb3b4c4(0xdf)]===_0xb3b4c4(0x122)){const _0x1c08e4=_0x549154[_0xb3b4c4(0xdf)],_0xe4bcd3=_0x31553b[_0xb3b4c4(0xf6)](_0x1c08e4);if(_0xe4bcd3&&!_0x599a50['has'](_0x1c08e4)){const _0x2235a6=new Set(_0x599a50);_0x2235a6['add'](_0x1c08e4);const _0x364bf3=expandConditions(_0xe4bcd3,_0x31553b,_0x2235a6);return{'type':_0x549154[_0xb3b4c4(0x17a)],'expanded_rule':_0x364bf3};}return{'type':_0x549154[_0xb3b4c4(0x17a)],'expanded_rule':_0xb3b4c4(0x158)};}const _0x3eea75={};for(const _0x427631 of Object['keys'](_0x549154)){_0x3eea75[_0x427631]=expandConditions(_0x549154[_0x427631],_0x31553b,_0x599a50);}return _0x3eea75;}export function serializeExpandedRule(_0x47ad46,_0x4e9c62){const _0x56547f=a132_0x42a3,_0x402e7f=expandSegmentReferences(_0x47ad46,_0x4e9c62);return JSON[_0x56547f(0x141)](deepSortObject(_0x402e7f));}export function createSegmentNameContext(_0x2f2af4){const _0x5dbd57=a132_0x42a3,_0x5994b2=new Set(),_0x550ba6=new Map(),_0xf59657=new Map();if(_0x2f2af4)for(const [_0x567b3d,_0x41c231]of Object['entries'](_0x2f2af4)){if(_0x41c231[_0x5dbd57(0x143)]){const _0x5903b1=serializeRule(_0x41c231[_0x5dbd57(0x143)]);_0xf59657[_0x5dbd57(0x109)](_0x5903b1,_0x567b3d),_0x5994b2['add'](_0x567b3d);}}return{'usedNames':_0x5994b2,'ruleHashToName':_0x550ba6,'localRuleToName':_0x2f2af4?_0xf59657:undefined};}export function resolveSegmentName(_0x481449,_0x48e0ae,_0x45ae5d,_0x2b9cd0){const _0x2a355d=a132_0x42a3,_0xde6f2f=serializeRule(_0x48e0ae);if(_0x45ae5d[_0x2a355d(0xde)]){const _0xc70307=_0x45ae5d[_0x2a355d(0xde)][_0x2a355d(0xf6)](_0xde6f2f);if(_0xc70307)return{'name':_0xc70307,'isDuplicate':![],'isLocalMatch':!![]};}const _0x464ab3=_0x45ae5d[_0x2a355d(0x12f)][_0x2a355d(0xf6)](_0xde6f2f);if(_0x464ab3)return{'name':_0x464ab3,'isDuplicate':!![],'isLocalMatch':![]};const _0x320baa=_0x2b9cd0(_0x481449);let _0x43f72e=_0x320baa||_0x481449,_0x4d39a3=_0x43f72e,_0x1b805f=0x2;while(_0x45ae5d[_0x2a355d(0x153)][_0x2a355d(0x14d)](_0x4d39a3)){_0x4d39a3=_0x43f72e+'_'+_0x1b805f,_0x1b805f++;}return _0x45ae5d[_0x2a355d(0x153)]['add'](_0x4d39a3),_0x45ae5d['ruleHashToName']['set'](_0xde6f2f,_0x4d39a3),{'name':_0x4d39a3,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x33da0f){const _0x50d703=[],_0x960d09=_0x44ea4e=>{const _0x3e0784=a132_0x42a3;if(!_0x44ea4e||typeof _0x44ea4e!==_0x3e0784(0x119))return;if(Array[_0x3e0784(0x111)](_0x44ea4e)){_0x44ea4e[_0x3e0784(0x10d)](_0x960d09);return;}const _0x1fa344=_0x44ea4e;(_0x1fa344[_0x3e0784(0x17a)]==='include'||_0x1fa344[_0x3e0784(0x17a)]===_0x3e0784(0x13f))&&typeof _0x1fa344[_0x3e0784(0xdf)]==='string'&&_0x50d703[_0x3e0784(0x166)](_0x1fa344[_0x3e0784(0xdf)]);for(const _0x2fffdc of Object[_0x3e0784(0x142)](_0x1fa344)){_0x960d09(_0x2fffdc);}};return _0x960d09(_0x33da0f),_0x50d703;}export function validateSegmentRule(_0x25358c,_0x5915cc){const _0x27bc26=a132_0x42a3;if(!_0x5915cc||!_0x5915cc[_0x27bc26(0x137)])return;for(let _0x5e02a4=0x0;_0x5e02a4<_0x5915cc[_0x27bc26(0x137)][_0x27bc26(0x163)];_0x5e02a4++){const _0x1bc0e3=_0x5915cc['conditions'][_0x5e02a4];if('type'in _0x1bc0e3&&_0x1bc0e3[_0x27bc26(0x17a)]===_0x27bc26(0x155)){const _0x3fb43b=_0x1bc0e3,_0x2a50ca=_0x3fb43b['source']||_0x3fb43b[_0x27bc26(0x101)];if((!_0x3fb43b[_0x27bc26(0x113)]||_0x3fb43b[_0x27bc26(0x113)]==='')&&!_0x2a50ca)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x27bc26(0xfb)+_0x25358c+_0x27bc26(0xe8)+(_0x27bc26(0x17e)+_0x5e02a4+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x27bc26(0x105));}}}
|
|
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));}}}
|