@tempots/beatui 0.33.0 → 0.35.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/{2019-Bl8v8fjU.cjs → 2019-DJeW9RI7.cjs} +1 -1
- package/dist/{2019-CKKsQZIa.js → 2019-Dmseo7Cq.js} +2 -2
- package/dist/{2020-BsHmbyBy.cjs → 2020-BySxLQc5.cjs} +1 -1
- package/dist/{2020-BqcGkd5L.js → 2020-I1mnGGtD.js} +2 -2
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/beatui.css +127 -16
- package/dist/beatui.tailwind.css +127 -16
- package/dist/hls-B7ZdiUxL.js +21734 -0
- package/dist/hls-C6lKM-CG.cjs +40 -0
- package/dist/{index-BXjEbt8G.js → index-C2rz3G1d.js} +1886 -1874
- package/dist/{index-BTbThGQK.cjs → index-CBc0q0zl.cjs} +2 -2
- package/dist/{index-BBIdmCak.cjs → index-CCu0qfNP.cjs} +1 -1
- package/dist/{index-HIb25Ti2.cjs → index-CZQHL_pf.cjs} +21 -21
- package/dist/{index-xdCnysNz.js → index-C_nSdynJ.js} +1 -1
- package/dist/{index-CvOeci8Y.cjs → index-Ct2_ulan.cjs} +1 -1
- package/dist/{index-DKPyYQwK.js → index-D-CBfcZj.js} +3 -3
- package/dist/{index-CiVTODdZ.js → index-DbQzJti7.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2239 -1778
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{modal-C3d-SRPh.cjs → modal-AFhB4rIq.cjs} +1 -1
- package/dist/{modal-BnY6iGcL.js → modal-Dm61yY5i.js} +1 -1
- package/dist/monaco/index.cjs.js +1 -1
- package/dist/monaco/index.es.js +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/timer-DK_yKNwE.cjs +1 -0
- package/dist/timer-DzWb416P.js +51 -0
- package/dist/types/components/content/native-pdf-preview.d.ts +12 -2
- package/dist/types/components/media/base-video-player.d.ts +77 -0
- package/dist/types/components/media/index.d.ts +1 -0
- package/dist/types/components/overlay/index.d.ts +1 -0
- package/dist/types/components/overlay/lightbox.d.ts +22 -0
- package/dist/types/components/overlay/ribbon.d.ts +5 -2
- package/dist/types/components/prosemirror/prosemirror-markdown-input.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/{utils-BoajYXEP.cjs → utils-BetBqtiV.cjs} +1 -1
- package/dist/{utils-Dl44PfbT.js → utils-g5YCiiS6.js} +1 -1
- package/package.json +3 -1
- package/dist/timer-BdH4cK6a.cjs +0 -1
- package/dist/timer-CQlK5LhW.js +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-CBc0q0zl.cjs");exports.JSONSchemaAllOf=e.JSONSchemaAllOf;exports.JSONSchemaAny=e.JSONSchemaAny;exports.JSONSchemaAnyOf=e.JSONSchemaAnyOf;exports.JSONSchemaArray=e.JSONSchemaArray;exports.JSONSchemaBoolean=e.JSONSchemaBoolean;exports.JSONSchemaConst=e.JSONSchemaConst;exports.JSONSchemaControl=e.JSONSchemaControl;exports.JSONSchemaEnum=e.JSONSchemaEnum;exports.JSONSchemaForm=e.JSONSchemaForm;exports.JSONSchemaGenericControl=e.JSONSchemaGenericControl;exports.JSONSchemaInteger=e.JSONSchemaInteger;exports.JSONSchemaNull=e.JSONSchemaNull;exports.JSONSchemaNumber=e.JSONSchemaNumber;exports.JSONSchemaObject=e.JSONSchemaObject;exports.JSONSchemaOneOf=e.JSONSchemaOneOf;exports.JSONSchemaString=e.JSONSchemaString;exports.JSONSchemaUnion=e.JSONSchemaUnion;exports.SchemaContext=e.SchemaContext;exports.ajvErrorsToControllerValidation=e.ajvErrorsToControllerValidation;exports.ajvErrorsToDependencies=e.ajvErrorsToDependencies;exports.buildMessage=e.buildMessage;exports.buildPath=e.buildPath;exports.clearCaches=e.clearCaches;exports.clearCachesForAjv=e.clearCachesForAjv;exports.compileWithCache=e.compileWithCache;exports.composeEffectiveObjectSchema=e.composeEffectiveObjectSchema;exports.createAJVStandardSchema=e.createAJVStandardSchema;exports.evaluateIfThenElseOverlay=e.evaluateIfThenElseOverlay;exports.evaluateNotViolation=e.evaluateNotViolation;exports.getAjvForSchema=e.getAjvForSchema;exports.getCacheStats=e.getCacheStats;exports.getEvaluatedProperties=e.getEvaluatedProperties;exports.jsonPointerToSegments=e.jsonPointerToSegments;exports.mergeAllOf=e.mergeAllOf;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as s, J as S, T as c, P as o, N as t, I as r, X as m, H as h, Y as O, W as n, L as l, O as N, K as J, Q as i, U as v, M as C, R as u, S as A, w as f, v as g, u as d, t as j, x as E, y as b, A as p, E as y, Z as T, F, D as P, B as V, z as x, G as I, s as B, C as D } from "../index-
|
|
1
|
+
import { V as s, J as S, T as c, P as o, N as t, I as r, X as m, H as h, Y as O, W as n, L as l, O as N, K as J, Q as i, U as v, M as C, R as u, S as A, w as f, v as g, u as d, t as j, x as E, y as b, A as p, E as y, Z as T, F, D as P, B as V, z as x, G as I, s as B, C as D } from "../index-D-CBfcZj.js";
|
|
2
2
|
export {
|
|
3
3
|
s as JSONSchemaAllOf,
|
|
4
4
|
S as JSONSchemaAny,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("@tempots/dom"),w=require("./timer-BdH4cK6a.cjs"),$=require("./notice-len8sDjL.cjs"),V=require("./translations-DQxg-W9w.cjs"),W=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function _(r){return Array.from(r.querySelectorAll(W)).filter(t=>{const s=t;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function B(r={}){const{active:t=!0,escapeDeactivates:s=!0,onEscape:e,initialFocus:a,returnFocus:i,clickOutsideDeactivates:c=!1,onClickOutside:d}=r;return o.WithElement(h=>{let f=t,m=null,u=[];typeof document<"u"&&(m=document.activeElement);const b=()=>{u=_(h)},g=n=>{if(f){if(s&&n.key==="Escape"){n.preventDefault(),e?.();return}if(n.key==="Tab"){if(b(),u.length===0){n.preventDefault();return}const v=u.indexOf(document.activeElement);n.shiftKey?v<=0&&(n.preventDefault(),u[u.length-1]?.focus()):v>=u.length-1&&(n.preventDefault(),u[0]?.focus())}}},p=n=>{if(!f||!c)return;const v=n.target;h.contains(v)||d?.()},y=()=>{if(!f)return;b();let n=null;typeof a=="function"?n=a():a?n=a:u.length>0&&(n=u[0]),n&&setTimeout(()=>{n?.focus()},50),document.addEventListener("keydown",g,!0),c&&document.addEventListener("click",p,!0)},T=()=>{f=!1,document.removeEventListener("keydown",g,!0),document.removeEventListener("click",p,!0);let n=null;typeof i=="function"?n=i():i?n=i:m&&(n=m),n&&document.body.contains(n)&&setTimeout(()=>{n?.focus()},0)};return setTimeout(()=>y(),0),o.OnDispose(()=>{T()})})}function P(r={}){return{activate:()=>B({...r,active:!0}),deactivate:()=>B({...r,active:!1})}}function F({initialStatus:r="closed",openedAfter:t,closedAfter:s}){const e=o.prop(r),a=()=>{e.set("start-opening")},i=()=>{e.set("start-closing")},c=e.map(n=>n!=="closed"&&n!=="start-closing"&&n!=="closing"),d=n=>{n?a():i()},h=()=>{d(!c.value)},f=n=>e.on(v=>{v==="closed"&&n()});let m=()=>{};e.on(n=>{switch(m(),n){case"start-opening":m=w.g(()=>e.set("opening"));break;case"opening":m=t(()=>e.set("opened"));break;case"start-closing":m=w.g(()=>e.set("closing"));break;case"closing":m=s(()=>e.set("closed"));break}}),e.onDispose(()=>m());const u=e.map(n=>n==="closed"),b=e.map(n=>n==="start-opening"),g=e.map(n=>n==="opening"),p=e.map(n=>n==="opened"),y=e.map(n=>n==="closing"),T=e.map(n=>n==="start-closing");return{status:e,open:a,close:i,toggle:h,setOpen:d,display:c,isClosed:u,isStartOpening:b,isOpening:g,isOpened:p,isClosing:y,isStartClosing:T,dispose:()=>e.dispose(),onClosed:f}}function U({initialStatus:r="closed",duration:t,openDuration:s=t??500,closeDuration:e=t??500}={}){return F({initialStatus:r,openedAfter:a=>w.T(a,s),closedAfter:a=>w.T(a,e)})}function q(r,t){let s=!1,e=null;function a(){s||(s=!0,e&&(clearTimeout(e),e=null),t())}function i(f){f.target===r&&a()}function c(f){f.target===r&&a()}const d=()=>{if(typeof r.getAnimations>"u"){e=setTimeout(a,16);return}r.getAnimations().length===0?(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}),e=setTimeout(a,1e3)):(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}))},h=w.g(d);return()=>{s=!0,h(),e&&(clearTimeout(e),e=null),r.removeEventListener("transitionend",i),r.removeEventListener("animationend",c)}}function M({initialStatus:r="closed",element:t}={}){let s=t;return{setElement:e=>{s=e},...F({initialStatus:r,openedAfter:e=>s==null?(e(),()=>{}):q(s,e),closedAfter:e=>s==null?(e(),()=>{}):q(s,e)})}}function z(r,t){return o.attr.class(o.computedOf(r,t)((s,e)=>`bc-toggle--animated bc-toggle--${s} bc-toggle--${e}`))}function D(r){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const e=r.validate(s);return e.success?{value:e.data}:{issues:e.errors.map(a=>({message:a.message,path:a.path}))}},types:void 0},safeParse:s=>{const e=r.validate(s);return e.success?{success:!0,data:e.data}:{success:!1,error:{errors:e.errors.map(a=>({message:a.message,path:a.path?.map(i=>typeof i=="object"&&"key"in i?i.key.toString():i.toString())||[]}))}}}}}class x{optional(){return new R(this)}default(t){return new H(this,t)}schema(){return D(this)}}class C extends x{minLength;maxLength;pattern;customValidations=[];validate(t){if(typeof t!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&t.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&t.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(t)&&s.push({message:"Invalid format"});for(const e of this.customValidations){const a=e(t);a&&s.push({message:a})}return s.length>0?{success:!1,errors:s}:{success:!0,data:t}}min(t,s){const e=new C;return e.minLength=t,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length<t?s:null),e}max(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=t,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length>t?s:null),e}regex(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=t,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>t.test(a)?null:s),e}email(t="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations,a=>s.test(a)?null:t],e}refine(t){const s=new C;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,t],s}}class A extends x{mustBeTrue=!1;trueMessage;validate(t){return typeof t!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&t!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:t}}refine(t,s){const e=new A;e.mustBeTrue=this.mustBeTrue,e.trueMessage=this.trueMessage;const a=e.validate.bind(e);return e.validate=i=>{const c=a(i);return c.success?t(c.data)?c:{success:!1,errors:[{message:s}]}:c},e}literal(t,s){const e=new A;return e.mustBeTrue=!0,e.trueMessage=s,e}}class R extends x{constructor(t){super(),this.inner=t}validate(t){if(t===void 0)return{success:!0,data:void 0};const s=this.inner.validate(t);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class H extends x{constructor(t,s){super(),this.inner=t,this.defaultValue=s}validate(t){return t===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(t)}}class O extends x{constructor(t){super(),this.shape=t}validate(t){if(typeof t!="object"||t===null||Array.isArray(t))return{success:!1,errors:[{message:"Expected object"}]};const s=t,e={},a=[];for(const[i,c]of Object.entries(this.shape)){const d=c.validate(s[i]);if(d.success)e[i]=d.data;else for(const h of d.errors)a.push({message:h.message,path:[i,...h.path||[]]})}return a.length>0?{success:!1,errors:a}:{success:!0,data:e}}refine(t,s){const e=new O(this.shape),a=e.validate.bind(e);return e.validate=i=>{const c=a(i);if(!c.success)return c;const d=t(c.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:c.data}},e}}const K=()=>new C,N=()=>new A,G=r=>new O(r);function I(r){return o.WithBrowserCtx(t=>{const s=[],e=()=>s.forEach(i=>i());return r(({effect:i="opaque",mode:c="capturing",onClickOutside:d,onEscape:h,content:f,container:m="body"})=>{m==="body"&&(t=t.makePortal("body"));const u=M();u.onClosed(e);let b=()=>{},g=()=>{};const p=E=>{E.key==="Escape"&&(h?.(),u.close())},y=()=>{d?.(),u.close()},T=E=>{b(),g(),E==="capturing"?(document.addEventListener("keydown",p),b=()=>document.removeEventListener("keydown",p),t.element.addEventListener("mousedown",y),g=()=>t.element.removeEventListener("mousedown",y)):(b=()=>{},g=()=>{})},n=o.Value.on(c,T);s.push(n),s.push(()=>{b(),g()});const v=()=>{const E=new Set;for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))l.hasAttribute("inert")?E.add(l):l.setAttribute("inert","");return s.push(()=>{for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))E.has(l)||l.removeAttribute("inert");E.clear()}),document.activeElement?.blur?.(),o.html.div(o.WithElement(l=>u.setElement(l)),o.dataAttr.status(u.status.map(String)),o.dataAttr.overlay("true"),o.attr.class(o.computedOf(i??"opaque",c)((l,L)=>`bc-overlay bc-overlay--effect-${l} bc-overlay--mode-${L}`)),f)},k=o.render(v(),t.element,{disposeWithParent:!0,clear:!1,providers:t.providers});s.push(k),w.g(()=>u.open())},e)})}function j(r,t){const{size:s="md",dismissable:e=!0,showCloseButton:a=!0,onClose:i,overlayEffect:c="opaque",container:d="body",position:h="center"}=r;return I((f,m)=>{let u=()=>{};return t(p=>{u=m;const y=o.prop("capturing");o.Value.on(e,l=>{y.set(l?"capturing":"non-capturing")});const T=o.computedOf(p.header!=null,a)((l,L)=>l||L),n=$.sessionId("modal"),v=`${n}-header`,k=`${n}-body`,E=o.html.div(o.attr.class(o.computedOf(s,h)((l,L)=>`bc-modal bc-modal--size-${l} bc-modal--container-${d} bc-modal--position-${L}`)),o.attr.role("dialog"),o.aria.modal(!0),...p.header?[o.aria.labelledby(v)]:[],o.aria.describedby(k),o.attr.tabindex(-1),o.attr.id(n),o.dataAttr.focusTrap("true"),o.on.mousedown(l=>l.stopPropagation()),B({escapeDeactivates:!1,initialFocus:()=>{const l=document.getElementById(n);if(!l)return null;const L=l.querySelector('[aria-label="Close modal"]');if(L)return L;const S=l.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return S||l}}),o.html.div(o.attr.class("bc-modal__content"),o.When(T,()=>o.html.div(o.attr.class("bc-modal__header"),o.html.div(o.attr.class("bc-modal__title"),...p.header?[o.attr.id(v)]:[],p.header),o.When(a,()=>o.Use(V.BeatUII18n,l=>$.CloseButton({size:"sm",label:l.$.closeModal,onClick:()=>{u(),m()}}))))),o.html.div(o.attr.class("bc-modal__body"),o.attr.id(k),p.body),p.footer&&o.html.div(o.attr.class("bc-modal__footer"),p.footer)));f({mode:y,effect:c??"opaque",container:d,content:E,onClickOutside:()=>{i?.(),m()},onEscape:()=>{i?.(),m()}})},()=>{u(),m()})})}function J(r,t){const{confirmText:s,cancelText:e,onConfirm:a,onCancel:i,...c}=r;return o.Use(V.BeatUII18n,d=>j({showCloseButton:!1,...c},(h,f)=>{const m=()=>{a?.(),f()},u=()=>{i?.(),f()};return t(g=>{h({body:g,footer:o.Fragment(o.attr.class("bc-modal__actions"),V.Button({variant:"outline",onClick:u},o.coalesce(e,d.$.cancel)),V.Button({color:"primary",variant:"filled",onClick:m},o.coalesce(s,d.$.confirm)))})},f)}))}exports.AnimatedToggleClass=z;exports.BooleanValidator=A;exports.ConfirmModal=J;exports.FocusTrap=B;exports.Modal=j;exports.ObjectValidator=O;exports.Overlay=I;exports.StringValidator=C;exports.boolean=N;exports.createStandardSchema=D;exports.object=G;exports.string=K;exports.useAnimatedElementToggle=M;exports.useAnimatedToggle=F;exports.useFocusTrap=P;exports.useTimedToggle=U;
|
|
1
|
+
"use strict";const o=require("@tempots/dom"),w=require("./timer-DK_yKNwE.cjs"),$=require("./notice-len8sDjL.cjs"),V=require("./translations-DQxg-W9w.cjs"),W=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function _(r){return Array.from(r.querySelectorAll(W)).filter(t=>{const s=t;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function B(r={}){const{active:t=!0,escapeDeactivates:s=!0,onEscape:e,initialFocus:a,returnFocus:i,clickOutsideDeactivates:c=!1,onClickOutside:d}=r;return o.WithElement(h=>{let f=t,m=null,u=[];typeof document<"u"&&(m=document.activeElement);const b=()=>{u=_(h)},g=n=>{if(f){if(s&&n.key==="Escape"){n.preventDefault(),e?.();return}if(n.key==="Tab"){if(b(),u.length===0){n.preventDefault();return}const v=u.indexOf(document.activeElement);n.shiftKey?v<=0&&(n.preventDefault(),u[u.length-1]?.focus()):v>=u.length-1&&(n.preventDefault(),u[0]?.focus())}}},p=n=>{if(!f||!c)return;const v=n.target;h.contains(v)||d?.()},y=()=>{if(!f)return;b();let n=null;typeof a=="function"?n=a():a?n=a:u.length>0&&(n=u[0]),n&&setTimeout(()=>{n?.focus()},50),document.addEventListener("keydown",g,!0),c&&document.addEventListener("click",p,!0)},T=()=>{f=!1,document.removeEventListener("keydown",g,!0),document.removeEventListener("click",p,!0);let n=null;typeof i=="function"?n=i():i?n=i:m&&(n=m),n&&document.body.contains(n)&&setTimeout(()=>{n?.focus()},0)};return setTimeout(()=>y(),0),o.OnDispose(()=>{T()})})}function P(r={}){return{activate:()=>B({...r,active:!0}),deactivate:()=>B({...r,active:!1})}}function F({initialStatus:r="closed",openedAfter:t,closedAfter:s}){const e=o.prop(r),a=()=>{e.set("start-opening")},i=()=>{e.set("start-closing")},c=e.map(n=>n!=="closed"&&n!=="start-closing"&&n!=="closing"),d=n=>{n?a():i()},h=()=>{d(!c.value)},f=n=>e.on(v=>{v==="closed"&&n()});let m=()=>{};e.on(n=>{switch(m(),n){case"start-opening":m=w.g(()=>e.set("opening"));break;case"opening":m=t(()=>e.set("opened"));break;case"start-closing":m=w.g(()=>e.set("closing"));break;case"closing":m=s(()=>e.set("closed"));break}}),e.onDispose(()=>m());const u=e.map(n=>n==="closed"),b=e.map(n=>n==="start-opening"),g=e.map(n=>n==="opening"),p=e.map(n=>n==="opened"),y=e.map(n=>n==="closing"),T=e.map(n=>n==="start-closing");return{status:e,open:a,close:i,toggle:h,setOpen:d,display:c,isClosed:u,isStartOpening:b,isOpening:g,isOpened:p,isClosing:y,isStartClosing:T,dispose:()=>e.dispose(),onClosed:f}}function U({initialStatus:r="closed",duration:t,openDuration:s=t??500,closeDuration:e=t??500}={}){return F({initialStatus:r,openedAfter:a=>w.T(a,s),closedAfter:a=>w.T(a,e)})}function q(r,t){let s=!1,e=null;function a(){s||(s=!0,e&&(clearTimeout(e),e=null),t())}function i(f){f.target===r&&a()}function c(f){f.target===r&&a()}const d=()=>{if(typeof r.getAnimations>"u"){e=setTimeout(a,16);return}r.getAnimations().length===0?(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}),e=setTimeout(a,1e3)):(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}))},h=w.g(d);return()=>{s=!0,h(),e&&(clearTimeout(e),e=null),r.removeEventListener("transitionend",i),r.removeEventListener("animationend",c)}}function M({initialStatus:r="closed",element:t}={}){let s=t;return{setElement:e=>{s=e},...F({initialStatus:r,openedAfter:e=>s==null?(e(),()=>{}):q(s,e),closedAfter:e=>s==null?(e(),()=>{}):q(s,e)})}}function z(r,t){return o.attr.class(o.computedOf(r,t)((s,e)=>`bc-toggle--animated bc-toggle--${s} bc-toggle--${e}`))}function D(r){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const e=r.validate(s);return e.success?{value:e.data}:{issues:e.errors.map(a=>({message:a.message,path:a.path}))}},types:void 0},safeParse:s=>{const e=r.validate(s);return e.success?{success:!0,data:e.data}:{success:!1,error:{errors:e.errors.map(a=>({message:a.message,path:a.path?.map(i=>typeof i=="object"&&"key"in i?i.key.toString():i.toString())||[]}))}}}}}class x{optional(){return new R(this)}default(t){return new H(this,t)}schema(){return D(this)}}class C extends x{minLength;maxLength;pattern;customValidations=[];validate(t){if(typeof t!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&t.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&t.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(t)&&s.push({message:"Invalid format"});for(const e of this.customValidations){const a=e(t);a&&s.push({message:a})}return s.length>0?{success:!1,errors:s}:{success:!0,data:t}}min(t,s){const e=new C;return e.minLength=t,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length<t?s:null),e}max(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=t,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length>t?s:null),e}regex(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=t,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>t.test(a)?null:s),e}email(t="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations,a=>s.test(a)?null:t],e}refine(t){const s=new C;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,t],s}}class A extends x{mustBeTrue=!1;trueMessage;validate(t){return typeof t!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&t!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:t}}refine(t,s){const e=new A;e.mustBeTrue=this.mustBeTrue,e.trueMessage=this.trueMessage;const a=e.validate.bind(e);return e.validate=i=>{const c=a(i);return c.success?t(c.data)?c:{success:!1,errors:[{message:s}]}:c},e}literal(t,s){const e=new A;return e.mustBeTrue=!0,e.trueMessage=s,e}}class R extends x{constructor(t){super(),this.inner=t}validate(t){if(t===void 0)return{success:!0,data:void 0};const s=this.inner.validate(t);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class H extends x{constructor(t,s){super(),this.inner=t,this.defaultValue=s}validate(t){return t===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(t)}}class O extends x{constructor(t){super(),this.shape=t}validate(t){if(typeof t!="object"||t===null||Array.isArray(t))return{success:!1,errors:[{message:"Expected object"}]};const s=t,e={},a=[];for(const[i,c]of Object.entries(this.shape)){const d=c.validate(s[i]);if(d.success)e[i]=d.data;else for(const h of d.errors)a.push({message:h.message,path:[i,...h.path||[]]})}return a.length>0?{success:!1,errors:a}:{success:!0,data:e}}refine(t,s){const e=new O(this.shape),a=e.validate.bind(e);return e.validate=i=>{const c=a(i);if(!c.success)return c;const d=t(c.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:c.data}},e}}const K=()=>new C,N=()=>new A,G=r=>new O(r);function I(r){return o.WithBrowserCtx(t=>{const s=[],e=()=>s.forEach(i=>i());return r(({effect:i="opaque",mode:c="capturing",onClickOutside:d,onEscape:h,content:f,container:m="body"})=>{m==="body"&&(t=t.makePortal("body"));const u=M();u.onClosed(e);let b=()=>{},g=()=>{};const p=E=>{E.key==="Escape"&&(h?.(),u.close())},y=()=>{d?.(),u.close()},T=E=>{b(),g(),E==="capturing"?(document.addEventListener("keydown",p),b=()=>document.removeEventListener("keydown",p),t.element.addEventListener("mousedown",y),g=()=>t.element.removeEventListener("mousedown",y)):(b=()=>{},g=()=>{})},n=o.Value.on(c,T);s.push(n),s.push(()=>{b(),g()});const v=()=>{const E=new Set;for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))l.hasAttribute("inert")?E.add(l):l.setAttribute("inert","");return s.push(()=>{for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))E.has(l)||l.removeAttribute("inert");E.clear()}),document.activeElement?.blur?.(),o.html.div(o.WithElement(l=>u.setElement(l)),o.dataAttr.status(u.status.map(String)),o.dataAttr.overlay("true"),o.attr.class(o.computedOf(i??"opaque",c)((l,L)=>`bc-overlay bc-overlay--effect-${l} bc-overlay--mode-${L}`)),f)},k=o.render(v(),t.element,{disposeWithParent:!0,clear:!1,providers:t.providers});s.push(k),w.g(()=>u.open())},e)})}function j(r,t){const{size:s="md",dismissable:e=!0,showCloseButton:a=!0,onClose:i,overlayEffect:c="opaque",container:d="body",position:h="center"}=r;return I((f,m)=>{let u=()=>{};return t(p=>{u=m;const y=o.prop("capturing");o.Value.on(e,l=>{y.set(l?"capturing":"non-capturing")});const T=o.computedOf(p.header!=null,a)((l,L)=>l||L),n=$.sessionId("modal"),v=`${n}-header`,k=`${n}-body`,E=o.html.div(o.attr.class(o.computedOf(s,h)((l,L)=>`bc-modal bc-modal--size-${l} bc-modal--container-${d} bc-modal--position-${L}`)),o.attr.role("dialog"),o.aria.modal(!0),...p.header?[o.aria.labelledby(v)]:[],o.aria.describedby(k),o.attr.tabindex(-1),o.attr.id(n),o.dataAttr.focusTrap("true"),o.on.mousedown(l=>l.stopPropagation()),B({escapeDeactivates:!1,initialFocus:()=>{const l=document.getElementById(n);if(!l)return null;const L=l.querySelector('[aria-label="Close modal"]');if(L)return L;const S=l.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return S||l}}),o.html.div(o.attr.class("bc-modal__content"),o.When(T,()=>o.html.div(o.attr.class("bc-modal__header"),o.html.div(o.attr.class("bc-modal__title"),...p.header?[o.attr.id(v)]:[],p.header),o.When(a,()=>o.Use(V.BeatUII18n,l=>$.CloseButton({size:"sm",label:l.$.closeModal,onClick:()=>{u(),m()}}))))),o.html.div(o.attr.class("bc-modal__body"),o.attr.id(k),p.body),p.footer&&o.html.div(o.attr.class("bc-modal__footer"),p.footer)));f({mode:y,effect:c??"opaque",container:d,content:E,onClickOutside:()=>{i?.(),m()},onEscape:()=>{i?.(),m()}})},()=>{u(),m()})})}function J(r,t){const{confirmText:s,cancelText:e,onConfirm:a,onCancel:i,...c}=r;return o.Use(V.BeatUII18n,d=>j({showCloseButton:!1,...c},(h,f)=>{const m=()=>{a?.(),f()},u=()=>{i?.(),f()};return t(g=>{h({body:g,footer:o.Fragment(o.attr.class("bc-modal__actions"),V.Button({variant:"outline",onClick:u},o.coalesce(e,d.$.cancel)),V.Button({color:"primary",variant:"filled",onClick:m},o.coalesce(s,d.$.confirm)))})},f)}))}exports.AnimatedToggleClass=z;exports.BooleanValidator=A;exports.ConfirmModal=J;exports.FocusTrap=B;exports.Modal=j;exports.ObjectValidator=O;exports.Overlay=I;exports.StringValidator=C;exports.boolean=N;exports.createStandardSchema=D;exports.object=G;exports.string=K;exports.useAnimatedElementToggle=M;exports.useAnimatedToggle=F;exports.useFocusTrap=P;exports.useTimedToggle=U;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WithElement as P, OnDispose as K, prop as W, attr as h, computedOf as A, WithBrowserCtx as N, Value as z, render as G, html as k, dataAttr as O, aria as F, on as J, When as D, Use as R, Fragment as Q, coalesce as q } from "@tempots/dom";
|
|
2
|
-
import { g as V, T as I } from "./timer-
|
|
2
|
+
import { g as V, T as I } from "./timer-DzWb416P.js";
|
|
3
3
|
import { s as X, C as Y } from "./notice-Cd9ElXwb.js";
|
|
4
4
|
import { a as U, B as j } from "./translations-iam7PITs.js";
|
|
5
5
|
const Z = [
|
package/dist/monaco/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-DK_yKNwE.cjs"),I=require("../link-portal-_tiDFZqh.cjs"),B=require("../theme-Dt6lCAvY.cjs"),p="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/",W=e=>{if(!e||typeof e!="object")return!1;const t=e;return!!(t.editor&&typeof t.editor.create=="function"&&t.languages)};function M(){if(typeof self>"u")return;const e=self.MonacoEnvironment;if(e&&(typeof e.getWorkerUrl=="function"||typeof e.getWorker=="function"))return;const t=()=>{const a=[`self.MonacoEnvironment = { baseUrl: '${p}' };`,`importScripts('${p}vs/base/worker/workerMain.js');`].join(`
|
|
2
2
|
`),i=new Blob([a],{type:"text/javascript"});return URL.createObjectURL(i)};self.MonacoEnvironment={getWorkerUrl(a,i){return t()}}}const F=e=>new Promise((t,a)=>{if(document.querySelector(`script[src="${e}"]`))return t();const s=document.createElement("script");s.src=e,s.async=!0;const l=document.querySelector("script[nonce]")?.getAttribute("nonce");l&&s.setAttribute("nonce",l),s.onload=()=>t(),s.onerror=h=>{console.error("[BeatUI] Failed to load script",e,h),a(new Error(`Failed to load script ${e}`))},document.head.appendChild(s)}),R=async()=>{const e=window;if((!e.require||!e.require.config)&&(await F(`${p}vs/loader.js`),await new Promise(t=>setTimeout(t,100)),!e.require))throw new Error("AMD loader failed to initialize");return e.require.config?.({baseUrl:p,paths:{vs:"vs"}}),e.require},$=async()=>{const e=window;if(e.monaco&&W(e.monaco))return e.monaco;M();const t=await R();if(await new Promise((a,i)=>{const s=setTimeout(()=>i(new Error("Timeout loading editor.main")),3e4);try{t(["vs/editor/editor.main"],()=>{clearTimeout(s),a()},l=>{clearTimeout(s),i(l)})}catch(l){clearTimeout(s),i(l)}}),!e.monaco)throw new Error("Monaco failed to initialize after loading editor.main");return e.monaco};let w=null;const v=new Map;let g=!1;async function S(){if(w)return w;!g&&typeof window<"u"&&(M(),g=!0);const e=await $();return w=e,e}async function _(e){if(v.has(e))return v.get(e);const t=(async()=>{const a=await S();switch(e){case"typescript":case"javascript":{a.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),a.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1});break}case"json":{a.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[],enableSchemaRequest:!0});break}case"css":case"scss":case"less":{a.languages.css.cssDefaults.setOptions({validate:!0});break}case"html":break;case"markdown":break;case"yaml":{a.languages.getLanguages().some(s=>s.id==="yaml")||a.languages.register({id:"yaml",extensions:[".yml",".yaml"]});break}}})();return v.set(e,t),t}async function O(e){const[t]=await Promise.all([S(),_(e)]);return t}function z(e){if(typeof window>"u")return;const t=window;e?(t.MonacoEnvironment={getWorker:e},g=!0):t.MonacoEnvironment||(M(),g=!0)}const N=e=>{const{value:t,onChange:a,onBlur:i,language:s="plaintext",readOnly:l=!1,editorOptions:h,jsonSchemas:V,autofocus:j,class:q,disabled:D,hasError:C,id:L,name:x,placeholder:P}=e,b=o.Value.toSignal(l);return o.Use(B.Theme,({appearance:T})=>o.html.div((e.cssInjection??"none")==="none"?null:o.Task(()=>Promise.resolve().then(()=>require("../styles-url-CZUL_YRT.cjs")),({default:u})=>I.LinkPortal({id:"beatui-monaco-css",href:u})),o.attr.class("bc-monaco-editor-container"),o.attr.class(q),o.attr.class(o.Value.map(C??!1,u=>u?"bc-input-container--error":"")),o.attr.id(L),o.attr.name(x),o.WithElement(u=>{let m=null;const c=[];return(async()=>{try{let d=function(){const n=r.getValue();a?.(n)};const f=o.Value.get(s)??"plaintext";if(m=(await O(f)).editor.create(u,{value:o.Value.get(t)??"",language:f,readOnly:o.Value.get(b)??!1,automaticLayout:!0,minimap:{enabled:!1},...h??{}}),!m)throw new Error("Failed to create Monaco editor");const r=m;c.push(o.effectOf(s,V)(async(n,y)=>{const E=await O(n);if(n==="json"){const U={validate:!0,enableSchemaRequest:!0,schemas:!!(y&&y.length)?y:[]};E.languages.json.jsonDefaults.setDiagnosticsOptions(U)}const k=r.getModel();k&&E.editor.setModelLanguage(k,n)})),c.push(r.onDidChangeModelContent(A.I(500,d)).dispose),c.push(r.onDidBlurEditorText(()=>{d(),i?.()}).dispose),c.push(o.Value.on(t,n=>{n!==r.getValue()&&r.setValue(n??"")})),c.push(o.Value.on(b,n=>{r.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(D??!1,n=>{r.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(j??!1,n=>{n&&r.focus()})),c.push(o.Value.on(P??"",n=>{r.updateOptions({placeholder:n??""})})),c.push(T.on(n=>{r.updateOptions({theme:n==="dark"?"vs-dark":"vs"})}))}catch(d){console.error("[BeatUI] Failed to initialize Monaco editor:",d);const f=u;f.textContent="Failed to load Monaco Editor. Please ensure monaco-editor is installed."}})(),o.OnDispose(()=>{try{c.forEach(d=>d())}catch{}try{m?.dispose()}catch{}})})))};exports.MonacoEditorInput=N;exports.configureMonacoEnvironment=z;
|
package/dist/monaco/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Value as c, Use as B, html as I, Task as W, attr as m, WithElement as F, OnDispose as R, effectOf as $ } from "@tempots/dom";
|
|
2
|
-
import { I as _ } from "../timer-
|
|
2
|
+
import { I as _ } from "../timer-DzWb416P.js";
|
|
3
3
|
import { L as z } from "../link-portal-Cr2l9f3k.js";
|
|
4
4
|
import { T as N } from "../theme-B5pmbvQ_.js";
|
|
5
5
|
const g = "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/", G = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index-CZQHL_pf.cjs");exports.DEFAULT_FEATURES=r.DEFAULT_FEATURES;exports.ProseMirrorMarkdownInput=r.ProseMirrorMarkdownInput;exports.ProseMirrorToolbar=r.ProseMirrorToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=(t,n)=>{const e=setTimeout(t,n);return()=>clearTimeout(e)},I=(t,n)=>{const e=setInterval(t,n);return()=>clearInterval(e)};function w(t,n,e={}){const{noTrailing:i=!1,noLeading:r=!1,debounceMode:l}=e;let o,f=!1,a=0;function m(){o&&clearTimeout(o)}function v(c){const{upcomingOnly:s=!1}=c||{};m(),f=!s}function d(...c){if(f)return;const s=this,T=Date.now()-a;function u(){a=Date.now(),n.apply(s,c)}function g(){o=void 0}!r&&l&&!o&&u(),m(),l===void 0&&T>t?r?(a=Date.now(),i||(o=setTimeout(l?g:u,t))):u():i||(o=setTimeout(l?g:u,l===void 0?Math.max(0,t-T):t))}return d.cancel=v,d}function x(t,n,{atBegin:e=!1}={}){return w(t,n,{debounceMode:e!==!1})}const A=t=>{let n=null;const e=i=>{n=null,t(i)};return n==null&&(n=requestAnimationFrame(e)),()=>{n!=null&&(cancelAnimationFrame(n),n=null)}};exports.I=x;exports.T=p;exports.g=A;exports.x=I;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const w = (e, n) => {
|
|
2
|
+
const t = setTimeout(e, n);
|
|
3
|
+
return () => clearTimeout(t);
|
|
4
|
+
}, x = (e, n) => {
|
|
5
|
+
const t = setInterval(e, n);
|
|
6
|
+
return () => clearInterval(t);
|
|
7
|
+
};
|
|
8
|
+
function p(e, n, t = {}) {
|
|
9
|
+
const { noTrailing: a = !1, noLeading: s = !1, debounceMode: l } = t;
|
|
10
|
+
let o, f = !1, u = 0;
|
|
11
|
+
function m() {
|
|
12
|
+
o && clearTimeout(o);
|
|
13
|
+
}
|
|
14
|
+
function g(c) {
|
|
15
|
+
const { upcomingOnly: r = !1 } = c || {};
|
|
16
|
+
m(), f = !r;
|
|
17
|
+
}
|
|
18
|
+
function d(...c) {
|
|
19
|
+
if (f) return;
|
|
20
|
+
const r = this, T = Date.now() - u;
|
|
21
|
+
function i() {
|
|
22
|
+
u = Date.now(), n.apply(r, c);
|
|
23
|
+
}
|
|
24
|
+
function v() {
|
|
25
|
+
o = void 0;
|
|
26
|
+
}
|
|
27
|
+
!s && l && !o && i(), m(), l === void 0 && T > e ? s ? (u = Date.now(), a || (o = setTimeout(l ? v : i, e))) : i() : a || (o = setTimeout(
|
|
28
|
+
l ? v : i,
|
|
29
|
+
l === void 0 ? Math.max(0, e - T) : e
|
|
30
|
+
));
|
|
31
|
+
}
|
|
32
|
+
return d.cancel = g, d;
|
|
33
|
+
}
|
|
34
|
+
function A(e, n, { atBegin: t = !1 } = {}) {
|
|
35
|
+
return p(e, n, { debounceMode: t !== !1 });
|
|
36
|
+
}
|
|
37
|
+
const D = (e) => {
|
|
38
|
+
let n = null;
|
|
39
|
+
const t = (a) => {
|
|
40
|
+
n = null, e(a);
|
|
41
|
+
};
|
|
42
|
+
return n == null && (n = requestAnimationFrame(t)), () => {
|
|
43
|
+
n != null && (cancelAnimationFrame(n), n = null);
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
A as I,
|
|
48
|
+
w as T,
|
|
49
|
+
D as g,
|
|
50
|
+
x
|
|
51
|
+
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { Value } from '@tempots/dom';
|
|
2
|
-
export
|
|
2
|
+
export interface NativePdfPreviewOptions {
|
|
3
|
+
/** PDF content blob */
|
|
3
4
|
content: Value<Blob>;
|
|
4
|
-
|
|
5
|
+
/** Show/hide toolbar (Chrome only). Default: true */
|
|
6
|
+
toolbar?: Value<boolean>;
|
|
7
|
+
/** Initial page number to display (Chrome, Firefox, Safari) */
|
|
8
|
+
page?: Value<number>;
|
|
9
|
+
/** Zoom level in percentage (Chrome, Firefox). Example: 150 for 150% */
|
|
10
|
+
zoom?: Value<number>;
|
|
11
|
+
/** Zoom fit mode (Chrome only). FitV=vertical, FitH=horizontal, Fit=both */
|
|
12
|
+
view?: Value<'FitV' | 'FitH' | 'Fit'>;
|
|
13
|
+
}
|
|
14
|
+
export declare function NativePdfPreview({ content, toolbar, page, zoom, view, }: NativePdfPreviewOptions): import("@tempots/dom").Renderable;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Renderable, Value } from '@tempots/dom';
|
|
2
|
+
export type BaseVideoProgress = {
|
|
3
|
+
played: number;
|
|
4
|
+
playedSeconds: number;
|
|
5
|
+
loaded: number;
|
|
6
|
+
loadedSeconds: number;
|
|
7
|
+
};
|
|
8
|
+
export type BaseVideoConfig = {
|
|
9
|
+
file?: {
|
|
10
|
+
forceHLS?: boolean;
|
|
11
|
+
attributes?: Record<string, string | number | boolean>;
|
|
12
|
+
};
|
|
13
|
+
hls?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export type BaseVideoPlayerOptions = {
|
|
16
|
+
url: Value<string | null>;
|
|
17
|
+
playing?: Value<boolean>;
|
|
18
|
+
loop?: Value<boolean>;
|
|
19
|
+
controls?: Value<boolean>;
|
|
20
|
+
volume?: Value<number>;
|
|
21
|
+
muted?: Value<boolean>;
|
|
22
|
+
playbackRate?: Value<number>;
|
|
23
|
+
pip?: Value<boolean>;
|
|
24
|
+
playsinline?: Value<boolean>;
|
|
25
|
+
width?: Value<string | number | undefined>;
|
|
26
|
+
height?: Value<string | number | undefined>;
|
|
27
|
+
progressInterval?: Value<number>;
|
|
28
|
+
seekTo?: Value<number | null | undefined>;
|
|
29
|
+
config?: BaseVideoConfig;
|
|
30
|
+
onReady?: () => void;
|
|
31
|
+
onStart?: () => void;
|
|
32
|
+
onPlay?: () => void;
|
|
33
|
+
onPause?: () => void;
|
|
34
|
+
onBuffer?: () => void;
|
|
35
|
+
onBufferEnd?: () => void;
|
|
36
|
+
onEnded?: () => void;
|
|
37
|
+
onError?: (e: unknown) => void;
|
|
38
|
+
onDuration?: (seconds: number) => void;
|
|
39
|
+
onSeek?: (seconds: number) => void;
|
|
40
|
+
onProgress?: (progress: BaseVideoProgress) => void;
|
|
41
|
+
onPlaybackRateChange?: (rate: number) => void;
|
|
42
|
+
onPlaybackQualityChange?: (quality: string) => void;
|
|
43
|
+
};
|
|
44
|
+
type YTPlayerState = {
|
|
45
|
+
PLAYING: number;
|
|
46
|
+
PAUSED: number;
|
|
47
|
+
BUFFERING: number;
|
|
48
|
+
ENDED: number;
|
|
49
|
+
};
|
|
50
|
+
interface YTPlayer {
|
|
51
|
+
loadVideoById: (opts: {
|
|
52
|
+
videoId: string;
|
|
53
|
+
}) => void;
|
|
54
|
+
playVideo: () => void;
|
|
55
|
+
pauseVideo: () => void;
|
|
56
|
+
seekTo: (seconds: number, allowSeekAhead: boolean) => void;
|
|
57
|
+
setPlaybackRate: (rate: number) => void;
|
|
58
|
+
setVolume: (volume: number) => void;
|
|
59
|
+
mute: () => void;
|
|
60
|
+
unMute: () => void;
|
|
61
|
+
getDuration: () => number;
|
|
62
|
+
getCurrentTime: () => number;
|
|
63
|
+
getVideoLoadedFraction: () => number;
|
|
64
|
+
destroy: () => void;
|
|
65
|
+
}
|
|
66
|
+
interface YTNamespace {
|
|
67
|
+
Player: new (el: HTMLElement, opts: unknown) => YTPlayer;
|
|
68
|
+
PlayerState: YTPlayerState;
|
|
69
|
+
}
|
|
70
|
+
declare global {
|
|
71
|
+
interface Window {
|
|
72
|
+
YT?: YTNamespace;
|
|
73
|
+
onYouTubeIframeAPIReady?: () => void;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export declare function BaseVideoPlayer(options: BaseVideoPlayerOptions): Renderable;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './base-video-player';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Renderable, Value, TNode } from '@tempots/dom';
|
|
2
|
+
import { OverlayEffect } from '../theme';
|
|
3
|
+
export interface LightboxOptions {
|
|
4
|
+
/** Whether clicking outside/Escape closes the lightbox (default: true) */
|
|
5
|
+
dismissable?: Value<boolean>;
|
|
6
|
+
/** Whether to show the close button in the top-right corner (default: true) */
|
|
7
|
+
showCloseButton?: Value<boolean>;
|
|
8
|
+
/** Overlay effect (default: 'opaque') */
|
|
9
|
+
overlayEffect?: Value<OverlayEffect>;
|
|
10
|
+
/** Container for the overlay: 'body' (default) or 'element' */
|
|
11
|
+
container?: 'body' | 'element';
|
|
12
|
+
/** Padding (in px) kept around content; content is capped by viewport minus padding (default: 32) */
|
|
13
|
+
padding?: Value<number>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Lightbox overlay for displaying arbitrary content maximized and centered.
|
|
17
|
+
* - Attaches via Portal to body by default
|
|
18
|
+
* - Dark background via Overlay effect
|
|
19
|
+
* - Fades in/out using the overlay's animated toggle
|
|
20
|
+
* - Caps content to viewport (minus padding) and clips overflow; no transform scaling
|
|
21
|
+
*/
|
|
22
|
+
export declare function Lightbox(options: LightboxOptions, fn: (open: (content: TNode) => void, close: () => void) => TNode): Renderable;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TNode, Value, Renderable } from '@tempots/dom';
|
|
2
2
|
import type { ThemeColorName } from '@/tokens';
|
|
3
3
|
import { ExtendedColor } from '../theme/style-utils';
|
|
4
|
+
export type RibbonCorner = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
4
5
|
export type RibbonOptions = {
|
|
5
6
|
/** Background/text color theme (defaults to 'primary') */
|
|
6
7
|
color?: Value<ThemeColorName | ExtendedColor>;
|
|
@@ -14,9 +15,11 @@ export type RibbonOptions = {
|
|
|
14
15
|
width?: Value<number | string>;
|
|
15
16
|
/** Rotation angle in degrees. Default: 45 */
|
|
16
17
|
angle?: Value<number>;
|
|
18
|
+
/** Corner position. Default: 'top-right' */
|
|
19
|
+
corner?: Value<RibbonCorner>;
|
|
17
20
|
};
|
|
18
21
|
/**
|
|
19
|
-
* Ribbon: renders diagonal content at
|
|
22
|
+
* Ribbon: renders diagonal content at a specified corner.
|
|
20
23
|
* Note: The parent container should be positioned (e.g., position: relative) for best results.
|
|
21
24
|
*/
|
|
22
|
-
export declare function Ribbon({ color, class: cls, inset, offset, width, angle, }: RibbonOptions, ...children: TNode[]): Renderable;
|
|
25
|
+
export declare function Ribbon({ color, class: cls, inset, offset, width, angle, corner, }: RibbonOptions, ...children: TNode[]): Renderable;
|
|
@@ -63,7 +63,8 @@ export declare const DEFAULT_FEATURES: MarkdownFeatures;
|
|
|
63
63
|
*
|
|
64
64
|
* ProseMirrorMarkdownInput({
|
|
65
65
|
* value: markdown,
|
|
66
|
-
*
|
|
66
|
+
* onInput: v => markdown.set(v), // Called on every document change
|
|
67
|
+
* onChange: v => console.log('Saved:', v), // Called when editor loses focus
|
|
67
68
|
* showToolbar: true,
|
|
68
69
|
* features: {
|
|
69
70
|
* headings: true,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './components/navigation';
|
|
|
12
12
|
export * from './components/overlay';
|
|
13
13
|
export * from './components/theme';
|
|
14
14
|
export * from './components/typography';
|
|
15
|
+
export * from './components/media';
|
|
15
16
|
export * from './i18n';
|
|
16
17
|
export * from './tokens';
|
|
17
18
|
export * from './tailwind';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),At=require("./colors-Qc1mmmfr.cjs"),Dt=require("./timer-BdH4cK6a.cjs"),nt=require("@tempots/ui"),w=require("./translations-DQxg-W9w.cjs"),A=require("./notice-len8sDjL.cjs");class Tt extends Error{constructor(n="Missing implementation"){super(n),this.name="MissingImplementationError"}}const St=e=>Bt(e).split("_").join(" "),Bt=e=>(e=e.replace(/::/g,"/"),e=e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),e=e.replace(/([a-z\d])([A-Z])/g,"$1_$2"),e=e.replace(/-/g,"_"),e.toLowerCase()),Ot=e=>e.substring(0,1).toUpperCase()+e.substring(1),Ut=e=>{if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf8");if(typeof atob<"u")return atob(e);throw new Tt("No implementation found for base64 decoding")};function J({onChange:e,value:n,accept:l="*/*",enableClick:a=!0,content:r,disabled:o=!1,allowMultiple:s}){return t.Use(w.BeatUII18n,c=>{const u=t.Value.deriveProp(n??[]),i=t.prop(!1),m=h=>{h.preventDefault(),h.stopPropagation(),i.value=!0},d=h=>{h.preventDefault(),h.stopPropagation(),(!h.currentTarget||!h.currentTarget.contains(h.relatedTarget))&&(i.value=!1)},b=h=>{h.preventDefault(),h.stopPropagation(),i.value=!1;const g=Array.from(h.dataTransfer?.files||[]);g.length>0&&(u.value=g,e(g))},p=h=>{t.Value.get(a)&&h.currentTarget.querySelector('input[type="file"]')?.click()};let v=null;const f=()=>{if(v==null)return;const h=Array.from(v.files??[]);h.length>0&&(u.value=h,e(h)),v.value=""},V=h=>{t.Value.get(a)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),p(h))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(a,h=>h?0:-1)),t.attr.style("position: relative;"),t.on.dragover(m),t.on.dragleave(d),t.on.drop(b),t.on.click(p),t.on.keydown(V),t.html.input(t.attr.type("file"),t.attr.disabled(o),t.attr.accept(l),t.attr.multiple(s),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(f),t.WithElement(h=>(v=h,t.OnDispose(u.on(g=>{const k=globalThis.DataTransfer;if(k!=null){const C=new k;g.forEach(I=>C.items.add(I)),h.files=C.files}}))))),t.aria.label(t.bind(c.$.dropZoneInstructions)(a)),r({files:u,clear:()=>u.value=[],change:u.set}))})}function Nt(e,n){return e.length===n.length&&e.every((l,a)=>l===n[a])}function Lt(e,n){const l=["bc-segmented-control",`bc-segmented-control--size-${e}`];return n&&l.push("bc-segmented-control--disabled"),l.join(" ")}function Rt({options:e,value:n,onChange:l,size:a="md",disabled:r=!1},...o){const s=At.f(e).map(([c,u])=>({key:c,label:u}));return t.WithElement(()=>{const c=Object.fromEntries(s.map((i,m)=>[i.key,m])),u=t.prop(s.map(()=>({left:0,width:0})),Nt);return t.html.div(t.attr.class(t.computedOf(a,r)((i,m)=>Lt(i??"md",m??!1))),t.html.div(t.attr.class("bc-segmented-control__container"),t.html.div(t.attr.class("bc-segmented-control__indicator"),t.style.width(t.computedOf(n,u)((i,m)=>{const{width:d}=m[c[i]??0];return`${d}px`})),t.style.left(t.computedOf(n,u)((i,m)=>{const{left:d}=m[c[i]??0];return`${d}px`}))),s.map(({label:i,key:m},d)=>t.html.button(t.attr.type("button"),t.on.click(b=>{b.preventDefault(),t.Value.get(r)||l?.(m)}),t.attr.disabled(r),t.attr.class("bc-segmented-control__segment"),t.attr.class(t.Value.map(n,b=>b===m?"bc-segmented-control__segment--active":"bc-segmented-control__segment--inactive")),nt.ElementRect(b=>{function p(){u.update(f=>{const V=[...f];return V[d]={width:b.value.width,left:b.value.localLeft},V})}const v=Dt.g(p);return t.OnDispose(v,b.on(p))}),i))),...o)})}function zt(e){const n=e.type.toLowerCase();return n.startsWith("image/")&&(n.includes("jpeg")||n.includes("jpg")||n.includes("png")||n.includes("gif")||n.includes("webp")||n.includes("svg"))}function Wt(e){const n=e.type.toLowerCase();return n.startsWith("image/")?"vscode-icons:file-type-image":n.startsWith("video/")?"vscode-icons:file-type-video":n.startsWith("audio/")?"vscode-icons:file-type-audio":n.includes("pdf")?"vscode-icons:file-type-pdf2":n.includes("word")||n.includes("document")?"vscode-icons:file-type-word":n.includes("excel")||n.includes("spreadsheet")?"vscode-icons:file-type-excel":n.includes("powerpoint")||n.includes("presentation")?"vscode-icons:file-type-powerpoint":n.includes("zip")||n.includes("archive")?"vscode-icons:file-type-zip":n.includes("text")?"vscode-icons:file-type-text":n.includes("json")?"vscode-icons:file-type-json-official":n.includes("csv")?"vscode-icons:file-type-csv":n.includes("xml")?"vscode-icons:file-type-xml":n.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function ot(e){return t.When(e.map(zt),()=>{const n=t.prop(null);return e.on(l=>{n.value&&URL.revokeObjectURL(n.value);const a=URL.createObjectURL(l);n.value=a}),t.html.div(t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(n),t.attr.alt(e.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail"),t.OnDispose(()=>{n.value&&URL.revokeObjectURL(n.value)})))},()=>w.Icon({icon:e.map(Wt)}))}const dt=(e,...n)=>{const{value:l=t.prop([]),accept:a="*/*",maxFiles:r,maxFileSize:o,onChange:s,onBlur:c,disabled:u,hasError:i,mode:m="default",showFileList:d=!0,...b}=e,p=l,v=t.Value.map(m,C=>C==="compact"),f=C=>{let I=C;if(r!=null){const x=t.Value.get(r);I=I.slice(0,x)}if(o){const x=t.Value.get(o);I=I.filter(y=>y.size<=x)}s?.(I)},V=C=>{const x=p.value.filter((y,_)=>_!==C);s?.(x)},h=()=>{s?.([])},g=({files:C,clear:I,change:x})=>t.Use(w.BeatUII18n,y=>t.html.div(t.attr.class("bc-file-input__drop-zone"),t.html.div(t.attr.class("bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"),w.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(y.$.filesInputInstructions)(r,o,y.$.fileSizeUnits.value))))),k=({files:C})=>t.Use(w.BeatUII18n,I=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(C.map(x=>x.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(C,x=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),ot(x),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),x.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),w.Icon({icon:"mdi:cloud-upload-outline",size:"sm"})," ",t.bind(I.$.filesInputInstructions)(r,o,I.$.fileSizeUnits.value)))));return t.Use(w.BeatUII18n,C=>w.InputContainer({baseContainer:t.Value.map(v,I=>!I),disabled:u,hasError:i,after:t.When(v,()=>t.When(p.map(({length:I})=>I>0),()=>A.CloseButton({size:"sm",label:C.$.clearAllFiles,disabled:u,onClick:h},t.attr.class("bc-file-input__compact-clear")))),...b,input:t.When(v,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),J({value:p,accept:a,enableClick:!0,allowMultiple:t.Value.map(r??1/0,I=>I>1),disabled:u,onChange:f,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),J({value:p,accept:a,enableClick:!0,allowMultiple:t.Value.map(r??1/0,I=>I>1),disabled:u,onChange:f,content:g}),t.When(d,()=>t.NotEmpty(p,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(p,(I,x)=>{const y=x.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),ot(I)),t.html.div(t.attr.class("bc-file-input__file-info"),t.html.div(t.attr.class("bc-file-input__file-name"),t.attr.title(I.$.name),I.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(I.$.size,C.$.fileSizeUnits)((_,M)=>w.formatFileSize(_,{units:M}))," • ",t.computedOf(I.$.type,C.$.unknownType)((_,M)=>_||M))),A.CloseButton({size:"sm",label:C.$.removeFile,disabled:u,onClick:()=>V(y)},t.attr.class("bc-file-input__remove-button")))})),t.When(p.map(({length:I})=>I>1),()=>t.html.div(t.attr.class("bc-file-input__clear-all-button-container"),t.html.button(t.attr.type("button"),t.attr.class("bc-file-input__clear-all-button"),t.attr.disabled(u),C.$.clearAllFiles,t.on.click(I=>{I.preventDefault(),I.stopPropagation(),h()})))))))))},...n))};async function mt(e){return new Promise((n,l)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const r=a.result;n(r.split(",")[1])},a.onerror=r=>l(r)})}function Pt(e){return Promise.all(e.map(mt))}function jt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Ht(e){const n=Ut(e??""),l=n.length,a=new Uint8Array(l);for(let r=0;r<l;r++)a[r]=n.charCodeAt(r);return a}function ft(e){const{value:n,onChange:l,onInput:a,...r}=e,o=new Map,s=t.Value.toSignal(n).map(m=>m.map((d,b)=>{const p=o.get(d),v=Ht(d??""),f=p?.type||jt(v),V=p?.name??`file-${b}`,h=v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength),g=new Blob([h],{type:f});return new File([g],V,{type:f})})),c=m=>d=>{m&&Pt(d).then(b=>{for(const[p,v]of b.entries())o.set(v,{name:d[p].name,type:d[p].type});m(b)})},u=c(l),i=c(a);return dt({...r,value:s,onChange:u,onInput:i})}function Zt(e){const{value:n,onInput:l,onChange:a,...r}=e;return ft({...r,maxFiles:1,value:t.Value.map(n,o=>o==null?[]:[o]),onChange:o=>{a?.(o[0])},onInput:o=>{l?.(o[0])}})}function K(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:[0,0,0]}function tt(e,n,l){const a=r=>r.toString(16).padStart(2,"0");return`#${a(Math.max(0,Math.min(255,e)))}${a(Math.max(0,Math.min(255,n)))}${a(Math.max(0,Math.min(255,l)))}`}function qt(e){if(!e)return[0,0,0,1];const l=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(l){const d=l[1];if(d.length===8){const b=parseInt(d.slice(0,2),16),p=parseInt(d.slice(2,4),16),v=parseInt(d.slice(4,6),16),f=parseInt(d.slice(6,8),16)/255;return[b,p,v,f]}if(d.length===6)return[parseInt(d.slice(0,2),16),parseInt(d.slice(2,4),16),parseInt(d.slice(4,6),16),1];if(d.length===4){const b=parseInt(d[0]+d[0],16),p=parseInt(d[1]+d[1],16),v=parseInt(d[2]+d[2],16),f=parseInt(d[3]+d[3],16)/255;return[b,p,v,f]}if(d.length===3){const b=parseInt(d[0]+d[0],16),p=parseInt(d[1]+d[1],16),v=parseInt(d[2]+d[2],16);return[b,p,v,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const r=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(r)return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),1];const o=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(o){const d=parseFloat(o[1]),b=parseFloat(o[2]),p=parseFloat(o[3]),v=o[4]!=null?parseFloat(o[4]):1,[f,V,h]=ht(d,b/100,p/100);return[f,V,h,v]}const s=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const d=parseFloat(s[1]),b=parseFloat(s[2])/100,p=parseFloat(s[3])/100,v=s[4]!=null?parseFloat(s[4]):1,[f,V,h]=Gt(d,b,p);return[f,V,h,v]}const c=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(c){const d=c[1],b=parseFloat(c[2]),p=parseFloat(c[3]),v=c[4]!=null?parseFloat(c[4]):1,f=d.endsWith("%")?Math.max(0,Math.min(1,parseFloat(d)/100)):Math.max(0,Math.min(1,parseFloat(d))),[V,h,g]=Jt(f,b,p);return[V,h,g,v]}const[u,i,m]=K(e);return[u,i,m,1]}const Yt=(e,n,l,a)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(l)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`;function Xt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function ht(e,n,l){e=(e%360+360)%360;const a=(1-Math.abs(2*l-1))*n,r=a*(1-Math.abs(e/60%2-1)),o=l-a/2;let s=0,c=0,u=0;return 0<=e&&e<60?[s,c,u]=[a,r,0]:60<=e&&e<120?[s,c,u]=[r,a,0]:120<=e&&e<180?[s,c,u]=[0,a,r]:180<=e&&e<240?[s,c,u]=[0,r,a]:240<=e&&e<300?[s,c,u]=[r,0,a]:[s,c,u]=[a,0,r],[Math.round((s+o)*255),Math.round((c+o)*255),Math.round((u+o)*255)]}function Gt(e,n,l){e=(e%360+360)%360;const a=n+l;a>1&&(n/=a,l/=a);const[r,o,s]=ht(e,1,.5).map(d=>d/255),c=1-n-l,u=r*c+n,i=o*c+n,m=s*c+n;return[Math.round(u*255),Math.round(i*255),Math.round(m*255)]}function et(e,n,l){e/=255,n/=255,l/=255;const a=Math.max(e,n,l),r=Math.min(e,n,l);let o=0,s=0;const c=(a+r)/2,u=a-r;if(u!==0){switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(n-l)/u+(n<l?6:0);break;case n:o=(l-e)/u+2;break;default:o=(e-n)/u+4}o*=60}return[Math.round(o),Math.round(s*100),Math.round(c*100)]}function Qt(e,n,l){const[a]=et(e,n,l),r=e/255,o=n/255,s=l/255,c=Math.min(r,o,s),u=1-Math.max(r,o,s);return[a,Math.round(c*100),Math.round(u*100)]}function X(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function G(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function Jt(e,n,l){const a=l*Math.PI/180,r=Math.cos(a)*n,o=Math.sin(a)*n,s=e+.3963377774*r+.2158037573*o,c=e-.1055613458*r-.0638541728*o,u=e-.0894841775*r-1.291485548*o,i=s*s*s,m=c*c*c,d=u*u*u,b=4.0767416621*i-3.3077115913*m+.2309699292*d,p=-1.2684380046*i+2.6097574011*m-.3413193965*d,v=-.0041960863*i-.7034186147*m+1.707614701*d;return[G(b),G(p),G(v)]}function Kt(e,n,l){const a=X(e),r=X(n),o=X(l),s=.4122214708*a+.5363325363*r+.0514459929*o,c=.2119034982*a+.6806995451*r+.1073969566*o,u=.0883024619*a+.2817188376*r+.6299787005*o,i=Math.cbrt(s),m=Math.cbrt(c),d=Math.cbrt(u),b=.2104542553*i+.793617785*m-.0040720468*d,p=1.9779984951*i-2.428592205*m+.4505937099*d,v=.0259040371*i+.7827717662*m-.808675766*d,f=Math.sqrt(p*p+v*v);let V=Math.atan2(v,p)*180/Math.PI;return V<0&&(V+=360),[b,f,V]}function P(e,n,l,a,r,o){switch(r){case"hex":if(o){const s=u=>u.toString(16).padStart(2,"0"),c=Math.max(0,Math.min(255,Math.round(a*255)));return`#${s(e)}${s(n)}${s(l)}${s(c)}`}return tt(e,n,l);case"rgb":return`rgb(${e}, ${n}, ${l})`;case"rgba":return`rgba(${e}, ${n}, ${l}, ${Math.round(a*100)/100})`;case"hsl":{const[s,c,u]=et(e,n,l);return`hsl(${s}, ${c}%, ${u}%)`}case"hsla":{const[s,c,u]=et(e,n,l);return`hsla(${s}, ${c}%, ${u}%, ${Math.round(a*100)/100})`}case"hwb":{const[s,c,u]=Qt(e,n,l);return a<1?`hwb(${s} ${c}% ${u}% / ${Math.round(a*100)/100})`:`hwb(${s} ${c}% ${u}%)`}case"oklch":{const[s,c,u]=Kt(e,n,l),i=(Math.round(s*1e3)/1e3).toFixed(3),m=(Math.round(c*1e3)/1e3).toFixed(3),d=(Math.round(u*10)/10).toFixed(1),b=Math.round(a*100)/100;return o||a<1?`oklch(${i} ${m} ${d} / ${b})`:`oklch(${i} ${m} ${d})`}}}function j(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}function te(e,n){const[l,a,r]=e,o=l<<16^a<<8^r,s=Xt(o),c=6+Math.floor(s()*5),u=.18+s()*.06,i=[];for(let p=0;p<c;p++){const v=p/c*Math.PI*2,f=n*(1+(s()*2-1)*u),V=Math.cos(v)*f,h=Math.sin(v)*f;i.push({x:V,y:h})}const m=(i[0].x+i[c-1].x)/2,d=(i[0].y+i[c-1].y)/2;let b=`M ${m.toFixed(3)} ${d.toFixed(3)}`;for(let p=0;p<c;p++){const v=i[p],f=i[(p+1)%c],V=(v.x+f.x)/2,h=(v.y+f.y)/2;b+=` Q ${v.x.toFixed(3)} ${v.y.toFixed(3)} ${V.toFixed(3)} ${h.toFixed(3)}`}return b+=" Z",b}const ee=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,displayValue:o,size:s,withAlpha:c}=e,u=t.Value.map(s??32,x=>x),i=t.Value.map(n,x=>qt(x??"#000000")),m=t.Value.map(i,([x,y,_])=>[x,y,_]),d=t.Value.map(i,([,,,x])=>x),b=t.prop(t.Value.get(d)??1),p=t.Value.map(c??!1,x=>x),v=t.Value.map(e.colorTextFormat??"rgb",x=>x),f=t.computedOf(m,b,v,p)(([x,y,_],M,E,$)=>P(x,y,_,M??1,j(E,$),$)),V=t.Value.map(e.colorTextFormat??"hex",x=>x),h=t.Value.map(u,x=>`${-x/2} ${-x/2} ${x} ${x}`),g=t.computedOf(m,u)((x,y)=>te(x,y/2)),k=t.computedOf(m,b,p)(([x,y,_],M,E)=>E||M<1?Yt(x,y,_,M):tt(x,y,_)),C=t.html.div(t.attr.class("bc-color-input__control"),t.attr.class(t.Value.map(p,x=>x?"bc-color-input__control--alpha":"")),t.attr.style(t.computedOf(u)(x=>`min-width:${x+2}px;height:${x+2}px`)),t.svg.svg(t.attr.class("bc-color-input__svg"),t.svgAttr.viewBox(h),t.svg.path(t.svgAttr.d(g),t.svgAttr.fill(k))),t.html.input(t.attr.type("color"),w.CommonInputAttributes(e),t.attr.value(t.Value.map(m,([x,y,_])=>tt(x,y,_))),t.attr.class("bc-input bc-color-input bc-color-input__native"),l!=null?t.on.blur(l):t.Empty,a!=null?t.on.change(x=>{const y=x.target.value;if(!a)return;const[_,M,E]=K(y),$=t.Value.get(b)??1,F=j(t.Value.get(V),t.Value.get(p)),T=P(_,M,E,$,F,t.Value.get(p));a(T)}):t.Empty,r!=null?t.on.input(x=>{const y=x.target.value;if(!r)return;const[_,M,E]=K(y),$=t.Value.get(b)??1,F=j(t.Value.get(V),t.Value.get(p)),T=P(_,M,E,$,F,t.Value.get(p));r(T)}):t.Empty)),I=t.When(p,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(b,x=>String(x??1))),t.attr.disabled(e.disabled),t.on.input(x=>{const y=parseFloat(x.target.value);b.set(y);const[_,M,E]=t.Value.get(m),$=j(t.Value.get(V),t.Value.get(p)),F=P(_,M,E,y,$,t.Value.get(p));r?.(F)}),t.on.change(x=>{const y=parseFloat(x.target.value);b.set(y);const[_,M,E]=t.Value.get(m),$=j(t.Value.get(V),t.Value.get(p)),F=P(_,M,E,y,$,t.Value.get(p));a?.(F)})));return w.InputContainer({baseContainer:!0,...e,growInput:!1,input:C,after:t.Fragment(t.When(o??!1,()=>t.html.span(t.attr.class("bc-color-input__rgb"),f)),I,e.after)})},at="$$tts-exp-",gt=(e,n)=>t.WithElement(l=>{const a=`${at}${e}`;return t.OnDispose(t.Value.on(n,r=>Reflect.set(l,a,r)))}),ne=(e,n)=>{const l=`${at}${e}`;return a=>{n(Reflect.get(a.target,l))}},bt=(e,n)=>{const l=`${at}${e}`;return a=>{const r=a.target,o=r.selectedIndex,s=r.options[o];n(Reflect.get(s,l))}};function ae(e,n,l){const a=["bc-card"];return e!=="default"&&a.push(`bc-card--${e}`),n!=="md"&&a.push(`bc-card--padding-${n}`),l!=="lg"&&a.push(`bc-card--rounded-${l}`),a.join(" ")}function re({variant:e="default",size:n="md",roundedness:l="lg"}={},...a){return t.html.div(t.attr.class(t.computedOf(e,n,l)((r,o,s)=>ae(r??"default",o??"md",s??"lg"))),...a)}function H(...e){return t.html.div(t.attr.class("bc-group"),...e)}const le=({startEditing:e,value:n,onChange:l,placeholder:a,disabled:r})=>{const o=t.Value.deriveProp(e??!1),s=t.prop(!1),c=t.Value.map(r??!1,u=>u);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(c,u=>u?"bc-editable-text--disabled":"")),t.aria.disabled(c),t.When(o,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),nt.AutoSelect(),t.on.keydown(u=>{u.key==="Enter"?o.set(!1):u.key==="Escape"&&(s.set(!0),o.set(!1))}),t.on.blur(t.emitValue(u=>{if(o.set(!1),s.value){s.set(!1);return}l(u)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(c)||o.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,u=>u!=null&&u.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(c,u=>!u),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(w.BeatUII18n,u=>t.aria.label(u.$.editLabel)),t.on.click(()=>o.set(!0)),w.Icon({icon:"line-md/pencil",color:"neutral"}))))))},vt=(e,n,l)=>t.Ensure(e,a=>t.OneOfType(a,{value:r=>{const o=t.computedOf(r,l)((s,c)=>n(s.value,c));return t.html.option(t.OnDispose(o.dispose),t.attr.selected(o),gt("value",r.$.value),r.$.label)},group:r=>t.html.optgroup(t.attr.label(r.$.group),t.ForEach(r.$.options,o=>vt(o,n,l))),break:()=>t.html.hr()})),xt=e=>{const{value:n,onBlur:l,onChange:a,options:r,unselectedLabel:o,equality:s=(i,m)=>i===m,after:c}=e;let u;return w.InputContainer({...e,after:t.Fragment(w.Icon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),c),input:t.html.select(t.WithElement(i=>{u=i;const m=new MutationObserver(d=>{const{removedNodes:b}=d[0];b.length>0&&(u.selectedIndex=0)});return m.observe(i,{childList:!0}),t.OnDispose(()=>m.disconnect())}),w.CommonInputAttributes(e),t.attr.class("bc-native-select bc-input"),t.Use(w.BeatUII18n,i=>t.html.option(t.attr.hidden("hidden"),t.coalesce(o,i.$.selectOne))),t.ForEach(r,i=>vt(i,s,n)),l!=null?t.on.blur(l):t.Empty,a!=null?t.on.change(bt("value",i=>a(i))):t.Empty)},t.on.click(()=>{u?.focus(),typeof u?.showPicker=="function"&&u.showPicker()}))};function It(e){const{controller:n,onChange:l,onBlur:a,...r}=e;return xt({...r,value:n.signal,onChange:A.makeOnChangeHandler(n,l),onBlur:A.makeOnBlurHandler(n,a)})}function se(e){return A.InputWrapper({...e,content:It(e)})}function Vt(e,n,l){const a=e.length.map(r=>r);return t.Fragment(t.OnDispose(()=>a.dispose()),t.Repeat(a,r=>{const o=e.item(r.index),s=[];return t.Fragment(t.OnDispose(()=>{o.dispose(),s.forEach(c=>c())}),n({list:e,item:o,position:r,remove:()=>e.removeAt(r.index),move:c=>{switch(c){case"up":if(r.index===0)return;e.move(r.index,r.index-1);break;case"down":if(r.index===e.length.value-1)return;e.move(r.index,r.index+1);break;case"first":e.move(r.index,0);break;case"last":e.move(r.index,e.length.value-1)}},canMove:c=>{const u=(()=>{switch(c){case"up":return t.signal(r.index>0);case"down":return e.length.map(i=>r.index<i-1)}})();return s.push(()=>u.dispose()),u},cannotMove:c=>{const u=(()=>{switch(c){case"up":return t.signal(r.index===0);case"down":return e.length.map(i=>r.index===i-1)}})();return s.push(()=>u.dispose()),u}}))},l))}const ut={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:e=>e.toUpperCase()},"*":{pattern:/^.$/}},oe=e=>e instanceof RegExp;function wt(e,n,l){if(e==null)return[];const a=l?{...ut,...n}:n??ut,r=(s,c)=>{const u=a[c];u?s.push({type:"pattern",name:c,...u}):s.push({type:"literal",char:c})},o=[];if(typeof e=="string"){for(const s of e)r(o,s);return o}for(const s of e)if(typeof s=="string")if(s.length<=1)r(o,s);else for(const c of s)r(o,c);else oe(s)?o.push({type:"pattern",pattern:s}):typeof s=="object"&&s&&o.push(s);return o}function ue(e,n){return l=>{switch(e){case"digits":return/[0-9]/.test(l);case"letters":return/[A-Za-z]/.test(l);case"alphanumeric":return/[A-Za-z0-9]/.test(l);case"custom":return n?.(l)??!0;default:return!0}}}function ct(e,n,l,a,r,o){const s={raw:e,previousConformed:n,cursor:r??e.length,completed:!1},c=a.definitions??{},u=typeof l=="function"?l(e,s):l,i=wt(u,c,a.useDefaultDefinitions??!0),m=ue(a.allowMode,a.allow),d=new Set;for(const $ of i)$.type==="literal"&&d.add($.char);if(a.prefix)for(const $ of a.prefix)d.add($);if(a.suffix)for(const $ of a.suffix)d.add($);const b=Array.from(e).filter($=>m($)&&!d.has($));if(b.length===0)return{value:"",cursor:0,completed:!1};const p=[],v=[];let f=0,V=0,h=0,g=-1;for(const $ of i){if($.type==="literal"){p.push($.char),v.push({kind:"literal",filled:!0});continue}V+=$.optional?0:1;const F=b[f];if(F==null)break;if($.type==="any"){h++,p.push($.transform?$.transform(F):F),v.push({kind:"slot",filled:!0}),g=v.length-1,f++;continue}if($.type==="pattern")if($.pattern.test(F)){h++;const T=$.transform?$.transform(F):F;p.push(T),v.push({kind:"slot",filled:!0}),g=v.length-1,f++}else{f++;continue}}const k=p.join(""),C=(a.prefix??"")+k+(a.suffix??"");let x=(a.prefix??"").length;if(g>=0){let $=g+1;if((o?.policy??"smart")!=="sticky")for(;$<v.length&&v[$].kind==="literal";)$++;x+=$}const y=a.completion?.mode==="min"?(a.completion.minChars??0)<=h:a.completion?.mode==="custom"?!!a.completion.isComplete?.(C):V>0&&h>=V,_=a.pipe?.(C,{...s,completed:y});let M,E=x;return _===!1?(M=n,E=n.length):typeof _=="string"?(M=_,E=_.length):typeof _=="object"&&_?(M=_.value,E=_.cursor??_.value.length):M=C,{value:M,cursor:E,completed:y}}function ce(e,n){const l=n?.strategy??"none";return l==="custom"&&n?.unmask?n.unmask(e):l==="strip"?e.replace(/[^A-Za-z0-9]/g,""):e}const rt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,onAccept:o,onComplete:s,mask:c,definitions:u,useDefaultDefinitions:i,extraLiterals:m,prefix:d,suffix:b,autofix:p,pipe:v,completion:f,unmask:V,allowMode:h,allow:g,placeholder:k,placeholderOptions:C}=e,I=t.computedOf(n,c,u,i,m,d,b,p,f,V,h,k,C)((y,_,M,E,$,F,T,z,W,R,U,Z,O)=>_?ct(y??"","",_,{definitions:M??{},useDefaultDefinitions:E??!0,extraLiterals:$??[],autofix:z??"none",completion:W??{mode:"mask"},pipe:v??(D=>D),unmask:R??{strategy:"none"},allowMode:U??"all",allow:g,prefix:F,suffix:T}).value:y??""),x=(y,_)=>{const M=y.value??"",E=t.Value.get(n)??"",$=c!=null?t.Value.get(c):null,F=u!=null?t.Value.get(u):void 0,T=i!=null?t.Value.get(i):void 0,z=m!=null?t.Value.get(m):void 0,W=p!=null?t.Value.get(p):void 0,R=f!=null?t.Value.get(f):void 0,U=V!=null?t.Value.get(V):void 0,Z=h!=null?t.Value.get(h):void 0,O=d!=null?t.Value.get(d):void 0,D=b!=null?t.Value.get(b):void 0,{value:N,cursor:Y,completed:lt}=$?ct(M,E,$,{definitions:F??{},useDefaultDefinitions:T??!0,extraLiterals:z??[],autofix:W??"none",completion:R??{mode:"mask"},pipe:v??(Ft=>Ft),unmask:U??{strategy:"none"},allowMode:Z??"all",allow:g,prefix:O,suffix:D},y.selectionStart??M.length,e.cursor?t.Value.get(e.cursor):void 0):{value:M,cursor:M.length,completed:!0};if(N!==M){y.value=N;try{y.setSelectionRange(Y,Y)}catch{}}const st=ce(N,U);o?.({raw:st,conformed:N,completed:lt,cursor:Y}),_==="input"?r?.(N):(a?.(N),lt&&s?.({raw:st,conformed:N}))};return w.InputContainer({...e,input:t.input.text(w.CommonInputAttributes(e),t.attr.value(I),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(y=>y instanceof HTMLInputElement?t.Fragment(t.on.input(()=>x(y,"input")),t.on.change(()=>x(y,"change")),t.on.keydown(_=>{if(_.key!=="Backspace"||!(e.cursor?t.Value.get(e.cursor)?.backspaceRubberBand??!0:!0))return;const E=y.selectionStart??0,$=y.selectionEnd??E;if(E!==$||E<=0)return;const F=y.value??"",T=c!=null?t.Value.get(c):null;if(!T)return;const z=u!=null?t.Value.get(u):void 0,W=i!=null?t.Value.get(i):!0,R=d!=null?t.Value.get(d):void 0,U=b!=null?t.Value.get(b):void 0,Z=wt(typeof T=="function"?T(F,{raw:F,previousConformed:F,cursor:E,completed:!1}):T,z??{},W??!0),O=new Set;for(const D of Z)D.type==="literal"&&O.add(D.char);if(R)for(const D of R)O.add(D);if(U)for(const D of U)O.add(D);if(O.has(F[E-1])){let D=E-1;for(;D>=0&&O.has(F[D]);)D--;D>=0&&(_.preventDefault(),_.stopPropagation(),y.value=F.slice(0,D)+F.slice(D+1),x(y,"input"))}})):t.Empty))})};function B(e,n,l){const a=t.Value.map(e,o=>o!=null),r=w.defaultMessages.clearValue;return t.When(a,()=>t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(r),t.attr.title(r),t.attr.disabled(n??!1),w.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.preventDefault(),o.stopPropagation(),l?.(null)})))}const ie=e=>{const{value:n,onBlur:l,onChange:a,after:r,disabled:o}=e,s=B(n,o,a);return w.InputContainer({...e,input:t.input.date(w.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty),after:r!=null?t.Fragment(s,r):s})},pe=e=>{const n=e.getFullYear(),l=e.getMonth()+1,a=e.getDate(),r=e.getHours(),o=e.getMinutes(),s=e.getSeconds();return`${n}-${l.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},de=e=>{const{value:n,onBlur:l,onChange:a,after:r,disabled:o}=e,s=t.Value.map(n,u=>u!=null?pe(u):null),c=B(n,o,a);return w.InputContainer({...e,input:t.input["datetime-local"](w.CommonInputAttributes(e),t.attr.value(t.Value.map(s,u=>u??null)),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty),after:r!=null?t.Fragment(c,r):c})},S=e=>typeof e=="string"&&e.trim()===""?null:e,L=e=>e??"",me=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return w.TextInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},fe=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return A.EmailInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},he=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return A.PasswordInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},yt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,rows:o}=e;return w.InputContainer({...e,input:t.html.textarea(w.CommonInputAttributes(e),t.attr.rows(o??3),t.attr.value(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValue(a)):t.Empty,r!=null?t.on.input(t.emitValue(r)):t.Empty)})},ge=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return yt({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},be=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c,after:u}=e,i=b=>{const p=a!=null?t.Value.get(a):void 0,v=r!=null?t.Value.get(r):void 0;return p!=null&&b<p?p:v!=null&&b>v?v:b},m=l!=null?t.Use(w.BeatUII18n,b=>{const p=t.computedOf(n,a)((h,g)=>g==null?!0:(h??0)>g),v=t.computedOf(n,r)((h,g)=>g==null?!0:(h??0)<g),f=h=>{const g=t.Value.get(n)??0,k=t.Value.get(l),C=h?.shiftKey?10:1,I=g-k*C,x=a!=null?t.Value.get(a):void 0;if(x!=null&&I<x)return;const y=i(I);y!==g&&s&&s(y)},V=h=>{const g=t.Value.get(n)??0,k=t.Value.get(l),C=h?.shiftKey?10:1,I=g+k*C,x=r!=null?t.Value.get(r):void 0;if(x!=null&&I>x)return;const y=i(I);y!==g&&s&&s(y)};return A.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(v,e.disabled??!1)((h,g)=>!h||g)),t.on.click(h=>V(h)),t.aria.label(b.$.incrementValue),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(p,e.disabled??!1)((h,g)=>!h||g)),t.on.click(h=>f(h)),t.aria.label(b.$.decrementValue),w.Icon({icon:"line-md:minus",size:"xs"})))}):null,d=u!=null&&m!=null?t.Fragment(m,u):u??m;return w.InputContainer({...e,input:t.input.number(a!=null?t.Fragment(t.attr.min(a),t.OnDispose(t.Value.on(a,b=>{b<t.Value.get(n)}))):t.Empty,r!=null?t.Fragment(t.attr.max(r),t.OnDispose(t.Value.on(r,b=>{b>t.Value.get(n)}))):t.Empty,w.CommonInputAttributes(e),t.attr.valueAsNumber(n),t.attr.step(l),t.attr.class("bc-input bc-number-input"),o!=null?t.on.blur(t.emitValue(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(s)):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(c)):t.Empty,l!=null?t.on.wheel(b=>{b.preventDefault();const p=t.Value.get(n)??0,v=t.Value.get(l),f=b.shiftKey?10:1,V=b.deltaY<0?v*f:-v*f,h=i(p+V);h!==p&&s&&s(h)}):t.Empty),after:d})},it=e=>{if(e==null||e==="")return null;const n=Number(e);return Number.isNaN(n)?null:n},ve=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c,after:u}=e,i=p=>{const v=a!=null?t.Value.get(a):void 0,f=r!=null?t.Value.get(r):void 0;return v!=null&&p<v?v:f!=null&&p>f?f:p},m=(()=>{if(l==null)return null;const p=t.computedOf(n,a)((g,k)=>{const C=g??0;return k==null?!0:C>k}),v=t.computedOf(n,r)((g,k)=>{const C=g??0;return k==null?!0:C<k}),f=g=>{const k=t.Value.get(n)??0,C=t.Value.get(l),I=g?.shiftKey?10:1,x=k-C*I,y=a!=null?t.Value.get(a):void 0;if(y!=null&&x<y)return;const _=i(x);_!==k&&s&&s(_)},V=g=>{const k=t.Value.get(n)??0,C=t.Value.get(l),I=g?.shiftKey?10:1,x=k+C*I,y=r!=null?t.Value.get(r):void 0;if(y!=null&&x>y)return;const _=i(x);_!==k&&s&&s(_)};return((g,k)=>A.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(v,e.disabled??!1)((C,I)=>!C||I)),t.on.click(C=>V(C)),t.aria.label(g),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(p,e.disabled??!1)((C,I)=>!C||I)),t.on.click(C=>f(C)),t.aria.label(k),w.Icon({icon:"line-md:minus",size:"xs"}))))(w.defaultMessages.incrementValue,w.defaultMessages.decrementValue)})(),d=B(n,e.disabled,s),b=u!=null&&m!=null?t.Fragment(m,d,u):u!=null?t.Fragment(d,u):m!=null?t.Fragment(m,d):d;return w.InputContainer({...e,input:t.input.number(a!=null?t.Fragment(t.attr.min(a),t.OnDispose(t.Value.on(a,p=>{}))):t.Empty,r!=null?t.Fragment(t.attr.max(r),t.OnDispose(t.Value.on(r,p=>{}))):t.Empty,w.CommonInputAttributes(e),t.attr.value(t.Value.map(n,p=>p==null?"":String(p))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),o!=null?t.on.blur(t.emitValue(o)):t.Empty,s!=null?t.on.change(t.emitValue(p=>{const v=it(p);s(v)})):t.Empty,c!=null?t.on.input(t.emitValue(p=>{const v=it(p);c(v)})):t.Empty,l!=null?t.on.wheel(p=>{p.preventDefault();const v=t.Value.get(n)??0,f=t.Value.get(l),V=p.shiftKey?10:1,h=p.deltaY<0?f*V:-f*V,g=i(v+h);g!==v&&s&&s(g)}):t.Empty),after:b})},xe=({value:e,onChange:n,offLabel:l,onLabel:a,label:r,disabled:o=!1,size:s="md",id:c,color:u="primary"})=>{const i=c??A.sessionId("switch"),m=`${i}-label`;function d(f,V){const h=["bc-switch",`bc-switch--size-${V}`,`bc-switch--${V}`];return f&&h.push("bc-switch--disabled"),h.join(" ")}function b(f){const V=f??"primary",h=new Map,g=w.backgroundValue(V,"solid","light"),k=w.backgroundValue(V,"solid","dark");return h.set("--switch-track-on-bg",g.backgroundColor),h.set("--switch-track-on-label",g.textColor),h.set("--switch-track-on-bg-dark",k.backgroundColor),h.set("--switch-track-on-label-dark",k.textColor),h.set("--switch-track-on-border-dark",w.borderColorValue(V,"dark")),Array.from(h.entries()).map(([C,I])=>`${C}: ${I}`).join("; ")}const p=()=>{t.Value.get(o)||n(!t.Value.get(e))},v=f=>{t.Value.get(o)||(f.key===" "||f.key==="Enter")&&(f.preventDefault(),p())};return t.html.div(t.attr.class(t.computedOf(o??!1,s)((f,V)=>d(f??!1,V??"md"))),t.attr.style(t.computedOf(u)(f=>b(f))),t.attr.id(i),t.attr.role("switch"),t.attr.tabindex(t.Value.map(o,f=>f?-1:0)),t.aria.checked(e),t.aria.disabled(o),t.aria.labelledby(r!=null?m:void 0),t.on.click(p),t.on.keydown(v),r!=null?A.Label(t.attr.id(m),t.attr.class(`bc-switch__label bc-switch__label--size-${s} bc-switch__label--nowrap`),r):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track--on":"bc-switch__track--off")),l!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),l):null,a!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),a):null,nt.ElementRect(f=>t.Use(w.Locale,({direction:V})=>t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,h=>h?"bc-switch__thumb--on":"bc-switch__thumb--off")),t.style.transform(t.computedOf(e,f,s,V)((h,{width:g},k,C)=>{const I=(()=>{switch(k){case"xs":return 5;case"sm":return 5.5;case"md":return 6;case"lg":return 7;case"xl":return 8}})(),x=C==="rtl"?`calc((var(--spacing-base) * ${I}) - ${g}px)`:`calc(${g}px - (var(--spacing-base) * ${I}))`;return h?`translateX(${x})`:"translateX(0)"})))))))},Ct=e=>{const n={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:a=>a.toLowerCase()};return rt({...e,mask:[n,n,n,n,n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,n,n,n,n,n,n,n,n],placeholder:e.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},Ie=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return Ct({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},Ve="line-md:star-alt-filled",we="line-md:star-alt",_t=e=>{const{value:n,onChange:l,disabled:a,max:r=5,fullColor:o="yellow",emptyColor:s="neutral",fullIcon:c=Ve,emptyIcon:u=we,size:i="md",onBlur:m,rounding:d=1}=e,b=()=>{const g=t.Value.get(d);return g>0?g:1},p=g=>Math.min(Math.max(g,0),t.Value.get(r)),v=(g,k)=>{if(t.Value.get(a??!1))return;const I=g.currentTarget.getBoundingClientRect(),x=(g.clientX-I.left)/I.width,y=k-1+x,_=b(),M=Math.ceil(y/_)*_,E=p(M);l?.(E)},f=g=>{if(t.Value.get(a??!1))return;const k=b(),C=t.Value.get(n)??0;let I;switch(g.key){case"ArrowRight":case"ArrowUp":I=p(C+k);break;case"ArrowLeft":case"ArrowDown":I=p(C-k);break;case"Home":I=0;break;case"End":I=t.Value.get(r);break;default:return}g.preventDefault(),l?.(I)},V=t.Value.map(i,g=>`bc-icon--${g}`),h=({index:g,counter:k})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(V),w.Icon({icon:u,size:i,color:s,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(V),t.style.width(t.Value.map(n,C=>{const I=Math.floor(C);return I>g?"100%":I<g?"0%":`${(C-g)*100}%`})),w.Icon({icon:c,size:i,color:o,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(C=>v(C,k),{preventDefault:!0,stopPropagation:!0})));return w.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(w.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(a??!1,g=>g?-1:0)),t.aria.disabled(a??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,g=>g??0)),t.aria.valuenow(t.Value.map(n,g=>g??0)),t.aria.valuetext(t.computedOf(n,r)((g,k)=>{const C=g??0,I=k??0;return`${String(C)} / ${String(I)}`})),t.on.keydown(f),m!=null?t.on.blur(m):null,t.Repeat(r,h))})},ye=e=>{const{value:n,onChange:l,onBlur:a,after:r,disabled:o,...s}=e,c=B(n,o,l);return _t({...s,value:t.Value.map(n,u=>u??0),onChange:l,onBlur:a,after:r!=null?t.Fragment(c,r):c})},Ce=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c}=e;return w.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),w.CommonInputAttributes(e),t.attr.min(a),t.attr.max(r),t.attr.step(l),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),o!=null?t.on.blur(t.emitValueAsNumber(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(s)):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(c)):t.Empty)})},_e=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c}=e,u=t.Value.map(n,m=>{if(m!=null)return m;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),i=B(n,e.disabled,m=>{s?.(m)});return w.InputContainer({...e,focusableSelector:'input[type="range"]',after:i,input:t.html.input(t.attr.type("range"),w.CommonInputAttributes(e),t.attr.min(a),t.attr.max(r),t.attr.step(l),t.attr.valueAsNumber(u),t.attr.class("bc-input bc-slider-input"),o!=null?t.on.blur(t.emitValueAsNumber(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(m=>{s(m)})):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(m=>{c(m)})):t.Empty)},t.Fragment())};let Q=null;async function q(){const e=globalThis;return e.Temporal?e.Temporal:(Q||(Q=Promise.resolve().then(()=>require("./index.esm-DJRz9AE-.cjs")).then(n=>{const l=n.Temporal;return e.Temporal||(e.Temporal=l),l})),Q)}const kt=(e,n)=>n?t.Task(q,{then:e,pending:n.pending,error:n.error}):t.Task(q,e),ke=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,$e=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function $t(e){return{mask:null,allowMode:"custom",allow:n=>/[0-9ptwdhms]/i.test(n),pipe:n=>{const l=n.toUpperCase();return l.length===0?l:!l.startsWith("P")||!ke.test(l)?!1:l},completion:{mode:"custom",isComplete:n=>{const l=n.toUpperCase();if(!$e.test(l))return!1;try{return e(l),!0}catch{return!1}}}}}const pt=(e,n)=>{if(e==null)return null;try{return e.Duration.from(n)}catch{return null}},Me=e=>{const{value:n,onChange:l,after:a,disabled:r,onBlur:o}=e,s=()=>{const i=B(n,r,l);return a!=null?t.Fragment(i,a):i},c=e.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return kt(i=>rt({...e,value:t.Value.map(n,m=>m?.toString()??""),onChange:l?m=>l(m===""?null:i.Duration.from(m)):void 0,onInput:void 0,...$t(i.Duration.from),placeholder:"P0DT0H0M0S",after:s()}),{pending:()=>w.InputContainer({...e,input:t.input.text(w.CommonInputAttributes(e),t.attr.value(t.Value.map(n,i=>i?.toString()??"")),t.attr.class("bc-input"),c,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(i=>{const d=i.currentTarget?.value??"";if(d===""){l(null);return}const b=globalThis.Temporal,p=pt(b,d);if(p!=null){l(p);return}q().then(v=>{const f=pt(v,d);f!=null&&l(f)}).catch(()=>{})}):t.Empty),after:s()})})},Mt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r}=e;return w.InputContainer({...e,input:t.input.url(w.CommonInputAttributes(e),t.attr.value(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValue(a)):t.Empty,r!=null?t.on.input(t.emitValue(r)):t.Empty)})},Ee=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return Mt({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},Et=e=>{const{controller:n,element:l,separator:a,showMove:r=!0,showRemove:o=!0,showAdd:s=!0,createItem:c,addLabel:u,controlsLayout:i="aside",removeDisabled:m,addDisabled:d}=e,b=t.Value.toSignal(i).map(f=>f==="aside"),p=f=>{const V=t.When(r??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(b.map(g=>g?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),w.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>f.move("up"),disabled:f.cannotMove("up")},t.Use(w.BeatUII18n,g=>w.Icon({size:"xs",icon:"line-md:arrow-up",title:g.$.incrementValue}))),w.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>f.move("down"),disabled:f.cannotMove("down")},t.Use(w.BeatUII18n,g=>w.Icon({size:"xs",icon:"line-md:arrow-down",title:g.$.decrementValue}))))),h=t.When(o,()=>t.Use(w.BeatUII18n,g=>A.CloseButton({size:"xs",label:t.Value.map(g.$.removeItem,k=>k.toLowerCase()),color:"danger",disabled:m,onClick:f.remove})));return g=>t.When(b,()=>H(t.attr.class("bc-group--gap-1 bc-group--align-center"),A.Stack(t.attr.class("bc-stack--grow"),g),A.Stack(t.attr.class("bc-stack--align-center"),t.When(n.signal.map(k=>k.length>1),()=>V),h)),()=>A.Stack(t.attr.class("bc-stack--gap-2"),g,H(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(n.signal.map(k=>k.length>1),()=>V,()=>t.html.div()),h)))},v=t.When(t.computedOf(s,c)((f,V)=>f&&V!=null),()=>H(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),w.Button({size:"sm",variant:"filled",onClick:()=>n.push(c()),disabled:t.computedOf(n.disabled,d??!1)((f,V)=>f||V)},t.Use(w.BeatUII18n,f=>H(t.attr.class("bc-group--gap-2"),w.Icon({icon:"line-md:plus"}),u??f.$.addLabel)))));return t.Fragment(Vt(n,f=>p(f)(l(f)),a),v)},Fe=(e,...n)=>{const{controller:l,element:a,separator:r,showMove:o,showRemove:s,showAdd:c,createItem:u,addLabel:i,controlsLayout:m,removeDisabled:d,addDisabled:b,...p}=e;return A.InputWrapper({...p,content:Et({controller:l,element:a,separator:r,showMove:o,showRemove:s,showAdd:c,createItem:u,addLabel:i,controlsLayout:m,removeDisabled:d,addDisabled:b})},...n)};class Ae extends A.Controller{branches;activeBranch;#e;#t=new Map;constructor(n,l,a,r,o,s,c=A.O){super(n,l,a,r,o,c),this.branches=s;const u=m=>{for(const d of s)if(d.detect(m))return d.key;return s[0]?.key??"unknown"};this.activeBranch=a.map(u,A.O);const i=m=>{if(this.#t.has(m))return this.#t.get(m);const d=s.find(p=>p.key===m);if(!d)throw new Error(`Unknown branch: ${m}`);const b=new A.Controller([...n,m],p=>{this.change(p)},this.signal.map(p=>d.detect(p)?p:d.defaultValue(),c),r.map(A.makeMapValidation([m])),{disabled:this.disabled,validationMode:this.parent.validationMode},c);return this.#t.set(m,b),b};this.#e=this.activeBranch.map(m=>i(m),A.O),this.onDispose(()=>{for(const m of this.#t.values())m.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(n){const l=this.branches.find(r=>r.key===n);if(!l)throw new Error(`Unknown branch: ${n}`);if(this.#t.has(n))return this.#t.get(n);const a=new A.Controller([...this.path,n],r=>{this.change(r)},this.signal.map(r=>l.detect(r)?r:l.defaultValue(),A.O),this.status.map(A.makeMapValidation([n])),{disabled:this.disabled,validationMode:this.parent.validationMode},A.O);return this.#t.set(n,a),a}switchToBranch(n,l=!1){const a=this.branches.find(s=>s.key===n);if(!a)throw new Error(`Unknown branch: ${n}`);const r=t.Value.get(this.signal);if(a.detect(r))return!0;if(a.convert){const s=a.convert(r);if(s.ok)return this.change(s.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const o=a.defaultValue();return this.change(o),!0}get activeBranchDefinition(){const n=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===n)}}function De(e){return e.transform(n=>n??null,n=>n??void 0)}function Te(e){return e.transform(n=>n??"",n=>n===""?void 0:n)}function Se(e){return e.transform(n=>n??void 0,n=>n??null)}exports.Base64Input=Zt;exports.Base64sInput=ft;exports.BaseListControl=Et;exports.BaseNativeSelectControl=It;exports.Card=re;exports.ColorInput=ee;exports.EditableText=le;exports.Expando=gt;exports.FilesInput=dt;exports.Group=H;exports.ListControl=Fe;exports.ListInput=Vt;exports.MaskInput=rt;exports.NativeSelect=xt;exports.NativeSelectControl=se;exports.NullableDateInput=ie;exports.NullableDateTimeInput=de;exports.NullableDurationInput=Me;exports.NullableEmailInput=fe;exports.NullableNumberInput=ve;exports.NullablePasswordInput=he;exports.NullableRatingInput=ye;exports.NullableResetAfter=B;exports.NullableSliderInput=_e;exports.NullableTextArea=ge;exports.NullableTextInput=me;exports.NullableUUIDInput=Ie;exports.NullableUrlInput=Ee;exports.NumberInput=be;exports.RatingInput=_t;exports.SegmentedInput=Rt;exports.SliderInput=Ce;exports.Switch=xe;exports.TextArea=yt;exports.UUIDInput=Ct;exports.UnionController=Ae;exports.UnstyledDropZone=J;exports.UrlInput=Mt;exports.WithTemporal=kt;exports._t=Ot;exports.durationMaskConfig=$t;exports.emitExpando=ne;exports.emitOptionExpando=bt;exports.emptyToNull=S;exports.ensureTemporal=q;exports.fileToBase64=mt;exports.gt=St;exports.nullToEmpty=L;exports.transformEmptyStringToUndefined=Te;exports.transformNullToUndefined=De;exports.transformUndefinedToNull=Se;
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),At=require("./colors-Qc1mmmfr.cjs"),Dt=require("./timer-DK_yKNwE.cjs"),nt=require("@tempots/ui"),w=require("./translations-DQxg-W9w.cjs"),A=require("./notice-len8sDjL.cjs");class Tt extends Error{constructor(n="Missing implementation"){super(n),this.name="MissingImplementationError"}}const St=e=>Bt(e).split("_").join(" "),Bt=e=>(e=e.replace(/::/g,"/"),e=e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),e=e.replace(/([a-z\d])([A-Z])/g,"$1_$2"),e=e.replace(/-/g,"_"),e.toLowerCase()),Ot=e=>e.substring(0,1).toUpperCase()+e.substring(1),Ut=e=>{if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf8");if(typeof atob<"u")return atob(e);throw new Tt("No implementation found for base64 decoding")};function J({onChange:e,value:n,accept:l="*/*",enableClick:a=!0,content:r,disabled:o=!1,allowMultiple:s}){return t.Use(w.BeatUII18n,c=>{const u=t.Value.deriveProp(n??[]),i=t.prop(!1),m=h=>{h.preventDefault(),h.stopPropagation(),i.value=!0},d=h=>{h.preventDefault(),h.stopPropagation(),(!h.currentTarget||!h.currentTarget.contains(h.relatedTarget))&&(i.value=!1)},b=h=>{h.preventDefault(),h.stopPropagation(),i.value=!1;const g=Array.from(h.dataTransfer?.files||[]);g.length>0&&(u.value=g,e(g))},p=h=>{t.Value.get(a)&&h.currentTarget.querySelector('input[type="file"]')?.click()};let v=null;const f=()=>{if(v==null)return;const h=Array.from(v.files??[]);h.length>0&&(u.value=h,e(h)),v.value=""},V=h=>{t.Value.get(a)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),p(h))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(a,h=>h?0:-1)),t.attr.style("position: relative;"),t.on.dragover(m),t.on.dragleave(d),t.on.drop(b),t.on.click(p),t.on.keydown(V),t.html.input(t.attr.type("file"),t.attr.disabled(o),t.attr.accept(l),t.attr.multiple(s),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(f),t.WithElement(h=>(v=h,t.OnDispose(u.on(g=>{const k=globalThis.DataTransfer;if(k!=null){const C=new k;g.forEach(I=>C.items.add(I)),h.files=C.files}}))))),t.aria.label(t.bind(c.$.dropZoneInstructions)(a)),r({files:u,clear:()=>u.value=[],change:u.set}))})}function Nt(e,n){return e.length===n.length&&e.every((l,a)=>l===n[a])}function Lt(e,n){const l=["bc-segmented-control",`bc-segmented-control--size-${e}`];return n&&l.push("bc-segmented-control--disabled"),l.join(" ")}function Rt({options:e,value:n,onChange:l,size:a="md",disabled:r=!1},...o){const s=At.f(e).map(([c,u])=>({key:c,label:u}));return t.WithElement(()=>{const c=Object.fromEntries(s.map((i,m)=>[i.key,m])),u=t.prop(s.map(()=>({left:0,width:0})),Nt);return t.html.div(t.attr.class(t.computedOf(a,r)((i,m)=>Lt(i??"md",m??!1))),t.html.div(t.attr.class("bc-segmented-control__container"),t.html.div(t.attr.class("bc-segmented-control__indicator"),t.style.width(t.computedOf(n,u)((i,m)=>{const{width:d}=m[c[i]??0];return`${d}px`})),t.style.left(t.computedOf(n,u)((i,m)=>{const{left:d}=m[c[i]??0];return`${d}px`}))),s.map(({label:i,key:m},d)=>t.html.button(t.attr.type("button"),t.on.click(b=>{b.preventDefault(),t.Value.get(r)||l?.(m)}),t.attr.disabled(r),t.attr.class("bc-segmented-control__segment"),t.attr.class(t.Value.map(n,b=>b===m?"bc-segmented-control__segment--active":"bc-segmented-control__segment--inactive")),nt.ElementRect(b=>{function p(){u.update(f=>{const V=[...f];return V[d]={width:b.value.width,left:b.value.localLeft},V})}const v=Dt.g(p);return t.OnDispose(v,b.on(p))}),i))),...o)})}function zt(e){const n=e.type.toLowerCase();return n.startsWith("image/")&&(n.includes("jpeg")||n.includes("jpg")||n.includes("png")||n.includes("gif")||n.includes("webp")||n.includes("svg"))}function Wt(e){const n=e.type.toLowerCase();return n.startsWith("image/")?"vscode-icons:file-type-image":n.startsWith("video/")?"vscode-icons:file-type-video":n.startsWith("audio/")?"vscode-icons:file-type-audio":n.includes("pdf")?"vscode-icons:file-type-pdf2":n.includes("word")||n.includes("document")?"vscode-icons:file-type-word":n.includes("excel")||n.includes("spreadsheet")?"vscode-icons:file-type-excel":n.includes("powerpoint")||n.includes("presentation")?"vscode-icons:file-type-powerpoint":n.includes("zip")||n.includes("archive")?"vscode-icons:file-type-zip":n.includes("text")?"vscode-icons:file-type-text":n.includes("json")?"vscode-icons:file-type-json-official":n.includes("csv")?"vscode-icons:file-type-csv":n.includes("xml")?"vscode-icons:file-type-xml":n.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function ot(e){return t.When(e.map(zt),()=>{const n=t.prop(null);return e.on(l=>{n.value&&URL.revokeObjectURL(n.value);const a=URL.createObjectURL(l);n.value=a}),t.html.div(t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(n),t.attr.alt(e.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail"),t.OnDispose(()=>{n.value&&URL.revokeObjectURL(n.value)})))},()=>w.Icon({icon:e.map(Wt)}))}const dt=(e,...n)=>{const{value:l=t.prop([]),accept:a="*/*",maxFiles:r,maxFileSize:o,onChange:s,onBlur:c,disabled:u,hasError:i,mode:m="default",showFileList:d=!0,...b}=e,p=l,v=t.Value.map(m,C=>C==="compact"),f=C=>{let I=C;if(r!=null){const x=t.Value.get(r);I=I.slice(0,x)}if(o){const x=t.Value.get(o);I=I.filter(y=>y.size<=x)}s?.(I)},V=C=>{const x=p.value.filter((y,_)=>_!==C);s?.(x)},h=()=>{s?.([])},g=({files:C,clear:I,change:x})=>t.Use(w.BeatUII18n,y=>t.html.div(t.attr.class("bc-file-input__drop-zone"),t.html.div(t.attr.class("bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"),w.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(y.$.filesInputInstructions)(r,o,y.$.fileSizeUnits.value))))),k=({files:C})=>t.Use(w.BeatUII18n,I=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(C.map(x=>x.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(C,x=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),ot(x),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),x.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),w.Icon({icon:"mdi:cloud-upload-outline",size:"sm"})," ",t.bind(I.$.filesInputInstructions)(r,o,I.$.fileSizeUnits.value)))));return t.Use(w.BeatUII18n,C=>w.InputContainer({baseContainer:t.Value.map(v,I=>!I),disabled:u,hasError:i,after:t.When(v,()=>t.When(p.map(({length:I})=>I>0),()=>A.CloseButton({size:"sm",label:C.$.clearAllFiles,disabled:u,onClick:h},t.attr.class("bc-file-input__compact-clear")))),...b,input:t.When(v,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),J({value:p,accept:a,enableClick:!0,allowMultiple:t.Value.map(r??1/0,I=>I>1),disabled:u,onChange:f,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),J({value:p,accept:a,enableClick:!0,allowMultiple:t.Value.map(r??1/0,I=>I>1),disabled:u,onChange:f,content:g}),t.When(d,()=>t.NotEmpty(p,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(p,(I,x)=>{const y=x.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),ot(I)),t.html.div(t.attr.class("bc-file-input__file-info"),t.html.div(t.attr.class("bc-file-input__file-name"),t.attr.title(I.$.name),I.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(I.$.size,C.$.fileSizeUnits)((_,M)=>w.formatFileSize(_,{units:M}))," • ",t.computedOf(I.$.type,C.$.unknownType)((_,M)=>_||M))),A.CloseButton({size:"sm",label:C.$.removeFile,disabled:u,onClick:()=>V(y)},t.attr.class("bc-file-input__remove-button")))})),t.When(p.map(({length:I})=>I>1),()=>t.html.div(t.attr.class("bc-file-input__clear-all-button-container"),t.html.button(t.attr.type("button"),t.attr.class("bc-file-input__clear-all-button"),t.attr.disabled(u),C.$.clearAllFiles,t.on.click(I=>{I.preventDefault(),I.stopPropagation(),h()})))))))))},...n))};async function mt(e){return new Promise((n,l)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const r=a.result;n(r.split(",")[1])},a.onerror=r=>l(r)})}function Pt(e){return Promise.all(e.map(mt))}function jt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Ht(e){const n=Ut(e??""),l=n.length,a=new Uint8Array(l);for(let r=0;r<l;r++)a[r]=n.charCodeAt(r);return a}function ft(e){const{value:n,onChange:l,onInput:a,...r}=e,o=new Map,s=t.Value.toSignal(n).map(m=>m.map((d,b)=>{const p=o.get(d),v=Ht(d??""),f=p?.type||jt(v),V=p?.name??`file-${b}`,h=v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength),g=new Blob([h],{type:f});return new File([g],V,{type:f})})),c=m=>d=>{m&&Pt(d).then(b=>{for(const[p,v]of b.entries())o.set(v,{name:d[p].name,type:d[p].type});m(b)})},u=c(l),i=c(a);return dt({...r,value:s,onChange:u,onInput:i})}function Zt(e){const{value:n,onInput:l,onChange:a,...r}=e;return ft({...r,maxFiles:1,value:t.Value.map(n,o=>o==null?[]:[o]),onChange:o=>{a?.(o[0])},onInput:o=>{l?.(o[0])}})}function K(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]:[0,0,0]}function tt(e,n,l){const a=r=>r.toString(16).padStart(2,"0");return`#${a(Math.max(0,Math.min(255,e)))}${a(Math.max(0,Math.min(255,n)))}${a(Math.max(0,Math.min(255,l)))}`}function qt(e){if(!e)return[0,0,0,1];const l=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(l){const d=l[1];if(d.length===8){const b=parseInt(d.slice(0,2),16),p=parseInt(d.slice(2,4),16),v=parseInt(d.slice(4,6),16),f=parseInt(d.slice(6,8),16)/255;return[b,p,v,f]}if(d.length===6)return[parseInt(d.slice(0,2),16),parseInt(d.slice(2,4),16),parseInt(d.slice(4,6),16),1];if(d.length===4){const b=parseInt(d[0]+d[0],16),p=parseInt(d[1]+d[1],16),v=parseInt(d[2]+d[2],16),f=parseInt(d[3]+d[3],16)/255;return[b,p,v,f]}if(d.length===3){const b=parseInt(d[0]+d[0],16),p=parseInt(d[1]+d[1],16),v=parseInt(d[2]+d[2],16);return[b,p,v,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const r=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(r)return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),1];const o=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(o){const d=parseFloat(o[1]),b=parseFloat(o[2]),p=parseFloat(o[3]),v=o[4]!=null?parseFloat(o[4]):1,[f,V,h]=ht(d,b/100,p/100);return[f,V,h,v]}const s=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const d=parseFloat(s[1]),b=parseFloat(s[2])/100,p=parseFloat(s[3])/100,v=s[4]!=null?parseFloat(s[4]):1,[f,V,h]=Gt(d,b,p);return[f,V,h,v]}const c=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(c){const d=c[1],b=parseFloat(c[2]),p=parseFloat(c[3]),v=c[4]!=null?parseFloat(c[4]):1,f=d.endsWith("%")?Math.max(0,Math.min(1,parseFloat(d)/100)):Math.max(0,Math.min(1,parseFloat(d))),[V,h,g]=Jt(f,b,p);return[V,h,g,v]}const[u,i,m]=K(e);return[u,i,m,1]}const Yt=(e,n,l,a)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(l)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`;function Xt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function ht(e,n,l){e=(e%360+360)%360;const a=(1-Math.abs(2*l-1))*n,r=a*(1-Math.abs(e/60%2-1)),o=l-a/2;let s=0,c=0,u=0;return 0<=e&&e<60?[s,c,u]=[a,r,0]:60<=e&&e<120?[s,c,u]=[r,a,0]:120<=e&&e<180?[s,c,u]=[0,a,r]:180<=e&&e<240?[s,c,u]=[0,r,a]:240<=e&&e<300?[s,c,u]=[r,0,a]:[s,c,u]=[a,0,r],[Math.round((s+o)*255),Math.round((c+o)*255),Math.round((u+o)*255)]}function Gt(e,n,l){e=(e%360+360)%360;const a=n+l;a>1&&(n/=a,l/=a);const[r,o,s]=ht(e,1,.5).map(d=>d/255),c=1-n-l,u=r*c+n,i=o*c+n,m=s*c+n;return[Math.round(u*255),Math.round(i*255),Math.round(m*255)]}function et(e,n,l){e/=255,n/=255,l/=255;const a=Math.max(e,n,l),r=Math.min(e,n,l);let o=0,s=0;const c=(a+r)/2,u=a-r;if(u!==0){switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(n-l)/u+(n<l?6:0);break;case n:o=(l-e)/u+2;break;default:o=(e-n)/u+4}o*=60}return[Math.round(o),Math.round(s*100),Math.round(c*100)]}function Qt(e,n,l){const[a]=et(e,n,l),r=e/255,o=n/255,s=l/255,c=Math.min(r,o,s),u=1-Math.max(r,o,s);return[a,Math.round(c*100),Math.round(u*100)]}function X(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function G(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function Jt(e,n,l){const a=l*Math.PI/180,r=Math.cos(a)*n,o=Math.sin(a)*n,s=e+.3963377774*r+.2158037573*o,c=e-.1055613458*r-.0638541728*o,u=e-.0894841775*r-1.291485548*o,i=s*s*s,m=c*c*c,d=u*u*u,b=4.0767416621*i-3.3077115913*m+.2309699292*d,p=-1.2684380046*i+2.6097574011*m-.3413193965*d,v=-.0041960863*i-.7034186147*m+1.707614701*d;return[G(b),G(p),G(v)]}function Kt(e,n,l){const a=X(e),r=X(n),o=X(l),s=.4122214708*a+.5363325363*r+.0514459929*o,c=.2119034982*a+.6806995451*r+.1073969566*o,u=.0883024619*a+.2817188376*r+.6299787005*o,i=Math.cbrt(s),m=Math.cbrt(c),d=Math.cbrt(u),b=.2104542553*i+.793617785*m-.0040720468*d,p=1.9779984951*i-2.428592205*m+.4505937099*d,v=.0259040371*i+.7827717662*m-.808675766*d,f=Math.sqrt(p*p+v*v);let V=Math.atan2(v,p)*180/Math.PI;return V<0&&(V+=360),[b,f,V]}function P(e,n,l,a,r,o){switch(r){case"hex":if(o){const s=u=>u.toString(16).padStart(2,"0"),c=Math.max(0,Math.min(255,Math.round(a*255)));return`#${s(e)}${s(n)}${s(l)}${s(c)}`}return tt(e,n,l);case"rgb":return`rgb(${e}, ${n}, ${l})`;case"rgba":return`rgba(${e}, ${n}, ${l}, ${Math.round(a*100)/100})`;case"hsl":{const[s,c,u]=et(e,n,l);return`hsl(${s}, ${c}%, ${u}%)`}case"hsla":{const[s,c,u]=et(e,n,l);return`hsla(${s}, ${c}%, ${u}%, ${Math.round(a*100)/100})`}case"hwb":{const[s,c,u]=Qt(e,n,l);return a<1?`hwb(${s} ${c}% ${u}% / ${Math.round(a*100)/100})`:`hwb(${s} ${c}% ${u}%)`}case"oklch":{const[s,c,u]=Kt(e,n,l),i=(Math.round(s*1e3)/1e3).toFixed(3),m=(Math.round(c*1e3)/1e3).toFixed(3),d=(Math.round(u*10)/10).toFixed(1),b=Math.round(a*100)/100;return o||a<1?`oklch(${i} ${m} ${d} / ${b})`:`oklch(${i} ${m} ${d})`}}}function j(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}function te(e,n){const[l,a,r]=e,o=l<<16^a<<8^r,s=Xt(o),c=6+Math.floor(s()*5),u=.18+s()*.06,i=[];for(let p=0;p<c;p++){const v=p/c*Math.PI*2,f=n*(1+(s()*2-1)*u),V=Math.cos(v)*f,h=Math.sin(v)*f;i.push({x:V,y:h})}const m=(i[0].x+i[c-1].x)/2,d=(i[0].y+i[c-1].y)/2;let b=`M ${m.toFixed(3)} ${d.toFixed(3)}`;for(let p=0;p<c;p++){const v=i[p],f=i[(p+1)%c],V=(v.x+f.x)/2,h=(v.y+f.y)/2;b+=` Q ${v.x.toFixed(3)} ${v.y.toFixed(3)} ${V.toFixed(3)} ${h.toFixed(3)}`}return b+=" Z",b}const ee=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,displayValue:o,size:s,withAlpha:c}=e,u=t.Value.map(s??32,x=>x),i=t.Value.map(n,x=>qt(x??"#000000")),m=t.Value.map(i,([x,y,_])=>[x,y,_]),d=t.Value.map(i,([,,,x])=>x),b=t.prop(t.Value.get(d)??1),p=t.Value.map(c??!1,x=>x),v=t.Value.map(e.colorTextFormat??"rgb",x=>x),f=t.computedOf(m,b,v,p)(([x,y,_],M,E,$)=>P(x,y,_,M??1,j(E,$),$)),V=t.Value.map(e.colorTextFormat??"hex",x=>x),h=t.Value.map(u,x=>`${-x/2} ${-x/2} ${x} ${x}`),g=t.computedOf(m,u)((x,y)=>te(x,y/2)),k=t.computedOf(m,b,p)(([x,y,_],M,E)=>E||M<1?Yt(x,y,_,M):tt(x,y,_)),C=t.html.div(t.attr.class("bc-color-input__control"),t.attr.class(t.Value.map(p,x=>x?"bc-color-input__control--alpha":"")),t.attr.style(t.computedOf(u)(x=>`min-width:${x+2}px;height:${x+2}px`)),t.svg.svg(t.attr.class("bc-color-input__svg"),t.svgAttr.viewBox(h),t.svg.path(t.svgAttr.d(g),t.svgAttr.fill(k))),t.html.input(t.attr.type("color"),w.CommonInputAttributes(e),t.attr.value(t.Value.map(m,([x,y,_])=>tt(x,y,_))),t.attr.class("bc-input bc-color-input bc-color-input__native"),l!=null?t.on.blur(l):t.Empty,a!=null?t.on.change(x=>{const y=x.target.value;if(!a)return;const[_,M,E]=K(y),$=t.Value.get(b)??1,F=j(t.Value.get(V),t.Value.get(p)),T=P(_,M,E,$,F,t.Value.get(p));a(T)}):t.Empty,r!=null?t.on.input(x=>{const y=x.target.value;if(!r)return;const[_,M,E]=K(y),$=t.Value.get(b)??1,F=j(t.Value.get(V),t.Value.get(p)),T=P(_,M,E,$,F,t.Value.get(p));r(T)}):t.Empty)),I=t.When(p,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(b,x=>String(x??1))),t.attr.disabled(e.disabled),t.on.input(x=>{const y=parseFloat(x.target.value);b.set(y);const[_,M,E]=t.Value.get(m),$=j(t.Value.get(V),t.Value.get(p)),F=P(_,M,E,y,$,t.Value.get(p));r?.(F)}),t.on.change(x=>{const y=parseFloat(x.target.value);b.set(y);const[_,M,E]=t.Value.get(m),$=j(t.Value.get(V),t.Value.get(p)),F=P(_,M,E,y,$,t.Value.get(p));a?.(F)})));return w.InputContainer({baseContainer:!0,...e,growInput:!1,input:C,after:t.Fragment(t.When(o??!1,()=>t.html.span(t.attr.class("bc-color-input__rgb"),f)),I,e.after)})},at="$$tts-exp-",gt=(e,n)=>t.WithElement(l=>{const a=`${at}${e}`;return t.OnDispose(t.Value.on(n,r=>Reflect.set(l,a,r)))}),ne=(e,n)=>{const l=`${at}${e}`;return a=>{n(Reflect.get(a.target,l))}},bt=(e,n)=>{const l=`${at}${e}`;return a=>{const r=a.target,o=r.selectedIndex,s=r.options[o];n(Reflect.get(s,l))}};function ae(e,n,l){const a=["bc-card"];return e!=="default"&&a.push(`bc-card--${e}`),n!=="md"&&a.push(`bc-card--padding-${n}`),l!=="lg"&&a.push(`bc-card--rounded-${l}`),a.join(" ")}function re({variant:e="default",size:n="md",roundedness:l="lg"}={},...a){return t.html.div(t.attr.class(t.computedOf(e,n,l)((r,o,s)=>ae(r??"default",o??"md",s??"lg"))),...a)}function H(...e){return t.html.div(t.attr.class("bc-group"),...e)}const le=({startEditing:e,value:n,onChange:l,placeholder:a,disabled:r})=>{const o=t.Value.deriveProp(e??!1),s=t.prop(!1),c=t.Value.map(r??!1,u=>u);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(c,u=>u?"bc-editable-text--disabled":"")),t.aria.disabled(c),t.When(o,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),nt.AutoSelect(),t.on.keydown(u=>{u.key==="Enter"?o.set(!1):u.key==="Escape"&&(s.set(!0),o.set(!1))}),t.on.blur(t.emitValue(u=>{if(o.set(!1),s.value){s.set(!1);return}l(u)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(c)||o.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,u=>u!=null&&u.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(c,u=>!u),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(w.BeatUII18n,u=>t.aria.label(u.$.editLabel)),t.on.click(()=>o.set(!0)),w.Icon({icon:"line-md/pencil",color:"neutral"}))))))},vt=(e,n,l)=>t.Ensure(e,a=>t.OneOfType(a,{value:r=>{const o=t.computedOf(r,l)((s,c)=>n(s.value,c));return t.html.option(t.OnDispose(o.dispose),t.attr.selected(o),gt("value",r.$.value),r.$.label)},group:r=>t.html.optgroup(t.attr.label(r.$.group),t.ForEach(r.$.options,o=>vt(o,n,l))),break:()=>t.html.hr()})),xt=e=>{const{value:n,onBlur:l,onChange:a,options:r,unselectedLabel:o,equality:s=(i,m)=>i===m,after:c}=e;let u;return w.InputContainer({...e,after:t.Fragment(w.Icon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),c),input:t.html.select(t.WithElement(i=>{u=i;const m=new MutationObserver(d=>{const{removedNodes:b}=d[0];b.length>0&&(u.selectedIndex=0)});return m.observe(i,{childList:!0}),t.OnDispose(()=>m.disconnect())}),w.CommonInputAttributes(e),t.attr.class("bc-native-select bc-input"),t.Use(w.BeatUII18n,i=>t.html.option(t.attr.hidden("hidden"),t.coalesce(o,i.$.selectOne))),t.ForEach(r,i=>vt(i,s,n)),l!=null?t.on.blur(l):t.Empty,a!=null?t.on.change(bt("value",i=>a(i))):t.Empty)},t.on.click(()=>{u?.focus(),typeof u?.showPicker=="function"&&u.showPicker()}))};function It(e){const{controller:n,onChange:l,onBlur:a,...r}=e;return xt({...r,value:n.signal,onChange:A.makeOnChangeHandler(n,l),onBlur:A.makeOnBlurHandler(n,a)})}function se(e){return A.InputWrapper({...e,content:It(e)})}function Vt(e,n,l){const a=e.length.map(r=>r);return t.Fragment(t.OnDispose(()=>a.dispose()),t.Repeat(a,r=>{const o=e.item(r.index),s=[];return t.Fragment(t.OnDispose(()=>{o.dispose(),s.forEach(c=>c())}),n({list:e,item:o,position:r,remove:()=>e.removeAt(r.index),move:c=>{switch(c){case"up":if(r.index===0)return;e.move(r.index,r.index-1);break;case"down":if(r.index===e.length.value-1)return;e.move(r.index,r.index+1);break;case"first":e.move(r.index,0);break;case"last":e.move(r.index,e.length.value-1)}},canMove:c=>{const u=(()=>{switch(c){case"up":return t.signal(r.index>0);case"down":return e.length.map(i=>r.index<i-1)}})();return s.push(()=>u.dispose()),u},cannotMove:c=>{const u=(()=>{switch(c){case"up":return t.signal(r.index===0);case"down":return e.length.map(i=>r.index===i-1)}})();return s.push(()=>u.dispose()),u}}))},l))}const ut={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:e=>e.toUpperCase()},"*":{pattern:/^.$/}},oe=e=>e instanceof RegExp;function wt(e,n,l){if(e==null)return[];const a=l?{...ut,...n}:n??ut,r=(s,c)=>{const u=a[c];u?s.push({type:"pattern",name:c,...u}):s.push({type:"literal",char:c})},o=[];if(typeof e=="string"){for(const s of e)r(o,s);return o}for(const s of e)if(typeof s=="string")if(s.length<=1)r(o,s);else for(const c of s)r(o,c);else oe(s)?o.push({type:"pattern",pattern:s}):typeof s=="object"&&s&&o.push(s);return o}function ue(e,n){return l=>{switch(e){case"digits":return/[0-9]/.test(l);case"letters":return/[A-Za-z]/.test(l);case"alphanumeric":return/[A-Za-z0-9]/.test(l);case"custom":return n?.(l)??!0;default:return!0}}}function ct(e,n,l,a,r,o){const s={raw:e,previousConformed:n,cursor:r??e.length,completed:!1},c=a.definitions??{},u=typeof l=="function"?l(e,s):l,i=wt(u,c,a.useDefaultDefinitions??!0),m=ue(a.allowMode,a.allow),d=new Set;for(const $ of i)$.type==="literal"&&d.add($.char);if(a.prefix)for(const $ of a.prefix)d.add($);if(a.suffix)for(const $ of a.suffix)d.add($);const b=Array.from(e).filter($=>m($)&&!d.has($));if(b.length===0)return{value:"",cursor:0,completed:!1};const p=[],v=[];let f=0,V=0,h=0,g=-1;for(const $ of i){if($.type==="literal"){p.push($.char),v.push({kind:"literal",filled:!0});continue}V+=$.optional?0:1;const F=b[f];if(F==null)break;if($.type==="any"){h++,p.push($.transform?$.transform(F):F),v.push({kind:"slot",filled:!0}),g=v.length-1,f++;continue}if($.type==="pattern")if($.pattern.test(F)){h++;const T=$.transform?$.transform(F):F;p.push(T),v.push({kind:"slot",filled:!0}),g=v.length-1,f++}else{f++;continue}}const k=p.join(""),C=(a.prefix??"")+k+(a.suffix??"");let x=(a.prefix??"").length;if(g>=0){let $=g+1;if((o?.policy??"smart")!=="sticky")for(;$<v.length&&v[$].kind==="literal";)$++;x+=$}const y=a.completion?.mode==="min"?(a.completion.minChars??0)<=h:a.completion?.mode==="custom"?!!a.completion.isComplete?.(C):V>0&&h>=V,_=a.pipe?.(C,{...s,completed:y});let M,E=x;return _===!1?(M=n,E=n.length):typeof _=="string"?(M=_,E=_.length):typeof _=="object"&&_?(M=_.value,E=_.cursor??_.value.length):M=C,{value:M,cursor:E,completed:y}}function ce(e,n){const l=n?.strategy??"none";return l==="custom"&&n?.unmask?n.unmask(e):l==="strip"?e.replace(/[^A-Za-z0-9]/g,""):e}const rt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,onAccept:o,onComplete:s,mask:c,definitions:u,useDefaultDefinitions:i,extraLiterals:m,prefix:d,suffix:b,autofix:p,pipe:v,completion:f,unmask:V,allowMode:h,allow:g,placeholder:k,placeholderOptions:C}=e,I=t.computedOf(n,c,u,i,m,d,b,p,f,V,h,k,C)((y,_,M,E,$,F,T,z,W,R,U,Z,O)=>_?ct(y??"","",_,{definitions:M??{},useDefaultDefinitions:E??!0,extraLiterals:$??[],autofix:z??"none",completion:W??{mode:"mask"},pipe:v??(D=>D),unmask:R??{strategy:"none"},allowMode:U??"all",allow:g,prefix:F,suffix:T}).value:y??""),x=(y,_)=>{const M=y.value??"",E=t.Value.get(n)??"",$=c!=null?t.Value.get(c):null,F=u!=null?t.Value.get(u):void 0,T=i!=null?t.Value.get(i):void 0,z=m!=null?t.Value.get(m):void 0,W=p!=null?t.Value.get(p):void 0,R=f!=null?t.Value.get(f):void 0,U=V!=null?t.Value.get(V):void 0,Z=h!=null?t.Value.get(h):void 0,O=d!=null?t.Value.get(d):void 0,D=b!=null?t.Value.get(b):void 0,{value:N,cursor:Y,completed:lt}=$?ct(M,E,$,{definitions:F??{},useDefaultDefinitions:T??!0,extraLiterals:z??[],autofix:W??"none",completion:R??{mode:"mask"},pipe:v??(Ft=>Ft),unmask:U??{strategy:"none"},allowMode:Z??"all",allow:g,prefix:O,suffix:D},y.selectionStart??M.length,e.cursor?t.Value.get(e.cursor):void 0):{value:M,cursor:M.length,completed:!0};if(N!==M){y.value=N;try{y.setSelectionRange(Y,Y)}catch{}}const st=ce(N,U);o?.({raw:st,conformed:N,completed:lt,cursor:Y}),_==="input"?r?.(N):(a?.(N),lt&&s?.({raw:st,conformed:N}))};return w.InputContainer({...e,input:t.input.text(w.CommonInputAttributes(e),t.attr.value(I),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(y=>y instanceof HTMLInputElement?t.Fragment(t.on.input(()=>x(y,"input")),t.on.change(()=>x(y,"change")),t.on.keydown(_=>{if(_.key!=="Backspace"||!(e.cursor?t.Value.get(e.cursor)?.backspaceRubberBand??!0:!0))return;const E=y.selectionStart??0,$=y.selectionEnd??E;if(E!==$||E<=0)return;const F=y.value??"",T=c!=null?t.Value.get(c):null;if(!T)return;const z=u!=null?t.Value.get(u):void 0,W=i!=null?t.Value.get(i):!0,R=d!=null?t.Value.get(d):void 0,U=b!=null?t.Value.get(b):void 0,Z=wt(typeof T=="function"?T(F,{raw:F,previousConformed:F,cursor:E,completed:!1}):T,z??{},W??!0),O=new Set;for(const D of Z)D.type==="literal"&&O.add(D.char);if(R)for(const D of R)O.add(D);if(U)for(const D of U)O.add(D);if(O.has(F[E-1])){let D=E-1;for(;D>=0&&O.has(F[D]);)D--;D>=0&&(_.preventDefault(),_.stopPropagation(),y.value=F.slice(0,D)+F.slice(D+1),x(y,"input"))}})):t.Empty))})};function B(e,n,l){const a=t.Value.map(e,o=>o!=null),r=w.defaultMessages.clearValue;return t.When(a,()=>t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(r),t.attr.title(r),t.attr.disabled(n??!1),w.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.preventDefault(),o.stopPropagation(),l?.(null)})))}const ie=e=>{const{value:n,onBlur:l,onChange:a,after:r,disabled:o}=e,s=B(n,o,a);return w.InputContainer({...e,input:t.input.date(w.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty),after:r!=null?t.Fragment(s,r):s})},pe=e=>{const n=e.getFullYear(),l=e.getMonth()+1,a=e.getDate(),r=e.getHours(),o=e.getMinutes(),s=e.getSeconds();return`${n}-${l.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},de=e=>{const{value:n,onBlur:l,onChange:a,after:r,disabled:o}=e,s=t.Value.map(n,u=>u!=null?pe(u):null),c=B(n,o,a);return w.InputContainer({...e,input:t.input["datetime-local"](w.CommonInputAttributes(e),t.attr.value(t.Value.map(s,u=>u??null)),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty),after:r!=null?t.Fragment(c,r):c})},S=e=>typeof e=="string"&&e.trim()===""?null:e,L=e=>e??"",me=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return w.TextInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},fe=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return A.EmailInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},he=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return A.PasswordInput({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},yt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,rows:o}=e;return w.InputContainer({...e,input:t.html.textarea(w.CommonInputAttributes(e),t.attr.rows(o??3),t.attr.value(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValue(a)):t.Empty,r!=null?t.on.input(t.emitValue(r)):t.Empty)})},ge=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return yt({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},be=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c,after:u}=e,i=b=>{const p=a!=null?t.Value.get(a):void 0,v=r!=null?t.Value.get(r):void 0;return p!=null&&b<p?p:v!=null&&b>v?v:b},m=l!=null?t.Use(w.BeatUII18n,b=>{const p=t.computedOf(n,a)((h,g)=>g==null?!0:(h??0)>g),v=t.computedOf(n,r)((h,g)=>g==null?!0:(h??0)<g),f=h=>{const g=t.Value.get(n)??0,k=t.Value.get(l),C=h?.shiftKey?10:1,I=g-k*C,x=a!=null?t.Value.get(a):void 0;if(x!=null&&I<x)return;const y=i(I);y!==g&&s&&s(y)},V=h=>{const g=t.Value.get(n)??0,k=t.Value.get(l),C=h?.shiftKey?10:1,I=g+k*C,x=r!=null?t.Value.get(r):void 0;if(x!=null&&I>x)return;const y=i(I);y!==g&&s&&s(y)};return A.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(v,e.disabled??!1)((h,g)=>!h||g)),t.on.click(h=>V(h)),t.aria.label(b.$.incrementValue),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(p,e.disabled??!1)((h,g)=>!h||g)),t.on.click(h=>f(h)),t.aria.label(b.$.decrementValue),w.Icon({icon:"line-md:minus",size:"xs"})))}):null,d=u!=null&&m!=null?t.Fragment(m,u):u??m;return w.InputContainer({...e,input:t.input.number(a!=null?t.Fragment(t.attr.min(a),t.OnDispose(t.Value.on(a,b=>{b<t.Value.get(n)}))):t.Empty,r!=null?t.Fragment(t.attr.max(r),t.OnDispose(t.Value.on(r,b=>{b>t.Value.get(n)}))):t.Empty,w.CommonInputAttributes(e),t.attr.valueAsNumber(n),t.attr.step(l),t.attr.class("bc-input bc-number-input"),o!=null?t.on.blur(t.emitValue(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(s)):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(c)):t.Empty,l!=null?t.on.wheel(b=>{b.preventDefault();const p=t.Value.get(n)??0,v=t.Value.get(l),f=b.shiftKey?10:1,V=b.deltaY<0?v*f:-v*f,h=i(p+V);h!==p&&s&&s(h)}):t.Empty),after:d})},it=e=>{if(e==null||e==="")return null;const n=Number(e);return Number.isNaN(n)?null:n},ve=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c,after:u}=e,i=p=>{const v=a!=null?t.Value.get(a):void 0,f=r!=null?t.Value.get(r):void 0;return v!=null&&p<v?v:f!=null&&p>f?f:p},m=(()=>{if(l==null)return null;const p=t.computedOf(n,a)((g,k)=>{const C=g??0;return k==null?!0:C>k}),v=t.computedOf(n,r)((g,k)=>{const C=g??0;return k==null?!0:C<k}),f=g=>{const k=t.Value.get(n)??0,C=t.Value.get(l),I=g?.shiftKey?10:1,x=k-C*I,y=a!=null?t.Value.get(a):void 0;if(y!=null&&x<y)return;const _=i(x);_!==k&&s&&s(_)},V=g=>{const k=t.Value.get(n)??0,C=t.Value.get(l),I=g?.shiftKey?10:1,x=k+C*I,y=r!=null?t.Value.get(r):void 0;if(y!=null&&x>y)return;const _=i(x);_!==k&&s&&s(_)};return((g,k)=>A.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(v,e.disabled??!1)((C,I)=>!C||I)),t.on.click(C=>V(C)),t.aria.label(g),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(p,e.disabled??!1)((C,I)=>!C||I)),t.on.click(C=>f(C)),t.aria.label(k),w.Icon({icon:"line-md:minus",size:"xs"}))))(w.defaultMessages.incrementValue,w.defaultMessages.decrementValue)})(),d=B(n,e.disabled,s),b=u!=null&&m!=null?t.Fragment(m,d,u):u!=null?t.Fragment(d,u):m!=null?t.Fragment(m,d):d;return w.InputContainer({...e,input:t.input.number(a!=null?t.Fragment(t.attr.min(a),t.OnDispose(t.Value.on(a,p=>{}))):t.Empty,r!=null?t.Fragment(t.attr.max(r),t.OnDispose(t.Value.on(r,p=>{}))):t.Empty,w.CommonInputAttributes(e),t.attr.value(t.Value.map(n,p=>p==null?"":String(p))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),o!=null?t.on.blur(t.emitValue(o)):t.Empty,s!=null?t.on.change(t.emitValue(p=>{const v=it(p);s(v)})):t.Empty,c!=null?t.on.input(t.emitValue(p=>{const v=it(p);c(v)})):t.Empty,l!=null?t.on.wheel(p=>{p.preventDefault();const v=t.Value.get(n)??0,f=t.Value.get(l),V=p.shiftKey?10:1,h=p.deltaY<0?f*V:-f*V,g=i(v+h);g!==v&&s&&s(g)}):t.Empty),after:b})},xe=({value:e,onChange:n,offLabel:l,onLabel:a,label:r,disabled:o=!1,size:s="md",id:c,color:u="primary"})=>{const i=c??A.sessionId("switch"),m=`${i}-label`;function d(f,V){const h=["bc-switch",`bc-switch--size-${V}`,`bc-switch--${V}`];return f&&h.push("bc-switch--disabled"),h.join(" ")}function b(f){const V=f??"primary",h=new Map,g=w.backgroundValue(V,"solid","light"),k=w.backgroundValue(V,"solid","dark");return h.set("--switch-track-on-bg",g.backgroundColor),h.set("--switch-track-on-label",g.textColor),h.set("--switch-track-on-bg-dark",k.backgroundColor),h.set("--switch-track-on-label-dark",k.textColor),h.set("--switch-track-on-border-dark",w.borderColorValue(V,"dark")),Array.from(h.entries()).map(([C,I])=>`${C}: ${I}`).join("; ")}const p=()=>{t.Value.get(o)||n(!t.Value.get(e))},v=f=>{t.Value.get(o)||(f.key===" "||f.key==="Enter")&&(f.preventDefault(),p())};return t.html.div(t.attr.class(t.computedOf(o??!1,s)((f,V)=>d(f??!1,V??"md"))),t.attr.style(t.computedOf(u)(f=>b(f))),t.attr.id(i),t.attr.role("switch"),t.attr.tabindex(t.Value.map(o,f=>f?-1:0)),t.aria.checked(e),t.aria.disabled(o),t.aria.labelledby(r!=null?m:void 0),t.on.click(p),t.on.keydown(v),r!=null?A.Label(t.attr.id(m),t.attr.class(`bc-switch__label bc-switch__label--size-${s} bc-switch__label--nowrap`),r):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track--on":"bc-switch__track--off")),l!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),l):null,a!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,f=>f?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),a):null,nt.ElementRect(f=>t.Use(w.Locale,({direction:V})=>t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,h=>h?"bc-switch__thumb--on":"bc-switch__thumb--off")),t.style.transform(t.computedOf(e,f,s,V)((h,{width:g},k,C)=>{const I=(()=>{switch(k){case"xs":return 5;case"sm":return 5.5;case"md":return 6;case"lg":return 7;case"xl":return 8}})(),x=C==="rtl"?`calc((var(--spacing-base) * ${I}) - ${g}px)`:`calc(${g}px - (var(--spacing-base) * ${I}))`;return h?`translateX(${x})`:"translateX(0)"})))))))},Ct=e=>{const n={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:a=>a.toLowerCase()};return rt({...e,mask:[n,n,n,n,n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,"-",n,n,n,n,n,n,n,n,n,n,n,n],placeholder:e.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},Ie=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return Ct({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},Ve="line-md:star-alt-filled",we="line-md:star-alt",_t=e=>{const{value:n,onChange:l,disabled:a,max:r=5,fullColor:o="yellow",emptyColor:s="neutral",fullIcon:c=Ve,emptyIcon:u=we,size:i="md",onBlur:m,rounding:d=1}=e,b=()=>{const g=t.Value.get(d);return g>0?g:1},p=g=>Math.min(Math.max(g,0),t.Value.get(r)),v=(g,k)=>{if(t.Value.get(a??!1))return;const I=g.currentTarget.getBoundingClientRect(),x=(g.clientX-I.left)/I.width,y=k-1+x,_=b(),M=Math.ceil(y/_)*_,E=p(M);l?.(E)},f=g=>{if(t.Value.get(a??!1))return;const k=b(),C=t.Value.get(n)??0;let I;switch(g.key){case"ArrowRight":case"ArrowUp":I=p(C+k);break;case"ArrowLeft":case"ArrowDown":I=p(C-k);break;case"Home":I=0;break;case"End":I=t.Value.get(r);break;default:return}g.preventDefault(),l?.(I)},V=t.Value.map(i,g=>`bc-icon--${g}`),h=({index:g,counter:k})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(V),w.Icon({icon:u,size:i,color:s,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(V),t.style.width(t.Value.map(n,C=>{const I=Math.floor(C);return I>g?"100%":I<g?"0%":`${(C-g)*100}%`})),w.Icon({icon:c,size:i,color:o,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(C=>v(C,k),{preventDefault:!0,stopPropagation:!0})));return w.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(w.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(a??!1,g=>g?-1:0)),t.aria.disabled(a??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,g=>g??0)),t.aria.valuenow(t.Value.map(n,g=>g??0)),t.aria.valuetext(t.computedOf(n,r)((g,k)=>{const C=g??0,I=k??0;return`${String(C)} / ${String(I)}`})),t.on.keydown(f),m!=null?t.on.blur(m):null,t.Repeat(r,h))})},ye=e=>{const{value:n,onChange:l,onBlur:a,after:r,disabled:o,...s}=e,c=B(n,o,l);return _t({...s,value:t.Value.map(n,u=>u??0),onChange:l,onBlur:a,after:r!=null?t.Fragment(c,r):c})},Ce=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c}=e;return w.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),w.CommonInputAttributes(e),t.attr.min(a),t.attr.max(r),t.attr.step(l),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),o!=null?t.on.blur(t.emitValueAsNumber(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(s)):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(c)):t.Empty)})},_e=e=>{const{value:n,step:l,min:a,max:r,onBlur:o,onChange:s,onInput:c}=e,u=t.Value.map(n,m=>{if(m!=null)return m;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),i=B(n,e.disabled,m=>{s?.(m)});return w.InputContainer({...e,focusableSelector:'input[type="range"]',after:i,input:t.html.input(t.attr.type("range"),w.CommonInputAttributes(e),t.attr.min(a),t.attr.max(r),t.attr.step(l),t.attr.valueAsNumber(u),t.attr.class("bc-input bc-slider-input"),o!=null?t.on.blur(t.emitValueAsNumber(o)):t.Empty,s!=null?t.on.change(t.emitValueAsNumber(m=>{s(m)})):t.Empty,c!=null?t.on.input(t.emitValueAsNumber(m=>{c(m)})):t.Empty)},t.Fragment())};let Q=null;async function q(){const e=globalThis;return e.Temporal?e.Temporal:(Q||(Q=Promise.resolve().then(()=>require("./index.esm-DJRz9AE-.cjs")).then(n=>{const l=n.Temporal;return e.Temporal||(e.Temporal=l),l})),Q)}const kt=(e,n)=>n?t.Task(q,{then:e,pending:n.pending,error:n.error}):t.Task(q,e),ke=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,$e=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function $t(e){return{mask:null,allowMode:"custom",allow:n=>/[0-9ptwdhms]/i.test(n),pipe:n=>{const l=n.toUpperCase();return l.length===0?l:!l.startsWith("P")||!ke.test(l)?!1:l},completion:{mode:"custom",isComplete:n=>{const l=n.toUpperCase();if(!$e.test(l))return!1;try{return e(l),!0}catch{return!1}}}}}const pt=(e,n)=>{if(e==null)return null;try{return e.Duration.from(n)}catch{return null}},Me=e=>{const{value:n,onChange:l,after:a,disabled:r,onBlur:o}=e,s=()=>{const i=B(n,r,l);return a!=null?t.Fragment(i,a):i},c=e.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return kt(i=>rt({...e,value:t.Value.map(n,m=>m?.toString()??""),onChange:l?m=>l(m===""?null:i.Duration.from(m)):void 0,onInput:void 0,...$t(i.Duration.from),placeholder:"P0DT0H0M0S",after:s()}),{pending:()=>w.InputContainer({...e,input:t.input.text(w.CommonInputAttributes(e),t.attr.value(t.Value.map(n,i=>i?.toString()??"")),t.attr.class("bc-input"),c,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(i=>{const d=i.currentTarget?.value??"";if(d===""){l(null);return}const b=globalThis.Temporal,p=pt(b,d);if(p!=null){l(p);return}q().then(v=>{const f=pt(v,d);f!=null&&l(f)}).catch(()=>{})}):t.Empty),after:s()})})},Mt=e=>{const{value:n,onBlur:l,onChange:a,onInput:r}=e;return w.InputContainer({...e,input:t.input.url(w.CommonInputAttributes(e),t.attr.value(n),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,a!=null?t.on.change(t.emitValue(a)):t.Empty,r!=null?t.on.input(t.emitValue(r)):t.Empty)})},Ee=e=>{const{value:n,onBlur:l,onChange:a,onInput:r,after:o,disabled:s,...c}=e,u=B(n,s,a);return Mt({...c,value:t.Value.map(n,L),onChange:a!=null?i=>a(S(i)):void 0,onInput:r!=null?i=>r(S(i)):void 0,onBlur:l,after:o!=null?t.Fragment(u,o):u})},Et=e=>{const{controller:n,element:l,separator:a,showMove:r=!0,showRemove:o=!0,showAdd:s=!0,createItem:c,addLabel:u,controlsLayout:i="aside",removeDisabled:m,addDisabled:d}=e,b=t.Value.toSignal(i).map(f=>f==="aside"),p=f=>{const V=t.When(r??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(b.map(g=>g?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),w.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>f.move("up"),disabled:f.cannotMove("up")},t.Use(w.BeatUII18n,g=>w.Icon({size:"xs",icon:"line-md:arrow-up",title:g.$.incrementValue}))),w.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>f.move("down"),disabled:f.cannotMove("down")},t.Use(w.BeatUII18n,g=>w.Icon({size:"xs",icon:"line-md:arrow-down",title:g.$.decrementValue}))))),h=t.When(o,()=>t.Use(w.BeatUII18n,g=>A.CloseButton({size:"xs",label:t.Value.map(g.$.removeItem,k=>k.toLowerCase()),color:"danger",disabled:m,onClick:f.remove})));return g=>t.When(b,()=>H(t.attr.class("bc-group--gap-1 bc-group--align-center"),A.Stack(t.attr.class("bc-stack--grow"),g),A.Stack(t.attr.class("bc-stack--align-center"),t.When(n.signal.map(k=>k.length>1),()=>V),h)),()=>A.Stack(t.attr.class("bc-stack--gap-2"),g,H(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(n.signal.map(k=>k.length>1),()=>V,()=>t.html.div()),h)))},v=t.When(t.computedOf(s,c)((f,V)=>f&&V!=null),()=>H(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),w.Button({size:"sm",variant:"filled",onClick:()=>n.push(c()),disabled:t.computedOf(n.disabled,d??!1)((f,V)=>f||V)},t.Use(w.BeatUII18n,f=>H(t.attr.class("bc-group--gap-2"),w.Icon({icon:"line-md:plus"}),u??f.$.addLabel)))));return t.Fragment(Vt(n,f=>p(f)(l(f)),a),v)},Fe=(e,...n)=>{const{controller:l,element:a,separator:r,showMove:o,showRemove:s,showAdd:c,createItem:u,addLabel:i,controlsLayout:m,removeDisabled:d,addDisabled:b,...p}=e;return A.InputWrapper({...p,content:Et({controller:l,element:a,separator:r,showMove:o,showRemove:s,showAdd:c,createItem:u,addLabel:i,controlsLayout:m,removeDisabled:d,addDisabled:b})},...n)};class Ae extends A.Controller{branches;activeBranch;#e;#t=new Map;constructor(n,l,a,r,o,s,c=A.O){super(n,l,a,r,o,c),this.branches=s;const u=m=>{for(const d of s)if(d.detect(m))return d.key;return s[0]?.key??"unknown"};this.activeBranch=a.map(u,A.O);const i=m=>{if(this.#t.has(m))return this.#t.get(m);const d=s.find(p=>p.key===m);if(!d)throw new Error(`Unknown branch: ${m}`);const b=new A.Controller([...n,m],p=>{this.change(p)},this.signal.map(p=>d.detect(p)?p:d.defaultValue(),c),r.map(A.makeMapValidation([m])),{disabled:this.disabled,validationMode:this.parent.validationMode},c);return this.#t.set(m,b),b};this.#e=this.activeBranch.map(m=>i(m),A.O),this.onDispose(()=>{for(const m of this.#t.values())m.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(n){const l=this.branches.find(r=>r.key===n);if(!l)throw new Error(`Unknown branch: ${n}`);if(this.#t.has(n))return this.#t.get(n);const a=new A.Controller([...this.path,n],r=>{this.change(r)},this.signal.map(r=>l.detect(r)?r:l.defaultValue(),A.O),this.status.map(A.makeMapValidation([n])),{disabled:this.disabled,validationMode:this.parent.validationMode},A.O);return this.#t.set(n,a),a}switchToBranch(n,l=!1){const a=this.branches.find(s=>s.key===n);if(!a)throw new Error(`Unknown branch: ${n}`);const r=t.Value.get(this.signal);if(a.detect(r))return!0;if(a.convert){const s=a.convert(r);if(s.ok)return this.change(s.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const o=a.defaultValue();return this.change(o),!0}get activeBranchDefinition(){const n=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===n)}}function De(e){return e.transform(n=>n??null,n=>n??void 0)}function Te(e){return e.transform(n=>n??"",n=>n===""?void 0:n)}function Se(e){return e.transform(n=>n??void 0,n=>n??null)}exports.Base64Input=Zt;exports.Base64sInput=ft;exports.BaseListControl=Et;exports.BaseNativeSelectControl=It;exports.Card=re;exports.ColorInput=ee;exports.EditableText=le;exports.Expando=gt;exports.FilesInput=dt;exports.Group=H;exports.ListControl=Fe;exports.ListInput=Vt;exports.MaskInput=rt;exports.NativeSelect=xt;exports.NativeSelectControl=se;exports.NullableDateInput=ie;exports.NullableDateTimeInput=de;exports.NullableDurationInput=Me;exports.NullableEmailInput=fe;exports.NullableNumberInput=ve;exports.NullablePasswordInput=he;exports.NullableRatingInput=ye;exports.NullableResetAfter=B;exports.NullableSliderInput=_e;exports.NullableTextArea=ge;exports.NullableTextInput=me;exports.NullableUUIDInput=Ie;exports.NullableUrlInput=Ee;exports.NumberInput=be;exports.RatingInput=_t;exports.SegmentedInput=Rt;exports.SliderInput=Ce;exports.Switch=xe;exports.TextArea=yt;exports.UUIDInput=Ct;exports.UnionController=Ae;exports.UnstyledDropZone=J;exports.UrlInput=Mt;exports.WithTemporal=kt;exports._t=Ot;exports.durationMaskConfig=$t;exports.emitExpando=ne;exports.emitOptionExpando=bt;exports.emptyToNull=S;exports.ensureTemporal=q;exports.fileToBase64=mt;exports.gt=St;exports.nullToEmpty=L;exports.transformEmptyStringToUndefined=Te;exports.transformNullToUndefined=De;exports.transformUndefinedToNull=Se;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Use as H, Value as u, prop as et, html as I, attr as a, on as C, WithElement as it, OnDispose as W, aria as N, bind as _t, computedOf as V, style as dt, When as E, NotEmpty as Gt, Fragment as L, ForEach as ft, svg as At, svgAttr as ht, Empty as T, emitValue as P, coalesce as Qt, Ensure as Jt, OneOfType as Kt, Repeat as Pt, signal as Ft, input as K, emitValueAsNullableDate as te, emitValueAsNullableDateTime as ee, emitValueAsNumber as G, emit as ne, Task as Bt } from "@tempots/dom";
|
|
2
2
|
import { f as se } from "./colors-WfmhQ5e1.js";
|
|
3
|
-
import { g as re } from "./timer-
|
|
3
|
+
import { g as re } from "./timer-DzWb416P.js";
|
|
4
4
|
import { ElementRect as jt, AutoSelect as le } from "@tempots/ui";
|
|
5
5
|
import { a as X, b as O, f as ae, I as z, C as j, d as yt, T as oe, L as ce, c as Lt, e as ie, B as gt } from "./translations-iam7PITs.js";
|
|
6
6
|
import { C as $t, m as ue, d as pe, I as Ht, E as de, P as fe, S as ct, s as me, L as he, e as bt, O as lt, f as Vt } from "./notice-Cd9ElXwb.js";
|