@north-light/cli 0.3.496 → 0.3.498
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin-memory/crouter-sdk/release-notes.md +2 -1
- package/dist/clients/attach/viewer.js +9 -9
- package/dist/commands/cron.js +5 -5
- package/dist/core/canvas/migrations.js +61 -55
- package/dist/core/graph/documents.js +5 -5
- package/dist/core/graph/kinds/document.js +4 -4
- package/dist/core/graph/names.js +3 -3
- package/dist/core/graph/objects.d.ts +2 -0
- package/dist/core/graph/objects.js +8 -8
- package/dist/core/graph/reader.js +3 -3
- package/dist/core/graph/repo-sync/repos.js +3 -3
- package/dist/core/peer/stubs.js +1 -1
- package/dist/daemon/api/handlers/crons.js +1 -1
- package/dist/daemon/api/handlers/docs.js +1 -1
- package/dist/daemon/api/reader.js +1 -1
- package/dist/daemon/cron/ended.d.ts +14 -0
- package/dist/daemon/cron/ended.js +2 -0
- package/dist/daemon/cron/passes.js +1 -1
- package/dist/launcher/limits/manager.js +1 -1
- package/dist/launcher/spec.d.ts +2 -2
- package/docs/sdk/release-notes.md +2 -1
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +12 -12
|
@@ -9,7 +9,7 @@ when-and-why-to-read: When you need Release notes, this knowledge should be read
|
|
|
9
9
|
|
|
10
10
|
Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
|
|
11
11
|
|
|
12
|
-
## 0.3.
|
|
12
|
+
## 0.3.495
|
|
13
13
|
|
|
14
14
|
`GET /v1/limits` reports how much of the data disk each app uses on a host without disk quota, and the disk as a whole. Additive: no request or response an existing app sends or reads changes.
|
|
15
15
|
|
|
@@ -18,6 +18,7 @@ Changes to `@north-light/sdk` that can change what an existing app sees. Newest
|
|
|
18
18
|
- `AppLimitsDTO.disk_used_bytes` was `null` whenever the host could not enforce project quota (every hosted runtime on Blaxel). It now holds the bytes under the app's folder, measured by a directory walk at most a minute old. It stays `null` when the host has no launcher, the first walk has not finished (a read waits at most 5 s for it), or the walk failed.
|
|
19
19
|
- `LimitsDTO.data_disk` is new and optional: `{total_bytes, used_bytes, user_bytes, runtime_bytes}` for the data volume. `crtr sys limits show` prints it.
|
|
20
20
|
|
|
21
|
+
## 0.3.493
|
|
21
22
|
|
|
22
23
|
An app can act on a person's hosted runtime with no sign-in of theirs, and `@north-light/plugin` can declare canvas object kinds. Everything below is additive: no request or response an existing app sends or reads changes.
|
|
23
24
|
|
|
@@ -1739,14 +1739,14 @@ ${u}`,"1").then(l=>{let d=a.options[Number.parseInt(l,10)-1]?.id;if(d===void 0)t
|
|
|
1739
1739
|
) SELECT o.* FROM chain c CROSS JOIN objects o WHERE o.rowid = c.rowid ORDER BY c.depth`).all(e.rowid)}function Mvn(t,e){let n=yge(t,e),r=n.length?n[n.length-1]:e,i=Dvn[r.type];if(!i)throw new Error(`${e.type} ${e.id} has no space: its owner chain ends at ${r.type} ${r.id}`);let o=n.length?[...n.slice(0,-1).reverse(),e]:[];return{space:r,path:o,impl:i}}function ygi(t,e){return e.type!=="document"?!1:ae(t,"SELECT source_path FROM documents WHERE object = ?").get(e.rowid)?.source_path!=null}function Ovn(t,e){return ae(t,`SELECT a.* FROM objects a WHERE a.type = 'app' AND a.deleted_at IS NULL AND EXISTS (
|
|
1740
1740
|
SELECT 1 FROM objects o JOIN documents d ON d.object = o.rowid
|
|
1741
1741
|
WHERE o.owner = a.rowid AND o.type = 'document' AND o.deleted_at IS NULL AND d.source_path IS NOT NULL)
|
|
1742
|
-
ORDER BY a.name = 'crtr', a.name`).all().filter(r=>_Xe(t,e,r))}function _Xe(t,e,n){return n.type==="app"}function wgi(t,e,n){let r=`${pp(t,n).external_id.replace(/^app:/,"")}:`;return e.some(i=>i.startsWith(r)&&!i.slice(r.length).includes(":"))}function Nvn(t,e,n){return e.class==="person"?!0:e.class==="object"?e.owner.rowid===n.rowid:e.class==="app"?e.app.rowid===n.rowid||n.type==="profile"&&n.owner===e.app.rowid:e.app.rowid===n.rowid||n.type==="profile"&&e.profile?.rowid===n.rowid||n.type==="repo"&&gge(t,e,n,"rw")}function Pvn(t,e,n){if(e.class!=="node"&&!(e.class==="app"&&e.place!==void 0))return!0;let r=e.class==="app"?e.place:nb(e.node.id,t);if(r===null)return!0;let i=cge(n.rowid,t);return i===null?!r.isolated:uge(r,i)}function xgi(t,{space:e,path:n},r,i){let o=[];if(e.type==="person")o.push("user");else if(e.type==="app"&&n.length>0){let s=n[0];if(s.type==="profile")n.length>1&&o.push(`profile:${pp(t,s).external_id}`);else if(s.type==="node"||vXe(s)){let a=pp(t,e).external_id;a!==i&&o.push(a)}}return r.type==="node"&&o.push("node"),o}function SXe(t,e,n,r,i){if(e.class==="person"||e.scopes===null)return!1;let o=e.scopes;if(o.length===0||r.space.type==="app"&&e.app.rowid===r.space.rowid)return!1;let s=pp(t,e.app).external_id;return xgi(t,r,i,s).some(a=>{let c=`crtr:objects:${n}:${a}`;return o.some(u=>la(u,c))})}function bgi(t,e,n,r){return e.class==="person"||e.scopes===null?!1:SXe(t,e,n,Mvn(t,r),r)}function Lvn(t,e,n,r,i){let o=r.owner===null?null:t.prepare("SELECT * FROM objects WHERE rowid = ?").get(r.owner)??null;if(o===null)return!1;let s={class:"app",app:e,scopes:n??[]};return Nvn(t,s,o)?n===null||bgi(t,s,"link",i):!1}function nl(t,e,n){return CXe(t,n)(e)}function CXe(t,e){let n=null,r=null;return i=>{if(i.class==="person")return!0;if(n??=Mvn(t,e),n.space.type==="app"&&n.path.length>0){if(r??=ygi(t,e),r&&_Xe(t,i,n.space))return!0;if(vXe(e)){if(i.app.rowid===n.space.rowid&&!Pvn(t,i,e))return!1;if(i.app.rowid!==n.space.rowid&&i.scopes!==null&&_Xe(t,i,n.space)&&(e.privacy==="public"||Agi(i)&&wgi(t,i.scopes,n.space)))return!0}}return SXe(t,i,"read",n,e)||i.class==="object"&&vXe(i.object)&&SXe(t,i,"watch",n,e)?!0:n.impl.canRead(t,i,n.space,n.path,e)}}var Agi,vXe,uh=h(()=>{"use strict";Ft();B0();W6();pge();H6();EXe();Agi=t=>t.class!=="app"||t.place!==void 0;vXe=t=>t.type.includes(".")});function j6(t){let e=t.match(Egi);if(!e)return{data:null,body:t,raw:""};let n=e[1],r=t.slice(e[0].length);return{data:_gi(n),body:r,raw:n}}function _gi(t){return vgi((0,Bvn.parse)(t))}function vgi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:{}}var Bvn,Egi,Age=h(()=>{"use strict";Bvn=Jt(S4e(),1),Egi=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?/});import{closeSync as w9s,existsSync as x9s,fsyncSync as b9s,mkdirSync as E9s,openSync as _9s,readFileSync as $vn,renameSync as v9s,writeSync as S9s}from"node:fs";import{join as Sgi}from"node:path";function Cgi(t){if(!/^[0-9a-f]{64}$/.test(t))throw new Error(`invalid body hash: ${t}`);return Sgi(Ko(),"bodies",t.slice(0,2),t)}function wge(t){try{return $vn(Cgi(t),"utf8")}catch(e){throw e.code==="ENOENT"?Mf(`no body ${t}`):e}}function MS(t,e){return e===null?wge(t):j6($vn(e,"utf8")).body}var OS=h(()=>{"use strict";Co();Rr();Age()});function pU(t,e){let n=ae(t,"SELECT * FROM objects WHERE type = 'person' AND name = 'user'").get(),r=Ovn(t,e),i=e.class==="node"?[e.node,...e.repos,...e.projectRepos,e.profile,e.app]:e.class==="app"?[e.app]:e.class==="object"?[e.owner,...e.repos,e.app]:[],o=new Set;return[...i,n,...r].filter(s=>!!s&&!o.has(s.rowid)&&!!o.add(s.rowid))}function q6(t,e,n,r){return t.prepare(`SELECT * FROM objects WHERE (type = 'document' OR instr(type, '.') > 0) AND owner = ? AND name = ?
|
|
1743
|
-
AND deleted_at IS ${r?"NOT NULL ORDER BY deleted_at DESC":"NULL"}`).all(e.rowid,n)}function Igi(t,e,n){return n==="node"?ae(t,"SELECT * FROM objects WHERE type = 'node' AND id = ?").all(e):n?ae(t,"SELECT * FROM objects WHERE type = ? AND (name = ? OR id = ?)").all(n,e,e):ae(t,`SELECT * FROM objects WHERE (type = 'node' AND id = ?)
|
|
1744
|
-
OR (type IN ('person','app','repo','profile') AND (name = ? OR id = ?))`).all(e,e,e)}function xge(t,e,n,r){let i=n.trim().replace(/^\[\[(.*)\]\]$/,"$1").trim(),o=/^([^:/]+):reports\/(.+?)(?:\.md)?$/.exec(i);o&&!Fvn.test(i)&&(i=`${o[1]}/reports/${o[2]}`);let s=r?.readable??(d=>nl(t,e,d)),a=rl(t,i);if(a&&s(a))return a.deleted_at?{deleted:a}:{object:a};let c=r?.view??pU(t,e);for(let d of c){let p=q6(t,d,i,!1).find(s);if(p)return{object:p}}let u=Fvn.exec(i),l=i.indexOf("/");if(u||l>0){let d=u?u[2]:i.slice(0,l),p=u?u[3]:i.slice(l+1),f=Igi(t,d,u?.[1]),m=x=>{let E=c.findIndex(_=>_.rowid===x.rowid);return E<0?1/0:E},g=f.filter(x=>m(x)<1/0).sort((x,E)=>m(x)-m(E));for(let x of g){let E=q6(t,x,p,!1).find(s);if(E)return{object:E}}let y=f.flatMap(x=>q6(t,x,p,!1)).filter(s);if(y.length===1)return{object:y[0]};if(y.length>1)return{ambiguous:y};let w=f.flatMap(x=>q6(t,x,p,!0)).find(s);return w?{deleted:w}:!u&&f.length===0&&vC(d)?{remote:i}:{missing:!0}}for(let d of c){let p=q6(t,d,i,!0).find(s);if(p)return{deleted:p}}return{missing:!0}}var Fvn,G6=h(()=>{"use strict";Ft();Rr();uh();ls();Fvn=/^(person|app|repo|profile|node):([^/]+)\/(.+)$/});function Uvn(t){return{rowid:t.rowid,object:t.object,owner:t.owner,position:t.position,on:t.on_event,deliver:t.deliver,...t.match_json!==null?{match:JSON.parse(t.match_json)}:{},...t.match_frontmatter_json!==null?{matchFrontmatter:JSON.parse(t.match_frontmatter_json)}:{},...t.if_json!==null?{if:JSON.parse(t.if_json)}:{}}}function fU(t,e){return ae(t,"SELECT * FROM rules WHERE object = ? ORDER BY position").all(e.rowid).map(Uvn)}function Qvn(t,e,n){if(e.length===0||n.length===0)return[];let r=`SELECT * FROM rules WHERE on_event IN (${e.map(()=>"?").join(",")})
|
|
1742
|
+
ORDER BY a.name = 'crtr', a.name`).all().filter(r=>_Xe(t,e,r))}function _Xe(t,e,n){return n.type==="app"}function wgi(t,e,n){let r=`${pp(t,n).external_id.replace(/^app:/,"")}:`;return e.some(i=>i.startsWith(r)&&!i.slice(r.length).includes(":"))}function Nvn(t,e,n){return e.class==="person"?!0:e.class==="object"?e.owner.rowid===n.rowid:e.class==="app"?e.app.rowid===n.rowid||n.type==="profile"&&n.owner===e.app.rowid:e.app.rowid===n.rowid||n.type==="profile"&&e.profile?.rowid===n.rowid||n.type==="repo"&&gge(t,e,n,"rw")}function Pvn(t,e,n){if(e.class!=="node"&&!(e.class==="app"&&e.place!==void 0))return!0;let r=e.class==="app"?e.place:nb(e.node.id,t);if(r===null)return!0;let i=cge(n.rowid,t);return i===null?!r.isolated:uge(r,i)}function xgi(t,{space:e,path:n},r,i){let o=[];if(e.type==="person")o.push("user");else if(e.type==="app"&&n.length>0){let s=n[0];if(s.type==="profile")n.length>1&&o.push(`profile:${pp(t,s).external_id}`);else if(s.type==="node"||vXe(s)){let a=pp(t,e).external_id;a!==i&&o.push(a)}}return r.type==="node"&&o.push("node"),o}function SXe(t,e,n,r,i){if(e.class==="person"||e.scopes===null)return!1;let o=e.scopes;if(o.length===0||r.space.type==="app"&&e.app.rowid===r.space.rowid)return!1;let s=pp(t,e.app).external_id;return xgi(t,r,i,s).some(a=>{let c=`crtr:objects:${n}:${a}`;return o.some(u=>la(u,c))})}function bgi(t,e,n,r){return e.class==="person"||e.scopes===null?!1:SXe(t,e,n,Mvn(t,r),r)}function Lvn(t,e,n,r,i){let o=r.owner===null?null:t.prepare("SELECT * FROM objects WHERE rowid = ?").get(r.owner)??null;if(o===null)return!1;let s={class:"app",app:e,scopes:n??[]};return Nvn(t,s,o)?n===null||bgi(t,s,"link",i):!1}function nl(t,e,n){return CXe(t,n)(e)}function CXe(t,e){let n=null,r=null;return i=>{if(i.class==="person")return!0;if(n??=Mvn(t,e),n.space.type==="app"&&n.path.length>0){if(r??=ygi(t,e),r&&_Xe(t,i,n.space))return!0;if(vXe(e)){if(i.app.rowid===n.space.rowid&&!Pvn(t,i,e))return!1;if(i.app.rowid!==n.space.rowid&&i.scopes!==null&&_Xe(t,i,n.space)&&(e.privacy==="public"||Agi(i)&&wgi(t,i.scopes,n.space)))return!0}}return SXe(t,i,"read",n,e)||i.class==="object"&&vXe(i.object)&&SXe(t,i,"watch",n,e)?!0:n.impl.canRead(t,i,n.space,n.path,e)}}var Agi,vXe,uh=h(()=>{"use strict";Ft();B0();W6();pge();H6();EXe();Agi=t=>t.class!=="app"||t.place!==void 0;vXe=t=>t.type.includes(".")});function j6(t){let e=t.match(Egi);if(!e)return{data:null,body:t,raw:""};let n=e[1],r=t.slice(e[0].length);return{data:_gi(n),body:r,raw:n}}function _gi(t){return vgi((0,Bvn.parse)(t))}function vgi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:{}}var Bvn,Egi,Age=h(()=>{"use strict";Bvn=Jt(S4e(),1),Egi=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?/});import{closeSync as w9s,existsSync as x9s,fsyncSync as b9s,mkdirSync as E9s,openSync as _9s,readFileSync as $vn,renameSync as v9s,writeSync as S9s}from"node:fs";import{join as Sgi}from"node:path";function Cgi(t){if(!/^[0-9a-f]{64}$/.test(t))throw new Error(`invalid body hash: ${t}`);return Sgi(Ko(),"bodies",t.slice(0,2),t)}function wge(t){try{return $vn(Cgi(t),"utf8")}catch(e){throw e.code==="ENOENT"?Mf(`no body ${t}`):e}}function MS(t,e){return e===null?wge(t):j6($vn(e,"utf8")).body}var OS=h(()=>{"use strict";Co();Rr();Age()});function pU(t,e){let n=ae(t,"SELECT * FROM objects WHERE type = 'person' AND name = 'user' AND home_machine IS NULL").get(),r=Ovn(t,e),i=e.class==="node"?[e.node,...e.repos,...e.projectRepos,e.profile,e.app]:e.class==="app"?[e.app]:e.class==="object"?[e.owner,...e.repos,e.app]:[],o=new Set;return[...i,n,...r].filter(s=>!!s&&!o.has(s.rowid)&&!!o.add(s.rowid))}function q6(t,e,n,r){return t.prepare(`SELECT * FROM objects WHERE (type = 'document' OR instr(type, '.') > 0) AND owner = ? AND name = ? AND home_machine IS NULL
|
|
1743
|
+
AND deleted_at IS ${r?"NOT NULL ORDER BY deleted_at DESC":"NULL"}`).all(e.rowid,n)}function Igi(t,e,n){return n==="node"?ae(t,"SELECT * FROM objects WHERE type = 'node' AND id = ?").all(e):n?ae(t,"SELECT * FROM objects WHERE type = ? AND (name = ? OR id = ?) AND home_machine IS NULL").all(n,e,e):ae(t,`SELECT * FROM objects WHERE (type = 'node' AND id = ?)
|
|
1744
|
+
OR (type IN ('person','app','repo','profile') AND (name = ? OR id = ?) AND home_machine IS NULL)`).all(e,e,e)}function xge(t,e,n,r){let i=n.trim().replace(/^\[\[(.*)\]\]$/,"$1").trim(),o=/^([^:/]+):reports\/(.+?)(?:\.md)?$/.exec(i);o&&!Fvn.test(i)&&(i=`${o[1]}/reports/${o[2]}`);let s=r?.readable??(d=>nl(t,e,d)),a=rl(t,i);if(a&&s(a))return a.deleted_at?{deleted:a}:{object:a};let c=r?.view??pU(t,e);for(let d of c){let p=q6(t,d,i,!1).find(s);if(p)return{object:p}}let u=Fvn.exec(i),l=i.indexOf("/");if(u||l>0){let d=u?u[2]:i.slice(0,l),p=u?u[3]:i.slice(l+1),f=Igi(t,d,u?.[1]),m=x=>{let E=c.findIndex(_=>_.rowid===x.rowid);return E<0?1/0:E},g=f.filter(x=>m(x)<1/0).sort((x,E)=>m(x)-m(E));for(let x of g){let E=q6(t,x,p,!1).find(s);if(E)return{object:E}}let y=f.flatMap(x=>q6(t,x,p,!1)).filter(s);if(y.length===1)return{object:y[0]};if(y.length>1)return{ambiguous:y};let w=f.flatMap(x=>q6(t,x,p,!0)).find(s);return w?{deleted:w}:!u&&f.length===0&&vC(d)?{remote:i}:{missing:!0}}for(let d of c){let p=q6(t,d,i,!0).find(s);if(p)return{deleted:p}}return{missing:!0}}var Fvn,G6=h(()=>{"use strict";Ft();Rr();uh();ls();Fvn=/^(person|app|repo|profile|node):([^/]+)\/(.+)$/});function Uvn(t){return{rowid:t.rowid,object:t.object,owner:t.owner,position:t.position,on:t.on_event,deliver:t.deliver,...t.match_json!==null?{match:JSON.parse(t.match_json)}:{},...t.match_frontmatter_json!==null?{matchFrontmatter:JSON.parse(t.match_frontmatter_json)}:{},...t.if_json!==null?{if:JSON.parse(t.if_json)}:{}}}function fU(t,e){return ae(t,"SELECT * FROM rules WHERE object = ? ORDER BY position").all(e.rowid).map(Uvn)}function Qvn(t,e,n){if(e.length===0||n.length===0)return[];let r=`SELECT * FROM rules WHERE on_event IN (${e.map(()=>"?").join(",")})
|
|
1745
1745
|
AND owner IN (${n.map(()=>"?").join(",")}) ORDER BY object, position`;return t.prepare(r).all(...e,...n).map(Uvn)}var bge=h(()=>{"use strict";Ft()});var Wvn=h(()=>{"use strict"});function IXe(t){return t==="orchestrator"?"\uF0E8":"\uF007"}function Ege(t){let e=(t.description??"").trim(),r=[t.name&&t.name!==t.kind?t.name:"",e].filter(i=>i!=="").join(" ");return r!==""?r:t.name}function Hvn(t){return`${IXe(t.mode)} ${t.kind}`}var z6=h(()=>{"use strict"});var _ge=h(()=>{"use strict";Ft();di();Vx()});var TXe=h(()=>{"use strict";Ft();di();lU();Vo();_ge()});var qvn=h(()=>{"use strict";Ft();di();rw();Vx();TXe()});function RD(t){if(typeof t=="string")return JSON.parse(t)}function Gvn(t){if(t===void 0)return null;let e=RD(t.sweep_observed_json),n=t.attempts,r=e===void 0?void 0:{reason:t.sweep_reason,...t.sweep_detail===null?{}:{detail:t.sweep_detail},observed:e,attempts:n,last_attempt:t.sweep_last_at,next_attempt:t.next_attempt_at,...t.quarantined===1?{quarantined:!0}:{}};return{state:t.state,...t.cleanup_state===null?{}:{cleanup:t.cleanup_state},path:t.path,branch:t.branch,repo_root:t.repo_root,base_ref:t.base_ref,base_sha:t.base_sha,created:t.created_at,...t.closed_at===null?{}:{closed:t.closed_at},...RD(t.abandoned_json)===void 0?{}:{abandoned:RD(t.abandoned_json)},...RD(t.land_intent_json)===void 0?{}:{land_intent:RD(t.land_intent_json)},...r===void 0?{}:{sweep:r},...RD(t.disposal_json)===void 0?{}:{disposal:RD(t.disposal_json)}}}function zvn(t){return Gvn(ae(ir(),"SELECT * FROM worktrees WHERE node_id = ?").get(t))}var vge=h(()=>{"use strict";Ft();di()});function kgi(){let t=new Map;for(let e of Yvn()){let n=e.requester_node_id,r=t.get(n);r===void 0?t.set(n,[e.title]):r.push(e.title)}return t}function Vvn(t){let e=kgi();return Object.fromEntries(t.map(n=>[n,e.get(n)?.length??0]))}var Kvn=h(()=>{"use strict";K6();v0()});var kXe,_Ks,Jvn=h(()=>{"use strict";v0();Kvn();Vo();vme();a6();_o();Co();kXe=class{async getNode(e){return ed(e)}async getRow(e){return DD(e)}async listNodes(e){return Sge(e)}async subscriptionsOf(e){return Cge(e)}async subscribersOf(e){return RXe(e)}async view(e){return V6(e)}async ticketCountsForNodes(e){return Vvn([...e])}async ticketCountsForView(e){return this.ticketCountsForNodes([e,...V6(e)])}async hasActiveLiveSubscription(e){return DXe(e)}},_Ks=new kXe});var Ige=h(()=>{"use strict";Ft();uh();ls()});function MD(t){return Array.isArray(t)?t:t===void 0?[]:[t]}function rb(t,e){return t===e?!0:(typeof t=="number"||typeof t=="string")&&(typeof e=="number"||typeof e=="string")?String(t)===String(e):!1}function Xvn(t,e){if(t&&typeof t=="object"&&e in t)return t[e];if(!e.includes("."))return;let n=t;for(let r of e.split(".")){if(n==null||typeof n!="object")return;n=n[r]}return n}function Rgi(t,e){if(typeof t!="string")return null;try{return new RegExp(t,e)}catch{return null}}function MXe(t,e,n){let r=MD(e);switch(t){case"eq":return Array.isArray(e)?e.some(i=>rb(i,n)):rb(e,n);case"ne":return!MXe("eq",e,n);case"in":return MD(n).some(i=>r.some(o=>rb(o,i)));case"nin":return!MXe("in",e,n);case"exists":return e!==void 0==(n!==!1);case"contains":return r.some(i=>rb(i,n));case"containsAll":return MD(n).every(i=>r.some(o=>rb(o,i)));case"containsAny":return MD(n).some(i=>r.some(o=>rb(o,i)));case"matches":case"imatches":{let i=Rgi(n,t==="imatches"?"i":"");return i?r.some(o=>typeof o=="string"||typeof o=="number"?i.test(String(o)):!1):!1}case"gt":case"gte":case"lt":case"lte":{let i=Number(e),o=Number(n);return Number.isNaN(i)||Number.isNaN(o)?!1:t==="gt"?i>o:t==="gte"?i>=o:t==="lt"?i<o:i<=o}default:return!1}}function Zvn(t,e){if(e===null||["string","number","boolean"].includes(typeof e))return Array.isArray(t)?t.some(n=>rb(n,e)):rb(t,e);if(Array.isArray(e)){let n=MD(t);return e.some(r=>n.some(i=>rb(i,r)))}return e&&typeof e=="object"?Object.entries(e).every(([n,r])=>MXe(n,t,r)):!1}function ib(t,e){if(t==null)return!1;if(Array.isArray(t))return t.every(o=>ib(o,e));if(typeof t!="object")return!1;let n=t;if("all"in n||"any"in n||"not"in n){let o=!0;"all"in n&&(o=o&&MD(n.all).every(s=>ib(s,e))),"any"in n&&(o=o&&MD(n.any).some(s=>ib(s,e))),"not"in n&&(o=o&&!ib(n.not,e));for(let s of Object.keys(n))s==="all"||s==="any"||s==="not"||(o=o&&Zvn(Xvn(e,s),n[s]));return o}let i=Object.keys(n);return i.length===0?!1:i.every(o=>Zvn(Xvn(e,o),n[o]))}var OXe=h(()=>{"use strict"});var NXe=h(()=>{"use strict";Vi();Lme();Vx();_ge()});var PXe=h(()=>{"use strict";_o();lU();Vi();hge();hge()});var eSn=h(()=>{"use strict";Vi();Rr();_ge();PXe()});var LXe=h(()=>{"use strict"});var tSn=h(()=>{"use strict";Vi()});async function nSn(t,e="SIGKILL",n){if(!("ok"in await Pme({operation:"stop",pid:t,signal:e,...n===void 0?{}:{nodeId:n}})))throw new Error("launcher did not stop process")}var BXe=h(()=>{"use strict";oge();v0();Rr();Vi();lU();Vo();Nf();NXe();eSn();LXe();tSn();Lme();Vx()});function Ogi(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return Array.isArray(e)?e.filter(n=>typeof n=="string"):null}catch{return null}}function Ngi(t){return{cron_id:t.cron_id,name:t.name,created_by:t.created_by??null,grantee:t.grantee,sub:t.sub??"user:local",grant_id:t.grant_id??null,scopes:Ogi(t.scopes_json),origin_run_id:t.origin_run_id??null,run_execution_id:t.run_execution_id??null,isolated:Number(t.isolated)!==0,command:t.command,fire_at:t.fire_at,recur:t.recur??null,tz:t.tz??null,expires_at:t.expires_at??null,anchor_node:t.anchor_node??null,cancel_on_wake:Number(t.cancel_on_wake)!==0,cwd:t.cwd,env_json:t.env_json??null,profile:t.profile??null,scope:t.scope,run_timeout_s:Number(t.run_timeout_s),overlap:t.overlap,on_output:t.on_output,sink:t.sink,tier:t.tier,last_output_hash:t.last_output_hash??null,held:Number(t.held)!==0,last_poke_at:t.last_poke_at??null,state:t.state,run_state:t.run_state,run_pid:t.run_pid??null,run_pid_identity:t.run_pid_identity??null,run_started_at:t.run_started_at??null,run_lease_owner:t.run_lease_owner??null,run_out_of_band:Number(t.run_out_of_band)!==0,created:t.created,updated:t.updated}}async function Pgi(t,e="SIGTERM"){if(!$Xe(t))return!1;if(process.platform!=="linux")return glt(t.run_pid,e),!0;try{return await nSn(t.run_pid,e,t.anchor_node??void 0),!0}catch(n){if(!$Xe(t))return!1;throw n}}function Lgi(t,e="SIGTERM"){return $Xe(t)?(Pgi(t,e).catch(n=>{za({level:"error",event:"cron.run.stop_failed",error:n,fields:{cron_id:t.cron_id,pid:t.run_pid}})}),!0):!1}function $Xe(t){let e=t.run_pid;if(e==null||t.run_pid_identity==null)return!1;let n=$be([e]);if(n===null)return!1;let r=n.get(e);return r===void 0?!1:Pbe(r,t.run_pid_identity)}function FXe(t){return Fa(e=>{let n=ae(e,"SELECT * FROM crons WHERE anchor_node = ? AND cancel_on_wake = 1").all(t).map(Ngi);for(let r of n)r.run_state==="running"&&Lgi(r),ae(e,"DELETE FROM crons WHERE cron_id = ?").run(r.cron_id);return n.map(r=>r.cron_id)})}var Tge=h(()=>{"use strict";Ft();di();rw();Su();BXe();Nf()});function UXe(t,e,n,r=ir()){if(e===null)return!1;let i=ae(r,"SELECT wait_id, generation FROM waits WHERE node_id = ? AND kind = 'controller' AND target_id = ? AND satisfied_at IS NULL").get(t,e);return i===void 0?!1:Number(ae(r,"UPDATE waits SET satisfied_at = ? WHERE wait_id = ? AND generation = ? AND satisfied_at IS NULL").run(n,i.wait_id,i.generation).changes)===1}var QXe=h(()=>{"use strict";Ft();di()});import{existsSync as Bgi,mkdirSync as $gi,renameSync as Fgi,writeFileSync as Ugi}from"node:fs";import{randomBytes as Qgi,randomUUID as Wgi}from"node:crypto";import{join as Hgi}from"node:path";function WXe(){let t;do t=Qgi(16).toString("hex");while(t==="00000000000000000000000000000000");return t}function jgi(t,e){let n=JSON.stringify(t);if(n===void 0)throw new TypeError(`${e} must be JSON-serializable`);return n}function rSn(t,e){return e!=="normal"&&e!=="deferred"?e:DD(t)?.lifecycle==="terminal"?"urgent":e}function qgi(t,e,n){let r=Pat(t);Bgi(r)||$gi(r,{recursive:!0});let i=e.replace(/[^0-9]/g,""),o=Hgi(r,`${i}-${Wgi().slice(0,6)}.md`),s=`${o}.tmp`;return Ugi(s,n,"utf8"),JM(s),Fgi(s,o),my(r),o}function Ggi(t){if(typeof t!="object"||t===null)return"";let e=t.body;return typeof e=="string"?e.trim():""}function HXe(t,e){let n=e.messageId??WXe(),r=Number(ae(t,"UPDATE message_sequence SET seq = seq + 1 WHERE id = 1 RETURNING seq").get().seq);return ae(t,`INSERT INTO messages
|
|
1746
1746
|
(message_id, seq, operation_id, created_at, sender_node_id, sender_name, kind, label, body_ref, body_json, disposition,
|
|
1747
1747
|
event, object_id, level, actor_id, cause_message_id, depth)
|
|
1748
1748
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n,r,e.operationId,e.createdAt,e.senderNodeId,e.senderName,e.kind,e.label,e.bodyRef,e.bodyJson===void 0?null:jgi(e.bodyJson,"message body"),e.disposition,e.event?.event??null,e.event?.objectId??null,e.event?.level??null,e.event?.actorId??null,e.causeMessageId??null,e.depth??0),n}function jXe(t,e){let n=new Date().toISOString(),r=t.operationId===void 0?LQ.current()??PQ():kb(t.operationId),i=t.bodyRef??null,o=t.bodyJson;if(i===null&&e!==null&&t.senderNodeId!=="human"){let s=Ggi(o),a=ect(s);a.clipped&&(i=qgi(e,n,s),o={...o,body:a.text})}return{createdAt:n,operationId:r,bodyRef:i,bodyJson:o}}function iSn(t){switch(t){case"interrupt":return{urgency:"critical",wake:1};case"steer":return{urgency:"urgent",wake:1};case"after-turn":return{urgency:"normal",wake:1};case"next-turn":return{urgency:"deferred",wake:0}}}var kge=h(()=>{"use strict";Ft();Tge();di();v0();Rr();Go();QXe();BQ();j9()});import{existsSync as zgi}from"node:fs";function Rge(t,e,n,r){let i=e===null?[]:r.projectPaths(e),o=n(t),s=new Set(o.map(c=>c.repo.rowid)),a=[];for(let c of i){if(!zgi(c))continue;let u;try{u=n(c)}catch(l){if(l instanceof hi&&l.code==="git-lookup-failed")continue;throw l}for(let l of u)s.has(l.repo.rowid)||(s.add(l.repo.rowid),a.push(l))}return{repos:o.map(c=>c.repo),checkouts:o,projectRepos:a.map(c=>c.repo),projectCheckouts:a}}function oSn(t,e,n,r=mU(t),i=!1){let o=ae(t,"SELECT o.* FROM objects o WHERE o.id = ? AND o.type = 'node'").get(e),s=ae(t,`SELECT (SELECT external_id FROM identities WHERE object = ?) AS grantee,
|
|
1749
|
-
sub, grant_id, scopes_json, cwd, profile_id FROM nodes WHERE node_id = ?`).get(o?.owner??null,e);if(!o||!s)throw new Error(`no node ${e}`);let{grantee:a,sub:c,grant_id:u,scopes_json:l,cwd:d,profile_id:p}=s,f=o.owner===null?null:r.object(o.owner);if(!f)throw new Error(`node ${e} has no owner`);let m=l===null?null:JSON.parse(l);return{class:"node",node:o,app:f,scopes:Kgi(a,c??"",u,m,r,i),launched:m,cwd:d,...Rge(d,p,n,r),profile:p===null?null:r.profile(p,f)}}function sSn(t,e,n=()=>[],r=mU(t)){let i=ae(t,"SELECT envelope_json FROM peer_stubs WHERE object = ?").get(e.rowid);if(i!==void 0)return Vgi(t,e,i.envelope_json===null?null:JSON.parse(i.envelope_json),r);if(e.type==="node")return oSn(t,e.id,n,r,!0);let o=e.owner===null?null:r.object(e.owner);if(!o)throw new Error(`watcher ${e.id} has no owner`);let a=(o.type==="app"?o:o.type==="profile"&&o.owner!==null?r.object(o.owner):null)??ae(t,"SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object WHERE i.external_id = 'app:terminal' AND i.scheme = 'app'").get()??ae(t,"SELECT * FROM objects WHERE type = 'person' AND name = 'user'").get();if(!a)throw new Error("no terminal app or person object");let c=ae(t,"SELECT external_id FROM identities WHERE object = ? AND scheme = 'app'").get(a.rowid)?.external_id??"app:terminal",u=ae(t,"SELECT resolved_scopes_json FROM grants WHERE grantee = ? AND status = 'active'").all(c),l=o.type==="person"?null:u.length===0?c==="app:terminal"&&!r.terminalHasIssuer()?kD:r.pluginScopes(c):u.length===1?JSON.parse(u[0].resolved_scopes_json).filter(d=>d.mode==="always").map(d=>KU(d.scope)):null;return{class:"object",object:e,node:e,owner:o,app:a,scopes:l,repos:o.type==="repo"?[o]:[]}}function aSn(t,e,n){let r=ae(t,"SELECT external_id FROM identities WHERE object = ? AND scheme = 'app'").get(e.rowid)?.external_id;if(r===void 0)return null;let i=ae(t,"SELECT resolved_scopes_json FROM grants WHERE grantee = ? AND status = 'active'").all(r);return i.length===0?r==="app:terminal"&&!n.terminalHasIssuer()?kD:n.pluginScopes(r):i.length>1?null:JSON.parse(i[0].resolved_scopes_json).filter(o=>o.mode==="always").map(o=>KU(o.scope))}function Vgi(t,e,n,r){let i=uSn(t);if(n!==null&&n.app===null)return{class:"object",object:e,node:e,owner:i,app:i,scopes:null,repos:[]};let o=n?.app==null?null:Ygi(t,n.app),s=n?.app==null?null:r.grantFor(n.app,n.sub),a=n===null||s===null?null:n.node_scopes===null?s.resolved:n.node_scopes.filter(u=>JV(s.resolved,u)),c=o??(e.owner===null?i:r.object(e.owner)??i);return{class:"object",object:e,node:e,owner:c,app:c,scopes:a,launched:n?.node_scopes??null,repos:[],...n?.place==null?{}:{place:n.place}}}function mU(t){return{grantById:Q6,grantFor:sge,terminalHasIssuer:()=>!!zo("user").runtime?.issuer,pluginScopes:e=>N0n(e.replace(/^app:/,""))?.scopes??null,object:e=>dc(t,e),profile:(e,n)=>lSn(t,e,n),projectPaths:e=>$0()?[]:nW(Ks(),e)?.manifest.projects.map(n=>n.path)??[]}}function cSn(t){let e=mU(t),n=new Map,r=(i,o)=>(n.has(i)||n.set(i,o()),n.get(i));return{grantById:i=>r(`g\0${i}`,()=>e.grantById(i)),grantFor:(i,o)=>r(`a\0${i}\0${o}`,()=>e.grantFor(i,o)),terminalHasIssuer:()=>r("issuer",()=>e.terminalHasIssuer()),pluginScopes:i=>r(`t\0${i}`,()=>e.pluginScopes(i)),object:i=>r(`o\0${i}`,()=>e.object(i)),profile:(i,o)=>r(`p\0${i}\0${o.rowid}`,()=>e.profile(i,o)),projectPaths:i=>r(`j\0${i}`,()=>e.projectPaths(i))}}function Kgi(t,e,n,r,i,o=!1){let s=n?i.grantById(n):i.grantFor(t,e),a=s&&s.grantee===t?s.resolved:t==="app:terminal"&&!i.terminalHasIssuer()?kD:null;if(a===null){if(o)return null;throw new Error(`the grant of ${t} is not active`)}return r===null?a:r.filter(c=>JV(a,c))}function uSn(t){return OD(t,"person","local-user","user:local","user")}function Ygi(t,e){return e==="user:local"?uSn(t):OD(t,"app","app",e,e.replace(/^app:/,""))}function lSn(t,e,n){return ae(t,`SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1749
|
+
sub, grant_id, scopes_json, cwd, profile_id FROM nodes WHERE node_id = ?`).get(o?.owner??null,e);if(!o||!s)throw new Error(`no node ${e}`);let{grantee:a,sub:c,grant_id:u,scopes_json:l,cwd:d,profile_id:p}=s,f=o.owner===null?null:r.object(o.owner);if(!f)throw new Error(`node ${e} has no owner`);let m=l===null?null:JSON.parse(l);return{class:"node",node:o,app:f,scopes:Kgi(a,c??"",u,m,r,i),launched:m,cwd:d,...Rge(d,p,n,r),profile:p===null?null:r.profile(p,f)}}function sSn(t,e,n=()=>[],r=mU(t)){let i=ae(t,"SELECT envelope_json FROM peer_stubs WHERE object = ?").get(e.rowid);if(i!==void 0)return Vgi(t,e,i.envelope_json===null?null:JSON.parse(i.envelope_json),r);if(e.type==="node")return oSn(t,e.id,n,r,!0);let o=e.owner===null?null:r.object(e.owner);if(!o)throw new Error(`watcher ${e.id} has no owner`);let a=(o.type==="app"?o:o.type==="profile"&&o.owner!==null?r.object(o.owner):null)??ae(t,"SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object WHERE i.external_id = 'app:terminal' AND i.scheme = 'app'").get()??ae(t,"SELECT * FROM objects WHERE type = 'person' AND name = 'user' AND home_machine IS NULL").get();if(!a)throw new Error("no terminal app or person object");let c=ae(t,"SELECT external_id FROM identities WHERE object = ? AND scheme = 'app'").get(a.rowid)?.external_id??"app:terminal",u=ae(t,"SELECT resolved_scopes_json FROM grants WHERE grantee = ? AND status = 'active'").all(c),l=o.type==="person"?null:u.length===0?c==="app:terminal"&&!r.terminalHasIssuer()?kD:r.pluginScopes(c):u.length===1?JSON.parse(u[0].resolved_scopes_json).filter(d=>d.mode==="always").map(d=>KU(d.scope)):null;return{class:"object",object:e,node:e,owner:o,app:a,scopes:l,repos:o.type==="repo"?[o]:[]}}function aSn(t,e,n){let r=ae(t,"SELECT external_id FROM identities WHERE object = ? AND scheme = 'app'").get(e.rowid)?.external_id;if(r===void 0)return null;let i=ae(t,"SELECT resolved_scopes_json FROM grants WHERE grantee = ? AND status = 'active'").all(r);return i.length===0?r==="app:terminal"&&!n.terminalHasIssuer()?kD:n.pluginScopes(r):i.length>1?null:JSON.parse(i[0].resolved_scopes_json).filter(o=>o.mode==="always").map(o=>KU(o.scope))}function Vgi(t,e,n,r){let i=uSn(t);if(n!==null&&n.app===null)return{class:"object",object:e,node:e,owner:i,app:i,scopes:null,repos:[]};let o=n?.app==null?null:Ygi(t,n.app),s=n?.app==null?null:r.grantFor(n.app,n.sub),a=n===null||s===null?null:n.node_scopes===null?s.resolved:n.node_scopes.filter(u=>JV(s.resolved,u)),c=o??(e.owner===null?i:r.object(e.owner)??i);return{class:"object",object:e,node:e,owner:c,app:c,scopes:a,launched:n?.node_scopes??null,repos:[],...n?.place==null?{}:{place:n.place}}}function mU(t){return{grantById:Q6,grantFor:sge,terminalHasIssuer:()=>!!zo("user").runtime?.issuer,pluginScopes:e=>N0n(e.replace(/^app:/,""))?.scopes??null,object:e=>dc(t,e),profile:(e,n)=>lSn(t,e,n),projectPaths:e=>$0()?[]:nW(Ks(),e)?.manifest.projects.map(n=>n.path)??[]}}function cSn(t){let e=mU(t),n=new Map,r=(i,o)=>(n.has(i)||n.set(i,o()),n.get(i));return{grantById:i=>r(`g\0${i}`,()=>e.grantById(i)),grantFor:(i,o)=>r(`a\0${i}\0${o}`,()=>e.grantFor(i,o)),terminalHasIssuer:()=>r("issuer",()=>e.terminalHasIssuer()),pluginScopes:i=>r(`t\0${i}`,()=>e.pluginScopes(i)),object:i=>r(`o\0${i}`,()=>e.object(i)),profile:(i,o)=>r(`p\0${i}\0${o.rowid}`,()=>e.profile(i,o)),projectPaths:i=>r(`j\0${i}`,()=>e.projectPaths(i))}}function Kgi(t,e,n,r,i,o=!1){let s=n?i.grantById(n):i.grantFor(t,e),a=s&&s.grantee===t?s.resolved:t==="app:terminal"&&!i.terminalHasIssuer()?kD:null;if(a===null){if(o)return null;throw new Error(`the grant of ${t} is not active`)}return r===null?a:r.filter(c=>JV(a,c))}function uSn(t){return OD(t,"person","local-user","user:local","user")}function Ygi(t,e){return e==="user:local"?uSn(t):OD(t,"app","app",e,e.replace(/^app:/,""))}function lSn(t,e,n){return ae(t,`SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1750
1750
|
WHERE i.scheme = 'profile' AND i.external_id = ?`).get(e)??OD(t,"profile","profile",e,MC(e).manifest.name,n)}var Y6=h(()=>{"use strict";Ft();_o();Co();sK();fd();B0();lU();di();ld();Vo();EYe();U6();Su();ls()});var qXe=h(()=>{"use strict";di();OS();NS();pge();ls();Y6()});var pSn=$(dSn=>{"use strict";Object.defineProperty(dSn,"__esModule",{value:!0})});var PS=$(Dge=>{"use strict";Object.defineProperty(Dge,"__esModule",{value:!0});Dge.CronField=void 0;var GXe=class t{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:""};static get min(){throw new Error("min must be overridden")}static get max(){throw new Error("max must be overridden")}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(e,n={rawValue:""}){if(!Array.isArray(e))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(e.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??""},this.#r=e.sort(t.sorter),this.#n=this.options.wildcard!==void 0?this.options.wildcard:this.#o(),this.#e=this.options.rawValue.includes("L")||e.includes("L"),this.#t=this.options.rawValue.includes("?")||e.includes("?")}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,n){let r=typeof e=="number",i=typeof n=="number";return r&&i?e-n:!r&&!i?e.localeCompare(n):r?-1:1}static findNearestValueInList(e,n,r){if(r){for(let i=e.length-1;i>=0;i--)if(e[i]<n)return e[i];return null}for(let i=0;i<e.length;i++)if(e[i]>n)return e[i];return null}findNearestValue(e,n){return this.constructor.findNearestValueInList(this.values,e,n)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,n=this.chars.length>0?` or chars ${this.chars.join("")}`:"",r=a=>c=>new RegExp(`^\\d{0,2}${c}$`).test(a),i=a=>(e=a,typeof a=="number"?a>=this.min&&a<=this.max:this.chars.some(r(a)));if(!this.#r.every(i))throw new Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${n}`);let s=this.#r.find((a,c)=>this.#r.indexOf(a)!==c);if(s)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${s}`)}#o(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,n)=>n+this.min).every(e=>this.#r.includes(e))}};Dge.CronField=GXe});var fSn=$(Mge=>{"use strict";Object.defineProperty(Mge,"__esModule",{value:!0});Mge.CronDayOfMonth=void 0;var Xgi=PS(),Zgi=1,eyi=31,tyi=Object.freeze(["L"]),zXe=class extends Xgi.CronField{static get min(){return Zgi}static get max(){return eyi}static get chars(){return tyi}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}};Mge.CronDayOfMonth=zXe});var mSn=$(Oge=>{"use strict";Object.defineProperty(Oge,"__esModule",{value:!0});Oge.CronDayOfWeek=void 0;var nyi=PS(),ryi=0,iyi=7,oyi=Object.freeze(["L"]),VXe=class extends nyi.CronField{static get min(){return ryi}static get max(){return iyi}static get chars(){return oyi}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};Oge.CronDayOfWeek=VXe});var hSn=$(Nge=>{"use strict";Object.defineProperty(Nge,"__esModule",{value:!0});Nge.CronHour=void 0;var syi=PS(),ayi=0,cyi=23,uyi=Object.freeze([]),KXe=class extends syi.CronField{static get min(){return ayi}static get max(){return cyi}static get chars(){return uyi}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}};Nge.CronHour=KXe});var gSn=$(Pge=>{"use strict";Object.defineProperty(Pge,"__esModule",{value:!0});Pge.CronMinute=void 0;var lyi=PS(),dyi=0,pyi=59,fyi=Object.freeze([]),YXe=class extends lyi.CronField{static get min(){return dyi}static get max(){return pyi}static get chars(){return fyi}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}};Pge.CronMinute=YXe});var GCn=$(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var sb=class extends Error{},sZe=class extends sb{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},aZe=class extends sb{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},cZe=class extends sb{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},$S=class extends sb{},Hge=class extends sb{constructor(e){super(`Invalid unit ${e}`)}},jc=class extends sb{},S0=class extends sb{constructor(){super("Zone is an abstract class")}},Et="numeric",oy="short",wf="long",jge={year:Et,month:Et,day:Et},zSn={year:Et,month:oy,day:Et},myi={year:Et,month:oy,day:Et,weekday:oy},VSn={year:Et,month:wf,day:Et},KSn={year:Et,month:wf,day:Et,weekday:wf},YSn={hour:Et,minute:Et},JSn={hour:Et,minute:Et,second:Et},XSn={hour:Et,minute:Et,second:Et,timeZoneName:oy},ZSn={hour:Et,minute:Et,second:Et,timeZoneName:wf},eCn={hour:Et,minute:Et,hourCycle:"h23"},tCn={hour:Et,minute:Et,second:Et,hourCycle:"h23"},nCn={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:oy},rCn={hour:Et,minute:Et,second:Et,hourCycle:"h23",timeZoneName:wf},iCn={year:Et,month:Et,day:Et,hour:Et,minute:Et},oCn={year:Et,month:Et,day:Et,hour:Et,minute:Et,second:Et},sCn={year:Et,month:oy,day:Et,hour:Et,minute:Et},aCn={year:Et,month:oy,day:Et,hour:Et,minute:Et,second:Et},hyi={year:Et,month:oy,day:Et,weekday:oy,hour:Et,minute:Et},cCn={year:Et,month:wf,day:Et,hour:Et,minute:Et,timeZoneName:oy},uCn={year:Et,month:wf,day:Et,hour:Et,minute:Et,second:Et,timeZoneName:oy},lCn={year:Et,month:wf,day:Et,weekday:wf,hour:Et,minute:Et,timeZoneName:wf},dCn={year:Et,month:wf,day:Et,weekday:wf,hour:Et,minute:Et,second:Et,timeZoneName:wf},US=class{get type(){throw new S0}get name(){throw new S0}get ianaName(){return this.name}get isUniversal(){throw new S0}offsetName(e,n){throw new S0}formatOffset(e,n){throw new S0}offset(e){throw new S0}equals(e){throw new S0}get isValid(){throw new S0}},JXe=null,rV=class t extends US{static get instance(){return JXe===null&&(JXe=new t),JXe}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return ECn(e,n,r)}formatOffset(e,n){return nV(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}},uZe=new Map;function gyi(t){let e=uZe.get(t);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),uZe.set(t,e)),e}var yyi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ayi(t,e){let n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,c,u,l]=r;return[s,i,o,a,c,u,l]}function wyi(t,e){let n=t.formatToParts(e),r=[];for(let i=0;i<n.length;i++){let{type:o,value:s}=n[i],a=yyi[o];o==="era"?r[a]=s:Hn(a)||(r[a]=parseInt(s,10))}return r}var XXe=new Map,ab=class t extends US{static create(e){let n=XXe.get(e);return n===void 0&&XXe.set(e,n=new t(e)),n}static resetCache(){XXe.clear(),uZe.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=t.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return ECn(e,n,r,this.name)}formatOffset(e,n){return nV(this.offset(e),n)}offset(e){if(!this.valid)return NaN;let n=new Date(e);if(isNaN(n))return NaN;let r=gyi(this.name),[i,o,s,a,c,u,l]=r.formatToParts?wyi(r,n):Ayi(r,n);a==="BC"&&(i=-Math.abs(i)+1);let p=Jge({year:i,month:o,day:s,hour:c===24?0:c,minute:u,second:l,millisecond:0}),f=+n,m=f%1e3;return f-=m>=0?m:1e3+m,(p-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}},ySn={};function xyi(t,e={}){let n=JSON.stringify([t,e]),r=ySn[n];return r||(r=new Intl.ListFormat(t,e),ySn[n]=r),r}var lZe=new Map;function dZe(t,e={}){let n=JSON.stringify([t,e]),r=lZe.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(t,e),lZe.set(n,r)),r}var pZe=new Map;function byi(t,e={}){let n=JSON.stringify([t,e]),r=pZe.get(n);return r===void 0&&(r=new Intl.NumberFormat(t,e),pZe.set(n,r)),r}var fZe=new Map;function Eyi(t,e={}){let{base:n,...r}=e,i=JSON.stringify([t,r]),o=fZe.get(i);return o===void 0&&(o=new Intl.RelativeTimeFormat(t,e),fZe.set(i,o)),o}var Z6=null;function _yi(){return Z6||(Z6=new Intl.DateTimeFormat().resolvedOptions().locale,Z6)}var mZe=new Map;function pCn(t){let e=mZe.get(t);return e===void 0&&(e=new Intl.DateTimeFormat(t).resolvedOptions(),mZe.set(t,e)),e}var hZe=new Map;function vyi(t){let e=hZe.get(t);if(!e){let n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in e||(e={...fCn,...e}),hZe.set(t,e)}return e}function Syi(t){let e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));let n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=dZe(t).resolvedOptions(),i=t}catch{let c=t.substring(0,n);r=dZe(c).resolvedOptions(),i=c}let{numberingSystem:o,calendar:s}=r;return[i,o,s]}}function Cyi(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Iyi(t){let e=[];for(let n=1;n<=12;n++){let r=ds.utc(2009,n,1);e.push(t(r))}return e}function Tyi(t){let e=[];for(let n=1;n<=7;n++){let r=ds.utc(2016,11,13+n);e.push(t(r))}return e}function Lge(t,e,n,r){let i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function kyi(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||pCn(t.locale).numberingSystem==="latn"}var gZe=class{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;let{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){let a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=byi(e,a)}}format(e){if(this.inf){let n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{let n=this.floor?Math.floor(e):IZe(e,3);return Ua(n,this.padTo)}}},yZe=class{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){let s=-1*(e.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&ab.create(a).valid?(i=a,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=dZe(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){let r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},AZe=class{constructor(e,n,r){this.opts={style:"long",...r},!n&&xCn()&&(this.rtf=Eyi(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):Yyi(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}},fCn={firstDay:1,minimalDays:4,weekend:[6,7]},uo=class t{static fromOpts(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,o=!1){let s=e||jo.defaultLocale,a=s||(o?"en-US":_yi()),c=n||jo.defaultNumberingSystem,u=r||jo.defaultOutputCalendar,l=xZe(i)||jo.defaultWeekSettings;return new t(a,c,u,l,s)}static resetCache(){Z6=null,lZe.clear(),pZe.clear(),fZe.clear(),mZe.clear(),hZe.clear()}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return t.create(e,n,r,i)}constructor(e,n,r,i,o){let[s,a,c]=Syi(e);this.locale=s,this.numberingSystem=n||a||null,this.outputCalendar=r||c||null,this.weekSettings=i,this.intl=Cyi(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=kyi(this)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,xZe(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Lge(this,e,SCn,()=>{let r=this.intl==="ja"||this.intl.startsWith("ja-");n&=!r;let i=n?{month:e,day:"numeric"}:{month:e},o=n?"format":"standalone";if(!this.monthsCache[o][e]){let s=r?a=>this.dtFormatter(a,i).format():a=>this.extract(a,i,"month");this.monthsCache[o][e]=Iyi(s)}return this.monthsCache[o][e]})}weekdays(e,n=!1){return Lge(this,e,TCn,()=>{let r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=Tyi(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Lge(this,void 0,()=>kCn,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ds.utc(2016,11,13,9),ds.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Lge(this,e,RCn,()=>{let n={era:e};return this.eraCache[e]||(this.eraCache[e]=[ds.utc(-40,1,1),ds.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){let i=this.dtFormatter(e,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(e={}){return new gZe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new yZe(e,this.intl,n)}relFormatter(e={}){return new AZe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return xyi(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||pCn(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bCn()?vyi(this.locale):fCn}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},ZXe=null,xf=class t extends US{static get utcInstance(){return ZXe===null&&(ZXe=new t(0)),ZXe}static instance(e){return e===0?t.utcInstance:new t(e)}static parseSpecifier(e){if(e){let n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(Xge(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${nV(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${nV(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return nV(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}},qge=class extends US{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function BS(t,e){if(Hn(t)||t===null)return e;if(t instanceof US)return t;if(Pyi(t)){let n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?rV.instance:n==="utc"||n==="gmt"?xf.utcInstance:xf.parseSpecifier(n)||ab.create(t)}else return FS(t)?xf.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new qge(t)}var _Ze={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ASn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ryi=_Ze.hanidec.replace(/[\[|\]]/g,"").split("");function Dyi(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(t[n].search(_Ze.hanidec)!==-1)e+=Ryi.indexOf(t[n]);else for(let i in ASn){let[o,s]=ASn[i];r>=o&&r<=s&&(e+=r-o)}}return parseInt(e,10)}else return e}var wZe=new Map;function Myi(){wZe.clear()}function ry({numberingSystem:t},e=""){let n=t||"latn",r=wZe.get(n);r===void 0&&(r=new Map,wZe.set(n,r));let i=r.get(e);return i===void 0&&(i=new RegExp(`${_Ze[n]}${e}`),r.set(e,i)),i}var wSn=()=>Date.now(),xSn="system",bSn=null,ESn=null,_Sn=null,vSn=60,SSn,CSn=null,jo=class{static get now(){return wSn}static set now(e){wSn=e}static set defaultZone(e){xSn=e}static get defaultZone(){return BS(xSn,rV.instance)}static get defaultLocale(){return bSn}static set defaultLocale(e){bSn=e}static get defaultNumberingSystem(){return ESn}static set defaultNumberingSystem(e){ESn=e}static get defaultOutputCalendar(){return _Sn}static set defaultOutputCalendar(e){_Sn=e}static get defaultWeekSettings(){return CSn}static set defaultWeekSettings(e){CSn=xZe(e)}static get twoDigitCutoffYear(){return vSn}static set twoDigitCutoffYear(e){vSn=e%100}static get throwOnInvalid(){return SSn}static set throwOnInvalid(e){SSn=e}static resetCaches(){uo.resetCache(),ab.resetCache(),ds.resetCache(),Myi()}},Af=class{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},mCn=[0,31,59,90,120,151,181,212,243,273,304,334],hCn=[0,31,60,91,121,152,182,213,244,274,305,335];function dh(t,e){return new Af("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function vZe(t,e,n){let r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function gCn(t,e,n){return n+(oV(t)?hCn:mCn)[e-1]}function yCn(t,e){let n=oV(t)?hCn:mCn,r=n.findIndex(o=>o<e),i=e-n[r];return{month:r+1,day:i}}function SZe(t,e){return(t-e+7)%7+1}function Gge(t,e=4,n=1){let{year:r,month:i,day:o}=t,s=gCn(r,i,o),a=SZe(vZe(r,i,o),n),c=Math.floor((s-a+14-e)/7),u;return c<1?(u=r-1,c=iV(u,e,n)):c>iV(r,e,n)?(u=r+1,c=1):u=r,{weekYear:u,weekNumber:c,weekday:a,...Zge(t)}}function ISn(t,e=4,n=1){let{weekYear:r,weekNumber:i,weekday:o}=t,s=SZe(vZe(r,1,e),n),a=wU(r),c=i*7+o-s-7+e,u;c<1?(u=r-1,c+=wU(u)):c>a?(u=r+1,c-=wU(r)):u=r;let{month:l,day:d}=yCn(u,c);return{year:u,month:l,day:d,...Zge(t)}}function eZe(t){let{year:e,month:n,day:r}=t,i=gCn(e,n,r);return{year:e,ordinal:i,...Zge(t)}}function TSn(t){let{year:e,ordinal:n}=t,{month:r,day:i}=yCn(e,n);return{year:e,month:r,day:i,...Zge(t)}}function kSn(t,e){if(!Hn(t.localWeekday)||!Hn(t.localWeekNumber)||!Hn(t.localWeekYear)){if(!Hn(t.weekday)||!Hn(t.weekNumber)||!Hn(t.weekYear))throw new $S("Cannot mix locale-based week fields with ISO-based week fields");return Hn(t.localWeekday)||(t.weekday=t.localWeekday),Hn(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Hn(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Oyi(t,e=4,n=1){let r=Yge(t.weekYear),i=ph(t.weekNumber,1,iV(t.weekYear,e,n)),o=ph(t.weekday,1,7);return r?i?o?!1:dh("weekday",t.weekday):dh("week",t.weekNumber):dh("weekYear",t.weekYear)}function Nyi(t){let e=Yge(t.year),n=ph(t.ordinal,1,wU(t.year));return e?n?!1:dh("ordinal",t.ordinal):dh("year",t.year)}function ACn(t){let e=Yge(t.year),n=ph(t.month,1,12),r=ph(t.day,1,zge(t.year,t.month));return e?n?r?!1:dh("day",t.day):dh("month",t.month):dh("year",t.year)}function wCn(t){let{hour:e,minute:n,second:r,millisecond:i}=t,o=ph(e,0,23)||e===24&&n===0&&r===0&&i===0,s=ph(n,0,59),a=ph(r,0,59),c=ph(i,0,999);return o?s?a?c?!1:dh("millisecond",i):dh("second",r):dh("minute",n):dh("hour",e)}function Hn(t){return typeof t>"u"}function FS(t){return typeof t=="number"}function Yge(t){return typeof t=="number"&&t%1===0}function Pyi(t){return typeof t=="string"}function Lyi(t){return Object.prototype.toString.call(t)==="[object Date]"}function xCn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bCn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Byi(t){return Array.isArray(t)?t:[t]}function RSn(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{let o=[e(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function $yi(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function bU(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xZe(t){if(t==null)return null;if(typeof t!="object")throw new jc("Week settings must be an object");if(!ph(t.firstDay,1,7)||!ph(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!ph(e,1,7)))throw new jc("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function ph(t,e,n){return Yge(t)&&t>=e&&t<=n}function Fyi(t,e){return t-e*Math.floor(t/e)}function Ua(t,e=2){let n=t<0,r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function LS(t){if(!(Hn(t)||t===null||t===""))return parseInt(t,10)}function ND(t){if(!(Hn(t)||t===null||t===""))return parseFloat(t)}function CZe(t){if(!(Hn(t)||t===null||t==="")){let e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function IZe(t,e,n="round"){let r=10**e;switch(n){case"expand":return t>0?Math.ceil(t*r)/r:Math.floor(t*r)/r;case"trunc":return Math.trunc(t*r)/r;case"round":return Math.round(t*r)/r;case"floor":return Math.floor(t*r)/r;case"ceil":return Math.ceil(t*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function oV(t){return t%4===0&&(t%100!==0||t%400===0)}function wU(t){return oV(t)?366:365}function zge(t,e){let n=Fyi(e-1,12)+1,r=t+(e-n)/12;return n===2?oV(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Jge(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function DSn(t,e,n){return-SZe(vZe(t,1,e),n)+e-1}function iV(t,e=4,n=1){let r=DSn(t,e,n),i=DSn(t+1,e,n);return(wU(t)-r+i)/7}function bZe(t){return t>99?t:t>jo.twoDigitCutoffYear?1900+t:2e3+t}function ECn(t,e,n,r=null){let i=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);let s={timeZoneName:e,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(c=>c.type.toLowerCase()==="timezonename");return a?a.value:null}function Xge(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);let r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function _Cn(t){let e=Number(t);if(typeof t=="boolean"||t===""||!Number.isFinite(e))throw new jc(`Invalid unit value ${t}`);return e}function Vge(t,e){let n={};for(let r in t)if(bU(t,r)){let i=t[r];if(i==null)continue;n[e(r)]=_Cn(i)}return n}function nV(t,e){let n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Ua(n,2)}:${Ua(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ua(n,2)}${Ua(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Zge(t){return $yi(t,["hour","minute","second","millisecond"])}var Uyi=["January","February","March","April","May","June","July","August","September","October","November","December"],vCn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Qyi=["J","F","M","A","M","J","J","A","S","O","N","D"];function SCn(t){switch(t){case"narrow":return[...Qyi];case"short":return[...vCn];case"long":return[...Uyi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var CCn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ICn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wyi=["M","T","W","T","F","S","S"];function TCn(t){switch(t){case"narrow":return[...Wyi];case"short":return[...ICn];case"long":return[...CCn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var kCn=["AM","PM"],Hyi=["Before Christ","Anno Domini"],jyi=["BC","AD"],qyi=["B","A"];function RCn(t){switch(t){case"narrow":return[...qyi];case"short":return[...jyi];case"long":return[...Hyi];default:return null}}function Gyi(t){return kCn[t.hour<12?0:1]}function zyi(t,e){return TCn(e)[t.weekday-1]}function Vyi(t,e){return SCn(e)[t.month-1]}function Kyi(t,e){return RCn(e)[t.year<0?0:1]}function Yyi(t,e,n="always",r=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&o){let d=t==="days";switch(e){case 1:return d?"tomorrow":`next ${i[t][0]}`;case-1:return d?"yesterday":`last ${i[t][0]}`;case 0:return d?"today":`this ${i[t][0]}`}}let s=Object.is(e,-0)||e<0,a=Math.abs(e),c=a===1,u=i[t],l=r?c?u[1]:u[2]||u[1]:c?i[t][0]:t;return s?`${a} ${l} ago`:`in ${a} ${l}`}function MSn(t,e){let n="";for(let r of t)r.literal?n+=r.val:n+=e(r.val);return n}var Jyi={D:jge,DD:zSn,DDD:VSn,DDDD:KSn,t:YSn,tt:JSn,ttt:XSn,tttt:ZSn,T:eCn,TT:tCn,TTT:nCn,TTTT:rCn,f:iCn,ff:sCn,fff:cCn,ffff:lCn,F:oCn,FF:aCn,FFF:uCn,FFFF:dCn},yf=class t{static create(e,n={}){return new t(e,n)}static parseFormat(e){let n=null,r="",i=!1,o=[];for(let s=0;s<e.length;s++){let a=e.charAt(s);a==="'"?((r.length>0||i)&&o.push({literal:i||/^\s+$/.test(r),val:r===""?"'":r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(e){return Jyi[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0,r=void 0){if(this.opts.forceSimple)return Ua(e,n);let i={...this.opts};return n>0&&(i.padTo=n),r&&(i.signDisplay=r),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,n){let r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(f,m)=>this.loc.extract(e,f,m),s=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",a=()=>r?Gyi(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(f,m)=>r?Vyi(e,f):o(m?{month:f}:{month:f,day:"numeric"},"month"),u=(f,m)=>r?zyi(e,f):o(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),l=f=>{let m=t.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(e,m):f},d=f=>r?Kyi(e,f):o({era:f},"era"),p=f=>{switch(f){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(e.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(f)}};return MSn(t.parseFormat(n),p)}formatDurationFromString(e,n){let r=this.opts.signMode==="negativeLargestOnly"?-1:1,i=l=>{switch(l[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},o=(l,d)=>p=>{let f=i(p);if(f){let m=d.isNegativeDuration&&f!==d.largestUnit?r:1,g;return this.opts.signMode==="negativeLargestOnly"&&f!==d.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(l.get(f)*m,p.length,g)}else return p},s=t.parseFormat(n),a=s.reduce((l,{literal:d,val:p})=>d?l:l.concat(p),[]),c=e.shiftTo(...a.map(i).filter(l=>l)),u={isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]};return MSn(s,o(c,u))}},DCn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function EU(...t){let e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function _U(...t){return e=>t.reduce(([n,r,i],o)=>{let[s,a,c]=o(e,i);return[{...n,...s},a||r,c]},[{},null,1]).slice(0,2)}function vU(t,...e){if(t==null)return[null,null];for(let[n,r]of e){let i=n.exec(t);if(i)return r(i)}return[null,null]}function MCn(...t){return(e,n)=>{let r={},i;for(i=0;i<t.length;i++)r[t[i]]=LS(e[n+i]);return[r,null,n+i]}}var OCn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Xyi=`(?:${OCn.source}?(?:\\[(${DCn.source})\\])?)?`,TZe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,NCn=RegExp(`${TZe.source}${Xyi}`),kZe=RegExp(`(?:[Tt]${NCn.source})?`),Zyi=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,eAi=/(\d{4})-?W(\d\d)(?:-?(\d))?/,tAi=/(\d{4})-?(\d{3})/,nAi=MCn("weekYear","weekNumber","weekDay"),rAi=MCn("year","ordinal"),iAi=/(\d{4})-(\d\d)-(\d\d)/,PCn=RegExp(`${TZe.source} ?(?:${OCn.source}|(${DCn.source}))?`),oAi=RegExp(`(?: ${PCn.source})?`);function xU(t,e,n){let r=t[e];return Hn(r)?n:LS(r)}function sAi(t,e){return[{year:xU(t,e),month:xU(t,e+1,1),day:xU(t,e+2,1)},null,e+3]}function SU(t,e){return[{hours:xU(t,e,0),minutes:xU(t,e+1,0),seconds:xU(t,e+2,0),milliseconds:CZe(t[e+3])},null,e+4]}function sV(t,e){let n=!t[e]&&!t[e+1],r=Xge(t[e+1],t[e+2]),i=n?null:xf.instance(r);return[{},i,e+3]}function aV(t,e){let n=t[e]?ab.create(t[e]):null;return[{},n,e+1]}var aAi=RegExp(`^T?${TZe.source}$`),cAi=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uAi(t){let[e,n,r,i,o,s,a,c,u]=t,l=e[0]==="-",d=c&&c[0]==="-",p=(f,m=!1)=>f!==void 0&&(m||f&&l)?-f:f;return[{years:p(ND(n)),months:p(ND(r)),weeks:p(ND(i)),days:p(ND(o)),hours:p(ND(s)),minutes:p(ND(a)),seconds:p(ND(c),c==="-0"),milliseconds:p(CZe(u),d)}]}var lAi={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function RZe(t,e,n,r,i,o,s){let a={year:e.length===2?bZe(LS(e)):LS(e),month:vCn.indexOf(n)+1,day:LS(r),hour:LS(i),minute:LS(o)};return s&&(a.second=LS(s)),t&&(a.weekday=t.length>3?CCn.indexOf(t)+1:ICn.indexOf(t)+1),a}var dAi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function pAi(t){let[,e,n,r,i,o,s,a,c,u,l,d]=t,p=RZe(e,i,r,n,o,s,a),f;return c?f=lAi[c]:u?f=0:f=Xge(l,d),[p,new xf(f)]}function fAi(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var mAi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,hAi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gAi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function OSn(t){let[,e,n,r,i,o,s,a]=t;return[RZe(e,i,r,n,o,s,a),xf.utcInstance]}function yAi(t){let[,e,n,r,i,o,s,a]=t;return[RZe(e,a,n,r,i,o,s),xf.utcInstance]}var AAi=EU(Zyi,kZe),wAi=EU(eAi,kZe),xAi=EU(tAi,kZe),bAi=EU(NCn),LCn=_U(sAi,SU,sV,aV),EAi=_U(nAi,SU,sV,aV),_Ai=_U(rAi,SU,sV,aV),vAi=_U(SU,sV,aV);function SAi(t){return vU(t,[AAi,LCn],[wAi,EAi],[xAi,_Ai],[bAi,vAi])}function CAi(t){return vU(fAi(t),[dAi,pAi])}function IAi(t){return vU(t,[mAi,OSn],[hAi,OSn],[gAi,yAi])}function TAi(t){return vU(t,[cAi,uAi])}var kAi=_U(SU);function RAi(t){return vU(t,[aAi,kAi])}var DAi=EU(iAi,oAi),MAi=EU(PCn),OAi=_U(SU,sV,aV);function NAi(t){return vU(t,[DAi,LCn],[MAi,OAi])}var NSn="Invalid Duration",BCn={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},PAi={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...BCn},lh=146097/400,gU=146097/4800,LAi={years:{quarters:4,months:12,weeks:lh/7,days:lh,hours:lh*24,minutes:lh*24*60,seconds:lh*24*60*60,milliseconds:lh*24*60*60*1e3},quarters:{months:3,weeks:lh/28,days:lh/4,hours:lh*24/4,minutes:lh*24*60/4,seconds:lh*24*60*60/4,milliseconds:lh*24*60*60*1e3/4},months:{weeks:gU/7,days:gU,hours:gU*24,minutes:gU*24*60,seconds:gU*24*60*60,milliseconds:gU*24*60*60*1e3},...BCn},LD=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],BAi=LD.slice(0).reverse();function ob(t,e,n=!1){let r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new pc(r)}function $Cn(t,e){var n;let r=(n=e.milliseconds)!=null?n:0;for(let i of BAi.slice(1))e[i]&&(r+=e[i]*t[i].milliseconds);return r}function PSn(t,e){let n=$Cn(t,e)<0?-1:1;LD.reduceRight((r,i)=>{if(Hn(e[i]))return r;if(r){let o=e[r]*n,s=t[i][r],a=Math.floor(o/s);e[i]+=a*n,e[r]-=a*s*n}return i},null),LD.reduce((r,i)=>{if(Hn(e[i]))return r;if(r){let o=e[r]%1;e[r]-=o,e[i]+=o*t[r][i]}return i},null)}function LSn(t){let e={};for(let[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}var pc=class t{constructor(e){let n=e.conversionAccuracy==="longterm"||!1,r=n?LAi:PAi;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||uo.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return t.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new jc(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new t({values:Vge(e,t.normalizeUnit),loc:uo.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(FS(e))return t.fromMillis(e);if(t.isDuration(e))return e;if(typeof e=="object")return t.fromObject(e);throw new jc(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){let[r]=TAi(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){let[r]=RAi(e);return r?t.fromObject(r,n):t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new jc("need to specify a reason the Duration is invalid");let r=e instanceof Af?e:new Af(e,n);if(jo.throwOnInvalid)throw new cZe(r);return new t({invalid:r})}static normalizeUnit(e){let n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Hge(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){let r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?yf.create(this.loc,r).formatDurationFromString(this,e):NSn}toHuman(e={}){if(!this.isValid)return NSn;let n=e.showZeros!==!1,r=LD.map(i=>{let o=this.values[i];return Hn(o)||o===0&&!n?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(o)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=IZe(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},ds.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?$Cn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e),r={};for(let i of LD)(bU(n.values,i)||bU(this.values,i))&&(r[i]=n.get(i)+this.get(i));return ob(this,{values:r},!0)}minus(e){if(!this.isValid)return this;let n=t.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let n={};for(let r of Object.keys(this.values))n[r]=_Cn(e(this.values[r],r));return ob(this,{values:n},!0)}get(e){return this[t.normalizeUnit(e)]}set(e){if(!this.isValid)return this;let n={...this.values,...Vge(e,t.normalizeUnit)};return ob(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){let s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return ob(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return PSn(this.matrix,e),ob(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=LSn(this.normalize().shiftToAll().toObject());return ob(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>t.normalizeUnit(s));let n={},r={},i=this.toObject(),o;for(let s of LD)if(e.indexOf(s)>=0){o=s;let a=0;for(let u in r)a+=this.matrix[u][s]*r[u],r[u]=0;FS(i[s])&&(a+=i[s]);let c=Math.trunc(a);n[s]=c,r[s]=(a*1e3-c*1e3)/1e3}else FS(i[s])&&(r[s]=i[s]);for(let s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return PSn(this.matrix,n),ob(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return ob(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=LSn(this.values);return ob(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(let r of LD)if(!n(this.values[r],e.values[r]))return!1;return!0}},yU="Invalid Interval";function $Ai(t,e){return!t||!t.isValid?$D.invalid("missing or invalid start"):!e||!e.isValid?$D.invalid("missing or invalid end"):e<t?$D.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}var $D=class t{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new jc("need to specify a reason the Interval is invalid");let r=e instanceof Af?e:new Af(e,n);if(jo.throwOnInvalid)throw new aZe(r);return new t({invalid:r})}static fromDateTimes(e,n){let r=X6(e),i=X6(n),o=$Ai(r,i);return o??new t({start:r,end:i})}static after(e,n){let r=pc.fromDurationLike(n),i=X6(e);return t.fromDateTimes(i,i.plus(r))}static before(e,n){let r=pc.fromDurationLike(n),i=X6(e);return t.fromDateTimes(i.minus(r),i)}static fromISO(e,n){let[r,i]=(e||"").split("/",2);if(r&&i){let o,s;try{o=ds.fromISO(r,n),s=o.isValid}catch{s=!1}let a,c;try{a=ds.fromISO(i,n),c=a.isValid}catch{c=!1}if(s&&c)return t.fromDateTimes(o,a);if(s){let u=pc.fromISO(i,n);if(u.isValid)return t.after(o,u)}else if(c){let u=pc.fromISO(r,n);if(u.isValid)return t.before(a,u)}}return t.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;let r=this.start.startOf(e,n),i;return n!=null&&n.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(e,n),Math.floor(i.diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];let n=e.map(X6).filter(s=>this.contains(s)).sort((s,a)=>s.toMillis()-a.toMillis()),r=[],{s:i}=this,o=0;for(;i<this.e;){let s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(t.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(e){let n=pc.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o,s=[];for(;r<this.e;){let a=this.start.plus(n.mapUnits(c=>c*i));o=+a>+this.e?this.e:a,s.push(t.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;let n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)}static merge(e){let[n,r]=e.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0,i=[],o=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((c,u)=>c.time-u.time);for(let c of a)r+=c.type==="s"?1:-1,r===1?n=c.time:(n&&+n!=+c.time&&i.push(t.fromDateTimes(n,c.time)),n=null);return t.merge(i)}difference(...e){return t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:yU}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=jge,n={}){return this.isValid?yf.create(this.s.loc.clone(n),e).formatInterval(this):yU}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:yU}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:yU}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:yU}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:yU}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):pc.invalid(this.invalidReason)}mapEndpoints(e){return t.fromDateTimes(e(this.s),e(this.e))}},BD=class{static hasDST(e=jo.defaultZone){let n=ds.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return ab.isValidZone(e)}static normalizeZone(e){return BS(e,jo.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||uo.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||uo.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||uo.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||uo.create(n,r,o)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||uo.create(n,r,o)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||uo.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||uo.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return uo.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return uo.create(n,null,"gregory").eras(e)}static features(){return{relative:xCn(),localeWeek:bCn()}}};function BSn(t,e){let n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(pc.fromMillis(r).as("days"))}function FAi(t,e,n){let r=[["years",(c,u)=>u.year-c.year],["quarters",(c,u)=>u.quarter-c.quarter+(u.year-c.year)*4],["months",(c,u)=>u.month-c.month+(u.year-c.year)*12],["weeks",(c,u)=>{let l=BSn(c,u);return(l-l%7)/7}],["days",BSn]],i={},o=t,s,a;for(let[c,u]of r)n.indexOf(c)>=0&&(s=c,i[c]=u(t,e),a=o.plus(i),a>e?(i[c]--,t=o.plus(i),t>e&&(a=t,i[c]--,t=o.plus(i))):t=a);return[t,i,a,s]}function UAi(t,e,n,r){let[i,o,s,a]=FAi(t,e,n),c=e-i,u=n.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(s<e&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+c/(s-i)));let l=pc.fromObject(o,r);return u.length>0?pc.fromMillis(c,r).shiftTo(...u).plus(l):l}var QAi="missing Intl.DateTimeFormat.formatToParts support";function pi(t,e=n=>n){return{regex:t,deser:([n])=>e(Dyi(n))}}var WAi="\xA0",FCn=`[ ${WAi}]`,UCn=new RegExp(FCn,"g");function HAi(t){return t.replace(/\./g,"\\.?").replace(UCn,FCn)}function $Sn(t){return t.replace(/\./g,"").replace(UCn," ").toLowerCase()}function iy(t,e){return t===null?null:{regex:RegExp(t.map(HAi).join("|")),deser:([n])=>t.findIndex(r=>$Sn(n)===$Sn(r))+e}}function FSn(t,e){return{regex:t,deser:([,n,r])=>Xge(n,r),groups:e}}function Bge(t){return{regex:t,deser:([e])=>e}}function jAi(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function qAi(t,e){let n=ry(e),r=ry(e,"{2}"),i=ry(e,"{3}"),o=ry(e,"{4}"),s=ry(e,"{6}"),a=ry(e,"{1,2}"),c=ry(e,"{1,3}"),u=ry(e,"{1,6}"),l=ry(e,"{1,9}"),d=ry(e,"{2,4}"),p=ry(e,"{4,6}"),f=y=>({regex:RegExp(jAi(y.val)),deser:([w])=>w,literal:!0}),g=(y=>{if(t.literal)return f(y);switch(y.val){case"G":return iy(e.eras("short"),0);case"GG":return iy(e.eras("long"),0);case"y":return pi(u);case"yy":return pi(d,bZe);case"yyyy":return pi(o);case"yyyyy":return pi(p);case"yyyyyy":return pi(s);case"M":return pi(a);case"MM":return pi(r);case"MMM":return iy(e.months("short",!0),1);case"MMMM":return iy(e.months("long",!0),1);case"L":return pi(a);case"LL":return pi(r);case"LLL":return iy(e.months("short",!1),1);case"LLLL":return iy(e.months("long",!1),1);case"d":return pi(a);case"dd":return pi(r);case"o":return pi(c);case"ooo":return pi(i);case"HH":return pi(r);case"H":return pi(a);case"hh":return pi(r);case"h":return pi(a);case"mm":return pi(r);case"m":return pi(a);case"q":return pi(a);case"qq":return pi(r);case"s":return pi(a);case"ss":return pi(r);case"S":return pi(c);case"SSS":return pi(i);case"u":return Bge(l);case"uu":return Bge(a);case"uuu":return pi(n);case"a":return iy(e.meridiems(),0);case"kkkk":return pi(o);case"kk":return pi(d,bZe);case"W":return pi(a);case"WW":return pi(r);case"E":case"c":return pi(n);case"EEE":return iy(e.weekdays("short",!1),1);case"EEEE":return iy(e.weekdays("long",!1),1);case"ccc":return iy(e.weekdays("short",!0),1);case"cccc":return iy(e.weekdays("long",!0),1);case"Z":case"ZZ":return FSn(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return FSn(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Bge(/[a-z_+-/]{1,256}?/i);case" ":return Bge(/[^\S\n\r]/);default:return f(y)}})(t)||{invalidReason:QAi};return g.token=t,g}var GAi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function zAi(t,e,n){let{type:r,value:i}=t;if(r==="literal"){let c=/^\s+$/.test(i);return{literal:!c,val:c?" ":i}}let o=e[r],s=r;r==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let a=GAi[s];if(typeof a=="object"&&(a=a[o]),a)return{literal:!1,val:a}}function VAi(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function KAi(t,e,n){let r=t.match(e);if(r){let i={},o=1;for(let s in n)if(bU(n,s)){let a=n[s],c=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+c))),o+=c}return[r,i]}else return[r,{}]}function YAi(t){let e=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},n=null,r;return Hn(t.z)||(n=ab.create(t.z)),Hn(t.Z)||(n||(n=new xf(t.Z)),r=t.Z),Hn(t.q)||(t.M=(t.q-1)*3+1),Hn(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Hn(t.u)||(t.S=CZe(t.u)),[Object.keys(t).reduce((o,s)=>{let a=e(s);return a&&(o[a]=t[s]),o},{}),n,r]}var tZe=null;function JAi(){return tZe||(tZe=ds.fromMillis(1555555555555)),tZe}function XAi(t,e){if(t.literal)return t;let n=yf.macroTokenToFormatOpts(t.val),r=HCn(n,e);return r==null||r.includes(void 0)?t:r}function QCn(t,e){return Array.prototype.concat(...t.map(n=>XAi(n,e)))}var Kge=class{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=QCn(yf.parseFormat(n),e),this.units=this.tokens.map(r=>qAi(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){let[r,i]=VAi(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(e){if(this.isValid){let[n,r]=KAi(e,this.regex,this.handlers),[i,o,s]=r?YAi(r):[null,null,void 0];if(bU(r,"a")&&bU(r,"H"))throw new $S("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:o,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function WCn(t,e,n){return new Kge(t,n).explainFromTokens(e)}function ZAi(t,e,n){let{result:r,zone:i,specificOffset:o,invalidReason:s}=WCn(t,e,n);return[r,i,o,s]}function HCn(t,e){if(!t)return null;let r=yf.create(e,t).dtFormatter(JAi()),i=r.formatToParts(),o=r.resolvedOptions();return i.map(s=>zAi(s,t,o))}var nZe="Invalid DateTime",USn=864e13;function eV(t){return new Af("unsupported zone",`the zone "${t.name}" is not supported`)}function rZe(t){return t.weekData===null&&(t.weekData=Gge(t.c)),t.weekData}function iZe(t){return t.localWeekData===null&&(t.localWeekData=Gge(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function PD(t,e){let n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new ds({...n,...e,old:n})}function jCn(t,e,n){let r=t-e*60*1e3,i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;let o=n.offset(r);return i===o?[r,i]:[t-Math.min(i,o)*60*1e3,Math.max(i,o)]}function $ge(t,e){t+=e*60*1e3;let n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Uge(t,e,n){return jCn(Jge(t),e,n)}function QSn(t,e){let n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,o={...t.c,year:r,month:i,day:Math.min(t.c.day,zge(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=pc.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=Jge(o),[c,u]=jCn(a,n,t.zone);return s!==0&&(c+=s,u=t.zone.offset(c)),{ts:c,o:u}}function AU(t,e,n,r,i,o){let{setZone:s,zone:a}=n;if(t&&Object.keys(t).length!==0||e){let c=e||a,u=ds.fromObject(t,{...n,zone:c,specificOffset:o});return s?u:u.setZone(a)}else return ds.invalid(new Af("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Fge(t,e,n=!0){return t.isValid?yf.create(uo.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function oZe(t,e,n){let r=t.c.year>9999||t.c.year<0,i="";if(r&&t.c.year>=0&&(i+="+"),i+=Ua(t.c.year,r?6:4),n==="year")return i;if(e){if(i+="-",i+=Ua(t.c.month),n==="month")return i;i+="-"}else if(i+=Ua(t.c.month),n==="month")return i;return i+=Ua(t.c.day),i}function WSn(t,e,n,r,i,o,s){let a=!n||t.c.millisecond!==0||t.c.second!==0,c="";switch(s){case"day":case"month":case"year":break;default:if(c+=Ua(t.c.hour),s==="hour")break;if(e){if(c+=":",c+=Ua(t.c.minute),s==="minute")break;a&&(c+=":",c+=Ua(t.c.second))}else{if(c+=Ua(t.c.minute),s==="minute")break;a&&(c+=Ua(t.c.second))}if(s==="second")break;a&&(!r||t.c.millisecond!==0)&&(c+=".",c+=Ua(t.c.millisecond,3))}return i&&(t.isOffsetFixed&&t.offset===0&&!o?c+="Z":t.o<0?(c+="-",c+=Ua(Math.trunc(-t.o/60)),c+=":",c+=Ua(Math.trunc(-t.o%60))):(c+="+",c+=Ua(Math.trunc(t.o/60)),c+=":",c+=Ua(Math.trunc(t.o%60)))),o&&(c+="["+t.zone.ianaName+"]"),c}var qCn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},e0i={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},t0i={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Qge=["year","month","day","hour","minute","second","millisecond"],n0i=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],r0i=["year","ordinal","hour","minute","second","millisecond"];function Wge(t){let e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Hge(t);return e}function HSn(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Wge(t)}}function i0i(t){if(tV===void 0&&(tV=jo.now()),t.type!=="iana")return t.offset(tV);let e=t.name,n=EZe.get(e);return n===void 0&&(n=t.offset(tV),EZe.set(e,n)),n}function jSn(t,e){let n=BS(e.zone,jo.defaultZone);if(!n.isValid)return ds.invalid(eV(n));let r=uo.fromObject(e),i,o;if(Hn(t.year))i=jo.now();else{for(let c of Qge)Hn(t[c])&&(t[c]=qCn[c]);let s=ACn(t)||wCn(t);if(s)return ds.invalid(s);let a=i0i(n);[i,o]=Uge(t,a,n)}return new ds({ts:i,zone:n,loc:r,o})}function qSn(t,e,n){let r=Hn(n.round)?!0:n.round,i=Hn(n.rounding)?"trunc":n.rounding,o=(a,c)=>(a=IZe(a,r||n.calendary?0:2,n.calendary?"round":i),e.loc.clone(n).relFormatter(n).format(a,c)),s=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return o(s(n.unit),n.unit);for(let a of n.units){let c=s(a);if(Math.abs(c)>=1)return o(c,a)}return o(t>e?-0:0,n.units[n.units.length-1])}function GSn(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}var tV,EZe=new Map,ds=class t{constructor(e){let n=e.zone||jo.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new Af("invalid input"):null)||(n.isValid?null:eV(n));this.ts=Hn(e.ts)?jo.now():e.ts;let i=null,o=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,o]=[e.old.c,e.old.o];else{let a=FS(e.o)&&!e.old?e.o:n.offset(this.ts);i=$ge(this.ts,a),r=Number.isNaN(i.year)?new Af("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=e.loc||uo.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new t({})}static local(){let[e,n]=GSn(arguments),[r,i,o,s,a,c,u]=n;return jSn({year:r,month:i,day:o,hour:s,minute:a,second:c,millisecond:u},e)}static utc(){let[e,n]=GSn(arguments),[r,i,o,s,a,c,u]=n;return e.zone=xf.utcInstance,jSn({year:r,month:i,day:o,hour:s,minute:a,second:c,millisecond:u},e)}static fromJSDate(e,n={}){let r=Lyi(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");let i=BS(n.zone,jo.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:uo.fromObject(n)}):t.invalid(eV(i))}static fromMillis(e,n={}){if(FS(e))return e<-USn||e>USn?t.invalid("Timestamp out of range"):new t({ts:e,zone:BS(n.zone,jo.defaultZone),loc:uo.fromObject(n)});throw new jc(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(FS(e))return new t({ts:e*1e3,zone:BS(n.zone,jo.defaultZone),loc:uo.fromObject(n)});throw new jc("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};let r=BS(n.zone,jo.defaultZone);if(!r.isValid)return t.invalid(eV(r));let i=uo.fromObject(n),o=Vge(e,HSn),{minDaysInFirstWeek:s,startOfWeek:a}=kSn(o,i),c=jo.now(),u=Hn(n.specificOffset)?r.offset(c):n.specificOffset,l=!Hn(o.ordinal),d=!Hn(o.year),p=!Hn(o.month)||!Hn(o.day),f=d||p,m=o.weekYear||o.weekNumber;if((f||l)&&m)throw new $S("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&l)throw new $S("Can't mix ordinal dates with month/day");let g=m||o.weekday&&!f,y,w,x=$ge(c,u);g?(y=n0i,w=e0i,x=Gge(x,s,a)):l?(y=r0i,w=t0i,x=eZe(x)):(y=Qge,w=qCn);let E=!1;for(let P of y){let U=o[P];Hn(U)?E?o[P]=w[P]:o[P]=x[P]:E=!0}let _=g?Oyi(o,s,a):l?Nyi(o):ACn(o),C=_||wCn(o);if(C)return t.invalid(C);let I=g?ISn(o,s,a):l?TSn(o):o,[D,M]=Uge(I,u,r),k=new t({ts:D,zone:r,o:M,loc:i});return o.weekday&&f&&e.weekday!==k.weekday?t.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${k.toISO()}`):k.isValid?k:t.invalid(k.invalid)}static fromISO(e,n={}){let[r,i]=SAi(e);return AU(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){let[r,i]=CAi(e);return AU(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){let[r,i]=IAi(e);return AU(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Hn(e)||Hn(n))throw new jc("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=r,s=uo.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,c,u,l]=ZAi(s,e,n);return l?t.invalid(l):AU(a,c,r,`format ${n}`,e,u)}static fromString(e,n,r={}){return t.fromFormat(e,n,r)}static fromSQL(e,n={}){let[r,i]=NAi(e);return AU(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new jc("need to specify a reason the DateTime is invalid");let r=e instanceof Af?e:new Af(e,n);if(jo.throwOnInvalid)throw new sZe(r);return new t({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){let r=HCn(e,uo.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return QCn(yf.parseFormat(e),uo.fromObject(n)).map(i=>i.val).join("")}static resetCache(){tV=void 0,EZe.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?rZe(this).weekYear:NaN}get weekNumber(){return this.isValid?rZe(this).weekNumber:NaN}get weekday(){return this.isValid?rZe(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?iZe(this).weekday:NaN}get localWeekNumber(){return this.isValid?iZe(this).weekNumber:NaN}get localWeekYear(){return this.isValid?iZe(this).weekYear:NaN}get ordinal(){return this.isValid?eZe(this.c).ordinal:NaN}get monthShort(){return this.isValid?BD.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?BD.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?BD.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?BD.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,n=6e4,r=Jge(this.c),i=this.zone.offset(r-e),o=this.zone.offset(r+e),s=this.zone.offset(r-i*n),a=this.zone.offset(r-o*n);if(s===a)return[this];let c=r-s*n,u=r-a*n,l=$ge(c,s),d=$ge(u,a);return l.hour===d.hour&&l.minute===d.minute&&l.second===d.second&&l.millisecond===d.millisecond?[PD(this,{ts:c}),PD(this,{ts:u})]:[this]}get isInLeapYear(){return oV(this.year)}get daysInMonth(){return zge(this.year,this.month)}get daysInYear(){return this.isValid?wU(this.year):NaN}get weeksInWeekYear(){return this.isValid?iV(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?iV(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:n,numberingSystem:r,calendar:i}=yf.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(xf.instance(e),n)}toLocal(){return this.setZone(jo.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=BS(e,jo.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){let o=e.offset(this.ts),s=this.toObject();[i]=Uge(s,o,e)}return PD(this,{ts:i,zone:e})}else return t.invalid(eV(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){let i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return PD(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let n=Vge(e,HSn),{minDaysInFirstWeek:r,startOfWeek:i}=kSn(n,this.loc),o=!Hn(n.weekYear)||!Hn(n.weekNumber)||!Hn(n.weekday),s=!Hn(n.ordinal),a=!Hn(n.year),c=!Hn(n.month)||!Hn(n.day),u=a||c,l=n.weekYear||n.weekNumber;if((u||s)&&l)throw new $S("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&s)throw new $S("Can't mix ordinal dates with month/day");let d;o?d=ISn({...Gge(this.c,r,i),...n},r,i):Hn(n.ordinal)?(d={...this.toObject(),...n},Hn(n.day)&&(d.day=Math.min(zge(d.year,d.month),d.day))):d=TSn({...eZe(this.c),...n});let[p,f]=Uge(d,this.o,this.zone);return PD(this,{ts:p,o:f})}plus(e){if(!this.isValid)return this;let n=pc.fromDurationLike(e);return PD(this,QSn(this,n))}minus(e){if(!this.isValid)return this;let n=pc.fromDurationLike(e).negate();return PD(this,QSn(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;let r={},i=pc.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){let o=this.loc.getStartOfWeek(),{weekday:s}=this;s<o&&(r.weekNumber=this.weekNumber-1),r.weekday=o}else r.weekday=1;if(i==="quarters"){let o=Math.ceil(this.month/3);r.month=(o-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?yf.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):nZe}toLocaleString(e=jge,n={}){return this.isValid?yf.create(this.loc.clone(n),e).formatDateTime(this):nZe}toLocaleParts(e={}){return this.isValid?yf.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1,precision:s="milliseconds"}={}){if(!this.isValid)return null;s=Wge(s);let a=e==="extended",c=oZe(this,a,s);return Qge.indexOf(s)>=3&&(c+="T"),c+=WSn(this,a,n,r,i,o,s),c}toISODate({format:e="extended",precision:n="day"}={}){return this.isValid?oZe(this,e==="extended",Wge(n)):null}toISOWeekDate(){return Fge(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended",precision:a="milliseconds"}={}){return this.isValid?(a=Wge(a),(i&&Qge.indexOf(a)>=3?"T":"")+WSn(this,s==="extended",n,e,r,o,a)):null}toRFC2822(){return Fge(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Fge(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?oZe(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),Fge(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():nZe}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return pc.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Byi(n).map(pc.normalizeUnit),s=e.valueOf()>this.valueOf(),a=s?this:e,c=s?e:this,u=UAi(a,c,o,i);return s?u.negate():u}diffNow(e="milliseconds",n={}){return this.diff(t.now(),e,n)}until(e){return this.isValid?$D.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;let i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(n,r)<=i&&i<=o.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),qSn(n,this.plus(r),{...e,numeric:"always",units:i,unit:o})}toRelativeCalendar(e={}){return this.isValid?qSn(e.base||t.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(t.isDateTime))throw new jc("min requires all arguments be DateTimes");return RSn(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(t.isDateTime))throw new jc("max requires all arguments be DateTimes");return RSn(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){let{locale:i=null,numberingSystem:o=null}=r,s=uo.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return WCn(s,e,n)}static fromStringExplain(e,n,r={}){return t.fromFormatExplain(e,n,r)}static buildFormatParser(e,n={}){let{locale:r=null,numberingSystem:i=null}=n,o=uo.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new Kge(o,e)}static fromFormatParser(e,n,r={}){if(Hn(e)||Hn(n))throw new jc("fromFormatParser requires an input string and a format parser");let{locale:i=null,numberingSystem:o=null}=r,s=uo.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});if(!s.equals(n.locale))throw new jc(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);let{result:a,zone:c,specificOffset:u,invalidReason:l}=n.explainFromTokens(e);return l?t.invalid(l):AU(a,c,r,`format ${n.format}`,e,u)}static get DATE_SHORT(){return jge}static get DATE_MED(){return zSn}static get DATE_MED_WITH_WEEKDAY(){return myi}static get DATE_FULL(){return VSn}static get DATE_HUGE(){return KSn}static get TIME_SIMPLE(){return YSn}static get TIME_WITH_SECONDS(){return JSn}static get TIME_WITH_SHORT_OFFSET(){return XSn}static get TIME_WITH_LONG_OFFSET(){return ZSn}static get TIME_24_SIMPLE(){return eCn}static get TIME_24_WITH_SECONDS(){return tCn}static get TIME_24_WITH_SHORT_OFFSET(){return nCn}static get TIME_24_WITH_LONG_OFFSET(){return rCn}static get DATETIME_SHORT(){return iCn}static get DATETIME_SHORT_WITH_SECONDS(){return oCn}static get DATETIME_MED(){return sCn}static get DATETIME_MED_WITH_SECONDS(){return aCn}static get DATETIME_MED_WITH_WEEKDAY(){return hyi}static get DATETIME_FULL(){return cCn}static get DATETIME_FULL_WITH_SECONDS(){return uCn}static get DATETIME_HUGE(){return lCn}static get DATETIME_HUGE_WITH_SECONDS(){return dCn}};function X6(t){if(ds.isDateTime(t))return t;if(t&&t.valueOf&&FS(t.valueOf()))return ds.fromJSDate(t);if(t&&typeof t=="object")return ds.fromObject(t);throw new jc(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var o0i="3.7.2";bf.DateTime=ds;bf.Duration=pc;bf.FixedOffsetZone=xf;bf.IANAZone=ab;bf.Info=BD;bf.Interval=$D;bf.InvalidZone=qge;bf.Settings=jo;bf.SystemZone=rV;bf.VERSION=o0i;bf.Zone=US});var nye=$(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.CronDate=td.DAYS_IN_MONTH=td.DateMathOp=td.TimeUnit=void 0;var FD=GCn(),il;(function(t){t.Second="Second",t.Minute="Minute",t.Hour="Hour",t.Day="Day",t.Month="Month",t.Year="Year"})(il||(td.TimeUnit=il={}));var eye;(function(t){t.Add="Add",t.Subtract="Subtract"})(eye||(td.DateMathOp=eye={}));td.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var tye=class t{#e;#t=null;#n=null;constructor(e,n){let r={zone:n};if(e?e instanceof t?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n):e instanceof Date?this.#e=FD.DateTime.fromJSDate(e,r):typeof e=="number"?this.#e=FD.DateTime.fromMillis(e,r):(this.#e=FD.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=FD.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=FD.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=FD.DateTime.fromFormat(e,"EEE, d MMM yyyy HH:mm:ss",r))):this.#e=FD.DateTime.local(),!this.#e.isValid)throw new Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#r(e){return e%4===0&&e%100!==0||e%400===0}get dstStart(){return this.#t}set dstStart(e){this.#t=e}get dstEnd(){return this.#n}set dstEnd(e){this.#n=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf("month")}addDay(){this.#e=this.#e.plus({days:1}).startOf("day")}addHour(){this.#e=this.#e.plus({hours:1}).startOf("hour")}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf("minute")}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf("month").startOf("second")}subtractDay(){this.#e=this.#e.minus({days:1}).endOf("day").startOf("second")}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf("hour").startOf("second")}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf("minute").startOf("second")}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){switch(e){case il.Year:return this.addYear();case il.Month:return this.addMonth();case il.Day:return this.addDay();case il.Hour:return this.addHour();case il.Minute:return this.addMinute();case il.Second:return this.addSecond()}}subtractUnit(e){switch(e){case il.Year:return this.subtractYear();case il.Month:return this.subtractMonth();case il.Day:return this.subtractDay();case il.Hour:return this.subtractHour();case il.Minute:return this.subtractMinute();case il.Second:return this.subtractSecond()}}invokeDateOperation(e,n){if(e===eye.Add){this.addUnit(n);return}if(e===eye.Subtract){this.subtractUnit(n);return}throw new Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf("day")}setEndOfDay(){this.#e=this.#e.endOf("day")}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#o().day}getUTCFullYear(){return this.#o().year}getUTCDay(){let e=this.#o().weekday;return e===7?0:e}getUTCMonth(){return this.#o().month-1}getUTCHours(){return this.#o().hour}getUTCMinutes(){return this.#o().minute}getUTCSeconds(){return this.#o().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:e,month:n}=this.#e;if(n===2){let r=t.#r(this.#e.year);return e===td.DAYS_IN_MONTH[n-1]-(r?0:1)}return e===td.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:e,month:n}=this.#e,r;return n===2?r=td.DAYS_IN_MONTH[n-1]-(t.#r(this.#e.year)?0:1):r=td.DAYS_IN_MONTH[n-1],e>r-7}applyDateOperation(e,n,r){if(n===il.Month||n===il.Day){this.invokeDateOperation(e,n);return}let i=this.getHours();this.invokeDateOperation(e,n);let o=this.getHours(),s=o-i;s===2?r!==24&&(this.dstStart=i+1):s===0&&this.getMinutes()===0&&this.getSeconds()===0&&r!==24&&(this.dstEnd=o)}#o(){return this.#e.toUTC()}};td.CronDate=tye;td.default=tye});var zCn=$(rye=>{"use strict";Object.defineProperty(rye,"__esModule",{value:!0});rye.CronMonth=void 0;var s0i=nye(),a0i=PS(),c0i=1,u0i=12,l0i=Object.freeze([]),DZe=class extends a0i.CronField{static get min(){return c0i}static get max(){return u0i}static get chars(){return l0i}static get daysInMonth(){return s0i.DAYS_IN_MONTH}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}};rye.CronMonth=DZe});var VCn=$(iye=>{"use strict";Object.defineProperty(iye,"__esModule",{value:!0});iye.CronSecond=void 0;var d0i=PS(),p0i=0,f0i=59,m0i=Object.freeze([]),MZe=class extends d0i.CronField{static get min(){return p0i}static get max(){return f0i}static get chars(){return m0i}constructor(e,n){super(e,n),this.validate()}get values(){return super.values}};iye.CronSecond=MZe});var oye=$(fp=>{"use strict";var h0i=fp&&fp.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),QS=fp&&fp.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&h0i(e,t,n)};Object.defineProperty(fp,"__esModule",{value:!0});QS(pSn(),fp);QS(fSn(),fp);QS(mSn(),fp);QS(PS(),fp);QS(hSn(),fp);QS(gSn(),fp);QS(zCn(),fp);QS(VCn(),fp)});var NZe=$(sye=>{"use strict";Object.defineProperty(sye,"__esModule",{value:!0});sye.CronFieldCollection=void 0;var fh=oye(),OZe=class t{#e;#t;#n;#r;#o;#i;static from(e,n){return new t({second:this.resolveField(fh.CronSecond,e.second,n.second),minute:this.resolveField(fh.CronMinute,e.minute,n.minute),hour:this.resolveField(fh.CronHour,e.hour,n.hour),dayOfMonth:this.resolveField(fh.CronDayOfMonth,e.dayOfMonth,n.dayOfMonth),month:this.resolveField(fh.CronMonth,e.month,n.month),dayOfWeek:this.resolveField(fh.CronDayOfWeek,e.dayOfWeek,n.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof fh.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:o,dayOfWeek:s}){if(!e)throw new Error("Validation error, Field second is missing");if(!n)throw new Error("Validation error, Field minute is missing");if(!r)throw new Error("Validation error, Field hour is missing");if(!i)throw new Error("Validation error, Field dayOfMonth is missing");if(!o)throw new Error("Validation error, Field month is missing");if(!s)throw new Error("Validation error, Field dayOfWeek is missing");if(o.values.length===1&&!i.hasLastChar&&s.isWildcard&&!(parseInt(i.values[0],10)<=fh.CronMonth.daysInMonth[o.values[0]-1]))throw new Error("Invalid explicit day of month definition");this.#e=e,this.#t=n,this.#n=r,this.#o=o,this.#i=s,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#o}get dayOfWeek(){return this.#i}static compactField(e){if(e.length===0)return[];let n=[],r;return e.forEach((i,o,s)=>{if(r===void 0){r={start:i,count:1};return}let a=s[o-1]||r.start,c=s[o+1];if(i==="L"||i==="W"){n.push(r),n.push({start:i,count:1}),r=void 0;return}if(r.step===void 0&&c!==void 0){let u=i-a,l=c-i;if(u<=l){r={...r,count:2,end:i,step:u};return}r.step=1}i-(r.end??0)===r.step?(r.count++,r.end=i):(r.count===1?n.push({start:r.start,count:1}):r.count===2?(n.push({start:r.start,count:1}),n.push({start:r.end??a,count:1})):n.push(r),r={start:i,count:1})}),r&&n.push(r),n}static#s(e,n,r){let i=n.step;return i?i===1&&n.start===e.min&&n.end&&n.end>=r?e.hasQuestionMarkChar?"?":"*":i!==1&&n.start===e.min&&n.end&&n.end>=r-i+1?`*/${i}`:null:null}static#c(e,n){let r=e.step;if(r===1)return`${e.start}-${e.end}`;let i=e.start===0?e.count-1:e.count;if(!r)throw new Error("Unexpected range step");if(!e.end)throw new Error("Unexpected range end");if(r*i>e.end){let o=(a,c)=>{if(typeof e.start!="number")throw new Error("Unexpected range start");return c%r===0?e.start+c:null};if(typeof e.start!="number")throw new Error("Unexpected range start");let s={length:e.end-e.start+1};return Array.from(s,o).filter(a=>a!==null).join(",")}return e.end===n-r+1?`${e.start}/${r}`:`${e.start}-${e.end}/${r}`}stringifyField(e){let n=e.max,r=e.values;if(e instanceof fh.CronDayOfWeek){n=6;let o=this.#i.values;r=o[o.length-1]===7?o.slice(0,-1):o}e instanceof fh.CronDayOfMonth&&(n=this.#o.values.length===1?fh.CronMonth.daysInMonth[this.#o.values[0]-1]:e.max);let i=t.compactField(r);if(i.length===1){let o=t.#s(e,i[0],n);if(o)return o}return i.map(o=>{let s=o.count===1?o.start.toString():t.#c(o,n);return e instanceof fh.CronDayOfWeek&&e.nthDay>0?`${s}#${e.nthDay}`:s}).join(",")}stringify(e=!1){let n=[];return e&&n.push(this.stringifyField(this.#e)),n.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#o),this.stringifyField(this.#i)),n.join(" ")}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#o.serialize(),dayOfWeek:this.#i.serialize()}}};sye.CronFieldCollection=OZe});var PZe=$(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.CronExpression=mh.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=mh.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var ca=nye();mh.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range";mh.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";var KCn=1e4,aye=class t{#e;#t;#n;#r;#o;#i;#s=null;#c=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new ca.CronDate(n.startDate,this.#t):null,this.#o=n.endDate?new ca.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let i=new ca.CronDate(r,this.#t);this.#r&&i.getTime()<this.#r.getTime()?r=this.#r:this.#o&&i.getTime()>this.#o.getTime()&&(r=this.#o)}this.#n=new ca.CronDate(r,this.#t),this.#i=e}get fields(){return this.#i}static fieldsToExpression(e,n){return new t(e,n||{})}static#a(e,n){return n.some(r=>r===e)}#l(e,n){return e[n?e.length-1:0]}#p(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#s===n)return this.#c;let r=new ca.CronDate(e);r.setStartOfDay();let i=new ca.CronDate(e);return i.setEndOfDay(),this.#s=n,this.#c=r.getUTCOffset()!==i.getUTCOffset(),this.#c}#d(e,n,r){let i=this.#i.second.values,o=e.getSeconds(),s=this.#i.second.findNearestValue(o,r);if(s!==null){e.setSeconds(s);return}e.applyDateOperation(n,ca.TimeUnit.Minute,this.#i.hour.values.length),e.setSeconds(this.#l(i,r))}#u(e,n,r){let i=this.#i.minute.values,o=this.#i.second.values,s=e.getMinutes(),a=this.#i.minute.findNearestValue(s,r);if(a!==null){e.setMinutes(a),e.setSeconds(this.#l(o,r));return}e.applyDateOperation(n,ca.TimeUnit.Hour,this.#i.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(o,r))}static#m(e,n){let r=n.isLastWeekdayOfMonth();return e.some(i=>{let o=parseInt(i.toString().charAt(0),10)%7;if(Number.isNaN(o))throw new Error(`Invalid last weekday of the month expression: ${i}`);return n.getDay()===o&&r})}next(){return this.#A()}prev(){return this.#A(!0)}hasNext(){let e=this.#n;try{return this.#A(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#A(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let n=[];if(e>=0)for(let r=0;r<e;r++)try{n.push(this.next())}catch{return n}else for(let r=0;r>e;r--)try{n.push(this.prev())}catch{return n}return n}reset(e){this.#n=new ca.CronDate(e||this.#e.currentDate,this.#t)}stringify(e=!1){return this.#i.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:o}=this.#i,s=new ca.CronDate(e,this.#t);return!(!n.values.includes(s.getSeconds())||!r.values.includes(s.getMinutes())||!i.values.includes(s.getHours())||!o.values.includes(s.getMonth()+1)||!this.#f(s)||this.#i.dayOfWeek.nthDay>0&&Math.ceil(s.getDate()/7)!==this.#i.dayOfWeek.nthDay)}toString(){return this.#e.expression||this.stringify(!0)}#f(e){let n=this.#i.dayOfMonth.isWildcard,r=!n,i=this.#i.dayOfWeek.isWildcard,o=!i,s=t.#a(e.getDate(),this.#i.dayOfMonth.values)||this.#i.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),a=t.#a(e.getDay(),this.#i.dayOfWeek.values)||this.#i.dayOfWeek.hasLastChar&&t.#m(this.#i.dayOfWeek.values,e);return!!(r&&o&&(s||a)||s&&!o||n&&!i&&a)}#y(e,n,r){let i=this.#i.hour.values,o=i,s=e.getHours(),a=t.#a(s,i),c=e.dstEnd===s;if(e.dstStart!==null&&e.dstStart===s-1&&t.#a(e.dstStart,i))return!0;if(c&&!r)return e.dstEnd=null,e.applyDateOperation(ca.DateMathOp.Add,ca.TimeUnit.Hour,o.length),!1;if(a)return!0;e.dstStart=null;let u=this.#i.hour.findNearestValue(s,r);if(u===null)return e.applyDateOperation(n,ca.TimeUnit.Day,o.length),!1;if(this.#p(e)){let l=r?s-u:u-s;for(let d=0;d<l&&(e.applyDateOperation(n,ca.TimeUnit.Hour,o.length),!(!r&&e.getHours()>=u||r&&e.getHours()<=u));d++);}else e.setHours(u);return e.setMinutes(this.#l(this.#i.minute.values,r)),e.setSeconds(this.#l(this.#i.second.values,r)),!1}#g(e){if(!this.#r&&!this.#o)return;let n=e.getTime();if(this.#r&&n<this.#r.getTime())throw new Error(mh.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(this.#o&&n>this.#o.getTime())throw new Error(mh.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#A(e=!1){let n=e?ca.DateMathOp.Subtract:ca.DateMathOp.Add,r=new ca.CronDate(this.#n),i=r.getTime(),o=0;for(;++o<KCn;){if(this.#g(r),!this.#f(r)){r.applyDateOperation(n,ca.TimeUnit.Day,this.#i.hour.values.length);continue}if(!(this.#i.dayOfWeek.nthDay<=0||Math.ceil(r.getDate()/7)===this.#i.dayOfWeek.nthDay)){r.applyDateOperation(n,ca.TimeUnit.Day,this.#i.hour.values.length);continue}if(!t.#a(r.getMonth()+1,this.#i.month.values)){r.applyDateOperation(n,ca.TimeUnit.Month,this.#i.hour.values.length);continue}if(this.#y(r,n,e)){if(!t.#a(r.getMinutes(),this.#i.minute.values)){this.#u(r,n,e);continue}if(!t.#a(r.getSeconds(),this.#i.second.values)){this.#d(r,n,e);continue}if(i===r.getTime()){(n==="Add"||r.getMilliseconds()===0)&&r.applyDateOperation(n,ca.TimeUnit.Second,this.#i.hour.values.length);continue}break}}if(o>KCn)throw new Error(mh.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return r.getMilliseconds()!==0&&r.setMilliseconds(0),this.#n=r,r}[Symbol.iterator](){return{next:()=>{try{return{value:this.#A(),done:!1}}catch{return{value:void 0,done:!0}}}}}};mh.CronExpression=aye;mh.default=aye});var YCn=$(LZe=>{"use strict";Object.defineProperty(LZe,"__esModule",{value:!0});LZe.seededRandom=A0i;function g0i(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return()=>e>>>0}function y0i(t){return()=>{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function A0i(t){let e=t?g0i(t)():Math.floor(Math.random()*1e10);return y0i(e)}});var cye=$(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.CronExpressionParser=yh.DayOfWeek=yh.Months=yh.CronUnit=yh.PredefinedExpressions=void 0;var w0i=NZe(),x0i=PZe(),b0i=YCn(),hh=oye(),BZe;(function(t){t["@yearly"]="0 0 0 1 1 *",t["@annually"]="0 0 0 1 1 *",t["@monthly"]="0 0 0 1 * *",t["@weekly"]="0 0 0 * * 0",t["@daily"]="0 0 0 * * *",t["@hourly"]="0 0 * * * *",t["@minutely"]="0 * * * * *",t["@secondly"]="* * * * * *",t["@weekdays"]="0 0 0 * * 1-5",t["@weekends"]="0 0 0 * * 0,6"})(BZe||(yh.PredefinedExpressions=BZe={}));var gh;(function(t){t.Second="Second",t.Minute="Minute",t.Hour="Hour",t.DayOfMonth="DayOfMonth",t.Month="Month",t.DayOfWeek="DayOfWeek"})(gh||(yh.CronUnit=gh={}));var $Ze;(function(t){t[t.jan=1]="jan",t[t.feb=2]="feb",t[t.mar=3]="mar",t[t.apr=4]="apr",t[t.may=5]="may",t[t.jun=6]="jun",t[t.jul=7]="jul",t[t.aug=8]="aug",t[t.sep=9]="sep",t[t.oct=10]="oct",t[t.nov=11]="nov",t[t.dec=12]="dec"})($Ze||(yh.Months=$Ze={}));var FZe;(function(t){t[t.sun=0]="sun",t[t.mon=1]="mon",t[t.tue=2]="tue",t[t.wed=3]="wed",t[t.thu=4]="thu",t[t.fri=5]="fri",t[t.sat=6]="sat"})(FZe||(yh.DayOfWeek=FZe={}));var UZe=class t{static parse(e,n={}){let{strict:r=!1,hashSeed:i}=n,o=(0,b0i.seededRandom)(i);e=BZe[e]||e;let s=t.#e(e,r);if(!(s.dayOfMonth==="*"||s.dayOfWeek==="*"||!r))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");let a=t.#t(gh.Second,s.second,hh.CronSecond.constraints,o),c=t.#t(gh.Minute,s.minute,hh.CronMinute.constraints,o),u=t.#t(gh.Hour,s.hour,hh.CronHour.constraints,o),l=t.#t(gh.Month,s.month,hh.CronMonth.constraints,o),d=t.#t(gh.DayOfMonth,s.dayOfMonth,hh.CronDayOfMonth.constraints,o),{dayOfWeek:p,nthDayOfWeek:f}=t.#p(s.dayOfWeek),m=t.#t(gh.DayOfWeek,p,hh.CronDayOfWeek.constraints,o),g=new w0i.CronFieldCollection({second:new hh.CronSecond(a,{rawValue:s.second}),minute:new hh.CronMinute(c,{rawValue:s.minute}),hour:new hh.CronHour(u,{rawValue:s.hour}),dayOfMonth:new hh.CronDayOfMonth(d,{rawValue:s.dayOfMonth}),month:new hh.CronMonth(l,{rawValue:s.month}),dayOfWeek:new hh.CronDayOfWeek(m,{rawValue:s.dayOfWeek,nthDayOfWeek:f})});return new x0i.CronExpression(g,{...n,expression:e})}static#e(e,n){if(n&&!e.length)throw new Error("Invalid cron expression");e=e||"0 * * * * *";let r=e.trim().split(/\s+/);if(n&&r.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(r.length>6)throw new Error("Invalid cron expression, too many fields");let i=["*","*","*","*","*","0"];r.length<i.length&&r.unshift(...i.slice(r.length));let[o,s,a,c,u,l]=r;return{second:o,minute:s,hour:a,dayOfMonth:c,month:u,dayOfWeek:l}}static#t(e,n,r,i){if((e===gh.Month||e===gh.DayOfWeek)&&(n=n.replace(/[a-z]{3}/gi,o=>{o=o.toLowerCase();let s=$Ze[o]||FZe[o];if(s===void 0)throw new Error(`Validation error, cannot resolve alias "${o}"`);return s.toString()})),!r.validChars.test(n))throw new Error(`Invalid characters, got value: ${n}`);return n=this.#n(n,r),n=this.#r(n,r,i),this.#o(e,n,r)}static#n(e,n){return e.replace(/[*?]/g,n.min+"-"+n.max)}static#r(e,n,r){let i=r();return e.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(o,s,a,c)=>{if(s&&a&&c){let u=parseInt(s,10),l=parseInt(a,10),d=parseInt(c,10);if(u>l)throw new Error(`Invalid range: ${u}-${l}, min > max`);if(d<=0)throw new Error(`Invalid step: ${d}, must be positive`);let p=Math.max(u,n.min),f=Math.floor(i*d),m=[];for(let g=Math.floor(p/d)*d+f;g<=l;g+=d)g>=p&&m.push(g);return m.join(",")}else if(s&&a){let u=parseInt(s,10),l=parseInt(a,10);if(u>l)throw new Error(`Invalid range: ${u}-${l}, min > max`);return String(Math.floor(i*(l-u+1))+u)}else if(c){let u=parseInt(c,10);if(u<=0)throw new Error(`Invalid step: ${u}, must be positive`);let l=Math.floor(i*u),d=[];for(let p=Math.floor(n.min/u)*u+l;p<=n.max;p+=u)p>=n.min&&d.push(p);return d.join(",")}else return String(Math.floor(i*(n.max-n.min+1)+n.min))})}static#o(e,n,r){let i=[];function o(a,c){if(Array.isArray(a))i.push(...a);else if(t.#d(c,a))i.push(a);else{let u=parseInt(a.toString(),10);if(!(u>=c.min&&u<=c.max))throw new Error(`Constraint error, got value ${a} expected range ${c.min}-${c.max}`);i.push(e===gh.DayOfWeek?u%7:a)}}return n.split(",").forEach(a=>{if(!(a.length>0))throw new Error("Invalid list value format");o(t.#i(e,a,r),r)}),i}static#i(e,n,r){let i=n.split("/");if(i.length>2)throw new Error(`Invalid repeat: ${n}`);return i.length===2?(i[0].includes("-")||(i[0]=`${i[0]}-${r.max}`),t.#l(e,i[0],parseInt(i[1],10),r)):t.#l(e,n,1,r)}static#s(e,n,r){if(!(!isNaN(e)&&!isNaN(n)&&e>=r.min&&n<=r.max))throw new Error(`Constraint error, got range ${e}-${n} expected range ${r.min}-${r.max}`);if(e>n)throw new Error(`Invalid range: ${e}-${n}, min(${e}) > max(${n})`)}static#c(e){if(!(!isNaN(e)&&e>0))throw new Error(`Constraint error, cannot repeat at every ${e} time.`)}static#a(e,n,r,i){let o=[];e===gh.DayOfWeek&&r%7===0&&o.push(0);for(let s=n;s<=r;s+=i)o.indexOf(s)===-1&&o.push(s);return o}static#l(e,n,r,i){let o=n.split("-");if(o.length<=1)return isNaN(+n)?n:+n;let[s,a]=o.map(c=>parseInt(c,10));return this.#s(s,a,i),this.#c(r),this.#a(e,s,a,r)}static#p(e){let n=e.split("#");if(n.length<=1)return{dayOfWeek:n[0]};let r=+n[n.length-1],i=e.match(/([,-/])/);if(i!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${i?.[0]}\` special characters are incompatible`);if(!(n.length<=2&&!isNaN(r)&&r>=1&&r<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:n[0],nthDayOfWeek:r}}static#d(e,n){return e.chars.some(r=>n.toString().includes(r))}};yh.CronExpressionParser=UZe});var JCn=$(C0=>{"use strict";var E0i=C0&&C0.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),_0i=C0&&C0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v0i=C0&&C0.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i<r.length;i++)r[i]!=="default"&&E0i(n,e,r[i]);return _0i(n,e),n}})();Object.defineProperty(C0,"__esModule",{value:!0});C0.CronFileParser=void 0;var S0i=cye(),QZe=class t{static async parseFile(e){let{readFile:n}=await Promise.resolve().then(()=>v0i(re("fs/promises"))),r=await n(e,"utf8");return t.#e(r)}static parseFileSync(e){let{readFileSync:n}=re("fs"),r=n(e,"utf8");return t.#e(r)}static#e(e){let n=e.split(`
|
|
1751
1751
|
`),r={variables:{},expressions:[],errors:{}};for(let i of n){let o=i.trim();if(o.length===0||o.startsWith("#"))continue;let s=o.match(/^(.*)=(.*)$/);if(s){let[,a,c]=s;r.variables[a]=c.replace(/["']/g,"");continue}try{let a=t.#t(o);r.expressions.push(a.interval)}catch(a){r.errors[o]=a}}return r}static#t(e){let n=e.split(" ");return{interval:S0i.CronExpressionParser.parse(n.slice(0,5).join(" ")),command:n.slice(5,n.length)}}};C0.CronFileParser=QZe});var XCn=$(qc=>{"use strict";var C0i=qc&&qc.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),I0i=qc&&qc.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&C0i(e,t,n)};Object.defineProperty(qc,"__esModule",{value:!0});qc.CronFileParser=qc.CronExpressionParser=qc.CronExpression=qc.CronFieldCollection=qc.CronDate=void 0;var T0i=cye(),k0i=nye();Object.defineProperty(qc,"CronDate",{enumerable:!0,get:function(){return k0i.CronDate}});var R0i=NZe();Object.defineProperty(qc,"CronFieldCollection",{enumerable:!0,get:function(){return R0i.CronFieldCollection}});var D0i=PZe();Object.defineProperty(qc,"CronExpression",{enumerable:!0,get:function(){return D0i.CronExpression}});var M0i=cye();Object.defineProperty(qc,"CronExpressionParser",{enumerable:!0,get:function(){return M0i.CronExpressionParser}});var O0i=JCn();Object.defineProperty(qc,"CronFileParser",{enumerable:!0,get:function(){return O0i.CronFileParser}});I0i(oye(),qc);qc.default=T0i.CronExpressionParser});var N0i,ZCn=h(()=>{"use strict";N0i=Jt(XCn(),1)});function eIn(t){return{node:t.node,preferenceSnapshot:t.preferenceSnapshot,objects:new Map([...t.objects].map(([e,n])=>[e,{...n}])),listed:new Map([...t.listed].map(([e,n])=>[e,{...n}]))}}function tIn(t){return{node:t,preferenceSnapshot:null,objects:new Map,listed:new Map}}function jZe(t,e){let n=tIn(e),r=ae(t,"SELECT preference_snapshot, listed_json FROM context_sessions WHERE node = ?").get(e);if(r!==void 0){n.preferenceSnapshot=r.preference_snapshot;for(let[o,s]of Object.entries(JSON.parse(r.listed_json)))n.listed.set(o,s)}let i=ae(t,"SELECT object, channel, level, heads_key, content_hash FROM exposures WHERE node = ?").all(e);for(let o of i){let s=n.objects.get(o.object)??{headsKey:o.heads_key,contentHash:o.content_hash};s[o.channel]=o.level,n.objects.set(o.object,s)}return WZe.set(n,eIn(n)),n}function qZe(t,e){let n=WZe.get(e)??tIn(e.node),r=JSON.stringify(Object.fromEntries(e.listed));(e.preferenceSnapshot!==n.preferenceSnapshot||r!==JSON.stringify(Object.fromEntries(n.listed)))&&ae(t,`INSERT INTO context_sessions (node, preference_snapshot, listed_json) VALUES (?, ?, ?)
|
|
1752
1752
|
ON CONFLICT(node) DO UPDATE SET preference_snapshot = excluded.preference_snapshot, listed_json = excluded.listed_json`).run(e.node,e.preferenceSnapshot,r);let i=ae(t,`INSERT INTO exposures (node, object, channel, level, heads_key, content_hash) VALUES (?, ?, ?, ?, ?, ?)
|
|
@@ -1774,7 +1774,7 @@ ${t.join(`
|
|
|
1774
1774
|
WHERE n.parent = ? AND o.deleted_at IS NULL ORDER BY o.rowid`).all(n.id),a=ae(t,"SELECT * FROM objects WHERE owner = ? AND deleted_at IS NULL ORDER BY rowid").all(n.rowid);HS(t,e,n,r.reposFn);let c={status:i?.status??"deleted",mandate_first_line:Swi(DIn(n.id)),children:o(s),owned:o(a.filter(l=>l.type!=="job")),jobs:o(a.filter(l=>l.type==="job"))},u=[wh("object",nd(t,n),ol("status",c.status)),`Mandate: ${c.mandate_first_line}`,...kU("Children",c.children),...kU("Owns",c.owned),...kU("Jobs",c.jobs)].join(`
|
|
1775
1775
|
`);return{data:c,text:u}}}});function PIn(t,e,n=Date.now()){let r=ae(t,`INSERT INTO peer_outbox (peer, kind, payload_json, idempotency_key, state, attempts, next_at, created_at)
|
|
1776
1776
|
VALUES (?, ?, ?, ?, 'pending', 0, ?, ?) ON CONFLICT (idempotency_key) DO NOTHING`).run(e.peer,e.kind,JSON.stringify(e.payload),e.key,n,n);return Number(r.changes)===0?!1:(setImmediate(()=>{for(let i of[...Cwi])try{i(e.peer)}catch{}}),!0)}var Lea,Bea,Cwi,LIn=h(()=>{"use strict";Ft();Lea=10*6e4,Bea=720*60*6e4,Cwi=new Set});import{resolve as Iwi,sep as BIn}from"node:path";function Twi(t,e,n){return ae(t,`SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1777
|
-
WHERE o.type = 'repo' AND i.scheme = ? AND i.external_id = ?`).get(e,n)??null}function kwi(t,e,n){let r=Twi(t,e.scheme,e.externalId);if(r)return r;let i=n??e.handleHint,o=ae(t,"SELECT 1 FROM objects WHERE name = ? AND type = 'repo'"),s=i;for(let a=2;o.get(s);a++)s=`${i}-${a}`;return OD(t,"repo",e.scheme,e.externalId,s)}function lV(t,e){let n=fa(Iwi(e)),r=[];for(let s of mye(n)){if(!s.ok)throw new hi("git-lookup-failed",`cannot identify the repo at ${s.dir}: ${s.reason}`,Ti.GENERAL,{dir:s.dir});r.push({root:s.root,repo:kwi(t,s)})}let i=ae(t,`SELECT o.*, i.external_id AS path FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1777
|
+
WHERE o.type = 'repo' AND i.scheme = ? AND i.external_id = ?`).get(e,n)??null}function kwi(t,e,n){let r=Twi(t,e.scheme,e.externalId);if(r)return r;let i=n??e.handleHint,o=ae(t,"SELECT 1 FROM objects WHERE name = ? AND type = 'repo' AND home_machine IS NULL"),s=i;for(let a=2;o.get(s);a++)s=`${i}-${a}`;return OD(t,"repo",e.scheme,e.externalId,s)}function lV(t,e){let n=fa(Iwi(e)),r=[];for(let s of mye(n)){if(!s.ok)throw new hi("git-lookup-failed",`cannot identify the repo at ${s.dir}: ${s.reason}`,Ti.GENERAL,{dir:s.dir});r.push({root:s.root,repo:kwi(t,s)})}let i=ae(t,`SELECT o.*, i.external_id AS path FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1778
1778
|
WHERE o.type = 'repo' AND i.scheme = 'local-path'`).all();for(let{path:s,...a}of i)(n===s||n.startsWith(s.endsWith(BIn)?s:s+BIn))&&r.push({root:s,repo:a});r.sort((s,a)=>a.root.length-s.root.length);let o=new Set;return r.filter(({repo:s})=>!o.has(s.rowid)&&(o.add(s.rowid),!0))}var _ye=h(()=>{"use strict";Ft();Co();Go();pa();ls();eet()});import{BlockList as $In,isIP as Vea}from"node:net";var FIn,Rwi,UIn=h(()=>{"use strict";FIn=new $In;for(let[t,e]of[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.88.99.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]])FIn.addSubnet(t,e,"ipv4");for(let[t,e]of[["2001::",23],["2001:4:112::",48],["2001:db8::",32],["2002::",16],["3fff::",20]])FIn.addSubnet(t,e,"ipv6");Rwi=new $In;Rwi.addSubnet("2000::",3,"ipv6")});var QIn=h(()=>{"use strict"});var WIn=h(()=>{"use strict";QIn()});var HIn=h(()=>{"use strict";Ft();Co();pa();ls();Cye();uh();k0();_ye();zD();UIn();WIn()});var Lwi,Iye,uet=h(()=>{"use strict";Lwi=new Map,Iye=t=>Lwi.get(t)??t});function qIn(t,e){let n=typeof e=="string"?rl(t,e):e;if(n===null)return null;let r=ae(t,"SELECT home_machine, envelope_json FROM peer_stubs WHERE object = ?").get(n.rowid);return r?{object:n,home_machine:r.home_machine,identity:r.envelope_json===null?null:JSON.parse(r.envelope_json)}:null}function det(t,e){let n=GIn(t,e.owner===null?null:dc(t,e.owner)),r=Bwi(t,e.type);return{id:e.id,type:e.type,kind:e.kind,name:e.name,preview:e.preview,owner:n,privacy:e.privacy,...r===null?{}:{kind_decl:r}}}function GIn(t,e){if(e===null||e.type!=="person"&&e.type!=="app"&&e.type!=="repo"&&e.type!=="profile")return null;let n=ae(t,"SELECT scheme, external_id FROM identities WHERE object = ?").get(e.rowid);return{id:e.id,type:e.type,scheme:n?.scheme??null,external_id:n?.external_id??null,handle:e.name}}function Bwi(t,e){let n=ae(t,"SELECT owner, description, events_json FROM object_kinds WHERE name = ?").get(e),r=n===void 0?null:GIn(t,dc(t,n.owner));return n===void 0||r===null?null:{name:e,description:n.description,events:JSON.parse(n.events_json),owner:r}}var zIn=h(()=>{"use strict";Ft();ls();HIn();Co();pa();uet()});function Fwi(t,e){let n=typeof e?.pointer=="string"?e.pointer:void 0,r=n===void 0?null:rl(t,n);if(r===null||r.type!=="document"||r.deleted_at!==null)return;let i=hU(t,r)[0];if(i===void 0)return;let o=ae(t,"SELECT source_path FROM documents WHERE object = ?").get(r.rowid);return MS(i.body_hash,o?.source_path??null)}function Uwi(t,e,n){let r=ae(t,"SELECT message_id, event, object_id, level, actor_id, body_ref, body_json FROM messages WHERE message_id = ?").get(e);if(r===void 0)throw new Error(`no message ${e}`);let i=rl(t,r.object_id);if(i===null)throw new Error(`no object ${r.object_id}`);let o=r.actor_id===null?null:rl(t,r.actor_id),s=r.body_json===null?{}:JSON.parse(r.body_json),{push:a,bodyRef:c,...u}=s,l=r.body_ref===null?void 0:Fwi(t,a);return{key:n,message_id:r.message_id,event:r.event,level:r.level,object:det(t,i),actor:o===null?null:det(t,o),attrs:a?.attrs??{},...Object.keys(u).length>0?{body:u}:{},...l===void 0?{}:{body_text:l}}}var $wi,VIn,KIn=h(()=>{"use strict";Ft();NS();OS();ls();LIn();zIn();$wi=(t,e)=>`ev:${t}:${e}`;VIn={bodyOwner:()=>null,enqueue(t,e,n){for(let r of n){let i=qIn(t,r.id);if(i===null)continue;let o=$wi(e.messageId,r.id);PIn(t,{peer:i.home_machine,kind:"event",key:o,payload:{...Uwi(t,e.messageId,o),...r.linked?{linked:!0}:{}}})}}}});import{randomBytes as Qwi}from"node:crypto";function RU(t,e){let n=ae(t,"SELECT receiver_json FROM custom_objects WHERE object = ?").get(e.rowid);if(!n?.receiver_json)return;let r=JSON.parse(n.receiver_json);if(r==="queue")return"queue";if(r&&typeof r=="object"&&!Array.isArray(r)){if("url"in r)return"url";if("argv"in r)return"argv"}}function jIn(t){setImmediate(()=>{for(let e of Wwi.get(t)??[])e()})}function Hwi(t,e){let n=ae(t,`SELECT COUNT(*) AS n FROM deliveries WHERE destination_id = ?
|
|
1779
1779
|
AND state = 'pending' AND canceled_at IS NULL`).get(e).n;if(n<=YIn)return;let r=ae(t,`SELECT delivery_id, message_id FROM deliveries
|
|
1780
1780
|
WHERE destination_id = ? AND state = 'pending' AND canceled_at IS NULL
|
|
@@ -1806,7 +1806,7 @@ ${t.join(`
|
|
|
1806
1806
|
AND d.type = 'document' AND d.name = ? AND d.deleted_at IS NULL LIMIT 1`).get(e.name,e.type,n)?`${e.type}:${e.name}`:e.name}function uxi(t,e,n){let r=ae(t,`SELECT e.written_as, o.* FROM edges e JOIN objects o ON o.rowid = e.dst
|
|
1807
1807
|
WHERE e.type = 'links-to' AND e.src = ? AND e.written_as IS NOT NULL`).all(e.rowid);if(r.length===0)return n;let i=new Map;for(let o of r){if(o.deleted_at||o.written_as===o.id)continue;let s=!o.written_as.includes("/");if(s&&o.name===o.written_as)continue;let a=o.owner===null?null:dc(t,o.owner),c=a?`${cxi(t,a,o.name)}/${o.name}`:o.name,u=s&&o.owner===e.owner?o.name:c;u!==o.written_as&&i.set(o.written_as,u)}return i.size===0?n:n.replace(/\[\[([^[\]\n]+?)\]\]/g,(o,s)=>{let a=i.get(s.trim());return a===void 0?o:`[[${a}]]`})}function lxi(t,e,n,r){let i=aet(e),{heads_key:o}=kye(t,n);T0(t,i,n,"read",{readHeadsKey:o}),Ah(t,{event:"read",object:n,actor:i,attrs:{}},r)}function iTn(t,e,n,r){return oxi(n),sxi(t,e,n),ixi(t,()=>{let i=kye(t,n),o=hU(t,n).map(a=>({...a,body:uxi(t,n,MS(a.body_hash,i.source_path))})),s=ae(t,"SELECT dst, written_as FROM edges WHERE type = 'links-to' AND src = ? ORDER BY written_as").all(n.rowid).map(a=>({written_as:a.written_as??"",object:dc(t,a.dst)})).filter(a=>a.object&&nl(t,e,a.object)).map(a=>({...a,deleted:a.object.deleted_at!==null}));return n.deleted_at||lxi(t,e,n,r),{object:n,record:i,heads:o,needsMerge:o.length>1,links:s}})}var rxi,NS=h(()=>{"use strict";Ft();Co();pa();uh();OS();Ige();k0();G6();ls();bge();ub();rxi=0});var set=h(()=>{"use strict";Ft();di();OS();NS();ls()});var oTn=h(()=>{"use strict"});var sTn=h(()=>{"use strict";Ft();_o();v0();di();Go();tb();set();oTn()});var aTn=h(()=>{"use strict";Ft();di()});var cTn=h(()=>{"use strict";Rr()});var uTn=h(()=>{"use strict";di()});var WS=h(()=>{"use strict";Wvn();z6();Rr();v0();qvn();pV();vge();Jvn();sTn();aTn();Tge();cTn();uTn();di()});function Rye(t){return t==null?[...kD]:[...t]}function Dye(t){return lK(t)!==null?"project":"user"}function Mye(t){if(t==null||t==="")return null;try{return Bf(t).manifest.name}catch(e){return e instanceof hi&&e.code==="not_found"||console.warn(`[subject] profile "${t}" failed to resolve for node subject assembly: ${e.message}`),null}}var Oye=h(()=>{"use strict";fd();Su();Co();U6()});function lTn(t){let e=t,n=new Set,r=0;for(;!n.has(e);){n.add(e);let i=DD(e);if(i===null||i.parent==null)break;e=i.parent,r++}return r}function dxi(t,e){let n=ir(),r=Rge(t,e,i=>lV(n,i),mU(n));return[...r.repos,...r.projectRepos]}function dTn(t,e){let n=ed(t);return n===null?null:{kind:n.kind,mode:n.mode,lifecycle:n.lifecycle,hasManager:(n.parent??null)!==null,cwd:n.cwd,scope:Dye(n.cwd),orchestration:{depth:lTn(t)},profile:Mye(n.profile_id),scopes:Rye(n.scopes),repo:(e??dxi(n.cwd,n.profile_id??null)).map(r=>r.name)}}var get=h(()=>{"use strict";WS();di();_ye();Y6();Oye();Oye()});function fV(t){return t.type==="node"?t.id:t.name}function pxi(t){return`${t.type}:${fV(t)}`}function fxi(t,e,n){if(n?.class==="node"&&n.profile!==null&&n.profile.rowid===e.rowid)return"content";let r=t?.delivery_limits;return r?r[pxi(e)]??r[fV(e)]??"content":"content"}function yet(t,e){if(e.class!=="node"||e.profile===null)return null;let n=ae(t,"SELECT external_id FROM identities WHERE object = ? AND scheme = 'profile'").get(e.profile.rowid);if(!n)throw new Error(`profile object ${e.profile.id} has no profile identity`);return MC(n.external_id).manifest}function Nye(t,e,n){return t.prepare(`SELECT o.*, d.heads_key, d.unlisted, d.source_path FROM objects o JOIN documents d ON d.object = o.rowid
|
|
1808
1808
|
WHERE o.type = 'document' AND o.deleted_at IS NULL AND ${e} ORDER BY o.rowid`).all(...n)}function mxi(t,e){let n=e.heads_key.split(","),r=t.prepare(`SELECT body_hash FROM revisions WHERE document = ? AND rev_id IN (${n.map(()=>"?").join(",")})
|
|
1809
|
-
ORDER BY number DESC LIMIT 1`).get(e.rowid,...n);if(!r)throw new Error(`document ${e.id} has no head revision ${e.heads_key}`);return r.body_hash}function Aet(t,e,n){let r=new Map;return{view:n,readable:i=>{let o=r.get(i.rowid);return o===void 0&&r.set(i.rowid,o=nl(t,e,i)),o}}}function wet(t,e,n,r,i,o){let{view:s}=n,a=s.findIndex(y=>y.rowid===i.owner),c=a>=0?s[a]:ae(t,"SELECT * FROM objects WHERE rowid = ?").get(i.owner),u=fV(c),l=xge(t,e,i.name,n),d=mxi(t,i),{heads_key:p,unlisted:f,source_path:m,...g}=i;return{object:g,owner:c,ownerHandle:u,viewRank:a>=0?a:s.length,ownNode:e.class==="node"&&i.owner===e.node.rowid,shipped:m!==null,kind:i.kind==="preference"?"preference":"knowledge",name:i.name,displayName:"object"in l&&l.object.rowid===i.rowid?i.name:`${u}/${i.name}`,preview:i.preview,unlisted:f!==0,headsKey:p,bodyHash:d,body:()=>MS(d,m),rules:o,limit:fxi(r,c,e)}}function Aye(t,e,n){let r=pU(t,e),i=Aet(t,e,r),o=yet(t,e),s=new Map;for(let d of Qvn(t,n,r.map(p=>p.rowid)))s.set(d.object,[...s.get(d.object)??[],d]);let a=e.class==="node"&&n.includes("boot")?Nye(t,"o.owner = ?",[e.node.rowid]):[],c=[...new Set([...s.keys(),...a.map(d=>d.rowid)])],u=c.length===0?[]:Nye(t,`o.rowid IN (${c.map(()=>"?").join(",")})`,c),l=new Map(r.map((d,p)=>[d.rowid,p]));return u.filter(i.readable).sort((d,p)=>l.get(d.owner)-l.get(p.owner)||d.rowid-p.rowid).map(d=>wet(t,e,i,o,d,s.get(d.rowid)??[]))}function cV(t,e,n){let r=Nye(t,"o.rowid = ?",[n.rowid])[0];if(!r)throw new Error(`document ${n.id} has no documents row`);return wet(t,e,Aet(t,e,pU(t,e)),yet(t,e),r,fU(t,r))}function ret(t,e,n){let r=Aet(t,e,pU(t,e)),i=yet(t,e);return Nye(t,"o.owner = ? AND d.unlisted = 0",[n.rowid]).filter(r.readable).map(o=>wet(t,e,r,i,o,fU(t,o)))}function xet(t,e){if(e.class!=="node")throw new Error(`nodeSubject needs a node reader, got ${e.class}`);let n=dTn(e.node.id,[...e.repos,...e.projectRepos]);if(n===null)throw new Error(`no node ${e.node.id}`);return n}var uV=h(()=>{"use strict";Ft();uh();OS();G6();bge();Su();get()});var pTn=h(()=>{"use strict";fd();sK()});function fTn(t){if(t.class!=="node")throw new Error(`delivery needs a node reader, got ${t.class}`);return t}function gxi(t){return t.node.rowid===hxi}function mTn(t,e,n,r=i=>lV(t,i)){let i=fTn(e).node,o=new Set,s=new Date().toISOString(),a=[];for(let{doc:c,level:u}of n)u!=="content"||o.has(c.object.rowid)||(o.add(c.object.rowid),T0(t,i,c.object,"deliver",{readHeadsKey:c.headsKey}),Ah(t,{event:"read",object:c.object,actor:i,attrs:{}},r),a.push({name:c.name,scope:c.ownerHandle,at:s,type:"loaded"}));gxi(fTn(e))||age(t,i.id,a)}var hxi,hTn=h(()=>{"use strict";Ft();IU();ub();k0();G6();_ye();Y6();ls();G6();U6();WS();wXe();Su();pTn();Oye();get();HD();Rr();PXe();ld();xye();uV();pye();gye();yye();iet();hxi=-1});function yxi(t,e,n){let r=`${n.name}/`;return ae(t,`SELECT * FROM objects WHERE type = 'document' AND deleted_at IS NULL AND owner IS ?
|
|
1809
|
+
ORDER BY number DESC LIMIT 1`).get(e.rowid,...n);if(!r)throw new Error(`document ${e.id} has no head revision ${e.heads_key}`);return r.body_hash}function Aet(t,e,n){let r=new Map;return{view:n,readable:i=>{let o=r.get(i.rowid);return o===void 0&&r.set(i.rowid,o=nl(t,e,i)),o}}}function wet(t,e,n,r,i,o){let{view:s}=n,a=s.findIndex(y=>y.rowid===i.owner),c=a>=0?s[a]:ae(t,"SELECT * FROM objects WHERE rowid = ?").get(i.owner),u=fV(c),l=xge(t,e,i.name,n),d=mxi(t,i),{heads_key:p,unlisted:f,source_path:m,...g}=i;return{object:g,owner:c,ownerHandle:u,viewRank:a>=0?a:s.length,ownNode:e.class==="node"&&i.owner===e.node.rowid,shipped:m!==null,kind:i.kind==="preference"?"preference":"knowledge",name:i.name,displayName:"object"in l&&l.object.rowid===i.rowid?i.name:`${u}/${i.name}`,preview:i.preview,unlisted:f!==0,headsKey:p,bodyHash:d,body:()=>MS(d,m),rules:o,limit:fxi(r,c,e)}}function Aye(t,e,n){let r=pU(t,e),i=Aet(t,e,r),o=yet(t,e),s=new Map;for(let d of Qvn(t,n,r.map(p=>p.rowid)))s.set(d.object,[...s.get(d.object)??[],d]);let a=e.class==="node"&&n.includes("boot")?Nye(t,"o.owner = ?",[e.node.rowid]):[],c=[...new Set([...s.keys(),...a.map(d=>d.rowid)])],u=c.length===0?[]:Nye(t,`o.rowid IN (${c.map(()=>"?").join(",")})`,c),l=new Map(r.map((d,p)=>[d.rowid,p]));return u.filter(i.readable).sort((d,p)=>l.get(d.owner)-l.get(p.owner)||d.rowid-p.rowid).map(d=>wet(t,e,i,o,d,s.get(d.rowid)??[]))}function cV(t,e,n){let r=Nye(t,"o.rowid = ?",[n.rowid])[0];if(!r)throw new Error(`document ${n.id} has no documents row`);return wet(t,e,Aet(t,e,pU(t,e)),yet(t,e),r,fU(t,r))}function ret(t,e,n){let r=Aet(t,e,pU(t,e)),i=yet(t,e);return Nye(t,"o.owner = ? AND d.unlisted = 0",[n.rowid]).filter(r.readable).map(o=>wet(t,e,r,i,o,fU(t,o)))}function xet(t,e){if(e.class!=="node")throw new Error(`nodeSubject needs a node reader, got ${e.class}`);let n=dTn(e.node.id,[...e.repos,...e.projectRepos]);if(n===null)throw new Error(`no node ${e.node.id}`);return n}var uV=h(()=>{"use strict";Ft();uh();OS();G6();bge();Su();get()});var pTn=h(()=>{"use strict";fd();sK()});function fTn(t){if(t.class!=="node")throw new Error(`delivery needs a node reader, got ${t.class}`);return t}function gxi(t){return t.node.rowid===hxi}function mTn(t,e,n,r=i=>lV(t,i)){let i=fTn(e).node,o=new Set,s=new Date().toISOString(),a=[];for(let{doc:c,level:u}of n)u!=="content"||o.has(c.object.rowid)||(o.add(c.object.rowid),T0(t,i,c.object,"deliver",{readHeadsKey:c.headsKey}),Ah(t,{event:"read",object:c.object,actor:i,attrs:{}},r),a.push({name:c.name,scope:c.ownerHandle,at:s,type:"loaded"}));gxi(fTn(e))||age(t,i.id,a)}var hxi,hTn=h(()=>{"use strict";Ft();IU();ub();k0();G6();_ye();Y6();ls();G6();U6();WS();wXe();Su();pTn();Oye();get();HD();Rr();PXe();ld();xye();uV();pye();gye();yye();iet();hxi=-1});function yxi(t,e,n){let r=`${n.name}/`;return ae(t,`SELECT * FROM objects WHERE type = 'document' AND deleted_at IS NULL AND home_machine IS NULL AND owner IS ?
|
|
1810
1810
|
AND substr(name, 1, ?) = ? ORDER BY name`).all(n.owner,r.length,r).filter(o=>!o.name.slice(r.length).includes("/")&&nl(t,e,o)).map(o=>nd(t,o))}function Axi(t,e,n){let r=e.class==="node",i=r?jZe(t,e.node.rowid):{node:0,preferenceSnapshot:null,objects:new Map,listed:new Map},o={db:t,reader:e,subject:r?xet(t,e):null,ledger:i,channel:"transcript"},s=net(o,cV(t,e,n));return r&&(mTn(t,e,s.delivered),qZe(t,i)),{attachments:s.attachments,linked:s.linked.map(a=>a.object)}}function wxi(t,e,n){if(e.class!=="node"||n.kind!=="knowledge"&&n.kind!=="preference"||n.owner===null)return;let r=dc(t,n.owner);r!==null&&age(t,e.node.id,[{name:n.name,scope:fV(r),at:new Date().toISOString(),type:"read"}])}function xxi(t,e){let n=[];if(e.attachments&&n.push(e.attachments,""),n.push(wh("object",t,ol("privacy",t.privacy)+ol("revision",e.revision))),n.push(`Preview: ${t.preview}`),e.summary&&n.push(`Summary: ${e.summary}`),e.fields!==void 0&&n.push(`<fields>
|
|
1811
1811
|
${JSON.stringify(e.fields,null,2)}
|
|
1812
1812
|
</fields>`),e.needs_merge?(e.heads.forEach((r,i)=>{n.push(`<head${ol("rev",r.rev_id)}${ol("number",r.number)}${ol("author",r.author_id)}>`,e.bodies[i]??"","</head>")}),n.push(`This document has ${e.heads.length} heads. Your next \`crtr doc edit\` writes the merged body and joins them into one revision.`)):n.push("",e.bodies[0]??""),e.listing&&e.listing.length>0){let r=e.listing.some(s=>s.owner?.id===t.owner?.id&&s.name.startsWith(`${t.name}/`)),i=e.listing.some(s=>s.owner?.id!==t.owner?.id||!s.name.startsWith(`${t.name}/`)),o=r&&i?`Names under ${t.name}/ and documents it links to`:r?`Names under ${t.name}/`:"Documents it links to";n.push("",...kU(o,e.listing))}return n.join(`
|
|
@@ -1818,11 +1818,11 @@ Summary: ${u.summary??""}
|
|
|
1818
1818
|
State: ${JSON.stringify(u.state)}
|
|
1819
1819
|
Published: ${u.published_at??"never"}
|
|
1820
1820
|
Receiver: ${u.receiver??"none"}
|
|
1821
|
-
Dropped: ${u.dropped}`}}}}var TTn=h(()=>{"use strict";Ft();qD();GD();jD();zD()});function DTn(){return kTn??=new Map([yTn,NIn,_Tn,bTn,...STn].map(t=>[t.name,t])),kTn}function _xi(t){return[...DTn().keys(),...ae(t,"SELECT name FROM object_kinds ORDER BY name").all().map(e=>e.name)]}function vxi(t,e){let n=RTn.get(t);n||(n=new Map,RTn.set(t,n));let r=n.get(e);if(r)return r;let i=ae(t,"SELECT events_json FROM object_kinds WHERE name = ?").get(e);if(!i)return null;let o=ITn(e,JSON.parse(i.events_json));return n.set(e,o),o}function DU(t,e){let n=DTn().get(e)??vxi(t,e);if(n==null)throw new hi("unknown_kind",`no object kind named ${JSON.stringify(e)}; the kinds are ${_xi(t).join(", ")}`,Ti.USAGE,{kind:e});return n}function nTn(t,e,n){let r=DU(t,e).events,i=Object.hasOwn(r,n)?r[n]:void 0;if(i===void 0)throw new hi("unknown_event",`${e} declares no event ${JSON.stringify(n)}; it declares ${Object.keys(r).join(", ")}`,Ti.USAGE,{kind:e,event:n,declared:Object.keys(r)});return i}var kTn,RTn,Cye=h(()=>{"use strict";Ft();Co();pa();ATn();ETn();cet();vTn();CTn();TTn();kTn=null;RTn=new WeakMap});function MTn(t){return t||null}function rl(t,e){return MTn(ae(t,"SELECT * FROM objects WHERE id = ?").get(e))}function dc(t,e){return MTn(ae(t,"SELECT * FROM objects WHERE rowid = ?").get(e))}function VD(t,e){return DU(t,e.type),ae(t,`INSERT INTO objects (id, type, kind, owner, privacy, name, preview, created_at)
|
|
1822
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`).get(e.id??Eet(),e.type,e.kind,e.owner,e.privacy,e.name,e.preview,new Date().toISOString())}function OD(t,e,n,r,i,o){if(!Sxi.has(e))throw new Error(`ensureOwner: ${e} is not an owner type`);let s=ae(t,`SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1821
|
+
Dropped: ${u.dropped}`}}}}var TTn=h(()=>{"use strict";Ft();qD();GD();jD();zD()});function DTn(){return kTn??=new Map([yTn,NIn,_Tn,bTn,...STn].map(t=>[t.name,t])),kTn}function _xi(t){return[...DTn().keys(),...ae(t,"SELECT name FROM object_kinds ORDER BY name").all().map(e=>e.name)]}function vxi(t,e){let n=RTn.get(t);n||(n=new Map,RTn.set(t,n));let r=n.get(e);if(r)return r;let i=ae(t,"SELECT events_json FROM object_kinds WHERE name = ?").get(e);if(!i)return null;let o=ITn(e,JSON.parse(i.events_json));return n.set(e,o),o}function DU(t,e){let n=DTn().get(e)??vxi(t,e);if(n==null)throw new hi("unknown_kind",`no object kind named ${JSON.stringify(e)}; the kinds are ${_xi(t).join(", ")}`,Ti.USAGE,{kind:e});return n}function nTn(t,e,n){let r=DU(t,e).events,i=Object.hasOwn(r,n)?r[n]:void 0;if(i===void 0)throw new hi("unknown_event",`${e} declares no event ${JSON.stringify(n)}; it declares ${Object.keys(r).join(", ")}`,Ti.USAGE,{kind:e,event:n,declared:Object.keys(r)});return i}var kTn,RTn,Cye=h(()=>{"use strict";Ft();Co();pa();ATn();ETn();cet();vTn();CTn();TTn();kTn=null;RTn=new WeakMap});function MTn(t){return t||null}function rl(t,e){return MTn(ae(t,"SELECT * FROM objects WHERE id = ?").get(e))}function dc(t,e){return MTn(ae(t,"SELECT * FROM objects WHERE rowid = ?").get(e))}function VD(t,e){return DU(t,e.type),ae(t,`INSERT INTO objects (id, type, kind, owner, privacy, name, preview, created_at, home_machine)
|
|
1822
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`).get(e.id??Eet(),e.type,e.kind,e.owner,e.privacy,e.name,e.preview,new Date().toISOString(),e.home_machine??null)}function OD(t,e,n,r,i,o){if(!Sxi.has(e))throw new Error(`ensureOwner: ${e} is not an owner type`);let s=ae(t,`SELECT o.* FROM identities i JOIN objects o ON o.rowid = i.object
|
|
1823
1823
|
WHERE i.scheme = ? AND i.external_id = ?`).get(n,r);if(s)return s;let a=ae(t,`SELECT o.id, o.type, i.scheme, i.external_id FROM objects o
|
|
1824
1824
|
LEFT JOIN identities i ON i.object = o.rowid
|
|
1825
|
-
WHERE o.name = ? AND o.type =
|
|
1825
|
+
WHERE o.name = ? AND o.type = ? AND o.home_machine IS NULL`).get(i,e);if(a)throw new hi("conflict",`handle "${i}" is held by ${a.type} ${a.id} (${a.scheme}:${a.external_id}); cannot give it to ${e} ${n}:${r}`,Ti.GENERAL,{handle:i,holder:a.id});let c=VD(t,{type:e,kind:null,owner:e==="profile"?o?.rowid??null:null,privacy:"public",name:i,preview:""});return ae(t,"INSERT INTO identities (object, scheme, external_id) VALUES (?, ?, ?)").run(c.rowid,n,r),c}var Sxi,ls=h(()=>{"use strict";Ft();Co();pa();_et();Cye();uh();OS();Sxi=new Set(["person","app","repo","profile"])});var OTn=h(()=>{"use strict";Ft();ls();ub();zD();kge();F6()});var NTn=h(()=>{"use strict";Ft();vge();NS();k0();ls();W6()});function PTn(t){let e=t.find(n=>n.threshold<=7);return e!==void 0&&e.delivery!=="next-turn"}function vet(t,e,...n){let r=t.prepare(`SELECT wo.id AS from_id, oo.id AS to_id, ws.config_json, ws.created_at,
|
|
1826
1826
|
wo.listen_json, wn.status AS from_status, onode.status AS to_status
|
|
1827
1827
|
FROM watches w
|
|
1828
1828
|
JOIN objects wo ON wo.rowid = w.watcher AND wo.type = 'node'
|