n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 30.4 kB
JavaScript
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./chunk-legacy-Dz3fjYb5.js","./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./useClipboard-legacy-DnQV92ly.js","./usePinnedData-legacy-BfjAvFWp.js","./useInjectWorkflowId-legacy-piYT0WDS.js"],(function(e,t){var r,n,s,i,a,o,l,c,h,p,u,d,f,b,y,g,E,x,_,m,v,O,w,A,C,P,k,D,S,j,I,T,R,N,$,U,M,L,B,K,F,X,H,J,Y,Q,G,W,V,q,z;function Z(e,t){return(e=e.slice()).push(t),e}function ee(e,t){return(t=t.slice()).unshift(e),t}function te(e,t,r,n,s){if(!(this instanceof te))try{return new te(e,t,r,n,s)}catch(a){if(!a.avoidNew)throw a;return a.value}"string"==typeof e&&(s=n,n=r,r=t,t=e,e=null);const i=e&&"object"==typeof e;if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.eval=void 0===e.eval?"safe":e.eval,this.ignoreEvalErrors=void 0!==e.ignoreEvalErrors&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||s||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){const n={path:i?e.path:t};i?"json"in e&&(n.json=e.json):n.json=r;const s=this.evaluate(n);if(!s||"object"!=typeof s)throw new G(s);return s}}return{setters:[function(e){e.o},function(e){r=e.$,n=e.A,s=e.C,i=e.E,a=e.Ft,o=e.N,l=e.R,c=e.S,h=e.Sn,p=e.Wt,u=e._n,d=e.j,f=e.w,b=e.yt},function(e){y=e.at},function(e){g=e.Ht,E=e.Mi,x=e.Ut,_=e.Wt,m=e.ct},function(e){v=e.t},function(e){O=e.Pi,w=e.Pn,A=e.fr,C=e.gr,P=e.lr,k=e.ma,D=e.pa},function(e){S=e.L,j=e.eo,I=e.xc},function(e){T=e.t},function(e){R=e.t},function(e){N=e.t}],execute:function(){($=document.createElement("style")).textContent="._actionsGroup_1eyin_125{z-index:10;padding-right:var(--spacing--sm);opacity:0;transition:opacity .3s;position:absolute;top:0;right:0}\n/*$vite$:1*/",document.head.appendChild($);try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(re=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[re]="66fd6058-1e96-41f1-832c-2691d71fb662",t._sentryDebugIdIdentifier="sentry-dbid-66fd6058-1e96-41f1-832c-2691d71fb662")}catch(t){}var t,re;U=class{add(e,t,r){if("string"!=typeof arguments[0])for(let n in arguments[0])this.add(n,arguments[0][n],arguments[1]);else(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)}),this)}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}},M=class{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.forEach((e=>{if("object"!=typeof e||!e.name||!e.init)throw new Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)}))}},L=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,r,n){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=r,n?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,r){return e.literals[t]=r,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map((e=>e.length)))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(t,r){if(e.hooks[t]){const n={context:this,node:r};return e.hooks.run(t,n),n.node}return r}searchHook(t){if(e.hooks[t]){const r={context:this};return e.hooks[t].find((function(e){return e.call(r.context,r),r.node})),r.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),r=1===t.length?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r,n,s=[];for(;this.index<this.expr.length;)if(r=this.code,r===e.SEMCOL_CODE||r===e.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())s.push(n);else if(this.index<this.expr.length){if(r===t)break;this.throwError('Unexpected "'+this.char+'"')}return s}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),r=t.length;for(;r>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,s,i,a,o,l,c;if(a=this.gobbleToken(),!a)return a;if(r=this.gobbleBinaryOp(),!r)return a;for(i={value:r,prec:e.binaryPrecedence(r),right_a:e.right_associative.has(r)},o=this.gobbleToken(),o||this.throwError("Expected expression after "+r),s=[a,i,o];r=this.gobbleBinaryOp();){if(n=e.binaryPrecedence(r),0===n){this.index-=r.length;break}i={value:r,prec:n,right_a:e.right_associative.has(r)},c=r;const l=e=>i.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;s.length>2&&l(s[s.length-2]);)o=s.pop(),r=s.pop().value,a=s.pop(),t={type:e.BINARY_EXP,operator:r,left:a,right:o},s.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+c),s.push(i,t)}for(l=s.length-1,t=s[l];l>1;)t={type:e.BINARY_EXP,operator:s[l-1].value,left:s[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,s;if(this.gobbleSpaces(),s=this.searchHook("gobble-token"),s)return this.runHook("after-token",s);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)s=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)s=this.gobbleArray();else{for(r=this.expr.substr(this.index,e.max_unop_len),n=r.length;n>0;){if(e.unary_ops.hasOwnProperty(r)&&(!e.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;const t=this.gobbleToken();return t||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:r,argument:t,prefix:!0})}r=r.substr(0,--n)}e.isIdentifierStart(t)?(s=this.gobbleIdentifier(),e.literals.hasOwnProperty(s.name)?s={type:e.LITERAL,value:e.literals[s.name],raw:s.name}:s.name===e.this_str&&(s={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(s=this.gobbleGroup())}return s?(s=this.gobbleTokenProperty(s),this.runHook("after-token",s)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===e.PERIOD_CODE||r===e.OBRACK_CODE||r===e.OPAREN_CODE||r===e.QUMARK_CODE;){let n;if(r===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===e.OBRACK_CODE?((t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(r===e.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t,r,n="";for(;e.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(t=this.char,"e"===t||"E"===t){for(n+=this.expr.charAt(this.index++),t=this.char,"+"!==t&&"-"!==t||(n+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return r=this.code,e.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(r===e.PERIOD_CODE||1===n.length&&n.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(n),raw:n}}gobbleStringLiteral(){let t="";const r=this.index,n=this.expr.charAt(this.index++);let s=!1;for(;this.index<this.expr.length;){let e=this.expr.charAt(this.index++);if(e===n){s=!0;break}if("\\"===e)switch(e=this.expr.charAt(this.index++),e){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=e}else t+=e}return s||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){const r=[];let n=!1,s=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===t){n=!0,this.index++,t===e.CPAREN_CODE&&s&&s>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}if(i===e.COMMA_CODE){if(this.index++,s++,s!==r.length)if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let e=r.length;e<s;e++)r.push(null)}else if(r.length!==s&&0!==s)this.throwError("Expected comma");else{const t=this.gobbleExpression();t&&t.type!==e.COMPOUND||this.throwError("Expected comma"),r.push(t)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,1===t.length?t[0]:!!t.length&&{type:e.SEQUENCE_EXP,expressions:t};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},B=new U,Object.assign(L,{hooks:B,plugins:new M(L),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),L.max_unop_len=L.getMaxKeyLen(L.unary_ops),L.max_binop_len=L.getMaxKeyLen(L.binary_ops),K=e=>new L(e).parse(),F=Object.getOwnPropertyNames(class{}),Object.getOwnPropertyNames(L).filter((e=>!F.includes(e)&&void 0===K[e])).forEach((e=>{K[e]=L[e]})),K.Jsep=L,K.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const s=this.gobbleExpression();if(s||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:s},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}}))}}),X={name:"regex",init(e){e.hooks.add("gobble-token",(function(r){if(47===this.code){const n=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(n,this.index);let i,a="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;a+=this.char}try{i=new RegExp(s,a)}catch(t){this.throwError(t.message)}return r.node={type:e.LITERAL,value:i,raw:this.expr.slice(n-1,this.index)},r.node=this.gobbleTokenProperty(r.node),r.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}},H={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(e){const t=[e.IDENTIFIER,e.MEMBER_EXP];function r(e){H.assignmentOperators.has(e.operator)?(e.type="AssignmentExpression",r(e.left),r(e.right)):e.operator||Object.values(e).forEach((e=>{e&&"object"==typeof e&&r(e)}))}H.assignmentOperators.forEach((t=>e.addBinaryOp(t,H.assignmentPrecedence,!0))),e.hooks.add("gobble-token",(function(e){const r=this.code;H.updateOperators.some((e=>e===r&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},e.node.argument&&t.includes(e.node.argument.type)||this.throwError(`Unexpected ${e.node.operator}`))})),e.hooks.add("after-token",(function(e){if(e.node){const r=this.code;H.updateOperators.some((e=>e===r&&e===this.expr.charCodeAt(this.index+1)))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:"UpdateExpression",operator:43===r?"++":"--",argument:e.node,prefix:!1})}})),e.hooks.add("after-expression",(function(e){e.node&&r(e.node)}))}},K.plugins.register(X,H),K.addUnaryOp("typeof"),K.addUnaryOp("void"),K.addLiteral("null",null),K.addLiteral("undefined",void 0),J=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),Y={evalAst(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":return Y.evalBinaryExpression(e,t);case"Compound":return Y.evalCompound(e,t);case"ConditionalExpression":return Y.evalConditionalExpression(e,t);case"Identifier":return Y.evalIdentifier(e,t);case"Literal":return Y.evalLiteral(e,t);case"MemberExpression":return Y.evalMemberExpression(e,t);case"UnaryExpression":return Y.evalUnaryExpression(e,t);case"ArrayExpression":return Y.evalArrayExpression(e,t);case"CallExpression":return Y.evalCallExpression(e,t);case"AssignmentExpression":return Y.evalAssignmentExpression(e,t);default:throw SyntaxError("Unexpected expression",e)}},evalBinaryExpression:(e,t)=>({"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](Y.evalAst(e.left,t),(()=>Y.evalAst(e.right,t)))),evalCompound(e,t){let r;for(let n=0;n<e.body.length;n++){"Identifier"===e.body[n].type&&["var","let","const"].includes(e.body[n].name)&&e.body[n+1]&&"AssignmentExpression"===e.body[n+1].type&&(n+=1);const s=e.body[n];r=Y.evalAst(s,t)}return r},evalConditionalExpression:(e,t)=>Y.evalAst(e.test,t)?Y.evalAst(e.consequent,t):Y.evalAst(e.alternate,t),evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral:e=>e.value,evalMemberExpression(e,t){const r=String(e.computed?Y.evalAst(e.property):e.property.name),n=Y.evalAst(e.object,t);if(null==n)throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);if(!Object.hasOwn(n,r)&&J.has(r))throw TypeError(`Cannot read properties of ${n} (reading '${r}')`);const s=n[r];return"function"==typeof s?s.bind(n):s},evalUnaryExpression:(e,t)=>({"-":e=>-Y.evalAst(e,t),"!":e=>!Y.evalAst(e,t),"~":e=>~Y.evalAst(e,t),"+":e=>+Y.evalAst(e,t),typeof:e=>typeof Y.evalAst(e,t),void:e=>{Y.evalAst(e,t)}}[e.operator](e.argument)),evalArrayExpression:(e,t)=>e.elements.map((e=>Y.evalAst(e,t))),evalCallExpression(e,t){const r=e.arguments.map((e=>Y.evalAst(e,t))),n=Y.evalAst(e.callee,t);if(n===Function)throw new Error("Function constructor is disabled");return n(...r)},evalAssignmentExpression(e,t){if("Identifier"!==e.left.type)throw SyntaxError("Invalid left-hand side in assignment");const r=e.left.name;return t[r]=Y.evalAst(e.right,t),t[r]}},Q=class{constructor(e){this.code=e,this.ast=K(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return Y.evalAst(this.ast,t)}},G=class extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}},te.prototype.evaluate=function(e,t,r,n){let s=this.parent,i=this.parentProperty,{flatten:a,wrap:o}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"==typeof e&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),a=Object.hasOwn(e,"flatten")?e.flatten:a,this.currResultType=Object.hasOwn(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,"sandbox")?e.sandbox:this.currSandbox,o=Object.hasOwn(e,"wrap")?e.wrap:o,this.currEval=Object.hasOwn(e,"eval")?e.eval:this.currEval,r=Object.hasOwn(e,"callback")?e.callback:r,this.currOtherTypeCallback=Object.hasOwn(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,s=Object.hasOwn(e,"parent")?e.parent:s,i=Object.hasOwn(e,"parentProperty")?e.parentProperty:i,e=e.path}if(s=s||null,i=i||null,Array.isArray(e)&&(e=te.toPathString(e)),!e&&""!==e||!t)return;const l=te.toPathArray(e);"$"===l[0]&&l.length>1&&l.shift(),this._hasParentSelector=null;const c=this._trace(l,t,["$"],s,i,r).filter((function(e){return e&&!e.isParentSelector}));return c.length?o||1!==c.length||c[0].hasArrExpr?c.reduce(((e,t)=>{const r=this._getPreferredOutput(t);return a&&Array.isArray(r)?e=e.concat(r):e.push(r),e}),[]):this._getPreferredOutput(c[0]):o?[]:void 0},te.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:te.toPathArray(e.path);return e.pointer=te.toPointer(t),e.path="string"==typeof e.path?e.path:te.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return te.toPathString(e[t]);case"pointer":return te.toPointer(e.path);default:throw new TypeError("Unknown result type")}},te.prototype._handleCallback=function(e,t,r){if(t){const n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:te.toPathString(e.path),t(n,r,e)}},te.prototype._trace=function(e,t,r,n,s,i,a,o){let l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:s,hasArrExpr:a},this._handleCallback(l,i,"value"),l;const c=e[0],h=e.slice(1),p=[];function u(e){Array.isArray(e)?e.forEach((e=>{p.push(e)})):p.push(e)}if(("string"!=typeof c||o)&&t&&Object.hasOwn(t,c))u(this._trace(h,t[c],Z(r,c),t,c,i,a));else if("*"===c)this._walk(t,(e=>{u(this._trace(h,t[e],Z(r,e),t,e,i,!0,!0))}));else if(".."===c)u(this._trace(h,t,r,n,s,i,a)),this._walk(t,(n=>{"object"==typeof t[n]&&u(this._trace(e.slice(),t[n],Z(r,n),t,n,i,!0))}));else{if("^"===c)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if("~"===c)return l={path:Z(r,c),value:s,parent:n,parentProperty:null},this._handleCallback(l,i,"property"),l;if("$"===c)u(this._trace(h,t,r,null,null,i,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))u(this._slice(c,h,t,r,n,s,i));else if(0===c.indexOf("?(")){if(!1===this.currEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=c.replace(/^\?\((.*?)\)$/u,"$1"),a=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);a?this._walk(t,(e=>{const o=[a[2]],l=a[1]?t[e][a[1]]:t[e];this._trace(o,l,r,n,s,i,!0).length>0&&u(this._trace(h,t[e],Z(r,e),t,e,i,!0))})):this._walk(t,(a=>{this._eval(e,t[a],a,r,n,s)&&u(this._trace(h,t[a],Z(r,a),t,a,i,!0))}))}else if("("===c[0]){if(!1===this.currEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");u(this._trace(ee(this._eval(c,t,r.at(-1),r.slice(0,-1),n,s),h),t,r,n,s,i,a))}else if("@"===c[0]){let e=!1;const a=c.slice(1,-2);switch(a){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===a&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===a&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,r,n,s);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+a)}if(e)return l={path:r,value:t,parent:n,parentProperty:s},this._handleCallback(l,i,"value"),l}else if("`"===c[0]&&t&&Object.hasOwn(t,c.slice(1))){const e=c.slice(1);u(this._trace(h,t[e],Z(r,e),t,e,i,a,!0))}else if(c.includes(",")){const e=c.split(",");for(const a of e)u(this._trace(ee(a,h),t,r,n,s,i,!0))}else!o&&t&&Object.hasOwn(t,c)&&u(this._trace(h,t[c],Z(r,c),t,c,i,a,!0))}if(this._hasParentSelector)for(let d=0;d<p.length;d++){const e=p[d];if(e&&e.isParentSelector){const r=this._trace(e.expr,t,e.path,n,s,i,a);if(Array.isArray(r)){p[d]=r[0];const e=r.length;for(let t=1;t<e;t++)d++,p.splice(d,0,r[t])}else p[d]=r}}return p},te.prototype._walk=function(e,t){if(Array.isArray(e)){const r=e.length;for(let e=0;e<r;e++)t(e)}else e&&"object"==typeof e&&Object.keys(e).forEach((e=>{t(e)}))},te.prototype._slice=function(e,t,r,n,s,i,a){if(!Array.isArray(r))return;const o=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1;let h=l[0]&&Number.parseInt(l[0])||0,p=l[1]&&Number.parseInt(l[1])||o;h=h<0?Math.max(0,h+o):Math.min(o,h),p=p<0?Math.max(0,p+o):Math.min(o,p);const u=[];for(let d=h;d<p;d+=c)this._trace(ee(d,t),r,n,s,i,a,!0).forEach((e=>{u.push(e)}));return u},te.prototype._eval=function(e,r,n,s,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=r;const o=e.includes("@path");o&&(this.currSandbox._$_path=te.toPathString(s.concat([n])));const l=this.currEval+"Script:"+e;if(!te.cache[l]){let t=e.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(o&&(t=t.replaceAll("@path","_$_path")),"safe"===this.currEval||!0===this.currEval||void 0===this.currEval)te.cache[l]=new this.safeVm.Script(t);else if("native"===this.currEval)te.cache[l]=new this.vm.Script(t);else if("function"==typeof this.currEval&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const e=this.currEval;te.cache[l]=new e(t)}else{if("function"!=typeof this.currEval)throw new TypeError(`Unknown "eval" property "${this.currEval}"`);te.cache[l]={runInNewContext:e=>this.currEval(t,e)}}}try{return te.cache[l].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+t.message+": "+e)}},te.cache={},te.toPathString=function(e){const t=e,r=t.length;let n="$";for(let s=1;s<r;s++)/^(~|\^|@.*?\(\))$/u.test(t[s])||(n+=/^[0-9*]+$/u.test(t[s])?"["+t[s]+"]":"['"+t[s]+"']");return n},te.toPointer=function(e){const t=e,r=t.length;let n="";for(let s=1;s<r;s++)/^(~|\^|@.*?\(\))$/u.test(t[s])||(n+="/"+t[s].toString().replaceAll("~","~0").replaceAll("/","~1"));return n},te.toPathArray=function(e){const{cache:t}=te;if(t[e])return t[e].concat();const r=[];return t[e]=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,(function(e,t){return"[#"+(r.push(t)-1)+"]"})).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,(function(e,t){return"['"+t.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"})).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,(function(e,t){return";"+t.split("").join(";")+";"})).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map((function(e){const t=e.match(/#(\d+)/u);return t&&t[1]?r[t[1]]:e})),t[e].concat()},te.prototype.safeVm={Script:Q},W=function(e,t,r){const n=e.length;for(let s=0;s<n;s++)r(e[s])&&t.push(e.splice(s--,1)[0])},V=class{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const r=Object.keys(e),n=[];W(r,n,(t=>"function"==typeof e[t]));const s=r.map((t=>e[t]));t=n.reduce(((t,r)=>{let n=e[r].toString();return/function/u.test(n)||(n="function "+n),"var "+r+"="+n+";"+t}),"")+t,/(['"])use strict\1/u.test(t)||r.includes("arguments")||(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const i=t.lastIndexOf(";"),a=-1!==i?t.slice(0,i+1)+" return "+t.slice(i+1):" return "+t;return new Function(...r,a)(...s)}},te.prototype.vm={Script:V},q={class:"el-dropdown-link"},z=o({__name:"RunDataJsonActions",props:{node:{},paneType:{},pushRef:{},distanceFromActive:{},selectedJsonPath:{default:S},jsonData:{},outputIndex:{},runIndex:{},execution:{}},setup(e){const t=e,o=l(I,a()),v=c((()=>void 0!==o?.value)),$=N(),U=C(),M=T(),L=y(),B=P(),{activeNode:K}=U,F=R(K),{showToast:X}=w(),H=A(),J=m(),Y=c((()=>!0===J?.meta?.readOnlyCanvas)),Q=c((()=>t.selectedJsonPath===S)),G=c((()=>Q.value?'[""]':t.selectedJsonPath));function W(e){let r;if("value"===e.command)r=function(){let e;if(Q.value){const r=window!==window.parent&&window.parent.location.pathname.includes("/executions");e=F.hasData.value&&!r?D(F.data.value):O(B.getNodeInputData(t.node,t.runIndex,t.outputIndex,"output",j.Main,t.execution))}else e=te({path:G.value.startsWith("$")?G.value:`$${G.value}`,json:t.jsonData})[0];let r="";return r="object"==typeof e?JSON.stringify(e,null,2):e.toString(),r}(),X({title:L.baseText("runData.copyValue.toast"),message:"",type:"success",duration:2e3});else{let n="",s="";if("itemPath"===e.command){const e=function(){let e="",r="";const n=k(G.value).split("]"),s=n[0].slice(1);return r=n.slice(1).join("]"),e=`$item(${s}).$node["${t.node.name}"].json`,{path:r,startPath:e}}();n=e.startPath,s=e.path,X({title:L.baseText("runData.copyItemPath.toast"),message:"",type:"success",duration:2e3})}else if("parameterPath"===e.command){const e=function(){const e=k(G.value).split("]").slice(1).join("]");let r=`$node["${t.node.name}"].json`;return 1===t.distanceFromActive&&(r="$json"),{path:e,startPath:r}}();n=e.startPath,s=e.path,X({title:L.baseText("runData.copyParameterPath.toast"),message:"",type:"success",duration:2e3})}s.startsWith("[")||s.startsWith(".")||!s||(s+="."),r=`{{ ${n+s} }}`}const n={value:"selection",itemPath:"item_path",parameterPath:"parameter_path"}[e.command];H.track("User copied ndv data",{node_type:K?.type,push_ref:t.pushRef,run_index:t.runIndex,view:"json",copy_type:n,workflow_id:$.value,pane:t.paneType,in_execution_log:Y.value}),M.copy(r)}return(e,t)=>(r(),i("div",{class:u(e.$style.actionsGroup),"data-test-id":"ndv-json-actions"},[Q.value?(r(),f(p(E),{key:0,variant:"subtle",title:p(L).baseText("runData.copyToClipboard"),icon:"files",circle:!1,onClick:t[0]||(t[0]=e=>W({command:"value"}))},null,8,["title"])):(r(),f(p(g),{key:1,trigger:"click",teleported:!v.value,onCommand:W},{dropdown:b((()=>[d(p(_),null,{default:b((()=>[d(p(x),{command:{command:"value"}},{default:b((()=>[n(h(p(L).baseText("runData.copyValue")),1)])),_:1}),d(p(x),{command:{command:"itemPath"},divided:""},{default:b((()=>[n(h(p(L).baseText("runData.copyItemPath")),1)])),_:1}),d(p(x),{command:{command:"parameterPath"}},{default:b((()=>[n(h(p(L).baseText("runData.copyParameterPath")),1)])),_:1})])),_:1})])),default:b((()=>[s("span",q,[d(p(E),{variant:"subtle",title:p(L).baseText("runData.copyToClipboard"),icon:"files",circle:!1},null,8,["title"])])])),_:1},8,["teleported"]))],2))}}),e("default",v(z,[["__cssModules",{$style:{actionsGroup:"_actionsGroup_1eyin_125"}}]]))}}}));
//# sourceMappingURL=RunDataJsonActions-legacy-BO9fr5Hf.js.map