"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function q(t,e,n,o,r,s,u,a,m){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return o(n(e(t.apply(this,arguments))))};case 5:return function(){return r(o(n(e(t.apply(this,arguments)))))};case 6:return function(){return s(r(o(n(e(t.apply(this,arguments))))))};case 7:return function(){return u(s(r(o(n(e(t.apply(this,arguments)))))))};case 8:return function(){return a(u(s(r(o(n(e(t.apply(this,arguments))))))))};case 9:return function(){return m(a(u(s(r(o(n(e(t.apply(this,arguments)))))))))}}}function c(t,e,n,o,r,s,u,a,m){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return n(e(t));case 4:return o(n(e(t)));case 5:return r(o(n(e(t))));case 6:return s(r(o(n(e(t)))));case 7:return u(s(r(o(n(e(t))))));case 8:return a(u(s(r(o(n(e(t)))))));case 9:return m(a(u(s(r(o(n(e(t))))))));default:{let C=arguments[0];for(let H=1;He=>(t(e),e),ee=t=>e=>e.then(n=>(t(n),n)),ne=t=>t==="",pt=t=>t.trim(),gt=t=>t.toLowerCase(),oe=t=>t.toUpperCase(),B=t=>typeof t=="string",re=t=>t.length,se=t=>t.split("").reverse().join(""),ce=t=>e=>{const n=e.split(t);return n.length>0?n:[e]},J=t=>{if(t.length<1)return"";const[e,...n]=t.split("");return[e.toUpperCase(),...n].join("")},Q=t=>{if(t.length<1)return"";const[e,...n]=t.split("");return[e.toLowerCase(),...n].join("")},ue=Object.freeze(Object.defineProperty({__proto__:null,capitalize:J,isEmpty:ne,isString:B,length:re,reverse:se,split:ce,toLowerCase:gt,toUpperCase:oe,trim:pt,uncapitalize:Q},Symbol.toStringTag,{value:"Module"})),F=t=>({equals:(e,n)=>e===n||t(e,n)}),le=(t,e)=>({equals:(n,o)=>n===o||t.equals(e(n),e(o))}),ie=t=>F((e,n)=>{for(const o in t)if(!t[o].equals(e[o],n[o]))return!1;return!0}),X=Object.freeze(F((t,e)=>t===e)),ae=F((t,e)=>t.valueOf()===e.valueOf()),fe=X,pe=X,ge=Object.freeze(Object.defineProperty({__proto__:null,Date:ae,Default:X,Number:pe,String:fe,deriveFrom:le,ofEquals:F,ofStruct:ie},Symbol.toStringTag,{value:"Module"})),g=ge,A=t=>({compare:(e,n)=>e===n?0:t(e,n)}),de=({compare:t})=>A((e,n)=>t(n,e)),dt=(t,e)=>({compare:(n,o)=>n===o?0:t.compare(e(n),e(o))}),Y=A((t,e)=>{const n=B(t)?t:globalThis.String(t),o=B(e)?e:globalThis.String(e);return no?1:0}),he=(...t)=>t.length<1?Y:A((e,n)=>t.reduce((o,r)=>o!==0?o:r.compare(e,n),0)),ht=A((t,e)=>e-t>0?-1:1),me=Y,ye=dt(ht,t=>t.valueOf()),$e=t=>({compare:t.compare,equals:(e,n)=>e===n||t.compare(e,n)===0}),ve=({compare:t})=>(e,n)=>t(e,n)===1,mt=({compare:t})=>(e,n)=>t(e,n)>=0,Ee=({compare:t})=>(e,n)=>t(e,n)===-1,yt=({compare:t})=>(e,n)=>t(e,n)<=0,_e=t=>(e,n)=>o=>mt(t)(o,e)&&yt(t)(o,n),Oe=Object.freeze(Object.defineProperty({__proto__:null,Date:ye,Default:Y,Number:ht,String:me,deriveEqualityComparer:$e,deriveFrom:dt,geq:mt,getComposite:he,gt:ve,isBetween:_e,leq:yt,lt:Ee,ofCompare:A,reverse:de},Symbol.toStringTag,{value:"Module"})),b=Oe,be=t=>g.ofEquals((e,n)=>e==null&&n==null||e!=null&&n!=null&&t.equals(e,n)),Se=t=>e=>e??t,ke=t=>e=>e??t(),Me=t=>e=>e!=null?t(e):e,je=t=>e=>{e!=null&&t(e)},$t=t=>e=>e!=null?t(e):e,we=$t,Pe=Object.freeze(Object.defineProperty({__proto__:null,bind:$t,defaultValue:Se,defaultWith:ke,flatMap:we,getEqualityComparer:be,iter:je,map:Me},Symbol.toStringTag,{value:"Module"})),Re=Pe,T=t=>{throw new Error(`assertExhaustive failed at runtime! It was called with ${t}`)},v=t=>({_tag:"Some",some:t}),qe=v,y=Object.freeze({_tag:"None"}),ze=t=>typeof t!="function",ut=(t,e)=>ze(t)?t:t(e),E=t=>e=>{switch(e._tag){case"Some":return ut(t.some,e.some);case"None":return ut(t.none,void 0);default:return T(e)}},vt=t=>E({some:e=>v(t(e)),none:y}),Ce=t=>E({some:t,none:void 0}),Ae=t=>E({some:e=>t(e)?v(e):y,none:y}),Te=t=>E({some:e=>t(e)?v(e):y,none:y}),Et=t=>E({some:e=>e,none:t}),De=t=>E({some:e=>e,none:t}),_t=t=>E({some:t,none:y}),Ne=_t,w=t=>t._tag==="Some",xe=t=>t._tag==="None",Ot=t=>e=>w(e[0])&&w(e[1])?v(t(e[0].some,e[1].some)):y,Ve=t=>e=>w(e[0])&&w(e[1])&&w(e[2])?v(t(e[0].some,e[1].some,e[2].some)):y,Ke=t=>t!=null?v(t):y,Be=(t,e=!0)=>c(t,E({some:n=>n,none:e?null:void 0})),Fe=t=>{try{return v(t())}catch{return y}},Ie=({equals:t})=>g.ofEquals((e,n)=>c([e,n],Ot((o,r)=>t(o,r)),Et(!1))),We=t=>e=>c(e,vt(n=>(t(n),n))),Le=Object.freeze(Object.defineProperty({__proto__:null,bind:_t,defaultValue:Et,defaultWith:De,filter:Ae,flatMap:Ne,getEqualityComparer:Ie,isNone:xe,isSome:w,iter:Ce,map:vt,map2:Ot,map3:Ve,match:E,none:y,of:qe,ofNullish:Ke,refine:Te,some:v,tee:We,toNullish:Be,tryCatch:Fe},Symbol.toStringTag,{value:"Module"})),l=Le,h=t=>({_tag:"Ok",ok:t}),f=t=>({_tag:"Err",err:t}),Ue=h,He=t=>typeof t!="function",lt=(t,e)=>He(t)?t:t(e),$=t=>e=>{switch(e._tag){case"Ok":return lt(t.ok,e.ok);case"Err":return lt(t.err,e.err);default:return T(e)}},Ge=(t,e)=>n=>c(n,$({ok:o=>t(o)?h(o):f(e(o)),err:o=>f(o)})),Je=t=>e=>c(e,$({ok:n=>h(t(n)),err:n=>f(n)})),Qe=t=>e=>c(e,$({ok:n=>h(n),err:n=>f(t(n))})),Xe=(t,e)=>$({ok:n=>h(t(n)),err:n=>f(e(n))}),bt=t=>e=>c(e,$({ok:n=>n,err:t})),Ye=t=>e=>c(e,$({ok:n=>n,err:t})),St=t=>$({ok:t,err:e=>f(e)}),Ze=St,P=t=>t._tag==="Ok",R=t=>t._tag==="Err",kt=t=>e=>P(e[0])&&P(e[1])?h(t(e[0].ok,e[1].ok)):R(e[0])?f(e[0].err):f(e[1].err),tn=t=>e=>P(e[0])&&P(e[1])&&P(e[2])?h(t(e[0].ok,e[1].ok,e[2].ok)):R(e[0])?f(e[0].err):R(e[1])?f(e[1].err):f(e[2].err);function en(t,e){const n=o=>o instanceof Error?o:Error(String(o));try{return h(t())}catch(o){return e!=null?f(e(o)):f(n(o))}}const nn=t=>e=>c(e,$({ok:n=>(t(n),h(n)),err:n=>f(n)})),on=t=>e=>c(e,$({ok:n=>h(n),err:n=>(t(n),f(n))})),rn=t=>l.match({some:h,none:q(t,f)}),sn=(t,e)=>g.ofEquals((n,o)=>R(n)&&R(o)&&e.equals(n.err,o.err)?!0:c([n,o],kt((r,s)=>t.equals(r,s)),bt(!1))),cn=Object.freeze(Object.defineProperty({__proto__:null,bind:St,defaultValue:bt,defaultWith:Ye,err:f,flatMap:Ze,getEqualityComparer:sn,isErr:R,isOk:P,map:Je,map2:kt,map3:tn,mapBoth:Xe,mapErr:Qe,match:$,of:Ue,ofOption:rn,ok:h,refine:Ge,tee:nn,teeErr:on,tryCatch:en},Symbol.toStringTag,{value:"Module"})),i=cn,Mt=t=>()=>Promise.resolve(t),un=t=>e=>()=>e().then(t),jt=t=>e=>()=>e().then(n=>t(n)()),ln=jt,an=t=>()=>t().then(e=>e()),fn=Mt({}),pn=t=>e=>async()=>{const n=t<=0?0:Math.floor(t);return await new Promise(o=>setTimeout(o,n)),await e()},gn=t=>async()=>{const e=[];for(let n=0;nt(),dn=t=>()=>Promise.all(t.map(wt)),hn=t=>()=>t,mn=t=>(...e)=>()=>t(...e),yn=t=>e=>async()=>{const n=await e();return t(n),n},$n=()=>new Promise(()=>{}),vn=Object.freeze(Object.defineProperty({__proto__:null,asyncify:mn,bind:jt,delay:pn,flatMap:ln,flatten:an,map:un,never:$n,of:Mt,ofPromise:hn,parallel:dn,sequential:gn,start:wt,tee:yn,unit:fn},Symbol.toStringTag,{value:"Module"})),I=vn,En=t=>()=>Promise.resolve(i.ok(t)),Pt=t=>()=>Promise.resolve(i.err(t)),_n=t=>e=>()=>e().then(i.map(t)),On=t=>e=>()=>e().then(i.mapErr(t)),bn=(t,e)=>n=>()=>n().then(i.mapBoth(t,e)),Rt=t=>e=>async()=>{const n=await e();return await c(n,i.match({ok:t,err:o=>Pt(o)}),I.start)},Sn=Rt,qt=t=>e=>()=>e().then(i.bind(t)),kn=qt,Mn=t=>()=>Promise.resolve(t),jn=t=>()=>t().then(e=>i.ok(e));function wn(t,e){return async()=>{const n=o=>o instanceof Error?o:Error(String(o));try{return i.ok(await t())}catch(o){return e!=null?i.err(e(o)):i.err(n(o))}}}const Pn=t=>e=>()=>e().then(i.match(t)),Rn=t=>t(),qn=t=>e=>I.tee(i.tee(t))(e),zn=t=>e=>I.tee(i.teeErr(t))(e),Cn=Object.freeze(Object.defineProperty({__proto__:null,bind:Rt,bindResult:qt,err:Pt,flatMap:Sn,flatMapResult:kn,map:_n,mapBoth:bn,mapErr:On,match:Pn,ofAsync:jn,ofResult:Mn,ok:En,start:Rn,tee:qn,teeErr:zn,tryCatch:wn},Symbol.toStringTag,{value:"Module"})),An=Cn;function zt(t){return e=>e.filter(t)}const Tn=t=>e=>e.filter(t),Dn=t=>e=>e.map(t),Nn=t=>e=>e.map(t),xn=t=>e=>{const n=[];for(let o=0;oe=>{const n=[];for(let o=0;ot.length>0?l.some(t[0]):l.none,Kn=Ct,Bn=t=>{if(t.length===0)return l.none;const[e,...n]=t;return l.some(n)},Fn=t=>e=>{const n=t<=0?0:Math.floor(t);if(n>e.length)return e;const o=[];for(let r=0;re=>{const n=t<=0?0:Math.floor(t);if(n>=e.length)return[];const o=[];for(let r=n;rn=>n.reduce(e,t),Ln=(t,e)=>n=>n.reduceRight(e,t),Un=t=>typeof t!="function",it=(t,e)=>Un(t)?t:t(e),Hn=t=>e=>e.length>0?it(t.nonEmpty,e):it(t.empty,void 0),p=t=>t.length===0,Gn=t=>t.length>0,At=t=>e=>e.flatMap(t),Jn=At,Tt=t=>e=>[...e,t],Qn=t=>e=>[t,...e],Xn=t=>e=>{const n=new Map;return e.forEach(o=>{const r=t(o);return n.has(r)?n.set(r,c(n.get(r),Tt(o))):n.set(r,[o])}),n},Dt=t=>e=>[...e,...t],Yn=t=>e=>[...t,...e],Nt=t=>e=>e.some(t),Zn=Nt,to=t=>t.flat(),eo=t=>e=>{if(p(e))return[];const n=t<=1?1:Math.floor(t),o=Math.ceil(e.length/n),r=[...globalThis.Array(o)].map(()=>[]);let s=0;for(let u=0;ut.length,D=(t,e=g.Default)=>n=>{if(p(n))return!1;const o=r=>e.equals(t,r);return n.some(o)},N=t=>e=>{if(p(e))return[];const n=[];return e.forEach(o=>{D(o,t)(n)||n.push(o)}),n},no=(t,e)=>n=>{if(p(n))return[];const o=[],r=[];return n.forEach(s=>{const u=t(s);D(u,e)(r)||(r.push(u),o.push(s))}),o},oo=t=>e=>p(e)?[]:e.slice(0).sort(t==null?void 0:t.compare),ro=(t,e=b.Default)=>n=>p(n)?[]:n.slice(0).sort((o,r)=>e.compare(t(o),t(r))),so=t=>t.slice(0).reverse(),Z=t=>e=>l.ofNullish(e.find(t)),xt=t=>e=>{const n=e.findIndex(t);return n<0?l.none:l.some(n)},Vt=(t,e)=>n=>{if(p(n))return[];if(p(t))return n;const o=[];for(let r=0;rn=>p(t)&&p(n)?[]:c(n,Dt(t),N(e)),uo=({equals:t})=>g.ofEquals((e,n)=>{if(p(e)&&p(n))return!0;if(e.length!==n.length)return!1;for(let o=0;ot,io=t=>e=>e.forEach(n=>t(n)),ao=Object.freeze(Object.defineProperty({__proto__:null,append:Tt,asMutable:lo,bind:At,choose:xn,chooseR:Vn,chunk:eo,concat:Dt,concatFirst:Yn,contains:D,except:Vt,exists:Nt,filter:zt,filteri:Tn,find:Z,findIndex:xt,first:Kn,flatMap:Jn,flatten:to,getEqualityComparer:uo,groupBy:Xn,head:Ct,isEmpty:p,isNonEmpty:Gn,iter:io,length:W,map:Dn,mapi:Nn,match:Hn,prepend:Qn,reduce:Wn,reduceRight:Ln,reverse:so,skip:In,some:Zn,sort:oo,sortBy:ro,tail:Bn,take:Fn,union:co,uniq:N,uniqBy:no},Symbol.toStringTag,{value:"Module"})),Kt=t=>t[0],fo=Kt,po=t=>({head:t[0],tail:t.slice(1)}),go=t=>e=>e.map(t),Bt=t=>e=>e.flatMap(t),ho=Bt,mo=t=>[t],yo=(t,e)=>{const n=Math.floor(t),o=Math.floor(e);if(n>=o)return[n];const r=[];for(let s=n;s<=o;s++)r.push(s);return r},$o=(t,e)=>{const n=t<=1?1:Math.floor(t);return[...Array(n).keys()].map(e)},vo=t=>t.slice(0).reverse(),Eo=(t=b.Default)=>e=>e.slice(0).sort(t.compare),_o=({equals:t})=>g.ofEquals((e,n)=>{if(e.length!==n.length)return!1;for(let o=0;on=>{if(n.size<1)return l.none;for(const[o,r]of n)if(e(o,t))return l.some([o,r]);return l.none},So=(t,e)=>n=>c(n,z(t,e),l.isSome),ko=(t,e)=>n=>c(n,z(t,e),l.map(([,o])=>o)),tt=([t,e],n)=>o=>{if(o.size<1){const s=O();return s.set(t,e),s}const r=new globalThis.Map(o);return c(o,z(t,n),l.match({none:()=>(r.set(t,e),r),some:([s])=>(r.set(s,e),r)}))},Mo=t=>e=>{if(e.size<1)return O();const n=O();for(const[o,r]of e)n.set(o,t(o,r));return n},jo=(t,e)=>n=>c(n,et(e),o=>o.find(t),l.ofNullish),O=()=>new globalThis.Map,wo=t=>e=>{if(e.size<1)return!1;for(const[,n]of e)if(t(n))return!0;return!1},Po=(t,e,n)=>o=>c(o,z(t,n),l.match({some:([r,s])=>{const u=new globalThis.Map(o);return u.set(r,e(s)),u},none:o})),Ro=t=>t.size,qo=t=>t.size<1,et=({compare:t}=b.Default)=>e=>Array.from(e.keys()).sort(t),zo=({compare:t}=b.Default)=>e=>{const n=[];for(const[,o]of e)n.push(o);return n.sort(t)},nt=t=>e=>c(e,et(t),n=>n.map(o=>[o,e.get(o)])),Co=(t,e,n)=>o=>c(o,nt(n),r=>r.reduce((s,[u,a])=>e(s,u,a),t)),Ao=(t,e,n)=>o=>c(o,nt(n),r=>r.reduceRight((s,[u,a])=>e(s,u,a),t)),To=t=>e=>{if(e.size<1)return O();const n=O();for(const[o,r]of e)t(o,r)&&n.set(o,r);return n},Do=t=>e=>{if(e.size<1)return!0;for(const[n,o]of e)if(!t(n,o))return!1;return!0},No=t=>e=>{if(!(e.size<1))for(const[n,o]of e)t(n,o)},xo=(t,e)=>t.length<1?new globalThis.Map:t.reduce((n,o)=>tt(o,e)(n),O()),Vo=(t,e)=>n=>c(n,z(t,e),l.match({some:([o])=>{const r=new globalThis.Map(n);return r.delete(o),r},none:n})),Ko=(t,e)=>Object.entries(t).reduce((n,[o,r])=>tt([o,r],e)(n),O()),Bo=Object.freeze(Object.defineProperty({__proto__:null,change:Po,containsKey:So,empty:O,every:Do,exists:wo,filter:To,find:ko,findKey:jo,findWithKey:z,isEmpty:qo,iter:No,keys:et,map:Mo,ofArray:xo,ofRecord:Ko,reduce:Co,reduceRight:Ao,remove:Vo,set:tt,size:Ro,toArray:nt,values:zo},Symbol.toStringTag,{value:"Module"})),Ft=Object.freeze({_tag:"NotStarted"}),It=Object.freeze({_tag:"InProgress"}),Wt=t=>({_tag:"Resolved",resolved:t}),_=(t,...e)=>(o=>typeof o=="function")(t)?t(...e):t,Lt=t=>e=>{switch(e._tag){case"NotStarted":return _(t.notStarted);case"InProgress":return _(t.inProgress);case"Resolved":return _(t.resolved,e.resolved);default:return T(e)}},x=t=>e=>{switch(e._tag){case"NotStarted":return _(t.notStarted!=null?t.notStarted:t.orElse);case"InProgress":return _(t.inProgress!=null?t.inProgress:t.orElse);case"Resolved":return t.resolved!=null?_(t.resolved,e.resolved):_(t.orElse);default:return _(t.orElse)}},Fo=x({resolved:!1,orElse:!0}),Io=t=>c(t,x({inProgress:!0,orElse:!1})),Wo=t=>c(t,x({resolved:!0,orElse:!1})),Lo=(t,e=g.Default)=>x({resolved:n=>e.equals(n,t),orElse:!1}),Uo=t=>Lt({resolved:q(t,Wt),inProgress:It,notStarted:Ft}),Ho=Object.freeze(Object.defineProperty({__proto__:null,inProgress:It,isInProgress:Io,isResolved:Wo,isResolvedWith:Lo,isUnresolved:Fo,map:Uo,match:Lt,matchOrElse:x,notStarted:Ft,resolved:Wt},Symbol.toStringTag,{value:"Module"})),k=Ho,Go=(t,e)=>`Must be an enum value in the set ${e}{ ${t.join(", ")} }`,at=t=>c(l.some(t),l.refine(B),l.map(q(pt,gt)),l.defaultValue(t)),Jo=t=>typeof t=="string"||typeof t=="number",Qo=(t,e)=>n=>c(l.ofNullish(n),i.ofOption(()=>`Enum${e?` ${e}`:""} cannot be null/undefined`),i.refine(Jo,()=>`Enum${e?` ${e}`:""} must be a string or number`),i.map(at),i.bind(o=>c(t,Z(r=>at(r)===o),l.match({some:r=>i.ok(r),none:()=>i.err(Go(t,e))})))),G=t=>typeof t=="function",Xo=t=>e=>n=>{const o=Object.entries(t).find(([,u])=>u===n);if(!o)throw new TypeError(`Expected to match against an enum where '${n}' is a valid value.`);const r=o[0];if(!Object.hasOwn(e,r))throw new TypeError(`Expected a matcher containing a case for '${r}'.`);const s=e[r];return G(s)?s():s},Yo=t=>e=>n=>{const o=Object.entries(t).find(([,s])=>s===n);if(!o)throw new TypeError(`Expected to match against an enum where '${n}' is a valid value.`);const r=o[0];if(Object.hasOwn(e,r)){const s=e[r];return G(s)?s():s}return G(e.orElse)?e.orElse():e.orElse},Zo=(t,e="")=>{const n=Object.entries(t).reduce((r,[s,u])=>({...r,[s]:u}),{}),o=Object.values(t);return{...n,values:o,parse:Qo(o,e),match:Xo(t),matchOrElse:Yo(t)}},tr=t=>typeof t=="function",Ut=(t,e,n)=>Object.entries(t).reduce((o,r)=>{const[s,u]=r,a=J(s),m=n.length>0?`${n}${a}`:`${a}`;return Object.assign(o,{[s]:tr(u)?(...C)=>({[e]:m,...u(...C)}):{[e]:m}})},{}),Ht=(t,e)=>Object.entries(t).reduce((n,o)=>{const[r]=o,s=J(r),u=e.length>0?`${e}${s}`:`${s}`;return Object.assign(n,{[r]:u})},{}),Gt=(t,e)=>e.length>0?t.replace(new RegExp(`${e}`),""):t,Jt=(t,e)=>n=>o=>{const r=Q(Gt(o[t],e));if(!Object.hasOwn(n,r))throw new TypeError(`Expected to be given a variant with scope ${e}. Actual type was ${o[t]}`);const s=n[r],u={...o};return delete u[t],typeof s=="function"?s(u):s},Qt=(t,e)=>n=>o=>{const r=Q(Gt(o[t],e));if(Object.hasOwn(n,r)){const s=n[r],u={...o};return delete u[t],typeof s=="function"?s(u):s}return typeof n.orElse=="function"?n.orElse():n.orElse},er=(t,e,n)=>({...Ut(t,e,n),match:Jt(e,n),matchOrElse:Qt(e,n),types:Ht(t,n)}),nr=t=>({...Ut(t,"_tag",""),match:Jt("_tag",""),matchOrElse:Qt("_tag",""),types:Ht(t,"")}),ot=t=>k.resolved(i.ok(t)),rt=t=>k.resolved(i.err(t)),or=t=>typeof t!="function",d=(t,e)=>or(t)?t:t(e),K=(t,e)=>Object.hasOwn(e,t),st=t=>e=>{switch(e._tag){case"InProgress":return d(t.inProgress,void 0);case"NotStarted":return d(t.notStarted,void 0);case"Resolved":return c(e.resolved,i.match({ok:n=>d(t.resolvedOk,n),err:n=>d(t.resolvedErr,n)}));default:return T(e)}},Xt=t=>e=>{switch(e._tag){case"InProgress":return K("inProgress",t)?d(t.inProgress,void 0):d(t.orElse,void 0);case"NotStarted":return K("notStarted",t)?d(t.notStarted,void 0):d(t.orElse,void 0);case"Resolved":return c(e.resolved,i.match({ok:n=>K("resolvedOk",t)?d(t.resolvedOk,n):d(t.orElse,void 0),err:n=>K("resolvedErr",t)?d(t.resolvedErr,n):d(t.orElse,void 0)}));default:return T(e)}},rr=t=>st({resolvedOk:q(t,ot),resolvedErr:rt,inProgress:k.inProgress,notStarted:k.notStarted}),sr=t=>st({resolvedErr:q(t,rt),resolvedOk:ot,inProgress:k.inProgress,notStarted:k.notStarted}),cr=t=>e=>c(e,Xt({resolvedOk:n=>n,orElse:t})),ur=Object.freeze(Object.defineProperty({__proto__:null,err:rt,map:rr,mapErr:sr,match:st,matchOrElse:Xt,ok:ot,unwrap:cr},Symbol.toStringTag,{value:"Module"})),lr=ur,S=t=>c(t,U(),W)<1,M=()=>({}),V=(t,{equals:e}=g.Default)=>n=>{if(S(n))return l.none;for(const o in n){const r=n[o];if(e(o,t)&&r!=null)return l.some([o,r])}return l.none},ir=(t,e)=>n=>c(n,V(t,e),l.isSome),ar=(t,e)=>n=>c(n,V(t,e),l.map(([,o])=>o)),L=([t,e],n)=>o=>S(o)?{[t]:e}:c(o,V(t,n),l.match({none:()=>({...o,[t]:e}),some:([r])=>({...o,[r]:e})})),fr=t=>e=>{if(S(e))return M();const n=M();for(const o in e){const r=e[o];r!=null&&(n[o]=t(o,r))}return n},U=({compare:t}=b.Default)=>e=>{const n=[];for(const o in e)e[o]!=null&&n.push(o);return n.sort(t)},pr=(t,e=b.Default)=>n=>c(n,U(e),o=>o.find(t),l.ofNullish),gr=t=>e=>{if(S(e))return!1;for(const n in e){const o=e[n];if(o!=null&&t(o))return!0}return!1},dr=(t,e,n)=>o=>c(o,V(t,n),l.match({some:([r,s])=>c(o,L([r,e(s)])),none:o})),hr=t=>{let e=0;for(const n in t)t[n]!=null&&e++;return e},mr=(t=b.Default)=>e=>{const n=[];for(const o in e){const r=e[o];r!=null&&n.push(r)}return n.sort(t.compare)},ct=t=>e=>c(e,U(t),n=>n.map(o=>[o,e[o]])),yr=(t,e,n)=>o=>c(o,ct(n),r=>r.reduce((s,[u,a])=>e(s,u,a),t)),$r=(t,e,n)=>o=>c(o,ct(n),r=>r.reduceRight((s,[u,a])=>e(s,u,a),t)),vr=t=>e=>{if(S(e))return e;const n=M();for(const o in e){const r=e[o];r!=null&&t(o,r)&&(n[o]=r)}return n},Er=t=>e=>{if(S(e))return!0;for(const n in e){const o=e[n];if(o!=null&&!t(n,o))return!1}return!0},_r=t=>e=>{if(!S(e))for(const n in e){const o=e[n];o!=null&&t(n,o)}},Or=(t,e)=>t.length<1?M():t.reduce((n,o)=>c(n,L(o,e)),M()),br=(t,{equals:e}=g.Default)=>n=>{const o=r=>e(t,r);return c(Object.keys(n),Z(o),l.match({some:r=>{const s={...n};return delete s[r],s},none:n}))},Sr=(t,e)=>Object.entries(t).reduce((n,[o,r])=>c(n,L([o,r],e)),M()),kr=Object.freeze(Object.defineProperty({__proto__:null,change:dr,containsKey:ir,empty:M,every:Er,exists:gr,filter:vr,find:ar,findKey:pr,findWithKey:V,isEmpty:S,iter:_r,keys:U,map:fr,ofArray:Or,ofRecord:Sr,reduce:yr,reduceRight:$r,remove:br,set:L,size:hr,toArray:ct,values:mr},Symbol.toStringTag,{value:"Module"})),Mr=kr,jr=t=>typeof t!="function",ft=t=>jr(t)?t:t(),wr=t=>e=>{switch(e){case!0:return ft(t.true);case!1:return ft(t.false)}},j=t=>t,Pr=()=>j([]),Rr=(t,e)=>c(t,N(e),W)===t.length,qr=(t,e)=>n=>c(n,D(t,e),wr({true:n,false:j([t,...n])})),zr=(t,{equals:e}=g.Default)=>n=>c(n,zt(o=>!e(o,t)),j),Yt=(t,e)=>c(t,N(e),j),Cr=Yt,Ar=(t,e)=>n=>c([...n,...t],N(e),j),Tr=(t,{equals:e}=g.Default)=>n=>{const o=a=>m=>e(a,m),r=n.length>t.length?n:t,s=(r===n?t:n).slice(),u=[];for(const a of r)c(s,xt(o(a)),l.match({some:m=>{u.push(s[m]),s.splice(m,1)},none:void 0}));return j(u)},Zt=(t,e)=>n=>c(n,Vt(t,e),j),Dr=t=>({equals:(e,n)=>e.length===0&&n.length===0?!0:e.length!==n.length?!1:c(e,Zt(n,t),W)===0}),Nr=Object.freeze(Object.defineProperty({__proto__:null,add:qr,empty:Pr,except:Zt,getEqualityComparer:Dr,intersect:Tr,isArraySet:Rr,of:Cr,ofArray:Yt,remove:zr,union:Ar},Symbol.toStringTag,{value:"Module"})),xr=Nr;exports.Array=ao;exports.ArraySet=xr;exports.Async=I;exports.AsyncResult=An;exports.Deferred=k;exports.DeferredResult=lr;exports.EqualityComparer=g;exports.Map=Bo;exports.NonEmptyArray=bo;exports.Nullable=Re;exports.Option=l;exports.OrderingComparer=b;exports.Rec=Mr;exports.Result=i;exports.String=ue;exports.enumOf=Zo;exports.flow=q;exports.pipe=c;exports.tee=te;exports.teeAsync=ee;exports.variant=nr;exports.variantC=er;