@lmvz-ds/components 0.12.5 → 0.13.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/dist/{esm/Effect-BhQLGXPs.js → cjs/assets-CB5ikzmP.js} +857 -4832
- package/dist/cjs/{icons-7wUEcWEo.js → icons-DM_TTn48.js} +363 -113
- package/dist/cjs/{index-CVw4GUo6.js → index-Bp6Dd2i1.js} +4 -2
- package/dist/cjs/{index-9ZJx0550.js → index-D3BMpL5w.js} +0 -3
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/lmvz-action.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-button.cjs.entry.js +7 -10
- package/dist/cjs/lmvz-card.cjs.entry.js +3 -4
- package/dist/cjs/lmvz-chip.cjs.entry.js +1 -1
- package/dist/cjs/lmvz-components.cjs.js +1 -1
- package/dist/cjs/lmvz-header.cjs.entry.js +13 -12
- package/dist/cjs/lmvz-icon.cjs.entry.js +8 -10
- package/dist/cjs/lmvz-input.cjs.entry.js +8 -11
- package/dist/cjs/lmvz-menuitem.cjs.entry.js +5 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reactive-controller-host-BMDEj1kX.js +168 -0
- package/dist/collection/components/lmvz-button/lmvz-button.js +3 -3
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/dist/collection/components/lmvz-icon/test/icons.unit.js +21 -12
- package/dist/collection/components/lmvz-input/lmvz-input.css +5 -2
- package/dist/collection/components/lmvz-input/lmvz-input.js +3 -3
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js +3 -3
- package/dist/collection/integration/header-integration.js +3 -1
- package/dist/collection/utils/{validation → aria}/aria-validation-controller.js +15 -34
- package/dist/collection/utils/{list-keyboard-controller.js → aria/list-keyboard-controller.js} +1 -1
- package/dist/collection/utils/{http.test.js → http.unit.js} +7 -6
- package/dist/components/index.js +1 -1
- package/dist/components/lmvz-action.js +1 -1
- package/dist/components/lmvz-button.js +1 -1
- package/dist/components/lmvz-card.js +1 -1
- package/dist/components/lmvz-chip.js +1 -1
- package/dist/components/lmvz-header.js +1 -1
- package/dist/components/lmvz-icon.js +1 -1
- package/dist/components/lmvz-input.js +1 -1
- package/dist/components/lmvz-menuitem.js +1 -1
- package/dist/components/p-BBDH9X49.js +1 -0
- package/dist/components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-Bs6_m7Uw.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/assets-ozES4zSA.js} +785 -5032
- package/dist/esm/{icons-Bx1wWPM2.js → icons-kpJZ1u9g.js} +268 -18
- package/dist/esm/{index-Bt32KzDW.js → index-BfTCfPZ1.js} +3 -1
- package/dist/esm/{index-smGPjoDX.js → index-T5ljELGS.js} +1 -3
- package/dist/esm/index.js +3 -5
- package/dist/esm/lmvz-action.entry.js +1 -1
- package/dist/esm/lmvz-button.entry.js +5 -8
- package/dist/esm/lmvz-card.entry.js +2 -3
- package/dist/esm/lmvz-chip.entry.js +1 -1
- package/dist/esm/lmvz-components.js +2 -2
- package/dist/esm/lmvz-header.entry.js +11 -10
- package/dist/esm/lmvz-icon.entry.js +5 -7
- package/dist/esm/lmvz-input.entry.js +6 -9
- package/dist/esm/lmvz-menuitem.entry.js +3 -5
- package/dist/esm/loader.js +2 -2
- package/dist/esm/reactive-controller-host-CZ3dGAjR.js +165 -0
- package/dist/lmvz-components/index.esm.js +1 -1
- package/dist/lmvz-components/lmvz-components.esm.js +1 -1
- package/dist/lmvz-components/p-16878d4c.entry.js +1 -0
- package/dist/lmvz-components/p-4ad8c332.entry.js +1 -0
- package/dist/lmvz-components/p-5eee0752.entry.js +1 -0
- package/dist/lmvz-components/p-8ea1a349.entry.js +1 -0
- package/dist/lmvz-components/{p-d4b68381.entry.js → p-980688a0.entry.js} +1 -1
- package/dist/lmvz-components/{p-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/lmvz-components/p-CZ3dGAjR.js +1 -0
- package/dist/lmvz-components/p-D9lc4ayG.js +1 -0
- package/dist/lmvz-components/p-T5ljELGS.js +2 -0
- package/dist/lmvz-components/p-a34542fa.entry.js +1 -0
- package/dist/lmvz-components/p-d2bf6a3f.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- package/dist/lmvz-components/p-iviTjlUy.js +1 -0
- package/dist/manifest.json +1 -1
- package/dist/types/components/lmvz-button/lmvz-button.d.ts +2 -2
- package/dist/types/components/lmvz-header/lmvz-header.d.ts +5 -4
- package/dist/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/dist/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/dist/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +2 -2
- package/dist/types/utils/{validation → aria}/aria-validation-controller.d.ts +1 -5
- package/dist/types/utils/{element-activation-controller.d.ts → aria/element-activation-controller.d.ts} +2 -2
- package/dist/types/utils/{list-keyboard-controller.d.ts → aria/list-keyboard-controller.d.ts} +1 -1
- package/hydrate/index.js +9610 -50169
- package/hydrate/index.mjs +9610 -50169
- package/package.json +17 -18
- package/readme.md +18 -0
- package/dist/cjs/MutableQueue-Bk9tBfaK.js +0 -462
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +0 -7
- package/dist/cjs/aria-validation-controller-B3hMkau3.js +0 -2930
- package/dist/cjs/assets-BguFB3wV.js +0 -71
- package/dist/cjs/axe-BNqwbBGU.js +0 -32834
- package/dist/components/p-3I3wZmp8.js +0 -1
- package/dist/components/p-B85MJLTf.js +0 -1
- package/dist/components/p-BaPwpeMs.js +0 -1
- package/dist/components/p-CAi33KTt.js +0 -1
- package/dist/components/p-CdofjRtQ.js +0 -1
- package/dist/components/p-D1HbKFuh.js +0 -12
- package/dist/components/p-UwhTS2ue.js +0 -1
- package/dist/esm/MutableQueue-CNlEFklh.js +0 -431
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/esm/aria-validation-controller-iA4YWFG-.js +0 -2927
- package/dist/esm/assets-Iu8neKuE.js +0 -67
- package/dist/esm/axe-cRQ9Ux1I.js +0 -32832
- package/dist/lmvz-components/p-1a10fcbd.entry.js +0 -1
- package/dist/lmvz-components/p-274c36df.entry.js +0 -1
- package/dist/lmvz-components/p-2ba68483.entry.js +0 -1
- package/dist/lmvz-components/p-4XIjw3k8.js +0 -1
- package/dist/lmvz-components/p-51Fb_qqD.js +0 -1
- package/dist/lmvz-components/p-77e26e71.entry.js +0 -1
- package/dist/lmvz-components/p-B85MJLTf.js +0 -1
- package/dist/lmvz-components/p-BhQLGXPs.js +0 -1
- package/dist/lmvz-components/p-CXWyvf0D.js +0 -1
- package/dist/lmvz-components/p-D1HbKFuh.js +0 -12
- package/dist/lmvz-components/p-D7I-Bc5i.js +0 -1
- package/dist/lmvz-components/p-a5fe62b6.entry.js +0 -1
- package/dist/lmvz-components/p-c8b78793.entry.js +0 -1
- package/dist/lmvz-components/p-smGPjoDX.js +0 -2
- /package/dist/collection/utils/{element-activation-controller.js → aria/element-activation-controller.js} +0 -0
- /package/dist/types/utils/{http.test.d.ts → http.unit.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as r,h as t,H as a}from"./p-smGPjoDX.js";import{a as o}from"./p-BhQLGXPs.js";import{s as m}from"./p-4XIjw3k8.js";const n=class{constructor(t){e(this,t),this.primaryAction=r(this,"primaryAction")}cardTitle;imageUrl;description;primaryActionLabel="";primaryAction;get fallbackImage(){return o(m("card-placeholder.svg"))}_onPrimaryClick(){this.primaryAction.emit()}_onOverflowClick(e){console.log(e)}render(){return t(a,{key:"1438354a53604954320d01652aa1d84f8712e875",role:"article"},t("div",{key:"dcffae2c48ebf8f8769cf07c2e78806f12df6888",class:"top"},t("div",{key:"e41e1d0aafbfc5879b86022e91958ef3373b48b2",class:"image-wrapper",style:{backgroundImage:`url(${this.imageUrl??this.fallbackImage})`}},t("div",{key:"f6a1fc9706012f39aca9dd0b995290e6042e3407",class:"chip-slot"},t("slot",{key:"4e014519c147705cc30b3268d652ea6c76c749ec",name:"chip"})))),t("div",{key:"e7baf78b660e9a97edd0b6a0aa1bdb1afa593fed",class:"bottom"},t("header",{key:"a8dad9f91df60f535725328a4901833d47652678"},t("h2",{key:"1cdbca46469750187856a46fa155128f1f8a677f",class:"title"},this.cardTitle)),t("p",{key:"f33c2c0af86d7be31fcbd676833b27c7d06e2dd9",class:"description"},this.description),t("div",{key:"a12595d514167fb957aac71fe3d144810b442f9d",class:"actions"},t("button",{key:"9730cedbf83599c09eedaaae43331147691486d6",class:"primary",onClick:this._onPrimaryClick.bind(this),"data-testid":"primary"},this.primaryActionLabel),t("button",{key:"48e9c511c406beb75334452769beade3dec9a3f5",class:"tertiary","aria-label":"More actions",onClick:this._onOverflowClick},t("span",{key:"81cc1af42a15dddb9dbd4f373a6a047c2e2cd563",class:"icon-placeholder"},"...")))))}static get assetsDirs(){return["../../assets"]}};n.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } .sc-lmvz-card-h { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: flex; min-width: var(--lmvz-other-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-other-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2rem, 1.94rem + 0.26vw, 2.25rem) / 1.2 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }";export{n as lmvz_card}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e,r as a,h as t,H as r}from"./p-smGPjoDX.js";import{g as n,c as s}from"./p-B3JVFwO1.js";import{R as i,A as l}from"./p-CXWyvf0D.js";import"./p-BhQLGXPs.js";import"./p-D7I-Bc5i.js";class o{host;elements=[];constructor(e){this.host=e}hostDidRender(){this.host.el.addEventListener("keydown",this.handleKeydown)}updateElements(e){this.elements=e}handleKeydown=e=>{const{key:a}=e;if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(a))return;const t=n(document),r=this.getNextFocusableElement(t,["ArrowDown","ArrowRight"].includes(a)?"down":"up");r&&(e.preventDefault(),r.focus?.())};getNextFocusableElement(e,a){const{elements:t}=this,r=t.indexOf(e);if(-1===r)return null;let n=null;if("down"===a?n=(r+1)%t.length:"up"===a&&(n=(r-1+t.length)%t.length),null==n)return null;const i=t[n];return s(i)?i:this.getNextFocusableElement(i,a)}}const c=class extends i{get el(){return e(this)}primarySlot;secondarySlot;secondaryNav;keyboardNavigationController=new o(this);get primaryMenuitems(){return this.primarySlot.assignedElements({flatten:!1})}get secondaryMenuitems(){return this.secondarySlot.assignedElements({flatten:!0})}get role(){return"banner"}lmvzActiveNav;get secondarySlotName(){return`connect-nav-${this.lmvzActiveNav}`}constructor(e){super(),a(this,e),this.addController(new l(this,{reValidateOnPropChanges:!0})),this.addController(this.keyboardNavigationController)}handleActiveNavChange(){this.updateElementsActive()}componentDidLoad(){this.primarySlot.addEventListener("slotchange",this.handlePrimaryNavChange.bind(this)),this.handlePrimaryNavChange(),this.secondarySlot.addEventListener("slotchange",this.handleSecondaryNavChange.bind(this))}handlePrimaryNavChange(){const e=this.primaryMenuitems;e.length?(e.forEach((e=>{e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls","nav-secondary")})),this.updateElementsActive()):console.warn("Primary slot has no assigned elements. Please add navigation items to the primary slot.")}handleSecondaryNavChange(){this.secondaryMenuitems.length&&this.keyboardNavigationController.updateElements([...this.primaryMenuitems,...this.secondaryMenuitems])}updateElementsActive(){let e;this.primaryMenuitems.forEach((a=>{const t=a.id===this.lmvzActiveNav;t&&(e=a.textContent||a.id),a.setAttribute("aria-expanded",t?"true":"false")})),this.secondaryNav.setAttribute("aria-label",`Untermenü für ${e}`)}delegateFocus(){const e=this.primaryMenuitems[0];e&&e.focus()}render(){return t(r,{key:"58934683ff442801eb34f025ac809631f93a27e8",onFocus:this.delegateFocus.bind(this)},t("div",{key:"35d3eadfabb70f83b313f946c8d31f9c223e8344",class:"brand"},t("slot",{key:"5ce98314d980d63e1c87f508d96119aca2e702a9",name:"brand"},t("lmvz-icon",{key:"b24e61a9071d81948d506a8c545e012d3f0e5dd2",id:"fallback-logo-lmvz",icon:"Logo",size:"inherit","aria-label":"Lehrmittelverlag Zürich"}))),t("nav",{key:"1d5cc9010ef90e6cebc8a7b054db595f35f9e040","aria-label":"Hauptnavigation"},t("div",{key:"488a1b1544242562b57d76169f1988d84c611de4",role:"menubar",class:"primary-menubar"},t("slot",{key:"59c6dd1442290931ed9a55f7bacc65ea4bb9ff6d",name:"nav-primary",ref:e=>this.primarySlot=e}),t("separator",{key:"2729f0e8b115614c50c4a16b6684a3bdb21856b8"}),t("div",{key:"6b5bed5951bad9173fefdc78039e71c4ccc120b2",role:"menu",id:"nav-secondary",class:"secondary-menubar",hidden:!this.lmvzActiveNav,ref:e=>this.secondaryNav=e},t("slot",{key:"02f5a13e8851372c1698e3f786a8757a0a09c32f",name:this.secondarySlotName,ref:e=>this.secondarySlot=e})))),t("div",{key:"53aafe8139bcea27d3039f64a48974cdb5aac5f9",class:"actions"},t("slot",{key:"f12ee19831073253e6ba8e251ba31ec403c21035",name:"actions"})))}static get watchers(){return{lmvzActiveNav:[{handleActiveNavChange:0}]}}};c.style=":host{display:flex;width:100vw;flex-direction:row;align-items:center;box-sizing:border-box;background-color:var(--lmvz-semantic-color-surface-primary, #ffffff);--lmvz-header-x-spacing-level-1:var(--lmvz-dimension-8-28, clamp(0.5rem, 0.2rem + 1.29vw, 1.75rem));--lmvz-header-x-spacing-level-2:var(--lmvz-component-buttongroup-wrapper-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));padding:var(--lmvz-dimension-8-16, clamp(0.5rem, 0.38rem + 0.52vw, 1rem)) var(--lmvz-header-x-spacing-level-1);gap:var(--lmvz-header-x-spacing-level-1);.brand{display:inline-flex;justify-content:center;align-items:center}#fallback-logo-lmvz{height:34px;width:auto}nav{flex-grow:1}.primary-menubar{display:flex;flex-direction:row;align-items:center}.secondary-menubar{display:flex;flex-direction:row;align-items:center;margin-left:var(--lmvz-header-x-spacing-level-2);padding-left:var(--lmvz-header-x-spacing-level-2);border-left:1px solid var(--lmvz-semantic-color-border-default, #e0e0e0)}}";export{c as lmvz_header}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,r as o,c as r,h as e,H as n}from"./p-smGPjoDX.js";import{c as a}from"./p-DMLRPGid.js";import{i as l,f as m}from"./p-B3JVFwO1.js";import{E as i}from"./p-CN0JX9-m.js";import{R as s,A as d}from"./p-CXWyvf0D.js";import"./p-B85MJLTf.js";import"./p-BhQLGXPs.js";import"./p-D7I-Bc5i.js";const c=class extends s{get el(){return t(this)}inheritedAttributes={};formEl=null;formButtonEl=null;lmvzActivation;get ti(){return 0}scale="default";variant="secondary";disabled=!1;type="button";form;constructor(t){super(),o(this,t),this.lmvzActivation=r(this,"lmvzActivation"),this.addController(new d(this)),this.addController(new i(this,{localHandler:this.handleClick.bind(this),keys:["Enter"]}))}connectedCallback(){this.inheritedAttributes=l(this.el)}renderHiddenButton(){const t=this.formEl=m(this.form,this.el);if(!t)return;const{formButtonEl:o}=this;if(null!==o&&t.contains(o))return;const r=this.formButtonEl=document.createElement("button");r.type="submit",r.style.display="none",r.disabled=this.disabled,t.appendChild(r)}submitForm(t){this.formEl&&this.formButtonEl&&(t.preventDefault(),this.formButtonEl.click())}handleClick=t=>{"submit"===this.type&&this.submitForm(t)};render(){return this.renderHiddenButton(),e(n,{key:"578b9f70209fba3a23bd20c3d8b3832cb3005311","aria-disabled":this.disabled?"true":null},e("button",{key:"6b25bee333bec8a36eb1bf77b8e11cd9691a998f",disabled:this.disabled,class:a(this.variant,{[this.scale??""]:!!this.scale,disabled:this.disabled}),...this.inheritedAttributes},e("slot",{key:"5e63d9c069ffa7c10585e1fda980d8087cb43cc9"})))}static get delegatesFocus(){return!0}};c.style=" @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } @layer lmvz-ds.reset { h1, h2, h3, h4, h5, h6 { margin: 0; } } :host { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-md-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-status-selected, #f1f9fe); outline-offset: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: var(--lmvz-semantic-border-width-default, 1px); --lmvz-button-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-border-color: var(--lmvz-semantic-color-border-hover, #c7c7c7); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-border-color: var(--lmvz-semantic-color-border-active, #d4d4d4); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #545454); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-sm-padding-x, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-padding-block: var(--lmvz-component-input-sm-padding-y, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-gap: var(--lmvz-component-input-sm-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.4 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-lg-padding-x, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-lg-padding-y, clamp(0.88rem, 0.78rem + 0.39vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-lg-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); --lmvz-button-font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.4 Router); } display: contents; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } ";export{c as lmvz_button}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./p-smGPjoDX.js";import{a4 as s,a1 as e,t as a,a2 as r,a5 as o}from"./p-BhQLGXPs.js";const n=function(){const t=Symbol.for("effect/Data/Error/plainArgs");return class extends s{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,t,{value:s,enumerable:!1}))}toJSON(){return{...this[t],...this}}}}(),i=t=>{const s={BaseEffectError:class extends n{_tag=t}};return s.BaseEffectError.prototype.name=t,s.BaseEffectError};i("URLCreationError");const c=(s,n)=>{const i=function(...t){return t.filter(Boolean).join("/").replace("//","/").replace("/./","/")}("../../assets",n,s);return e((()=>t(i))).pipe(a((()=>r(`Failed to create URL for asset "${s}" in path "${n}".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration! Falling back to a relative URL, which may work in some environments but is not guaranteed to be correct.`))),o((()=>new URL(i,import.meta?.url??window?.location?.origin??""))))};export{i as T,c as s}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,b as s,d as e,i,e as r,f as n,m as o,h as a,j as h,k as c,n as u,o as d,p as l,q as f,u as p,v,w as m,x as g,y,z as w,A as S,B as x,C,D as k,E,F as _,G as b,H as V,I as B,J as M,K as P,L as R,M as T,N as j,O as L,P as N,Q as O,R as z,S as A,T as F,U as G,V as I,W as K,X as D,Y as X,Z as $,_ as H,$ as Q,a0 as W,a1 as q,a2 as J,a3 as U}from"./p-BhQLGXPs.js";import{u as Y,o as Z,p as tt,E as st,a as et,_ as it,s as rt,i as nt,d as ot}from"./p-D7I-Bc5i.js";import{T as at,s as ht}from"./p-4XIjw3k8.js";const ct=Symbol.for("effect/Brand/Refined"),ut=(t,s,e,i)=>E({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),dt=(t,s)=>E({_tag:"Pending",key:t,deferred:s}),lt=Symbol.for("effect/Cache/MapKey");class ft{current;[lt]=lt;previous=void 0;next=void 0;constructor(t){this.current=t}[T](){return j(O(this.current),N(O(this.previous)),N(O(this.next)),L(this))}[z](t){return this===t||vt(t)&&F(this.current,t.current)&&F(this.previous,t.previous)&&F(this.next,t.next)}}const pt=t=>new ft(t),vt=t=>A(t,lt);class mt{head=void 0;tail=void 0;add(t){if(t!==this.tail)if(void 0===this.tail)this.head=t,this.tail=t;else{const s=t.previous,e=t.next;void 0!==e&&(t.next=void 0,void 0!==s?(s.next=e,e.previous=s):(this.head=e,this.head.previous=void 0)),this.tail.next=t,t.previous=this.tail,this.tail=t}}remove(){const t=this.head;if(void 0!==t){const s=t.next;void 0!==s?(t.next=void 0,this.head=s,this.head.previous=void 0):(this.head=void 0,this.tail=void 0)}return t}}const gt=Symbol.for("effect/Cache"),yt={_Key:t=>t,_Error:t=>t,_Value:t=>t},wt=Symbol.for("effect/ConsumerCache"),St={_Key:t=>t,_Error:t=>t,_Value:t=>t},xt=t=>({loadedMillis:t});class Ct{capacity;context;fiberId;lookup;timeToLive;[gt]=yt;[wt]=St;cacheState;constructor(t,s,e,i,r){this.capacity=t,this.context=s,this.fiberId=e,this.lookup=i,this.timeToLive=r,this.cacheState={map:V(),keys:new mt,accesses:et(),updating:R(!1),hits:0,misses:0}}get(t){return h(this.getEither(t),l)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:p(this.cacheState.map)})))}getOption(t){return v((()=>o(m(this.cacheState.map,t),{onNone:()=>{const s=pt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return v((()=>o(m(this.cacheState.map,t),{onNone:()=>{const s=pt(t);return this.trackAccess(s),this.trackMiss(),g(y())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>w(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=m(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return x(xt(s.value.entryStats.loadedMillis));case"Pending":return y();case"Refreshing":return x(xt(s.value.complete.entryStats.loadedMillis))}return y()}))}getEither(t){return v((()=>{const i=t;let r,n,a=C(m(this.cacheState.map,i));return void 0===a&&(n=Y(this.fiberId),r=pt(i),w(this.cacheState.map,i)?a=C(m(this.cacheState.map,i)):k(this.cacheState.map,i,dt(r,n))),void 0===a?(this.trackAccess(r),this.trackMiss(),h(this.lookupValueOf(t,n),s)):_(this.resolveMapValue(a),o({onNone:()=>this.getEither(t),onSome:t=>g(e(t))}))}))}invalidate(t){return f((()=>{b(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=m(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&b(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=V()}))}refresh(t){return B((s=>v((()=>{const e=t,i=Y(this.fiberId);let r=C(m(this.cacheState.map,e));if(void 0===r&&(w(this.cacheState.map,e)?r=C(m(this.cacheState.map,e)):k(this.cacheState.map,e,dt(pt(e),i))),void 0===r)return G(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=C(m(this.cacheState.map,e));return F(s,r)&&b(this.cacheState.map,e),G(this.get(t))}return j(this.lookupValueOf(t,i),I((()=>{const t=C(m(this.cacheState.map,e));if(F(t,r)){const t=((t,s)=>E({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return k(this.cacheState.map,e,t),!0}return!1})),G);case"Pending":case"Refreshing":return it(r.deferred)}}))))}set(t,s){return B((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=rt(s),o=ut(pt(r),n,xt(i),i+K(a(this.timeToLive(n))));k(this.cacheState.map,r,o)}))))}get size(){return f((()=>p(this.cacheState.map)))}get values(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[1].exit.value);return t}))}get entries(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push([s[0],s[1].exit.value]);return t}))}get keys(){return f((()=>{const t=[];for(const s of this.cacheState.map)"Complete"===s[1]._tag&&"Success"===s[1].exit._tag&&t.push(s[0]);return t}))}resolveMapValue(t,s=!1){return B((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(b(this.cacheState.map,t.key.current),g(y())):(this.trackHit(),h(t.exit,x));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?g(y()):h(it(t.deferred),x);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?g(y()):h(it(t.deferred),x):h(t.complete.exit,x)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(Z(this.cacheState.accesses,t),M(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=tt(this.cacheState.accesses,st);s===st?t=!1:this.cacheState.keys.add(s)}let s=p(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?w(this.cacheState.map,e.current)&&(b(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}P(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return B((e=>v((()=>{const i=t;return j(this.lookup(t),H(this.context),$,_((t=>{const r=e.unsafeCurrentTimeMillis(),n=xt(r),o=ut(pt(i),t,n,r+K(a(this.timeToLive(t))));return k(this.cacheState.map,i,o),X(ot(s,t),t)})),D((()=>X(nt(s),f((()=>{b(this.cacheState.map,i)}))))))}))))}}const kt=t=>{const s=a(t.timeToLive);return(t=>h(c([u(),d]),(([s,e])=>new Ct(t.capacity,s,e,t.lookup,(s=>a(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})};class Et extends(at("FetchError")){}class _t extends(at("NotFoundError")){}class bt extends(at("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}const Vt=function(...a){const h=2===a.length?t=>a[0](t)?s(t):e(a[1](t)):t=>o(a[0](t),{onNone:()=>s(t),onSome:e});return Object.assign((s=>t(h(s),i)),{[ct]:ct,option:t=>n(h(t)),either:h,is:t=>r(h(t))})}((function(t){if("string"!=typeof t)return!1;try{return"svg"===(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.nodeName}catch{return!1}}),(()=>[{message:"SVG data is malformed",meta:undefined}]));class Bt extends(at("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}const Mt=()=>Vt('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');let Pt=null;function Rt(t){const s=t;return Q((function*(){return Pt||(Pt=yield*kt({capacity:200,timeToLive:U,lookup:t=>Q((function*(){const s=t,e=yield*ht(`${s}.svg`,"icons"),i=yield*(r=e,Q((function*(){const t=yield*W({try:()=>fetch(r,void 0),catch:t=>new Et({cause:t})});return 404===t.status?yield*new _t({url:t.url}):t})));var r;const n=yield*(t=>W({try:()=>t.text(),catch:t=>new bt(t)}))(i);return yield*(o=n,q({try:()=>Vt(o),catch:t=>new Bt(t,"SVGString")}));var o}))})),yield*Pt.get(s)}))}function Tt(){return Q((function*(){Pt?yield*Pt.invalidateAll:J("Attempted to clear icon cache before it was initialized")}))}export{Tt as c,Mt as e,Rt as f}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,r as e,c as r,h as i}from"./p-smGPjoDX.js";import{c as o}from"./p-DMLRPGid.js";import{a}from"./p-B3JVFwO1.js";import{R as s,A as n}from"./p-CXWyvf0D.js";import"./p-B85MJLTf.js";import"./p-BhQLGXPs.js";import"./p-D7I-Bc5i.js";let l=0;const c=class extends s{get el(){return t(this)}lmvzInput;internals;nativeInputElement;inputId="lmvz-input-"+l++;initialValue="";nativeError=!1;errorFromProp=!1;get helperId(){return this.helperText?`${this.inputId}-helper`:void 0}get showErrorMessage(){return this.error&&Boolean(this.errorMessage)}get errorId(){return`${this.inputId}-error`}get describedBy(){const t=[];return this.helperId&&t.push(this.helperId),this.showErrorMessage&&t.push(this.errorId),t.length>0?t.join(" "):void 0}value;label;helperText;placeholder;disabled=!1;readonly=!1;required=!1;name;type="text";errorMessage;autocomplete;inputmode;autocorrect;autocapitalize;spellcheck;autofocus=!1;minlength;maxlength;pattern;min;max;step;form;get error(){return this.errorFromProp||this.nativeError}set error(t){this.errorFromProp=t}async setValue(t){this.value=this.nativeInputElement.value=t??"",this.internals.setFormValue?.(t),this.lmvzInput.emit(t)}async focusInput(){this.nativeInputElement?.focus()}async blurInput(){this.nativeInputElement?.blur()}async select(){this.nativeInputElement?.select()}async checkValidity(){return this.nativeInputElement?.checkValidity?.()??!1}async reportValidity(){return this.nativeInputElement?.reportValidity?.()??!1}async getInputElement(){return this.nativeInputElement||await new Promise((t=>a(this.el,t))),Promise.resolve(this.nativeInputElement)}constructor(t){super(),e(this,t),this.lmvzInput=r(this,"lmvzInput"),t.$hostElement$["s-ei"]?this.internals=t.$hostElement$["s-ei"]:(this.internals=t.$hostElement$.attachInternals(),t.$hostElement$["s-ei"]=this.internals),this.addController(new n(this,{reValidateOnPropChanges:!0}))}componentWillLoad(){this.initialValue=this.value}formAssociatedCallback(t){t&&this.internals.setFormValue?.(this.value)}formResetCallback(){this.internals.setValidity({}),this.setValue(this.initialValue)}formStateRestoreCallback(t){this.setValue(t)}handleValueChange(t){this.nativeInputElement&&(this.nativeInputElement.value===t||this.setValue(t))}handleDisabledChange(t){t&&this.nativeInputElement&&this.nativeInputElement.blur()}handleInput=t=>{this.setValue(t.target.value)};handleChange=t=>{this.updateNativeError(t.target??this.nativeInputElement)};handleFocus=()=>{};handleBlur=t=>{const e=t.target;e.reportValidity?.()};updateNativeError(t){const e=t??this.nativeInputElement;e&&(this.nativeError=!(e.checkValidity?.()??1))}render(){const t=Boolean(this.value),e=t||Boolean(this.placeholder);return i("div",{key:"402189a211eec970a9f5b8fcc551c6c3508bec05",class:o("input-container",{"interaction-filled":t})},i("div",{key:"1cbe6011f14774e1226406ef4fe301fd94338444",class:"input-wrapper"},i("slot",{key:"ea0f30124315c88e9721bb4457126bd6cf18110a",name:"before-input"}),i("div",{key:"f630b5f3a33a961f94b5a782b0ce6b4d49d1958c",class:"label-input-group"},i("label",{key:"dbb3fe066ebf93f7fcbe6973a1e37685d7206888",htmlFor:this.inputId,class:o({floating:e})},this.label,this.required&&i("span",{key:"7c1a2458b66becb45c730bfe3ff0c570293f702f",class:"required-indicator","aria-hidden":"true"}," ","*")),i("input",{key:"14b14457e200d20faf9053848662743dfe1cf417",id:this.inputId,ref:t=>this.nativeInputElement=t,type:this.type,min:this.min,max:this.max,step:this.step,value:this.value,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,form:this.form,autocomplete:this.autocomplete,inputmode:this.inputmode,autocorrect:this.autocorrect,autocapitalize:this.autocapitalize,spellcheck:this.spellcheck,autofocus:this.autofocus,minlength:this.minlength,maxlength:this.maxlength,pattern:this.pattern,"aria-invalid":this.error?"true":"false","aria-required":this.required?"true":"false","aria-describedby":this.describedBy,"aria-errormessage":this.errorId,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur})),i("slot",{key:"4b530738ff7404eb1bcecc10a0388570e2243cf3",name:"after-input"})),this.helperText&&i("div",{key:"f1a287047e9b4d58aa90af157d50b3d564555e9b",id:this.helperId,class:"helper-text"},this.helperText),this.showErrorMessage&&i("div",{key:"2a25c4a88a63363cdd814f1d4fead5e8a238621b",id:this.errorId,class:"error-message",role:"alert"},this.errorMessage))}static get formAssociated(){return!0}static get watchers(){return{value:[{handleValueChange:0}],disabled:[{handleDisabledChange:0}]}}};c.style="@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'), local('Router'); font-weight: 400 normal; } @font-face { font-family: Router; src: local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'), local('Router'); font-weight: 500; } @font-face { font-family: Router; src: local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'), local('Router'); font-weight: 700 bold; } } .sc-lmvz-input-h { display: block; font-family: var(--lmvz-global-font-family-default, Router); --input-radius: var(--lmvz-component-input-radius-default, 999px); --input-bg: var(--lmvz-semantic-color-surface-input-primary, #ffffff); --input-border-color: var(--lmvz-semantic-color-border-default, #e0e0e0); --input-border-color-hover: var(--lmvz-semantic-color-border-hover, #c7c7c7); --input-border-color-focus: var(--lmvz-semantic-color-status-on-selected, #0e7ab4); --input-border-width: var(--lmvz-semantic-border-width-default, 1px); --input-height: 48px; --input-padding-x: 16px; --label-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --input-text-color: var(--lmvz-semantic-color-on-surface-input-primary, #000000); --helper-text-color: var(--lmvz-semantic-color-on-surface-input-secondary, #7a7a7a); --error-text-color: var(--lmvz-semantic-color-status-on-danger, #e52a31); --label-floating-scale: 0.85; --label-minimized-top: -6px; --label-minimized-bg: var(--input-bg); --label-minimized-padding-x: 4px; --input-disabled-opacity: var(--lmvz-component-input-disabled-opacity, 40%); } .input-container.sc-lmvz-input { display: flex; flex-direction: column; position: relative; width: 100%; } .input-wrapper.sc-lmvz-input { background-color: var(--input-bg); border: var(--input-border-width) solid var(--input-border-color); border-radius: var(--input-radius); display: flex; align-items: center; height: var(--input-height); padding: 0 var(--input-padding-x); position: relative; transition: border-color 0.2s ease; gap: 8px; } [disabled].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { opacity: var(--input-disabled-opacity); cursor: not-allowed; pointer-events: none; } .input-container.sc-lmvz-input:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--input-border-color-focus); outline: 2px solid var(--input-border-color-focus); outline-offset: 2px; } .input-container.sc-lmvz-input:has(input:focus-visible) .input-wrapper.sc-lmvz-input { box-shadow: 0 0 0 3px rgb(0 86 214 / 20%); } [error].sc-lmvz-input-h .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); } [error].sc-lmvz-input-h:focus-within .input-wrapper.sc-lmvz-input { border-color: var(--error-text-color); outline-color: var(--error-text-color); } .sc-lmvz-input-h:not([disabled]) .input-wrapper.sc-lmvz-input:hover { border-color: var(--input-border-color-hover); } .label-input-group.sc-lmvz-input { position: relative; flex-grow: 1; display: flex; align-items: center; height: 100%; } label.sc-lmvz-input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--label-color); font-size: 14px; font-family: Router, sans-serif; font-weight: 400; pointer-events: none; transition: all 0.2s ease-out; background-color: transparent; padding: 0; margin: 0; line-height: normal; white-space: nowrap; } label.floating.sc-lmvz-input { top: 0; transform: translateY(-50%) scale(0.85); transform-origin: left top; background-color: var(--label-minimized-bg); padding: 0 var(--label-minimized-padding-x); left: -2px; color: var(--input-text-color); font-weight: 500; } .required-indicator.sc-lmvz-input { color: var(--error-text-color); margin-left: 2px; } input.sc-lmvz-input { border: none; background: transparent; width: 100%; height: 100%; color: var(--input-text-color); font-family: inherit; font-size: 14px; outline: none; padding: 0; margin: 0; font-weight: 400; } input.sc-lmvz-input::placeholder { color: var(--label-color); } .helper-text.sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--helper-text-color); font-family: Router, sans-serif; font-weight: 500; } .error-message.sc-lmvz-input { padding-top: 8px; padding-left: 12px; font-size: 12px; color: var(--error-text-color); font-family: Router, sans-serif; font-weight: 500; } .sc-lmvz-input-s > lmvz-button { --lmvz-button-padding: 4px; }";export{c as lmvz_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{t as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=function(t,e){if("function"==typeof t)return function(){return t(arguments)?e.apply(this,arguments):t=>e(t,...arguments)};switch(t){case 0:case 1:throw new RangeError(`Invalid arity ${t}`);case 2:return function(t,r){return arguments.length>=2?e(t,r):function(r){return e(r,t)}};case 3:return function(t,r,n){return arguments.length>=3?e(t,r,n):function(n){return e(n,t,r)}};case 4:return function(t,r,n,s){return arguments.length>=4?e(t,r,n,s):function(s){return e(s,t,r,n)}};case 5:return function(t,r,n,s,i){return arguments.length>=5?e(t,r,n,s,i):function(i){return e(i,t,r,n,s)}};default:return function(){if(arguments.length>=t)return e.apply(this,arguments);const r=arguments;return function(t){return e(t,...r)}}}},e=t=>t,r=t=>()=>t,n=r(!0),s=r(!1),i=r(void 0),o=i;function c(t,e,r,n,s,i,o,c,a){switch(arguments.length){case 1:return t;case 2:return e(t);case 3:return r(e(t));case 4:return n(r(e(t)));case 5:return s(n(r(e(t))));case 6:return i(s(n(r(e(t)))));case 7:return o(i(s(n(r(e(t))))));case 8:return c(o(i(s(n(r(e(t)))))));case 9:return a(c(o(i(s(n(r(e(t))))))));default:{let t=arguments[0];for(let e=1;e<arguments.length;e++)t=arguments[e](t);return t}}}const a=t=>(e,r)=>e===r||t(e,r),u=t(2,((t,e)=>a(((r,n)=>t(e(r),e(n)))))),h="effect/GlobalValue";let l;const f=(t,e)=>(l||(globalThis[h]??=new Map,l=globalThis[h]),l.has(t)||l.set(t,e()),l.get(t)),b=t=>"number"==typeof t,d=t=>"function"==typeof t,p=t=>(t=>"object"==typeof t&&null!==t)(t)||d(t),m=t(2,((t,e)=>p(t)&&e in t)),S=t(2,((t,e)=>m(t,"_tag")&&t._tag===e)),g=t=>null==t,y=t=>"string"==typeof t||m(t,Symbol.iterator),w=t=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`;let _=class t{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new t(this.self)}};class v{_state;constructor(t,e,r,n){return g(e)&&g(t)?(e=4294967295*Math.random()>>>0,t=0):g(e)&&(e=t,t=0),g(n)&&g(r)?(n=this._state?this._state[3]:4150755663,r=this._state?this._state[2]:335903614):g(n)&&(n=r,r=0),this._state=new Int32Array([0,0,r>>>0,(1|(n||0))>>>0]),this._next(),O(this._state,this._state[0],this._state[1],t>>>0,e>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=1|t[3]}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){return(1*(67108863&this._next())*134217728+1*(134217727&this._next()))/9007199254740992}_next(){const t=this._state[0]>>>0,e=this._state[1]>>>0;!function(t,e,r,n,s){let i=32557*(r>>>16)>>>0,o=19605*(65535&r)>>>0,c=32557*(65535&r)>>>0,a=19605*(r>>>16)+((o>>>16)+(i>>>16))>>>0;o=o<<16>>>0,c=c+o>>>0,c>>>0<o>>>0&&(a=a+1>>>0),i=i<<16>>>0,c=c+i>>>0,c>>>0<i>>>0&&(a=a+1>>>0),a=a+Math.imul(r,1481765933)>>>0,a=a+Math.imul(e,s)>>>0,t[0]=a,t[1]=c}(this._state,t,e,0,1284865837),O(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,n=(e>>>18|t<<14)>>>0;r=(r^t)>>>0,n=(n^e)>>>0;const s=(n>>>27|r<<5)>>>0,i=t>>>27;return(s>>>i|s<<((-i>>>0&31)>>>0))>>>0}}function O(t,e,r,n,s){let i=e+n>>>0;const o=r+s>>>0;o>>>0<r>>>0&&(i=i+1|0),t[0]=i,t[1]=o}const M=Symbol.for("effect/Utils/YieldWrap");class E{#t;constructor(t){this.#t=t}[M](){return this.#t}}function I(t){if("object"==typeof t&&null!==t&&M in t)return t[M]();throw new Error(w("yieldWrapGet"))}const k=f("effect/Utils/isStructuralRegion",(()=>({enabled:!1,tester:void 0}))),F={effect_internal_function:t=>t()},N=!0===F.effect_internal_function((()=>(new Error).stack))?.includes("effect_internal_function")?F.effect_internal_function:t=>{try{return t()}finally{}},C=f(Symbol.for("effect/Hash/randomHashCache"),(()=>new WeakMap)),j=Symbol.for("effect/Hash"),A=t=>{if(!0===k.enabled)return 0;switch(typeof t){case"number":return L(t);case"bigint":return D(t.toString(10));case"boolean":case"symbol":return D(String(t));case"string":return D(t);case"undefined":return D("undefined");case"function":case"object":return null===t?D("null"):t instanceof Date?Number.isNaN(t.getTime())?D("Invalid Date"):A(t.toISOString()):t instanceof URL?A(t.href):T(t)?t[j]():R(t);default:throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},R=t=>(C.has(t)||C.set(t,L(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),C.get(t)),x=t=>e=>53*e^t,$=t=>3221225471&t|t>>>1&1073741824,T=t=>m(t,j),L=t=>{if(t!=t||t===1/0)return 0;let e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return $(e)},D=t=>{let e=5381,r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return $(e)},P=t=>((t,e)=>{let r=12289;for(let n=0;n<e.length;n++)r^=c(D(e[n]),x(A(t[e[n]])));return $(r)})(t,Object.keys(t)),B=t=>{let e=6151;for(let r=0;r<t.length;r++)e=c(e,x(A(t[r])));return $(e)},q=function(){if(1===arguments.length){const t=arguments[0];return function(e){return Object.defineProperty(t,j,{value:()=>e,enumerable:!1}),e}}const t=arguments[1];return Object.defineProperty(arguments[0],j,{value:()=>t,enumerable:!1}),t},U=Symbol.for("effect/Equal");function J(){return 1===arguments.length?t=>G(t,arguments[0]):G(arguments[0],arguments[1])}function G(t,e){if(t===e)return!0;const r=typeof t;if(r!==typeof e)return!1;if("object"===r||"function"===r){if(null!==t&&null!==e){if(W(t)&&W(e))return!(A(t)!==A(e)||!t[U](e))||!(!k.enabled||!k.tester)&&k.tester(t,e);if(t instanceof Date&&e instanceof Date){const r=t.getTime(),n=e.getTime();return r===n||Number.isNaN(r)&&Number.isNaN(n)}if(t instanceof URL&&e instanceof URL)return t.href===e.href}if(k.enabled){if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every(((t,r)=>G(t,e[r])));if(Object.getPrototypeOf(t)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(t),n=Object.keys(e);if(r.length===n.length){for(const n of r)if(!(n in e)||!G(t[n],e[n]))return!!k.tester&&k.tester(t,e);return!0}}return!!k.tester&&k.tester(t,e)}}return!(!k.enabled||!k.tester)&&k.tester(t,e)}const W=t=>m(t,U),V=()=>J,H=Symbol.for("nodejs.util.inspect.custom"),z=t=>{try{if(m(t,"toJSON")&&d(t.toJSON)&&0===t.toJSON.length)return t.toJSON();if(Array.isArray(t))return t.map(z)}catch{return{}}return et(t)},Y=t=>JSON.stringify(t,null,2),K=(t,e=2)=>{if("string"==typeof t)return t;try{return"object"==typeof t?Q(t,e):String(t)}catch{return String(t)}},Q=(t,e)=>{let r=[];const n=JSON.stringify(t,((t,e)=>"object"==typeof e&&null!==e?r.includes(e)?void 0:r.push(e)&&(void 0!==tt.fiberRefs&&X(e)?e[Z](tt.fiberRefs):e):e),e);return r=void 0,n},Z=Symbol.for("effect/Inspectable/Redactable"),X=t=>"object"==typeof t&&null!==t&&Z in t,tt=f("effect/Inspectable/redactableState",(()=>({fiberRefs:void 0}))),et=t=>X(t)&&void 0!==tt.fiberRefs?t[Z](tt.fiberRefs):t,rt=(t,e)=>{switch(e.length){case 0:return t;case 1:return e[0](t);case 2:return e[1](e[0](t));case 3:return e[2](e[1](e[0](t)));case 4:return e[3](e[2](e[1](e[0](t))));case 5:return e[4](e[3](e[2](e[1](e[0](t)))));case 6:return e[5](e[4](e[3](e[2](e[1](e[0](t))))));case 7:return e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))));case 8:return e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t))))))));case 9:return e[8](e[7](e[6](e[5](e[4](e[3](e[2](e[1](e[0](t)))))))));default:{let r=t;for(let t=0,n=e.length;t<n;t++)r=e[t](r);return r}}},nt="Async",st="Commit",it="Failure",ot="OnFailure",ct="OnSuccess",at="OnSuccessAndFailure",ut="Success",ht="Sync",lt="Tag",ft="UpdateRuntimeFlags",bt="While",dt="Iterator",pt="WithRuntime",mt="Yield",St="RevertFlags",gt=()=>"3.19.14",yt=Symbol.for("effect/Effect"),wt=Symbol.for("effect/Stream"),_t=Symbol.for("effect/Sink"),vt=Symbol.for("effect/Channel"),Ot={_R:t=>t,_E:t=>t,_A:t=>t,_V:gt()},Mt={[yt]:Ot,[wt]:Ot,[_t]:{_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t},[vt]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},[U](t){return this===t},[j](){return q(this,R(this))},[Symbol.iterator](){return new _(new E(this))},pipe(){return rt(this,arguments)}},Et={[j](){return q(this,P(this))},[U](t){const e=Object.keys(this),r=Object.keys(t);if(e.length!==r.length)return!1;for(const r of e)if(!(r in t)||!J(this[r],t[r]))return!1;return!0}},It={...Mt,_op:st},kt={...It,...Et},Ft=function(){function t(){}return t.prototype=It,t}(),Nt=Symbol.for("effect/Option"),Ct={...Mt,[Nt]:{_A:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},jt=Object.assign(Object.create(Ct),{_tag:"Some",_op:"Some",[U](t){return xt(t)&&Tt(t)&&J(this.value,t.value)},[j](){return q(this,x(A(this._tag))(A(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:z(this.value)}}}),At=A("None"),Rt=Object.assign(Object.create(Ct),{_tag:"None",_op:"None",[U]:t=>xt(t)&&$t(t),[j]:()=>At,toJSON(){return{_id:"Option",_tag:this._tag}}}),xt=t=>m(t,Nt),$t=t=>"None"===t._tag,Tt=t=>"Some"===t._tag,Lt=Object.create(Rt),Dt=t=>{const e=Object.create(jt);return e.value=t,e},Pt=Symbol.for("effect/Either"),Bt={...Mt,[Pt]:{_R:t=>t},[H](){return this.toJSON()},toString(){return Y(this.toJSON())}},qt=Object.assign(Object.create(Bt),{_tag:"Right",_op:"Right",[U](t){return Jt(t)&&Wt(t)&&J(this.right,t.right)},[j](){return x(A(this._tag))(A(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:z(this.right)}}}),Ut=Object.assign(Object.create(Bt),{_tag:"Left",_op:"Left",[U](t){return Jt(t)&&Gt(t)&&J(this.left,t.left)},[j](){return x(A(this._tag))(A(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:z(this.left)}}}),Jt=t=>m(t,Pt),Gt=t=>"Left"===t._tag,Wt=t=>"Right"===t._tag,Vt=t=>{const e=Object.create(qt);return e.right=t,e},Ht=t=>{const e=Object.create(Ut);return e.left=t,e},zt=Gt,Yt=Wt,Kt=t(2,((t,{onLeft:e,onRight:r})=>zt(t)?e(t.left):r(t.right))),Qt=Kt({onLeft:e,onRight:e}),Zt=t(2,((t,e)=>{if(Yt(t))return t.right;throw e(t.left)})),Xt=t=>t.length>0,te=t=>(e,r)=>e===r?0:t(e,r),ee=te(((t,e)=>t<e?-1:1)),re=t(2,((t,e)=>te(((r,n)=>t(e(r),e(n)))))),ne=e=>t(2,((t,r)=>1===e(t,r))),se=()=>Lt,ie=Dt,oe=$t,ce=Tt,ae=t(2,((t,{onNone:e,onSome:r})=>oe(t)?e():r(t.value))),ue=t=>Gt(t)?Lt:Dt(t.right),he=t(2,((t,e)=>oe(t)?e():t.value)),le=t(2,((t,e)=>oe(t)?ie(e()):t)),fe=t=>null==t?se():ie(t),be=he(i),de=t(2,((t,e)=>{if(ce(t))return t.value;throw e()}))((()=>new Error("getOrThrow called on a None"))),pe=t(2,((t,e)=>oe(t)?se():ie(e(t.value)))),me=t(2,((t,e)=>oe(t)?se():e(t.value))),Se=(e=>t(2,((t,r)=>!oe(t)&&e(t.value,r))))(V()),ge=t=>(e,r)=>oe(e)?r:oe(r)?e:ie(t(e.value,r.value)),ye=(...t)=>t,we=t=>new Array(t),_e=t(2,((t,e)=>{const r=Math.max(1,Math.floor(t)),n=new Array(r);for(let t=0;t<r;t++)n[t]=e(t);return n})),ve=t=>Array.isArray(t)?t:Array.from(t),Oe=t(2,((t,e)=>[e,...t])),Me=t(2,((t,e)=>[...t,e])),Ee=t(2,((t,e)=>ve(t).concat(ve(e)))),Ie=Xt,ke=Xt,Fe=(t,e)=>t<0||t>=e.length,Ne=t(2,((t,e)=>{const r=Math.floor(e);return Fe(r,t)?se():ie(t[r])})),Ce=t(2,((t,e)=>{const r=Math.floor(e);if(Fe(r,t))throw new Error(`Index ${r} out of bounds`);return t[r]})),je=Ne(0),Ae=Ce(0),Re=t=>t[t.length-1],xe=t=>t.slice(1),$e=t(2,((t,e)=>Ue(t,((t,e)=>{let r=0;for(const n of t){if(!e(n,r))break;r++}return r})(t,e)))),Te=t(2,((t,e)=>{const r=ve(t);return r.slice(((t,e)=>Math.floor(Math.min(Math.max(0,t),e.length)))(e,r),r.length)})),Le=t=>Array.from(t).reverse(),De=t(2,((t,e)=>{const r=Array.from(t);return r.sort(e),r})),Pe=t(2,((t,e)=>Be(t,e,ye))),Be=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);if(ke(n)&&ke(s)){const t=[r(Ae(n),Ae(s))],e=Math.min(n.length,s.length);for(let i=1;i<e;i++)t[i]=r(n[i],s[i]);return t}return[]})),qe=V(),Ue=t(2,((t,e)=>{const r=Array.from(t),n=Math.floor(e);return ke(r)?n>=1?Je(r,n):[[],r]:[r,[]]})),Je=t(2,((t,e)=>{const r=Math.max(1,Math.floor(e));return r>=t.length?[Ge(t),[]]:[Oe(t.slice(1,r),Ae(t)),t.slice(r)]})),Ge=t=>t.slice(),We=t(3,((t,e,r)=>{const n=ve(t),s=ve(e);return ke(n)?ke(s)?rr(r)(Ee(n,s)):n:s})),Ve=t(2,((t,e)=>We(t,e,qe))),He=()=>[],ze=t=>[t],Ye=t(2,((t,e)=>t.map(e))),Ke=t(2,((t,e)=>{if((t=>0===t.length)(t))return[];const r=[];for(let n=0;n<t.length;n++){const s=e(t[n],n);for(let t=0;t<s.length;t++)r.push(s[t])}return r}))(e),Qe=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++){const s=e(r[t],t);ce(s)&&n.push(s.value)}return n})),Ze=t(2,((t,e)=>{const r=ve(t),n=[];for(let t=0;t<r.length;t++)e(r[t],t)&&n.push(r[t]);return n})),Xe=t(3,((t,e,r)=>ve(t).reduce(((t,e,n)=>r(t,e,n)),e))),tr=(t,e)=>{const r=[];let n,s=t;for(;ce(n=e(s));){const[t,e]=n.value;r.push(t),s=e}return r},er=t=>a(((e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0})),rr=t(2,((t,e)=>{const r=ve(t);if(ke(r)){const t=[Ae(r)],n=xe(r);for(const r of n)t.every((t=>!e(r,t)))&&t.push(r);return t}return[]})),nr=t=>rr(t,V()),sr=t(2,((t,e)=>ve(t).join(e))),ir=ee,or=Symbol.for("effect/Context/Tag"),cr=Symbol.for("effect/Context/Reference"),ar=Symbol.for("effect/STM"),ur={...Mt,_op:"Tag",[ar]:Ot,[or]:{_Service:t=>t,_Identifier:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[H](){return this.toJSON()},of:t=>t,context(t){return mr(this,t)}},hr={...ur,[cr]:cr},lr=Symbol.for("effect/Context"),fr={[lr]:{_Services:t=>t},[U](t){if(dr(t)&&this.unsafeMap.size===t.unsafeMap.size){for(const e of this.unsafeMap.keys())if(!t.unsafeMap.has(e)||!J(this.unsafeMap.get(e),t.unsafeMap.get(e)))return!1;return!0}return!1},[j](){return q(this,L(this.unsafeMap.size))},pipe(){return rt(this,arguments)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(z)}},[H](){return this.toJSON()}},br=t=>{const e=Object.create(fr);return e.unsafeMap=t,e},dr=t=>m(t,lr),pr=br(new Map),mr=(t,e)=>br(new Map([[t.key,e]])),Sr=t(3,((t,e,r)=>{const n=new Map(t.unsafeMap);return n.set(e.key,r),br(n)})),gr=f("effect/Context/defaultValueCache",(()=>new Map)),yr=t=>{if(gr.has(t.key))return gr.get(t.key);const e=t.defaultValue();return gr.set(t.key,e),e},wr=t(2,((t,e)=>{if(!t.unsafeMap.has(e.key)){if(cr in e)return yr(e);throw(t=>{const e=new Error("Service not found"+(t.key?`: ${String(t.key)}`:""));if(t.stack){const r=t.stack.split("\n");if(r.length>2){const t=r[2].match(/at (.*)/);t&&(e.message=e.message+` (defined at ${t[1]})`)}}if(e.stack){const t=e.stack.split("\n");t.splice(1,3),e.stack=t.join("\n")}return e})(e)}return t.unsafeMap.get(e.key)})),_r=wr,vr=t(2,((t,e)=>t.unsafeMap.has(e.key)?Dt(t.unsafeMap.get(e.key)):m(e,cr)?Dt(yr(e)):Lt)),Or=t(2,((t,e)=>{const r=new Map(t.unsafeMap);for(const[t,n]of e.unsafeMap)r.set(t,n);return br(r)})),Mr=t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=e;const n=Object.create(ur);return Object.defineProperty(n,"stack",{get:()=>r.stack}),n.key=t,n},Er=dr,Ir=()=>pr,kr=mr,Fr=Sr,Nr=_r,Cr=wr,jr=vr,Ar=Or,Rr=()=>(t,e)=>{const r=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;function s(){}return Error.stackTraceLimit=r,Object.setPrototypeOf(s,hr),s.key=t,s.defaultValue=e.defaultValue,Object.defineProperty(s,"stack",{get:()=>n.stack}),s},xr=Symbol.for("effect/Chunk"),$r=[],Tr=(t=>a(((e,r)=>e.length===r.length&&Vr(e).every(((e,n)=>t(e,Qr(r,n)))))))(J),Lr={[xr]:{_A:t=>t},toString(){return Y(this.toJSON())},toJSON(){return{_id:"Chunk",values:Vr(this).map(z)}},[H](){return this.toJSON()},[U](t){return Pr(t)&&Tr(this,t)},[j](){return q(this,B(Vr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return $r[Symbol.iterator]();default:return Vr(this)[Symbol.iterator]()}},pipe(){return rt(this,arguments)}},Dr=t=>{const e=Object.create(Lr);switch(e.backing=t,t._tag){case"IEmpty":e.length=0,e.depth=0,e.left=e,e.right=e;break;case"IConcat":e.length=t.left.length+t.right.length,e.depth=1+Math.max(t.left.depth,t.right.depth),e.left=t.left,e.right=t.right;break;case"IArray":e.length=t.array.length,e.depth=0,e.left=Br,e.right=Br;break;case"ISingleton":e.length=1,e.depth=0,e.left=Br,e.right=Br;break;case"ISlice":e.length=t.length,e.depth=t.chunk.depth+1,e.left=Br,e.right=Br}return e},Pr=t=>m(t,xr),Br=Dr({_tag:"IEmpty"}),qr=()=>Br,Ur=(...t)=>Kr(t),Jr=t=>Dr({_tag:"ISingleton",a:t}),Gr=t=>Pr(t)?t:Yr(ve(t)),Wr=(t,e,r)=>{switch(t.backing._tag){case"IArray":!function(t,e,r,n,s){for(let e=0;e<Math.min(t.length,0+s);e++)r[n+e-0]=t[e]}(t.backing.array,0,e,r,t.length);break;case"IConcat":Wr(t.left,e,r),Wr(t.right,e,r+t.left.length);break;case"ISingleton":e[r]=t.backing.a;break;case"ISlice":{let n=0,s=r;for(;n<t.length;)e[s]=Qr(t,n),n+=1,s+=1;break}}},Vr=t=>{switch(t.backing._tag){case"IEmpty":return $r;case"IArray":return t.backing.array;default:{const e=new Array(t.length);return Wr(t,e,0),t.backing={_tag:"IArray",array:e},t.left=Br,t.right=Br,t.depth=0,e}}},Hr=t=>{switch(t.backing._tag){case"IEmpty":case"ISingleton":return t;case"IArray":return Dr({_tag:"IArray",array:Le(t.backing.array)});case"IConcat":return Dr({_tag:"IConcat",left:Hr(t.backing.right),right:Hr(t.backing.left)});case"ISlice":return Yr(Le(Vr(t)))}},zr=t(2,((t,e)=>e<0||e>=t.length?se():ie(Qr(t,e)))),Yr=t=>0===t.length?qr():1===t.length?Jr(t[0]):Dr({_tag:"IArray",array:t}),Kr=t=>Yr(t),Qr=t(2,((t,e)=>{switch(t.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":if(0!==e)throw new Error("Index out of bounds");return t.backing.a;case"IArray":if(e>=t.length||e<0)throw new Error("Index out of bounds");return t.backing.array[e];case"IConcat":return e<t.left.length?Qr(t.left,e):Qr(t.right,e-t.left.length);case"ISlice":return Qr(t.backing.chunk,e+t.backing.offset)}})),Zr=t(2,((t,e)=>rn(t,Jr(e)))),Xr=t(2,((t,e)=>rn(Jr(e),t))),tn=t(2,((t,e)=>{if(e<=0)return Br;if(e>=t.length)return t;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,length:e,offset:t.backing.offset});case"IConcat":return e>t.left.length?Dr({_tag:"IConcat",left:t.left,right:tn(t.right,e-t.left.length)}):tn(t.left,e);default:return Dr({_tag:"ISlice",chunk:t,offset:0,length:e})}})),en=t(2,((t,e)=>{if(e<=0)return t;if(e>=t.length)return Br;switch(t.backing._tag){case"ISlice":return Dr({_tag:"ISlice",chunk:t.backing.chunk,offset:t.backing.offset+e,length:t.backing.length-e});case"IConcat":return e>t.left.length?en(t.right,e-t.left.length):Dr({_tag:"IConcat",left:en(t.left,e),right:t.right});default:return Dr({_tag:"ISlice",chunk:t,offset:e,length:t.length-e})}})),rn=t(2,((t,e)=>{if("IEmpty"===t.backing._tag)return e;if("IEmpty"===e.backing._tag)return t;const r=e.depth-t.depth;if(Math.abs(r)<=1)return Dr({_tag:"IConcat",left:t,right:e});if(r<-1){if(t.left.depth>=t.right.depth){const r=rn(t.right,e);return Dr({_tag:"IConcat",left:t.left,right:r})}{const r=rn(t.right.right,e);if(r.depth===t.depth-3){const e=Dr({_tag:"IConcat",left:t.right.left,right:r});return Dr({_tag:"IConcat",left:t.left,right:e})}{const e=Dr({_tag:"IConcat",left:t.left,right:t.right.left});return Dr({_tag:"IConcat",left:e,right:r})}}}if(e.right.depth>=e.left.depth){const r=rn(t,e.left);return Dr({_tag:"IConcat",left:r,right:e.right})}{const r=rn(t,e.left.left);if(r.depth===e.depth-3){const t=Dr({_tag:"IConcat",left:r,right:e.left.right});return Dr({_tag:"IConcat",left:t,right:e.right})}{const t=Dr({_tag:"IConcat",left:e.left.right,right:e.right});return Dr({_tag:"IConcat",left:r,right:t})}}})),nn=t(2,((t,e)=>Yr(Qe(t,e)))),sn=t(2,((t,e)=>Yr(Ze(t,e)))),on=t=>0===t.length,cn=t=>t.length>0,an=zr(0),un=t=>Qr(t,0),hn=un,ln=t(2,((t,e)=>"ISingleton"===t.backing._tag?Jr(e(t.backing.a,0)):Yr(c(Vr(t),Ye(((t,r)=>e(t,r))))))),fn=t(2,((t,e)=>[tn(t,e),en(t,e)])),bn=t(2,((t,e)=>{let r=0;for(const n of Vr(t)){if(e(n))break;r++}return fn(t,r)})),dn=t=>en(t,1),pn=Xe,mn=Symbol.for("effect/Duration"),Sn=BigInt(0),gn=BigInt(24),yn=BigInt(60),wn=BigInt(1e3),_n=BigInt(1e6),vn=BigInt(1e9),On=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Mn=t=>{if(Nn(t))return t;if(b(t))return xn(t);if((t=>"bigint"==typeof t)(t))return An(t);if(Array.isArray(t)&&2===t.length&&t.every(b))return t[0]===-1/0||t[1]===-1/0||Number.isNaN(t[0])||Number.isNaN(t[1])?Cn:t[0]===1/0||t[1]===1/0?jn:An(BigInt(Math.round(1e9*t[0]))+BigInt(Math.round(t[1])));if((t=>"string"==typeof t)(t)){const e=On.exec(t);if(e){const[t,r,n]=e,s=Number(r);switch(n){case"nano":case"nanos":return An(BigInt(r));case"micro":case"micros":return Rn(BigInt(r));case"milli":case"millis":return xn(s);case"second":case"seconds":return $n(s);case"minute":case"minutes":return Tn(s);case"hour":case"hours":return Ln(s);case"day":case"days":return Dn(s);case"week":case"weeks":return Pn(s)}}}throw new Error("Invalid DurationInput")},En={_tag:"Millis",millis:0},In={_tag:"Infinity"},kn={[mn]:mn,[j](){return q(this,P(this.value))},[U](t){return Nn(t)&&Vn(this,t)},toString(){return`Duration(${Hn(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:qn(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Fn=t=>{const e=Object.create(kn);return e.value=b(t)?isNaN(t)||t<=0?En:Number.isFinite(t)?Number.isInteger(t)?{_tag:"Millis",millis:t}:{_tag:"Nanos",nanos:BigInt(Math.round(1e6*t))}:In:t<=Sn?En:{_tag:"Nanos",nanos:t},e},Nn=t=>m(t,mn),Cn=Fn(0),jn=Fn(1/0),An=t=>Fn(t),Rn=t=>Fn(t*wn),xn=t=>Fn(t),$n=t=>Fn(1e3*t),Tn=t=>Fn(6e4*t),Ln=t=>Fn(36e5*t),Dn=t=>Fn(864e5*t),Pn=t=>Fn(6048e5*t),Bn=t=>Un(t,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),qn=t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(e.value.nanos/vn),Number(e.value.nanos%vn)];case"Millis":return[Math.floor(e.value.millis/1e3),Math.round(e.value.millis%1e3*1e6)]}},Un=t(2,((t,e)=>{const r=Mn(t);switch(r.value._tag){case"Nanos":return e.onNanos(r.value.nanos);case"Infinity":return e.onMillis(1/0);case"Millis":return e.onMillis(r.value.millis)}})),Jn=t(3,((t,e,r)=>{const n=Mn(t),s=Mn(e);if("Infinity"===n.value._tag||"Infinity"===s.value._tag)return r.onMillis(Bn(n),Bn(s));if("Nanos"===n.value._tag||"Nanos"===s.value._tag){const t="Nanos"===n.value._tag?n.value.nanos:BigInt(Math.round(1e6*n.value.millis)),e="Nanos"===s.value._tag?s.value.nanos:BigInt(Math.round(1e6*s.value.millis));return r.onNanos(t,e)}return r.onMillis(n.value.millis,s.value.millis)})),Gn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t<=e,onNanos:(t,e)=>t<=e}))),Wn=t(2,((t,e)=>Jn(t,e,{onMillis:(t,e)=>t>=e,onNanos:(t,e)=>t>=e}))),Vn=t(2,((t,e)=>((t,e)=>Jn(t,e,{onMillis:(t,e)=>t===e,onNanos:(t,e)=>t===e}))(Mn(t),Mn(e)))),Hn=t=>{const e=Mn(t);if("Infinity"===e.value._tag)return"Infinity";if((t=>{switch(t.value._tag){case"Millis":return 0===t.value.millis;case"Nanos":return t.value.nanos===Sn;case"Infinity":return!1}})(e))return"0";const r=(t=>{const e=Mn(t);if("Infinity"===e.value._tag)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const r=(t=>{const e=Mn(t);switch(e.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(1e6*e.value.millis))}})(e),n=r/_n,s=n/wn,i=s/yn,o=i/yn;return{days:Number(o/gn),hours:Number(o%gn),minutes:Number(i%yn),seconds:Number(s%yn),millis:Number(n%wn),nanos:Number(r%_n)}})(e),n=[];return 0!==r.days&&n.push(`${r.days}d`),0!==r.hours&&n.push(`${r.hours}h`),0!==r.minutes&&n.push(`${r.minutes}m`),0!==r.seconds&&n.push(`${r.seconds}s`),0!==r.millis&&n.push(`${r.millis}ms`),0!==r.nanos&&n.push(`${r.nanos}ns`),n.join(" ")},zn=Math.pow(2,5),Yn=zn-1,Kn=zn/2,Qn=zn/4;function Zn(t,e){return e>>>t&Yn}function Xn(t){return 1<<t}function ts(t,e){return r=t&e-1,r=(r=(858993459&(r-=r>>1&1431655765))+(r>>2&858993459))+(r>>4)&252645135,127&(r+=r>>8)+(r>>16);var r}function es(t,e,r,n){let s=n;if(!t){const t=n.length;s=new Array(t);for(let e=0;e<t;++e)s[e]=n[e]}return s[e]=r,s}function rs(t,e,r){const n=r.length-1;let s=0,i=0,o=r;if(t)s=i=e;else for(o=new Array(n);s<e;)o[i++]=r[s++];for(++s;s<=n;)o[i++]=r[s++];return t&&(o.length=n),o}class ns{_tag="EmptyNode";modify(t,e,r,n,s,i){const o=r(se());return oe(o)?new ns:(++i.value,new os(t,n,s,o))}}function ss(t){return S(t,"EmptyNode")}function is(t,e){return!ss(t)&&e===t.edit}class os{edit;hash;key;value;_tag="LeafNode";constructor(t,e,r,n){this.edit=t,this.hash=e,this.key=r,this.value=n}modify(t,e,r,n,s,i){if(J(s,this.key)){const e=r(this.value);return e===this.value?this:oe(e)?(--i.value,new ns):is(this,t)?(this.value=e,this):new os(t,n,s,e)}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}}class cs{edit;hash;children;_tag="CollisionNode";constructor(t,e,r){this.edit=t,this.hash=e,this.children=r}modify(t,e,r,n,s,i){if(n===this.hash){const e=is(this,t),n=this.updateCollisionList(e,t,this.hash,this.children,r,s,i);return n===this.children?this:n.length>1?new cs(t,this.hash,n):n[0]}const o=r(se());return oe(o)?this:(++i.value,ls(t,e,this.hash,this,n,new os(t,n,s,o)))}updateCollisionList(t,e,r,n,s,i,o){const c=n.length;for(let a=0;a<c;++a){const c=n[a];if("key"in c&&J(i,c.key)){const u=c.value,h=s(u);return h===u?n:oe(h)?(--o.value,rs(t,a,n)):es(t,a,new os(e,r,i,h),n)}}const a=s(se());return oe(a)?n:(++o.value,es(t,c,new os(e,r,i,a),n))}}class as{edit;mask;children;_tag="IndexedNode";constructor(t,e,r){this.edit=t,this.mask=e,this.children=r}modify(t,e,r,n,s,i){const o=this.mask,c=this.children,a=Zn(e,n),u=Xn(a),h=ts(o,u),l=o&u,f=is(this,t);if(!l){const l=(new ns).modify(t,e+5,r,n,s,i);return l?c.length>=Kn?function(t,e,r,n,s){const i=[];let o=n,c=0;for(let t=0;o;++t)1&o&&(i[t]=s[c++]),o>>>=1;return i[e]=r,new us(t,c+1,i)}(t,a,l,o,c):new as(t,o|u,function(t,e,r,n){const s=n.length;if(t){let t=s;for(;t>=e;)n[t--]=n[t];return n[e]=r,n}let i=0,o=0;const c=new Array(s+1);for(;i<e;)c[o++]=n[i++];for(c[e]=r;i<s;)c[++o]=n[i++];return c}(f,h,l,c)):this}const b=c[h],d=b.modify(t,e+5,r,n,s,i);if(b===d)return this;let p,m=o;if(ss(d)){if(m&=~u,!m)return new ns;if(c.length<=2&&(ss(S=c[1^h])||"LeafNode"===S._tag||"CollisionNode"===S._tag))return c[1^h];p=rs(f,h,c)}else p=es(f,h,d,c);var S;return f?(this.mask=m,this.children=p,this):new as(t,m,p)}}class us{edit;size;children;_tag="ArrayNode";constructor(t,e,r){this.edit=t,this.size=e,this.children=r}modify(t,e,r,n,s,i){let o=this.size;const c=this.children,a=Zn(e,n),u=c[a],h=(u||new ns).modify(t,e+5,r,n,s,i);if(u===h)return this;const l=is(this,t);let f;if(ss(u)&&!ss(h))++o,f=es(l,a,h,c);else if(!ss(u)&&ss(h)){if(--o,o<=Qn)return function(t,e,r,n){const s=new Array(e-1);let i=0,o=0;for(let t=0,e=n.length;t<e;++t)if(t!==r){const e=n[t];e&&!ss(e)&&(s[i++]=e,o|=1<<t)}return new as(t,o,s)}(t,o,a,c);f=es(l,a,new ns,c)}else f=es(l,a,h,c);return l?(this.size=o,this.children=f,this):new us(t,o,f)}}function hs(t,e,r,n,s,i){if(r===s)return new cs(t,r,[i,n]);const o=Zn(e,r),c=Zn(e,s);if(o===c)return e=>new as(t,Xn(o)|Xn(c),[e]);{const e=o<c?[n,i]:[i,n];return new as(t,Xn(o)|Xn(c),e)}}function ls(t,e,r,n,s,i){let o,c=e;for(;;){const e=hs(t,c,r,n,s,i);if("function"!=typeof e){let t=e;for(;null!=o;)t=o.value(t),o=o.previous;return t}o={value:e,previous:o},c+=5}}const fs="effect/HashMap",bs=Symbol.for(fs),ds={[bs]:bs,[Symbol.iterator](){return new ms(this,((t,e)=>[t,e]))},[j](){let t=A(fs);for(const e of this)t^=c(A(e[0]),x(A(e[1])));return q(this,t)},[U](t){if(vs(t)){if(t._size!==this._size)return!1;for(const e of this){const r=c(t,Ms(e[0],A(e[0])));if(oe(r))return!1;if(!J(e[1],r.value))return!1}return!0}return!1},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},ps=(t,e,r,n)=>{const s=Object.create(ds);return s._editable=t,s._edit=e,s._root=r,s._size=n,s};class ms{map;f;v;constructor(t,e){this.map=t,this.f=e,this.v=gs(this.map._root,this.f,void 0)}next(){if(oe(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=Ss(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new ms(this.map,this.f)}}const Ss=t=>t?ys(t[0],t[1],t[2],t[3],t[4]):se(),gs=(t,e,r)=>{switch(t._tag){case"LeafNode":return ce(t.value)?ie({value:e(t.key,t.value.value),cont:r}):Ss(r);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const n=t.children;return ys(n.length,n,0,e,r)}default:return Ss(r)}},ys=(t,e,r,n,s)=>{for(;r<t;){const i=e[r++];if(i&&!ss(i))return gs(i,n,[t,e,r,n,s])}return Ss(s)},ws=ps(!1,0,new ns,0),_s=()=>ws,vs=t=>m(t,bs),Os=t(2,((t,e)=>Ms(t,e,A(e)))),Ms=t(3,((t,e,r)=>{let n=t._root,s=0;for(;;)switch(n._tag){case"LeafNode":return J(e,n.key)?n.value:se();case"CollisionNode":if(r===n.hash){const t=n.children;for(let r=0,n=t.length;r<n;++r){const n=t[r];if("key"in n&&J(e,n.key))return n.value}}return se();case"IndexedNode":{const t=Xn(Zn(s,r));if(n.mask&t){n=n.children[ts(n.mask,t)],s+=5;break}return se()}case"ArrayNode":if(n=n.children[Zn(s,r)],n){s+=5;break}return se();default:return se()}})),Es=t(2,((t,e)=>ce(Ms(t,e,A(e))))),Is=t(3,((t,e,r)=>js(t,e,(()=>ie(r))))),ks=t(3,((t,e,r)=>t._editable?(t._root=e,t._size=r,t):e===t._root?t:ps(t._editable,t._edit,e,r))),Fs=t=>new ms(t,(t=>t)),Ns=t=>t._size,Cs=t=>ps(!0,t._edit+1,t._root,t._size),js=t(3,((t,e,r)=>As(t,e,A(e),r))),As=t(4,((t,e,r,n)=>{const s={value:t._size},i=t._root.modify(t._editable?t._edit:NaN,0,n,r,e,s);return c(t,ks(i,s.value))})),Rs=t(2,((t,e)=>js(t,e,se))),xs=t(2,((t,e)=>Ts(t,_s(),((t,r,n)=>Is(t,n,e(r,n)))))),$s=t(2,((t,e)=>Ts(t,void 0,((t,r,n)=>e(r,n))))),Ts=t(3,((t,e,r)=>{const n=t._root;if("LeafNode"===n._tag)return ce(n.value)?r(e,n.value.value,n.key):e;if("EmptyNode"===n._tag)return e;const s=[n.children];let i;for(;i=s.pop();)for(let t=0,n=i.length;t<n;){const n=i[t++];n&&!ss(n)&&("LeafNode"===n._tag?ce(n.value)&&(e=r(e,n.value.value,n.key)):s.push(n.children))}return e})),Ls="effect/HashSet",Ds=Symbol.for(Ls),Ps={[Ds]:Ds,[Symbol.iterator](){return Fs(this._keyMap)},[j](){return q(this,x(A(this._keyMap))(A(Ls)))},[U](t){return!!qs(t)&&Ns(this._keyMap)===Ns(t._keyMap)&&J(this._keyMap,t._keyMap)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},Bs=t=>{const e=Object.create(Ps);return e._keyMap=t,e},qs=t=>m(t,Ds),Us=Bs(_s()),Js=()=>Us,Gs=t(2,((t,e)=>Es(t._keyMap,e))),Ws=t=>Bs(Cs(t._keyMap)),Vs=t=>(t._keyMap._editable=!1,t),Hs=t(2,((t,e)=>{const r=Ws(t);return e(r),Vs(r)})),zs=t(2,((t,e)=>t._keyMap._editable?(Is(e,!0)(t._keyMap),t):Bs(Is(e,!0)(t._keyMap)))),Ys=t(2,((t,e)=>t._keyMap._editable?(Rs(e)(t._keyMap),t):Bs(Rs(e)(t._keyMap)))),Ks=t(2,((t,e)=>Hs(t,(t=>{for(const r of e)Ys(t,r)})))),Qs=t(2,((t,e)=>Hs(Js(),(r=>{Zs(t,(t=>zs(r,t)));for(const t of e)zs(r,t)})))),Zs=t(2,((t,e)=>$s(t._keyMap,((t,r)=>e(r))))),Xs=t(3,((t,e,r)=>Ts(t._keyMap,e,((t,e,n)=>r(t,n))))),ti=Js,ei=(...t)=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)},ri=Gs,ni=t=>Ns(t._keyMap),si=zs,ii=Ys,oi=Ks,ci=Qs,ai=Xs,ui=Symbol.for("effect/MutableRef"),hi={[ui]:ui,toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableRef",current:z(this.current)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}},li=t=>{const e=Object.create(hi);return e.current=t,e},fi=t(3,((t,e,r)=>!!J(e,t.current)&&(t.current=r,!0))),bi=t=>t.current,di=t(2,((t,e)=>(t.current=e,t))),pi="effect/FiberId",mi=Symbol.for(pi),Si="None",gi="Runtime",yi="Composite",wi=D(`${pi}-${Si}`);let _i=class{[mi]=mi;_tag=Si;id=-1;startTimeMillis=-1;[j](){return wi}[U](t){return Ei(t)&&t._tag===Si}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[H](){return this.toJSON()}};class vi{id;startTimeMillis;[mi]=mi;_tag=gi;constructor(t,e){this.id=t,this.startTimeMillis=e}[j](){return q(this,D(`${pi}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[U](t){return Ei(t)&&t._tag===gi&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[H](){return this.toJSON()}}class Oi{left;right;[mi]=mi;_tag=yi;constructor(t,e){this.left=t,this.right=e}_hash;[j](){return c(D(`${pi}-${this._tag}`),x(A(this.left)),x(A(this.right)),q(this))}[U](t){return Ei(t)&&t._tag===yi&&J(this.left,t.left)&&J(this.right,t.right)}toString(){return Y(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:z(this.left),right:z(this.right)}}[H](){return this.toJSON()}}const Mi=new _i,Ei=t=>m(t,mi),Ii=t(2,((t,e)=>t._tag===Si?e:e._tag===Si?t:new Oi(t,e))),ki=t=>{switch(t._tag){case Si:return ti();case gi:return ei(t.id);case yi:return c(ki(t.left),ci(ki(t.right)))}},Fi=f(Symbol.for("effect/Fiber/Id/_fiberCounter"),(()=>li(0))),Ni=t=>Array.from(ki(t)).map((t=>`#${t}`)).join(","),Ci=Mi,ji=Ii,Ai=t=>c(t,ai(Mi,((t,e)=>Ii(e)(t)))),Ri=Ni,xi=()=>{const t=bi(Fi);return c(Fi,di(t+1)),new vi(t,Date.now())},$i=_s,Ti=Os,Li=Is,Di=Fs,Pi=js,Bi=xs,qi=Ts,Ui=Symbol.for("effect/List"),Ji=t=>ve(t),Gi=(()=>u(er(J),Ji))(),Wi={[Ui]:Ui,_tag:"Cons",toString(){return Y(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:Ji(this).map(z)}},[H](){return this.toJSON()},[U](t){return Ki(t)&&this._tag===t._tag&&Gi(this,t)},[j](){return q(this,B(Ji(this)))},[Symbol.iterator](){let t=!1,e=this;return{next(){if(t)return this.return();if("Nil"===e._tag)return t=!0,this.return();const r=e.head;return e=e.tail,{done:t,value:r}},return:e=>(t||(t=!0),{done:!0,value:e})}},pipe(){return rt(this,arguments)}},Vi=(t,e)=>{const r=Object.create(Wi);return r.head=t,r.tail=e,r},Hi=D("Nil"),zi={[Ui]:Ui,_tag:"Nil",toString(){return Y(this.toJSON())},toJSON:()=>({_id:"List",_tag:"Nil"}),[H](){return this.toJSON()},[j]:()=>Hi,[U](t){return Ki(t)&&this._tag===t._tag},[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})}),pipe(){return rt(this,arguments)}},Yi=Object.create(zi),Ki=t=>m(t,Ui),Qi=t=>"Nil"===t._tag,Zi=(t,e)=>Vi(t,e),Xi=()=>Yi,to=t=>Vi(t,Yi),eo=t(2,((t,e)=>no(e,t))),ro=t(2,((t,e)=>Zi(e,t))),no=t(2,((t,e)=>{if(Qi(t))return e;if(Qi(e))return t;{const r=Vi(e.head,t);let n=r,s=e.tail;for(;!Qi(s);){const e=Vi(s.head,t);n.tail=e,n=e,s=s.tail}return r}})),so=t(3,((t,e,r)=>{let n=e,s=t;for(;!Qi(s);)n=r(n,s.head),s=s.tail;return n})),io=t=>{let e=Xi(),r=t;for(;!Qi(r);)e=ro(e,r.head),r=r.tail;return e},oo=function(){function t(t){t&&Object.assign(this,t)}return t.prototype=Et,t}(),co=t=>Object.assign(Object.create(Et),t),ao=Symbol.for("effect/DifferContextPatch");function uo(t){return t}const ho={...oo.prototype,[ao]:{_Value:uo,_Patch:uo}},lo=Object.create(Object.assign(Object.create(ho),{_tag:"Empty"})),fo=()=>lo,bo=Object.assign(Object.create(ho),{_tag:"AndThen"}),po=Object.assign(Object.create(ho),{_tag:"AddService"}),mo=(t,e)=>{const r=Object.create(po);return r.key=t,r.service=e,r},So=Object.assign(Object.create(ho),{_tag:"RemoveService"}),go=t=>{const e=Object.create(So);return e.key=t,e},yo=Object.assign(Object.create(ho),{_tag:"UpdateService"}),wo=(t,e)=>{const r=Object.create(yo);return r.key=t,r.update=e,r},_o=t(2,((t,e)=>((t,e)=>{const r=Object.create(bo);return r.first=t,r.second=e,r})(t,e))),vo=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=!1,n=Jr(t);const s=new Map(e.unsafeMap);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AddService":s.set(t.key,t.service),n=e;break;case"AndThen":n=Xr(Xr(e,t.second),t.first);break;case"RemoveService":s.delete(t.key),n=e;break;case"UpdateService":s.set(t.key,t.update(s.get(t.key))),r=!0,n=e}}if(!r)return br(s);const i=new Map;for(const[t]of e.unsafeMap)s.has(t)&&(i.set(t,s.get(t)),s.delete(t));for(const[t,e]of s)i.set(t,e);return br(i)})),Oo=Symbol.for("effect/DifferHashSetPatch");function Mo(t){return t}const Eo={...oo.prototype,[Oo]:{_Value:Mo,_Key:Mo,_Patch:Mo}},Io=Object.create(Object.assign(Object.create(Eo),{_tag:"Empty"})),ko=()=>Io,Fo=Object.assign(Object.create(Eo),{_tag:"AndThen"}),No=Object.assign(Object.create(Eo),{_tag:"Add"}),Co=t=>{const e=Object.create(No);return e.value=t,e},jo=Object.assign(Object.create(Eo),{_tag:"Remove"}),Ao=t(2,((t,e)=>((t,e)=>{const r=Object.create(Fo);return r.first=t,r.second=e,r})(t,e))),Ro=t(2,((t,e)=>{if("Empty"===t._tag)return e;let r=e,n=Jr(t);for(;cn(n);){const t=hn(n),e=dn(n);switch(t._tag){case"Empty":n=e;break;case"AndThen":n=Xr(t.first)(Xr(t.second)(e));break;case"Add":r=si(t.value)(r),n=e;break;case"Remove":r=ii(t.value)(r),n=e}}return r})),xo=Symbol.for("effect/DifferReadonlyArrayPatch");function $o(t){return t}const To={...oo.prototype,[xo]:{_Value:$o,_Patch:$o}},Lo=Object.create(Object.assign(Object.create(To),{_tag:"Empty"})),Do=()=>Lo,Po=Object.assign(Object.create(To),{_tag:"AndThen"}),Bo=Object.assign(Object.create(To),{_tag:"Append"}),qo=Object.assign(Object.create(To),{_tag:"Slice"}),Uo=Object.assign(Object.create(To),{_tag:"Update"}),Jo=(t,e)=>{const r=Object.create(Uo);return r.index=t,r.patch=e,r},Go=t(2,((t,e)=>((t,e)=>{const r=Object.create(Po);return r.first=t,r.second=e,r})(t,e))),Wo=t(3,((t,e,r)=>{if("Empty"===t._tag)return e;let n=e.slice(),s=ze(t);for(;Ie(s);){const t=Ae(s),e=xe(s);switch(t._tag){case"Empty":s=e;break;case"AndThen":e.unshift(t.first,t.second),s=e;break;case"Append":for(const e of t.values)n.push(e);s=e;break;case"Slice":n=n.slice(t.from,t.until),s=e;break;case"Update":n[t.index]=r.patch(t.patch,n[t.index]),s=e}}return n})),Vo=Symbol.for("effect/Differ"),Ho={[Vo]:{_P:e,_V:e},pipe(){return rt(this,arguments)}},zo=t=>{const e=Object.create(Ho);return e.empty=t.empty,e.diff=t.diff,e.combine=t.combine,e.patch=t.patch,e},Yo=()=>Ko(((t,e)=>e)),Ko=t=>zo({empty:e,combine:(t,r)=>t===e?r:r===e?t:e=>r(t(e)),diff:(t,n)=>J(t,n)?e:r(n),patch:(e,r)=>t(r,e(r))}),Qo=255,Zo=t=>t&Qo,Xo=t=>t>>8&Qo,tc=(t,e)=>(t&Qo)+((e&t&Qo)<<8),ec=tc(0,0),rc=t(2,((t,e)=>tc(Zo(t)&~e,Xo(t)))),nc=t(2,((t,e)=>t|e)),sc=t(2,((t,e)=>t|e)),ic=t=>oc(t)&&!lc(t),oc=t=>cc(t,1),cc=t(2,((t,e)=>!!(t&e))),ac=(...t)=>t.reduce(((t,e)=>t|e),0),uc=ac(0),hc=t=>cc(t,4),lc=t=>cc(t,16),fc=t(2,((t,e)=>tc(t^e,e))),bc=t(2,((t,e)=>t&(~Zo(e)>>>0&Qo|Xo(e))|Zo(e)&Xo(e))),dc=zo({empty:ec,diff:(t,e)=>fc(t,e),combine:(t,e)=>nc(e)(t),patch:(t,e)=>bc(e,t)}),pc=t=>tc(t,0),mc=rc,Sc=(t,e)=>({_tag:"Par",left:t,right:e}),gc=(t,e)=>({_tag:"Seq",left:t,right:e}),yc=t=>{let e=t,r=Mc(),n=Xi(),s=Xi();for(;;)switch(e._tag){case"Empty":if(Qi(n))return[r,s];e=n.head,n=n.tail;break;case"Par":n=Zi(e.right,n),e=e.left;break;case"Seq":{const t=e.left,r=e.right;switch(t._tag){case"Empty":e=r;break;case"Par":{const n=t.right;e=Sc(gc(t.left,r),gc(n,r));break}case"Seq":e=gc(t.left,gc(t.right,r));break;case"Single":e=t,s=Zi(r,s)}break}case"Single":if(r=Ec(r,e),Qi(n))return[r,s];e=n.head,n=n.tail}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},wc=(t,e)=>{if(Qi(t))return to(Nc(e));if(kc(e))return t;const r=$c(t.head),n=Fc(e);return 1===r.length&&1===n.length&&J(r[0],n[0])?Zi(xc(t.head,Nc(e)),t.tail):Zi(Nc(e),t)},_c=Symbol.for("effect/RequestBlock/RequestBlockParallel"),vc={_R:t=>t};class Oc{map;[_c]=vc;constructor(t){this.map=t}}const Mc=()=>new Oc($i()),Ec=(t,e)=>new Oc(Pi(t.map,e.dataSource,(t=>le(pe(t,Zr(e.blockedRequest)),(()=>Jr(e.blockedRequest)))))),Ic=(t,e)=>new Oc(qi(t.map,e.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>e,onSome:t=>rn(e,t)}))))),kc=t=>(t=>t&&ss(t._root))(t.map),Fc=t=>Array.from(Di(t.map)),Nc=t=>Rc(Bi(t.map,(t=>Jr(t)))),Cc=Symbol.for("effect/RequestBlock/RequestBlockSequential"),jc={_R:t=>t};class Ac{map;[Cc]=jc;constructor(t){this.map=t}}const Rc=t=>new Ac(t),xc=(t,e)=>new Ac(qi(e.map,t.map,((t,e,r)=>Li(t,r,ae(Ti(t,r),{onNone:()=>qr(),onSome:t=>rn(t,e)}))))),$c=t=>Array.from(Di(t.map)),Tc="Die",Lc="Empty",Dc="Fail",Pc="Interrupt",Bc="Parallel",qc="Sequential",Uc="effect/Cause",Jc=Symbol.for(Uc),Gc={[Jc]:{_E:t=>t},[j](){return c(A(Uc),x(A(ha(this))),q(this))},[U](t){return Qc(t)&&ua(this,t)},pipe(){return rt(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:z(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:z(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:z(this.left),right:z(this.right)}}},toString(){return wa(this)},[H](){return this.toJSON()}},Wc=(()=>{const t=Object.create(Gc);return t._tag=Lc,t})(),Vc=t=>{const e=Object.create(Gc);return e._tag=Dc,e.error=t,e},Hc=t=>{const e=Object.create(Gc);return e._tag=Tc,e.defect=t,e},zc=t=>{const e=Object.create(Gc);return e._tag=Pc,e.fiberId=t,e},Yc=(t,e)=>{const r=Object.create(Gc);return r._tag=Bc,r.left=t,r.right=e,r},Kc=(t,e)=>{const r=Object.create(Gc);return r._tag=qc,r.left=t,r.right=e,r},Qc=t=>m(t,Jc),Zc=t=>t._tag===Tc,Xc=t=>ce(ia(t)),ta=t=>ya(void 0,da)(t),ea=t=>Hr(ga(t,qr(),((t,e)=>e._tag===Tc?ie(c(t,Xr(e.defect))):se()))),ra=t=>ga(t,ti(),((t,e)=>e._tag===Pc?ie(c(t,si(e.fiberId))):se())),na=t=>{const e=(t=>fa(t,(t=>t._tag===Dc?ie(t.error):se())))(t);switch(e._tag){case"None":return Vt(t);case"Some":return Ht(e.value)}},sa=t=>Sa(t,{onEmpty:ie(Wc),onFail:pe(Vc),onDie:t=>ie(Hc(t)),onInterrupt:t=>ie(zc(t)),onSequential:ge(Kc),onParallel:ge(Yc)}),ia=t=>fa(t,(t=>t._tag===Pc?ie(t.fiberId):se())),oa=t=>Sa(t,{onEmpty:Wc,onFail:()=>Wc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}),ca=t(2,((t,e)=>aa(t,(t=>Vc(e(t)))))),aa=t(2,((t,e)=>Sa(t,{onEmpty:Wc,onFail:t=>e(t),onDie:t=>Hc(t),onInterrupt:t=>zc(t),onSequential:(t,e)=>Kc(t,e),onParallel:(t,e)=>Yc(t,e)}))),ua=(t,e)=>{let r=Jr(t),n=Jr(e);for(;cn(r)&&cn(n);){const[t,e]=c(hn(r),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])}))),[s,i]=c(hn(n),ga([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return ie([c(t,ci(n)),c(e,rn(s))])})));if(!J(t,s))return!1;r=e,n=i}return!0},ha=t=>la(Jr(t),qr()),la=(t,e)=>{for(;;){const[r,n]=c(t,Xe([ti(),qr()],(([t,e],r)=>{const[n,s]=ba(r);return[c(t,ci(n)),c(e,rn(s))]}))),s=ni(r)>0?c(e,Xr(r)):e;if(on(n))return Hr(s);t=n,e=s}throw new Error(w("Cause.flattenCauseLoop"))},fa=t(2,((t,e)=>{const r=[t];for(;r.length>0;){const t=r.pop(),n=e(t);switch(n._tag){case"None":switch(t._tag){case qc:case Bc:r.push(t.right),r.push(t.left)}break;case"Some":return n}}return se()})),ba=t=>{let e=t;const r=[];let n=ti(),s=qr();for(;void 0!==e;)switch(e._tag){case Lc:if(0===r.length)return[n,s];e=r.pop();break;case Dc:if(n=si(n,Ur(e._tag,e.error)),0===r.length)return[n,s];e=r.pop();break;case Tc:if(n=si(n,Ur(e._tag,e.defect)),0===r.length)return[n,s];e=r.pop();break;case Pc:if(n=si(n,Ur(e._tag,e.fiberId)),0===r.length)return[n,s];e=r.pop();break;case qc:switch(e.left._tag){case Lc:e=e.right;break;case qc:e=Kc(e.left.left,Kc(e.left.right,e.right));break;case Bc:e=Yc(Kc(e.left.left,e.right),Kc(e.left.right,e.right));break;default:s=Xr(s,e.right),e=e.left}break;case Bc:r.push(e.right),e=e.left}throw new Error(w("Cause.evaluateCauseLoop"))},da={emptyCase:n,failCase:s,dieCase:s,interruptCase:n,sequentialCase:(t,e,r)=>e&&r,parallelCase:(t,e,r)=>e&&r},pa="SequentialCase",ma="ParallelCase",Sa=t(2,((t,{onDie:e,onEmpty:r,onFail:n,onInterrupt:s,onParallel:i,onSequential:o})=>ya(t,void 0,{emptyCase:()=>r,failCase:(t,e)=>n(e),dieCase:(t,r)=>e(r),interruptCase:(t,e)=>s(e),sequentialCase:(t,e,r)=>o(e,r),parallelCase:(t,e,r)=>i(e,r)}))),ga=t(3,((t,e,r)=>{let n=e,s=t;const i=[];for(;void 0!==s;){const t=r(n,s);switch(n=ce(t)?t.value:n,s._tag){case qc:case Bc:i.push(s.right),s=s.left;break;default:s=void 0}void 0===s&&i.length>0&&(s=i.pop())}return n})),ya=t(3,((t,e,r)=>{const n=[t],s=[];for(;n.length>0;){const t=n.pop();switch(t._tag){case Lc:s.push(Vt(r.emptyCase(e)));break;case Dc:s.push(Vt(r.failCase(e,t.error)));break;case Tc:s.push(Vt(r.dieCase(e,t.defect)));break;case Pc:s.push(Vt(r.interruptCase(e,t.fiberId)));break;case qc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:pa}));break;case Bc:n.push(t.right),n.push(t.left),s.push(Ht({_tag:ma}))}}const i=[];for(;s.length>0;){const t=s.pop();switch(t._tag){case"Left":switch(t.left._tag){case pa:{const t=i.pop(),n=i.pop(),s=r.sequentialCase(e,t,n);i.push(s);break}case ma:{const t=i.pop(),n=i.pop(),s=r.parallelCase(e,t,n);i.push(s);break}}break;case"Right":i.push(t.right)}}if(0===i.length)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return i.pop()})),wa=(t,e)=>ta(t)?"All fibers interrupted without errors.":Fa(t).map((function(t){return!0!==e?.renderErrorCause||void 0===t.cause?t.stack:`${t.stack} {\n${_a(t.cause," ")}\n}`})).join("\n"),_a=(t,e)=>{const r=t.stack.split("\n");let n=`${e}[cause]: ${r[0]}`;for(let t=1,s=r.length;t<s;t++)n+=`\n${e}${r[t]}`;return t.cause&&(n+=` {\n${_a(t.cause,`${e} `)}\n${e}}`),n};class va extends globalThis.Error{span=void 0;constructor(t){const e="object"==typeof t&&null!==t,r=Error.stackTraceLimit;Error.stackTraceLimit=1,super(Oa(t),e&&"cause"in t&&void 0!==t.cause?{cause:new va(t.cause)}:void 0),""===this.message&&(this.message="An error has occurred"),Error.stackTraceLimit=r,this.name=t instanceof Error?t.name:"Error",e&&(ka in t&&(this.span=t[ka]),Object.keys(t).forEach((e=>{e in this||(this[e]=t[e])}))),this.stack=Ia(`${this.name}: ${this.message}`,t instanceof Error&&t.stack?t.stack:"",this.span)}}const Oa=t=>{if("string"==typeof t)return t;if("object"==typeof t&&null!==t&&t instanceof Error)return t.message;try{if(m(t,"toString")&&d(t.toString)&&t.toString!==Object.prototype.toString&&t.toString!==globalThis.Array.prototype.toString)return t.toString()}catch{}return Q(t)},Ma=/\((.*)\)/g,Ea=f("effect/Tracer/spanToTrace",(()=>new WeakMap)),Ia=(t,e,r)=>{const n=[t],s=e.startsWith(t)?e.slice(t.length).split("\n"):e.split("\n");for(let t=1;t<s.length;t++)if(s[t].includes(" at new BaseEffectError")||s[t].includes(" at new YieldableError"))t++;else{if(s[t].includes("Generator.next"))break;if(s[t].includes("effect_internal_function"))break;n.push(s[t].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(r){let t=r,e=0;for(;t&&"Span"===t._tag&&e<10;){const r=Ea.get(t);if("function"==typeof r){const e=r();if("string"==typeof e){const r=e.matchAll(Ma);let s=!1;for(const[,e]of r)s=!0,n.push(` at ${t.name} (${e})`);s||n.push(` at ${t.name} (${e.replace(/^at /,"")})`)}else n.push(` at ${t.name}`)}else n.push(` at ${t.name}`);t=be(t.parent),e++}}return n.join("\n")},ka=Symbol.for("effect/SpanAnnotation"),Fa=t=>ya(t,void 0,{emptyCase:()=>[],dieCase:(t,e)=>[new va(e)],failCase:(t,e)=>[new va(e)],interruptCase:()=>[],parallelCase:(t,e,r)=>[...e,...r],sequentialCase:(t,e,r)=>[...e,...r]}),Na="Pending",Ca="Done",ja=Symbol.for("effect/Deferred"),Aa={_E:t=>t,_A:t=>t},Ra=t=>({_tag:Ca,effect:t});class xa{self;called=!1;constructor(t){this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new xa(this.self)}}const $a=(t,e)=>{const r=new Da("Blocked");return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r},Ta=Symbol.for("effect/Effect");class La{patch;op;_op=St;constructor(t,e){this.patch=t,this.op=e}}class Da{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t}[U](t){return this===t}[j](){return q(this,R(this))}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:z(this.effect_instruction_i0),effect_instruction_i1:z(this.effect_instruction_i1),effect_instruction_i2:z(this.effect_instruction_i2)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}class Pa{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Failure"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[j](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get cause(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}class Ba{_op;effect_instruction_i0=void 0;effect_instruction_i1=void 0;effect_instruction_i2=void 0;trace=void 0;[Ta]=Ot;constructor(t){this._op=t,this._tag=t}[U](t){return Uh(t)&&"Success"===t._op&&J(this.effect_instruction_i0,t.effect_instruction_i0)}[j](){return c(D(this._tag),x(A(this.effect_instruction_i0)),q(this))}get value(){return this.effect_instruction_i0}pipe(){return rt(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:z(this.value)}}toString(){return Y(this.toJSON())}[H](){return this.toJSON()}[Symbol.iterator](){return new xa(new E(this))}}const qa=t=>m(t,Ta),Ua=t=>{const e=new Da(pt);return e.effect_instruction_i0=t,e},Ja=t(3,((t,e,r)=>$u((n=>hu(t,(t=>hu(nu(Cu((()=>n(e(t))))),(e=>Cu((()=>r(t,e))).pipe(du({onFailure:t=>{switch(e._tag){case it:return ou(Kc(e.effect_instruction_i0,t));case ut:return ou(t)}},onSuccess:()=>e})))))))))),Ga=t(2,((t,e)=>hu(t,(()=>Nu(e))))),Wa=t=>Ga(t,void 0),Va=function(){const t=new Da(st);switch(arguments.length){case 2:t.effect_instruction_i0=arguments[0],t.commit=arguments[1];break;case 3:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.commit=arguments[2];break;case 4:t.effect_instruction_i0=arguments[0],t.effect_instruction_i1=arguments[1],t.effect_instruction_i2=arguments[2],t.commit=arguments[3];break;default:throw new Error(w("you're not supposed to end up here"))}return t},Ha=(t,e=Ci)=>{const r=new Da(nt);let n;return r.effect_instruction_i0=e=>{n=t(e)},r.effect_instruction_i1=e,Iu(r,(()=>qa(n)?n:Tu))},za=(t,e=Ci)=>Cu((()=>Ha(t,e))),Ya=(t,e=Ci)=>Va(t,(function(){let t,r;function n(e){t?t(e):void 0===r&&(r=e)}const s=new Da(nt);let i,o;return s.effect_instruction_i0=e=>{t=e,r&&e(r)},s.effect_instruction_i1=e,1!==this.effect_instruction_i0.length?(o=new AbortController,i=N((()=>this.effect_instruction_i0(n,o.signal)))):i=N((()=>this.effect_instruction_i0(n))),i||o?Iu(s,(()=>(o&&o.abort(),i??Tu))):s})),Ka=t(2,((t,e)=>{const r=new Da(ot);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),Qa=t(2,((t,e)=>pu(t,{onFailure:e,onSuccess:Nu}))),Za=Symbol.for("effect/OriginalAnnotation"),Xa=(t,e)=>ce(e)?new Proxy(t,{has:(t,e)=>e===ka||e===Za||e in t,get:(r,n)=>n===ka?e.value:n===Za?t:r[n]}):t,tu=t=>p(t)&&!(ka in t)?Ua((e=>ou(Hc(Xa(t,El(e)))))):ou(Hc(t)),eu=t=>cu((()=>Hc(new Th(t)))),ru=t=>pu(t,{onFailure:t=>Nu(Ht(t)),onSuccess:t=>Nu(Vt(t))}),nu=t=>bu(t,{onFailure:Kh,onSuccess:tl}),su=t=>p(t)&&!(ka in t)?Ua((e=>ou(Vc(Xa(t,El(e)))))):ou(Vc(t)),iu=t=>hu(ju(t),su),ou=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},cu=t=>hu(ju(t),ou),au=Ua((t=>Nu(t.id()))),uu=t=>Ua((e=>t(e.id()))),hu=t(2,((t,e)=>{const r=new Da(ct);return r.effect_instruction_i0=t,r.effect_instruction_i1=e,r})),lu=t=>{const e=new Da("OnStep");return e.effect_instruction_i0=t,e},fu=t=>hu(t,e),bu=t(2,((t,e)=>du(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),du=t(2,((t,e)=>{const r=new Da(at);return r.effect_instruction_i0=t,r.effect_instruction_i1=e.onFailure,r.effect_instruction_i2=e.onSuccess,r})),pu=t(2,((t,e)=>du(t,{onFailure:t=>{if(ea(t).length>0)return ou((t=>Sa(t,{onEmpty:Wc,onFail:Hc,onDie:Hc,onInterrupt:zc,onSequential:Kc,onParallel:Yc}))(t));const r=(t=>Hr(ga(t,qr(),((t,e)=>e._tag===Dc?ie(c(t,Xr(e.error))):se()))))(t);return r.length>0?e.onFailure(un(r)):ou(t)},onSuccess:e.onSuccess}))),mu=t(2,((t,e)=>Cu((()=>{const r=ve(t),n=we(r.length);let s=0;return Ga(Du({while:()=>s<r.length,body:()=>e(r[s],s),step:t=>{n[s++]=t}}),n)})))),Su=t(2,((t,e)=>Cu((()=>{const r=ve(t);let n=0;return Du({while:()=>n<r.length,body:()=>e(r[n],n),step:()=>{n++}})})))),gu=hu(au,(t=>yu(t))),yu=t=>ou(zc(t)),wu=t=>{const e=new Da(ft);return e.effect_instruction_i0=tc(r=1,r),e.effect_instruction_i1=()=>t,e;var r},_u=t(2,((t,e)=>$u((r=>hu(nu(r(t)),(t=>ll(e,t))))))),vu=t(2,((t,e)=>hu(t,(t=>ju((()=>e(t))))))),Ou=t(2,((t,e)=>pu(t,{onFailure:t=>iu((()=>e.onFailure(t))),onSuccess:t=>ju((()=>e.onSuccess(t)))}))),Mu=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return iu((()=>e(r.left)));case"Right":return ou(r.right)}},onSuccess:Nu}))),Eu=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>{const r=Kh(t);return du(e(r),{onFailure:e=>Kh(Kc(t,e)),onSuccess:()=>r})},onSuccess:t=>{const r=tl(t);return Wu(e(r),r)}}))))),Iu=t(2,((t,e)=>Eu(t,Zh({onFailure:t=>ta(t)?Wa(e(ra(t))):Tu,onSuccess:()=>Tu})))),ku=t(2,((t,e)=>Ru(t,e,Nu))),Fu=t(2,((t,e)=>pu(t,{onFailure:t=>tu(e(t)),onSuccess:Nu}))),Nu=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},Cu=t=>{const e=new Da(st);return e.commit=t,e},ju=t=>{const e=new Da(ht);return e.effect_instruction_i0=t,e},Au=t((t=>3===t.length||2===t.length&&!(p(t[1])&&"onlyEffect"in t[1])),((t,e)=>hu(t,(t=>{const r="function"==typeof e?e(t):e;return qa(r)?Ga(r,t):m(n=r,"then")&&d(n.then)?Ha((e=>{r.then((()=>e(Nu(t))),(t=>e(su(new qh(t,"An unknown error occurred in Effect.tap")))))})):Nu(t);var n})))),Ru=t(3,((t,e,r)=>du(t,{onFailure:t=>ea(t).length>0?ou(de((t=>Sa(t,{onEmpty:se(),onFail:t=>ie(Hc(t)),onDie:t=>ie(Hc(t)),onInterrupt:()=>se(),onSequential:ge(Kc),onParallel:ge(Yc)}))(t))):e(),onSuccess:r}))),xu=t=>{const e=new Da(ft);return e.effect_instruction_i0=pc(1),e.effect_instruction_i1=()=>t,e},$u=t=>Va(t,(function(){const t=new Da(ft);return t.effect_instruction_i0=pc(1),t.effect_instruction_i1=t=>oc(t)?N((()=>this.effect_instruction_i0(wu))):N((()=>this.effect_instruction_i0(xu))),t})),Tu=Nu(void 0),Lu=t(2,((t,e)=>hu(e,(e=>e?c(t,vu(ie)):Nu(se()))))),Du=t=>{const e=new Da(bt);return e.effect_instruction_i0=t.while,e.effect_instruction_i1=t.body,e.effect_instruction_i2=t.step,e},Pu=t=>Cu((()=>{const e=new Da(dt);return e.effect_instruction_i0=t(),e})),Bu=function(){const t=1===arguments.length?arguments[0]:arguments[1].bind(arguments[0]);return Pu((()=>t(c)))},qu=(t,...e)=>Object.defineProperty(0===e.length?function(...e){return Pu((()=>t.apply(this,e)))}:function(...r){let n=Pu((()=>t.apply(this,r)));for(const t of e)n=t(n,...r);return n},"length",{value:t.length,configurable:!0}),Uu=t=>{const e=new Da(mt);return void 0!==t?.priority?yh(e,t.priority):e},Ju=t(2,((t,e)=>hu(t,(t=>vu(e,(e=>[t,e])))))),Gu=t(2,((t,e)=>hu(t,(t=>Ga(e,t))))),Wu=t(2,((t,e)=>hu(t,(()=>e)))),Vu=t(3,((t,e,r)=>hu(t,(t=>vu(e,(e=>r(t,e))))))),Hu=t=>hu(au,(e=>c(t,zu(e)))),zu=t(2,((t,e)=>hu(t.interruptAsFork(e),(()=>t.await)))),Yu={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return rt(this,arguments)}},Ku={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return rt(this,arguments)}},Qu={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return rt(this,arguments)}},Zu={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return rt(this,arguments)}},Xu=Symbol.for("effect/FiberRef"),th={_A:t=>t},eh=t=>Ua((e=>tl(e.getFiberRef(t)))),rh=t(2,((t,e)=>hu(eh(t),e))),nh=t(2,((t,e)=>sh(t,(()=>[void 0,e])))),sh=t(2,((t,e)=>Ua((r=>{const[n,s]=e(r.getFiberRef(t));return r.setFiberRef(t,s),Nu(n)})))),ih=t(3,((t,e,r)=>Ja(Gu(eh(e),nh(e,r)),(()=>t),(t=>nh(e,t))))),oh=t(3,((t,e,r)=>rh(e,(n=>ih(t,e,r(n)))))),ch=(t,r)=>lh(t,{differ:Yo(),fork:r?.fork??e,join:r?.join}),ah=t=>{const e=zo({empty:ko(),combine:(t,e)=>Ao(e)(t),diff:(t,e)=>((t,e)=>{const[r,n]=ai([t,ko()],(([t,e],r)=>ri(r)(t)?[ii(r)(t),e]:[t,Ao(Co(r))(e)]))(e);return ai(n,((t,e)=>Ao((t=>{const e=Object.create(jo);return e.value=t,e})(e))(t)))(r)})(t,e),patch:(t,e)=>Ro(e)(t)});return lh(t,{differ:e,fork:e.empty})},uh=t=>{const e=(t=>zo({empty:Do(),combine:(t,e)=>Go(t,e),diff:(e,r)=>(t=>{let e=0,r=Do();for(;e<t.oldValue.length&&e<t.newValue.length;){const n=t.differ.diff(t.oldValue[e],t.newValue[e]);J(n,t.differ.empty)||(r=Go(r,Jo(e,n))),e+=1}return e<t.oldValue.length&&(r=Go(r,((t,e)=>{const r=Object.create(qo);return r.from=0,r.until=e,r})(0,e))),e<t.newValue.length&&(r=Go(r,(t=>{const e=Object.create(Bo);return e.values=t,e})(Te(e)(t.newValue)))),r})({oldValue:e,newValue:r,differ:t}),patch:(e,r)=>Wo(e,r,t)}))(Yo());return lh(t,{differ:e,fork:e.empty})},hh=t=>{const e=zo({empty:fo(),combine:(t,e)=>_o(e)(t),diff:(t,e)=>((t,e)=>{const r=new Map(t.unsafeMap);let n=fo();for(const[t,s]of e.unsafeMap.entries())if(r.has(t)){const e=r.get(t);r.delete(t),J(e,s)||(n=_o(wo(t,(()=>s)))(n))}else r.delete(t),n=_o(mo(t,s))(n);for(const[t]of r.entries())n=_o(go(t))(n);return n})(t,e),patch:(t,e)=>vo(e)(t)});return lh(t,{differ:e,fork:e.empty})},lh=(t,e)=>({...It,[Xu]:th,initial:t,commit(){return eh(this)},diff:(t,r)=>e.differ.diff(t,r),combine:(t,r)=>e.differ.combine(t,r),patch:t=>r=>e.differ.patch(t,r),fork:e.fork,join:e.join??((t,e)=>e)}),fh=t=>lh(t,{differ:dc,fork:dc.empty}),bh=f(Symbol.for("effect/FiberRef/currentContext"),(()=>hh(Ir()))),dh=f(Symbol.for("effect/FiberRef/currentSchedulingPriority"),(()=>ch(0))),ph=f(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),(()=>ch(2048))),mh=f(Symbol.for("effect/FiberRef/currentLogAnnotation"),(()=>ch($i()))),Sh=f(Symbol.for("effect/FiberRef/currentLogLevel"),(()=>ch(Qu))),gh=f(Symbol.for("effect/FiberRef/currentLogSpan"),(()=>ch(Xi()))),yh=t(2,((t,e)=>ih(t,dh,e))),wh=f(Symbol.for("effect/FiberRef/currentConcurrency"),(()=>ch("unbounded"))),_h=f(Symbol.for("effect/FiberRef/currentRequestBatching"),(()=>ch(!0))),vh=f(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),(()=>ch(ie(Zu)))),Oh=f(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),(()=>ch(ie(Ku)))),Mh=f(Symbol.for("effect/FiberRef/currentMetricLabels"),(()=>uh([]))),Eh=f(Symbol.for("effect/FiberRef/currentForkScopeOverride"),(()=>ch(se(),{fork:()=>se(),join:t=>t}))),Ih=f(Symbol.for("effect/FiberRef/currentInterruptedCause"),(()=>ch(Wc,{fork:()=>Wc,join:t=>t}))),kh=Symbol.for("effect/Scope"),Fh=Symbol.for("effect/CloseableScope"),Nh=(t,e)=>t.addFinalizer((()=>Wa(e))),Ch=(t,e)=>t.addFinalizer(e),jh=(t,e)=>t.close(e),Ah=(t,e)=>t.fork(e),Rh=function(){class t extends globalThis.Error{commit(){return su(this)}toJSON(){const t={...this};return this.message&&(t.message=this.message),this.cause&&(t.cause=this.cause),t}[H](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}`:this.toString():"Bun"in globalThis?wa(Vc(this),{renderErrorCause:!0}):this}}return Object.assign(t.prototype,kt),t}(),xh=(t,e)=>{class r extends Rh{_tag=e}return Object.assign(r.prototype,t),r.prototype.name=e,r},$h=Symbol.for("effect/Cause/errors/RuntimeException"),Th=xh({[$h]:$h},"RuntimeException"),Lh=Symbol.for("effect/Cause/errors/InterruptedException"),Dh=Symbol.for("effect/Cause/errors/NoSuchElement"),Ph=xh({[Dh]:Dh},"NoSuchElementException"),Bh=Symbol.for("effect/Cause/errors/UnknownException"),qh=function(){class t extends Rh{_tag="UnknownException";error;constructor(t,e){super(e??"An unknown error occurred",{cause:t}),this.error=t}}return Object.assign(t.prototype,{[Bh]:Bh,name:"UnknownException"}),t}(),Uh=t=>qa(t)&&"_tag"in t&&("Success"===t._tag||"Failure"===t._tag),Jh=t=>"Failure"===t._tag,Gh=t=>"Success"===t._tag,Wh=t(2,((t,e)=>{switch(t._tag){case it:return Kh(t.effect_instruction_i0);case ut:return tl(e)}})),Vh=t=>Wh(t,void 0),Hh=(t,e)=>il(t,e?.parallel?Yc:Kc),zh=t=>Kh(Hc(t)),Yh=t=>Kh(Vc(t)),Kh=t=>{const e=new Pa(it);return e.effect_instruction_i0=t,e},Qh=t(2,((t,e)=>{switch(t._tag){case it:return Kh(t.effect_instruction_i0);case ut:return tl(e(t.effect_instruction_i0))}})),Zh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),Xh=t(2,((t,{onFailure:e,onSuccess:r})=>{switch(t._tag){case it:return e(t.effect_instruction_i0);case ut:return r(t.effect_instruction_i0)}})),tl=t=>{const e=new Ba(ut);return e.effect_instruction_i0=t,e},el=tl(void 0),rl=t(2,((t,e)=>sl(t,e,{onSuccess:(t,e)=>[t,e],onFailure:Kc}))),nl=t(2,((t,e)=>sl(t,e,{onSuccess:(t,e)=>e,onFailure:Kc}))),sl=t(3,((t,e,{onFailure:r,onSuccess:n})=>{switch(t._tag){case it:switch(e._tag){case ut:return Kh(t.effect_instruction_i0);case it:return Kh(r(t.effect_instruction_i0,e.effect_instruction_i0))}case ut:switch(e._tag){case ut:return tl(n(t.effect_instruction_i0,e.effect_instruction_i0));case it:return Kh(e.effect_instruction_i0)}}})),il=(t,e)=>{const r=Gr(t);return cn(r)?c(dn(r),Xe(c(hn(r),Qh(Jr)),((t,r)=>c(t,sl(r,{onSuccess:(t,e)=>c(t,Xr(e)),onFailure:e})))),Qh(Hr),Qh((t=>Vr(t))),ie):se()},ol=t=>{var e;return{...It,[ja]:Aa,state:li((e=[],{_tag:Na,joiners:e})),commit(){return ul(this)},blockingOn:t}},cl=()=>hu(au,(t=>al(t))),al=t=>ju((()=>ol(t))),ul=t=>za((e=>{const r=bi(t.state);switch(r._tag){case Ca:return e(r.effect);case Na:return r.joiners.push(e),gl(t,e)}}),t.blockingOn),hl=t(2,((t,e)=>ju((()=>{const r=bi(t.state);switch(r._tag){case Ca:return!1;case Na:di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e);return!0}})))),ll=t(2,((t,e)=>hl(t,e))),fl=t(2,((t,e)=>hl(t,ou(e)))),bl=t=>hu(au,(e=>hl(t,yu(e)))),dl=t(2,((t,e)=>hl(t,yu(e)))),pl=t=>ju((()=>bi(t.state)._tag===Ca)),ml=t(2,((t,e)=>hl(t,Nu(e)))),Sl=(t,e)=>{const r=bi(t.state);if(r._tag===Na){di(t.state,Ra(e));for(let t=0,n=r.joiners.length;t<n;t++)r.joiners[t](e)}},gl=(t,e)=>ju((()=>{const r=bi(t.state);if(r._tag===Na){const t=r.joiners.indexOf(e);t>=0&&r.joiners.splice(t,1)}})),yl=Ua((t=>tl(t.currentContext))),wl=()=>yl,_l=t=>hu(wl(),t),vl=t(2,((t,e)=>ih(bh,e)(t))),Ol=t(2,((t,e)=>oh(bh,(t=>Ar(t,e)))(t))),Ml=t(2,((t,e)=>_l((r=>vl(t,e(r)))))),El=t=>{const e=t.currentSpan;return void 0!==e&&"Span"===e._tag?ie(e):se()},Il=Symbol.for("effect/MutableHashMap"),kl={[Il]:Il,[Symbol.iterator](){return new Fl(this)},toString(){return Y(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(z)}},[H](){return this.toJSON()},pipe(){return rt(this,arguments)}};class Fl{self;referentialIterator;bucketIterator;constructor(t){this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(void 0!==this.bucketIterator)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new Nl(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new Fl(this.self)}}class Nl{backing;constructor(t){this.backing=t}currentBucket;next(){if(void 0===this.currentBucket){const t=this.backing.next();if(t.done)return t;this.currentBucket=t.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const Cl=()=>{const t=Object.create(kl);return t.referential=new Map,t.buckets=new Map,t.bucketsSize=0,t},jl=t(2,((t,e)=>{if(!1===W(e))return t.referential.has(e)?ie(t.referential.get(e)):se();const r=e[j](),n=t.buckets.get(r);return void 0===n?se():Al(t,n,e)})),Al=(t,e,r,n=!1)=>{for(let s=0,i=e.length;s<i;s++)if(r[U](e[s][0])){const r=e[s][1];return n&&(e.splice(s,1),t.bucketsSize--),ie(r)}return se()},Rl=t(2,((t,e)=>ce(jl(t,e)))),xl=t(3,((t,e,r)=>{if(!1===W(e))return t.referential.set(e,r),t;const n=e[j](),s=t.buckets.get(n);return void 0===s?(t.buckets.set(n,[[e,r]]),t.bucketsSize++,t):($l(t,s,e),s.push([e,r]),t.bucketsSize++,t)})),$l=(t,e,r)=>{for(let n=0,s=e.length;n<s;n++)if(r[U](e[n][0]))return e.splice(n,1),void t.bucketsSize--},Tl=t(2,((t,e)=>{if(!1===W(e))return t.referential.delete(e),t;const r=e[j](),n=t.buckets.get(r);return void 0===n||($l(t,n,e),0===n.length&&t.buckets.delete(r)),t})),Ll=t=>t.referential.size+t.bucketsSize,Dl=Symbol.for("effect/Clock"),Pl=Mr("effect/Clock"),Bl={unsafeSchedule(t,e){const r=Bn(e);if(r>2147483647)return s;let n=!1;const i=setTimeout((()=>{n=!0,t()}),r);return()=>(clearTimeout(i),!n)}},ql=function(){const t=BigInt(1e6);if("undefined"==typeof performance||"function"!=typeof performance.now)return()=>BigInt(Date.now())*t;let e;return()=>(void 0===e&&(e=BigInt(Date.now())*t-BigInt(Math.round(1e6*performance.now()))),e+BigInt(Math.round(1e6*performance.now())))}(),Ul=function(){const t="object"==typeof process&&"hrtime"in process&&"function"==typeof process.hrtime.bigint?process.hrtime:void 0;if(!t)return ql;const e=ql()-t.bigint();return()=>e+t.bigint()}();class Jl{[Dl]=Dl;unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return Ul()}currentTimeMillis=ju((()=>this.unsafeCurrentTimeMillis()));currentTimeNanos=ju((()=>this.unsafeCurrentTimeNanos()));scheduler(){return Nu(Bl)}sleep(t){return Ya((e=>{const r=Bl.unsafeSchedule((()=>e(Tu)),t);return Wa(ju(r))}))}}const Gl=()=>new Jl,Wl="InvalidData",Vl="MissingData",Hl="SourceUnavailable",zl="Unsupported",Yl=Symbol.for("effect/ConfigError"),Kl={_tag:"ConfigError",[Yl]:Yl},Ql=(t,e)=>{const r=Object.create(Kl);return r._op="And",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Zl=(t,e)=>{const r=Object.create(Kl);return r._op="Or",r.left=t,r.right=e,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(r,"message",{enumerable:!1,get(){return this.toString()}}),r},Xl=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=Wl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Invalid data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},tf=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=Vl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Missing data at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},ef=(t,e,r,n={pathDelim:"."})=>{const s=Object.create(Kl);return s._op=Hl,s.path=t,s.message=e,s.cause=r,Object.defineProperty(s,"toString",{enumerable:!1,value(){return`(Source unavailable at ${c(this.path,sr(n.pathDelim))}: "${this.message}")`}}),s},rf=(t,e,r={pathDelim:"."})=>{const n=Object.create(Kl);return n._op=zl,n.path=t,n.message=e,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${c(this.path,sr(r.pathDelim))}: "${this.message}")`}}),n},nf=t(2,((t,e)=>{switch(t._op){case"And":return Ql(nf(t.left,e),nf(t.right,e));case"Or":return Zl(nf(t.left,e),nf(t.right,e));case Wl:return Xl([...e,...t.path],t.message);case Vl:return tf([...e,...t.path],t.message);case Hl:return ef([...e,...t.path],t.message,t.cause);case zl:return rf([...e,...t.path],t.message)}})),sf={_tag:"Empty"},of=t(2,((t,e)=>{let r=to(e),n=t;for(;"Cons"===r._tag;){const t=r.head;switch(t._tag){case"Empty":r=r.tail;break;case"AndThen":r=Zi(t.first,Zi(t.second,r.tail));break;case"MapName":n=Ye(n,t.f),r=r.tail;break;case"Nested":n=Oe(n,t.name),r=r.tail;break;case"Unnested":if(!c(je(n),Se(t.name)))return Ht(tf(n,`Expected ${t.name} to be in path in ConfigProvider#unnested`));n=xe(n),r=r.tail}}return Vt(n)})),cf=(t,e)=>[...t,...e],af=Symbol.for("effect/ConfigProvider"),uf=Mr("effect/ConfigProvider"),hf=Symbol.for("effect/ConfigProviderFlat"),lf=t=>({[af]:af,pipe(){return rt(this,arguments)},...t}),ff=t=>{const{pathDelim:e,seqDelim:r}=Object.assign({},{pathDelim:"_",seqDelim:","},t),n=()=>"undefined"!=typeof process&&"env"in process&&"object"==typeof process.env?process.env:{};return s=(t=>({[hf]:hf,patch:t.patch,load:(e,r,n=!0)=>t.load(e,r,n),enumerateChildren:t.enumerateChildren}))({load:(t,s,i=!0)=>{const o=(t=>c(t,sr(e)))(t),a=n();return c(o in a?ie(a[o]):se(),Mu((()=>tf(t,`Expected ${o} to exist in the process context`))),hu((e=>pf(e,t,s,r,i))))},enumerateChildren:t=>ju((()=>{const r=n();return(t=>{const e=Ws(Js());for(const r of t)zs(e,r);return Vs(e)})(Object.keys(r).map((t=>t.toUpperCase().split(e))).filter((e=>{for(let r=0;r<t.length;r++){const n=c(t,Ce(r)),s=e[r];if(void 0===s||n!==s)return!1}return!0})).flatMap((e=>e.slice(t.length,t.length+1))))})),patch:sf}),lf({load:t=>hu(bf(s,[],t,!1),(e=>ae(je(e),{onNone:()=>su(tf([],`Expected a single value having structure: ${t}`)),onSome:Nu}))),flattened:s});var s},bf=(t,e,r,n)=>{const s=r;switch(s._tag){case"Constant":return Nu(ze(s.value));case"Described":return Cu((()=>bf(t,e,s.config,n)));case"Fail":return su(tf(e,s.message));case"Fallback":return c(Cu((()=>bf(t,e,s.first,n))),Qa((r=>s.condition(r)?c(bf(t,e,s.second,n),Qa((t=>su(Zl(r,t))))):su(r))));case"Lazy":return Cu((()=>bf(t,e,s.config(),n)));case"MapOrFail":return Cu((()=>c(bf(t,e,s.original,n),hu(mu((t=>c(s.mapOrFail(t),Mu(nf(((t,e)=>{let r=e;if("Nested"===r._tag){const e=t.slice();for(;"Nested"===r._tag;)e.push(r.name),r=r.config;return e}return t})(e,s.original))))))))));case"Nested":return Cu((()=>bf(t,cf(e,ze(s.name)),s.config,n)));case"Primitive":return c(of(e,t.patch),hu((e=>c(t.load(e,s,n),hu((t=>{if(0===t.length){const t=c(ke(r=e)?ie(Re(r)):se(),he((()=>"<n/a>")));return su(tf([],`Expected ${s.description} with name ${t}`))}var r;return Nu(t)}))))));case"Sequence":return c(of(e,t.patch),hu((r=>c(t.enumerateChildren(r),hu(Sf),hu((r=>0===r.length?Cu((()=>vu(bf(t,e,s.config,!0),ze))):c(mu(r,(r=>bf(t,Me(e,`[${r}]`),s.config,!0))),vu((t=>{const e=Ke(t);return ze(0===e.length?[]:e)})))))))));case"HashMap":return Cu((()=>c(of(e,t.patch),hu((e=>c(t.enumerateChildren(e),hu((r=>c(r,mu((r=>bf(t,cf(e,ze(r)),s.valueConfig,n))),vu((t=>0===t.length?ze($i()):c(mf(t),Ye((t=>(t=>{const e=Cs(_s());for(const r of t)Is(e,r[0],r[1]);return(r=e)._editable=!1,r;var r})(Pe(ve(r),t))))))))))))))));case"ZipWith":return Cu((()=>c(bf(t,e,s.left,n),ru,hu((r=>c(bf(t,e,s.right,n),ru,hu((t=>{if(zt(r)&&zt(t))return su(Ql(r.left,t.left));if(zt(r)&&Yt(t))return su(r.left);if(Yt(r)&&zt(t))return su(t.left);if(Yt(r)&&Yt(t)){const n=c(e,sr(".")),i=df(e,n),[o,a]=((t,e,r,n)=>{const s=tr(r.length,(e=>e>=n.length?se():ie([t(e),e+1]))),i=tr(n.length,(t=>t>=r.length?se():ie([e(t),t+1])));return[cf(r,s),cf(n,i)]})(i,i,c(r.right,Ye(Vt)),c(t.right,Ye(Vt)));return c(o,Pe(a),mu((([t,e])=>c(Ju(t,e),vu((([t,e])=>s.zip(t,e)))))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")}))))))))}},df=(t,e)=>r=>Ht(tf(t,`The element at index ${r} in a sequence at path "${e}" was missing`)),pf=(t,e,r,n,s)=>s?c(((t,e)=>{const r=t.split(new RegExp(`\\s*${(t=>t.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"))(e)}\\s*`));return r})(t,n),mu((t=>r.parse(t.trim()))),Mu(nf(e))):c(r.parse(t),Ou({onFailure:nf(e),onSuccess:ze})),mf=t=>Object.keys(t[0]).map((e=>t.map((t=>t[e])))),Sf=t=>c(mu(t,yf),Ou({onFailure:()=>[],onSuccess:De(ir)}),ru,vu(Qt)),gf=/^(\[(\d+)\])$/,yf=t=>{const e=t.match(gf);if(null!==e){const t=e[2];return c(void 0!==t&&t.length>0?ie(t):se(),me(wf))}return se()},wf=t=>{const e=Number.parseInt(t);return Number.isNaN(e)?se():ie(e)},_f=Symbol.for("effect/Console"),vf=Mr("effect/Console"),Of={[_f]:_f,assert:(t,...e)=>ju((()=>{console.assert(t,...e)})),clear:ju((()=>{console.clear()})),count:t=>ju((()=>{console.count(t)})),countReset:t=>ju((()=>{console.countReset(t)})),debug:(...t)=>ju((()=>{console.debug(...t)})),dir:(t,e)=>ju((()=>{console.dir(t,e)})),dirxml:(...t)=>ju((()=>{console.dirxml(...t)})),error:(...t)=>ju((()=>{console.error(...t)})),group:t=>ju(t?.collapsed?()=>console.groupCollapsed(t?.label):()=>console.group(t?.label)),groupEnd:ju((()=>{console.groupEnd()})),info:(...t)=>ju((()=>{console.info(...t)})),log:(...t)=>ju((()=>{console.log(...t)})),table:(t,e)=>ju((()=>{console.table(t,e)})),time:t=>ju((()=>console.time(t))),timeEnd:t=>ju((()=>console.timeEnd(t))),timeLog:(t,...e)=>ju((()=>{console.timeLog(t,...e)})),trace:(...t)=>ju((()=>{console.trace(...t)})),warn:(...t)=>ju((()=>{console.warn(...t)})),unsafe:console},Mf=Symbol.for("effect/Random"),Ef=Mr("effect/Random");class If{seed;[Mf]=Mf;PRNG;constructor(t){this.seed=t,this.PRNG=new v(t)}get next(){return ju((()=>this.PRNG.number()))}get nextBoolean(){return vu(this.next,(t=>t>.5))}get nextInt(){return ju((()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER)))}nextRange(t,e){return vu(this.next,(r=>(e-t)*r+t))}nextIntBetween(t,e){return ju((()=>this.PRNG.integer(e-t)+t))}shuffle(t){return kf(t,(t=>this.nextIntBetween(0,t)))}}const kf=(t,e)=>Cu((()=>c(ju((()=>Array.from(t))),hu((t=>{const r=[];for(let e=t.length;e>=2;e-=1)r.push(e);return c(r,Su((r=>c(e(r),vu((e=>Ff(t,r-1,e)))))),Ga(Gr(t)))}))))),Ff=(t,e,r)=>{const n=t[e];return t[e]=t[r],t[r]=n,t},Nf=t=>new If(A(t)),Cf=Symbol.for("effect/Tracer"),jf=t=>({[Cf]:Cf,...t}),Af=Mr("effect/Tracer"),Rf=Mr("effect/ParentSpan"),xf=function(){return function(t){let e="";for(let r=0;r<t;r++)e+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return e}}();class $f{name;parent;context;startTime;kind;_tag="Span";spanId;traceId="native";sampled=!0;status;attributes;events=[];links;constructor(t,e,r,n,s,i){this.name=t,this.parent=e,this.context=r,this.startTime=s,this.kind=i,this.status={_tag:"Started",startTime:s},this.attributes=new Map,this.traceId="Some"===e._tag?e.value.traceId:xf(32),this.spanId=xf(16),this.links=Array.from(n)}end(t,e){this.status={_tag:"Ended",endTime:t,exit:e,startTime:this.status.startTime}}attribute(t,e){this.attributes.set(t,e)}event(t,e,r){this.events.push([t,e,r??{}])}addLinks(t){this.links.push(...t)}}const Tf=jf({span:(t,e,r,n,s,i)=>new $f(t,e,r,n,s,i),context:t=>t()}),Lf=c(Ir(),Fr(Pl,Gl()),Fr(vf,Of),Fr(Ef,Nf(Math.random())),Fr(uf,ff()),Fr(Af,Tf)),Df=f(Symbol.for("effect/DefaultServices/currentServices"),(()=>hh(Lf))),Pf=t=>(t=>Ua((e=>t(e.currentDefaultServices))))((e=>t(e.unsafeMap.get(Pl.key)))),Bf=Pf((t=>t.currentTimeMillis)),qf=Pf,Uf=Symbol.for("effect/FiberRefs");class Jf{locals;[Uf]=Uf;constructor(t){this.locals=t}pipe(){return rt(this,arguments)}}const Gf=t(3,((t,e,r)=>{const n=new Map(t.locals);return r.locals.forEach(((t,r)=>{const s=t[0][1];if(!t[0][0][U](e)){if(!n.has(r)){if(J(s,r.initial))return;return void n.set(r,[[e,r.join(r.initial,s)]])}const i=n.get(r),[o,c]=((t,e,r,n=!1)=>{const s=t;let i,o=e,c=r,a=n;for(;void 0===i;)if(ke(o)&&ke(c)){const t=Ae(o)[0],e=xe(o),r=Ae(c)[0],n=Ae(c)[1],s=xe(c);t.startTimeMillis<r.startTimeMillis?(c=s,a=!0):t.startTimeMillis>r.startTimeMillis?o=e:t.id<r.id?(c=s,a=!0):t.id>r.id?o=e:i=[n,a]}else i=[s.initial,!0];return i})(r,i,t);if(c){const t=r.diff(o,s),c=i[0][1],a=r.join(c,r.patch(t)(c));if(!J(c,a)){let t;const s=i[0][0];t=s[U](e)?[[s,a],...i.slice(1)]:[[e,a],...i],n.set(r,t)}}}})),new Jf(n)})),Wf=t(2,((t,e)=>{const r=new Map;return Vf(t,r,e),new Jf(r)})),Vf=(t,e,r)=>{t.locals.forEach(((t,n)=>{const s=t[0][1],i=n.patch(n.fork)(s);J(s,i)?e.set(n,t):e.set(n,[[r,i],...t])}))},Hf=t(2,((t,e)=>{const r=new Map(t.locals);return r.delete(e),new Jf(r)})),zf=t(2,((t,e)=>t.locals.has(e)?ie(Ae(t.locals.get(e))[1]):se())),Yf=t(2,((t,e)=>c(zf(t,e),he((()=>e.initial))))),Kf=t(2,((t,{fiberId:e,fiberRef:r,value:n})=>{if(0===t.locals.size)return new Jf(new Map([[r,[[e,n]]]]));const s=new Map(t.locals);return Qf(s,e,r,n),new Jf(s)})),Qf=(t,e,r,n)=>{const s=t.get(r)??[];let i;if(ke(s)){const[t,r]=Ae(s);if(t[U](e)){if(J(r,n))return;i=[[e,n],...s.slice(1)]}else i=[[e,n],...s]}else i=[[e,n]];t.set(r,i)},Zf=t(2,((t,{entries:e,forkAs:r})=>{if(0===t.locals.size)return new Jf(new Map(e));const n=new Map(t.locals);return void 0!==r&&Vf(t,n,r),e.forEach((([t,e])=>{1===e.length?Qf(n,e[0][0],t,e[0][1]):e.forEach((([e,r])=>{Qf(n,e,t,r)}))})),new Jf(n)})),Xf=Yf,tb=Zf,eb=function(){return t=new Map,new Jf(t);var t},rb=Yu,nb=Ku,sb=Qu,ib=ne(c(ir,re((t=>t.ordinal)))),ob=t=>t.replace(/[\s="]/g,"_"),cb=t=>e=>`${ob(e.label)}=${t-e.startTime}ms`,ab=Mt,ub=Ft;class hb extends ub{}const lb=Symbol.for("effect/Readable"),fb=Symbol.for("effect/Ref"),bb={_A:t=>t};class db extends hb{ref;commit(){return this.get}[fb]=bb;[lb]=lb;constructor(t){super(),this.ref=t,this.get=ju((()=>bi(this.ref)))}get;modify(t){return ju((()=>{const e=bi(this.ref),[r,n]=t(e);return e!==n&&di(n)(this.ref),r}))}}const pb=t=>new db(li(t)),mb=t=>ju((()=>pb(t))),Sb=t=>t.get,gb=t(2,((t,e)=>t.modify((()=>[void 0,e])))),yb=t(2,((t,e)=>t.modify(e))),wb=t(2,((t,e)=>t.modify((t=>[void 0,e(t)])))),_b="Empty",vb="Remove",Ob="Update",Mb="AndThen",Eb={_tag:_b},Ib=(t,e)=>{const r=new Map(t.locals);let n=Eb;for(const[t,s]of e.locals.entries()){const e=Ae(s)[1],i=r.get(t);if(void 0!==i){const r=Ae(i)[1];J(r,e)||(n=kb({_tag:Ob,fiberRef:t,patch:t.diff(r,e)})(n))}else n=kb({_tag:"Add",fiberRef:t,value:e})(n);r.delete(t)}for(const[t]of r.entries())n=kb({_tag:vb,fiberRef:t})(n);return n},kb=t(2,((t,e)=>({_tag:Mb,first:t,second:e}))),Fb=t(3,((t,e,r)=>{let n=r,s=ze(t);for(;ke(s);){const t=Ae(s),r=xe(s);switch(t._tag){case _b:s=r;break;case"Add":n=Kf(n,{fiberId:e,fiberRef:t.fiberRef,value:t.value}),s=r;break;case vb:n=Hf(n,t.fiberRef),s=r;break;case Ob:{const i=Yf(n,t.fiberRef);n=Kf(n,{fiberId:e,fiberRef:t.fiberRef,value:t.fiberRef.patch(t.patch)(i)}),s=r;break}case Mb:s=Oe(t.first)(Oe(t.second)(r))}}return n})),Nb="effect/MetricLabel",Cb=Symbol.for(Nb);class jb{key;value;[Cb]=Cb;_hash;constructor(t,e){this.key=t,this.value=e,this._hash=D(Nb+this.key+this.value)}[j](){return this._hash}[U](t){return Rb(t)&&this.key===t.key&&this.value===t.value}pipe(){return rt(this,arguments)}}const Ab=(t,e)=>new jb(t,e),Rb=t=>m(t,Cb),xb=t(2,((t,e)=>du(t,{onFailure:t=>{const r=e(t);switch(r._tag){case"None":return ou(t);case"Some":return r.value}},onSuccess:Nu}))),$b=qf,Tb=t(2,((t,e)=>pu(t,{onFailure:t=>Nu(e.onFailure(t)),onSuccess:t=>Nu(e.onSuccess(t))}))),Lb=Ua((t=>Nu(t.getFiberRefs()))),Db=t=>(...e)=>{const r=fe(t);let n;for(let t=0,r=e.length;t<r;t++){const r=e[t];Qc(r)&&(n=void 0!==n?Kc(n,r):r,e=[...e.slice(0,t),...e.slice(t+1)],t--)}return void 0===n&&(n=Wc),Ua((t=>(t.log(e,n,r),Tu)))},Pb=Db(nb),Bb=Db(rb),qb=t(2,((t,e)=>du(t,{onFailure:t=>cu((()=>e(t))),onSuccess:Nu}))),Ub=t(2,((t,e)=>ku(t,(()=>ju(e))))),Jb=t(3,((t,e,r)=>_l((n=>vl(t,Fr(n,e,r)))))),Gb=t(3,((t,e,r)=>_l((n=>hu(r,(r=>vl(t,c(n,Fr(e,r))))))))),Wb=t=>{const e=Mn(t);return Pf((t=>t.sleep(e)))},Vb=Nu(se()),Hb=t(3,((t,e,r)=>hu(e,(n=>hu(t,(t=>vu(e,(e=>[r(n,e),t])))))))),zb=t(2,((t,e)=>du(t,{onFailure:t=>{const r=na(t);switch(r._tag){case"Left":return Wu(e(r.left),ou(t));case"Right":return ou(t)}},onSuccess:Nu}))),Yb=t(2,((t,e)=>du(t,{onFailure:t=>Wu(e(t),ou(t)),onSuccess:Nu}))),Kb=t(2,((t,e)=>Cu((()=>e()?vu(t,ie):Nu(se()))))),Qb="Sequential",Zb="Parallel",Xb={_tag:Qb},td={_tag:Zb},ed=Xb,rd=td,nd=t=>({_tag:"ParallelN",parallelism:t}),sd=Ib,id=Fb,od="effect/FiberStatus",cd=Symbol.for(od),ad="Done",ud="Running",hd="Suspended",ld=D(`${od}-${ad}`);class fd{[cd]=cd;_tag=ad;[j](){return ld}[U](t){return pd(t)&&t._tag===ad}}class bd{runtimeFlags;[cd]=cd;_tag=ud;constructor(t){this.runtimeFlags=t}[j](){return c(A(od),x(A(this._tag)),x(A(this.runtimeFlags)),q(this))}[U](t){return pd(t)&&t._tag===ud&&this.runtimeFlags===t.runtimeFlags}}class dd{runtimeFlags;blockingOn;[cd]=cd;_tag=hd;constructor(t,e){this.runtimeFlags=t,this.blockingOn=e}[j](){return c(A(od),x(A(this._tag)),x(A(this.runtimeFlags)),x(A(this.blockingOn)),q(this))}[U](t){return pd(t)&&t._tag===hd&&this.runtimeFlags===t.runtimeFlags&&J(this.blockingOn,t.blockingOn)}}const pd=t=>m(t,cd),md=new fd,Sd=t=>new bd(t),gd=Symbol.for("effect/Micro"),yd=Symbol.for("effect/Micro/MicroExit"),wd=Symbol.for("effect/Micro/MicroCause"),_d={_E:e};class vd extends globalThis.Error{_tag;traces;[wd];constructor(t,e,r){const n=`MicroCause.${t}`;let s,i,o;if(e instanceof globalThis.Error){s=`(${n}) ${e.name}`,i=e.message;const t=i.split("\n").length;o=e.stack?`(${n}) ${e.stack.split("\n").slice(0,t+3).join("\n")}`:`${s}: ${i}`}else s=n,i=K(e,0),o=`${s}: ${i}`;r.length>0&&(o+=`\n ${r.join("\n ")}`),super(i),this._tag=t,this.traces=r,this[wd]=_d,this.name=s,this.stack=o}pipe(){return rt(this,arguments)}toString(){return this.stack}[H](){return this.stack}}class Od extends vd{defect;constructor(t,e=[]){super("Die",t,e),this.defect=t}}class Md extends vd{constructor(t=[]){super("Interrupt","interrupted",t)}}const Ed=(t=[])=>new Md(t),Id=Symbol.for("effect/Micro/MicroFiber"),kd={_A:e,_E:e};class Fd{context;interruptible;[Id];_stack=[];_observers=[];_exit;_children;currentOpCount=0;constructor(t,e=!0){this.context=t,this.interruptible=e,this[Id]=kd}getRef(t){return(e=this.context).unsafeMap.has((r=t).key)?e.unsafeMap.get(r.key):yr(r);var e,r}addObserver(t){return this._exit?(t(this._exit),o):(this._observers.push(t),()=>{const e=this._observers.indexOf(t);e>=0&&this._observers.splice(e,1)})}_interrupted=!1;unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(Xd))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(void 0!==this._yielded){const t=this._yielded;this._yielded=void 0,t()}const e=this.runLoop(t);if(e===Td)return;const r=Nd.interruptChildren&&Nd.interruptChildren(this);if(void 0!==r)return this.evaluate(zd(r,(()=>e)));this._exit=e;for(let t=0;t<this._observers.length;t++)this._observers[t](e);this._observers.length=0}runLoop(t){let e=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!e&&this.getRef(cp).shouldYield(this)){e=!0;const t=r;r=zd(Wd,(()=>t))}if(r=r[Ad](this),r===Td){const t=this._yielded;return yd in t?(this._yielded=void 0,t):Td}}}catch(t){return m(r,Ad)?tp(t):tp(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const e=this._stack.pop();if(!e)return;const r=e[$d]&&e[$d](this);if(r)return{[t]:r};if(e[t])return e}}_yielded=void 0;yieldWith(t){return this._yielded=t,Td}children(){return this._children??=new Set}}const Nd=f("effect/Micro/fiberMiddleware",(()=>({interruptChildren:void 0}))),Cd=Symbol.for("effect/Micro/identifier"),jd=Symbol.for("effect/Micro/args"),Ad=Symbol.for("effect/Micro/evaluate"),Rd=Symbol.for("effect/Micro/successCont"),xd=Symbol.for("effect/Micro/failureCont"),$d=Symbol.for("effect/Micro/ensureCont"),Td=Symbol.for("effect/Micro/Yield"),Ld={_A:e,_E:e,_R:e},Dd={...ab,_op:"Micro",[gd]:Ld,pipe(){return rt(this,arguments)},[Symbol.iterator](){return new _(new E(this))},toJSON(){return{_id:"Micro",op:this[Cd],...jd in this?{args:this[jd]}:void 0}},toString(){return Y(this)},[H](){return Y(this)}};function Pd(){return tp("Micro.evaluate: Not implemented")}const Bd=t=>({...Dd,[Cd]:t.op,[Ad]:t.eval??Pd,[Rd]:t.contA,[xd]:t.contE,[$d]:t.ensure}),qd=t=>{const e=Bd(t);return function(){const r=Object.create(e);return r[jd]=!1===t.single?arguments:arguments[0],r}},Ud=t=>{const e={...Bd(t),[yd]:yd,_tag:t.op,get[t.prop](){return this[jd]},toJSON(){return{_id:"MicroExit",_tag:t.op,[t.prop]:this[jd]}},[U](e){return Kd(e)&&e._tag===t.op&&J(this[jd],e[jd])},[j](){return q(this,x(D(t.op))(A(this[jd])))}};return function(t){const r=Object.create(e);return r[jd]=t,r[Rd]=void 0,r[xd]=void 0,r[$d]=void 0,r}},Jd=Ud({op:"Success",prop:"value",eval(t){const e=t.getCont(Rd);return e?e[Rd](this[jd],t):t.yieldWith(this)}}),Gd=Ud({op:"Failure",prop:"cause",eval(t){let e=t.getCont(xd);for(;"Interrupt"===this[jd]._tag&&e&&t.interruptible;)e=t.getCont(xd);return e?e[xd](this[jd],t):t.yieldWith(this)}}),Wd=qd({op:"Yield",eval(t){let e=!1;return t.getRef(cp).scheduleTask((()=>{e||t.evaluate(ep)}),this[jd]??0),t.yieldWith((()=>{e=!0}))}})(0),Vd=Jd(void 0),Hd=qd({op:"WithMicroFiber",eval(t){return this[jd](t)}}),zd=t(2,((t,e)=>{const r=Object.create(Yd);return r[jd]=t,r[Rd]=e,r})),Yd=Bd({op:"OnSuccess",eval(t){return t._stack.push(this),this[jd]}}),Kd=t=>m(t,yd),Qd=Jd,Zd=Gd,Xd=Zd(Ed()),tp=t=>Zd(((t,e=[])=>new Od(t,e))(t)),ep=Qd(void 0),rp="setImmediate"in globalThis?globalThis.setImmediate:t=>setTimeout(t,0);class np{tasks=[];running=!1;scheduleTask(t,e){this.tasks.push(t),this.running||(this.running=!0,rp(this.afterScheduled))}afterScheduled=()=>{this.running=!1,this.runTasks()};runTasks(){const t=this.tasks;this.tasks=[];for(let e=0,r=t.length;e<r;e++)t[e]()}shouldYield(t){return t.currentOpCount>=t.getRef(op)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const sp=t(2,((t,e)=>Hd((r=>{const n=r.context;return r.context=e(n),hp(t,(()=>(r.context=n,Vd)))})))),ip=t(2,((t,e)=>sp(t,Ar(e))));class op extends(Rr()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048})){}class cp extends(Rr()("effect/Micro/currentScheduler",{defaultValue:()=>new np})){}const ap=t(2,((t,e)=>{const r=Object.create(up);return r[jd]=t,r[Rd]=e.onSuccess,r[xd]=e.onFailure,r})),up=Bd({op:"OnSuccessAndFailure",eval(t){return t._stack.push(this),this[jd]}}),hp=t(2,((t,e)=>bp((r=>ap(r(t),{onFailure:t=>zd(e(Zd(t)),(()=>Gd(t))),onSuccess:t=>zd(e(Qd(t)),(()=>Jd(t)))}))))),lp=qd({op:"SetInterruptible",ensure(t){if(t.interruptible=this[jd],t._interrupted&&t.interruptible)return()=>Xd}}),fp=t=>Hd((e=>e.interruptible?t:(e.interruptible=!0,e._stack.push(lp(!1)),e._interrupted?Xd:t))),bp=t=>Hd((r=>r.interruptible?(r.interruptible=!1,r._stack.push(lp(!0)),t(fp)):t(e)));class dp{buckets=[];scheduleTask(t,e){const r=this.buckets.length;let n,s=0;for(;s<r&&this.buckets[s][0]<=e;s++)n=this.buckets[s];n&&n[0]===e?n[1].push(t):s===r?this.buckets.push([e,[t]]):this.buckets.splice(s,0,[e,[t]])}}class pp{maxNextTickBeforeTimer;running=!1;tasks=new dp;constructor(t){this.maxNextTickBeforeTimer=t}starveInternal(t){const e=this.tasks.buckets;this.tasks.buckets=[];for(const[t,r]of e)for(let t=0;t<r.length;t++)r[t]();0===this.tasks.buckets.length?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout((()=>this.starveInternal(0)),0):Promise.resolve(void 0).then((()=>this.starveInternal(t+1)))}shouldYield(t){return t.currentOpCount>t.getFiberRef(ph)&&t.getFiberRef(dh)}scheduleTask(t,e){this.tasks.scheduleTask(t,e),this.running||(this.running=!0,this.starve())}}const mp=f(Symbol.for("effect/Scheduler/defaultScheduler"),(()=>new pp(2048)));class Sp{tasks=new dp;deferred=!1;scheduleTask(t,e){this.deferred?mp.scheduleTask(t,e):this.tasks.scheduleTask(t,e)}shouldYield(t){return t.currentOpCount>t.getFiberRef(ph)&&t.getFiberRef(dh)}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[e,r]of t)for(let t=0;t<r.length;t++)r[t]()}this.deferred=!0}}const gp=f(Symbol.for("effect/FiberRef/currentScheduler"),(()=>ch(mp))),yp=f(Symbol.for("effect/FiberRef/currentRequestMap"),(()=>ch(new Map))),wp=(t,e,r,n)=>{switch(t){case void 0:return e();case"unbounded":return r();case"inherit":return rh(wh,(t=>"unbounded"===t?r():t>1?n(t):e()));default:return t>1?n(t):e()}},_p="InterruptSignal",vp="Stateful",Op="Resume",Mp="YieldNow",Ep=t=>({_tag:_p,cause:t}),Ip=t=>({_tag:vp,onFiber:t}),kp=t=>({_tag:Op,effect:t}),Fp=Symbol.for("effect/FiberScope");class Np{[Fp]=Fp;fiberId=Ci;roots=new Set;add(t,e){this.roots.add(e),e.addObserver((()=>{this.roots.delete(e)}))}}class Cp{fiberId;parent;[Fp]=Fp;constructor(t,e){this.fiberId=t,this.parent=e}add(t,e){this.parent.tell(Ip((t=>{t.addChild(e),e.addObserver((()=>{t.removeChild(e)}))})))}}const jp=f(Symbol.for("effect/FiberScope/Global"),(()=>new Np)),Ap=Symbol.for("effect/Fiber"),Rp={_E:t=>t,_A:t=>t},xp=Symbol.for("effect/Fiber"),$p=t=>t.await,Tp=t=>t.inheritAll,Lp=t=>Gu(fu(t.await),t.inheritAll),Dp="effect/FiberCurrent",Pp=Symbol.for("effect/Logger"),Bp={_Message:t=>t,_Output:t=>t},qp=t=>({[Pp]:Bp,log:t,pipe(){return rt(this,arguments)}}),Up=/^[^\s"=]*$/,Jp=(t,e)=>({annotations:r,cause:n,date:s,fiberId:i,logLevel:o,message:c,spans:a})=>{const u=(e,r)=>`${ob(e)}=${(e=>e.match(Up)?e:t(e))(r)}`,h=(t,e)=>" "+u(t,e);let l=u("timestamp",s.toISOString());l+=h("level",o.label),l+=h("fiber",Ni(i));const f=(b=c,Array.isArray(b)?b:[b]);var b;for(let t=0;t<f.length;t++)l+=h("message",K(f[t],e));(t=>t._tag===Lc)(n)||(l+=h("cause",wa(n,{renderErrorCause:!0})));for(const t of a)l+=" "+cb(s.getTime())(t);for(const[t,n]of r)l+=h(t,K(n,e));return l},Gp=qp(Jp((t=>`"${t.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`)));"object"==typeof process&&null!==process&&"object"==typeof process.stdout&&null!==process.stdout&&process;const Wp="effect/MetricBoundaries",Vp=Symbol.for(Wp);class Hp{values;[Vp]=Vp;constructor(t){this.values=t,this._hash=c(D(Wp),x(B(this.values)))}_hash;[j](){return this._hash}[U](t){return zp(t)&&J(this.values,t.values)}pipe(){return rt(this,arguments)}}const zp=t=>m(t,Vp),Yp=t=>{const e=c(t,Ee(Jr(Number.POSITIVE_INFINITY)),nr);return new Hp(e)},Kp=t=>c(_e(t.count-1,(e=>t.start*Math.pow(t.factor,e))),Yr,Yp),Qp=Symbol.for("effect/MetricKeyType"),Zp="effect/MetricKeyType/Counter",Xp=Symbol.for(Zp),tm=Symbol.for("effect/MetricKeyType/Frequency"),em=Symbol.for("effect/MetricKeyType/Gauge"),rm="effect/MetricKeyType/Histogram",nm=Symbol.for(rm),sm=Symbol.for("effect/MetricKeyType/Summary"),im={_In:t=>t,_Out:t=>t};class om{incremental;bigint;[Qp]=im;[Xp]=Xp;constructor(t,e){this.incremental=t,this.bigint=e,this._hash=D(Zp)}_hash;[j](){return this._hash}[U](t){return am(t)}pipe(){return rt(this,arguments)}}class cm{boundaries;[Qp]=im;[nm]=nm;constructor(t){this.boundaries=t,this._hash=c(D(rm),x(A(this.boundaries)))}_hash;[j](){return this._hash}[U](t){return um(t)&&J(this.boundaries,t.boundaries)}pipe(){return rt(this,arguments)}}const am=t=>m(t,Xp),um=t=>m(t,nm),hm=Symbol.for("effect/MetricKey"),lm={_Type:t=>t},fm=er(J);class bm{name;keyType;description;tags;[hm]=lm;constructor(t,e,r,n=[]){this.name=t,this.keyType=e,this.description=r,this.tags=n,this._hash=c(D(this.name+this.description),x(A(this.keyType)),x(B(this.tags)))}_hash;[j](){return this._hash}[U](t){return dm(t)&&this.name===t.name&&J(this.keyType,t.keyType)&&J(this.description,t.description)&&fm(this.tags,t.tags)}pipe(){return rt(this,arguments)}}const dm=t=>m(t,hm),pm=t(2,((t,e)=>0===e.length?t:new bm(t.name,t.keyType,t.description,Ve(t.tags,e)))),mm=Symbol.for("effect/MetricState"),Sm="effect/MetricState/Counter",gm=Symbol.for(Sm),ym="effect/MetricState/Frequency",wm=Symbol.for(ym),_m="effect/MetricState/Gauge",vm=Symbol.for(_m),Om="effect/MetricState/Histogram",Mm=Symbol.for(Om),Em="effect/MetricState/Summary",Im=Symbol.for(Em),km={_A:t=>t};class Fm{count;[mm]=km;[gm]=gm;constructor(t){this.count=t}[j](){return c(A(Sm),x(A(this.count)),q(this))}[U](t){return xm(t)&&this.count===t.count}pipe(){return rt(this,arguments)}}const Nm=er(J);class Cm{occurrences;[mm]=km;[wm]=wm;constructor(t){this.occurrences=t}_hash;[j](){return c(D(ym),x(B(ve(this.occurrences.entries()))),q(this))}[U](t){return $m(t)&&Nm(ve(this.occurrences.entries()),ve(t.occurrences.entries()))}pipe(){return rt(this,arguments)}}class jm{value;[mm]=km;[vm]=vm;constructor(t){this.value=t}[j](){return c(A(_m),x(A(this.value)),q(this))}[U](t){return Tm(t)&&this.value===t.value}pipe(){return rt(this,arguments)}}class Am{buckets;count;min;max;sum;[mm]=km;[Mm]=Mm;constructor(t,e,r,n,s){this.buckets=t,this.count=e,this.min=r,this.max=n,this.sum=s}[j](){return c(A(Om),x(A(this.buckets)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return Lm(t)&&J(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}class Rm{error;quantiles;count;min;max;sum;[mm]=km;[Im]=Im;constructor(t,e,r,n,s,i){this.error=t,this.quantiles=e,this.count=r,this.min=n,this.max=s,this.sum=i}[j](){return c(A(Em),x(A(this.error)),x(A(this.quantiles)),x(A(this.count)),x(A(this.min)),x(A(this.max)),x(A(this.sum)),q(this))}[U](t){return Dm(t)&&this.error===t.error&&J(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return rt(this,arguments)}}const xm=t=>m(t,gm),$m=t=>m(t,wm),Tm=t=>m(t,vm),Lm=t=>m(t,Mm),Dm=t=>m(t,Im),Pm=Symbol.for("effect/MetricHook"),Bm={_In:t=>t,_Out:t=>t},qm=t=>({[Pm]:Bm,pipe(){return rt(this,arguments)},...t}),Um=BigInt(0),Jm=(t,e,r)=>{const n=r.length;if(!ke(e))return[];const s=e[0],i=e.slice(1),o=Gm(t,n,se(),0,s,r),c=ze(o);return i.forEach((e=>{c.push(Gm(t,n,o.value,o.consumed,e,o.rest))})),Ye(c,(t=>[t.quantile,t.value]))},Gm=(t,e,r,n,s,i)=>{let o=t,c=e,a=r,u=n,h=s,l=i,f=t,b=e,d=r,p=n,m=s,S=i;for(;;){if(!ke(l))return{quantile:h,value:se(),consumed:u,rest:[]};if(1===h)return{quantile:h,value:ie(Re(l)),consumed:u+l.length,rest:[]};const t=Ae(l),e=$e(l,(e=>e===t)),r=h*c,n=o/2*r,s=u+e[0].length,i=Math.abs(s-r);if(s<r-n)f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;else{if(s>r+n)return{quantile:h,value:oe(a)?ie(t):a,consumed:u,rest:l};switch(a._tag){case"None":f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue;case"Some":if(i<Math.abs(r-a.value)){f=o,b=c,d=je(l),p=s,m=h,S=e[1],o=f,c=b,a=d,u=p,h=m,l=S;continue}return{quantile:h,value:ie(a.value),consumed:u,rest:l}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},Wm=Symbol.for("effect/MetricPair"),Vm={_Type:t=>t},Hm=(t,e)=>({[Wm]:Vm,metricKey:t,metricState:e,pipe(){return rt(this,arguments)}}),zm=Symbol.for("effect/MetricRegistry");class Ym{[zm]=zm;map=Cl();snapshot(){const t=[];for(const[e,r]of this.map)t.push(Hm(e,r.get()));return t}get(t){const e=c(this.map,jl(t),be);if(null==e){if(am(t.keyType))return this.getCounter(t);if(m(t.keyType,em))return this.getGauge(t);if(m(t.keyType,tm))return this.getFrequency(t);if(um(t.keyType))return this.getHistogram(t);if((t=>m(t,sm))(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}return e}getCounter(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{let e=t.keyType.bigint?Um:0;const r=t.keyType.incremental?t.keyType.bigint?t=>t>=Um:t=>t>=0:()=>!0,n=t=>{r(t)&&(e+=t)};return qm({get:()=>new Fm(e),update:n,modify:n})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getFrequency(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const e=new Map;for(const r of t.keyType.preregisteredWords)e.set(r,0);const r=t=>{const r=e.get(t)??0;e.set(t,r+1)};return qm({get:()=>new Cm(e),update:r,modify:r})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getGauge(t){let e=c(this.map,jl(t),be);if(null==e){const r=((t,e)=>{let r=e;return qm({get:()=>new jm(r),update:t=>{r=t},modify:t=>{r+=t}})})(0,t.keyType.bigint?BigInt(0):0);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getHistogram(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const e=t.keyType.boundaries.values,r=e.length,n=new Uint32Array(r+1),s=new Float64Array(r);let i=0,o=0,a=Number.MAX_VALUE,u=Number.MIN_VALUE;c(e,De(ir),Ye(((t,e)=>{s[e]=t})));const h=t=>{let e=0,c=r;for(;e!==c;){const r=Math.floor(e+(c-e)/2);t<=s[r]?c=r:e=r,c===e+1&&(t<=s[e]?c=e:e=c)}n[e]=n[e]+1,i+=1,o+=t,t<a&&(a=t),t>u&&(u=t)},l=()=>{const t=we(r);let e=0;for(let i=0;i<r;i++)e+=n[i],t[i]=[s[i],e];return t};return qm({get:()=>{return t={buckets:l(),count:i,min:a,max:u,sum:o},new Am(t.buckets,t.count,t.min,t.max,t.sum);var t},update:h,modify:h})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}getSummary(t){let e=c(this.map,jl(t),be);if(null==e){const r=(t=>{const{error:e,maxAge:r,maxSize:n,quantiles:s}=t.keyType,i=c(s,De(ir)),o=we(n);let a=0,u=0,h=0,l=0,f=0;const b=t=>{const s=[];let c=0;for(;c!==n-1;){const e=o[c];if(null!=e){const[n,i]=e,o=xn(t-n);Wn(o,Cn)&&Gn(o,r)&&s.push(i)}c+=1}return Jm(e,i,De(s,ir))},d=(t,e)=>{n>0&&(a+=1,o[a%n]=[e,t]),l=0===u?t:Math.min(l,t),f=0===u?t:Math.max(f,t),u+=1,h+=t};return qm({get:()=>{return t={error:e,quantiles:b(Date.now()),count:u,min:l,max:f,sum:h},new Rm(t.error,t.quantiles,t.count,t.min,t.max,t.sum);var t},update:([t,e])=>d(t,e),modify:([t,e])=>d(t,e)})})(t);c(this.map,Rl(t))||c(this.map,xl(t,r)),e=r}return e}}const Km=Symbol.for("effect/Metric"),Qm={_Type:t=>t,_In:t=>t,_Out:t=>t},Zm=f(Symbol.for("effect/Metric/globalMetricRegistry"),(()=>new Ym)),Xm=function(t,e,r,n){const s=Object.assign((t=>Au(t,(t=>iS(s,t)))),{[Km]:Qm,keyType:t,unsafeUpdate:e,unsafeValue:r,unsafeModify:n,register(){return this.unsafeValue([]),this},pipe(){return rt(this,arguments)}});return s},tS=(t,e)=>eS(((t,e)=>new bm(t,(t=>new om(t?.incremental??!1,t?.bigint??!1))(e),fe(e?.description)))(t,e)),eS=t=>{let e;const r=new WeakMap,n=n=>{if(0===n.length)return void 0!==e||(e=Zm.get(t)),e;let s=r.get(n);return void 0!==s||(s=Zm.get(pm(t,n)),r.set(n,s)),s};return Xm(t.keyType,((t,e)=>n(e).update(t)),(t=>n(t).get()),((t,e)=>n(e).modify(t)))},rS=(t,e,r)=>eS(((t,e,r)=>new bm(t,(t=>new cm(t))(e),fe(r)))(t,e,r)),nS=t(3,((t,e,r)=>sS(t,[Ab(e,r)]))),sS=t(2,((t,e)=>Xm(t.keyType,((r,n)=>t.unsafeUpdate(r,Ve(e,n))),(r=>t.unsafeValue(Ve(e,r))),((r,n)=>t.unsafeModify(r,Ve(e,n)))))),iS=t(2,((t,e)=>rh(Mh,(r=>ju((()=>t.unsafeUpdate(e,r))))))),oS=t(2,((t,e)=>rh(yp,(r=>ju((()=>{if(r.has(t)){const n=r.get(t);n.state.completed||(n.state.completed=!0,Sl(n.result,e))}})))))),cS=Symbol.for("effect/Supervisor"),aS={_T:t=>t};class uS{underlying;value0;[cS]=aS;constructor(t,e){this.underlying=t,this.value0=e}get value(){return this.value0}onStart(t,e,r,n){this.underlying.onStart(t,e,r,n)}onEnd(t,e){this.underlying.onEnd(t,e)}onEffect(t,e){this.underlying.onEffect(t,e)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}}class hS{left;right;_tag="Zip";[cS]=aS;constructor(t,e){this.left=t,this.right=e}get value(){return Ju(this.left.value,this.right.value)}onStart(t,e,r,n){this.left.onStart(t,e,r,n),this.right.onStart(t,e,r,n)}onEnd(t,e){this.left.onEnd(t,e),this.right.onEnd(t,e)}onEffect(t,e){this.left.onEffect(t,e),this.right.onEffect(t,e)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}}const lS=t=>m(t,cS)&&S(t,"Zip");class fS{effect;[cS]=aS;constructor(t){this.effect=t}get value(){return this.effect}onStart(t,e,r,n){}onEnd(t,e){}onEffect(t,e){}onSuspend(t){}onResume(t){}map(t){return new uS(this,c(this.value,vu(t)))}zip(t){return new hS(this,t)}onRun(t,e){return t()}}const bS=f("effect/Supervisor/none",(()=>new fS(Tu))),dS="Empty",pS="AddSupervisor",mS="RemoveSupervisor",SS="AndThen",gS={_tag:dS},yS=(t,e)=>({_tag:SS,first:t,second:e}),wS=(t,e)=>J(t,e)?bS:lS(t)?wS(t.left,e).zip(wS(t.right,e)):t,_S=t=>J(t,bS)?ti():lS(t)?c(_S(t.left),ci(_S(t.right))):ei(t),vS=zo({empty:gS,patch:(t,e)=>((t,e)=>{let r=t,n=e;for(;cn(n);){const t=hn(n);switch(t._tag){case dS:n=dn(n);break;case pS:r=r.zip(t.supervisor),n=dn(n);break;case mS:r=wS(r,t.supervisor),n=dn(n);break;case SS:n=Xr(t.first)(Xr(t.second)(dn(n)))}}return r})(e,Jr(t)),combine:yS,diff:(t,e)=>{if(J(t,e))return gS;const r=_S(t),n=_S(e),s=c(n,oi(r),ai(gS,((t,e)=>yS(t,{_tag:pS,supervisor:e})))),i=c(r,oi(n),ai(gS,((t,e)=>yS(t,{_tag:mS,supervisor:e}))));return yS(s,i)}}),OS=tS("effect_fiber_started",{incremental:!0}),MS=tS("effect_fiber_active"),ES=tS("effect_fiber_successes",{incremental:!0}),IS=tS("effect_fiber_failures",{incremental:!0}),kS=nS(rS("effect_fiber_lifetimes",Kp({start:.5,factor:2,count:35})),"time_unit","milliseconds"),FS="Continue",NS="Yield",CS={_E:t=>t,_A:t=>t},jS=t=>{throw new Error(`BUG: FiberRuntime - ${K(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},AS=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),RS=f("effect/internal/fiberRuntime/yieldedOpChannel",(()=>({currentOp:null}))),xS={[ct]:(t,e,r)=>N((()=>e.effect_instruction_i1(r))),OnStep:(t,e,r)=>tl(tl(r)),[at]:(t,e,r)=>N((()=>e.effect_instruction_i2(r))),[St]:(t,e,r)=>(t.patchRuntimeFlags(t.currentRuntimeFlags,e.patch),ic(t.currentRuntimeFlags)&&t.isInterrupted()?Kh(t.getInterruptedCause()):tl(r)),[bt]:(t,e,r)=>(N((()=>e.effect_instruction_i2(r))),N((()=>e.effect_instruction_i0()))?(t.pushStack(e),N((()=>e.effect_instruction_i1()))):Tu),[dt]:(t,e,r)=>{for(;;){const n=N((()=>e.effect_instruction_i0.next(r)));if(n.done)return tl(n.value);const s=I(n.value);if(!Uh(s))return t.pushStack(e),s;if("Failure"===s._tag)return s;r=s.value}}},$S={[_p]:(t,e,r,n)=>(t.processNewInterruptSignal(n.cause),ic(e)?Kh(n.cause):r),[Op]:()=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[vp]:(t,e,r,n)=>(n.onFiber(t,Sd(e)),r),[Mp]:(t,e,r)=>hu(Uu(),(()=>r))},TS=gt();class LS extends hb{[Ap]=Rp;[xp]=CS;_fiberRefs;_fiberId;_queue=new Array;_children=null;_observers=new Array;_running=!1;_stack=[];_asyncInterruptor=null;_asyncBlockingOn=null;_exitValue=null;_steps=[];_isYielding=!1;currentRuntimeFlags;currentOpCount=0;currentSupervisor;currentScheduler;currentTracer;currentSpan;currentContext;currentDefaultServices;constructor(t,e,r){if(super(),this.currentRuntimeFlags=r,this._fiberId=t,this._fiberRefs=e,hc(r)){const t=this.getFiberRef(Mh);OS.unsafeUpdate(1,t),MS.unsafeUpdate(1,t)}this.refreshRefCache()}commit(){return Lp(this)}id(){return this._fiberId}resume(t){this.tell(kp(t))}get status(){return this.ask(((t,e)=>e))}get runtimeFlags(){return this.ask(((t,e)=>e._tag===ad?t.currentRuntimeFlags:e.runtimeFlags))}scope(){return new Cp((t=this).id(),t);var t}get children(){return this.ask((t=>Array.from(t.getChildren())))}getChildren(){return null===this._children&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(Ih)}fiberRefs(){return this.ask((t=>t.getFiberRefs()))}ask(t){return Cu((()=>{const e=ol(this._fiberId);return this.tell(Ip(((r,n)=>{Sl(e,ju((()=>t(r,n))))}))),ul(e)}))}tell(t){this._queue.push(t),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Ya((t=>{const e=e=>t(Nu(e));return this.tell(Ip((t=>{null!==t._exitValue?e(this._exitValue):t.addObserver(e)}))),ju((()=>this.tell(Ip((t=>{t.removeObserver(e)})))))}),this.id())}get inheritAll(){return Ua(((t,e)=>{const r=t.id(),n=t.getFiberRefs(),s=e.runtimeFlags,i=this.getFiberRefs(),o=Gf(n,r,i);t.setFiberRefs(o);const a=t.getFiberRef(dg);return(t=>{const e=new Da(ft);return e.effect_instruction_i0=t,e.effect_instruction_i1=void 0,e})(c(fc(s,a),mc(1),mc(16)))}))}get poll(){return ju((()=>fe(this._exitValue)))}unsafePoll(){return this._exitValue}interruptAsFork(t){return ju((()=>this.tell(Ep(zc(t)))))}unsafeInterruptAsFork(t){this.tell(Ep(zc(t)))}addObserver(t){null!==this._exitValue?t(this._exitValue):this._observers.push(t)}removeObserver(t){this._observers=this._observers.filter((e=>e!==t))}getFiberRefs(){return this.setFiberRef(dg,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(t){this._fiberRefs=Hf(this._fiberRefs,t)}getFiberRef(t){return this._fiberRefs.locals.has(t)?this._fiberRefs.locals.get(t)[0][1]:t.initial}setFiberRef(t,e){this._fiberRefs=Kf(this._fiberRefs,{fiberId:this._fiberId,fiberRef:t,value:e}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Df),this.currentTracer=this.currentDefaultServices.unsafeMap.get(Af.key),this.currentSupervisor=this.getFiberRef(pg),this.currentScheduler=this.getFiberRef(gp),this.currentContext=this.getFiberRef(bh),this.currentSpan=this.currentContext.unsafeMap.get(Rf.key)}setFiberRefs(t){this._fiberRefs=t,this.refreshRefCache()}addChild(t){this.getChildren().add(t)}removeChild(t){this.getChildren().delete(t)}transferChildren(t){const e=this._children;if(this._children=null,null!==e&&e.size>0)for(const r of e)null===r._exitValue&&t.add(this.currentRuntimeFlags,r)}drainQueueOnCurrentThread(){let t=!0;for(;t;){let e=FS;const r=globalThis[Dp];globalThis[Dp]=this;try{for(;e===FS;)e=0===this._queue.length?"Done":this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[Dp]=r}this._queue.length>0&&!this._running?(this._running=!0,e===NS?(this.drainQueueLaterOnExecutor(),t=!1):t=!0):t=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(dh))}drainQueueWhileRunning(t,e){let r=e;for(;this._queue.length>0;){const e=this._queue.splice(0,1)[0];r=$S[e._tag](this,t,r,e)}return r}isInterrupted(){return!((t=this.getFiberRef(Ih))._tag===Lc||ga(t,!0,((t,e)=>{switch(e._tag){case Lc:return ie(t);case Tc:case Dc:case Pc:return ie(!1);default:return se()}})));var t}addInterruptedCause(t){const e=this.getFiberRef(Ih);this.setFiberRef(Ih,Kc(e,t))}processNewInterruptSignal(t){this.addInterruptedCause(t),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(null===this._children||0===this._children.size)return!1;let t=!1;for(const e of this._children)e.tell(Ep(zc(this.id()))),t=!0;return t}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const t=this._children.values();this._children=null;let e=!1;return Du({while:()=>!e,body:()=>{const r=t.next();return r.done?ju((()=>{e=!0})):Wa(r.value.await)},step:()=>{}})}return null}reportExitValue(t){if(hc(this.currentRuntimeFlags)){const e=this.getFiberRef(Mh),r=this.id().startTimeMillis,n=Date.now();switch(kS.unsafeUpdate(n-r,e),MS.unsafeUpdate(-1,e),t._tag){case ut:ES.unsafeUpdate(1,e);break;case it:IS.unsafeUpdate(1,e)}}if("Failure"===t._tag){const e=this.getFiberRef(vh);ta(t.cause)||"Some"!==e._tag||this.log("Fiber terminated with an unhandled error",t.cause,e)}}setExitValue(t){this._exitValue=t,this.reportExitValue(t);for(let e=this._observers.length-1;e>=0;e--)this._observers[e](t);this._observers=[]}getLoggers(){return this.getFiberRef(qS)}log(t,e,r){const n=ce(r)?r.value:this.getFiberRef(Sh),s=this.getFiberRef(DS);if(ib(s,n))return;const i=this.getFiberRef(gh),o=this.getFiberRef(mh),c=this.getLoggers(),a=this.getFiberRefs();if(ni(c)>0){const r=Nr(this.getFiberRef(Df),Pl),s=new Date(r.unsafeCurrentTimeMillis());((t,e)=>{const r=tt.fiberRefs;tt.fiberRefs=t;try{return e()}finally{tt.fiberRefs=r}})(a,(()=>{for(const r of c)r.log({fiberId:this.id(),logLevel:n,message:t,cause:e,context:a,spans:i,annotations:o,date:s})}))}}evaluateMessageWhileSuspended(t){switch(t._tag){case Mp:return NS;case _p:return this.processNewInterruptSignal(t.cause),null!==this._asyncInterruptor&&(this._asyncInterruptor(Kh(t.cause)),this._asyncInterruptor=null),FS;case Op:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(t.effect),FS;case vp:return t.onFiber(this,null!==this._exitValue?md:new dd(this.currentRuntimeFlags,this._asyncBlockingOn)),FS;default:return jS(t)}}evaluateEffect(t){this.currentSupervisor.onResume(this);try{let e=ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(this.getInterruptedCause()):t;for(;null!==e;){const t=this.runLoop(e);if(t===AS){const t=RS.currentOp;RS.currentOp=null,t._op===mt?cc(this.currentRuntimeFlags,32)?(this.tell({_tag:Mp}),this.tell(kp(el)),e=null):e=el:t._op===nt&&(e=null)}else{this.currentRuntimeFlags=c(this.currentRuntimeFlags,sc(16));const r=this.interruptAllChildren();null!==r?e=hu(r,(()=>t)):(0===this._queue.length?this.setExitValue(t):this.tell(kp(t)),e=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(t){if(this._running)this.tell(kp(t));else{this._running=!0;const e=globalThis[Dp];globalThis[Dp]=this;try{this.evaluateEffect(t)}finally{this._running=!1,globalThis[Dp]=e,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(t){this.tell(kp(t))}patchRuntimeFlags(t,e){const r=bc(t,e);return globalThis[Dp]=this,this.currentRuntimeFlags=r,r}initiateAsync(t,e){let r=!1;const n=t=>{r||(r=!0,this.tell(kp(t)))};ic(t)&&(this._asyncInterruptor=n);try{e(n)}catch(t){n(ou(Hc(t)))}}pushStack(t){this._stack.push(t),"OnStep"===t._op&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const t=this._stack.pop();if(t)return"OnStep"===t._op&&this._steps.pop(),t}getNextSuccessCont(){let t=this.popStack();for(;t;){if(t._op!==ot)return t;t=this.popStack()}}getNextFailCont(){let t=this.popStack();for(;t;){if(t._op!==ct&&t._op!==bt&&t._op!==dt)return t;t=this.popStack()}}[lt](t){return ju((()=>Cr(this.currentContext,t)))}Left(t){return su(t.left)}None(t){return su(new Ph)}Right(t){return tl(t.right)}Some(t){return tl(t.value)}Micro(t){return Ha((e=>{let r=e;const n=(t=>{const e=new Fd(cp.context(new np));return e.evaluate(t),e})(ip(t,this.currentContext));return n.addObserver((t=>{if("Success"===t._tag)return r(tl(t.value));switch(t.cause._tag){case"Interrupt":return r(Kh(zc(Ci)));case"Fail":return r(su(t.cause.error));case"Die":return r(tu(t.cause.defect))}})),Ha((t=>{r=()=>{t(Tu)},n.unsafeInterrupt()}))}))}[ht](t){const e=N((()=>t.effect_instruction_i0())),r=this.getNextSuccessCont();return void 0!==r?(r._op in xS||jS(r),xS[r._op](this,r,e)):(RS.currentOp=tl(e),AS)}[ut](t){const e=t,r=this.getNextSuccessCont();return void 0!==r?(r._op in xS||jS(r),xS[r._op](this,r,e.effect_instruction_i0)):(RS.currentOp=e,AS)}[it](t){const e=t.effect_instruction_i0,r=this.getNextFailCont();if(void 0===r)return RS.currentOp=Kh(e),AS;switch(r._op){case ot:case at:return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(oa(e)):N((()=>r.effect_instruction_i1(e)));case"OnStep":return ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(oa(e)):tl(Kh(e));case St:return this.patchRuntimeFlags(this.currentRuntimeFlags,r.patch),ic(this.currentRuntimeFlags)&&this.isInterrupted()?Kh(Kc(e,this.getInterruptedCause())):Kh(e);default:jS(r)}}[pt](t){return N((()=>t.effect_instruction_i0(this,Sd(this.currentRuntimeFlags))))}Blocked(t){const e=this.getFiberRefs(),r=this.currentRuntimeFlags;if(this._steps.length>0){const n=[],s=this._steps[this._steps.length-1];let i=this.popStack();for(;i&&"OnStep"!==i._op;)n.push(i),i=this.popStack();this.setFiberRefs(s.refs),this.currentRuntimeFlags=s.flags;const o=sd(s.refs,e),c=fc(s.flags,r);return tl($a(t.effect_instruction_i0,Ua((e=>{for(;n.length>0;)e.pushStack(n.pop());return e.setFiberRefs(id(e.id(),e.getFiberRefs())(o)),e.currentRuntimeFlags=bc(c)(e.currentRuntimeFlags),t.effect_instruction_i1}))))}return $u((e=>hu(HS((t=>{const e=new Da("RunBlocked");return e.effect_instruction_i0=t,e})(t.effect_instruction_i0)),(()=>e(t.effect_instruction_i1)))))}RunBlocked(t){return Su((t=>{let e=to(t),r=Xi();for(;;){const[t,n]=so(e,[Mc(),Xi()],(([t,e],r)=>{const[n,s]=yc(r);return[Ic(t,n),eo(e,s)]}));if(r=wc(r,t),Qi(n))return io(r);e=n}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")})(t.effect_instruction_i0),(t=>WS((t=>Array.from(t.map))(t),(([t,e])=>{const r=new Map,n=[];for(const t of e){n.push(Vr(t));for(const e of t)r.set(e.request,e)}const s=n.flat();return ih(_g(t.runAll(n),s,(()=>s.forEach((t=>{t.listeners.interrupted=!0})))),yp,r)}),!1,!1)))}[ft](t){const e=t.effect_instruction_i0,r=this.currentRuntimeFlags,n=bc(r,e);if(ic(n)&&this.isInterrupted())return Kh(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,e),t.effect_instruction_i1){const e=fc(n,r);return this.pushStack(new La(e,t)),N((()=>t.effect_instruction_i1(r)))}return el}[ct](t){return this.pushStack(t),t.effect_instruction_i0}OnStep(t){return this.pushStack(t),t.effect_instruction_i0}[ot](t){return this.pushStack(t),t.effect_instruction_i0}[at](t){return this.pushStack(t),t.effect_instruction_i0}[nt](t){return this._asyncBlockingOn=t.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,t.effect_instruction_i0),RS.currentOp=t,AS}[mt](t){return this._isYielding=!1,RS.currentOp=t,AS}[bt](t){const e=t.effect_instruction_i1;return(0,t.effect_instruction_i0)()?(this.pushStack(t),e()):el}[dt](t){return xS[dt](this,t,void 0)}[st](t){return N((()=>t.commit()))}runLoop(t){let e=t;for(this.currentOpCount=0;;){if(2&this.currentRuntimeFlags&&this.currentSupervisor.onEffect(this,e),this._queue.length>0&&(e=this.drainQueueWhileRunning(this.currentRuntimeFlags,e)),!this._isYielding){this.currentOpCount+=1;const t=this.currentScheduler.shouldYield(this);if(!1!==t){this._isYielding=!0,this.currentOpCount=0;const r=e;e=hu(Uu({priority:t}),(()=>r))}}try{if(e=this.currentTracer.context((()=>{if(TS!==e[Ta]._V){const t=this.getFiberRef(Oh);"Some"===t._tag&&this.log(`Executing an Effect versioned ${e[Ta]._V} with a Runtime of version 3.19.14, 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`,Wc,t)}return this[e._op](e)}),this),e===AS){const t=RS.currentOp;return t._op===mt||t._op===nt?AS:(RS.currentOp=null,t._op===ut||t._op===it?t:Kh(Hc(t)))}}catch(t){e=e!==AS&&!m(e,"_op")||!(e._op in this)?eu(`Not a valid effect: ${K(e)}`):m(t,Lh)?Kh(Kc(Hc(t),zc(Ci))):tu(t)}}}run=()=>{this.drainQueueOnCurrentThread()}}const DS=f("effect/FiberRef/currentMinimumLogLevel",(()=>ch(sb))),PS=f(Symbol.for("effect/Logger/defaultLogger"),(()=>{return t=Gp,qp((e=>{const r=Xf(e.context,Df);Nr(r,vf).unsafe.log(t.log(e))}));var t})),BS=f(Symbol.for("effect/Logger/tracerLogger"),(()=>qp((({annotations:t,cause:e,context:r,fiberId:n,logLevel:s,message:i})=>{const o=jr(Yf(r,bh),Rf);if("None"===o._tag||"ExternalSpan"===o.value._tag)return;const c=Cr(Yf(r,Df),Pl),a={};for(const[e,r]of t)a[e]=r;a["effect.fiberId"]=Ri(n),a["effect.logLevel"]=s.label,null!==e&&"Empty"!==e._tag&&(a["effect.cause"]=wa(e,{renderErrorCause:!0})),o.value.event(K(Array.isArray(i)&&1===i.length?i[0]:i),c.unsafeCurrentTimeNanos(),a)})))),qS=f(Symbol.for("effect/FiberRef/currentLoggers"),(()=>ah(ei(PS,BS)))),US=(t,r)=>{const[n,s]=(t=>{if(Array.isArray(t)||y(t))return[t,se()];const e=Object.keys(t),r=e.length;return[e.map((e=>t[e])),ie((t=>{const n={};for(let s=0;s<r;s++)n[e[s]]=t[s];return n}))]})(t);return"validate"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return hu(JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>{const e=se(),s=t.length,i=new Array(s),o=new Array(s);let c=!1;for(let r=0;r<s;r++){const n=t[r];"Left"===n._tag?(i[r]=ie(n.left),c=!0):(o[r]=n.right,i[r]=e)}return c?su("Some"===r._tag?r.value(i):i):n?.discard?Tu:Nu("Some"===r._tag?r.value(o):o)}))})(n,s,r):"either"===r?.mode?((t,r,n)=>{const s=[];for(const e of t)s.push(ru(e));return n?.discard?JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,discard:!0,concurrentFinalizers:n?.concurrentFinalizers}):vu(JS(s,e,{concurrency:n?.concurrency,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(t=>"Some"===r._tag?r.value(t):t))})(n,s,r):!0!==r?.discard&&"Some"===s._tag?vu(JS(n,e,r),s.value):JS(n,e,r)},JS=t((t=>y(t[0])),((t,e,r)=>Ua((n=>{const s=!0===r?.batching||"inherit"===r?.batching&&n.getFiberRef(_h);return r?.discard?wp(r.concurrency,(()=>tg(ed,r?.concurrentFinalizers)((r=>s?WS(t,((t,n)=>r(e(t,n))),!0,!1,1):Su(t,((t,n)=>r(e(t,n))))))),(()=>tg(rd,r?.concurrentFinalizers)((r=>WS(t,((t,n)=>r(e(t,n))),s,!1)))),(n=>tg(nd(n),r?.concurrentFinalizers)((r=>WS(t,((t,n)=>r(e(t,n))),s,!1,n))))):wp(r?.concurrency,(()=>tg(ed,r?.concurrentFinalizers)((r=>s?VS(t,1,((t,n)=>r(e(t,n))),!0):mu(t,((t,n)=>r(e(t,n))))))),(()=>tg(rd,r?.concurrentFinalizers)((r=>GS(t,((t,n)=>r(e(t,n))),s)))),(n=>tg(nd(n),r?.concurrentFinalizers)((r=>VS(t,n,((t,n)=>r(e(t,n))),s)))))})))),GS=(t,e,r)=>Cu((()=>{const n=ve(t),s=new Array(n.length);return Wu(WS(n,((t,r)=>hu(e(t,r),(t=>ju((()=>s[r]=t))))),r,!1),Nu(s))})),WS=(t,e,r,n,s)=>$u((i=>(t=>Ua((e=>{const r=c(e.getFiberRef(Eh),he((()=>e.scope())));return t(ih(Eh,ie(r)))})))((o=>Ua((c=>{let a=Array.from(t).reverse(),u=a.length;if(0===u)return Tu;let h=0,l=!1;const f=s?Math.min(a.length,s):a.length,b=new Set,d=new Array,p=new Array,m=new Array,S=new Array,g=()=>{const t=d.filter((({exit:t})=>"Failure"===t._tag)).sort(((t,e)=>t.index<e.index?-1:t.index===e.index?0:1)).map((({exit:t})=>t));return 0===t.length&&t.push(el),t},y=(t,e=!1)=>{const r=xu(o(t)),n=YS(r,c,c.currentRuntimeFlags,jp);return c.currentScheduler.scheduleTask((()=>{e&&n.unsafeInterruptAsFork(c.id()),n.resume(r)}),0),n},w=()=>{n||(u-=a.length,a=[]),l=!0,b.forEach((t=>{t.currentScheduler.scheduleTask((()=>{t.unsafeInterruptAsFork(c.id())}),0)}))},_=r?lu:nu,v=y(Ya((t=>{const n=(t,e)=>{"Blocked"===t._op?S.push(t):(d.push({index:e,exit:t}),"Failure"!==t._op||l||w())},o=()=>{if(a.length>0){const f=a.pop();let w=h++;const v=()=>{const t=a.pop();return w=h++,hu(Uu(),(()=>hu(_(i(e(t,w))),O)))},O=t=>a.length>0&&(n(t,w),a.length>0)?v():Nu(t),M=hu(_(i(e(f,w))),O),E=y(M);p.push(E),b.add(E),l&&E.currentScheduler.scheduleTask((()=>{E.unsafeInterruptAsFork(c.id())}),0),E.addObserver((e=>{let i;if(i="Failure"===e._op?e:e.effect_instruction_i0,m.push(E),b.delete(E),n(i,w),d.length===u)t(Nu(he(Hh(g(),{parallel:!0}),(()=>el))));else if(S.length+d.length===u){const e=g(),n=S.map((t=>t.effect_instruction_i0)).reduce(Sc);t(Nu($a(n,WS([he(Hh(e,{parallel:!0}),(()=>el)),...S.map((t=>t.effect_instruction_i1))],(t=>t),r,!0,s))))}else o()}))}};for(let t=0;t<f;t++)o()})));return Wa(Eu(fu(i(Lp(v))),Zh({onFailure:t=>{w();const e=S.length+1,r=Math.min("number"==typeof s?s:S.length,S.length),n=Array.from(S);return Ya((s=>{let i=0;const o=(r,o)=>()=>{i++,i===e&&s(tl(Kh(t))),n.length>0&&o&&c()},c=()=>{y(n.pop(),!0).addObserver(o(0,!0))};v.addObserver(o(0,!1));for(let t=0;t<r;t++)c()}))},onSuccess:()=>mu(m,(t=>t.inheritAll))})))})))))),VS=(t,e,r,n)=>Cu((()=>{const s=ve(t),i=new Array(s.length);return Wu(WS(s,((t,e)=>vu(r(t,e),(t=>i[e]=t))),n,!1,e),Nu(i))})),HS=t=>QS(t,jp),zS=(t,e,r,n=null)=>{const s=KS(t,e,r,n);return s.resume(t),s},YS=(t,e,r,n=null)=>KS(t,e,r,n),KS=(t,e,r,n=null)=>{const s=xi(),i=e.getFiberRefs(),o=Wf(i,s),a=new LS(s,o,r),u=Yf(o,bh),h=a.currentSupervisor;return h.onStart(u,t,ie(e),a),a.addObserver((t=>h.onEnd(t,a))),(null!==n?n:c(e.getFiberRef(Eh),he((()=>e.scope())))).add(r,a),a},QS=(t,e)=>Ua(((r,n)=>Nu(zS(t,r,n.runtimeFlags,e)))),ZS=t=>_l((e=>ae(jr(e,cg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Parallel":return t;case"Sequential":case"ParallelN":return hu(Ah(e,rd),(e=>fg(t,e)))}}}))),XS=t=>e=>_l((r=>ae(jr(r,cg),{onNone:()=>e,onSome:r=>"ParallelN"===r.strategy._tag&&r.strategy.parallelism===t?e:hu(Ah(r,nd(t)),(t=>fg(e,t)))}))),tg=(t,r)=>n=>_l((s=>ae(jr(s,cg),{onNone:()=>n(e),onSome:s=>{if(!0!==r)return n(e);{const e="Parallel"===t._tag?ZS:"Sequential"===t._tag?rg:XS(t.parallelism);switch(s.strategy._tag){case"Parallel":return e(n(ZS));case"Sequential":return e(n(rg));case"ParallelN":return e(n(XS(s.strategy.parallelism)))}}}}))),eg=t=>hu(lg(),(e=>Eu(t(e),(t=>e.close(t))))),rg=t=>_l((e=>ae(jr(e,cg),{onNone:()=>t,onSome:e=>{switch(e.strategy._tag){case"Sequential":return t;case"Parallel":case"ParallelN":return hu(Ah(e,ed),(e=>fg(t,e)))}}}))),ng=t((t=>qa(t[1])),((t,e,r)=>og(t,e,((t,e)=>[t,e]),r))),sg=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?og(t,e,(t=>t),r):Gu(t,e))),ig=t((t=>qa(t[1])),((t,e,r)=>!0===r?.concurrent||void 0!==r?.batching&&!1!==r.batching?og(t,e,((t,e)=>e),r):Wu(t,e))),og=t((t=>qa(t[1])),((t,e,r,n)=>vu(US([t,e],{concurrency:n?.concurrent?2:1,batching:n?.batching,concurrentFinalizers:n?.concurrentFinalizers}),(([t,e])=>r(t,e))))),cg=Mr("effect/Scope"),ag=cg,ug={[kh]:kh,[Fh]:Fh,pipe(){return rt(this,arguments)},fork(t){return ju((()=>{const e=hg(t);if("Closed"===this.state._tag)return e.state=this.state,e;const r={};return this.state.finalizers.set(r,(t=>e.close(t))),((t,e)=>{"Open"===t.state._tag&&t.state.finalizers.set({},e)})(e,(()=>ju((()=>{"Open"===this.state._tag&&this.state.finalizers.delete(r)})))),e}))},close(t){return Cu((()=>{if("Closed"===this.state._tag)return Tu;const e=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:t},0===e.length?Tu:this.strategy._tag===Qb?c(mu(e,(e=>nu(e(t)))),hu((t=>c(Hh(t),pe(Vh),he((()=>el)))))):(()=>this.strategy._tag===Zb)()?c(GS(e,(e=>nu(e(t))),!1),hu((t=>c(Hh(t,{parallel:!0}),pe(Vh),he((()=>el)))))):c(VS(e,this.strategy.parallelism,(e=>nu(e(t))),!1),hu((t=>c(Hh(t,{parallel:!0}),pe(Vh),he((()=>el))))))}))},addFinalizer(t){return Cu((()=>"Closed"===this.state._tag?t(this.state.exit):(this.state.finalizers.set({},t),Tu)))}},hg=(t=Xb)=>{const e=Object.create(ug);return e.strategy=t,e.state={_tag:"Open",finalizers:new Map},e},lg=(t=Xb)=>ju((()=>hg(t))),fg=t(2,((t,e)=>Ml(t,Ar(kr(cg,e))))),bg=t=>lh(t,{differ:vS,fork:gS}),dg=fh(uc),pg=bg(bS),mg=t(3,((t,e,r)=>gg(t,e,{onSelfWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onSelfDone(n,e)));case it:return r.onSelfDone(n,e)}})),onOtherWin:(t,e)=>hu(t.await,(n=>{switch(n._tag){case ut:return hu(t.inheritAll,(()=>r.onOtherDone(n,e)));case it:return r.onOtherDone(n,e)}}))}))),Sg=t(2,((t,e)=>uu((r=>mg(t,e,{onSelfDone:(t,e)=>Xh(t,{onFailure:t=>c(Lp(e),qb((e=>Yc(t,e)))),onSuccess:t=>c(e,zu(r),Ga(t))}),onOtherDone:(t,e)=>Xh(t,{onFailure:t=>c(Lp(e),qb((e=>Yc(e,t)))),onSuccess:t=>c(e,zu(r),Ga(t))})}))))),gg=t(3,((t,e,r)=>Ua(((n,s)=>{const i=s.runtimeFlags,o=li(!0),c=KS(t,n,i,r.selfScope),a=KS(e,n,i,r.otherScope);return Ya((n=>{c.addObserver((()=>yg(c,a,r.onSelfWin,o,n))),a.addObserver((()=>yg(a,c,r.onOtherWin,o,n))),c.startFork(t),a.startFork(e)}),ji(c.id(),a.id()))})))),yg=(t,e,r,n,s)=>{fi(!0,!1)(n)&&s(r(t,e))},wg=t(2,((t,e)=>$u((r=>du(r(t),{onFailure:t=>du(e,{onFailure:e=>ou(Kc(t,e)),onSuccess:()=>ou(t)}),onSuccess:t=>Ga(e,t)}))))),_g=(t,e,r)=>uu((n=>hu(hu(HS(wu(t)),(t=>Ya((n=>{const s=e.map((t=>t.listeners.count)),i=()=>{s.every((t=>0===t))&&e.every((t=>"Pending"===t.result.state.current._tag||!("Done"!==t.result.state.current._tag||!Uh(t.result.state.current.effect)||"Failure"!==t.result.state.current.effect._tag||!Xc(t.result.state.current.effect.cause))))&&(o.forEach((t=>t())),r?.(),n(Hu(t)))};t.addObserver((t=>{o.forEach((t=>t())),n(t)}));const o=e.map(((t,e)=>{const r=t=>{s[e]=t,i()};return t.listeners.addObserver(r),()=>t.listeners.removeObserver(r)}));return i(),ju((()=>{o.forEach((t=>t()))}))})))),(()=>Cu((()=>{const t=e.flatMap((t=>t.state.completed?[]:[t]));return Su(t,(t=>oS(t.request,(t=>Kh(zc(t)))(n))))})))))),vg=Symbol.for("effect/ScheduleInterval"),Og={[vg]:vg,startMillis:0,endMillis:0},Mg=(t,e)=>t>e?Og:{[vg]:vg,startMillis:t,endMillis:e},Eg=t(2,((t,e)=>Ig(t,e)===t)),Ig=t(2,((t,e)=>t.endMillis<=e.startMillis?t:e.endMillis<=t.startMillis?e:t.startMillis<e.startMillis?t:e.startMillis<t.startMillis?e:t.endMillis<=e.endMillis?t:e)),kg=t(2,((t,e)=>{const r=Math.max(t.startMillis,e.startMillis),n=Math.min(t.endMillis,e.endMillis);return Mg(r,n)})),Fg=Og,Ng=Eg,Cg=kg,jg=Symbol.for("effect/ScheduleIntervals"),Ag=t=>({[jg]:jg,intervals:t}),Rg=t(2,((t,e)=>xg(t.intervals,e.intervals,qr()))),xg=(t,e,r)=>{let n=t,s=e,i=r;for(;cn(n)&&cn(s);){const t=c(hn(n),Cg(hn(s))),e=(o=t).startMillis>=o.endMillis?i:c(i,Xr(t));c(hn(n),Ng(hn(s)))?n=dn(n):s=dn(s),i=e}var o;return Ag(Hr(i))},$g=t=>c(t.intervals,an,he((()=>Fg))).startMillis,Tg=t(2,((t,e)=>$g(t)<$g(e))),Lg=Ag,Dg=Rg,Pg=$g,Bg=t=>c(t.intervals,an,he((()=>Fg))).endMillis,qg=Tg,Ug="Continue",Jg="Done",Gg={_tag:Jg},Wg=t=>t._tag===Ug,Vg=t=>t._tag===Jg,Hg=Nh,zg=Ch,Yg=jh,Kg=fg,Qg=Ah,Zg=lg;class Xg{permits;waiters=new Set;taken=0;constructor(t){this.permits=t}get free(){return this.permits-this.taken}take=t=>za((e=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),this.taken+=t,e(Nu(t)))};return this.waiters.add(r),ju((()=>{this.waiters.delete(r)}))}return this.taken+=t,e(Nu(t))}));updateTakenUnsafe(t,e){return this.taken=e(this.taken),this.waiters.size>0&&t.getFiberRef(gp).scheduleTask((()=>{const t=this.waiters.values();let e=t.next();for(;!1===e.done&&this.free>0;)e.value(),e=t.next()}),t.getFiberRef(dh)),Nu(this.free)}updateTaken(t){return Ua((e=>this.updateTakenUnsafe(e,t)))}resize=t=>Wa(Ua((e=>(this.permits=t,this.free<0?Tu:this.updateTakenUnsafe(e,(t=>t))))));release=t=>this.updateTaken((e=>e-t));releaseAll=this.updateTaken((()=>0));withPermits=t=>e=>$u((r=>hu(r(this.take(t)),(t=>wg(r(e),this.release(t))))));withPermitsIfAvailable=t=>e=>$u((r=>Cu((()=>this.free<t?Vb:(this.taken+=t,wg(r((t=>vu(t,ie))(e)),this.release(t)))))))}const ty=t=>new Xg(t),ey=t(2,((t,e)=>Ua(((r,n)=>{const s=e,i=zS(t,r,n.runtimeFlags,jp);if("Open"===s.state._tag){const t=()=>uu((t=>J(t,i.id())?Tu:Wa(Hu(i)))),e={};s.state.finalizers.set(e,t),i.addObserver((()=>{"Closed"!==s.state._tag&&s.state.finalizers.delete(e)}))}else i.unsafeInterruptAsFork(r.id());return Nu(i)})))),ry=t(2,((t,e)=>c(nu(t),Sg(nu(e)),(t=>fu(t))))),ny=Symbol.for("effect/Ref/SynchronizedRef"),sy={_A:t=>t};class iy extends hb{ref;withLock;[ny]=sy;[fb]=bb;[lb]=lb;constructor(t,e){super(),this.ref=t,this.withLock=e,this.get=Sb(this.ref)}get;commit(){return this.get}modify(t){return this.modifyEffect((e=>Nu(t(e))))}modifyEffect(t){return this.withLock(c(hu(Sb(this.ref),t),hu((([t,e])=>Ga(gb(this.ref,e),t)))))}}const oy=t=>{const e=pb(t),r=ty(1);return new iy(e,r.withPermits(1))},cy=Symbol.for("effect/ManagedRuntime"),ay=t=>function(){if(1===arguments.length){const e=arguments[0];return(r,...n)=>t(e,r,...n)}return t.apply(this,arguments)},uy=ay(((t,e,r)=>{const n=xi(),s=[[bh,[[n,t.context]]]];r?.scheduler&&s.push([gp,[[n,r.scheduler]]]);let i=tb(t.fiberRefs,{entries:s,forkAs:n});r?.updateRefs&&(i=r.updateRefs(i,n));const o=new LS(n,i,t.runtimeFlags);let c=e;r?.scope&&(c=hu(Qg(r.scope,Xb),(t=>Wu(Nh(t,uu((t=>J(t,o.id())?Tu:zu(o,t)))),Eu(e,(e=>Yg(t,e)))))));const a=o.currentSupervisor;return a!==bS&&(a.onStart(t.context,c,se(),o),o.addObserver((t=>a.onEnd(t,o)))),jp.add(t.runtimeFlags,o),!1===r?.immediate?o.resume(c):o.start(c),o})),hy=ay(((t,e)=>{const r=Sy(t)(e);if("Failure"===r._tag)throw py(r.effect_instruction_i0);return r.effect_instruction_i0}));class ly extends Error{fiber;_tag="AsyncFiberException";constructor(t){super(`Fiber #${t.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`),this.fiber=t,this.name=this._tag,this.stack=this.message}}const fy=Symbol.for("effect/Runtime/FiberFailure"),by=Symbol.for("effect/Runtime/FiberFailure/Cause");class dy extends Error{[fy];[by];constructor(t){const e=Fa(t)[0];super(e?.message||"An error has occurred"),this[fy]=fy,this[by]=t,this.name=e?`(FiberFailure) ${e.name}`:"FiberFailure",e?.stack&&(this.stack=e.stack)}toJSON(){return{_id:"FiberFailure",cause:this[by].toJSON()}}toString(){return"(FiberFailure) "+wa(this[by],{renderErrorCause:!0})}[H](){return this.toString()}}const py=t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new dy(t);return Error.stackTraceLimit=e,r},my=t=>{const e=t;switch(e._op){case"Failure":case"Success":return e;case"Left":return Yh(e.left);case"Right":return tl(e.right);case"Some":return tl(e.value);case"None":return Yh(new Ph)}},Sy=ay(((t,e)=>{const r=my(e);if(r)return r;const n=new Sp,s=uy(t)(e,{scheduler:n});n.flush();return s.unsafePoll()||zh(Xa((t=>{const e=Error.stackTraceLimit;Error.stackTraceLimit=0;const r=new ly(t);return Error.stackTraceLimit=e,r})(s),El(s)))})),gy=ay(((t,e,r)=>yy(t,e,r).then((t=>{switch(t._tag){case ut:return t.effect_instruction_i0;case it:throw py(t.effect_instruction_i0)}})))),yy=ay(((t,e,r)=>new Promise((n=>{const s=my(e);s&&n(s);const i=uy(t)(e);i.addObserver((t=>{n(t)})),void 0!==r?.signal&&(r.signal.aborted?i.unsafeInterruptAsFork(i.id()):r.signal.addEventListener("abort",(()=>{i.unsafeInterruptAsFork(i.id())}),{once:!0}))}))));class wy{context;runtimeFlags;fiberRefs;constructor(t,e,r){this.context=t,this.runtimeFlags=e,this.fiberRefs=r}pipe(){return rt(this,arguments)}}const _y=t=>new wy(t.context,t.runtimeFlags,t.fiberRefs),vy=ac(1,32,4),Oy=_y({context:Ir(),runtimeFlags:vy,fiberRefs:eb()}),My=uy(Oy),Ey=gy(Oy),Iy=hy(Oy),ky=t(2,((t,e)=>t.modifyEffect(e))),Fy=Symbol.for("effect/Layer"),Ny={[Fy]:{_RIn:t=>t,_E:t=>t,_ROut:t=>t},pipe(){return rt(this,arguments)}},Cy=Symbol.for("effect/Layer/MemoMap"),jy=Rr()("effect/Layer/CurrentMemoMap",{defaultValue:()=>xy()});class Ay{ref;[Cy];constructor(t){this.ref=t,this[Cy]=Cy}getOrElseMemoize(t,e){return c(ky(this.ref,(r=>{const n=r.get(t);if(void 0!==n){const[t,s]=n,i=c(t,hu((([t,e])=>c((t=>{return e=(e,r)=>c(t,Fb(e,r)),Ua((t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),Tu)));var e})(t),Ga(e)))),Eu(Zh({onFailure:()=>Tu,onSuccess:()=>Ch(e,s)})));return Nu([i,r])}return c(mb(0),hu((n=>c(cl(),hu((s=>c(mb((()=>Tu)),vu((i=>{const o=$u((o=>c(lg(),hu((a=>c(o(hu(Ly(t,a,!0),(t=>{return e=t(this),Hb(e,Lb,Ib);var e}))),nu,hu((o=>{switch(o._tag){case it:return c(fl(s,o.effect_instruction_i0),Wu(jh(a,o)),Wu(ou(o.effect_instruction_i0)));case ut:return c(gb(i,(t=>c(jh(a,t),Lu(yb(n,(t=>[1===t,t-1]))),Wa))),Wu(wb(n,(t=>t+1))),Wu(Ch(e,(e=>c(ju((()=>r.delete(t))),Wu(Sb(i)),hu((t=>t(e))))))),Wu(ml(s,o.effect_instruction_i0)),Ga(o.effect_instruction_i0[1]))}})))))))),a=[c(ul(s),Eu(Xh({onFailure:()=>Tu,onSuccess:()=>wb(n,(t=>t+1))}))),t=>c(Sb(i),hu((e=>e(t))))];return[o,(u=t,"Fresh"===u._op_layer?r:r.set(t,a))];var u})))))))))})),fu)}}const Ry=Cu((()=>{return vu((t=new Map,ju((()=>oy(t)))),(t=>new Ay(t)));var t})),xy=()=>new Ay(oy(new Map)),$y=t(2,((t,e)=>hu(Ry,(r=>Ty(t,r,e))))),Ty=t(3,((t,e,r)=>hu(Ly(t,r),(t=>Jb(t(e),jy,e))))),Ly=(t,e,r=!1)=>{const n=t;switch(n._op_layer){case"Locally":return ju((()=>t=>n.f(t.getOrElseMemoize(n.self,e))));case"ExtendScope":return ju((()=>t=>{return e=e=>t.getOrElseMemoize(n.layer,e),hu(cg,e);var e}));case"Fold":return ju((()=>t=>c(t.getOrElseMemoize(n.layer,e),du({onFailure:r=>t.getOrElseMemoize(n.failureK(r),e),onSuccess:r=>t.getOrElseMemoize(n.successK(r),e)}))));case"Fresh":return ju((()=>()=>c(n.layer,$y(e))));case"FromEffect":return ju(r?()=>()=>n.effect:()=>r=>r.getOrElseMemoize(t,e));case"Provide":return ju((()=>t=>c(t.getOrElseMemoize(n.first,e),hu((r=>c(t.getOrElseMemoize(n.second,e),vl(r)))))));case"Scoped":return ju(r?()=>()=>fg(n.effect,e):()=>r=>r.getOrElseMemoize(t,e));case"Suspend":return ju((()=>t=>t.getOrElseMemoize(n.evaluate(),e)));case"ProvideMerge":return ju((()=>t=>c(t.getOrElseMemoize(n.first,e),Vu(t.getOrElseMemoize(n.second,e),n.zipK))));case"ZipWith":return Bu((function*(){const t=yield*Ah(e,td),r=yield*Ah(t,Xb),s=yield*Ah(t,Xb);return t=>c(t.getOrElseMemoize(n.first,r),og(t.getOrElseMemoize(n.second,s),n.zipK,{concurrent:!0}))}));case"MergeAll":{const t=n.layers;return vu(Ah(e,td),(e=>r=>{const n=new Array(t.length);return vu(WS(t,qu((function*(t,s){const i=yield*Ah(e,Xb),o=yield*r.getOrElseMemoize(t,i);n[s]=o})),!1,!1),(()=>((...t)=>{const e=new Map;for(let r=0;r<t.length;r++)t[r].unsafeMap.forEach(((t,r)=>{e.set(r,t)}));return br(e)})(...n)))}))}}},Dy=t(2,((t,e)=>eg((r=>hu($y(e,r),(e=>Ol(t,e))))))),Py=t(2,((t,e)=>{const r=sd(Oy.fiberRefs,e.fiberRefs),n=fc(Oy.runtimeFlags,e.runtimeFlags);return $u((s=>Ua((i=>{const o=i.getFiberRef(bh),c=i.getFiberRefs(),a=id(i.id(),c)(r),u=i.currentRuntimeFlags,h=bc(n)(u),l=sd(a,c),f=fc(h,u);return i.setFiberRefs(a),i.currentRuntimeFlags=h,wg(Ol(s(t),Ar(o,e.context)),Ua((t=>(t.setFiberRefs(id(t.id(),t.getFiberRefs())(l)),t.currentRuntimeFlags=bc(f)(t.currentRuntimeFlags),Tu))))}))))})),By=t(2,((t,e)=>Array.isArray(e)?Dy(t,((...t)=>{const e=Object.create(Ny);return e._op_layer="MergeAll",e.layers=t,e})(...e)):m(e,Fy)?Dy(t,e):Er(e)?Ol(t,e):cy in e?hu(e.runtimeEffect,(e=>Py(t,e))):Py(t,e))),qy=Symbol.for("effect/Schedule"),Uy=Symbol.for("effect/ScheduleDriver"),Jy={start:0,now:0,input:void 0,output:void 0,elapsed:Cn,elapsedSincePrevious:Cn,recurrence:0},Gy=Rr()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>Jy}),Wy={_Out:t=>t,_In:t=>t,_R:t=>t},Vy={_Out:t=>t,_In:t=>t,_R:t=>t};class Hy{initial;step;[qy]=Wy;constructor(t,e){this.initial=t,this.step=e}pipe(){return rt(this,arguments)}}const zy=(t,e,r,n)=>wb(t,(t=>0===t.recurrence?{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:Cn,elapsedSincePrevious:Cn,start:e}:{now:e,input:r,output:n,recurrence:t.recurrence+1,elapsed:xn(e-t.start),elapsedSincePrevious:xn(e-t.now),start:t.start}));class Yy{schedule;ref;[Uy]=Vy;constructor(t,e){this.schedule=t,this.ref=e}get state(){return vu(Sb(this.ref),(t=>t[1]))}get last(){return hu(Sb(this.ref),(([t,e])=>{switch(t._tag){case"None":return iu((()=>new Ph));case"Some":return Nu(t.value)}}))}iterationMeta=pb(Jy);get reset(){return gb(this.ref,[se(),this.schedule.initial]).pipe(Gu(gb(this.iterationMeta,Jy)))}next(t){return c(vu(Sb(this.ref),(t=>t[1])),hu((e=>c(Bf,hu((r=>c(Cu((()=>this.schedule.step(r,t,e))),hu((([e,n,s])=>{const i=gb(this.ref,[ie(n),e]);if(Vg(s))return i.pipe(Wu(su(se())));const o=Pg(s.intervals)-r;if(o<=0)return i.pipe(Wu(zy(this.iterationMeta,r,t,n)),Ga(n));const a=xn(o);return c(i,Wu(zy(this.iterationMeta,r,t,n)),Wu(Wb(a)),Ga(n))})))))))))}}const Ky=(t,e)=>new Hy(t,e),Qy=t(2,((t,e)=>Zy(t,((t,r)=>ju((()=>e(t,r))))))),Zy=t(2,((t,e)=>Ky(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,s])=>Vg(s)?Nu([t,r,Gg]):vu(e(n,r),(e=>e?[t,r,s]:[t,r,Gg])))))))),Xy=t(2,((t,e)=>tw(t,e,Dg))),tw=t(3,((t,e,r)=>Ky([t.initial,e.initial],((n,s,i)=>c(Vu(t.step(n,s,i[0]),e.step(n,s,i[1]),((t,e)=>[t,e])),hu((([[n,i,o],[c,a,u]])=>Wg(o)&&Wg(u)?ew(t,e,s,n,i,o.intervals,c,a,u.intervals,r):Nu([[n,c],[i,a],Gg])))))))),ew=(t,e,r,n,s,i,o,a,u,h)=>{const l=h(i,u);return(t=>cn(t.intervals))(l)?Nu([[n,o],[s,a],(f=l,{_tag:Ug,intervals:f})]):c(i,qg(u))?hu(t.step(Bg(i),r,n),(([n,s,i])=>Vg(i)?Nu([[n,o],[s,a],Gg]):ew(t,e,r,n,s,i.intervals,o,a,u,h))):hu(e.step(Bg(u),r,o),(([o,c,a])=>Vg(a)?Nu([[n,o],[s,c],Gg]):ew(t,e,r,n,s,i,o,c,a.intervals,h)));var f},rw=t(2,((t,e)=>nw(t,(t=>ju((()=>e(t))))))),nw=t(2,((t,e)=>Ky(t.initial,((r,n,s)=>hu(t.step(r,n,s),(([t,r,n])=>vu(e(r),(e=>[t,e,n])))))))),sw=(t,e)=>Ky(t,((t,r,n)=>ju((()=>{return[e(n),n,(s=t,r=Mg(s,Number.POSITIVE_INFINITY),{_tag:Ug,intervals:Lg(Jr(r))})];var r,s})))),iw=t(2,((t,e)=>Zy(t,(t=>(t=>vu(t,(t=>!t)))(e(t)))))),ow=t(2,((t,e)=>Zy(t,(t=>e(t))))),cw=t(2,((t,e)=>Qy(t,((t,r)=>e(r))))),aw=Symbol.for("effect/Schedule/ScheduleDefect");class uw{error;[aw];constructor(t){this.error=t,this[aw]=aw}}const hw=t=>Qa(t,(t=>tu(new uw(t)))),lw=t(2,((t,e)=>bw(t,e,(t=>su(t))))),fw=t(2,((t,e)=>{if(m(e,qy))return lw(t,e);const r=e.schedule??(t=>Ky(t.initial,((e,r,n)=>c(t.step(e,r,n),vu((([t,e,n])=>[t,r,n]))))))(pw),n=e.while?ow(r,(t=>{const r=e.while(t);return"boolean"==typeof r?Nu(r):hw(r)})):r,s=e.until?iw(n,(t=>{const r=e.until(t);return"boolean"==typeof r?Nu(r):hw(r)})):n,i=e.times?Xy(s,(o=e.times,cw(pw,(t=>t<o)))).pipe(rw((t=>t[0]))):s;var o,a;return a=lw(t,i),Ka(a,(t=>ou((t=>ae(fa(t,(t=>Zc(t)&&m(t.defect,aw)?ie(t.defect):se())),{onNone:()=>t,onSome:t=>Vc(t.error)}))(t))))})),bw=t(3,((t,e,r)=>hu((t=>c(mb([se(),t.initial]),vu((e=>new Yy(t,e)))))(e),(e=>pu(t,{onFailure:t=>r(t,se()),onSuccess:n=>dw(Gb(t,Gy,Sb(e.iterationMeta)),e,((t,n)=>Gb(r(t,n),Gy,Sb(e.iterationMeta))),n)}))))),dw=(t,r,n,s)=>pu(r.next(s),{onFailure:()=>(t=>Fu(t,e))(r.last),onSuccess:e=>pu(t,{onFailure:t=>n(t,ie(e)),onSuccess:e=>dw(t,r,n,e)})}),pw=sw(0,(t=>t+1)),mw=qa,Sw=US,gw=JS,yw=Ya,ww=Ua,_w=su,vw=ou,Ow=eu,Mw=Bu,Ew=t=>Ya(t.length>=1?(e,r)=>{try{t(r).then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}:e=>{try{t().then((t=>e(Nu(t))),(t=>e(tu(t))))}catch(t){e(tu(t))}}),Iw=Nu,kw=Cu,Fw=ju,Nw=Tu,Cw=Qa,jw=Ka,Aw=xb,Rw=t=>Tb(t,{onFailure:o,onSuccess:o}),xw=t=>{let e,r;return"function"==typeof t?e=t:(e=t.try,r=t.catch),Cu((()=>{try{return Nu(N(e))}catch(t){return su(r?N((()=>r(t))):new qh(t,"An unknown error occurred in Effect.try"))}}))},$w=t=>{let e,r;"function"==typeof t?e=t:(e=t.try,r=t.catch);const n=t=>r?iu((()=>r(t))):su(new qh(t,"An unknown error occurred in Effect.tryPromise"));return Ya(e.length>=1?(t,r)=>{try{e(r).then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}}:t=>{try{e().then((e=>t(Nu(e))),(e=>t(n(e))))}catch(e){t(n(e))}})},Tw=gu,Lw=wu,Dw=xu,Pw=$u,Bw=Ga,qw=Wa,Uw=vu,Jw=Mu,Gw=Ja,Ww=wg,Vw=ag,Hw=eg,zw=uu,Yw=HS,Kw=ey,Qw=By,Zw=nu,Xw=_u,t_=Kb,e_=hu,r_=fu,n_=Sg,s_=ry,i_=mg,o_=Au,c_=zb,a_=Yb,u_=t=>{const e=hu(hu(t,(()=>Uu())),(()=>e));return e},h_=fw,l_=Tb,f_=bu,b_=du,d_=Pb,p_=Bb,m_=Ub,S_=()=>Ua(((t,e)=>Nu(new wy(t.getFiberRef(bh),e.runtimeFlags,t.getFiberRefs())))),g_=t=>ju((()=>ty(t))),y_=My,w_=Ey,__=Iy,v_=ng,O_=sg,M_=ig,E_=og;export{Mw as $,ce as A,ie as B,be as C,xl as D,co as E,hu as F,Tl as G,Cl as H,$b as I,fi as J,di as K,li as L,j as M,c as N,q as O,x as P,A as Q,U as R,m as S,J as T,Wa as U,Kb as V,Bn as W,Iu as X,Wu as Y,nu as Z,vl as _,__ as a,Yw as a$,$w as a0,xw as a1,d_ as a2,jn as a3,Rh as a4,m_ as a5,mb as a6,yb as a7,Sb as a8,wb as a9,WS as aA,ul as aB,ve as aC,He as aD,Ue as aE,on as aF,ol as aG,Gr as aH,Sl as aI,Xr as aJ,sn as aK,rn as aL,Zr as aM,dl as aN,qr as aO,Tu as aP,mw as aQ,Kt as aR,Nw as aS,Rw as aT,E_ as aU,Zw as aV,Fw as aW,Qw as aX,b_ as aY,M_ as aZ,e_ as a_,Xc as aa,Vc as ab,na as ac,sa as ad,ca as ae,Hc as af,zc as ag,Zc as ah,ra as ai,ta as aj,Lp as ak,Hu as al,$p as am,Tp as an,zu as ao,t as ap,cl as aq,hb as ar,rt as as,Qa as at,gu as au,bi as av,xu as aw,Ua as ax,Lu as ay,ml as az,Vt as b,ll as b$,Lw as b0,kw as b1,Ww as b2,Dw as b3,Uw as b4,v_ as b5,gw as b6,he as b7,Ow as b8,jw as b9,S_ as bA,o_ as bB,zg as bC,g_ as bD,t_ as bE,n_ as bF,Bw as bG,h_ as bH,qw as bI,s_ as bJ,u_ as bK,Jr as bL,_w as bM,Jw as bN,pn as bO,ln as bP,l_ as bQ,bn as bR,an as bS,nn as bT,Aw as bU,Yr as bV,y_ as bW,Ew as bX,yw as bY,fl as bZ,bl as b_,Pw as ba,Sw as bb,Qg as bc,ed as bd,Gw as be,Kw as bf,ni as bg,Ai as bh,Xw as bi,O_ as bj,a_ as bk,Hg as bl,vw as bm,r_ as bn,zw as bo,Tw as bp,f_ as bq,Hw as br,Qr as bs,o as bt,Vw as bu,ww as bv,Zg as bw,Kg as bx,Yg as by,i_ as bz,Cw as c,pl as c0,Jh as c1,Gh as c2,Zh as c3,Kh as c4,tl as c5,Yh as c6,nl as c7,Hh as c8,el as c9,zh as ca,Qh as cb,rl as cc,H as cd,z as ce,Y as cf,Hr as cg,Ht as d,Yt as e,ue as f,Zt as g,Mn as h,e as i,vu as j,US as k,p_ as l,ae as m,wl as n,au as o,Qt as p,ju as q,w_ as r,Iw as s,c_ as t,Ll as u,Cu as v,jl as w,Nu as x,se as y,Rl as z}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as t}from"./p-smGPjoDX.js";import{a6 as s,a7 as e,a8 as i,a9 as n,aa as r,ab as o,ac as a,ad as c,ae as h,af as u,ag as l,ah as d,ai as f,aj as b,ak as v,al as m,am as p,an as y,ao as S,N as w,F as g,q as _,ap as F,j as E,L as C,aq as O,ar as D,as as k,v as x,at as j,au as R,av as P,y as A,B as I,aw as L,ax as z,K as B,U as N,ay as U,az as q,Y as Q,aA as W,aB as T,x as V,aC as M,aD as H,aE as K,aF as G,aG as X,X as Y,aH as Z,aI as J,aJ as $,aK as tt,aL as st,aM as et,aN as it,aO as nt,aP as rt,o as ot,S as at,aQ as ct,i as ht,aR as ut,aS as lt,aT as dt,aU as ft,aV as bt,aW as vt,aX as mt,aY as pt,aZ as yt,a_ as St,a$ as wt,b0 as gt,b1 as _t,b2 as Ft,b3 as Et,b4 as Ct,b5 as Ot,b6 as Dt,s as kt,A as xt,b7 as jt,b8 as Rt,b9 as Pt,ba as At,bb as It,bc as Lt,bd as zt,be as Bt,bf as Nt,bg as Ut,bh as qt,bi as Qt,bj as Wt,bk as Tt,bl as Vt,bm as Mt,bn as Ht,bo as Kt,bp as Gt,d as Xt,b as Yt,bq as Zt,br as Jt,bs as $t,bt as ts,bu as ss,$ as es,bv as is,bw as ns,bx as rs,by as os,bz as as,bA as cs,bB as hs,bC as us,bD as ls,bE as ds,bF as fs,bG as bs,m as vs,bH as ms,bI as ps,T as ys,bJ as Ss,bK as ws,bL as gs,bM as _s,bN as Fs,bO as Es,bP as Cs,bQ as Os,bR as Ds,bS as ks,bT as xs,c as js,bU as Rs,bV as Ps,bW as As,bX as Is,bY as Ls}from"./p-BhQLGXPs.js";import{a as zs,l as Bs,p as Ns,E as Us,o as qs,b as Qs,c as Ws,e as Ts,f as Vs,g as Ms,h as Hs,z as Ks,s as Gs,j as Xs,m as Ys,k as Zs,v as Js,n as $s,q as te,r as se,t as ee,w as ie,_ as ne,x as re,y as oe,A as ae,B as ce}from"./p-D7I-Bc5i.js";const he=s,ue=i,le=e,de=n,fe=o,be=u,ve=l,me=d,pe=r,ye=b,Se=f,we=a,ge=c,_e=h,Fe=p,Ee=y,Ce=m,Oe=S,De=v,ke=Symbol.for("effect/QueueEnqueue"),xe=Symbol.for("effect/QueueDequeue"),je=Symbol.for("effect/QueueStrategy"),Re=Symbol.for("effect/BackingQueue"),Pe={_A:t=>t},Ae={_A:t=>t},Ie={_In:t=>t},Le={_Out:t=>t};class ze extends D{queue;takers;shutdownHook;shutdownFlag;strategy;[ke]=Ie;[xe]=Le;constructor(t,s,e,i,n){super(),this.queue=t,this.takers=s,this.shutdownHook=e,this.shutdownFlag=i,this.strategy=n}pipe(){return k(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return x((()=>j(this.unsafeSize(),(()=>R))))}unsafeSize(){return P(this.shutdownFlag)?A():I(this.queue.length()-Bs(this.takers)+this.strategy.surplusSize())}get isEmpty(){return E(this.size,(t=>t<=0))}get isFull(){return E(this.size,(t=>t>=this.capacity()))}get shutdown(){return L(z((t=>(w(this.shutdownFlag,B(!0)),w(W(Xe(this.takers),(s=>it(s,t.id())),!1,!1),Q(this.strategy.shutdown),U(q(this.shutdownHook,void 0)),N)))))}get isShutdown(){return _((()=>P(this.shutdownFlag)))}get awaitShutdown(){return T(this.shutdownHook)}isActive(){return!P(this.shutdownFlag)}unsafeOffer(t){if(P(this.shutdownFlag))return!1;let s;if(0===this.queue.length()){const e=w(this.takers,Ns(Us));e!==Us?(Ke(e,t),s=!0):s=!1}else s=!1;if(s)return!0;const e=this.queue.offer(t);return Je(this.strategy,this.queue,this.takers),e}offer(t){return x((()=>{if(P(this.shutdownFlag))return R;let s;if(0===this.queue.length()){const e=w(this.takers,Ns(Us));e!==Us?(Ke(e,t),s=!0):s=!1}else s=!1;if(s)return V(!0);const e=this.queue.offer(t);return Je(this.strategy,this.queue,this.takers),e?V(!0):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)}))}offerAll(t){return x((()=>{if(P(this.shutdownFlag))return R;const s=M(t),e=0===this.queue.length()?M(Ye(this.takers,s.length)):H,[i,n]=w(s,K(e.length));for(let t=0;t<e.length;t++)Ke(e[t],i[t]);if(0===n.length)return V(!0);const r=this.queue.offerAll(n);return Je(this.strategy,this.queue,this.takers),G(r)?V(!0):this.strategy.handleSurplus(r,this.queue,this.takers,this.shutdownFlag)}))}get take(){return z((t=>{if(P(this.shutdownFlag))return R;const s=this.queue.poll(Us);if(s!==Us)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),V(s);{const s=X(t.id());return w(x((()=>(w(this.takers,qs(s)),Je(this.strategy,this.queue,this.takers),P(this.shutdownFlag)?R:T(s)))),Y((()=>_((()=>Ze(this.takers,s))))))}}))}get takeAll(){return x((()=>P(this.shutdownFlag)?R:_((()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Z(t)}))))}takeUpTo(t){return x((()=>P(this.shutdownFlag)?R:_((()=>{const s=this.queue.pollUpTo(t);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),Z(s)}))))}takeBetween(t,s){return x((()=>Be(this,t,s,nt())))}}const Be=(t,s,e,i)=>e<s?V(i):w(Te(t,e),g((n=>{const r=s-n.length;return 1===r?w(We(t),E((t=>w(i,st(n),et(t))))):r>1?w(We(t),g((s=>Be(t,r-1,e-n.length-1,w(i,st(n),et(s)))))):V(w(i,st(n)))}))),Ne=(t,s)=>w(O(),E((e=>((t,s,e,i,n)=>new ze(t,s,e,i,n))(t,zs(),e,C(!1),s))));class Ue{mutable;[Re]=Ae;constructor(t){this.mutable=t}poll(t){return Ns(this.mutable,t)}pollUpTo(t){return Qs(this.mutable,t)}offerAll(t){return Ts(this.mutable,t)}offer(t){return qs(this.mutable,t)}capacity(){return Ms(this.mutable)}length(){return Bs(this.mutable)}}const qe=t=>new Ue(t),Qe=F(2,((t,s)=>t.offer(s))),We=t=>t.take,Te=F(2,((t,s)=>t.takeUpTo(s))),Ve=F(3,((t,s,e)=>t.takeBetween(s,e)));class Me{[je]=Pe;putters=zs();surplusSize(){return Bs(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!Ws(this.putters)&&!Ws(t);){const s=Ns(t,void 0),e=Ns(this.putters,void 0);e[2]&&Ke(e[1],!0),Ke(s,e[0])}}get shutdown(){return w(ot,g((t=>w(_((()=>Xe(this.putters))),g((s=>W(s,(([s,e,i])=>i?w(it(e,t),N):rt),!1,!1)))))))}handleSurplus(t,s,e,i){return z((n=>{const r=X(n.id());return w(x((()=>(this.unsafeOffer(t,r),this.unsafeOnQueueEmptySpace(s,e),Je(this,s,e),P(i)?R:T(r)))),Y((()=>_((()=>this.unsafeRemove(r))))))}))}unsafeOnQueueEmptySpace(t,s){let e=!0;for(;e&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const i=w(this.putters,Ns(Us));if(i===Us)e=!1;else{const e=t.offer(i[0]);e&&i[2]?Ke(i[1],!0):e||Ge(this.putters,w(Xe(this.putters),$(i))),Je(this,t,s)}}}unsafeOffer(t,s){const e=M(t);for(let t=0;t<e.length;t++){const i=e[t];w(this.putters,qs(t===e.length-1?[i,s,!0]:[i,s,!1]))}}unsafeRemove(t){Ge(this.putters,w(Xe(this.putters),tt((([,s])=>s!==t))))}}class He{[je]=Pe;surplusSize(){return 0}get shutdown(){return rt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,s,e,i){return V(!1)}unsafeOnQueueEmptySpace(t,s){}}const Ke=(t,s)=>J(t,V(s)),Ge=(t,s)=>w(t,Ts(s)),Xe=t=>w(t,Qs(Number.POSITIVE_INFINITY)),Ye=(t,s)=>w(t,Qs(s)),Ze=(t,s)=>{Ge(t,w(Xe(t),tt((t=>s!==t))))},Je=(t,s,e)=>{let i=!0;for(;i&&0!==s.length();){const n=w(e,Ns(Us));if(n!==Us){const r=s.poll(Us);r!==Us?(Ke(n,r),t.unsafeOnQueueEmptySpace(s,e)):Ge(e,w(Xe(e),$(n))),i=!0}else i=!1}i&&0===s.length()&&!Ws(e)&&t.onCompleteTakersWithEmptyQueue(e)},$e=t=>w(_((()=>Vs(t))),g((t=>Ne(qe(t),new Me)))),ti=()=>w(_((()=>zs())),g((t=>Ne(qe(t),new He)))),si=t=>t.shutdown,ei=Qe,ii=We,ni=Ve,ri="Continue",oi=Symbol.for("effect/ChannelChildExecutorDecision"),ai={[oi]:oi},ci=()=>{const t=Object.create(ai);return t._tag=ri,t},hi="ContinuationK",ui=Symbol.for("effect/ChannelContinuation"),li={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutDone:t=>t,_OutErr2:t=>t,_OutElem:t=>t,_OutDone2:t=>t};class di{onSuccess;onHalt;_tag=hi;[ui]=li;constructor(t,s){this.onSuccess=t,this.onHalt=s}onExit(t){return Hs(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class fi{finalizer;_tag="ContinuationFinalizer";[ui]=li;constructor(t){this.finalizer=t}}const bi="PullAfterNext",vi=Symbol.for("effect/ChannelUpstreamPullStrategy"),mi={[vi]:{_A:t=>t}},pi=t=>{const s=Object.create(mi);return s._tag=bi,s.emitSeparator=t,s},yi="BracketOut",Si="Bridge",wi="ConcatAll",gi="Emit",_i="Ensuring",Fi="Fail",Ei="Fold",Ci="FromEffect",Oi="PipeTo",Di="Read",ki="Succeed",xi="SucceedNow",ji="Suspend",Ri=Symbol.for("effect/Channel"),Pi={[Ri]:{_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t},pipe(){return k(this,arguments)}},Ai=t=>at(t,Ri)||ct(t),Ii=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=yi,e.acquire=()=>t,e.finalizer=s,e})),Li=(t,s,e)=>{const i=Object.create(Pi);return i._tag=wi,i.combineInners=s,i.combineAll=e,i.onPull=()=>pi(A()),i.onEmit=()=>ci,i.value=()=>t,i.k=ht,i},zi=F(4,((t,s,e,i)=>{const n=Object.create(Pi);return n._tag=wi,n.combineInners=e,n.combineAll=i,n.onPull=()=>pi(A()),n.onEmit=()=>ci,n.value=()=>t,n.k=s,n})),Bi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Si,e.input=s,e.channel=t,e})),Ni=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=_i,e.channel=t,e.finalizer=s,e})),Ui=t=>qi(fe(t)),qi=t=>Qi((()=>t)),Qi=t=>{const s=Object.create(Pi);return s._tag=Fi,s.error=t,s},Wi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Ei,e.channel=t,e.k=new di(s,qi),e})),Ti=t=>{const s=Object.create(Pi);return s._tag=Ci,s.effect=()=>t,s},Vi=F(2,((t,s)=>{const e=Object.create(Pi);return e._tag=Oi,e.left=()=>t,e.right=()=>s,e})),Mi=t=>Hi({onInput:t.onInput,onFailure:s=>ut(we(s),{onLeft:t.onFailure,onRight:qi}),onDone:t.onDone}),Hi=t=>{const s=Object.create(Pi);return s._tag=Di,s.more=t.onInput,s.done=new di(t.onDone,t.onFailure),s},Ki=t=>Yi((()=>t)),Gi=t=>{const s=Object.create(Pi);return s._tag=xi,s.terminal=t,s},Xi=t=>{const s=Object.create(Pi);return s._tag=ji,s.channel=t,s},Yi=t=>{const s=Object.create(Pi);return s._tag=ki,s.evaluate=t,s},Zi=Gi(void 0),Ji=t=>{const s=Object.create(Pi);return s._tag=gi,s.out=t,s},$i="Done",tn="Emit",sn="FromEffect",en="Read",nn=Symbol.for("effect/ChannelState"),rn={[nn]:{_E:t=>t,_R:t=>t}},on=()=>{const t=Object.create(rn);return t._tag=$i,t},an=()=>{const t=Object.create(rn);return t._tag=tn,t},cn=t=>{const s=Object.create(rn);return s._tag=sn,s.effect=t,s},hn=(t,s,e,i)=>{const n=Object.create(rn);return n._tag=en,n.upstream=t,n.onEffect=s,n.onEmit=e,n.onDone=i,n},un=t=>t._tag===sn,ln=t=>un(t)?dt(t.effect):void 0,dn="PullFromChild",fn="PullFromUpstream",bn="DrainChildExecutors",vn="Emit";class mn{childExecutor;parentSubexecutor;onEmit;_tag=dn;constructor(t,s,e){this.childExecutor=t,this.parentSubexecutor=s,this.onEmit=e}close(t){const s=this.childExecutor.close(t),e=this.parentSubexecutor.close(t);return void 0!==s&&void 0!==e?ft(bt(s),bt(e),((t,s)=>w(t,Ks(s)))):void 0!==s?s:void 0!==e?e:void 0}enqueuePullFromChild(t){return this}}class pn{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=fn;constructor(t,s,e,i,n,r,o,a){this.upstreamExecutor=t,this.createChild=s,this.lastDone=e,this.activeChildExecutors=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o,this.onEmit=a}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?ft(t,bt(s),((t,s)=>Ks(t,s))):void 0!==t?t:void 0!==s?bt(s):void 0),void 0)}enqueuePullFromChild(t){return new pn(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class yn{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=bn;constructor(t,s,e,i,n,r,o){this.upstreamExecutor=t,this.lastDone=s,this.activeChildExecutors=e,this.upstreamDone=i,this.combineChildResults=n,this.combineWithChildResult=r,this.onPull=o}close(t){const s=this.upstreamExecutor.close(t);return[...this.activeChildExecutors.map((s=>void 0!==s?s.childExecutor.close(t):void 0)),s].reduce(((t,s)=>void 0!==t&&void 0!==s?ft(t,bt(s),((t,s)=>Ks(t,s))):void 0!==t?t:void 0!==s?bt(s):void 0),void 0)}enqueuePullFromChild(t){return new yn(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class Sn{value;next;_tag=vn;constructor(t,s){this.value=t,this.next=s}close(t){return this.next.close(t)}enqueuePullFromChild(t){return this}}const wn=Symbol.for("effect/ChannelUpstreamPullRequest"),gn={[wn]:{_A:t=>t}},_n=t=>{const s=Object.create(gn);return s._tag="Pulled",s.value=t,s};class Fn{_activeSubexecutor=void 0;_cancelled=void 0;_closeLastSubstream=void 0;_currentChannel;_done=void 0;_doneStack=[];_emitted=void 0;_executeCloseLastSubstream;_input=void 0;_inProgressFinalizer=void 0;_providedEnv;constructor(t,s,e){this._currentChannel=t,this._executeCloseLastSubstream=e,this._providedEnv=s}run(){let t;for(;void 0===t;)if(void 0!==this._cancelled)t=this.processCancellation();else if(void 0!==this._activeSubexecutor)t=this.runSubexecutor();else try{if(void 0===this._currentChannel)t=on();else switch(ct(this._currentChannel)&&(this._currentChannel=Ti(this._currentChannel)),this._currentChannel._tag){case yi:t=this.runBracketOut(this._currentChannel);break;case Si:{const s=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,void 0!==this._input){const e=this._input;this._input=void 0;const i=()=>St(s.awaitRead(),(()=>_t((()=>{const t=e.run();switch(t._tag){case $i:return Ys(e.getDone(),{onFailure:t=>s.error(t),onSuccess:t=>s.done(t)});case tn:return St(s.emit(e.getEmit()),(()=>i()));case sn:return pt(t.effect,{onFailure:t=>s.error(t),onSuccess:()=>i()});case en:return On(t,(()=>i()),(t=>s.error(t)))}}))));t=cn(St(wt(gt(i())),(t=>vt((()=>this.addFinalizer((s=>St(Ce(t),(()=>_t((()=>{const t=this.restorePipe(s,e);return void 0!==t?t:lt})))))))))))}break}case wi:{const t=new Fn(this._currentChannel.value(),this._providedEnv,(t=>vt((()=>{this._closeLastSubstream=w(void 0===this._closeLastSubstream?lt:this._closeLastSubstream,yt(t))}))));t._input=this._input;const s=this._currentChannel;this._activeSubexecutor=new pn(t,(t=>s.k(t)),void 0,[],((t,e)=>s.combineInners(t,e)),((t,e)=>s.combineAll(t,e)),(t=>s.onPull(t)),(t=>s.onEmit(t))),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case gi:this._emitted=this._currentChannel.out,this._currentChannel=void 0!==this._activeSubexecutor?void 0:Zi,t=an();break;case _i:this.runEnsuring(this._currentChannel);break;case Fi:t=this.doneHalt(this._currentChannel.error());break;case Ei:this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break;case Ci:{const s=void 0===this._providedEnv?this._currentChannel.effect():w(this._currentChannel.effect(),mt(this._providedEnv));t=cn(pt(s,{onFailure:t=>{const s=this.doneHalt(t);return void 0!==s&&un(s)?s.effect:lt},onSuccess:t=>{const s=this.doneSucceed(t);return void 0!==s&&un(s)?s.effect:lt}}));break}case Oi:{const t=this._input,s=new Fn(this._currentChannel.left(),this._providedEnv,(t=>this._executeCloseLastSubstream(t)));s._input=t,this._input=s,this.addFinalizer((s=>{const e=this.restorePipe(s,t);return void 0!==e?e:lt})),this._currentChannel=this._currentChannel.right();break}case"Provide":{const t=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer((()=>vt((()=>{this._providedEnv=t}))));break}case Di:{const s=this._currentChannel;t=hn(this._input,ht,(t=>{try{this._currentChannel=s.more(t)}catch(t){this._currentChannel=s.done.onExit($s(t))}}),(t=>{this._currentChannel=(t=>s.done.onExit(t))(t)}));break}case ki:t=this.doneSucceed(this._currentChannel.evaluate());break;case xi:t=this.doneSucceed(this._currentChannel.terminal);break;case ji:this._currentChannel=this._currentChannel.channel()}}catch(t){this._currentChannel=qi(be(t))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const s=[];let e=this._doneStack.pop();for(;e;)"ContinuationFinalizer"===e._tag&&s.push(e.finalizer),e=this._doneStack.pop();const i=0===s.length?lt:Cn(s,t);return this.storeInProgressFinalizer(i),i}popNextFinalizers(){const t=[];for(;0!==this._doneStack.length;){const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi)return t;t.push(s),this._doneStack.pop()}return t}restorePipe(t,s){const e=this._input;return this._input=s,void 0!==e?e.close(t):lt}close(t){let s;const e=this._inProgressFinalizer;let i;void 0!==e&&(s=w(e,Ft(vt((()=>this.clearInProgressFinalizer())))));const n=this.popAllFinalizers(t);void 0!==n&&(i=w(n,Ft(vt((()=>this.clearInProgressFinalizer())))));const r=void 0===this._activeSubexecutor?void 0:this._activeSubexecutor.close(t);if(void 0!==r||void 0!==s||void 0!==i)return w(bt(En(r)),Ot(bt(En(s))),Ot(bt(En(i))),Ct((([[t,s],e])=>w(t,Ks(s),Ks(e)))),Et,St((t=>_t((()=>t)))))}doneSucceed(t){if(0===this._doneStack.length)return this._done=Gs(t),this._currentChannel=void 0,on();const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi)return this._doneStack.pop(),void(this._currentChannel=s.onSuccess(t));const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=Gs(t),this._currentChannel=void 0,on();const i=Cn(e.map((t=>t.finalizer)),Gs(t));this.storeInProgressFinalizer(i);const n=w(i,Ft(vt((()=>this.clearInProgressFinalizer()))),Et,St((()=>vt((()=>this.doneSucceed(t))))));return cn(n)}doneHalt(t){if(0===this._doneStack.length)return this._done=Xs(t),this._currentChannel=void 0,on();const s=this._doneStack[this._doneStack.length-1];if(s._tag===hi){this._doneStack.pop();try{this._currentChannel=s.onHalt(t)}catch(t){this._currentChannel=qi(be(t))}return}const e=this.popNextFinalizers();if(0===this._doneStack.length)return this._doneStack=e.reverse(),this._done=Xs(t),this._currentChannel=void 0,on();const i=Cn(e.map((t=>t.finalizer)),Xs(t));this.storeInProgressFinalizer(i);const n=w(i,Ft(vt((()=>this.clearInProgressFinalizer()))),Et,St((()=>vt((()=>this.doneHalt(t))))));return cn(n)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,on()}runBracketOut(t){const s=Et(pt(this.provide(t.acquire()),{onFailure:t=>vt((()=>{this._currentChannel=qi(t)})),onSuccess:s=>vt((()=>{this.addFinalizer((e=>this.provide(t.finalizer(s,e)))),this._currentChannel=Ji(s)}))}));return cn(s)}provide(t){return void 0===this._providedEnv?t:w(t,mt(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new fi(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case dn:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case fn:return this.pullFromUpstream(t);case bn:return this.drainChildExecutors(t);case vn:return this._emitted=t.value,this._activeSubexecutor=t.next,an()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const s=Ys(t,{onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)});return this._activeSubexecutor=void 0,void 0===s?lt:un(e=s)?e.effect:lt;var e}finishSubexecutorWithCloseEffect(t,...s){this.addFinalizer((()=>w(s,Dt((s=>w(vt((()=>s(t))),St((t=>void 0!==t?t:lt)))),{discard:!0}))));const e=w(t,Ys({onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)}));return this._activeSubexecutor=void 0,e}applyUpstreamPullStrategy(t,s,e){switch(e._tag){case bi:{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[void 0,...s]:s]}case"PullAfterAllEnqueued":{const i=!t||s.some((t=>void 0!==t));return[e.emitSeparator,i?[...s,void 0]:s]}}}pullFromChild(t,s,e,i){return hn(t,ht,(n=>{const r=e(n);switch(r._tag){case ri:break;case"Close":this.finishWithDoneValue(t,s,r.value);break;case"Yield":{const t=s.enqueuePullFromChild(i);this.replaceSubexecutor(t);break}}this._activeSubexecutor=new Sn(n,this._activeSubexecutor)}),Ys({onFailure:e=>{const i=this.handleSubexecutorFailure(t,s,e);return void 0===i?void 0:ln(i)},onSuccess:e=>{this.finishWithDoneValue(t,s,e)}}))}finishWithDoneValue(t,s,e){const i=s;switch(i._tag){case fn:{const s=new pn(i.upstreamExecutor,i.createChild,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.combineChildResults,i.combineWithChildResult,i.onPull,i.onEmit);this._closeLastSubstream=t.close(Gs(e)),this.replaceSubexecutor(s);break}case bn:{const s=new yn(i.upstreamExecutor,void 0!==i.lastDone?i.combineChildResults(i.lastDone,e):e,i.activeChildExecutors,i.upstreamDone,i.combineChildResults,i.combineWithChildResult,i.onPull);this._closeLastSubstream=t.close(Gs(e)),this.replaceSubexecutor(s);break}}}handleSubexecutorFailure(t,s,e){return this.finishSubexecutorWithCloseEffect(Xs(e),(t=>s.close(t)),(s=>t.close(s)))}pullFromUpstream(t){if(0===t.activeChildExecutors.length)return this.performPullFromUpstream(t);const s=t.activeChildExecutors[0],e=new pn(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(void 0===s)return this.performPullFromUpstream(e);this.replaceSubexecutor(new mn(s.childExecutor,e,s.onEmit))}performPullFromUpstream(t){return hn(t.upstreamExecutor,(t=>{const s=void 0===this._closeLastSubstream?lt:this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(s),yt(t))}),(s=>{if(void 0!==this._closeLastSubstream){const e=this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(e),Ct((()=>{const e=new Fn(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(_n(s)));this._activeSubexecutor=new mn(e,new pn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),xt(i)&&(this._activeSubexecutor=new Sn(i.value,this._activeSubexecutor))})))}const e=new Fn(t.createChild(s),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[i,n]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(_n(s)));this._activeSubexecutor=new mn(e,new pn(t.upstreamExecutor,t.createChild,t.lastDone,n,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),xt(i)&&(this._activeSubexecutor=new Sn(i.value,this._activeSubexecutor))}),(s=>{if(t.activeChildExecutors.some((t=>void 0!==t))){const s=new yn(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(void 0!==this._closeLastSubstream){const t=this._closeLastSubstream;return this._closeLastSubstream=void 0,w(this._executeCloseLastSubstream(t),Ct((()=>this.replaceSubexecutor(s))))}return void this.replaceSubexecutor(s)}const e=this._closeLastSubstream,i=this.finishSubexecutorWithCloseEffect(w(s,te((s=>t.combineWithChildResult(t.lastDone,s)))),(()=>e),(s=>t.upstreamExecutor.close(s)));return void 0===i?void 0:ln(i)}))}drainChildExecutors(t){if(0===t.activeChildExecutors.length){const s=this._closeLastSubstream;return void 0!==s&&this.addFinalizer((()=>kt(s))),this.finishSubexecutorWithCloseEffect(t.upstreamDone,(()=>s),(s=>t.upstreamExecutor.close(s)))}const s=t.activeChildExecutors[0],e=t.activeChildExecutors.slice(1);if(void 0===s){const[s,i]=this.applyUpstreamPullStrategy(!0,e,t.onPull((t=>{const s=Object.create(gn);return s._tag="NoUpstream",s.activeDownstreamCount=t,s})(e.reduce(((t,s)=>void 0!==s?t+1:t),0))));return this.replaceSubexecutor(new yn(t.upstreamExecutor,t.lastDone,i,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),xt(s)?(this._emitted=s.value,an()):void 0}const i=new yn(t.upstreamExecutor,t.lastDone,e,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new mn(s.childExecutor,i,s.onEmit))}}const En=t=>void 0!==t?t:lt,Cn=(t,s)=>w(Dt(t,(t=>bt(t(s)))),Ct((t=>w(Zs(t),jt((()=>Js))))),St((t=>_t((()=>t))))),On=(t,s,e)=>{const i=[t],n=()=>{const t=i.pop();if(void 0===t||void 0===t.upstream)return Rt("Unexpected end of input for channel execution");const r=t.upstream.run();switch(r._tag){case tn:{const r=t.onEmit(t.upstream.getEmit());return 0===i.length?void 0===r?_t(s):w(r,pt({onFailure:e,onSuccess:s})):void 0===r?_t((()=>n())):w(r,pt({onFailure:e,onSuccess:()=>n()}))}case $i:{const r=t.onDone(t.upstream.getDone());return 0===i.length?void 0===r?_t(s):w(r,pt({onFailure:e,onSuccess:s})):void 0===r?_t((()=>n())):w(r,pt({onFailure:e,onSuccess:()=>n()}))}case sn:return i.push(t),w(t.onEffect(r.effect),Pt((s=>_t((()=>{const e=t.onDone(Xs(s));return void 0===e?lt:e})))),pt({onFailure:e,onSuccess:()=>n()}));case en:return i.push(t),i.push(r),_t((()=>n()))}};return n()},Dn=F(2,((t,s)=>At((e=>It([Lt(s,zt),se(),se()]).pipe(St((([i,n,r])=>e(((s,e,i)=>Bt(vt((()=>new Fn(t,void 0,ht))),(t=>_t((()=>kn(t.run(),t).pipe(Qt(s),yt(ne(s)),Wt(ne(e)))))),((t,s)=>{const e=t.close(s);return void 0===e?lt:Tt(e,(t=>Vt(i,Mt(t))))})))(n,r,i)).pipe(Nt(s),St((t=>s.addFinalizer((s=>{const e=Hs(s)?Se(s.cause):void 0;return ee(n).pipe(St((s=>s?ie(r,void 0).pipe(yt(Fe(t)),yt(Ee(t))):ie(r,void 0).pipe(yt(e&&Ut(e)>0?Oe(t,qt(e)):Ce(t)),yt(Ee(t))))))})).pipe(yt(e(ne(n)))))))))))))),kn=(t,s)=>{const e=t;switch(e._tag){case sn:return w(e.effect,St((()=>kn(s.run(),s))));case tn:return kn(s.run(),s);case $i:return _t((()=>s.getDone()));case en:return On(e,(()=>kn(s.run(),s)),Mt)}},xn=Symbol.for("effect/ChannelMergeDecision"),jn={[xn]:{_R:t=>t,_E0:t=>t,_Z0:t=>t,_E:t=>t,_Z:t=>t}},Rn=t=>{const s=Object.create(jn);return s._tag="Await",s.f=t,s},Pn="BothRunning",An="LeftDone",In="RightDone",Ln=Symbol.for("effect/ChannelMergeState"),zn={[Ln]:Ln},Bn=(t,s)=>{const e=Object.create(zn);return e._tag=Pn,e.left=t,e.right=s,e},Nn=t=>{const s=Object.create(zn);return s._tag=An,s.f=t,s},Un=t=>{const s=Object.create(zn);return s._tag=In,s.f=t,s},qn="BackPressure",Qn="BufferSliding",Wn=Symbol.for("effect/ChannelMergeStrategy"),Tn={[Wn]:Wn},Vn=()=>{const t=Object.create(Tn);return t._tag=qn,t},Mn=()=>{const t=Object.create(Tn);return t._tag=Qn,t},Hn=F(2,((t,{onBackPressure:s,onBufferSliding:e})=>{switch(t._tag){case qn:return s();case Qn:return e()}})),Kn="Empty",Gn="Emit",Xn="Error",Yn="Done",Zn=t=>({_tag:Kn,notifyProducer:t}),Jn=t=>({_tag:Gn,notifyConsumers:t}),$n=t=>({_tag:Xn,cause:t});class tr{ref;constructor(t){this.ref=t}awaitRead(){return Ht(le(this.ref,(t=>t._tag===Kn?[ne(t.notifyProducer),t]:[lt,t])))}get close(){return Kt((t=>this.error(ve(t))))}done(t){return Ht(le(this.ref,(s=>{switch(s._tag){case Kn:return[ne(s.notifyProducer),s];case Gn:return[Dt(s.notifyConsumers,(s=>ie(s,Xt(t))),{discard:!0}),(e=t,{_tag:Yn,done:e})];case Xn:case Yn:return[Gt,s]}var e})))}emit(t){return St(se(),(s=>Ht(le(this.ref,(e=>{switch(e._tag){case Kn:return[ne(e.notifyProducer),e];case Gn:{const i=e.notifyConsumers[0],n=e.notifyConsumers.slice(1);if(void 0!==i)return[ie(i,Yt(t)),0===n.length?Zn(s):Jn(n)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case Xn:case Yn:return[Gt,e]}})))))}error(t){return Ht(le(this.ref,(s=>{switch(s._tag){case Kn:return[ne(s.notifyProducer),s];case Gn:return[Dt(s.notifyConsumers,(s=>re(s,t)),{discard:!0}),$n(t)];case Xn:case Yn:return[Gt,s]}})))}get take(){return this.takeWith((t=>Xs(_e(t,Xt))),(t=>Gs(t)),(t=>oe(Yt(t))))}takeWith(t,s,e){return St(se(),(i=>Ht(le(this.ref,(n=>{switch(n._tag){case Kn:return[yt(ie(n.notifyProducer,void 0),Zt(ne(i),{onFailure:t,onSuccess:ut({onLeft:e,onRight:s})})),Jn([i])];case Gn:return[Zt(ne(i),{onFailure:t,onSuccess:ut({onLeft:e,onRight:s})}),Jn([...n.notifyConsumers,i])];case Xn:return[kt(t(n.cause)),n];case Yn:return[kt(e(n.done)),n]}})))))}}const sr=()=>w(se(),St((t=>he(Zn(t)))),Ct((t=>new tr(t)))),er=F(2,((t,s)=>zi(t,s,(()=>{}),(()=>{})))),ir=t=>{const s=Hi({onInput:()=>s,onFailure:qi,onDone:Ki});return Vi(t,s)},nr=F(2,((t,s)=>Ni(t,(()=>s)))),rr=t=>pr(t.takeWith(qi,(s=>Wi(Ji(s),(()=>rr(t)))),Ki)),or=()=>Mi({onInput:t=>Wi(Ji(t),(()=>or())),onFailure:Ui,onDone:Gi}),ar=F(2,((t,s)=>Wi(t,(t=>Yi((()=>s(t))))))),cr=F(2,((t,s)=>{const e=Mi({onInput:t=>Wi(Ji(s(t)),(()=>e)),onFailure:Ui,onDone:Gi});return Vi(t,e)})),hr=F(3,((t,s,e)=>Sr((i=>es((function*(){const n=yield*sr(),r=rr(n),o=yield*$e(e);yield*Vt(i,si(o));const a=yield*se(),c=e===Number.POSITIVE_INFINITY?()=>ht:(yield*ls(e)).withPermits,h=yield*r.pipe(Vi(t),vr(i));yield*h.pipe(pt({onFailure:t=>ei(o,Mt(t)),onSuccess:ut({onLeft:t=>yt(gt(c(e)(lt)),ps(ei(o,kt(Xt(t))))),onRight:t=>es((function*(){const e=yield*se(),n=yield*se();yield*ei(o,Ct(ne(e),Yt)),yield*ie(n,void 0).pipe(yt(At((e=>bt(e(ne(a))).pipe(Ss(bt(e(s(t)))),St(ht)))).pipe(Tt((t=>re(a,t))),Qt(e))),c(1),Nt(i)),yield*ne(n)}))})}),ws,gt,Nt(i));const u=pr(Zt(Ht(ii(o)),{onFailure:qi,onSuccess:ut({onLeft:Gi,onRight:t=>Wi(Ji(t),(()=>u))})}));return Bi(u,n)})))))),ur=F(3,((t,s,e)=>(t=>s=>(({bufferSize:t=16,concurrency:s,mergeStrategy:e=Vn()})=>(i,n)=>Sr((r=>es((function*(){const o="unbounded"===s?Number.MAX_SAFE_INTEGER:s,a=yield*sr(),c=rr(a),h=yield*$e(t);yield*Vt(r,si(h));const u=yield*ti();yield*Vt(r,si(u));const l=yield*he(A()),d=yield*se(),f=(yield*ls(o)).withPermits,b=yield*vr(Vi(c,i),r);function v(t){return t.pipe(St(ut({onLeft:t=>kt(I(t)),onRight:t=>bs(ei(h,kt(Yt(t))),A())})),ms({until:t=>xt(t)}),St((t=>de(l,vs({onNone:()=>I(t.value),onSome:s=>I(n(s,t.value))})))),Pt((t=>pe(t)?Mt(t):ei(h,Mt(t)).pipe(yt(ie(d,void 0)),ps))))}yield*b.pipe(pt({onFailure:t=>ei(h,Mt(t)).pipe(yt(kt(!1))),onSuccess:ut({onLeft:t=>as(gt(ne(d)),gt(f(o)(lt)),{onSelfDone:(t,s)=>bs(Ce(s),!1),onOtherDone:(s,e)=>yt(Ce(e),ue(l).pipe(St(vs({onNone:()=>ei(h,kt(Xt(t))),onSome:s=>ei(h,kt(Xt(n(s,t))))})),bs(!1)))}),onRight:t=>Hn(e,{onBackPressure:()=>es((function*(){const s=yield*se(),e=Jt((s=>vr(Vi(c,t),s).pipe(St((t=>fs(bt(v(t)),bt(gt(ne(d)))))),St(ht))));return yield*ie(s,void 0).pipe(yt(e),f(1),Nt(r)),yield*ne(s),!(yield*ee(d))})),onBufferSliding:()=>es((function*(){const s=yield*se(),e=yield*se(),i=yield*(n=u,n.size);var n;yield*ii(u).pipe(St((t=>ie(t,void 0))),ds((()=>i>=o))),yield*ei(u,s);const a=Jt((e=>vr(Vi(c,t),e).pipe(St((t=>bt(v(t)).pipe(fs(bt(gt(ne(d)))),fs(bt(gt(ne(s))))))),St(ht))));return yield*ie(e,void 0).pipe(yt(a),f(1),Nt(r)),yield*ne(e),!(yield*ee(d))}))})})}),ms({while:t=>t}),Nt(r));const m=w(ii(h),Ht,Zt({onFailure:qi,onSuccess:ut({onLeft:Gi,onRight:t=>Wi(Ji(t),(()=>m))})}),pr);return Bi(m,a)})))))(t)(s,ts))(e)(cr(t,s)))),lr=F(2,((t,s)=>Sr((function(e){return es((function*(){const i=yield*sr(),n=rr(i),r=yield*vr(Vi(n,t),e),o=yield*vr(Vi(n,s.other),e);function a(t,s,i){return(n,r,o)=>{function a(t){const e=t;return"Done"===e._tag?kt(Ti(yt(Ce(s),e.effect))):Ct(Fe(s),Ys({onFailure:t=>Ti(e.f(Xs(t))),onSuccess:ut({onLeft:t=>Ti(e.f(Gs(t))),onRight:t=>Fr(Ji(t),c(o(e.f)))})}))}return Ys(t,{onFailure:t=>a(n(Xs(t))),onSuccess:ut({onLeft:t=>a(n(Gs(t))),onRight:t=>kt(Wi(Ji(t),(()=>Wi(Ti(Nt(gt(i),e)),(t=>c(r(t,s)))))))})})}}function c(t){switch(t._tag){case Pn:{const e=gt(De(t.left)),i=gt(De(t.right));return pr(as(e,i,{onSelfDone:(e,i)=>yt(Ce(i),a(e,t.right,r)(s.onSelfDone,Bn,(t=>Nn(t)))),onOtherDone:(e,i)=>yt(Ce(i),a(e,t.left,o)(s.onOtherDone,((t,s)=>Bn(s,t)),(t=>Un(t))))}))}case An:return pr(Ct(bt(o),Ys({onFailure:s=>Ti(t.f(Xs(s))),onSuccess:ut({onLeft:s=>Ti(t.f(Gs(s))),onRight:s=>Wi(Ji(s),(()=>c(Nn(t.f))))})})));case In:return pr(Ct(bt(r),Ys({onFailure:s=>Ti(t.f(Xs(s))),onSuccess:ut({onLeft:s=>Ti(t.f(Gs(s))),onRight:s=>Wi(Ji(s),(()=>c(Un(t.f))))})})))}}return Ti(is((t=>{const s=is((s=>(s.transferChildren(t.scope()),lt))),i=gt(r).pipe(Ft(s),Nt(e)),n=gt(o).pipe(Ft(s),Nt(e));return ft(i,n,((t,s)=>Bn(t,s)))}))).pipe(Wi(c),Bi(i))}))})))),dr=F(2,((t,s)=>Xi((()=>{let e;const i=Mi({onInput:t=>Wi(Ji(t),(()=>i)),onFailure:t=>(e=Cr(t),qi(be(e))),onDone:Gi}),n=Hi({onInput:t=>w(Ji(t),Wi((()=>n))),onFailure:t=>me(t)&&Or(t.defect)&&ys(t.defect,e)?Ui(t.defect.error):qi(t),onDone:Gi});return Vi(Vi(Vi(t,i),s),n)})))),fr=t=>(t=>Jt((s=>Dn(t,s))))(ir(t)),br=t=>yr(Ct(ss,(s=>Wi(Ti(t(s)),Ji)))),vr=F(2,((t,s)=>Ot(vt((()=>new Fn(t,void 0,ht))),cs()).pipe(hs((([t,e])=>us(s,(s=>{const i=t.close(s);return void 0!==i?mt(i,e):lt})))),Et,Ct((([t])=>_t((()=>mr(t.run(),t)))))))),mr=(t,s)=>{const e=t;switch(e._tag){case $i:return Ys(s.getDone(),{onFailure:Mt,onSuccess:t=>kt(Xt(t))});case tn:return kt(Yt(s.getEmit()));case sn:return w(e.effect,St((()=>mr(s.run(),s))));case en:return On(e,(()=>mr(s.run(),s)),(t=>Mt(t)))}},pr=t=>{return s=Ti(t),Wi(s,ht);var s},yr=t=>{return Li((s=t,pr(At((t=>Ct(ns(),(e=>Ii(Tt(t(rs(s,e)),(t=>os(e,Xs(t)))),((t,s)=>os(e,s))))))))),(t=>t),(t=>t));var s},Sr=t=>Li(br(t),(t=>t),(t=>t)),wr=t=>gr(0,t.length,t),gr=(t,s,e)=>t===s?Zi:w(Ji(w(e,$t(t))),Wi((()=>gr(t+1,s,e)))),_r=F((t=>Ai(t[1])),((t,s,e)=>e?.concurrent?lr(t,{other:s,onSelfDone:t=>Rn((s=>_t((()=>ae(t,s))))),onOtherDone:t=>Rn((s=>_t((()=>ae(s,t)))))}):Wi(t,(t=>ar(s,(s=>[t,s])))))),Fr=F((t=>Ai(t[1])),((t,s,e)=>e?.concurrent?ar(_r(t,s,{concurrent:!0}),(t=>t[1])):Wi(t,(()=>s)))),Er=Symbol.for("effect/Channel/ChannelException"),Cr=t=>({_tag:"ChannelException",[Er]:Er,error:t}),Or=t=>at(t,Er),Dr=Symbol.for("effect/Sink"),kr={_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t};class xr{channel;[Dr]=kr;constructor(t){this.channel=t}pipe(){return k(this,arguments)}}const jr=new xr(ir(or())),Rr=t=>ct(t)?Rr(new xr(Ti(t))):t.channel,Pr=Symbol.for("effect/Take"),Ar={_A:t=>t,_E:t=>t};class Ir{exit;[Pr]=Ar;constructor(t){this.exit=t}pipe(){return k(this,arguments)}}const Lr=t=>new Ir(Gs(t)),zr=new Ir(oe(A())),Br=Symbol.for("effect/Stream"),Nr={_R:t=>t,_E:t=>t,_A:t=>t};class Ur{channel;[Br]=Nr;constructor(t){this.channel=t}pipe(){return k(this,arguments)}}const qr=t=>at(t,Br)||ct(t),Qr=F(2,((t,s)=>new Ur(w(Kr(t),nr(s))))),Wr=F((t=>qr(t[0])),((t,s,e)=>{const i=e?.bufferSize??16;return e?.switch?Tr(e?.concurrency,(()=>Vr(t,1,i,s)),(e=>Vr(t,e,i,s))):Tr(e?.concurrency,(()=>new Ur(er(Kr(t),(t=>w(t,Cs((t=>Kr(s(t)))),Es(Zi,((t,s)=>w(t,Fr(s))))))))),(()=>new Ur(w(Kr(t),er(wr),ur((t=>Kr(s(t))),e)))))})),Tr=(t,s,e)=>{switch(t){case void 0:return s();case"unbounded":return e(Number.MAX_SAFE_INTEGER);default:return t>1?e(t):s()}},Vr=F(4,((t,s,e,i)=>new Ur(w(Kr(t),er(wr),ur((t=>Kr(i(t))),{concurrency:s,mergeStrategy:Mn(),bufferSize:e}))))),Mr=F((t=>qr(t[0])),((t,s)=>Wr(t,ht,s))),Hr=t=>(t=>{const s=Hi({onInput:t=>Wi(wr(t),(()=>s)),onFailure:qi,onDone:()=>Zi});return new Ur(w(Kr(t),Vi(s)))})((t=>{const s=Hi({onInput:t=>((t,s)=>{const[e,i]=w(t,Ds((t=>!ce(t)))),n=w(ks(i),vs({onNone:()=>s,onSome:Ys({onFailure:t=>vs(ge(t),{onNone:()=>Zi,onSome:qi}),onSuccess:()=>Zi})}));return w(Ji(w(e,xs((t=>ce(t)?I(t.value):A())))),Wi((()=>n)))})(t,s),onFailure:t=>qi(t),onDone:()=>Zi});return new Ur(w(Kr(t),Vi(s)))})(w(t,Zr((t=>t.exit))))),Kr=t=>{if("channel"in t)return t.channel;if(ct(t))return Kr(Gr(t));throw new TypeError("Expected a Stream.")},Gr=t=>w(t,Fs(I),Xr),Xr=t=>new Ur(pr(Os(t,{onFailure:vs({onNone:()=>Zi,onSome:Ui}),onSuccess:t=>Ji(gs(t))}))),Yr=(t,s)=>w(ni(t,1,s?.maxChunkSize??4096),Pt((s=>w(t.isShutdown,St((t=>t&&pe(s)?_s(A()):(t=>Fs(Mt(t),I))(s)))))),to,s?.shutdown?Qr(si(t)):ht),Zr=F(2,((t,s)=>new Ur(w(Kr(t),cr(Cs(s)))))),Jr=F(2,((t,s)=>{const e=t=>{const i=t.next();return i.done?Hi({onInput:t=>e(t[Symbol.iterator]()),onFailure:qi,onDone:Ki}):pr(Ct(s(i.value),(s=>Wi(Ji(gs(s)),(()=>e(t))))))};return new Ur(w(Kr(t),Vi(Xi((()=>e(nt()[Symbol.iterator]()))))))})),$r=F(3,((t,s,e)=>new Ur(w(Kr(t),er(wr),hr(e,s),cr(gs))))),to=t=>eo(t,(t=>w(Ct(t,(s=>I([s,t]))),js(vs({onNone:()=>kt(A()),onSome:_s}))))),so=F(2,((t,s)=>Kr(t).pipe(dr(Rr(s)),fr))),eo=(t,s)=>{return e=()=>{const e=t=>pr(Ct(s(t),vs({onNone:()=>Zi,onSome:([t,s])=>Wi(Ji(t),(()=>e(s)))})));return new Ur(e(t))},new Ur(Xi((()=>Kr(e()))));var e},io=Symbol.for("effect/GroupBy"),no={_R:t=>t,_E:t=>t,_K:t=>t,_V:t=>t},ro=F((t=>at(t[0],io)),((t,s,e)=>Wr(t.grouped,(([t,e])=>s(t,Hr(Yr(e,{shutdown:!0})))),{concurrency:"unbounded",bufferSize:e?.bufferSize??16}))),oo=t=>({[io]:no,pipe(){return k(this,arguments)},grouped:t}),ao=F((t=>"function"!=typeof t[0]),((t,s,e)=>e?.key?ro(co(t,e.key,{bufferSize:e.bufferSize}),((t,e)=>Jr(e,s))):Tr(e?.concurrency,(()=>Jr(t,s)),(i=>e?.unordered?Wr(t,(t=>Gr(s(t))),{concurrency:i}):$r(t,i,s))))),co=F((t=>"function"!=typeof t[0]),((t,s,e)=>{const i=(t,n)=>Hi({onInput:r=>Wi(Ti(Dt(ho(r,s),(([s,i])=>{const r=t.get(s);return void 0===r?w($e(e?.bufferSize??16),St((e=>w(vt((()=>{t.set(s,e)})),yt(ei(n,new Ir(Gs(gs([s,e]))))),yt(w(ei(e,Lr(i)),Rs((t=>ye(t)?I(lt):A())))))))):Rs(ei(r,Lr(i)),(t=>ye(t)?I(lt):A()))}),{discard:!0})),(()=>i(t,n))),onFailure:t=>Ti(ei(n,(t=>new Ir(Xs(w(t,_e(I)))))(t))),onDone:()=>Ti(w(Dt(t.entries(),(([t,s])=>w(ei(s,zr),Rs((t=>ye(t)?I(lt):A())))),{discard:!0}),yt(ei(n,zr))))});return oo((t=>Mr((t=>new Ur(br((s=>t(s).pipe(Ct(gs))))))((s=>t(s)))))((s=>es((function*(){const e=new Map,n=yield*ti();return yield*Vt(s,si(n)),yield*Kr(t).pipe(Vi(i(e,n)),ir,Dn(s),Nt(s),bs(Hr(Yr(n,{shutdown:!0}))))})))))})),ho=F(2,((t,s)=>{const e=[],i=t[Symbol.iterator](),n=new Map;let r;for(;(r=i.next())&&!r.done;){const t=r.value,i=s(t);if(n.has(i))n.get(i).push(t);else{const s=[t];e.push([i,s]),n.set(i,s)}}return Ps(e.map((t=>[t[0],Ps(t[1])])))})),uo=Yr,lo=ao;class fo{controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){this.controllers.size||console.warn("ReactiveControllerHost connected with no controllers registered.",this),this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}}class bo{host;config;static get globalValidationEnabled(){return t.isDev}static axe=this.globalValidationEnabled?import("./p-D1HbKFuh.js").then((function(t){return t.a})):null;static axeQueue=null;static axeStreamFiber=null;visibilityObserver;elementQueued=!1;elementValidated=!1;knownValidationErrors=[];get disabled(){return!0}constructor(t,s){this.host=t,this.config=s,bo.initializeAxeStream()}static initializeAxeStream(){if(!this.globalValidationEnabled)return;if(this.axeStreamFiber)return;const t=es((function*(){const t=bo.axeQueue=yield*$e(100),s=yield*Is((()=>bo.axe));if(!s)return void console.error("Axe library not available, ARIA validation will not run.");const e=uo(t).pipe(lo((({context:t,onComplete:e})=>Ls((i=>{s.run(t,{},((t,s)=>{e(t,s),i(lt)}))})))));var i;yield*(i=e,so(i,jr))}));this.axeStreamFiber=As(t)}hostDidLoad(){this.elementQueued||this.elementValidated||(this.host.el.checkVisibility()?this.enqueueValidation():this.observeVisibilityOnce())}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver()}observeVisibilityOnce(){this.visibilityObserver=new IntersectionObserver((t=>{for(const s of t)s.target===this.host.el&&s.isIntersecting&&(this.checkLazyValidation(),this.discardVisibilityObserver())}),{root:this.host.el.parentElement,rootMargin:"0px",threshold:.01}),this.visibilityObserver.observe(this.host.el)}checkLazyValidation(){(this.config?.reValidateOnPropChanges||!this.elementQueued&&!this.elementValidated)&&this.enqueueValidation()}enqueueValidation(){}discardVisibilityObserver(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=void 0)}}export{bo as A,fo as R}
|