n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 4.67 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.13.4"}}catch(e){}}(),System.register([],(function(e,t){var n,r,a,i,s,o,c,u,l,f;function d(e,t=globalThis,n=["*"]){t.addEventListener("message",(function r(a){if(!a||!a.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin '${a.origin}' for comlink proxy`);const{id:o,type:c,path:u}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(S);let f;try{const t=u.slice(0,-1).reduce(((e,t)=>e[t]),e),n=u.reduce(((e,t)=>e[t]),e);switch(c){case"GET":f=n;break;case"SET":t[u.slice(-1)[0]]=S(a.data.value),f=!0;break;case"APPLY":f=n.apply(t,l);break;case"CONSTRUCT":f=w(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;d(e,n),f=E(t,[t])}break;case"RELEASE":f=void 0;break;default:return}}catch(g){f={value:g,[s]:0}}Promise.resolve(f).catch((e=>({value:e,[s]:0}))).then((n=>{const[a,s]=v(n);t.postMessage(Object.assign(Object.assign({},a),{id:o}),s),"RELEASE"===c&&(t.removeEventListener("message",r),p(t),i in e&&"function"==typeof e[i]&&e[i]())})).catch((e=>{const[n,r]=v({value:new TypeError("Unserializable return value"),[s]:0});t.postMessage(Object.assign(Object.assign({},n),{id:o}),r)}))})),t.start&&t.start()}function p(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function g(e,t){return b(e,[],t)}function y(e){if(e)throw new Error("Proxy has been released and is not useable")}function m(e){return T(e,{type:"RELEASE"}).then((()=>{p(e)}))}function b(e,t=[],n=function(){}){let i=!1;const s=new Proxy(n,{get(n,r){if(y(i),r===a)return()=>{!function(e){l&&l.unregister(e)}(s),m(e),i=!0};if("then"===r){if(0===t.length)return{then:()=>s};const n=T(e,{type:"GET",path:t.map((e=>e.toString()))}).then(S);return n.then.bind(n)}return b(e,[...t,r])},set(n,r,a){y(i);const[s,o]=v(a);return T(e,{type:"SET",path:[...t,r].map((e=>e.toString())),value:s},o).then(S)},apply(n,a,s){y(i);const o=t[t.length-1];if(o===r)return T(e,{type:"ENDPOINT"}).then(S);if("bind"===o)return b(e,t.slice(0,-1));const[c,u]=h(s);return T(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:c},u).then(S)},construct(n,r){y(i);const[a,s]=h(r);return T(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:a},s).then(S)}});return function(e,t){const n=(u.get(t)||0)+1;u.set(t,n),l&&l.register(e,t,e)}(s,e),s}function h(e){const t=e.map(v);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}function E(e,t){return f.set(e,t),e}function w(e){return Object.assign(e,{[n]:!0})}function v(e){for(const[t,n]of c)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},f.get(e)||[]]}function S(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function T(e,t,n){return new Promise((r=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===a&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),n)}))}return e({n:E,r:g,t:w}),{setters:[],execute:function(){try{e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(t=(new e.Error).stack)&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c7772eaa-cf9d-40c7-9ef3-e0c9a77f7185",e._sentryDebugIdIdentifier="sentry-dbid-c7772eaa-cf9d-40c7-9ef3-e0c9a77f7185")}catch(e){}var e,t;n=Symbol("Comlink.proxy"),r=Symbol("Comlink.endpoint"),a=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.finalizer"),s=Symbol("Comlink.thrown"),o=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>o(e)&&e[n],serialize(e){const{port1:t,port2:n}=new MessageChannel;return d(e,t),[n,[n]]},deserialize:e=>(e.start(),g(e))}],["throw",{canHandle:e=>o(e)&&s in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]),u=new WeakMap,l="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(u.get(e)||0)-1;u.set(e,t),0===t&&m(e)})),f=new WeakMap}}}));
//# sourceMappingURL=comlink-legacy-DWRhlxf2.js.map