@treasuredata/tdx 2026.3.20 → 2026.3.21
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- 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.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- 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 a133_0x2d29(){const _0x514921=['column_name','cyan','data','entries','query','set','size','Attributes','extra','error','columns','fields','some','setJobId','behavior','matrixTableName','localeCompare','298880IDGFLd','2128176ojRJWY','varchar','Unknown','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','column_type','bold','parentTableName','1604490mXhtmQ','Behaviors','1074iiHvay','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','push','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','displayName','filter','execute','Schema\x20query:\x0a','slice','4235yZGDdS','attribute','source','1565721ZPbYYD','name','dim','SELECT\x20*\x20FROM\x20(\x0a','8CFZSBV','379799HCUbnF','543065uktxEX','key','sort','tableName','matrixColumnName','behaviorName','length','get','type','groupingName','information_schema','null','parentColumn','verbose','default'];a133_0x2d29=function(){return _0x514921;};return a133_0x2d29();}(function(_0x1e8f53,_0x3fe4aa){const _0x52e710=a133_0x4264,_0x5560ee=_0x1e8f53();while(!![]){try{const _0x286f02=-parseInt(_0x52e710(0x113))/0x1+parseInt(_0x52e710(0xf7))/0x2+parseInt(_0x52e710(0xff))/0x3+parseInt(_0x52e710(0xf8))/0x4+-parseInt(_0x52e710(0x10a))/0x5*(parseInt(_0x52e710(0x101))/0x6)+-parseInt(_0x52e710(0x112))/0x7+-parseInt(_0x52e710(0x111))/0x8*(parseInt(_0x52e710(0x10d))/0x9);if(_0x286f02===_0x3fe4aa)break;else _0x5560ee['push'](_0x5560ee['shift']());}catch(_0x30f8d9){_0x5560ee['push'](_0x5560ee['shift']());}}}(a133_0x2d29,0x47a22));import a133_0xfcf1e6 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x53deef){const _0xf59503=a133_0x4264,_0x35534a=_0x53deef[_0xf59503(0xf0)]['map'](_0x2eb42d=>({'column_name':_0x2eb42d['name'],'column_type':_0x2eb42d['type'],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x53deef,'columns':[{'name':_0xf59503(0xe6),'type':_0xf59503(0xf9)},{'name':_0xf59503(0xfc),'type':_0xf59503(0xf9)},{'name':_0xf59503(0xe2),'type':'varchar'},{'name':_0xf59503(0x114),'type':_0xf59503(0xf9)},{'name':_0xf59503(0xe5),'type':_0xf59503(0xf9)},{'name':_0xf59503(0xee),'type':_0xf59503(0xf9)}],'data':_0x35534a};}export async function executeSchemaQuery(_0x52a3f7,_0x42403e,_0x1732f1){const _0x1f69f5=a133_0x4264,_0x443654=_0x52a3f7['trim']()['replace'](/;+$/,''),_0x212f95=_0x1f69f5(0x110)+_0x443654+_0x1f69f5(0x102);_0x1732f1[_0x1f69f5(0xe4)]&&console[_0x1f69f5(0xef)](_0x1f69f5(0x108)+_0x212f95);const _0xcf4c81=await withProgressSpinner('Fetching\x20schema...',async _0x370231=>{const _0x1f5e00=_0x1f69f5,_0x2f071f=await _0x42403e[_0x1f5e00(0xea)][_0x1f5e00(0x107)](_0x212f95,{'catalog':'td','schema':_0x1f5e00(0xe1),'onJobId':_0x31fd8b=>{const _0x25c54a=_0x1f5e00;_0x370231[_0x25c54a(0xf3)](_0x31fd8b);}});return _0x2f071f;},{'verbose':_0x1732f1[_0x1f69f5(0xe4)]});return buildSchemaResult(_0xcf4c81[_0x1f69f5(0xe8)]);}function columnName(_0x1fc9a7){const _0x56c6b8=a133_0x4264;return _0x1fc9a7[_0x56c6b8(0x117)]||_0x1fc9a7[_0x56c6b8(0xe3)]||_0x1fc9a7[_0x56c6b8(0x10e)];}function formatFieldLine(_0x10c2ac,_0x2119da,_0x56f4dd){const _0x2cc53c=a133_0x4264,_0x1f40a3=_0x10c2ac!==_0x2119da?'\x20'+a133_0xfcf1e6['dim']('('+_0x2119da+')'):'';return'\x20\x20\x20\x20'+_0x10c2ac+_0x1f40a3+':\x20'+a133_0xfcf1e6[_0x2cc53c(0xe7)](_0x56f4dd);}function sortByColumnName(_0x235759){const _0x140353=a133_0x4264;return[..._0x235759][_0x140353(0x115)]((_0x3bc0c6,_0x4e99bb)=>columnName(_0x3bc0c6)[_0x140353(0xf6)](columnName(_0x4e99bb)));}function a133_0x4264(_0x1604cb,_0x6e118c){_0x1604cb=_0x1604cb-0xe1;const _0x2d29bb=a133_0x2d29();let _0x426445=_0x2d29bb[_0x1604cb];return _0x426445;}export function displayFieldsHumanReadable(_0x28ade1,_0x1b7b5c){const _0x2f0038=a133_0x4264,_0x27612c=_0x28ade1[_0x2f0038(0x106)](_0x59ebff=>_0x59ebff[_0x2f0038(0x10c)]===_0x2f0038(0x10b)),_0x261dc6=_0x28ade1['filter'](_0x1fdc0=>_0x1fdc0[_0x2f0038(0x10c)]===_0x2f0038(0xf4)),_0x15fa4d=new Map();for(const _0x3e2098 of _0x27612c){const _0x3ea49f=_0x3e2098[_0x2f0038(0x11c)]||_0x3e2098[_0x2f0038(0xfe)]||_0x2f0038(0xfa),_0x2de2ea=_0x15fa4d['get'](_0x3ea49f);_0x2de2ea?_0x2de2ea[_0x2f0038(0xf1)][_0x2f0038(0x103)](_0x3e2098):_0x15fa4d[_0x2f0038(0xeb)](_0x3ea49f,{'displayName':_0x3ea49f,'tableName':_0x3e2098[_0x2f0038(0xfe)],'fields':[_0x3e2098]});}const _0x167c18=new Map();for(const _0x5ccc69 of _0x261dc6){const _0x5d52d8=_0x5ccc69[_0x2f0038(0x118)]||'Unknown',_0x35919d=_0x167c18[_0x2f0038(0x11a)](_0x5d52d8)||[];_0x35919d[_0x2f0038(0x103)](_0x5ccc69),_0x167c18['set'](_0x5d52d8,_0x35919d);}console[_0x2f0038(0xef)]('\x0a'+a133_0xfcf1e6['bold'](_0x1b7b5c));if(_0x15fa4d[_0x2f0038(0xec)]>0x0){console[_0x2f0038(0xef)]('\x0a'+a133_0xfcf1e6[_0x2f0038(0x10f)](_0x2f0038(0xed)));const _0x42e219=[..._0x15fa4d[_0x2f0038(0xe9)]()][_0x2f0038(0x115)]((_0x22de1d,_0x214c1c)=>_0x22de1d[0x0][_0x2f0038(0xf6)](_0x214c1c[0x0]));for(const [,_0x8016c2]of _0x42e219){const _0x3887e8=_0x8016c2['tableName']&&_0x8016c2[_0x2f0038(0x116)]!==_0x8016c2[_0x2f0038(0x105)]?'\x20'+a133_0xfcf1e6['dim']('('+_0x8016c2[_0x2f0038(0x116)]+')'):'';console[_0x2f0038(0xef)]('\x20\x20'+a133_0xfcf1e6[_0x2f0038(0xfd)](_0x8016c2[_0x2f0038(0x105)])+_0x3887e8);for(const _0x2f8463 of sortByColumnName(_0x8016c2[_0x2f0038(0xf1)])){console[_0x2f0038(0xef)](formatFieldLine(columnName(_0x2f8463),_0x2f8463[_0x2f0038(0x10e)],_0x2f8463['type']));}}}if(_0x167c18[_0x2f0038(0xec)]>0x0){console[_0x2f0038(0xef)]('\x0a'+a133_0xfcf1e6[_0x2f0038(0x10f)](_0x2f0038(0x100)));const _0x4abd8b=[..._0x167c18['entries']()]['sort']((_0x42fcc5,_0x2d5760)=>_0x42fcc5[0x0][_0x2f0038(0xf6)](_0x2d5760[0x0]));for(const [_0x3f876f,_0x14a2a0]of _0x4abd8b){const _0xbb50=_0x14a2a0[0x0],_0x5775cb=_0xbb50?.[_0x2f0038(0xf5)];if(_0x5775cb){const _0x447cf7=_0x5775cb!==_0x3f876f?'\x20'+a133_0xfcf1e6[_0x2f0038(0x10f)]('('+_0x3f876f+')'):'';console['error']('\x20\x20'+a133_0xfcf1e6[_0x2f0038(0xfd)](_0x5775cb)+_0x447cf7);}else{const _0x1220ca=_0xbb50?.['parentTableName']||'';console[_0x2f0038(0xef)]('\x20\x20'+a133_0xfcf1e6[_0x2f0038(0xfd)](_0x3f876f)+(_0x1220ca?'\x20'+a133_0xfcf1e6['dim']('('+_0x1220ca+')'):''));}for(const _0x1ce0c1 of sortByColumnName(_0x14a2a0)){const _0x3661d4=_0x1ce0c1[_0x2f0038(0x10e)]['startsWith'](_0x3f876f+'.')?_0x1ce0c1[_0x2f0038(0x10e)][_0x2f0038(0x109)](_0x3f876f[_0x2f0038(0x119)]+0x1):_0x1ce0c1[_0x2f0038(0x10e)];console[_0x2f0038(0xef)](formatFieldLine(columnName(_0x1ce0c1),_0x3661d4,_0x1ce0c1[_0x2f0038(0x11b)]));}}}const _0x5527c2=_0x28ade1[_0x2f0038(0xf2)](_0x3ce2d6=>_0x3ce2d6[_0x2f0038(0x117)]||_0x3ce2d6['matrixTableName']);_0x5527c2&&(console[_0x2f0038(0xef)]('\x0a'+a133_0xfcf1e6[_0x2f0038(0x10f)](_0x2f0038(0x104))),console[_0x2f0038(0xef)](a133_0xfcf1e6[_0x2f0038(0x10f)](_0x2f0038(0xfb)))),console['error']('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a134_0x1b73(){const _0x27ae46=['42sXxmAc','231136jyaHNt','182089kFbJtl','relative','isFile','isDirectory','387904ZTPLgK','132822WlLoKJ','endsWith','map','.yaml','258046bIjJvd','name','toLowerCase','263103eMFabQ','dirname','140765TEsyBD','join','.yml','extname'];a134_0x1b73=function(){return _0x27ae46;};return a134_0x1b73();}(function(_0x4ba18d,_0x4f8abf){const _0x3dddc6=a134_0x3652,_0x55bf23=_0x4ba18d();while(!![]){try{const _0x51c074=parseInt(_0x3dddc6(0xe8))/0x1+-parseInt(_0x3dddc6(0xdd))/0x2+-parseInt(_0x3dddc6(0xe0))/0x3+parseInt(_0x3dddc6(0xd8))/0x4+-parseInt(_0x3dddc6(0xe2))/0x5+-parseInt(_0x3dddc6(0xd9))/0x6*(-parseInt(_0x3dddc6(0xe6))/0x7)+-parseInt(_0x3dddc6(0xe7))/0x8;if(_0x51c074===_0x4f8abf)break;else _0x55bf23['push'](_0x55bf23['shift']());}catch(_0x84e540){_0x55bf23['push'](_0x55bf23['shift']());}}}(a134_0x1b73,0x21b86));import{readdirSync,statSync}from'fs';import a134_0x5ab5b2 from'path';function a134_0x3652(_0x4cb388,_0x340dc5){_0x4cb388=_0x4cb388-0xd6;const _0x1b73e8=a134_0x1b73();let _0x3652cc=_0x1b73e8[_0x4cb388];return _0x3652cc;}export function findYamlFiles(_0x23fcfc){const _0x36ade3=[];function _0x1a91ec(_0xcc189a){const _0x56325a=a134_0x3652,_0x214c14=readdirSync(_0xcc189a,{'withFileTypes':!![]});for(const _0x357782 of _0x214c14){const _0x36a92e=a134_0x5ab5b2[_0x56325a(0xe3)](_0xcc189a,_0x357782[_0x56325a(0xde)]);if(_0x357782[_0x56325a(0xd7)]())_0x1a91ec(_0x36a92e);else(_0x357782[_0x56325a(0xde)][_0x56325a(0xda)](_0x56325a(0xe4))||_0x357782[_0x56325a(0xde)]['endsWith'](_0x56325a(0xdc)))&&_0x36ade3['push'](_0x36a92e);}}return _0x1a91ec(_0x23fcfc),_0x36ade3;}export function discoverYamlFiles(_0x3f7da5){const _0x3c54f8=a134_0x3652,_0x4520cc=findYamlFiles(_0x3f7da5);return _0x4520cc[_0x3c54f8(0xdb)](_0x4fdf40=>{const _0x2b17e7=_0x3c54f8,_0x15fb41=a134_0x5ab5b2[_0x2b17e7(0xe9)](_0x3f7da5,_0x4fdf40),_0x3a7022=a134_0x5ab5b2[_0x2b17e7(0xe1)](_0x15fb41);return{'absolutePath':_0x4fdf40,'relativePath':_0x15fb41,'folderPath':_0x3a7022==='.'?'':_0x3a7022};});}export function isYamlFile(_0xf1f4ee){const _0x1164d8=a134_0x3652;try{const _0x3f173c=statSync(_0xf1f4ee);if(!_0x3f173c[_0x1164d8(0xd6)]())return![];const _0x1c4ed2=a134_0x5ab5b2[_0x1164d8(0xe5)](_0xf1f4ee)[_0x1164d8(0xdf)]();return _0x1c4ed2===_0x1164d8(0xe4)||_0x1c4ed2===_0x1164d8(0xdc);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3b8e2b,_0x3eda9b){const _0x1d95bf=a133_0x2249,_0x4817bf=_0x3b8e2b();while(!![]){try{const _0x51f10f=parseInt(_0x1d95bf(0x1b4))/0x1+parseInt(_0x1d95bf(0x1a7))/0x2*(parseInt(_0x1d95bf(0x179))/0x3)+-parseInt(_0x1d95bf(0x1b6))/0x4+-parseInt(_0x1d95bf(0x18b))/0x5*(-parseInt(_0x1d95bf(0x199))/0x6)+-parseInt(_0x1d95bf(0x1a0))/0x7*(-parseInt(_0x1d95bf(0x1b2))/0x8)+-parseInt(_0x1d95bf(0x173))/0x9*(-parseInt(_0x1d95bf(0x1bf))/0xa)+-parseInt(_0x1d95bf(0x181))/0xb;if(_0x51f10f===_0x3eda9b)break;else _0x4817bf['push'](_0x4817bf['shift']());}catch(_0x21fe70){_0x4817bf['push'](_0x4817bf['shift']());}}}(a133_0x596f,0xc697f));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x2cf628){const _0x217bab=a133_0x2249;return _0x2cf628[_0x217bab(0x1b0)]()[_0x217bab(0x188)](/\s+/g,'_')[_0x217bab(0x188)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x341458){const _0x54d166=a133_0x2249,_0x4976d4=_0x341458[_0x54d166(0x19d)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4976d4){const _0x5ed384=_0x4976d4[0x1]['toLowerCase'](),_0x54413c=_0x4976d4[0x2],_0x216cec=_0x54413c[_0x54d166(0x188)](/-/g,'')['slice'](0x0,0x4)[_0x54d166(0x1b0)]();return _0x5ed384+'_'+_0x216cec;}const _0x1c4d0a=_0x341458[_0x54d166(0x19d)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1c4d0a){const _0x11df0d=_0x1c4d0a[0x1],_0x596489=_0x1c4d0a[0x2][_0x54d166(0x1b0)](),_0x4c6aec=_0x11df0d['replace'](/-/g,'')[_0x54d166(0x17d)](0x0,0x4)[_0x54d166(0x1b0)]();return _0x596489+'_'+_0x4c6aec;}return undefined;}function stableStringify(_0x3a0bec){const _0x3240cb=a133_0x2249;if(Array[_0x3240cb(0x193)](_0x3a0bec))return'['+_0x3a0bec[_0x3240cb(0x174)](_0x4f6d1d=>stableStringify(_0x4f6d1d))[_0x3240cb(0x1ae)](',')+']';if(_0x3a0bec&&typeof _0x3a0bec===_0x3240cb(0x1b3)){const _0x2a27d0=_0x3a0bec,_0x268501=Object['keys'](_0x2a27d0)[_0x3240cb(0x176)](),_0x591405=_0x268501[_0x3240cb(0x174)](_0x354299=>'\x22'+_0x354299+'\x22:'+stableStringify(_0x2a27d0[_0x354299]));return'{'+_0x591405['join'](',')+'}';}const _0x2f0026=JSON[_0x3240cb(0x1ab)](_0x3a0bec);return _0x2f0026===undefined?_0x3240cb(0x195):_0x2f0026;}export function consolidateActivationsByContent(_0x4b52ef){const _0x34d392=a133_0x2249,_0xa4008d={},_0x4334dc=new Map(),_0x5a1adb=new Map();for(const _0x487006 of _0x4b52ef){if(!_0x487006)continue;for(const [_0x698e01,_0x429ee1]of Object[_0x34d392(0x17c)](_0x487006)){const _0x162e9c={'name':_0x429ee1[_0x34d392(0x18d)],'connection':_0x429ee1[_0x34d392(0x1af)],..._0x429ee1[_0x34d392(0x175)]!==undefined&&{'all_columns':_0x429ee1[_0x34d392(0x175)]},..._0x429ee1['columns']!==undefined&&{'columns':_0x429ee1['columns']},..._0x429ee1[_0x34d392(0x190)]!==undefined&&{'behavior':_0x429ee1[_0x34d392(0x190)]},..._0x429ee1[_0x34d392(0x19f)]!==undefined&&{'schedule':_0x429ee1[_0x34d392(0x19f)]},..._0x429ee1[_0x34d392(0x198)]!==undefined&&{'notification':_0x429ee1[_0x34d392(0x198)]},..._0x429ee1['connector_config']!==undefined&&{'connector_config':_0x429ee1[_0x34d392(0x1a9)]},..._0x429ee1[_0x34d392(0x191)]!==undefined&&{'activation_template_id':_0x429ee1[_0x34d392(0x191)]}},_0x5e4a8a=stableStringify(_0x162e9c),_0x22b02e=_0x5a1adb[_0x34d392(0x1c0)](_0x5e4a8a);_0x22b02e?_0x4334dc[_0x34d392(0x1bd)](_0x698e01,_0x22b02e):(_0xa4008d[_0x698e01]=_0x429ee1,_0x4334dc[_0x34d392(0x1bd)](_0x698e01,_0x698e01),_0x5a1adb['set'](_0x5e4a8a,_0x698e01));}}return{'merged':_0xa4008d,'nameMapping':_0x4334dc};}function a133_0x596f(){const _0x150587=['version_number','null','with','trim','notification','1819128rnCSuU','item','bundle_name','endsWith','match','some','schedule','4270AgRjOO','segments','merged','rule','activation','exit_criteria','type','6058rkLiVs','.yml','connector_config','exclude','stringify','index','journeys','join','connection','toLowerCase','journeyBundleName','11920DkfXbr','object','1590909iDjVSt','keys','6177656aqSehd','journey','journeyStages','condition','launched','length','has','set','stages','54010eNBxBD','get','push','version','1440PtHiuL','map','all_columns','sort','conditions','branches','192JiWrie','activations','steps','entries','slice','versions','attributes','segment','26539964ZNGiCZ','goal','startsWith','entry_criteria','from','bundle_id','values','replace','decision_point','milestone','20jJowVZ','yaml','name','description','include','behavior','activation_template_id','string','isArray'];a133_0x596f=function(){return _0x150587;};return a133_0x596f();}export function updateActivationReferences(_0x1df528,_0x55c078){const _0x3b0bf2=a133_0x2249;if(!_0x1df528)return;for(const _0x8ed417 of _0x1df528){if(!_0x8ed417[_0x3b0bf2(0x17b)])continue;for(const _0x118f23 of _0x8ed417['steps']){if(_0x118f23[_0x3b0bf2(0x1a6)]==='activation'&&_0x118f23[_0x3b0bf2(0x196)]?.[_0x3b0bf2(0x1a4)]){const _0xa011d0=_0x55c078[_0x3b0bf2(0x1c0)](_0x118f23[_0x3b0bf2(0x196)][_0x3b0bf2(0x1a4)]);_0xa011d0&&_0xa011d0!==_0x118f23[_0x3b0bf2(0x196)][_0x3b0bf2(0x1a4)]&&(_0x118f23[_0x3b0bf2(0x196)][_0x3b0bf2(0x1a4)]=_0xa011d0);}}}}function a133_0x2249(_0x513d06,_0x5b5d67){_0x513d06=_0x513d06-0x172;const _0x596f63=a133_0x596f();let _0x224982=_0x596f63[_0x513d06];return _0x224982;}export function consolidateSegmentsByContent(_0x3e2162,_0x549da6){const _0x4c7359=a133_0x2249,_0xc66a46={},_0x3ef6c5=new Map(),_0x450da3=new Map();for(const _0x36568b of _0x3e2162){if(!_0x36568b)continue;for(const [_0x20bb30,_0x2b4a50]of Object[_0x4c7359(0x17c)](_0x36568b)){if(!_0x2b4a50['rule']){_0xc66a46[_0x20bb30]=_0x2b4a50,_0x3ef6c5[_0x4c7359(0x1bd)](_0x20bb30,_0x20bb30);continue;}const _0xdb9abb=_0x2b4a50[_0x4c7359(0x18e)]&&_0x2b4a50[_0x4c7359(0x18e)][_0x4c7359(0x197)]()?_0x2b4a50[_0x4c7359(0x18e)]:undefined,_0x574e1a=JSON[_0x4c7359(0x1ab)]({'description':_0xdb9abb,'rule':deepSortObject(_0x2b4a50[_0x4c7359(0x1a3)])}),_0x42bfdd=_0x450da3[_0x4c7359(0x1c0)](_0x574e1a);if(_0x42bfdd){const _0x4351ca={..._0x2b4a50[_0x4c7359(0x18e)]!==undefined&&{'description':_0x2b4a50[_0x4c7359(0x18e)]},'rule':_0x2b4a50[_0x4c7359(0x1a3)]?deepSortObject(_0x2b4a50['rule']):_0x2b4a50['rule']};if(_0x20bb30<_0x42bfdd){_0xc66a46[_0x20bb30]=_0x4351ca,delete _0xc66a46[_0x42bfdd];for(const [_0x56cf08,_0x50fa00]of _0x3ef6c5[_0x4c7359(0x17c)]()){_0x50fa00===_0x42bfdd&&_0x3ef6c5[_0x4c7359(0x1bd)](_0x56cf08,_0x20bb30);}_0x3ef6c5[_0x4c7359(0x1bd)](_0x20bb30,_0x20bb30),_0x450da3[_0x4c7359(0x1bd)](_0x574e1a,_0x20bb30);}else _0xc66a46[_0x42bfdd]=_0x4351ca,_0x3ef6c5[_0x4c7359(0x1bd)](_0x20bb30,_0x42bfdd);}else{let _0x5a867b=_0x20bb30;if(_0x549da6){const _0x4e7eab=_0x549da6['get'](_0x574e1a);_0x4e7eab&&_0x4e7eab[_0x4c7359(0x1bb)]>0x0&&(_0x5a867b=_0x4e7eab[_0x4c7359(0x17d)]()[_0x4c7359(0x176)]()[0x0]);}const _0x55cb7c={..._0x2b4a50[_0x4c7359(0x18e)]!==undefined&&{'description':_0x2b4a50['description']},'rule':_0x2b4a50[_0x4c7359(0x1a3)]?deepSortObject(_0x2b4a50[_0x4c7359(0x1a3)]):_0x2b4a50[_0x4c7359(0x1a3)]};_0xc66a46[_0x5a867b]=_0x55cb7c,_0x3ef6c5['set'](_0x20bb30,_0x5a867b),_0x450da3[_0x4c7359(0x1bd)](_0x574e1a,_0x5a867b);}}}return{'merged':_0xc66a46,'nameMapping':_0x3ef6c5};}export function updateSegmentReferences(_0x405c7a,_0x3e6ba4){const _0x458377=a133_0x2249;if(!_0x405c7a)return;for(const _0x35e445 of _0x405c7a){if(_0x35e445[_0x458377(0x184)]?.[_0x458377(0x180)]){const _0x5aae1c=_0x3e6ba4[_0x458377(0x1c0)](_0x35e445[_0x458377(0x184)][_0x458377(0x180)]);_0x5aae1c&&(_0x35e445[_0x458377(0x184)][_0x458377(0x180)]=_0x5aae1c);}if(_0x35e445[_0x458377(0x1a5)])for(const _0x4ec5be of _0x35e445[_0x458377(0x1a5)]){if(_0x4ec5be['segment']){const _0x4794a1=_0x3e6ba4[_0x458377(0x1c0)](_0x4ec5be['segment']);_0x4794a1&&(_0x4ec5be[_0x458377(0x180)]=_0x4794a1);}}if(_0x35e445[_0x458377(0x18a)]?.[_0x458377(0x180)]){const _0x5aa88f=_0x3e6ba4[_0x458377(0x1c0)](_0x35e445[_0x458377(0x18a)][_0x458377(0x180)]);_0x5aa88f&&(_0x35e445[_0x458377(0x18a)][_0x458377(0x180)]=_0x5aa88f);}if(_0x35e445[_0x458377(0x17b)])for(const _0x24b538 of _0x35e445['steps']){if(_0x24b538['type']===_0x458377(0x189)&&_0x24b538['with']?.[_0x458377(0x178)])for(const _0x21d441 of _0x24b538[_0x458377(0x196)][_0x458377(0x178)]){if(_0x21d441[_0x458377(0x180)]){const _0x3cb653=_0x3e6ba4[_0x458377(0x1c0)](_0x21d441[_0x458377(0x180)]);_0x3cb653&&(_0x21d441['segment']=_0x3cb653);}}if(_0x24b538['type']==='wait'&&_0x24b538['with']?.['condition']?.[_0x458377(0x180)]){const _0x30e6ee=_0x3e6ba4[_0x458377(0x1c0)](_0x24b538[_0x458377(0x196)][_0x458377(0x1b9)][_0x458377(0x180)]);_0x30e6ee&&(_0x24b538[_0x458377(0x196)][_0x458377(0x1b9)][_0x458377(0x180)]=_0x30e6ee);}}}}export function updateSegmentRefsInSegments(_0xf9536b,_0x1b10fd){const _0x4fdb1b=a133_0x2249;for(const _0x5a745f of Object[_0x4fdb1b(0x187)](_0xf9536b)){_0x5a745f[_0x4fdb1b(0x1a3)]&&updateSegmentRefsInRule(_0x5a745f[_0x4fdb1b(0x1a3)],_0x1b10fd);}}function updateSegmentRefsInRule(_0x31a3b2,_0x2cc2b2){const _0x8edb7b=a133_0x2249;if(_0x31a3b2===null||typeof _0x31a3b2!==_0x8edb7b(0x1b3))return;if(Array[_0x8edb7b(0x193)](_0x31a3b2)){for(const _0x59470b of _0x31a3b2){updateSegmentRefsInRule(_0x59470b,_0x2cc2b2);}return;}const _0x2b9b21=_0x31a3b2;if((_0x2b9b21['type']===_0x8edb7b(0x18f)||_0x2b9b21[_0x8edb7b(0x1a6)]===_0x8edb7b(0x1aa))&&typeof _0x2b9b21[_0x8edb7b(0x180)]===_0x8edb7b(0x192)){const _0x482744=_0x2cc2b2[_0x8edb7b(0x1c0)](_0x2b9b21['segment']);_0x482744&&(_0x2b9b21[_0x8edb7b(0x180)]=_0x482744);}if(_0x2b9b21[_0x8edb7b(0x177)]&&Array[_0x8edb7b(0x193)](_0x2b9b21[_0x8edb7b(0x177)]))for(const _0x571dd7 of _0x2b9b21[_0x8edb7b(0x177)]){updateSegmentRefsInRule(_0x571dd7,_0x2cc2b2);}}export function buildJourneysArray(_0x1a16ce,_0x22f723){const _0x47c378=a133_0x2249;return _0x1a16ce[_0x47c378(0x174)](_0x3d4631=>{const _0x1b7457=_0x47c378,_0xe790c8=_0x22f723?_0x3d4631['item']['id']===_0x22f723:_0x1a16ce[_0x1b7457(0x1bb)]===0x1,_0x3c59ab=_0x3d4631[_0x1b7457(0x18c)][_0x1b7457(0x1ad)]?.[0x0],_0x49e58b=_0x3c59ab?.['goal']||_0x3d4631[_0x1b7457(0x18c)]['goal'],_0x52d72d={'version':_0x3c59ab?.[_0x1b7457(0x172)]||_0x3d4631[_0x1b7457(0x18c)][_0x1b7457(0x172)]||_0x3d4631[_0x1b7457(0x19a)][_0x1b7457(0x18d)],'state':_0x3d4631[_0x1b7457(0x19a)]['state']===_0x1b7457(0x1ba)?_0x1b7457(0x1ba):'draft','stages':_0x3c59ab?.[_0x1b7457(0x1be)]||_0x3d4631[_0x1b7457(0x18c)][_0x1b7457(0x1be)]||[],'id':_0x3c59ab?.['id']||_0x3d4631[_0x1b7457(0x18c)]['id'],'version_number':_0x3c59ab?.['version_number']||_0x3d4631[_0x1b7457(0x18c)][_0x1b7457(0x194)]};return _0x49e58b&&(_0x52d72d['goal']=_0x49e58b),_0xe790c8&&(_0x52d72d['latest']=!![]),_0x52d72d;});}export function buildMergedJourneyDef(_0x2f0cb2,_0x261d3c,_0x549b18){const _0x3508a6=a133_0x2249,_0x54df52=_0x2f0cb2[0x0][_0x3508a6(0x18c)],_0x45bfad=buildJourneysArray(_0x2f0cb2,_0x549b18),{merged:_0x2bd48e,nameMapping:_0x8fe607}=consolidateSegmentsByContent(_0x2f0cb2['map'](_0x7f6300=>_0x7f6300[_0x3508a6(0x18c)]['segments']),_0x261d3c);updateSegmentRefsInSegments(_0x2bd48e,_0x8fe607);const _0x3708bb=Array[_0x3508a6(0x185)](_0x8fe607['entries']())[_0x3508a6(0x19e)](([_0x2ea07d,_0x2ce4ac])=>_0x2ea07d!==_0x2ce4ac&&_0x2ea07d[_0x3508a6(0x183)](_0x3508a6(0x184)));let _0x4e539a=_0x2bd48e,_0x572bfe=new Map();if(_0x3708bb){const _0x5baf4f=consolidateSegmentsByContent([_0x2bd48e],_0x261d3c);_0x4e539a=_0x5baf4f[_0x3508a6(0x1a2)],_0x572bfe=_0x5baf4f['nameMapping'];}const _0x1b0605=new Map(_0x8fe607);for(const [_0x136995,_0x284a1a]of _0x572bfe[_0x3508a6(0x17c)]()){_0x1b0605[_0x3508a6(0x1bd)](_0x136995,_0x284a1a);}for(const [_0xa0137d,_0x6a6fdc]of _0x1b0605[_0x3508a6(0x17c)]()){let _0x17b517=_0x6a6fdc,_0x50e31e=0x0;while(_0x1b0605[_0x3508a6(0x1bc)](_0x17b517)&&_0x1b0605[_0x3508a6(0x1c0)](_0x17b517)!==_0x17b517&&_0x50e31e<MAX_MAPPING_CHAIN_DEPTH){_0x17b517=_0x1b0605['get'](_0x17b517),_0x50e31e++;}_0x17b517!==_0x6a6fdc&&_0x1b0605[_0x3508a6(0x1bd)](_0xa0137d,_0x17b517);}for(const _0x19774b of _0x45bfad){updateSegmentReferences(_0x19774b[_0x3508a6(0x1be)],_0x1b0605);}const {merged:_0x58a653,nameMapping:_0x2a37ad}=consolidateActivationsByContent(_0x2f0cb2[_0x3508a6(0x174)](_0x45f9e0=>_0x45f9e0['yaml'][_0x3508a6(0x17a)]));for(const _0x5da78d of _0x45bfad){updateActivationReferences(_0x5da78d[_0x3508a6(0x1be)],_0x2a37ad);}let _0x3e63d8=_0x54df52[_0x3508a6(0x182)];if(_0x3e63d8?.['segment']){const _0x597f18=_0x1b0605[_0x3508a6(0x1c0)](_0x3e63d8[_0x3508a6(0x180)]);_0x597f18&&(_0x3e63d8={..._0x3e63d8,'segment':_0x597f18});}for(const _0x1f9304 of _0x45bfad){if(_0x1f9304[_0x3508a6(0x182)]?.[_0x3508a6(0x180)]){const _0x2dad5e=_0x1b0605['get'](_0x1f9304[_0x3508a6(0x182)][_0x3508a6(0x180)]);_0x2dad5e&&(_0x1f9304[_0x3508a6(0x182)]={..._0x1f9304[_0x3508a6(0x182)],'segment':_0x2dad5e});}}return _0x45bfad[_0x3508a6(0x19e)](_0xd57959=>_0xd57959[_0x3508a6(0x182)])&&(_0x3e63d8=undefined),{'type':_0x3508a6(0x1b7),'name':_0x54df52[_0x3508a6(0x18d)],'description':_0x54df52['description'],'goal':_0x3e63d8,'reentry':_0x54df52['reentry'],'segments':Object[_0x3508a6(0x1b5)](_0x4e539a)[_0x3508a6(0x1bb)]>0x0?_0x4e539a:undefined,'activations':Object[_0x3508a6(0x1b5)](_0x58a653)['length']>0x0?_0x58a653:undefined,'journeys':_0x45bfad,'bundle_id':_0x54df52[_0x3508a6(0x186)],'bundle_name':_0x54df52[_0x3508a6(0x19b)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x21ffa8,_0x13a73b,_0x482e55,_0x5e2002){const _0x4fdaa2=a133_0x2249,_0x1107cd=_0x21ffa8+':'+_0x13a73b,_0x359273=_0x482e55[_0x4fdaa2(0x1c0)](_0x1107cd);if(_0x359273)return _0x359273;const _0x533160=await _0x5e2002(_0x21ffa8),_0x37b593=_0x533160[_0x4fdaa2(0x17f)][_0x4fdaa2(0x1b1)]||_0x533160[_0x4fdaa2(0x17f)]['name'],_0x3d63ca=_0x533160[_0x4fdaa2(0x17f)][_0x4fdaa2(0x1b8)]['find'](_0x349c72=>String(_0x349c72['id'])===String(_0x13a73b)),_0x577242=_0x3d63ca?.[_0x4fdaa2(0x18d)]||_0x13a73b,_0x48e1ab={'journeyName':_0x37b593,'stageName':_0x577242};return _0x482e55['set'](_0x1107cd,_0x48e1ab),_0x48e1ab;}export function formatApiJourneyName(_0x2696ea,_0xef9da0){return _0xef9da0+'\x20('+_0x2696ea+')';}export function isLocalJourneyRef(_0x5ee3db){const _0x1f3e75=a133_0x2249;return _0x5ee3db[_0x1f3e75(0x19c)](_0x1f3e75(0x1a8))||_0x5ee3db['endsWith']('.yaml');}export function buildLocalRuleToNameMapping(_0x21912a){const _0x2884e9=a133_0x2249,_0x519ec9=new Map();if(!_0x21912a)return _0x519ec9;for(const [_0x10fcf8,_0x6b287b]of Object['entries'](_0x21912a)){if(_0x6b287b[_0x2884e9(0x1a3)]){const _0x5b950d=serializeRule(_0x6b287b[_0x2884e9(0x1a3)]),_0x21b67c=_0x519ec9['get'](_0x5b950d)||[];_0x21b67c[_0x2884e9(0x1c1)](_0x10fcf8),_0x519ec9[_0x2884e9(0x1bd)](_0x5b950d,_0x21b67c);}}return _0x519ec9;}export function buildLocalRuleToNameMappingFromJourney(_0x1cb0d8){const _0x668d4a=a133_0x2249,_0x31bad6=_0x1cb0d8[_0x668d4a(0x1a1)];if(!_0x31bad6)return new Map();const _0x4f9948=collectSegmentUsageCounts(_0x1cb0d8),_0x2dd784=new Map();let _0x3ee0f7=0x0;for(const [_0x4758aa,_0x4eba28]of Object['entries'](_0x31bad6)){if(!_0x4eba28[_0x668d4a(0x1a3)]){_0x3ee0f7++;continue;}const _0x3caf35=serializeRule(_0x4eba28['rule']),_0x174cee=_0x2dd784[_0x668d4a(0x1c0)](_0x3caf35)||[];_0x174cee[_0x668d4a(0x1c1)]({'name':_0x4758aa,'index':_0x3ee0f7}),_0x2dd784[_0x668d4a(0x1bd)](_0x3caf35,_0x174cee),_0x3ee0f7++;}const _0x5833d0=new Map();for(const [_0x4bac53,_0x2ae24e]of _0x2dd784){const _0x411db1=_0x2ae24e['slice']()[_0x668d4a(0x176)]((_0x32b4dc,_0x4b2c0a)=>{const _0x23fac2=_0x668d4a,_0x3fd9e2=_0x4f9948[_0x23fac2(0x1c0)](_0x32b4dc[_0x23fac2(0x18d)])||0x0,_0x123e0a=_0x4f9948[_0x23fac2(0x1c0)](_0x4b2c0a['name'])||0x0;if(_0x3fd9e2!==_0x123e0a)return _0x123e0a-_0x3fd9e2;return _0x32b4dc[_0x23fac2(0x1ac)]-_0x4b2c0a[_0x23fac2(0x1ac)];})[_0x668d4a(0x174)](_0x3ac891=>_0x3ac891[_0x668d4a(0x18d)]);_0x5833d0[_0x668d4a(0x1bd)](_0x4bac53,_0x411db1);}return _0x5833d0;}export function collectSegmentUsageCounts(_0x5af5a2){const _0x5cf0ab=a133_0x2249,_0x1e6fe2=new Map(),_0x5d93bf=_0x6012a3=>{const _0x4059c8=a133_0x2249;if(!_0x6012a3)return;_0x1e6fe2[_0x4059c8(0x1bd)](_0x6012a3,(_0x1e6fe2['get'](_0x6012a3)||0x0)+0x1);},_0x2a1017=_0x40016b=>{const _0x27b7db=a133_0x2249;for(const _0x3faf2d of _0x40016b){_0x5d93bf(_0x3faf2d[_0x27b7db(0x184)]?.[_0x27b7db(0x180)]);if(_0x3faf2d[_0x27b7db(0x1a5)])for(const _0x609604 of _0x3faf2d['exit_criteria']){_0x5d93bf(_0x609604['segment']);}_0x5d93bf(_0x3faf2d['milestone']?.[_0x27b7db(0x180)]);if(_0x3faf2d['steps'])for(const _0x3ed1cb of _0x3faf2d[_0x27b7db(0x17b)]){if(_0x3ed1cb[_0x27b7db(0x1a6)]===_0x27b7db(0x189))for(const _0x17ada7 of _0x3ed1cb[_0x27b7db(0x196)][_0x27b7db(0x178)]){_0x5d93bf(_0x17ada7['segment']);}else _0x3ed1cb['type']==='wait'&&_0x5d93bf(_0x3ed1cb[_0x27b7db(0x196)][_0x27b7db(0x1b9)]?.[_0x27b7db(0x180)]);}}};_0x5d93bf(_0x5af5a2[_0x5cf0ab(0x182)]?.[_0x5cf0ab(0x180)]);if(_0x5af5a2[_0x5cf0ab(0x1ad)])for(const _0x50bf65 of _0x5af5a2['journeys']){_0x5d93bf(_0x50bf65[_0x5cf0ab(0x182)]?.[_0x5cf0ab(0x180)]),_0x2a1017(_0x50bf65[_0x5cf0ab(0x1be)]);}_0x5af5a2[_0x5cf0ab(0x1be)]&&_0x2a1017(_0x5af5a2[_0x5cf0ab(0x1be)]);if(_0x5af5a2[_0x5cf0ab(0x17e)])for(const _0xd13b28 of _0x5af5a2[_0x5cf0ab(0x17e)]){_0x2a1017(_0xd13b28['stages']);}return _0x1e6fe2;}
|
|
1
|
+
function a135_0x2def(_0x1e68e1,_0x125b58){_0x1e68e1=_0x1e68e1-0x9e;const _0x315f1c=a135_0x315f();let _0x2def0c=_0x315f1c[_0x1e68e1];return _0x2def0c;}(function(_0x3083f4,_0x4e6245){const _0x16c1de=a135_0x2def,_0x11a33b=_0x3083f4();while(!![]){try{const _0x5cf000=parseInt(_0x16c1de(0xbc))/0x1+-parseInt(_0x16c1de(0xe2))/0x2+parseInt(_0x16c1de(0xb8))/0x3*(-parseInt(_0x16c1de(0xdf))/0x4)+parseInt(_0x16c1de(0xba))/0x5+parseInt(_0x16c1de(0xec))/0x6*(-parseInt(_0x16c1de(0xd5))/0x7)+-parseInt(_0x16c1de(0xcb))/0x8*(parseInt(_0x16c1de(0xe4))/0x9)+parseInt(_0x16c1de(0xc2))/0xa;if(_0x5cf000===_0x4e6245)break;else _0x11a33b['push'](_0x11a33b['shift']());}catch(_0x34dc1b){_0x11a33b['push'](_0x11a33b['shift']());}}}(a135_0x315f,0xc58d4));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x35ba7b){const _0x875060=a135_0x2def;return _0x35ba7b[_0x875060(0xa4)]()[_0x875060(0xcd)](/\s+/g,'_')[_0x875060(0xcd)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x875060(0xcd)](/_+/g,'_')[_0x875060(0xcd)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x227232){const _0x49d7ee=a135_0x2def,_0x2721ac=_0x227232[_0x49d7ee(0xbf)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x2721ac){const _0x21dadc=_0x2721ac[0x1][_0x49d7ee(0xa4)](),_0xe94bbf=_0x2721ac[0x2],_0x5ba6e5=_0xe94bbf[_0x49d7ee(0xcd)](/-/g,'')[_0x49d7ee(0x9f)](0x0,0x4)[_0x49d7ee(0xa4)]();return _0x21dadc+'_'+_0x5ba6e5;}const _0x4fcbd8=_0x227232['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4fcbd8){const _0x1f5cba=_0x4fcbd8[0x1],_0x103f42=_0x4fcbd8[0x2][_0x49d7ee(0xa4)](),_0x17e31a=_0x1f5cba[_0x49d7ee(0xcd)](/-/g,'')[_0x49d7ee(0x9f)](0x0,0x4)[_0x49d7ee(0xa4)]();return _0x103f42+'_'+_0x17e31a;}return undefined;}function stableStringify(_0x19bb2b){const _0x3ab394=a135_0x2def;if(Array['isArray'](_0x19bb2b))return'['+_0x19bb2b[_0x3ab394(0xdd)](_0x2eec4c=>stableStringify(_0x2eec4c))[_0x3ab394(0xd4)](',')+']';if(_0x19bb2b&&typeof _0x19bb2b===_0x3ab394(0xda)){const _0x1f36e3=_0x19bb2b,_0x41fd2a=Object[_0x3ab394(0xc9)](_0x1f36e3)[_0x3ab394(0xc3)](),_0x3d7c31=_0x41fd2a['map'](_0x198334=>'\x22'+_0x198334+'\x22:'+stableStringify(_0x1f36e3[_0x198334]));return'{'+_0x3d7c31[_0x3ab394(0xd4)](',')+'}';}const _0x5a6ccb=JSON['stringify'](_0x19bb2b);return _0x5a6ccb===undefined?_0x3ab394(0xb6):_0x5a6ccb;}export function consolidateActivationsByContent(_0x4ac283){const _0x5b206d=a135_0x2def,_0x5158b0={},_0x279936=new Map(),_0x2e5eb5=new Map();for(const _0x108184 of _0x4ac283){if(!_0x108184)continue;for(const [_0x11a615,_0x3e9c7d]of Object['entries'](_0x108184)){const _0x199c6c={'name':_0x3e9c7d[_0x5b206d(0xa2)],'connection':_0x3e9c7d['connection'],..._0x3e9c7d[_0x5b206d(0xd9)]!==undefined&&{'all_columns':_0x3e9c7d['all_columns']},..._0x3e9c7d[_0x5b206d(0xe7)]!==undefined&&{'columns':_0x3e9c7d['columns']},..._0x3e9c7d[_0x5b206d(0xe3)]!==undefined&&{'behavior':_0x3e9c7d['behavior']},..._0x3e9c7d[_0x5b206d(0xce)]!==undefined&&{'schedule':_0x3e9c7d[_0x5b206d(0xce)]},..._0x3e9c7d['notification']!==undefined&&{'notification':_0x3e9c7d['notification']},..._0x3e9c7d[_0x5b206d(0xca)]!==undefined&&{'connector_config':_0x3e9c7d[_0x5b206d(0xca)]},..._0x3e9c7d[_0x5b206d(0xdb)]!==undefined&&{'activation_template_id':_0x3e9c7d[_0x5b206d(0xdb)]}},_0x5a6bd5=stableStringify(_0x199c6c),_0x168555=_0x2e5eb5[_0x5b206d(0xbb)](_0x5a6bd5);_0x168555?_0x279936[_0x5b206d(0xb5)](_0x11a615,_0x168555):(_0x5158b0[_0x11a615]=_0x3e9c7d,_0x279936[_0x5b206d(0xb5)](_0x11a615,_0x11a615),_0x2e5eb5['set'](_0x5a6bd5,_0x11a615));}}return{'merged':_0x5158b0,'nameMapping':_0x279936};}export function updateActivationReferences(_0x58e4b3,_0x2258fb){const _0x1e3f59=a135_0x2def;if(!_0x58e4b3)return;for(const _0x428989 of _0x58e4b3){if(!_0x428989[_0x1e3f59(0xc6)])continue;for(const _0x5e7065 of _0x428989[_0x1e3f59(0xc6)]){if(_0x5e7065[_0x1e3f59(0x9e)]===_0x1e3f59(0xeb)&&_0x5e7065[_0x1e3f59(0xe5)]?.['activation']){const _0x4d18d3=_0x2258fb[_0x1e3f59(0xbb)](_0x5e7065[_0x1e3f59(0xe5)]['activation']);_0x4d18d3&&_0x4d18d3!==_0x5e7065['with'][_0x1e3f59(0xeb)]&&(_0x5e7065[_0x1e3f59(0xe5)][_0x1e3f59(0xeb)]=_0x4d18d3);}}}}export function consolidateSegmentsByContent(_0x222bde,_0x58593f){const _0x429edb=a135_0x2def,_0x448af5={},_0x945d33=new Map(),_0x2f73a4=new Map();for(const _0x2e1ddf of _0x222bde){if(!_0x2e1ddf)continue;for(const [_0xffdb18,_0x4c1190]of Object[_0x429edb(0xd1)](_0x2e1ddf)){if(!_0x4c1190[_0x429edb(0xe0)]){_0x448af5[_0xffdb18]=_0x4c1190,_0x945d33[_0x429edb(0xb5)](_0xffdb18,_0xffdb18);continue;}const _0xf50d25=_0x4c1190[_0x429edb(0xc8)]&&_0x4c1190[_0x429edb(0xc8)][_0x429edb(0xac)]()?_0x4c1190[_0x429edb(0xc8)]:undefined,_0x5aab6b=JSON[_0x429edb(0xab)]({'description':_0xf50d25,'rule':deepSortObject(_0x4c1190[_0x429edb(0xe0)])}),_0x265738=_0x2f73a4[_0x429edb(0xbb)](_0x5aab6b);if(_0x265738){const _0x24e78c={..._0x4c1190[_0x429edb(0xc8)]!==undefined&&{'description':_0x4c1190['description']},'rule':_0x4c1190[_0x429edb(0xe0)]?deepSortObject(_0x4c1190[_0x429edb(0xe0)]):_0x4c1190['rule']};if(_0xffdb18<_0x265738){_0x448af5[_0xffdb18]=_0x24e78c,delete _0x448af5[_0x265738];for(const [_0x16c316,_0x106b5f]of _0x945d33[_0x429edb(0xd1)]()){_0x106b5f===_0x265738&&_0x945d33[_0x429edb(0xb5)](_0x16c316,_0xffdb18);}_0x945d33[_0x429edb(0xb5)](_0xffdb18,_0xffdb18),_0x2f73a4[_0x429edb(0xb5)](_0x5aab6b,_0xffdb18);}else _0x448af5[_0x265738]=_0x24e78c,_0x945d33['set'](_0xffdb18,_0x265738);}else{let _0x2b3c5d=_0xffdb18;if(_0x58593f){const _0x4edf5b=_0x58593f[_0x429edb(0xbb)](_0x5aab6b);_0x4edf5b&&_0x4edf5b[_0x429edb(0xe8)]>0x0&&(_0x2b3c5d=_0x4edf5b[_0x429edb(0x9f)]()['sort']()[0x0]);}const _0x331899={..._0x4c1190[_0x429edb(0xc8)]!==undefined&&{'description':_0x4c1190['description']},'rule':_0x4c1190['rule']?deepSortObject(_0x4c1190[_0x429edb(0xe0)]):_0x4c1190[_0x429edb(0xe0)]};_0x448af5[_0x2b3c5d]=_0x331899,_0x945d33[_0x429edb(0xb5)](_0xffdb18,_0x2b3c5d),_0x2f73a4[_0x429edb(0xb5)](_0x5aab6b,_0x2b3c5d);}}}return{'merged':_0x448af5,'nameMapping':_0x945d33};}export function updateSegmentReferences(_0x188af5,_0x11eabe){const _0x552770=a135_0x2def;if(!_0x188af5)return;for(const _0x34426d of _0x188af5){if(_0x34426d[_0x552770(0xb1)]?.[_0x552770(0xa6)]){const _0xa27b6c=_0x11eabe[_0x552770(0xbb)](_0x34426d['entry_criteria'][_0x552770(0xa6)]);_0xa27b6c&&(_0x34426d[_0x552770(0xb1)][_0x552770(0xa6)]=_0xa27b6c);}if(_0x34426d['exit_criteria'])for(const _0x5e4237 of _0x34426d[_0x552770(0xde)]){if(_0x5e4237[_0x552770(0xa6)]){const _0x2fd508=_0x11eabe[_0x552770(0xbb)](_0x5e4237[_0x552770(0xa6)]);_0x2fd508&&(_0x5e4237['segment']=_0x2fd508);}}if(_0x34426d[_0x552770(0xb3)]?.[_0x552770(0xa6)]){const _0x22c22d=_0x11eabe[_0x552770(0xbb)](_0x34426d[_0x552770(0xb3)][_0x552770(0xa6)]);_0x22c22d&&(_0x34426d['milestone'][_0x552770(0xa6)]=_0x22c22d);}if(_0x34426d[_0x552770(0xc6)])for(const _0xb0b0cd of _0x34426d['steps']){if(_0xb0b0cd[_0x552770(0x9e)]==='decision_point'&&_0xb0b0cd[_0x552770(0xe5)]?.[_0x552770(0xc1)])for(const _0x342f9b of _0xb0b0cd[_0x552770(0xe5)]['branches']){if(_0x342f9b[_0x552770(0xa6)]){const _0x54c6ba=_0x11eabe[_0x552770(0xbb)](_0x342f9b[_0x552770(0xa6)]);_0x54c6ba&&(_0x342f9b[_0x552770(0xa6)]=_0x54c6ba);}}if(_0xb0b0cd[_0x552770(0x9e)]===_0x552770(0xa8)&&_0xb0b0cd['with']?.[_0x552770(0xd7)]?.[_0x552770(0xa6)]){const _0x5795fc=_0x11eabe['get'](_0xb0b0cd[_0x552770(0xe5)][_0x552770(0xd7)][_0x552770(0xa6)]);_0x5795fc&&(_0xb0b0cd['with'][_0x552770(0xd7)][_0x552770(0xa6)]=_0x5795fc);}}}}export function updateSegmentRefsInSegments(_0x106889,_0x154bbb){const _0x1807b6=a135_0x2def;for(const _0x3fbb7c of Object[_0x1807b6(0xbd)](_0x106889)){_0x3fbb7c[_0x1807b6(0xe0)]&&updateSegmentRefsInRule(_0x3fbb7c['rule'],_0x154bbb);}}function updateSegmentRefsInRule(_0x15cdc5,_0x445f66){const _0x5e0fdf=a135_0x2def;if(_0x15cdc5===null||typeof _0x15cdc5!==_0x5e0fdf(0xda))return;if(Array[_0x5e0fdf(0xb2)](_0x15cdc5)){for(const _0x48bcb5 of _0x15cdc5){updateSegmentRefsInRule(_0x48bcb5,_0x445f66);}return;}const _0x1fde2d=_0x15cdc5;if((_0x1fde2d['type']==='include'||_0x1fde2d[_0x5e0fdf(0x9e)]===_0x5e0fdf(0xdc))&&typeof _0x1fde2d['segment']===_0x5e0fdf(0xd0)){const _0x180665=_0x445f66[_0x5e0fdf(0xbb)](_0x1fde2d[_0x5e0fdf(0xa6)]);_0x180665&&(_0x1fde2d[_0x5e0fdf(0xa6)]=_0x180665);}if(_0x1fde2d[_0x5e0fdf(0xcf)]&&Array[_0x5e0fdf(0xb2)](_0x1fde2d[_0x5e0fdf(0xcf)]))for(const _0x523576 of _0x1fde2d['conditions']){updateSegmentRefsInRule(_0x523576,_0x445f66);}}export function buildJourneysArray(_0x16e513,_0x18e163){const _0xd676f=a135_0x2def;return _0x16e513[_0xd676f(0xdd)](_0x50da40=>{const _0x1ca61b=_0xd676f,_0x455ac5=_0x18e163?_0x50da40[_0x1ca61b(0xb9)]['id']===_0x18e163:_0x16e513[_0x1ca61b(0xe8)]===0x1,_0x2070da=_0x50da40['yaml']['journeys']?.[0x0],_0x53c8b5=_0x2070da?.[_0x1ca61b(0xb7)]||_0x50da40[_0x1ca61b(0xc4)]['goal'],_0x3ff14e={'version':_0x2070da?.[_0x1ca61b(0xe9)]||_0x50da40[_0x1ca61b(0xc4)]['version']||_0x50da40[_0x1ca61b(0xb9)][_0x1ca61b(0xa2)],'state':_0x50da40['item']['state']===_0x1ca61b(0xb0)?'launched':_0x1ca61b(0xae),'stages':_0x2070da?.[_0x1ca61b(0xc7)]||_0x50da40['yaml'][_0x1ca61b(0xc7)]||[],'id':_0x2070da?.['id']||_0x50da40[_0x1ca61b(0xc4)]['id'],'version_number':_0x2070da?.[_0x1ca61b(0xa5)]||_0x50da40[_0x1ca61b(0xc4)][_0x1ca61b(0xa5)]};return _0x53c8b5&&(_0x3ff14e[_0x1ca61b(0xb7)]=_0x53c8b5),_0x455ac5&&(_0x3ff14e[_0x1ca61b(0xd3)]=!![]),_0x3ff14e;});}export function buildMergedJourneyDef(_0x27f4bc,_0xe8279f,_0x1c61c5){const _0x4c6c50=a135_0x2def,_0x6d7044=_0x27f4bc[0x0][_0x4c6c50(0xc4)],_0xd55712=buildJourneysArray(_0x27f4bc,_0x1c61c5),{merged:_0x25bcc5,nameMapping:_0x41148a}=consolidateSegmentsByContent(_0x27f4bc[_0x4c6c50(0xdd)](_0x220dba=>_0x220dba['yaml'][_0x4c6c50(0xcc)]),_0xe8279f);updateSegmentRefsInSegments(_0x25bcc5,_0x41148a);const _0x49490a=Array[_0x4c6c50(0xe1)](_0x41148a[_0x4c6c50(0xd1)]())[_0x4c6c50(0xc5)](([_0xe1d962,_0x3f1bab])=>_0xe1d962!==_0x3f1bab&&_0xe1d962[_0x4c6c50(0xea)]('entry_criteria'));let _0x2a367b=_0x25bcc5,_0x2a0f58=new Map();if(_0x49490a){const _0x95edc0=consolidateSegmentsByContent([_0x25bcc5],_0xe8279f);_0x2a367b=_0x95edc0[_0x4c6c50(0xe6)],_0x2a0f58=_0x95edc0[_0x4c6c50(0xa0)];}const _0xdf34a3=new Map(_0x41148a);for(const [_0x4da7b8,_0x2b3968]of _0x2a0f58[_0x4c6c50(0xd1)]()){_0xdf34a3['set'](_0x4da7b8,_0x2b3968);}for(const [_0x2be749,_0x176405]of _0xdf34a3[_0x4c6c50(0xd1)]()){let _0x563be6=_0x176405,_0x59b565=0x0;while(_0xdf34a3[_0x4c6c50(0xaf)](_0x563be6)&&_0xdf34a3[_0x4c6c50(0xbb)](_0x563be6)!==_0x563be6&&_0x59b565<MAX_MAPPING_CHAIN_DEPTH){_0x563be6=_0xdf34a3[_0x4c6c50(0xbb)](_0x563be6),_0x59b565++;}_0x563be6!==_0x176405&&_0xdf34a3[_0x4c6c50(0xb5)](_0x2be749,_0x563be6);}for(const _0x526010 of _0xd55712){updateSegmentReferences(_0x526010[_0x4c6c50(0xc7)],_0xdf34a3);}const {merged:_0x1a8d2e,nameMapping:_0x2db8d8}=consolidateActivationsByContent(_0x27f4bc[_0x4c6c50(0xdd)](_0x3d5356=>_0x3d5356[_0x4c6c50(0xc4)]['activations']));for(const _0x400355 of _0xd55712){updateActivationReferences(_0x400355[_0x4c6c50(0xc7)],_0x2db8d8);}let _0x4fe856=_0x6d7044['goal'];if(_0x4fe856?.['segment']){const _0x12ce36=_0xdf34a3[_0x4c6c50(0xbb)](_0x4fe856[_0x4c6c50(0xa6)]);_0x12ce36&&(_0x4fe856={..._0x4fe856,'segment':_0x12ce36});}for(const _0x38305d of _0xd55712){if(_0x38305d[_0x4c6c50(0xb7)]?.[_0x4c6c50(0xa6)]){const _0x3758a9=_0xdf34a3[_0x4c6c50(0xbb)](_0x38305d[_0x4c6c50(0xb7)][_0x4c6c50(0xa6)]);_0x3758a9&&(_0x38305d[_0x4c6c50(0xb7)]={..._0x38305d[_0x4c6c50(0xb7)],'segment':_0x3758a9});}}return _0xd55712[_0x4c6c50(0xc5)](_0x1e2634=>_0x1e2634[_0x4c6c50(0xb7)])&&(_0x4fe856=undefined),{'type':_0x4c6c50(0xa7),'name':_0x6d7044[_0x4c6c50(0xa2)],'description':_0x6d7044[_0x4c6c50(0xc8)],'goal':_0x4fe856,'reentry':_0x6d7044[_0x4c6c50(0xaa)],'segments':Object[_0x4c6c50(0xc9)](_0x2a367b)[_0x4c6c50(0xe8)]>0x0?_0x2a367b:undefined,'activations':Object[_0x4c6c50(0xc9)](_0x1a8d2e)['length']>0x0?_0x1a8d2e:undefined,'journeys':_0xd55712,'bundle_id':_0x6d7044[_0x4c6c50(0xa1)],'bundle_name':_0x6d7044[_0x4c6c50(0xd6)]};}export function createJumpTargetCache(){return new Map();}function a135_0x315f(){const _0x2a2c91=['slice','nameMapping','bundle_id','name','versions','toLowerCase','version_number','segment','journey','wait','decision_point','reentry','stringify','trim','endsWith','draft','has','launched','entry_criteria','isArray','milestone','push','set','null','goal','54HnuQNS','item','3662675WDIxTV','get','1115692QoAoaH','values','journeys','match','attributes','branches','38765800qMVwjI','sort','yaml','some','steps','stages','description','keys','connector_config','8CvRtbP','segments','replace','schedule','conditions','string','entries','index','latest','join','7OsKEeE','bundle_name','condition','journeyStages','all_columns','object','activation_template_id','exclude','map','exit_criteria','295188vBIvRF','rule','from','2540798XWdySv','behavior','13243491UUdQrk','with','merged','columns','length','version','startsWith','activation','5072346EfPJZg','type'];a135_0x315f=function(){return _0x2a2c91;};return a135_0x315f();}export async function resolveJumpTarget(_0x458ab4,_0x211610,_0x4e3d6d,_0x3fed90){const _0x235e39=a135_0x2def,_0x5bcd91=_0x458ab4+':'+_0x211610,_0x3245b3=_0x4e3d6d[_0x235e39(0xbb)](_0x5bcd91);if(_0x3245b3)return _0x3245b3;const _0x3cb9cd=await _0x3fed90(_0x458ab4),_0xea42e1=_0x3cb9cd[_0x235e39(0xc0)]['journeyBundleName']||_0x3cb9cd[_0x235e39(0xc0)][_0x235e39(0xa2)],_0x124868=_0x3cb9cd['attributes'][_0x235e39(0xd8)]['find'](_0x47d112=>String(_0x47d112['id'])===String(_0x211610)),_0x409bf6=_0x124868?.['name']||_0x211610,_0x1d70cf={'journeyName':_0xea42e1,'stageName':_0x409bf6};return _0x4e3d6d[_0x235e39(0xb5)](_0x5bcd91,_0x1d70cf),_0x1d70cf;}export function formatApiJourneyName(_0x20bfc9,_0x20ed74){return _0x20ed74+'\x20('+_0x20bfc9+')';}export function isLocalJourneyRef(_0x442c7d){const _0xd3a705=a135_0x2def;return _0x442c7d[_0xd3a705(0xad)]('.yml')||_0x442c7d[_0xd3a705(0xad)]('.yaml');}export function buildLocalRuleToNameMapping(_0x4db711){const _0x155e8a=a135_0x2def,_0x9d7b4c=new Map();if(!_0x4db711)return _0x9d7b4c;for(const [_0x3742e7,_0x297530]of Object[_0x155e8a(0xd1)](_0x4db711)){if(_0x297530[_0x155e8a(0xe0)]){const _0x15a341=serializeRule(_0x297530[_0x155e8a(0xe0)]),_0x244b99=_0x9d7b4c['get'](_0x15a341)||[];_0x244b99[_0x155e8a(0xb4)](_0x3742e7),_0x9d7b4c[_0x155e8a(0xb5)](_0x15a341,_0x244b99);}}return _0x9d7b4c;}export function buildLocalRuleToNameMappingFromJourney(_0x4f45f8){const _0x526a72=a135_0x2def,_0xb79b9f=_0x4f45f8[_0x526a72(0xcc)];if(!_0xb79b9f)return new Map();const _0x68e92a=collectSegmentUsageCounts(_0x4f45f8),_0x1bcf02=new Map();let _0x1f5397=0x0;for(const [_0x4189d1,_0xa6daad]of Object[_0x526a72(0xd1)](_0xb79b9f)){if(!_0xa6daad[_0x526a72(0xe0)]){_0x1f5397++;continue;}const _0x49a1ca=serializeRule(_0xa6daad[_0x526a72(0xe0)]),_0x1798de=_0x1bcf02[_0x526a72(0xbb)](_0x49a1ca)||[];_0x1798de['push']({'name':_0x4189d1,'index':_0x1f5397}),_0x1bcf02['set'](_0x49a1ca,_0x1798de),_0x1f5397++;}const _0x312a9f=new Map();for(const [_0x1b62df,_0x29de17]of _0x1bcf02){const _0x55d727=_0x29de17[_0x526a72(0x9f)]()[_0x526a72(0xc3)]((_0x230975,_0x27e966)=>{const _0x14f530=_0x526a72,_0x26b8c8=_0x68e92a[_0x14f530(0xbb)](_0x230975[_0x14f530(0xa2)])||0x0,_0x3f7d5e=_0x68e92a[_0x14f530(0xbb)](_0x27e966['name'])||0x0;if(_0x26b8c8!==_0x3f7d5e)return _0x3f7d5e-_0x26b8c8;return _0x230975['index']-_0x27e966[_0x14f530(0xd2)];})[_0x526a72(0xdd)](_0x5758c4=>_0x5758c4[_0x526a72(0xa2)]);_0x312a9f[_0x526a72(0xb5)](_0x1b62df,_0x55d727);}return _0x312a9f;}export function collectSegmentUsageCounts(_0x30eac8){const _0x29db78=a135_0x2def,_0x234c92=new Map(),_0x2a928a=_0xf10c2f=>{const _0x275367=a135_0x2def;if(!_0xf10c2f)return;_0x234c92['set'](_0xf10c2f,(_0x234c92[_0x275367(0xbb)](_0xf10c2f)||0x0)+0x1);},_0x25e75b=_0x4489cd=>{const _0x270798=a135_0x2def;for(const _0x120d7d of _0x4489cd){_0x2a928a(_0x120d7d[_0x270798(0xb1)]?.[_0x270798(0xa6)]);if(_0x120d7d[_0x270798(0xde)])for(const _0x27e07f of _0x120d7d[_0x270798(0xde)]){_0x2a928a(_0x27e07f[_0x270798(0xa6)]);}_0x2a928a(_0x120d7d[_0x270798(0xb3)]?.[_0x270798(0xa6)]);if(_0x120d7d[_0x270798(0xc6)])for(const _0x192f44 of _0x120d7d[_0x270798(0xc6)]){if(_0x192f44['type']===_0x270798(0xa9))for(const _0x29b5a4 of _0x192f44[_0x270798(0xe5)][_0x270798(0xc1)]){_0x2a928a(_0x29b5a4[_0x270798(0xa6)]);}else _0x192f44['type']===_0x270798(0xa8)&&_0x2a928a(_0x192f44['with']['condition']?.['segment']);}}};_0x2a928a(_0x30eac8[_0x29db78(0xb7)]?.[_0x29db78(0xa6)]);if(_0x30eac8['journeys'])for(const _0x393708 of _0x30eac8[_0x29db78(0xbe)]){_0x2a928a(_0x393708['goal']?.[_0x29db78(0xa6)]),_0x25e75b(_0x393708['stages']);}_0x30eac8[_0x29db78(0xc7)]&&_0x25e75b(_0x30eac8[_0x29db78(0xc7)]);if(_0x30eac8[_0x29db78(0xa3)])for(const _0x1e0d88 of _0x30eac8[_0x29db78(0xa3)]){_0x25e75b(_0x1e0d88[_0x29db78(0xc7)]);}return _0x234c92;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x420259,_0x2f2ded){const _0x4159a3=a134_0x164d,_0x466ce3=_0x420259();while(!![]){try{const _0x1f8c4f=-parseInt(_0x4159a3(0x1b3))/0x1*(-parseInt(_0x4159a3(0x147))/0x2)+-parseInt(_0x4159a3(0x12a))/0x3*(-parseInt(_0x4159a3(0x12d))/0x4)+parseInt(_0x4159a3(0x16f))/0x5+parseInt(_0x4159a3(0x150))/0x6+parseInt(_0x4159a3(0x1ad))/0x7+-parseInt(_0x4159a3(0x13f))/0x8*(-parseInt(_0x4159a3(0x18b))/0x9)+-parseInt(_0x4159a3(0x14a))/0xa;if(_0x1f8c4f===_0x2f2ded)break;else _0x466ce3['push'](_0x466ce3['shift']());}catch(_0x429ea9){_0x466ce3['push'](_0x466ce3['shift']());}}}(a134_0x21a0,0xccc61));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x25f40b,_0x443ef1,_0xac29d3,_0x1ed8fe,_0x5b823d,_0x22dad6){const _0x3f6e23=a134_0x164d;return{'level':_0x25f40b,'path':_0x443ef1,'code':_0xac29d3,'message':_0x1ed8fe,'location':getLocationFromPath(_0x5b823d[_0x3f6e23(0x195)],_0x5b823d['source'],pathToArray(_0x22dad6??_0x443ef1))};}function validateVersionStructure(_0x3c8a45,_0x4a961f){const _0x4fd17b=a134_0x164d,_0x37a057=[];return _0x3c8a45[_0x4fd17b(0x1ae)]>MAX_STAGES&&_0x37a057[_0x4fd17b(0x13b)](createIssue(_0x4fd17b(0x154),_0x4fd17b(0x121),_0x4fd17b(0x187),'Journey\x20has\x20'+_0x3c8a45[_0x4fd17b(0x1ae)]+_0x4fd17b(0x159)+MAX_STAGES,_0x4a961f)),_0x37a057;}function validateStageStructure(_0x3c6c7b,_0x43634a,_0x797062,_0x324267){const _0x293b54=a134_0x164d,_0x310372=[],_0x18c769='stages['+_0x43634a+']';_0x43634a===0x0&&!_0x3c6c7b[_0x293b54(0x16b)]&&_0x310372[_0x293b54(0x13b)](createIssue('error',_0x18c769+'.entry_criteria','MISSING_ENTRY_CRITERIA','Stage\x20\x27'+_0x3c6c7b[_0x293b54(0x163)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x324267,_0x18c769));const _0x1a4607=_0x43634a===_0x797062-0x1;!_0x1a4607&&!_0x3c6c7b[_0x293b54(0x17d)]&&_0x310372[_0x293b54(0x13b)](createIssue(_0x293b54(0x154),_0x18c769+_0x293b54(0x143),_0x293b54(0x1a7),_0x293b54(0x11b)+_0x3c6c7b['name']+_0x293b54(0x135),_0x324267,_0x18c769));(!_0x3c6c7b[_0x293b54(0x188)]||_0x3c6c7b[_0x293b54(0x188)][_0x293b54(0x1ae)]===0x0)&&_0x310372[_0x293b54(0x13b)](createIssue(_0x293b54(0x16a),_0x18c769+_0x293b54(0x14e),_0x293b54(0x15c),_0x293b54(0x11b)+_0x3c6c7b[_0x293b54(0x163)]+_0x293b54(0x193),_0x324267,_0x18c769));const _0x59c909=_0x3c6c7b[_0x293b54(0x128)]?.[_0x293b54(0x1ae)]??0x0;if(_0x59c909===0x0)_0x310372[_0x293b54(0x13b)](createIssue(_0x293b54(0x154),_0x18c769+_0x293b54(0x189),_0x293b54(0x15a),_0x293b54(0x11b)+_0x3c6c7b[_0x293b54(0x163)]+'\x27\x20has\x20no\x20steps',_0x324267,_0x18c769+_0x293b54(0x189)));else{if(_0x59c909===0x1)_0x310372[_0x293b54(0x13b)](createIssue(_0x293b54(0x16a),_0x18c769+'.steps',_0x293b54(0x15a),_0x293b54(0x11b)+_0x3c6c7b[_0x293b54(0x163)]+'\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',_0x324267,_0x18c769+_0x293b54(0x189)));else _0x59c909<=0x3&&_0x310372[_0x293b54(0x13b)](createIssue(_0x293b54(0x16a),_0x18c769+_0x293b54(0x189),_0x293b54(0x131),_0x293b54(0x11b)+_0x3c6c7b['name']+_0x293b54(0x133)+_0x59c909+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x324267,_0x18c769+'.steps'));}return _0x310372;}function validateStep(_0x2209cb,_0x1d7be7,_0x2a760f,_0x10536b){const _0x579909=a134_0x164d,_0xf29859=[];if(_0x2209cb[_0x579909(0x15d)]===_0x579909(0x1b4))return _0x2209cb[_0x579909(0x177)]&&_0xf29859[_0x579909(0x13b)](createIssue('error',_0x1d7be7+_0x579909(0x1a6),'END_STEP_HAS_NEXT_OR_WITH',_0x579909(0x17c)+_0x2209cb[_0x579909(0x163)]+_0x579909(0x129),_0x2a760f)),'with'in _0x2209cb&&_0x2209cb[_0x579909(0x156)]!==undefined&&_0xf29859[_0x579909(0x13b)](createIssue(_0x579909(0x154),_0x1d7be7+_0x579909(0x170),_0x579909(0x106),_0x579909(0x17c)+_0x2209cb[_0x579909(0x163)]+_0x579909(0xfe),_0x2a760f)),_0xf29859;_0x2209cb[_0x579909(0x177)]&&(_0x2a760f[_0x579909(0x173)]&&!_0x2a760f[_0x579909(0x173)][_0x579909(0x10e)](_0x2209cb[_0x579909(0x177)])&&_0xf29859[_0x579909(0x13b)](createIssue(_0x579909(0x154),_0x1d7be7+_0x579909(0x1a6),_0x579909(0x1b2),_0x579909(0x16c)+_0x2209cb[_0x579909(0x177)]+'\x27',_0x2a760f)));switch(_0x2209cb[_0x579909(0x15d)]){case _0x579909(0x110):_0xf29859[_0x579909(0x13b)](...validateWaitStep(_0x2209cb,_0x1d7be7,_0x2a760f,_0x10536b));break;case _0x579909(0x162):_0xf29859[_0x579909(0x13b)](...validateActivationStep(_0x2209cb,_0x1d7be7,_0x2a760f));break;case'decision_point':_0xf29859[_0x579909(0x13b)](...validateDecisionPointStep(_0x2209cb,_0x1d7be7,_0x2a760f,_0x10536b));break;case'ab_test':_0xf29859[_0x579909(0x13b)](...validateAbTestStep(_0x2209cb,_0x1d7be7,_0x2a760f,_0x10536b));break;case _0x579909(0xff):_0xf29859[_0x579909(0x13b)](...validateJumpStep(_0x2209cb,_0x1d7be7,_0x2a760f));break;}return _0xf29859;}function validateWaitStep(_0x389d79,_0xac249e,_0x8262cc,_0x1d2e0d){const _0x110472=a134_0x164d,_0x526c51=[];if(!_0x389d79['with'])return _0x526c51['push'](createIssue('error',_0xac249e+_0x110472(0x170),_0x110472(0x112),'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0x8262cc,_0xac249e)),_0x526c51;if(_0x389d79[_0x110472(0x156)]['condition']){const _0x5a8c9f=_0x389d79['with']['condition'];if(_0x5a8c9f[_0x110472(0x12f)]){_0x8262cc[_0x110472(0x146)]?.[_0x110472(0x13a)](_0x5a8c9f[_0x110472(0x12f)]);!_0x5a8c9f['segment'][_0x110472(0x107)](_0x110472(0x172))&&(_0x8262cc['embeddedSegments']&&!_0x8262cc['embeddedSegments'][_0x110472(0x10e)](_0x5a8c9f[_0x110472(0x12f)])&&_0x526c51[_0x110472(0x13b)](createIssue(_0x110472(0x154),_0xac249e+_0x110472(0x186),'MISSING_SEGMENT_REFERENCE','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x5a8c9f[_0x110472(0x12f)]+_0x110472(0x1a9),_0x8262cc)));_0x5a8c9f[_0x110472(0x177)]&&_0x8262cc[_0x110472(0x173)]&&!_0x8262cc[_0x110472(0x173)]['has'](_0x5a8c9f[_0x110472(0x177)])&&_0x526c51['push'](createIssue(_0x110472(0x154),_0xac249e+_0x110472(0x13e),_0x110472(0x1b2),_0x110472(0x10b)+_0x5a8c9f[_0x110472(0x177)]+'\x27',_0x8262cc));_0x5a8c9f[_0x110472(0x166)]?.[_0x110472(0x177)]&&_0x8262cc['stepNames']&&!_0x8262cc[_0x110472(0x173)][_0x110472(0x10e)](_0x5a8c9f[_0x110472(0x166)][_0x110472(0x177)])&&_0x526c51[_0x110472(0x13b)](createIssue(_0x110472(0x154),_0xac249e+_0x110472(0x192),_0x110472(0x1b2),_0x110472(0x152)+_0x5a8c9f['timeout']['next']+'\x27',_0x8262cc));const _0x249e5e=_0x5a8c9f[_0x110472(0x177)]||_0x389d79[_0x110472(0x177)],_0x4975e7=_0x5a8c9f[_0x110472(0x166)]?.[_0x110472(0x177)]||_0x389d79[_0x110472(0x177)];if(_0x249e5e){const _0x48edd0=_0x1d2e0d[_0x110472(0x108)](_0x249e5e);_0x48edd0?.['type']===_0x110472(0x1a8)&&_0x526c51['push'](createIssue('warning',_0xac249e+_0x110472(0x13e),_0x110472(0x15f),_0x110472(0x125)+_0x249e5e+_0x110472(0x171),_0x8262cc,_0xac249e+_0x110472(0x148)));}if(_0x4975e7){const _0x186a31=_0x1d2e0d[_0x110472(0x108)](_0x4975e7);_0x186a31?.[_0x110472(0x15d)]===_0x110472(0x1a8)&&_0x526c51[_0x110472(0x13b)](createIssue(_0x110472(0x16a),_0xac249e+_0x110472(0x192),'BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x4975e7+_0x110472(0x171),_0x8262cc,_0xac249e+_0x110472(0x11f)));}}}return _0x526c51;}function validateActivationStep(_0x170c4c,_0x4af7ca,_0x120587){const _0x18b8bf=a134_0x164d,_0x4059a7=[];if(!_0x170c4c[_0x18b8bf(0x156)]?.[_0x18b8bf(0x162)])return _0x4059a7[_0x18b8bf(0x13b)](createIssue('error',_0x4af7ca+_0x18b8bf(0x16e),_0x18b8bf(0x14f),_0x18b8bf(0x130),_0x120587,_0x4af7ca)),_0x4059a7;const _0x12c248=_0x170c4c['with']['activation'];return _0x120587['activationKeys']&&!_0x12c248['startsWith'](_0x18b8bf(0x172))&&(!_0x120587[_0x18b8bf(0x1a0)][_0x18b8bf(0x10e)](_0x12c248)&&_0x4059a7[_0x18b8bf(0x13b)](createIssue('error',_0x4af7ca+_0x18b8bf(0x16e),_0x18b8bf(0x118),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x12c248+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x120587))),_0x4059a7;}function validateDecisionPointStep(_0x14af59,_0x2b13f1,_0x2f4ce2,_0x472ae1){const _0x11688a=a134_0x164d,_0x2d495c=[];if(!_0x14af59[_0x11688a(0x156)]?.[_0x11688a(0x101)]||_0x14af59[_0x11688a(0x156)][_0x11688a(0x101)][_0x11688a(0x1ae)]===0x0)return _0x2d495c[_0x11688a(0x13b)](createIssue(_0x11688a(0x154),_0x2b13f1+_0x11688a(0x10d),'MISSING_CONDITIONS',_0x11688a(0x127),_0x2f4ce2,_0x2b13f1)),_0x2d495c;for(let _0x3fc9b3=0x0;_0x3fc9b3<_0x14af59[_0x11688a(0x156)]['branches']['length'];_0x3fc9b3++){const _0xc3906a=_0x14af59[_0x11688a(0x156)][_0x11688a(0x101)][_0x3fc9b3],_0x11b392=_0x2b13f1+_0x11688a(0x12c)+_0x3fc9b3+']';_0xc3906a[_0x11688a(0x12f)]&&!_0xc3906a[_0x11688a(0x11d)]&&(_0x2f4ce2['referencedSegments']?.[_0x11688a(0x13a)](_0xc3906a[_0x11688a(0x12f)]),!_0xc3906a[_0x11688a(0x12f)][_0x11688a(0x107)](_0x11688a(0x172))&&(_0x2f4ce2[_0x11688a(0x113)]&&!_0x2f4ce2[_0x11688a(0x113)][_0x11688a(0x10e)](_0xc3906a[_0x11688a(0x12f)])&&_0x2d495c[_0x11688a(0x13b)](createIssue('error',_0x11b392+_0x11688a(0x103),_0x11688a(0x12e),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0xc3906a[_0x11688a(0x12f)]+'\x27',_0x2f4ce2))));_0xc3906a['next']&&_0x2f4ce2[_0x11688a(0x173)]&&!_0x2f4ce2[_0x11688a(0x173)]['has'](_0xc3906a[_0x11688a(0x177)])&&_0x2d495c['push'](createIssue('error',_0x11b392+_0x11688a(0x1a6),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0xc3906a[_0x11688a(0x177)]+'\x27',_0x2f4ce2));if(_0xc3906a['next']){const _0x282d89=_0x472ae1['get'](_0xc3906a[_0x11688a(0x177)]);_0x282d89?.[_0x11688a(0x15d)]===_0x11688a(0x1a8)&&_0x2d495c[_0x11688a(0x13b)](createIssue('warning',_0x11b392+_0x11688a(0x1a6),'BRANCH_DIRECTLY_TO_MERGE',_0x11688a(0x104)+_0xc3906a[_0x11688a(0x163)]+_0x11688a(0x18d)+_0xc3906a['next']+'\x27\x20with\x20no\x20action\x20in\x20between',_0x2f4ce2));}}return _0x2d495c;}function validateAbTestStep(_0x5db377,_0x3f4f14,_0x1cc031,_0x4b46be){const _0x73ec5=a134_0x164d,_0x12ff32=[];if(!_0x5db377[_0x73ec5(0x156)]?.[_0x73ec5(0x18e)]||_0x5db377[_0x73ec5(0x156)][_0x73ec5(0x18e)][_0x73ec5(0x1ae)]===0x0)return _0x12ff32[_0x73ec5(0x13b)](createIssue(_0x73ec5(0x154),_0x3f4f14+'.with.variants',_0x73ec5(0x176),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x1cc031,_0x3f4f14)),_0x12ff32;const _0x44c841=_0x5db377[_0x73ec5(0x156)][_0x73ec5(0x18e)]['reduce']((_0x369235,_0x1b9942)=>_0x369235+(_0x1b9942['percentage']||0x0),0x0);Math[_0x73ec5(0x102)](_0x44c841-0x64)>0.01&&_0x12ff32['push'](createIssue(_0x73ec5(0x154),_0x3f4f14+'.with.variants',_0x73ec5(0x136),_0x73ec5(0x100)+_0x44c841+'%)',_0x1cc031));for(let _0x5a47a1=0x0;_0x5a47a1<_0x5db377['with'][_0x73ec5(0x18e)][_0x73ec5(0x1ae)];_0x5a47a1++){const _0x482e7d=_0x5db377[_0x73ec5(0x156)][_0x73ec5(0x18e)][_0x5a47a1],_0x5ad92c=_0x3f4f14+_0x73ec5(0x15b)+_0x5a47a1+']';_0x482e7d[_0x73ec5(0x177)]&&_0x1cc031[_0x73ec5(0x173)]&&!_0x1cc031[_0x73ec5(0x173)][_0x73ec5(0x10e)](_0x482e7d[_0x73ec5(0x177)])&&_0x12ff32[_0x73ec5(0x13b)](createIssue(_0x73ec5(0x154),_0x5ad92c+'.next',_0x73ec5(0x1b2),_0x73ec5(0x168)+_0x482e7d[_0x73ec5(0x177)]+'\x27',_0x1cc031));if(_0x482e7d[_0x73ec5(0x177)]){const _0x522ba0=_0x4b46be[_0x73ec5(0x108)](_0x482e7d[_0x73ec5(0x177)]);_0x522ba0?.['type']===_0x73ec5(0x1a8)&&_0x12ff32[_0x73ec5(0x13b)](createIssue(_0x73ec5(0x16a),_0x5ad92c+_0x73ec5(0x1a6),'BRANCH_DIRECTLY_TO_MERGE','A/B\x20test\x20variant\x20\x27'+_0x482e7d[_0x73ec5(0x163)]+_0x73ec5(0x18d)+_0x482e7d['next']+_0x73ec5(0x194),_0x1cc031));}}return _0x12ff32;}function a134_0x21a0(){const _0x49e384=['goal','versions','End\x20step\x20\x27','milestone','Embedded\x20segment\x20\x27','journeys,\x20stages,\x20or\x20versions','trim','.type','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','MERGE_TO_MERGE_CHAIN','SINGLE_INPUT_MERGE','safeParse','.with.condition.segment','TOO_MANY_STAGES','exit_criteria','.steps','set','938070rEFjvp','target','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','variants','MISSING_NAME','.with.target','versions[','.with.condition.timeout.next','\x27\x20has\x20no\x20exit_criteria\x20defined','\x27\x20with\x20no\x20action\x20in\x20between','document','\x20versions)','decision_point','symbol','success','every','values','MISSING_GOAL','segments','sort','ab_test','activationKeys','level','entries','journeys[','\x27\x20has\x20no\x20end\x20step','UNUSED_EMBEDDED_SEGMENT','.next','MISSING_MILESTONE','merge','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','join','.entry_criteria','3855586LONSNz','length','stage','Merge\x20step\x20\x27','message','INVALID_NEXT_REFERENCE','1173285lwoAdV','end','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','jump','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','branches','abs','.segment','Decision\x20branch\x20\x27','\x20with\x20latest:\x20true','END_STEP_HAS_NEXT_OR_WITH','startsWith','get','journey\x20entry','ACTIVATION_SCHEMA_ERROR','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','description','.with.branches','has','some','wait','variant\x20\x27','MISSING_WAIT_PARAMS','embeddedSegments','\x27\x20of\x20\x27','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','keys','map','MISSING_ACTIVATION_DEFINITION','Journey\x20has\x20no\x20goal\x20defined','source','Stage\x20\x27','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','excluded','latest','.with.condition.timeout','goalIsInherited','stages','Journey\x20name\x20is\x20required','timeout\x20of\x20\x27','step\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20(from:\x20','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','steps','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','9zddVcy','endsWith','.with.branches[','1075588YDPETE','MISSING_SEGMENT_REFERENCE','segment','Activation\x20step\x20requires\x20an\x20activation\x20reference','FEW_STEPS','path','\x27\x20has\x20only\x20','splice','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','INVALID_AB_TEST_PERCENTAGES','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','state','activations','add','push','includes','journey','.with.condition.next','64GeBRkl','size','MISSING_END_STEP','skipSchema','.milestone','filter','JOURNEY_SCHEMA_ERROR','referencedSegments','2IKIyZv','.with.condition','MISSING_STAGES','44318970QoHbuJ','excluded_','DUPLICATE_STEP_NAME','.rule','.exit_criteria','MISSING_ACTIVATION_REF','5334216fXKgFp','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','.name','error','stages[','with','match','\x27\x20(first\x20defined\x20at\x20steps[','\x20stages\x20but\x20maximum\x20is\x20','INSUFFICIENT_STEPS','.with.variants[','MISSING_EXIT_CRITERIA','type',').\x20Merge\x20is\x20unnecessary.','BRANCH_DIRECTLY_TO_MERGE','\x20(across\x20','condition','activation','name','INVALID_JUMP_TARGET','indices','timeout','journeys','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','segments.','warning','entry_criteria','Step\x20references\x20non-existent\x20step\x20\x27','data','.with.activation','5085000nYsLra','.with','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','ref:','stepNames','launched','rule','MISSING_CONDITIONS','next','condition\x20of\x20\x27','issues'];a134_0x21a0=function(){return _0x49e384;};return a134_0x21a0();}function validateJumpStep(_0x19e863,_0x5c4857,_0x3f45db){const _0x18ea1d=a134_0x164d,_0x4fa7a2=[];if(!_0x19e863[_0x18ea1d(0x156)]?.[_0x18ea1d(0x18c)])return _0x4fa7a2[_0x18ea1d(0x13b)](createIssue(_0x18ea1d(0x154),_0x5c4857+_0x18ea1d(0x190),'INVALID_JUMP_TARGET','Jump\x20step\x20requires\x20a\x20target',_0x3f45db,_0x5c4857)),_0x4fa7a2;return(!_0x19e863[_0x18ea1d(0x156)]['target'][_0x18ea1d(0x13d)]||!_0x19e863[_0x18ea1d(0x156)]['target'][_0x18ea1d(0x1af)])&&_0x4fa7a2['push'](createIssue(_0x18ea1d(0x154),_0x5c4857+'.with.target',_0x18ea1d(0x164),_0x18ea1d(0x137),_0x3f45db)),_0x4fa7a2;}function buildConvergenceMap(_0x55bfcf){const _0x420e91=a134_0x164d,_0x5d09a7=new Map();function _0x251c31(_0x24259b,_0x51f094){const _0x47f80f=a134_0x164d,_0x2784a0=_0x5d09a7[_0x47f80f(0x108)](_0x24259b)||[];_0x2784a0[_0x47f80f(0x13b)](_0x51f094),_0x5d09a7[_0x47f80f(0x18a)](_0x24259b,_0x2784a0);}for(const _0x269e04 of _0x55bfcf){_0x269e04[_0x420e91(0x177)]&&_0x251c31(_0x269e04[_0x420e91(0x177)],{'stepName':_0x269e04[_0x420e91(0x163)],'description':_0x420e91(0x124)+_0x269e04[_0x420e91(0x163)]+'\x27'});if(_0x269e04[_0x420e91(0x15d)]===_0x420e91(0x197)&&_0x269e04['with']?.[_0x420e91(0x101)])for(const _0x450e7d of _0x269e04[_0x420e91(0x156)]['branches']){_0x450e7d[_0x420e91(0x177)]&&_0x251c31(_0x450e7d['next'],{'stepName':_0x269e04[_0x420e91(0x163)],'description':'branch\x20\x27'+_0x450e7d[_0x420e91(0x163)]+_0x420e91(0x114)+_0x269e04[_0x420e91(0x163)]+'\x27'});}if(_0x269e04[_0x420e91(0x15d)]===_0x420e91(0x19f)&&_0x269e04[_0x420e91(0x156)]?.[_0x420e91(0x18e)])for(const _0x8cf766 of _0x269e04[_0x420e91(0x156)]['variants']){_0x8cf766['next']&&_0x251c31(_0x8cf766[_0x420e91(0x177)],{'stepName':_0x269e04[_0x420e91(0x163)],'description':_0x420e91(0x111)+_0x8cf766[_0x420e91(0x163)]+_0x420e91(0x114)+_0x269e04[_0x420e91(0x163)]+'\x27'});}_0x269e04[_0x420e91(0x15d)]===_0x420e91(0x110)&&_0x269e04[_0x420e91(0x156)]?.[_0x420e91(0x161)]&&(_0x269e04[_0x420e91(0x156)][_0x420e91(0x161)][_0x420e91(0x177)]&&_0x251c31(_0x269e04[_0x420e91(0x156)]['condition']['next'],{'stepName':_0x269e04['name'],'description':_0x420e91(0x178)+_0x269e04[_0x420e91(0x163)]+'\x27'}),_0x269e04[_0x420e91(0x156)]['condition'][_0x420e91(0x166)]?.[_0x420e91(0x177)]&&_0x251c31(_0x269e04[_0x420e91(0x156)][_0x420e91(0x161)][_0x420e91(0x166)][_0x420e91(0x177)],{'stepName':_0x269e04[_0x420e91(0x163)],'description':_0x420e91(0x123)+_0x269e04[_0x420e91(0x163)]+'\x27'}));}return _0x5d09a7;}function a134_0x164d(_0x5d44b7,_0x9d7a65){_0x5d44b7=_0x5d44b7-0xfe;const _0x21a096=a134_0x21a0();let _0x164d9d=_0x21a096[_0x5d44b7];return _0x164d9d;}function validateFlowControl(_0x5aa8be,_0x456263,_0x3f206d){const _0xaf499c=a134_0x164d,_0x579e48=[],_0x17325d=_0xaf499c(0x155)+_0x456263+']',_0x6e92de=_0x5aa8be['steps']||[];if(_0x6e92de[_0xaf499c(0x1ae)]===0x0)return _0x579e48;const _0x34a082=new Map();for(const _0x4078b4 of _0x6e92de){_0x4078b4[_0xaf499c(0x163)]&&_0x34a082[_0xaf499c(0x18a)](_0x4078b4[_0xaf499c(0x163)],_0x4078b4);}const _0x4713fb=buildConvergenceMap(_0x6e92de),_0x1cfb88=_0x6e92de[_0xaf499c(0x10f)](_0x613829=>_0x613829[_0xaf499c(0x15d)]===_0xaf499c(0x1b4));!_0x1cfb88&&_0x579e48[_0xaf499c(0x13b)](createIssue(_0xaf499c(0x154),_0x17325d+'.steps',_0xaf499c(0x141),_0xaf499c(0x11b)+_0x5aa8be[_0xaf499c(0x163)]+_0xaf499c(0x1a4),_0x3f206d));for(const [_0x2c4d7a,_0x31ade3]of _0x4713fb){const _0x5c3608=_0x34a082[_0xaf499c(0x108)](_0x2c4d7a);if(!_0x5c3608)continue;if(_0x31ade3['length']>0x1&&_0x5c3608[_0xaf499c(0x15d)]!==_0xaf499c(0x1a8)){const _0x57e970=_0x31ade3[_0xaf499c(0x117)](_0x44c689=>_0x44c689[_0xaf499c(0x10c)])[_0xaf499c(0x1ab)](',\x20');_0x579e48[_0xaf499c(0x13b)](createIssue(_0xaf499c(0x154),_0x17325d+_0xaf499c(0x189),'CONVERGENCE_WITHOUT_MERGE',_0xaf499c(0x151)+_0x2c4d7a+_0xaf499c(0x126)+_0x57e970+').\x20Use\x20a\x20merge\x20step.',_0x3f206d));}_0x31ade3[_0xaf499c(0x1ae)]===0x1&&_0x5c3608[_0xaf499c(0x15d)]==='merge'&&_0x579e48['push'](createIssue('warning',_0x17325d+_0xaf499c(0x189),_0xaf499c(0x184),_0xaf499c(0x1b0)+_0x2c4d7a+'\x27\x20has\x20only\x20one\x20input\x20(from:\x20'+_0x31ade3[0x0]['description']+_0xaf499c(0x15e),_0x3f206d));}for(const _0x345f87 of _0x6e92de){if(_0x345f87['type']===_0xaf499c(0x1a8)&&_0x345f87[_0xaf499c(0x177)]){const _0x178c04=_0x34a082[_0xaf499c(0x108)](_0x345f87['next']);_0x178c04?.[_0xaf499c(0x15d)]==='merge'&&_0x579e48[_0xaf499c(0x13b)](createIssue('error',_0x17325d+_0xaf499c(0x189),_0xaf499c(0x183),_0xaf499c(0x1b0)+_0x345f87[_0xaf499c(0x163)]+_0xaf499c(0x1aa)+_0x345f87['next']+_0xaf499c(0x182),_0x3f206d));}}return _0x579e48;}function validateCriteria(_0x54f241,_0x1b5dce,_0x2ecbb4){const _0x5434b2=a134_0x164d,_0x356a7c=[];return _0x54f241['segment']&&(_0x2ecbb4[_0x5434b2(0x146)]?.[_0x5434b2(0x13a)](_0x54f241[_0x5434b2(0x12f)]),!_0x54f241[_0x5434b2(0x12f)][_0x5434b2(0x107)](_0x5434b2(0x172))&&(_0x2ecbb4[_0x5434b2(0x113)]&&!_0x2ecbb4[_0x5434b2(0x113)][_0x5434b2(0x10e)](_0x54f241[_0x5434b2(0x12f)])&&_0x356a7c['push'](createIssue(_0x5434b2(0x154),_0x1b5dce+_0x5434b2(0x103),_0x5434b2(0x12e),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x54f241['segment']+'\x27',_0x2ecbb4)))),_0x356a7c;}function validateEmbeddedSegment(_0x3cb83e,_0x519059,_0x2f2f9a){const _0x43ccda=a134_0x164d,_0x2bf672=[];return _0x3cb83e[_0x43ccda(0x175)]&&_0x2bf672[_0x43ccda(0x13b)](...validateRuleDef(_0x3cb83e[_0x43ccda(0x175)],_0x519059+_0x43ccda(0x14d),_0x2f2f9a)),_0x2bf672;}function validateStage(_0x2a2926,_0x3b823e,_0x4bcae5,_0x1a618b){const _0x4f2116=a134_0x164d,_0x11a5ec=[],_0x2392b0=_0x4f2116(0x155)+_0x3b823e+']',_0x14e33f=new Map(),_0x27b899=new Map();if(_0x2a2926[_0x4f2116(0x128)]){for(let _0x5522a9=0x0;_0x5522a9<_0x2a2926[_0x4f2116(0x128)][_0x4f2116(0x1ae)];_0x5522a9++){const _0x334026=_0x2a2926[_0x4f2116(0x128)][_0x5522a9];_0x334026['name']&&_0x14e33f['set'](_0x334026[_0x4f2116(0x163)],_0x334026);}for(let _0x28c512=0x0;_0x28c512<_0x2a2926[_0x4f2116(0x128)][_0x4f2116(0x1ae)];_0x28c512++){const _0x32cd87=_0x2a2926[_0x4f2116(0x128)][_0x28c512],_0xff9bd2=_0x2392b0+'.steps['+_0x28c512+']';if(_0x32cd87[_0x4f2116(0x163)]){if(_0x27b899[_0x4f2116(0x10e)](_0x32cd87[_0x4f2116(0x163)])){const _0x360606=_0x27b899['get'](_0x32cd87[_0x4f2116(0x163)]);_0x11a5ec[_0x4f2116(0x13b)](createIssue(_0x4f2116(0x154),_0xff9bd2+_0x4f2116(0x153),_0x4f2116(0x14c),'Duplicate\x20step\x20name\x20\x27'+_0x32cd87[_0x4f2116(0x163)]+_0x4f2116(0x158)+_0x360606+'])',_0x1a618b));}else _0x27b899[_0x4f2116(0x18a)](_0x32cd87[_0x4f2116(0x163)],_0x28c512);}_0x11a5ec[_0x4f2116(0x13b)](...validateStep(_0x32cd87,_0xff9bd2,_0x1a618b,_0x14e33f));}}_0x2a2926[_0x4f2116(0x16b)]&&_0x11a5ec[_0x4f2116(0x13b)](...validateCriteria(_0x2a2926[_0x4f2116(0x16b)],_0x2392b0+_0x4f2116(0x1ac),_0x1a618b));if(_0x2a2926[_0x4f2116(0x188)])for(let _0x359868=0x0;_0x359868<_0x2a2926[_0x4f2116(0x188)]['length'];_0x359868++){_0x11a5ec['push'](...validateCriteria(_0x2a2926['exit_criteria'][_0x359868],_0x2392b0+'.exit_criteria['+_0x359868+']',_0x1a618b));}return _0x2a2926[_0x4f2116(0x17d)]&&_0x11a5ec[_0x4f2116(0x13b)](...validateCriteria(_0x2a2926[_0x4f2116(0x17d)],_0x2392b0+'.milestone',_0x1a618b)),_0x11a5ec[_0x4f2116(0x13b)](...validateStageStructure(_0x2a2926,_0x3b823e,_0x4bcae5,_0x1a618b)),_0x11a5ec['push'](...validateFlowControl(_0x2a2926,_0x3b823e,_0x1a618b)),_0x11a5ec;}function validateStagesForVersion(_0x3d11e7,_0x5833a2,_0x37c90a,_0x25ca81,_0x512e4a,_0x2d40ec,_0x40297f){const _0x4ae0f3=a134_0x164d;if(_0x3d11e7[_0x4ae0f3(0x1ae)]===0x0){_0x512e4a[_0x4ae0f3(0x13b)]({'level':'error','path':_0x25ca81+_0x4ae0f3(0x121),'code':_0x4ae0f3(0x149),'message':_0x4ae0f3(0x115),'location':getLocationFromPath(_0x37c90a['document'],_0x37c90a[_0x4ae0f3(0x11a)],['stages'])});return;}const _0x2b1574=new Set();for(const _0x45f06b of _0x3d11e7){if(_0x45f06b[_0x4ae0f3(0x128)])for(const _0x49cf6e of _0x45f06b[_0x4ae0f3(0x128)]){_0x49cf6e[_0x4ae0f3(0x163)]&&_0x2b1574[_0x4ae0f3(0x13a)](_0x49cf6e[_0x4ae0f3(0x163)]);}}const _0xe61346={..._0x37c90a,'stepNames':_0x2b1574},_0x2351f3=validateVersionStructure(_0x3d11e7,_0xe61346);for(const _0x2c9023 of _0x2351f3){const _0x1a2180=_0x25ca81?{..._0x2c9023,'path':''+_0x25ca81+_0x2c9023['path']}:_0x2c9023;if(_0x1a2180['level']===_0x4ae0f3(0x154))_0x512e4a['push'](_0x1a2180);else _0x2d40ec['push'](_0x1a2180);}for(let _0x315345=0x0;_0x315345<_0x3d11e7[_0x4ae0f3(0x1ae)];_0x315345++){const _0x4bf596=validateStage(_0x3d11e7[_0x315345],_0x315345,_0x3d11e7[_0x4ae0f3(0x1ae)],_0xe61346);for(const _0x3d9ff2 of _0x4bf596){const _0xa24df2=_0x25ca81?{..._0x3d9ff2,'path':''+_0x25ca81+_0x3d9ff2[_0x4ae0f3(0x132)]}:_0x3d9ff2;if(_0xa24df2[_0x4ae0f3(0x1a1)]===_0x4ae0f3(0x154))_0x512e4a[_0x4ae0f3(0x13b)](_0xa24df2);else _0x2d40ec[_0x4ae0f3(0x13b)](_0xa24df2);}}if(_0x5833a2[_0x4ae0f3(0x17a)]){const _0x4e1010=_0x40297f?.[_0x4ae0f3(0x120)]?_0x4ae0f3(0x17a):_0x25ca81+_0x4ae0f3(0x17a),_0x742d4b=validateCriteria(_0x5833a2[_0x4ae0f3(0x17a)],_0x4e1010,_0xe61346);for(const _0x1361ac of _0x742d4b){if(_0x1361ac['level']==='error')_0x512e4a[_0x4ae0f3(0x13b)](_0x1361ac);else _0x2d40ec['push'](_0x1361ac);}}}function extractVersionIndex(_0x1b06de){const _0x319b15=a134_0x164d,_0x5db1a9=_0x1b06de[_0x319b15(0x157)](/^journeys\[(\d+)\]\./);return _0x5db1a9?_0x5db1a9[0x1]:undefined;}function deduplicateAcrossVersions(_0x1ab0c3){const _0x4186d3=a134_0x164d,_0x261eaa=new Map();for(let _0x3310e1=0x0;_0x3310e1<_0x1ab0c3[_0x4186d3(0x1ae)];_0x3310e1++){const _0x2e5a10=_0x1ab0c3[_0x3310e1]['code']+':'+_0x1ab0c3[_0x3310e1][_0x4186d3(0x1b1)],_0x13fed8=extractVersionIndex(_0x1ab0c3[_0x3310e1][_0x4186d3(0x132)]),_0x55e065=_0x261eaa[_0x4186d3(0x108)](_0x2e5a10);if(_0x55e065){_0x55e065[_0x4186d3(0x165)][_0x4186d3(0x13b)](_0x3310e1);if(_0x13fed8)_0x55e065['versions'][_0x4186d3(0x13a)](_0x13fed8);}else _0x261eaa[_0x4186d3(0x18a)](_0x2e5a10,{'indices':[_0x3310e1],'versions':new Set(_0x13fed8?[_0x13fed8]:[])});}const _0x3414c0=new Set();for(const {indices:_0x1d4137,versions:_0x1cf87a}of _0x261eaa[_0x4186d3(0x19b)]()){if(_0x1cf87a[_0x4186d3(0x140)]<=0x1)continue;const _0x5dadfb=_0x1ab0c3[_0x1d4137[0x0]];_0x5dadfb[_0x4186d3(0x132)]=_0x5dadfb['path']['replace'](/^journeys\[\d+\]\./,''),_0x5dadfb[_0x4186d3(0x1b1)]=_0x5dadfb[_0x4186d3(0x1b1)]+_0x4186d3(0x160)+_0x1cf87a[_0x4186d3(0x140)]+_0x4186d3(0x196);for(let _0x2a80c4=0x1;_0x2a80c4<_0x1d4137[_0x4186d3(0x1ae)];_0x2a80c4++){_0x3414c0[_0x4186d3(0x13a)](_0x1d4137[_0x2a80c4]);}}const _0xeb815=[..._0x3414c0][_0x4186d3(0x19e)]((_0x480562,_0x5d87d6)=>_0x5d87d6-_0x480562);for(const _0x29674e of _0xeb815){_0x1ab0c3[_0x4186d3(0x134)](_0x29674e,0x1);}}export function validateJourneyDef(_0x31c97b,_0xadea20={},_0x37f8fd={}){const _0x126801=a134_0x164d;if(_0x37f8fd[_0x126801(0x142)])return runJourneySemanticChecks(_0x31c97b,_0xadea20);const _0x2c6276=JourneyDefSchema[_0x126801(0x185)](_0x31c97b);if(_0x2c6276[_0x126801(0x199)])return runJourneySemanticChecks(_0x2c6276[_0x126801(0x16d)],_0xadea20);return zodErrorsToJourneyValidationResult(_0x2c6276[_0x126801(0x154)],_0xadea20);}function zodErrorsToJourneyValidationResult(_0x19e6ef,_0x8660ef){const _0x131e19=a134_0x164d,_0xc15c3=flattenZodIssues(_0x19e6ef[_0x131e19(0x179)]),_0x1ef081=_0xc15c3[_0x131e19(0x117)](_0x2368e2=>{const _0x223a3e=_0x131e19,_0x39cd4d=formatZodPath(_0x2368e2[_0x223a3e(0x132)]),_0x2c53bc=mapJourneyZodIssueToCode(_0x2368e2,_0x39cd4d),_0x47f64a=getLocationFromPath(_0x8660ef['document'],_0x8660ef[_0x223a3e(0x11a)],_0x2368e2[_0x223a3e(0x132)][_0x223a3e(0x117)](_0x29505d=>typeof _0x29505d===_0x223a3e(0x198)?String(_0x29505d):_0x29505d));return{'level':'error','path':_0x39cd4d,'code':_0x2c53bc,'message':_0x2368e2[_0x223a3e(0x1b1)],..._0x47f64a&&{'location':_0x47f64a}};});return{'valid':![],'errors':_0x1ef081,'warnings':[]};}function mapJourneyZodIssueToCode(_0x35e7d0,_0x2626cc){const _0x500c5f=a134_0x164d;if(_0x2626cc==='name')return _0x500c5f(0x18f);if(_0x2626cc['endsWith'](_0x500c5f(0x181))&&_0x2626cc['includes'](_0x500c5f(0x128)))return _0x500c5f(0x145);if(_0x2626cc===_0x500c5f(0x121)||_0x2626cc[_0x500c5f(0x12b)]('.stages'))return _0x500c5f(0x149);if(_0x2626cc===''&&_0x35e7d0['message'][_0x500c5f(0x13c)](_0x500c5f(0x17f)))return _0x500c5f(0x149);if(_0x2626cc[_0x500c5f(0x13c)](_0x500c5f(0x162)))return _0x500c5f(0x10a);return _0x500c5f(0x145);}function runJourneySemanticChecks(_0x31161f,_0x4b46ae){const _0x3a1cea=a134_0x164d,_0x14e2e6=[],_0x472f8f=[];(!_0x31161f[_0x3a1cea(0x163)]||_0x31161f[_0x3a1cea(0x163)][_0x3a1cea(0x180)]()==='')&&_0x14e2e6['push']({'level':_0x3a1cea(0x154),'path':_0x3a1cea(0x163),'code':'MISSING_NAME','message':_0x3a1cea(0x122),'location':getLocationFromPath(_0x4b46ae[_0x3a1cea(0x195)],_0x4b46ae[_0x3a1cea(0x11a)],[_0x3a1cea(0x163)])});const _0x871a18=new Set();if(_0x31161f[_0x3a1cea(0x19d)])for(const _0x13d6cb of Object[_0x3a1cea(0x116)](_0x31161f[_0x3a1cea(0x19d)])){_0x871a18['add'](_0x13d6cb);}const _0x5a1d05=new Set();if(_0x31161f[_0x3a1cea(0x139)])for(const _0x486a76 of Object[_0x3a1cea(0x116)](_0x31161f['activations'])){_0x5a1d05['add'](_0x486a76);}const _0x54da83=new Set(),_0x554942={..._0x4b46ae,'embeddedSegments':_0x871a18,'referencedSegments':_0x54da83,'activationKeys':_0x5a1d05[_0x3a1cea(0x140)]>0x0?_0x5a1d05:undefined};if(_0x31161f[_0x3a1cea(0x19d)])for(const [_0x216ce2,_0x1e6504]of Object[_0x3a1cea(0x1a2)](_0x31161f['segments'])){const _0x3579d5=validateEmbeddedSegment(_0x1e6504,_0x3a1cea(0x169)+_0x216ce2,_0x554942);for(const _0x3a7c92 of _0x3579d5){if(_0x3a7c92[_0x3a1cea(0x1a1)]===_0x3a1cea(0x154))_0x14e2e6[_0x3a1cea(0x13b)](_0x3a7c92);else _0x472f8f['push'](_0x3a7c92);}}const _0x1eba78=!!_0x31161f[_0x3a1cea(0x17a)],_0x3fbd02=_0x31161f[_0x3a1cea(0x167)]?.[_0x3a1cea(0x19a)](_0x523da2=>!!_0x523da2[_0x3a1cea(0x17a)])??![];!_0x1eba78&&!_0x3fbd02&&_0x472f8f[_0x3a1cea(0x13b)]({'level':_0x3a1cea(0x16a),'path':_0x3a1cea(0x17a),'code':_0x3a1cea(0x19c),'message':_0x3a1cea(0x119),'location':getLocationFromPath(_0x4b46ae[_0x3a1cea(0x195)],_0x4b46ae[_0x3a1cea(0x11a)],[_0x3a1cea(0x17a)])});const _0x2a24e9=_0x31161f['journeys']??_0x31161f[_0x3a1cea(0x17b)];if(_0x2a24e9&&_0x2a24e9[_0x3a1cea(0x144)](_0x1f9734=>_0x1f9734[_0x3a1cea(0x11e)]===!![])[_0x3a1cea(0x1ae)]>0x1){const _0xe410f2=_0x31161f[_0x3a1cea(0x167)]?_0x3a1cea(0x167):_0x3a1cea(0x17b);_0x14e2e6['push']({'level':_0x3a1cea(0x154),'path':_0xe410f2,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0xe410f2===_0x3a1cea(0x167)?_0x3a1cea(0x109):'version')+_0x3a1cea(0x105),'location':getLocationFromPath(_0x4b46ae['document'],_0x4b46ae[_0x3a1cea(0x11a)],[_0xe410f2])});}if(_0x31161f[_0x3a1cea(0x167)]&&_0x31161f[_0x3a1cea(0x167)][_0x3a1cea(0x1ae)]>0x0)for(let _0x4f7921=0x0;_0x4f7921<_0x31161f['journeys'][_0x3a1cea(0x1ae)];_0x4f7921++){const _0x5eae82=_0x31161f[_0x3a1cea(0x167)][_0x4f7921];if(_0x31161f['journeys'][_0x3a1cea(0x1ae)]>0x1&&_0x5eae82[_0x3a1cea(0x138)]===_0x3a1cea(0x174))continue;const _0x42b914=_0x5eae82[_0x3a1cea(0x121)]||[],_0x496b6a=_0x3a1cea(0x1a3)+_0x4f7921+'].',_0xac3bdc=!!_0x5eae82[_0x3a1cea(0x17a)],_0x19a105=_0xac3bdc?{..._0x31161f,'goal':_0x5eae82[_0x3a1cea(0x17a)]}:_0x31161f;validateStagesForVersion(_0x42b914,_0x19a105,_0x554942,_0x496b6a,_0x14e2e6,_0x472f8f,{'goalIsInherited':!_0xac3bdc});}else{if(_0x31161f[_0x3a1cea(0x17b)]&&_0x31161f[_0x3a1cea(0x17b)][_0x3a1cea(0x1ae)]>0x0)for(let _0x59f029=0x0;_0x59f029<_0x31161f[_0x3a1cea(0x17b)][_0x3a1cea(0x1ae)];_0x59f029++){const _0xf8e450=_0x31161f['versions'][_0x59f029];if(_0x31161f[_0x3a1cea(0x17b)]['length']>0x1&&_0xf8e450[_0x3a1cea(0x138)]===_0x3a1cea(0x174))continue;const _0x22ddb2=_0xf8e450[_0x3a1cea(0x121)]||[],_0x448a9f=_0x3a1cea(0x191)+_0x59f029+'].';validateStagesForVersion(_0x22ddb2,_0x31161f,_0x554942,_0x448a9f,_0x14e2e6,_0x472f8f);}else{const _0x2ffdb5=_0x31161f[_0x3a1cea(0x121)]||[];validateStagesForVersion(_0x2ffdb5,_0x31161f,_0x554942,'',_0x14e2e6,_0x472f8f);}}_0x31161f['journeys']&&_0x31161f[_0x3a1cea(0x167)][_0x3a1cea(0x1ae)]>0x1&&(deduplicateAcrossVersions(_0x14e2e6),deduplicateAcrossVersions(_0x472f8f));for(const _0x32194a of _0x871a18){!_0x54da83['has'](_0x32194a)&&!_0x32194a[_0x3a1cea(0x107)](_0x3a1cea(0x14b))&&_0x472f8f[_0x3a1cea(0x13b)]({'level':'warning','path':'segments.'+_0x32194a,'code':_0x3a1cea(0x1a5),'message':_0x3a1cea(0x17e)+_0x32194a+_0x3a1cea(0x11c),'location':getLocationFromPath(_0x4b46ae[_0x3a1cea(0x195)],_0x4b46ae[_0x3a1cea(0x11a)],[_0x3a1cea(0x19d),_0x32194a])});}return{'valid':_0x14e2e6[_0x3a1cea(0x1ae)]===0x0,'errors':_0x14e2e6,'warnings':_0x472f8f};}
|
|
1
|
+
(function(_0x226be3,_0x4f33ef){const _0x2e9b9b=a136_0x44f5,_0x3ad4e1=_0x226be3();while(!![]){try{const _0x5aad8e=parseInt(_0x2e9b9b(0x1da))/0x1*(parseInt(_0x2e9b9b(0x15e))/0x2)+-parseInt(_0x2e9b9b(0x1a5))/0x3*(-parseInt(_0x2e9b9b(0x173))/0x4)+-parseInt(_0x2e9b9b(0x1e6))/0x5*(-parseInt(_0x2e9b9b(0x152))/0x6)+parseInt(_0x2e9b9b(0x194))/0x7+parseInt(_0x2e9b9b(0x172))/0x8*(parseInt(_0x2e9b9b(0x18c))/0x9)+parseInt(_0x2e9b9b(0x184))/0xa+-parseInt(_0x2e9b9b(0x1a4))/0xb;if(_0x5aad8e===_0x4f33ef)break;else _0x3ad4e1['push'](_0x3ad4e1['shift']());}catch(_0x85af89){_0x3ad4e1['push'](_0x3ad4e1['shift']());}}}(a136_0x1ae1,0xbb25f));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1e9c78,_0x52f787,_0x3dbe71,_0x263ddf,_0x43e46e,_0x52da19){const _0x2837fa=a136_0x44f5;return{'level':_0x1e9c78,'path':_0x52f787,'code':_0x3dbe71,'message':_0x263ddf,'location':getLocationFromPath(_0x43e46e[_0x2837fa(0x15c)],_0x43e46e[_0x2837fa(0x1bd)],pathToArray(_0x52da19??_0x52f787))};}function validateVersionStructure(_0x21c304,_0x2c46b2){const _0x3098ed=a136_0x44f5,_0x26366a=[];return _0x21c304['length']>MAX_STAGES&&_0x26366a[_0x3098ed(0x159)](createIssue(_0x3098ed(0x1ba),_0x3098ed(0x1bb),_0x3098ed(0x1d4),_0x3098ed(0x1a0)+_0x21c304['length']+_0x3098ed(0x14f)+MAX_STAGES,_0x2c46b2)),_0x26366a;}function validateStageStructure(_0x329dc6,_0x3371cb,_0x49868f,_0x2fa9eb){const _0x15572a=a136_0x44f5,_0x4f8655=[],_0x4c1be0=_0x15572a(0x17b)+_0x3371cb+']';_0x3371cb===0x0&&!_0x329dc6['entry_criteria']&&_0x4f8655[_0x15572a(0x159)](createIssue(_0x15572a(0x1ba),_0x4c1be0+_0x15572a(0x136),_0x15572a(0x1e5),_0x15572a(0x149)+_0x329dc6[_0x15572a(0x190)]+_0x15572a(0x1ad),_0x2fa9eb,_0x4c1be0));const _0x29f1a7=_0x3371cb===_0x49868f-0x1;!_0x29f1a7&&!_0x329dc6['milestone']&&_0x4f8655[_0x15572a(0x159)](createIssue(_0x15572a(0x1ba),_0x4c1be0+_0x15572a(0x139),_0x15572a(0x1a3),_0x15572a(0x149)+_0x329dc6[_0x15572a(0x190)]+_0x15572a(0x1b1),_0x2fa9eb,_0x4c1be0));(!_0x329dc6[_0x15572a(0x176)]||_0x329dc6[_0x15572a(0x176)][_0x15572a(0x154)]===0x0)&&_0x4f8655['push'](createIssue(_0x15572a(0x17e),_0x4c1be0+_0x15572a(0x1bc),_0x15572a(0x1ca),'Stage\x20\x27'+_0x329dc6[_0x15572a(0x190)]+_0x15572a(0x198),_0x2fa9eb,_0x4c1be0));const _0x23ab85=_0x329dc6[_0x15572a(0x14b)]?.[_0x15572a(0x154)]??0x0;if(_0x23ab85===0x0)_0x4f8655[_0x15572a(0x159)](createIssue(_0x15572a(0x1ba),_0x4c1be0+_0x15572a(0x142),_0x15572a(0x1c7),_0x15572a(0x149)+_0x329dc6['name']+_0x15572a(0x1e1),_0x2fa9eb,_0x4c1be0+_0x15572a(0x142)));else{if(_0x23ab85===0x1)_0x4f8655['push'](createIssue(_0x15572a(0x17e),_0x4c1be0+'.steps',_0x15572a(0x1c7),_0x15572a(0x149)+_0x329dc6['name']+_0x15572a(0x185),_0x2fa9eb,_0x4c1be0+_0x15572a(0x142)));else _0x23ab85<=0x3&&_0x4f8655[_0x15572a(0x159)](createIssue(_0x15572a(0x17e),_0x4c1be0+_0x15572a(0x142),_0x15572a(0x1a8),_0x15572a(0x149)+_0x329dc6[_0x15572a(0x190)]+_0x15572a(0x188)+_0x23ab85+_0x15572a(0x1b3),_0x2fa9eb,_0x4c1be0+_0x15572a(0x142)));}return _0x4f8655;}function validateStep(_0x1e4ab6,_0x29a272,_0x364bf0,_0x5227cb){const _0x1857d9=a136_0x44f5,_0x239cdc=[];if(_0x1e4ab6['type']===_0x1857d9(0x14c))return _0x1e4ab6['next']&&_0x239cdc[_0x1857d9(0x159)](createIssue(_0x1857d9(0x1ba),_0x29a272+_0x1857d9(0x16d),_0x1857d9(0x133),_0x1857d9(0x164)+_0x1e4ab6['name']+_0x1857d9(0x131),_0x364bf0)),'with'in _0x1e4ab6&&_0x1e4ab6['with']!==undefined&&_0x239cdc[_0x1857d9(0x159)](createIssue(_0x1857d9(0x1ba),_0x29a272+_0x1857d9(0x193),_0x1857d9(0x133),_0x1857d9(0x164)+_0x1e4ab6[_0x1857d9(0x190)]+_0x1857d9(0x140),_0x364bf0)),_0x239cdc;_0x1e4ab6['next']&&(_0x364bf0[_0x1857d9(0x1ab)]&&!_0x364bf0[_0x1857d9(0x1ab)][_0x1857d9(0x13e)](_0x1e4ab6[_0x1857d9(0x13f)])&&_0x239cdc[_0x1857d9(0x159)](createIssue(_0x1857d9(0x1ba),_0x29a272+'.next','INVALID_NEXT_REFERENCE',_0x1857d9(0x16e)+_0x1e4ab6['next']+'\x27',_0x364bf0)));switch(_0x1e4ab6[_0x1857d9(0x1be)]){case'wait':_0x239cdc['push'](...validateWaitStep(_0x1e4ab6,_0x29a272,_0x364bf0,_0x5227cb));break;case'activation':_0x239cdc[_0x1857d9(0x159)](...validateActivationStep(_0x1e4ab6,_0x29a272,_0x364bf0));break;case'decision_point':_0x239cdc[_0x1857d9(0x159)](...validateDecisionPointStep(_0x1e4ab6,_0x29a272,_0x364bf0,_0x5227cb));break;case _0x1857d9(0x138):_0x239cdc[_0x1857d9(0x159)](...validateAbTestStep(_0x1e4ab6,_0x29a272,_0x364bf0,_0x5227cb));break;case _0x1857d9(0x196):_0x239cdc[_0x1857d9(0x159)](...validateJumpStep(_0x1e4ab6,_0x29a272,_0x364bf0));break;}return _0x239cdc;}function validateWaitStep(_0x17224a,_0x553a76,_0x18cb6b,_0x32953c){const _0x294770=a136_0x44f5,_0x50ce64=[];if(!_0x17224a[_0x294770(0x187)])return _0x50ce64[_0x294770(0x159)](createIssue(_0x294770(0x1ba),_0x553a76+'.with',_0x294770(0x1d9),_0x294770(0x1ac),_0x18cb6b,_0x553a76)),_0x50ce64;if(_0x17224a[_0x294770(0x187)][_0x294770(0x1c4)]){const _0x44ce7c=_0x17224a[_0x294770(0x187)]['condition'];if(_0x44ce7c[_0x294770(0x1d1)]){_0x18cb6b[_0x294770(0x13b)]?.[_0x294770(0x1b7)](_0x44ce7c['segment']);!_0x44ce7c[_0x294770(0x1d1)]['startsWith'](_0x294770(0x17f))&&(_0x18cb6b[_0x294770(0x1d6)]&&!_0x18cb6b[_0x294770(0x1d6)][_0x294770(0x13e)](_0x44ce7c[_0x294770(0x1d1)])&&_0x50ce64[_0x294770(0x159)](createIssue('error',_0x553a76+_0x294770(0x186),'MISSING_SEGMENT_REFERENCE',_0x294770(0x1e4)+_0x44ce7c[_0x294770(0x1d1)]+_0x294770(0x1b6),_0x18cb6b)));_0x44ce7c[_0x294770(0x13f)]&&_0x18cb6b['stepNames']&&!_0x18cb6b[_0x294770(0x1ab)][_0x294770(0x13e)](_0x44ce7c[_0x294770(0x13f)])&&_0x50ce64[_0x294770(0x159)](createIssue('error',_0x553a76+'.with.condition.next',_0x294770(0x17d),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x44ce7c[_0x294770(0x13f)]+'\x27',_0x18cb6b));_0x44ce7c[_0x294770(0x1e7)]?.[_0x294770(0x13f)]&&_0x18cb6b[_0x294770(0x1ab)]&&!_0x18cb6b[_0x294770(0x1ab)][_0x294770(0x13e)](_0x44ce7c[_0x294770(0x1e7)][_0x294770(0x13f)])&&_0x50ce64[_0x294770(0x159)](createIssue(_0x294770(0x1ba),_0x553a76+_0x294770(0x174),_0x294770(0x17d),_0x294770(0x19c)+_0x44ce7c[_0x294770(0x1e7)][_0x294770(0x13f)]+'\x27',_0x18cb6b));const _0x370517=_0x44ce7c[_0x294770(0x13f)]||_0x17224a['next'],_0x1605c3=_0x44ce7c[_0x294770(0x1e7)]?.[_0x294770(0x13f)]||_0x17224a[_0x294770(0x13f)];if(_0x370517){const _0x3c3714=_0x32953c[_0x294770(0x134)](_0x370517);_0x3c3714?.[_0x294770(0x1be)]==='merge'&&_0x50ce64['push'](createIssue('warning',_0x553a76+'.with.condition.next','BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x370517+_0x294770(0x19f),_0x18cb6b,_0x553a76+_0x294770(0x1d5)));}if(_0x1605c3){const _0x552fef=_0x32953c['get'](_0x1605c3);_0x552fef?.[_0x294770(0x1be)]===_0x294770(0x1a9)&&_0x50ce64['push'](createIssue('warning',_0x553a76+_0x294770(0x174),_0x294770(0x1cd),_0x294770(0x183)+_0x1605c3+_0x294770(0x19f),_0x18cb6b,_0x553a76+'.with.condition.timeout'));}}}return _0x50ce64;}function validateActivationStep(_0x3d6d2e,_0x368a1c,_0x5ece90){const _0x47f60f=a136_0x44f5,_0x12ba59=[];if(!_0x3d6d2e[_0x47f60f(0x187)]?.[_0x47f60f(0x1a7)])return _0x12ba59[_0x47f60f(0x159)](createIssue(_0x47f60f(0x1ba),_0x368a1c+'.with.activation',_0x47f60f(0x13a),_0x47f60f(0x1a2),_0x5ece90,_0x368a1c)),_0x12ba59;const _0x38eb6e=_0x3d6d2e[_0x47f60f(0x187)][_0x47f60f(0x1a7)];return _0x5ece90[_0x47f60f(0x16b)]&&!_0x38eb6e[_0x47f60f(0x14d)](_0x47f60f(0x17f))&&(!_0x5ece90['activationKeys'][_0x47f60f(0x13e)](_0x38eb6e)&&_0x12ba59[_0x47f60f(0x159)](createIssue('error',_0x368a1c+_0x47f60f(0x156),'MISSING_ACTIVATION_DEFINITION','Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x38eb6e+_0x47f60f(0x1cc),_0x5ece90))),_0x12ba59;}function a136_0x1ae1(){const _0x269693=['Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','End\x20step\x20\x27','.type','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','.with.variants','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','Journey\x20name\x20is\x20required','launched','activationKeys','MISSING_STAGES','.next','Step\x20references\x20non-existent\x20step\x20\x27','version','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.branches','509752mejnWb','344592PxanBp','.with.condition.timeout.next','issues','exit_criteria','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','Decision\x20branch\x20\x27','Journey\x20can\x20have\x20at\x20most\x20one\x20','size','stages[','state','INVALID_NEXT_REFERENCE','warning','ref:','safeParse','versions','filter','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','11203710yZxzmt','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','.with.condition.segment','with','\x27\x20has\x20only\x20','entries','indices','skipSchema','99qcQdna','milestone',').\x20Use\x20a\x20merge\x20step.','journeys[','name','.with.variants[','data','.with','7549584spChza','A/B\x20test\x20variant\x20\x27','jump','set','\x27\x20has\x20no\x20exit_criteria\x20defined','entry_criteria','rule','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','.rule','Duplicate\x20step\x20name\x20\x27','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','Journey\x20has\x20','wait','Activation\x20step\x20requires\x20an\x20activation\x20reference','MISSING_MILESTONE','52795919LOfNQh','18PVTCyt','versions[','activation','FEW_STEPS','merge','JOURNEY_SCHEMA_ERROR','stepNames','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','timeout\x20of\x20\x27','journeys','.segment','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','path','\x20steps\x20(may\x20be\x20too\x20simple)','keys','excluded_','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','add','message','Criteria\x20references\x20undefined\x20segment\x20\x27','error','stages','.exit_criteria','source','type','endsWith','replace','branches','trim','variants','condition','INVALID_JUMP_TARGET','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','INSUFFICIENT_STEPS','success','Merge\x20step\x20\x27','MISSING_EXIT_CRITERIA','target','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','BRANCH_DIRECTLY_TO_MERGE','symbol','\x27\x20has\x20no\x20end\x20step','\x27\x20with\x20no\x20action\x20in\x20between','segment','segments','\x20versions)','TOO_MANY_STAGES','.with.condition','embeddedSegments','.name','splice','MISSING_WAIT_PARAMS','929683ZhKIJD','match','Journey\x20has\x20no\x20goal\x20defined','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','DUPLICATE_STEP_NAME','segments.','\x20(across\x20','\x27\x20has\x20no\x20steps','SINGLE_INPUT_MERGE','Embedded\x20segment\x20\x27','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','MISSING_ENTRY_CRITERIA','7375vaeZOO','timeout','MISSING_SEGMENT_REFERENCE','sort','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','activations','END_STEP_HAS_NEXT_OR_WITH','get','MISSING_GOAL','.entry_criteria','percentage','ab_test','.milestone','MISSING_ACTIVATION_REF','referencedSegments','map','includes','has','next','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','decision_point','.steps','journey','.exit_criteria[','MISSING_END_STEP','reduce','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','MISSING_CONDITIONS','Stage\x20\x27','join','steps','end','startsWith','.stages','\x20stages\x20but\x20maximum\x20is\x20','description','level','4962UbTMwX','MISSING_NAME','length','condition\x20of\x20\x27','.with.activation','goalIsInherited','goal','push','\x27\x20(first\x20defined\x20at\x20steps[','Jump\x20step\x20requires\x20a\x20target','document','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','2lFMWzQ','CONVERGENCE_WITHOUT_MERGE','some','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','.with.target'];a136_0x1ae1=function(){return _0x269693;};return a136_0x1ae1();}function validateDecisionPointStep(_0x5e9b62,_0x17cff7,_0x3820d7,_0x2496d7){const _0x397962=a136_0x44f5,_0xb1c16=[];if(!_0x5e9b62['with']?.[_0x397962(0x1c1)]||_0x5e9b62[_0x397962(0x187)][_0x397962(0x1c1)][_0x397962(0x154)]===0x0)return _0xb1c16[_0x397962(0x159)](createIssue('error',_0x17cff7+_0x397962(0x171),_0x397962(0x148),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x3820d7,_0x17cff7)),_0xb1c16;for(let _0x29ead0=0x0;_0x29ead0<_0x5e9b62[_0x397962(0x187)][_0x397962(0x1c1)][_0x397962(0x154)];_0x29ead0++){const _0xc9e154=_0x5e9b62[_0x397962(0x187)]['branches'][_0x29ead0],_0x4de51e=_0x17cff7+'.with.branches['+_0x29ead0+']';_0xc9e154['segment']&&!_0xc9e154['excluded']&&(_0x3820d7['referencedSegments']?.['add'](_0xc9e154[_0x397962(0x1d1)]),!_0xc9e154[_0x397962(0x1d1)][_0x397962(0x14d)](_0x397962(0x17f))&&(_0x3820d7['embeddedSegments']&&!_0x3820d7['embeddedSegments'][_0x397962(0x13e)](_0xc9e154[_0x397962(0x1d1)])&&_0xb1c16[_0x397962(0x159)](createIssue('error',_0x4de51e+_0x397962(0x1b0),_0x397962(0x1e8),_0x397962(0x166)+_0xc9e154[_0x397962(0x1d1)]+'\x27',_0x3820d7))));_0xc9e154['next']&&_0x3820d7[_0x397962(0x1ab)]&&!_0x3820d7['stepNames'][_0x397962(0x13e)](_0xc9e154['next'])&&_0xb1c16[_0x397962(0x159)](createIssue(_0x397962(0x1ba),_0x4de51e+_0x397962(0x16d),_0x397962(0x17d),_0x397962(0x163)+_0xc9e154['next']+'\x27',_0x3820d7));if(_0xc9e154[_0x397962(0x13f)]){const _0x4c8471=_0x2496d7['get'](_0xc9e154[_0x397962(0x13f)]);_0x4c8471?.['type']===_0x397962(0x1a9)&&_0xb1c16[_0x397962(0x159)](createIssue('warning',_0x4de51e+_0x397962(0x16d),'BRANCH_DIRECTLY_TO_MERGE',_0x397962(0x178)+_0xc9e154[_0x397962(0x190)]+_0x397962(0x170)+_0xc9e154[_0x397962(0x13f)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x3820d7));}}return _0xb1c16;}function validateAbTestStep(_0x5039d3,_0x2dfce8,_0x4d3f98,_0x3b7041){const _0x2f72a6=a136_0x44f5,_0x56b1e1=[];if(!_0x5039d3['with']?.[_0x2f72a6(0x1c3)]||_0x5039d3[_0x2f72a6(0x187)][_0x2f72a6(0x1c3)][_0x2f72a6(0x154)]===0x0)return _0x56b1e1[_0x2f72a6(0x159)](createIssue(_0x2f72a6(0x1ba),_0x2dfce8+'.with.variants',_0x2f72a6(0x148),_0x2f72a6(0x161),_0x4d3f98,_0x2dfce8)),_0x56b1e1;const _0x20f763=_0x5039d3[_0x2f72a6(0x187)][_0x2f72a6(0x1c3)][_0x2f72a6(0x146)]((_0x277b42,_0x3eb72e)=>_0x277b42+(_0x3eb72e[_0x2f72a6(0x137)]||0x0),0x0);Math['abs'](_0x20f763-0x64)>0.01&&_0x56b1e1[_0x2f72a6(0x159)](createIssue('error',_0x2dfce8+_0x2f72a6(0x167),'INVALID_AB_TEST_PERCENTAGES','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20'+_0x20f763+'%)',_0x4d3f98));for(let _0x1d7cab=0x0;_0x1d7cab<_0x5039d3[_0x2f72a6(0x187)][_0x2f72a6(0x1c3)][_0x2f72a6(0x154)];_0x1d7cab++){const _0x5e49ae=_0x5039d3[_0x2f72a6(0x187)][_0x2f72a6(0x1c3)][_0x1d7cab],_0x3b52ea=_0x2dfce8+_0x2f72a6(0x191)+_0x1d7cab+']';_0x5e49ae['next']&&_0x4d3f98[_0x2f72a6(0x1ab)]&&!_0x4d3f98[_0x2f72a6(0x1ab)][_0x2f72a6(0x13e)](_0x5e49ae[_0x2f72a6(0x13f)])&&_0x56b1e1[_0x2f72a6(0x159)](createIssue(_0x2f72a6(0x1ba),_0x3b52ea+'.next','INVALID_NEXT_REFERENCE','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x5e49ae['next']+'\x27',_0x4d3f98));if(_0x5e49ae[_0x2f72a6(0x13f)]){const _0x31c8f0=_0x3b7041[_0x2f72a6(0x134)](_0x5e49ae[_0x2f72a6(0x13f)]);_0x31c8f0?.[_0x2f72a6(0x1be)]===_0x2f72a6(0x1a9)&&_0x56b1e1[_0x2f72a6(0x159)](createIssue(_0x2f72a6(0x17e),_0x3b52ea+_0x2f72a6(0x16d),_0x2f72a6(0x1cd),_0x2f72a6(0x195)+_0x5e49ae[_0x2f72a6(0x190)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x5e49ae[_0x2f72a6(0x13f)]+_0x2f72a6(0x1d0),_0x4d3f98));}}return _0x56b1e1;}function validateJumpStep(_0x211740,_0x4f89f7,_0x1b249d){const _0x52aa4f=a136_0x44f5,_0x132e2f=[];if(!_0x211740[_0x52aa4f(0x187)]?.['target'])return _0x132e2f['push'](createIssue(_0x52aa4f(0x1ba),_0x4f89f7+_0x52aa4f(0x162),_0x52aa4f(0x1c5),_0x52aa4f(0x15b),_0x1b249d,_0x4f89f7)),_0x132e2f;return(!_0x211740[_0x52aa4f(0x187)]['target'][_0x52aa4f(0x143)]||!_0x211740['with'][_0x52aa4f(0x1cb)]['stage'])&&_0x132e2f[_0x52aa4f(0x159)](createIssue(_0x52aa4f(0x1ba),_0x4f89f7+'.with.target',_0x52aa4f(0x1c5),_0x52aa4f(0x1dd),_0x1b249d)),_0x132e2f;}function buildConvergenceMap(_0x4b9aa9){const _0x3d49a2=a136_0x44f5,_0x350980=new Map();function _0x5a1174(_0x43b5d5,_0x5087fe){const _0x13092d=a136_0x44f5,_0x52a882=_0x350980[_0x13092d(0x134)](_0x43b5d5)||[];_0x52a882['push'](_0x5087fe),_0x350980[_0x13092d(0x197)](_0x43b5d5,_0x52a882);}for(const _0x3fb72e of _0x4b9aa9){_0x3fb72e['next']&&_0x5a1174(_0x3fb72e[_0x3d49a2(0x13f)],{'stepName':_0x3fb72e['name'],'description':'step\x20\x27'+_0x3fb72e[_0x3d49a2(0x190)]+'\x27'});if(_0x3fb72e[_0x3d49a2(0x1be)]===_0x3d49a2(0x141)&&_0x3fb72e[_0x3d49a2(0x187)]?.['branches'])for(const _0x3a9c84 of _0x3fb72e[_0x3d49a2(0x187)][_0x3d49a2(0x1c1)]){_0x3a9c84[_0x3d49a2(0x13f)]&&_0x5a1174(_0x3a9c84[_0x3d49a2(0x13f)],{'stepName':_0x3fb72e[_0x3d49a2(0x190)],'description':'branch\x20\x27'+_0x3a9c84[_0x3d49a2(0x190)]+'\x27\x20of\x20\x27'+_0x3fb72e[_0x3d49a2(0x190)]+'\x27'});}if(_0x3fb72e['type']===_0x3d49a2(0x138)&&_0x3fb72e['with']?.[_0x3d49a2(0x1c3)])for(const _0x34c4fd of _0x3fb72e['with'][_0x3d49a2(0x1c3)]){_0x34c4fd['next']&&_0x5a1174(_0x34c4fd[_0x3d49a2(0x13f)],{'stepName':_0x3fb72e[_0x3d49a2(0x190)],'description':'variant\x20\x27'+_0x34c4fd[_0x3d49a2(0x190)]+'\x27\x20of\x20\x27'+_0x3fb72e[_0x3d49a2(0x190)]+'\x27'});}_0x3fb72e['type']===_0x3d49a2(0x1a1)&&_0x3fb72e[_0x3d49a2(0x187)]?.[_0x3d49a2(0x1c4)]&&(_0x3fb72e[_0x3d49a2(0x187)]['condition'][_0x3d49a2(0x13f)]&&_0x5a1174(_0x3fb72e[_0x3d49a2(0x187)][_0x3d49a2(0x1c4)][_0x3d49a2(0x13f)],{'stepName':_0x3fb72e[_0x3d49a2(0x190)],'description':_0x3d49a2(0x155)+_0x3fb72e['name']+'\x27'}),_0x3fb72e[_0x3d49a2(0x187)][_0x3d49a2(0x1c4)]['timeout']?.[_0x3d49a2(0x13f)]&&_0x5a1174(_0x3fb72e['with']['condition']['timeout']['next'],{'stepName':_0x3fb72e[_0x3d49a2(0x190)],'description':_0x3d49a2(0x1ae)+_0x3fb72e['name']+'\x27'}));}return _0x350980;}function validateFlowControl(_0x4e1089,_0x344186,_0x1a2e90){const _0x3abef4=a136_0x44f5,_0x471268=[],_0x376cdb=_0x3abef4(0x17b)+_0x344186+']',_0xec050a=_0x4e1089[_0x3abef4(0x14b)]||[];if(_0xec050a['length']===0x0)return _0x471268;const _0x16c153=new Map();for(const _0x5efd10 of _0xec050a){_0x5efd10[_0x3abef4(0x190)]&&_0x16c153[_0x3abef4(0x197)](_0x5efd10[_0x3abef4(0x190)],_0x5efd10);}const _0x325985=buildConvergenceMap(_0xec050a),_0x51890b=_0xec050a[_0x3abef4(0x160)](_0x37a5fd=>_0x37a5fd[_0x3abef4(0x1be)]==='end');!_0x51890b&&_0x471268[_0x3abef4(0x159)](createIssue(_0x3abef4(0x1ba),_0x376cdb+_0x3abef4(0x142),_0x3abef4(0x145),_0x3abef4(0x149)+_0x4e1089[_0x3abef4(0x190)]+_0x3abef4(0x1cf),_0x1a2e90));for(const [_0x2876d3,_0x338c03]of _0x325985){const _0xb8b27c=_0x16c153[_0x3abef4(0x134)](_0x2876d3);if(!_0xb8b27c)continue;if(_0x338c03[_0x3abef4(0x154)]>0x1&&_0xb8b27c[_0x3abef4(0x1be)]!==_0x3abef4(0x1a9)){const _0x2202ee=_0x338c03['map'](_0x1dcc18=>_0x1dcc18[_0x3abef4(0x150)])[_0x3abef4(0x14a)](',\x20');_0x471268['push'](createIssue(_0x3abef4(0x1ba),_0x376cdb+'.steps',_0x3abef4(0x15f),_0x3abef4(0x19b)+_0x2876d3+'\x27\x20(from:\x20'+_0x2202ee+_0x3abef4(0x18e),_0x1a2e90));}_0x338c03['length']===0x1&&_0xb8b27c[_0x3abef4(0x1be)]===_0x3abef4(0x1a9)&&_0x471268[_0x3abef4(0x159)](createIssue(_0x3abef4(0x17e),_0x376cdb+_0x3abef4(0x142),_0x3abef4(0x1e2),_0x3abef4(0x1c9)+_0x2876d3+_0x3abef4(0x177)+_0x338c03[0x0][_0x3abef4(0x150)]+').\x20Merge\x20is\x20unnecessary.',_0x1a2e90));}for(const _0x166a39 of _0xec050a){if(_0x166a39['type']===_0x3abef4(0x1a9)&&_0x166a39[_0x3abef4(0x13f)]){const _0x2c1254=_0x16c153['get'](_0x166a39[_0x3abef4(0x13f)]);_0x2c1254?.['type']===_0x3abef4(0x1a9)&&_0x471268[_0x3abef4(0x159)](createIssue(_0x3abef4(0x1ba),_0x376cdb+'.steps','MERGE_TO_MERGE_CHAIN',_0x3abef4(0x1c9)+_0x166a39['name']+_0x3abef4(0x147)+_0x166a39['next']+_0x3abef4(0x168),_0x1a2e90));}}return _0x471268;}function validateCriteria(_0x509def,_0x258ec3,_0x1209b6){const _0x23599e=a136_0x44f5,_0x1b1105=[];return _0x509def['segment']&&(_0x1209b6[_0x23599e(0x13b)]?.[_0x23599e(0x1b7)](_0x509def[_0x23599e(0x1d1)]),!_0x509def['segment'][_0x23599e(0x14d)]('ref:')&&(_0x1209b6[_0x23599e(0x1d6)]&&!_0x1209b6[_0x23599e(0x1d6)][_0x23599e(0x13e)](_0x509def[_0x23599e(0x1d1)])&&_0x1b1105[_0x23599e(0x159)](createIssue('error',_0x258ec3+'.segment',_0x23599e(0x1e8),_0x23599e(0x1b9)+_0x509def[_0x23599e(0x1d1)]+'\x27',_0x1209b6)))),_0x1b1105;}function validateEmbeddedSegment(_0x25c0e4,_0x57896a,_0xf4c16b){const _0x583e86=a136_0x44f5,_0x425dd7=[];return _0x25c0e4['rule']&&_0x425dd7['push'](...validateRuleDef(_0x25c0e4[_0x583e86(0x19a)],_0x57896a+_0x583e86(0x19d),_0xf4c16b)),_0x425dd7;}function a136_0x44f5(_0x4ba297,_0x231707){_0x4ba297=_0x4ba297-0x131;const _0x1ae162=a136_0x1ae1();let _0x44f599=_0x1ae162[_0x4ba297];return _0x44f599;}function validateStage(_0x12ec46,_0xbc6c03,_0x137e31,_0x3bd257){const _0xe36149=a136_0x44f5,_0x44317d=[],_0x12eee7=_0xe36149(0x17b)+_0xbc6c03+']',_0x5ef217=new Map(),_0x2a55c4=new Map();if(_0x12ec46[_0xe36149(0x14b)]){for(let _0x23fc24=0x0;_0x23fc24<_0x12ec46['steps'][_0xe36149(0x154)];_0x23fc24++){const _0x10594a=_0x12ec46['steps'][_0x23fc24];_0x10594a[_0xe36149(0x190)]&&_0x5ef217[_0xe36149(0x197)](_0x10594a['name'],_0x10594a);}for(let _0x285299=0x0;_0x285299<_0x12ec46[_0xe36149(0x14b)][_0xe36149(0x154)];_0x285299++){const _0x31ec29=_0x12ec46['steps'][_0x285299],_0x536965=_0x12eee7+'.steps['+_0x285299+']';if(_0x31ec29[_0xe36149(0x190)]){if(_0x2a55c4['has'](_0x31ec29['name'])){const _0x4e8a86=_0x2a55c4['get'](_0x31ec29[_0xe36149(0x190)]);_0x44317d[_0xe36149(0x159)](createIssue('error',_0x536965+_0xe36149(0x1d7),_0xe36149(0x1de),_0xe36149(0x19e)+_0x31ec29[_0xe36149(0x190)]+_0xe36149(0x15a)+_0x4e8a86+'])',_0x3bd257));}else _0x2a55c4[_0xe36149(0x197)](_0x31ec29[_0xe36149(0x190)],_0x285299);}_0x44317d['push'](...validateStep(_0x31ec29,_0x536965,_0x3bd257,_0x5ef217));}}_0x12ec46[_0xe36149(0x199)]&&_0x44317d['push'](...validateCriteria(_0x12ec46['entry_criteria'],_0x12eee7+'.entry_criteria',_0x3bd257));if(_0x12ec46[_0xe36149(0x176)])for(let _0x3d3781=0x0;_0x3d3781<_0x12ec46[_0xe36149(0x176)][_0xe36149(0x154)];_0x3d3781++){_0x44317d[_0xe36149(0x159)](...validateCriteria(_0x12ec46[_0xe36149(0x176)][_0x3d3781],_0x12eee7+_0xe36149(0x144)+_0x3d3781+']',_0x3bd257));}return _0x12ec46[_0xe36149(0x18d)]&&_0x44317d['push'](...validateCriteria(_0x12ec46[_0xe36149(0x18d)],_0x12eee7+_0xe36149(0x139),_0x3bd257)),_0x44317d['push'](...validateStageStructure(_0x12ec46,_0xbc6c03,_0x137e31,_0x3bd257)),_0x44317d['push'](...validateFlowControl(_0x12ec46,_0xbc6c03,_0x3bd257)),_0x44317d;}function validateStagesForVersion(_0x30bcdf,_0x20a9c1,_0x3ea55d,_0x10e244,_0x414ee6,_0x233f1d,_0x3f5b9d){const _0x5b489b=a136_0x44f5;if(_0x30bcdf[_0x5b489b(0x154)]===0x0){_0x414ee6[_0x5b489b(0x159)]({'level':_0x5b489b(0x1ba),'path':_0x10e244+_0x5b489b(0x1bb),'code':'MISSING_STAGES','message':_0x5b489b(0x1c6),'location':getLocationFromPath(_0x3ea55d[_0x5b489b(0x15c)],_0x3ea55d['source'],[_0x5b489b(0x1bb)])});return;}const _0x2d7997=new Set();for(const _0x240593 of _0x30bcdf){if(_0x240593[_0x5b489b(0x14b)])for(const _0x4a770f of _0x240593[_0x5b489b(0x14b)]){_0x4a770f[_0x5b489b(0x190)]&&_0x2d7997[_0x5b489b(0x1b7)](_0x4a770f[_0x5b489b(0x190)]);}}const _0x5bea30={..._0x3ea55d,'stepNames':_0x2d7997},_0x123bc9=validateVersionStructure(_0x30bcdf,_0x5bea30);for(const _0x1ac567 of _0x123bc9){const _0x1542b5=_0x10e244?{..._0x1ac567,'path':''+_0x10e244+_0x1ac567[_0x5b489b(0x1b2)]}:_0x1ac567;if(_0x1542b5['level']===_0x5b489b(0x1ba))_0x414ee6['push'](_0x1542b5);else _0x233f1d['push'](_0x1542b5);}for(let _0x1a4512=0x0;_0x1a4512<_0x30bcdf[_0x5b489b(0x154)];_0x1a4512++){const _0x17eaf3=validateStage(_0x30bcdf[_0x1a4512],_0x1a4512,_0x30bcdf[_0x5b489b(0x154)],_0x5bea30);for(const _0x6b8e23 of _0x17eaf3){const _0x127059=_0x10e244?{..._0x6b8e23,'path':''+_0x10e244+_0x6b8e23[_0x5b489b(0x1b2)]}:_0x6b8e23;if(_0x127059[_0x5b489b(0x151)]===_0x5b489b(0x1ba))_0x414ee6[_0x5b489b(0x159)](_0x127059);else _0x233f1d[_0x5b489b(0x159)](_0x127059);}}if(_0x20a9c1[_0x5b489b(0x158)]){const _0x17fcda=_0x3f5b9d?.[_0x5b489b(0x157)]?'goal':_0x10e244+'goal',_0x9b211c=validateCriteria(_0x20a9c1['goal'],_0x17fcda,_0x5bea30);for(const _0xe6842d of _0x9b211c){if(_0xe6842d[_0x5b489b(0x151)]==='error')_0x414ee6[_0x5b489b(0x159)](_0xe6842d);else _0x233f1d[_0x5b489b(0x159)](_0xe6842d);}}}function extractVersionIndex(_0x3b4536){const _0x1bebb4=a136_0x44f5,_0x191941=_0x3b4536[_0x1bebb4(0x1db)](/^journeys\[(\d+)\]\./);return _0x191941?_0x191941[0x1]:undefined;}function deduplicateAcrossVersions(_0x70eabc){const _0x1baef0=a136_0x44f5,_0x1fafdf=new Map();for(let _0x3b119b=0x0;_0x3b119b<_0x70eabc[_0x1baef0(0x154)];_0x3b119b++){const _0x58ec27=_0x70eabc[_0x3b119b]['code']+':'+_0x70eabc[_0x3b119b][_0x1baef0(0x1b8)],_0x27db7f=extractVersionIndex(_0x70eabc[_0x3b119b][_0x1baef0(0x1b2)]),_0x24fa4b=_0x1fafdf['get'](_0x58ec27);if(_0x24fa4b){_0x24fa4b[_0x1baef0(0x18a)]['push'](_0x3b119b);if(_0x27db7f)_0x24fa4b['versions'][_0x1baef0(0x1b7)](_0x27db7f);}else _0x1fafdf[_0x1baef0(0x197)](_0x58ec27,{'indices':[_0x3b119b],'versions':new Set(_0x27db7f?[_0x27db7f]:[])});}const _0x2c6e86=new Set();for(const {indices:_0x433e4f,versions:_0x260cda}of _0x1fafdf['values']()){if(_0x260cda[_0x1baef0(0x17a)]<=0x1)continue;const _0x29187d=_0x70eabc[_0x433e4f[0x0]];_0x29187d[_0x1baef0(0x1b2)]=_0x29187d[_0x1baef0(0x1b2)][_0x1baef0(0x1c0)](/^journeys\[\d+\]\./,''),_0x29187d[_0x1baef0(0x1b8)]=_0x29187d[_0x1baef0(0x1b8)]+_0x1baef0(0x1e0)+_0x260cda[_0x1baef0(0x17a)]+_0x1baef0(0x1d3);for(let _0x50db48=0x1;_0x50db48<_0x433e4f[_0x1baef0(0x154)];_0x50db48++){_0x2c6e86[_0x1baef0(0x1b7)](_0x433e4f[_0x50db48]);}}const _0x90fbf=[..._0x2c6e86][_0x1baef0(0x1e9)]((_0x8c6aa4,_0x20ffe9)=>_0x20ffe9-_0x8c6aa4);for(const _0x19b0be of _0x90fbf){_0x70eabc[_0x1baef0(0x1d8)](_0x19b0be,0x1);}}export function validateJourneyDef(_0x7c15cb,_0xa83a0c={},_0x2f3b18={}){const _0x148add=a136_0x44f5;if(_0x2f3b18[_0x148add(0x18b)])return runJourneySemanticChecks(_0x7c15cb,_0xa83a0c);const _0x113508=JourneyDefSchema[_0x148add(0x180)](_0x7c15cb);if(_0x113508[_0x148add(0x1c8)])return runJourneySemanticChecks(_0x113508[_0x148add(0x192)],_0xa83a0c);return zodErrorsToJourneyValidationResult(_0x113508[_0x148add(0x1ba)],_0xa83a0c);}function zodErrorsToJourneyValidationResult(_0x29aae6,_0x4365d9){const _0x455b1c=a136_0x44f5,_0x541d0e=flattenZodIssues(_0x29aae6[_0x455b1c(0x175)]),_0x12438a=_0x541d0e[_0x455b1c(0x13c)](_0x280e2e=>{const _0x3f5e8f=_0x455b1c,_0x5d5a0b=formatZodPath(_0x280e2e[_0x3f5e8f(0x1b2)]),_0x54559e=mapJourneyZodIssueToCode(_0x280e2e,_0x5d5a0b),_0x5da205=getLocationFromPath(_0x4365d9['document'],_0x4365d9['source'],_0x280e2e[_0x3f5e8f(0x1b2)]['map'](_0x56edf8=>typeof _0x56edf8===_0x3f5e8f(0x1ce)?String(_0x56edf8):_0x56edf8));return{'level':_0x3f5e8f(0x1ba),'path':_0x5d5a0b,'code':_0x54559e,'message':_0x280e2e[_0x3f5e8f(0x1b8)],..._0x5da205&&{'location':_0x5da205}};});return{'valid':![],'errors':_0x12438a,'warnings':[]};}function mapJourneyZodIssueToCode(_0xb66569,_0x14093e){const _0x3908cc=a136_0x44f5;if(_0x14093e===_0x3908cc(0x190))return'MISSING_NAME';if(_0x14093e[_0x3908cc(0x1bf)](_0x3908cc(0x165))&&_0x14093e[_0x3908cc(0x13d)](_0x3908cc(0x14b)))return _0x3908cc(0x1aa);if(_0x14093e===_0x3908cc(0x1bb)||_0x14093e[_0x3908cc(0x1bf)](_0x3908cc(0x14e)))return _0x3908cc(0x16c);if(_0x14093e===''&&_0xb66569[_0x3908cc(0x1b8)][_0x3908cc(0x13d)]('journeys,\x20stages,\x20or\x20versions'))return _0x3908cc(0x16c);if(_0x14093e[_0x3908cc(0x13d)](_0x3908cc(0x1a7)))return'ACTIVATION_SCHEMA_ERROR';return _0x3908cc(0x1aa);}function runJourneySemanticChecks(_0x101f5b,_0xe30b69){const _0x49e18f=a136_0x44f5,_0x3431ea=[],_0x58823a=[];(!_0x101f5b[_0x49e18f(0x190)]||_0x101f5b[_0x49e18f(0x190)][_0x49e18f(0x1c2)]()==='')&&_0x3431ea['push']({'level':_0x49e18f(0x1ba),'path':'name','code':_0x49e18f(0x153),'message':_0x49e18f(0x169),'location':getLocationFromPath(_0xe30b69[_0x49e18f(0x15c)],_0xe30b69[_0x49e18f(0x1bd)],['name'])});const _0x3b9435=new Set();if(_0x101f5b[_0x49e18f(0x1d2)])for(const _0x2be0d7 of Object[_0x49e18f(0x1b4)](_0x101f5b['segments'])){_0x3b9435[_0x49e18f(0x1b7)](_0x2be0d7);}const _0x45a8b1=new Set();if(_0x101f5b['activations'])for(const _0x4ac9d6 of Object[_0x49e18f(0x1b4)](_0x101f5b[_0x49e18f(0x132)])){_0x45a8b1['add'](_0x4ac9d6);}const _0x5b988f=new Set(),_0x573431={..._0xe30b69,'embeddedSegments':_0x3b9435,'referencedSegments':_0x5b988f,'activationKeys':_0x45a8b1[_0x49e18f(0x17a)]>0x0?_0x45a8b1:undefined};if(_0x101f5b[_0x49e18f(0x1d2)])for(const [_0x2eb080,_0x43ca0e]of Object[_0x49e18f(0x189)](_0x101f5b[_0x49e18f(0x1d2)])){const _0x5e462c=validateEmbeddedSegment(_0x43ca0e,_0x49e18f(0x1df)+_0x2eb080,_0x573431);for(const _0x5892e1 of _0x5e462c){if(_0x5892e1[_0x49e18f(0x151)]===_0x49e18f(0x1ba))_0x3431ea[_0x49e18f(0x159)](_0x5892e1);else _0x58823a['push'](_0x5892e1);}}const _0x1ba5c4=!!_0x101f5b['goal'],_0x1b152f=_0x101f5b['journeys']?.['every'](_0x115cf3=>!!_0x115cf3['goal'])??![];!_0x1ba5c4&&!_0x1b152f&&_0x58823a['push']({'level':_0x49e18f(0x17e),'path':_0x49e18f(0x158),'code':_0x49e18f(0x135),'message':_0x49e18f(0x1dc),'location':getLocationFromPath(_0xe30b69['document'],_0xe30b69[_0x49e18f(0x1bd)],[_0x49e18f(0x158)])});const _0x2e3f0d=_0x101f5b[_0x49e18f(0x1af)]??_0x101f5b['versions'];if(_0x2e3f0d&&_0x2e3f0d[_0x49e18f(0x182)](_0x3f62b9=>_0x3f62b9['latest']===!![])['length']>0x1){const _0x2256fe=_0x101f5b[_0x49e18f(0x1af)]?_0x49e18f(0x1af):_0x49e18f(0x181);_0x3431ea[_0x49e18f(0x159)]({'level':'error','path':_0x2256fe,'code':'DUPLICATE_LATEST','message':_0x49e18f(0x179)+(_0x2256fe===_0x49e18f(0x1af)?'journey\x20entry':_0x49e18f(0x16f))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0xe30b69['document'],_0xe30b69['source'],[_0x2256fe])});}if(_0x101f5b['journeys']&&_0x101f5b[_0x49e18f(0x1af)][_0x49e18f(0x154)]>0x0)for(let _0xfd754=0x0;_0xfd754<_0x101f5b[_0x49e18f(0x1af)][_0x49e18f(0x154)];_0xfd754++){const _0x97ee51=_0x101f5b[_0x49e18f(0x1af)][_0xfd754];if(_0x101f5b[_0x49e18f(0x1af)][_0x49e18f(0x154)]>0x1&&_0x97ee51['state']===_0x49e18f(0x16a))continue;const _0x47987f=_0x97ee51['stages']||[],_0x419d40=_0x49e18f(0x18f)+_0xfd754+'].',_0x30c188=!!_0x97ee51[_0x49e18f(0x158)],_0x281da0=_0x30c188?{..._0x101f5b,'goal':_0x97ee51[_0x49e18f(0x158)]}:_0x101f5b;validateStagesForVersion(_0x47987f,_0x281da0,_0x573431,_0x419d40,_0x3431ea,_0x58823a,{'goalIsInherited':!_0x30c188});}else{if(_0x101f5b[_0x49e18f(0x181)]&&_0x101f5b[_0x49e18f(0x181)]['length']>0x0)for(let _0x282ec6=0x0;_0x282ec6<_0x101f5b[_0x49e18f(0x181)][_0x49e18f(0x154)];_0x282ec6++){const _0x9c1d2d=_0x101f5b[_0x49e18f(0x181)][_0x282ec6];if(_0x101f5b['versions'][_0x49e18f(0x154)]>0x1&&_0x9c1d2d[_0x49e18f(0x17c)]===_0x49e18f(0x16a))continue;const _0x1c844b=_0x9c1d2d[_0x49e18f(0x1bb)]||[],_0x35ea8a=_0x49e18f(0x1a6)+_0x282ec6+'].';validateStagesForVersion(_0x1c844b,_0x101f5b,_0x573431,_0x35ea8a,_0x3431ea,_0x58823a);}else{const _0x1540a0=_0x101f5b['stages']||[];validateStagesForVersion(_0x1540a0,_0x101f5b,_0x573431,'',_0x3431ea,_0x58823a);}}_0x101f5b[_0x49e18f(0x1af)]&&_0x101f5b['journeys'][_0x49e18f(0x154)]>0x1&&(deduplicateAcrossVersions(_0x3431ea),deduplicateAcrossVersions(_0x58823a));for(const _0x17b1e2 of _0x3b9435){!_0x5b988f[_0x49e18f(0x13e)](_0x17b1e2)&&!_0x17b1e2['startsWith'](_0x49e18f(0x1b5))&&_0x58823a[_0x49e18f(0x159)]({'level':_0x49e18f(0x17e),'path':_0x49e18f(0x1df)+_0x17b1e2,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x49e18f(0x1e3)+_0x17b1e2+_0x49e18f(0x15d),'location':getLocationFromPath(_0xe30b69[_0x49e18f(0x15c)],_0xe30b69[_0x49e18f(0x1bd)],[_0x49e18f(0x1d2),_0x17b1e2])});}return{'valid':_0x3431ea['length']===0x0,'errors':_0x3431ea,'warnings':_0x58823a};}
|