wizards 0.2.28 → 0.2.30

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.
Files changed (64) hide show
  1. package/apps/runtime/dist/auth/account.js +8 -0
  2. package/apps/runtime/dist/auth/index.js +3 -0
  3. package/apps/runtime/dist/authoring/guide.js +8 -2
  4. package/apps/runtime/dist/credits/estimate.js +4 -0
  5. package/apps/runtime/dist/engine/requirements.js +4 -0
  6. package/apps/runtime/dist/engine/steps.js +42 -1
  7. package/apps/runtime/dist/env.js +5 -0
  8. package/apps/runtime/dist/index.js +4 -0
  9. package/apps/runtime/dist/manage.js +6 -1
  10. package/apps/runtime/dist/plugins/loader.js +9 -2
  11. package/apps/runtime/dist/plugins/pro-keys.js +34 -0
  12. package/apps/runtime/dist/plugins/pro-state.js +83 -0
  13. package/apps/runtime/dist/plugins/pro.js +316 -0
  14. package/apps/runtime/dist/routes/plugins.js +49 -0
  15. package/apps/runtime/dist/routes/studio.js +3 -0
  16. package/apps/runtime/dist/tools/plugin.js +49 -25
  17. package/apps/web/dist/assets/{Account-CVMSZTCv.js → Account-9HRO4JWr.js} +1 -1
  18. package/apps/web/dist/assets/{ChangelogDialog-3N1CgtWP.js → ChangelogDialog-DXH1HcDL.js} +1 -1
  19. package/apps/web/dist/assets/{CreditsDialog-BW-RETl-.js → CreditsDialog-BtID6slV.js} +1 -1
  20. package/apps/web/dist/assets/{EditorPage-DnuHM3nW.js → EditorPage-DhAf6LjO.js} +1 -1
  21. package/apps/web/dist/assets/{FlowPreview-Ds6ul7-N.js → FlowPreview-D3ZFAeax.js} +1 -1
  22. package/apps/web/dist/assets/{Harness-D-QoXcSe.js → Harness-mggD1ecl.js} +1 -1
  23. package/apps/web/dist/assets/{HomePage-Ch0HlwVX.js → HomePage-CBhmQH5G.js} +1 -1
  24. package/apps/web/dist/assets/{ImportWizard-DVcYcB6l.js → ImportWizard-BB8oJW0X.js} +1 -1
  25. package/apps/web/dist/assets/{LocalRuntime-D7bzT40S.js → LocalRuntime-Dyvqh8HP.js} +1 -1
  26. package/apps/web/dist/assets/{NewWizardPage-DvA6AX7D.js → NewWizardPage-CLFsjQgm.js} +2 -2
  27. package/apps/web/dist/assets/{ProjectPage-BWAISSfX.js → ProjectPage-BwUhAgVx.js} +1 -1
  28. package/apps/web/dist/assets/{PublicRunner-D2bd95TR.js → PublicRunner-EfNAsmpU.js} +1 -1
  29. package/apps/web/dist/assets/{RunDrawer-DkOCgXAR.js → RunDrawer-Cwtrh-Iz.js} +1 -1
  30. package/apps/web/dist/assets/{RunnerView-DF5uW_95.js → RunnerView-EQpbU4EU.js} +1 -1
  31. package/apps/web/dist/assets/SettingsPage-CASSFJS5.js +1 -0
  32. package/apps/web/dist/assets/{SetupPage-BaT-VqIc.js → SetupPage-BTjh2p6y.js} +1 -1
  33. package/apps/web/dist/assets/{SharePage-COKOsuvD.js → SharePage-BSD9UL9f.js} +1 -1
  34. package/apps/web/dist/assets/arrow-right-CzoY677S.js +1 -0
  35. package/apps/web/dist/assets/changelog-j7qikrRS.js +1 -0
  36. package/apps/web/dist/assets/{circle-alert-BG9P3ewL.js → circle-alert-CN6dFS0d.js} +1 -1
  37. package/apps/web/dist/assets/definition-Cx9uG0KU.js +1 -0
  38. package/apps/web/dist/assets/{esm-0rdZWuyu.js → esm-CKwbhTDV.js} +1 -1
  39. package/apps/web/dist/assets/{external-link-BwCtn1nW.js → external-link-DvkH63pi.js} +1 -1
  40. package/apps/web/dist/assets/{image-DG4q2P1H.js → image-BUbtvL1h.js} +1 -1
  41. package/apps/web/dist/assets/{index-DHM9S48l.js → index-C4KaV94L.js} +4 -4
  42. package/apps/web/dist/assets/{lock-DH_BntP_.js → lock-COAprdab.js} +1 -1
  43. package/apps/web/dist/assets/{meta-DI0ahJ_z.js → meta-vzJM2HEw.js} +1 -1
  44. package/apps/web/dist/assets/{pen-line-B1dsy3Sr.js → pen-line-JsP-r_aH.js} +1 -1
  45. package/apps/web/dist/assets/{refresh-cw-B9M1g3SH.js → refresh-cw-DLXaS3Ri.js} +1 -1
  46. package/apps/web/dist/assets/{settings-menu-DOjgaq6J.js → settings-menu-Ds_wegZm.js} +1 -1
  47. package/apps/web/dist/assets/{star-axQV_3EC.js → star-CpnGQZXD.js} +1 -1
  48. package/apps/web/dist/assets/{surface-BE-3Z1DP.js → surface-BFwNWkx9.js} +2 -2
  49. package/apps/web/dist/assets/{trash-3S1_XpVa.js → trash-CQZuqdcu.js} +1 -1
  50. package/apps/web/dist/assets/{ui-BZ01zr3i.js → ui-BTkH_7CG.js} +1 -1
  51. package/apps/web/dist/assets/{upload-U0i8fAW3.js → upload-Dok4YeXQ.js} +1 -1
  52. package/apps/web/dist/assets/{video-Db4o719f.js → video-BjQoPIsn.js} +1 -1
  53. package/apps/web/dist/assets/{volume-2-6f7qN_LM.js → volume-2-D-Bn77h4.js} +1 -1
  54. package/apps/web/dist/assets/{wand-sparkles-MelvBtiK.js → wand-sparkles-D3sDsFFG.js} +1 -1
  55. package/apps/web/dist/index.html +3 -3
  56. package/apps/web/dist/mcp/flow.html +49 -49
  57. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +15 -3
  58. package/node_modules/@engenty-wizards/shared/dist/definition.js +38 -9
  59. package/node_modules/@engenty-wizards/shared/dist/marketplace.js +8 -1
  60. package/package.json +1 -1
  61. package/apps/web/dist/assets/SettingsPage-CMTGFXit.js +0 -1
  62. package/apps/web/dist/assets/arrow-right-hy38IBRU.js +0 -1
  63. package/apps/web/dist/assets/changelog-C8wFW63z.js +0 -1
  64. package/apps/web/dist/assets/definition-BiUSuZN5.js +0 -1
@@ -66,7 +66,7 @@ Error generating stack: `+e.message+`
66
66
 
67
67
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ue,c=!ot.jitless,l=c&&de.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Ur([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Kr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ke(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Pe(e,r,st())))}),t)}var qr=F(`$ZodUnion`,(e,t)=>{Bn.init(e,t),Ye(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Ye(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ye(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Ye(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>D(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Kr(t,r,e,i)):Kr(o,r,e,i)}});function Jr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Yr=F(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,qr.init(e,t);let n=e._zod.parse;Ye(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||A(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=te(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=T(()=>Jr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ue(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Xr=F(`$ZodIntersection`,(e,t)=>{Bn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Qr(e,t,n)):Qr(e,i,a)}});function Zr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fe(e)&&fe(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Zr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Zr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Qr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Zr(t.value,n.value);if(!c.valid){if(ke(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var $r=F(`$ZodRecord`,(e,t)=>{Bn.init(e,t);let n=ot.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!fe(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Pe(e,i,st())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...je(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...je(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&mn.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Pe(e,i,st())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...je(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...je(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),ei=F(`$ZodEnum`,(e,t)=>{Bn.init(e,t);let n=x(t.entries),r=new Set(n);e._zod.values=r,Ye(e,`pattern`,e=>{let t=x(e.def.entries).filter(e=>me.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ge(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ti=F(`$ZodLiteral`,(e,t)=>{Bn.init(e,t);let n=new Set(t.values);e._zod.values=n,Ye(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?ge(e):e?ge(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ni=F(`$ZodTransform`,(e,t)=>{Bn.init(e,t),e._zod.optin=`optional`,ot.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new at(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new it;return n.value=i,n}});function ri(e,t){return e.value=t.issues.length?void 0:t.value,e}var ii=F(`$ZodOptional`,(e,t)=>{Bn.init(e,t),Ye(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Ye(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Ye(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${D(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ri(e,t)):ri(e,r)}return t.innerType._zod.run(e,n)}}),ai=F(`$ZodExactOptional`,(e,t)=>{ii.init(e,t),Ye(e,`values`,e=>e.def.innerType._zod.values),Ye(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),oi=F(`$ZodNullable`,(e,t)=>{Bn.init(e,t),Ye(e,`optin`,e=>e.def.innerType._zod.optin),Ye(e,`optout`,e=>e.def.innerType._zod.optout),Ye(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${D(t.source)}|null)$`):void 0}),Ye(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),si=F(`$ZodDefault`,(e,t)=>{Bn.init(e,t),e._zod.optin=`defaulted`,Ye(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ci(e,t)):ci(r,t)}});function ci(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var li=F(`$ZodPrefault`,(e,t)=>{Bn.init(e,t),e._zod.optin=`defaulted`,Ye(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ui=F(`$ZodNonOptional`,(e,t)=>{Bn.init(e,t),Ye(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>di(t,e)):di(i,e)}});function di(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function fi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Pe(e,r,st()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var pi=F(`$ZodCatch`,(e,t)=>{Bn.init(e,t),Ye(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Ye(e,`optout`,e=>e.def.innerType._zod.optout),Ye(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>fi(e,r,t,n)):fi(e,r,t,n)}}),mi=F(`$ZodPipe`,(e,t)=>{Bn.init(e,t),Ye(e,`values`,e=>e.def.in._zod.values),Ye(e,`optin`,e=>e.def.in._zod.optin),Ye(e,`optout`,e=>e.def.out._zod.optout),Ye(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>hi(e,t.in,n)):hi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>hi(e,t.out,n)):hi(r,t.out,n)}});function hi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var gi=F(`$ZodPreprocess`,(e,t)=>{mi.init(e,t)}),_i=F(`$ZodReadonly`,(e,t)=>{Bn.init(e,t),Ye(e,`propValues`,e=>e.def.innerType._zod.propValues),Ye(e,`values`,e=>e.def.innerType._zod.values),Ye(e,`optin`,e=>e.def.innerType?._zod?.optin),Ye(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(vi):vi(r)}});function vi(e){return e.memo||(e.value=Object.freeze(e.value)),e}function yi(e){let t=e._zod.def,n=t.pattern,r=!!t.format?.includes(`int`),i,a;for(let e of t.checks??[]){let t=e._zod.def;t.pattern&&(n=t.pattern),r||=!!t.format?.includes(`int`);let o=t.minimum??t.length,s=t.maximum??t.length;o!==void 0&&(i===void 0||o>i)&&(i=o),s!==void 0&&(a===void 0||s<a)&&(a=s)}if(n)return n.source;if(i!==void 0&&a!==void 0&&i>a)return`(?!)`;if(i!==void 0||a!==void 0)return fn({minimum:i,maximum:a}).source;let o=e._zod.pattern;return(r&&o===mn?pn:o)?.source}function bi(e){let t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){let e=r._zod.pattern?.source,t=bi(r);return n&&e&&t&&t!==e?n.replace(D(e),()=>D(t)):n}if(t.options){let e=t.options.map(bi);if(e.every(Boolean))return`^(${e.map(e=>D(e)).join(`|`)})$`}return yi(e)}var xi=F(`$ZodTemplateLiteral`,(e,t)=>{Bn.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){let t=bi(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(D(t))}else if(e===null||he.has(typeof e))n.push(ge(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Si=F(`$ZodLazy`,(e,t)=>{Bn.init(e,t),k(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Ye(e,`pattern`,e=>e.innerType?._zod?.pattern),Ye(e,`propValues`,e=>e.innerType?._zod?.propValues),Ye(e,`optin`,e=>e.innerType?._zod?.optin??void 0),Ye(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ci=F(`$ZodCustom`,(e,t)=>{bn.init(e,t),Bn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>wi(t,n,r,e));wi(i,n,r,e)}});function wi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ze(e))}}var Ti=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Ei=`~memo`,Di=[];function Oi(e){return typeof e==`object`&&!!e}function ki(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Ai=new WeakMap,ji=0,Mi=1,Ni=2;function Pi(e,t,n){let r=Ai.get(e);if(r!==void 0)return r?Ni:ji;if(t.has(e))return Ni;t.add(e);let i=ji,a=e=>{if(i!==Ni&&e?._zod){let r=Pi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=ji;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Mi:o.value?._zod?Pi(o.value,t,n):ji;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=te(c);s(e?o(e,!0):Mi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Pi(r,t,!1):Mi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Fi(e,i)}function Fi(e,t){return t!==Mi&&Ai.set(e,t===Ni),t}function Ii(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Li,Ri=[],zi={alloc(e,t,n){let r=Li;if(!r)return n;Li=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ri.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Vi(n,e.value))throw new Ti;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Pi(e,new Set,!1);if(i===ji)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ni||r?n=!0:r=!0}let l=s.value;if(!Oi(l))return t(s,c);let u=c[Ei];u||(u={buckets:new WeakMap,backEdges:void 0},c[Ei]=u);let d;i===c?d=a:(d=Ii(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ki(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Li=d;let p=Ri.length,m=t(s,c);Li=void 0;let h=Ri.length>p?Ri.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ki(e.issues):Di),e)):(h&&(h.issues=m.issues.length?ki(m.issues):Di),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Bi(){return zi}function Vi(e,t){let n=e[Ei]?.backEdges;return n!==void 0&&Oi(t)&&n.has(t)}var Hi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Re(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${N(e.values[0])}`:`Invalid option: expected one of ${S(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ui(){return{localeError:Hi()}}var Wi,Gi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ki(){return new Gi}(Wi=globalThis).__zod_globalRegistry??(Wi.__zod_globalRegistry=Ki());var qi=globalThis.__zod_globalRegistry;function Ji(e){return e.checks&&=[...e.checks],e}function Yi(e,t){return new e(Ji({type:`string`,...M(t)}))}function Xi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...M(t)})}function Zi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...M(t)})}function Qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...M(t)})}function $i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...M(t)})}function ea(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...M(t)})}function ta(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...M(t)})}function na(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...M(t)})}function ra(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...M(t)})}function ia(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...M(t)})}function aa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...M(t)})}function oa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...M(t)})}function sa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...M(t)})}function ca(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...M(t)})}function la(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...M(t)})}function ua(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...M(t)})}function da(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...M(t)})}function fa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...M(t)})}function pa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...M(t)})}function ma(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...M(t)})}function ha(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...M(t)})}function ga(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...M(t)})}function _a(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...M(t)})}function va(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...M(t)})}function ya(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...M(t)})}function ba(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...M(t)})}function xa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...M(t)})}function Sa(e,t){return new e(Ji({type:`number`,checks:[],...M(t)}))}function Ca(e,t){return new e(Ji({type:`number`,coerce:!0,checks:[],...M(t)}))}function wa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...M(t)})}function Ta(e,t){return new e({type:`boolean`,...M(t)})}function Ea(e,t){return new e({type:`undefined`,...M(t)})}function Da(e,t){return new e({type:`null`,...M(t)})}function Oa(e){return new e({type:`any`})}function ka(e){return new e({type:`unknown`})}function Aa(e,t){return new e({type:`never`,...M(t)})}function ja(e,t){return new Cn({check:`less_than`,...M(t),value:e,inclusive:!1})}function Ma(e,t){return new Cn({check:`less_than`,...M(t),value:e,inclusive:!0})}function Na(e,t){return new wn({check:`greater_than`,...M(t),value:e,inclusive:!1})}function Pa(e,t){return new wn({check:`greater_than`,...M(t),value:e,inclusive:!0})}function Fa(e,t){return new Tn({check:`multiple_of`,...M(t),value:e})}function Ia(e,t){return new Dn({check:`max_length`,...M(t),maximum:e})}function La(e,t){return new On({check:`min_length`,...M(t),minimum:e})}function Ra(e,t){return new kn({check:`length_equals`,...M(t),length:e})}function za(e,t){return new jn({check:`string_format`,format:`regex`,...M(t),pattern:e})}function Ba(e){return new Mn({check:`string_format`,format:`lowercase`,...M(e)})}function Va(e){return new Nn({check:`string_format`,format:`uppercase`,...M(e)})}function Ha(e,t){return new Pn({check:`string_format`,format:`includes`,...M(t),includes:e})}function Ua(e,t){return new Fn({check:`string_format`,format:`starts_with`,...M(t),prefix:e})}function Wa(e,t){return new In({check:`string_format`,format:`ends_with`,...M(t),suffix:e})}function Ga(e){return new Ln({check:`overwrite`,tx:e})}function Ka(e){return Ga(t=>t.normalize(e))}function qa(){return Ga(e=>e.trim())}function Ja(){return Ga(e=>e.toLowerCase())}function Ya(){return Ga(e=>e.toUpperCase())}function Xa(){return Ga(e=>j(e))}function Za(e,t,n){return new e({type:`array`,element:t,...M(n)})}function Qa(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...M(n)})}function $a(e,t){let n=eo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ze(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ze(r))}},e(t.value,t)),t);return n}function eo(e,t){let n=new bn({check:`custom`,...M(t)});return n._zod.check=e,n}function to(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&A(e,t,n[t]);return e}function no(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??qi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ro(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function io(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,io(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&to(o.schema,c),t.io===`input`&&ho(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ao(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function oo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ao(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ao(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
68
68
 
69
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function so(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;so(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var co=new Set([`type`,`properties`,`required`,`additionalProperties`]),lo=[`oneOf`,`anyOf`];function uo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function fo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!co.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??uo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}A(n,r,e.length===1?e[0]:fo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=uo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function po(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of co)if(t in e)return;let n=t.filter(e=>lo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=fo(t);else{let e=n[0],i=lo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>fo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,to(e,r))}function mo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):to(i,s),to(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())so(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])po(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}to(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,A(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:_o(t,`input`,e.processors),output:_o(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ho(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ho(r.element,n);if(r.type===`set`)return ho(r.valueType,n);if(r.type===`lazy`)return ho(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return ho(r.innerType,n);if(r.type===`intersection`)return ho(r.left,n)||ho(r.right,n);if(r.type===`record`||r.type===`map`)return ho(r.keyType,n)||ho(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ho(r.in,n)||ho(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ho(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ho(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ho(e,n))return!0;return!!(r.rest&&ho(r.rest,n))}return!1}var go=(e,t={})=>n=>{let r=no({...n,processors:t});return io(e,r),oo(r,e),mo(r,e)},_o=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=no({...i??{},target:a,io:t,processors:n});return io(e,o),oo(o,e),mo(o,e)},vo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},yo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},bo=(e,t)=>{vo(e,`minimum`,t),yo(e,`maximum`,t)},xo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},So=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Co=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},wo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},To=(e,t)=>vo(e,`minimum`,t.minimum),Eo=(e,t)=>yo(e,`maximum`,t.maximum),Do=e=>(t,n)=>{wo(t,n.format);let[r,i]=e[n.format];vo(t,`minimum`,r),yo(t,`maximum`,i)},Oo={greater_than:(e,t)=>vo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>yo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>xo(e,t.value),number_format:Do(ve),bigint_format:Do(ye),min_length:To,max_length:Eo,length_equals:(e,t)=>bo(e,t.length),min_size:To,max_size:Eo,size_equals:(e,t)=>bo(e,t.size),string_format:(e,t)=>{wo(e,t.format),t.pattern&&So(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Co(e,t.mime)};function ko(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Oo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&vo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&vo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&yo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&yo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&xo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Co(t,i.mime);for(let e of i.patterns??[])So(t,e);return t}var Ao={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},jo=new Map([[Sr,en],[wr,tn]]),Mo=e=>jo.get(e)??e,No=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ko(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ao[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Mo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Po=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ko(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ro(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Fo=(e,t,n,r)=>{n.type=`boolean`},Io=(e,t,n,r)=>{ro(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{ro(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},zo=(e,t,n,r)=>{ro(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{ro(e,t,n,r,`Void cannot be represented in JSON Schema`)},Vo=(e,t,n,r)=>{n.not={}},Ho=(e,t,n,r)=>{},Uo=(e,t,n,r)=>{},Wo=(e,t,n,r)=>{ro(e,t,n,r,`Date cannot be represented in JSON Schema`)},Go=(e,t,n,r)=>{let i=e._zod.def,a=x(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ko=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(ro(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(ro(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},qo=(e,t,n,r)=>{ro(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Yo=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=ko(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Xo=(e,t,n,r)=>{n.type=`boolean`},Zo=(e,t,n,r)=>{ro(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Qo=(e,t,n,r)=>{ro(e,t,n,r,`Function types cannot be represented in JSON Schema`)},$o=(e,t,n,r)=>{ro(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},es=(e,t,n,r)=>{ro(e,t,n,r,`Map cannot be represented in JSON Schema`)},ts=(e,t,n,r)=>{ro(e,t,n,r,`Set cannot be represented in JSON Schema`)},ns=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ko(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=io(a.element,t,{...r,path:[...r.path,`items`]})};function rs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?rs(t.out):t.type===`catch`?rs(t.innerType):e._zod.optin}var is=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ro(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)A(i.properties,e,io(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?rs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=io(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},as=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>io(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},os=(e,t,n,r)=>{let i=e._zod.def,a=io(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=io(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},ss=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>io(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?io(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?rs(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=ko(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function cs(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=cs(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>cs(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?mn:pn).source),p):p}var ls=new WeakMap;function us(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of ls.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=cs(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var ds=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ko(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=io(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)A(i.patternProperties,Mo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=io(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ls.get(t);n||(n=[],ls.set(t,n),t.deferred.push(()=>us(t))),n.push(e)}i.additionalProperties=io(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&rs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},fs=(e,t,n,r)=>{let i=e._zod.def,a=io(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ps=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ms=Symbol();function hs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ro(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ms):JSON.parse(o)}var gs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=hs(i.defaultValue,e,t,n,r);o!==ms&&(n.default=o)},_s=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=hs(i.defaultValue,e,t,n,r);o!==ms&&(n._prefault=o)},vs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ro(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ys=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;io(o,t,r);let s=t.seen.get(e);s.ref=o},bs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ss=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Cs=(e,t,n,r)=>{let i=e._zod.innerType;io(i,t,r);let a=t.seen.get(e);a.ref=i},ws={string:No,number:Po,boolean:Fo,bigint:Io,symbol:Lo,null:Ro,undefined:zo,void:Bo,never:Vo,any:Ho,unknown:Uo,date:Wo,enum:Go,literal:Ko,nan:qo,template_literal:Jo,file:Yo,success:Xo,custom:Zo,function:Qo,transform:$o,map:es,set:ts,array:ns,object:is,union:as,intersection:os,tuple:ss,record:ds,nullable:fs,nonoptional:ps,default:gs,prefault:_s,catch:vs,pipe:ys,readonly:bs,promise:xs,optional:Ss,lazy:Cs};function Ts(e,t){if(`_idmap`in e){let n=e,r=no({...t,processors:ws}),i={};for(let e of n._idmap.entries()){let[t,n]=e;io(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;oo(r,n),A(a,t,mo(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=no({...t,processors:ws});return io(e,n),oo(n,e),mo(n,e)}var Es=new WeakSet([Object.prototype,Error.prototype]);function Ds(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Os=F(`ZodError`,(e,t)=>{mt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Es.has(n)||(Es.add(n),Ds(n,`format`,e=>t=>_t(e,t)),Ds(n,`flatten`,e=>t=>gt(e,t)),Ds(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,C,2)}),Ds(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,C,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ks=yt(Os),As=bt(Os),js=xt(Os),Ms=Ct(Os),Ns=kt(Os),Ps=At(Os),Fs=jt(Os),Is=Mt(Os),Ls=Nt(Os),Rs=Pt(Os),zs=Ft(Os),Bs=It(Os);function Vs(){ot.localeError||st(Ui())}function Hs(){ot.memoizer||st({memoizer:Bi()})}var Us=F(`ZodType`,(e,t)=>(Vs(),Bn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(se(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _e(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fl(e,t))},superRefine(e,t){return this.check(pl(e,t))},overwrite(e){return this.check(Ga(e))},optional(){return q(this)},exactOptional(){return Gc(this)},nullable(){return qc(this)},nullish(){return q(qc(this))},nonoptional(e){return $c(this,e)},array(){return B(this)},or(e){return U([this,e])},and(e){return Lc(this,e)},transform(e){return rl(this,Hc(e))},default(e){return Yc(this,e)},prefault(e){return Zc(this,e)},catch(e){return tl(this,e)},pipe(e){return rl(this,e)},readonly(){return ol(this)},describe(e){let t=this.clone();return qi.add(t,{description:e}),t},meta(...e){if(e.length===0)return qi.get(this);let t=this.clone();return qi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return He(this,`~standard`,{...Un(this),jsonSchema:{input:_o(this,`input`),output:_o(this,`output`)}})},set"~standard"(e){Ve(this,`~standard`,e)},parse:function e(t,n){return ks(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await As(this,t,n,{callee:e})},safeParse(e,t){return js(this,e,t)},async safeParseAsync(e,t){return Ms(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ve(this,`spa`,e)},validate(e,t){return Et(this,e,t)},validateAsync(e,t){return Ot(this,e,t)},encode:function e(t,n){return Ns(this,t,n,{callee:e})},decode:function e(t,n){return Ps(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Fs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Is(this,t,n,{callee:e})},safeEncode(e,t){return Ls(this,e,t)},safeDecode(e,t){return Rs(this,e,t)},async safeEncodeAsync(e,t){return zs(this,e,t)},async safeDecodeAsync(e,t){return Bs(this,e,t)},toJSONSchema(e){return go(this,{})(e)},get description(){return qi.get(this)?.description},get _def(){return this._zod.def}}),Ws=F(`_ZodString`,(e,t)=>{Wn.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)},Ue({format:e=>ko(e).format??null,minLength:e=>ko(e).minimum??null,maxLength:e=>ko(e).maximum??null},{regex(...e){return this.check(za(...e))},includes(...e){return this.check(Ha(...e))},startsWith(...e){return this.check(Ua(...e))},endsWith(...e){return this.check(Wa(...e))},min(...e){return this.check(La(...e))},max(...e){return this.check(Ia(...e))},length(...e){return this.check(Ra(...e))},nonempty(...e){return this.check(La(1,...e))},lowercase(e){return this.check(Ba(e))},uppercase(e){return this.check(Va(e))},trim(){return this.check(qa())},normalize(...e){return this.check(Ka(...e))},toLowerCase(){return this.check(Ja())},toUpperCase(){return this.check(Ya())},slugify(){return this.check(Xa())}})),Gs=F(`ZodString`,(e,t)=>{Wn.init(e,t),Ws.init(e,t)},{email(e){return this.check(Xi(Zs,e))},url(e){return this.check(na(tc,e))},jwt(e){return this.check(_a(_c,e))},emoji(e){return this.check(ra(rc,e))},guid(e){return this.check(Zi($s,e))},uuid(e){return this.check(Qi(ec,e))},uuidv4(e){return this.check($i(ec,e))},uuidv6(e){return this.check(ea(ec,e))},uuidv7(e){return this.check(ta(ec,e))},nanoid(e){return this.check(ia(ic,e))},cuid(e){return this.check(aa(ac,e))},cuid2(e){return this.check(oa(oc,e))},ulid(e){return this.check(sa(sc,e))},base64(e){return this.check(ma(mc,e))},base64url(e){return this.check(ha(hc,e))},xid(e){return this.check(ca(cc,e))},ksuid(e){return this.check(la(lc,e))},ipv4(e){return this.check(ua(uc,e))},ipv6(e){return this.check(da(dc,e))},cidrv4(e){return this.check(fa(fc,e))},cidrv6(e){return this.check(pa(pc,e))},e164(e){return this.check(ga(gc,e))},datetime(e){return this.check(va(qs,e))},date(e){return this.check(ya(Js,e))},time(e){return this.check(ba(Ys,e))},duration(e){return this.check(xa(Xs,e))}});function I(e){return Yi(Gs,e)}var Ks=F(`ZodStringFormat`,(e,t)=>{Gn.init(e,t),Ws.init(e,t)}),qs=F(`ZodISODateTime`,(e,t)=>{ur.init(e,t),Ks.init(e,t)}),Js=F(`ZodISODate`,(e,t)=>{dr.init(e,t),Ks.init(e,t)}),Ys=F(`ZodISOTime`,(e,t)=>{fr.init(e,t),Ks.init(e,t)}),Xs=F(`ZodISODuration`,(e,t)=>{pr.init(e,t),Ks.init(e,t)}),Zs=F(`ZodEmail`,(e,t)=>{Jn.init(e,t),Ks.init(e,t)});function Qs(e){return Xi(Zs,e)}var $s=F(`ZodGUID`,(e,t)=>{Kn.init(e,t),Ks.init(e,t)}),ec=F(`ZodUUID`,(e,t)=>{qn.init(e,t),Ks.init(e,t)}),tc=F(`ZodURL`,(e,t)=>{nr.init(e,t),Ks.init(e,t)});function nc(e){return na(tc,e)}var rc=F(`ZodEmoji`,(e,t)=>{rr.init(e,t),Ks.init(e,t)}),ic=F(`ZodNanoID`,(e,t)=>{ir.init(e,t),Ks.init(e,t)}),ac=F(`ZodCUID`,(e,t)=>{ar.init(e,t),Ks.init(e,t)}),oc=F(`ZodCUID2`,(e,t)=>{or.init(e,t),Ks.init(e,t)}),sc=F(`ZodULID`,(e,t)=>{sr.init(e,t),Ks.init(e,t)}),cc=F(`ZodXID`,(e,t)=>{cr.init(e,t),Ks.init(e,t)}),lc=F(`ZodKSUID`,(e,t)=>{lr.init(e,t),Ks.init(e,t)}),uc=F(`ZodIPv4`,(e,t)=>{mr.init(e,t),Ks.init(e,t)}),dc=F(`ZodIPv6`,(e,t)=>{_r.init(e,t),Ks.init(e,t)}),fc=F(`ZodCIDRv4`,(e,t)=>{vr.init(e,t),Ks.init(e,t)}),pc=F(`ZodCIDRv6`,(e,t)=>{br.init(e,t),Ks.init(e,t)}),mc=F(`ZodBase64`,(e,t)=>{Cr.init(e,t),Ks.init(e,t)}),hc=F(`ZodBase64URL`,(e,t)=>{Er.init(e,t),Ks.init(e,t)}),gc=F(`ZodE164`,(e,t)=>{Dr.init(e,t),Ks.init(e,t)}),_c=F(`ZodJWT`,(e,t)=>{kr.init(e,t),Ks.init(e,t)}),vc=F(`ZodNumber`,(e,t)=>{Ar.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.isFinite=!0},Ue({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ko(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ko(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ko(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ko(e).format??null},{gt(e,t){return this.check(Na(e,t))},gte(e,t){return this.check(Pa(e,t))},min(e,t){return this.check(Pa(e,t))},lt(e,t){return this.check(ja(e,t))},lte(e,t){return this.check(Ma(e,t))},max(e,t){return this.check(Ma(e,t))},int(e){return this.check(bc(e))},safe(e){return this.check(bc(e))},positive(e){return this.check(Na(0,e))},nonnegative(e){return this.check(Pa(0,e))},negative(e){return this.check(ja(0,e))},nonpositive(e){return this.check(Ma(0,e))},multipleOf(e,t){return this.check(Fa(e,t))},step(e,t){return this.check(Fa(e,t))},finite(){return this}}));function L(e){return Sa(vc,e)}var yc=F(`ZodNumberFormat`,(e,t)=>{jr.init(e,t),vc.init(e,t)});function bc(e){return wa(yc,e)}var xc=F(`ZodBoolean`,(e,t)=>{Mr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r)});function R(e){return Ta(xc,e)}var Sc=F(`ZodUndefined`,(e,t)=>{Nr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r)});function Cc(e){return Ea(Sc,e)}var wc=F(`ZodNull`,(e,t)=>{Pr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r)});function Tc(e){return Da(wc,e)}var Ec=F(`ZodAny`,(e,t)=>{Fr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dc(){return Oa(Ec)}var Oc=F(`ZodUnknown`,(e,t)=>{Ir.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function z(){return ka(Oc)}var kc=F(`ZodNever`,(e,t)=>{Lr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r)});function Ac(e){return Aa(kc,e)}var jc=F(`ZodArray`,(e,t)=>{Hs(),zr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.element=t.element},{min(e,t){return this.check(La(e,t))},nonempty(e){return this.check(La(1,e))},max(e,t){return this.check(Ia(e,t))},length(e,t){return this.check(Ra(e,t))},unwrap(){return this.element}});function B(e,t){return Za(jc,e,t)}var Mc=F(`ZodObject`,(e,t)=>{Hs(),Gr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),Xe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(se(this._zod.def,{catchall:e}))},passthrough(){return this.clone(se(this._zod.def,{catchall:z()}))},loose(){return this.clone(se(this._zod.def,{catchall:z()}))},strict(){return this.clone(se(this._zod.def,{catchall:Ac()}))},strip(){return this.clone(se(this._zod.def,{catchall:void 0}))},extend(e){return Ce(this,e)},safeExtend(e){return Te(this,e)},merge(e){return Ee(this,e)},pick(e){return be(this,e)},omit(e){return Se(this,e)},partial(...e){return De(Uc,this,e[0])},exactPartial(...e){return De(Wc,this,e[0],`exactPartial`)},required(...e){return Oe(Qc,this,e[0])}});function V(e,t){return new Mc({type:`object`,shape:e??{},...M(t)})}function H(e,t){return new Mc({type:`object`,shape:e,catchall:z(),...M(t)})}var Nc=F(`ZodUnion`,(e,t)=>{qr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.options=t.options});function U(e,t){return new Nc({type:`union`,options:e,...M(t)})}var Pc=F(`ZodDiscriminatedUnion`,(e,t)=>{Nc.init(e,t),Yr.init(e,t)});function Fc(e,t,n){return new Pc({type:`union`,options:t,discriminator:e,...M(n)})}var Ic=F(`ZodIntersection`,(e,t)=>{Xr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r)});function Lc(e,t){return new Ic({type:`intersection`,left:e,right:t})}var Rc=F(`ZodRecord`,(e,t)=>{Hs(),$r.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function W(e,t,n){return!t||!t._zod?new Rc({type:`record`,keyType:I(),valueType:e,...M(t)}):new Rc({type:`record`,keyType:e,valueType:t,...M(n)})}var zc=F(`ZodEnum`,(e,t)=>{ei.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new zc({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new zc({...t,checks:[],...M(r),entries:i})}});function G(e,t){return new zc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}var Bc=F(`ZodLiteral`,(e,t)=>{ti.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new Bc({type:`literal`,values:Array.isArray(e)?e:[e],...M(t)})}var Vc=F(`ZodTransform`,(e,t)=>{Hs(),ni.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new at(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ze(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ze(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Hc(e){return new Vc({type:`transform`,transform:e})}var Uc=F(`ZodOptional`,(e,t)=>{ii.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function q(e){return new Uc({type:`optional`,innerType:e})}var Wc=F(`ZodExactOptional`,(e,t)=>{ai.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gc(e){return new Wc({type:`optional`,innerType:e})}var Kc=F(`ZodNullable`,(e,t)=>{oi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qc(e){return new Kc({type:`nullable`,innerType:e})}var Jc=F(`ZodDefault`,(e,t)=>{si.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yc(e,t){return new Jc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var Xc=F(`ZodPrefault`,(e,t)=>{li.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zc(e,t){return new Xc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var Qc=F(`ZodNonOptional`,(e,t)=>{ui.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $c(e,t){return new Qc({type:`nonoptional`,innerType:e,...M(t)})}var el=F(`ZodCatch`,(e,t)=>{pi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tl(e,t){return new el({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Qe(t)})}var nl=F(`ZodPipe`,(e,t)=>{mi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e.in=t.in,e.out=t.out});function rl(e,t){return new nl({type:`pipe`,in:e,out:t})}var il=F(`ZodPreprocess`,(e,t)=>{nl.init(e,t),gi.init(e,t)}),al=F(`ZodReadonly`,(e,t)=>{_i.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ol(e){return new al({type:`readonly`,innerType:e})}var sl=F(`ZodTemplateLiteral`,(e,t)=>{xi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r)});function cl(e,t){return new sl({type:`template_literal`,parts:e,...M(t)})}var ll=F(`ZodLazy`,(e,t)=>{Si.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function ul(e){return new ll({type:`lazy`,getter:e})}var dl=F(`ZodCustom`,(e,t)=>{Ci.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r)});function fl(e,t={}){return Qa(dl,e,t)}function pl(e,t){return $a(e,t)}function ml(e,t){return new il({type:`pipe`,in:Hc(e),out:t})}var hl={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},gl;gl||={};function _l(e){return va(qs,e)}function vl(e){return ya(Js,e)}function yl(e){return Ca(vc,e)}var bl=V({description:I().max(1024).optional(),edit:G([`inline`,`popout`]).optional(),id:I().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/,`column id must be a lowercase slug (a-z, 0-9, _)`),name:I().min(1).max(128),required:R().optional()}),xl=G([`integer`,`decimal`,`percent`,`currency`]),Sl=V({currency:I().regex(/^[A-Z]{3}$/,`currency must be an ISO 4217 code`).optional(),fractionDigits:L().int().min(0).max(8).optional(),grouping:R().optional(),style:xl}).superRefine((e,t)=>{e.style===`currency`&&!e.currency&&t.addIssue({code:`custom`,message:`currency style needs an ISO 4217 code`,path:[`currency`]}),e.style!==`currency`&&e.currency&&t.addIssue({code:`custom`,message:`currency is only valid on currency columns`,path:[`currency`]})}),Cl=G([`date`,`datetime`,`time`]),wl=G([`short`,`medium`,`long`,`iso`]),Tl=G([`hours`,`minutes`,`seconds`]),El=V({dateStyle:wl.optional(),kind:Cl,timePrecision:Tl.optional()}),Dl=G([`milliseconds`,`seconds`,`minutes`,`hours`,`days`]),Ol=G([`hms`,`hours`,`minutes`,`decimal-hours`,`iso`]),kl=V({display:Ol,inputUnit:Dl}),Al=V({id:I().min(1).max(64),label:I().min(1).max(128)}),jl=V({allowCustom:R(),multiple:R().optional(),options:B(Al).max(200)}),Ml=V({style:G([`single`,`multiline`,`markdown`]).default(`single`)}),Nl=B(Fc(`type`,[bl.extend({format:Ml.optional(),type:K(`text`)}),bl.extend({format:Sl,type:K(`number`)}),bl.extend({format:El,type:K(`date`)}),bl.extend({format:kl,type:K(`duration`)}),bl.extend({format:jl,type:K(`select`)}),bl.extend({type:K(`boolean`)})])).min(1).max(64).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.length;r++){let i=e[r]?.id;i&&(n.has(i)&&t.addIssue({code:`custom`,message:`duplicate column id "${i}"`,path:[r,`id`]}),n.add(i))}});V({description:I().optional(),edit:G([`inline`,`popout`]).optional(),format:V({allowCustom:R().optional(),currency:I().optional(),dateStyle:G([`short`,`medium`,`long`,`iso`]).optional(),display:Ol.optional(),fractionDigits:L().int().optional(),grouping:R().optional(),inputUnit:Dl.optional(),kind:Cl.optional(),multiple:R().optional(),options:B(Al).optional(),style:G([`single`,`multiline`,`markdown`,`integer`,`decimal`,`percent`,`currency`]).optional(),timePrecision:Tl.optional()}).optional(),id:I(),name:I(),required:R().optional(),type:G([`text`,`number`,`date`,`duration`,`select`,`boolean`])}),V({table_id:I().uuid()});var Pl=36e5,Fl=6e4,Il=1e3;function Ll(e){return e.fractionDigits===void 0?e.style===`integer`?0:2:e.fractionDigits}function Rl(e,t,n=`en`){if(typeof e!=`number`||!Number.isFinite(e))return``;let r=Ll(t),i=t.grouping!==!1;return t.style===`percent`?new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,style:`percent`,useGrouping:i}).format(e):t.style===`currency`&&t.currency?new Intl.NumberFormat(n,{currency:t.currency,maximumFractionDigits:r,minimumFractionDigits:r,style:`currency`,useGrouping:i}).format(e):new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,useGrouping:i}).format(e)}function zl(e,t,n=`en`){if(typeof e!=`string`||e.length===0)return``;if(t.kind===`time`)return Bl(e,t.timePrecision??`minutes`);if(t.dateStyle===`iso`)return t.kind===`date`?e.slice(0,10):e;let r=t.kind===`date`?new Date(`${e}T00:00:00`):new Date(e);if(Number.isNaN(r.getTime()))return e;let i=t.dateStyle??`medium`;if(t.kind===`date`)return new Intl.DateTimeFormat(n,{dateStyle:i}).format(r);let a=t.timePrecision??`minutes`;return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:a===`hours`?`short`:`medium`}).format(r)}function Bl(e,t){let[n=`0`,r=`00`,i=`00`]=e.split(`:`);return t===`hours`?`${n.padStart(2,`0`)}:00`:t===`minutes`?`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}`:`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}:${i.padStart(2,`0`)}`}function Vl(e,t){if(typeof e!=`number`||!Number.isFinite(e))return``;let n=Math.max(0,Math.round(e));if(t.display===`iso`)return Hl(n);if(t.display===`minutes`)return`${Math.round(n/Fl)} min`;if(t.display===`hours`)return`${(n/Pl).toFixed(2)} h`;if(t.display===`decimal-hours`)return(n/Pl).toFixed(2);let r=Math.floor(n/Pl),i=Math.floor(n%Pl/Fl),a=Math.floor(n%Fl/Il);return`${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function Hl(e){let t=Math.floor(e/Pl),n=Math.floor(e%Pl/Fl),r=Math.floor(e%Fl/Il);return`${t>=24?`P${Math.floor(t/24)}D`:`P`}T${t%24}H${n}M${r}S`}function Ul(e,t,n=`en`){if(t==null)return``;switch(e.type){case`number`:return Rl(t,e.format,n);case`date`:return zl(t,e.format,n);case`duration`:return Vl(t,e.format);case`boolean`:return t===!0?`true`:t===!1?`false`:``;case`select`:return Wl(e,t);default:return String(t)}}function Wl(e,t){let n=Array.isArray(t)?t:[t],r=e.format.options.reduce((e,t)=>(e[t.id]=t.label,e),{});return n.filter(e=>typeof e==`string`&&e.length>0).map(e=>r[e]??e).join(`, `)}var Gl=[`mail`],Kl=B(H({id:I().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,40}$/,`ids are letters, digits, _ and -`),component:G([`Column`,`Text`,`List`,`Row`,`DetailGrid`,`Badge`,`Grid`,`Metric`,`Table`,`Image`,`BarChart`,`LineChart`,`DonutChart`,`Actions`,`Button`]),children:U([B(I()),V({path:I(),componentId:I()})]).optional()})).min(1).max(200),ql=e=>!(!e||typeof e!=`object`||Array.isArray(e)||typeof e.path!=`string`);function Jl(e,t){let n=e;for(let e of t.split(`/`).slice(1)){if(typeof n!=`object`||!n)return;n=n[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return n}function Yl(e,t,n){return ql(e)?e.path.startsWith(`/`)?Jl(t,e.path):n===void 0?void 0:Jl(n,`/${e.path.replace(/\./g,`/`)}`):e}var Xl=[`round`,`drop`,`dome`,`flame`,`oval`,`bean`,`pebble`,`sprout`,`tower`,`wedge`],Zl=[`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`image`,`file`,`items`,`connection`,`list`,`location`,`audio`,`signature`,`slot`];function Ql(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let{lat:t,lng:n,label:r}=e;return typeof t==`number`&&typeof n==`number`||typeof r==`string`&&r.trim().length>0}function $l(e){return!!(e&&typeof e==`object`&&typeof e.asset==`string`&&e.asset)}var eu=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`],tu=/^[a-z][a-z0-9-]{0,39}$/,nu=/^[a-z][a-z0-9_]{0,39}$/,ru=[`classifier`,`standard`,`high`,`highest`];[...ru];var iu=[`low`,`medium`,`high`],au=[`image`,`video`,`voice`,`document`,`dashboard`],ou=[`png`,`mp4`,`mp3`,`pdf`,`docx`,`html`,`md`,`txt`,`csv`,`xlsx`,`json`,`zip`],su=[`1:1`,`16:9`,`9:16`,`4:5`,`3:2`,`2:3`],cu=[`720p`,`480p`],lu=I().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,40}$/,`ids are letters, digits and _ and start with a letter`),uu=V({id:lu,label:I().min(1),kind:G([`text`,`number`,`money`])}),du=V({field:I(),op:G([`equals`,`notEquals`,`in`,`notEmpty`,`empty`,`gt`,`lt`,`contains`]),value:U([I(),L(),R(),B(I())]).optional()}),fu=U([du,B(du).min(1)]),pu=V({id:lu,label:I().min(1),kind:G(Zl),required:R().optional(),placeholder:I().optional(),help:I().optional(),options:B(I()).optional(),default:U([I(),L(),R(),B(I())]).optional(),columns:B(uu).optional(),vat:V({rate:L().optional(),field:I().optional()}).optional(),currency:I().optional(),multiple:R().optional(),min:L().int().min(1).max(30).optional(),max:L().int().min(1).max(30).optional(),camera:R().optional(),video:R().optional(),listen:R().optional(),scan:R().optional(),connection:I().optional(),list:I().optional(),prefill:I().optional(),when:fu.optional(),optionsFrom:I().optional(),ask:I().min(1).optional(),group:I().optional()}),mu=V({id:lu,instructions:I().min(1),optional:R().optional()}),hu=V({when:fu.optional(),ask:I().min(1).optional(),goto:I(),max:L().int().min(1).max(50).optional()}).refine(e=>e.when===void 0||e.ask===void 0,{message:`A branch has "when" or "ask", not both.`}),gu={id:lu,title:I().min(1),description:I().optional(),next:B(hu).optional()},_u=V({id:lu,kind:G([`text`,`number`,`list`,`table`,`yesno`,`choice`,`score`]),description:I().optional(),columns:B(I().min(1)).optional(),options:B(I().min(1)).min(2).max(40).optional()}).refine(e=>e.kind!==`choice`&&e.kind!==`score`||!!e.options?.length,{message:`A choice or score field lists its options.`,path:[`options`]}).refine(e=>e.kind!==`score`||(e.options?.length??0)<=10,{message:`A score has at most ten levels.`,path:[`options`]}),vu=V({...gu,type:K(`page`),fields:B(pu).min(1),groups:B(mu).max(6).optional(),cta:I().optional()}),yu=V({...gu,type:K(`agent`),instructions:I().min(1),tools:B(U([G(eu),cl([I().regex(tu),`.`,I().regex(nu)])])).default([]),mcp:B(I()).optional(),connections:B(I()).optional(),output:V({format:G([`text`,`markdown`,`json`]),fields:B(_u).optional(),surface:R().optional()}).default({format:`markdown`}),model:G(ru).optional(),effort:G(iu).optional(),each:I().optional(),working:I().optional()}),bu=V({...gu,type:K(`generate`),asset:G(au),prompt:I().min(1),options:V({aspectRatio:G(su).optional(),duration:L().optional(),resolution:G(cu).optional(),style:I().optional(),template:G([`invoice`,`offer`,`briefing`,`letter`,`report`,`free`]).optional()}).optional(),referenceImage:I().optional(),each:I().optional(),model:G(ru).optional(),effort:G(iu).optional(),working:I().optional()}),xu=V({...gu,type:K(`widget`),entry:I().min(1),data:W(I(),I()).default({}),sample:I().optional(),size:V({width:L().int().min(200).max(3840),height:L().int().min(200).max(3840)}).optional(),video:R().optional(),working:I().optional()}),Su=[`16:9`,`9:16`,`1:1`],Cu=V({...gu,type:K(`film`),brief:I().min(1),skills:B(I().min(1)).max(12).default([`hyperframes`]),kit:I().optional(),inputs:W(I(),I()).default({}),format:G(Su).default(`16:9`),seconds:L().int().min(3).max(600).optional(),model:G(ru).optional(),effort:G(iu).optional(),working:I().optional()}),wu=V({id:lu,description:I().min(1),components:Kl,group:I().optional(),required:R().optional()}),Tu=V({...gu,type:K(`surface`),components:Kl.optional(),candidates:B(wu).max(16).optional(),groups:B(mu).max(6).optional(),data:W(I(),I()).default({}),working:I().optional()}).refine(e=>!!e.components!=!!e.candidates,{message:`A surface step has either "components" or "candidates".`}),Eu=V({...gu,type:K(`review`),show:B(I()).min(1),edit:R().optional(),regenerate:R().optional()}),Du=V({from:I(),label:I().optional(),formats:B(G(ou)).min(1)}),Ou=Fc(`type`,[vu,yu,bu,xu,Tu,Cu,Eu,V({...gu,type:K(`result`),message:I().optional(),deliverables:B(Du)})]),ku=V({id:lu,title:I().min(1),description:I().optional(),columns:Nl,key:I().optional(),check:V({file:I().optional(),status:I().optional()}).optional(),shared:R().optional()}),Au=V({id:lu,kind:G(Gl).optional(),connector:I().optional(),actions:B(I()).max(200).optional(),policy:W(I(),G([`allow`,`ask`])).optional(),title:I().optional(),description:I().optional()});V({version:K(1).default(1),title:I().min(1),description:I().default(``),avatar:G(Xl).default(`round`),intro:I().optional(),lists:B(ku).max(12).optional(),connections:B(Au).max(12).optional(),steps:B(Ou).min(1)});function ju(e){return e.when===void 0&&e.ask===void 0}function Mu(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function Nu(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Pu(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`||!e.trim())return null;let t=Number(e.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(t)?t:null}function Fu(e,t){let n=t[e.field];switch(e.op){case`empty`:return Mu(n);case`notEmpty`:return!Mu(n);case`equals`:return String(n)===String(e.value);case`notEquals`:return String(n)!==String(e.value);case`in`:return Array.isArray(e.value)&&e.value.map(String).includes(String(n));case`gt`:case`lt`:{let t=Pu(n),r=Pu(e.value);return t!==null&&r!==null&&(e.op===`gt`?t>r:t<r)}case`contains`:return Array.isArray(n)?n.map(String).includes(String(e.value)):typeof n==`string`&&e.value!==void 0&&n.toLowerCase().includes(String(e.value).toLowerCase())}}function Iu(e,t){return Nu(e).every(e=>Fu(e,t))}function Lu(e){return!!(e.ask||e.group)}function Ru(e,t,n){let r={...t,...n},i=[];for(let t of e)Iu(t.when,r)?i.push(t):delete r[t.id];return i}var zu=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;function Bu(e){let t=zu.exec(e.trim());if(!t)return null;let[,n,r,i,a,o]=t.map(Number),s=new Date(Date.UTC(n,r-1,i,a,o));return s.getUTCMonth()!==r-1||s.getUTCDate()!==i||a>23||o>59||!Number.isFinite(Date.parse(e))?null:{day:`${t[1]}-${t[2]}-${t[3]}`,time:`${t[4]}:${t[5]}`,wall:s}}function Vu(e,t=`de`){let n=Bu(e);if(!n)return e;let r=Ku[t];return`${n.wall.toLocaleDateString(r,{weekday:`long`,timeZone:`UTC`})}, ${n.wall.toLocaleDateString(r,{day:`numeric`,month:`long`,timeZone:`UTC`})}`}function Hu(e,t=`de`){let n=Bu(e);if(!n)return e;let r=Ku[t];return`${n.wall.toLocaleDateString(r,{weekday:`short`,timeZone:`UTC`}).replace(/\.$/,``)} ${n.wall.toLocaleDateString(r,{day:`2-digit`,month:`2-digit`,year:`numeric`,timeZone:`UTC`})}, ${n.time}`}function Uu(e,t,n){let r=Array.isArray(t)?t:[],i=(e.columns??[]).filter(e=>e.kind!==`text`),a=r.map(e=>{let t=i.length?i.reduce((t,n)=>t*Wu(e[n.id]),1):0;return{...e,amount:Gu(t)}}),o=Gu(a.reduce((e,t)=>e+t.amount,0)),s=e.vat?.rate??0;if(e.vat?.field){let t=n[e.vat.field],r=Number.parseFloat(String(t??``).replace(`,`,`.`));Number.isFinite(r)&&(s=r)}let c=Gu(o*s/100);return{rows:a,net:o,vatRate:s,vat:c,gross:Gu(o+c),currency:e.currency??`EUR`}}function Wu(e){let t=Number(typeof e==`string`?e.replace(/\s/g,``).replace(`,`,`.`):e);return Number.isFinite(t)?t:0}function Gu(e){return Math.round(e*100)/100}var Ku={de:`de-DE`,en:`en-GB`},qu=Object.defineProperty,Ju=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yu=(e,t)=>{let n={};for(var r in e)qu(n,r,{get:e[r],enumerable:!0});return t&&qu(n,Symbol.toStringTag,{value:`Module`}),n},Xu=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function Zu(e){return typeof e==`string`&&Xu.has(e.replace(/#$/,``))}var Qu=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],$u=`io.modelcontextprotocol/related-task`,ed=`io.modelcontextprotocol/protocolVersion`,td=`io.modelcontextprotocol/clientInfo`,nd=`io.modelcontextprotocol/serverInfo`,rd=`io.modelcontextprotocol/clientCapabilities`,id=`io.modelcontextprotocol/subscriptionId`,ad=`io.modelcontextprotocol/logLevel`,od=ul(()=>U([I(),L(),R(),Tc(),W(I(),od),B(od)])),sd=W(I(),od),cd=B(od),ld=U([I(),L().int()]),ud=I(),dd=V({ttl:L().optional()}),fd=V({taskId:I()}),pd=H({progressToken:ld.optional(),[$u]:fd.optional()}),md=V({_meta:pd.optional()}),hd=md.extend({task:dd.optional()}),gd=V({method:I(),params:md.loose().optional()}),_d=V({_meta:pd.optional()}),vd=V({method:I(),params:_d.loose().optional()}),yd=H({get[nd](){return Pd.optional().catch(void 0)}}),bd=H({_meta:yd.optional()}),xd=U([I(),L().int()]),Sd=V({jsonrpc:K(`2.0`),id:xd,...gd.shape}).strict(),Cd=V({jsonrpc:K(`2.0`),...vd.shape}).strict(),wd=V({jsonrpc:K(`2.0`),id:xd,result:bd}).strict(),Td=V({jsonrpc:K(`2.0`),id:xd.optional(),error:V({code:L().int(),message:I(),data:z().optional()})}).strict(),Ed=U([Sd,Cd,wd,Td]),Dd=U([wd,Td]),Od=bd.strict(),kd=_d.extend({requestId:xd.optional(),reason:I().optional()}),Ad=vd.extend({method:K(`notifications/cancelled`),params:kd}),jd=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),Md=V({icons:B(jd).optional()}),Nd=V({name:I(),title:I().optional()}),Pd=Nd.extend({...Nd.shape,...Md.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),Fd=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),sd).optional(),url:sd.optional()}),sd.optional())),Id=H({list:sd.optional(),cancel:sd.optional(),requests:H({sampling:H({createMessage:sd.optional()}).optional(),elicitation:H({create:sd.optional()}).optional()}).optional()}),Ld=H({list:sd.optional(),cancel:sd.optional(),requests:H({tools:H({call:sd.optional()}).optional()}).optional()}),Rd=V({experimental:W(I(),sd).optional(),sampling:V({context:sd.optional(),tools:sd.optional()}).optional(),elicitation:Fd.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:Id.optional(),extensions:W(I(),sd).optional()}),zd=md.extend({protocolVersion:I(),capabilities:Rd,clientInfo:Pd}),Bd=gd.extend({method:K(`initialize`),params:zd}),Vd=V({experimental:W(I(),sd).optional(),logging:sd.optional(),completions:sd.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:Ld.optional(),extensions:W(I(),sd).optional()}),Hd=bd.extend({protocolVersion:I(),capabilities:Vd,serverInfo:Pd,instructions:I().optional()}),Ud=vd.extend({method:K(`notifications/initialized`),params:_d.optional()}),Wd=gd.extend({method:K(`server/discover`),params:md.optional()}),Gd=bd.extend({supportedVersions:B(I()),capabilities:Vd,instructions:I().optional()}),Kd=gd.extend({method:K(`ping`),params:md.optional()}),qd=V({progress:L(),total:q(L()),message:q(I())}),Jd=V({..._d.shape,...qd.shape,progressToken:ld}),Yd=vd.extend({method:K(`notifications/progress`),params:Jd}),Xd=md.extend({cursor:ud.optional()}),Zd=gd.extend({params:Xd.optional()}),Qd=bd.extend({nextCursor:ud.optional()}),$d=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),ef=$d.extend({text:I()}),tf=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),nf=$d.extend({blob:tf}),rf=G([`user`,`assistant`]),af=V({audience:B(rf).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),of=V({...Nd.shape,...Md.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:af.optional(),_meta:q(H({}))}),sf=V({...Nd.shape,...Md.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:af.optional(),_meta:q(H({}))}),cf=Zd.extend({method:K(`resources/list`)}),lf=Qd.extend({resources:B(of)}),uf=Zd.extend({method:K(`resources/templates/list`)}),df=Qd.extend({resourceTemplates:B(sf)}),ff=md.extend({uri:I()}),pf=ff,mf=gd.extend({method:K(`resources/read`),params:pf}),hf=bd.extend({contents:B(U([ef,nf]))}),gf=vd.extend({method:K(`notifications/resources/list_changed`),params:_d.optional()}),_f=ff,vf=gd.extend({method:K(`resources/subscribe`),params:_f}),yf=ff,bf=gd.extend({method:K(`resources/unsubscribe`),params:yf}),xf=V({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:B(I()).optional()}),Sf=md.extend({notifications:xf}),Cf=gd.extend({method:K(`subscriptions/listen`),params:Sf}),wf=_d.extend({notifications:xf}),Tf=vd.extend({method:K(`notifications/subscriptions/acknowledged`),params:wf}),Ef=yd.extend({[id]:xd}),Df=bd.extend({_meta:Ef}),Of=_d.extend({uri:I()}),kf=vd.extend({method:K(`notifications/resources/updated`),params:Of}),Af=V({name:I(),description:q(I()),required:q(R())}),jf=V({...Nd.shape,...Md.shape,description:q(I()),arguments:q(B(Af)),_meta:q(H({}))}),Mf=Zd.extend({method:K(`prompts/list`)}),Nf=Qd.extend({prompts:B(jf)}),Pf=md.extend({name:I(),arguments:W(I(),I()).optional()}),Ff=gd.extend({method:K(`prompts/get`),params:Pf}),If=V({type:K(`text`),text:I(),annotations:af.optional(),_meta:W(I(),z()).optional()}),Lf=V({type:K(`image`),data:tf,mimeType:I(),annotations:af.optional(),_meta:W(I(),z()).optional()}),Rf=V({type:K(`audio`),data:tf,mimeType:I(),annotations:af.optional(),_meta:W(I(),z()).optional()}),zf=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),Bf=V({type:K(`resource`),resource:U([ef,nf]),annotations:af.optional(),_meta:W(I(),z()).optional()}),Vf=of.extend({type:K(`resource_link`)}),Hf=U([If,Lf,Rf,Vf,Bf]),Uf=V({role:rf,content:Hf}),Wf=bd.extend({description:I().optional(),messages:B(Uf)}),Gf=vd.extend({method:K(`notifications/prompts/list_changed`),params:_d.optional()}),Kf=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),qf=V({taskSupport:G([`required`,`optional`,`forbidden`]).optional()}),Jf=V({...Nd.shape,...Md.shape,description:I().optional(),inputSchema:V({type:K(`object`),properties:W(I(),od).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:H({$schema:I().optional()}).optional(),annotations:Kf.optional(),execution:qf.optional(),_meta:W(I(),z()).optional()}),Yf=Zd.extend({method:K(`tools/list`)}),Xf=Qd.extend({tools:B(Jf)}),Zf=bd.extend({content:B(Hf).default([]),structuredContent:z().optional(),isError:R().optional()}),Qf=Zf.or(bd.extend({toolResult:z()})),$f=hd.extend({name:I(),arguments:W(I(),z()).optional()}),ep=gd.extend({method:K(`tools/call`),params:$f}),tp=vd.extend({method:K(`notifications/tools/list_changed`),params:_d.optional()}),np=V({autoRefresh:R().default(!0),debounceMs:L().int().nonnegative().default(300)}),rp=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),ip=md.extend({level:rp}),ap=gd.extend({method:K(`logging/setLevel`),params:ip}),op=_d.extend({level:rp,logger:I().optional(),data:z()}),sp=vd.extend({method:K(`notifications/message`),params:op}),cp=V({name:I().optional()}),lp=V({hints:B(cp).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),up=V({mode:G([`auto`,`required`,`none`]).optional()}),dp=V({type:K(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(Hf),structuredContent:z().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),fp=Fc(`type`,[If,Lf,Rf]),pp=Fc(`type`,[If,Lf,Rf,zf,dp]),mp=V({role:rf,content:U([pp,B(pp)]),_meta:W(I(),z()).optional()}),hp=hd.extend({messages:B(mp),modelPreferences:lp.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:sd.optional(),tools:B(Jf).optional(),toolChoice:up.optional()}),gp=gd.extend({method:K(`sampling/createMessage`),params:hp}),_p=bd.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:rf,content:fp}),vp=bd.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:rf,content:U([pp,B(pp)])}),yp=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),bp=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),xp=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Sp=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),Cp=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),wp=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Tp=U([Sp,Cp]),Ep=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),Dp=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),Op=U([Ep,Dp]),kp=U([wp,Tp,Op]),Ap=U([kp,yp,bp,xp]),jp=hd.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),Ap),required:B(I()).optional()}).catchall(z())}),Mp=hd.extend({mode:K(`url`),message:I(),elicitationId:I(),url:I().url()}),Np=U([jp,Mp]),Pp=gd.extend({method:K(`elicitation/create`),params:Np}),Fp=_d.extend({elicitationId:I()}),Ip=vd.extend({method:K(`notifications/elicitation/complete`),params:Fp}),Lp=bd.extend({action:G([`accept`,`decline`,`cancel`]),content:ml(e=>e===null?void 0:e,W(I(),U([I(),L(),R(),B(I())])).optional())}),Rp=V({type:K(`ref/resource`),uri:I()}),zp=V({type:K(`ref/prompt`),name:I()}),Bp=md.extend({ref:U([zp,Rp]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()}),Vp=gd.extend({method:K(`completion/complete`),params:Bp}),Hp=bd.extend({completion:H({values:B(I()).max(100),total:q(L().int()),hasMore:q(R())})}),Up=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),Wp=gd.extend({method:K(`roots/list`),params:md.optional()}),Gp=bd.extend({roots:B(Up)}),Kp=vd.extend({method:K(`notifications/roots/list_changed`),params:_d.optional()}),qp=H({ttl:L().optional(),pollInterval:L().optional()}),Jp=G([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Yp=V({taskId:I(),status:Jp,ttl:U([L(),Tc()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:q(L()),statusMessage:q(I())}),Xp=bd.extend({task:Yp}),Zp=_d.merge(Yp),Qp=vd.extend({method:K(`notifications/tasks/status`),params:Zp}),$p=gd.extend({method:K(`tasks/get`),params:md.extend({taskId:I()})}),em=bd.merge(Yp),tm=gd.extend({method:K(`tasks/result`),params:md.extend({taskId:I()})}),nm=bd.loose(),rm=Zd.extend({method:K(`tasks/list`)}),im=Qd.extend({tasks:B(Yp)}),am=gd.extend({method:K(`tasks/cancel`),params:md.extend({taskId:I()})}),om=bd.merge(Yp),sm=U([Kd,Bd,Wd,Vp,ap,Ff,Mf,cf,uf,mf,vf,bf,Cf,ep,Yf]),cm=U([Ad,Yd,Ud,Kp]),lm=U([Od,_p,vp,Lp,Gp]),um=U([Kd,gp,Pp,Wp]),dm=U([Ad,Yd,sp,kf,gf,tp,Gf,Tf,Ip]),fm=U([Od,Hd,Gd,Hp,Wf,Nf,lf,df,hf,Zf,Xf,Df]),pm=nc().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:hl.custom,message:`URL must be parseable`,fatal:!0}),et}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),mm=H({resource:I().url(),authorization_servers:B(pm).optional(),jwks_uri:I().url().optional(),scopes_supported:B(I()).optional(),bearer_methods_supported:B(I()).optional(),resource_signing_alg_values_supported:B(I()).optional(),resource_name:I().optional(),resource_documentation:I().optional(),resource_policy_uri:I().url().optional(),resource_tos_uri:I().url().optional(),tls_client_certificate_bound_access_tokens:R().optional(),authorization_details_types_supported:B(I()).optional(),dpop_signing_alg_values_supported:B(I()).optional(),dpop_bound_access_tokens_required:R().optional()}),hm=H({issuer:I(),authorization_endpoint:pm,token_endpoint:pm,registration_endpoint:pm.optional(),scopes_supported:B(I()).optional(),response_types_supported:B(I()),response_modes_supported:B(I()).optional(),grant_types_supported:B(I()).optional(),token_endpoint_auth_methods_supported:B(I()).optional(),token_endpoint_auth_signing_alg_values_supported:B(I()).optional(),service_documentation:pm.optional(),revocation_endpoint:pm.optional(),revocation_endpoint_auth_methods_supported:B(I()).optional(),revocation_endpoint_auth_signing_alg_values_supported:B(I()).optional(),introspection_endpoint:I().optional(),introspection_endpoint_auth_methods_supported:B(I()).optional(),introspection_endpoint_auth_signing_alg_values_supported:B(I()).optional(),code_challenge_methods_supported:B(I()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:B(I()).optional()}),gm=H({issuer:I(),authorization_endpoint:pm,token_endpoint:pm,userinfo_endpoint:pm.optional(),jwks_uri:pm,registration_endpoint:pm.optional(),scopes_supported:B(I()).optional(),response_types_supported:B(I()),response_modes_supported:B(I()).optional(),grant_types_supported:B(I()).optional(),acr_values_supported:B(I()).optional(),subject_types_supported:B(I()),id_token_signing_alg_values_supported:B(I()),id_token_encryption_alg_values_supported:B(I()).optional(),id_token_encryption_enc_values_supported:B(I()).optional(),userinfo_signing_alg_values_supported:B(I()).optional(),userinfo_encryption_alg_values_supported:B(I()).optional(),userinfo_encryption_enc_values_supported:B(I()).optional(),request_object_signing_alg_values_supported:B(I()).optional(),request_object_encryption_alg_values_supported:B(I()).optional(),request_object_encryption_enc_values_supported:B(I()).optional(),token_endpoint_auth_methods_supported:B(I()).optional(),token_endpoint_auth_signing_alg_values_supported:B(I()).optional(),display_values_supported:B(I()).optional(),claim_types_supported:B(I()).optional(),claims_supported:B(I()).optional(),service_documentation:I().optional(),claims_locales_supported:B(I()).optional(),ui_locales_supported:B(I()).optional(),claims_parameter_supported:R().optional(),request_parameter_supported:R().optional(),request_uri_parameter_supported:R().optional(),require_request_uri_registration:R().optional(),op_policy_uri:pm.optional(),op_tos_uri:pm.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),_m=V({...gm.shape,...hm.pick({code_challenge_methods_supported:!0}).shape}),vm=V({access_token:I(),id_token:I().optional(),token_type:I(),expires_in:yl().optional(),scope:I().optional(),refresh_token:I().optional(),issuer:I().optional().catch(void 0)}).strip(),ym=V({issued_token_type:K(`urn:ietf:params:oauth:token-type:id-jag`),access_token:I(),token_type:I().optional(),expires_in:L().optional(),scope:I().optional()}).strip(),bm=V({error:I(),error_description:I().optional(),error_uri:I().optional()}),xm=pm.optional().or(K(``).transform(()=>void 0)),Sm=V({redirect_uris:B(pm),token_endpoint_auth_method:I().optional(),grant_types:B(I()).optional(),response_types:B(I()).optional(),application_type:I().optional(),client_name:I().optional(),client_uri:pm.optional(),logo_uri:xm,scope:I().optional(),contacts:B(I()).optional(),tos_uri:xm,policy_uri:I().optional(),jwks_uri:pm.optional(),jwks:Dc().optional(),software_id:I().optional(),software_version:I().optional(),software_statement:I().optional()}).strip(),Cm=V({client_id:I(),client_secret:I().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional(),issuer:I().optional().catch(void 0)}).strip(),wm=Sm.merge(Cm),Tm=V({error:I(),error_description:I().optional()}).strip(),Em=V({token:I(),token_type_hint:I().optional()}).strip(),Dm=Symbol.for(`mcp.sdk.errorBrands`);function Om(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Dm,{value:n,enumerable:!1,configurable:!0})}function km(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Dm)){let n=t[Dm];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Om(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});var Am=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),jm=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Om(this,new.target)}};(class extends jm{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var Mm=`2026-07-28`;function Nm(e){return e>=Mm}function Pm(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var Fm=[`task`,`inputRequests`,`requestState`];function Im(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||Fm.some(t=>t in e)?e:{...e,content:[]}}function Lm(){let e=ul(()=>U([I(),L(),R(),Tc(),W(I(),e),B(e)])),t=W(I(),e),n=U([I(),L().int()]),r=I(),i=V({ttl:L().optional()}),a=V({taskId:I()}),o=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=V({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=V({method:I(),params:s.loose().optional()}),u=V({_meta:o.optional()}),d=V({method:I(),params:u.loose().optional()}),f=H({_meta:o.optional()}),p=U([I(),L().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:I().optional()}),g=d.extend({method:K(`notifications/cancelled`),params:h}),_=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),v=V({icons:B(_).optional()}),y=V({name:I(),title:I().optional()}),b=y.extend({...y.shape,...v.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),x=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),t).optional(),url:t.optional()}),t.optional())),S=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),C=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),w=V({experimental:W(I(),t).optional(),sampling:V({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:S.optional(),extensions:W(I(),t).optional()}),T=s.extend({protocolVersion:I(),capabilities:w,clientInfo:b}),E=l.extend({method:K(`initialize`),params:T}),D=V({experimental:W(I(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:C.optional(),extensions:W(I(),t).optional()}),ee=f.extend({protocolVersion:I(),capabilities:D,serverInfo:b,instructions:I().optional()}),O=d.extend({method:K(`notifications/initialized`),params:u.optional()}),k=l.extend({method:K(`ping`),params:s.optional()}),A=V({progress:L(),total:q(L()),message:q(I())}),te=V({...u.shape,...A.shape,progressToken:n}),ne=d.extend({method:K(`notifications/progress`),params:te}),re=s.extend({cursor:r.optional()}),ie=l.extend({params:re.optional()}),ae=f.extend({nextCursor:r.optional()}),oe=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),se=oe.extend({text:I()}),ce=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),j=oe.extend({blob:ce}),le=G([`user`,`assistant`]),ue=V({audience:B(le).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),de=V({...y.shape,...v.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:ue.optional(),_meta:q(H({}))}),fe=V({...y.shape,...v.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:ue.optional(),_meta:q(H({}))}),pe=ie.extend({method:K(`resources/list`)}),me=ae.extend({resources:B(de)}),he=ie.extend({method:K(`resources/templates/list`)}),ge=ae.extend({resourceTemplates:B(fe)}),_e=s.extend({uri:I()}),M=_e,N=l.extend({method:K(`resources/read`),params:M}),P=f.extend({contents:B(U([se,j]))}),ve=d.extend({method:K(`notifications/resources/list_changed`),params:u.optional()}),ye=_e,be=l.extend({method:K(`resources/subscribe`),params:ye}),xe=_e,Se=l.extend({method:K(`resources/unsubscribe`),params:xe}),Ce=u.extend({uri:I()}),we=d.extend({method:K(`notifications/resources/updated`),params:Ce}),Te=V({name:I(),description:q(I()),required:q(R())}),Ee=V({...y.shape,...v.shape,description:q(I()),arguments:q(B(Te)),_meta:q(H({}))}),De=ie.extend({method:K(`prompts/list`)}),Oe=ae.extend({prompts:B(Ee)}),ke=s.extend({name:I(),arguments:W(I(),I()).optional()}),Ae=l.extend({method:K(`prompts/get`),params:ke}),je=V({type:K(`text`),text:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Me=V({type:K(`image`),data:ce,mimeType:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Ne=V({type:K(`audio`),data:ce,mimeType:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Pe=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),Fe=V({type:K(`resource`),resource:U([se,j]),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Ie=de.extend({type:K(`resource_link`)}),Le=U([je,Me,Ne,Ie,Fe]),Re=V({role:le,content:Le}),ze=f.extend({description:I().optional(),messages:B(Re)}),Be=d.extend({method:K(`notifications/prompts/list_changed`),params:u.optional()}),Ve=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),He=V({taskSupport:G([`required`,`optional`,`forbidden`]).optional()}),Ue=V({...y.shape,...v.shape,description:I().optional(),inputSchema:V({type:K(`object`),properties:W(I(),e).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:V({type:K(`object`),properties:W(I(),e).optional(),required:B(I()).optional()}).catchall(z()).optional(),annotations:Ve.optional(),execution:He.optional(),_meta:W(I(),z()).optional()}),We=ie.extend({method:K(`tools/list`)}),Ge=ae.extend({tools:B(Ue)}),Ke=f.extend({content:B(Le),structuredContent:W(I(),z()).optional(),isError:R().optional()}),qe=c.extend({name:I(),arguments:W(I(),z()).optional()}),Je=l.extend({method:K(`tools/call`),params:qe}),Ye=d.extend({method:K(`notifications/tools/list_changed`),params:u.optional()}),Xe=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ze=s.extend({level:Xe}),Qe=l.extend({method:K(`logging/setLevel`),params:Ze}),$e=u.extend({level:Xe,logger:I().optional(),data:z()}),et=d.extend({method:K(`notifications/message`),params:$e}),tt=V({name:I().optional()}),nt=V({hints:B(tt).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),rt=V({mode:G([`auto`,`required`,`none`]).optional()}),F=V({type:K(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(Le),structuredContent:V({}).loose().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),it=Fc(`type`,[je,Me,Ne]),at=Fc(`type`,[je,Me,Ne,Pe,F]),ot=V({role:le,content:U([at,B(at)]),_meta:W(I(),z()).optional()}),st=c.extend({messages:B(ot),modelPreferences:nt.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:t.optional(),tools:B(Ue).optional(),toolChoice:rt.optional()}),ct=l.extend({method:K(`sampling/createMessage`),params:st}),lt=f.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:le,content:it}),ut=f.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:le,content:U([at,B(at)])}),dt=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),ft=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),pt=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),mt=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),ht=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),gt=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),_t=U([mt,ht]),vt=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),yt=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),bt=U([vt,yt]),xt=U([gt,_t,bt]),St=U([xt,dt,ft,pt]),Ct=c.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),St),required:B(I()).optional()}).catchall(z())}),wt=c.extend({mode:K(`url`),message:I(),elicitationId:I(),url:I().url()}),Tt=U([Ct,wt]),Et=l.extend({method:K(`elicitation/create`),params:Tt}),Dt=u.extend({elicitationId:I()}),Ot=d.extend({method:K(`notifications/elicitation/complete`),params:Dt}),kt=f.extend({action:G([`accept`,`decline`,`cancel`]),content:ml(e=>e===null?void 0:e,W(I(),U([I(),L(),R(),B(I())])).optional())}),At=V({type:K(`ref/resource`),uri:I()}),jt=V({type:K(`ref/prompt`),name:I()}),Mt=s.extend({ref:U([jt,At]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()}),Nt=l.extend({method:K(`completion/complete`),params:Mt}),Pt=f.extend({completion:H({values:B(I()).max(100),total:q(L().int()),hasMore:q(R())})}),Ft=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),It=l.extend({method:K(`roots/list`),params:s.optional()}),Lt=f.extend({roots:B(Ft)}),Rt=d.extend({method:K(`notifications/roots/list_changed`),params:u.optional()}),zt=H({ttl:L().optional(),pollInterval:L().optional()}),Bt=G([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Vt=V({taskId:I(),status:Bt,ttl:U([L(),Tc()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:q(L()),statusMessage:q(I())}),Ht=f.extend({task:Vt}),Ut=u.merge(Vt),Wt=d.extend({method:K(`notifications/tasks/status`),params:Ut}),Gt=l.extend({method:K(`tasks/get`),params:s.extend({taskId:I()})}),Kt=f.merge(Vt),qt=l.extend({method:K(`tasks/result`),params:s.extend({taskId:I()})}),Jt=f.loose(),Yt=ie.extend({method:K(`tasks/list`)}),Xt=ae.extend({tasks:B(Vt)}),Zt=l.extend({method:K(`tasks/cancel`),params:s.extend({taskId:I()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:w,InitializeRequestParamsSchema:T,InitializeRequestSchema:E,ServerCapabilitiesSchema:D,InitializeResultSchema:ee,InitializedNotificationSchema:O,PingRequestSchema:k,ProgressSchema:A,ProgressNotificationParamsSchema:te,ProgressNotificationSchema:ne,PaginatedRequestParamsSchema:re,PaginatedRequestSchema:ie,PaginatedResultSchema:ae,ResourceContentsSchema:oe,TextResourceContentsSchema:se,BlobResourceContentsSchema:j,RoleSchema:le,AnnotationsSchema:ue,ResourceSchema:de,ResourceTemplateSchema:fe,ListResourcesRequestSchema:pe,ListResourcesResultSchema:me,ListResourceTemplatesRequestSchema:he,ListResourceTemplatesResultSchema:ge,ResourceRequestParamsSchema:_e,ReadResourceRequestParamsSchema:M,ReadResourceRequestSchema:N,ReadResourceResultSchema:P,ResourceListChangedNotificationSchema:ve,SubscribeRequestParamsSchema:ye,SubscribeRequestSchema:be,UnsubscribeRequestParamsSchema:xe,UnsubscribeRequestSchema:Se,ResourceUpdatedNotificationParamsSchema:Ce,ResourceUpdatedNotificationSchema:we,PromptArgumentSchema:Te,PromptSchema:Ee,ListPromptsRequestSchema:De,ListPromptsResultSchema:Oe,GetPromptRequestParamsSchema:ke,GetPromptRequestSchema:Ae,TextContentSchema:je,ImageContentSchema:Me,AudioContentSchema:Ne,ToolUseContentSchema:Pe,EmbeddedResourceSchema:Fe,ResourceLinkSchema:Ie,ContentBlockSchema:Le,PromptMessageSchema:Re,GetPromptResultSchema:ze,PromptListChangedNotificationSchema:Be,ToolAnnotationsSchema:Ve,ToolExecutionSchema:He,ToolSchema:Ue,ListToolsRequestSchema:We,ListToolsResultSchema:Ge,CallToolResultSchema:Ke,CallToolRequestParamsSchema:qe,CallToolRequestSchema:Je,ToolListChangedNotificationSchema:Ye,LoggingLevelSchema:Xe,SetLevelRequestParamsSchema:Ze,SetLevelRequestSchema:Qe,LoggingMessageNotificationParamsSchema:$e,LoggingMessageNotificationSchema:et,ModelHintSchema:tt,ModelPreferencesSchema:nt,ToolChoiceSchema:rt,ToolResultContentSchema:F,SamplingContentSchema:it,SamplingMessageContentBlockSchema:at,SamplingMessageSchema:ot,CreateMessageRequestParamsSchema:st,CreateMessageRequestSchema:ct,CreateMessageResultSchema:lt,CreateMessageResultWithToolsSchema:ut,BooleanSchemaSchema:dt,StringSchemaSchema:ft,NumberSchemaSchema:pt,UntitledSingleSelectEnumSchemaSchema:mt,TitledSingleSelectEnumSchemaSchema:ht,LegacyTitledEnumSchemaSchema:gt,SingleSelectEnumSchemaSchema:_t,UntitledMultiSelectEnumSchemaSchema:vt,TitledMultiSelectEnumSchemaSchema:yt,MultiSelectEnumSchemaSchema:bt,EnumSchemaSchema:xt,PrimitiveSchemaDefinitionSchema:St,ElicitRequestFormParamsSchema:Ct,ElicitRequestURLParamsSchema:wt,ElicitRequestParamsSchema:Tt,ElicitRequestSchema:Et,ElicitationCompleteNotificationParamsSchema:Dt,ElicitationCompleteNotificationSchema:Ot,ElicitResultSchema:kt,ResourceTemplateReferenceSchema:At,PromptReferenceSchema:jt,CompleteRequestParamsSchema:Mt,CompleteRequestSchema:Nt,CompleteResultSchema:Pt,RootSchema:Ft,ListRootsRequestSchema:It,ListRootsResultSchema:Lt,RootsListChangedNotificationSchema:Rt,TaskCreationParamsSchema:zt,TaskStatusSchema:Bt,TaskSchema:Vt,CreateTaskResultSchema:Ht,TaskStatusNotificationParamsSchema:Ut,TaskStatusNotificationSchema:Wt,GetTaskRequestSchema:Gt,GetTaskResultSchema:Kt,GetTaskPayloadRequestSchema:qt,GetTaskPayloadResultSchema:Jt,ListTasksRequestSchema:Yt,ListTasksResultSchema:Xt,CancelTaskRequestSchema:Zt,CancelTaskResultSchema:f.merge(Vt),ClientRequestSchema:U([k,E,Nt,Qe,Ae,De,pe,he,N,be,Se,Je,We,Gt,qt,Yt,Zt]),ClientNotificationSchema:U([g,ne,O,Rt,Wt]),ClientResultSchema:U([m,lt,ut,kt,Lt,Kt,Xt,Ht]),ServerRequestSchema:U([k,ct,Et,It,Gt,qt,Yt,Zt]),ServerNotificationSchema:U([g,ne,et,we,ve,Ye,Be,Wt,Ot]),ServerResultSchema:U([m,ee,Pt,ze,Oe,me,ge,P,Ke,Ge,Kt,Xt,Ht]),CallToolResultWireSchema:z().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of Fm)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Im).pipe(Ke)}}var Rm;function zm(){return Rm??=Lm()}function Bm(e){return e.type!==`object`}var Vm=new Set([`const`,`enum`,`default`,`examples`]),Hm=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function Um(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Wm(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(Um(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Zu(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&Um(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Vm.has(o)?s:Hm.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Gm={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Km={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},qm={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Jm;function Ym(){if(Jm)return Jm;let e=zm();return Jm={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Jm}function Xm(e){return Object.prototype.hasOwnProperty.call(Gm,e)}function Zm(e){return Object.prototype.hasOwnProperty.call(Km,e)}function Qm(e){return Object.prototype.hasOwnProperty.call(qm,e)}function $m(e){return Qm(e)?Ym().resultSchemas[e]:void 0}function eh(e){return Xm(e)?Ym().requestSchemas[e]:void 0}function th(e){return Zm(e)?Ym().notificationSchemas[e]:void 0}Object.keys(Gm),Object.keys(Km);function nh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function rh(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ih={ok:!1,reason:`not-in-era`};function ah(e){return nh(e)&&nh(e.outputSchema)&&Bm(e.outputSchema)}function oh(e){return e}var sh={era:`2025-11-25`,hasRequestMethod:Xm,hasNotificationMethod:Zm,validateRequest:(e,t)=>rh(eh(e),t),validateResult:(e,t)=>rh($m(e),t),validateNotification:(e,t)=>rh(th(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ih,validateInputResponse:()=>ih,samplingResultVariant:((e,t)=>{let n=zm();return rh(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=Pm(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&Bm(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(nh(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:oh(e)}}return{kind:`complete`,result:oh(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>ah(e))?t:{...t,tools:n.map(e=>ah(e)?{...e,outputSchema:Wm(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function ch(){let e=ul(()=>U([I(),L(),R(),Tc(),W(I(),e),B(e)])),t=W(I(),e),n=U([I(),L().int()]),r=I(),i=U([I(),L().int()]),a=G([`user`,`assistant`]),o=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=V({ttl:L().optional()}),l=V({taskId:I()}),u=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=V({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=V({_meta:u.optional()}),m=V({method:I(),params:p.loose().optional()}),h=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),g=V({icons:B(h).optional()}),_=V({name:I(),title:I().optional()}),v=_.extend({..._.shape,...g.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),y=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),t).optional(),url:t.optional()}),t.optional())),b=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),x=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),S=V({experimental:W(I(),t).optional(),sampling:V({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:b.optional(),extensions:W(I(),t).optional()}),C=V({experimental:W(I(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:x.optional(),extensions:W(I(),t).optional()}),w=V({progress:L(),total:q(L()),message:q(I())}),T=V({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:K(`notifications/progress`),params:T}),D=p.extend({level:o,logger:I().optional(),data:z()}),ee=m.extend({method:K(`notifications/message`),params:D}),O=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),k=O.extend({text:I()}),A=O.extend({blob:s}),te=V({audience:B(a).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),ne=V({..._.shape,...g.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:te.optional(),_meta:q(H({}))}),re=V({..._.shape,...g.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:te.optional(),_meta:q(H({}))}),ie=m.extend({method:K(`notifications/resources/list_changed`),params:p.optional()}),ae=p.extend({uri:I()}),oe=m.extend({method:K(`notifications/resources/updated`),params:ae}),se=V({name:I(),description:q(I()),required:q(R())}),ce=V({..._.shape,...g.shape,description:q(I()),arguments:q(B(se)),_meta:q(H({}))}),j=m.extend({method:K(`notifications/prompts/list_changed`),params:p.optional()}),le=V({type:K(`text`),text:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),ue=V({type:K(`image`),data:s,mimeType:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),de=V({type:K(`audio`),data:s,mimeType:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),fe=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),pe=V({type:K(`resource`),resource:U([k,A]),annotations:te.optional(),_meta:W(I(),z()).optional()}),me=ne.extend({type:K(`resource_link`)}),he=U([le,ue,de,me,pe]),ge=V({role:a,content:he}),_e=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),M=m.extend({method:K(`notifications/tools/list_changed`),params:p.optional()}),N=V({name:I().optional()}),P=V({hints:B(N).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ve=V({mode:G([`auto`,`required`,`none`]).optional()}),ye=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),be=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),xe=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Se=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),Ce=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),we=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Te=U([Se,Ce]),Ee=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),De=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),Oe=U([Ee,De]),ke=U([we,Te,Oe]),Ae=U([ke,ye,be,xe]),je=f.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),Ae),required:B(I()).optional()}).catchall(z())}),Me=V({type:K(`ref/resource`),uri:I()}),Ne=V({type:K(`ref/prompt`),name:I()}),Pe=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),Fe=S.shape,Ie=V({experimental:Fe.experimental,sampling:Fe.sampling,elicitation:Fe.elicitation,roots:Fe.roots,extensions:Fe.extensions}),Le=C.shape,Re=V({experimental:Le.experimental,logging:Le.logging,completions:Le.completions,prompts:Le.prompts,resources:Le.resources,tools:Le.tools,extensions:Le.extensions}),ze=H({progressToken:n.optional(),[ed]:I(),[td]:v.optional(),[rd]:Ie,[ad]:o.optional()}),Be=V({..._.shape,...g.shape,description:I().optional(),inputSchema:H({$schema:I().optional(),type:K(`object`)}),outputSchema:H({$schema:I().optional()}).optional(),annotations:_e.optional(),_meta:W(I(),z()).optional()}),Ve=V({type:K(`tool_result`),toolUseId:I(),content:B(he),structuredContent:z().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),He=U([le,ue,de,fe,Ve]),Ue=V({role:a,content:U([He,B(He)]),_meta:W(I(),z()).optional()}),We=I(),Ge=H({[nd]:v.optional().catch(void 0)}),Ke=Ge.optional();function qe(e){return H({_meta:Ke,resultType:We.default(`complete`),...e})}let Je=qe({}),Ye=qe({nextCursor:r.optional()}),Xe=qe({content:B(he),structuredContent:z().optional(),isError:R().optional()}),Ze=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),tools:B(Be),nextCursor:r.optional()}),Qe=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),prompts:B(ce),nextCursor:r.optional()}),$e=qe({description:I().optional(),messages:B(ge)}),et=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resources:B(ne),nextCursor:r.optional()}),tt=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resourceTemplates:B(re),nextCursor:r.optional()}),nt=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),contents:B(U([k,A]))}),rt=qe({completion:V({values:B(I()).max(100),total:L().int().optional(),hasMore:R().optional()}).loose()}),F=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`])}),it=qe({ttlMs:L().int().min(0).catch(0),cacheScope:G([`public`,`private`]).catch(`private`),supportedVersions:B(I()),capabilities:Re,instructions:I().optional()}),at=V({messages:B(Ue),modelPreferences:P.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:t.optional(),tools:B(Be).optional(),toolChoice:ve.optional()}),ot=V({method:K(`sampling/createMessage`),params:at}),st=V({method:K(`roots/list`),params:V({_meta:W(I(),z()).optional()}).optional()}),ct=V({...Ue.shape,model:I(),stopReason:I().optional()}),lt=V({roots:B(Pe)}),ut=V({action:G([`accept`,`decline`,`cancel`]),content:W(I(),U([I(),L(),R(),B(I())])).optional()}),dt=V({mode:K(`url`),message:I(),url:I().url()}),ft=U([je,dt]),pt=V({method:K(`elicitation/create`),params:ft}),mt=U([ot,st,pt]),ht=U([ct,lt,ut]),gt=W(I(),mt),_t=W(I(),ht),vt=qe({inputRequests:gt.optional(),requestState:I().optional()}),yt={inputResponses:_t.optional(),requestState:I().optional()},bt=V({_meta:ze,...yt}),xt=H({progressToken:n.optional()});function St(e,t){return V({method:K(e),params:V({_meta:ze,...t})})}function Ct(e,t){return V({method:K(e),params:V({_meta:xt.optional(),...t}).optional()})}let wt={name:I(),arguments:W(I(),z()).optional(),...yt},Tt={cursor:r.optional()},Et=St(`tools/call`,wt),Dt=St(`tools/list`,Tt),Ot=St(`prompts/list`,Tt),kt=St(`prompts/get`,{name:I(),arguments:W(I(),I()).optional(),...yt}),At=St(`resources/list`,Tt),jt=St(`resources/templates/list`,Tt),Mt=St(`resources/read`,{uri:I(),...yt}),Nt={ref:U([Ne,Me]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()},Pt=St(`completion/complete`,Nt),Ft=St(`server/discover`,{}),It=V({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:B(I()).optional()}),Lt={notifications:It},Rt=St(`subscriptions/listen`,Lt),zt=Ge.extend({"io.modelcontextprotocol/subscriptionId":i}),Bt=H({_meta:zt,resultType:We.default(`complete`)}),Vt={"tools/call":Ct(`tools/call`,wt),"tools/list":Ct(`tools/list`,Tt),"prompts/get":Ct(`prompts/get`,{name:I(),arguments:W(I(),I()).optional()}),"prompts/list":Ct(`prompts/list`,Tt),"resources/list":Ct(`resources/list`,Tt),"resources/templates/list":Ct(`resources/templates/list`,Tt),"resources/read":Ct(`resources/read`,{uri:I()}),"completion/complete":Ct(`completion/complete`,Nt),"server/discover":Ct(`server/discover`,{}),"subscriptions/listen":Ct(`subscriptions/listen`,Lt)};function Ht(e){return H({_meta:Ke,...e})}let Ut={"tools/call":Ht({content:B(he),structuredContent:z().optional(),isError:R().optional()}),"tools/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),tools:B(Be),nextCursor:r.optional()}),"prompts/get":Ht({description:I().optional(),messages:B(ge)}),"prompts/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),prompts:B(ce),nextCursor:r.optional()}),"resources/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resources:B(ne),nextCursor:r.optional()}),"resources/templates/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resourceTemplates:B(re),nextCursor:r.optional()}),"resources/read":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),contents:B(U([k,A]))}),"completion/complete":Ht({completion:V({values:B(I()).max(100),total:L().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":Ht({ttlMs:L().int().min(0).catch(0),cacheScope:G([`public`,`private`]).catch(`private`),supportedVersions:B(I()),capabilities:Re,instructions:I().optional()}),"subscriptions/listen":Ht({})},Wt=H({"io.modelcontextprotocol/subscriptionId":i.optional()}),Gt=V({method:K(`notifications/subscriptions/acknowledged`),params:V({_meta:Wt.optional(),notifications:It})}),Kt=V({_meta:Wt.optional(),requestId:i,reason:I().optional()}),qt=V({method:K(`notifications/cancelled`),params:Kt}),Jt={"notifications/cancelled":qt,"notifications/progress":E,"notifications/message":ee,"notifications/resources/updated":oe,"notifications/resources/list_changed":ie,"notifications/tools/list_changed":M,"notifications/prompts/list_changed":j,"notifications/subscriptions/acknowledged":Gt},Yt=e=>V({jsonrpc:K(`2.0`),id:U([I(),L().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:C,ProgressSchema:w,ProgressNotificationParamsSchema:T,ProgressNotificationSchema:E,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:ee,ResourceContentsSchema:O,TextResourceContentsSchema:k,BlobResourceContentsSchema:A,AnnotationsSchema:te,ResourceSchema:ne,ResourceTemplateSchema:re,ResourceListChangedNotificationSchema:ie,ResourceUpdatedNotificationParamsSchema:ae,ResourceUpdatedNotificationSchema:oe,PromptArgumentSchema:se,PromptSchema:ce,PromptListChangedNotificationSchema:j,TextContentSchema:le,ImageContentSchema:ue,AudioContentSchema:de,ToolUseContentSchema:fe,EmbeddedResourceSchema:pe,ResourceLinkSchema:me,ContentBlockSchema:he,PromptMessageSchema:ge,ToolAnnotationsSchema:_e,ToolListChangedNotificationSchema:M,ModelHintSchema:N,ModelPreferencesSchema:P,ToolChoiceSchema:ve,BooleanSchemaSchema:ye,StringSchemaSchema:be,NumberSchemaSchema:xe,UntitledSingleSelectEnumSchemaSchema:Se,TitledSingleSelectEnumSchemaSchema:Ce,LegacyTitledEnumSchemaSchema:we,SingleSelectEnumSchemaSchema:Te,UntitledMultiSelectEnumSchemaSchema:Ee,TitledMultiSelectEnumSchemaSchema:De,MultiSelectEnumSchemaSchema:Oe,EnumSchemaSchema:ke,PrimitiveSchemaDefinitionSchema:Ae,ElicitRequestFormParamsSchema:je,ResourceTemplateReferenceSchema:Me,PromptReferenceSchema:Ne,RootSchema:Pe,ClientCapabilities2026Schema:Ie,ServerCapabilities2026Schema:Re,RequestMetaEnvelopeSchema:ze,ToolSchema:Be,ToolResultContentSchema:Ve,SamplingMessageContentBlockSchema:He,SamplingMessageSchema:Ue,ResultTypeSchema:We,ResultMetaSchema:Ge,ResultSchema:Je,PaginatedResultSchema:Ye,CallToolResultSchema:Xe,ListToolsResultSchema:Ze,ListPromptsResultSchema:Qe,GetPromptResultSchema:$e,ListResourcesResultSchema:et,ListResourceTemplatesResultSchema:tt,ReadResourceResultSchema:nt,CompleteResultSchema:rt,CacheableResultSchema:F,DiscoverResultSchema:it,CreateMessageRequestParamsSchema:at,CreateMessageRequestSchema:ot,ListRootsRequestSchema:st,CreateMessageResultSchema:ct,ListRootsResultSchema:lt,ElicitResultSchema:ut,ElicitRequestURLParamsSchema:dt,ElicitRequestParamsSchema:ft,ElicitRequestSchema:pt,InputRequestSchema:mt,InputResponseSchema:ht,InputRequestsSchema:gt,InputResponsesSchema:_t,InputRequiredResultSchema:vt,InputResponseRequestParamsSchema:bt,CallToolRequestSchema:Et,ListToolsRequestSchema:Dt,ListPromptsRequestSchema:Ot,GetPromptRequestSchema:kt,ListResourcesRequestSchema:At,ListResourceTemplatesRequestSchema:jt,ReadResourceRequestSchema:Mt,CompleteRequestSchema:Pt,DiscoverRequestSchema:Ft,SubscriptionFilterSchema:It,SubscriptionsListenRequestSchema:Rt,SubscriptionsListenResultMetaSchema:zt,SubscriptionsListenResultSchema:Bt,dispatchRequestSchemas:Vt,dispatchResultSchemas:Ut,NotificationMetaSchema:Wt,SubscriptionsAcknowledgedNotificationSchema:Gt,CancelledNotificationParamsSchema:Kt,CancelledNotificationSchema:qt,notificationSchemas2026:Jt,JSONRPCResultResponseSchema:Yt(Je),CallToolResultResponseSchema:Yt(U([Xe,vt])),ListToolsResultResponseSchema:Yt(Ze),ListPromptsResultResponseSchema:Yt(Qe),GetPromptResultResponseSchema:Yt(U([$e,vt])),ListResourcesResultResponseSchema:Yt(et),ListResourceTemplatesResultResponseSchema:Yt(tt),ReadResourceResultResponseSchema:Yt(U([nt,vt])),CompleteResultResponseSchema:Yt(rt),DiscoverResultResponseSchema:Yt(it)}}var lh;function uh(){return lh??=ch()}var dh=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function fh(e){return dh.includes(e)}var ph=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function mh(e){return e[ph]}function hh(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function gh(e){return e===`public`||e===`private`}var _h=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),vh=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Om(this,new.target)}static fromError(t,n,r){if(t===_h.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new bh(e.elicitations,n)}if(t===_h.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new xh({supported:e.supported,requested:e.requested},n)}if(t===_h.InvalidParams||t===_h.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===_h.ResourceNotFound||Object.keys(e).length===1))return new yh(e.uri,n)}if(t===_h.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Sh({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},yh=class extends vh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(_h.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},bh=class extends vh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(_h.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},xh=class extends vh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(_h.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Sh=class extends vh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(_h.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Ch=0,wh=`private`,Th=[`tools/call`,`prompts/get`,`resources/read`];function Eh(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Th.includes(e))return t;throw new vh(_h.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Dh(e,t){let n=mh(t);if(t.resultType!==`complete`||!fh(e))return n===void 0?t:Mh(t);let r=t,i=hh(r.ttlMs)?r.ttlMs:Ah(n),a=gh(r.cacheScope)?r.cacheScope:jh(n),o={...r,ttlMs:i,cacheScope:a};return delete o[ph],o}function Oh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kh(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[nd]:t}}:!Oh(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[nd]:t}}}function Ah(e){return e!==void 0&&hh(e.ttlMs)?e.ttlMs:Ch}function jh(e){return e!==void 0&&gh(e.cacheScope)?e.cacheScope:wh}function Mh(e){let t={...e};return delete t[ph],t}var Nh=[`elicitation/create`,`sampling/createMessage`,`roots/list`],Ph;function Fh(){if(Ph)return Ph;let e=uh();return Ph={request:{"elicitation/create":V({method:K(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":V({method:K(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":V({method:K(`roots/list`),params:H({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Ph}function Ih(e){return Nh.includes(e)}function Lh(e){return Ih(e)?Fh().request[e]:void 0}function Rh(e){return Ih(e)?Fh().response[e]:void 0}var zh={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Bh={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Vh(e){return Object.prototype.hasOwnProperty.call(zh,e)}function Hh(e){return Object.prototype.hasOwnProperty.call(Bh,e)}function Uh(e){return Object.prototype.hasOwnProperty.call(zh,e)}function Wh(e){return Vh(e)?uh().dispatchRequestSchemas[e]:void 0}function Gh(e){return Uh(e)?uh().dispatchResultSchemas[e]:void 0}function Kh(e){return Hh(e)?uh().notificationSchemas2026[e]:void 0}Object.keys(zh),Object.keys(Bh);function qh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jh(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Yh={ok:!1,reason:`not-in-era`},Xh=[ed,rd];function Zh(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>qh(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!qh(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(qh(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Qh={era:`2026-07-28`,hasRequestMethod:Vh,hasNotificationMethod:Hh,hasInputRequestMethod:e=>Lh(e)!==void 0,validateRequest:(e,t)=>Jh(Wh(e),t),validateResult:(e,t)=>Jh(Gh(e),t),validateNotification:(e,t)=>Jh(Kh(e),t),validateInputRequest:(e,t)=>Jh(Lh(e),t),validateInputResponse:(e,t)=>Jh(Rh(e),t),samplingResultVariant:()=>Yh,outboundEnvelope(e){return{[ed]:e.protocolVersion,[td]:e.clientInfo,[rd]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Xh)n in e||t.push({key:n,problem:`missing`});let n=uh().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>Pm(e),inputRequestSchema:Lh,decodeResult(e,t){if(!qh(t))return{kind:`invalid`,error:new jm(Am.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new jm(Am.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new jm(Am.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=qh(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:uh().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new jm(Am.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new jm(Am.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=eg(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new jm(Am.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return kh(Dh(e,Eh(e,Zh(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=uh().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},$h;function eg(){if($h)return $h;let e=uh();return $h={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},$h}var tg=`2026-07-28`;function ng(e){return e!==void 0&&Nm(e)?Qh:sh}function rg(e){return e.revision===void 0?e.era===`modern`?Qh.era:sh.era:ng(e.revision).era}function ig(e){return og.some(t=>t.hasRequestMethod(e))}function ag(e){return og.some(t=>t.hasNotificationMethod(e))}var og=[sh,Qh],sg=Yu({AnnotationsSchema:()=>af,AudioContentSchema:()=>Rf,BaseMetadataSchema:()=>Nd,BaseRequestParamsSchema:()=>md,BlobResourceContentsSchema:()=>nf,BooleanSchemaSchema:()=>yp,CallToolRequestParamsSchema:()=>$f,CallToolRequestSchema:()=>ep,CallToolResultSchema:()=>Zf,CancelTaskRequestSchema:()=>am,CancelTaskResultSchema:()=>om,CancelledNotificationParamsSchema:()=>kd,CancelledNotificationSchema:()=>Ad,ClientCapabilitiesSchema:()=>Rd,ClientNotificationSchema:()=>cm,ClientRequestSchema:()=>sm,ClientResultSchema:()=>lm,ClientTasksCapabilitySchema:()=>Id,CompatibilityCallToolResultSchema:()=>Qf,CompleteRequestParamsSchema:()=>Bp,CompleteRequestSchema:()=>Vp,CompleteResultSchema:()=>Hp,ContentBlockSchema:()=>Hf,CreateMessageRequestParamsSchema:()=>hp,CreateMessageRequestSchema:()=>gp,CreateMessageResultSchema:()=>_p,CreateMessageResultWithToolsSchema:()=>vp,CreateTaskResultSchema:()=>Xp,CursorSchema:()=>ud,DiscoverRequestSchema:()=>Wd,DiscoverResultSchema:()=>Gd,ElicitRequestFormParamsSchema:()=>jp,ElicitRequestParamsSchema:()=>Np,ElicitRequestSchema:()=>Pp,ElicitRequestURLParamsSchema:()=>Mp,ElicitResultSchema:()=>Lp,ElicitationCompleteNotificationParamsSchema:()=>Fp,ElicitationCompleteNotificationSchema:()=>Ip,EmbeddedResourceSchema:()=>Bf,EmptyResultSchema:()=>Od,EnumSchemaSchema:()=>kp,GetPromptRequestParamsSchema:()=>Pf,GetPromptRequestSchema:()=>Ff,GetPromptResultSchema:()=>Wf,GetTaskPayloadRequestSchema:()=>tm,GetTaskPayloadResultSchema:()=>nm,GetTaskRequestSchema:()=>$p,GetTaskResultSchema:()=>em,IconSchema:()=>jd,IconsSchema:()=>Md,ImageContentSchema:()=>Lf,ImplementationSchema:()=>Pd,InitializeRequestParamsSchema:()=>zd,InitializeRequestSchema:()=>Bd,InitializeResultSchema:()=>Hd,InitializedNotificationSchema:()=>Ud,JSONArraySchema:()=>cd,JSONObjectSchema:()=>sd,JSONRPCErrorResponseSchema:()=>Td,JSONRPCMessageSchema:()=>Ed,JSONRPCNotificationSchema:()=>Cd,JSONRPCRequestSchema:()=>Sd,JSONRPCResponseSchema:()=>Dd,JSONRPCResultResponseSchema:()=>wd,JSONValueSchema:()=>od,LegacyTitledEnumSchemaSchema:()=>wp,ListChangedOptionsBaseSchema:()=>np,ListPromptsRequestSchema:()=>Mf,ListPromptsResultSchema:()=>Nf,ListResourceTemplatesRequestSchema:()=>uf,ListResourceTemplatesResultSchema:()=>df,ListResourcesRequestSchema:()=>cf,ListResourcesResultSchema:()=>lf,ListRootsRequestSchema:()=>Wp,ListRootsResultSchema:()=>Gp,ListTasksRequestSchema:()=>rm,ListTasksResultSchema:()=>im,ListToolsRequestSchema:()=>Yf,ListToolsResultSchema:()=>Xf,LoggingLevelSchema:()=>rp,LoggingMessageNotificationParamsSchema:()=>op,LoggingMessageNotificationSchema:()=>sp,ModelHintSchema:()=>cp,ModelPreferencesSchema:()=>lp,MultiSelectEnumSchemaSchema:()=>Op,NotificationSchema:()=>vd,NotificationsParamsSchema:()=>_d,NumberSchemaSchema:()=>xp,PaginatedRequestParamsSchema:()=>Xd,PaginatedRequestSchema:()=>Zd,PaginatedResultSchema:()=>Qd,PingRequestSchema:()=>Kd,PrimitiveSchemaDefinitionSchema:()=>Ap,ProgressNotificationParamsSchema:()=>Jd,ProgressNotificationSchema:()=>Yd,ProgressSchema:()=>qd,ProgressTokenSchema:()=>ld,PromptArgumentSchema:()=>Af,PromptListChangedNotificationSchema:()=>Gf,PromptMessageSchema:()=>Uf,PromptReferenceSchema:()=>zp,PromptSchema:()=>jf,ReadResourceRequestParamsSchema:()=>pf,ReadResourceRequestSchema:()=>mf,ReadResourceResultSchema:()=>hf,RelatedTaskMetadataSchema:()=>fd,RequestIdSchema:()=>xd,RequestMetaSchema:()=>pd,RequestSchema:()=>gd,ResourceContentsSchema:()=>$d,ResourceLinkSchema:()=>Vf,ResourceListChangedNotificationSchema:()=>gf,ResourceRequestParamsSchema:()=>ff,ResourceSchema:()=>of,ResourceTemplateReferenceSchema:()=>Rp,ResourceTemplateSchema:()=>sf,ResourceUpdatedNotificationParamsSchema:()=>Of,ResourceUpdatedNotificationSchema:()=>kf,ResultMetaObjectSchema:()=>yd,ResultSchema:()=>bd,RoleSchema:()=>rf,RootSchema:()=>Up,RootsListChangedNotificationSchema:()=>Kp,SamplingContentSchema:()=>fp,SamplingMessageContentBlockSchema:()=>pp,SamplingMessageSchema:()=>mp,ServerCapabilitiesSchema:()=>Vd,ServerNotificationSchema:()=>dm,ServerRequestSchema:()=>um,ServerResultSchema:()=>fm,ServerTasksCapabilitySchema:()=>Ld,SetLevelRequestParamsSchema:()=>ip,SetLevelRequestSchema:()=>ap,SingleSelectEnumSchemaSchema:()=>Tp,StringSchemaSchema:()=>bp,SubscribeRequestParamsSchema:()=>_f,SubscribeRequestSchema:()=>vf,SubscriptionFilterSchema:()=>xf,SubscriptionsAcknowledgedNotificationParamsSchema:()=>wf,SubscriptionsAcknowledgedNotificationSchema:()=>Tf,SubscriptionsListenRequestParamsSchema:()=>Sf,SubscriptionsListenRequestSchema:()=>Cf,SubscriptionsListenResultMetaSchema:()=>Ef,SubscriptionsListenResultSchema:()=>Df,TaskAugmentedRequestParamsSchema:()=>hd,TaskCreationParamsSchema:()=>qp,TaskMetadataSchema:()=>dd,TaskSchema:()=>Yp,TaskStatusNotificationParamsSchema:()=>Zp,TaskStatusNotificationSchema:()=>Qp,TaskStatusSchema:()=>Jp,TextContentSchema:()=>If,TextResourceContentsSchema:()=>ef,TitledMultiSelectEnumSchemaSchema:()=>Dp,TitledSingleSelectEnumSchemaSchema:()=>Cp,ToolAnnotationsSchema:()=>Kf,ToolChoiceSchema:()=>up,ToolExecutionSchema:()=>qf,ToolListChangedNotificationSchema:()=>tp,ToolResultContentSchema:()=>dp,ToolSchema:()=>Jf,ToolUseContentSchema:()=>zf,UnsubscribeRequestParamsSchema:()=>yf,UnsubscribeRequestSchema:()=>bf,UntitledMultiSelectEnumSchemaSchema:()=>Ep,UntitledSingleSelectEnumSchemaSchema:()=>Sp}),cg=e=>Sd.safeParse(e).success,lg=e=>Cd.safeParse(e).success,ug=e=>wd.safeParse(e).success,dg=e=>Td.safeParse(e).success;_h.InvalidRequest,_h.UnsupportedProtocolVersion,_h.InvalidParams,_h.MethodNotFound,_h.InvalidParams,_h.MissingRequiredClientCapability,_h.ParseError,_h.InvalidRequest,_h.MethodNotFound,_h.UnsupportedProtocolVersion,_h.MissingRequiredClientCapability;function fg(e,t){return js(e,t)}function pg(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function mg(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var hg=!1,gg=`draft-2020-12`;function _g(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:gg});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);hg||(hg=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=Ts(e,{target:gg,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&vg(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function vg(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||vg(e)))}return!1}function yg(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function bg(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>yg(e)).join(`, `)}:{success:!0,data:n.value}}function xg(e){let t=Ts(e,{target:gg,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var Sg=/\\\.\\d\{(\d+)\}/;function Cg(e){let t=Sg.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>_l({local:e,offset:t,precision:n}))))}function wg(e,t){let n;switch(e){case`email`:n=[Qs()];break;case`uri`:n=[nc()];break;case`date`:n=[vl()];break;case`date-time`:n=Cg(t)}return new Set(n.map(e=>xg(e)).filter(e=>e!==void 0))}function Tg(e,t,n){return n!==`zod`||wg(e,t).has(t)}function Eg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Dg(e){try{return _g(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new vh(_h.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Og=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function kg(e){return Og.has(e)||e.startsWith(`x-`)}var Ag=new Set([`$schema`,...Object.keys(jp.shape.requestedSchema.shape)]),jg={string:pg([bp,Sp,Cp,wp]),number:pg([xp]),integer:pg([xp]),boolean:pg([yp]),array:pg([Ep,Dp])},Mg=new Set(bp.shape.format.unwrap().options);function Ng(e,t,n,r){if(!Eg(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(jg,e.type)?jg[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||kg(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Mg.has(e.format)?(typeof s!=`string`||!Tg(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Pg(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&Eg(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Ng(n,`properties.${e}`,t,r)])):Ag.has(i)?n[i]=a:kg(i)||r.push(i);if(r.length>0)throw new vh(_h.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Fg(e,t){if(!Eg(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!fg(Ap,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Ig(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Ig(e,t[r],`${n}[${r}]`)):!Eg(e)||!Eg(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Ig(r,t[e],i):kg(e)?[]:[i]})}function Lg(e){if(!mg(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Pg(Dg(e.requestedSchema),t),r=fg(jp.shape.requestedSchema,n);if(!r.success)throw new vh(_h.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Fg(n,r.error.message)}`);let i=Ig(n,r.data);if(i.length>0)throw new vh(_h.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new vh(_h.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Rg(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Rg,{elicit(e){try{return{method:`elicitation/create`,params:Lg(e)}}catch(e){throw e instanceof vh?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var zg=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Bg={IdJagTokenExchangeResponseSchema:ym,OAuthClientInformationFullSchema:wm,OAuthClientInformationSchema:Cm,OAuthClientMetadataSchema:Sm,OAuthClientRegistrationErrorSchema:Tm,OAuthErrorResponseSchema:bm,OAuthMetadataSchema:hm,OAuthProtectedResourceMetadataSchema:mm,OAuthTokenRevocationRequestSchema:Em,OAuthTokensSchema:vm,OpenIdProviderDiscoveryMetadataSchema:_m,OpenIdProviderMetadataSchema:gm},Vg={},Hg={};function Ug(e,t){let n=e.slice(0,-6);Vg[n]=t,Hg[n]=e=>t.safeParse(e).success}for(let e of zg)Ug(e,sg[e]);for(let[e,t]of Object.entries(Bg))Ug(e,t);Object.freeze(Vg),Object.freeze(Hg);function Wg(e){switch(e){case`initialize`:case`notifications/initialized`:return ng(void 0);case`server/discover`:return ng(tg);default:return}}var Gg=[ed,td,rd,ad],Kg=[`inputResponses`,`requestState`];function qg(e,t){let n=e.params;if(!Qg(n))return{message:e,lifted:{}};let r=n._meta,i=Qg(r)?Gg.filter(e=>e in r):[],a=t===`request`?Kg.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Qg(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Jg(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Yg(e){return()=>e}var Xg=Yg(void 0),Zg=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Qu,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new jm(Am.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new jm(Am.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),ug(e)||dg(e)?this._onresponse(e):cg(e)?this._onrequest(e,t):lg(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new jm(Am.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=qg(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=rg(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(ag(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=qg(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=rg(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(_h.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(ig(n.method)&&!i.hasRequestMethod(n.method)){o(_h.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(_h.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(_h.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:e_(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Xg:Yg(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),mg(t))return u(e,t,n);let i=Jg(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(_h.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:_h.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),ug(e)?n(e):n(vh.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),mg(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Jg(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ng(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Wg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ig(t)&&!e.hasRequestMethod(t))throw new jm(Am.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof jm?e:new jm(Am.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof jm?e:new jm(Am.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(t_(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;bg(n,o).then(e=>{e.success?d(e.data):f(new jm(Am.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new jm(Am.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new jm(Am.NotConnected,`Not connected`);if(ag(t.method)&&!e.hasNotificationMethod(t.method))throw new jm(Am.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!ig(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new vh(_h.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await bg(t.params,{...r.params});if(!a.success)throw new vh(_h.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!ag(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new vh(_h.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await bg(t.params,{...r.params});if(!i.success)throw new vh(_h.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Qg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function e_(e){let t={},n=[];if(!$g(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!$g(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function t_(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}Ju((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);var n_=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,r_=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,i_=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,a_=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,o_=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,s_=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,c_=/^(?:\/(?:[^~/]|~0|~1)*)*$/,l_=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,u_=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,d_=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,f_=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function p_(e){return e.test.bind(e)}m_.bind(void 0,!1),p_(i_),p_(a_),p_(o_),p_(r_),p_(d_),p_(f_),p_(s_),p_(c_),p_(l_),p_(u_);function m_(e,t){let n=t.match(n_);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}globalThis.crypto;var h_,g_,__,v_,y_,b_=o((()=>{h_=`modulepreload`,g_=function(e,t){return new URL(e,t).href},__={},v_=function(e){return e.pathname.endsWith(`.css`)},y_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=g_(t,n);let r=s(t);if(r.href in __)return;__[r.href]=!0;let i=v_(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:h_,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}})),x_=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e){super(e),this.name=new.target.name,Om(this,new.target)}};(class extends x_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}}),class extends x_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},class extends x_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends x_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},class extends x_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Om(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return km(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return km(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Om(this,new.target)}};var S_=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},C_=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},w_=new Set;function T_(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;w_.has(o)||(w_.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},E_(t)):e=>s({method:a,params:e})]}function E_(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var D_=`2026-01-26`,O_=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Ed.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},k_=U([K(`light`),K(`dark`)]).describe(`Color theme preference for the host environment.`),A_=U([K(`inline`),K(`fullscreen`),K(`pip`)]).describe(`Display mode for UI presentation.`),j_=W(U([K(`--color-background-primary`),K(`--color-background-secondary`),K(`--color-background-tertiary`),K(`--color-background-inverse`),K(`--color-background-ghost`),K(`--color-background-info`),K(`--color-background-danger`),K(`--color-background-success`),K(`--color-background-warning`),K(`--color-background-disabled`),K(`--color-text-primary`),K(`--color-text-secondary`),K(`--color-text-tertiary`),K(`--color-text-inverse`),K(`--color-text-ghost`),K(`--color-text-info`),K(`--color-text-danger`),K(`--color-text-success`),K(`--color-text-warning`),K(`--color-text-disabled`),K(`--color-border-primary`),K(`--color-border-secondary`),K(`--color-border-tertiary`),K(`--color-border-inverse`),K(`--color-border-ghost`),K(`--color-border-info`),K(`--color-border-danger`),K(`--color-border-success`),K(`--color-border-warning`),K(`--color-border-disabled`),K(`--color-ring-primary`),K(`--color-ring-secondary`),K(`--color-ring-inverse`),K(`--color-ring-info`),K(`--color-ring-danger`),K(`--color-ring-success`),K(`--color-ring-warning`),K(`--font-sans`),K(`--font-mono`),K(`--font-weight-normal`),K(`--font-weight-medium`),K(`--font-weight-semibold`),K(`--font-weight-bold`),K(`--font-text-xs-size`),K(`--font-text-sm-size`),K(`--font-text-md-size`),K(`--font-text-lg-size`),K(`--font-heading-xs-size`),K(`--font-heading-sm-size`),K(`--font-heading-md-size`),K(`--font-heading-lg-size`),K(`--font-heading-xl-size`),K(`--font-heading-2xl-size`),K(`--font-heading-3xl-size`),K(`--font-text-xs-line-height`),K(`--font-text-sm-line-height`),K(`--font-text-md-line-height`),K(`--font-text-lg-line-height`),K(`--font-heading-xs-line-height`),K(`--font-heading-sm-line-height`),K(`--font-heading-md-line-height`),K(`--font-heading-lg-line-height`),K(`--font-heading-xl-line-height`),K(`--font-heading-2xl-line-height`),K(`--font-heading-3xl-line-height`),K(`--border-radius-xs`),K(`--border-radius-sm`),K(`--border-radius-md`),K(`--border-radius-lg`),K(`--border-radius-xl`),K(`--border-radius-full`),K(`--border-width-regular`),K(`--shadow-hairline`),K(`--shadow-sm`),K(`--shadow-md`),K(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function so(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;so(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var co=new Set([`type`,`properties`,`required`,`additionalProperties`]),lo=[`oneOf`,`anyOf`];function uo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function fo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!co.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??uo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}A(n,r,e.length===1?e[0]:fo(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=uo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function po(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of co)if(t in e)return;let n=t.filter(e=>lo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=fo(t);else{let e=n[0],i=lo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>fo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,to(e,r))}function mo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):to(i,s),to(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())so(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])po(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}to(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,A(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:_o(t,`input`,e.processors),output:_o(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ho(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ho(r.element,n);if(r.type===`set`)return ho(r.valueType,n);if(r.type===`lazy`)return ho(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return ho(r.innerType,n);if(r.type===`intersection`)return ho(r.left,n)||ho(r.right,n);if(r.type===`record`||r.type===`map`)return ho(r.keyType,n)||ho(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ho(r.in,n)||ho(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ho(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ho(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ho(e,n))return!0;return!!(r.rest&&ho(r.rest,n))}return!1}var go=(e,t={})=>n=>{let r=no({...n,processors:t});return io(e,r),oo(r,e),mo(r,e)},_o=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=no({...i??{},target:a,io:t,processors:n});return io(e,o),oo(o,e),mo(o,e)},vo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},yo=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},bo=(e,t)=>{vo(e,`minimum`,t),yo(e,`maximum`,t)},xo=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},So=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Co=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},wo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},To=(e,t)=>vo(e,`minimum`,t.minimum),Eo=(e,t)=>yo(e,`maximum`,t.maximum),Do=e=>(t,n)=>{wo(t,n.format);let[r,i]=e[n.format];vo(t,`minimum`,r),yo(t,`maximum`,i)},Oo={greater_than:(e,t)=>vo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>yo(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>xo(e,t.value),number_format:Do(ve),bigint_format:Do(ye),min_length:To,max_length:Eo,length_equals:(e,t)=>bo(e,t.length),min_size:To,max_size:Eo,size_equals:(e,t)=>bo(e,t.size),string_format:(e,t)=>{wo(e,t.format),t.pattern&&So(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Co(e,t.mime)};function ko(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Oo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&vo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&vo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&yo(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&yo(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&xo(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Co(t,i.mime);for(let e of i.patterns??[])So(t,e);return t}var Ao={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},jo=new Map([[Sr,en],[wr,tn]]),Mo=e=>jo.get(e)??e,No=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ko(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ao[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Mo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Po=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ko(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ro(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Fo=(e,t,n,r)=>{n.type=`boolean`},Io=(e,t,n,r)=>{ro(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{ro(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},zo=(e,t,n,r)=>{ro(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{ro(e,t,n,r,`Void cannot be represented in JSON Schema`)},Vo=(e,t,n,r)=>{n.not={}},Ho=(e,t,n,r)=>{},Uo=(e,t,n,r)=>{},Wo=(e,t,n,r)=>{ro(e,t,n,r,`Date cannot be represented in JSON Schema`)},Go=(e,t,n,r)=>{let i=e._zod.def,a=x(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ko=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(ro(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(ro(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},qo=(e,t,n,r)=>{ro(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Jo=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Yo=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=ko(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Xo=(e,t,n,r)=>{n.type=`boolean`},Zo=(e,t,n,r)=>{ro(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Qo=(e,t,n,r)=>{ro(e,t,n,r,`Function types cannot be represented in JSON Schema`)},$o=(e,t,n,r)=>{ro(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},es=(e,t,n,r)=>{ro(e,t,n,r,`Map cannot be represented in JSON Schema`)},ts=(e,t,n,r)=>{ro(e,t,n,r,`Set cannot be represented in JSON Schema`)},ns=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ko(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=io(a.element,t,{...r,path:[...r.path,`items`]})};function rs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?rs(t.out):t.type===`catch`?rs(t.innerType):e._zod.optin}var is=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ro(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)A(i.properties,e,io(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?rs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=io(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},as=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>io(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},os=(e,t,n,r)=>{let i=e._zod.def,a=io(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=io(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},ss=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>io(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?io(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?rs(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=ko(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function cs(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=cs(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>cs(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?mn:pn).source),p):p}var ls=new WeakMap;function us(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of ls.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=cs(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var ds=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ko(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=io(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)A(i.patternProperties,Mo(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=io(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=ls.get(t);n||(n=[],ls.set(t,n),t.deferred.push(()=>us(t))),n.push(e)}i.additionalProperties=io(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&rs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},fs=(e,t,n,r)=>{let i=e._zod.def,a=io(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ps=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ms=Symbol();function hs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ro(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ms):JSON.parse(o)}var gs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=hs(i.defaultValue,e,t,n,r);o!==ms&&(n.default=o)},_s=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=hs(i.defaultValue,e,t,n,r);o!==ms&&(n._prefault=o)},vs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ro(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ys=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;io(o,t,r);let s=t.seen.get(e);s.ref=o},bs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},xs=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ss=(e,t,n,r)=>{let i=e._zod.def;io(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Cs=(e,t,n,r)=>{let i=e._zod.innerType;io(i,t,r);let a=t.seen.get(e);a.ref=i},ws={string:No,number:Po,boolean:Fo,bigint:Io,symbol:Lo,null:Ro,undefined:zo,void:Bo,never:Vo,any:Ho,unknown:Uo,date:Wo,enum:Go,literal:Ko,nan:qo,template_literal:Jo,file:Yo,success:Xo,custom:Zo,function:Qo,transform:$o,map:es,set:ts,array:ns,object:is,union:as,intersection:os,tuple:ss,record:ds,nullable:fs,nonoptional:ps,default:gs,prefault:_s,catch:vs,pipe:ys,readonly:bs,promise:xs,optional:Ss,lazy:Cs};function Ts(e,t){if(`_idmap`in e){let n=e,r=no({...t,processors:ws}),i={};for(let e of n._idmap.entries()){let[t,n]=e;io(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;oo(r,n),A(a,t,mo(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=no({...t,processors:ws});return io(e,n),oo(n,e),mo(n,e)}var Es=new WeakSet([Object.prototype,Error.prototype]);function Ds(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Os=F(`ZodError`,(e,t)=>{mt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Es.has(n)||(Es.add(n),Ds(n,`format`,e=>t=>_t(e,t)),Ds(n,`flatten`,e=>t=>gt(e,t)),Ds(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,C,2)}),Ds(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,C,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ks=yt(Os),As=bt(Os),js=xt(Os),Ms=Ct(Os),Ns=kt(Os),Ps=At(Os),Fs=jt(Os),Is=Mt(Os),Ls=Nt(Os),Rs=Pt(Os),zs=Ft(Os),Bs=It(Os);function Vs(){ot.localeError||st(Ui())}function Hs(){ot.memoizer||st({memoizer:Bi()})}var Us=F(`ZodType`,(e,t)=>(Vs(),Bn.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(se(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return _e(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fl(e,t))},superRefine(e,t){return this.check(pl(e,t))},overwrite(e){return this.check(Ga(e))},optional(){return q(this)},exactOptional(){return Gc(this)},nullable(){return qc(this)},nullish(){return q(qc(this))},nonoptional(e){return $c(this,e)},array(){return B(this)},or(e){return U([this,e])},and(e){return Lc(this,e)},transform(e){return rl(this,Hc(e))},default(e){return Yc(this,e)},prefault(e){return Zc(this,e)},catch(e){return tl(this,e)},pipe(e){return rl(this,e)},readonly(){return ol(this)},describe(e){let t=this.clone();return qi.add(t,{description:e}),t},meta(...e){if(e.length===0)return qi.get(this);let t=this.clone();return qi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return He(this,`~standard`,{...Un(this),jsonSchema:{input:_o(this,`input`),output:_o(this,`output`)}})},set"~standard"(e){Ve(this,`~standard`,e)},parse:function e(t,n){return ks(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await As(this,t,n,{callee:e})},safeParse(e,t){return js(this,e,t)},async safeParseAsync(e,t){return Ms(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ve(this,`spa`,e)},validate(e,t){return Et(this,e,t)},validateAsync(e,t){return Ot(this,e,t)},encode:function e(t,n){return Ns(this,t,n,{callee:e})},decode:function e(t,n){return Ps(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Fs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Is(this,t,n,{callee:e})},safeEncode(e,t){return Ls(this,e,t)},safeDecode(e,t){return Rs(this,e,t)},async safeEncodeAsync(e,t){return zs(this,e,t)},async safeDecodeAsync(e,t){return Bs(this,e,t)},toJSONSchema(e){return go(this,{})(e)},get description(){return qi.get(this)?.description},get _def(){return this._zod.def}}),Ws=F(`_ZodString`,(e,t)=>{Wn.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r)},Ue({format:e=>ko(e).format??null,minLength:e=>ko(e).minimum??null,maxLength:e=>ko(e).maximum??null},{regex(...e){return this.check(za(...e))},includes(...e){return this.check(Ha(...e))},startsWith(...e){return this.check(Ua(...e))},endsWith(...e){return this.check(Wa(...e))},min(...e){return this.check(La(...e))},max(...e){return this.check(Ia(...e))},length(...e){return this.check(Ra(...e))},nonempty(...e){return this.check(La(1,...e))},lowercase(e){return this.check(Ba(e))},uppercase(e){return this.check(Va(e))},trim(){return this.check(qa())},normalize(...e){return this.check(Ka(...e))},toLowerCase(){return this.check(Ja())},toUpperCase(){return this.check(Ya())},slugify(){return this.check(Xa())}})),Gs=F(`ZodString`,(e,t)=>{Wn.init(e,t),Ws.init(e,t)},{email(e){return this.check(Xi(Zs,e))},url(e){return this.check(na(tc,e))},jwt(e){return this.check(_a(_c,e))},emoji(e){return this.check(ra(rc,e))},guid(e){return this.check(Zi($s,e))},uuid(e){return this.check(Qi(ec,e))},uuidv4(e){return this.check($i(ec,e))},uuidv6(e){return this.check(ea(ec,e))},uuidv7(e){return this.check(ta(ec,e))},nanoid(e){return this.check(ia(ic,e))},cuid(e){return this.check(aa(ac,e))},cuid2(e){return this.check(oa(oc,e))},ulid(e){return this.check(sa(sc,e))},base64(e){return this.check(ma(mc,e))},base64url(e){return this.check(ha(hc,e))},xid(e){return this.check(ca(cc,e))},ksuid(e){return this.check(la(lc,e))},ipv4(e){return this.check(ua(uc,e))},ipv6(e){return this.check(da(dc,e))},cidrv4(e){return this.check(fa(fc,e))},cidrv6(e){return this.check(pa(pc,e))},e164(e){return this.check(ga(gc,e))},datetime(e){return this.check(va(qs,e))},date(e){return this.check(ya(Js,e))},time(e){return this.check(ba(Ys,e))},duration(e){return this.check(xa(Xs,e))}});function I(e){return Yi(Gs,e)}var Ks=F(`ZodStringFormat`,(e,t)=>{Gn.init(e,t),Ws.init(e,t)}),qs=F(`ZodISODateTime`,(e,t)=>{ur.init(e,t),Ks.init(e,t)}),Js=F(`ZodISODate`,(e,t)=>{dr.init(e,t),Ks.init(e,t)}),Ys=F(`ZodISOTime`,(e,t)=>{fr.init(e,t),Ks.init(e,t)}),Xs=F(`ZodISODuration`,(e,t)=>{pr.init(e,t),Ks.init(e,t)}),Zs=F(`ZodEmail`,(e,t)=>{Jn.init(e,t),Ks.init(e,t)});function Qs(e){return Xi(Zs,e)}var $s=F(`ZodGUID`,(e,t)=>{Kn.init(e,t),Ks.init(e,t)}),ec=F(`ZodUUID`,(e,t)=>{qn.init(e,t),Ks.init(e,t)}),tc=F(`ZodURL`,(e,t)=>{nr.init(e,t),Ks.init(e,t)});function nc(e){return na(tc,e)}var rc=F(`ZodEmoji`,(e,t)=>{rr.init(e,t),Ks.init(e,t)}),ic=F(`ZodNanoID`,(e,t)=>{ir.init(e,t),Ks.init(e,t)}),ac=F(`ZodCUID`,(e,t)=>{ar.init(e,t),Ks.init(e,t)}),oc=F(`ZodCUID2`,(e,t)=>{or.init(e,t),Ks.init(e,t)}),sc=F(`ZodULID`,(e,t)=>{sr.init(e,t),Ks.init(e,t)}),cc=F(`ZodXID`,(e,t)=>{cr.init(e,t),Ks.init(e,t)}),lc=F(`ZodKSUID`,(e,t)=>{lr.init(e,t),Ks.init(e,t)}),uc=F(`ZodIPv4`,(e,t)=>{mr.init(e,t),Ks.init(e,t)}),dc=F(`ZodIPv6`,(e,t)=>{_r.init(e,t),Ks.init(e,t)}),fc=F(`ZodCIDRv4`,(e,t)=>{vr.init(e,t),Ks.init(e,t)}),pc=F(`ZodCIDRv6`,(e,t)=>{br.init(e,t),Ks.init(e,t)}),mc=F(`ZodBase64`,(e,t)=>{Cr.init(e,t),Ks.init(e,t)}),hc=F(`ZodBase64URL`,(e,t)=>{Er.init(e,t),Ks.init(e,t)}),gc=F(`ZodE164`,(e,t)=>{Dr.init(e,t),Ks.init(e,t)}),_c=F(`ZodJWT`,(e,t)=>{kr.init(e,t),Ks.init(e,t)}),vc=F(`ZodNumber`,(e,t)=>{Ar.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.isFinite=!0},Ue({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ko(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ko(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ko(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ko(e).format??null},{gt(e,t){return this.check(Na(e,t))},gte(e,t){return this.check(Pa(e,t))},min(e,t){return this.check(Pa(e,t))},lt(e,t){return this.check(ja(e,t))},lte(e,t){return this.check(Ma(e,t))},max(e,t){return this.check(Ma(e,t))},int(e){return this.check(bc(e))},safe(e){return this.check(bc(e))},positive(e){return this.check(Na(0,e))},nonnegative(e){return this.check(Pa(0,e))},negative(e){return this.check(ja(0,e))},nonpositive(e){return this.check(Ma(0,e))},multipleOf(e,t){return this.check(Fa(e,t))},step(e,t){return this.check(Fa(e,t))},finite(){return this}}));function L(e){return Sa(vc,e)}var yc=F(`ZodNumberFormat`,(e,t)=>{jr.init(e,t),vc.init(e,t)});function bc(e){return wa(yc,e)}var xc=F(`ZodBoolean`,(e,t)=>{Mr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r)});function R(e){return Ta(xc,e)}var Sc=F(`ZodUndefined`,(e,t)=>{Nr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r)});function Cc(e){return Ea(Sc,e)}var wc=F(`ZodNull`,(e,t)=>{Pr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r)});function Tc(e){return Da(wc,e)}var Ec=F(`ZodAny`,(e,t)=>{Fr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dc(){return Oa(Ec)}var Oc=F(`ZodUnknown`,(e,t)=>{Ir.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function z(){return ka(Oc)}var kc=F(`ZodNever`,(e,t)=>{Lr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r)});function Ac(e){return Aa(kc,e)}var jc=F(`ZodArray`,(e,t)=>{Hs(),zr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.element=t.element},{min(e,t){return this.check(La(e,t))},nonempty(e){return this.check(La(1,e))},max(e,t){return this.check(Ia(e,t))},length(e,t){return this.check(Ra(e,t))},unwrap(){return this.element}});function B(e,t){return Za(jc,e,t)}var Mc=F(`ZodObject`,(e,t)=>{Hs(),Gr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),Xe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(se(this._zod.def,{catchall:e}))},passthrough(){return this.clone(se(this._zod.def,{catchall:z()}))},loose(){return this.clone(se(this._zod.def,{catchall:z()}))},strict(){return this.clone(se(this._zod.def,{catchall:Ac()}))},strip(){return this.clone(se(this._zod.def,{catchall:void 0}))},extend(e){return Ce(this,e)},safeExtend(e){return Te(this,e)},merge(e){return Ee(this,e)},pick(e){return be(this,e)},omit(e){return Se(this,e)},partial(...e){return De(Uc,this,e[0])},exactPartial(...e){return De(Wc,this,e[0],`exactPartial`)},required(...e){return Oe(Qc,this,e[0])}});function V(e,t){return new Mc({type:`object`,shape:e??{},...M(t)})}function H(e,t){return new Mc({type:`object`,shape:e,catchall:z(),...M(t)})}var Nc=F(`ZodUnion`,(e,t)=>{qr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.options=t.options});function U(e,t){return new Nc({type:`union`,options:e,...M(t)})}var Pc=F(`ZodDiscriminatedUnion`,(e,t)=>{Nc.init(e,t),Yr.init(e,t)});function Fc(e,t,n){return new Pc({type:`union`,options:t,discriminator:e,...M(n)})}var Ic=F(`ZodIntersection`,(e,t)=>{Xr.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r)});function Lc(e,t){return new Ic({type:`intersection`,left:e,right:t})}var Rc=F(`ZodRecord`,(e,t)=>{Hs(),$r.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function W(e,t,n){return!t||!t._zod?new Rc({type:`record`,keyType:I(),valueType:e,...M(t)}):new Rc({type:`record`,keyType:e,valueType:t,...M(n)})}var zc=F(`ZodEnum`,(e,t)=>{ei.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new zc({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new zc({...t,checks:[],...M(r),entries:i})}});function G(e,t){return new zc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}var Bc=F(`ZodLiteral`,(e,t)=>{ti.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new Bc({type:`literal`,values:Array.isArray(e)?e:[e],...M(t)})}var Vc=F(`ZodTransform`,(e,t)=>{Hs(),ni.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new at(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ze(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ze(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Hc(e){return new Vc({type:`transform`,transform:e})}var Uc=F(`ZodOptional`,(e,t)=>{ii.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function q(e){return new Uc({type:`optional`,innerType:e})}var Wc=F(`ZodExactOptional`,(e,t)=>{ai.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gc(e){return new Wc({type:`optional`,innerType:e})}var Kc=F(`ZodNullable`,(e,t)=>{oi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qc(e){return new Kc({type:`nullable`,innerType:e})}var Jc=F(`ZodDefault`,(e,t)=>{si.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yc(e,t){return new Jc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var Xc=F(`ZodPrefault`,(e,t)=>{li.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zc(e,t){return new Xc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var Qc=F(`ZodNonOptional`,(e,t)=>{ui.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $c(e,t){return new Qc({type:`nonoptional`,innerType:e,...M(t)})}var el=F(`ZodCatch`,(e,t)=>{pi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tl(e,t){return new el({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Qe(t)})}var nl=F(`ZodPipe`,(e,t)=>{mi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e.in=t.in,e.out=t.out});function rl(e,t){return new nl({type:`pipe`,in:e,out:t})}var il=F(`ZodPreprocess`,(e,t)=>{nl.init(e,t),gi.init(e,t)}),al=F(`ZodReadonly`,(e,t)=>{_i.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ol(e){return new al({type:`readonly`,innerType:e})}var sl=F(`ZodTemplateLiteral`,(e,t)=>{xi.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r)});function cl(e,t){return new sl({type:`template_literal`,parts:e,...M(t)})}var ll=F(`ZodLazy`,(e,t)=>{Si.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function ul(e){return new ll({type:`lazy`,getter:e})}var dl=F(`ZodCustom`,(e,t)=>{Ci.init(e,t),Us.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r)});function fl(e,t={}){return Qa(dl,e,t)}function pl(e,t){return $a(e,t)}function ml(e,t){return new il({type:`pipe`,in:Hc(e),out:t})}var hl={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},gl;gl||={};function _l(e){return va(qs,e)}function vl(e){return ya(Js,e)}function yl(e){return Ca(vc,e)}var bl=V({description:I().max(1024).optional(),edit:G([`inline`,`popout`]).optional(),id:I().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/,`column id must be a lowercase slug (a-z, 0-9, _)`),name:I().min(1).max(128),required:R().optional()}),xl=G([`integer`,`decimal`,`percent`,`currency`]),Sl=V({currency:I().regex(/^[A-Z]{3}$/,`currency must be an ISO 4217 code`).optional(),fractionDigits:L().int().min(0).max(8).optional(),grouping:R().optional(),style:xl}).superRefine((e,t)=>{e.style===`currency`&&!e.currency&&t.addIssue({code:`custom`,message:`currency style needs an ISO 4217 code`,path:[`currency`]}),e.style!==`currency`&&e.currency&&t.addIssue({code:`custom`,message:`currency is only valid on currency columns`,path:[`currency`]})}),Cl=G([`date`,`datetime`,`time`]),wl=G([`short`,`medium`,`long`,`iso`]),Tl=G([`hours`,`minutes`,`seconds`]),El=V({dateStyle:wl.optional(),kind:Cl,timePrecision:Tl.optional()}),Dl=G([`milliseconds`,`seconds`,`minutes`,`hours`,`days`]),Ol=G([`hms`,`hours`,`minutes`,`decimal-hours`,`iso`]),kl=V({display:Ol,inputUnit:Dl}),Al=V({id:I().min(1).max(64),label:I().min(1).max(128)}),jl=V({allowCustom:R(),multiple:R().optional(),options:B(Al).max(200)}),Ml=V({style:G([`single`,`multiline`,`markdown`]).default(`single`)}),Nl=B(Fc(`type`,[bl.extend({format:Ml.optional(),type:K(`text`)}),bl.extend({format:Sl,type:K(`number`)}),bl.extend({format:El,type:K(`date`)}),bl.extend({format:kl,type:K(`duration`)}),bl.extend({format:jl,type:K(`select`)}),bl.extend({type:K(`boolean`)})])).min(1).max(64).superRefine((e,t)=>{let n=new Set;for(let r=0;r<e.length;r++){let i=e[r]?.id;i&&(n.has(i)&&t.addIssue({code:`custom`,message:`duplicate column id "${i}"`,path:[r,`id`]}),n.add(i))}});V({description:I().optional(),edit:G([`inline`,`popout`]).optional(),format:V({allowCustom:R().optional(),currency:I().optional(),dateStyle:G([`short`,`medium`,`long`,`iso`]).optional(),display:Ol.optional(),fractionDigits:L().int().optional(),grouping:R().optional(),inputUnit:Dl.optional(),kind:Cl.optional(),multiple:R().optional(),options:B(Al).optional(),style:G([`single`,`multiline`,`markdown`,`integer`,`decimal`,`percent`,`currency`]).optional(),timePrecision:Tl.optional()}).optional(),id:I(),name:I(),required:R().optional(),type:G([`text`,`number`,`date`,`duration`,`select`,`boolean`])}),V({table_id:I().uuid()});var Pl=36e5,Fl=6e4,Il=1e3;function Ll(e){return e.fractionDigits===void 0?e.style===`integer`?0:2:e.fractionDigits}function Rl(e,t,n=`en`){if(typeof e!=`number`||!Number.isFinite(e))return``;let r=Ll(t),i=t.grouping!==!1;return t.style===`percent`?new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,style:`percent`,useGrouping:i}).format(e):t.style===`currency`&&t.currency?new Intl.NumberFormat(n,{currency:t.currency,maximumFractionDigits:r,minimumFractionDigits:r,style:`currency`,useGrouping:i}).format(e):new Intl.NumberFormat(n,{maximumFractionDigits:r,minimumFractionDigits:r,useGrouping:i}).format(e)}function zl(e,t,n=`en`){if(typeof e!=`string`||e.length===0)return``;if(t.kind===`time`)return Bl(e,t.timePrecision??`minutes`);if(t.dateStyle===`iso`)return t.kind===`date`?e.slice(0,10):e;let r=t.kind===`date`?new Date(`${e}T00:00:00`):new Date(e);if(Number.isNaN(r.getTime()))return e;let i=t.dateStyle??`medium`;if(t.kind===`date`)return new Intl.DateTimeFormat(n,{dateStyle:i}).format(r);let a=t.timePrecision??`minutes`;return new Intl.DateTimeFormat(n,{dateStyle:i,timeStyle:a===`hours`?`short`:`medium`}).format(r)}function Bl(e,t){let[n=`0`,r=`00`,i=`00`]=e.split(`:`);return t===`hours`?`${n.padStart(2,`0`)}:00`:t===`minutes`?`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}`:`${n.padStart(2,`0`)}:${r.padStart(2,`0`)}:${i.padStart(2,`0`)}`}function Vl(e,t){if(typeof e!=`number`||!Number.isFinite(e))return``;let n=Math.max(0,Math.round(e));if(t.display===`iso`)return Hl(n);if(t.display===`minutes`)return`${Math.round(n/Fl)} min`;if(t.display===`hours`)return`${(n/Pl).toFixed(2)} h`;if(t.display===`decimal-hours`)return(n/Pl).toFixed(2);let r=Math.floor(n/Pl),i=Math.floor(n%Pl/Fl),a=Math.floor(n%Fl/Il);return`${r}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function Hl(e){let t=Math.floor(e/Pl),n=Math.floor(e%Pl/Fl),r=Math.floor(e%Fl/Il);return`${t>=24?`P${Math.floor(t/24)}D`:`P`}T${t%24}H${n}M${r}S`}function Ul(e,t,n=`en`){if(t==null)return``;switch(e.type){case`number`:return Rl(t,e.format,n);case`date`:return zl(t,e.format,n);case`duration`:return Vl(t,e.format);case`boolean`:return t===!0?`true`:t===!1?`false`:``;case`select`:return Wl(e,t);default:return String(t)}}function Wl(e,t){let n=Array.isArray(t)?t:[t],r=e.format.options.reduce((e,t)=>(e[t.id]=t.label,e),{});return n.filter(e=>typeof e==`string`&&e.length>0).map(e=>r[e]??e).join(`, `)}var Gl=[`mail`],Kl=B(H({id:I().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,40}$/,`ids are letters, digits, _ and -`),component:G([`Column`,`Text`,`List`,`Row`,`DetailGrid`,`Badge`,`Grid`,`Metric`,`Table`,`Image`,`BarChart`,`LineChart`,`DonutChart`,`Actions`,`Button`]),children:U([B(I()),V({path:I(),componentId:I()})]).optional()})).min(1).max(200),ql=e=>!(!e||typeof e!=`object`||Array.isArray(e)||typeof e.path!=`string`);function Jl(e,t){let n=e;for(let e of t.split(`/`).slice(1)){if(typeof n!=`object`||!n)return;n=n[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return n}function Yl(e,t,n){return ql(e)?e.path.startsWith(`/`)?Jl(t,e.path):n===void 0?void 0:Jl(n,`/${e.path.replace(/\./g,`/`)}`):e}var Xl=[`round`,`drop`,`dome`,`flame`,`oval`,`bean`,`pebble`,`sprout`,`tower`,`wedge`],Zl=[`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`image`,`file`,`items`,`connection`,`list`,`location`,`audio`,`signature`,`slot`];function Ql(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let{lat:t,lng:n,label:r}=e;return typeof t==`number`&&typeof n==`number`||typeof r==`string`&&r.trim().length>0}function $l(e){return!!(e&&typeof e==`object`&&typeof e.asset==`string`&&e.asset)}var eu=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`],tu=/^[a-z][a-z0-9-]{0,39}$/,nu=/^[a-z][a-z0-9_]{0,39}$/,ru=[`classifier`,`standard`,`high`,`highest`];[...ru];var iu=[`low`,`medium`,`high`],au=[`image`,`video`,`voice`,`document`,`dashboard`],ou=[`png`,`mp4`,`mp3`,`pdf`,`docx`,`html`,`md`,`txt`,`csv`,`xlsx`,`json`,`zip`],su=[`1:1`,`16:9`,`9:16`,`4:5`,`3:2`,`2:3`],cu=[`720p`,`480p`],lu=I().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,40}$/,`ids are letters, digits and _ and start with a letter`),uu=V({id:lu,label:I().min(1),kind:G([`text`,`number`,`money`])}),du=V({field:I(),op:G([`equals`,`notEquals`,`in`,`notEmpty`,`empty`,`gt`,`lt`,`contains`]),value:U([I(),L(),R(),B(I())]).optional()}),fu=U([du,B(du).min(1)]),pu=V({id:lu,label:I().min(1),kind:G(Zl),required:R().optional(),placeholder:I().optional(),help:I().optional(),options:B(I()).optional(),default:U([I(),L(),R(),B(I())]).optional(),columns:B(uu).optional(),vat:V({rate:L().optional(),field:I().optional()}).optional(),currency:I().optional(),multiple:R().optional(),min:L().int().min(1).max(30).optional(),max:L().int().min(1).max(30).optional(),camera:R().optional(),video:R().optional(),listen:R().optional(),scan:R().optional(),connection:I().optional(),list:I().optional(),prefill:I().optional(),when:fu.optional(),optionsFrom:I().optional(),ask:I().min(1).optional(),group:I().optional()}),mu=V({id:lu,instructions:I().min(1),optional:R().optional()}),hu=V({when:fu.optional(),ask:I().min(1).optional(),goto:I(),max:L().int().min(1).max(50).optional()}).refine(e=>e.when===void 0||e.ask===void 0,{message:`A branch has "when" or "ask", not both.`}),gu={id:lu,title:I().min(1),description:I().optional(),next:B(hu).optional()},_u=V({id:lu,kind:G([`text`,`number`,`list`,`table`,`yesno`,`choice`,`score`]),description:I().optional(),columns:B(I().min(1)).optional(),options:B(I().min(1)).min(2).max(40).optional()}).refine(e=>e.kind!==`choice`&&e.kind!==`score`||!!e.options?.length,{message:`A choice or score field lists its options.`,path:[`options`]}).refine(e=>e.kind!==`score`||(e.options?.length??0)<=10,{message:`A score has at most ten levels.`,path:[`options`]}),vu=V({...gu,type:K(`page`),fields:B(pu).min(1),groups:B(mu).max(6).optional(),cta:I().optional()}),yu=cl([I().regex(tu),`.`,I().regex(nu)]),bu=V({...gu,type:K(`agent`),instructions:I().default(``),call:V({tool:yu,input:W(I(),z()).default({})}).optional(),tools:B(U([G(eu),yu])).default([]),mcp:B(I()).optional(),connections:B(I()).optional(),output:V({format:G([`text`,`markdown`,`json`]),fields:B(_u).optional(),surface:R().optional()}).default({format:`markdown`}),model:G(ru).optional(),effort:G(iu).optional(),each:I().optional(),working:I().optional()}),xu=V({...gu,type:K(`generate`),asset:G(au),prompt:I().min(1),options:V({aspectRatio:G(su).optional(),duration:L().optional(),resolution:G(cu).optional(),style:I().optional(),template:G([`invoice`,`offer`,`briefing`,`letter`,`report`,`free`]).optional()}).optional(),referenceImage:I().optional(),each:I().optional(),model:G(ru).optional(),effort:G(iu).optional(),working:I().optional()}),Su=V({...gu,type:K(`widget`),entry:I().min(1),data:W(I(),I()).default({}),sample:I().optional(),size:V({width:L().int().min(200).max(3840),height:L().int().min(200).max(3840)}).optional(),video:R().optional(),working:I().optional()}),Cu=[`16:9`,`9:16`,`1:1`],wu=V({...gu,type:K(`film`),brief:I().min(1),skills:B(I().min(1)).max(12).default([`hyperframes`]),kit:I().optional(),inputs:W(I(),I()).default({}),format:G(Cu).default(`16:9`),seconds:L().int().min(3).max(600).optional(),model:G(ru).optional(),effort:G(iu).optional(),working:I().optional()}),Tu=V({id:lu,description:I().min(1),components:Kl,group:I().optional(),required:R().optional()}),Eu=V({...gu,type:K(`surface`),components:Kl.optional(),candidates:B(Tu).max(16).optional(),groups:B(mu).max(6).optional(),data:W(I(),I()).default({}),working:I().optional()}).refine(e=>!!e.components!=!!e.candidates,{message:`A surface step has either "components" or "candidates".`}),Du=V({...gu,type:K(`review`),show:B(I()).min(1),edit:R().optional(),regenerate:R().optional()}),Ou=V({from:I(),label:I().optional(),formats:B(G(ou)).min(1)}),ku=Fc(`type`,[vu,bu,xu,Su,Eu,wu,Du,V({...gu,type:K(`result`),message:I().optional(),deliverables:B(Ou)})]),Au=V({id:lu,title:I().min(1),description:I().optional(),columns:Nl,key:I().optional(),check:V({file:I().optional(),status:I().optional()}).optional(),shared:R().optional()}),ju=V({id:lu,kind:G(Gl).optional(),connector:I().optional(),actions:B(I()).max(200).optional(),policy:W(I(),G([`allow`,`ask`])).optional(),title:I().optional(),description:I().optional()});V({version:K(1).default(1),title:I().min(1),description:I().default(``),avatar:G(Xl).default(`round`),intro:I().optional(),lists:B(Au).max(12).optional(),connections:B(ju).max(12).optional(),steps:B(ku).min(1)});function Mu(e){return e.when===void 0&&e.ask===void 0}function Nu(e){return e==null||e===``||Array.isArray(e)&&e.length===0}function Pu(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Fu(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`||!e.trim())return null;let t=Number(e.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(t)?t:null}function Iu(e,t){let n=t[e.field];switch(e.op){case`empty`:return Nu(n);case`notEmpty`:return!Nu(n);case`equals`:return String(n)===String(e.value);case`notEquals`:return String(n)!==String(e.value);case`in`:return Array.isArray(e.value)&&e.value.map(String).includes(String(n));case`gt`:case`lt`:{let t=Fu(n),r=Fu(e.value);return t!==null&&r!==null&&(e.op===`gt`?t>r:t<r)}case`contains`:return Array.isArray(n)?n.map(String).includes(String(e.value)):typeof n==`string`&&e.value!==void 0&&n.toLowerCase().includes(String(e.value).toLowerCase())}}function Lu(e,t){return Pu(e).every(e=>Iu(e,t))}function Ru(e){return!!(e.ask||e.group)}function zu(e,t,n){let r={...t,...n},i=[];for(let t of e)Lu(t.when,r)?i.push(t):delete r[t.id];return i}var Bu=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;function Vu(e){let t=Bu.exec(e.trim());if(!t)return null;let[,n,r,i,a,o]=t.map(Number),s=new Date(Date.UTC(n,r-1,i,a,o));return s.getUTCMonth()!==r-1||s.getUTCDate()!==i||a>23||o>59||!Number.isFinite(Date.parse(e))?null:{day:`${t[1]}-${t[2]}-${t[3]}`,time:`${t[4]}:${t[5]}`,wall:s}}function Hu(e,t=`de`){let n=Vu(e);if(!n)return e;let r=qu[t];return`${n.wall.toLocaleDateString(r,{weekday:`long`,timeZone:`UTC`})}, ${n.wall.toLocaleDateString(r,{day:`numeric`,month:`long`,timeZone:`UTC`})}`}function Uu(e,t=`de`){let n=Vu(e);if(!n)return e;let r=qu[t];return`${n.wall.toLocaleDateString(r,{weekday:`short`,timeZone:`UTC`}).replace(/\.$/,``)} ${n.wall.toLocaleDateString(r,{day:`2-digit`,month:`2-digit`,year:`numeric`,timeZone:`UTC`})}, ${n.time}`}function Wu(e,t,n){let r=Array.isArray(t)?t:[],i=(e.columns??[]).filter(e=>e.kind!==`text`),a=r.map(e=>{let t=i.length?i.reduce((t,n)=>t*Gu(e[n.id]),1):0;return{...e,amount:Ku(t)}}),o=Ku(a.reduce((e,t)=>e+t.amount,0)),s=e.vat?.rate??0;if(e.vat?.field){let t=n[e.vat.field],r=Number.parseFloat(String(t??``).replace(`,`,`.`));Number.isFinite(r)&&(s=r)}let c=Ku(o*s/100);return{rows:a,net:o,vatRate:s,vat:c,gross:Ku(o+c),currency:e.currency??`EUR`}}function Gu(e){let t=Number(typeof e==`string`?e.replace(/\s/g,``).replace(`,`,`.`):e);return Number.isFinite(t)?t:0}function Ku(e){return Math.round(e*100)/100}var qu={de:`de-DE`,en:`en-GB`},Ju=Object.defineProperty,Yu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xu=(e,t)=>{let n={};for(var r in e)Ju(n,r,{get:e[r],enumerable:!0});return t&&Ju(n,Symbol.toStringTag,{value:`Module`}),n},Zu=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function Qu(e){return typeof e==`string`&&Zu.has(e.replace(/#$/,``))}var $u=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],ed=`io.modelcontextprotocol/related-task`,td=`io.modelcontextprotocol/protocolVersion`,nd=`io.modelcontextprotocol/clientInfo`,rd=`io.modelcontextprotocol/serverInfo`,id=`io.modelcontextprotocol/clientCapabilities`,ad=`io.modelcontextprotocol/subscriptionId`,od=`io.modelcontextprotocol/logLevel`,sd=ul(()=>U([I(),L(),R(),Tc(),W(I(),sd),B(sd)])),cd=W(I(),sd),ld=B(sd),ud=U([I(),L().int()]),dd=I(),fd=V({ttl:L().optional()}),pd=V({taskId:I()}),md=H({progressToken:ud.optional(),[ed]:pd.optional()}),hd=V({_meta:md.optional()}),gd=hd.extend({task:fd.optional()}),_d=V({method:I(),params:hd.loose().optional()}),vd=V({_meta:md.optional()}),yd=V({method:I(),params:vd.loose().optional()}),bd=H({get[rd](){return Fd.optional().catch(void 0)}}),xd=H({_meta:bd.optional()}),Sd=U([I(),L().int()]),Cd=V({jsonrpc:K(`2.0`),id:Sd,..._d.shape}).strict(),wd=V({jsonrpc:K(`2.0`),...yd.shape}).strict(),Td=V({jsonrpc:K(`2.0`),id:Sd,result:xd}).strict(),Ed=V({jsonrpc:K(`2.0`),id:Sd.optional(),error:V({code:L().int(),message:I(),data:z().optional()})}).strict(),Dd=U([Cd,wd,Td,Ed]),Od=U([Td,Ed]),kd=xd.strict(),Ad=vd.extend({requestId:Sd.optional(),reason:I().optional()}),jd=yd.extend({method:K(`notifications/cancelled`),params:Ad}),Md=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),Nd=V({icons:B(Md).optional()}),Pd=V({name:I(),title:I().optional()}),Fd=Pd.extend({...Pd.shape,...Nd.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),Id=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),cd).optional(),url:cd.optional()}),cd.optional())),Ld=H({list:cd.optional(),cancel:cd.optional(),requests:H({sampling:H({createMessage:cd.optional()}).optional(),elicitation:H({create:cd.optional()}).optional()}).optional()}),Rd=H({list:cd.optional(),cancel:cd.optional(),requests:H({tools:H({call:cd.optional()}).optional()}).optional()}),zd=V({experimental:W(I(),cd).optional(),sampling:V({context:cd.optional(),tools:cd.optional()}).optional(),elicitation:Id.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:Ld.optional(),extensions:W(I(),cd).optional()}),Bd=hd.extend({protocolVersion:I(),capabilities:zd,clientInfo:Fd}),Vd=_d.extend({method:K(`initialize`),params:Bd}),Hd=V({experimental:W(I(),cd).optional(),logging:cd.optional(),completions:cd.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:Rd.optional(),extensions:W(I(),cd).optional()}),Ud=xd.extend({protocolVersion:I(),capabilities:Hd,serverInfo:Fd,instructions:I().optional()}),Wd=yd.extend({method:K(`notifications/initialized`),params:vd.optional()}),Gd=_d.extend({method:K(`server/discover`),params:hd.optional()}),Kd=xd.extend({supportedVersions:B(I()),capabilities:Hd,instructions:I().optional()}),qd=_d.extend({method:K(`ping`),params:hd.optional()}),Jd=V({progress:L(),total:q(L()),message:q(I())}),Yd=V({...vd.shape,...Jd.shape,progressToken:ud}),Xd=yd.extend({method:K(`notifications/progress`),params:Yd}),Zd=hd.extend({cursor:dd.optional()}),Qd=_d.extend({params:Zd.optional()}),$d=xd.extend({nextCursor:dd.optional()}),ef=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),tf=ef.extend({text:I()}),nf=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),rf=ef.extend({blob:nf}),af=G([`user`,`assistant`]),of=V({audience:B(af).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),sf=V({...Pd.shape,...Nd.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:of.optional(),_meta:q(H({}))}),cf=V({...Pd.shape,...Nd.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:of.optional(),_meta:q(H({}))}),lf=Qd.extend({method:K(`resources/list`)}),uf=$d.extend({resources:B(sf)}),df=Qd.extend({method:K(`resources/templates/list`)}),ff=$d.extend({resourceTemplates:B(cf)}),pf=hd.extend({uri:I()}),mf=pf,hf=_d.extend({method:K(`resources/read`),params:mf}),gf=xd.extend({contents:B(U([tf,rf]))}),_f=yd.extend({method:K(`notifications/resources/list_changed`),params:vd.optional()}),vf=pf,yf=_d.extend({method:K(`resources/subscribe`),params:vf}),bf=pf,xf=_d.extend({method:K(`resources/unsubscribe`),params:bf}),Sf=V({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:B(I()).optional()}),Cf=hd.extend({notifications:Sf}),wf=_d.extend({method:K(`subscriptions/listen`),params:Cf}),Tf=vd.extend({notifications:Sf}),Ef=yd.extend({method:K(`notifications/subscriptions/acknowledged`),params:Tf}),Df=bd.extend({[ad]:Sd}),Of=xd.extend({_meta:Df}),kf=vd.extend({uri:I()}),Af=yd.extend({method:K(`notifications/resources/updated`),params:kf}),jf=V({name:I(),description:q(I()),required:q(R())}),Mf=V({...Pd.shape,...Nd.shape,description:q(I()),arguments:q(B(jf)),_meta:q(H({}))}),Nf=Qd.extend({method:K(`prompts/list`)}),Pf=$d.extend({prompts:B(Mf)}),Ff=hd.extend({name:I(),arguments:W(I(),I()).optional()}),If=_d.extend({method:K(`prompts/get`),params:Ff}),Lf=V({type:K(`text`),text:I(),annotations:of.optional(),_meta:W(I(),z()).optional()}),Rf=V({type:K(`image`),data:nf,mimeType:I(),annotations:of.optional(),_meta:W(I(),z()).optional()}),zf=V({type:K(`audio`),data:nf,mimeType:I(),annotations:of.optional(),_meta:W(I(),z()).optional()}),Bf=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),Vf=V({type:K(`resource`),resource:U([tf,rf]),annotations:of.optional(),_meta:W(I(),z()).optional()}),Hf=sf.extend({type:K(`resource_link`)}),Uf=U([Lf,Rf,zf,Hf,Vf]),Wf=V({role:af,content:Uf}),Gf=xd.extend({description:I().optional(),messages:B(Wf)}),Kf=yd.extend({method:K(`notifications/prompts/list_changed`),params:vd.optional()}),qf=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),Jf=V({taskSupport:G([`required`,`optional`,`forbidden`]).optional()}),Yf=V({...Pd.shape,...Nd.shape,description:I().optional(),inputSchema:V({type:K(`object`),properties:W(I(),sd).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:H({$schema:I().optional()}).optional(),annotations:qf.optional(),execution:Jf.optional(),_meta:W(I(),z()).optional()}),Xf=Qd.extend({method:K(`tools/list`)}),Zf=$d.extend({tools:B(Yf)}),Qf=xd.extend({content:B(Uf).default([]),structuredContent:z().optional(),isError:R().optional()}),$f=Qf.or(xd.extend({toolResult:z()})),ep=gd.extend({name:I(),arguments:W(I(),z()).optional()}),tp=_d.extend({method:K(`tools/call`),params:ep}),np=yd.extend({method:K(`notifications/tools/list_changed`),params:vd.optional()}),rp=V({autoRefresh:R().default(!0),debounceMs:L().int().nonnegative().default(300)}),ip=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),ap=hd.extend({level:ip}),op=_d.extend({method:K(`logging/setLevel`),params:ap}),sp=vd.extend({level:ip,logger:I().optional(),data:z()}),cp=yd.extend({method:K(`notifications/message`),params:sp}),lp=V({name:I().optional()}),up=V({hints:B(lp).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),dp=V({mode:G([`auto`,`required`,`none`]).optional()}),fp=V({type:K(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(Uf),structuredContent:z().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),pp=Fc(`type`,[Lf,Rf,zf]),mp=Fc(`type`,[Lf,Rf,zf,Bf,fp]),hp=V({role:af,content:U([mp,B(mp)]),_meta:W(I(),z()).optional()}),gp=gd.extend({messages:B(hp),modelPreferences:up.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:cd.optional(),tools:B(Yf).optional(),toolChoice:dp.optional()}),_p=_d.extend({method:K(`sampling/createMessage`),params:gp}),vp=xd.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:af,content:pp}),yp=xd.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:af,content:U([mp,B(mp)])}),bp=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),xp=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),Sp=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Cp=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),wp=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),Tp=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Ep=U([Cp,wp]),Dp=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),Op=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),kp=U([Dp,Op]),Ap=U([Tp,Ep,kp]),jp=U([Ap,bp,xp,Sp]),Mp=gd.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),jp),required:B(I()).optional()}).catchall(z())}),Np=gd.extend({mode:K(`url`),message:I(),elicitationId:I(),url:I().url()}),Pp=U([Mp,Np]),Fp=_d.extend({method:K(`elicitation/create`),params:Pp}),Ip=vd.extend({elicitationId:I()}),Lp=yd.extend({method:K(`notifications/elicitation/complete`),params:Ip}),Rp=xd.extend({action:G([`accept`,`decline`,`cancel`]),content:ml(e=>e===null?void 0:e,W(I(),U([I(),L(),R(),B(I())])).optional())}),zp=V({type:K(`ref/resource`),uri:I()}),Bp=V({type:K(`ref/prompt`),name:I()}),Vp=hd.extend({ref:U([Bp,zp]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()}),Hp=_d.extend({method:K(`completion/complete`),params:Vp}),Up=xd.extend({completion:H({values:B(I()).max(100),total:q(L().int()),hasMore:q(R())})}),Wp=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),Gp=_d.extend({method:K(`roots/list`),params:hd.optional()}),Kp=xd.extend({roots:B(Wp)}),qp=yd.extend({method:K(`notifications/roots/list_changed`),params:vd.optional()}),Jp=H({ttl:L().optional(),pollInterval:L().optional()}),Yp=G([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Xp=V({taskId:I(),status:Yp,ttl:U([L(),Tc()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:q(L()),statusMessage:q(I())}),Zp=xd.extend({task:Xp}),Qp=vd.merge(Xp),$p=yd.extend({method:K(`notifications/tasks/status`),params:Qp}),em=_d.extend({method:K(`tasks/get`),params:hd.extend({taskId:I()})}),tm=xd.merge(Xp),nm=_d.extend({method:K(`tasks/result`),params:hd.extend({taskId:I()})}),rm=xd.loose(),im=Qd.extend({method:K(`tasks/list`)}),am=$d.extend({tasks:B(Xp)}),om=_d.extend({method:K(`tasks/cancel`),params:hd.extend({taskId:I()})}),sm=xd.merge(Xp),cm=U([qd,Vd,Gd,Hp,op,If,Nf,lf,df,hf,yf,xf,wf,tp,Xf]),lm=U([jd,Xd,Wd,qp]),um=U([kd,vp,yp,Rp,Kp]),dm=U([qd,_p,Fp,Gp]),fm=U([jd,Xd,cp,Af,_f,np,Kf,Ef,Lp]),pm=U([kd,Ud,Kd,Up,Gf,Pf,uf,ff,gf,Qf,Zf,Of]),mm=nc().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:hl.custom,message:`URL must be parseable`,fatal:!0}),et}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),hm=H({resource:I().url(),authorization_servers:B(mm).optional(),jwks_uri:I().url().optional(),scopes_supported:B(I()).optional(),bearer_methods_supported:B(I()).optional(),resource_signing_alg_values_supported:B(I()).optional(),resource_name:I().optional(),resource_documentation:I().optional(),resource_policy_uri:I().url().optional(),resource_tos_uri:I().url().optional(),tls_client_certificate_bound_access_tokens:R().optional(),authorization_details_types_supported:B(I()).optional(),dpop_signing_alg_values_supported:B(I()).optional(),dpop_bound_access_tokens_required:R().optional()}),gm=H({issuer:I(),authorization_endpoint:mm,token_endpoint:mm,registration_endpoint:mm.optional(),scopes_supported:B(I()).optional(),response_types_supported:B(I()),response_modes_supported:B(I()).optional(),grant_types_supported:B(I()).optional(),token_endpoint_auth_methods_supported:B(I()).optional(),token_endpoint_auth_signing_alg_values_supported:B(I()).optional(),service_documentation:mm.optional(),revocation_endpoint:mm.optional(),revocation_endpoint_auth_methods_supported:B(I()).optional(),revocation_endpoint_auth_signing_alg_values_supported:B(I()).optional(),introspection_endpoint:I().optional(),introspection_endpoint_auth_methods_supported:B(I()).optional(),introspection_endpoint_auth_signing_alg_values_supported:B(I()).optional(),code_challenge_methods_supported:B(I()).optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0),dpop_signing_alg_values_supported:B(I()).optional()}),_m=H({issuer:I(),authorization_endpoint:mm,token_endpoint:mm,userinfo_endpoint:mm.optional(),jwks_uri:mm,registration_endpoint:mm.optional(),scopes_supported:B(I()).optional(),response_types_supported:B(I()),response_modes_supported:B(I()).optional(),grant_types_supported:B(I()).optional(),acr_values_supported:B(I()).optional(),subject_types_supported:B(I()),id_token_signing_alg_values_supported:B(I()),id_token_encryption_alg_values_supported:B(I()).optional(),id_token_encryption_enc_values_supported:B(I()).optional(),userinfo_signing_alg_values_supported:B(I()).optional(),userinfo_encryption_alg_values_supported:B(I()).optional(),userinfo_encryption_enc_values_supported:B(I()).optional(),request_object_signing_alg_values_supported:B(I()).optional(),request_object_encryption_alg_values_supported:B(I()).optional(),request_object_encryption_enc_values_supported:B(I()).optional(),token_endpoint_auth_methods_supported:B(I()).optional(),token_endpoint_auth_signing_alg_values_supported:B(I()).optional(),display_values_supported:B(I()).optional(),claim_types_supported:B(I()).optional(),claims_supported:B(I()).optional(),service_documentation:I().optional(),claims_locales_supported:B(I()).optional(),ui_locales_supported:B(I()).optional(),claims_parameter_supported:R().optional(),request_parameter_supported:R().optional(),request_uri_parameter_supported:R().optional(),require_request_uri_registration:R().optional(),op_policy_uri:mm.optional(),op_tos_uri:mm.optional(),client_id_metadata_document_supported:R().optional(),authorization_response_iss_parameter_supported:R().optional().catch(void 0)}),vm=V({..._m.shape,...gm.pick({code_challenge_methods_supported:!0}).shape}),ym=V({access_token:I(),id_token:I().optional(),token_type:I(),expires_in:yl().optional(),scope:I().optional(),refresh_token:I().optional(),issuer:I().optional().catch(void 0)}).strip(),bm=V({issued_token_type:K(`urn:ietf:params:oauth:token-type:id-jag`),access_token:I(),token_type:I().optional(),expires_in:L().optional(),scope:I().optional()}).strip(),xm=V({error:I(),error_description:I().optional(),error_uri:I().optional()}),Sm=mm.optional().or(K(``).transform(()=>void 0)),Cm=V({redirect_uris:B(mm),token_endpoint_auth_method:I().optional(),grant_types:B(I()).optional(),response_types:B(I()).optional(),application_type:I().optional(),client_name:I().optional(),client_uri:mm.optional(),logo_uri:Sm,scope:I().optional(),contacts:B(I()).optional(),tos_uri:Sm,policy_uri:I().optional(),jwks_uri:mm.optional(),jwks:Dc().optional(),software_id:I().optional(),software_version:I().optional(),software_statement:I().optional()}).strip(),wm=V({client_id:I(),client_secret:I().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional(),issuer:I().optional().catch(void 0)}).strip(),Tm=Cm.merge(wm),Em=V({error:I(),error_description:I().optional()}).strip(),Dm=V({token:I(),token_type_hint:I().optional()}).strip(),Om=Symbol.for(`mcp.sdk.errorBrands`);function km(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Om,{value:n,enumerable:!1,configurable:!0})}function Am(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Om)){let n=t[Om];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,km(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});var jm=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Mm=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,km(this,new.target)}};(class extends Mm{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var Nm=`2026-07-28`;function Pm(e){return e>=Nm}function Fm(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var Im=[`task`,`inputRequests`,`requestState`];function Lm(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||Im.some(t=>t in e)?e:{...e,content:[]}}function Rm(){let e=ul(()=>U([I(),L(),R(),Tc(),W(I(),e),B(e)])),t=W(I(),e),n=U([I(),L().int()]),r=I(),i=V({ttl:L().optional()}),a=V({taskId:I()}),o=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=V({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=V({method:I(),params:s.loose().optional()}),u=V({_meta:o.optional()}),d=V({method:I(),params:u.loose().optional()}),f=H({_meta:o.optional()}),p=U([I(),L().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:I().optional()}),g=d.extend({method:K(`notifications/cancelled`),params:h}),_=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),v=V({icons:B(_).optional()}),y=V({name:I(),title:I().optional()}),b=y.extend({...y.shape,...v.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),x=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),t).optional(),url:t.optional()}),t.optional())),S=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),C=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),w=V({experimental:W(I(),t).optional(),sampling:V({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:S.optional(),extensions:W(I(),t).optional()}),T=s.extend({protocolVersion:I(),capabilities:w,clientInfo:b}),E=l.extend({method:K(`initialize`),params:T}),D=V({experimental:W(I(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:C.optional(),extensions:W(I(),t).optional()}),ee=f.extend({protocolVersion:I(),capabilities:D,serverInfo:b,instructions:I().optional()}),O=d.extend({method:K(`notifications/initialized`),params:u.optional()}),k=l.extend({method:K(`ping`),params:s.optional()}),A=V({progress:L(),total:q(L()),message:q(I())}),te=V({...u.shape,...A.shape,progressToken:n}),ne=d.extend({method:K(`notifications/progress`),params:te}),re=s.extend({cursor:r.optional()}),ie=l.extend({params:re.optional()}),ae=f.extend({nextCursor:r.optional()}),oe=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),se=oe.extend({text:I()}),ce=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),j=oe.extend({blob:ce}),le=G([`user`,`assistant`]),ue=V({audience:B(le).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),de=V({...y.shape,...v.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:ue.optional(),_meta:q(H({}))}),fe=V({...y.shape,...v.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:ue.optional(),_meta:q(H({}))}),pe=ie.extend({method:K(`resources/list`)}),me=ae.extend({resources:B(de)}),he=ie.extend({method:K(`resources/templates/list`)}),ge=ae.extend({resourceTemplates:B(fe)}),_e=s.extend({uri:I()}),M=_e,N=l.extend({method:K(`resources/read`),params:M}),P=f.extend({contents:B(U([se,j]))}),ve=d.extend({method:K(`notifications/resources/list_changed`),params:u.optional()}),ye=_e,be=l.extend({method:K(`resources/subscribe`),params:ye}),xe=_e,Se=l.extend({method:K(`resources/unsubscribe`),params:xe}),Ce=u.extend({uri:I()}),we=d.extend({method:K(`notifications/resources/updated`),params:Ce}),Te=V({name:I(),description:q(I()),required:q(R())}),Ee=V({...y.shape,...v.shape,description:q(I()),arguments:q(B(Te)),_meta:q(H({}))}),De=ie.extend({method:K(`prompts/list`)}),Oe=ae.extend({prompts:B(Ee)}),ke=s.extend({name:I(),arguments:W(I(),I()).optional()}),Ae=l.extend({method:K(`prompts/get`),params:ke}),je=V({type:K(`text`),text:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Me=V({type:K(`image`),data:ce,mimeType:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Ne=V({type:K(`audio`),data:ce,mimeType:I(),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Pe=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),Fe=V({type:K(`resource`),resource:U([se,j]),annotations:ue.optional(),_meta:W(I(),z()).optional()}),Ie=de.extend({type:K(`resource_link`)}),Le=U([je,Me,Ne,Ie,Fe]),Re=V({role:le,content:Le}),ze=f.extend({description:I().optional(),messages:B(Re)}),Be=d.extend({method:K(`notifications/prompts/list_changed`),params:u.optional()}),Ve=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),He=V({taskSupport:G([`required`,`optional`,`forbidden`]).optional()}),Ue=V({...y.shape,...v.shape,description:I().optional(),inputSchema:V({type:K(`object`),properties:W(I(),e).optional(),required:B(I()).optional()}).catchall(z()),outputSchema:V({type:K(`object`),properties:W(I(),e).optional(),required:B(I()).optional()}).catchall(z()).optional(),annotations:Ve.optional(),execution:He.optional(),_meta:W(I(),z()).optional()}),We=ie.extend({method:K(`tools/list`)}),Ge=ae.extend({tools:B(Ue)}),Ke=f.extend({content:B(Le),structuredContent:W(I(),z()).optional(),isError:R().optional()}),qe=c.extend({name:I(),arguments:W(I(),z()).optional()}),Je=l.extend({method:K(`tools/call`),params:qe}),Ye=d.extend({method:K(`notifications/tools/list_changed`),params:u.optional()}),Xe=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ze=s.extend({level:Xe}),Qe=l.extend({method:K(`logging/setLevel`),params:Ze}),$e=u.extend({level:Xe,logger:I().optional(),data:z()}),et=d.extend({method:K(`notifications/message`),params:$e}),tt=V({name:I().optional()}),nt=V({hints:B(tt).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),rt=V({mode:G([`auto`,`required`,`none`]).optional()}),F=V({type:K(`tool_result`),toolUseId:I().describe(`The unique identifier for the corresponding tool call.`),content:B(Le),structuredContent:V({}).loose().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),it=Fc(`type`,[je,Me,Ne]),at=Fc(`type`,[je,Me,Ne,Pe,F]),ot=V({role:le,content:U([at,B(at)]),_meta:W(I(),z()).optional()}),st=c.extend({messages:B(ot),modelPreferences:nt.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:t.optional(),tools:B(Ue).optional(),toolChoice:rt.optional()}),ct=l.extend({method:K(`sampling/createMessage`),params:st}),lt=f.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`]).or(I())),role:le,content:it}),ut=f.extend({model:I(),stopReason:q(G([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(I())),role:le,content:U([at,B(at)])}),dt=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),ft=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),pt=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),mt=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),ht=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),gt=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),_t=U([mt,ht]),vt=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),yt=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),bt=U([vt,yt]),xt=U([gt,_t,bt]),St=U([xt,dt,ft,pt]),Ct=c.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),St),required:B(I()).optional()}).catchall(z())}),wt=c.extend({mode:K(`url`),message:I(),elicitationId:I(),url:I().url()}),Tt=U([Ct,wt]),Et=l.extend({method:K(`elicitation/create`),params:Tt}),Dt=u.extend({elicitationId:I()}),Ot=d.extend({method:K(`notifications/elicitation/complete`),params:Dt}),kt=f.extend({action:G([`accept`,`decline`,`cancel`]),content:ml(e=>e===null?void 0:e,W(I(),U([I(),L(),R(),B(I())])).optional())}),At=V({type:K(`ref/resource`),uri:I()}),jt=V({type:K(`ref/prompt`),name:I()}),Mt=s.extend({ref:U([jt,At]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()}),Nt=l.extend({method:K(`completion/complete`),params:Mt}),Pt=f.extend({completion:H({values:B(I()).max(100),total:q(L().int()),hasMore:q(R())})}),Ft=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),It=l.extend({method:K(`roots/list`),params:s.optional()}),Lt=f.extend({roots:B(Ft)}),Rt=d.extend({method:K(`notifications/roots/list_changed`),params:u.optional()}),zt=H({ttl:L().optional(),pollInterval:L().optional()}),Bt=G([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Vt=V({taskId:I(),status:Bt,ttl:U([L(),Tc()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:q(L()),statusMessage:q(I())}),Ht=f.extend({task:Vt}),Ut=u.merge(Vt),Wt=d.extend({method:K(`notifications/tasks/status`),params:Ut}),Gt=l.extend({method:K(`tasks/get`),params:s.extend({taskId:I()})}),Kt=f.merge(Vt),qt=l.extend({method:K(`tasks/result`),params:s.extend({taskId:I()})}),Jt=f.loose(),Yt=ie.extend({method:K(`tasks/list`)}),Xt=ae.extend({tasks:B(Vt)}),Zt=l.extend({method:K(`tasks/cancel`),params:s.extend({taskId:I()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:w,InitializeRequestParamsSchema:T,InitializeRequestSchema:E,ServerCapabilitiesSchema:D,InitializeResultSchema:ee,InitializedNotificationSchema:O,PingRequestSchema:k,ProgressSchema:A,ProgressNotificationParamsSchema:te,ProgressNotificationSchema:ne,PaginatedRequestParamsSchema:re,PaginatedRequestSchema:ie,PaginatedResultSchema:ae,ResourceContentsSchema:oe,TextResourceContentsSchema:se,BlobResourceContentsSchema:j,RoleSchema:le,AnnotationsSchema:ue,ResourceSchema:de,ResourceTemplateSchema:fe,ListResourcesRequestSchema:pe,ListResourcesResultSchema:me,ListResourceTemplatesRequestSchema:he,ListResourceTemplatesResultSchema:ge,ResourceRequestParamsSchema:_e,ReadResourceRequestParamsSchema:M,ReadResourceRequestSchema:N,ReadResourceResultSchema:P,ResourceListChangedNotificationSchema:ve,SubscribeRequestParamsSchema:ye,SubscribeRequestSchema:be,UnsubscribeRequestParamsSchema:xe,UnsubscribeRequestSchema:Se,ResourceUpdatedNotificationParamsSchema:Ce,ResourceUpdatedNotificationSchema:we,PromptArgumentSchema:Te,PromptSchema:Ee,ListPromptsRequestSchema:De,ListPromptsResultSchema:Oe,GetPromptRequestParamsSchema:ke,GetPromptRequestSchema:Ae,TextContentSchema:je,ImageContentSchema:Me,AudioContentSchema:Ne,ToolUseContentSchema:Pe,EmbeddedResourceSchema:Fe,ResourceLinkSchema:Ie,ContentBlockSchema:Le,PromptMessageSchema:Re,GetPromptResultSchema:ze,PromptListChangedNotificationSchema:Be,ToolAnnotationsSchema:Ve,ToolExecutionSchema:He,ToolSchema:Ue,ListToolsRequestSchema:We,ListToolsResultSchema:Ge,CallToolResultSchema:Ke,CallToolRequestParamsSchema:qe,CallToolRequestSchema:Je,ToolListChangedNotificationSchema:Ye,LoggingLevelSchema:Xe,SetLevelRequestParamsSchema:Ze,SetLevelRequestSchema:Qe,LoggingMessageNotificationParamsSchema:$e,LoggingMessageNotificationSchema:et,ModelHintSchema:tt,ModelPreferencesSchema:nt,ToolChoiceSchema:rt,ToolResultContentSchema:F,SamplingContentSchema:it,SamplingMessageContentBlockSchema:at,SamplingMessageSchema:ot,CreateMessageRequestParamsSchema:st,CreateMessageRequestSchema:ct,CreateMessageResultSchema:lt,CreateMessageResultWithToolsSchema:ut,BooleanSchemaSchema:dt,StringSchemaSchema:ft,NumberSchemaSchema:pt,UntitledSingleSelectEnumSchemaSchema:mt,TitledSingleSelectEnumSchemaSchema:ht,LegacyTitledEnumSchemaSchema:gt,SingleSelectEnumSchemaSchema:_t,UntitledMultiSelectEnumSchemaSchema:vt,TitledMultiSelectEnumSchemaSchema:yt,MultiSelectEnumSchemaSchema:bt,EnumSchemaSchema:xt,PrimitiveSchemaDefinitionSchema:St,ElicitRequestFormParamsSchema:Ct,ElicitRequestURLParamsSchema:wt,ElicitRequestParamsSchema:Tt,ElicitRequestSchema:Et,ElicitationCompleteNotificationParamsSchema:Dt,ElicitationCompleteNotificationSchema:Ot,ElicitResultSchema:kt,ResourceTemplateReferenceSchema:At,PromptReferenceSchema:jt,CompleteRequestParamsSchema:Mt,CompleteRequestSchema:Nt,CompleteResultSchema:Pt,RootSchema:Ft,ListRootsRequestSchema:It,ListRootsResultSchema:Lt,RootsListChangedNotificationSchema:Rt,TaskCreationParamsSchema:zt,TaskStatusSchema:Bt,TaskSchema:Vt,CreateTaskResultSchema:Ht,TaskStatusNotificationParamsSchema:Ut,TaskStatusNotificationSchema:Wt,GetTaskRequestSchema:Gt,GetTaskResultSchema:Kt,GetTaskPayloadRequestSchema:qt,GetTaskPayloadResultSchema:Jt,ListTasksRequestSchema:Yt,ListTasksResultSchema:Xt,CancelTaskRequestSchema:Zt,CancelTaskResultSchema:f.merge(Vt),ClientRequestSchema:U([k,E,Nt,Qe,Ae,De,pe,he,N,be,Se,Je,We,Gt,qt,Yt,Zt]),ClientNotificationSchema:U([g,ne,O,Rt,Wt]),ClientResultSchema:U([m,lt,ut,kt,Lt,Kt,Xt,Ht]),ServerRequestSchema:U([k,ct,Et,It,Gt,qt,Yt,Zt]),ServerNotificationSchema:U([g,ne,et,we,ve,Ye,Be,Wt,Ot]),ServerResultSchema:U([m,ee,Pt,ze,Oe,me,ge,P,Ke,Ge,Kt,Xt,Ht]),CallToolResultWireSchema:z().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of Im)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Lm).pipe(Ke)}}var zm;function Bm(){return zm??=Rm()}function Vm(e){return e.type!==`object`}var Hm=new Set([`const`,`enum`,`default`,`examples`]),Um=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function Wm(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Gm(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(Wm(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Qu(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&Wm(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Hm.has(o)?s:Um.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Km={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},qm={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Jm={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ym;function Xm(){if(Ym)return Ym;let e=Bm();return Ym={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ym}function Zm(e){return Object.prototype.hasOwnProperty.call(Km,e)}function Qm(e){return Object.prototype.hasOwnProperty.call(qm,e)}function $m(e){return Object.prototype.hasOwnProperty.call(Jm,e)}function eh(e){return $m(e)?Xm().resultSchemas[e]:void 0}function th(e){return Zm(e)?Xm().requestSchemas[e]:void 0}function nh(e){return Qm(e)?Xm().notificationSchemas[e]:void 0}Object.keys(Km),Object.keys(qm);function rh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ih(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ah={ok:!1,reason:`not-in-era`};function oh(e){return rh(e)&&rh(e.outputSchema)&&Vm(e.outputSchema)}function sh(e){return e}var ch={era:`2025-11-25`,hasRequestMethod:Zm,hasNotificationMethod:Qm,validateRequest:(e,t)=>ih(th(e),t),validateResult:(e,t)=>ih(eh(e),t),validateNotification:(e,t)=>ih(nh(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ah,validateInputResponse:()=>ah,samplingResultVariant:((e,t)=>{let n=Bm();return ih(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=Fm(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&Vm(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(rh(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:sh(e)}}return{kind:`complete`,result:sh(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>oh(e))?t:{...t,tools:n.map(e=>oh(e)?{...e,outputSchema:Gm(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function lh(){let e=ul(()=>U([I(),L(),R(),Tc(),W(I(),e),B(e)])),t=W(I(),e),n=U([I(),L().int()]),r=I(),i=U([I(),L().int()]),a=G([`user`,`assistant`]),o=G([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=I().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=V({ttl:L().optional()}),l=V({taskId:I()}),u=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=V({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=V({_meta:u.optional()}),m=V({method:I(),params:p.loose().optional()}),h=V({src:I(),mimeType:I().optional(),sizes:B(I()).optional(),theme:G([`light`,`dark`]).optional()}),g=V({icons:B(h).optional()}),_=V({name:I(),title:I().optional()}),v=_.extend({..._.shape,...g.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),y=ml(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Lc(V({form:Lc(V({applyDefaults:R().optional()}),t).optional(),url:t.optional()}),t.optional())),b=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),x=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),S=V({experimental:W(I(),t).optional(),sampling:V({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:V({listChanged:R().optional()}).optional(),tasks:b.optional(),extensions:W(I(),t).optional()}),C=V({experimental:W(I(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:V({listChanged:R().optional()}).optional(),resources:V({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:V({listChanged:R().optional()}).optional(),tasks:x.optional(),extensions:W(I(),t).optional()}),w=V({progress:L(),total:q(L()),message:q(I())}),T=V({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:K(`notifications/progress`),params:T}),D=p.extend({level:o,logger:I().optional(),data:z()}),ee=m.extend({method:K(`notifications/message`),params:D}),O=V({uri:I(),mimeType:q(I()),_meta:W(I(),z()).optional()}),k=O.extend({text:I()}),A=O.extend({blob:s}),te=V({audience:B(a).optional(),priority:L().min(0).max(1).optional(),lastModified:_l({offset:!0}).optional()}),ne=V({..._.shape,...g.shape,uri:I(),description:q(I()),mimeType:q(I()),size:q(L()),annotations:te.optional(),_meta:q(H({}))}),re=V({..._.shape,...g.shape,uriTemplate:I(),description:q(I()),mimeType:q(I()),annotations:te.optional(),_meta:q(H({}))}),ie=m.extend({method:K(`notifications/resources/list_changed`),params:p.optional()}),ae=p.extend({uri:I()}),oe=m.extend({method:K(`notifications/resources/updated`),params:ae}),se=V({name:I(),description:q(I()),required:q(R())}),ce=V({..._.shape,...g.shape,description:q(I()),arguments:q(B(se)),_meta:q(H({}))}),j=m.extend({method:K(`notifications/prompts/list_changed`),params:p.optional()}),le=V({type:K(`text`),text:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),ue=V({type:K(`image`),data:s,mimeType:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),de=V({type:K(`audio`),data:s,mimeType:I(),annotations:te.optional(),_meta:W(I(),z()).optional()}),fe=V({type:K(`tool_use`),name:I(),id:I(),input:W(I(),z()),_meta:W(I(),z()).optional()}),pe=V({type:K(`resource`),resource:U([k,A]),annotations:te.optional(),_meta:W(I(),z()).optional()}),me=ne.extend({type:K(`resource_link`)}),he=U([le,ue,de,me,pe]),ge=V({role:a,content:he}),_e=V({title:I().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),M=m.extend({method:K(`notifications/tools/list_changed`),params:p.optional()}),N=V({name:I().optional()}),P=V({hints:B(N).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ve=V({mode:G([`auto`,`required`,`none`]).optional()}),ye=V({type:K(`boolean`),title:I().optional(),description:I().optional(),default:R().optional()}),be=V({type:K(`string`),title:I().optional(),description:I().optional(),minLength:L().optional(),maxLength:L().optional(),format:G([`email`,`uri`,`date`,`date-time`]).optional(),default:I().optional()}),xe=V({type:G([`number`,`integer`]),title:I().optional(),description:I().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Se=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),default:I().optional()}),Ce=V({type:K(`string`),title:I().optional(),description:I().optional(),oneOf:B(V({const:I(),title:I()})),default:I().optional()}),we=V({type:K(`string`),title:I().optional(),description:I().optional(),enum:B(I()),enumNames:B(I()).optional(),default:I().optional()}),Te=U([Se,Ce]),Ee=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({type:K(`string`),enum:B(I())}),default:B(I()).optional()}),De=V({type:K(`array`),title:I().optional(),description:I().optional(),minItems:L().optional(),maxItems:L().optional(),items:V({anyOf:B(V({const:I(),title:I()}))}),default:B(I()).optional()}),Oe=U([Ee,De]),ke=U([we,Te,Oe]),Ae=U([ke,ye,be,xe]),je=f.extend({mode:K(`form`).optional(),message:I(),requestedSchema:V({type:K(`object`),properties:W(I(),Ae),required:B(I()).optional()}).catchall(z())}),Me=V({type:K(`ref/resource`),uri:I()}),Ne=V({type:K(`ref/prompt`),name:I()}),Pe=V({uri:I().startsWith(`file://`),name:I().optional(),_meta:W(I(),z()).optional()}),Fe=S.shape,Ie=V({experimental:Fe.experimental,sampling:Fe.sampling,elicitation:Fe.elicitation,roots:Fe.roots,extensions:Fe.extensions}),Le=C.shape,Re=V({experimental:Le.experimental,logging:Le.logging,completions:Le.completions,prompts:Le.prompts,resources:Le.resources,tools:Le.tools,extensions:Le.extensions}),ze=H({progressToken:n.optional(),[td]:I(),[nd]:v.optional(),[id]:Ie,[od]:o.optional()}),Be=V({..._.shape,...g.shape,description:I().optional(),inputSchema:H({$schema:I().optional(),type:K(`object`)}),outputSchema:H({$schema:I().optional()}).optional(),annotations:_e.optional(),_meta:W(I(),z()).optional()}),Ve=V({type:K(`tool_result`),toolUseId:I(),content:B(he),structuredContent:z().optional(),isError:R().optional(),_meta:W(I(),z()).optional()}),He=U([le,ue,de,fe,Ve]),Ue=V({role:a,content:U([He,B(He)]),_meta:W(I(),z()).optional()}),We=I(),Ge=H({[rd]:v.optional().catch(void 0)}),Ke=Ge.optional();function qe(e){return H({_meta:Ke,resultType:We.default(`complete`),...e})}let Je=qe({}),Ye=qe({nextCursor:r.optional()}),Xe=qe({content:B(he),structuredContent:z().optional(),isError:R().optional()}),Ze=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),tools:B(Be),nextCursor:r.optional()}),Qe=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),prompts:B(ce),nextCursor:r.optional()}),$e=qe({description:I().optional(),messages:B(ge)}),et=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resources:B(ne),nextCursor:r.optional()}),tt=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resourceTemplates:B(re),nextCursor:r.optional()}),nt=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),contents:B(U([k,A]))}),rt=qe({completion:V({values:B(I()).max(100),total:L().int().optional(),hasMore:R().optional()}).loose()}),F=qe({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`])}),it=qe({ttlMs:L().int().min(0).catch(0),cacheScope:G([`public`,`private`]).catch(`private`),supportedVersions:B(I()),capabilities:Re,instructions:I().optional()}),at=V({messages:B(Ue),modelPreferences:P.optional(),systemPrompt:I().optional(),includeContext:G([`none`,`thisServer`,`allServers`]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:B(I()).optional(),metadata:t.optional(),tools:B(Be).optional(),toolChoice:ve.optional()}),ot=V({method:K(`sampling/createMessage`),params:at}),st=V({method:K(`roots/list`),params:V({_meta:W(I(),z()).optional()}).optional()}),ct=V({...Ue.shape,model:I(),stopReason:I().optional()}),lt=V({roots:B(Pe)}),ut=V({action:G([`accept`,`decline`,`cancel`]),content:W(I(),U([I(),L(),R(),B(I())])).optional()}),dt=V({mode:K(`url`),message:I(),url:I().url()}),ft=U([je,dt]),pt=V({method:K(`elicitation/create`),params:ft}),mt=U([ot,st,pt]),ht=U([ct,lt,ut]),gt=W(I(),mt),_t=W(I(),ht),vt=qe({inputRequests:gt.optional(),requestState:I().optional()}),yt={inputResponses:_t.optional(),requestState:I().optional()},bt=V({_meta:ze,...yt}),xt=H({progressToken:n.optional()});function St(e,t){return V({method:K(e),params:V({_meta:ze,...t})})}function Ct(e,t){return V({method:K(e),params:V({_meta:xt.optional(),...t}).optional()})}let wt={name:I(),arguments:W(I(),z()).optional(),...yt},Tt={cursor:r.optional()},Et=St(`tools/call`,wt),Dt=St(`tools/list`,Tt),Ot=St(`prompts/list`,Tt),kt=St(`prompts/get`,{name:I(),arguments:W(I(),I()).optional(),...yt}),At=St(`resources/list`,Tt),jt=St(`resources/templates/list`,Tt),Mt=St(`resources/read`,{uri:I(),...yt}),Nt={ref:U([Ne,Me]),argument:V({name:I(),value:I()}),context:V({arguments:W(I(),I()).optional()}).optional()},Pt=St(`completion/complete`,Nt),Ft=St(`server/discover`,{}),It=V({toolsListChanged:R().optional(),promptsListChanged:R().optional(),resourcesListChanged:R().optional(),resourceSubscriptions:B(I()).optional()}),Lt={notifications:It},Rt=St(`subscriptions/listen`,Lt),zt=Ge.extend({"io.modelcontextprotocol/subscriptionId":i}),Bt=H({_meta:zt,resultType:We.default(`complete`)}),Vt={"tools/call":Ct(`tools/call`,wt),"tools/list":Ct(`tools/list`,Tt),"prompts/get":Ct(`prompts/get`,{name:I(),arguments:W(I(),I()).optional()}),"prompts/list":Ct(`prompts/list`,Tt),"resources/list":Ct(`resources/list`,Tt),"resources/templates/list":Ct(`resources/templates/list`,Tt),"resources/read":Ct(`resources/read`,{uri:I()}),"completion/complete":Ct(`completion/complete`,Nt),"server/discover":Ct(`server/discover`,{}),"subscriptions/listen":Ct(`subscriptions/listen`,Lt)};function Ht(e){return H({_meta:Ke,...e})}let Ut={"tools/call":Ht({content:B(he),structuredContent:z().optional(),isError:R().optional()}),"tools/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),tools:B(Be),nextCursor:r.optional()}),"prompts/get":Ht({description:I().optional(),messages:B(ge)}),"prompts/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),prompts:B(ce),nextCursor:r.optional()}),"resources/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resources:B(ne),nextCursor:r.optional()}),"resources/templates/list":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),resourceTemplates:B(re),nextCursor:r.optional()}),"resources/read":Ht({ttlMs:L().int().min(0),cacheScope:G([`public`,`private`]),contents:B(U([k,A]))}),"completion/complete":Ht({completion:V({values:B(I()).max(100),total:L().int().optional(),hasMore:R().optional()}).loose()}),"server/discover":Ht({ttlMs:L().int().min(0).catch(0),cacheScope:G([`public`,`private`]).catch(`private`),supportedVersions:B(I()),capabilities:Re,instructions:I().optional()}),"subscriptions/listen":Ht({})},Wt=H({"io.modelcontextprotocol/subscriptionId":i.optional()}),Gt=V({method:K(`notifications/subscriptions/acknowledged`),params:V({_meta:Wt.optional(),notifications:It})}),Kt=V({_meta:Wt.optional(),requestId:i,reason:I().optional()}),qt=V({method:K(`notifications/cancelled`),params:Kt}),Jt={"notifications/cancelled":qt,"notifications/progress":E,"notifications/message":ee,"notifications/resources/updated":oe,"notifications/resources/list_changed":ie,"notifications/tools/list_changed":M,"notifications/prompts/list_changed":j,"notifications/subscriptions/acknowledged":Gt},Yt=e=>V({jsonrpc:K(`2.0`),id:U([I(),L().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:C,ProgressSchema:w,ProgressNotificationParamsSchema:T,ProgressNotificationSchema:E,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:ee,ResourceContentsSchema:O,TextResourceContentsSchema:k,BlobResourceContentsSchema:A,AnnotationsSchema:te,ResourceSchema:ne,ResourceTemplateSchema:re,ResourceListChangedNotificationSchema:ie,ResourceUpdatedNotificationParamsSchema:ae,ResourceUpdatedNotificationSchema:oe,PromptArgumentSchema:se,PromptSchema:ce,PromptListChangedNotificationSchema:j,TextContentSchema:le,ImageContentSchema:ue,AudioContentSchema:de,ToolUseContentSchema:fe,EmbeddedResourceSchema:pe,ResourceLinkSchema:me,ContentBlockSchema:he,PromptMessageSchema:ge,ToolAnnotationsSchema:_e,ToolListChangedNotificationSchema:M,ModelHintSchema:N,ModelPreferencesSchema:P,ToolChoiceSchema:ve,BooleanSchemaSchema:ye,StringSchemaSchema:be,NumberSchemaSchema:xe,UntitledSingleSelectEnumSchemaSchema:Se,TitledSingleSelectEnumSchemaSchema:Ce,LegacyTitledEnumSchemaSchema:we,SingleSelectEnumSchemaSchema:Te,UntitledMultiSelectEnumSchemaSchema:Ee,TitledMultiSelectEnumSchemaSchema:De,MultiSelectEnumSchemaSchema:Oe,EnumSchemaSchema:ke,PrimitiveSchemaDefinitionSchema:Ae,ElicitRequestFormParamsSchema:je,ResourceTemplateReferenceSchema:Me,PromptReferenceSchema:Ne,RootSchema:Pe,ClientCapabilities2026Schema:Ie,ServerCapabilities2026Schema:Re,RequestMetaEnvelopeSchema:ze,ToolSchema:Be,ToolResultContentSchema:Ve,SamplingMessageContentBlockSchema:He,SamplingMessageSchema:Ue,ResultTypeSchema:We,ResultMetaSchema:Ge,ResultSchema:Je,PaginatedResultSchema:Ye,CallToolResultSchema:Xe,ListToolsResultSchema:Ze,ListPromptsResultSchema:Qe,GetPromptResultSchema:$e,ListResourcesResultSchema:et,ListResourceTemplatesResultSchema:tt,ReadResourceResultSchema:nt,CompleteResultSchema:rt,CacheableResultSchema:F,DiscoverResultSchema:it,CreateMessageRequestParamsSchema:at,CreateMessageRequestSchema:ot,ListRootsRequestSchema:st,CreateMessageResultSchema:ct,ListRootsResultSchema:lt,ElicitResultSchema:ut,ElicitRequestURLParamsSchema:dt,ElicitRequestParamsSchema:ft,ElicitRequestSchema:pt,InputRequestSchema:mt,InputResponseSchema:ht,InputRequestsSchema:gt,InputResponsesSchema:_t,InputRequiredResultSchema:vt,InputResponseRequestParamsSchema:bt,CallToolRequestSchema:Et,ListToolsRequestSchema:Dt,ListPromptsRequestSchema:Ot,GetPromptRequestSchema:kt,ListResourcesRequestSchema:At,ListResourceTemplatesRequestSchema:jt,ReadResourceRequestSchema:Mt,CompleteRequestSchema:Pt,DiscoverRequestSchema:Ft,SubscriptionFilterSchema:It,SubscriptionsListenRequestSchema:Rt,SubscriptionsListenResultMetaSchema:zt,SubscriptionsListenResultSchema:Bt,dispatchRequestSchemas:Vt,dispatchResultSchemas:Ut,NotificationMetaSchema:Wt,SubscriptionsAcknowledgedNotificationSchema:Gt,CancelledNotificationParamsSchema:Kt,CancelledNotificationSchema:qt,notificationSchemas2026:Jt,JSONRPCResultResponseSchema:Yt(Je),CallToolResultResponseSchema:Yt(U([Xe,vt])),ListToolsResultResponseSchema:Yt(Ze),ListPromptsResultResponseSchema:Yt(Qe),GetPromptResultResponseSchema:Yt(U([$e,vt])),ListResourcesResultResponseSchema:Yt(et),ListResourceTemplatesResultResponseSchema:Yt(tt),ReadResourceResultResponseSchema:Yt(U([nt,vt])),CompleteResultResponseSchema:Yt(rt),DiscoverResultResponseSchema:Yt(it)}}var uh;function dh(){return uh??=lh()}var fh=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function ph(e){return fh.includes(e)}var mh=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function hh(e){return e[mh]}function gh(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function _h(e){return e===`public`||e===`private`}var vh=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),yh=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,km(this,new.target)}static fromError(t,n,r){if(t===vh.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new xh(e.elicitations,n)}if(t===vh.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Sh({supported:e.supported,requested:e.requested},n)}if(t===vh.InvalidParams||t===vh.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===vh.ResourceNotFound||Object.keys(e).length===1))return new bh(e.uri,n)}if(t===vh.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Ch({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},bh=class extends yh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(vh.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},xh=class extends yh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(vh.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Sh=class extends yh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(vh.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Ch=class extends yh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(vh.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},wh=0,Th=`private`,Eh=[`tools/call`,`prompts/get`,`resources/read`];function Dh(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Eh.includes(e))return t;throw new yh(vh.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Oh(e,t){let n=hh(t);if(t.resultType!==`complete`||!ph(e))return n===void 0?t:Nh(t);let r=t,i=gh(r.ttlMs)?r.ttlMs:jh(n),a=_h(r.cacheScope)?r.cacheScope:Mh(n),o={...r,ttlMs:i,cacheScope:a};return delete o[mh],o}function kh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ah(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[rd]:t}}:!kh(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[rd]:t}}}function jh(e){return e!==void 0&&gh(e.ttlMs)?e.ttlMs:wh}function Mh(e){return e!==void 0&&_h(e.cacheScope)?e.cacheScope:Th}function Nh(e){let t={...e};return delete t[mh],t}var Ph=[`elicitation/create`,`sampling/createMessage`,`roots/list`],Fh;function Ih(){if(Fh)return Fh;let e=dh();return Fh={request:{"elicitation/create":V({method:K(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":V({method:K(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":V({method:K(`roots/list`),params:H({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Fh}function Lh(e){return Ph.includes(e)}function Rh(e){return Lh(e)?Ih().request[e]:void 0}function zh(e){return Lh(e)?Ih().response[e]:void 0}var Bh={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Vh={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Hh(e){return Object.prototype.hasOwnProperty.call(Bh,e)}function Uh(e){return Object.prototype.hasOwnProperty.call(Vh,e)}function Wh(e){return Object.prototype.hasOwnProperty.call(Bh,e)}function Gh(e){return Hh(e)?dh().dispatchRequestSchemas[e]:void 0}function Kh(e){return Wh(e)?dh().dispatchResultSchemas[e]:void 0}function qh(e){return Uh(e)?dh().notificationSchemas2026[e]:void 0}Object.keys(Bh),Object.keys(Vh);function Jh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Yh(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Xh={ok:!1,reason:`not-in-era`},Zh=[td,id];function Qh(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Jh(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Jh(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Jh(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var $h={era:`2026-07-28`,hasRequestMethod:Hh,hasNotificationMethod:Uh,hasInputRequestMethod:e=>Rh(e)!==void 0,validateRequest:(e,t)=>Yh(Gh(e),t),validateResult:(e,t)=>Yh(Kh(e),t),validateNotification:(e,t)=>Yh(qh(e),t),validateInputRequest:(e,t)=>Yh(Rh(e),t),validateInputResponse:(e,t)=>Yh(zh(e),t),samplingResultVariant:()=>Xh,outboundEnvelope(e){return{[td]:e.protocolVersion,[nd]:e.clientInfo,[id]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Zh)n in e||t.push({key:n,problem:`missing`});let n=dh().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>Fm(e),inputRequestSchema:Rh,decodeResult(e,t){if(!Jh(t))return{kind:`invalid`,error:new Mm(jm.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Mm(jm.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Mm(jm.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Jh(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:dh().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Mm(jm.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Mm(jm.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=tg(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Mm(jm.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return Ah(Oh(e,Dh(e,Qh(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=dh().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},eg;function tg(){if(eg)return eg;let e=dh();return eg={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},eg}var ng=`2026-07-28`;function rg(e){return e!==void 0&&Pm(e)?$h:ch}function ig(e){return e.revision===void 0?e.era===`modern`?$h.era:ch.era:rg(e.revision).era}function ag(e){return sg.some(t=>t.hasRequestMethod(e))}function og(e){return sg.some(t=>t.hasNotificationMethod(e))}var sg=[ch,$h],cg=Xu({AnnotationsSchema:()=>of,AudioContentSchema:()=>zf,BaseMetadataSchema:()=>Pd,BaseRequestParamsSchema:()=>hd,BlobResourceContentsSchema:()=>rf,BooleanSchemaSchema:()=>bp,CallToolRequestParamsSchema:()=>ep,CallToolRequestSchema:()=>tp,CallToolResultSchema:()=>Qf,CancelTaskRequestSchema:()=>om,CancelTaskResultSchema:()=>sm,CancelledNotificationParamsSchema:()=>Ad,CancelledNotificationSchema:()=>jd,ClientCapabilitiesSchema:()=>zd,ClientNotificationSchema:()=>lm,ClientRequestSchema:()=>cm,ClientResultSchema:()=>um,ClientTasksCapabilitySchema:()=>Ld,CompatibilityCallToolResultSchema:()=>$f,CompleteRequestParamsSchema:()=>Vp,CompleteRequestSchema:()=>Hp,CompleteResultSchema:()=>Up,ContentBlockSchema:()=>Uf,CreateMessageRequestParamsSchema:()=>gp,CreateMessageRequestSchema:()=>_p,CreateMessageResultSchema:()=>vp,CreateMessageResultWithToolsSchema:()=>yp,CreateTaskResultSchema:()=>Zp,CursorSchema:()=>dd,DiscoverRequestSchema:()=>Gd,DiscoverResultSchema:()=>Kd,ElicitRequestFormParamsSchema:()=>Mp,ElicitRequestParamsSchema:()=>Pp,ElicitRequestSchema:()=>Fp,ElicitRequestURLParamsSchema:()=>Np,ElicitResultSchema:()=>Rp,ElicitationCompleteNotificationParamsSchema:()=>Ip,ElicitationCompleteNotificationSchema:()=>Lp,EmbeddedResourceSchema:()=>Vf,EmptyResultSchema:()=>kd,EnumSchemaSchema:()=>Ap,GetPromptRequestParamsSchema:()=>Ff,GetPromptRequestSchema:()=>If,GetPromptResultSchema:()=>Gf,GetTaskPayloadRequestSchema:()=>nm,GetTaskPayloadResultSchema:()=>rm,GetTaskRequestSchema:()=>em,GetTaskResultSchema:()=>tm,IconSchema:()=>Md,IconsSchema:()=>Nd,ImageContentSchema:()=>Rf,ImplementationSchema:()=>Fd,InitializeRequestParamsSchema:()=>Bd,InitializeRequestSchema:()=>Vd,InitializeResultSchema:()=>Ud,InitializedNotificationSchema:()=>Wd,JSONArraySchema:()=>ld,JSONObjectSchema:()=>cd,JSONRPCErrorResponseSchema:()=>Ed,JSONRPCMessageSchema:()=>Dd,JSONRPCNotificationSchema:()=>wd,JSONRPCRequestSchema:()=>Cd,JSONRPCResponseSchema:()=>Od,JSONRPCResultResponseSchema:()=>Td,JSONValueSchema:()=>sd,LegacyTitledEnumSchemaSchema:()=>Tp,ListChangedOptionsBaseSchema:()=>rp,ListPromptsRequestSchema:()=>Nf,ListPromptsResultSchema:()=>Pf,ListResourceTemplatesRequestSchema:()=>df,ListResourceTemplatesResultSchema:()=>ff,ListResourcesRequestSchema:()=>lf,ListResourcesResultSchema:()=>uf,ListRootsRequestSchema:()=>Gp,ListRootsResultSchema:()=>Kp,ListTasksRequestSchema:()=>im,ListTasksResultSchema:()=>am,ListToolsRequestSchema:()=>Xf,ListToolsResultSchema:()=>Zf,LoggingLevelSchema:()=>ip,LoggingMessageNotificationParamsSchema:()=>sp,LoggingMessageNotificationSchema:()=>cp,ModelHintSchema:()=>lp,ModelPreferencesSchema:()=>up,MultiSelectEnumSchemaSchema:()=>kp,NotificationSchema:()=>yd,NotificationsParamsSchema:()=>vd,NumberSchemaSchema:()=>Sp,PaginatedRequestParamsSchema:()=>Zd,PaginatedRequestSchema:()=>Qd,PaginatedResultSchema:()=>$d,PingRequestSchema:()=>qd,PrimitiveSchemaDefinitionSchema:()=>jp,ProgressNotificationParamsSchema:()=>Yd,ProgressNotificationSchema:()=>Xd,ProgressSchema:()=>Jd,ProgressTokenSchema:()=>ud,PromptArgumentSchema:()=>jf,PromptListChangedNotificationSchema:()=>Kf,PromptMessageSchema:()=>Wf,PromptReferenceSchema:()=>Bp,PromptSchema:()=>Mf,ReadResourceRequestParamsSchema:()=>mf,ReadResourceRequestSchema:()=>hf,ReadResourceResultSchema:()=>gf,RelatedTaskMetadataSchema:()=>pd,RequestIdSchema:()=>Sd,RequestMetaSchema:()=>md,RequestSchema:()=>_d,ResourceContentsSchema:()=>ef,ResourceLinkSchema:()=>Hf,ResourceListChangedNotificationSchema:()=>_f,ResourceRequestParamsSchema:()=>pf,ResourceSchema:()=>sf,ResourceTemplateReferenceSchema:()=>zp,ResourceTemplateSchema:()=>cf,ResourceUpdatedNotificationParamsSchema:()=>kf,ResourceUpdatedNotificationSchema:()=>Af,ResultMetaObjectSchema:()=>bd,ResultSchema:()=>xd,RoleSchema:()=>af,RootSchema:()=>Wp,RootsListChangedNotificationSchema:()=>qp,SamplingContentSchema:()=>pp,SamplingMessageContentBlockSchema:()=>mp,SamplingMessageSchema:()=>hp,ServerCapabilitiesSchema:()=>Hd,ServerNotificationSchema:()=>fm,ServerRequestSchema:()=>dm,ServerResultSchema:()=>pm,ServerTasksCapabilitySchema:()=>Rd,SetLevelRequestParamsSchema:()=>ap,SetLevelRequestSchema:()=>op,SingleSelectEnumSchemaSchema:()=>Ep,StringSchemaSchema:()=>xp,SubscribeRequestParamsSchema:()=>vf,SubscribeRequestSchema:()=>yf,SubscriptionFilterSchema:()=>Sf,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Tf,SubscriptionsAcknowledgedNotificationSchema:()=>Ef,SubscriptionsListenRequestParamsSchema:()=>Cf,SubscriptionsListenRequestSchema:()=>wf,SubscriptionsListenResultMetaSchema:()=>Df,SubscriptionsListenResultSchema:()=>Of,TaskAugmentedRequestParamsSchema:()=>gd,TaskCreationParamsSchema:()=>Jp,TaskMetadataSchema:()=>fd,TaskSchema:()=>Xp,TaskStatusNotificationParamsSchema:()=>Qp,TaskStatusNotificationSchema:()=>$p,TaskStatusSchema:()=>Yp,TextContentSchema:()=>Lf,TextResourceContentsSchema:()=>tf,TitledMultiSelectEnumSchemaSchema:()=>Op,TitledSingleSelectEnumSchemaSchema:()=>wp,ToolAnnotationsSchema:()=>qf,ToolChoiceSchema:()=>dp,ToolExecutionSchema:()=>Jf,ToolListChangedNotificationSchema:()=>np,ToolResultContentSchema:()=>fp,ToolSchema:()=>Yf,ToolUseContentSchema:()=>Bf,UnsubscribeRequestParamsSchema:()=>bf,UnsubscribeRequestSchema:()=>xf,UntitledMultiSelectEnumSchemaSchema:()=>Dp,UntitledSingleSelectEnumSchemaSchema:()=>Cp}),lg=e=>Cd.safeParse(e).success,ug=e=>wd.safeParse(e).success,dg=e=>Td.safeParse(e).success,fg=e=>Ed.safeParse(e).success;vh.InvalidRequest,vh.UnsupportedProtocolVersion,vh.InvalidParams,vh.MethodNotFound,vh.InvalidParams,vh.MissingRequiredClientCapability,vh.ParseError,vh.InvalidRequest,vh.MethodNotFound,vh.UnsupportedProtocolVersion,vh.MissingRequiredClientCapability;function pg(e,t){return js(e,t)}function mg(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function hg(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var gg=!1,_g=`draft-2020-12`;function vg(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:_g});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);gg||(gg=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=Ts(e,{target:_g,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&yg(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function yg(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||yg(e)))}return!1}function bg(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function xg(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>bg(e)).join(`, `)}:{success:!0,data:n.value}}function Sg(e){let t=Ts(e,{target:_g,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var Cg=/\\\.\\d\{(\d+)\}/;function wg(e){let t=Cg.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>_l({local:e,offset:t,precision:n}))))}function Tg(e,t){let n;switch(e){case`email`:n=[Qs()];break;case`uri`:n=[nc()];break;case`date`:n=[vl()];break;case`date-time`:n=wg(t)}return new Set(n.map(e=>Sg(e)).filter(e=>e!==void 0))}function Eg(e,t,n){return n!==`zod`||Tg(e,t).has(t)}function Dg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Og(e){try{return vg(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new yh(vh.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var kg=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Ag(e){return kg.has(e)||e.startsWith(`x-`)}var jg=new Set([`$schema`,...Object.keys(Mp.shape.requestedSchema.shape)]),Mg={string:mg([xp,Cp,wp,Tp]),number:mg([Sp]),integer:mg([Sp]),boolean:mg([bp]),array:mg([Dp,Op])},Ng=new Set(xp.shape.format.unwrap().options);function Pg(e,t,n,r){if(!Dg(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Mg,e.type)?Mg[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Ag(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Ng.has(e.format)?(typeof s!=`string`||!Eg(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Fg(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&Dg(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Pg(n,`properties.${e}`,t,r)])):jg.has(i)?n[i]=a:Ag(i)||r.push(i);if(r.length>0)throw new yh(vh.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Ig(e,t){if(!Dg(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!pg(jp,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Lg(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Lg(e,t[r],`${n}[${r}]`)):!Dg(e)||!Dg(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Lg(r,t[e],i):Ag(e)?[]:[i]})}function Rg(e){if(!hg(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Fg(Og(e.requestedSchema),t),r=pg(Mp.shape.requestedSchema,n);if(!r.success)throw new yh(vh.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ig(n,r.error.message)}`);let i=Lg(n,r.data);if(i.length>0)throw new yh(vh.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new yh(vh.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function zg(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(zg,{elicit(e){try{return{method:`elicitation/create`,params:Rg(e)}}catch(e){throw e instanceof yh?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Bg=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Vg={IdJagTokenExchangeResponseSchema:bm,OAuthClientInformationFullSchema:Tm,OAuthClientInformationSchema:wm,OAuthClientMetadataSchema:Cm,OAuthClientRegistrationErrorSchema:Em,OAuthErrorResponseSchema:xm,OAuthMetadataSchema:gm,OAuthProtectedResourceMetadataSchema:hm,OAuthTokenRevocationRequestSchema:Dm,OAuthTokensSchema:ym,OpenIdProviderDiscoveryMetadataSchema:vm,OpenIdProviderMetadataSchema:_m},Hg={},Ug={};function Wg(e,t){let n=e.slice(0,-6);Hg[n]=t,Ug[n]=e=>t.safeParse(e).success}for(let e of Bg)Wg(e,cg[e]);for(let[e,t]of Object.entries(Vg))Wg(e,t);Object.freeze(Hg),Object.freeze(Ug);function Gg(e){switch(e){case`initialize`:case`notifications/initialized`:return rg(void 0);case`server/discover`:return rg(ng);default:return}}var Kg=[td,nd,id,od],qg=[`inputResponses`,`requestState`];function Jg(e,t){let n=e.params;if(!$g(n))return{message:e,lifted:{}};let r=n._meta,i=$g(r)?Kg.filter(e=>e in r):[],a=t===`request`?qg.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&$g(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Yg(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Xg(e){return()=>e}var Zg=Xg(void 0),Qg=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??$u,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Mm(jm.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Mm(jm.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),dg(e)||fg(e)?this._onresponse(e):lg(e)?this._onrequest(e,t):ug(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Mm(jm.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Jg(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=ig(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(og(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Jg(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=ig(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(vh.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(ag(n.method)&&!i.hasRequestMethod(n.method)){o(vh.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(vh.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(vh.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:t_(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Zg:Xg(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),hg(t))return u(e,t,n);let i=Yg(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(vh.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:vh.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),dg(e)?n(e):n(yh.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),hg(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Yg(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return rg(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Gg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ag(t)&&!e.hasRequestMethod(t))throw new Mm(jm.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Mm?e:new Mm(jm.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Mm?e:new Mm(jm.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(n_(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;xg(n,o).then(e=>{e.success?d(e.data):f(new Mm(jm.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Mm(jm.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Mm(jm.NotConnected,`Not connected`);if(og(t.method)&&!e.hasNotificationMethod(t.method))throw new Mm(jm.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!ag(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new yh(vh.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await xg(t.params,{...r.params});if(!a.success)throw new yh(vh.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!og(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new yh(vh.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await xg(t.params,{...r.params});if(!i.success)throw new yh(vh.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function $g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function e_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t_(e){let t={},n=[];if(!e_(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!e_(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function n_(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}Yu((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);var r_=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,i_=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,a_=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,o_=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,s_=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,c_=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,l_=/^(?:\/(?:[^~/]|~0|~1)*)*$/,u_=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,d_=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,f_=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,p_=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function m_(e){return e.test.bind(e)}h_.bind(void 0,!1),m_(a_),m_(o_),m_(s_),m_(i_),m_(f_),m_(p_),m_(c_),m_(l_),m_(u_),m_(d_);function h_(e,t){let n=t.match(r_);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}globalThis.crypto;var g_,__,v_,y_,b_,x_=o((()=>{g_=`modulepreload`,__=function(e,t){return new URL(e,t).href},v_={},y_=function(e){return e.pathname.endsWith(`.css`)},b_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=__(t,n);let r=s(t);if(r.href in v_)return;v_[r.href]=!0;let i=y_(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:g_,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}})),S_=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e){super(e),this.name=new.target.name,km(this,new.target)}};(class extends S_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}}),class extends S_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},class extends S_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends S_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},class extends S_{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,km(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Am(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Am(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,km(this,new.target)}};var C_=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},w_=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},T_=new Set;function E_(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;T_.has(o)||(T_.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},D_(t)):e=>s({method:a,params:e})]}function D_(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var O_=`2026-01-26`,k_=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Dd.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},A_=U([K(`light`),K(`dark`)]).describe(`Color theme preference for the host environment.`),j_=U([K(`inline`),K(`fullscreen`),K(`pip`)]).describe(`Display mode for UI presentation.`),M_=W(U([K(`--color-background-primary`),K(`--color-background-secondary`),K(`--color-background-tertiary`),K(`--color-background-inverse`),K(`--color-background-ghost`),K(`--color-background-info`),K(`--color-background-danger`),K(`--color-background-success`),K(`--color-background-warning`),K(`--color-background-disabled`),K(`--color-text-primary`),K(`--color-text-secondary`),K(`--color-text-tertiary`),K(`--color-text-inverse`),K(`--color-text-ghost`),K(`--color-text-info`),K(`--color-text-danger`),K(`--color-text-success`),K(`--color-text-warning`),K(`--color-text-disabled`),K(`--color-border-primary`),K(`--color-border-secondary`),K(`--color-border-tertiary`),K(`--color-border-inverse`),K(`--color-border-ghost`),K(`--color-border-info`),K(`--color-border-danger`),K(`--color-border-success`),K(`--color-border-warning`),K(`--color-border-disabled`),K(`--color-ring-primary`),K(`--color-ring-secondary`),K(`--color-ring-inverse`),K(`--color-ring-info`),K(`--color-ring-danger`),K(`--color-ring-success`),K(`--color-ring-warning`),K(`--font-sans`),K(`--font-mono`),K(`--font-weight-normal`),K(`--font-weight-medium`),K(`--font-weight-semibold`),K(`--font-weight-bold`),K(`--font-text-xs-size`),K(`--font-text-sm-size`),K(`--font-text-md-size`),K(`--font-text-lg-size`),K(`--font-heading-xs-size`),K(`--font-heading-sm-size`),K(`--font-heading-md-size`),K(`--font-heading-lg-size`),K(`--font-heading-xl-size`),K(`--font-heading-2xl-size`),K(`--font-heading-3xl-size`),K(`--font-text-xs-line-height`),K(`--font-text-sm-line-height`),K(`--font-text-md-line-height`),K(`--font-text-lg-line-height`),K(`--font-heading-xs-line-height`),K(`--font-heading-sm-line-height`),K(`--font-heading-md-line-height`),K(`--font-heading-lg-line-height`),K(`--font-heading-xl-line-height`),K(`--font-heading-2xl-line-height`),K(`--font-heading-3xl-line-height`),K(`--border-radius-xs`),K(`--border-radius-sm`),K(`--border-radius-md`),K(`--border-radius-lg`),K(`--border-radius-xl`),K(`--border-radius-full`),K(`--border-width-regular`),K(`--shadow-hairline`),K(`--shadow-sm`),K(`--shadow-md`),K(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
70
70
 
71
71
  Individual style keys are optional - hosts may provide any subset of these values.
72
72
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -84,10 +84,10 @@ Individual style keys are optional - hosts may provide any subset of these value
84
84
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
85
85
 
86
86
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
87
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);V({method:K(`ui/open-link`),params:V({url:I().describe(`URL to open in the host's browser`)})});var M_=V({isError:R().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),N_=V({isError:R().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),P_=V({isError:R().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();V({method:K(`ui/notifications/sandbox-proxy-ready`),params:V({})});var F_=V({connectDomains:B(I()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
87
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);V({method:K(`ui/open-link`),params:V({url:I().describe(`URL to open in the host's browser`)})});var N_=V({isError:R().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),P_=V({isError:R().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),F_=V({isError:R().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();V({method:K(`ui/notifications/sandbox-proxy-ready`),params:V({})});var I_=V({connectDomains:B(I()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
88
88
 
89
89
  - Maps to CSP \`connect-src\` directive
90
- - Empty or omitted → no network connections (secure default)`),resourceDomains:B(I()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:B(I()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:B(I()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),I_=V({camera:V({}).optional().describe(`Request camera access.
90
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:B(I()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:B(I()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:B(I()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),L_=V({camera:V({}).optional().describe(`Request camera access.
91
91
 
92
92
  Maps to Permission Policy \`camera\` feature.`),microphone:V({}).optional().describe(`Request microphone access.
93
93
 
@@ -95,7 +95,7 @@ Maps to Permission Policy \`microphone\` feature.`),geolocation:V({}).optional()
95
95
 
96
96
  Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:V({}).optional().describe(`Request clipboard write access.
97
97
 
98
- Maps to Permission Policy \`clipboard-write\` feature.`)});V({method:K(`ui/notifications/size-changed`),params:V({width:L().optional().describe(`New width in pixels.`),height:L().optional().describe(`New height in pixels.`)})});var L_=V({method:K(`ui/notifications/tool-input`),params:V({arguments:W(I(),z().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),R_=V({method:K(`ui/notifications/tool-input-partial`),params:V({arguments:W(I(),z().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),z_=V({method:K(`ui/notifications/tool-cancelled`),params:V({reason:I().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})}),B_=V({fonts:I().optional()}),V_=V({variables:j_.optional().describe(`CSS variables for theming the app.`),css:B_.optional().describe(`CSS blocks that apps can inject.`)}),H_=V({method:K(`ui/resource-teardown`),params:V({})}),U_=W(I(),z()),W_=V({text:V({}).optional().describe(`Host supports text content blocks.`),image:V({}).optional().describe(`Host supports image content blocks.`),audio:V({}).optional().describe(`Host supports audio content blocks.`),resource:V({}).optional().describe(`Host supports resource content blocks.`),resourceLink:V({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:V({}).optional().describe(`Host supports structured content.`)});V({method:K(`ui/notifications/request-teardown`),params:V({}).optional()});var G_=V({experimental:W(I(),W(I(),Dc()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:V({}).optional().describe(`Host supports opening external URLs.`),downloadFile:V({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:V({listChanged:R().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:V({listChanged:R().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:V({}).optional().describe(`Host accepts log messages.`),sandbox:V({permissions:I_.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:F_.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:W_.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:W_.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:V({tools:V({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),K_=V({experimental:W(I(),W(I(),Dc()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:V({listChanged:R().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:B(A_).optional().describe(`Display modes the app supports.`)});V({method:K(`ui/notifications/initialized`),params:V({}).optional()}),V({csp:F_.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:I_.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:I().optional().describe(`Dedicated origin for view sandbox.
98
+ Maps to Permission Policy \`clipboard-write\` feature.`)});V({method:K(`ui/notifications/size-changed`),params:V({width:L().optional().describe(`New width in pixels.`),height:L().optional().describe(`New height in pixels.`)})});var R_=V({method:K(`ui/notifications/tool-input`),params:V({arguments:W(I(),z().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),z_=V({method:K(`ui/notifications/tool-input-partial`),params:V({arguments:W(I(),z().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),B_=V({method:K(`ui/notifications/tool-cancelled`),params:V({reason:I().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})}),V_=V({fonts:I().optional()}),H_=V({variables:M_.optional().describe(`CSS variables for theming the app.`),css:V_.optional().describe(`CSS blocks that apps can inject.`)}),U_=V({method:K(`ui/resource-teardown`),params:V({})}),W_=W(I(),z()),G_=V({text:V({}).optional().describe(`Host supports text content blocks.`),image:V({}).optional().describe(`Host supports image content blocks.`),audio:V({}).optional().describe(`Host supports audio content blocks.`),resource:V({}).optional().describe(`Host supports resource content blocks.`),resourceLink:V({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:V({}).optional().describe(`Host supports structured content.`)});V({method:K(`ui/notifications/request-teardown`),params:V({}).optional()});var K_=V({experimental:W(I(),W(I(),Dc()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:V({}).optional().describe(`Host supports opening external URLs.`),downloadFile:V({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:V({listChanged:R().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:V({listChanged:R().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:V({}).optional().describe(`Host accepts log messages.`),sandbox:V({permissions:L_.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:I_.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:G_.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:G_.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:V({tools:V({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),q_=V({experimental:W(I(),W(I(),Dc()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:V({listChanged:R().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:B(j_).optional().describe(`Display modes the app supports.`)});V({method:K(`ui/notifications/initialized`),params:V({}).optional()}),V({csp:I_.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:L_.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:I().optional().describe(`Dedicated origin for view sandbox.
99
99
 
100
100
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
101
101
 
@@ -109,10 +109,10 @@ Boolean requesting whether a visible border and background is provided by the ho
109
109
 
110
110
  - \`true\`: request visible border + background
111
111
  - \`false\`: request no visible border + background
112
- - omitted: host decides border`)}),V({method:K(`ui/request-display-mode`),params:V({mode:A_.describe(`The display mode being requested.`)})});var q_=V({mode:A_.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),J_=U([K(`model`),K(`app`)]).describe(`Tool visibility scope - who can access the tool.`);V({resourceUri:I().optional(),visibility:B(J_).optional().describe(`Who can access this tool. Default: ["model", "app"]
112
+ - omitted: host decides border`)}),V({method:K(`ui/request-display-mode`),params:V({mode:j_.describe(`The display mode being requested.`)})});var J_=V({mode:j_.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),Y_=U([K(`model`),K(`app`)]).describe(`Tool visibility scope - who can access the tool.`);V({resourceUri:I().optional(),visibility:B(Y_).optional().describe(`Who can access this tool. Default: ["model", "app"]
113
113
  - "model": Tool visible to and callable by the agent
114
- - "app": Tool callable by the app from this server only`),csp:Ac().optional(),permissions:Ac().optional()}),V({mimeTypes:B(I()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),V({method:K(`ui/download-file`),params:V({contents:B(U([Bf,Vf])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),V({method:K(`ui/message`),params:V({role:K(`user`).describe(`Message role, currently only "user" is supported.`),content:B(Hf).describe(`Message content blocks (text, image, etc.).`)})}),V({method:K(`ui/notifications/sandbox-resource-ready`),params:V({html:I().describe(`HTML content to load into the inner iframe.`),sandbox:I().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:F_.optional().describe(`CSP configuration from resource metadata.`),permissions:I_.optional().describe(`Sandbox permissions from resource metadata.`)})});var Y_=V({method:K(`ui/notifications/tool-result`),params:Zf.describe(`Standard MCP tool execution result.`)}),X_=V({toolInfo:V({id:xd.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Jf.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:k_.optional().describe(`Current color theme preference.`),styles:V_.optional().describe(`Style configuration for theming the app.`),displayMode:A_.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:B(A_).optional().describe(`Display modes the host supports.`),containerDimensions:U([V({height:L().describe(`Fixed container height in pixels.`)}),V({maxHeight:U([L(),Cc()]).optional().describe(`Maximum container height in pixels.`)})]).and(U([V({width:L().describe(`Fixed container width in pixels.`)}),V({maxWidth:U([L(),Cc()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
115
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:I().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:I().optional().describe(`User's timezone in IANA format.`),userAgent:I().optional().describe(`Host application identifier.`),platform:U([K(`web`),K(`desktop`),K(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:V({touch:R().optional().describe(`Whether the device supports touch input.`),hover:R().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:V({top:L().describe(`Top safe area inset in pixels.`),right:L().describe(`Right safe area inset in pixels.`),bottom:L().describe(`Bottom safe area inset in pixels.`),left:L().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Z_=V({method:K(`ui/notifications/host-context-changed`),params:X_.describe(`Partial context update containing only changed fields.`)});V({method:K(`ui/update-model-context`),params:V({content:B(Hf).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:W(I(),z().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),V({method:K(`ui/initialize`),params:V({appInfo:Pd.describe(`App identification (name and version).`),appCapabilities:K_.describe(`Features and capabilities this app provides.`),protocolVersion:I().describe(`Protocol version this app supports.`)})});var Q_=V({protocolVersion:I().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:Pd.describe(`Host application identification and version.`),hostCapabilities:G_.describe(`Features and capabilities provided by the host.`),hostContext:X_.describe(`Rich context about the host environment.`)}).passthrough(),$_={target:`draft-2020-12`};async function ev(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t]($_);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function tv(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function nv(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var rv=class e extends Zg{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new S_;_methods=new C_;setRequestHandler=(...e)=>{let[t,...n]=T_(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=T_(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:L_,toolinputpartial:R_,toolresult:Y_,toolcancelled:z_,hostcontextchanged:Z_};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&st({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=nv(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await tv(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await tv(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await ev(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await ev(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:H_.shape.params,result:U_},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},P_,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Od,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},M_,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},N_,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},q_,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new O_(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:D_}},Q_,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},iv=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function av(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:iv(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ov=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},sv=e=>{let t=ov(e);return t.charAt(0).toUpperCase()+t.slice(1)},cv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),lv={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function uv(e){return e!=null}function dv(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??lv.width,a=e.size??e.height??lv.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?cv(...c):cv(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??lv[`stroke-width`])*Number(e.size??e.width??lv.width)/Number(t.size??t.width??lv.width):t.strokeWidth??lv[`stroke-width`];return[`svg`,{...Object.entries(lv).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&uv(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&uv(t.width)&&{[r(`width`)]:t.width},...`height`in t&&uv(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function fv(e,t={}){return dv(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var pv=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},mv=(0,y.createContext)({}),hv=()=>(0,y.useContext)(mv),gv=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=hv()??{},b=!!c||pv(d),[x,S,C=[]]=fv(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:cv(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function J(e,t=[],n=[]){let r=typeof e==`string`?av(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(gv,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=sv(r.name)),i}var _v={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};_v.node;var vv=J(_v),yv={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};yv.node;var bv=J(yv),xv={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};xv.node;var Sv=J(xv),Cv={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Cv.node;var wv=J(Cv),Tv={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Tv.node;var Ev=J(Tv),Dv={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};Dv.node;var Ov=J(Dv),kv={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};kv.node;var Av=J(kv),jv={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};jv.node;var Mv=J(jv),Nv={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Nv.node;var Pv=J(Nv),Fv={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Fv.node;var Iv=J(Fv),Lv={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Lv.node;var Rv=J(Lv),zv={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};zv.node;var Bv=J(zv),Vv={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Vv.node;var Hv=J(Vv),Uv={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};Uv.node;var Wv=J(Uv),Gv={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Gv.node;var Kv=J(Gv),qv={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};qv.node;var Jv=J(qv),Yv={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};Yv.node;var Xv=J(Yv),Zv={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Zv.node;var Qv=J(Zv),$v={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};$v.node;var ey=J($v),ty={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};ty.node;var ny=J(ty),ry={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};ry.node;var iy=J(ry),ay={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};ay.node;var oy=J(ay),sy={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};sy.node;var cy=J(sy),ly={name:`flashlight-off`,size:24,node:[[`path`,{d:`M11.652 6H18`,key:`voqkpr`}],[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6`,key:`dzyf92`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007`,key:`1hvcfn`}]]};ly.node;var uy=J(ly),dy={name:`flashlight`,size:24,node:[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]};dy.node;var fy=J(dy),py={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};py.node;var my=J(py),hy={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};hy.node;var gy=J(hy),_y={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};_y.node;var vy=J(_y),yy={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};yy.node;var by=J(yy),xy={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};xy.node;var Sy=J(xy),Cy={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};Cy.node;var wy=J(Cy),Ty={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Ty.node;var Ey=J(Ty),Dy={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Dy.node;var Oy=J(Dy),ky={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ky.node;var Ay=J(ky),jy={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};jy.node;var My=J(jy),Ny={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Ny.node;var Py=J(Ny),Fy={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Fy.node;var Iy=J(Fy),Ly={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};Ly.node;var Ry=J(Ly),zy={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};zy.node;var By=J(zy),Vy={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Vy.node;var Hy=J(Vy),Uy={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Uy.node;var Wy=J(Uy),Gy={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Gy.node;var Ky=J(Gy),qy={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};qy.node;var Jy=J(qy),Yy={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Yy.node;var Xy=J(Yy),Zy={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Zy.node;var Qy=J(Zy),$y={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};$y.node;var eb=J($y),tb={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};tb.node;var nb=J(tb),rb={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};rb.node;var ib=J(rb),ab={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};ab.node;var ob=J(ab),sb={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};sb.node;var cb=J(sb),lb={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};lb.node;var ub=J(lb),db={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};db.node;var fb=J(db),pb={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};pb.node;var mb=J(pb),hb={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};hb.node;var gb=J(hb),_b={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};_b.node;var vb=J(_b),yb={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};yb.node;var bb=J(yb),xb={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};xb.node;var Sb=J(xb),Cb={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Cb.node;var wb=J(Cb),Tb={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Tb.node;var Eb=J(Tb),Db={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};Db.node;var Ob=J(Db),kb={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};kb.node;var Ab=J(kb),jb={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};jb.node;var Mb=J(jb),Nb={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Nb.node;var Pb=J(Nb),Fb={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Fb.node;var Ib=J(Fb),Lb,Rb,zb,Bb=o((()=>{Lb={cobalt:`var(--engenty-cobalt, oklch(60% 0.23 262))`,amber:`var(--engenty-amber, oklch(82% 0.17 78))`,moss:`var(--engenty-moss, oklch(72% 0.22 145))`,rose:`var(--engenty-rose, oklch(64% 0.25 18))`,ember:`var(--engenty-ember, oklch(70% 0.21 42))`,teal:`var(--engenty-teal, oklch(74% 0.16 192))`,violet:`var(--engenty-violet, oklch(60% 0.25 300))`,magenta:`var(--engenty-magenta, oklch(65% 0.28 345))`,citron:`var(--engenty-citron, oklch(89% 0.2 118))`,slate:`var(--engenty-slate, oklch(66% 0.13 235))`},Rb=[`round`,`drop`,`dome`,`flame`,`oval`],[...Rb],zb={bean:`teal`,dome:`moss`,drop:`amber`,flame:`rose`,oval:`ember`,pebble:`slate`,round:`cobalt`,sprout:`citron`,tower:`violet`,wedge:`magenta`}}));function Vb(e){return Math.max(...e.blobs.map(e=>e.r*Math.min(e.rx??1,e.ry??1)))}function Hb(e){let t=new Float32Array(Gb*4);for(let n=0;n<Gb;n++){let r=e.blobs[n];if(!r){t[n*4]=1e4,t[n*4+1]=1e4,t[n*4+2]=0,t[n*4+3]=0;continue}t[n*4]=r.x,t[n*4+1]=r.y,t[n*4+2]=r.r*(r.rx??1),t[n*4+3]=r.r*(r.ry??1)}return t}function Ub(e){let t=new Float32Array(Kb*4),n=new Float32Array(Kb*4);return e.extras?.forEach((e,r)=>{let i=r*4;switch(n[i]=qb[e.type],n[i+1]=e.alpha??1,e.type){case`ink-dot`:t.set([e.x,e.y,e.r,0],i);break;case`body-dot`:t.set([e.x,e.y,e.r,e.bob??0],i);break;case`arc`:t.set([e.cx,e.cy,e.r,e.half*Math.PI/180],i),n[i+2]=e.width,n[i+3]=+!!e.body;break;case`bar`:t.set([e.x,e.y,e.half,0],i),n[i+2]=e.width;break;case`wave`:t.set([e.x,e.y,e.len,e.amp],i),n[i+2]=e.width}}),{geometry:t,meta:n}}var Wb,Gb,Kb,qb,Jb=o((()=>{Wb={round:{blobs:[{x:60,y:61,r:36,rx:1,ry:1.06}],extras:[{type:`body-dot`,x:97,y:34,r:6,alpha:.5,bob:3},{type:`body-dot`,x:106,y:24,r:3.5,alpha:.35,bob:3.5}],falloff:2.2,fur:9,period:3.6,eye:{x:68,y:58,r:8},shadowRx:26},drop:{blobs:[{x:60,y:70,r:30,rx:1,ry:.95},{x:60,y:40,r:20,rx:.85,ry:1.15},{x:60,y:22,r:9,rx:.7,ry:1}],extras:[{type:`wave`,x:48,y:76,len:24,amp:2,width:2.6}],falloff:1.7,fur:8.5,period:4.4,eye:{x:60,y:56,r:8},shadowRx:24},dome:{blobs:[{x:60,y:72,r:32,rx:1.02,ry:.82},{x:60,y:46,r:28,rx:1,ry:1}],extras:[{type:`bar`,x:46,y:85,half:5,width:2.4,alpha:.5},{type:`bar`,x:60,y:87,half:5,width:2.4,alpha:.5},{type:`bar`,x:74,y:85,half:5,width:2.4,alpha:.5},{type:`body-dot`,x:60,y:6,r:3,bob:2.5}],falloff:1.7,fur:9,period:3,eye:{x:60,y:54,r:8.5},shadowRx:27},flame:{blobs:[{x:60,y:80,r:22,rx:1,ry:.95},{x:60,y:54,r:19,rx:.95,ry:1.1},{x:60,y:30,r:12,rx:.72,ry:1.25},{x:60,y:16,r:5,rx:.6,ry:1.1}],extras:[{type:`arc`,cx:60,cy:45,r:32,half:39,width:3,alpha:.55,body:!0},{type:`ink-dot`,x:60,y:82,r:2.6}],falloff:1.6,fur:7.5,period:2.6,eye:{x:60,y:62,r:8},shadowRx:22},oval:{blobs:[{x:60,y:64,r:40,rx:1.06,ry:.76}],extras:[{type:`arc`,cx:60,cy:223,r:172,half:10.7,width:2.2,alpha:.45},{type:`arc`,cx:60,cy:261,r:191,half:10.3,width:2.2,alpha:.45}],falloff:2.2,fur:10,period:4,eye:{x:66,y:58,r:8},shadowRx:32},bean:{blobs:[{x:46,y:76,r:24},{x:74,y:54,r:22}],extras:[{type:`body-dot`,x:32,y:94,r:4,alpha:.4}],falloff:1.7,fur:9,period:3.8,eye:{x:70,y:58,r:8},shadowRx:26},pebble:{blobs:[{x:56,y:76,r:32,rx:1.3,ry:.66},{x:86,y:74,r:18,rx:1,ry:.7}],extras:[{type:`ink-dot`,x:42,y:76,r:3,alpha:.32},{type:`ink-dot`,x:56,y:86,r:2.2,alpha:.32},{type:`ink-dot`,x:86,y:80,r:2.6,alpha:.32}],falloff:1.8,fur:9.5,period:4.6,eye:{x:68,y:72,r:7.5},shadowRx:34},sprout:{blobs:[{x:60,y:74,r:28},{x:48,y:34,r:8,rx:.75,ry:1.15},{x:72,y:32,r:7,rx:.75,ry:1.15}],falloff:1.7,fur:8.5,period:3.2,eye:{x:60,y:68,r:8.5},shadowRx:26},tower:{blobs:[{x:60,y:86,r:19},{x:60,y:60,r:17},{x:60,y:36,r:14}],extras:[{type:`arc`,cx:60,cy:154,r:80,half:13,width:2.2,alpha:.4},{type:`arc`,cx:60,cy:187,r:99,half:11.7,width:2.2,alpha:.4}],falloff:1.6,fur:8,period:4,eye:{x:60,y:52,r:8},shadowRx:20},wedge:{blobs:[{x:44,y:84,r:20},{x:76,y:84,r:20},{x:60,y:48,r:14}],extras:[{type:`arc`,cx:60,cy:28,r:10,half:53,width:3,alpha:.5,body:!0}],falloff:1.7,fur:8.5,period:2.9,eye:{x:60,y:70,r:8},shadowRx:28}},Gb=Math.max(...Object.values(Wb).map(e=>e.blobs.length)),Kb=Math.max(...Object.values(Wb).map(e=>e.extras?.length??0)),qb={"ink-dot":1,"body-dot":2,arc:3,bar:4,wave:5}})),Yb=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Xb=s(((e,t)=>{t.exports=Yb()}));function Zb(e,t){let n=1/0,r=-1/0;for(let i of Wb[e].blobs){let e=i.r*(i.rx??1),a=i.r*(i.ry??1),o=(t-i.y)/a;if(Math.abs(o)>=1)continue;let s=e*Math.sqrt(1-o*o);n=Math.min(n,i.x-s),r=Math.max(r,i.x+s)}return[n,r]}function Qb(e){let{x:t,y:n,r}=Wb[e].eye,i=r*1.45,a=r*.42,[o,s]=Zb(e,n);return{band:r*.95,left:o,lens:i,outer:i+a/2,right:s,rim:a,x:t,y:n}}function $b({g:e}){let t=(t,n)=>n-t>1?(0,tx.jsxs)(`g`,{children:[(0,tx.jsx)(`rect`,{fill:nx,height:e.band,rx:e.band*.3,width:n-t,x:t,y:e.y-e.band/2}),(0,tx.jsx)(`line`,{stroke:rx,strokeDasharray:`1.6 1.6`,strokeWidth:.6,x1:t+1,x2:n-1,y1:e.y,y2:e.y})]}):null;return(0,tx.jsxs)(`g`,{className:`e-goggles`,children:[t(e.left+1.5,e.x-e.outer+.5),t(e.x+e.outer-.5,e.right-1.5),(0,tx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:ox,r:e.lens}),(0,tx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.lens,stroke:ix,strokeWidth:e.rim}),(0,tx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.outer,stroke:ax,strokeWidth:.7}),[45,135,225,315].map(t=>(0,tx.jsx)(`circle`,{cx:e.x+Math.cos(t*Math.PI/180)*e.lens,cy:e.y+Math.sin(t*Math.PI/180)*e.lens,fill:ax,r:.9},t)),(0,tx.jsx)(`path`,{d:`M ${e.x-e.lens*.62} ${e.y-e.lens*.2} A ${e.lens*.66} ${e.lens*.66} 0 0 1 ${e.x-e.lens*.1} ${e.y-e.lens*.64}`,fill:`none`,opacity:.75,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:1.3})]})}function ex({kind:e}){return(0,tx.jsx)($b,{g:Qb(e)})}var tx,nx,rx,ix,ax,ox,sx=o((()=>{Jb(),tx=Xb(),nx=`oklch(40% 0.07 50)`,rx=`oklch(30% 0.06 45)`,ix=`oklch(74% 0.12 80)`,ax=`oklch(55% 0.1 70)`,ox=`oklch(88% 0.05 220 / 0.32)`}));function cx(){_x=0;let e=window.innerHeight,t=!1;for(let n of hx){let r=n.svg.getBoundingClientRect();if(r.bottom<-40||r.top>e+40)continue;let i=r.left+r.width*.5,a=r.top+r.height*.48,o=gx.x-i,s=gx.y-a,c=Math.hypot(o,s)||1,l=o/c,u=s/c,d=Math.min(r.width,r.height)*2.4,f=.35+Math.min(1,c/d)*.65,p=l*5.5*f,m=u*3.5*f,h=l*7*f+u*1.2*f;n.tx=bx(n.tx,p,.16),n.ty=bx(n.ty,m,.16),n.rot=bx(n.rot,h,.14),n.lean&&n.lean.setAttribute(`transform`,`translate(${n.tx.toFixed(2)} ${n.ty.toFixed(2)}) rotate(${n.rot.toFixed(2)} 60 62)`),n.shadow&&(n.shadow.setAttribute(`cx`,(60-n.tx*.35).toFixed(2)),n.shadow.setAttribute(`opacity`,String(Math.max(.08,.14-Math.abs(n.ty)*.008))));let g=n.ex+l*n.max*f,_=n.ey+1+u*n.max*.9*f;n.px=bx(n.px,g,.24),n.py=bx(n.py,_,.24),n.pupil&&(n.pupil.setAttribute(`cx`,n.px.toFixed(2)),n.pupil.setAttribute(`cy`,n.py.toFixed(2))),n.glint&&(n.glint.setAttribute(`cx`,(n.px-2).toFixed(2)),n.glint.setAttribute(`cy`,(n.py-3.4).toFixed(2))),(Math.abs(n.tx-p)>.05||Math.abs(n.px-g)>.05)&&(t=!0)}(t||vx-->0)&&(_x=requestAnimationFrame(cx))}function lx(){vx=48,_x||=requestAnimationFrame(cx)}function ux(e){gx.x=e.clientX,gx.y=e.clientY,lx()}function dx(){yx||typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(yx=!0,gx.x=window.innerWidth*.62,gx.y=window.innerHeight*.28,window.addEventListener(`pointermove`,ux,{passive:!0}),lx())}function fx(){hx.size>0||yx&&(yx=!1,window.removeEventListener(`pointermove`,ux),_x&&=(cancelAnimationFrame(_x),0))}function px(e,t,n=!0){let r=(0,mx.useRef)(t);r.current=t,(0,mx.useEffect)(()=>{let t=e.current;if(!(t&&n)||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{ex:i,ey:a,max:o=3.2}=r.current,s={svg:t,lean:t.querySelector(`.e-lean`),pupil:t.querySelector(`.e-pupil`),glint:t.querySelector(`.e-glint`),shadow:t.querySelector(`.e-shadow`),ex:i,ey:a,max:o,tx:0,ty:0,rot:0,px:i,py:a+1};return hx.add(s),dx(),lx(),()=>{hx.delete(s),fx()}},[e,n,t.ex,t.ey,t.max])}var mx,hx,gx,_x,vx,yx,bx,xx=o((()=>{mx=u(f(),1),hx=new Set,gx={x:0,y:0},_x=0,vx=0,yx=!1,bx=(e,t,n)=>e+(t-e)*n}));function Sx({ex:e,ey:t,max:n,ink:r,r:i,blink:a=`5.2s`}){let o=i*1.15;return(0,Y.jsxs)(`g`,{className:`e-eye`,"data-ex":e,"data-ey":t,"data-max":n,children:[(0,Y.jsx)(`ellipse`,{cx:e,cy:t,fill:`#fff`,rx:i,ry:o,children:(0,Y.jsx)(`animate`,{attributeName:`ry`,dur:a,keyTimes:`0;0.92;0.95;1`,repeatCount:`indefinite`,values:`${o};${o};${i*.1};${o}`})}),(0,Y.jsx)(`circle`,{className:`e-pupil`,cx:e,cy:t+1,fill:r,r:i*.48}),(0,Y.jsx)(`circle`,{className:`e-glint`,cx:e-i*.25,cy:t-i*.3,fill:`#fff`,r:i*.18})]})}function Cx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.cobalt,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.6s`,repeatCount:`indefinite`,values:`M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z;M60 30 Q100 20 94 62 Q98 102 60 95 Q22 102 26 62 Q20 22 60 30 Z;M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z`})}),(0,Y.jsx)(`circle`,{cx:`97`,cy:`34`,fill:Lb.cobalt,opacity:`0.5`,r:`6`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3.6s`,repeatCount:`indefinite`,values:`34;28;34`})}),(0,Y.jsx)(`circle`,{cx:`106`,cy:`24`,fill:Lb.cobalt,opacity:`0.35`,r:`3.5`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,begin:`0.4s`,dur:`3.6s`,repeatCount:`indefinite`,values:`24;17;24`})}),(0,Y.jsx)(Sx,{blink:`5.2s`,ex:68,ey:58,ink:`oklch(18% 0.08 260)`,max:3.4,r:8})]})}function wx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.amber,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4.4s`,repeatCount:`indefinite`,values:`M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z;M50 20 Q92 30 88 66 Q92 98 60 96 Q28 98 32 66 Q26 36 50 20 Z;M70 20 Q94 36 90 66 Q88 98 60 96 Q32 98 32 66 Q30 30 70 20 Z;M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z`})}),(0,Y.jsx)(Sx,{blink:`4.4s`,ex:60,ey:56,ink:`oklch(30% 0.10 60)`,max:3.2,r:8}),(0,Y.jsx)(`path`,{d:`M48 76 Q54 72 60 76 Q66 80 72 76`,fill:`none`,stroke:`oklch(30% 0.10 55)`,strokeLinecap:`round`,strokeWidth:`2.6`})]})}function Tx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.moss,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3s`,repeatCount:`indefinite`,values:`M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z;M60 30 Q98 36 96 74 Q96 98 60 98 Q24 98 24 74 Q22 36 60 30 Z;M60 12 Q88 26 88 68 Q88 94 60 94 Q32 94 32 68 Q32 26 60 12 Z;M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z`})}),(0,Y.jsx)(`path`,{d:`M46 90 L46 80 M60 92 L60 82 M74 90 L74 80`,opacity:`0.5`,stroke:`oklch(28% 0.10 155)`,strokeLinecap:`round`,strokeWidth:`2.4`}),(0,Y.jsx)(`circle`,{cx:`60`,cy:`6`,fill:Lb.moss,r:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3s`,repeatCount:`indefinite`,values:`8;3;8`})}),(0,Y.jsx)(Sx,{blink:`4.6s`,ex:60,ey:54,ink:`oklch(16% 0.08 160)`,max:3.4,r:8.5})]})}function Ex(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.rose,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`2.6s`,repeatCount:`indefinite`,values:`M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z;M52 18 Q86 40 82 76 Q80 98 60 98 Q40 98 38 76 Q32 46 52 18 Z;M68 18 Q88 46 82 76 Q80 98 60 98 Q40 98 38 76 Q34 40 68 18 Z;M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z`})}),(0,Y.jsx)(`path`,{d:`M40 20 Q60 6 80 20`,fill:`none`,opacity:`0.55`,stroke:Lb.rose,strokeLinecap:`round`,strokeWidth:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`opacity`,dur:`2.6s`,repeatCount:`indefinite`,values:`0.55;0.15;0.55`})}),(0,Y.jsx)(Sx,{blink:`3.8s`,ex:60,ey:62,ink:`oklch(22% 0.10 18)`,max:3.2,r:8}),(0,Y.jsx)(`circle`,{cx:`60`,cy:`82`,fill:`oklch(22% 0.10 18)`,r:`2.6`})]})}function Dx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.ember,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z;M60 40 Q110 40 108 66 Q108 96 60 96 Q12 96 12 66 Q10 40 60 40 Z;M60 28 Q92 36 92 62 Q92 88 60 90 Q28 88 28 62 Q28 36 60 28 Z;M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z`})}),(0,Y.jsxs)(`g`,{fill:`none`,opacity:`0.45`,stroke:`oklch(40% 0.16 30)`,strokeWidth:`2.2`,children:[(0,Y.jsx)(`path`,{d:`M28 54 Q60 48 92 54`,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M28 54 Q60 48 92 54;M20 56 Q60 50 100 56;M32 52 Q60 46 88 52;M28 54 Q60 48 92 54`})}),(0,Y.jsx)(`path`,{d:`M26 70 Q60 64 94 70`,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M26 70 Q60 64 94 70;M18 72 Q60 66 102 72;M30 68 Q60 62 90 68;M26 70 Q60 64 94 70`})})]}),(0,Y.jsx)(Sx,{blink:`4.2s`,ex:66,ey:58,ink:`oklch(24% 0.10 30)`,max:3.2,r:8})]})}function Ox(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.teal,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.8s`,repeatCount:`indefinite`,values:`M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z;M46 98 Q20 92 24 66 Q28 40 54 36 Q80 30 90 50 Q100 68 84 86 Q68 102 46 98 Z;M50 94 Q28 90 28 68 Q30 46 52 40 Q76 34 86 50 Q94 64 82 82 Q72 98 50 94 Z;M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z`})}),(0,Y.jsx)(`circle`,{cx:`32`,cy:`94`,fill:Lb.teal,opacity:`0.4`,r:`4`,children:(0,Y.jsx)(`animate`,{attributeName:`cx`,dur:`3.8s`,repeatCount:`indefinite`,values:`32;27;32`})}),(0,Y.jsx)(Sx,{blink:`4.8s`,ex:70,ey:58,ink:`oklch(18% 0.08 200)`,max:3.4,r:8})]})}function kx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.slate,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4.6s`,repeatCount:`indefinite`,values:`M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z;M60 98 Q14 98 14 78 Q14 58 46 54 Q80 50 102 62 Q114 74 106 88 Q98 98 60 98 Z;M60 94 Q26 94 22 78 Q20 62 46 58 Q76 54 94 62 Q106 70 100 84 Q94 94 60 94 Z;M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z`})}),(0,Y.jsxs)(`g`,{fill:`oklch(30% 0.05 244)`,opacity:`0.32`,children:[(0,Y.jsx)(`circle`,{cx:`42`,cy:`76`,r:`3`}),(0,Y.jsx)(`circle`,{cx:`56`,cy:`86`,r:`2.2`}),(0,Y.jsx)(`circle`,{cx:`86`,cy:`80`,r:`2.6`})]}),(0,Y.jsx)(Sx,{blink:`5.6s`,ex:68,ey:72,ink:`oklch(20% 0.06 244)`,max:3,r:7.5})]})}function Ax(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`g`,{fill:Lb.citron,children:[(0,Y.jsx)(`ellipse`,{cx:`48`,cy:`34`,rx:`6`,ry:`10`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3.2s`,repeatCount:`indefinite`,values:`34;30;34`})}),(0,Y.jsx)(`ellipse`,{cx:`72`,cy:`32`,rx:`5.5`,ry:`9`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,begin:`0.5s`,dur:`3.2s`,repeatCount:`indefinite`,values:`32;28;32`})})]}),(0,Y.jsx)(`path`,{fill:Lb.citron,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.2s`,repeatCount:`indefinite`,values:`M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z;M60 102 Q24 100 24 72 Q24 42 60 40 Q96 42 96 72 Q96 100 60 102 Z;M60 98 Q32 96 32 72 Q32 50 60 48 Q88 50 88 72 Q88 96 60 98 Z;M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z`})}),(0,Y.jsx)(Sx,{blink:`4.2s`,ex:60,ey:68,ink:`oklch(24% 0.09 108)`,max:3.4,r:8.5})]})}function jx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.violet,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z;M60 104 Q32 102 36 78 Q40 56 40 42 Q40 22 60 20 Q80 22 80 42 Q80 56 84 78 Q88 102 60 104 Z;M60 100 Q40 98 40 78 Q42 60 44 46 Q46 30 60 28 Q74 30 76 46 Q78 60 80 78 Q80 98 60 100 Z;M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z`})}),(0,Y.jsxs)(`g`,{fill:`none`,opacity:`0.4`,stroke:`oklch(28% 0.10 308)`,strokeLinecap:`round`,strokeWidth:`2.2`,children:[(0,Y.jsx)(`path`,{d:`M42 74 Q60 70 78 74`}),(0,Y.jsx)(`path`,{d:`M40 88 Q60 84 80 88`})]}),(0,Y.jsx)(Sx,{blink:`5s`,ex:60,ey:52,ink:`oklch(20% 0.09 308)`,max:3.2,r:8})]})}function Mx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Lb.magenta,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`2.9s`,repeatCount:`indefinite`,values:`M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z;M60 24 Q78 38 90 70 Q100 94 78 100 Q60 104 42 100 Q20 94 30 70 Q42 38 60 24 Z;M60 34 Q72 44 82 70 Q92 90 76 96 Q60 100 44 96 Q28 90 38 70 Q48 44 60 34 Z;M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z`})}),(0,Y.jsx)(`path`,{d:`M52 22 Q60 14 68 22`,fill:`none`,opacity:`0.5`,stroke:Lb.magenta,strokeLinecap:`round`,strokeWidth:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`opacity`,dur:`2.9s`,repeatCount:`indefinite`,values:`0.5;0.12;0.5`})}),(0,Y.jsx)(Sx,{blink:`3.6s`,ex:60,ey:70,ink:`oklch(22% 0.10 345)`,max:3.2,r:8})]})}function Nx({kind:e}){switch(e){case`drop`:return(0,Y.jsx)(wx,{});case`dome`:return(0,Y.jsx)(Tx,{});case`flame`:return(0,Y.jsx)(Ex,{});case`oval`:return(0,Y.jsx)(Dx,{});case`bean`:return(0,Y.jsx)(Ox,{});case`pebble`:return(0,Y.jsx)(kx,{});case`sprout`:return(0,Y.jsx)(Ax,{});case`tower`:return(0,Y.jsx)(jx,{});case`wedge`:return(0,Y.jsx)(Mx,{});default:return(0,Y.jsx)(Cx,{})}}function Px({animated:e=!0,goggles:t=!1,kind:n=`round`,size:r=160,className:i}){let a=(0,Fx.useRef)(null),o=Ix[n],s=Lx[n];return px(a,o,e),(0,Fx.useEffect)(()=>{let t=a.current;if(!t)return;let n=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(e&&!n){t.unpauseAnimations();return}t.pauseAnimations(),t.setCurrentTime(0)},[e]),(0,Y.jsxs)(`svg`,{"aria-hidden":`true`,className:i,height:r,overflow:`visible`,ref:a,style:{display:`block`},viewBox:`0 0 120 120`,width:r,children:[(0,Y.jsx)(`ellipse`,{className:`e-shadow`,cx:`60`,cy:s.cy,fill:`#000`,opacity:`0.14`,rx:s.rx,ry:`4.5`,children:(0,Y.jsx)(`animate`,{attributeName:`rx`,dur:s.dur,repeatCount:`indefinite`,values:`${s.rx};${s.rx*.8};${s.rx}`})}),(0,Y.jsxs)(`g`,{className:`e-lean`,children:[(0,Y.jsx)(Nx,{kind:n}),t?(0,Y.jsx)(ex,{kind:n}):null]})]})}var Fx,Y,Ix,Lx,Rx=o((()=>{Fx=u(f(),1),Bb(),sx(),xx(),Y=Xb(),Ix={round:{ex:68,ey:58,max:3.4},drop:{ex:60,ey:56,max:3.2},dome:{ex:60,ey:54,max:3.4},flame:{ex:60,ey:62,max:3.2},oval:{ex:66,ey:58,max:3.2},bean:{ex:70,ey:58,max:3.4},pebble:{ex:68,ey:72,max:3},sprout:{ex:60,ey:68,max:3.4},tower:{ex:60,ey:52,max:3.2},wedge:{ex:60,ey:70,max:3.2}},Lx={round:{cy:108,rx:26,dur:`3.6s`},drop:{cy:106,rx:24,dur:`4.4s`},dome:{cy:104,rx:27,dur:`3s`},flame:{cy:106,rx:22,dur:`2.6s`},oval:{cy:102,rx:32,dur:`4s`},bean:{cy:102,rx:26,dur:`3.8s`},pebble:{cy:102,rx:34,dur:`4.6s`},sprout:{cy:106,rx:26,dur:`3.2s`},tower:{cy:108,rx:20,dur:`4s`},wedge:{cy:106,rx:28,dur:`2.9s`}}}));Bb(),Rx();var X=Xb(),zx={entry:{de:`Eintrag {n} von {total}`,en:`Entry {n} of {total}`},deciding:{de:`Entscheidet, wie es weitergeht …`,en:`Deciding how to go on …`},choosingFields:{de:`Wählt die passenden Fragen …`,en:`Choosing the right questions …`},batchDone:{de:`{done} von {total} fertig`,en:`{done} of {total} done`},editing:{de:`Bearbeitet {n} von {total}`,en:`Editing {n} of {total}`},filming:{de:`Dreht {n} von {total}`,en:`Filming {n} of {total}`},clipsRendering:{de:`{count} Clips werden gerendert – das dauert einige Minuten.`,en:`Rendering {count} clips – this takes a few minutes.`},videoRendering:{de:`Das Video wird gerendert – das dauert meist 1–3 Minuten.`,en:`Rendering the video – this usually takes 1–3 minutes.`},photo:{de:`Sieht sich Foto {n} von {total} an`,en:`Looking at photo {n} of {total}`},listen:{de:`Hört „{label}“ an …`,en:`Listening to “{label}” …`},listenFailed:{de:`„{label}“ konnte nicht verschriftlicht werden.`,en:`“{label}” could not be written down.`},filmCutting:{de:`Der Film wird geschnitten – das dauert etwa eine Minute.`,en:`Cutting the film – this takes about a minute.`},filmProgress:{de:`{pct} % geschnitten`,en:`{pct} % cut`},filmError:{de:`Der Film meldet: {detail}`,en:`The film reports: {detail}`},widgetError:{de:`Das Widget meldet einen Fehler: {detail}`,en:`The widget reports an error: {detail}`},mcpConnected:{de:`Verbunden mit {names}`,en:`Connected to {names}`},mcpUnreachable:{de:`MCP-Server nicht erreichbar: {detail}`,en:`MCP server unreachable: {detail}`},reads:{de:`Liest {name}`,en:`Reading {name}`},readsMany:{de:`Liest {count} Dokumente`,en:`Reading {count} documents`},opens:{de:`Öffnet {name}`,en:`Opening {name}`},clicks:{de:`Klickt im Browser`,en:`Clicking in the browser`},types:{de:`Tippt im Browser`,en:`Typing in the browser`},looksAtPage:{de:`Sieht sich die Seite an`,en:`Looking at the page`},waitsForSignIn:{de:`Wartet auf deine Anmeldung bei {name}`,en:`Waiting for you to sign in at {name}`},downloads:{de:`Lädt {name} herunter`,en:`Downloading {name}`},runs:{de:`Führt aus: {command}`,en:`Running: {command}`},python:{de:`Führt Python aus`,en:`Running Python`},drawing:{de:`Zeichnet ein Bild`,en:`Drawing an image`},writesPage:{de:`Schreibt die Seite „{title}“`,en:`Writing the page “{title}”`},searchesDocuments:{de:`Sucht in den Dokumenten: {query}`,en:`Searching the documents: {query}`},searchesKnowledge:{de:`Sucht in Wissen: {query} – {relevant} von {candidates} passen`,en:`Searching the knowledge: {query} – {relevant} of {candidates} fit`},listsKnowledge:{de:`Listet Wissen`,en:`Listing the knowledge`},searchesMail:{de:`Durchsucht {label}`,en:`Searching {label}`},savesReceipts:{de:`Speichert {count} Belege aus {label}`,en:`Saving {count} receipts from {label}`},remembers:{de:`Merkt sich {title}`,en:`Remembering {title}`},files:{de:`Legt {count} Dateien ab`,en:`Filing {count} files`},filmSetup:{de:`Richtet den Arbeitsordner für den Film ein`,en:`Setting up the folder for the film`},filmClient:{de:`{client} arbeitet am Film – das dauert meist 10–40 Minuten.`,en:`{client} is working on the film – this usually takes 10–40 minutes.`},filmTask:{de:`Am Film: {task}`,en:`On the film: {task}`},filmLooks:{de:`Sieht sich Bilder des Films an`,en:`Looking at frames of the film`},filmFix:{de:`Der Film ließ sich nicht rendern – Claude Code bessert nach`,en:`The film did not render – Claude Code is fixing it`},filmResume:{de:`Macht dort weiter, wo der Film stehen geblieben ist`,en:`Picking the film up where it stopped`}};function Bx(e,t){let n=zx[e.code];return n?n[t].replace(/\{(\w+)\}/g,(t,n)=>e.params?.[n]===void 0?t:String(e.params[n])):``}var Vx={"brand.tagline":`Wünsch dir was. Wir bauen deinen Wizard.`,"brand.sub":`Er führt dich Schritt für Schritt zum Ergebnis. Die KI erledigt die Arbeit.`,"auth.dev":`Dev-Login (lokal)`,"auth.legal":`Kein Passwort, keine Registrierung – du meldest dich mit einem bestehenden Konto an.`,"auth.signIn":`Anmelden oder Konto erstellen`,"auth.failed":`Die Anmeldung hat nicht geklappt. Bitte noch einmal versuchen.`,"auth.localLink":`Öffne den Link, den die App beim Start ausgegeben hat – er meldet dich an diesem Gerät an.`,"nav.account":`Konto & Guthaben`,"setup.keysInAccount":`API-Schlüssel für Skripte gehören zu deinem Konto. Du legst sie dort an und ziehst sie dort zurück.`,"setup.openAccount":`Konto öffnen`,"class.label":`Modell-Klasse`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Bild`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Sprachausgabe`,"class.classifier.hint":`Zuordnen, Ja/Nein, wenige Werte aus Text ziehen. Am günstigsten.`,"class.standard.hint":`Kurze Texte, eine API aufrufen, umformatieren.`,"class.high.hint":`Recherche mit Werkzeugen, lange Dokumente, Abwägen vieler Quellen.`,"class.highest.hint":`Schweres Abwägen oder Code. Mehrfach so teuer wie High.`,"class.effort":`Denkaufwand`,"class.effortAuto":`Automatisch`,"class.effort.low":`Niedrig`,"class.effort.medium":`Mittel`,"class.effort.high":`Hoch`,"estimate.step":`≈ {n} Credits, selten mehr als {high}`,"estimate.measured":`gemessen aus den letzten Läufen`,"estimate.formula":`geschätzt, wird nach fünf Läufen genauer`,"estimate.share":`Ein Lauf kostet etwa {run} Credits. Beim Tageslimit sind es höchstens {day} Credits am Tag.`,"local.title":`Modelle`,"local.accountWaiting":`Warte auf die Anmeldung im Browser …`,"local.accountFailed":`Der Konto-Dienst ist gerade nicht erreichbar.`,"local.accountExpired":`Die Anmeldung ist abgelaufen. Bitte neu anmelden.`,"local.sourceNeedsAccount":`Dafür brauchst du ein Konto.`,"local.toAccount":`Zu Einstellungen → Konto`,"local.sourceOwn":`Eigene Schlüssel`,"local.keys":`Schlüssel`,"local.keysHint":`Ein Schlüssel reicht. Schlüssel liegen im Schlüsselbund dieses Geräts, nie in der Datenbank.`,"local.keySet":`hinterlegt`,"local.keyEmpty":`nicht hinterlegt`,"local.keyRemove":`Entfernen`,"local.classes":`Modell je Klasse`,"local.classesHint":`Ein Schritt nennt nur die Klasse. Hier steht, welches Modell sie bedient, z. B. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini oder ollama:qwen3.`,"local.save":`Speichern`,"local.saved":`Gespeichert`,"local.chat":`Der Chat im Studio antwortet über`,"local.chatModels":`Modell-Klasse Highest`,"local.chatClaude":`Claude-Abo (Claude Code)`,"local.subscription":`Mit dem Abo baut das auf diesem Gerät installierte Claude Code den Wizard – mit deiner Anmeldung dort. Läufe nutzen weiter Schlüssel oder Guthaben.`,"harness.hint":`Texte denkt das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Bilder, Videos und Audio brauchen weiter einen Schlüssel.`,"harness.hintImages":`Texte und Bilder macht das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Videos und Audio brauchen weiter einen Schlüssel.`,"harness.found":`{name} {version} gefunden`,"harness.missing":`{name} ist auf diesem Gerät nicht installiert.`,"harness.install":`Oder in deinem eigenen Terminal:`,"harness.installButton":`{name} installieren`,"harness.installing":`{name} wird im Terminal unten installiert – das dauert etwa eine Minute. Danach meldest du es an.`,"harness.installEnded":`Die Installation ist zu Ende, aber {name} ist nicht da. Was oben steht, sagt warum.`,"harness.appHere":`Die {app}-App ist auf diesem Computer: {name} meldet sich mit demselben {sub} an.`,"harness.notInstalled":`nicht installiert`,"harness.authSubscription":`Angemeldet mit deinem {sub}.`,"harness.authKey":`Angemeldet mit einem API-Schlüssel aus deiner Shell – nicht mit dem Abo. Melde dich hier an, damit es über dein {sub} läuft.`,"harness.authNone":`Noch nicht angemeldet.`,"harness.signIn":`Hier anmelden`,"harness.signingIn":`Die Anmeldung läuft im Terminal unten – dein Browser öffnet sich dafür. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.signInInteractive":`Unten startet {name}. Wähle dort die Anmeldung mit deinem {sub} und melde dich im Browser an. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.loginEnded":`Die Anmeldung wurde beendet, ohne dass {name} angemeldet ist.`,"harness.sub.claude":`Claude-Abo`,"harness.sub.codex":`ChatGPT-Abo`,"harness.sub.gemini":`Google-Konto`,"harness.sub.cursor":`Cursor-Abo`,"harness.desc.claude":`Mit deinem Claude-Abo – kein Schlüssel nötig.`,"harness.desc.codex":`Mit deinem ChatGPT-Abo – kein Schlüssel nötig.`,"harness.desc.gemini":`Mit deinem Google-Konto – kein Schlüssel nötig.`,"harness.desc.cursor":`Mit deinem Cursor-Abo – kein Schlüssel nötig.`,"harness.ready":`angemeldet`,"local.recheck":`Erneut prüfen`,"local.test":`Testen`,"local.testHint":`Ein kurzer Aufruf zeigt, ob der Weg zum Modell offen ist.`,"local.testOk":`Antwort in {s} s über {ref}: „{reply}“`,"local.testFailed":`Der Test hat nicht geklappt: {error}`,"models.groupCaps":`Fähigkeiten`,"models.groupAccess":`Zugänge`,"models.groupMore":`Weitere Anbieter`,"models.cap.text":`Text & Denken`,"models.cap.text.hint":`Schreibt, fasst zusammen, recherchiert und entscheidet – in fast jedem Schritt.`,"models.cap.image":`Bilder`,"models.cap.image.hint":`Erzeugt Bilder: Logos, Produktfotos, Illustrationen.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Erzeugt kurze Clips aus Text oder aus einem Bild.`,"models.cap.speech":`Sprachausgabe`,"models.cap.speech.hint":`Liest Texte vor: Voice-over, Hörfassungen, Ansagen.`,"models.cap.listening":`Sprachnotizen`,"models.cap.listening.hint":`Versteht Gesprochenes und macht aus Sprachnotizen Text.`,"models.way.local":`Lokales Modell`,"models.way.credits":`Guthaben`,"models.way.creditsTeam":`Guthaben des Teams`,"models.way.none":`nicht eingerichtet`,"models.who":`Wer macht das?`,"models.optSubscription":`Dein Abo`,"models.optKey":`Eigener API Key`,"models.optLocal":`Lokales Modell`,"models.optLocalNote":`Ollama auf diesem Computer`,"models.noteIncluded":`im Abo enthalten`,"models.noteSignedOut":`nicht angemeldet`,"models.noteMissing":`nicht installiert`,"models.noteKey":`API Key hinterlegt`,"models.noteKeyShort":`Key`,"models.noteSignedIn":`angemeldet`,"models.noteShellKey":`API Key aus der Shell`,"models.optOther":`Sonst`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API Key fehlt`,"models.noteNeedsAccount":`Konto nötig`,"models.notePerImage":`≈ {n} Credits je Bild`,"models.notePerSecond":`≈ {n} Credits je Sekunde`,"models.notePer1k":`≈ {n} Credits je 1000 Zeichen`,"models.notePerMinute":`≈ {n} Credits je Minute`,"models.creditsAuto":`engenty wählt: {model}`,"models.creditsAutoNone":`engenty wählt das Modell`,"models.creditsPickHint":`Abgerechnet in Credits – ohne eigenen API Key.`,"models.viaCredits":`{name} über engenty Guthaben`,"models.viaCreditsHint":`Ohne eigenen API Key, abgerechnet in Credits.`,"models.viaCreditsNeedsAccount":`Mit einem engenty-Konto, abgerechnet in Credits.`,"models.noteUsage":`Credits nach Verbrauch`,"models.model":`Modell`,"models.modelCustom":`Eigenes Modell …`,"models.textSimple":`Einfache Schritte`,"models.textDemanding":`Anspruchsvolle Schritte`,"models.perClass":`Je Klasse anpassen`,"models.manageKey":`API Key von {name}`,"models.key":`API Key`,"models.keyFor":`API Key von {name}`,"models.keyGet":`Key bei {name} holen`,"models.keySave":`Prüfen und speichern`,"models.keyStored":`API Key hinterlegt`,"models.keyNone":`Kein API Key`,"models.keyCheck":`Prüfen`,"models.keyReplace":`Ersetzen`,"models.keyRemove":`Entfernen`,"models.keyOk":`Der Key gilt.`,"models.keyBad":`Der Key wurde nicht angenommen.`,"models.keyWhereLocal":`Der Key bleibt auf diesem Gerät, nie in der Datenbank.`,"models.keyWhereCloud":`Der Key liegt verschlüsselt beim Team. Niemand sieht ihn wieder.`,"models.keyFallback":`Bis der Key da ist, springt das Guthaben ein.`,"models.uses":`Wofür`,"models.useFor":`Nutzen`,"models.inUse":`wird genutzt`,"models.try":`Ausprobieren`,"models.try.text":`Testen`,"models.try.image":`Probebild erzeugen`,"models.try.video":`Probeclip erzeugen`,"models.try.speech":`Probe anhören`,"models.try.listening":`Zuhören testen`,"models.tryCost":`Kostet wie ein echter Aufruf.`,"models.tryCostVideo":`Ein Clip von 4 Sekunden – kostet wie ein echter.`,"models.tryWait":`Wird erzeugt …`,"models.tryWaitVideo":`Ein Clip dauert ein bis zwei Minuten …`,"models.tryOk":`In {s} s mit {model}`,"models.tryHeard":`Gehört: „{text}“`,"models.tryHeardNothing":`Nichts gehört – der Weg ist offen.`,"models.tryFailed":`Hat nicht geklappt: {error}`,"models.creditsName":`engenty Guthaben`,"models.creditsTeam":`Guthaben des Teams`,"models.creditsLocalLead":`Springt ein, wo kein Abo und kein eigener API Key eingerichtet ist.`,"models.creditsCloudHint":`Alles ohne eigenen API Key läuft über das Guthaben. Eigene Keys gehen vor und kosten keine Credits.`,"models.creditsConnectTitle":`Mit einem Konto`,"models.creditsLocalHint":`Mit einem engenty-Konto springt das Guthaben ein, wo nichts Eigenes eingerichtet ist – etwa für Videos ohne eigenen API Key.`,"models.creditsConnect":`Konto verbinden`,"models.creditsFallback":`Guthaben springt ein`,"models.creditsFallbackOn":`Was kein Abo und keinen eigenen API Key hat, läuft über das Guthaben.`,"models.creditsFallbackOff":`Aus: Was kein Abo und keinen eigenen API Key hat, läuft nicht.`,"models.creditsOn":`Läuft über das Guthaben`,"models.creditsNone":`Gerade läuft nichts über das Guthaben.`,"models.creditsTopUp":`Aufladen`,"models.creditsPicks":`engenty wählt das Modell und rechnet in Credits ab.`,"models.creditsModel":`Gerade: {model}.`,"models.clientSignIn":`Anmeldung`,"models.clientImages":`{name} erzeugt Bilder mit deinem {sub} – ohne eigenen API Key.`,"models.clientNotChosen":`Text läuft gerade nicht über {name}.`,"models.ollamaHint":`Adresse von Ollama und das Modell, das dort läuft.`,"models.readOnly":`Nur Admins des Teams ändern die Modelle.`,"models.viewAs":`Vorschau als`,"models.view.auto":`wie es ist`,"models.view.local":`lokal`,"models.view.linked":`lokal + Konto`,"models.view.cloud":`Cloud-Studio`,"setup.title":`Setup`,"setup.sub":`Engenty kann deine vorhandenen Konten auf deinem Computer nutzen.`,"setup.source":`Womit soll die Engenty denken?`,"setup.local":`Läuft lokal auf diesem Gerät.`,"setup.stage.connect":`Verbinden`,"setup.stage.test":`Testen`,"setup.stage.done":`Fertig`,"setup.h.install":`Installiere {name}`,"setup.h.signIn":`Melde {name} an`,"setup.h.keys":`Trage einen Schlüssel ein`,"setup.h.test":`Ein kurzer Test`,"setup.h.done":`Verbunden.`,"setup.ready":`Alles bereit.`,"setup.noHarness":`Noch kein KI-Client installiert. Wähle einen – er wird hier installiert – oder trage eigene Schlüssel ein.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic oder Ollama.`,"setup.recommended":`Empfohlen`,"setup.done":`Zum Studio`,"setup.untilWorks":`Das Studio öffnet sich, sobald der Test klappt.`,"cloud.onPublish":`Sobald du den Wizard veröffentlichst, geht die Version auch in die Cloud deines Kontos und läuft dort hinter einem eigenen Link.`,"cloud.notSent":`Diese Version ist noch nicht in der Cloud.`,"cloud.send":`Jetzt senden`,"cloud.resend":`Erneut senden`,"cloud.again":`Um {when} wird es noch einmal versucht.`,"cloud.sent":`Version {v} · gesendet am {when}`,"cloud.notRunnable":`Version {v} läuft in der Cloud nicht.`,"cloud.keepsRunning":`Dort läuft weiter Version {v}.`,"cloud.nothingRuns":`Dort läuft deshalb noch nichts.`,"cloud.notes":`Was in der Cloud anders läuft:`,"cloud.check":`Was dem jetzigen Stand in der Cloud fehlen würde:`,"cloud.checkBlocking":`So, wie der Wizard jetzt ist, würde er in der Cloud nicht laufen:`,"cloud.documents":`Die Dokumente des Space bleiben auf diesem Gerät. In der Cloud arbeiten die Schritte ohne sie.`,"cloud.stepName":`„{title}“`,"cloud.problem.sandbox":`Der Server hat keine Maschine für Code. Dort läuft das ohne sie.`,"cloud.problem.mcp":`Die MCP-Server des Space gibt es auf dem Server nicht: {detail}.`,"cloud.problem.model":`Dafür gibt es in der Cloud kein Modell.`,"cloud.problem.connector":`Dem Space fehlt in der Cloud ein Connector.`,"cloud.problem.invalid":`So nimmt der Server den Wizard nicht an.`,"cloud.spaceLimit":`In der Cloud deines Kontos liegt schon der Space einer anderen Installation:`,"cloud.replace":`Bisherigen Space ersetzen`,"cloud.replaceConfirm":`Den bisherigen Space aus der Cloud entfernen? Seine Wizards und ihre Links verschwinden dort. Danach wird gesendet, was hier veröffentlicht ist.`,"cloud.noticeError":`Hier veröffentlicht. In der Cloud ist diese Version nicht angekommen – mehr dazu unten.`,"cloud.noticeNotRunnable":`Hier veröffentlicht. In der Cloud läuft diese Version nicht – mehr dazu unten.`,"readonly.wizard":`Dieser Wizard kommt aus deiner lokalen Installation und wird dort geändert. Hier läuft, was du dort veröffentlichst.`,"readonly.project":`Dieser Space kommt aus deiner lokalen Installation und wird dort geändert.`,"readonly.server":`Auf diesem Server wird nichts gebaut. Hier laufen die Wizards, die deine lokale Installation veröffentlicht.`,"nav.wizards":`Wizards`,"nav.settings":`Einstellungen`,"nav.project":`Space`,"account.title":`Konto`,"account.hint":`Wie dich die App nennt und wie man dich erreicht.`,"account.initials":`Dein Kürzel im Menü oben rechts: die Anfangsbuchstaben deines Namens.`,"account.name":`Name`,"account.nameHint":`Anfangs steht hier der Benutzername dieses Geräts.`,"account.fromAccount":`Name und E-Mail kommen aus deinem Konto.`,"account.about":`Über dich`,"account.aboutHint":`Wer du bist und was du machst.`,"account.email":`E-Mail`,"account.phone":`Telefon`,"account.connection":`engenty.ai`,"account.connectionHint":`Anmeldung, Guthaben und die Cloud, in der deine Wizards für alle laufen.`,"account.profile":`Profil`,"account.local":`Lokale Installation`,"account.localText":`Diese App läuft auf deinem Gerät und ist mit keinem Konto verbunden. Wizards, Space und Dateien bleiben hier.`,"account.linked":`Verbunden`,"account.with":`Mit einem Konto`,"account.withCredits":`Guthaben für die Modelle, wo kein KI-Client installiert ist. Kein API Key nötig.`,"account.withCloud":`Was du veröffentlichst, läuft auch auf engenty.ai – hinter einem öffentlichen Link, auch wenn dieses Gerät aus ist.`,"account.signIn":`Anmelden`,"account.signInAgain":`Neu anmelden`,"account.new":`Noch kein Konto?`,"account.newHint":`Ein neues Konto braucht einen Einladungscode. Trag ihn hier ein, dann steht er bei der Registrierung schon im Formular.`,"account.code":`Einladungscode`,"account.create":`Konto erstellen`,"account.credits":`Guthaben`,"account.topUp":`Aufladen`,"account.expires":`{n} Credits gültig bis {date}`,"account.kind.start":`Startguthaben`,"account.kind.monthly":`Monatsguthaben`,"account.kind.gift":`Geschenkt`,"account.cloud":`Was du hier veröffentlichst, läuft auch auf {host}.`,"account.look":`Darstellung`,"account.lookHint":`Sprache und Design der App in diesem Browser.`,"nav.logout":`Abmelden`,"nav.connected":`Verbunden mit {host}`,"nav.expired":`Anmeldung abgelaufen`,"nav.onlyHere":`Nur auf diesem Computer`,"nav.local":`lokal`,"nav.language":`Sprache`,"nav.theme":`Design`,"nav.credits":`{n} Credits`,"footer.billing":`Guthaben`,"footer.usage":`Verbrauch`,"footer.invoices":`Rechnungen`,"footer.account":`Konto`,"about.version":`Version {v}`,"about.update.available":`Version {v} von engenty wizards ist da.`,"about.update.install":`Aktualisieren`,"about.update.installing":`Version {v} wird installiert …`,"about.update.restarting":`Startet neu mit Version {v} …`,"about.update.done":`Installiert. Starte engenty wizards neu, um {v} zu nutzen.`,"about.update.failed":`Das Update ist fehlgeschlagen. Logs: logs/update.log`,"about.update.notes":`Was ist neu`,"about.changelog":`Changelog`,"about.changelogHint":`Was sich von Version zu Version geändert hat.`,"about.changelogEmpty":`Noch keine Einträge.`,"about.unreleased":`Noch nicht veröffentlicht`,"about.breaking":`breaking`,"about.credits":`Open Source`,"about.creditsHint":`engenty wizards und die Open-Source-Software, auf der es aufbaut.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Gebaut mit`,"about.creditsDeps":`Direkte Abhängigkeiten`,"about.creditsDepsHint":`Was die Teile dieser App selbst einbinden, mit Version und Lizenz – ohne deren eigene Abhängigkeiten.`,"about.creditsShared":`Von mehreren Teilen genutzt`,"about.search":`Suchen …`,"about.noMatches":`Keine Treffer.`,"theme.dark":`Dunkles Design`,"theme.light":`Helles Design`,"home.title":`Deine Wizards`,"home.new":`Neuer Wizard`,"home.import":`Importieren`,"import.failed":`Import hat nicht geklappt`,"home.empty":`Noch keine Wizards in diesem Space.`,"home.live":`Live`,"home.draft":`Entwurf`,"where.here":`Lokal`,"where.hereVersion":`Lokal · Version {v}`,"where.hereHint":`Läuft nur auf diesem Computer, solange die App läuft.`,"where.liveHint":`Läuft auf {host} – für alle mit dem Link.`,"where.liveAt":`Live auf {host} · Version {v}`,"where.note":`1 Hinweis`,"where.notes":`{n} Hinweise`,"where.sending":`Wird gesendet`,"where.missing":`Nicht in der Cloud`,"home.steps":`{n} Schritte`,"home.newProject":`Neuer Space`,"home.projectName":`Name des Space`,"home.projectLimit":`Höchstens {n} Spaces`,"team.title":`Team`,"team.hint":`Wer im Team ist und auf welchem Paket es läuft. Eingeladen und verwaltet wird im Konto.`,"team.plan":`Paket`,"team.planFree":`Free`,"team.seats":`{taken} von {limit} Plätzen`,"team.seatsUnlimited":`Plätze ohne Limit`,"team.members":`Mitglieder`,"team.invited":`eingeladen`,"team.you":`du`,"team.manage":`Mitglieder verwalten`,"team.changePlan":`Paket ansehen`,"team.roles":`Inhaber und Admins legen Wizards und Spaces an und löschen sie; Mitglieder bearbeiten die Wizards, die es gibt.`,"team.memberNote":`Du bist Mitglied: Du bearbeitest Wizards, Admins legen neue an und löschen.`,"team.failed":`Das Team ließ sich nicht laden.`,"team.role.owner":`Inhaber`,"team.role.admin":`Admin`,"team.role.member":`Mitglied`,"models.ownKeysPlan":`Eigene API Keys gibt es ab dem Pro-Paket. Hier zahlen die Credits des Teams.`,"home.fromLocal":`Aus deiner lokalen Installation – geändert wird dort.`,"home.syncedAt":`Zuletzt angekommen: {when}.`,"home.local.title":`Hier laufen die Wizards aus deiner lokalen Installation`,"home.local.text":`Du baust auf deinem eigenen Computer. Was du dort veröffentlichst, läuft hier – für alle, hinter einem Link.`,"home.local.install":`Installiere engenty wizards auf deinem Computer:`,"home.local.signIn":`Melde dich dort unter Einstellungen → Konto mit diesem Konto an.`,"home.local.publish":`Veröffentliche einen Wizard. Er erscheint dann hier.`,"new.title":`Was soll dein Wizard können?`,"new.placeholder":`z. B. Kunden geben ihr Produkt und ihre Zielgruppe ein, der Wizard recherchiert Wettbewerber und erstellt daraus ein Positionierungs-Briefing als PDF.`,"new.build":`Wizard bauen`,"new.orStarter":`Oder beginne mit einer Vorlage`,"new.import":`Wizard-Paket importieren`,"new.hint":`Du kannst alles danach im Gespräch ändern.`,"editor.resize":`Breite ändern – Doppelklick setzt zurück`,"editor.resizeSheet":`Höhe ändern – Tippen klappt ein und aus`,"editor.export":`Als Paket exportieren (.wizard)`,"addStep.title":`Was soll hier passieren?`,"addStep.placeholder":`Zum Beispiel: eine Karte mit allen gefundenen Objekten, der Preis als Farbe`,"addStep.kind":`Art des Schritts`,"addStep.auto":`KI wählt`,"addStep.empty":`Beschreibe zuerst, was der Schritt tun soll.`,"addStep.busy":`Der Assistent arbeitet noch an der letzten Nachricht. Versuch es gleich noch einmal.`,"addStep.emptyStep":`Leer einfügen`,"addStep.cancel":`Abbrechen`,"addStep.create":`Erstellen`,"addStep.building":`Neuer Schritt wird gebaut …`,"addStep.showChat":`Im Gespräch ansehen`,"addStep.add":`Schritt hinzufügen`,"surface.preview":`Vorschau`,"surface.code":`Code`,"surface.sampleNote":`Mit Beispieldaten – ein Lauf zeigt seine eigenen.`,"surface.sampleText":`Beispieltext`,"surface.sampleBrand":`Deine Firma`,"addStep.when":`Wann?`,"addStep.always":`Immer`,"addStep.onlyIf":`Nur wenn …`,"addStep.aiDecides":`KI entscheidet …`,"addStep.ifPlaceholder":`Zum Beispiel: Umsatz unter 100`,"addStep.askPlaceholder":`Zum Beispiel: die Person will ihr Geld zurück`,"addStep.whenEmpty":`Sag, wann der Schritt kommen soll.`,"addStep.messageIf":`Nur wenn: {text} – sonst geht es nach „{from}“ weiter wie bisher.`,"addStep.messageAsk":`KI entscheidet: {text} – sonst geht es nach „{from}“ weiter wie bisher.`,"addStep.here":`Hier einen Schritt einfügen`,"addStep.between":`Zwischen „{before}“ und „{after}“`,"addStep.after":`Nach „{title}“`,"addStep.first":`Als erster Schritt, vor „{title}“`,"addStep.message":`Neuer Schritt · {place}`,"addStep.messageAs":`Neuer Schritt ({kind}) · {place}`,"widget.missing":`Das Widget ist noch nicht gebaut.`,"widget.what":`Was soll das Widget zeigen? (optional)`,"widget.build":`Vom Assistenten bauen lassen`,"widget.upload":`Eigene HTML hochladen`,"widget.buildMessage":`Bitte baue das Widget „{title}“. {what}`,"editor.chat":`Gespräch`,"editor.dropToAttach":`Loslassen, um es der Nachricht anzuhängen`,"editor.memory":`Gedächtnis`,"memory.explain":`Was der Wizard über alle Läufe hinweg weiß: Notizen, die KI-Schritte mit dem Werkzeug „Seiten“ lesen und fortschreiben, und die Tabellen seiner geteilten Listen. Dieselben Daten stehen im Bereich unter Daten.`,"memory.unused":`Noch nutzt kein Schritt das Gedächtnis. Bitte den Assistenten, dass sich ein KI-Schritt etwas merken soll.`,"memory.none":`Noch nichts gemerkt.`,"memory.add":`Notiz`,"memory.newNote":`Notiz`,"memory.back":`Gedächtnis`,"memory.testCopy":`Testläufe lesen das Gedächtnis, schreiben aber in eine eigene Kopie, die mit dem Lauf verschwindet.`,"editor.step":`Schritte`,"editor.runs":`Durchläufe`,"editor.reviewEditable":`bearbeitbar`,"editor.reviewRedo":`neu erstellbar`,"editor.otherwise":`sonst`,"editor.next.title":`Nächster Schritt`,"editor.next.ways":`Nächster Schritt · {count} Wege`,"editor.next.open":`Schritt öffnen`,"editor.next.then":`Danach`,"editor.next.fold":`Zuklappen`,"editor.next.unfold":`Kurz zeigen`,"editor.branch.ai":`KI`,"editor.branch.addWhen":`Bedingung`,"editor.branch.when":`Weiter, wenn`,"editor.branch.pick":`Wählen …`,"editor.branch.and":`und`,"editor.branch.statement":`Aussage`,"editor.branch.none":`Keine trifft klar zu`,"editor.branch.how":`Entschieden von einem Entscheidungsmodell (Jev), wo es einen Weg dorthin gibt, sonst vom Sprachmodell der Klasse Klassifizieren. Liegen die zwei wahrscheinlichsten Antworten weniger als 10 Punkte auseinander, gilt „keine“.`,"editor.branch.lastRun":`Im letzten Testlauf entschieden von {source}.`,"editor.branch.bySystemOne":`einem Entscheidungsmodell`,"editor.branch.byLlm":`dem Sprachmodell`,"editor.branch.notYet":`Ein Testlauf zeigt hier, wie die KI entschieden hat.`,"editor.branch.end":`Ende`,"editor.branch.max":`Höchstens so oft (sonst 10)`,"editor.branch.remove":`Verzweigung entfernen`,"editor.branch.addAsk":`KI entscheidet`,"editor.branch.newAsk":`Die Person möchte …`,"editor.whenFilled":`{field} ausgefüllt`,"editor.whenEmpty":`{field} leer`,"editor.whenContains":`{field} enthält {value}`,"editor.whenAsk":`entscheidet: {text}`,"editor.surfaceJson":`Ansicht (JSON)`,"editor.fieldAsk":`Oder: zeigen, wenn die KI das für zutreffend hält …`,"editor.atMost":`höchstens {count}×`,"editor.shownWhen":`Nur zeigen, wenn`,"editor.shownAlways":`Immer zeigen`,"editor.conditionValue":`Wert`,"editor.optionsFrom":`Auswahl aus früheren Daten`,"editor.optionsFixed":`Feste Auswahl`,"editor.op.equals":`ist`,"editor.op.notEquals":`ist nicht`,"editor.op.in":`ist eine von`,"editor.op.notEmpty":`ist ausgefüllt`,"editor.op.empty":`ist leer`,"editor.op.gt":`größer als`,"editor.op.lt":`kleiner als`,"editor.op.contains":`enthält`,"editor.conditionsMore":`und {count} weitere Bedingungen`,"tool.web_search":`Websuche`,"tool.web_fetch":`Webseiten lesen`,"tool.browser":`Browser`,"tool.sandbox":`Code & Shell`,"tool.image":`Bilder`,"tool.http":`API`,"tool.pages":`Seiten`,"editor.test":`Testen`,"editor.share":`Teilen`,"editor.publish":`Veröffentlichen`,"editor.published":`Live · Version {v}`,"editor.unpublishedChanges":`Änderungen nicht veröffentlicht`,"editor.notPublished":`Noch nicht veröffentlicht`,"editor.composer":`Beschreibe, was sich ändern soll …`,"editor.attach":`Dateien anhängen`,"editor.detach":`Entfernen`,"editor.attached":`Angehängt`,"editor.thread":`Verlauf`,"editor.voice":`Diktieren`,"editor.voiceStop":`Diktat beenden`,"editor.listening":`Ich höre zu …`,"editor.transcribing":`Wird verschriftlicht …`,"editor.micDenied":`Das Mikrofon ist für diese Seite nicht freigegeben.`,"editor.building":`Baue den Ablauf …`,"editor.files":`Dateien`,"files.explain":`Was dein Wizard bei jedem Durchlauf braucht: Widget-Code, Bibliotheken, Kartenumrisse, Preislisten. Der Assistent legt sie im Gespräch an – du kannst auch eigene hochladen.`,"files.upload":`Hochladen`,"files.drop":`Zum Hochladen loslassen`,"files.count":`{n} Dateien · {size}`,"files.empty":`Noch keine Dateien. Zieh Dateien hierher oder bitte den Assistenten, ein Widget zu bauen.`,"files.download":`Herunterladen`,"files.delete":`Löschen`,"files.confirmDelete":`„{path}“ löschen?`,"files.none":`Dieser Wizard hat keine Dateien.`,"editor.thinking":`Denkt nach …`,"editor.chatBroken":`Die Verbindung ist abgebrochen. Was schon gebaut war, ist gespeichert – schick die Nachricht bitte noch einmal.`,"editor.issues":`Bevor du testest oder teilst, braucht der Wizard noch Korrekturen:`,"editor.fixWithChat":`Vom Assistenten beheben lassen`,"editor.models.blocking":`So kann der Wizard nicht starten. Es fehlen Modelle:`,"editor.models.optional":`Diese Schritte laufen so nicht. Wähle beim Testen einen Weg ohne sie oder richte die Modelle ein:`,"editor.models.settings":`Modelle einrichten`,"editor.prevStep":`Vorheriger Schritt`,"editor.nextStep":`Nächster Schritt`,"editor.deleteStep":`Schritt löschen`,"editor.holdToDelete":`Zum Löschen halten`,"editor.deleting":`Löschen`,"editor.moveUp":`Nach oben`,"editor.moveDown":`Nach unten`,"editor.noRuns":`Noch keine Durchläufe.`,"editor.restart":`Neu starten`,"editor.close":`Schließen`,"runDrawer.expand":`Ganzes Fenster`,"runDrawer.shrink":`Zurück an den Rand`,"editor.chatHello":`Beschreibe mir, was dein Wizard tun soll. Ich baue den Ablauf und du siehst ihn links als Diagramm.`,"shareRun.button":`Teilen`,"shareRun.title":`Ergebnis teilen`,"shareRun.email":`E-Mail`,"shareRun.more":`Mehr …`,"shareRun.until":`Der Link ist bis {date} gültig.`,"shareRun.kept":`Der Link bleibt gültig, bis du ihn zurückziehst.`,"shareRun.withdraw":`Link zurückziehen`,"sharePage.gone":`Dieser Link ist abgelaufen oder wurde zurückgezogen.`,"sharePage.own":`Selbst ausprobieren`,"sharePage.until":`Geteilt · verfügbar bis {date}`,"sharePage.shared":`Geteilt am {date}`,"share.title":`Wizard teilen`,"share.link":`Link`,"share.copy":`Kopieren`,"share.copied":`Kopiert`,"share.enabled":`Link ist aktiv`,"share.limit":`Durchläufe pro Tag`,"share.rotate":`Neuen Link erzeugen`,"share.rotateHint":`Der alte Link funktioniert danach nicht mehr.`,"share.publishFirst":`Veröffentliche den Wizard, damit der Link funktioniert.`,"share.unpublished":`Deine Änderungen sind noch nicht veröffentlicht: der Link läuft mit der Version davor.`,"share.website":`Website`,"share.openHere":`Auf diesem Computer testen`,"share.settings":`Einstellungen`,"share.on":`aktiv`,"share.off":`aus`,"share.perDay":`{n} pro Tag`,"share.rotateCloud":`Der alte Link funktioniert danach nicht mehr – auch der in der Cloud.`,"share.others":`Mit anderen teilen`,"share.othersHint":`Mit einem Konto läuft der Wizard auch auf engenty.ai: ein Link, ein QR-Code und ein Tag für deine Website – für alle, auch wenn dein Computer aus ist.`,"share.details":`Details`,"teaser.website":`Eine Website braucht einen Link, den jeder erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann steht hier der Tag für deine Seite.`,"teaser.qr":`Ein QR-Code braucht einen Link, den jedes Handy erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann stehen hier der QR-Code und die ID für die App.`,"teaser.link":`Dieser Link geht nur auf diesem Computer, solange die App läuft. Mit einem Konto läuft der Wizard auch auf engenty.ai – mit einem Link für alle.`,"teaser.models":`Ohne eigenen API Key: mit einem Konto laufen Text, Bilder und Videos über Guthaben.`,"teaser.connect":`Konto verbinden`,"teaser.modelsLinked":`Oder über das Guthaben deines Kontos: unter Modelle „Guthaben des Kontos“ wählen.`,"share.open":`Öffnen`,"share.qr":`QR-Code`,"share.qrHint":`Mit der Kamera des Handys scannen: der Wizard öffnet sich, in der App engenty wizards, wenn sie installiert ist.`,"share.code":`ID für die App:`,"share.readOnly":`Ob der Link aktiv ist und wie viele Durchläufe er am Tag zulässt, stellst du in deiner lokalen Installation ein.`,"embed.inline":`In der Seite`,"embed.modal":`Button + Fenster`,"embed.inlineHint":`Füge das Tag in den HTML-Code deiner Seite ein. Der Wizard erscheint an dieser Stelle.`,"embed.modalHint":`Füge das Tag in den HTML-Code deiner Seite ein. An dieser Stelle erscheint ein Button, der den Wizard in einem Fenster öffnet.`,"type.page":`Seite`,"type.agent":`KI-Schritt`,"type.generate":`Erzeugen`,"type.surface":`Ansicht`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Prüfen`,"type.result":`Ergebnis`,"run.start":`Los geht's`,"run.closed":`Hier gerade nicht verfügbar, dafür fehlt: {list}`,"slot.later":`Spätere Termine zeigen`,"slot.none":`Gerade sind keine Termine frei.`,"run.cls.text":`Text`,"run.cls.image":`Bilder`,"run.cls.video":`Videos`,"run.cls.speech":`Sprachausgabe`,"run.cls.audio":`Sprachnotizen`,"run.next":`Weiter`,"run.back":`Zurück`,"run.accept":`Passt so`,"run.regenerate":`Neue Variante`,"run.edit":`Bearbeiten`,"run.resume":`Letzten Durchlauf fortsetzen`,"run.regenerateNote":`Was soll anders werden?`,"run.pickItem":`Nr. {n}`,"run.pickedItem":`Nr. {n} neu`,"run.regeneratePicked":`Neu erstellt wird nur Nr. {n}.`,"run.regenerateAll":`Alle werden neu erstellt. Tippe oben auf eine Nummer, um nur einzelne zu erneuern.`,"check.progress":`{done} von {total} geprüft`,"check.onlyOpen":`Nur offene`,"check.noFile":`Zu dieser Zeile gibt es keine Datei.`,"check.noPreview":`Für diese Datei gibt es keine Vorschau – öffne sie mit dem Link oben.`,"check.reopen":`Wieder offen`,"market.search":`Vorlage suchen …`,"market.all":`Alle`,"market.industry":`Branche`,"market.format":`Ergebnis`,"market.capability":`Fähigkeit`,"market.unavailable":`nicht eingerichtet`,"market.without":`Geht auch ohne: {list}`,"market.optional":`nicht eingerichtet, geht auch ohne`,"market.optionalHint":`Läuft hier ohne {list}: Antworten, die das bräuchten, sind im Wizard gesperrt. Einrichten unter Modelle.`,"market.missing":`Hier nicht eingerichtet: {list}`,"market.plan":`Paket`,"market.pro":`Pro`,"market.proHint":`Braucht Plugins, die mit Pro auf engenty.ai dabei sind`,"market.needsPro":`Mit Pro: braucht {list}`,"market.needsProHint":`Diese Vorlage braucht {list}. Die Plugins sind mit Pro und Team auf engenty.ai dabei.`,"market.missingHint":`Dafür fehlt hier ein Modell: {list}. Richte es unter Modelle ein.`,"market.none":`Keine Vorlage passt zu dieser Auswahl.`,"market.notFound":`Diese Vorlage gibt es nicht (mehr).`,"market.star":`Merken`,"market.starred":`Gemerkt`,"market.starHint":`Gemerkte Vorlagen liegen auf diesem Rechner auch ohne Verbindung bereit.`,"market.fromPlugin":`Kommt mit dem Plugin „{name}“`,"market.noneStarred":`Du hast noch keine Vorlage gemerkt.`,"market.offline":`Keine Verbindung zum Marktplatz: du siehst die Vorlagen, die hier bereitliegen.`,"market.more":`Mehr anzeigen`,"market.reset":`Auswahl zurücksetzen`,"market.count":`{n} Vorlagen`,"market.countOf":`{n} von {all} Vorlagen`,"market.countOfShort":`{n} von {all}`,"market.resetShort":`Zurücksetzen`,"market.minutes":`~ {n} Min.`,"market.credits":`~ {n} Credits pro Lauf`,"market.needsUpdate":`Braucht eine neuere App`,"market.needsUpdateHint":`Diese Vorlage nutzt Funktionen, die deine App noch nicht kennt. Aktualisiere die App, dann kannst du sie verwenden.`,"market.use":`Mit dieser Vorlage starten`,"market.steps":`So läuft der Wizard ab`,"market.duration":`Dauer`,"market.durationHint":`vom Start bis zum Ergebnis, mit {n} Angaben von dir`,"market.result":`Ergebnis`,"market.creditsRange":`~ {n} Credits`,"market.creditsHint":`pro Lauf geschätzt, selten mehr als das Doppelte`,"market.needs":`Braucht`,"market.cost":`Kosten`,"new.forWebsite":`Kleine Helfer für deine Website`,"run.feedbackPlaceholder":`Passt etwas nicht? Schreib, was anders sein soll …`,"run.feedbackTarget":`Was soll sich ändern?`,"run.feedbackPick":`Wähle oben, was sich ändern soll.`,"ai.generated":`KI-generiert`,"ai.modified":`Mit KI verändert`,"ai.publish":`Mit KI erstellt: Wer das veröffentlicht, muss es als KI-generiert kennzeichnen (EU AI Act, Art. 50). Die Datei trägt die Kennzeichnung bereits in ihren Metadaten.`,"run.regenerateGo":`Neu erstellen`,"run.retry":`Erneut versuchen`,"run.again":`Nochmal`,"run.download":`Herunterladen`,"run.copy":`Text kopieren`,"run.failed":`Da hat etwas nicht geklappt.`,"run.unavailable":`Dieser Wizard ist gerade nicht verfügbar.`,"run.notFound":`Diesen Wizard gibt es nicht (mehr).`,"run.madeWith":`Erstellt mit engenty wizards`,"run.working":`Einen Moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Abgebrochen.`,"run.addRow":`Zeile hinzufügen`,"run.upload":`Datei wählen oder hierher ziehen`,"run.uploading":`Lädt hoch …`,"run.required":`Pflichtfeld`,"run.net":`Netto`,"run.vat":`USt. {r} %`,"run.total":`Gesamt`,"settings.title":`Einstellungen`,"settings.name":`Name`,"settings.mcp":`Verbundene Systeme (MCP)`,"settings.mcpHint":`KI-Schritte können in diese Systeme schreiben oder daraus lesen – nur, wenn du sie im Schritt freigibst.`,"settings.addServer":`System verbinden`,"settings.serverName":`Name`,"settings.serverUrl":`MCP-URL`,"settings.serverHeader":`Authorization-Header (optional)`,"settings.save":`Speichern`,"settings.saved":`Gespeichert`,"settings.delete":`Space löschen`,"settings.noProject":`Hier erscheint dein Space, sobald deine lokale Installation den ersten Wizard veröffentlicht hat.`,"settings.copy":`Kopieren`,"settings.copied":`Kopiert`,"settings.lastUsed":`zuletzt {when}`,"settings.neverUsed":`noch nie benutzt`,"settings.revoke":`Schlüssel löschen`,"mcp.appsDisconnect":`Austragen`,"plugins.title":`Plugins`,"plugins.hint":`Plugins erweitern diese App um Seiten, Einstellungen und Werkzeuge für Schritte. Sie laufen mit allen Rechten der App: installiere nur, was du kennst.`,"plugins.hintManaged":`Diese Plugins sind für dein Konto freigeschaltet.`,"plugins.reload":`Neu laden`,"plugins.rescan":`Neu suchen`,"plugins.tools":`Werkzeuge für Schritte`,"plugins.serverFailed":`Der Server-Teil hat nicht geladen: {error}`,"plugins.studioFailed":`Der Studio-Teil hat nicht geladen: {error}`,"plugins.problems":`Kein Plugin`,"plugins.crashed":`Dieser Teil eines Plugins ist abgestürzt.`,"mcp.notReverse":`Nicht verwechseln mit „Verbundene Systeme (MCP)“ unter Connectors: Dort ruft engenty andere Server auf, hier ruft dein Client engenty auf.`,"integrate.nav":`Einbinden`,"integrate.groupApps":`KI-Apps`,"integrate.groupShare":`Teilen`,"integrate.shareLink":`Per Link teilen`,"integrate.shareSite":`In eine Website einbinden`,"integrate.soon":`bald`,"integrate.stateWorks":`funktioniert`,"integrate.stateConnected":`eingetragen`,"integrate.stateInstalled":`auf diesem Computer`,"integrate.kindMcp":`Werkzeuge im Chat: Wizards finden, starten, ausfüllen – und bauen.`,"integrate.kindMcpShort":`Werkzeuge im Chat`,"integrate.kindAppShort":`der Wizard als Widget`,"integrate.kindAppNoShort":`zeigt diese App nicht`,"integrate.kindApp":`Der Wizard selbst im Chat, Seite für Seite, als Widget.`,"integrate.kindAppNo":`Zeigt diese App nicht – ein Lauf kommt als Text.`,"integrate.where":`Wo läuft die App?`,"integrate.here":`Auf diesem Computer`,"integrate.hereHint":`Ein Klick, kein Schlüssel. Die App startet engenty wizards selbst.`,"integrate.hereManaged":`Nur mit engenty wizards auf deinem Computer.`,"integrate.address":`Über die Adresse`,"integrate.addressHint":`Von überall, wo die Adresse erreichbar ist – mit Schlüssel.`,"integrate.connectTitle":`Eintragen`,"integrate.connectHint":`Trägt engenty wizards in die Einstellungen von {app} ein.`,"integrate.connect":`In {app} eintragen`,"integrate.connected":`In {app} eingetragen`,"integrate.notInstalled":`{app} ist auf diesem Computer nicht zu finden. Eintragen geht trotzdem – es wirkt, sobald {app} da ist.`,"integrate.file":`In {file} eintragen:`,"integrate.vscode":`In VS Code: „MCP: Open User Configuration“, dann eintragen:`,"integrate.chatgpt":`In ChatGPT: Einstellungen → Apps & Connectors → Erweitert → Entwicklermodus, dann „Erstellen“ mit dieser Adresse:`,"integrate.generic":`In den MCP-Einstellungen der App einen Server mit dieser Adresse anlegen (Streamable HTTP):`,"integrate.oauthLocal":`Diese App verbindet sich von den Servern ihres Herstellers aus – diesen Computer erreicht sie nicht. Nimm hier „Auf diesem Computer“ oder eine App, die hier läuft.`,"integrate.test":`Testen`,"integrate.seen":`{app} meldet sich`,"integrate.restart":`Beende {app} ganz und starte es neu – dann meldet es sich hier.`,"integrate.reload":`Lade die MCP-Server in {app} neu oder starte es neu.`,"integrate.tool":`Ein Werkzeug aufgerufen`,"integrate.askHint":`Schreib in {app} in einem neuen Chat:`,"integrate.askTool":`Welche Wizards habe ich in engenty?`,"integrate.widget":`Wizard als Widget gezeigt`,"integrate.widgetHint":`Starte einen veröffentlichten Wizard:`,"integrate.askWidget":`Starte einen meiner engenty Wizards.`,"integrate.works":`{app} arbeitet mit deinen Wizards.`,"mcp.notHere":`Geht mit diesem Server nicht`,"mcp.needsPublic":`claude.ai verbindet sich von Anthropics Servern aus. Das geht nur, wenn dieser Server öffentlich über HTTPS erreichbar ist.`,"mcp.keyTitle":`Schlüssel erstellen`,"mcp.keyHint":`Mit dem Schlüssel meldet sich dein Client an. Er wird nur einmal angezeigt und steht dann gleich im Befehl im nächsten Schritt.`,"mcp.keyCreate":`Schlüssel für {client} erstellen`,"mcp.keyReady":`Schlüssel erstellt – er steht schon im Befehl unten.`,"mcp.keyFirst":`Erst den Schlüssel erstellen – dann steht hier der fertige Befehl.`,"mcp.add":`Server eintragen`,"mcp.terminal":`Im Terminal ausführen:`,"mcp.ccPlugin":`Optional das Plugin – es bringt den Befehl /wizard mit:`,"mcp.codexKey":`Im Terminal ausführen – Codex liest den Schlüssel aus einer Umgebungsvariable:`,"mcp.claudeAi":`In claude.ai: Einstellungen → Konnektoren → Eigenen Konnektor hinzufügen, diese Adresse eintragen:`,"mcp.oauth":`Kein Schlüssel nötig: Beim ersten Aufruf meldet sich dein Client im Browser an.`,"mcp.addressPublic":`Öffentlich erreichbar.`,"mcp.addressLocal":`Nur auf diesem Rechner erreichbar, und nur solange engenty wizards läuft.`,"mcp.keys":`Schlüssel`,"mcp.keysHint":`Jeder Schlüssel meldet einen Client an und hat alle Rechte – behandle ihn wie ein Passwort. Löschst du ihn, ist der Client abgemeldet.`,"editor.viaClient":`Über {client}`,"editor.changedVia":`Geändert über {client}`,"editor.merged":`Mit Änderungen von außen zusammengeführt`,"run.uploadMore":`Weitere Datei`,"run.camera":`Kamera`,"camera.title":`Mit der Kamera aufnehmen`,"camera.hint":`Gerade und gut beleuchtet ins Bild halten.`,"camera.taken":`{n} aufgenommen`,"camera.shoot":`Aufnehmen`,"camera.done":`Fertig`,"camera.denied":`Die Kamera ist für diese Seite nicht freigegeben. Erlaube sie in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder nimm das Foto mit der Kamera-App auf.`,"connect.go":`Verbinden`,"connect.connected":`Verbunden über {name}`,"connect.disconnect":`Trennen`,"connect.none":`Auf diesem Server ist noch kein Anbieter zum Verbinden eingerichtet.`,"connect.openLink":`Hier klicken, um die Anmeldung in einem neuen Tab zu öffnen`,"list.empty":`Noch keine Einträge.`,"list.delete":`Zeile löschen`,"ask.typeInto":`Text in die Seite tippen …`,"ask.hide":`verdeckt`,"ask.up":`Nach oben`,"ask.down":`Nach unten`,"ask.pictureHint":`Das ist die Seite, die der Wizard geöffnet hat. Du kannst auch direkt ins Bild klicken und tippen.`,"ask.remember":`Anmeldung für nächstes Mal merken`,"ask.private":`Was du eingibst, geht direkt in die Seite. Die KI bekommt es nicht zu sehen. Gemerkte Anmeldungen werden verschlüsselt gespeichert.`,"ask.skip":`Überspringen`,"ask.done":`Ich bin angemeldet`,"ask.signIn":`Anmelden`,"ask.wants":`Der Wizard möchte in {service} Folgendes ausführen:`,"ask.allowRest":`Für den Rest dieses Durchlaufs erlauben`,"ask.allow":`Erlauben`,"ask.deny":`Nicht erlauben`,"store.open":`Was dieser Wizard sich merkt`,"store.title":`Gespeichert für dich`,"store.explain":`Dieser Wizard merkt sich Listen, Dateien und verbundene Konten für deinen nächsten Durchlauf. Nur du siehst sie.`,"store.empty":`Noch nichts gespeichert.`,"store.rows":`{n} Einträge`,"store.signIns":`Gemerkte Anmeldungen im Browser`,"store.files":`{n} Dateien · {size}`,"store.delete":`Alles löschen`,"store.confirmDelete":`Wirklich alles löschen`,"common.close":`Schließen`,"composer.send":`Senden`,"dictation.settings":`Mikrofon und Aufnahme`,"dictation.microphone":`Mikrofon`,"dictation.default":`Standard des Systems`,"dictation.mic":`Mikrofon {n}`,"dictation.showMics":`Namen der Mikrofone zeigen …`,"dictation.hold":`Halten zum Aufnehmen`,"dictation.holdToTalk":`Zum Sprechen gedrückt halten`,"date.pick":`Datum wählen`,"time.pick":`Uhrzeit wählen`,"time.hour":`Stunde`,"time.minute":`Minute`,"date.pickRange":`Tag oder Zeitraum wählen`,"date.pickStart":`Ersten Tag wählen`,"date.pickEnd":`Letzten Tag wählen – oder denselben für einen Tag`,"date.today":`Heute`,"date.clear":`Leeren`,"date.prev":`Voriger Monat`,"date.next":`Nächster Monat`,"connectors.title":`Connectors`,"connectors.hint":`Dienste, in denen ein Wizard für die Person arbeiten kann – sie verbindet beim Durchlauf ihr eigenes Konto. Die wichtigsten sind eingebaut; jeden weiteren findest du im Verzeichnis integrations.sh und importierst ihn aus seiner OpenAPI-Beschreibung oder seinem MCP-Server.`,"connectors.imported":`Aus dem Verzeichnis`,"connectors.noneImported":`Hier ist kein Connector aus dem Verzeichnis importiert.`,"connectors.notSetUp":`nicht eingerichtet`,"connectors.setup":`Auf dem Server fehlen:`,"connectors.search":`Dienst suchen, z. B. Notion, Stripe, GitHub`,"connectors.find":`Suchen`,"connectors.none":`Nichts gefunden.`,"connectors.import":`Importieren`,"connectors.exists":`Schon importiert.`,"connectors.ownClient":`Eigener OAuth-Client`,"connectors.refresh":`Aktionen neu laden`,"connectors.remove":`Entfernen`,"connectors.actions":`{n} Aktionen, {r} lesend`,"connectors.pending":`Aktionen erscheinen, sobald ein Konto verbunden ist`,"connectors.needsClient":`Dieser Dienst braucht einen OAuth-Client (ID und Secret). Entfernen und mit „Eigener OAuth-Client“ neu importieren.`,"connectors.authNone":`ohne Anmeldung`,"connectors.authOauth":`Anmeldung per OAuth`,"connectors.authKey":`API-Schlüssel`,"connectors.group.read":`liest`,"connectors.group.write":`ändert`,"connectors.group.destructive":`löscht`,"run.uploadTouch":`Datei wählen`,"run.maxFiles":`Hier gehen höchstens {n} – die übrigen habe ich weggelassen.`,"run.filesMin":`{n} von mindestens {min}`,"run.filesOf":`{n} von höchstens {max}`,"run.moveFile":`Nr. {n} verschieben`,"run.moveFileHint":`Ziehen, um die Reihenfolge zu ändern`,"run.removeFile":`Entfernen`,"run.awake":`Der Bildschirm bleibt an, solange der Wizard arbeitet.`,"run.openFull":`Groß öffnen`,"run.yes":`Ja`,"run.no":`Nein`,"run.share":`Teilen`,"run.shareNow":`Jetzt teilen`,"run.shareFile":`Als Datei teilen oder in einer App öffnen`,"camera.asking":`Dein Browser fragt gleich nach der Kamera. Das Bild bleibt in diesem Wizard.`,"camera.missing":`An diesem Gerät wurde keine Kamera gefunden. Lade stattdessen ein Foto hoch.`,"camera.busy":`Die Kamera wird gerade von einer anderen App verwendet. Schließe sie und versuche es noch einmal.`,"camera.native":`Kamera-App öffnen`,"camera.pick":`Foto auswählen`,"camera.torch":`Licht`,"camera.flip":`Kamera wechseln`,"camera.photo":`Foto`,"camera.video":`Video`,"camera.record":`Aufnahme starten`,"camera.stop":`Aufnahme beenden`,"camera.recording":`Nimmt auf – tippe zum Beenden.`,"camera.clipHint":`Ein kurzer Clip, höchstens {s} Sekunden.`,"camera.hintMany":`Seite für Seite aufnehmen, dann „Fertig“.`,"scan.button":`Scannen`,"scan.title":`Code scannen`,"scan.asking":`Dein Browser fragt gleich nach der Kamera – sie liest nur den Code.`,"scan.hint":`Halte den QR- oder Strichcode in den Rahmen.`,"scan.hintQr":`Halte den QR-Code in den Rahmen. Strichcodes liest dieses Gerät hier nicht.`,"scan.miss":`Auf dem Foto war kein Code zu erkennen. Versuch es näher und schärfer.`,"scan.fromPhoto":`Foto mit dem Code wählen`,"scan.typeInstead":`Lieber eintippen`,"location.use":`Meinen Standort übernehmen`,"location.locating":`Standort wird bestimmt …`,"location.refining":`wird noch genauer …`,"location.accuracy":`auf etwa {m} m genau`,"location.map":`Karte`,"location.remove":`Standort entfernen`,"location.why":`Dein Browser fragt nach deinem Standort. Er wird nur für diesen Wizard verwendet. Du kannst auch einfach die Adresse eintippen.`,"location.denied":`Der Standort ist für diese Seite nicht freigegeben. Erlaube ihn in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder tippe die Adresse unten ein.`,"location.unavailable":`Dein Gerät konnte den Standort gerade nicht bestimmen. Versuch es im Freien noch einmal oder tippe die Adresse ein.`,"location.timeout":`Das hat zu lange gedauert. Versuch es noch einmal oder tippe die Adresse ein.`,"location.manual":`Adresse oder Ort eintippen`,"location.label":`Adresse oder Beschreibung des Orts`,"voice.start":`Sprachnotiz aufnehmen`,"voice.stop":`Stopp`,"voice.recording":`Aufnahme läuft …`,"voice.left":`noch {s} s`,"voice.again":`Neu aufnehmen`,"voice.remove":`Löschen`,"voice.pick":`Audiodatei wählen`,"voice.why":`Dein Browser fragt nach dem Mikrofon. Die Aufnahme wird danach in Text umgewandelt.`,"voice.denied":`Das Mikrofon ist für diese Seite nicht freigegeben. Erlaube es in den Website-Einstellungen deines Browsers – oder nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"voice.noRecorder":`Dieser Browser kann hier nicht aufnehmen. Nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"sign.open":`Hier unterschreiben`,"sign.hint":`Mit dem Finger unterschreiben`,"sign.pad":`Unterschriftsfeld`,"sign.clear":`Löschen`,"sign.accept":`Übernehmen`,"sign.again":`Neu unterschreiben`,"sign.remove":`Unterschrift entfernen`,"notify.ask":`Bescheid geben, wenn es fertig ist`,"notify.on":`Du bekommst Bescheid`,"notify.why":`Mit Ton, Vibration oder einer Mitteilung. Dein Browser fragt dafür einmal um Erlaubnis.`,"notify.onHint":`Du kannst die App wechseln – eine Mitteilung holt dich zurück.`,"notify.quiet":`Mit Ton und Vibration, solange diese Seite offen ist.`,"notify.blocked":`Mitteilungen sind für diese Seite blockiert – es gibt Ton und Vibration, solange sie offen ist. Erlauben kannst du sie in den Website-Einstellungen deines Browsers.`,"notify.done":`Dein Ergebnis ist fertig.`,"notify.next":`Es geht weiter – wirf einen Blick darauf.`,"notify.needsYou":`Der Wizard braucht dich kurz.`,"install.add":`Zum Startbildschirm hinzufügen`,"install.ios":`Tippe unten auf „Teilen“ und dann auf „Zum Home-Bildschirm“.`,"install.bookmark":`Als Lesezeichen speichern`,"install.bookmark.mac":`Drücke ⌘ D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.bookmark.pc":`Drücke Strg + D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.app":`In der App öffnen`,"install.app.offer":`Installiere das Studio als App: eigenes Fenster, eigenes Symbol im Dock oder in der Taskleiste.`,"install.app.browser":`In Chrome oder Edge lässt sich das Studio als App installieren: eigenes Fenster, eigenes Symbol.`,"install.app.action":`Als App installieren`,"install.app.close":`Schließen`,"common.offline":`Keine Verbindung. Prüfe dein Netz und versuch es noch einmal.`,"common.retry":`Erneut versuchen`,"common.cancel":`Abbrechen`,"common.loading":`Lädt …`,"common.error":`Fehler`,"data.hint":`Tabellen und Seiten, die der Space und seine Wizards behalten.`,"data.all":`Alle Daten`,"data.own":`Allgemein`,"data.table":`Tabelle`,"data.page":`Seite`,"data.newTable":`Neue Tabelle`,"data.newPage":`Neue Seite`,"data.title":`Titel`,"data.owner":`Gehört zu`,"data.create":`Anlegen`,"data.empty":`Noch keine Tabellen und Seiten. Leg eine an – bald schreiben auch deine Wizards hier.`,"data.rows":`{n} Zeilen`,"data.addRow":`Zeile`,"data.noRows":`Noch keine Zeilen.`,"data.deleteRow":`Zeile löschen`,"data.deleteTable":`Tabelle löschen`,"data.deletePage":`Seite löschen`,"data.confirmDelete":`„{title}“ löschen?`,"data.newColumn":`Neue Spalte`,"data.columnName":`Name`,"data.columnType":`Typ`,"data.required":`Muss ausgefüllt werden`,"data.deleteColumn":`Spalte löschen`,"data.removeOption":`Entfernen`,"data.fromList":`Eine Liste des Wizards: jeder Durchlauf schreibt hier hinein. Die Spalten kommen aus dem Wizard.`,"data.badCell":`Dieser Wert passt nicht in „{column}“ und ist nicht gespeichert.`,"data.type.text":`Text`,"data.type.number":`Zahl`,"data.type.date":`Datum`,"data.type.duration":`Dauer`,"data.type.select":`Auswahl`,"data.type.boolean":`Ja / Nein`,"data.text.single":`Eine Zeile`,"data.text.multiline":`Mehrere Zeilen`,"data.number.integer":`Ganze Zahl`,"data.number.decimal":`Dezimalzahl`,"data.number.percent":`Prozent`,"data.number.currency":`Betrag`,"data.currency":`Währung (z. B. EUR)`,"data.date.date":`Datum`,"data.date.datetime":`Datum und Uhrzeit`,"data.date.time":`Uhrzeit`,"data.unit":`Eingabe in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`Sekunden`,"data.unit.minutes":`Minuten`,"data.unit.hours":`Stunden`,"data.unit.days":`Tage`,"data.options":`Auswahlmöglichkeiten, eine je Zeile`,"data.multiple":`Mehrere wählbar`,"data.write":`Schreiben`,"data.preview":`Vorschau`,"data.pageEmpty":`Diese Seite ist noch leer.`,"data.markdownHint":`Markdown: # Überschrift, **fett**, - Liste`,"space.info":`Info & Marke`,"space.knowledge":`Wissen`,"space.data":`Daten`,"space.results":`Ergebnisse`,"space.resultsAll":`Alle Ergebnisse`,"space.resultsHint":`Läufe deiner Wizards, die ihr Ergebnis erreicht haben, die neuesten zuerst.`,"space.resultsEmpty":`Noch keine Ergebnisse. Ein Lauf steht hier, sobald er fertig ist.`,"space.resultCredits":`{n} Credits`,"space.resultsSearch":`Suchen: Wizard, Eingaben, Ergebnis …`,"space.resultsModeAll":`Live & Test`,"space.resultsAnyTime":`Jederzeit`,"space.resultsDay":`Letzte 24 Stunden`,"space.resultsDays":`Letzte {n} Tage`,"space.resultsNone":`Keine Ergebnisse zu dieser Suche.`,"space.resultFiles":`{n} Dateien`,"project.rename":`Space umbenennen`,"project.saving":`Speichert …`,"project.base":`Basis`,"project.baseHint":`Wer hinter den Wizards steht. Jeder KI-Schritt kennt das.`,"project.title":`Titel`,"project.titleHint":`Firma, Marke oder Vorhaben – so sehen es auch Endnutzer.`,"project.about":`Über`,"project.aboutHint":`Was ihr macht, für wen, und in welchem Ton ihr schreibt.`,"project.logos":`Logos`,"project.logosHint":`Das erste Logo sehen Endnutzer. Eine Beschreibung sagt, wofür eine Variante gedacht ist.`,"project.logoAdd":`Logo`,"project.logoMain":`Hauptlogo`,"project.logoMakeMain":`Als Hauptlogo`,"project.colors":`Farben`,"project.colorsHint":`Die erste Farbe ist der Akzent in Dokumenten, Dashboards und auf öffentlichen Seiten.`,"project.colorAdd":`Farbe`,"project.colorName":`z. B. Primär – Buttons und Überschriften`,"project.colorUse":`Beschreibe, wie engenty diese Farbe einsetzen soll.`,"project.colorAddTitle":`Farbe hinzufügen`,"project.colorValue":`Farbwert`,"project.colorUseLabel":`Verwendung`,"project.add":`Hinzufügen`,"project.colorAccent":`Akzent`,"project.colorFirst":`Als Akzent`,"project.assets":`Assets`,"project.assetsHint":`Bilder, Grafiken, Videos. KI-Schritte setzen sie in Dokumente und wählen nach der Beschreibung.`,"project.assetAdd":`Dateien`,"project.assetSearch":`Assets filtern …`,"know.all":`Alles`,"know.title":`Wissen`,"know.hint":`Was die Schritte deiner Wizards nachschlagen. Dokumente werden beim Hochladen zu Seiten und Tabellen; Kategorien halten die Einträge auseinander.`,"know.empty":`Noch nichts da. Lade Dokumente hoch, leg eine Seite an oder gib dem Assistenten eine Website.`,"know.drop":`Dokumente hierher ziehen oder`,"know.pick":`auswählen`,"know.page":`Seite`,"know.table":`Tabelle`,"know.faq":`FAQ`,"know.file":`Datei`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`Neue Seite`,"know.newTable":`Neue Tabelle`,"know.asFaq":`Als FAQ: Frage und Antwort je Zeile`,"know.newCategory":`Neue Kategorie`,"know.search":`Suche testen …`,"know.searchNone":`Nichts Relevantes gefunden.`,"know.searchStats":`{candidates} Kandidaten geprüft, {hits} relevant`,"know.searchUnchecked":`{hits} Treffer, ungeprüft`,"know.unchecked":`Ohne Classifier bleiben Treffer ungeprüft. Er braucht einen AI-Gateway- oder TypeSafe-Key oder ein Konto.`,"know.keywordsOnly":`Ohne Embedding-Modell findet die Suche nach Wörtern, nicht nach Bedeutung.`,"know.clear":`Zurücksetzen`,"know.sub":`{n} Unterseiten`,"know.rows":`{n} Zeilen`,"know.review":`Prüfen`,"know.reviewed":`Geprüft`,"know.from":`Aus {label}`,"know.kept":`Von Hand geändert: {label} schreibt sie nicht mehr.`,"know.original":`Original`,"know.reading":`Wird gelesen …`,"know.subPages":`Unterseiten`,"know.addSub":`Unterseite`,"know.type.choice":`Auswahl`,"know.type.date":`Datum`,"know.type.number":`Zahl`,"know.type.text":`Text`,"know.type.boolean":`Ja / Nein`,"know.name":`Name`,"know.type":`Typ`,"know.unit":`Einheit`,"know.unitHint":`z. B. h, €, kg`,"know.multiple":`Mehrere Werte je Eintrag`,"know.ordered":`Die Werte sind gestuft (niedrig → hoch)`,"know.values":`Werte`,"know.valuesHint":`Einer je Zeile. Weitere kommen mit den Einträgen dazu.`,"know.hintField":`Woher die Werte kommen`,"know.hintFieldHint":`Kurz, z. B. Kopfzeile, Dateiname, Filter der Website.`,"know.create":`Anlegen`,"know.proposed":`Vorgeschlagen`,"know.proposedHint":`Erst übernommen wird sie gefüllt.`,"know.accept":`Übernehmen`,"know.dismiss":`Verwerfen`,"know.alike":`„{a}“ und „{b}“ sehen nach einem Wert aus.`,"know.merge":`Zusammenführen`,"know.items":`{n} Einträge`,"know.item":`1 Eintrag`,"know.row":`1 Zeile`,"know.oneSub":`1 Unterseite`,"know.addValue":`Wert hinzufügen`,"know.range":`{min} bis {max}`,"know.summary":`Übersicht`,"know.summaryHint":`Ein Modell fasst die Einträge dieses Werts zusammen. Die Suche findet die Übersicht wie eine Seite.`,"know.summaryWrite":`Übersicht schreiben`,"know.summaryAgain":`Neu schreiben`,"know.summaryEmpty":`Noch keine Übersicht.`,"know.toc":`Inhaltsverzeichnis`,"know.tocRows":`{n} Zeilen in {table}`,"know.deleteCategory":`Kategorie löschen`,"know.confirmCategory":`„{name}“ löschen? Die Einträge bleiben, nur die Kategorie geht.`,"know.deleteValue":`Wert löschen`,"know.yes":`Ja`,"know.no":`Nein`,"know.minimum":`ab`,"know.maximum":`bis`,"know.contains":`enthält`,"know.by.person":`von Hand gesetzt`,"know.by.origin":`aus der Quelle`,"know.by.model":`von einem Modell gelesen`,"know.remove":`Entfernen`,"know.unset":`Nicht gesetzt`,"know.deleteFile":`Datei löschen`,"project.documents":`Dokumente`,"project.documentsHint":`PDFs, Listen, Excel, Word, Text. Sie werden gelesen und kommen in einen Index, den jeder KI-Schritt durchsucht.`,"project.documentAdd":`Dokumente`,"project.drop":`Hierher ziehen oder`,"project.staysLocal":`Bleibt in deiner lokalen Installation und wird nicht hierher gesendet.`,"project.description":`Beschreibung hinzufügen …`,"project.describing":`Wird angesehen …`,"project.reading":`Wird gelesen …`,"project.indexed":`Im Index`,"project.indexedKeywords":`Im Index (Stichwörter)`,"project.notIndexed":`Kein Text gefunden`,"project.reindex":`Neu einlesen`,"project.pages":`{n} Seiten`,"project.keywordsOnly":`Der Index sucht gerade nach Stichwörtern. Mit einem AI-Gateway- oder OpenAI-Schlüssel kommt die Suche nach Bedeutung dazu.`,"project.preview":`Vorschau`,"project.viewList":`Als Liste zeigen`,"project.viewCards":`Als Karten zeigen`,"project.original":`Original`,"project.readText":`Gelesener Text`,"project.openOriginal":`Original öffnen`,"project.noText":`Noch kein Text: das Dokument wird gerade gelesen oder ließ sich nicht lesen.`,"project.textCut":`Die Vorschau zeigt den Anfang ({shown} von {total} Zeichen).`,"project.searchTest":`Im Index suchen …`,"project.searchNone":`Nichts gefunden.`,"project.remove":`Entfernen`,"project.removeConfirm":`„{name}“ entfernen?`,"project.facts":`Fakten`,"project.factsHint":`Was Wizards wissen sollen: Adresse, UID, Öffnungszeiten – alles, was passt.`,"project.factLabel":`Bezeichnung`,"project.factValue":`Wert`,"project.factAdd":`Eintrag`,"project.factType":`Typ`,"project.factAuto":`Automatisch`,"project.type.text":`Text`,"project.type.longtext":`Langer Text`,"project.type.number":`Zahl`,"project.type.date":`Datum`,"project.type.url":`Link`,"project.type.email":`E-Mail`,"project.type.phone":`Telefon`,"project.type.boolean":`Ja / Nein`,"project.yes":`Ja`,"project.no":`Nein`,"project.assistant":`Assistent`,"project.assistantTitle":`Erzähl mir von euch`,"project.assistantHello":`Nenn mir eure Website oder gib mir Dateien. Ich trage ein, was ich finde: Titel, Beschreibung, Logo, Farben und Fakten.`,"project.assistantComposer":`z. B. „Lies unsere Website example.at“ …`,"project.assistantTitleKnowledge":`Was sollen deine Wizards wissen?`,"project.assistantHelloKnowledge":`Gib mir Dokumente oder sag mir, wo das Wissen steht. Ich lese es ein – unten siehst du, was hineinkommt.`,"project.assistantComposerKnowledge":`Dokumente anhängen oder sagen, wo das Wissen steht …`,"project.assistantChanged":`Space aktualisiert`,"flowApp.loading":`Der Wizard kommt …`,"flowApp.draft":`Entwurf`,"flowApp.published":`Veröffentlicht`,"flowApp.issues":`{n} Fehler im Entwurf`,"flowApp.flow":`Ablauf`,"flowApp.notPublished":`Veröffentliche ihn im Studio, dann läuft er hier.`,"flowApp.runPage":`Im Browser weiter`,"flowApp.inBrowser":`Nur im Browser: {fields}`,"flowApp.done":`Fertig`,"flowApp.credits":`{n} Credits`,"flowApp.ask":`Der Wizard fragt`,"flowApp.allow":`Erlauben`,"flowApp.skip":`Überspringen`,"flowApp.signIn":`Eine Anmeldung bei {site} – das geht nur im Browser.`,"flowApp.fullscreen":`Größer`,"flowApp.inline":`Kleiner`,"flowApp.failed":`Das hat nicht geklappt: {error}`},Hx={"brand.tagline":`Build AI wizards, no code.`,"brand.sub":`Describe a flow in your own words. engenty turns it into a wizard you share with a link.`,"auth.dev":`Dev login (local)`,"auth.legal":`No password, no sign-up form — you sign in with an account you already have.`,"auth.signIn":`Sign in or create an account`,"auth.failed":`Sign-in did not work. Please try again.`,"auth.localLink":`Open the link the app printed at start — it signs you in on this device.`,"nav.account":`Account & credits`,"setup.keysInAccount":`API keys for scripts belong to your account. You create and revoke them there.`,"setup.openAccount":`Open account`,"class.label":`Model class`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Image`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Speech`,"class.classifier.hint":`Routing, yes/no, pulling a few values out of text. Cheapest.`,"class.standard.hint":`Short copy, calling an API, reformatting.`,"class.high.hint":`Research with tools, long documents, weighing many sources.`,"class.highest.hint":`Hard reasoning or code. Several times the cost of High.`,"class.effort":`Thinking effort`,"class.effortAuto":`Automatic`,"class.effort.low":`Low`,"class.effort.medium":`Medium`,"class.effort.high":`High`,"estimate.step":`≈ {n} credits, rarely more than {high}`,"estimate.measured":`measured from the latest runs`,"estimate.formula":`estimated, gets exact after five runs`,"estimate.share":`A run costs about {run} credits. At the daily limit that is at most {day} credits a day.`,"local.title":`Models`,"local.accountWaiting":`Waiting for the sign-in in your browser …`,"local.accountFailed":`The account service cannot be reached right now.`,"local.accountExpired":`The sign-in has expired. Please sign in again.`,"local.sourceNeedsAccount":`This needs an account.`,"local.toAccount":`Go to Settings → Account`,"local.sourceOwn":`Own keys`,"local.keys":`Keys`,"local.keysHint":`One key is enough. Keys live in this device's keychain, never in the database.`,"local.keySet":`stored`,"local.keyEmpty":`not stored`,"local.keyRemove":`Remove`,"local.classes":`Model per class`,"local.classesHint":`A step names only the class. Here is which model serves it, e.g. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini or ollama:qwen3.`,"local.save":`Save`,"local.saved":`Saved`,"local.chat":`The studio chat answers on`,"local.chatModels":`Model class Highest`,"local.chatClaude":`Claude subscription (Claude Code)`,"local.subscription":`With the subscription, the Claude Code installed on this device builds the wizard — on your sign-in there. Runs keep using keys or credits.`,"harness.hint":`Text thinks on the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Images, video and audio still need a key.`,"harness.hintImages":`Text and images come from the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Video and audio still need a key.`,"harness.found":`{name} {version} found`,"harness.missing":`{name} is not installed on this device.`,"harness.install":`Or in your own terminal:`,"harness.installButton":`Install {name}`,"harness.installing":`{name} installs in the terminal below — it takes about a minute. Then you sign it in.`,"harness.installEnded":`The install ended, but {name} is not there. What it printed above says why.`,"harness.appHere":`The {app} app is on this computer: {name} signs in with the same {sub}.`,"harness.notInstalled":`not installed`,"harness.authSubscription":`Signed in with your {sub}.`,"harness.authKey":`Signed in with an API key from your shell — not the subscription. Sign in here so it runs on your {sub}.`,"harness.authNone":`Not signed in yet.`,"harness.signIn":`Sign in here`,"harness.signingIn":`The sign-in runs in the terminal below — your browser opens for it. The terminal closes once the sign-in is there.`,"harness.signInInteractive":`{name} starts below. Pick the sign-in with your {sub} there and sign in in the browser. The terminal closes once the sign-in is there.`,"harness.loginEnded":`The sign-in ended without {name} being signed in.`,"harness.sub.claude":`Claude subscription`,"harness.sub.codex":`ChatGPT subscription`,"harness.sub.gemini":`Google account`,"harness.sub.cursor":`Cursor subscription`,"harness.desc.claude":`On your Claude subscription — no key needed.`,"harness.desc.codex":`On your ChatGPT subscription — no key needed.`,"harness.desc.gemini":`On your Google account — no key needed.`,"harness.desc.cursor":`On your Cursor subscription — no key needed.`,"harness.ready":`signed in`,"local.recheck":`Check again`,"local.test":`Test`,"local.testHint":`One short call shows whether the way to the model is open.`,"local.testOk":`Answered in {s} s on {ref}: “{reply}”`,"local.testFailed":`The test did not work: {error}`,"models.groupCaps":`Capabilities`,"models.groupAccess":`Access`,"models.groupMore":`More providers`,"models.cap.text":`Text & reasoning`,"models.cap.text.hint":`Writes, summarizes, researches and decides – in almost every step.`,"models.cap.image":`Images`,"models.cap.image.hint":`Makes images: logos, product shots, illustrations.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Makes short clips from text or from an image.`,"models.cap.speech":`Voice`,"models.cap.speech.hint":`Reads text aloud: voice-overs, audio versions, announcements.`,"models.cap.listening":`Voice notes`,"models.cap.listening.hint":`Understands speech and turns voice notes into text.`,"models.way.local":`Local model`,"models.way.credits":`Credits`,"models.way.creditsTeam":`Team credits`,"models.way.none":`not set up`,"models.who":`Who does it?`,"models.optSubscription":`Your subscription`,"models.optKey":`Own API key`,"models.optLocal":`Local model`,"models.optLocalNote":`Ollama on this computer`,"models.noteIncluded":`included in the plan`,"models.noteSignedOut":`not signed in`,"models.noteMissing":`not installed`,"models.noteKey":`API key stored`,"models.noteKeyShort":`key`,"models.noteSignedIn":`signed in`,"models.noteShellKey":`API key from the shell`,"models.optOther":`Other`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API key missing`,"models.noteNeedsAccount":`needs an account`,"models.notePerImage":`≈ {n} credits per image`,"models.notePerSecond":`≈ {n} credits per second`,"models.notePer1k":`≈ {n} credits per 1000 characters`,"models.notePerMinute":`≈ {n} credits per minute`,"models.creditsAuto":`engenty picks: {model}`,"models.creditsAutoNone":`engenty picks the model`,"models.creditsPickHint":`Billed in credits – no API key of your own.`,"models.viaCredits":`{name} on engenty credits`,"models.viaCreditsHint":`No API key of your own, billed in credits.`,"models.viaCreditsNeedsAccount":`With an engenty account, billed in credits.`,"models.noteUsage":`credits by usage`,"models.model":`Model`,"models.modelCustom":`Another model …`,"models.textSimple":`Simple steps`,"models.textDemanding":`Demanding steps`,"models.perClass":`Adjust per class`,"models.manageKey":`{name} API key`,"models.key":`API key`,"models.keyFor":`{name} API key`,"models.keyGet":`Get a key from {name}`,"models.keySave":`Check and save`,"models.keyStored":`API key stored`,"models.keyNone":`No API key`,"models.keyCheck":`Check`,"models.keyReplace":`Replace`,"models.keyRemove":`Remove`,"models.keyOk":`The key works.`,"models.keyBad":`The key was not accepted.`,"models.keyWhereLocal":`The key stays on this device, never in the database.`,"models.keyWhereCloud":`The key is kept encrypted for the team. Nobody sees it again.`,"models.keyFallback":`Until the key is there, credits step in.`,"models.uses":`Used for`,"models.useFor":`Use`,"models.inUse":`in use`,"models.try":`Try it`,"models.try.text":`Test`,"models.try.image":`Make a test image`,"models.try.video":`Make a test clip`,"models.try.speech":`Hear a sample`,"models.try.listening":`Test listening`,"models.tryCost":`Costs like a real call.`,"models.tryCostVideo":`A 4-second clip – costs like a real one.`,"models.tryWait":`Generating …`,"models.tryWaitVideo":`A clip takes a minute or two …`,"models.tryOk":`In {s} s with {model}`,"models.tryHeard":`Heard: “{text}”`,"models.tryHeardNothing":`Nothing heard – the way is open.`,"models.tryFailed":`That did not work: {error}`,"models.creditsName":`engenty credits`,"models.creditsTeam":`Team credits`,"models.creditsLocalLead":`Step in where no subscription and no own API key is set up.`,"models.creditsCloudHint":`Everything without an own API key runs on the credits. Own keys come first and cost no credits.`,"models.creditsConnectTitle":`With an account`,"models.creditsLocalHint":`With an engenty account, credits step in where nothing of your own is set up – for videos without an own API key, say.`,"models.creditsConnect":`Connect an account`,"models.creditsFallback":`Credits step in`,"models.creditsFallbackOn":`What has no subscription and no own API key runs on the credits.`,"models.creditsFallbackOff":`Off: what has no subscription and no own API key does not run.`,"models.creditsOn":`Runs on credits`,"models.creditsNone":`Nothing runs on credits right now.`,"models.creditsTopUp":`Top up`,"models.creditsPicks":`engenty picks the model and bills in credits.`,"models.creditsModel":`Right now: {model}.`,"models.clientSignIn":`Sign-in`,"models.clientImages":`{name} makes images with your {sub} – no API key of your own.`,"models.clientNotChosen":`Text does not run on {name} right now.`,"models.ollamaHint":`Where Ollama runs and the model it serves.`,"models.readOnly":`Only the team's admins change its models.`,"models.viewAs":`Preview as`,"models.view.auto":`as it is`,"models.view.local":`local`,"models.view.linked":`local + account`,"models.view.cloud":`cloud studio`,"setup.title":`Setup`,"setup.sub":`Engenty can use your existing accounts on your computer.`,"setup.source":`Choose your Engine`,"setup.local":`Runs locally on this device.`,"setup.stage.connect":`Connect`,"setup.stage.test":`Test`,"setup.stage.done":`Done`,"setup.h.install":`Install {name}`,"setup.h.signIn":`Sign in to {name}`,"setup.h.keys":`Enter a key`,"setup.h.test":`One short test`,"setup.h.done":`Connected.`,"setup.ready":`All set.`,"setup.noHarness":`No AI client installed yet. Pick one — it installs right here — or enter your own keys.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic or Ollama.`,"setup.recommended":`Recommended`,"setup.done":`Open the studio`,"setup.untilWorks":`The studio opens once the test works.`,"cloud.onPublish":`When you publish the wizard, the version also goes to your account's cloud and runs there behind a link of its own.`,"cloud.notSent":`This version is not in the cloud yet.`,"cloud.send":`Send now`,"cloud.resend":`Send again`,"cloud.again":`It is tried again at {when}.`,"cloud.sent":`Version {v} · sent {when}`,"cloud.notRunnable":`Version {v} does not run in the cloud.`,"cloud.keepsRunning":`Version {v} keeps running there.`,"cloud.nothingRuns":`So nothing runs there yet.`,"cloud.notes":`What runs differently in the cloud:`,"cloud.check":`What the cloud would lack for the wizard as it is now:`,"cloud.checkBlocking":`As it is now, the wizard would not run in the cloud:`,"cloud.documents":`The space's documents stay on this device. In the cloud the steps work without them.`,"cloud.stepName":`“{title}”`,"cloud.problem.sandbox":`The server has no machine for code. There it works without one.`,"cloud.problem.mcp":`The space's MCP servers are not on the server: {detail}.`,"cloud.problem.model":`The cloud has no model for this.`,"cloud.problem.connector":`The space lacks a connector in the cloud.`,"cloud.problem.invalid":`The server does not take the wizard like this.`,"cloud.spaceLimit":`Your account's cloud already holds the space of another install:`,"cloud.replace":`Replace that space`,"cloud.replaceConfirm":`Remove that space from the cloud? Its wizards and their links go from there. Then everything published here is sent.`,"cloud.noticeError":`Published here. This version did not arrive in the cloud — see below.`,"cloud.noticeNotRunnable":`Published here. This version does not run in the cloud — see below.`,"readonly.wizard":`This wizard comes from your local install and is changed there. What you publish there runs here.`,"readonly.project":`This space comes from your local install and is changed there.`,"readonly.server":`Nothing is built on this server. The wizards your local install publishes run here.`,"nav.wizards":`Wizards`,"nav.settings":`Settings`,"nav.project":`Space`,"account.title":`Account`,"account.hint":`What the app calls you and how to reach you.`,"account.initials":`Your initials in the menu at the top right: the first letters of your name.`,"account.name":`Name`,"account.nameHint":`It starts as this device's user name.`,"account.fromAccount":`Name and e-mail come from your account.`,"account.about":`About you`,"account.aboutHint":`Who you are and what you do.`,"account.email":`E-mail`,"account.phone":`Phone`,"account.connection":`engenty.ai`,"account.connectionHint":`Sign-in, credits and the cloud that runs your wizards for everyone.`,"account.profile":`Profile`,"account.local":`Local install`,"account.localText":`This app runs on your device and is not connected to an account. Wizards, the space and files stay here.`,"account.linked":`Connected`,"account.with":`With an account`,"account.withCredits":`Credits for the models where no AI client is installed. No API key needed.`,"account.withCloud":`What you publish also runs on engenty.ai, behind a public link, even when this device is off.`,"account.signIn":`Sign in`,"account.signInAgain":`Sign in again`,"account.new":`No account yet?`,"account.newHint":`A new account needs an invitation code. Enter it here and the sign-up page has it filled in.`,"account.code":`Invitation code`,"account.create":`Create account`,"account.credits":`Credits`,"account.topUp":`Top up`,"account.expires":`{n} credits valid until {date}`,"account.kind.start":`Starting credits`,"account.kind.monthly":`Monthly credits`,"account.kind.gift":`Gift`,"account.cloud":`What you publish here also runs on {host}.`,"account.look":`Appearance`,"account.lookHint":`Language and theme of the app in this browser.`,"nav.logout":`Sign out`,"nav.connected":`Connected to {host}`,"nav.expired":`Sign-in expired`,"nav.onlyHere":`Only on this computer`,"nav.local":`local`,"nav.language":`Language`,"nav.theme":`Theme`,"nav.credits":`{n} credits`,"footer.billing":`Credits`,"footer.usage":`Usage`,"footer.invoices":`Invoices`,"footer.account":`Account`,"about.version":`Version {v}`,"about.update.available":`Version {v} of engenty wizards is out.`,"about.update.install":`Update`,"about.update.installing":`Installing version {v} …`,"about.update.restarting":`Restarting with version {v} …`,"about.update.done":`Installed. Restart engenty wizards to use {v}.`,"about.update.failed":`The update failed. Logs: logs/update.log`,"about.update.notes":`What's new`,"about.changelog":`Changelog`,"about.changelogHint":`What changed from release to release.`,"about.changelogEmpty":`Nothing here yet.`,"about.unreleased":`Unreleased`,"about.breaking":`breaking`,"about.credits":`Open source`,"about.creditsHint":`engenty wizards and the open-source software it builds on.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Built with`,"about.creditsDeps":`Direct dependencies`,"about.creditsDepsHint":`What the parts of this app include themselves, with version and license — without their own dependencies.`,"about.creditsShared":`Used by more than one part`,"about.search":`Search …`,"about.noMatches":`No matches.`,"theme.dark":`Dark theme`,"theme.light":`Light theme`,"home.title":`Your wizards`,"home.new":`New wizard`,"home.import":`Import`,"import.failed":`The import did not work`,"home.empty":`No wizards in this space yet.`,"home.live":`Live`,"home.draft":`Draft`,"where.here":`Local`,"where.hereVersion":`Local · version {v}`,"where.hereHint":`Runs only on this computer, while the app is running.`,"where.liveHint":`Runs on {host}, for everyone with the link.`,"where.liveAt":`Live on {host} · version {v}`,"where.note":`1 note`,"where.notes":`{n} notes`,"where.sending":`Being sent`,"where.missing":`Not in the cloud`,"home.steps":`{n} steps`,"home.newProject":`New space`,"home.projectName":`Space name`,"home.projectLimit":`At most {n} spaces`,"team.title":`Team`,"team.hint":`Who is in the team and which plan it is on. Inviting and managing happens in the account.`,"team.plan":`Plan`,"team.planFree":`Free`,"team.seats":`{taken} of {limit} seats`,"team.seatsUnlimited":`Unlimited seats`,"team.members":`Members`,"team.invited":`invited`,"team.you":`you`,"team.manage":`Manage members`,"team.changePlan":`See plans`,"team.roles":`Owners and admins create and delete wizards and spaces; members edit the wizards there are.`,"team.memberNote":`You are a member: you edit wizards, admins create new ones and delete.`,"team.failed":`The team could not be loaded.`,"team.role.owner":`Owner`,"team.role.admin":`Admin`,"team.role.member":`Member`,"models.ownKeysPlan":`Your own API keys come with the Pro plan. Here the team's credits pay.`,"home.fromLocal":`From your local install — changed there.`,"home.syncedAt":`Last arrived: {when}.`,"home.local.title":`The wizards from your local install run here`,"home.local.text":`You build on your own computer. What you publish there runs here — for everyone, behind a link.`,"home.local.install":`Install engenty wizards on your computer:`,"home.local.signIn":`Sign in there with this account, under Settings → Account.`,"home.local.publish":`Publish a wizard. It then shows up here.`,"new.title":`What should your wizard do?`,"new.placeholder":`e.g. Customers enter their product and audience, the wizard researches competitors and writes a positioning briefing as a PDF.`,"new.build":`Build wizard`,"new.orStarter":`Or start from a template`,"new.import":`Import a wizard package`,"new.hint":`You can change everything afterwards in the conversation.`,"editor.resize":`Resize — double-click resets`,"editor.resizeSheet":`Resize — tap folds and unfolds`,"editor.export":`Export as a package (.wizard)`,"addStep.title":`What should happen here?`,"addStep.placeholder":`For example: a map of all the objects found, with the price as colour`,"addStep.kind":`Kind of step`,"addStep.auto":`AI picks`,"addStep.empty":`Describe what the step should do first.`,"addStep.busy":`The assistant is still working on the last message. Try again in a moment.`,"addStep.emptyStep":`Insert empty`,"addStep.cancel":`Cancel`,"addStep.create":`Create`,"addStep.building":`Building the new step …`,"addStep.showChat":`See it in the conversation`,"addStep.add":`Add step`,"surface.preview":`Preview`,"surface.code":`Code`,"surface.sampleNote":`With sample data – a run shows its own.`,"surface.sampleText":`Sample text`,"surface.sampleBrand":`Your company`,"addStep.when":`When?`,"addStep.always":`Always`,"addStep.onlyIf":`Only if …`,"addStep.aiDecides":`AI decides …`,"addStep.ifPlaceholder":`For example: revenue below 100`,"addStep.askPlaceholder":`For example: the person wants a refund`,"addStep.whenEmpty":`Say when the step should come.`,"addStep.messageIf":`Only if: {text} – otherwise the run goes on after “{from}” as before.`,"addStep.messageAsk":`AI decides: {text} – otherwise the run goes on after “{from}” as before.`,"addStep.here":`Add a step here`,"addStep.between":`Between “{before}” and “{after}”`,"addStep.after":`After “{title}”`,"addStep.first":`As the first step, before “{title}”`,"addStep.message":`New step · {place}`,"addStep.messageAs":`New step ({kind}) · {place}`,"widget.missing":`The widget isn't built yet.`,"widget.what":`What should the widget show? (optional)`,"widget.build":`Let the assistant build it`,"widget.upload":`Upload your own HTML`,"widget.buildMessage":`Please build the widget “{title}”. {what}`,"editor.chat":`Conversation`,"editor.dropToAttach":`Drop to attach to your message`,"editor.memory":`Memory`,"memory.explain":`What the wizard knows across all its runs: notes that AI steps with the “pages” tool read and add to, and the tables of its shared lists. The same data is under Data in your space.`,"memory.unused":`No step uses the memory yet. Ask the assistant to have an AI step remember something.`,"memory.none":`Nothing remembered yet.`,"memory.add":`Note`,"memory.newNote":`Note`,"memory.back":`Memory`,"memory.testCopy":`Test runs read the memory but write into a copy of their own, which goes with the run.`,"editor.step":`Steps`,"editor.runs":`Runs`,"editor.reviewEditable":`editable`,"editor.reviewRedo":`can be redone`,"editor.otherwise":`otherwise`,"editor.next.title":`Next step`,"editor.next.ways":`Next step · {count} ways`,"editor.next.open":`Open step`,"editor.next.then":`Then`,"editor.next.fold":`Fold`,"editor.next.unfold":`Show in brief`,"editor.branch.ai":`AI`,"editor.branch.addWhen":`Condition`,"editor.branch.when":`Go on when`,"editor.branch.pick":`Pick …`,"editor.branch.and":`and`,"editor.branch.statement":`Statement`,"editor.branch.none":`None clearly holds`,"editor.branch.how":`Decided by a decision model (Jev) where there is a way to one, otherwise by the classifier class's language model. If the two most probable answers are less than 10 points apart, "none" holds.`,"editor.branch.lastRun":`In the last test run decided by {source}.`,"editor.branch.bySystemOne":`a decision model`,"editor.branch.byLlm":`the language model`,"editor.branch.notYet":`A test run shows here how the AI decided.`,"editor.branch.end":`End`,"editor.branch.max":`At most this often (otherwise 10)`,"editor.branch.remove":`Remove branch`,"editor.branch.addAsk":`AI decides`,"editor.branch.newAsk":`The person wants …`,"editor.whenFilled":`{field} filled in`,"editor.whenEmpty":`{field} empty`,"editor.whenContains":`{field} contains {value}`,"editor.whenAsk":`decides: {text}`,"editor.surfaceJson":`View (JSON)`,"editor.fieldAsk":`Or: show when the AI finds this true …`,"editor.atMost":`at most {count}×`,"editor.shownWhen":`Show only when`,"editor.shownAlways":`Always show`,"editor.conditionValue":`Value`,"editor.optionsFrom":`Choices from earlier data`,"editor.optionsFixed":`Fixed choices`,"editor.op.equals":`is`,"editor.op.notEquals":`is not`,"editor.op.in":`is one of`,"editor.op.notEmpty":`is filled in`,"editor.op.empty":`is empty`,"editor.op.gt":`greater than`,"editor.op.lt":`less than`,"editor.op.contains":`contains`,"editor.conditionsMore":`and {count} more conditions`,"tool.web_search":`Web search`,"tool.web_fetch":`Read web pages`,"tool.browser":`Browser`,"tool.sandbox":`Code & shell`,"tool.image":`Images`,"tool.http":`API`,"tool.pages":`Pages`,"editor.test":`Test`,"editor.share":`Share`,"editor.publish":`Publish`,"editor.published":`Live · version {v}`,"editor.unpublishedChanges":`Unpublished changes`,"editor.notPublished":`Not published yet`,"editor.composer":`Describe what should change …`,"editor.attach":`Attach files`,"editor.detach":`Remove`,"editor.attached":`Attached`,"editor.thread":`Thread`,"editor.voice":`Dictate`,"editor.voiceStop":`Stop dictating`,"editor.listening":`Listening …`,"editor.transcribing":`Writing it down …`,"editor.micDenied":`The microphone is not allowed for this page.`,"editor.building":`Building the flow …`,"editor.files":`Files`,"files.explain":`What your wizard needs on every run: widget code, libraries, map outlines, price lists. The assistant creates them in the chat – you can upload your own too.`,"files.upload":`Upload`,"files.drop":`Drop to upload`,"files.count":`{n} files · {size}`,"files.empty":`No files yet. Drop files here or ask the assistant to build a widget.`,"files.download":`Download`,"files.delete":`Delete`,"files.confirmDelete":`Delete “{path}”?`,"files.none":`This wizard has no files.`,"editor.thinking":`Thinking …`,"editor.chatBroken":`The connection dropped. What was already built is saved – please send your message again.`,"editor.issues":`Before you test or share, the wizard needs a few fixes:`,"editor.fixWithChat":`Let the assistant fix it`,"editor.models.blocking":`The wizard can't start like this. Models are missing:`,"editor.models.optional":`These steps won't run like this. Choose a path without them when testing, or set up the models:`,"editor.models.settings":`Set up models`,"editor.prevStep":`Previous step`,"editor.nextStep":`Next step`,"editor.deleteStep":`Delete step`,"editor.holdToDelete":`Hold to delete`,"editor.deleting":`Delete`,"editor.moveUp":`Move up`,"editor.moveDown":`Move down`,"editor.noRuns":`No runs yet.`,"editor.restart":`Restart`,"editor.close":`Close`,"runDrawer.expand":`Fill the window`,"runDrawer.shrink":`Back to the side`,"editor.chatHello":`Tell me what your wizard should do. I'll build the flow and you'll see it as a diagram on the left.`,"shareRun.button":`Share`,"shareRun.title":`Share result`,"shareRun.email":`Email`,"shareRun.more":`More …`,"shareRun.until":`The link works until {date}.`,"shareRun.kept":`The link works until you withdraw it.`,"shareRun.withdraw":`Withdraw link`,"sharePage.gone":`This link has expired or was withdrawn.`,"sharePage.own":`Try it yourself`,"sharePage.until":`Shared · available until {date}`,"sharePage.shared":`Shared on {date}`,"share.title":`Share wizard`,"share.link":`Link`,"share.copy":`Copy`,"share.copied":`Copied`,"share.enabled":`Link is active`,"share.limit":`Runs per day`,"share.rotate":`Create a new link`,"share.rotateHint":`The old link stops working.`,"share.publishFirst":`Publish the wizard so the link works.`,"share.open":`Open`,"share.unpublished":`Your changes are not published yet: the link runs the version before.`,"share.website":`Website`,"share.openHere":`Test on this computer`,"share.settings":`Settings`,"share.on":`on`,"share.off":`off`,"share.perDay":`{n} a day`,"share.rotateCloud":`The old link stops working, the one in the cloud too.`,"share.others":`Share with others`,"share.othersHint":`With an account the wizard also runs on engenty.ai: a link, a QR code and a tag for your website, for everyone, also while your computer is off.`,"share.details":`Details`,"teaser.website":`A website needs a link everyone can reach. With an account the wizard also runs on engenty.ai, and the tag for your page is here.`,"teaser.qr":`A QR code needs a link every phone can reach. With an account the wizard also runs on engenty.ai, and its QR code and the ID for the app are here.`,"teaser.link":`This link only works on this computer, while the app is running. With an account the wizard also runs on engenty.ai, with a link for everyone.`,"teaser.models":`No API key of your own: with an account, text, images and videos run on credits.`,"teaser.connect":`Connect an account`,"teaser.modelsLinked":`Or on your account's credits: under Models, choose "The account's credits".`,"share.qr":`QR code`,"share.qrHint":`Scan it with a phone's camera: the wizard opens, in the engenty wizards app when it is installed.`,"share.code":`ID for the app:`,"share.readOnly":`Whether the link is active and how many runs a day it allows is set in your local install.`,"embed.inline":`Inline`,"embed.modal":`Button + modal`,"embed.inlineHint":`Paste the tag into your page's HTML. The wizard appears in that place.`,"embed.modalHint":`Paste the tag into your page's HTML. A button appears in that place and opens the wizard in a window.`,"type.page":`Page`,"type.agent":`AI step`,"type.generate":`Generate`,"type.surface":`View`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Review`,"type.result":`Result`,"run.start":`Let's go`,"run.closed":`Not available here right now, it needs: {list}`,"slot.later":`Show later times`,"slot.none":`No times are free right now.`,"run.cls.text":`text`,"run.cls.image":`images`,"run.cls.video":`video`,"run.cls.speech":`speech output`,"run.cls.audio":`voice notes`,"run.next":`Continue`,"run.back":`Back`,"run.accept":`Looks good`,"run.regenerate":`New version`,"run.edit":`Edit`,"run.resume":`Continue your last run`,"run.regenerateNote":`What should change?`,"run.pickItem":`No. {n}`,"run.pickedItem":`No. {n} again`,"run.regeneratePicked":`Only no. {n} will be made again.`,"run.regenerateAll":`Applies to all. Tap a number to change single ones only.`,"check.progress":`{done} of {total} checked`,"check.onlyOpen":`Open only`,"check.noFile":`There is no file for this row.`,"check.noPreview":`This file has no preview – open it with the link above.`,"check.reopen":`Open again`,"market.search":`Search templates …`,"market.all":`All`,"market.industry":`Industry`,"market.format":`Result`,"market.capability":`Capability`,"market.unavailable":`not set up`,"market.without":`Works without: {list}`,"market.optional":`not set up, works without`,"market.optionalHint":`Runs here without {list}: answers that would need it are locked in the wizard. Set it up under Models.`,"market.missing":`Not set up here: {list}`,"market.plan":`Plan`,"market.pro":`Pro`,"market.proHint":`Needs plugins that come with Pro on engenty.ai`,"market.needsPro":`With Pro: needs {list}`,"market.needsProHint":`This template needs {list}. The plugins come with Pro and Team on engenty.ai.`,"market.missingHint":`This needs a model that isn't set up here: {list}. Set it up under Models.`,"market.none":`No template matches this selection.`,"market.notFound":`There is no such template (any more).`,"market.star":`Star`,"market.starred":`Starred`,"market.starHint":`Starred templates are kept on this computer, ready without a connection.`,"market.fromPlugin":`Comes with the plugin “{name}”`,"market.noneStarred":`You haven't starred a template yet.`,"market.offline":`No connection to the marketplace: you see the templates kept here.`,"market.more":`Show more`,"market.reset":`Reset selection`,"market.count":`{n} templates`,"market.countOf":`{n} of {all} templates`,"market.countOfShort":`{n} of {all}`,"market.resetShort":`Reset`,"market.minutes":`~ {n} min`,"market.credits":`~ {n} credits per run`,"market.needsUpdate":`Needs a newer app`,"market.needsUpdateHint":`This template uses features your app does not know yet. Update the app, then you can use it.`,"market.use":`Start with this template`,"market.steps":`How the wizard runs`,"market.duration":`Duration`,"market.durationHint":`from start to result, with {n} inputs from you`,"market.result":`Result`,"market.creditsRange":`~ {n} credits`,"market.creditsHint":`estimated per run, rarely more than twice that`,"market.needs":`Needs`,"market.cost":`Cost`,"new.forWebsite":`Small helpers for your website`,"run.feedbackPlaceholder":`Something not right? Write what should be different …`,"run.feedbackTarget":`What should change?`,"run.feedbackPick":`Pick above what should change.`,"ai.generated":`AI generated`,"ai.modified":`AI modified`,"ai.publish":`Made with AI: whoever publishes this has to label it as AI-generated (EU AI Act, Art. 50). The file already carries the marking in its metadata.`,"run.regenerateGo":`Recreate`,"run.retry":`Try again`,"run.again":`Start over`,"run.download":`Download`,"run.copy":`Copy text`,"run.failed":`Something went wrong.`,"run.unavailable":`This wizard is not available right now.`,"run.notFound":`This wizard does not exist (anymore).`,"run.madeWith":`Made with engenty wizards`,"run.working":`One moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Cancelled.`,"run.addRow":`Add row`,"run.upload":`Choose a file or drop it here`,"run.uploading":`Uploading …`,"run.required":`Required`,"run.net":`Net`,"run.vat":`VAT {r} %`,"run.total":`Total`,"settings.title":`Settings`,"settings.name":`Name`,"settings.mcp":`Connected systems (MCP)`,"settings.mcpHint":`AI steps can read from and write to these systems — only when you allow it on the step.`,"settings.addServer":`Connect a system`,"settings.serverName":`Name`,"settings.serverUrl":`MCP URL`,"settings.serverHeader":`Authorization header (optional)`,"settings.save":`Save`,"settings.saved":`Saved`,"settings.delete":`Delete space`,"settings.noProject":`Your space shows up here once your local install has published its first wizard.`,"settings.copy":`Copy`,"settings.copied":`Copied`,"settings.lastUsed":`last used {when}`,"settings.neverUsed":`never used`,"settings.revoke":`Delete key`,"mcp.appsDisconnect":`Remove`,"plugins.title":`Plugins`,"plugins.hint":`Plugins add pages, settings and tools for steps to this app. They run with the app's full rights: install only what you know.`,"plugins.hintManaged":`These plugins are switched on for your account.`,"plugins.reload":`Reload`,"plugins.rescan":`Look again`,"plugins.tools":`Tools for steps`,"plugins.serverFailed":`The server half did not load: {error}`,"plugins.studioFailed":`The studio half did not load: {error}`,"plugins.problems":`Not a plugin`,"plugins.crashed":`This part of a plugin crashed.`,"mcp.notReverse":`Not the same as “Connected systems (MCP)” under Connectors: there engenty calls other servers, here your client calls engenty.`,"integrate.nav":`Integrate`,"integrate.groupApps":`AI apps`,"integrate.groupShare":`Share`,"integrate.shareLink":`Share by link`,"integrate.shareSite":`Put on a website`,"integrate.soon":`soon`,"integrate.stateWorks":`works`,"integrate.stateConnected":`added`,"integrate.stateInstalled":`on this computer`,"integrate.kindMcp":`Tools in the chat: find, run and fill in wizards — and build them.`,"integrate.kindMcpShort":`tools in the chat`,"integrate.kindAppShort":`the wizard as a widget`,"integrate.kindAppNoShort":`this app does not show it`,"integrate.kindApp":`The wizard itself in the chat, page by page, as a widget.`,"integrate.kindAppNo":`This app does not show them — a run comes as text.`,"integrate.where":`Where does the app run?`,"integrate.here":`On this computer`,"integrate.hereHint":`One click, no key. The app starts engenty wizards itself.`,"integrate.hereManaged":`Only with engenty wizards on your computer.`,"integrate.address":`At the address`,"integrate.addressHint":`From anywhere the address can be reached — with a key.`,"integrate.connectTitle":`Add`,"integrate.connectHint":`Adds engenty wizards to the settings of {app}.`,"integrate.connect":`Add to {app}`,"integrate.connected":`Added to {app}`,"integrate.notInstalled":`{app} is not on this computer. You can add it anyway — it works once {app} is there.`,"integrate.file":`Put this into {file}:`,"integrate.vscode":`In VS Code: "MCP: Open User Configuration", then add:`,"integrate.chatgpt":`In ChatGPT: Settings → Apps & Connectors → Advanced → Developer mode, then "Create" with this address:`,"integrate.generic":`In the app's MCP settings, add a server at this address (Streamable HTTP):`,"integrate.oauthLocal":`This app connects from its maker's servers — it cannot reach this computer. Use "On this computer" or an app that runs here.`,"integrate.test":`Test`,"integrate.seen":`{app} checks in`,"integrate.restart":`Quit {app} completely and start it again — then it checks in here.`,"integrate.reload":`Reload the MCP servers in {app}, or restart it.`,"integrate.tool":`Called a tool`,"integrate.askHint":`In a new chat in {app}, write:`,"integrate.askTool":`Which wizards do I have in engenty?`,"integrate.widget":`Showed the wizard as a widget`,"integrate.widgetHint":`Start a published wizard:`,"integrate.askWidget":`Start one of my engenty wizards.`,"integrate.works":`{app} works with your wizards.`,"mcp.notHere":`Not possible with this server`,"mcp.needsPublic":`claude.ai connects from Anthropic's servers. That only works when this server is reachable publicly over HTTPS.`,"mcp.keyTitle":`Create a key`,"mcp.keyHint":`The key signs your client in. It is shown once and goes straight into the command in the next step.`,"mcp.keyCreate":`Create a key for {client}`,"mcp.keyReady":`Key created — it is already in the command below.`,"mcp.keyFirst":`Create the key first — then the finished command shows up here.`,"mcp.add":`Add the server`,"mcp.terminal":`Run in the terminal:`,"mcp.ccPlugin":`Optionally the plugin — it adds the /wizard command:`,"mcp.codexKey":`Run in the terminal — Codex reads the key from an environment variable:`,"mcp.claudeAi":`In claude.ai: Settings → Connectors → Add custom connector, and enter this address:`,"mcp.oauth":`No key needed: on first use your client signs in in the browser.`,"mcp.addressPublic":`Reachable publicly.`,"mcp.addressLocal":`Reachable on this computer only, and only while engenty wizards runs.`,"mcp.keys":`Keys`,"mcp.keysHint":`Each key signs one client in and has every right — treat it like a password. Delete it and that client is signed out.`,"editor.viaClient":`Via {client}`,"editor.changedVia":`Changed via {client}`,"editor.merged":`Merged with changes from elsewhere`,"run.uploadMore":`Another file`,"run.camera":`Camera`,"camera.title":`Take a picture`,"camera.hint":`Hold it flat and well lit.`,"camera.taken":`{n} taken`,"camera.shoot":`Capture`,"camera.done":`Done`,"camera.denied":`The camera is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or take the photo with your camera app.`,"connect.go":`Connect`,"connect.connected":`Connected through {name}`,"connect.disconnect":`Disconnect`,"connect.none":`No provider is set up for connecting on this server yet.`,"connect.openLink":`Click here to open the sign-in in a new tab`,"list.empty":`No entries yet.`,"list.delete":`Delete row`,"ask.typeInto":`Type into the page …`,"ask.hide":`hidden`,"ask.up":`Scroll up`,"ask.down":`Scroll down`,"ask.pictureHint":`This is the page the wizard has open. You can also click and type right in the picture.`,"ask.remember":`Remember this sign-in for next time`,"ask.private":`What you enter goes straight into the page. The AI never sees it. Remembered sign-ins are stored encrypted.`,"ask.skip":`Skip`,"ask.done":`I am signed in`,"ask.signIn":`Sign in`,"ask.wants":`The wizard wants to run this in {service}:`,"ask.allowRest":`Allow for the rest of this run`,"ask.allow":`Allow`,"ask.deny":`Don't allow`,"store.open":`What this wizard remembers`,"store.title":`Kept for you`,"store.explain":`This wizard keeps lists, files and connected accounts for your next run. Only you see them.`,"store.empty":`Nothing kept yet.`,"store.rows":`{n} entries`,"store.signIns":`Remembered sign-ins in the browser`,"store.files":`{n} files · {size}`,"store.delete":`Delete everything`,"store.confirmDelete":`Really delete everything`,"common.close":`Close`,"composer.send":`Send`,"dictation.settings":`Microphone and recording`,"dictation.microphone":`Microphone`,"dictation.default":`System default`,"dictation.mic":`Microphone {n}`,"dictation.showMics":`Show microphone names …`,"dictation.hold":`Hold to record`,"dictation.holdToTalk":`Hold to talk`,"date.pick":`Pick a date`,"time.pick":`Pick a time`,"time.hour":`Hour`,"time.minute":`Minute`,"date.pickRange":`Pick a day or a period`,"date.pickStart":`Pick the first day`,"date.pickEnd":`Pick the last day – or the same one for one day`,"date.today":`Today`,"date.clear":`Clear`,"date.prev":`Previous month`,"date.next":`Next month`,"connectors.title":`Connectors`,"connectors.hint":`Services a wizard can work in for the person — they connect their own account during a run. The main ones are built in; any other you find in the integrations.sh registry and import from its OpenAPI spec or its MCP server.`,"connectors.imported":`From the registry`,"connectors.noneImported":`No connector from the registry is imported here.`,"connectors.notSetUp":`not set up`,"connectors.setup":`The server still needs:`,"connectors.search":`Find a service, e.g. Notion, Stripe, GitHub`,"connectors.find":`Search`,"connectors.none":`Nothing found.`,"connectors.import":`Import`,"connectors.exists":`Already imported.`,"connectors.ownClient":`Own OAuth client`,"connectors.refresh":`Reload actions`,"connectors.remove":`Remove`,"connectors.actions":`{n} actions, {r} read-only`,"connectors.pending":`Actions appear once an account is connected`,"connectors.needsClient":`This service needs an OAuth client (id and secret). Remove it and import again with “Own OAuth client”.`,"connectors.authNone":`no sign-in`,"connectors.authOauth":`OAuth sign-in`,"connectors.authKey":`API key`,"connectors.group.read":`reads`,"connectors.group.write":`changes`,"connectors.group.destructive":`deletes`,"run.uploadTouch":`Choose a file`,"run.maxFiles":`At most {n} fit here – I left out the rest.`,"run.filesMin":`{n} of at least {min}`,"run.filesOf":`{n} of at most {max}`,"run.moveFile":`Move no. {n}`,"run.moveFileHint":`Drag to change the order`,"run.removeFile":`Remove`,"run.awake":`The screen stays on while the wizard works.`,"run.openFull":`Open full size`,"run.yes":`Yes`,"run.no":`No`,"run.share":`Share`,"run.shareNow":`Share now`,"run.shareFile":`Share as a file or open in an app`,"camera.asking":`Your browser is about to ask for the camera. The picture stays in this wizard.`,"camera.missing":`No camera was found on this device. Upload a photo instead.`,"camera.busy":`Another app is using the camera. Close it and try again.`,"camera.native":`Open the camera app`,"camera.pick":`Choose a photo`,"camera.torch":`Light`,"camera.flip":`Switch camera`,"camera.photo":`Photo`,"camera.video":`Video`,"camera.record":`Start recording`,"camera.stop":`Stop recording`,"camera.recording":`Recording — tap to stop.`,"camera.clipHint":`A short clip, {s} seconds at most.`,"camera.hintMany":`Capture page after page, then “Done”.`,"scan.button":`Scan`,"scan.title":`Scan a code`,"scan.asking":`Your browser is about to ask for the camera — it only reads the code.`,"scan.hint":`Hold the QR code or barcode inside the frame.`,"scan.hintQr":`Hold the QR code inside the frame. This device does not read barcodes here.`,"scan.miss":`No code was found in the photo. Try closer and sharper.`,"scan.fromPhoto":`Choose a photo of the code`,"scan.typeInstead":`Type it instead`,"location.use":`Use my location`,"location.locating":`Finding your location …`,"location.refining":`getting more exact …`,"location.accuracy":`exact to about {m} m`,"location.map":`Map`,"location.remove":`Remove location`,"location.why":`Your browser asks for your location. It is only used for this wizard. You can also just type the address.`,"location.denied":`Location is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or type the address below.`,"location.unavailable":`Your device could not find its location right now. Try again outdoors or type the address.`,"location.timeout":`That took too long. Try again or type the address.`,"location.manual":`Type an address or place`,"location.label":`Address or description of the place`,"voice.start":`Record a voice note`,"voice.stop":`Stop`,"voice.recording":`Recording …`,"voice.left":`{s} s left`,"voice.again":`Record again`,"voice.remove":`Delete`,"voice.pick":`Choose an audio file`,"voice.why":`Your browser asks for the microphone. The recording is turned into text afterwards.`,"voice.denied":`The microphone is not allowed for this page. Allow it in your browser's site settings — or record the note with your voice memo app and choose the file.`,"voice.noRecorder":`This browser cannot record here. Record the note with your voice memo app and choose the file.`,"sign.open":`Sign here`,"sign.hint":`Sign with your finger`,"sign.pad":`Signature pad`,"sign.clear":`Clear`,"sign.accept":`Use it`,"sign.again":`Sign again`,"sign.remove":`Remove signature`,"notify.ask":`Tell me when it is done`,"notify.on":`You will be told`,"notify.why":`With a sound, a buzz or a notification. Your browser asks once for permission.`,"notify.onHint":`You can switch apps — a notification brings you back.`,"notify.quiet":`With a sound and a buzz while this page is open.`,"notify.blocked":`Notifications are blocked for this page — you get a sound and a buzz while it is open. You can allow them in your browser's site settings.`,"notify.done":`Your result is ready.`,"notify.next":`It goes on — have a look.`,"notify.needsYou":`The wizard needs you for a moment.`,"install.add":`Add to home screen`,"install.ios":`Tap “Share” below, then “Add to Home Screen”.`,"install.bookmark":`Bookmark this wizard`,"install.bookmark.mac":`Press ⌘ D to keep this wizard in your bookmarks.`,"install.bookmark.pc":`Press Ctrl + D to keep this wizard in your bookmarks.`,"install.app":`Open in the app`,"install.app.offer":`Install the studio as an app: its own window, its own icon in the Dock or taskbar.`,"install.app.browser":`In Chrome or Edge the studio installs as an app: its own window, its own icon.`,"install.app.action":`Install as app`,"install.app.close":`Close`,"common.offline":`No connection. Check your network and try again.`,"common.retry":`Try again`,"common.cancel":`Cancel`,"common.loading":`Loading …`,"common.error":`Error`,"data.hint":`Tables and pages the space and its wizards keep.`,"data.all":`All data`,"data.own":`General`,"data.table":`Table`,"data.page":`Page`,"data.newTable":`New table`,"data.newPage":`New page`,"data.title":`Title`,"data.owner":`Belongs to`,"data.create":`Create`,"data.empty":`No tables or pages yet. Create one – soon your wizards will write here too.`,"data.rows":`{n} rows`,"data.addRow":`Row`,"data.noRows":`No rows yet.`,"data.deleteRow":`Delete row`,"data.deleteTable":`Delete table`,"data.deletePage":`Delete page`,"data.confirmDelete":`Delete “{title}”?`,"data.newColumn":`New column`,"data.columnName":`Name`,"data.columnType":`Type`,"data.required":`Must be filled in`,"data.deleteColumn":`Delete column`,"data.removeOption":`Remove`,"data.fromList":`A list of the wizard: every run writes into it. The columns come from the wizard.`,"data.badCell":`This value does not fit “{column}” and is not saved.`,"data.type.text":`Text`,"data.type.number":`Number`,"data.type.date":`Date`,"data.type.duration":`Duration`,"data.type.select":`Choice`,"data.type.boolean":`Yes / no`,"data.text.single":`One line`,"data.text.multiline":`Several lines`,"data.number.integer":`Whole number`,"data.number.decimal":`Decimal`,"data.number.percent":`Percent`,"data.number.currency":`Amount`,"data.currency":`Currency (e.g. EUR)`,"data.date.date":`Date`,"data.date.datetime":`Date and time`,"data.date.time":`Time`,"data.unit":`Entered in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`seconds`,"data.unit.minutes":`minutes`,"data.unit.hours":`hours`,"data.unit.days":`days`,"data.options":`Choices, one per line`,"data.multiple":`Several can be chosen`,"data.write":`Write`,"data.preview":`Preview`,"data.pageEmpty":`This page is still empty.`,"data.markdownHint":`Markdown: # heading, **bold**, - list`,"space.info":`Info & brand`,"space.knowledge":`Knowledge`,"space.data":`Data`,"space.results":`Results`,"space.resultsAll":`All results`,"space.resultsHint":`Runs of your wizards that reached their result, newest first.`,"space.resultsEmpty":`No results yet. A run shows up here once it is done.`,"space.resultCredits":`{n} credits`,"space.resultsSearch":`Search: wizard, answers, result …`,"space.resultsModeAll":`Live & test`,"space.resultsAnyTime":`Any time`,"space.resultsDay":`Last 24 hours`,"space.resultsDays":`Last {n} days`,"space.resultsNone":`No results for this search.`,"space.resultFiles":`{n} files`,"project.rename":`Rename space`,"project.saving":`Saving …`,"project.base":`Basics`,"project.baseHint":`Who is behind the wizards. Every AI step knows this.`,"project.title":`Title`,"project.titleHint":`Company, brand or undertaking — end users see it too.`,"project.about":`About`,"project.aboutHint":`What you do, for whom, and the tone you write in.`,"project.logos":`Logos`,"project.logosHint":`End users see the first logo. A description says what a variant is for.`,"project.logoAdd":`Logo`,"project.logoMain":`Main logo`,"project.logoMakeMain":`Make main logo`,"project.colors":`Colours`,"project.colorsHint":`The first colour is the accent of documents, dashboards and public pages.`,"project.colorAdd":`Colour`,"project.colorName":`e.g. Primary — buttons and headings`,"project.colorUse":`Describe how engenty should use this color.`,"project.colorAddTitle":`Add a colour`,"project.colorValue":`Colour value`,"project.colorUseLabel":`Use`,"project.add":`Add`,"project.colorAccent":`Accent`,"project.colorFirst":`Make accent`,"project.assets":`Assets`,"project.assetsHint":`Images, graphics, videos. AI steps place them in documents and choose by the description.`,"project.assetAdd":`Files`,"project.assetSearch":`Filter assets …`,"know.all":`All`,"know.title":`Knowledge`,"know.hint":`What your wizards' steps look things up in. Documents become pages and tables when they arrive; Kategorien keep the items apart.`,"know.empty":`Nothing here yet. Upload documents, add a page or give the assistant a website.`,"know.drop":`Drop documents here or`,"know.pick":`choose`,"know.page":`Page`,"know.table":`Table`,"know.faq":`FAQ`,"know.file":`File`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`New page`,"know.newTable":`New table`,"know.asFaq":`As an FAQ: a question and its answer per row`,"know.newCategory":`New Kategorie`,"know.search":`Try a search …`,"know.searchNone":`Nothing relevant found.`,"know.searchStats":`{candidates} candidates checked, {hits} relevant`,"know.searchUnchecked":`{hits} hits, unchecked`,"know.unchecked":`Without a classifier hits stay unchecked. It needs an AI Gateway or TypeSafe key, or an account.`,"know.keywordsOnly":`Without an embedding model the search finds words, not meaning.`,"know.clear":`Reset`,"know.sub":`{n} sub-pages`,"know.rows":`{n} rows`,"know.review":`Check`,"know.reviewed":`Checked`,"know.from":`From {label}`,"know.kept":`Changed by hand: {label} no longer writes it.`,"know.original":`Original`,"know.reading":`Reading …`,"know.subPages":`Sub-pages`,"know.addSub":`Sub-page`,"know.type.choice":`Choice`,"know.type.date":`Date`,"know.type.number":`Number`,"know.type.text":`Text`,"know.type.boolean":`Yes / no`,"know.name":`Name`,"know.type":`Type`,"know.unit":`Unit`,"know.unitHint":`e.g. h, €, kg`,"know.multiple":`Several values per item`,"know.ordered":`The values are ranked (low → high)`,"know.values":`Values`,"know.valuesHint":`One per line. More come with the items.`,"know.hintField":`Where the values come from`,"know.hintFieldHint":`Short, e.g. header, file name, the website's filter.`,"know.create":`Create`,"know.proposed":`Proposed`,"know.proposedHint":`It is filled once it is taken.`,"know.accept":`Take`,"know.dismiss":`Dismiss`,"know.alike":`“{a}” and “{b}” look like one value.`,"know.merge":`Merge`,"know.items":`{n} items`,"know.item":`1 item`,"know.row":`1 row`,"know.oneSub":`1 sub-page`,"know.addValue":`Add a value`,"know.range":`{min} to {max}`,"know.summary":`Overview`,"know.summaryHint":`A model sums up the items of this value. The search finds the overview like a page.`,"know.summaryWrite":`Write the overview`,"know.summaryAgain":`Write again`,"know.summaryEmpty":`No overview yet.`,"know.toc":`Contents`,"know.tocRows":`{n} rows in {table}`,"know.deleteCategory":`Delete Kategorie`,"know.confirmCategory":`Delete “{name}”? The items stay, only the Kategorie goes.`,"know.deleteValue":`Delete value`,"know.yes":`Yes`,"know.no":`No`,"know.minimum":`from`,"know.maximum":`to`,"know.contains":`contains`,"know.by.person":`set by hand`,"know.by.origin":`from the source`,"know.by.model":`read by a model`,"know.remove":`Remove`,"know.unset":`Not set`,"know.deleteFile":`Delete file`,"project.documents":`Documents`,"project.documentsHint":`PDFs, lists, Excel, Word, text. They are read and put into an index every AI step searches.`,"project.documentAdd":`Documents`,"project.drop":`Drop here or`,"project.staysLocal":`Stays in your local install and is not sent here.`,"project.description":`Add a description …`,"project.describing":`Looking at it …`,"project.reading":`Reading …`,"project.indexed":`In the index`,"project.indexedKeywords":`In the index (keywords)`,"project.notIndexed":`No text found`,"project.reindex":`Read again`,"project.pages":`{n} pages`,"project.keywordsOnly":`The index searches by keywords right now. With an AI Gateway or OpenAI key it also searches by meaning.`,"project.preview":`Preview`,"project.viewList":`Show as a list`,"project.viewCards":`Show as cards`,"project.original":`Original`,"project.readText":`Text as read`,"project.openOriginal":`Open the original`,"project.noText":`No text yet: the document is still being read, or could not be read.`,"project.textCut":`The preview shows the start ({shown} of {total} characters).`,"project.searchTest":`Search the index …`,"project.searchNone":`Nothing found.`,"project.remove":`Remove`,"project.removeConfirm":`Remove “{name}”?`,"project.facts":`Facts`,"project.factsHint":`What wizards should know: address, VAT id, opening hours — anything that fits.`,"project.factLabel":`Label`,"project.factValue":`Value`,"project.factAdd":`Entry`,"project.factType":`Type`,"project.factAuto":`Automatic`,"project.type.text":`Text`,"project.type.longtext":`Long text`,"project.type.number":`Number`,"project.type.date":`Date`,"project.type.url":`Link`,"project.type.email":`Email`,"project.type.phone":`Phone`,"project.type.boolean":`Yes / No`,"project.yes":`Yes`,"project.no":`No`,"project.assistant":`Assistant`,"project.assistantTitle":`Tell me about yourselves`,"project.assistantHello":`Name your website or give me files. I fill in what I find: title, description, logo, colours and facts.`,"project.assistantComposer":`e.g. “Read our website example.com” …`,"project.assistantTitleKnowledge":`What should your wizards know?`,"project.assistantHelloKnowledge":`Give me documents or tell me where the knowledge is. I read it in – below you see what goes in.`,"project.assistantComposerKnowledge":`Attach documents or say where the knowledge is …`,"project.assistantChanged":`Space updated`,"flowApp.loading":`The wizard is on its way …`,"flowApp.draft":`Draft`,"flowApp.published":`Published`,"flowApp.issues":`{n} issues in the draft`,"flowApp.flow":`Flow`,"flowApp.notPublished":`Publish it in the studio to run it here.`,"flowApp.runPage":`Continue in the browser`,"flowApp.inBrowser":`Only in the browser: {fields}`,"flowApp.done":`Done`,"flowApp.credits":`{n} credits`,"flowApp.ask":`The wizard asks`,"flowApp.allow":`Allow`,"flowApp.skip":`Skip`,"flowApp.signIn":`A sign-in at {site} — only in the browser.`,"flowApp.fullscreen":`Larger`,"flowApp.inline":`Smaller`,"flowApp.failed":`That did not work: {error}`},Ux=`wizards.lang`;function Wx(){try{let e=localStorage.getItem(Ux);return e===`de`||e===`en`?e:null}catch{return null}}var Gx=Wx()??(typeof navigator<`u`&&!navigator.language.toLowerCase().startsWith(`de`)?`en`:`de`),Kx=Gx===`de`?Vx:Hx,qx=new Set;function Jx(e){if(e!==Gx){Gx=e,Kx=e===`de`?Vx:Hx,document.documentElement.lang=e;try{localStorage.setItem(Ux,e)}catch{}for(let e of qx)e()}}function Yx(e){return e.note&&Bx(e.note,Gx)||e.message}function Z(e,t){let n=Kx[e]??Vx[e]??e;for(let[e,r]of Object.entries(t??{}))n=n.replace(`{${e}}`,String(r));return n}typeof document<`u`&&(document.documentElement.lang=Gx),Bb();var Xx=`wizards.theme`,Zx=new Set,Qx=window.matchMedia(`(prefers-color-scheme: dark)`);function $x(){try{let e=localStorage.getItem(Xx);return e===`light`||e===`dark`?e:null}catch{return null}}var eS=0;function tS(){return eS>0?`dark`:$x()??(Qx.matches?`dark`:`light`)}function nS(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function rS(){let e=tS()===`dark`;document.documentElement.classList.toggle(`dark`,e),nS();for(let e of Zx)e()}Qx.addEventListener(`change`,rS),rS();function iS(){return(0,y.useSyncExternalStore)(e=>(Zx.add(e),()=>Zx.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var aS=e=>`oklch(from ${Lb[zb[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`,oS=``.replace(/\/+$/,``);`${oS}`;var sS=null;function cS(e){sS=e?{base:e.base.replace(/\/+$/,``),ticket:e.ticket}:null}function lS(e){return sS&&e.startsWith(`/api/`)?`${sS.base}${e}${e.includes(`?`)?`&`:`?`}rt=${encodeURIComponent(sS.ticket)}`:!oS||!e.startsWith(`/`)||e.startsWith(`//`)||e===oS||e.startsWith(`${oS}/`)?e:`${oS}${e}`}function uS(e){return`./${e.replace(/^\/+/,``)}`}var dS=class extends Error{status;body;constructor(e,t,n){super(e),this.status=t,this.body=n}};async function fS(e,t,n){let r=await fetch(lS(t),{method:e,credentials:`include`,headers:n!==void 0&&!(n instanceof FormData)?{"content-type":`application/json`}:void 0,body:n===void 0?void 0:n instanceof FormData?n:JSON.stringify(n)}).catch(()=>{throw new dS(Z(`common.offline`),0,null)}),i=await r.text(),a=i?pS(i):null;if(!r.ok)throw new dS(a?.error??r.statusText,r.status,a);return a}function pS(e){try{return JSON.parse(e)}catch{return{error:e}}}var mS={get:e=>fS(`GET`,e),post:(e,t)=>fS(`POST`,e,t??{}),put:(e,t)=>fS(`PUT`,e,t),patch:(e,t)=>fS(`PATCH`,e,t),del:e=>fS(`DELETE`,e),upload:(e,t)=>{let n=new FormData;return n.set(`file`,t),fS(`POST`,e,n)}};typeof navigator<`u`&&navigator.mediaDevices?.getUserMedia;var hS=`wizards.dictation`;(()=>{try{let e=JSON.parse(localStorage.getItem(hS)??`{}`);return{deviceId:String(e.deviceId??``),hold:e.hold===!0}}catch{return{deviceId:``,hold:!1}}})();function Q(...e){return e.filter(Boolean).join(` `)}var gS={primary:`bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]`,secondary:`bg-card text-ink border border-border hover:bg-paper-2`,ghost:`text-ink-2 hover:text-ink hover:bg-accent`,quiet:`bg-paper-2 text-ink hover:bg-paper-3`,danger:`text-rose hover:bg-rose-tint`},_S=(0,y.forwardRef)(function({variant:e=`primary`,size:t=`md`,busy:n,className:r,children:i,disabled:a,...o},s){return(0,X.jsxs)(`button`,{ref:s,type:`button`,disabled:a||n,className:Q(`inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50`,t===`sm`&&`h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4`,t===`md`&&`h-10 px-4 text-sm coarse:h-11`,t===`lg`&&`h-12 px-6 text-[0.9375rem]`,gS[e],r),...o,children:[n?(0,X.jsx)(OS,{className:`size-4`}):null,i]})});function vS({label:e,className:t,children:n,...r}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,className:Q(`inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11`,t),...r,children:n})}var yS=`rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60`;function bS(e){return/(^|\s)w-/.test(e??``)?null:`w-full`}var xS=(0,y.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`input`,{ref:n,className:Q(yS,bS(e),`h-11`,e),...t})});function SS(e){return(0,X.jsx)(`input`,{type:`color`,className:`swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1`,...e})}var CS=(0,y.forwardRef)(function({className:e,minRows:t=3,maxRows:n=14,onChange:r,...i},a){let o=(0,y.useRef)(null),s=()=>{let e=o.current;if(!e)return;let r=Number.parseFloat(getComputedStyle(e).lineHeight)||22;e.style.height=`auto`;let i=r*n+20;e.style.height=`${Math.min(Math.max(e.scrollHeight,r*t+20),i)}px`,e.style.overflowY=e.scrollHeight>i?`auto`:`hidden`};return(0,y.useLayoutEffect)(s),(0,X.jsx)(`textarea`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},className:Q(yS,bS(e),`resize-none py-2.5 leading-[1.5]`,e),onChange:e=>{s(),r?.(e)},...i})});function wS({value:e,onChange:t,options:n,className:r,placeholder:i}){return(0,X.jsxs)(`div`,{className:Q(`relative`,r),children:[(0,X.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:Q(yS,`h-11 w-full appearance-none pr-9`),children:[i===void 0?null:(0,X.jsx)(`option`,{value:``,children:i}),n.map(e=>(0,X.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,X.jsx)(`svg`,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3`,viewBox:`0 0 16 16`,fill:`none`,children:(0,X.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})]})}function TS({value:e,onChange:t,options:n,multi:r,disabled:i}){let a=new Set(Array.isArray(e)?e:e?[e]:[]);return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let o=a.has(e);return(0,X.jsx)(`button`,{type:`button`,"aria-pressed":o,disabled:i?.includes(e),onClick:()=>{if(r){let r=new Set(a);o?r.delete(e):r.add(e),t(n.filter(e=>r.has(e)))}else t(e)},className:Q(`h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11`,o?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`),children:e},e)})})}function ES({checked:e,onChange:t,label:n,disabled:r}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,onClick:()=>t(!e),className:Q(`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60`,e?`bg-primary`:`bg-paper-3`),children:(0,X.jsx)(`span`,{className:Q(`inline-block size-5 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-[22px]`:`translate-x-[2px]`)})})}function DS({children:e,hint:t,required:n}){return(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsxs)(`div`,{className:`font-medium text-[0.875rem] text-ink`,children:[e,n?(0,X.jsx)(`span`,{className:`ml-1 text-ember`,children:`*`}):null]}),t?(0,X.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t}):null]})}function OS({className:e}){return(0,X.jsxs)(`svg`,{className:Q(`size-5 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,X.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function kS({className:e,children:t,...n}){return(0,X.jsx)(`div`,{className:Q(`rounded-xl bg-card shadow-soft ring-1 ring-border-soft`,e),...n,children:t})}function AS({children:e,tone:t=`neutral`,icon:n,title:r}){return(0,X.jsxs)(`span`,{title:r,className:Q(`inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]`,t===`neutral`&&`bg-paper-2 text-ink-2`,t===`live`&&`bg-moss-tint text-moss`,t===`warn`&&`bg-amber-tint text-ink-2`,t===`ember`&&`bg-ember-tint text-ember-strong`),children:[n??(t===`live`?(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-moss`}):null),e]})}function jS({open:e,onClose:t,title:n,children:r,wide:i,bare:a}){let o=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=o.current;t&&(e&&!t.open?(t.showModal(),t.querySelector(`[data-autofocus]`)?.focus()):!e&&t.open&&t.close())},[e]),(0,X.jsx)(`dialog`,{ref:o,onClose:t,onClick:e=>{e.target===o.current&&t()},className:Q(`m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]`,a?`w-[calc(100%-48px)] overflow-visible bg-transparent max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none`:`max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay`,i===`page`?`sm:max-w-4xl`:i?`sm:max-w-2xl`:`sm:max-w-md`,!a&&(i===`page`?`max-w-4xl`:i?`max-w-2xl`:`max-w-md`)),children:e&&a?r:e?(0,X.jsxs)(`div`,{className:`p-5 sm:p-7`,children:[n?(0,X.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`min-w-0 font-display font-semibold text-xl`,children:n}),(0,X.jsx)(vS,{label:Z(`common.close`),onClick:t,className:`-mt-1.5 -mr-2`,children:(0,X.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,className:`size-4`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}):null,r]}):null})}function MS({text:e}){return e.split(/(https?:\/\/[^\s)]+)/).map((e,t)=>t%2?(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`font-medium text-ink underline underline-offset-2`,children:new URL(e).host},e):e)}function NS(e){let t=IS.get(e);if(t)return t;if(!LS){let e=document.createElement(`canvas`);e.width=1,e.height=1,LS=e.getContext(`2d`,{willReadFrequently:!0})}let n=[.5,.5,.5];if(LS){LS.clearRect(0,0,1,1),LS.fillStyle=`#808080`,LS.fillStyle=e,LS.fillRect(0,0,1,1);let[t,r,i]=LS.getImageData(0,0,1,1).data;n=[t/255,r/255,i/255]}return IS.set(e,n),n}function PS(e,t){let n=RS.get(e);return n||(n=document.createElement(`span`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,e.appendChild(n),RS.set(e,n)),n.style.color=``,n.style.color=t,NS(getComputedStyle(n).color||`#808080`)}function FS(e,t){let n=PS(e,Lb[zb[t]]),r=Math.max(...n),i=[Math.min(1,n[0]+n[0]/(r||1)*.45),Math.min(1,n[1]+n[1]/(r||1)*.45),Math.min(1,n[2]+n[2]/(r||1)*.45)];return{body:zS(n,[1,1,1],.12),deep:zS(n,[.03,.02,.06],.62),tip:zS(i,[1,1,1],.12)}}var IS,LS,RS,zS,BS=o((()=>{Bb(),IS=new Map,LS=null,RS=new WeakMap,zS=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]})),VS,HS=o((()=>{VS=`
114
+ - "app": Tool callable by the app from this server only`),csp:Ac().optional(),permissions:Ac().optional()}),V({mimeTypes:B(I()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),V({method:K(`ui/download-file`),params:V({contents:B(U([Vf,Hf])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),V({method:K(`ui/message`),params:V({role:K(`user`).describe(`Message role, currently only "user" is supported.`),content:B(Uf).describe(`Message content blocks (text, image, etc.).`)})}),V({method:K(`ui/notifications/sandbox-resource-ready`),params:V({html:I().describe(`HTML content to load into the inner iframe.`),sandbox:I().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:I_.optional().describe(`CSP configuration from resource metadata.`),permissions:L_.optional().describe(`Sandbox permissions from resource metadata.`)})});var X_=V({method:K(`ui/notifications/tool-result`),params:Qf.describe(`Standard MCP tool execution result.`)}),Z_=V({toolInfo:V({id:Sd.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Yf.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:A_.optional().describe(`Current color theme preference.`),styles:H_.optional().describe(`Style configuration for theming the app.`),displayMode:j_.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:B(j_).optional().describe(`Display modes the host supports.`),containerDimensions:U([V({height:L().describe(`Fixed container height in pixels.`)}),V({maxHeight:U([L(),Cc()]).optional().describe(`Maximum container height in pixels.`)})]).and(U([V({width:L().describe(`Fixed container width in pixels.`)}),V({maxWidth:U([L(),Cc()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
115
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:I().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:I().optional().describe(`User's timezone in IANA format.`),userAgent:I().optional().describe(`Host application identifier.`),platform:U([K(`web`),K(`desktop`),K(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:V({touch:R().optional().describe(`Whether the device supports touch input.`),hover:R().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:V({top:L().describe(`Top safe area inset in pixels.`),right:L().describe(`Right safe area inset in pixels.`),bottom:L().describe(`Bottom safe area inset in pixels.`),left:L().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Q_=V({method:K(`ui/notifications/host-context-changed`),params:Z_.describe(`Partial context update containing only changed fields.`)});V({method:K(`ui/update-model-context`),params:V({content:B(Uf).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:W(I(),z().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),V({method:K(`ui/initialize`),params:V({appInfo:Fd.describe(`App identification (name and version).`),appCapabilities:q_.describe(`Features and capabilities this app provides.`),protocolVersion:I().describe(`Protocol version this app supports.`)})});var $_=V({protocolVersion:I().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:Fd.describe(`Host application identification and version.`),hostCapabilities:K_.describe(`Features and capabilities provided by the host.`),hostContext:Z_.describe(`Rich context about the host environment.`)}).passthrough(),ev={target:`draft-2020-12`};async function tv(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](ev);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function nv(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function rv(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var iv=class e extends Qg{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new C_;_methods=new w_;setRequestHandler=(...e)=>{let[t,...n]=E_(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=E_(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:R_,toolinputpartial:z_,toolresult:X_,toolcancelled:B_,hostcontextchanged:Q_};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&st({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=rv(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await nv(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await nv(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await tv(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await tv(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:U_.shape.params,result:W_},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},F_,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},kd,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},N_,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},P_,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},J_,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new k_(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:O_}},$_,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},av=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ov(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:av(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var sv=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},cv=e=>{let t=sv(e);return t.charAt(0).toUpperCase()+t.slice(1)},lv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),uv={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function dv(e){return e!=null}function fv(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??uv.width,a=e.size??e.height??uv.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?lv(...c):lv(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??uv[`stroke-width`])*Number(e.size??e.width??uv.width)/Number(t.size??t.width??uv.width):t.strokeWidth??uv[`stroke-width`];return[`svg`,{...Object.entries(uv).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&dv(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&dv(t.width)&&{[r(`width`)]:t.width},...`height`in t&&dv(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function pv(e,t={}){return fv(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var mv=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},hv=(0,y.createContext)({}),gv=()=>(0,y.useContext)(hv),_v=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=gv()??{},b=!!c||mv(d),[x,S,C=[]]=pv(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:lv(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function J(e,t=[],n=[]){let r=typeof e==`string`?ov(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(_v,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=cv(r.name)),i}var vv={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};vv.node;var yv=J(vv),bv={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};bv.node;var xv=J(bv),Sv={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Sv.node;var Cv=J(Sv),wv={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};wv.node;var Tv=J(wv),Ev={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ev.node;var Dv=J(Ev),Ov={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};Ov.node;var kv=J(Ov),Av={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Av.node;var jv=J(Av),Mv={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Mv.node;var Nv=J(Mv),Pv={name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]};Pv.node;var Fv=J(Pv),Iv={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Iv.node;var Lv=J(Iv),Rv={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Rv.node;var zv=J(Rv),Bv={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Bv.node;var Vv=J(Bv),Hv={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Hv.node;var Uv=J(Hv),Wv={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};Wv.node;var Gv=J(Wv),Kv={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};Kv.node;var qv=J(Kv),Jv={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Jv.node;var Yv=J(Jv),Xv={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};Xv.node;var Zv=J(Xv),Qv={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Qv.node;var $v=J(Qv),ey={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ey.node;var ty=J(ey),ny={name:`file-headphone`,size:24,node:[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]],aliases:[`file-audio`,`file-audio-2`]};ny.node;var ry=J(ny),iy={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};iy.node;var ay=J(iy),oy={name:`film`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]};oy.node;var sy=J(oy),cy={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};cy.node;var ly=J(cy),uy={name:`flashlight-off`,size:24,node:[[`path`,{d:`M11.652 6H18`,key:`voqkpr`}],[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6`,key:`dzyf92`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007`,key:`1hvcfn`}]]};uy.node;var dy=J(uy),fy={name:`flashlight`,size:24,node:[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]};fy.node;var py=J(fy),my={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};my.node;var hy=J(my),gy={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};gy.node;var _y=J(gy),vy={name:`image-up`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};vy.node;var yy=J(vy),by={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};by.node;var xy=J(by),Sy={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Sy.node;var Cy=J(Sy),wy={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};wy.node;var Ty=J(wy),Ey={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};Ey.node;var Dy=J(Ey),Oy={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Oy.node;var ky=J(Oy),Ay={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ay.node;var jy=J(Ay),My={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};My.node;var Ny=J(My),Py={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Py.node;var Fy=J(Py),Iy={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Iy.node;var Ly=J(Iy),Ry={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};Ry.node;var zy=J(Ry),By={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};By.node;var Vy=J(By),Hy={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Hy.node;var Uy=J(Hy),Wy={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Wy.node;var Gy=J(Wy),Ky={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Ky.node;var qy=J(Ky),Jy={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Jy.node;var Yy=J(Jy),Xy={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Xy.node;var Zy=J(Xy),Qy={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Qy.node;var $y=J(Qy),eb={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};eb.node;var tb=J(eb),nb={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};nb.node;var rb=J(nb),ib={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};ib.node;var ab=J(ib),ob={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};ob.node;var sb=J(ob),cb={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};cb.node;var lb=J(cb),ub={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};ub.node;var db=J(ub),fb={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};fb.node;var pb=J(fb),mb={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};mb.node;var hb=J(mb),gb={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};gb.node;var _b=J(gb),vb={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};vb.node;var yb=J(vb),bb={name:`switch-camera`,size:24,node:[[`path`,{d:`M11 19H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h5`,key:`mtk2lu`}],[`path`,{d:`M13 5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-5`,key:`120jsl`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m18 22-3-3 3-3`,key:`kgdoj7`}],[`path`,{d:`m6 2 3 3-3 3`,key:`1fnbkv`}]]};bb.node;var xb=J(bb),Sb={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Sb.node;var Cb=J(Sb),wb={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};wb.node;var Tb=J(wb),Eb={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Eb.node;var Db=J(Eb),Ob={name:`unplug`,size:24,node:[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]};Ob.node;var kb=J(Ob),Ab={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};Ab.node;var jb=J(Ab),Mb={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Mb.node;var Nb=J(Mb),Pb={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Pb.node;var Fb=J(Pb),Ib={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ib.node;var Lb=J(Ib),Rb,zb,Bb,Vb=o((()=>{Rb={cobalt:`var(--engenty-cobalt, oklch(60% 0.23 262))`,amber:`var(--engenty-amber, oklch(82% 0.17 78))`,moss:`var(--engenty-moss, oklch(72% 0.22 145))`,rose:`var(--engenty-rose, oklch(64% 0.25 18))`,ember:`var(--engenty-ember, oklch(70% 0.21 42))`,teal:`var(--engenty-teal, oklch(74% 0.16 192))`,violet:`var(--engenty-violet, oklch(60% 0.25 300))`,magenta:`var(--engenty-magenta, oklch(65% 0.28 345))`,citron:`var(--engenty-citron, oklch(89% 0.2 118))`,slate:`var(--engenty-slate, oklch(66% 0.13 235))`},zb=[`round`,`drop`,`dome`,`flame`,`oval`],[...zb],Bb={bean:`teal`,dome:`moss`,drop:`amber`,flame:`rose`,oval:`ember`,pebble:`slate`,round:`cobalt`,sprout:`citron`,tower:`violet`,wedge:`magenta`}}));function Hb(e){return Math.max(...e.blobs.map(e=>e.r*Math.min(e.rx??1,e.ry??1)))}function Ub(e){let t=new Float32Array(Kb*4);for(let n=0;n<Kb;n++){let r=e.blobs[n];if(!r){t[n*4]=1e4,t[n*4+1]=1e4,t[n*4+2]=0,t[n*4+3]=0;continue}t[n*4]=r.x,t[n*4+1]=r.y,t[n*4+2]=r.r*(r.rx??1),t[n*4+3]=r.r*(r.ry??1)}return t}function Wb(e){let t=new Float32Array(qb*4),n=new Float32Array(qb*4);return e.extras?.forEach((e,r)=>{let i=r*4;switch(n[i]=Jb[e.type],n[i+1]=e.alpha??1,e.type){case`ink-dot`:t.set([e.x,e.y,e.r,0],i);break;case`body-dot`:t.set([e.x,e.y,e.r,e.bob??0],i);break;case`arc`:t.set([e.cx,e.cy,e.r,e.half*Math.PI/180],i),n[i+2]=e.width,n[i+3]=+!!e.body;break;case`bar`:t.set([e.x,e.y,e.half,0],i),n[i+2]=e.width;break;case`wave`:t.set([e.x,e.y,e.len,e.amp],i),n[i+2]=e.width}}),{geometry:t,meta:n}}var Gb,Kb,qb,Jb,Yb=o((()=>{Gb={round:{blobs:[{x:60,y:61,r:36,rx:1,ry:1.06}],extras:[{type:`body-dot`,x:97,y:34,r:6,alpha:.5,bob:3},{type:`body-dot`,x:106,y:24,r:3.5,alpha:.35,bob:3.5}],falloff:2.2,fur:9,period:3.6,eye:{x:68,y:58,r:8},shadowRx:26},drop:{blobs:[{x:60,y:70,r:30,rx:1,ry:.95},{x:60,y:40,r:20,rx:.85,ry:1.15},{x:60,y:22,r:9,rx:.7,ry:1}],extras:[{type:`wave`,x:48,y:76,len:24,amp:2,width:2.6}],falloff:1.7,fur:8.5,period:4.4,eye:{x:60,y:56,r:8},shadowRx:24},dome:{blobs:[{x:60,y:72,r:32,rx:1.02,ry:.82},{x:60,y:46,r:28,rx:1,ry:1}],extras:[{type:`bar`,x:46,y:85,half:5,width:2.4,alpha:.5},{type:`bar`,x:60,y:87,half:5,width:2.4,alpha:.5},{type:`bar`,x:74,y:85,half:5,width:2.4,alpha:.5},{type:`body-dot`,x:60,y:6,r:3,bob:2.5}],falloff:1.7,fur:9,period:3,eye:{x:60,y:54,r:8.5},shadowRx:27},flame:{blobs:[{x:60,y:80,r:22,rx:1,ry:.95},{x:60,y:54,r:19,rx:.95,ry:1.1},{x:60,y:30,r:12,rx:.72,ry:1.25},{x:60,y:16,r:5,rx:.6,ry:1.1}],extras:[{type:`arc`,cx:60,cy:45,r:32,half:39,width:3,alpha:.55,body:!0},{type:`ink-dot`,x:60,y:82,r:2.6}],falloff:1.6,fur:7.5,period:2.6,eye:{x:60,y:62,r:8},shadowRx:22},oval:{blobs:[{x:60,y:64,r:40,rx:1.06,ry:.76}],extras:[{type:`arc`,cx:60,cy:223,r:172,half:10.7,width:2.2,alpha:.45},{type:`arc`,cx:60,cy:261,r:191,half:10.3,width:2.2,alpha:.45}],falloff:2.2,fur:10,period:4,eye:{x:66,y:58,r:8},shadowRx:32},bean:{blobs:[{x:46,y:76,r:24},{x:74,y:54,r:22}],extras:[{type:`body-dot`,x:32,y:94,r:4,alpha:.4}],falloff:1.7,fur:9,period:3.8,eye:{x:70,y:58,r:8},shadowRx:26},pebble:{blobs:[{x:56,y:76,r:32,rx:1.3,ry:.66},{x:86,y:74,r:18,rx:1,ry:.7}],extras:[{type:`ink-dot`,x:42,y:76,r:3,alpha:.32},{type:`ink-dot`,x:56,y:86,r:2.2,alpha:.32},{type:`ink-dot`,x:86,y:80,r:2.6,alpha:.32}],falloff:1.8,fur:9.5,period:4.6,eye:{x:68,y:72,r:7.5},shadowRx:34},sprout:{blobs:[{x:60,y:74,r:28},{x:48,y:34,r:8,rx:.75,ry:1.15},{x:72,y:32,r:7,rx:.75,ry:1.15}],falloff:1.7,fur:8.5,period:3.2,eye:{x:60,y:68,r:8.5},shadowRx:26},tower:{blobs:[{x:60,y:86,r:19},{x:60,y:60,r:17},{x:60,y:36,r:14}],extras:[{type:`arc`,cx:60,cy:154,r:80,half:13,width:2.2,alpha:.4},{type:`arc`,cx:60,cy:187,r:99,half:11.7,width:2.2,alpha:.4}],falloff:1.6,fur:8,period:4,eye:{x:60,y:52,r:8},shadowRx:20},wedge:{blobs:[{x:44,y:84,r:20},{x:76,y:84,r:20},{x:60,y:48,r:14}],extras:[{type:`arc`,cx:60,cy:28,r:10,half:53,width:3,alpha:.5,body:!0}],falloff:1.7,fur:8.5,period:2.9,eye:{x:60,y:70,r:8},shadowRx:28}},Kb=Math.max(...Object.values(Gb).map(e=>e.blobs.length)),qb=Math.max(...Object.values(Gb).map(e=>e.extras?.length??0)),Jb={"ink-dot":1,"body-dot":2,arc:3,bar:4,wave:5}})),Xb=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Zb=s(((e,t)=>{t.exports=Xb()}));function Qb(e,t){let n=1/0,r=-1/0;for(let i of Gb[e].blobs){let e=i.r*(i.rx??1),a=i.r*(i.ry??1),o=(t-i.y)/a;if(Math.abs(o)>=1)continue;let s=e*Math.sqrt(1-o*o);n=Math.min(n,i.x-s),r=Math.max(r,i.x+s)}return[n,r]}function $b(e){let{x:t,y:n,r}=Gb[e].eye,i=r*1.45,a=r*.42,[o,s]=Qb(e,n);return{band:r*.95,left:o,lens:i,outer:i+a/2,right:s,rim:a,x:t,y:n}}function ex({g:e}){let t=(t,n)=>n-t>1?(0,nx.jsxs)(`g`,{children:[(0,nx.jsx)(`rect`,{fill:rx,height:e.band,rx:e.band*.3,width:n-t,x:t,y:e.y-e.band/2}),(0,nx.jsx)(`line`,{stroke:ix,strokeDasharray:`1.6 1.6`,strokeWidth:.6,x1:t+1,x2:n-1,y1:e.y,y2:e.y})]}):null;return(0,nx.jsxs)(`g`,{className:`e-goggles`,children:[t(e.left+1.5,e.x-e.outer+.5),t(e.x+e.outer-.5,e.right-1.5),(0,nx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:sx,r:e.lens}),(0,nx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.lens,stroke:ax,strokeWidth:e.rim}),(0,nx.jsx)(`circle`,{cx:e.x,cy:e.y,fill:`none`,r:e.outer,stroke:ox,strokeWidth:.7}),[45,135,225,315].map(t=>(0,nx.jsx)(`circle`,{cx:e.x+Math.cos(t*Math.PI/180)*e.lens,cy:e.y+Math.sin(t*Math.PI/180)*e.lens,fill:ox,r:.9},t)),(0,nx.jsx)(`path`,{d:`M ${e.x-e.lens*.62} ${e.y-e.lens*.2} A ${e.lens*.66} ${e.lens*.66} 0 0 1 ${e.x-e.lens*.1} ${e.y-e.lens*.64}`,fill:`none`,opacity:.75,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:1.3})]})}function tx({kind:e}){return(0,nx.jsx)(ex,{g:$b(e)})}var nx,rx,ix,ax,ox,sx,cx=o((()=>{Yb(),nx=Zb(),rx=`oklch(40% 0.07 50)`,ix=`oklch(30% 0.06 45)`,ax=`oklch(74% 0.12 80)`,ox=`oklch(55% 0.1 70)`,sx=`oklch(88% 0.05 220 / 0.32)`}));function lx(){vx=0;let e=window.innerHeight,t=!1;for(let n of gx){let r=n.svg.getBoundingClientRect();if(r.bottom<-40||r.top>e+40)continue;let i=r.left+r.width*.5,a=r.top+r.height*.48,o=_x.x-i,s=_x.y-a,c=Math.hypot(o,s)||1,l=o/c,u=s/c,d=Math.min(r.width,r.height)*2.4,f=.35+Math.min(1,c/d)*.65,p=l*5.5*f,m=u*3.5*f,h=l*7*f+u*1.2*f;n.tx=xx(n.tx,p,.16),n.ty=xx(n.ty,m,.16),n.rot=xx(n.rot,h,.14),n.lean&&n.lean.setAttribute(`transform`,`translate(${n.tx.toFixed(2)} ${n.ty.toFixed(2)}) rotate(${n.rot.toFixed(2)} 60 62)`),n.shadow&&(n.shadow.setAttribute(`cx`,(60-n.tx*.35).toFixed(2)),n.shadow.setAttribute(`opacity`,String(Math.max(.08,.14-Math.abs(n.ty)*.008))));let g=n.ex+l*n.max*f,_=n.ey+1+u*n.max*.9*f;n.px=xx(n.px,g,.24),n.py=xx(n.py,_,.24),n.pupil&&(n.pupil.setAttribute(`cx`,n.px.toFixed(2)),n.pupil.setAttribute(`cy`,n.py.toFixed(2))),n.glint&&(n.glint.setAttribute(`cx`,(n.px-2).toFixed(2)),n.glint.setAttribute(`cy`,(n.py-3.4).toFixed(2))),(Math.abs(n.tx-p)>.05||Math.abs(n.px-g)>.05)&&(t=!0)}(t||yx-->0)&&(vx=requestAnimationFrame(lx))}function ux(){yx=48,vx||=requestAnimationFrame(lx)}function dx(e){_x.x=e.clientX,_x.y=e.clientY,ux()}function fx(){bx||typeof window>`u`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(bx=!0,_x.x=window.innerWidth*.62,_x.y=window.innerHeight*.28,window.addEventListener(`pointermove`,dx,{passive:!0}),ux())}function px(){gx.size>0||bx&&(bx=!1,window.removeEventListener(`pointermove`,dx),vx&&=(cancelAnimationFrame(vx),0))}function mx(e,t,n=!0){let r=(0,hx.useRef)(t);r.current=t,(0,hx.useEffect)(()=>{let t=e.current;if(!(t&&n)||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let{ex:i,ey:a,max:o=3.2}=r.current,s={svg:t,lean:t.querySelector(`.e-lean`),pupil:t.querySelector(`.e-pupil`),glint:t.querySelector(`.e-glint`),shadow:t.querySelector(`.e-shadow`),ex:i,ey:a,max:o,tx:0,ty:0,rot:0,px:i,py:a+1};return gx.add(s),fx(),ux(),()=>{gx.delete(s),px()}},[e,n,t.ex,t.ey,t.max])}var hx,gx,_x,vx,yx,bx,xx,Sx=o((()=>{hx=u(f(),1),gx=new Set,_x={x:0,y:0},vx=0,yx=0,bx=!1,xx=(e,t,n)=>e+(t-e)*n}));function Cx({ex:e,ey:t,max:n,ink:r,r:i,blink:a=`5.2s`}){let o=i*1.15;return(0,Y.jsxs)(`g`,{className:`e-eye`,"data-ex":e,"data-ey":t,"data-max":n,children:[(0,Y.jsx)(`ellipse`,{cx:e,cy:t,fill:`#fff`,rx:i,ry:o,children:(0,Y.jsx)(`animate`,{attributeName:`ry`,dur:a,keyTimes:`0;0.92;0.95;1`,repeatCount:`indefinite`,values:`${o};${o};${i*.1};${o}`})}),(0,Y.jsx)(`circle`,{className:`e-pupil`,cx:e,cy:t+1,fill:r,r:i*.48}),(0,Y.jsx)(`circle`,{className:`e-glint`,cx:e-i*.25,cy:t-i*.3,fill:`#fff`,r:i*.18})]})}function wx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.cobalt,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.6s`,repeatCount:`indefinite`,values:`M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z;M60 30 Q100 20 94 62 Q98 102 60 95 Q22 102 26 62 Q20 22 60 30 Z;M60 22 Q96 26 96 62 Q96 96 60 100 Q24 96 24 62 Q24 26 60 22 Z`})}),(0,Y.jsx)(`circle`,{cx:`97`,cy:`34`,fill:Rb.cobalt,opacity:`0.5`,r:`6`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3.6s`,repeatCount:`indefinite`,values:`34;28;34`})}),(0,Y.jsx)(`circle`,{cx:`106`,cy:`24`,fill:Rb.cobalt,opacity:`0.35`,r:`3.5`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,begin:`0.4s`,dur:`3.6s`,repeatCount:`indefinite`,values:`24;17;24`})}),(0,Y.jsx)(Cx,{blink:`5.2s`,ex:68,ey:58,ink:`oklch(18% 0.08 260)`,max:3.4,r:8})]})}function Tx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.amber,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4.4s`,repeatCount:`indefinite`,values:`M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z;M50 20 Q92 30 88 66 Q92 98 60 96 Q28 98 32 66 Q26 36 50 20 Z;M70 20 Q94 36 90 66 Q88 98 60 96 Q32 98 32 66 Q30 30 70 20 Z;M60 16 Q90 34 90 66 Q90 96 60 98 Q30 96 30 66 Q30 34 60 16 Z`})}),(0,Y.jsx)(Cx,{blink:`4.4s`,ex:60,ey:56,ink:`oklch(30% 0.10 60)`,max:3.2,r:8}),(0,Y.jsx)(`path`,{d:`M48 76 Q54 72 60 76 Q66 80 72 76`,fill:`none`,stroke:`oklch(30% 0.10 55)`,strokeLinecap:`round`,strokeWidth:`2.6`})]})}function Ex(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.moss,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3s`,repeatCount:`indefinite`,values:`M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z;M60 30 Q98 36 96 74 Q96 98 60 98 Q24 98 24 74 Q22 36 60 30 Z;M60 12 Q88 26 88 68 Q88 94 60 94 Q32 94 32 68 Q32 26 60 12 Z;M60 20 Q92 30 92 70 Q92 96 60 96 Q28 96 28 70 Q28 30 60 20 Z`})}),(0,Y.jsx)(`path`,{d:`M46 90 L46 80 M60 92 L60 82 M74 90 L74 80`,opacity:`0.5`,stroke:`oklch(28% 0.10 155)`,strokeLinecap:`round`,strokeWidth:`2.4`}),(0,Y.jsx)(`circle`,{cx:`60`,cy:`6`,fill:Rb.moss,r:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3s`,repeatCount:`indefinite`,values:`8;3;8`})}),(0,Y.jsx)(Cx,{blink:`4.6s`,ex:60,ey:54,ink:`oklch(16% 0.08 160)`,max:3.4,r:8.5})]})}function Dx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.rose,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`2.6s`,repeatCount:`indefinite`,values:`M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z;M52 18 Q86 40 82 76 Q80 98 60 98 Q40 98 38 76 Q32 46 52 18 Z;M68 18 Q88 46 82 76 Q80 98 60 98 Q40 98 38 76 Q34 40 68 18 Z;M60 14 Q84 44 80 76 Q78 98 60 98 Q42 98 40 76 Q36 44 60 14 Z`})}),(0,Y.jsx)(`path`,{d:`M40 20 Q60 6 80 20`,fill:`none`,opacity:`0.55`,stroke:Rb.rose,strokeLinecap:`round`,strokeWidth:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`opacity`,dur:`2.6s`,repeatCount:`indefinite`,values:`0.55;0.15;0.55`})}),(0,Y.jsx)(Cx,{blink:`3.8s`,ex:60,ey:62,ink:`oklch(22% 0.10 18)`,max:3.2,r:8}),(0,Y.jsx)(`circle`,{cx:`60`,cy:`82`,fill:`oklch(22% 0.10 18)`,r:`2.6`})]})}function Ox(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.ember,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z;M60 40 Q110 40 108 66 Q108 96 60 96 Q12 96 12 66 Q10 40 60 40 Z;M60 28 Q92 36 92 62 Q92 88 60 90 Q28 88 28 62 Q28 36 60 28 Z;M60 34 Q100 38 100 64 Q100 92 60 94 Q20 92 20 64 Q20 38 60 34 Z`})}),(0,Y.jsxs)(`g`,{fill:`none`,opacity:`0.45`,stroke:`oklch(40% 0.16 30)`,strokeWidth:`2.2`,children:[(0,Y.jsx)(`path`,{d:`M28 54 Q60 48 92 54`,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M28 54 Q60 48 92 54;M20 56 Q60 50 100 56;M32 52 Q60 46 88 52;M28 54 Q60 48 92 54`})}),(0,Y.jsx)(`path`,{d:`M26 70 Q60 64 94 70`,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M26 70 Q60 64 94 70;M18 72 Q60 66 102 72;M30 68 Q60 62 90 68;M26 70 Q60 64 94 70`})})]}),(0,Y.jsx)(Cx,{blink:`4.2s`,ex:66,ey:58,ink:`oklch(24% 0.10 30)`,max:3.2,r:8})]})}function kx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.teal,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.8s`,repeatCount:`indefinite`,values:`M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z;M46 98 Q20 92 24 66 Q28 40 54 36 Q80 30 90 50 Q100 68 84 86 Q68 102 46 98 Z;M50 94 Q28 90 28 68 Q30 46 52 40 Q76 34 86 50 Q94 64 82 82 Q72 98 50 94 Z;M48 96 Q24 92 26 68 Q28 44 52 38 Q78 32 88 50 Q98 66 84 84 Q70 100 48 96 Z`})}),(0,Y.jsx)(`circle`,{cx:`32`,cy:`94`,fill:Rb.teal,opacity:`0.4`,r:`4`,children:(0,Y.jsx)(`animate`,{attributeName:`cx`,dur:`3.8s`,repeatCount:`indefinite`,values:`32;27;32`})}),(0,Y.jsx)(Cx,{blink:`4.8s`,ex:70,ey:58,ink:`oklch(18% 0.08 200)`,max:3.4,r:8})]})}function Ax(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.slate,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4.6s`,repeatCount:`indefinite`,values:`M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z;M60 98 Q14 98 14 78 Q14 58 46 54 Q80 50 102 62 Q114 74 106 88 Q98 98 60 98 Z;M60 94 Q26 94 22 78 Q20 62 46 58 Q76 54 94 62 Q106 70 100 84 Q94 94 60 94 Z;M60 96 Q20 96 18 78 Q16 60 46 56 Q78 52 98 62 Q110 72 104 86 Q98 96 60 96 Z`})}),(0,Y.jsxs)(`g`,{fill:`oklch(30% 0.05 244)`,opacity:`0.32`,children:[(0,Y.jsx)(`circle`,{cx:`42`,cy:`76`,r:`3`}),(0,Y.jsx)(`circle`,{cx:`56`,cy:`86`,r:`2.2`}),(0,Y.jsx)(`circle`,{cx:`86`,cy:`80`,r:`2.6`})]}),(0,Y.jsx)(Cx,{blink:`5.6s`,ex:68,ey:72,ink:`oklch(20% 0.06 244)`,max:3,r:7.5})]})}function jx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`g`,{fill:Rb.citron,children:[(0,Y.jsx)(`ellipse`,{cx:`48`,cy:`34`,rx:`6`,ry:`10`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,dur:`3.2s`,repeatCount:`indefinite`,values:`34;30;34`})}),(0,Y.jsx)(`ellipse`,{cx:`72`,cy:`32`,rx:`5.5`,ry:`9`,children:(0,Y.jsx)(`animate`,{attributeName:`cy`,begin:`0.5s`,dur:`3.2s`,repeatCount:`indefinite`,values:`32;28;32`})})]}),(0,Y.jsx)(`path`,{fill:Rb.citron,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`3.2s`,repeatCount:`indefinite`,values:`M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z;M60 102 Q24 100 24 72 Q24 42 60 40 Q96 42 96 72 Q96 100 60 102 Z;M60 98 Q32 96 32 72 Q32 50 60 48 Q88 50 88 72 Q88 96 60 98 Z;M60 100 Q28 98 28 72 Q28 46 60 44 Q92 46 92 72 Q92 98 60 100 Z`})}),(0,Y.jsx)(Cx,{blink:`4.2s`,ex:60,ey:68,ink:`oklch(24% 0.09 108)`,max:3.4,r:8.5})]})}function Mx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.violet,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`4s`,repeatCount:`indefinite`,values:`M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z;M60 104 Q32 102 36 78 Q40 56 40 42 Q40 22 60 20 Q80 22 80 42 Q80 56 84 78 Q88 102 60 104 Z;M60 100 Q40 98 40 78 Q42 60 44 46 Q46 30 60 28 Q74 30 76 46 Q78 60 80 78 Q80 98 60 100 Z;M60 102 Q36 100 38 78 Q40 58 42 44 Q44 26 60 24 Q76 26 78 44 Q80 58 82 78 Q84 100 60 102 Z`})}),(0,Y.jsxs)(`g`,{fill:`none`,opacity:`0.4`,stroke:`oklch(28% 0.10 308)`,strokeLinecap:`round`,strokeWidth:`2.2`,children:[(0,Y.jsx)(`path`,{d:`M42 74 Q60 70 78 74`}),(0,Y.jsx)(`path`,{d:`M40 88 Q60 84 80 88`})]}),(0,Y.jsx)(Cx,{blink:`5s`,ex:60,ey:52,ink:`oklch(20% 0.09 308)`,max:3.2,r:8})]})}function Nx(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{fill:Rb.magenta,children:(0,Y.jsx)(`animate`,{attributeName:`d`,dur:`2.9s`,repeatCount:`indefinite`,values:`M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z;M60 24 Q78 38 90 70 Q100 94 78 100 Q60 104 42 100 Q20 94 30 70 Q42 38 60 24 Z;M60 34 Q72 44 82 70 Q92 90 76 96 Q60 100 44 96 Q28 90 38 70 Q48 44 60 34 Z;M60 30 Q74 40 86 70 Q96 92 78 98 Q60 102 42 98 Q24 92 34 70 Q46 40 60 30 Z`})}),(0,Y.jsx)(`path`,{d:`M52 22 Q60 14 68 22`,fill:`none`,opacity:`0.5`,stroke:Rb.magenta,strokeLinecap:`round`,strokeWidth:`3`,children:(0,Y.jsx)(`animate`,{attributeName:`opacity`,dur:`2.9s`,repeatCount:`indefinite`,values:`0.5;0.12;0.5`})}),(0,Y.jsx)(Cx,{blink:`3.6s`,ex:60,ey:70,ink:`oklch(22% 0.10 345)`,max:3.2,r:8})]})}function Px({kind:e}){switch(e){case`drop`:return(0,Y.jsx)(Tx,{});case`dome`:return(0,Y.jsx)(Ex,{});case`flame`:return(0,Y.jsx)(Dx,{});case`oval`:return(0,Y.jsx)(Ox,{});case`bean`:return(0,Y.jsx)(kx,{});case`pebble`:return(0,Y.jsx)(Ax,{});case`sprout`:return(0,Y.jsx)(jx,{});case`tower`:return(0,Y.jsx)(Mx,{});case`wedge`:return(0,Y.jsx)(Nx,{});default:return(0,Y.jsx)(wx,{})}}function Fx({animated:e=!0,goggles:t=!1,kind:n=`round`,size:r=160,className:i}){let a=(0,Ix.useRef)(null),o=Lx[n],s=Rx[n];return mx(a,o,e),(0,Ix.useEffect)(()=>{let t=a.current;if(!t)return;let n=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(e&&!n){t.unpauseAnimations();return}t.pauseAnimations(),t.setCurrentTime(0)},[e]),(0,Y.jsxs)(`svg`,{"aria-hidden":`true`,className:i,height:r,overflow:`visible`,ref:a,style:{display:`block`},viewBox:`0 0 120 120`,width:r,children:[(0,Y.jsx)(`ellipse`,{className:`e-shadow`,cx:`60`,cy:s.cy,fill:`#000`,opacity:`0.14`,rx:s.rx,ry:`4.5`,children:(0,Y.jsx)(`animate`,{attributeName:`rx`,dur:s.dur,repeatCount:`indefinite`,values:`${s.rx};${s.rx*.8};${s.rx}`})}),(0,Y.jsxs)(`g`,{className:`e-lean`,children:[(0,Y.jsx)(Px,{kind:n}),t?(0,Y.jsx)(tx,{kind:n}):null]})]})}var Ix,Y,Lx,Rx,zx=o((()=>{Ix=u(f(),1),Vb(),cx(),Sx(),Y=Zb(),Lx={round:{ex:68,ey:58,max:3.4},drop:{ex:60,ey:56,max:3.2},dome:{ex:60,ey:54,max:3.4},flame:{ex:60,ey:62,max:3.2},oval:{ex:66,ey:58,max:3.2},bean:{ex:70,ey:58,max:3.4},pebble:{ex:68,ey:72,max:3},sprout:{ex:60,ey:68,max:3.4},tower:{ex:60,ey:52,max:3.2},wedge:{ex:60,ey:70,max:3.2}},Rx={round:{cy:108,rx:26,dur:`3.6s`},drop:{cy:106,rx:24,dur:`4.4s`},dome:{cy:104,rx:27,dur:`3s`},flame:{cy:106,rx:22,dur:`2.6s`},oval:{cy:102,rx:32,dur:`4s`},bean:{cy:102,rx:26,dur:`3.8s`},pebble:{cy:102,rx:34,dur:`4.6s`},sprout:{cy:106,rx:26,dur:`3.2s`},tower:{cy:108,rx:20,dur:`4s`},wedge:{cy:106,rx:28,dur:`2.9s`}}}));Vb(),zx();var X=Zb(),Bx={entry:{de:`Eintrag {n} von {total}`,en:`Entry {n} of {total}`},deciding:{de:`Entscheidet, wie es weitergeht …`,en:`Deciding how to go on …`},choosingFields:{de:`Wählt die passenden Fragen …`,en:`Choosing the right questions …`},batchDone:{de:`{done} von {total} fertig`,en:`{done} of {total} done`},editing:{de:`Bearbeitet {n} von {total}`,en:`Editing {n} of {total}`},filming:{de:`Dreht {n} von {total}`,en:`Filming {n} of {total}`},clipsRendering:{de:`{count} Clips werden gerendert – das dauert einige Minuten.`,en:`Rendering {count} clips – this takes a few minutes.`},videoRendering:{de:`Das Video wird gerendert – das dauert meist 1–3 Minuten.`,en:`Rendering the video – this usually takes 1–3 minutes.`},photo:{de:`Sieht sich Foto {n} von {total} an`,en:`Looking at photo {n} of {total}`},listen:{de:`Hört „{label}“ an …`,en:`Listening to “{label}” …`},listenFailed:{de:`„{label}“ konnte nicht verschriftlicht werden.`,en:`“{label}” could not be written down.`},filmCutting:{de:`Der Film wird geschnitten – das dauert etwa eine Minute.`,en:`Cutting the film – this takes about a minute.`},filmProgress:{de:`{pct} % geschnitten`,en:`{pct} % cut`},filmError:{de:`Der Film meldet: {detail}`,en:`The film reports: {detail}`},widgetError:{de:`Das Widget meldet einen Fehler: {detail}`,en:`The widget reports an error: {detail}`},mcpConnected:{de:`Verbunden mit {names}`,en:`Connected to {names}`},mcpUnreachable:{de:`MCP-Server nicht erreichbar: {detail}`,en:`MCP server unreachable: {detail}`},reads:{de:`Liest {name}`,en:`Reading {name}`},readsMany:{de:`Liest {count} Dokumente`,en:`Reading {count} documents`},opens:{de:`Öffnet {name}`,en:`Opening {name}`},clicks:{de:`Klickt im Browser`,en:`Clicking in the browser`},types:{de:`Tippt im Browser`,en:`Typing in the browser`},looksAtPage:{de:`Sieht sich die Seite an`,en:`Looking at the page`},waitsForSignIn:{de:`Wartet auf deine Anmeldung bei {name}`,en:`Waiting for you to sign in at {name}`},downloads:{de:`Lädt {name} herunter`,en:`Downloading {name}`},runs:{de:`Führt aus: {command}`,en:`Running: {command}`},python:{de:`Führt Python aus`,en:`Running Python`},drawing:{de:`Zeichnet ein Bild`,en:`Drawing an image`},writesPage:{de:`Schreibt die Seite „{title}“`,en:`Writing the page “{title}”`},searchesDocuments:{de:`Sucht in den Dokumenten: {query}`,en:`Searching the documents: {query}`},searchesKnowledge:{de:`Sucht in Wissen: {query} – {relevant} von {candidates} passen`,en:`Searching the knowledge: {query} – {relevant} of {candidates} fit`},listsKnowledge:{de:`Listet Wissen`,en:`Listing the knowledge`},searchesMail:{de:`Durchsucht {label}`,en:`Searching {label}`},savesReceipts:{de:`Speichert {count} Belege aus {label}`,en:`Saving {count} receipts from {label}`},remembers:{de:`Merkt sich {title}`,en:`Remembering {title}`},files:{de:`Legt {count} Dateien ab`,en:`Filing {count} files`},filmSetup:{de:`Richtet den Arbeitsordner für den Film ein`,en:`Setting up the folder for the film`},filmClient:{de:`{client} arbeitet am Film – das dauert meist 10–40 Minuten.`,en:`{client} is working on the film – this usually takes 10–40 minutes.`},filmTask:{de:`Am Film: {task}`,en:`On the film: {task}`},filmLooks:{de:`Sieht sich Bilder des Films an`,en:`Looking at frames of the film`},filmFix:{de:`Der Film ließ sich nicht rendern – Claude Code bessert nach`,en:`The film did not render – Claude Code is fixing it`},filmResume:{de:`Macht dort weiter, wo der Film stehen geblieben ist`,en:`Picking the film up where it stopped`}};function Vx(e,t){let n=Bx[e.code];return n?n[t].replace(/\{(\w+)\}/g,(t,n)=>e.params?.[n]===void 0?t:String(e.params[n])):``}var Hx={"brand.tagline":`Wünsch dir was. Wir bauen deinen Wizard.`,"brand.sub":`Er führt dich Schritt für Schritt zum Ergebnis. Die KI erledigt die Arbeit.`,"auth.dev":`Dev-Login (lokal)`,"auth.legal":`Kein Passwort, keine Registrierung – du meldest dich mit einem bestehenden Konto an.`,"auth.signIn":`Anmelden oder Konto erstellen`,"auth.failed":`Die Anmeldung hat nicht geklappt. Bitte noch einmal versuchen.`,"auth.localLink":`Öffne den Link, den die App beim Start ausgegeben hat – er meldet dich an diesem Gerät an.`,"nav.account":`Konto & Guthaben`,"setup.keysInAccount":`API-Schlüssel für Skripte gehören zu deinem Konto. Du legst sie dort an und ziehst sie dort zurück.`,"setup.openAccount":`Konto öffnen`,"class.label":`Modell-Klasse`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Bild`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Sprachausgabe`,"class.classifier.hint":`Zuordnen, Ja/Nein, wenige Werte aus Text ziehen. Am günstigsten.`,"class.standard.hint":`Kurze Texte, eine API aufrufen, umformatieren.`,"class.high.hint":`Recherche mit Werkzeugen, lange Dokumente, Abwägen vieler Quellen.`,"class.highest.hint":`Schweres Abwägen oder Code. Mehrfach so teuer wie High.`,"class.effort":`Denkaufwand`,"class.effortAuto":`Automatisch`,"class.effort.low":`Niedrig`,"class.effort.medium":`Mittel`,"class.effort.high":`Hoch`,"estimate.step":`≈ {n} Credits, selten mehr als {high}`,"estimate.measured":`gemessen aus den letzten Läufen`,"estimate.formula":`geschätzt, wird nach fünf Läufen genauer`,"estimate.share":`Ein Lauf kostet etwa {run} Credits. Beim Tageslimit sind es höchstens {day} Credits am Tag.`,"local.title":`Modelle`,"local.accountWaiting":`Warte auf die Anmeldung im Browser …`,"local.accountFailed":`Der Konto-Dienst ist gerade nicht erreichbar.`,"local.accountExpired":`Die Anmeldung ist abgelaufen. Bitte neu anmelden.`,"local.sourceNeedsAccount":`Dafür brauchst du ein Konto.`,"local.toAccount":`Zu Einstellungen → Konto`,"local.sourceOwn":`Eigene Schlüssel`,"local.keys":`Schlüssel`,"local.keysHint":`Ein Schlüssel reicht. Schlüssel liegen im Schlüsselbund dieses Geräts, nie in der Datenbank.`,"local.keySet":`hinterlegt`,"local.keyEmpty":`nicht hinterlegt`,"local.keyRemove":`Entfernen`,"local.classes":`Modell je Klasse`,"local.classesHint":`Ein Schritt nennt nur die Klasse. Hier steht, welches Modell sie bedient, z. B. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini oder ollama:qwen3.`,"local.save":`Speichern`,"local.saved":`Gespeichert`,"local.chat":`Der Chat im Studio antwortet über`,"local.chatModels":`Modell-Klasse Highest`,"local.chatClaude":`Claude-Abo (Claude Code)`,"local.subscription":`Mit dem Abo baut das auf diesem Gerät installierte Claude Code den Wizard – mit deiner Anmeldung dort. Läufe nutzen weiter Schlüssel oder Guthaben.`,"harness.hint":`Texte denkt das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Bilder, Videos und Audio brauchen weiter einen Schlüssel.`,"harness.hintImages":`Texte und Bilder macht das auf diesem Gerät installierte {name} – mit deinem {sub} und deiner Anmeldung dort. Kein Schlüssel nötig. Videos und Audio brauchen weiter einen Schlüssel.`,"harness.found":`{name} {version} gefunden`,"harness.missing":`{name} ist auf diesem Gerät nicht installiert.`,"harness.install":`Oder in deinem eigenen Terminal:`,"harness.installButton":`{name} installieren`,"harness.installing":`{name} wird im Terminal unten installiert – das dauert etwa eine Minute. Danach meldest du es an.`,"harness.installEnded":`Die Installation ist zu Ende, aber {name} ist nicht da. Was oben steht, sagt warum.`,"harness.appHere":`Die {app}-App ist auf diesem Computer: {name} meldet sich mit demselben {sub} an.`,"harness.notInstalled":`nicht installiert`,"harness.authSubscription":`Angemeldet mit deinem {sub}.`,"harness.authKey":`Angemeldet mit einem API-Schlüssel aus deiner Shell – nicht mit dem Abo. Melde dich hier an, damit es über dein {sub} läuft.`,"harness.authNone":`Noch nicht angemeldet.`,"harness.signIn":`Hier anmelden`,"harness.signingIn":`Die Anmeldung läuft im Terminal unten – dein Browser öffnet sich dafür. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.signInInteractive":`Unten startet {name}. Wähle dort die Anmeldung mit deinem {sub} und melde dich im Browser an. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.loginEnded":`Die Anmeldung wurde beendet, ohne dass {name} angemeldet ist.`,"harness.sub.claude":`Claude-Abo`,"harness.sub.codex":`ChatGPT-Abo`,"harness.sub.gemini":`Google-Konto`,"harness.sub.cursor":`Cursor-Abo`,"harness.desc.claude":`Mit deinem Claude-Abo – kein Schlüssel nötig.`,"harness.desc.codex":`Mit deinem ChatGPT-Abo – kein Schlüssel nötig.`,"harness.desc.gemini":`Mit deinem Google-Konto – kein Schlüssel nötig.`,"harness.desc.cursor":`Mit deinem Cursor-Abo – kein Schlüssel nötig.`,"harness.ready":`angemeldet`,"local.recheck":`Erneut prüfen`,"local.test":`Testen`,"local.testHint":`Ein kurzer Aufruf zeigt, ob der Weg zum Modell offen ist.`,"local.testOk":`Antwort in {s} s über {ref}: „{reply}“`,"local.testFailed":`Der Test hat nicht geklappt: {error}`,"models.groupCaps":`Fähigkeiten`,"models.groupAccess":`Zugänge`,"models.groupMore":`Weitere Anbieter`,"models.cap.text":`Text & Denken`,"models.cap.text.hint":`Schreibt, fasst zusammen, recherchiert und entscheidet – in fast jedem Schritt.`,"models.cap.image":`Bilder`,"models.cap.image.hint":`Erzeugt Bilder: Logos, Produktfotos, Illustrationen.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Erzeugt kurze Clips aus Text oder aus einem Bild.`,"models.cap.speech":`Sprachausgabe`,"models.cap.speech.hint":`Liest Texte vor: Voice-over, Hörfassungen, Ansagen.`,"models.cap.listening":`Sprachnotizen`,"models.cap.listening.hint":`Versteht Gesprochenes und macht aus Sprachnotizen Text.`,"models.way.local":`Lokales Modell`,"models.way.credits":`Guthaben`,"models.way.creditsTeam":`Guthaben des Teams`,"models.way.none":`nicht eingerichtet`,"models.who":`Wer macht das?`,"models.optSubscription":`Dein Abo`,"models.optKey":`Eigener API Key`,"models.optLocal":`Lokales Modell`,"models.optLocalNote":`Ollama auf diesem Computer`,"models.noteIncluded":`im Abo enthalten`,"models.noteSignedOut":`nicht angemeldet`,"models.noteMissing":`nicht installiert`,"models.noteKey":`API Key hinterlegt`,"models.noteKeyShort":`Key`,"models.noteSignedIn":`angemeldet`,"models.noteShellKey":`API Key aus der Shell`,"models.optOther":`Sonst`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API Key fehlt`,"models.noteNeedsAccount":`Konto nötig`,"models.notePerImage":`≈ {n} Credits je Bild`,"models.notePerSecond":`≈ {n} Credits je Sekunde`,"models.notePer1k":`≈ {n} Credits je 1000 Zeichen`,"models.notePerMinute":`≈ {n} Credits je Minute`,"models.creditsAuto":`engenty wählt: {model}`,"models.creditsAutoNone":`engenty wählt das Modell`,"models.creditsPickHint":`Abgerechnet in Credits – ohne eigenen API Key.`,"models.viaCredits":`{name} über engenty Guthaben`,"models.viaCreditsHint":`Ohne eigenen API Key, abgerechnet in Credits.`,"models.viaCreditsNeedsAccount":`Mit einem engenty-Konto, abgerechnet in Credits.`,"models.noteUsage":`Credits nach Verbrauch`,"models.model":`Modell`,"models.modelCustom":`Eigenes Modell …`,"models.textSimple":`Einfache Schritte`,"models.textDemanding":`Anspruchsvolle Schritte`,"models.perClass":`Je Klasse anpassen`,"models.manageKey":`API Key von {name}`,"models.key":`API Key`,"models.keyFor":`API Key von {name}`,"models.keyGet":`Key bei {name} holen`,"models.keySave":`Prüfen und speichern`,"models.keyStored":`API Key hinterlegt`,"models.keyNone":`Kein API Key`,"models.keyCheck":`Prüfen`,"models.keyReplace":`Ersetzen`,"models.keyRemove":`Entfernen`,"models.keyOk":`Der Key gilt.`,"models.keyBad":`Der Key wurde nicht angenommen.`,"models.keyWhereLocal":`Der Key bleibt auf diesem Gerät, nie in der Datenbank.`,"models.keyWhereCloud":`Der Key liegt verschlüsselt beim Team. Niemand sieht ihn wieder.`,"models.keyFallback":`Bis der Key da ist, springt das Guthaben ein.`,"models.uses":`Wofür`,"models.useFor":`Nutzen`,"models.inUse":`wird genutzt`,"models.try":`Ausprobieren`,"models.try.text":`Testen`,"models.try.image":`Probebild erzeugen`,"models.try.video":`Probeclip erzeugen`,"models.try.speech":`Probe anhören`,"models.try.listening":`Zuhören testen`,"models.tryCost":`Kostet wie ein echter Aufruf.`,"models.tryCostVideo":`Ein Clip von 4 Sekunden – kostet wie ein echter.`,"models.tryWait":`Wird erzeugt …`,"models.tryWaitVideo":`Ein Clip dauert ein bis zwei Minuten …`,"models.tryOk":`In {s} s mit {model}`,"models.tryHeard":`Gehört: „{text}“`,"models.tryHeardNothing":`Nichts gehört – der Weg ist offen.`,"models.tryFailed":`Hat nicht geklappt: {error}`,"models.creditsName":`engenty Guthaben`,"models.creditsTeam":`Guthaben des Teams`,"models.creditsLocalLead":`Springt ein, wo kein Abo und kein eigener API Key eingerichtet ist.`,"models.creditsCloudHint":`Alles ohne eigenen API Key läuft über das Guthaben. Eigene Keys gehen vor und kosten keine Credits.`,"models.creditsConnectTitle":`Mit einem Konto`,"models.creditsLocalHint":`Mit einem engenty-Konto springt das Guthaben ein, wo nichts Eigenes eingerichtet ist – etwa für Videos ohne eigenen API Key.`,"models.creditsConnect":`Konto verbinden`,"models.creditsFallback":`Guthaben springt ein`,"models.creditsFallbackOn":`Was kein Abo und keinen eigenen API Key hat, läuft über das Guthaben.`,"models.creditsFallbackOff":`Aus: Was kein Abo und keinen eigenen API Key hat, läuft nicht.`,"models.creditsOn":`Läuft über das Guthaben`,"models.creditsNone":`Gerade läuft nichts über das Guthaben.`,"models.creditsTopUp":`Aufladen`,"models.creditsPicks":`engenty wählt das Modell und rechnet in Credits ab.`,"models.creditsModel":`Gerade: {model}.`,"models.clientSignIn":`Anmeldung`,"models.clientImages":`{name} erzeugt Bilder mit deinem {sub} – ohne eigenen API Key.`,"models.clientNotChosen":`Text läuft gerade nicht über {name}.`,"models.ollamaHint":`Adresse von Ollama und das Modell, das dort läuft.`,"models.readOnly":`Nur Admins des Teams ändern die Modelle.`,"models.viewAs":`Vorschau als`,"models.view.auto":`wie es ist`,"models.view.local":`lokal`,"models.view.linked":`lokal + Konto`,"models.view.cloud":`Cloud-Studio`,"setup.title":`Setup`,"setup.sub":`Engenty kann deine vorhandenen Konten auf deinem Computer nutzen.`,"setup.source":`Womit soll die Engenty denken?`,"setup.local":`Läuft lokal auf diesem Gerät.`,"setup.stage.connect":`Verbinden`,"setup.stage.test":`Testen`,"setup.stage.done":`Fertig`,"setup.h.install":`Installiere {name}`,"setup.h.signIn":`Melde {name} an`,"setup.h.keys":`Trage einen Schlüssel ein`,"setup.h.test":`Ein kurzer Test`,"setup.h.done":`Verbunden.`,"setup.ready":`Alles bereit.`,"setup.noHarness":`Noch kein KI-Client installiert. Wähle einen – er wird hier installiert – oder trage eigene Schlüssel ein.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic oder Ollama.`,"setup.recommended":`Empfohlen`,"setup.done":`Zum Studio`,"setup.untilWorks":`Das Studio öffnet sich, sobald der Test klappt.`,"cloud.onPublish":`Sobald du den Wizard veröffentlichst, geht die Version auch in die Cloud deines Kontos und läuft dort hinter einem eigenen Link.`,"cloud.notSent":`Diese Version ist noch nicht in der Cloud.`,"cloud.send":`Jetzt senden`,"cloud.resend":`Erneut senden`,"cloud.again":`Um {when} wird es noch einmal versucht.`,"cloud.sent":`Version {v} · gesendet am {when}`,"cloud.notRunnable":`Version {v} läuft in der Cloud nicht.`,"cloud.keepsRunning":`Dort läuft weiter Version {v}.`,"cloud.nothingRuns":`Dort läuft deshalb noch nichts.`,"cloud.notes":`Was in der Cloud anders läuft:`,"cloud.check":`Was dem jetzigen Stand in der Cloud fehlen würde:`,"cloud.checkBlocking":`So, wie der Wizard jetzt ist, würde er in der Cloud nicht laufen:`,"cloud.documents":`Die Dokumente des Space bleiben auf diesem Gerät. In der Cloud arbeiten die Schritte ohne sie.`,"cloud.stepName":`„{title}“`,"cloud.problem.sandbox":`Der Server hat keine Maschine für Code. Dort läuft das ohne sie.`,"cloud.problem.mcp":`Die MCP-Server des Space gibt es auf dem Server nicht: {detail}.`,"cloud.problem.model":`Dafür gibt es in der Cloud kein Modell.`,"cloud.problem.connector":`Dem Space fehlt in der Cloud ein Connector.`,"cloud.problem.invalid":`So nimmt der Server den Wizard nicht an.`,"cloud.spaceLimit":`In der Cloud deines Kontos liegt schon der Space einer anderen Installation:`,"cloud.replace":`Bisherigen Space ersetzen`,"cloud.replaceConfirm":`Den bisherigen Space aus der Cloud entfernen? Seine Wizards und ihre Links verschwinden dort. Danach wird gesendet, was hier veröffentlicht ist.`,"cloud.noticeError":`Hier veröffentlicht. In der Cloud ist diese Version nicht angekommen – mehr dazu unten.`,"cloud.noticeNotRunnable":`Hier veröffentlicht. In der Cloud läuft diese Version nicht – mehr dazu unten.`,"readonly.wizard":`Dieser Wizard kommt aus deiner lokalen Installation und wird dort geändert. Hier läuft, was du dort veröffentlichst.`,"readonly.project":`Dieser Space kommt aus deiner lokalen Installation und wird dort geändert.`,"readonly.server":`Auf diesem Server wird nichts gebaut. Hier laufen die Wizards, die deine lokale Installation veröffentlicht.`,"nav.wizards":`Wizards`,"nav.settings":`Einstellungen`,"nav.project":`Space`,"account.title":`Konto`,"account.hint":`Wie dich die App nennt und wie man dich erreicht.`,"account.initials":`Dein Kürzel im Menü oben rechts: die Anfangsbuchstaben deines Namens.`,"account.name":`Name`,"account.nameHint":`Anfangs steht hier der Benutzername dieses Geräts.`,"account.fromAccount":`Name und E-Mail kommen aus deinem Konto.`,"account.about":`Über dich`,"account.aboutHint":`Wer du bist und was du machst.`,"account.email":`E-Mail`,"account.phone":`Telefon`,"account.connection":`engenty.ai`,"account.connectionHint":`Anmeldung, Guthaben und die Cloud, in der deine Wizards für alle laufen.`,"account.profile":`Profil`,"account.local":`Lokale Installation`,"account.localText":`Diese App läuft auf deinem Gerät und ist mit keinem Konto verbunden. Wizards, Space und Dateien bleiben hier.`,"account.linked":`Verbunden`,"account.with":`Mit einem Konto`,"account.withCredits":`Guthaben für die Modelle, wo kein KI-Client installiert ist. Kein API Key nötig.`,"account.withCloud":`Was du veröffentlichst, läuft auch auf engenty.ai – hinter einem öffentlichen Link, auch wenn dieses Gerät aus ist.`,"account.signIn":`Anmelden`,"account.signInAgain":`Neu anmelden`,"account.new":`Noch kein Konto?`,"account.newHint":`Ein neues Konto braucht einen Einladungscode. Trag ihn hier ein, dann steht er bei der Registrierung schon im Formular.`,"account.code":`Einladungscode`,"account.create":`Konto erstellen`,"account.credits":`Guthaben`,"account.topUp":`Aufladen`,"account.expires":`{n} Credits gültig bis {date}`,"account.kind.start":`Startguthaben`,"account.kind.monthly":`Monatsguthaben`,"account.kind.gift":`Geschenkt`,"account.cloud":`Was du hier veröffentlichst, läuft auch auf {host}.`,"account.look":`Darstellung`,"account.lookHint":`Sprache und Design der App in diesem Browser.`,"nav.logout":`Abmelden`,"nav.connected":`Verbunden mit {host}`,"nav.expired":`Anmeldung abgelaufen`,"nav.onlyHere":`Nur auf diesem Computer`,"nav.local":`lokal`,"nav.language":`Sprache`,"nav.theme":`Design`,"nav.credits":`{n} Credits`,"footer.billing":`Guthaben`,"footer.usage":`Verbrauch`,"footer.invoices":`Rechnungen`,"footer.account":`Konto`,"about.version":`Version {v}`,"about.update.available":`Version {v} von engenty wizards ist da.`,"about.update.install":`Aktualisieren`,"about.update.installing":`Version {v} wird installiert …`,"about.update.restarting":`Startet neu mit Version {v} …`,"about.update.done":`Installiert. Starte engenty wizards neu, um {v} zu nutzen.`,"about.update.failed":`Das Update ist fehlgeschlagen. Logs: logs/update.log`,"about.update.notes":`Was ist neu`,"about.changelog":`Changelog`,"about.changelogHint":`Was sich von Version zu Version geändert hat.`,"about.changelogEmpty":`Noch keine Einträge.`,"about.unreleased":`Noch nicht veröffentlicht`,"about.breaking":`breaking`,"about.credits":`Open Source`,"about.creditsHint":`engenty wizards und die Open-Source-Software, auf der es aufbaut.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Gebaut mit`,"about.creditsDeps":`Direkte Abhängigkeiten`,"about.creditsDepsHint":`Was die Teile dieser App selbst einbinden, mit Version und Lizenz – ohne deren eigene Abhängigkeiten.`,"about.creditsShared":`Von mehreren Teilen genutzt`,"about.search":`Suchen …`,"about.noMatches":`Keine Treffer.`,"theme.dark":`Dunkles Design`,"theme.light":`Helles Design`,"home.title":`Deine Wizards`,"home.new":`Neuer Wizard`,"home.import":`Importieren`,"import.failed":`Import hat nicht geklappt`,"home.empty":`Noch keine Wizards in diesem Space.`,"home.live":`Live`,"home.draft":`Entwurf`,"where.here":`Lokal`,"where.hereVersion":`Lokal · Version {v}`,"where.hereHint":`Läuft nur auf diesem Computer, solange die App läuft.`,"where.liveHint":`Läuft auf {host} – für alle mit dem Link.`,"where.liveAt":`Live auf {host} · Version {v}`,"where.note":`1 Hinweis`,"where.notes":`{n} Hinweise`,"where.sending":`Wird gesendet`,"where.missing":`Nicht in der Cloud`,"home.steps":`{n} Schritte`,"home.newProject":`Neuer Space`,"home.projectName":`Name des Space`,"home.projectLimit":`Höchstens {n} Spaces`,"team.title":`Team`,"team.hint":`Wer im Team ist und auf welchem Paket es läuft. Eingeladen und verwaltet wird im Konto.`,"team.plan":`Paket`,"team.planFree":`Free`,"team.seats":`{taken} von {limit} Plätzen`,"team.seatsUnlimited":`Plätze ohne Limit`,"team.members":`Mitglieder`,"team.invited":`eingeladen`,"team.you":`du`,"team.manage":`Mitglieder verwalten`,"team.changePlan":`Paket ansehen`,"team.roles":`Inhaber und Admins legen Wizards und Spaces an und löschen sie; Mitglieder bearbeiten die Wizards, die es gibt.`,"team.memberNote":`Du bist Mitglied: Du bearbeitest Wizards, Admins legen neue an und löschen.`,"team.failed":`Das Team ließ sich nicht laden.`,"team.role.owner":`Inhaber`,"team.role.admin":`Admin`,"team.role.member":`Mitglied`,"models.ownKeysPlan":`Eigene API Keys gibt es ab dem Pro-Paket. Hier zahlen die Credits des Teams.`,"home.fromLocal":`Aus deiner lokalen Installation – geändert wird dort.`,"home.syncedAt":`Zuletzt angekommen: {when}.`,"home.local.title":`Hier laufen die Wizards aus deiner lokalen Installation`,"home.local.text":`Du baust auf deinem eigenen Computer. Was du dort veröffentlichst, läuft hier – für alle, hinter einem Link.`,"home.local.install":`Installiere engenty wizards auf deinem Computer:`,"home.local.signIn":`Melde dich dort unter Einstellungen → Konto mit diesem Konto an.`,"home.local.publish":`Veröffentliche einen Wizard. Er erscheint dann hier.`,"new.title":`Was soll dein Wizard können?`,"new.placeholder":`z. B. Kunden geben ihr Produkt und ihre Zielgruppe ein, der Wizard recherchiert Wettbewerber und erstellt daraus ein Positionierungs-Briefing als PDF.`,"new.build":`Wizard bauen`,"new.orStarter":`Oder beginne mit einer Vorlage`,"new.import":`Wizard-Paket importieren`,"new.hint":`Du kannst alles danach im Gespräch ändern.`,"editor.resize":`Breite ändern – Doppelklick setzt zurück`,"editor.resizeSheet":`Höhe ändern – Tippen klappt ein und aus`,"editor.export":`Als Paket exportieren (.wizard)`,"addStep.title":`Was soll hier passieren?`,"addStep.placeholder":`Zum Beispiel: eine Karte mit allen gefundenen Objekten, der Preis als Farbe`,"addStep.kind":`Art des Schritts`,"addStep.auto":`KI wählt`,"addStep.empty":`Beschreibe zuerst, was der Schritt tun soll.`,"addStep.busy":`Der Assistent arbeitet noch an der letzten Nachricht. Versuch es gleich noch einmal.`,"addStep.emptyStep":`Leer einfügen`,"addStep.cancel":`Abbrechen`,"addStep.create":`Erstellen`,"addStep.building":`Neuer Schritt wird gebaut …`,"addStep.showChat":`Im Gespräch ansehen`,"addStep.add":`Schritt hinzufügen`,"surface.preview":`Vorschau`,"surface.code":`Code`,"surface.sampleNote":`Mit Beispieldaten – ein Lauf zeigt seine eigenen.`,"surface.sampleText":`Beispieltext`,"surface.sampleBrand":`Deine Firma`,"addStep.when":`Wann?`,"addStep.always":`Immer`,"addStep.onlyIf":`Nur wenn …`,"addStep.aiDecides":`KI entscheidet …`,"addStep.ifPlaceholder":`Zum Beispiel: Umsatz unter 100`,"addStep.askPlaceholder":`Zum Beispiel: die Person will ihr Geld zurück`,"addStep.whenEmpty":`Sag, wann der Schritt kommen soll.`,"addStep.messageIf":`Nur wenn: {text} – sonst geht es nach „{from}“ weiter wie bisher.`,"addStep.messageAsk":`KI entscheidet: {text} – sonst geht es nach „{from}“ weiter wie bisher.`,"addStep.here":`Hier einen Schritt einfügen`,"addStep.between":`Zwischen „{before}“ und „{after}“`,"addStep.after":`Nach „{title}“`,"addStep.first":`Als erster Schritt, vor „{title}“`,"addStep.message":`Neuer Schritt · {place}`,"addStep.messageAs":`Neuer Schritt ({kind}) · {place}`,"widget.missing":`Das Widget ist noch nicht gebaut.`,"widget.what":`Was soll das Widget zeigen? (optional)`,"widget.build":`Vom Assistenten bauen lassen`,"widget.upload":`Eigene HTML hochladen`,"widget.buildMessage":`Bitte baue das Widget „{title}“. {what}`,"editor.chat":`Gespräch`,"editor.dropToAttach":`Loslassen, um es der Nachricht anzuhängen`,"editor.memory":`Gedächtnis`,"memory.explain":`Was der Wizard über alle Läufe hinweg weiß: Notizen, die KI-Schritte mit dem Werkzeug „Seiten“ lesen und fortschreiben, und die Tabellen seiner geteilten Listen. Dieselben Daten stehen im Bereich unter Daten.`,"memory.unused":`Noch nutzt kein Schritt das Gedächtnis. Bitte den Assistenten, dass sich ein KI-Schritt etwas merken soll.`,"memory.none":`Noch nichts gemerkt.`,"memory.add":`Notiz`,"memory.newNote":`Notiz`,"memory.back":`Gedächtnis`,"memory.testCopy":`Testläufe lesen das Gedächtnis, schreiben aber in eine eigene Kopie, die mit dem Lauf verschwindet.`,"editor.step":`Schritte`,"editor.runs":`Durchläufe`,"editor.reviewEditable":`bearbeitbar`,"editor.reviewRedo":`neu erstellbar`,"editor.otherwise":`sonst`,"editor.next.title":`Nächster Schritt`,"editor.next.ways":`Nächster Schritt · {count} Wege`,"editor.next.open":`Schritt öffnen`,"editor.next.then":`Danach`,"editor.next.fold":`Zuklappen`,"editor.next.unfold":`Kurz zeigen`,"editor.branch.ai":`KI`,"editor.branch.addWhen":`Bedingung`,"editor.branch.when":`Weiter, wenn`,"editor.branch.pick":`Wählen …`,"editor.branch.and":`und`,"editor.branch.statement":`Aussage`,"editor.branch.none":`Keine trifft klar zu`,"editor.branch.how":`Entschieden von einem Entscheidungsmodell (Jev), wo es einen Weg dorthin gibt, sonst vom Sprachmodell der Klasse Klassifizieren. Liegen die zwei wahrscheinlichsten Antworten weniger als 10 Punkte auseinander, gilt „keine“.`,"editor.branch.lastRun":`Im letzten Testlauf entschieden von {source}.`,"editor.branch.bySystemOne":`einem Entscheidungsmodell`,"editor.branch.byLlm":`dem Sprachmodell`,"editor.branch.notYet":`Ein Testlauf zeigt hier, wie die KI entschieden hat.`,"editor.branch.end":`Ende`,"editor.branch.max":`Höchstens so oft (sonst 10)`,"editor.branch.remove":`Verzweigung entfernen`,"editor.branch.addAsk":`KI entscheidet`,"editor.branch.newAsk":`Die Person möchte …`,"editor.whenFilled":`{field} ausgefüllt`,"editor.whenEmpty":`{field} leer`,"editor.whenContains":`{field} enthält {value}`,"editor.whenAsk":`entscheidet: {text}`,"editor.surfaceJson":`Ansicht (JSON)`,"editor.fieldAsk":`Oder: zeigen, wenn die KI das für zutreffend hält …`,"editor.atMost":`höchstens {count}×`,"editor.shownWhen":`Nur zeigen, wenn`,"editor.shownAlways":`Immer zeigen`,"editor.conditionValue":`Wert`,"editor.optionsFrom":`Auswahl aus früheren Daten`,"editor.optionsFixed":`Feste Auswahl`,"editor.op.equals":`ist`,"editor.op.notEquals":`ist nicht`,"editor.op.in":`ist eine von`,"editor.op.notEmpty":`ist ausgefüllt`,"editor.op.empty":`ist leer`,"editor.op.gt":`größer als`,"editor.op.lt":`kleiner als`,"editor.op.contains":`enthält`,"editor.conditionsMore":`und {count} weitere Bedingungen`,"tool.web_search":`Websuche`,"tool.web_fetch":`Webseiten lesen`,"tool.browser":`Browser`,"tool.sandbox":`Code & Shell`,"tool.image":`Bilder`,"tool.http":`API`,"tool.pages":`Seiten`,"editor.test":`Testen`,"editor.share":`Teilen`,"editor.publish":`Veröffentlichen`,"editor.published":`Live · Version {v}`,"editor.unpublishedChanges":`Änderungen nicht veröffentlicht`,"editor.notPublished":`Noch nicht veröffentlicht`,"editor.composer":`Beschreibe, was sich ändern soll …`,"editor.attach":`Dateien anhängen`,"editor.detach":`Entfernen`,"editor.attached":`Angehängt`,"editor.thread":`Verlauf`,"editor.voice":`Diktieren`,"editor.voiceStop":`Diktat beenden`,"editor.listening":`Ich höre zu …`,"editor.transcribing":`Wird verschriftlicht …`,"editor.micDenied":`Das Mikrofon ist für diese Seite nicht freigegeben.`,"editor.building":`Baue den Ablauf …`,"editor.files":`Dateien`,"files.explain":`Was dein Wizard bei jedem Durchlauf braucht: Widget-Code, Bibliotheken, Kartenumrisse, Preislisten. Der Assistent legt sie im Gespräch an – du kannst auch eigene hochladen.`,"files.upload":`Hochladen`,"files.drop":`Zum Hochladen loslassen`,"files.count":`{n} Dateien · {size}`,"files.empty":`Noch keine Dateien. Zieh Dateien hierher oder bitte den Assistenten, ein Widget zu bauen.`,"files.download":`Herunterladen`,"files.delete":`Löschen`,"files.confirmDelete":`„{path}“ löschen?`,"files.none":`Dieser Wizard hat keine Dateien.`,"editor.thinking":`Denkt nach …`,"editor.chatBroken":`Die Verbindung ist abgebrochen. Was schon gebaut war, ist gespeichert – schick die Nachricht bitte noch einmal.`,"editor.issues":`Bevor du testest oder teilst, braucht der Wizard noch Korrekturen:`,"editor.fixWithChat":`Vom Assistenten beheben lassen`,"editor.models.blocking":`So kann der Wizard nicht starten. Es fehlen Modelle:`,"editor.models.optional":`Diese Schritte laufen so nicht. Wähle beim Testen einen Weg ohne sie oder richte die Modelle ein:`,"editor.models.settings":`Modelle einrichten`,"editor.prevStep":`Vorheriger Schritt`,"editor.nextStep":`Nächster Schritt`,"editor.deleteStep":`Schritt löschen`,"editor.holdToDelete":`Zum Löschen halten`,"editor.deleting":`Löschen`,"editor.moveUp":`Nach oben`,"editor.moveDown":`Nach unten`,"editor.noRuns":`Noch keine Durchläufe.`,"editor.restart":`Neu starten`,"editor.close":`Schließen`,"runDrawer.expand":`Ganzes Fenster`,"runDrawer.shrink":`Zurück an den Rand`,"editor.chatHello":`Beschreibe mir, was dein Wizard tun soll. Ich baue den Ablauf und du siehst ihn links als Diagramm.`,"shareRun.button":`Teilen`,"shareRun.title":`Ergebnis teilen`,"shareRun.email":`E-Mail`,"shareRun.more":`Mehr …`,"shareRun.until":`Der Link ist bis {date} gültig.`,"shareRun.kept":`Der Link bleibt gültig, bis du ihn zurückziehst.`,"shareRun.withdraw":`Link zurückziehen`,"sharePage.gone":`Dieser Link ist abgelaufen oder wurde zurückgezogen.`,"sharePage.own":`Selbst ausprobieren`,"sharePage.until":`Geteilt · verfügbar bis {date}`,"sharePage.shared":`Geteilt am {date}`,"share.title":`Wizard teilen`,"share.link":`Link`,"share.copy":`Kopieren`,"share.copied":`Kopiert`,"share.enabled":`Link ist aktiv`,"share.limit":`Durchläufe pro Tag`,"share.rotate":`Neuen Link erzeugen`,"share.rotateHint":`Der alte Link funktioniert danach nicht mehr.`,"share.publishFirst":`Veröffentliche den Wizard, damit der Link funktioniert.`,"share.unpublished":`Deine Änderungen sind noch nicht veröffentlicht: der Link läuft mit der Version davor.`,"share.website":`Website`,"share.openHere":`Auf diesem Computer testen`,"share.settings":`Einstellungen`,"share.on":`aktiv`,"share.off":`aus`,"share.perDay":`{n} pro Tag`,"share.rotateCloud":`Der alte Link funktioniert danach nicht mehr – auch der in der Cloud.`,"share.others":`Mit anderen teilen`,"share.othersHint":`Mit einem Konto läuft der Wizard auch auf engenty.ai: ein Link, ein QR-Code und ein Tag für deine Website – für alle, auch wenn dein Computer aus ist.`,"share.details":`Details`,"teaser.website":`Eine Website braucht einen Link, den jeder erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann steht hier der Tag für deine Seite.`,"teaser.qr":`Ein QR-Code braucht einen Link, den jedes Handy erreicht. Mit einem Konto läuft der Wizard auch auf engenty.ai – dann stehen hier der QR-Code und die ID für die App.`,"teaser.link":`Dieser Link geht nur auf diesem Computer, solange die App läuft. Mit einem Konto läuft der Wizard auch auf engenty.ai – mit einem Link für alle.`,"teaser.models":`Ohne eigenen API Key: mit einem Konto laufen Text, Bilder und Videos über Guthaben.`,"teaser.connect":`Konto verbinden`,"teaser.modelsLinked":`Oder über das Guthaben deines Kontos: unter Modelle „Guthaben des Kontos“ wählen.`,"share.open":`Öffnen`,"share.qr":`QR-Code`,"share.qrHint":`Mit der Kamera des Handys scannen: der Wizard öffnet sich, in der App engenty wizards, wenn sie installiert ist.`,"share.code":`ID für die App:`,"share.readOnly":`Ob der Link aktiv ist und wie viele Durchläufe er am Tag zulässt, stellst du in deiner lokalen Installation ein.`,"embed.inline":`In der Seite`,"embed.modal":`Button + Fenster`,"embed.inlineHint":`Füge das Tag in den HTML-Code deiner Seite ein. Der Wizard erscheint an dieser Stelle.`,"embed.modalHint":`Füge das Tag in den HTML-Code deiner Seite ein. An dieser Stelle erscheint ein Button, der den Wizard in einem Fenster öffnet.`,"type.page":`Seite`,"type.agent":`KI-Schritt`,"type.generate":`Erzeugen`,"type.surface":`Ansicht`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Prüfen`,"type.result":`Ergebnis`,"run.start":`Los geht's`,"run.closed":`Hier gerade nicht verfügbar, dafür fehlt: {list}`,"slot.later":`Spätere Termine zeigen`,"slot.none":`Gerade sind keine Termine frei.`,"run.cls.text":`Text`,"run.cls.image":`Bilder`,"run.cls.video":`Videos`,"run.cls.speech":`Sprachausgabe`,"run.cls.audio":`Sprachnotizen`,"run.next":`Weiter`,"run.back":`Zurück`,"run.accept":`Passt so`,"run.regenerate":`Neue Variante`,"run.edit":`Bearbeiten`,"run.resume":`Letzten Durchlauf fortsetzen`,"run.regenerateNote":`Was soll anders werden?`,"run.pickItem":`Nr. {n}`,"run.pickedItem":`Nr. {n} neu`,"run.regeneratePicked":`Neu erstellt wird nur Nr. {n}.`,"run.regenerateAll":`Alle werden neu erstellt. Tippe oben auf eine Nummer, um nur einzelne zu erneuern.`,"check.progress":`{done} von {total} geprüft`,"check.onlyOpen":`Nur offene`,"check.noFile":`Zu dieser Zeile gibt es keine Datei.`,"check.noPreview":`Für diese Datei gibt es keine Vorschau – öffne sie mit dem Link oben.`,"check.reopen":`Wieder offen`,"market.search":`Vorlage suchen …`,"market.all":`Alle`,"market.industry":`Branche`,"market.format":`Ergebnis`,"market.capability":`Fähigkeit`,"market.unavailable":`nicht eingerichtet`,"market.without":`Geht auch ohne: {list}`,"market.optional":`nicht eingerichtet, geht auch ohne`,"market.optionalHint":`Läuft hier ohne {list}: Antworten, die das bräuchten, sind im Wizard gesperrt. Einrichten unter Modelle.`,"market.missing":`Hier nicht eingerichtet: {list}`,"market.plan":`Paket`,"market.pro":`Pro`,"market.proHint":`Braucht Plugins, die mit Pro auf engenty.ai dabei sind`,"market.needsPro":`Mit Pro: braucht {list}`,"market.needsProHint":`Diese Vorlage braucht {list}. Die Plugins sind mit Pro und Team auf engenty.ai dabei.`,"market.missingHint":`Dafür fehlt hier ein Modell: {list}. Richte es unter Modelle ein.`,"market.none":`Keine Vorlage passt zu dieser Auswahl.`,"market.notFound":`Diese Vorlage gibt es nicht (mehr).`,"market.star":`Merken`,"market.starred":`Gemerkt`,"market.starHint":`Gemerkte Vorlagen liegen auf diesem Rechner auch ohne Verbindung bereit.`,"market.fromPlugin":`Kommt mit dem Plugin „{name}“`,"market.noneStarred":`Du hast noch keine Vorlage gemerkt.`,"market.offline":`Keine Verbindung zum Marktplatz: du siehst die Vorlagen, die hier bereitliegen.`,"market.more":`Mehr anzeigen`,"market.reset":`Auswahl zurücksetzen`,"market.count":`{n} Vorlagen`,"market.countOf":`{n} von {all} Vorlagen`,"market.countOfShort":`{n} von {all}`,"market.resetShort":`Zurücksetzen`,"market.minutes":`~ {n} Min.`,"market.credits":`~ {n} Credits pro Lauf`,"market.needsUpdate":`Braucht eine neuere App`,"market.needsUpdateHint":`Diese Vorlage nutzt Funktionen, die deine App noch nicht kennt. Aktualisiere die App, dann kannst du sie verwenden.`,"market.use":`Mit dieser Vorlage starten`,"market.steps":`So läuft der Wizard ab`,"market.duration":`Dauer`,"market.durationHint":`vom Start bis zum Ergebnis, mit {n} Angaben von dir`,"market.result":`Ergebnis`,"market.creditsRange":`~ {n} Credits`,"market.creditsHint":`pro Lauf geschätzt, selten mehr als das Doppelte`,"market.needs":`Braucht`,"market.cost":`Kosten`,"new.forWebsite":`Kleine Helfer für deine Website`,"run.feedbackPlaceholder":`Passt etwas nicht? Schreib, was anders sein soll …`,"run.feedbackTarget":`Was soll sich ändern?`,"run.feedbackPick":`Wähle oben, was sich ändern soll.`,"ai.generated":`KI-generiert`,"ai.modified":`Mit KI verändert`,"ai.publish":`Mit KI erstellt: Wer das veröffentlicht, muss es als KI-generiert kennzeichnen (EU AI Act, Art. 50). Die Datei trägt die Kennzeichnung bereits in ihren Metadaten.`,"run.regenerateGo":`Neu erstellen`,"run.retry":`Erneut versuchen`,"run.again":`Nochmal`,"run.download":`Herunterladen`,"run.copy":`Text kopieren`,"run.failed":`Da hat etwas nicht geklappt.`,"run.unavailable":`Dieser Wizard ist gerade nicht verfügbar.`,"run.notFound":`Diesen Wizard gibt es nicht (mehr).`,"run.madeWith":`Erstellt mit engenty wizards`,"run.working":`Einen Moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Abgebrochen.`,"run.addRow":`Zeile hinzufügen`,"run.upload":`Datei wählen oder hierher ziehen`,"run.uploading":`Lädt hoch …`,"run.required":`Pflichtfeld`,"run.net":`Netto`,"run.vat":`USt. {r} %`,"run.total":`Gesamt`,"settings.title":`Einstellungen`,"settings.name":`Name`,"settings.mcp":`Verbundene Systeme (MCP)`,"settings.mcpHint":`KI-Schritte können in diese Systeme schreiben oder daraus lesen – nur, wenn du sie im Schritt freigibst.`,"settings.addServer":`System verbinden`,"settings.serverName":`Name`,"settings.serverUrl":`MCP-URL`,"settings.serverHeader":`Authorization-Header (optional)`,"settings.save":`Speichern`,"settings.saved":`Gespeichert`,"settings.delete":`Space löschen`,"settings.noProject":`Hier erscheint dein Space, sobald deine lokale Installation den ersten Wizard veröffentlicht hat.`,"settings.copy":`Kopieren`,"settings.copied":`Kopiert`,"settings.lastUsed":`zuletzt {when}`,"settings.neverUsed":`noch nie benutzt`,"settings.revoke":`Schlüssel löschen`,"mcp.appsDisconnect":`Austragen`,"plugins.title":`Plugins`,"plugins.hint":`Plugins erweitern diese App um Seiten, Einstellungen und Werkzeuge für Schritte. Sie laufen mit allen Rechten der App: installiere nur, was du kennst.`,"plugins.hintManaged":`Diese Plugins sind für dein Konto freigeschaltet.`,"plugins.reload":`Neu laden`,"plugins.rescan":`Neu suchen`,"plugins.tools":`Werkzeuge für Schritte`,"plugins.serverFailed":`Der Server-Teil hat nicht geladen: {error}`,"plugins.studioFailed":`Der Studio-Teil hat nicht geladen: {error}`,"plugins.problems":`Kein Plugin`,"plugins.crashed":`Dieser Teil eines Plugins ist abgestürzt.`,"plugins.none":`Keine eigenen Plugins installiert.`,"pro.title":`Pro-Module`,"pro.hint":`Module, die dein Paket (Pro, Team) enthält, hier auf deinem Rechner. Sie kommen von deinem engenty-Konto, sind von engenty signiert und bleiben an, solange dein Paket sie enthält – ohne Internet bis zu einer Woche.`,"pro.check":`Paket prüfen`,"pro.notLinked":`Verbinde dein engenty-Konto (Einstellungen → Konto), um die Module deines Pakets hier zu nutzen.`,"pro.plan":`Paket: {plan}`,"pro.confirmedUntil":`bestätigt bis {date}`,"pro.plans":`Pakete`,"pro.on":`Aktiv`,"pro.notInPlan":`Nicht in deinem Paket`,"pro.install":`Installieren`,"pro.update":`Aktualisieren`,"pro.remove":`Entfernen`,"pro.none":`Für diese Version ({runtime}) gibt es noch keine Pro-Module.`,"pro.held.plan":`Nicht in deinem Paket`,"pro.held.release":`Wird für diese Version neu geladen`,"pro.held.unconfirmed":`Paket nicht bestätigt – online prüfen`,"mcp.notReverse":`Nicht verwechseln mit „Verbundene Systeme (MCP)“ unter Connectors: Dort ruft engenty andere Server auf, hier ruft dein Client engenty auf.`,"integrate.nav":`Einbinden`,"integrate.groupApps":`KI-Apps`,"integrate.groupShare":`Teilen`,"integrate.shareLink":`Per Link teilen`,"integrate.shareSite":`In eine Website einbinden`,"integrate.soon":`bald`,"integrate.stateWorks":`funktioniert`,"integrate.stateConnected":`eingetragen`,"integrate.stateInstalled":`auf diesem Computer`,"integrate.kindMcp":`Werkzeuge im Chat: Wizards finden, starten, ausfüllen – und bauen.`,"integrate.kindMcpShort":`Werkzeuge im Chat`,"integrate.kindAppShort":`der Wizard als Widget`,"integrate.kindAppNoShort":`zeigt diese App nicht`,"integrate.kindApp":`Der Wizard selbst im Chat, Seite für Seite, als Widget.`,"integrate.kindAppNo":`Zeigt diese App nicht – ein Lauf kommt als Text.`,"integrate.where":`Wo läuft die App?`,"integrate.here":`Auf diesem Computer`,"integrate.hereHint":`Ein Klick, kein Schlüssel. Die App startet engenty wizards selbst.`,"integrate.hereManaged":`Nur mit engenty wizards auf deinem Computer.`,"integrate.address":`Über die Adresse`,"integrate.addressHint":`Von überall, wo die Adresse erreichbar ist – mit Schlüssel.`,"integrate.connectTitle":`Eintragen`,"integrate.connectHint":`Trägt engenty wizards in die Einstellungen von {app} ein.`,"integrate.connect":`In {app} eintragen`,"integrate.connected":`In {app} eingetragen`,"integrate.notInstalled":`{app} ist auf diesem Computer nicht zu finden. Eintragen geht trotzdem – es wirkt, sobald {app} da ist.`,"integrate.file":`In {file} eintragen:`,"integrate.vscode":`In VS Code: „MCP: Open User Configuration“, dann eintragen:`,"integrate.chatgpt":`In ChatGPT: Einstellungen → Apps & Connectors → Erweitert → Entwicklermodus, dann „Erstellen“ mit dieser Adresse:`,"integrate.generic":`In den MCP-Einstellungen der App einen Server mit dieser Adresse anlegen (Streamable HTTP):`,"integrate.oauthLocal":`Diese App verbindet sich von den Servern ihres Herstellers aus – diesen Computer erreicht sie nicht. Nimm hier „Auf diesem Computer“ oder eine App, die hier läuft.`,"integrate.test":`Testen`,"integrate.seen":`{app} meldet sich`,"integrate.restart":`Beende {app} ganz und starte es neu – dann meldet es sich hier.`,"integrate.reload":`Lade die MCP-Server in {app} neu oder starte es neu.`,"integrate.tool":`Ein Werkzeug aufgerufen`,"integrate.askHint":`Schreib in {app} in einem neuen Chat:`,"integrate.askTool":`Welche Wizards habe ich in engenty?`,"integrate.widget":`Wizard als Widget gezeigt`,"integrate.widgetHint":`Starte einen veröffentlichten Wizard:`,"integrate.askWidget":`Starte einen meiner engenty Wizards.`,"integrate.works":`{app} arbeitet mit deinen Wizards.`,"mcp.notHere":`Geht mit diesem Server nicht`,"mcp.needsPublic":`claude.ai verbindet sich von Anthropics Servern aus. Das geht nur, wenn dieser Server öffentlich über HTTPS erreichbar ist.`,"mcp.keyTitle":`Schlüssel erstellen`,"mcp.keyHint":`Mit dem Schlüssel meldet sich dein Client an. Er wird nur einmal angezeigt und steht dann gleich im Befehl im nächsten Schritt.`,"mcp.keyCreate":`Schlüssel für {client} erstellen`,"mcp.keyReady":`Schlüssel erstellt – er steht schon im Befehl unten.`,"mcp.keyFirst":`Erst den Schlüssel erstellen – dann steht hier der fertige Befehl.`,"mcp.add":`Server eintragen`,"mcp.terminal":`Im Terminal ausführen:`,"mcp.ccPlugin":`Optional das Plugin – es bringt den Befehl /wizard mit:`,"mcp.codexKey":`Im Terminal ausführen – Codex liest den Schlüssel aus einer Umgebungsvariable:`,"mcp.claudeAi":`In claude.ai: Einstellungen → Konnektoren → Eigenen Konnektor hinzufügen, diese Adresse eintragen:`,"mcp.oauth":`Kein Schlüssel nötig: Beim ersten Aufruf meldet sich dein Client im Browser an.`,"mcp.addressPublic":`Öffentlich erreichbar.`,"mcp.addressLocal":`Nur auf diesem Rechner erreichbar, und nur solange engenty wizards läuft.`,"mcp.keys":`Schlüssel`,"mcp.keysHint":`Jeder Schlüssel meldet einen Client an und hat alle Rechte – behandle ihn wie ein Passwort. Löschst du ihn, ist der Client abgemeldet.`,"editor.viaClient":`Über {client}`,"editor.changedVia":`Geändert über {client}`,"editor.merged":`Mit Änderungen von außen zusammengeführt`,"run.uploadMore":`Weitere Datei`,"run.camera":`Kamera`,"camera.title":`Mit der Kamera aufnehmen`,"camera.hint":`Gerade und gut beleuchtet ins Bild halten.`,"camera.taken":`{n} aufgenommen`,"camera.shoot":`Aufnehmen`,"camera.done":`Fertig`,"camera.denied":`Die Kamera ist für diese Seite nicht freigegeben. Erlaube sie in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder nimm das Foto mit der Kamera-App auf.`,"connect.go":`Verbinden`,"connect.connected":`Verbunden über {name}`,"connect.disconnect":`Trennen`,"connect.none":`Auf diesem Server ist noch kein Anbieter zum Verbinden eingerichtet.`,"connect.openLink":`Hier klicken, um die Anmeldung in einem neuen Tab zu öffnen`,"list.empty":`Noch keine Einträge.`,"list.delete":`Zeile löschen`,"ask.typeInto":`Text in die Seite tippen …`,"ask.hide":`verdeckt`,"ask.up":`Nach oben`,"ask.down":`Nach unten`,"ask.pictureHint":`Das ist die Seite, die der Wizard geöffnet hat. Du kannst auch direkt ins Bild klicken und tippen.`,"ask.remember":`Anmeldung für nächstes Mal merken`,"ask.private":`Was du eingibst, geht direkt in die Seite. Die KI bekommt es nicht zu sehen. Gemerkte Anmeldungen werden verschlüsselt gespeichert.`,"ask.skip":`Überspringen`,"ask.done":`Ich bin angemeldet`,"ask.signIn":`Anmelden`,"ask.wants":`Der Wizard möchte in {service} Folgendes ausführen:`,"ask.allowRest":`Für den Rest dieses Durchlaufs erlauben`,"ask.allow":`Erlauben`,"ask.deny":`Nicht erlauben`,"store.open":`Was dieser Wizard sich merkt`,"store.title":`Gespeichert für dich`,"store.explain":`Dieser Wizard merkt sich Listen, Dateien und verbundene Konten für deinen nächsten Durchlauf. Nur du siehst sie.`,"store.empty":`Noch nichts gespeichert.`,"store.rows":`{n} Einträge`,"store.signIns":`Gemerkte Anmeldungen im Browser`,"store.files":`{n} Dateien · {size}`,"store.delete":`Alles löschen`,"store.confirmDelete":`Wirklich alles löschen`,"common.close":`Schließen`,"composer.send":`Senden`,"dictation.settings":`Mikrofon und Aufnahme`,"dictation.microphone":`Mikrofon`,"dictation.default":`Standard des Systems`,"dictation.mic":`Mikrofon {n}`,"dictation.showMics":`Namen der Mikrofone zeigen …`,"dictation.hold":`Halten zum Aufnehmen`,"dictation.holdToTalk":`Zum Sprechen gedrückt halten`,"date.pick":`Datum wählen`,"time.pick":`Uhrzeit wählen`,"time.hour":`Stunde`,"time.minute":`Minute`,"date.pickRange":`Tag oder Zeitraum wählen`,"date.pickStart":`Ersten Tag wählen`,"date.pickEnd":`Letzten Tag wählen – oder denselben für einen Tag`,"date.today":`Heute`,"date.clear":`Leeren`,"date.prev":`Voriger Monat`,"date.next":`Nächster Monat`,"connectors.title":`Connectors`,"connectors.hint":`Dienste, in denen ein Wizard für die Person arbeiten kann – sie verbindet beim Durchlauf ihr eigenes Konto. Die wichtigsten sind eingebaut; jeden weiteren findest du im Verzeichnis integrations.sh und importierst ihn aus seiner OpenAPI-Beschreibung oder seinem MCP-Server.`,"connectors.imported":`Aus dem Verzeichnis`,"connectors.noneImported":`Hier ist kein Connector aus dem Verzeichnis importiert.`,"connectors.notSetUp":`nicht eingerichtet`,"connectors.setup":`Auf dem Server fehlen:`,"connectors.search":`Dienst suchen, z. B. Notion, Stripe, GitHub`,"connectors.find":`Suchen`,"connectors.none":`Nichts gefunden.`,"connectors.import":`Importieren`,"connectors.exists":`Schon importiert.`,"connectors.ownClient":`Eigener OAuth-Client`,"connectors.refresh":`Aktionen neu laden`,"connectors.remove":`Entfernen`,"connectors.actions":`{n} Aktionen, {r} lesend`,"connectors.pending":`Aktionen erscheinen, sobald ein Konto verbunden ist`,"connectors.needsClient":`Dieser Dienst braucht einen OAuth-Client (ID und Secret). Entfernen und mit „Eigener OAuth-Client“ neu importieren.`,"connectors.authNone":`ohne Anmeldung`,"connectors.authOauth":`Anmeldung per OAuth`,"connectors.authKey":`API-Schlüssel`,"connectors.group.read":`liest`,"connectors.group.write":`ändert`,"connectors.group.destructive":`löscht`,"run.uploadTouch":`Datei wählen`,"run.maxFiles":`Hier gehen höchstens {n} – die übrigen habe ich weggelassen.`,"run.filesMin":`{n} von mindestens {min}`,"run.filesOf":`{n} von höchstens {max}`,"run.moveFile":`Nr. {n} verschieben`,"run.moveFileHint":`Ziehen, um die Reihenfolge zu ändern`,"run.removeFile":`Entfernen`,"run.awake":`Der Bildschirm bleibt an, solange der Wizard arbeitet.`,"run.openFull":`Groß öffnen`,"run.yes":`Ja`,"run.no":`Nein`,"run.share":`Teilen`,"run.shareNow":`Jetzt teilen`,"run.shareFile":`Als Datei teilen oder in einer App öffnen`,"camera.asking":`Dein Browser fragt gleich nach der Kamera. Das Bild bleibt in diesem Wizard.`,"camera.missing":`An diesem Gerät wurde keine Kamera gefunden. Lade stattdessen ein Foto hoch.`,"camera.busy":`Die Kamera wird gerade von einer anderen App verwendet. Schließe sie und versuche es noch einmal.`,"camera.native":`Kamera-App öffnen`,"camera.pick":`Foto auswählen`,"camera.torch":`Licht`,"camera.flip":`Kamera wechseln`,"camera.photo":`Foto`,"camera.video":`Video`,"camera.record":`Aufnahme starten`,"camera.stop":`Aufnahme beenden`,"camera.recording":`Nimmt auf – tippe zum Beenden.`,"camera.clipHint":`Ein kurzer Clip, höchstens {s} Sekunden.`,"camera.hintMany":`Seite für Seite aufnehmen, dann „Fertig“.`,"scan.button":`Scannen`,"scan.title":`Code scannen`,"scan.asking":`Dein Browser fragt gleich nach der Kamera – sie liest nur den Code.`,"scan.hint":`Halte den QR- oder Strichcode in den Rahmen.`,"scan.hintQr":`Halte den QR-Code in den Rahmen. Strichcodes liest dieses Gerät hier nicht.`,"scan.miss":`Auf dem Foto war kein Code zu erkennen. Versuch es näher und schärfer.`,"scan.fromPhoto":`Foto mit dem Code wählen`,"scan.typeInstead":`Lieber eintippen`,"location.use":`Meinen Standort übernehmen`,"location.locating":`Standort wird bestimmt …`,"location.refining":`wird noch genauer …`,"location.accuracy":`auf etwa {m} m genau`,"location.map":`Karte`,"location.remove":`Standort entfernen`,"location.why":`Dein Browser fragt nach deinem Standort. Er wird nur für diesen Wizard verwendet. Du kannst auch einfach die Adresse eintippen.`,"location.denied":`Der Standort ist für diese Seite nicht freigegeben. Erlaube ihn in den Website-Einstellungen deines Browsers (Schloss-Symbol in der Adresszeile) – oder tippe die Adresse unten ein.`,"location.unavailable":`Dein Gerät konnte den Standort gerade nicht bestimmen. Versuch es im Freien noch einmal oder tippe die Adresse ein.`,"location.timeout":`Das hat zu lange gedauert. Versuch es noch einmal oder tippe die Adresse ein.`,"location.manual":`Adresse oder Ort eintippen`,"location.label":`Adresse oder Beschreibung des Orts`,"voice.start":`Sprachnotiz aufnehmen`,"voice.stop":`Stopp`,"voice.recording":`Aufnahme läuft …`,"voice.left":`noch {s} s`,"voice.again":`Neu aufnehmen`,"voice.remove":`Löschen`,"voice.pick":`Audiodatei wählen`,"voice.why":`Dein Browser fragt nach dem Mikrofon. Die Aufnahme wird danach in Text umgewandelt.`,"voice.denied":`Das Mikrofon ist für diese Seite nicht freigegeben. Erlaube es in den Website-Einstellungen deines Browsers – oder nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"voice.noRecorder":`Dieser Browser kann hier nicht aufnehmen. Nimm die Notiz mit der Diktier-App auf und wähle die Datei.`,"sign.open":`Hier unterschreiben`,"sign.hint":`Mit dem Finger unterschreiben`,"sign.pad":`Unterschriftsfeld`,"sign.clear":`Löschen`,"sign.accept":`Übernehmen`,"sign.again":`Neu unterschreiben`,"sign.remove":`Unterschrift entfernen`,"notify.ask":`Bescheid geben, wenn es fertig ist`,"notify.on":`Du bekommst Bescheid`,"notify.why":`Mit Ton, Vibration oder einer Mitteilung. Dein Browser fragt dafür einmal um Erlaubnis.`,"notify.onHint":`Du kannst die App wechseln – eine Mitteilung holt dich zurück.`,"notify.quiet":`Mit Ton und Vibration, solange diese Seite offen ist.`,"notify.blocked":`Mitteilungen sind für diese Seite blockiert – es gibt Ton und Vibration, solange sie offen ist. Erlauben kannst du sie in den Website-Einstellungen deines Browsers.`,"notify.done":`Dein Ergebnis ist fertig.`,"notify.next":`Es geht weiter – wirf einen Blick darauf.`,"notify.needsYou":`Der Wizard braucht dich kurz.`,"install.add":`Zum Startbildschirm hinzufügen`,"install.ios":`Tippe unten auf „Teilen“ und dann auf „Zum Home-Bildschirm“.`,"install.bookmark":`Als Lesezeichen speichern`,"install.bookmark.mac":`Drücke ⌘ D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.bookmark.pc":`Drücke Strg + D, dann liegt dieser Wizard in deinen Lesezeichen.`,"install.app":`In der App öffnen`,"install.app.offer":`Installiere das Studio als App: eigenes Fenster, eigenes Symbol im Dock oder in der Taskleiste.`,"install.app.browser":`In Chrome oder Edge lässt sich das Studio als App installieren: eigenes Fenster, eigenes Symbol.`,"install.app.action":`Als App installieren`,"install.app.close":`Schließen`,"common.offline":`Keine Verbindung. Prüfe dein Netz und versuch es noch einmal.`,"common.retry":`Erneut versuchen`,"common.cancel":`Abbrechen`,"common.loading":`Lädt …`,"common.error":`Fehler`,"data.hint":`Tabellen und Seiten, die der Space und seine Wizards behalten.`,"data.all":`Alle Daten`,"data.own":`Allgemein`,"data.table":`Tabelle`,"data.page":`Seite`,"data.newTable":`Neue Tabelle`,"data.newPage":`Neue Seite`,"data.title":`Titel`,"data.owner":`Gehört zu`,"data.create":`Anlegen`,"data.empty":`Noch keine Tabellen und Seiten. Leg eine an – bald schreiben auch deine Wizards hier.`,"data.rows":`{n} Zeilen`,"data.addRow":`Zeile`,"data.noRows":`Noch keine Zeilen.`,"data.deleteRow":`Zeile löschen`,"data.deleteTable":`Tabelle löschen`,"data.deletePage":`Seite löschen`,"data.confirmDelete":`„{title}“ löschen?`,"data.newColumn":`Neue Spalte`,"data.columnName":`Name`,"data.columnType":`Typ`,"data.required":`Muss ausgefüllt werden`,"data.deleteColumn":`Spalte löschen`,"data.removeOption":`Entfernen`,"data.fromList":`Eine Liste des Wizards: jeder Durchlauf schreibt hier hinein. Die Spalten kommen aus dem Wizard.`,"data.badCell":`Dieser Wert passt nicht in „{column}“ und ist nicht gespeichert.`,"data.type.text":`Text`,"data.type.number":`Zahl`,"data.type.date":`Datum`,"data.type.duration":`Dauer`,"data.type.select":`Auswahl`,"data.type.boolean":`Ja / Nein`,"data.text.single":`Eine Zeile`,"data.text.multiline":`Mehrere Zeilen`,"data.number.integer":`Ganze Zahl`,"data.number.decimal":`Dezimalzahl`,"data.number.percent":`Prozent`,"data.number.currency":`Betrag`,"data.currency":`Währung (z. B. EUR)`,"data.date.date":`Datum`,"data.date.datetime":`Datum und Uhrzeit`,"data.date.time":`Uhrzeit`,"data.unit":`Eingabe in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`Sekunden`,"data.unit.minutes":`Minuten`,"data.unit.hours":`Stunden`,"data.unit.days":`Tage`,"data.options":`Auswahlmöglichkeiten, eine je Zeile`,"data.multiple":`Mehrere wählbar`,"data.write":`Schreiben`,"data.preview":`Vorschau`,"data.pageEmpty":`Diese Seite ist noch leer.`,"data.markdownHint":`Markdown: # Überschrift, **fett**, - Liste`,"space.info":`Info & Marke`,"space.knowledge":`Wissen`,"space.data":`Daten`,"space.results":`Ergebnisse`,"space.resultsAll":`Alle Ergebnisse`,"space.resultsHint":`Läufe deiner Wizards, die ihr Ergebnis erreicht haben, die neuesten zuerst.`,"space.resultsEmpty":`Noch keine Ergebnisse. Ein Lauf steht hier, sobald er fertig ist.`,"space.resultCredits":`{n} Credits`,"space.resultsSearch":`Suchen: Wizard, Eingaben, Ergebnis …`,"space.resultsModeAll":`Live & Test`,"space.resultsAnyTime":`Jederzeit`,"space.resultsDay":`Letzte 24 Stunden`,"space.resultsDays":`Letzte {n} Tage`,"space.resultsNone":`Keine Ergebnisse zu dieser Suche.`,"space.resultFiles":`{n} Dateien`,"project.rename":`Space umbenennen`,"project.saving":`Speichert …`,"project.base":`Basis`,"project.baseHint":`Wer hinter den Wizards steht. Jeder KI-Schritt kennt das.`,"project.title":`Titel`,"project.titleHint":`Firma, Marke oder Vorhaben – so sehen es auch Endnutzer.`,"project.about":`Über`,"project.aboutHint":`Was ihr macht, für wen, und in welchem Ton ihr schreibt.`,"project.logos":`Logos`,"project.logosHint":`Das erste Logo sehen Endnutzer. Eine Beschreibung sagt, wofür eine Variante gedacht ist.`,"project.logoAdd":`Logo`,"project.logoMain":`Hauptlogo`,"project.logoMakeMain":`Als Hauptlogo`,"project.colors":`Farben`,"project.colorsHint":`Die erste Farbe ist der Akzent in Dokumenten, Dashboards und auf öffentlichen Seiten.`,"project.colorAdd":`Farbe`,"project.colorName":`z. B. Primär – Buttons und Überschriften`,"project.colorUse":`Beschreibe, wie engenty diese Farbe einsetzen soll.`,"project.colorAddTitle":`Farbe hinzufügen`,"project.colorValue":`Farbwert`,"project.colorUseLabel":`Verwendung`,"project.add":`Hinzufügen`,"project.colorAccent":`Akzent`,"project.colorFirst":`Als Akzent`,"project.assets":`Assets`,"project.assetsHint":`Bilder, Grafiken, Videos. KI-Schritte setzen sie in Dokumente und wählen nach der Beschreibung.`,"project.assetAdd":`Dateien`,"project.assetSearch":`Assets filtern …`,"know.all":`Alles`,"know.title":`Wissen`,"know.hint":`Was die Schritte deiner Wizards nachschlagen. Dokumente werden beim Hochladen zu Seiten und Tabellen; Kategorien halten die Einträge auseinander.`,"know.empty":`Noch nichts da. Lade Dokumente hoch, leg eine Seite an oder gib dem Assistenten eine Website.`,"know.drop":`Dokumente hierher ziehen oder`,"know.pick":`auswählen`,"know.page":`Seite`,"know.table":`Tabelle`,"know.faq":`FAQ`,"know.file":`Datei`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`Neue Seite`,"know.newTable":`Neue Tabelle`,"know.asFaq":`Als FAQ: Frage und Antwort je Zeile`,"know.newCategory":`Neue Kategorie`,"know.search":`Suche testen …`,"know.searchNone":`Nichts Relevantes gefunden.`,"know.searchStats":`{candidates} Kandidaten geprüft, {hits} relevant`,"know.searchUnchecked":`{hits} Treffer, ungeprüft`,"know.unchecked":`Ohne Classifier bleiben Treffer ungeprüft. Er braucht einen AI-Gateway- oder TypeSafe-Key oder ein Konto.`,"know.keywordsOnly":`Ohne Embedding-Modell findet die Suche nach Wörtern, nicht nach Bedeutung.`,"know.clear":`Zurücksetzen`,"know.sub":`{n} Unterseiten`,"know.rows":`{n} Zeilen`,"know.review":`Prüfen`,"know.reviewed":`Geprüft`,"know.from":`Aus {label}`,"know.kept":`Von Hand geändert: {label} schreibt sie nicht mehr.`,"know.original":`Original`,"know.reading":`Wird gelesen …`,"know.subPages":`Unterseiten`,"know.addSub":`Unterseite`,"know.type.choice":`Auswahl`,"know.type.date":`Datum`,"know.type.number":`Zahl`,"know.type.text":`Text`,"know.type.boolean":`Ja / Nein`,"know.name":`Name`,"know.type":`Typ`,"know.unit":`Einheit`,"know.unitHint":`z. B. h, €, kg`,"know.multiple":`Mehrere Werte je Eintrag`,"know.ordered":`Die Werte sind gestuft (niedrig → hoch)`,"know.values":`Werte`,"know.valuesHint":`Einer je Zeile. Weitere kommen mit den Einträgen dazu.`,"know.hintField":`Woher die Werte kommen`,"know.hintFieldHint":`Kurz, z. B. Kopfzeile, Dateiname, Filter der Website.`,"know.create":`Anlegen`,"know.proposed":`Vorgeschlagen`,"know.proposedHint":`Erst übernommen wird sie gefüllt.`,"know.accept":`Übernehmen`,"know.dismiss":`Verwerfen`,"know.alike":`„{a}“ und „{b}“ sehen nach einem Wert aus.`,"know.merge":`Zusammenführen`,"know.items":`{n} Einträge`,"know.item":`1 Eintrag`,"know.row":`1 Zeile`,"know.oneSub":`1 Unterseite`,"know.addValue":`Wert hinzufügen`,"know.range":`{min} bis {max}`,"know.summary":`Übersicht`,"know.summaryHint":`Ein Modell fasst die Einträge dieses Werts zusammen. Die Suche findet die Übersicht wie eine Seite.`,"know.summaryWrite":`Übersicht schreiben`,"know.summaryAgain":`Neu schreiben`,"know.summaryEmpty":`Noch keine Übersicht.`,"know.toc":`Inhaltsverzeichnis`,"know.tocRows":`{n} Zeilen in {table}`,"know.deleteCategory":`Kategorie löschen`,"know.confirmCategory":`„{name}“ löschen? Die Einträge bleiben, nur die Kategorie geht.`,"know.deleteValue":`Wert löschen`,"know.yes":`Ja`,"know.no":`Nein`,"know.minimum":`ab`,"know.maximum":`bis`,"know.contains":`enthält`,"know.by.person":`von Hand gesetzt`,"know.by.origin":`aus der Quelle`,"know.by.model":`von einem Modell gelesen`,"know.remove":`Entfernen`,"know.unset":`Nicht gesetzt`,"know.deleteFile":`Datei löschen`,"project.documents":`Dokumente`,"project.documentsHint":`PDFs, Listen, Excel, Word, Text. Sie werden gelesen und kommen in einen Index, den jeder KI-Schritt durchsucht.`,"project.documentAdd":`Dokumente`,"project.drop":`Hierher ziehen oder`,"project.staysLocal":`Bleibt in deiner lokalen Installation und wird nicht hierher gesendet.`,"project.description":`Beschreibung hinzufügen …`,"project.describing":`Wird angesehen …`,"project.reading":`Wird gelesen …`,"project.indexed":`Im Index`,"project.indexedKeywords":`Im Index (Stichwörter)`,"project.notIndexed":`Kein Text gefunden`,"project.reindex":`Neu einlesen`,"project.pages":`{n} Seiten`,"project.keywordsOnly":`Der Index sucht gerade nach Stichwörtern. Mit einem AI-Gateway- oder OpenAI-Schlüssel kommt die Suche nach Bedeutung dazu.`,"project.preview":`Vorschau`,"project.viewList":`Als Liste zeigen`,"project.viewCards":`Als Karten zeigen`,"project.original":`Original`,"project.readText":`Gelesener Text`,"project.openOriginal":`Original öffnen`,"project.noText":`Noch kein Text: das Dokument wird gerade gelesen oder ließ sich nicht lesen.`,"project.textCut":`Die Vorschau zeigt den Anfang ({shown} von {total} Zeichen).`,"project.searchTest":`Im Index suchen …`,"project.searchNone":`Nichts gefunden.`,"project.remove":`Entfernen`,"project.removeConfirm":`„{name}“ entfernen?`,"project.facts":`Fakten`,"project.factsHint":`Was Wizards wissen sollen: Adresse, UID, Öffnungszeiten – alles, was passt.`,"project.factLabel":`Bezeichnung`,"project.factValue":`Wert`,"project.factAdd":`Eintrag`,"project.factType":`Typ`,"project.factAuto":`Automatisch`,"project.type.text":`Text`,"project.type.longtext":`Langer Text`,"project.type.number":`Zahl`,"project.type.date":`Datum`,"project.type.url":`Link`,"project.type.email":`E-Mail`,"project.type.phone":`Telefon`,"project.type.boolean":`Ja / Nein`,"project.yes":`Ja`,"project.no":`Nein`,"project.assistant":`Assistent`,"project.assistantTitle":`Erzähl mir von euch`,"project.assistantHello":`Nenn mir eure Website oder gib mir Dateien. Ich trage ein, was ich finde: Titel, Beschreibung, Logo, Farben und Fakten.`,"project.assistantComposer":`z. B. „Lies unsere Website example.at“ …`,"project.assistantTitleKnowledge":`Was sollen deine Wizards wissen?`,"project.assistantHelloKnowledge":`Gib mir Dokumente oder sag mir, wo das Wissen steht. Ich lese es ein – unten siehst du, was hineinkommt.`,"project.assistantComposerKnowledge":`Dokumente anhängen oder sagen, wo das Wissen steht …`,"project.assistantChanged":`Space aktualisiert`,"flowApp.loading":`Der Wizard kommt …`,"flowApp.draft":`Entwurf`,"flowApp.published":`Veröffentlicht`,"flowApp.issues":`{n} Fehler im Entwurf`,"flowApp.flow":`Ablauf`,"flowApp.notPublished":`Veröffentliche ihn im Studio, dann läuft er hier.`,"flowApp.runPage":`Im Browser weiter`,"flowApp.inBrowser":`Nur im Browser: {fields}`,"flowApp.done":`Fertig`,"flowApp.credits":`{n} Credits`,"flowApp.ask":`Der Wizard fragt`,"flowApp.allow":`Erlauben`,"flowApp.skip":`Überspringen`,"flowApp.signIn":`Eine Anmeldung bei {site} – das geht nur im Browser.`,"flowApp.fullscreen":`Größer`,"flowApp.inline":`Kleiner`,"flowApp.failed":`Das hat nicht geklappt: {error}`},Ux={"brand.tagline":`Build AI wizards, no code.`,"brand.sub":`Describe a flow in your own words. engenty turns it into a wizard you share with a link.`,"auth.dev":`Dev login (local)`,"auth.legal":`No password, no sign-up form — you sign in with an account you already have.`,"auth.signIn":`Sign in or create an account`,"auth.failed":`Sign-in did not work. Please try again.`,"auth.localLink":`Open the link the app printed at start — it signs you in on this device.`,"nav.account":`Account & credits`,"setup.keysInAccount":`API keys for scripts belong to your account. You create and revoke them there.`,"setup.openAccount":`Open account`,"class.label":`Model class`,"class.classifier":`Classifier`,"class.standard":`Standard`,"class.high":`High`,"class.highest":`Highest`,"class.image":`Image`,"class.video":`Video`,"class.audio":`Audio`,"class.speech":`Speech`,"class.classifier.hint":`Routing, yes/no, pulling a few values out of text. Cheapest.`,"class.standard.hint":`Short copy, calling an API, reformatting.`,"class.high.hint":`Research with tools, long documents, weighing many sources.`,"class.highest.hint":`Hard reasoning or code. Several times the cost of High.`,"class.effort":`Thinking effort`,"class.effortAuto":`Automatic`,"class.effort.low":`Low`,"class.effort.medium":`Medium`,"class.effort.high":`High`,"estimate.step":`≈ {n} credits, rarely more than {high}`,"estimate.measured":`measured from the latest runs`,"estimate.formula":`estimated, gets exact after five runs`,"estimate.share":`A run costs about {run} credits. At the daily limit that is at most {day} credits a day.`,"local.title":`Models`,"local.accountWaiting":`Waiting for the sign-in in your browser …`,"local.accountFailed":`The account service cannot be reached right now.`,"local.accountExpired":`The sign-in has expired. Please sign in again.`,"local.sourceNeedsAccount":`This needs an account.`,"local.toAccount":`Go to Settings → Account`,"local.sourceOwn":`Own keys`,"local.keys":`Keys`,"local.keysHint":`One key is enough. Keys live in this device's keychain, never in the database.`,"local.keySet":`stored`,"local.keyEmpty":`not stored`,"local.keyRemove":`Remove`,"local.classes":`Model per class`,"local.classesHint":`A step names only the class. Here is which model serves it, e.g. anthropic/claude-haiku-4.5, openai:gpt-5.4-mini or ollama:qwen3.`,"local.save":`Save`,"local.saved":`Saved`,"local.chat":`The studio chat answers on`,"local.chatModels":`Model class Highest`,"local.chatClaude":`Claude subscription (Claude Code)`,"local.subscription":`With the subscription, the Claude Code installed on this device builds the wizard — on your sign-in there. Runs keep using keys or credits.`,"harness.hint":`Text thinks on the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Images, video and audio still need a key.`,"harness.hintImages":`Text and images come from the {name} installed on this device — on your {sub} and your sign-in there. No key needed. Video and audio still need a key.`,"harness.found":`{name} {version} found`,"harness.missing":`{name} is not installed on this device.`,"harness.install":`Or in your own terminal:`,"harness.installButton":`Install {name}`,"harness.installing":`{name} installs in the terminal below — it takes about a minute. Then you sign it in.`,"harness.installEnded":`The install ended, but {name} is not there. What it printed above says why.`,"harness.appHere":`The {app} app is on this computer: {name} signs in with the same {sub}.`,"harness.notInstalled":`not installed`,"harness.authSubscription":`Signed in with your {sub}.`,"harness.authKey":`Signed in with an API key from your shell — not the subscription. Sign in here so it runs on your {sub}.`,"harness.authNone":`Not signed in yet.`,"harness.signIn":`Sign in here`,"harness.signingIn":`The sign-in runs in the terminal below — your browser opens for it. The terminal closes once the sign-in is there.`,"harness.signInInteractive":`{name} starts below. Pick the sign-in with your {sub} there and sign in in the browser. The terminal closes once the sign-in is there.`,"harness.loginEnded":`The sign-in ended without {name} being signed in.`,"harness.sub.claude":`Claude subscription`,"harness.sub.codex":`ChatGPT subscription`,"harness.sub.gemini":`Google account`,"harness.sub.cursor":`Cursor subscription`,"harness.desc.claude":`On your Claude subscription — no key needed.`,"harness.desc.codex":`On your ChatGPT subscription — no key needed.`,"harness.desc.gemini":`On your Google account — no key needed.`,"harness.desc.cursor":`On your Cursor subscription — no key needed.`,"harness.ready":`signed in`,"local.recheck":`Check again`,"local.test":`Test`,"local.testHint":`One short call shows whether the way to the model is open.`,"local.testOk":`Answered in {s} s on {ref}: “{reply}”`,"local.testFailed":`The test did not work: {error}`,"models.groupCaps":`Capabilities`,"models.groupAccess":`Access`,"models.groupMore":`More providers`,"models.cap.text":`Text & reasoning`,"models.cap.text.hint":`Writes, summarizes, researches and decides – in almost every step.`,"models.cap.image":`Images`,"models.cap.image.hint":`Makes images: logos, product shots, illustrations.`,"models.cap.video":`Videos`,"models.cap.video.hint":`Makes short clips from text or from an image.`,"models.cap.speech":`Voice`,"models.cap.speech.hint":`Reads text aloud: voice-overs, audio versions, announcements.`,"models.cap.listening":`Voice notes`,"models.cap.listening.hint":`Understands speech and turns voice notes into text.`,"models.way.local":`Local model`,"models.way.credits":`Credits`,"models.way.creditsTeam":`Team credits`,"models.way.none":`not set up`,"models.who":`Who does it?`,"models.optSubscription":`Your subscription`,"models.optKey":`Own API key`,"models.optLocal":`Local model`,"models.optLocalNote":`Ollama on this computer`,"models.noteIncluded":`included in the plan`,"models.noteSignedOut":`not signed in`,"models.noteMissing":`not installed`,"models.noteKey":`API key stored`,"models.noteKeyShort":`key`,"models.noteSignedIn":`signed in`,"models.noteShellKey":`API key from the shell`,"models.optOther":`Other`,"models.optCreditsGroup":`engenty`,"models.noteNoKey":`API key missing`,"models.noteNeedsAccount":`needs an account`,"models.notePerImage":`≈ {n} credits per image`,"models.notePerSecond":`≈ {n} credits per second`,"models.notePer1k":`≈ {n} credits per 1000 characters`,"models.notePerMinute":`≈ {n} credits per minute`,"models.creditsAuto":`engenty picks: {model}`,"models.creditsAutoNone":`engenty picks the model`,"models.creditsPickHint":`Billed in credits – no API key of your own.`,"models.viaCredits":`{name} on engenty credits`,"models.viaCreditsHint":`No API key of your own, billed in credits.`,"models.viaCreditsNeedsAccount":`With an engenty account, billed in credits.`,"models.noteUsage":`credits by usage`,"models.model":`Model`,"models.modelCustom":`Another model …`,"models.textSimple":`Simple steps`,"models.textDemanding":`Demanding steps`,"models.perClass":`Adjust per class`,"models.manageKey":`{name} API key`,"models.key":`API key`,"models.keyFor":`{name} API key`,"models.keyGet":`Get a key from {name}`,"models.keySave":`Check and save`,"models.keyStored":`API key stored`,"models.keyNone":`No API key`,"models.keyCheck":`Check`,"models.keyReplace":`Replace`,"models.keyRemove":`Remove`,"models.keyOk":`The key works.`,"models.keyBad":`The key was not accepted.`,"models.keyWhereLocal":`The key stays on this device, never in the database.`,"models.keyWhereCloud":`The key is kept encrypted for the team. Nobody sees it again.`,"models.keyFallback":`Until the key is there, credits step in.`,"models.uses":`Used for`,"models.useFor":`Use`,"models.inUse":`in use`,"models.try":`Try it`,"models.try.text":`Test`,"models.try.image":`Make a test image`,"models.try.video":`Make a test clip`,"models.try.speech":`Hear a sample`,"models.try.listening":`Test listening`,"models.tryCost":`Costs like a real call.`,"models.tryCostVideo":`A 4-second clip – costs like a real one.`,"models.tryWait":`Generating …`,"models.tryWaitVideo":`A clip takes a minute or two …`,"models.tryOk":`In {s} s with {model}`,"models.tryHeard":`Heard: “{text}”`,"models.tryHeardNothing":`Nothing heard – the way is open.`,"models.tryFailed":`That did not work: {error}`,"models.creditsName":`engenty credits`,"models.creditsTeam":`Team credits`,"models.creditsLocalLead":`Step in where no subscription and no own API key is set up.`,"models.creditsCloudHint":`Everything without an own API key runs on the credits. Own keys come first and cost no credits.`,"models.creditsConnectTitle":`With an account`,"models.creditsLocalHint":`With an engenty account, credits step in where nothing of your own is set up – for videos without an own API key, say.`,"models.creditsConnect":`Connect an account`,"models.creditsFallback":`Credits step in`,"models.creditsFallbackOn":`What has no subscription and no own API key runs on the credits.`,"models.creditsFallbackOff":`Off: what has no subscription and no own API key does not run.`,"models.creditsOn":`Runs on credits`,"models.creditsNone":`Nothing runs on credits right now.`,"models.creditsTopUp":`Top up`,"models.creditsPicks":`engenty picks the model and bills in credits.`,"models.creditsModel":`Right now: {model}.`,"models.clientSignIn":`Sign-in`,"models.clientImages":`{name} makes images with your {sub} – no API key of your own.`,"models.clientNotChosen":`Text does not run on {name} right now.`,"models.ollamaHint":`Where Ollama runs and the model it serves.`,"models.readOnly":`Only the team's admins change its models.`,"models.viewAs":`Preview as`,"models.view.auto":`as it is`,"models.view.local":`local`,"models.view.linked":`local + account`,"models.view.cloud":`cloud studio`,"setup.title":`Setup`,"setup.sub":`Engenty can use your existing accounts on your computer.`,"setup.source":`Choose your Engine`,"setup.local":`Runs locally on this device.`,"setup.stage.connect":`Connect`,"setup.stage.test":`Test`,"setup.stage.done":`Done`,"setup.h.install":`Install {name}`,"setup.h.signIn":`Sign in to {name}`,"setup.h.keys":`Enter a key`,"setup.h.test":`One short test`,"setup.h.done":`Connected.`,"setup.ready":`All set.`,"setup.noHarness":`No AI client installed yet. Pick one — it installs right here — or enter your own keys.`,"setup.ownDesc":`AI Gateway, OpenAI, Anthropic or Ollama.`,"setup.recommended":`Recommended`,"setup.done":`Open the studio`,"setup.untilWorks":`The studio opens once the test works.`,"cloud.onPublish":`When you publish the wizard, the version also goes to your account's cloud and runs there behind a link of its own.`,"cloud.notSent":`This version is not in the cloud yet.`,"cloud.send":`Send now`,"cloud.resend":`Send again`,"cloud.again":`It is tried again at {when}.`,"cloud.sent":`Version {v} · sent {when}`,"cloud.notRunnable":`Version {v} does not run in the cloud.`,"cloud.keepsRunning":`Version {v} keeps running there.`,"cloud.nothingRuns":`So nothing runs there yet.`,"cloud.notes":`What runs differently in the cloud:`,"cloud.check":`What the cloud would lack for the wizard as it is now:`,"cloud.checkBlocking":`As it is now, the wizard would not run in the cloud:`,"cloud.documents":`The space's documents stay on this device. In the cloud the steps work without them.`,"cloud.stepName":`“{title}”`,"cloud.problem.sandbox":`The server has no machine for code. There it works without one.`,"cloud.problem.mcp":`The space's MCP servers are not on the server: {detail}.`,"cloud.problem.model":`The cloud has no model for this.`,"cloud.problem.connector":`The space lacks a connector in the cloud.`,"cloud.problem.invalid":`The server does not take the wizard like this.`,"cloud.spaceLimit":`Your account's cloud already holds the space of another install:`,"cloud.replace":`Replace that space`,"cloud.replaceConfirm":`Remove that space from the cloud? Its wizards and their links go from there. Then everything published here is sent.`,"cloud.noticeError":`Published here. This version did not arrive in the cloud — see below.`,"cloud.noticeNotRunnable":`Published here. This version does not run in the cloud — see below.`,"readonly.wizard":`This wizard comes from your local install and is changed there. What you publish there runs here.`,"readonly.project":`This space comes from your local install and is changed there.`,"readonly.server":`Nothing is built on this server. The wizards your local install publishes run here.`,"nav.wizards":`Wizards`,"nav.settings":`Settings`,"nav.project":`Space`,"account.title":`Account`,"account.hint":`What the app calls you and how to reach you.`,"account.initials":`Your initials in the menu at the top right: the first letters of your name.`,"account.name":`Name`,"account.nameHint":`It starts as this device's user name.`,"account.fromAccount":`Name and e-mail come from your account.`,"account.about":`About you`,"account.aboutHint":`Who you are and what you do.`,"account.email":`E-mail`,"account.phone":`Phone`,"account.connection":`engenty.ai`,"account.connectionHint":`Sign-in, credits and the cloud that runs your wizards for everyone.`,"account.profile":`Profile`,"account.local":`Local install`,"account.localText":`This app runs on your device and is not connected to an account. Wizards, the space and files stay here.`,"account.linked":`Connected`,"account.with":`With an account`,"account.withCredits":`Credits for the models where no AI client is installed. No API key needed.`,"account.withCloud":`What you publish also runs on engenty.ai, behind a public link, even when this device is off.`,"account.signIn":`Sign in`,"account.signInAgain":`Sign in again`,"account.new":`No account yet?`,"account.newHint":`A new account needs an invitation code. Enter it here and the sign-up page has it filled in.`,"account.code":`Invitation code`,"account.create":`Create account`,"account.credits":`Credits`,"account.topUp":`Top up`,"account.expires":`{n} credits valid until {date}`,"account.kind.start":`Starting credits`,"account.kind.monthly":`Monthly credits`,"account.kind.gift":`Gift`,"account.cloud":`What you publish here also runs on {host}.`,"account.look":`Appearance`,"account.lookHint":`Language and theme of the app in this browser.`,"nav.logout":`Sign out`,"nav.connected":`Connected to {host}`,"nav.expired":`Sign-in expired`,"nav.onlyHere":`Only on this computer`,"nav.local":`local`,"nav.language":`Language`,"nav.theme":`Theme`,"nav.credits":`{n} credits`,"footer.billing":`Credits`,"footer.usage":`Usage`,"footer.invoices":`Invoices`,"footer.account":`Account`,"about.version":`Version {v}`,"about.update.available":`Version {v} of engenty wizards is out.`,"about.update.install":`Update`,"about.update.installing":`Installing version {v} …`,"about.update.restarting":`Restarting with version {v} …`,"about.update.done":`Installed. Restart engenty wizards to use {v}.`,"about.update.failed":`The update failed. Logs: logs/update.log`,"about.update.notes":`What's new`,"about.changelog":`Changelog`,"about.changelogHint":`What changed from release to release.`,"about.changelogEmpty":`Nothing here yet.`,"about.unreleased":`Unreleased`,"about.breaking":`breaking`,"about.credits":`Open source`,"about.creditsHint":`engenty wizards and the open-source software it builds on.`,"about.creditsProduct":`engenty`,"about.creditsBuiltWith":`Built with`,"about.creditsDeps":`Direct dependencies`,"about.creditsDepsHint":`What the parts of this app include themselves, with version and license — without their own dependencies.`,"about.creditsShared":`Used by more than one part`,"about.search":`Search …`,"about.noMatches":`No matches.`,"theme.dark":`Dark theme`,"theme.light":`Light theme`,"home.title":`Your wizards`,"home.new":`New wizard`,"home.import":`Import`,"import.failed":`The import did not work`,"home.empty":`No wizards in this space yet.`,"home.live":`Live`,"home.draft":`Draft`,"where.here":`Local`,"where.hereVersion":`Local · version {v}`,"where.hereHint":`Runs only on this computer, while the app is running.`,"where.liveHint":`Runs on {host}, for everyone with the link.`,"where.liveAt":`Live on {host} · version {v}`,"where.note":`1 note`,"where.notes":`{n} notes`,"where.sending":`Being sent`,"where.missing":`Not in the cloud`,"home.steps":`{n} steps`,"home.newProject":`New space`,"home.projectName":`Space name`,"home.projectLimit":`At most {n} spaces`,"team.title":`Team`,"team.hint":`Who is in the team and which plan it is on. Inviting and managing happens in the account.`,"team.plan":`Plan`,"team.planFree":`Free`,"team.seats":`{taken} of {limit} seats`,"team.seatsUnlimited":`Unlimited seats`,"team.members":`Members`,"team.invited":`invited`,"team.you":`you`,"team.manage":`Manage members`,"team.changePlan":`See plans`,"team.roles":`Owners and admins create and delete wizards and spaces; members edit the wizards there are.`,"team.memberNote":`You are a member: you edit wizards, admins create new ones and delete.`,"team.failed":`The team could not be loaded.`,"team.role.owner":`Owner`,"team.role.admin":`Admin`,"team.role.member":`Member`,"models.ownKeysPlan":`Your own API keys come with the Pro plan. Here the team's credits pay.`,"home.fromLocal":`From your local install — changed there.`,"home.syncedAt":`Last arrived: {when}.`,"home.local.title":`The wizards from your local install run here`,"home.local.text":`You build on your own computer. What you publish there runs here — for everyone, behind a link.`,"home.local.install":`Install engenty wizards on your computer:`,"home.local.signIn":`Sign in there with this account, under Settings → Account.`,"home.local.publish":`Publish a wizard. It then shows up here.`,"new.title":`What should your wizard do?`,"new.placeholder":`e.g. Customers enter their product and audience, the wizard researches competitors and writes a positioning briefing as a PDF.`,"new.build":`Build wizard`,"new.orStarter":`Or start from a template`,"new.import":`Import a wizard package`,"new.hint":`You can change everything afterwards in the conversation.`,"editor.resize":`Resize — double-click resets`,"editor.resizeSheet":`Resize — tap folds and unfolds`,"editor.export":`Export as a package (.wizard)`,"addStep.title":`What should happen here?`,"addStep.placeholder":`For example: a map of all the objects found, with the price as colour`,"addStep.kind":`Kind of step`,"addStep.auto":`AI picks`,"addStep.empty":`Describe what the step should do first.`,"addStep.busy":`The assistant is still working on the last message. Try again in a moment.`,"addStep.emptyStep":`Insert empty`,"addStep.cancel":`Cancel`,"addStep.create":`Create`,"addStep.building":`Building the new step …`,"addStep.showChat":`See it in the conversation`,"addStep.add":`Add step`,"surface.preview":`Preview`,"surface.code":`Code`,"surface.sampleNote":`With sample data – a run shows its own.`,"surface.sampleText":`Sample text`,"surface.sampleBrand":`Your company`,"addStep.when":`When?`,"addStep.always":`Always`,"addStep.onlyIf":`Only if …`,"addStep.aiDecides":`AI decides …`,"addStep.ifPlaceholder":`For example: revenue below 100`,"addStep.askPlaceholder":`For example: the person wants a refund`,"addStep.whenEmpty":`Say when the step should come.`,"addStep.messageIf":`Only if: {text} – otherwise the run goes on after “{from}” as before.`,"addStep.messageAsk":`AI decides: {text} – otherwise the run goes on after “{from}” as before.`,"addStep.here":`Add a step here`,"addStep.between":`Between “{before}” and “{after}”`,"addStep.after":`After “{title}”`,"addStep.first":`As the first step, before “{title}”`,"addStep.message":`New step · {place}`,"addStep.messageAs":`New step ({kind}) · {place}`,"widget.missing":`The widget isn't built yet.`,"widget.what":`What should the widget show? (optional)`,"widget.build":`Let the assistant build it`,"widget.upload":`Upload your own HTML`,"widget.buildMessage":`Please build the widget “{title}”. {what}`,"editor.chat":`Conversation`,"editor.dropToAttach":`Drop to attach to your message`,"editor.memory":`Memory`,"memory.explain":`What the wizard knows across all its runs: notes that AI steps with the “pages” tool read and add to, and the tables of its shared lists. The same data is under Data in your space.`,"memory.unused":`No step uses the memory yet. Ask the assistant to have an AI step remember something.`,"memory.none":`Nothing remembered yet.`,"memory.add":`Note`,"memory.newNote":`Note`,"memory.back":`Memory`,"memory.testCopy":`Test runs read the memory but write into a copy of their own, which goes with the run.`,"editor.step":`Steps`,"editor.runs":`Runs`,"editor.reviewEditable":`editable`,"editor.reviewRedo":`can be redone`,"editor.otherwise":`otherwise`,"editor.next.title":`Next step`,"editor.next.ways":`Next step · {count} ways`,"editor.next.open":`Open step`,"editor.next.then":`Then`,"editor.next.fold":`Fold`,"editor.next.unfold":`Show in brief`,"editor.branch.ai":`AI`,"editor.branch.addWhen":`Condition`,"editor.branch.when":`Go on when`,"editor.branch.pick":`Pick …`,"editor.branch.and":`and`,"editor.branch.statement":`Statement`,"editor.branch.none":`None clearly holds`,"editor.branch.how":`Decided by a decision model (Jev) where there is a way to one, otherwise by the classifier class's language model. If the two most probable answers are less than 10 points apart, "none" holds.`,"editor.branch.lastRun":`In the last test run decided by {source}.`,"editor.branch.bySystemOne":`a decision model`,"editor.branch.byLlm":`the language model`,"editor.branch.notYet":`A test run shows here how the AI decided.`,"editor.branch.end":`End`,"editor.branch.max":`At most this often (otherwise 10)`,"editor.branch.remove":`Remove branch`,"editor.branch.addAsk":`AI decides`,"editor.branch.newAsk":`The person wants …`,"editor.whenFilled":`{field} filled in`,"editor.whenEmpty":`{field} empty`,"editor.whenContains":`{field} contains {value}`,"editor.whenAsk":`decides: {text}`,"editor.surfaceJson":`View (JSON)`,"editor.fieldAsk":`Or: show when the AI finds this true …`,"editor.atMost":`at most {count}×`,"editor.shownWhen":`Show only when`,"editor.shownAlways":`Always show`,"editor.conditionValue":`Value`,"editor.optionsFrom":`Choices from earlier data`,"editor.optionsFixed":`Fixed choices`,"editor.op.equals":`is`,"editor.op.notEquals":`is not`,"editor.op.in":`is one of`,"editor.op.notEmpty":`is filled in`,"editor.op.empty":`is empty`,"editor.op.gt":`greater than`,"editor.op.lt":`less than`,"editor.op.contains":`contains`,"editor.conditionsMore":`and {count} more conditions`,"tool.web_search":`Web search`,"tool.web_fetch":`Read web pages`,"tool.browser":`Browser`,"tool.sandbox":`Code & shell`,"tool.image":`Images`,"tool.http":`API`,"tool.pages":`Pages`,"editor.test":`Test`,"editor.share":`Share`,"editor.publish":`Publish`,"editor.published":`Live · version {v}`,"editor.unpublishedChanges":`Unpublished changes`,"editor.notPublished":`Not published yet`,"editor.composer":`Describe what should change …`,"editor.attach":`Attach files`,"editor.detach":`Remove`,"editor.attached":`Attached`,"editor.thread":`Thread`,"editor.voice":`Dictate`,"editor.voiceStop":`Stop dictating`,"editor.listening":`Listening …`,"editor.transcribing":`Writing it down …`,"editor.micDenied":`The microphone is not allowed for this page.`,"editor.building":`Building the flow …`,"editor.files":`Files`,"files.explain":`What your wizard needs on every run: widget code, libraries, map outlines, price lists. The assistant creates them in the chat – you can upload your own too.`,"files.upload":`Upload`,"files.drop":`Drop to upload`,"files.count":`{n} files · {size}`,"files.empty":`No files yet. Drop files here or ask the assistant to build a widget.`,"files.download":`Download`,"files.delete":`Delete`,"files.confirmDelete":`Delete “{path}”?`,"files.none":`This wizard has no files.`,"editor.thinking":`Thinking …`,"editor.chatBroken":`The connection dropped. What was already built is saved – please send your message again.`,"editor.issues":`Before you test or share, the wizard needs a few fixes:`,"editor.fixWithChat":`Let the assistant fix it`,"editor.models.blocking":`The wizard can't start like this. Models are missing:`,"editor.models.optional":`These steps won't run like this. Choose a path without them when testing, or set up the models:`,"editor.models.settings":`Set up models`,"editor.prevStep":`Previous step`,"editor.nextStep":`Next step`,"editor.deleteStep":`Delete step`,"editor.holdToDelete":`Hold to delete`,"editor.deleting":`Delete`,"editor.moveUp":`Move up`,"editor.moveDown":`Move down`,"editor.noRuns":`No runs yet.`,"editor.restart":`Restart`,"editor.close":`Close`,"runDrawer.expand":`Fill the window`,"runDrawer.shrink":`Back to the side`,"editor.chatHello":`Tell me what your wizard should do. I'll build the flow and you'll see it as a diagram on the left.`,"shareRun.button":`Share`,"shareRun.title":`Share result`,"shareRun.email":`Email`,"shareRun.more":`More …`,"shareRun.until":`The link works until {date}.`,"shareRun.kept":`The link works until you withdraw it.`,"shareRun.withdraw":`Withdraw link`,"sharePage.gone":`This link has expired or was withdrawn.`,"sharePage.own":`Try it yourself`,"sharePage.until":`Shared · available until {date}`,"sharePage.shared":`Shared on {date}`,"share.title":`Share wizard`,"share.link":`Link`,"share.copy":`Copy`,"share.copied":`Copied`,"share.enabled":`Link is active`,"share.limit":`Runs per day`,"share.rotate":`Create a new link`,"share.rotateHint":`The old link stops working.`,"share.publishFirst":`Publish the wizard so the link works.`,"share.open":`Open`,"share.unpublished":`Your changes are not published yet: the link runs the version before.`,"share.website":`Website`,"share.openHere":`Test on this computer`,"share.settings":`Settings`,"share.on":`on`,"share.off":`off`,"share.perDay":`{n} a day`,"share.rotateCloud":`The old link stops working, the one in the cloud too.`,"share.others":`Share with others`,"share.othersHint":`With an account the wizard also runs on engenty.ai: a link, a QR code and a tag for your website, for everyone, also while your computer is off.`,"share.details":`Details`,"teaser.website":`A website needs a link everyone can reach. With an account the wizard also runs on engenty.ai, and the tag for your page is here.`,"teaser.qr":`A QR code needs a link every phone can reach. With an account the wizard also runs on engenty.ai, and its QR code and the ID for the app are here.`,"teaser.link":`This link only works on this computer, while the app is running. With an account the wizard also runs on engenty.ai, with a link for everyone.`,"teaser.models":`No API key of your own: with an account, text, images and videos run on credits.`,"teaser.connect":`Connect an account`,"teaser.modelsLinked":`Or on your account's credits: under Models, choose "The account's credits".`,"share.qr":`QR code`,"share.qrHint":`Scan it with a phone's camera: the wizard opens, in the engenty wizards app when it is installed.`,"share.code":`ID for the app:`,"share.readOnly":`Whether the link is active and how many runs a day it allows is set in your local install.`,"embed.inline":`Inline`,"embed.modal":`Button + modal`,"embed.inlineHint":`Paste the tag into your page's HTML. The wizard appears in that place.`,"embed.modalHint":`Paste the tag into your page's HTML. A button appears in that place and opens the wizard in a window.`,"type.page":`Page`,"type.agent":`AI step`,"type.generate":`Generate`,"type.surface":`View`,"type.widget":`Widget`,"type.film":`Film`,"type.review":`Review`,"type.result":`Result`,"run.start":`Let's go`,"run.closed":`Not available here right now, it needs: {list}`,"slot.later":`Show later times`,"slot.none":`No times are free right now.`,"run.cls.text":`text`,"run.cls.image":`images`,"run.cls.video":`video`,"run.cls.speech":`speech output`,"run.cls.audio":`voice notes`,"run.next":`Continue`,"run.back":`Back`,"run.accept":`Looks good`,"run.regenerate":`New version`,"run.edit":`Edit`,"run.resume":`Continue your last run`,"run.regenerateNote":`What should change?`,"run.pickItem":`No. {n}`,"run.pickedItem":`No. {n} again`,"run.regeneratePicked":`Only no. {n} will be made again.`,"run.regenerateAll":`Applies to all. Tap a number to change single ones only.`,"check.progress":`{done} of {total} checked`,"check.onlyOpen":`Open only`,"check.noFile":`There is no file for this row.`,"check.noPreview":`This file has no preview – open it with the link above.`,"check.reopen":`Open again`,"market.search":`Search templates …`,"market.all":`All`,"market.industry":`Industry`,"market.format":`Result`,"market.capability":`Capability`,"market.unavailable":`not set up`,"market.without":`Works without: {list}`,"market.optional":`not set up, works without`,"market.optionalHint":`Runs here without {list}: answers that would need it are locked in the wizard. Set it up under Models.`,"market.missing":`Not set up here: {list}`,"market.plan":`Plan`,"market.pro":`Pro`,"market.proHint":`Needs plugins that come with Pro on engenty.ai`,"market.needsPro":`With Pro: needs {list}`,"market.needsProHint":`This template needs {list}. The plugins come with Pro and Team on engenty.ai.`,"market.missingHint":`This needs a model that isn't set up here: {list}. Set it up under Models.`,"market.none":`No template matches this selection.`,"market.notFound":`There is no such template (any more).`,"market.star":`Star`,"market.starred":`Starred`,"market.starHint":`Starred templates are kept on this computer, ready without a connection.`,"market.fromPlugin":`Comes with the plugin “{name}”`,"market.noneStarred":`You haven't starred a template yet.`,"market.offline":`No connection to the marketplace: you see the templates kept here.`,"market.more":`Show more`,"market.reset":`Reset selection`,"market.count":`{n} templates`,"market.countOf":`{n} of {all} templates`,"market.countOfShort":`{n} of {all}`,"market.resetShort":`Reset`,"market.minutes":`~ {n} min`,"market.credits":`~ {n} credits per run`,"market.needsUpdate":`Needs a newer app`,"market.needsUpdateHint":`This template uses features your app does not know yet. Update the app, then you can use it.`,"market.use":`Start with this template`,"market.steps":`How the wizard runs`,"market.duration":`Duration`,"market.durationHint":`from start to result, with {n} inputs from you`,"market.result":`Result`,"market.creditsRange":`~ {n} credits`,"market.creditsHint":`estimated per run, rarely more than twice that`,"market.needs":`Needs`,"market.cost":`Cost`,"new.forWebsite":`Small helpers for your website`,"run.feedbackPlaceholder":`Something not right? Write what should be different …`,"run.feedbackTarget":`What should change?`,"run.feedbackPick":`Pick above what should change.`,"ai.generated":`AI generated`,"ai.modified":`AI modified`,"ai.publish":`Made with AI: whoever publishes this has to label it as AI-generated (EU AI Act, Art. 50). The file already carries the marking in its metadata.`,"run.regenerateGo":`Recreate`,"run.retry":`Try again`,"run.again":`Start over`,"run.download":`Download`,"run.copy":`Copy text`,"run.failed":`Something went wrong.`,"run.unavailable":`This wizard is not available right now.`,"run.notFound":`This wizard does not exist (anymore).`,"run.madeWith":`Made with engenty wizards`,"run.working":`One moment …`,"run.elapsed":`{s} s`,"run.cancelled":`Cancelled.`,"run.addRow":`Add row`,"run.upload":`Choose a file or drop it here`,"run.uploading":`Uploading …`,"run.required":`Required`,"run.net":`Net`,"run.vat":`VAT {r} %`,"run.total":`Total`,"settings.title":`Settings`,"settings.name":`Name`,"settings.mcp":`Connected systems (MCP)`,"settings.mcpHint":`AI steps can read from and write to these systems — only when you allow it on the step.`,"settings.addServer":`Connect a system`,"settings.serverName":`Name`,"settings.serverUrl":`MCP URL`,"settings.serverHeader":`Authorization header (optional)`,"settings.save":`Save`,"settings.saved":`Saved`,"settings.delete":`Delete space`,"settings.noProject":`Your space shows up here once your local install has published its first wizard.`,"settings.copy":`Copy`,"settings.copied":`Copied`,"settings.lastUsed":`last used {when}`,"settings.neverUsed":`never used`,"settings.revoke":`Delete key`,"mcp.appsDisconnect":`Remove`,"plugins.title":`Plugins`,"plugins.hint":`Plugins add pages, settings and tools for steps to this app. They run with the app's full rights: install only what you know.`,"plugins.hintManaged":`These plugins are switched on for your account.`,"plugins.reload":`Reload`,"plugins.rescan":`Look again`,"plugins.tools":`Tools for steps`,"plugins.serverFailed":`The server half did not load: {error}`,"plugins.studioFailed":`The studio half did not load: {error}`,"plugins.problems":`Not a plugin`,"plugins.crashed":`This part of a plugin crashed.`,"plugins.none":`No plugins of your own installed.`,"pro.title":`Pro modules`,"pro.hint":`Modules your plan (Pro, Team) includes, here on your computer. They come from your engenty account, are signed by engenty and stay on while your plan includes them – up to a week without internet.`,"pro.check":`Check plan`,"pro.notLinked":`Link your engenty account (Settings → Account) to use your plan's modules here.`,"pro.plan":`Plan: {plan}`,"pro.confirmedUntil":`confirmed until {date}`,"pro.plans":`Plans`,"pro.on":`On`,"pro.notInPlan":`Not in your plan`,"pro.install":`Install`,"pro.update":`Update`,"pro.remove":`Remove`,"pro.none":`There are no Pro modules for this version ({runtime}) yet.`,"pro.held.plan":`Not in your plan`,"pro.held.release":`Fetched again for this version`,"pro.held.unconfirmed":`Plan not confirmed – check online`,"mcp.notReverse":`Not the same as “Connected systems (MCP)” under Connectors: there engenty calls other servers, here your client calls engenty.`,"integrate.nav":`Integrate`,"integrate.groupApps":`AI apps`,"integrate.groupShare":`Share`,"integrate.shareLink":`Share by link`,"integrate.shareSite":`Put on a website`,"integrate.soon":`soon`,"integrate.stateWorks":`works`,"integrate.stateConnected":`added`,"integrate.stateInstalled":`on this computer`,"integrate.kindMcp":`Tools in the chat: find, run and fill in wizards — and build them.`,"integrate.kindMcpShort":`tools in the chat`,"integrate.kindAppShort":`the wizard as a widget`,"integrate.kindAppNoShort":`this app does not show it`,"integrate.kindApp":`The wizard itself in the chat, page by page, as a widget.`,"integrate.kindAppNo":`This app does not show them — a run comes as text.`,"integrate.where":`Where does the app run?`,"integrate.here":`On this computer`,"integrate.hereHint":`One click, no key. The app starts engenty wizards itself.`,"integrate.hereManaged":`Only with engenty wizards on your computer.`,"integrate.address":`At the address`,"integrate.addressHint":`From anywhere the address can be reached — with a key.`,"integrate.connectTitle":`Add`,"integrate.connectHint":`Adds engenty wizards to the settings of {app}.`,"integrate.connect":`Add to {app}`,"integrate.connected":`Added to {app}`,"integrate.notInstalled":`{app} is not on this computer. You can add it anyway — it works once {app} is there.`,"integrate.file":`Put this into {file}:`,"integrate.vscode":`In VS Code: "MCP: Open User Configuration", then add:`,"integrate.chatgpt":`In ChatGPT: Settings → Apps & Connectors → Advanced → Developer mode, then "Create" with this address:`,"integrate.generic":`In the app's MCP settings, add a server at this address (Streamable HTTP):`,"integrate.oauthLocal":`This app connects from its maker's servers — it cannot reach this computer. Use "On this computer" or an app that runs here.`,"integrate.test":`Test`,"integrate.seen":`{app} checks in`,"integrate.restart":`Quit {app} completely and start it again — then it checks in here.`,"integrate.reload":`Reload the MCP servers in {app}, or restart it.`,"integrate.tool":`Called a tool`,"integrate.askHint":`In a new chat in {app}, write:`,"integrate.askTool":`Which wizards do I have in engenty?`,"integrate.widget":`Showed the wizard as a widget`,"integrate.widgetHint":`Start a published wizard:`,"integrate.askWidget":`Start one of my engenty wizards.`,"integrate.works":`{app} works with your wizards.`,"mcp.notHere":`Not possible with this server`,"mcp.needsPublic":`claude.ai connects from Anthropic's servers. That only works when this server is reachable publicly over HTTPS.`,"mcp.keyTitle":`Create a key`,"mcp.keyHint":`The key signs your client in. It is shown once and goes straight into the command in the next step.`,"mcp.keyCreate":`Create a key for {client}`,"mcp.keyReady":`Key created — it is already in the command below.`,"mcp.keyFirst":`Create the key first — then the finished command shows up here.`,"mcp.add":`Add the server`,"mcp.terminal":`Run in the terminal:`,"mcp.ccPlugin":`Optionally the plugin — it adds the /wizard command:`,"mcp.codexKey":`Run in the terminal — Codex reads the key from an environment variable:`,"mcp.claudeAi":`In claude.ai: Settings → Connectors → Add custom connector, and enter this address:`,"mcp.oauth":`No key needed: on first use your client signs in in the browser.`,"mcp.addressPublic":`Reachable publicly.`,"mcp.addressLocal":`Reachable on this computer only, and only while engenty wizards runs.`,"mcp.keys":`Keys`,"mcp.keysHint":`Each key signs one client in and has every right — treat it like a password. Delete it and that client is signed out.`,"editor.viaClient":`Via {client}`,"editor.changedVia":`Changed via {client}`,"editor.merged":`Merged with changes from elsewhere`,"run.uploadMore":`Another file`,"run.camera":`Camera`,"camera.title":`Take a picture`,"camera.hint":`Hold it flat and well lit.`,"camera.taken":`{n} taken`,"camera.shoot":`Capture`,"camera.done":`Done`,"camera.denied":`The camera is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or take the photo with your camera app.`,"connect.go":`Connect`,"connect.connected":`Connected through {name}`,"connect.disconnect":`Disconnect`,"connect.none":`No provider is set up for connecting on this server yet.`,"connect.openLink":`Click here to open the sign-in in a new tab`,"list.empty":`No entries yet.`,"list.delete":`Delete row`,"ask.typeInto":`Type into the page …`,"ask.hide":`hidden`,"ask.up":`Scroll up`,"ask.down":`Scroll down`,"ask.pictureHint":`This is the page the wizard has open. You can also click and type right in the picture.`,"ask.remember":`Remember this sign-in for next time`,"ask.private":`What you enter goes straight into the page. The AI never sees it. Remembered sign-ins are stored encrypted.`,"ask.skip":`Skip`,"ask.done":`I am signed in`,"ask.signIn":`Sign in`,"ask.wants":`The wizard wants to run this in {service}:`,"ask.allowRest":`Allow for the rest of this run`,"ask.allow":`Allow`,"ask.deny":`Don't allow`,"store.open":`What this wizard remembers`,"store.title":`Kept for you`,"store.explain":`This wizard keeps lists, files and connected accounts for your next run. Only you see them.`,"store.empty":`Nothing kept yet.`,"store.rows":`{n} entries`,"store.signIns":`Remembered sign-ins in the browser`,"store.files":`{n} files · {size}`,"store.delete":`Delete everything`,"store.confirmDelete":`Really delete everything`,"common.close":`Close`,"composer.send":`Send`,"dictation.settings":`Microphone and recording`,"dictation.microphone":`Microphone`,"dictation.default":`System default`,"dictation.mic":`Microphone {n}`,"dictation.showMics":`Show microphone names …`,"dictation.hold":`Hold to record`,"dictation.holdToTalk":`Hold to talk`,"date.pick":`Pick a date`,"time.pick":`Pick a time`,"time.hour":`Hour`,"time.minute":`Minute`,"date.pickRange":`Pick a day or a period`,"date.pickStart":`Pick the first day`,"date.pickEnd":`Pick the last day – or the same one for one day`,"date.today":`Today`,"date.clear":`Clear`,"date.prev":`Previous month`,"date.next":`Next month`,"connectors.title":`Connectors`,"connectors.hint":`Services a wizard can work in for the person — they connect their own account during a run. The main ones are built in; any other you find in the integrations.sh registry and import from its OpenAPI spec or its MCP server.`,"connectors.imported":`From the registry`,"connectors.noneImported":`No connector from the registry is imported here.`,"connectors.notSetUp":`not set up`,"connectors.setup":`The server still needs:`,"connectors.search":`Find a service, e.g. Notion, Stripe, GitHub`,"connectors.find":`Search`,"connectors.none":`Nothing found.`,"connectors.import":`Import`,"connectors.exists":`Already imported.`,"connectors.ownClient":`Own OAuth client`,"connectors.refresh":`Reload actions`,"connectors.remove":`Remove`,"connectors.actions":`{n} actions, {r} read-only`,"connectors.pending":`Actions appear once an account is connected`,"connectors.needsClient":`This service needs an OAuth client (id and secret). Remove it and import again with “Own OAuth client”.`,"connectors.authNone":`no sign-in`,"connectors.authOauth":`OAuth sign-in`,"connectors.authKey":`API key`,"connectors.group.read":`reads`,"connectors.group.write":`changes`,"connectors.group.destructive":`deletes`,"run.uploadTouch":`Choose a file`,"run.maxFiles":`At most {n} fit here – I left out the rest.`,"run.filesMin":`{n} of at least {min}`,"run.filesOf":`{n} of at most {max}`,"run.moveFile":`Move no. {n}`,"run.moveFileHint":`Drag to change the order`,"run.removeFile":`Remove`,"run.awake":`The screen stays on while the wizard works.`,"run.openFull":`Open full size`,"run.yes":`Yes`,"run.no":`No`,"run.share":`Share`,"run.shareNow":`Share now`,"run.shareFile":`Share as a file or open in an app`,"camera.asking":`Your browser is about to ask for the camera. The picture stays in this wizard.`,"camera.missing":`No camera was found on this device. Upload a photo instead.`,"camera.busy":`Another app is using the camera. Close it and try again.`,"camera.native":`Open the camera app`,"camera.pick":`Choose a photo`,"camera.torch":`Light`,"camera.flip":`Switch camera`,"camera.photo":`Photo`,"camera.video":`Video`,"camera.record":`Start recording`,"camera.stop":`Stop recording`,"camera.recording":`Recording — tap to stop.`,"camera.clipHint":`A short clip, {s} seconds at most.`,"camera.hintMany":`Capture page after page, then “Done”.`,"scan.button":`Scan`,"scan.title":`Scan a code`,"scan.asking":`Your browser is about to ask for the camera — it only reads the code.`,"scan.hint":`Hold the QR code or barcode inside the frame.`,"scan.hintQr":`Hold the QR code inside the frame. This device does not read barcodes here.`,"scan.miss":`No code was found in the photo. Try closer and sharper.`,"scan.fromPhoto":`Choose a photo of the code`,"scan.typeInstead":`Type it instead`,"location.use":`Use my location`,"location.locating":`Finding your location …`,"location.refining":`getting more exact …`,"location.accuracy":`exact to about {m} m`,"location.map":`Map`,"location.remove":`Remove location`,"location.why":`Your browser asks for your location. It is only used for this wizard. You can also just type the address.`,"location.denied":`Location is not allowed for this page. Allow it in your browser's site settings (the lock icon in the address bar) — or type the address below.`,"location.unavailable":`Your device could not find its location right now. Try again outdoors or type the address.`,"location.timeout":`That took too long. Try again or type the address.`,"location.manual":`Type an address or place`,"location.label":`Address or description of the place`,"voice.start":`Record a voice note`,"voice.stop":`Stop`,"voice.recording":`Recording …`,"voice.left":`{s} s left`,"voice.again":`Record again`,"voice.remove":`Delete`,"voice.pick":`Choose an audio file`,"voice.why":`Your browser asks for the microphone. The recording is turned into text afterwards.`,"voice.denied":`The microphone is not allowed for this page. Allow it in your browser's site settings — or record the note with your voice memo app and choose the file.`,"voice.noRecorder":`This browser cannot record here. Record the note with your voice memo app and choose the file.`,"sign.open":`Sign here`,"sign.hint":`Sign with your finger`,"sign.pad":`Signature pad`,"sign.clear":`Clear`,"sign.accept":`Use it`,"sign.again":`Sign again`,"sign.remove":`Remove signature`,"notify.ask":`Tell me when it is done`,"notify.on":`You will be told`,"notify.why":`With a sound, a buzz or a notification. Your browser asks once for permission.`,"notify.onHint":`You can switch apps — a notification brings you back.`,"notify.quiet":`With a sound and a buzz while this page is open.`,"notify.blocked":`Notifications are blocked for this page — you get a sound and a buzz while it is open. You can allow them in your browser's site settings.`,"notify.done":`Your result is ready.`,"notify.next":`It goes on — have a look.`,"notify.needsYou":`The wizard needs you for a moment.`,"install.add":`Add to home screen`,"install.ios":`Tap “Share” below, then “Add to Home Screen”.`,"install.bookmark":`Bookmark this wizard`,"install.bookmark.mac":`Press ⌘ D to keep this wizard in your bookmarks.`,"install.bookmark.pc":`Press Ctrl + D to keep this wizard in your bookmarks.`,"install.app":`Open in the app`,"install.app.offer":`Install the studio as an app: its own window, its own icon in the Dock or taskbar.`,"install.app.browser":`In Chrome or Edge the studio installs as an app: its own window, its own icon.`,"install.app.action":`Install as app`,"install.app.close":`Close`,"common.offline":`No connection. Check your network and try again.`,"common.retry":`Try again`,"common.cancel":`Cancel`,"common.loading":`Loading …`,"common.error":`Error`,"data.hint":`Tables and pages the space and its wizards keep.`,"data.all":`All data`,"data.own":`General`,"data.table":`Table`,"data.page":`Page`,"data.newTable":`New table`,"data.newPage":`New page`,"data.title":`Title`,"data.owner":`Belongs to`,"data.create":`Create`,"data.empty":`No tables or pages yet. Create one – soon your wizards will write here too.`,"data.rows":`{n} rows`,"data.addRow":`Row`,"data.noRows":`No rows yet.`,"data.deleteRow":`Delete row`,"data.deleteTable":`Delete table`,"data.deletePage":`Delete page`,"data.confirmDelete":`Delete “{title}”?`,"data.newColumn":`New column`,"data.columnName":`Name`,"data.columnType":`Type`,"data.required":`Must be filled in`,"data.deleteColumn":`Delete column`,"data.removeOption":`Remove`,"data.fromList":`A list of the wizard: every run writes into it. The columns come from the wizard.`,"data.badCell":`This value does not fit “{column}” and is not saved.`,"data.type.text":`Text`,"data.type.number":`Number`,"data.type.date":`Date`,"data.type.duration":`Duration`,"data.type.select":`Choice`,"data.type.boolean":`Yes / no`,"data.text.single":`One line`,"data.text.multiline":`Several lines`,"data.number.integer":`Whole number`,"data.number.decimal":`Decimal`,"data.number.percent":`Percent`,"data.number.currency":`Amount`,"data.currency":`Currency (e.g. EUR)`,"data.date.date":`Date`,"data.date.datetime":`Date and time`,"data.date.time":`Time`,"data.unit":`Entered in`,"data.unit.milliseconds":`ms`,"data.unit.seconds":`seconds`,"data.unit.minutes":`minutes`,"data.unit.hours":`hours`,"data.unit.days":`days`,"data.options":`Choices, one per line`,"data.multiple":`Several can be chosen`,"data.write":`Write`,"data.preview":`Preview`,"data.pageEmpty":`This page is still empty.`,"data.markdownHint":`Markdown: # heading, **bold**, - list`,"space.info":`Info & brand`,"space.knowledge":`Knowledge`,"space.data":`Data`,"space.results":`Results`,"space.resultsAll":`All results`,"space.resultsHint":`Runs of your wizards that reached their result, newest first.`,"space.resultsEmpty":`No results yet. A run shows up here once it is done.`,"space.resultCredits":`{n} credits`,"space.resultsSearch":`Search: wizard, answers, result …`,"space.resultsModeAll":`Live & test`,"space.resultsAnyTime":`Any time`,"space.resultsDay":`Last 24 hours`,"space.resultsDays":`Last {n} days`,"space.resultsNone":`No results for this search.`,"space.resultFiles":`{n} files`,"project.rename":`Rename space`,"project.saving":`Saving …`,"project.base":`Basics`,"project.baseHint":`Who is behind the wizards. Every AI step knows this.`,"project.title":`Title`,"project.titleHint":`Company, brand or undertaking — end users see it too.`,"project.about":`About`,"project.aboutHint":`What you do, for whom, and the tone you write in.`,"project.logos":`Logos`,"project.logosHint":`End users see the first logo. A description says what a variant is for.`,"project.logoAdd":`Logo`,"project.logoMain":`Main logo`,"project.logoMakeMain":`Make main logo`,"project.colors":`Colours`,"project.colorsHint":`The first colour is the accent of documents, dashboards and public pages.`,"project.colorAdd":`Colour`,"project.colorName":`e.g. Primary — buttons and headings`,"project.colorUse":`Describe how engenty should use this color.`,"project.colorAddTitle":`Add a colour`,"project.colorValue":`Colour value`,"project.colorUseLabel":`Use`,"project.add":`Add`,"project.colorAccent":`Accent`,"project.colorFirst":`Make accent`,"project.assets":`Assets`,"project.assetsHint":`Images, graphics, videos. AI steps place them in documents and choose by the description.`,"project.assetAdd":`Files`,"project.assetSearch":`Filter assets …`,"know.all":`All`,"know.title":`Knowledge`,"know.hint":`What your wizards' steps look things up in. Documents become pages and tables when they arrive; Kategorien keep the items apart.`,"know.empty":`Nothing here yet. Upload documents, add a page or give the assistant a website.`,"know.drop":`Drop documents here or`,"know.pick":`choose`,"know.page":`Page`,"know.table":`Table`,"know.faq":`FAQ`,"know.file":`File`,"know.category":`Kategorie`,"know.categories":`Kategorien`,"know.newPage":`New page`,"know.newTable":`New table`,"know.asFaq":`As an FAQ: a question and its answer per row`,"know.newCategory":`New Kategorie`,"know.search":`Try a search …`,"know.searchNone":`Nothing relevant found.`,"know.searchStats":`{candidates} candidates checked, {hits} relevant`,"know.searchUnchecked":`{hits} hits, unchecked`,"know.unchecked":`Without a classifier hits stay unchecked. It needs an AI Gateway or TypeSafe key, or an account.`,"know.keywordsOnly":`Without an embedding model the search finds words, not meaning.`,"know.clear":`Reset`,"know.sub":`{n} sub-pages`,"know.rows":`{n} rows`,"know.review":`Check`,"know.reviewed":`Checked`,"know.from":`From {label}`,"know.kept":`Changed by hand: {label} no longer writes it.`,"know.original":`Original`,"know.reading":`Reading …`,"know.subPages":`Sub-pages`,"know.addSub":`Sub-page`,"know.type.choice":`Choice`,"know.type.date":`Date`,"know.type.number":`Number`,"know.type.text":`Text`,"know.type.boolean":`Yes / no`,"know.name":`Name`,"know.type":`Type`,"know.unit":`Unit`,"know.unitHint":`e.g. h, €, kg`,"know.multiple":`Several values per item`,"know.ordered":`The values are ranked (low → high)`,"know.values":`Values`,"know.valuesHint":`One per line. More come with the items.`,"know.hintField":`Where the values come from`,"know.hintFieldHint":`Short, e.g. header, file name, the website's filter.`,"know.create":`Create`,"know.proposed":`Proposed`,"know.proposedHint":`It is filled once it is taken.`,"know.accept":`Take`,"know.dismiss":`Dismiss`,"know.alike":`“{a}” and “{b}” look like one value.`,"know.merge":`Merge`,"know.items":`{n} items`,"know.item":`1 item`,"know.row":`1 row`,"know.oneSub":`1 sub-page`,"know.addValue":`Add a value`,"know.range":`{min} to {max}`,"know.summary":`Overview`,"know.summaryHint":`A model sums up the items of this value. The search finds the overview like a page.`,"know.summaryWrite":`Write the overview`,"know.summaryAgain":`Write again`,"know.summaryEmpty":`No overview yet.`,"know.toc":`Contents`,"know.tocRows":`{n} rows in {table}`,"know.deleteCategory":`Delete Kategorie`,"know.confirmCategory":`Delete “{name}”? The items stay, only the Kategorie goes.`,"know.deleteValue":`Delete value`,"know.yes":`Yes`,"know.no":`No`,"know.minimum":`from`,"know.maximum":`to`,"know.contains":`contains`,"know.by.person":`set by hand`,"know.by.origin":`from the source`,"know.by.model":`read by a model`,"know.remove":`Remove`,"know.unset":`Not set`,"know.deleteFile":`Delete file`,"project.documents":`Documents`,"project.documentsHint":`PDFs, lists, Excel, Word, text. They are read and put into an index every AI step searches.`,"project.documentAdd":`Documents`,"project.drop":`Drop here or`,"project.staysLocal":`Stays in your local install and is not sent here.`,"project.description":`Add a description …`,"project.describing":`Looking at it …`,"project.reading":`Reading …`,"project.indexed":`In the index`,"project.indexedKeywords":`In the index (keywords)`,"project.notIndexed":`No text found`,"project.reindex":`Read again`,"project.pages":`{n} pages`,"project.keywordsOnly":`The index searches by keywords right now. With an AI Gateway or OpenAI key it also searches by meaning.`,"project.preview":`Preview`,"project.viewList":`Show as a list`,"project.viewCards":`Show as cards`,"project.original":`Original`,"project.readText":`Text as read`,"project.openOriginal":`Open the original`,"project.noText":`No text yet: the document is still being read, or could not be read.`,"project.textCut":`The preview shows the start ({shown} of {total} characters).`,"project.searchTest":`Search the index …`,"project.searchNone":`Nothing found.`,"project.remove":`Remove`,"project.removeConfirm":`Remove “{name}”?`,"project.facts":`Facts`,"project.factsHint":`What wizards should know: address, VAT id, opening hours — anything that fits.`,"project.factLabel":`Label`,"project.factValue":`Value`,"project.factAdd":`Entry`,"project.factType":`Type`,"project.factAuto":`Automatic`,"project.type.text":`Text`,"project.type.longtext":`Long text`,"project.type.number":`Number`,"project.type.date":`Date`,"project.type.url":`Link`,"project.type.email":`Email`,"project.type.phone":`Phone`,"project.type.boolean":`Yes / No`,"project.yes":`Yes`,"project.no":`No`,"project.assistant":`Assistant`,"project.assistantTitle":`Tell me about yourselves`,"project.assistantHello":`Name your website or give me files. I fill in what I find: title, description, logo, colours and facts.`,"project.assistantComposer":`e.g. “Read our website example.com” …`,"project.assistantTitleKnowledge":`What should your wizards know?`,"project.assistantHelloKnowledge":`Give me documents or tell me where the knowledge is. I read it in – below you see what goes in.`,"project.assistantComposerKnowledge":`Attach documents or say where the knowledge is …`,"project.assistantChanged":`Space updated`,"flowApp.loading":`The wizard is on its way …`,"flowApp.draft":`Draft`,"flowApp.published":`Published`,"flowApp.issues":`{n} issues in the draft`,"flowApp.flow":`Flow`,"flowApp.notPublished":`Publish it in the studio to run it here.`,"flowApp.runPage":`Continue in the browser`,"flowApp.inBrowser":`Only in the browser: {fields}`,"flowApp.done":`Done`,"flowApp.credits":`{n} credits`,"flowApp.ask":`The wizard asks`,"flowApp.allow":`Allow`,"flowApp.skip":`Skip`,"flowApp.signIn":`A sign-in at {site} — only in the browser.`,"flowApp.fullscreen":`Larger`,"flowApp.inline":`Smaller`,"flowApp.failed":`That did not work: {error}`},Wx=`wizards.lang`;function Gx(){try{let e=localStorage.getItem(Wx);return e===`de`||e===`en`?e:null}catch{return null}}var Kx=Gx()??(typeof navigator<`u`&&!navigator.language.toLowerCase().startsWith(`de`)?`en`:`de`),qx=Kx===`de`?Hx:Ux,Jx=new Set;function Yx(e){if(e!==Kx){Kx=e,qx=e===`de`?Hx:Ux,document.documentElement.lang=e;try{localStorage.setItem(Wx,e)}catch{}for(let e of Jx)e()}}function Xx(e){return e.note&&Vx(e.note,Kx)||e.message}function Z(e,t){let n=qx[e]??Hx[e]??e;for(let[e,r]of Object.entries(t??{}))n=n.replace(`{${e}}`,String(r));return n}typeof document<`u`&&(document.documentElement.lang=Kx),Vb();var Zx=`wizards.theme`,Qx=new Set,$x=window.matchMedia(`(prefers-color-scheme: dark)`);function eS(){try{let e=localStorage.getItem(Zx);return e===`light`||e===`dark`?e:null}catch{return null}}var tS=0;function nS(){return tS>0?`dark`:eS()??($x.matches?`dark`:`light`)}function rS(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function iS(){let e=nS()===`dark`;document.documentElement.classList.toggle(`dark`,e),rS();for(let e of Qx)e()}$x.addEventListener(`change`,iS),iS();function aS(){return(0,y.useSyncExternalStore)(e=>(Qx.add(e),()=>Qx.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var oS=e=>`oklch(from ${Rb[Bb[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`,sS=``.replace(/\/+$/,``);`${sS}`;var cS=null;function lS(e){cS=e?{base:e.base.replace(/\/+$/,``),ticket:e.ticket}:null}function uS(e){return cS&&e.startsWith(`/api/`)?`${cS.base}${e}${e.includes(`?`)?`&`:`?`}rt=${encodeURIComponent(cS.ticket)}`:!sS||!e.startsWith(`/`)||e.startsWith(`//`)||e===sS||e.startsWith(`${sS}/`)?e:`${sS}${e}`}function dS(e){return`./${e.replace(/^\/+/,``)}`}var fS=class extends Error{status;body;constructor(e,t,n){super(e),this.status=t,this.body=n}};async function pS(e,t,n){let r=await fetch(uS(t),{method:e,credentials:`include`,headers:n!==void 0&&!(n instanceof FormData)?{"content-type":`application/json`}:void 0,body:n===void 0?void 0:n instanceof FormData?n:JSON.stringify(n)}).catch(()=>{throw new fS(Z(`common.offline`),0,null)}),i=await r.text(),a=i?mS(i):null;if(!r.ok)throw new fS(a?.error??r.statusText,r.status,a);return a}function mS(e){try{return JSON.parse(e)}catch{return{error:e}}}var hS={get:e=>pS(`GET`,e),post:(e,t)=>pS(`POST`,e,t??{}),put:(e,t)=>pS(`PUT`,e,t),patch:(e,t)=>pS(`PATCH`,e,t),del:e=>pS(`DELETE`,e),upload:(e,t)=>{let n=new FormData;return n.set(`file`,t),pS(`POST`,e,n)}};typeof navigator<`u`&&navigator.mediaDevices?.getUserMedia;var gS=`wizards.dictation`;(()=>{try{let e=JSON.parse(localStorage.getItem(gS)??`{}`);return{deviceId:String(e.deviceId??``),hold:e.hold===!0}}catch{return{deviceId:``,hold:!1}}})();function Q(...e){return e.filter(Boolean).join(` `)}var _S={primary:`bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]`,secondary:`bg-card text-ink border border-border hover:bg-paper-2`,ghost:`text-ink-2 hover:text-ink hover:bg-accent`,quiet:`bg-paper-2 text-ink hover:bg-paper-3`,danger:`text-rose hover:bg-rose-tint`},vS=(0,y.forwardRef)(function({variant:e=`primary`,size:t=`md`,busy:n,className:r,children:i,disabled:a,...o},s){return(0,X.jsxs)(`button`,{ref:s,type:`button`,disabled:a||n,className:Q(`inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50`,t===`sm`&&`h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4`,t===`md`&&`h-10 px-4 text-sm coarse:h-11`,t===`lg`&&`h-12 px-6 text-[0.9375rem]`,_S[e],r),...o,children:[n?(0,X.jsx)(kS,{className:`size-4`}):null,i]})});function yS({label:e,className:t,children:n,...r}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,className:Q(`inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11`,t),...r,children:n})}var bS=`rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60`;function xS(e){return/(^|\s)w-/.test(e??``)?null:`w-full`}var SS=(0,y.forwardRef)(function({className:e,...t},n){return(0,X.jsx)(`input`,{ref:n,className:Q(bS,xS(e),`h-11`,e),...t})});function CS(e){return(0,X.jsx)(`input`,{type:`color`,className:`swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1`,...e})}var wS=(0,y.forwardRef)(function({className:e,minRows:t=3,maxRows:n=14,onChange:r,...i},a){let o=(0,y.useRef)(null),s=()=>{let e=o.current;if(!e)return;let r=Number.parseFloat(getComputedStyle(e).lineHeight)||22;e.style.height=`auto`;let i=r*n+20;e.style.height=`${Math.min(Math.max(e.scrollHeight,r*t+20),i)}px`,e.style.overflowY=e.scrollHeight>i?`auto`:`hidden`};return(0,y.useLayoutEffect)(s),(0,X.jsx)(`textarea`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},className:Q(bS,xS(e),`resize-none py-2.5 leading-[1.5]`,e),onChange:e=>{s(),r?.(e)},...i})});function TS({value:e,onChange:t,options:n,className:r,placeholder:i}){return(0,X.jsxs)(`div`,{className:Q(`relative`,r),children:[(0,X.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:Q(bS,`h-11 w-full appearance-none pr-9`),children:[i===void 0?null:(0,X.jsx)(`option`,{value:``,children:i}),n.map(e=>(0,X.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,X.jsx)(`svg`,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3`,viewBox:`0 0 16 16`,fill:`none`,children:(0,X.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})]})}function ES({value:e,onChange:t,options:n,multi:r,disabled:i}){let a=new Set(Array.isArray(e)?e:e?[e]:[]);return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let o=a.has(e);return(0,X.jsx)(`button`,{type:`button`,"aria-pressed":o,disabled:i?.includes(e),onClick:()=>{if(r){let r=new Set(a);o?r.delete(e):r.add(e),t(n.filter(e=>r.has(e)))}else t(e)},className:Q(`h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11`,o?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`),children:e},e)})})}function DS({checked:e,onChange:t,label:n,disabled:r}){return(0,X.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,onClick:()=>t(!e),className:Q(`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60`,e?`bg-primary`:`bg-paper-3`),children:(0,X.jsx)(`span`,{className:Q(`inline-block size-5 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-[22px]`:`translate-x-[2px]`)})})}function OS({children:e,hint:t,required:n}){return(0,X.jsxs)(`div`,{className:`mb-2`,children:[(0,X.jsxs)(`div`,{className:`font-medium text-[0.875rem] text-ink`,children:[e,n?(0,X.jsx)(`span`,{className:`ml-1 text-ember`,children:`*`}):null]}),t?(0,X.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t}):null]})}function kS({className:e}){return(0,X.jsxs)(`svg`,{className:Q(`size-5 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,X.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function AS({className:e,children:t,...n}){return(0,X.jsx)(`div`,{className:Q(`rounded-xl bg-card shadow-soft ring-1 ring-border-soft`,e),...n,children:t})}function jS({children:e,tone:t=`neutral`,icon:n,title:r}){return(0,X.jsxs)(`span`,{title:r,className:Q(`inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]`,t===`neutral`&&`bg-paper-2 text-ink-2`,t===`live`&&`bg-moss-tint text-moss`,t===`warn`&&`bg-amber-tint text-ink-2`,t===`ember`&&`bg-ember-tint text-ember-strong`),children:[n??(t===`live`?(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-moss`}):null),e]})}function MS({open:e,onClose:t,title:n,children:r,wide:i,bare:a}){let o=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=o.current;t&&(e&&!t.open?(t.showModal(),t.querySelector(`[data-autofocus]`)?.focus()):!e&&t.open&&t.close())},[e]),(0,X.jsx)(`dialog`,{ref:o,onClose:t,onClick:e=>{e.target===o.current&&t()},className:Q(`m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]`,a?`w-[calc(100%-48px)] overflow-visible bg-transparent max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none`:`max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay`,i===`page`?`sm:max-w-4xl`:i?`sm:max-w-2xl`:`sm:max-w-md`,!a&&(i===`page`?`max-w-4xl`:i?`max-w-2xl`:`max-w-md`)),children:e&&a?r:e?(0,X.jsxs)(`div`,{className:`p-5 sm:p-7`,children:[n?(0,X.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`min-w-0 font-display font-semibold text-xl`,children:n}),(0,X.jsx)(yS,{label:Z(`common.close`),onClick:t,className:`-mt-1.5 -mr-2`,children:(0,X.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,className:`size-4`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}):null,r]}):null})}function NS({text:e}){return e.split(/(https?:\/\/[^\s)]+)/).map((e,t)=>t%2?(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`font-medium text-ink underline underline-offset-2`,children:new URL(e).host},e):e)}function PS(e){let t=LS.get(e);if(t)return t;if(!RS){let e=document.createElement(`canvas`);e.width=1,e.height=1,RS=e.getContext(`2d`,{willReadFrequently:!0})}let n=[.5,.5,.5];if(RS){RS.clearRect(0,0,1,1),RS.fillStyle=`#808080`,RS.fillStyle=e,RS.fillRect(0,0,1,1);let[t,r,i]=RS.getImageData(0,0,1,1).data;n=[t/255,r/255,i/255]}return LS.set(e,n),n}function FS(e,t){let n=zS.get(e);return n||(n=document.createElement(`span`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,e.appendChild(n),zS.set(e,n)),n.style.color=``,n.style.color=t,PS(getComputedStyle(n).color||`#808080`)}function IS(e,t){let n=FS(e,Rb[Bb[t]]),r=Math.max(...n),i=[Math.min(1,n[0]+n[0]/(r||1)*.45),Math.min(1,n[1]+n[1]/(r||1)*.45),Math.min(1,n[2]+n[2]/(r||1)*.45)];return{body:BS(n,[1,1,1],.12),deep:BS(n,[.03,.02,.06],.62),tip:BS(i,[1,1,1],.12)}}var LS,RS,zS,BS,VS=o((()=>{Vb(),LS=new Map,RS=null,zS=new WeakMap,BS=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n]})),HS,US=o((()=>{HS=`
116
116
  vec4 gogglesOver(vec2 p, float aa, float front) {
117
117
  if (uGoggles < 0.5) return vec4(0.0);
118
118
  vec2 q = p - eyeCentre();
@@ -133,7 +133,7 @@ vec4 gogglesOver(vec2 p, float aa, float front) {
133
133
  vec4 acc = vec4(leather * band, band);
134
134
  return acc;
135
135
  }
136
- `})),US,WS=o((()=>{US=`
136
+ `})),WS,GS=o((()=>{WS=`
137
137
  vec3 deformJelly(vec3 p) {
138
138
  vec3 q=p-vec3(60.0,60.0,0.0);
139
139
  vec3 local=q/max(uScale,1.0);
@@ -157,10 +157,10 @@ vec3 deformJelly(vec3 p) {
157
157
  q.z-=length(uPull.zw)*softness*influence*0.15;
158
158
  return q+vec3(60.0,60.0,0.0);
159
159
  }
160
- `})),GS,KS=o((()=>{HS(),Jb(),WS(),GS=`#version 300 es
160
+ `})),KS,qS=o((()=>{US(),Yb(),GS(),KS=`#version 300 es
161
161
  precision highp float;
162
- #define BLOBS ${Gb}
163
- #define EXTRAS ${Kb}
162
+ #define BLOBS ${Kb}
163
+ #define EXTRAS ${qb}
164
164
  #define VIEW ${152 .toFixed(1)}
165
165
  #define ORIGIN ${(-16).toFixed(1)}
166
166
  #define TAU 6.2831853
@@ -191,7 +191,7 @@ uniform float uClarity;
191
191
  uniform float uSoftness;
192
192
  uniform vec4 uPull;
193
193
  #ifdef JELLY_COAT
194
- ${US}
194
+ ${WS}
195
195
  #endif
196
196
  vec2 eyeCentre() { return uEye.xy; }
197
197
  float bodyK(vec2 p) {
@@ -261,8 +261,8 @@ vec4 extrasOver(vec2 p,vec3 ink,vec3 bodyCol,float aa){
261
261
  }
262
262
  return acc;
263
263
  }
264
- ${VS}
265
- `}));function qS(e){let t=[];for(let n=0;n<e.extraMeta.length/4;n++){let[r,,i,a]=e.extraMeta.slice(n*4,n*4+4);if(r!==2&&!(r===3&&a>.5))continue;let[o,s,c,l]=e.extras.slice(n*4,n*4+4),u=r===2?16:32,d=(e,t)=>{let a=e/u*(r===2?Math.PI:l*2)-(r===2?0:l),d=t/16*Math.PI*2,f=r===2?[Math.sin(a)*Math.cos(d),-Math.cos(a),Math.sin(a)*Math.sin(d)]:[Math.sin(a)*Math.cos(d),-Math.cos(a)*Math.cos(d),Math.sin(d)],p=r===2?[o,s,0]:[o+Math.sin(a)*c,s-Math.cos(a)*c,0],m=r===2?c:i*.5;return[...p.map((e,t)=>e+f[t]*m),...f,n]},f=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]].reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r];for(let e of o)t.push(...e)};for(let e=0;e<u;e++)for(let t=0;t<16;t++){let n=d(e,t),r=d(e+1,t),i=d(e+1,t+1),a=d(e,t+1);f(n,r,i),f(n,i,a)}}return new Float32Array(t)}function JS(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aExtra`,1,24]];return{draw(i){let a=`${i.extras.join(`,`)}:${i.extraMeta.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: accessory allocation failed`);let r=qS(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var YS=o((()=>{})),XS,ZS,QS=o((()=>{KS(),XS=`${GS}
264
+ ${HS}
265
+ `}));function JS(e){let t=[];for(let n=0;n<e.extraMeta.length/4;n++){let[r,,i,a]=e.extraMeta.slice(n*4,n*4+4);if(r!==2&&!(r===3&&a>.5))continue;let[o,s,c,l]=e.extras.slice(n*4,n*4+4),u=r===2?16:32,d=(e,t)=>{let a=e/u*(r===2?Math.PI:l*2)-(r===2?0:l),d=t/16*Math.PI*2,f=r===2?[Math.sin(a)*Math.cos(d),-Math.cos(a),Math.sin(a)*Math.sin(d)]:[Math.sin(a)*Math.cos(d),-Math.cos(a)*Math.cos(d),Math.sin(d)],p=r===2?[o,s,0]:[o+Math.sin(a)*c,s-Math.cos(a)*c,0],m=r===2?c:i*.5;return[...p.map((e,t)=>e+f[t]*m),...f,n]},f=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]].reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r];for(let e of o)t.push(...e)};for(let e=0;e<u;e++)for(let t=0;t<16;t++){let n=d(e,t),r=d(e+1,t),i=d(e+1,t+1),a=d(e,t+1);f(n,r,i),f(n,i,a)}}return new Float32Array(t)}function YS(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aExtra`,1,24]];return{draw(i){let a=`${i.extras.join(`,`)}:${i.extraMeta.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: accessory allocation failed`);let r=JS(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var XS=o((()=>{})),ZS,QS,$S=o((()=>{qS(),ZS=`${KS}
266
266
  in vec3 aPosition;
267
267
  in vec3 aNormal;
268
268
  in float aExtra;
@@ -277,7 +277,7 @@ void main(){
277
277
  vAlpha=mix(uExtraMeta[index].y,1.0,0.65);
278
278
  gl_Position=projectCoat(poseCoat(p));
279
279
  }
280
- `,ZS=`${GS}
280
+ `,QS=`${KS}
281
281
  in vec3 vNormal;
282
282
  in float vAlpha;
283
283
  out vec4 outColor;
@@ -290,7 +290,7 @@ void main(){
290
290
  color+=uTip*pow(1.0-abs(n.z),3.0)*0.2;
291
291
  outColor=vec4(color*vAlpha,vAlpha);
292
292
  }
293
- `})),$S,eC=o((()=>{$S={inflate:27,softness:.05,clarity:.15}}));function tC(e,t,n){let r=e.createShader(t);if(!r)throw Error(`engenty fur: could not create shader`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(`engenty fur: shader compile failed — ${t}`)}return r}function nC(e,t,n){let r=e.getContext(`webgl2`,{alpha:!0,antialias:!0,depth:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,stencil:!1});if(!r)return null;let i=null;try{let e=tC(r,r.VERTEX_SHADER,n.vertex),a=tC(r,r.FRAGMENT_SHADER,t);if(i=r.createProgram(),!i)throw Error(`engenty fur: could not create program`);if(r.attachShader(i,e),r.attachShader(i,a),r.linkProgram(i),r.deleteShader(e),r.deleteShader(a),!r.getProgramParameter(i,r.LINK_STATUS))throw Error(`engenty fur: link failed — ${r.getProgramInfoLog(i)}`)}catch(e){return i&&r.deleteProgram(i),console.error(e),null}let a={};for(let e of rC)a[e]=r.getUniformLocation(i,e);let o=r.createVertexArray();r.bindVertexArray(o);let s=n.geometry(r,i),c=r.useProgram.bind(r);r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA);let l=!1,u=1;return{dispose(){l||(l=!0,s.dispose(),r.deleteVertexArray(o),r.deleteProgram(i))},render(e){l||(c(i),r.bindVertexArray(o),r.uniform2f(a.uResolution,u,u),r.uniform1f(a.uTime,e.time),r.uniform4fv(a.uBlobs,e.blobs),r.uniform1f(a.uFalloff,e.falloff),r.uniform1f(a.uScale,e.scale),r.uniform1f(a.uFur,e.fur),r.uniform1f(a.uPeriod,e.period),r.uniform1f(a.uInflate,e.inflate),r.uniform1f(a.uDensity,e.density),r.uniform1f(a.uThick,e.thick),r.uniform1f(a.uClarity,e.clarity),r.uniform1f(a.uSoftness,e.softness??$S.softness),r.uniform4fv(a.uPull,e.pull??[60,60,0,0]),r.uniform2fv(a.uLean,e.lean),r.uniform3fv(a.uLight,e.light),r.uniform3fv(a.uBody,e.body),r.uniform3fv(a.uDeep,e.deep),r.uniform3fv(a.uTip,e.tip),r.uniform3fv(a.uEye,e.eye),r.uniform1f(a.uWind,e.wind),r.uniform2fv(a.uGaze,e.gaze),r.uniform2fv(a.uTurn,e.turn??[0,0]),r.uniform1f(a.uGoggles,+!!e.goggles),r.uniform4fv(a.uExtras,e.extras),r.uniform4fv(a.uExtraMeta,e.extraMeta),r.uniform2fv(a.uWobble,e.wobble),r.enable(r.SCISSOR_TEST),r.scissor(0,0,u,u),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.depthMask(!0),r.frontFace(r.CW),n.doubleSided?r.disable(r.CULL_FACE):(r.enable(r.CULL_FACE),r.cullFace(r.BACK)),n.clear!==!1&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),r.depthMask(n.depthWrite!==!1),s.draw(e))},viewport(e){l||(u=e,r.viewport(0,0,e,e))}}}var rC,iC=o((()=>{eC(),rC=`uResolution.uTime.uBlobs.uFalloff.uScale.uFur.uPeriod.uInflate.uDensity.uThick.uLean.uLight.uBody.uDeep.uTip.uEye.uWind.uGaze.uTurn.uGoggles.uExtras.uExtraMeta.uWobble.uClarity.uSoftness.uPull`.split(`.`)}));function aC(e){return`${e.blobs.join(`,`)}:${e.falloff}:${e.inflate}`}function oC(e,t){let n=0,r=[0,0,0];for(let i=0;i<t.blobs.length;i+=4){let a=t.blobs[i+2],o=t.blobs[i+3];if(a<=0||o<=0)continue;let s=a*t.inflate/30,c=e[0]-t.blobs[i],l=e[1]-t.blobs[i+1],u=e[2],d=Math.exp(-t.falloff*(c*c/(a*a)+l*l/(o*o)+u*u/(s*s)));n+=d,r[0]+=d*c/(a*a),r[1]+=d*l/(o*o),r[2]+=d*u/(s*s)}let i=Math.hypot(...r)||1;return{value:n,normal:[r[0]/i,r[1]/i,r[2]/i]}}function sC(e){let t=aC(e),n=cC.get(t);if(n)return n;let r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(let t=0;t<e.blobs.length;t+=4){if(e.blobs[t+2]<=0)continue;let n=[e.blobs[t],e.blobs[t+1],0],a=[e.blobs[t+2],e.blobs[t+3],e.blobs[t+2]*e.inflate/30];for(let e=0;e<3;e++)r[e]=Math.min(r[e],n[e]-a[e]*1.5),i[e]=Math.max(i[e],n[e]+a[e]*1.5)}let a=2.7,[o,s,c]=i.map((e,t)=>Math.ceil((e-r[t])/a)+1),l=[],u=[];for(let t=0;t<c;t++)for(let n=0;n<s;n++)for(let i=0;i<o;i++){let o=[r[0]+i*a,r[1]+n*a,r[2]+t*a];l.push(o),u.push(oC(o,e).value)}let d=Math.exp(-e.falloff),f=[],p=0,m=(e,t)=>{let n=(d-u[e])/(u[t]-u[e]);return[0,1,2].map(r=>l[e][r]+(l[t][r]-l[e][r])*n)},h=(t,n,r)=>{let i=n.map((e,n)=>e-t[n]),a=r.map((e,n)=>e-t[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]],s=Math.hypot(...o)*.5;if(s<1e-9)return;let c=oC(t,e).normal,l=o.reduce((e,t,n)=>e+t*c[n],0)<0?[t,r,n]:[t,n,r];for(let t of l)f.push(...t,...oC(t,e).normal);p+=s};for(let e=0;e<c-1;e++)for(let t=0;t<s-1;t++)for(let n=0;n<o-1;n++){let r=n+o*(t+s*e),i=o*s,a=[r,r+1,r+o+1,r+o,r+i,r+i+1,r+i+o+1,r+i+o];if(!(a.every(e=>u[e]<d)||a.every(e=>u[e]>=d)))for(let e of lC){let t=e.map(e=>a[e]).filter(e=>u[e]>=d),n=e.map(e=>a[e]).filter(e=>u[e]<d);if(t.length===1)h(...n.map(e=>m(t[0],e)));else if(t.length===3)h(...t.map(e=>m(n[0],e)));else if(t.length===2){let e=m(t[0],n[0]),r=m(t[0],n[1]),i=m(t[1],n[0]),a=m(t[1],n[1]);h(e,r,i),h(r,a,i)}}}let g={vertices:new Float32Array(f),area:p};if(cC.set(t,g),cC.size>24){let e=cC.keys().next().value;e&&cC.delete(e)}return g}var cC,lC,uC=o((()=>{cC=new Map,lC=[[0,5,1,6],[0,1,2,6],[0,2,3,6],[0,3,7,6],[0,7,4,6],[0,4,5,6]]}));function dC(e,t,n){let r=0,i=200;for(let a=0;a<24;a++){let a=(r+i)/2,o=0;for(let r=0;r<e.blobs.length;r+=4){let[i,s,c,l]=e.blobs.slice(r,r+4);c<=0||(o+=Math.exp(-e.falloff*(((t-i)/c)**2+((n-s)/l)**2+(a/(c*e.inflate/30))**2)))}o>Math.exp(-e.falloff)?r=a:i=a}return(r+i)/2}function fC(e){let t=[],[n,r,i]=e.eye,a=i*1.35,o=dC(e,n,r),s=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]];for(let i of o.reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r])t.push(...i)},c=(e,t,n)=>{for(let r=0;r<e;r++)for(let i=0;i<t;i++){let a=n(r/e,i/t),o=n((r+1)/e,i/t),c=n((r+1)/e,(i+1)/t),l=n(r/e,(i+1)/t);s(a,o,c),s(a,c,l)}},l=(e,t,i,a,s)=>c(96,16,(c,l)=>{let u=c*Math.PI*2,d=l*Math.PI*2,f=Math.cos(u)*Math.cos(d)/t,p=Math.sin(u)*Math.cos(d)/t,m=Math.sin(d)/a,h=Math.hypot(f,p,m);return[n+Math.cos(u)*(e+Math.cos(d)*t),r+Math.sin(u)*(e+Math.cos(d)*t),o+i+Math.sin(d)*a,f/h,p/h,m/h,s]});l(a*1.14,a*.2,.3,1.5,0),l(a*1.13,a*.14,2.1,1.8,1);for(let e=0;e<4;e++){let t=Math.PI/4+e*Math.PI/2,i=n+Math.cos(t)*a*1.13,s=r+Math.sin(t)*a*1.13;c(10,12,(e,t)=>{let n=e*Math.PI,r=t*Math.PI*2,a=[Math.sin(n)*Math.cos(r),Math.sin(n)*Math.sin(r),Math.cos(n)];return[i+a[0]*.65,s+a[1]*.65,o+3.9+a[2]*.4,...a,2]})}return c(18,96,(e,t)=>{let i=t*Math.PI*2,s=Math.cos(i)*e,c=Math.sin(i)*e,l=[s*.45,c*.45,1],u=Math.hypot(...l);return[n+s*a,r+c*a,o+2.4+2.3*(1-e*e),l[0]/u,l[1]/u,l[2]/u,3]}),new Float32Array(t)}function pC(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aMaterial`,1,24]];return{draw(i){if(!i.goggles)return;let a=`${aC(i)}:${i.eye.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: goggle allocation failed`);let r=fC(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let{buffer:t}of n.values())e.deleteBuffer(t);n.clear()}}}var mC=o((()=>{uC()})),hC,gC,_C=o((()=>{KS(),hC=`${GS}
293
+ `})),eC,tC=o((()=>{eC={inflate:27,softness:.05,clarity:.15}}));function nC(e,t,n){let r=e.createShader(t);if(!r)throw Error(`engenty fur: could not create shader`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(`engenty fur: shader compile failed — ${t}`)}return r}function rC(e,t,n){let r=e.getContext(`webgl2`,{alpha:!0,antialias:!0,depth:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,stencil:!1});if(!r)return null;let i=null;try{let e=nC(r,r.VERTEX_SHADER,n.vertex),a=nC(r,r.FRAGMENT_SHADER,t);if(i=r.createProgram(),!i)throw Error(`engenty fur: could not create program`);if(r.attachShader(i,e),r.attachShader(i,a),r.linkProgram(i),r.deleteShader(e),r.deleteShader(a),!r.getProgramParameter(i,r.LINK_STATUS))throw Error(`engenty fur: link failed — ${r.getProgramInfoLog(i)}`)}catch(e){return i&&r.deleteProgram(i),console.error(e),null}let a={};for(let e of iC)a[e]=r.getUniformLocation(i,e);let o=r.createVertexArray();r.bindVertexArray(o);let s=n.geometry(r,i),c=r.useProgram.bind(r);r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA);let l=!1,u=1;return{dispose(){l||(l=!0,s.dispose(),r.deleteVertexArray(o),r.deleteProgram(i))},render(e){l||(c(i),r.bindVertexArray(o),r.uniform2f(a.uResolution,u,u),r.uniform1f(a.uTime,e.time),r.uniform4fv(a.uBlobs,e.blobs),r.uniform1f(a.uFalloff,e.falloff),r.uniform1f(a.uScale,e.scale),r.uniform1f(a.uFur,e.fur),r.uniform1f(a.uPeriod,e.period),r.uniform1f(a.uInflate,e.inflate),r.uniform1f(a.uDensity,e.density),r.uniform1f(a.uThick,e.thick),r.uniform1f(a.uClarity,e.clarity),r.uniform1f(a.uSoftness,e.softness??eC.softness),r.uniform4fv(a.uPull,e.pull??[60,60,0,0]),r.uniform2fv(a.uLean,e.lean),r.uniform3fv(a.uLight,e.light),r.uniform3fv(a.uBody,e.body),r.uniform3fv(a.uDeep,e.deep),r.uniform3fv(a.uTip,e.tip),r.uniform3fv(a.uEye,e.eye),r.uniform1f(a.uWind,e.wind),r.uniform2fv(a.uGaze,e.gaze),r.uniform2fv(a.uTurn,e.turn??[0,0]),r.uniform1f(a.uGoggles,+!!e.goggles),r.uniform4fv(a.uExtras,e.extras),r.uniform4fv(a.uExtraMeta,e.extraMeta),r.uniform2fv(a.uWobble,e.wobble),r.enable(r.SCISSOR_TEST),r.scissor(0,0,u,u),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.depthMask(!0),r.frontFace(r.CW),n.doubleSided?r.disable(r.CULL_FACE):(r.enable(r.CULL_FACE),r.cullFace(r.BACK)),n.clear!==!1&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),r.depthMask(n.depthWrite!==!1),s.draw(e))},viewport(e){l||(u=e,r.viewport(0,0,e,e))}}}var iC,aC=o((()=>{tC(),iC=`uResolution.uTime.uBlobs.uFalloff.uScale.uFur.uPeriod.uInflate.uDensity.uThick.uLean.uLight.uBody.uDeep.uTip.uEye.uWind.uGaze.uTurn.uGoggles.uExtras.uExtraMeta.uWobble.uClarity.uSoftness.uPull`.split(`.`)}));function oC(e){return`${e.blobs.join(`,`)}:${e.falloff}:${e.inflate}`}function sC(e,t){let n=0,r=[0,0,0];for(let i=0;i<t.blobs.length;i+=4){let a=t.blobs[i+2],o=t.blobs[i+3];if(a<=0||o<=0)continue;let s=a*t.inflate/30,c=e[0]-t.blobs[i],l=e[1]-t.blobs[i+1],u=e[2],d=Math.exp(-t.falloff*(c*c/(a*a)+l*l/(o*o)+u*u/(s*s)));n+=d,r[0]+=d*c/(a*a),r[1]+=d*l/(o*o),r[2]+=d*u/(s*s)}let i=Math.hypot(...r)||1;return{value:n,normal:[r[0]/i,r[1]/i,r[2]/i]}}function cC(e){let t=oC(e),n=lC.get(t);if(n)return n;let r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(let t=0;t<e.blobs.length;t+=4){if(e.blobs[t+2]<=0)continue;let n=[e.blobs[t],e.blobs[t+1],0],a=[e.blobs[t+2],e.blobs[t+3],e.blobs[t+2]*e.inflate/30];for(let e=0;e<3;e++)r[e]=Math.min(r[e],n[e]-a[e]*1.5),i[e]=Math.max(i[e],n[e]+a[e]*1.5)}let a=2.7,[o,s,c]=i.map((e,t)=>Math.ceil((e-r[t])/a)+1),l=[],u=[];for(let t=0;t<c;t++)for(let n=0;n<s;n++)for(let i=0;i<o;i++){let o=[r[0]+i*a,r[1]+n*a,r[2]+t*a];l.push(o),u.push(sC(o,e).value)}let d=Math.exp(-e.falloff),f=[],p=0,m=(e,t)=>{let n=(d-u[e])/(u[t]-u[e]);return[0,1,2].map(r=>l[e][r]+(l[t][r]-l[e][r])*n)},h=(t,n,r)=>{let i=n.map((e,n)=>e-t[n]),a=r.map((e,n)=>e-t[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]],s=Math.hypot(...o)*.5;if(s<1e-9)return;let c=sC(t,e).normal,l=o.reduce((e,t,n)=>e+t*c[n],0)<0?[t,r,n]:[t,n,r];for(let t of l)f.push(...t,...sC(t,e).normal);p+=s};for(let e=0;e<c-1;e++)for(let t=0;t<s-1;t++)for(let n=0;n<o-1;n++){let r=n+o*(t+s*e),i=o*s,a=[r,r+1,r+o+1,r+o,r+i,r+i+1,r+i+o+1,r+i+o];if(!(a.every(e=>u[e]<d)||a.every(e=>u[e]>=d)))for(let e of uC){let t=e.map(e=>a[e]).filter(e=>u[e]>=d),n=e.map(e=>a[e]).filter(e=>u[e]<d);if(t.length===1)h(...n.map(e=>m(t[0],e)));else if(t.length===3)h(...t.map(e=>m(n[0],e)));else if(t.length===2){let e=m(t[0],n[0]),r=m(t[0],n[1]),i=m(t[1],n[0]),a=m(t[1],n[1]);h(e,r,i),h(r,a,i)}}}let g={vertices:new Float32Array(f),area:p};if(lC.set(t,g),lC.size>24){let e=lC.keys().next().value;e&&lC.delete(e)}return g}var lC,uC,dC=o((()=>{lC=new Map,uC=[[0,5,1,6],[0,1,2,6],[0,2,3,6],[0,3,7,6],[0,7,4,6],[0,4,5,6]]}));function fC(e,t,n){let r=0,i=200;for(let a=0;a<24;a++){let a=(r+i)/2,o=0;for(let r=0;r<e.blobs.length;r+=4){let[i,s,c,l]=e.blobs.slice(r,r+4);c<=0||(o+=Math.exp(-e.falloff*(((t-i)/c)**2+((n-s)/l)**2+(a/(c*e.inflate/30))**2)))}o>Math.exp(-e.falloff)?r=a:i=a}return(r+i)/2}function pC(e){let t=[],[n,r,i]=e.eye,a=i*1.35,o=fC(e,n,r),s=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]];for(let i of o.reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r])t.push(...i)},c=(e,t,n)=>{for(let r=0;r<e;r++)for(let i=0;i<t;i++){let a=n(r/e,i/t),o=n((r+1)/e,i/t),c=n((r+1)/e,(i+1)/t),l=n(r/e,(i+1)/t);s(a,o,c),s(a,c,l)}},l=(e,t,i,a,s)=>c(96,16,(c,l)=>{let u=c*Math.PI*2,d=l*Math.PI*2,f=Math.cos(u)*Math.cos(d)/t,p=Math.sin(u)*Math.cos(d)/t,m=Math.sin(d)/a,h=Math.hypot(f,p,m);return[n+Math.cos(u)*(e+Math.cos(d)*t),r+Math.sin(u)*(e+Math.cos(d)*t),o+i+Math.sin(d)*a,f/h,p/h,m/h,s]});l(a*1.14,a*.2,.3,1.5,0),l(a*1.13,a*.14,2.1,1.8,1);for(let e=0;e<4;e++){let t=Math.PI/4+e*Math.PI/2,i=n+Math.cos(t)*a*1.13,s=r+Math.sin(t)*a*1.13;c(10,12,(e,t)=>{let n=e*Math.PI,r=t*Math.PI*2,a=[Math.sin(n)*Math.cos(r),Math.sin(n)*Math.sin(r),Math.cos(n)];return[i+a[0]*.65,s+a[1]*.65,o+3.9+a[2]*.4,...a,2]})}return c(18,96,(e,t)=>{let i=t*Math.PI*2,s=Math.cos(i)*e,c=Math.sin(i)*e,l=[s*.45,c*.45,1],u=Math.hypot(...l);return[n+s*a,r+c*a,o+2.4+2.3*(1-e*e),l[0]/u,l[1]/u,l[2]/u,3]}),new Float32Array(t)}function mC(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aMaterial`,1,24]];return{draw(i){if(!i.goggles)return;let a=`${oC(i)}:${i.eye.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: goggle allocation failed`);let r=pC(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let{buffer:t}of n.values())e.deleteBuffer(t);n.clear()}}}var hC=o((()=>{dC()})),gC,_C,vC=o((()=>{qS(),gC=`${KS}
294
294
  in vec3 aPosition;
295
295
  in vec3 aNormal;
296
296
  in float aMaterial;
@@ -301,7 +301,7 @@ void main(){
301
301
  vMaterial=int(aMaterial+0.5);
302
302
  gl_Position=projectCoat(poseCoat(aPosition));
303
303
  }
304
- `,gC=`${GS}
304
+ `,_C=`${KS}
305
305
  in vec3 vNormal;
306
306
  flat in int vMaterial;
307
307
  out vec4 outColor;
@@ -321,7 +321,7 @@ void main(){
321
321
  vec3 color=base*(0.4+diffuse*0.75)+reflected*(vMaterial==0?0.04:0.27)+vec3(1.0,0.9,0.65)*spec*(vMaterial==0?0.1:0.8);
322
322
  outColor=vec4(color,1.0);
323
323
  }
324
- `})),vC,yC,bC,xC=o((()=>{KS(),vC=`${GS}
324
+ `})),yC,bC,xC,SC=o((()=>{qS(),yC=`${KS}
325
325
  in vec3 aPosition;
326
326
  in vec3 aNormal;
327
327
  out vec3 vLocal;
@@ -331,11 +331,11 @@ void main(){
331
331
  vNormal=poseNormal(aPosition,aNormal);
332
332
  gl_Position=projectCoat(poseCoat(aPosition));
333
333
  }
334
- `,yC=`
334
+ `,bC=`
335
335
  in vec3 vLocal;
336
336
  in vec3 vNormal;
337
337
  out vec4 outColor;
338
- `,bC=`${GS}${yC}
338
+ `,xC=`${KS}${bC}
339
339
  void main(){
340
340
  vec2 p=vLocal.xy;
341
341
  vec3 n=normalize(vNormal),light=normalize(uLight);
@@ -368,7 +368,7 @@ void main(){
368
368
  vec4 goggles=gogglesOver(p,aa,front);
369
369
  outColor=vec4(goggles.rgb+color*(1.0-goggles.a),1.0);
370
370
  }
371
- `})),SC,CC=o((()=>{KS(),xC(),SC=`${GS}${yC}
371
+ `})),CC,wC=o((()=>{qS(),SC(),CC=`${KS}${bC}
372
372
  /** Luminance, for turning a reflection into coverage. */
373
373
  float lum(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
374
374
 
@@ -509,7 +509,7 @@ void main(){
509
509
  vec4 goggles = gogglesOver(p, aaPx, front);
510
510
  outColor = goggles + acc * (1.0 - goggles.a);
511
511
  }
512
- `}));function wC(e,t,n,r,i){let a=-Math.sin(n[0]),o=Math.cos(n[0])*Math.sin(n[1]),s=Math.cos(n[0])*Math.cos(n[1]),c=1/0,l=-1/0;for(let t=0;t<e.length;t+=EC){let n=e[t]*a+e[t+1]*o+e[t+2]*s;c=Math.min(c,n),l=Math.max(l,n)}i.fill(0);let u=255/Math.max(l-c,.001);for(let t=0;t<r.length;t++){let n=t*EC,l=e[n]*a+e[n+1]*o+e[n+2]*s,d=Math.min(255,Math.max(0,Math.floor((l-c)*u)));r[t]=d,i[d]++}let d=0;for(let e=0;e<DC;e++){let t=i[e];i[e]=d,d+=t}for(let n=0;n<r.length;n++){let a=i[r[n]]++*EC;for(let r=0;r<EC;r++)t[a+r]=e[n*EC+r]}}function TC(e){return{roots:e,sorted:new Float32Array(e.length),buckets:new Uint16Array(e.length/EC),counts:new Uint32Array(DC),yaw:NaN,pitch:NaN}}var EC,DC,OC=o((()=>{EC=8,DC=256}));function kC(e){let t=sC(e),n=781,r=()=>(n=(n*1664525+1013904223)%4294967296,n/4294967296),i=[],a=Math.min(200,Math.max(10,e.density))**2/4e3,o=t.vertices;for(let e=0;e<o.length;e+=18){let t=[o[e+6]-o[e],o[e+7]-o[e+1],o[e+8]-o[e+2]],n=[o[e+12]-o[e],o[e+13]-o[e+1],o[e+14]-o[e+2]],s=Math.hypot(t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0])*.5*a,c=Math.floor(s)+ +(r()<s%1);for(let t=0;t<c;t++){let t=Math.sqrt(r()),n=r(),a=[1-t,t*(1-n),t*n],s=Array.from({length:6},(t,n)=>a.reduce((t,r,i)=>t+r*o[e+i*6+n],0)),c=Math.hypot(s[3],s[4],s[5]);i.push(s[0],s[1],s[2],s[3]/c,s[4]/c,s[5]/c,r(),r())}}return new Float32Array(i)}function AC(e,t){let n=new Map,r=e.getAttribLocation(t,`aRoot`),i=e.getAttribLocation(t,`aNormal`),a=e.getAttribLocation(t,`aRandom`);return{draw(t){let o=`${aC(t)}:${t.density}`,s=n.get(o);if(!s){let r=e.createBuffer();if(!r)throw Error(`engenty: strand allocation failed`);let i=kC(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i,e.DYNAMIC_DRAW),s={buffer:r,count:i.length/8,order:TC(i)},n.set(o,s),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,s.buffer);let c=t.turn??[0,0],l=s.order;(l.yaw!==c[0]||l.pitch!==c[1])&&(wC(l.roots,l.sorted,c,l.buckets,l.counts),e.bufferSubData(e.ARRAY_BUFFER,0,l.sorted),l.yaw=c[0],l.pitch=c[1]);for(let[t,n,o]of[[r,3,0],[i,3,12],[a,2,24]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n,e.FLOAT,!1,32,o),e.vertexAttribDivisor(t,1);e.drawArraysInstanced(e.TRIANGLE_STRIP,0,18,s.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var jC=o((()=>{OC(),uC()})),MC,NC,PC=o((()=>{KS(),MC=`${GS}
512
+ `}));function TC(e,t,n,r,i){let a=-Math.sin(n[0]),o=Math.cos(n[0])*Math.sin(n[1]),s=Math.cos(n[0])*Math.cos(n[1]),c=1/0,l=-1/0;for(let t=0;t<e.length;t+=DC){let n=e[t]*a+e[t+1]*o+e[t+2]*s;c=Math.min(c,n),l=Math.max(l,n)}i.fill(0);let u=255/Math.max(l-c,.001);for(let t=0;t<r.length;t++){let n=t*DC,l=e[n]*a+e[n+1]*o+e[n+2]*s,d=Math.min(255,Math.max(0,Math.floor((l-c)*u)));r[t]=d,i[d]++}let d=0;for(let e=0;e<OC;e++){let t=i[e];i[e]=d,d+=t}for(let n=0;n<r.length;n++){let a=i[r[n]]++*DC;for(let r=0;r<DC;r++)t[a+r]=e[n*DC+r]}}function EC(e){return{roots:e,sorted:new Float32Array(e.length),buckets:new Uint16Array(e.length/DC),counts:new Uint32Array(OC),yaw:NaN,pitch:NaN}}var DC,OC,kC=o((()=>{DC=8,OC=256}));function AC(e){let t=cC(e),n=781,r=()=>(n=(n*1664525+1013904223)%4294967296,n/4294967296),i=[],a=Math.min(200,Math.max(10,e.density))**2/4e3,o=t.vertices;for(let e=0;e<o.length;e+=18){let t=[o[e+6]-o[e],o[e+7]-o[e+1],o[e+8]-o[e+2]],n=[o[e+12]-o[e],o[e+13]-o[e+1],o[e+14]-o[e+2]],s=Math.hypot(t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0])*.5*a,c=Math.floor(s)+ +(r()<s%1);for(let t=0;t<c;t++){let t=Math.sqrt(r()),n=r(),a=[1-t,t*(1-n),t*n],s=Array.from({length:6},(t,n)=>a.reduce((t,r,i)=>t+r*o[e+i*6+n],0)),c=Math.hypot(s[3],s[4],s[5]);i.push(s[0],s[1],s[2],s[3]/c,s[4]/c,s[5]/c,r(),r())}}return new Float32Array(i)}function jC(e,t){let n=new Map,r=e.getAttribLocation(t,`aRoot`),i=e.getAttribLocation(t,`aNormal`),a=e.getAttribLocation(t,`aRandom`);return{draw(t){let o=`${oC(t)}:${t.density}`,s=n.get(o);if(!s){let r=e.createBuffer();if(!r)throw Error(`engenty: strand allocation failed`);let i=AC(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i,e.DYNAMIC_DRAW),s={buffer:r,count:i.length/8,order:EC(i)},n.set(o,s),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,s.buffer);let c=t.turn??[0,0],l=s.order;(l.yaw!==c[0]||l.pitch!==c[1])&&(TC(l.roots,l.sorted,c,l.buckets,l.counts),e.bufferSubData(e.ARRAY_BUFFER,0,l.sorted),l.yaw=c[0],l.pitch=c[1]);for(let[t,n,o]of[[r,3,0],[i,3,12],[a,2,24]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n,e.FLOAT,!1,32,o),e.vertexAttribDivisor(t,1);e.drawArraysInstanced(e.TRIANGLE_STRIP,0,18,s.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var MC=o((()=>{kC(),dC()})),NC,PC,FC=o((()=>{qS(),NC=`${KS}
513
513
  in vec3 aRoot;
514
514
  in vec3 aNormal;
515
515
  in vec2 aRandom;
@@ -554,7 +554,7 @@ void main(){
554
554
  vAcross=side;
555
555
  vCoverage=min(1.0,radius/(pixel*0.7))*socket*(1.0-strap*0.85);
556
556
  }
557
- `,NC=`#version 300 es
557
+ `,PC=`#version 300 es
558
558
  precision highp float;
559
559
  in vec3 vColor;
560
560
  in float vAcross;
@@ -565,18 +565,18 @@ void main(){
565
565
  if(alpha<0.025)discard;
566
566
  outColor=vec4(vColor*alpha,alpha);
567
567
  }
568
- `}));function FC(e,t){let n=new Map,r=e.getAttribLocation(t,`aPosition`),i=e.getAttribLocation(t,`aNormal`);return{draw(t){let a=aC(t),o=n.get(a);if(!o){let r=e.createBuffer();if(!r)throw Error(`engenty: body allocation failed`);let i=sC(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i.vertices,e.STATIC_DRAW),o={buffer:r,count:i.vertices.length/6},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[t,n]of[[r,0],[i,12]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,3,e.FLOAT,!1,24,n);e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var IC=o((()=>{uC()}));function LC(e,t){let n=nC(e,t===`fur`?bC:SC,{vertex:t===`fur`?vC:vC.replace(`#version 300 es`,`#version 300 es
569
- #define JELLY_COAT`),geometry:FC});if(!n)return null;let r=[n];if(t===`fur`){let t=nC(e,NC,{vertex:MC,geometry:AC,clear:!1,doubleSided:!0,depthWrite:!1});if(!t)return n.dispose(),null;r.push(t)}let i=nC(e,ZS,{vertex:XS,geometry:JS,clear:!1});if(!i){for(let e of r)e.dispose();return null}r.push(i);let a=nC(e,gC,{vertex:t===`jelly`?hC.replace(`#version 300 es`,`#version 300 es
570
- #define JELLY_COAT`):hC,geometry:pC,clear:!1});if(!a){for(let e of r)e.dispose();return null}return r.push(a),{render(e){for(let t of r)t.render(e)},viewport(e){for(let t of r)t.viewport(e)},dispose(){for(let e of r)e.dispose()}}}var RC=o((()=>{YS(),QS(),iC(),mC(),_C(),CC(),jC(),PC(),IC(),xC()}));function zC(e){if(HC.has(e)||typeof document>`u`)return null;let t=document.createElement(`canvas`);t.width=1,t.height=1;let n=LC(t,e);return n?(t.addEventListener(`webglcontextlost`,t=>{t.preventDefault(),VC.delete(e)}),{canvas:t,refs:0,renderer:n,size:0}):(HC.add(e),null)}function BC(e=`fur`){let t=VC.get(e);if(!t){let n=zC(e);if(!n)return null;VC.set(e,n),t=n}let n=t;n.refs+=1;let r=!1;return{drawInto(t,i,a){if(r||VC.get(e)!==n)return;let o=i;o>n.size&&(n.size=o,n.canvas.width=o,n.canvas.height=o),n.renderer.viewport(o),n.renderer.render(a),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(n.canvas,0,n.canvas.height-o,o,o,0,0,t.canvas.width,t.canvas.height)},release(){r||(r=!0,--n.refs,n.refs<=0&&VC.get(e)===n&&(n.renderer.dispose(),VC.delete(e)))}}}var VC,HC,UC=o((()=>{RC(),VC=new Map,HC=new Set}));function WC(e,t){let n=GC/Math.max(1,Math.hypot(e,t));return[e*n,t===0?0:-t*n]}var GC,KC=o((()=>{GC=Math.PI/18}));function qC(e,t,n){if(n<=0)return;let r=3.8,i=Math.sqrt(110-r*r),a=Math.exp(-3.8*n),o=Math.cos(i*n),s=Math.sin(i*n);for(let[n,c,l]of[[`x`,`vx`,t[0]],[`y`,`vy`,t[1]]]){let t=e[n]-l,u=e[c];e[n]=l+a*(t*o+(u+r*t)/i*s),e[c]=a*(u*o-(r*u+110*t)/i*s)}}var JC=o((()=>{}));function YC(e,t){let n={x:0,y:0,vx:0,vy:0},r=[60,60],i=null,a=[0,0],o=!1,s=n=>{if(!t()||n.button!==0||i!==null)return;let s=e.getBoundingClientRect(),c=(n.clientX-s.left)/s.width*152+-16,l=(n.clientY-s.top)/s.height*152+-16;Math.hypot(c-60,l-60)>48||(r[0]=c,r[1]=l,a=[n.clientX,n.clientY],i=n.pointerId,o=!1,e.setPointerCapture(i))},c=r=>{if(r.pointerId!==i)return;if(!t()){l(r);return}let s=e.getBoundingClientRect(),c=(r.clientX-a[0])/s.width*152,u=(r.clientY-a[1])/s.height*152,d=Math.min(1,18/(Math.hypot(c,u)||1));n.x=c*d,n.y=u*d,n.vx=0,n.vy=0,o||=Math.hypot(r.clientX-a[0],r.clientY-a[1])>4},l=t=>{t.pointerId===i&&(i=null,e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId))},u=e=>{o&&=(e.preventDefault(),e.stopPropagation(),!1)};return e.addEventListener(`pointerdown`,s),e.addEventListener(`pointermove`,c),e.addEventListener(`pointerup`,l),e.addEventListener(`pointercancel`,l),e.addEventListener(`lostpointercapture`,l),e.addEventListener(`click`,u,!0),{step(e){return i===null&&qC(n,[0,0],e),[r[0],r[1],n.x,n.y]},dispose(){i!==null&&e.hasPointerCapture(i)&&e.releasePointerCapture(i),e.removeEventListener(`pointerdown`,s),e.removeEventListener(`pointermove`,c),e.removeEventListener(`pointerup`,l),e.removeEventListener(`pointercancel`,l),e.removeEventListener(`lostpointercapture`,l),e.removeEventListener(`click`,u,!0)}}}var XC=o((()=>{KS(),JC()}));function ZC(e){ew.x=e.clientX,ew.y=e.clientY;for(let e of tw)e()}function QC(){return ew}function $C(e){return!nw&&typeof window<`u`&&(nw=!0,ew.x=window.innerWidth*.62,ew.y=window.innerHeight*.28,window.addEventListener(`pointermove`,ZC,{passive:!0})),tw.add(e),()=>{tw.delete(e)}}var ew,tw,nw,rw=o((()=>{ew={x:0,y:0},tw=new Set,nw=!1})),iw=c({FluffyEngenty:()=>aw});function aw({className:e,motion:t=`auto`,animationSpeed:n=1,turn:r,coat:i=`fur`,goggles:a=!1,interactive:o=!0,look:s=null,kind:c=`round`,overrides:l,quality:u=`high`,size:d=260}){let f=(0,ow.useRef)(null),p=(0,ow.useRef)(null),m=(0,ow.useRef)(0);m.current===0&&(uw+=1,m.current=uw*dw);let h=(0,ow.useRef)(null),[g,_]=(0,ow.useState)(!0),v=Wb[c],y=(0,ow.useMemo)(()=>Hb(v),[v]),b=(0,ow.useMemo)(()=>Ub(v),[v]),x=(0,ow.useMemo)(()=>Vb(v),[v]),S=(0,ow.useRef)({animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d});return S.current={animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d},(0,ow.useEffect)(()=>{f.current?.()},[c,l,u,d,o,s,a,t,n,r]),(0,ow.useEffect)(()=>{let e=p.current,t=h.current;if(!(e&&t))return;let n=e.getContext(`2d`),r=n?BC(i):null;if(!(n&&r)){_(!1);return}let a=m.current,o=window.matchMedia(`(prefers-reduced-motion: reduce)`),s={x:0,y:0},c={x:0,y:0},l={vx:0,vy:0,x:0,y:0},u=0,d=!0,g=0,v=0,y=i===`jelly`?YC(t,()=>S.current.interactive&&S.current.motion!==`pause`&&(S.current.motion===`play`||!o.matches)):null,b=f=>{u=0;let p=S.current,m=cw[p.quality],h=p.motion===`pause`||p.motion===`auto`&&o.matches,_=h?0:Math.min((f-(v||f))/1e3,.1);g+=_*Math.max(.1,Math.min(2,p.animationSpeed)),v=f;let x=Math.min(window.devicePixelRatio||1,m.dprCap),C=Math.max(1,Math.round(p.size*x));e.width!==C&&(e.width=C,e.height=C);let w=120*C/(lw*152),T=p.overrides?.fur??p.form.fur;if((p.interactive||p.look)&&!h){let e,n,r,i;if(p.look)e=p.look.x,n=p.look.y,r=Math.hypot(e,n)||1,i=Math.min(1,r);else{let a=t.getBoundingClientRect(),o=QC();e=o.x-(a.left+a.width*.5),n=o.y-(a.top+a.height*.48),r=Math.hypot(e,n)||1,i=.35+Math.min(1,r/(a.width*2.4||1))*.65}s.x+=(e/r*5.5*i-s.x)*.16,s.y+=(n/r*3.5*i-s.y)*.16,c.x+=(e/r*i-c.x)*.24,c.y+=(n/r*.9*i-c.y)*.24}qC(l,[s.x,s.y],_*Math.max(.1,Math.min(2,p.animationSpeed)));let E=FS(t,p.kind);r.drawInto(n,C,{blobs:p.blobs,clarity:p.overrides?.clarity??$S.clarity,softness:p.overrides?.softness??$S.softness,pull:y?.step(_*Math.max(.1,Math.min(2,p.animationSpeed))),body:E.body,deep:E.deep,density:Math.min(p.overrides?.density??m.density,w),extraMeta:p.extras.meta,extras:p.extras.geometry,eye:[p.form.eye.x,p.form.eye.y,p.form.eye.r],gaze:[c.x,c.y],goggles:p.goggles,turn:p.turn?WC(p.turn.yaw/GC,p.turn.pitch/GC):WC(c.x,c.y),fur:T,inflate:p.overrides?.inflate??(i===`jelly`?$S.inflate:pw),lean:[s.x,s.y],light:fw,period:p.form.period,scale:p.scale,falloff:p.form.falloff,thick:p.overrides?.thick??m.thick,time:g+a,tip:E.tip,wind:p.overrides?.wind??mw,wobble:[l.x-s.x,l.y-s.y]}),d&&!h&&(u=requestAnimationFrame(b))},x=()=>{u||=(v=0,requestAnimationFrame(b))},C=new IntersectionObserver(([e])=>{d=e?.isIntersecting??!0,d?x():u&&=(cancelAnimationFrame(u),0)},{rootMargin:`120px`});C.observe(t),f.current=x;let w=$C(x);return o.addEventListener(`change`,x),x(),()=>{f.current=null,C.disconnect(),y?.dispose(),w(),o.removeEventListener(`change`,x),u&&cancelAnimationFrame(u),r.release()}},[i]),g?(0,sw.jsxs)(`div`,{"aria-hidden":`true`,className:e,ref:h,style:{height:d,position:`relative`,width:d},children:[(0,sw.jsx)(`div`,{style:{background:`radial-gradient(closest-side, rgb(0 0 0 / 0.2), transparent)`,filter:`blur(4px)`,height:`${v.shadowRx*50/152}%`,left:`50%`,position:`absolute`,top:`${hw(110)}%`,transform:`translate(-50%, -50%)`,width:`${v.shadowRx*2.5*100/152}%`}}),(0,sw.jsx)(`canvas`,{ref:p,style:{display:`block`,height:d,width:d,touchAction:i===`jelly`&&o&&t!==`pause`?`none`:void 0,cursor:i===`jelly`&&o?`grab`:void 0}})]}):(0,sw.jsx)(Px,{className:e,goggles:a,kind:c,size:d})}var ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw=o((()=>{ow=u(f(),1),Rx(),Jb(),BS(),KS(),UC(),KC(),eC(),XC(),JC(),rw(),sw=Xb(),cw={high:{density:68,dprCap:2,thick:1},low:{density:40,dprCap:1,thick:1.15},medium:{density:55,dprCap:1.5,thick:1.05}},lw=1.7,uw=0,dw=2.399963,fw=[-.42,-.72,.75],pw=30,mw=.5,hw=e=>(e- -16)/152*100}));Rx(),b_();var _w=(0,y.lazy)(()=>y_(()=>Promise.resolve().then(()=>(gw(),iw)).then(e=>({default:e.FluffyEngenty})),void 0,import.meta.url));function vw({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=iS(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,X.jsx)(y.Suspense,{fallback:(0,X.jsx)(Px,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,X.jsx)(_w,{goggles:i,coat:c,kind:o,size:t,quality:`medium`,interactive:a})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:aS(o),borderRadius:t*.28,height:t,width:t},children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,X.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,X.jsx)(y.Suspense,{fallback:(0,X.jsx)(Px,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,X.jsx)(_w,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,X.jsx)(Px,{goggles:i,kind:o,size:t,animated:a})}function yw(e,t){this.v=e,this.k=t}function bw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xw(e){if(Array.isArray(e))return e}function Sw(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Cw(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
571
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ww(e,t){return xw(e)||Sw(e,t)||Tw(e,t)||Cw()}function Tw(e,t){if(e){if(typeof e==`string`)return bw(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bw(e,t):void 0}}function Ew(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof yw;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Ew.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Ew.prototype.next=function(e){return this._invoke(`next`,e)},Ew.prototype.throw=function(e){return this._invoke(`throw`,e)},Ew.prototype.return=function(e){return this._invoke(`return`,e)};var Dw=Object.entries,Ow=Object.setPrototypeOf,kw=Object.isFrozen,Aw=Object.getPrototypeOf,jw=Object.getOwnPropertyDescriptor,Mw=Object.freeze,Nw=Object.seal,Pw=Object.create,Fw=typeof Reflect<`u`&&Reflect,Iw=Fw.apply,Lw=Fw.construct;Mw||=function(e){return e},Nw||=function(e){return e},Iw||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Lw||=function(e){return new e(...[...arguments].slice(1))};var Rw=iT(Array.prototype.forEach);Array.prototype.indexOf;var zw=iT(Array.prototype.lastIndexOf),Bw=iT(Array.prototype.pop),Vw=iT(Array.prototype.push);Array.prototype.slice;var Hw=iT(Array.prototype.splice),Uw=Array.isArray,Ww=iT(String.prototype.toLowerCase),Gw=iT(String.prototype.toString),Kw=iT(String.prototype.match),qw=iT(String.prototype.replace),Jw=iT(String.prototype.indexOf),Yw=iT(String.prototype.trim),Xw=iT(Number.prototype.toString),Zw=iT(Boolean.prototype.toString),Qw=typeof BigInt>`u`?null:iT(BigInt.prototype.toString),$w=typeof Symbol>`u`?null:iT(Symbol.prototype.toString),eT=iT(Object.prototype.hasOwnProperty),tT=iT(Object.prototype.toString),nT=iT(RegExp.prototype.test),rT=aT(TypeError);function iT(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Iw(e,t,n)}}function aT(e){return function(){return Lw(e,[...arguments])}}function oT(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ww;if(Ow&&Ow(e,null),!Uw(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(kw(t)||(t[r]=e),i=e)}e[i]=!0}return e}function sT(e){for(let t=0;t<e.length;t++)eT(e,t)||(e[t]=null);return e}function cT(e){let t=Pw(null);for(let r of Dw(e)){var n=ww(r,2);let i=n[0],a=n[1];eT(e,i)&&(t[i]=Uw(a)?sT(a):a&&typeof a==`object`&&a.constructor===Object?cT(a):a)}return t}function lT(e){switch(typeof e){case`string`:return e;case`number`:return Xw(e);case`boolean`:return Zw(e);case`bigint`:return Qw?Qw(e):`0`;case`symbol`:return $w?$w(e):`Symbol()`;case`undefined`:return tT(e);case`function`:case`object`:{if(e===null)return tT(e);let t=e,n=uT(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:tT(e)}return tT(e)}default:return tT(e)}}function uT(e,t){for(;e!==null;){let n=jw(e,t);if(n){if(n.get)return iT(n.get);if(typeof n.value==`function`)return iT(n.value)}e=Aw(e)}function n(){return null}return n}function dT(e){try{return nT(e,``),!0}catch{return!1}}var fT=Mw(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),pT=Mw(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),mT=Mw([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),hT=Mw([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),gT=Mw(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),_T=Mw([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),vT=Mw([`#text`]),yT=Mw(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),bT=Mw(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),xT=Mw(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ST=Mw([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),CT=Nw(/{{[\w\W]*|^[\w\W]*}}/g),wT=Nw(/<%[\w\W]*|^[\w\W]*%>/g),TT=Nw(/\${[\w\W]*/g),ET=Nw(/^data-[\-\w.\u00B7-\uFFFF]+$/),DT=Nw(/^aria-[\-\w]+$/),OT=Nw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kT=Nw(/^(?:\w+script|data):/i),AT=Nw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jT=Nw(/^html$/i),MT=Nw(/^[a-z][.\w]*(-[.\w]+)+$/i),NT=Nw(/<[/\w!]/g),PT=Nw(/<[/\w]/g),FT=Nw(/<\/no(script|embed|frames)/i),IT=Nw(/\/>/i),LT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},RT=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],zT=Mw(oT({},RT)),BT=function(){let e={};return Rw(RT,t=>{e[t]=Nw(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),Mw(e)}(),VT=function(){return typeof window>`u`?null:window},HT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},UT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},WT=function(e,t,n,r){return eT(e,t)&&Uw(e[t])?oT(r.base?cT(r.base):{},e[t],r.transform):n},GT=function(e,t,n){let r=eT(e,t)?e[t]:void 0;return r&&typeof r==`object`?cT(r):n()};function KT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VT(),t=e=>KT(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==LT.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=uT(d,`cloneNode`),p=uT(d,`remove`),m=uT(d,`removeAttributeNode`),h=uT(d,`nextSibling`),g=uT(d,`childNodes`),_=uT(d,`parentNode`),v=uT(d,`shadowRoot`),y=uT(d,`attributes`),b=o&&o.prototype?uT(o.prototype,`nodeType`):null,x=o&&o.prototype?uT(o.prototype,`nodeName`):null,S=o&&o.prototype?uT(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,k=function(){if(O>0)throw rT(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},te=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},ne=function(){return ee||=(D=HT(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=UT();t.isSupported=typeof Dw==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=CT,ue=wT,de=TT,fe=ET,pe=DT,me=kT,he=AT,ge=MT,_e=OT,M=null,N=oT({},[...fT,...pT,...mT,...gT,...vT]),P=null,ve=oT({},[...yT,...bT,...xT,...ST]),ye=Object.seal(Pw(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,xe=null,Se=Object.seal(Pw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=oT({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=oT({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=oT({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,et=null,tt=oT({},[Ye,Xe,Ze],Gw),nt=Mw([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=oT({},nt),F=Mw([`annotation-xml`]),it=oT({},F),at=oT({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],ct=null,lt=null,ut=n.createElement(`form`),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&&lt===e)return;(!e||typeof e!=`object`)&&(e={}),e=cT(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ct=ot===`application/xhtml+xml`?Gw:Ww,M=WT(e,`ALLOWED_TAGS`,N,{transform:ct}),P=WT(e,`ALLOWED_ATTR`,ve,{transform:ct}),et=WT(e,`ALLOWED_NAMESPACES`,tt,{transform:Gw}),qe=WT(e,`ADD_URI_SAFE_ATTR`,Je,{transform:ct,base:Je}),Ge=WT(e,`ADD_DATA_URI_TAGS`,Ke,{transform:ct,base:Ke}),Ue=WT(e,`FORBID_CONTENTS`,We,{transform:ct}),be=WT(e,`FORBID_TAGS`,cT({}),{transform:ct}),xe=WT(e,`FORBID_ATTR`,cT({}),{transform:ct}),He=eT(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?cT(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,_e=dT(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:OT,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,rt=GT(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>oT({},nt)),it=GT(e,`HTML_INTEGRATION_POINTS`,()=>oT({},F));let t=GT(e,`CUSTOM_ELEMENT_HANDLING`,()=>Pw(null));if(ye=Pw(null),eT(t,`tagNameCheck`)&&dt(t.tagNameCheck)&&(ye.tagNameCheck=t.tagNameCheck),eT(t,`attributeNameCheck`)&&dt(t.attributeNameCheck)&&(ye.attributeNameCheck=t.attributeNameCheck),eT(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ye.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Nw(ye),De&&(we=!1),Fe&&(Pe=!0),He&&(M=oT({},vT),P=Pw(null),He.html===!0&&(oT(M,fT),oT(P,yT)),He.svg===!0&&(oT(M,pT),oT(P,bT),oT(P,ST)),He.svgFilters===!0&&(oT(M,mT),oT(P,bT),oT(P,ST)),He.mathMl===!0&&(oT(M,gT),oT(P,xT),oT(P,ST))),Se.tagCheck=null,Se.attributeCheck=null,eT(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:Uw(e.ADD_TAGS)&&(M===N&&(M=cT(M)),oT(M,e.ADD_TAGS,ct))),eT(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:Uw(e.ADD_ATTR)&&(P===ve&&(P=cT(P)),oT(P,e.ADD_ATTR,ct))),eT(e,`ADD_FORBID_CONTENTS`)&&Uw(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=cT(Ue)),oT(Ue,e.ADD_FORBID_CONTENTS,ct)),Be&&(M[`#text`]=!0),ke&&oT(M,[`html`,`head`,`body`]),M.table&&(oT(M,[`tbody`]),delete be.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw rT(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw rT(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));Mw&&Mw(e),lt=e},pt=oT({},[...pT,...mT,...hT]),mt=oT({},[...gT,..._T]),ht=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||rt[n]):!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&it[n]:!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Xe&&!it[n]||t.namespaceURI===Ye&&!rt[n]?!1:!mt[e]&&(at[e]||!pt[e])},vt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=Ww(e.tagName),r=Ww(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Xe?ht(n,t,r):e.namespaceURI===Ye?gt(n,t,r):e.namespaceURI===Ze?_t(n,t,r):!!(ot===`application/xhtml+xml`&&et[e.namespaceURI]):!1},yt=function(e){Vw(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw rT(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){wt(e);let t=g(e);if(t){let e=[];Rw(t,t=>{Vw(e,t)}),Rw(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Vw(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||P[ct(i)]||bt(e,r,i)}},wt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===LT.element&&Ct(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Tt=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Et=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===LT.processingInstruction||n===LT.comment&&nT(PT,e.data)){try{p(e)}catch{}continue}if(n===LT.element){let t=e,n=ct(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Tt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Dt=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=Kw(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},Ot=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},kt=function(e){return e=qw(e,le,` `),e=qw(e,ue,` `),e=qw(e,de,` `),e},At=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=kt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Rw(i,e=>{Mt(e.content)&&At(e.content)})},jt=function(e){let t=x?x(e):null;return typeof t!=`string`||ct(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===LT.documentFragment}catch{return!1}},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Pt(e,n,r){e.length!==0&&Rw(e,e=>{e.call(t,n,r,lt)})}let Ft=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&nT(NT,e.textContent)&&nT(NT,e.innerHTML)||Oe&&e.namespaceURI===Ze&&zT[t]&&(Nt(e.firstElementChild)||typeof e.textContent==`string`&&nT(BT[t],e.textContent))||e.nodeType===LT.processingInstruction||Oe&&e.nodeType===LT.comment&&nT(PT,e.data))},It=function(e,t){return e instanceof RegExp?nT(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Lt=function(e,t,n){if(!be[t]&&Ut(t)&&It(ye.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Rt=function(e,t,n,r){return e.length===0?t:t===n||t===r?cT(t):t},zt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&wt(e),!0)},Bt=function(e,n){if(Pt(j.beforeSanitizeElements,e,null),zt(e,n))return!0;if(jt(e))return yt(e),!0;let r=ct(w(e));if(M=Rt(j.uponSanitizeElement,M,N,je),Pt(j.uponSanitizeElement,e,{tagName:r,allowedTags:M}),zt(e,n))return!0;if(Ft(e,r))return yt(e),!0;if(be[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!M[r]){let t=Lt(e,r,n);return t===!1&&(Pt(j.afterSanitizeElements,e,null),zt(e,n))?!0:t}if(C(e)===LT.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&nT(FT,e.innerHTML))return yt(e),!0;if(De&&e.nodeType===LT.text){let n=kt(e.textContent);e.textContent!==n&&(Vw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Pt(j.afterSanitizeElements,e,null),zt(e,n)},Vt=function(e,t,r){if(xe[t]||Tt(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=P[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);return we&&nT(fe,t)||Ce&&nT(pe,t)?!0:i?qe[t]||nT(_e,qw(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Jw(r,`data:`)===0&&Ge[e]||Te&&!nT(me,qw(r,he,``))?!0:!r:Ut(e)&&It(ye.tagNameCheck,e)&&It(ye.attributeNameCheck,t,e)||t===`is`&&ye.allowCustomizedBuiltInElements&&It(ye.tagNameCheck,r)},Ht=oT({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ut=function(e){return!Ht[Ww(e)]&&nT(ge,e)},Wt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Gt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!jt(e)||(yt(e),!1)}catch{return St(t,e),!1}},Kt=function(e,n){if(Pt(j.beforeSanitizeAttributes,e,null),zt(e,n))return;let r=e.attributes;if(!r||jt(e))return;P=Rt(j.uponSanitizeAttribute,P,ve,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},a=r.length,o=ct(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=ct(s),d=l,f=s===`value`?d:Yw(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Pt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&Jw(f,ze)!==0&&(St(s,e,n),f=ze+f,p=!0),Oe&&nT(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){St(s,e,n);continue}if(u===`attributename`&&Kw(f,`href`)){St(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){St(s,e,n);continue}if(!Ee&&nT(IT,f)){St(s,e,n);continue}if(De&&(f=kt(f)),!Vt(o,u,f)){St(s,e,n);continue}f=Wt(o,u,c,f),f!==d&&Gt(e,s,c,f)&&p&&Bw(t.removed)}}Pt(j.afterSanitizeAttributes,e,null),zt(e,n)},qt=function(e){let t=null,n=Ot(e);for(Pt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Pt(j.uponSanitizeShadowNode,t,null),Bt(t,e),Kt(t,e),Mt(t.content)&&qt(t.content),C(t)===LT.element){let e=v(t);Mt(e)&&(Jt(e),qt(e))}Pt(j.afterSanitizeShadowDOM,e,null)},Jt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){qt(e.shadow);continue}let n=e.node,r=C(n)===LT.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ct(e)===`template`){let e=n.content;Mt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Mt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`\x3C!-->`),typeof e!=`string`&&!Nt(e)&&(e=lT(e),typeof e!=`string`))throw rT(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(M=je,P=Me):ft(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(M=cT(M)),j.uponSanitizeAttribute.length>0&&(P=cT(P)),t.removed=[];let c=Ve&&typeof e!=`string`&&Nt(e);if(c){Et(e);let t=w(e);if(typeof t==`string`){let n=ct(t);if(!M[n]||be[n])throw xt(e),rT(`root node is forbidden and cannot be sanitized in-place`)}if(jt(e))throw xt(e),rT(`root node is clobbered and cannot be sanitized in-place`);try{Jt(e)}catch(t){throw xt(e),t}}else if(Nt(e))i=Dt(`\x3C!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===LT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Jt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?A(e):e;if(i=Dt(e),!i)return Pe?null:Ie?E:``}i&&Ne&&yt(i.firstChild);let l=c?e:i;try{let e=Ot(l);for(;o=e.nextNode();)Bt(o,l),Kt(o,l),Mt(o.content)&&qt(o.content)}catch(n){throw c&&(xt(e),Rw(t.removed,e=>{e.element&&wt(e.element)})),n}if(c){let n=!1;if(Rw(t.removed,t=>{t.element&&(t.element===e&&(n=!0),wt(t.element))}),n)throw rT(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&At(e),e}if(Pe){if(De&&At(i),Fe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(P.shadowroot||P.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&nT(jT,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
572
- `+u),De&&(u=kt(u)),T&&Ie?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),Ae=!0,je=M,Me=P},t.clearConfig=function(){lt=null,Ae=!1,je=null,Me=null,T=D,E=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=ct(e),i=ct(t);return Vt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&eT(j,e)&&Vw(j[e],t)},t.removeHook=function(e,t){if(eT(j,e)){if(t!==void 0){let n=zw(j[e],t);return n===-1?void 0:Hw(j[e],n,1)[0]}return Bw(j[e])}},t.removeHooks=function(e){eT(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=UT()},t}var qT=KT();function JT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var YT=JT();function XT(e){YT=e}var ZT={exec:()=>null};function QT(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $T(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(tE.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var eE=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),tE={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:QT(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:QT(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:QT(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:QT(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:QT(e=>RegExp(`^ {0,${e}}(?:</?(?:${gE})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:QT(e=>RegExp(`^ {0,${e}}>`))},nE=/^(?:[ \t]*(?:\n|$))+/,rE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,iE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,aE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sE=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lE=$T(cE).replace(/bull/g,sE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),uE=$T(cE).replace(/bull/g,sE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),dE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,fE=/^[^\n]+/,pE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mE=$T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,pE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hE=$T(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,sE).getRegex(),gE=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,_E=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,vE=$T(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,_E).replace(`tag`,gE).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yE=e=>$T(dE).replace(`hr`,aE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,gE).getRegex(),bE=yE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),xE=yE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),SE={blockquote:$T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,xE).getRegex(),code:rE,def:mE,fences:iE,heading:oE,hr:aE,html:vE,lheading:lE,list:hE,newline:nE,paragraph:bE,table:ZT,text:fE},CE=$T(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,aE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,gE).getRegex(),wE={...SE,lheading:uE,table:CE,paragraph:$T(dE).replace(`hr`,aE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,CE).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,gE).getRegex()},TE={...SE,html:$T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,_E).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ZT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$T(dE).replace(`hr`,aE).replace(`heading`,` *#{1,6} *[^
573
- ]`).replace(`lheading`,lE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},EE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,DE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,OE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,kE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,AE=/[\p{P}\p{S}]/u,jE=/[\s\p{P}\p{S}]/u,ME=/[^\s\p{P}\p{S}]/u,NE=$T(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,jE).getRegex(),PE=/[\p{Pi}\p{Ps}"']/u,FE=/(?!~)[\p{P}\p{S}]/u,IE=/(?!~)[\s\p{P}\p{S}]/u,LE=/(?:[^\s\p{P}\p{S}]|~)/u,RE=$T(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,eE?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),zE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,BE=$T(zE,`u`).replace(/punct/g,AE).getRegex(),VE=$T(zE,`u`).replace(/punct/g,FE).getRegex(),HE=$T(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,PE).replace(/punct/g,AE).getRegex(),UE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,WE=$T(UE,`gu`).replace(/notPunctSpace/g,ME).replace(/punctSpace/g,jE).replace(/punct/g,AE).getRegex(),GE=$T(UE,`gu`).replace(/notPunctSpace/g,LE).replace(/punctSpace/g,IE).replace(/punct/g,FE).getRegex(),KE=$T(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ME).replace(/punctSpace/g,jE).replace(/punct/g,AE).getRegex(),qE=$T(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ME).replace(/punctSpace/g,jE).replace(/punct/g,AE).getRegex(),JE=$T(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ME).replace(/punctSpace/g,jE).replace(/punct/g,AE).getRegex(),YE=$T(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,AE).getRegex(),XE=$T(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ME).replace(/punctSpace/g,jE).replace(/punct/g,AE).getRegex(),ZE=$T(/\\(punct)/,`gu`).replace(/punct/g,AE).getRegex(),QE=$T(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$E=$T(_E).replace(`(?:-->|$)`,`-->`).getRegex(),eD=$T(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,$E).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tD=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,nD=$T(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,tD).getRegex(),rD=$T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,nD).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iD=$T(/^!?\[(label)\]\[(ref)\]/).replace(`label`,nD).replace(`ref`,pE).getRegex(),aD=$T(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,pE).getRegex(),oD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,sD=$T(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,tD).getRegex(),cD=$T(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$T(/^!?\[(label)\]\[(ref)\]/).replace(`label`,sD).replace(`ref`,oD).getRegex()).replace(`nolink`,$T(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,oD).getRegex()).getRegex(),lD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,uD=$T(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),dD={_backpedal:ZT,anyPunctuation:ZE,autolink:QE,blockSkip:RE,br:OE,code:DE,del:ZT,delLDelim:ZT,delRDelim:ZT,emStrongLDelim:BE,emStrongRDelimAst:WE,emStrongRDelimUnd:qE,escape:EE,link:rD,nolink:aD,punctuation:NE,reflink:iD,reflinkSearch:cD,tag:eD,text:kE,url:ZT},fD={...dD,emStrongLDelim:HE,emStrongRDelimAst:KE,emStrongRDelimUnd:JE,link:$T(/^!?\[(label)\]\((.*?)\)/).replace(`label`,nD).getRegex(),reflink:$T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,nD).getRegex()},pD={...dD,emStrongRDelimAst:GE,emStrongLDelim:VE,delLDelim:YE,delRDelim:XE,url:$T(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,uD).replace(`protocol`,lD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$T(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,lD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},mD={...pD,br:$T(OE).replace(`{2,}`,`*`).getRegex(),text:$T(pD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},hD={normal:SE,gfm:wE,pedantic:TE},gD={normal:dD,gfm:pD,breaks:mD,pedantic:fD},_D={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},vD=e=>_D[e];function yD(e,t){if(t){if(tE.escapeTest.test(e))return e.replace(tE.escapeReplace,vD)}else if(tE.escapeTestNoEncode.test(e))return e.replace(tE.escapeReplaceNoEncode,vD);return e}function bD(e){return e.replace(tE.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function xD(e){try{e=encodeURI(e).replace(tE.percentDecode,`%`)}catch{return null}return e}function SD(e,t){let n=e.replace(tE.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(tE.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(tE.slashPipe,`|`);return n}function CD(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function wD(e){let t=e.split(`
574
- `),n=t.length-1;for(;n>=0&&tE.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
575
- `)}function TD(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function ED(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function DD(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function OD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function kD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
568
+ `}));function IC(e,t){let n=new Map,r=e.getAttribLocation(t,`aPosition`),i=e.getAttribLocation(t,`aNormal`);return{draw(t){let a=oC(t),o=n.get(a);if(!o){let r=e.createBuffer();if(!r)throw Error(`engenty: body allocation failed`);let i=cC(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i.vertices,e.STATIC_DRAW),o={buffer:r,count:i.vertices.length/6},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[t,n]of[[r,0],[i,12]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,3,e.FLOAT,!1,24,n);e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var LC=o((()=>{dC()}));function RC(e,t){let n=rC(e,t===`fur`?xC:CC,{vertex:t===`fur`?yC:yC.replace(`#version 300 es`,`#version 300 es
569
+ #define JELLY_COAT`),geometry:IC});if(!n)return null;let r=[n];if(t===`fur`){let t=rC(e,PC,{vertex:NC,geometry:jC,clear:!1,doubleSided:!0,depthWrite:!1});if(!t)return n.dispose(),null;r.push(t)}let i=rC(e,QS,{vertex:ZS,geometry:YS,clear:!1});if(!i){for(let e of r)e.dispose();return null}r.push(i);let a=rC(e,_C,{vertex:t===`jelly`?gC.replace(`#version 300 es`,`#version 300 es
570
+ #define JELLY_COAT`):gC,geometry:mC,clear:!1});if(!a){for(let e of r)e.dispose();return null}return r.push(a),{render(e){for(let t of r)t.render(e)},viewport(e){for(let t of r)t.viewport(e)},dispose(){for(let e of r)e.dispose()}}}var zC=o((()=>{XS(),$S(),aC(),hC(),vC(),wC(),MC(),FC(),LC(),SC()}));function BC(e){if(UC.has(e)||typeof document>`u`)return null;let t=document.createElement(`canvas`);t.width=1,t.height=1;let n=RC(t,e);return n?(t.addEventListener(`webglcontextlost`,t=>{t.preventDefault(),HC.delete(e)}),{canvas:t,refs:0,renderer:n,size:0}):(UC.add(e),null)}function VC(e=`fur`){let t=HC.get(e);if(!t){let n=BC(e);if(!n)return null;HC.set(e,n),t=n}let n=t;n.refs+=1;let r=!1;return{drawInto(t,i,a){if(r||HC.get(e)!==n)return;let o=i;o>n.size&&(n.size=o,n.canvas.width=o,n.canvas.height=o),n.renderer.viewport(o),n.renderer.render(a),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(n.canvas,0,n.canvas.height-o,o,o,0,0,t.canvas.width,t.canvas.height)},release(){r||(r=!0,--n.refs,n.refs<=0&&HC.get(e)===n&&(n.renderer.dispose(),HC.delete(e)))}}}var HC,UC,WC=o((()=>{zC(),HC=new Map,UC=new Set}));function GC(e,t){let n=KC/Math.max(1,Math.hypot(e,t));return[e*n,t===0?0:-t*n]}var KC,qC=o((()=>{KC=Math.PI/18}));function JC(e,t,n){if(n<=0)return;let r=3.8,i=Math.sqrt(110-r*r),a=Math.exp(-3.8*n),o=Math.cos(i*n),s=Math.sin(i*n);for(let[n,c,l]of[[`x`,`vx`,t[0]],[`y`,`vy`,t[1]]]){let t=e[n]-l,u=e[c];e[n]=l+a*(t*o+(u+r*t)/i*s),e[c]=a*(u*o-(r*u+110*t)/i*s)}}var YC=o((()=>{}));function XC(e,t){let n={x:0,y:0,vx:0,vy:0},r=[60,60],i=null,a=[0,0],o=!1,s=n=>{if(!t()||n.button!==0||i!==null)return;let s=e.getBoundingClientRect(),c=(n.clientX-s.left)/s.width*152+-16,l=(n.clientY-s.top)/s.height*152+-16;Math.hypot(c-60,l-60)>48||(r[0]=c,r[1]=l,a=[n.clientX,n.clientY],i=n.pointerId,o=!1,e.setPointerCapture(i))},c=r=>{if(r.pointerId!==i)return;if(!t()){l(r);return}let s=e.getBoundingClientRect(),c=(r.clientX-a[0])/s.width*152,u=(r.clientY-a[1])/s.height*152,d=Math.min(1,18/(Math.hypot(c,u)||1));n.x=c*d,n.y=u*d,n.vx=0,n.vy=0,o||=Math.hypot(r.clientX-a[0],r.clientY-a[1])>4},l=t=>{t.pointerId===i&&(i=null,e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId))},u=e=>{o&&=(e.preventDefault(),e.stopPropagation(),!1)};return e.addEventListener(`pointerdown`,s),e.addEventListener(`pointermove`,c),e.addEventListener(`pointerup`,l),e.addEventListener(`pointercancel`,l),e.addEventListener(`lostpointercapture`,l),e.addEventListener(`click`,u,!0),{step(e){return i===null&&JC(n,[0,0],e),[r[0],r[1],n.x,n.y]},dispose(){i!==null&&e.hasPointerCapture(i)&&e.releasePointerCapture(i),e.removeEventListener(`pointerdown`,s),e.removeEventListener(`pointermove`,c),e.removeEventListener(`pointerup`,l),e.removeEventListener(`pointercancel`,l),e.removeEventListener(`lostpointercapture`,l),e.removeEventListener(`click`,u,!0)}}}var ZC=o((()=>{qS(),YC()}));function QC(e){tw.x=e.clientX,tw.y=e.clientY;for(let e of nw)e()}function $C(){return tw}function ew(e){return!rw&&typeof window<`u`&&(rw=!0,tw.x=window.innerWidth*.62,tw.y=window.innerHeight*.28,window.addEventListener(`pointermove`,QC,{passive:!0})),nw.add(e),()=>{nw.delete(e)}}var tw,nw,rw,iw=o((()=>{tw={x:0,y:0},nw=new Set,rw=!1})),aw=c({FluffyEngenty:()=>ow});function ow({className:e,motion:t=`auto`,animationSpeed:n=1,turn:r,coat:i=`fur`,goggles:a=!1,interactive:o=!0,look:s=null,kind:c=`round`,overrides:l,quality:u=`high`,size:d=260}){let f=(0,sw.useRef)(null),p=(0,sw.useRef)(null),m=(0,sw.useRef)(0);m.current===0&&(dw+=1,m.current=dw*fw);let h=(0,sw.useRef)(null),[g,_]=(0,sw.useState)(!0),v=Gb[c],y=(0,sw.useMemo)(()=>Ub(v),[v]),b=(0,sw.useMemo)(()=>Wb(v),[v]),x=(0,sw.useMemo)(()=>Hb(v),[v]),S=(0,sw.useRef)({animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d});return S.current={animationSpeed:n,motion:t,turn:r,goggles:a,blobs:y,extras:b,form:v,interactive:o,kind:c,look:s,overrides:l,quality:u,scale:x,size:d},(0,sw.useEffect)(()=>{f.current?.()},[c,l,u,d,o,s,a,t,n,r]),(0,sw.useEffect)(()=>{let e=p.current,t=h.current;if(!(e&&t))return;let n=e.getContext(`2d`),r=n?VC(i):null;if(!(n&&r)){_(!1);return}let a=m.current,o=window.matchMedia(`(prefers-reduced-motion: reduce)`),s={x:0,y:0},c={x:0,y:0},l={vx:0,vy:0,x:0,y:0},u=0,d=!0,g=0,v=0,y=i===`jelly`?XC(t,()=>S.current.interactive&&S.current.motion!==`pause`&&(S.current.motion===`play`||!o.matches)):null,b=f=>{u=0;let p=S.current,m=lw[p.quality],h=p.motion===`pause`||p.motion===`auto`&&o.matches,_=h?0:Math.min((f-(v||f))/1e3,.1);g+=_*Math.max(.1,Math.min(2,p.animationSpeed)),v=f;let x=Math.min(window.devicePixelRatio||1,m.dprCap),C=Math.max(1,Math.round(p.size*x));e.width!==C&&(e.width=C,e.height=C);let w=120*C/(uw*152),T=p.overrides?.fur??p.form.fur;if((p.interactive||p.look)&&!h){let e,n,r,i;if(p.look)e=p.look.x,n=p.look.y,r=Math.hypot(e,n)||1,i=Math.min(1,r);else{let a=t.getBoundingClientRect(),o=$C();e=o.x-(a.left+a.width*.5),n=o.y-(a.top+a.height*.48),r=Math.hypot(e,n)||1,i=.35+Math.min(1,r/(a.width*2.4||1))*.65}s.x+=(e/r*5.5*i-s.x)*.16,s.y+=(n/r*3.5*i-s.y)*.16,c.x+=(e/r*i-c.x)*.24,c.y+=(n/r*.9*i-c.y)*.24}JC(l,[s.x,s.y],_*Math.max(.1,Math.min(2,p.animationSpeed)));let E=IS(t,p.kind);r.drawInto(n,C,{blobs:p.blobs,clarity:p.overrides?.clarity??eC.clarity,softness:p.overrides?.softness??eC.softness,pull:y?.step(_*Math.max(.1,Math.min(2,p.animationSpeed))),body:E.body,deep:E.deep,density:Math.min(p.overrides?.density??m.density,w),extraMeta:p.extras.meta,extras:p.extras.geometry,eye:[p.form.eye.x,p.form.eye.y,p.form.eye.r],gaze:[c.x,c.y],goggles:p.goggles,turn:p.turn?GC(p.turn.yaw/KC,p.turn.pitch/KC):GC(c.x,c.y),fur:T,inflate:p.overrides?.inflate??(i===`jelly`?eC.inflate:mw),lean:[s.x,s.y],light:pw,period:p.form.period,scale:p.scale,falloff:p.form.falloff,thick:p.overrides?.thick??m.thick,time:g+a,tip:E.tip,wind:p.overrides?.wind??hw,wobble:[l.x-s.x,l.y-s.y]}),d&&!h&&(u=requestAnimationFrame(b))},x=()=>{u||=(v=0,requestAnimationFrame(b))},C=new IntersectionObserver(([e])=>{d=e?.isIntersecting??!0,d?x():u&&=(cancelAnimationFrame(u),0)},{rootMargin:`120px`});C.observe(t),f.current=x;let w=ew(x);return o.addEventListener(`change`,x),x(),()=>{f.current=null,C.disconnect(),y?.dispose(),w(),o.removeEventListener(`change`,x),u&&cancelAnimationFrame(u),r.release()}},[i]),g?(0,cw.jsxs)(`div`,{"aria-hidden":`true`,className:e,ref:h,style:{height:d,position:`relative`,width:d},children:[(0,cw.jsx)(`div`,{style:{background:`radial-gradient(closest-side, rgb(0 0 0 / 0.2), transparent)`,filter:`blur(4px)`,height:`${v.shadowRx*50/152}%`,left:`50%`,position:`absolute`,top:`${gw(110)}%`,transform:`translate(-50%, -50%)`,width:`${v.shadowRx*2.5*100/152}%`}}),(0,cw.jsx)(`canvas`,{ref:p,style:{display:`block`,height:d,width:d,touchAction:i===`jelly`&&o&&t!==`pause`?`none`:void 0,cursor:i===`jelly`&&o?`grab`:void 0}})]}):(0,cw.jsx)(Fx,{className:e,goggles:a,kind:c,size:d})}var sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w=o((()=>{sw=u(f(),1),zx(),Yb(),VS(),qS(),WC(),qC(),tC(),ZC(),YC(),iw(),cw=Zb(),lw={high:{density:68,dprCap:2,thick:1},low:{density:40,dprCap:1,thick:1.15},medium:{density:55,dprCap:1.5,thick:1.05}},uw=1.7,dw=0,fw=2.399963,pw=[-.42,-.72,.75],mw=30,hw=.5,gw=e=>(e- -16)/152*100}));zx(),x_();var vw=(0,y.lazy)(()=>b_(()=>Promise.resolve().then(()=>(_w(),aw)).then(e=>({default:e.FluffyEngenty})),void 0,import.meta.url));function yw({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=aS(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,X.jsx)(y.Suspense,{fallback:(0,X.jsx)(Fx,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,X.jsx)(vw,{goggles:i,coat:c,kind:o,size:t,quality:`medium`,interactive:a})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:oS(o),borderRadius:t*.28,height:t,width:t},children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,X.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,X.jsx)(y.Suspense,{fallback:(0,X.jsx)(Fx,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,X.jsx)(vw,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,X.jsx)(Fx,{goggles:i,kind:o,size:t,animated:a})}function bw(e,t){this.v=e,this.k=t}function xw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sw(e){if(Array.isArray(e))return e}function Cw(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ww(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
571
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tw(e,t){return Sw(e)||Cw(e,t)||Ew(e,t)||ww()}function Ew(e,t){if(e){if(typeof e==`string`)return xw(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xw(e,t):void 0}}function Dw(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof bw;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Dw.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Dw.prototype.next=function(e){return this._invoke(`next`,e)},Dw.prototype.throw=function(e){return this._invoke(`throw`,e)},Dw.prototype.return=function(e){return this._invoke(`return`,e)};var Ow=Object.entries,kw=Object.setPrototypeOf,Aw=Object.isFrozen,jw=Object.getPrototypeOf,Mw=Object.getOwnPropertyDescriptor,Nw=Object.freeze,Pw=Object.seal,Fw=Object.create,Iw=typeof Reflect<`u`&&Reflect,Lw=Iw.apply,Rw=Iw.construct;Nw||=function(e){return e},Pw||=function(e){return e},Lw||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Rw||=function(e){return new e(...[...arguments].slice(1))};var zw=aT(Array.prototype.forEach);Array.prototype.indexOf;var Bw=aT(Array.prototype.lastIndexOf),Vw=aT(Array.prototype.pop),Hw=aT(Array.prototype.push);Array.prototype.slice;var Uw=aT(Array.prototype.splice),Ww=Array.isArray,Gw=aT(String.prototype.toLowerCase),Kw=aT(String.prototype.toString),qw=aT(String.prototype.match),Jw=aT(String.prototype.replace),Yw=aT(String.prototype.indexOf),Xw=aT(String.prototype.trim),Zw=aT(Number.prototype.toString),Qw=aT(Boolean.prototype.toString),$w=typeof BigInt>`u`?null:aT(BigInt.prototype.toString),eT=typeof Symbol>`u`?null:aT(Symbol.prototype.toString),tT=aT(Object.prototype.hasOwnProperty),nT=aT(Object.prototype.toString),rT=aT(RegExp.prototype.test),iT=oT(TypeError);function aT(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Lw(e,t,n)}}function oT(e){return function(){return Rw(e,[...arguments])}}function sT(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gw;if(kw&&kw(e,null),!Ww(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Aw(t)||(t[r]=e),i=e)}e[i]=!0}return e}function cT(e){for(let t=0;t<e.length;t++)tT(e,t)||(e[t]=null);return e}function lT(e){let t=Fw(null);for(let r of Ow(e)){var n=Tw(r,2);let i=n[0],a=n[1];tT(e,i)&&(t[i]=Ww(a)?cT(a):a&&typeof a==`object`&&a.constructor===Object?lT(a):a)}return t}function uT(e){switch(typeof e){case`string`:return e;case`number`:return Zw(e);case`boolean`:return Qw(e);case`bigint`:return $w?$w(e):`0`;case`symbol`:return eT?eT(e):`Symbol()`;case`undefined`:return nT(e);case`function`:case`object`:{if(e===null)return nT(e);let t=e,n=dT(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:nT(e)}return nT(e)}default:return nT(e)}}function dT(e,t){for(;e!==null;){let n=Mw(e,t);if(n){if(n.get)return aT(n.get);if(typeof n.value==`function`)return aT(n.value)}e=jw(e)}function n(){return null}return n}function fT(e){try{return rT(e,``),!0}catch{return!1}}var pT=Nw(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),mT=Nw(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),hT=Nw([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),gT=Nw([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),_T=Nw(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),vT=Nw([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),yT=Nw([`#text`]),bT=Nw(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),xT=Nw(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),ST=Nw(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),CT=Nw([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),wT=Pw(/{{[\w\W]*|^[\w\W]*}}/g),TT=Pw(/<%[\w\W]*|^[\w\W]*%>/g),ET=Pw(/\${[\w\W]*/g),DT=Pw(/^data-[\-\w.\u00B7-\uFFFF]+$/),OT=Pw(/^aria-[\-\w]+$/),kT=Pw(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),AT=Pw(/^(?:\w+script|data):/i),jT=Pw(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),MT=Pw(/^html$/i),NT=Pw(/^[a-z][.\w]*(-[.\w]+)+$/i),PT=Pw(/<[/\w!]/g),FT=Pw(/<[/\w]/g),IT=Pw(/<\/no(script|embed|frames)/i),LT=Pw(/\/>/i),RT={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zT=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],BT=Nw(sT({},zT)),VT=function(){let e={};return zw(zT,t=>{e[t]=Pw(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),Nw(e)}(),HT=function(){return typeof window>`u`?null:window},UT=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},WT=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},GT=function(e,t,n,r){return tT(e,t)&&Ww(e[t])?sT(r.base?lT(r.base):{},e[t],r.transform):n},KT=function(e,t,n){let r=tT(e,t)?e[t]:void 0;return r&&typeof r==`object`?lT(r):n()};function qT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HT(),t=e=>qT(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==RT.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=dT(d,`cloneNode`),p=dT(d,`remove`),m=dT(d,`removeAttributeNode`),h=dT(d,`nextSibling`),g=dT(d,`childNodes`),_=dT(d,`parentNode`),v=dT(d,`shadowRoot`),y=dT(d,`attributes`),b=o&&o.prototype?dT(o.prototype,`nodeType`):null,x=o&&o.prototype?dT(o.prototype,`nodeName`):null,S=o&&o.prototype?dT(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,k=function(){if(O>0)throw iT(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},te=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},ne=function(){return ee||=(D=UT(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=WT();t.isSupported=typeof Ow==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=wT,ue=TT,de=ET,fe=DT,pe=OT,me=AT,he=jT,ge=NT,_e=kT,M=null,N=sT({},[...pT,...mT,...hT,..._T,...yT]),P=null,ve=sT({},[...bT,...xT,...ST,...CT]),ye=Object.seal(Fw(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,xe=null,Se=Object.seal(Fw(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=sT({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=sT({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=sT({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,Ze=`http://www.w3.org/1999/xhtml`,Qe=Ze,$e=!1,et=null,tt=sT({},[Ye,Xe,Ze],Kw),nt=Nw([`mi`,`mo`,`mn`,`ms`,`mtext`]),rt=sT({},nt),F=Nw([`annotation-xml`]),it=sT({},F),at=sT({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],ct=null,lt=null,ut=n.createElement(`form`),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&&lt===e)return;(!e||typeof e!=`object`)&&(e={}),e=lT(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ct=ot===`application/xhtml+xml`?Kw:Gw,M=GT(e,`ALLOWED_TAGS`,N,{transform:ct}),P=GT(e,`ALLOWED_ATTR`,ve,{transform:ct}),et=GT(e,`ALLOWED_NAMESPACES`,tt,{transform:Kw}),qe=GT(e,`ADD_URI_SAFE_ATTR`,Je,{transform:ct,base:Je}),Ge=GT(e,`ADD_DATA_URI_TAGS`,Ke,{transform:ct,base:Ke}),Ue=GT(e,`FORBID_CONTENTS`,We,{transform:ct}),be=GT(e,`FORBID_TAGS`,lT({}),{transform:ct}),xe=GT(e,`FORBID_ATTR`,lT({}),{transform:ct}),He=tT(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?lT(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,_e=fT(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:kT,Qe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ze,rt=KT(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>sT({},nt)),it=KT(e,`HTML_INTEGRATION_POINTS`,()=>sT({},F));let t=KT(e,`CUSTOM_ELEMENT_HANDLING`,()=>Fw(null));if(ye=Fw(null),tT(t,`tagNameCheck`)&&dt(t.tagNameCheck)&&(ye.tagNameCheck=t.tagNameCheck),tT(t,`attributeNameCheck`)&&dt(t.attributeNameCheck)&&(ye.attributeNameCheck=t.attributeNameCheck),tT(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ye.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Pw(ye),De&&(we=!1),Fe&&(Pe=!0),He&&(M=sT({},yT),P=Fw(null),He.html===!0&&(sT(M,pT),sT(P,bT)),He.svg===!0&&(sT(M,mT),sT(P,xT),sT(P,CT)),He.svgFilters===!0&&(sT(M,hT),sT(P,xT),sT(P,CT)),He.mathMl===!0&&(sT(M,_T),sT(P,ST),sT(P,CT))),Se.tagCheck=null,Se.attributeCheck=null,tT(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:Ww(e.ADD_TAGS)&&(M===N&&(M=lT(M)),sT(M,e.ADD_TAGS,ct))),tT(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:Ww(e.ADD_ATTR)&&(P===ve&&(P=lT(P)),sT(P,e.ADD_ATTR,ct))),tT(e,`ADD_FORBID_CONTENTS`)&&Ww(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=lT(Ue)),sT(Ue,e.ADD_FORBID_CONTENTS,ct)),Be&&(M[`#text`]=!0),ke&&sT(M,[`html`,`head`,`body`]),M.table&&(sT(M,[`tbody`]),delete be.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw iT(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw iT(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));Nw&&Nw(e),lt=e},pt=sT({},[...mT,...hT,...gT]),mt=sT({},[..._T,...vT]),ht=function(e,t,n){return t.namespaceURI===Ze?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||rt[n]):!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Ze?e===`math`:t.namespaceURI===Xe?e===`math`&&it[n]:!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Xe&&!it[n]||t.namespaceURI===Ye&&!rt[n]?!1:!mt[e]&&(at[e]||!pt[e])},vt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Qe,tagName:`template`});let n=Gw(e.tagName),r=Gw(t.tagName);return et[e.namespaceURI]?e.namespaceURI===Xe?ht(n,t,r):e.namespaceURI===Ye?gt(n,t,r):e.namespaceURI===Ze?_t(n,t,r):!!(ot===`application/xhtml+xml`&&et[e.namespaceURI]):!1},yt=function(e){Hw(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw iT(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){wt(e);let t=g(e);if(t){let e=[];zw(t,t=>{Hw(e,t)}),zw(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Hw(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||P[ct(i)]||bt(e,r,i)}},wt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===RT.element&&Ct(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Tt=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Et=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===RT.processingInstruction||n===RT.comment&&rT(FT,e.data)){try{p(e)}catch{}continue}if(n===RT.element){let t=e,n=ct(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Tt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Dt=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=qw(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Qe===Ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Qe===Ze)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Qe,`template`,null);try{t.documentElement.innerHTML=$e?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Qe===Ze?se.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},Ot=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},kt=function(e){return e=Jw(e,le,` `),e=Jw(e,ue,` `),e=Jw(e,de,` `),e},At=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=kt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&zw(i,e=>{Mt(e.content)&&At(e.content)})},jt=function(e){let t=x?x(e):null;return typeof t!=`string`||ct(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===RT.documentFragment}catch{return!1}},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Pt(e,n,r){e.length!==0&&zw(e,e=>{e.call(t,n,r,lt)})}let Ft=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&rT(PT,e.textContent)&&rT(PT,e.innerHTML)||Oe&&e.namespaceURI===Ze&&BT[t]&&(Nt(e.firstElementChild)||typeof e.textContent==`string`&&rT(VT[t],e.textContent))||e.nodeType===RT.processingInstruction||Oe&&e.nodeType===RT.comment&&rT(FT,e.data))},It=function(e,t){return e instanceof RegExp?rT(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Lt=function(e,t,n){if(!be[t]&&Ut(t)&&It(ye.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Rt=function(e,t,n,r){return e.length===0?t:t===n||t===r?lT(t):t},zt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&wt(e),!0)},Bt=function(e,n){if(Pt(j.beforeSanitizeElements,e,null),zt(e,n))return!0;if(jt(e))return yt(e),!0;let r=ct(w(e));if(M=Rt(j.uponSanitizeElement,M,N,je),Pt(j.uponSanitizeElement,e,{tagName:r,allowedTags:M}),zt(e,n))return!0;if(Ft(e,r))return yt(e),!0;if(be[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!M[r]){let t=Lt(e,r,n);return t===!1&&(Pt(j.afterSanitizeElements,e,null),zt(e,n))?!0:t}if(C(e)===RT.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&rT(IT,e.innerHTML))return yt(e),!0;if(De&&e.nodeType===RT.text){let n=kt(e.textContent);e.textContent!==n&&(Hw(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Pt(j.afterSanitizeElements,e,null),zt(e,n)},Vt=function(e,t,r){if(xe[t]||Tt(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=P[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);return we&&rT(fe,t)||Ce&&rT(pe,t)?!0:i?qe[t]||rT(_e,Jw(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Yw(r,`data:`)===0&&Ge[e]||Te&&!rT(me,Jw(r,he,``))?!0:!r:Ut(e)&&It(ye.tagNameCheck,e)&&It(ye.attributeNameCheck,t,e)||t===`is`&&ye.allowCustomizedBuiltInElements&&It(ye.tagNameCheck,r)},Ht=sT({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ut=function(e){return!Ht[Gw(e)]&&rT(ge,e)},Wt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Gt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!jt(e)||(yt(e),!1)}catch{return St(t,e),!1}},Kt=function(e,n){if(Pt(j.beforeSanitizeAttributes,e,null),zt(e,n))return;let r=e.attributes;if(!r||jt(e))return;P=Rt(j.uponSanitizeAttribute,P,ve,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},a=r.length,o=ct(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=ct(s),d=l,f=s===`value`?d:Xw(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Pt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&Yw(f,ze)!==0&&(St(s,e,n),f=ze+f,p=!0),Oe&&rT(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){St(s,e,n);continue}if(u===`attributename`&&qw(f,`href`)){St(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){St(s,e,n);continue}if(!Ee&&rT(LT,f)){St(s,e,n);continue}if(De&&(f=kt(f)),!Vt(o,u,f)){St(s,e,n);continue}f=Wt(o,u,c,f),f!==d&&Gt(e,s,c,f)&&p&&Vw(t.removed)}}Pt(j.afterSanitizeAttributes,e,null),zt(e,n)},qt=function(e){let t=null,n=Ot(e);for(Pt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Pt(j.uponSanitizeShadowNode,t,null),Bt(t,e),Kt(t,e),Mt(t.content)&&qt(t.content),C(t)===RT.element){let e=v(t);Mt(e)&&(Jt(e),qt(e))}Pt(j.afterSanitizeShadowDOM,e,null)},Jt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){qt(e.shadow);continue}let n=e.node,r=C(n)===RT.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ct(e)===`template`){let e=n.content;Mt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Mt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if($e=!e,$e&&(e=`\x3C!-->`),typeof e!=`string`&&!Nt(e)&&(e=uT(e),typeof e!=`string`))throw iT(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(M=je,P=Me):ft(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(M=lT(M)),j.uponSanitizeAttribute.length>0&&(P=lT(P)),t.removed=[];let c=Ve&&typeof e!=`string`&&Nt(e);if(c){Et(e);let t=w(e);if(typeof t==`string`){let n=ct(t);if(!M[n]||be[n])throw xt(e),iT(`root node is forbidden and cannot be sanitized in-place`)}if(jt(e))throw xt(e),iT(`root node is clobbered and cannot be sanitized in-place`);try{Jt(e)}catch(t){throw xt(e),t}}else if(Nt(e))i=Dt(`\x3C!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===RT.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Jt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?A(e):e;if(i=Dt(e),!i)return Pe?null:Ie?E:``}i&&Ne&&yt(i.firstChild);let l=c?e:i;try{let e=Ot(l);for(;o=e.nextNode();)Bt(o,l),Kt(o,l),Mt(o.content)&&qt(o.content)}catch(n){throw c&&(xt(e),zw(t.removed,e=>{e.element&&wt(e.element)})),n}if(c){let n=!1;if(zw(t.removed,t=>{t.element&&(t.element===e&&(n=!0),wt(t.element))}),n)throw iT(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&At(e),e}if(Pe){if(De&&At(i),Fe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(P.shadowroot||P.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&rT(MT,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
572
+ `+u),De&&(u=kt(u)),T&&Ie?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),Ae=!0,je=M,Me=P},t.clearConfig=function(){lt=null,Ae=!1,je=null,Me=null,T=D,E=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=ct(e),i=ct(t);return Vt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&tT(j,e)&&Hw(j[e],t)},t.removeHook=function(e,t){if(tT(j,e)){if(t!==void 0){let n=Bw(j[e],t);return n===-1?void 0:Uw(j[e],n,1)[0]}return Vw(j[e])}},t.removeHooks=function(e){tT(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=WT()},t}var JT=qT();function YT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var XT=YT();function ZT(e){XT=e}var QT={exec:()=>null};function $T(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function eE(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(nE.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var tE=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),nE={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:$T(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$T(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:$T(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:$T(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:$T(e=>RegExp(`^ {0,${e}}(?:</?(?:${_E})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:$T(e=>RegExp(`^ {0,${e}}>`))},rE=/^(?:[ \t]*(?:\n|$))+/,iE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,aE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oE=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cE=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uE=eE(lE).replace(/bull/g,cE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),dE=eE(lE).replace(/bull/g,cE).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fE=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pE=/^[^\n]+/,mE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hE=eE(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,mE).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gE=eE(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,cE).getRegex(),_E=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,vE=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,yE=eE(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,vE).replace(`tag`,_E).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bE=e=>eE(fE).replace(`hr`,oE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_E).getRegex(),xE=bE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),SE=bE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),CE={blockquote:eE(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,SE).getRegex(),code:iE,def:hE,fences:aE,heading:sE,hr:oE,html:yE,lheading:uE,list:gE,newline:rE,paragraph:xE,table:QT,text:pE},wE=eE(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,oE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_E).getRegex(),TE={...CE,lheading:dE,table:wE,paragraph:eE(fE).replace(`hr`,oE).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,wE).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_E).getRegex()},EE={...CE,html:eE(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,vE).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:QT,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:eE(fE).replace(`hr`,oE).replace(`heading`,` *#{1,6} *[^
573
+ ]`).replace(`lheading`,uE).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},DE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,AE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,jE=/[\p{P}\p{S}]/u,ME=/[\s\p{P}\p{S}]/u,NE=/[^\s\p{P}\p{S}]/u,PE=eE(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ME).getRegex(),FE=/[\p{Pi}\p{Ps}"']/u,IE=/(?!~)[\p{P}\p{S}]/u,LE=/(?!~)[\s\p{P}\p{S}]/u,RE=/(?:[^\s\p{P}\p{S}]|~)/u,zE=eE(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,tE?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),BE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,VE=eE(BE,`u`).replace(/punct/g,jE).getRegex(),HE=eE(BE,`u`).replace(/punct/g,IE).getRegex(),UE=eE(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,FE).replace(/punct/g,jE).getRegex(),WE=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,GE=eE(WE,`gu`).replace(/notPunctSpace/g,NE).replace(/punctSpace/g,ME).replace(/punct/g,jE).getRegex(),KE=eE(WE,`gu`).replace(/notPunctSpace/g,RE).replace(/punctSpace/g,LE).replace(/punct/g,IE).getRegex(),qE=eE(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,NE).replace(/punctSpace/g,ME).replace(/punct/g,jE).getRegex(),JE=eE(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,NE).replace(/punctSpace/g,ME).replace(/punct/g,jE).getRegex(),YE=eE(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,NE).replace(/punctSpace/g,ME).replace(/punct/g,jE).getRegex(),XE=eE(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,jE).getRegex(),ZE=eE(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,NE).replace(/punctSpace/g,ME).replace(/punct/g,jE).getRegex(),QE=eE(/\\(punct)/,`gu`).replace(/punct/g,jE).getRegex(),$E=eE(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),eD=eE(vE).replace(`(?:-->|$)`,`-->`).getRegex(),tD=eE(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,eD).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),nD=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,rD=eE(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,nD).getRegex(),iD=eE(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,rD).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),aD=eE(/^!?\[(label)\]\[(ref)\]/).replace(`label`,rD).replace(`ref`,mE).getRegex(),oD=eE(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,mE).getRegex(),sD=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,cD=eE(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,nD).getRegex(),lD=eE(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,eE(/^!?\[(label)\]\[(ref)\]/).replace(`label`,cD).replace(`ref`,sD).getRegex()).replace(`nolink`,eE(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,sD).getRegex()).getRegex(),uD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dD=eE(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),fD={_backpedal:QT,anyPunctuation:QE,autolink:$E,blockSkip:zE,br:kE,code:OE,del:QT,delLDelim:QT,delRDelim:QT,emStrongLDelim:VE,emStrongRDelimAst:GE,emStrongRDelimUnd:JE,escape:DE,link:iD,nolink:oD,punctuation:PE,reflink:aD,reflinkSearch:lD,tag:tD,text:AE,url:QT},pD={...fD,emStrongLDelim:UE,emStrongRDelimAst:qE,emStrongRDelimUnd:YE,link:eE(/^!?\[(label)\]\((.*?)\)/).replace(`label`,rD).getRegex(),reflink:eE(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,rD).getRegex()},mD={...fD,emStrongRDelimAst:KE,emStrongLDelim:HE,delLDelim:XE,delRDelim:ZE,url:eE(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,dD).replace(`protocol`,uD).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:eE(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,uD).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},hD={...mD,br:eE(kE).replace(`{2,}`,`*`).getRegex(),text:eE(mD.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},gD={normal:CE,gfm:TE,pedantic:EE},_D={normal:fD,gfm:mD,breaks:hD,pedantic:pD},vD={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},yD=e=>vD[e];function bD(e,t){if(t){if(nE.escapeTest.test(e))return e.replace(nE.escapeReplace,yD)}else if(nE.escapeTestNoEncode.test(e))return e.replace(nE.escapeReplaceNoEncode,yD);return e}function xD(e){return e.replace(nE.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function SD(e){try{e=encodeURI(e).replace(nE.percentDecode,`%`)}catch{return null}return e}function CD(e,t){let n=e.replace(nE.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(nE.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(nE.slashPipe,`|`);return n}function wD(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function TD(e){let t=e.split(`
574
+ `),n=t.length-1;for(;n>=0&&nE.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
575
+ `)}function ED(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function DD(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function OD(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function kD(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function AD(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
576
576
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
577
- `)}function AD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var jD=class{options;rules;lexer;constructor(e){this.options=e||YT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:wD(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=kD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=CD(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:CD(t[0],`
578
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:CD(t[0],`
579
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=CD(t[0],`
577
+ `)}function jD(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var MD=class{options;rules;lexer;constructor(e){this.options=e||XT}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:TD(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=AD(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=wD(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:wD(t[0],`
578
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:wD(t[0],`
579
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=wD(t[0],`
580
580
  `).split(`
581
581
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
582
582
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -591,19 +591,19 @@ ${d.join(`
591
591
  `+e.join(`
592
592
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
593
593
  `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
594
- `,1)[0],l=t[1].length,u=this.options.pedantic?DD(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>DD(e,l)),d=e.split(`
594
+ `,1)[0],l=t[1].length,u=this.options.pedantic?OD(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>OD(e,l)),d=e.split(`
595
595
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
596
596
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
597
597
  `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
598
598
  `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
599
599
  `+d}f=!d.trim(),r+=l+`
600
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=wD(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=TD(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:CD(t[0],`
601
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=SD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
602
- `):[],a={type:`table`,raw:CD(t[0],`
603
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(SD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:CD(t[0],`
600
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=TD(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=ED(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:wD(t[0],`
601
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=CD(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
602
+ `):[],a={type:`table`,raw:wD(t[0],`
603
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(CD(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:wD(t[0],`
604
604
  `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
605
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&AD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=CD(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=ED(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),OD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&AD(e,n[1],r,this.rules))return;let i=t[TD((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return OD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:bD(t[0]),escaped:e}}}},MD=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||YT,this.options.tokenizer=this.options.tokenizer||new jD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:tE,block:hD.normal,inline:gD.normal};this.options.pedantic?(t.block=hD.pedantic,t.inline=gD.pedantic):this.options.gfm&&(t.block=hD.gfm,t.inline=this.options.breaks?gD.breaks:gD.gfm),this.tokenizer.rules=t}static get rules(){return{block:hD,inline:gD}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(tE.carriageReturn,`
606
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(tE.tabCharGlobal,` `).replace(tE.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
605
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&jD(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=wD(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=DD(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),kD(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&jD(e,n[1],r,this.rules))return;let i=t[ED((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return kD(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:xD(t[0]),escaped:e}}}},ND=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||XT,this.options.tokenizer=this.options.tokenizer||new MD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:nE,block:gD.normal,inline:_D.normal};this.options.pedantic?(t.block=gD.pedantic,t.inline=_D.pedantic):this.options.gfm&&(t.block=gD.gfm,t.inline=this.options.breaks?_D.breaks:_D.gfm),this.tokenizer.rules=t}static get rules(){return{block:gD,inline:_D}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(nE.carriageReturn,`
606
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(nE.tabCharGlobal,` `).replace(nE.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
607
607
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
608
608
  `)?``:`
609
609
  `)+i.raw,n.text+=`
@@ -616,9 +616,9 @@ ${d.join(`
616
616
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
617
617
  `)?``:`
618
618
  `)+i.raw,n.text+=`
619
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,TD(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,TD(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ND=class{options;parser;constructor(e){this.options=e||YT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(tE.notSpaceStart)?.[0],i=e?e.replace(tE.endingNewline,``)+`
620
- `:``;return r?`<pre><code class="language-`+yD(r)+`">`+(n?i:yD(i,!0))+`</code></pre>
621
- `:`<pre><code>`+(n?i:yD(i,!0))+`</code></pre>
619
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,ED(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,ED(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},PD=class{options;parser;constructor(e){this.options=e||XT}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(nE.notSpaceStart)?.[0],i=e?e.replace(nE.endingNewline,``)+`
620
+ `:``;return r?`<pre><code class="language-`+bD(r)+`">`+(n?i:bD(i,!0))+`</code></pre>
621
+ `:`<pre><code>`+(n?i:bD(i,!0))+`</code></pre>
622
622
  `}blockquote({tokens:e}){return`<blockquote>
623
623
  ${this.parser.parse(e)}</blockquote>
624
624
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -634,8 +634,8 @@ ${this.parser.parse(e)}</blockquote>
634
634
  `}tablerow({text:e}){return`<tr>
635
635
  ${e}</tr>
636
636
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
637
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${yD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?yD(n,!0):this.parser.parseInline(r),o=xD(e);if(o===null)return a;e=yD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+yD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=xD(e);if(i===null)return yD(n);e=i;let a=`<img src="${yD(e)}" alt="${yD(n)}"`;return t&&(a+=` title="${yD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:yD(e.text)}},PD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},FD=class e{options;renderer;textRenderer;constructor(e){this.options=e||YT,this.options.renderer=this.options.renderer||new ND,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new PD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ID=class{options;block;constructor(e){this.options=e||YT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?MD.lex:MD.lexInline}provideParser(e=this.block){return e?FD.parse:FD.parseInline}},LD=new class{defaults=JT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=FD;Renderer=ND;TextRenderer=PD;Lexer=MD;Tokenizer=jD;Hooks=ID;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ND(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new jD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ID;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ID.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ID.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return MD.lex(e,t??this.defaults)}parser(e,t){return FD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?MD.lex:MD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?FD.parse:FD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?MD.lex:MD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?FD.parse:FD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
638
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+yD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function RD(e,t){return LD.parse(e,t)}RD.options=RD.setOptions=function(e){return LD.setOptions(e),RD.defaults=LD.defaults,XT(RD.defaults),RD},RD.getDefaults=JT,RD.defaults=YT;function zD(...e){return LD.use(...e),RD.defaults=LD.defaults,XT(RD.defaults),RD}RD.use=zD,RD.walkTokens=function(e,t){return LD.walkTokens(e,t)},RD.parseInline=LD.parseInline,RD.Parser=FD,RD.parser=FD.parse,RD.Renderer=ND,RD.TextRenderer=PD,RD.Lexer=MD,RD.lexer=MD.lex,RD.Tokenizer=jD,RD.Hooks=ID,RD.parse=RD,RD.options,RD.setOptions,RD.walkTokens,RD.parseInline,FD.parse,MD.lex;function BD(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var VD=BD();(VD!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`)&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var HD=e=>VD?.can.includes(e)===!0;function UD(e,t){return VD&&HD(e)?VD.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function WD(e,t){HD(e)&&UD(e,t).catch(()=>void 0)}function GD(e,t,n){return HD(`download`)?(e.preventDefault(),UD(`download`,{url:new URL(t,window.location.href).href,filename:n}).catch(()=>void 0),!0):!1}var KD=typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches===!0,qD=typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia;function JD(){(0,y.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=document.documentElement,n=()=>{let n=e.scale>1.01?0:window.innerHeight-e.height-e.offsetTop,r=n>80;t.style.setProperty(`--kb`,r?`${Math.round(n)}px`:`0px`),t.classList.toggle(`keyboard-open`,r)};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n),t.style.removeProperty(`--kb`),t.classList.remove(`keyboard-open`)}},[])}function YD(e){let[t,n]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(e&&HD(`keepAwake`))return WD(`keepAwake`,!0),n(!0),()=>{WD(`keepAwake`,!1),n(!1)};if(!e||!(`wakeLock`in navigator))return;let t=null,r=!1,i=async()=>{if(!(r||t||document.visibilityState!==`visible`))try{let e=await navigator.wakeLock.request(`screen`);if(r){e.release().catch(()=>void 0);return}t=e,n(!0),e.addEventListener(`release`,()=>{t===e&&(t=null,n(!1))})}catch{}};return i(),document.addEventListener(`visibilitychange`,i),()=>{r=!0,document.removeEventListener(`visibilitychange`,i),t?.release().catch(()=>void 0),t=null,n(!1)}},[e]),t}var XD=`wz.notify`,ZD=new Set,QD=null;function $D(){try{return localStorage.getItem(XD)===`1`}catch{return!1}}function eO(e){try{e?localStorage.setItem(XD,`1`):localStorage.removeItem(XD)}catch{}for(let e of ZD)e()}var tO=typeof window<`u`&&`Notification`in window,nO=null;function rO(){return $D()?HD(`notify`)?nO===!1?`quiet`:`on`:tO&&Notification.permission===`granted`?`on`:`quiet`:`off`}function iO(){return(0,y.useSyncExternalStore)(e=>(ZD.add(e),()=>ZD.delete(e)),rO,()=>`off`)}function aO(){return HD(`notify`)?nO===!1:tO&&Notification.permission===`denied`}async function oO(){if(eO(!0),HD(`notify`)){nO=!HD(`notifyPermission`)||await UD(`notifyPermission`).catch(()=>!1);for(let e of ZD)e();return rO()}try{QD??=new AudioContext,QD.resume()}catch{QD=null}if(tO&&Notification.permission==="default")try{await Notification.requestPermission()}catch{}tO&&Notification.permission===`granted`&&await navigator.serviceWorker?.register(`${oS}/sw.js`).catch(()=>void 0);for(let e of ZD)e();return rO()}function sO(){eO(!1)}function cO(){let e=QD;if(e?.state!==`running`)return;let t=e.currentTime;for(let[n,r]of[660,880].entries()){let i=e.createOscillator(),a=e.createGain();i.frequency.value=r,a.gain.setValueAtTime(0,t+n*.16),a.gain.linearRampToValueAtTime(.18,t+n*.16+.02),a.gain.exponentialRampToValueAtTime(.001,t+n*.16+.32),i.connect(a).connect(e.destination),i.start(t+n*.16),i.stop(t+n*.16+.34)}}async function lO(e){if(!$D())return;if(HD(`notify`)){WD(`notify`,e);return}if(document.visibilityState===`visible`){cO(),navigator.vibrate?.([120,60,120]);return}if(!tO||Notification.permission!==`granted`)return;let t={body:e.body,tag:e.tag,icon:uS(`icons/icon-192.png`),badge:uS(`icons/icon-192.png`),data:{url:location.href}};try{let n=await navigator.serviceWorker?.getRegistration();if(n?.active){await n.showNotification(e.title,t);return}}catch{}try{new Notification(e.title,t)}catch{}}function uO(){if(typeof navigator>`u`||!navigator.canShare)return!1;try{return navigator.canShare({files:[new File([`x`],`x.pdf`,{type:`application/pdf`})]})}catch{return!1}}var dO=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),fO=e=>{let t=typeof e==`number`?e:Number(String(e??``).replace(`,`,`.`));return Number.isFinite(t)?t:0};function pO(e,t){let n=dO(e);return n?/^(https?:|data:|\/)/.test(n)?n:t(n):null}function mO(e,t,n,r){return Yl(e[t],n.data,r)}function hO(e,t,n){let r=dO(t)||`label`,i=dO(n)||`value`;return Array.isArray(e)?e.map(e=>({label:dO(e?.[r]),value:fO(e?.[i])})):[]}function gO({c:e,ctx:t,row:n}){let r=e.children;if(!r)return null;if(Array.isArray(r))return(0,X.jsx)(X.Fragment,{children:r.map(e=>(0,X.jsx)(CO,{id:e,ctx:t,row:n},e))});let i=Yl({path:r.path},t.data,n);return(0,X.jsx)(X.Fragment,{children:(Array.isArray(i)?i:[]).map((e,n)=>(0,X.jsx)(CO,{id:r.componentId,ctx:t,row:e},n))})}var _O={success:`bg-moss-tint text-moss`,warning:`bg-amber-tint text-ink-2`,default:`bg-paper-2 text-ink-2`};function vO({data:e}){let t=Math.max(1,...e.map(e=>e.value));return(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map((e,n)=>(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,8rem)_1fr_auto] items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-[0.8125rem] text-ink-2`,children:e.label}),(0,X.jsx)(`span`,{className:`h-2.5 rounded-full bg-paper-2`,children:(0,X.jsx)(`span`,{className:`block h-full rounded-full bg-ember`,style:{width:`${e.value/t*100}%`}})}),(0,X.jsx)(`span`,{className:`text-[0.8125rem] tabular-nums`,children:e.value.toLocaleString()})]},n))})}function yO({data:e}){if(e.length<2)return(0,X.jsx)(vO,{data:e});let t=Math.max(...e.map(e=>e.value)),n=Math.min(...e.map(e=>e.value)),r=t-n||1,i=e.map((t,i)=>[i/(e.length-1)*312+4,116-(t.value-n)/r*112]);return(0,X.jsxs)(`figure`,{children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 320 120`,className:`w-full text-ember`,role:`img`,children:[(0,X.jsx)(`polyline`,{points:i.map(([e,t])=>`${e},${t}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinejoin:`round`}),i.map(([t,n],r)=>(0,X.jsx)(`circle`,{cx:t,cy:n,r:`3`,fill:`currentColor`,children:(0,X.jsx)(`title`,{children:`${e[r].label}: ${e[r].value}`})},r))]}),(0,X.jsxs)(`figcaption`,{className:`mt-1 flex justify-between text-[0.75rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:e[0].label}),(0,X.jsx)(`span`,{children:e.at(-1)?.label})]})]})}var bO=[`var(--color-ember)`,`var(--color-cobalt)`,`var(--color-moss)`,`var(--color-amber)`,`var(--color-ink-3)`];function xO({data:e}){let t=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,n=0,r=2*Math.PI*40;return(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsx)(`svg`,{viewBox:`0 0 100 100`,className:`size-28 shrink-0 -rotate-90`,role:`img`,children:e.map((e,i)=>{let a=Math.max(0,e.value)/t*r,o=(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:40,fill:`none`,stroke:bO[i%bO.length],strokeWidth:`16`,strokeDasharray:`${a} ${r-a}`,strokeDashoffset:-n,children:(0,X.jsx)(`title`,{children:`${e.label}: ${e.value}`})},i);return n+=a,o})}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1 text-[0.8125rem]`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{background:bO[t%bO.length]}}),(0,X.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.value.toLocaleString()})]},t))})]})}function SO({title:e,children:t}){return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-4 ring-1 ring-border-soft`,children:[e?(0,X.jsx)(`div`,{className:`mb-3 font-medium text-[0.875rem]`,children:e}):null,t]})}function CO({id:e,ctx:t,row:n}){let r=t.byId.get(e);if(!r)return null;let i=e=>mO(r,e,t,n);switch(r.component){case`Column`:return(0,X.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,X.jsx)(gO,{c:r,ctx:t,row:n})});case`Text`:{let e=dO(i(`variant`))||`body`;return(0,X.jsx)(`p`,{className:Q(e===`h3`&&`font-display font-semibold text-[1.25rem] leading-tight`,e===`h4`&&`font-semibold text-[1rem]`,e===`body`&&`text-[0.9375rem] leading-relaxed`,e===`muted`&&`text-[0.8125rem] text-ink-3`),children:dO(i(`text`))})}case`List`:return(0,X.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft`,children:(0,X.jsx)(gO,{c:r,ctx:t,row:n})});case`Row`:{let e=pO(i(`image`),t.assetUrl),n=dO(i(`badge`));return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[e?(0,X.jsx)(`img`,{src:e,alt:``,className:`size-10 shrink-0 rounded-lg object-cover`}):null,(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate text-[0.9375rem]`,children:dO(i(`title`))}),i(`subtitle`)?(0,X.jsx)(`div`,{className:`truncate text-[0.8125rem] text-ink-3`,children:dO(i(`subtitle`))}):null]}),i(`meta`)?(0,X.jsx)(`span`,{className:`shrink-0 text-[0.8125rem] text-ink-3 tabular-nums`,children:dO(i(`meta`))}):null,n?(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]`,_O.default),children:n}):null]})}case`DetailGrid`:{let e=i(`rows`);return(0,X.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 rounded-xl bg-card p-4 text-[0.875rem] ring-1 ring-border-soft`,children:(Array.isArray(e)?e:[]).map((e,r)=>(0,X.jsxs)(`div`,{className:`contents`,children:[(0,X.jsx)(`dt`,{className:`text-ink-3`,children:dO(Yl(e?.label,t.data,n))}),(0,X.jsx)(`dd`,{className:`break-words`,children:dO(Yl(e?.value,t.data,n))})]},r))})}case`Badge`:return(0,X.jsx)(`span`,{className:Q(`inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]`,_O[dO(i(`tone`))]??_O.default),children:dO(i(`label`))});case`Grid`:{let e=Math.min(4,Math.max(1,fO(i(`columns`))||2));return(0,X.jsx)(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, ${e>2?9:12}rem), 1fr))`},children:(0,X.jsx)(gO,{c:r,ctx:t,row:n})})}case`Metric`:return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-4 ring-1 ring-border-soft`,children:[(0,X.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:dO(i(`label`))}),(0,X.jsx)(`div`,{className:`mt-1 font-display font-semibold text-[1.5rem] tabular-nums`,children:dO(i(`value`))}),i(`caption`)?(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:dO(i(`caption`))}):null]});case`Table`:{let e=i(`rows`),t=Array.isArray(e)?e:[],n=i(`columns`),r=Array.isArray(n)?n.map(e=>({key:dO(e?.key),label:dO(e?.label??e?.key)})):[...new Set(t.flatMap(e=>Object.keys(e??{})))].map(e=>({key:e,label:e}));return(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-xl ring-1 ring-border-soft`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsx)(`tr`,{children:r.map(e=>(0,X.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e.label},e.key))})}),(0,X.jsx)(`tbody`,{children:t.map((e,t)=>(0,X.jsx)(`tr`,{className:`border-border-soft border-t`,children:r.map(t=>(0,X.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:dO(e?.[t.key])},t.key))},t))})]})})}case`Image`:{let e=pO(i(`src`),t.assetUrl);return e?(0,X.jsx)(`img`,{src:e,alt:dO(i(`alt`)),className:`w-full rounded-xl`}):null}case`BarChart`:return(0,X.jsx)(SO,{title:dO(i(`title`)),children:(0,X.jsx)(vO,{data:hO(i(`points`),i(`labelKey`),i(`valueKey`))})});case`LineChart`:return(0,X.jsx)(SO,{title:dO(i(`title`)),children:(0,X.jsx)(yO,{data:hO(i(`points`),i(`labelKey`),i(`valueKey`))})});case`DonutChart`:return(0,X.jsx)(SO,{title:dO(i(`title`)),children:(0,X.jsx)(xO,{data:hO(i(`slices`),i(`labelKey`),i(`valueKey`))})});case`Actions`:return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(gO,{c:r,ctx:t,row:n})});case`Button`:{let e=dO(i(`action`));return!t.onAction&&e!==`open`?null:(0,X.jsx)(`button`,{type:`button`,onClick:()=>{let n=i(`target`);if(e===`open`){let e=pO(n,t.assetUrl);e&&window.open(e,`_blank`,`noopener`);return}t.onAction?.({action:e,target:n})},className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-4 text-[0.875rem] text-ink-2 hover:text-ink coarse:h-11`,children:dO(i(`label`))})}}return null}function wO({surface:e,assetUrl:t,onAction:n}){let r={byId:new Map(e.components.map(e=>[e.id,e])),data:e.data,assetUrl:t,onAction:n};return(0,X.jsx)(CO,{id:`root`,ctx:r})}function TO({text:e,className:t}){let n=(0,y.useMemo)(()=>qT.sanitize(RD.parse(e,{async:!1})),[e]);return(0,X.jsx)(`div`,{className:Q(`prose-zen`,t),dangerouslySetInnerHTML:{__html:n}})}function EO({src:e,page:t,height:n,fit:r}){let i=(0,y.useRef)(null),[a,o]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.clientWidth));return t.observe(e),o(e.clientWidth),()=>t.disconnect()},[]);let[s,c]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=!0;return fetch(e,{credentials:`include`}).then(e=>e.ok?e.text():``).then(n=>t&&c({src:e,text:n})),()=>{t=!1}},[e]);let l=t??Math.max(a,900),u=a?r?a/l:Math.min(1,a/l):1;return(0,X.jsxs)(`div`,{ref:i,className:`relative overflow-hidden rounded-lg bg-white ring-1 ring-border-soft`,style:{height:n*u},children:[s?.src===e?(0,X.jsx)(`iframe`,{title:`preview`,srcDoc:s.text,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:l,height:n,transform:`scale(${u})`}},e):(0,X.jsx)(`div`,{className:`absolute inset-0 animate-pulse bg-paper-2`}),(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-full bg-card/90 text-ink-2 shadow-soft ring-1 ring-border-soft backdrop-blur hover:text-ink coarse:size-11`,"aria-label":Z(`run.openFull`),children:(0,X.jsx)(Ry,{className:`size-4`})})]})}var DO={disc:{file:`ai`,box:566.93,x:89.28,y:100.72,w:365.49,h:365.49},generated:{file:`ai-generated`,box:1789.84,x:207.3,y:144.36,w:1384.24,h:266.41},edited:{file:`ai-modified`,box:1700.79,x:231.11,y:144.36,w:1230.56,h:266.41}};function OO({icon:e,tone:t,size:n,className:r}){let i=DO[e],a=n/i.h;return(0,X.jsx)(`img`,{src:uS(`ai-labels/${i.file}-${t}.svg`),alt:``,draggable:!1,className:Q(`pointer-events-none absolute max-w-none select-none`,r),style:{width:i.box*a,height:566.93*a,left:-i.x*a,top:-i.y*a}})}function kO({ai:e,className:t}){let[n,r]=(0,y.useState)(!1);if(!e)return null;let i=DO[e],a=t===`static`,o=a?[[`black`,`dark:hidden`],[`white`,`hidden dark:block`]]:[[`white`,``]];return(0,X.jsx)(`button`,{type:`button`,"aria-label":Z(e===`edited`?`ai.modified`:`ai.generated`),"aria-expanded":n,"data-open":n,onClick:()=>r(e=>!e),className:Q(`group block cursor-default overflow-hidden rounded-full backdrop-blur-md transition-[width] duration-200`,`w-[var(--ai-disc)] hover:w-[var(--ai-long)] focus-visible:w-[var(--ai-long)] data-[open=true]:w-[var(--ai-long)]`,a?`relative`:Q(`absolute shadow-[0_1px_3px_rgba(0,0,0,0.25)]`,t??`bottom-2 left-2`)),style:{height:18,"--ai-disc":`18px`,"--ai-long":`${i.w/i.h*18}px`},children:o.map(([t,r])=>(0,X.jsxs)(`span`,{className:r,children:[(0,X.jsx)(OO,{icon:`disc`,tone:t,size:18,className:Q(`transition-opacity duration-200`,n?`opacity-0`:`opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0`)}),(0,X.jsx)(OO,{icon:e,tone:t,size:18,className:Q(`transition-opacity duration-200`,n?`opacity-100`:`opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`)})]},t))})}function AO(e,t){return e.type===`agent`?e.output.fields?.find(e=>e.id===t)?.description??t:t}function jO({step:e,json:t}){return!t||typeof t!=`object`?(0,X.jsx)(`pre`,{className:`text-[0.8125rem]`,children:JSON.stringify(t,null,2)}):(0,X.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(t).map(([t,n])=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-1 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:AO(e,t)}),typeof n==`boolean`?(0,X.jsx)(`div`,{className:`text-[0.9375rem]`,children:Z(n?`run.yes`:`run.no`)}):typeof n==`string`||typeof n==`number`?(0,X.jsx)(`div`,{className:`whitespace-pre-wrap text-[0.9375rem]`,children:String(n)}):Array.isArray(n)&&n.every(e=>typeof e!=`object`)?(0,X.jsx)(`ul`,{className:`list-disc pl-5 text-[0.875rem]`,children:n.map((e,t)=>(0,X.jsx)(`li`,{className:`break-words`,children:String(e)},t))}):Array.isArray(n)&&n.length&&typeof n[0]==`object`?(0,X.jsx)(MO,{rows:n}):(0,X.jsx)(`pre`,{className:`overflow-auto rounded-lg bg-paper-2 p-3 text-[0.75rem]`,children:JSON.stringify(n,null,2)})]},t))})}function MO({rows:e}){let t=[...new Set(e.flatMap(e=>Object.keys(e)))];return(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-lg ring-1 ring-border-soft`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsx)(`tr`,{children:t.map(e=>(0,X.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e},e))})}),(0,X.jsx)(`tbody`,{children:e.map((e,n)=>(0,X.jsx)(`tr`,{className:`border-border-soft border-t`,children:t.map(t=>(0,X.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:e[t]===null||e[t]===void 0?``:String(e[t])},t))},n))})]})})}function NO({text:e}){let[t,n]=(0,y.useState)(!1);return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4`,children:[t?(0,X.jsx)(Iv,{className:`size-3.5`}):(0,X.jsx)(Hv,{className:`size-3.5`}),Z(t?`share.copied`:`run.copy`)]})}function PO({base:e,step:t,output:n,editable:r,draft:i,onDraft:a,picked:o,onPick:s,onSurfaceAction:c}){if(!n)return null;let l=t=>lS(`${e}/assets/${t}`);if(n.surface)return(0,X.jsx)(wO,{surface:n.surface,assetUrl:l,onAction:c});if(t.type===`widget`||t.type===`film`){let e=n.assets?.find(e=>e.kind===`video`);if(e){let r=n.assets?.find(e=>e.kind===`poster`),i=t.type===`film`?t.format===`9:16`:(t.size?.height??0)>(t.size?.width??1);return(0,X.jsxs)(`div`,{className:Q(`relative mx-auto`,i?`w-fit`:`w-full`),children:[(0,X.jsx)(`video`,{src:l(e.id),poster:r?l(r.id):void 0,controls:!0,playsInline:!0,className:Q(`rounded-lg bg-black ring-1 ring-border-soft`,i?`max-h-[76vh]`:`w-full`)}),(0,X.jsx)(kO,{ai:e.ai,className:`top-2 right-2`})]})}if(t.type===`film`)return null;let r=n.assets?.find(e=>e.mime===`text/html`),i=t.size??{width:1280,height:720};return r?(0,X.jsx)(EO,{src:l(r.id),page:i.width,height:i.height,fit:!0}):null}if(t.type===`generate`){let e=n.assets?.[0];if(!e)return null;if(t.asset===`voice`)return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`audio`,{src:l(e.id),controls:!0,className:`w-full`}),(0,X.jsx)(kO,{ai:e.ai,className:`static`}),n.text?(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-2 leading-relaxed`,children:n.text}):null]});if((n.assets?.length??0)>1&&(t.asset===`image`||t.asset===`video`)){let e=t.options?.aspectRatio===`9:16`||t.options?.aspectRatio===`2:3`;return(0,X.jsx)(`div`,{className:Q(`grid gap-3`,e?`grid-cols-2 sm:grid-cols-3`:`sm:grid-cols-2`),children:n.assets?.map((e,n)=>{let r=o?.includes(n);return(0,X.jsxs)(`figure`,{className:Q(`relative overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,r&&`ring-2 ring-ember`),children:[t.asset===`image`?(0,X.jsx)(`img`,{src:l(e.id),alt:`${t.title} ${n+1}`,className:`w-full`}):(0,X.jsx)(`video`,{src:l(e.id),controls:!0,playsInline:!0,loop:!0,className:`w-full`}),s?(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>s(n),className:Q(`absolute top-2 left-2 inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.75rem] shadow-soft backdrop-blur coarse:h-11`,r?`bg-ember text-ember-on`:`bg-card/90 text-ink-2 hover:text-ink`),children:[r?(0,X.jsx)(Iv,{className:`size-3.5`}):null,Z(r?`run.pickedItem`:`run.pickItem`,{n:n+1})]}):(0,X.jsx)(`span`,{className:`absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2`,children:n+1}),(0,X.jsx)(kO,{ai:e.ai,className:t.asset===`image`?`bottom-2 left-2`:`top-2 right-2`})]},e.id)})})}if(t.asset===`image`)return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:l(e.id),alt:t.title,className:`w-full rounded-lg bg-paper-2 ring-1 ring-border-soft`}),(0,X.jsx)(kO,{ai:e.ai})]});if(t.asset===`video`){let n=t.options?.aspectRatio===`9:16`;return(0,X.jsxs)(`div`,{className:Q(`relative mx-auto`,n?`w-fit`:`w-full`),children:[(0,X.jsx)(`video`,{src:l(e.id),controls:!0,playsInline:!0,loop:!0,className:Q(`rounded-lg bg-black ring-1 ring-border-soft`,n?`max-h-[70vh]`:`w-full`)}),(0,X.jsx)(kO,{ai:e.ai,className:`top-2 left-2`})]})}return t.asset===`document`?(0,X.jsx)(EO,{src:l(e.id),page:820,height:1100}):(0,X.jsx)(EO,{src:l(e.id),page:null,height:760})}if(t.type===`agent`){let e=n.assets?.filter(e=>e.kind!==`file`&&e.mime.startsWith(`image/`))??[],o=n.assets?.filter(e=>e.kind===`file`)??[];return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t.output.format===`json`&&n.json!==void 0?(0,X.jsx)(jO,{step:t,json:n.json}):r?(0,X.jsx)(CS,{value:i??n.text??``,onChange:e=>a?.(e.target.value),minRows:4,maxRows:24}):t.output.format===`markdown`?(0,X.jsx)(TO,{text:n.text??``}):(0,X.jsx)(`div`,{className:`whitespace-pre-wrap text-[1rem] leading-relaxed`,children:n.text}),e.map(e=>(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:l(e.id),alt:``,className:`w-full rounded-lg ring-1 ring-border-soft`}),(0,X.jsx)(kO,{ai:e.ai})]},e.id)),o.length?(0,X.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:o.map(e=>(0,X.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,X.jsxs)(`a`,{href:l(e.id),download:e.name,onClick:t=>GD(t,l(e.id),e.name),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,X.jsx)(iy,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]})},e.id))}):null,t.output.format!==`json`&&!r&&n.text?(0,X.jsx)(`div`,{children:(0,X.jsx)(NO,{text:n.text})}):null]})}return null}var FO={png:`PNG`,mp4:`MP4`,mp3:`MP3`,pdf:`PDF`,docx:`Word`,html:`HTML`,md:`Markdown`,txt:`Text`,csv:`CSV`,xlsx:`Excel`,json:`JSON`,zip:`ZIP`};function IO(e,t){return(e.headers.get(`content-disposition`)??``).match(/filename="([^"]+)"/)?.[1]??t}function LO({url:e,format:t,title:n}){let[r,i]=(0,y.useState)(`idle`),a=(0,y.useRef)(null),o=async()=>{if(HD(`share`)){i(`busy`),await UD(`share`,{url:new URL(e,location.href).href,title:n}).catch(()=>void 0),i(`idle`);return}try{if(!a.current){i(`busy`);let n=await fetch(e,{credentials:`include`});if(!n.ok)throw Error(String(n.status));let r=await n.blob();a.current=new File([r],IO(n,`download.${t}`),{type:r.type.split(`;`)[0]})}let r={files:[a.current],title:n};if(!navigator.canShare(r)){location.href=e,i(`idle`);return}await navigator.share(r),i(`idle`)}catch(e){i(a.current&&e.name===`NotAllowedError`?`ready`:`idle`)}};return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void o(),disabled:r===`busy`,"aria-label":Z(`run.shareFile`),title:Z(`run.shareFile`),className:Q(`inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,r===`ready`?`bg-ember-tint text-ink ring-1 ring-ember`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[r===`busy`?(0,X.jsx)(OS,{className:`size-3.5`}):(0,X.jsx)(fb,{className:`size-3.5`}),Z(r===`ready`?`run.shareNow`:`run.share`)]})}var RO=HD(`share`)||uO();function zO({base:e,stepId:t,formats:n,title:r}){let i=n=>lS(`${e}/steps/${t}/download?format=${n}`);return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n.map((e,t)=>(0,X.jsxs)(`a`,{href:i(e),onClick:t=>GD(t,i(e)),className:Q(`inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,t===0?`bg-primary text-primary-foreground hover:brightness-105`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[t===0?(0,X.jsx)(Jv,{className:`size-3.5`}):null,FO[e]]},e)),RO&&n.length?(0,X.jsx)(LO,{url:i(n[0]),format:n[0],title:r},i(n[0])):null]})}function BO(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:Z(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var VO={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function HO({runId:e,title:t,initial:n}){let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(n),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),p=async()=>{if(i(!0),!a){c(!0),f(null);try{o(await mS.post(`/api/runs/${e}/share`))}catch(e){f(e.message)}finally{c(!1)}}},m=async()=>{await mS.del(`/api/runs/${e}/share`),o(null),i(!1)},h=()=>{a&&(navigator.clipboard.writeText(a.url),u(!0),setTimeout(()=>u(!1),1500))},g=HD(`share`)||typeof navigator<`u`&&`share`in navigator,_=a?.expiresAt?new Intl.DateTimeFormat(Gx,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_S,{variant:`secondary`,onClick:()=>void p(),children:[(0,X.jsx)(ub,{className:`size-4`}),` `,Z(`shareRun.button`)]}),(0,X.jsx)(jS,{open:r,onClose:()=>i(!1),title:Z(`shareRun.title`),children:s?(0,X.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,X.jsx)(OS,{})}):d?(0,X.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:d}):a?(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,X.jsx)(Ey,{className:`size-4 shrink-0 text-ink-3`}),(0,X.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":Z(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,X.jsxs)(_S,{size:`sm`,onClick:h,children:[l?(0,X.jsx)(Iv,{className:`size-3.5`}):(0,X.jsx)(Hv,{className:`size-3.5`}),Z(l?`share.copied`:`share.copy`)]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[BO(a.url,t).map(e=>(0,X.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,X.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,X.jsx)(Py,{className:`size-5`}):VO[e.id]}),e.label]},e.id)),g?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void(HD(`share`)?UD(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,X.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,X.jsx)(ub,{className:`size-5`})}),Z(`shareRun.more`)]}):null]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:_?Z(`shareRun.until`,{date:_}):Z(`shareRun.kept`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>void m(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:Z(`shareRun.withdraw`)})]})]}):null})]})}function UO({runId:e,ask:t}){return t.kind===`confirm`?(0,X.jsx)(WO,{runId:e,ask:t}):(0,X.jsx)(GO,{runId:e,ask:t})}function WO({runId:e,ask:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=async n=>{a(!0),s(null);try{await mS.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){s(e.message),a(!1)}},l=t.action.destructive?wb:Xy;return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:Q(`flex size-10 shrink-0 items-center justify-center rounded-full`,t.action.destructive?`bg-rose-tint text-rose`:`bg-ember-tint text-ember-strong`),children:(0,X.jsx)(l,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`ask.wants`,{service:t.service})}),(0,X.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason})]})]}),(0,X.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[0.8125rem] leading-relaxed ring-1 ring-border-soft`,children:t.input}),(0,X.jsxs)(`div`,{className:`mt-5 flex items-center gap-4`,children:[(0,X.jsx)(ES,{checked:n,onChange:r,label:Z(`ask.allowRest`)}),(0,X.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Z(`ask.allowRest`)})]}),o?(0,X.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:o}):null,(0,X.jsxs)(`div`,{className:`action-bar mt-6 flex items-center justify-between gap-3`,children:[(0,X.jsx)(_S,{variant:`ghost`,disabled:i,onClick:()=>void c({type:`skip`}),children:Z(`ask.deny`)}),(0,X.jsx)(_S,{busy:i,onClick:()=>void c({type:`done`,remember:n}),children:Z(`ask.allow`)})]})]})}function GO({runId:e,ask:t}){let[n,r]=(0,y.useState)({}),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=(0,y.useCallback)(()=>d(e=>e+1),[]);(0,y.useEffect)(()=>{let e=setInterval(_,2500);return()=>clearInterval(e)},[_]);let v=async n=>{s(!0),l(null);try{await mS.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){l(e.message),s(!1)}},b=async t=>{l(null);try{await mS.post(`/api/runs/${e}/browser/act`,t)}catch(e){l(e.message)}_()},x=e=>{let t=g.current;if(!t?.naturalWidth)return;let n=t.getBoundingClientRect();b({type:`click`,x:Math.round((e.clientX-n.left)/n.width*t.naturalWidth),y:Math.round((e.clientY-n.top)/n.height*t.naturalHeight)})},S=t.fields.some(e=>n[e.id]);return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-ember-tint text-ember-strong`,children:(0,X.jsx)(My,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason}),(0,X.jsxs)(`p`,{className:`mt-0.5 truncate text-[0.8125rem] text-ink-3`,children:[t.site.host,t.site.title?` · ${t.site.title}`:``]})]})]}),(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-paper-2 ring-1 ring-border-soft`,children:[(0,X.jsx)(`img`,{ref:g,src:lS(`/api/runs/${e}/browser/screen?t=${u}`),alt:t.site.host,onClick:x,className:`block w-full cursor-pointer`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border-soft border-t bg-card p-2`,children:[(0,X.jsx)(xS,{type:m?`password`:`text`,autoComplete:`off`,value:f,placeholder:Z(`ask.typeInto`),onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b({type:`type`,text:f}).then(()=>p(``)))},autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`send`,className:`h-9 min-w-[9rem] flex-1 basis-full text-[0.8125rem] sm:basis-0 coarse:h-11`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:Q(`h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5`,m?`bg-ember-veil text-ink`:`text-ink-3 hover:bg-paper-2`),children:Z(`ask.hide`)}),(0,X.jsx)(KO,{label:`Enter`,onClick:()=>void b({type:`key`,key:`Enter`}),children:(0,X.jsx)(Wv,{className:`size-4`})}),(0,X.jsx)(KO,{label:Z(`ask.up`),onClick:()=>void b({type:`scroll`,dy:-500}),children:(0,X.jsx)(Ev,{className:`size-4`})}),(0,X.jsx)(KO,{label:Z(`ask.down`),onClick:()=>void b({type:`scroll`,dy:500}),children:(0,X.jsx)(bv,{className:`size-4`})})]})]}),(0,X.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-4`,children:Z(`ask.pictureHint`)}),t.fields.length?(0,X.jsxs)(`form`,{className:`mt-5 flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),v({type:`fill`,values:n,remember:i})},children:[t.fields.map((e,i)=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(DS,{children:e.label}),(0,X.jsx)(xS,{autoFocus:i===0,type:e.secret?`password`:`text`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:i===t.fields.length-1?`go`:`next`,value:n[e.id]??``,onChange:t=>r(n=>({...n,[e.id]:t.target.value}))})]},e.id)),(0,X.jsx)(`button`,{type:`submit`,hidden:!0})]}):null,(0,X.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-4`,children:[(0,X.jsx)(ES,{checked:i,onChange:a,label:Z(`ask.remember`)}),(0,X.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Z(`ask.remember`)})]}),(0,X.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(mb,{className:`mt-0.5 size-4 shrink-0 text-moss`}),` `,Z(`ask.private`)]}),c?(0,X.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:c}):null,(0,X.jsxs)(`div`,{className:`action-bar mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(_S,{variant:`ghost`,disabled:o,onClick:()=>void v({type:`skip`}),children:Z(`ask.skip`)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.fields.length?(0,X.jsx)(_S,{variant:`secondary`,disabled:o,onClick:()=>void v({type:`done`,remember:i}),children:Z(`ask.done`)}):null,t.fields.length?(0,X.jsx)(_S,{busy:o,disabled:!S,onClick:()=>void v({type:`fill`,values:n,remember:i}),children:Z(`ask.signIn`)}):(0,X.jsx)(_S,{busy:o,onClick:()=>void v({type:`done`,remember:i}),children:Z(`ask.done`)})]})]})]})}function KO({label:e,onClick:t,children:n}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:`flex size-9 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-paper-2 hover:text-ink coarse:size-11`,children:n})}async function qO(e,t=2400){if(!/^image\/(jpeg|png|webp)$/.test(e.type)||e.size<12e5)return e;try{let n=await createImageBitmap(e),r=Math.min(1,t/Math.max(n.width,n.height)),i=document.createElement(`canvas`);i.width=Math.round(n.width*r),i.height=Math.round(n.height*r),i.getContext(`2d`)?.drawImage(n,0,0,i.width,i.height);let a=await new Promise(e=>i.toBlob(e,`image/jpeg`,.86));return a&&a.size<e.size?new File([a],`${e.name.replace(/\.[^.]+$/,``)}.jpg`,{type:`image/jpeg`}):e}catch{return e}}function JO(){return new Date().toISOString().slice(0,19).replace(/[:T]/g,`-`)}function YO(e){let t=e?.name;return t===`NotFoundError`||t===`OverconstrainedError`?`missing`:t===`NotReadableError`||t===`AbortError`?`busy`:`denied`}function XO(e){return!!e?.getCapabilities?.()?.torch}function ZO(e,t,n=!1){let r=(0,y.useRef)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!e)return;let r=null,i=!1;s(null),a(null),d(!1),p(!1);let o={facingMode:{ideal:t},width:{ideal:2560},height:{ideal:1440}};return(async()=>{if(!navigator.mediaDevices?.getUserMedia)throw new DOMException(`no camera api`,`NotAllowedError`);try{r=await navigator.mediaDevices.getUserMedia({video:o,audio:n})}catch(e){if(!n)throw e;r=await navigator.mediaDevices.getUserMedia({video:o})}if(i){for(let e of r.getTracks())e.stop();return}a(r);let e=r.getVideoTracks()[0],t=()=>!i&&d(XO(e));t(),setTimeout(t,600);let s=await navigator.mediaDevices.enumerateDevices().catch(()=>[]);i||l(s.filter(e=>e.kind===`videoinput`).length)})().catch(e=>!i&&s(YO(e))),()=>{i=!0;for(let e of r?.getTracks()??[])e.stop()}},[e,t,n]),(0,y.useEffect)(()=>{r.current&&i&&(r.current.srcObject=i)},[i]),{video:r,stream:i,error:o,cameras:c,torchable:u,torch:f,setTorch:async e=>{let t=i?.getVideoTracks()[0];try{await t?.applyConstraints({advanced:[{torch:e}]}),p(e)}catch{d(!1)}},mirrored:i?.getVideoTracks()[0]?.getSettings().facingMode===`user`}}function QO({open:e,onClose:t,label:n,children:r}){let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,X.jsx)(`dialog`,{ref:i,onClose:t,"aria-label":n,className:`media-sheet`,children:e?(0,X.jsx)(`div`,{className:`flex h-full flex-col`,children:r}):null})}function $O({label:e,onClick:t,active:n,children:r}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":n,onClick:t,className:Q(`flex size-11 shrink-0 items-center justify-center rounded-full transition`,n?`bg-white text-black`:`bg-white/12 text-white hover:bg-white/20`),children:r})}function ek({title:e,onClose:t,camera:n,onFlip:r}){return(0,X.jsx)(`div`,{className:`safe-top`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,X.jsx)($O,{label:Z(`common.close`),onClick:t,children:(0,X.jsx)(Ib,{className:`size-5`})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]`,children:e}),n.torchable?(0,X.jsx)($O,{label:Z(`camera.torch`),active:n.torch,onClick:()=>void n.setTorch(!n.torch),children:n.torch?(0,X.jsx)(fy,{className:`size-5`}):(0,X.jsx)(uy,{className:`size-5`})}):null,n.stream&&(n.cameras>1||KD)?(0,X.jsx)($O,{label:Z(`camera.flip`),onClick:r,children:(0,X.jsx)(bb,{className:`size-5`})}):(0,X.jsx)(`span`,{className:`size-11`})]})})}function tk({camera:e,asking:t,children:n,actions:r}){return(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(`video`,{ref:e.video,autoPlay:!0,playsInline:!0,muted:!0,className:Q(`absolute inset-0 size-full object-contain`,e.mirrored&&`-scale-x-100`)}),e.error?(0,X.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-5 bg-black px-8 text-center`,children:[(0,X.jsx)(`p`,{className:`max-w-sm text-[0.9375rem] text-white/85 leading-relaxed`,children:Z(`camera.${e.error}`)}),r]}):e.stream?n:(0,X.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75`,children:[(0,X.jsx)(OS,{}),(0,X.jsx)(`p`,{className:`max-w-xs text-[0.875rem] leading-relaxed`,children:t})]})]})}var nk=30;function rk(){if(typeof MediaRecorder<`u`)return[`video/mp4;codecs=avc1.42E01E,mp4a.40.2`,`video/mp4`,`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e))}var ik=!!rk();function ak({open:e,multiple:t,video:n,onClose:r,onCapture:i,onNative:a}){let[o,s]=(0,y.useState)(`environment`),[c,l]=(0,y.useState)(`photo`),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=(0,y.useRef)(null),_=ZO(e,o,c===`video`);(0,y.useEffect)(()=>{e&&(d(0),l(`photo`),h(null))},[e]);let v=async e=>{p(!0);try{await i(e),d(e=>e+1),t||r()}finally{p(!1)}},b=async()=>{let e=_.video.current;if(!e?.videoWidth)return;let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`)?.drawImage(e,0,0);let n=await new Promise(e=>t.toBlob(e,`image/jpeg`,.9));n&&await v(new File([n],`foto-${JO()}.jpg`,{type:`image/jpeg`}))},x=()=>{g.current?.state===`recording`&&g.current.stop()},S=()=>{let e=rk();if(!_.stream||!e)return;let t=[],n=new MediaRecorder(_.stream,{mimeType:e,videoBitsPerSecond:25e5,audioBitsPerSecond:96e3});n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{h(null),g.current=null;let n=e.split(`;`)[0];if(t.length){let e=n===`video/mp4`?`mp4`:`webm`;v(new File(t,`video-${JO()}.${e}`,{type:n}))}},g.current=n,n.start(1e3),h(0)};(0,y.useEffect)(()=>{if(m===null)return;if(m>=nk){g.current?.state===`recording`&&g.current.stop();return}let e=setTimeout(()=>h(e=>e===null?null:e+1),1e3);return()=>clearTimeout(e)},[m]),(0,y.useEffect)(()=>{!e&&g.current&&(g.current.onstop=null,g.current.stop(),g.current=null)},[e]);let C=e=>`0:${String(e).padStart(2,`0`)}`;return(0,X.jsxs)(QO,{open:e,onClose:r,label:Z(`camera.title`),children:[(0,X.jsx)(ek,{title:m===null?u?Z(`camera.taken`,{n:u}):Z(`camera.title`):`${C(m)} / ${C(nk)}`,onClose:r,camera:_,onFlip:()=>s(e=>e===`environment`?`user`:`environment`)}),(0,X.jsx)(tk,{camera:_,asking:Z(`camera.asking`),actions:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a?(0,X.jsxs)(ok,{onClick:()=>{r(),a()},children:[(0,X.jsx)(Pv,{className:`size-4`}),` `,Z(KD?`camera.native`:`camera.pick`)]}):null,(0,X.jsx)(ok,{quiet:!0,onClick:r,children:Z(`common.close`)})]})}),(0,X.jsxs)(`div`,{className:Q(`safe-bottom px-4 pt-3`,_.error&&`invisible`),children:[n&&ik&&m===null?(0,X.jsx)(`div`,{className:`mb-3 flex justify-center gap-1 text-[0.8125rem]`,children:[`photo`,`video`].map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:Q(`h-9 rounded-full px-4 font-medium transition`,c===e?`bg-white text-black`:`text-white/70 hover:text-white`),children:Z(e===`photo`?`camera.photo`:`camera.video`)},e))}):null,(0,X.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[0.8125rem] text-white/70 leading-snug`,children:m===null?c===`video`?Z(`camera.clipHint`,{s:nk}):Z(t?`camera.hintMany`:`camera.hint`):Z(`camera.recording`)}),(0,X.jsx)(`button`,{type:`button`,"aria-label":Z(c===`photo`?`camera.shoot`:m===null?`camera.record`:`camera.stop`),disabled:!_.stream||f,onClick:()=>c===`photo`?void b():m===null?S():x(),className:`flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40`,children:f?(0,X.jsx)(OS,{className:`text-white`}):c===`photo`?(0,X.jsx)(`span`,{className:`size-[54px] rounded-full bg-white`}):m===null?(0,X.jsx)(`span`,{className:`flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]`,children:(0,X.jsx)(Ab,{className:`size-6 text-white`})}):(0,X.jsx)(`span`,{className:`size-7 rounded-md bg-[#e5484d]`})}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:t&&u&&m===null?(0,X.jsxs)(ok,{onClick:r,children:[(0,X.jsx)(Iv,{className:`size-4`}),` `,Z(`camera.done`)]}):null})]})]})]})}function ok({onClick:e,quiet:t,children:n}){return(0,X.jsx)(`button`,{type:`button`,onClick:e,className:Q(`inline-flex h-11 items-center justify-center gap-2 rounded-full px-5 font-medium text-[0.875rem] transition`,t?`text-white/75 hover:text-white`:`bg-white text-black hover:bg-white/90`),children:n})}var sk=25,ck=9e3;function lk(e){return e.code===e.PERMISSION_DENIED?`denied`:e.code===e.TIMEOUT?`timeout`:`unavailable`}function uk({value:e,runId:t,placeholder:n,onChange:r,onBusy:i}){let a=Ql(e)?e:null,[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(!!a?.label),f=(0,y.useRef)(a);f.current=a;let p=a?.lat!==void 0&&a.lng!==void 0,m=typeof navigator<`u`&&`geolocation`in navigator,h=()=>{u.current!==null&&(navigator.geolocation.clearWatch(u.current),u.current=null),s(!1),i?.(!1)};(0,y.useEffect)(()=>()=>{u.current!==null&&navigator.geolocation.clearWatch(u.current)},[]);let g=async(e,n)=>{try{let{label:i}=await mS.post(`/api/runs/${t}/geocode`,{lat:e,lng:n,language:Gx}),a=f.current;i&&!d.current&&a?.lat===e&&a.lng===n&&r({...a,label:i})}catch{}},_=()=>{l(null),s(!0),i?.(!0);let e=Date.now(),t=1/0;u.current=navigator.geolocation.watchPosition(n=>{let{latitude:i,longitude:a,accuracy:o}=n.coords;if(o<t){t=o;let e=Math.round(i*1e6)/1e6,n=Math.round(a*1e6)/1e6,s=d.current?f.current?.label:void 0,c={lat:e,lng:n,accuracy:Math.round(o),...s?{label:s}:{}};f.current=c,r(c)}if(t<=sk||Date.now()-e>ck){h();let e=f.current;e?.lat!==void 0&&e.lng!==void 0&&g(e.lat,e.lng)}},e=>{h(),t===1/0&&l(lk(e))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:1e4})},v=e=>{d.current=e.trim().length>0;let t={...p?a:{},label:e};r(p||e.trim()?t:void 0)};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,X.jsx)(Iy,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`truncate font-medium text-[0.9375rem] tabular-nums`,children:[a.lat?.toFixed(5),`, `,a.lng?.toFixed(5)]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:o?Z(`location.refining`):a.accuracy?Z(`location.accuracy`,{m:a.accuracy}):null}),(0,X.jsxs)(`a`,{href:`https://www.openstreetmap.org/?mlat=${a.lat}&mlon=${a.lng}#map=17/${a.lat}/${a.lng}`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline-offset-2 hover:text-ink hover:underline coarse:-my-3 coarse:min-h-11 coarse:min-w-11`,children:[Z(`location.map`),` `,(0,X.jsx)(Qv,{className:`size-3`})]})]})]}),(0,X.jsx)(vS,{label:Z(`location.remove`),onClick:()=>{h(),d.current=!1,r(void 0)},children:(0,X.jsx)(Ib,{className:`size-4`})})]}):m?(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(_S,{variant:`secondary`,size:`lg`,busy:o,onClick:_,className:`w-full sm:w-auto`,children:[o?null:(0,X.jsx)(Ay,{className:`size-4`}),Z(o?`location.locating`:`location.use`)]}),c?(0,X.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Z(`location.${c}`)}):(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Z(`location.why`)})]}):null,(0,X.jsx)(xS,{value:a?.label??``,placeholder:n??Z(p?`location.label`:`location.manual`),autoComplete:`street-address`,enterKeyHint:`done`,"aria-label":Z(`location.manual`),onChange:e=>v(e.target.value)})]})}var dk=c({createWorker:()=>fk}),fk,pk=o((()=>{fk=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
637
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${bD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?bD(n,!0):this.parser.parseInline(r),o=SD(e);if(o===null)return a;e=bD(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+bD(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=SD(e);if(i===null)return bD(n);e=i;let a=`<img src="${bD(e)}" alt="${bD(n)}"`;return t&&(a+=` title="${bD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:bD(e.text)}},FD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ID=class e{options;renderer;textRenderer;constructor(e){this.options=e||XT,this.options.renderer=this.options.renderer||new PD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new FD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},LD=class{options;block;constructor(e){this.options=e||XT}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ND.lex:ND.lexInline}provideParser(e=this.block){return e?ID.parse:ID.parseInline}},RD=new class{defaults=YT();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ID;Renderer=PD;TextRenderer=FD;Lexer=ND;Tokenizer=MD;Hooks=LD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new PD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new MD(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new LD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=LD.passThroughHooks.has(n)?e=>{if(this.defaults.async&&LD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ND.lex(e,t??this.defaults)}parser(e,t){return ID.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ND.lex:ND.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ID.parse:ID.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ND.lex:ND.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ID.parse:ID.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
638
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+bD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function zD(e,t){return RD.parse(e,t)}zD.options=zD.setOptions=function(e){return RD.setOptions(e),zD.defaults=RD.defaults,ZT(zD.defaults),zD},zD.getDefaults=YT,zD.defaults=XT;function BD(...e){return RD.use(...e),zD.defaults=RD.defaults,ZT(zD.defaults),zD}zD.use=BD,zD.walkTokens=function(e,t){return RD.walkTokens(e,t)},zD.parseInline=RD.parseInline,zD.Parser=ID,zD.parser=ID.parse,zD.Renderer=PD,zD.TextRenderer=FD,zD.Lexer=ND,zD.lexer=ND.lex,zD.Tokenizer=MD,zD.Hooks=LD,zD.parse=zD,zD.options,zD.setOptions,zD.walkTokens,zD.parseInline,ID.parse,ND.lex;function VD(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var HD=VD();(HD!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`)&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var UD=e=>HD?.can.includes(e)===!0;function WD(e,t){return HD&&UD(e)?HD.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function GD(e,t){UD(e)&&WD(e,t).catch(()=>void 0)}function KD(e,t,n){return UD(`download`)?(e.preventDefault(),WD(`download`,{url:new URL(t,window.location.href).href,filename:n}).catch(()=>void 0),!0):!1}var qD=typeof window<`u`&&window.matchMedia?.(`(pointer: coarse)`).matches===!0,JD=typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia;function YD(){(0,y.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=document.documentElement,n=()=>{let n=e.scale>1.01?0:window.innerHeight-e.height-e.offsetTop,r=n>80;t.style.setProperty(`--kb`,r?`${Math.round(n)}px`:`0px`),t.classList.toggle(`keyboard-open`,r)};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n),t.style.removeProperty(`--kb`),t.classList.remove(`keyboard-open`)}},[])}function XD(e){let[t,n]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(e&&UD(`keepAwake`))return GD(`keepAwake`,!0),n(!0),()=>{GD(`keepAwake`,!1),n(!1)};if(!e||!(`wakeLock`in navigator))return;let t=null,r=!1,i=async()=>{if(!(r||t||document.visibilityState!==`visible`))try{let e=await navigator.wakeLock.request(`screen`);if(r){e.release().catch(()=>void 0);return}t=e,n(!0),e.addEventListener(`release`,()=>{t===e&&(t=null,n(!1))})}catch{}};return i(),document.addEventListener(`visibilitychange`,i),()=>{r=!0,document.removeEventListener(`visibilitychange`,i),t?.release().catch(()=>void 0),t=null,n(!1)}},[e]),t}var ZD=`wz.notify`,QD=new Set,$D=null;function eO(){try{return localStorage.getItem(ZD)===`1`}catch{return!1}}function tO(e){try{e?localStorage.setItem(ZD,`1`):localStorage.removeItem(ZD)}catch{}for(let e of QD)e()}var nO=typeof window<`u`&&`Notification`in window,rO=null;function iO(){return eO()?UD(`notify`)?rO===!1?`quiet`:`on`:nO&&Notification.permission===`granted`?`on`:`quiet`:`off`}function aO(){return(0,y.useSyncExternalStore)(e=>(QD.add(e),()=>QD.delete(e)),iO,()=>`off`)}function oO(){return UD(`notify`)?rO===!1:nO&&Notification.permission===`denied`}async function sO(){if(tO(!0),UD(`notify`)){rO=!UD(`notifyPermission`)||await WD(`notifyPermission`).catch(()=>!1);for(let e of QD)e();return iO()}try{$D??=new AudioContext,$D.resume()}catch{$D=null}if(nO&&Notification.permission==="default")try{await Notification.requestPermission()}catch{}nO&&Notification.permission===`granted`&&await navigator.serviceWorker?.register(`${sS}/sw.js`).catch(()=>void 0);for(let e of QD)e();return iO()}function cO(){tO(!1)}function lO(){let e=$D;if(e?.state!==`running`)return;let t=e.currentTime;for(let[n,r]of[660,880].entries()){let i=e.createOscillator(),a=e.createGain();i.frequency.value=r,a.gain.setValueAtTime(0,t+n*.16),a.gain.linearRampToValueAtTime(.18,t+n*.16+.02),a.gain.exponentialRampToValueAtTime(.001,t+n*.16+.32),i.connect(a).connect(e.destination),i.start(t+n*.16),i.stop(t+n*.16+.34)}}async function uO(e){if(!eO())return;if(UD(`notify`)){GD(`notify`,e);return}if(document.visibilityState===`visible`){lO(),navigator.vibrate?.([120,60,120]);return}if(!nO||Notification.permission!==`granted`)return;let t={body:e.body,tag:e.tag,icon:dS(`icons/icon-192.png`),badge:dS(`icons/icon-192.png`),data:{url:location.href}};try{let n=await navigator.serviceWorker?.getRegistration();if(n?.active){await n.showNotification(e.title,t);return}}catch{}try{new Notification(e.title,t)}catch{}}function dO(){if(typeof navigator>`u`||!navigator.canShare)return!1;try{return navigator.canShare({files:[new File([`x`],`x.pdf`,{type:`application/pdf`})]})}catch{return!1}}var fO=e=>e==null?``:typeof e==`object`?JSON.stringify(e):String(e),pO=e=>{let t=typeof e==`number`?e:Number(String(e??``).replace(`,`,`.`));return Number.isFinite(t)?t:0};function mO(e,t){let n=fO(e);return n?/^(https?:|data:|\/)/.test(n)?n:t(n):null}function hO(e,t,n,r){return Yl(e[t],n.data,r)}function gO(e,t,n){let r=fO(t)||`label`,i=fO(n)||`value`;return Array.isArray(e)?e.map(e=>({label:fO(e?.[r]),value:pO(e?.[i])})):[]}function _O({c:e,ctx:t,row:n}){let r=e.children;if(!r)return null;if(Array.isArray(r))return(0,X.jsx)(X.Fragment,{children:r.map(e=>(0,X.jsx)(wO,{id:e,ctx:t,row:n},e))});let i=Yl({path:r.path},t.data,n);return(0,X.jsx)(X.Fragment,{children:(Array.isArray(i)?i:[]).map((e,n)=>(0,X.jsx)(wO,{id:r.componentId,ctx:t,row:e},n))})}var vO={success:`bg-moss-tint text-moss`,warning:`bg-amber-tint text-ink-2`,default:`bg-paper-2 text-ink-2`};function yO({data:e}){let t=Math.max(1,...e.map(e=>e.value));return(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map((e,n)=>(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,8rem)_1fr_auto] items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-[0.8125rem] text-ink-2`,children:e.label}),(0,X.jsx)(`span`,{className:`h-2.5 rounded-full bg-paper-2`,children:(0,X.jsx)(`span`,{className:`block h-full rounded-full bg-ember`,style:{width:`${e.value/t*100}%`}})}),(0,X.jsx)(`span`,{className:`text-[0.8125rem] tabular-nums`,children:e.value.toLocaleString()})]},n))})}function bO({data:e}){if(e.length<2)return(0,X.jsx)(yO,{data:e});let t=Math.max(...e.map(e=>e.value)),n=Math.min(...e.map(e=>e.value)),r=t-n||1,i=e.map((t,i)=>[i/(e.length-1)*312+4,116-(t.value-n)/r*112]);return(0,X.jsxs)(`figure`,{children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 320 120`,className:`w-full text-ember`,role:`img`,children:[(0,X.jsx)(`polyline`,{points:i.map(([e,t])=>`${e},${t}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinejoin:`round`}),i.map(([t,n],r)=>(0,X.jsx)(`circle`,{cx:t,cy:n,r:`3`,fill:`currentColor`,children:(0,X.jsx)(`title`,{children:`${e[r].label}: ${e[r].value}`})},r))]}),(0,X.jsxs)(`figcaption`,{className:`mt-1 flex justify-between text-[0.75rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:e[0].label}),(0,X.jsx)(`span`,{children:e.at(-1)?.label})]})]})}var xO=[`var(--color-ember)`,`var(--color-cobalt)`,`var(--color-moss)`,`var(--color-amber)`,`var(--color-ink-3)`];function SO({data:e}){let t=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,n=0,r=2*Math.PI*40;return(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,X.jsx)(`svg`,{viewBox:`0 0 100 100`,className:`size-28 shrink-0 -rotate-90`,role:`img`,children:e.map((e,i)=>{let a=Math.max(0,e.value)/t*r,o=(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:40,fill:`none`,stroke:xO[i%xO.length],strokeWidth:`16`,strokeDasharray:`${a} ${r-a}`,strokeDashoffset:-n,children:(0,X.jsx)(`title`,{children:`${e.label}: ${e.value}`})},i);return n+=a,o})}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-1 text-[0.8125rem]`,children:e.map((e,t)=>(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`size-2.5 rounded-full`,style:{background:xO[t%xO.length]}}),(0,X.jsx)(`span`,{className:`text-ink-2`,children:e.label}),(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.value.toLocaleString()})]},t))})]})}function CO({title:e,children:t}){return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-4 ring-1 ring-border-soft`,children:[e?(0,X.jsx)(`div`,{className:`mb-3 font-medium text-[0.875rem]`,children:e}):null,t]})}function wO({id:e,ctx:t,row:n}){let r=t.byId.get(e);if(!r)return null;let i=e=>hO(r,e,t,n);switch(r.component){case`Column`:return(0,X.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,X.jsx)(_O,{c:r,ctx:t,row:n})});case`Text`:{let e=fO(i(`variant`))||`body`;return(0,X.jsx)(`p`,{className:Q(e===`h3`&&`font-display font-semibold text-[1.25rem] leading-tight`,e===`h4`&&`font-semibold text-[1rem]`,e===`body`&&`text-[0.9375rem] leading-relaxed`,e===`muted`&&`text-[0.8125rem] text-ink-3`),children:fO(i(`text`))})}case`List`:return(0,X.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft`,children:(0,X.jsx)(_O,{c:r,ctx:t,row:n})});case`Row`:{let e=mO(i(`image`),t.assetUrl),n=fO(i(`badge`));return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[e?(0,X.jsx)(`img`,{src:e,alt:``,className:`size-10 shrink-0 rounded-lg object-cover`}):null,(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate text-[0.9375rem]`,children:fO(i(`title`))}),i(`subtitle`)?(0,X.jsx)(`div`,{className:`truncate text-[0.8125rem] text-ink-3`,children:fO(i(`subtitle`))}):null]}),i(`meta`)?(0,X.jsx)(`span`,{className:`shrink-0 text-[0.8125rem] text-ink-3 tabular-nums`,children:fO(i(`meta`))}):null,n?(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]`,vO.default),children:n}):null]})}case`DetailGrid`:{let e=i(`rows`);return(0,X.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 rounded-xl bg-card p-4 text-[0.875rem] ring-1 ring-border-soft`,children:(Array.isArray(e)?e:[]).map((e,r)=>(0,X.jsxs)(`div`,{className:`contents`,children:[(0,X.jsx)(`dt`,{className:`text-ink-3`,children:fO(Yl(e?.label,t.data,n))}),(0,X.jsx)(`dd`,{className:`break-words`,children:fO(Yl(e?.value,t.data,n))})]},r))})}case`Badge`:return(0,X.jsx)(`span`,{className:Q(`inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]`,vO[fO(i(`tone`))]??vO.default),children:fO(i(`label`))});case`Grid`:{let e=Math.min(4,Math.max(1,pO(i(`columns`))||2));return(0,X.jsx)(`div`,{className:`grid gap-3`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(min(100%, ${e>2?9:12}rem), 1fr))`},children:(0,X.jsx)(_O,{c:r,ctx:t,row:n})})}case`Metric`:return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-4 ring-1 ring-border-soft`,children:[(0,X.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:fO(i(`label`))}),(0,X.jsx)(`div`,{className:`mt-1 font-display font-semibold text-[1.5rem] tabular-nums`,children:fO(i(`value`))}),i(`caption`)?(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:fO(i(`caption`))}):null]});case`Table`:{let e=i(`rows`),t=Array.isArray(e)?e:[],n=i(`columns`),r=Array.isArray(n)?n.map(e=>({key:fO(e?.key),label:fO(e?.label??e?.key)})):[...new Set(t.flatMap(e=>Object.keys(e??{})))].map(e=>({key:e,label:e}));return(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-xl ring-1 ring-border-soft`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsx)(`tr`,{children:r.map(e=>(0,X.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e.label},e.key))})}),(0,X.jsx)(`tbody`,{children:t.map((e,t)=>(0,X.jsx)(`tr`,{className:`border-border-soft border-t`,children:r.map(t=>(0,X.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:fO(e?.[t.key])},t.key))},t))})]})})}case`Image`:{let e=mO(i(`src`),t.assetUrl);return e?(0,X.jsx)(`img`,{src:e,alt:fO(i(`alt`)),className:`w-full rounded-xl`}):null}case`BarChart`:return(0,X.jsx)(CO,{title:fO(i(`title`)),children:(0,X.jsx)(yO,{data:gO(i(`points`),i(`labelKey`),i(`valueKey`))})});case`LineChart`:return(0,X.jsx)(CO,{title:fO(i(`title`)),children:(0,X.jsx)(bO,{data:gO(i(`points`),i(`labelKey`),i(`valueKey`))})});case`DonutChart`:return(0,X.jsx)(CO,{title:fO(i(`title`)),children:(0,X.jsx)(SO,{data:gO(i(`slices`),i(`labelKey`),i(`valueKey`))})});case`Actions`:return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,X.jsx)(_O,{c:r,ctx:t,row:n})});case`Button`:{let e=fO(i(`action`));return!t.onAction&&e!==`open`?null:(0,X.jsx)(`button`,{type:`button`,onClick:()=>{let n=i(`target`);if(e===`open`){let e=mO(n,t.assetUrl);e&&window.open(e,`_blank`,`noopener`);return}t.onAction?.({action:e,target:n})},className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-4 text-[0.875rem] text-ink-2 hover:text-ink coarse:h-11`,children:fO(i(`label`))})}}return null}function TO({surface:e,assetUrl:t,onAction:n}){let r={byId:new Map(e.components.map(e=>[e.id,e])),data:e.data,assetUrl:t,onAction:n};return(0,X.jsx)(wO,{id:`root`,ctx:r})}function EO({text:e,className:t}){let n=(0,y.useMemo)(()=>JT.sanitize(zD.parse(e,{async:!1})),[e]);return(0,X.jsx)(`div`,{className:Q(`prose-zen`,t),dangerouslySetInnerHTML:{__html:n}})}function DO({src:e,page:t,height:n,fit:r}){let i=(0,y.useRef)(null),[a,o]=(0,y.useState)(0);(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.clientWidth));return t.observe(e),o(e.clientWidth),()=>t.disconnect()},[]);let[s,c]=(0,y.useState)(null);(0,y.useEffect)(()=>{let t=!0;return fetch(e,{credentials:`include`}).then(e=>e.ok?e.text():``).then(n=>t&&c({src:e,text:n})),()=>{t=!1}},[e]);let l=t??Math.max(a,900),u=a?r?a/l:Math.min(1,a/l):1;return(0,X.jsxs)(`div`,{ref:i,className:`relative overflow-hidden rounded-lg bg-white ring-1 ring-border-soft`,style:{height:n*u},children:[s?.src===e?(0,X.jsx)(`iframe`,{title:`preview`,srcDoc:s.text,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:l,height:n,transform:`scale(${u})`}},e):(0,X.jsx)(`div`,{className:`absolute inset-0 animate-pulse bg-paper-2`}),(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`absolute top-3 right-3 inline-flex size-9 items-center justify-center rounded-full bg-card/90 text-ink-2 shadow-soft ring-1 ring-border-soft backdrop-blur hover:text-ink coarse:size-11`,"aria-label":Z(`run.openFull`),children:(0,X.jsx)(zy,{className:`size-4`})})]})}var OO={disc:{file:`ai`,box:566.93,x:89.28,y:100.72,w:365.49,h:365.49},generated:{file:`ai-generated`,box:1789.84,x:207.3,y:144.36,w:1384.24,h:266.41},edited:{file:`ai-modified`,box:1700.79,x:231.11,y:144.36,w:1230.56,h:266.41}};function kO({icon:e,tone:t,size:n,className:r}){let i=OO[e],a=n/i.h;return(0,X.jsx)(`img`,{src:dS(`ai-labels/${i.file}-${t}.svg`),alt:``,draggable:!1,className:Q(`pointer-events-none absolute max-w-none select-none`,r),style:{width:i.box*a,height:566.93*a,left:-i.x*a,top:-i.y*a}})}function AO({ai:e,className:t}){let[n,r]=(0,y.useState)(!1);if(!e)return null;let i=OO[e],a=t===`static`,o=a?[[`black`,`dark:hidden`],[`white`,`hidden dark:block`]]:[[`white`,``]];return(0,X.jsx)(`button`,{type:`button`,"aria-label":Z(e===`edited`?`ai.modified`:`ai.generated`),"aria-expanded":n,"data-open":n,onClick:()=>r(e=>!e),className:Q(`group block cursor-default overflow-hidden rounded-full backdrop-blur-md transition-[width] duration-200`,`w-[var(--ai-disc)] hover:w-[var(--ai-long)] focus-visible:w-[var(--ai-long)] data-[open=true]:w-[var(--ai-long)]`,a?`relative`:Q(`absolute shadow-[0_1px_3px_rgba(0,0,0,0.25)]`,t??`bottom-2 left-2`)),style:{height:18,"--ai-disc":`18px`,"--ai-long":`${i.w/i.h*18}px`},children:o.map(([t,r])=>(0,X.jsxs)(`span`,{className:r,children:[(0,X.jsx)(kO,{icon:`disc`,tone:t,size:18,className:Q(`transition-opacity duration-200`,n?`opacity-0`:`opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0`)}),(0,X.jsx)(kO,{icon:e,tone:t,size:18,className:Q(`transition-opacity duration-200`,n?`opacity-100`:`opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`)})]},t))})}function jO(e,t){return e.type===`agent`?e.output.fields?.find(e=>e.id===t)?.description??t:t}function MO({step:e,json:t}){return!t||typeof t!=`object`?(0,X.jsx)(`pre`,{className:`text-[0.8125rem]`,children:JSON.stringify(t,null,2)}):(0,X.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(t).map(([t,n])=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-1 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:jO(e,t)}),typeof n==`boolean`?(0,X.jsx)(`div`,{className:`text-[0.9375rem]`,children:Z(n?`run.yes`:`run.no`)}):typeof n==`string`||typeof n==`number`?(0,X.jsx)(`div`,{className:`whitespace-pre-wrap text-[0.9375rem]`,children:String(n)}):Array.isArray(n)&&n.every(e=>typeof e!=`object`)?(0,X.jsx)(`ul`,{className:`list-disc pl-5 text-[0.875rem]`,children:n.map((e,t)=>(0,X.jsx)(`li`,{className:`break-words`,children:String(e)},t))}):Array.isArray(n)&&n.length&&typeof n[0]==`object`?(0,X.jsx)(NO,{rows:n}):(0,X.jsx)(`pre`,{className:`overflow-auto rounded-lg bg-paper-2 p-3 text-[0.75rem]`,children:JSON.stringify(n,null,2)})]},t))})}function NO({rows:e}){let t=[...new Set(e.flatMap(e=>Object.keys(e)))];return(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-lg ring-1 ring-border-soft`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsx)(`tr`,{children:t.map(e=>(0,X.jsx)(`th`,{className:`px-3 py-2 text-left font-medium`,children:e},e))})}),(0,X.jsx)(`tbody`,{children:e.map((e,n)=>(0,X.jsx)(`tr`,{className:`border-border-soft border-t`,children:t.map(t=>(0,X.jsx)(`td`,{className:`px-3 py-2 tabular-nums`,children:e[t]===null||e[t]===void 0?``:String(e[t])},t))},n))})]})})}function PO({text:e}){let[t,n]=(0,y.useState)(!1);return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4`,children:[t?(0,X.jsx)(Lv,{className:`size-3.5`}):(0,X.jsx)(Uv,{className:`size-3.5`}),Z(t?`share.copied`:`run.copy`)]})}function FO({base:e,step:t,output:n,editable:r,draft:i,onDraft:a,picked:o,onPick:s,onSurfaceAction:c}){if(!n)return null;let l=t=>uS(`${e}/assets/${t}`);if(n.surface)return(0,X.jsx)(TO,{surface:n.surface,assetUrl:l,onAction:c});if(t.type===`widget`||t.type===`film`){let e=n.assets?.find(e=>e.kind===`video`);if(e){let r=n.assets?.find(e=>e.kind===`poster`),i=t.type===`film`?t.format===`9:16`:(t.size?.height??0)>(t.size?.width??1);return(0,X.jsxs)(`div`,{className:Q(`relative mx-auto`,i?`w-fit`:`w-full`),children:[(0,X.jsx)(`video`,{src:l(e.id),poster:r?l(r.id):void 0,controls:!0,playsInline:!0,className:Q(`rounded-lg bg-black ring-1 ring-border-soft`,i?`max-h-[76vh]`:`w-full`)}),(0,X.jsx)(AO,{ai:e.ai,className:`top-2 right-2`})]})}if(t.type===`film`)return null;let r=n.assets?.find(e=>e.mime===`text/html`),i=t.size??{width:1280,height:720};return r?(0,X.jsx)(DO,{src:l(r.id),page:i.width,height:i.height,fit:!0}):null}if(t.type===`generate`){let e=n.assets?.[0];if(!e)return null;if(t.asset===`voice`)return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`audio`,{src:l(e.id),controls:!0,className:`w-full`}),(0,X.jsx)(AO,{ai:e.ai,className:`static`}),n.text?(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-2 leading-relaxed`,children:n.text}):null]});if((n.assets?.length??0)>1&&(t.asset===`image`||t.asset===`video`)){let e=t.options?.aspectRatio===`9:16`||t.options?.aspectRatio===`2:3`;return(0,X.jsx)(`div`,{className:Q(`grid gap-3`,e?`grid-cols-2 sm:grid-cols-3`:`sm:grid-cols-2`),children:n.assets?.map((e,n)=>{let r=o?.includes(n);return(0,X.jsxs)(`figure`,{className:Q(`relative overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,r&&`ring-2 ring-ember`),children:[t.asset===`image`?(0,X.jsx)(`img`,{src:l(e.id),alt:`${t.title} ${n+1}`,className:`w-full`}):(0,X.jsx)(`video`,{src:l(e.id),controls:!0,playsInline:!0,loop:!0,className:`w-full`}),s?(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>s(n),className:Q(`absolute top-2 left-2 inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.75rem] shadow-soft backdrop-blur coarse:h-11`,r?`bg-ember text-ember-on`:`bg-card/90 text-ink-2 hover:text-ink`),children:[r?(0,X.jsx)(Lv,{className:`size-3.5`}):null,Z(r?`run.pickedItem`:`run.pickItem`,{n:n+1})]}):(0,X.jsx)(`span`,{className:`absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2`,children:n+1}),(0,X.jsx)(AO,{ai:e.ai,className:t.asset===`image`?`bottom-2 left-2`:`top-2 right-2`})]},e.id)})})}if(t.asset===`image`)return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:l(e.id),alt:t.title,className:`w-full rounded-lg bg-paper-2 ring-1 ring-border-soft`}),(0,X.jsx)(AO,{ai:e.ai})]});if(t.asset===`video`){let n=t.options?.aspectRatio===`9:16`;return(0,X.jsxs)(`div`,{className:Q(`relative mx-auto`,n?`w-fit`:`w-full`),children:[(0,X.jsx)(`video`,{src:l(e.id),controls:!0,playsInline:!0,loop:!0,className:Q(`rounded-lg bg-black ring-1 ring-border-soft`,n?`max-h-[70vh]`:`w-full`)}),(0,X.jsx)(AO,{ai:e.ai,className:`top-2 left-2`})]})}return t.asset===`document`?(0,X.jsx)(DO,{src:l(e.id),page:820,height:1100}):(0,X.jsx)(DO,{src:l(e.id),page:null,height:760})}if(t.type===`agent`){let e=n.assets?.filter(e=>e.kind!==`file`&&e.mime.startsWith(`image/`))??[],o=n.assets?.filter(e=>e.kind===`file`)??[];return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t.output.format===`json`&&n.json!==void 0?(0,X.jsx)(MO,{step:t,json:n.json}):r?(0,X.jsx)(wS,{value:i??n.text??``,onChange:e=>a?.(e.target.value),minRows:4,maxRows:24}):t.output.format===`markdown`?(0,X.jsx)(EO,{text:n.text??``}):(0,X.jsx)(`div`,{className:`whitespace-pre-wrap text-[1rem] leading-relaxed`,children:n.text}),e.map(e=>(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`img`,{src:l(e.id),alt:``,className:`w-full rounded-lg ring-1 ring-border-soft`}),(0,X.jsx)(AO,{ai:e.ai})]},e.id)),o.length?(0,X.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:o.map(e=>(0,X.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,X.jsxs)(`a`,{href:l(e.id),download:e.name,onClick:t=>KD(t,l(e.id),e.name),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,X.jsx)(ay,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]})},e.id))}):null,t.output.format!==`json`&&!r&&n.text?(0,X.jsx)(`div`,{children:(0,X.jsx)(PO,{text:n.text})}):null]})}return null}var IO={png:`PNG`,mp4:`MP4`,mp3:`MP3`,pdf:`PDF`,docx:`Word`,html:`HTML`,md:`Markdown`,txt:`Text`,csv:`CSV`,xlsx:`Excel`,json:`JSON`,zip:`ZIP`};function LO(e,t){return(e.headers.get(`content-disposition`)??``).match(/filename="([^"]+)"/)?.[1]??t}function RO({url:e,format:t,title:n}){let[r,i]=(0,y.useState)(`idle`),a=(0,y.useRef)(null),o=async()=>{if(UD(`share`)){i(`busy`),await WD(`share`,{url:new URL(e,location.href).href,title:n}).catch(()=>void 0),i(`idle`);return}try{if(!a.current){i(`busy`);let n=await fetch(e,{credentials:`include`});if(!n.ok)throw Error(String(n.status));let r=await n.blob();a.current=new File([r],LO(n,`download.${t}`),{type:r.type.split(`;`)[0]})}let r={files:[a.current],title:n};if(!navigator.canShare(r)){location.href=e,i(`idle`);return}await navigator.share(r),i(`idle`)}catch(e){i(a.current&&e.name===`NotAllowedError`?`ready`:`idle`)}};return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void o(),disabled:r===`busy`,"aria-label":Z(`run.shareFile`),title:Z(`run.shareFile`),className:Q(`inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,r===`ready`?`bg-ember-tint text-ink ring-1 ring-ember`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[r===`busy`?(0,X.jsx)(kS,{className:`size-3.5`}):(0,X.jsx)(pb,{className:`size-3.5`}),Z(r===`ready`?`run.shareNow`:`run.share`)]})}var zO=UD(`share`)||dO();function BO({base:e,stepId:t,formats:n,title:r}){let i=n=>uS(`${e}/steps/${t}/download?format=${n}`);return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n.map((e,t)=>(0,X.jsxs)(`a`,{href:i(e),onClick:t=>KD(t,i(e)),className:Q(`inline-flex h-9 items-center gap-1.5 rounded-full px-3.5 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4`,t===0?`bg-primary text-primary-foreground hover:brightness-105`:`bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink`),children:[t===0?(0,X.jsx)(Yv,{className:`size-3.5`}):null,IO[e]]},e)),zO&&n.length?(0,X.jsx)(RO,{url:i(n[0]),format:n[0],title:r},i(n[0])):null]})}function VO(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:Z(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var HO={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function UO({runId:e,title:t,initial:n}){let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(n),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),p=async()=>{if(i(!0),!a){c(!0),f(null);try{o(await hS.post(`/api/runs/${e}/share`))}catch(e){f(e.message)}finally{c(!1)}}},m=async()=>{await hS.del(`/api/runs/${e}/share`),o(null),i(!1)},h=()=>{a&&(navigator.clipboard.writeText(a.url),u(!0),setTimeout(()=>u(!1),1500))},g=UD(`share`)||typeof navigator<`u`&&`share`in navigator,_=a?.expiresAt?new Intl.DateTimeFormat(Kx,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(vS,{variant:`secondary`,onClick:()=>void p(),children:[(0,X.jsx)(db,{className:`size-4`}),` `,Z(`shareRun.button`)]}),(0,X.jsx)(MS,{open:r,onClose:()=>i(!1),title:Z(`shareRun.title`),children:s?(0,X.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,X.jsx)(kS,{})}):d?(0,X.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:d}):a?(0,X.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,X.jsx)(Dy,{className:`size-4 shrink-0 text-ink-3`}),(0,X.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":Z(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,X.jsxs)(vS,{size:`sm`,onClick:h,children:[l?(0,X.jsx)(Lv,{className:`size-3.5`}):(0,X.jsx)(Uv,{className:`size-3.5`}),Z(l?`share.copied`:`share.copy`)]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[VO(a.url,t).map(e=>(0,X.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,X.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,X.jsx)(Fy,{className:`size-5`}):HO[e.id]}),e.label]},e.id)),g?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void(UD(`share`)?WD(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,X.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,X.jsx)(db,{className:`size-5`})}),Z(`shareRun.more`)]}):null]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:_?Z(`shareRun.until`,{date:_}):Z(`shareRun.kept`)}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>void m(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:Z(`shareRun.withdraw`)})]})]}):null})]})}function WO({runId:e,ask:t}){return t.kind===`confirm`?(0,X.jsx)(GO,{runId:e,ask:t}):(0,X.jsx)(KO,{runId:e,ask:t})}function GO({runId:e,ask:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=async n=>{a(!0),s(null);try{await hS.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){s(e.message),a(!1)}},l=t.action.destructive?Tb:Zy;return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:Q(`flex size-10 shrink-0 items-center justify-center rounded-full`,t.action.destructive?`bg-rose-tint text-rose`:`bg-ember-tint text-ember-strong`),children:(0,X.jsx)(l,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`ask.wants`,{service:t.service})}),(0,X.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason})]})]}),(0,X.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[0.8125rem] leading-relaxed ring-1 ring-border-soft`,children:t.input}),(0,X.jsxs)(`div`,{className:`mt-5 flex items-center gap-4`,children:[(0,X.jsx)(DS,{checked:n,onChange:r,label:Z(`ask.allowRest`)}),(0,X.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Z(`ask.allowRest`)})]}),o?(0,X.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:o}):null,(0,X.jsxs)(`div`,{className:`action-bar mt-6 flex items-center justify-between gap-3`,children:[(0,X.jsx)(vS,{variant:`ghost`,disabled:i,onClick:()=>void c({type:`skip`}),children:Z(`ask.deny`)}),(0,X.jsx)(vS,{busy:i,onClick:()=>void c({type:`done`,remember:n}),children:Z(`ask.allow`)})]})]})}function KO({runId:e,ask:t}){let[n,r]=(0,y.useState)({}),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=(0,y.useCallback)(()=>d(e=>e+1),[]);(0,y.useEffect)(()=>{let e=setInterval(_,2500);return()=>clearInterval(e)},[_]);let v=async n=>{s(!0),l(null);try{await hS.post(`/api/runs/${e}/ask/${t.id}`,n)}catch(e){l(e.message),s(!1)}},b=async t=>{l(null);try{await hS.post(`/api/runs/${e}/browser/act`,t)}catch(e){l(e.message)}_()},x=e=>{let t=g.current;if(!t?.naturalWidth)return;let n=t.getBoundingClientRect();b({type:`click`,x:Math.round((e.clientX-n.left)/n.width*t.naturalWidth),y:Math.round((e.clientY-n.top)/n.height*t.naturalHeight)})},S=t.fields.some(e=>n[e.id]);return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-5 flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-ember-tint text-ember-strong`,children:(0,X.jsx)(Ny,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`font-display font-semibold text-[1.25rem] leading-snug tracking-tight`,children:t.reason}),(0,X.jsxs)(`p`,{className:`mt-0.5 truncate text-[0.8125rem] text-ink-3`,children:[t.site.host,t.site.title?` · ${t.site.title}`:``]})]})]}),(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-paper-2 ring-1 ring-border-soft`,children:[(0,X.jsx)(`img`,{ref:g,src:uS(`/api/runs/${e}/browser/screen?t=${u}`),alt:t.site.host,onClick:x,className:`block w-full cursor-pointer`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-border-soft border-t bg-card p-2`,children:[(0,X.jsx)(SS,{type:m?`password`:`text`,autoComplete:`off`,value:f,placeholder:Z(`ask.typeInto`),onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b({type:`type`,text:f}).then(()=>p(``)))},autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`send`,className:`h-9 min-w-[9rem] flex-1 basis-full text-[0.8125rem] sm:basis-0 coarse:h-11`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:Q(`h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5`,m?`bg-ember-veil text-ink`:`text-ink-3 hover:bg-paper-2`),children:Z(`ask.hide`)}),(0,X.jsx)(qO,{label:`Enter`,onClick:()=>void b({type:`key`,key:`Enter`}),children:(0,X.jsx)(Gv,{className:`size-4`})}),(0,X.jsx)(qO,{label:Z(`ask.up`),onClick:()=>void b({type:`scroll`,dy:-500}),children:(0,X.jsx)(Dv,{className:`size-4`})}),(0,X.jsx)(qO,{label:Z(`ask.down`),onClick:()=>void b({type:`scroll`,dy:500}),children:(0,X.jsx)(xv,{className:`size-4`})})]})]}),(0,X.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-4`,children:Z(`ask.pictureHint`)}),t.fields.length?(0,X.jsxs)(`form`,{className:`mt-5 flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),v({type:`fill`,values:n,remember:i})},children:[t.fields.map((e,i)=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(OS,{children:e.label}),(0,X.jsx)(SS,{autoFocus:i===0,type:e.secret?`password`:`text`,autoComplete:`off`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:i===t.fields.length-1?`go`:`next`,value:n[e.id]??``,onChange:t=>r(n=>({...n,[e.id]:t.target.value}))})]},e.id)),(0,X.jsx)(`button`,{type:`submit`,hidden:!0})]}):null,(0,X.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-4`,children:[(0,X.jsx)(DS,{checked:i,onChange:a,label:Z(`ask.remember`)}),(0,X.jsx)(`span`,{className:`flex-1 text-[0.8125rem] text-ink-2`,children:Z(`ask.remember`)})]}),(0,X.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(hb,{className:`mt-0.5 size-4 shrink-0 text-moss`}),` `,Z(`ask.private`)]}),c?(0,X.jsx)(`div`,{className:`mt-3 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:c}):null,(0,X.jsxs)(`div`,{className:`action-bar mt-6 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(vS,{variant:`ghost`,disabled:o,onClick:()=>void v({type:`skip`}),children:Z(`ask.skip`)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.fields.length?(0,X.jsx)(vS,{variant:`secondary`,disabled:o,onClick:()=>void v({type:`done`,remember:i}),children:Z(`ask.done`)}):null,t.fields.length?(0,X.jsx)(vS,{busy:o,disabled:!S,onClick:()=>void v({type:`fill`,values:n,remember:i}),children:Z(`ask.signIn`)}):(0,X.jsx)(vS,{busy:o,onClick:()=>void v({type:`done`,remember:i}),children:Z(`ask.done`)})]})]})]})}function qO({label:e,onClick:t,children:n}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:t,className:`flex size-9 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-paper-2 hover:text-ink coarse:size-11`,children:n})}async function JO(e,t=2400){if(!/^image\/(jpeg|png|webp)$/.test(e.type)||e.size<12e5)return e;try{let n=await createImageBitmap(e),r=Math.min(1,t/Math.max(n.width,n.height)),i=document.createElement(`canvas`);i.width=Math.round(n.width*r),i.height=Math.round(n.height*r),i.getContext(`2d`)?.drawImage(n,0,0,i.width,i.height);let a=await new Promise(e=>i.toBlob(e,`image/jpeg`,.86));return a&&a.size<e.size?new File([a],`${e.name.replace(/\.[^.]+$/,``)}.jpg`,{type:`image/jpeg`}):e}catch{return e}}function YO(){return new Date().toISOString().slice(0,19).replace(/[:T]/g,`-`)}function XO(e){let t=e?.name;return t===`NotFoundError`||t===`OverconstrainedError`?`missing`:t===`NotReadableError`||t===`AbortError`?`busy`:`denied`}function ZO(e){return!!e?.getCapabilities?.()?.torch}function QO(e,t,n=!1){let r=(0,y.useRef)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null),[c,l]=(0,y.useState)(1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{if(!e)return;let r=null,i=!1;s(null),a(null),d(!1),p(!1);let o={facingMode:{ideal:t},width:{ideal:2560},height:{ideal:1440}};return(async()=>{if(!navigator.mediaDevices?.getUserMedia)throw new DOMException(`no camera api`,`NotAllowedError`);try{r=await navigator.mediaDevices.getUserMedia({video:o,audio:n})}catch(e){if(!n)throw e;r=await navigator.mediaDevices.getUserMedia({video:o})}if(i){for(let e of r.getTracks())e.stop();return}a(r);let e=r.getVideoTracks()[0],t=()=>!i&&d(ZO(e));t(),setTimeout(t,600);let s=await navigator.mediaDevices.enumerateDevices().catch(()=>[]);i||l(s.filter(e=>e.kind===`videoinput`).length)})().catch(e=>!i&&s(XO(e))),()=>{i=!0;for(let e of r?.getTracks()??[])e.stop()}},[e,t,n]),(0,y.useEffect)(()=>{r.current&&i&&(r.current.srcObject=i)},[i]),{video:r,stream:i,error:o,cameras:c,torchable:u,torch:f,setTorch:async e=>{let t=i?.getVideoTracks()[0];try{await t?.applyConstraints({advanced:[{torch:e}]}),p(e)}catch{d(!1)}},mirrored:i?.getVideoTracks()[0]?.getSettings().facingMode===`user`}}function $O({open:e,onClose:t,label:n,children:r}){let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=i.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,X.jsx)(`dialog`,{ref:i,onClose:t,"aria-label":n,className:`media-sheet`,children:e?(0,X.jsx)(`div`,{className:`flex h-full flex-col`,children:r}):null})}function ek({label:e,onClick:t,active:n,children:r}){return(0,X.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":n,onClick:t,className:Q(`flex size-11 shrink-0 items-center justify-center rounded-full transition`,n?`bg-white text-black`:`bg-white/12 text-white hover:bg-white/20`),children:r})}function tk({title:e,onClose:t,camera:n,onFlip:r}){return(0,X.jsx)(`div`,{className:`safe-top`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,X.jsx)(ek,{label:Z(`common.close`),onClick:t,children:(0,X.jsx)(Lb,{className:`size-5`})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]`,children:e}),n.torchable?(0,X.jsx)(ek,{label:Z(`camera.torch`),active:n.torch,onClick:()=>void n.setTorch(!n.torch),children:n.torch?(0,X.jsx)(py,{className:`size-5`}):(0,X.jsx)(dy,{className:`size-5`})}):null,n.stream&&(n.cameras>1||qD)?(0,X.jsx)(ek,{label:Z(`camera.flip`),onClick:r,children:(0,X.jsx)(xb,{className:`size-5`})}):(0,X.jsx)(`span`,{className:`size-11`})]})})}function nk({camera:e,asking:t,children:n,actions:r}){return(0,X.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[(0,X.jsx)(`video`,{ref:e.video,autoPlay:!0,playsInline:!0,muted:!0,className:Q(`absolute inset-0 size-full object-contain`,e.mirrored&&`-scale-x-100`)}),e.error?(0,X.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-5 bg-black px-8 text-center`,children:[(0,X.jsx)(`p`,{className:`max-w-sm text-[0.9375rem] text-white/85 leading-relaxed`,children:Z(`camera.${e.error}`)}),r]}):e.stream?n:(0,X.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75`,children:[(0,X.jsx)(kS,{}),(0,X.jsx)(`p`,{className:`max-w-xs text-[0.875rem] leading-relaxed`,children:t})]})]})}var rk=30;function ik(){if(typeof MediaRecorder<`u`)return[`video/mp4;codecs=avc1.42E01E,mp4a.40.2`,`video/mp4`,`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`].find(e=>MediaRecorder.isTypeSupported(e))}var ak=!!ik();function ok({open:e,multiple:t,video:n,onClose:r,onCapture:i,onNative:a}){let[o,s]=(0,y.useState)(`environment`),[c,l]=(0,y.useState)(`photo`),[u,d]=(0,y.useState)(0),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=(0,y.useRef)(null),_=QO(e,o,c===`video`);(0,y.useEffect)(()=>{e&&(d(0),l(`photo`),h(null))},[e]);let v=async e=>{p(!0);try{await i(e),d(e=>e+1),t||r()}finally{p(!1)}},b=async()=>{let e=_.video.current;if(!e?.videoWidth)return;let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`)?.drawImage(e,0,0);let n=await new Promise(e=>t.toBlob(e,`image/jpeg`,.9));n&&await v(new File([n],`foto-${YO()}.jpg`,{type:`image/jpeg`}))},x=()=>{g.current?.state===`recording`&&g.current.stop()},S=()=>{let e=ik();if(!_.stream||!e)return;let t=[],n=new MediaRecorder(_.stream,{mimeType:e,videoBitsPerSecond:25e5,audioBitsPerSecond:96e3});n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{h(null),g.current=null;let n=e.split(`;`)[0];if(t.length){let e=n===`video/mp4`?`mp4`:`webm`;v(new File(t,`video-${YO()}.${e}`,{type:n}))}},g.current=n,n.start(1e3),h(0)};(0,y.useEffect)(()=>{if(m===null)return;if(m>=rk){g.current?.state===`recording`&&g.current.stop();return}let e=setTimeout(()=>h(e=>e===null?null:e+1),1e3);return()=>clearTimeout(e)},[m]),(0,y.useEffect)(()=>{!e&&g.current&&(g.current.onstop=null,g.current.stop(),g.current=null)},[e]);let C=e=>`0:${String(e).padStart(2,`0`)}`;return(0,X.jsxs)($O,{open:e,onClose:r,label:Z(`camera.title`),children:[(0,X.jsx)(tk,{title:m===null?u?Z(`camera.taken`,{n:u}):Z(`camera.title`):`${C(m)} / ${C(rk)}`,onClose:r,camera:_,onFlip:()=>s(e=>e===`environment`?`user`:`environment`)}),(0,X.jsx)(nk,{camera:_,asking:Z(`camera.asking`),actions:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a?(0,X.jsxs)(sk,{onClick:()=>{r(),a()},children:[(0,X.jsx)(Fv,{className:`size-4`}),` `,Z(qD?`camera.native`:`camera.pick`)]}):null,(0,X.jsx)(sk,{quiet:!0,onClick:r,children:Z(`common.close`)})]})}),(0,X.jsxs)(`div`,{className:Q(`safe-bottom px-4 pt-3`,_.error&&`invisible`),children:[n&&ak&&m===null?(0,X.jsx)(`div`,{className:`mb-3 flex justify-center gap-1 text-[0.8125rem]`,children:[`photo`,`video`].map(e=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:Q(`h-9 rounded-full px-4 font-medium transition`,c===e?`bg-white text-black`:`text-white/70 hover:text-white`),children:Z(e===`photo`?`camera.photo`:`camera.video`)},e))}):null,(0,X.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`text-[0.8125rem] text-white/70 leading-snug`,children:m===null?c===`video`?Z(`camera.clipHint`,{s:rk}):Z(t?`camera.hintMany`:`camera.hint`):Z(`camera.recording`)}),(0,X.jsx)(`button`,{type:`button`,"aria-label":Z(c===`photo`?`camera.shoot`:m===null?`camera.record`:`camera.stop`),disabled:!_.stream||f,onClick:()=>c===`photo`?void b():m===null?S():x(),className:`flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40`,children:f?(0,X.jsx)(kS,{className:`text-white`}):c===`photo`?(0,X.jsx)(`span`,{className:`size-[54px] rounded-full bg-white`}):m===null?(0,X.jsx)(`span`,{className:`flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]`,children:(0,X.jsx)(jb,{className:`size-6 text-white`})}):(0,X.jsx)(`span`,{className:`size-7 rounded-md bg-[#e5484d]`})}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:t&&u&&m===null?(0,X.jsxs)(sk,{onClick:r,children:[(0,X.jsx)(Lv,{className:`size-4`}),` `,Z(`camera.done`)]}):null})]})]})]})}function sk({onClick:e,quiet:t,children:n}){return(0,X.jsx)(`button`,{type:`button`,onClick:e,className:Q(`inline-flex h-11 items-center justify-center gap-2 rounded-full px-5 font-medium text-[0.875rem] transition`,t?`text-white/75 hover:text-white`:`bg-white text-black hover:bg-white/90`),children:n})}var ck=25,lk=9e3;function uk(e){return e.code===e.PERMISSION_DENIED?`denied`:e.code===e.TIMEOUT?`timeout`:`unavailable`}function dk({value:e,runId:t,placeholder:n,onChange:r,onBusy:i}){let a=Ql(e)?e:null,[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=(0,y.useRef)(null),d=(0,y.useRef)(!!a?.label),f=(0,y.useRef)(a);f.current=a;let p=a?.lat!==void 0&&a.lng!==void 0,m=typeof navigator<`u`&&`geolocation`in navigator,h=()=>{u.current!==null&&(navigator.geolocation.clearWatch(u.current),u.current=null),s(!1),i?.(!1)};(0,y.useEffect)(()=>()=>{u.current!==null&&navigator.geolocation.clearWatch(u.current)},[]);let g=async(e,n)=>{try{let{label:i}=await hS.post(`/api/runs/${t}/geocode`,{lat:e,lng:n,language:Kx}),a=f.current;i&&!d.current&&a?.lat===e&&a.lng===n&&r({...a,label:i})}catch{}},_=()=>{l(null),s(!0),i?.(!0);let e=Date.now(),t=1/0;u.current=navigator.geolocation.watchPosition(n=>{let{latitude:i,longitude:a,accuracy:o}=n.coords;if(o<t){t=o;let e=Math.round(i*1e6)/1e6,n=Math.round(a*1e6)/1e6,s=d.current?f.current?.label:void 0,c={lat:e,lng:n,accuracy:Math.round(o),...s?{label:s}:{}};f.current=c,r(c)}if(t<=ck||Date.now()-e>lk){h();let e=f.current;e?.lat!==void 0&&e.lng!==void 0&&g(e.lat,e.lng)}},e=>{h(),t===1/0&&l(uk(e))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:1e4})},v=e=>{d.current=e.trim().length>0;let t={...p?a:{},label:e};r(p||e.trim()?t:void 0)};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[p?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,X.jsx)(Ly,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`truncate font-medium text-[0.9375rem] tabular-nums`,children:[a.lat?.toFixed(5),`, `,a.lng?.toFixed(5)]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 text-[0.8125rem] text-ink-3`,children:[(0,X.jsx)(`span`,{children:o?Z(`location.refining`):a.accuracy?Z(`location.accuracy`,{m:a.accuracy}):null}),(0,X.jsxs)(`a`,{href:`https://www.openstreetmap.org/?mlat=${a.lat}&mlon=${a.lng}#map=17/${a.lat}/${a.lng}`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline-offset-2 hover:text-ink hover:underline coarse:-my-3 coarse:min-h-11 coarse:min-w-11`,children:[Z(`location.map`),` `,(0,X.jsx)($v,{className:`size-3`})]})]})]}),(0,X.jsx)(yS,{label:Z(`location.remove`),onClick:()=>{h(),d.current=!1,r(void 0)},children:(0,X.jsx)(Lb,{className:`size-4`})})]}):m?(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(vS,{variant:`secondary`,size:`lg`,busy:o,onClick:_,className:`w-full sm:w-auto`,children:[o?null:(0,X.jsx)(jy,{className:`size-4`}),Z(o?`location.locating`:`location.use`)]}),c?(0,X.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Z(`location.${c}`)}):(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Z(`location.why`)})]}):null,(0,X.jsx)(SS,{value:a?.label??``,placeholder:n??Z(p?`location.label`:`location.manual`),autoComplete:`street-address`,enterKeyHint:`done`,"aria-label":Z(`location.manual`),onChange:e=>v(e.target.value)})]})}var fk=c({createWorker:()=>pk}),pk,mk=o((()=>{pk=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
639
639
  class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
640
640
  class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
641
641
  this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
@@ -732,13 +732,13 @@ u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.cre
732
732
  y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
733
733
  self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
734
734
  break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
735
- `]),{type:`application/javascript`}))})),mk=c({default:()=>hk}),hk,gk=o((()=>{b_(),hk=class e{constructor(t,n,r,i,a){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera=`environment`,this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement(`canvas`),r&&typeof r==`object`?this._onDecode=n:(console.warn(r||i||a?`You're using a deprecated version of the QrScanner constructor which will be removed in the future`:`Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),this._legacyOnDecode=n),n=typeof r==`object`?r:{},this._onDecodeError=n.onDecodeError||(typeof r==`function`?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof i==`function`?i:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof r==`number`?r:typeof i==`number`?i:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let o=!1;if(t.hidden&&(t.hidden=!1,o=!0),document.body.contains(t)||(document.body.appendChild(t),o=!0),r=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(i=!!n.overlay,this.$overlay=n.overlay||document.createElement(`div`),a=this.$overlay.style,a.position=`absolute`,a.display=`none`,a.pointerEvents=`none`,this.$overlay.classList.add(`scan-region-highlight`),!i&&n.highlightScanRegion){this.$overlay.innerHTML=`<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>`;try{this.$overlay.firstElementChild.animate({transform:[`scale(.98)`,`scale(1.01)`]},{duration:400,iterations:1/0,direction:`alternate`,easing:`ease-in-out`})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML(`beforeend`,`<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>`),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let e=window.getComputedStyle(t);e.display===`none`&&(t.style.setProperty(`display`,`block`,`important`),o=!0),e.visibility!==`visible`&&(t.style.setProperty(`visibility`,`visible`,`important`),o=!0),o&&(console.warn(`QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.`),t.style.opacity=`0`,t.style.width=`0`,t.style.height=`0`,this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener(`play`,this._onPlay),t.addEventListener(`loadedmetadata`,this._onLoadedMetaData),document.addEventListener(`visibilitychange`,this._onVisibilityChange),window.addEventListener(`resize`,this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn(`Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.`)}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`),r;try{t&&(await n()).every(e=>!e.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((e,t)=>({id:e.deviceId,label:e.label||(t===0?`Default Camera`:`Camera ${t+1}`)}))}finally{r&&(console.warn(`Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream`),e._stopVideoStream(r))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return`torch`in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn(`Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream`),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw`No flash available`;await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener(`loadedmetadata`,this._onLoadedMetaData),this.$video.removeEventListener(`play`,this._onPlay),document.removeEventListener(`visibilitychange`,this._onVisibilityChange),window.removeEventListener(`resize`,this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,`close`)}async start(){if(this._destroyed)throw Error(`The QR scanner can not be started as it had been destroyed.`);if((!this._active||this._paused)&&(window.location.protocol!==`https:`&&console.warn(`The camera stream is only accessible if the page is transferred via https.`),this._active=!0,!document.hidden)){if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display=`none`);let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(e=>setTimeout(e,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,r,i,a=!1,o=!1){let s,c=!1;n&&(`scanRegion`in n||`qrEngine`in n||`canvas`in n||`disallowCanvasResizing`in n||`alsoTryWithoutScanRegion`in n||`returnDetailedScanResult`in n)?(s=n.scanRegion,r=n.qrEngine,i=n.canvas,a=n.disallowCanvasResizing||!1,o=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||i||a||o?`You're using a deprecated api for scanImage which will be removed in the future.`:`Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),n=!!r;try{let l,u;[r,l]=await Promise.all([r||e.createQrEngine(),e._loadImage(t)]),[i,u]=e._drawToCanvas(l,s,i,a);let d;if(r instanceof Worker){let t=r;n||e._postWorkerMessageSync(t,`inversionMode`,`both`),d=await new Promise((n,r)=>{let a,o,c,l=-1;o=i=>{i.data.id===l&&(t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),i.data.data===null?r(e.NO_QR_CODE_FOUND):n({data:i.data.data,cornerPoints:e._convertPoints(i.data.cornerPoints,s)}))},c=e=>{t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),r(`Scanner error: `+(e?e.message||e:`Unknown Error`))},t.addEventListener(`message`,o),t.addEventListener(`error`,c),a=setTimeout(()=>c(`timeout`),1e4);let d=u.getImageData(0,0,i.width,i.height);l=e._postWorkerMessageSync(t,`decode`,d,[d.data.buffer])})}else d=await Promise.race([new Promise((e,t)=>window.setTimeout(()=>t(`Scanner error: timeout`),1e4)),(async()=>{try{var[n]=await r.detect(i);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,s)}}catch(r){if(n=r.message||r,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:s,canvas:i,disallowCanvasResizing:a,alsoTryWithoutScanRegion:o});throw`Scanner error: ${n}`}})()]);return c?d:d.data}catch(n){if(!s||!o)throw n;let l=await e.scanImage(t,{qrEngine:r,canvas:i,disallowCanvasResizing:a});return c?l:l.data}finally{n||e._postWorkerMessage(r,`close`)}}setGrayscaleWeights(t,n,r,i=!0){e._postWorkerMessage(this._qrEnginePromise,`grayscaleWeights`,{red:t,green:n,blue:r,useIntegerApproximation:i})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,`inversionMode`,t)}static async createQrEngine(t){if(t&&console.warn(`Specifying a worker path is not required and not supported anymore.`),t=()=>y_(()=>Promise.resolve().then(()=>(pk(),dk)).then(e=>e.createWorker()),void 0,import.meta.url),!(!e._disableBarcodeDetector&&`BarcodeDetector`in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes(`qr_code`)))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:e})=>/Chromium/i.test(e))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues([`architecture`,`platformVersion`]).then(({architecture:e,platformVersion:t})=>/arm/i.test(e||`arm`)&&13<=parseInt(t||`13`)).catch(()=>!0)?t():new BarcodeDetector({formats:[`qr_code`]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=``),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,r=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,o=e.offsetTop,s=window.getComputedStyle(e),c=s.objectFit,l=t/n,u=r/i;switch(c){case`none`:var d=t,f=n;break;case`fill`:d=r,f=i;break;default:(c===`cover`?l>u:l<u)?(f=i,d=f*l):(d=r,f=d/l),c===`scale-down`&&(d=Math.min(d,t),f=Math.min(f,n))}var[p,m]=s.objectPosition.split(` `).map((e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?(t?i-f:r-d)*n/100:n});s=this._scanRegion.width||t,u=this._scanRegion.height||n,c=this._scanRegion.x||0;var h=this._scanRegion.y||0;l=this.$overlay.style,l.width=`${s/t*d}px`,l.height=`${u/n*f}px`,l.top=`${o+m+h/n*f}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${a+(n?r-p-d:p)+(n?t-c-s:c)/t*d}px`,l.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,r=t.y||0,i=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let a of e)a.x=a.x*i+n,a.y=a.y*t+r;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||(`requestVideoFrameCallback`in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(e=>setTimeout(e,n-t)),this._lastScanTimestamp=Date.now();try{var r=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute(`viewBox`,`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute(`points`,r.cornerPoints.map(({x:e,y:t})=>`${e},${t}`).join(` `)),this.$codeOutlineHighlight.style.display=``)):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display=`none`,100))}this._scanFrame()})}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw`Camera not found.`;let e=/^(environment|user)$/.test(this._preferredCamera)?`facingMode`:`deviceId`,t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map(t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:this._preferredCamera===`environment`?`user`:`environment`)}}catch{}throw`Camera not found.`}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform=`scaleX(`+(e===`user`?-1:1)+`)`}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?`environment`:/front|user|face/i.test(e.label)?`user`:null:null}static _drawToCanvas(e,t,n,r=!1){n||=document.createElement(`canvas`);let i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.videoWidth||e.width,s=t&&t.height?t.height:e.videoHeight||e.height;return r||(r=t&&t.downScaledWidth?t.downScaledWidth:o,t=t&&t.downScaledHeight?t.downScaledHeight:s,n.width!==r&&(n.width=r),n.height!==t&&(n.height=t)),t=n.getContext(`2d`,{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,i,a,o,s,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||`OffscreenCanvas`in window&&t instanceof OffscreenCanvas||`ImageBitmap`in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t==`string`){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw`Unsupported image type.`}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,n)=>{let r=i=>{e.removeEventListener(`load`,r),e.removeEventListener(`error`,r),i instanceof ErrorEvent?n(`Image load error`):t()};e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}static async _postWorkerMessage(t,n,r,i){return e._postWorkerMessageSync(await t,n,r,i)}static _postWorkerMessageSync(t,n,r,i){if(!(t instanceof Worker))return-1;let a=e._workerMessageId++;return t.postMessage({id:a,type:n,data:r},i),a}},hk.DEFAULT_CANVAS_SIZE=400,hk.NO_QR_CODE_FOUND=`No QR code found`,hk._disableBarcodeDetector=!1,hk._workerMessageId=0}));b_();var _k=null;function vk(){return _k??=(async()=>{let e=window.BarcodeDetector;if(e)try{let t=await e.getSupportedFormats();if(t.includes(`qr_code`)){let n=new e({formats:t});return{qrOnly:!1,detect:async e=>(await n.detect(e))[0]?.rawValue||null}}}catch{}let{default:t}=await y_(async()=>{let{default:e}=await Promise.resolve().then(()=>(gk(),mk));return{default:e}},void 0,import.meta.url),n=t.createQrEngine();return{qrOnly:!0,detect:async e=>{try{return(await t.scanImage(e,{qrEngine:n,returnDetailedScanResult:!0})).data||null}catch{return null}}}})(),_k}function yk({open:e,onClose:t,onResult:n}){let r=(0,y.useRef)(n);r.current=n;let i=(0,y.useRef)(t);return i.current=t,(0,y.useEffect)(()=>{e&&UD(`scan`).then(e=>{e&&r.current(e)}).catch(()=>void 0).finally(()=>i.current())},[e]),null}function bk(e){return HD(`scan`)?(0,X.jsx)(yk,{...e}):(0,X.jsx)(xk,{...e})}function xk({open:e,onClose:t,onResult:n}){let[r,i]=(0,y.useState)(`environment`),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(null),u=ZO(e,r),d=(0,y.useRef)(n);d.current=n;let f=(0,y.useRef)(t);f.current=t,(0,y.useEffect)(()=>{e&&(c(!1),vk().then(e=>o(e.qrOnly)))},[e]),(0,y.useEffect)(()=>{if(!e||!u.stream)return;let t=!1,n,r=async()=>{let e=u.video.current;if(!t&&e&&e.readyState>=2&&e.videoWidth){let n=await(await vk()).detect(e).catch(()=>null);if(n&&!t){navigator.vibrate?.(60),d.current(n),f.current();return}}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[e,u.stream,u.video]);let p=async e=>{if(!e)return;c(!1);let r=await createImageBitmap(e).catch(()=>null),i=r?await(await vk()).detect(r).catch(()=>null):null;i?(n(i),t()):c(!0)};return(0,X.jsxs)(QO,{open:e,onClose:t,label:Z(`scan.title`),children:[(0,X.jsx)(ek,{title:Z(`scan.title`),onClose:t,camera:u,onFlip:()=>i(e=>e===`environment`?`user`:`environment`)}),(0,X.jsx)(tk,{camera:u,asking:Z(`scan.asking`),actions:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(ok,{onClick:()=>l.current?.click(),children:[(0,X.jsx)(vy,{className:`size-4`}),` `,Z(`scan.fromPhoto`)]}),(0,X.jsx)(ok,{quiet:!0,onClick:t,children:Z(`scan.typeInstead`)})]}),children:(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,X.jsx)(`div`,{className:`aspect-square w-[min(68%,320px)] rounded-3xl border-2 border-white/90 shadow-[0_0_0_100vmax_rgb(0_0_0/0.35)]`})})}),(0,X.jsxs)(`div`,{className:`safe-bottom flex flex-col items-center gap-3 px-5 pt-3 text-center`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-white/75 leading-snug`,children:Z(s?`scan.miss`:a?`scan.hintQr`:`scan.hint`)}),u.stream?(0,X.jsxs)(ok,{quiet:!0,onClick:()=>l.current?.click(),children:[(0,X.jsx)(vy,{className:`size-4`}),` `,Z(`scan.fromPhoto`)]}):null]}),(0,X.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,onChange:e=>{p(e.target.files?.[0]),e.target.value=``}})]})}var Sk=`#1d1a17`,Ck={width:1200,height:480};function wk(e,t,n,r,i){e.lineCap=`round`,e.lineJoin=`round`,e.strokeStyle=Sk,e.fillStyle=Sk,e.lineWidth=i;for(let a of t){if(a.length===1){e.beginPath(),e.arc(a[0].x*n,a[0].y*r,i/2,0,Math.PI*2),e.fill();continue}e.beginPath(),e.moveTo(a[0].x*n,a[0].y*r);for(let t=1;t<a.length-1;t++){let i=a[t],o=a[t+1];e.quadraticCurveTo(i.x*n,i.y*r,(i.x+o.x)/2*n,(i.y+o.y)/2*r)}let t=a[a.length-1];e.lineTo(t.x*n,t.y*r),e.stroke()}}function Tk({strokes:e,onStrokes:t}){let n=(0,y.useRef)(null),r=(0,y.useRef)(null),i=(0,y.useRef)(e);i.current=e;let a=()=>{let e=n.current,t=e?.getContext(`2d`);if(!e||!t)return;let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),s=Math.round(e.clientHeight*a);(e.width!==o||e.height!==s)&&(e.width=o,e.height=s),t.clearRect(0,0,o,s),wk(t,r.current?[...i.current,r.current]:i.current,o,s,2.4*a)};(0,y.useEffect)(()=>{a();let e=n.current;if(!e)return;let t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[e]);let o=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}};return(0,X.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl bg-white ring-1 ring-input`,children:[(0,X.jsx)(`canvas`,{ref:n,"aria-label":Z(`sign.pad`),className:`block aspect-[5/2] w-full cursor-crosshair touch-none select-none`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r.current=[o(e)],a()},onPointerMove:e=>{r.current&&(r.current.push(o(e)),a())},onPointerUp:()=>{if(r.current){let e=r.current;r.current=null,t([...i.current,e])}},onPointerCancel:()=>{r.current=null,a()}}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-6 bottom-[22%] border-[#1d1a17]/25 border-b`}),e.length?null:(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-[#1d1a17]/40 text-[0.875rem]`,children:Z(`sign.hint`)})]})}async function Ek(e){let t=document.createElement(`canvas`);t.width=Ck.width,t.height=Ck.height;let n=t.getContext(`2d`);if(!n)return null;wk(n,e,Ck.width,Ck.height,7);let r=await new Promise(e=>t.toBlob(e,`image/png`));return r?new File([r],`unterschrift.png`,{type:`image/png`}):null}function Dk({label:e,value:t,runId:n,onChange:r}){let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=typeof t==`string`&&t?t:null,p=async()=>{l(!0),d(null);try{let e=await Ek(o);if(!e)return;r((await mS.upload(`/api/runs/${n}/uploads`,e)).id),a(!1)}catch(e){d(e.message)}finally{l(!1)}};return(0,X.jsxs)(`div`,{children:[f?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`min-w-0 flex-1 rounded-lg bg-white px-3`,"aria-label":Z(`sign.again`),children:(0,X.jsx)(`img`,{src:lS(`/api/runs/${n}/assets/${f}`),alt:e,className:`mx-auto h-20 object-contain`})}),(0,X.jsx)(vS,{label:Z(`sign.remove`),onClick:()=>r(void 0),children:(0,X.jsx)(Ib,{className:`size-4`})})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,children:[(0,X.jsx)(Jy,{className:`size-6`}),Z(`sign.open`)]}),(0,X.jsxs)(jS,{open:i,onClose:()=>a(!1),title:e,wide:!0,children:[(0,X.jsx)(Tk,{strokes:o,onStrokes:s}),u?(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:u}):null,(0,X.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3`,children:[(0,X.jsxs)(_S,{variant:`ghost`,disabled:!o.length||c,onClick:()=>s([]),children:[(0,X.jsx)(Xv,{className:`size-4`}),` `,Z(`sign.clear`)]}),(0,X.jsx)(_S,{busy:c,disabled:!o.length,onClick:()=>void p(),children:Z(`sign.accept`)})]})]})]})}function Ok({runId:e,connectionId:t,connector:n,onCancel:r}){let[i,a]=(0,y.useState)({}),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{s(!0),l(null);try{await mS.post(`/api/runs/${e}/connections/${t}/credentials/${n.id}`,{values:i})}catch(e){l(e.message)}finally{s(!1)}};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input`,children:[(n.fields??[]).map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(DS,{children:e.label}),(0,X.jsx)(xS,{type:e.secret?`password`:`text`,autoComplete:`off`,value:i[e.key]??``,placeholder:e.placeholder,onChange:t=>a(n=>({...n,[e.key]:t.target.value})),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}})]},e.key)),n.hint?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:n.hint}):null,c?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c}):null,(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(_S,{variant:`ghost`,size:`sm`,onClick:r,children:Z(`common.cancel`)}),(0,X.jsx)(_S,{size:`sm`,busy:o,onClick:()=>void u(),children:Z(`connect.go`)})]})]})}function kk({runId:e,connection:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null);if(!t)return null;if(t.account){let n=t.connectors.find(e=>e.id===t.account?.connector)?.name??``;return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,X.jsx)(Iv,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate font-medium text-[0.9375rem]`,children:t.account.label}),(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`connect.connected`,{name:n})})]}),(0,X.jsx)(vS,{label:Z(`connect.disconnect`),onClick:()=>void mS.del(`/api/runs/${e}/connections/${t.id}`),children:(0,X.jsx)(Ob,{className:`size-4`})})]})}let c=async n=>{if(s(null),a(null),HD(`signIn`)){try{let{url:r}=await mS.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);await UD(`signIn`,{url:r})}catch(e){s(e.message)}return}let r=window.open(`about:blank`,`wizard-connect`,`width=540,height=700`);try{let{url:i}=await mS.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);r?r.location.replace(i):a(i)}catch(e){r?.close(),s(e.message)}},l=t.connectors.find(e=>e.id===n);return t.connectors.length?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.connectors.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>e.auth===`oauth2`?void c(e):r(n===e.id?null:e.id),className:Q(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,n===e.id?`bg-ember-veil text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember`),children:[(0,X.jsx)(Ey,{className:`size-4`}),` `,e.name]},e.id))}),l?(0,X.jsx)(Ok,{runId:e,connectionId:t.id,connector:l,onCancel:()=>r(null)}):null,i?(0,X.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`text-[0.875rem] text-ember underline`,children:Z(`connect.openLink`)}):null,o?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:o}):null]}):(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`connect.none`)})}function Ak(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function jk(e,t){if(t.trim()===``)return null;if(e.type===`number`){let e=Number(t.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(e)?e:t}return e.type===`boolean`?t===`true`:t}function Mk({column:e,value:t,boxed:n,onCommit:r}){let[i,a]=(0,y.useState)(Ak(t));(0,y.useEffect)(()=>a(Ak(t)),[t]);let o=Q(`w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card`,n?`h-11 bg-paper-2`:`h-9 bg-transparent hover:bg-paper-2 coarse:h-11`);return e.type===`boolean`?(0,X.jsx)(`label`,{className:`flex size-9 cursor-pointer items-center justify-center coarse:size-11`,children:(0,X.jsx)(`input`,{type:`checkbox`,"aria-label":e.name,checked:t===!0,onChange:e=>r(e.target.checked),className:`size-4 accent-[var(--ember)] coarse:size-6`})}):e.type===`select`&&!e.format.multiple&&!e.format.allowCustom?(0,X.jsxs)(`select`,{value:i,onChange:e=>r(e.target.value||null),className:o,children:[(0,X.jsx)(`option`,{value:``}),e.format.options.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.label},e.id))]}):(0,X.jsx)(`input`,{"aria-label":e.name,type:e.type===`date`&&e.format.kind===`date`?`date`:`text`,inputMode:e.type===`number`?`decimal`:void 0,enterKeyHint:`done`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onBlur:()=>{i!==Ak(t)&&r(jk(e,i))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.target.blur())},className:Q(o,e.type===`number`&&`text-right tabular-nums`)})}function Nk({runId:e,list:t,editable:n}){let{def:r,rows:i}=t,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)({}),l=`/api/runs/${e}/lists/${r.id}/rows`,u=async e=>{o(null);try{await e()}catch(e){o(e instanceof dS?e.message:String(e))}},d=()=>u(async()=>{await mS.post(l,{cells:s}),c({})}),f=Object.values(s).some(e=>e!=null&&e!==``);if(!i.length&&!n)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`list.empty`)});let p=(e,t)=>t===0||e.type===`text`&&e.format?.style===`multiline`,m=(e,t,n)=>void u(()=>mS.patch(`${l}/${e}`,{cells:{[t]:n}}));return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[i.map(e=>(0,X.jsxs)(`div`,{className:`rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((t,r)=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,p(t,r)&&`col-span-2`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:t.name}),n?(0,X.jsx)(Mk,{boxed:!0,column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,X.jsx)(`div`,{className:Q(`break-words px-1 text-[0.875rem]`,t.type===`number`&&`tabular-nums`),children:Ul(t,e.cells[t.id],Gx)||`—`})]},t.id))}),n?(0,X.jsx)(`div`,{className:`mt-1 flex justify-end`,children:(0,X.jsx)(vS,{label:Z(`list.delete`),onClick:()=>void u(()=>mS.del(`${l}/${e.id}`)),children:(0,X.jsx)(Sb,{className:`size-4`})})}):null]},e.id)),n?(0,X.jsxs)(`div`,{className:`rounded-lg border border-input border-dashed p-2`,children:[(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((e,t)=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,p(e,t)&&`col-span-2`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,X.jsx)(Mk,{boxed:!0,column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})]},e.id))}),(0,X.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,X.jsxs)(_S,{variant:`secondary`,size:`sm`,onClick:()=>f?void d():void 0,children:[(0,X.jsx)(eb,{className:`size-4`}),` `,Z(`run.addRow`)]})})]}):null]}),(0,X.jsx)(`div`,{className:`hidden overflow-x-auto rounded-lg ring-1 ring-border-soft sm:block`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsxs)(`tr`,{children:[r.columns.map(e=>(0,X.jsx)(`th`,{className:`whitespace-nowrap px-3 py-2 text-left font-medium`,children:e.name},e.id)),n?(0,X.jsx)(`th`,{className:`w-10`}):null]})}),(0,X.jsxs)(`tbody`,{children:[i.map(e=>(0,X.jsxs)(`tr`,{className:`border-border-soft border-t align-top`,children:[r.columns.map(t=>(0,X.jsx)(`td`,{className:Q(`min-w-[7.5rem]`,n?`px-1 py-0.5`:`px-3 py-2`),children:n?(0,X.jsx)(Mk,{column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,X.jsx)(`span`,{className:Q(t.type===`number`&&`tabular-nums`),children:Ul(t,e.cells[t.id],Gx)})},t.id)),n?(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(vS,{label:Z(`list.delete`),className:`size-9`,onClick:()=>void u(()=>mS.del(`${l}/${e.id}`)),children:(0,X.jsx)(Sb,{className:`size-3.5`})})}):null]},e.id)),n?(0,X.jsxs)(`tr`,{className:`border-border-soft border-t bg-paper`,children:[r.columns.map(e=>(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(Mk,{column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})},e.id)),(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(vS,{label:Z(`run.addRow`),className:`size-9`,onClick:()=>f?void d():void 0,children:(0,X.jsx)(eb,{className:`size-4`})})})]}):null]})]})}),a?(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:a}):null]})}function Pk(e,t,n){return lS(`/api/runs/${e}/store/files/${t.split(`/`).map(encodeURIComponent).join(`/`)}${n?`?inline=1`:``}`)}var Fk=[`bg-paper-3 text-ink-3`,`bg-moss-tint text-moss`,`bg-rose-tint text-rose`,`bg-ember-tint text-ember-strong`];function Ik({runId:e,list:t}){let{def:n,rows:r}=t,i=n.columns.find(e=>e.id===n.check?.file),a=n.columns.find(e=>e.id===n.check?.status),o=a?.type===`select`?a.format.options:[],s=o[0]?.id,c=e=>a?String(e.cells[a.id]??s??``):``,l=e=>!a||c(e)===s,[u,d]=(0,y.useState)(()=>(r.find(l)??r[0])?.id??null),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=`/api/runs/${e}/lists/${n.id}/rows`,_=r.find(e=>e.id===u)??r[0],v=f?r.filter(e=>l(e)||e.id===_?.id):r,b=r.filter(e=>!l(e)).length,x=n.columns.filter(e=>e!==i&&e!==a),S=x.filter(e=>e.id!==n.key),C=S.find(e=>e.type===`text`)??S[0],w=S.filter(e=>e!==C),T=async(e,t)=>{h(null);try{await mS.patch(`${g}/${e}`,{cells:t})}catch(e){h(e instanceof dS?e.message:String(e))}},E=e=>{let t=v.findIndex(e=>e.id===_?.id),n=v[Math.min(v.length-1,Math.max(0,t+e))];n&&d(n.id)},D=async e=>{if(!_||!a)return;let t=r.findIndex(e=>e.id===_.id),n=[...r.slice(t+1),...r.slice(0,t)].find(l);await T(_.id,{[a.id]:e}),n&&e!==s&&d(n.id)},ee=e=>{e.target.closest(`input, textarea, select`)||(e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),E(e.key===`ArrowDown`?1:-1)):/^[1-9]$/.test(e.key)&&o[Number(e.key)]&&(e.preventDefault(),D(o[Number(e.key)].id)))};if(!r.length)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`list.empty`)});let O=i&&_?String(_.cells[i.id]??``).trim():``,k=O.split(`.`).pop()?.toLowerCase()??``,A=e=>Fk[Math.min(Math.max(0,o.findIndex(t=>t.id===c(e))),3)];return(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]`,onKeyDown:ee,children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:Z(`check.progress`,{done:b,total:r.length})}),a?(0,X.jsx)(`button`,{type:`button`,"aria-pressed":f,onClick:()=>p(e=>!e),className:Q(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,f?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:Z(`check.onlyOpen`)}):null]}),(0,X.jsx)(`ul`,{className:`flex max-h-[38vh] flex-col gap-1.5 overflow-y-auto p-0.5 pr-1 lg:max-h-[calc(100vh-15rem)]`,children:v.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>d(e.id),"aria-current":e.id===_?.id,className:Q(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left ring-1 transition`,e.id===_?.id?`bg-card shadow-soft ring-ember`:`bg-paper ring-border-soft hover:bg-card`),children:[(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate font-medium text-[0.875rem]`,children:C&&Ul(C,e.cells[C.id],Gx)||`—`}),(0,X.jsx)(`span`,{className:`block truncate text-[0.75rem] text-ink-3 tabular-nums`,children:w.slice(0,2).map(t=>Ul(t,e.cells[t.id],Gx)).filter(Boolean).join(` · `)})]}),a?(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]`,A(e)),children:o.find(t=>t.id===c(e))?.label??c(e)}):null]})},e.id))})]}),_?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[o.length>1?(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.slice(1).map((e,t)=>(0,X.jsxs)(_S,{size:`md`,variant:c(_)===e.id?`primary`:`secondary`,onClick:()=>void D(e.id),children:[c(_)===e.id?(0,X.jsx)(Iv,{className:`size-4`}):null,e.label,(0,X.jsx)(`kbd`,{className:`ml-1 hidden rounded bg-black/10 px-1.5 text-[0.6875rem] lg:inline`,children:t+1})]},e.id)),c(_)===s?null:(0,X.jsx)(_S,{size:`md`,variant:`ghost`,onClick:()=>void D(s??``),children:Z(`check.reopen`)})]}):null,(0,X.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,children:O?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-border-soft border-b bg-card px-3 py-2 text-[0.8125rem]`,children:[(0,X.jsx)(iy,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:O.split(`/`).pop()}),(0,X.jsx)(`a`,{href:Pk(e,O,k===`pdf`),target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline`,children:Z(`run.openFull`)})]}),k===`pdf`?(0,X.jsx)(`iframe`,{title:O,src:`${Pk(e,O,!0)}#toolbar=0&navpanes=0&view=FitH`,className:`h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]`},O):[`png`,`jpg`,`jpeg`,`webp`].includes(k)?(0,X.jsx)(`div`,{className:`flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]`,children:(0,X.jsx)(`img`,{src:Pk(e,O,!0),alt:O,className:`max-w-full object-contain`},O)}):(0,X.jsx)(`p`,{className:`px-4 py-10 text-center text-[0.875rem] text-ink-3`,children:Z(`check.noPreview`)})]}):(0,X.jsx)(`p`,{className:`px-4 py-14 text-center text-[0.875rem] text-ink-3`,children:Z(`check.noFile`)})}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 sm:grid-cols-3`,children:x.map(e=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,e.type===`text`&&e.format?.style===`multiline`&&`col-span-full`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,X.jsx)(Mk,{boxed:!0,column:e,value:_.cells[e.id],onCommit:t=>void T(_.id,{[e.id]:t})})]},e.id))}),m?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:m}):null]}):null]})}var Lk={xlsx:`Excel`,csv:`CSV`,json:`JSON`,md:`Markdown`,zip:`ZIP`};function Rk({runId:e,list:t}){return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.formats.map(n=>(0,X.jsx)(`a`,{href:lS(`/api/runs/${e}/lists/${t.def.id}/download?format=${n}`),className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4`,children:Lk[n]??n},n))})}function zk(e){return e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function Bk({runId:e}){let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&(o(!1),mS.get(`/api/runs/${e}/store`).then(i))},[t,e]);let s=r&&!r.files.length&&!r.connections.length&&!r.keepsSignIns&&r.lists.every(e=>!e.rows);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`inline-flex items-center gap-1.5 text-[0.8125rem] text-ink-4 transition hover:text-ink-2 coarse:min-h-11`,children:[(0,X.jsx)(Kv,{className:`size-3.5`}),` `,Z(`store.open`)]}),(0,X.jsx)(jS,{open:t,onClose:()=>n(!1),title:Z(`store.title`),wide:!0,children:r?(0,X.jsxs)(`div`,{className:`flex flex-col gap-5 text-[0.875rem]`,children:[(0,X.jsx)(`p`,{className:`text-ink-3`,children:Z(`store.explain`)}),s?(0,X.jsx)(`p`,{className:`text-ink-2`,children:Z(`store.empty`)}):null,r.lists.some(e=>e.rows)?(0,X.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.lists.filter(e=>e.rows).map(e=>(0,X.jsxs)(`li`,{className:`flex justify-between gap-3`,children:[(0,X.jsx)(`span`,{children:e.title}),(0,X.jsx)(`span`,{className:`text-ink-3 tabular-nums`,children:Z(`store.rows`,{n:e.rows})})]},e.id))}):null,r.connections.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Ey,{className:`size-4 text-ink-3`}),` `,e.account?.label]},e.id)),r.keepsSignIns?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Iv,{className:`size-4 text-ink-3`}),` `,Z(`store.signIns`)]}):null,r.files.length?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-1 text-ink-3`,children:Z(`store.files`,{n:r.files.length,size:zk(r.files.reduce((e,t)=>e+t.size,0))})}),(0,X.jsx)(`ul`,{className:`max-h-56 overflow-y-auto rounded-lg ring-1 ring-border-soft`,children:r.files.map(t=>(0,X.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,X.jsxs)(`a`,{href:lS(`/api/runs/${e}/store/files/${t.path}`),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,title:t.source??void 0,children:[(0,X.jsx)(iy,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.path}),(0,X.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:zk(t.size)})]})},t.path))})]}):null,(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[s?(0,X.jsx)(`span`,{}):a?(0,X.jsxs)(_S,{variant:`secondary`,onClick:async()=>{await mS.del(`/api/runs/${e}/store`),i(await mS.get(`/api/runs/${e}/store`)),o(!1)},children:[(0,X.jsx)(Sb,{className:`size-4`}),` `,Z(`store.confirmDelete`)]}):(0,X.jsxs)(_S,{variant:`ghost`,onClick:()=>o(!0),children:[(0,X.jsx)(Sb,{className:`size-4`}),` `,Z(`store.delete`)]}),(0,X.jsx)(_S,{onClick:()=>n(!1),children:Z(`common.close`)})]})]}):(0,X.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,X.jsx)(OS,{})})})]})}var Vk=300;function Hk(){if(typeof MediaRecorder<`u`)return[`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function Uk(e){return`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function Wk({value:e,runId:t,onChange:n,onBusy:r}){let i=$l(e)?e:null,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(0),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(null),b=Hk(),x=qD&&!!b;(0,y.useEffect)(()=>()=>{_.current&&(_.current.recorder.onstop=null,_.current.stop())},[]),(0,y.useEffect)(()=>()=>{h&&URL.revokeObjectURL(h.url)},[h]);let S=async(e,i)=>{u(!0),r?.(!0),f(null);try{let r=await mS.upload(`/api/runs/${t}/uploads`,e);g({asset:r.id,url:URL.createObjectURL(e)}),n({asset:r.id,...i===void 0?{}:{seconds:i}})}catch(e){f(e.message)}finally{u(!1),r?.(!1)}},C=async()=>{f(null),m(!1);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch{m(!0);return}let t=[],n=new MediaRecorder(e,{mimeType:b,audioBitsPerSecond:48e3}),i=Date.now(),a=new AudioContext,s=a.createAnalyser();s.fftSize=256,a.createMediaStreamSource(e).connect(s);let l=new Uint8Array(s.fftSize),u=0,d=()=>{s.getByteTimeDomainData(l);let e=0;for(let t of l)e=Math.max(e,Math.abs(t-128));if(c(Math.min(1,e/64)),o((Date.now()-i)/1e3),(Date.now()-i)/1e3>=Vk){p();return}u=requestAnimationFrame(d)},p=()=>{cancelAnimationFrame(u),n.state!==`inactive`&&n.stop();for(let t of e.getTracks())t.stop();a.close().catch(()=>void 0),_.current=null,o(null),c(0)};n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{let e=(n.mimeType||b||`audio/webm`).split(`;`)[0],r=e===`audio/mp4`?`m4a`:e===`audio/ogg`?`ogg`:`webm`,a=Math.max(1,Math.round((Date.now()-i)/1e3));S(new File(t,`sprachnotiz-${JO()}.${r}`,{type:e}),a)},_.current={recorder:n,stop:p},r?.(!0),n.start(1e3),u=requestAnimationFrame(d)},w=a!==null,T=(0,X.jsxs)(_S,{variant:`secondary`,onClick:()=>v.current?.click(),children:[(0,X.jsx)(ny,{className:`size-4`}),` `,Z(`voice.pick`)]});return(0,X.jsxs)(`div`,{children:[w?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-ember`,children:[(0,X.jsxs)(`span`,{className:`relative flex size-11 shrink-0 items-center justify-center`,children:[(0,X.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-rose-tint transition-transform duration-75`,style:{transform:`scale(${.7+s*.5})`}}),(0,X.jsx)(`span`,{className:`relative size-3.5 animate-pulse-dot rounded-full bg-rose`})]}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`font-medium text-[0.9375rem] tabular-nums`,children:Uk(a)}),(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:a>270?Z(`voice.left`,{s:Math.ceil(Vk-a)}):Z(`voice.recording`)})]}),(0,X.jsxs)(_S,{onClick:()=>_.current?.stop(),children:[(0,X.jsx)(vb,{className:`size-3.5 fill-current`}),` `,Z(`voice.stop`)]})]}):l?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input`,children:[(0,X.jsx)(OS,{className:`size-4`}),` `,Z(`run.uploading`)]}):i?(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`audio`,{controls:!0,preload:`metadata`,src:h?.asset===i.asset?h.url:`/api/runs/${t}/assets/${i.asset}`,className:`h-11 w-full`}),i.transcript?(0,X.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap px-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:i.transcript}):null,(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:i.seconds?Uk(i.seconds):null}),(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[x?(0,X.jsxs)(_S,{variant:`ghost`,size:`sm`,onClick:()=>void C(),children:[(0,X.jsx)(ib,{className:`size-3.5`}),` `,Z(`voice.again`)]}):null,(0,X.jsx)(_S,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:Z(`voice.remove`)})]})]})]}):(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,X.jsxs)(_S,{variant:`secondary`,size:`lg`,onClick:()=>void C(),className:`w-full sm:w-auto`,children:[(0,X.jsx)(By,{className:`size-4`}),` `,Z(`voice.start`)]}):T,x&&p?T:null]}),p?(0,X.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Z(`voice.denied`)}):(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Z(x?`voice.why`:`voice.noRecorder`)})]}),(0,X.jsx)(`input`,{ref:v,type:`file`,hidden:!0,accept:`audio/*`,capture:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&S(t,void 0)}}),d?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:d}):null]})}function Gk(e,t){try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e)}catch{return`${e.toFixed(2)} ${t}`}}function Kk({field:e,value:t,values:n,onChange:r}){let i=e.columns??[],a=Array.isArray(t)&&t.length?t:[{}],o=Uu(e,a,n),s=(e,t,n)=>{r(a.map((r,i)=>i===e?{...r,[t]:n}:r))},c=i.map(e=>e.kind===`text`&&e===i[0]?`minmax(0,3fr)`:`minmax(0,1fr)`).join(` `);return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`hidden gap-2 px-2 pt-1 pb-2 text-[0.75rem] text-ink-3 sm:grid`,style:{gridTemplateColumns:`${c} 36px`},children:i.map(e=>(0,X.jsx)(`div`,{className:e.kind===`text`?``:`text-right`,children:e.label},e.id))}),(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>(0,X.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 rounded-lg bg-paper p-2 sm:bg-transparent sm:p-0 sm:[grid-template-columns:var(--cols)]`,style:{"--cols":`${c} 36px`},children:[i.map((n,r)=>(0,X.jsxs)(`label`,{className:Q(`flex min-w-0 flex-col gap-1 sm:col-span-1`,r===0?`col-span-5`:i.length-1<=2?`col-span-3`:`col-span-2`),children:[(0,X.jsx)(`span`,{className:`px-0.5 text-[0.6875rem] text-ink-3 sm:hidden`,children:n.label}),(0,X.jsx)(`input`,{"aria-label":n.label,placeholder:n.label,inputMode:n.kind===`text`?`text`:`decimal`,autoComplete:`off`,value:String(e[n.id]??``),onChange:e=>s(t,n.id,e.target.value),className:Q(`h-11 w-full min-w-0 rounded-md border border-transparent bg-paper-2 px-2.5 text-[0.875rem] outline-none placeholder:text-transparent focus:border-focus focus:bg-card sm:placeholder:text-ink-4`,n.kind!==`text`&&`text-right tabular-nums`)})]},n.id)),(0,X.jsx)(vS,{label:Z(`list.delete`),onClick:()=>r(a.filter((e,n)=>n!==t)),className:`order-first col-start-6 row-start-1 size-11 justify-self-end self-end sm:order-none sm:col-start-auto sm:row-start-auto`,children:(0,X.jsx)(Sb,{className:`size-4`})})]},t))}),(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-end justify-between gap-3 px-2 pb-1`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>r([...a,{}]),className:`inline-flex h-9 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent coarse:h-11`,children:[(0,X.jsx)(eb,{className:`size-4`}),` `,Z(`run.addRow`)]}),(0,X.jsxs)(`div`,{className:`text-right text-[0.8125rem] tabular-nums`,children:[(0,X.jsxs)(`div`,{className:`text-ink-3`,children:[Z(`run.net`),` `,Gk(o.net,o.currency)]}),o.vatRate?(0,X.jsxs)(`div`,{className:`text-ink-3`,children:[Z(`run.vat`,{r:o.vatRate}),` `,Gk(o.vat,o.currency)]}):null,(0,X.jsxs)(`div`,{className:`font-semibold text-[0.9375rem] text-ink`,children:[Z(`run.total`),` `,Gk(o.gross,o.currency)]})]})]})]})}function qk(e){return!!e?.closest(`input, textarea, [contenteditable='true']`)}function Jk({field:e,value:t,runId:n,onChange:r,onBusy:i}){let a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(null),c=(0,y.useRef)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)({}),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),S=(0,y.useRef)(null),C=e=>{S.current=e,x(e)},w=e.kind===`image`,T=!!e.multiple,E=T?e.max??30:1,D=w||!!e.camera||!!e.video,ee=!w&&!!e.video,O=Array.isArray(t)?t:typeof t==`string`&&t?[t]:[],k=(0,y.useRef)(O);k.current=O;let A=O.length<E,te=async e=>{let t=(w?e.filter(e=>e.type.startsWith(`image/`)):e).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));if(!t.length)return;let a=E-(T?k.current.length:0);u(!0),i?.(!0),m(t.length>a&&T?Z(`run.maxFiles`,{n:E}):null);try{for(let e of t.slice(0,Math.max(0,a))){let t=await qO(e),i=await mS.upload(`/api/runs/${n}/uploads`,t);f(e=>({...e,[i.id]:{name:i.name,mime:i.mime}}));let a=T?[...k.current,i.id]:i.id;k.current=T?a:[i.id],r(a)}}catch(e){m(e.message)}finally{u(!1),i?.(!1)}},ne=(0,y.useRef)(te);ne.current=te;let re=e=>{let t=O.filter(t=>t!==e);r(T?t:void 0)},ie=(e,t)=>{let n=k.current.indexOf(e),i=Math.min(k.current.length-1,Math.max(0,t));if(n<0||n===i)return;let a=k.current.filter(t=>t!==e);a.splice(i,0,e),k.current=a,r(a)},ae=T&&O.length>1;(0,y.useEffect)(()=>{if(!A)return;let e=e=>{let t=Array.from(e.clipboardData?.files??[]),n=a.current;if(!t.length||!n||qk(document.activeElement))return;let r=document.querySelectorAll(`[data-upload-field]`);(n.matches(`:hover`)||n.contains(document.activeElement)||r.length===1)&&(e.preventDefault(),ne.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[A]);let oe=Q(`flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,O.length?`py-4`:`py-8`);return(0,X.jsxs)(`div`,{ref:a,"data-upload-field":``,onDragOver:e=>{A&&(e.preventDefault(),v(!0))},onDragLeave:()=>v(!1),onDrop:e=>{v(!1),A&&(e.preventDefault(),te(Array.from(e.dataTransfer.files)))},children:[O.length?(0,X.jsx)(`div`,{className:`mb-2 flex flex-col gap-2`,children:O.map((e,t)=>{let r=d[e],i=r?.mime??(w?`image/`:``);return(0,X.jsxs)(`div`,{"data-file-id":e,className:Q(`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input transition-shadow`,b===e&&`relative z-10 shadow-elevated ring-2 ring-ember`),children:[ae?(0,X.jsxs)(`button`,{type:`button`,"aria-label":Z(`run.moveFile`,{n:t+1}),title:Z(`run.moveFileHint`),className:Q(`-mr-1 flex h-14 w-9 shrink-0 touch-none flex-col items-center justify-center gap-0.5 rounded-lg text-ink-3 hover:bg-paper-2 hover:text-ink`,b===e?`cursor-grabbing`:`cursor-grab`),onPointerDown:t=>{try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}C(e)},onPointerMove:t=>{if(S.current!==e)return;let n=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[data-file-id]`),r=n?.getAttribute(`data-file-id`);r&&r!==e&&a.current?.contains(n??null)&&ie(e,k.current.indexOf(r))},onPointerUp:()=>C(null),onPointerCancel:()=>C(null),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),ie(e,t+(n.key===`ArrowUp`?-1:1)))},children:[(0,X.jsx)(`span`,{className:`font-medium text-[0.75rem] tabular-nums`,children:t+1}),(0,X.jsx)(my,{className:`size-4`})]}):null,i.startsWith(`image/`)?(0,X.jsx)(`img`,{src:lS(`/api/runs/${n}/assets/${e}`),alt:``,className:`size-14 rounded-lg object-cover`}):(0,X.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg bg-paper-2`,children:i.startsWith(`video/`)?(0,X.jsx)(oy,{className:`size-5 text-ink-3`}):(0,X.jsx)(Ky,{className:`size-5 text-ink-3`})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[0.875rem]`,children:r?.name??`✓`}),(0,X.jsx)(vS,{label:Z(`run.removeFile`),onClick:()=>re(e),children:(0,X.jsx)(Ib,{className:`size-4`})})]},e)})}):null,A?(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>o.current?.click(),className:Q(oe,`min-w-[9rem] flex-1 px-4`,_&&`border-ember text-ink`),children:[w?(0,X.jsx)(gy,{className:`size-6`}):(0,X.jsx)(Ky,{className:`size-6`}),l?Z(`run.uploading`):O.length?Z(`run.uploadMore`):Z(KD?`run.uploadTouch`:`run.upload`)]}),D?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>qD?g(!0):s.current?.click(),className:Q(oe,`w-28`),children:[(0,X.jsx)(Pv,{className:`size-6`}),Z(`run.camera`)]}):null,ee&&!(qD&&ik)?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:Q(oe,`w-28`),children:[(0,X.jsx)(Ab,{className:`size-6`}),Z(`camera.video`)]}):null]}):null,(0,X.jsx)(`input`,{ref:o,type:`file`,hidden:!0,multiple:T,accept:w?`image/*`:void 0,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),(0,X.jsx)(`input`,{ref:s,type:`file`,hidden:!0,accept:`image/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),ee?(0,X.jsx)(`input`,{ref:c,type:`file`,hidden:!0,accept:`video/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}):null,(0,X.jsx)(ak,{open:h,multiple:T,video:ee,onClose:()=>g(!1),onCapture:e=>te([e]),onNative:()=>s.current?.click()}),T&&(e.min||e.max)?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.min&&O.length<e.min?Z(`run.filesMin`,{n:O.length,min:e.min}):e.max?Z(`run.filesOf`,{n:O.length,max:e.max}):null}):null,p?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p}):null]})}function Yk(e){let t=`${e.id} ${e.label}`.toLowerCase();return/telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t)?{type:`tel`,inputMode:`tel`,autoComplete:`tel`}:/\bplz\b|postleitzahl|postal|zip/.test(t)?{inputMode:`numeric`,autoComplete:`postal-code`}:/iban/.test(t)?{autoCapitalize:`characters`,autoCorrect:`off`,spellCheck:!1}:/vorname|first.?name/.test(t)?{autoComplete:`given-name`,autoCapitalize:`words`}:/nachname|last.?name|surname/.test(t)?{autoComplete:`family-name`,autoCapitalize:`words`}:/firma|unternehmen|company|organi[sz]ation/.test(t)?{autoComplete:`organization`,autoCapitalize:`words`}:/straße|strasse|street|anschrift|adresse|address/.test(t)?{autoComplete:`street-address`,autoCapitalize:`words`}:/\b(ort|stadt|city|town)\b/.test(t)?{autoComplete:`address-level2`,autoCapitalize:`words`}:/\bname\b|ansprechp/.test(t)?{autoComplete:`name`,autoCapitalize:`words`}:{autoCapitalize:`sentences`}}function Xk({field:e,value:t,onChange:n}){let[r,i]=(0,y.useState)(!1);return(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(xS,{value:t,placeholder:e.placeholder,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>n(e.target.value)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`inline-flex h-11 shrink-0 items-center gap-2 rounded-lg border border-input bg-card px-3.5 font-medium text-[0.875rem] text-ink-2 transition hover:border-ember hover:text-ink`,children:[(0,X.jsx)(ob,{className:`size-4`}),` `,Z(`scan.button`)]}),(0,X.jsx)(bk,{open:r,onClose:()=>i(!1),onResult:n})]})}var Zk=4;function Qk(e){let t=new Map,n=e.map(e=>({value:e,slot:Bu(e)})).filter(e=>e.slot).sort((e,t)=>Date.parse(e.value)-Date.parse(t.value));for(let{value:e,slot:r}of n){if(!r)continue;let n=t.get(r.day)??{label:Vu(e,Gx),times:[]};n.times.push({value:e,time:r.time}),t.set(r.day,n)}return[...t.values()]}function $k({name:e,label:t,options:n,value:r,onChange:i,disabled:a}){let o=Qk(n),s=o.findIndex(e=>e.times.some(e=>e.value===r)),[c,l]=(0,y.useState)(s>=Zk);if(!o.length)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`slot.none`)});let u=c?o:o.slice(0,Zk);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,X.jsx)(`legend`,{className:`sr-only`,children:t}),u.map(t=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-2 font-medium text-[0.75rem] text-ink-3`,children:t.label}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.times.map(n=>(0,X.jsxs)(`label`,{className:`relative`,children:[(0,X.jsx)(`input`,{type:`radio`,name:`slot-${e}`,value:n.value,checked:n.value===r,disabled:a.has(n.value),"aria-label":`${t.label}, ${n.time}`,onChange:()=>i(n.value),className:`peer sr-only`}),(0,X.jsx)(`span`,{className:Q(`inline-flex h-10 cursor-pointer items-center rounded-full border px-4 text-sm tabular-nums transition coarse:h-11`,`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`,`peer-checked:border-ember peer-checked:bg-ember-tint peer-checked:text-ink`,`peer-disabled:pointer-events-none peer-disabled:line-through peer-disabled:opacity-60`,`peer-focus-visible:outline-[1.5px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-(--focus-line) peer-focus-visible:outline-solid`),children:n.time})]},n.value))})]},t.label))]}),o.length>u.length?(0,X.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`self-start text-[0.8125rem] text-ink-3 underline-offset-4 transition hover:text-ink hover:underline coarse:min-h-11`,children:Z(`slot.later`)}):null]})}function eA({field:e,value:t,values:n,runId:r,view:i,onChange:a,onBusy:o,error:s,closed:c}){let l=t==null?``:String(t),u=new Set(c?.values.map(String)),d;switch(e.kind){case`textarea`:d=(0,X.jsx)(CS,{value:l,placeholder:e.placeholder,autoCapitalize:`sentences`,enterKeyHint:`enter`,onChange:e=>a(e.target.value)});break;case`number`:d=(0,X.jsx)(xS,{inputMode:`decimal`,autoComplete:`off`,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`select`:{let t=e.options??[];d=t.length<=5&&t.every(e=>e.length<=28)?(0,X.jsx)(TS,{value:l,options:t,onChange:a,disabled:[...u]}):(0,X.jsx)(wS,{value:l,placeholder:`—`,onChange:a,options:t.map(e=>({value:e,label:e,disabled:u.has(e)}))});break}case`slot`:d=(0,X.jsx)($k,{name:e.id,label:e.label,options:e.options??[],value:l,onChange:a,disabled:u});break;case`multiselect`:d=(0,X.jsx)(TS,{multi:!0,value:Array.isArray(t)?t:[],options:e.options??[],onChange:a});break;case`date`:d=(0,X.jsx)(xS,{type:`date`,value:l,onChange:e=>a(e.target.value),className:`w-full sm:w-56`});break;case`email`:d=(0,X.jsx)(xS,{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`url`:d=(0,X.jsx)(xS,{type:`url`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder??`https://`,onChange:e=>a(e.target.value)});break;case`toggle`:d=(0,X.jsx)(ES,{checked:t===!0,onChange:a,label:e.label,disabled:u.has(String(t!==!0))});break;case`color`:d=(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(SS,{value:l||`#e0531b`,onChange:e=>a(e.target.value)}),(0,X.jsx)(xS,{value:l,placeholder:`#e0531b`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>a(e.target.value),className:`w-36`})]});break;case`image`:case`file`:d=(0,X.jsx)(Jk,{field:e,value:t,runId:r,onChange:a,onBusy:o});break;case`items`:d=(0,X.jsx)(Kk,{field:e,value:t,values:n,onChange:a});break;case`connection`:d=(0,X.jsx)(kk,{runId:r,connection:i?.connections.find(t=>t.id===e.connection)});break;case`list`:{let t=i?.lists.find(t=>t.def.id===e.list);d=t?(0,X.jsx)(Nk,{runId:r,list:t,editable:!0}):null;break}case`location`:d=(0,X.jsx)(uk,{value:t,runId:r,placeholder:e.placeholder,onChange:a,onBusy:o});break;case`audio`:d=c?null:(0,X.jsx)(Wk,{value:t,runId:r,onChange:a,onBusy:o});break;case`signature`:d=(0,X.jsx)(Dk,{label:e.label,value:t,runId:r,onChange:a});break;default:d=e.scan?(0,X.jsx)(Xk,{field:e,value:l,onChange:a}):(0,X.jsx)(xS,{...Yk(e),value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)})}return(0,X.jsxs)(`div`,{children:[e.kind===`toggle`?(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,X.jsx)(DS,{hint:e.help,children:e.label}),d]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(DS,{hint:e.help,required:e.required,children:e.label}),d]}),c?(0,X.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:Z(`run.closed`,{list:c.classes.map(e=>Z(`run.cls.${tA[e]}`)).join(`, `)})}):null,s?(0,X.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:s}):null]})}var tA={classifier:`text`,standard:`text`,high:`text`,highest:`text`,image:`image`,video:`video`,speech:`speech`,audio:`audio`},nA=45e3;function rA(e){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)({});(0,y.useEffect)(()=>{if(n(null),o(!1),!e)return;let t=!1,r=0,i,a=null,s=Date.now(),c=()=>{t=!0,a?.close(),o(!0)},l=async()=>{try{let r=await mS.get(`/api/runs/${e}`);t||n(r)}catch(e){e instanceof dS&&e.status===404&&c()}},u=()=>{if(clearTimeout(i),a?.close(),t)return;let o=new EventSource(lS(`/api/runs/${e}/stream`),{withCredentials:!0});a=o,s=Date.now(),o.addEventListener(`view`,e=>{r=0,s=Date.now(),n(JSON.parse(e.data))}),o.addEventListener(`ping`,()=>{s=Date.now()}),o.onerror=()=>{o.close(),!(t||a!==o)&&(a=null,l(),r=Math.min(r+1,6),i=setTimeout(u,500*2**r))}},d=()=>{t||document.visibilityState!==`visible`||(!a||a.readyState===EventSource.CLOSED||Date.now()-s>nA?(r=0,u()):l())},f=setInterval(()=>{!t&&a&&Date.now()-s>nA&&(r=0,u())},15e3);return u(),document.addEventListener(`visibilitychange`,d),window.addEventListener(`pageshow`,d),window.addEventListener(`online`,d),()=>{t=!0,clearTimeout(i),clearInterval(f),document.removeEventListener(`visibilitychange`,d),window.removeEventListener(`pageshow`,d),window.removeEventListener(`online`,d),a?.close()}},[e]);let d=(0,y.useCallback)(async(t,n)=>{if(!e)return!1;c(!0),i(null),u({});try{return await mS.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof dS&&e.status===422&&Array.isArray(e.body?.fields)&&u(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),i(e.message),!1}finally{c(!1)}},[e]);return{view:t,notFound:a,error:r,busy:s,fieldErrors:l,submitPage:(e,t)=>d(`pages/${e}`,{values:t}),accept:(e,t)=>d(`reviews/${e}`,{type:`accept`,edits:t}),regenerate:(e,t,n,r)=>d(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>d(`back`),retry:()=>d(`retry`)}}function iA({view:e}){let t=Math.round(Math.min(e.progress.done,e.progress.total)/Math.max(1,e.progress.total)*100);return(0,X.jsx)(`div`,{className:`h-[3px] w-full bg-paper-2`,children:(0,X.jsx)(`div`,{className:`h-full bg-ember transition-[width] duration-700 ease-out`,style:{width:`${t}%`}})})}function aA({title:e,description:t,kicker:n}){return(0,X.jsxs)(`div`,{className:`mb-8`,children:[n?(0,X.jsx)(`p`,{className:`mb-4 text-[0.9375rem] text-ink-2 leading-relaxed`,children:n}):null,(0,X.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] leading-[1.15] tracking-tight sm:text-[2rem]`,children:e}),t?(0,X.jsx)(`p`,{className:`mt-2 text-[0.9375rem] text-ink-3 leading-relaxed`,children:t}):null]})}function oA(e,t){let n={};for(let r of e.fields)n[r.id]=t.values[r.id]??t.prefill?.[r.id]??r.default??(r.kind===`multiselect`?[]:void 0);return n}function sA(e){return Array.from(e.querySelectorAll(`input:not([type="hidden"], [type="file"], [type="checkbox"], [type="color"], [type="range"], [disabled]), textarea:not([disabled])`)).filter(e=>!e.closest(`dialog`)&&e.offsetParent!==null)}function cA({view:e,run:t,step:n}){let[r,i]=(0,y.useState)(()=>oA(n,e)),[a,o]=(0,y.useState)(new Set),s=(0,y.useRef)(null),c=e.progress.done===0,l=Ru((0,y.useMemo)(()=>n.fields.filter(t=>!Lu(t)||e.decidedFields?.includes(t.id)).map(t=>e.options?.[t.id]?.length?{...t,options:e.options[t.id]}:t),[n.fields,e.options,e.decidedFields]),e.known??{},r),u=()=>void t.submitPage(n.id,r);return(0,y.useEffect)(()=>{if(!s.current)return;let e=sA(s.current).filter(e=>e instanceof HTMLInputElement);for(let[t,n]of e.entries())(n.dataset.hint||!n.hasAttribute(`enterkeyhint`))&&(n.dataset.hint=`1`,n.setAttribute(`enterkeyhint`,t===e.length-1?`go`:`next`))}),(0,X.jsxs)(`form`,{ref:s,className:`animate-rise`,onSubmit:e=>{e.preventDefault(),a.size||u()},onKeyDown:e=>{let t=e.target;if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||!(t instanceof HTMLInputElement)||t.closest(`dialog`))return;let n=sA(e.currentTarget),r=n[n.indexOf(t)+1];r&&(e.preventDefault(),r.focus())},children:[(0,X.jsx)(aA,{title:n.title,description:n.description,kicker:c?e.wizard.intro:null}),(0,X.jsx)(`div`,{className:`flex flex-col gap-7`,children:l.map(n=>(0,X.jsx)(eA,{field:n,value:r[n.id],values:r,runId:e.id,view:e,error:t.fieldErrors[n.id],closed:e.closed?.[n.id],onChange:e=>i(t=>({...t,[n.id]:e})),onBusy:e=>o(t=>{if(t.has(n.id)===e)return t;let r=new Set(t);return e?r.add(n.id):r.delete(n.id),r})},n.id))}),(0,X.jsx)(lA,{view:e,run:t,sticky:!0,children:(0,X.jsxs)(_S,{type:`submit`,size:`lg`,busy:t.busy,disabled:a.size>0,children:[n.cta||Z(`run.next`),` `,(0,X.jsx)(wv,{className:`size-4`})]})})]})}function lA({view:e,run:t,sticky:n,children:r}){return(0,X.jsxs)(`div`,{className:Q(`mt-10 flex items-center justify-between gap-3`,n&&`action-bar`),children:[e.canBack?(0,X.jsxs)(_S,{variant:`ghost`,onClick:()=>void t.back(),disabled:t.busy,children:[(0,X.jsx)(Sv,{className:`size-4`}),` `,Z(`run.back`)]}):(0,X.jsx)(`span`,{}),r]})}function uA(){let e=iO(),[t,n]=(0,y.useState)(!1),r=e!==`off`;return(0,X.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:t,onClick:async()=>{if(r){sO();return}n(!0),await oO(),n(!1)},className:Q(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4`),children:[r?(0,X.jsx)(Ov,{className:`size-4 text-ember-strong`}):(0,X.jsx)(Av,{className:`size-4`}),Z(r?`notify.on`:`notify.ask`)]}),(0,X.jsx)(`p`,{className:`max-w-xs text-[0.75rem] text-ink-4 leading-relaxed`,children:Z(e===`off`?`notify.why`:e===`on`?`notify.onHint`:aO()?`notify.blocked`:`notify.quiet`)})]})}function dA({view:e,compact:t,awake:n}){let r=(0,y.useMemo)(()=>{let t=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id);return t?new Date(t.at).getTime():Date.now()},[e.events,e.step?.id]),[i,a]=(0,y.useState)(Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let o=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id)?.message??e.step?.title??Z(`run.working`),s=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=r-500),c=s.slice(-4),l=[...new Set(s.map(e=>e.asset).filter(e=>!!e))],u=[...s].reverse().find(e=>e.asset)?.asset;return(0,X.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-6 text-center`,children:[(0,X.jsx)(vw,{kind:e.wizard.avatar,size:t?130:170,fluffy:!0}),(0,X.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem] tracking-tight`,children:o}),(0,X.jsx)(`div`,{className:`mt-1 text-[0.8125rem] text-ink-4 tabular-nums`,children:Z(`run.elapsed`,{s:Math.max(0,Math.round((i-r)/1e3))})}),l.length?(0,X.jsx)(`div`,{className:`mt-5 flex max-w-full flex-wrap justify-center gap-2`,children:l.slice(-8).map(t=>(0,X.jsx)(`img`,{src:lS(`/api/runs/${e.id}/assets/${t}`),alt:``,className:Q(`size-16 animate-rise rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft transition sm:size-20`,t===u?`ring-2 ring-ember`:`opacity-70`)},t))}):null,(0,X.jsx)(`div`,{className:`mt-6 flex min-h-[7rem] w-full max-w-sm flex-col gap-1.5`,children:c.map((e,t)=>(0,X.jsxs)(`div`,{className:Q(`flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity`,t===c.length-1?`text-ink-2`:`text-ink-4`),children:[t===c.length-1?(0,X.jsx)(gb,{className:`size-3.5 animate-breathe text-ember`}):null,(0,X.jsx)(`span`,{className:`truncate`,children:Yx(e)})]},e.id))}),t?null:(0,X.jsx)(uA,{}),n?(0,X.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-4`,children:Z(`run.awake`)}):null]})}function fA(e){let t=(0,y.useRef)({running:!1,since:0,ask:null});(0,y.useEffect)(()=>{if(!e)return;let n=t.current,r=e.status===`running`,i=r?n.running?n.since:Date.now():0,a=t=>{document.visibilityState!==`visible`&&!document.title.startsWith(`● `)&&(document.title=`● ${document.title}`),lO({title:e.wizard.title,body:t,tag:e.id})};r&&e.ask&&e.ask.id!==n.ask?a(Z(`notify.needsYou`)):!r&&n.running&&Date.now()-n.since>8e3&&a(e.status===`failed`?Z(`run.failed`):e.status===`done`?Z(`notify.done`):Z(`notify.next`)),t.current={running:r,since:i,ask:e.ask?.id??null}},[e]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&document.title.startsWith(`● `)&&(document.title=document.title.slice(2))};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function pA({view:e,run:t,step:n}){let[r,i]=(0,y.useState)({}),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)(``),l=e.shown.filter(e=>e.output),[u,d]=(0,y.useState)(l.length===1?l[0].step.id:null),[f,p]=(0,y.useState)({}),m=(0,y.useRef)(null),h=l.find(e=>e.step.id===u),g=h?.step.type===`generate`&&(h.output?.assets?.length??0)>1,_=()=>{h&&s.trim()&&t.regenerate(n.id,h.step.id,s.trim(),f[h.step.id])};return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsx)(aA,{title:n.title,description:n.description}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.shown.filter(e=>e.output).map(({step:t,output:s})=>{let c=!!n.edit&&t.type===`agent`&&t.output.format!==`json`;return(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.title}),(0,X.jsx)(`div`,{className:`flex items-center`,children:c&&!a[t.id]?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>({...e,[t.id]:!0})),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent hover:text-ink coarse:h-11`,children:[(0,X.jsx)(Qy,{className:`size-3.5`}),` `,Z(`run.edit`)]}):null})]}),(0,X.jsx)(PO,{base:`/api/runs/${e.id}`,step:t,output:s,editable:c&&a[t.id],draft:r[t.id],onDraft:e=>i(n=>({...n,[t.id]:e})),picked:f[t.id],onPick:n.regenerate?e=>{d(t.id),p(n=>{let r=n[t.id]??[];return{...n,[t.id]:r.includes(e)?r.filter(t=>t!==e):[...r,e]}}),m.current?.focus()}:void 0,onSurfaceAction:n.regenerate?()=>{d(t.id),m.current?.focus()}:void 0})]},t.id)}),e.lists.map(t=>(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.def.title}),t.def.check?(0,X.jsx)(Ik,{runId:e.id,list:t}):(0,X.jsx)(Nk,{runId:e.id,list:t,editable:!0})]},t.def.id)),n.regenerate&&l.length?(0,X.jsxs)(kS,{className:`p-3`,children:[l.length>1?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 pb-2`,children:[(0,X.jsx)(`span`,{className:`mr-1 text-[0.8125rem] text-ink-3`,children:Z(`run.feedbackTarget`)}),l.map(({step:e})=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>{d(e.id),m.current?.focus()},className:Q(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,u===e.id?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:e.title},e.id))]}):null,(0,X.jsx)(CS,{ref:m,minRows:2,maxRows:8,value:s,placeholder:Z(`run.feedbackPlaceholder`),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`border-0 bg-transparent shadow-none focus:ring-0`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pt-1`,children:[(0,X.jsx)(`span`,{className:`min-w-0 text-[0.75rem] text-ink-3`,children:g?f[h.step.id]?.length?Z(`run.regeneratePicked`,{n:[...f[h.step.id]].sort((e,t)=>e-t).map(e=>e+1).join(`, `)}):Z(`run.regenerateAll`):!h&&s.trim()?Z(`run.feedbackPick`):null}),(0,X.jsxs)(_S,{size:`sm`,variant:`secondary`,busy:t.busy,disabled:!s.trim()||!h,onClick:_,children:[(0,X.jsx)(nb,{className:`size-3.5`}),` `,Z(`run.regenerateGo`)]})]})]}):null]}),(0,X.jsx)(lA,{view:e,run:t,sticky:!0,children:(0,X.jsxs)(_S,{size:`lg`,busy:t.busy,onClick:()=>void t.accept(n.id,Object.keys(r).length?r:void 0),children:[Z(`run.accept`),` `,(0,X.jsx)(wv,{className:`size-4`})]})})]})}function mA({view:e,run:t,step:n,onRestart:r}){let i=e.shown.filter(e=>e.output);return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-x-4 gap-y-5`,children:[(0,X.jsx)(vw,{kind:e.wizard.avatar,size:64}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 basis-[12rem]`,children:[(0,X.jsx)(`h1`,{className:`text-balance font-display font-semibold text-[1.75rem] leading-tight tracking-tight sm:text-[2rem]`,children:n.title}),n.message?(0,X.jsx)(`p`,{className:`mt-1 text-[0.9375rem] text-ink-3`,children:n.message}):null]}),e.shown.some(e=>e.output)?(0,X.jsx)(`div`,{className:`max-sm:basis-full`,children:(0,X.jsx)(HO,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null})}):null]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i.map(({step:t,output:n,formats:r,label:i})=>(0,X.jsxs)(kS,{className:`p-4 sm:p-5`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:i??t.title}),(0,X.jsx)(zO,{base:`/api/runs/${e.id}`,stepId:t.id,formats:r,title:i??t.title})]}),(0,X.jsx)(PO,{base:`/api/runs/${e.id}`,step:t,output:n}),n?.assets?.some(e=>e.ai)?(0,X.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:Z(`ai.publish`)}):null]},t.id)),e.lists.map(t=>(0,X.jsxs)(kS,{className:`p-4 sm:p-5`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:t.label??t.def.title}),(0,X.jsx)(Rk,{runId:e.id,list:t})]}),(0,X.jsx)(Nk,{runId:e.id,list:t,editable:!0})]},t.def.id))]}),(0,X.jsx)(lA,{view:e,run:t,children:r?(0,X.jsxs)(_S,{variant:`secondary`,onClick:r,children:[(0,X.jsx)(ib,{className:`size-4`}),` `,Z(`run.again`)]}):(0,X.jsx)(`span`,{})})]})}function hA({view:e,run:t}){return(0,X.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-8 text-center`,children:[(0,X.jsx)(vw,{kind:e.wizard.avatar,size:90}),(0,X.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem]`,children:Z(`run.failed`)}),(0,X.jsx)(`p`,{className:`mt-2 max-w-md text-[0.9375rem] text-ink-3`,children:(0,X.jsx)(MS,{text:e.error??``})}),(0,X.jsxs)(`div`,{className:`mt-8 flex gap-3`,children:[e.canBack?(0,X.jsxs)(_S,{variant:`ghost`,onClick:()=>void t.back(),children:[(0,X.jsx)(Sv,{className:`size-4`}),` `,Z(`run.back`)]}):null,(0,X.jsxs)(_S,{onClick:()=>void t.retry(),busy:t.busy,children:[(0,X.jsx)(ib,{className:`size-4`}),` `,Z(`run.retry`)]})]})]})}function gA({runId:e,compact:t,onRestart:n,onView:r,stickyProgress:i}){let a=rA(e),{view:o}=a;(0,y.useEffect)(()=>{r?.(o)},[o,r]),JD();let s=YD(o?.status===`running`&&!o.ask);if(fA(o),a.notFound)return(0,X.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Z(`run.notFound`)});if(!o)return(0,X.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,X.jsx)(OS,{})});let c=o.step,l=null;if(o.status===`running`&&o.ask)l=(0,X.jsx)(UO,{runId:o.id,ask:o.ask},o.ask.id);else if(o.status===`running`)l=(0,X.jsx)(dA,{view:o,compact:t,awake:s});else if(o.status===`failed`)l=(0,X.jsx)(hA,{view:o,run:a});else if(o.status===`cancelled`)l=(0,X.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Z(`run.cancelled`)});else if(c?.type===`page`)l=(0,X.jsx)(cA,{view:o,run:a,step:c},c.id);else if(c?.type===`review`){let e=o.shown.map(e=>e.output?.at??``).join(`|`);l=(0,X.jsx)(pA,{view:o,run:a,step:c},`${c.id}:${e}`)}else c?.type===`result`&&(l=(0,X.jsx)(mA,{view:o,run:a,step:c,onRestart:n}));let u=c?.type===`review`&&o.status===`waiting_input`&&o.lists.some(e=>e.def.check);return(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col`,children:[i?(0,X.jsx)(`div`,{className:`sticky top-0 z-10`,children:(0,X.jsx)(iA,{view:o})}):(0,X.jsx)(iA,{view:o}),(0,X.jsxs)(`div`,{className:Q(`safe-x mx-auto w-full flex-1`,u?`max-w-[1240px] py-8`:t?`max-w-[620px] py-8`:`max-w-[640px] py-8 sm:py-16`),children:[l,a.error&&o.status!==`failed`?(0,X.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:a.error}):null,o.keeps&&o.status!==`running`?(0,X.jsx)(`div`,{className:`mt-10 flex justify-center`,children:(0,X.jsx)(Bk,{runId:o.id})}):null]})]})}var _A=Object.defineProperty,vA=(e,t,n)=>t in e?_A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yA=(e,t)=>{for(var n in t)_A(e,n,{get:t[n],enumerable:!0})},bA=(e,t,n)=>vA(e,typeof t==`symbol`?t:t+``,n),xA={};yA(xA,{Graph:()=>oj,alg:()=>PA});var SA=Object.defineProperty,CA=(e,t)=>{for(var n in t)SA(e,n,{get:t[n],enumerable:!0})},wA=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=DA(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=OA(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,TA(this._preds[a],i),TA(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?kA(this._isDirected,e):DA(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?kA(this._isDirected,e):DA(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?kA(this._isDirected,e):DA(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],EA(this._preds[t],e),EA(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function TA(e,t){e[t]?e[t]++:e[t]=1}function EA(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function DA(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function OA(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function kA(e,t){return DA(e,t.v,t.w,t.name)}CA({},{read:()=>NA,write:()=>AA});function AA(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:jA(e),edges:MA(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function jA(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function MA(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function NA(e){let t=new wA(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var PA={};CA(PA,{CycleException:()=>YA,bellmanFord:()=>IA,components:()=>RA,dijkstra:()=>VA,dijkstraAll:()=>UA,findCycles:()=>GA,floydWarshall:()=>qA,isAcyclic:()=>ZA,postorder:()=>tj,preorder:()=>nj,prim:()=>rj,shortestPaths:()=>ij,tarjan:()=>WA,topsort:()=>XA});var FA=()=>1;function IA(e,t,n,r){return LA(e,String(t),n||FA,r||function(t){return e.outEdges(t)??[]})}function LA(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function RA(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var zA=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},BA=()=>1;function VA(e,t,n,r){return HA(e,String(t),n||BA,r||function(t){return e.outEdges(t)??[]})}function HA(e,t,n,r){let i={},a=new zA,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function UA(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=VA(e,i,t,n),r},{})}function WA(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function GA(e){return WA(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var KA=()=>1;function qA(e,t,n){return JA(e,t||KA,n||function(t){return e.outEdges(t)??[]})}function JA(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var YA=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function XA(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new YA;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new YA;return r}function ZA(e){try{XA(e)}catch(e){if(e instanceof YA)return!1;throw e}return!0}function QA(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=$A(e,t,n===`post`,o,a,r,i)}),i}function $A(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=$A(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function ej(e,t,n){return QA(e,t,n,function(e,t){return e.push(t),e},[])}function tj(e,t){return ej(e,t,`post`)}function nj(e,t){return ej(e,t,`pre`)}function rj(e,t){var n;let r=new wA,i={},a=new zA,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function ij(e,t,n,r){return aj(e,t,n,r??(t=>e.outEdges(t)??[]))}function aj(e,t,n,r){if(n===void 0)return VA(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return IA(e,t,n,r)}return VA(e,t,n,r)}var oj=wA;function sj(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Cj(r);return n.dummy=t,e.setNode(i,n),i}function cj(e){let t=new oj().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function lj(e){let t=new oj({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function uj(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function dj(e){let t=wj(vj(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function fj(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=_j(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function pj(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=_j(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function mj(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),sj(e,`border`,i,t)}function hj(e,t=gj){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var gj=65535;function _j(e,t){return t.length>gj?e(...hj(t).map(t=>e(...t))):e(...t)}function vj(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return _j(Math.max,t)}function yj(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function bj(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function xj(e,t){return t()}var Sj=0;function Cj(e){return e+(``+ ++Sj)}function wj(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Tj(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Ej(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Dj(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var Oj=`\0`;function kj(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var Aj=`3.1.1`,jj=class{constructor(){bA(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Mj(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Mj(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Nj)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Mj(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Nj(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Pj=jj,Fj=()=>1;function Ij(e,t){if(e.nodeCount()<=1)return[];let n=zj(e,t||Fj);return Lj(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Lj(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Rj(e,t,n,o);for(;o=i.dequeue();)Rj(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(Rj(e,t,n,o,!0)||[]);break}}}return r}function Rj(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Bj(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Bj(t,n,o)}),e.removeNode(r.v),o}function zj(e,t){let n=new oj,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Vj(i+r+3).map(()=>new Pj),o=r+1;return n.nodes().forEach(e=>{Bj(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Bj(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Vj(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Hj(e,t){(e.graph().acyclicer===`greedy`?Ij(e,n(e)):Uj(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Cj(`rev`))});function n(e){return t=>e.edge(t).weight}}function Uj(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Gj(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Wj(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Gj(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function Kj(e){e.graph().dummyChains=[],e.edges().forEach(t=>qj(e,t))}function qj(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=sj(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Jj(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Yj(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=_j(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function Xj(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Zj=Qj;function Qj(e){let t=new oj({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;$j(t,e)<i&&(a=eM(t,e),a);)o=t.hasNode(a.v)?Xj(e,a):-Xj(e,a),tM(t,e,o);return t}function $j(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Xj(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function eM(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=Xj(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function tM(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:nM,postorder:rM}=PA,iM=aM;aM.initLowLimValues=lM,aM.initCutValues=oM,aM.calcCutValue=cM,aM.leaveEdge=dM,aM.enterEdge=fM,aM.exchangeEdges=pM;function aM(e){e=cj(e),Yj(e);let t=Zj(e);lM(t),oM(t,e);let n,r;for(;n=dM(t);)r=fM(t,e,n),pM(t,e,n,r)}function oM(e,t){let n=rM(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>sM(e,t,n))}function sM(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=cM(e,t,n)}function cM(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,hM(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function lM(e,t){arguments.length<2&&(t=e.nodes()[0]),uM(e,{},1,t)}function uM(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=uM(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function dM(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function fM(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===gM(e,e.node(t.v),s)&&c!==gM(e,e.node(t.w),s)).reduce((e,n)=>Xj(t,n)<Xj(t,e)?n:e)}function pM(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),lM(e),oM(e,t),mM(e,t)}function mM(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=nM(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function hM(e,t,n){return e.hasEdge(t,n)}function gM(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var _M=vM;function vM(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:xM(e);break;case`tight-tree`:bM(e);break;case`longest-path`:yM(e);break;case`none`:break;default:xM(e)}}var yM=Yj;function bM(e){Yj(e),Zj(e)}function xM(e){iM(e)}var SM=CM;function CM(e){let t=TM(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=wM(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function wM(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function TM(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(Oj).forEach(r),t}function EM(e){let t=sj(e,`root`,{},`_root`),n=OM(e),r=Object.values(n),i=_j(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=kM(e)+1;e.children(Oj).forEach(r=>{DM(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function DM(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=mj(e,`_bt`),l=mj(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{DM(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function OM(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(Oj).forEach(e=>n(e,1)),t}function kM(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function AM(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var jM=MM;function MM(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)NM(e,`borderLeft`,`_bl`,n,i,t),NM(e,`borderRight`,`_br`,n,i,t)}}e.children(Oj).forEach(t)}function NM(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=sj(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function PM(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&IM(e)}function FM(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&RM(e),(t===`lr`||t===`rl`)&&(BM(e),IM(e))}function IM(e){e.nodes().forEach(t=>LM(e.node(t))),e.edges().forEach(t=>LM(e.edge(t)))}function LM(e){let t=e.width;e.width=e.height,e.height=t}function RM(e){e.nodes().forEach(t=>zM(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(zM),Object.hasOwn(r,`y`)&&zM(r)})}function zM(e){e.y=-e.y}function BM(e){e.nodes().forEach(t=>VM(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(VM),Object.hasOwn(r,`x`)&&VM(r)})}function VM(e){let t=e.x;e.x=e.y,e.y=t}function HM(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=wj(_j(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return kj(t,e.node(n),e.node(r))}return a}function UM(e,t){let n=0;for(let r=1;r<t.length;++r)n+=WM(e,t[r-1],t[r]);return n}function WM(e,t,n){let r=Dj(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function GM(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function KM(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),qM(Object.values(n).filter(e=>!e.indegree))}function qM(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&JM(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Tj(e,[`vs`,`i`,`barycenter`,`weight`]))}function JM(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function YM(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=yj(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(ZM(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=XM(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=XM(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function XM(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function ZM(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=kj(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function QM(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=GM(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=QM(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&eN(t,r)}});let h=KM(m,n);$M(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=YM(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function $M(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function eN(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function tN(e,t,n,r){r||=e.nodes();let i=nN(e),a=new oj({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function nN(e){let t;for(;e.hasNode(t=Cj(`_root`)););return t}function rN(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function iN(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,iN);return}let r=vj(e),i=aN(e,wj(1,r+1),`inEdges`),a=aN(e,wj(r-1,-1,-1),`outEdges`),o=HM(e,n);if(sN(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){oN(t%2?i:a,t%4>=2,l,n),o=dj(e);let u=UM(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}sN(e,c)}function aN(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return tN(e,t,n,r.get(t)||[])})}function oN(e,t,n,r){let i=!0,a=new oj;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=QM(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),rN(e,a,s.vs)})}function sN(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function cN(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=uN(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&dN(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function lN(e,t){let n={};function r(t,r,i,a,o){wj(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&dN(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function uN(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function dN(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function fN(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function pN(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||SN(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>SN(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!fN(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function mN(e,t,n,r,i=!1){let a={},o=hN(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function hN(e,t,n,r){let i=new oj,a=e.graph(),o=bN(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function gN(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=xN(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function _N(e,t){let n=Object.values(t),r=_j(Math.min,n),i=_j(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-_j(Math.min,c);a!==`l`&&(l=i-_j(Math.max,c)),l&&(e[o]=Ej(s,e=>e+l))})})}function vN(e,t=void 0){let n=e.ul;return n?Ej(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function yN(e,t){let n=dj(e),r=Object.assign(cN(e,n),lN(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=pN(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=mN(e,a,s.root,s.align,n===`r`);n===`r`&&(c=Ej(c,e=>-e)),i[o+n]=c})}),_N(i,gN(e,i)),vN(i,e.graph().align)}function bN(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function xN(e,t){return e.node(t).width}function SN(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function CN(e,t){e=lj(e),wN(e),Object.entries(yN(e,t)).forEach(([t,n])=>e.node(t).x=n)}function wN(e){let t=dj(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var TN=new WeakMap;function EN(e,t={}){return ON(e,xj,t),e}function DN(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function ON(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new oj({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=DN(e,t.v,r),i=DN(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),ON(o,t,n);let l=zN(o);kN(l,t,n,null),AN(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=zN(e),g=kN(h,t,n,TN.get(e)??null);TN.set(e,g),AN(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function kN(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>BN(e)),t(` removeSelfEdges`,()=>YN(e)),t(` acyclic`,()=>Hj(e,s)),t(` nestingGraph.run`,()=>EM(e)),t(` rank`,()=>_M(lj(e))),t(` injectEdgeLabelProxies`,()=>VN(e)),t(` removeEmptyRanks`,()=>pj(e)),t(` nestingGraph.cleanup`,()=>AM(e)),t(` normalizeRanks`,()=>fj(e)),t(` assignRankMinMax`,()=>HN(e)),t(` removeEdgeLabelProxies`,()=>UN(e)),t(` normalize.run`,()=>Kj(e)),t(` parentDummyChains`,()=>SM(e)),t(` addBorderSegments`,()=>jM(e)),t(` order`,()=>iN(e,n,c)),t(` insertSelfEdges`,()=>XN(e)),t(` adjustCoordinateSystem`,()=>PM(e)),t(` position`,()=>CN(e,n.corePath)),t(` positionSelfEdges`,()=>ZN(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>JN(e)),t(` normalize.undo`,()=>Jj(e)),t(` fixupEdgeLabelCoords`,()=>KN(e)),t(` undoCoordinateSystem`,()=>FM(e)),t(` translateGraph`,()=>WN(e)),t(` assignNodeIntersects`,()=>GN(e)),t(` reversePoints`,()=>qN(e)),t(` acyclic.undo`,()=>Wj(e)),{graph:e,rawNodes:l}}function AN(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var jN=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],MN={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},NN=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],PN=[`width`,`height`,`rank`],FN={width:0,height:0},IN=[`minlen`,`weight`,`width`,`height`,`labeloffset`],LN={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},RN=[`labelpos`];function zN(e){let t=new oj({multigraph:!0,compound:!0}),n=$N(e.graph());return t.setGraph(Object.assign({},MN,QN(n,jN),Tj(n,NN))),e.nodes().forEach(n=>{let r=QN($N(e.node(n)),PN);Object.keys(FN).forEach(e=>{r[e]===void 0&&(r[e]=FN[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=$N(e.edge(n));t.setEdge(n,Object.assign({},LN,QN(r,IN),Tj(r,RN)))}),t}function BN(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function VN(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);sj(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function HN(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function UN(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function WN(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function GN(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(uj(r,a)),n.points.push(uj(i,o))})}function KN(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function qN(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function JN(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function YN(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function XN(e){dj(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{sj(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function ZN(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function QN(e,t){return Ej(Tj(e,t),Number)}function $N(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function eP(e){let t=dj(e),n=new oj({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var tP={graphlib:xA,version:Aj,layout:EN,debug:eP,util:{time:bj,notime:xj}};function nP(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=nP(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var rP={value:()=>{}};function iP(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new aP(n)}function aP(e){this._=e}function oP(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}aP.prototype=iP.prototype={constructor:aP,on:function(e,t){var n=this._,r=oP(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=sP(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=cP(n[i],e.name,t);else if(t==null)for(i in n)n[i]=cP(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new aP(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function sP(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function cP(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=rP,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var lP={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function uP(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),lP.hasOwnProperty(t)?{space:lP[t],local:e}:e}function dP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function fP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pP(e){var t=uP(e);return(t.local?fP:dP)(t)}function mP(){}function hP(e){return e==null?mP:function(){return this.querySelector(e)}}function gP(e){typeof e!=`function`&&(e=hP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new iI(r,this._parents)}function _P(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vP(){return[]}function yP(e){return e==null?vP:function(){return this.querySelectorAll(e)}}function bP(e){return function(){return _P(e.apply(this,arguments))}}function xP(e){e=typeof e==`function`?bP(e):yP(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new iI(r,i)}function SP(e){return function(){return this.matches(e)}}function CP(e){return function(t){return t.matches(e)}}var wP=Array.prototype.find;function TP(e){return function(){return wP.call(this.children,e)}}function EP(){return this.firstElementChild}function DP(e){return this.select(e==null?EP:TP(typeof e==`function`?e:CP(e)))}var OP=Array.prototype.filter;function kP(){return Array.from(this.children)}function AP(e){return function(){return OP.call(this.children,e)}}function jP(e){return this.selectAll(e==null?kP:AP(typeof e==`function`?e:CP(e)))}function MP(e){typeof e!=`function`&&(e=SP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new iI(r,this._parents)}function NP(e){return Array(e.length)}function PP(){return new iI(this._enter||this._groups.map(NP),this._parents)}function FP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}FP.prototype={constructor:FP,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function IP(e){return function(){return e}}function LP(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new FP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function RP(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new FP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function zP(e){return e.__data__}function BP(e,t){if(!arguments.length)return Array.from(this,zP);var n=t?RP:LP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=IP(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=VP(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new iI(o,r),o._enter=s,o._exit=c,o}function VP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function HP(){return new iI(this._exit||this._groups.map(NP),this._parents)}function UP(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function WP(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new iI(s,this._parents)}function GP(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function KP(e){e||=qP;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new iI(i,this._parents).order()}function qP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function JP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function YP(){return Array.from(this)}function XP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function ZP(){let e=0;for(let t of this)++e;return e}function QP(){return!this.node()}function $P(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function eF(e){return function(){this.removeAttribute(e)}}function tF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nF(e,t){return function(){this.setAttribute(e,t)}}function rF(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function iF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function aF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function oF(e,t){var n=uP(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?tF:eF:typeof t==`function`?n.local?aF:iF:n.local?rF:nF)(n,t))}function sF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function cF(e){return function(){this.style.removeProperty(e)}}function lF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function uF(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dF(e,t,n){return arguments.length>1?this.each((t==null?cF:typeof t==`function`?uF:lF)(e,t,n??``)):fF(this.node(),e)}function fF(e,t){return e.style.getPropertyValue(t)||sF(e).getComputedStyle(e,null).getPropertyValue(t)}function pF(e){return function(){delete this[e]}}function mF(e,t){return function(){this[e]=t}}function hF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gF(e,t){return arguments.length>1?this.each((t==null?pF:typeof t==`function`?hF:mF)(e,t)):this.node()[e]}function _F(e){return e.trim().split(/^|\s+/)}function vF(e){return e.classList||new yF(e)}function yF(e){this._node=e,this._names=_F(e.getAttribute(`class`)||``)}yF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function bF(e,t){for(var n=vF(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xF(e,t){for(var n=vF(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function SF(e){return function(){bF(this,e)}}function CF(e){return function(){xF(this,e)}}function wF(e,t){return function(){(t.apply(this,arguments)?bF:xF)(this,e)}}function TF(e,t){var n=_F(e+``);if(arguments.length<2){for(var r=vF(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?wF:t?SF:CF)(n,t))}function EF(){this.textContent=``}function DF(e){return function(){this.textContent=e}}function OF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function kF(e){return arguments.length?this.each(e==null?EF:(typeof e==`function`?OF:DF)(e)):this.node().textContent}function AF(){this.innerHTML=``}function jF(e){return function(){this.innerHTML=e}}function MF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function NF(e){return arguments.length?this.each(e==null?AF:(typeof e==`function`?MF:jF)(e)):this.node().innerHTML}function PF(){this.nextSibling&&this.parentNode.appendChild(this)}function FF(){return this.each(PF)}function IF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function LF(){return this.each(IF)}function RF(e){var t=typeof e==`function`?e:pP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function zF(){return null}function BF(e,t){var n=typeof e==`function`?e:pP(e),r=t==null?zF:typeof t==`function`?t:hP(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function VF(){var e=this.parentNode;e&&e.removeChild(this)}function HF(){return this.each(VF)}function UF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GF(e){return this.select(e?WF:UF)}function KF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function qF(e){return function(t){e.call(this,t,this.__data__)}}function JF(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function YF(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function XF(e,t,n){return function(){var r=this.__on,i,a=qF(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function ZF(e,t,n){var r=JF(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?XF:YF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function QF(e,t,n){var r=sF(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function $F(e,t){return function(){return QF(this,e,t)}}function eI(e,t){return function(){return QF(this,e,t.apply(this,arguments))}}function tI(e,t){return this.each((typeof t==`function`?eI:$F)(e,t))}function*nI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var rI=[null];function iI(e,t){this._groups=e,this._parents=t}function aI(){return new iI([[document.documentElement]],rI)}function oI(){return this}iI.prototype=aI.prototype={constructor:iI,select:gP,selectAll:xP,selectChild:DP,selectChildren:jP,filter:MP,data:BP,enter:PP,exit:HP,join:UP,merge:WP,selection:oI,order:GP,sort:KP,call:JP,nodes:YP,node:XP,size:ZP,empty:QP,each:$P,attr:oF,style:dF,property:gF,classed:TF,text:kF,html:NF,raise:FF,lower:LF,append:RF,insert:BF,remove:HF,clone:GF,datum:KF,on:ZF,dispatch:tI,[Symbol.iterator]:nI};function sI(e){return typeof e==`string`?new iI([[document.querySelector(e)]],[document.documentElement]):new iI([[e]],rI)}function cI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function lI(e,t){if(e=cI(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var uI={passive:!1},dI={capture:!0,passive:!1};function fI(e){e.stopImmediatePropagation()}function pI(e){e.preventDefault(),e.stopImmediatePropagation()}function mI(e){var t=e.document.documentElement,n=sI(e).on(`dragstart.drag`,pI,dI);`onselectstart`in t?n.on(`selectstart.drag`,pI,dI):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function hI(e,t){var n=e.document.documentElement,r=sI(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,pI,dI),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var gI=e=>()=>e;function _I(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}_I.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vI(e){return!e.ctrlKey&&!e.button}function yI(){return this.parentNode}function bI(e,t){return t??{x:e.x,y:e.y}}function xI(){return navigator.maxTouchPoints||`ontouchstart`in this}function SI(){var e=vI,t=yI,n=bI,r=xI,i={},a=iP(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,uI).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(sI(n.view).on(`mousemove.drag`,m,dI).on(`mouseup.drag`,h,dI),mI(n.view),fI(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(pI(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){sI(e.view).on(`mousemove.drag mouseup.drag`,null),hI(e.view,l),pI(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(fI(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(pI(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(fI(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=lI(l||r,t),p,m,h;if((h=n.call(e,new _I(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=lI(l||a,t),_=o}u.call(r,e,new _I(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:gI(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:gI(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:gI(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:gI(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function CI(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function TI(){}var EI=.7,DI=1/EI,OI=`\\s*([+-]?\\d+)\\s*`,kI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,AI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,jI=/^#([0-9a-f]{3,8})$/,MI=RegExp(`^rgb\\(${OI},${OI},${OI}\\)$`),NI=RegExp(`^rgb\\(${AI},${AI},${AI}\\)$`),PI=RegExp(`^rgba\\(${OI},${OI},${OI},${kI}\\)$`),FI=RegExp(`^rgba\\(${AI},${AI},${AI},${kI}\\)$`),II=RegExp(`^hsl\\(${kI},${AI},${AI}\\)$`),LI=RegExp(`^hsla\\(${kI},${AI},${AI},${kI}\\)$`),RI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};CI(TI,UI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zI,formatHex:zI,formatHex8:BI,formatHsl:VI,formatRgb:HI,toString:HI});function zI(){return this.rgb().formatHex()}function BI(){return this.rgb().formatHex8()}function VI(){return nL(this).formatHsl()}function HI(){return this.rgb().formatRgb()}function UI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=jI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?WI(t):n===3?new JI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?GI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?GI(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=MI.exec(e))?new JI(t[1],t[2],t[3],1):(t=NI.exec(e))?new JI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=PI.exec(e))?GI(t[1],t[2],t[3],t[4]):(t=FI.exec(e))?GI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=II.exec(e))?tL(t[1],t[2]/100,t[3]/100,1):(t=LI.exec(e))?tL(t[1],t[2]/100,t[3]/100,t[4]):RI.hasOwnProperty(e)?WI(RI[e]):e===`transparent`?new JI(NaN,NaN,NaN,0):null}function WI(e){return new JI(e>>16&255,e>>8&255,e&255,1)}function GI(e,t,n,r){return r<=0&&(e=t=n=NaN),new JI(e,t,n,r)}function KI(e){return e instanceof TI||(e=UI(e)),e?(e=e.rgb(),new JI(e.r,e.g,e.b,e.opacity)):new JI}function qI(e,t,n,r){return arguments.length===1?KI(e):new JI(e,t,n,r??1)}function JI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}CI(JI,qI,wI(TI,{brighter(e){return e=e==null?DI:DI**+e,new JI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?EI:EI**+e,new JI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new JI($I(this.r),$I(this.g),$I(this.b),QI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:YI,formatHex:YI,formatHex8:XI,formatRgb:ZI,toString:ZI}));function YI(){return`#${eL(this.r)}${eL(this.g)}${eL(this.b)}`}function XI(){return`#${eL(this.r)}${eL(this.g)}${eL(this.b)}${eL((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZI(){let e=QI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${$I(this.r)}, ${$I(this.g)}, ${$I(this.b)}${e===1?`)`:`, ${e})`}`}function QI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $I(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eL(e){return e=$I(e),(e<16?`0`:``)+e.toString(16)}function tL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new iL(e,t,n,r)}function nL(e){if(e instanceof iL)return new iL(e.h,e.s,e.l,e.opacity);if(e instanceof TI||(e=UI(e)),!e)return new iL;if(e instanceof iL)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new iL(o,s,c,e.opacity)}function rL(e,t,n,r){return arguments.length===1?nL(e):new iL(e,t,n,r??1)}function iL(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}CI(iL,rL,wI(TI,{brighter(e){return e=e==null?DI:DI**+e,new iL(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?EI:EI**+e,new iL(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new JI(sL(e>=240?e-240:e+120,i,r),sL(e,i,r),sL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new iL(aL(this.h),oL(this.s),oL(this.l),QI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=QI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${aL(this.h)}, ${oL(this.s)*100}%, ${oL(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function aL(e){return e=(e||0)%360,e<0?e+360:e}function oL(e){return Math.max(0,Math.min(1,e||0))}function sL(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var cL=e=>()=>e;function lL(e,t){return function(n){return e+n*t}}function uL(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function dL(e){return(e=+e)==1?fL:function(t,n){return n-t?uL(t,n,e):cL(isNaN(t)?n:t)}}function fL(e,t){var n=t-e;return n?lL(e,n):cL(isNaN(e)?t:e)}var pL=(function e(t){var n=dL(t);function r(e,t){var r=n((e=qI(e)).r,(t=qI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=fL(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function mL(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function hL(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gL(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=TL(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function _L(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function vL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function yL(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=TL(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var bL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xL=new RegExp(bL.source,`g`);function SL(e){return function(){return e}}function CL(e){return function(t){return e(t)+``}}function wL(e,t){var n=bL.lastIndex=xL.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=bL.exec(e))&&(i=xL.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:vL(r,i)})),n=xL.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?CL(c[0].x):SL(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function TL(e,t){var n=typeof t,r;return t==null||n===`boolean`?cL(t):(n===`number`?vL:n===`string`?(r=UI(t))?(t=r,pL):wL:t instanceof UI?pL:t instanceof Date?_L:hL(t)?mL:Array.isArray(t)?gL:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?yL:vL)(e,t)}var EL=180/Math.PI,DL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function OL(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*EL,skewX:Math.atan(c)*EL,scaleX:o,scaleY:s}}var kL;function AL(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?DL:OL(t.a,t.b,t.c,t.d,t.e,t.f)}function jL(e){return e==null||(kL||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),kL.setAttribute(`transform`,e),!(e=kL.transform.baseVal.consolidate()))?DL:(e=e.matrix,OL(e.a,e.b,e.c,e.d,e.e,e.f))}function ML(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:vL(e,i)},{i:c-2,x:vL(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:vL(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:vL(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:vL(e,n)},{i:s-2,x:vL(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var NL=ML(AL,`px, `,`px)`,`deg)`),PL=ML(jL,`, `,`)`,`)`),FL=1e-12;function IL(e){return((e=Math.exp(e))+1/e)/2}function LL(e){return((e=Math.exp(e))-1/e)/2}function RL(e){return((e=Math.exp(2*e))-1)/(e+1)}var zL=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<FL)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=IL(y),c=s/(n*g)*(i*RL(t*r+y)-LL(y));return[a+c*d,o+c*f,s*i/IL(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),BL=0,VL=0,HL=0,UL=1e3,WL,GL,KL=0,qL=0,JL=0,YL=typeof performance==`object`&&performance.now?performance:Date,XL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ZL(){return qL||=(XL(QL),YL.now()+JL)}function QL(){qL=0}function $L(){this._call=this._time=this._next=null}$L.prototype=eR.prototype={constructor:$L,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?ZL():+n)+(t==null?0:+t),!this._next&&GL!==this&&(GL?GL._next=this:WL=this,GL=this),this._call=e,this._time=n,aR()},stop:function(){this._call&&(this._call=null,this._time=1/0,aR())}};function eR(e,t,n){var r=new $L;return r.restart(e,t,n),r}function tR(){ZL(),++BL;for(var e=WL,t;e;)(t=qL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--BL}function nR(){qL=(KL=YL.now())+JL,BL=VL=0;try{tR()}finally{BL=0,iR(),qL=0}}function rR(){var e=YL.now(),t=e-KL;t>UL&&(JL-=t,KL=e)}function iR(){for(var e,t=WL,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:WL=n);GL=e,aR(r)}function aR(e){BL||(VL&&=clearTimeout(VL),e-qL>24?(e<1/0&&(VL=setTimeout(nR,e-YL.now()-JL)),HL&&=clearInterval(HL)):(HL||=(KL=YL.now(),setInterval(rR,UL)),BL=1,XL(nR)))}function oR(e,t,n){var r=new $L;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var sR=iP(`start`,`end`,`cancel`,`interrupt`),cR=[];function lR(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;pR(e,n,{name:t,index:r,group:i,on:sR,tween:cR,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function uR(e,t){var n=fR(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function dR(e,t){var n=fR(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function fR(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function pR(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=eR(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return oR(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(oR(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function mR(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function hR(e){return this.each(function(){mR(this,e)})}function gR(e,t){var n,r;return function(){var i=dR(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function _R(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=dR(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function vR(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=fR(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?gR:_R)(n,e,t))}function yR(e,t,n){var r=e._id;return e.each(function(){var e=dR(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return fR(e,r).value[t]}}function bR(e,t){var n;return(typeof t==`number`?vL:t instanceof UI?pL:(n=UI(t))?(t=n,pL):wL)(e,t)}function xR(e){return function(){this.removeAttribute(e)}}function SR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function wR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function TR(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ER(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function DR(e,t){var n=uP(e),r=n===`transform`?PL:bR;return this.attrTween(e,typeof t==`function`?(n.local?ER:TR)(n,r,yR(this,`attr.`+e,t)):t==null?(n.local?SR:xR)(n):(n.local?wR:CR)(n,r,t))}function OR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function kR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kR(e,i)),n}return i._value=t,i}function jR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&OR(e,i)),n}return i._value=t,i}function MR(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=uP(e);return this.tween(n,(r.local?AR:jR)(r,t))}function NR(e,t){return function(){uR(this,e).delay=+t.apply(this,arguments)}}function PR(e,t){return t=+t,function(){uR(this,e).delay=t}}function FR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?NR:PR)(t,e)):fR(this.node(),t).delay}function IR(e,t){return function(){dR(this,e).duration=+t.apply(this,arguments)}}function LR(e,t){return t=+t,function(){dR(this,e).duration=t}}function RR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?IR:LR)(t,e)):fR(this.node(),t).duration}function zR(e,t){if(typeof t!=`function`)throw Error();return function(){dR(this,e).ease=t}}function BR(e){var t=this._id;return arguments.length?this.each(zR(t,e)):fR(this.node(),t).ease}function VR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();dR(this,e).ease=n}}function HR(e){if(typeof e!=`function`)throw Error();return this.each(VR(this._id,e))}function UR(e){typeof e!=`function`&&(e=SP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new vz(r,this._parents,this._name,this._id)}function WR(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new vz(o,this._parents,this._name,this._id)}function GR(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function KR(e,t,n){var r,i,a=GR(t)?uR:dR;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function qR(e,t){var n=this._id;return arguments.length<2?fR(this.node(),n).on.on(e):this.each(KR(n,e,t))}function JR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function YR(){return this.on(`end.remove`,JR(this._id))}function XR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=hP(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,lR(l[f],t,n,f,l,fR(u,n)));return new vz(a,this._parents,t,n)}function ZR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=yP(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=fR(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&lR(p,t,n,h,f,m);a.push(f),o.push(u)}return new vz(a,o,t,n)}var QR=aI.prototype.constructor;function $R(){return new QR(this._groups,this._parents)}function ez(e,t){var n,r,i;return function(){var a=fF(this,e),o=(this.style.removeProperty(e),fF(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function tz(e){return function(){this.style.removeProperty(e)}}function nz(e,t,n){var r,i=n+``,a;return function(){var o=fF(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function rz(e,t,n){var r,i,a;return function(){var o=fF(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),fF(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function iz(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=dR(this,e),l=c.on,u=c.value[a]==null?s||=tz(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function az(e,t,n){var r=(e+=``)==`transform`?NL:bR;return t==null?this.styleTween(e,ez(e,r)).on(`end.style.`+e,tz(e)):typeof t==`function`?this.styleTween(e,rz(e,r,yR(this,`style.`+e,t))).each(iz(this._id,e)):this.styleTween(e,nz(e,r,t),n).on(`end.style.`+e,null)}function oz(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function sz(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&oz(e,a,n)),r}return a._value=t,a}function cz(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,sz(e,t,n??``))}function lz(e){return function(){this.textContent=e}}function uz(e){return function(){var t=e(this);this.textContent=t??``}}function dz(e){return this.tween(`text`,typeof e==`function`?uz(yR(this,`text`,e)):lz(e==null?``:e+``))}function fz(e){return function(t){this.textContent=e.call(this,t)}}function pz(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&fz(r)),t}return r._value=e,r}function mz(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,pz(e))}function hz(){for(var e=this._name,t=this._id,n=yz(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=fR(c,t);lR(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new vz(r,this._parents,e,n)}function gz(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=dR(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var _z=0;function vz(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function yz(){return++_z}var bz=aI.prototype;vz.prototype={constructor:vz,select:XR,selectAll:ZR,selectChild:bz.selectChild,selectChildren:bz.selectChildren,filter:UR,merge:WR,selection:$R,transition:hz,call:bz.call,nodes:bz.nodes,node:bz.node,size:bz.size,empty:bz.empty,each:bz.each,on:qR,attr:DR,attrTween:MR,style:az,styleTween:cz,text:dz,textTween:mz,remove:YR,tween:vR,delay:FR,duration:RR,ease:BR,easeVarying:HR,end:gz,[Symbol.iterator]:bz[Symbol.iterator]};function xz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Sz={time:null,delay:0,duration:250,ease:xz};function Cz(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function wz(e){var t,n;e instanceof vz?(t=e._id,e=e._name):(t=yz(),(n=Sz).time=ZL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&lR(c,e,t,l,o,n||Cz(c,t));return new vz(r,this._parents,e,t)}aI.prototype.interrupt=hR,aI.prototype.transition=wz;var Tz=e=>()=>e;function Ez(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Dz(e,t,n){this.k=e,this.x=t,this.y=n}Dz.prototype={constructor:Dz,scale:function(e){return e===1?this:new Dz(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Dz(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Oz=new Dz(1,0,0);kz.prototype=Dz.prototype;function kz(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Oz;return e.__zoom}function Az(e){e.stopImmediatePropagation()}function jz(e){e.preventDefault(),e.stopImmediatePropagation()}function Mz(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Nz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Pz(){return this.__zoom||Oz}function Fz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Iz(){return navigator.maxTouchPoints||`ontouchstart`in this}function Lz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Rz(){var e=Mz,t=Nz,n=Lz,r=Fz,i=Iz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=zL,l=iP(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Pz).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,O).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Pz),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Oz.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Dz(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Dz(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Dz(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=sI(this.that).datum();l.call(e,this.that,new Ez(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=lI(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],mR(this),s.start();jz(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=sI(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=lI(t,i),l=t.clientX,u=t.clientY;mI(t.view),Az(t),a.mouse=[c,this.__zoom.invert(c)],mR(this),a.start();function d(e){if(jz(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=lI(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),hI(e.view,a.moved),jz(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=lI(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);jz(r),s>0?sI(this).transition().duration(s).call(x,d,c,r):sI(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Az(t),s=0;s<i;++s)c=r[s],l=lI(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),mR(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(jz(e),s=0;s<a;++s)c=i[s],l=lI(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function O(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Az(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=lI(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=sI(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Tz(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Tz(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Tz(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Tz([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var zz={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Bz=[[-1/0,-1/0],[1/0,1/0]],Vz=[`Enter`,` `,`Escape`],Hz={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Uz;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Uz||={});var Wz;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Wz||={});var Gz;(function(e){e.Partial=`partial`,e.Full=`full`})(Gz||={});var Kz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},qz;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(qz||={});var Jz;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Jz||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var Yz={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},Xz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Zz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),Qz=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),$z=(e,t=[0,0])=>{let{width:n,height:r}=NB(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},eB=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):Qz(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,pB(e,_B(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?hB(r):{x:0,y:0,width:0,height:0}},tB=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=pB(n,_B(e)),r=!0)}),r?hB(n):{x:0,y:0,width:0,height:0}},nB=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=yB(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},rB=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function iB(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=NB(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function aB({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=AB(tB(iB(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function oB({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,zz.error005());else{let{width:e,height:t}=NB(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&MB(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=MB(d)?lB(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,zz.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function sB({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=rB(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var cB=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),lB=(e={x:0,y:0},t,n)=>({x:cB(e.x,t[0][0],t[1][0]-(n?.width??0)),y:cB(e.y,t[0][1],t[1][1]-(n?.height??0))});function uB(e,t,n){let{width:r,height:i}=NB(n),{x:a,y:o}=n.internals.positionAbsolute;return lB(e,[[a,o],[a+r,o+i]],t)}var dB=(e,t,n)=>e<t?cB(Math.abs(e-t),1,t)/t:e>n?-cB(Math.abs(e-n),1,t)/t:0,fB=(e,t,n=15,r=40)=>[dB(e.x,r,t.width-r)*n,dB(e.y,r,t.height-r)*n],pB=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),mB=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),hB=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gB=(e,t=[0,0])=>{let{x:n,y:r}=Qz(e)?e.internals.positionAbsolute:$z(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},_B=(e,t=[0,0])=>{let{x:n,y:r}=Qz(e)?e.internals.positionAbsolute:$z(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},vB=(e,t)=>hB(pB(mB(e),mB(t))),yB=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},bB=(e,t)=>yB(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),xB=e=>SB(e.width)&&SB(e.height)&&SB(e.x)&&SB(e.y),SB=e=>!isNaN(e)&&isFinite(e),CB=(e,t)=>(e,t)=>{},wB=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),TB=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?wB(s,o):s},EB=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function DB(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function OB(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=DB(e,n),i=DB(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=DB(e.top??e.y??0,n),i=DB(e.bottom??e.y??0,n),a=DB(e.left??e.x??0,t),o=DB(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function kB(e,t,n,r,i,a){let{x:o,y:s}=EB(e,[t,n,r]),{x:c,y:l}=EB({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var AB=(e,t,n,r,i,a)=>{let o=OB(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=cB(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=kB(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},jB=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function MB(e){return e!=null&&e!==`parent`}function NB(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function PB(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function FB(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function IB(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function LB(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function RB(e){return{...Hz,...e||{}}}function zB(e){return e===null?null:e?`valid`:`invalid`}function BB(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=KB(e),s=TB({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?wB(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var VB=e=>({width:e.offsetWidth,height:e.offsetHeight}),HB=e=>e?.getRootNode?.()||window?.document,UB=[`INPUT`,`SELECT`,`TEXTAREA`];function WB(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?UB.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var GB=e=>`clientX`in e,KB=(e,t)=>{let n=GB(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},qB=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...VB(t)}})};function JB({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function YB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function XB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-YB(t-r,a),n];case $.Right:return[t+YB(r-t,a),n];case $.Top:return[t,n-YB(n-i,a)];case $.Bottom:return[t,n+YB(i-n,a)]}}function ZB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=XB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=XB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=JB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function QB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function $B({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function eV({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=pB(_B(e),_B(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),bB({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},hB(a))>0}var tV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,nV=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),rV=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,zz.error006()),t;let r=n.getEdgeId||tV,i;return i=Xz(e)?{...e}:{...e,id:r(e)},nV(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function iV({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=QB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var aV={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},oV=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},sV=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function cV({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=aV[t],c=aV[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=oV({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=QB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function lV(e,t,n,r){let i=Math.min(sV(e,t)/2,sV(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function uV({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=cV({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=lV(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function dV(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function fV(e){let{sourceNode:t,targetNode:n}=e;if(!dV(t)||!dV(n))return null;let r=t.internals.handleBounds||pV(t.handles),i=n.internals.handleBounds||pV(n.handles),a=hV(r?.source??[],e.sourceHandle),o=hV(e.connectionMode===Uz.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,zz.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=mV(t,a,s),u=mV(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function pV(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function mV(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??NB(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function hV(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function gV(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function _V(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=gV(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var vV=1e3,yV=10,bV={nodeOrigin:[0,0],nodeExtent:Bz,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},xV={...bV,checkEquality:!0};function SV(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function CV(e,t,n){let r=SV(bV,n);for(let n of e.values())if(n.parentId)OV(n,e,t,r);else{let e=lB($z(n,r.nodeOrigin),MB(n.extent)?n.extent:r.nodeExtent,NB(n));n.internals.positionAbsolute=e}}function wV(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function TV(e){return e===`manual`}function EV(e,t,n,r={}){let i=SV(xV,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!TV(i.zIndexMode)?vV:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=lB($z(u,i.nodeOrigin),MB(u.extent)?u.extent:i.nodeExtent,NB(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:wV(u,e),z:kV(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&OV(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function DV(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function OV(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=SV(bV,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}DV(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*yV),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=AV(e,u,o,s,a&&!TV(c)?vV:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function kV(e,t,n){let r=SB(e.zIndex)?e.zIndex:0;return TV(n)?r:r+(e.selected?t:0)}function AV(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=NB(e),l=$z(e,n),u=MB(e.extent)?lB(l,e.extent,c):l,d=lB({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=uB(d,c,t));let f=kV(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function jV(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=vB(a.get(n.parentId)?.expandedRect??gB(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=NB(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function MV(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=VB(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=MB(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=uB(h,s,n))}else m&&(h=lB(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:qB(`source`,r.nodeElement,p,d,e.id),target:qB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&OV(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:gB(g,i)}))}}if(f.length>0){let e=jV(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function NV({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function PV(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function FV(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;PV(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),PV(`target`,s,c,e,i,o),t.set(r.id,r)}}function IV(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:IV(n,t):!1}function LV(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function RV(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!IV(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function zV({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function BV({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=wB(a,t);return{x:o.x-a.x,y:o.y-a.y}}function VV({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=sI(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?mB(tB(s)):null,x=v&&l?BV({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:wB(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=oB({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=zV({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=fB(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=BB(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=RV(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=zV({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=SI().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=BB(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=KB(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=BB(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=KB(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=KB(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=zV({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!LV(t,`.${g}`,v))&&(!_||LV(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function HV(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())bB(i,gB(e))>0&&r.push(e);return r}var UV=250;function WV(e,t,n,r){let i=[],a=1/0,o=HV(e,n,t+UV);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=mV(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function GV(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...mV(o,c,c.position,!0)}:c}function KV(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function qV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var JV=()=>!0;function YV(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=JV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=HB(e.target),E=0,D,{x:ee,y:O}=KB(e),k=KV(a,w),A=s?.getBoundingClientRect(),te=!1;if(!A||!k)return;let ne=GV(i,k,r,c,t);if(!ne)return;let re=KB(e,A),ie=!1,ae=null,oe=!1,se=null;function ce(){if(!u||!A)return;let[e,t]=fB(re,A,S);f({x:e,y:t}),E=requestAnimationFrame(ce)}let j={...ne,nodeId:i,type:k,position:ne.position},le=c.get(i),ue={inProgress:!0,isValid:null,from:mV(le,j,$.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:le,to:re,toHandle:null,toPosition:Yz[j.position],toNode:null,pointer:re};function de(){te=!0,y(ue),m?.(e,{nodeId:i,handleId:r,handleType:k})}C===0&&de();function fe(e){if(!te){let{x:t,y:n}=KB(e),r=t-ee,i=n-O;if(!(r*r+i*i>C*C))return;de()}if(!x()||!j){pe(e);return}let a=b();re=KB(e,A),D=WV(TB(re,a,!1,[1,1]),n,c,j),ie||=(ce(),!0);let s=XV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});se=s.handleDomNode,ae=s.connection,oe=qV(!!D,s.isValid);let u=c.get(i),f=u?mV(u,j,$.Left,!0):ue.from,p={...ue,from:f,isValid:oe,to:s.toHandle&&oe?EB({x:s.toHandle.x,y:s.toHandle.y},a):re,toHandle:s.toHandle,toPosition:oe&&s.toHandle?s.toHandle.position:Yz[j.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:re};y(p),ue=p}function pe(e){if(!(`touches`in e&&e.touches.length>0)){if(te){(D||se)&&ae&&oe&&h?.(ae);let{inProgress:t,...n}=ue,r={...n,toPosition:ue.toHandle?ue.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ie=!1,oe=!1,ae=null,se=null,T.removeEventListener(`mousemove`,fe),T.removeEventListener(`mouseup`,pe),T.removeEventListener(`touchmove`,fe),T.removeEventListener(`touchend`,pe)}}T.addEventListener(`mousemove`,fe),T.addEventListener(`mouseup`,pe),T.addEventListener(`touchmove`,fe),T.addEventListener(`touchend`,pe)}function XV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=JV,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=KB(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=KV(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Uz.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=GV(t,e,a,u,n,!0)}return _}var ZV={onPointerDown:YV,isValid:XV};function QV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=sI(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&jB()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Rz().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:lI}}var $V=e=>({x:e.x,y:e.y,zoom:e.k}),eH=({x:e,y:t,zoom:n})=>Oz.translate(e,t).scale(n),tH=(e,t)=>e.target.closest(`.${t}`),nH=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,iH=(e,t=0,n=rH,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},aH=e=>{let t=e.ctrlKey&&jB()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(tH(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=lI(u),t=d*2**aH(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Wz.Vertical?0:u.deltaX*f,m=i===Wz.Horizontal?0:u.deltaY*f;!jB()&&u.shiftKey&&i!==Wz.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=$V(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function sH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=tH(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function cH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=$V(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function lH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&nH(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,$V(a.transform))}}function uH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&nH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=$V(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function dH({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(tH(f,`${u}-flow__node`)||tH(f,`${u}-flow__edge`)||tH(f,`${u}-flow__selection`)||tH(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||tH(f,c)&&h||tH(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function fH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Rz().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=sI(e).call(f);y({x:i.x,y:i.y,zoom:cB(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(aH);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?TL:zL).transform(iH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:ee}){r&&!l.isZoomingOrPanning&&v();let O=i&&!C&&!r;f.clickDistance(ee?1/0:!SB(D)||D<0?0:D);let k=O?oH({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):sH({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=cH({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let te=lH({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,te);let ne=uH({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,ne);let re=dH({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(re),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=eH(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=eH(e);return await g(n,t),n}function x(e){if(p){let t=eH(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?kz(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?TL:zL).scaleTo(iH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?TL:zL).scaleBy(iH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!SB(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var pH;(function(e){e.Line=`line`,e.Handle=`handle`})(pH||={});function mH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function hH(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function gH(e,t){return Math.max(0,t-e)}function _H(e,t){return Math.max(0,e-t)}function vH(e,t,n){return Math.max(0,t-e,e-n)}function yH(e,t){return e?!t:t}function bH(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,O=-a[1]*S,k=vH(E,h,g),A=vH(D,_,v);if(o){let e=0,t=0;c&&w<0?e=gH(y+w+ee,o[0][0]):!c&&w>0&&(e=_H(y+E+ee,o[1][0])),l&&T<0?t=gH(b+T+O,o[0][1]):!l&&T>0&&(t=_H(b+D+O,o[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(s){let e=0,t=0;c&&w>0?e=_H(y+w,s[0][0]):!c&&w<0&&(e=gH(y+E,s[1][0])),l&&T>0?t=_H(b+T,s[0][1]):!l&&T<0&&(t=gH(b+D,s[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(i){if(u){let e=vH(E/C,_,v)*C;if(k=Math.max(k,e),o){let e=0;e=!c&&!l||c&&!l&&f?_H(b+O+E/C,o[1][1])*C:gH(b+O+(c?w:-w)/C,o[0][1])*C,k=Math.max(k,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?gH(b+E/C,s[1][1])*C:_H(b+(c?w:-w)/C,s[0][1])*C,k=Math.max(k,e)}}if(d){let e=vH(D*C,h,g)/C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||l&&!c&&f?_H(y+D*C+ee,o[1][0])/C:gH(y+(l?T:-T)*C+ee,o[0][0])/C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?gH(y+D*C,s[1][0])/C:_H(y+(l?T:-T)*C,s[0][0])/C,A=Math.max(A,e)}}}T+=T<0?A:-A,w+=w<0?k:-k,i&&(f?E>D*C?T=(yH(c,l)?-w:w)/C:w=(yH(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let te=c?y+w:y,ne=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+te,y:a[1]*T*(l?-1:1)+ne}}var xH={width:0,height:0,x:0,y:0},SH={...xH,pointerX:0,pointerY:0,aspectRatio:1};function CH(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function wH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=sI(e),o={controlDirection:hH(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...xH},h={...SH};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:hH(e)};let g,_=null,v=[],y,b,x,S=SI().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=BB(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=MB(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=CH(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=BB(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:ee,y:O}=bH(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),k=E!==S,A=D!==C,te=ee!==u&&k,ne=O!==f&&A;if(!te&&!ne&&!k&&!A)return;let re={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((te||ne||T[0]===1||T[1]===1)&&(w.x=te?ee:m.x,w.y=ne?O:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=ee-u,t=O-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((k||A)&&(w.width=k&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=A&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let ie=mH({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ae={...m,direction:ie};if(p?.(e,ae)===!1){m=re.prevValues,h.x=re.startX,h.y=re.startY,v.forEach((e,t)=>{e.position=re.childNodes[t].position});return}d?.(e,ae),r(w,l)}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var TH=s((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),EH=s(((e,t)=>{t.exports=TH()})),DH=s((e=>{var t=f(),n=EH();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),OH=u(s(((e,t)=>{t.exports=DH()}))(),1),kH=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},AH=e=>e?kH(e):kH,{useDebugValue:jH}=y.default,{useSyncExternalStoreWithSelector:MH}=OH.default,NH=e=>e;function PH(e,t=NH,n){let r=MH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jH(r),r}var FH=(e,t)=>{let n=AH(e),r=(e,r=t)=>PH(n,e,r);return Object.assign(r,n),r},IH=(e,t)=>e?FH(e,t):FH;function LH(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}g();var RH=(0,y.createContext)(null),zH=RH.Provider,BH=zz.error001(`react`);function VH(e,t){let n=(0,y.useContext)(RH);if(n===null)throw Error(BH);return PH(n,e,t)}function HH(){let e=(0,y.useContext)(RH);if(e===null)throw Error(BH);return(0,y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var UH={display:`none`},WH={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},GH=`react-flow__node-desc`,KH=`react-flow__edge-desc`,qH=`react-flow__aria-live`,JH=e=>e.ariaLiveMessage,YH=e=>e.ariaLabelConfig;function XH({rfId:e}){let t=VH(JH);return(0,X.jsx)(`div`,{id:`${qH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:WH,children:t})}function ZH({rfId:e,disableKeyboardA11y:t}){let n=VH(YH);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{id:`${GH}-${e}`,style:UH,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,X.jsx)(`div`,{id:`${KH}-${e}`,style:UH,children:n[`edge.a11yDescription.default`]}),!t&&(0,X.jsx)(XH,{rfId:e})]})}var QH=(0,y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,X.jsx)(`div`,{className:nP([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});QH.displayName=`Panel`;var $H=`https://reactflow.dev?utm_source=attribution`;function eU({proOptions:e,position:t=`bottom-right`}){return(0,y.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,X.jsx)(QH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${$H}`,children:(0,X.jsx)(`a`,{href:$H,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var tU=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},nU=e=>e.id;function rU(e,t){return LH(e.selectedNodes.map(nU),t.selectedNodes.map(nU))&&LH(e.selectedEdges.map(nU),t.selectedEdges.map(nU))}function iU({onSelectionChange:e}){let t=HH(),{selectedNodes:n,selectedEdges:r}=VH(tU,rU);return(0,y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var aU=e=>!!e.onSelectionChangeHandlers;function oU({onSelectionChange:e}){let t=VH(aU);return e||t?(0,X.jsx)(iU,{onSelectionChange:e}):null}var sU=[0,0],cU={x:0,y:0,zoom:1},lU=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],uU=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),dU={translateExtent:Bz,nodeOrigin:sU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function fU(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=VH(uU,LH),l=HH();(0,y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=dU,s()}),[]);let u=(0,y.useRef)(dU);return(0,y.useEffect)(()=>{for(let s of lU){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:RB(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},lU.map(t=>e[t])),null}function pU(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function mU(e){let[t,n]=(0,y.useState)(e===`system`?null:e);return(0,y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=pU(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?pU()?.matches?`dark`:`light`:t}var hU=typeof document<`u`?document:null;function gU(e=null,t={target:hU,actInsideInputWithModifier:!0}){let[n,r]=(0,y.useState)(!1),i=(0,y.useRef)(!1),a=(0,y.useRef)(new Set([])),[o,s]=(0,y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
735
+ `]),{type:`application/javascript`}))})),hk=c({default:()=>gk}),gk,_k=o((()=>{x_(),gk=class e{constructor(t,n,r,i,a){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera=`environment`,this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement(`canvas`),r&&typeof r==`object`?this._onDecode=n:(console.warn(r||i||a?`You're using a deprecated version of the QrScanner constructor which will be removed in the future`:`Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),this._legacyOnDecode=n),n=typeof r==`object`?r:{},this._onDecodeError=n.onDecodeError||(typeof r==`function`?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof i==`function`?i:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof r==`number`?r:typeof i==`number`?i:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let o=!1;if(t.hidden&&(t.hidden=!1,o=!0),document.body.contains(t)||(document.body.appendChild(t),o=!0),r=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(i=!!n.overlay,this.$overlay=n.overlay||document.createElement(`div`),a=this.$overlay.style,a.position=`absolute`,a.display=`none`,a.pointerEvents=`none`,this.$overlay.classList.add(`scan-region-highlight`),!i&&n.highlightScanRegion){this.$overlay.innerHTML=`<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>`;try{this.$overlay.firstElementChild.animate({transform:[`scale(.98)`,`scale(1.01)`]},{duration:400,iterations:1/0,direction:`alternate`,easing:`ease-in-out`})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML(`beforeend`,`<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>`),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let e=window.getComputedStyle(t);e.display===`none`&&(t.style.setProperty(`display`,`block`,`important`),o=!0),e.visibility!==`visible`&&(t.style.setProperty(`visibility`,`visible`,`important`),o=!0),o&&(console.warn(`QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.`),t.style.opacity=`0`,t.style.width=`0`,t.style.height=`0`,this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener(`play`,this._onPlay),t.addEventListener(`loadedmetadata`,this._onLoadedMetaData),document.addEventListener(`visibilitychange`,this._onVisibilityChange),window.addEventListener(`resize`,this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn(`Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.`)}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`),r;try{t&&(await n()).every(e=>!e.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((e,t)=>({id:e.deviceId,label:e.label||(t===0?`Default Camera`:`Camera ${t+1}`)}))}finally{r&&(console.warn(`Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream`),e._stopVideoStream(r))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return`torch`in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn(`Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream`),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw`No flash available`;await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener(`loadedmetadata`,this._onLoadedMetaData),this.$video.removeEventListener(`play`,this._onPlay),document.removeEventListener(`visibilitychange`,this._onVisibilityChange),window.removeEventListener(`resize`,this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,`close`)}async start(){if(this._destroyed)throw Error(`The QR scanner can not be started as it had been destroyed.`);if((!this._active||this._paused)&&(window.location.protocol!==`https:`&&console.warn(`The camera stream is only accessible if the page is transferred via https.`),this._active=!0,!document.hidden)){if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display=`none`);let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(e=>setTimeout(e,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,r,i,a=!1,o=!1){let s,c=!1;n&&(`scanRegion`in n||`qrEngine`in n||`canvas`in n||`disallowCanvasResizing`in n||`alsoTryWithoutScanRegion`in n||`returnDetailedScanResult`in n)?(s=n.scanRegion,r=n.qrEngine,i=n.canvas,a=n.disallowCanvasResizing||!1,o=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||i||a||o?`You're using a deprecated api for scanImage which will be removed in the future.`:`Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),n=!!r;try{let l,u;[r,l]=await Promise.all([r||e.createQrEngine(),e._loadImage(t)]),[i,u]=e._drawToCanvas(l,s,i,a);let d;if(r instanceof Worker){let t=r;n||e._postWorkerMessageSync(t,`inversionMode`,`both`),d=await new Promise((n,r)=>{let a,o,c,l=-1;o=i=>{i.data.id===l&&(t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),i.data.data===null?r(e.NO_QR_CODE_FOUND):n({data:i.data.data,cornerPoints:e._convertPoints(i.data.cornerPoints,s)}))},c=e=>{t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),r(`Scanner error: `+(e?e.message||e:`Unknown Error`))},t.addEventListener(`message`,o),t.addEventListener(`error`,c),a=setTimeout(()=>c(`timeout`),1e4);let d=u.getImageData(0,0,i.width,i.height);l=e._postWorkerMessageSync(t,`decode`,d,[d.data.buffer])})}else d=await Promise.race([new Promise((e,t)=>window.setTimeout(()=>t(`Scanner error: timeout`),1e4)),(async()=>{try{var[n]=await r.detect(i);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,s)}}catch(r){if(n=r.message||r,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:s,canvas:i,disallowCanvasResizing:a,alsoTryWithoutScanRegion:o});throw`Scanner error: ${n}`}})()]);return c?d:d.data}catch(n){if(!s||!o)throw n;let l=await e.scanImage(t,{qrEngine:r,canvas:i,disallowCanvasResizing:a});return c?l:l.data}finally{n||e._postWorkerMessage(r,`close`)}}setGrayscaleWeights(t,n,r,i=!0){e._postWorkerMessage(this._qrEnginePromise,`grayscaleWeights`,{red:t,green:n,blue:r,useIntegerApproximation:i})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,`inversionMode`,t)}static async createQrEngine(t){if(t&&console.warn(`Specifying a worker path is not required and not supported anymore.`),t=()=>b_(()=>Promise.resolve().then(()=>(mk(),fk)).then(e=>e.createWorker()),void 0,import.meta.url),!(!e._disableBarcodeDetector&&`BarcodeDetector`in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes(`qr_code`)))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:e})=>/Chromium/i.test(e))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues([`architecture`,`platformVersion`]).then(({architecture:e,platformVersion:t})=>/arm/i.test(e||`arm`)&&13<=parseInt(t||`13`)).catch(()=>!0)?t():new BarcodeDetector({formats:[`qr_code`]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=``),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,r=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,o=e.offsetTop,s=window.getComputedStyle(e),c=s.objectFit,l=t/n,u=r/i;switch(c){case`none`:var d=t,f=n;break;case`fill`:d=r,f=i;break;default:(c===`cover`?l>u:l<u)?(f=i,d=f*l):(d=r,f=d/l),c===`scale-down`&&(d=Math.min(d,t),f=Math.min(f,n))}var[p,m]=s.objectPosition.split(` `).map((e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?(t?i-f:r-d)*n/100:n});s=this._scanRegion.width||t,u=this._scanRegion.height||n,c=this._scanRegion.x||0;var h=this._scanRegion.y||0;l=this.$overlay.style,l.width=`${s/t*d}px`,l.height=`${u/n*f}px`,l.top=`${o+m+h/n*f}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${a+(n?r-p-d:p)+(n?t-c-s:c)/t*d}px`,l.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,r=t.y||0,i=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let a of e)a.x=a.x*i+n,a.y=a.y*t+r;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||(`requestVideoFrameCallback`in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(e=>setTimeout(e,n-t)),this._lastScanTimestamp=Date.now();try{var r=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute(`viewBox`,`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute(`points`,r.cornerPoints.map(({x:e,y:t})=>`${e},${t}`).join(` `)),this.$codeOutlineHighlight.style.display=``)):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display=`none`,100))}this._scanFrame()})}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw`Camera not found.`;let e=/^(environment|user)$/.test(this._preferredCamera)?`facingMode`:`deviceId`,t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map(t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:this._preferredCamera===`environment`?`user`:`environment`)}}catch{}throw`Camera not found.`}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform=`scaleX(`+(e===`user`?-1:1)+`)`}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?`environment`:/front|user|face/i.test(e.label)?`user`:null:null}static _drawToCanvas(e,t,n,r=!1){n||=document.createElement(`canvas`);let i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.videoWidth||e.width,s=t&&t.height?t.height:e.videoHeight||e.height;return r||(r=t&&t.downScaledWidth?t.downScaledWidth:o,t=t&&t.downScaledHeight?t.downScaledHeight:s,n.width!==r&&(n.width=r),n.height!==t&&(n.height=t)),t=n.getContext(`2d`,{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,i,a,o,s,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||`OffscreenCanvas`in window&&t instanceof OffscreenCanvas||`ImageBitmap`in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t==`string`){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw`Unsupported image type.`}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,n)=>{let r=i=>{e.removeEventListener(`load`,r),e.removeEventListener(`error`,r),i instanceof ErrorEvent?n(`Image load error`):t()};e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}static async _postWorkerMessage(t,n,r,i){return e._postWorkerMessageSync(await t,n,r,i)}static _postWorkerMessageSync(t,n,r,i){if(!(t instanceof Worker))return-1;let a=e._workerMessageId++;return t.postMessage({id:a,type:n,data:r},i),a}},gk.DEFAULT_CANVAS_SIZE=400,gk.NO_QR_CODE_FOUND=`No QR code found`,gk._disableBarcodeDetector=!1,gk._workerMessageId=0}));x_();var vk=null;function yk(){return vk??=(async()=>{let e=window.BarcodeDetector;if(e)try{let t=await e.getSupportedFormats();if(t.includes(`qr_code`)){let n=new e({formats:t});return{qrOnly:!1,detect:async e=>(await n.detect(e))[0]?.rawValue||null}}}catch{}let{default:t}=await b_(async()=>{let{default:e}=await Promise.resolve().then(()=>(_k(),hk));return{default:e}},void 0,import.meta.url),n=t.createQrEngine();return{qrOnly:!0,detect:async e=>{try{return(await t.scanImage(e,{qrEngine:n,returnDetailedScanResult:!0})).data||null}catch{return null}}}})(),vk}function bk({open:e,onClose:t,onResult:n}){let r=(0,y.useRef)(n);r.current=n;let i=(0,y.useRef)(t);return i.current=t,(0,y.useEffect)(()=>{e&&WD(`scan`).then(e=>{e&&r.current(e)}).catch(()=>void 0).finally(()=>i.current())},[e]),null}function xk(e){return UD(`scan`)?(0,X.jsx)(bk,{...e}):(0,X.jsx)(Sk,{...e})}function Sk({open:e,onClose:t,onResult:n}){let[r,i]=(0,y.useState)(`environment`),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),l=(0,y.useRef)(null),u=QO(e,r),d=(0,y.useRef)(n);d.current=n;let f=(0,y.useRef)(t);f.current=t,(0,y.useEffect)(()=>{e&&(c(!1),yk().then(e=>o(e.qrOnly)))},[e]),(0,y.useEffect)(()=>{if(!e||!u.stream)return;let t=!1,n,r=async()=>{let e=u.video.current;if(!t&&e&&e.readyState>=2&&e.videoWidth){let n=await(await yk()).detect(e).catch(()=>null);if(n&&!t){navigator.vibrate?.(60),d.current(n),f.current();return}}t||(n=setTimeout(r,200))};return r(),()=>{t=!0,clearTimeout(n)}},[e,u.stream,u.video]);let p=async e=>{if(!e)return;c(!1);let r=await createImageBitmap(e).catch(()=>null),i=r?await(await yk()).detect(r).catch(()=>null):null;i?(n(i),t()):c(!0)};return(0,X.jsxs)($O,{open:e,onClose:t,label:Z(`scan.title`),children:[(0,X.jsx)(tk,{title:Z(`scan.title`),onClose:t,camera:u,onFlip:()=>i(e=>e===`environment`?`user`:`environment`)}),(0,X.jsx)(nk,{camera:u,asking:Z(`scan.asking`),actions:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(sk,{onClick:()=>l.current?.click(),children:[(0,X.jsx)(yy,{className:`size-4`}),` `,Z(`scan.fromPhoto`)]}),(0,X.jsx)(sk,{quiet:!0,onClick:t,children:Z(`scan.typeInstead`)})]}),children:(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,X.jsx)(`div`,{className:`aspect-square w-[min(68%,320px)] rounded-3xl border-2 border-white/90 shadow-[0_0_0_100vmax_rgb(0_0_0/0.35)]`})})}),(0,X.jsxs)(`div`,{className:`safe-bottom flex flex-col items-center gap-3 px-5 pt-3 text-center`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-white/75 leading-snug`,children:Z(s?`scan.miss`:a?`scan.hintQr`:`scan.hint`)}),u.stream?(0,X.jsxs)(sk,{quiet:!0,onClick:()=>l.current?.click(),children:[(0,X.jsx)(yy,{className:`size-4`}),` `,Z(`scan.fromPhoto`)]}):null]}),(0,X.jsx)(`input`,{ref:l,type:`file`,hidden:!0,accept:`image/*`,onChange:e=>{p(e.target.files?.[0]),e.target.value=``}})]})}var Ck=`#1d1a17`,wk={width:1200,height:480};function Tk(e,t,n,r,i){e.lineCap=`round`,e.lineJoin=`round`,e.strokeStyle=Ck,e.fillStyle=Ck,e.lineWidth=i;for(let a of t){if(a.length===1){e.beginPath(),e.arc(a[0].x*n,a[0].y*r,i/2,0,Math.PI*2),e.fill();continue}e.beginPath(),e.moveTo(a[0].x*n,a[0].y*r);for(let t=1;t<a.length-1;t++){let i=a[t],o=a[t+1];e.quadraticCurveTo(i.x*n,i.y*r,(i.x+o.x)/2*n,(i.y+o.y)/2*r)}let t=a[a.length-1];e.lineTo(t.x*n,t.y*r),e.stroke()}}function Ek({strokes:e,onStrokes:t}){let n=(0,y.useRef)(null),r=(0,y.useRef)(null),i=(0,y.useRef)(e);i.current=e;let a=()=>{let e=n.current,t=e?.getContext(`2d`);if(!e||!t)return;let a=window.devicePixelRatio||1,o=Math.round(e.clientWidth*a),s=Math.round(e.clientHeight*a);(e.width!==o||e.height!==s)&&(e.width=o,e.height=s),t.clearRect(0,0,o,s),Tk(t,r.current?[...i.current,r.current]:i.current,o,s,2.4*a)};(0,y.useEffect)(()=>{a();let e=n.current;if(!e)return;let t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[e]);let o=e=>{let t=e.currentTarget.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}};return(0,X.jsxs)(`div`,{className:`relative overflow-hidden rounded-xl bg-white ring-1 ring-input`,children:[(0,X.jsx)(`canvas`,{ref:n,"aria-label":Z(`sign.pad`),className:`block aspect-[5/2] w-full cursor-crosshair touch-none select-none`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r.current=[o(e)],a()},onPointerMove:e=>{r.current&&(r.current.push(o(e)),a())},onPointerUp:()=>{if(r.current){let e=r.current;r.current=null,t([...i.current,e])}},onPointerCancel:()=>{r.current=null,a()}}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-6 bottom-[22%] border-[#1d1a17]/25 border-b`}),e.length?null:(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-[#1d1a17]/40 text-[0.875rem]`,children:Z(`sign.hint`)})]})}async function Dk(e){let t=document.createElement(`canvas`);t.width=wk.width,t.height=wk.height;let n=t.getContext(`2d`);if(!n)return null;Tk(n,e,wk.width,wk.height,7);let r=await new Promise(e=>t.toBlob(e,`image/png`));return r?new File([r],`unterschrift.png`,{type:`image/png`}):null}function Ok({label:e,value:t,runId:n,onChange:r}){let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=typeof t==`string`&&t?t:null,p=async()=>{l(!0),d(null);try{let e=await Dk(o);if(!e)return;r((await hS.upload(`/api/runs/${n}/uploads`,e)).id),a(!1)}catch(e){d(e.message)}finally{l(!1)}};return(0,X.jsxs)(`div`,{children:[f?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`min-w-0 flex-1 rounded-lg bg-white px-3`,"aria-label":Z(`sign.again`),children:(0,X.jsx)(`img`,{src:uS(`/api/runs/${n}/assets/${f}`),alt:e,className:`mx-auto h-20 object-contain`})}),(0,X.jsx)(yS,{label:Z(`sign.remove`),onClick:()=>r(void 0),children:(0,X.jsx)(Lb,{className:`size-4`})})]}):(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{s([]),a(!0)},className:`flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,children:[(0,X.jsx)(Yy,{className:`size-6`}),Z(`sign.open`)]}),(0,X.jsxs)(MS,{open:i,onClose:()=>a(!1),title:e,wide:!0,children:[(0,X.jsx)(Ek,{strokes:o,onStrokes:s}),u?(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:u}):null,(0,X.jsxs)(`div`,{className:`mt-5 flex items-center justify-between gap-3`,children:[(0,X.jsxs)(vS,{variant:`ghost`,disabled:!o.length||c,onClick:()=>s([]),children:[(0,X.jsx)(Zv,{className:`size-4`}),` `,Z(`sign.clear`)]}),(0,X.jsx)(vS,{busy:c,disabled:!o.length,onClick:()=>void p(),children:Z(`sign.accept`)})]})]})]})}function kk({runId:e,connectionId:t,connector:n,onCancel:r}){let[i,a]=(0,y.useState)({}),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),u=async()=>{s(!0),l(null);try{await hS.post(`/api/runs/${e}/connections/${t}/credentials/${n.id}`,{values:i})}catch(e){l(e.message)}finally{s(!1)}};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input`,children:[(n.fields??[]).map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(OS,{children:e.label}),(0,X.jsx)(SS,{type:e.secret?`password`:`text`,autoComplete:`off`,value:i[e.key]??``,placeholder:e.placeholder,onChange:t=>a(n=>({...n,[e.key]:t.target.value})),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}})]},e.key)),n.hint?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:n.hint}):null,c?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c}):null,(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(vS,{variant:`ghost`,size:`sm`,onClick:r,children:Z(`common.cancel`)}),(0,X.jsx)(vS,{size:`sm`,busy:o,onClick:()=>void u(),children:Z(`connect.go`)})]})]})}function Ak({runId:e,connection:t}){let[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(null);if(!t)return null;if(t.account){let n=t.connectors.find(e=>e.id===t.account?.connector)?.name??``;return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-moss-tint text-moss`,children:(0,X.jsx)(Lv,{className:`size-5`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate font-medium text-[0.9375rem]`,children:t.account.label}),(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`connect.connected`,{name:n})})]}),(0,X.jsx)(yS,{label:Z(`connect.disconnect`),onClick:()=>void hS.del(`/api/runs/${e}/connections/${t.id}`),children:(0,X.jsx)(kb,{className:`size-4`})})]})}let c=async n=>{if(s(null),a(null),UD(`signIn`)){try{let{url:r}=await hS.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);await WD(`signIn`,{url:r})}catch(e){s(e.message)}return}let r=window.open(`about:blank`,`wizard-connect`,`width=540,height=700`);try{let{url:i}=await hS.post(`/api/runs/${e}/connections/${t.id}/oauth/${n.id}`);r?r.location.replace(i):a(i)}catch(e){r?.close(),s(e.message)}},l=t.connectors.find(e=>e.id===n);return t.connectors.length?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.connectors.map(e=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>e.auth===`oauth2`?void c(e):r(n===e.id?null:e.id),className:Q(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,n===e.id?`bg-ember-veil text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember`),children:[(0,X.jsx)(Dy,{className:`size-4`}),` `,e.name]},e.id))}),l?(0,X.jsx)(kk,{runId:e,connectionId:t.id,connector:l,onCancel:()=>r(null)}):null,i?(0,X.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`text-[0.875rem] text-ember underline`,children:Z(`connect.openLink`)}):null,o?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:o}):null]}):(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`connect.none`)})}function jk(e){return e==null?``:Array.isArray(e)?e.join(`, `):String(e)}function Mk(e,t){if(t.trim()===``)return null;if(e.type===`number`){let e=Number(t.replace(/\s/g,``).replace(`,`,`.`));return Number.isFinite(e)?e:t}return e.type===`boolean`?t===`true`:t}function Nk({column:e,value:t,boxed:n,onCommit:r}){let[i,a]=(0,y.useState)(jk(t));(0,y.useEffect)(()=>a(jk(t)),[t]);let o=Q(`w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card`,n?`h-11 bg-paper-2`:`h-9 bg-transparent hover:bg-paper-2 coarse:h-11`);return e.type===`boolean`?(0,X.jsx)(`label`,{className:`flex size-9 cursor-pointer items-center justify-center coarse:size-11`,children:(0,X.jsx)(`input`,{type:`checkbox`,"aria-label":e.name,checked:t===!0,onChange:e=>r(e.target.checked),className:`size-4 accent-[var(--ember)] coarse:size-6`})}):e.type===`select`&&!e.format.multiple&&!e.format.allowCustom?(0,X.jsxs)(`select`,{value:i,onChange:e=>r(e.target.value||null),className:o,children:[(0,X.jsx)(`option`,{value:``}),e.format.options.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.label},e.id))]}):(0,X.jsx)(`input`,{"aria-label":e.name,type:e.type===`date`&&e.format.kind===`date`?`date`:`text`,inputMode:e.type===`number`?`decimal`:void 0,enterKeyHint:`done`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),onBlur:()=>{i!==jk(t)&&r(Mk(e,i))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.target.blur())},className:Q(o,e.type===`number`&&`text-right tabular-nums`)})}function Pk({runId:e,list:t,editable:n}){let{def:r,rows:i}=t,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)({}),l=`/api/runs/${e}/lists/${r.id}/rows`,u=async e=>{o(null);try{await e()}catch(e){o(e instanceof fS?e.message:String(e))}},d=()=>u(async()=>{await hS.post(l,{cells:s}),c({})}),f=Object.values(s).some(e=>e!=null&&e!==``);if(!i.length&&!n)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`list.empty`)});let p=(e,t)=>t===0||e.type===`text`&&e.format?.style===`multiline`,m=(e,t,n)=>void u(()=>hS.patch(`${l}/${e}`,{cells:{[t]:n}}));return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[i.map(e=>(0,X.jsxs)(`div`,{className:`rounded-lg bg-paper p-2 ring-1 ring-border-soft`,children:[(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((t,r)=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,p(t,r)&&`col-span-2`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:t.name}),n?(0,X.jsx)(Nk,{boxed:!0,column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,X.jsx)(`div`,{className:Q(`break-words px-1 text-[0.875rem]`,t.type===`number`&&`tabular-nums`),children:Ul(t,e.cells[t.id],Kx)||`—`})]},t.id))}),n?(0,X.jsx)(`div`,{className:`mt-1 flex justify-end`,children:(0,X.jsx)(yS,{label:Z(`list.delete`),onClick:()=>void u(()=>hS.del(`${l}/${e.id}`)),children:(0,X.jsx)(Cb,{className:`size-4`})})}):null]},e.id)),n?(0,X.jsxs)(`div`,{className:`rounded-lg border border-input border-dashed p-2`,children:[(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-1.5`,children:r.columns.map((e,t)=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,p(e,t)&&`col-span-2`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,X.jsx)(Nk,{boxed:!0,column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})]},e.id))}),(0,X.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,X.jsxs)(vS,{variant:`secondary`,size:`sm`,onClick:()=>f?void d():void 0,children:[(0,X.jsx)(tb,{className:`size-4`}),` `,Z(`run.addRow`)]})})]}):null]}),(0,X.jsx)(`div`,{className:`hidden overflow-x-auto rounded-lg ring-1 ring-border-soft sm:block`,children:(0,X.jsxs)(`table`,{className:`w-full text-[0.8125rem]`,children:[(0,X.jsx)(`thead`,{className:`bg-paper-2 text-ink-2`,children:(0,X.jsxs)(`tr`,{children:[r.columns.map(e=>(0,X.jsx)(`th`,{className:`whitespace-nowrap px-3 py-2 text-left font-medium`,children:e.name},e.id)),n?(0,X.jsx)(`th`,{className:`w-10`}):null]})}),(0,X.jsxs)(`tbody`,{children:[i.map(e=>(0,X.jsxs)(`tr`,{className:`border-border-soft border-t align-top`,children:[r.columns.map(t=>(0,X.jsx)(`td`,{className:Q(`min-w-[7.5rem]`,n?`px-1 py-0.5`:`px-3 py-2`),children:n?(0,X.jsx)(Nk,{column:t,value:e.cells[t.id],onCommit:n=>m(e.id,t.id,n)}):(0,X.jsx)(`span`,{className:Q(t.type===`number`&&`tabular-nums`),children:Ul(t,e.cells[t.id],Kx)})},t.id)),n?(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(yS,{label:Z(`list.delete`),className:`size-9`,onClick:()=>void u(()=>hS.del(`${l}/${e.id}`)),children:(0,X.jsx)(Cb,{className:`size-3.5`})})}):null]},e.id)),n?(0,X.jsxs)(`tr`,{className:`border-border-soft border-t bg-paper`,children:[r.columns.map(e=>(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(Nk,{column:e,value:s[e.id],onCommit:t=>c(n=>({...n,[e.id]:t}))})},e.id)),(0,X.jsx)(`td`,{className:`px-1 py-0.5`,children:(0,X.jsx)(yS,{label:Z(`run.addRow`),className:`size-9`,onClick:()=>f?void d():void 0,children:(0,X.jsx)(tb,{className:`size-4`})})})]}):null]})]})}),a?(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:a}):null]})}function Fk(e,t,n){return uS(`/api/runs/${e}/store/files/${t.split(`/`).map(encodeURIComponent).join(`/`)}${n?`?inline=1`:``}`)}var Ik=[`bg-paper-3 text-ink-3`,`bg-moss-tint text-moss`,`bg-rose-tint text-rose`,`bg-ember-tint text-ember-strong`];function Lk({runId:e,list:t}){let{def:n,rows:r}=t,i=n.columns.find(e=>e.id===n.check?.file),a=n.columns.find(e=>e.id===n.check?.status),o=a?.type===`select`?a.format.options:[],s=o[0]?.id,c=e=>a?String(e.cells[a.id]??s??``):``,l=e=>!a||c(e)===s,[u,d]=(0,y.useState)(()=>(r.find(l)??r[0])?.id??null),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),g=`/api/runs/${e}/lists/${n.id}/rows`,_=r.find(e=>e.id===u)??r[0],v=f?r.filter(e=>l(e)||e.id===_?.id):r,b=r.filter(e=>!l(e)).length,x=n.columns.filter(e=>e!==i&&e!==a),S=x.filter(e=>e.id!==n.key),C=S.find(e=>e.type===`text`)??S[0],w=S.filter(e=>e!==C),T=async(e,t)=>{h(null);try{await hS.patch(`${g}/${e}`,{cells:t})}catch(e){h(e instanceof fS?e.message:String(e))}},E=e=>{let t=v.findIndex(e=>e.id===_?.id),n=v[Math.min(v.length-1,Math.max(0,t+e))];n&&d(n.id)},D=async e=>{if(!_||!a)return;let t=r.findIndex(e=>e.id===_.id),n=[...r.slice(t+1),...r.slice(0,t)].find(l);await T(_.id,{[a.id]:e}),n&&e!==s&&d(n.id)},ee=e=>{e.target.closest(`input, textarea, select`)||(e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),E(e.key===`ArrowDown`?1:-1)):/^[1-9]$/.test(e.key)&&o[Number(e.key)]&&(e.preventDefault(),D(o[Number(e.key)].id)))};if(!r.length)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`list.empty`)});let O=i&&_?String(_.cells[i.id]??``).trim():``,k=O.split(`.`).pop()?.toLowerCase()??``,A=e=>Ik[Math.min(Math.max(0,o.findIndex(t=>t.id===c(e))),3)];return(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]`,onKeyDown:ee,children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:Z(`check.progress`,{done:b,total:r.length})}),a?(0,X.jsx)(`button`,{type:`button`,"aria-pressed":f,onClick:()=>p(e=>!e),className:Q(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,f?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:Z(`check.onlyOpen`)}):null]}),(0,X.jsx)(`ul`,{className:`flex max-h-[38vh] flex-col gap-1.5 overflow-y-auto p-0.5 pr-1 lg:max-h-[calc(100vh-15rem)]`,children:v.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>d(e.id),"aria-current":e.id===_?.id,className:Q(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left ring-1 transition`,e.id===_?.id?`bg-card shadow-soft ring-ember`:`bg-paper ring-border-soft hover:bg-card`),children:[(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate font-medium text-[0.875rem]`,children:C&&Ul(C,e.cells[C.id],Kx)||`—`}),(0,X.jsx)(`span`,{className:`block truncate text-[0.75rem] text-ink-3 tabular-nums`,children:w.slice(0,2).map(t=>Ul(t,e.cells[t.id],Kx)).filter(Boolean).join(` · `)})]}),a?(0,X.jsx)(`span`,{className:Q(`shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]`,A(e)),children:o.find(t=>t.id===c(e))?.label??c(e)}):null]})},e.id))})]}),_?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[o.length>1?(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.slice(1).map((e,t)=>(0,X.jsxs)(vS,{size:`md`,variant:c(_)===e.id?`primary`:`secondary`,onClick:()=>void D(e.id),children:[c(_)===e.id?(0,X.jsx)(Lv,{className:`size-4`}):null,e.label,(0,X.jsx)(`kbd`,{className:`ml-1 hidden rounded bg-black/10 px-1.5 text-[0.6875rem] lg:inline`,children:t+1})]},e.id)),c(_)===s?null:(0,X.jsx)(vS,{size:`md`,variant:`ghost`,onClick:()=>void D(s??``),children:Z(`check.reopen`)})]}):null,(0,X.jsx)(`div`,{className:`overflow-hidden rounded-lg bg-paper-2 ring-1 ring-border-soft`,children:O?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 border-border-soft border-b bg-card px-3 py-2 text-[0.8125rem]`,children:[(0,X.jsx)(ay,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:O.split(`/`).pop()}),(0,X.jsx)(`a`,{href:Fk(e,O,k===`pdf`),target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline`,children:Z(`run.openFull`)})]}),k===`pdf`?(0,X.jsx)(`iframe`,{title:O,src:`${Fk(e,O,!0)}#toolbar=0&navpanes=0&view=FitH`,className:`h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]`},O):[`png`,`jpg`,`jpeg`,`webp`].includes(k)?(0,X.jsx)(`div`,{className:`flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]`,children:(0,X.jsx)(`img`,{src:Fk(e,O,!0),alt:O,className:`max-w-full object-contain`},O)}):(0,X.jsx)(`p`,{className:`px-4 py-10 text-center text-[0.875rem] text-ink-3`,children:Z(`check.noPreview`)})]}):(0,X.jsx)(`p`,{className:`px-4 py-14 text-center text-[0.875rem] text-ink-3`,children:Z(`check.noFile`)})}),(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-2 sm:grid-cols-3`,children:x.map(e=>(0,X.jsxs)(`div`,{className:Q(`min-w-0`,e.type===`text`&&e.format?.style===`multiline`&&`col-span-full`),children:[(0,X.jsx)(`div`,{className:`px-1 pb-0.5 text-[0.6875rem] text-ink-3`,children:e.name}),(0,X.jsx)(Nk,{boxed:!0,column:e,value:_.cells[e.id],onCommit:t=>void T(_.id,{[e.id]:t})})]},e.id))}),m?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:m}):null]}):null]})}var Rk={xlsx:`Excel`,csv:`CSV`,json:`JSON`,md:`Markdown`,zip:`ZIP`};function zk({runId:e,list:t}){return(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.formats.map(n=>(0,X.jsx)(`a`,{href:uS(`/api/runs/${e}/lists/${t.def.id}/download?format=${n}`),className:`inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4`,children:Rk[n]??n},n))})}function Bk(e){return e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function Vk({runId:e}){let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{t&&(o(!1),hS.get(`/api/runs/${e}/store`).then(i))},[t,e]);let s=r&&!r.files.length&&!r.connections.length&&!r.keepsSignIns&&r.lists.every(e=>!e.rows);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`inline-flex items-center gap-1.5 text-[0.8125rem] text-ink-4 transition hover:text-ink-2 coarse:min-h-11`,children:[(0,X.jsx)(qv,{className:`size-3.5`}),` `,Z(`store.open`)]}),(0,X.jsx)(MS,{open:t,onClose:()=>n(!1),title:Z(`store.title`),wide:!0,children:r?(0,X.jsxs)(`div`,{className:`flex flex-col gap-5 text-[0.875rem]`,children:[(0,X.jsx)(`p`,{className:`text-ink-3`,children:Z(`store.explain`)}),s?(0,X.jsx)(`p`,{className:`text-ink-2`,children:Z(`store.empty`)}):null,r.lists.some(e=>e.rows)?(0,X.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.lists.filter(e=>e.rows).map(e=>(0,X.jsxs)(`li`,{className:`flex justify-between gap-3`,children:[(0,X.jsx)(`span`,{children:e.title}),(0,X.jsx)(`span`,{className:`text-ink-3 tabular-nums`,children:Z(`store.rows`,{n:e.rows})})]},e.id))}):null,r.connections.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Dy,{className:`size-4 text-ink-3`}),` `,e.account?.label]},e.id)),r.keepsSignIns?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Lv,{className:`size-4 text-ink-3`}),` `,Z(`store.signIns`)]}):null,r.files.length?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-1 text-ink-3`,children:Z(`store.files`,{n:r.files.length,size:Bk(r.files.reduce((e,t)=>e+t.size,0))})}),(0,X.jsx)(`ul`,{className:`max-h-56 overflow-y-auto rounded-lg ring-1 ring-border-soft`,children:r.files.map(t=>(0,X.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,X.jsxs)(`a`,{href:uS(`/api/runs/${e}/store/files/${t.path}`),className:`flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,title:t.source??void 0,children:[(0,X.jsx)(ay,{className:`size-3.5 shrink-0 text-ink-3`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.path}),(0,X.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:Bk(t.size)})]})},t.path))})]}):null,(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-1`,children:[s?(0,X.jsx)(`span`,{}):a?(0,X.jsxs)(vS,{variant:`secondary`,onClick:async()=>{await hS.del(`/api/runs/${e}/store`),i(await hS.get(`/api/runs/${e}/store`)),o(!1)},children:[(0,X.jsx)(Cb,{className:`size-4`}),` `,Z(`store.confirmDelete`)]}):(0,X.jsxs)(vS,{variant:`ghost`,onClick:()=>o(!0),children:[(0,X.jsx)(Cb,{className:`size-4`}),` `,Z(`store.delete`)]}),(0,X.jsx)(vS,{onClick:()=>n(!1),children:Z(`common.close`)})]})]}):(0,X.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,X.jsx)(kS,{})})})]})}var Hk=300;function Uk(){if(typeof MediaRecorder<`u`)return[`audio/webm;codecs=opus`,`audio/mp4`,`audio/webm`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function Wk(e){return`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`}function Gk({value:e,runId:t,onChange:n,onBusy:r}){let i=$l(e)?e:null,[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(0),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),_=(0,y.useRef)(null),v=(0,y.useRef)(null),b=Uk(),x=JD&&!!b;(0,y.useEffect)(()=>()=>{_.current&&(_.current.recorder.onstop=null,_.current.stop())},[]),(0,y.useEffect)(()=>()=>{h&&URL.revokeObjectURL(h.url)},[h]);let S=async(e,i)=>{u(!0),r?.(!0),f(null);try{let r=await hS.upload(`/api/runs/${t}/uploads`,e);g({asset:r.id,url:URL.createObjectURL(e)}),n({asset:r.id,...i===void 0?{}:{seconds:i}})}catch(e){f(e.message)}finally{u(!1),r?.(!1)}},C=async()=>{f(null),m(!1);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch{m(!0);return}let t=[],n=new MediaRecorder(e,{mimeType:b,audioBitsPerSecond:48e3}),i=Date.now(),a=new AudioContext,s=a.createAnalyser();s.fftSize=256,a.createMediaStreamSource(e).connect(s);let l=new Uint8Array(s.fftSize),u=0,d=()=>{s.getByteTimeDomainData(l);let e=0;for(let t of l)e=Math.max(e,Math.abs(t-128));if(c(Math.min(1,e/64)),o((Date.now()-i)/1e3),(Date.now()-i)/1e3>=Hk){p();return}u=requestAnimationFrame(d)},p=()=>{cancelAnimationFrame(u),n.state!==`inactive`&&n.stop();for(let t of e.getTracks())t.stop();a.close().catch(()=>void 0),_.current=null,o(null),c(0)};n.ondataavailable=e=>e.data.size&&t.push(e.data),n.onstop=()=>{let e=(n.mimeType||b||`audio/webm`).split(`;`)[0],r=e===`audio/mp4`?`m4a`:e===`audio/ogg`?`ogg`:`webm`,a=Math.max(1,Math.round((Date.now()-i)/1e3));S(new File(t,`sprachnotiz-${YO()}.${r}`,{type:e}),a)},_.current={recorder:n,stop:p},r?.(!0),n.start(1e3),u=requestAnimationFrame(d)},w=a!==null,T=(0,X.jsxs)(vS,{variant:`secondary`,onClick:()=>v.current?.click(),children:[(0,X.jsx)(ry,{className:`size-4`}),` `,Z(`voice.pick`)]});return(0,X.jsxs)(`div`,{children:[w?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-3 ring-1 ring-ember`,children:[(0,X.jsxs)(`span`,{className:`relative flex size-11 shrink-0 items-center justify-center`,children:[(0,X.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-rose-tint transition-transform duration-75`,style:{transform:`scale(${.7+s*.5})`}}),(0,X.jsx)(`span`,{className:`relative size-3.5 animate-pulse-dot rounded-full bg-rose`})]}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`font-medium text-[0.9375rem] tabular-nums`,children:Wk(a)}),(0,X.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:a>270?Z(`voice.left`,{s:Math.ceil(Hk-a)}):Z(`voice.recording`)})]}),(0,X.jsxs)(vS,{onClick:()=>_.current?.stop(),children:[(0,X.jsx)(yb,{className:`size-3.5 fill-current`}),` `,Z(`voice.stop`)]})]}):l?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input`,children:[(0,X.jsx)(kS,{className:`size-4`}),` `,Z(`run.uploading`)]}):i?(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-3 ring-1 ring-input`,children:[(0,X.jsx)(`audio`,{controls:!0,preload:`metadata`,src:h?.asset===i.asset?h.url:`/api/runs/${t}/assets/${i.asset}`,className:`h-11 w-full`}),i.transcript?(0,X.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap px-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:i.transcript}):null,(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:i.seconds?Wk(i.seconds):null}),(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[x?(0,X.jsxs)(vS,{variant:`ghost`,size:`sm`,onClick:()=>void C(),children:[(0,X.jsx)(ab,{className:`size-3.5`}),` `,Z(`voice.again`)]}):null,(0,X.jsx)(vS,{variant:`ghost`,size:`sm`,onClick:()=>n(void 0),children:Z(`voice.remove`)})]})]})]}):(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,X.jsxs)(vS,{variant:`secondary`,size:`lg`,onClick:()=>void C(),className:`w-full sm:w-auto`,children:[(0,X.jsx)(Vy,{className:`size-4`}),` `,Z(`voice.start`)]}):T,x&&p?T:null]}),p?(0,X.jsx)(`p`,{className:`mt-2 rounded-lg bg-amber-tint px-3 py-2 text-[0.8125rem] text-ink-2 leading-relaxed`,children:Z(`voice.denied`)}):(0,X.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3 leading-relaxed`,children:Z(x?`voice.why`:`voice.noRecorder`)})]}),(0,X.jsx)(`input`,{ref:v,type:`file`,hidden:!0,accept:`audio/*`,capture:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&S(t,void 0)}}),d?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:d}):null]})}function Kk(e,t){try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e)}catch{return`${e.toFixed(2)} ${t}`}}function qk({field:e,value:t,values:n,onChange:r}){let i=e.columns??[],a=Array.isArray(t)&&t.length?t:[{}],o=Wu(e,a,n),s=(e,t,n)=>{r(a.map((r,i)=>i===e?{...r,[t]:n}:r))},c=i.map(e=>e.kind===`text`&&e===i[0]?`minmax(0,3fr)`:`minmax(0,1fr)`).join(` `);return(0,X.jsxs)(`div`,{className:`rounded-xl bg-card p-2 ring-1 ring-input`,children:[(0,X.jsx)(`div`,{className:`hidden gap-2 px-2 pt-1 pb-2 text-[0.75rem] text-ink-3 sm:grid`,style:{gridTemplateColumns:`${c} 36px`},children:i.map(e=>(0,X.jsx)(`div`,{className:e.kind===`text`?``:`text-right`,children:e.label},e.id))}),(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map((e,t)=>(0,X.jsxs)(`div`,{className:`grid grid-cols-6 gap-2 rounded-lg bg-paper p-2 sm:bg-transparent sm:p-0 sm:[grid-template-columns:var(--cols)]`,style:{"--cols":`${c} 36px`},children:[i.map((n,r)=>(0,X.jsxs)(`label`,{className:Q(`flex min-w-0 flex-col gap-1 sm:col-span-1`,r===0?`col-span-5`:i.length-1<=2?`col-span-3`:`col-span-2`),children:[(0,X.jsx)(`span`,{className:`px-0.5 text-[0.6875rem] text-ink-3 sm:hidden`,children:n.label}),(0,X.jsx)(`input`,{"aria-label":n.label,placeholder:n.label,inputMode:n.kind===`text`?`text`:`decimal`,autoComplete:`off`,value:String(e[n.id]??``),onChange:e=>s(t,n.id,e.target.value),className:Q(`h-11 w-full min-w-0 rounded-md border border-transparent bg-paper-2 px-2.5 text-[0.875rem] outline-none placeholder:text-transparent focus:border-focus focus:bg-card sm:placeholder:text-ink-4`,n.kind!==`text`&&`text-right tabular-nums`)})]},n.id)),(0,X.jsx)(yS,{label:Z(`list.delete`),onClick:()=>r(a.filter((e,n)=>n!==t)),className:`order-first col-start-6 row-start-1 size-11 justify-self-end self-end sm:order-none sm:col-start-auto sm:row-start-auto`,children:(0,X.jsx)(Cb,{className:`size-4`})})]},t))}),(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-end justify-between gap-3 px-2 pb-1`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>r([...a,{}]),className:`inline-flex h-9 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent coarse:h-11`,children:[(0,X.jsx)(tb,{className:`size-4`}),` `,Z(`run.addRow`)]}),(0,X.jsxs)(`div`,{className:`text-right text-[0.8125rem] tabular-nums`,children:[(0,X.jsxs)(`div`,{className:`text-ink-3`,children:[Z(`run.net`),` `,Kk(o.net,o.currency)]}),o.vatRate?(0,X.jsxs)(`div`,{className:`text-ink-3`,children:[Z(`run.vat`,{r:o.vatRate}),` `,Kk(o.vat,o.currency)]}):null,(0,X.jsxs)(`div`,{className:`font-semibold text-[0.9375rem] text-ink`,children:[Z(`run.total`),` `,Kk(o.gross,o.currency)]})]})]})]})}function Jk(e){return!!e?.closest(`input, textarea, [contenteditable='true']`)}function Yk({field:e,value:t,runId:n,onChange:r,onBusy:i}){let a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(null),c=(0,y.useRef)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)({}),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(!1),[_,v]=(0,y.useState)(!1),[b,x]=(0,y.useState)(null),S=(0,y.useRef)(null),C=e=>{S.current=e,x(e)},w=e.kind===`image`,T=!!e.multiple,E=T?e.max??30:1,D=w||!!e.camera||!!e.video,ee=!w&&!!e.video,O=Array.isArray(t)?t:typeof t==`string`&&t?[t]:[],k=(0,y.useRef)(O);k.current=O;let A=O.length<E,te=async e=>{let t=(w?e.filter(e=>e.type.startsWith(`image/`)):e).sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));if(!t.length)return;let a=E-(T?k.current.length:0);u(!0),i?.(!0),m(t.length>a&&T?Z(`run.maxFiles`,{n:E}):null);try{for(let e of t.slice(0,Math.max(0,a))){let t=await JO(e),i=await hS.upload(`/api/runs/${n}/uploads`,t);f(e=>({...e,[i.id]:{name:i.name,mime:i.mime}}));let a=T?[...k.current,i.id]:i.id;k.current=T?a:[i.id],r(a)}}catch(e){m(e.message)}finally{u(!1),i?.(!1)}},ne=(0,y.useRef)(te);ne.current=te;let re=e=>{let t=O.filter(t=>t!==e);r(T?t:void 0)},ie=(e,t)=>{let n=k.current.indexOf(e),i=Math.min(k.current.length-1,Math.max(0,t));if(n<0||n===i)return;let a=k.current.filter(t=>t!==e);a.splice(i,0,e),k.current=a,r(a)},ae=T&&O.length>1;(0,y.useEffect)(()=>{if(!A)return;let e=e=>{let t=Array.from(e.clipboardData?.files??[]),n=a.current;if(!t.length||!n||Jk(document.activeElement))return;let r=document.querySelectorAll(`[data-upload-field]`);(n.matches(`:hover`)||n.contains(document.activeElement)||r.length===1)&&(e.preventDefault(),ne.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[A]);let oe=Q(`flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink`,O.length?`py-4`:`py-8`);return(0,X.jsxs)(`div`,{ref:a,"data-upload-field":``,onDragOver:e=>{A&&(e.preventDefault(),v(!0))},onDragLeave:()=>v(!1),onDrop:e=>{v(!1),A&&(e.preventDefault(),te(Array.from(e.dataTransfer.files)))},children:[O.length?(0,X.jsx)(`div`,{className:`mb-2 flex flex-col gap-2`,children:O.map((e,t)=>{let r=d[e],i=r?.mime??(w?`image/`:``);return(0,X.jsxs)(`div`,{"data-file-id":e,className:Q(`flex items-center gap-3 rounded-xl bg-card p-2 ring-1 ring-input transition-shadow`,b===e&&`relative z-10 shadow-elevated ring-2 ring-ember`),children:[ae?(0,X.jsxs)(`button`,{type:`button`,"aria-label":Z(`run.moveFile`,{n:t+1}),title:Z(`run.moveFileHint`),className:Q(`-mr-1 flex h-14 w-9 shrink-0 touch-none flex-col items-center justify-center gap-0.5 rounded-lg text-ink-3 hover:bg-paper-2 hover:text-ink`,b===e?`cursor-grabbing`:`cursor-grab`),onPointerDown:t=>{try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}C(e)},onPointerMove:t=>{if(S.current!==e)return;let n=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[data-file-id]`),r=n?.getAttribute(`data-file-id`);r&&r!==e&&a.current?.contains(n??null)&&ie(e,k.current.indexOf(r))},onPointerUp:()=>C(null),onPointerCancel:()=>C(null),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),ie(e,t+(n.key===`ArrowUp`?-1:1)))},children:[(0,X.jsx)(`span`,{className:`font-medium text-[0.75rem] tabular-nums`,children:t+1}),(0,X.jsx)(hy,{className:`size-4`})]}):null,i.startsWith(`image/`)?(0,X.jsx)(`img`,{src:uS(`/api/runs/${n}/assets/${e}`),alt:``,className:`size-14 rounded-lg object-cover`}):(0,X.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-lg bg-paper-2`,children:i.startsWith(`video/`)?(0,X.jsx)(sy,{className:`size-5 text-ink-3`}):(0,X.jsx)(qy,{className:`size-5 text-ink-3`})}),(0,X.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[0.875rem]`,children:r?.name??`✓`}),(0,X.jsx)(yS,{label:Z(`run.removeFile`),onClick:()=>re(e),children:(0,X.jsx)(Lb,{className:`size-4`})})]},e)})}):null,A?(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>o.current?.click(),className:Q(oe,`min-w-[9rem] flex-1 px-4`,_&&`border-ember text-ink`),children:[w?(0,X.jsx)(_y,{className:`size-6`}):(0,X.jsx)(qy,{className:`size-6`}),l?Z(`run.uploading`):O.length?Z(`run.uploadMore`):Z(qD?`run.uploadTouch`:`run.upload`)]}),D?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>JD?g(!0):s.current?.click(),className:Q(oe,`w-28`),children:[(0,X.jsx)(Fv,{className:`size-6`}),Z(`run.camera`)]}):null,ee&&!(JD&&ak)?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:Q(oe,`w-28`),children:[(0,X.jsx)(jb,{className:`size-6`}),Z(`camera.video`)]}):null]}):null,(0,X.jsx)(`input`,{ref:o,type:`file`,hidden:!0,multiple:T,accept:w?`image/*`:void 0,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),(0,X.jsx)(`input`,{ref:s,type:`file`,hidden:!0,accept:`image/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}),ee?(0,X.jsx)(`input`,{ref:c,type:`file`,hidden:!0,accept:`video/*`,capture:`environment`,onChange:e=>{te(Array.from(e.target.files??[])),e.target.value=``}}):null,(0,X.jsx)(ok,{open:h,multiple:T,video:ee,onClose:()=>g(!1),onCapture:e=>te([e]),onNative:()=>s.current?.click()}),T&&(e.min||e.max)?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.min&&O.length<e.min?Z(`run.filesMin`,{n:O.length,min:e.min}):e.max?Z(`run.filesOf`,{n:O.length,max:e.max}):null}):null,p?(0,X.jsx)(`div`,{className:`mt-2 text-[0.8125rem] text-rose`,children:p}):null]})}function Xk(e){let t=`${e.id} ${e.label}`.toLowerCase();return/telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t)?{type:`tel`,inputMode:`tel`,autoComplete:`tel`}:/\bplz\b|postleitzahl|postal|zip/.test(t)?{inputMode:`numeric`,autoComplete:`postal-code`}:/iban/.test(t)?{autoCapitalize:`characters`,autoCorrect:`off`,spellCheck:!1}:/vorname|first.?name/.test(t)?{autoComplete:`given-name`,autoCapitalize:`words`}:/nachname|last.?name|surname/.test(t)?{autoComplete:`family-name`,autoCapitalize:`words`}:/firma|unternehmen|company|organi[sz]ation/.test(t)?{autoComplete:`organization`,autoCapitalize:`words`}:/straße|strasse|street|anschrift|adresse|address/.test(t)?{autoComplete:`street-address`,autoCapitalize:`words`}:/\b(ort|stadt|city|town)\b/.test(t)?{autoComplete:`address-level2`,autoCapitalize:`words`}:/\bname\b|ansprechp/.test(t)?{autoComplete:`name`,autoCapitalize:`words`}:{autoCapitalize:`sentences`}}function Zk({field:e,value:t,onChange:n}){let[r,i]=(0,y.useState)(!1);return(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(SS,{value:t,placeholder:e.placeholder,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>n(e.target.value)}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`inline-flex h-11 shrink-0 items-center gap-2 rounded-lg border border-input bg-card px-3.5 font-medium text-[0.875rem] text-ink-2 transition hover:border-ember hover:text-ink`,children:[(0,X.jsx)(sb,{className:`size-4`}),` `,Z(`scan.button`)]}),(0,X.jsx)(xk,{open:r,onClose:()=>i(!1),onResult:n})]})}var Qk=4;function $k(e){let t=new Map,n=e.map(e=>({value:e,slot:Vu(e)})).filter(e=>e.slot).sort((e,t)=>Date.parse(e.value)-Date.parse(t.value));for(let{value:e,slot:r}of n){if(!r)continue;let n=t.get(r.day)??{label:Hu(e,Kx),times:[]};n.times.push({value:e,time:r.time}),t.set(r.day,n)}return[...t.values()]}function eA({name:e,label:t,options:n,value:r,onChange:i,disabled:a}){let o=$k(n),s=o.findIndex(e=>e.times.some(e=>e.value===r)),[c,l]=(0,y.useState)(s>=Qk);if(!o.length)return(0,X.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:Z(`slot.none`)});let u=c?o:o.slice(0,Qk);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`fieldset`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,X.jsx)(`legend`,{className:`sr-only`,children:t}),u.map(t=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`mb-2 font-medium text-[0.75rem] text-ink-3`,children:t.label}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.times.map(n=>(0,X.jsxs)(`label`,{className:`relative`,children:[(0,X.jsx)(`input`,{type:`radio`,name:`slot-${e}`,value:n.value,checked:n.value===r,disabled:a.has(n.value),"aria-label":`${t.label}, ${n.time}`,onChange:()=>i(n.value),className:`peer sr-only`}),(0,X.jsx)(`span`,{className:Q(`inline-flex h-10 cursor-pointer items-center rounded-full border px-4 text-sm tabular-nums transition coarse:h-11`,`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`,`peer-checked:border-ember peer-checked:bg-ember-tint peer-checked:text-ink`,`peer-disabled:pointer-events-none peer-disabled:line-through peer-disabled:opacity-60`,`peer-focus-visible:outline-[1.5px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-(--focus-line) peer-focus-visible:outline-solid`),children:n.time})]},n.value))})]},t.label))]}),o.length>u.length?(0,X.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`self-start text-[0.8125rem] text-ink-3 underline-offset-4 transition hover:text-ink hover:underline coarse:min-h-11`,children:Z(`slot.later`)}):null]})}function tA({field:e,value:t,values:n,runId:r,view:i,onChange:a,onBusy:o,error:s,closed:c}){let l=t==null?``:String(t),u=new Set(c?.values.map(String)),d;switch(e.kind){case`textarea`:d=(0,X.jsx)(wS,{value:l,placeholder:e.placeholder,autoCapitalize:`sentences`,enterKeyHint:`enter`,onChange:e=>a(e.target.value)});break;case`number`:d=(0,X.jsx)(SS,{inputMode:`decimal`,autoComplete:`off`,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`select`:{let t=e.options??[];d=t.length<=5&&t.every(e=>e.length<=28)?(0,X.jsx)(ES,{value:l,options:t,onChange:a,disabled:[...u]}):(0,X.jsx)(TS,{value:l,placeholder:`—`,onChange:a,options:t.map(e=>({value:e,label:e,disabled:u.has(e)}))});break}case`slot`:d=(0,X.jsx)(eA,{name:e.id,label:e.label,options:e.options??[],value:l,onChange:a,disabled:u});break;case`multiselect`:d=(0,X.jsx)(ES,{multi:!0,value:Array.isArray(t)?t:[],options:e.options??[],onChange:a});break;case`date`:d=(0,X.jsx)(SS,{type:`date`,value:l,onChange:e=>a(e.target.value),className:`w-full sm:w-56`});break;case`email`:d=(0,X.jsx)(SS,{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)});break;case`url`:d=(0,X.jsx)(SS,{type:`url`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,value:l,placeholder:e.placeholder??`https://`,onChange:e=>a(e.target.value)});break;case`toggle`:d=(0,X.jsx)(DS,{checked:t===!0,onChange:a,label:e.label,disabled:u.has(String(t!==!0))});break;case`color`:d=(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(CS,{value:l||`#e0531b`,onChange:e=>a(e.target.value)}),(0,X.jsx)(SS,{value:l,placeholder:`#e0531b`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>a(e.target.value),className:`w-36`})]});break;case`image`:case`file`:d=(0,X.jsx)(Yk,{field:e,value:t,runId:r,onChange:a,onBusy:o});break;case`items`:d=(0,X.jsx)(qk,{field:e,value:t,values:n,onChange:a});break;case`connection`:d=(0,X.jsx)(Ak,{runId:r,connection:i?.connections.find(t=>t.id===e.connection)});break;case`list`:{let t=i?.lists.find(t=>t.def.id===e.list);d=t?(0,X.jsx)(Pk,{runId:r,list:t,editable:!0}):null;break}case`location`:d=(0,X.jsx)(dk,{value:t,runId:r,placeholder:e.placeholder,onChange:a,onBusy:o});break;case`audio`:d=c?null:(0,X.jsx)(Gk,{value:t,runId:r,onChange:a,onBusy:o});break;case`signature`:d=(0,X.jsx)(Ok,{label:e.label,value:t,runId:r,onChange:a});break;default:d=e.scan?(0,X.jsx)(Zk,{field:e,value:l,onChange:a}):(0,X.jsx)(SS,{...Xk(e),value:l,placeholder:e.placeholder,onChange:e=>a(e.target.value)})}return(0,X.jsxs)(`div`,{children:[e.kind===`toggle`?(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,X.jsx)(OS,{hint:e.help,children:e.label}),d]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(OS,{hint:e.help,required:e.required,children:e.label}),d]}),c?(0,X.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:Z(`run.closed`,{list:c.classes.map(e=>Z(`run.cls.${nA[e]}`)).join(`, `)})}):null,s?(0,X.jsx)(`div`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:s}):null]})}var nA={classifier:`text`,standard:`text`,high:`text`,highest:`text`,image:`image`,video:`video`,speech:`speech`,audio:`audio`},rA=45e3;function iA(e){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)({});(0,y.useEffect)(()=>{if(n(null),o(!1),!e)return;let t=!1,r=0,i,a=null,s=Date.now(),c=()=>{t=!0,a?.close(),o(!0)},l=async()=>{try{let r=await hS.get(`/api/runs/${e}`);t||n(r)}catch(e){e instanceof fS&&e.status===404&&c()}},u=()=>{if(clearTimeout(i),a?.close(),t)return;let o=new EventSource(uS(`/api/runs/${e}/stream`),{withCredentials:!0});a=o,s=Date.now(),o.addEventListener(`view`,e=>{r=0,s=Date.now(),n(JSON.parse(e.data))}),o.addEventListener(`ping`,()=>{s=Date.now()}),o.onerror=()=>{o.close(),!(t||a!==o)&&(a=null,l(),r=Math.min(r+1,6),i=setTimeout(u,500*2**r))}},d=()=>{t||document.visibilityState!==`visible`||(!a||a.readyState===EventSource.CLOSED||Date.now()-s>rA?(r=0,u()):l())},f=setInterval(()=>{!t&&a&&Date.now()-s>rA&&(r=0,u())},15e3);return u(),document.addEventListener(`visibilitychange`,d),window.addEventListener(`pageshow`,d),window.addEventListener(`online`,d),()=>{t=!0,clearTimeout(i),clearInterval(f),document.removeEventListener(`visibilitychange`,d),window.removeEventListener(`pageshow`,d),window.removeEventListener(`online`,d),a?.close()}},[e]);let d=(0,y.useCallback)(async(t,n)=>{if(!e)return!1;c(!0),i(null),u({});try{return await hS.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof fS&&e.status===422&&Array.isArray(e.body?.fields)&&u(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),i(e.message),!1}finally{c(!1)}},[e]);return{view:t,notFound:a,error:r,busy:s,fieldErrors:l,submitPage:(e,t)=>d(`pages/${e}`,{values:t}),accept:(e,t)=>d(`reviews/${e}`,{type:`accept`,edits:t}),regenerate:(e,t,n,r)=>d(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>d(`back`),retry:()=>d(`retry`)}}function aA({view:e}){let t=Math.round(Math.min(e.progress.done,e.progress.total)/Math.max(1,e.progress.total)*100);return(0,X.jsx)(`div`,{className:`h-[3px] w-full bg-paper-2`,children:(0,X.jsx)(`div`,{className:`h-full bg-ember transition-[width] duration-700 ease-out`,style:{width:`${t}%`}})})}function oA({title:e,description:t,kicker:n}){return(0,X.jsxs)(`div`,{className:`mb-8`,children:[n?(0,X.jsx)(`p`,{className:`mb-4 text-[0.9375rem] text-ink-2 leading-relaxed`,children:n}):null,(0,X.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] leading-[1.15] tracking-tight sm:text-[2rem]`,children:e}),t?(0,X.jsx)(`p`,{className:`mt-2 text-[0.9375rem] text-ink-3 leading-relaxed`,children:t}):null]})}function sA(e,t){let n={};for(let r of e.fields)n[r.id]=t.values[r.id]??t.prefill?.[r.id]??r.default??(r.kind===`multiselect`?[]:void 0);return n}function cA(e){return Array.from(e.querySelectorAll(`input:not([type="hidden"], [type="file"], [type="checkbox"], [type="color"], [type="range"], [disabled]), textarea:not([disabled])`)).filter(e=>!e.closest(`dialog`)&&e.offsetParent!==null)}function lA({view:e,run:t,step:n}){let[r,i]=(0,y.useState)(()=>sA(n,e)),[a,o]=(0,y.useState)(new Set),s=(0,y.useRef)(null),c=e.progress.done===0,l=zu((0,y.useMemo)(()=>n.fields.filter(t=>!Ru(t)||e.decidedFields?.includes(t.id)).map(t=>e.options?.[t.id]?.length?{...t,options:e.options[t.id]}:t),[n.fields,e.options,e.decidedFields]),e.known??{},r),u=()=>void t.submitPage(n.id,r);return(0,y.useEffect)(()=>{if(!s.current)return;let e=cA(s.current).filter(e=>e instanceof HTMLInputElement);for(let[t,n]of e.entries())(n.dataset.hint||!n.hasAttribute(`enterkeyhint`))&&(n.dataset.hint=`1`,n.setAttribute(`enterkeyhint`,t===e.length-1?`go`:`next`))}),(0,X.jsxs)(`form`,{ref:s,className:`animate-rise`,onSubmit:e=>{e.preventDefault(),a.size||u()},onKeyDown:e=>{let t=e.target;if(e.key!==`Enter`||e.defaultPrevented||e.nativeEvent.isComposing||!(t instanceof HTMLInputElement)||t.closest(`dialog`))return;let n=cA(e.currentTarget),r=n[n.indexOf(t)+1];r&&(e.preventDefault(),r.focus())},children:[(0,X.jsx)(oA,{title:n.title,description:n.description,kicker:c?e.wizard.intro:null}),(0,X.jsx)(`div`,{className:`flex flex-col gap-7`,children:l.map(n=>(0,X.jsx)(tA,{field:n,value:r[n.id],values:r,runId:e.id,view:e,error:t.fieldErrors[n.id],closed:e.closed?.[n.id],onChange:e=>i(t=>({...t,[n.id]:e})),onBusy:e=>o(t=>{if(t.has(n.id)===e)return t;let r=new Set(t);return e?r.add(n.id):r.delete(n.id),r})},n.id))}),(0,X.jsx)(uA,{view:e,run:t,sticky:!0,children:(0,X.jsxs)(vS,{type:`submit`,size:`lg`,busy:t.busy,disabled:a.size>0,children:[n.cta||Z(`run.next`),` `,(0,X.jsx)(Tv,{className:`size-4`})]})})]})}function uA({view:e,run:t,sticky:n,children:r}){return(0,X.jsxs)(`div`,{className:Q(`mt-10 flex items-center justify-between gap-3`,n&&`action-bar`),children:[e.canBack?(0,X.jsxs)(vS,{variant:`ghost`,onClick:()=>void t.back(),disabled:t.busy,children:[(0,X.jsx)(Cv,{className:`size-4`}),` `,Z(`run.back`)]}):(0,X.jsx)(`span`,{}),r]})}function dA(){let e=aO(),[t,n]=(0,y.useState)(!1),r=e!==`off`;return(0,X.jsxs)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:t,onClick:async()=>{if(r){cO();return}n(!0),await sO(),n(!1)},className:Q(`inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition`,r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4`),children:[r?(0,X.jsx)(kv,{className:`size-4 text-ember-strong`}):(0,X.jsx)(jv,{className:`size-4`}),Z(r?`notify.on`:`notify.ask`)]}),(0,X.jsx)(`p`,{className:`max-w-xs text-[0.75rem] text-ink-4 leading-relaxed`,children:Z(e===`off`?`notify.why`:e===`on`?`notify.onHint`:oO()?`notify.blocked`:`notify.quiet`)})]})}function fA({view:e,compact:t,awake:n}){let r=(0,y.useMemo)(()=>{let t=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id);return t?new Date(t.at).getTime():Date.now()},[e.events,e.step?.id]),[i,a]=(0,y.useState)(Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let o=[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id)?.message??e.step?.title??Z(`run.working`),s=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=r-500),c=s.slice(-4),l=[...new Set(s.map(e=>e.asset).filter(e=>!!e))],u=[...s].reverse().find(e=>e.asset)?.asset;return(0,X.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-6 text-center`,children:[(0,X.jsx)(yw,{kind:e.wizard.avatar,size:t?130:170,fluffy:!0}),(0,X.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem] tracking-tight`,children:o}),(0,X.jsx)(`div`,{className:`mt-1 text-[0.8125rem] text-ink-4 tabular-nums`,children:Z(`run.elapsed`,{s:Math.max(0,Math.round((i-r)/1e3))})}),l.length?(0,X.jsx)(`div`,{className:`mt-5 flex max-w-full flex-wrap justify-center gap-2`,children:l.slice(-8).map(t=>(0,X.jsx)(`img`,{src:uS(`/api/runs/${e.id}/assets/${t}`),alt:``,className:Q(`size-16 animate-rise rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft transition sm:size-20`,t===u?`ring-2 ring-ember`:`opacity-70`)},t))}):null,(0,X.jsx)(`div`,{className:`mt-6 flex min-h-[7rem] w-full max-w-sm flex-col gap-1.5`,children:c.map((e,t)=>(0,X.jsxs)(`div`,{className:Q(`flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity`,t===c.length-1?`text-ink-2`:`text-ink-4`),children:[t===c.length-1?(0,X.jsx)(_b,{className:`size-3.5 animate-breathe text-ember`}):null,(0,X.jsx)(`span`,{className:`truncate`,children:Xx(e)})]},e.id))}),t?null:(0,X.jsx)(dA,{}),n?(0,X.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-4`,children:Z(`run.awake`)}):null]})}function pA(e){let t=(0,y.useRef)({running:!1,since:0,ask:null});(0,y.useEffect)(()=>{if(!e)return;let n=t.current,r=e.status===`running`,i=r?n.running?n.since:Date.now():0,a=t=>{document.visibilityState!==`visible`&&!document.title.startsWith(`● `)&&(document.title=`● ${document.title}`),uO({title:e.wizard.title,body:t,tag:e.id})};r&&e.ask&&e.ask.id!==n.ask?a(Z(`notify.needsYou`)):!r&&n.running&&Date.now()-n.since>8e3&&a(e.status===`failed`?Z(`run.failed`):e.status===`done`?Z(`notify.done`):Z(`notify.next`)),t.current={running:r,since:i,ask:e.ask?.id??null}},[e]),(0,y.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&document.title.startsWith(`● `)&&(document.title=document.title.slice(2))};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}function mA({view:e,run:t,step:n}){let[r,i]=(0,y.useState)({}),[a,o]=(0,y.useState)({}),[s,c]=(0,y.useState)(``),l=e.shown.filter(e=>e.output),[u,d]=(0,y.useState)(l.length===1?l[0].step.id:null),[f,p]=(0,y.useState)({}),m=(0,y.useRef)(null),h=l.find(e=>e.step.id===u),g=h?.step.type===`generate`&&(h.output?.assets?.length??0)>1,_=()=>{h&&s.trim()&&t.regenerate(n.id,h.step.id,s.trim(),f[h.step.id])};return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsx)(oA,{title:n.title,description:n.description}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.shown.filter(e=>e.output).map(({step:t,output:s})=>{let c=!!n.edit&&t.type===`agent`&&t.output.format!==`json`;return(0,X.jsxs)(`section`,{children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.title}),(0,X.jsx)(`div`,{className:`flex items-center`,children:c&&!a[t.id]?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>({...e,[t.id]:!0})),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-2 hover:bg-accent hover:text-ink coarse:h-11`,children:[(0,X.jsx)($y,{className:`size-3.5`}),` `,Z(`run.edit`)]}):null})]}),(0,X.jsx)(FO,{base:`/api/runs/${e.id}`,step:t,output:s,editable:c&&a[t.id],draft:r[t.id],onDraft:e=>i(n=>({...n,[t.id]:e})),picked:f[t.id],onPick:n.regenerate?e=>{d(t.id),p(n=>{let r=n[t.id]??[];return{...n,[t.id]:r.includes(e)?r.filter(t=>t!==e):[...r,e]}}),m.current?.focus()}:void 0,onSurfaceAction:n.regenerate?()=>{d(t.id),m.current?.focus()}:void 0})]},t.id)}),e.lists.map(t=>(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]`,children:t.def.title}),t.def.check?(0,X.jsx)(Lk,{runId:e.id,list:t}):(0,X.jsx)(Pk,{runId:e.id,list:t,editable:!0})]},t.def.id)),n.regenerate&&l.length?(0,X.jsxs)(AS,{className:`p-3`,children:[l.length>1?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 pb-2`,children:[(0,X.jsx)(`span`,{className:`mr-1 text-[0.8125rem] text-ink-3`,children:Z(`run.feedbackTarget`)}),l.map(({step:e})=>(0,X.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>{d(e.id),m.current?.focus()},className:Q(`inline-flex h-8 items-center rounded-full px-3 text-[0.8125rem] ring-1 transition coarse:h-11`,u===e.id?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-2 ring-input hover:text-ink`),children:e.title},e.id))]}):null,(0,X.jsx)(wS,{ref:m,minRows:2,maxRows:8,value:s,placeholder:Z(`run.feedbackPlaceholder`),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`border-0 bg-transparent shadow-none focus:ring-0`}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 pt-1`,children:[(0,X.jsx)(`span`,{className:`min-w-0 text-[0.75rem] text-ink-3`,children:g?f[h.step.id]?.length?Z(`run.regeneratePicked`,{n:[...f[h.step.id]].sort((e,t)=>e-t).map(e=>e+1).join(`, `)}):Z(`run.regenerateAll`):!h&&s.trim()?Z(`run.feedbackPick`):null}),(0,X.jsxs)(vS,{size:`sm`,variant:`secondary`,busy:t.busy,disabled:!s.trim()||!h,onClick:_,children:[(0,X.jsx)(rb,{className:`size-3.5`}),` `,Z(`run.regenerateGo`)]})]})]}):null]}),(0,X.jsx)(uA,{view:e,run:t,sticky:!0,children:(0,X.jsxs)(vS,{size:`lg`,busy:t.busy,onClick:()=>void t.accept(n.id,Object.keys(r).length?r:void 0),children:[Z(`run.accept`),` `,(0,X.jsx)(Tv,{className:`size-4`})]})})]})}function hA({view:e,run:t,step:n,onRestart:r}){let i=e.shown.filter(e=>e.output);return(0,X.jsxs)(`div`,{className:`animate-rise`,children:[(0,X.jsxs)(`div`,{className:`mb-8 flex flex-wrap items-center gap-x-4 gap-y-5`,children:[(0,X.jsx)(yw,{kind:e.wizard.avatar,size:64}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 basis-[12rem]`,children:[(0,X.jsx)(`h1`,{className:`text-balance font-display font-semibold text-[1.75rem] leading-tight tracking-tight sm:text-[2rem]`,children:n.title}),n.message?(0,X.jsx)(`p`,{className:`mt-1 text-[0.9375rem] text-ink-3`,children:n.message}):null]}),e.shown.some(e=>e.output)?(0,X.jsx)(`div`,{className:`max-sm:basis-full`,children:(0,X.jsx)(UO,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null})}):null]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i.map(({step:t,output:n,formats:r,label:i})=>(0,X.jsxs)(AS,{className:`p-4 sm:p-5`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:i??t.title}),(0,X.jsx)(BO,{base:`/api/runs/${e.id}`,stepId:t.id,formats:r,title:i??t.title})]}),(0,X.jsx)(FO,{base:`/api/runs/${e.id}`,step:t,output:n}),n?.assets?.some(e=>e.ai)?(0,X.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:Z(`ai.publish`)}):null]},t.id)),e.lists.map(t=>(0,X.jsxs)(AS,{className:`p-4 sm:p-5`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem]`,children:t.label??t.def.title}),(0,X.jsx)(zk,{runId:e.id,list:t})]}),(0,X.jsx)(Pk,{runId:e.id,list:t,editable:!0})]},t.def.id))]}),(0,X.jsx)(uA,{view:e,run:t,children:r?(0,X.jsxs)(vS,{variant:`secondary`,onClick:r,children:[(0,X.jsx)(ab,{className:`size-4`}),` `,Z(`run.again`)]}):(0,X.jsx)(`span`,{})})]})}function gA({view:e,run:t}){return(0,X.jsxs)(`div`,{className:`flex animate-rise flex-col items-center pt-8 text-center`,children:[(0,X.jsx)(yw,{kind:e.wizard.avatar,size:90}),(0,X.jsx)(`h2`,{className:`mt-4 font-display font-semibold text-[1.375rem]`,children:Z(`run.failed`)}),(0,X.jsx)(`p`,{className:`mt-2 max-w-md text-[0.9375rem] text-ink-3`,children:(0,X.jsx)(NS,{text:e.error??``})}),(0,X.jsxs)(`div`,{className:`mt-8 flex gap-3`,children:[e.canBack?(0,X.jsxs)(vS,{variant:`ghost`,onClick:()=>void t.back(),children:[(0,X.jsx)(Cv,{className:`size-4`}),` `,Z(`run.back`)]}):null,(0,X.jsxs)(vS,{onClick:()=>void t.retry(),busy:t.busy,children:[(0,X.jsx)(ab,{className:`size-4`}),` `,Z(`run.retry`)]})]})]})}function _A({runId:e,compact:t,onRestart:n,onView:r,stickyProgress:i}){let a=iA(e),{view:o}=a;(0,y.useEffect)(()=>{r?.(o)},[o,r]),YD();let s=XD(o?.status===`running`&&!o.ask);if(pA(o),a.notFound)return(0,X.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Z(`run.notFound`)});if(!o)return(0,X.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,X.jsx)(kS,{})});let c=o.step,l=null;if(o.status===`running`&&o.ask)l=(0,X.jsx)(WO,{runId:o.id,ask:o.ask},o.ask.id);else if(o.status===`running`)l=(0,X.jsx)(fA,{view:o,compact:t,awake:s});else if(o.status===`failed`)l=(0,X.jsx)(gA,{view:o,run:a});else if(o.status===`cancelled`)l=(0,X.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:Z(`run.cancelled`)});else if(c?.type===`page`)l=(0,X.jsx)(lA,{view:o,run:a,step:c},c.id);else if(c?.type===`review`){let e=o.shown.map(e=>e.output?.at??``).join(`|`);l=(0,X.jsx)(mA,{view:o,run:a,step:c},`${c.id}:${e}`)}else c?.type===`result`&&(l=(0,X.jsx)(hA,{view:o,run:a,step:c,onRestart:n}));let u=c?.type===`review`&&o.status===`waiting_input`&&o.lists.some(e=>e.def.check);return(0,X.jsxs)(`div`,{className:`flex min-h-full flex-col`,children:[i?(0,X.jsx)(`div`,{className:`sticky top-0 z-10`,children:(0,X.jsx)(aA,{view:o})}):(0,X.jsx)(aA,{view:o}),(0,X.jsxs)(`div`,{className:Q(`safe-x mx-auto w-full flex-1`,u?`max-w-[1240px] py-8`:t?`max-w-[620px] py-8`:`max-w-[640px] py-8 sm:py-16`),children:[l,a.error&&o.status!==`failed`?(0,X.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-4 py-3 text-[0.875rem] text-rose`,children:a.error}):null,o.keeps&&o.status!==`running`?(0,X.jsx)(`div`,{className:`mt-10 flex justify-center`,children:(0,X.jsx)(Vk,{runId:o.id})}):null]})]})}var vA=Object.defineProperty,yA=(e,t,n)=>t in e?vA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bA=(e,t)=>{for(var n in t)vA(e,n,{get:t[n],enumerable:!0})},xA=(e,t,n)=>yA(e,typeof t==`symbol`?t:t+``,n),SA={};bA(SA,{Graph:()=>sj,alg:()=>FA});var CA=Object.defineProperty,wA=(e,t)=>{for(var n in t)CA(e,n,{get:t[n],enumerable:!0})},TA=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=OA(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=kA(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,EA(this._preds[a],i),EA(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?AA(this._isDirected,e):OA(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?AA(this._isDirected,e):OA(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?AA(this._isDirected,e):OA(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],DA(this._preds[t],e),DA(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function EA(e,t){e[t]?e[t]++:e[t]=1}function DA(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function OA(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function kA(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function AA(e,t){return OA(e,t.v,t.w,t.name)}wA({},{read:()=>PA,write:()=>jA});function jA(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:MA(e),edges:NA(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function MA(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function NA(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function PA(e){let t=new TA(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var FA={};wA(FA,{CycleException:()=>XA,bellmanFord:()=>LA,components:()=>zA,dijkstra:()=>HA,dijkstraAll:()=>WA,findCycles:()=>KA,floydWarshall:()=>JA,isAcyclic:()=>QA,postorder:()=>nj,preorder:()=>rj,prim:()=>ij,shortestPaths:()=>aj,tarjan:()=>GA,topsort:()=>ZA});var IA=()=>1;function LA(e,t,n,r){return RA(e,String(t),n||IA,r||function(t){return e.outEdges(t)??[]})}function RA(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function zA(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var BA=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},VA=()=>1;function HA(e,t,n,r){return UA(e,String(t),n||VA,r||function(t){return e.outEdges(t)??[]})}function UA(e,t,n,r){let i={},a=new BA,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function WA(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=HA(e,i,t,n),r},{})}function GA(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function KA(e){return GA(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var qA=()=>1;function JA(e,t,n){return YA(e,t||qA,n||function(t){return e.outEdges(t)??[]})}function YA(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var XA=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function ZA(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new XA;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new XA;return r}function QA(e){try{ZA(e)}catch(e){if(e instanceof XA)return!1;throw e}return!0}function $A(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=ej(e,t,n===`post`,o,a,r,i)}),i}function ej(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=ej(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function tj(e,t,n){return $A(e,t,n,function(e,t){return e.push(t),e},[])}function nj(e,t){return tj(e,t,`post`)}function rj(e,t){return tj(e,t,`pre`)}function ij(e,t){var n;let r=new TA,i={},a=new BA,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function aj(e,t,n,r){return oj(e,t,n,r??(t=>e.outEdges(t)??[]))}function oj(e,t,n,r){if(n===void 0)return HA(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return LA(e,t,n,r)}return HA(e,t,n,r)}var sj=TA;function cj(e,t,n,r){let i=r;for(;e.hasNode(i);)i=wj(r);return n.dummy=t,e.setNode(i,n),i}function lj(e){let t=new sj().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function uj(e){let t=new sj({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function dj(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function fj(e){let t=Tj(yj(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function pj(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=vj(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function mj(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=vj(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function hj(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),cj(e,`border`,i,t)}function gj(e,t=_j){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var _j=65535;function vj(e,t){return t.length>_j?e(...gj(t).map(t=>e(...t))):e(...t)}function yj(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return vj(Math.max,t)}function bj(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function xj(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Sj(e,t){return t()}var Cj=0;function wj(e){return e+(``+ ++Cj)}function Tj(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Ej(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Dj(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Oj(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var kj=`\0`;function Aj(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var jj=`3.1.1`,Mj=class{constructor(){xA(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Nj(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Nj(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Pj)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Nj(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Pj(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Fj=Mj,Ij=()=>1;function Lj(e,t){if(e.nodeCount()<=1)return[];let n=Bj(e,t||Ij);return Rj(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Rj(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)zj(e,t,n,o);for(;o=i.dequeue();)zj(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(zj(e,t,n,o,!0)||[]);break}}}return r}function zj(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,Vj(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,Vj(t,n,o)}),e.removeNode(r.v),o}function Bj(e,t){let n=new sj,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=Hj(i+r+3).map(()=>new Fj),o=r+1;return n.nodes().forEach(e=>{Vj(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function Vj(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function Hj(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Uj(e,t){(e.graph().acyclicer===`greedy`?Lj(e,n(e)):Wj(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,wj(`rev`))});function n(e){return t=>e.edge(t).weight}}function Wj(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&Kj(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function Gj(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Kj(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function qj(e){e.graph().dummyChains=[],e.edges().forEach(t=>Jj(e,t))}function Jj(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=cj(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Yj(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Xj(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=vj(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function Zj(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Qj=$j;function $j(e){let t=new sj({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;eM(t,e)<i&&(a=tM(t,e),a);)o=t.hasNode(a.v)?Zj(e,a):-Zj(e,a),nM(t,e,o);return t}function eM(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Zj(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function tM(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=Zj(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function nM(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:rM,postorder:iM}=FA,aM=oM;oM.initLowLimValues=uM,oM.initCutValues=sM,oM.calcCutValue=lM,oM.leaveEdge=fM,oM.enterEdge=pM,oM.exchangeEdges=mM;function oM(e){e=lj(e),Xj(e);let t=Qj(e);uM(t),sM(t,e);let n,r;for(;n=fM(t);)r=pM(t,e,n),mM(t,e,n,r)}function sM(e,t){let n=iM(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>cM(e,t,n))}function cM(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=lM(e,t,n)}function lM(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,gM(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function uM(e,t){arguments.length<2&&(t=e.nodes()[0]),dM(e,{},1,t)}function dM(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=dM(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function fM(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function pM(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===_M(e,e.node(t.v),s)&&c!==_M(e,e.node(t.w),s)).reduce((e,n)=>Zj(t,n)<Zj(t,e)?n:e)}function mM(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),uM(e),sM(e,t),hM(e,t)}function hM(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=rM(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function gM(e,t,n){return e.hasEdge(t,n)}function _M(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var vM=yM;function yM(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:SM(e);break;case`tight-tree`:xM(e);break;case`longest-path`:bM(e);break;case`none`:break;default:SM(e)}}var bM=Xj;function xM(e){Xj(e),Qj(e)}function SM(e){aM(e)}var CM=wM;function wM(e){let t=EM(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=TM(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function TM(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function EM(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(kj).forEach(r),t}function DM(e){let t=cj(e,`root`,{},`_root`),n=kM(e),r=Object.values(n),i=vj(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=AM(e)+1;e.children(kj).forEach(r=>{OM(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function OM(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=hj(e,`_bt`),l=hj(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{OM(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function kM(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(kj).forEach(e=>n(e,1)),t}function AM(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function jM(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var MM=NM;function NM(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)PM(e,`borderLeft`,`_bl`,n,i,t),PM(e,`borderRight`,`_br`,n,i,t)}}e.children(kj).forEach(t)}function PM(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=cj(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function FM(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&LM(e)}function IM(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&zM(e),(t===`lr`||t===`rl`)&&(VM(e),LM(e))}function LM(e){e.nodes().forEach(t=>RM(e.node(t))),e.edges().forEach(t=>RM(e.edge(t)))}function RM(e){let t=e.width;e.width=e.height,e.height=t}function zM(e){e.nodes().forEach(t=>BM(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(BM),Object.hasOwn(r,`y`)&&BM(r)})}function BM(e){e.y=-e.y}function VM(e){e.nodes().forEach(t=>HM(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(HM),Object.hasOwn(r,`x`)&&HM(r)})}function HM(e){let t=e.x;e.x=e.y,e.y=t}function UM(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=Tj(vj(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return Aj(t,e.node(n),e.node(r))}return a}function WM(e,t){let n=0;for(let r=1;r<t.length;++r)n+=GM(e,t[r-1],t[r]);return n}function GM(e,t,n){let r=Oj(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function KM(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function qM(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),JM(Object.values(n).filter(e=>!e.indegree))}function JM(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&YM(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Ej(e,[`vs`,`i`,`barycenter`,`weight`]))}function YM(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function XM(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=bj(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(QM(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=ZM(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=ZM(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function ZM(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function QM(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=Aj(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function $M(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=KM(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=$M(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&tN(t,r)}});let h=qM(m,n);eN(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=XM(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function eN(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function tN(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function nN(e,t,n,r){r||=e.nodes();let i=rN(e),a=new sj({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function rN(e){let t;for(;e.hasNode(t=wj(`_root`)););return t}function iN(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function aN(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,aN);return}let r=yj(e),i=oN(e,Tj(1,r+1),`inEdges`),a=oN(e,Tj(r-1,-1,-1),`outEdges`),o=UM(e,n);if(cN(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){sN(t%2?i:a,t%4>=2,l,n),o=fj(e);let u=WM(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}cN(e,c)}function oN(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return nN(e,t,n,r.get(t)||[])})}function sN(e,t,n,r){let i=!0,a=new sj;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=$M(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),iN(e,a,s.vs)})}function cN(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function lN(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=dN(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&fN(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function uN(e,t){let n={};function r(t,r,i,a,o){Tj(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&fN(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function dN(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function fN(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function pN(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function mN(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||CN(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>CN(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!pN(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function hN(e,t,n,r,i=!1){let a={},o=gN(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function gN(e,t,n,r){let i=new sj,a=e.graph(),o=xN(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function _N(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=SN(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function vN(e,t){let n=Object.values(t),r=vj(Math.min,n),i=vj(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-vj(Math.min,c);a!==`l`&&(l=i-vj(Math.max,c)),l&&(e[o]=Dj(s,e=>e+l))})})}function yN(e,t=void 0){let n=e.ul;return n?Dj(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function bN(e,t){let n=fj(e),r=Object.assign(lN(e,n),uN(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=mN(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=hN(e,a,s.root,s.align,n===`r`);n===`r`&&(c=Dj(c,e=>-e)),i[o+n]=c})}),vN(i,_N(e,i)),yN(i,e.graph().align)}function xN(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function SN(e,t){return e.node(t).width}function CN(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function wN(e,t){e=uj(e),TN(e),Object.entries(bN(e,t)).forEach(([t,n])=>e.node(t).x=n)}function TN(e){let t=fj(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var EN=new WeakMap;function DN(e,t={}){return kN(e,Sj,t),e}function ON(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function kN(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new sj({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=ON(e,t.v,r),i=ON(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),kN(o,t,n);let l=BN(o);AN(l,t,n,null),jN(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=BN(e),g=AN(h,t,n,EN.get(e)??null);EN.set(e,g),jN(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function AN(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>VN(e)),t(` removeSelfEdges`,()=>XN(e)),t(` acyclic`,()=>Uj(e,s)),t(` nestingGraph.run`,()=>DM(e)),t(` rank`,()=>vM(uj(e))),t(` injectEdgeLabelProxies`,()=>HN(e)),t(` removeEmptyRanks`,()=>mj(e)),t(` nestingGraph.cleanup`,()=>jM(e)),t(` normalizeRanks`,()=>pj(e)),t(` assignRankMinMax`,()=>UN(e)),t(` removeEdgeLabelProxies`,()=>WN(e)),t(` normalize.run`,()=>qj(e)),t(` parentDummyChains`,()=>CM(e)),t(` addBorderSegments`,()=>MM(e)),t(` order`,()=>aN(e,n,c)),t(` insertSelfEdges`,()=>ZN(e)),t(` adjustCoordinateSystem`,()=>FM(e)),t(` position`,()=>wN(e,n.corePath)),t(` positionSelfEdges`,()=>QN(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>YN(e)),t(` normalize.undo`,()=>Yj(e)),t(` fixupEdgeLabelCoords`,()=>qN(e)),t(` undoCoordinateSystem`,()=>IM(e)),t(` translateGraph`,()=>GN(e)),t(` assignNodeIntersects`,()=>KN(e)),t(` reversePoints`,()=>JN(e)),t(` acyclic.undo`,()=>Gj(e)),{graph:e,rawNodes:l}}function jN(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var MN=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],NN={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},PN=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],FN=[`width`,`height`,`rank`],IN={width:0,height:0},LN=[`minlen`,`weight`,`width`,`height`,`labeloffset`],RN={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},zN=[`labelpos`];function BN(e){let t=new sj({multigraph:!0,compound:!0}),n=eP(e.graph());return t.setGraph(Object.assign({},NN,$N(n,MN),Ej(n,PN))),e.nodes().forEach(n=>{let r=$N(eP(e.node(n)),FN);Object.keys(IN).forEach(e=>{r[e]===void 0&&(r[e]=IN[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=eP(e.edge(n));t.setEdge(n,Object.assign({},RN,$N(r,LN),Ej(r,zN)))}),t}function VN(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function HN(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);cj(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function UN(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function WN(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function GN(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function KN(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(dj(r,a)),n.points.push(dj(i,o))})}function qN(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function JN(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function YN(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function XN(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function ZN(e){fj(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{cj(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function QN(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function $N(e,t){return Dj(Ej(e,t),Number)}function eP(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function tP(e){let t=fj(e),n=new sj({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var nP={graphlib:SA,version:jj,layout:DN,debug:tP,util:{time:xj,notime:Sj}};function rP(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=rP(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var iP={value:()=>{}};function aP(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new oP(n)}function oP(e){this._=e}function sP(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}oP.prototype=aP.prototype={constructor:oP,on:function(e,t){var n=this._,r=sP(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=cP(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=lP(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lP(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new oP(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function cP(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lP(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=iP,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uP={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function dP(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),uP.hasOwnProperty(t)?{space:uP[t],local:e}:e}function fP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function pP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mP(e){var t=dP(e);return(t.local?pP:fP)(t)}function hP(){}function gP(e){return e==null?hP:function(){return this.querySelector(e)}}function _P(e){typeof e!=`function`&&(e=gP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new aI(r,this._parents)}function vP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yP(){return[]}function bP(e){return e==null?yP:function(){return this.querySelectorAll(e)}}function xP(e){return function(){return vP(e.apply(this,arguments))}}function SP(e){e=typeof e==`function`?xP(e):bP(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new aI(r,i)}function CP(e){return function(){return this.matches(e)}}function wP(e){return function(t){return t.matches(e)}}var TP=Array.prototype.find;function EP(e){return function(){return TP.call(this.children,e)}}function DP(){return this.firstElementChild}function OP(e){return this.select(e==null?DP:EP(typeof e==`function`?e:wP(e)))}var kP=Array.prototype.filter;function AP(){return Array.from(this.children)}function jP(e){return function(){return kP.call(this.children,e)}}function MP(e){return this.selectAll(e==null?AP:jP(typeof e==`function`?e:wP(e)))}function NP(e){typeof e!=`function`&&(e=CP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new aI(r,this._parents)}function PP(e){return Array(e.length)}function FP(){return new aI(this._enter||this._groups.map(PP),this._parents)}function IP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}IP.prototype={constructor:IP,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function LP(e){return function(){return e}}function RP(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new IP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function zP(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new IP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function BP(e){return e.__data__}function VP(e,t){if(!arguments.length)return Array.from(this,BP);var n=t?zP:RP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=LP(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=HP(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new aI(o,r),o._enter=s,o._exit=c,o}function HP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function UP(){return new aI(this._exit||this._groups.map(PP),this._parents)}function WP(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function GP(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new aI(s,this._parents)}function KP(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function qP(e){e||=JP;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new aI(i,this._parents).order()}function JP(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function YP(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XP(){return Array.from(this)}function ZP(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function QP(){let e=0;for(let t of this)++e;return e}function $P(){return!this.node()}function eF(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function tF(e){return function(){this.removeAttribute(e)}}function nF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rF(e,t){return function(){this.setAttribute(e,t)}}function iF(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function aF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function sF(e,t){var n=dP(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?nF:tF:typeof t==`function`?n.local?oF:aF:n.local?iF:rF)(n,t))}function cF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lF(e){return function(){this.style.removeProperty(e)}}function uF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dF(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function fF(e,t,n){return arguments.length>1?this.each((t==null?lF:typeof t==`function`?dF:uF)(e,t,n??``)):pF(this.node(),e)}function pF(e,t){return e.style.getPropertyValue(t)||cF(e).getComputedStyle(e,null).getPropertyValue(t)}function mF(e){return function(){delete this[e]}}function hF(e,t){return function(){this[e]=t}}function gF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _F(e,t){return arguments.length>1?this.each((t==null?mF:typeof t==`function`?gF:hF)(e,t)):this.node()[e]}function vF(e){return e.trim().split(/^|\s+/)}function yF(e){return e.classList||new bF(e)}function bF(e){this._node=e,this._names=vF(e.getAttribute(`class`)||``)}bF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function xF(e,t){for(var n=yF(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function SF(e,t){for(var n=yF(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function CF(e){return function(){xF(this,e)}}function wF(e){return function(){SF(this,e)}}function TF(e,t){return function(){(t.apply(this,arguments)?xF:SF)(this,e)}}function EF(e,t){var n=vF(e+``);if(arguments.length<2){for(var r=yF(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?TF:t?CF:wF)(n,t))}function DF(){this.textContent=``}function OF(e){return function(){this.textContent=e}}function kF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function AF(e){return arguments.length?this.each(e==null?DF:(typeof e==`function`?kF:OF)(e)):this.node().textContent}function jF(){this.innerHTML=``}function MF(e){return function(){this.innerHTML=e}}function NF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function PF(e){return arguments.length?this.each(e==null?jF:(typeof e==`function`?NF:MF)(e)):this.node().innerHTML}function FF(){this.nextSibling&&this.parentNode.appendChild(this)}function IF(){return this.each(FF)}function LF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function RF(){return this.each(LF)}function zF(e){var t=typeof e==`function`?e:mP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function BF(){return null}function VF(e,t){var n=typeof e==`function`?e:mP(e),r=t==null?BF:typeof t==`function`?t:gP(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function HF(){var e=this.parentNode;e&&e.removeChild(this)}function UF(){return this.each(HF)}function WF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KF(e){return this.select(e?GF:WF)}function qF(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function JF(e){return function(t){e.call(this,t,this.__data__)}}function YF(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function XF(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function ZF(e,t,n){return function(){var r=this.__on,i,a=JF(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function QF(e,t,n){var r=YF(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?ZF:XF,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function $F(e,t,n){var r=cF(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function eI(e,t){return function(){return $F(this,e,t)}}function tI(e,t){return function(){return $F(this,e,t.apply(this,arguments))}}function nI(e,t){return this.each((typeof t==`function`?tI:eI)(e,t))}function*rI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var iI=[null];function aI(e,t){this._groups=e,this._parents=t}function oI(){return new aI([[document.documentElement]],iI)}function sI(){return this}aI.prototype=oI.prototype={constructor:aI,select:_P,selectAll:SP,selectChild:OP,selectChildren:MP,filter:NP,data:VP,enter:FP,exit:UP,join:WP,merge:GP,selection:sI,order:KP,sort:qP,call:YP,nodes:XP,node:ZP,size:QP,empty:$P,each:eF,attr:sF,style:fF,property:_F,classed:EF,text:AF,html:PF,raise:IF,lower:RF,append:zF,insert:VF,remove:UF,clone:KF,datum:qF,on:QF,dispatch:nI,[Symbol.iterator]:rI};function cI(e){return typeof e==`string`?new aI([[document.querySelector(e)]],[document.documentElement]):new aI([[e]],iI)}function lI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function uI(e,t){if(e=lI(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var dI={passive:!1},fI={capture:!0,passive:!1};function pI(e){e.stopImmediatePropagation()}function mI(e){e.preventDefault(),e.stopImmediatePropagation()}function hI(e){var t=e.document.documentElement,n=cI(e).on(`dragstart.drag`,mI,fI);`onselectstart`in t?n.on(`selectstart.drag`,mI,fI):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function gI(e,t){var n=e.document.documentElement,r=cI(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,mI,fI),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var _I=e=>()=>e;function vI(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}vI.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yI(e){return!e.ctrlKey&&!e.button}function bI(){return this.parentNode}function xI(e,t){return t??{x:e.x,y:e.y}}function SI(){return navigator.maxTouchPoints||`ontouchstart`in this}function CI(){var e=yI,t=bI,n=xI,r=SI,i={},a=aP(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,dI).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(cI(n.view).on(`mousemove.drag`,m,fI).on(`mouseup.drag`,h,fI),hI(n.view),pI(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(mI(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){cI(e.view).on(`mousemove.drag mouseup.drag`,null),gI(e.view,l),mI(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(pI(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(mI(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(pI(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=uI(l||r,t),p,m,h;if((h=n.call(e,new vI(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=uI(l||a,t),_=o}u.call(r,e,new vI(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:_I(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:_I(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:_I(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:_I(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function wI(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function TI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function EI(){}var DI=.7,OI=1/DI,kI=`\\s*([+-]?\\d+)\\s*`,AI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,jI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,MI=/^#([0-9a-f]{3,8})$/,NI=RegExp(`^rgb\\(${kI},${kI},${kI}\\)$`),PI=RegExp(`^rgb\\(${jI},${jI},${jI}\\)$`),FI=RegExp(`^rgba\\(${kI},${kI},${kI},${AI}\\)$`),II=RegExp(`^rgba\\(${jI},${jI},${jI},${AI}\\)$`),LI=RegExp(`^hsl\\(${AI},${jI},${jI}\\)$`),RI=RegExp(`^hsla\\(${AI},${jI},${jI},${AI}\\)$`),zI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};wI(EI,WI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:BI,formatHex:BI,formatHex8:VI,formatHsl:HI,formatRgb:UI,toString:UI});function BI(){return this.rgb().formatHex()}function VI(){return this.rgb().formatHex8()}function HI(){return rL(this).formatHsl()}function UI(){return this.rgb().formatRgb()}function WI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=MI.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GI(t):n===3?new YI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?KI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?KI(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=NI.exec(e))?new YI(t[1],t[2],t[3],1):(t=PI.exec(e))?new YI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FI.exec(e))?KI(t[1],t[2],t[3],t[4]):(t=II.exec(e))?KI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=LI.exec(e))?nL(t[1],t[2]/100,t[3]/100,1):(t=RI.exec(e))?nL(t[1],t[2]/100,t[3]/100,t[4]):zI.hasOwnProperty(e)?GI(zI[e]):e===`transparent`?new YI(NaN,NaN,NaN,0):null}function GI(e){return new YI(e>>16&255,e>>8&255,e&255,1)}function KI(e,t,n,r){return r<=0&&(e=t=n=NaN),new YI(e,t,n,r)}function qI(e){return e instanceof EI||(e=WI(e)),e?(e=e.rgb(),new YI(e.r,e.g,e.b,e.opacity)):new YI}function JI(e,t,n,r){return arguments.length===1?qI(e):new YI(e,t,n,r??1)}function YI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}wI(YI,JI,TI(EI,{brighter(e){return e=e==null?OI:OI**+e,new YI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?DI:DI**+e,new YI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new YI(eL(this.r),eL(this.g),eL(this.b),$I(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XI,formatHex:XI,formatHex8:ZI,formatRgb:QI,toString:QI}));function XI(){return`#${tL(this.r)}${tL(this.g)}${tL(this.b)}`}function ZI(){return`#${tL(this.r)}${tL(this.g)}${tL(this.b)}${tL((isNaN(this.opacity)?1:this.opacity)*255)}`}function QI(){let e=$I(this.opacity);return`${e===1?`rgb(`:`rgba(`}${eL(this.r)}, ${eL(this.g)}, ${eL(this.b)}${e===1?`)`:`, ${e})`}`}function $I(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eL(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tL(e){return e=eL(e),(e<16?`0`:``)+e.toString(16)}function nL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new aL(e,t,n,r)}function rL(e){if(e instanceof aL)return new aL(e.h,e.s,e.l,e.opacity);if(e instanceof EI||(e=WI(e)),!e)return new aL;if(e instanceof aL)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new aL(o,s,c,e.opacity)}function iL(e,t,n,r){return arguments.length===1?rL(e):new aL(e,t,n,r??1)}function aL(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}wI(aL,iL,TI(EI,{brighter(e){return e=e==null?OI:OI**+e,new aL(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?DI:DI**+e,new aL(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new YI(cL(e>=240?e-240:e+120,i,r),cL(e,i,r),cL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new aL(oL(this.h),sL(this.s),sL(this.l),$I(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=$I(this.opacity);return`${e===1?`hsl(`:`hsla(`}${oL(this.h)}, ${sL(this.s)*100}%, ${sL(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function oL(e){return e=(e||0)%360,e<0?e+360:e}function sL(e){return Math.max(0,Math.min(1,e||0))}function cL(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var lL=e=>()=>e;function uL(e,t){return function(n){return e+n*t}}function dL(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function fL(e){return(e=+e)==1?pL:function(t,n){return n-t?dL(t,n,e):lL(isNaN(t)?n:t)}}function pL(e,t){var n=t-e;return n?uL(e,n):lL(isNaN(e)?t:e)}var mL=(function e(t){var n=fL(t);function r(e,t){var r=n((e=JI(e)).r,(t=JI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=pL(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function hL(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function gL(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _L(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=EL(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function vL(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function yL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bL(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=EL(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var xL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,SL=new RegExp(xL.source,`g`);function CL(e){return function(){return e}}function wL(e){return function(t){return e(t)+``}}function TL(e,t){var n=xL.lastIndex=SL.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=xL.exec(e))&&(i=SL.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:yL(r,i)})),n=SL.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?wL(c[0].x):CL(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function EL(e,t){var n=typeof t,r;return t==null||n===`boolean`?lL(t):(n===`number`?yL:n===`string`?(r=WI(t))?(t=r,mL):TL:t instanceof WI?mL:t instanceof Date?vL:gL(t)?hL:Array.isArray(t)?_L:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?bL:yL)(e,t)}var DL=180/Math.PI,OL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kL(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*DL,skewX:Math.atan(c)*DL,scaleX:o,scaleY:s}}var AL;function jL(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?OL:kL(t.a,t.b,t.c,t.d,t.e,t.f)}function ML(e){return e==null||(AL||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),AL.setAttribute(`transform`,e),!(e=AL.transform.baseVal.consolidate()))?OL:(e=e.matrix,kL(e.a,e.b,e.c,e.d,e.e,e.f))}function NL(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:yL(e,i)},{i:c-2,x:yL(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:yL(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:yL(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:yL(e,n)},{i:s-2,x:yL(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var PL=NL(jL,`px, `,`px)`,`deg)`),FL=NL(ML,`, `,`)`,`)`),IL=1e-12;function LL(e){return((e=Math.exp(e))+1/e)/2}function RL(e){return((e=Math.exp(e))-1/e)/2}function zL(e){return((e=Math.exp(2*e))-1)/(e+1)}var BL=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<IL)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=LL(y),c=s/(n*g)*(i*zL(t*r+y)-RL(y));return[a+c*d,o+c*f,s*i/LL(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),VL=0,HL=0,UL=0,WL=1e3,GL,KL,qL=0,JL=0,YL=0,XL=typeof performance==`object`&&performance.now?performance:Date,ZL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function QL(){return JL||=(ZL($L),XL.now()+YL)}function $L(){JL=0}function eR(){this._call=this._time=this._next=null}eR.prototype=tR.prototype={constructor:eR,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?QL():+n)+(t==null?0:+t),!this._next&&KL!==this&&(KL?KL._next=this:GL=this,KL=this),this._call=e,this._time=n,oR()},stop:function(){this._call&&(this._call=null,this._time=1/0,oR())}};function tR(e,t,n){var r=new eR;return r.restart(e,t,n),r}function nR(){QL(),++VL;for(var e=GL,t;e;)(t=JL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--VL}function rR(){JL=(qL=XL.now())+YL,VL=HL=0;try{nR()}finally{VL=0,aR(),JL=0}}function iR(){var e=XL.now(),t=e-qL;t>WL&&(YL-=t,qL=e)}function aR(){for(var e,t=GL,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:GL=n);KL=e,oR(r)}function oR(e){VL||(HL&&=clearTimeout(HL),e-JL>24?(e<1/0&&(HL=setTimeout(rR,e-XL.now()-YL)),UL&&=clearInterval(UL)):(UL||=(qL=XL.now(),setInterval(iR,WL)),VL=1,ZL(rR)))}function sR(e,t,n){var r=new eR;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var cR=aP(`start`,`end`,`cancel`,`interrupt`),lR=[];function uR(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;mR(e,n,{name:t,index:r,group:i,on:cR,tween:lR,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function dR(e,t){var n=pR(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function fR(e,t){var n=pR(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function pR(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function mR(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=tR(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return sR(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(sR(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function hR(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function gR(e){return this.each(function(){hR(this,e)})}function _R(e,t){var n,r;return function(){var i=fR(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function vR(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=fR(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function yR(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=pR(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?_R:vR)(n,e,t))}function bR(e,t,n){var r=e._id;return e.each(function(){var e=fR(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return pR(e,r).value[t]}}function xR(e,t){var n;return(typeof t==`number`?yL:t instanceof WI?mL:(n=WI(t))?(t=n,mL):TL)(e,t)}function SR(e){return function(){this.removeAttribute(e)}}function CR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function TR(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ER(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function DR(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function OR(e,t){var n=dP(e),r=n===`transform`?FL:xR;return this.attrTween(e,typeof t==`function`?(n.local?DR:ER)(n,r,bR(this,`attr.`+e,t)):t==null?(n.local?CR:SR)(n):(n.local?TR:wR)(n,r,t))}function kR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function AR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function jR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&AR(e,i)),n}return i._value=t,i}function MR(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kR(e,i)),n}return i._value=t,i}function NR(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=dP(e);return this.tween(n,(r.local?jR:MR)(r,t))}function PR(e,t){return function(){dR(this,e).delay=+t.apply(this,arguments)}}function FR(e,t){return t=+t,function(){dR(this,e).delay=t}}function IR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?PR:FR)(t,e)):pR(this.node(),t).delay}function LR(e,t){return function(){fR(this,e).duration=+t.apply(this,arguments)}}function RR(e,t){return t=+t,function(){fR(this,e).duration=t}}function zR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?LR:RR)(t,e)):pR(this.node(),t).duration}function BR(e,t){if(typeof t!=`function`)throw Error();return function(){fR(this,e).ease=t}}function VR(e){var t=this._id;return arguments.length?this.each(BR(t,e)):pR(this.node(),t).ease}function HR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();fR(this,e).ease=n}}function UR(e){if(typeof e!=`function`)throw Error();return this.each(HR(this._id,e))}function WR(e){typeof e!=`function`&&(e=CP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new yz(r,this._parents,this._name,this._id)}function GR(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new yz(o,this._parents,this._name,this._id)}function KR(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function qR(e,t,n){var r,i,a=KR(t)?dR:fR;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function JR(e,t){var n=this._id;return arguments.length<2?pR(this.node(),n).on.on(e):this.each(qR(n,e,t))}function YR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function XR(){return this.on(`end.remove`,YR(this._id))}function ZR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=gP(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,uR(l[f],t,n,f,l,pR(u,n)));return new yz(a,this._parents,t,n)}function QR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=bP(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=pR(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&uR(p,t,n,h,f,m);a.push(f),o.push(u)}return new yz(a,o,t,n)}var $R=oI.prototype.constructor;function ez(){return new $R(this._groups,this._parents)}function tz(e,t){var n,r,i;return function(){var a=pF(this,e),o=(this.style.removeProperty(e),pF(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function nz(e){return function(){this.style.removeProperty(e)}}function rz(e,t,n){var r,i=n+``,a;return function(){var o=pF(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function iz(e,t,n){var r,i,a;return function(){var o=pF(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),pF(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function az(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=fR(this,e),l=c.on,u=c.value[a]==null?s||=nz(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function oz(e,t,n){var r=(e+=``)==`transform`?PL:xR;return t==null?this.styleTween(e,tz(e,r)).on(`end.style.`+e,nz(e)):typeof t==`function`?this.styleTween(e,iz(e,r,bR(this,`style.`+e,t))).each(az(this._id,e)):this.styleTween(e,rz(e,r,t),n).on(`end.style.`+e,null)}function sz(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function cz(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&sz(e,a,n)),r}return a._value=t,a}function lz(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,cz(e,t,n??``))}function uz(e){return function(){this.textContent=e}}function dz(e){return function(){var t=e(this);this.textContent=t??``}}function fz(e){return this.tween(`text`,typeof e==`function`?dz(bR(this,`text`,e)):uz(e==null?``:e+``))}function pz(e){return function(t){this.textContent=e.call(this,t)}}function mz(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&pz(r)),t}return r._value=e,r}function hz(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,mz(e))}function gz(){for(var e=this._name,t=this._id,n=bz(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=pR(c,t);uR(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yz(r,this._parents,e,n)}function _z(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=fR(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var vz=0;function yz(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function bz(){return++vz}var xz=oI.prototype;yz.prototype={constructor:yz,select:ZR,selectAll:QR,selectChild:xz.selectChild,selectChildren:xz.selectChildren,filter:WR,merge:GR,selection:ez,transition:gz,call:xz.call,nodes:xz.nodes,node:xz.node,size:xz.size,empty:xz.empty,each:xz.each,on:JR,attr:OR,attrTween:NR,style:oz,styleTween:lz,text:fz,textTween:hz,remove:XR,tween:yR,delay:IR,duration:zR,ease:VR,easeVarying:UR,end:_z,[Symbol.iterator]:xz[Symbol.iterator]};function Sz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Cz={time:null,delay:0,duration:250,ease:Sz};function wz(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Tz(e){var t,n;e instanceof yz?(t=e._id,e=e._name):(t=bz(),(n=Cz).time=QL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&uR(c,e,t,l,o,n||wz(c,t));return new yz(r,this._parents,e,t)}oI.prototype.interrupt=gR,oI.prototype.transition=Tz;var Ez=e=>()=>e;function Dz(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Oz(e,t,n){this.k=e,this.x=t,this.y=n}Oz.prototype={constructor:Oz,scale:function(e){return e===1?this:new Oz(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Oz(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var kz=new Oz(1,0,0);Az.prototype=Oz.prototype;function Az(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kz;return e.__zoom}function jz(e){e.stopImmediatePropagation()}function Mz(e){e.preventDefault(),e.stopImmediatePropagation()}function Nz(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Pz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Fz(){return this.__zoom||kz}function Iz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Lz(){return navigator.maxTouchPoints||`ontouchstart`in this}function Rz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function zz(){var e=Nz,t=Pz,n=Rz,r=Iz,i=Lz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=BL,l=aP(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Fz).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,O).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Fz),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(kz.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Oz(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Oz(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Oz(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=cI(this.that).datum();l.call(e,this.that,new Dz(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=uI(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],hR(this),s.start();Mz(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=cI(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=uI(t,i),l=t.clientX,u=t.clientY;hI(t.view),jz(t),a.mouse=[c,this.__zoom.invert(c)],hR(this),a.start();function d(e){if(Mz(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=uI(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),gI(e.view,a.moved),Mz(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=uI(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Mz(r),s>0?cI(this).transition().duration(s).call(x,d,c,r):cI(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(jz(t),s=0;s<i;++s)c=r[s],l=uI(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),hR(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Mz(e),s=0;s<a;++s)c=i[s],l=uI(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function O(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(jz(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=uI(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=cI(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Ez(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Ez(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ez(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Ez([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Bz={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Vz=[[-1/0,-1/0],[1/0,1/0]],Hz=[`Enter`,` `,`Escape`],Uz={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Wz;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Wz||={});var Gz;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Gz||={});var Kz;(function(e){e.Partial=`partial`,e.Full=`full`})(Kz||={});var qz={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Jz;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Jz||={});var Yz;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Yz||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var Xz={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},Zz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Qz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),$z=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),eB=(e,t=[0,0])=>{let{width:n,height:r}=PB(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},tB=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):$z(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,mB(e,vB(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?gB(r):{x:0,y:0,width:0,height:0}},nB=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=mB(n,vB(e)),r=!0)}),r?gB(n):{x:0,y:0,width:0,height:0}},rB=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=bB(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},iB=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function aB(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=PB(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function oB({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=jB(nB(aB(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function sB({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,Bz.error005());else{let{width:e,height:t}=PB(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&NB(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=NB(d)?uB(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,Bz.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function cB({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=iB(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var lB=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),uB=(e={x:0,y:0},t,n)=>({x:lB(e.x,t[0][0],t[1][0]-(n?.width??0)),y:lB(e.y,t[0][1],t[1][1]-(n?.height??0))});function dB(e,t,n){let{width:r,height:i}=PB(n),{x:a,y:o}=n.internals.positionAbsolute;return uB(e,[[a,o],[a+r,o+i]],t)}var fB=(e,t,n)=>e<t?lB(Math.abs(e-t),1,t)/t:e>n?-lB(Math.abs(e-n),1,t)/t:0,pB=(e,t,n=15,r=40)=>[fB(e.x,r,t.width-r)*n,fB(e.y,r,t.height-r)*n],mB=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),hB=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),gB=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),_B=(e,t=[0,0])=>{let{x:n,y:r}=$z(e)?e.internals.positionAbsolute:eB(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},vB=(e,t=[0,0])=>{let{x:n,y:r}=$z(e)?e.internals.positionAbsolute:eB(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},yB=(e,t)=>gB(mB(hB(e),hB(t))),bB=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},xB=(e,t)=>bB(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),SB=e=>CB(e.width)&&CB(e.height)&&CB(e.x)&&CB(e.y),CB=e=>!isNaN(e)&&isFinite(e),wB=(e,t)=>(e,t)=>{},TB=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),EB=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?TB(s,o):s},DB=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function OB(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function kB(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=OB(e,n),i=OB(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=OB(e.top??e.y??0,n),i=OB(e.bottom??e.y??0,n),a=OB(e.left??e.x??0,t),o=OB(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function AB(e,t,n,r,i,a){let{x:o,y:s}=DB(e,[t,n,r]),{x:c,y:l}=DB({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var jB=(e,t,n,r,i,a)=>{let o=kB(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=lB(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=AB(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},MB=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function NB(e){return e!=null&&e!==`parent`}function PB(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function FB(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function IB(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function LB(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function RB(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function zB(e){return{...Uz,...e||{}}}function BB(e){return e===null?null:e?`valid`:`invalid`}function VB(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=qB(e),s=EB({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?TB(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var HB=e=>({width:e.offsetWidth,height:e.offsetHeight}),UB=e=>e?.getRootNode?.()||window?.document,WB=[`INPUT`,`SELECT`,`TEXTAREA`];function GB(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?WB.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var KB=e=>`clientX`in e,qB=(e,t)=>{let n=KB(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},JB=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...HB(t)}})};function YB({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function XB(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ZB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-XB(t-r,a),n];case $.Right:return[t+XB(r-t,a),n];case $.Top:return[t,n-XB(n-i,a)];case $.Bottom:return[t,n+XB(i-n,a)]}}function QB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=ZB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=ZB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=YB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function $B({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function eV({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function tV({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=mB(vB(e),vB(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),xB({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},gB(a))>0}var nV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,rV=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),iV=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,Bz.error006()),t;let r=n.getEdgeId||nV,i;return i=Zz(e)?{...e}:{...e,id:r(e)},rV(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function aV({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=$B({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var oV={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},sV=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},cV=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function lV({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=oV[t],c=oV[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=sV({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=$B({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function uV(e,t,n,r){let i=Math.min(cV(e,t)/2,cV(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function dV({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=lV({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=uV(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function fV(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function pV(e){let{sourceNode:t,targetNode:n}=e;if(!fV(t)||!fV(n))return null;let r=t.internals.handleBounds||mV(t.handles),i=n.internals.handleBounds||mV(n.handles),a=gV(r?.source??[],e.sourceHandle),o=gV(e.connectionMode===Wz.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Bz.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=hV(t,a,s),u=hV(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function mV(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function hV(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??PB(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function gV(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function _V(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function vV(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=_V(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var yV=1e3,bV=10,xV={nodeOrigin:[0,0],nodeExtent:Vz,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},SV={...xV,checkEquality:!0};function CV(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function wV(e,t,n){let r=CV(xV,n);for(let n of e.values())if(n.parentId)kV(n,e,t,r);else{let e=uB(eB(n,r.nodeOrigin),NB(n.extent)?n.extent:r.nodeExtent,PB(n));n.internals.positionAbsolute=e}}function TV(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function EV(e){return e===`manual`}function DV(e,t,n,r={}){let i=CV(SV,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!EV(i.zIndexMode)?yV:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=uB(eB(u,i.nodeOrigin),NB(u.extent)?u.extent:i.nodeExtent,PB(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:TV(u,e),z:AV(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&kV(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function OV(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function kV(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=CV(xV,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}OV(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*bV),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=jV(e,u,o,s,a&&!EV(c)?yV:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function AV(e,t,n){let r=CB(e.zIndex)?e.zIndex:0;return EV(n)?r:r+(e.selected?t:0)}function jV(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=PB(e),l=eB(e,n),u=NB(e.extent)?uB(l,e.extent,c):l,d=uB({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=dB(d,c,t));let f=AV(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function MV(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=yB(a.get(n.parentId)?.expandedRect??_B(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=PB(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function NV(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=HB(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=NB(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=dB(h,s,n))}else m&&(h=uB(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:JB(`source`,r.nodeElement,p,d,e.id),target:JB(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&kV(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:_B(g,i)}))}}if(f.length>0){let e=MV(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function PV({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function FV(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function IV(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;FV(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),FV(`target`,s,c,e,i,o),t.set(r.id,r)}}function LV(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:LV(n,t):!1}function RV(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function zV(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!LV(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function BV({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function VV({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=TB(a,t);return{x:o.x-a.x,y:o.y-a.y}}function HV({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=cI(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?hB(nB(s)):null,x=v&&l?VV({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:TB(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=sB({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=BV({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=pB(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=VB(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=zV(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=BV({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=CI().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=VB(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=qB(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=VB(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=qB(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=qB(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=BV({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!RV(t,`.${g}`,v))&&(!_||RV(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function UV(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())xB(i,_B(e))>0&&r.push(e);return r}var WV=250;function GV(e,t,n,r){let i=[],a=1/0,o=UV(e,n,t+WV);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=hV(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function KV(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...hV(o,c,c.position,!0)}:c}function qV(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function JV(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var YV=()=>!0;function XV(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=YV,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=UB(e.target),E=0,D,{x:ee,y:O}=qB(e),k=qV(a,w),A=s?.getBoundingClientRect(),te=!1;if(!A||!k)return;let ne=KV(i,k,r,c,t);if(!ne)return;let re=qB(e,A),ie=!1,ae=null,oe=!1,se=null;function ce(){if(!u||!A)return;let[e,t]=pB(re,A,S);f({x:e,y:t}),E=requestAnimationFrame(ce)}let j={...ne,nodeId:i,type:k,position:ne.position},le=c.get(i),ue={inProgress:!0,isValid:null,from:hV(le,j,$.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:le,to:re,toHandle:null,toPosition:Xz[j.position],toNode:null,pointer:re};function de(){te=!0,y(ue),m?.(e,{nodeId:i,handleId:r,handleType:k})}C===0&&de();function fe(e){if(!te){let{x:t,y:n}=qB(e),r=t-ee,i=n-O;if(!(r*r+i*i>C*C))return;de()}if(!x()||!j){pe(e);return}let a=b();re=qB(e,A),D=GV(EB(re,a,!1,[1,1]),n,c,j),ie||=(ce(),!0);let s=ZV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});se=s.handleDomNode,ae=s.connection,oe=JV(!!D,s.isValid);let u=c.get(i),f=u?hV(u,j,$.Left,!0):ue.from,p={...ue,from:f,isValid:oe,to:s.toHandle&&oe?DB({x:s.toHandle.x,y:s.toHandle.y},a):re,toHandle:s.toHandle,toPosition:oe&&s.toHandle?s.toHandle.position:Xz[j.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:re};y(p),ue=p}function pe(e){if(!(`touches`in e&&e.touches.length>0)){if(te){(D||se)&&ae&&oe&&h?.(ae);let{inProgress:t,...n}=ue,r={...n,toPosition:ue.toHandle?ue.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ie=!1,oe=!1,ae=null,se=null,T.removeEventListener(`mousemove`,fe),T.removeEventListener(`mouseup`,pe),T.removeEventListener(`touchmove`,fe),T.removeEventListener(`touchend`,pe)}}T.addEventListener(`mousemove`,fe),T.addEventListener(`mouseup`,pe),T.addEventListener(`touchmove`,fe),T.addEventListener(`touchend`,pe)}function ZV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=YV,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=qB(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=qV(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Wz.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=KV(t,e,a,u,n,!0)}return _}var QV={onPointerDown:XV,isValid:ZV};function $V({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=cI(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&MB()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=zz().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:uI}}var eH=e=>({x:e.x,y:e.y,zoom:e.k}),tH=({x:e,y:t,zoom:n})=>kz.translate(e,t).scale(n),nH=(e,t)=>e.target.closest(`.${t}`),rH=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),iH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,aH=(e,t=0,n=iH,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},oH=e=>{let t=e.ctrlKey&&MB()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function sH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(nH(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=uI(u),t=d*2**oH(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Gz.Vertical?0:u.deltaX*f,m=i===Gz.Horizontal?0:u.deltaY*f;!MB()&&u.shiftKey&&i!==Gz.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=eH(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function cH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=nH(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function lH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=eH(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function uH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&rH(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,eH(a.transform))}}function dH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&rH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=eH(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function fH({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(nH(f,`${u}-flow__node`)||nH(f,`${u}-flow__edge`)||nH(f,`${u}-flow__selection`)||nH(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||nH(f,c)&&h||nH(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function pH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=zz().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=cI(e).call(f);y({x:i.x,y:i.y,zoom:lB(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(oH);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?EL:BL).transform(aH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:ee}){r&&!l.isZoomingOrPanning&&v();let O=i&&!C&&!r;f.clickDistance(ee?1/0:!CB(D)||D<0?0:D);let k=O?sH({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):cH({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=lH({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let te=uH({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,te);let ne=dH({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,ne);let re=fH({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(re),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=tH(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=tH(e);return await g(n,t),n}function x(e){if(p){let t=tH(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Az(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?EL:BL).scaleTo(aH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?EL:BL).scaleBy(aH(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!CB(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var mH;(function(e){e.Line=`line`,e.Handle=`handle`})(mH||={});function hH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function gH(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function _H(e,t){return Math.max(0,t-e)}function vH(e,t){return Math.max(0,e-t)}function yH(e,t,n){return Math.max(0,t-e,e-n)}function bH(e,t){return e?!t:t}function xH(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,O=-a[1]*S,k=yH(E,h,g),A=yH(D,_,v);if(o){let e=0,t=0;c&&w<0?e=_H(y+w+ee,o[0][0]):!c&&w>0&&(e=vH(y+E+ee,o[1][0])),l&&T<0?t=_H(b+T+O,o[0][1]):!l&&T>0&&(t=vH(b+D+O,o[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(s){let e=0,t=0;c&&w>0?e=vH(y+w,s[0][0]):!c&&w<0&&(e=_H(y+E,s[1][0])),l&&T>0?t=vH(b+T,s[0][1]):!l&&T<0&&(t=_H(b+D,s[1][1])),k=Math.max(k,e),A=Math.max(A,t)}if(i){if(u){let e=yH(E/C,_,v)*C;if(k=Math.max(k,e),o){let e=0;e=!c&&!l||c&&!l&&f?vH(b+O+E/C,o[1][1])*C:_H(b+O+(c?w:-w)/C,o[0][1])*C,k=Math.max(k,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?_H(b+E/C,s[1][1])*C:vH(b+(c?w:-w)/C,s[0][1])*C,k=Math.max(k,e)}}if(d){let e=yH(D*C,h,g)/C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||l&&!c&&f?vH(y+D*C+ee,o[1][0])/C:_H(y+(l?T:-T)*C+ee,o[0][0])/C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?_H(y+D*C,s[1][0])/C:vH(y+(l?T:-T)*C,s[0][0])/C,A=Math.max(A,e)}}}T+=T<0?A:-A,w+=w<0?k:-k,i&&(f?E>D*C?T=(bH(c,l)?-w:w)/C:w=(bH(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let te=c?y+w:y,ne=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+te,y:a[1]*T*(l?-1:1)+ne}}var SH={width:0,height:0,x:0,y:0},CH={...SH,pointerX:0,pointerY:0,aspectRatio:1};function wH(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function TH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=cI(e),o={controlDirection:gH(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...SH},h={...CH};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:gH(e)};let g,_=null,v=[],y,b,x,S=CI().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=VB(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=NB(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=wH(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=VB(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:ee,y:O}=xH(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),k=E!==S,A=D!==C,te=ee!==u&&k,ne=O!==f&&A;if(!te&&!ne&&!k&&!A)return;let re={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((te||ne||T[0]===1||T[1]===1)&&(w.x=te?ee:m.x,w.y=ne?O:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=ee-u,t=O-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((k||A)&&(w.width=k&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=A&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let ie=hH({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ae={...m,direction:ie};if(p?.(e,ae)===!1){m=re.prevValues,h.x=re.startX,h.y=re.startY,v.forEach((e,t)=>{e.position=re.childNodes[t].position});return}d?.(e,ae),r(w,l)}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var EH=s((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),DH=s(((e,t)=>{t.exports=EH()})),OH=s((e=>{var t=f(),n=DH();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),kH=u(s(((e,t)=>{t.exports=OH()}))(),1),AH=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},jH=e=>e?AH(e):AH,{useDebugValue:MH}=y.default,{useSyncExternalStoreWithSelector:NH}=kH.default,PH=e=>e;function FH(e,t=PH,n){let r=NH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return MH(r),r}var IH=(e,t)=>{let n=jH(e),r=(e,r=t)=>FH(n,e,r);return Object.assign(r,n),r},LH=(e,t)=>e?IH(e,t):IH;function RH(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}g();var zH=(0,y.createContext)(null),BH=zH.Provider,VH=Bz.error001(`react`);function HH(e,t){let n=(0,y.useContext)(zH);if(n===null)throw Error(VH);return FH(n,e,t)}function UH(){let e=(0,y.useContext)(zH);if(e===null)throw Error(VH);return(0,y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var WH={display:`none`},GH={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},KH=`react-flow__node-desc`,qH=`react-flow__edge-desc`,JH=`react-flow__aria-live`,YH=e=>e.ariaLiveMessage,XH=e=>e.ariaLabelConfig;function ZH({rfId:e}){let t=HH(YH);return(0,X.jsx)(`div`,{id:`${JH}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:GH,children:t})}function QH({rfId:e,disableKeyboardA11y:t}){let n=HH(XH);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{id:`${KH}-${e}`,style:WH,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,X.jsx)(`div`,{id:`${qH}-${e}`,style:WH,children:n[`edge.a11yDescription.default`]}),!t&&(0,X.jsx)(ZH,{rfId:e})]})}var $H=(0,y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,X.jsx)(`div`,{className:rP([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});$H.displayName=`Panel`;var eU=`https://reactflow.dev?utm_source=attribution`;function tU({proOptions:e,position:t=`bottom-right`}){return(0,y.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,X.jsx)($H,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${eU}`,children:(0,X.jsx)(`a`,{href:eU,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var nU=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},rU=e=>e.id;function iU(e,t){return RH(e.selectedNodes.map(rU),t.selectedNodes.map(rU))&&RH(e.selectedEdges.map(rU),t.selectedEdges.map(rU))}function aU({onSelectionChange:e}){let t=UH(),{selectedNodes:n,selectedEdges:r}=HH(nU,iU);return(0,y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var oU=e=>!!e.onSelectionChangeHandlers;function sU({onSelectionChange:e}){let t=HH(oU);return e||t?(0,X.jsx)(aU,{onSelectionChange:e}):null}var cU=[0,0],lU={x:0,y:0,zoom:1},uU=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],dU=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),fU={translateExtent:Vz,nodeOrigin:cU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function pU(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=HH(dU,RH),l=UH();(0,y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=fU,s()}),[]);let u=(0,y.useRef)(fU);return(0,y.useEffect)(()=>{for(let s of uU){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:zB(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},uU.map(t=>e[t])),null}function mU(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function hU(e){let[t,n]=(0,y.useState)(e===`system`?null:e);return(0,y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=mU(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?mU()?.matches?`dark`:`light`:t}var gU=typeof document<`u`?document:null;function _U(e=null,t={target:gU,actInsideInputWithModifier:!0}){let[n,r]=(0,y.useState)(!1),i=(0,y.useRef)(!1),a=(0,y.useRef)(new Set([])),[o,s]=(0,y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
736
736
  `).replace(`
737
737
 
738
738
  `,`
739
739
  +`).split(`
740
- `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,y.useEffect)(()=>{let n=t?.target??hU,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&WB(e))return!1;let n=vU(e.code,s);if(a.current.add(e[n]),_U(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=vU(e.code,s);_U(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function _U(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function vU(e,t){return t.includes(e)?`code`:`key`}var yU=()=>{let e=HH();return(0,y.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=AB(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return TB(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=EB(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function bU(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)xU(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function xU(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function SU(e,t){return bU(e,t)}function CU(e,t){return bU(e,t)}function wU(e,t){return{id:e,type:`select`,selected:t}}function TU(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(wU(a.id,e)))}return r}function EU({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function DU(e){return{id:e.id,type:`remove`}}var OU=CB(`React Flow`,`https://reactflow.dev/`);function kU(e,t,n={}){return rV(e,t,{...n,onError:n.onError??OU})}var AU=e=>Zz(e),jU=e=>Xz(e);function MU(e){return(0,y.forwardRef)(e)}var NU=typeof window<`u`?y.useLayoutEffect:y.useEffect;function PU(e){let[t,n]=(0,y.useState)(BigInt(0)),[r]=(0,y.useState)(()=>FU(()=>n(e=>e+BigInt(1))));return NU(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function FU(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var IU=(0,y.createContext)(null);function LU({children:e}){let t=HH(),n=PU((0,y.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=EU({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=PU((0,y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(EU({items:s,lookup:o}))},[])),i=(0,y.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,X.jsx)(IU.Provider,{value:i,children:e})}function RU(){let e=(0,y.useContext)(IU);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var zU=e=>!!e.panZoom;function BU(){let e=yU(),t=HH(),n=RU(),r=VH(zU),i=(0,y.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=AU(e)?e:n.get(e.id),a=i.parentId?FB(i.position,i.measured,i.parentId,n,r):i.position;return gB({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&AU(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&jU(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await sB({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(DU);o?.(f),c(e)}if(m){let e=d.map(DU);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=xB(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=gB(s?r:a),l=bB(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=xB(e)?e:a(e);if(!r)return!1;let i=bB(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return eB(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??LB();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,y.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var VU=e=>e.selected,HU=typeof window<`u`?window:void 0;function UU({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=HH(),{deleteElements:r}=BU(),i=gU(e,{actInsideInputWithModifier:!1}),a=gU(t,{target:HU});(0,y.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(VU),edges:e.filter(VU)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,y.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function WU(e){let t=HH();(0,y.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=VB(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,zz.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var GU={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},KU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=Wz.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=HH(),w=(0,y.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=VH(KU,LH),ee=gU(p),O=(0,y.useRef)();WU(w);let k=(0,y.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[v,b]);return(0,y.useEffect)(()=>{if(w.current){O.current=fH({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return C.setState({panZoom:O.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,y.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:ee,preventScrolling:m,noPanClassName:_,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:k,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,ee,m,_,T,g,E,k,D,S,x]),(0,X.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:GU,children:h})}var JU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YU(){let{userSelectionActive:e,userSelectionRect:t}=VH(JU,LH);return e&&t?(0,X.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var XU=(e,t)=>n=>{n.target===t.current&&e?.(n)},ZU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function QU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Gz.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,y.useRef)(0),_=HH(),{userSelectionActive:v,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=VH(ZU,LH),w=b&&(e||v),T=(0,y.useRef)(null),E=(0,y.useRef)(),D=(0,y.useRef)(new Set),ee=(0,y.useRef)(new Set),O=(0,y.useRef)(!1),k=(0,y.useRef)(!1),A=(0,y.useRef)({x:0,y:0}),te=(0,y.useRef)(!1),ne=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},re=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},ie=d?e=>d(e):void 0,ae=e=>{k.current&&=(e.stopPropagation(),!1)},oe=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=KB(n.nativeEvent,E.current),u=TB({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function se(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=EB(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=ee.current;D.current=new Set(nB(a,m,i,n===Gz.Partial,!0).map(e=>e.id)),ee.current=new Set;let v=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&ee.current.add(e)}}IB(h,D.current)||c(TU(a,D.current,!0)),IB(g,ee.current)||l(TU(o,ee.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ce(){if(!i||!E.current)return;let[e,t]=fB(A.current,E.current,C);S({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(ce);return}let{x:t,y:n}=A.current;se(t,n),g.current=requestAnimationFrame(ce)})}let j=()=>{cancelAnimationFrame(g.current),g.current=0,te.current=!1};(0,y.useEffect)(()=>()=>j(),[]);let le=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!E.current||!n)return;let{x:o,y:c}=KB(e.nativeEvent,E.current);A.current={x:o,y:c};let l=EB({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,te.current||=(ce(),!0),se(o,c)},ue=e=>{if(!w){e.target===T.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===T.current&&_.getState().userSelectionRect&&ne?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:D.current.size>0})),j())},de=e=>{e.target?.releasePointerCapture?.(e.pointerId),j()},fe=r===!0||Array.isArray(r)&&r.includes(0);return(0,X.jsxs)(`div`,{className:nP([`react-flow__pane`,{draggable:fe,dragging:x,selection:e}]),onClick:w?void 0:XU(ne,T),onContextMenu:XU(re,T),onWheel:XU(ie,T),onPointerEnter:w?void 0:f,onPointerMove:w?le:p,onPointerUp:ue,onPointerCancel:w?de:void 0,onPointerDownCapture:w?oe:void 0,onClickCapture:w?ae:void 0,onPointerLeave:m,ref:T,style:GU,children:[h,(0,X.jsx)(YU,{})]})}function $U({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,zz.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function eW({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=HH(),[c,l]=(0,y.useState)(!1),u=(0,y.useRef)();return(0,y.useEffect)(()=>{if(!t)return u.current=VV({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{$U({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,y.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var tW=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function nW(){let e=HH();return(0,y.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=tW(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=wB(t,i));let{position:a,positionAbsolute:s}=oB({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var rW=(0,y.createContext)(null),iW=rW.Provider;rW.Consumer;var aW=()=>(0,y.useContext)(rW),oW=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),sW=(0,y.createContext)(null);function cW({children:e}){let t=VH(oW,LH);return(0,X.jsx)(sW.Provider,{value:t,children:e})}function lW(){let e=(0,y.useContext)(sW);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var uW={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},dW=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return uW;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Uz.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function fW({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=HH(),_=aW(),{connectOnClick:v,noPanClassName:y,rfId:b}=lW(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=VH(dW(_,m,e),LH);_||g.getState().onError?.(`010`,zz.error010());let ee=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(kU(i,e,{onError:n}))}n?.(i),s?.(i)},O=e=>{if(!_)return;let t=GB(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();ZV.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:ee,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,X.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:nP([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:O,onTouchStart:O,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=HB(t.target),h=n||c,{connection:v,isValid:y}=ZV.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&ee(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var pW=(0,y.memo)(MU(fW));function mW({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[e?.label,(0,X.jsx)(pW,{type:`source`,position:n,isConnectable:t})]})}function hW({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pW,{type:`target`,position:n,isConnectable:t}),e?.label,(0,X.jsx)(pW,{type:`source`,position:r,isConnectable:t})]})}function gW(){return null}function _W({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pW,{type:`target`,position:n,isConnectable:t}),e?.label]})}var vW={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},yW={input:mW,default:hW,output:_W,group:gW};function bW(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var xW=e=>{let{width:t,height:n,x:r,y:i}=tB(e.nodeLookup,{filter:e=>!!e.selected});return{width:SB(t)?t:null,height:SB(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function SW({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=HH(),{width:i,height:a,transformString:o,userSelectionActive:s}=VH(xW,LH),c=nW(),l=(0,y.useRef)(null);(0,y.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(eW({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,X.jsx)(`div`,{className:nP([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,X.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(vW,e.key)&&(e.preventDefault(),c({direction:vW[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var CW=typeof window<`u`?window:void 0,wW=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function TW({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:te,noPanClassName:ne,disableKeyboardA11y:re,onViewportChange:ie,isControlledViewport:ae}){let{nodesSelectionActive:oe,userSelectionActive:se}=VH(wW,LH),ce=gU(l,{target:CW}),j=gU(h,{target:CW}),le=j||w,ue=j||b,de=u&&le!==!0,fe=ce||se||de;return UU({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,X.jsx)(qU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ue,panActivationKeyPressed:j,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ce&&le,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:te,noPanClassName:ne,onViewportChange:ie,isControlledViewport:ae,paneClickDistance:s,selectionOnDrag:de,children:(0,X.jsxs)(QU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:T,isSelecting:!!fe,selectionMode:d,selectionKeyPressed:ce,paneClickDistance:s,selectionOnDrag:de,children:[e,oe&&(0,X.jsx)(SW,{onSelectionContextMenu:A,noPanClassName:ne,disableKeyboardA11y:re})]})})}TW.displayName=`FlowRenderer`;var EW=(0,y.memo)(TW),DW=e=>t=>e?nB(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function OW(e){return VH((0,y.useCallback)(DW(e),[e]),LH)}var kW=e=>e.updateNodeInternals;function AW(){let e=VH(kW),[t]=(0,y.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,y.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function jW({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=HH(),a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(e.sourcePosition),c=(0,y.useRef)(e.targetPosition),l=(0,y.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,y.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,y.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,y.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function MW({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=VH(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},LH),S=y.type||`default`,C=g?.[S]||yW[S];C===void 0&&(v?.(`003`,zz.error003(S)),S=`default`,C=g?.default||yW.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),ee=HH(),O=PB(y),k=jW({node:y,nodeType:S,hasDimensions:O,resizeObserver:d}),A=eW({nodeRef:k,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),te=nW();if(y.hidden)return null;let ne=NB(y),re=bW(y),ie=T||w||t||n||r||i,ae=n?e=>n(e,{...b.userNode}):void 0,oe=r?e=>r(e,{...b.userNode}):void 0,se=i?e=>i(e,{...b.userNode}):void 0,ce=a?e=>a(e,{...b.userNode}):void 0,j=o?e=>o(e,{...b.userNode}):void 0,le=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=ee.getState();T&&(!r||!w||i>0)&&$U({id:e,store:ee,nodeRef:k}),t&&t(n,{...b.userNode})},ue=t=>{if(!(WB(t.nativeEvent)||m)){if(Vz.includes(t.key)&&T){let n=t.key===`Escape`;$U({id:e,store:ee,unselect:n,nodeRef:k})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(vW,t.key)){t.preventDefault();let{ariaLabelConfig:e}=ee.getState();ee.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),te({direction:vW[t.key],factor:t.shiftKey?4:1})}}},de=()=>{if(m||!k.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=ee.getState();i&&(nB(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ne.width/2,y.position.y+ne.height/2,{zoom:t[2]}))};return(0,X.jsx)(`div`,{className:nP([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:A}]),ref:k,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ie?`all`:`none`,visibility:O?`visible`:`hidden`,...y.style,...re},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onContextMenu:ce,onClick:le,onDoubleClick:j,onKeyDown:D?ue:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${GH}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,X.jsx)(iW,{value:e,children:(0,X.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:A,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ne})})})}var NW=(0,y.memo)(MW),PW=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function FW(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=VH(PW,LH),a=OW(e.onlyRenderVisibleElements),o=AW();return(0,X.jsx)(`div`,{className:`react-flow__nodes`,style:GU,children:a.map(a=>(0,X.jsx)(NW,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}FW.displayName=`NodeRenderer`;var IW=(0,y.memo)(FW);function LW(e){return VH((0,y.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&eV({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),LH)}var RW=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,X.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},zW=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,X.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},BW={[Jz.Arrow]:RW,[Jz.ArrowClosed]:zW};function VW(e){let t=HH();return(0,y.useMemo)(()=>Object.prototype.hasOwnProperty.call(BW,e)?BW[e]:(t.getState().onError?.(`009`,zz.error009(e)),null),[e])}var HW=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=VW(t);return c?(0,X.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,X.jsx)(c,{color:n,strokeWidth:o})}):null},UW=({defaultColor:e,rfId:t})=>{let n=VH(e=>e.edges),r=VH(e=>e.defaultEdgeOptions),i=(0,y.useMemo)(()=>_V(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,X.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,X.jsx)(`defs`,{children:i.map(e=>(0,X.jsx)(HW,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};UW.displayName=`MarkerDefinitions`;var WW=(0,y.memo)(UW);function GW({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,y.useState)({x:1,y:0,width:0,height:0}),p=nP([`react-flow__edge-textwrapper`,l]),m=(0,y.useRef)(null);return(0,y.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,X.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,X.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,X.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}GW.displayName=`EdgeText`;var KW=(0,y.memo)(GW);function qW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{...u,d:e,fill:`none`,className:nP([`react-flow__edge-path`,u.className])}),l?(0,X.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&SB(t)&&SB(n)?(0,X.jsx)(KW,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function JW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function YW({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=JW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=JW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=JB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function XW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=YW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,X.jsx)(qW,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var ZW=XW({isInternal:!1}),QW=XW({isInternal:!0});ZW.displayName=`SimpleBezierEdge`,QW.displayName=`SimpleBezierEdgeInternal`;function $W(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=uV({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,X.jsx)(qW,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var eG=$W({isInternal:!1}),tG=$W({isInternal:!0});eG.displayName=`SmoothStepEdge`,tG.displayName=`SmoothStepEdgeInternal`;function nG(e){return(0,y.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,X.jsx)(eG,{...n,id:r,pathOptions:(0,y.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var rG=nG({isInternal:!1}),iG=nG({isInternal:!0});rG.displayName=`StepEdge`,iG.displayName=`StepEdgeInternal`;function aG(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=iV({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,X.jsx)(qW,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var oG=aG({isInternal:!1}),sG=aG({isInternal:!0});oG.displayName=`StraightEdge`,sG.displayName=`StraightEdgeInternal`;function cG(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=ZB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,X.jsx)(qW,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var lG=cG({isInternal:!1}),uG=cG({isInternal:!0});lG.displayName=`BezierEdge`,uG.displayName=`BezierEdgeInternal`;var dG={default:uG,straight:sG,step:iG,smoothstep:tG,simplebezier:QW},fG={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},pG=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,mG=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,hG=`react-flow__edgeupdater`;function gG({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,X.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:nP([hG,`${hG}-${s}`]),cx:pG(t,r,e),cy:mG(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function _G({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=HH(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;ZV.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,X.jsxs)(X.Fragment,{children:[(e===!0||e===`source`)&&(0,X.jsx)(gG,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,X.jsx)(gG,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function vG({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let b=VH(t=>t.edgeLookup.get(e)),x=VH(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||dG[S];C===void 0&&(_?.(`011`,zz.error011(S)),S=`default`,C=h?.default||dG.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,y.useRef)(null),[ee,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(!1),te=HH(),{zIndex:ne=b.zIndex,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce}=VH((0,y.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return fG;let i=fV({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=$B({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||fG,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,_]),LH),j=(0,y.useMemo)(()=>b.markerStart?`url('#${gV(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,y.useMemo)(()=>b.markerEnd?`url('#${gV(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||re===null||ie===null||ae===null||oe===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState();E&&(te.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,fe=o?e=>{o(e,{...b})}:void 0,pe=s?e=>{s(e,{...b})}:void 0,me=c?e=>{c(e,{...b})}:void 0,he=l?e=>{l(e,{...b})}:void 0;return(0,X.jsx)(`svg`,{style:{zIndex:ne},children:(0,X.jsxs)(`g`,{className:nP([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:fe,onMouseEnter:pe,onMouseMove:me,onMouseLeave:he,onKeyDown:w?t=>{if(!v&&Vz.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=te.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${KH}-${m}`:void 0,ref:D,...b.domAttributes,children:[!k&&(0,X.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:j,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,X.jsx)(_G,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:O,setReconnecting:A})]})})}var yG=(0,y.memo)(vG),bG=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xG({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=VH(bG,LH),b=LW(t);return(0,X.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,X.jsx)(WW,{defaultColor:e,rfId:n}),b.map(e=>(0,X.jsx)(yG,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}xG.displayName=`EdgeRenderer`;var SG=(0,y.memo)(xG),CG=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function wG({children:e}){let t=HH(),n=(0,y.useRef)(null),[r]=(0,y.useState)(()=>t.getState().transform);return NU(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=CG(r)))};return r(),t.subscribe(r)},[t]),(0,X.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:CG(r)},children:e})}function TG(e){let t=BU(),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var EG=e=>e.panZoom?.syncViewport;function DG(e){let t=VH(EG),n=HH();return(0,y.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function OG(e){return e.connection.inProgress?{...e.connection,to:TB(e.connection.to,e.transform)}:{...e.connection}}function kG(e){return e?t=>e(OG(t)):OG}function AG(e){return VH(kG(e),LH)}var jG=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MG({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=VH(jG,LH);return a&&i&&c?(0,X.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,X.jsx)(`g`,{className:nP([`react-flow__connection`,zB(s)]),children:(0,X.jsx)(NG,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var NG=({style:e,type:t=qz.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=AG();if(!i)return;if(n)return(0,X.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:zB(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case qz.Bezier:[m]=ZB(h);break;case qz.SimpleBezier:[m]=YW(h);break;case qz.Step:[m]=uV({...h,borderRadius:0});break;case qz.SmoothStep:[m]=uV(h);break;default:[m]=iV(h)}return(0,X.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};NG.displayName=`ConnectionLine`;var PG={};function FG(e=PG){(0,y.useRef)(e),HH(),(0,y.useEffect)(()=>{},[e])}function IG(){HH(),(0,y.useRef)(!1),(0,y.useEffect)(()=>{},[])}function LG({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,preventScrolling:A,defaultMarkerColor:te,zoomOnScroll:ne,zoomOnPinch:re,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,zoomOnDoubleClick:se,panOnDrag:ce,autoPanOnSelection:j,onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneScroll:pe,onPaneContextMenu:me,paneClickDistance:he,nodeClickDistance:ge,onEdgeContextMenu:_e,onEdgeMouseEnter:M,onEdgeMouseMove:N,onEdgeMouseLeave:P,reconnectRadius:ve,onReconnect:ye,onReconnectStart:be,onReconnectEnd:xe,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,viewport:Oe,onViewportChange:ke,nodesDraggable:Ae}){return FG(e),FG(t),IG(),TG(n),DG(Oe),(0,X.jsx)(EW,{onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:pe,paneClickDistance:he,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ne,zoomOnPinch:re,zoomOnDoubleClick:se,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,panOnDrag:ce,autoPanOnSelection:j,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,onViewportChange:ke,isControlledViewport:!!Oe,children:(0,X.jsxs)(wG,{children:[(0,X.jsx)(SG,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ye,onReconnectStart:be,onReconnectEnd:xe,onlyRenderVisibleElements:T,onEdgeContextMenu:_e,onEdgeMouseEnter:M,onEdgeMouseMove:N,onEdgeMouseLeave:P,reconnectRadius:ve,defaultMarkerColor:te,noPanClassName:we,disableKeyboardA11y:Te,rfId:De}),(0,X.jsx)(MG,{style:h,type:m,component:g,containerStyle:_}),(0,X.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,X.jsx)(IW,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ge,onlyRenderVisibleElements:T,noPanClassName:we,noDragClassName:Se,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,nodesDraggable:Ae}),(0,X.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}LG.displayName=`GraphView`;var RG=(0,y.memo)(LG),zG=CB(`React Flow`,`https://reactflow.dev/`),BG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Bz;FV(h,g,_);let{nodesInitialized:x}=EV(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=AB(tB(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Bz,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Uz.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...Kz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:zG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Hz,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},VG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>IH((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await aB({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...BG({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=EV(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();FV(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=MV(e,n,r,i,a,o,l);d&&(CV(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=mV(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=jV(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(SU(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(CU(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>wU(e,!0)));return}i(TU(r,new Set([...e]),!0)),a(TU(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>wU(e,!0)));return}a(TU(n,new Set([...e]))),i(TU(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(wU(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(wU(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,wU(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,wU(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(EV(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return NV({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...Kz}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...BG()})}},Object.is);function HG({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,y.useState)(()=>VG({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,X.jsx)(zH,{value:m,children:(0,X.jsx)(LU,{children:(0,X.jsx)(cW,{children:p})})})}function UG({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,y.useContext)(RH)?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(HG,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var WG={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function GG({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:te,onSelectionDragStop:ne,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onBeforeDelete:oe,connectionMode:se,connectionLineType:ce=qz.Bezier,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,deleteKeyCode:de=`Backspace`,selectionKeyCode:fe=`Shift`,selectionOnDrag:pe=!1,selectionMode:me=Gz.Full,panActivationKeyCode:he=`Space`,multiSelectionKeyCode:ge=jB()?`Meta`:`Control`,zoomActivationKeyCode:_e=jB()?`Meta`:`Control`,snapToGrid:M,snapGrid:N,onlyRenderVisibleElements:P=!1,selectNodesOnDrag:ve,nodesDraggable:ye,autoPanOnNodeFocus:be,nodesConnectable:xe,nodesFocusable:Se,nodeOrigin:Ce=sU,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee=!0,defaultViewport:De=cU,minZoom:Oe=.5,maxZoom:ke=2,translateExtent:Ae=Bz,preventScrolling:je=!0,nodeExtent:Me,defaultMarkerColor:Ne=`#b1b1b7`,zoomOnScroll:Pe=!0,zoomOnPinch:Fe=!0,panOnScroll:Ie=!1,panOnScrollSpeed:Le=.5,panOnScrollMode:Re=Wz.Free,zoomOnDoubleClick:ze=!0,panOnDrag:Be=!0,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe=1,nodeClickDistance:Je=0,children:Ye,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:F=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:ct=`nopan`,fitView:lt,fitViewOptions:ut,connectOnClick:dt,attributionPosition:ft,proOptions:pt,defaultEdgeOptions:mt,elevateNodesOnSelect:ht=!0,elevateEdgesOnSelect:gt=!1,disableKeyboardA11y:_t=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanOnSelection:bt=!0,autoPanSpeed:xt,connectionRadius:St,isValidConnection:Ct,onError:wt,style:Tt,id:Et,nodeDragThreshold:Dt,connectionDragThreshold:Ot,viewport:kt,onViewportChange:At,width:jt,height:Mt,colorMode:Nt=`light`,debug:Pt,onScroll:Ft,ariaLabelConfig:It,zIndexMode:Lt=`basic`,...Rt},zt){let Bt=Et||`1`,Vt=mU(Nt),Ht=(0,y.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Ft?.(e)},[Ft]);return(0,X.jsx)(`div`,{"data-testid":`rf__wrapper`,...Rt,onScroll:Ht,style:{...Tt,...WG},ref:zt,className:nP([`react-flow`,i,Vt]),id:Et,role:`application`,children:(0,X.jsxs)(UG,{nodes:e,edges:t,width:jt,height:Mt,fitView:lt,fitViewOptions:ut,minZoom:Oe,maxZoom:ke,nodeOrigin:Ce,nodeExtent:Me,zIndexMode:Lt,children:[(0,X.jsx)(fU,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ye,autoPanOnNodeFocus:be,nodesConnectable:xe,nodesFocusable:Se,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,minZoom:Oe,maxZoom:ke,nodeExtent:Me,onNodesChange:it,onEdgesChange:at,snapToGrid:M,snapGrid:N,connectionMode:se,translateExtent:Ae,connectOnClick:dt,defaultEdgeOptions:mt,fitView:lt,fitViewOptions:ut,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:te,onSelectionDragStart:A,onSelectionDragStop:ne,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ct,nodeOrigin:Ce,rfId:Bt,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:xt,onError:wt,connectionRadius:St,isValidConnection:Ct,selectNodesOnDrag:ve,nodeDragThreshold:Dt,connectionDragThreshold:Ot,onBeforeDelete:oe,debug:Pt,ariaLabelConfig:It,zIndexMode:Lt}),(0,X.jsx)(RG,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ce,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:me,deleteKeyCode:de,multiSelectionKeyCode:ge,panActivationKeyCode:he,zoomActivationKeyCode:_e,onlyRenderVisibleElements:P,defaultViewport:De,translateExtent:Ae,minZoom:Oe,maxZoom:ke,preventScrolling:je,zoomOnScroll:Pe,zoomOnPinch:Fe,zoomOnDoubleClick:ze,panOnScroll:Ie,panOnScrollSpeed:Le,panOnScrollMode:Re,panOnDrag:Be,autoPanOnSelection:bt,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe,nodeClickDistance:Je,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:F,defaultMarkerColor:Ne,noDragClassName:ot,noWheelClassName:st,noPanClassName:ct,rfId:Bt,disableKeyboardA11y:_t,nodeExtent:Me,viewport:kt,onViewportChange:At,nodesDraggable:ye}),(0,X.jsx)(oU,{onSelectionChange:k}),Ye,(0,X.jsx)(eU,{proOptions:pt,position:ft}),(0,X.jsx)(ZH,{rfId:Bt,disableKeyboardA11y:_t})]})})}var KG=MU(GG);zz.error014();function qG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,X.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nP([`react-flow__background-pattern`,n,r])})}function JG({radius:e,className:t}){return(0,X.jsx)(`circle`,{cx:e,cy:e,r:e,className:nP([`react-flow__background-pattern`,`dots`,t])})}var YG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(YG||={});var XG={[YG.Dots]:1,[YG.Lines]:1,[YG.Cross]:6},ZG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function QG({id:e,variant:t=YG.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,y.useRef)(null),{transform:f,patternId:p}=VH(ZG,LH),m=r||XG[t],h=t===YG.Dots,g=t===YG.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:v,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return(0,X.jsxs)(`svg`,{className:nP([`react-flow__background`,l]),style:{...c,...GU,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,X.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,X.jsx)(JG,{radius:b/2,className:u}):(0,X.jsx)(qG,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,X.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}QG.displayName=`Background`,(0,y.memo)(QG);function $G(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,X.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function eK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,X.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function tK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,X.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function nK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function rK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function iK({children:e,className:t,...n}){return(0,X.jsx)(`button`,{type:`button`,className:nP([`react-flow__controls-button`,t]),...n,children:e})}var aK=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function oK({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=HH(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=VH(aK,LH),{zoomIn:y,zoomOut:b,fitView:x}=BU();return(0,X.jsxs)(QH,{className:nP([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(iK,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,X.jsx)($G,{})}),(0,X.jsx)(iK,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,X.jsx)(eK,{})})]}),n&&(0,X.jsx)(iK,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,X.jsx)(tK,{})}),r&&(0,X.jsx)(iK,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,X.jsx)(rK,{}):(0,X.jsx)(nK,{})}),u]})}oK.displayName=`Controls`,(0,y.memo)(oK);function sK({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,X.jsx)(`rect`,{className:nP([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var cK=(0,y.memo)(sK),lK=e=>e.nodes.map(e=>e.id),uK=e=>e instanceof Function?e:()=>e;function dK({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=cK,onClick:o}){let s=VH(lK,LH),c=uK(t),l=uK(e),u=uK(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,X.jsx)(X.Fragment,{children:s.map(e=>(0,X.jsx)(pK,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function fK({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=VH(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=NB(r);return{node:r,x:i,y:a,width:o,height:s}},LH);return!l||l.hidden||!PB(l)?null:(0,X.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var pK=(0,y.memo)(fK),mK=(0,y.memo)(dK),hK=200,gK=150,_K=e=>!e.hidden,vK=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?vB(tB(e.nodeLookup,{filter:_K}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yK=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bK=(e,t)=>yK(e.viewBB,t.viewBB)&&yK(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,xK=`react-flow__minimap-desc`;function SK({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:b=1,offsetScale:x=5}){let S=HH(),C=(0,y.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:ee,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=VH(vK,bK),te=e?.width??hK,ne=e?.height??gK,re=w.width/te,ie=w.height/ne,ae=Math.max(re,ie),oe=ae*te,se=ae*ne,ce=x*ae,j=w.x-(oe-w.width)/2-ce,le=w.y-(se-w.height)/2-ce,ue=oe+ce*2,de=se+ce*2,fe=`${xK}-${D}`,pe=(0,y.useRef)(0),me=(0,y.useRef)();pe.current=ae,(0,y.useEffect)(()=>{let e=S.getState().panZoom;if(C.current&&e)return me.current=QV({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>pe.current}),()=>{me.current?.destroy()}},[T]),(0,y.useEffect)(()=>{me.current?.update({translateExtent:ee,width:O,height:k,inversePan:v,pannable:h,zoomStep:b,zoomable:g})},[h,g,v,b,ee,O,k]);let he=p?e=>{let[t,n]=me.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ge=(0,y.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),_e=m?ge:void 0,M=_??A[`minimap.ariaLabel`];return(0,X.jsx)(QH,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ae:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:nP([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,X.jsxs)(`svg`,{width:te,height:ne,viewBox:`${j} ${le} ${ue} ${de}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":fe,ref:C,onClick:he,children:[M&&(0,X.jsx)(`title`,{id:fe,children:M}),(0,X.jsx)(mK,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,X.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${j-ce},${le-ce}h${ue+ce*2}v${de+ce*2}h${-ue-ce*2}z
741
- M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}SK.displayName=`MiniMap`,(0,y.memo)(SK);var CK=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wK={[pH.Line]:`right`,[pH.Handle]:`bottom-right`};function TK({nodeId:e,position:t,variant:n=pH.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=aW(),b=typeof e==`string`?e:v,x=HH(),S=(0,y.useRef)(null),C=n===pH.Handle,w=VH((0,y.useCallback)(CK(C&&p),[C,p]),LH),T=(0,y.useRef)(null),E=t??wK[n];(0,y.useEffect)(()=>{if(S.current&&b)return T.current||=wH({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=jV([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...FB({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]);let D=E.split(`-`);return(0,X.jsx)(`div`,{className:nP([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,y.memo)(TK);function EK(e){switch(e.type){case`page`:return Oy;case`agent`:return Mv;case`generate`:return e.asset===`image`?by:e.asset===`video`?Ab:e.asset===`dashboard`?Sy:iy;case`widget`:return vv;case`surface`:return wy;case`film`:return Bv;case`review`:return ey;case`result`:return cy}return Mb}var DK={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,film:`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function OK(e){return Z(`type.${e.type}`)}var kK=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function AK(e){return kK.includes(e)?Z(`tool.${e}`):e}function jK(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(AK),n=e.mcp?.length?[`MCP: ${e.mcp.join(`, `)}`]:[];return[...t,...n].join(` · `)||e.instructions.slice(0,90)}case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`film`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?Z(`editor.reviewEditable`):null,e.regenerate?Z(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var MK=280,NK=92;function PK({data:e}){let{step:t,selected:n,issue:r,active:i,pulse:a,cost:o,passed:s,onAddAfter:c}=e,l=EK(t);return(0,X.jsxs)(`div`,{className:Q(`group relative w-[280px] cursor-pointer rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 transition`,n?`shadow-elevated ring-2 ring-ember`:i?`ring-2 ring-moss`:a?`ring-2 ring-ember/60`:`ring-border-soft hover:shadow-elevated`),children:[i?(0,X.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-moss`}):a?(0,X.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-ember`}):null,(0,X.jsx)(pW,{type:`target`,position:$.Top}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:Q(`inline-flex size-6 items-center justify-center rounded-md`,DK[t.type]),children:(0,X.jsx)(l,{className:`size-3.5`})}),(0,X.jsx)(`span`,{className:`font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.07em]`,children:OK(t)}),r?(0,X.jsx)(Rv,{className:`ml-auto size-4 text-rose`}):s&&!i?(0,X.jsx)(Iv,{className:`ml-auto size-4 text-moss`}):o===null?null:(0,X.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] text-ink-3 tabular-nums`,children:[`≈`,` `,Z(`nav.credits`,{n:o<10?o.toLocaleString(void 0,{maximumFractionDigits:1}):Math.round(o)})]})]}),(0,X.jsx)(`div`,{className:`mt-1.5 truncate font-display font-semibold text-[0.9375rem] text-ink`,children:t.title}),(0,X.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:jK(t)||`\xA0`}),(0,X.jsx)(pW,{type:`source`,position:$.Bottom}),c?(0,X.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},className:Q(`nodrag nopan -translate-x-1/2 -translate-y-1/2 absolute top-full left-1/2 z-10 inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-full bg-card px-3 text-[0.75rem] text-ember-strong shadow-soft ring-1 ring-ember/40 transition hover:bg-ember-tint focus-visible:opacity-100`,n?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`),children:[(0,X.jsx)(gb,{className:`size-3.5`}),` `,Z(`addStep.add`)]}):null]})}function FK({data:e}){return(0,X.jsxs)(`div`,{className:Q(`flex w-[280px] cursor-pointer items-center gap-3 rounded-full bg-paper-2 py-1.5 pr-5 pl-2 transition`,e.selected?`ring-2 ring-ember`:`hover:bg-paper-3`),children:[(0,X.jsx)(vw,{kind:e.avatar,size:40,interactive:!1}),(0,X.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:e.title}),(0,X.jsx)(pW,{type:`source`,position:$.Bottom})]})}function IK({data:e}){return(0,X.jsxs)(`div`,{className:`w-[280px] rounded-xl border border-ember/50 border-dashed bg-card/70 px-4 py-3 text-left`,children:[(0,X.jsx)(pW,{type:`target`,position:$.Top}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ember-strong`,children:[(0,X.jsx)(OS,{className:`size-3.5`}),` `,Z(`addStep.building`)]}),(0,X.jsx)(`div`,{className:`mt-1.5 line-clamp-2 text-[0.8125rem] text-ink-2`,children:e.prompt}),(0,X.jsx)(pW,{type:`source`,position:$.Bottom})]})}function LK(e){let{data:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s}=e,c={label:e.label,labelStyle:e.labelStyle,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,markerEnd:e.markerEnd};if(!t?.points.length){let[e,t,l]=ZB({sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s});return(0,X.jsx)(qW,{path:e,labelX:t,labelY:l,...c})}let l=[{x:n,y:r},...t.points,{x:i,y:a}],u=l.map((e,t)=>{let n=l[t-1];if(!n)return`M ${e.x} ${e.y}`;let r=(n.y+e.y)/2;return`C ${n.x} ${r} ${e.x} ${r} ${e.x} ${e.y}`}).join(` `);return(0,X.jsx)(qW,{path:u,labelX:t.labelX,labelY:t.labelY,...c})}var RK={step:PK,start:FK,adding:IK},zK={branch:LK},BK=`__adding`,VK=34,HK={},UK={};function WK(e){return`${Math.round(e*100)} %`}function GK(e){let t=e.ask?Z(`editor.whenAsk`,{text:e.ask}):ju(e)?Z(`editor.otherwise`):Nu(e.when).map(KK).join(` · `);return e.max?`${t} (${Z(`editor.atMost`,{count:e.max})})`:t}function KK(e){let t=Array.isArray(e.value)?e.value.join(` / `):String(e.value??``);switch(e.op){case`equals`:return`${e.field} = ${t}`;case`notEquals`:return`${e.field} ≠ ${t}`;case`in`:return`${e.field} ∈ ${t}`;case`notEmpty`:return Z(`editor.whenFilled`,{field:e.field});case`empty`:return Z(`editor.whenEmpty`,{field:e.field});case`gt`:return`${e.field} > ${t}`;case`lt`:return`${e.field} < ${t}`;case`contains`:return Z(`editor.whenContains`,{field:e.field,value:t})}}function qK(e,t,n,r,i,a,o,s,c,l){let u=new tP.graphlib.Graph;u.setGraph({rankdir:`TB`,nodesep:48,ranksep:46,marginx:20,marginy:20}),u.setDefaultEdgeLabel(()=>({})),u.setNode(`__start`,{width:MK,height:52});for(let t of e.steps)u.setNode(t.id,{width:MK,height:NK});let d=[],f={markerEnd:{type:Jz.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}};c&&u.setNode(BK,{width:MK,height:NK});let p=(t,n,r,i={})=>{let a=e.steps[r]?.id;if(c?.at===r){u.setEdge(n,BK),d.push({id:t,source:n,target:BK,...i,...f}),a&&(u.setEdge(BK,a),d.push({id:`${t}-adding`,source:BK,target:a,...f}));return}a&&(u.hasEdge(n,a)||u.setEdge(n,a),d.push({id:t,source:n,target:a,...i,...f}))};(e.steps[0]||c)&&p(`e-start`,`__start`,0),e.steps.forEach((t,n)=>{let r=e.steps[n+1],i=s[t.id],a=i&&i.rule!==null?t.next?.[i.rule]?.goto:void 0,o=new Map;for(let n of t.next??[])n.goto!==`end`&&e.steps.some(e=>e.id===n.goto)&&o.set(n.goto,[...o.get(n.goto)??[],GK(n)]);for(let[e,n]of o){let r=n.join(` · `),o=r.length>VK?`${r.slice(0,33)}…`:r,s=a===e?i?.probabilities?.[`r${i.rule}`]:void 0,c=a===e,l=c?`✓ ${o}${s===void 0?``:` · ${WK(s)}`}`:o;u.setEdge(t.id,e,{width:l.length*6.2+16,height:22,labelpos:`c`}),d.push({id:`b-${t.id}-${e}`,type:`branch`,source:t.id,target:e,label:l,className:`cursor-pointer`,labelStyle:{fontSize:11,fill:c?`var(--moss)`:`var(--ink-2)`},labelBgStyle:{fill:`var(--paper-2)`},labelBgPadding:[6,3],labelBgBorderRadius:8,style:c?{strokeDasharray:`5 4`,stroke:`var(--moss)`,strokeWidth:2}:{strokeDasharray:`5 4`},...f})}if((r||c?.at===n+1)&&t.type!==`result`&&!t.next?.some(ju)){let e=i?.rule===null,r=e?i?.probabilities?.none:void 0;p(`n-${t.id}`,t.id,n+1,{...t.next?.length?{label:e?`✓ ${Z(`editor.otherwise`)}${r===void 0?``:` · ${WK(r)}`}`:Z(`editor.otherwise`),className:`cursor-pointer`,labelStyle:{fontSize:11,fill:e?`var(--moss)`:`var(--ink-3)`},labelBgStyle:{fill:`var(--background)`},...e?{style:{stroke:`var(--moss)`,strokeWidth:2}}:{}}:{}})}}),tP.layout(u);for(let e of d){if(e.type!==`branch`)continue;let t=u.edge(e.source,e.target),n=(t.points??[]).slice(1,-1);n.length&&t.x!==void 0&&t.y!==void 0&&(e.data={points:n,labelX:t.x,labelY:t.y})}return{nodes:[{id:`__start`,type:`start`,position:{x:u.node(`__start`).x-MK/2,y:u.node(`__start`).y-26},data:{title:e.title,avatar:e.avatar,selected:t===`__wizard`},draggable:!1},...e.steps.map((e,s)=>{let c=u.node(e.id);return{id:e.id,type:`step`,position:{x:c.x-MK/2,y:c.y-NK/2},data:{step:e,selected:t===e.id,issue:n.has(e.id),index:s,active:r===e.id,pulse:i.includes(e.id),cost:a[e.id]?.credits??null,passed:o.has(e.id),onAddAfter:l&&e.type!==`result`?()=>l(s+1):void 0},draggable:!1}}),...c?[{id:BK,type:`adding`,position:{x:u.node(BK).x-MK/2,y:u.node(BK).y-NK/2},data:{prompt:c.prompt},draggable:!1,selectable:!1}]:[]],edges:d}}function JK(){let e=BU(),t=`inline-flex size-8 items-center justify-center rounded-full text-ink-3 hover:bg-accent hover:text-ink`;return(0,X.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 flex items-center gap-0.5 rounded-full bg-card p-1 shadow-soft ring-1 ring-border-soft`,children:[(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomOut(),"aria-label":`Zoom out`,children:(0,X.jsx)(Wy,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.fitView({padding:.2,duration:300}),"aria-label":`Fit`,children:(0,X.jsx)(cb,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomIn(),"aria-label":`Zoom in`,children:(0,X.jsx)(eb,{className:`size-4`})})]})}var YK=.8,XK=new Set;function ZK({def:e,selected:t,onSelect:n,issueSteps:r,activeStep:i,pulse:a,costs:o=HK,passed:s=XK,minFitZoom:c=YK,fitKey:l,decisions:u=UK,onBranch:d,adding:f=null,onInsert:p}){let{nodes:m,edges:h}=(0,y.useMemo)(()=>qK(e,t,r,i,a??[],o,s,u,f,p),[e,t,r,i,a,o,s,u,f,p]),g=BU(),_=(0,y.useRef)(null),v=e.steps.map(e=>e.id).join(`|`)+(f?`+${f.at}`:``);return(0,y.useEffect)(()=>{let e=requestAnimationFrame(()=>{let e=_.current;if(!e||!m.length)return;let t=m.map(e=>e.position.x),n=m.map(e=>e.position.y),r={x:Math.min(...t),y:Math.min(...n),width:Math.max(...t)+MK-Math.min(...t),height:Math.max(...n)+NK-Math.min(...n)},i=Math.min(e.clientWidth/(r.width*1.2),e.clientHeight/(r.height*1.15),1),a=Math.max(i,c),o=(e.clientWidth-r.width*a)/2-r.x*a,s=i>=c?(e.clientHeight-r.height*a)/2-r.y*a:24-r.y*a;g.setViewport({x:o,y:s,zoom:a},{duration:400})});return()=>cancelAnimationFrame(e)},[v,l,g]),(0,X.jsx)(`div`,{ref:_,className:`h-full w-full`,children:(0,X.jsx)(KG,{nodes:m,edges:h,nodeTypes:RK,edgeTypes:zK,onNodeClick:(e,t)=>{t.id!==BK&&n(t.id===`__start`?`__wizard`:t.id)},onEdgeClick:(t,r)=>{let i=e.steps.find(e=>e.id===(r.source===BK?``:r.source));i?.next?.length&&d?d(i.id):i&&n(i.id)},onPaneClick:()=>n(null),nodesConnectable:!1,nodesDraggable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnScroll:!1,zoomOnPinch:!0,minZoom:.3,maxZoom:1.4,proOptions:{hideAttribution:!0},children:(0,X.jsx)(JK,{})})})}function QK(e){return(0,X.jsx)(HG,{children:(0,X.jsx)(ZK,{...e})})}var $K=`engenty/flow`,eq=new Set([`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`location`,`slot`]),tq=420,nq=600,rq=320,iq=new Set;function aq(e){if(e.structuredContent)return e.structuredContent;let t=e.content?.find(e=>e.type===`text`);try{return t&&`text`in t?JSON.parse(t.text):null}catch{return t&&`text`in t?t.text:null}}function oq(e){let t=aq(e);if(e.isError){let e=t&&typeof t==`object`&&`error`in t?String(t.error):String(t);throw Object.assign(Error(e),{body:t})}return t}function sq(e){e&&(e.theme&&document.documentElement.classList.toggle(`dark`,e.theme===`dark`),e.locale&&Jx(e.locale.toLowerCase().startsWith(`de`)?`de`:`en`))}function cq(){let e=(0,y.useMemo)(()=>new rv({name:`engenty-wizards-flow`,version:`1.0.0`},{},{autoResize:!0}),[]),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(`asking`);(0,y.useEffect)(()=>{e.ontoolresult=e=>{let t=e._meta?.[$K];t&&(n(t),i(t.run??null))},e.onhostcontextchanged=e=>{o(t=>({...t,...e})),sq(e)},e.connect().then(()=>{let t=e.getHostContext();o(t),sq(t)}).catch(e=>console.error(`[flow widget]`,e))},[e]);let d=(0,y.useCallback)(async(t,n)=>oq(await e.callServerTool({name:t,arguments:n})),[e]),f=(0,y.useCallback)(t=>{let n=t.outputs.map(e=>e.title).join(`, `),r=[`engenty wizards run ${t.runId}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,n?`Made so far: ${n}.`:``,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].filter(Boolean).join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),p=(0,y.useRef)(``),m=(0,y.useCallback)(t=>{let n=t?`${t.status}:${t.step?.id??``}`:``;if(!t||n===p.current)return;p.current=n;let r=[`engenty wizards run ${t.id}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),h=(0,y.useRef)(null),g=(0,y.useRef)(``),_=(0,y.useCallback)(e=>{m(e);let t=e?`${e.status}:${e.step?.id??``}`:``;t!==g.current&&(g.current=t,h.current?.scrollTo({top:0}))},[m]),v=r?.runId,b=t?.runtime;(0,y.useEffect)(()=>{if(!v||!b){u(`no`);return}cS(b),u(`asking`);let e=!0;return fetch(lS(`/api/runs/${v}`),{credentials:`include`}).then(t=>e&&u(t.ok?`yes`:`no`)).catch(()=>e&&u(`no`)),()=>{e=!1}},[v,b]);let x=(0,y.useCallback)(async t=>{let r=await e.callServerTool({name:`run_wizard`,arguments:{wizardId:t}});oq(r);let a=r._meta?.[$K];a&&(n(a),i(a.run??null))},[e]),S=r?.status===`running`;(0,y.useEffect)(()=>{if(!v||!S||l!==`no`)return;let e=!0;return(async()=>{for(;e;)try{let t=await d(`get_run`,{runId:v,waitSeconds:20});if(!e)return;if(i(t),t.status!==`running`){f(t);return}}catch{await new Promise(e=>setTimeout(e,3e3))}})(),()=>{e=!1}},[v,S,l,d,f]);let C=(0,y.useMemo)(()=>new Set(r?.passed??[]),[r]),w=a?.displayMode===`fullscreen`,T=a?.availableDisplayModes?.includes(`fullscreen`),E=t=>{e.openLink({url:t}).catch(()=>window.open(t,`_blank`,`noopener`))};if(!t||r&&l===`asking`)return(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-ink-3 text-sm`,style:{height:160},children:[(0,X.jsx)(OS,{className:`size-4`}),Z(`flowApp.loading`)]});if(r&&l===`yes`)return(0,X.jsx)(`div`,{ref:h,className:`overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:nq},children:(0,X.jsx)(gA,{runId:r.runId,compact:!0,stickyProgress:!0,onView:_})});if(!r)return(0,X.jsx)(lq,{view:t,onStart:()=>x(t.wizard.id)});let D=r&&r.status!==`done`?r.step?.id??null:null;return(0,X.jsxs)(`div`,{className:Q(`flex bg-background text-ink`,w?`h-screen flex-row`:`flex-col`),children:[(0,X.jsx)(`div`,{className:Q(`relative min-w-0`,w?`flex-1`:``),style:w?void 0:{height:rq},children:(0,X.jsx)(QK,{def:t.definition,selected:s,onSelect:c,issueSteps:iq,activeStep:D,passed:C,minFitZoom:.45,fitKey:String(w)})}),(0,X.jsxs)(`aside`,{className:Q(`flex flex-col gap-3 border-border-soft bg-card p-4`,w?`w-[380px] overflow-y-auto border-l`:`border-t`),children:[(0,X.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:t.wizard.title}),(0,X.jsx)(AS,{children:t.wizard.shows===`published`?Z(`flowApp.published`):Z(`flowApp.draft`)}),t.wizard.issues?(0,X.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:Z(`flowApp.issues`,{n:t.wizard.issues})}):null,(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:T?(0,X.jsxs)(_S,{size:`sm`,variant:`ghost`,onClick:()=>e.requestDisplayMode({mode:w?`inline`:`fullscreen`}).then(({mode:e})=>o(t=>({...t,displayMode:e}))).catch(()=>void 0),children:[w?(0,X.jsx)(Hy,{className:`size-4`}):(0,X.jsx)(Ry,{className:`size-4`}),Z(w?`flowApp.inline`:`flowApp.fullscreen`)]}):null})]}),(0,X.jsx)(uq,{report:r,selected:s,call:d,onReport:e=>{i(e),f(e)},open:E})]})]})}function lq({view:e,onStart:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=e.wizard.description??e.definition.description;return(0,X.jsxs)(`div`,{className:`flex flex-col overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:nq},children:[(0,X.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center px-6 pt-6 pb-6 text-center`,children:[(0,X.jsx)(vw,{kind:e.wizard.avatar??e.definition.avatar,size:120,fluffy:!0}),(0,X.jsx)(`h1`,{className:`mt-2 text-balance font-display font-semibold text-[1.625rem] leading-[1.1] tracking-tight`,children:e.wizard.title}),c?(0,X.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c}):null,e.wizard.published?(0,X.jsxs)(_S,{size:`lg`,className:`mt-8 min-w-48`,busy:n,onClick:async()=>{r(!0),a(null);try{await t()}catch(e){a(e.message),r(!1)}},children:[Z(`run.start`),` `,(0,X.jsx)(wv,{className:`size-4`})]}):(0,X.jsx)(`p`,{className:`mt-8 rounded-xl bg-paper-2 px-5 py-4 text-[0.875rem] text-ink-2`,children:Z(`flowApp.notPublished`)}),i?(0,X.jsx)(`p`,{className:`mt-4 text-[0.875rem] text-rose`,children:i}):null,(0,X.jsxs)(_S,{size:`sm`,variant:`ghost`,className:`mt-4`,onClick:()=>s(!o),children:[(0,X.jsx)(Pb,{className:`size-4`}),Z(`flowApp.flow`)]})]}),o?(0,X.jsx)(`div`,{className:`relative border-border-soft border-t`,style:{height:tq},children:(0,X.jsx)(QK,{def:e.definition,selected:null,onSelect:()=>void 0,issueSteps:iq,activeStep:null,minFitZoom:.45})}):null]})}function uq({report:e,selected:t,call:n,onReport:r,open:i}){let[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),l=async(t,i)=>{o(!0),c(null);try{r(await n(t,{runId:e.runId,...i}))}catch(e){c(e.message)}finally{o(!1)}},u=e.waitingFor,d=t?e.outputs.filter(e=>e.stepId===t):[],f=e.events.at(-1),p=e.browserUrl,m=p?()=>i(p):void 0,h=null;return e.status===`running`&&!(u&&`ask`in u)?h=(0,X.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-2`,children:[(0,X.jsx)(OS,{className:`size-4`}),f&&Yx(f)||Z(`run.working`)]}):u&&`page`in u?h=(0,X.jsx)(fq,{fields:u.fields,busy:a,onSubmit:e=>l(`answer_page`,{stepId:u.page,values:e,waitSeconds:3}),onBrowser:m},`${e.runId}-${u.page}`):u&&`review`in u?h=(0,X.jsx)(mq,{outputs:e.outputs.filter(e=>u.show.includes(e.stepId)),targets:u.show,busy:a,onAccept:()=>l(`review_step`,{stepId:u.review,action:{type:`accept`}}),onRegenerate:(e,t)=>l(`review_step`,{stepId:u.review,action:{type:`regenerate`,target:e,note:t}}),open:i}):u&&`ask`in u?h=u.kind===`confirm`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`font-medium text-[0.8125rem]`,children:Z(`flowApp.ask`)}),(0,X.jsxs)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:[u.reason,` — `,u.service,`: `,u.action]}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(_S,{size:`sm`,busy:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`allow`}),children:Z(`flowApp.allow`)}),(0,X.jsx)(_S,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`skip`}),children:Z(`flowApp.skip`)})]})]}):(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Z(`flowApp.signIn`,{site:u.site})}),m?(0,X.jsxs)(_S,{size:`sm`,onClick:m,children:[(0,X.jsx)(Qv,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]}):e.status===`failed`?h=(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:e.error||Z(`run.failed`)}),(0,X.jsx)(_S,{size:`sm`,busy:a,onClick:()=>l(`control_run`,{action:`retry`}),children:Z(`run.retry`)})]}):e.status===`cancelled`?h=(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`run.cancelled`)}):e.status===`done`&&(h=(0,X.jsx)(hq,{outputs:e.outputs,open:i})),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,X.jsx)(`span`,{className:`font-medium text-ink-2`,children:e.status===`done`?Z(`flowApp.done`):e.step?.title}),(0,X.jsxs)(`span`,{children:[`· `,Z(`flowApp.credits`,{n:e.credits})]}),(0,X.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.status===`waiting_input`&&e.passed.length?(0,X.jsxs)(_S,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`control_run`,{action:`back`}),children:[(0,X.jsx)(Eb,{className:`size-4`}),Z(`run.back`)]}):null,m?(0,X.jsxs)(_S,{size:`sm`,variant:`ghost`,onClick:m,children:[(0,X.jsx)(Qv,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]})]}),h,s?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:Z(`flowApp.failed`,{error:s})}):null,d.length&&e.status!==`done`?(0,X.jsx)(hq,{outputs:d,open:i}):null]})}function dq(e){return e.value??e.default??(e.kind===`multiselect`?[]:e.kind!==`toggle`&&``)}function fq({fields:e,busy:t,onSubmit:n,onBrowser:r}){let i=e.filter(e=>eq.has(e.kind)),a=e.filter(e=>!eq.has(e.kind)),[o,s]=(0,y.useState)(()=>Object.fromEntries(i.map(e=>[e.id,dq(e)]))),c=(e,t)=>s(n=>({...n,[e]:t})),l=i.some(e=>{let t=o[e.id];return e.required&&(t===``||t===void 0||Array.isArray(t)&&!t.length)});return a.some(e=>e.required)?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Z(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}),r?(0,X.jsxs)(_S,{size:`sm`,onClick:r,children:[(0,X.jsx)(Qv,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]}):(0,X.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault();let t={};for(let e of i){let n=o[e.id];n!==``&&n!==void 0&&(t[e.id]=e.kind===`number`?Number(n):e.kind===`location`?{label:String(n)}:n)}n(t)},children:[i.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(DS,{required:e.required,hint:e.help,children:e.label}),(0,X.jsx)(`div`,{className:`mt-1.5`,children:(0,X.jsx)(pq,{field:e,value:o[e.id],onChange:t=>c(e.id,t)})})]},e.id)),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(_S,{type:`submit`,busy:t,disabled:l,children:Z(`run.next`)}),a.length?(0,X.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:Z(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}):null]})]})}function pq({field:e,value:t,onChange:n}){let r=typeof t==`string`||typeof t==`number`?String(t):``;switch(e.kind){case`textarea`:return(0,X.jsx)(CS,{value:r,rows:4,placeholder:e.placeholder,onChange:e=>n(e.target.value)});case`select`:return(0,X.jsx)(wS,{value:r,onChange:n,placeholder:``,options:(e.options??[]).map(e=>({value:e,label:e}))});case`multiselect`:return(0,X.jsx)(TS,{multi:!0,value:Array.isArray(t)?t:[],onChange:n,options:e.options??[]});case`slot`:return e.options?.length?(0,X.jsx)(wS,{value:r,onChange:n,placeholder:``,options:e.options.map(e=>({value:e,label:Hu(e,Gx)}))}):(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`slot.none`)});case`toggle`:return(0,X.jsx)(ES,{checked:t===!0,onChange:n});case`location`:return(0,X.jsx)(xS,{value:t&&typeof t==`object`&&`label`in t?String(t.label??``):r,placeholder:e.placeholder,onChange:e=>n(e.target.value)});default:return(0,X.jsx)(xS,{type:e.kind===`number`?`number`:e.kind===`date`?`date`:e.kind===`email`?`email`:e.kind===`url`?`url`:e.kind===`color`?`color`:`text`,value:r,placeholder:e.placeholder,onChange:e=>n(e.target.value)})}}function mq({outputs:e,targets:t,busy:n,onAccept:r,onRegenerate:i,open:a}){let[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(t[0]??``);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(hq,{outputs:e,open:a}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>1?(0,X.jsx)(wS,{value:c,onChange:l,options:e.map(e=>({value:e.stepId,label:e.title}))}):null,(0,X.jsx)(CS,{rows:2,value:o,placeholder:Z(`run.regenerateNote`),onChange:e=>s(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(_S,{busy:n,onClick:r,children:Z(`run.accept`)}),(0,X.jsx)(_S,{variant:`ghost`,disabled:n||!o.trim()||!c,onClick:()=>i(c,o.trim()),children:Z(`run.regenerateGo`)})]})]})]})}function hq({outputs:e,open:t}){return(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,X.jsxs)(`section`,{className:`rounded-xl bg-paper-2 p-3`,children:[(0,X.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.8125rem] text-ink-2`,children:e.title}),e.text?(0,X.jsx)(TO,{text:e.text,className:`text-[0.8125rem]`}):null,e.assets.filter(e=>e.mime.startsWith(`image/`)).map(e=>(0,X.jsx)(`img`,{src:e.url,alt:e.name,className:`mt-2 max-h-64 rounded-lg`},e.url)),Object.keys(e.downloads).length?(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:Object.entries(e.downloads).map(([e,n])=>(0,X.jsxs)(_S,{size:`sm`,variant:`secondary`,onClick:()=>t(n),children:[(0,X.jsx)(Jv,{className:`size-4`}),e.toUpperCase()]},e))}):null]},e.stepId))})}(0,b.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(y.StrictMode,{children:(0,X.jsx)(cq,{})}));</script>
740
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,y.useEffect)(()=>{let n=t?.target??gU,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&GB(e))return!1;let n=yU(e.code,s);if(a.current.add(e[n]),vU(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=yU(e.code,s);vU(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function vU(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function yU(e,t){return t.includes(e)?`code`:`key`}var bU=()=>{let e=UH();return(0,y.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=jB(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return EB(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=DB(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function xU(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)SU(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function SU(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function CU(e,t){return xU(e,t)}function wU(e,t){return xU(e,t)}function TU(e,t){return{id:e,type:`select`,selected:t}}function EU(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(TU(a.id,e)))}return r}function DU({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function OU(e){return{id:e.id,type:`remove`}}var kU=wB(`React Flow`,`https://reactflow.dev/`);function AU(e,t,n={}){return iV(e,t,{...n,onError:n.onError??kU})}var jU=e=>Qz(e),MU=e=>Zz(e);function NU(e){return(0,y.forwardRef)(e)}var PU=typeof window<`u`?y.useLayoutEffect:y.useEffect;function FU(e){let[t,n]=(0,y.useState)(BigInt(0)),[r]=(0,y.useState)(()=>IU(()=>n(e=>e+BigInt(1))));return PU(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function IU(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var LU=(0,y.createContext)(null);function RU({children:e}){let t=UH(),n=FU((0,y.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=DU({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=FU((0,y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(DU({items:s,lookup:o}))},[])),i=(0,y.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,X.jsx)(LU.Provider,{value:i,children:e})}function zU(){let e=(0,y.useContext)(LU);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var BU=e=>!!e.panZoom;function VU(){let e=bU(),t=UH(),n=zU(),r=HH(BU),i=(0,y.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=jU(e)?e:n.get(e.id),a=i.parentId?IB(i.position,i.measured,i.parentId,n,r):i.position;return _B({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&jU(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&MU(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await cB({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(OU);o?.(f),c(e)}if(m){let e=d.map(OU);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=SB(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=_B(s?r:a),l=xB(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=SB(e)?e:a(e);if(!r)return!1;let i=xB(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return tB(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??RB();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,y.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var HU=e=>e.selected,UU=typeof window<`u`?window:void 0;function WU({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=UH(),{deleteElements:r}=VU(),i=_U(e,{actInsideInputWithModifier:!1}),a=_U(t,{target:UU});(0,y.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(HU),edges:e.filter(HU)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,y.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function GU(e){let t=UH();(0,y.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=HB(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,Bz.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var KU={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},qU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function JU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=Gz.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=UH(),w=(0,y.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=HH(qU,RH),ee=_U(p),O=(0,y.useRef)();GU(w);let k=(0,y.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[v,b]);return(0,y.useEffect)(()=>{if(w.current){O.current=pH({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return C.setState({panZoom:O.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),(0,y.useEffect)(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:ee,preventScrolling:m,noPanClassName:_,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:k,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,ee,m,_,T,g,E,k,D,S,x]),(0,X.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:KU,children:h})}var YU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function XU(){let{userSelectionActive:e,userSelectionRect:t}=HH(YU,RH);return e&&t?(0,X.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var ZU=(e,t)=>n=>{n.target===t.current&&e?.(n)},QU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function $U({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Kz.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,y.useRef)(0),_=UH(),{userSelectionActive:v,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=HH(QU,RH),w=b&&(e||v),T=(0,y.useRef)(null),E=(0,y.useRef)(),D=(0,y.useRef)(new Set),ee=(0,y.useRef)(new Set),O=(0,y.useRef)(!1),k=(0,y.useRef)(!1),A=(0,y.useRef)({x:0,y:0}),te=(0,y.useRef)(!1),ne=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},re=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},ie=d?e=>d(e):void 0,ae=e=>{k.current&&=(e.stopPropagation(),!1)},oe=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=qB(n.nativeEvent,E.current),u=EB({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function se(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=DB(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=ee.current;D.current=new Set(rB(a,m,i,n===Kz.Partial,!0).map(e=>e.id)),ee.current=new Set;let v=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&ee.current.add(e)}}LB(h,D.current)||c(EU(a,D.current,!0)),LB(g,ee.current)||l(EU(o,ee.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ce(){if(!i||!E.current)return;let[e,t]=pB(A.current,E.current,C);S({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(ce);return}let{x:t,y:n}=A.current;se(t,n),g.current=requestAnimationFrame(ce)})}let j=()=>{cancelAnimationFrame(g.current),g.current=0,te.current=!1};(0,y.useEffect)(()=>()=>j(),[]);let le=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!E.current||!n)return;let{x:o,y:c}=qB(e.nativeEvent,E.current);A.current={x:o,y:c};let l=DB({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,te.current||=(ce(),!0),se(o,c)},ue=e=>{if(!w){e.target===T.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===T.current&&_.getState().userSelectionRect&&ne?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:D.current.size>0})),j())},de=e=>{e.target?.releasePointerCapture?.(e.pointerId),j()},fe=r===!0||Array.isArray(r)&&r.includes(0);return(0,X.jsxs)(`div`,{className:rP([`react-flow__pane`,{draggable:fe,dragging:x,selection:e}]),onClick:w?void 0:ZU(ne,T),onContextMenu:ZU(re,T),onWheel:ZU(ie,T),onPointerEnter:w?void 0:f,onPointerMove:w?le:p,onPointerUp:ue,onPointerCancel:w?de:void 0,onPointerDownCapture:w?oe:void 0,onClickCapture:w?ae:void 0,onPointerLeave:m,ref:T,style:KU,children:[h,(0,X.jsx)(XU,{})]})}function eW({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,Bz.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function tW({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=UH(),[c,l]=(0,y.useState)(!1),u=(0,y.useRef)();return(0,y.useEffect)(()=>{if(!t)return u.current=HV({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{eW({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,y.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var nW=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function rW(){let e=UH();return(0,y.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=nW(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=TB(t,i));let{position:a,positionAbsolute:s}=sB({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var iW=(0,y.createContext)(null),aW=iW.Provider;iW.Consumer;var oW=()=>(0,y.useContext)(iW),sW=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cW=(0,y.createContext)(null);function lW({children:e}){let t=HH(sW,RH);return(0,X.jsx)(cW.Provider,{value:t,children:e})}function uW(){let e=(0,y.useContext)(cW);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var dW={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},fW=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return dW;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Wz.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function pW({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=UH(),_=oW(),{connectOnClick:v,noPanClassName:y,rfId:b}=uW(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=HH(fW(_,m,e),RH);_||g.getState().onError?.(`010`,Bz.error010());let ee=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(AU(i,e,{onError:n}))}n?.(i),s?.(i)},O=e=>{if(!_)return;let t=KB(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();QV.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:ee,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,X.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:rP([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:O,onTouchStart:O,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=UB(t.target),h=n||c,{connection:v,isValid:y}=QV.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&ee(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var mW=(0,y.memo)(NU(pW));function hW({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[e?.label,(0,X.jsx)(mW,{type:`source`,position:n,isConnectable:t})]})}function gW({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(mW,{type:`target`,position:n,isConnectable:t}),e?.label,(0,X.jsx)(mW,{type:`source`,position:r,isConnectable:t})]})}function _W(){return null}function vW({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(mW,{type:`target`,position:n,isConnectable:t}),e?.label]})}var yW={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},bW={input:hW,default:gW,output:vW,group:_W};function xW(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var SW=e=>{let{width:t,height:n,x:r,y:i}=nB(e.nodeLookup,{filter:e=>!!e.selected});return{width:CB(t)?t:null,height:CB(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function CW({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=UH(),{width:i,height:a,transformString:o,userSelectionActive:s}=HH(SW,RH),c=rW(),l=(0,y.useRef)(null);(0,y.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(tW({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,X.jsx)(`div`,{className:rP([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,X.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(yW,e.key)&&(e.preventDefault(),c({direction:yW[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var wW=typeof window<`u`?window:void 0,TW=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function EW({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:te,noPanClassName:ne,disableKeyboardA11y:re,onViewportChange:ie,isControlledViewport:ae}){let{nodesSelectionActive:oe,userSelectionActive:se}=HH(TW,RH),ce=_U(l,{target:wW}),j=_U(h,{target:wW}),le=j||w,ue=j||b,de=u&&le!==!0,fe=ce||se||de;return WU({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,X.jsx)(JU,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ue,panActivationKeyPressed:j,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ce&&le,defaultViewport:E,translateExtent:D,minZoom:ee,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:te,noPanClassName:ne,onViewportChange:ie,isControlledViewport:ae,paneClickDistance:s,selectionOnDrag:de,children:(0,X.jsxs)($U,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:le,autoPanOnSelection:T,isSelecting:!!fe,selectionMode:d,selectionKeyPressed:ce,paneClickDistance:s,selectionOnDrag:de,children:[e,oe&&(0,X.jsx)(CW,{onSelectionContextMenu:A,noPanClassName:ne,disableKeyboardA11y:re})]})})}EW.displayName=`FlowRenderer`;var DW=(0,y.memo)(EW),OW=e=>t=>e?rB(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function kW(e){return HH((0,y.useCallback)(OW(e),[e]),RH)}var AW=e=>e.updateNodeInternals;function jW(){let e=HH(AW),[t]=(0,y.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,y.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function MW({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=UH(),a=(0,y.useRef)(null),o=(0,y.useRef)(null),s=(0,y.useRef)(e.sourcePosition),c=(0,y.useRef)(e.targetPosition),l=(0,y.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,y.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,y.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,y.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function NW({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=HH(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},RH),S=y.type||`default`,C=g?.[S]||bW[S];C===void 0&&(v?.(`003`,Bz.error003(S)),S=`default`,C=g?.default||bW.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),ee=UH(),O=FB(y),k=MW({node:y,nodeType:S,hasDimensions:O,resizeObserver:d}),A=tW({nodeRef:k,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),te=rW();if(y.hidden)return null;let ne=PB(y),re=xW(y),ie=T||w||t||n||r||i,ae=n?e=>n(e,{...b.userNode}):void 0,oe=r?e=>r(e,{...b.userNode}):void 0,se=i?e=>i(e,{...b.userNode}):void 0,ce=a?e=>a(e,{...b.userNode}):void 0,j=o?e=>o(e,{...b.userNode}):void 0,le=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=ee.getState();T&&(!r||!w||i>0)&&eW({id:e,store:ee,nodeRef:k}),t&&t(n,{...b.userNode})},ue=t=>{if(!(GB(t.nativeEvent)||m)){if(Hz.includes(t.key)&&T){let n=t.key===`Escape`;eW({id:e,store:ee,unselect:n,nodeRef:k})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(yW,t.key)){t.preventDefault();let{ariaLabelConfig:e}=ee.getState();ee.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),te({direction:yW[t.key],factor:t.shiftKey?4:1})}}},de=()=>{if(m||!k.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=ee.getState();i&&(rB(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ne.width/2,y.position.y+ne.height/2,{zoom:t[2]}))};return(0,X.jsx)(`div`,{className:rP([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:A}]),ref:k,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ie?`all`:`none`,visibility:O?`visible`:`hidden`,...y.style,...re},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onContextMenu:ce,onClick:le,onDoubleClick:j,onKeyDown:D?ue:void 0,tabIndex:D?0:void 0,onFocus:D?de:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${KH}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,X.jsx)(aW,{value:e,children:(0,X.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:A,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ne})})})}var PW=(0,y.memo)(NW),FW=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function IW(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=HH(FW,RH),a=kW(e.onlyRenderVisibleElements),o=jW();return(0,X.jsx)(`div`,{className:`react-flow__nodes`,style:KU,children:a.map(a=>(0,X.jsx)(PW,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}IW.displayName=`NodeRenderer`;var LW=(0,y.memo)(IW);function RW(e){return HH((0,y.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&tV({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),RH)}var zW=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,X.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},BW=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,X.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},VW={[Yz.Arrow]:zW,[Yz.ArrowClosed]:BW};function HW(e){let t=UH();return(0,y.useMemo)(()=>Object.prototype.hasOwnProperty.call(VW,e)?VW[e]:(t.getState().onError?.(`009`,Bz.error009(e)),null),[e])}var UW=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=HW(t);return c?(0,X.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,X.jsx)(c,{color:n,strokeWidth:o})}):null},WW=({defaultColor:e,rfId:t})=>{let n=HH(e=>e.edges),r=HH(e=>e.defaultEdgeOptions),i=(0,y.useMemo)(()=>vV(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,X.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,X.jsx)(`defs`,{children:i.map(e=>(0,X.jsx)(UW,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};WW.displayName=`MarkerDefinitions`;var GW=(0,y.memo)(WW);function KW({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,y.useState)({x:1,y:0,width:0,height:0}),p=rP([`react-flow__edge-textwrapper`,l]),m=(0,y.useRef)(null);return(0,y.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,X.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,X.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,X.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}KW.displayName=`EdgeText`;var qW=(0,y.memo)(KW);function JW({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{...u,d:e,fill:`none`,className:rP([`react-flow__edge-path`,u.className])}),l?(0,X.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&CB(t)&&CB(n)?(0,X.jsx)(qW,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function YW({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function XW({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=YW({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=YW({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=YB({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function ZW(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=XW({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,X.jsx)(JW,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var QW=ZW({isInternal:!1}),$W=ZW({isInternal:!0});QW.displayName=`SimpleBezierEdge`,$W.displayName=`SimpleBezierEdgeInternal`;function eG(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=dV({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,X.jsx)(JW,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var tG=eG({isInternal:!1}),nG=eG({isInternal:!0});tG.displayName=`SmoothStepEdge`,nG.displayName=`SmoothStepEdgeInternal`;function rG(e){return(0,y.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,X.jsx)(tG,{...n,id:r,pathOptions:(0,y.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var iG=rG({isInternal:!1}),aG=rG({isInternal:!0});iG.displayName=`StepEdge`,aG.displayName=`StepEdgeInternal`;function oG(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=aV({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,X.jsx)(JW,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var sG=oG({isInternal:!1}),cG=oG({isInternal:!0});sG.displayName=`StraightEdge`,cG.displayName=`StraightEdgeInternal`;function lG(e){return(0,y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=QB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,X.jsx)(JW,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var uG=lG({isInternal:!1}),dG=lG({isInternal:!0});uG.displayName=`BezierEdge`,dG.displayName=`BezierEdgeInternal`;var fG={default:dG,straight:cG,step:aG,smoothstep:nG,simplebezier:$W},pG={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},mG=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,hG=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,gG=`react-flow__edgeupdater`;function _G({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,X.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:rP([gG,`${gG}-${s}`]),cx:mG(t,r,e),cy:hG(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function vG({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=UH(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;QV.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,X.jsxs)(X.Fragment,{children:[(e===!0||e===`source`)&&(0,X.jsx)(_G,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,X.jsx)(_G,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function yG({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let b=HH(t=>t.edgeLookup.get(e)),x=HH(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||fG[S];C===void 0&&(_?.(`011`,Bz.error011(S)),S=`default`,C=h?.default||fG.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,y.useRef)(null),[ee,O]=(0,y.useState)(!1),[k,A]=(0,y.useState)(!1),te=UH(),{zIndex:ne=b.zIndex,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce}=HH((0,y.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return pG;let i=pV({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=eV({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||pG,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,_]),RH),j=(0,y.useMemo)(()=>b.markerStart?`url('#${_V(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,y.useMemo)(()=>b.markerEnd?`url('#${_V(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||re===null||ie===null||ae===null||oe===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=te.getState();E&&(te.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,fe=o?e=>{o(e,{...b})}:void 0,pe=s?e=>{s(e,{...b})}:void 0,me=c?e=>{c(e,{...b})}:void 0,he=l?e=>{l(e,{...b})}:void 0;return(0,X.jsx)(`svg`,{style:{zIndex:ne},children:(0,X.jsxs)(`g`,{className:rP([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:fe,onMouseEnter:pe,onMouseMove:me,onMouseLeave:he,onKeyDown:w?t=>{if(!v&&Hz.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=te.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${qH}-${m}`:void 0,ref:D,...b.domAttributes,children:[!k&&(0,X.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:j,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,X.jsx)(vG,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:re,sourceY:ie,targetX:ae,targetY:oe,sourcePosition:se,targetPosition:ce,setUpdateHover:O,setReconnecting:A})]})})}var bG=(0,y.memo)(yG),xG=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function SG({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=HH(xG,RH),b=RW(t);return(0,X.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,X.jsx)(GW,{defaultColor:e,rfId:n}),b.map(e=>(0,X.jsx)(bG,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}SG.displayName=`EdgeRenderer`;var CG=(0,y.memo)(SG),wG=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function TG({children:e}){let t=UH(),n=(0,y.useRef)(null),[r]=(0,y.useState)(()=>t.getState().transform);return PU(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=wG(r)))};return r(),t.subscribe(r)},[t]),(0,X.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:wG(r)},children:e})}function EG(e){let t=VU(),n=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var DG=e=>e.panZoom?.syncViewport;function OG(e){let t=HH(DG),n=UH();return(0,y.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function kG(e){return e.connection.inProgress?{...e.connection,to:EB(e.connection.to,e.transform)}:{...e.connection}}function AG(e){return e?t=>e(kG(t)):kG}function jG(e){return HH(AG(e),RH)}var MG=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function NG({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=HH(MG,RH);return a&&i&&c?(0,X.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,X.jsx)(`g`,{className:rP([`react-flow__connection`,BB(s)]),children:(0,X.jsx)(PG,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var PG=({style:e,type:t=Jz.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=jG();if(!i)return;if(n)return(0,X.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:BB(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Jz.Bezier:[m]=QB(h);break;case Jz.SimpleBezier:[m]=XW(h);break;case Jz.Step:[m]=dV({...h,borderRadius:0});break;case Jz.SmoothStep:[m]=dV(h);break;default:[m]=aV(h)}return(0,X.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};PG.displayName=`ConnectionLine`;var FG={};function IG(e=FG){(0,y.useRef)(e),UH(),(0,y.useEffect)(()=>{},[e])}function LG(){UH(),(0,y.useRef)(!1),(0,y.useEffect)(()=>{},[])}function RG({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,preventScrolling:A,defaultMarkerColor:te,zoomOnScroll:ne,zoomOnPinch:re,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,zoomOnDoubleClick:se,panOnDrag:ce,autoPanOnSelection:j,onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneScroll:pe,onPaneContextMenu:me,paneClickDistance:he,nodeClickDistance:ge,onEdgeContextMenu:_e,onEdgeMouseEnter:M,onEdgeMouseMove:N,onEdgeMouseLeave:P,reconnectRadius:ve,onReconnect:ye,onReconnectStart:be,onReconnectEnd:xe,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,viewport:Oe,onViewportChange:ke,nodesDraggable:Ae}){return IG(e),IG(t),LG(),EG(n),OG(Oe),(0,X.jsx)(DW,{onPaneClick:le,onPaneMouseEnter:ue,onPaneMouseMove:de,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:pe,paneClickDistance:he,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ne,zoomOnPinch:re,zoomOnDoubleClick:se,panOnScroll:ie,panOnScrollSpeed:ae,panOnScrollMode:oe,panOnDrag:ce,autoPanOnSelection:j,defaultViewport:D,translateExtent:ee,minZoom:O,maxZoom:k,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:Se,noWheelClassName:Ce,noPanClassName:we,disableKeyboardA11y:Te,onViewportChange:ke,isControlledViewport:!!Oe,children:(0,X.jsxs)(TG,{children:[(0,X.jsx)(CG,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ye,onReconnectStart:be,onReconnectEnd:xe,onlyRenderVisibleElements:T,onEdgeContextMenu:_e,onEdgeMouseEnter:M,onEdgeMouseMove:N,onEdgeMouseLeave:P,reconnectRadius:ve,defaultMarkerColor:te,noPanClassName:we,disableKeyboardA11y:Te,rfId:De}),(0,X.jsx)(NG,{style:h,type:m,component:g,containerStyle:_}),(0,X.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,X.jsx)(LW,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ge,onlyRenderVisibleElements:T,noPanClassName:we,noDragClassName:Se,disableKeyboardA11y:Te,nodeExtent:Ee,rfId:De,nodesDraggable:Ae}),(0,X.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}RG.displayName=`GraphView`;var zG=(0,y.memo)(RG),BG=wB(`React Flow`,`https://reactflow.dev/`),VG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Vz;IV(h,g,_);let{nodesInitialized:x}=DV(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=jB(nB(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Vz,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Wz.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...qz},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:BG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Uz,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},HG=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>LH((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await oB({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...VG({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=DV(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();IV(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=NV(e,n,r,i,a,o,l);d&&(wV(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=hV(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=MV(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(CU(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(wU(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>TU(e,!0)));return}i(EU(r,new Set([...e]),!0)),a(EU(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>TU(e,!0)));return}a(EU(n,new Set([...e]))),i(EU(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(TU(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(TU(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,TU(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,TU(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(DV(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return PV({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...qz}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...VG()})}},Object.is);function UG({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,y.useState)(()=>HG({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,X.jsx)(BH,{value:m,children:(0,X.jsx)(RU,{children:(0,X.jsx)(lW,{children:p})})})}function WG({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,y.useContext)(zH)?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(UG,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var GG={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function KG({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:te,onSelectionDragStop:ne,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onBeforeDelete:oe,connectionMode:se,connectionLineType:ce=Jz.Bezier,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,deleteKeyCode:de=`Backspace`,selectionKeyCode:fe=`Shift`,selectionOnDrag:pe=!1,selectionMode:me=Kz.Full,panActivationKeyCode:he=`Space`,multiSelectionKeyCode:ge=MB()?`Meta`:`Control`,zoomActivationKeyCode:_e=MB()?`Meta`:`Control`,snapToGrid:M,snapGrid:N,onlyRenderVisibleElements:P=!1,selectNodesOnDrag:ve,nodesDraggable:ye,autoPanOnNodeFocus:be,nodesConnectable:xe,nodesFocusable:Se,nodeOrigin:Ce=cU,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee=!0,defaultViewport:De=lU,minZoom:Oe=.5,maxZoom:ke=2,translateExtent:Ae=Vz,preventScrolling:je=!0,nodeExtent:Me,defaultMarkerColor:Ne=`#b1b1b7`,zoomOnScroll:Pe=!0,zoomOnPinch:Fe=!0,panOnScroll:Ie=!1,panOnScrollSpeed:Le=.5,panOnScrollMode:Re=Gz.Free,zoomOnDoubleClick:ze=!0,panOnDrag:Be=!0,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe=1,nodeClickDistance:Je=0,children:Ye,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:F=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:ct=`nopan`,fitView:lt,fitViewOptions:ut,connectOnClick:dt,attributionPosition:ft,proOptions:pt,defaultEdgeOptions:mt,elevateNodesOnSelect:ht=!0,elevateEdgesOnSelect:gt=!1,disableKeyboardA11y:_t=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanOnSelection:bt=!0,autoPanSpeed:xt,connectionRadius:St,isValidConnection:Ct,onError:wt,style:Tt,id:Et,nodeDragThreshold:Dt,connectionDragThreshold:Ot,viewport:kt,onViewportChange:At,width:jt,height:Mt,colorMode:Nt=`light`,debug:Pt,onScroll:Ft,ariaLabelConfig:It,zIndexMode:Lt=`basic`,...Rt},zt){let Bt=Et||`1`,Vt=hU(Nt),Ht=(0,y.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Ft?.(e)},[Ft]);return(0,X.jsx)(`div`,{"data-testid":`rf__wrapper`,...Rt,onScroll:Ht,style:{...Tt,...GG},ref:zt,className:rP([`react-flow`,i,Vt]),id:Et,role:`application`,children:(0,X.jsxs)(WG,{nodes:e,edges:t,width:jt,height:Mt,fitView:lt,fitViewOptions:ut,minZoom:Oe,maxZoom:ke,nodeOrigin:Ce,nodeExtent:Me,zIndexMode:Lt,children:[(0,X.jsx)(pU,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ye,autoPanOnNodeFocus:be,nodesConnectable:xe,nodesFocusable:Se,edgesFocusable:we,edgesReconnectable:Te,elementsSelectable:Ee,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,minZoom:Oe,maxZoom:ke,nodeExtent:Me,onNodesChange:it,onEdgesChange:at,snapToGrid:M,snapGrid:N,connectionMode:se,translateExtent:Ae,connectOnClick:dt,defaultEdgeOptions:mt,fitView:lt,fitViewOptions:ut,onNodesDelete:D,onEdgesDelete:ee,onDelete:O,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:te,onSelectionDragStart:A,onSelectionDragStop:ne,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ct,nodeOrigin:Ce,rfId:Bt,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:xt,onError:wt,connectionRadius:St,isValidConnection:Ct,selectNodesOnDrag:ve,nodeDragThreshold:Dt,connectionDragThreshold:Ot,onBeforeDelete:oe,debug:Pt,ariaLabelConfig:It,zIndexMode:Lt}),(0,X.jsx)(zG,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ce,connectionLineStyle:j,connectionLineComponent:le,connectionLineContainerStyle:ue,selectionKeyCode:fe,selectionOnDrag:pe,selectionMode:me,deleteKeyCode:de,multiSelectionKeyCode:ge,panActivationKeyCode:he,zoomActivationKeyCode:_e,onlyRenderVisibleElements:P,defaultViewport:De,translateExtent:Ae,minZoom:Oe,maxZoom:ke,preventScrolling:je,zoomOnScroll:Pe,zoomOnPinch:Fe,zoomOnDoubleClick:ze,panOnScroll:Ie,panOnScrollSpeed:Le,panOnScrollMode:Re,panOnDrag:Be,autoPanOnSelection:bt,onPaneClick:Ve,onPaneMouseEnter:He,onPaneMouseMove:Ue,onPaneMouseLeave:We,onPaneScroll:Ge,onPaneContextMenu:Ke,paneClickDistance:qe,nodeClickDistance:Je,onSelectionContextMenu:re,onSelectionStart:ie,onSelectionEnd:ae,onReconnect:Xe,onReconnectStart:Ze,onReconnectEnd:Qe,onEdgeContextMenu:$e,onEdgeDoubleClick:et,onEdgeMouseEnter:tt,onEdgeMouseMove:nt,onEdgeMouseLeave:rt,reconnectRadius:F,defaultMarkerColor:Ne,noDragClassName:ot,noWheelClassName:st,noPanClassName:ct,rfId:Bt,disableKeyboardA11y:_t,nodeExtent:Me,viewport:kt,onViewportChange:At,nodesDraggable:ye}),(0,X.jsx)(sU,{onSelectionChange:k}),Ye,(0,X.jsx)(tU,{proOptions:pt,position:ft}),(0,X.jsx)(QH,{rfId:Bt,disableKeyboardA11y:_t})]})})}var qG=NU(KG);Bz.error014();function JG({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,X.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rP([`react-flow__background-pattern`,n,r])})}function YG({radius:e,className:t}){return(0,X.jsx)(`circle`,{cx:e,cy:e,r:e,className:rP([`react-flow__background-pattern`,`dots`,t])})}var XG;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(XG||={});var ZG={[XG.Dots]:1,[XG.Lines]:1,[XG.Cross]:6},QG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $G({id:e,variant:t=XG.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,y.useRef)(null),{transform:f,patternId:p}=HH(QG,RH),m=r||ZG[t],h=t===XG.Dots,g=t===XG.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:v,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return(0,X.jsxs)(`svg`,{className:rP([`react-flow__background`,l]),style:{...c,...KU,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,X.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,X.jsx)(YG,{radius:b/2,className:u}):(0,X.jsx)(JG,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,X.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}$G.displayName=`Background`,(0,y.memo)($G);function eK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,X.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function tK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,X.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function nK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,X.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function rK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function iK(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function aK({children:e,className:t,...n}){return(0,X.jsx)(`button`,{type:`button`,className:rP([`react-flow__controls-button`,t]),...n,children:e})}var oK=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function sK({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=UH(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=HH(oK,RH),{zoomIn:y,zoomOut:b,fitView:x}=VU();return(0,X.jsxs)($H,{className:rP([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(aK,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,X.jsx)(eK,{})}),(0,X.jsx)(aK,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,X.jsx)(tK,{})})]}),n&&(0,X.jsx)(aK,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,X.jsx)(nK,{})}),r&&(0,X.jsx)(aK,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,X.jsx)(iK,{}):(0,X.jsx)(rK,{})}),u]})}sK.displayName=`Controls`,(0,y.memo)(sK);function cK({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,X.jsx)(`rect`,{className:rP([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var lK=(0,y.memo)(cK),uK=e=>e.nodes.map(e=>e.id),dK=e=>e instanceof Function?e:()=>e;function fK({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=lK,onClick:o}){let s=HH(uK,RH),c=dK(t),l=dK(e),u=dK(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,X.jsx)(X.Fragment,{children:s.map(e=>(0,X.jsx)(mK,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function pK({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=HH(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=PB(r);return{node:r,x:i,y:a,width:o,height:s}},RH);return!l||l.hidden||!FB(l)?null:(0,X.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var mK=(0,y.memo)(pK),hK=(0,y.memo)(fK),gK=200,_K=150,vK=e=>!e.hidden,yK=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?yB(nB(e.nodeLookup,{filter:vK}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},bK=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,xK=(e,t)=>bK(e.viewBB,t.viewBB)&&bK(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,SK=`react-flow__minimap-desc`;function CK({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:b=1,offsetScale:x=5}){let S=UH(),C=(0,y.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:ee,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=HH(yK,xK),te=e?.width??gK,ne=e?.height??_K,re=w.width/te,ie=w.height/ne,ae=Math.max(re,ie),oe=ae*te,se=ae*ne,ce=x*ae,j=w.x-(oe-w.width)/2-ce,le=w.y-(se-w.height)/2-ce,ue=oe+ce*2,de=se+ce*2,fe=`${SK}-${D}`,pe=(0,y.useRef)(0),me=(0,y.useRef)();pe.current=ae,(0,y.useEffect)(()=>{let e=S.getState().panZoom;if(C.current&&e)return me.current=$V({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>pe.current}),()=>{me.current?.destroy()}},[T]),(0,y.useEffect)(()=>{me.current?.update({translateExtent:ee,width:O,height:k,inversePan:v,pannable:h,zoomStep:b,zoomable:g})},[h,g,v,b,ee,O,k]);let he=p?e=>{let[t,n]=me.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ge=(0,y.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),_e=m?ge:void 0,M=_??A[`minimap.ariaLabel`];return(0,X.jsx)($H,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ae:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:rP([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,X.jsxs)(`svg`,{width:te,height:ne,viewBox:`${j} ${le} ${ue} ${de}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":fe,ref:C,onClick:he,children:[M&&(0,X.jsx)(`title`,{id:fe,children:M}),(0,X.jsx)(hK,{onClick:_e,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,X.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${j-ce},${le-ce}h${ue+ce*2}v${de+ce*2}h${-ue-ce*2}z
741
+ M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}CK.displayName=`MiniMap`,(0,y.memo)(CK);var wK=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,TK={[mH.Line]:`right`,[mH.Handle]:`bottom-right`};function EK({nodeId:e,position:t,variant:n=mH.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=oW(),b=typeof e==`string`?e:v,x=UH(),S=(0,y.useRef)(null),C=n===mH.Handle,w=HH((0,y.useCallback)(wK(C&&p),[C,p]),RH),T=(0,y.useRef)(null),E=t??TK[n];(0,y.useEffect)(()=>{if(S.current&&b)return T.current||=TH({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=MV([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...IB({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]);let D=E.split(`-`);return(0,X.jsx)(`div`,{className:rP([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,y.memo)(EK);function DK(e){switch(e.type){case`page`:return ky;case`agent`:return Nv;case`generate`:return e.asset===`image`?xy:e.asset===`video`?jb:e.asset===`dashboard`?Cy:ay;case`widget`:return yv;case`surface`:return Ty;case`film`:return Vv;case`review`:return ty;case`result`:return ly}return Nb}var OK={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,film:`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function kK(e){return Z(`type.${e.type}`)}var AK=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function jK(e){return AK.includes(e)?Z(`tool.${e}`):e}function MK(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(jK),n=e.mcp?.length?[`MCP: ${e.mcp.join(`, `)}`]:[];return[...t,...n].join(` · `)||e.instructions.slice(0,90)}case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`film`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?Z(`editor.reviewEditable`):null,e.regenerate?Z(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var NK=280,PK=92;function FK({data:e}){let{step:t,selected:n,issue:r,active:i,pulse:a,cost:o,passed:s,onAddAfter:c}=e,l=DK(t);return(0,X.jsxs)(`div`,{className:Q(`group relative w-[280px] cursor-pointer rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 transition`,n?`shadow-elevated ring-2 ring-ember`:i?`ring-2 ring-moss`:a?`ring-2 ring-ember/60`:`ring-border-soft hover:shadow-elevated`),children:[i?(0,X.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-moss`}):a?(0,X.jsx)(`span`,{className:`-top-1 -right-1 absolute size-3 animate-breathe rounded-full bg-ember`}):null,(0,X.jsx)(mW,{type:`target`,position:$.Top}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:Q(`inline-flex size-6 items-center justify-center rounded-md`,OK[t.type]),children:(0,X.jsx)(l,{className:`size-3.5`})}),(0,X.jsx)(`span`,{className:`font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.07em]`,children:kK(t)}),r?(0,X.jsx)(zv,{className:`ml-auto size-4 text-rose`}):s&&!i?(0,X.jsx)(Lv,{className:`ml-auto size-4 text-moss`}):o===null?null:(0,X.jsxs)(`span`,{className:`ml-auto text-[0.6875rem] text-ink-3 tabular-nums`,children:[`≈`,` `,Z(`nav.credits`,{n:o<10?o.toLocaleString(void 0,{maximumFractionDigits:1}):Math.round(o)})]})]}),(0,X.jsx)(`div`,{className:`mt-1.5 truncate font-display font-semibold text-[0.9375rem] text-ink`,children:t.title}),(0,X.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:MK(t)||`\xA0`}),(0,X.jsx)(mW,{type:`source`,position:$.Bottom}),c?(0,X.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},className:Q(`nodrag nopan -translate-x-1/2 -translate-y-1/2 absolute top-full left-1/2 z-10 inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-full bg-card px-3 text-[0.75rem] text-ember-strong shadow-soft ring-1 ring-ember/40 transition hover:bg-ember-tint focus-visible:opacity-100`,n?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`),children:[(0,X.jsx)(_b,{className:`size-3.5`}),` `,Z(`addStep.add`)]}):null]})}function IK({data:e}){return(0,X.jsxs)(`div`,{className:Q(`flex w-[280px] cursor-pointer items-center gap-3 rounded-full bg-paper-2 py-1.5 pr-5 pl-2 transition`,e.selected?`ring-2 ring-ember`:`hover:bg-paper-3`),children:[(0,X.jsx)(yw,{kind:e.avatar,size:40,interactive:!1}),(0,X.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:e.title}),(0,X.jsx)(mW,{type:`source`,position:$.Bottom})]})}function LK({data:e}){return(0,X.jsxs)(`div`,{className:`w-[280px] rounded-xl border border-ember/50 border-dashed bg-card/70 px-4 py-3 text-left`,children:[(0,X.jsx)(mW,{type:`target`,position:$.Top}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ember-strong`,children:[(0,X.jsx)(kS,{className:`size-3.5`}),` `,Z(`addStep.building`)]}),(0,X.jsx)(`div`,{className:`mt-1.5 line-clamp-2 text-[0.8125rem] text-ink-2`,children:e.prompt}),(0,X.jsx)(mW,{type:`source`,position:$.Bottom})]})}function RK(e){let{data:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s}=e,c={label:e.label,labelStyle:e.labelStyle,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,markerEnd:e.markerEnd};if(!t?.points.length){let[e,t,l]=QB({sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s});return(0,X.jsx)(JW,{path:e,labelX:t,labelY:l,...c})}let l=[{x:n,y:r},...t.points,{x:i,y:a}],u=l.map((e,t)=>{let n=l[t-1];if(!n)return`M ${e.x} ${e.y}`;let r=(n.y+e.y)/2;return`C ${n.x} ${r} ${e.x} ${r} ${e.x} ${e.y}`}).join(` `);return(0,X.jsx)(JW,{path:u,labelX:t.labelX,labelY:t.labelY,...c})}var zK={step:FK,start:IK,adding:LK},BK={branch:RK},VK=`__adding`,HK=34,UK={},WK={};function GK(e){return`${Math.round(e*100)} %`}function KK(e){let t=e.ask?Z(`editor.whenAsk`,{text:e.ask}):Mu(e)?Z(`editor.otherwise`):Pu(e.when).map(qK).join(` · `);return e.max?`${t} (${Z(`editor.atMost`,{count:e.max})})`:t}function qK(e){let t=Array.isArray(e.value)?e.value.join(` / `):String(e.value??``);switch(e.op){case`equals`:return`${e.field} = ${t}`;case`notEquals`:return`${e.field} ≠ ${t}`;case`in`:return`${e.field} ∈ ${t}`;case`notEmpty`:return Z(`editor.whenFilled`,{field:e.field});case`empty`:return Z(`editor.whenEmpty`,{field:e.field});case`gt`:return`${e.field} > ${t}`;case`lt`:return`${e.field} < ${t}`;case`contains`:return Z(`editor.whenContains`,{field:e.field,value:t})}}function JK(e,t,n,r,i,a,o,s,c,l){let u=new nP.graphlib.Graph;u.setGraph({rankdir:`TB`,nodesep:48,ranksep:46,marginx:20,marginy:20}),u.setDefaultEdgeLabel(()=>({})),u.setNode(`__start`,{width:NK,height:52});for(let t of e.steps)u.setNode(t.id,{width:NK,height:PK});let d=[],f={markerEnd:{type:Yz.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}};c&&u.setNode(VK,{width:NK,height:PK});let p=(t,n,r,i={})=>{let a=e.steps[r]?.id;if(c?.at===r){u.setEdge(n,VK),d.push({id:t,source:n,target:VK,...i,...f}),a&&(u.setEdge(VK,a),d.push({id:`${t}-adding`,source:VK,target:a,...f}));return}a&&(u.hasEdge(n,a)||u.setEdge(n,a),d.push({id:t,source:n,target:a,...i,...f}))};(e.steps[0]||c)&&p(`e-start`,`__start`,0),e.steps.forEach((t,n)=>{let r=e.steps[n+1],i=s[t.id],a=i&&i.rule!==null?t.next?.[i.rule]?.goto:void 0,o=new Map;for(let n of t.next??[])n.goto!==`end`&&e.steps.some(e=>e.id===n.goto)&&o.set(n.goto,[...o.get(n.goto)??[],KK(n)]);for(let[e,n]of o){let r=n.join(` · `),o=r.length>HK?`${r.slice(0,33)}…`:r,s=a===e?i?.probabilities?.[`r${i.rule}`]:void 0,c=a===e,l=c?`✓ ${o}${s===void 0?``:` · ${GK(s)}`}`:o;u.setEdge(t.id,e,{width:l.length*6.2+16,height:22,labelpos:`c`}),d.push({id:`b-${t.id}-${e}`,type:`branch`,source:t.id,target:e,label:l,className:`cursor-pointer`,labelStyle:{fontSize:11,fill:c?`var(--moss)`:`var(--ink-2)`},labelBgStyle:{fill:`var(--paper-2)`},labelBgPadding:[6,3],labelBgBorderRadius:8,style:c?{strokeDasharray:`5 4`,stroke:`var(--moss)`,strokeWidth:2}:{strokeDasharray:`5 4`},...f})}if((r||c?.at===n+1)&&t.type!==`result`&&!t.next?.some(Mu)){let e=i?.rule===null,r=e?i?.probabilities?.none:void 0;p(`n-${t.id}`,t.id,n+1,{...t.next?.length?{label:e?`✓ ${Z(`editor.otherwise`)}${r===void 0?``:` · ${GK(r)}`}`:Z(`editor.otherwise`),className:`cursor-pointer`,labelStyle:{fontSize:11,fill:e?`var(--moss)`:`var(--ink-3)`},labelBgStyle:{fill:`var(--background)`},...e?{style:{stroke:`var(--moss)`,strokeWidth:2}}:{}}:{}})}}),nP.layout(u);for(let e of d){if(e.type!==`branch`)continue;let t=u.edge(e.source,e.target),n=(t.points??[]).slice(1,-1);n.length&&t.x!==void 0&&t.y!==void 0&&(e.data={points:n,labelX:t.x,labelY:t.y})}return{nodes:[{id:`__start`,type:`start`,position:{x:u.node(`__start`).x-NK/2,y:u.node(`__start`).y-26},data:{title:e.title,avatar:e.avatar,selected:t===`__wizard`},draggable:!1},...e.steps.map((e,s)=>{let c=u.node(e.id);return{id:e.id,type:`step`,position:{x:c.x-NK/2,y:c.y-PK/2},data:{step:e,selected:t===e.id,issue:n.has(e.id),index:s,active:r===e.id,pulse:i.includes(e.id),cost:a[e.id]?.credits??null,passed:o.has(e.id),onAddAfter:l&&e.type!==`result`?()=>l(s+1):void 0},draggable:!1}}),...c?[{id:VK,type:`adding`,position:{x:u.node(VK).x-NK/2,y:u.node(VK).y-PK/2},data:{prompt:c.prompt},draggable:!1,selectable:!1}]:[]],edges:d}}function YK(){let e=VU(),t=`inline-flex size-8 items-center justify-center rounded-full text-ink-3 hover:bg-accent hover:text-ink`;return(0,X.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 flex items-center gap-0.5 rounded-full bg-card p-1 shadow-soft ring-1 ring-border-soft`,children:[(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomOut(),"aria-label":`Zoom out`,children:(0,X.jsx)(Gy,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.fitView({padding:.2,duration:300}),"aria-label":`Fit`,children:(0,X.jsx)(lb,{className:`size-4`})}),(0,X.jsx)(`button`,{type:`button`,className:t,onClick:()=>e.zoomIn(),"aria-label":`Zoom in`,children:(0,X.jsx)(tb,{className:`size-4`})})]})}var XK=.8,ZK=new Set;function QK({def:e,selected:t,onSelect:n,issueSteps:r,activeStep:i,pulse:a,costs:o=UK,passed:s=ZK,minFitZoom:c=XK,fitKey:l,decisions:u=WK,onBranch:d,adding:f=null,onInsert:p}){let{nodes:m,edges:h}=(0,y.useMemo)(()=>JK(e,t,r,i,a??[],o,s,u,f,p),[e,t,r,i,a,o,s,u,f,p]),g=VU(),_=(0,y.useRef)(null),v=e.steps.map(e=>e.id).join(`|`)+(f?`+${f.at}`:``);return(0,y.useEffect)(()=>{let e=requestAnimationFrame(()=>{let e=_.current;if(!e||!m.length)return;let t=m.map(e=>e.position.x),n=m.map(e=>e.position.y),r={x:Math.min(...t),y:Math.min(...n),width:Math.max(...t)+NK-Math.min(...t),height:Math.max(...n)+PK-Math.min(...n)},i=Math.min(e.clientWidth/(r.width*1.2),e.clientHeight/(r.height*1.15),1),a=Math.max(i,c),o=(e.clientWidth-r.width*a)/2-r.x*a,s=i>=c?(e.clientHeight-r.height*a)/2-r.y*a:24-r.y*a;g.setViewport({x:o,y:s,zoom:a},{duration:400})});return()=>cancelAnimationFrame(e)},[v,l,g]),(0,X.jsx)(`div`,{ref:_,className:`h-full w-full`,children:(0,X.jsx)(qG,{nodes:m,edges:h,nodeTypes:zK,edgeTypes:BK,onNodeClick:(e,t)=>{t.id!==VK&&n(t.id===`__start`?`__wizard`:t.id)},onEdgeClick:(t,r)=>{let i=e.steps.find(e=>e.id===(r.source===VK?``:r.source));i?.next?.length&&d?d(i.id):i&&n(i.id)},onPaneClick:()=>n(null),nodesConnectable:!1,nodesDraggable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnScroll:!1,zoomOnPinch:!0,minZoom:.3,maxZoom:1.4,proOptions:{hideAttribution:!0},children:(0,X.jsx)(YK,{})})})}function $K(e){return(0,X.jsx)(UG,{children:(0,X.jsx)(QK,{...e})})}var eq=`engenty/flow`,tq=new Set([`text`,`textarea`,`number`,`select`,`multiselect`,`date`,`email`,`url`,`toggle`,`color`,`location`,`slot`]),nq=420,rq=600,iq=320,aq=new Set;function oq(e){if(e.structuredContent)return e.structuredContent;let t=e.content?.find(e=>e.type===`text`);try{return t&&`text`in t?JSON.parse(t.text):null}catch{return t&&`text`in t?t.text:null}}function sq(e){let t=oq(e);if(e.isError){let e=t&&typeof t==`object`&&`error`in t?String(t.error):String(t);throw Object.assign(Error(e),{body:t})}return t}function cq(e){e&&(e.theme&&document.documentElement.classList.toggle(`dark`,e.theme===`dark`),e.locale&&Yx(e.locale.toLowerCase().startsWith(`de`)?`de`:`en`))}function lq(){let e=(0,y.useMemo)(()=>new iv({name:`engenty-wizards-flow`,version:`1.0.0`},{},{autoResize:!0}),[]),[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(`asking`);(0,y.useEffect)(()=>{e.ontoolresult=e=>{let t=e._meta?.[eq];t&&(n(t),i(t.run??null))},e.onhostcontextchanged=e=>{o(t=>({...t,...e})),cq(e)},e.connect().then(()=>{let t=e.getHostContext();o(t),cq(t)}).catch(e=>console.error(`[flow widget]`,e))},[e]);let d=(0,y.useCallback)(async(t,n)=>sq(await e.callServerTool({name:t,arguments:n})),[e]),f=(0,y.useCallback)(t=>{let n=t.outputs.map(e=>e.title).join(`, `),r=[`engenty wizards run ${t.runId}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,n?`Made so far: ${n}.`:``,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].filter(Boolean).join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),p=(0,y.useRef)(``),m=(0,y.useCallback)(t=>{let n=t?`${t.status}:${t.step?.id??``}`:``;if(!t||n===p.current)return;p.current=n;let r=[`engenty wizards run ${t.id}: ${t.status}${t.step?` at "${t.step.title}"`:``}.`,t.status===`done`?`The person finished it in the widget; get_run has the outputs and download links.`:`The person answers this run in the widget; get_run has the details.`].join(` `);e.updateModelContext({content:[{type:`text`,text:r}]}).catch(()=>void 0)},[e]),h=(0,y.useRef)(null),g=(0,y.useRef)(``),_=(0,y.useCallback)(e=>{m(e);let t=e?`${e.status}:${e.step?.id??``}`:``;t!==g.current&&(g.current=t,h.current?.scrollTo({top:0}))},[m]),v=r?.runId,b=t?.runtime;(0,y.useEffect)(()=>{if(!v||!b){u(`no`);return}lS(b),u(`asking`);let e=!0;return fetch(uS(`/api/runs/${v}`),{credentials:`include`}).then(t=>e&&u(t.ok?`yes`:`no`)).catch(()=>e&&u(`no`)),()=>{e=!1}},[v,b]);let x=(0,y.useCallback)(async t=>{let r=await e.callServerTool({name:`run_wizard`,arguments:{wizardId:t}});sq(r);let a=r._meta?.[eq];a&&(n(a),i(a.run??null))},[e]),S=r?.status===`running`;(0,y.useEffect)(()=>{if(!v||!S||l!==`no`)return;let e=!0;return(async()=>{for(;e;)try{let t=await d(`get_run`,{runId:v,waitSeconds:20});if(!e)return;if(i(t),t.status!==`running`){f(t);return}}catch{await new Promise(e=>setTimeout(e,3e3))}})(),()=>{e=!1}},[v,S,l,d,f]);let C=(0,y.useMemo)(()=>new Set(r?.passed??[]),[r]),w=a?.displayMode===`fullscreen`,T=a?.availableDisplayModes?.includes(`fullscreen`),E=t=>{e.openLink({url:t}).catch(()=>window.open(t,`_blank`,`noopener`))};if(!t||r&&l===`asking`)return(0,X.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-ink-3 text-sm`,style:{height:160},children:[(0,X.jsx)(kS,{className:`size-4`}),Z(`flowApp.loading`)]});if(r&&l===`yes`)return(0,X.jsx)(`div`,{ref:h,className:`overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:rq},children:(0,X.jsx)(_A,{runId:r.runId,compact:!0,stickyProgress:!0,onView:_})});if(!r)return(0,X.jsx)(uq,{view:t,onStart:()=>x(t.wizard.id)});let D=r&&r.status!==`done`?r.step?.id??null:null;return(0,X.jsxs)(`div`,{className:Q(`flex bg-background text-ink`,w?`h-screen flex-row`:`flex-col`),children:[(0,X.jsx)(`div`,{className:Q(`relative min-w-0`,w?`flex-1`:``),style:w?void 0:{height:iq},children:(0,X.jsx)($K,{def:t.definition,selected:s,onSelect:c,issueSteps:aq,activeStep:D,passed:C,minFitZoom:.45,fitKey:String(w)})}),(0,X.jsxs)(`aside`,{className:Q(`flex flex-col gap-3 border-border-soft bg-card p-4`,w?`w-[380px] overflow-y-auto border-l`:`border-t`),children:[(0,X.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate font-display font-semibold text-[0.9375rem]`,children:t.wizard.title}),(0,X.jsx)(jS,{children:t.wizard.shows===`published`?Z(`flowApp.published`):Z(`flowApp.draft`)}),t.wizard.issues?(0,X.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:Z(`flowApp.issues`,{n:t.wizard.issues})}):null,(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:T?(0,X.jsxs)(vS,{size:`sm`,variant:`ghost`,onClick:()=>e.requestDisplayMode({mode:w?`inline`:`fullscreen`}).then(({mode:e})=>o(t=>({...t,displayMode:e}))).catch(()=>void 0),children:[w?(0,X.jsx)(Uy,{className:`size-4`}):(0,X.jsx)(zy,{className:`size-4`}),Z(w?`flowApp.inline`:`flowApp.fullscreen`)]}):null})]}),(0,X.jsx)(dq,{report:r,selected:s,call:d,onReport:e=>{i(e),f(e)},open:E})]})]})}function uq({view:e,onStart:t}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=e.wizard.description??e.definition.description;return(0,X.jsxs)(`div`,{className:`flex flex-col overflow-y-auto overscroll-contain bg-background text-ink`,style:{maxHeight:rq},children:[(0,X.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center px-6 pt-6 pb-6 text-center`,children:[(0,X.jsx)(yw,{kind:e.wizard.avatar??e.definition.avatar,size:120,fluffy:!0}),(0,X.jsx)(`h1`,{className:`mt-2 text-balance font-display font-semibold text-[1.625rem] leading-[1.1] tracking-tight`,children:e.wizard.title}),c?(0,X.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c}):null,e.wizard.published?(0,X.jsxs)(vS,{size:`lg`,className:`mt-8 min-w-48`,busy:n,onClick:async()=>{r(!0),a(null);try{await t()}catch(e){a(e.message),r(!1)}},children:[Z(`run.start`),` `,(0,X.jsx)(Tv,{className:`size-4`})]}):(0,X.jsx)(`p`,{className:`mt-8 rounded-xl bg-paper-2 px-5 py-4 text-[0.875rem] text-ink-2`,children:Z(`flowApp.notPublished`)}),i?(0,X.jsx)(`p`,{className:`mt-4 text-[0.875rem] text-rose`,children:i}):null,(0,X.jsxs)(vS,{size:`sm`,variant:`ghost`,className:`mt-4`,onClick:()=>s(!o),children:[(0,X.jsx)(Fb,{className:`size-4`}),Z(`flowApp.flow`)]})]}),o?(0,X.jsx)(`div`,{className:`relative border-border-soft border-t`,style:{height:nq},children:(0,X.jsx)($K,{def:e.definition,selected:null,onSelect:()=>void 0,issueSteps:aq,activeStep:null,minFitZoom:.45})}):null]})}function dq({report:e,selected:t,call:n,onReport:r,open:i}){let[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),l=async(t,i)=>{o(!0),c(null);try{r(await n(t,{runId:e.runId,...i}))}catch(e){c(e.message)}finally{o(!1)}},u=e.waitingFor,d=t?e.outputs.filter(e=>e.stepId===t):[],f=e.events.at(-1),p=e.browserUrl,m=p?()=>i(p):void 0,h=null;return e.status===`running`&&!(u&&`ask`in u)?h=(0,X.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-2`,children:[(0,X.jsx)(kS,{className:`size-4`}),f&&Xx(f)||Z(`run.working`)]}):u&&`page`in u?h=(0,X.jsx)(pq,{fields:u.fields,busy:a,onSubmit:e=>l(`answer_page`,{stepId:u.page,values:e,waitSeconds:3}),onBrowser:m},`${e.runId}-${u.page}`):u&&`review`in u?h=(0,X.jsx)(hq,{outputs:e.outputs.filter(e=>u.show.includes(e.stepId)),targets:u.show,busy:a,onAccept:()=>l(`review_step`,{stepId:u.review,action:{type:`accept`}}),onRegenerate:(e,t)=>l(`review_step`,{stepId:u.review,action:{type:`regenerate`,target:e,note:t}}),open:i}):u&&`ask`in u?h=u.kind===`confirm`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`font-medium text-[0.8125rem]`,children:Z(`flowApp.ask`)}),(0,X.jsxs)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:[u.reason,` — `,u.service,`: `,u.action]}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(vS,{size:`sm`,busy:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`allow`}),children:Z(`flowApp.allow`)}),(0,X.jsx)(vS,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`answer_ask`,{askId:u.ask,answer:`skip`}),children:Z(`flowApp.skip`)})]})]}):(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Z(`flowApp.signIn`,{site:u.site})}),m?(0,X.jsxs)(vS,{size:`sm`,onClick:m,children:[(0,X.jsx)($v,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]}):e.status===`failed`?h=(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:e.error||Z(`run.failed`)}),(0,X.jsx)(vS,{size:`sm`,busy:a,onClick:()=>l(`control_run`,{action:`retry`}),children:Z(`run.retry`)})]}):e.status===`cancelled`?h=(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`run.cancelled`)}):e.status===`done`&&(h=(0,X.jsx)(gq,{outputs:e.outputs,open:i})),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,X.jsx)(`span`,{className:`font-medium text-ink-2`,children:e.status===`done`?Z(`flowApp.done`):e.step?.title}),(0,X.jsxs)(`span`,{children:[`· `,Z(`flowApp.credits`,{n:e.credits})]}),(0,X.jsxs)(`span`,{className:`ml-auto flex gap-1`,children:[e.status===`waiting_input`&&e.passed.length?(0,X.jsxs)(vS,{size:`sm`,variant:`ghost`,disabled:a,onClick:()=>l(`control_run`,{action:`back`}),children:[(0,X.jsx)(Db,{className:`size-4`}),Z(`run.back`)]}):null,m?(0,X.jsxs)(vS,{size:`sm`,variant:`ghost`,onClick:m,children:[(0,X.jsx)($v,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]})]}),h,s?(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:Z(`flowApp.failed`,{error:s})}):null,d.length&&e.status!==`done`?(0,X.jsx)(gq,{outputs:d,open:i}):null]})}function fq(e){return e.value??e.default??(e.kind===`multiselect`?[]:e.kind!==`toggle`&&``)}function pq({fields:e,busy:t,onSubmit:n,onBrowser:r}){let i=e.filter(e=>tq.has(e.kind)),a=e.filter(e=>!tq.has(e.kind)),[o,s]=(0,y.useState)(()=>Object.fromEntries(i.map(e=>[e.id,fq(e)]))),c=(e,t)=>s(n=>({...n,[e]:t})),l=i.some(e=>{let t=o[e.id];return e.required&&(t===``||t===void 0||Array.isArray(t)&&!t.length)});return a.some(e=>e.required)?(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:Z(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}),r?(0,X.jsxs)(vS,{size:`sm`,onClick:r,children:[(0,X.jsx)($v,{className:`size-4`}),Z(`flowApp.runPage`)]}):null]}):(0,X.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault();let t={};for(let e of i){let n=o[e.id];n!==``&&n!==void 0&&(t[e.id]=e.kind===`number`?Number(n):e.kind===`location`?{label:String(n)}:n)}n(t)},children:[i.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(OS,{required:e.required,hint:e.help,children:e.label}),(0,X.jsx)(`div`,{className:`mt-1.5`,children:(0,X.jsx)(mq,{field:e,value:o[e.id],onChange:t=>c(e.id,t)})})]},e.id)),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(vS,{type:`submit`,busy:t,disabled:l,children:Z(`run.next`)}),a.length?(0,X.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:Z(`flowApp.inBrowser`,{fields:a.map(e=>e.label).join(`, `)})}):null]})]})}function mq({field:e,value:t,onChange:n}){let r=typeof t==`string`||typeof t==`number`?String(t):``;switch(e.kind){case`textarea`:return(0,X.jsx)(wS,{value:r,rows:4,placeholder:e.placeholder,onChange:e=>n(e.target.value)});case`select`:return(0,X.jsx)(TS,{value:r,onChange:n,placeholder:``,options:(e.options??[]).map(e=>({value:e,label:e}))});case`multiselect`:return(0,X.jsx)(ES,{multi:!0,value:Array.isArray(t)?t:[],onChange:n,options:e.options??[]});case`slot`:return e.options?.length?(0,X.jsx)(TS,{value:r,onChange:n,placeholder:``,options:e.options.map(e=>({value:e,label:Uu(e,Kx)}))}):(0,X.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:Z(`slot.none`)});case`toggle`:return(0,X.jsx)(DS,{checked:t===!0,onChange:n});case`location`:return(0,X.jsx)(SS,{value:t&&typeof t==`object`&&`label`in t?String(t.label??``):r,placeholder:e.placeholder,onChange:e=>n(e.target.value)});default:return(0,X.jsx)(SS,{type:e.kind===`number`?`number`:e.kind===`date`?`date`:e.kind===`email`?`email`:e.kind===`url`?`url`:e.kind===`color`?`color`:`text`,value:r,placeholder:e.placeholder,onChange:e=>n(e.target.value)})}}function hq({outputs:e,targets:t,busy:n,onAccept:r,onRegenerate:i,open:a}){let[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(t[0]??``);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(gq,{outputs:e,open:a}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[t.length>1?(0,X.jsx)(TS,{value:c,onChange:l,options:e.map(e=>({value:e.stepId,label:e.title}))}):null,(0,X.jsx)(wS,{rows:2,value:o,placeholder:Z(`run.regenerateNote`),onChange:e=>s(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(vS,{busy:n,onClick:r,children:Z(`run.accept`)}),(0,X.jsx)(vS,{variant:`ghost`,disabled:n||!o.trim()||!c,onClick:()=>i(c,o.trim()),children:Z(`run.regenerateGo`)})]})]})]})}function gq({outputs:e,open:t}){return(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,X.jsxs)(`section`,{className:`rounded-xl bg-paper-2 p-3`,children:[(0,X.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.8125rem] text-ink-2`,children:e.title}),e.text?(0,X.jsx)(EO,{text:e.text,className:`text-[0.8125rem]`}):null,e.assets.filter(e=>e.mime.startsWith(`image/`)).map(e=>(0,X.jsx)(`img`,{src:e.url,alt:e.name,className:`mt-2 max-h-64 rounded-lg`},e.url)),Object.keys(e.downloads).length?(0,X.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:Object.entries(e.downloads).map(([e,n])=>(0,X.jsxs)(vS,{size:`sm`,variant:`secondary`,onClick:()=>t(n),children:[(0,X.jsx)(Yv,{className:`size-4`}),e.toUpperCase()]},e))}):null]},e.stepId))})}(0,b.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(y.StrictMode,{children:(0,X.jsx)(lq,{})}));</script>
742
742
  <style rel="stylesheet" crossorigin>@import "https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-border-default:1px solid #bbb;--xy-node-border-selected-default:1px solid #555;--xy-handle-background-color-default:#333;--xy-selection-background-color-default:#9696b41a;--xy-selection-border-default:1px dotted #9b9b9bcc;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#555;--xy-background-pattern-lines-color-default:#333;--xy-background-pattern-cross-color-default:#333;--xy-node-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));min-width:5px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{justify-content:center;align-items:center;width:26px;height:26px;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border:var(--xy-node-border,var(--xy-node-border-default));color:var(--xy-node-color,var(--xy-node-color-default))}.react-flow__node-input.selected,.react-flow__node-input:focus,.react-flow__node-input:focus-visible,.react-flow__node-default.selected,.react-flow__node-default:focus,.react-flow__node-default:focus-visible,.react-flow__node-output.selected,.react-flow__node-output:focus,.react-flow__node-output:focus-visible,.react-flow__node-group.selected,.react-flow__node-group:focus,.react-flow__node-group:focus-visible{border:var(--xy-node-border-selected,var(--xy-node-border-selected-default));outline:none}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}@layer theme{:root,:host{--color-amber-200:oklch(92.4% .12 95.746);--color-emerald-300:oklch(84.5% .143 164.978);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-violet-300:oklch(81.1% .111 293.571);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--f-ui);--default-mono-font-family:var(--f-mono);--color-card:var(--card);--color-ember:var(--ember-mark);--color-ink-3:var(--ink-3);--color-moss:var(--moss);--color-cobalt:var(--cobalt);--color-amber:var(--amber)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html:not([data-desktop]) :is(button,select,summary,[role=button],[role=switch],label:has(input[type=file]),input[type=color]):not(:disabled){cursor:pointer}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-3{inset:calc(var(--spacing) * 3)}.inset-x-0{inset-inline:0}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-y-0{inset-block:0}.-top-0\.5{top:calc(var(--spacing) * -.5)}.-top-1{top:calc(var(--spacing) * -1)}.-top-1\.5{top:calc(var(--spacing) * -1.5)}.-top-2\.5{top:calc(var(--spacing) * -2.5)}.-top-3{top:calc(var(--spacing) * -3)}.-top-4{top:calc(var(--spacing) * -4)}.-top-12{top:calc(var(--spacing) * -12)}.-top-14{top:calc(var(--spacing) * -14)}.-top-28{top:calc(var(--spacing) * -28)}.top-0{top:0}.top-0\.5{top:calc(var(--spacing) * .5)}.top-1{top:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-6{top:calc(var(--spacing) * 6)}.top-11{top:calc(var(--spacing) * 11)}.top-12{top:calc(var(--spacing) * 12)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.-right-1\.5{right:calc(var(--spacing) * -1.5)}.-right-10{right:calc(var(--spacing) * -10)}.right-0{right:0}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-9{right:calc(var(--spacing) * 9)}.right-10{right:calc(var(--spacing) * 10)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.-bottom-5{bottom:calc(var(--spacing) * -5)}.bottom-0{bottom:0}.bottom-0\.5{bottom:calc(var(--spacing) * .5)}.bottom-1{bottom:var(--spacing)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-10{bottom:calc(var(--spacing) * 10)}.bottom-12{bottom:calc(var(--spacing) * 12)}.bottom-\[22\%\]{bottom:22%}.bottom-full{bottom:100%}.-left-2\.5{left:calc(var(--spacing) * -2.5)}.-left-5{left:calc(var(--spacing) * -5)}.left-0{left:0}.left-0\.5{left:calc(var(--spacing) * .5)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\[7px\]{left:7px}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-first{order:-9999}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-5{grid-column:span 5/span 5}.col-span-full{grid-column:1/-1}.col-start-6{grid-column-start:6}.row-start-1{grid-row-start:1}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.m-3{margin:calc(var(--spacing) * 3)}.m-auto{margin:auto}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-5{margin-inline:calc(var(--spacing) * -5)}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-5{margin-inline:calc(var(--spacing) * 5)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.-mt-1\.5{margin-top:calc(var(--spacing) * -1.5)}.-mt-2{margin-top:calc(var(--spacing) * -2)}.-mt-3{margin-top:calc(var(--spacing) * -3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-9{margin-top:calc(var(--spacing) * 9)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mt-\[7px\]{margin-top:7px}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.-mr-1\.5{margin-right:calc(var(--spacing) * -1.5)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:var(--spacing)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-\[0\.09em\]{margin-right:.09em}.mr-auto{margin-right:auto}.-mb-1\.5{margin-bottom:calc(var(--spacing) * -1.5)}.-mb-9{margin-bottom:calc(var(--spacing) * -9)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-1\.5{margin-left:calc(var(--spacing) * -1.5)}.-ml-3{margin-left:calc(var(--spacing) * -3)}.ml-1{margin-left:var(--spacing)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-\[0\.06em\]{margin-left:.06em}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.aspect-\[5\/2\]{aspect-ratio:5/2}.aspect-square{aspect-ratio:1}.size-1{width:var(--spacing);height:var(--spacing)}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28)}.size-48{width:calc(var(--spacing) * 48);height:calc(var(--spacing) * 48)}.size-80{width:calc(var(--spacing) * 80);height:calc(var(--spacing) * 80)}.size-\[3px\]{width:3px;height:3px}.size-\[22px\]{width:22px;height:22px}.size-\[54px\]{width:54px;height:54px}.size-\[72px\]{width:72px;height:72px}.size-full{width:100%;height:100%}.h-\(--sheet\){height:var(--sheet)}.h-0{height:0}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-40{height:calc(var(--spacing) * 40)}.h-\[3px\]{height:3px}.h-\[28rem\]{height:28rem}.h-\[46vh\]{height:46vh}.h-\[70dvh\]{height:70dvh}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[38vh\]{max-height:38vh}.max-h-\[46vh\]{max-height:46vh}.max-h-\[60dvh\]{max-height:60dvh}.max-h-\[68dvh\]{max-height:68dvh}.max-h-\[70dvh\]{max-height:70dvh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[76vh\]{max-height:76vh}.max-h-\[200px\]{max-height:200px}.max-h-\[520px\]{max-height:520px}.max-h-\[calc\(100dvh-32px\)\]{max-height:calc(100dvh - 32px)}.max-h-\[calc\(100dvh-48px\)\]{max-height:calc(100dvh - 48px)}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-48{min-height:calc(var(--spacing) * 48)}.min-h-80{min-height:calc(var(--spacing) * 80)}.min-h-\[6\.5rem\]{min-height:6.5rem}.min-h-\[7rem\]{min-height:7rem}.min-h-\[50vh\]{min-height:50vh}.min-h-\[60dvh\]{min-height:60dvh}.min-h-\[124px\]{min-height:124px}.min-h-dvh{min-height:100dvh}.min-h-full{min-height:100%}.w-0{width:0}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-\[19rem\]{width:19rem}.w-\[280px\]{width:280px}.w-\[380px\]{width:380px}.w-\[calc\(100\%\+0\.5rem\)\]{width:calc(100% + .5rem)}.w-\[calc\(100\%-0\.75rem\)\]{width:calc(100% - .75rem)}.w-\[calc\(100\%-32px\)\]{width:calc(100% - 32px)}.w-\[calc\(100\%-48px\)\]{width:calc(100% - 48px)}.w-\[min\(68\%\,320px\)\]{width:min(68%,320px)}.w-\[var\(--ai-disc\)\]{width:var(--ai-disc)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[60\%\]{max-width:60%}.max-w-\[88rem\]{max-width:88rem}.max-w-\[160px\]{max-width:160px}.max-w-\[620px\]{max-width:620px}.max-w-\[640px\]{max-width:640px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-\[calc\(100vw-32px\)\]{max-width:calc(100vw - 32px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-60{min-width:calc(var(--spacing) * 60)}.min-w-\[7\.5rem\]{min-width:7.5rem}.min-w-\[9rem\]{min-width:9rem}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-56{flex-basis:calc(var(--spacing) * 56)}.basis-\[12rem\]{flex-basis:12rem}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.origin-top{transform-origin:top}.origin-top-left{transform-origin:0 0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[2px\]{--tw-translate-x:2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[22px\]{--tw-translate-x:22px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-scale-x-100{--tw-scale-x:calc(100% * -1);scale:var(--tw-scale-x) var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-zoom-in{cursor:zoom-in}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scroll-mt-14{scroll-margin-top:calc(var(--spacing) * 14)}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.\[scrollbar-width\:none\]{scrollbar-width:none}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[22px_minmax\(0\,1fr\)\]{grid-template-columns:22px minmax(0,1fr)}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.grid-cols-\[auto_minmax\(0\,1fr\)\]{grid-template-columns:auto minmax(0,1fr)}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.grid-cols-\[minmax\(0\,8rem\)_1fr_auto\]{grid-template-columns:minmax(0,8rem) 1fr auto}.grid-cols-\[repeat\(auto-fill\,minmax\(184px\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(184px,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-7{gap:calc(var(--spacing) * 7)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-9{gap:calc(var(--spacing) * 9)}.gap-10{gap:calc(var(--spacing) * 10)}.gap-x-1{column-gap:var(--spacing)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-2\.5{column-gap:calc(var(--spacing) * 2.5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-7{column-gap:calc(var(--spacing) * 7)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-5{row-gap:calc(var(--spacing) * 5)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border-soft>:not(:last-child)){border-color:var(--border-soft)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) * 2)}.rounded-3xl{border-radius:calc(var(--radius) * 3)}.rounded-\[1\.375rem\]{border-radius:1.375rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.rounded-t-3xl{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.rounded-b-xl{border-bottom-right-radius:calc(var(--radius) * 1.5);border-bottom-left-radius:calc(var(--radius) * 1.5)}.rounded-br-md{border-bottom-right-radius:calc(var(--radius) * .75)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[\#1d1a17\]\/25{border-color:oklab(22.0098% .00284923 .00685373/.25)}.border-border{border-color:var(--border)}.border-border-soft{border-color:var(--border-soft)}.border-ember,.border-ember\/50{border-color:var(--ember-mark)}@supports (color:color-mix(in lab, red, red)){.border-ember\/50{border-color:color-mix(in oklab, var(--ember-mark) 50%, transparent)}}.border-focus{border-color:var(--focus-line)}.border-ink-4{border-color:var(--ink-4)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-white\/40{border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40{border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.border-white\/90{border-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-\(--coin-bg\,var\(--color-card\)\){background-color:var(--coin-bg,var(--color-card))}.bg-\[\#0f1424\]{background-color:#0f1424}.bg-\[\#e5484d\]{background-color:#e5484d}.bg-\[oklch\(20\%_0\.01_60\/0\.22\)\]{background-color:oklch(20% .01 60/.22)}.bg-\[oklch\(20\%_0\.03_260\)\]{background-color:oklch(20% .03 260)}.bg-accent{background-color:var(--accent)}.bg-amber{background-color:var(--amber)}.bg-amber-tint{background-color:var(--amber-tint)}.bg-background,.bg-background\/85{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/85{background-color:color-mix(in oklab, var(--background) 85%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\/10{background-color:color-mix(in oklab, var(--color-black) 10%, transparent)}}.bg-border-soft{background-color:var(--border-soft)}.bg-card,.bg-card\/70{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/70{background-color:color-mix(in oklab, var(--card) 70%, transparent)}}.bg-card\/90{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/90{background-color:color-mix(in oklab, var(--card) 90%, transparent)}}.bg-card\/95{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/95{background-color:color-mix(in oklab, var(--card) 95%, transparent)}}.bg-cobalt{background-color:var(--cobalt)}.bg-cobalt-tint{background-color:var(--cobalt-tint)}.bg-ember{background-color:var(--ember-mark)}.bg-ember-tint,.bg-ember-tint\/50{background-color:var(--ember-tint)}@supports (color:color-mix(in lab, red, red)){.bg-ember-tint\/50{background-color:color-mix(in oklab, var(--ember-tint) 50%, transparent)}}.bg-ember-veil{background-color:var(--ember-veil)}.bg-foreground{background-color:var(--foreground)}.bg-ink{background-color:var(--ink)}.bg-ink-4,.bg-ink-4\/40{background-color:var(--ink-4)}@supports (color:color-mix(in lab, red, red)){.bg-ink-4\/40{background-color:color-mix(in oklab, var(--ink-4) 40%, transparent)}}.bg-moss{background-color:var(--moss)}.bg-moss-tint{background-color:var(--moss-tint)}.bg-muted{background-color:var(--muted)}.bg-paper{background-color:var(--paper)}.bg-paper-2{background-color:var(--paper-2)}.bg-paper-3{background-color:var(--paper-3)}.bg-primary{background-color:var(--primary)}.bg-rose{background-color:var(--rose)}.bg-rose-tint{background-color:var(--rose-tint)}.bg-rose\/25{background-color:var(--rose)}@supports (color:color-mix(in lab, red, red)){.bg-rose\/25{background-color:color-mix(in oklab, var(--rose) 25%, transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/12{background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/12{background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-white\/\[0\.07\]{background-color:#ffffff12}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.07\]{background-color:color-mix(in oklab, var(--color-white) 7.0%, transparent)}}.bg-linear-to-br{--tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab, red, red)){.bg-linear-to-br{--tw-gradient-position:to bottom right in oklab}}.bg-linear-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-linear-to-l{--tw-gradient-position:to left}@supports (background-image:linear-gradient(in lab, red, red)){.bg-linear-to-l{--tw-gradient-position:to left in oklab}}.bg-linear-to-l{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-linear-to-r{--tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab, red, red)){.bg-linear-to-r{--tw-gradient-position:to right in oklab}}.bg-linear-to-r{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab, red, red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-ember-tint{--tw-gradient-from:var(--ember-tint);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-paper\/85{--tw-gradient-from:var(--paper)}@supports (color:color-mix(in lab, red, red)){.from-paper\/85{--tw-gradient-from:color-mix(in oklab, var(--paper) 85%, transparent)}}.from-paper\/85{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-50\%{--tw-gradient-from-position:50%}.via-card{--tw-gradient-via:var(--card);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-paper\/55{--tw-gradient-via:var(--paper)}@supports (color:color-mix(in lab, red, red)){.via-paper\/55{--tw-gradient-via:color-mix(in oklab, var(--paper) 55%, transparent)}}.via-paper\/55{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-card{--tw-gradient-to:var(--card);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-ember-tint{--tw-gradient-to:var(--ember-tint);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-paper\/0{--tw-gradient-to:var(--paper)}@supports (color:color-mix(in lab, red, red)){.to-paper\/0{--tw-gradient-to:color-mix(in oklab, var(--paper) 0%, transparent)}}.to-paper\/0{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-50\%{--tw-gradient-to-position:50%}.\[mask-image\:linear-gradient\(to_top\,black_45\%\,transparent\)\]{-webkit-mask-image:linear-gradient(#0000,#000 55%);mask-image:linear-gradient(#0000,#000 55%)}.fill-amber{fill:var(--amber)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-7{padding-block:calc(var(--spacing) * 7)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-14{padding-block:calc(var(--spacing) * 14)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-24{padding-block:calc(var(--spacing) * 24)}.py-\[3px\]{padding-block:3px}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-10{padding-top:calc(var(--spacing) * 10)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pr-20{padding-right:calc(var(--spacing) * 20)}.pr-32{padding-right:calc(var(--spacing) * 32)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pb-20{padding-bottom:calc(var(--spacing) * 20)}.pb-32{padding-bottom:calc(var(--spacing) * 32)}.pb-\[max\(1\.5rem\,calc\(env\(safe-area-inset-bottom\)\+0\.75rem\)\)\]{padding-bottom:max(1.5rem, calc(env(safe-area-inset-bottom) + .75rem))}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-5\.5{padding-left:calc(var(--spacing) * 5.5)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-\[-2px\]{vertical-align:-2px}.align-top{vertical-align:top}.font-display{font-family:var(--f-display)}.font-mono{font-family:var(--f-mono)}.font-sans{font-family:var(--f-ui)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.75rem\]{font-size:.75rem}.text-\[0\.875rem\]{font-size:.875rem}.text-\[0\.6875rem\]{font-size:.6875rem}.text-\[0\.8125rem\]{font-size:.8125rem}.text-\[0\.9375rem\]{font-size:.9375rem}.text-\[0\.78125rem\]{font-size:.78125rem}.text-\[1\.5rem\]{font-size:1.5rem}.text-\[1\.25rem\]{font-size:1.25rem}.text-\[1\.75rem\]{font-size:1.75rem}.text-\[1\.375rem\]{font-size:1.375rem}.text-\[1\.0625rem\]{font-size:1.0625rem}.text-\[1\.625rem\]{font-size:1.625rem}.text-\[1\.875rem\]{font-size:1.875rem}.text-\[1rem\]{font-size:1rem}.text-\[2\.125rem\]{font-size:2.125rem}.text-\[2rem\]{font-size:2rem}.text-\[14px\]{font-size:14px}.text-\[clamp\(28px\,3vw\,40px\)\]{font-size:clamp(28px,3vw,40px)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-\[1\.1\]{--tw-leading:1.1;line-height:1.1}.leading-\[1\.5\]{--tw-leading:1.5;line-height:1.5}.leading-\[1\.06\]{--tw-leading:1.06;line-height:1.06}.leading-\[1\.6\]{--tw-leading:1.6;line-height:1.6}.leading-\[1\.08\]{--tw-leading:1.08;line-height:1.08}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.02em\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\[-0\.03em\]{--tw-tracking:-.03em;letter-spacing:-.03em}.tracking-\[0\.06em\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\[0\.07em\]{--tw-tracking:.07em;letter-spacing:.07em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\[0\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.break-normal{overflow-wrap:normal;word-break:normal}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.\[tab-size\:2\]{tab-size:2}.text-\[\#1d1a17\]\/40{color:oklab(22.0098% .00284923 .00685373/.4)}.text-\[oklch\(32\%_0\.15_262\)\]{color:oklch(32% .15 262)}.text-amber{color:var(--amber)}.text-amber-200{color:var(--color-amber-200)}.text-background{color:var(--background)}.text-black{color:var(--color-black)}.text-cobalt{color:var(--cobalt)}.text-ember{color:var(--ember-mark)}.text-ember-on{color:var(--ember-on)}.text-ember-strong{color:var(--ember-strong-mark)}.text-emerald-300{color:var(--color-emerald-300)}.text-foreground{color:var(--foreground)}.text-ink{color:var(--ink)}.text-ink-2{color:var(--ink-2)}.text-ink-3{color:var(--ink-3)}.text-ink-4{color:var(--ink-4)}.text-moss{color:var(--moss)}.text-muted-foreground{color:var(--muted-foreground)}.text-paper{color:var(--paper)}.text-primary-foreground{color:var(--primary-foreground)}.text-rose{color:var(--rose)}.text-sky-300{color:var(--color-sky-300)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-transparent{color:#0000}.text-violet-300{color:var(--color-violet-300)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab, red, red)){.text-white\/40{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.text-white\/55{color:#ffffff8c}@supports (color:color-mix(in lab, red, red)){.text-white\/55{color:color-mix(in oklab, var(--color-white) 55%, transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60{color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/65{color:#ffffffa6}@supports (color:color-mix(in lab, red, red)){.text-white\/65{color:color-mix(in oklab, var(--color-white) 65%, transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70{color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab, red, red)){.text-white\/75{color:color-mix(in oklab, var(--color-white) 75%, transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80{color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85{color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85{color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.caret-white{caret-color:var(--color-white)}.accent-\[var\(--ember\)\]{accent-color:var(--ember)}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.opacity-\[0\.14\]{opacity:.14}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_0_1px_var\(--border-soft\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--border-soft));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_0_100vmax_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 0 0 100vmax var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_1px_0_oklch\(0\%_0_0\/0\.08\)\]{--tw-shadow:0 1px 0 var(--tw-shadow-color,oklch(0% 0 0/.08));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(0\,0\,0\,0\.25\)\]{--tw-shadow:0 1px 3px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_2px_8px_oklch\(0\%_0_0\/0\.22\)\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,oklch(0% 0 0/.22));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_6px_24px_oklch\(88\%_0\.17_150\/0\.35\)\]{--tw-shadow:0 6px 24px var(--tw-shadow-color,oklch(88% .17 150/.35));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[inset_0_1px_0_oklch\(0\%_0_0\/0\.02\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,oklch(0% 0 0/.02));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-elevated{--tw-shadow:var(--shadow-ember-elevated);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-overlay{--tw-shadow:var(--shadow-ember-overlay);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-soft{--tw-shadow:var(--shadow-ember-soft);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-amber\/30{--tw-ring-color:var(--amber)}@supports (color:color-mix(in lab, red, red)){.ring-amber\/30{--tw-ring-color:color-mix(in oklab, var(--amber) 30%, transparent)}}.ring-border{--tw-ring-color:var(--border)}.ring-border-soft{--tw-ring-color:var(--border-soft)}.ring-card{--tw-ring-color:var(--card)}.ring-ember{--tw-ring-color:var(--ember-mark)}.ring-ember-strong\/40{--tw-ring-color:var(--ember-strong-mark)}@supports (color:color-mix(in lab, red, red)){.ring-ember-strong\/40{--tw-ring-color:color-mix(in oklab, var(--ember-strong-mark) 40%, transparent)}}.ring-ember-veil{--tw-ring-color:var(--ember-veil)}.ring-ember\/30{--tw-ring-color:var(--ember-mark)}@supports (color:color-mix(in lab, red, red)){.ring-ember\/30{--tw-ring-color:color-mix(in oklab, var(--ember-mark) 30%, transparent)}}.ring-ember\/40{--tw-ring-color:var(--ember-mark)}@supports (color:color-mix(in lab, red, red)){.ring-ember\/40{--tw-ring-color:color-mix(in oklab, var(--ember-mark) 40%, transparent)}}.ring-ember\/60{--tw-ring-color:var(--ember-mark)}@supports (color:color-mix(in lab, red, red)){.ring-ember\/60{--tw-ring-color:color-mix(in oklab, var(--ember-mark) 60%, transparent)}}.ring-focus-glow{--tw-ring-color:var(--focus-glow)}.ring-ink-4{--tw-ring-color:var(--ink-4)}.ring-input{--tw-ring-color:var(--input)}.ring-moss{--tw-ring-color:var(--moss)}.ring-rose,.ring-rose\/30{--tw-ring-color:var(--rose)}@supports (color:color-mix(in lab, red, red)){.ring-rose\/30{--tw-ring-color:color-mix(in oklab, var(--rose) 30%, transparent)}}.ring-rose\/40{--tw-ring-color:var(--rose)}@supports (color:color-mix(in lab, red, red)){.ring-rose\/40{--tw-ring-color:color-mix(in oklab, var(--rose) 40%, transparent)}}.ring-transparent{--tw-ring-color:transparent}.ring-white\/12{--tw-ring-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.ring-white\/12{--tw-ring-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.ring-white\/15{--tw-ring-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.ring-white\/15{--tw-ring-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\[1px\]{--tw-backdrop-blur:blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background\,filter\,color\,transform\]{transition-property:background,filter,color,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\,filter\]{transition-property:background-color,color,box-shadow,filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\,translate\]{transition-property:left,translate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[opacity\,scale\,left\]{transition-property:opacity,scale,left;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,background\,color\]{transition-property:width,background,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\,margin\,opacity\]{transition-property:width,margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-\[cubic-bezier\(0\.3\,0\.7\,0\.2\,1\)\]{--tw-ease:cubic-bezier(.3,.7,.2,1);transition-timing-function:cubic-bezier(.3,.7,.2,1)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}.group-open\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}@media (hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:bg-ember\/70:is(:where(.group):hover *){background-color:var(--ember-mark)}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-ember\/70:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--ember-mark) 70%, transparent)}}.group-hover\:text-white\/80:is(:where(.group):hover *){color:#fffc}@supports (color:color-mix(in lab, red, red)){.group-hover\:text-white\/80:is(:where(.group):hover *){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:bg-ember:is(:where(.group):focus-visible *){background-color:var(--ember-mark)}.group-focus-visible\:opacity-0:is(:where(.group):focus-visible *){opacity:0}.group-focus-visible\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.group-active\:h-16:is(:where(.group):active *){height:calc(var(--spacing) * 16)}.group-active\:w-14:is(:where(.group):active *){width:calc(var(--spacing) * 14)}.group-active\:bg-ember:is(:where(.group):active *){background-color:var(--ember-mark)}@media (hover:hover){.group-enabled\:group-hover\:translate-x-0\.5:is(:where(.group):enabled *):is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.peer-checked\:border-ember:is(:where(.peer):checked~*){border-color:var(--ember-mark)}.peer-checked\:bg-ember-tint:is(:where(.peer):checked~*){background-color:var(--ember-tint)}.peer-checked\:text-ink:is(:where(.peer):checked~*){color:var(--ink)}.peer-focus-visible\:outline-\[1\.5px\]:is(:where(.peer):focus-visible~*){outline-style:var(--tw-outline-style);outline-width:1.5px}.peer-focus-visible\:outline-offset-2:is(:where(.peer):focus-visible~*){outline-offset:2px}.peer-focus-visible\:outline-\(--focus-line\):is(:where(.peer):focus-visible~*){outline-color:var(--focus-line)}.peer-focus-visible\:outline-solid:is(:where(.peer):focus-visible~*){--tw-outline-style:solid;outline-style:solid}.peer-disabled\:pointer-events-none:is(:where(.peer):disabled~*){pointer-events:none}.peer-disabled\:line-through:is(:where(.peer):disabled~*){text-decoration-line:line-through}.peer-disabled\:opacity-60:is(:where(.peer):disabled~*){opacity:.6}.selection\:bg-sky-400\/30 ::selection{background-color:#00bcfe4d}@supports (color:color-mix(in lab, red, red)){.selection\:bg-sky-400\/30 ::selection{background-color:color-mix(in oklab, var(--color-sky-400) 30%, transparent)}}.selection\:bg-sky-400\/30::selection{background-color:#00bcfe4d}@supports (color:color-mix(in lab, red, red)){.selection\:bg-sky-400\/30::selection{background-color:color-mix(in oklab, var(--color-sky-400) 30%, transparent)}}.placeholder\:truncate::placeholder{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.placeholder\:text-ink-4::placeholder{color:var(--ink-4)}.placeholder\:text-transparent::placeholder{color:#0000}.backdrop\:bg-\[oklch\(20\%_0\.01_60\/0\.28\)\]::backdrop{background-color:oklch(20% .01 60/.28)}.backdrop\:backdrop-blur-\[2px\]::backdrop{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:-inset-x-1:before{content:var(--tw-content);inset-inline:calc(var(--spacing) * -1)}.before\:inset-x-0:before{content:var(--tw-content);inset-inline:0}.before\:-inset-y-2\.5:before{content:var(--tw-content);inset-block:calc(var(--spacing) * -2.5)}.before\:-top-4:before{content:var(--tw-content);top:calc(var(--spacing) * -4)}.before\:h-4:before{content:var(--tw-content);height:calc(var(--spacing) * 4)}.before\:content-\[\'\'\]:before{--tw-content:"";content:var(--tw-content)}.first\:mt-0:first-child{margin-top:0}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first\:border-l-0:first-child{border-left-style:var(--tw-border-style);border-left-width:0}.first\:pt-0:first-child{padding-top:0}.first\:pl-0:first-child{padding-left:0}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.last\:pb-0:last-child{padding-bottom:0}.focus-within\:w-full:focus-within{width:100%}.focus-within\:border-focus:focus-within{border-color:var(--focus-line)}.focus-within\:opacity-100:focus-within{opacity:1}.focus-within\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:ring-4:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:ring-focus:focus-within{--tw-ring-color:var(--focus-line)}.focus-within\:ring-focus-glow:focus-within{--tw-ring-color:var(--focus-glow)}@media (hover:hover){.hover\:w-\[var\(--ai-long\)\]:hover{width:var(--ai-long)}.hover\:border-ember:hover{border-color:var(--ember-mark)}.hover\:border-ink-4:hover{border-color:var(--ink-4)}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-card:hover,.hover\:bg-card\/60:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-card\/60:hover{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.hover\:bg-ember-tint:hover{background-color:var(--ember-tint)}.hover\:bg-paper-2:hover{background-color:var(--paper-2)}.hover\:bg-paper-3:hover{background-color:var(--paper-3)}.hover\:bg-rose-tint:hover{background-color:var(--rose-tint)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:bg-white\/15:hover{background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/15:hover{background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:bg-white\/90:hover{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/90:hover{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.hover\:text-ink:hover{color:var(--ink)}.hover\:text-ink-2:hover{color:var(--ink-2)}.hover\:text-ink-3:hover{color:var(--ink-3)}.hover\:text-rose:hover{color:var(--rose)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-elevated:hover{--tw-shadow:var(--shadow-ember-elevated);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:ring-2:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:ring-border:hover{--tw-ring-color:var(--border)}.hover\:ring-border-soft:hover{--tw-ring-color:var(--border-soft)}.hover\:ring-ember:hover{--tw-ring-color:var(--ember-mark)}.hover\:ring-ink-4:hover{--tw-ring-color:var(--ink-4)}.hover\:brightness-105:hover{--tw-brightness:brightness(105%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-\[1\.06\]:hover{--tw-brightness:brightness(1.06);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-ember:focus{border-color:var(--ember-mark)}.focus\:border-focus:focus{border-color:var(--focus-line)}.focus\:bg-card:focus{background-color:var(--card)}.focus\:bg-paper:focus{background-color:var(--paper)}.focus\:text-ink:focus{color:var(--ink)}.focus\:opacity-100:focus{opacity:1}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-4:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-border:focus{--tw-ring-color:var(--border)}.focus\:ring-focus-glow:focus{--tw-ring-color:var(--focus-glow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus-visible\:w-\[var\(--ai-long\)\]:focus-visible{width:var(--ai-long)}.focus-visible\:border-focus:focus-visible{border-color:var(--focus-line)}.focus-visible\:opacity-100:focus-visible{opacity:1}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-focus:focus-visible{--tw-ring-color:var(--focus-line)}.focus-visible\:ring-focus-glow:focus-visible{--tw-ring-color:var(--focus-glow)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\:scale-\[0\.98\]:active{scale:.98}.active\:brightness-95:active{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:line-through:disabled{text-decoration-line:line-through}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media (hover:hover){.disabled\:hover\:bg-transparent:disabled:hover{background-color:#0000}}.has-\[input\:not\(\:placeholder-shown\)\]\:w-full:has(:is(input:not(:placeholder-shown))){width:100%}.aria-pressed\:bg-foreground[aria-pressed=true]{background-color:var(--foreground)}.aria-pressed\:text-background[aria-pressed=true]{color:var(--background)}.aria-pressed\:ring-2[aria-pressed=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-pressed\:ring-current[aria-pressed=true]{--tw-ring-color:currentcolor}.data-\[open\=true\]\:w-\[var\(--ai-long\)\][data-open=true]{width:var(--ai-long)}.data-\[over\]\:border-focus[data-over]{border-color:var(--focus-line)}.data-\[over\]\:bg-paper-2[data-over]{background-color:var(--paper-2)}.data-\[over\]\:text-ink[data-over]{color:var(--ink)}@media (prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}@media not all and (width>=420px){.max-\[420px\]\:hidden{display:none}}@media not all and (width>=64rem){.max-lg\:pointer-events-none{pointer-events:none}.max-lg\:left-1\/2{left:50%}.max-lg\:hidden{display:none}.max-lg\:h-0{height:0}.max-lg\:h-\[148px\]{height:148px}.max-lg\:-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:scale-\[0\.4\]{scale:.4}.max-lg\:scale-\[0\.6\]{scale:.6}.max-lg\:text-center{text-align:center}.max-lg\:opacity-0{opacity:0}.max-lg\:opacity-100{opacity:1}@media (prefers-reduced-motion:no-preference){.max-lg\:motion-safe\:transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.max-lg\:motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}}}@media not all and (width>=48rem){.max-md\:hidden{display:none}.max-md\:scroll-mt-36{scroll-margin-top:calc(var(--spacing) * 36)}.max-md\:py-2{padding-block:calc(var(--spacing) * 2)}}@media not all and (width>=40rem){.max-sm\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.max-sm\:col-span-3{grid-column:span 3/span 3}.max-sm\:m-0{margin:0}.max-sm\:-mx-3{margin-inline:calc(var(--spacing) * -3)}.max-sm\:ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.max-sm\:hidden{display:none}.max-sm\:size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.max-sm\:h-dvh{height:100dvh}.max-sm\:max-h-none{max-height:none}.max-sm\:w-auto{width:auto}.max-sm\:w-full{width:100%}.max-sm\:max-w-none{max-width:none}.max-sm\:basis-full{flex-basis:100%}.max-sm\:\[scrollbar-width\:none\]{scrollbar-width:none}.max-sm\:overflow-x-auto{overflow-x:auto}.max-sm\:overflow-y-auto{overflow-y:auto}.max-sm\:rounded-none{border-radius:0}.max-sm\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.max-sm\:border-border-soft{border-color:var(--border-soft)}.max-sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.max-sm\:pr-10{padding-right:calc(var(--spacing) * 10)}.max-sm\:pb-4{padding-bottom:calc(var(--spacing) * 4)}.max-sm\:font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}}@media (width>=40rem){.sm\:-top-3\.5{top:calc(var(--spacing) * -3.5)}.sm\:-right-3\.5{right:calc(var(--spacing) * -3.5)}.sm\:order-none{order:0}.sm\:col-span-1{grid-column:span 1/span 1}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-auto{grid-column-start:auto}.sm\:row-start-auto{grid-row-start:auto}.sm\:-mx-7{margin-inline:calc(var(--spacing) * -7)}.sm\:mt-6{margin-top:calc(var(--spacing) * 6)}.sm\:mr-1{margin-right:var(--spacing)}.sm\:block{display:block}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:inline-flex{display:inline-flex}.sm\:size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20)}.sm\:h-11{height:calc(var(--spacing) * 11)}.sm\:min-h-0{min-height:0}.sm\:min-h-\[136px\]{min-height:136px}.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:w-56{width:calc(var(--spacing) * 56)}.sm\:w-\[var\(--drawer\)\]{width:var(--drawer)}.sm\:w-auto{width:auto}.sm\:max-w-2xl{max-width:var(--container-2xl)}.sm\:max-w-4xl{max-width:var(--container-4xl)}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:basis-0{flex-basis:0}.sm\:\[grid-template-columns\:var\(--cols\)\]{grid-template-columns:var(--cols)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.sm\:grid-cols-\[1fr_2fr_auto\]{grid-template-columns:1fr 2fr auto}.sm\:grid-cols-\[7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem minmax(0,1fr)}.sm\:grid-cols-\[9rem_minmax\(0\,1fr\)\]{grid-template-columns:9rem minmax(0,1fr)}.sm\:grid-cols-\[230px_minmax\(0\,1fr\)\]{grid-template-columns:230px minmax(0,1fr)}.sm\:grid-cols-\[minmax\(0\,1fr\)_12rem_auto\]{grid-template-columns:minmax(0,1fr) 12rem auto}.sm\:grid-cols-\[minmax\(0\,2fr\)_minmax\(0\,3fr\)_auto_auto\]{grid-template-columns:minmax(0,2fr) minmax(0,3fr) auto auto}.sm\:grid-rows-\[minmax\(0\,1fr\)\]{grid-template-rows:minmax(0,1fr)}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:justify-center{justify-content:center}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:gap-8{gap:calc(var(--spacing) * 8)}.sm\:overflow-y-auto{overflow-y:auto}.sm\:rounded-t-2xl{border-top-left-radius:calc(var(--radius) * 2);border-top-right-radius:calc(var(--radius) * 2)}.sm\:bg-transparent{background-color:#0000}.sm\:p-0{padding:0}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-7{padding:calc(var(--spacing) * 7)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:px-7{padding-inline:calc(var(--spacing) * 7)}.sm\:px-10{padding-inline:calc(var(--spacing) * 10)}.sm\:py-16{padding-block:calc(var(--spacing) * 16)}.sm\:pt-6{padding-top:calc(var(--spacing) * 6)}.sm\:pt-8{padding-top:calc(var(--spacing) * 8)}.sm\:pt-16{padding-top:calc(var(--spacing) * 16)}.sm\:pr-36{padding-right:calc(var(--spacing) * 36)}.sm\:pr-40{padding-right:calc(var(--spacing) * 40)}.sm\:pb-6{padding-bottom:calc(var(--spacing) * 6)}.sm\:pb-8{padding-bottom:calc(var(--spacing) * 8)}.sm\:pb-16{padding-bottom:calc(var(--spacing) * 16)}.sm\:text-\[1\.75rem\]{font-size:1.75rem}.sm\:text-\[2\.125rem\]{font-size:2.125rem}.sm\:text-\[2\.375rem\]{font-size:2.375rem}.sm\:text-\[2rem\]{font-size:2rem}.sm\:placeholder\:text-ink-4::placeholder{color:var(--ink-4)}}@media (width>=48rem){.md\:sticky{position:sticky}.md\:top-20{top:calc(var(--spacing) * 20)}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}.md\:grid-cols-\[13\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:13.5rem minmax(0,1fr)}.md\:gap-8{gap:calc(var(--spacing) * 8)}.md\:self-start{align-self:flex-start}}@media (width>=64rem){.lg\:pointer-events-none{pointer-events:none}.lg\:top-\[calc\(6vh\+5\.25rem\)\]{top:calc(6vh + 5.25rem)}.lg\:left-0{left:0}.lg\:left-\[calc\(50\%-508px\)\]{left:calc(50% - 508px)}.lg\:left-\[calc\(50\%-560px\)\]{left:calc(50% - 560px)}.lg\:ml-0{margin-left:0}.lg\:ml-\[calc\(50\%-16rem\)\]{margin-left:calc(50% - 16rem)}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:inline{display:inline}.lg\:h-0{height:0}.lg\:h-\[calc\(100vh-27rem\)\]{height:calc(100vh - 27rem)}.lg\:h-auto{height:auto}.lg\:max-h-\[calc\(100vh-15rem\)\]{max-height:calc(100vh - 15rem)}.lg\:max-h-\[calc\(100vh-27rem\)\]{max-height:calc(100vh - 27rem)}.lg\:min-h-\[6\.5rem\]{min-height:6.5rem}.lg\:min-h-\[360px\]{min-height:360px}.lg\:w-\(--pane\){width:var(--pane)}.lg\:w-\[32rem\]{width:32rem}.lg\:origin-center{transform-origin:50%}.lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.lg\:scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.lg\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[1fr_280px\]{grid-template-columns:1fr 280px}.lg\:grid-cols-\[15rem_minmax\(0\,1fr\)\]{grid-template-columns:15rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(280px\,360px\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(280px,360px) minmax(0,1fr)}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:gap-10{gap:calc(var(--spacing) * 10)}.lg\:gap-14{gap:calc(var(--spacing) * 14)}.lg\:rounded-tr-none{border-top-right-radius:0}.lg\:pt-3{padding-top:calc(var(--spacing) * 3)}.lg\:pt-\[6vh\]{padding-top:6vh}.lg\:text-left{text-align:left}.lg\:opacity-0{opacity:0}.lg\:opacity-100{opacity:1}.lg\:transition-\[margin\]{transition-property:margin;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.lg\:duration-700{--tw-duration:.7s;transition-duration:.7s}}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}@media (pointer:coarse){.coarse\:-my-3{margin-block:calc(var(--spacing) * -3)}.coarse\:size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.coarse\:size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.coarse\:size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.coarse\:h-11{height:calc(var(--spacing) * 11)}.coarse\:min-h-11{min-height:calc(var(--spacing) * 11)}.coarse\:min-w-11{min-width:calc(var(--spacing) * 11)}.coarse\:px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.coarse\:px-4{padding-inline:calc(var(--spacing) * 4)}.coarse\:py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.coarse\:py-3{padding-block:calc(var(--spacing) * 3)}.coarse\:opacity-100{opacity:1}}@media not all and (width>=40rem){.max-sm\:\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\>svg\]\:size-full>svg{width:100%;height:100%}}:root,.dark .tone-flip{--raw-primary:#e0531b;--raw-secondary:#f1f3f5;--raw-background:#faf8f5;--raw-sidebar:var(--paper);--contrast:1;--hue-success:150;--hue-danger:25;--hue-warning:70;--hue-info:264;--paper:oklch(from var(--raw-background) calc(.99 - (.02 * var(--contrast))) c h);--paper-2:oklch(from var(--raw-background) calc(.96 - (.03 * var(--contrast))) calc(c * 1.2) h);--paper-3:oklch(from var(--raw-background) calc(.94 - (.04 * var(--contrast))) calc(c * 1.5) h);--canvas:var(--paper);--canvas-dim:var(--paper-2);--canvas-darken:var(--paper-3);--ink:oklch(from var(--raw-background) calc(.22 + (.05 / var(--contrast))) calc(c * 1.2) h);--ink-2:oklch(from var(--raw-background) calc(.4 + (.05 / var(--contrast))) c h);--ink-3:oklch(from var(--raw-background) calc(.55 + (.05 / var(--contrast))) calc(c * .8) h);--ink-4:oklch(from var(--raw-background) calc(.7 + (.05 / var(--contrast))) calc(c * .6) h);--ember:oklch(from var(--raw-primary) l c h);--ember-strong:oklch(from var(--raw-primary) calc(l - (.08 * var(--contrast))) c h);--ember-tint:oklch(from var(--raw-primary) calc(.96 + .02 * (1 - var(--contrast))) calc(c * .2) h);--ember-veil:oklch(from var(--raw-primary) l c h / .1);--ember-mark:oklch(from var(--ember) min(l, .65) c h);--ember-strong-mark:oklch(from var(--ember-strong) min(l, .65) c h);--ember-on:oklch(from var(--ember-mark) calc(.16 + .83 * clamp(0, (.65 - l) * 1000, 1)) .01 h);--cobalt:var(--info);--cobalt-tint:var(--info-tint);--moss:var(--success);--moss-tint:var(--success-tint);--amber:var(--warning);--amber-tint:var(--warning-tint);--rose:var(--danger);--rose-tint:var(--danger-tint);--danger:oklch(from var(--raw-background) calc(.64 - (.05 * var(--contrast))) .2 var(--hue-danger));--danger-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .03 var(--hue-danger));--success:oklch(from var(--raw-background) calc(.48 - (.04 * var(--contrast))) .13 var(--hue-success));--success-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .025 var(--hue-success));--warning:oklch(from var(--raw-background) calc(.78 - (.04 * var(--contrast))) .16 var(--hue-warning));--warning-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .04 var(--hue-warning));--info:oklch(from var(--raw-background) calc(.5 - (.05 * var(--contrast))) .18 var(--hue-info));--info-tint:oklch(from var(--raw-background) calc(.98 - (.01 * var(--contrast))) .025 var(--hue-info));--link:var(--info);--secondary-accent:oklch(from var(--raw-secondary) l c h);--secondary-accent-strong:oklch(from var(--raw-secondary) calc(l - (.08 * var(--contrast))) c h);--f-display:"Space Grotesk", ui-sans-serif, system-ui, sans-serif;--f-ui:"Geist", ui-sans-serif, system-ui, sans-serif;--f-mono:"Geist Mono", ui-monospace, monospace;--t-display-l:56px;--t-display:40px;--t-h1:28px;--t-h2:20px;--t-h3:16px;--t-body:14px;--t-ui:13px;--t-small:12px;--t-micro:11px;--s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-5:20px;--s-6:24px;--s-8:32px;--s-10:40px;--s-12:48px;--s-16:64px;--r-1:2px;--r-2:4px;--r-3:6px;--r-4:12px;--r-5:16px;--r-pill:999px;--shadow-ember-elevated:0 1px 2px oklch(from var(--raw-background) .4 c h / .04), 0 6px 18px oklch(from var(--raw-background) .2 c h / .06);--shadow-ember-overlay:0 2px 4px oklch(from var(--raw-background) .2 c h / .08), 0 10px 28px oklch(from var(--raw-background) .15 c h / .16);--shadow-ember-soft:0 1px 2px oklch(from var(--raw-background) .4 c h / .03), 0 3px 10px oklch(from var(--raw-background) .3 c h / .05);--e-1:0 1px 0 oklch(from var(--raw-background) .7 c h / .08);--e-2:var(--shadow-ember-elevated);--e-3:0 1px 2px oklch(from var(--raw-background) .4 c h / .04), 0 6px 18px oklch(from var(--raw-background) .4 c h / .06), 0 18px 36px oklch(from var(--raw-background) .4 c h / .07);--shadow-shell-secondary-edge:0 2px 24px -8px oklch(from var(--raw-background) .35 c h / .14);--shadow-shell-copilot-edge:0 2px 24px -8px oklch(from var(--raw-background) .35 c h / .14);--row-compact:28px;--row-default:32px;--row-comfy:40px;--shell-row:44px;--shell-footer:48px;--input-inset:oklch(from var(--raw-background) calc(calc(.99 - (.02 * var(--contrast))) - (.12 * var(--contrast))) calc(c * 3) h / .65)}.dark,.tone-flip{--raw-sidebar:oklch(from var(--raw-background) calc(.09 + (.03 * var(--contrast))) calc(c * 1.2) h);--paper:oklch(from var(--raw-background) calc(.12 + (.03 * var(--contrast))) c h);--paper-2:oklch(from var(--raw-background) calc(.15 + (.02 * var(--contrast))) calc(c * 1.2) h);--paper-3:oklch(from var(--raw-background) calc(.18 + (.01 * var(--contrast))) calc(c * 1.5) h);--ink:oklch(from var(--raw-background) calc(.92 - (.05 / var(--contrast))) calc(c * 1.2) h);--ink-2:oklch(from var(--raw-background) calc(.85 - (.05 / var(--contrast))) c h);--ink-3:oklch(from var(--raw-background) calc(.72 - (.05 / var(--contrast))) calc(c * .8) h);--ink-4:oklch(from var(--raw-background) calc(.58 - (.05 / var(--contrast))) calc(c * .6) h);--input-inset:oklch(from var(--raw-background) calc(calc(.12 + (.03 * var(--contrast))) + (.21 * var(--contrast))) calc(c * 2.8) h / .65);--ember-strong:oklch(from var(--raw-primary) calc(l + (.08 * var(--contrast))) c h);--ember-tint:oklch(from var(--raw-primary) calc(.18 + .02 * var(--contrast)) calc(c * .35) h);--ember-mark:oklch(from var(--ember) max(l, .6) c h);--ember-strong-mark:oklch(from var(--ember-strong) max(l, .6) c h);--secondary-accent-strong:oklch(from var(--raw-secondary) calc(l + (.08 * var(--contrast))) c h);--danger:oklch(from var(--raw-background) calc(.62 + (.05 * var(--contrast))) .2 var(--hue-danger));--danger-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .05 var(--hue-danger));--success:oklch(from var(--raw-background) calc(.65 + (.05 * var(--contrast))) .13 var(--hue-success));--success-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .04 var(--hue-success));--warning:oklch(from var(--raw-background) calc(.78 + (.04 * var(--contrast))) .16 var(--hue-warning));--warning-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .05 var(--hue-warning));--info:oklch(from var(--raw-background) calc(.72 + (.05 * var(--contrast))) .18 var(--hue-info));--info-tint:oklch(from var(--raw-background) calc(.18 + (.02 * var(--contrast))) .04 var(--hue-info));--shadow-ember-elevated:0 1px 2px oklch(0% 0 0/.22), 0 6px 18px oklch(0% 0 0/.28);--shadow-ember-overlay:0 2px 4px oklch(0% 0 0/.3), 0 10px 28px oklch(0% 0 0/.44);--shadow-ember-soft:0 1px 2px oklch(0% 0 0/.18), 0 3px 10px oklch(0% 0 0/.22);--e-2:var(--shadow-ember-elevated);--e-3:0 1px 2px oklch(0% 0 0/.22), 0 6px 18px oklch(0% 0 0/.28), 0 24px 48px oklch(0% 0 0/.32);--shadow-shell-secondary-edge:0 2px 28px -10px oklch(0% 0 0/.5);--shadow-shell-copilot-edge:0 2px 28px -10px oklch(0% 0 0/.5)}.tone-flip{--canvas:var(--paper);--canvas-dim:var(--paper-2);--canvas-darken:var(--paper-3);--cobalt:var(--info);--cobalt-tint:var(--info-tint);--moss:var(--success);--moss-tint:var(--success-tint);--amber:var(--warning);--amber-tint:var(--warning-tint);--rose:var(--danger);--rose-tint:var(--danger-tint);--link:var(--info);color:var(--foreground)}@media (prefers-contrast:more){:root{--contrast:1.4}}.theme-high-contrast{--contrast:1.4}.theme-deuteranopia,.theme-protanopia{--hue-success:195;--hue-danger:15;--hue-warning:50}.theme-tritanopia{--hue-success:165;--hue-warning:10;--hue-info:140}:root,.dark .tone-flip{--background:var(--canvas);--foreground:var(--ink);--card:oklch(100% 0 0);--card-foreground:var(--ink);--popover:oklch(from var(--card) l c h / .72);--popover-foreground:var(--ink);--primary:var(--ember-strong);--primary-foreground:oklch(from var(--primary) calc(.16 + .83 * clamp(0, (.65 - l) * 1000, 1)) .01 h);--secondary:var(--paper-2);--secondary-foreground:var(--ink);--muted:var(--paper-3)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--muted:color-mix(in oklch, var(--paper-3) 32%, var(--card))}}:root,.dark .tone-flip{--muted-foreground:var(--ink-3);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--accent:color-mix(in oklch, var(--ink) calc(7.5% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--accent-foreground:var(--ink);--destructive:var(--danger);--destructive-foreground:oklch(99% 0 0);--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--border:color-mix(in oklch, var(--ink) calc(12% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--border-soft:var(--border)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--border-soft:color-mix(in oklch, var(--border) 50%, transparent)}}:root,.dark .tone-flip{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--input:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}:root,.dark .tone-flip{--ring:var(--ember)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--ring:color-mix(in oklch, var(--ember) 45%, transparent)}}:root,.dark .tone-flip{--link:var(--info);--chart-1:var(--moss);--chart-2:var(--cobalt);--chart-3:var(--ember);--chart-4:var(--amber);--chart-5:var(--rose);--sidebar:oklch(from var(--raw-sidebar) l c h);--sidebar-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-primary:var(--ember);--sidebar-primary-foreground:var(--ember-on);--sidebar-accent:oklch(from var(--sidebar) calc(l + .05 * (1 - 2 * l)) c h);--sidebar-accent-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-border:var(--sidebar)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--sidebar-border:color-mix(in oklch, var(--sidebar) 82%, var(--sidebar-foreground))}}:root,.dark .tone-flip{--sidebar-ring:var(--sidebar-primary)}@supports (color:color-mix(in lab, red, red)){:root,.dark .tone-flip{--sidebar-ring:color-mix(in oklch, var(--sidebar-primary) 65%, transparent)}}:root,.dark .tone-flip{--font-sans:var(--f-ui);--font-heading:var(--f-display);--font-mono:var(--f-mono);--radius:.5rem;--radius-button:.5rem;--shadow-2xs:var(--e-1);--shadow-xs:0 1px 2px oklch(40% var(--seed-neutral-c) var(--seed-neutral-h) / .06);--shadow-sm:var(--e-2);--shadow-md:0 4px 12px oklch(40% var(--seed-neutral-c) var(--seed-neutral-h) / .08);--shadow-lg:var(--e-3);--shadow-xl:0 20px 40px oklch(35% var(--seed-neutral-c) var(--seed-neutral-h) / .12);--shadow-2xl:0 24px 48px oklch(30% var(--seed-neutral-c) var(--seed-neutral-h) / .16)}.dark,.tone-flip{--background:var(--canvas);--foreground:var(--ink);--card:var(--paper-2);--card-foreground:var(--ink);--popover:oklch(from var(--card) l c h / .78);--popover-foreground:var(--ink);--primary:var(--ember-strong);--primary-foreground:oklch(from var(--primary) calc(.16 + .83 * clamp(0, (.65 - l) * 1000, 1)) .01 h);--secondary:var(--paper-2);--secondary-foreground:var(--ink-2);--muted:var(--paper-3)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--muted:color-mix(in oklch, var(--paper-3) 45%, var(--card))}}.dark,.tone-flip{--muted-foreground:var(--ink-3);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--accent:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--accent-foreground:var(--ink);--destructive:var(--danger);--destructive-foreground:oklch(99% 0 0);--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--border:color-mix(in oklch, var(--ink) calc(12% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--border-soft:var(--border)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--border-soft:color-mix(in oklch, var(--border) 50%, transparent)}}.dark,.tone-flip{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--input:color-mix(in oklch, var(--ink) calc(10% * var(--contrast)), var(--paper))}}.dark,.tone-flip{--ring:var(--ember)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--ring:color-mix(in oklch, var(--ember) 55%, transparent)}}.dark,.tone-flip{--link:var(--info);--chart-1:var(--moss);--chart-2:var(--cobalt);--chart-3:var(--ember);--chart-4:var(--amber);--chart-5:var(--rose);--sidebar:oklch(from var(--raw-sidebar) l c h);--sidebar-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-primary:var(--ember);--sidebar-primary-foreground:var(--ember-on);--sidebar-accent:oklch(from var(--sidebar) calc(l + .05 * (1 - 2 * l)) c h);--sidebar-accent-foreground:oklch(from var(--sidebar) clamp(.15, (.62 - l) * 100, .98) calc(c * .06) h);--sidebar-border:var(--sidebar)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--sidebar-border:color-mix(in oklch, var(--sidebar) 82%, var(--sidebar-foreground))}}.dark,.tone-flip{--sidebar-ring:var(--sidebar-primary)}@supports (color:color-mix(in lab, red, red)){.dark,.tone-flip{--sidebar-ring:color-mix(in oklch, var(--sidebar-primary) 55%, transparent)}}.dark,.tone-flip{--shadow-2xs:0 1px 0 oklch(0% 0 0/.2);--shadow-xs:0 1px 2px oklch(0% 0 0/.25);--shadow-sm:var(--e-2);--shadow-md:0 4px 14px oklch(0% 0 0/.32);--shadow-lg:var(--e-3);--shadow-xl:0 20px 40px oklch(0% 0 0/.42);--shadow-2xl:0 24px 56px oklch(0% 0 0/.48)}.dark{--stage:oklch(34% .14 264);--raw-background:var(--stage);--raw-sidebar:oklch(from var(--stage) calc(l - .04) c h);--paper:oklch(from var(--stage) l c h);--card:oklch(from var(--stage) calc(l + .06) calc(c * .95) h);--paper-2:oklch(from var(--stage) calc(l + .1) calc(c * .92) h);--paper-3:oklch(from var(--stage) calc(l + .14) calc(c * .88) h);--ink:oklch(from var(--stage) .97 .015 h);--ink-2:oklch(from var(--stage) .9 .03 h);--ink-3:oklch(from var(--stage) .8 .05 h);--ink-4:oklch(from var(--stage) .68 .06 h);--accent:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--accent:color-mix(in oklch, var(--ink) 10%, var(--card))}}.dark{--border:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--border:color-mix(in oklch, var(--ink) 18%, var(--card))}}.dark{--input:var(--ink)}@supports (color:color-mix(in lab, red, red)){.dark{--input:color-mix(in oklch, var(--ink) 24%, var(--card))}}.dark{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html{-webkit-text-size-adjust:100%;font-size:16px}@media ((width>768px)) and ((width<1280px)){html[data-studio]{font-size:14px}}body{background:var(--background);color:var(--foreground);font-family:var(--f-ui);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{min-height:100dvh}@media (pointer:coarse){input:not([type=checkbox],[type=radio],[type=range],[type=color]),textarea,select{font-size:16px}}button,a,[role=switch]{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.safe-top{padding-top:env(safe-area-inset-top)}.safe-x{padding-left:max(1.25rem, env(safe-area-inset-left));padding-right:max(1.25rem, env(safe-area-inset-right))}.safe-bottom{padding-bottom:max(.75rem, env(safe-area-inset-bottom))}@media (width<=767px){.action-bar{bottom:var(--kb,0px);z-index:10;padding:.75rem 1.25rem max(.75rem, env(safe-area-inset-bottom));background:var(--background);margin-inline:-1.25rem;position:sticky}@supports (color:color-mix(in lab, red, red)){.action-bar{background:color-mix(in oklch, var(--background) 88%, transparent)}}.action-bar{-webkit-backdrop-filter:blur(10px);border-top:1px solid var(--border-soft)}.keyboard-open .action-bar{padding-bottom:.75rem}}:root.in-app{--f-ui:-apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, system-ui, sans-serif;--f-mono:ui-monospace, "SF Mono", Menlo, monospace}::selection{color:var(--ink);background:var(--ember-veil)}:root{--focus-line:var(--ink)}@supports (color:color-mix(in lab, red, red)){:root{--focus-line:color-mix(in oklch, var(--ink) 26%, transparent)}}:root{--focus-glow:transparent}:focus-visible{outline:1.5px solid var(--focus-line);outline-offset:2px}:is(input,textarea,select):focus-visible{outline:none}.theme-high-contrast{--focus-line:var(--ember);--focus-glow:var(--ember-veil)}@media (prefers-contrast:more){:root{--focus-line:var(--ember);--focus-glow:var(--ember-veil)}}.theme-high-contrast :focus-visible{outline-width:2px}@media (prefers-contrast:more){:focus-visible{outline-width:2px}}.prose-zen{color:var(--ink);overflow-wrap:anywhere;line-height:1.6}.prose-zen>*+*{margin-top:.75em}.prose-zen h1,.prose-zen h2,.prose-zen h3{font-family:var(--f-display);margin-top:1.25em;font-weight:600;line-height:1.25}.prose-zen h1{font-size:1.5rem}.prose-zen h2{font-size:1.2rem}.prose-zen h3{font-size:1.05rem}.prose-zen ul,.prose-zen ol{padding-left:1.25em}.prose-zen ul{list-style:outside}.prose-zen ol{list-style:decimal}.prose-zen a{color:var(--ember-strong-mark);text-underline-offset:2px;text-decoration:underline}.prose-zen table{border-collapse:collapse;width:100%;font-size:.9em}@media (width<=639px){.prose-zen table{-webkit-overflow-scrolling:touch;display:block;overflow-x:auto}}.prose-zen pre{overflow-x:auto}.prose-zen img{max-width:100%;height:auto}.prose-zen th,.prose-zen td{border-bottom:1px solid var(--border-soft);text-align:left;padding:.4em .6em}.prose-zen code{font-family:var(--f-mono);background:var(--paper-2);border-radius:4px;padding:.1em .3em;font-size:.9em}.prose-zen blockquote{border-left:3px solid var(--border);color:var(--ink-2);padding-left:.9em}.swatch::-webkit-color-swatch-wrapper{padding:0}.swatch::-webkit-color-swatch{border-radius:calc(var(--radius) * .5);border:0}.swatch::-moz-color-swatch{border-radius:calc(var(--radius) * .5);border:0}.react-flow__attribution{display:none}.react-flow__edge-path{stroke:var(--ink-4);stroke-width:1.5px}.react-flow__handle{opacity:0}@keyframes rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}.animate-rise{animation:.45s cubic-bezier(.2,.7,.2,1) backwards rise}@keyframes dock{0%{opacity:0;transform:translateY(calc(100% + 16px))}to{opacity:1;transform:none}}.animate-dock{animation:.32s cubic-bezier(.2,.7,.2,1) both dock}@keyframes settle{0%{opacity:0;transform:translate(28px)}}.animate-settle{animation:.6s cubic-bezier(.2,.7,.2,1) .3s both settle}@keyframes step-deeper{0%{opacity:0;transform:translate(1.5rem)}}@keyframes step-back{0%{opacity:0;transform:translate(-1.5rem)}}.animate-step-deeper{animation:.2s ease-out backwards step-deeper}.animate-step-back{animation:.2s ease-out backwards step-back}@keyframes breathe{0%,to{opacity:.5}50%{opacity:1}}.animate-breathe{animation:2.4s ease-in-out infinite breathe}@keyframes pulse-dot{0%,to{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(.72)}}.animate-pulse-dot{animation:1.2s ease-in-out infinite pulse-dot}dialog.media-sheet{color:#fff;background:#000;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:0}dialog.media-sheet::backdrop{background:oklch(20% .01 60/.5)}@media (width>=640px) and (height>=560px){dialog.media-sheet{border-radius:calc(var(--radius) * 2);width:min(720px,100% - 48px);height:min(640px,100dvh - 48px);margin:auto;overflow:hidden}}@media (prefers-reduced-motion:reduce){.animate-rise,.animate-dock,.animate-settle,.animate-step-deeper,.animate-step-back,.animate-breathe,.animate-pulse-dot{animation:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}
743
743
  /*$vite$:1*/</style>
744
744
  </head>