@lmvz-ds/components 0.12.5 → 0.13.1
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/cjs/assets-CJzJZPzV.js +26 -0
- package/dist/{esm/Effect-BhQLGXPs.js → cjs/icons-FIfJEo6G.js} +1708 -5205
- 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 +4 -5
- 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-card/lmvz-card.js +3 -4
- package/dist/collection/components/lmvz-header/lmvz-header.js +11 -8
- package/dist/collection/components/lmvz-icon/icons.js +2 -2
- 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/assets.js +9 -6
- package/dist/collection/utils/http.js +2 -2
- package/dist/collection/utils/{http.test.js → http.unit.js} +8 -7
- package/dist/collection/utils/validation/svg.js +1 -1
- 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-DMLRPGid.js → p-BfTCfPZ1.js} +1 -1
- package/dist/components/p-BsS3QvWn.js +1 -0
- package/dist/components/p-CMteT-Yo.js +1 -0
- package/dist/components/p-CdYWDK7m.js +1 -0
- package/dist/components/p-vi4YzJmv.js +1 -0
- package/dist/esm/assets-BelZNJ1W.js +23 -0
- package/dist/{cjs/Effect-CNhHt4Xb.js → esm/icons-CM7lsnuO.js} +1751 -5457
- 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 +4 -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 +4 -5
- 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-6e3314ab.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-BoR31cjC.js +1 -0
- package/dist/lmvz-components/p-CVf2C8dL.js +1 -0
- package/dist/lmvz-components/p-CZ3dGAjR.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-d9dc29a1.entry.js +1 -0
- package/dist/lmvz-components/{p-9faac8f3.entry.js → p-feda2ec5.entry.js} +1 -1
- 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/dist/types/utils/assets.d.ts +1 -8
- package/dist/types/utils/http.d.ts +3 -3
- package/dist/types/utils/validation/svg.d.ts +2 -2
- package/hydrate/index.js +3608 -54447
- package/hydrate/index.mjs +3608 -54447
- 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/cjs/icons-7wUEcWEo.js +0 -607
- 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/esm/icons-Bx1wWPM2.js +0 -603
- 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{p as t,h as s,d as e,t as i}from"./p-BaPwpeMs.js";import{g as r,b as n,l as o,i as a,c,d as h,m as l,e as m,f as d,h as u,j as v,k as p,n as g,s as f,o as w,p as z,q as y,t as b,u as k,v as x,w as S,x as C,y as E,z as _,A as M,B as P,C as L,D as R,E as T,F as V,G as D,H as O,I as j,J as I,K as A,L as B,M as N,N as $,O as K,P as F,Q as H,R as G,S as Q,T as U,U as W,V as Z,W as q,X as J,Y as X,Z as Y,_ as tt,$ as st,r as et,a0 as it,a1 as rt,a2 as nt,a3 as ot}from"./p-CdofjRtQ.js";import{u as at,o as ct,p as ht,E as lt,a as mt,_ as dt,s as ut,i as vt,d as pt,R as gt,A as ft}from"./p-3I3wZmp8.js";import{T as wt,s as zt}from"./p-CAi33KTt.js";const yt=Symbol.for("effect/Brand/Refined"),bt=(t,s,e,i)=>M({_tag:"Complete",key:t,exit:s,entryStats:e,timeToLiveMillis:i}),kt=(t,s)=>M({_tag:"Pending",key:t,deferred:s}),xt=Symbol.for("effect/Cache/MapKey");class St{current;[xt]=xt;previous=void 0;next=void 0;constructor(t){this.current=t}[j](){return I(N(this.current),B(N(this.previous)),B(N(this.next)),A(this))}[$](t){return this===t||Et(t)&&F(this.current,t.current)&&F(this.previous,t.previous)&&F(this.next,t.next)}}const Ct=t=>new St(t),Et=t=>K(t,xt);class _t{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 Mt=Symbol.for("effect/Cache"),Pt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Lt=Symbol.for("effect/ConsumerCache"),Rt={_Key:t=>t,_Error:t=>t,_Value:t=>t},Tt=t=>({loadedMillis:t});class Vt{capacity;context;fiberId;lookup;timeToLive;[Mt]=Pt;[Lt]=Rt;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:R(),keys:new _t,accesses:mt(),updating:O(!1),hits:0,misses:0}}get(t){return d(this.getEither(t),g)}get cacheStats(){return f((()=>({hits:this.cacheState.hits,misses:this.cacheState.misses,size:w(this.cacheState.map)})))}getOption(t){return z((()=>l(y(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),b(k())},onSome:t=>this.resolveMapValue(t)})))}getOptionComplete(t){return z((()=>l(y(this.cacheState.map,t),{onNone:()=>{const s=Ct(t);return this.trackAccess(s),this.trackMiss(),b(k())},onSome:t=>this.resolveMapValue(t,!0)})))}contains(t){return f((()=>x(this.cacheState.map,t)))}entryStats(t){return f((()=>{const s=y(this.cacheState.map,t);if(S(s))switch(s.value._tag){case"Complete":return C(Tt(s.value.entryStats.loadedMillis));case"Pending":return k();case"Refreshing":return C(Tt(s.value.complete.entryStats.loadedMillis))}return k()}))}getEither(t){return z((()=>{const s=t;let e,i,r=E(y(this.cacheState.map,s));return void 0===r&&(i=at(this.fiberId),e=Ct(s),x(this.cacheState.map,s)?r=E(y(this.cacheState.map,s)):_(this.cacheState.map,s,kt(e,i))),void 0===r?(this.trackAccess(e),this.trackMiss(),d(this.lookupValueOf(t,i),n)):P(this.resolveMapValue(r),l({onNone:()=>this.getEither(t),onSome:t=>b(o(t))}))}))}invalidate(t){return f((()=>{L(this.cacheState.map,t)}))}invalidateWhen(t,s){return f((()=>{const e=y(this.cacheState.map,t);S(e)&&"Complete"===e.value._tag&&"Success"===e.value.exit._tag&&s(e.value.exit.value)&&L(this.cacheState.map,t)}))}get invalidateAll(){return f((()=>{this.cacheState.map=R()}))}refresh(t){return T((s=>z((()=>{const e=t,i=at(this.fiberId);let r=E(y(this.cacheState.map,e));if(void 0===r&&(x(this.cacheState.map,e)?r=E(y(this.cacheState.map,e)):_(this.cacheState.map,e,kt(Ct(e),i))),void 0===r)return H(this.lookupValueOf(t,i));switch(r._tag){case"Complete":if(this.hasExpired(s,r.timeToLiveMillis)){const s=E(y(this.cacheState.map,e));return F(s,r)&&L(this.cacheState.map,e),H(this.get(t))}return I(this.lookupValueOf(t,i),G((()=>{const t=E(y(this.cacheState.map,e));if(F(t,r)){const t=((t,s)=>M({_tag:"Refreshing",deferred:t,complete:s}))(i,r);return _(this.cacheState.map,e,t),!0}return!1})),H);case"Pending":case"Refreshing":return dt(r.deferred)}}))))}set(t,s){return T((e=>f((()=>{const i=e.unsafeCurrentTimeMillis(),r=t,n=ut(s),o=bt(Ct(r),n,Tt(i),i+Q(m(this.timeToLive(n))));_(this.cacheState.map,r,o)}))))}get size(){return f((()=>w(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 T((e=>{switch(t._tag){case"Complete":return this.trackAccess(t.key),this.hasExpired(e,t.timeToLiveMillis)?(L(this.cacheState.map,t.key.current),b(k())):(this.trackHit(),d(t.exit,C));case"Pending":return this.trackAccess(t.key),this.trackHit(),s?b(k()):d(dt(t.deferred),C);case"Refreshing":return this.trackAccess(t.complete.key),this.trackHit(),this.hasExpired(e,t.complete.timeToLiveMillis)?s?b(k()):d(dt(t.deferred),C):d(t.complete.exit,C)}}))}trackHit(){this.cacheState.hits=this.cacheState.hits+1}trackMiss(){this.cacheState.misses=this.cacheState.misses+1}trackAccess(t){if(ct(this.cacheState.accesses,t),V(this.cacheState.updating,!1,!0)){let t=!0;for(;t;){const s=ht(this.cacheState.accesses,lt);s===lt?t=!1:this.cacheState.keys.add(s)}let s=w(this.cacheState.map);for(t=s>this.capacity;t;){const e=this.cacheState.keys.remove();void 0!==e?x(this.cacheState.map,e.current)&&(L(this.cacheState.map,e.current),s-=1,t=s>this.capacity):t=!1}D(this.cacheState.updating,!1)}}hasExpired(t,s){return t.unsafeCurrentTimeMillis()>s}lookupValueOf(t,s){return T((e=>z((()=>{const i=t;return I(this.lookup(t),q(this.context),Z,P((t=>{const r=e.unsafeCurrentTimeMillis(),n=Tt(r),o=bt(Ct(i),t,n,r+Q(m(this.timeToLive(t))));return _(this.cacheState.map,i,o),W(pt(s,t),t)})),U((()=>W(vt(s),f((()=>{L(this.cacheState.map,i)}))))))}))))}}const Dt=t=>{const s=m(t.timeToLive);return(t=>d(u([v(),p]),(([s,e])=>new Vt(t.capacity,s,e,t.lookup,(s=>m(t.timeToLive(s)))))))({capacity:t.capacity,lookup:t.lookup,timeToLive:()=>s})};class Ot extends(wt("FetchError")){}class jt extends(wt("NotFoundError")){}class It extends(wt("ResponseTextError")){constructor(t){super(new Error("Failed to read response text",{cause:t}))}}const At=function(...t){const s=2===t.length?s=>t[0](s)?n(s):o(t[1](s)):s=>l(t[0](s),{onNone:()=>n(s),onSome:o});return Object.assign((t=>r(s(t),a)),{[yt]:yt,option:t=>h(s(t)),either:s,is:t=>c(s(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(wt("BrandValidationError")){constructor(t,s){super(new Error(`Brand validation failed for type ${s}.`,{cause:t}))}}let Nt=null;function $t(){return J((function*(){Nt?yield*Nt.invalidateAll:tt("Attempted to clear icon cache before it was initialized")}))}const Kt=t(class extends gt{intersectionObserver;get el(){return this}icon;weight="medium";size="md";iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(t){super(!1),!1!==t&&this.__registerHost(),this.addController(new ft(this))}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()}))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null)}async loadIconPathData(){const{icon:t,visible:s}=this;t&&s&&(this.iconData=await et(function(t){const s=t;return J((function*(){return Nt||(Nt=yield*Dt({capacity:200,timeToLive:st,lookup:t=>J((function*(){const s=t,e=yield*zt(`${s}.svg`,"icons"),i=yield*(r=e,J((function*(){const t=yield*X({try:()=>fetch(r,void 0),catch:t=>new Ot({cause:t})});return 404===t.status?yield*new jt({url:t.url}):t})));var r;const n=yield*(t=>X({try:()=>t.text(),catch:t=>new It(t)}))(i);return yield*(o=n,Y({try:()=>At(o),catch:t=>new Bt(t,"SVGString")}));var o}))})),yield*Nt.get(s)}))}(this.icon).pipe(it((s=>rt(`Error loading icon "${t}":`,s.message,s.cause,s.stack))),nt((()=>ot(At('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>')))))))}render(){return s(e,{key:"50d0f96ec5085a47ca7783e5232dfb503fa32d29",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(t,s=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((s=>{s.some((s=>!!s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t(),!0)))}),{rootMargin:`${s}px`}),this.intersectionObserver.observe(this.el)):t()}static get assetsDirs(){return["../../assets/icons"]}static get watchers(){return{icon:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));display:inline-block;line-height:0;svg{display:block}svg>path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));height:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))}}[size='sm'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem));height:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.81rem + 0.26vw, 1.13rem))}}[size='md'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));height:var(--lmvz-component-icon-size-md, clamp(1rem, 0.88rem + 0.52vw, 1.5rem))}}[size='lg'].sc-lmvz-icon-h{svg{width:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem));height:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.38rem + 0.52vw, 2rem))}}[size='inherit'].sc-lmvz-icon-h{svg{width:inherit;height:inherit}}[weight='light'].sc-lmvz-icon-h{svg>path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg>path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg>path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg>path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}]}]);function Ft(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((t=>{"lmvz-icon"===t&&(customElements.get(i(t))||customElements.define(i(t),Kt))}))}export{Kt as L,$t as c,Ft as d}
|
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
import { aq as deferredMake, aB as deferredAwait, az as deferredSucceed, bZ as deferredFailCause, aG as deferredUnsafeMake, b_ as deferredInterrupt, b$ as deferredDone, c0 as deferredIsDone, c1 as exitIsFailure, c2 as exitIsSuccess, c3 as exitMatch, c4 as exitFailCause, c5 as exitSucceed, c6 as exitFail, c7 as exitZipRight, c8 as exitCollectAll, c9 as exitVoid, ca as exitDie, cb as exitMap, cc as exitZip, ap as dual, as as pipeArguments, cd as NodeInspectSymbol, ce as toJSON, cf as format, aJ as prepend, aO as empty$1, cg as reverse } from './Effect-BhQLGXPs.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new `Deferred`.
|
|
5
|
-
*
|
|
6
|
-
* @since 2.0.0
|
|
7
|
-
* @category constructors
|
|
8
|
-
*/
|
|
9
|
-
const make$1 = deferredMake;
|
|
10
|
-
const _await = deferredAwait;
|
|
11
|
-
/**
|
|
12
|
-
* Exits the `Deferred` with the specified `Exit` value, which will be
|
|
13
|
-
* propagated to all fibers waiting on the value of the `Deferred`.
|
|
14
|
-
*
|
|
15
|
-
* @since 2.0.0
|
|
16
|
-
* @category utils
|
|
17
|
-
*/
|
|
18
|
-
const done = deferredDone;
|
|
19
|
-
/**
|
|
20
|
-
* Fails the `Deferred` with the specified `Cause`, which will be propagated to
|
|
21
|
-
* all fibers waiting on the value of the `Deferred`.
|
|
22
|
-
*
|
|
23
|
-
* @since 2.0.0
|
|
24
|
-
* @category utils
|
|
25
|
-
*/
|
|
26
|
-
const failCause$1 = deferredFailCause;
|
|
27
|
-
/**
|
|
28
|
-
* Completes the `Deferred` with interruption. This will interrupt all fibers
|
|
29
|
-
* waiting on the value of the `Deferred` with the `FiberId` of the fiber
|
|
30
|
-
* calling this method.
|
|
31
|
-
*
|
|
32
|
-
* @since 2.0.0
|
|
33
|
-
* @category utils
|
|
34
|
-
*/
|
|
35
|
-
const interrupt = deferredInterrupt;
|
|
36
|
-
/**
|
|
37
|
-
* Returns `true` if this `Deferred` has already been completed with a value or
|
|
38
|
-
* an error, `false` otherwise.
|
|
39
|
-
*
|
|
40
|
-
* @since 2.0.0
|
|
41
|
-
* @category getters
|
|
42
|
-
*/
|
|
43
|
-
const isDone = deferredIsDone;
|
|
44
|
-
/**
|
|
45
|
-
* Completes the `Deferred` with the specified value.
|
|
46
|
-
*
|
|
47
|
-
* @since 2.0.0
|
|
48
|
-
* @category utils
|
|
49
|
-
*/
|
|
50
|
-
const succeed$1 = deferredSucceed;
|
|
51
|
-
/**
|
|
52
|
-
* Unsafely creates a new `Deferred` from the specified `FiberId`.
|
|
53
|
-
*
|
|
54
|
-
* @since 2.0.0
|
|
55
|
-
* @category unsafe
|
|
56
|
-
*/
|
|
57
|
-
const unsafeMake = deferredUnsafeMake;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Returns `true` if the specified `Exit` is a `Failure`, `false` otherwise.
|
|
61
|
-
*
|
|
62
|
-
* @since 2.0.0
|
|
63
|
-
* @category refinements
|
|
64
|
-
*/
|
|
65
|
-
const isFailure = exitIsFailure;
|
|
66
|
-
/**
|
|
67
|
-
* Returns `true` if the specified `Exit` is a `Success`, `false` otherwise.
|
|
68
|
-
*
|
|
69
|
-
* @since 2.0.0
|
|
70
|
-
* @category refinements
|
|
71
|
-
*/
|
|
72
|
-
const isSuccess = exitIsSuccess;
|
|
73
|
-
/**
|
|
74
|
-
* Collects all of the specified exit values into a `Some<Exit<List<A>, E>>`. If
|
|
75
|
-
* the provided iterable contains no elements, `None` will be returned.
|
|
76
|
-
*
|
|
77
|
-
* @since 2.0.0
|
|
78
|
-
* @category constructors
|
|
79
|
-
*/
|
|
80
|
-
const all = exitCollectAll;
|
|
81
|
-
/**
|
|
82
|
-
* Constructs a new `Exit.Failure` from the specified unrecoverable defect.
|
|
83
|
-
*
|
|
84
|
-
* @since 2.0.0
|
|
85
|
-
* @category constructors
|
|
86
|
-
*/
|
|
87
|
-
const die = exitDie;
|
|
88
|
-
/**
|
|
89
|
-
* Constructs a new `Exit.Failure` from the specified recoverable error of type
|
|
90
|
-
* `E`.
|
|
91
|
-
*
|
|
92
|
-
* @since 2.0.0
|
|
93
|
-
* @category constructors
|
|
94
|
-
*/
|
|
95
|
-
const fail = exitFail;
|
|
96
|
-
/**
|
|
97
|
-
* Constructs a new `Exit.Failure` from the specified `Cause` of type `E`.
|
|
98
|
-
*
|
|
99
|
-
* @since 2.0.0
|
|
100
|
-
* @category constructors
|
|
101
|
-
*/
|
|
102
|
-
const failCause = exitFailCause;
|
|
103
|
-
/**
|
|
104
|
-
* Maps over the `Success` value of the specified exit using the provided
|
|
105
|
-
* function.
|
|
106
|
-
*
|
|
107
|
-
* @since 2.0.0
|
|
108
|
-
* @category mapping
|
|
109
|
-
*/
|
|
110
|
-
const map = exitMap;
|
|
111
|
-
/**
|
|
112
|
-
* @since 2.0.0
|
|
113
|
-
* @category folding
|
|
114
|
-
*/
|
|
115
|
-
const match = exitMatch;
|
|
116
|
-
/**
|
|
117
|
-
* Constructs a new `Exit.Success` containing the specified value of type `A`.
|
|
118
|
-
*
|
|
119
|
-
* @since 2.0.0
|
|
120
|
-
* @category constructors
|
|
121
|
-
*/
|
|
122
|
-
const succeed = exitSucceed;
|
|
123
|
-
const void_ = exitVoid;
|
|
124
|
-
/**
|
|
125
|
-
* Sequentially zips the this result with the specified result or else returns
|
|
126
|
-
* the failed `Cause<E | E2>`.
|
|
127
|
-
*
|
|
128
|
-
* @since 2.0.0
|
|
129
|
-
* @category zipping
|
|
130
|
-
*/
|
|
131
|
-
const zip = exitZip;
|
|
132
|
-
/**
|
|
133
|
-
* Sequentially zips the this result with the specified result discarding the
|
|
134
|
-
* first element of the tuple or else returns the failed `Cause<E | E2>`.
|
|
135
|
-
*
|
|
136
|
-
* @since 2.0.0
|
|
137
|
-
* @category zipping
|
|
138
|
-
*/
|
|
139
|
-
const zipRight = exitZipRight;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @since 2.0.0
|
|
143
|
-
*/
|
|
144
|
-
const TypeId$1 = /*#__PURE__*/Symbol.for("effect/MutableList");
|
|
145
|
-
const MutableListProto = {
|
|
146
|
-
[TypeId$1]: TypeId$1,
|
|
147
|
-
[Symbol.iterator]() {
|
|
148
|
-
let done = false;
|
|
149
|
-
let head = this.head;
|
|
150
|
-
return {
|
|
151
|
-
next() {
|
|
152
|
-
if (done) {
|
|
153
|
-
return this.return();
|
|
154
|
-
}
|
|
155
|
-
if (head == null) {
|
|
156
|
-
done = true;
|
|
157
|
-
return this.return();
|
|
158
|
-
}
|
|
159
|
-
const value = head.value;
|
|
160
|
-
head = head.next;
|
|
161
|
-
return {
|
|
162
|
-
done,
|
|
163
|
-
value
|
|
164
|
-
};
|
|
165
|
-
},
|
|
166
|
-
return(value) {
|
|
167
|
-
if (!done) {
|
|
168
|
-
done = true;
|
|
169
|
-
}
|
|
170
|
-
return {
|
|
171
|
-
done: true,
|
|
172
|
-
value
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
toString() {
|
|
178
|
-
return format(this.toJSON());
|
|
179
|
-
},
|
|
180
|
-
toJSON() {
|
|
181
|
-
return {
|
|
182
|
-
_id: "MutableList",
|
|
183
|
-
values: Array.from(this).map(toJSON)
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
[NodeInspectSymbol]() {
|
|
187
|
-
return this.toJSON();
|
|
188
|
-
},
|
|
189
|
-
pipe() {
|
|
190
|
-
return pipeArguments(this, arguments);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
/** @internal */
|
|
194
|
-
const makeNode = value => ({
|
|
195
|
-
value,
|
|
196
|
-
removed: false,
|
|
197
|
-
prev: undefined,
|
|
198
|
-
next: undefined
|
|
199
|
-
});
|
|
200
|
-
/**
|
|
201
|
-
* Creates an empty `MutableList`.
|
|
202
|
-
*
|
|
203
|
-
* @since 2.0.0
|
|
204
|
-
* @category constructors
|
|
205
|
-
*/
|
|
206
|
-
const empty = () => {
|
|
207
|
-
const list = Object.create(MutableListProto);
|
|
208
|
-
list.head = undefined;
|
|
209
|
-
list.tail = undefined;
|
|
210
|
-
list._length = 0;
|
|
211
|
-
return list;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* Returns `true` if the list contains zero elements, `false`, otherwise.
|
|
215
|
-
*
|
|
216
|
-
* @since 2.0.0
|
|
217
|
-
* @category getters
|
|
218
|
-
*/
|
|
219
|
-
const isEmpty$1 = self => length$1(self) === 0;
|
|
220
|
-
/**
|
|
221
|
-
* Returns the length of the list.
|
|
222
|
-
*
|
|
223
|
-
* @since 2.0.0
|
|
224
|
-
* @category getters
|
|
225
|
-
*/
|
|
226
|
-
const length$1 = self => self._length;
|
|
227
|
-
/**
|
|
228
|
-
* Appends the specified element to the end of the `MutableList`.
|
|
229
|
-
*
|
|
230
|
-
* @category concatenating
|
|
231
|
-
* @since 2.0.0
|
|
232
|
-
*/
|
|
233
|
-
const append = /*#__PURE__*/dual(2, (self, value) => {
|
|
234
|
-
const node = makeNode(value);
|
|
235
|
-
if (self.head === undefined) {
|
|
236
|
-
self.head = node;
|
|
237
|
-
}
|
|
238
|
-
if (self.tail === undefined) {
|
|
239
|
-
self.tail = node;
|
|
240
|
-
} else {
|
|
241
|
-
self.tail.next = node;
|
|
242
|
-
node.prev = self.tail;
|
|
243
|
-
self.tail = node;
|
|
244
|
-
}
|
|
245
|
-
self._length += 1;
|
|
246
|
-
return self;
|
|
247
|
-
});
|
|
248
|
-
/**
|
|
249
|
-
* Removes the first value from the list and returns it, if it exists.
|
|
250
|
-
*
|
|
251
|
-
* @since 0.0.1
|
|
252
|
-
*/
|
|
253
|
-
const shift = self => {
|
|
254
|
-
const head = self.head;
|
|
255
|
-
if (head !== undefined) {
|
|
256
|
-
remove(self, head);
|
|
257
|
-
return head.value;
|
|
258
|
-
}
|
|
259
|
-
return undefined;
|
|
260
|
-
};
|
|
261
|
-
const remove = (self, node) => {
|
|
262
|
-
if (node.removed) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
node.removed = true;
|
|
266
|
-
if (node.prev !== undefined && node.next !== undefined) {
|
|
267
|
-
node.prev.next = node.next;
|
|
268
|
-
node.next.prev = node.prev;
|
|
269
|
-
} else if (node.prev !== undefined) {
|
|
270
|
-
self.tail = node.prev;
|
|
271
|
-
node.prev.next = undefined;
|
|
272
|
-
} else if (node.next !== undefined) {
|
|
273
|
-
self.head = node.next;
|
|
274
|
-
node.next.prev = undefined;
|
|
275
|
-
} else {
|
|
276
|
-
self.tail = undefined;
|
|
277
|
-
self.head = undefined;
|
|
278
|
-
}
|
|
279
|
-
if (self._length > 0) {
|
|
280
|
-
self._length -= 1;
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* @since 2.0.0
|
|
286
|
-
*/
|
|
287
|
-
const TypeId = /*#__PURE__*/Symbol.for("effect/MutableQueue");
|
|
288
|
-
/**
|
|
289
|
-
* @since 2.0.0
|
|
290
|
-
* @category symbol
|
|
291
|
-
*/
|
|
292
|
-
const EmptyMutableQueue = /*#__PURE__*/Symbol.for("effect/mutable/MutableQueue/Empty");
|
|
293
|
-
const MutableQueueProto = {
|
|
294
|
-
[TypeId]: TypeId,
|
|
295
|
-
[Symbol.iterator]() {
|
|
296
|
-
return Array.from(this.queue)[Symbol.iterator]();
|
|
297
|
-
},
|
|
298
|
-
toString() {
|
|
299
|
-
return format(this.toJSON());
|
|
300
|
-
},
|
|
301
|
-
toJSON() {
|
|
302
|
-
return {
|
|
303
|
-
_id: "MutableQueue",
|
|
304
|
-
values: Array.from(this).map(toJSON)
|
|
305
|
-
};
|
|
306
|
-
},
|
|
307
|
-
[NodeInspectSymbol]() {
|
|
308
|
-
return this.toJSON();
|
|
309
|
-
},
|
|
310
|
-
pipe() {
|
|
311
|
-
return pipeArguments(this, arguments);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const make = capacity => {
|
|
315
|
-
const queue = Object.create(MutableQueueProto);
|
|
316
|
-
queue.queue = empty();
|
|
317
|
-
queue.capacity = capacity;
|
|
318
|
-
return queue;
|
|
319
|
-
};
|
|
320
|
-
/**
|
|
321
|
-
* Creates a new bounded `MutableQueue`.
|
|
322
|
-
*
|
|
323
|
-
* @since 2.0.0
|
|
324
|
-
* @category constructors
|
|
325
|
-
*/
|
|
326
|
-
const bounded = capacity => make(capacity);
|
|
327
|
-
/**
|
|
328
|
-
* Creates a new unbounded `MutableQueue`.
|
|
329
|
-
*
|
|
330
|
-
* @since 2.0.0
|
|
331
|
-
* @category constructors
|
|
332
|
-
*/
|
|
333
|
-
const unbounded = () => make(undefined);
|
|
334
|
-
/**
|
|
335
|
-
* Returns the current number of elements in the queue.
|
|
336
|
-
*
|
|
337
|
-
* @since 2.0.0
|
|
338
|
-
* @category getters
|
|
339
|
-
*/
|
|
340
|
-
const length = self => length$1(self.queue);
|
|
341
|
-
/**
|
|
342
|
-
* Returns `true` if the queue is empty, `false` otherwise.
|
|
343
|
-
*
|
|
344
|
-
* @since 2.0.0
|
|
345
|
-
* @category getters
|
|
346
|
-
*/
|
|
347
|
-
const isEmpty = self => isEmpty$1(self.queue);
|
|
348
|
-
/**
|
|
349
|
-
* The **maximum** number of elements that a queue can hold.
|
|
350
|
-
*
|
|
351
|
-
* **Note**: unbounded queues can still implement this interface with
|
|
352
|
-
* `capacity = Infinity`.
|
|
353
|
-
*
|
|
354
|
-
* @since 2.0.0
|
|
355
|
-
* @category getters
|
|
356
|
-
*/
|
|
357
|
-
const capacity = self => self.capacity === undefined ? Infinity : self.capacity;
|
|
358
|
-
/**
|
|
359
|
-
* Offers an element to the queue.
|
|
360
|
-
*
|
|
361
|
-
* Returns whether the enqueue was successful or not.
|
|
362
|
-
*
|
|
363
|
-
* @since 2.0.0
|
|
364
|
-
*/
|
|
365
|
-
const offer = /*#__PURE__*/dual(2, (self, value) => {
|
|
366
|
-
const queueLength = length$1(self.queue);
|
|
367
|
-
if (self.capacity !== undefined && queueLength === self.capacity) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
append(value)(self.queue);
|
|
371
|
-
return true;
|
|
372
|
-
});
|
|
373
|
-
/**
|
|
374
|
-
* Enqueues a collection of values into the queue.
|
|
375
|
-
*
|
|
376
|
-
* Returns a `Chunk` of the values that were **not** able to be enqueued.
|
|
377
|
-
*
|
|
378
|
-
* @since 2.0.0
|
|
379
|
-
*/
|
|
380
|
-
const offerAll = /*#__PURE__*/dual(2, (self, values) => {
|
|
381
|
-
const iterator = values[Symbol.iterator]();
|
|
382
|
-
let next;
|
|
383
|
-
let remainder = empty$1();
|
|
384
|
-
let offering = true;
|
|
385
|
-
while (offering && (next = iterator.next()) && !next.done) {
|
|
386
|
-
offering = offer(next.value)(self);
|
|
387
|
-
}
|
|
388
|
-
while (next != null && !next.done) {
|
|
389
|
-
remainder = prepend(next.value)(remainder);
|
|
390
|
-
next = iterator.next();
|
|
391
|
-
}
|
|
392
|
-
return reverse(remainder);
|
|
393
|
-
});
|
|
394
|
-
/**
|
|
395
|
-
* Dequeues an element from the queue.
|
|
396
|
-
*
|
|
397
|
-
* Returns either an element from the queue, or the `def` param.
|
|
398
|
-
*
|
|
399
|
-
* **Note**: if there is no meaningful default for your type, you can always
|
|
400
|
-
* use `poll(MutableQueue.EmptyMutableQueue)`.
|
|
401
|
-
*
|
|
402
|
-
* @since 2.0.0
|
|
403
|
-
*/
|
|
404
|
-
const poll = /*#__PURE__*/dual(2, (self, def) => {
|
|
405
|
-
if (isEmpty$1(self.queue)) {
|
|
406
|
-
return def;
|
|
407
|
-
}
|
|
408
|
-
return shift(self.queue);
|
|
409
|
-
});
|
|
410
|
-
/**
|
|
411
|
-
* Dequeues up to `n` elements from the queue.
|
|
412
|
-
*
|
|
413
|
-
* Returns a `List` of up to `n` elements.
|
|
414
|
-
*
|
|
415
|
-
* @since 2.0.0
|
|
416
|
-
*/
|
|
417
|
-
const pollUpTo = /*#__PURE__*/dual(2, (self, n) => {
|
|
418
|
-
let result = empty$1();
|
|
419
|
-
let count = 0;
|
|
420
|
-
while (count < n) {
|
|
421
|
-
const element = poll(EmptyMutableQueue)(self);
|
|
422
|
-
if (element === EmptyMutableQueue) {
|
|
423
|
-
break;
|
|
424
|
-
}
|
|
425
|
-
result = prepend(element)(result);
|
|
426
|
-
count += 1;
|
|
427
|
-
}
|
|
428
|
-
return reverse(result);
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
export { zip as A, isSuccess as B, EmptyMutableQueue as E, _await as _, unbounded as a, pollUpTo as b, isEmpty as c, done as d, offerAll as e, bounded as f, capacity as g, isFailure as h, interrupt as i, failCause as j, all as k, length as l, match as m, die as n, offer as o, poll as p, map as q, make$1 as r, succeed as s, isDone as t, unsafeMake as u, void_ as v, succeed$1 as w, failCause$1 as x, fail as y, zipRight as z };
|