@smartkomm/plexus-cli 0.1.178 → 0.1.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs
CHANGED
|
@@ -7604,7 +7604,7 @@ plexus-cli offer workflow node add --dir <dir> --type engagePush \\
|
|
|
7604
7604
|
# An old bundle that still carries \`wires\` is refused
|
|
7605
7605
|
# ([graph/retiredField]) \u2014 export it again.
|
|
7606
7606
|
|
|
7607
|
-
#
|
|
7607
|
+
# The contract-date additional fields (a school typically maps a few; meaning not confirmed by the school): --engage-contract-fields on
|
|
7608
7608
|
|
|
7609
7609
|
# 3. Later changes to the mapping:
|
|
7610
7610
|
plexus-cli offer workflow node set-engage --dir <dir> --node engagePush --config <scratch>/engage-mapping.json
|
|
@@ -7688,6 +7688,7 @@ Order matters; each step names why.
|
|
|
7688
7688
|
(\u201EJetzt live \xFCbertragen" is hidden while any issue is listed).
|
|
7689
7689
|
|
|
7690
7690
|
## Related
|
|
7691
|
+
- What is sent, what is proven, open questions: \`docs/integrations/engage.md\` in the Plexus repository
|
|
7691
7692
|
- [Name what a node reads](./addresses.md) \xB7 [Edit a live tenant's offer](./edit-live-tenant-offer.md)
|
|
7692
7693
|
- \`plexus-cli offer workflow node add --help\` (\`--engage-*\` flags) \xB7 \`plexus-cli offer workflow node set-engage --help\`
|
|
7693
7694
|
`,"references/offer/form-views.md":`# Give a form a document view
|
|
@@ -10975,7 +10976,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
|
|
|
10975
10976
|
## Related
|
|
10976
10977
|
- Command reference: \`plexus-cli jobs list --help\`, \`plexus-cli platform workers reap --help\`,
|
|
10977
10978
|
\`plexus-cli platform imports cleanup-orphaned --help\`.
|
|
10978
|
-
`};var df="4be686654d94bb4029a900a6c2ea157ae8aa11159570eac1f484dbebf23a890c",iy=JR;var oy=class extends ve{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=T.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:df,tools:bl}),0}},sy=class extends ve{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=T.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let n=JSON.parse(await ry(this.context.stdin)),t=await this.context.executePlexusAgentTool(this.tool,n);return this.print(t),0}},QR=[oy,sy];var ay=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],Yle=new Set(ay.map(e=>e.key));function XR(e,n,t,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===n);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${n}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${n} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===t||l.runId===t);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${t}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(XR,"resolveStartTarget");function Cz(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Cz,"applicantText");function eI(e){return e.map(n=>({id:n.application._id,status:n.deletedAt?`${n.application.status} (gel\xF6scht)`:n.application.status,state:n.currentProcessStateId??"",applicant:Cz(n.applicantName),test:n.application.testMode===!0?"test":""}))}s(eI,"applicationRows");var ZR=ay.map(e=>e.email);function nI(e,n,t,r){if(t===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(t!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(ey(e,n)&&(r===void 0||!ZR.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${ZR.join(", ")} (--applicant) \u2014 never a real family's`)}s(nI,"assertStartApplicant");function tI(e){let n={};for(let{address:t,...r}of e.entries)n[t]=r;return{applicationId:e.applicationId,store:n}}s(tI,"processStoreJson");function Dz(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.snapshotNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(n=>`${n.partKey}: contract ${n.contractId} \xB7 ${n.revision===null?"keine Fassung":`Fassung ${n.revision.snapshotNumber}`} \xB7 ${n.contractStatus}`).join("; ")}}s(Dz,"refText");function Fz(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Dz(e.ref):JSON.stringify(e.value)}s(Fz,"holds");function rI(e){return e.entries.map(n=>({address:n.address,state:n.state,holds:Fz(n),producer:n.producer?.label??"",written:n.writtenAt===void 0?"":new Date(n.writtenAt).toISOString()}))}s(rI,"storeRows");function cf(e){let n={},t={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(t,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);t[o]=a;try{n[o]=JSON.parse(a)}catch{n[o]=a}}return{values:n,raw:t}}s(cf,"parseKv");var iI="started",uf="submitted",ff="submitted",oI="load-scenario:";var sI="(Bewerbung)";function aI(e){return{nodeId:sI,actions:e.map(n=>({id:n.id,label:{de:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`,en:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`},...n.disabledReason===void 0?{}:{disabledReason:n.disabledReason}}))}}s(aI,"sharedAsList");function lI(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(lI,"disabledText");function dI(e){return e.flatMap(({nodeId:n,actions:t})=>t.map(r=>({node:n,action:r.id,label:r.label.de,disabled:lI(r)})))}s(dI,"actionRows");function cI(e,n,t=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===n));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${n}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${n}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===n);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${n}" on ${i} is disabled: ${lI(a)}`);if(i!==sI)return i;let l=t[0];if(l===void 0)throw new Error(`test-actions run: "${n}" needs a current node \u2014 the application has none`);return l}s(cI,"nodeOfferingAction");function uI(e,n,t){if(e.startsWith(oI)){if(Object.hasOwn(t,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:n,...t}}return Object.keys(t).length===0?void 0:{...t}}s(uI,"runParams");async function Lz(e,n){let t=await e.query(x.workflow.getInstance,{applicationId:n});if(t===null)throw new Error(`test-actions: application ${n} has no workflow instance`);return t.instance.currentNodeIds}s(Lz,"currentNodeIds");function Mz(e,n){switch(n){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${n} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(Mz,"refusalText");async function pf(e,n,t){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:n});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${Mz(n,r.reason)}`);let i=[];for(let o of t){let a=await e.query(x.workflow.listTestActions,{applicationId:n,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,aI(r.actions)]}s(pf,"actionsOf");async function fI(e,n,t){return t!==void 0?[t]:await Lz(e,n)}s(fI,"nodesOf");var ly=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=T.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let n=await this.caller(),t=await pf(n,this.application,await fI(n,this.application,this.node));return this.print(t,dI,["node","action","label","disabled"]),0}},dy=class extends D{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=T.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (its `confirm` in `test-actions list`)"});async execute(){let n=uI(this.action,this.autoSubmit,cf(this.param??[]).values),t=await this.caller(),r=this.application,i=await fI(t,this.application,this.node),o=cI(await pf(t,r,i),this.action,i);return await t.mutation(x.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...n===void 0?{}:{params:n}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},pI=[ly,dy];var We=["de","en"];function Ts(e,n){return We.every(t=>e[t]===n[t])}s(Ts,"sameText");function Rn(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let n=e;return Object.keys(n).some(r=>!We.includes(r))?"not-localized":We.filter(r=>{let i=n[r];return typeof i!="string"||i.trim()===""})}s(Rn,"missingLocales");function Ii(e){let n=Rn(e);return n!=="not-localized"&&n.length===0}s(Ii,"isLocalizedText");function vl(e,n){let t={};for(let r of We){let i=e.map(o=>o[r]);t[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?n(i,r):""}return t}s(vl,"composeTexts");var mr=/^[a-z][A-Za-z0-9]*$/;function cy(e){return typeof e=="string"&&mr.test(e)}s(cy,"isNodeId");function $s(e,n){cy(e)||L(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${mr.source}.`);let t=new Set(n);if(!t.has(e))return e;let r=2;for(;t.has(`${e}${r}`);)r++;return`${e}${r}`}s($s,"makeNodeId");var _i="$env";function pe(e){if(e.scope==="env")return`${_i}.${e.key}`;let n=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?n:`${n}.${e.path}`}s(pe,"formatAddress");var Oi=/^[a-z][a-zA-Z0-9_]*$/,qz=/^[A-Za-z_][A-Za-z0-9_]*$/;function wo(e){return typeof e=="string"&&e.split(".").every(n=>qz.test(n))}s(wo,"isPath");function Hr(e){if(!e.startsWith("$"))return null;let n=e.slice(1).split("."),[t,...r]=n;switch(t){case"env":{let i=r.join(".");return r.length>0&&wo(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!Oi.test(o)||(t==="node"?!mr.test(i):!Oi.test(i))?null:Kz({scope:t,owner:i,key:o},a)}default:return null}}s(Hr,"tryParseAddress");function Kz(e,n){if(n.length===0)return e;let t=n.join(".");return wo(t)?{...e,path:t}:null}s(Kz,"withPath");function xe(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=n.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(n).some(r=>!t.includes(r))||n.path!==void 0&&!wo(n.path))return!1;switch(n.scope){case"env":return wo(n.key);case"node":return typeof n.owner=="string"&&mr.test(n.owner)&&typeof n.key=="string"&&Oi.test(n.key);case"task":return typeof n.owner=="string"&&Oi.test(n.owner)&&typeof n.key=="string"&&Oi.test(n.key);default:return!1}}s(xe,"isAddress");var Jr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},Rs=Object.keys(Jr);function Is(e){return Object.hasOwn(Jr,e)}s(Is,"isEnvKey");var jz=["self-service","staff"];function mI(e,n){return{kind:"fixed",values:e,labels:n}}s(mI,"fixedSet");var mf={of:"applicant.language",withoutValue:"de"},Qr={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:mf},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:mf},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:mf},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:mf},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:mI(We,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:mI(jz,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},hf={types:Jr,fields:Qr},gf=Rs.flatMap(e=>Object.keys(Jr[e]).map(n=>`${e}.${n}`));function Ht(e){return Object.hasOwn(Qr,e)}s(Ht,"isEnvLeaf");function yf(e){return`${_i}.${e}`}s(yf,"envIdentifier");function ko(e){let n=Qr[e],[t,r]=e.split("."),i=Jr[t][r];i===void 0&&L(`[env] leaf "${e}" has no type`);let o=n.valueSet;return{leaf:e,type:i,label:n.label,nullable:n.nullable,...n.absent===void 0?{}:{absent:n.absent},...n.nameLanguage===void 0?{}:{nameLanguage:n.nameLanguage},...n.cohortBound===void 0?{}:{cohortBound:n.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&L(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(ko,"envLeaf");var hI="staffInput";var Vz=["boolean"],xl=/^[a-z][A-Za-z0-9]*$/;function wf(e){return e.staffInputs??[]}s(wf,"staffInputsOf");function kf(e){return`${hI}.${e}`}s(kf,"staffInputLeaf");function gI(e){return`${_i}.${kf(e)}`}s(gI,"staffInputIdentifier");function Bz(e){let n=`${hI}.`;return e.startsWith(n)?e.slice(n.length):null}s(Bz,"staffInputKeyOfLeaf");function Os(e,n){let t=Bz(n);return t===null?void 0:wf(e).find(r=>r.key===t)}s(Os,"declaredStaffInput");function yI(e){return[...wf(e).map(n=>({leaf:kf(n.key),type:n.type,label:n.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...gf.map(n=>{let t=ko(n);return{leaf:n,type:t.type,label:t.label,valueSet:Qr[n].valueSet,nullable:t.nullable,cohortBound:t.cohortBound===!0}})]}s(yI,"envLeavesFor");function wI(e){return yI(e).filter(n=>!n.cohortBound)}s(wI,"conditionEnvLeaves");function kI(e){return vI(wI(e))}s(kI,"envConditionSchemaFor");function Uz(e){return yI(e).map(n=>n.leaf==="stage.key"?{...n,valueSet:{kind:"open"}}:n)}s(Uz,"offerConditionEnvLeaves");function bI(e){return vI(Uz(e))}s(bI,"offerConditionSchemaFor");function vI(e){let n={},t={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");n[l]={...n[l]??{},[d]:i},t[r]={valueSet:o,nullable:a}}return{types:n,fields:t}}s(vI,"schemaOfLeaves");function xI(e){let n=e.staffInputs;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let t=[],r=new Set;return n.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){t.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};xl.test(l.key)||t.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&t.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),Vz.includes(l.type)||t.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=Rn(l.label);c==="not-localized"?t.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&t.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),t}s(xI,"staffInputIssues");var by={required:!0,description:"Offer slug (its offerKey)"},uy=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=T.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",by);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let n=await this.caller(),t=await n.query(x.admission.listForAngebot,{client:this.requireTenant(n),offerKey:this.offer}),r=eI(t).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},fy=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=T.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",by);async execute(){let n=await this.caller(),t=await n.query(x.admission.getCountsByListForAngebot,{client:this.requireTenant(n),offerKey:this.offer});return this.print(t,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},py=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=T.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let n=await this.caller(),t=this.application,r=await n.query(x.admission.get,{applicationId:t});if(r===null)throw new Error(`applications show: no application ${t} (or not visible to you)`);let i=await n.query(x.workflow.getInstance,{applicationId:t});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:t},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerId},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},my=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=T.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let t=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(tI(t),()=>rI(t),["address","state","holds","producer","written"]),0}},hy=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=T.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=f.String("--offer",by);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=f.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let n=await this.caller();nI(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let t=this.requireTenant(n),r=XR(await n.query(x.admission.listAdmissionTree,{client:t}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await n.query(x.applicants.partyByEmail,{client:t,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await n.mutation(x.admission.staffStartApplicationForParty,{client:t,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:AI(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await n.query(x.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await pf(n,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},gy=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=T.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one), or with --all-test every expired one of the school",details:"With an id: discards that test application. With --all-test --older-than <N>d: lists the school's test applications whose last activity is older than N days (N \u2265 14) and that are not kept as a demo \u2014 a dry run unless --confirm; --confirm discards each expired one the server re-checks, the rest are reported with the reason. Recipe: playbooks/applications/expire-test-applications.md.",examples:[["Dry run","plexus-cli --env prod --tenant <t> applications discard-test --all-test --older-than 14d --dry-run"],["Discard","plexus-cli --env prod --tenant <t> --allow-prod applications discard-test --all-test --older-than 14d --confirm"]]});application=f.String({required:!1});allTest=f.Boolean("--all-test",!1,{description:"Every expired test application of the school instead of one id"});olderThan=f.String("--older-than",{description:"With --all-test: days without activity, as <N>d (N \u2265 14)"});dryRun=f.Boolean("--dry-run",!1,{description:"With --all-test: list only (the default)"});confirm=f.Boolean("--confirm",!1,{description:"With --all-test: discard (else the dry run)"});async execute(){if(!this.allTest){if(this.application===void 0)throw new Error("applications discard-test: name an application id, or use --all-test --older-than <N>d");if(this.olderThan!==void 0||this.dryRun||this.confirm)throw new Error("applications discard-test: --older-than, --dry-run and --confirm belong to --all-test");return await(await this.caller()).mutation(x.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},u=>[{key:"discarded",value:u.discarded}]),0}if(this.application!==void 0)throw new Error("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new Error("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new Error("applications discard-test: --dry-run and --confirm exclude each other");let n=Gz(this.olderThan),t=await this.caller(),r=this.requireTenant(t),i=[],o=null;for(;;){let c=await t.query(x.admission.testTtlPlan,{client:r,olderThanDays:n,cursor:o});if(i.push(...c.rows),c.isDone)break;o=c.continueCursor}let a=i.map(c=>({...c,result:c.verdict!=="expired"?"kept":c.block!==null?"blocked":this.confirm?"pending":"would discard"})),l=i.filter(c=>c.verdict==="expired"&&c.protectedDemo).map(c=>c.applicationId);if(this.confirm&&l.length>0)throw new Error(`applications discard-test --all-test: protected demo application(s) in the discard set, nothing discarded: ${l.join(", ")}`);let d=0;if(this.confirm)for(let c of a.filter(u=>u.result==="pending"))try{await t.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:n}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:n,confirm:this.confirm,rows:a},c=>c.rows.map(u=>({id:u.applicationId,lastActivity:new Date(u.lastActivityAt).toISOString().slice(0,10),verdict:u.verdict,block:u.block??"",result:u.result})),["id","lastActivity","verdict","block","result"]),d>0?1:0}};function Gz(e){let n=/^(\d+)d$/.exec(e.trim());if(n===null)throw new Error(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(n[1])}s(Gz,"parseDays");var yy=class extends D{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=T.Usage({category:"Admission",description:"Mark a TEST application \u201EDemo behalten\u201C (never expires, never discarded), or clear the mark with --off"});application=f.String({required:!0});off=f.Boolean("--off",!1,{description:"Clear the mark"});async execute(){return await(await this.caller()).mutation(x.admission.setKeepAsDemo,{applicationId:this.application,keep:!this.off}),this.print({application:this.application,keepAsDemo:!this.off},t=>[{key:"application",value:t.application},{key:"keep as demo",value:t.keepAsDemo?"ja":"nein"}]),0}},wy=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=T.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let t=await(await this.caller()).query(x.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(t,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},ky=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=T.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let n=await this.caller(),[{key:t,value:r}]=AI([this.input]);return await n.mutation(x.admission.correctStaffInput,{applicationId:this.application,key:t,value:r,reason:this.reason}),this.print({application:this.application,key:t,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},SI=[uy,fy,py,my,hy,gy,yy,wy,ky];function AI(e){return e.map(n=>{let[t="",r,...i]=n.split("=");if(!xl.test(t)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${n}": expected key=true or key=false`);return{key:t,value:r==="true"}})}s(AI,"parseStaffInputs");var Vn="contractGenerator",bo="documentTemplate";function Sl(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=Object.keys(n);return(n.kind==="generator"||n.kind==="package")&&typeof n.key=="string"&&n.key.length>0&&(n.revision===void 0||typeof n.revision=="number"&&Number.isInteger(n.revision)&&n.revision>0)&&t.every(r=>r==="kind"||r==="key"||r==="revision")}s(Sl,"isGeneratorRef");function EI(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(EI,"literalOf");function Zr(e){let n=EI(e,Vn);return Sl(n)?n:null}s(Zr,"generatorRefOfNode");function hr(e){let n=EI(e,bo);return typeof n=="string"&&n.length>0?n:null}s(hr,"documentTemplateKeyOfNode");function TI(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(TI,"generatorRefLabel");var zz=["formExports","generatorStamp"];function $I(e,n,t){let r=e.inputs?.[Vn];(r?.kind!=="literal"||!Sl(r.value))&&L(`applyGeneratorStamp: the node names no generator in inputs.${Vn} \u2014 a stamp derives from it`),t.freezeRevision&&n.revision!==void 0&&(e.inputs[Vn]={kind:"literal",value:{...r.value,revision:n.revision}}),e.generatorStamp={inputSchema:n.inputSchema,parties:n.parties,schemaDigest:n.schemaDigest,...n.parts===void 0?{}:{parts:n.parts},...n.coverLetter===void 0?{}:{coverLetter:n.coverLetter}}}s($I,"applyGeneratorStamp");var Wz=["reads"];function _s(e){if(e===null||typeof e!="object")return e;let n={...e};return Array.isArray(n.nodes)&&(n.nodes=n.nodes.map(t=>{if(t===null||typeof t!="object")return t;let r={...t};for(let i of zz)delete r[i];for(let i of Wz)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),n}s(_s,"comparableWorkflowGraph");var Al={id:{de:"die Identit\xE4t ist der Slug des Angebots (bundle.yaml slugs.manifest)",en:"the identity is the offer's slug (bundle.yaml slugs.manifest)"},label:{de:"der Titel steht in bundle.yaml `label`",en:"the title is bundle.yaml `label`"},version:{de:"die Revision z\xE4hlt die Datenbank",en:"the database counts the revision"},applicantMode:{de:"von nichts gelesen",en:"read by nothing"},signatureLevel:{de:"von nichts gelesen",en:"read by nothing"},roleInstances:{de:"die Rollen kommen aus den Formular-Effekten",en:"roles come from the form effects"},leistungen:{de:"von nichts gelesen",en:"read by nothing"},capacity:{de:"die Kapazit\xE4t geh\xF6rt der Kohorte (program.runs[].capacities)",en:"capacity belongs to the cohort (program.runs[].capacities)"},progressLayoutId:{de:"von nichts gelesen",en:"read by nothing"},bewerbungsfenster:{de:"die Kohorte besitzt die \xD6ffnung (isOpen / applicationOpensAt)",en:"the cohort owns opening (isOpen / applicationOpensAt)"},selection:{de:"die Reihenfolge ist der Eingang `waitlistOrder` des Wartelistenknotens (automatisches Nachr\xFCcken gibt es nicht mehr; Freigabe-Strategie und Stichtag las nichts)",en:"the order is the waitlist node's input `waitlistOrder` (automatic promotion is gone; release strategy and deadline were read by nothing)"},progressLayout:{de:"das Fortschrittslayout geh\xF6rt zum Workflow: den Block nach workflow.json `progressLayout` verschieben (ohne Workflow l\xF6schen)",en:"the progress layout belongs to the workflow: move the block to workflow.json `progressLayout` (without a workflow: delete it)"}};function bf(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(n=>{let t=Al[n];return t!==void 0?`manifest: \`${n}\` is no longer part of manifest.json (${t.en}). Delete the line.`:`manifest: unknown key \`${n}\` \u2014 manifest.json carries no key.`})}s(bf,"manifestIssues");function Yz(e){let n=[],t=e.buses;if(!Array.isArray(t))return n;let r=t.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return n;for(let i of r.states){if(!i||typeof i!="object")continue;let o=i;if(o.terminal!==!0&&(!o.external||typeof o.external!="object")){let a=typeof o.id=="string"?o.id:"?";n.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return n}s(Yz,"validateProgressLayoutExternalCopy");function RI(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let n=e.buses;return!Array.isArray(n)||!n.some(t=>!!t&&typeof t=="object"&&t.key==="process")?["progressLayout: the layout must declare the `process` bus"]:Yz(e)}s(RI,"progressLayoutIssues");var II=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var Hz=new Set(["sections","effects","outcomes","testScenarios","env","views"]),vf={id:{de:"der Schl\xFCssel des Formulars ist sein Slug",en:"the form's key is its slug"},label:{de:"der Name steht in der Formularzeile (createSmartForm.label)",en:"the name is the form row's (createSmartForm.label)"},outcomeIds:{de:"die Ergebnisse sind die ids von outcomes[]",en:"the outcomes are the ids of outcomes[]"},schoolSlug:{de:"von nichts gelesen",en:"read by nothing"}};function OI(e,n){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${n}: die Formulardefinition muss ein Objekt sein.`,en:`${n}: the form definition must be an object.`}];let t=[];for(let i of Object.keys(e)){if(Hz.has(i))continue;let o=vf[i];t.push(o!==void 0?{de:`${n}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${n}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${n}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${n}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||t.push({de:`${n}: \`${i}\` muss eine Liste sein.`,en:`${n}: \`${i}\` must be a list.`});return t}s(OI,"smartFormDefinitionShapeIssues");var kt=["granted","rejected","waitlisted","other"];function Ni(e){return typeof e=="string"&&kt.includes(e)}s(Ni,"isOutcomeSemantic");var Jt=["arrival","manual"],_I={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function Jz(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(Jz,"literal");function vy(e){let n=Jz(e,"waitlistOrder");return Jt.includes(n)?{waitlistOrder:n}:null}s(vy,"waitlistPolicyOrNull");var gn="responsible",xy="team:";function xf(e){return`${xy}${e}`}s(xf,"teamSlot");function Sf(e){return e.startsWith(xy)?e.slice(xy.length):null}s(Sf,"teamKeyOfSlot");function NI(e){return e.kind==="responsible"?gn:xf(e.groupKey)}s(NI,"slotIdOf");function Af(e){if(e===gn)return{kind:"responsible"};let n=Sf(e);return n===null||n.length===0?null:{kind:"team",groupKey:n}}s(Af,"slotOfId");var Sy="review",Ay="checkField",PI="reviewed",CI="reviewing",Ef=["rejected","waitlisted"];function Ey(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Ey,"isObject");var Qz=new Set(["decision",Sy]),DI={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function Ty(e){return Object.hasOwn(DI,e)?DI[e]:void 0}s(Ty,"legacySemanticOfId");function Zz(e){return e===Sy?kt.filter(n=>!Ef.includes(n)):kt}s(Zz,"allowedSemanticsFor");var Xz="other";function FI(e){return Ey(e)&&Qz.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(FI,"outcomesOf");function LI(e){return(e?.nodes??[]).some(n=>FI(n).some(t=>Ey(t)&&!("semantic"in t)))}s(LI,"needsOutcomeSemantics");function MI(e,n={}){let t=[],r=[],i=[],o=e.nodes.map(a=>{let l=FI(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=Zz(u),h=!1,w=l.map(k=>{if(!Ey(k))return k;let y=String(k.id);if("semantic"in k)return Ni(k.semantic)||i.push({nodeId:c,outcomeId:y,value:String(k.semantic)}),k;let v=`${c}.${y}`,A=Object.hasOwn(n,v)?n[v]:void 0;if(A!==void 0)return p.includes(A)?(t.push({nodeId:c,outcomeId:y,semantic:A,source:"answer"}),h=!0,{...k,semantic:A}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p,answer:A}),k);let E=Ty(y),R=E??Xz;return p.includes(R)?(t.push({nodeId:c,outcomeId:y,semantic:R,source:E===void 0?"formerDefault":"legacyTable"}),h=!0,{...k,semantic:R}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p}),k)});return h?{...d,outcomes:w}:a});return t.length===0?{graph:e,written:t,refused:r,invalid:i}:{graph:{...e,nodes:o},written:t,refused:r,invalid:i}}s(MI,"addOutcomeSemantics");var gr="bewerbungOffen";function vo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(vo,"isObject");var $y=["event","effect"];function qI(e){return vo(e)&&e.type==="eventTrigger"}s(qI,"isTrigger");function KI(e){let n=vo(e.inputs)?e.inputs:{};return"outcomes"in e||$y.some(t=>t in e||t in n)}s(KI,"oldShape");function jI(e){return(e?.nodes??[]).some(n=>qI(n)&&KI(n))}s(jI,"needsEventTriggerStartMove");function eW(e){let n=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>vo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===gr))return{unmoved:{nodeId:n,reason:"outcomesNotStart"}};let i=Object.keys(vo(e.next)?e.next:{});if(!(i.length===1&&i[0]===gr))return{unmoved:{nodeId:n,reason:"nextNotStart"}};let o=vo(e.inputs)?{...e.inputs}:{};for(let l of $y){let d=o[l];if(vo(d)&&d.kind==="binding")return{unmoved:{nodeId:n,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of $y)delete a[l],delete o[l];return vo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(eW,"moveNode");function VI(e){let n=[],t=[],r=e.nodes.map(i=>{if(!qI(i)||!KI(i))return i;let o=eW(i);return"unmoved"in o?(t.push(o.unmoved),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(VI,"moveEventTriggerStart");function El(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(El,"isObject");var BI={waitlistOrder:"arrival"};function UI(e){return!El(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(El(e.inputs)?e.inputs:{}))}s(UI,"lacksPolicy");function nW(e){return(e?.nodes??[]).some(UI)}s(nW,"needsWaitlistPolicyMove");function Ry(e){return El(e)&&Jt.includes(e.waitlistOrder)}s(Ry,"isWaitlistPolicy");function tW(e){if(e===void 0)return{policy:BI,stated:!1};if(!El(e))return"malformed";let n=e.waitlistOrder;return n!==void 0&&!Jt.includes(n)?"malformed":{policy:{waitlistOrder:n??BI.waitlistOrder},stated:n!==void 0}}s(tW,"policyOfSelection");function GI(e,n,t={}){let r=[],i=[];if(!nW(e))return{graph:e,moved:r,refused:i};let o=tW(n),a=e.nodes.map(l=>{if(!UI(l))return l;let d=l,c=String(d.id),u=El(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(t,c)?t[c]:void 0,h,w;if(p!==void 0)h=p,w="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,w=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:w}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(GI,"moveWaitlistPolicyToInputs");function xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(xo,"isObject");var rW=[Vn,bo],iW=["inputSchema","parties","schemaDigest","parts"];function zI(e){return xo(e)&&e.type==="governedDocument"&&("resolver"in e||xo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s(zI,"oldShape");function WI(e){return(e?.nodes??[]).some(zI)}s(WI,"needsGeneratorInputMove");function oW(e){let n=xo(e.inputs)?{...e.inputs}:{},t={...e},r;if("resolver"in e){let i=e.resolver;if(!xo(i))return{unmoved:"resolverNotObject"};if(Vn in n)return{unmoved:"generatorInputExists"};if(typeof i.key!="string"||i.key.length===0)return{unmoved:"pinWithoutKey"};if(i.kind!=="generator"&&i.kind!=="package")return{unmoved:"pinWithoutKind"};if(i.revision!==void 0&&!(typeof i.revision=="number"&&Number.isInteger(i.revision)&&i.revision>0))return{unmoved:"pinRevisionInvalid"};if((xo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>xo(d)&&rW.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};n[Vn]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(iW.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(t.generatorStamp=l),r=i.cockpitFields,delete t.resolver}if(xo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(bo in n)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};n[bo]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}t.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};t.cockpitFields=r}return t.inputs=n,{node:t}}s(oW,"moveNode");function YI(e){let n=[],t=[],r=e.nodes.map(i=>{if(!zI(i))return i;let o=oW(i);return"unmoved"in o?(t.push({nodeId:String(i.id),reason:o.unmoved}),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(YI,"moveGeneratorPinsToInputs");var HI=/^\d{4}-\d{2}-\d{2}$/;function yr(e,n){return{de:e,en:n}}s(yr,"issue");function So(e){if(typeof e!="object"||e===null)return yr("keine Reduktion","not a reduction");let n=e;if(n.kind==="none")return Object.keys(n).length===1?null:yr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(n.kind!=="amount")return yr(`unbekannte Art ${JSON.stringify(n.kind)}`,`unknown kind ${JSON.stringify(n.kind)}`);let{amount:t,activeFrom:r,activeTo:i}=n;return typeof t!="number"||!Number.isFinite(t)||t<=0?yr("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((t*100).toFixed(6)))?typeof r!="string"||!HI.test(r)?yr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!HI.test(i)?yr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?yr("das Ende liegt vor dem Beginn","the end is before the start"):n.floorTotal!==void 0&&(typeof n.floorTotal!="number"||!Number.isSafeInteger(n.floorTotal)||n.floorTotal<0)?yr("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):n.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(n.pricePeriod))?yr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(n).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?yr("unbekannte Angaben","unknown details"):null:yr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(So,"reductionShapeIssue");function Pi(e){if(typeof e!="object"||e===null)return!1;let n=e;return typeof n.itemKey=="string"&&n.itemKey.length>0&&Array.isArray(n.grantKeys)&&n.grantKeys.every(t=>typeof t=="string"&&t.length>0)&&(n.reduction===void 0||So(n.reduction)===null&&n.reduction.kind==="amount")}s(Pi,"isPricedItemValue");var Ns=["freetext","recommendation","choice","pricedItem","record","reduction"],Ps=[...Ns,"appointment"];function QI(e){return typeof e=="string"&&Ps.includes(e)}s(QI,"isTaskResultKind");function Ci(e){return typeof e=="string"&&Ns.includes(e)}s(Ci,"isRecordedTaskResultKind");function Cs(e){return Ci(e.kind)}s(Cs,"isRecordedTaskResult");var Tf=["number","boolean","enum","text","person","assignment"];function Iy(e){return typeof e=="string"&&Tf.includes(e)}s(Iy,"isRecordFieldType");function ZI(e){return e==="number"||e==="boolean"||e==="enum"}s(ZI,"isSuggestibleFieldType");var Oy=["form","siblingRank"],$f=500;function sW(e){switch(e.type){case"number":case"boolean":case"enum":return e.type;case"text":return"string";case"person":return e.multiple===!0?"staffUserList":"staffUser";case"assignment":return"taskAssignment"}}s(sW,"recordFieldValueType");var Xr={freetext:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Freitext",en:"Free text"}},recommendation:{choiceValueType:"enum",valueType:null,textValueType:"string",label:{de:"Empfehlung",en:"Recommendation"}},choice:{choiceValueType:"enum",valueType:"enum",textValueType:"string",label:{de:"Auswahl",en:"Choice"}},pricedItem:{choiceValueType:"enum",valueType:"pricedItem",textValueType:"string",label:{de:"Preisposition",en:"Priced item"}},reduction:{choiceValueType:null,valueType:"reduction",textValueType:"string",label:{de:"Reduktion",en:"Reduction"}},record:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Erfassung",en:"Record"}},appointment:{choiceValueType:null,valueType:null,textValueType:null,label:{de:"Termin",en:"Appointment"}}};function XI(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(XI,"isProseResult");function Rf(e){return e.kind==="record"?(e.fields??[]).filter(n=>typeof n.writes=="string"&&n.writes.length>0&&Iy(n.type)).map(n=>({key:n.writes,valueType:sW(n),field:n})):aW(e)}s(Rf,"draftResultStoreWrites");function aW(e){let n=Xr[e.kind].valueType;return e.writes===void 0||n===null?[]:[{key:e.writes,valueType:n}]}s(aW,"singleStoreWrite");var JI="team:";function Ds(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(JI)){let n=e.slice(JI.length);return n.length===0?null:{kind:"team",groupKey:n}}return{kind:"channel",channelKey:e}}s(Ds,"parseTaskResultChat");var Ue={unknownKind:"[taskResult/unknownKind]",onApproval:"[taskResult/onApproval]",unknownField:"[taskResult/unknownField]",choiceOptions:"[taskResult/choiceOptions]",textRequiredOnFreetext:"[taskResult/textRequiredOnFreetext]",chatMissing:"[taskResult/chatMissing]",chatExternal:"[taskResult/chatExternal]",chatUnknownChannel:"[taskResult/chatUnknownChannel]",appointmentMissingTitle:"[taskResult/appointmentMissingTitle]",pricedItemMissingItem:"[taskResult/pricedItemMissingItem]",pricedItemUnknownItem:"[taskResult/pricedItemUnknownItem]",pricedItemNotInProgram:"[taskResult/pricedItemNotInProgram]",pricedItemOfferWithoutProgram:"[taskResult/pricedItemOfferWithoutProgram]",itemOnNonPricedItem:"[taskResult/itemOnNonPricedItem]",writesOnProse:"[taskResult/writesOnProse]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",recordText:"[taskResult/recordText]",recordPerson:"[taskResult/recordPerson]",recordAssignment:"[taskResult/recordAssignment]",reductionPrices:"[taskResult/reductionPrices]"};var lW=new Set(["if","else","in","true","false","null"]),dW=new Set(["==","!=","<=",">=","&&","||"]);function cW(e){return e>="0"&&e<="9"}s(cW,"isDigit");function uW(e){return/[a-zA-Z_$]/.test(e)}s(uW,"isIdentStart");function fW(e){return/[a-zA-Z0-9_.$]/.test(e)}s(fW,"isIdentCont");function pW(e){let n=[],t=0;for(;t<e.length;){let r=e.charAt(t);if(r===" "||r===" "||r===`
|
|
10979
|
+
`};var df="13befa7cacfcefc3b800fbfeb9018c0760579a2333fbf4ef1f7fbeef9d33c312",iy=JR;var oy=class extends ve{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=T.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:df,tools:bl}),0}},sy=class extends ve{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=T.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let n=JSON.parse(await ry(this.context.stdin)),t=await this.context.executePlexusAgentTool(this.tool,n);return this.print(t),0}},QR=[oy,sy];var ay=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],Yle=new Set(ay.map(e=>e.key));function XR(e,n,t,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===n);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${n}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${n} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===t||l.runId===t);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${t}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(XR,"resolveStartTarget");function Cz(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Cz,"applicantText");function eI(e){return e.map(n=>({id:n.application._id,status:n.deletedAt?`${n.application.status} (gel\xF6scht)`:n.application.status,state:n.currentProcessStateId??"",applicant:Cz(n.applicantName),test:n.application.testMode===!0?"test":""}))}s(eI,"applicationRows");var ZR=ay.map(e=>e.email);function nI(e,n,t,r){if(t===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(t!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(ey(e,n)&&(r===void 0||!ZR.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${ZR.join(", ")} (--applicant) \u2014 never a real family's`)}s(nI,"assertStartApplicant");function tI(e){let n={};for(let{address:t,...r}of e.entries)n[t]=r;return{applicationId:e.applicationId,store:n}}s(tI,"processStoreJson");function Dz(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.snapshotNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(n=>`${n.partKey}: contract ${n.contractId} \xB7 ${n.revision===null?"keine Fassung":`Fassung ${n.revision.snapshotNumber}`} \xB7 ${n.contractStatus}`).join("; ")}}s(Dz,"refText");function Fz(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Dz(e.ref):JSON.stringify(e.value)}s(Fz,"holds");function rI(e){return e.entries.map(n=>({address:n.address,state:n.state,holds:Fz(n),producer:n.producer?.label??"",written:n.writtenAt===void 0?"":new Date(n.writtenAt).toISOString()}))}s(rI,"storeRows");function cf(e){let n={},t={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(t,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);t[o]=a;try{n[o]=JSON.parse(a)}catch{n[o]=a}}return{values:n,raw:t}}s(cf,"parseKv");var iI="started",uf="submitted",ff="submitted",oI="load-scenario:";var sI="(Bewerbung)";function aI(e){return{nodeId:sI,actions:e.map(n=>({id:n.id,label:{de:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`,en:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`},...n.disabledReason===void 0?{}:{disabledReason:n.disabledReason}}))}}s(aI,"sharedAsList");function lI(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(lI,"disabledText");function dI(e){return e.flatMap(({nodeId:n,actions:t})=>t.map(r=>({node:n,action:r.id,label:r.label.de,disabled:lI(r)})))}s(dI,"actionRows");function cI(e,n,t=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===n));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${n}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${n}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===n);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${n}" on ${i} is disabled: ${lI(a)}`);if(i!==sI)return i;let l=t[0];if(l===void 0)throw new Error(`test-actions run: "${n}" needs a current node \u2014 the application has none`);return l}s(cI,"nodeOfferingAction");function uI(e,n,t){if(e.startsWith(oI)){if(Object.hasOwn(t,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:n,...t}}return Object.keys(t).length===0?void 0:{...t}}s(uI,"runParams");async function Lz(e,n){let t=await e.query(x.workflow.getInstance,{applicationId:n});if(t===null)throw new Error(`test-actions: application ${n} has no workflow instance`);return t.instance.currentNodeIds}s(Lz,"currentNodeIds");function Mz(e,n){switch(n){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${n} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(Mz,"refusalText");async function pf(e,n,t){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:n});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${Mz(n,r.reason)}`);let i=[];for(let o of t){let a=await e.query(x.workflow.listTestActions,{applicationId:n,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,aI(r.actions)]}s(pf,"actionsOf");async function fI(e,n,t){return t!==void 0?[t]:await Lz(e,n)}s(fI,"nodesOf");var ly=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=T.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let n=await this.caller(),t=await pf(n,this.application,await fI(n,this.application,this.node));return this.print(t,dI,["node","action","label","disabled"]),0}},dy=class extends D{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=T.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (its `confirm` in `test-actions list`)"});async execute(){let n=uI(this.action,this.autoSubmit,cf(this.param??[]).values),t=await this.caller(),r=this.application,i=await fI(t,this.application,this.node),o=cI(await pf(t,r,i),this.action,i);return await t.mutation(x.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...n===void 0?{}:{params:n}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},pI=[ly,dy];var We=["de","en"];function Ts(e,n){return We.every(t=>e[t]===n[t])}s(Ts,"sameText");function Rn(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let n=e;return Object.keys(n).some(r=>!We.includes(r))?"not-localized":We.filter(r=>{let i=n[r];return typeof i!="string"||i.trim()===""})}s(Rn,"missingLocales");function Ii(e){let n=Rn(e);return n!=="not-localized"&&n.length===0}s(Ii,"isLocalizedText");function vl(e,n){let t={};for(let r of We){let i=e.map(o=>o[r]);t[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?n(i,r):""}return t}s(vl,"composeTexts");var mr=/^[a-z][A-Za-z0-9]*$/;function cy(e){return typeof e=="string"&&mr.test(e)}s(cy,"isNodeId");function $s(e,n){cy(e)||L(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${mr.source}.`);let t=new Set(n);if(!t.has(e))return e;let r=2;for(;t.has(`${e}${r}`);)r++;return`${e}${r}`}s($s,"makeNodeId");var _i="$env";function pe(e){if(e.scope==="env")return`${_i}.${e.key}`;let n=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?n:`${n}.${e.path}`}s(pe,"formatAddress");var Oi=/^[a-z][a-zA-Z0-9_]*$/,qz=/^[A-Za-z_][A-Za-z0-9_]*$/;function wo(e){return typeof e=="string"&&e.split(".").every(n=>qz.test(n))}s(wo,"isPath");function Hr(e){if(!e.startsWith("$"))return null;let n=e.slice(1).split("."),[t,...r]=n;switch(t){case"env":{let i=r.join(".");return r.length>0&&wo(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!Oi.test(o)||(t==="node"?!mr.test(i):!Oi.test(i))?null:Kz({scope:t,owner:i,key:o},a)}default:return null}}s(Hr,"tryParseAddress");function Kz(e,n){if(n.length===0)return e;let t=n.join(".");return wo(t)?{...e,path:t}:null}s(Kz,"withPath");function xe(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=n.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(n).some(r=>!t.includes(r))||n.path!==void 0&&!wo(n.path))return!1;switch(n.scope){case"env":return wo(n.key);case"node":return typeof n.owner=="string"&&mr.test(n.owner)&&typeof n.key=="string"&&Oi.test(n.key);case"task":return typeof n.owner=="string"&&Oi.test(n.owner)&&typeof n.key=="string"&&Oi.test(n.key);default:return!1}}s(xe,"isAddress");var Jr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},Rs=Object.keys(Jr);function Is(e){return Object.hasOwn(Jr,e)}s(Is,"isEnvKey");var jz=["self-service","staff"];function mI(e,n){return{kind:"fixed",values:e,labels:n}}s(mI,"fixedSet");var mf={of:"applicant.language",withoutValue:"de"},Qr={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:mf},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:mf},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:mf},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:mf},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:mI(We,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:mI(jz,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},hf={types:Jr,fields:Qr},gf=Rs.flatMap(e=>Object.keys(Jr[e]).map(n=>`${e}.${n}`));function Ht(e){return Object.hasOwn(Qr,e)}s(Ht,"isEnvLeaf");function yf(e){return`${_i}.${e}`}s(yf,"envIdentifier");function ko(e){let n=Qr[e],[t,r]=e.split("."),i=Jr[t][r];i===void 0&&L(`[env] leaf "${e}" has no type`);let o=n.valueSet;return{leaf:e,type:i,label:n.label,nullable:n.nullable,...n.absent===void 0?{}:{absent:n.absent},...n.nameLanguage===void 0?{}:{nameLanguage:n.nameLanguage},...n.cohortBound===void 0?{}:{cohortBound:n.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&L(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(ko,"envLeaf");var hI="staffInput";var Vz=["boolean"],xl=/^[a-z][A-Za-z0-9]*$/;function wf(e){return e.staffInputs??[]}s(wf,"staffInputsOf");function kf(e){return`${hI}.${e}`}s(kf,"staffInputLeaf");function gI(e){return`${_i}.${kf(e)}`}s(gI,"staffInputIdentifier");function Bz(e){let n=`${hI}.`;return e.startsWith(n)?e.slice(n.length):null}s(Bz,"staffInputKeyOfLeaf");function Os(e,n){let t=Bz(n);return t===null?void 0:wf(e).find(r=>r.key===t)}s(Os,"declaredStaffInput");function yI(e){return[...wf(e).map(n=>({leaf:kf(n.key),type:n.type,label:n.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...gf.map(n=>{let t=ko(n);return{leaf:n,type:t.type,label:t.label,valueSet:Qr[n].valueSet,nullable:t.nullable,cohortBound:t.cohortBound===!0}})]}s(yI,"envLeavesFor");function wI(e){return yI(e).filter(n=>!n.cohortBound)}s(wI,"conditionEnvLeaves");function kI(e){return vI(wI(e))}s(kI,"envConditionSchemaFor");function Uz(e){return yI(e).map(n=>n.leaf==="stage.key"?{...n,valueSet:{kind:"open"}}:n)}s(Uz,"offerConditionEnvLeaves");function bI(e){return vI(Uz(e))}s(bI,"offerConditionSchemaFor");function vI(e){let n={},t={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");n[l]={...n[l]??{},[d]:i},t[r]={valueSet:o,nullable:a}}return{types:n,fields:t}}s(vI,"schemaOfLeaves");function xI(e){let n=e.staffInputs;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let t=[],r=new Set;return n.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){t.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};xl.test(l.key)||t.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&t.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),Vz.includes(l.type)||t.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=Rn(l.label);c==="not-localized"?t.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&t.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),t}s(xI,"staffInputIssues");var by={required:!0,description:"Offer slug (its offerKey)"},uy=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=T.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",by);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let n=await this.caller(),t=await n.query(x.admission.listForAngebot,{client:this.requireTenant(n),offerKey:this.offer}),r=eI(t).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},fy=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=T.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",by);async execute(){let n=await this.caller(),t=await n.query(x.admission.getCountsByListForAngebot,{client:this.requireTenant(n),offerKey:this.offer});return this.print(t,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},py=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=T.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let n=await this.caller(),t=this.application,r=await n.query(x.admission.get,{applicationId:t});if(r===null)throw new Error(`applications show: no application ${t} (or not visible to you)`);let i=await n.query(x.workflow.getInstance,{applicationId:t});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:t},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerId},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},my=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=T.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let t=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(tI(t),()=>rI(t),["address","state","holds","producer","written"]),0}},hy=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=T.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=f.String("--offer",by);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=f.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let n=await this.caller();nI(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let t=this.requireTenant(n),r=XR(await n.query(x.admission.listAdmissionTree,{client:t}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await n.query(x.applicants.partyByEmail,{client:t,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await n.mutation(x.admission.staffStartApplicationForParty,{client:t,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:AI(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await n.query(x.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await pf(n,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},gy=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=T.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one), or with --all-test every expired one of the school",details:"With an id: discards that test application. With --all-test --older-than <N>d: lists the school's test applications whose last activity is older than N days (N \u2265 14) and that are not kept as a demo \u2014 a dry run unless --confirm; --confirm discards each expired one the server re-checks, the rest are reported with the reason. Recipe: playbooks/applications/expire-test-applications.md.",examples:[["Dry run","plexus-cli --env prod --tenant <t> applications discard-test --all-test --older-than 14d --dry-run"],["Discard","plexus-cli --env prod --tenant <t> --allow-prod applications discard-test --all-test --older-than 14d --confirm"]]});application=f.String({required:!1});allTest=f.Boolean("--all-test",!1,{description:"Every expired test application of the school instead of one id"});olderThan=f.String("--older-than",{description:"With --all-test: days without activity, as <N>d (N \u2265 14)"});dryRun=f.Boolean("--dry-run",!1,{description:"With --all-test: list only (the default)"});confirm=f.Boolean("--confirm",!1,{description:"With --all-test: discard (else the dry run)"});async execute(){if(!this.allTest){if(this.application===void 0)throw new Error("applications discard-test: name an application id, or use --all-test --older-than <N>d");if(this.olderThan!==void 0||this.dryRun||this.confirm)throw new Error("applications discard-test: --older-than, --dry-run and --confirm belong to --all-test");return await(await this.caller()).mutation(x.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},u=>[{key:"discarded",value:u.discarded}]),0}if(this.application!==void 0)throw new Error("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new Error("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new Error("applications discard-test: --dry-run and --confirm exclude each other");let n=Gz(this.olderThan),t=await this.caller(),r=this.requireTenant(t),i=[],o=null;for(;;){let c=await t.query(x.admission.testTtlPlan,{client:r,olderThanDays:n,cursor:o});if(i.push(...c.rows),c.isDone)break;o=c.continueCursor}let a=i.map(c=>({...c,result:c.verdict!=="expired"?"kept":c.block!==null?"blocked":this.confirm?"pending":"would discard"})),l=i.filter(c=>c.verdict==="expired"&&c.protectedDemo).map(c=>c.applicationId);if(this.confirm&&l.length>0)throw new Error(`applications discard-test --all-test: protected demo application(s) in the discard set, nothing discarded: ${l.join(", ")}`);let d=0;if(this.confirm)for(let c of a.filter(u=>u.result==="pending"))try{await t.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:n}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:n,confirm:this.confirm,rows:a},c=>c.rows.map(u=>({id:u.applicationId,lastActivity:new Date(u.lastActivityAt).toISOString().slice(0,10),verdict:u.verdict,block:u.block??"",result:u.result})),["id","lastActivity","verdict","block","result"]),d>0?1:0}};function Gz(e){let n=/^(\d+)d$/.exec(e.trim());if(n===null)throw new Error(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(n[1])}s(Gz,"parseDays");var yy=class extends D{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=T.Usage({category:"Admission",description:"Mark a TEST application \u201EDemo behalten\u201C (never expires, never discarded), or clear the mark with --off"});application=f.String({required:!0});off=f.Boolean("--off",!1,{description:"Clear the mark"});async execute(){return await(await this.caller()).mutation(x.admission.setKeepAsDemo,{applicationId:this.application,keep:!this.off}),this.print({application:this.application,keepAsDemo:!this.off},t=>[{key:"application",value:t.application},{key:"keep as demo",value:t.keepAsDemo?"ja":"nein"}]),0}},wy=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=T.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let t=await(await this.caller()).query(x.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(t,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},ky=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=T.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let n=await this.caller(),[{key:t,value:r}]=AI([this.input]);return await n.mutation(x.admission.correctStaffInput,{applicationId:this.application,key:t,value:r,reason:this.reason}),this.print({application:this.application,key:t,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},SI=[uy,fy,py,my,hy,gy,yy,wy,ky];function AI(e){return e.map(n=>{let[t="",r,...i]=n.split("=");if(!xl.test(t)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${n}": expected key=true or key=false`);return{key:t,value:r==="true"}})}s(AI,"parseStaffInputs");var Vn="contractGenerator",bo="documentTemplate";function Sl(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=Object.keys(n);return(n.kind==="generator"||n.kind==="package")&&typeof n.key=="string"&&n.key.length>0&&(n.revision===void 0||typeof n.revision=="number"&&Number.isInteger(n.revision)&&n.revision>0)&&t.every(r=>r==="kind"||r==="key"||r==="revision")}s(Sl,"isGeneratorRef");function EI(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(EI,"literalOf");function Zr(e){let n=EI(e,Vn);return Sl(n)?n:null}s(Zr,"generatorRefOfNode");function hr(e){let n=EI(e,bo);return typeof n=="string"&&n.length>0?n:null}s(hr,"documentTemplateKeyOfNode");function TI(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(TI,"generatorRefLabel");var zz=["formExports","generatorStamp"];function $I(e,n,t){let r=e.inputs?.[Vn];(r?.kind!=="literal"||!Sl(r.value))&&L(`applyGeneratorStamp: the node names no generator in inputs.${Vn} \u2014 a stamp derives from it`),t.freezeRevision&&n.revision!==void 0&&(e.inputs[Vn]={kind:"literal",value:{...r.value,revision:n.revision}}),e.generatorStamp={inputSchema:n.inputSchema,parties:n.parties,schemaDigest:n.schemaDigest,...n.parts===void 0?{}:{parts:n.parts},...n.coverLetter===void 0?{}:{coverLetter:n.coverLetter}}}s($I,"applyGeneratorStamp");var Wz=["reads"];function _s(e){if(e===null||typeof e!="object")return e;let n={...e};return Array.isArray(n.nodes)&&(n.nodes=n.nodes.map(t=>{if(t===null||typeof t!="object")return t;let r={...t};for(let i of zz)delete r[i];for(let i of Wz)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),n}s(_s,"comparableWorkflowGraph");var Al={id:{de:"die Identit\xE4t ist der Slug des Angebots (bundle.yaml slugs.manifest)",en:"the identity is the offer's slug (bundle.yaml slugs.manifest)"},label:{de:"der Titel steht in bundle.yaml `label`",en:"the title is bundle.yaml `label`"},version:{de:"die Revision z\xE4hlt die Datenbank",en:"the database counts the revision"},applicantMode:{de:"von nichts gelesen",en:"read by nothing"},signatureLevel:{de:"von nichts gelesen",en:"read by nothing"},roleInstances:{de:"die Rollen kommen aus den Formular-Effekten",en:"roles come from the form effects"},leistungen:{de:"von nichts gelesen",en:"read by nothing"},capacity:{de:"die Kapazit\xE4t geh\xF6rt der Kohorte (program.runs[].capacities)",en:"capacity belongs to the cohort (program.runs[].capacities)"},progressLayoutId:{de:"von nichts gelesen",en:"read by nothing"},bewerbungsfenster:{de:"die Kohorte besitzt die \xD6ffnung (isOpen / applicationOpensAt)",en:"the cohort owns opening (isOpen / applicationOpensAt)"},selection:{de:"die Reihenfolge ist der Eingang `waitlistOrder` des Wartelistenknotens (automatisches Nachr\xFCcken gibt es nicht mehr; Freigabe-Strategie und Stichtag las nichts)",en:"the order is the waitlist node's input `waitlistOrder` (automatic promotion is gone; release strategy and deadline were read by nothing)"},progressLayout:{de:"das Fortschrittslayout geh\xF6rt zum Workflow: den Block nach workflow.json `progressLayout` verschieben (ohne Workflow l\xF6schen)",en:"the progress layout belongs to the workflow: move the block to workflow.json `progressLayout` (without a workflow: delete it)"}};function bf(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(n=>{let t=Al[n];return t!==void 0?`manifest: \`${n}\` is no longer part of manifest.json (${t.en}). Delete the line.`:`manifest: unknown key \`${n}\` \u2014 manifest.json carries no key.`})}s(bf,"manifestIssues");function Yz(e){let n=[],t=e.buses;if(!Array.isArray(t))return n;let r=t.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return n;for(let i of r.states){if(!i||typeof i!="object")continue;let o=i;if(o.terminal!==!0&&(!o.external||typeof o.external!="object")){let a=typeof o.id=="string"?o.id:"?";n.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return n}s(Yz,"validateProgressLayoutExternalCopy");function RI(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let n=e.buses;return!Array.isArray(n)||!n.some(t=>!!t&&typeof t=="object"&&t.key==="process")?["progressLayout: the layout must declare the `process` bus"]:Yz(e)}s(RI,"progressLayoutIssues");var II=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var Hz=new Set(["sections","effects","outcomes","testScenarios","env","views"]),vf={id:{de:"der Schl\xFCssel des Formulars ist sein Slug",en:"the form's key is its slug"},label:{de:"der Name steht in der Formularzeile (createSmartForm.label)",en:"the name is the form row's (createSmartForm.label)"},outcomeIds:{de:"die Ergebnisse sind die ids von outcomes[]",en:"the outcomes are the ids of outcomes[]"},schoolSlug:{de:"von nichts gelesen",en:"read by nothing"}};function OI(e,n){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${n}: die Formulardefinition muss ein Objekt sein.`,en:`${n}: the form definition must be an object.`}];let t=[];for(let i of Object.keys(e)){if(Hz.has(i))continue;let o=vf[i];t.push(o!==void 0?{de:`${n}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${n}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${n}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${n}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||t.push({de:`${n}: \`${i}\` muss eine Liste sein.`,en:`${n}: \`${i}\` must be a list.`});return t}s(OI,"smartFormDefinitionShapeIssues");var kt=["granted","rejected","waitlisted","other"];function Ni(e){return typeof e=="string"&&kt.includes(e)}s(Ni,"isOutcomeSemantic");var Jt=["arrival","manual"],_I={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function Jz(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(Jz,"literal");function vy(e){let n=Jz(e,"waitlistOrder");return Jt.includes(n)?{waitlistOrder:n}:null}s(vy,"waitlistPolicyOrNull");var gn="responsible",xy="team:";function xf(e){return`${xy}${e}`}s(xf,"teamSlot");function Sf(e){return e.startsWith(xy)?e.slice(xy.length):null}s(Sf,"teamKeyOfSlot");function NI(e){return e.kind==="responsible"?gn:xf(e.groupKey)}s(NI,"slotIdOf");function Af(e){if(e===gn)return{kind:"responsible"};let n=Sf(e);return n===null||n.length===0?null:{kind:"team",groupKey:n}}s(Af,"slotOfId");var Sy="review",Ay="checkField",PI="reviewed",CI="reviewing",Ef=["rejected","waitlisted"];function Ey(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Ey,"isObject");var Qz=new Set(["decision",Sy]),DI={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function Ty(e){return Object.hasOwn(DI,e)?DI[e]:void 0}s(Ty,"legacySemanticOfId");function Zz(e){return e===Sy?kt.filter(n=>!Ef.includes(n)):kt}s(Zz,"allowedSemanticsFor");var Xz="other";function FI(e){return Ey(e)&&Qz.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(FI,"outcomesOf");function LI(e){return(e?.nodes??[]).some(n=>FI(n).some(t=>Ey(t)&&!("semantic"in t)))}s(LI,"needsOutcomeSemantics");function MI(e,n={}){let t=[],r=[],i=[],o=e.nodes.map(a=>{let l=FI(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=Zz(u),h=!1,w=l.map(k=>{if(!Ey(k))return k;let y=String(k.id);if("semantic"in k)return Ni(k.semantic)||i.push({nodeId:c,outcomeId:y,value:String(k.semantic)}),k;let v=`${c}.${y}`,A=Object.hasOwn(n,v)?n[v]:void 0;if(A!==void 0)return p.includes(A)?(t.push({nodeId:c,outcomeId:y,semantic:A,source:"answer"}),h=!0,{...k,semantic:A}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p,answer:A}),k);let E=Ty(y),R=E??Xz;return p.includes(R)?(t.push({nodeId:c,outcomeId:y,semantic:R,source:E===void 0?"formerDefault":"legacyTable"}),h=!0,{...k,semantic:R}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p}),k)});return h?{...d,outcomes:w}:a});return t.length===0?{graph:e,written:t,refused:r,invalid:i}:{graph:{...e,nodes:o},written:t,refused:r,invalid:i}}s(MI,"addOutcomeSemantics");var gr="bewerbungOffen";function vo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(vo,"isObject");var $y=["event","effect"];function qI(e){return vo(e)&&e.type==="eventTrigger"}s(qI,"isTrigger");function KI(e){let n=vo(e.inputs)?e.inputs:{};return"outcomes"in e||$y.some(t=>t in e||t in n)}s(KI,"oldShape");function jI(e){return(e?.nodes??[]).some(n=>qI(n)&&KI(n))}s(jI,"needsEventTriggerStartMove");function eW(e){let n=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>vo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===gr))return{unmoved:{nodeId:n,reason:"outcomesNotStart"}};let i=Object.keys(vo(e.next)?e.next:{});if(!(i.length===1&&i[0]===gr))return{unmoved:{nodeId:n,reason:"nextNotStart"}};let o=vo(e.inputs)?{...e.inputs}:{};for(let l of $y){let d=o[l];if(vo(d)&&d.kind==="binding")return{unmoved:{nodeId:n,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of $y)delete a[l],delete o[l];return vo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(eW,"moveNode");function VI(e){let n=[],t=[],r=e.nodes.map(i=>{if(!qI(i)||!KI(i))return i;let o=eW(i);return"unmoved"in o?(t.push(o.unmoved),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(VI,"moveEventTriggerStart");function El(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(El,"isObject");var BI={waitlistOrder:"arrival"};function UI(e){return!El(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(El(e.inputs)?e.inputs:{}))}s(UI,"lacksPolicy");function nW(e){return(e?.nodes??[]).some(UI)}s(nW,"needsWaitlistPolicyMove");function Ry(e){return El(e)&&Jt.includes(e.waitlistOrder)}s(Ry,"isWaitlistPolicy");function tW(e){if(e===void 0)return{policy:BI,stated:!1};if(!El(e))return"malformed";let n=e.waitlistOrder;return n!==void 0&&!Jt.includes(n)?"malformed":{policy:{waitlistOrder:n??BI.waitlistOrder},stated:n!==void 0}}s(tW,"policyOfSelection");function GI(e,n,t={}){let r=[],i=[];if(!nW(e))return{graph:e,moved:r,refused:i};let o=tW(n),a=e.nodes.map(l=>{if(!UI(l))return l;let d=l,c=String(d.id),u=El(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(t,c)?t[c]:void 0,h,w;if(p!==void 0)h=p,w="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,w=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:w}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(GI,"moveWaitlistPolicyToInputs");function xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(xo,"isObject");var rW=[Vn,bo],iW=["inputSchema","parties","schemaDigest","parts"];function zI(e){return xo(e)&&e.type==="governedDocument"&&("resolver"in e||xo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s(zI,"oldShape");function WI(e){return(e?.nodes??[]).some(zI)}s(WI,"needsGeneratorInputMove");function oW(e){let n=xo(e.inputs)?{...e.inputs}:{},t={...e},r;if("resolver"in e){let i=e.resolver;if(!xo(i))return{unmoved:"resolverNotObject"};if(Vn in n)return{unmoved:"generatorInputExists"};if(typeof i.key!="string"||i.key.length===0)return{unmoved:"pinWithoutKey"};if(i.kind!=="generator"&&i.kind!=="package")return{unmoved:"pinWithoutKind"};if(i.revision!==void 0&&!(typeof i.revision=="number"&&Number.isInteger(i.revision)&&i.revision>0))return{unmoved:"pinRevisionInvalid"};if((xo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>xo(d)&&rW.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};n[Vn]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(iW.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(t.generatorStamp=l),r=i.cockpitFields,delete t.resolver}if(xo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(bo in n)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};n[bo]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}t.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};t.cockpitFields=r}return t.inputs=n,{node:t}}s(oW,"moveNode");function YI(e){let n=[],t=[],r=e.nodes.map(i=>{if(!zI(i))return i;let o=oW(i);return"unmoved"in o?(t.push({nodeId:String(i.id),reason:o.unmoved}),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(YI,"moveGeneratorPinsToInputs");var HI=/^\d{4}-\d{2}-\d{2}$/;function yr(e,n){return{de:e,en:n}}s(yr,"issue");function So(e){if(typeof e!="object"||e===null)return yr("keine Reduktion","not a reduction");let n=e;if(n.kind==="none")return Object.keys(n).length===1?null:yr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(n.kind!=="amount")return yr(`unbekannte Art ${JSON.stringify(n.kind)}`,`unknown kind ${JSON.stringify(n.kind)}`);let{amount:t,activeFrom:r,activeTo:i}=n;return typeof t!="number"||!Number.isFinite(t)||t<=0?yr("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((t*100).toFixed(6)))?typeof r!="string"||!HI.test(r)?yr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!HI.test(i)?yr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?yr("das Ende liegt vor dem Beginn","the end is before the start"):n.floorTotal!==void 0&&(typeof n.floorTotal!="number"||!Number.isSafeInteger(n.floorTotal)||n.floorTotal<0)?yr("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):n.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(n.pricePeriod))?yr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(n).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?yr("unbekannte Angaben","unknown details"):null:yr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(So,"reductionShapeIssue");function Pi(e){if(typeof e!="object"||e===null)return!1;let n=e;return typeof n.itemKey=="string"&&n.itemKey.length>0&&Array.isArray(n.grantKeys)&&n.grantKeys.every(t=>typeof t=="string"&&t.length>0)&&(n.reduction===void 0||So(n.reduction)===null&&n.reduction.kind==="amount")}s(Pi,"isPricedItemValue");var Ns=["freetext","recommendation","choice","pricedItem","record","reduction"],Ps=[...Ns,"appointment"];function QI(e){return typeof e=="string"&&Ps.includes(e)}s(QI,"isTaskResultKind");function Ci(e){return typeof e=="string"&&Ns.includes(e)}s(Ci,"isRecordedTaskResultKind");function Cs(e){return Ci(e.kind)}s(Cs,"isRecordedTaskResult");var Tf=["number","boolean","enum","text","person","assignment"];function Iy(e){return typeof e=="string"&&Tf.includes(e)}s(Iy,"isRecordFieldType");function ZI(e){return e==="number"||e==="boolean"||e==="enum"}s(ZI,"isSuggestibleFieldType");var Oy=["form","siblingRank"],$f=500;function sW(e){switch(e.type){case"number":case"boolean":case"enum":return e.type;case"text":return"string";case"person":return e.multiple===!0?"staffUserList":"staffUser";case"assignment":return"taskAssignment"}}s(sW,"recordFieldValueType");var Xr={freetext:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Freitext",en:"Free text"}},recommendation:{choiceValueType:"enum",valueType:null,textValueType:"string",label:{de:"Empfehlung",en:"Recommendation"}},choice:{choiceValueType:"enum",valueType:"enum",textValueType:"string",label:{de:"Auswahl",en:"Choice"}},pricedItem:{choiceValueType:"enum",valueType:"pricedItem",textValueType:"string",label:{de:"Preisposition",en:"Priced item"}},reduction:{choiceValueType:null,valueType:"reduction",textValueType:"string",label:{de:"Reduktion",en:"Reduction"}},record:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Erfassung",en:"Record"}},appointment:{choiceValueType:null,valueType:null,textValueType:null,label:{de:"Termin",en:"Appointment"}}};function XI(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(XI,"isProseResult");function Rf(e){return e.kind==="record"?(e.fields??[]).filter(n=>typeof n.writes=="string"&&n.writes.length>0&&Iy(n.type)).map(n=>({key:n.writes,valueType:sW(n),field:n})):aW(e)}s(Rf,"draftResultStoreWrites");function aW(e){let n=Xr[e.kind].valueType;return e.writes===void 0||n===null?[]:[{key:e.writes,valueType:n}]}s(aW,"singleStoreWrite");var JI="team:";function Ds(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(JI)){let n=e.slice(JI.length);return n.length===0?null:{kind:"team",groupKey:n}}return{kind:"channel",channelKey:e}}s(Ds,"parseTaskResultChat");var Ue={unknownKind:"[taskResult/unknownKind]",onApproval:"[taskResult/onApproval]",unknownField:"[taskResult/unknownField]",choiceOptions:"[taskResult/choiceOptions]",textRequiredOnFreetext:"[taskResult/textRequiredOnFreetext]",chatMissing:"[taskResult/chatMissing]",chatExternal:"[taskResult/chatExternal]",chatUnknownChannel:"[taskResult/chatUnknownChannel]",appointmentMissingTitle:"[taskResult/appointmentMissingTitle]",pricedItemMissingItem:"[taskResult/pricedItemMissingItem]",pricedItemUnknownItem:"[taskResult/pricedItemUnknownItem]",pricedItemNotInProgram:"[taskResult/pricedItemNotInProgram]",pricedItemOfferWithoutProgram:"[taskResult/pricedItemOfferWithoutProgram]",itemOnNonPricedItem:"[taskResult/itemOnNonPricedItem]",writesOnProse:"[taskResult/writesOnProse]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",recordText:"[taskResult/recordText]",recordPerson:"[taskResult/recordPerson]",recordAssignment:"[taskResult/recordAssignment]",reductionPrices:"[taskResult/reductionPrices]"};var lW=new Set(["if","else","in","true","false","null"]),dW=new Set(["==","!=","<=",">=","&&","||"]);function cW(e){return e>="0"&&e<="9"}s(cW,"isDigit");function uW(e){return/[a-zA-Z_$]/.test(e)}s(uW,"isIdentStart");function fW(e){return/[a-zA-Z0-9_.$]/.test(e)}s(fW,"isIdentCont");function pW(e){let n=[],t=0;for(;t<e.length;){let r=e.charAt(t);if(r===" "||r===" "||r===`
|
|
10979
10980
|
`||r==="\r"){t++;continue}if(r==="'"){let o=t+1,a="";for(;o<e.length&&e.charAt(o)!=="'";)e.charAt(o)==="\\"&&o+1<e.length?(a+=e.charAt(o+1),o+=2):(a+=e.charAt(o),o++);o>=e.length&&L(`Unterminated string at ${t}`),n.push({t:"str",v:a}),t=o+1;continue}if(cW(r)){let o=t;for(;o<e.length&&/[0-9.]/.test(e.charAt(o));)o++;n.push({t:"num",v:Number(e.slice(t,o))}),t=o;continue}if(uW(r)){let o=t;for(;o<e.length&&fW(e.charAt(o));)o++;let a=e.slice(t,o);lW.has(a)?n.push({t:"kw",v:a}):n.push({t:"ident",v:a}),t=o;continue}let i=e.slice(t,t+2);if(dW.has(i)){n.push({t:"op",v:i}),t+=2;continue}if("<>!".includes(r)){n.push({t:"op",v:r}),t++;continue}if("()[],".includes(r)){n.push({t:"punct",v:r}),t++;continue}L(`Unexpected char '${r}' at ${t}`)}return n}s(pW,"tokenise");var eO=1e4,nO=128;function Fs(e){e.depth++,e.depth>nO&&L(`Expression nesting too deep (> ${nO})`)}s(Fs,"enterDepth");function aO(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(aO,"peek");function Bn(e){let n=e.tokens[e.pos];return n||L(`Unexpected end at ${e.pos}`),e.pos++,n}s(Bn,"take");function Un(e,n,t){let r=aO(e);return!(!r||r.t!==n||t!==void 0&&r.v!==t)}s(Un,"match");function Ao(e,n,t){return Un(e,n,t)||L(`Expected ${n}${t?`:${t}`:""} at ${e.pos}`),Bn(e)}s(Ao,"expect");function ni(e){Fs(e);try{return Un(e,"kw","if")?mW(e):hW(e)}finally{e.depth--}}s(ni,"parseExpr");function mW(e){Ao(e,"kw","if"),Ao(e,"punct","(");let n=ni(e);Ao(e,"punct",")");let t=ni(e);Ao(e,"kw","else");let r=ni(e);return{kind:"if",cond:n,then:t,else:r}}s(mW,"parseIf");function hW(e){let n=tO(e),t=0;try{for(;Un(e,"op","||");){Bn(e),Fs(e),t++;let r=tO(e);n={kind:"binary",op:"||",left:n,right:r}}}finally{e.depth-=t}return n}s(hW,"parseLogicOr");function tO(e){let n=rO(e),t=0;try{for(;Un(e,"op","&&");){Bn(e),Fs(e),t++;let r=rO(e);n={kind:"binary",op:"&&",left:n,right:r}}}finally{e.depth-=t}return n}s(tO,"parseLogicAnd");function rO(e){let n=iO(e),t=0;try{for(;Un(e,"op","==")||Un(e,"op","!=");){let r=Bn(e).v;Fs(e),t++;let i=iO(e);n={kind:"binary",op:r,left:n,right:i}}}finally{e.depth-=t}return n}s(rO,"parseEquality");function iO(e){let n=Ny(e),t=0;try{for(;Un(e,"op","<")||Un(e,"op","<=")||Un(e,"op",">")||Un(e,"op",">=")||Un(e,"kw","in");){let r=Bn(e),i=r.t==="kw"?"in":r.v;Fs(e),t++;let o=Ny(e);n={kind:"binary",op:i,left:n,right:o}}}finally{e.depth-=t}return n}s(iO,"parseCompare");function Ny(e){if(Un(e,"op","!")){Bn(e),Fs(e);try{return{kind:"unary",op:"!",operand:Ny(e)}}finally{e.depth--}}return gW(e)}s(Ny,"parseUnary");function gW(e){let n=aO(e);if(n||L("Unexpected end"),n.t==="num")return Bn(e),{kind:"num",value:n.v};if(n.t==="str")return Bn(e),{kind:"str",value:n.v};if(n.t==="kw"&&n.v==="true")return Bn(e),{kind:"bool",value:!0};if(n.t==="kw"&&n.v==="false")return Bn(e),{kind:"bool",value:!1};if(n.t==="kw"&&n.v==="null")return Bn(e),{kind:"null"};if(n.t==="punct"&&n.v==="("){Bn(e);let t=ni(e);return Ao(e,"punct",")"),t}if(n.t==="punct"&&n.v==="["){Bn(e);let t=[];if(!Un(e,"punct","]"))for(t.push(ni(e));Un(e,"punct",",");)Bn(e),t.push(ni(e));return Ao(e,"punct","]"),{kind:"arr",items:t}}if(n.t==="ident"){let t=n.v;if(Bn(e),Un(e,"punct","(")){Bn(e);let r=[];if(!Un(e,"punct",")"))for(r.push(ni(e));Un(e,"punct",",");)Bn(e),r.push(ni(e));return Ao(e,"punct",")"),{kind:"call",name:t,args:r}}return{kind:"ident",path:t}}L(`Unexpected token at ${e.pos}`)}s(gW,"parsePrimary");function In(e){e.length>eO&&L(`Expression too long (${e.length} > ${eO})`);let n={tokens:pW(e),pos:0,depth:0},t=ni(n);return n.pos<n.tokens.length&&L(`Unexpected trailing token at ${n.pos}`),t}s(In,"parseExpression");var yW=new Map([["today",()=>new Date().toISOString().slice(0,10)],["years_between",(e,n)=>{if(typeof e!="string"||typeof n!="string")return null;let t=new Date(e),r=new Date(n);if(isNaN(t.getTime())||isNaN(r.getTime()))return null;let i=r.getFullYear()-t.getFullYear(),o=r.getMonth()-t.getMonth();return(o<0||o===0&&r.getDate()<t.getDate())&&i--,i}],["length",e=>typeof e=="string"||Array.isArray(e)?e.length:0]]);function yn(e,n){switch(e.kind){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"null":return null;case"ident":{let t=Object.hasOwn(n.values,e.path)?n.values[e.path]:void 0;return t===void 0?null:t}case"arr":return e.items.map(t=>yn(t,n));case"unary":{let t=yn(e.operand,n);return!Eo(t)}case"call":{let t=n.functions!==void 0&&Object.hasOwn(n.functions,e.name)?n.functions[e.name]:yW.get(e.name);t||L(`Unknown function '${e.name}'`);let r=e.args.map(i=>yn(i,n));return t(...r)}case"binary":return wW(e.op,e.left,e.right,n);case"if":return Eo(yn(e.cond,n))?yn(e.then,n):yn(e.else,n)}}s(yn,"evaluate");function wW(e,n,t,r){if(e==="&&"){let a=yn(n,r);return Eo(a)?Eo(yn(t,r)):!1}if(e==="||"){let a=yn(n,r);return Eo(a)?!0:Eo(yn(t,r))}let i=yn(n,r),o=yn(t,r);switch(e){case"==":return _y(i,o);case"!=":return!_y(i,o);case"<":{let[a,l]=If(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=If(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=If(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=If(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>_y(a,i)):!1}}s(wW,"evalBinary");function If(e,n){return[oO(e),oO(n)]}s(If,"orderedOperands");function oO(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"){if(e.trim()==="")return null;let n=Number(e);return Number.isFinite(n)?n:null}return null}s(oO,"numericOperand");function _y(e,n){return e===n?!0:e==null||n==null?!1:typeof e=="number"&&typeof n=="string"?e===Number(n):typeof e=="string"&&typeof n=="number"?Number(e)===n:!1}s(_y,"looseEq");function Eo(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(Eo,"truthy");function On(e){let n=new Set;return ei(e,n),[...n]}s(On,"dependencies");function ei(e,n){switch(e.kind){case"ident":n.add(e.path);return;case"call":e.args.forEach(t=>ei(t,n));return;case"arr":e.items.forEach(t=>ei(t,n));return;case"unary":ei(e.operand,n);return;case"binary":ei(e.left,n),ei(e.right,n);return;case"if":ei(e.cond,n),ei(e.then,n),ei(e.else,n);return;default:return}}s(ei,"walk");var sO=new Map;function ti(e){let n=sO.get(e);return n||(n=In(e),sO.set(e,n)),n}s(ti,"parseCached");function kW(e,n){return yn(ti(e),n)}s(kW,"evalExpression");function lO(e,n){return Eo(kW(e,n))}s(lO,"evalBoolean");function dO(e,n){n!==null&&(typeof n=="object"||typeof n=="function")&&Object.hasOwn(n,"exports")&&L(`[workflow/registry] node type "${e}": custom spec.exports is unsupported; use artifact-slot exports.`)}s(dO,"assertNoCustomNodeExports");var Py=null;function cO(e){for(let[n,t]of Object.entries(e))dO(n,t);Py=e}s(cO,"setSpecs");function uO(){return Py||L("[workflow/registry] Specs not initialised. Import convex/model/admission/specs before calling specFor()."),Py}s(uO,"requireSpecs");function He(e){let n=uO(),t=n[e.type];return t===void 0&&se("INVALID",{de:`[workflow/registry] Unbekannter Knotentyp "${String(e.type)}" (Knoten "${String(e.id)}"). Registrierte Typen: ${Object.keys(n).sort().join(", ")}.`,en:`[workflow/registry] Unknown node type "${String(e.type)}" (node "${String(e.id)}"). Registered types: ${Object.keys(n).sort().join(", ")}.`}),t}s(He,"specFor");function fO(){return Object.keys(uO()).sort()}s(fO,"registeredNodeTypes");var pO=gf.filter(e=>Qr[e].cohortBound!==!0);function Cy(e){return Ht(e)&&Qr[e].cohortBound!==!0}s(Cy,"isEnvAddressLeaf");function Dy(e){return ko(e).type}s(Dy,"envType");function Fy(e){return ko(e).label}s(Fy,"envLabel");function Ly(e){if(e.scope==="env"||e.path===void 0)return e;switch(e.scope){case"node":return{scope:"node",owner:e.owner,key:e.key};case"task":return{scope:"task",owner:e.owner,key:e.key}}}s(Ly,"addressBase");function wr(e){return e.scope==="node"&&e.key===nt&&e.path===void 0}s(wr,"isInstanceAddress");function un(e){return xe(e)&&e.scope==="node"&&e.key===nt&&e.path!==void 0}s(un,"isFormFieldAddress");function mO(e){return un(e)?{owner:e.owner,path:e.path}:null}s(mO,"formFieldOf");function bW(e){return On(ti(e)).map(n=>{if(!n.startsWith("$"))return{identifier:n,address:null,reason:"bareIdentifier"};let t=Hr(n);return t===null?{identifier:n,address:null,reason:"shape"}:{identifier:n,address:t}})}s(bW,"expressionAddresses");var nt="admission",My="document",_f="contract",Nf="contracts",hO="payment",qy=new Set(["adoptForm","setFlagTarget","form","familyRequestFrom"]);var lt={id:"identity",type:"identity",label:"display",sublabel:"display",library:"display",outcomes:"control",outputLabels:"display",inputs:"input",next:"control",tasks:"config",assign:"reference",actionTeams:"reference",optionalActions:"config",artifacts:"config",notifications:"config"},rue={join:{...lt},end:{...lt},eventTrigger:{...lt},form:{...lt,adoptForm:"address",formExports:"stamp"},roleAssign:{...lt},setFlag:{...lt},if:{...lt,condition:"address"},countersign:{...lt,contract:"address",titles:"display",signing:"config"},engagePush:{...lt,engage:"tenantRef",form:"address",contract:"address",payment:"address"},decision:{...lt,commentRequired:"config",decisionAsTask:"config",reads:"address",view:"config",requiresOneOf:"config"},review:{...lt,form:"address",commentRequired:"config",decisionAsTask:"config"},waitlist:{...lt},completenessCheck:{...lt,requires:"address",deadline:"config"},collectPayment:{...lt},governedDocument:{...lt,production:"config",form:"address",generatorStamp:"stamp",templateStamp:"stamp",approval:"config",confirmBeforeIssue:"config",confirmContractTerms:"config",contractTermsQuestionText:"display",responseStrategy:"config",titles:"display",responseLabels:"display",reads:"address"}};function Di(e){return Array.isArray(e)?e:[]}s(Di,"listOf");function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(Pt,"record");function gO(e){switch(e.type){case"countersign":return["contract"];case"engagePush":return["form","contract","payment"];case"governedDocument":return e.production==="resolver"?["form"]:[];case"review":return["form"];default:return[]}}s(gO,"dataSourceFieldsOf");function yO(e){return e.type==="review"?[]:e.type==="engagePush"?["form"]:gO(e)}s(yO,"requiredDataSourceFields");var vW={setFlag:{target:"setFlagTarget"}};function Tl(e,n={}){let t=[],r=e,i=`nodes.${e.id}`,o=s((d,c,u,p={})=>{t.push({kind:d,at:c,nodeId:e.id,value:u,judgedTogether:null,...p})},"field"),a=new Map(n.slotTypes===!1?[]:(He(e).inputs?.(e)??[]).map(d=>[d.id,d.type])),l=vW[e.type]??{};for(let[d,c]of Object.entries(Pt(r.inputs)??{})){let u=Pt(c);if(u?.kind!=="binding")continue;let p="address"in u?u.address:u.path,h=l[d];if(h!==void 0){o(h,`${i}.inputs.${d}`,p);continue}let w=a.get(d);o("binding",`${i}.inputs.${d}`,p,w!==void 0?{expectedType:w}:{})}for(let[d,c]of Di(r.reads).entries())o("nodeReads",`${i}.reads.${d}`,c,{judgedTogether:`${i}.reads`});for(let[d,c]of Di(r.requires).entries())o("requires",`${i}.requires.${d}`,c,{judgedTogether:`${i}.requires`});e.type==="form"&&r.adoptForm!==void 0&&o("adoptForm",`${i}.adoptForm`,r.adoptForm);for(let d of gO(e))r[d]!==void 0&&o(d,`${i}.${d}`,r[d]);e.type==="if"&&r.condition!==void 0&&o("condition",`${i}.condition`,r.condition);for(let[d,c]of Di(r.tasks).entries())t.push(...wO(e.id,c,d));for(let[d,c]of Di(r.optionalActions).entries()){let u=Pt(c);u?.when!==void 0&&o("optionalActionWhen",xW(e.id,typeof u.key=="string"?u.key:String(d)),u.when)}return t}s(Tl,"nodeAddressFields");function xW(e,n){return`nodes.${e}.optionalActions.${n}.when`}s(xW,"optionalActionWhenPath");function wO(e,n,t){let r=Pt(n);if(r===null)return[];let i=[],o=typeof r.key=="string"?r.key:String(t),a=`nodes.${e}.tasks.${o}`,l=s((p,h,w,k={})=>{i.push({kind:p,at:h,nodeId:e,taskKey:o,value:w,judgedTogether:null,...k})},"field"),d=`${a}.evidence`;r.when!==void 0&&l("taskWhen",`${a}.when`,r.when,{expectedType:"boolean",judgedTogether:d});for(let[p,h]of Di(r.reads).entries())l("taskReads",`${a}.reads.${p}`,h,{judgedTogether:d});for(let[p,h]of Di(r.documents).entries()){let w=Pt(h);w===null||w.kind!=="field"||l("taskDocument",`${a}.documents.${p}`,w.address)}let c=Pt(r.familyRequest);if(c!==null){for(let[p,h]of Di(c.fields).entries())l("familyRequestFields",`${a}.familyRequest.fields.${p}`,h,{judgedTogether:`${a}.familyRequest.fields`});c.from!==void 0&&l("familyRequestFrom",`${a}.familyRequest.from`,c.from)}let u=Pt(r.result);if(u?.kind==="record")for(let[p,h]of Di(u.fields).entries()){let w=Pt(Pt(h)?.suggest);if(w?.kind!=="form")continue;let k=Pt(h)?.type;l("suggest",`${a}.result.fields.${p}.suggest`,"address"in w?w.address:w.key,typeof k=="string"?{expectedType:k}:{})}return i}s(wO,"taskAddressFields");function Ls(e){return Ky(e)?(jy(e.value)??[]).flatMap(n=>n.address===null?[]:[n.address]):xe(e.value)?[e.value]:[]}s(Ls,"addressesInField");function Ky(e){return e.kind==="condition"||e.kind==="optionalActionWhen"}s(Ky,"isExpressionField");function jy(e){if(typeof e!="string"||e.trim().length===0)return null;try{ti(e)}catch{return null}return bW(e)}s(jy,"conditionAddresses");function bt(e){return e.type==="form"&&e.adoptForm!==void 0&&e.adoptForm!==!1}s(bt,"adoptsForm");function kO(e){if(e.type!=="form"||bt({type:e.type,adoptForm:e.adoptForm}))return;let n=e.inputs?.smartForm;return n?.kind==="literal"&&typeof n.value=="string"&&n.value!==""?n.value:void 0}s(kO,"createdSmartFormSlug");function SW(e,n){return e.type!=="governedDocument"||e.production!=="resolver"||n!==My?n:e.generatorStamp?.parts!==void 0?Nf:_f}s(SW,"addressKeyOfPort");function bO(e){let n=e.result;return n===void 0||!Cs(n)?[]:Rf(n).map(t=>t.key)}s(bO,"storeWritesOf");function Vy(e,n){return(Array.isArray(e.processStore)?e.processStore:[]).find(t=>t.key===n)}s(Vy,"declaredKey");function Cr(e,n){let t=[];if(!bt(n))for(let r of He(n).outputs?.(n)??[])t.push({address:{scope:"node",owner:n.id,key:SW(n,r.name)},type:r.type,...r.label!==void 0?{label:r.label}:{},nodeId:n.id,nodePort:r});for(let r of Array.isArray(n.tasks)?n.tasks:[])for(let i of bO(r)){let o=Vy(e,i);t.push({address:{scope:"task",owner:r.key,key:i},type:o?.type??"unknown",...o!==void 0?{label:o.label}:{},nodeId:n.id})}return t}s(Cr,"producedAddresses");function vO(e,n,t){for(let r of e.nodes)for(let i of Array.isArray(r.tasks)?r.tasks:[])if(i.key===n&&bO(i).includes(t))return{nodeId:r.id,template:i};return null}s(vO,"taskWriter");function ri(e,n,t){return vO(e,n,t)?.nodeId??null}s(ri,"taskOwnerNode");function AW(e){return Tl(e,{slotTypes:!1}).flatMap(n=>Ls(n).map(t=>({address:t,field:n})))}s(AW,"writtenAddressesOf");function To(e,n){let t=[],r=new Set,i=s((a,l,d,c)=>{let u=`${pe(a)}|${l}|${d.at}|${c===void 0?"":pe(c)}`;r.has(u)||(r.add(u),t.push({address:a,origin:l,field:d,...c!==void 0?{via:c}:{}}))},"push"),o=s((a,l)=>{if(a.scope!=="task")return;let d=vO(e,a.owner,a.key);if(d!==null){for(let c of wO(d.nodeId,d.template))if(!(c.kind!=="taskWhen"&&c.kind!=="taskReads"))for(let u of Ls(c))i(u,"evidence",l,a)}},"carried");for(let{address:a,field:l}of AW(n))i(a,"written",l),o(a,l);return t}s(To,"addressReadsOf");function By(e,n){switch(n.scope){case"env":return Ht(n.key)?Dy(n.key):Os(e,n.key)?.type;case"task":return n.path!==void 0||ri(e,n.owner,n.key)===null?void 0:Vy(e,n.key)?.type;case"node":{let t=e.nodes.find(i=>i.id===n.owner);if(t===void 0)return;let r=Cr(e,t).find(i=>i.address.scope==="node"&&i.address.key===n.key);return r===void 0?void 0:n.path===void 0?r.type:r.nodePort?.schema?.find(i=>i.key===n.path)?.type}}}s(By,"addressType");function Of(e,n){let t=Pt(e)?.[n];return typeof t=="string"&&t.length>0?t:void 0}s(Of,"labelText");function _e(e,n,t){let r=e.nodes.find(i=>i.id===n);return Of(r?.label,t)??n}s(_e,"nodeDisplayName");function $o(e,n,t){for(let r of e.nodes){let i=(Array.isArray(r.tasks)?r.tasks:[]).find(o=>o.key===n);if(i!==void 0)return Of(i.title,t)??n}return n}s($o,"taskDisplayName");function je(e,n,t){let r=[];switch(n.scope){case"env":r.push(Ht(n.key)?Fy(n.key)[t]:Os(e,n.key)?.label[t]??n.key);break;case"task":r.push($o(e,n.owner,t),Of(Vy(e,n.key)?.label,t)??n.key);break;case"node":{r.push(_e(e,n.owner,t));let i=e.nodes.find(a=>a.id===n.owner),o=i===void 0?void 0:Cr(e,i).find(a=>a.address.scope==="node"&&a.address.key===n.key);r.push(Of(o?.label,t)??n.key);break}}return n.scope!=="env"&&n.path!==void 0&&r.push(n.path),`${r.join(" \u203A ")} (${pe(n)})`}s(je,"displayAddress");var $l=["beneficiary","signers"];function Rl(e){let n=[];for(let[t,r]of Object.entries(Pt(e.inputs)??{})){let i=Pt(r);i?.kind==="binding"&&xe(i.address)&&n.push({slot:t,address:i.address})}return n}s(Rl,"bindingAddresses");function xO(e,n){return Rl(e).find(t=>t.slot===n)?.address??null}s(xO,"bindingAddressAt");function SO(e,n){let t=s(i=>i.scope==="node"&&i.owner===n||i.scope==="task"&&ri(e,i.owner,i.key)===n,"names");return e.nodes.filter(i=>i.id!==n).flatMap(i=>Tl(i,{slotTypes:!1})).flatMap(i=>Ls(i).filter(t).map(o=>({at:i.at,nodeId:i.nodeId,address:o})))}s(SO,"addressesNaming");var _n={target:"target",flagKey:"flagKey",value:"value"};function EW(e){return xO(e,_n.target)}s(EW,"setFlagTarget");function AO(e){let n=EW(e);return n!==null&&wr(n)?n.owner:null}s(AO,"setFlagTargetOwner");function Pf(e){let n=e.inputs?.[_n.flagKey];return n?.kind==="literal"&&typeof n.value=="string"&&n.value.length>0?n.value:null}s(Pf,"setFlagKey");function EO(e){let n=e.inputs?.[_n.value];if(n===void 0||n.kind==="unset")return!0;if(n.kind==="literal"&&typeof n.value=="boolean")return n.value;L(`[setFlag/valueType] setFlag node "${String(e.id)}": \`${_n.value}\` is no yes/no literal \u2014 publish refuses that`)}s(EO,"setFlagValue");function TO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(TO,"isObject");var $O=["target","flagKey","value"];function RO(e){return TO(e)&&e.type==="setFlag"&&$O.some(n=>n in e)}s(RO,"oldShape");function IO(e){return(e?.nodes??[]).some(RO)}s(IO,"needsSetFlagInputMove");function TW(e){let n=TO(e.inputs)?{...e.inputs}:{};if($O.some(a=>a in e&&_n[a]in n))return{unmoved:"inputExists"};if("target"in e&&!xe(e.target))return{unmoved:"targetNotAddress"};if("flagKey"in e&&typeof e.flagKey!="string")return{unmoved:"flagKeyNotString"};if("value"in e&&typeof e.value!="boolean")return{unmoved:"valueNotBoolean"};let{target:t,flagKey:r,value:i,...o}=e;return t!==void 0&&(n[_n.target]={kind:"binding",address:t}),typeof r=="string"&&r.length>0&&(n[_n.flagKey]={kind:"literal",value:r}),i!==void 0&&(n[_n.value]={kind:"literal",value:i}),{node:{...o,inputs:n}}}s(TW,"moveNode");function OO(e){let n=[],t=[],r=e.nodes.map(i=>{if(!RO(i))return i;let o=TW(i);return"unmoved"in o?(t.push({nodeId:String(i.id),reason:o.unmoved}),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(OO,"moveSetFlagConfigToInputs");function _O(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(_O,"isObject");var Uy={countersign:{dueInDays:"number"},decision:{allowSkipInTest:"boolean"},completenessCheck:{guestRole:"string"},governedDocument:{responseDueInDays:"number"}},Gy={review:["allowSkipInTest"]};function NO(e){return Uy[String(e)]??{}}s(NO,"movesOf");function PO(e){return Gy[String(e)]??[]}s(PO,"deadOf");function CO(e){return _O(e)&&[...Object.keys(NO(e.type)),...PO(e.type)].some(n=>n in e)}s(CO,"oldShape");function DO(e){return(e?.nodes??[]).some(CO)}s(DO,"needsScalarInputMove");function $W(e,n){return n==="number"?typeof e=="number"&&Number.isInteger(e)&&e>=1:typeof e===n}s($W,"wellTyped");function RW(e){let n=_O(e.inputs)?{...e.inputs}:{},t={...e};for(let[r,i]of Object.entries(NO(e.type))){if(!(r in e))continue;let o=e[r];if(r in n)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!(i==="string"&&o==="")&&!$W(o,i))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueWrongType"}};o!==""&&(n[r]={kind:"literal",value:o}),delete t[r]}for(let r of PO(e.type))delete t[r];return t.inputs=n,{node:t}}s(RW,"moveNode");function FO(e){let n=[],t=[],r=e.nodes.map(i=>{if(!CO(i))return i;let o=RW(i);return"unmoved"in o?(t.push(o.unmoved),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(FO,"moveScalarConfigToInputs");var Ms={team:{label:{de:"Team",en:"Team"},optionSource:"tenantTeams",existence:{check:"generic",catalog:"teamKeys"}},roleKey:{label:{de:"Rolle",en:"Role"},optionSource:"tenantRoles",existence:{check:"node",codes:["roleAssign/unknownRoleKey","completenessCheck/unknownRole"]}},article:{label:{de:"Artikel",en:"Article"},optionSource:"programArticles",existence:{check:"node",codes:["collectPayment/unknownArticle"]}},legalEntity:{label:{de:"Tr\xE4ger",en:"Legal entity"},optionSource:"tenantTraeger",existence:{check:"node",codes:["governedDocument/unknownTraeger","collectPayment/unknownPayee"]}},contractGenerator:{label:{de:"Vertragsgenerator",en:"Contract generator"},optionSource:"tenantGenerators",existence:{check:"publish",by:"admittedGeneratorByKey"}},documentTemplate:{label:{de:"Dokumentvorlage",en:"Document template"},optionSource:"tenantDocumentTemplates",existence:{check:"publish",by:"governedDocument/unknownTemplate"}},smartForm:{label:{de:"Formular",en:"Form"},optionSource:"offerSmartForms",existence:{check:"publish",by:"form/unknownSmartForm"}},unit:{label:{de:"Einrichtung",en:"Unit"},optionSource:"tenantUnits",existence:{check:"generic",catalog:"unitKeys"}},formFlag:{label:{de:"Merkmal im Formular",en:"Flag in the form"},optionSource:"targetFormFlags",existence:{check:"node",codes:["setFlag/unknownFlag"]}}};function Cf(e){return typeof e=="string"&&Object.hasOwn(Ms,e)}s(Cf,"isResourceType");var wue=Object.keys(Ms).filter(e=>Ms[e].existence.check==="generic");function LO(e){if(typeof e!="object"||e===null)return!1;let n=e;return typeof n.groupKey=="string"&&n.groupKey.length>0&&Array.isArray(n.grantKeys)&&n.grantKeys.every(t=>typeof t=="string"&&t.length>0)&&(n.reduction===void 0||So(n.reduction)===null&&n.reduction.kind==="amount")&&Object.keys(n).every(t=>t==="groupKey"||t==="grantKeys"||t==="reduction")}s(LO,"isPricedGroupValue");var zy=["street","hausnr","plz","ort","land"];function MO(e){return zy.includes(e)}s(MO,"isAddressPart");var IW=["municipality","municipalityKey","district","districtKey"],Wy=[...zy,...IW],Yy={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",consent:"boolean",enum:"option",address:"composite",docRef:"file",party:"edge",personRef:"edge",personList:"edge",roleKey:"roleKey",pricedItem:"pricedItem",pricedGroup:"pricedGroup",reduction:"reduction",article:"article",legalEntity:"legalEntity",contractGenerator:"contractGenerator",documentTemplate:"documentTemplate",localizedText:"localizedText",staffUser:"staffUser",staffUserList:"staffUser",taskAssignment:"taskAssignment"},qs=Object.keys(Yy);function Fi(e){return typeof e=="string"&&e in Yy}s(Fi,"isValueType");function vt(e){return e===void 0?void 0:Yy[e]}s(vt,"dataTypeOf");function Df(e,n){let t=vt(e),r=vt(n);return t!==void 0&&t===r}s(Df,"valueTypesCompatible");function Ro(e){return e===null?"null is not a text in both languages":Il(e,{type:"localizedText"})}s(Ro,"completeLocalizedTextIssue");function Il(e,n){if(Cf(n.type)&&!Fi(n.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${n.type} key`;let t=vt(n.type),r=JSON.stringify(e),i=`slot type "${n.type}" takes a binding, not a literal`;if(t===void 0||t==="composite"||t==="file"||t==="edge"||t==="staffUser"||t==="taskAssignment")return i;if(e===null)return null;switch(t){case"text":return typeof e=="string"?null:`${r} is not a text (slot type "${n.type}")`;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?null:`${r} is not a date YYYY-MM-DD`;case"number":return typeof e=="number"&&Number.isFinite(e)?null:`${r} is not a number`;case"boolean":return typeof e=="boolean"?null:`${r} is not true/false`;case"option":{if(typeof e!="string")return`${r} is not an option value`;let o=(n.enumOptions??[]).map(a=>a.value);return o.length===0||o.includes(e)?null:`${r} is not one of the options ${o.join(", ")}`}case"pricedItem":{let o=e;return typeof o=="object"&&typeof o.itemKey=="string"&&o.itemKey.length>0&&Array.isArray(o.grantKeys)&&o.grantKeys.every(a=>typeof a=="string")?null:`${r} is not a priced item {"itemKey":\u2026,"grantKeys":[\u2026]}`}case"pricedGroup":return LO(e)?null:`${r} is not a priced group {"groupKey":\u2026,"grantKeys":[\u2026]}`;case"article":return typeof e=="string"&&e.length>0?null:`${r} is not an article key`;case"legalEntity":return typeof e=="string"&&e.length>0?null:`${r} is not a legal entity key`;case"contractGenerator":return Sl(e)?null:`${r} is not a contract generator {"kind":"generator"|"package","key":\u2026,"revision"?:n}`;case"documentTemplate":return typeof e=="string"&&e.length>0?null:`${r} is not a document template key`;case"roleKey":return typeof e=="string"&&e.length>0?null:`${r} is not a role key`;case"localizedText":{let o=e,a=s(l=>typeof l=="string"&&l.trim().length>0,"filled");return typeof o=="object"&&Object.keys(o).sort().join(",")==="de,en"&&a(o.de)&&a(o.en)?null:`${r} is not a text in both languages {"de":\u2026,"en":\u2026}`}case"reduction":{let o=So(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(Il,"literalTypeIssue");function qO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(qO,"isObject");var OW={collectPayment:{reason:"reason"}},_W={governedDocument:["mockAutoProduce"]},KO={collectPayment:{reason:{de:"`reason` gibt es als Knoteneigenschaft nicht mehr \u2014 der Hinweis f\xFCr die Familie ist der Eingang `inputs.reason` (ein fester Text auf Deutsch und Englisch im Parameter-Bereich).",en:"`reason` no longer exists as a node property \u2014 the note for the family is the input `inputs.reason` (a fixed text in German and English among the parameters)."}},governedDocument:{template:{de:"`template` gibt es am Knoten nicht mehr \u2014 die Parameter geh\xF6ren der Vorlage (ihr Datensatz, `plexus-cli catalog` documentTemplates[].parameters) und werden beim Speichern und Ver\xF6ffentlichen als `templateStamp` \xFCbernommen.",en:"`template` no longer exists on the node \u2014 the parameters belong to the template (its record, `plexus-cli catalog` documentTemplates[].parameters) and are stamped as `templateStamp` on save and publish."},cockpitFields:{de:'`cockpitFields` gibt es nicht mehr \u2014 ein Parameter, der im Cockpit erg\xE4nzt wird, ist sein Eingang `{ kind: "cockpit" }` (im Parameter-Bereich \u201Eim Cockpit erg\xE4nzen").',en:'`cockpitFields` no longer exists \u2014 a parameter completed in the cockpit is its input `{ kind: "cockpit" }` ("complete in the cockpit" among the parameters).'},mockAutoProduce:{de:"`mockAutoProduce` gibt es nicht mehr \u2014 das Muster-Dokument, das ein Upload-Knoten beim Eintritt selbst einstellte, ist entfernt; das Dokument kommt aus einem Upload.",en:"`mockAutoProduce` no longer exists \u2014 the sample document an upload node put on its slot by itself on entry is removed; the document comes from an upload."}}};function Hy(e){return OW[String(e)]??{}}s(Hy,"movesOf");function jO(e){return _W[String(e)]??[]}s(jO,"deadOf");function VO(e){return qO(e)&&[...Object.keys(Hy(e.type)),...jO(e.type)].some(n=>n in e)}s(VO,"oldShape");function BO(e){return(e?.nodes??[]).some(VO)}s(BO,"needsNodeConfigInputMove");function NW(e){return Ro(e)===null}s(NW,"isCompleteText");function PW(e){let n=qO(e.inputs)?{...e.inputs}:{},t={...e};for(let[r,i]of Object.entries(Hy(e.type)))if(r in e){if(i in n)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!NW(e[r]))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueNotLocalized"}};n[i]={kind:"literal",value:e[r]},delete t[r]}for(let r of jO(e.type))delete t[r];return Object.keys(Hy(e.type)).some(r=>r in e)&&(t.inputs=n),{node:t}}s(PW,"moveNode");function UO(e){let n=[],t=[],r=e.nodes.map(i=>{if(!VO(i))return i;let o=PW(i);return"unmoved"in o?(t.push(o.unmoved),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(UO,"moveNodeConfigToInputs");var Ol="collectPayment",Ks=["online","manual"];function Ff(e){return Ks.includes(e)}s(Ff,"isCollectPaymentMode");var Io="paid",Jy="skipPayment",Qy="confirmPayment",Li="article",tt="mode",Mi="reason",Qt="payee",Zy=["one_time"];function Lf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Lf,"isObject");function GO(e){if(!Lf(e)||e.type!==Ol)return!1;let n=Lf(e.inputs)?e.inputs:{},t=n[tt];return!Lf(t)||t.kind!=="literal"||t.value!=="online"?!1:!(Qt in n)}s(GO,"isOnlinePaymentWithoutPayee");function zO(e){return(e?.nodes??[]).some(GO)}s(zO,"needsPayee");function WO(e,n={}){let t=[],r=[],i=e.nodes.map(o=>{if(!GO(o))return o;let a=String(o.id),l=Object.hasOwn(n,a)?n[a]:void 0;if(l===void 0||l==="")return r.push(a),o;t.push({nodeId:a,payee:l});let d=Lf(o.inputs)?o.inputs:{};return{...o,inputs:{...d,[Qt]:{kind:"literal",value:l}}}});return t.length===0?{graph:e,set:t,refused:r}:{graph:{...e,nodes:i},set:t,refused:r}}s(WO,"setPayeeOnOnlinePayments");var YO="settlement",CW={online:"online",separate:"manual"};function Xy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Xy,"isObject");function HO(e){return Xy(e)&&e.type===Ol&&Xy(e.inputs)&&YO in e.inputs}s(HO,"carriesSettlement");function JO(e){return(e?.nodes??[]).some(HO)}s(JO,"needsPaymentModeRename");function QO(e){let n=[],t=[],r=e.nodes.map(i=>{if(!HO(i))return i;let o=String(i.id),{[YO]:a,...l}=i.inputs;if(tt in l)return t.push({nodeId:o,reason:"bothCells"}),i;let d=Xy(a)&&a.kind==="literal"&&typeof a.value=="string"?CW[a.value]:void 0;return d===void 0?(t.push({nodeId:o,reason:"unknownValue"}),i):(n.push(o),{...i,inputs:{...l,[tt]:{...a,value:d}}})});return n.length===0?{graph:e,moved:n,refused:t}:{graph:{...e,nodes:r},moved:n,refused:t}}s(QO,"renameSettlementToMode");var XO="formView";function Mf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Mf,"isObject");function ew(e){return Array.isArray(e.tasks)?e.tasks:[]}s(ew,"tasksOf");function _l(e){return Mf(e)&&XO in e}s(_l,"carriesFormView");function e_(e){return(e?.nodes??[]).some(n=>_l(n)||Mf(n)&&ew(n).some(_l))}s(e_,"needsFormViewMove");function ZO(e){let{[XO]:n,...t}=e;return"view"in t?"bothFields":!Mf(n)||typeof n.form!="string"||typeof n.key!="string"?"malformed":{...t,view:{kind:"form",form:n.form,view:n.key}}}s(ZO,"moved");function n_(e){let n=[],t=[],r=e.nodes.map(i=>{if(!Mf(i))return i;let o=String(i.id),a=i;if(_l(a)){let l=ZO(a);typeof l=="string"?t.push({nodeId:o,reason:l}):(a=l,n.push(o))}return ew(a).some(_l)&&(a={...a,tasks:ew(a).map(l=>{if(!_l(l))return l;let d=String(l.key),c=ZO(l);return typeof c=="string"?(t.push({nodeId:o,taskKey:d,reason:c}),l):(n.push(`${o}.${d}`),c)})}),a});return n.length===0?{graph:e,moved:n,refused:t}:{graph:{...e,nodes:r},moved:n,refused:t}}s(n_,"moveFormViewToView");function Dr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Dr,"isObject");function nw(e){return Array.isArray(e.tasks)?e.tasks:[]}s(nw,"tasksOf");function Nl(e){return Dr(e)&&Array.isArray(e.documents)?e.documents:[]}s(Nl,"documentsOf");function Pl(e){return Dr(e)&&e.kind==="document"}s(Pl,"isDocumentRef");function t_(e){return(e?.nodes??[]).some(n=>Dr(n)&&nw(n).some(t=>Nl(t).some(Pl)))}s(t_,"needsDocumentRefMove");function DW(e,n){let t=n.address;if(!Dr(t)||t.scope!=="node"||typeof t.owner!="string"||t.path!==void 0||t.key!=="document"&&t.key!=="contract"&&t.key!=="contracts")return null;let r=e.find(a=>Dr(a)&&a.id===t.owner),i=Dr(r)&&Array.isArray(r.artifacts)?r.artifacts:[];if(i.length!==1)return null;let o=Dr(i[0])?i[0].key:void 0;return typeof o=="string"&&o.length>0?o:null}s(DW,"slotOf");function r_(e){let n=[],t=[],r=e.nodes.map(i=>{if(!Dr(i)||!nw(i).some(a=>Nl(a).some(Pl)))return i;let o=String(i.id);return{...i,tasks:nw(i).map(a=>{if(!Dr(a)||!Nl(a).some(Pl))return a;let l=String(a.key),d=Nl(a).map(p=>Pl(p)?DW(e.nodes,p):void 0);if(d.includes(null))return t.push({nodeId:o,taskKey:l,reason:"noSlot"}),a;let c=new Set,u=Nl(a).flatMap((p,h)=>{let w=Pl(p)?{kind:"artifact",key:d[h]}:p;if(!Dr(w)||w.kind!=="artifact")return[w];let k=String(w.key);return c.has(k)?[]:(c.add(k),[w])});return n.push(`${o}.${l}`),{...a,documents:u}})}});return n.length===0?{graph:e,moved:n,refused:t}:{graph:{...e,nodes:r},moved:n,refused:t}}s(r_,"moveDocumentRefsToArtifact");function qf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(qf,"isObject");function tw(e){return qf(e)&&qf(e.assign)&&"userId"in e.assign}s(tw,"namesUser");function Kf(e){return(e?.nodes??[]).flatMap(n=>qf(n)&&Array.isArray(n.tasks)?n.tasks.filter(tw).map(t=>({nodeId:String(n.id),taskKey:String(t.key),hasTeam:typeof t.assign.group=="string"&&t.assign.group.length>0})):[])}s(Kf,"taskUserAssignments");function i_(e){let n=Kf(e);if(n.length===0)return{graph:e,dropped:n};let t=e.nodes.map(r=>{if(!qf(r)||!Array.isArray(r.tasks)||!r.tasks.some(tw))return r;let i=r.tasks.map(o=>{if(!tw(o))return o;let{userId:a,...l}=o.assign,{assign:d,...c}=o;return Object.keys(l).length===0?c:{...c,assign:l}});return{...r,tasks:i}});return{graph:{...e,nodes:t},dropped:n}}s(i_,"dropTaskAssignUserIds");var js={"assign{}":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der Knoten-Aufgabe",en:"team of the node task"},consequence:{de:"beim Betreten des Knotens entsteht die Aufgabe f\xFCr niemanden",en:"entering the node creates the task for nobody"}},"actionTeams{}":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Knoten-Aktion ausf\xFChren darf",en:"team that may perform the node action"},consequence:{de:"au\xDFer der zust\xE4ndigen Person darf niemand die Aktion ausf\xFChren",en:"nobody but the responsible person may perform the action"}},"tasks[].assign.group":{kind:"team",codec:"key",involves:!0,required:!0,what:{de:"Team der Aufgabe",en:"team of the task"},consequence:{de:"die Aufgabe kann nicht angelegt werden, und der Prozess bleibt stehen",en:"the task cannot be created and the process stops"}},"tasks[].params.revisionGroup":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der \xDCberarbeitung",en:"revision team"},consequence:{de:"eine Ablehnung findet niemanden, der \xFCberarbeitet",en:"a rejection finds nobody to revise"}},"tasks[].result.chat":{kind:"team",codec:"chatTarget",involves:!1,required:!1,what:{de:"Chat des Ergebnisses",en:"chat of the result"},consequence:{de:"das Ergebnis l\xE4sst sich nicht im Chat ablegen",en:"the result cannot be posted to the chat"}},"tasks[].result.primaryHostTeams":{kind:"team",codec:"key",involves:!1,required:!1,list:!0,what:{de:"Team oben in der Gastgeber-Auswahl",en:"team listed first in the host picker"},consequence:{de:"die Gastgeber-Auswahl kann das Team nicht oben zeigen",en:"the host picker cannot list the team first"}},"optionalActions[].trigger":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Aktion ausl\xF6sen darf",en:"team that may trigger the action"},consequence:{de:"niemand au\xDFer der Prozessverantwortung kann die Aktion ausl\xF6sen",en:"nobody but the process owner can trigger the action"}}},rw=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function iw(e,n){if(typeof n!="string"||n.length===0)return null;if(e==="key")return n;let t=Ds(n);return t?.kind==="team"?t.groupKey:null}s(iw,"decodeKey");var o_={"assign{}":"assign","actionTeams{}":"actionTeams"},FW=s(e=>e in o_,"isMapLeaf");function LW(e){let n=/^(tasks|optionalActions)\[\](?:\.([a-zA-Z]+))?\.([a-zA-Z]+)$/.exec(e);return n===null&&L(`[resource] unreadable reference leaf "${e}"`),{list:n[1],field:n[2]??null,key:n[3]}}s(LW,"locate");function jf(e){let n=[],t=e;for(let[r,i]of Object.entries(o_))for(let[o,a]of Object.entries(rw(t[i])??{}))n.push({path:`${i}.${o}`,leaf:r,owner:o,key:iw("key",a),missing:typeof a!="string"||a.length===0});for(let r of Object.keys(js)){if(FW(r))continue;let i=js[r],{list:o,field:a,key:l}=LW(r);for(let d of Array.isArray(t[o])?t[o]:[]){let c=rw(d);if(c===null||typeof c.key!="string")continue;let p=(a===null?c:rw(c[a]))?.[l];if(p===void 0&&!i.required)continue;let h=`${o}.${c.key}${a===null?"":`.${a}`}.${l}`;if(i.list===!0){if(!Array.isArray(p)){n.push({path:h,leaf:r,owner:c.key,key:null,missing:!0});continue}let k=c.key;p.forEach((y,v)=>{n.push({path:`${h}.${v}`,leaf:r,owner:k,index:v,key:iw(i.codec,y),missing:typeof y!="string"||y.length===0})});continue}let w=typeof p!="string"||p.length===0;n.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:iw(i.codec,p),missing:w})}}return n}s(jf,"nodeResourceReferences");var s_=s(e=>(e??[]).map(n=>`\u201E${n}\u201C`).join(", "),"list"),a_=s(e=>(e??[]).map(n=>`"${n}"`).join(", "),"listEn"),MW={"address/shape":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C ist keine g\xFCltige Adresse.`,remedy:"W\xE4hle die Adresse in der Auswahl neu."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" is not a valid address.`,remedy:"Choose the address again from the picker."}),"en")},"address/missing":{de:s(e=>({problem:`${e.where}: Hier fehlt die Adresse, ohne die dieser Schritt nicht arbeiten kann.`,remedy:"W\xE4hle sie in der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: The address this step cannot work without is missing.`,remedy:"Choose it from the picker."}),"en")},"address/bareIdentifier":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C nennt nur einen Schl\xFCssel, nicht, wer ihn erzeugt.`,remedy:"W\xE4hle in der Auswahl die volle Adresse, z. B. das Feld aus dem Formular, das es erfasst."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" names a key only, not who produces it.`,remedy:"Choose the full address from the picker, e.g. the field from the form that collects it."}),"en")},"address/unknownOwner":{de:s(e=>({problem:`${e.where}: ${e.address} nennt einen Knoten oder eine Aufgabe, die es im Ablauf nicht gibt.`,remedy:"W\xE4hle eine Adresse aus der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} names a node or task the workflow does not have.`,remedy:"Choose an address from the picker."}),"en")},"address/unknownKey":{de:s(e=>({problem:`${e.where}: ${e.producer??"der Erzeuger"} erzeugt ${e.address} nicht.`,remedy:"W\xE4hle einen Wert, den der Erzeuger tats\xE4chlich liefert."}),"de"),en:s(e=>({problem:`${e.where}: ${e.producer??"the producer"} does not produce ${e.address}.`,remedy:"Choose a value the producer actually delivers."}),"en")},"address/envCohortBound":{de:s(e=>({problem:`${e.where}: ${e.address} \xE4ndert sich, wenn Stufe oder Schuljahr gewechselt werden \u2014 ein Dokument, das den Wert druckt, w\xFCrde das nicht bemerken.`,remedy:"Lies den Wert \xFCber ein Formularfeld, das ihn berechnet (z. B. \u201EKlassenstufe\u201C): ein Wechsel friert es neu ein und h\xE4lt ein gedrucktes Dokument an."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} changes when the application's stage or school year is changed \u2014 a document printing it would not notice.`,remedy:'Read it through a form field that computes it (e.g. "Grade"): a change re-freezes it and holds a printed document.'}),"en")},"address/staffInputConditionOnly":{de:s(e=>({problem:`${e.where}: ${e.address} ist eine interne Angabe beim Anlegen \u2014 sie lenkt eine Weiche (\u201EWenn\u201C-Knoten) oder f\xFCllt einen Parameter eines Knotens.`,remedy:"Lies sie in der Bedingung eines \u201EWenn\u201C-Knotens oder binde einen Parameter des Knotens daran (z. B. im Vertrag); Formulare, Aufgaben und Regeln lesen sie nicht."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is a staff input set at the start \u2014 it steers a branch (an "If" node) or fills a node's parameter.`,remedy:'Read it in the condition of an "If" node or bind a node parameter to it (e.g. in the contract); forms, tasks and rules do not read it.'}),"en")},"address/ownerNotWriter":{de:s(e=>({problem:`${e.where}: Die Aufgabe \u201E${e.producer}\u201C schreibt ${e.address} nicht.`,remedy:"W\xE4hle den Wert \xFCber seinen Schl\xFCssel; die schreibende Aufgabe folgt daraus."}),"de"),en:s(e=>({problem:`${e.where}: The task "${e.producer}" does not write ${e.address}.`,remedy:"Choose the value by its key; the writing task follows from it."}),"en")},"address/taskOwnerTaken":{de:s(e=>({problem:`${e.where}: Den Aufgaben-Schl\xFCssel gibt es mehrfach (${s_(e.names)}), und eine dieser Aufgaben schreibt Prozesswerte.`,remedy:"Gib der schreibenden Aufgabe einen Schl\xFCssel, den keine andere Aufgabe tr\xE4gt."}),"de"),en:s(e=>({problem:`${e.where}: The task key is used more than once (${a_(e.names)}), and one of these tasks writes process values.`,remedy:"Give the writing task a key no other task carries."}),"en")},"address/notVisible":{de:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C h\xE4ngt an \u201E${e.producerNode}\u201C, das nicht auf jedem Weg vor \u201E${e.reader}\u201C liegt.`:`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C liegt nicht auf jedem Weg vor \u201E${e.reader}\u201C.`,remedy:`Lies nur, was auf jedem Weg vor \u201E${e.reader}\u201C entsteht, oder ordne die Schritte so, dass der Erzeuger immer vorher l\xE4uft.`}),"de"),en:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 "${e.producer}" hangs on "${e.producerNode}", which does not lie before "${e.reader}" on every path.`:`${e.where}: ${e.address} \u2014 "${e.producer}" does not lie before "${e.reader}" on every path.`,remedy:`Read only what is produced before "${e.reader}" on every path, or order the steps so the producer always runs first.`}),"en")},"address/pathNotInTarget":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"der Erzeuger"} hat dieses Feld nicht.`,remedy:"W\xE4hle ein Feld, das es dort gibt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the producer"} has no such field.`,remedy:"Choose a field that exists there."}),"en")},"address/typeMismatch":{de:s(e=>({problem:`${e.where}: erwartet ${e.expected}, ${e.address} ist ${e.actual}.`,remedy:`W\xE4hle einen Wert vom Typ ${e.expected}.`}),"de"),en:s(e=>({problem:`${e.where}: expects ${e.expected}, ${e.address} is ${e.actual}.`,remedy:`Choose a value of type ${e.expected}.`}),"en")},"address/notFormInstance":{de:s(e=>({problem:`${e.where}: ${e.address} ist kein ganzes Formular.`,remedy:"W\xE4hle das Formular des Knotens, der es anlegt \u2014 ohne Feld, nicht den Knoten, der es \xFCbernimmt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is not a whole form.`,remedy:"Choose the form of the node that creates it \u2014 without a field, not the node that continues it."}),"en")},"address/mixedForms":{de:s(e=>({problem:`${e.where}: Die Liste liest Felder aus mehreren Formularen (${s_(e.names)}), beurteilt wird sie aber an einem Formular.`,remedy:"W\xE4hle alle Felder dieser Liste aus demselben Formular."}),"de"),en:s(e=>({problem:`${e.where}: The list reads fields of several forms (${a_(e.names)}) but is judged on one.`,remedy:"Choose every field of this list from the same form."}),"en")},"workItems/keyFormat":{de:s(e=>({problem:`${e.where}: Der Aufgaben-Schl\xFCssel \u201E${e.address}\u201C hat nicht die Form ^[a-z][a-zA-Z0-9_]*$.`,remedy:"Benenne die Aufgabe in camelCase um, z. B. \u201EgeschwisterRang\u201C."}),"de"),en:s(e=>({problem:`${e.where}: The task key "${e.address}" does not match ^[a-z][a-zA-Z0-9_]*$.`,remedy:'Rename the task in camelCase, e.g. "siblingRank".'}),"en")}};function Vs(e,n,t){let{problem:r,remedy:i}=MW[e][t](n);return`[${e}] ${r} ${i}`}s(Vs,"addressMessage");function Zt(e){let n=[];for(let t of e){let r=t.next;if(r)for(let[i,o]of Object.entries(r))n.push({id:`${t.id}|${i}`,source:t.id,target:o.to,sourceBranchId:i})}return n}s(Zt,"derivedEdges");function ow(e){let n=new Map;for(let t of Zt(e.nodes)){let r=n.get(t.source)??[];r.push(t.target),n.set(t.source,r)}return n}s(ow,"successorsOf");function Bs(e,n,t){if(n===t)return!0;let r=ow(e),i=new Set([...r.values()].flat()),o=e.nodes.filter(l=>!i.has(l.id)&&l.id!==n).map(l=>l.id),a=new Set(o);for(;o.length>0;){let l=o.shift();if(l===t)return!1;for(let d of r.get(l)??[])d===n||a.has(d)||(a.add(d),o.push(d))}return!0}s(Bs,"dominates");function l_(e,n,t){if(n===t)return!0;let r=ow(e),i=[n],o=new Set(i);for(;i.length>0;){let a=i.shift();for(let l of r.get(a)??[]){if(l===t)return!0;o.has(l)||(o.add(l),i.push(l))}}return!1}s(l_,"reaches");function d_(e,n,t,r){let i=new Map(e.nodes.map(d=>[d.id,d])),o=ow(e),a=[n],l=new Set(a);for(;a.length>0;){let d=a.shift();for(let c of o.get(d)??[]){if(l.has(c)||t.has(c))continue;l.add(c);let u=i.get(c);if(u!==void 0&&r(u))return c;a.push(c)}}return null}s(d_,"reachedAvoiding");function sw(e,n){let t=[],r=s(i=>({address:i.address,type:i.type,...i.label!==void 0?{label:i.label}:{},nodeId:i.nodeId}),"toVisible");for(let i of e.nodes)if(Bs(e,i.id,n))for(let o of Cr(e,i))t.push(r(o));for(let i of pO)t.push({address:{scope:"env",key:i},type:Dy(i),label:Fy(i),nodeId:null});for(let i of wf(e))t.push({address:{scope:"env",key:kf(i.key)},type:i.type,label:i.label,nodeId:null});return t}s(sw,"visibleAddressesAt");function ii(e,n){let t=e?.readinessFormFieldsByFormNode?.get(n.owner);if(t!==void 0)return t.get(n.path)??null}s(ii,"formFieldEntryOf");var c_={binding:{de:"Eingang",en:"Input"},condition:{de:"Bedingung",en:"Condition"},nodeReads:{de:"Gelesene Felder",en:"Fields read"},requires:{de:"Geforderte Felder",en:"Required fields"},adoptForm:{de:"\xDCbernommenes Formular",en:"Continued form"},setFlagTarget:{de:"Freizuschaltendes Formular",en:"Form to unlock"},form:{de:"Formular",en:"Form"},contract:{de:"Vertrag",en:"Contract"},payment:{de:"Zahlung",en:"Payment"},taskWhen:{de:"Bedingung",en:"Condition"},optionalActionWhen:{de:"Bedingung der optionalen Aktion",en:"Condition of the optional action"},taskReads:{de:"Gelesene Felder der Aufgabe",en:"Fields the task reads"},taskDocument:{de:"Dokumente",en:"Documents"},familyRequestFields:{de:"Nachforderbare Felder",en:"Requestable fields"},familyRequestFrom:{de:"Nachforderung aus",en:"Request from"},suggest:{de:"Vorschlag",en:"Suggestion"}},qW=new Set(["nodeReads","requires","taskReads","taskDocument","familyRequestFields"]);function KW(e,n,t){let r=[];n.taskKey!==void 0&&r.push(`${t==="de"?"Aufgabe":"task"} \u201E${$o(e,n.taskKey,t)}\u201C`);let i=n.kind==="binding"?` \u201E${n.at.split(".").pop()}\u201C`:"";return r.push(`${c_[n.kind][t]}${i}`),r.join(" \u203A ")}s(KW,"addressFieldWhere");function Cl(e,n,t){let r=KW(e,n,t);return`\u201E${_e(e,n.nodeId,t)}\u201C \u203A ${r}`}s(Cl,"whereOf");function u_(e,n,t){if(n.scope==="node")return _e(e,n.owner,t);if(n.scope==="task")return $o(e,n.owner,t)}s(u_,"producerName");function f_(e,n){let t=[],r=new Set,i=s((l,d,c)=>{let u={de:Vs(l,c("de"),"de"),en:Vs(l,c("en"),"en")},p=`${d}|${u.de}`;r.has(p)||(r.add(p),t.push({layer:"GRAPH",kind:"nodeRule",path:d,reason:u,severity:"error"}))},"report"),o=new Map(e.nodes.map(l=>[l.id,l])),a=[...e.nodes.flatMap(l=>Tl(l))];for(let l of a){let d=s(c=>Cl(e,l,c),"where");for(let c of jW(e,l,i))BW(e,l,c,i)&&(GW(e,l,c,n,i),qy.has(l.kind)&&!WW(o,c)&&i("address/notFormInstance",l.at,u=>({where:d(u),address:je(e,c,u)})))}return YW(e,i),HW(e,a,i),XW(e,i),n1(e,i),t}s(f_,"checkAddresses");function jW(e,n,t){let r=s(i=>Cl(e,n,i),"where");if(Ky(n)){let i=jy(n.value)??[];for(let o of i)o.address===null&&t(o.reason==="bareIdentifier"?"address/bareIdentifier":"address/shape",n.at,a=>({where:r(a),address:o.identifier}));return Ls(n)}return typeof n.value=="string"?(t("address/bareIdentifier",n.at,i=>({where:r(i),address:n.value})),[]):xe(n.value)?[n.value]:(t("address/shape",n.at,i=>({where:r(i),address:JSON.stringify(n.value)??"undefined"})),[])}s(jW,"checkFieldShape");function p_(e,n,t,r){let i=u_(e,t,r);return{where:Cl(e,n,r),address:je(e,t,r),...i!==void 0?{producer:i}:{}}}s(p_,"addressParams");function VW(e,n,t){return Cy(n)||t==="optionalActionWhen"&&(Os(e,n)!==void 0||Ht(n))?null:Os(e,n)!==void 0?t==="condition"||t==="binding"?null:"address/staffInputConditionOnly":Ht(n)?"address/envCohortBound":"address/unknownKey"}s(VW,"envAddressRefusal");function BW(e,n,t,r){let i=s(o=>p_(e,n,t,o),"params");switch(t.scope){case"env":{let o=VW(e,t.key,n.kind);return o===null?!0:(r(o,n.at,i),!1)}case"task":return e.nodes.some(a=>(a.tasks??[]).some(l=>l.key===t.owner))?(e.processStore??[]).some(a=>a.key===t.key)?ri(e,t.owner,t.key)===null?(r("address/ownerNotWriter",n.at,i),!1):!0:(r("address/unknownKey",n.at,i),!1):(r("address/unknownOwner",n.at,i),!1);case"node":{let o=e.nodes.find(a=>a.id===t.owner);return o===void 0?(r("address/unknownOwner",n.at,i),!1):Cr(e,o).some(a=>a.address.scope==="node"&&a.address.key===t.key)?!0:(r(qy.has(n.kind)&&bt(o)?"address/notFormInstance":"address/unknownKey",n.at,i),!1)}}}s(BW,"resolves");function UW(e,n){return e===void 0||n===void 0||vt(n)===void 0?!0:vt(e)!==void 0&&Df(e,n)}s(UW,"addressTypeFits");function GW(e,n,t,r,i){let o=s(l=>p_(e,n,t,l),"params");if(t.scope!=="env"&&t.path!==void 0&&!zW(e,n,t,r)){i("address/pathNotInTarget",n.at,o);return}if(n.expectedType===void 0)return;let a=By(e,t);UW(a,n.expectedType)||i("address/typeMismatch",n.at,l=>({...o(l),expected:n.expectedType,actual:a}))}s(GW,"checkPathAndType");function zW(e,n,t,r){if(t.scope!=="node")return!1;if(By(e,t)!==void 0)return!0;if(t.key!==nt)return!1;if(!qW.has(n.kind))return e.nodes.find(o=>o.id===t.owner)?.formExports===void 0;let i=r?.readinessFormFieldsByFormNode?.get(t.owner);return i===void 0||i.has(t.path)}s(zW,"pathExists");function WW(e,n){if(!wr(n))return!1;let t=e.get(n.owner);return t!==void 0&&t.type==="form"&&!bt(t)}s(WW,"isCreatingFormInstance");function YW(e,n){for(let t of e.nodes){let r=new Set(Tl(t).map(i=>i.kind));for(let i of yO(t))r.has(i)||n("address/missing",`nodes.${t.id}.${i}`,o=>({where:`\u201E${_e(e,t.id,o)}\u201C \u203A ${c_[i][o]}`}))}}s(YW,"checkRequiredFields");function HW(e,n,t){let r=new Map;for(let i of n)if(i.judgedTogether!==null)for(let o of Ls(i)){if(o.scope!=="node"||o.key!==nt)continue;let a=r.get(i.judgedTogether)??[];a.push({field:i,owner:o.owner}),r.set(i.judgedTogether,a)}for(let[i,o]of r){let a=[...new Set(o.map(l=>l.owner))];a.length<2||t("address/mixedForms",i,l=>({where:Cl(e,o[0].field,l),names:a.map(d=>_e(e,d,l))}))}}s(HW,"checkMixedForms");function JW(e,n){return e.type==="engagePush"&&n.kind==="payment"}s(JW,"readSkipsAbsentProducer");function QW(e,n,t){return n!==t&&l_(e,n,t)}s(QW,"precedesOnSomePath");function ZW(e,n,t,r){let i=Ly(t.address);return r.has(pe(i))||!e1(e,i)?!0:t.origin==="written"&&i.scope==="node"&&JW(n,t.field)&&QW(e,i.owner,n.id)}s(ZW,"readPassesVisibility");function XW(e,n){for(let t of e.nodes){let r=To(e,t);if(r.length===0)continue;let i=new Set(sw(e,t.id).map(o=>pe(o.address)));for(let o of r){let a=Ly(o.address);if(ZW(e,t,o,i))continue;let l=a.scope==="task"?ri(e,a.owner,a.key):a.scope==="node"?a.owner:null;n("address/notVisible",o.field.at,d=>({where:Cl(e,o.field,d),address:je(e,o.address,d),producer:u_(e,a,d)??je(e,a,d),...l!==null?{producerNode:_e(e,l,d)}:{},reader:_e(e,t.id,d)}))}}}s(XW,"checkVisibility");function e1(e,n){if(n.scope==="env")return Cy(n.key);let t=pe(n);return e.nodes.some(r=>Cr(e,r).some(i=>pe(i.address)===t))}s(e1,"producedSomewhere");function n1(e,n){let t=new Map;for(let r of e.nodes){let i=new Set(Cr(e,r).flatMap(o=>o.address.scope==="task"?[o.address.owner]:[]));for(let[o,a]of(r.tasks??[]).entries()){let l=a.key;if(typeof l!="string"||!Oi.test(l)){n("workItems/keyFormat",`nodes.${r.id}.tasks.${o}.key`,c=>({where:`\u201E${_e(e,r.id,c)}\u201C`,address:String(l)}));continue}let d=t.get(l)??[];d.push({nodeId:r.id,writes:i.has(l)}),t.set(l,d)}}for(let[r,i]of t)if(!(i.length<2||!i.some(o=>o.writes)))for(let o of i)n("address/taskOwnerTaken",`nodes.${o.nodeId}.tasks.${r}`,a=>({where:`\u201E${_e(e,o.nodeId,a)}\u201C \u203A ${a==="de"?"Aufgabe":"task"} \u201E${$o(e,r,a)}\u201C`,names:i.map(l=>_e(e,l.nodeId,a))}))}s(n1,"checkTaskKeys");function Vf(e,n){return e.label[n]??""}s(Vf,"wordingIn");function qi(e,n){let t=m_(e,n),r=Vf(e.qualifier,n);return t===""||r===""&&Vf(e.qualifier,"de")!==""?"":r===""?t:`${r} \xB7 ${t}`}s(qi,"fieldLabelIn");function m_(e,n){return Vf(e,n)}s(m_,"fieldOwnLabelIn");function Us(e){return{key:e.key,kind:e.kind,type:e.kind==="entered"?e.type:null,repeated:e.kind==="entered"&&e.repeated,reviewRequired:e.kind==="entered"&&e.reviewRequired,name:{de:qi(e,"de"),en:qi(e,"en")}}}s(Us,"catalogField");function Gs(e,n){switch(e){case"nodeReads":return n.repeated?"repeated":null;case"requires":return n.repeated?"repeated":n.kind==="computed"?"computed":n.name.en===""?"untranslated":null;case"taskDocument":return n.repeated?"repeated":n.kind==="entered"&&n.type==="docRef"?null:"notDocument";case"taskReads":case"familyRequestFields":return null}}s(Gs,"catalogFieldRefusal");function Bf(e,n){let t=e.buses.find(r=>r.key===n);return t||L(`[progress] layout '${e.id}' has no bus '${n}'`),t}s(Bf,"progressBus");function Dl(e,n){return e.states.some(t=>t.id===n)}s(Dl,"isBusState");function h_(e,n){let t=e.terminalSemantics?.[n];return t||L(`[progress] no terminal semantics for state '${n}' on bus '${e.key}'`),t}s(h_,"terminalSemantics");function Uf(e,n){return!!e.terminalSemantics&&Object.prototype.hasOwnProperty.call(e.terminalSemantics,n)}s(Uf,"hasTerminalSemantics");function t1(e,n){return(e.boards??[]).find(t=>t.audience===n||t.audience==="both")??null}s(t1,"boardForAudience");function g_(e){return t1(Bf(e,"process"),"internal")}s(g_,"internalProcessBoard");function zs(e,n,t){let r=null;for(let i of e.mappings)if(i.event===t)if("nodeId"in i.match){if(i.match.nodeId===n.id)return{bus:i.bus,state:i.state}}else i.match.nodeType===n.type&&(r=i);return r?{bus:r.bus,state:r.state}:null}s(zs,"resolveProgressEvent");var Ws={approved:"enrolled",rejected:"declined",withdrawn:"declined",expired:"declined"},oi=Object.keys(Ws);function Oo(e){return Object.hasOwn(Ws,e)}s(Oo,"isEndNodeOutcome");var aw={approved:{de:"Angenommen",en:"Admitted"},rejected:{de:"Abgelehnt",en:"Rejected"},withdrawn:{de:"Zur\xFCckgezogen",en:"Withdrawn"},expired:{de:"Abgelaufen",en:"Expired"}};var Ki=["commit","discard"],xfe=m.union(...Ki.map(e=>m.literal(e)));function Gf(e){return typeof e=="string"&&Ki.includes(e)}s(Gf,"isApplicationDataDecision");function Ln(e){return Object.keys(e)}s(Ln,"progressEventsOf");var te=s((e,n)=>({de:e,en:n}),"lt"),Xe=s((e,n,t,r,i=null,o=null)=>({chipLabel:e,tone:n,nextAction:i,affordance:o,title:t,body:r}),"ex"),y_={key:"eingeschrieben",label:te("Eingeschrieben","Enrolled"),scope:"global",defaultCollapsed:!0},zf={key:"abgesagt",label:te("Abgesagt","Declined"),scope:"global",track:"exit",defaultCollapsed:!0},w_={key:"abgelehnt",label:te("Abgelehnt","Rejected"),scope:"global",track:"exit",defaultCollapsed:!0};var k_={enrolled:{label:te("Eingeschrieben","Enrolled"),tone:"green",terminal:{lifecycleStatus:"completed",outcome:"approved"},phase:y_,external:Xe(te("Eingeschrieben","Enrolled"),"green",te("Sie sind eingeschrieben!","You are enrolled!"),te("Ihre Anmeldung ist abgeschlossen und Ihr Platz ist gesichert. Wir freuen uns auf Sie.","Your enrolment is complete and your place is secured. We look forward to welcoming you."))},declined:{label:te("Abgesagt","Declined"),tone:"red",terminal:{lifecycleStatus:"completed",outcome:"rejected"},phase:zf,external:Xe(te("Abgesagt","Declined"),"red",te("Die Bewerbung wurde beendet","The application has ended"),te("Ihre Bewerbung wurde nicht fortgef\xFChrt.","Your application was not continued."))}},b_={role:"effect",effect:"pure",progressDefaults:k_,progressEvents:Ln(k_),inputs:s(()=>[{id:"applicationOutcome",label:{de:"Ergebnis",en:"Outcome"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:oi.map(e=>({value:e,label:aw[e]}))},{id:"dataDecision",label:{de:"Erfasste Daten",en:"Captured data"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:[{value:"commit",label:{de:"\xDCbernehmen",en:"Keep"}},{value:"discard",label:{de:"Verwerfen",en:"Discard"}}]}],"inputs"),notificationEvents:s(()=>[{id:"reached",label:{de:"Verfahren abgeschlossen",en:"Process completed"},audience:"external",args:[{key:"applicationId",type:"string",required:!0},{key:"outcome",type:"string",required:!0}]}],"notificationEvents"),validate:s(e=>[...r1(e),...i1(e),...o1(e)],"validate")},Ys=s((e,n,t,r)=>({layer:"GRAPH",kind:"nodeRule",path:`node.${e.id}.inputs.${n}`,reason:{de:t,en:r},severity:"error"}),"nodeIssue");function _o(e){let n=e.inputs?.applicationOutcome;return n?.kind==="literal"&&n.value!=null?String(n.value):null}s(_o,"literalOutcome");function r1(e){if(e.type!=="end")return[];let n=e.inputs?.applicationOutcome;if(n===void 0||n.kind==="unset")return[];let t=_o(e);return t===null?[Ys(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: das Ergebnis ist kein fester Wert \u2014 die Engine kann den Abschluss nicht ableiten`,`[end/applicationOutcome] ${e.label.en}: the application outcome is no fixed value \u2014 the engine cannot derive the terminal`)]:Oo(t)?[]:[Ys(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: '${t}' ist kein Ausgang eines Endknotens (${oi.join("|")}) \u2014 die Warteliste endet \xFCber das closed-Outcome ihres Wartelistenknotens`,`[end/applicationOutcome] ${e.label.en}: '${t}' is not an outcome of an end node (${oi.join("|")}) \u2014 the waitlist ends through the closed outcome of its waitlist node`)]}s(r1,"checkEndApplicationOutcome");function i1(e){if(e.type!=="end")return[];let n=e.inputs?.dataDecision;return!n||n.kind!=="literal"||n.value==null?[Ys(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision fehlt \u2014 der Endknoten muss festlegen, ob die erfassten Daten \xFCbernommen (commit) oder verworfen (discard) werden`,`[end/dataDecision] ${e.label.en}: dataDecision is missing \u2014 the end node must decide whether the collected data is kept (commit) or discarded (discard)`)]:Gf(n.value)?[]:[Ys(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision '${String(n.value)}' ist ung\xFCltig (${Ki.join("|")})`,`[end/dataDecision] ${e.label.en}: dataDecision '${String(n.value)}' is invalid (${Ki.join("|")})`)]}s(i1,"checkEndDataDecision");function o1(e){if(e.type!=="end")return[];let n=_o(e);if(n===null||!Oo(n)||n==="approved")return[];let t=e.inputs?.dataDecision;if(t?.kind!=="literal"||t.value!=="commit")return[];let r=aw[n];return[{...Ys(e,"dataDecision",`[end/commitWithoutApproval] ${e.label.de}: Ende ohne Zusage \xFCbernimmt die erfassten Daten (commit) \u2014 Personen und Beziehungen bleiben nach dem Ergebnis \u201E${r.de}" bestehen. Gewollt? Sonst discard.`,`[end/commitWithoutApproval] ${e.label.en}: end without admission keeps the captured data (commit) \u2014 persons and relationships remain after the outcome "${r.en}". Intended? Otherwise discard.`),severity:"warning"}]}s(o1,"checkEndCommitWithoutApproval");function v_(e,n){if(!n?.layout||!n.wiring)return[];let t=[];for(let r of e.nodes){if(r.type!=="end")continue;let i=_o(r);if(i===null||!Oo(i))continue;let o=Ws[i],a=zs(n.wiring,r,o);if(a===null)continue;let l=n.layout.buses.find(c=>c.key===a.bus);if(l===void 0||!Uf(l,a.state))continue;let d=h_(l,a.state).outcome;d!==i&&t.push(Ys(r,"applicationOutcome",`[end/outcomeMismatch] ${r.label.de}: das Ergebnis \u201E${i}" passt nicht zum Endzustand \u201E${a.state}" (Bus ${a.bus}), der \u201E${String(d)}" besiegelt \u2014 Ergebnis oder Verdrahtung angleichen.`,`[end/outcomeMismatch] ${r.label.en}: the outcome "${i}" does not match the final state "${a.state}" (bus ${a.bus}), which seals "${String(d)}" \u2014 align the outcome or the wiring.`))}return t}s(v_,"checkEndOutcomeMatchesTerminal");function Hs(e){let n=He(e);return typeof n.inputs=="function"?n.inputs(e):[]}s(Hs,"inputSlots");function s1(e,n){return Hs(e).find(t=>t.id===n)}s(s1,"findInputSlot");function a1(e,n){let t=s1(e,n);if(!t)return{source:"missing",spec:{id:n,label:{de:n,en:n},type:"string"},unknownSlot:!0};let r=e.inputs?.[n]??{kind:"unset"};return r.kind==="binding"&&xe(r.address)?{source:"binding",spec:t,address:r.address}:r.kind==="literal"?{source:"literal",spec:t,value:r.value}:r.kind==="cockpit"&&t.deferrable===!0?{source:"cockpit",spec:t}:t.defaultValue!==void 0?{source:"default",spec:t,value:t.defaultValue}:t.required?{source:"missing",spec:t}:{source:"optional",spec:t}}s(a1,"resolveInput");function x_(e){return Hs(e).filter(n=>a1(e,n.id).source==="missing")}s(x_,"missingRequiredInputs");var l1=["personRef","formRef","documentRef","docRef"];function d1(e){let n=He(e);return typeof n.inputs!="function"?[]:n.inputs(e).map(t=>({id:t.id,type:t.type}))}s(d1,"listInputs");function S_(e){let n=[];for(let t of e.nodes)for(let r of d1(t))!l1.includes(r.type)||t.inputs?.[r.id]?.kind!=="literal"||n.push({layer:"GRAPH",kind:"modelError",path:`node.${t.id}.param.${r.id}`,reason:{de:`${t.label.de}: Literal f\xFCr referenztypisierten Slot "${r.id}" ist verboten \u2014 der Slot wird an eine Adresse gebunden`,en:`${t.label.en}: A literal for the reference-typed slot "${r.id}" is not allowed \u2014 the slot is bound to an address`},severity:"error"});return n}s(S_,"findParamValueRefSlotErrors");function A_(e){let n=[];for(let t of e.nodes){let r=He(t);if(typeof r.inputs=="function")for(let i of r.inputs(t)){let o=t.inputs?.[i.id];if(o?.kind==="cockpit"&&i.deferrable!==!0){n.push({layer:"GRAPH",kind:"modelError",path:`nodes.${t.id}.inputs.${i.id}`,reason:{de:`[inputs/notDeferrable] ${t.label.de}: Parameter \u201E${i.label.de}\u201C l\xE4sst sich nicht im Cockpit erg\xE4nzen \u2014 nur Parameter eines Generators oder einer Vorlage.`,en:`[inputs/notDeferrable] ${t.label.en}: Parameter "${i.label.en}" cannot be completed in the cockpit \u2014 only parameters of a generator or a template can.`},severity:"error"});continue}(i.inspector==="literal-only"&&o?.kind==="binding"||i.inspector==="binding-only"&&o?.kind==="literal")&&n.push({layer:"GRAPH",kind:"modelError",path:`nodes.${t.id}.inputs.${i.id}`,reason:i.inspector==="literal-only"?{de:`[inputs/inspectorKind] ${t.label.de}: Parameter \u201E${i.label.de}\u201C ist ein fester Wert \u2014 eine Bindung an eine Adresse ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${t.label.en}: Parameter "${i.label.en}" is a fixed value \u2014 it cannot be bound to an address.`}:{de:`[inputs/inspectorKind] ${t.label.de}: Parameter \u201E${i.label.de}\u201C wird an eine Adresse gebunden \u2014 ein fester Wert ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${t.label.en}: Parameter "${i.label.en}" is bound to an address \u2014 a fixed value is not possible here.`},severity:"error"})}}return n}s(A_,"findInspectorKindErrors");function E_(e){let n=[];for(let t of e.nodes)for(let r of x_(t))n.push({layer:"GRAPH",kind:"contractGap",path:`node.${t.id}.input.${r.id}`,reason:{de:`${t.label.de}: Pflicht-Slot "${r.label.de}" nicht gesetzt`,en:`${t.label.en}: Required slot "${r.label.en}" is not set`},severity:"error"});return n}s(E_,"findMissingRequiredInputs");function Wf(e){let n=e.processStore;return n===void 0?[]:(Array.isArray(n)||L("graph.processStore must be an array \u2014 the graph validator refuses anything else"),n)}s(Wf,"processStoreKeys");function T_(e){let n=[];for(let t of e.tasks??[]){let r=t.result;if(!(r===void 0||!Cs(r)))for(let i of Rf(r))n.push({key:i.key,nodeId:e.id,taskKey:t.key,template:t,result:r,valueType:i.valueType,...i.field!==void 0?{fieldKey:i.field.key}:{}})}return n}s(T_,"storeWritersOn");function $_(e){let n=new Map;for(let t of e.nodes)for(let r of T_(t)){let i=n.get(r.key)??[];i.push(r),n.set(r.key,i)}return n}s($_,"processStoreWriters");function c1(e,n,t){for(let r of e.nodes){let i=T_(r).find(o=>o.taskKey===n&&o.key===t);if(i!==void 0)return i}return null}s(c1,"writerAt");function u1(e,n,t){(n.scope!=="task"||n.path!==void 0)&&L(`[process] ${t}: ${pe(n)} is no task value`);let r=c1(e,n.owner,n.key);return r===null&&L(`[address/ownerNotWriter] ${t}: task "${n.owner}" writes no "${n.key}" \u2014 publish refuses that`),{key:n.key,nodeId:r.nodeId,taskKey:r.taskKey,...r.fieldKey!==void 0?{fieldKey:r.fieldKey}:{}}}s(u1,"sourceOfAddress");function R_(e,n){(n.scope!=="task"||n.path!==void 0)&&L(`[process] ${pe(n)} is no store address`);let t=Wf(e).find(r=>r.key===n.key);return t===void 0&&L(`[address/unknownKey] ${pe(n)}: "${n.key}" is not declared in processStore`),{key:t.key,type:t.type,label:t.label,audience:t.audience,source:u1(e,n,pe(n))}}s(R_,"processLeafOf");var lw=new Set(["enum","pricedItem","number","boolean","reduction","string","staffUser","staffUserList","taskAssignment"]),dt={invalidKey:"[process/invalidKey]",unknownKey:"[process/unknownKey]",secondWriter:"[process/secondWriter]",noWriter:"[process/noWriter]",writerTypeMismatch:"[process/writerTypeMismatch]",pricedItemWritesNothing:"[process/pricedItemWritesNothing]",internalInDocument:"[process/internalInDocument]",writerMustBlock:"[process/writerMustBlock]",absentWithoutDefault:"[process/absentWithoutDefault]",defaultItemMismatch:"[process/defaultItemMismatch]"};function ct(e,n,t,r){return{layer:"GRAPH",kind:"contractGap",path:e,reason:{de:`${n} ${t}`,en:`${n} ${r}`},severity:"error"}}s(ct,"err");function O_(e){let n=[],t=Wf(e),r=new Map(t.map(l=>[l.key,l])),i=new Set;for(let[l,d]of t.entries()){let c=`processStore[${l}]`;if(typeof d.key!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(d.key)){n.push(ct(c,dt.invalidKey,`Vorgangs-Schl\xFCssel ${JSON.stringify(d.key)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,`Process key ${JSON.stringify(d.key)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`));continue}i.has(d.key)&&n.push(ct(c,dt.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" ist doppelt deklariert.`,`Process key "${d.key}" is declared twice.`)),i.add(d.key),lw.has(d.type)||n.push(ct(c,dt.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" hat den Typ "${d.type}" \u2014 der Vorgang speichert nur Ergebnisse mit Wert: ${[...lw].join(", ")}.`,`Process key "${d.key}" has the type "${d.type}" \u2014 the process only stores results with a value: ${[...lw].join(", ")}.`)),(!d.label?.de?.trim()||!d.label?.en?.trim())&&n.push(ct(c,dt.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" braucht ein Label in beiden Sprachen.`,`Process key "${d.key}" needs a label in both languages.`)),d.audience!=="internal"&&d.audience!=="printable"&&n.push(ct(c,dt.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}": audience muss 'internal' oder 'printable' sein.`,`Process key "${d.key}": audience must be 'internal' or 'printable'.`))}let o=$_(e);for(let l of e.nodes)for(let d of l.tasks??[]){let c=d.result;c?.kind==="pricedItem"&&c.writes===void 0&&n.push(ct(`node.${l.id}.tasks.${d.key}.result.writes`,dt.pricedItemWritesNothing,`Aufgabe "${d.key}" (Knoten "${l.id}") bepreist einen Artikel, schreibt das Ergebnis aber in keinen Vorgangs-Schl\xFCssel ('result.writes') \u2014 niemand k\xF6nnte den Preis lesen.`,`Task "${d.key}" (node "${l.id}") prices an article but writes the result to no process key ('result.writes') \u2014 nobody could read the price.`))}for(let[l,d]of o){let c=r.get(l);for(let u of d){let p=u.fieldKey===void 0?`node.${u.nodeId}.tasks.${u.taskKey}.result.writes`:`node.${u.nodeId}.tasks.${u.taskKey}.result.fields.${u.fieldKey}.writes`;if(c===void 0){n.push(ct(p,dt.unknownKey,`${u.fieldKey===void 0?"":`Feld "${u.fieldKey}" der `}Aufgabe "${u.taskKey}" schreibt "${l}", aber der Workflow deklariert keinen solchen Vorgangs-Schl\xFCssel (graph.processStore).`,`${u.fieldKey===void 0?"Task":`Field "${u.fieldKey}" of task`} "${u.taskKey}" writes "${l}", but the workflow declares no such process key (graph.processStore).`));continue}if(u.valueType!==c.type){let h=u.fieldKey===void 0?`Aufgabe "${u.taskKey}"`:`Feld "${u.fieldKey}" der Aufgabe "${u.taskKey}"`,w=u.fieldKey===void 0?`Task "${u.taskKey}"`:`Field "${u.fieldKey}" of task "${u.taskKey}"`;n.push(ct(p,dt.writerTypeMismatch,`${h} liefert ${u.valueType}, der Vorgangs-Schl\xFCssel "${l}" ist aber als ${c.type} deklariert.`,`${w} delivers ${u.valueType}, but the process key "${l}" is declared as ${c.type}.`))}}if(d.length>1){let u=d.map(p=>`${p.nodeId}/${p.taskKey}${p.fieldKey===void 0?"":`.${p.fieldKey}`}`).join(", ");n.push(ct(`processStore.${l}`,dt.secondWriter,`Vorgangs-Schl\xFCssel "${l}" wird ${d.length}-mal geschrieben (${u}) \u2014 genau ein Schreiber je Schl\xFCssel.`,`Process key "${l}" is written ${d.length} times (${u}) \u2014 exactly one writer per key.`))}}for(let l of t)o.has(l.key)||n.push(ct(`processStore.${l.key}`,dt.noWriter,`Vorgangs-Schl\xFCssel "${l.key}" ist deklariert, aber keine Aufgabe schreibt ihn ('result.writes').`,`Process key "${l.key}" is declared, but no task writes it ('result.writes').`));let a=new Map;for(let l of e.nodes){let d=He(l),c=typeof d.inputs=="function"?d.inputs(l):[];for(let u of c){let p=l.inputs?.[u.id];if(p?.kind!=="binding")continue;let h=f1(e,p.address);if(h===null)continue;let w=`node.${l.id}.input.${u.id}`,k=pe(p.address),y=a.get(h.source.key)??new Set;y.add(l.id),a.set(h.source.key,y),h.audience==="internal"&&n.push(ct(w,dt.internalInDocument,`${l.label.de}: "${u.id}" liest den internen Vorgangs-Schl\xFCssel "${h.key}" \u2014 ein Dokument dieses Knotens geht an die Familie; nur 'printable'-Schl\xFCssel d\xFCrfen hinein.`,`${l.label.en}: "${u.id}" reads the internal process key "${h.key}" \u2014 a document of this node goes to the family; only 'printable' keys may go in.`));let v=p1(o,h.source.key,h.source.taskKey);if(v.template.when!==void 0&&u.required===!0&&u.defaultValue===void 0&&n.push(ct(w,dt.absentWithoutDefault,`${l.label.de}: "${u.id}" ist Pflicht und an ${k} gebunden, aber die schreibende Aufgabe entsteht nur unter einer Bedingung (when: ${I_(v.template.when)}) \u2014 ohne Vorgabewert bliebe das Feld dann f\xFCr immer leer.`,`${l.label.en}: "${u.id}" is required and bound to ${k}, but the writing task only exists under a condition (when: ${I_(v.template.when)}) \u2014 without a default value the field would stay empty forever.`)),v.result.kind==="pricedItem"&&u.defaultValue!==void 0){let A=u.defaultValue;(!Pi(A)||A.itemKey!==v.result.item||A.grantKeys.length>0)&&n.push(ct(w,dt.defaultItemMismatch,`${l.label.de}: der Vorgabewert von "${u.id}" muss der Artikel der schreibenden Aufgabe ohne Erm\xE4\xDFigung sein ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 sonst rechnete die Familie ohne Antrag einen anderen Artikel als mit.`,`${l.label.en}: the default value of "${u.id}" must be the article of the writing task without a reduction ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 otherwise the family would be charged a different article without an application than with one.`))}}}for(let[l,d]of a){let c=o.get(l)[0],u=c.template.blocks,p=u===void 0?void 0:u.node??c.nodeId,h=p!==void 0&&(()=>{let k=e.nodes.find(y=>y.id===p);return k!==void 0&&He(k).processHoldTemplate?.(k)===u.templateKey})(),w=`node.${c.nodeId}.tasks.${c.taskKey}.blocks`;if(!h){let k=[...d][0],y=e.nodes.find(A=>A.id===k),v=He(y).processHoldTemplate?.(y)??"?";n.push(ct(w,dt.writerMustBlock,`Die Aufgabe "${c.taskKey}" schreibt "${l}", h\xE4lt aber keinen der lesenden Knoten (${[...d].join(", ")}) zur\xFCck \u2014 sie muss den ersten blockieren, z. B. blocks: { ${k===c.nodeId?"":`node: '${k}', `}templateKey: '${v}' }, sonst arbeitet er, bevor der Wert existiert.`,`The task "${c.taskKey}" writes "${l}" but holds back none of the reading nodes (${[...d].join(", ")}) \u2014 it must block the first one, e.g. blocks: { ${k===c.nodeId?"":`node: '${k}', `}templateKey: '${v}' }, otherwise it works before the value exists.`));continue}for(let k of d)k===p||Bs(e,p,k)||n.push(ct(w,dt.writerMustBlock,`"${k}" liest "${l}", liegt aber nicht hinter dem zur\xFCckgehaltenen Knoten "${p}" \u2014 auf einem Weg an ihm vorbei l\xE4se er den Wert, bevor er feststeht.`,`"${k}" reads "${l}" but does not lie behind the held-back node "${p}" \u2014 on a path past it, it would read the value before it is settled.`))}return n}s(O_,"processBindingIssues");function f1(e,n){return!xe(n)||n.scope!=="task"||n.path!==void 0||!Wf(e).some(t=>t.key===n.key)||ri(e,n.owner,n.key)===null?null:R_(e,n)}s(f1,"draftLeafOf");function p1(e,n,t){let r=e.get(n)?.find(i=>i.taskKey===t);return r===void 0&&L(`[process] the leaf of "${n}" names task "${t}", which does not write it`),r}s(p1,"writerOf");function I_(e){return xe(e)?pe(e):JSON.stringify(e)}s(I_,"shown");function dw(e){let n=He(e);return e.outcomes&&e.outcomes.length>0?[...e.outcomes]:n.outcomes&&n.outcomes.length>0?[...n.outcomes]:null}s(dw,"nodeOutcomes");var m1=["documentChangeRequested","documentReturned","coverLetterConfirmed","coverLetterRevisionRequested"];function __(e){return m1.includes(e)}s(__,"isNonAdvancingExternalEvent");var Js=["offer","contract"];function Yf(e){return typeof e=="string"&&Js.includes(e)}s(Yf,"isArtifactSlotType");var N_="open",Qs="done";function cw(e){let n={};for(let t of We)n[t]=e(t);return n}s(cw,"localized");var P_=[{key:"tenantSlug",type:"string"}];var h1=/^(\d{4})-(\d{2})-(\d{2})$/;function g1(e){return e>=1900&&e<=2100}s(g1,"isSupportedYear");function y1(e,n,t){let r=new Date(Date.UTC(e,n-1,t));return r.getUTCFullYear()===e&&r.getUTCMonth()===n-1&&r.getUTCDate()===t}s(y1,"isRealDate");function uw(e){if(typeof e!="string")return null;let n=h1.exec(e);if(n===null)return null;let[,t,r,i]=n;return t===void 0||r===void 0||i===void 0||!g1(Number(t))||!y1(Number(t),Number(r),Number(i))?null:{year:t,month:r,day:i}}s(uw,"isoDateParts");var w1="Europe/Berlin";function D_(){return w1}s(D_,"tenantTimeZone");var C_=new Map;function k1(e){let n=C_.get(e);if(n)return n;let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{se("INVALID",{de:`Unbekannte Zeitzone "${e}".`,en:`Unknown time zone "${e}".`})}return C_.set(e,t),t}s(k1,"formatterFor");function b1(e,n){let t=new Map(k1(e).formatToParts(new Date(n)).map(a=>[a.type,a.value])),r=s(a=>{let l=t.get(a);return l===void 0&&L(`Zeitzone "${e}" liefert kein Feld ${a}.`),Number(l)},"read"),i=r("hour")%24;return Date.UTC(r("year"),r("month")-1,r("day"),i,r("minute"),r("second"))-Math.floor(n/1e3)*1e3}s(b1,"zoneOffsetAt");function fw(e,n){let t=e+b1(n,e);return{wallClock:new Date(t).toISOString().slice(0,19),timeZone:n}}s(fw,"instantToLocalDateTime");var pw=3;function F_(e){return fw(e,D_()).wallClock.slice(0,10)}s(F_,"localIsoDate");var Hf=["login","security","admission","tasks","deadlines","schoolMessages","staffAssigned","staffTeamQueue","staffFeedback","staffAppointments","staffDeadlines","staffWaitlist","staffUnassigned","familyMessages","mentions"],L_=m.union(...Hf.map(e=>m.literal(e)));var Ppe=m.union(m.literal("admission"),m.literal("tasks"),m.literal("staff"),m.literal("chat")),mw=["loginOnly","all"],Cpe=m.union(m.literal("loginOnly"),m.literal("all"));function M_(e){return typeof e=="string"&&mw.includes(e)}s(M_,"isMailLevel");function q_(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=30}s(q_,"isUnassignedTaskNoticeDays");function K_(e){return e*864e5}s(K_,"unassignedTaskNoticeMs");var Lpe=K_(3),Mpe=K_(1);var Fl="subject";function j_(e){return e.category==="login"}s(j_,"isSignInLetter");var dn={key:"schoolName",label:"Name der Schule"},B_={de:"Zu Ihren Bewerbungen",en:"View your applications"},vn={key:"portalLink",label:"Link zum Bewerberportal",required:!0,link:!0,actionLabel:B_},hw={key:vn.key,label:vn.label,link:!0,actionLabel:B_},U_={key:"authorName",label:"Name der schreibenden Person"},No={key:"applicationLink",label:"Link zur Bewerbung",required:!0,link:!0,actionLabel:{de:"Bewerbung \xF6ffnen",en:"Open application"}},Ll={key:"anmeldeLink",label:"Anmeldelink",required:!0,link:!0,actionLabel:{de:"Jetzt anmelden",en:"Sign in now"},previewValue:{de:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL",en:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL"}},x1={key:"passwortLink",label:"Link zum neuen Passwort",required:!0,link:!0,actionLabel:{de:"Neues Passwort festlegen",en:"Set a new password"},previewValue:{de:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL",en:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL"}},G_={key:"bestaetigungsLink",label:"Best\xE4tigungslink",required:!0,link:!0,actionLabel:{de:"E-Mail best\xE4tigen",en:"Confirm email address"},previewValue:{de:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL",en:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL"}},Ml={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"15 Minuten",en:"15 minutes"}},z_={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"24 Stunden",en:"24 hours"}},S1={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"60 Minuten",en:"60 minutes"}};function Re(e){return{key:Fl,label:"Betreff",default:e}}s(Re,"subjectSlot");var ji=m.object({de:m.string(),en:m.string()}),Sn={tenantSlug:m.string(),applicationId:m.id("applications")},A1=m.object({tenantSlug:m.string()}),E1={id:"applicant.welcome",category:"admission",label:"Willkommen",occasion:{de:"Sobald f\xFCr eine Familie ein Zugang angelegt wurde",en:"As soon as an account has been created for a family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:A1,channels:["email"],portalVisible:!0,placeholders:[dn,vn],slots:[Re({de:"Willkommen \u2014 Ihre Bewerbung bei uns",en:"Welcome \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`vielen Dank f\xFCr Ihre Registrierung bei {{schoolName}}. \xDCber den folgenden Link k\xF6nnen Sie jederzeit Ihre Bewerbungen einsehen und fortsetzen:
|
|
10980
10981
|
|
|
10981
10982
|
{{portalLink}}`,en:`Thank you for registering with {{schoolName}}. You can view and continue your applications at any time using the link below:
|
|
@@ -11490,6 +11491,6 @@ ${t.length} unusable ${o}:
|
|
|
11490
11491
|
`),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli platform users relink-auth <email>
|
|
11491
11492
|
`),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli platform users provision --tenant <slug> --email <email> --name <name>
|
|
11492
11493
|
`)}else this.context.stdout.write(`No unusable identities.
|
|
11493
|
-
`);return t.length>0?1:0}},cT=class extends cr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=T.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let t=await(await this.caller()).mutation(x.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function tB(e,n){if(e===n)throw new Error("Pass exactly one of --on or --off.");return e}s(tB,"requireOnOff");var rB=[WE,YE,HE,JE,QE,ZE,XE,eT,nT,tT,pu,rT,iT,oT,sT,aT,lT,dT,cT];function iB(e){return e.de??e.en??Object.values(e)[0]??""}s(iB,"titleDe");function H9(e){return{id:e._id,kind:e.kind,status:e.status,title:iB(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(H9,"row");var J9=["id","kind","status","title","assignee","group","outcome"],pT=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=T.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.list,{client:t,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(H9),J9),0}},mT=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=T.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.get,{client:t,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:iB(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},hT=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=T.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.createManual,{client:t,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},gT=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=T.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.complete,{client:t,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},yT=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=T.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.assign,{client:t,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},oB=[pT,mT,hT,gT,yT];var mu=[...QR,...uD,...xD,...AF,...SF,...JF,...rL,...tL,...eB,...rB,...XV,...qj,...Gj,...HC,...zF,...VV,...HR,...SI,...CC,...sL,...oL,...dL,...cL,...UF,...OF,...oB,...Pq,...xK,...Lj,...SK,...EV,...PV,...zj,...nV,...iV,...lV,...cV,...FV,...zV,...pI];for(let e of mu){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:w$(e.usage.category,n.join(" "))})}var sB="0.1.178";function aB(){return mu.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=m$[fo(t)];return{path:t,effect:po(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(aB,"plexusCommandCatalog");import ds from"node:path";function Q9(e){let n=ln()?.workspaceRoot??process.cwd(),t=ds.resolve(n,e),r=ds.relative(n,t);if(ds.isAbsolute(e)||r===".."||r.startsWith(`..${ds.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Q9,"workspacePath");function Z9(e){let{absolute:n,relative:t}=Q9(e.path??".");if(e.operation==="list"){if(!Ae(n))return{files:[]};let r=[],i=s(o=>{for(let a of Rr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=ds.join(o,a.name);if(a.isDirectory()?i(l):r.push(ds.relative(n,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=he(n);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:t,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:t,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return ze(n,a,"utf8"),{path:t,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Fn(ds.dirname(n),{recursive:!0}),ze(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return ps(n),{path:t,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(Z9,"plexusWorkspace");function lB(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=bl[t];if(!o||!Object.hasOwn(bl,t))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(t==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(iy,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:iy[i.path],skillHash:df}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return Z9(i)},"executePlexusAgentTool")}s(lB,"createPlexusAgentToolExecutor");var Bh=lB({inspectCommand:cB,executeCommand:uB});function Uh(){let e=new ys({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:sB});e.register(rl.HelpCommand),e.register(rl.VersionCommand);for(let t of mu)e.register(t);async function n(t,r){let i;try{i=e.process(t,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return nX(i,r.stderr??process.stderr),e.run(i,r)}return s(n,"run"),{process(t,r){return e.process(t,r)},run:n,async runExit(t,r){process.exitCode=await n(t,r)}}}s(Uh,"createPlexusCli");function nX(e,n){let t=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&t!==r&&ll[t]===r&&sn(n,t,r),t in ll&&po(t)==="confirm"&&!dl(e)&&n.write(`plexus-cli: \`${ll[t]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11494
|
+
`);return t.length>0?1:0}},cT=class extends cr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=T.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let t=await(await this.caller()).mutation(x.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function tB(e,n){if(e===n)throw new Error("Pass exactly one of --on or --off.");return e}s(tB,"requireOnOff");var rB=[WE,YE,HE,JE,QE,ZE,XE,eT,nT,tT,pu,rT,iT,oT,sT,aT,lT,dT,cT];function iB(e){return e.de??e.en??Object.values(e)[0]??""}s(iB,"titleDe");function H9(e){return{id:e._id,kind:e.kind,status:e.status,title:iB(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(H9,"row");var J9=["id","kind","status","title","assignee","group","outcome"],pT=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=T.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.list,{client:t,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(H9),J9),0}},mT=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=T.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.get,{client:t,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:iB(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},hT=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=T.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.createManual,{client:t,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},gT=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=T.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.complete,{client:t,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},yT=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=T.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.assign,{client:t,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},oB=[pT,mT,hT,gT,yT];var mu=[...QR,...uD,...xD,...AF,...SF,...JF,...rL,...tL,...eB,...rB,...XV,...qj,...Gj,...HC,...zF,...VV,...HR,...SI,...CC,...sL,...oL,...dL,...cL,...UF,...OF,...oB,...Pq,...xK,...Lj,...SK,...EV,...PV,...zj,...nV,...iV,...lV,...cV,...FV,...zV,...pI];for(let e of mu){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:w$(e.usage.category,n.join(" "))})}var sB="0.1.179";function aB(){return mu.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=m$[fo(t)];return{path:t,effect:po(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(aB,"plexusCommandCatalog");import ds from"node:path";function Q9(e){let n=ln()?.workspaceRoot??process.cwd(),t=ds.resolve(n,e),r=ds.relative(n,t);if(ds.isAbsolute(e)||r===".."||r.startsWith(`..${ds.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Q9,"workspacePath");function Z9(e){let{absolute:n,relative:t}=Q9(e.path??".");if(e.operation==="list"){if(!Ae(n))return{files:[]};let r=[],i=s(o=>{for(let a of Rr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=ds.join(o,a.name);if(a.isDirectory()?i(l):r.push(ds.relative(n,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=he(n);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:t,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:t,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return ze(n,a,"utf8"),{path:t,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Fn(ds.dirname(n),{recursive:!0}),ze(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return ps(n),{path:t,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(Z9,"plexusWorkspace");function lB(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=bl[t];if(!o||!Object.hasOwn(bl,t))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(t==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(iy,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:iy[i.path],skillHash:df}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return Z9(i)},"executePlexusAgentTool")}s(lB,"createPlexusAgentToolExecutor");var Bh=lB({inspectCommand:cB,executeCommand:uB});function Uh(){let e=new ys({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:sB});e.register(rl.HelpCommand),e.register(rl.VersionCommand);for(let t of mu)e.register(t);async function n(t,r){let i;try{i=e.process(t,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return nX(i,r.stderr??process.stderr),e.run(i,r)}return s(n,"run"),{process(t,r){return e.process(t,r)},run:n,async runExit(t,r){process.exitCode=await n(t,r)}}}s(Uh,"createPlexusCli");function nX(e,n){let t=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&t!==r&&ll[t]===r&&sn(n,t,r),t in ll&&po(t)==="confirm"&&!dl(e)&&n.write(`plexus-cli: \`${ll[t]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11494
11495
|
`)}s(nX,"noteRetiredPath");function cB(e){let n=Uh().process(Ya(e),{executePlexusAgentTool:Bh}),t=n.path.join(" ");if(t.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=aB().find(l=>l.path===t);if(!r){if(t===""||t==="--help"||t==="--version")return{path:t,writes:!1,host:"shared"};throw new Error(`plexus: command ${t} has no host classification.`)}let i=n,o=r.effect==="callKind"?mm(Ta($a),i.fn??"",i.kind):void 0,a=Hu(t,{confirm:dl(n),callKind:o});return{...r,writes:a}}s(cB,"inspectPlexusCommand");async function uB(e,n){if(n)return bT(n,()=>uB(e));if(!Array.isArray(e.argv)||e.argv.length===0||e.argv.length>128||e.argv.some(l=>typeof l!="string"||l.length>128e3)||(e.stdin?.length??0)>1e6)throw new Error("plexus: invalid command invocation.");let t="",r="",i=Uh();if(ln()){let l=cB(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(Ya(e.argv),{executePlexusAgentTool:Bh,stdin:eX.from(e.stdin===void 0?[]:[e.stdin]),stdout:new dB({write(l,d,c){t+=String(l),c()}}),stderr:new dB({write(l,d,c){r+=String(l),c()}})}),stdout:t,stderr:r}}s(uB,"executePlexusCommand");ET({source:tX.join(import.meta.dirname,"skill")});Uh().runExit(Ya(process.argv.slice(2)),{executePlexusAgentTool:Bh});
|
|
11495
11496
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
13befa7cacfcefc3b800fbfeb9018c0760579a2333fbf4ef1f7fbeef9d33c312
|
|
@@ -62,7 +62,7 @@ plexus-cli offer workflow node add --dir <dir> --type engagePush \
|
|
|
62
62
|
# An old bundle that still carries `wires` is refused
|
|
63
63
|
# ([graph/retiredField]) — export it again.
|
|
64
64
|
|
|
65
|
-
#
|
|
65
|
+
# The contract-date additional fields (a school typically maps a few; meaning not confirmed by the school): --engage-contract-fields on
|
|
66
66
|
|
|
67
67
|
# 3. Later changes to the mapping:
|
|
68
68
|
plexus-cli offer workflow node set-engage --dir <dir> --node engagePush --config <scratch>/engage-mapping.json
|
|
@@ -146,5 +146,6 @@ Order matters; each step names why.
|
|
|
146
146
|
(„Jetzt live übertragen" is hidden while any issue is listed).
|
|
147
147
|
|
|
148
148
|
## Related
|
|
149
|
+
- What is sent, what is proven, open questions: `docs/integrations/engage.md` in the Plexus repository
|
|
149
150
|
- [Name what a node reads](./addresses.md) · [Edit a live tenant's offer](./edit-live-tenant-offer.md)
|
|
150
151
|
- `plexus-cli offer workflow node add --help` (`--engage-*` flags) · `plexus-cli offer workflow node set-engage --help`
|