@galaxy-tool-util/gxwf-web 1.4.0 → 1.5.0
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/package.json +5 -5
- package/public/assets/{FileView-CsOpVj29.js → FileView-fG7RG6QP.js} +1 -1
- package/public/assets/{ToolCacheView-bRFTq8lT.js → ToolCacheView-TNGPFceD.js} +2 -2
- package/public/assets/WorkflowView-D0y_HEKs.js +198 -0
- package/public/assets/{architectureDiagram-Q4EWVU46-jinf4bpr.js → architectureDiagram-Q4EWVU46-CAgVzFqE.js} +1 -1
- package/public/assets/{blockDiagram-DXYQGD6D-DyH9QtyX.js → blockDiagram-DXYQGD6D-BgA362BK.js} +1 -1
- package/public/assets/{c4Diagram-AHTNJAMY-eIaaNFF5.js → c4Diagram-AHTNJAMY-KGdXuDOE.js} +1 -1
- package/public/assets/channel-DDEfYj9m.js +1 -0
- package/public/assets/{chunk-336JU56O-K6Z1vrz8.js → chunk-336JU56O-DU7Z6ZqP.js} +2 -2
- package/public/assets/{chunk-426QAEUC-B7stkjff.js → chunk-426QAEUC-DYNMZOw6.js} +1 -1
- package/public/assets/{chunk-4TB4RGXK-DzYiMt8K.js → chunk-4TB4RGXK-ClYdUZGQ.js} +1 -1
- package/public/assets/{chunk-5FUZZQ4R-BXjMW0vl.js → chunk-5FUZZQ4R-BTrpKOs2.js} +1 -1
- package/public/assets/{chunk-5PVQY5BW-DpYMb9bR.js → chunk-5PVQY5BW-Dc2FZZd9.js} +1 -1
- package/public/assets/{chunk-EDXVE4YY-B13SDZ3c.js → chunk-EDXVE4YY-Cb_jQNPc.js} +1 -1
- package/public/assets/{chunk-ENJZ2VHE-DrVCiAoi.js → chunk-ENJZ2VHE-D72PJYFH.js} +1 -1
- package/public/assets/{chunk-ICPOFSXX-DwxYmUOT.js → chunk-ICPOFSXX-BfFbNaWT.js} +1 -1
- package/public/assets/{chunk-OYMX7WX6-CmfQJYSW.js → chunk-OYMX7WX6-BJ7HnA9i.js} +1 -1
- package/public/assets/{chunk-U2HBQHQK-oBXc92ns.js → chunk-U2HBQHQK-Cw2C_MTw.js} +1 -1
- package/public/assets/{chunk-X2U36JSP-CWkpvLVO.js → chunk-X2U36JSP-D9cn8Q0g.js} +1 -1
- package/public/assets/{chunk-YZCP3GAM-0MxWrEbo.js → chunk-YZCP3GAM-DbF6Xmqb.js} +1 -1
- package/public/assets/{chunk-ZZ45TVLE-BqOxN5U6.js → chunk-ZZ45TVLE-jc5HPlLj.js} +1 -1
- package/public/assets/classDiagram-6PBFFD2Q-BonxU2Pr.js +1 -0
- package/public/assets/classDiagram-v2-HSJHXN6E-DIw72pvQ.js +1 -0
- package/public/assets/clone-b9hz-7Rr.js +1 -0
- package/public/assets/{dagre-BxiFovGJ.js → dagre-CgPPoXdp.js} +1 -1
- package/public/assets/{dagre-KV5264BT-1zSgR5z0.js → dagre-KV5264BT-CEnKOkJD.js} +1 -1
- package/public/assets/{diagram-5BDNPKRD-DpWxP0aE.js → diagram-5BDNPKRD-9tqQbmWk.js} +1 -1
- package/public/assets/{diagram-G4DWMVQ6-BhUB45RQ.js → diagram-G4DWMVQ6-BmYgThWl.js} +1 -1
- package/public/assets/{diagram-MMDJMWI5-D3tAT1JA.js → diagram-MMDJMWI5-DivvwOWS.js} +1 -1
- package/public/assets/{diagram-TYMM5635-Y66BFGuY.js → diagram-TYMM5635-D1_Tj6pF.js} +1 -1
- package/public/assets/{erDiagram-SMLLAGMA-olVV48Hp.js → erDiagram-SMLLAGMA-CYSV0BE4.js} +1 -1
- package/public/assets/{flowDiagram-DWJPFMVM-QayyKS33.js → flowDiagram-DWJPFMVM-BGIkFQ6t.js} +1 -1
- package/public/assets/{ganttDiagram-T4ZO3ILL-DmE3LL1i.js → ganttDiagram-T4ZO3ILL-VI4Gbq3U.js} +1 -1
- package/public/assets/{gitGraphDiagram-UUTBAWPF-KhK3dvbQ.js → gitGraphDiagram-UUTBAWPF-Do1y70il.js} +1 -1
- package/public/assets/{graphlib-Bi-ymRsv.js → graphlib-DgT5U4LD.js} +1 -1
- package/public/assets/{index-4Ycp0GGC.js → index-DujJTa6m.js} +2 -2
- package/public/assets/{infoDiagram-42DDH7IO-BmhfgIe-.js → infoDiagram-42DDH7IO-CsPsiDMr.js} +1 -1
- package/public/assets/{ishikawaDiagram-UXIWVN3A-D-BfQrbQ.js → ishikawaDiagram-UXIWVN3A-BKfIGTr_.js} +1 -1
- package/public/assets/{journeyDiagram-VCZTEJTY-CT0HRztw.js → journeyDiagram-VCZTEJTY-Dew-JWJP.js} +1 -1
- package/public/assets/{kanban-definition-6JOO6SKY-BZnydE-0.js → kanban-definition-6JOO6SKY-B49jS5tm.js} +1 -1
- package/public/assets/{line-qKqldnLj.js → line-DLs8pe8_.js} +1 -1
- package/public/assets/{mermaid-parser.core-C09j9HB7.js → mermaid-parser.core-C7uDfEv_.js} +1 -1
- package/public/assets/{mermaid.core-BDhviqRd.js → mermaid.core-DZ5cLraE.js} +3 -3
- package/public/assets/{mindmap-definition-QFDTVHPH-Dt3WMSPV.js → mindmap-definition-QFDTVHPH-Dtd9nryT.js} +1 -1
- package/public/assets/{pieDiagram-DEJITSTG-Yqe8uCAr.js → pieDiagram-DEJITSTG-DecnWuHL.js} +1 -1
- package/public/assets/{quadrantDiagram-34T5L4WZ-D6S_SKNN.js → quadrantDiagram-34T5L4WZ-rwtCHNqR.js} +1 -1
- package/public/assets/{requirementDiagram-MS252O5E-jfbAS50v.js → requirementDiagram-MS252O5E-B_KKFFTQ.js} +1 -1
- package/public/assets/{sankeyDiagram-XADWPNL6-BAUJwgc9.js → sankeyDiagram-XADWPNL6-6dvvnj4L.js} +1 -1
- package/public/assets/{sequenceDiagram-FGHM5R23-D7HLbuOf.js → sequenceDiagram-FGHM5R23--QMwD4p7.js} +1 -1
- package/public/assets/{stateDiagram-FHFEXIEX-BX7o31BE.js → stateDiagram-FHFEXIEX-CG8TGK15.js} +1 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-Diy8mz-j.js +1 -0
- package/public/assets/{timeline-definition-GMOUNBTQ-CZLMeEm3.js → timeline-definition-GMOUNBTQ-RU_gK7LU.js} +1 -1
- package/public/assets/useToolInfoService-C1D4X77C.js +276 -0
- package/public/assets/{vennDiagram-DHZGUBPP-CU_yL8Jq.js → vennDiagram-DHZGUBPP-DkBDAkqR.js} +1 -1
- package/public/assets/{wardleyDiagram-NUSXRM2D-BJ2G793c.js → wardleyDiagram-NUSXRM2D-BC-MZSUZ.js} +1 -1
- package/public/assets/{xychartDiagram-5P7HB3ND-CtCVgkGt.js → xychartDiagram-5P7HB3ND-YSSUwZXU.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/WorkflowView-CRSqinCX.js +0 -198
- package/public/assets/channel-B9wkeALp.js +0 -1
- package/public/assets/classDiagram-6PBFFD2Q-A_f6K02B.js +0 -1
- package/public/assets/classDiagram-v2-HSJHXN6E-DrcrbPO1.js +0 -1
- package/public/assets/clone-grQBEjNN.js +0 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-Co5H7aCg.js +0 -1
- package/public/assets/useToolInfoService-BoFJqmDR.js +0 -276
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./chunk-Bj-mKKzh.js";import{$t as i,Cn as a,E as o,En as s,Ft as c,I as l,It as u,Jt as d,Lt as f,Nt as p,Qt as m,Rt as h,St as g,Wt as _,Xt as v,Yt as ee,Z as te,Zt as ne,_ as re,_n as ie,at as ae,c as oe,dn as se,fn as ce,gn as le,it as ue,ln as de,lt as fe,pn as pe,qt as me,rn as he,sn as ge,un as _e,x as ve,xt as ye,yt as be}from"./useApi-CXAk43j3.js";import{g as xe,h as Se,l as Ce,u as we}from"./index-DujJTa6m.js";import"./browser-DVDf39JZ.js";var Te=o.extend({name:`togglebutton`,style:`
|
|
2
|
+
.p-togglebutton {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
user-select: none;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
8
|
+
color: dt('togglebutton.color');
|
|
9
|
+
background: dt('togglebutton.background');
|
|
10
|
+
border: 1px solid dt('togglebutton.border.color');
|
|
11
|
+
padding: dt('togglebutton.padding');
|
|
12
|
+
font-size: 1rem;
|
|
13
|
+
font-family: inherit;
|
|
14
|
+
font-feature-settings: inherit;
|
|
15
|
+
transition:
|
|
16
|
+
background dt('togglebutton.transition.duration'),
|
|
17
|
+
color dt('togglebutton.transition.duration'),
|
|
18
|
+
border-color dt('togglebutton.transition.duration'),
|
|
19
|
+
outline-color dt('togglebutton.transition.duration'),
|
|
20
|
+
box-shadow dt('togglebutton.transition.duration');
|
|
21
|
+
border-radius: dt('togglebutton.border.radius');
|
|
22
|
+
outline-color: transparent;
|
|
23
|
+
font-weight: dt('togglebutton.font.weight');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.p-togglebutton-content {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex: 1 1 auto;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
gap: dt('togglebutton.gap');
|
|
32
|
+
padding: dt('togglebutton.content.padding');
|
|
33
|
+
background: transparent;
|
|
34
|
+
border-radius: dt('togglebutton.content.border.radius');
|
|
35
|
+
transition:
|
|
36
|
+
background dt('togglebutton.transition.duration'),
|
|
37
|
+
color dt('togglebutton.transition.duration'),
|
|
38
|
+
border-color dt('togglebutton.transition.duration'),
|
|
39
|
+
outline-color dt('togglebutton.transition.duration'),
|
|
40
|
+
box-shadow dt('togglebutton.transition.duration');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover {
|
|
44
|
+
background: dt('togglebutton.hover.background');
|
|
45
|
+
color: dt('togglebutton.hover.color');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.p-togglebutton.p-togglebutton-checked {
|
|
49
|
+
background: dt('togglebutton.checked.background');
|
|
50
|
+
border-color: dt('togglebutton.checked.border.color');
|
|
51
|
+
color: dt('togglebutton.checked.color');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.p-togglebutton-checked .p-togglebutton-content {
|
|
55
|
+
background: dt('togglebutton.content.checked.background');
|
|
56
|
+
box-shadow: dt('togglebutton.content.checked.shadow');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.p-togglebutton:focus-visible {
|
|
60
|
+
box-shadow: dt('togglebutton.focus.ring.shadow');
|
|
61
|
+
outline: dt('togglebutton.focus.ring.width') dt('togglebutton.focus.ring.style') dt('togglebutton.focus.ring.color');
|
|
62
|
+
outline-offset: dt('togglebutton.focus.ring.offset');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.p-togglebutton.p-invalid {
|
|
66
|
+
border-color: dt('togglebutton.invalid.border.color');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.p-togglebutton:disabled {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
cursor: default;
|
|
72
|
+
background: dt('togglebutton.disabled.background');
|
|
73
|
+
border-color: dt('togglebutton.disabled.border.color');
|
|
74
|
+
color: dt('togglebutton.disabled.color');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.p-togglebutton-label,
|
|
78
|
+
.p-togglebutton-icon {
|
|
79
|
+
position: relative;
|
|
80
|
+
transition: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.p-togglebutton-icon {
|
|
84
|
+
color: dt('togglebutton.icon.color');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon {
|
|
88
|
+
color: dt('togglebutton.icon.hover.color');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.p-togglebutton.p-togglebutton-checked .p-togglebutton-icon {
|
|
92
|
+
color: dt('togglebutton.icon.checked.color');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.p-togglebutton:disabled .p-togglebutton-icon {
|
|
96
|
+
color: dt('togglebutton.icon.disabled.color');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.p-togglebutton-sm {
|
|
100
|
+
padding: dt('togglebutton.sm.padding');
|
|
101
|
+
font-size: dt('togglebutton.sm.font.size');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.p-togglebutton-sm .p-togglebutton-content {
|
|
105
|
+
padding: dt('togglebutton.content.sm.padding');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.p-togglebutton-lg {
|
|
109
|
+
padding: dt('togglebutton.lg.padding');
|
|
110
|
+
font-size: dt('togglebutton.lg.font.size');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.p-togglebutton-lg .p-togglebutton-content {
|
|
114
|
+
padding: dt('togglebutton.content.lg.padding');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.p-togglebutton-fluid {
|
|
118
|
+
width: 100%;
|
|
119
|
+
}
|
|
120
|
+
`,classes:{root:function(e){var t=e.instance,n=e.props;return[`p-togglebutton p-component`,{"p-togglebutton-checked":t.active,"p-invalid":t.$invalid,"p-togglebutton-fluid":n.fluid,"p-togglebutton-sm p-inputfield-sm":n.size===`small`,"p-togglebutton-lg p-inputfield-lg":n.size===`large`}]},content:`p-togglebutton-content`,icon:`p-togglebutton-icon`,label:`p-togglebutton-label`}}),Ee={name:`BaseToggleButton`,extends:oe,props:{onIcon:String,offIcon:String,onLabel:{type:String,default:`Yes`},offLabel:{type:String,default:`No`},readonly:{type:Boolean,default:!1},tabindex:{type:Number,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},size:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Te,provide:function(){return{$pcToggleButton:this,$parentInstance:this}}};function De(e){"@babel/helpers - typeof";return De=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},De(e)}function Oe(e,t,n){return(t=ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ke(e){var t=Ae(e,`string`);return De(t)==`symbol`?t:t+``}function Ae(e,t){if(De(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(De(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var je={name:`ToggleButton`,extends:Ee,inheritAttrs:!1,emits:[`change`],methods:{getPTOptions:function(e){return(e===`root`?this.ptmi:this.ptm)(e,{context:{active:this.active,disabled:this.disabled}})},onChange:function(e){!this.disabled&&!this.readonly&&(this.writeValue(!this.d_value,e),this.$emit(`change`,e))},onBlur:function(e){var t,n;(t=(n=this.formField).onBlur)==null||t.call(n,e)}},computed:{active:function(){return this.d_value===!0},hasLabel:function(){return f(this.onLabel)&&f(this.offLabel)},label:function(){return this.hasLabel?this.d_value?this.onLabel:this.offLabel:`\xA0`},dataP:function(){return g(Oe({checked:this.active,invalid:this.$invalid},this.size,this.size))}},directives:{ripple:re}},Me=[`tabindex`,`disabled`,`aria-pressed`,`aria-label`,`aria-labelledby`,`data-p-checked`,`data-p-disabled`,`data-p`],Ne=[`data-p`];function Pe(e,t,n,r,i,o){var c=ce(`ripple`);return ie((ge(),v(`button`,he({type:`button`,class:e.cx(`root`),tabindex:e.tabindex,disabled:e.disabled,"aria-pressed":e.d_value,onClick:t[0]||=function(){return o.onChange&&o.onChange.apply(o,arguments)},onBlur:t[1]||=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}},o.getPTOptions(`root`),{"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"data-p-checked":o.active,"data-p-disabled":e.disabled,"data-p":o.dataP}),[me(`span`,he({class:e.cx(`content`)},o.getPTOptions(`content`),{"data-p":o.dataP}),[_e(e.$slots,`default`,{},function(){return[_e(e.$slots,`icon`,{value:e.d_value,class:a(e.cx(`icon`))},function(){return[e.onIcon||e.offIcon?(ge(),v(`span`,he({key:0,class:[e.cx(`icon`),e.d_value?e.onIcon:e.offIcon]},o.getPTOptions(`icon`)),null,16)):ee(``,!0)]}),me(`span`,he({class:e.cx(`label`)},o.getPTOptions(`label`)),s(o.label),17)]})],16,Ne)],16,Me)),[[c]])}je.render=Pe;var Fe=o.extend({name:`selectbutton`,style:`
|
|
121
|
+
.p-selectbutton {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
user-select: none;
|
|
124
|
+
vertical-align: bottom;
|
|
125
|
+
outline-color: transparent;
|
|
126
|
+
border-radius: dt('selectbutton.border.radius');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.p-selectbutton .p-togglebutton {
|
|
130
|
+
border-radius: 0;
|
|
131
|
+
border-width: 1px 1px 1px 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.p-selectbutton .p-togglebutton:focus-visible {
|
|
135
|
+
position: relative;
|
|
136
|
+
z-index: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.p-selectbutton .p-togglebutton:first-child {
|
|
140
|
+
border-inline-start-width: 1px;
|
|
141
|
+
border-start-start-radius: dt('selectbutton.border.radius');
|
|
142
|
+
border-end-start-radius: dt('selectbutton.border.radius');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.p-selectbutton .p-togglebutton:last-child {
|
|
146
|
+
border-start-end-radius: dt('selectbutton.border.radius');
|
|
147
|
+
border-end-end-radius: dt('selectbutton.border.radius');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.p-selectbutton.p-invalid {
|
|
151
|
+
outline: 1px solid dt('selectbutton.invalid.border.color');
|
|
152
|
+
outline-offset: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.p-selectbutton-fluid {
|
|
156
|
+
width: 100%;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.p-selectbutton-fluid .p-togglebutton {
|
|
160
|
+
flex: 1 1 0;
|
|
161
|
+
}
|
|
162
|
+
`,classes:{root:function(e){var t=e.props,n=e.instance;return[`p-selectbutton p-component`,{"p-invalid":n.$invalid,"p-selectbutton-fluid":t.fluid}]}}}),Ie={name:`BaseSelectButton`,extends:oe,props:{options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,allowEmpty:{type:Boolean,default:!0},dataKey:null,ariaLabelledby:{type:String,default:null},size:{type:String,default:null},fluid:{type:Boolean,default:null}},style:Fe,provide:function(){return{$pcSelectButton:this,$parentInstance:this}}};function Le(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Be(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
163
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Re(e){return He(e)||Ve(e)||Be(e)||ze()}function ze(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
164
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Be(e,t){if(e){if(typeof e==`string`)return Ue(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(e,t):void 0}}function Ve(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function He(e){if(Array.isArray(e))return Ue(e)}function Ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var We={name:`SelectButton`,extends:Ie,inheritAttrs:!1,emits:[`change`],methods:{getOptionLabel:function(e){return this.optionLabel?u(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?u(e,this.optionValue):e},getOptionRenderKey:function(e){return this.dataKey?u(e,this.dataKey):this.getOptionLabel(e)},isOptionDisabled:function(e){return this.optionDisabled?u(e,this.optionDisabled):!1},isOptionReadonly:function(e){if(this.allowEmpty)return!1;var t=this.isSelected(e);return this.multiple?t&&this.d_value.length===1:t},onOptionSelect:function(e,t,n){var r=this;if(!(this.disabled||this.isOptionDisabled(t)||this.isOptionReadonly(t))){var i=this.isSelected(t),a=this.getOptionValue(t),o;if(this.multiple)if(i){if(o=this.d_value.filter(function(e){return!p(e,a,r.equalityKey)}),!this.allowEmpty&&o.length===0)return}else o=this.d_value?[].concat(Re(this.d_value),[a]):[a];else{if(i&&!this.allowEmpty)return;o=i?null:a}this.writeValue(o,e),this.$emit(`change`,{originalEvent:e,value:o})}},isSelected:function(e){var t=!1,n=this.getOptionValue(e);if(this.multiple){if(this.d_value){var r=Le(this.d_value),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;if(p(a,n,this.equalityKey)){t=!0;break}}}catch(e){r.e(e)}finally{r.f()}}}else t=p(this.d_value,n,this.equalityKey);return t}},computed:{equalityKey:function(){return this.optionValue?null:this.dataKey},dataP:function(){return g({invalid:this.$invalid})}},directives:{ripple:re},components:{ToggleButton:je}},Ge=[`aria-labelledby`,`data-p`];function Ke(e,t,n,r,i,a){var o=se(`ToggleButton`);return ge(),v(`div`,he({class:e.cx(`root`),role:`group`,"aria-labelledby":e.ariaLabelledby},e.ptmi(`root`),{"data-p":a.dataP}),[(ge(!0),v(_,null,de(e.options,function(t,n){return ge(),d(o,{key:a.getOptionRenderKey(t),modelValue:a.isSelected(t),onLabel:a.getOptionLabel(t),offLabel:a.getOptionLabel(t),disabled:e.disabled||a.isOptionDisabled(t),unstyled:e.unstyled,size:e.size,readonly:a.isOptionReadonly(t),onChange:function(e){return a.onOptionSelect(e,t,n)},pt:e.ptm(`pcToggleButton`)},ne({_:2},[e.$slots.option?{name:`default`,fn:le(function(){return[_e(e.$slots,`option`,{option:t,index:n},function(){return[me(`span`,he({ref_for:!0},e.ptm(`pcToggleButton`).label),s(a.getOptionLabel(t)),17)]})]}),key:`0`}:void 0]),1032,[`modelValue`,`onLabel`,`offLabel`,`disabled`,`unstyled`,`size`,`readonly`,`onChange`,`pt`])}),128))],16,Ge)}We.render=Ke;var qe=o.extend({name:`menu`,style:`
|
|
165
|
+
.p-menu {
|
|
166
|
+
background: dt('menu.background');
|
|
167
|
+
color: dt('menu.color');
|
|
168
|
+
border: 1px solid dt('menu.border.color');
|
|
169
|
+
border-radius: dt('menu.border.radius');
|
|
170
|
+
min-width: 12.5rem;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.p-menu-list {
|
|
174
|
+
margin: 0;
|
|
175
|
+
padding: dt('menu.list.padding');
|
|
176
|
+
outline: 0 none;
|
|
177
|
+
list-style: none;
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
gap: dt('menu.list.gap');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.p-menu-item-content {
|
|
184
|
+
transition:
|
|
185
|
+
background dt('menu.transition.duration'),
|
|
186
|
+
color dt('menu.transition.duration');
|
|
187
|
+
border-radius: dt('menu.item.border.radius');
|
|
188
|
+
color: dt('menu.item.color');
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.p-menu-item-link {
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
text-decoration: none;
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
position: relative;
|
|
199
|
+
color: inherit;
|
|
200
|
+
padding: dt('menu.item.padding');
|
|
201
|
+
gap: dt('menu.item.gap');
|
|
202
|
+
user-select: none;
|
|
203
|
+
outline: 0 none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.p-menu-item-label {
|
|
207
|
+
line-height: 1;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.p-menu-item-icon {
|
|
211
|
+
color: dt('menu.item.icon.color');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.p-menu-item.p-focus .p-menu-item-content {
|
|
215
|
+
color: dt('menu.item.focus.color');
|
|
216
|
+
background: dt('menu.item.focus.background');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.p-menu-item.p-focus .p-menu-item-icon {
|
|
220
|
+
color: dt('menu.item.icon.focus.color');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
|
|
224
|
+
color: dt('menu.item.focus.color');
|
|
225
|
+
background: dt('menu.item.focus.background');
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
|
|
229
|
+
color: dt('menu.item.icon.focus.color');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.p-menu-overlay {
|
|
233
|
+
box-shadow: dt('menu.shadow');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.p-menu-submenu-label {
|
|
237
|
+
background: dt('menu.submenu.label.background');
|
|
238
|
+
padding: dt('menu.submenu.label.padding');
|
|
239
|
+
color: dt('menu.submenu.label.color');
|
|
240
|
+
font-weight: dt('menu.submenu.label.font.weight');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.p-menu-separator {
|
|
244
|
+
border-block-start: 1px solid dt('menu.separator.border.color');
|
|
245
|
+
}
|
|
246
|
+
`,classes:{root:function(e){var t=e.props;return[`p-menu p-component`,{"p-menu-overlay":t.popup}]},start:`p-menu-start`,list:`p-menu-list`,submenuLabel:`p-menu-submenu-label`,separator:`p-menu-separator`,end:`p-menu-end`,item:function(e){var t=e.instance;return[`p-menu-item`,{"p-focus":t.id===t.focusedOptionId,"p-disabled":t.disabled()}]},itemContent:`p-menu-item-content`,itemLink:`p-menu-item-link`,itemIcon:`p-menu-item-icon`,itemLabel:`p-menu-item-label`}}),Je={name:`BaseMenu`,extends:ve,props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:[String,Object],default:`body`},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:qe,provide:function(){return{$pcMenu:this,$parentInstance:this}}},Ye={name:`Menuitem`,hostName:`Menu`,extends:ve,inheritAttrs:!1,emits:[`item-click`,`item-mousemove`],props:{item:null,templates:null,id:null,focusedOptionId:null,index:null},methods:{getItemProp:function(e,t){return e&&e.item?c(e.item[t]):void 0},getPTOptions:function(e){return this.ptm(e,{context:{item:this.item,index:this.index,focused:this.isItemFocused(),disabled:this.disabled()}})},isItemFocused:function(){return this.focusedOptionId===this.id},onItemClick:function(e){var t=this.getItemProp(this.item,`command`);t&&t({originalEvent:e,item:this.item.item}),this.$emit(`item-click`,{originalEvent:e,item:this.item,id:this.id})},onItemMouseMove:function(e){this.$emit(`item-mousemove`,{originalEvent:e,item:this.item,id:this.id})},visible:function(){return typeof this.item.visible==`function`?this.item.visible():this.item.visible!==!1},disabled:function(){return typeof this.item.disabled==`function`?this.item.disabled():this.item.disabled},label:function(){return typeof this.item.label==`function`?this.item.label():this.item.label},getMenuItemProps:function(e){return{action:he({class:this.cx(`itemLink`),tabindex:`-1`},this.getPTOptions(`itemLink`)),icon:he({class:[this.cx(`itemIcon`),e.icon]},this.getPTOptions(`itemIcon`)),label:he({class:this.cx(`itemLabel`)},this.getPTOptions(`itemLabel`))}}},computed:{dataP:function(){return g({focus:this.isItemFocused(),disabled:this.disabled()})}},directives:{ripple:re}},Xe=[`id`,`aria-label`,`aria-disabled`,`data-p-focused`,`data-p-disabled`,`data-p`],Ze=[`data-p`],Qe=[`href`,`target`],$e=[`data-p`],et=[`data-p`];function tt(e,t,n,r,i,o){var c=ce(`ripple`);return o.visible()?(ge(),v(`li`,he({key:0,id:n.id,class:[e.cx(`item`),n.item.class],role:`menuitem`,style:n.item.style,"aria-label":o.label(),"aria-disabled":o.disabled(),"data-p-focused":o.isItemFocused(),"data-p-disabled":o.disabled()||!1,"data-p":o.dataP},o.getPTOptions(`item`)),[me(`div`,he({class:e.cx(`itemContent`),onClick:t[0]||=function(e){return o.onItemClick(e)},onMousemove:t[1]||=function(e){return o.onItemMouseMove(e)},"data-p":o.dataP},o.getPTOptions(`itemContent`)),[n.templates.item?n.templates.item?(ge(),d(pe(n.templates.item),{key:1,item:n.item,label:o.label(),props:o.getMenuItemProps(n.item)},null,8,[`item`,`label`,`props`])):ee(``,!0):ie((ge(),v(`a`,he({key:0,href:n.item.url,class:e.cx(`itemLink`),target:n.item.target,tabindex:`-1`},o.getPTOptions(`itemLink`)),[n.templates.itemicon?(ge(),d(pe(n.templates.itemicon),{key:0,item:n.item,class:a(e.cx(`itemIcon`))},null,8,[`item`,`class`])):n.item.icon?(ge(),v(`span`,he({key:1,class:[e.cx(`itemIcon`),n.item.icon],"data-p":o.dataP},o.getPTOptions(`itemIcon`)),null,16,$e)):ee(``,!0),me(`span`,he({class:e.cx(`itemLabel`),"data-p":o.dataP},o.getPTOptions(`itemLabel`)),s(o.label()),17,et)],16,Qe)),[[c]])],16,Ze)],16,Xe)):ee(``,!0)}Ye.render=tt;function nt(e){return ot(e)||at(e)||it(e)||rt()}function rt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
247
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function it(e,t){if(e){if(typeof e==`string`)return st(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}function at(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ot(e){if(Array.isArray(e))return st(e)}function st(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ct={name:`Menu`,extends:Je,inheritAttrs:!1,emits:[`show`,`hide`,`focus`,`blur`],data:function(){return{overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted:function(){this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount:function(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&=(this.scrollHandler.destroy(),null),this.target=null,this.container&&this.autoZIndex&&xe.clear(this.container),this.container=null},methods:{itemClick:function(e){var t=e.item;this.disabled(t)||(t.command&&t.command(e),this.overlayVisible&&this.hide(),!this.popup&&this.focusedOptionIndex!==e.id&&(this.focusedOptionIndex=e.id))},itemMouseMove:function(e){this.focused&&(this.focusedOptionIndex=e.id)},onListFocus:function(e){this.focused=!0,!this.popup&&this.changeFocusedOptionIndex(0),this.$emit(`focus`,e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit(`blur`,e)},onListKeyDown:function(e){switch(e.code){case`ArrowDown`:this.onArrowDownKey(e);break;case`ArrowUp`:this.onArrowUpKey(e);break;case`Home`:this.onHomeKey(e);break;case`End`:this.onEndKey(e);break;case`Enter`:case`NumpadEnter`:this.onEnterKey(e);break;case`Space`:this.onSpaceKey(e);break;case`Escape`:this.popup&&(fe(this.target),this.hide());case`Tab`:this.overlayVisible&&this.hide();break}},onArrowDownKey:function(e){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey&&this.popup)fe(this.target),this.hide(),e.preventDefault();else{var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t),e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(ue(this.container,`li[data-pc-section="item"][data-p-disabled="false"]`).length-1),e.preventDefault()},onEnterKey:function(e){var t=ye(this.list,`li[id="${`${this.focusedOptionIndex}`}"]`),n=t&&ye(t,`a[data-pc-section="itemlink"]`);this.popup&&fe(this.target),n?n.click():t&&t.click(),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},findNextOptionIndex:function(e){var t=nt(ue(this.container,`li[data-pc-section="item"][data-p-disabled="false"]`)).findIndex(function(t){return t.id===e});return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=nt(ue(this.container,`li[data-pc-section="item"][data-p-disabled="false"]`)).findIndex(function(t){return t.id===e});return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=ue(this.container,`li[data-pc-section="item"][data-p-disabled="false"]`),n=e>=t.length?t.length-1:e<0?0:e;n>-1&&(this.focusedOptionIndex=t[n].getAttribute(`id`))},toggle:function(e,t){this.overlayVisible?this.hide():this.show(e,t)},show:function(e,t){this.overlayVisible=!0,this.target=t??e.currentTarget},hide:function(){this.overlayVisible=!1,this.target=null},onEnter:function(e){te(e,{position:`absolute`,top:`0`}),this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&xe.set(`menu`,e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&fe(this.list),this.$emit(`show`)},onLeave:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit(`hide`)},onAfterLeave:function(e){this.autoZIndex&&xe.clear(e)},alignOverlay:function(){l(this.container,this.target),be(this.target)>be(this.container)&&(this.container.style.minWidth=be(this.target)+`px`)},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){var n=e.container&&!e.container.contains(t.target),r=!(e.target&&(e.target===t.target||e.target.contains(t.target)));e.overlayVisible&&n&&r?e.hide():!e.popup&&n&&r&&(e.focusedOptionIndex=-1)},document.addEventListener(`click`,this.outsideClickListener,!0))},unbindOutsideClickListener:function(){this.outsideClickListener&&=(document.removeEventListener(`click`,this.outsideClickListener,!0),null)},bindScrollListener:function(){var e=this;this.scrollHandler||=new Se(this.target,function(){e.overlayVisible&&e.hide()}),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!ae()&&e.hide()},window.addEventListener(`resize`,this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&=(window.removeEventListener(`resize`,this.resizeListener),null)},visible:function(e){return typeof e.visible==`function`?e.visible():e.visible!==!1},disabled:function(e){return typeof e.disabled==`function`?e.disabled():e.disabled},label:function(e){return typeof e.label==`function`?e.label():e.label},onOverlayClick:function(e){Ce.emit(`overlay-click`,{originalEvent:e,target:this.target})},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{focusedOptionId:function(){return this.focusedOptionIndex===-1?null:this.focusedOptionIndex},dataP:function(){return g({popup:this.popup})}},components:{PVMenuitem:Ye,Portal:we}},lt=[`id`,`data-p`],ut=[`id`,`tabindex`,`aria-activedescendant`,`aria-label`,`aria-labelledby`],dt=[`id`];function ft(e,t,n,r,a,o){var c=se(`PVMenuitem`),l=se(`Portal`);return ge(),d(l,{appendTo:e.appendTo,disabled:!e.popup},{default:le(function(){return[i(h,he({name:`p-anchored-overlay`,onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},e.ptm(`transition`)),{default:le(function(){return[!e.popup||a.overlayVisible?(ge(),v(`div`,he({key:0,ref:o.containerRef,id:e.$id,class:e.cx(`root`),onClick:t[3]||=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)},"data-p":o.dataP},e.ptmi(`root`)),[e.$slots.start?(ge(),v(`div`,he({key:0,class:e.cx(`start`)},e.ptm(`start`)),[_e(e.$slots,`start`)],16)):ee(``,!0),me(`ul`,he({ref:o.listRef,id:e.$id+`_list`,class:e.cx(`list`),role:`menu`,tabindex:e.tabindex,"aria-activedescendant":a.focused?o.focusedOptionId:void 0,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||=function(){return o.onListFocus&&o.onListFocus.apply(o,arguments)},onBlur:t[1]||=function(){return o.onListBlur&&o.onListBlur.apply(o,arguments)},onKeydown:t[2]||=function(){return o.onListKeyDown&&o.onListKeyDown.apply(o,arguments)}},e.ptm(`list`)),[(ge(!0),v(_,null,de(e.model,function(t,n){return ge(),v(_,{key:o.label(t)+n.toString()},[t.items&&o.visible(t)&&!t.separator?(ge(),v(_,{key:0},[t.items?(ge(),v(`li`,he({key:0,id:e.$id+`_`+n,class:[e.cx(`submenuLabel`),t.class],role:`none`},{ref_for:!0},e.ptm(`submenuLabel`)),[_e(e.$slots,e.$slots.submenulabel?`submenulabel`:`submenuheader`,{item:t},function(){return[m(s(o.label(t)),1)]})],16,dt)):ee(``,!0),(ge(!0),v(_,null,de(t.items,function(r,i){return ge(),v(_,{key:r.label+n+`_`+i},[o.visible(r)&&!r.separator?(ge(),d(c,{key:0,id:e.$id+`_`+n+`_`+i,item:r,templates:e.$slots,focusedOptionId:o.focusedOptionId,unstyled:e.unstyled,onItemClick:o.itemClick,onItemMousemove:o.itemMouseMove,pt:e.pt},null,8,[`id`,`item`,`templates`,`focusedOptionId`,`unstyled`,`onItemClick`,`onItemMousemove`,`pt`])):o.visible(r)&&r.separator?(ge(),v(`li`,he({key:`separator`+n+i,class:[e.cx(`separator`),t.class],style:r.style,role:`separator`},{ref_for:!0},e.ptm(`separator`)),null,16)):ee(``,!0)],64)}),128))],64)):o.visible(t)&&t.separator?(ge(),v(`li`,he({key:`separator`+n.toString(),class:[e.cx(`separator`),t.class],style:t.style,role:`separator`},{ref_for:!0},e.ptm(`separator`)),null,16)):(ge(),d(c,{key:o.label(t)+n.toString(),id:e.$id+`_`+n,item:t,index:n,templates:e.$slots,focusedOptionId:o.focusedOptionId,unstyled:e.unstyled,onItemClick:o.itemClick,onItemMousemove:o.itemMouseMove,pt:e.pt},null,8,[`id`,`item`,`index`,`templates`,`focusedOptionId`,`unstyled`,`onItemClick`,`onItemMousemove`,`pt`]))],64)}),128))],16,ut),e.$slots.end?(ge(),v(`div`,he({key:1,class:e.cx(`end`)},e.ptm(`end`)),[_e(e.$slots,`end`)],16)):ee(``,!0)],16,lt)):ee(``,!0)]}),_:3},16,[`onEnter`,`onLeave`,`onAfterLeave`])]}),_:3},8,[`appendTo`,`disabled`])}ct.render=ft;function pt(e){if(!e.includes(`/repos/`))return null;let[t,n]=e.split(`/repos/`,2),r=n.split(`/`);if(r.length<3)return null;let i=`${r[0]}~${r[1]}~${r[2]}`,a=r.length>3?r[3]:null;return{toolshedUrl:t.startsWith(`http`)?t:`https://${t}`,trsToolId:i,toolVersion:a}}function mt(e,t){let n=t.split(`~`);return`${e.replace(`https://`,``).replace(`http://`,``)}/repos/${n.join(`/`)}`}async function ht(e,t,n){let r=`${e}/${t}/${n}`,i=new TextEncoder().encode(r),a=await globalThis.crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(a)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var gt=`__index__`,_t=class{storage;entries={};loaded=!1;constructor(e){this.storage=e}async load(){this.entries=(await this.storage.load(gt))?.entries??{},this.loaded=!0}async ensureLoaded(){this.loaded||await this.load()}async save(){let e={entries:this.entries};await this.storage.save(gt,e)}async add(e,t,n,r,i=``){await this.ensureLoaded(),this.entries[e]={tool_id:t,tool_version:n,source:r,source_url:i,cached_at:new Date().toISOString()},await this.save()}async remove(e){await this.ensureLoaded(),e in this.entries&&(delete this.entries[e],await this.save())}async has(e){return await this.ensureLoaded(),e in this.entries}async listAll(){return await this.ensureLoaded(),Object.entries(this.entries).map(([e,t])=>({cache_key:e,...t}))}async clear(){this.entries={},this.loaded=!0,await this.save()}},vt=e=>typeof e==`function`,y=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};case 4:return function(e,n,r,i){return arguments.length>=4?t(e,n,r,i):function(i){return t(i,e,n,r)}};case 5:return function(e,n,r,i,a){return arguments.length>=5?t(e,n,r,i,a):function(a){return t(a,e,n,r,i)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},b=e=>e,yt=e=>()=>e,bt=yt(!0),xt=yt(!1),St=yt(void 0),Ct=St;function x(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return o(a(i(r(n(t(e))))));case 8:return s(o(a(i(r(n(t(e)))))));case 9:return c(s(o(a(i(r(n(t(e))))))));default:{let e=arguments[0];for(let t=1;t<arguments.length;t++)e=arguments[t](e);return e}}}var wt=e=>(t,n)=>t===n||e(t,n),Tt=(e,t)=>e===t,Et=y(2,(e,t)=>wt((n,r)=>e(t(n),t(r)))),Dt=Et(Tt,e=>e.getTime()),Ot=e=>wt((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}),kt=`effect/GlobalValue`,At,S=(e,t)=>(At||=(globalThis[kt]??=new Map,globalThis[kt]),At.has(e)||At.set(e,t()),At.get(e)),jt=e=>!!e,Mt=e=>e instanceof Set,Nt=e=>typeof e==`string`,Pt=e=>typeof e==`number`,Ft=e=>typeof e==`boolean`,It=e=>typeof e==`bigint`,Lt=e=>typeof e==`symbol`,Rt=vt,zt=e=>e===void 0,Bt=e=>!1,Vt=e=>typeof e==`object`&&!!e,Ht=e=>Vt(e)||Rt(e),C=y(2,(e,t)=>Ht(e)&&t in e),Ut=y(2,(e,t)=>C(e,`_tag`)&&e._tag===t),Wt=e=>e==null,Gt=e=>e!=null,Kt=e=>e instanceof Uint8Array,qt=e=>e instanceof Date,Jt=e=>typeof e==`string`||C(e,Symbol.iterator),Yt=e=>Vt(e)&&!Array.isArray(e),Xt=e=>C(e,`then`)&&Rt(e.then),Zt=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`,Qt=class e{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new e(this.self)}},$t=335903614,en=4150755663,tn=1481765933,nn=1284865837,rn=9007199254740992,an=134217728,on=class{_state;constructor(e,t,n,r){return Wt(t)&&Wt(e)?(t=Math.random()*4294967295>>>0,e=0):Wt(t)&&(t=e,e=0),Wt(r)&&Wt(n)?(r=this._state?this._state[3]:en,n=this._state?this._state[2]:$t):Wt(r)&&(r=n,n=0),this._state=new Int32Array([0,0,n>>>0,((r||0)|1)>>>0]),this._next(),cn(this._state,this._state[0],this._state[1],e>>>0,t>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(e){this._state[0]=e[0],this._state[1]=e[1],this._state[2]=e[2],this._state[3]=e[3]|1}integer(e){return Math.round(this.number()*(2**53-1))%e}number(){let e=(this._next()&67108863)*1,t=(this._next()&134217727)*1;return(e*an+t)/rn}_next(){let e=this._state[0]>>>0,t=this._state[1]>>>0;sn(this._state,e,t,tn,nn),cn(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let n=e>>>18,r=(t>>>18|e<<14)>>>0;n=(n^e)>>>0,r=(r^t)>>>0;let i=(r>>>27|n<<5)>>>0,a=e>>>27,o=(-a>>>0&31)>>>0;return(i>>>a|i<<o)>>>0}};function sn(e,t,n,r,i){let a=(n>>>16)*(i&65535)>>>0,o=(n&65535)*(i>>>16)>>>0,s=(n&65535)*(i&65535)>>>0,c=(n>>>16)*(i>>>16)+((o>>>16)+(a>>>16))>>>0;o=o<<16>>>0,s=s+o>>>0,s>>>0<o>>>0&&(c=c+1>>>0),a=a<<16>>>0,s=s+a>>>0,s>>>0<a>>>0&&(c=c+1>>>0),c=c+Math.imul(n,r)>>>0,c=c+Math.imul(t,i)>>>0,e[0]=c,e[1]=s}function cn(e,t,n,r,i){let a=t+r>>>0,o=n+i>>>0;o>>>0<n>>>0&&(a=a+1|0),e[0]=a,e[1]=o}var ln=Symbol.for(`effect/Utils/YieldWrap`),un=class{#e;constructor(e){this.#e=e}[ln](){return this.#e}};function dn(e){if(typeof e==`object`&&e&&ln in e)return e[ln]();throw Error(Zt(`yieldWrapGet`))}var fn=S(`effect/Utils/isStructuralRegion`,()=>({enabled:!1,tester:void 0})),pn={effect_internal_function:e=>e()},mn=pn.effect_internal_function(()=>Error().stack)?.includes(`effect_internal_function`)===!0?pn.effect_internal_function:{effect_internal_function:e=>{try{return e()}finally{}}}.effect_internal_function;(function*(){}).constructor;var hn=S(Symbol.for(`effect/Hash/randomHashCache`),()=>new WeakMap),w=Symbol.for(`effect/Hash`),T=e=>{if(fn.enabled===!0)return 0;switch(typeof e){case`number`:return yn(e);case`bigint`:return bn(e.toString(10));case`boolean`:return bn(String(e));case`symbol`:return bn(String(e));case`string`:return bn(e);case`undefined`:return bn(`undefined`);case`function`:case`object`:return e===null?bn(`null`):e instanceof Date?Number.isNaN(e.getTime())?bn(`Invalid Date`):T(e.toISOString()):e instanceof URL?T(e.href):vn(e)?e[w]():gn(e);default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},gn=e=>(hn.has(e)||hn.set(e,yn(Math.floor(Math.random()*(2**53-1)))),hn.get(e)),E=e=>t=>t*53^e,_n=e=>e&3221225471|e>>>1&1073741824,vn=e=>C(e,w),yn=e=>{if(e!==e||e===1/0)return 0;let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return _n(t)},bn=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return _n(t)},xn=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=x(bn(t[r]),E(T(e[t[r]])));return _n(n)},Sn=e=>xn(e,Object.keys(e)),Cn=e=>{let t=6151;for(let n=0;n<e.length;n++)t=x(t,E(T(e[n])));return _n(t)},wn=function(){if(arguments.length===1){let e=arguments[0];return function(t){return Object.defineProperty(e,w,{value(){return t},enumerable:!1}),t}}let e=arguments[0],t=arguments[1];return Object.defineProperty(e,w,{value(){return t},enumerable:!1}),t},D=Symbol.for(`effect/Equal`);function O(){return arguments.length===1?e=>Tn(e,arguments[0]):Tn(arguments[0],arguments[1])}function Tn(e,t){if(e===t)return!0;let n=typeof e;if(n!==typeof t)return!1;if(n===`object`||n===`function`){if(e!==null&&t!==null){if(En(e)&&En(t))return T(e)===T(t)&&e[D](t)?!0:fn.enabled&&fn.tester?fn.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(fn.enabled){if(e===null||t===null)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Tn(e,t[n]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let n=Object.keys(e),r=Object.keys(t);if(n.length===r.length){for(let r of n)if(!(r in t&&Tn(e[r],t[r])))return fn.tester?fn.tester(e,t):!1;return!0}}return fn.tester?fn.tester(e,t):!1}}return fn.enabled&&fn.tester?fn.tester(e,t):!1}var En=e=>C(e,D),Dn=()=>O,k=Symbol.for(`nodejs.util.inspect.custom`),On=e=>{try{if(C(e,`toJSON`)&&Rt(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(On)}catch{return{}}return Vn(e)},kn=`[Circular]`;function An(e){try{return e.toISOString()}catch{return`Invalid Date`}}function jn(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Mn(e){return Nt(e)?JSON.stringify(e):String(e)}function Nn(e,t){let n=t?.space??0,r=new WeakSet,i=n?Pt(n)?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(Array.isArray(e)){if(r.has(e))return kn;if(r.add(e),!i||e.length<=1)return`[${e.map(e=>c(e,n)).join(`,`)}]`;let t=e.map(e=>c(e,n+1)).join(`,
|
|
248
|
+
`+a(n+1));return`[\n${a(n+1)}${t}\n${a(n)}]`}if(qt(e))return An(e);if(!t?.ignoreToString&&C(e,`toString`)&&Rt(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=jn(e);return e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}if(Nt(e))return JSON.stringify(e);if(Pt(e)||e==null||Ft(e)||Lt(e))return String(e);if(It(e))return String(e)+`n`;if(e instanceof Set||e instanceof Map)return r.has(e)?kn:(r.add(e),`${e.constructor.name}(${c(Array.from(e),n)})`);if(Ht(e)){if(r.has(e))return kn;r.add(e);let t=s(e);return!i||t.length<=1?o(e,`{${t.map(t=>`${Mn(t)}:${c(e[t],n)}`).join(`,`)}}`):o(e,`{\n${t.map(t=>`${a(n+1)}${Mn(t)}: ${c(e[t],n+1)}`).join(`,
|
|
249
|
+
`)}\n${a(n)}}`)}return String(e)}return c(e,0)}var Pn=e=>JSON.stringify(e,null,2),Fn=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?In(e,t):String(e)}catch{return String(e)}},In=(e,t)=>{let n=[],r=JSON.stringify(e,(e,t)=>typeof t==`object`&&t?n.includes(t)?void 0:n.push(t)&&(zn.fiberRefs!==void 0&&Rn(t)?t[Ln](zn.fiberRefs):t):t,t);return n=void 0,r},Ln=Symbol.for(`effect/Inspectable/Redactable`),Rn=e=>typeof e==`object`&&!!e&&Ln in e,zn=S(`effect/Inspectable/redactableState`,()=>({fiberRefs:void 0})),Bn=(e,t)=>{let n=zn.fiberRefs;zn.fiberRefs=e;try{return t()}finally{zn.fiberRefs=n}},Vn=e=>Rn(e)&&zn.fiberRefs!==void 0?e[Ln](zn.fiberRefs):e,A=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Hn=`Async`,Un=`Commit`,Wn=`Failure`,Gn=`OnFailure`,Kn=`OnSuccess`,qn=`OnSuccessAndFailure`,Jn=`Success`,Yn=`Sync`,Xn=`UpdateRuntimeFlags`,Zn=`While`,Qn=`Iterator`,$n=`WithRuntime`,er=`Yield`,tr=`RevertFlags`,nr=`3.21.0`,rr=()=>nr,ir=Symbol.for(`effect/Effect`),ar=Symbol.for(`effect/Stream`),or=Symbol.for(`effect/Sink`),sr=Symbol.for(`effect/Channel`),cr={_R:e=>e,_E:e=>e,_A:e=>e,_V:rr()},lr={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},ur={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},dr={[ir]:cr,[ar]:cr,[or]:lr,[sr]:ur,[D](e){return this===e},[w](){return wn(this,gn(this))},[Symbol.iterator](){return new Qt(new un(this))},pipe(){return A(this,arguments)}},fr={[w](){return wn(this,Sn(this))},[D](e){let t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(let n of t)if(!(n in e&&O(this[n],e[n])))return!1;return!0}},pr={...dr,_op:Un},mr={...pr,...fr},hr=function(){function e(){}return e.prototype=pr,e}(),gr=Symbol.for(`effect/Option`),_r={...dr,[gr]:{_A:e=>e},[k](){return this.toJSON()},toString(){return Pn(this.toJSON())}},vr=Object.assign(Object.create(_r),{_tag:`Some`,_op:`Some`,[D](e){return xr(e)&&Cr(e)&&O(this.value,e.value)},[w](){return wn(this,E(T(this._tag))(T(this.value)))},toJSON(){return{_id:`Option`,_tag:this._tag,value:On(this.value)}}}),yr=T(`None`),br=Object.assign(Object.create(_r),{_tag:`None`,_op:`None`,[D](e){return xr(e)&&Sr(e)},[w](){return yr},toJSON(){return{_id:`Option`,_tag:this._tag}}}),xr=e=>C(e,gr),Sr=e=>e._tag===`None`,Cr=e=>e._tag===`Some`,wr=Object.create(br),Tr=e=>{let t=Object.create(vr);return t.value=e,t},Er=Symbol.for(`effect/Either`),Dr={...dr,[Er]:{_R:e=>e},[k](){return this.toJSON()},toString(){return Pn(this.toJSON())}},Or=Object.assign(Object.create(Dr),{_tag:`Right`,_op:`Right`,[D](e){return Ar(e)&&Mr(e)&&O(this.right,e.right)},[w](){return E(T(this._tag))(T(this.right))},toJSON(){return{_id:`Either`,_tag:this._tag,right:On(this.right)}}}),kr=Object.assign(Object.create(Dr),{_tag:`Left`,_op:`Left`,[D](e){return Ar(e)&&jr(e)&&O(this.left,e.left)},[w](){return E(T(this._tag))(T(this.left))},toJSON(){return{_id:`Either`,_tag:this._tag,left:On(this.left)}}}),Ar=e=>C(e,Er),jr=e=>e._tag===`Left`,Mr=e=>e._tag===`Right`,Nr=e=>{let t=Object.create(kr);return t.left=e,t},Pr=e=>{let t=Object.create(Or);return t.right=e,t},Fr=e=>jr(e)?wr:Tr(e.right),Ir=y(2,(e,t)=>Sr(e)?Nr(t()):Pr(e.value)),j=Pr,M=Nr,Lr=Ir,Rr=e=>{if(Rt(e))try{return j(e())}catch(e){return M(e)}else try{return j(e.try())}catch(t){return M(e.catch(t))}},zr=Ar,Br=jr,Vr=Mr,Hr=y(2,(e,{onLeft:t,onRight:n})=>Br(e)?M(t(e.left)):j(n(e.right))),Ur=y(2,(e,t)=>Br(e)?M(t(e.left)):j(e.right)),Wr=y(2,(e,t)=>Vr(e)?j(t(e.right)):M(e.left)),Gr=y(2,(e,{onLeft:t,onRight:n})=>Br(e)?t(e.left):n(e.right)),Kr=Gr({onLeft:b,onRight:b}),qr=y(2,(e,t)=>{if(Vr(e))return e.right;throw t(e.left)}),Jr=qr(()=>Error(`getOrThrow called on a Left`)),Yr=e=>e.length>0,Xr=e=>(t,n)=>t===n?0:e(t,n),Zr=Xr((e,t)=>e<t?-1:1),Qr=y(2,(e,t)=>Xr((n,r)=>e(t(n),t(r)))),$r=e=>y(2,(t,n)=>e(t,n)===1),N=()=>wr,P=Tr,ei=xr,ti=Sr,ni=Cr,ri=y(2,(e,{onNone:t,onSome:n})=>ti(e)?t():n(e.value)),ii=Fr,ai=y(2,(e,t)=>ti(e)?t():e.value),oi=y(2,(e,t)=>ti(e)?t():e),si=y(2,(e,t)=>ti(e)?P(t()):e),ci=e=>e==null?N():P(e),li=ai(St),ui=e=>(...t)=>{try{return P(e(...t))}catch{return N()}},di=y(2,(e,t)=>{if(ni(e))return e.value;throw t()}),fi=di(()=>Error(`getOrThrow called on a None`)),pi=y(2,(e,t)=>ti(e)?N():P(t(e.value))),mi=y(2,(e,t)=>ti(e)?N():t(e.value)),hi=y(2,(e,t)=>ti(e)?N():ci(t(e.value))),gi=mi,_i=y(2,(e,t)=>gi(e,e=>t(e)?Tr(e):wr)),vi=e=>wt((t,n)=>ti(t)?ti(n):ti(n)?!1:e(t.value,n.value)),yi=(e=>y(2,(t,n)=>ti(t)?!1:e(t.value,n)))(Dn()),bi=y(2,(e,t)=>ti(e)?!1:t(e.value)),xi=e=>(t,n)=>ti(t)?n:ti(n)?t:P(e(t.value,n.value)),Si=(...e)=>e,Ci=e=>Ti(e).length===0,wi=y(2,(e,t)=>Object.prototype.hasOwnProperty.call(e,t)),Ti=e=>Object.keys(e),Ei=e=>Array(e),Di=y(2,(e,t)=>{let n=Math.max(1,Math.floor(e)),r=Array(n);for(let e=0;e<n;e++)r[e]=t(e);return r}),Oi=e=>Array.isArray(e)?e:Array.from(e),ki=e=>Array.isArray(e)?e:[e],Ai=y(2,(e,{onEmpty:t,onNonEmpty:n})=>Li(e)?n(Ui(e),Ki(e)):t()),ji=y(2,(e,t)=>[t,...e]),Mi=y(2,(e,t)=>[...e,t]),Ni=y(2,(e,t)=>Oi(e).concat(Oi(t))),Pi=Array.isArray,Fi=e=>e.length===0,Ii=Yr,Li=Yr,Ri=(e,t)=>e<0||e>=t.length,zi=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),Bi=y(2,(e,t)=>{let n=Math.floor(t);return Ri(n,e)?N():P(e[n])}),Vi=y(2,(e,t)=>{let n=Math.floor(t);if(Ri(n,e))throw Error(`Index ${n} out of bounds`);return e[n]}),Hi=Bi(0),Ui=Vi(0),Wi=e=>Li(e)?P(Gi(e)):N(),Gi=e=>e[e.length-1],Ki=e=>e.slice(1),qi=(e,t)=>{let n=0;for(let r of e){if(!t(r,n))break;n++}return n},Ji=y(2,(e,t)=>ta(e,qi(e,t))),Yi=y(2,(e,t)=>{let n=Oi(e);return n.slice(zi(t,n),n.length)}),Xi=e=>Array.from(e).reverse(),Zi=y(2,(e,t)=>{let n=Array.from(e);return n.sort(t),n}),Qi=y(2,(e,t)=>$i(e,t,Si)),$i=y(3,(e,t,n)=>{let r=Oi(e),i=Oi(t);if(Li(r)&&Li(i)){let e=[n(Ui(r),Ui(i))],t=Math.min(r.length,i.length);for(let a=1;a<t;a++)e[a]=n(r[a],i[a]);return e}return[]}),ea=Dn(),ta=y(2,(e,t)=>{let n=Array.from(e),r=Math.floor(t);return Li(n)?r>=1?na(n,r):[[],n]:[n,[]]}),na=y(2,(e,t)=>{let n=Math.max(1,Math.floor(t));return n>=e.length?[ra(e),[]]:[ji(e.slice(1,n),Ui(e)),e.slice(n)]}),ra=e=>e.slice(),ia=y(3,(e,t,n)=>{let r=Oi(e),i=Oi(t);return Li(r)?Li(i)?ha(n)(Ni(r,i)):r:i}),aa=y(2,(e,t)=>ia(e,t,ea)),oa=()=>[],sa=e=>[e],ca=y(2,(e,t)=>e.map(t)),la=y(2,(e,t)=>{if(Fi(e))return[];let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r);for(let e=0;e<i.length;e++)n.push(i[e])}return n}),ua=la(b),da=y(2,(e,t)=>{let n=Oi(e),r=[];for(let e=0;e<n.length;e++){let i=t(n[e],e);ni(i)&&r.push(i.value)}return r}),fa=y(3,(e,t,n)=>Oi(e).reduce((e,t,r)=>n(e,t,r),t)),pa=(e,t)=>{let n=[],r=e,i;for(;ni(i=t(r));){let[e,t]=i.value;n.push(e),r=t}return n},ma=Ot,ha=y(2,(e,t)=>{let n=Oi(e);if(Li(n)){let e=[Ui(n)],r=Ki(n);for(let n of r)e.every(e=>!t(n,e))&&e.push(n);return e}return[]}),ga=e=>ha(e,Dn()),_a=y(2,(e,t)=>Oi(e).join(t)),va=/^[+-]?\d+$/,ya=Symbol.for(`effect/BigDecimal`),ba={[ya]:ya,[w](){let e=Da(this);return x(T(e.value),E(yn(e.scale)),wn(this))},[D](e){return xa(e)&&ja(this,e)},toString(){return`BigDecimal(${Fa(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},xa=e=>C(e,ya),Sa=(e,t)=>{let n=Object.create(ba);return n.value=e,n.scale=t,n},Ca=(e,t)=>{if(e!==wa&&e%Ta===wa)throw RangeError(`Value must be normalized`);let n=Sa(e,t);return n.normalized=n,n},wa=BigInt(0),Ta=BigInt(10),Ea=Ca(wa,0),Da=e=>{if(e.normalized===void 0)if(e.value===wa)e.normalized=Ea;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=Ca(BigInt(t.substring(0,t.length-n)),e.scale-n)}return e.normalized},Oa=y(2,(e,t)=>t>e.scale?Sa(e.value*Ta**BigInt(t-e.scale),t):t<e.scale?Sa(e.value/Ta**BigInt(e.scale-t),t):e),ka=e=>e.value<wa?Sa(-e.value,e.scale):e,Aa=wt((e,t)=>e.scale>t.scale?Oa(t,e.scale).value===e.value:e.scale<t.scale?Oa(e,t.scale).value===t.value:e.value===t.value),ja=y(2,(e,t)=>Aa(e,t)),Ma=e=>di(Na(e),()=>RangeError(`Number must be finite, got ${e}`)),Na=e=>{if(!Number.isFinite(e))return N();let t=`${e}`;if(t.includes(`e`))return Pa(t);let[n,r=``]=t.split(`.`);return P(Sa(BigInt(`${n}${r}`),r.length))},Pa=e=>{if(e===``)return P(Ea);let t,n,r=e.search(/[eE]/);if(r!==-1){let i=e.slice(r+1);if(t=e.slice(0,r),n=Number(i),t===``||!Number.isSafeInteger(n)||!va.test(i))return N()}else t=e,n=0;let i,a,o=t.search(/\./);if(o!==-1){let e=t.slice(0,o),n=t.slice(o+1);i=`${e}${n}`,a=n.length}else i=t,a=0;if(!va.test(i))return N();let s=a-n;return Number.isSafeInteger(s)?P(Sa(BigInt(i),s)):N()},Fa=e=>{let t=Da(e);if(Math.abs(t.scale)>=16)return Ia(t);let n=t.value<wa,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},Ia=e=>{if(Ra(e))return`0e+0`;let t=Da(e),n=`${ka(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${za(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},La=e=>Number(Fa(e)),Ra=e=>e.value===wa,za=e=>e.value<wa,Ba=e=>e>BigInt(2**53-1)||e<BigInt(-(2**53-1))?N():P(Number(e)),Va=e=>{try{return e.trim()===``?N():P(BigInt(e))}catch{return N()}},Ha=e=>{if(e>2**53-1||e<-(2**53-1))return N();try{return P(BigInt(e))}catch{return N()}},Ua=e=>!e,Wa=Symbol.for(`effect/Chunk`);function Ga(e,t,n,r,i){for(let a=t;a<Math.min(e.length,t+i);a++)n[r+a-t]=e[a];return n}var Ka=[],qa=(e=>wt((t,n)=>t.length===n.length&&ro(t).every((t,r)=>e(t,co(n,r)))))(O),Ja={[Wa]:{_A:e=>e},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`Chunk`,values:ro(this).map(On)}},[k](){return this.toJSON()},[D](e){return Xa(e)&&qa(this,e)},[w](){return wn(this,Cn(ro(this)))},[Symbol.iterator](){switch(this.backing._tag){case`IArray`:return this.backing.array[Symbol.iterator]();case`IEmpty`:return Ka[Symbol.iterator]();default:return ro(this)[Symbol.iterator]()}},pipe(){return A(this,arguments)}},Ya=e=>{let t=Object.create(Ja);switch(t.backing=e,e._tag){case`IEmpty`:t.length=0,t.depth=0,t.left=t,t.right=t;break;case`IConcat`:t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break;case`IArray`:t.length=e.array.length,t.depth=0,t.left=Za,t.right=Za;break;case`ISingleton`:t.length=1,t.depth=0,t.left=Za,t.right=Za;break;case`ISlice`:t.length=e.length,t.depth=e.chunk.depth+1,t.left=Za,t.right=Za;break}return t},Xa=e=>C(e,Wa),Za=Ya({_tag:`IEmpty`}),Qa=()=>Za,$a=(...e)=>so(e),eo=e=>Ya({_tag:`ISingleton`,a:e}),to=e=>Xa(e)?e:oo(Oi(e)),no=(e,t,n)=>{switch(e.backing._tag){case`IArray`:Ga(e.backing.array,0,t,n,e.length);break;case`IConcat`:no(e.left,t,n),no(e.right,t,n+e.left.length);break;case`ISingleton`:t[n]=e.backing.a;break;case`ISlice`:{let r=0,i=n;for(;r<e.length;)t[i]=co(e,r),r+=1,i+=1;break}}},ro=e=>{switch(e.backing._tag){case`IEmpty`:return Ka;case`IArray`:return e.backing.array;default:{let t=Array(e.length);return no(e,t,0),e.backing={_tag:`IArray`,array:t},e.left=Za,e.right=Za,e.depth=0,t}}},io=e=>{switch(e.backing._tag){case`IEmpty`:case`ISingleton`:return e;case`IArray`:return Ya({_tag:`IArray`,array:Xi(e.backing.array)});case`IConcat`:return Ya({_tag:`IConcat`,left:io(e.backing.right),right:io(e.backing.left)});case`ISlice`:return oo(Xi(ro(e)))}},ao=y(2,(e,t)=>t<0||t>=e.length?N():P(co(e,t))),oo=e=>e.length===0?Qa():e.length===1?eo(e[0]):Ya({_tag:`IArray`,array:e}),so=e=>oo(e),co=y(2,(e,t)=>{switch(e.backing._tag){case`IEmpty`:throw Error(`Index out of bounds`);case`ISingleton`:if(t!==0)throw Error(`Index out of bounds`);return e.backing.a;case`IArray`:if(t>=e.length||t<0)throw Error(`Index out of bounds`);return e.backing.array[t];case`IConcat`:return t<e.left.length?co(e.left,t):co(e.right,t-e.left.length);case`ISlice`:return co(e.backing.chunk,t+e.backing.offset)}}),lo=y(2,(e,t)=>po(e,eo(t))),uo=y(2,(e,t)=>po(eo(t),e)),fo=y(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return Za;switch(e.backing._tag){case`ISlice`:return Ya({_tag:`ISlice`,chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case`IConcat`:return t>e.left.length?fo(e.right,t-e.left.length):Ya({_tag:`IConcat`,left:fo(e.left,t),right:e.right});default:return Ya({_tag:`ISlice`,chunk:e,offset:t,length:e.length-t})}}),po=y(2,(e,t)=>{if(e.backing._tag===`IEmpty`)return t;if(t.backing._tag===`IEmpty`)return e;let n=t.depth-e.depth;if(Math.abs(n)<=1)return Ya({_tag:`IConcat`,left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){let n=po(e.right,t);return Ya({_tag:`IConcat`,left:e.left,right:n})}else{let n=po(e.right.right,t);if(n.depth===e.depth-3){let t=Ya({_tag:`IConcat`,left:e.right.left,right:n});return Ya({_tag:`IConcat`,left:e.left,right:t})}else return Ya({_tag:`IConcat`,left:Ya({_tag:`IConcat`,left:e.left,right:e.right.left}),right:n})}else if(t.right.depth>=t.left.depth)return Ya({_tag:`IConcat`,left:po(e,t.left),right:t.right});else{let n=po(e,t.left.left);return n.depth===t.depth-3?Ya({_tag:`IConcat`,left:Ya({_tag:`IConcat`,left:n,right:t.left.right}),right:t.right}):Ya({_tag:`IConcat`,left:n,right:Ya({_tag:`IConcat`,left:t.left.right,right:t.right})})}}),mo=e=>e.length===0,ho=e=>e.length>0,go=ao(0),_o=e=>co(e,0),vo=_o,yo=e=>fo(e,1),bo=2**5,xo=bo-1,So=bo/2,Co=bo/4;function wo(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function To(e,t){return t>>>e&xo}function Eo(e){return 1<<e}function Do(e,t){return wo(e&t-1)}var Oo=(e,t)=>({value:e,previous:t});function ko(e,t,n,r){let i=r;if(!e){let e=r.length;i=Array(e);for(let t=0;t<e;++t)i[t]=r[t]}return i[t]=n,i}function Ao(e,t,n){let r=n.length-1,i=0,a=0,o=n;if(e)i=a=t;else for(o=Array(r);i<t;)o[a++]=n[i++];for(++i;i<=r;)o[a++]=n[i++];return e&&(o.length=r),o}function jo(e,t,n,r){let i=r.length;if(e){let e=i;for(;e>=t;)r[e--]=r[e];return r[t]=n,r}let a=0,o=0,s=Array(i+1);for(;a<t;)s[o++]=r[a++];for(s[t]=n;a<i;)s[++o]=r[a++];return s}var Mo=class e{_tag=`EmptyNode`;modify(t,n,r,i,a,o){let s=r(N());return ti(s)?new e:(++o.value,new Io(t,i,a,s))}};function No(e){return Ut(e,`EmptyNode`)}function Po(e){return No(e)||e._tag===`LeafNode`||e._tag===`CollisionNode`}function Fo(e,t){return No(e)?!1:t===e.edit}var Io=class e{edit;hash;key;value;_tag=`LeafNode`;constructor(e,t,n,r){this.edit=e,this.hash=t,this.key=n,this.value=r}modify(t,n,r,i,a,o){if(O(a,this.key)){let n=r(this.value);return n===this.value?this:ti(n)?(--o.value,new Mo):Fo(this,t)?(this.value=n,this):new e(t,i,a,n)}let s=r(N());return ti(s)?this:(++o.value,Uo(t,n,this.hash,this,i,new e(t,i,a,s)))}},Lo=class e{edit;hash;children;_tag=`CollisionNode`;constructor(e,t,n){this.edit=e,this.hash=t,this.children=n}modify(t,n,r,i,a,o){if(i===this.hash){let n=Fo(this,t),i=this.updateCollisionList(n,t,this.hash,this.children,r,a,o);return i===this.children?this:i.length>1?new e(t,this.hash,i):i[0]}let s=r(N());return ti(s)?this:(++o.value,Uo(t,n,this.hash,this,i,new Io(t,i,a,s)))}updateCollisionList(e,t,n,r,i,a,o){let s=r.length;for(let c=0;c<s;++c){let s=r[c];if(`key`in s&&O(a,s.key)){let l=s.value,u=i(l);return u===l?r:ti(u)?(--o.value,Ao(e,c,r)):ko(e,c,new Io(t,n,a,u),r)}}let c=i(N());return ti(c)?r:(++o.value,ko(e,s,new Io(t,n,a,c),r))}},Ro=class e{edit;mask;children;_tag=`IndexedNode`;constructor(e,t,n){this.edit=e,this.mask=t,this.children=n}modify(t,n,r,i,a,o){let s=this.mask,c=this.children,l=To(n,i),u=Eo(l),d=Do(s,u),f=s&u,p=Fo(this,t);if(!f){let f=new Mo().modify(t,n+5,r,i,a,o);return f?c.length>=So?Vo(t,l,f,s,c):new e(t,s|u,jo(p,d,f,c)):this}let m=c[d],h=m.modify(t,n+5,r,i,a,o);if(m===h)return this;let g=s,_;if(No(h)){if(g&=~u,!g)return new Mo;if(c.length<=2&&Po(c[d^1]))return c[d^1];_=Ao(p,d,c)}else _=ko(p,d,h,c);return p?(this.mask=g,this.children=_,this):new e(t,g,_)}},zo=class e{edit;size;children;_tag=`ArrayNode`;constructor(e,t,n){this.edit=e,this.size=t,this.children=n}modify(t,n,r,i,a,o){let s=this.size,c=this.children,l=To(n,i),u=c[l],d=(u||new Mo).modify(t,n+5,r,i,a,o);if(u===d)return this;let f=Fo(this,t),p;if(No(u)&&!No(d))++s,p=ko(f,l,d,c);else if(!No(u)&&No(d)){if(--s,s<=Co)return Bo(t,s,l,c);p=ko(f,l,new Mo,c)}else p=ko(f,l,d,c);return f?(this.size=s,this.children=p,this):new e(t,s,p)}};function Bo(e,t,n,r){let i=Array(t-1),a=0,o=0;for(let e=0,t=r.length;e<t;++e)if(e!==n){let t=r[e];t&&!No(t)&&(i[a++]=t,o|=1<<e)}return new Ro(e,o,i)}function Vo(e,t,n,r,i){let a=[],o=r,s=0;for(let e=0;o;++e)o&1&&(a[e]=i[s++]),o>>>=1;return a[t]=n,new zo(e,s+1,a)}function Ho(e,t,n,r,i,a){if(n===i)return new Lo(e,n,[a,r]);let o=To(t,n),s=To(t,i);if(o===s)return t=>new Ro(e,Eo(o)|Eo(s),[t]);{let t=o<s?[r,a]:[a,r];return new Ro(e,Eo(o)|Eo(s),t)}}function Uo(e,t,n,r,i,a){let o,s=t;for(;;){let t=Ho(e,s,n,r,i,a);if(typeof t==`function`)o=Oo(t,o),s+=5;else{let e=t;for(;o!=null;)e=o.value(e),o=o.previous;return e}}}var Wo=`effect/HashMap`,Go=Symbol.for(Wo),Ko={[Go]:Go,[Symbol.iterator](){return new Jo(this,(e,t)=>[e,t])},[w](){let e=T(Wo);for(let t of this)e^=x(T(t[0]),E(T(t[1])));return wn(this,e)},[D](e){if(ts(e)){if(e._size!==this._size)return!1;for(let t of this){let n=x(e,is(t[0],T(t[0])));if(ti(n)||!O(t[1],n.value))return!1}return!0}return!1},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`HashMap`,values:Array.from(this).map(On)}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},qo=(e,t,n,r)=>{let i=Object.create(Ko);return i._editable=e,i._edit=t,i._root=n,i._size=r,i},Jo=class e{map;f;v;constructor(e,t){this.map=e,this.f=t,this.v=Xo(this.map._root,this.f,void 0)}next(){if(ti(this.v))return{done:!0,value:void 0};let e=this.v.value;return this.v=Yo(e.cont),{done:!1,value:e.value}}[Symbol.iterator](){return new e(this.map,this.f)}},Yo=e=>e?Zo(e[0],e[1],e[2],e[3],e[4]):N(),Xo=(e,t,n=void 0)=>{switch(e._tag){case`LeafNode`:return ni(e.value)?P({value:t(e.key,e.value.value),cont:n}):Yo(n);case`CollisionNode`:case`ArrayNode`:case`IndexedNode`:{let r=e.children;return Zo(r.length,r,0,t,n)}default:return Yo(n)}},Zo=(e,t,n,r,i)=>{for(;n<e;){let a=t[n++];if(a&&!No(a))return Xo(a,r,[e,t,n,r,i])}return Yo(i)},Qo=qo(!1,0,new Mo,0),$o=()=>Qo,es=e=>{let t=us($o());for(let n of e)os(t,n[0],n[1]);return ds(t)},ts=e=>C(e,Go),ns=e=>e&&No(e._root),rs=y(2,(e,t)=>is(e,t,T(t))),is=y(3,(e,t,n)=>{let r=e._root,i=0;for(;;)switch(r._tag){case`LeafNode`:return O(t,r.key)?r.value:N();case`CollisionNode`:if(n===r.hash){let e=r.children;for(let n=0,r=e.length;n<r;++n){let r=e[n];if(`key`in r&&O(t,r.key))return r.value}}return N();case`IndexedNode`:{let e=Eo(To(i,n));if(r.mask&e){r=r.children[Do(r.mask,e)],i+=5;break}return N()}case`ArrayNode`:if(r=r.children[To(i,n)],r){i+=5;break}return N();default:return N()}}),as=y(2,(e,t)=>ni(is(e,t,T(t)))),os=y(3,(e,t,n)=>fs(e,t,()=>P(n))),ss=y(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:qo(e._editable,e._edit,t,n)),cs=e=>new Jo(e,e=>e),ls=e=>e._size,us=e=>qo(!0,e._edit+1,e._root,e._size),ds=e=>(e._editable=!1,e),fs=y(3,(e,t,n)=>ps(e,t,T(t),n)),ps=y(4,(e,t,n,r)=>{let i={value:e._size};return x(e,ss(e._root.modify(e._editable?e._edit:NaN,0,r,n,t,i),i.value))}),ms=y(2,(e,t)=>fs(e,t,N)),hs=y(2,(e,t)=>_s(e,$o(),(e,n,r)=>os(e,r,t(n,r)))),gs=y(2,(e,t)=>_s(e,void 0,(e,n,r)=>t(n,r))),_s=y(3,(e,t,n)=>{let r=e._root;if(r._tag===`LeafNode`)return ni(r.value)?n(t,r.value.value,r.key):t;if(r._tag===`EmptyNode`)return t;let i=[r.children],a;for(;a=i.pop();)for(let e=0,r=a.length;e<r;){let r=a[e++];r&&!No(r)&&(r._tag===`LeafNode`?ni(r.value)&&(t=n(t,r.value.value,r.key)):i.push(r.children))}return t}),vs=`effect/HashSet`,ys=Symbol.for(vs),bs={[ys]:ys,[Symbol.iterator](){return cs(this._keyMap)},[w](){return wn(this,E(T(this._keyMap))(T(vs)))},[D](e){return Ss(e)?ls(this._keyMap)===ls(e._keyMap)&&O(this._keyMap,e._keyMap):!1},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`HashSet`,values:Array.from(this).map(On)}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},xs=e=>{let t=Object.create(bs);return t._keyMap=e,t},Ss=e=>C(e,ys),Cs=xs($o()),ws=()=>Cs,Ts=e=>{let t=js(ws());for(let n of e)Ps(t,n);return Ms(t)},Es=(...e)=>{let t=js(ws());for(let n of e)Ps(t,n);return Ms(t)},Ds=y(2,(e,t)=>as(e._keyMap,t)),Os=y(2,(e,t)=>{let n=!1;for(let r of e)if(n=t(r),n)break;return n}),ks=y(2,(e,t)=>!Os(e,e=>!t(e))),As=e=>ls(e._keyMap),js=e=>xs(us(e._keyMap)),Ms=e=>(e._keyMap._editable=!1,e),Ns=y(2,(e,t)=>{let n=js(e);return t(n),Ms(n)}),Ps=y(2,(e,t)=>e._keyMap._editable?(os(t,!0)(e._keyMap),e):xs(os(t,!0)(e._keyMap))),Fs=y(2,(e,t)=>e._keyMap._editable?(ms(t)(e._keyMap),e):xs(ms(t)(e._keyMap))),Is=y(2,(e,t)=>Ns(e,e=>{for(let n of t)Fs(e,n)})),Ls=y(2,(e,t)=>Ns(ws(),n=>{Rs(e,e=>Ps(n,e));for(let e of t)Ps(n,e)})),Rs=y(2,(e,t)=>gs(e._keyMap,(e,n)=>t(n))),zs=y(3,(e,t,n)=>_s(e._keyMap,t,(e,t,r)=>n(e,r))),Bs=ws,Vs=Ts,Hs=Es,Us=Ds,Ws=ks,Gs=As,Ks=Ps,qs=Fs,Js=Is,Ys=Ls,Xs=zs,Zs=`Empty`,Qs=`Fail`,$s=`Interrupt`,ec=`Parallel`,tc=`Sequential`,nc=`effect/Cause`,rc=Symbol.for(nc),ic={_E:e=>e},ac={[rc]:ic,[w](){return x(T(nc),E(T(Oc(this))),wn(this))},[D](e){return fc(e)&&Dc(this,e)},pipe(){return A(this,arguments)},toJSON(){switch(this._tag){case`Empty`:return{_id:`Cause`,_tag:this._tag};case`Die`:return{_id:`Cause`,_tag:this._tag,defect:On(this.defect)};case`Interrupt`:return{_id:`Cause`,_tag:this._tag,fiberId:this.fiberId.toJSON()};case`Fail`:return{_id:`Cause`,_tag:this._tag,failure:On(this.error)};case`Sequential`:case`Parallel`:return{_id:`Cause`,_tag:this._tag,left:On(this.left),right:On(this.right)}}},toString(){return Rc(this)},[k](){return this.toJSON()}},oc=(()=>{let e=Object.create(ac);return e._tag=Zs,e})(),sc=e=>{let t=Object.create(ac);return t._tag=Qs,t.error=e,t},cc=e=>{let t=Object.create(ac);return t._tag=`Die`,t.defect=e,t},lc=e=>{let t=Object.create(ac);return t._tag=$s,t.fiberId=e,t},uc=(e,t)=>{let n=Object.create(ac);return n._tag=ec,n.left=e,n.right=t,n},dc=(e,t)=>{let n=Object.create(ac);return n._tag=tc,n.left=e,n.right=t,n},fc=e=>C(e,rc),pc=e=>e._tag===Zs,mc=e=>e._tag===Qs,hc=e=>e._tag===`Empty`?!0:Ic(e,!0,(e,t)=>{switch(t._tag){case Zs:return P(e);case`Die`:case Qs:case $s:return P(!1);default:return N()}}),gc=e=>ni(Cc(e)),_c=e=>Lc(void 0,Mc)(e),vc=e=>io(Ic(e,Qa(),(e,t)=>t._tag===`Fail`?P(x(e,uo(t.error))):N())),yc=e=>io(Ic(e,Qa(),(e,t)=>t._tag===`Die`?P(x(e,uo(t.defect))):N())),bc=e=>Ic(e,Bs(),(e,t)=>t._tag===`Interrupt`?P(x(e,Ks(t.fiberId))):N()),xc=e=>Ac(e,e=>e._tag===`Fail`?P(e.error):N()),Sc=e=>{let t=xc(e);switch(t._tag){case`None`:return j(e);case`Some`:return M(t.value)}},Cc=e=>Ac(e,e=>e._tag===`Interrupt`?P(e.fiberId):N()),wc=e=>Fc(e,{onEmpty:N(),onFail:e=>P(cc(e)),onDie:e=>P(cc(e)),onInterrupt:()=>N(),onSequential:xi(dc),onParallel:xi(uc)}),Tc=e=>Fc(e,{onEmpty:oc,onFail:()=>oc,onDie:cc,onInterrupt:lc,onSequential:dc,onParallel:uc}),Ec=e=>Fc(e,{onEmpty:oc,onFail:cc,onDie:cc,onInterrupt:lc,onSequential:dc,onParallel:uc}),Dc=(e,t)=>{let n=eo(e),r=eo(t);for(;ho(n)&&ho(r);){let[e,t]=x(vo(n),Ic([Bs(),Qa()],([e,t],n)=>{let[r,i]=jc(n);return P([x(e,Ys(r)),x(t,po(i))])})),[i,a]=x(vo(r),Ic([Bs(),Qa()],([e,t],n)=>{let[r,i]=jc(n);return P([x(e,Ys(r)),x(t,po(i))])}));if(!O(e,i))return!1;n=t,r=a}return!0},Oc=e=>kc(eo(e),Qa()),kc=(e,t)=>{for(;;){let[n,r]=x(e,fa([Bs(),Qa()],([e,t],n)=>{let[r,i]=jc(n);return[x(e,Ys(r)),x(t,po(i))]})),i=Gs(n)>0?x(t,uo(n)):t;if(mo(r))return io(i);e=r,t=i}throw Error(Zt(`Cause.flattenCauseLoop`))},Ac=y(2,(e,t)=>{let n=[e];for(;n.length>0;){let e=n.pop(),r=t(e);switch(r._tag){case`None`:switch(e._tag){case tc:case ec:n.push(e.right),n.push(e.left);break}break;case`Some`:return r}}return N()}),jc=e=>{let t=e,n=[],r=Bs(),i=Qa();for(;t!==void 0;)switch(t._tag){case Zs:if(n.length===0)return[r,i];t=n.pop();break;case Qs:if(r=Ks(r,$a(t._tag,t.error)),n.length===0)return[r,i];t=n.pop();break;case`Die`:if(r=Ks(r,$a(t._tag,t.defect)),n.length===0)return[r,i];t=n.pop();break;case $s:if(r=Ks(r,$a(t._tag,t.fiberId)),n.length===0)return[r,i];t=n.pop();break;case tc:switch(t.left._tag){case Zs:t=t.right;break;case tc:t=dc(t.left.left,dc(t.left.right,t.right));break;case ec:t=uc(dc(t.left.left,t.right),dc(t.left.right,t.right));break;default:i=uo(i,t.right),t=t.left;break}break;case ec:n.push(t.right),t=t.left;break}throw Error(Zt(`Cause.evaluateCauseLoop`))},Mc={emptyCase:bt,failCase:xt,dieCase:xt,interruptCase:bt,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},Nc=`SequentialCase`,Pc=`ParallelCase`,Fc=y(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:i,onParallel:a,onSequential:o})=>Lc(e,void 0,{emptyCase:()=>n,failCase:(e,t)=>r(t),dieCase:(e,n)=>t(n),interruptCase:(e,t)=>i(t),sequentialCase:(e,t,n)=>o(t,n),parallelCase:(e,t,n)=>a(t,n)})),Ic=y(3,(e,t,n)=>{let r=t,i=e,a=[];for(;i!==void 0;){let e=n(r,i);switch(r=ni(e)?e.value:r,i._tag){case tc:a.push(i.right),i=i.left;break;case ec:a.push(i.right),i=i.left;break;default:i=void 0;break}i===void 0&&a.length>0&&(i=a.pop())}return r}),Lc=y(3,(e,t,n)=>{let r=[e],i=[];for(;r.length>0;){let e=r.pop();switch(e._tag){case Zs:i.push(j(n.emptyCase(t)));break;case Qs:i.push(j(n.failCase(t,e.error)));break;case`Die`:i.push(j(n.dieCase(t,e.defect)));break;case $s:i.push(j(n.interruptCase(t,e.fiberId)));break;case tc:r.push(e.right),r.push(e.left),i.push(M({_tag:Nc}));break;case ec:r.push(e.right),r.push(e.left),i.push(M({_tag:Pc}));break}}let a=[];for(;i.length>0;){let e=i.pop();switch(e._tag){case`Left`:switch(e.left._tag){case Nc:{let e=a.pop(),r=a.pop(),i=n.sequentialCase(t,e,r);a.push(i);break}case Pc:{let e=a.pop(),r=a.pop(),i=n.parallelCase(t,e,r);a.push(i);break}}break;case`Right`:a.push(e.right);break}}if(a.length===0)throw Error(`BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues`);return a.pop()}),Rc=(e,t)=>_c(e)?`All fibers interrupted without errors.`:Kc(e).map(function(e){return t?.renderErrorCause!==!0||e.cause===void 0?e.stack:`${e.stack} {\n${zc(e.cause,` `)}\n}`}).join(`
|
|
250
|
+
`),zc=(e,t)=>{let n=e.stack.split(`
|
|
251
|
+
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${zc(e.cause,`${t} `)}\n${t}}`),r},Bc=e=>{let t=typeof e==`object`&&!!e,n=Error.stackTraceLimit;Error.stackTraceLimit=1;let r=Error(Vc(e),t&&`cause`in e&&e.cause!==void 0?{cause:Bc(e.cause)}:void 0);return Error.stackTraceLimit=n,r.message===``&&(r.message=`An error has occurred`),Error.stackTraceLimit=n,r.name=e instanceof Error?e.name:`Error`,t&&(Gc in e&&(r.span=e[Gc]),Object.keys(e).forEach(t=>{t in r||(r[t]=e[t])})),r.stack=Wc(`${r.name}: ${r.message}`,e instanceof Error&&e.stack?e.stack:``,r.span),r},Vc=e=>{if(typeof e==`string`)return e;if(typeof e==`object`&&e&&e instanceof Error)return e.message;try{if(C(e,`toString`)&&Rt(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return In(e)},Hc=/\((.*)\)/g,Uc=S(`effect/Tracer/spanToTrace`,()=>new WeakMap),Wc=(e,t,n)=>{let r=[e],i=t.startsWith(e)?t.slice(e.length).split(`
|
|
252
|
+
`):t.split(`
|
|
253
|
+
`);for(let e=1;e<i.length;e++){if(i[e].includes(` at new BaseEffectError`)||i[e].includes(` at new YieldableError`)){e++;continue}if(i[e].includes(`Generator.next`)||i[e].includes(`effect_internal_function`))break;r.push(i[e].replace(/at .*effect_instruction_i.*\((.*)\)/,`at $1`).replace(/EffectPrimitive\.\w+/,`<anonymous>`))}if(n){let e=n,t=0;for(;e&&e._tag===`Span`&&t<10;){let n=Uc.get(e);if(typeof n==`function`){let t=n();if(typeof t==`string`){let n=t.matchAll(Hc),i=!1;for(let[,t]of n)i=!0,r.push(` at ${e.name} (${t})`);i||r.push(` at ${e.name} (${t.replace(/^at /,``)})`)}else r.push(` at ${e.name}`)}else r.push(` at ${e.name}`);e=li(e.parent),t++}}return r.join(`
|
|
254
|
+
`)},Gc=Symbol.for(`effect/SpanAnnotation`),Kc=e=>Lc(e,void 0,{emptyCase:()=>[],dieCase:(e,t)=>[Bc(t)],failCase:(e,t)=>[Bc(t)],interruptCase:()=>[],parallelCase:(e,t,n)=>[...t,...n],sequentialCase:(e,t,n)=>[...t,...n]}),qc=Symbol.for(`effect/Context/Tag`),Jc=Symbol.for(`effect/Context/Reference`),Yc=Symbol.for(`effect/STM`),Xc={...dr,_op:`Tag`,[Yc]:cr,[qc]:{_Service:e=>e,_Identifier:e=>e},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`Tag`,key:this.key,stack:this.stack}},[k](){return this.toJSON()},of(e){return e},context(e){return ll(this,e)}},Zc={...Xc,[Jc]:Jc},Qc=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=t;let r=Object.create(Xc);return Object.defineProperty(r,`stack`,{get(){return n.stack}}),r.key=e,r},$c=e=>()=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=2;let n=Error();Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,Xc),r.key=e,Object.defineProperty(r,`stack`,{get(){return n.stack}}),r},el=()=>(e,t)=>{let n=Error.stackTraceLimit;Error.stackTraceLimit=2;let r=Error();Error.stackTraceLimit=n;function i(){}return Object.setPrototypeOf(i,Zc),i.key=e,i.defaultValue=t.defaultValue,Object.defineProperty(i,`stack`,{get(){return r.stack}}),i},tl=Symbol.for(`effect/Context`),nl={[tl]:{_Services:e=>e},[D](e){if(al(e)&&this.unsafeMap.size===e.unsafeMap.size){for(let t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!O(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[w](){return wn(this,yn(this.unsafeMap.size))},pipe(){return A(this,arguments)},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`Context`,services:Array.from(this.unsafeMap).map(On)}},[k](){return this.toJSON()}},rl=e=>{let t=Object.create(nl);return t.unsafeMap=e,t},il=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(e.stack){let n=e.stack.split(`
|
|
255
|
+
`);if(n.length>2){let e=n[2].match(/at (.*)/);e&&(t.message+=` (defined at ${e[1]})`)}}if(t.stack){let e=t.stack.split(`
|
|
256
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
257
|
+
`)}return t},al=e=>C(e,tl),ol=e=>C(e,Jc),sl=rl(new Map),cl=()=>sl,ll=(e,t)=>rl(new Map([[e.key,t]])),ul=y(3,(e,t,n)=>{let r=new Map(e.unsafeMap);return r.set(t.key,n),rl(r)}),dl=S(`effect/Context/defaultValueCache`,()=>new Map),fl=e=>{if(dl.has(e.key))return dl.get(e.key);let t=e.defaultValue();return dl.set(e.key,t),t},pl=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):fl(t),ml=y(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Jc in t)return fl(t);throw il(t)}return e.unsafeMap.get(t.key)}),hl=ml,gl=y(2,(e,t)=>e.unsafeMap.has(t.key)?Tr(e.unsafeMap.get(t.key)):ol(t)?Tr(fl(t)):wr),_l=y(2,(e,t)=>{let n=new Map(e.unsafeMap);for(let[e,r]of t.unsafeMap)n.set(e,r);return rl(n)}),vl=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((e,n)=>{t.set(n,e)});return rl(t)},yl=Qc,bl=cl,xl=ll,Sl=ul,Cl=hl,wl=ml,Tl=gl,El=_l,Dl=vl,Ol=$c,kl=el,Al=Symbol.for(`effect/Duration`),jl=BigInt(0),Ml=BigInt(24),Nl=BigInt(60),Pl=BigInt(1e3),Fl=BigInt(1e6),Il=BigInt(1e9),Ll=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Rl=e=>{if(Ul(e))return e;if(Pt(e))return Xl(e);if(It(e))return Jl(e);if(Array.isArray(e)&&e.length===2&&e.every(Pt))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?Kl:e[0]===1/0||e[1]===1/0?ql:Jl(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(Nt(e)){let t=Ll.exec(e);if(t){let[e,n,r]=t,i=Number(n);switch(r){case`nano`:case`nanos`:return Jl(BigInt(n));case`micro`:case`micros`:return Yl(BigInt(n));case`milli`:case`millis`:return Xl(i);case`second`:case`seconds`:return Zl(i);case`minute`:case`minutes`:return Ql(i);case`hour`:case`hours`:return $l(i);case`day`:case`days`:return eu(i);case`week`:case`weeks`:return tu(i)}}}throw Error(`Invalid DurationInput`)},zl={_tag:`Millis`,millis:0},Bl={_tag:`Infinity`},Vl={[Al]:Al,[w](){return wn(this,Sn(this.value))},[D](e){return Ul(e)&&du(this,e)},toString(){return`Duration(${pu(this)})`},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,hrtime:au(this)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`}}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},Hl=e=>{let t=Object.create(Vl);return Pt(e)?isNaN(e)||e<=0?t.value=zl:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:`Millis`,millis:e}:t.value={_tag:`Nanos`,nanos:BigInt(Math.round(e*1e6))}:t.value=Bl:e<=jl?t.value=zl:t.value={_tag:`Nanos`,nanos:e},t},Ul=e=>C(e,Al),Wl=e=>e.value._tag!==`Infinity`,Gl=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===jl;case`Infinity`:return!1}},Kl=Hl(0),ql=Hl(1/0),Jl=e=>Hl(e),Yl=e=>Hl(e*Pl),Xl=e=>Hl(e),Zl=e=>Hl(e*1e3),Ql=e=>Hl(e*6e4),$l=e=>Hl(e*36e5),eu=e=>Hl(e*864e5),tu=e=>Hl(e*6048e5),nu=e=>ou(e,{onMillis:e=>e,onNanos:e=>Number(e)/1e6}),ru=e=>{let t=Rl(e);switch(t.value._tag){case`Infinity`:return N();case`Nanos`:return P(t.value.nanos);case`Millis`:return P(BigInt(Math.round(t.value.millis*1e6)))}},iu=e=>{let t=Rl(e);switch(t.value._tag){case`Infinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return BigInt(Math.round(t.value.millis*1e6))}},au=e=>{let t=Rl(e);switch(t.value._tag){case`Infinity`:return[1/0,0];case`Nanos`:return[Number(t.value.nanos/Il),Number(t.value.nanos%Il)];case`Millis`:return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},ou=y(2,(e,t)=>{let n=Rl(e);switch(n.value._tag){case`Nanos`:return t.onNanos(n.value.nanos);case`Infinity`:return t.onMillis(1/0);case`Millis`:return t.onMillis(n.value.millis)}}),su=y(3,(e,t,n)=>{let r=Rl(e),i=Rl(t);if(r.value._tag===`Infinity`||i.value._tag===`Infinity`)return n.onMillis(nu(r),nu(i));if(r.value._tag===`Nanos`||i.value._tag===`Nanos`){let e=r.value._tag===`Nanos`?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),t=i.value._tag===`Nanos`?i.value.nanos:BigInt(Math.round(i.value.millis*1e6));return n.onNanos(e,t)}return n.onMillis(r.value.millis,i.value.millis)}),cu=(e,t)=>su(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t}),lu=y(2,(e,t)=>su(e,t,{onMillis:(e,t)=>e<=t,onNanos:(e,t)=>e<=t})),uu=y(2,(e,t)=>su(e,t,{onMillis:(e,t)=>e>=t,onNanos:(e,t)=>e>=t})),du=y(2,(e,t)=>cu(Rl(e),Rl(t))),fu=e=>{let t=Rl(e);if(t.value._tag===`Infinity`)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};let n=iu(t),r=n/Fl,i=r/Pl,a=i/Nl,o=a/Nl,s=o/Ml;return{days:Number(s),hours:Number(o%Ml),minutes:Number(a%Nl),seconds:Number(i%Nl),millis:Number(r%Pl),nanos:Number(n%Fl)}},pu=e=>{let t=Rl(e);if(t.value._tag===`Infinity`)return`Infinity`;if(Gl(t))return`0`;let n=fu(t),r=[];return n.days!==0&&r.push(`${n.days}d`),n.hours!==0&&r.push(`${n.hours}h`),n.minutes!==0&&r.push(`${n.minutes}m`),n.seconds!==0&&r.push(`${n.seconds}s`),n.millis!==0&&r.push(`${n.millis}ms`),n.nanos!==0&&r.push(`${n.nanos}ns`),r.join(` `)},mu=Symbol.for(`effect/MutableRef`),hu={[mu]:mu,toString(){return Pn(this.toJSON())},toJSON(){return{_id:`MutableRef`,current:On(this.current)}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},gu=e=>{let t=Object.create(hu);return t.current=e,t},_u=e=>e.current,vu=y(2,(e,t)=>(e.current=t,e)),yu=`effect/FiberId`,bu=Symbol.for(yu),xu=`None`,Su=`Runtime`,Cu=`Composite`,wu=bn(`${yu}-${xu}`),Tu=class{[bu]=bu;_tag=xu;id=-1;startTimeMillis=-1;[w](){return wu}[D](e){return ju(e)&&e._tag===xu}toString(){return Pn(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag}}[k](){return this.toJSON()}},Eu=class{id;startTimeMillis;[bu]=bu;_tag=Su;constructor(e,t){this.id=e,this.startTimeMillis=t}[w](){return wn(this,bn(`${yu}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[D](e){return ju(e)&&e._tag===Su&&this.id===e.id&&this.startTimeMillis===e.startTimeMillis}toString(){return Pn(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[k](){return this.toJSON()}},Du=class{left;right;[bu]=bu;_tag=Cu;constructor(e,t){this.left=e,this.right=t}_hash;[w](){return x(bn(`${yu}-${this._tag}`),E(T(this.left)),E(T(this.right)),wn(this))}[D](e){return ju(e)&&e._tag===Cu&&O(this.left,e.left)&&O(this.right,e.right)}toString(){return Pn(this.toJSON())}toJSON(){return{_id:`FiberId`,_tag:this._tag,left:On(this.left),right:On(this.right)}}[k](){return this.toJSON()}},Ou=new Tu,ku=(e,t)=>new Eu(e,t),Au=(e,t)=>new Du(e,t),ju=e=>C(e,bu),Mu=e=>e._tag===xu||x(Iu(e),Ws(e=>Mu(e))),Nu=e=>{switch(e._tag){case xu:return Bs();case Su:return Hs(e.id);case Cu:return x(Nu(e.left),Ys(Nu(e.right)))}},Pu=S(Symbol.for(`effect/Fiber/Id/_fiberCounter`),()=>gu(0)),Fu=e=>Array.from(Nu(e)).map(e=>`#${e}`).join(`,`),Iu=e=>{switch(e._tag){case xu:return Bs();case Su:return Hs(e);case Cu:return x(Iu(e.left),Ys(Iu(e.right)))}},Lu=()=>{let e=_u(Pu);return x(Pu,vu(e+1)),new Eu(e,Date.now())},Ru=Ou,zu=ku,Bu=Au,Vu=ju,Hu=Fu,Uu=Lu,Wu=$o,Gu=es,Ku=ns,qu=rs,Ju=os,Yu=cs,Xu=fs,Zu=hs,Qu=_s,$u=Symbol.for(`effect/List`),ed=e=>Oi(e),td=(e=>Et(ma(e),ed))(O),nd={[$u]:$u,_tag:`Cons`,toString(){return Pn(this.toJSON())},toJSON(){return{_id:`List`,_tag:`Cons`,values:ed(this).map(On)}},[k](){return this.toJSON()},[D](e){return od(e)&&this._tag===e._tag&&td(this,e)},[w](){return wn(this,Cn(ed(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag===`Nil`)return e=!0,this.return();let n=t.head;return t=t.tail,{done:e,value:n}},return(t){return e||=!0,{done:!0,value:t}}}},pipe(){return A(this,arguments)}},rd=(e,t)=>{let n=Object.create(nd);return n.head=e,n.tail=t,n},id=bn(`Nil`),ad=Object.create({[$u]:$u,_tag:`Nil`,toString(){return Pn(this.toJSON())},toJSON(){return{_id:`List`,_tag:`Nil`}},[k](){return this.toJSON()},[w](){return id},[D](e){return od(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return A(this,arguments)}}),od=e=>C(e,$u),sd=e=>e._tag===`Nil`,cd=e=>e._tag===`Cons`,ld=()=>ad,ud=(e,t)=>rd(e,t),dd=ld,fd=e=>rd(e,ad),pd=y(2,(e,t)=>hd(t,e)),md=y(2,(e,t)=>ud(t,e)),hd=y(2,(e,t)=>{if(sd(e))return t;if(sd(t))return e;{let n=rd(t.head,e),r=n,i=t.tail;for(;!sd(i);){let t=rd(i.head,e);r.tail=t,r=t,i=i.tail}return n}}),gd=y(3,(e,t,n)=>{let r=t,i=e;for(;!sd(i);)r=n(r,i.head),i=i.tail;return r}),_d=e=>{let t=dd(),n=e;for(;!sd(n);)t=md(t,n.head),n=n.tail;return t};Array.prototype;var vd=function(){function e(e){e&&Object.assign(this,e)}return e.prototype=fr,e}();({...vd.prototype});var yd=Symbol.for(`effect/DifferContextPatch`);function bd(e){return e}var xd={...vd.prototype,[yd]:{_Value:bd,_Patch:bd}},Sd=Object.create(Object.assign(Object.create(xd),{_tag:`Empty`})),Cd=()=>Sd,wd=Object.assign(Object.create(xd),{_tag:`AndThen`}),Td=(e,t)=>{let n=Object.create(wd);return n.first=e,n.second=t,n},Ed=Object.assign(Object.create(xd),{_tag:`AddService`}),Dd=(e,t)=>{let n=Object.create(Ed);return n.key=e,n.service=t,n},Od=Object.assign(Object.create(xd),{_tag:`RemoveService`}),kd=e=>{let t=Object.create(Od);return t.key=e,t},Ad=Object.assign(Object.create(xd),{_tag:`UpdateService`}),jd=(e,t)=>{let n=Object.create(Ad);return n.key=e,n.update=t,n},Md=(e,t)=>{let n=new Map(e.unsafeMap),r=Cd();for(let[e,i]of t.unsafeMap.entries())if(n.has(e)){let t=n.get(e);n.delete(e),O(t,i)||(r=Nd(jd(e,()=>i))(r))}else n.delete(e),r=Nd(Dd(e,i))(r);for(let[e]of n.entries())r=Nd(kd(e))(r);return r},Nd=y(2,(e,t)=>Td(e,t)),Pd=y(2,(e,t)=>{if(e._tag===`Empty`)return t;let n=!1,r=eo(e),i=new Map(t.unsafeMap);for(;ho(r);){let e=vo(r),t=yo(r);switch(e._tag){case`Empty`:r=t;break;case`AddService`:i.set(e.key,e.service),r=t;break;case`AndThen`:r=uo(uo(t,e.second),e.first);break;case`RemoveService`:i.delete(e.key),r=t;break;case`UpdateService`:i.set(e.key,e.update(i.get(e.key))),n=!0,r=t;break}}if(!n)return rl(i);let a=new Map;for(let[e]of t.unsafeMap)i.has(e)&&(a.set(e,i.get(e)),i.delete(e));for(let[e,t]of i)a.set(e,t);return rl(a)});({...vd.prototype});var Fd=Symbol.for(`effect/DifferHashSetPatch`);function Id(e){return e}var Ld={...vd.prototype,[Fd]:{_Value:Id,_Key:Id,_Patch:Id}},Rd=Object.create(Object.assign(Object.create(Ld),{_tag:`Empty`})),zd=()=>Rd,Bd=Object.assign(Object.create(Ld),{_tag:`AndThen`}),Vd=(e,t)=>{let n=Object.create(Bd);return n.first=e,n.second=t,n},Hd=Object.assign(Object.create(Ld),{_tag:`Add`}),Ud=e=>{let t=Object.create(Hd);return t.value=e,t},Wd=Object.assign(Object.create(Ld),{_tag:`Remove`}),Gd=e=>{let t=Object.create(Wd);return t.value=e,t},Kd=(e,t)=>{let[n,r]=Xs([e,zd()],([e,t],n)=>Us(n)(e)?[qs(n)(e),t]:[e,qd(Ud(n))(t)])(t);return Xs(r,(e,t)=>qd(Gd(t))(e))(n)},qd=y(2,(e,t)=>Vd(e,t)),Jd=y(2,(e,t)=>{if(e._tag===`Empty`)return t;let n=t,r=eo(e);for(;ho(r);){let e=vo(r),t=yo(r);switch(e._tag){case`Empty`:r=t;break;case`AndThen`:r=uo(e.first)(uo(e.second)(t));break;case`Add`:n=Ks(e.value)(n),r=t;break;case`Remove`:n=qs(e.value)(n),r=t}}return n});({...vd.prototype});var Yd=Symbol.for(`effect/DifferReadonlyArrayPatch`);function Xd(e){return e}var Zd={...vd.prototype,[Yd]:{_Value:Xd,_Patch:Xd}},Qd=Object.create(Object.assign(Object.create(Zd),{_tag:`Empty`})),$d=()=>Qd,ef=Object.assign(Object.create(Zd),{_tag:`AndThen`}),tf=(e,t)=>{let n=Object.create(ef);return n.first=e,n.second=t,n},nf=Object.assign(Object.create(Zd),{_tag:`Append`}),rf=e=>{let t=Object.create(nf);return t.values=e,t},af=Object.assign(Object.create(Zd),{_tag:`Slice`}),of=(e,t)=>{let n=Object.create(af);return n.from=e,n.until=t,n},sf=Object.assign(Object.create(Zd),{_tag:`Update`}),cf=(e,t)=>{let n=Object.create(sf);return n.index=e,n.patch=t,n},lf=e=>{let t=0,n=$d();for(;t<e.oldValue.length&&t<e.newValue.length;){let r=e.oldValue[t],i=e.newValue[t],a=e.differ.diff(r,i);O(a,e.differ.empty)||(n=uf(n,cf(t,a))),t+=1}return t<e.oldValue.length&&(n=uf(n,of(0,t))),t<e.newValue.length&&(n=uf(n,rf(Yi(t)(e.newValue)))),n},uf=y(2,(e,t)=>tf(e,t)),df=y(3,(e,t,n)=>{if(e._tag===`Empty`)return t;let r=t.slice(),i=sa(e);for(;Ii(i);){let e=Ui(i),t=Ki(i);switch(e._tag){case`Empty`:i=t;break;case`AndThen`:t.unshift(e.first,e.second),i=t;break;case`Append`:for(let t of e.values)r.push(t);i=t;break;case`Slice`:r=r.slice(e.from,e.until),i=t;break;case`Update`:r[e.index]=n.patch(e.patch,r[e.index]),i=t;break}}return r}),ff={[Symbol.for(`effect/Differ`)]:{_P:b,_V:b},pipe(){return A(this,arguments)}},pf=e=>{let t=Object.create(ff);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},mf=()=>pf({empty:Cd(),combine:(e,t)=>Nd(t)(e),diff:(e,t)=>Md(e,t),patch:(e,t)=>Pd(t)(e)}),hf=()=>pf({empty:zd(),combine:(e,t)=>qd(t)(e),diff:(e,t)=>Kd(e,t),patch:(e,t)=>Jd(t)(e)}),gf=e=>pf({empty:$d(),combine:(e,t)=>uf(e,t),diff:(t,n)=>lf({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>df(t,n,e)}),_f=()=>vf((e,t)=>t),vf=e=>pf({empty:b,combine:(e,t)=>e===b?t:t===b?e:n=>t(e(n)),diff:(e,t)=>O(e,t)?b:yt(t),patch:(t,n)=>e(n,t(n))}),yf=255,bf=8,xf=e=>e&yf,Sf=e=>e>>bf&yf,Cf=(e,t)=>(e&yf)+((t&e&yf)<<bf),wf=Cf(0,0),Tf=e=>Cf(e,e),Ef=e=>Cf(e,0),Df=y(2,(e,t)=>Cf(xf(e)&~t,Sf(e))),Of=y(2,(e,t)=>e|t),kf=e=>~e>>>0&yf,Af=e=>Pf(e,32),jf=y(2,(e,t)=>e|t),Mf=e=>Nf(e)&&!Rf(e),Nf=e=>Pf(e,1),Pf=y(2,(e,t)=>(e&t)!==0),Ff=(...e)=>e.reduce((e,t)=>e|t,0),If=Ff(0),Lf=e=>Pf(e,4),Rf=e=>Pf(e,16),zf=y(2,(e,t)=>Cf(e^t,t)),Bf=y(2,(e,t)=>e&(kf(xf(t))|Sf(t))|xf(t)&Sf(t)),Vf=pf({empty:wf,diff:(e,t)=>zf(e,t),combine:(e,t)=>Of(t)(e),patch:(e,t)=>Bf(t,e)}),Hf=Tf,Uf=Ef,Wf=Df,Gf=(e,t)=>({_tag:`Par`,left:e,right:t}),Kf=(e,t)=>({_tag:`Seq`,left:e,right:t}),qf=e=>{let t=fd(e),n=dd();for(;;){let[e,r]=gd(t,[$f(),dd()],([e,t],n)=>{let[r,i]=Jf(n);return[tp(e,r),pd(t,i)]});if(n=Yf(n,e),sd(r))return _d(n);t=r}throw Error(`BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues`)},Jf=e=>{let t=e,n=$f(),r=dd(),i=dd();for(;;)switch(t._tag){case`Empty`:if(sd(r))return[n,i];t=r.head,r=r.tail;break;case`Par`:r=ud(t.right,r),t=t.left;break;case`Seq`:{let e=t.left,n=t.right;switch(e._tag){case`Empty`:t=n;break;case`Par`:{let r=e.left,i=e.right;t=Gf(Kf(r,n),Kf(i,n));break}case`Seq`:{let r=e.left,i=e.right;t=Kf(r,Kf(i,n));break}case`Single`:t=e,i=ud(n,i);break}break}case`Single`:if(n=ep(n,t),sd(r))return[n,i];t=r.head,r=r.tail;break}throw Error(`BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues`)},Yf=(e,t)=>{if(sd(e))return fd(ip(t));if(np(t))return e;let n=up(e.head),r=rp(t);return n.length===1&&r.length===1&&O(n[0],r[0])?ud(lp(e.head,ip(t)),e.tail):ud(ip(t),e)},Xf=Symbol.for(`effect/RequestBlock/RequestBlockParallel`),Zf={_R:e=>e},Qf=class{map;[Xf]=Zf;constructor(e){this.map=e}},$f=()=>new Qf(Wu()),ep=(e,t)=>new Qf(Xu(e.map,t.dataSource,e=>si(pi(e,lo(t.blockedRequest)),()=>eo(t.blockedRequest)))),tp=(e,t)=>new Qf(Qu(e.map,t.map,(e,t,n)=>Ju(e,n,ri(qu(e,n),{onNone:()=>t,onSome:e=>po(t,e)})))),np=e=>Ku(e.map),rp=e=>Array.from(Yu(e.map)),ip=e=>cp(Zu(e.map,e=>eo(e))),ap=Symbol.for(`effect/RequestBlock/RequestBlockSequential`),op={_R:e=>e},sp=class{map;[ap]=op;constructor(e){this.map=e}},cp=e=>new sp(e),lp=(e,t)=>new sp(Qu(t.map,e.map,(e,t,n)=>Ju(e,n,ri(qu(e,n),{onNone:()=>Qa(),onSome:e=>po(e,t)})))),up=e=>Array.from(Yu(e.map)),dp=e=>Array.from(e.map),fp=`Pending`,pp=`Done`,mp=Symbol.for(`effect/Deferred`),hp={_E:e=>e,_A:e=>e},gp=e=>({_tag:fp,joiners:e}),_p=e=>({_tag:pp,effect:e}),vp=class e{self;called=!1;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(e){return{value:e,done:!0}}throw(e){throw e}[Symbol.iterator](){return new e(this.self)}},yp=(e,t)=>{let n=new Cp(`Blocked`);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},bp=e=>{let t=new Cp(`RunBlocked`);return t.effect_instruction_i0=e,t},xp=Symbol.for(`effect/Effect`),Sp=class{patch;op;_op=tr;constructor(e,t){this.patch=e,this.op=t}},Cp=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[xp]=cr;constructor(e){this._op=e}[D](e){return this===e}[w](){return wn(this,gn(this))}pipe(){return A(this,arguments)}toJSON(){return{_id:`Effect`,_op:this._op,effect_instruction_i0:On(this.effect_instruction_i0),effect_instruction_i1:On(this.effect_instruction_i1),effect_instruction_i2:On(this.effect_instruction_i2)}}toString(){return Pn(this.toJSON())}[k](){return this.toJSON()}[Symbol.iterator](){return new vp(new un(this))}},wp=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[xp]=cr;constructor(e){this._op=e,this._tag=e}[D](e){return Oh(e)&&e._op===`Failure`&&O(this.effect_instruction_i0,e.effect_instruction_i0)}[w](){return x(bn(this._tag),E(T(this.effect_instruction_i0)),wn(this))}get cause(){return this.effect_instruction_i0}pipe(){return A(this,arguments)}toJSON(){return{_id:`Exit`,_tag:this._op,cause:this.cause.toJSON()}}toString(){return Pn(this.toJSON())}[k](){return this.toJSON()}[Symbol.iterator](){return new vp(new un(this))}},Tp=class{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[xp]=cr;constructor(e){this._op=e,this._tag=e}[D](e){return Oh(e)&&e._op===`Success`&&O(this.effect_instruction_i0,e.effect_instruction_i0)}[w](){return x(bn(this._tag),E(T(this.effect_instruction_i0)),wn(this))}get value(){return this.effect_instruction_i0}pipe(){return A(this,arguments)}toJSON(){return{_id:`Exit`,_tag:this._op,value:On(this.value)}}toString(){return Pn(this.toJSON())}[k](){return this.toJSON()}[Symbol.iterator](){return new vp(new un(this))}},Ep=e=>C(e,xp),Dp=e=>{let t=new Cp($n);return t.effect_instruction_i0=e,t},Op=y(3,(e,t,n)=>mm(r=>F(e,e=>F(Vp(L(()=>r(t(e)))),t=>L(()=>n(e,t)).pipe(Zp({onFailure:e=>{switch(t._tag){case Wn:return Wp(dc(t.effect_instruction_i0,e));case Jn:return Wp(e)}},onSuccess:()=>t})))))),kp=y(2,(e,t)=>F(e,()=>I(t))),Ap=e=>kp(e,void 0),jp=function(){let e=new Cp(Un);switch(arguments.length){case 2:e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break;case 3:e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break;case 4:e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break;default:throw Error(Zt(`you're not supposed to end up here`))}return e},Mp=(e,t=Ru)=>{let n=new Cp(Hn),r;return n.effect_instruction_i0=t=>{r=e(t)},n.effect_instruction_i1=t,om(n,e=>Ep(r)?r:hm)},Np=(e,t=Ru)=>L(()=>Mp(e,t)),Pp=(e,t=Ru)=>jp(e,function(){let e,n;function r(t){e?e(t):n===void 0&&(n=t)}let i=new Cp(Hn);i.effect_instruction_i0=t=>{e=t,n&&t(n)},i.effect_instruction_i1=t;let a,o;return this.effect_instruction_i0.length===1?a=mn(()=>this.effect_instruction_i0(r)):(o=new AbortController,a=mn(()=>this.effect_instruction_i0(r,o.signal))),a||o?om(i,e=>(o&&o.abort(),a??hm)):i}),Fp=y(2,(e,t)=>Qp(e,{onFailure:t,onSuccess:I})),Ip=Symbol.for(`effect/OriginalAnnotation`),Lp=(e,t)=>ni(t)?new Proxy(e,{has(e,t){return t===Gc||t===Ip||t in e},get(n,r){return r===Gc?t.value:r===Ip?e:n[r]}}):e,Rp=e=>Ht(e)&&!(Gc in e)?Dp(t=>Wp(cc(Lp(e,og(t))))):Wp(cc(e)),zp=e=>Gp(()=>cc(new yh(e))),Bp=e=>Qp(e,{onFailure:e=>I(M(e)),onSuccess:e=>I(j(e))}),Vp=e=>Xp(e,{onFailure:Fh,onSuccess:Hh}),Hp=e=>Ht(e)&&!(Gc in e)?Dp(t=>Wp(sc(Lp(e,og(t))))):Wp(sc(e)),Up=e=>F(R(e),Hp),Wp=e=>{let t=new wp(Wn);return t.effect_instruction_i0=e,t},Gp=e=>F(R(e),Wp),Kp=Dp(e=>I(e.id())),qp=e=>Dp(t=>e(t.id())),F=y(2,(e,t)=>{let n=new Cp(Kn);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Jp=e=>{let t=new Cp(`OnStep`);return t.effect_instruction_i0=e,t},Yp=e=>F(e,b),Xp=y(2,(e,t)=>Zp(e,{onFailure:e=>I(t.onFailure(e)),onSuccess:e=>I(t.onSuccess(e))})),Zp=y(2,(e,t)=>{let n=new Cp(qn);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),Qp=y(2,(e,t)=>Zp(e,{onFailure:e=>{if(yc(e).length>0)return Wp(Ec(e));let n=vc(e);return n.length>0?t.onFailure(_o(n)):Wp(e)},onSuccess:t.onSuccess})),$p=y(2,(e,t)=>L(()=>{let n=Oi(e),r=Ei(n.length),i=0;return kp(vm({while:()=>i<n.length,body:()=>t(n[i],i),step:e=>{r[i++]=e}}),r)})),em=y(2,(e,t)=>L(()=>{let n=Oi(e),r=0;return vm({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),tm=e=>{let t=new Cp(Xn);return t.effect_instruction_i0=Hf(1),t.effect_instruction_i1=()=>e,t},nm=y(2,(e,t)=>F(e,e=>R(()=>t(e)))),rm=y(2,(e,t)=>Qp(e,{onFailure:e=>Up(()=>t.onFailure(e)),onSuccess:e=>R(()=>t.onSuccess(e))})),im=y(2,(e,t)=>Zp(e,{onFailure:e=>{let n=Sc(e);switch(n._tag){case`Left`:return Up(()=>t(n.left));case`Right`:return Wp(n.right)}},onSuccess:I})),am=y(2,(e,t)=>mm(n=>Zp(n(e),{onFailure:e=>{let n=Fh(e);return Zp(t(n),{onFailure:t=>Fh(dc(e,t)),onSuccess:()=>n})},onSuccess:e=>{let n=Hh(e);return Tm(t(n),n)}}))),om=y(2,(e,t)=>am(e,Bh({onFailure:e=>_c(e)?Ap(t(bc(e))):hm,onSuccess:()=>hm}))),sm=y(2,(e,t)=>fm(e,t,I)),cm=e=>lm(e,b),lm=y(2,(e,t)=>Qp(e,{onFailure:e=>Rp(t(e)),onSuccess:I})),I=e=>{let t=new Tp(Jn);return t.effect_instruction_i0=e,t},L=e=>{let t=new Cp(Un);return t.commit=e,t},R=e=>{let t=new Cp(Yn);return t.effect_instruction_i0=e,t},um=y(e=>e.length===3||e.length===2&&!(Ht(e[1])&&`onlyEffect`in e[1]),(e,t)=>F(e,e=>{let n=typeof t==`function`?t(e):t;return Ep(n)?kp(n,e):Xt(n)?Mp(t=>{n.then(n=>t(I(e)),e=>t(Hp(new Dh(e,`An unknown error occurred in Effect.tap`))))}):I(e)})),dm=e=>Dp(t=>e(Um(ch,P(x(t.getFiberRef(ch),ai(()=>t.scope())))))),fm=y(3,(e,t,n)=>Zp(e,{onFailure:e=>yc(e).length>0?Wp(fi(wc(e))):t(),onSuccess:n})),pm=e=>{let t=new Cp(Xn);return t.effect_instruction_i0=Uf(1),t.effect_instruction_i1=()=>e,t},mm=e=>jp(e,function(){let e=new Cp(Xn);return e.effect_instruction_i0=Uf(1),e.effect_instruction_i1=e=>Nf(e)?mn(()=>this.effect_instruction_i0(tm)):mn(()=>this.effect_instruction_i0(pm)),e}),hm=I(void 0),gm=e=>{let t=new Cp(Xn);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},_m=y(2,(e,t)=>F(t,t=>t?x(e,nm(P)):I(N()))),vm=e=>{let t=new Cp(Zn);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},ym=e=>L(()=>{let t=new Cp(Qn);return t.effect_instruction_i0=e(),t}),bm=function(){let e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return ym(()=>e(x))},xm=(e,...t)=>Object.defineProperty(t.length===0?function(...t){return ym(()=>e.apply(this,t))}:function(...n){let r=ym(()=>e.apply(this,n));for(let e of t)r=e(r,...n);return r},`length`,{value:e.length,configurable:!0}),Sm=e=>{let t=new Cp(er);return e?.priority===void 0?t:nh(t,e.priority)},Cm=y(2,(e,t)=>F(e,e=>nm(t,t=>[e,t]))),wm=y(2,(e,t)=>F(e,e=>kp(t,e))),Tm=y(2,(e,t)=>F(e,()=>t)),Em=y(3,(e,t,n)=>F(e,e=>nm(t,t=>n(e,t)))),Dm=e=>F(Kp,t=>x(e,Om(t))),Om=y(2,(e,t)=>F(e.interruptAsFork(t),()=>e.await)),km={_tag:`All`,syslog:0,label:`ALL`,ordinal:-(2**53-1),pipe(){return A(this,arguments)}},Am={_tag:`Fatal`,syslog:2,label:`FATAL`,ordinal:5e4,pipe(){return A(this,arguments)}},jm={_tag:`Error`,syslog:3,label:`ERROR`,ordinal:4e4,pipe(){return A(this,arguments)}},Mm={_tag:`Warning`,syslog:4,label:`WARN`,ordinal:3e4,pipe(){return A(this,arguments)}},Nm={_tag:`Info`,syslog:6,label:`INFO`,ordinal:2e4,pipe(){return A(this,arguments)}},Pm={_tag:`Debug`,syslog:7,label:`DEBUG`,ordinal:1e4,pipe(){return A(this,arguments)}},Fm={_tag:`Trace`,syslog:7,label:`TRACE`,ordinal:0,pipe(){return A(this,arguments)}},Im={_tag:`None`,syslog:7,label:`OFF`,ordinal:2**53-1,pipe(){return A(this,arguments)}},Lm=Symbol.for(`effect/FiberRef`),Rm={_A:e=>e},zm=e=>Dp(t=>Hh(t.getFiberRef(e))),Bm=y(2,(e,t)=>F(zm(e),t)),Vm=y(2,(e,t)=>Hm(e,()=>[void 0,t])),Hm=y(2,(e,t)=>Dp(n=>{let[r,i]=t(n.getFiberRef(e));return n.setFiberRef(e,i),I(r)})),Um=y(3,(e,t,n)=>Op(wm(zm(t),Vm(t,n)),()=>e,e=>Vm(t,e))),Wm=(e,t)=>Jm(e,{differ:_f(),fork:t?.fork??b,join:t?.join}),Gm=e=>{let t=hf();return Jm(e,{differ:t,fork:t.empty})},Km=e=>{let t=gf(_f());return Jm(e,{differ:t,fork:t.empty})},qm=e=>{let t=mf();return Jm(e,{differ:t,fork:t.empty})},Jm=(e,t)=>({...pr,[Lm]:Rm,initial:e,commit(){return zm(this)},diff:(e,n)=>t.differ.diff(e,n),combine:(e,n)=>t.differ.combine(e,n),patch:e=>n=>t.differ.patch(e,n),fork:t.fork,join:t.join??((e,t)=>t)}),Ym=e=>Jm(e,{differ:Vf,fork:Vf.empty}),Xm=S(Symbol.for(`effect/FiberRef/currentContext`),()=>qm(bl())),Zm=S(Symbol.for(`effect/FiberRef/currentSchedulingPriority`),()=>Wm(0)),Qm=S(Symbol.for(`effect/FiberRef/currentMaxOpsBeforeYield`),()=>Wm(2048)),$m=S(Symbol.for(`effect/FiberRef/currentLogAnnotation`),()=>Wm(Wu())),eh=S(Symbol.for(`effect/FiberRef/currentLogLevel`),()=>Wm(Nm)),th=S(Symbol.for(`effect/FiberRef/currentLogSpan`),()=>Wm(dd())),nh=y(2,(e,t)=>Um(e,Zm,t)),rh=S(Symbol.for(`effect/FiberRef/currentConcurrency`),()=>Wm(`unbounded`)),ih=S(Symbol.for(`effect/FiberRef/currentRequestBatching`),()=>Wm(!0)),ah=S(Symbol.for(`effect/FiberRef/currentUnhandledErrorLogLevel`),()=>Wm(P(Pm))),oh=S(Symbol.for(`effect/FiberRef/versionMismatchErrorLogLevel`),()=>Wm(P(Mm))),sh=S(Symbol.for(`effect/FiberRef/currentMetricLabels`),()=>Km(oa())),ch=S(Symbol.for(`effect/FiberRef/currentForkScopeOverride`),()=>Wm(N(),{fork:()=>N(),join:(e,t)=>e})),lh=S(Symbol.for(`effect/FiberRef/currentInterruptedCause`),()=>Wm(oc,{fork:()=>oc,join:(e,t)=>e})),uh=Symbol.for(`effect/Scope`),dh=Symbol.for(`effect/CloseableScope`),fh=(e,t)=>e.addFinalizer(()=>Ap(t)),ph=(e,t)=>e.addFinalizer(t),mh=(e,t)=>e.close(t),hh=(e,t)=>e.fork(t),gh=function(){class e extends globalThis.Error{commit(){return Hp(this)}toJSON(){let e={...this};return this.message&&(e.message=this.message),this.cause&&(e.cause=this.cause),e}[k](){return this.toString===globalThis.Error.prototype.toString?`Bun`in globalThis?Rc(sc(this),{renderErrorCause:!0}):this:this.stack?`${this.toString()}\n${this.stack.split(`
|
|
258
|
+
`).slice(1).join(`
|
|
259
|
+
`)}`:this.toString()}}return Object.assign(e.prototype,mr),e}(),_h=(e,t)=>{class n extends gh{_tag=t}return Object.assign(n.prototype,e),n.prototype.name=t,n},vh=Symbol.for(`effect/Cause/errors/RuntimeException`),yh=_h({[vh]:vh},`RuntimeException`),bh=Symbol.for(`effect/Cause/errors/InterruptedException`),xh=e=>C(e,bh),Sh=Symbol.for(`effect/Cause/errors/IllegalArgument`),Ch=_h({[Sh]:Sh},`IllegalArgumentException`),wh=Symbol.for(`effect/Cause/errors/NoSuchElement`),Th=_h({[wh]:wh},`NoSuchElementException`),Eh=Symbol.for(`effect/Cause/errors/UnknownException`),Dh=function(){class e extends gh{_tag=`UnknownException`;error;constructor(e,t){super(t??`An unknown error occurred`,{cause:e}),this.error=e}}return Object.assign(e.prototype,{[Eh]:Eh,name:`UnknownException`}),e}(),Oh=e=>Ep(e)&&`_tag`in e&&(e._tag===`Success`||e._tag===`Failure`),kh=e=>e._tag===`Success`,Ah=y(2,(e,t)=>{switch(e._tag){case Wn:return Fh(e.effect_instruction_i0);case Jn:return Hh(t)}}),jh=e=>Ah(e,void 0),Mh=(e,t)=>Gh(e,t?.parallel?uc:dc),Nh=e=>Fh(cc(e)),Ph=e=>Fh(sc(e)),Fh=e=>{let t=new wp(Wn);return t.effect_instruction_i0=e,t},Ih=y(2,(e,t)=>{switch(e._tag){case Wn:return Fh(e.effect_instruction_i0);case Jn:return t(e.effect_instruction_i0)}}),Lh=e=>x(e,Ih(b)),Rh=e=>Fh(lc(e)),zh=y(2,(e,t)=>{switch(e._tag){case Wn:return Fh(e.effect_instruction_i0);case Jn:return Hh(t(e.effect_instruction_i0))}}),Bh=y(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Wn:return t(e.effect_instruction_i0);case Jn:return n(e.effect_instruction_i0)}}),Vh=y(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Wn:return t(e.effect_instruction_i0);case Jn:return n(e.effect_instruction_i0)}}),Hh=e=>{let t=new Tp(Jn);return t.effect_instruction_i0=e,t},Uh=Hh(void 0),Wh=y(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case Wn:switch(t._tag){case Jn:return Fh(e.effect_instruction_i0);case Wn:return Fh(n(e.effect_instruction_i0,t.effect_instruction_i0))}case Jn:switch(t._tag){case Jn:return Hh(r(e.effect_instruction_i0,t.effect_instruction_i0));case Wn:return Fh(t.effect_instruction_i0)}}}),Gh=(e,t)=>{let n=to(e);return ho(n)?x(yo(n),fa(x(vo(n),zh(eo)),(e,n)=>x(e,Wh(n,{onSuccess:(e,t)=>x(e,uo(t)),onFailure:t}))),zh(io),zh(e=>ro(e)),P):N()},Kh=e=>({...pr,[mp]:hp,state:gu(gp([])),commit(){return Yh(this)},blockingOn:e}),qh=()=>F(Kp,e=>Jh(e)),Jh=e=>R(()=>Kh(e)),Yh=e=>Np(t=>{let n=_u(e.state);switch(n._tag){case pp:return t(n.effect);case fp:return n.joiners.push(t),eg(e,t)}},e.blockingOn),Xh=y(2,(e,t)=>R(()=>{let n=_u(e.state);switch(n._tag){case pp:return!1;case fp:vu(e.state,_p(t));for(let e=0,r=n.joiners.length;e<r;e++)n.joiners[e](t);return!0}})),Zh=y(2,(e,t)=>Xh(e,Wp(t))),Qh=y(2,(e,t)=>Xh(e,I(t))),$h=(e,t)=>{let n=_u(e.state);if(n._tag===`Pending`){vu(e.state,_p(t));for(let e=0,r=n.joiners.length;e<r;e++)n.joiners[e](t)}},eg=(e,t)=>R(()=>{let n=_u(e.state);if(n._tag===`Pending`){let e=n.joiners.indexOf(t);e>=0&&n.joiners.splice(e,1)}}),tg=Dp(e=>Hh(e.currentContext)),ng=()=>tg,rg=e=>F(ng(),e),ig=y(2,(e,t)=>Um(Xm,t)(e)),ag=y(2,(e,t)=>rg(n=>ig(e,t(n)))),og=e=>{let t=e.currentSpan;return t!==void 0&&t._tag===`Span`?P(t):N()},sg=mc,cg=Ch,lg=Rc,ug=`InvalidData`,dg=`MissingData`,fg=`SourceUnavailable`,pg=`Unsupported`,mg=Symbol.for(`effect/ConfigError`),hg={_tag:`ConfigError`,[mg]:mg},gg=(e,t)=>{let n=Object.create(hg);return n._op=`And`,n.left=e,n.right=t,Object.defineProperty(n,`toString`,{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(n,`message`,{enumerable:!1,get(){return this.toString()}}),n},_g=(e,t)=>{let n=Object.create(hg);return n._op=`Or`,n.left=e,n.right=t,Object.defineProperty(n,`toString`,{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(n,`message`,{enumerable:!1,get(){return this.toString()}}),n},vg=(e,t,n={pathDelim:`.`})=>{let r=Object.create(hg);return r._op=ug,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Invalid data at ${x(this.path,_a(n.pathDelim))}: "${this.message}")`}}),r},yg=(e,t,n={pathDelim:`.`})=>{let r=Object.create(hg);return r._op=dg,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Missing data at ${x(this.path,_a(n.pathDelim))}: "${this.message}")`}}),r},bg=(e,t,n,r={pathDelim:`.`})=>{let i=Object.create(hg);return i._op=fg,i.path=e,i.message=t,i.cause=n,Object.defineProperty(i,`toString`,{enumerable:!1,value(){return`(Source unavailable at ${x(this.path,_a(r.pathDelim))}: "${this.message}")`}}),i},xg=(e,t,n={pathDelim:`.`})=>{let r=Object.create(hg);return r._op=pg,r.path=e,r.message=t,Object.defineProperty(r,`toString`,{enumerable:!1,value(){return`(Unsupported operation at ${x(this.path,_a(n.pathDelim))}: "${this.message}")`}}),r},Sg=y(2,(e,t)=>{switch(e._op){case`And`:return gg(Sg(e.left,t),Sg(e.right,t));case`Or`:return _g(Sg(e.left,t),Sg(e.right,t));case ug:return vg([...t,...e.path],e.message);case dg:return yg([...t,...e.path],e.message);case fg:return bg([...t,...e.path],e.message,e.cause);case pg:return xg([...t,...e.path],e.message)}}),Cg=Symbol.for(`effect/Clock`),wg=yl(`effect/Clock`),Tg=2**31-1,Eg={unsafeSchedule(e,t){let n=nu(t);if(n>Tg)return xt;let r=!1,i=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(i),!r)}},Dg=function(){let e=BigInt(1e6);if(typeof performance>`u`||typeof performance.now!=`function`)return()=>BigInt(Date.now())*e;let t;return()=>(t===void 0&&(t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6))),t+BigInt(Math.round(performance.now()*1e6)))}(),Og=function(){let e=typeof process==`object`&&`hrtime`in process&&typeof process.hrtime.bigint==`function`?process.hrtime:void 0;if(!e)return Dg;let t=Dg()-e.bigint();return()=>t+e.bigint()}(),kg=class{[Cg]=Cg;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Og()}currentTimeMillis=R(()=>this.unsafeCurrentTimeMillis());currentTimeNanos=R(()=>this.unsafeCurrentTimeNanos());scheduler(){return I(Eg)}sleep(e){return Pp(t=>Ap(R(Eg.unsafeSchedule(()=>t(hm),e))))}},Ag=()=>new kg,jg=Zr,Mg=e=>{if(e===`NaN`)return Tr(NaN);if(e===`Infinity`)return Tr(1/0);if(e===`-Infinity`)return Tr(-1/0);if(e.trim()===``)return wr;let t=Number(e);return Number.isNaN(t)?wr:Tr(t)},Ng=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`),Pg={_tag:`Empty`},Fg=y(2,(e,t)=>{let n=fd(t),r=e;for(;cd(n);){let e=n.head;switch(e._tag){case`Empty`:n=n.tail;break;case`AndThen`:n=ud(e.first,ud(e.second,n.tail));break;case`MapName`:r=ca(r,e.f),n=n.tail;break;case`Nested`:r=ji(r,e.name),n=n.tail;break;case`Unnested`:if(x(Hi(r),yi(e.name)))r=Ki(r),n=n.tail;else return M(yg(r,`Expected ${e.name} to be in path in ConfigProvider#unnested`));break}}return j(r)}),Ig=`Constant`,Lg=`Fail`,Rg=`Fallback`,zg=`Described`,Bg=`Lazy`,Vg=`MapOrFail`,Hg=`Nested`,Ug=`Primitive`,Wg=`Sequence`,Gg=`HashMap`,Kg=`ZipWith`,qg=(e,t)=>[...e,...t],Jg=Symbol.for(`effect/ConfigProvider`),Yg=yl(`effect/ConfigProvider`),Xg=Symbol.for(`effect/ConfigProviderFlat`),Zg=e=>({[Jg]:Jg,pipe(){return A(this,arguments)},...e}),Qg=e=>({[Xg]:Xg,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),$g=e=>Zg({load:t=>F(r_(e,oa(),t,!1),e=>ri(Hi(e),{onNone:()=>Hp(yg(oa(),`Expected a single value having structure: ${t}`)),onSome:I})),flattened:e}),e_=e=>{let{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:`_`,seqDelim:`,`},e),r=e=>x(e,_a(t)),i=e=>e.split(t),a=()=>(typeof process<`u`&&`env`in process,{});return $g(Qg({load:(e,t,i=!0)=>{let o=r(e),s=a();return x(o in s?P(s[o]):N(),im(()=>yg(e,`Expected ${o} to exist in the process context`)),F(r=>o_(r,e,t,n,i)))},enumerateChildren:e=>R(()=>{let t=a();return Vs(Object.keys(t).map(e=>i(e.toUpperCase())).filter(t=>{for(let n=0;n<e.length;n++){let r=x(e,Vi(n)),i=t[n];if(i===void 0||r!==i)return!1}return!0}).flatMap(t=>t.slice(e.length,e.length+1)))}),patch:Pg}))},t_=(e,t,n,r)=>{let i=pa(n.length,t=>t>=r.length?N():P([e(t),t+1])),a=pa(r.length,e=>e>=n.length?N():P([t(e),e+1]));return[qg(n,i),qg(r,a)]},n_=(e,t)=>{let n=t;if(n._tag===`Nested`){let t=e.slice();for(;n._tag===`Nested`;)t.push(n.name),n=n.config;return t}return e},r_=(e,t,n,r)=>{let i=n;switch(i._tag){case Ig:return I(sa(i.value));case zg:return L(()=>r_(e,t,i.config,r));case Lg:return Hp(yg(t,i.message));case Rg:return x(L(()=>r_(e,t,i.first,r)),Fp(n=>i.condition(n)?x(r_(e,t,i.second,r),Fp(e=>Hp(_g(n,e)))):Hp(n)));case Bg:return L(()=>r_(e,t,i.config(),r));case Vg:return L(()=>x(r_(e,t,i.original,r),F($p(e=>x(i.mapOrFail(e),im(Sg(n_(t,i.original))))))));case Hg:return L(()=>r_(e,qg(t,sa(i.name)),i.config,r));case Ug:return x(Fg(t,e.patch),F(t=>x(e.load(t,i,r),F(e=>{if(e.length===0){let e=x(Wi(t),ai(()=>`<n/a>`));return Hp(yg([],`Expected ${i.description} with name ${e}`))}return I(e)}))));case Wg:return x(Fg(t,e.patch),F(n=>x(e.enumerateChildren(n),F(c_),F(n=>n.length===0?L(()=>nm(r_(e,t,i.config,!0),sa)):x($p(n,n=>r_(e,Mi(t,`[${n}]`),i.config,!0)),nm(e=>{let t=ua(e);return t.length===0?sa(oa()):sa(t)}))))));case Gg:return L(()=>x(Fg(t,e.patch),F(t=>x(e.enumerateChildren(t),F(n=>x(n,$p(n=>r_(e,qg(t,sa(n)),i.valueConfig,r)),nm(e=>e.length===0?sa(Wu()):x(s_(e),ca(e=>Gu(Qi(Oi(n),e)))))))))));case Kg:return L(()=>x(r_(e,t,i.left,r),Bp,F(n=>x(r_(e,t,i.right,r),Bp,F(e=>{if(Br(n)&&Br(e))return Hp(gg(n.left,e.left));if(Br(n)&&Vr(e))return Hp(n.left);if(Vr(n)&&Br(e))return Hp(e.left);if(Vr(n)&&Vr(e)){let r=i_(t,x(t,_a(`.`))),[a,o]=t_(r,r,x(n.right,ca(j)),x(e.right,ca(j)));return x(a,Qi(o),$p(([e,t])=>x(Cm(e,t),nm(([e,t])=>i.zip(e,t)))))}throw Error(`BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues`)})))))}},i_=(e,t)=>n=>M(yg(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),a_=(e,t)=>e.split(RegExp(`\\s*${Ng(t)}\\s*`)),o_=(e,t,n,r,i)=>i?x(a_(e,r),$p(e=>n.parse(e.trim())),im(Sg(t))):x(n.parse(e),rm({onFailure:Sg(t),onSuccess:sa})),s_=e=>Object.keys(e[0]).map(t=>e.map(e=>e[t])),c_=e=>x($p(e,u_),rm({onFailure:()=>oa(),onSuccess:Zi(jg)}),Bp,nm(Kr)),l_=/^(\[(\d+)\])$/,u_=e=>{let t=e.match(l_);if(t!==null){let e=t[2];return x(e!==void 0&&e.length>0?P(e):N(),mi(d_))}return N()},d_=e=>{let t=Number.parseInt(e);return Number.isNaN(t)?N():P(t)},f_=Symbol.for(`effect/Console`),p_=yl(`effect/Console`),m_={[f_]:f_,assert(e,...t){return R(()=>{console.assert(e,...t)})},clear:R(()=>{console.clear()}),count(e){return R(()=>{console.count(e)})},countReset(e){return R(()=>{console.countReset(e)})},debug(...e){return R(()=>{console.debug(...e)})},dir(e,t){return R(()=>{console.dir(e,t)})},dirxml(...e){return R(()=>{console.dirxml(...e)})},error(...e){return R(()=>{console.error(...e)})},group(e){return e?.collapsed?R(()=>console.groupCollapsed(e?.label)):R(()=>console.group(e?.label))},groupEnd:R(()=>{console.groupEnd()}),info(...e){return R(()=>{console.info(...e)})},log(...e){return R(()=>{console.log(...e)})},table(e,t){return R(()=>{console.table(e,t)})},time(e){return R(()=>console.time(e))},timeEnd(e){return R(()=>console.timeEnd(e))},timeLog(e,...t){return R(()=>{console.timeLog(e,...t)})},trace(...e){return R(()=>{console.trace(...e)})},warn(...e){return R(()=>{console.warn(...e)})},unsafe:console},h_=Symbol.for(`effect/Random`),g_=yl(`effect/Random`),__=class{seed;[h_]=h_;PRNG;constructor(e){this.seed=e,this.PRNG=new on(e)}get next(){return R(()=>this.PRNG.number())}get nextBoolean(){return nm(this.next,e=>e>.5)}get nextInt(){return R(()=>this.PRNG.integer(2**53-1))}nextRange(e,t){return nm(this.next,n=>(t-e)*n+e)}nextIntBetween(e,t){return R(()=>this.PRNG.integer(t-e)+e)}shuffle(e){return v_(e,e=>this.nextIntBetween(0,e))}},v_=(e,t)=>L(()=>x(R(()=>Array.from(e)),F(e=>{let n=[];for(let t=e.length;t>=2;--t)n.push(t);return x(n,em(n=>x(t(n),nm(t=>y_(e,n-1,t)))),kp(to(e)))}))),y_=(e,t,n)=>{let r=e[t];return e[t]=e[n],e[n]=r,e},b_=e=>new __(T(e)),x_=Symbol.for(`effect/Tracer`),S_=e=>({[x_]:x_,...e}),C_=yl(`effect/Tracer`),w_=yl(`effect/ParentSpan`),T_=function(){return function(e){let t=``;for(let n=0;n<e;n++)t+=`abcdef0123456789`.charAt(Math.floor(Math.random()*16));return t}}(),E_=class{name;parent;context;startTime;kind;_tag=`Span`;spanId;traceId=`native`;sampled=!0;status;attributes;events=[];links;constructor(e,t,n,r,i,a){this.name=e,this.parent=t,this.context=n,this.startTime=i,this.kind=a,this.status={_tag:`Started`,startTime:i},this.attributes=new Map,this.traceId=t._tag===`Some`?t.value.traceId:T_(32),this.spanId=T_(16),this.links=Array.from(r)}end(e,t){this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}},D_=S_({span:(e,t,n,r,i,a)=>new E_(e,t,n,r,i,a),context:e=>e()}),O_=kl()(`effect/Tracer/DisablePropagation`,{defaultValue:xt}),k_=x(bl(),Sl(wg,Ag()),Sl(p_,m_),Sl(g_,b_(Math.random())),Sl(Yg,e_()),Sl(C_,D_)),A_=S(Symbol.for(`effect/DefaultServices/currentServices`),()=>qm(k_)),j_=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return{BaseEffectError:class extends gh{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Object.assign(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}.BaseEffectError}(),M_=e=>{let t={BaseEffectError:class extends j_{_tag=e}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},N_=dr,P_=hr,F_=class extends P_{},I_=`Sequential`,L_=`Parallel`,R_=`ParallelN`,z_={_tag:I_},B_={_tag:L_},V_=e=>({_tag:R_,parallelism:e}),H_=e=>e._tag===I_,U_=e=>e._tag===L_,W_=z_,G_=B_,K_=V_;function q_(e){return new X_(e)}function J_(){return q_(new Map)}var Y_=Symbol.for(`effect/FiberRefs`),X_=class{locals;[Y_]=Y_;constructor(e){this.locals=e}pipe(){return A(this,arguments)}},Z_=(e,t,n,r=!1)=>{let i=e,a=t,o=n,s=r,c;for(;c===void 0;)if(Li(a)&&Li(o)){let e=Ui(a)[0],t=Ki(a),n=Ui(o)[0],r=Ui(o)[1],i=Ki(o);e.startTimeMillis<n.startTimeMillis?(o=i,s=!0):e.startTimeMillis>n.startTimeMillis?a=t:e.id<n.id?(o=i,s=!0):e.id>n.id?a=t:c=[r,s]}else c=[i.initial,!0];return c},Q_=y(3,(e,t,n)=>{let r=new Map(e.locals);return n.locals.forEach((e,n)=>{let i=e[0][1];if(!e[0][0][D](t)){if(!r.has(n)){if(O(i,n.initial))return;r.set(n,[[t,n.join(n.initial,i)]]);return}let a=r.get(n),[o,s]=Z_(n,a,e);if(s){let e=n.diff(o,i),s=a[0][1],c=n.join(s,n.patch(e)(s));if(!O(s,c)){let e,i=a[0][0];e=i[D](t)?[[i,c],...a.slice(1)]:[[t,c],...a],r.set(n,e)}}}}),new X_(r)}),$_=y(2,(e,t)=>{let n=new Map;return ev(e,n,t),new X_(n)}),ev=(e,t,n)=>{e.locals.forEach((e,r)=>{let i=e[0][1],a=r.patch(r.fork)(i);O(i,a)?t.set(r,e):t.set(r,[[n,a],...e])})},tv=y(2,(e,t)=>{let n=new Map(e.locals);return n.delete(t),new X_(n)}),nv=y(2,(e,t)=>e.locals.has(t)?P(Ui(e.locals.get(t))[1]):N()),rv=y(2,(e,t)=>x(nv(e,t),ai(()=>t.initial))),iv=y(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new X_(new Map([[n,[[t,r]]]]));let i=new Map(e.locals);return av(i,t,n,r),new X_(i)}),av=(e,t,n,r)=>{let i=e.get(n)??[],a;if(Li(i)){let[e,n]=Ui(i);if(e[D](t)){if(O(n,r))return;a=[[t,r],...i.slice(1)]}else a=[[t,r],...i]}else a=[[t,r]];e.set(n,a)},ov=y(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new X_(new Map(t));let r=new Map(e.locals);return n!==void 0&&ev(e,r,n),t.forEach(([e,t])=>{t.length===1?av(r,t[0][0],e,t[0][1]):t.forEach(([t,n])=>{av(r,t,e,n)})}),new X_(r)}),sv=rv,cv=ov,lv=J_,uv=`Empty`,dv=`Remove`,fv=`Update`,pv=`AndThen`,mv={_tag:uv},hv=(e,t)=>{let n=new Map(e.locals),r=mv;for(let[e,i]of t.locals.entries()){let t=Ui(i)[1],a=n.get(e);if(a!==void 0){let n=Ui(a)[1];O(n,t)||(r=gv({_tag:fv,fiberRef:e,patch:e.diff(n,t)})(r))}else r=gv({_tag:`Add`,fiberRef:e,value:t})(r);n.delete(e)}for(let[e]of n.entries())r=gv({_tag:dv,fiberRef:e})(r);return r},gv=y(2,(e,t)=>({_tag:pv,first:e,second:t})),_v=y(3,(e,t,n)=>{let r=n,i=sa(e);for(;Li(i);){let e=Ui(i),n=Ki(i);switch(e._tag){case uv:i=n;break;case`Add`:r=iv(r,{fiberId:t,fiberRef:e.fiberRef,value:e.value}),i=n;break;case dv:r=tv(r,e.fiberRef),i=n;break;case fv:{let a=rv(r,e.fiberRef);r=iv(r,{fiberId:t,fiberRef:e.fiberRef,value:e.fiberRef.patch(e.patch)(a)}),i=n;break}case pv:i=ji(e.first)(ji(e.second)(n));break}}return r}),vv=hv,yv=_v,bv=`effect/FiberStatus`,xv=Symbol.for(bv),Sv=`Done`,Cv=`Running`,wv=`Suspended`,Tv=bn(`${bv}-${Sv}`),Ev=class{[xv]=xv;_tag=Sv;[w](){return Tv}[D](e){return Mv(e)&&e._tag===`Done`}},Dv=class{runtimeFlags;[xv]=xv;_tag=Cv;constructor(e){this.runtimeFlags=e}[w](){return x(T(bv),E(T(this._tag)),E(T(this.runtimeFlags)),wn(this))}[D](e){return Mv(e)&&e._tag===`Running`&&this.runtimeFlags===e.runtimeFlags}},Ov=class{runtimeFlags;blockingOn;[xv]=xv;_tag=wv;constructor(e,t){this.runtimeFlags=e,this.blockingOn=t}[w](){return x(T(bv),E(T(this._tag)),E(T(this.runtimeFlags)),E(T(this.blockingOn)),wn(this))}[D](e){return Mv(e)&&e._tag===`Suspended`&&this.runtimeFlags===e.runtimeFlags&&O(this.blockingOn,e.blockingOn)}},kv=new Ev,Av=e=>new Dv(e),jv=(e,t)=>new Ov(e,t),Mv=e=>C(e,xv),Nv=e=>e._tag===Sv,Pv=kv,Fv=Av,Iv=jv,Lv=Nv,Rv=km,zv=Am,Bv=jm,Vv=Mm,Hv=Nm,Uv=Pm,Wv=Fm,Gv=Im,Kv=$r(x(jg,Qr(e=>e.ordinal))),qv=e=>{switch(e){case`All`:return Rv;case`Debug`:return Uv;case`Error`:return Bv;case`Fatal`:return zv;case`Info`:return Hv;case`Trace`:return Wv;case`None`:return Gv;case`Warning`:return Vv}},Jv=Symbol.for(`effect/Micro`),Yv=Symbol.for(`effect/Micro/MicroExit`),Xv=Symbol.for(`effect/Micro/MicroCause`),Zv={_E:b},Qv=class extends globalThis.Error{_tag;traces;[Xv];constructor(e,t,n){let r=`MicroCause.${e}`,i,a,o;if(t instanceof globalThis.Error){i=`(${r}) ${t.name}`,a=t.message;let e=a.split(`
|
|
260
|
+
`).length;o=t.stack?`(${r}) ${t.stack.split(`
|
|
261
|
+
`).slice(0,e+3).join(`
|
|
262
|
+
`)}`:`${i}: ${a}`}else i=r,a=Fn(t,0),o=`${i}: ${a}`;n.length>0&&(o+=`\n ${n.join(`
|
|
263
|
+
`)}`),super(a),this._tag=e,this.traces=n,this[Xv]=Zv,this.name=i,this.stack=o}pipe(){return A(this,arguments)}toString(){return this.stack}[k](){return this.stack}},$v=class extends Qv{error;constructor(e,t=[]){super(`Fail`,e,t),this.error=e}},ey=(e,t=[])=>new $v(e,t),ty=class extends Qv{defect;constructor(e,t=[]){super(`Die`,e,t),this.defect=e}},ny=(e,t=[])=>new ty(e,t),ry=class extends Qv{constructor(e=[]){super(`Interrupt`,`interrupted`,e)}},iy=(e=[])=>new ry(e),ay=e=>e._tag===`Interrupt`,oy=Symbol.for(`effect/Micro/MicroFiber`),sy={_A:b,_E:b},cy=class{context;interruptible;[oy];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(e,t=!0){this.context=e,this.interruptible=t,this[oy]=sy}getRef(e){return pl(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ct):(this._observers.push(e),()=>{let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(Py))}unsafePoll(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===gy)return;let n=ly.interruptChildren&&ly.interruptChildren(this);if(n!==void 0)return this.evaluate(ky(n,()=>t));this._exit=t;for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0}runLoop(e){let t=!1,n=e;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!t&&this.getRef(Hy).shouldYield(this)){t=!0;let e=n;n=ky(Ey,()=>e)}if(n=n[fy](this),n===gy){let e=this._yielded;return Yv in e?(this._yielded=void 0,e):gy}}}catch(e){return C(n,fy)?Fy(e):Fy(`MicroFiber.runLoop: Not a valid effect: ${String(n)}`)}}getCont(e){for(;;){let t=this._stack.pop();if(!t)return;let n=t[hy]&&t[hy](this);if(n)return{[e]:n};if(t[e])return t}}_yielded=void 0;yieldWith(e){return this._yielded=e,gy}children(){return this._children??=new Set}},ly=S(`effect/Micro/fiberMiddleware`,()=>({interruptChildren:void 0})),uy=Symbol.for(`effect/Micro/identifier`),dy=Symbol.for(`effect/Micro/args`),fy=Symbol.for(`effect/Micro/evaluate`),py=Symbol.for(`effect/Micro/successCont`),my=Symbol.for(`effect/Micro/failureCont`),hy=Symbol.for(`effect/Micro/ensureCont`),gy=Symbol.for(`effect/Micro/Yield`),_y={_A:b,_E:b,_R:b},vy={...N_,_op:`Micro`,[Jv]:_y,pipe(){return A(this,arguments)},[Symbol.iterator](){return new Qt(new un(this))},toJSON(){return{_id:`Micro`,op:this[uy],...dy in this?{args:this[dy]}:void 0}},toString(){return Pn(this)},[k](){return Pn(this)}};function yy(e){return Fy(`Micro.evaluate: Not implemented`)}var by=e=>({...vy,[uy]:e.op,[fy]:e.eval??yy,[py]:e.contA,[my]:e.contE,[hy]:e.ensure}),xy=e=>{let t=by(e);return function(){let n=Object.create(t);return n[dy]=e.single===!1?arguments:arguments[0],n}},Sy=e=>{let t={...by(e),[Yv]:Yv,_tag:e.op,get[e.prop](){return this[dy]},toJSON(){return{_id:`MicroExit`,_tag:e.op,[e.prop]:this[dy]}},[D](t){return jy(t)&&t._tag===e.op&&O(this[dy],t[dy])},[w](){return wn(this,E(bn(e.op))(T(this[dy])))}};return function(e){let n=Object.create(t);return n[dy]=e,n[py]=void 0,n[my]=void 0,n[hy]=void 0,n}},Cy=Sy({op:`Success`,prop:`value`,eval(e){let t=e.getCont(py);return t?t[py](this[dy],e):e.yieldWith(this)}}),wy=Sy({op:`Failure`,prop:`cause`,eval(e){let t=e.getCont(my);for(;ay(this[dy])&&t&&e.interruptible;)t=e.getCont(my);return t?t[my](this[dy],e):e.yieldWith(this)}}),Ty=e=>wy(ey(e)),Ey=xy({op:`Yield`,eval(e){let t=!1;return e.getRef(Hy).scheduleTask(()=>{t||e.evaluate(Iy)},this[dy]??0),e.yieldWith(()=>{t=!0})}})(0),Dy=Cy(void 0),Oy=xy({op:`WithMicroFiber`,eval(e){return this[dy](e)}}),ky=y(2,(e,t)=>{let n=Object.create(Ay);return n[dy]=e,n[py]=t,n}),Ay=by({op:`OnSuccess`,eval(e){return e._stack.push(this),this[dy]}}),jy=e=>C(e,Yv),My=Cy,Ny=wy,Py=Ny(iy()),Fy=e=>Ny(ny(e)),Iy=My(void 0),Ly=`setImmediate`in globalThis?globalThis.setImmediate:e=>setTimeout(e,0),Ry=class{tasks=[];running=!1;scheduleTask(e,t){this.tasks.push(e),this.running||(this.running=!0,Ly(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){let e=this.tasks;this.tasks=[];for(let t=0,n=e.length;t<n;t++)e[t]()}shouldYield(e){return e.currentOpCount>=e.getRef(Vy)}flush(){for(;this.tasks.length>0;)this.runTasks()}},zy=y(2,(e,t)=>Oy(n=>{let r=n.context;return n.context=t(r),Gy(e,()=>(n.context=r,Dy))})),By=y(2,(e,t)=>zy(e,El(t))),Vy=class extends kl()(`effect/Micro/currentMaxOpsBeforeYield`,{defaultValue:()=>2048}){};kl()(`effect/Micro/currentConcurrency`,{defaultValue:()=>`unbounded`});var Hy=class extends kl()(`effect/Micro/currentScheduler`,{defaultValue:()=>new Ry}){},Uy=y(2,(e,t)=>{let n=Object.create(Wy);return n[dy]=e,n[py]=t.onSuccess,n[my]=t.onFailure,n}),Wy=by({op:`OnSuccessAndFailure`,eval(e){return e._stack.push(this),this[dy]}}),Gy=y(2,(e,t)=>Jy(n=>Uy(n(e),{onFailure:e=>ky(t(Ny(e)),()=>wy(e)),onSuccess:e=>ky(t(My(e)),()=>Cy(e))}))),Ky=xy({op:`SetInterruptible`,ensure(e){if(e.interruptible=this[dy],e._interrupted&&e.interruptible)return()=>Py}}),qy=e=>Oy(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(Ky(!1)),t._interrupted?Py:e)),Jy=e=>Oy(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Ky(!0)),e(qy)):e(b)),Yy=(e,t)=>{let n=new cy(Hy.context(t?.scheduler??new Ry));if(n.evaluate(e),t?.signal)if(t.signal.aborted)n.unsafeInterrupt();else{let e=()=>n.unsafeInterrupt();t.signal.addEventListener(`abort`,e,{once:!0}),n.addObserver(()=>t.signal.removeEventListener(`abort`,e))}return n},Xy=function(){class e extends globalThis.Error{}return Object.assign(e.prototype,vy,fr,{[uy]:`Failure`,[fy](){return Ty(this)},toString(){return this.message?`${this.name}: ${this.message}`:this.name},toJSON(){return{...this}},[k](){let e=this.stack;return e?`${this.toString()}\n${e.split(`
|
|
264
|
+
`).slice(1).join(`
|
|
265
|
+
`)}`:this.toString()}}),e}(),Zy=function(){return class extends Xy{constructor(e){super(),e&&Object.assign(this,e)}}}(),Qy=e=>{class t extends Zy{_tag=e}return t.prototype.name=e,t};Qy(`NoSuchElementException`),Qy(`TimeoutException`);var $y=Symbol.for(`effect/Readable`),eb=Symbol.for(`effect/Ref`),tb={_A:e=>e},nb=class extends F_{ref;commit(){return this.get}[eb]=tb;[$y]=$y;constructor(e){super(),this.ref=e,this.get=R(()=>_u(this.ref))}get;modify(e){return R(()=>{let t=_u(this.ref),[n,r]=e(t);return t!==r&&vu(r)(this.ref),n})}},rb=e=>new nb(gu(e)),ib=e=>R(()=>rb(e)),ab=e=>e.get,ob=y(2,(e,t)=>e.modify(()=>[void 0,t])),sb=y(2,(e,t)=>e.modify(t)),cb=y(2,(e,t)=>e.modify(e=>[void 0,t(e)])),lb=class e{scheduleDrain;running=!1;tasks=new ub;constructor(e){this.scheduleDrain=e}starveInternal=e=>{let t=this.tasks.buckets;this.tasks.buckets=[];for(let[e,n]of t)for(let e=0;e<n.length;e++)n[e]();this.tasks.buckets.length===0?this.running=!1:this.starve(e)};starve(e=0){this.scheduleDrain(e,this.starveInternal)}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running||(this.running=!0,this.starve())}static cached(t){let n=new e(t),r=new WeakMap;return i=>{if(i===void 0)return n;let a=r.get(i);return a===void 0&&(a=new e(t),r.set(i,a)),a}}},ub=class{buckets=[];scheduleTask(e,t){let n=this.buckets.length,r,i=0;for(;i<n&&this.buckets[i][0]<=t;i++)r=this.buckets[i];r&&r[0]===t?r[1].push(e):i===n?this.buckets.push([t,[e]]):this.buckets.splice(i,0,[t,[e]])}},db=class{maxNextTickBeforeTimer;getRunner=lb.cached((e,t)=>{e>=this.maxNextTickBeforeTimer?setTimeout(()=>t(0),0):Promise.resolve(void 0).then(()=>t(e+1))});constructor(e){this.maxNextTickBeforeTimer=e}shouldYield(e){return e.currentOpCount>e.getFiberRef(Qm)?e.getFiberRef(Zm):!1}scheduleTask(e,t,n){this.getRunner(n).scheduleTask(e,t)}},fb=S(Symbol.for(`effect/Scheduler/defaultScheduler`),()=>new db(2048)),pb=class{tasks=new ub;deferred=!1;scheduleTask(e,t,n){this.deferred?fb.scheduleTask(e,t,n):this.tasks.scheduleTask(e,t)}shouldYield(e){return e.currentOpCount>e.getFiberRef(Qm)?e.getFiberRef(Zm):!1}flush(){for(;this.tasks.buckets.length>0;){let e=this.tasks.buckets;this.tasks.buckets=[];for(let[t,n]of e)for(let e=0;e<n.length;e++)n[e]()}this.deferred=!0}},mb=S(Symbol.for(`effect/FiberRef/currentScheduler`),()=>Wm(fb)),hb=S(Symbol.for(`effect/FiberRef/currentRequestMap`),()=>Wm(new Map)),gb=(e,t,n,r)=>{switch(e){case void 0:return t();case`unbounded`:return n();case`inherit`:return Bm(rh,e=>e===`unbounded`?n():e>1?r(e):t());default:return e>1?r(e):t()}},_b=e=>e.replace(/[\s="]/g,`_`),vb=e=>t=>`${_b(t.label)}=${e-t.startTime}ms`,yb=`effect/MetricLabel`,bb=Symbol.for(yb),xb=class{key;value;[bb]=bb;_hash;constructor(e,t){this.key=e,this.value=t,this._hash=bn(yb+this.key+this.value)}[w](){return this._hash}[D](e){return Cb(e)&&this.key===e.key&&this.value===e.value}pipe(){return A(this,arguments)}},Sb=(e,t)=>new xb(e,t),Cb=e=>C(e,bb),wb=e=>nm(e,P),Tb=e=>Rb(e,kb,hv),Eb=e=>sm(e,()=>F(Sm(),()=>Eb(e))),Db=(e,t,n,r)=>F(n(r,t),i=>{if(i)return I(P(r));let a=e.next();return a.done?I(N()):Db(e,t+1,n,a.value)}),Ob=(e,t,n)=>{let r=e.next();return r.done?I(!0):F(n(r.value,t),r=>r?Ob(e,t+1,n):I(r))},kb=Dp(e=>I(e.getFiberRefs())),Ab=(e,t)=>L(()=>t.while(e)?F(t.body(e),e=>Ab(e,t)):I(e)),jb=(e,t,n,r)=>L(()=>t(e)?F(r(e),i=>nm(jb(n(e),t,n,r),md(i))):R(()=>dd())),Mb=(e,t,n,r)=>L(()=>t(e)?F(r(e),()=>Mb(n(e),t,n,r)):hm),Nb=e=>zb((t,n)=>x(e,_v(t,n))),Pb=y(3,(e,t,n)=>rg(r=>ig(e,Sl(r,t,n)))),Fb=(e,t,n,r,i)=>{let a=e.next();return!a.done&&r(n)?F(i(n,a.value,t),n=>Fb(e,t+1,n,r,i)):I(n)},Ib=(e,t)=>F(e,n=>t<=0?I(n):Tm(Sm(),Ib(e,t-1))),Lb=I(N()),Rb=y(3,(e,t,n)=>F(t,r=>F(e,e=>nm(t,t=>[n(r,t),e])))),zb=e=>Dp(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),hm)),Bb=mi(e=>Cl(e.context,O_)?e._tag===`Span`?Bb(e.parent):N():P(e)),Vb=kh,Hb=Lh,Ub=`InterruptSignal`,Wb=`Stateful`,Gb=`Resume`,Kb=`YieldNow`,qb=e=>({_tag:Ub,cause:e}),Jb=e=>({_tag:Wb,onFiber:e}),Yb=e=>({_tag:Gb,effect:e}),Xb=()=>({_tag:Kb}),Zb=Symbol.for(`effect/FiberScope`),Qb=class{[Zb]=Zb;fiberId=Ru;roots=new Set;add(e,t){this.roots.add(t),t.addObserver(()=>{this.roots.delete(t)})}},$b=class{fiberId;parent;[Zb]=Zb;constructor(e,t){this.fiberId=e,this.parent=t}add(e,t){this.parent.tell(Jb(e=>{e.addChild(t),t.addObserver(()=>{e.removeChild(t)})}))}},ex=e=>new $b(e.id(),e),tx=S(Symbol.for(`effect/FiberScope/Global`),()=>new Qb),nx=Symbol.for(`effect/Fiber`),rx={_E:e=>e,_A:e=>e},ix={[nx]:rx,pipe(){return A(this,arguments)}},ax=Symbol.for(`effect/Fiber`),ox=e=>wm(Yp(e.await),e.inheritAll);({...pr}),{...ix};var sx=`effect/FiberCurrent`,cx=Symbol.for(`effect/Logger`),lx={_Message:e=>e,_Output:e=>e},ux=e=>({[cx]:lx,log:e,pipe(){return A(this,arguments)}}),dx=/^[^\s"=]*$/,fx=ux(((e,t)=>({annotations:n,cause:r,date:i,fiberId:a,logLevel:o,message:s,spans:c})=>{let l=t=>t.match(dx)?t:e(t),u=(e,t)=>`${_b(e)}=${l(t)}`,d=(e,t)=>` `+u(e,t),f=u(`timestamp`,i.toISOString());f+=d(`level`,o.label),f+=d(`fiber`,Fu(a));let p=ki(s);for(let e=0;e<p.length;e++)f+=d(`message`,Fn(p[e],t));pc(r)||(f+=d(`cause`,Rc(r,{renderErrorCause:!0})));for(let e of c)f+=` `+vb(i.getTime())(e);for(let[e,r]of n)f+=d(e,Fn(r,t));return f})(e=>`"${e.replace(/\\([\s\S])|(")/g,`\\$1$2`)}"`)),px={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};px.gray,px.blue,px.green,px.yellow,px.red,px.bgBrightRed,px.black;var mx=typeof process==`object`&&process!==null&&typeof process.stdout==`object`&&process.stdout!==null;mx&&process.stdout.isTTY,mx||`Deno`in globalThis;var hx=`effect/MetricBoundaries`,gx=Symbol.for(hx),_x=class{values;[gx]=gx;constructor(e){this.values=e,this._hash=x(bn(hx),E(Cn(this.values)))}_hash;[w](){return this._hash}[D](e){return vx(e)&&O(this.values,e.values)}pipe(){return A(this,arguments)}},vx=e=>C(e,gx),yx=e=>new _x(x(e,Ni(eo(1/0)),ga)),bx=e=>x(Di(e.count-1,t=>e.start*e.factor**+t),oo,yx),xx=Symbol.for(`effect/MetricKeyType`),Sx=`effect/MetricKeyType/Counter`,Cx=Symbol.for(Sx),wx=Symbol.for(`effect/MetricKeyType/Frequency`),Tx=Symbol.for(`effect/MetricKeyType/Gauge`),Ex=`effect/MetricKeyType/Histogram`,Dx=Symbol.for(Ex),Ox=Symbol.for(`effect/MetricKeyType/Summary`),kx={_In:e=>e,_Out:e=>e},Ax=class{incremental;bigint;[xx]=kx;[Cx]=Cx;constructor(e,t){this.incremental=e,this.bigint=t,this._hash=bn(Sx)}_hash;[w](){return this._hash}[D](e){return Px(e)}pipe(){return A(this,arguments)}},jx=class{boundaries;[xx]=kx;[Dx]=Dx;constructor(e){this.boundaries=e,this._hash=x(bn(Ex),E(T(this.boundaries)))}_hash;[w](){return this._hash}[D](e){return Lx(e)&&O(this.boundaries,e.boundaries)}pipe(){return A(this,arguments)}},Mx=e=>new Ax(e?.incremental??!1,e?.bigint??!1),Nx=e=>new jx(e),Px=e=>C(e,Cx),Fx=e=>C(e,wx),Ix=e=>C(e,Tx),Lx=e=>C(e,Dx),Rx=e=>C(e,Ox),zx=Symbol.for(`effect/MetricKey`),Bx={_Type:e=>e},Vx=ma(O),Hx=class{name;keyType;description;tags;[zx]=Bx;constructor(e,t,n,r=[]){this.name=e,this.keyType=t,this.description=n,this.tags=r,this._hash=x(bn(this.name+this.description),E(T(this.keyType)),E(Cn(this.tags)))}_hash;[w](){return this._hash}[D](e){return Ux(e)&&this.name===e.name&&O(this.keyType,e.keyType)&&O(this.description,e.description)&&Vx(this.tags,e.tags)}pipe(){return A(this,arguments)}},Ux=e=>C(e,zx),Wx=(e,t)=>new Hx(e,Mx(t),ci(t?.description)),Gx=(e,t,n)=>new Hx(e,Nx(t),ci(n)),Kx=y(2,(e,t)=>t.length===0?e:new Hx(e.name,e.keyType,e.description,aa(e.tags,t))),qx=Symbol.for(`effect/MutableHashMap`),Jx={[qx]:qx,[Symbol.iterator](){return new Yx(this)},toString(){return Pn(this.toJSON())},toJSON(){return{_id:`MutableHashMap`,values:Array.from(this).map(On)}},[k](){return this.toJSON()},pipe(){return A(this,arguments)}},Yx=class e{self;referentialIterator;bucketIterator;constructor(e){this.self=e,this.referentialIterator=e.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();let e=this.referentialIterator.next();return e.done?(this.bucketIterator=new Xx(this.self.buckets.values()),this.next()):e}[Symbol.iterator](){return new e(this.self)}},Xx=class{backing;constructor(e){this.backing=e}currentBucket;next(){if(this.currentBucket===void 0){let e=this.backing.next();if(e.done)return e;this.currentBucket=e.value[Symbol.iterator]()}let e=this.currentBucket.next();return e.done?(this.currentBucket=void 0,this.next()):e}},Zx=()=>{let e=Object.create(Jx);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},Qx=y(2,(e,t)=>{if(En(t)===!1)return e.referential.has(t)?P(e.referential.get(t)):N();let n=t[w](),r=e.buckets.get(n);return r===void 0?N():$x(e,r,t)}),$x=(e,t,n,r=!1)=>{for(let i=0,a=t.length;i<a;i++)if(n[D](t[i][0])){let n=t[i][1];return r&&(t.splice(i,1),e.bucketsSize--),P(n)}return N()},eS=y(2,(e,t)=>ni(Qx(e,t))),tS=y(3,(e,t,n)=>{if(En(t)===!1)return e.referential.set(t,n),e;let r=t[w](),i=e.buckets.get(r);return i===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(nS(e,i,t),i.push([t,n]),e.bucketsSize++,e)}),nS=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(n[D](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},rS=Symbol.for(`effect/MetricState`),iS=`effect/MetricState/Counter`,aS=Symbol.for(iS),oS=`effect/MetricState/Frequency`,sS=Symbol.for(oS),cS=`effect/MetricState/Gauge`,lS=Symbol.for(cS),uS=`effect/MetricState/Histogram`,dS=Symbol.for(uS),fS=`effect/MetricState/Summary`,pS=Symbol.for(fS),mS={_A:e=>e},hS=class{count;[rS]=mS;[aS]=aS;constructor(e){this.count=e}[w](){return x(T(iS),E(T(this.count)),wn(this))}[D](e){return ES(e)&&this.count===e.count}pipe(){return A(this,arguments)}},gS=ma(O),_S=class{occurrences;[rS]=mS;[sS]=sS;constructor(e){this.occurrences=e}_hash;[w](){return x(bn(oS),E(Cn(Oi(this.occurrences.entries()))),wn(this))}[D](e){return DS(e)&&gS(Oi(this.occurrences.entries()),Oi(e.occurrences.entries()))}pipe(){return A(this,arguments)}},vS=class{value;[rS]=mS;[lS]=lS;constructor(e){this.value=e}[w](){return x(T(cS),E(T(this.value)),wn(this))}[D](e){return OS(e)&&this.value===e.value}pipe(){return A(this,arguments)}},yS=class{buckets;count;min;max;sum;[rS]=mS;[dS]=dS;constructor(e,t,n,r,i){this.buckets=e,this.count=t,this.min=n,this.max=r,this.sum=i}[w](){return x(T(uS),E(T(this.buckets)),E(T(this.count)),E(T(this.min)),E(T(this.max)),E(T(this.sum)),wn(this))}[D](e){return kS(e)&&O(this.buckets,e.buckets)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return A(this,arguments)}},bS=class{error;quantiles;count;min;max;sum;[rS]=mS;[pS]=pS;constructor(e,t,n,r,i,a){this.error=e,this.quantiles=t,this.count=n,this.min=r,this.max=i,this.sum=a}[w](){return x(T(fS),E(T(this.error)),E(T(this.quantiles)),E(T(this.count)),E(T(this.min)),E(T(this.max)),E(T(this.sum)),wn(this))}[D](e){return AS(e)&&this.error===e.error&&O(this.quantiles,e.quantiles)&&this.count===e.count&&this.min===e.min&&this.max===e.max&&this.sum===e.sum}pipe(){return A(this,arguments)}},xS=e=>new hS(e),SS=e=>new _S(e),CS=e=>new vS(e),wS=e=>new yS(e.buckets,e.count,e.min,e.max,e.sum),TS=e=>new bS(e.error,e.quantiles,e.count,e.min,e.max,e.sum),ES=e=>C(e,aS),DS=e=>C(e,sS),OS=e=>C(e,lS),kS=e=>C(e,dS),AS=e=>C(e,pS),jS=Symbol.for(`effect/MetricHook`),MS={_In:e=>e,_Out:e=>e},NS=e=>({[jS]:MS,pipe(){return A(this,arguments)},...e}),PS=BigInt(0),FS=e=>{let t=e.keyType.bigint?PS:0,n=e.keyType.incremental?e.keyType.bigint?e=>e>=PS:e=>e>=0:e=>!0,r=e=>{n(e)&&(t+=e)};return NS({get:()=>xS(t),update:r,modify:r})},IS=e=>{let t=new Map;for(let n of e.keyType.preregisteredWords)t.set(n,0);let n=e=>{let n=t.get(e)??0;t.set(e,n+1)};return NS({get:()=>SS(t),update:n,modify:n})},LS=(e,t)=>{let n=t;return NS({get:()=>CS(n),update:e=>{n=e},modify:e=>{n+=e}})},RS=e=>{let t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),i=new Float64Array(n),a=0,o=0,s=Number.MAX_VALUE,c=Number.MIN_VALUE;x(t,Zi(jg),ca((e,t)=>{i[t]=e}));let l=e=>{let t=0,l=n;for(;t!==l;){let n=Math.floor(t+(l-t)/2);e<=i[n]?l=n:t=n,l===t+1&&(e<=i[t]?l=t:t=l)}r[t]=r[t]+1,a+=1,o+=e,e<s&&(s=e),e>c&&(c=e)},u=()=>{let e=Ei(n),t=0;for(let a=0;a<n;a++){let n=i[a],o=r[a];t+=o,e[a]=[n,t]}return e};return NS({get:()=>wS({buckets:u(),count:a,min:s,max:c,sum:o}),update:l,modify:l})},zS=e=>{let{error:t,maxAge:n,maxSize:r,quantiles:i}=e.keyType,a=x(i,Zi(jg)),o=Ei(r),s=0,c=0,l=0,u=0,d=0,f=e=>{let i=[],s=0;for(;s!==r-1;){let t=o[s];if(t!=null){let[r,a]=t,o=Xl(e-r);uu(o,Kl)&&lu(o,n)&&i.push(a)}s+=1}return BS(t,a,Zi(i,jg))},p=(e,t)=>{if(r>0){s+=1;let n=s%r;o[n]=[t,e]}u=c===0?e:Math.min(u,e),d=c===0?e:Math.max(d,e),c+=1,l+=e};return NS({get:()=>TS({error:t,quantiles:f(Date.now()),count:c,min:u,max:d,sum:l}),update:([e,t])=>p(e,t),modify:([e,t])=>p(e,t)})},BS=(e,t,n)=>{let r=n.length;if(!Li(t))return oa();let i=t[0],a=t.slice(1),o=VS(e,r,N(),0,i,n),s=sa(o);return a.forEach(t=>{s.push(VS(e,r,o.value,o.consumed,t,o.rest))}),ca(s,e=>[e.quantile,e.value])},VS=(e,t,n,r,i,a)=>{let o=e,s=t,c=n,l=r,u=i,d=a,f=e,p=t,m=n,h=r,g=i,_=a;for(;;){if(!Li(d))return{quantile:u,value:N(),consumed:l,rest:[]};if(u===1)return{quantile:u,value:P(Gi(d)),consumed:l+d.length,rest:[]};let e=Ui(d),t=Ji(d,t=>t===e),n=u*s,r=o/2*n,i=l+t[0].length,a=Math.abs(i-n);if(i<n-r){f=o,p=s,m=Hi(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue}if(i>n+r){let t=ti(c)?P(e):c;return{quantile:u,value:t,consumed:l,rest:d}}switch(c._tag){case`None`:f=o,p=s,m=Hi(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue;case`Some`:if(a<Math.abs(n-c.value)){f=o,p=s,m=Hi(d),h=i,g=u,_=t[1],o=f,s=p,c=m,l=h,u=g,d=_;continue}return{quantile:u,value:P(c.value),consumed:l,rest:d}}}throw Error(`BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues`)},HS=Symbol.for(`effect/MetricPair`),US={_Type:e=>e},WS=(e,t)=>({[HS]:US,metricKey:e,metricState:t,pipe(){return A(this,arguments)}}),GS=Symbol.for(`effect/MetricRegistry`),KS=class{[GS]=GS;map=Zx();snapshot(){let e=[];for(let[t,n]of this.map)e.push(WS(t,n.get()));return e}get(e){let t=x(this.map,Qx(e),li);if(t==null){if(Px(e.keyType))return this.getCounter(e);if(Ix(e.keyType))return this.getGauge(e);if(Fx(e.keyType))return this.getFrequency(e);if(Lx(e.keyType))return this.getHistogram(e);if(Rx(e.keyType))return this.getSummary(e);throw Error(`BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues`)}else return t}getCounter(e){let t=x(this.map,Qx(e),li);if(t==null){let n=FS(e);x(this.map,eS(e))||x(this.map,tS(e,n)),t=n}return t}getFrequency(e){let t=x(this.map,Qx(e),li);if(t==null){let n=IS(e);x(this.map,eS(e))||x(this.map,tS(e,n)),t=n}return t}getGauge(e){let t=x(this.map,Qx(e),li);if(t==null){let n=LS(e,e.keyType.bigint?BigInt(0):0);x(this.map,eS(e))||x(this.map,tS(e,n)),t=n}return t}getHistogram(e){let t=x(this.map,Qx(e),li);if(t==null){let n=RS(e);x(this.map,eS(e))||x(this.map,tS(e,n)),t=n}return t}getSummary(e){let t=x(this.map,Qx(e),li);if(t==null){let n=zS(e);x(this.map,eS(e))||x(this.map,tS(e,n)),t=n}return t}},qS=()=>new KS,JS=Symbol.for(`effect/Metric`),YS={_Type:e=>e,_In:e=>e,_Out:e=>e},XS=S(Symbol.for(`effect/Metric/globalMetricRegistry`),()=>qS()),ZS=function(e,t,n,r){let i=Object.assign(e=>um(e,e=>rC(i,e)),{[JS]:YS,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return A(this,arguments)}});return i},QS=(e,t)=>$S(Wx(e,t)),$S=e=>{let t,n=new WeakMap,r=r=>{if(r.length===0)return t===void 0&&(t=XS.get(e)),t;let i=n.get(r);return i===void 0?(i=XS.get(Kx(e,r)),n.set(r,i),i):i};return ZS(e.keyType,(e,t)=>r(t).update(e),e=>r(e).get(),(e,t)=>r(t).modify(e))},eC=(e,t,n)=>$S(Gx(e,t,n)),tC=y(3,(e,t,n)=>nC(e,[Sb(t,n)])),nC=y(2,(e,t)=>ZS(e.keyType,(n,r)=>e.unsafeUpdate(n,aa(t,r)),n=>e.unsafeValue(aa(t,n)),(n,r)=>e.unsafeModify(n,aa(t,r)))),rC=y(2,(e,t)=>Bm(sh,n=>R(()=>e.unsafeUpdate(t,n))));({...fr});var iC=y(2,(e,t)=>Bm(hb,n=>R(()=>{if(n.has(e)){let r=n.get(e);r.state.completed||(r.state.completed=!0,$h(r.result,t))}}))),aC=Symbol.for(`effect/Supervisor`),oC={_T:e=>e},sC=class e{underlying;value0;[aC]=oC;constructor(e,t){this.underlying=e,this.value0=t}get value(){return this.value0}onStart(e,t,n,r){this.underlying.onStart(e,t,n,r)}onEnd(e,t){this.underlying.onEnd(e,t)}onEffect(e,t){this.underlying.onEffect(e,t)}onSuspend(e){this.underlying.onSuspend(e)}onResume(e){this.underlying.onResume(e)}map(t){return new e(this,x(this.value,nm(t)))}zip(e){return new cC(this,e)}},cC=class e{left;right;_tag=`Zip`;[aC]=oC;constructor(e,t){this.left=e,this.right=t}get value(){return Cm(this.left.value,this.right.value)}onStart(e,t,n,r){this.left.onStart(e,t,n,r),this.right.onStart(e,t,n,r)}onEnd(e,t){this.left.onEnd(e,t),this.right.onEnd(e,t)}onEffect(e,t){this.left.onEffect(e,t),this.right.onEffect(e,t)}onSuspend(e){this.left.onSuspend(e),this.right.onSuspend(e)}onResume(e){this.left.onResume(e),this.right.onResume(e)}map(e){return new sC(this,x(this.value,nm(e)))}zip(t){return new e(this,t)}},lC=e=>C(e,aC)&&Ut(e,`Zip`),uC=class{effect;[aC]=oC;constructor(e){this.effect=e}get value(){return this.effect}onStart(e,t,n,r){}onEnd(e,t){}onEffect(e,t){}onSuspend(e){}onResume(e){}map(e){return new sC(this,x(this.value,nm(e)))}zip(e){return new cC(this,e)}onRun(e,t){return e()}},dC=e=>new uC(e),fC=S(`effect/Supervisor/none`,()=>dC(hm)),pC=pf,mC=`Empty`,hC=`AddSupervisor`,gC=`RemoveSupervisor`,_C=`AndThen`,vC={_tag:mC},yC=(e,t)=>({_tag:_C,first:e,second:t}),bC=(e,t)=>xC(t,eo(e)),xC=(e,t)=>{let n=e,r=t;for(;ho(r);){let e=vo(r);switch(e._tag){case mC:r=yo(r);break;case hC:n=n.zip(e.supervisor),r=yo(r);break;case gC:n=SC(n,e.supervisor),r=yo(r);break;case _C:r=uo(e.first)(uo(e.second)(yo(r)));break}}return n},SC=(e,t)=>O(e,t)?fC:lC(e)?SC(e.left,t).zip(SC(e.right,t)):e,CC=e=>O(e,fC)?Bs():lC(e)?x(CC(e.left),Ys(CC(e.right))):Hs(e),wC=pC({empty:vC,patch:bC,combine:yC,diff:(e,t)=>{if(O(e,t))return vC;let n=CC(e),r=CC(t);return yC(x(r,Js(n),Xs(vC,(e,t)=>yC(e,{_tag:hC,supervisor:t}))),x(n,Js(r),Xs(vC,(e,t)=>yC(e,{_tag:gC,supervisor:t}))))}}),TC=QS(`effect_fiber_started`,{incremental:!0}),EC=QS(`effect_fiber_active`),DC=QS(`effect_fiber_successes`,{incremental:!0}),OC=QS(`effect_fiber_failures`,{incremental:!0}),kC=tC(eC(`effect_fiber_lifetimes`,bx({start:.5,factor:2,count:35})),`time_unit`,`milliseconds`),AC=`Continue`,jC=`Done`,MC=`Yield`,NC={_E:e=>e,_A:e=>e},PC=e=>{throw Error(`BUG: FiberRuntime - ${Fn(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},FC=Symbol.for(`effect/internal/fiberRuntime/YieldedOp`),IC=S(`effect/internal/fiberRuntime/yieldedOpChannel`,()=>({currentOp:null})),LC={[Kn]:(e,t,n)=>mn(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>Hh(Hh(n)),[qn]:(e,t,n)=>mn(()=>t.effect_instruction_i2(n)),[tr]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),Mf(e.currentRuntimeFlags)&&e.isInterrupted()?Fh(e.getInterruptedCause()):Hh(n)),[Zn]:(e,t,n)=>(mn(()=>t.effect_instruction_i2(n)),mn(()=>t.effect_instruction_i0())?(e.pushStack(t),mn(()=>t.effect_instruction_i1())):hm),[Qn]:(e,t,n)=>{for(;;){let r=mn(()=>t.effect_instruction_i0.next(n));if(r.done)return Hh(r.value);let i=dn(r.value);if(!Oh(i))return e.pushStack(t),i;if(i._tag===`Failure`)return i;n=i.value}}},RC={[Ub]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),Mf(t)?Fh(r.cause):n),[Gb]:(e,t,n,r)=>{throw Error(`It is illegal to have multiple concurrent run loops in a single fiber`)},[Wb]:(e,t,n,r)=>(r.onFiber(e,Fv(t)),n),[Kb]:(e,t,n,r)=>F(Sm(),()=>n)},zC=e=>em(qf(e),e=>ew(dp(e),([e,t])=>{let n=new Map,r=[];for(let e of t){r.push(ro(e));for(let t of e)n.set(t.request,t)}let i=r.flat();return Um(Cw(e.runAll(r),i,()=>i.forEach(e=>{e.listeners.interrupted=!0})),hb,n)},!1,!1)),BC=rr(),VC=class extends F_{[nx]=rx;[ax]=NC;_fiberRefs;_fiberId;_queue=[];_children=null;_observers=[];_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(e,t,n){if(super(),this.currentRuntimeFlags=n,this._fiberId=e,this._fiberRefs=t,Lf(n)){let e=this.getFiberRef(sh);TC.unsafeUpdate(1,e),EC.unsafeUpdate(1,e)}this.refreshRefCache()}commit(){return ox(this)}id(){return this._fiberId}resume(e){this.tell(Yb(e))}get status(){return this.ask((e,t)=>t)}get runtimeFlags(){return this.ask((e,t)=>Lv(t)?e.currentRuntimeFlags:t.runtimeFlags)}scope(){return ex(this)}get children(){return this.ask(e=>Array.from(e.getChildren()))}getChildren(){return this._children===null&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(lh)}fiberRefs(){return this.ask(e=>e.getFiberRefs())}ask(e){return L(()=>{let t=Kh(this._fiberId);return this.tell(Jb((n,r)=>{$h(t,R(()=>e(n,r)))})),Yh(t)})}tell(e){this._queue.push(e),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Pp(e=>{let t=t=>e(I(t));if(this._exitValue!==null){t(this._exitValue);return}return this.tell(Jb((e,n)=>{e._exitValue===null?e.addObserver(t):t(this._exitValue)})),R(()=>this.tell(Jb((e,n)=>{e.removeObserver(t)})))},this.id())}get inheritAll(){return Dp((e,t)=>{let n=e.id(),r=e.getFiberRefs(),i=t.runtimeFlags,a=Q_(r,n,this.getFiberRefs());return e.setFiberRefs(a),gm(x(zf(i,e.getFiberRef(bw)),Wf(1),Wf(16)))})}get poll(){return R(()=>ci(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(e){return R(()=>this.tell(qb(lc(e))))}unsafeInterruptAsFork(e){this.tell(qb(lc(e)))}addObserver(e){this._exitValue===null?this._observers.push(e):e(this._exitValue)}removeObserver(e){this._observers=this._observers.filter(t=>t!==e)}getFiberRefs(){return this.setFiberRef(bw,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(e){this._fiberRefs=tv(this._fiberRefs,e)}getFiberRef(e){return this._fiberRefs.locals.has(e)?this._fiberRefs.locals.get(e)[0][1]:e.initial}setFiberRef(e,t){this._fiberRefs=iv(this._fiberRefs,{fiberId:this._fiberId,fiberRef:e,value:t}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(A_),this.currentTracer=this.currentDefaultServices.unsafeMap.get(C_.key),this.currentSupervisor=this.getFiberRef(xw),this.currentScheduler=this.getFiberRef(mb),this.currentContext=this.getFiberRef(Xm),this.currentSpan=this.currentContext.unsafeMap.get(w_.key)}setFiberRefs(e){this._fiberRefs=e,this.refreshRefCache()}addChild(e){this.getChildren().add(e)}removeChild(e){this.getChildren().delete(e)}transferChildren(e){let t=this._children;if(this._children=null,t!==null&&t.size>0)for(let n of t)n._exitValue===null&&e.add(this.currentRuntimeFlags,n)}drainQueueOnCurrentThread(){let e=!0;for(;e;){let t=AC,n=globalThis[sx];globalThis[sx]=this;try{for(;t===AC;)t=this._queue.length===0?jC:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[sx]=n}this._queue.length>0&&!this._running?(this._running=!0,t===MC?(this.drainQueueLaterOnExecutor(),e=!1):e=!0):e=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(Zm),this)}drainQueueWhileRunning(e,t){let n=t;for(;this._queue.length>0;){let t=this._queue.splice(0,1)[0];n=RC[t._tag](this,e,n,t)}return n}isInterrupted(){return!hc(this.getFiberRef(lh))}addInterruptedCause(e){let t=this.getFiberRef(lh);this.setFiberRef(lh,dc(t,e))}processNewInterruptSignal(e){this.addInterruptedCause(e),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let e=!1;for(let t of this._children)t.tell(qb(lc(this.id()))),e=!0;return e}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){let e=this._children.values();this._children=null;let t=!1;return vm({while:()=>!t,body:()=>{let n=e.next();return n.done?R(()=>{t=!0}):Ap(n.value.await)},step:()=>{}})}return null}reportExitValue(e){if(Lf(this.currentRuntimeFlags)){let t=this.getFiberRef(sh),n=this.id().startTimeMillis,r=Date.now();switch(kC.unsafeUpdate(r-n,t),EC.unsafeUpdate(-1,t),e._tag){case Jn:DC.unsafeUpdate(1,t);break;case Wn:OC.unsafeUpdate(1,t);break}}if(e._tag===`Failure`){let t=this.getFiberRef(ah);!_c(e.cause)&&t._tag===`Some`&&this.log(`Fiber terminated with an unhandled error`,e.cause,t)}}setExitValue(e){this._exitValue=e,this.reportExitValue(e);for(let t=this._observers.length-1;t>=0;t--)this._observers[t](e);this._observers=[]}getLoggers(){return this.getFiberRef(KC)}log(e,t,n){let r=ni(n)?n.value:this.getFiberRef(eh);if(Kv(this.getFiberRef(HC),r))return;let i=this.getFiberRef(th),a=this.getFiberRef($m),o=this.getLoggers(),s=this.getFiberRefs();if(Gs(o)>0){let n=Cl(this.getFiberRef(A_),wg),c=new Date(n.unsafeCurrentTimeMillis());Bn(s,()=>{for(let n of o)n.log({fiberId:this.id(),logLevel:r,message:e,cause:t,context:s,spans:i,annotations:a,date:c})})}}evaluateMessageWhileSuspended(e){switch(e._tag){case Kb:return MC;case Ub:return this.processNewInterruptSignal(e.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(Fh(e.cause)),this._asyncInterruptor=null),AC;case Gb:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(e.effect),AC;case Wb:return e.onFiber(this,this._exitValue===null?Iv(this.currentRuntimeFlags,this._asyncBlockingOn):Pv),AC;default:return PC(e)}}evaluateEffect(e){this.currentSupervisor.onResume(this);try{let t=Mf(this.currentRuntimeFlags)&&this.isInterrupted()?Fh(this.getInterruptedCause()):e;for(;t!==null;){let e=t,n=this.runLoop(e);if(n===FC){let e=IC.currentOp;IC.currentOp=null,e._op===`Yield`?Af(this.currentRuntimeFlags)?(this.tell(Xb()),this.tell(Yb(Uh)),t=null):t=Uh:e._op===`Async`&&(t=null)}else{this.currentRuntimeFlags=x(this.currentRuntimeFlags,jf(16));let e=this.interruptAllChildren();e===null?(this._queue.length===0?this.setExitValue(n):this.tell(Yb(n)),t=null):t=F(e,()=>n)}}}finally{this.currentSupervisor.onSuspend(this)}}start(e){if(this._running)this.tell(Yb(e));else{this._running=!0;let t=globalThis[sx];globalThis[sx]=this;try{this.evaluateEffect(e)}finally{this._running=!1,globalThis[sx]=t,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(e){this.tell(Yb(e))}patchRuntimeFlags(e,t){let n=Bf(e,t);return globalThis[sx]=this,this.currentRuntimeFlags=n,n}initiateAsync(e,t){let n=!1,r=e=>{n||(n=!0,this.tell(Yb(e)))};Mf(e)&&(this._asyncInterruptor=r);try{t(r)}catch(e){r(Wp(cc(e)))}}pushStack(e){this._stack.push(e),e._op===`OnStep`&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){let e=this._stack.pop();if(e)return e._op===`OnStep`&&this._steps.pop(),e}getNextSuccessCont(){let e=this.popStack();for(;e;){if(e._op!==`OnFailure`)return e;e=this.popStack()}}getNextFailCont(){let e=this.popStack();for(;e;){if(e._op!==`OnSuccess`&&e._op!==`While`&&e._op!==`Iterator`)return e;e=this.popStack()}}Tag(e){return R(()=>wl(this.currentContext,e))}Left(e){return Hp(e.left)}None(e){return Hp(new Th)}Right(e){return Hh(e.right)}Some(e){return Hh(e.value)}Micro(e){return Mp(t=>{let n=t,r=Yy(By(e,this.currentContext));return r.addObserver(e=>{if(e._tag===`Success`)return n(Hh(e.value));switch(e.cause._tag){case`Interrupt`:return n(Fh(lc(Ru)));case`Fail`:return n(Hp(e.cause.error));case`Die`:return n(Rp(e.cause.defect))}}),Mp(e=>{n=t=>{e(hm)},r.unsafeInterrupt()})})}[Yn](e){let t=mn(()=>e.effect_instruction_i0()),n=this.getNextSuccessCont();return n===void 0?(IC.currentOp=Hh(t),FC):(n._op in LC||PC(n),LC[n._op](this,n,t))}[Jn](e){let t=e,n=this.getNextSuccessCont();return n===void 0?(IC.currentOp=t,FC):(n._op in LC||PC(n),LC[n._op](this,n,t.effect_instruction_i0))}[Wn](e){let t=e.effect_instruction_i0,n=this.getNextFailCont();if(n!==void 0)switch(n._op){case Gn:case qn:return Mf(this.currentRuntimeFlags)&&this.isInterrupted()?Fh(Tc(t)):mn(()=>n.effect_instruction_i1(t));case`OnStep`:return Mf(this.currentRuntimeFlags)&&this.isInterrupted()?Fh(Tc(t)):Hh(Fh(t));case tr:return this.patchRuntimeFlags(this.currentRuntimeFlags,n.patch),Mf(this.currentRuntimeFlags)&&this.isInterrupted()?Fh(dc(t,this.getInterruptedCause())):Fh(t);default:PC(n)}else return IC.currentOp=Fh(t),FC}[$n](e){return mn(()=>e.effect_instruction_i0(this,Fv(this.currentRuntimeFlags)))}Blocked(e){let t=this.getFiberRefs(),n=this.currentRuntimeFlags;if(this._steps.length>0){let r=[],i=this._steps[this._steps.length-1],a=this.popStack();for(;a&&a._op!==`OnStep`;)r.push(a),a=this.popStack();this.setFiberRefs(i.refs),this.currentRuntimeFlags=i.flags;let o=vv(i.refs,t),s=zf(i.flags,n);return Hh(yp(e.effect_instruction_i0,Dp(t=>{for(;r.length>0;)t.pushStack(r.pop());return t.setFiberRefs(yv(t.id(),t.getFiberRefs())(o)),t.currentRuntimeFlags=Bf(s)(t.currentRuntimeFlags),e.effect_instruction_i1})))}return mm(t=>F(nw(bp(e.effect_instruction_i0)),()=>t(e.effect_instruction_i1)))}RunBlocked(e){return zC(e.effect_instruction_i0)}[Xn](e){let t=e.effect_instruction_i0,n=this.currentRuntimeFlags,r=Bf(n,t);if(Mf(r)&&this.isInterrupted())return Fh(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,t),e.effect_instruction_i1){let t=zf(r,n);return this.pushStack(new Sp(t,e)),mn(()=>e.effect_instruction_i1(n))}else return Uh}[Kn](e){return this.pushStack(e),e.effect_instruction_i0}OnStep(e){return this.pushStack(e),e.effect_instruction_i0}[Gn](e){return this.pushStack(e),e.effect_instruction_i0}[qn](e){return this.pushStack(e),e.effect_instruction_i0}[Hn](e){return this._asyncBlockingOn=e.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,e.effect_instruction_i0),IC.currentOp=e,FC}[er](e){return this._isYielding=!1,IC.currentOp=e,FC}[Zn](e){let t=e.effect_instruction_i0,n=e.effect_instruction_i1;return t()?(this.pushStack(e),n()):Uh}[Qn](e){return LC[Qn](this,e,void 0)}[Un](e){return mn(()=>e.commit())}runLoop(e){let t=e;for(this.currentOpCount=0;;){if(this.currentRuntimeFlags&2&&this.currentSupervisor.onEffect(this,t),this._queue.length>0&&(t=this.drainQueueWhileRunning(this.currentRuntimeFlags,t)),!this._isYielding){this.currentOpCount+=1;let e=this.currentScheduler.shouldYield(this);if(e!==!1){this._isYielding=!0,this.currentOpCount=0;let n=t;t=F(Sm({priority:e}),()=>n)}}try{if(t=this.currentTracer.context(()=>{if(BC!==t[xp]._V){let e=this.getFiberRef(oh);if(e._tag===`Some`){let n=t[xp]._V;this.log(`Executing an Effect versioned ${n} with a Runtime of version ${rr()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,oc,e)}}return this[t._op](t)},this),t===FC){let e=IC.currentOp;return e._op===`Yield`||e._op===`Async`?FC:(IC.currentOp=null,e._op===`Success`||e._op===`Failure`?e:Fh(cc(e)))}}catch(e){t=t!==FC&&!C(t,`_op`)||!(t._op in this)?zp(`Not a valid effect: ${Fn(t)}`):xh(e)?Fh(dc(cc(e),lc(Ru))):Rp(e)}}}run=()=>{this.drainQueueOnCurrentThread()}},HC=S(`effect/FiberRef/currentMinimumLogLevel`,()=>Wm(qv(`Info`))),UC=e=>ux(t=>{Cl(sv(t.context,A_),p_).unsafe.log(e.log(t))}),WC=S(Symbol.for(`effect/Logger/defaultLogger`),()=>UC(fx)),GC=S(Symbol.for(`effect/Logger/tracerLogger`),()=>ux(({annotations:e,cause:t,context:n,fiberId:r,logLevel:i,message:a})=>{let o=Bb(Tl(rv(n,Xm),w_));if(o._tag===`None`||o.value._tag===`ExternalSpan`)return;let s=wl(rv(n,A_),wg),c={};for(let[t,n]of e)c[t]=n;c[`effect.fiberId`]=Hu(r),c[`effect.logLevel`]=i.label,t!==null&&t._tag!==`Empty`&&(c[`effect.cause`]=Rc(t,{renderErrorCause:!0})),o.value.event(Fn(Array.isArray(a)&&a.length===1?a[0]:a),s.unsafeCurrentTimeNanos(),c)})),KC=S(Symbol.for(`effect/FiberRef/currentLoggers`),()=>Gm(Hs(WC,GC))),qC=(e,t,n)=>{let r=e.next();return r.done?I(!1):F(n(r.value,t),r=>r?I(r):qC(e,t+1,n))},JC=e=>{if(Array.isArray(e)||Jt(e))return[e,N()];let t=Object.keys(e),n=t.length;return[t.map(t=>e[t]),P(e=>{let r={};for(let i=0;i<n;i++)r[t[i]]=e[i];return r})]},YC=(e,t,n)=>{let r=[];for(let t of e)r.push(Bp(t));return F(QC(r,b,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),e=>{let r=N(),i=e.length,a=Array(i),o=Array(i),s=!1;for(let t=0;t<i;t++){let n=e[t];n._tag===`Left`?(a[t]=P(n.left),s=!0):(o[t]=n.right,a[t]=r)}return s?t._tag===`Some`?Hp(t.value(a)):Hp(a):n?.discard?hm:t._tag===`Some`?I(t.value(o)):I(o)})},XC=(e,t,n)=>{let r=[];for(let t of e)r.push(Bp(t));return n?.discard?QC(r,b,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):nm(QC(r,b,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),e=>t._tag===`Some`?t.value(e):e)},ZC=(e,t)=>{let[n,r]=JC(e);return t?.mode===`validate`?YC(n,r,t):t?.mode===`either`?XC(n,r,t):t?.discard!==!0&&r._tag===`Some`?nm(QC(n,b,t),r.value):QC(n,b,t)},QC=y(e=>Jt(e[0]),(e,t,n)=>Dp(r=>{let i=n?.batching===!0||n?.batching===`inherit`&&r.getFiberRef(ih);return n?.discard?gb(n.concurrency,()=>lw(W_,n?.concurrentFinalizers)(n=>i?ew(e,(e,r)=>n(t(e,r)),!0,!1,1):em(e,(e,r)=>n(t(e,r)))),()=>lw(G_,n?.concurrentFinalizers)(n=>ew(e,(e,r)=>n(t(e,r)),i,!1)),r=>lw(K_(r),n?.concurrentFinalizers)(n=>ew(e,(e,r)=>n(t(e,r)),i,!1,r))):gb(n?.concurrency,()=>lw(W_,n?.concurrentFinalizers)(n=>i?tw(e,1,(e,r)=>n(t(e,r)),!0):$p(e,(e,r)=>n(t(e,r)))),()=>lw(G_,n?.concurrentFinalizers)(n=>$C(e,(e,r)=>n(t(e,r)),i)),r=>lw(K_(r),n?.concurrentFinalizers)(n=>tw(e,r,(e,r)=>n(t(e,r)),i)))})),$C=(e,t,n)=>L(()=>{let r=Oi(e),i=Array(r.length);return Tm(ew(r,(e,n)=>F(t(e,n),e=>R(()=>i[n]=e)),n,!1),I(i))}),ew=(e,t,n,r,i)=>mm(a=>dm(o=>Dp(s=>{let c=Array.from(e).reverse(),l=c.length;if(l===0)return hm;let u=0,d=!1,f=i?Math.min(c.length,i):c.length,p=new Set,m=[],h=()=>p.forEach(e=>{e.currentScheduler.scheduleTask(()=>{e.unsafeInterruptAsFork(s.id())},0,e)}),g=[],_=[],v=[],ee=()=>{let e=m.filter(({exit:e})=>e._tag===`Failure`).sort((e,t)=>e.index<t.index?-1:e.index===t.index?0:1).map(({exit:e})=>e);return e.length===0&&e.push(Uh),e},te=(e,t=!1)=>{let n=pm(o(e)),r=iw(n,s,s.currentRuntimeFlags,tx);return s.currentScheduler.scheduleTask(()=>{t&&r.unsafeInterruptAsFork(s.id()),r.resume(n)},0,r),r},ne=()=>{r||(l-=c.length,c=[]),d=!0,h()},re=n?Jp:Vp,ie=te(Pp(e=>{let r=(e,t)=>{e._op===`Blocked`?v.push(e):(m.push({index:t,exit:e}),e._op===`Failure`&&!d&&ne())},o=()=>{if(c.length>0){let f=c.pop(),h=u++,ne=()=>{let e=c.pop();return h=u++,F(Sm(),()=>F(re(a(t(e,h))),ie))},ie=e=>c.length>0&&(r(e,h),c.length>0)?ne():I(e),ae=te(F(re(a(t(f,h))),ie));g.push(ae),p.add(ae),d&&ae.currentScheduler.scheduleTask(()=>{ae.unsafeInterruptAsFork(s.id())},0,ae),ae.addObserver(t=>{let a;if(a=t._op===`Failure`?t:t.effect_instruction_i0,_.push(ae),p.delete(ae),r(a,h),m.length===l)e(I(ai(Mh(ee(),{parallel:!0}),()=>Uh)));else if(v.length+m.length===l){let t=ee();e(I(yp(v.map(e=>e.effect_instruction_i0).reduce(Gf),ew([ai(Mh(t,{parallel:!0}),()=>Uh),...v.map(e=>e.effect_instruction_i1)],e=>e,n,!0,i))))}else o()})}};for(let e=0;e<f;e++)o()}));return Ap(am(Yp(a(ox(ie))),Bh({onFailure:e=>{ne();let t=v.length+1,n=Math.min(typeof i==`number`?i:v.length,v.length),r=Array.from(v);return Pp(i=>{let a=[],o=0,s=0,c=(n,s)=>c=>{a[n]=c,o++,o===t&&i(Hh(Fh(e))),r.length>0&&s&&l()},l=()=>{te(r.pop(),!0).addObserver(c(s,!0)),s++};ie.addObserver(c(s,!1)),s++;for(let e=0;e<n;e++)l()})},onSuccess:()=>$p(_,e=>e.inheritAll)})))}))),tw=(e,t,n,r)=>L(()=>{let i=Oi(e),a=Array(i.length);return Tm(ew(i,(e,t)=>nm(n(e,t),e=>a[t]=e),r,!1,t),I(a))}),nw=e=>ow(e,tx),rw=(e,t,n,r=null)=>{let i=aw(e,t,n,r);return i.resume(e),i},iw=(e,t,n,r=null)=>aw(e,t,n,r),aw=(e,t,n,r=null)=>{let i=Uu(),a=$_(t.getFiberRefs(),i),o=new VC(i,a,n),s=rv(a,Xm),c=o.currentSupervisor;return c.onStart(s,e,P(t),o),o.addObserver(e=>c.onEnd(e,o)),(r===null?x(t.getFiberRef(ch),ai(()=>t.scope())):r).add(n,o),o},ow=(e,t)=>Dp((n,r)=>I(rw(e,n,r.runtimeFlags,t))),sw=e=>rg(t=>ri(Tl(t,pw),{onNone:()=>e,onSome:t=>{switch(t.strategy._tag){case`Parallel`:return e;case`Sequential`:case`ParallelN`:return F(hh(t,G_),t=>vw(e,t))}}})),cw=e=>t=>rg(n=>ri(Tl(n,pw),{onNone:()=>t,onSome:n=>n.strategy._tag===`ParallelN`&&n.strategy.parallelism===e?t:F(hh(n,K_(e)),e=>vw(t,e))})),lw=(e,t)=>n=>rg(r=>ri(Tl(r,pw),{onNone:()=>n(b),onSome:r=>{if(t===!0){let t=e._tag===`Parallel`?sw:e._tag===`Sequential`?dw:cw(e.parallelism);switch(r.strategy._tag){case`Parallel`:return t(n(sw));case`Sequential`:return t(n(dw));case`ParallelN`:return t(n(cw(r.strategy.parallelism)))}}else return n(b)}})),uw=e=>F(pw,e),dw=e=>rg(t=>ri(Tl(t,pw),{onNone:()=>e,onSome:t=>{switch(t.strategy._tag){case`Sequential`:return e;case`Parallel`:case`ParallelN`:return F(hh(t,W_),t=>vw(e,t))}}})),fw=y(e=>Ep(e[1]),(e,t,n,r)=>nm(ZC([e,t],{concurrency:r?.concurrent?2:1,batching:r?.batching,concurrentFinalizers:r?.concurrentFinalizers}),([e,t])=>n(e,t))),pw=yl(`effect/Scope`),mw=(e,t)=>{e.state._tag===`Open`&&e.state.finalizers.set({},t)},hw={[uh]:uh,[dh]:dh,pipe(){return A(this,arguments)},fork(e){return R(()=>{let t=gw(e);if(this.state._tag===`Closed`)return t.state=this.state,t;let n={};return this.state.finalizers.set(n,e=>t.close(e)),mw(t,e=>R(()=>{this.state._tag===`Open`&&this.state.finalizers.delete(n)})),t})},close(e){return L(()=>{if(this.state._tag===`Closed`)return hm;let t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:`Closed`,exit:e},t.length===0?hm:H_(this.strategy)?x($p(t,t=>Vp(t(e))),F(e=>x(Mh(e),pi(jh),ai(()=>Uh)))):U_(this.strategy)?x($C(t,t=>Vp(t(e)),!1),F(e=>x(Mh(e,{parallel:!0}),pi(jh),ai(()=>Uh)))):x(tw(t,this.strategy.parallelism,t=>Vp(t(e)),!1),F(e=>x(Mh(e,{parallel:!0}),pi(jh),ai(()=>Uh))))})},addFinalizer(e){return L(()=>this.state._tag===`Closed`?e(this.state.exit):(this.state.finalizers.set({},e),hm))}},gw=(e=z_)=>{let t=Object.create(hw);return t.strategy=e,t.state={_tag:`Open`,finalizers:new Map},t},_w=(e=z_)=>R(()=>gw(e)),vw=y(2,(e,t)=>ag(e,El(xl(pw,t)))),yw=e=>Jm(e,{differ:wC,fork:vC}),bw=Ym(If),xw=yw(fC),Sw=y(2,(e,t)=>mm(n=>Zp(n(e),{onFailure:e=>Zp(t,{onFailure:t=>Wp(dc(e,t)),onSuccess:()=>Wp(e)}),onSuccess:e=>kp(t,e)}))),Cw=(e,t,n)=>qp(r=>F(F(nw(tm(e)),e=>Pp(r=>{let i=t.map(e=>e.listeners.count),a=()=>{i.every(e=>e===0)&&t.every(e=>e.result.state.current._tag===`Pending`?!0:!!(e.result.state.current._tag===`Done`&&Oh(e.result.state.current.effect)&&e.result.state.current.effect._tag===`Failure`&&gc(e.result.state.current.effect.cause)))&&(o.forEach(e=>e()),n?.(),r(Dm(e)))};e.addObserver(e=>{o.forEach(e=>e()),r(e)});let o=t.map((e,t)=>{let n=e=>{i[t]=e,a()};return e.listeners.addObserver(n),()=>e.listeners.removeObserver(n)});return a(),R(()=>{o.forEach(e=>e())})})),()=>L(()=>em(t.flatMap(e=>e.state.completed?[]:[e]),e=>iC(e.request,Rh(r)))))),ww=Symbol.for(`effect/ScheduleInterval`),Tw={[ww]:ww,startMillis:0,endMillis:0},Ew=e=>x(e.intervals,go,ai(()=>Tw)).startMillis,Dw=e=>x(e.intervals,go,ai(()=>Tw)).endMillis,Ow=y(2,(e,t)=>Ew(e)<Ew(t)),kw=e=>ho(e.intervals),Aw=Dw,jw=Ow,Mw=kw,Nw=`Continue`,Pw=`Done`,Fw=e=>({_tag:Nw,intervals:e}),Iw={_tag:Pw},Lw=e=>e._tag===Pw,Rw=Fw,zw=Iw,Bw=Lw,Vw=mh,Hw=hh,Uw=class{permits;waiters=new Set;taken=0;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take=e=>Np(t=>{if(this.free<e){let n=()=>{this.free<e||(this.waiters.delete(n),t(L(()=>this.free<e?this.take(e):(this.taken+=e,I(e)))))};return this.waiters.add(n),R(()=>{this.waiters.delete(n)})}t(L(()=>this.free<e?this.take(e):(this.taken+=e,I(e))))});updateTakenUnsafe(e,t){return this.taken=t(this.taken),this.waiters.size>0&&e.getFiberRef(mb).scheduleTask(()=>{let e=this.waiters.values(),t=e.next();for(;t.done===!1&&this.free>0;)t.value(),t=e.next()},e.getFiberRef(Zm),e),I(this.free)}updateTaken(e){return Dp(t=>this.updateTakenUnsafe(t,e))}resize=e=>Ap(Dp(t=>(this.permits=e,this.free<0?hm:this.updateTakenUnsafe(t,e=>e))));release=e=>this.updateTaken(t=>t-e);releaseAll=this.updateTaken(e=>0);withPermits=e=>t=>mm(n=>F(n(this.take(e)),e=>Sw(n(t),this.release(e))));withPermitsIfAvailable=e=>t=>mm(n=>L(()=>this.free<e?Lb:(this.taken+=e,Sw(n(wb(t)),this.release(e)))))},Ww=e=>new Uw(e),Gw=Symbol.for(`effect/Ref/SynchronizedRef`),Kw={_A:e=>e},qw=class extends F_{ref;withLock;[Gw]=Kw;[eb]=tb;[$y]=$y;constructor(e,t){super(),this.ref=e,this.withLock=t,this.get=ab(this.ref)}get;commit(){return this.get}modify(e){return this.modifyEffect(t=>I(e(t)))}modifyEffect(e){return this.withLock(x(F(ab(this.ref),e),F(([e,t])=>kp(ob(this.ref,t),e))))}},Jw=e=>R(()=>Yw(e)),Yw=e=>new qw(rb(e),Ww(1).withPermits(1)),Xw=`Fresh`,Zw=Om,Qw=e=>function(){if(arguments.length===1){let t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},$w=Qw((e,t,n)=>{let r=Uu(),i=[[Xm,[[r,e.context]]]];n?.scheduler&&i.push([mb,[[r,n.scheduler]]]);let a=cv(e.fiberRefs,{entries:i,forkAs:r});n?.updateRefs&&(a=n.updateRefs(a,r));let o=new VC(r,a,e.runtimeFlags),s=t;n?.scope&&(s=F(Hw(n.scope,z_),e=>Tm(fh(e,qp(e=>O(e,o.id())?hm:Om(o,e))),am(t,t=>Vw(e,t)))));let c=o.currentSupervisor;return c!==fC&&(c.onStart(e.context,s,N(),o),o.addObserver(e=>c.onEnd(e,o))),tx.add(e.runtimeFlags,o),n?.immediate===!1?o.resume(s):o.start(s),o}),eT=Qw((e,t,n={})=>{let r=$w(e,t,n);return n.onExit&&r.addObserver(e=>{n.onExit(e)}),(t,n)=>eT(e)(x(r,Zw(t??Ru)),{...n,onExit:n?.onExit?e=>n.onExit(Hb(e)):void 0})}),tT=Qw((e,t)=>{let n=lT(e)(t);if(n._tag===`Failure`)throw sT(n.effect_instruction_i0);return n.effect_instruction_i0}),nT=class extends Error{fiber;_tag=`AsyncFiberException`;constructor(e){super(`Fiber #${e.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`),this.fiber=e,this.name=this._tag,this.stack=this.message}},rT=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let n=new nT(e);return Error.stackTraceLimit=t,n},iT=Symbol.for(`effect/Runtime/FiberFailure`),aT=Symbol.for(`effect/Runtime/FiberFailure/Cause`),oT=class extends Error{[iT];[aT];constructor(e){let t=Kc(e)[0];super(t?.message||`An error has occurred`),this[iT]=iT,this[aT]=e,this.name=t?`(FiberFailure) ${t.name}`:`FiberFailure`,t?.stack&&(this.stack=t.stack)}toJSON(){return{_id:`FiberFailure`,cause:this[aT].toJSON()}}toString(){return`(FiberFailure) `+Rc(this[aT],{renderErrorCause:!0})}[k](){return this.toString()}},sT=e=>{let t=Error.stackTraceLimit;Error.stackTraceLimit=0;let n=new oT(e);return Error.stackTraceLimit=t,n},cT=e=>{let t=e;switch(t._op){case`Failure`:case`Success`:return t;case`Left`:return Ph(t.left);case`Right`:return Hh(t.right);case`Some`:return Hh(t.value);case`None`:return Ph(new Th)}},lT=Qw((e,t)=>{let n=cT(t);if(n)return n;let r=new pb,i=$w(e)(t,{scheduler:r});return r.flush(),i.unsafePoll()||Nh(Lp(rT(i),og(i)))}),uT=class{context;runtimeFlags;fiberRefs;constructor(e,t,n){this.context=e,this.runtimeFlags=t,this.fiberRefs=n}pipe(){return A(this,arguments)}},dT=(e=>new uT(e.context,e.runtimeFlags,e.fiberRefs))({context:bl(),runtimeFlags:Ff(1,32,4),fiberRefs:lv()}),fT=$w(dT),pT=tT(dT),mT=y(2,(e,t)=>e.modifyEffect(t)),hT=Symbol.for(`effect/Layer/MemoMap`),gT=kl()(`effect/Layer/CurrentMemoMap`,{defaultValue:()=>bT()}),_T=e=>e._op_layer===Xw,vT=class{ref;[hT];constructor(e){this.ref=e,this[hT]=hT}getOrElseMemoize(e,t){return x(mT(this.ref,n=>{let r=n.get(e);if(r!==void 0){let[e,i]=r;return I([x(e,F(([e,t])=>x(Nb(e),kp(t))),am(Bh({onFailure:()=>hm,onSuccess:()=>ph(t,i)}))),n])}return x(ib(0),F(r=>x(qh(),F(i=>x(ib(()=>hm),nm(a=>{let o=mm(o=>x(_w(),F(s=>x(o(F(CT(e,s,!0),e=>Tb(e(this)))),Vp,F(o=>{switch(o._tag){case Wn:return x(Zh(i,o.effect_instruction_i0),Tm(mh(s,o)),Tm(Wp(o.effect_instruction_i0)));case Jn:return x(ob(a,e=>x(mh(s,e),_m(sb(r,e=>[e===1,e-1])),Ap)),Tm(cb(r,e=>e+1)),Tm(ph(t,t=>x(R(()=>n.delete(e)),Tm(ab(a)),F(e=>e(t))))),Tm(Qh(i,o.effect_instruction_i0)),kp(o.effect_instruction_i0[1]))}}))))),s=[x(Yh(i),am(Vh({onFailure:()=>hm,onSuccess:()=>cb(r,e=>e+1)}))),e=>x(ab(a),F(t=>t(e)))];return[o,_T(e)?n:n.set(e,s)]}))))))}),Yp)}},yT=L(()=>nm(Jw(new Map),e=>new vT(e))),bT=()=>new vT(Yw(new Map)),xT=y(2,(e,t)=>F(yT,n=>ST(e,n,t))),ST=y(3,(e,t,n)=>F(CT(e,n),e=>Pb(e(t),gT,t))),CT=(e,t,n=!1)=>{let r=e;switch(r._op_layer){case`Locally`:return R(()=>e=>r.f(e.getOrElseMemoize(r.self,t)));case`ExtendScope`:return R(()=>e=>uw(t=>e.getOrElseMemoize(r.layer,t)));case`Fold`:return R(()=>e=>x(e.getOrElseMemoize(r.layer,t),Zp({onFailure:n=>e.getOrElseMemoize(r.failureK(n),t),onSuccess:n=>e.getOrElseMemoize(r.successK(n),t)})));case`Fresh`:return R(()=>e=>x(r.layer,xT(t)));case`FromEffect`:return R(n?()=>e=>r.effect:()=>n=>n.getOrElseMemoize(e,t));case`Provide`:return R(()=>e=>x(e.getOrElseMemoize(r.first,t),F(n=>x(e.getOrElseMemoize(r.second,t),ig(n)))));case`Scoped`:return R(n?()=>e=>vw(r.effect,t):()=>n=>n.getOrElseMemoize(e,t));case`Suspend`:return R(()=>e=>e.getOrElseMemoize(r.evaluate(),t));case`ProvideMerge`:return R(()=>e=>x(e.getOrElseMemoize(r.first,t),Em(e.getOrElseMemoize(r.second,t),r.zipK)));case`ZipWith`:return bm(function*(){let e=yield*hh(t,B_),n=yield*hh(e,z_),i=yield*hh(e,z_);return e=>x(e.getOrElseMemoize(r.first,n),fw(e.getOrElseMemoize(r.second,i),r.zipK,{concurrent:!0}))});case`MergeAll`:{let e=r.layers;return nm(hh(t,B_),t=>n=>{let r=Array(e.length);return nm(ew(e,xm(function*(e,i){let a=yield*hh(t,z_);r[i]=yield*n.getOrElseMemoize(e,a)}),!1,!1),()=>Dl(...r))})}}},wT=Symbol.for(`effect/DateTime`),TT=Symbol.for(`effect/DateTime/TimeZone`),ET={[wT]:wT,pipe(){return A(this,arguments)},[k](){return this.toString()},toJSON(){return aE(this).toJSON()}},DT={...ET,_tag:`Utc`,[w](){return wn(this,yn(this.epochMillis))},[D](e){return NT(e)&&e._tag===`Utc`&&this.epochMillis===e.epochMillis},toString(){return`DateTime.Utc(${aE(this).toJSON()})`}},OT={...ET,_tag:`Zoned`,[w](){return x(yn(this.epochMillis),E(T(this.zone)),wn(this))},[D](e){return NT(e)&&e._tag===`Zoned`&&this.epochMillis===e.epochMillis&&O(this.zone,e.zone)},toString(){return`DateTime.Zoned(${yE(this)})`}},kT={[TT]:TT,[k](){return this.toString()}},AT={...kT,_tag:`Named`,[w](){return wn(this,bn(`Named:${this.id}`))},[D](e){return PT(e)&&e._tag===`Named`&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:`TimeZone`,_tag:`Named`,id:this.id}}},jT={...kT,_tag:`Offset`,[w](){return wn(this,bn(`Offset:${this.offset}`))},[D](e){return PT(e)&&e._tag===`Offset`&&this.offset===e.offset},toString(){return`TimeZone.Offset(${cE(this.offset)})`},toJSON(){return{_id:`TimeZone`,_tag:`Offset`,offset:this.offset}}},MT=(e,t,n)=>{let r=Object.create(OT);return r.epochMillis=e,r.zone=t,Object.defineProperty(r,`partsUtc`,{value:n,enumerable:!1,writable:!0}),Object.defineProperty(r,`adjustedEpochMillis`,{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(r,`partsAdjusted`,{value:void 0,enumerable:!1,writable:!0}),r},NT=e=>C(e,wT),PT=e=>C(e,TT),FT=e=>PT(e)&&e._tag===`Offset`,IT=e=>PT(e)&&e._tag===`Named`,LT=e=>e._tag===`Utc`,RT=e=>e._tag===`Zoned`,zT=wt((e,t)=>e.epochMillis===t.epochMillis),BT=e=>{let t=Object.create(DT);return t.epochMillis=e,Object.defineProperty(t,`partsUtc`,{value:void 0,enumerable:!1,writable:!0}),t},VT=e=>{let t=e.getTime();if(Number.isNaN(t))throw new cg(`Invalid date`);return BT(t)},HT=e=>{if(NT(e))return e;if(e instanceof Date)return VT(e);if(typeof e==`object`){let t=new Date(0);return dE(t,e),VT(t)}else if(typeof e==`string`&&!UT(e))return VT(new Date(e+`Z`));return VT(new Date(e))},UT=e=>/Z|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e),WT=-86399999568e5,GT=864e13-840*60*1e3,KT=(e,t)=>{if(t?.timeZone===void 0&&NT(e)&&RT(e))return e;let n=HT(e);if(n.epochMillis<WT||n.epochMillis>GT)throw RangeError(`Epoch millis out of range: ${n.epochMillis}`);let r;if(t?.timeZone===void 0)r=eE(new Date(n.epochMillis).getTimezoneOffset()*-60*1e3);else if(PT(t?.timeZone))r=t.timeZone;else if(typeof t?.timeZone==`number`)r=eE(t.timeZone);else{let e=rE(t.timeZone);if(ti(e))throw new cg(`Invalid time zone: ${t.timeZone}`);r=e.value}return t?.adjustForTimeZone===!0?pE(n.epochMillis,r,t?.disambiguation??`compatible`):MT(n.epochMillis,r,n.partsUtc)},qT=ui(KT),JT=/^(.{17,35})\[(.+)\]$/,YT=e=>{let t=JT.exec(e);if(t===null){let t=hE(e);return t===null?N():qT(e,{timeZone:t})}let[,n,r]=t;return qT(n,{timeZone:r})},XT=S(`effect/DateTime/validZoneCache`,()=>new Map),ZT={day:`numeric`,month:`numeric`,year:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`longOffset`,fractionalSecondDigits:3,hourCycle:`h23`},QT=e=>{let t=e.resolvedOptions().timeZone;if(XT.has(t))return XT.get(t);let n=Object.create(AT);return n.id=t,n.format=e,XT.set(t,n),n},$T=e=>{if(XT.has(e))return XT.get(e);try{return QT(new Intl.DateTimeFormat(`en-US`,{...ZT,timeZone:e}))}catch{throw new cg(`Invalid time zone: ${e}`)}},eE=e=>{let t=Object.create(jT);return t.offset=e,t},tE=ui($T),nE=/^(?:GMT|[+-])/,rE=e=>{if(nE.test(e)){let t=hE(e);return t===null?N():P(eE(t))}return tE(e)},iE=e=>e._tag===`Offset`?cE(e.offset):e.id,aE=e=>new Date(e.epochMillis),oE=e=>{if(e._tag===`Utc`)return new Date(e.epochMillis);if(e.zone._tag===`Offset`)return new Date(e.epochMillis+e.zone.offset);if(e.adjustedEpochMillis!==void 0)return new Date(e.adjustedEpochMillis);let t=e.zone.format.formatToParts(e.epochMillis).filter(e=>e.type!==`literal`),n=new Date(0);return n.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),n.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),Number(t[6].value)),e.adjustedEpochMillis=n.getTime(),n},sE=e=>oE(e).getTime()-uE(e),cE=e=>{let t=Math.abs(e),n=Math.floor(t/(3600*1e3)),r=Math.round(t%(3600*1e3)/(60*1e3));return r===60&&(n+=1,r=0),`${e<0?`-`:`+`}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},lE=e=>cE(sE(e)),uE=e=>e.epochMillis,dE=(e,t)=>{if(t.year!==void 0&&e.setUTCFullYear(t.year),t.month!==void 0&&e.setUTCMonth(t.month-1),t.day!==void 0&&e.setUTCDate(t.day),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hours!==void 0&&e.setUTCHours(t.hours),t.minutes!==void 0&&e.setUTCMinutes(t.minutes),t.seconds!==void 0&&e.setUTCSeconds(t.seconds),t.millis!==void 0&&e.setUTCMilliseconds(t.millis)},fE=1440*60*1e3,pE=(e,t,n)=>{if(t._tag===`Offset`)return MT(e-t.offset,t);let r=gE(e-fE,e,t),i=gE(e+fE,e,t);if(r===i)return MT(e-r,t);let a=r<i,o=r-i;if(a){if(gE(e-i,e,t)===i)return MT(e-i,t);let a=MT(e-r,t);if(e!==oE(a).getTime())switch(n){case`reject`:{let n=new Date(e).toISOString();throw RangeError(`Gap time: ${n} does not exist in time zone ${t.id}`)}case`earlier`:return MT(e-i,t);case`compatible`:case`later`:return a}return a}if(gE(e-r,e,t)===r){if(n===`earlier`||n===`compatible`||gE(e-r+o,e+o,t)===r)return MT(e-r,t);if(n===`reject`){let n=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${n} occurs twice in time zone ${t.id}`)}}return MT(e-i,t)},mE=/([+-])(\d{2}):(\d{2})$/,hE=e=>{let t=mE.exec(e);if(t===null)return null;let[,n,r,i]=t;return(n===`+`?1:-1)*(Number(r)*60+Number(i))*60*1e3},gE=(e,t,n)=>{let r=n.format.formatToParts(e).find(e=>e.type===`timeZoneName`)?.value??``;if(r===`GMT`)return 0;let i=hE(r);return i===null?sE(MT(t,n)):i},_E=e=>aE(e).toISOString(),vE=e=>{let t=oE(e);return e._tag===`Utc`?t.toISOString():`${t.toISOString().slice(0,-1)}${lE(e)}`},yE=e=>e.zone._tag===`Offset`?vE(e):`${vE(e)}[${e.zone.id}]`,bE=e=>e.toUpperCase(),xE=e=>e.toLowerCase(),SE=e=>e.length===0?e:bE(e[0])+e.slice(1),CE=e=>e.length===0?e:xE(e[0])+e.slice(1),wE=e=>e.length>0,TE=(e,t,n,r,i,a,o,s,c,l)=>{let u=l(a,c);return Mw(u)?I([[r,o],[i,s],Rw(u)]):x(a,jw(c))?F(e.step(Aw(a),n,r),([r,i,a])=>Bw(a)?I([[r,o],[i,s],zw]):TE(e,t,n,r,i,a.intervals,o,s,c,l)):F(t.step(Aw(c),n,o),([o,s,c])=>Bw(c)?I([[r,o],[i,s],zw]):TE(e,t,n,r,i,a,o,s,c.intervals,l))},EE=(e,t,n,r)=>Qp(t.next(r),{onFailure:()=>cm(t.last),onSuccess:r=>Qp(e,{onFailure:e=>n(e,P(r)),onSuccess:r=>EE(e,t,n,r)})}),DE=(e,t,n)=>Fp(e,r=>Qp(t.next(r),{onFailure:()=>x(t.last,cm,F(e=>n(r,e))),onSuccess:()=>DE(e,t,n)})),OE=(e,t,n)=>Qp(n.next(t),{onFailure:()=>cm(n.last),onSuccess:()=>F(e,t=>OE(e,t,n))}),kE=Ep,AE=QC,jE=L,ME=hm,NE=Fp,PE=nm,FE=rm,IE=im,LE=Bp,RE=F,zE=fT,BE=pT,VE=NT,HE=FT,UE=IT,WE=LT,GE=RT,KE=zT,qE=VT,JE=HT,YE=KT,XE=YT,ZE=$T,QE=eE,$E=rE,eD=iE,tD=aE,nD=uE;Ol(`effect/DateTime/CurrentTimeZone`)();var rD=_E,iD=yE,aD=(e,t)=>{switch(t._tag){case`StringKeyword`:case`TemplateLiteral`:return Object.keys(e);case`SymbolKeyword`:return Object.getOwnPropertySymbols(e);case`Refinement`:return aD(e,t.from)}},oD=e=>{let t=!1,n;return()=>t?n:(n=e(),t=!0,n)},sD=e=>Array.isArray(e),cD=e=>!Array.isArray(e),lD=e=>`[${Mn(e)}]`,uD=e=>sD(e)?e.map(lD).join(``):lD(e),dD=(e,t,n,r)=>{let i=e;return n&&Li(n)&&(i+=`\nat path: ${uD(n)}`),t!==void 0&&(i+=`\ndetails: ${t}`),r&&(i+=`\nschema (${r._tag}): ${r}`),i},fD=e=>dD(`Invalid Argument`,e),pD=(e,t,n)=>dD(`Missing annotation`,e,t,n),mD=(e,t)=>pD(`Generating a JSON Schema for this schema requires a "jsonSchema" annotation`,e,t),hD=(e,t)=>pD(`Generating a JSON Schema for this schema requires an "identifier" annotation`,e,t),gD=e=>dD(`Generating a JSON Schema for post-rest elements is not currently supported. You're welcome to contribute by submitting a Pull Request`,void 0,e),_D=(e,t)=>dD(`Unsupported key`,`Cannot encode ${Mn(e)} key to JSON Schema`,t),vD=e=>dD(`Unsupported key schema`,void 0,void 0,e),yD=e=>dD(`Unsupported literal`,`literal value: ${Nn(e)}`),bD=e=>dD(`Duplicate index signature`,`${e} index signature`),xD=dD(`Unsupported index signature parameter`,"An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),SD=dD(`Invalid element`,`A required element cannot follow an optional element. ts(1257)`),CD=e=>dD(`Duplicate property signature transformation`,`Duplicate key ${Nn(e)}`),wD=e=>dD(`Duplicate property signature`,`Duplicate key ${Nn(e)}`),TD=Symbol.for(`effect/SchemaId/DateFromSelf`),ED=Symbol.for(`effect/SchemaId/GreaterThan`),DD=Symbol.for(`effect/SchemaId/GreaterThanOrEqualTo`),OD=Symbol.for(`effect/SchemaId/LessThan`),kD=Symbol.for(`effect/SchemaId/LessThanOrEqualTo`),AD=Symbol.for(`effect/SchemaId/Int`),jD=Symbol.for(`effect/SchemaId/NonNaN`),MD=Symbol.for(`effect/SchemaId/Finite`),ND=Symbol.for(`effect/SchemaId/JsonNumber`),PD=Symbol.for(`effect/SchemaId/Between`),FD=Symbol.for(`effect/SchemaId/GreaterThanOrEqualToBigint`),ID=Symbol.for(`effect/SchemaId/BetweenBigint`),LD=Symbol.for(`effect/SchemaId/MinLength`),RD=Symbol.for(`effect/SchemaId/MaxLength`),zD=Symbol.for(`effect/SchemaId/Length`),BD=Symbol.for(`effect/SchemaId/MinItems`),VD=Symbol.for(`effect/SchemaId/MaxItems`),HD=Symbol.for(`effect/annotation/TypeConstructor`),UD=Symbol.for(`effect/annotation/Brand`),WD=Symbol.for(`effect/annotation/SchemaId`),GD=Symbol.for(`effect/annotation/Message`),KD=Symbol.for(`effect/annotation/MissingMessage`),qD=Symbol.for(`effect/annotation/Identifier`),JD=Symbol.for(`effect/annotation/Title`),YD=Symbol.for(`effect/annotation/AutoTitle`),XD=Symbol.for(`effect/annotation/Description`),ZD=Symbol.for(`effect/annotation/Examples`),QD=Symbol.for(`effect/annotation/Default`),$D=Symbol.for(`effect/annotation/JSONSchema`),eO=Symbol.for(`effect/annotation/Arbitrary`),tO=Symbol.for(`effect/annotation/Pretty`),nO=Symbol.for(`effect/annotation/Equivalence`),rO=Symbol.for(`effect/annotation/Documentation`),iO=Symbol.for(`effect/annotation/Concurrency`),aO=Symbol.for(`effect/annotation/Batching`),oO=Symbol.for(`effect/annotation/ParseIssueTitle`),sO=Symbol.for(`effect/annotation/ParseOptions`),cO=Symbol.for(`effect/annotation/DecodingFallback`),lO=Symbol.for(`effect/annotation/Surrogate`),uO=Symbol.for(`effect/annotation/StableFilter`),dO=y(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?P(e.annotations[t]):N()),fO=dO(UD),pO=dO(GD),mO=dO(KD),hO=dO(JD),gO=dO(YD),_O=dO(qD),vO=dO(XD),yO=dO(ZD),bO=dO(QD),xO=dO($D),SO=dO(iO),CO=dO(aO),wO=dO(oO),TO=dO(sO),EO=dO(cO),DO=dO(lO),OO=dO(uO),kO=e=>bi(OO(e),e=>e===!0),AO=Symbol.for(`effect/annotation/JSONIdentifier`),jO=dO(AO),MO=e=>oi(jO(e),()=>_O(e)),NO=Symbol.for(`effect/schema/ParseJson`),PO=class{typeParameters;decodeUnknown;encodeUnknown;annotations;_tag=`Declaration`;constructor(e,t,n,r={}){this.typeParameters=e,this.decodeUnknown=t,this.encodeUnknown=n,this.annotations=r}toString(){return ai(Zk(this),()=>`<declaration schema>`)}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(e=>e.toJSON()),annotations:Kk(this.annotations)}}},FO=e=>t=>t._tag===e,IO=FO(`Declaration`),LO=class{literal;annotations;_tag=`Literal`;constructor(e,t={}){this.literal=e,this.annotations=t}toString(){return ai(Zk(this),()=>Nn(this.literal))}toJSON(){return{_tag:this._tag,literal:It(this.literal)?String(this.literal):this.literal,annotations:Kk(this.annotations)}}},RO=FO(`Literal`),zO=new LO(null),BO=class{symbol;annotations;_tag=`UniqueSymbol`;constructor(e,t={}){this.symbol=e,this.annotations=t}toString(){return ai(Zk(this),()=>Nn(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:Kk(this.annotations)}}},VO=new class{annotations;_tag=`UndefinedKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`undefined`}),HO=new class{annotations;_tag=`NeverKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`never`}),UO=FO(`NeverKeyword`),WO=new class{annotations;_tag=`UnknownKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`unknown`}),GO=new class{annotations;_tag=`AnyKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`any`}),KO=new class{annotations;_tag=`StringKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`string`,[XD]:`a string`}),qO=FO(`StringKeyword`),JO=new class{annotations;_tag=`NumberKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`number`,[XD]:`a number`}),YO=new class{annotations;_tag=`BooleanKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`boolean`,[XD]:`a boolean`}),XO=new class{annotations;_tag=`BigIntKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`bigint`,[XD]:`a bigint`}),ZO=new class{annotations;_tag=`SymbolKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`symbol`,[XD]:`a symbol`}),QO=FO(`SymbolKeyword`),$O=new class{annotations;_tag=`ObjectKeyword`;constructor(e={}){this.annotations=e}toString(){return Jk(this)}toJSON(){return{_tag:this._tag,annotations:Kk(this.annotations)}}}({[JD]:`object`,[XD]:"an object in the TypeScript meaning, i.e. the `object` type"}),ek=class{type;annotations;constructor(e,t={}){this.type=e,this.annotations=t}toJSON(){return{type:this.type.toJSON(),annotations:Kk(this.annotations)}}toString(){return String(this.type)}},tk=class extends ek{isOptional;constructor(e,t,n={}){super(e,n),this.isOptional=t}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:Kk(this.annotations)}}toString(){return String(this.type)+(this.isOptional?`?`:``)}},nk=e=>e.map(e=>e.type),rk=class{elements;rest;isReadonly;annotations;_tag=`TupleType`;constructor(e,t,n,r={}){this.elements=e,this.rest=t,this.isReadonly=n,this.annotations=r;let i=!1,a=!1;for(let t of e)if(t.isOptional)i=!0;else if(i){a=!0;break}if(a||i&&t.length>1)throw Error(SD)}toString(){return ai(Zk(this),()=>ik(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(e=>e.toJSON()),rest:this.rest.map(e=>e.toJSON()),isReadonly:this.isReadonly,annotations:Kk(this.annotations)}}},ik=e=>{let t=e.elements.map(String).join(`, `);return Ai(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{let i=String(n),a=i.includes(` | `)?`(${i})`:i;if(r.length>0){let n=r.map(String).join(`, `);return e.elements.length>0?`readonly [${t}, ...${a}[], ${n}]`:`readonly [...${a}[], ${n}]`}else if(e.elements.length>0)return`readonly [${t}, ...${a}[]]`;else return`ReadonlyArray<${i}>`}})},ak=class extends tk{name;isReadonly;constructor(e,t,n,r,i){super(t,n,i),this.name=e,this.isReadonly=r}toString(){return(this.isReadonly?`readonly `:``)+String(this.name)+(this.isOptional?`?`:``)+`: `+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:Kk(this.annotations)}}},ok=e=>{switch(e._tag){case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:return!0;case`Refinement`:return ok(e.from)}return!1},sk=class{type;isReadonly;parameter;constructor(e,t,n){if(this.type=t,this.isReadonly=n,ok(e))this.parameter=e;else throw Error(xD)}toString(){return(this.isReadonly?`readonly `:``)+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}},ck=class{annotations;_tag=`TypeLiteral`;propertySignatures;indexSignatures;constructor(e,t,n={}){this.annotations=n;let r={};for(let t=0;t<e.length;t++){let n=e[t].name;if(Object.prototype.hasOwnProperty.call(r,n))throw Error(wD(n));r[n]=null}let i={string:!1,symbol:!1};for(let e=0;e<t.length;e++){let n=qk(t[e].parameter);if(qO(n)){if(i.string)throw Error(bD(`string`));i.string=!0}else if(QO(n)){if(i.symbol)throw Error(bD(`symbol`));i.symbol=!0}}this.propertySignatures=e,this.indexSignatures=t}toString(){return ai(Zk(this),()=>uk(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(e=>e.toJSON()),indexSignatures:this.indexSignatures.map(e=>e.toJSON()),annotations:Kk(this.annotations)}}},lk=e=>e.map(String).join(`; `),uk=e=>{if(e.propertySignatures.length>0){let t=e.propertySignatures.map(String).join(`; `);return e.indexSignatures.length>0?`{ ${t}; ${lk(e.indexSignatures)} }`:`{ ${t} }`}else if(e.indexSignatures.length>0)return`{ ${lk(e.indexSignatures)} }`;else return`{}`},dk=FO(`TypeLiteral`),fk=Zi(Qr(jg,e=>{switch(e._tag){case`AnyKeyword`:return 0;case`UnknownKeyword`:return 1;case`ObjectKeyword`:return 2;case`StringKeyword`:case`NumberKeyword`:case`BooleanKeyword`:case`BigIntKeyword`:case`SymbolKeyword`:return 3}return 4})),pk={string:`StringKeyword`,number:`NumberKeyword`,boolean:`BooleanKeyword`,bigint:`BigIntKeyword`},mk=e=>la(e,e=>yk(e)?mk(e.types):[e]),hk=e=>{let t=fk(e),n=[],r={},i=[];for(let e of t)switch(e._tag){case`NeverKeyword`:break;case`AnyKeyword`:return[GO];case`UnknownKeyword`:return[WO];case`ObjectKeyword`:case`UndefinedKeyword`:case`VoidKeyword`:case`StringKeyword`:case`NumberKeyword`:case`BooleanKeyword`:case`BigIntKeyword`:case`SymbolKeyword`:r[e._tag]||(r[e._tag]=e,n.push(e));break;case`Literal`:{let t=typeof e.literal;switch(t){case`string`:case`number`:case`bigint`:case`boolean`:!r[pk[t]]&&!i.includes(e.literal)&&(i.push(e.literal),n.push(e));break;case`object`:i.includes(e.literal)||(i.push(e.literal),n.push(e));break}break}case`UniqueSymbol`:!r.SymbolKeyword&&!i.includes(e.symbol)&&(i.push(e.symbol),n.push(e));break;case`TupleType`:r.ObjectKeyword||n.push(e);break;case`TypeLiteral`:e.propertySignatures.length===0&&e.indexSignatures.length===0?r[`{}`]||(r[`{}`]=e,n.push(e)):r.ObjectKeyword||n.push(e);break;default:n.push(e)}return n},gk=class e{types;annotations;static make=(t,n)=>vk(t)?new e(t,n):t.length===1?t[0]:HO;static unify=(t,n)=>e.make(hk(mk(t)),n);_tag=`Union`;constructor(e,t={}){this.types=e,this.annotations=t}toString(){return ai(Zk(this),()=>this.types.map(String).join(` | `))}toJSON(){return{_tag:this._tag,types:this.types.map(e=>e.toJSON()),annotations:Kk(this.annotations)}}},_k=(e,t)=>e.map(t),vk=e=>e.length>1,yk=FO(`Union`),bk=S(Symbol.for(`effect/Schema/AST/toJSONMemoMap`),()=>new WeakMap),xk=class{f;annotations;_tag=`Suspend`;constructor(e,t={}){this.f=e,this.annotations=t,this.f=oD(e)}toString(){return Zk(this).pipe(oi(()=>mi(ui(this.f)(),e=>Zk(e))),ai(()=>`<suspended schema>`))}toJSON(){let e=this.f(),t=bk.get(e);return t||(bk.set(e,{_tag:this._tag}),t={_tag:this._tag,ast:e.toJSON(),annotations:Kk(this.annotations)},bk.set(e,t),t)}},Sk=FO(`Suspend`),Ck=class{from;filter;annotations;_tag=`Refinement`;constructor(e,t,n={}){this.from=e,this.filter=t,this.annotations=n}toString(){return _O(this).pipe(ai(()=>ri(Xk(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:e=>wk(this.from)?String(this.from)+` & `+e:e})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:Kk(this.annotations)}}},wk=FO(`Refinement`),Tk={},Ek=class{from;to;transformation;annotations;_tag=`Transformation`;constructor(e,t,n,r={}){this.from=e,this.to=t,this.transformation=n,this.annotations=r}toString(){return ai(Zk(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:Kk(this.annotations)}}},Dk=FO(`Transformation`),Ok=class{decode;encode;_tag=`FinalTransformation`;constructor(e,t){this.decode=e,this.encode=t}},kk=class{from;to;decode;encode;constructor(e,t,n,r){this.from=e,this.to=t,this.decode=n,this.encode=r}},Ak=class{propertySignatureTransformations;_tag=`TypeLiteralTransformation`;constructor(e){this.propertySignatureTransformations=e;let t={},n={};for(let r of e){let e=r.from;if(t[e])throw Error(CD(e));t[e]=!0;let i=r.to;if(n[i])throw Error(CD(i));n[i]=!0}}},jk=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[qD];let i={...r,...t},a=DO(e);return ni(a)&&(i[lO]=jk(a.value,t)),n.annotations.value=i,Object.create(Object.getPrototypeOf(e),n)},Mk=`[\\s\\S]*?`,Nk=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`,Pk=(e,t)=>{switch(e._tag){case`Literal`:return Ng(String(e.literal));case`StringKeyword`:return Mk;case`NumberKeyword`:return Nk;case`TemplateLiteral`:return Ik(e,t,!1);case`Union`:return e.types.map(e=>Pk(e,t)).join(`|`)}},Fk=(e,t,n,r)=>{if(yk(e)){if(n&&!r)return`(?:${t})`}else if(!n||!r)return t;return`(${t})`},Ik=(e,t,n)=>{let r=``;if(e.head!==``){let i=Ng(e.head);r+=t&&n?`(${i})`:i}for(let i of e.spans){let e=Pk(i.type,t);if(r+=Fk(i.type,e,t,n),i.literal!==``){let e=Ng(i.literal);r+=t&&n?`(${e})`:e}}return r},Lk=e=>RegExp(`^${Ik(e,!1,!0)}$`),Rk=(e,t)=>{let n=[],r=[],i=e=>{switch(e._tag){case`NeverKeyword`:break;case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:case`Refinement`:r.push(new sk(e,t,!0));break;case`Literal`:if(Nt(e.literal)||Pt(e.literal))n.push(new ak(e.literal,t,!1,!0));else throw Error(yD(e.literal));break;case`Enums`:for(let[r,i]of e.enums)n.push(new ak(i,t,!1,!0));break;case`UniqueSymbol`:n.push(new ak(e.symbol,t,!1,!0));break;case`Union`:e.types.forEach(i);break;default:throw Error(vD(e))}};return i(e),{propertySignatures:n,indexSignatures:r}},zk=e=>t=>{let n;for(let r of e)Object.prototype.hasOwnProperty.call(t.annotations,r)&&(n===void 0&&(n={}),n[r]=t.annotations[r]);return n},Bk=zk([ZD,QD,$D,eO,tO,nO]),Vk=e=>{switch(e._tag){case`Declaration`:{let t=Hk(e.typeParameters,Vk);return t===e.typeParameters?e:new PO(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case`TupleType`:{let t=Hk(e.elements,e=>{let t=Vk(e.type);return t===e.type?e:new tk(t,e.isOptional)}),n=nk(e.rest),r=Hk(n,Vk);return t===e.elements&&r===n?e:new rk(t,r.map(e=>new ek(e)),e.isReadonly,e.annotations)}case`TypeLiteral`:{let t=Hk(e.propertySignatures,e=>{let t=Vk(e.type);return t===e.type?e:new ak(e.name,t,e.isOptional,e.isReadonly)}),n=Hk(e.indexSignatures,e=>{let t=Vk(e.type);return t===e.type?e:new sk(e.parameter,t,e.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new ck(t,n,e.annotations)}case`Union`:{let t=Hk(e.types,Vk);return t===e.types?e:gk.make(t,e.annotations)}case`Suspend`:return new xk(()=>Vk(e.f()),e.annotations);case`Refinement`:{let t=Vk(e.from);return t===e.from?e:new Ck(t,e.filter,e.annotations)}case`Transformation`:{let t=Bk(e);return Vk(t===void 0?e.to:jk(e.to,t))}}return e};function Hk(e,t){let n=!1,r=Ei(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}var Uk=e=>{switch(e._tag){case`Transformation`:return e.from;case`Refinement`:return Uk(e.from);case`Suspend`:return Uk(e.f())}},Wk=(e,t)=>{switch(e._tag){case`Declaration`:{let n=Hk(e.typeParameters,e=>Wk(e,t));return n===e.typeParameters?e:new PO(n,e.decodeUnknown,e.encodeUnknown)}case`TupleType`:{let n=Hk(e.elements,e=>{let n=Wk(e.type,t);return n===e.type?e:new tk(n,e.isOptional)}),r=nk(e.rest),i=Hk(r,e=>Wk(e,t));return n===e.elements&&i===r?e:new rk(n,i.map(e=>new ek(e)),e.isReadonly)}case`TypeLiteral`:{let n=Hk(e.propertySignatures,e=>{let n=Wk(e.type,t);return n===e.type?e:new ak(e.name,n,e.isOptional,e.isReadonly)}),r=Hk(e.indexSignatures,e=>{let n=Wk(e.type,t);return n===e.type?e:new sk(e.parameter,n,e.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new ck(n,r)}case`Union`:{let n=Hk(e.types,e=>Wk(e,t));return n===e.types?e:gk.make(n)}case`Suspend`:{let n,r=MO(e);if(ni(r)){let e=t?`Bound`:``;n={[AO]:`${r.value}Encoded${e}`}}return new xk(()=>Wk(e.f(),t),n)}case`Refinement`:{let n=Wk(e.from,t);return t?n===e.from?e:Uk(e.from)===void 0&&kO(e)?new Ck(n,e.filter,e.annotations):n:n}case`Transformation`:return Wk(e.from,t)}return e},Gk=e=>Wk(e,!1),Kk=e=>{let t={};for(let n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},qk=e=>{switch(e._tag){case`StringKeyword`:case`SymbolKeyword`:case`TemplateLiteral`:return e;case`Refinement`:return qk(e.from)}},Jk=e=>ai(Zk(e),()=>e._tag);function Yk(e){return ri(fO(e),{onNone:()=>``,onSome:e=>e.map(e=>` & Brand<${Nn(e)}>`).join(``)})}var Xk=e=>hO(e).pipe(oi(()=>vO(e)),oi(()=>gO(e)),pi(t=>t+Yk(e))),Zk=e=>oi(_O(e),()=>Xk(e)),Qk=(e,t,n)=>{switch(e._tag){case`UndefinedKeyword`:return HO;case`Union`:{let n=[],r=!1;for(let i of e.types){let e=t(i);e?(r=!0,UO(e)||n.push(e)):n.push(i)}if(r)return gk.make(n);break}case`Suspend`:return t(e.f());case`Transformation`:return n(e)}},$k=class{path;actual;issue;_tag=`Pointer`;constructor(e,t,n){this.path=e,this.actual=t,this.issue=n}},eA=class{actual;message;_tag=`Unexpected`;constructor(e,t){this.actual=e,this.message=t}},tA=class{ast;message;_tag=`Missing`;actual=void 0;constructor(e,t){this.ast=e,this.message=t}},nA=class{ast;actual;issues;output;_tag=`Composite`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.issues=n,this.output=r}},rA=class{ast;actual;kind;issue;_tag=`Refinement`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.kind=n,this.issue=r}},iA=class{ast;actual;kind;issue;_tag=`Transformation`;constructor(e,t,n,r){this.ast=e,this.actual=t,this.kind=n,this.issue=r}},aA=class{ast;actual;message;_tag=`Type`;constructor(e,t,n){this.ast=e,this.actual=t,this.message=n}},oA=class{ast;actual;message;_tag=`Forbidden`;constructor(e,t,n){this.ast=e,this.actual=t,this.message=n}},sA=Symbol.for(`effect/Schema/ParseErrorTypeId`),cA=class extends M_(`ParseError`){[sA]=sA;get message(){return this.toString()}toString(){return WA.formatIssueSync(this.issue)}toJSON(){return{_id:`ParseError`,message:this.toString()}}[k](){return this.toJSON()}},lA=e=>new cA({issue:e}),uA=j,dA=M,fA=Rr,pA=Lr,mA=zr,hA=y(2,(e,t)=>mA(e)?Gr(e,{onLeft:M,onRight:t}):RE(e,t)),gA=y(2,(e,t)=>mA(e)?Wr(e,t):PE(e,t)),_A=y(2,(e,t)=>mA(e)?Ur(e,t):IE(e,t)),vA=y(2,(e,t)=>mA(e)?Hr(e,{onLeft:t.onFailure,onRight:t.onSuccess}):FE(e,t)),yA=y(2,(e,t)=>mA(e)?Gr(e,{onLeft:t,onRight:j}):NE(e,t)),bA=(e,t)=>t===void 0||Pt(t)?e:e===void 0?t:{...e,...t},xA=(e,t,n)=>{let r=jA(e,t);return(e,t)=>r(e,bA(n,t))},SA=(e,t,n)=>{let r=xA(e,t,n);return(e,t)=>qr(r(e,t),lA)},CA=(e,t,n)=>{let r=xA(e,t,n);return(e,t)=>ii(r(e,t))},wA=(e,t,n)=>{let r=jA(e,t);return(e,t)=>r(e,{...bA(n,t),isEffectAllowed:!0})},TA=(e,t)=>SA(e.ast,!0,t),EA=(e,t)=>wA(e.ast,!0,t),DA=(e,t)=>wA(e.ast,!1,t),OA=(e,t)=>SA(Vk(e.ast),!0,t),kA=S(Symbol.for(`effect/ParseResult/decodeMemoMap`),()=>new WeakMap),AA=S(Symbol.for(`effect/ParseResult/encodeMemoMap`),()=>new WeakMap),jA=(e,t)=>{let n=t?kA:AA,r=n.get(e);if(r)return r;let i=PA(e,t),a=TO(e),o=ni(a)?(e,t)=>i(e,bA(t,a.value)):i,s=EO(e),c=t&&ni(s)?(t,n)=>zA(yA(o(t,n),s.value),e,t,n):o;return n.set(e,c),c},MA=e=>li(SO(e)),NA=e=>li(CO(e)),PA=(e,t)=>{switch(e._tag){case`Refinement`:if(t){let t=jA(e.from,!0);return(n,r)=>{r??=Tk;let i=r?.errors===`all`;return zA(hA(yA(t(n,r),t=>{let a=new rA(e,n,`From`,t);return i&&kO(e)&&$A(t)?ri(e.filter(n,r,e),{onNone:()=>M(a),onSome:t=>M(new nA(e,n,[a,new rA(e,n,`Predicate`,t)]))}):M(a)}),t=>ri(e.filter(t,r,e),{onNone:()=>j(t),onSome:t=>M(new rA(e,n,`Predicate`,t))})),e,n,r)}}else{let t=jA(Vk(e),!0),n=jA(RA(e.from),!1);return(r,i)=>zA(hA(t(r,i),e=>n(e,i)),e,r,i)}case`Transformation`:{let n=HA(e.transformation,t),r=t?jA(e.from,!0):jA(e.to,!1),i=t?jA(e.to,!0):jA(e.from,!1);return(a,o)=>zA(hA(_A(r(a,o),n=>new iA(e,a,t?`Encoded`:`Type`,n)),r=>hA(_A(n(r,o??Tk,e,a),t=>new iA(e,a,`Transformation`,t)),n=>_A(i(n,o),n=>new iA(e,a,t?`Type`:`Encoded`,n)))),e,a,o)}case`Declaration`:{let n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(t,r)=>zA(n(t,r??Tk,e),e,t,r)}case`Literal`:return FA(e,t=>t===e.literal);case`UniqueSymbol`:return FA(e,t=>t===e.symbol);case`UndefinedKeyword`:return FA(e,zt);case`NeverKeyword`:return FA(e,Bt);case`UnknownKeyword`:case`AnyKeyword`:case`VoidKeyword`:return j;case`StringKeyword`:return FA(e,Nt);case`NumberKeyword`:return FA(e,Pt);case`BooleanKeyword`:return FA(e,Ft);case`BigIntKeyword`:return FA(e,It);case`SymbolKeyword`:return FA(e,Lt);case`ObjectKeyword`:return FA(e,Ht);case`Enums`:return FA(e,t=>e.enums.some(([e,n])=>n===t));case`TemplateLiteral`:{let t=Lk(e);return FA(e,e=>Nt(e)&&t.test(e))}case`TupleType`:{let n=e.elements.map(e=>jA(e.type,t)),r=e.rest.map(e=>jA(e.type,t)),i=e.elements.filter(e=>!e.isOptional);e.rest.length>0&&(i=i.concat(e.rest.slice(1)));let a=i.length,o=e.elements.length>0?e.elements.map((e,t)=>t).join(` | `):`never`,s=MA(e),c=NA(e);return(t,l)=>{if(!Pi(t))return M(new aA(e,t));let u=l?.errors===`all`,d=[],f=0,p=[],m=t.length;for(let n=m;n<=a-1;n++){let r=new $k(n,t,new tA(i[n-m]));if(u){d.push([f++,r]);continue}else return M(new nA(e,t,r,p))}if(e.rest.length===0)for(let n=e.elements.length;n<=m-1;n++){let r=new $k(n,t,new eA(t[n],`is unexpected, expected: ${o}`));if(u){d.push([f++,r]);continue}else return M(new nA(e,t,r,p))}let h=0,g;for(;h<n.length;h++)if(m<h+1){if(e.elements[h].isOptional)continue}else{let r=n[h],i=r(t[h],l);if(mA(i)){if(Br(i)){let n=new $k(h,t,i.left);if(u){d.push([f++,n]);continue}else return M(new nA(e,t,n,VA(p)))}p.push([f++,i.right])}else{let n=f++,r=h;g||=[],g.push(({es:a,output:o})=>RE(LE(i),i=>{if(Br(i)){let s=new $k(r,t,i.left);return u?(a.push([n,s]),ME):M(new nA(e,t,s,VA(o)))}return o.push([n,i.right]),ME}))}}if(Li(r)){let[n,...i]=r;for(;h<m-i.length;h++){let r=n(t[h],l);if(mA(r))if(Br(r)){let n=new $k(h,t,r.left);if(u){d.push([f++,n]);continue}else return M(new nA(e,t,n,VA(p)))}else p.push([f++,r.right]);else{let n=f++,i=h;g||=[],g.push(({es:a,output:o})=>RE(LE(r),r=>{if(Br(r)){let s=new $k(i,t,r.left);return u?(a.push([n,s]),ME):M(new nA(e,t,s,VA(o)))}else return o.push([n,r.right]),ME}))}}for(let n=0;n<i.length;n++){let r=h+n;if(!(m<r+1)){let a=i[n](t[r],l);if(mA(a)){if(Br(a)){let n=new $k(r,t,a.left);if(u){d.push([f++,n]);continue}else return M(new nA(e,t,n,VA(p)))}p.push([f++,a.right])}else{let n=f++;g||=[],g.push(({es:i,output:o})=>RE(LE(a),a=>{if(Br(a)){let s=new $k(r,t,a.left);return u?(i.push([n,s]),ME):M(new nA(e,t,s,VA(o)))}return o.push([n,a.right]),ME}))}}}}let _=({es:n,output:r})=>Ii(n)?M(new nA(e,t,VA(n),VA(r))):j(VA(r));if(g&&g.length>0){let e=g;return jE(()=>{let t={es:ra(d),output:ra(p)};return RE(AE(e,e=>e(t),{concurrency:s,batching:c,discard:!0}),()=>_(t))})}return _({output:p,es:d})}}case`TypeLiteral`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return FA(e,Gt);let n=[],r={},i=[];for(let a of e.propertySignatures)n.push([jA(a.type,t),a]),r[a.name]=null,i.push(a.name);let a=e.indexSignatures.map(e=>[jA(e.parameter,t),jA(e.type,t),e.parameter]),o=gk.make(e.indexSignatures.map(e=>e.parameter).concat(i.map(e=>Lt(e)?new BO(e):new LO(e)))),s=jA(o,t),c=MA(e),l=NA(e);return(t,u)=>{if(!Yt(t))return M(new aA(e,t));let d=u?.errors===`all`,f=[],p=0,m=u?.onExcessProperty===`error`,h=u?.onExcessProperty===`preserve`,g={},_;if(m||h){_=Reflect.ownKeys(t);for(let n of _){let r=s(n,u);if(mA(r)&&Br(r))if(m){let r=new $k(n,t,new eA(t[n],`is unexpected, expected: ${String(o)}`));if(d){f.push([p++,r]);continue}else return M(new nA(e,t,r,g))}else g[n]=t[n]}}let v,ee=u?.exact===!0;for(let r=0;r<n.length;r++){let i=n[r][1],a=i.name,o=Object.prototype.hasOwnProperty.call(t,a);if(!o){if(i.isOptional)continue;if(ee){let n=new $k(a,t,new tA(i));if(d){f.push([p++,n]);continue}else return M(new nA(e,t,n,g))}}let s=n[r][0],c=s(t[a],u);if(mA(c)){if(Br(c)){let n=new $k(a,t,o?c.left:new tA(i));if(d){f.push([p++,n]);continue}else return M(new nA(e,t,n,g))}g[a]=c.right}else{let n=p++,r=a;v||=[],v.push(({es:a,output:s})=>RE(LE(c),c=>{if(Br(c)){let l=new $k(r,t,o?c.left:new tA(i));return d?(a.push([n,l]),ME):M(new nA(e,t,l,s))}return s[r]=c.right,ME}))}}for(let n=0;n<a.length;n++){let i=a[n],o=i[0],s=i[1],c=aD(t,i[2]);for(let n of c){let i=o(n,u);if(mA(i)&&Vr(i)){let i=s(t[n],u);if(mA(i))if(Br(i)){let r=new $k(n,t,i.left);if(d){f.push([p++,r]);continue}else return M(new nA(e,t,r,g))}else Object.prototype.hasOwnProperty.call(r,n)||(g[n]=i.right);else{let a=p++,o=n;v||=[],v.push(({es:s,output:c})=>RE(LE(i),i=>{if(Br(i)){let n=new $k(o,t,i.left);return d?(s.push([a,n]),ME):M(new nA(e,t,n,c))}else return Object.prototype.hasOwnProperty.call(r,n)||(c[n]=i.right),ME}))}}}}let te=({es:n,output:r})=>{if(Ii(n))return M(new nA(e,t,VA(n),r));if(u?.propertyOrder===`original`){let e=_||Reflect.ownKeys(t);for(let t of i)e.indexOf(t)===-1&&e.push(t);let n={};for(let t of e)Object.prototype.hasOwnProperty.call(r,t)&&(n[t]=r[t]);return j(n)}return j(r)};if(v&&v.length>0){let e=v;return jE(()=>{let t={es:ra(f),output:Object.assign({},g)};return RE(AE(e,e=>e(t),{concurrency:c,batching:l,discard:!0}),()=>te(t))})}return te({es:f,output:g})}}case`Union`:{let n=LA(e.types,t),r=Reflect.ownKeys(n.keys),i=r.length,a=e.types.length,o=new Map;for(let n=0;n<a;n++)o.set(e.types[n],jA(e.types[n],t));let s=MA(e)??1,c=NA(e);return(t,l)=>{let u=[],d=0,f=[];if(i>0)if(Vt(t))for(let e=0;e<i;e++){let i=r[e],o=n.keys[i].buckets;if(Object.prototype.hasOwnProperty.call(t,i)){let e=String(t[i]);if(Object.prototype.hasOwnProperty.call(o,e))f=f.concat(o[e]);else{let{candidates:e,literals:r}=n.keys[i],o=gk.make(r),s=e.length===a?new ck([new ak(i,o,!1,!0)],[]):gk.make(e);u.push([d++,new nA(s,t,new $k(i,t,new aA(o,t[i])))])}}else{let{candidates:e,literals:r}=n.keys[i],o=new ak(i,gk.make(r),!1,!0),s=e.length===a?new ck([o],[]):gk.make(e);u.push([d++,new nA(s,t,new $k(i,t,new tA(o)))])}}else{let r=n.candidates.length===a?e:gk.make(n.candidates);u.push([d++,new aA(r,t)])}n.otherwise.length>0&&(f=f.concat(n.otherwise));let p;for(let e=0;e<f.length;e++){let n=f[e],r=o.get(n)(t,l);if(mA(r)&&(!p||p.length===0)){if(Vr(r))return r;u.push([d++,r.left])}else{let e=d++;p||=[],p.push(t=>jE(()=>`finalResult`in t?ME:RE(LE(r),n=>(Vr(n)?t.finalResult=n:t.es.push([e,n.left]),ME))))}}let m=n=>Ii(n)?n.length===1&&n[0][1]._tag===`Type`?M(n[0][1]):M(new nA(e,t,VA(n))):M(new aA(e,t));if(p&&p.length>0){let e=p;return jE(()=>{let t={es:ra(u)};return RE(AE(e,e=>e(t),{concurrency:s,batching:c,discard:!0}),()=>`finalResult`in t?t.finalResult:m(t.es))})}return m(u)}}case`Suspend`:{let n=oD(()=>jA(e.f(),t));return(e,t)=>n()(e,t)}}},FA=(e,t)=>n=>t(n)?j(n):M(new aA(e,n)),IA=(e,t)=>{switch(e._tag){case`Declaration`:{let n=DO(e);if(ni(n))return IA(n.value,t);break}case`TypeLiteral`:{let n=[];for(let r=0;r<e.propertySignatures.length;r++){let i=e.propertySignatures[r],a=t?Gk(i.type):Vk(i.type);RO(a)&&!i.isOptional&&n.push([i.name,a])}return n}case`TupleType`:{let n=[];for(let r=0;r<e.elements.length;r++){let i=e.elements[r],a=t?Gk(i.type):Vk(i.type);RO(a)&&!i.isOptional&&n.push([r,a])}return n}case`Refinement`:return IA(e.from,t);case`Suspend`:return IA(e.f(),t);case`Transformation`:return IA(t?e.from:e.to,t)}return[]},LA=(e,t)=>{let n={},r=[],i=[];for(let a=0;a<e.length;a++){let o=e[a],s=IA(o,t);if(s.length>0){i.push(o);for(let e=0;e<s.length;e++){let[t,r]=s[e],i=String(r.literal);n[t]=n[t]||{buckets:{},literals:[],candidates:[]};let a=n[t].buckets;if(Object.prototype.hasOwnProperty.call(a,i)){if(e<s.length-1)continue;a[i].push(o),n[t].literals.push(r),n[t].candidates.push(o)}else{a[i]=[o],n[t].literals.push(r),n[t].candidates.push(o);break}}}else r.push(o)}return{keys:n,otherwise:r,candidates:i}},RA=e=>wk(e)?RA(e.from):e,zA=(e,t,n,r)=>{if(r?.isEffectAllowed===!0||mA(e))return e;let i=new pb,a=zE(e,{scheduler:i});i.flush();let o=a.unsafePoll();if(o){if(Vb(o))return j(o.value);let e=o.cause;return sg(e)?M(e.error):M(new oA(t,n,lg(e)))}return M(new oA(t,n,`cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work`))},BA=([e],[t])=>e>t?1:e<t?-1:0;function VA(e){return e.sort(BA).map(e=>e[1])}var HA=(e,t)=>{switch(e._tag){case`FinalTransformation`:return t?e.decode:e.encode;case`ComposeTransformation`:return j;case`TypeLiteralTransformation`:return n=>{let r=j(n);for(let n of e.propertySignatureTransformations){let[e,i]=t?[n.from,n.to]:[n.to,n.from],a=t?n.decode:n.encode;r=gA(r,t=>{let n=a(Object.prototype.hasOwnProperty.call(t,e)?P(t[e]):N());return delete t[e],ni(n)&&(t[i]=n.value),t})}return r}}},UA=(e,t=[])=>({value:e,forest:t}),WA={formatIssue:e=>gA(dj(e),GA),formatIssueSync:e=>{let t=WA.formatIssue(e);return mA(t)?Jr(t):BE(t)},formatError:e=>WA.formatIssue(e.issue),formatErrorSync:e=>WA.formatIssueSync(e.issue)},GA=e=>e.value+KA(`
|
|
266
|
+
`,e.forest),KA=(e,t)=>{let n=``,r=t.length,i;for(let a=0;a<r;a++){i=t[a];let o=a===r-1;n+=e+(o?`└`:`├`)+`─ `+i.value,n+=KA(e+(r>1&&!o?`│ `:` `),i.forest)}return n},qA=e=>{switch(e){case`Encoded`:return`Encoded side transformation failure`;case`Transformation`:return`Transformation process failure`;case`Type`:return`Type side transformation failure`}},JA=e=>{switch(e){case`From`:return`From side refinement failure`;case`Predicate`:return`Predicate refinement failure`}},YA=e=>`ast`in e?P(e.ast):N(),XA=j(void 0),ZA=e=>YA(e).pipe(mi(pO),ri({onNone:()=>XA,onSome:t=>{let n=t(e);return Nt(n)?j({message:n,override:!1}):kE(n)?PE(n,e=>({message:e,override:!1})):Nt(n.message)?j({message:n.message,override:n.override}):PE(n.message,e=>({message:e,override:n.override}))}})),QA=e=>t=>t._tag===e,$A=QA(`Composite`),ej=QA(`Refinement`),tj=QA(`Transformation`),nj=e=>hA(ZA(e),t=>t===void 0?XA:!t.override&&($A(e)||ej(e)&&e.kind===`From`||tj(e)&&e.kind!==`Transformation`)?tj(e)||ej(e)?nj(e.issue):XA:j(t.message)),rj=e=>YA(e).pipe(mi(wO),hi(t=>t(e)),li);function ij(e){return vO(e).pipe(oi(()=>hO(e)),oi(()=>gO(e)),oi(()=>_O(e)),ai(()=>`{ ${e.from} | filter }`))}function aj(e){return e.message===void 0?`Expected ${wk(e.ast)?ij(e.ast):String(e.ast)}, actual ${Nn(e.actual)}`:e.message}var oj=e=>gA(nj(e),t=>t??rj(e)??aj(e)),sj=e=>rj(e)??String(e.ast),cj=e=>e.message??`is forbidden`,lj=e=>e.message??`is unexpected`,uj=e=>{let t=mO(e.ast);if(ni(t)){let e=t.value();return Nt(e)?j(e):e}return j(e.message??`is missing`)},dj=e=>{switch(e._tag){case`Type`:return gA(oj(e),UA);case`Forbidden`:return j(UA(sj(e),[UA(cj(e))]));case`Unexpected`:return j(UA(lj(e)));case`Missing`:return gA(uj(e),UA);case`Transformation`:return hA(nj(e),t=>t===void 0?gA(dj(e.issue),t=>UA(sj(e),[UA(qA(e.kind),[t])])):j(UA(t)));case`Refinement`:return hA(nj(e),t=>t===void 0?gA(dj(e.issue),t=>UA(sj(e),[UA(JA(e.kind),[t])])):j(UA(t)));case`Pointer`:return gA(dj(e.issue),t=>UA(uD(e.path),[t]));case`Composite`:return hA(nj(e),t=>{if(t!==void 0)return j(UA(t));let n=sj(e);return sD(e.issues)?gA(AE(e.issues,dj),e=>UA(n,e)):gA(dj(e.issues),e=>UA(n,[e]))})}},fj=y(e=>Ht(e[0]),(e,...t)=>{let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}),pj=y(e=>Ht(e[0]),(e,...t)=>{let n={...e};for(let e of t)delete n[e];return n}),mj=Symbol.for(`effect/Schema`);function hj(e){return class{[mj]=gj;static ast=e;static annotations(e){return hj(yj(this.ast,e))}static pipe(){return A(this,arguments)}static toString(){return String(e)}static Type;static Encoded;static Context;static[mj]=gj}}var gj={_A:e=>e,_I:e=>e,_R:e=>e},_j={typeConstructor:HD,schemaId:WD,message:GD,missingMessage:KD,identifier:qD,title:JD,description:XD,examples:ZD,default:QD,documentation:rO,jsonSchema:$D,arbitrary:eO,pretty:tO,equivalence:nO,concurrency:iO,batching:aO,parseIssueTitle:oO,parseOptions:sO,decodingFallback:cO},vj=e=>{if(!e)return{};let t={...e};for(let n in _j)if(n in e){let r=_j[n];t[r]=e[n],delete t[n]}return t},yj=(e,t)=>jk(e,vj(t));function bj(e){return e}var xj=e=>String(e.ast),Sj=e=>hj(Vk(e.ast)),Cj=e=>C(e,mj)&&Ht(e[mj]);function wj(e){return vk(e)?gk.make(_k(e,e=>new LO(e))):new LO(e[0])}function Tj(e,t=wj(e)){return class extends hj(t){static annotations(e){return Tj(this.literals,yj(this.ast,e))}static literals=[...e]}}function z(...e){return Li(e)?Tj(e):Nj}var Ej=(e,t,n)=>Oj(e,new PO(e.map(e=>e.ast),(...e)=>t.decode(...e.map(hj)),(...e)=>t.encode(...e.map(hj)),vj(n))),Dj=(e,t)=>{let n=()=>(t,n,r)=>e(t)?uA(t):dA(new aA(r,t));return Oj([],new PO([],n,n,vj(t)))};function Oj(e,t){return class extends hj(t){static annotations(e){return Oj(this.typeParameters,yj(this.ast,e))}static typeParameters=[...e]}}var kj=function(){if(Array.isArray(arguments[0])){let e=arguments[0],t=arguments[1],n=arguments[2];return Ej(e,t,n)}let e=arguments[0],t=arguments[1];return Dj(e,t)},Aj=Symbol.for(`effect/SchemaId/InstanceOf`),jj=(e,t)=>kj(t=>t instanceof e,{title:e.name,description:`an instance of ${e.name}`,pretty:()=>String,schemaId:Aj,[Aj]:{constructor:e},...t}),Mj=class extends hj(VO){},B=class extends hj(zO){},Nj=class extends hj(HO){},V=class extends hj(WO){},Pj=class extends hj(XO){},Fj=class extends hj(ZO){},H=class extends hj(KO){},U=class extends hj(JO){},W=class extends hj(YO){},Ij=class extends hj($O){},Lj=e=>gk.make(e.map(e=>e.ast));function Rj(e,t=Lj(e)){return class extends hj(t){static annotations(e){return Rj(this.members,yj(this.ast,e))}static members=[...e]}}function G(...e){return vk(e)?Rj(e):Li(e)?e[0]:Nj}var K=e=>G(e,B),zj=e=>G(e,Mj),Bj=e=>new Vj(new tk(e.ast,!1),e),Vj=class e{ast;from;[mj];_Token;constructor(e,t){this.ast=e,this.from=t}annotations(t){return new e(new tk(this.ast.type,this.ast.isOptional,{...this.ast.annotations,...vj(t)}),this.from)}toString(){return`${this.ast.type}${this.ast.isOptional?`?`:``}`}},Hj=(e,t)=>new rk(e.map(e=>Cj(e)?new tk(e.ast,!1):e.ast),t.map(e=>Cj(e)?new ek(e.ast):e.ast),!0);function Uj(e,t,n=Hj(e,t)){return class extends hj(n){static annotations(e){return Uj(this.elements,this.rest,yj(this.ast,e))}static elements=[...e];static rest=[...t]}}function Wj(...e){return Array.isArray(e[0])?Uj(e[0],e.slice(1)):Uj(e,[])}function Gj(e,t){return class extends Uj([],[e],t){static annotations(e){return Gj(this.value,yj(this.ast,e))}static value=e}}var q=e=>Gj(e),Kj=e=>e?`"?:"`:`":"`,qj=class extends tk{isReadonly;defaultValue;_tag=`PropertySignatureDeclaration`;constructor(e,t,n,r,i){super(e,t,r),this.isReadonly=n,this.defaultValue=i}toString(){let e=Kj(this.isOptional),t=String(this.type);return`PropertySignature<${e}, ${t}, never, ${e}, ${t}>`}},Jj=class extends tk{isReadonly;defaultValue;constructor(e,t,n,r,i){super(e,t,r),this.isReadonly=n,this.defaultValue=i}},Yj=e=>e===void 0?`never`:Nt(e)?JSON.stringify(e):String(e),Xj=class{from;to;decode;encode;_tag=`PropertySignatureTransformation`;constructor(e,t,n,r){this.from=e,this.to=t,this.decode=n,this.encode=r}toString(){return`PropertySignature<${Kj(this.to.isOptional)}, ${this.to.type}, ${Yj(this.from.fromKey)}, ${Kj(this.from.isOptional)}, ${this.from.type}>`}},Zj=(e,t)=>{switch(e._tag){case`PropertySignatureDeclaration`:return new qj(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case`PropertySignatureTransformation`:return new Xj(e.from,new Jj(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},Qj=Symbol.for(`effect/PropertySignature`),$j=e=>C(e,Qj),eM=class e{ast;[mj];[Qj]=null;_TypeToken;_Key;_EncodedToken;_HasDefault;constructor(e){this.ast=e}pipe(){return A(this,arguments)}annotations(t){return new e(Zj(this.ast,vj(t)))}toString(){return String(this.ast)}},tM=e=>new eM(e),nM=class e extends eM{from;constructor(e,t){super(e),this.from=t}annotations(t){return new e(Zj(this.ast,vj(t)),this.from)}},rM=e=>new nM(new qj(e.ast,!1,!0,{},void 0),e),iM=y(2,(e,t)=>{let n=e.ast;switch(n._tag){case`PropertySignatureDeclaration`:return tM(new qj(n.type,n.isOptional,n.isReadonly,n.annotations,t));case`PropertySignatureTransformation`:return tM(new Xj(n.from,new Jj(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),J=e=>new nM(new qj(e.ast===VO||e.ast===HO?VO:zj(e).ast,!0,!0,{},void 0),e),aM=zk([KD]),oM=(e,t)=>{let n=Reflect.ownKeys(e),r=[];if(n.length>0){let i=[],a=[],o=[];for(let t=0;t<n.length;t++){let s=n[t],c=e[s];if($j(c)){let e=c.ast;switch(e._tag){case`PropertySignatureDeclaration`:{let t=e.type,n=e.isOptional,o=e.annotations;i.push(new ak(s,t,n,!0,aM(e))),a.push(new ak(s,Vk(t),n,!0,o)),r.push(new ak(s,t,n,!0,o));break}case`PropertySignatureTransformation`:{let t=e.from.fromKey??s;i.push(new ak(t,e.from.type,e.from.isOptional,!0,e.from.annotations)),a.push(new ak(s,e.to.type,e.to.isOptional,!0,e.to.annotations)),o.push(new kk(t,s,e.decode,e.encode));break}}}else i.push(new ak(s,c.ast,!1,!0)),a.push(new ak(s,Vk(c.ast),!1,!0)),r.push(new ak(s,c.ast,!1,!0))}if(Li(o)){let e=[],n=[];for(let r of t){let{indexSignatures:t,propertySignatures:o}=Rk(r.key.ast,r.value.ast);o.forEach(e=>{i.push(e),a.push(new ak(e.name,Vk(e.type),e.isOptional,e.isReadonly,e.annotations))}),t.forEach(t=>{e.push(t),n.push(new sk(t.parameter,Vk(t.type),t.isReadonly))})}return new Ek(new ck(i,e,{[YD]:`Struct (Encoded side)`}),new ck(a,n,{[YD]:`Struct (Type side)`}),new Ak(o))}}let i=[];for(let e of t){let{indexSignatures:t,propertySignatures:n}=Rk(e.key.ast,e.value.ast);n.forEach(e=>r.push(e)),t.forEach(e=>i.push(e))}return new ck(r,i)},sM=(e,t)=>{let n=Reflect.ownKeys(e);for(let r of n){let n=e[r];if(t[r]===void 0&&$j(n)){let e=n.ast,i=e._tag===`PropertySignatureDeclaration`?e.defaultValue:e.to.defaultValue;i!==void 0&&(t[r]=i())}}return t};function cM(e,t,n=oM(e,t)){return class extends hj(n){static annotations(e){return cM(this.fields,this.records,yj(this.ast,e))}static fields={...e};static records=[...t];static make=(t,n)=>{let r=sM(e,{...t});return vP(n)?r:OA(this)(r)};static pick(...t){return Y(fj(e,...t))}static omit(...t){return Y(pj(e,...t))}}}function Y(e,...t){return cM(e,t)}var lM=e=>z(e).pipe(rM,iM(()=>e)),uM=(e,t)=>Y({_tag:lM(e),...t});function dM(e,t,n){return class extends cM({},[{key:e,value:t}],n){static annotations(n){return dM(e,t,yj(this.ast,n))}static key=e;static value=t}}var X=e=>dM(e.key,e.value),fM=e=>hj(new xk(()=>e().ast)),pM=Symbol.for(`effect/SchemaId/Refine`);function mM(e,t,n){return class extends hj(n){static annotations(e){return mM(this.from,this.filter,yj(this.ast,e))}static[pM]=e;static from=e;static filter=t;static make=(e,t)=>vP(t)?e:OA(this)(e)}}var hM=(e,t,n)=>{if(Ft(e))return e?N():P(new aA(t,n));if(Nt(e))return P(new aA(t,n,e));if(e!==void 0){if(`_tag`in e)return P(e);let r=new aA(t,n,e.message);return P(Li(e.path)?new $k(e.path,n,r):r)}return N()},gM=(e,t,n)=>{if(cD(e))return hM(e,t,n);if(Li(e)){let r=da(e,e=>hM(e,t,n));if(Li(r))return P(r.length===1?r[0]:new nA(t,n,r))}return N()};function Z(e,t){return n=>{function r(t,n,r){return gM(e(t,n,r),r,t)}return mM(n,r,new Ck(n.ast,r,vj(t)))}}function _M(e,t,n){return class extends hj(n){static annotations(e){return _M(this.from,this.to,yj(this.ast,e))}static from=e;static to=t}}var vM=y(e=>Cj(e[0])&&Cj(e[1]),(e,t,n)=>_M(e,t,new Ek(e.ast,t.ast,new Ok(n.decode,n.encode)))),yM=y(e=>Cj(e[0])&&Cj(e[1]),(e,t,n)=>vM(e,t,{strict:!0,decode:(e,t,r,i)=>uA(n.decode(e,i)),encode:(e,t,r,i)=>uA(n.encode(e,i))})),bM=Symbol.for(`effect/SchemaId/Trimmed`),xM=e=>t=>t.pipe(Z(e=>e===e.trim(),{schemaId:bM,title:`trimmed`,description:`a string with no leading or trailing whitespace`,jsonSchema:{pattern:`^\\S[\\s\\S]*\\S$|^\\S$|^$`},...e})),SM=RD,CM=(e,t)=>n=>n.pipe(Z(t=>t.length<=e,{schemaId:SM,title:`maxLength(${e})`,description:`a string at most ${e} character(s) long`,jsonSchema:{maxLength:e},...t})),wM=LD,TM=(e,t)=>n=>n.pipe(Z(t=>t.length>=e,{schemaId:wM,title:`minLength(${e})`,description:`a string at least ${e} character(s) long`,jsonSchema:{minLength:e},...t})),EM=zD,DM=(e,t)=>n=>{let r=Ht(e)?Math.max(0,Math.floor(e.min)):Math.max(0,Math.floor(e)),i=Ht(e)?Math.max(r,Math.floor(e.max)):r;return r===i?n.pipe(Z(e=>e.length===r,{schemaId:EM,title:`length(${r})`,description:r===1?`a single character`:`a string ${r} character(s) long`,jsonSchema:{minLength:r,maxLength:r},...t})):n.pipe(Z(e=>e.length>=r&&e.length<=i,{schemaId:EM,title:`length({ min: ${r}, max: ${i})`,description:`a string at least ${r} character(s) and at most ${i} character(s) long`,jsonSchema:{minLength:r,maxLength:i},...t}))},OM=Symbol.for(`effect/SchemaId/Pattern`),kM=(e,t)=>n=>{let r=e.source;return n.pipe(Z(t=>(e.lastIndex=0,e.test(t)),{schemaId:OM,[OM]:{regex:e},description:`a string matching the pattern ${r}`,jsonSchema:{pattern:r},...t}))},AM=Symbol.for(`effect/SchemaId/Lowercased`),jM=e=>t=>t.pipe(Z(e=>e===e.toLowerCase(),{schemaId:AM,title:`lowercased`,description:`a lowercase string`,jsonSchema:{pattern:`^[^A-Z]*$`},...e})),MM=class extends H.pipe(jM({identifier:`Lowercased`})){},NM=Symbol.for(`effect/SchemaId/Uppercased`),PM=e=>t=>t.pipe(Z(e=>e===e.toUpperCase(),{schemaId:NM,title:`uppercased`,description:`an uppercase string`,jsonSchema:{pattern:`^[^a-z]*$`},...e})),FM=class extends H.pipe(PM({identifier:`Uppercased`})){},IM=Symbol.for(`effect/SchemaId/Capitalized`),LM=e=>t=>t.pipe(Z(e=>e[0]?.toUpperCase()===e[0],{schemaId:IM,title:`capitalized`,description:`a capitalized string`,jsonSchema:{pattern:`^[^a-z]?.*$`},...e})),RM=class extends H.pipe(LM({identifier:`Capitalized`})){},zM=Symbol.for(`effect/SchemaId/Uncapitalized`),BM=e=>t=>t.pipe(Z(e=>e[0]?.toLowerCase()===e[0],{schemaId:zM,title:`uncapitalized`,description:`a uncapitalized string`,jsonSchema:{pattern:`^[^A-Z]?.*$`},...e})),VM=class extends H.pipe(BM({identifier:`Uncapitalized`})){};H.pipe(DM(1,{identifier:`Char`}));var HM=e=>TM(1,{title:`nonEmptyString`,description:`a non empty string`,...e});yM(H.annotations({description:`a string that will be converted to lowercase`}),MM,{strict:!0,decode:e=>e.toLowerCase(),encode:b}).annotations({identifier:`Lowercase`}),yM(H.annotations({description:`a string that will be converted to uppercase`}),FM,{strict:!0,decode:e=>e.toUpperCase(),encode:b}).annotations({identifier:`Uppercase`}),yM(H.annotations({description:`a string that will be converted to a capitalized format`}),RM,{strict:!0,decode:e=>SE(e),encode:b}).annotations({identifier:`Capitalize`}),yM(H.annotations({description:`a string that will be converted to an uncapitalized format`}),VM,{strict:!0,decode:e=>CE(e),encode:b}).annotations({identifier:`Uncapitalize`});var UM=class extends H.pipe(xM({identifier:`Trimmed`})){},WM=class extends UM.pipe(HM({identifier:`NonEmptyTrimmedString`})){};yM(H.annotations({description:`a string that will be trimmed`}),UM,{strict:!0,decode:e=>e.trim(),encode:b}).annotations({identifier:`Trim`});var GM=e=>e instanceof Error?e.message:String(e);H.pipe(HM({identifier:`NonEmptyString`}));var KM=Symbol.for(`effect/SchemaId/UUID`),qM=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;H.pipe(kM(qM,{schemaId:KM,identifier:`UUID`,jsonSchema:{format:`uuid`,pattern:qM.source},description:`a Universally Unique Identifier`,arbitrary:()=>e=>e.uuid()}));var JM=Symbol.for(`effect/SchemaId/ULID`);H.pipe(kM(/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/i,{schemaId:JM,identifier:`ULID`,description:`a Universally Unique Lexicographically Sortable Identifier`,arbitrary:()=>e=>e.ulid()}));var YM=class extends jj(URL,{typeConstructor:{_tag:`URL`},identifier:`URLFromSelf`,arbitrary:()=>e=>e.webUrl().map(e=>new URL(e)),pretty:()=>e=>e.toString()}){};vM(H.annotations({description:`a string to be decoded into a URL`}),YM,{strict:!0,decode:(e,t,n)=>fA({try:()=>new URL(e),catch:t=>new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a URL. ${GM(t)}`)}),encode:e=>uA(e.toString())}).annotations({identifier:`URL`,pretty:()=>e=>e.toString()});var XM=MD,ZM=e=>t=>t.pipe(Z(Number.isFinite,{schemaId:XM,title:`finite`,description:`a finite number`,jsonSchema:{},...e})),QM=ED,$M=(e,t)=>n=>n.pipe(Z(t=>t>e,{schemaId:QM,title:`greaterThan(${e})`,description:e===0?`a positive number`:`a number greater than ${e}`,jsonSchema:{exclusiveMinimum:e},...t})),eN=DD,tN=(e,t)=>n=>n.pipe(Z(t=>t>=e,{schemaId:eN,title:`greaterThanOrEqualTo(${e})`,description:e===0?`a non-negative number`:`a number greater than or equal to ${e}`,jsonSchema:{minimum:e},...t})),nN=AD,rN=e=>t=>t.pipe(Z(e=>Number.isSafeInteger(e),{schemaId:nN,title:`int`,description:`an integer`,jsonSchema:{type:`integer`},...e})),iN=OD,aN=(e,t)=>n=>n.pipe(Z(t=>t<e,{schemaId:iN,title:`lessThan(${e})`,description:e===0?`a negative number`:`a number less than ${e}`,jsonSchema:{exclusiveMaximum:e},...t})),oN=kD,sN=(e,t)=>n=>n.pipe(Z(t=>t<=e,{schemaId:oN,title:`lessThanOrEqualTo(${e})`,description:e===0?`a non-positive number`:`a number less than or equal to ${e}`,jsonSchema:{maximum:e},...t})),cN=PD,lN=(e,t,n)=>r=>r.pipe(Z(n=>n>=e&&n<=t,{schemaId:cN,title:`between(${e}, ${t})`,description:`a number between ${e} and ${t}`,jsonSchema:{minimum:e,maximum:t},...n})),uN=jD,dN=e=>t=>t.pipe(Z(e=>!Number.isNaN(e),{schemaId:uN,title:`nonNaN`,description:`a number excluding NaN`,...e})),fN=e=>$M(0,{title:`positive`,...e}),pN=e=>aN(0,{title:`negative`,...e}),mN=e=>sN(0,{title:`nonPositive`,...e}),hN=e=>tN(0,{title:`nonNegative`,...e});function gN(e){return vM(e,U,{strict:!1,decode:(e,t,n)=>pA(Mg(e),()=>new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a number`)),encode:e=>uA(String(e))})}gN(H.annotations({description:`a string to be decoded into a number`})).annotations({identifier:`NumberFromString`}),U.pipe(ZM({identifier:`Finite`}));var _N=class extends U.pipe(rN({identifier:`Int`})){};U.pipe(dN({identifier:`NonNaN`})),U.pipe(fN({identifier:`Positive`})),U.pipe(pN({identifier:`Negative`})),U.pipe(mN({identifier:`NonPositive`}));var vN=class extends U.pipe(hN({identifier:`NonNegative`})){},yN=ND;U.pipe(ZM({schemaId:yN,identifier:`JsonNumber`})),yM(W.annotations({description:`a boolean that will be negated`}),W,{strict:!0,decode:e=>Ua(e),encode:e=>Ua(e)});var bN=(e,t)=>{let n=Symbol.keyFor(e);return n===void 0?dA(new aA(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):uA(n)},xN=e=>uA(Symbol.for(e));vM(H.annotations({description:`a string to be decoded into a globally shared symbol`}),Fj,{strict:!1,decode:e=>xN(e),encode:(e,t,n)=>bN(e,n)}).annotations({identifier:`Symbol`});var SN=FD,CN=(e,t)=>n=>n.pipe(Z(t=>t>=e,{schemaId:SN,[SN]:{min:e},title:`greaterThanOrEqualToBigInt(${e})`,description:e===0n?`a non-negative bigint`:`a bigint greater than or equal to ${e}n`,...t})),wN=ID,TN=(e,t,n)=>r=>r.pipe(Z(n=>n>=e&&n<=t,{schemaId:wN,[wN]:{min:e,max:t},title:`betweenBigInt(${e}, ${t})`,description:`a bigint between ${e}n and ${t}n`,...n})),EN=e=>CN(0n,{title:`nonNegativeBigInt`,...e}),DN=class extends vM(H.annotations({description:`a string to be decoded into a bigint`}),Pj,{strict:!0,decode:(e,t,n)=>pA(Va(e),()=>new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a bigint`)),encode:e=>uA(String(e))}).annotations({identifier:`BigInt`}){},ON=Pj.pipe(EN({identifier:`NonNegativeBigintFromSelf`}));vM(U.annotations({description:`a number to be decoded into a bigint`}),Pj.pipe(TN(BigInt(-(2**53-1)),BigInt(2**53-1))),{strict:!0,decode:(e,t,n)=>pA(Ha(e),()=>new aA(n,e,`Unable to decode ${e} into a bigint`)),encode:(e,t,n)=>pA(Ba(e),()=>new aA(n,e,`Unable to encode ${e}n into a number`))}).annotations({identifier:`BigIntFromNumber`});var kN=(e,t,n,r)=>vA(e,{onFailure:e=>new nA(n,r,e),onSuccess:t}),AN=class extends kj(Ul,{typeConstructor:{_tag:`effect/Duration`},identifier:`DurationFromSelf`,pretty:()=>String,arbitrary:()=>e=>e.oneof(e.constant(ql),e.bigInt({min:0n}).map(e=>Jl(e)),e.maxSafeNat().map(e=>Xl(e))),equivalence:()=>cu}){};vM(ON.annotations({description:`a bigint to be decoded into a Duration`}),AN.pipe(Z(e=>Wl(e),{description:`a finite duration`})),{strict:!0,decode:e=>uA(Jl(e)),encode:(e,t,n)=>ri(ru(e),{onNone:()=>dA(new aA(n,e,`Unable to encode ${e} into a bigint`)),onSome:e=>uA(e)})}).annotations({identifier:`DurationFromNanos`});var jN=vN.pipe(rN()).annotations({identifier:`NonNegativeInt`});yM(vN.annotations({description:`a non-negative number to be decoded into a Duration`}),AN,{strict:!0,decode:e=>Xl(e),encode:e=>nu(e)}).annotations({identifier:`DurationFromMillis`});var MN=uM(`Millis`,{millis:jN}),NN=uM(`Nanos`,{nanos:DN}),PN=uM(`Infinity`,{}),FN=PN.make({}),IN=G(MN,NN,PN).annotations({identifier:`DurationValue`,description:`an JSON-compatible tagged union to be decoded into a Duration`}),LN=G(Wj(Bj(jN).annotations({title:`seconds`}),Bj(jN).annotations({title:`nanos`})).annotations({identifier:`FiniteHRTime`}),Wj(z(-1),z(0)).annotations({identifier:`InfiniteHRTime`})).annotations({identifier:`HRTime`,description:`a tuple of seconds and nanos to be decoded into a Duration`}),RN=e=>typeof e==`object`;yM(G(IN,LN),AN,{strict:!0,decode:e=>{if(RN(e))switch(e._tag){case`Millis`:return Xl(e.millis);case`Nanos`:return Jl(e.nanos);case`Infinity`:return ql}let[t,n]=e;return t===-1?ql:Jl(BigInt(t)*BigInt(1e9)+BigInt(n))},encode:e=>{switch(e.value._tag){case`Millis`:return MN.make({millis:e.value.millis});case`Nanos`:return NN.make({nanos:e.value.nanos});case`Infinity`:return FN}}}).annotations({identifier:`Duration`});var zN=class extends kj(Kt,{typeConstructor:{_tag:`Uint8Array`},identifier:`Uint8ArrayFromSelf`,pretty:()=>e=>`new Uint8Array(${JSON.stringify(Array.from(e))})`,arbitrary:()=>e=>e.uint8Array(),equivalence:()=>ma(O)}){};yM(q(class extends U.pipe(lN(0,255,{identifier:`Uint8`,description:`a 8-bit unsigned integer`})){}).annotations({description:`an array of 8-bit unsigned integers to be decoded into a Uint8Array`}),zN,{strict:!0,decode:e=>Uint8Array.from(e),encode:e=>Array.from(e)}).annotations({identifier:`Uint8Array`});var BN=BD,VN=(e,t)=>n=>{let r=Math.floor(e);if(r<1)throw Error(fD(`Expected an integer greater than or equal to 1, actual ${e}`));return n.pipe(Z(e=>e.length>=r,{schemaId:BN,title:`minItems(${r})`,description:`an array of at least ${r} item(s)`,jsonSchema:{minItems:r},[uO]:!0,...t}))},HN=VD,UN=(e,t)=>n=>{let r=Math.floor(e);if(r<1)throw Error(fD(`Expected an integer greater than or equal to 1, actual ${e}`));return n.pipe(Z(e=>e.length<=r,{schemaId:HN,title:`maxItems(${r})`,description:`an array of at most ${r} item(s)`,jsonSchema:{maxItems:r},[uO]:!0,...t}))},WN=Symbol.for(`effect/SchemaId/ValidDate`),GN=e=>t=>t.pipe(Z(e=>!Number.isNaN(e.getTime()),{schemaId:WN,[WN]:{noInvalidDate:!0},title:`validDate`,description:`a valid Date`,...e})),KN=TD,qN=class extends kj(qt,{typeConstructor:{_tag:`Date`},identifier:`DateFromSelf`,schemaId:KN,[KN]:{noInvalidDate:!1},description:`a potentially invalid Date instance`,pretty:()=>e=>`new Date(${JSON.stringify(e)})`,arbitrary:()=>e=>e.date({noInvalidDate:!1}),equivalence:()=>Dt}){};qN.pipe(GN({identifier:`ValidDateFromSelf`,description:`a valid Date instance`})),class extends yM(H.annotations({description:`a string to be decoded into a Date`}),qN,{strict:!0,decode:e=>new Date(e),encode:e=>An(e)}).annotations({identifier:`DateFromString`}){}.pipe(GN({identifier:`Date`})),yM(U.annotations({description:`a number to be decoded into a Date`}),qN,{strict:!0,decode:e=>new Date(e),encode:e=>e.getTime()}).annotations({identifier:`DateFromNumber`});var JN=class extends kj(e=>VE(e)&&WE(e),{typeConstructor:{_tag:`effect/DateTime.Utc`},identifier:`DateTimeUtcFromSelf`,description:`a DateTime.Utc instance`,pretty:()=>e=>e.toString(),arbitrary:()=>e=>e.date({noInvalidDate:!0}).map(e=>qE(e)),equivalence:()=>KE}){},YN=(e,t)=>fA({try:()=>JE(e),catch:()=>new aA(t,e,`Unable to decode ${Nn(e)} into a DateTime.Utc`)});vM(U.annotations({description:`a number to be decoded into a DateTime.Utc`}),JN,{strict:!0,decode:(e,t,n)=>YN(e,n),encode:e=>uA(nD(e))}).annotations({identifier:`DateTimeUtcFromNumber`}),vM(qN.annotations({description:`a Date to be decoded into a DateTime.Utc`}),JN,{strict:!0,decode:(e,t,n)=>YN(e,n),encode:e=>uA(tD(e))}).annotations({identifier:`DateTimeUtcFromDate`}),vM(H.annotations({description:`a string to be decoded into a DateTime.Utc`}),JN,{strict:!0,decode:(e,t,n)=>YN(e,n),encode:e=>uA(rD(e))}).annotations({identifier:`DateTimeUtc`});var XN=()=>e=>e.integer({min:-720*60*1e3,max:840*60*1e3}).map(QE),ZN=class extends kj(HE,{typeConstructor:{_tag:`effect/DateTime.TimeZone.Offset`},identifier:`TimeZoneOffsetFromSelf`,description:`a TimeZone.Offset instance`,pretty:()=>e=>e.toString(),arbitrary:XN}){};yM(U.annotations({description:`a number to be decoded into a TimeZone.Offset`}),ZN,{strict:!0,decode:e=>QE(e),encode:e=>e.offset}).annotations({identifier:`TimeZoneOffset`});var QN=()=>e=>e.constantFrom(...Intl.supportedValuesOf(`timeZone`)).map(ZE),$N=class extends kj(UE,{typeConstructor:{_tag:`effect/DateTime.TimeZone.Named`},identifier:`TimeZoneNamedFromSelf`,description:`a TimeZone.Named instance`,pretty:()=>e=>e.toString(),arbitrary:QN}){};vM(H.annotations({description:`a string to be decoded into a TimeZone.Named`}),$N,{strict:!0,decode:(e,t,n)=>fA({try:()=>ZE(e),catch:()=>new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a TimeZone.Named`)}),encode:e=>uA(e.id)}).annotations({identifier:`TimeZoneNamed`});var eP=class extends G(ZN,$N){};vM(H.annotations({description:`a string to be decoded into a TimeZone`}),eP,{strict:!0,decode:(e,t,n)=>ri($E(e),{onNone:()=>dA(new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a TimeZone`)),onSome:uA}),encode:e=>uA(eD(e))}).annotations({identifier:`TimeZone`});var tP=e=>e.oneof(XN()(e),QN()(e)),nP=class extends kj(e=>VE(e)&&GE(e),{typeConstructor:{_tag:`effect/DateTime.Zoned`},identifier:`DateTimeZonedFromSelf`,description:`a DateTime.Zoned instance`,pretty:()=>e=>e.toString(),arbitrary:()=>e=>e.tuple(e.integer({min:-31536e9,max:31536e9}),tP(e)).map(([e,t])=>YE(e,{timeZone:t})),equivalence:()=>KE}){};vM(H.annotations({description:`a string to be decoded into a DateTime.Zoned`}),nP,{strict:!0,decode:(e,t,n)=>ri(XE(e),{onNone:()=>dA(new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a DateTime.Zoned`)),onSome:uA}),encode:e=>uA(iD(e))}).annotations({identifier:`DateTimeZoned`});var rP=e=>e._tag===`None`?N():P(e.value),iP=(e,t)=>n=>n.oneof(t,n.record({_tag:n.constant(`None`)}),n.record({_tag:n.constant(`Some`),value:e(n)})).map(rP),aP=e=>ri({onNone:()=>`none()`,onSome:t=>`some(${e(t)})`}),oP=e=>(t,n,r)=>ei(t)?ti(t)?uA(N()):kN(e(t.value,n),P,r,t):dA(new aA(r,t)),sP=e=>kj([e],{decode:e=>oP(EA(e)),encode:e=>oP(DA(e))},{typeConstructor:{_tag:`effect/Option`},pretty:aP,arbitrary:iP,equivalence:vi});yM(H,(e=>sP(e).annotations({description:`Option<${xj(e)}>`}))(WM),{strict:!0,decode:e=>_i(P(e.trim()),wE),encode:e=>ai(e,()=>``)});var cP=(e,t)=>n=>{let r=n.array(e(n));return(t.depthIdentifier===void 0?r:n.oneof(t,n.constant([]),r)).map(e=>new Set(e))},lP=e=>t=>`new Set([${Array.from(t.values()).map(t=>e(t)).join(`, `)}])`,uP=e=>{let t=ma(e);return wt((e,n)=>t(Array.from(e.values()),Array.from(n.values())))},dP=e=>(t,n,r)=>Mt(t)?kN(e(Array.from(t.values()),n),e=>new Set(e),r,t):dA(new aA(r,t)),fP=(e,t)=>kj([e],{decode:e=>dP(EA(q(e))),encode:e=>dP(DA(q(e)))},{typeConstructor:{_tag:`ReadonlySet`},description:t,pretty:lP,arbitrary:cP,equivalence:uP}),pP=e=>fP(e,`Set<${xj(e)}>`);function mP(e){return yM(q(e),pP(Sj(bj(e))),{strict:!0,decode:e=>new Set(e),encode:e=>Array.from(e)})}var hP=()=>e=>`BigDecimal(${Fa(Da(e))})`,gP=()=>e=>e.tuple(e.bigInt(),e.integer({min:-18,max:18})).map(([e,t])=>Sa(e,t)),_P=class extends kj(xa,{typeConstructor:{_tag:`effect/BigDecimal`},identifier:`BigDecimalFromSelf`,pretty:hP,arbitrary:gP,equivalence:()=>Aa}){};vM(H.annotations({description:`a string to be decoded into a BigDecimal`}),_P,{strict:!0,decode:(e,t,n)=>Pa(e).pipe(ri({onNone:()=>dA(new aA(n,e,`Unable to decode ${JSON.stringify(e)} into a BigDecimal`)),onSome:e=>uA(Da(e))})),encode:e=>uA(Fa(Da(e)))}).annotations({identifier:`BigDecimal`}),yM(U.annotations({description:`a number to be decoded into a BigDecimal`}),_P,{strict:!0,decode:e=>Ma(e),encode:e=>La(e)}).annotations({identifier:`BigDecimalFromNumber`});function vP(e){return Ft(e)?e:e?.disableValidation??!1}var yP=G(Y({_tag:z(`None`)}).annotations({identifier:`FiberIdNoneEncoded`}),Y({_tag:z(`Runtime`),id:_N,startTimeMillis:_N}).annotations({identifier:`FiberIdRuntimeEncoded`}),Y({_tag:z(`Composite`),left:fM(()=>yP),right:fM(()=>yP)}).annotations({identifier:`FiberIdCompositeEncoded`})).annotations({identifier:`FiberIdEncoded`}),bP=e=>e.letrec(t=>({None:e.record({_tag:e.constant(`None`)}),Runtime:e.record({_tag:e.constant(`Runtime`),id:e.integer(),startTimeMillis:e.integer()}),Composite:e.record({_tag:e.constant(`Composite`),left:t(`FiberId`),right:t(`FiberId`)}),FiberId:e.oneof(t(`None`),t(`Runtime`),t(`Composite`))})).FiberId.map(CP),xP=e=>{switch(e._tag){case`None`:return`FiberId.none`;case`Runtime`:return`FiberId.runtime(${e.id}, ${e.startTimeMillis})`;case`Composite`:return`FiberId.composite(${xP(e.right)}, ${xP(e.left)})`}},SP=class extends kj(Vu,{typeConstructor:{_tag:`effect/FiberId`},identifier:`FiberIdFromSelf`,pretty:()=>xP,arbitrary:()=>bP}){},CP=e=>{switch(e._tag){case`None`:return Ru;case`Runtime`:return zu(e.id,e.startTimeMillis);case`Composite`:return Bu(CP(e.left),CP(e.right))}},wP=e=>{switch(e._tag){case`None`:return{_tag:`None`};case`Runtime`:return{_tag:`Runtime`,id:e.id,startTimeMillis:e.startTimeMillis};case`Composite`:return{_tag:`Composite`,left:wP(e.left),right:wP(e.right)}}};yM(yP,SP,{strict:!0,decode:e=>CP(e),encode:e=>wP(e)}).annotations({identifier:`FiberId`}),yM(V,V,{strict:!0,decode:e=>{if(Ht(e)&&`message`in e&&typeof e.message==`string`){let t=Error(e.message,{cause:e});return`name`in e&&typeof e.name==`string`&&(t.name=e.name),t.stack=`stack`in e&&typeof e.stack==`string`?e.stack:``,t}return Vc(e)},encode:e=>e instanceof Error?{name:e.name,message:e.message}:Vc(e)}).annotations({identifier:`Defect`}),yM(V,W,{strict:!0,decode:e=>jt(e),encode:b}).annotations({identifier:`BooleanFromUnknown`}),yM(z(`true`,`false`).annotations({description:`a string to be decoded into a boolean`}),W,{strict:!0,decode:e=>e===`true`,encode:e=>e?`true`:`false`}).annotations({identifier:`BooleanFromString`});var TP=uM(`symbol`,{key:H}).annotations({description:`an object to be decoded into a globally shared symbol`}),EP=vM(TP,Fj,{strict:!0,decode:e=>xN(e.key),encode:(e,t,n)=>gA(bN(e,n),e=>TP.make({key:e}))}),DP=class extends G(H,U,EP).annotations({identifier:`PropertyKey`}){};Y({_tag:rM(z(`Pointer`,`Unexpected`,`Missing`,`Composite`,`Refinement`,`Transformation`,`Type`,`Forbidden`)).annotations({description:`The tag identifying the type of parse issue`}),path:rM(q(DP)).annotations({description:`The path to the property where the issue occurred`}),message:rM(H).annotations({description:`A descriptive message explaining the issue`})}).annotations({identifier:`ArrayFormatterIssue`,description:`Represents an issue returned by the ArrayFormatter formatter`});function OP(e){return e===`job_internal`||e===`job_runtime`}function kP(e){return e===`request`||e===`relaxed_request`||e===`request_internal`||e===`request_internal_dereferenced`||e===`landing_request`||e===`landing_request_internal`}function AP(e){return e===`request`||e===`relaxed_request`||e===`landing_request`}function jP(e){return e===`workflow_step_linked`}function MP(e){return e===`workflow_step_native`}function NP(e){return e===`landing_request`||e===`landing_request_internal`}function PP(e){return e===`workflow_step`||e===`workflow_step_linked`||e===`workflow_step_native`}function FP(e){return e===`test_case_xml`||e===`test_case_json`}function IP(e){return e===`request`||e===`relaxed_request`||e===`request_internal`||e===`landing_request`||e===`landing_request_internal`}var LP=new Map;function RP(e,t){LP.set(e,t)}var zP=G(Y({__class__:z(`ConnectedValue`)}),Y({__class__:z(`RuntimeValue`)})),BP=G(_N,H.pipe(Z(e=>{if(!/^-?\d+$/.test(e))return`String '${e}' is not a valid integer`}))),VP=G(U.pipe(ZM()),H.pipe(Z(e=>{if(isNaN(Number(e))||e.trim()===``)return`String '${e}' is not a valid number`})));function HP(e){return e.startsWith(`_`)?{name:`X${e}`,alias:e}:{name:e}}function UP(e,t){return OP(e)?!1:NP(e)?!0:!t}var WP=new Map;function GP(e,t){WP.set(e,t)}function KP(e,t){let n=e;for(let e of t){let t=WP.get(e.type);t&&(n=t(n,e))}return n}function qP(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t))o=BP,r.optional&&(o=K(o)),o=G(o,zP),s=!0;else{o=_N;let e=[...r.validators];(r.min!==null||r.max!==null)&&e.push({type:`in_range`,min:r.min,max:r.max,exclude_min:!1,exclude_max:!1,negate:!1}),o=KP(o,e),r.optional&&(o=K(o))}let c=UP(t,!r.optional&&r.value===null);return{name:i,alias:a,schema:o,isOptional:c,connectedValueHandled:s}}RP(`gx_integer`,qP);function JP(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t))o=VP,r.optional&&(o=K(o)),o=G(o,zP),s=!0;else{o=U.pipe(ZM());let e=[...r.validators];(r.min!==null||r.max!==null)&&e.push({type:`in_range`,min:r.min,max:r.max,exclude_min:!1,exclude_max:!1,negate:!1}),o=KP(o,e),r.optional&&(o=K(o))}let c=UP(t,!r.optional&&r.value===null);return{name:i,alias:a,schema:o,isOptional:c,connectedValueHandled:s}}RP(`gx_float`,JP);function YP(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t)){let e=G(W,z(`true`,`false`,`True`,`False`));r.optional&&(e=K(e)),o=G(e,zP),s=!0}else o=W;let c=UP(t,!1);return{name:i,alias:a,schema:o,isOptional:c,connectedValueHandled:s}}RP(`gx_boolean`,YP);function XP(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=H;o=KP(o,r.validators),(r.optional||t===`relaxed_request`)&&(o=K(o));let s=UP(t,!r.optional&&r.value===null);return{name:i,alias:a,schema:o,isOptional:s}}RP(`gx_text`,XP);function ZP(e,t,n){let{name:r,alias:i}=HP(e.name),a,o=!1;MP(t)?(a=G(H.pipe(kM(/^#[0-9a-fA-F]{6}$/)),zP),o=!0):a=H.pipe(kM(/^#[0-9a-fA-F]{6}$/));let s=UP(t,!1);return{name:r,alias:i,schema:a,isOptional:s,connectedValueHandled:o}}RP(`gx_color`,ZP);function QP(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=H;o=KP(o,r.validators);let s=!1;MP(t)?(o=G(o,zP),s=!0,r.optional||(o=K(o))):r.optional&&(o=K(o));let c=!r.optional&&r.value===null;MP(t)&&!r.optional&&(c=!1);let l=UP(t,c);return{name:i,alias:a,schema:o,isOptional:l,connectedValueHandled:s}}RP(`gx_hidden`,QP);function $P(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o;o=r.options&&r.options.length>0?G(...r.options.map(e=>z(e.value))):H;let s,c=!1;if(MP(t))s=r.multiple?G(q(o),H):o,(r.optional||r.multiple)&&(s=K(s)),s=G(s,zP),c=!0;else if(r.multiple){let e=o;if(jP(t)){let t=Y({__class__:z(`ConnectedValue`)});e=G(o,t),c=!0}s=t===`test_case_xml`?G(K(q(o)),H):K(q(e))}else s=r.optional?K(o):o;let l=UP(t,!1);return{name:i,alias:a,schema:s,isOptional:l,connectedValueHandled:c}}RP(`gx_select`,$P);function eF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=H.pipe(kM(/^gx[a-z]+:\/\//));o=KP(o,r.validators),r.optional&&(o=K(o));let s=UP(t,!r.optional&&r.value===null);return{name:i,alias:a,schema:o,isOptional:s}}RP(`gx_directory_uri`,eF);function tF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=H,s;s=r.multiple?K(q(o)):r.optional?K(o):o;let c=UP(t,!1);return{name:i,alias:a,schema:s,isOptional:c}}RP(`gx_genomebuild`,tF);function nF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=H;r.optional&&(o=K(o));let s=UP(t,!r.optional&&r.value===null);return{name:i,alias:a,schema:o,isOptional:s}}RP(`gx_baseurl`,nF);function rF(e){return e.test_parameter.parameter_type===`gx_boolean`}function iF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=HP(r.test_parameter.name),s=rF(r),c=MP(t),l=[],u=new Set(r.whens.map(e=>e.discriminator)),d=r.whens;if(s&&r.whens.length===1){let e=!u.has(!0);d=[...r.whens,{discriminator:e,parameters:[],is_default_when:!1}]}for(let e of d){let r=n.buildChildSchemaInfos(e.parameters,t);if(!r)throw Error(`Failed to build child schemas for conditional branch ${e.discriminator}`);let i=!OP(t)&&e.is_default_when,a;if(s&&c){let t=String(e.discriminator).toLowerCase();a=G(z(e.discriminator),z(t))}else a=z(e.discriminator);let u={name:o.name,alias:o.alias,schema:a,isOptional:i},d=n.assembleStruct([u,...r]);l.push(d)}return{name:i,alias:a,schema:l.length===1?l[0]:G(...l),isOptional:UP(t,!1)}}RP(`gx_conditional`,iF);function aF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=n.buildChildSchemaInfos(r.parameters,t);if(!o)throw Error(`Failed to build child schemas for section '${r.name}'`);return{name:i,alias:a,schema:n.assembleStruct(o),isOptional:UP(t,o.some(e=>!e.isOptional))}}RP(`gx_section`,aF);function oF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=n.buildChildSchemaInfos(r.parameters,t);if(!o)throw Error(`Failed to build child schemas for repeat '${r.name}'`);let s=q(n.assembleStruct(o));NP(t)||(r.min!==null&&r.min>0&&(s=s.pipe(VN(r.min))),r.max!==null&&(s=s.pipe(UN(r.max))));let c=UP(t,o.some(e=>!e.isOptional)&&r.min!==null&&r.min>0);return{name:i,alias:a,schema:s,isOptional:c}}RP(`gx_repeat`,oF);function sF(e,t){let n=[];for(let r of e){let e=r.options.length===0;(!t||e)&&n.push(r.value),n.push(...sF(r.options,t))}return n}function cF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o=r.hierarchy===`recurse`&&!r.multiple,s=sF(r.options,o),c;c=s.length>0?G(...s.map(e=>z(e))):H;let l;l=r.multiple?q(c):c;let u=UP(t,!0);return{name:i,alias:a,schema:l,isOptional:u}}RP(`gx_drill_down`,cF);function lF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t))o=zP,r.optional&&(o=K(o)),s=!0;else if(PP(t))o=Nj.annotations({jsonSchema:{not:{}}});else if(FP(t))o=G(Y({class:z(`File`),path:H}),Y({class:z(`File`),location:H}));else if(t===`job_runtime`){let e=Y({class:z(`File`),basename:H,location:H,path:H,nameroot:H,nameext:H,format:H,size:U,element_identifier:J(H)});o=r.multiple?q(e):e}else{let e=AP(t)?H:_N,n=Y({src:z(`hda`),id:e}),i=Y({src:z(`dce`),id:e}),a=Y({src:z(`url`),url:H,ext:H}),s=Y({src:z(`hdca`),id:e,map_over_type:J(K(H))}),c=Y({src:z(`dce`),id:e,map_over_type:J(K(H))}),l=Y({__class__:z(`Batch`),values:q(G(s,c))});if(r.multiple){let r=[n,Y({src:z(`hdca`),id:e})];IP(t)&&r.push(a);let i=G(...r),s=[i,q(i)];kP(t)&&s.push(l),o=G(...s)}else{let e=[n,i];IP(t)&&e.push(a),kP(t)&&e.push(l),o=G(...e)}}r.optional&&!PP(t)&&!s&&(o=K(o));let c;return c=t===`workflow_step`?!0:UP(t,!r.optional),{name:i,alias:a,schema:o,isOptional:c,connectedValueHandled:s}}RP(`gx_data`,lF);function uF(e){return e===`list`||e.startsWith(`list:`)||e===`sample_sheet`}function dF(e,t){return Y({class:z(`Collection`),name:H,collection_type:e,tags:q(V),elements:t,column_definitions:J(q(V)),has_single_item:J(W)})}function fF(e){let t=e.indexOf(`:`);if(t===-1)return e===`paired`?Y({forward:Ij,reverse:Ij}):uF(e)?q(V):X({key:H,value:V});let n=e.slice(t+1);return q(dF(z(n),fF(n)))}function pF(){let e=G(Y({class:z(`File`),identifier:H,path:H}),fM(()=>Y({class:z(`Collection`),collection_type:H,identifier:J(H),elements:q(e)})));return Y({class:z(`Collection`),collection_type:H,name:J(H),elements:q(e)})}function mF(e){if(e===null)return dF(H,G(q(V),X({key:H,value:V})));let t=e.split(`,`).map(e=>e.trim()).map(e=>dF(z(e),fF(e)));return t.length===1?t[0]:G(...t)}function hF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t))o=zP,r.optional&&(o=K(o)),s=!0;else if(PP(t))o=Nj.annotations({jsonSchema:{not:{}}});else if(FP(t))o=pF();else if(t===`job_runtime`)o=mF(r.collection_type);else{let e=AP(t)?H:_N,n=Y({src:z(`hdca`),id:e}),r=Y({class:z(`Collection`),collection_type:H,elements:q(V)}),i=[n];if(t===`job_internal`){let t=Y({src:z(`dce`),id:e});i.push(t)}t!==`request_internal_dereferenced`&&t!==`job_internal`&&i.push(r),o=i.length===1?i[0]:G(...i)}r.optional&&!PP(t)&&!s&&(o=K(o));let c;return c=t===`workflow_step`?!0:UP(t,!r.optional),{name:i,alias:a,schema:o,isOptional:c,connectedValueHandled:s}}RP(`gx_data_collection`,hF);function gF(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o,s=!1;if(MP(t))return o=r.multiple?G(q(BP),H):BP,r.optional&&(o=K(o)),o=G(o,zP),s=!0,{name:i,alias:a,schema:o,isOptional:!0,connectedValueHandled:s};o=r.multiple?t===`test_case_xml`?H:q(_N):_N,r.optional&&(o=K(o));let c=r.value!==null,l=UP(t,!r.optional&&!c);return{name:i,alias:a,schema:o,isOptional:l,connectedValueHandled:s}}RP(`gx_data_column`,gF);function _F(e,t,n){let r=e,{name:i,alias:a}=HP(r.name),o;o=r.multiple?q(H):H,r.optional&&(o=K(o));let s=UP(t,!r.optional);return{name:i,alias:a,schema:o,isOptional:s}}RP(`gx_group_tag`,_F),X({key:H,value:V}).pipe(Z(e=>{let t=e;if(typeof t.type!=`string`)return`type must be a string`;if(!Array.isArray(t.columns)||!t.columns.every(e=>Number.isInteger(e)))return`columns must be an integer array`},{jsonSchema:{type:`object`,required:[`type`,`columns`],properties:{type:{type:`string`},columns:{type:`array`,items:{type:`integer`}}}}}));var vF=X({key:H,value:V}).pipe(Z(e=>{let t=e;if(!Array.isArray(t.rules))return`rules must be an array`;if(!Array.isArray(t.mapping))return`mapping must be an array`;for(let e of t.mapping){if(!e||typeof e!=`object`)return`each mapping must be an object`;let t=e;if(typeof t.type!=`string`)return`each mapping must have type:string`;if(!Array.isArray(t.columns)||!t.columns.every(e=>Number.isInteger(e)))return`each mapping must have columns:int[]`}},{jsonSchema:{type:`object`,required:[`rules`,`mapping`],properties:{rules:{type:`array`,items:{type:`object`}},mapping:{type:`array`,items:{type:`object`,required:[`type`,`columns`],properties:{type:{type:`string`},columns:{type:`array`,items:{type:`integer`}}}}}}}}));function yF(e,t,n){let{name:r,alias:i}=HP(e.name),a=vF,o=!1;MP(t)&&(a=G(a,zP),o=!0);let s=UP(t,!0);return{name:r,alias:i,schema:a,isOptional:s,connectedValueHandled:o}}RP(`gx_rules`,yF);function bF(e,t){let n=t;if(n.negate){let t={};return n.min!=null&&(t[n.exclude_min?`exclusiveMinimum`:`minimum`]=n.min),n.max!=null&&(t[n.exclude_max?`exclusiveMaximum`:`maximum`]=n.max),e.pipe(Z(e=>{let t=!0;return n.min!=null&&(t&&=n.exclude_min?e>n.min:e>=n.min),n.max!=null&&(t&&=n.exclude_max?e<n.max:e<=n.max),!t},{jsonSchema:{not:t}}))}let r=e;return n.min!=null&&(r=n.exclude_min?r.pipe($M(n.min)):r.pipe(tN(n.min))),n.max!=null&&(r=n.exclude_max?r.pipe(aN(n.max)):r.pipe(sN(n.max))),r}GP(`in_range`,bF);function xF(e){let t=e.match(/^(\^?)\(\?([aiLmsux]+)\)/);if(!t)return{pattern:e,flags:``};let n=t[1],r=t[2],i=``;return r.includes(`i`)&&(i+=`i`),r.includes(`m`)&&(i+=`m`),r.includes(`s`)&&(i+=`s`),{pattern:n+e.slice(t[0].length),flags:i}}function SF(e){return e.replace(/\\\\|\\([^\\^$.*+?()[\]{}|dDwWsSnrtfv0cxupPkbB])/g,(e,t)=>t===void 0?e:t)}function CF(e){return e.replace(/\[\]\]/g,`[\\]]`)}function wF(e){let t=SF(e);t=CF(t);try{return new RegExp(t,`u`),t}catch{return null}}function TF(e){let{pattern:t,flags:n}=xF(e);try{return new RegExp(t,n)}catch{return null}}function EF(e,t){let n=t;if(n.negate){let t=TF(n.expression);return t?e.pipe(Z(e=>e===``||!t.test(e),{jsonSchema:{}})):e}let{pattern:r,flags:i}=xF(n.expression),a=r;a.startsWith(`^`)||(a=`^`+a);try{let t=new RegExp(a,i),n;if(i)n={jsonSchema:{}};else{let e=wF(a);n=e?{jsonSchema:{pattern:`(^$|${e})`}}:{jsonSchema:{}}}return e.pipe(Z(e=>e===``||t.test(e),n))}catch{return e}}GP(`regex`,EF);function DF(e,t){let n=t;if(n.negate){let t={};return n.min!=null&&(t.minLength=n.min),n.max!=null&&(t.maxLength=n.max),e.pipe(Z(e=>{let t=!0;return n.min!=null&&(t&&=e.length>=n.min),n.max!=null&&(t&&=e.length<=n.max),!t},{jsonSchema:{not:t}}))}let r=e;return n.min!=null&&(r=r.pipe(TM(n.min))),n.max!=null&&(r=r.pipe(CM(n.max))),r}GP(`length`,DF);function OF(e,t){let n=e.match(/^'([^']*)'\s+in\s+value$/);if(n)return t.includes(n[1]);let r=e.match(/^"([^"]*)"\s+in\s+value$/);if(r)return t.includes(r[1]);let i=e.match(/^value\s*==\s*['"]([^'"]*)['"]\s*$/);if(i)return t===i[1]}function kF(e,t){let n=t;return e.pipe(Z(e=>{let t=OF(n.expression,e);return t===void 0?!0:n.negate?!t:t},{jsonSchema:{}}))}GP(`expression`,kF);function AF(e,t){let n=t;return e.pipe(Z(e=>{let t=e.length===0;return n.negate?t:!t},{jsonSchema:{}}))}GP(`empty_field`,AF);function jF(e,t){return e}GP(`no_options`,jF);var MF=(e,t)=>{let n={},r=t?.target??`jsonSchema7`,i=PF(Dk(e.ast)&&eI(e.ast.from)?e.ast.to:e.ast,{definitions:n,target:r}),a={$schema:NF(r),$defs:{},...i};return Ci(n)?delete a.$defs:a.$defs=n,a};function NF(e){switch(e){case`jsonSchema7`:return`http://json-schema.org/draft-07/schema#`;case`jsonSchema2019-09`:return`https://json-schema.org/draft/2019-09/schema`;case`jsonSchema2020-12`:case`openApi3.1`:return`https://json-schema.org/draft/2020-12/schema`}}var PF=(e,t)=>{let n=t.definitionPath??`#/$defs/`,r=e=>n+e,i=t.target??`jsonSchema7`,a=t.topLevelReferenceStrategy??`keep`,o=t.additionalPropertiesStrategy??`strict`;return cI(e,t.definitions,`handle-identifier`,[],{getRef:r,target:i,topLevelReferenceStrategy:a,additionalPropertiesStrategy:o},`handle-annotation`,`handle-errors`)},FF={$id:`/schemas/never`,not:{}},IF={$id:`/schemas/any`},LF={$id:`/schemas/unknown`},RF={$id:`/schemas/void`},zF={$id:`/schemas/object`,anyOf:[{type:`object`},{type:`array`}]},BF={$id:`/schemas/%7B%7D`,anyOf:[{type:`object`},{type:`array`}]};function VF(e){if(e!==void 0)return li(vO(e))}function HF(e){if(e!==void 0)return li(hO(e))}function UF(e){return e===void 0?N():bO(e)}function WF(e,t){return CA(e,!1)(t)}function GF(e){if(e!==void 0)return li(yO(e))}function KF(e,t){let n=CA(e,!1),r=da(t,e=>n(e).pipe(_i(JF)));return r.length>0?r:void 0}function qF(e,t,n){if(t!==void 0)switch(e._tag){case`StringKeyword`:return t===KO.annotations[n]?void 0:t;case`NumberKeyword`:return t===JO.annotations[n]?void 0:t;case`BooleanKeyword`:return t===YO.annotations[n]?void 0:t}return t}function JF(e,t=new Set){if(e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return!0;if(Array.isArray(e)||typeof e==`object`){if(t.has(e))return!1;t.add(e);try{if(Array.isArray(e))return e.every(e=>JF(e,t));let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype||Object.getOwnPropertySymbols(e).length>0?!1:Object.values(e).every(e=>JF(e,t))}finally{t.delete(e)}}return!1}function YF(e,t,n,r,i){let a={};if(t!==void 0&&(a.description=t),n!==void 0&&(a.title=n),ni(r)){let t=WF(e,r.value);ni(t)&&JF(t.value)&&(a.default=t.value)}if(i!==void 0){let t=KF(e,i);t!==void 0&&(a.examples=t)}if(Object.keys(a).length!==0)return a}function XF(e,t){return YF(e,VF(t),HF(t),UF(t),GF(t))}function ZF(e){return YF(e,qF(e,VF(e),XD),qF(e,HF(e),JD),UF(e),GF(e))}function QF(e,t){return t?`$ref`in e?{allOf:[e],...t}:{...e,...t}:e}var $F=e=>{if(ti(xO(e)))return Qk(e,$F,e=>$F(e.from))},eI=e=>e.annotations[WD]===NO,tI=(e,t)=>wk(e)&&e.annotations[WD]===AD?`type`in t&&t.type!==`integer`:`type`in t||`oneOf`in t||`anyOf`in t||`$ref`in t,nI=(e,t,n)=>{let r={...e,...ZF(n),...t};r.allOf??=[];let i=(n,i)=>{n in t&&n in e&&(r.allOf.unshift({[n]:e[n]}),r.allOf=r.allOf.filter(i))};return i(`minLength`,e=>e.minLength>t.minLength),i(`maxLength`,e=>e.maxLength<t.maxLength),i(`pattern`,e=>e.pattern!==t.pattern),i(`minItems`,e=>e.minItems>t.minItems),i(`maxItems`,e=>e.maxItems<t.maxItems),i(`minimum`,e=>e.minimum>t.minimum),i(`maximum`,e=>e.maximum<t.maximum),i(`exclusiveMinimum`,e=>e.exclusiveMinimum>t.exclusiveMinimum),i(`exclusiveMaximum`,e=>e.exclusiveMaximum<t.exclusiveMaximum),i(`multipleOf`,e=>e.multipleOf!==t.multipleOf),r.allOf.length===0&&delete r.allOf,r};function rI(e){switch(e.target){case`jsonSchema7`:return!1;case`jsonSchema2019-09`:case`jsonSchema2020-12`:case`openApi3.1`:return!0}}function iI(e){switch(e.additionalPropertiesStrategy){case`allow`:return!0;case`strict`:return!1}}function aI(e,t){return oI(e,ZF(t))}function oI(e,t){return t===void 0||Object.keys(t).length===0?e:`$ref`in e?{allOf:[e],...t}:{...e,...t}}function sI(e){let t=li(MO(e));if(t===void 0){if(Sk(e))return sI(e.f());if(Dk(e)&&dk(e.from)&&IO(e.to)){let t=e.to;if(ni(DO(t)))return sI(t)}}return t}function cI(e,t,n,r,i,a,o){if(n===`handle-identifier`&&(i.topLevelReferenceStrategy!==`skip`||Sk(e))){let n=sI(e);if(n!==void 0){let a=n.replace(/~/gi,`~0`).replace(/\//gi,`~1`),s={$ref:i.getRef(a)};return wi(t,n)||(t[n]=s,t[n]=cI(e,t,`ignore-identifier`,r,i,`handle-annotation`,o)),s}}if(a===`handle-annotation`){let a=xO(e);if(ni(a)){let s=a.value;if(tI(e,s))switch(e._tag){case`Declaration`:return aI(s,e);default:return s}else switch(e._tag){case`Refinement`:{let a=Uk(e);return a===void 0?nI(cI(e.from,t,n,r,i,`handle-annotation`,o),s,e):cI(a,t,n,r,i,`handle-annotation`,o)}default:return{...cI(e,t,n,r,i,`ignore-annotation`,o),...s}}}}let s=DO(e);if(ni(s))return cI(s.value,t,n,r,i,`handle-annotation`,o);switch(e._tag){case`Declaration`:case`UndefinedKeyword`:case`BigIntKeyword`:case`UniqueSymbol`:case`SymbolKeyword`:if(o===`ignore-errors`)return aI(IF,e);throw Error(mD(r,e));case`Suspend`:if(n===`handle-identifier`){if(o===`ignore-errors`)return aI(IF,e);throw Error(hD(r,e))}return cI(e.f(),t,`ignore-identifier`,r,i,`handle-annotation`,o);case`NeverKeyword`:return aI(FF,e);case`VoidKeyword`:return aI(RF,e);case`UnknownKeyword`:return aI(LF,e);case`AnyKeyword`:return aI(IF,e);case`ObjectKeyword`:return aI(zF,e);case`StringKeyword`:return aI({type:`string`},e);case`NumberKeyword`:return aI({type:`number`},e);case`BooleanKeyword`:return aI({type:`boolean`},e);case`Literal`:{let t=e.literal;if(t===null)return aI({type:`null`},e);if(Nt(t))return aI({type:`string`,enum:[t]},e);if(Pt(t))return aI({type:`number`,enum:[t]},e);if(Ft(t))return aI({type:`boolean`,enum:[t]},e);if(o===`ignore-errors`)return aI(IF,e);throw Error(mD(r,e))}case`Enums`:{let t=e.enums.map(e=>({type:Pt(e[1])?`number`:`string`,title:e[0],enum:[e[1]]}));return t.length>=1?aI({$comment:`/schemas/enums`,anyOf:t},e):aI(FF,e)}case`TupleType`:{let n=e.elements.map((e,n)=>QF(cI(e.type,t,`handle-identifier`,r.concat(n),i,`handle-annotation`,o),XF(e.type,e))),a=e.rest.map(e=>QF(cI(e.type,t,`handle-identifier`,r,i,`handle-annotation`,o),XF(e.type,e))),s={type:`array`},c=e.elements.length;c>0&&(s.minItems=c-e.elements.filter(e=>e.isOptional).length,i.target===`jsonSchema7`?s.items=n:s.prefixItems=n);let l=a.length;if(l>0){let t=a[0];if(l===1&&e.elements.every(t=>t.type===e.rest[0].type)?i.target===`jsonSchema7`?s.items=t:(s.items=t,delete s.prefixItems):i.target===`jsonSchema7`?s.additionalItems=t:s.items=t,l>1){if(o===`ignore-errors`)return aI(IF,e);throw Error(gD(r))}}else c>0?i.target===`jsonSchema7`?s.additionalItems=!1:s.items=!1:s.maxItems=0;return aI(s,e)}case`TypeLiteral`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return aI(BF,e);let n={type:`object`,required:[],properties:{},additionalProperties:iI(i)},a,s;for(let c of e.indexSignatures){let e=$F(c.type)??c.type,l=c.parameter;switch(l._tag){case`StringKeyword`:n.additionalProperties=cI(e,t,`handle-identifier`,r,i,`handle-annotation`,o);break;case`TemplateLiteral`:a=cI(e,t,`handle-identifier`,r,i,`handle-annotation`,o),s={type:`string`,pattern:Lk(l).source};break;case`Refinement`:a=cI(e,t,`handle-identifier`,r,i,`handle-annotation`,o),s=cI(l,t,`handle-identifier`,r,i,`handle-annotation`,o);break;case`SymbolKeyword`:{let a=r.concat(`[symbol]`);n.additionalProperties=cI(e,t,`handle-identifier`,a,i,`handle-annotation`,o),s=cI(l,t,`handle-identifier`,a,i,`handle-annotation`,o);break}}}for(let a=0;a<e.propertySignatures.length;a++){let s=e.propertySignatures[a],c=s.name;if(Nt(c)){let e=$F(s.type),a=e??s.type;n.properties[c]=QF(cI(a,t,`handle-identifier`,r.concat(s.name),i,`handle-annotation`,o),XF(a,s)),!s.isOptional&&e===void 0&&n.required.push(c)}else{if(o===`ignore-errors`)return aI(IF,e);throw Error(_D(c,r))}}return a!==void 0&&(delete n.additionalProperties,n.patternProperties={"":a}),s!==void 0&&(n.propertyNames=s),aI(n,e)}case`Union`:{let n=hI(e.types.map(e=>cI(e,t,`handle-identifier`,r,i,`handle-annotation`,o)));switch(n.length){case 0:return FF;case 1:return aI(n[0],e);default:return aI({anyOf:n},e)}}case`Refinement`:return cI(e.from,t,n,r,i,`handle-annotation`,o);case`TemplateLiteral`:{let t=Lk(e);return aI({type:`string`,title:String(e),description:`a template literal`,pattern:t.source},e)}case`Transformation`:{if(eI(e.from)){let a={type:`string`,contentMediaType:`application/json`};return rI(i)&&(a.contentSchema=cI(e.to,t,n,r,i,`handle-annotation`,o)),a}let a=cI(e.from,t,n,r,i,`handle-annotation`,o);if(e.transformation._tag===`TypeLiteralTransformation`&&lI(a)){let t=cI(e.to,{},`ignore-identifier`,r,i,`handle-annotation`,`ignore-errors`);if(lI(t))for(let n of e.transformation.propertySignatureTransformations){let e=n.to,r=n.from;if(Nt(e)&&Nt(r)){let n=t.properties[e];if(Yt(n)){let e=a.properties[r];if(Yt(e)){let t={};Nt(n.title)&&(t.title=n.title),Nt(n.description)&&(t.description=n.description),Array.isArray(n.examples)&&(t.examples=n.examples),Object.hasOwn(n,`default`)&&n.default!==void 0&&(t.default=n.default),a.properties[r]=oI(e,t)}}}}}return aI(a,e)}}}function lI(e){return Yt(e)&&e.type===`object`&&Yt(e.properties)}function uI(e){return e===FF||C(e,`$id`)&&e.$id===FF.$id&&Object.keys(e).length===3&&e.title===HO.annotations[JD]}function dI(e){return`$id`in e&&e.$id===IF.$id}function fI(e){return`$id`in e&&e.$id===LF.$id}function pI(e){return`$id`in e&&e.$id===RF.$id}function mI(e){return C(e,`enum`)&&`type`in e&&Object.keys(e).length===2}function hI(e){let t=[];for(let n of e)if(!uI(n)){if(dI(n)||fI(n)||pI(n))return[n];if(mI(n)&&t.length>0){let e=t[t.length-1];if(mI(e)&&e.type===n.type){t[t.length-1]={type:e.type,enum:[...e.enum,...n.enum]};continue}}t.push(n)}return t}var gI=Y({format:H,content:H}),_I=Y({value:H,type:H}),vI=Y({type:H,content:H}),yI=z(`pattern`,`tool_provided_metadata`),bI=z(`filename`,`name`,`designation`,`dbkey`),xI=z(`lexical`,`numeric`),SI=Y({discover_via:yI,format:K(H),visible:W,assign_primary_output:W,directory:K(H),recurse:W,match_relative_path:W}),CI=Y({...SI.fields,discover_via:z(`tool_provided_metadata`)}),wI=G(Y({...SI.fields,discover_via:z(`pattern`),sort_key:bI,sort_comp:xI,sort_reverse:W,pattern:H}),CI),TI=Y({name:H,label:K(H),hidden:W}),EI=Y({...TI.fields,type:z(`data`),format:H,format_source:K(H),metadata_source:K(H),discover_datasets:K(q(wI)),from_work_dir:K(H),precreate_directory:W}),DI=Y({collection_type:K(H),collection_type_source:K(H),collection_type_from_rules:K(H),structured_like:K(H),discover_datasets:K(q(wI))}),OI=G(EI,Y({...TI.fields,type:z(`collection`),structure:DI}),Y({...TI.fields,type:z(`text`)}),Y({...TI.fields,type:z(`integer`)}),Y({...TI.fields,type:z(`float`)}),Y({...TI.fields,type:z(`boolean`)})),kI=yM(K(H),K(H),{decode:e=>e===``?null:e,encode:e=>e}),AI=kj(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).annotations({jsonSchema:{type:`object`}}),jI=Y({id:H,version:K(H),name:H,description:kI,inputs:q(AI),outputs:q(OI),citations:q(vI),license:K(H),profile:K(H),edam_operations:q(H),edam_topics:q(H),xrefs:q(_I),help:J(G(gI,B))});MF(jI,{target:`jsonSchema2020-12`});var MI=z(`null`,`boolean`,`int`,`long`,`float`,`double`,`string`),NI=z(`null`,`boolean`,`int`,`long`,`float`,`double`,`string`,`integer`,`text`,`File`,`data`,`collection`),PI=z(`tool`,`subworkflow`,`pause`,`pick_value`),FI=Y({doc:J(G(B,H,q(H)))}),II=Y({symbols:q(H),type:z(`enum`)}),LI=Y({fields:J(G(B,q(fM(()=>zI).annotations({identifier:`RecordFieldSchema`})))),type:z(`record`)}),RI=Y({items:G(MI,LI,II,fM(()=>RI).annotations({identifier:`ArraySchemaSchema`}),H,q(G(MI,LI,II,fM(()=>RI).annotations({identifier:`ArraySchemaSchema`}),H))),type:z(`array`)}),zI=Y({...FI.fields,name:H,type:G(MI,LI,II,RI,H,q(G(MI,LI,II,RI,H)))}),BI=Y({label:J(G(B,H))}),VI=Y({id:J(G(B,H))}),HI=Y({...BI.fields,...FI.fields,...VI.fields}),UI=Y({...HI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V))}),WI=Y({...HI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H)))}),GI=Y({top:U,left:U}),KI=Y({position:J(G(B,GI))}),qI=Y({...UI.fields,...KI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),optional:J(G(W,B))}),JI=Y({min:J(G(U,B)),max:J(G(U,B))}),YI=Y({...qI.fields,...JI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),type:z(`float`)}),XI=Y({...qI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),type:z(`boolean`)}),ZI=Y({name:H,type:G(z(`File`,`null`,`boolean`,`int`,`float`,`string`),q(z(`File`,`null`,`boolean`,`int`,`float`,`string`))),format:J(G(B,H))}),QI=Y({name:H,description:J(G(B,H)),type:z(`string`,`int`,`float`,`boolean`,`element_identifier`),optional:W,default_value:J(G(B,H,U,W)),validators:J(G(B,q(V))),restrictions:J(G(B,q(G(H,U,U,W)))),suggestions:J(G(B,q(G(H,U,U,W))))}),$I=Y({...qI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),format:J(G(B,q(H)))}),eL=Y({...$I.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),optional:J(G(W,B)),type:z(`collection`),collection_type:J(G(B,H)),column_definitions:J(G(B,q(QI))),fields:J(G(B,q(ZI)))}),tL=Y({...qI.fields,...JI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),type:z(`integer`,`int`)}),nL=Y({...$I.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),optional:J(G(W,B)),type:J(G(z(`data`,`File`),B))}),rL=Y({value:H,label:J(G(B,H))}),iL=Y({...qI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),type:z(`text`,`string`),restrictions:J(G(B,q(G(H,rL)))),suggestions:J(G(B,q(G(H,rL)))),restrictOnConnections:J(G(B,W))}),aL=Y({...WI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),outputSource:J(G(B,H)),type:J(G(B,NI))}),oL=Y({...VI.fields,...BI.fields,...FI.fields,inputs:G(q(G(nL,eL,tL,YI,iL,XI)),X({key:H,value:G(nL,eL,tL,YI,iL,XI,H)}),X({key:H,value:V})),outputs:G(q(aL),X({key:H,value:G(aL,H)}),X({key:H,value:V}))}),sL=Y({uuid:J(G(B,H))}),cL=Y({errors:J(G(B,H))}),lL=Y({name:H,changeset_revision:H,owner:H,tool_shed:H}),uL=Y({tool_id:J(G(B,H)),tool_shed_repository:J(G(B,lL)),tool_version:J(G(B,H))});Y({...$I.fields,...JI.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,GI)),optional:J(G(W,B)),type:J(G(NI,B,q(NI))),collection_type:J(G(B,H)),column_definitions:J(G(B,q(QI))),fields:J(G(B,q(ZI))),restrictions:J(G(B,q(G(H,rL)))),suggestions:J(G(B,q(G(H,rL)))),restrictOnConnections:J(G(B,W))});var dL=Y({...VI.fields,add_tags:J(G(B,q(H))),change_datatype:J(G(B,H)),delete_intermediate_datasets:J(G(B,W)),hide:J(G(B,W)),remove_tags:J(G(B,q(H))),rename:J(G(B,H)),set_columns:J(G(X({key:H,value:V}),B))}),fL=Y({source:J(G(B,H,q(H)))}),pL=Y({...VI.fields,...fL.fields,...BI.fields,default:J(G(B,V))}),mL=Y({name:J(G(B,H)),identifier:J(G(B,H)),url:J(G(B,H)),email:J(G(B,H)),image:J(G(B,H)),address:J(G(B,H)),alternateName:J(G(B,H)),telephone:J(G(B,H)),faxNumber:J(G(B,H))}),hL=Y({...mL.fields,class:z(`Organization`)}),gL=Y({markdown:H}),_L=Y({position:J(G(q(U),B)),size:J(G(q(U),B)),color:J(G(B,H)),label:J(G(B,H))}),vL=Y({..._L.fields,type:z(`markdown`),text:J(G(B,H))}),yL=Y({...mL.fields,class:z(`Person`),givenName:J(G(B,H)),familyName:J(G(B,H)),honorificPrefix:J(G(B,H)),honorificSuffix:J(G(B,H)),jobTitle:J(G(B,H))}),bL=Y({..._L.fields,type:z(`frame`),title:J(G(B,H)),contains_steps:J(G(B,q(G(H,U)))),contains_comments:J(G(B,q(G(H,U))))}),xL=Y({..._L.fields,type:z(`freehand`),thickness:J(G(B,U)),line:J(G(q(q(U)),B))}),SL=Y({..._L.fields,type:z(`text`),text:J(G(B,H)),bold:J(G(B,W)),italic:J(G(B,W)),text_size:J(G(B,U))}),CL=Y({...oL.fields,...sL.fields,id:J(G(B,H)),class:z(`GalaxyWorkflow`),label:J(G(B,H)),doc:J(G(B,H,q(H))),steps:G(q(fM(()=>wL).annotations({identifier:`WorkflowStepSchema`})),X({key:H,value:fM(()=>wL).annotations({identifier:`WorkflowStepSchema`})})),report:J(G(B,gL)),tags:J(G(q(H),B)),comments:J(G(q(G(SL,vL,bL,xL)),X({key:H,value:G(SL,vL,bL,xL)}),B)),creator:J(G(q(G(yL,hL)),B)),license:J(G(B,H)),release:J(G(B,H))}),wL=Y({...VI.fields,...BI.fields,...FI.fields,...KI.fields,...uL.fields,...cL.fields,...sL.fields,in:J(G(q(pL),X({key:H,value:G(pL,H,q(H))}),B)),out:J(G(q(G(dL,H)),X({key:H,value:G(dL,H)}),B)),state:J(G(X({key:H,value:V}),B)),tool_state:J(G(H,X({key:H,value:V}),B)),post_job_actions:J(G(X({key:H,value:V}),B)),type:J(G(B,PI)),run:J(G(CL,H,X({key:H,value:V}),B)),runtime_inputs:J(G(B,q(H))),when:J(G(B,H))}),TL=z(`null`,`boolean`,`int`,`long`,`float`,`double`,`string`),EL=z(`null`,`boolean`,`int`,`long`,`float`,`double`,`string`,`integer`,`text`,`File`,`data`,`collection`),DL=z(`tool`,`subworkflow`,`pause`,`pick_value`),OL=Y({doc:J(G(B,H,q(H)))}),kL=Y({symbols:q(H),type:z(`enum`)}),AL=Y({fields:J(G(B,q(fM(()=>ML).annotations({identifier:`RecordFieldSchema`})))),type:z(`record`)}),jL=Y({items:G(TL,AL,kL,fM(()=>jL).annotations({identifier:`ArraySchemaSchema`}),H,q(G(TL,AL,kL,fM(()=>jL).annotations({identifier:`ArraySchemaSchema`}),H))),type:z(`array`)}),ML=Y({...OL.fields,name:H,type:G(TL,AL,kL,jL,H,q(G(TL,AL,kL,jL,H)))}),NL=Y({label:J(G(B,H))}),PL=Y({id:J(G(B,H))}),FL=Y({...NL.fields,...OL.fields,...PL.fields}),IL=Y({...FL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V))}),LL=Y({...Y({...FL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H)))}).fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),outputSource:J(G(B,H)),type:J(G(B,EL))}),RL=Y({top:U,left:U}),zL=Y({position:J(G(B,RL))}),BL=Y({...IL.fields,...zL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),optional:J(G(W,B))}),VL=Y({...BL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),type:z(`boolean`)}),HL=Y({...BL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),format:J(G(B,q(H)))}),UL=Y({...HL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),optional:J(G(W,B)),type:J(G(z(`data`,`File`),B))}),WL=Y({name:H,type:G(z(`File`,`null`,`boolean`,`int`,`float`,`string`),q(z(`File`,`null`,`boolean`,`int`,`float`,`string`))),format:J(G(B,H))}),GL=Y({name:H,description:J(G(B,H)),type:z(`string`,`int`,`float`,`boolean`,`element_identifier`),optional:W,default_value:J(G(B,H,U,W)),validators:J(G(B,q(V))),restrictions:J(G(B,q(G(H,U,U,W)))),suggestions:J(G(B,q(G(H,U,U,W))))}),KL=Y({...HL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),optional:J(G(W,B)),type:z(`collection`),collection_type:J(G(B,H)),column_definitions:J(G(B,q(GL))),fields:J(G(B,q(WL)))}),qL=Y({min:J(G(U,B)),max:J(G(U,B))}),JL=Y({...BL.fields,...qL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),type:z(`float`)}),YL=Y({value:H,label:J(G(B,H))}),XL=Y({...BL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),type:z(`text`,`string`),restrictions:J(G(B,q(G(H,YL)))),suggestions:J(G(B,q(G(H,YL)))),restrictOnConnections:J(G(B,W))}),ZL=Y({...BL.fields,...qL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),type:z(`integer`,`int`)}),QL=Y({...PL.fields,...NL.fields,...OL.fields,inputs:G(q(G(UL,KL,ZL,JL,XL,VL)),X({key:H,value:G(UL,KL,ZL,JL,XL,VL,H)}),X({key:H,value:V})),outputs:G(q(LL),X({key:H,value:G(LL,H)}),X({key:H,value:V}))}),$L=Y({uuid:J(G(B,H))}),eR=Y({errors:J(G(B,H))}),tR=Y({name:H,changeset_revision:H,owner:H,tool_shed:H}),nR=Y({tool_id:J(G(B,H)),tool_shed_repository:J(G(B,tR)),tool_version:J(G(B,H))});Y({...HL.fields,...qL.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),default:J(G(B,V)),position:J(G(B,RL)),optional:J(G(W,B)),type:J(G(EL,B,q(EL))),collection_type:J(G(B,H)),column_definitions:J(G(B,q(GL))),fields:J(G(B,q(WL))),restrictions:J(G(B,q(G(H,YL)))),suggestions:J(G(B,q(G(H,YL)))),restrictOnConnections:J(G(B,W))});var rR=Y({...PL.fields,add_tags:J(G(B,q(H))),change_datatype:J(G(B,H)),delete_intermediate_datasets:J(G(B,W)),hide:J(G(B,W)),remove_tags:J(G(B,q(H))),rename:J(G(B,H)),set_columns:J(G(X({key:H,value:V}),B))}),iR=Y({name:J(G(B,H)),identifier:J(G(B,H)),url:J(G(B,H)),email:J(G(B,H)),image:J(G(B,H)),address:J(G(B,H)),alternateName:J(G(B,H)),telephone:J(G(B,H)),faxNumber:J(G(B,H))}),aR=Y({...iR.fields,class:z(`Organization`)}),oR=Y({position:J(G(q(U),B)),size:J(G(q(U),B)),color:J(G(B,H)),label:J(G(B,H))}),sR=Y({...oR.fields,type:z(`text`),text:J(G(B,H)),bold:J(G(B,W)),italic:J(G(B,W)),text_size:J(G(B,U))}),cR=Y({...oR.fields,type:z(`freehand`),thickness:J(G(B,U)),line:J(G(q(q(U)),B))}),lR=Y({...iR.fields,class:z(`Person`),givenName:J(G(B,H)),familyName:J(G(B,H)),honorificPrefix:J(G(B,H)),honorificSuffix:J(G(B,H)),jobTitle:J(G(B,H))}),uR=Y({markdown:H}),dR=Y({...oR.fields,type:z(`frame`),title:J(G(B,H)),contains_steps:J(G(B,q(G(H,U)))),contains_comments:J(G(B,q(G(H,U))))}),fR=Y({...oR.fields,type:z(`markdown`),text:J(G(B,H))}),pR=Y({...QL.fields,...$L.fields,id:J(G(B,H)),class:z(`GalaxyWorkflow`),label:J(G(B,H)),doc:J(G(B,H,q(H))),steps:G(q(fM(()=>gR).annotations({identifier:`WorkflowStepSchema`})),X({key:H,value:fM(()=>gR).annotations({identifier:`WorkflowStepSchema`})})),report:J(G(B,uR)),tags:J(G(q(H),B)),comments:J(G(q(G(sR,fR,dR,cR)),X({key:H,value:G(sR,fR,dR,cR)}),B)),creator:J(G(q(G(lR,aR)),B)),license:J(G(B,H)),release:J(G(B,H))}),mR=Y({source:J(G(B,H,q(H)))}),hR=Y({...PL.fields,...mR.fields,...NL.fields,default:J(G(B,V))}),gR=Y({...PL.fields,...NL.fields,...OL.fields,...zL.fields,...nR.fields,...eR.fields,...$L.fields,in:J(G(q(hR),X({key:H,value:G(hR,H,q(H))}),B)),out:J(G(q(G(rR,H)),X({key:H,value:G(rR,H)}),B)),state:J(G(X({key:H,value:V}),B)),tool_state:J(G(H,X({key:H,value:V}),B)),post_job_actions:J(G(X({key:H,value:V}),B)),type:J(G(B,DL)),run:J(G(pR,H,X({key:H,value:V}),B)),runtime_inputs:J(G(B,q(H))),when:J(G(B,H))}),_R=Y({...gR.fields,id:J(G(B,H)),label:J(G(B,H)),doc:J(G(B,H,q(H))),position:J(G(B,RL)),tool_id:J(G(B,H)),tool_shed_repository:J(G(B,tR)),tool_version:J(G(B,H)),errors:J(G(B,H)),uuid:J(G(B,H)),_plan_state:J(G(B,H)),_plan_context:J(G(B,H)),_plan_in:J(G(B,H)),_plan_out:J(G(B,H))});Y({...QL.fields,...$L.fields,id:J(G(B,H)),class:z(`GalaxyWorkflowDraft`),label:J(G(B,H)),doc:J(G(B,H,q(H))),steps:G(q(_R),X({key:H,value:_R})),report:J(G(B,uR)),tags:J(G(q(H),B)),comments:J(G(q(G(sR,fR,dR,cR)),X({key:H,value:G(sR,fR,dR,cR)}),B)),creator:J(G(q(G(lR,aR)),B)),license:J(G(B,H)),release:J(G(B,H))});var vR=z(`null`,`boolean`,`int`,`long`,`float`,`double`,`string`),yR=z(`data_input`,`data_collection_input`,`parameter_input`,`tool`,`subworkflow`,`pause`,`pick_value`),bR=Y({doc:J(G(B,H,q(H)))}),xR=Y({symbols:q(H),type:z(`enum`)}),SR=Y({fields:J(G(B,q(fM(()=>wR).annotations({identifier:`RecordFieldSchema`})))),type:z(`record`)}),CR=Y({items:G(vR,SR,xR,fM(()=>CR).annotations({identifier:`ArraySchemaSchema`}),H,q(G(vR,SR,xR,fM(()=>CR).annotations({identifier:`ArraySchemaSchema`}),H))),type:z(`array`)}),wR=Y({...bR.fields,name:H,type:G(vR,SR,xR,CR,H,q(G(vR,SR,xR,CR,H)))}),TR=Y({uuid:J(G(B,H))}),ER=Y({errors:J(G(B,H))}),DR=Y({top:U,left:U}),OR=Y({position:J(G(B,DR))}),kR=Y({name:H,changeset_revision:H,owner:H,tool_shed:H}),AR=Y({tool_id:J(G(B,H)),tool_shed_repository:J(G(B,kR)),tool_version:J(G(B,H))});Y({name:H,description:J(G(B,H)),type:z(`string`,`int`,`float`,`boolean`,`element_identifier`),optional:W,default_value:J(G(B,H,U,W)),validators:J(G(B,q(V))),restrictions:J(G(B,q(G(H,U,U,W)))),suggestions:J(G(B,q(G(H,U,U,W))))}),Y({name:H,type:G(z(`File`,`null`,`boolean`,`int`,`float`,`string`),q(z(`File`,`null`,`boolean`,`int`,`float`,`string`))),format:J(G(B,H))}),Y({value:H,label:J(G(B,H))});var jR=Y({name:H,description:J(G(B,H))}),MR=Y({name:H,type:J(G(B,H))}),NR=Y({label:J(G(B,H)),output_name:H,uuid:J(G(B,H))}),PR=Y({id:U,output_name:H,input_subworkflow_step_id:J(G(B,U))}),FR=Y({action_type:H,output_name:J(G(H,B)),action_arguments:J(G(X({key:H,value:V}),B))}),IR=Y({text:J(G(B,H)),bold:J(G(B,W)),italic:J(G(B,W)),size:J(G(B,U))}),LR=Y({text:J(G(B,H))}),RR=Y({title:J(G(B,H))}),zR=Y({line:J(G(q(q(U)),B)),thickness:J(G(B,U))}),BR=Y({id:U,position:J(G(q(U),B)),size:J(G(q(U),B)),color:J(G(B,H))}),VR=Y({...BR.fields,type:z(`text`),data:J(G(B,IR))}),HR=Y({...BR.fields,type:z(`markdown`),data:J(G(B,LR))}),UR=Y({...BR.fields,type:z(`frame`),data:J(G(B,RR)),child_steps:J(G(B,q(U))),child_comments:J(G(B,q(U)))}),WR=Y({...BR.fields,type:z(`freehand`),data:J(G(B,zR))}),GR=Y({name:J(G(B,H)),identifier:J(G(B,H)),url:J(G(B,H)),email:J(G(B,H)),image:J(G(B,H)),address:J(G(B,H)),alternateName:J(G(B,H)),telephone:J(G(B,H)),faxNumber:J(G(B,H))}),KR=Y({...GR.fields,class:z(`Organization`)}),qR=Y({...GR.fields,class:z(`Person`),givenName:J(G(B,H)),familyName:J(G(B,H)),honorificPrefix:J(G(B,H)),honorificSuffix:J(G(B,H)),jobTitle:J(G(B,H))}),JR=Y({markdown:H}),YR=Y({url:J(G(B,H)),trs_tool_id:J(G(B,H)),trs_version_id:J(G(B,H)),trs_server:J(G(B,H)),trs_url:J(G(B,H))}),XR=Y({...TR.fields,name:J(G(B,H)),class:z(`NativeGalaxyWorkflow`),a_galaxy_workflow:z(`true`),"format-version":z(`0.1`),annotation:J(G(B,H)),tags:J(G(B,q(H))),version:J(G(B,U)),license:J(G(B,H)),release:J(G(B,H)),creator:J(G(q(G(qR,KR)),B)),report:J(G(B,JR)),readme:J(G(B,H)),help:J(G(B,H)),logo_url:J(G(B,H)),doi:J(G(B,q(H))),source_metadata:J(G(B,YR)),comments:J(G(q(G(VR,HR,UR,WR)),B)),steps:J(G(X({key:H,value:fM(()=>ZR).annotations({identifier:`NativeStepSchema`})}),B)),subworkflows:J(G(X({key:H,value:fM(()=>XR).annotations({identifier:`NativeGalaxyWorkflowSchema`})}),B))}),ZR=Y({...ER.fields,...OR.fields,...TR.fields,...AR.fields,name:J(G(B,H)),id:J(G(B,U)),type:J(G(B,yR)),label:J(G(B,H)),annotation:J(G(B,H)),when:J(G(B,H)),content_id:J(G(B,H)),tool_state:J(G(H,X({key:H,value:V}),B)),tool_uuid:J(G(B,H)),input_connections:J(G(X({key:H,value:G(PR,q(PR))}),B)),inputs:J(G(B,q(jR))),outputs:J(G(B,q(MR))),workflow_outputs:J(G(B,q(NR))),post_job_actions:J(G(X({key:H,value:FR}),B)),subworkflow:J(G(XR,B)),tool_representation:J(G(X({key:H,value:V}),B)),in:J(G(X({key:H,value:V}),B))}),QR=Y({tool_id:H,tool_version:K(H)}),$R=Y({name:J(K(H)),a_galaxy_workflow:H,"format-version":H,annotation:J(K(H)),tags:q(H),version:J(K(U)),license:J(K(H)),release:J(K(H)),uuid:J(K(H)),steps:X({key:H,value:fM(()=>ez)}),unique_tools:mP(QR)}),ez=Y({id:U,name:J(K(H)),type:J(K(yR)),label:J(K(H)),annotation:J(K(H)),when:J(K(H)),content_id:J(K(H)),tool_state:X({key:H,value:V}),tool_id:J(K(H)),tool_version:J(K(H)),tool_shed_repository:J(K(kR)),uuid:J(K(H)),errors:J(K(H)),position:J(K(DR)),input_connections:X({key:H,value:q(V)}),inputs:q(jR),outputs:q(MR),workflow_outputs:q(NR),post_job_actions:X({key:H,value:FR}),subworkflow:J(K($R)),tool_uuid:J(K(H)),tool_representation:J(K(X({key:H,value:V}))),in:J(K(X({key:H,value:V}))),connected_paths:mP(H)});function tz(e){let t=e,n=nz(t.steps),r=sz(t.tags),i=cz(n),a={name:t.name,a_galaxy_workflow:t.a_galaxy_workflow??`true`,"format-version":t[`format-version`]??`0.1`,annotation:t.annotation,tags:r,version:t.version,license:t.license,release:t.release,uuid:t.uuid,steps:n,unique_tools:i};return t.comments!=null&&(a.comments=t.comments),a}function nz(e){let t={};if(!e)return t;for(let[n,r]of Object.entries(e))t[n]=rz(r);return t}function rz(e){let t=az(e.tool_state),n=oz(e.input_connections),r=new Set(Object.keys(n)),i=null;return e.subworkflow!=null&&(i=tz(e.subworkflow)),{id:e.id??0,name:e.name,type:e.type,label:e.label,annotation:e.annotation,when:e.when,content_id:e.content_id,tool_state:t,tool_id:e.tool_id,tool_version:e.tool_version,tool_shed_repository:e.tool_shed_repository,uuid:e.uuid,errors:e.errors,position:iz(e.position),input_connections:n,inputs:e.inputs??[],outputs:e.outputs??[],workflow_outputs:e.workflow_outputs??[],post_job_actions:e.post_job_actions??{},subworkflow:i,tool_uuid:e.tool_uuid,tool_representation:e.tool_representation,in:e.in,connected_paths:r}}function iz(e){return e==null?e:{top:e.top,left:e.left}}function az(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return{}}return typeof e==`object`&&e?e:{}}function oz(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?r:[r];return t}function sz(e){return Array.isArray(e)?e:typeof e==`string`&&e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}function cz(e){let t=new Set;return lz(e,t),t}function lz(e,t){for(let n of Object.values(e))n.tool_id!=null&&t.add({tool_id:n.tool_id,tool_version:n.tool_version??null}),n.subworkflow&&lz(n.subworkflow.steps,t)}var uz={File:`data`,data_input:`data`,data_collection:`collection`};function dz(e){return uz[e]??e}var fz=Y({id:H,source:J(K(G(H,q(H)))),label:J(K(H)),default:J(K(V))}),pz=Y({id:J(K(H)),add_tags:J(K(q(H))),change_datatype:J(K(H)),delete_intermediate_datasets:J(K(W)),hide:J(K(W)),remove_tags:J(K(q(H))),rename:J(K(H)),set_columns:J(K(X({key:H,value:V})))}),mz=Y({id:H,label:J(K(H)),doc:J(K(H)),type:J(K(G(H,q(H)))),optional:J(K(W)),default:J(K(V)),format:J(K(q(H))),collection_type:J(K(H)),position:J(K(X({key:H,value:V})))}),hz=Y({id:H,label:J(K(H)),doc:J(K(H)),outputSource:J(K(H)),type:J(K(H))}),gz=Y({class:z(`GalaxyWorkflow`),label:J(K(H)),doc:J(K(H)),inputs:q(mz),outputs:q(hz),steps:q(fM(()=>_z)),tags:J(K(q(H))),uuid:J(K(H)),report:J(K(X({key:H,value:V}))),license:J(K(H)),release:J(K(H)),unique_tools:mP(QR)}),_z=Y({id:H,label:J(K(H)),doc:J(K(H)),tool_id:J(K(H)),tool_version:J(K(H)),tool_shed_repository:J(K(X({key:H,value:V}))),type:J(K(H)),run:J(K(G(gz,H))),in:q(fz),out:q(pz),post_job_actions:J(K(X({key:H,value:V}))),state:J(K(X({key:H,value:V}))),tool_state:J(K(X({key:H,value:V}))),when:J(K(H)),position:J(K(X({key:H,value:V}))),errors:J(K(H)),uuid:J(K(H)),runtime_inputs:J(K(q(H)))});function vz(e){let t=e;if(t.$graph){let e=t.$graph,n=new Map,r;for(let t of e)t.id===`main`?r=t:n.set(t.id,t);if(!r)throw Error(`$graph workflow missing 'main' entry`);return yz(r,n)}return yz(t,new Map)}function yz(e,t){let n=bz(e.inputs),r=xz(e.outputs),i=Sz(e.steps,t),a=Mz(i),o={class:`GalaxyWorkflow`,label:e.label??null,doc:jz(e.doc),inputs:n,outputs:r,steps:i,tags:e.tags,uuid:e.uuid,report:e.report,license:e.license,release:e.release,unique_tools:a};return e.comments!=null&&(o.comments=e.comments),e.creator!=null&&(o.creator=e.creator),o}function bz(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>{let t=e;return{...t,id:t.id,doc:jz(t.doc)}});let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`)t.push({id:n,type:dz(r)});else if(r&&typeof r==`object`){let e=r,i=typeof e.type==`string`?dz(e.type):e.type;t.push({...e,id:n,type:i,doc:jz(e.doc)})}else t.push({id:n});return t}function xz(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>{let t=e;return{...t,id:t.id,doc:jz(t.doc)}});let t=[];for(let[n,r]of Object.entries(e))if(r&&typeof r==`object`){let e=r;t.push({...e,id:n,doc:jz(e.doc)})}else t.push({id:n});return t}function Sz(e,t){if(!e)return[];if(Array.isArray(e))return e.map((e,n)=>{let r=e;return Cz(r,r.id??String(n),t)});let n=[];for(let[r,i]of Object.entries(e))if(i&&typeof i==`object`){let e=i;`label`in e||(e={...e,label:r}),n.push(Cz(e,r,t))}return n}function Cz(e,t,n){let r=wz(e.in),i=Tz(e.out),a=Ez(e.run,n),o=new Map,s=e.state==null?e.state:kz(e.state,``,o),c=[];for(let[e,t]of o)c.push({id:e,source:t.length===1?t[0]:t});let l=new Set(r.map(e=>e.id));for(let e of c)l.has(e.id)||r.push(e);return{id:t,label:e.label,doc:jz(e.doc),tool_id:e.tool_id,tool_version:e.tool_version,tool_shed_repository:e.tool_shed_repository,type:e.type,run:a,in:r,out:i,post_job_actions:e.post_job_actions,state:s,tool_state:Az(e.tool_state),when:e.when,position:e.position,errors:e.errors,uuid:e.uuid,runtime_inputs:e.runtime_inputs}}function wz(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>{if(typeof e==`string`)return{id:e};let t=e;return{...t,id:t.id}});let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`)t.push({id:n,source:r});else if(Array.isArray(r))t.push({id:n,source:r});else if(r&&typeof r==`object`){let e=r;t.push({...e,id:n})}else t.push({id:n});return t}function Tz(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>typeof e==`string`?{id:e}:e);let t=[];for(let[n,r]of Object.entries(e))r&&typeof r==`object`?t.push({...r,id:n}):t.push({id:n});return t}function Ez(e,t){if(e==null)return e;if(typeof e==`string`){if(e.startsWith(`#`)){let n=e.slice(1),r=t.get(n);if(!r)throw Error(`Subworkflow reference not found: ${e}`);return yz(r,t)}return e}if(typeof e==`object`){let n=e;return`@import`in n&&typeof n[`@import`]==`string`?n[`@import`]:n.class===`GalaxyUserTool`?n:yz(n,t)}return null}var Dz={__class__:`ConnectedValue`};function Oz(e){return typeof e==`number`&&Number.isInteger(e)?String(e):e}function kz(e,t,n){if(e&&typeof e==`object`&&!Array.isArray(e)){let r=e;if(`$link`in r){let e=n.get(t)??[];return e.push(Oz(r.$link)),n.set(t,e),{...Dz}}let i={};for(let[e,a]of Object.entries(r))i[e]=kz(a,t?`${t}|${e}`:e,n);return i}return Array.isArray(e)?e.map((e,r)=>{if(e&&typeof e==`object`&&!Array.isArray(e)&&`$link`in e){let r=n.get(t)??[];return r.push(Oz(e.$link)),n.set(t,r),null}return kz(e,`${t}_${r}`,n)}):e}function Az(e){if(e==null)return e;if(typeof e==`string`)try{return JSON.parse(e)}catch{return{}}return typeof e==`object`?e:null}function jz(e){return Array.isArray(e)?e.join(`
|
|
267
|
+
`):e}function Mz(e){let t=new Set;return Nz(e,t),t}function Nz(e,t){for(let n of e)if(n.tool_id!=null&&t.add({tool_id:n.tool_id,tool_version:n.tool_version??null}),n.run&&typeof n.run==`object`&&n.run.class===`GalaxyWorkflow`){let e=n.run;Nz(e.steps,t)}}var Pz={text:{text:`text`,bold:`bold`,italic:`italic`,size:`text_size`},markdown:{text:`text`},frame:{title:`title`},freehand:{thickness:`thickness`,line:`line`}},Fz=[`type`,`position`,`size`,`color`];function Iz(e){let t=e.type,n={};for(let t of Fz)t in e&&(n[t]=e[t]);`label`in e&&(n.label=e.label);let r=e.data??{},i=Pz[t]??{};for(let[e,t]of Object.entries(i))e in r&&(n[t]=r[e]);return`child_steps`in e&&(n.contains_steps=e.child_steps),`child_comments`in e&&(n.contains_comments=e.child_comments),n}function Lz(e){let t=e.type,n={};for(let t of Fz)t in e&&(n[t]=e[t]);`label`in e&&(n.label=e.label);let r={},i=Pz[t]??{};for(let[t,n]of Object.entries(i))n in e&&(r[t]=e[n]);return n.data=r,`contains_steps`in e&&(n.child_steps=e.contains_steps),`contains_comments`in e&&(n.child_comments=e.contains_comments),n}var Rz=`_unlabeled_input_`,zz=`_unlabeled_step_`;function Bz(e){return e.startsWith(Rz)}function Vz(e){return e.startsWith(zz)}function Hz(e){return Bz(e)||Vz(e)}var Uz=class{seenLabels=new Set;anonymousLabels=0;ensureNewOutputLabel(e){return e??=(this.anonymousLabels+=1,`_anonymous_output_${this.anonymousLabels}`),this.seenLabels.add(e),e}};function Wz(e,t){let n=t instanceof Map?[...t.keys()]:[...t];n.sort((e,t)=>t.length-e.length);for(let t of n){if(e===t)return[t,`output`];if(e.startsWith(t+`/`))return[t,e.slice(t.length+1)]}if(e.includes(`/`)){let t=e.indexOf(`/`);return[e.slice(0,t),e.slice(t+1)]}return[e,`output`]}var Gz=new Set([`data_input`,`data_collection_input`,`parameter_input`]);function Kz(e,t){return qz(tz(e),t)}function qz(e,t){let n=new Map;for(let[t,r]of Object.entries(e.steps))r.label==null?Gz.has(r.type)?n.set(String(t),`${Rz}${r.id}`):n.set(String(t),`${zz}${r.id}`):n.set(String(t),r.label);let r=new Uz,i=[];for(let t of Object.values(e.steps))for(let e of t.workflow_outputs){let a=oB(e.output_name,n,t.id),o=r.ensureNewOutputLabel(e.label);i.push({id:o,outputSource:a})}let a=[],o=[];for(let r of Object.values(e.steps))Gz.has(r.type)?a.push(Yz(r)):o.push(Zz(r,n,t));sB(i,o);let s=cB(e,n),c=e,l={class:`GalaxyWorkflow`,label:e.name??null,doc:e.annotation||null,inputs:a,outputs:i,steps:o,tags:e.tags,uuid:e.uuid,license:e.license??void 0,release:e.release??void 0,unique_tools:e.unique_tools};return s&&(l.comments=s),c.report&&(l.report={markdown:c.report.markdown}),c.creator&&(l.creator=c.creator),l}function Jz(e,t){if(e===`data_collection_input`)return`collection`;if(e===`data_input`)return`data`;if(e===`parameter_input`){let e=t.parameter_type??``,n=e;return e===`integer`?n=`int`:e===`text`&&(n=`string`),t.multiple?[n]:n}return`data`}function Yz(e){let t={id:e.label??`_unlabeled_input_${e.id}`,type:Jz(e.type,e.tool_state)},n=e.tool_state;for(let e of[`collection_type`,`optional`,`format`,`default`,`restrictions`,`suggestions`,`restrictOnConnections`,`fields`,`column_definitions`])if(e in n)if(e===`format`){let r=n[e];t[e]=typeof r==`string`?[r]:r}else t[e]=n[e];return e.annotation&&(t.doc=e.annotation),e.position&&(t.position=e.position),t}function Xz(e,t){let n=e.label??t.get(String(e.id));return{stepId:n??String(e.id),displayLabel:n&&Hz(n)?void 0:n}}function Zz(e,t,n){let r=e.type;return r===`subworkflow`?eB(e,t,n):r===`pause`?tB(e,t):r===`pick_value`?nB(e,t):Qz(e,t,n)}function Qz(e,t,n){let r=e.tool_representation;if(r&&r.class===`GalaxyUserTool`)return $z(e,t);let i=rB(e,t),a=aB(e),o=n?.stateEncodeToFormat2?.(e),s=null;if(o!=null)s=Object.keys(o.state).length>0?o.state:null,o.in&&iB(i,o.in);else{let t={...e.tool_state};delete t.__page__,delete t.__rerun_remap_job_id__,Object.keys(t).length>0&&(s=t)}let{stepId:c,displayLabel:l}=Xz(e,t);return{id:c,label:l??void 0,doc:e.annotation||void 0,tool_id:e.tool_id??void 0,tool_version:e.tool_version??void 0,tool_shed_repository:e.tool_shed_repository,in:i,out:a,tool_state:s,position:e.position,when:e.when??void 0,uuid:e.uuid??void 0,errors:e.errors??void 0}}function $z(e,t){let n=rB(e,t),r=aB(e),{stepId:i,displayLabel:a}=Xz(e,t);return{id:i,label:a??void 0,doc:e.annotation||void 0,run:e.tool_representation,in:n,out:r,position:e.position}}function eB(e,t,n){let r=rB(e,t),i=aB(e),a=null,o=e.content_source;(o===`url`||o===`trs_url`)&&e.content_id?a=e.content_id:e.subworkflow==null?e.content_id&&(a=e.content_id):a=qz(e.subworkflow,n);let{stepId:s,displayLabel:c}=Xz(e,t);return{id:s,label:c??void 0,doc:e.annotation||void 0,run:a,in:r,out:i,position:e.position,when:e.when??void 0,uuid:e.uuid??void 0}}function tB(e,t){let n=rB(e,t),{stepId:r,displayLabel:i}=Xz(e,t);return{id:r,label:i??void 0,doc:e.annotation||void 0,type:`pause`,in:n,out:[],position:e.position}}function nB(e,t){let n=rB(e,t),r=aB(e),{stepId:i,displayLabel:a}=Xz(e,t),o;return`mode`in e.tool_state&&(o={mode:e.tool_state.mode}),{id:i,label:a??void 0,doc:e.annotation||void 0,type:`pick_value`,state:o,in:n,out:r,position:e.position}}function rB(e,t){let n=[],r=new Map;if(e.in!=null)for(let[t,n]of Object.entries(e.in))n&&typeof n==`object`&&`default`in n&&r.set(t,n.default);for(let[i,a]of Object.entries(e.input_connections)){let e=Array.isArray(a)?a:[a],o=[];for(let n of e){let e=n,r=oB(e.output_name,t,e.id);o.push(r)}let s=i,c=o;i===`__NO_INPUT_OUTPUT_NAME__`&&(s=`$step`,c=o.map(e=>e.includes(`/__NO_INPUT_OUTPUT_NAME__`)?e.split(`/__NO_INPUT_OUTPUT_NAME__`)[0]:e));let l=c.length===1?c[0]:c,u=r.get(s);r.delete(s);let d={id:s,source:l};u!==void 0&&(d.default=u),n.push(d)}for(let[e,t]of r)n.push({id:e,default:t});return n}function iB(e,t){let n=new Set;for(let t of e)t.id&&n.add(t.id);for(let[r,i]of Object.entries(t))n.has(r)||e.push({id:r,source:i})}function aB(e){if(!e.post_job_actions||Object.keys(e.post_job_actions).length===0)return[];let t=new Map;for(let n of Object.values(e.post_job_actions)){let e=n.action_type,r=n.output_name,i=n.action_arguments??{};t.has(r)||t.set(r,{});let a=t.get(r);e===`RenameDatasetAction`?a.rename=i.newname:e===`HideDatasetAction`?a.hide=!0:e===`DeleteIntermediatesAction`?a.delete_intermediate_datasets=!0:e===`ChangeDatatypeAction`?a.change_datatype=i.newtype:e===`TagDatasetAction`?a.add_tags=i.tags.split(`,`):e===`RemoveTagDatasetAction`?a.remove_tags=i.tags.split(`,`):e===`ColumnSetAction`&&i&&Object.keys(i).length>0&&(a.set_columns=i)}let n=[];for(let[e,r]of t)n.push({id:e,...r});return n}function oB(e,t,n){let r=t.get(String(n))??String(n);return e===`output`?r:`${r}/${e}`}function sB(e,t){let n=new Map;for(let e of t){let t=e.label??e.id;e.run&&typeof e.run==`object`&&n.set(String(t),e.run)}for(let t of e){let e=t.outputSource;if(!e||!e.includes(`/`))continue;let[r,i]=e.split(`/`,2);if(!i.includes(`:`))continue;let[a,o]=i.split(`:`,2),s=n.get(r);if(!s)continue;let c=`/${o}`;for(let e of s.outputs){let n=e.outputSource;if(n&&n.endsWith(c)){let i=n.slice(0,-c.length);if(i===a||i.endsWith(a)){t.outputSource=`${r}/${e.id}`;break}}}}}function cB(e,t){let n=e.comments;if(!n||!Array.isArray(n)||n.length===0)return;let r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t.label&&r.set(e,t.label)}let i=[];for(let e of n){let n=Iz(e);n.type===`frame`&&(n.contains_steps&&Array.isArray(n.contains_steps)&&(n.contains_steps=n.contains_steps.map(e=>t.get(String(e))??e)),n.contains_comments&&Array.isArray(n.contains_comments)&&(n.contains_comments=n.contains_comments.map(e=>r.get(e)??e))),i.push(n)}return i}function lB(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var uB={input:`data_input`,input_collection:`data_collection_input`,parameter:`parameter_input`},dB=class e{options;labels=new Map;constructor(e={}){this.options=e}stepId(e){let t=String(e);return this.labels.has(t)?this.labels.get(t):parseInt(t,10)}stepOutput(e){let[t,n]=Wz(e,this.labels);return[this.stepId(t),n]}childContext(){return new e(this.options)}},fB={hide:{actionClass:`HideDatasetAction`,defaultVal:!1,arguments:()=>({})},rename:{actionClass:`RenameDatasetAction`,defaultVal:{},arguments:e=>({newname:e})},delete_intermediate_datasets:{actionClass:`DeleteIntermediatesAction`,defaultVal:!1,arguments:()=>({})},change_datatype:{actionClass:`ChangeDatatypeAction`,defaultVal:{},arguments:e=>({newtype:e})},set_columns:{actionClass:`ColumnSetAction`,defaultVal:{},arguments:e=>e},add_tags:{actionClass:`TagDatasetAction`,defaultVal:[],arguments:e=>({tags:e.join(`,`)})},remove_tags:{actionClass:`RemoveTagDatasetAction`,defaultVal:[],arguments:e=>({tags:e.join(`,`)})}};function pB(e,t){let n;n=mB(e)?e:vz(e);let r=new dB(t);return hB(n,r),gB(n,r)}function mB(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.class===`GalaxyWorkflow`&&Array.isArray(t.inputs)&&Array.isArray(t.steps)}function hB(e,t){for(let n=0;n<e.inputs.length;n++){let r=e.inputs[n];r.id&&t.labels.set(r.id,n)}for(let n=0;n<e.steps.length;n++){let r=e.inputs.length+n,i=e.steps[n].label??e.steps[n].id;i&&t.labels.set(i,r)}}function gB(e,t){let n={};for(let t=0;t<e.inputs.length;t++)n[String(t)]=_B(e.inputs[t],t);let r=e.inputs.length;for(let i=0;i<e.steps.length;i++){let a=r+i;n[String(a)]=vB(e.steps[i],a,t)}kB(e.outputs,n,t);let i=AB(e,t),a=e,o={a_galaxy_workflow:`true`,"format-version":`0.1`,name:e.label??`Workflow`,annotation:e.doc??``,tags:e.tags??[],uuid:e.uuid||lB(),license:e.license??void 0,release:e.release??void 0,steps:n,unique_tools:e.unique_tools};return i&&i.length>0&&(o.comments=i),a.report&&(o.report={markdown:a.report.markdown}),a.creator&&(o.creator=a.creator),o}function _B(e,t){let n=e.id||`Input ${t}`,r=Hz(n)?void 0:n,i=e.type,a=!1;if(Array.isArray(i)){if(i.length!==1)throw Error(`Only simple arrays of workflow inputs are currently supported`);i=i[0],a=!0}let o=i??`data`,s;if([`File`,`data`,`data_input`].includes(o))s=`data_input`;else if([`collection`,`data_collection`,`data_collection_input`].includes(o))s=`data_collection_input`;else if([`text`,`string`,`integer`,`int`,`float`,`color`,`boolean`].includes(o))s=`parameter_input`;else throw Error(`Unknown input type [${o}] encountered.`);let c={name:n};if(s===`parameter_input`){let e=o;e===`int`?e=`integer`:e===`string`&&(e=`text`),c.parameter_type=e}a&&(c.multiple=!0),e.optional!=null&&(c.optional=e.optional),e.format&&(c.format=e.format),e.collection_type&&(c.collection_type=e.collection_type),e.default!=null&&(c.default=e.default);for(let t of[`restrictions`,`suggestions`,`restrictOnConnections`,`fields`,`column_definitions`])t in e&&(c[t]=e[t]);let l,u=e.default;return u&&typeof u==`object`&&u.class===`File`&&(l={default:{default:u}},delete c.default),{id:t,type:s,label:r??null,name:n,annotation:NB(e.doc)??``,tool_state:c,position:MB(e.position,t),input_connections:{},inputs:[{name:n,description:``}],outputs:[],workflow_outputs:[],post_job_actions:{},in:l,connected_paths:new Set}}function vB(e,t,n){let r=yB(e);if(r===`tool`)return bB(e,t,n);if(r===`subworkflow`)return xB(e,t,n);if(r===`pause`)return SB(e,t,n);if(r===`pick_value`)return CB(e,t,n);throw Error(`Unhandled step type: ${r}`)}function yB(e){if(e.run!=null){if(typeof e.run==`object`)return e.run.class===`GalaxyUserTool`?`tool`:`subworkflow`;if(typeof e.run==`string`)return`subworkflow`}let t=e.type??`tool`;return uB[t]??t}function bB(e,t,n){let r;if(e.run&&typeof e.run==`object`){let t=e.run;t.class===`GalaxyUserTool`&&(r=t)}let i={__page__:0},a=wB(e),o=e.runtime_inputs??[],s;if(e.state!=null||o.length>0){s=e.state?{...e.state}:{};for(let e of o)s[e]={__class__:`RuntimeValue`}}else s=e.tool_state==null?{}:{...e.tool_state};let c=n.options.stateEncodeToNative?.(e,s)??s;Object.keys(c).length>0&&Object.assign(i,c);let l=EB(a,n),u=DB(e.out,e.post_job_actions),d=new Set(Object.keys(l)),f=r!=null,p=f?null:e.tool_id??void 0;return{id:t,type:`tool`,label:jB(e),name:p??r?.name??`User Defined Tool`,annotation:e.doc??``,tool_id:p,tool_version:e.tool_version??void 0,tool_shed_repository:e.tool_shed_repository,tool_state:i,tool_representation:r,in:TB(e),tool_uuid:f?null:e.uuid??void 0,input_connections:l,post_job_actions:u,position:MB(e.position,t),when:e.when??void 0,uuid:e.uuid??void 0,errors:e.errors??void 0,inputs:[],outputs:[],workflow_outputs:[],connected_paths:d}}function xB(e,t,n){let r=null,i=null,a;if(typeof e.run==`object`&&e.run!=null){a=n.childContext();let t=e.run;hB(t,a),r=gB(t,a)}else typeof e.run==`string`&&(i=e.run);let o=EB(wB(e),n,r!=null,a),s=DB(e.out,e.post_job_actions),c=new Set(Object.keys(o));return{id:t,type:`subworkflow`,label:jB(e),annotation:e.doc??``,tool_state:{},subworkflow:r,content_id:i,in:TB(e),input_connections:o,post_job_actions:s,position:MB(e.position,t),when:e.when??void 0,uuid:e.uuid??void 0,inputs:[],outputs:[],workflow_outputs:[],connected_paths:c}}function SB(e,t,n){let r=e.label??e.id??`Pause for dataset review`,i=EB(wB(e),n),a=new Set(Object.keys(i));return{id:t,type:`pause`,label:jB(e),name:r,annotation:e.doc??``,tool_state:{name:r},input_connections:i,inputs:[{name:r,description:``}],outputs:[],workflow_outputs:[],post_job_actions:{},position:MB(e.position,t),uuid:e.uuid??void 0,connected_paths:a}}function CB(e,t,n){let r=e.label??e.id??`Pick Value`,i=e.state?{...e.state}:{};i.name=r;let a=EB(wB(e),n),o=new Set(Object.keys(a)),s=Object.keys(a).length;s>0&&(i.num_inputs=Math.max(2,s));let c=DB([...e.out],e.post_job_actions);return{id:t,type:`pick_value`,label:jB(e),name:r,annotation:e.doc??``,tool_state:i,input_connections:a,post_job_actions:c,inputs:[{name:r,description:``}],outputs:[],workflow_outputs:[],position:MB(e.position,t),uuid:e.uuid??void 0,connected_paths:o}}function wB(e){let t={};for(let n of e.in){let e=n.id;if(!e)continue;let r=n.source;r!=null&&(Array.isArray(r)?t[e]=[...r]:t[e]=[r])}return t}function TB(e){let t={};for(let n of e.in){let e=n.id;e&&n.default!=null&&(t[e]={default:n.default})}return Object.keys(t).length>0?t:void 0}function EB(e,t,n=!1,r){let i={};for(let[a,o]of Object.entries(e)){let e=[];for(let i of o){let o=i;a===`$step`&&(o=i+`/__NO_INPUT_OUTPUT_NAME__`);let[s,c]=t.stepOutput(o),l={id:s,output_name:c};n&&r&&r.labels.has(a)&&(l.input_subworkflow_step_id=r.stepId(a)),e.push(l)}let s=a===`$step`?`__NO_INPUT_OUTPUT_NAME__`:a;e.length>0&&(i[s]=e)}return i}function DB(e,t){let n={};for(let t of e){let e=t.id;if(e)for(let[r,i]of Object.entries(fB)){let a=t[r]??void 0;if(a??=i.defaultVal,OB(a)){let t=i.actionClass+e;n[t]={action_type:i.actionClass,output_name:e,action_arguments:i.arguments(a)}}}}if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function OB(e){return e===!1||e==null?!1:Array.isArray(e)?e.length>0:typeof e==`object`?Object.keys(e).length>0:!!e}function kB(e,t,n){for(let r of e){let e=r.outputSource;if(!e)continue;let[i,a]=n.stepOutput(e),o=String(i);if(!(o in t))continue;let s=r.label??r.id,c={output_name:a,label:(s&&s.startsWith(`_anonymous_output_`)?null:s)??void 0};t[o].workflow_outputs.push(c)}}function AB(e,t){let n=e.comments;if(!n)return;let r;if(Array.isArray(n)){if(n.length===0)return;r=n}else if(typeof n==`object`){if(r=Object.entries(n).map(([e,t])=>({...t,label:e})),r.length===0)return}else return;let i=new Map;for(let e=0;e<r.length;e++){let t=r[e];t.label&&i.set(t.label,e)}let a=[];for(let e=0;e<r.length;e++){let n=Lz(r[e]);n.id=e,n.child_steps&&Array.isArray(n.child_steps)&&(n.child_steps=n.child_steps.map(e=>typeof e==`string`?t.stepId(e):e)),n.child_comments&&Array.isArray(n.child_comments)&&(n.child_comments=n.child_comments.map(e=>{if(typeof e==`string`){if(!i.has(e))throw Error(`contains_comments references unknown comment label '${e}'`);return i.get(e)}return e})),a.push(n)}return a}function jB(e){return e.label==null?e.id&&!/^\d+$/.test(e.id)?Hz(e.id)?null:e.id:null:Hz(e.label)?null:e.label}function MB(e,t){return e??{left:10*t,top:10*t}}function NB(e){return e==null?e:Array.isArray(e)?e.length>0?e.join(`
|
|
268
|
+
`):null:e}function PB(e){return e.a_galaxy_workflow===`true`?Kz(e):vz(e)}var FB=new Set([`__page__`,`__rerun_remap_job_id__`]),IB=new Set([`chromInfo`,`__input_ext`]),LB=new Set([`__current_case__`,`__index__`]);new Set([...FB,...IB,...LB]);function RB(e,t,n,r){return`${e}|${t}->${n}|${r}`}var zB=[`>`,`]`],BB=[`{{`,`}}`],VB=[`[`,`]`],HB={data:zB,collection:zB,integer:BB,float:BB,text:BB,boolean:BB,color:BB,input:zB,tool:VB,subworkflow:[`[[`,`]]`]},UB=`toolshed.g2.bx.psu.edu/repos/`;function WB(e){let t=e.replace(/"/g,`#quot;`);for(let e of`()[]{}<>`)t=t.replaceAll(e,`#${e.charCodeAt(0)};`);return t}function GB(e){return e==null?`input`:Array.isArray(e)?e.length>0?e[0]:`input`:e}function KB(e,t,n){return`${e}${n[0]}"${t}"${n[1]}`}function qB(e){if(e==null)return[];let t=Array.isArray(e)?e:typeof e==`object`?Object.values(e):[],n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e;if(t.type!==`frame`)continue;let r=t.contains_steps;!Array.isArray(r)||r.length===0||n.push({title:typeof t.title==`string`?t.title:null,containsSteps:r.map(e=>String(e))})}return n}function JB(e,t={}){let n=typeof e==`object`&&e&&e.class===`GalaxyWorkflow`&&Array.isArray(e.inputs)&&`unique_tools`in e?e:PB(e),r=[`graph LR`],i=new Map,a=new Map;n.inputs.forEach((e,t)=>{let n=`input_${t}`,r=e.id||String(t);i.set(r,n);let o=WB(r),s=GB(e.type),c=HB[s]??zB;a.set(r,KB(n,`${o}<br/><i>${s}</i>`,c))});let o=new Map,s=new Map;n.steps.forEach((e,t)=>{let n=`step_${t}`,r=e.label||e.id;o.set(r,n);let i=e.tool_id??null;i&&i.startsWith(UB)&&(i=i.slice(29));let a=e.id&&!Vz(e.id)?e.id:null,c=WB(e.label||a||(i?`tool:${i}`:String(t))),l=HB[e.type||(e.run==null?`tool`:`subworkflow`)]??VB;s.set(r,KB(n,c,l))});let c=new Set,l=[];if(t.comments){let e=n.comments;for(let t of qB(e)){l.push(t);for(let e of t.containsSteps)c.add(e)}}for(let[e,t]of a)c.has(e)||r.push(` ${t}`);for(let[e,t]of s)c.has(e)||r.push(` ${t}`);l.forEach((e,t)=>{let n=WB(e.title||`Group ${t}`);r.push(` subgraph sub_${t} ["${n}"]`);for(let t of e.containsSteps)a.has(t)?r.push(` ${a.get(t)}`):s.has(t)&&r.push(` ${s.get(t)}`);r.push(` end`)});let u=new Set([...i.keys(),...o.keys()]),d=new Set,f=[],p=0;n.steps.forEach((e,n)=>{let a=`step_${n}`,s=e.label||e.id;for(let n of e.in){if(n.source==null)continue;let e=n.id||``,c=Array.isArray(n.source)?n.source:[n.source];for(let n of c){let[c,l]=Wz(n,u),m=i.get(c)??o.get(c);if(!m)continue;let h=`${m}->${a}`;if(d.has(h))continue;d.add(h);let g=t.edgeAnnotations?.get(RB(c,l,s,e)),{line:_,linkStyle:v}=YB(m,a,g,p);r.push(` ${_}`),v&&f.push(v),p++}}});for(let e of f)r.push(` ${e}`);return r.join(`
|
|
269
|
+
`)}function YB(e,t,n,r){if(!n||n.mapDepth===0&&!n.reduction)return{line:`${e} --> ${t}`,linkStyle:null};if(n.reduction)return{line:`${e} -. "${n.mapping?WB(`reduce ${n.mapping}`):`reduce`}" .-> ${t}`,linkStyle:`linkStyle ${r} stroke:#a55,stroke-dasharray:6 4`};let i=WB(n.mapping??`map`),a=2+n.mapDepth;return{line:`${e} ==>|"${i}"| ${t}`,linkStyle:`linkStyle ${r} stroke:#5a8,stroke-width:${a}px`}}function XB(e){return e===`preset`||e===`topological`}function ZB(e){let t=e.nodes.map(e=>e.data.id),n=new Map;t.forEach((e,t)=>n.set(e,t));let r=new Map;for(let e of t)r.set(e,[]);for(let t of e.edges){let{source:e,target:i}=t.data;!n.has(e)||!n.has(i)||r.get(i).push(e)}let i=new Map;for(let[e,t]of r)i.set(e,t.length);let a=new Map,o=[...t.filter(e=>i.get(e)===0)];o.sort((e,t)=>n.get(e)-n.get(t));let s=new Set,c=new Map;for(let e of t)c.set(e,[]);for(let[e,t]of r)for(let n of t)c.get(n).push(e);for(;o.length>0;){let e=0;for(let t=1;t<o.length;t++)n.get(o[t])<n.get(o[e])&&(e=t);let t=o.splice(e,1)[0];s.add(t);let l=r.get(t);if(l.length===0)a.set(t,0);else{let e=0;for(let t of l){let n=a.get(t);n!==void 0&&n+1>e&&(e=n+1)}a.set(t,e)}for(let e of c.get(t)){let t=i.get(e)-1;i.set(e,t),t===0&&o.push(e)}}for(let e of t)s.has(e)||a.set(e,n.get(e));let l=new Map;for(let e of t){let t=a.get(e);l.has(t)||l.set(t,[]),l.get(t).push(e)}let u=new Map;for(let[e,t]of l)t.forEach((t,n)=>{u.set(t,{x:e*220,y:n*100})});return u}var QB=`toolshed.g2.bx.psu.edu/repos/`;function $B(e,t={}){let n=typeof e==`object`&&e&&e.class===`GalaxyWorkflow`&&Array.isArray(e.inputs)&&`unique_tools`in e?e:PB(e),r=t.layout??`preset`,i=[],a=[];n.inputs.forEach((e,t)=>{i.push(rV(e,t))});let o=n.inputs.length,s=new Set;for(let e of n.inputs)s.add(e.id);for(let e of n.steps)s.add(e.label||e.id);n.steps.forEach((e,n)=>{i.push(iV(e,n+o)),a.push(...aV(e,s,t.edgeAnnotations))});let c={nodes:i,edges:a};if(r===`preset`)return c;if(XB(r)){let e=ZB(c);for(let t of i){let n=e.get(t.data.id);n&&(t.position=n)}}else for(let e of i)delete e.position;return c.layout={name:r},c}function eV(e){return{x:10*e,y:10*e}}function tV(e,t){if(e==null)return eV(t);let n=e.left,r=e.top,i=typeof n==`number`?Math.trunc(n):Number.parseInt(String(n??0),10),a=typeof r==`number`?Math.trunc(r):Number.parseInt(String(r??0),10);return{x:Number.isFinite(i)?i:0,y:Number.isFinite(a)?a:0}}function nV(e){return e==null?`input`:typeof e==`string`?e:e.length>0?`${e[0]}[]`:`input`}function rV(e,t){let n=e.id||String(t),r=nV(e.type);return{group:`nodes`,data:{id:n,label:n,doc:typeof e.doc==`string`?e.doc:null,tool_id:null,step_type:r,repo_link:null},classes:[`type_${r}`,`input`],position:tV(e.position,t)}}function iV(e,t){let n=e.label||e.id,r=e.type||(e.run==null?`tool`:`subworkflow`),i=e.tool_id??null;i&&i.startsWith(QB)&&(i=i.slice(29));let a=e.id&&!Vz(e.id)?e.id:null,o=e.label||a||(i?`tool:${i}`:String(t)),s=null,c=e.tool_shed_repository;return c&&(s=`https://${c.tool_shed}/view/${c.owner}/${c.name}/${c.changeset_revision}`),{group:`nodes`,data:{id:n,label:o,doc:typeof e.doc==`string`?e.doc:null,tool_id:e.tool_id??null,step_type:r,repo_link:s},classes:[`type_${r}`,`runnable`],position:tV(e.position,t)}}function aV(e,t,n){let r=e.label||e.id,i=[];for(let a of e.in){if(a.source==null)continue;let e=a.id||`unknown`,o=Array.isArray(a.source)?a.source:[a.source];for(let a of o){let[o,s]=Wz(a,t),c=s===`output`?null:s,l={group:`edges`,data:{id:`${r}__${e}__from__${o}`,source:o,target:r,input:e,output:c}},u=n?.get(RB(o,s,r,e));if(u){l.data.map_depth=u.mapDepth,l.data.reduction=u.reduction,l.data.mapping=u.mapping??null;let e=[];u.mapDepth>0&&e.push(`mapover_${u.mapDepth}`),u.reduction&&e.push(`reduction`),e.length>0&&(l.classes=e)}i.push(l)}}return i}function oV(e){return[...e.nodes,...e.edges]}var sV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;var a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),cV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=sV(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),Q=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=sV(),n=cV(),r=sV();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`strConcat`,{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`getProperty`,{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`regexpCode`,{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}});var i=cV();Object.defineProperty(e,`Scope`,{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,`ValueScope`,{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,`ValueScopeName`,{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,`varKinds`,{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=ue(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ue(this.rhs,e,n),this}get names(){return le(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=ue(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(de(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ce(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(fe(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=ue(this.condition,e,t),this}get names(){let e=super.names;return le(e,this.condition),this.else&&ce(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var ee=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=ue(this.iteration,e,t),this}get names(){return ce(super.names,this.iteration.names)}},te=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return le(le(super.names,this.from),this.to)}},ne=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=ue(this.iterable,e,t),this}get names(){return ce(super.names,this.iterable.names)}},re=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};re.kind=`func`;var ie=class extends p{render(e){return`return `+super.render(e)}};ie.kind=`return`;var ae=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&ce(e,this.catch.names),this.finally&&ce(e,this.finally.names),e}},oe=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};oe.kind=`catch`;var se=class extends m{render(e){return`finally`+super.render(e)}};se.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
270
|
+
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new ee(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new te(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new ne(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new ne(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new ie;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(ie)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new ae;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new oe(e),t(e)}return n&&(this._currNode=r.finally=new se,this.code(n)),this._endBlockNode(oe,se)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new re(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(re)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function ce(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function le(e,n){return n instanceof t._CodeOrName?ce(e,n.names):e}function ue(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function de(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function fe(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${ve(e)}`}e.not=fe;var pe=_e(e.operators.AND);function me(...e){return e.reduce(pe)}e.and=me;var he=_e(e.operators.OR);function ge(...e){return e.reduce(he)}e.or=ge;function _e(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${ve(n)} ${e} ${ve(r)}`}function ve(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),$=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=Q(),n=sV();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||ne(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0?!0:(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var ee;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(ee||(e.Type=ee={}));function te(e,n,r){if(e instanceof t.Name){let i=n===ee.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=te;function ne(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=ne})),lV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),uV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=Q(),n=$(),r=lV();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),dV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=uV(),n=Q(),r=lV(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),fV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),pV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),mV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=fV(),n=pV(),r=uV(),i=Q(),a=$(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
271
|
+
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
272
|
+
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
273
|
+
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),hV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assignDefaults=void 0;var t=Q(),n=$();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),gV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=Q(),n=$(),r=lV(),i=$();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),_V=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=Q(),n=lV(),r=gV(),i=uV();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)te(),i.modifying&&s(e),ne(()=>e.error());else{let t=i.async?v():ee();i.modifying&&s(e),ne(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>te((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function ee(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),te(t.nil),e}function te(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function ne(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),vV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=Q(),n=$();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),yV=r(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),bV=r(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else (p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),xV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=$(),n=yV(),r=bV(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),SV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=dV(),n=mV(),r=pV(),i=mV(),a=hV(),o=_V(),s=vV(),c=Q(),l=lV(),u=xV(),d=$(),f=uV();function p(e){if(re(e)&&(ae(e),ne(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${ee(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(ee(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&de(e),ce(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),oe(e),fe(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function ee(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function te(e,n){if(re(e)&&(ae(e),ne(e))){ie(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function ne({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function re(e){return typeof e.schema!=`boolean`}function ie(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&de(e),le(e),ue(e);let a=r.const(`_errs`,l.default.errors);oe(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function ae(e){(0,d.checkUnknownRules)(e),se(e)}function oe(e,t){if(e.opts.jtd)return me(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);me(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function se(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function ce(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function le(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function ue(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function de({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function fe(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&pe(e),t.return((0,c._)`${l.default.errors} === 0`))}function pe({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function me(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>Te(e,`$ref`,h.all.$ref.definition));return}p.jtd||ge(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),he(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):he(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function he(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&Te(e,n.keyword,n.definition,t.type)})}function ge(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(_e(e,t),e.opts.allowUnionTypes||ve(e,t),ye(e,e.dataTypes))}function _e(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{xe(e.dataTypes,t)||Ce(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),Se(e,t)}}function ve(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&Ce(e,`use allowUnionTypes to allow union type keyword`)}function ye(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>be(t,e))&&Ce(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function be(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function xe(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function Se(e,t){let n=[];for(let r of e.dataTypes)xe(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function Ce(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var we=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,Oe(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return te(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=we;function Te(e,t,n,r){let i=new we(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var Ee=/^\/(?:[^~]|~0|~1)*$/,De=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Oe(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!Ee.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=De.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=Oe})),CV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),wV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=xV();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),TV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=Q(),n=CV(),r=lV(),i=xV(),a=$(),o=SV(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),EV=n({$id:()=>DV,additionalProperties:()=>!1,default:()=>MV,description:()=>OV,properties:()=>jV,required:()=>AV,type:()=>kV}),DV,OV,kV,AV,jV,MV,NV=e((()=>{DV=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,OV=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,kV=`object`,AV=[`$data`],jV={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},MV={$id:DV,description:OV,type:kV,required:AV,properties:jV,additionalProperties:!1}})),PV=r(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,n){if(e.length){let r=i(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function c(e){let t=0,n={error:!1,address:``,zone:``},r=[],a=[],c=!1,l=!1,u=s;for(let i=0;i<e.length;i++){let s=e[i];if(!(s===`[`||s===`]`))if(s===`:`){if(c===!0&&(l=!0),!u(a,r,n))break;if(++t>7){n.error=!0;break}i>0&&e[i-1]===`:`&&(c=!0),r.push(`:`);continue}else if(s===`%`){if(!u(a,r,n))break;u=o}else{a.push(s);continue}}return a.length&&(u===o?n.zone=a.join(``):l?r.push(a.join(``)):r.push(i(a))),n.address=r.join(``),n}function l(e){if(u(e,`:`)<2)return{host:e,isIPV6:!1};let t=c(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function u(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function d(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}function f(e,t){let n=t===!0?unescape:escape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function p(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let t=l(n);n=t.isIPV6===!0?`[${t.escapedHost}]`:e.host}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:a,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:r,isUUID:n,normalizeIPv6:l,stringArrayToHexStripped:i}})),FV=r(((e,t)=>{var{isUUID:n}=PV(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=re(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=re(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},ee={scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},te={scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0},ne={http:h,https:g,ws:_,wss:v,urn:ee,"urn:uuid":te};Object.setPrototypeOf(ne,null);function re(e){return e&&(ne[e]||ne[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:ne,isValidSchemeName:a,getSchemeHandler:re}})),IV=r(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizeComponentEncoding:a,isIPv4:o,nonSimpleDomain:s}=PV(),{SCHEMES:c,getSchemeHandler:l}=FV();function u(e,t){return typeof e==`string`?e=m(g(e,t),t):typeof e==`object`&&(e=g(m(e,t),t)),e}function d(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=f(g(e,r),g(t,r),r,!0);return r.skipEscape=!0,m(i,r)}function f(e,t,n,i){let a={};return i||(e=g(m(e,n),n),t=g(m(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function p(e,t,n){return typeof e==`string`?(e=unescape(e),e=m(a(g(e,n),!0),{...n,skipEscape:!0})):typeof e==`object`&&(e=m(a(e,!0),{...n,skipEscape:!0})),typeof t==`string`?(t=unescape(t),t=m(a(g(t,n),!0),{...n,skipEscape:!0})):typeof t==`object`&&(t=m(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function m(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},a=Object.assign({},t),o=[],s=l(a.scheme||n.scheme);s&&s.serialize&&s.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),a.reference!==`suffix`&&n.scheme&&o.push(n.scheme,`:`);let c=i(n);if(c!==void 0&&(a.reference!==`suffix`&&o.push(`//`),o.push(c),n.path&&n.path[0]!==`/`&&o.push(`/`)),n.path!==void 0){let e=n.path;!a.absolutePath&&(!s||!s.absolutePath)&&(e=r(e)),c===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),o.push(e)}return n.query!==void 0&&o.push(`?`,n.query),n.fragment!==void 0&&o.push(`#`,n.fragment),o.join(``)}var h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let c=e.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||``,i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(o(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&a===!1&&s(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}(!t||t&&!t.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&=escape(unescape(i.path)),i.fragment&&=encodeURI(decodeURIComponent(i.fragment))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return i}var _={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:m,parse:g};t.exports=_,t.exports.default=_,t.exports.fastUri=_})),LV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=IV();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),RV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=SV();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return n.KeywordCxt}});var r=Q();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return r.CodeGen}});var i=CV(),a=wV(),o=fV(),s=TV(),c=Q(),l=xV(),u=mV(),d=$(),f=(NV(),t(EV).default),p=LV(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},ee=200;function te(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??ee,loopEnum:e.loopEnum??ee,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var ne=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...te(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=ue(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),re.call(this,_,e,`NOT SUPPORTED`),re.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=ce.call(this),e.formats&&oe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&se.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),ae.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=ie.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=ie.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(fe.call(this,n,t),!t)return(0,d.eachItem)(n,e=>pe.call(this,e)),this;he.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>pe.call(this,e,r):e=>r.type.forEach(t=>pe.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=_e(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};ne.ValidationError=i.default,ne.MissingRefError=a.default,e.default=ne;function re(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function ie(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function ae(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function oe(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function se(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function ce(){let e={...this.opts};for(let t of h)delete e[t];return e}var le={log(){},warn(){},error(){}};function ue(e){if(e===!1)return le;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var de=/^[a-z_$][a-z0-9_$:-]*$/i;function fe(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!de.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function pe(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?me.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function me(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function he(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=_e(t)),e.validateSchema=this.compile(t,!0))}var ge={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function _e(e){return{anyOf:[e,ge]}}})),zV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),BV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.callRef=e.getValidate=void 0;var t=wV(),n=gV(),r=Q(),i=lV(),a=TV(),o=$(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),VV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=zV(),n=BV();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),HV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),UV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),WV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),GV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$(),r=WV();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),KV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gV(),n=$(),r=Q();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),qV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),JV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gV(),n=Q(),r=$();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),YV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),XV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=yV();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),ZV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=mV(),n=Q(),r=$(),i=XV();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),QV=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$(),r=XV();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),$V=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$(),r=XV();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),eH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=HV(),n=UV(),r=GV(),i=KV(),a=qV(),o=JV(),s=YV(),c=ZV(),l=QV(),u=$V();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),tH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateAdditionalItems=void 0;var t=Q(),n=$(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),nH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTuple=void 0;var t=Q(),n=$(),r=gV(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),rH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=nH();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),iH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$(),r=gV(),i=tH();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),aH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),oH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=Q(),n=$(),r=gV();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
274
|
+
missingProperty: ${i},
|
|
275
|
+
depsCount: ${n},
|
|
276
|
+
deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),sH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),cH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gV(),n=Q(),r=lV(),i=$();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(ee(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(ee(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function ee(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),lH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=SV(),n=gV(),r=$(),i=cH();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),uH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=gV(),n=Q(),r=$(),i=$();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),dH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),fH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:gV().validateUnion,error:{message:`must match a schema in anyOf`}}})),pH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),mH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),hH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=$(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),gH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=$();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),_H=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=tH(),n=rH(),r=nH(),i=iH(),a=aH(),o=oH(),s=sH(),c=cH(),l=lH(),u=uH(),d=dH(),f=fH(),p=pH(),m=mH(),h=hH(),g=gH();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),vH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),yH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=[vH().default]})),bH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),xH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),SH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Q(),n=xH(),r=TV(),i=wV(),a=$();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),CH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:se,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:ee,int32:{type:`number`,validate:re},int64:{type:`number`,validate:ie},float:{type:`number`,validate:ae},double:{type:`number`,validate:ae},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}var s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}var d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}var v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function ee(e){return v.lastIndex=0,v.test(e)}var te=-(2**31),ne=2**31-1;function re(e){return Number.isInteger(e)&&e<=ne&&e>=te}function ie(e){return Number.isInteger(e)}function ae(){return!0}var oe=/[^\\]\\Z/;function se(e){if(oe.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),wH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VV(),n=eH(),r=_H(),i=yH(),a=bH();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),TH=n({$id:()=>DH,$schema:()=>EH,default:()=>MH,definitions:()=>kH,properties:()=>jH,title:()=>OH,type:()=>AH}),EH,DH,OH,kH,AH,jH,MH,NH=e((()=>{EH=`http://json-schema.org/draft-07/schema#`,DH=`http://json-schema.org/draft-07/schema#`,OH=`Core schema meta-schema`,kH={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},AH=[`object`,`boolean`],jH={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},MH={$schema:EH,$id:DH,title:OH,definitions:kH,type:AH,properties:jH,default:!0}})),PH=r(((e,n)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;var r=RV(),i=wH(),a=SH(),o=(NH(),t(TH).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=l,n.exports=e=l,n.exports.Ajv=l,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=l;var u=SV();Object.defineProperty(e,`KeywordCxt`,{enumerable:!0,get:function(){return u.KeywordCxt}});var d=Q();Object.defineProperty(e,`_`,{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,`str`,{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,`stringify`,{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,`nil`,{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,`Name`,{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,`CodeGen`,{enumerable:!0,get:function(){return d.CodeGen}});var f=CV();Object.defineProperty(e,`ValidationError`,{enumerable:!0,get:function(){return f.default}});var p=wV();Object.defineProperty(e,`MissingRefError`,{enumerable:!0,get:function(){return p.default}})})),FH=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.formatLimitDefinition=void 0;var t=PH(),n=Q(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}));r(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0});var n=CH(),r=FH(),i=Q(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,`__esModule`,{value:!0}),e.default=s}))();var IH=new Set([`integer`,`float`,`text`,`boolean`,`hidden`,`color`,`rules`,`data`,`hidden_data`,`data_collection`,`select`,`drill_down`,`data_column`,`group_tag`,`baseurl`,`genomebuild`,`directory_uri`]);function LH(e){return RH(e).map(zH)}function RH(e){if(Array.isArray(e))return e.filter(aU);if(e&&typeof e==`object`){let t=[];for(let[n,r]of Object.entries(e))if(aU(r)){let e={...r};e.name??=n,t.push(e)}return t}return[]}function zH(e){let t=BH(e);return t===`conditional`?VH(e):t===`repeat`?KH(e):t===`section`?qH(e):JH(e)}function BH(e){let t=e.type;return t===`conditional`?`conditional`:t===`repeat`?`repeat`:t===`section`?`section`:null}function VH(e){let t=oU(e.name),n=e.test_parameter;if(!aU(n))throw Error(`conditional '${t}' must define a 'test_parameter'`);let r=JH(n);if(r.parameter_type!==`gx_boolean`&&r.parameter_type!==`gx_select`)throw Error(`conditional '${t}' test_parameter must be boolean or select (got ${r.parameter_type})`);let i=HH(e,r);return{parameter_type:`gx_conditional`,name:t,hidden:cU(e.hidden,!1),label:sU(e.label),help:sU(e.help),argument:sU(e.argument),is_dynamic:!1,test_parameter:r,whens:i}}function HH(e,t){let n=UH(t),r=[],i=e.when,a=e.whens;if(aU(i))for(let[e,a]of Object.entries(i)){let i=Array.isArray(a)?a.filter(aU):[];r.push(WH(e,LH(i),n,t))}else if(Array.isArray(a))for(let e of a){if(!aU(e))continue;let i=e.discriminator,a=e.parameters;r.push(WH(i,LH(a),n,t))}return r}function UH(e){if(e.parameter_type===`gx_boolean`)return e.value??!1;if(e.parameter_type===`gx_select`){let t=e.options;if(!t)return null;let n=t.find(e=>e.selected);return n?n.value:t[0]?.value??null}return null}function WH(e,t,n,r){let i;return i=r.parameter_type===`gx_boolean`?GH(e):e==null?``:String(e),{discriminator:i,parameters:t,is_default_when:i===n}}function GH(e){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.toLowerCase();return t===`true`||t===`yes`||t===`1`}return!!e}function KH(e){let t=oU(e.name),n=LH(e.blocks??e.parameters??e.inputs);return{parameter_type:`gx_repeat`,name:t,hidden:cU(e.hidden,!1),label:sU(e.label),help:sU(e.help),argument:sU(e.argument),is_dynamic:!1,parameters:n,min:lU(e.min),max:lU(e.max)}}function qH(e){let t=oU(e.name),n=LH(e.parameters??e.inputs);return{parameter_type:`gx_section`,name:t,hidden:cU(e.hidden,!1),label:sU(e.label),help:sU(e.help),argument:sU(e.argument),is_dynamic:!1,parameters:n}}function JH(e){let t=oU(e.type);if(!IH.has(t))throw Error(`Unknown Galaxy parameter type '${t}'`);let n=YH(e);switch(t){case`integer`:{let t=n.optional,r=nU(e.value,t,`integer`);return{...n,parameter_type:`gx_integer`,type:`integer`,value:r,min:lU(e.min),max:lU(e.max),validators:rU(e.validators,`number`)}}case`float`:{let t=n.optional,r=nU(e.value,t,`float`);return{...n,parameter_type:`gx_float`,type:`float`,value:r,min:uU(e.min),max:uU(e.max),validators:rU(e.validators,`number`)}}case`text`:{let t=XH(e);return{...n,optional:t,parameter_type:`gx_text`,type:`text`,area:cU(e.area,!1),value:ZH(e.value,t),default_options:[],validators:rU(e.validators,`text`)}}case`boolean`:{n.optional;let t=e.checked,r=t==null?!1:GH(t);return{...n,parameter_type:`gx_boolean`,type:`boolean`,value:r,truevalue:sU(e.truevalue),falsevalue:sU(e.falsevalue)}}case`hidden`:return{...n,parameter_type:`gx_hidden`,type:`hidden`,value:sU(e.value),validators:rU(e.validators,`text`)};case`color`:{let t=typeof e.value==`string`?e.value:`#000000`;return{...n,parameter_type:`gx_color`,type:`color`,value:t}}case`rules`:return{...n,parameter_type:`gx_rules`,type:`rules`};case`data`:case`hidden_data`:{let r=t===`data`?n.optional:!0;return{...n,optional:r,parameter_type:`gx_data`,type:`data`,multiple:cU(e.multiple,!1),extensions:QH(e)}}case`data_collection`:return{...n,parameter_type:`gx_data_collection`,type:`data_collection`,collection_type:sU(e.collection_type),extensions:QH(e),value:e.default??e.value??null};case`select`:{let t=cU(e.multiple,!1),r=n.optional,i=$H(e),a=rU(e.validators,`select`),o=r?a.filter(e=>e.type!==`no_options`):a;return{...n,parameter_type:`gx_select`,type:`select`,multiple:t,options:i,validators:o}}case`drill_down`:return{...n,parameter_type:`gx_drill_down`,type:`drill_down`,multiple:cU(e.multiple,!1),hierarchy:e.hierarchy===`recurse`?`recurse`:`exact`,options:eU(e.options)??[]};case`data_column`:{let t=cU(e.multiple,!1),r=cU(e.accept_default,!1),i=n.optional,a=e.value;!i&&r&&(i=!0),r&&a==null&&(a=t?[0]:0);let o;if(a==null)o=null;else if(t)o=(Array.isArray(a)?a:String(a).split(`,`)).map(e=>Number(e)).filter(e=>!Number.isNaN(e));else{let e=typeof a==`number`?a:Number(a);o=Number.isNaN(e)?null:e}return{...n,optional:i,parameter_type:`gx_data_column`,type:`data_column`,multiple:t,value:o}}case`group_tag`:return{...n,parameter_type:`gx_group_tag`,type:`group_tag`,multiple:cU(e.multiple,!1)};case`baseurl`:return{...n,parameter_type:`gx_baseurl`,type:`baseurl`,value:sU(e.value)};case`genomebuild`:return{...n,parameter_type:`gx_genomebuild`,type:`genomebuild`,multiple:cU(e.multiple,!1),options:[]};case`directory_uri`:return{...n,parameter_type:`gx_directory_uri`,type:`directory_uri`,value:sU(e.value),validators:rU(e.validators,`text`)};default:throw Error(`Unknown Galaxy parameter type '${t}'`)}}function YH(e){return{name:oU(e.name),hidden:cU(e.hidden,!1),label:sU(e.label),help:sU(e.help),argument:sU(e.argument),is_dynamic:!1,optional:cU(e.optional,!1)}}function XH(e){return e.optional!==void 0&&e.optional!==null?GH(e.optional):e.value===void 0||e.value===null||e.value===``}function ZH(e,t){return typeof e==`string`?e:e==null?t?null:``:String(e)}function QH(e){let t=e.extensions;(t==null||Array.isArray(t)&&t.length===0)&&(t=e.format??`data`);let n;return n=Array.isArray(t)?t:typeof t==`string`?t.split(`,`):[`data`],n.map(e=>String(e).trim().toLowerCase()).filter(e=>e!==``)}function $H(e){let t=e.options;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!aU(e))continue;let t=e.value;if(t===void 0)continue;let r=String(t),i=typeof e.label==`string`?e.label:r,a=cU(e.selected,!1);n.push({label:i,value:r,selected:a})}return n}function eU(e){return Array.isArray(e)?e.filter(aU).map(tU):null}function tU(e){return{value:String(e.value??``),name:String(e.name??e.value??``),options:eU(e.options)??[],selected:cU(e.selected,!1)}}function nU(e,t,n){if(e==null||e===``)return null;let r=n===`integer`?parseInt(String(e),10):Number(e);if(Number.isNaN(r)){if(t)return null;throw Error(`invalid ${n} value: ${JSON.stringify(e)}`)}return r}function rU(e,t){if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!aU(t))continue;let e=iU(t);e&&n.push(e)}return t===`number`?n.filter(e=>e.type===`in_range`):t===`text`?n.filter(e=>e.type===`length`||e.type===`regex`||e.type===`expression`||e.type===`empty_field`):n.filter(e=>e.type===`no_options`)}function iU(e){let t=oU(e.type),n=cU(e.negate,!1);switch(t){case`in_range`:return{type:`in_range`,min:uU(e.min),max:uU(e.max),exclude_min:cU(e.exclude_min,!1),exclude_max:cU(e.exclude_max,!1),negate:n,message:sU(e.message)};case`regex`:return{type:`regex`,expression:oU(e.expression),negate:n};case`length`:return{type:`length`,min:lU(e.min),max:lU(e.max),negate:n};case`expression`:return{type:`expression`,expression:oU(e.expression),negate:n};case`empty_field`:return{type:`empty_field`,negate:n};case`no_options`:return{type:`no_options`,negate:n};default:return null}}function aU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function oU(e){return typeof e==`string`?e:e==null?``:String(e)}function sU(e){return e==null?null:typeof e==`string`?e:String(e)}function cU(e,t){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.toLowerCase();if(t===`true`||t===`yes`||t===`1`)return!0;if(t===`false`||t===`no`||t===`0`)return!1}return t}function lU(e){if(e==null||e===``)return null;let t=parseInt(String(e),10);return Number.isNaN(t)?null:t}function uU(e){if(e==null||e===``)return null;let t=Number(e);return Number.isNaN(t)?null:t}var dU={__default__:String.raw`primary_DATASET_ID_(?P<designation>[^_]+)_(?P<visible>[^_]+)_(?P<ext>[^_]+)(_(?P<dbkey>[^_]+))?`,__name__:String.raw`(?P<name>.*)`,__designation__:String.raw`(?P<designation>.*)`,__name_and_ext__:String.raw`(?P<name>.*)\.(?P<ext>[^\.]+)?`,__designation_and_ext__:String.raw`(?P<designation>.*)\.(?P<ext>[^\._]+)?`},fU=`filename`,pU=`lexical`,mU=new Set([`filename`,`name`,`designation`,`dbkey`]);function hU(e){return gU(e).map(_U)}function gU(e){if(Array.isArray(e))return e.filter(DU);if(e&&typeof e==`object`){let t=[];for(let[n,r]of Object.entries(e))if(DU(r)){let e={...r};e.name??=n,t.push(e)}return t}return[]}function _U(e){let t=typeof e.type==`string`?e.type:`data`;if(t===`collection`)return bU(e);if(t===`data`)return vU(e);if(t===`integer`)return yU(e,`integer`);if(t===`float`)return yU(e,`float`);if(t===`boolean`)return yU(e,`boolean`);if(t===`text`)return yU(e,`text`);throw Error(`Unknown output_type '${t}'`)}function vU(e){return{name:OU(e.name),label:kU(e.label),hidden:AU(e.hidden,!1),type:`data`,format:OU(e.format)||`data`,format_source:kU(e.format_source),metadata_source:kU(e.metadata_source),discover_datasets:SU(e.discover_datasets),from_work_dir:kU(e.from_work_dir),precreate_directory:AU(e.precreate_directory,!1)}}function yU(e,t){return{name:OU(e.name),label:kU(e.label),hidden:AU(e.hidden,!1),type:t}}function bU(e){return{name:OU(e.name),label:kU(e.label),hidden:AU(e.hidden,!1),type:`collection`,structure:xU(e)}}function xU(e){let t=DU(e.structure)?e.structure:e;return{collection_type:kU(t.collection_type),collection_type_source:kU(t.collection_type_source??t.type_source),collection_type_from_rules:kU(t.collection_type_from_rules),structured_like:kU(t.structured_like),discover_datasets:SU(t.discover_datasets)}}function SU(e){let t;if(e==null)return null;if(Array.isArray(e))t=e;else if(DU(e))t=[e];else return null;let n=t.filter(DU).map(CU);if(n.length>1&&n.some(e=>e.discover_via===`tool_provided_metadata`))throw Error(`Cannot specify more than one discover dataset condition if any of them specify tool_provided_metadata.`);return n}function CU(e){let t=AU(e.from_provided_metadata,!1),n=typeof e.discover_via==`string`?e.discover_via:t?`tool_provided_metadata`:`pattern`,r={format:kU(e.format??e.ext),visible:AU(e.visible,!1),assign_primary_output:AU(e.assign_primary_output,!1),directory:kU(e.directory),recurse:AU(e.recurse,!1),match_relative_path:AU(e.match_relative_path,!1)};if(n===`tool_provided_metadata`){if(e.pattern||e.sort_by)throw Error(`Cannot specify attribute [pattern] or [sort_by] if from_provided_metadata is True`);return{discover_via:`tool_provided_metadata`,...r}}let i=wU(e),[a,o,s]=TU(e);return{discover_via:`pattern`,...r,pattern:i,sort_key:a,sort_comp:o,sort_reverse:s}}function wU(e){let t=e.pattern,n=typeof t==`string`&&t?t:`__default__`;return dU[n]??n}function TU(e){if(e.sort_by==null&&typeof e.sort_key==`string`&&typeof e.sort_comp==`string`&&e.sort_reverse!==void 0)return[EU(e.sort_key),e.sort_comp===`numeric`?`numeric`:`lexical`,AU(e.sort_reverse,!1)];let t=typeof e.sort_by==`string`?e.sort_by:fU,n=!1;t.startsWith(`reverse_`)&&(n=!0,t=t.slice(8));let r=pU;if(t.includes(`_`)){let e=t.indexOf(`_`),n=t.slice(0,e);(n===`lexical`||n===`numeric`)&&(r=n,t=t.slice(e+1))}return[EU(t),r,n]}function EU(e){if(mU.has(e))return e;throw Error(`Invalid sort key '${e}'`)}function DU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function OU(e){return typeof e==`string`?e:e==null?``:String(e)}function kU(e){return e==null?null:typeof e==`string`?e:String(e)}function AU(e,t){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.toLowerCase();if(t===`true`||t===`yes`||t===`1`)return!0;if(t===`false`||t===`no`||t===`0`)return!1}return t}var jU=class extends Error{};function MU(e){if(!e||typeof e!=`object`||Array.isArray(e))throw new jU(`inline tool representation must be an object`);if(e.class!==`GalaxyUserTool`)throw new jU(`inline tool representation must have class 'GalaxyUserTool' (got ${JSON.stringify(e.class)})`);let t=typeof e.id==`string`?e.id:``,n=e.version==null?null:String(e.version),r=typeof e.name==`string`&&e.name||t||``,i=typeof e.description==`string`?e.description:``;return{id:t,version:n,name:r,description:i===``?null:i,inputs:LH(e.inputs),outputs:hU(e.outputs),citations:FU(e.citations),license:typeof e.license==`string`?e.license:null,profile:PU(e.profile),edam_operations:NU(e.edam_operations),edam_topics:NU(e.edam_topics),xrefs:IU(e.xrefs),help:LU(e.help)}}function NU(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function PU(e){return typeof e==`string`&&e?e:typeof e==`number`?String(e):`24.2`}function FU(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n,r=typeof e.type==`string`?e.type:null,i=typeof e.content==`string`?e.content:null;r&&i!==null&&t.push({type:r,content:i})}return t}function IU(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n,r=typeof e.value==`string`?e.value:null,i=typeof e.type==`string`?e.type:null;r!==null&&i&&t.push({value:r,type:i})}return t}function LU(e){if(e==null)return null;if(typeof e==`string`)return{format:`markdown`,content:e};if(typeof e==`object`&&!Array.isArray(e)){let t=e,n=typeof t.content==`string`?t.content:null;return n===null?null:{format:typeof t.format==`string`?t.format:`markdown`,content:n}}return null}var RU=`GALAXY_TOOLSHED_URL`;function zU(){if(typeof process<`u`)return{}[RU]}var BU=class{defaultToolshedUrl;index;storage;memoryCache=new Map;constructor(e){this.defaultToolshedUrl=e.defaultToolshedUrl??zU()??`https://toolshed.g2.bx.psu.edu`,this.storage=e.storage,this.index=new _t(this.storage)}resolveToolCoordinates(e,t){let n=pt(e);return n===null?{toolshedUrl:this.defaultToolshedUrl,trsToolId:e,version:t??null,readableId:mt(this.defaultToolshedUrl,e)}:{toolshedUrl:n.toolshedUrl,trsToolId:n.trsToolId,version:t??n.toolVersion,readableId:mt(n.toolshedUrl,n.trsToolId)}}async hasCached(e,t){let n=this.resolveToolCoordinates(e,t);if(n.version===null)return!1;let r=await ht(n.toolshedUrl,n.trsToolId,n.version);return this.memoryCache.has(r)||await this.storage.load(r)!==null}async loadCached(e){if(this.memoryCache.has(e))return this.memoryCache.get(e);try{let t=await this.storage.load(e);if(t===null)return null;let n=TA(jI)(t);if(!await this.index.has(e)){let r=t;await this.index.add(e,r.id??n.id??`unknown`,n.version??`unknown`,`orphan`)}return this.memoryCache.set(e,n),n}catch(t){return console.debug(`Failed to load cached tool ${e}: ${t}`),null}}async loadCachedRaw(e){return this.storage.load(e)}async statCached(e){return typeof this.storage.stat==`function`?this.storage.stat(e):null}async removeCached(e){let t=await this.index.has(e),n=t?!1:(await this.storage.list()).includes(e),r=t||n;return await this.storage.delete(e),await this.index.remove(e),this.memoryCache.delete(e),r}async saveTool(e,t,n,r,i,a=``){await this.storage.save(e,t),await this.index.add(e,n,r,i,a),this.memoryCache.set(e,t)}async listCached(){return this.index.listAll()}async getCacheStats(){let e=await this.index.listAll(),t={},n,r;for(let i of e)t[i.source]=(t[i.source]??0)+1,(n===void 0||i.cached_at<n)&&(n=i.cached_at),(r===void 0||i.cached_at>r)&&(r=i.cached_at);let i={count:e.length,bySource:t};if(n!==void 0&&(i.oldest=n),r!==void 0&&(i.newest=r),typeof this.storage.stat==`function`){let t=0;for(let n of e){let e=await this.storage.stat(n.cache_key);e!==null&&(t+=e.sizeBytes)}i.totalBytes=t}return i}async clearCache(e){if(e===void 0){let e=await this.storage.list();for(let t of e)await this.storage.delete(t);return await this.index.clear(),this.memoryCache.clear(),e.length}let t=e.replace(/\*$/,``),n=(await this.index.listAll()).filter(e=>e.tool_id.startsWith(t));for(let e of n)await this.storage.delete(e.cache_key),await this.index.remove(e.cache_key),this.memoryCache.delete(e.cache_key);return n.length}},VU=`galaxy-tool-cache-v1`,HU=`data`,UU=`__index__`,WU=class{dbName;db=null;constructor(e=VU){this.dbName=e}getDb(){return this.db===null?new Promise((e,t)=>{let n=indexedDB.open(this.dbName,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(HU)||t.createObjectStore(HU)},n.onsuccess=t=>{this.db=t.target.result,e(this.db)},n.onerror=()=>t(n.error)}):Promise.resolve(this.db)}async load(e){let t=await this.getDb();return new Promise((n,r)=>{let i=t.transaction(HU,`readonly`).objectStore(HU).get(e);i.onsuccess=()=>n(i.result??null),i.onerror=()=>r(i.error)})}async save(e,t){let n=await this.getDb();return new Promise((r,i)=>{let a=n.transaction(HU,`readwrite`);a.objectStore(HU).put(t,e),a.oncomplete=()=>r(),a.onerror=()=>i(a.error)})}async delete(e){let t=await this.getDb();return new Promise((n,r)=>{let i=t.transaction(HU,`readwrite`);i.objectStore(HU).delete(e),i.oncomplete=()=>n(),i.onerror=()=>r(i.error)})}async list(){let e=await this.getDb();return new Promise((t,n)=>{let r=e.transaction(HU,`readonly`).objectStore(HU).getAllKeys();r.onsuccess=()=>t(r.result.filter(e=>e!==UU)),r.onerror=()=>n(r.error)})}async stat(e){let t=await this.load(e);if(t===null)return null;let n;return n=t instanceof Blob?t.size:JSON.stringify(t).length,{sizeBytes:n}}async saveAll(e){let t=await this.getDb();return new Promise((n,r)=>{let i=t.transaction(HU,`readwrite`),a=i.objectStore(HU);for(let[t,n]of e)a.put(n,t);i.oncomplete=()=>n(),i.onerror=()=>r(i.error)})}},GU=class extends Error{url;statusCode;_tag=`ToolFetchError`;constructor(e,t,n){super(e),this.url=t,this.statusCode=n}};async function KU(e,t,n,r=globalThis.fetch){let i=`${e}/api/tools/${t}/versions/${n}`,a=await r(i,{headers:{Accept:`application/json`},signal:AbortSignal.timeout(3e4)});if(!a.ok){let e=await a.text().catch(()=>``);throw new GU(`Failed to fetch from ${i}: ${a.status} ${e.slice(0,200)}`,i,a.status)}let o=await a.json();return TA(jI)(o)}async function qU(e,t,n,r=globalThis.fetch){let i=`${e}/api/tools/${encodeURIComponent(t)}/parsed${n?`?tool_version=${encodeURIComponent(n)}`:``}`,a=await r(i,{headers:{Accept:`application/json`},signal:AbortSignal.timeout(3e4)});if(!a.ok){let e=await a.text().catch(()=>``);throw new GU(`Failed to fetch from Galaxy ${i}: ${a.status} ${e.slice(0,200)}`,i,a.status)}let o=await a.json();return TA(jI)(o)}var JU=3e4;function YU(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`TRS versions response: entries[${t}] must be an object`);let n=e;if(typeof n.id!=`string`)throw Error(`TRS versions response: entries[${t}].id must be a string`);if(n.name!==null&&typeof n.name!=`string`)throw Error(`TRS versions response: entries[${t}].name must be a string or null`);if(typeof n.url!=`string`)throw Error(`TRS versions response: entries[${t}].url must be a string`);if(!Array.isArray(n.descriptor_type)||n.descriptor_type.some(e=>typeof e!=`string`))throw Error(`TRS versions response: entries[${t}].descriptor_type must be a string array`);if(!Array.isArray(n.author)||n.author.some(e=>typeof e!=`string`))throw Error(`TRS versions response: entries[${t}].author must be a string array`);return n}async function XU(e,t,n=globalThis.fetch){let r=`${e}/api/ga4gh/trs/v2/tools/${encodeURIComponent(t)}/versions`,i;try{i=await n(r,{headers:{Accept:`application/json`},signal:AbortSignal.timeout(JU)})}catch(e){throw new GU(`TRS versions request to ${r} failed: ${e.message}`,r)}if(!i.ok){let e=await i.text().catch(()=>``);throw new GU(`TRS versions request to ${r} failed: ${i.status} ${e.slice(0,200)}`,r,i.status)}let a=await i.json();if(!Array.isArray(a))throw new GU(`TRS versions response from ${r} was not an array`,r,i.status);try{return a.map(YU)}catch(e){throw new GU(`TRS versions response from ${r} was malformed: ${e.message}`,r,i.status)}}async function ZU(e,t,n=globalThis.fetch){let r=await XU(e,t,n);return r.length>0?r[r.length-1].id:null}var QU=class{cache;sources;fetcher;constructor(e){this.cache=new BU({storage:e.storage,defaultToolshedUrl:e.defaultToolshedUrl}),this.fetcher=e.fetcher??globalThis.fetch,e.sources?this.sources=e.sources:(this.sources=[{type:`toolshed`,url:e.defaultToolshedUrl??this.cache.defaultToolshedUrl}],e.galaxyUrl&&this.sources.push({type:`galaxy`,url:e.galaxyUrl}))}async getToolInfo(e,t){let n=this.cache.resolveToolCoordinates(e,t),r=n.version;if(r===null&&(r=await this.resolveLatestVersion(n.toolshedUrl,n.trsToolId),r===null))throw Error(`No version available for tool: ${e}`);let i=await ht(n.toolshedUrl,n.trsToolId,r),a=await this.cache.loadCached(i);if(a!==null)return a;for(let t of this.sources)try{let a,o,s;return t.type===`toolshed`?(a=await KU(t.url,n.trsToolId,r,this.fetcher),o=`api`,s=`${t.url}/api/tools/${n.trsToolId}/versions/${r}`):(a=await qU(t.url,e,r,this.fetcher),o=`galaxy`,s=`${t.url}/api/tools/${encodeURIComponent(e)}/parsed`),await this.cache.saveTool(i,a,n.readableId,r,o,s),a}catch(e){let r=e instanceof Error?e.message:String(e);console.debug(`${t.type} fetch failed (${t.url}) for ${n.trsToolId}: ${r}`)}return null}async resolveLatestVersion(e,t){try{return await ZU(e,t,this.fetcher)}catch(n){let r=n instanceof Error?n.message:String(n);return console.debug(`TRS latest-version lookup failed for ${t} on ${e}: ${r}`),null}}async refetch(e,t,n){let r=this.cache.resolveToolCoordinates(e,t??null),i=r.version,a=!1;if(i!==null&&(a=await this.cache.hasCached(e,i)),a&&!n?.force)return{cacheKey:await ht(r.toolshedUrl,r.trsToolId,i),fetched:!1,alreadyCached:!0};if(a&&n?.force&&i!==null){let e=await ht(r.toolshedUrl,r.trsToolId,i);await this.cache.removeCached(e)}let o=await this.getToolInfo(e,t??null);if(o===null)throw Error(`Failed to fetch tool: ${e}`);return i=o.version??i??`unknown`,{cacheKey:await ht(r.toolshedUrl,r.trsToolId,i),fetched:!0,alreadyCached:a}}async addTool(e,t,n,r=`local`,i=``){let a=this.cache.resolveToolCoordinates(e,t),o=a.version??t,s=await ht(a.toolshedUrl,a.trsToolId,o);return await this.cache.saveTool(s,n,a.readableId,o,r,i),s}},$U=null,eW=`https://toolshed.g2.bx.psu.edu`,tW=`gxwf-ui:tool-cache`;function nW(e={}){if($U)return $U;let t={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},n=e.toolshedUrl??t.VITE_GXWF_TOOLSHED_URL??eW,r=e.toolCacheProxyUrl??t.VITE_GXWF_TOOL_CACHE_PROXY_URL,i=e.cacheDbName??t.VITE_GXWF_CACHE_DB_NAME??tW,a=[];r&&a.push({type:`galaxy`,url:r}),a.push({type:`toolshed`,url:n});let o=new WU(i);return n!==eW&&console.info(`[gxwf-ui] VITE_GXWF_TOOLSHED_URL=${n} — ensure the page CSP connect-src includes this origin (gxwf-web: --csp-connect-src).`),$U=new QU({storage:o,sources:a,defaultToolshedUrl:n}),$U}export{JB as a,pt as c,je as d,$B as i,ct as l,MU as n,pB as o,oV as r,tz as s,nW as t,We as u};
|