@highstate/designer 0.18.0 → 0.19.1
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{H72r7nSc.js → BLsOQd1H.js} +21 -21
- package/.output/public/_nuxt/{CtwNW5xN.js → C4zpeTvm.js} +1 -1
- package/.output/public/_nuxt/{DqRHBxBn.js → CEYFgC8B.js} +1 -1
- package/.output/public/_nuxt/{DFsBSlE_.js → DTAwr92a.js} +1 -1
- package/.output/public/_nuxt/SytC7lKg.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/033f259e-8ba9-4c82-8824-56febea80b7d.json +1 -0
- package/.output/public/_nuxt/{ih8zLb53.js → dwrHE3tM.js} +1 -1
- package/.output/public/_nuxt/{entry.BAsn-2au.css → entry.dxugZJXl.css} +1 -1
- package/.output/public/_nuxt/{graph-resolver-Cs66Hj63.js → graph-resolver-eG1ZUsYn.js} +1 -1
- package/.output/server/index.mjs +477 -477
- package/.output/server/package.json +1 -1
- package/package.json +4 -4
- package/.output/public/_nuxt/XrMy4kkt.js +0 -1
- package/.output/public/_nuxt/builds/meta/67bdb4cb-b70e-4916-9486-0f6cd2f9704f.json +0 -1
|
@@ -147,7 +147,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
147
147
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
148
148
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const u=n.sep[a];switch(u.type){case"newline":o.push(a);break;case"space":break;case"comment":u.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(wt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Pc(n.key)&&!wt(n.sep,"newline")){const o=Ut(n.start),a=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:u}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(wt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Ut(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):wt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!wt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||wt(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Mn(r),i=Ut(s);Vi(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
149
149
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
150
|
-
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mn(e),r=Ut(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mn(e),r=Ut(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Pp(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Op||null,prettyErrors:e}}function Cp(t,e={}){const{lineCounter:n,prettyErrors:r}=Pp(e),s=new Tp(n?.addNewLine),i=new kp(e);let o=null;for(const a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new wn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Ui(t,n)),o.warnings.forEach(Ui(t,n))),o}function xp(t,e,n){let r;const s=Cp(t,n);if(!s)return null;if(s.warnings.forEach(i=>sc(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}var Ge=G({title:Z().optional(),globalTitle:Z().optional(),description:Z().optional(),color:Z().optional(),icon:Z().optional(),iconColor:Z().optional(),avatarUrl:Z().optional(),secondaryIcon:Z().optional(),secondaryIconColor:Z().optional()}),rt=Ge.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),Cc=Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),cn=Ge.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Bp=G({createdAt:_e(),updatedAt:_e()}),ot=Z().regex(/^[a-z][a-z0-9-.]+$/,"Name must start with a letter and can only contain lowercase letters, numbers, dashes (-) and dots (.)").min(2).max(64),Cn=nn([Tr([ot,pe("."),pe("v"),qe().int().min(1)]),Tr([ot,pe("."),ot,pe("."),pe("v"),qe().int().min(1)]),Tr([ot,pe("."),ot,pe("."),ot,pe("."),pe("v"),qe().int().min(1)])]),ds=Z().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),js=G({type:Cn,required:Ce(),multiple:Ce(),field:Z()});G({type:Cn,extensions:Z().array().optional(),directExtensions:Z().array().optional(),inclusions:js.array().optional(),directInclusions:js.array().optional(),schema:En(),meta:Ge.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:qe()});var Dp=Symbol("runtimeSchema"),xc=gt(["composite","unit"]),Bc=G({schema:En(),[Dp]:hh(ke).optional(),required:Ce(),meta:Ge.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),Ki=G({type:Cn,required:Ce(),multiple:Ce(),meta:Ge.required({title:!0}).pick({title:!0,description:!0})}),Rp=G({type:ot,kind:xc,args:Ue(ds,Bc),inputs:Ue(ds,Ki),outputs:Ue(ds,Ki),meta:Ge.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:Z().optional(),defaultNamePrefix:Z()}),definitionHash:qe()}),Dc=G({x:qe(),y:qe()}),mt=Tr([Cn,":",ot]),Qt=G({instanceId:mt,output:Z()}),Fs=G({hubId:Z()}),jp=G({args:Ue(Z(),Bt()).optional(),inputs:Ue(Z(),Ke(Qt)).optional(),hubInputs:Ue(Z(),Ke(Fs)).optional(),injectionInputs:Ke(Fs).optional(),position:Dc.optional()}),hs=G({id:mt,kind:xc,type:Cn,name:ot,...jp.shape,resolvedInputs:Ue(Z(),Ke(Qt)).optional(),parentId:mt.optional(),outputs:Ue(Z(),Ke(Qt)).optional(),resolvedOutputs:Ue(Z(),Ke(Qt)).optional()}),Fp=G({position:Dc.optional(),inputs:Ke(Qt).optional(),injectionInputs:Ke(Fs).optional()}),zp=G({id:ge(),...Fp.shape}),Up=G({"c857cac5-caa6-4421-b82c-e561fbce6367":pe(!0),value:Z()});G({"348d020e-0d9e-4ae7-9415-b91af99f5339":pe(!0),id:qe(),value:Bt()});G({"6d7f9da0-9cb6-496d-b72e-cf85ee4d9cf8":pe(!0),id:qe()});var Mp=G({name:Z(),contentType:Z().optional(),size:qe().optional(),mode:qe().optional()}),Lp=nn([Z(),qe(),Ce(),Z().array()]);G({name:Z(),meta:Ge.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:Z().optional(),value:Lp.optional()});var qp=Bc.extend({readonly:Ce(),computed:Ce()}),Zp=G({package:Z(),path:Z().optional()});G({...Rp.shape,source:Zp,secrets:Ue(Z(),qp)});function ci(t){return"source"in t}var Vp=nn([G({type:pe("before-destroy")})]);G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:Vp});var Kp=G({name:Z()}),Hp=G({...Qt.shape,inclusion:js.optional()});G({instanceId:Z(),args:Ue(Z(),Bt()),inputs:Ue(Z(),Hp.array()),invokedTriggers:Kp.array(),secretNames:Z().array(),stateIdMap:Ue(mt,Z()),importBasePath:Z()});var Hi=new WeakMap;function Gp(t){const e=Up.safeParse(t);if(!e.success)return t;const n=Hi.get(t);if(n!==void 0)return n;const r=xp(e.data.value);return Hi.set(t,r),r}var Jp=Symbol("unitArtifactId"),Wp=G({"d55c63ac-3174-4756-808f-f778e99af0d1":pe(!0),[Jp]:Z().optional(),hash:Z(),meta:rt.optional()}),Yp=nn([G({type:pe("embedded"),isBinary:Ce().optional(),value:Z()}),G({type:pe("artifact"),...Wp.shape})]),Rc=G({meta:Mp,content:Yp}),jc=G({image:Z(),command:Z().array(),cwd:Z().optional(),env:Ue(Z(),Z()).optional(),files:Ue(Z(),Rc).optional()});G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:jc});var Fc=nn([G({type:pe("markdown"),content:Z()}),G({type:pe("qr"),content:Z(),showContent:ph(),language:Z().optional()}),G({type:pe("file"),file:Rc})]);G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:Fc.array()});G({name:Z(),image:Z(),params:Ue(Z(),Bt())});G({projectId:ge(),workerVersionId:ge(),apiUrl:kd(),apiKey:Z()});Et("type",[G({type:pe("host")})]);const Qp={id:"q8xbilhwpsn65zjlv5kz44qh"},Xp={id:"n0rfvpl9o77iqf29ff4kk5gf"},em={id:"pmn9y901jeiz2ydh93045l39"},tm={id:"qppfcerovu3h22o0x8rlpc3g"};Et("type",[G({type:pe("codebase")}),G({type:pe("database")})]);G({name:ot,spaceId:ge().default(Qp.id),modelStorageId:ge().default(tm.id),libraryId:ge().default(Xp.id),pulumiBackendId:ge().default(em.id),meta:rt});G({id:Z(),name:ot,meta:rt,spaceId:ge(),modelStorageId:ge(),libraryId:ge(),pulumiBackendId:ge(),...Bp.shape});const nm=G({encryptedIdentities:Ke(Z()),hasPasskey:Ce()});Et("type",[G({type:pe("locked"),unlockSuite:nm.optional()}),G({type:pe("unlocked")})]);Et("type",[G({type:pe("host")})]);const rm=Ge.pick({title:!0,description:!0}).required({title:!0});G({meta:rm,recipient:Z()});const sm=G({key:Z(),order:gt(["asc","desc"])}),kt=G({search:Z().optional(),sortBy:Ke(sm).optional(),skip:qe().int().nonnegative().default(0).optional(),count:qe().int().positive().max(100).default(20).optional()}),im=Ge.pick({title:!0,description:!0}).required({title:!0});G({id:ge(),meta:rt,serviceAccountId:ge(),serviceAccountMeta:cn.nullable(),createdAt:_e()});kt.extend({serviceAccountId:Z().optional()});G({id:ge(),hash:Z(),size:qe(),meta:rt,createdAt:_e(),updatedAt:_e()});kt.extend({stateId:Z().optional(),serviceAccountId:Z().optional(),terminalId:Z().optional(),pageId:Z().optional()});G({name:Z(),meta:rt,value:Z(),message:Z().optional(),order:qe().min(0).max(100).optional()});const om=G({stateId:ge(),meta:rt,acquiredAt:_e()});Et("type",[G({type:pe("locked"),locks:om.array()}),G({type:pe("unlocked"),stateIds:Ke(Z())})]);G({updatedInstances:hs.array().optional(),updatedHubs:zp.array().optional(),updatedVirtualInstances:hs.array().optional(),updatedGhostInstances:hs.array().optional(),deletedInstanceIds:mt.array().optional(),deletedHubIds:Z().array().optional(),deletedVirtualInstanceIds:mt.array().optional(),deletedGhostInstanceIds:mt.array().optional()});const am=gt(["destroy","preview","update","refresh"]),cm=G({id:mt,parentId:Z().optional(),message:Z()}),um=G({type:am,instances:Ke(cm)}),lm=G({forceUpdateDependencies:Ce().default(!1),ignoreDependencies:Ce().default(!1),forceUpdateChildren:Ce().default(!1),destroyDependentInstances:Ce().default(!0),invokeDestroyTriggers:Ce().default(!0),deleteUnreachableResources:Ce().default(!1),forceDeleteState:Ce().default(!1),allowPartialCompositeInstanceUpdate:Ce().default(!1),allowPartialCompositeInstanceDestruction:Ce().default(!1),refresh:Ce().default(!1),debug:Ce().default(!1)}).partial(),zc=gt(["update","preview","destroy","recreate","refresh"]),fm=gt(["pending","running","failing","completed","failed","cancelled","cancelling"]),Uc=Ge.pick({title:!0,description:!0}).required({title:!0}),dm=G({projectId:Z(),type:zc,instanceIds:Ke(mt).min(1),options:lm.partial().optional()});dm.extend({meta:Uc,plan:um.array().optional()});Et("type",[G({type:pe("updated"),operation:En()}),G({type:pe("deleted"),operationId:Z()})]);G({id:ge(),type:zc,status:fm,meta:Uc,startedAt:_e(),updatedAt:_e(),finishedAt:_e().nullable()});const hm=G({id:ge(),meta:rt,name:Z().nullable(),stateId:ge().nullable(),serviceAccountId:ge().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional(),artifactId:Z().optional()});G({...hm.shape,content:Ke(Fc)});G({id:ge(),meta:Cc,name:Z().nullable(),systemName:Z().nullable(),stateId:ge().nullable(),serviceAccountId:ge().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional()});G({id:ge(),meta:cn,createdAt:_e(),updatedAt:_e()});kt.extend({artifactId:Z().optional()});G({stateId:Z(),output:Z()});Et("type",[G({type:pe("updated"),state:En()}),G({type:pe("patched"),stateId:Z(),patch:En()}),G({type:pe("deleted"),stateId:Z()})]);Et("type",[G({type:pe("registered"),instanceId:Z(),params:Ue(Z(),Bt())}),G({type:pe("deregistered"),instanceId:Z()})]);const pm=gt(["active","unavailable"]);G({id:ge(),terminalId:ge(),meta:Cc,startedAt:_e(),finishedAt:_e().nullable()});const mm=G({id:ge(),name:Z().nullable(),meta:rt,status:pm,stateId:Z().nullable(),serviceAccountId:Z().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional(),artifactId:Z().optional()});G({...mm.shape,spec:jc});G({id:ge(),meta:rt,name:Z(),stateId:ge(),createdAt:_e(),updatedAt:_e()});kt.extend({stateId:Z().optional()});const Mc=gt(["password","passkey"]),Lc=Ge.pick({title:!0,description:!0}).required({title:!0});G({meta:Lc,type:Mc,encryptedIdentity:Z(),recipient:Z()});G({id:ge(),type:Mc,meta:Lc,recipient:Z(),createdAt:_e(),updatedAt:_e()});const gm=gt(["unknown","starting","running","stopping","stopped","error"]);G({id:ge(),digest:Z(),meta:rt,status:gm,enabled:Ce(),apiKeyId:Z(),apiKeyMeta:im,createdAt:_e(),updatedAt:_e()});G({id:ge(),identity:Z(),meta:rt,serviceAccountId:Z(),serviceAccountMeta:cn,createdAt:_e()});kt.extend({serviceAccountId:Z().optional()});class ui{constructor(e,n,r,s){this.nodes=e,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(e){this.workset.add(e)}addAllNodesToWorkset(){for(const e of this.nodes.keys())this.workset.add(e)}get outputs(){return this.outputMap}get dependents(){return this.dependentMap}requireOutput(e){const n=this.outputMap.get(e);if(!n)throw new Error(`Output for node ${e} is not available`);return n}getDependents(e){const n=this.dependentMap.get(e);return n?Array.from(n):[]}invalidate(e){const n=[e];for(;n.length>0;){const r=n.pop();if(!this.nodes.has(r))continue;this.outputMap.delete(r),this.workset.add(r);const s=this.dependentMap.get(r);if(s)for(const i of s)this.outputMap.has(i)&&n.push(i)}}invalidateSingle(e){this.nodes.has(e)&&(this.outputMap.delete(e),this.workset.add(e))}async process(e){for(;this.workset.size>0;){const n=this.workset.values().next().value,r=[{nodeId:n,resolved:!1,dependencies:[]}];for(;r.length>0;){const s=r[r.length-1],{nodeId:i,resolved:o}=s,a=this.nodes.get(i);if(!a){this.logger.warn({nodeId:i},"node not found in the graph, skipping"),r.pop();continue}if(this.outputMap.has(i)){r.pop();continue}if(!o){s.dependencies=$h(this.getNodeDependencies(a));let y=!1;for(const d of s.dependencies){if(!this.nodes.has(d)){this.logger.warn({depId:d,nodeId:i},"dependency not found in the graph, skipping");continue}this.outputMap.has(d)||(r.push({nodeId:d,resolved:!1,dependencies:[]}),y=!0)}if(y){s.resolved=!0;continue}}const u=await this.processNode(a,this.logger);if(e?.aborted){this.logger.warn({nodeId:i},"processing aborted, skipping output");return}const f=new Set,h=this.dependencyMap.get(i)??[];for(const y of h){const d=this.dependentMap.get(y);d&&(d.delete(i),f.add(y),d.size===0&&this.dependentMap.delete(y))}for(const y of s.dependencies){let d=this.dependentMap.get(y);d||(d=new Set,this.dependentMap.set(y,d)),d.add(i),f.add(y)}if(this.dependentSetHandler)for(const y of f){const d=this.dependentMap.get(y);this.dependentSetHandler(y,d)}this.outputMap.set(i,u),this.outputHandler?.(i,u),this.dependencyMap.set(i,s.dependencies),r.pop()}this.workset.delete(n)}}}class ym extends ui{getNodeDependencies(e){const n=[];if(e.kind==="hub"){for(const r of e.hub.inputs??[])n.push(`instance:${r.instanceId}`);for(const r of e.hub.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}for(const r of Object.values(e.instance.inputs??{}))for(const s of r)n.push(`instance:${s.instanceId}`);for(const r of Object.values(e.instance.hubInputs??{}))for(const s of r)n.push(`hub:${s.hubId}`);for(const r of e.instance.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}processNode(e){const n=h=>{const y=this.outputs.get(`hub:${h.hubId}`);if(!y)return{resolvedInputs:[]};if(y.kind!=="hub")throw new Error("Expected hub node");return y},r=h=>{const y=this.outputs.get(`instance:${h.instanceId}`);if(!y)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(y.kind!=="instance")throw new Error("Expected instance node");return{component:y.component,resolvedInputs:y.resolvedInputs[h.output]??[],resolvedOutputs:y.resolvedOutputs?.[h.output]}};if(e.kind==="hub"){const h=new Map,y=d=>{h.set(`${d.input.instanceId}:${d.input.output}`,d)};for(const d of e.hub.inputs??[]){const{component:m}=r(d),b=m?.outputs[d.output];if(!b){this.logger.warn({msg:"output not found in the component",input:d,component:m});continue}y({input:d,type:b.type})}for(const d of e.hub.injectionInputs??[]){const{resolvedInputs:m}=n(d);for(const b of m)y(b)}return{kind:"hub",resolvedInputs:Array.from(h.values())}}if(e.instance.resolvedInputs)return{kind:"instance",instance:e.instance,component:e.component,resolvedInputs:bh(e.instance.resolvedInputs,(h,y)=>{const d=e.component.inputs[y];return d?h.map(m=>({input:m,type:d.type})):(this.logger.warn({msg:"input not found in the component",inputName:y,component:e.component}),[])}),resolvedOutputs:e.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,i=(h,y)=>{let d=s.get(h);d||(d=new Map,s.set(h,d)),d.set(`${y.input.instanceId}:${y.input.output}`,y)},o=(h,y)=>{const d=e.component.inputs[h];if(!d){this.logger.warn({msg:"input not found in the component",input:y,component:e.component});return}const{component:m,resolvedOutputs:b}=r(y);if(!m){this.logger.warn({instanceId:e.instance.id,input:y},"no output found for the input");return}if(ci(m)){i(h,{input:y,type:d.type});return}if(b)for(const w of b)i(h,{input:w,type:d.type});else i(h,{input:y,type:d.type})};for(const[h,y]of Object.entries(e.instance.inputs??{}))for(const d of y)o(h,d);const a=new Map,u=new Map;for(const h of e.instance.injectionInputs??[]){const{resolvedInputs:y}=n(h);for(const d of y)a.set(`${d.input.instanceId}:${d.input.output}`,d)}for(const[h,y]of Object.entries(e.component.inputs??{})){const d=new Map(a),m=e.instance.hubInputs?.[h]??[];for(const b of m){const{resolvedInputs:w}=n(b);for(const g of w)d.set(`${g.input.instanceId}:${g.input.output}`,g)}for(const b of d.values())if(b.type===y.type){o(h,b.input);const w=`${b.input.instanceId}:${b.input.output}`;a.has(w)&&u.set(w,b)}}const f=vh(Array.from(s.entries()).map(([h,y])=>[h,Array.from(y.values())]));return{kind:"instance",instance:e.instance,component:e.component,resolvedInputs:f,resolvedOutputs:e.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(u.values())}}}function wm(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}const vm=t=>new TextEncoder().encode(t);typeof Buffer<"u"&&Buffer.from;function bm(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),n=0;n<t.length;)e[n]=t[n],n+=1;return e}return Uint32Array.from(t)}function ps(t){return new _m().update(t).digest()}var _m=(function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var n,r;try{for(var s=wm(e),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Em[(this.checksum^o)&255]}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t})(),$m=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Em=bm($m);function km(t){const e=t.length;let n=0,r=0;for(;r<e;){let s=t.charCodeAt(r++);if((s&4294967168)===0){n++;continue}else if((s&4294965248)===0)n+=2;else{if(s>=55296&&s<=56319&&r<e){const i=t.charCodeAt(r);(i&64512)===56320&&(++r,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?n+=3:n+=4}}return n}function Sm(t,e,n){const r=t.length;let s=n,i=0;for(;i<r;){let o=t.charCodeAt(i++);if((o&4294967168)===0){e[s++]=o;continue}else if((o&4294965248)===0)e[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<r){const a=t.charCodeAt(i);(a&64512)===56320&&(++i,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[s++]=o>>12&15|224,e[s++]=o>>6&63|128):(e[s++]=o>>18&7|240,e[s++]=o>>12&63|128,e[s++]=o>>6&63|128)}e[s++]=o&63|128}}const Im=new TextEncoder,Am=50;function Nm(t,e,n){Im.encodeInto(t,e.subarray(n))}function Om(t,e,n){t.length>Am?Nm(t,e,n):Sm(t,e,n)}new TextDecoder;class Ln{constructor(e,n){this.type=e,this.data=n}}class zr extends Error{constructor(e){super(e);const n=Object.create(zr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:zr.name})}}function Tm(t,e,n){const r=n/4294967296,s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function qc(t,e,n){const r=Math.floor(n/4294967296),s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Pm(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}const Cm=-1,xm=4294967296-1,Bm=17179869184-1;function Dm({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Bm)if(e===0&&t<=xm){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|n&3),i.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),qc(r,4,t),n}}function Rm(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function jm(t){if(t instanceof Date){const e=Rm(t);return Dm(e)}else return null}function Fm(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),s=(n&3)*4294967296+r,i=n>>>2;return{sec:s,nsec:i}}case 12:{const n=Pm(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new zr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function zm(t){const e=Fm(t);return new Date(e.sec*1e3+e.nsec/1e6)}const Um={type:Cm,encode:jm,decode:zm};class zs{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Um)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const s=-1-e;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=-1-r;return new Ln(o,i)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=r;return new Ln(o,i)}}}return e instanceof Ln?e:null}decode(e,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(e,n,r):new Ln(n,e)}}zs.defaultCodec=new zs;function Mm(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Lm(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Mm(t)?new Uint8Array(t):Uint8Array.from(t)}const qm=100,Zm=2048;class li{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??zs.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??qm,this.initialBufferSize=e?.initialBufferSize??Zm,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new li({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=km(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),Om(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Lm(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of e)this.doEncode(s,n+1)}countWithoutUndefined(e,n){let r=0;for(const s of n)e[s]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const i of r){const o=e[i];this.ignoreUndefined&&o===void 0||(this.encodeString(i),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),Tm(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),qc(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function Vm(t,e){return new li(e).encodeSharedRef(t)}var ms={},fn={},Gi;function Km(){if(Gi)return fn;Gi=1,fn.byteLength=a,fn.toByteArray=f,fn.fromByteArray=d;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=r.length;s<i;++s)t[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function o(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=m.indexOf("=");w===-1&&(w=b);var g=w===b?0:4-w%4;return[w,g]}function a(m){var b=o(m),w=b[0],g=b[1];return(w+g)*3/4-g}function u(m,b,w){return(b+w)*3/4-w}function f(m){var b,w=o(m),g=w[0],$=w[1],p=new n(u(m,g,$)),_=0,I=$>0?g-4:g,v;for(v=0;v<I;v+=4)b=e[m.charCodeAt(v)]<<18|e[m.charCodeAt(v+1)]<<12|e[m.charCodeAt(v+2)]<<6|e[m.charCodeAt(v+3)],p[_++]=b>>16&255,p[_++]=b>>8&255,p[_++]=b&255;return $===2&&(b=e[m.charCodeAt(v)]<<2|e[m.charCodeAt(v+1)]>>4,p[_++]=b&255),$===1&&(b=e[m.charCodeAt(v)]<<10|e[m.charCodeAt(v+1)]<<4|e[m.charCodeAt(v+2)]>>2,p[_++]=b>>8&255,p[_++]=b&255),p}function h(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function y(m,b,w){for(var g,$=[],p=b;p<w;p+=3)g=(m[p]<<16&16711680)+(m[p+1]<<8&65280)+(m[p+2]&255),$.push(h(g));return $.join("")}function d(m){for(var b,w=m.length,g=w%3,$=[],p=16383,_=0,I=w-g;_<I;_+=p)$.push(y(m,_,_+p>I?I:_+p));return g===1?(b=m[w-1],$.push(t[b>>2]+t[b<<4&63]+"==")):g===2&&(b=(m[w-2]<<8)+m[w-1],$.push(t[b>>10]+t[b>>4&63]+t[b<<2&63]+"=")),$.join("")}return fn}var qn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ji;function Hm(){return Ji||(Ji=1,qn.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,u=(1<<a)-1,f=u>>1,h=-7,y=n?s-1:0,d=n?-1:1,m=t[e+y];for(y+=d,i=m&(1<<-h)-1,m>>=-h,h+=a;h>0;i=i*256+t[e+y],y+=d,h-=8);for(o=i&(1<<-h)-1,i>>=-h,h+=r;h>0;o=o*256+t[e+y],y+=d,h-=8);if(i===0)i=1-f;else{if(i===u)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-f}return(m?-1:1)*o*Math.pow(2,i-r)},qn.write=function(t,e,n,r,s,i){var o,a,u,f=i*8-s-1,h=(1<<f)-1,y=h>>1,d=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,b=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+y>=1?e+=d/u:e+=d*Math.pow(2,1-y),e*u>=2&&(o++,u/=2),o+y>=h?(a=0,o=h):o+y>=1?(a=(e*u-1)*Math.pow(2,s),o=o+y):(a=e*Math.pow(2,y-1)*Math.pow(2,s),o=0));s>=8;t[n+m]=a&255,m+=b,a/=256,s-=8);for(o=o<<s|a,f+=s;f>0;t[n+m]=o&255,m+=b,o/=256,f-=8);t[n+m-b]|=w*128}),qn}/*!
|
|
150
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Mn(e),r=Ut(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Mn(e),r=Ut(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Pp(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Op||null,prettyErrors:e}}function Cp(t,e={}){const{lineCounter:n,prettyErrors:r}=Pp(e),s=new Tp(n?.addNewLine),i=new kp(e);let o=null;for(const a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new wn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Ui(t,n)),o.warnings.forEach(Ui(t,n))),o}function xp(t,e,n){let r;const s=Cp(t,n);if(!s)return null;if(s.warnings.forEach(i=>sc(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}var Ge=G({title:Z().optional(),globalTitle:Z().optional(),description:Z().optional(),color:Z().optional(),icon:Z().optional(),iconColor:Z().optional(),avatarUrl:Z().optional(),secondaryIcon:Z().optional(),secondaryIconColor:Z().optional()}),rt=Ge.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),Cc=Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),cn=Ge.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Bp=G({createdAt:_e(),updatedAt:_e()}),ot=Z().regex(/^[a-z][a-z0-9-.]+$/,"Name must start with a letter and can only contain lowercase letters, numbers, dashes (-) and dots (.)").min(2).max(64),Cn=nn([Tr([ot,pe("."),pe("v"),qe().int().min(1)]),Tr([ot,pe("."),ot,pe("."),pe("v"),qe().int().min(1)]),Tr([ot,pe("."),ot,pe("."),ot,pe("."),pe("v"),qe().int().min(1)])]),ds=Z().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),js=G({type:Cn,required:Ce(),multiple:Ce(),field:Z()});G({type:Cn,extensions:Z().array().optional(),directExtensions:Z().array().optional(),inclusions:js.array().optional(),directInclusions:js.array().optional(),schema:En(),meta:Ge.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:qe()});var Dp=Symbol("runtimeSchema"),xc=gt(["composite","unit"]),Bc=G({schema:En(),[Dp]:hh(ke).optional(),required:Ce(),meta:Ge.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),Ki=G({type:Cn,required:Ce(),multiple:Ce(),meta:Ge.required({title:!0}).pick({title:!0,description:!0})}),Rp=G({type:ot,kind:xc,args:Ue(ds,Bc),inputs:Ue(ds,Ki),outputs:Ue(ds,Ki),meta:Ge.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:Z().optional(),defaultNamePrefix:Z()}),definitionHash:qe()}),Dc=G({x:qe(),y:qe()}),mt=Tr([Cn,":",ot]),Qt=G({instanceId:mt,output:Z()}),Fs=G({hubId:Z()}),jp=G({args:Ue(Z(),Bt()).optional(),inputs:Ue(Z(),Ke(Qt)).optional(),hubInputs:Ue(Z(),Ke(Fs)).optional(),injectionInputs:Ke(Fs).optional(),position:Dc.optional()}),hs=G({id:mt,kind:xc,type:Cn,name:ot,...jp.shape,resolvedInputs:Ue(Z(),Ke(Qt)).optional(),parentId:mt.optional(),outputs:Ue(Z(),Ke(Qt)).optional(),resolvedOutputs:Ue(Z(),Ke(Qt)).optional()}),Fp=G({position:Dc.optional(),inputs:Ke(Qt).optional(),injectionInputs:Ke(Fs).optional()}),zp=G({id:ge(),...Fp.shape}),Up=G({"c857cac5-caa6-4421-b82c-e561fbce6367":pe(!0),value:Z()});G({"348d020e-0d9e-4ae7-9415-b91af99f5339":pe(!0),id:qe(),value:Bt()});G({"6d7f9da0-9cb6-496d-b72e-cf85ee4d9cf8":pe(!0),id:qe()});var Mp=G({name:Z(),contentType:Z().optional(),size:qe().optional(),mode:qe().optional()}),Lp=nn([Z(),qe(),Ce(),Z().array()]);G({name:Z(),meta:Ge.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:Z().optional(),value:Lp.optional()});var qp=Bc.extend({readonly:Ce(),computed:Ce()}),Zp=G({package:Z(),path:Z().optional()});G({...Rp.shape,source:Zp,secrets:Ue(Z(),qp)});function ci(t){return"source"in t}var Vp=nn([G({type:pe("before-destroy")})]);G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:Vp});var Kp=G({name:Z()}),Hp=G({...Qt.shape,inclusion:js.optional()});G({instanceId:Z(),args:Ue(Z(),Bt()),inputs:Ue(Z(),Hp.array()),invokedTriggers:Kp.array(),secretNames:Z().array(),stateIdMap:Ue(mt,Z()),importBasePath:Z()});var Hi=new WeakMap;function Gp(t){const e=Up.safeParse(t);if(!e.success)return t;const n=Hi.get(t);if(n!==void 0)return n;const r=xp(e.data.value);return Hi.set(t,r),r}var Jp=Symbol("unitArtifactId"),Wp=G({"d55c63ac-3174-4756-808f-f778e99af0d1":pe(!0),[Jp]:Z().optional(),hash:Z(),meta:rt.optional()}),Yp=nn([G({type:pe("embedded"),isBinary:Ce().optional(),value:Z()}),G({type:pe("artifact"),...Wp.shape})]),Rc=G({meta:Mp,content:Yp}),jc=G({image:Z(),command:Z().array(),cwd:Z().optional(),env:Ue(Z(),Z()).optional(),files:Ue(Z(),Rc).optional()});G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:jc});var Fc=nn([G({type:pe("markdown"),content:Z()}),G({type:pe("qr"),content:Z(),showContent:ph(),language:Z().optional()}),G({type:pe("file"),file:Rc})]);G({name:Z(),meta:Ge.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:Fc.array()});G({name:Z(),image:Z(),params:Ue(Z(),Bt())});G({projectId:ge(),workerVersionId:ge(),apiUrl:kd(),apiKey:Z()});Et("type",[G({type:pe("host")})]);const Qp={id:"q8xbilhwpsn65zjlv5kz44qh"},Xp={id:"n0rfvpl9o77iqf29ff4kk5gf"},em={id:"pmn9y901jeiz2ydh93045l39"},tm={id:"qppfcerovu3h22o0x8rlpc3g"};Et("type",[G({type:pe("codebase")}),G({type:pe("database")})]);G({name:ot,spaceId:ge().default(Qp.id),modelStorageId:ge().default(tm.id),libraryId:ge().default(Xp.id),pulumiBackendId:ge().default(em.id),meta:rt});G({id:Z(),name:ot,meta:rt,spaceId:ge(),modelStorageId:ge(),libraryId:ge(),pulumiBackendId:ge(),...Bp.shape});const nm=G({encryptedIdentities:Ke(Z()),hasPasskey:Ce()});Et("type",[G({type:pe("locked"),unlockSuite:nm.optional()}),G({type:pe("unlocked")})]);Et("type",[G({type:pe("host")})]);const rm=Ge.pick({title:!0,description:!0}).required({title:!0});G({meta:rm,recipient:Z()});const sm=G({key:Z(),order:gt(["asc","desc"])}),kt=G({search:Z().optional(),sortBy:Ke(sm).optional(),skip:qe().int().nonnegative().default(0).optional(),count:qe().int().positive().max(100).default(20).optional()}),im=Ge.pick({title:!0,description:!0}).required({title:!0});G({id:ge(),meta:rt,serviceAccountId:ge(),serviceAccountMeta:cn.nullable(),createdAt:_e()});kt.extend({serviceAccountId:Z().optional()});G({id:ge(),hash:Z(),size:qe(),meta:rt,createdAt:_e(),updatedAt:_e()});kt.extend({stateId:Z().optional(),serviceAccountId:Z().optional(),terminalId:Z().optional(),pageId:Z().optional()});G({name:Z(),meta:rt,value:Z(),message:Z().optional(),order:qe().min(0).max(100).optional()});const om=G({stateId:ge(),meta:rt,acquiredAt:_e()});Et("type",[G({type:pe("locked"),locks:om.array()}),G({type:pe("unlocked"),stateIds:Ke(Z())})]);G({updatedInstances:hs.array().optional(),updatedHubs:zp.array().optional(),updatedVirtualInstances:hs.array().optional(),updatedGhostInstances:hs.array().optional(),deletedInstanceIds:mt.array().optional(),deletedHubIds:Z().array().optional(),deletedVirtualInstanceIds:mt.array().optional(),deletedGhostInstanceIds:mt.array().optional()});const am=gt(["destroy","preview","update","refresh"]),cm=G({id:mt,parentId:Z().optional(),message:Z()}),um=G({type:am,instances:Ke(cm)}),lm=G({forceUpdateDependencies:Ce().default(!1),ignoreDependencies:Ce().default(!1),forceUpdateChildren:Ce().default(!1),destroyDependentInstances:Ce().default(!0),invokeDestroyTriggers:Ce().default(!0),deleteUnreachableResources:Ce().default(!1),forceDeleteState:Ce().default(!1),allowPartialCompositeInstanceUpdate:Ce().default(!1),allowPartialCompositeInstanceDestruction:Ce().default(!1),refresh:Ce().default(!1),debug:Ce().default(!1)}).partial(),zc=gt(["update","preview","destroy","recreate","refresh"]),fm=gt(["pending","running","failing","completed","failed","cancelled","cancelling"]),Uc=Ge.pick({title:!0,description:!0}).required({title:!0}),dm=G({projectId:Z(),type:zc,instanceIds:Ke(mt).min(1),options:lm.partial().optional()});dm.extend({meta:Uc,plan:um.array().optional()});Et("type",[G({type:pe("updated"),operation:En()}),G({type:pe("deleted"),operationId:Z()})]);G({id:ge(),type:zc,status:fm,meta:Uc,startedAt:_e(),updatedAt:_e(),finishedAt:_e().nullable()});const hm=G({id:ge(),meta:rt,name:Z().nullable(),stateId:ge().nullable(),serviceAccountId:ge().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional(),artifactId:Z().optional()});G({...hm.shape,content:Ke(Fc)});G({id:ge(),meta:Cc,name:Z().nullable(),systemName:Z().nullable(),stateId:ge().nullable(),serviceAccountId:ge().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional()});G({id:ge(),meta:cn,createdAt:_e(),updatedAt:_e()});kt.extend({artifactId:Z().optional()});G({stateId:Z(),output:Z()});Et("type",[G({type:pe("updated"),state:En()}),G({type:pe("patched"),stateId:Z(),patch:En()}),G({type:pe("deleted"),stateId:Z()})]);Et("type",[G({type:pe("registered"),instanceId:Z(),params:Ue(Z(),Bt())}),G({type:pe("deregistered"),instanceId:Z()})]);const pm=gt(["active","unavailable"]);G({id:ge(),terminalId:ge(),meta:Cc,startedAt:_e(),finishedAt:_e().nullable()});const mm=G({id:ge(),name:Z().nullable(),meta:rt,status:pm,stateId:Z().nullable(),serviceAccountId:Z().nullable(),serviceAccountMeta:cn.nullable(),createdAt:_e(),updatedAt:_e()});kt.extend({serviceAccountId:Z().optional(),stateId:Z().optional(),artifactId:Z().optional()});G({...mm.shape,spec:jc});G({id:ge(),meta:rt,name:Z(),stateId:ge(),createdAt:_e(),updatedAt:_e()});kt.extend({stateId:Z().optional()});const Mc=gt(["password","passkey"]),Lc=Ge.pick({title:!0,description:!0}).required({title:!0});G({meta:Lc,type:Mc,encryptedIdentity:Z(),recipient:Z()});G({id:ge(),type:Mc,meta:Lc,recipient:Z(),createdAt:_e(),updatedAt:_e()});const gm=gt(["unknown","starting","running","stopping","stopped","error"]);G({id:ge(),digest:Z(),meta:rt,status:gm,enabled:Ce(),apiKeyId:Z(),apiKeyMeta:im,createdAt:_e(),updatedAt:_e()});G({id:ge(),identity:Z(),meta:rt,serviceAccountId:Z(),serviceAccountMeta:cn,createdAt:_e()});kt.extend({serviceAccountId:Z().optional()});class ui{constructor(e,n,r,s){this.nodes=e,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(e){this.workset.add(e)}addAllNodesToWorkset(){for(const e of this.nodes.keys())this.workset.add(e)}get outputs(){return this.outputMap}get dependents(){return this.dependentMap}requireOutput(e){const n=this.outputMap.get(e);if(!n)throw new Error(`Output for node ${e} is not available`);return n}getDependents(e){const n=this.dependentMap.get(e);return n?Array.from(n):[]}invalidate(e){const n=[e];for(;n.length>0;){const r=n.pop();if(!this.nodes.has(r))continue;this.outputMap.delete(r),this.workset.add(r);const s=this.dependentMap.get(r);if(s)for(const i of s)this.outputMap.has(i)&&n.push(i)}}invalidateSingle(e){this.nodes.has(e)&&(this.outputMap.delete(e),this.workset.add(e))}async process(e){for(;this.workset.size>0;){const n=this.workset.values().next().value,r=[{nodeId:n,resolved:!1,dependencies:[]}];for(;r.length>0;){const s=r[r.length-1],{nodeId:i,resolved:o}=s,a=this.nodes.get(i);if(!a){this.logger.warn({nodeId:i},"node not found in the graph, skipping"),r.pop();continue}if(this.outputMap.has(i)){r.pop();continue}if(!o){s.dependencies=$h(this.getNodeDependencies(a));let y=!1;for(const d of s.dependencies){if(!this.nodes.has(d)){this.logger.warn({depId:d,nodeId:i},"dependency not found in the graph, skipping");continue}this.outputMap.has(d)||(r.push({nodeId:d,resolved:!1,dependencies:[]}),y=!0)}if(y){s.resolved=!0;continue}}const u=await this.processNode(a,this.logger);if(e?.aborted){this.logger.warn({nodeId:i},"processing aborted, skipping output");return}const f=new Set,h=this.dependencyMap.get(i)??[];for(const y of h){const d=this.dependentMap.get(y);d&&(d.delete(i),f.add(y),d.size===0&&this.dependentMap.delete(y))}for(const y of s.dependencies){let d=this.dependentMap.get(y);d||(d=new Set,this.dependentMap.set(y,d)),d.add(i),f.add(y)}if(this.dependentSetHandler)for(const y of f){const d=this.dependentMap.get(y);this.dependentSetHandler(y,d)}this.outputMap.set(i,u),this.outputHandler?.(i,u),this.dependencyMap.set(i,s.dependencies),r.pop()}this.workset.delete(n)}}}class ym extends ui{getNodeDependencies(e){const n=[];if(e.kind==="hub"){for(const r of e.hub.inputs??[])n.push(`instance:${r.instanceId}`);for(const r of e.hub.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}for(const r of Object.values(e.instance.inputs??{}))for(const s of r)n.push(`instance:${s.instanceId}`);for(const r of Object.values(e.instance.hubInputs??{}))for(const s of r)n.push(`hub:${s.hubId}`);for(const r of e.instance.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}processNode(e){const n=h=>{const y=this.outputs.get(`hub:${h.hubId}`);if(!y)return{resolvedInputs:[]};if(y.kind!=="hub")throw new Error("Expected hub node");return y},r=h=>{const y=this.outputs.get(`instance:${h.instanceId}`);if(!y)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(y.kind!=="instance")throw new Error("Expected instance node");return{component:y.component,resolvedInputs:y.resolvedInputs[h.output]??[],resolvedOutputs:y.resolvedOutputs?.[h.output]}};if(e.kind==="hub"){const h=new Map,y=d=>{h.set(`${d.input.instanceId}:${d.input.output}`,d)};for(const d of e.hub.inputs??[]){const{component:m}=r(d),b=m?.outputs[d.output];if(!b){this.logger.warn({msg:"output not found in the component",input:d,component:m});continue}y({input:d,type:b.type})}for(const d of e.hub.injectionInputs??[]){const{resolvedInputs:m}=n(d);for(const b of m)y(b)}return{kind:"hub",hub:e.hub,resolvedInputs:Array.from(h.values())}}if(e.instance.resolvedInputs)return{kind:"instance",instance:e.instance,component:e.component,resolvedInputs:bh(e.instance.resolvedInputs,(h,y)=>{const d=e.component.inputs[y];return d?h.map(m=>({input:m,type:d.type})):(this.logger.warn({msg:"input not found in the component",inputName:y,component:e.component}),[])}),resolvedOutputs:e.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,i=(h,y)=>{let d=s.get(h);d||(d=new Map,s.set(h,d)),d.set(`${y.input.instanceId}:${y.input.output}`,y)},o=(h,y)=>{const d=e.component.inputs[h];if(!d){this.logger.warn({msg:"input not found in the component",input:y,component:e.component});return}const{component:m,resolvedOutputs:b}=r(y);if(!m){this.logger.warn({instanceId:e.instance.id,input:y},"no output found for the input");return}if(ci(m)){i(h,{input:y,type:d.type});return}if(b)for(const w of b)i(h,{input:w,type:d.type});else i(h,{input:y,type:d.type})};for(const[h,y]of Object.entries(e.instance.inputs??{}))for(const d of y)o(h,d);const a=new Map,u=new Map;for(const h of e.instance.injectionInputs??[]){const{resolvedInputs:y}=n(h);for(const d of y)a.set(`${d.input.instanceId}:${d.input.output}`,d)}for(const[h,y]of Object.entries(e.component.inputs??{})){const d=new Map(a),m=e.instance.hubInputs?.[h]??[];for(const b of m){const{resolvedInputs:w}=n(b);for(const g of w)d.set(`${g.input.instanceId}:${g.input.output}`,g)}for(const b of d.values())if(b.type===y.type){o(h,b.input);const w=`${b.input.instanceId}:${b.input.output}`;a.has(w)&&u.set(w,b)}}const f=vh(Array.from(s.entries()).map(([h,y])=>[h,Array.from(y.values())]));return{kind:"instance",instance:e.instance,component:e.component,resolvedInputs:f,resolvedOutputs:e.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(u.values())}}}function wm(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}const vm=t=>new TextEncoder().encode(t);typeof Buffer<"u"&&Buffer.from;function bm(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),n=0;n<t.length;)e[n]=t[n],n+=1;return e}return Uint32Array.from(t)}function ps(t){return new _m().update(t).digest()}var _m=(function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var n,r;try{for(var s=wm(e),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Em[(this.checksum^o)&255]}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t})(),$m=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Em=bm($m);function km(t){const e=t.length;let n=0,r=0;for(;r<e;){let s=t.charCodeAt(r++);if((s&4294967168)===0){n++;continue}else if((s&4294965248)===0)n+=2;else{if(s>=55296&&s<=56319&&r<e){const i=t.charCodeAt(r);(i&64512)===56320&&(++r,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?n+=3:n+=4}}return n}function Sm(t,e,n){const r=t.length;let s=n,i=0;for(;i<r;){let o=t.charCodeAt(i++);if((o&4294967168)===0){e[s++]=o;continue}else if((o&4294965248)===0)e[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<r){const a=t.charCodeAt(i);(a&64512)===56320&&(++i,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[s++]=o>>12&15|224,e[s++]=o>>6&63|128):(e[s++]=o>>18&7|240,e[s++]=o>>12&63|128,e[s++]=o>>6&63|128)}e[s++]=o&63|128}}const Im=new TextEncoder,Am=50;function Nm(t,e,n){Im.encodeInto(t,e.subarray(n))}function Om(t,e,n){t.length>Am?Nm(t,e,n):Sm(t,e,n)}new TextDecoder;class Ln{constructor(e,n){this.type=e,this.data=n}}class zr extends Error{constructor(e){super(e);const n=Object.create(zr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:zr.name})}}function Tm(t,e,n){const r=n/4294967296,s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function qc(t,e,n){const r=Math.floor(n/4294967296),s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Pm(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}const Cm=-1,xm=4294967296-1,Bm=17179869184-1;function Dm({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Bm)if(e===0&&t<=xm){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|n&3),i.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),qc(r,4,t),n}}function Rm(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function jm(t){if(t instanceof Date){const e=Rm(t);return Dm(e)}else return null}function Fm(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),s=(n&3)*4294967296+r,i=n>>>2;return{sec:s,nsec:i}}case 12:{const n=Pm(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new zr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function zm(t){const e=Fm(t);return new Date(e.sec*1e3+e.nsec/1e6)}const Um={type:Cm,encode:jm,decode:zm};class zs{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Um)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const s=-1-e;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=-1-r;return new Ln(o,i)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=r;return new Ln(o,i)}}}return e instanceof Ln?e:null}decode(e,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(e,n,r):new Ln(n,e)}}zs.defaultCodec=new zs;function Mm(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Lm(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Mm(t)?new Uint8Array(t):Uint8Array.from(t)}const qm=100,Zm=2048;class li{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??zs.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??qm,this.initialBufferSize=e?.initialBufferSize??Zm,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new li({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=km(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),Om(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Lm(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of e)this.doEncode(s,n+1)}countWithoutUndefined(e,n){let r=0;for(const s of n)e[s]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const i of r){const o=e[i];this.ignoreUndefined&&o===void 0||(this.encodeString(i),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),Tm(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),qc(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function Vm(t,e){return new li(e).encodeSharedRef(t)}var ms={},fn={},Gi;function Km(){if(Gi)return fn;Gi=1,fn.byteLength=a,fn.toByteArray=f,fn.fromByteArray=d;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=r.length;s<i;++s)t[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function o(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=m.indexOf("=");w===-1&&(w=b);var g=w===b?0:4-w%4;return[w,g]}function a(m){var b=o(m),w=b[0],g=b[1];return(w+g)*3/4-g}function u(m,b,w){return(b+w)*3/4-w}function f(m){var b,w=o(m),g=w[0],$=w[1],p=new n(u(m,g,$)),_=0,I=$>0?g-4:g,v;for(v=0;v<I;v+=4)b=e[m.charCodeAt(v)]<<18|e[m.charCodeAt(v+1)]<<12|e[m.charCodeAt(v+2)]<<6|e[m.charCodeAt(v+3)],p[_++]=b>>16&255,p[_++]=b>>8&255,p[_++]=b&255;return $===2&&(b=e[m.charCodeAt(v)]<<2|e[m.charCodeAt(v+1)]>>4,p[_++]=b&255),$===1&&(b=e[m.charCodeAt(v)]<<10|e[m.charCodeAt(v+1)]<<4|e[m.charCodeAt(v+2)]>>2,p[_++]=b>>8&255,p[_++]=b&255),p}function h(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function y(m,b,w){for(var g,$=[],p=b;p<w;p+=3)g=(m[p]<<16&16711680)+(m[p+1]<<8&65280)+(m[p+2]&255),$.push(h(g));return $.join("")}function d(m){for(var b,w=m.length,g=w%3,$=[],p=16383,_=0,I=w-g;_<I;_+=p)$.push(y(m,_,_+p>I?I:_+p));return g===1?(b=m[w-1],$.push(t[b>>2]+t[b<<4&63]+"==")):g===2&&(b=(m[w-2]<<8)+m[w-1],$.push(t[b>>10]+t[b>>4&63]+t[b<<2&63]+"=")),$.join("")}return fn}var qn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ji;function Hm(){return Ji||(Ji=1,qn.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,u=(1<<a)-1,f=u>>1,h=-7,y=n?s-1:0,d=n?-1:1,m=t[e+y];for(y+=d,i=m&(1<<-h)-1,m>>=-h,h+=a;h>0;i=i*256+t[e+y],y+=d,h-=8);for(o=i&(1<<-h)-1,i>>=-h,h+=r;h>0;o=o*256+t[e+y],y+=d,h-=8);if(i===0)i=1-f;else{if(i===u)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-f}return(m?-1:1)*o*Math.pow(2,i-r)},qn.write=function(t,e,n,r,s,i){var o,a,u,f=i*8-s-1,h=(1<<f)-1,y=h>>1,d=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,b=r?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+y>=1?e+=d/u:e+=d*Math.pow(2,1-y),e*u>=2&&(o++,u/=2),o+y>=h?(a=0,o=h):o+y>=1?(a=(e*u-1)*Math.pow(2,s),o=o+y):(a=e*Math.pow(2,y-1)*Math.pow(2,s),o=0));s>=8;t[n+m]=a&255,m+=b,a/=256,s-=8);for(o=o<<s|a,f+=s;f>0;t[n+m]=o&255,m+=b,o/=256,f-=8);t[n+m-b]|=w*128}),qn}/*!
|
|
151
151
|
* The buffer module from node.js, for the browser.
|
|
152
152
|
*
|
|
153
153
|
* @author Feross Aboukhadijeh <https://feross.org>
|