@tempots/beatui 0.79.0 → 0.81.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.
Files changed (93) hide show
  1. package/dist/{ar-D__6gR_P.js → ar-Bo_FZZi7.js} +2 -1
  2. package/dist/ar-DwHLVgKj.cjs +1 -0
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +5 -5
  5. package/dist/{de-DmKpCTuQ.js → de-CCqwOkqN.js} +3 -2
  6. package/dist/de-zI5mdV4M.cjs +1 -0
  7. package/dist/{deep-merge-Bsqkvp9-.js → deep-merge-1uN6CG6K.js} +2 -2
  8. package/dist/{deep-merge-cQgRrtGF.cjs → deep-merge-CBIkQM4E.cjs} +1 -1
  9. package/dist/{duration-input-DcZf0Dyd.js → duration-input-C9kpsw-t.js} +3 -3
  10. package/dist/{duration-input-Dt6riwzu.cjs → duration-input-DHWhQJnn.cjs} +1 -1
  11. package/dist/{es-BDZ5UJLS.js → es-BF02UrPL.js} +2 -1
  12. package/dist/es-Cw90CAbu.cjs +1 -0
  13. package/dist/fa-B4lssnzR.cjs +1 -0
  14. package/dist/{fa-CuPgy1cj.js → fa-DPQV4YB8.js} +2 -1
  15. package/dist/fr-1Kd6z1F-.cjs +1 -0
  16. package/dist/{fr-DmyMO3lB.js → fr-dmxPhwkD.js} +4 -3
  17. package/dist/{he-C3RHfs6R.js → he-BtQbrVt3.js} +2 -1
  18. package/dist/he-CJ3XnuPm.cjs +1 -0
  19. package/dist/hi-BpfnFKHp.cjs +1 -0
  20. package/dist/{hi-YnvrXBht.js → hi-D_Le4Yka.js} +10 -9
  21. package/dist/{index-mPVib4v9.js → index-CGEzILlC.js} +1 -1
  22. package/dist/{index-CdVc1Y2V.cjs → index-CfaWytS2.cjs} +1 -1
  23. package/dist/{index-BGwNJNop.cjs → index-K6u33-GC.cjs} +2 -2
  24. package/dist/{index-Dbu1ZPpw.js → index-YtW7SCWB.js} +3 -3
  25. package/dist/index.cjs.js +2 -2
  26. package/dist/index.es.js +15 -15
  27. package/dist/it-COCZ9NyB.cjs +1 -0
  28. package/dist/{it-CWLwlDXe.js → it-DyHjSuHN.js} +2 -1
  29. package/dist/ja--NdggLU9.cjs +1 -0
  30. package/dist/{ja-DthjgDtM.js → ja-X43lABza.js} +2 -1
  31. package/dist/json-schema/index.cjs.js +8 -8
  32. package/dist/json-schema/index.es.js +4230 -4046
  33. package/dist/json-structure/index.cjs.js +1 -1
  34. package/dist/json-structure/index.es.js +4 -4
  35. package/dist/{ko-joDK7ONT.js → ko-B9g9iw99.js} +2 -1
  36. package/dist/ko-BUvb0ggK.cjs +1 -0
  37. package/dist/{modal-oWbT46Rc.js → modal-CSHIhHvI.js} +2 -2
  38. package/dist/{modal-D3NQ6ZgO.cjs → modal-cc8Ehngz.cjs} +1 -1
  39. package/dist/nl-0S25Gsld.cjs +1 -0
  40. package/dist/{nl-DmoWeXUt.js → nl-Ew5jnSsT.js} +2 -1
  41. package/dist/{notice-C0Brmeyi.js → notice-C-964yaY.js} +2 -2
  42. package/dist/{notice-DYBLXglS.cjs → notice-C_BWqu2K.cjs} +1 -1
  43. package/dist/pl-B3k-K3S4.cjs +1 -0
  44. package/dist/{pl-8hl5VXnm.js → pl-C9f6UBSe.js} +2 -1
  45. package/dist/prosemirror/index.cjs.js +1 -1
  46. package/dist/prosemirror/index.es.js +1 -1
  47. package/dist/pt-CKoikRO5.cjs +1 -0
  48. package/dist/{pt-BfYK9Rl3.js → pt-DYtAvbrw.js} +2 -1
  49. package/dist/ru-COb7RSDt.cjs +1 -0
  50. package/dist/{ru-eA_dNkJz.js → ru-ZexN-b8V.js} +2 -1
  51. package/dist/{toolbar-DoRPrs-s.cjs → toolbar-D5FcnRju.cjs} +1 -1
  52. package/dist/{toolbar-CdY5huSG.js → toolbar-DNpBIoJo.js} +1 -1
  53. package/dist/{tr-CdqbnopM.js → tr-BDvn05-H.js} +4 -3
  54. package/dist/tr-tO_EH-Y2.cjs +1 -0
  55. package/dist/{translations-BEMKy6-W.js → translations-0tLX4x7M.js} +26 -25
  56. package/dist/{translations-CVfr2JXG.js → translations-CfWR4loD.js} +1 -1
  57. package/dist/{translations-D_Vu2mbd.cjs → translations-DwGC_94w.cjs} +1 -1
  58. package/dist/translations-WPN3ibDg.cjs +1 -0
  59. package/dist/types/beatui-i18n/default.d.ts +1 -0
  60. package/dist/types/beatui-i18n/locales/en.d.ts +1 -0
  61. package/dist/types/beatui-i18n/translations.d.ts +1 -0
  62. package/dist/types/components/json-schema/schema-conditionals.d.ts +11 -0
  63. package/dist/types/components/json-schema/schema-context.d.ts +1 -1
  64. package/dist/ur-BbnYJ3HS.cjs +1 -0
  65. package/dist/{ur-D9sr_I1M.js → ur-DbEqQgS6.js} +2 -1
  66. package/dist/{use-form-pSErMD6z.cjs → use-form-D4JFOcjo.cjs} +1 -1
  67. package/dist/{use-form-DMiCxK26.js → use-form-D4rqJkvG.js} +1 -1
  68. package/dist/vi-ByBwvGQY.cjs +1 -0
  69. package/dist/{vi-0f97dtZb.js → vi-CpZUeuSj.js} +2 -1
  70. package/dist/{widget-customization-nxbAoCx5.js → widget-customization-BSjJz3_Y.js} +4 -4
  71. package/dist/{widget-customization-WNWmH_gX.cjs → widget-customization-CrFVrt4V.cjs} +1 -1
  72. package/dist/{zh-C7HcUKhE.js → zh-DJyhKO0I.js} +2 -1
  73. package/dist/zh-DnxK0ieB.cjs +1 -0
  74. package/package.json +1 -1
  75. package/dist/ar-DNoFBb9J.cjs +0 -1
  76. package/dist/de-AwUkK0rS.cjs +0 -1
  77. package/dist/es-D-d2AIlX.cjs +0 -1
  78. package/dist/fa-D7rRdG8c.cjs +0 -1
  79. package/dist/fr-0er_BWMt.cjs +0 -1
  80. package/dist/he-R2veUyP3.cjs +0 -1
  81. package/dist/hi-C9UP7NGG.cjs +0 -1
  82. package/dist/it-Cxt1_D4h.cjs +0 -1
  83. package/dist/ja-CpDovHPb.cjs +0 -1
  84. package/dist/ko-M_MCTNuN.cjs +0 -1
  85. package/dist/nl-DGhIOGxN.cjs +0 -1
  86. package/dist/pl-DocnXix_.cjs +0 -1
  87. package/dist/pt-DO2Zcuqv.cjs +0 -1
  88. package/dist/ru-D9KCOBqN.cjs +0 -1
  89. package/dist/tr-BBmQvRSa.cjs +0 -1
  90. package/dist/translations-eUtMHN9s.cjs +0 -1
  91. package/dist/ur-u5qjZsKM.cjs +0 -1
  92. package/dist/vi-_w5RE8el.cjs +0 -1
  93. package/dist/zh-6cQcHbf6.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import { f as a } from "./translations-BEMKy6-W.js";
1
+ import { f as a } from "./translations-0tLX4x7M.js";
2
2
  const d = {
3
3
  loadingExtended: "جاري التحميل، يرجى الانتظار",
4
4
  loadingShort: "جاري التحميل...",
@@ -8,6 +8,7 @@ const d = {
8
8
  failedToLoadIcon: "فشل في تحميل الأيقونة",
9
9
  editLabel: "تحرير",
10
10
  selectOne: "اختر واحد",
11
+ selectNone: "لا شيء",
11
12
  selectMany: "اختر عدة",
12
13
  noResults: "لا نتائج",
13
14
  passwordPlaceholderText: "كلمة المرور السرية",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-WPN3ibDg.cjs"),a={loadingExtended:"جاري التحميل، يرجى الانتظار",loadingShort:"جاري التحميل...",locale:"اللغة",iconDescription:"أيقونة",loadingIcon:"أيقونة التحميل",failedToLoadIcon:"فشل في تحميل الأيقونة",editLabel:"تحرير",selectOne:"اختر واحد",selectNone:"لا شيء",selectMany:"اختر عدة",noResults:"لا نتائج",passwordPlaceholderText:"كلمة المرور السرية",togglePasswordVisibility:"إظهار/إخفاء كلمة المرور",toggleMenu:"تبديل القائمة",toggleAside:"تبديل اللوحة الجانبية",mainNavigation:"القائمة الرئيسية",sidebar:"الشريط الجانبي",closeDrawer:"إغلاق الدرج",closeModal:"إغلاق النافذة المنبثقة",confirm:"تأكيد",cancel:"إلغاء",addLabel:"إضافة",removeItem:"إزالة العنصر",currentLocale:"العربية",ar:"العربية",de:"الألمانية",en:"الإنجليزية",es:"الأسبانية",fr:"الفرنسية",hi:"الهندية",it:"الإيطالية",ja:"اليابانية",ko:"الكورية",nl:"الهولندية",pl:"البولندية",pt:"البرتغالية",ru:"الروسية",tr:"التركية",vi:"الفيتنامية",zh:"الصينية",he:"العبرية",fa:"الفارسية",ur:"الأردية",emailPlaceholderText:"بريدك الإلكتروني",incrementValue:"زيادة القيمة",decrementValue:"تقليل القيمة",dropZoneInstructions:e=>e?"انقر للاختيار أو اسحب الملفات هنا، أو اضغط Enter أو Space لفتح محدد الملفات":"اسحب الملفات هنا",fileSizeUnits:["بايت","ك.ب","م.ب","ج.ب","ت.ب"],removeFile:"إزالة الملف",clearAllFiles:"مسح كل الملفات",clearValue:"مسح القيمة",unknownType:"نوع غير معروف",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"انقر للاختيار أو اسحب الملفات هنا":"انقر للاختيار أو اسحب ملف هنا";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`حتى ${e} ملفات`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`حد أقصى ${i} لكل ملف`)}l.length>0&&(n+=` (${l.join("، ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tempots/dom"),p=require("../use-form-pSErMD6z.cjs"),g=require("../modal-D3NQ6ZgO.cjs"),y=require("../translations-D_Vu2mbd.cjs"),P=require("../notice-DYBLXglS.cjs"),q=require("../translations-eUtMHN9s.cjs"),J=require("@tempots/ui"),T={google:{name:"Google",icon:"logos:google-icon",color:"#4285f4"},github:{name:"GitHub",icon:"logos:github-icon",color:"#333"},apple:{name:"Apple",icon:"logos:apple",color:"#000"},facebook:{name:"Facebook",icon:"logos:facebook",color:"#1877f2"},twitter:{name:"Twitter",icon:"logos:twitter",color:"#1da1f2"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"#00a4ef"},discord:{name:"Discord",icon:"logos:discord-icon",color:"#5865f2"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"#0077b5"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"#e4405f"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"#000"},snapchat:{name:"Snapchat",icon:"logos:snapchat-icon",color:"#fffc00"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"#ff4500"},pinterest:{name:"Pinterest",icon:"logos:pinterest-icon",color:"#bd081c"},twitch:{name:"Twitch",icon:"logos:twitch",color:"#9146ff"},steam:{name:"Steam",icon:"logos:steam-icon",color:"#000"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"#313131"},playstation:{name:"PlayStation",icon:"logos:playstation-icon",color:"#003791"},xbox:{name:"Xbox",icon:"logos:xbox-icon",color:"#107c10"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"#25d366"},wechat:{name:"WeChat",icon:"logos:wechat-icon",color:"#1aad19"},amazon:{name:"Amazon",icon:"logos:amazon-icon",color:"#ff9900"},yahoo:{name:"Yahoo",icon:"logos:yahoo-icon",color:"#720e9e"},paypal:{name:"PayPal",icon:"logos:paypal",color:"#0070ba"},x:{name:"X",icon:"simple-icons:x",color:"#000"}};function N(e){return T[e]?.name||e}function K(e){return T[e]?.icon||"mdi:account"}function Q(e){return T[e]?.color||"#666"}function tt(e,o="Continue with {provider}"){return o.replace("{provider}",N(e))}const B={minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!1};function et(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function D(e=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let l=0;l<e;l++)i+=o.charAt(Math.floor(Math.random()*o.length));return i}function ot(e,o,i,l=[],c={}){const n={google:"https://accounts.google.com/oauth/authorize",github:"https://github.com/login/oauth/authorize",apple:"https://appleid.apple.com/auth/authorize",facebook:"https://www.facebook.com/v18.0/dialog/oauth",twitter:"https://twitter.com/i/oauth2/authorize",microsoft:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",discord:"https://discord.com/api/oauth2/authorize",linkedin:"https://www.linkedin.com/oauth/v2/authorization",instagram:"https://api.instagram.com/oauth/authorize",tiktok:"https://www.tiktok.com/v2/auth/authorize",snapchat:"https://accounts.snapchat.com/accounts/oauth2/authorize",reddit:"https://www.reddit.com/api/v1/authorize",pinterest:"https://api.pinterest.com/oauth/",twitch:"https://id.twitch.tv/oauth2/authorize",steam:"https://steamcommunity.com/oauth/authorize",epic:"https://auth.epicgames.com/authorize",playstation:"https://auth.api.sonyentertainmentnetwork.com/oauth/authorize",xbox:"https://login.live.com/oauth20_authorize.srf",whatsapp:"https://web.whatsapp.com/oauth/authorize",wechat:"https://open.weixin.qq.com/connect/qrconnect",amazon:"https://www.amazon.com/ap/oa",yahoo:"https://api.login.yahoo.com/oauth2/request_auth",paypal:"https://www.paypal.com/signin/authorize",x:"https://api.twitter.com/oauth2/authorize"},m={google:["openid","email","profile"],github:["user:email"],apple:["email","name"],facebook:["email"],twitter:["users.read"],microsoft:["openid","email","profile"],discord:["identify","email"],linkedin:["r_liteprofile","r_emailaddress"],instagram:["user_profile","user_media"],tiktok:["user.info.basic","user.external.id"],snapchat:["user.info.basic","user.external.id"],reddit:["identity","email"],pinterest:["read_public","read_relationships"],twitch:["openid","email","profile"],steam:["openid","email","profile"],epic:["openid","email","profile"],playstation:["openid","email","profile"],xbox:["openid","email","profile"],whatsapp:["openid","email","profile"],wechat:["openid","email","profile"],amazon:["openid","email","profile"],yahoo:["openid","email","profile"],paypal:["openid","email","profile"],x:["openid","email","profile"]},a=n[e];if(!a)throw new Error(`Unsupported provider: ${e}`);const r=l.length>0?l:m[e],s=D(),h=new URLSearchParams({client_id:o,redirect_uri:i,scope:r.join(" "),state:s,response_type:"code",...c});return`${a}?${h.toString()}`}function at(e,o,i,l){const c=window.open(e,`${o}_login`,"width=500,height=600,scrollbars=yes,resizable=yes");if(!c){l?.(new Error("Failed to open popup window"));return}const n=setInterval(()=>{c.closed&&(clearInterval(n),l?.(new Error("Login cancelled")))},1e3),m=a=>{a.origin===window.location.origin&&(a.data.type==="SOCIAL_LOGIN_SUCCESS"?(clearInterval(n),c.close(),window.removeEventListener("message",m),i?.(a.data.result)):a.data.type==="SOCIAL_LOGIN_ERROR"&&(clearInterval(n),c.close(),window.removeEventListener("message",m),l?.(new Error(a.data.error))))};window.addEventListener("message",m)}function nt(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unexpected error occurred"}function rt(){return typeof window<"u"&&typeof document<"u"}function $({task:e,message:o,onStart:i,onEnd:l}){return async c=>{i?.();const n=await p.taskToValidation({task:e!=null?()=>e(c):async()=>null,errorMessage:o,errorPath:["root"],validation:m=>m!=null?p.i.invalid({message:m}):p.i.valid});return l?.(),n}}function z(e=B){let o=g.string();return e.minLength&&(o=o.min(e.minLength,`Password must be at least ${e.minLength} characters`)),e.requireUppercase&&(o=o.regex(/[A-Z]/,"Password must contain at least one uppercase letter")),e.requireLowercase&&(o=o.regex(/[a-z]/,"Password must contain at least one lowercase letter")),e.requireNumbers&&(o=o.regex(/[0-9]/,"Password must contain at least one number")),e.requireSymbols&&(o=o.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,"Password must contain at least one special character")),e.customValidation&&(o=o.refine(i=>e.customValidation(i))),o}const x=g.string().min(1,"Email is required").email("Please enter a valid email address");function E(e){const o=e?z(e):g.string().refine(i=>i.length>0?null:"Password is required");return g.object({email:x,password:o,rememberMe:g.boolean().default(!1)}).schema()}function O(e=B,o){const i=z(e),l=o?.showNameField!==!1,c=o?.showConfirmPassword!==!1,n=o?.showAcceptTermsAndConditions!==!1,m={name:l?g.string().min(1,"Name is required").optional():g.string().optional(),email:x,password:i,confirmPassword:c?g.string().min(1,"Please confirm your password"):g.string(),acceptTerms:n?g.boolean().refine(r=>r===!0,"You must accept the terms and conditions"):g.boolean().default(!0)},a=g.object(m);return c?a.refine(r=>r.password===r.confirmPassword?null:"Passwords don't match",{path:["confirmPassword"]}).schema():a.schema()}const R=g.object({email:x}).schema(),st=E(),it=O(),ct={signIn:E,signUp:O,resetPassword:()=>R};function lt(e){const o=x.validate(e);return o.success?null:o.errors[0]?.message||"Invalid email"}function mt(e,o=B){const l=z(o).validate(e);return l.success?null:l.errors[0]?.message||"Invalid password"}function U(e,o=B){const i={length:e.length>=(o.minLength||8),uppercase:/[A-Z]/.test(e),lowercase:/[a-z]/.test(e),numbers:/[0-9]/.test(e),symbols:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(e),custom:o.customValidation?o.customValidation(e)===null:e.length>0},l=[!0,o.requireUppercase,o.requireLowercase,o.requireNumbers,o.requireSymbols,!!o.customValidation].filter(Boolean).length,c=[i.length,o.requireUppercase?i.uppercase:null,o.requireLowercase?i.lowercase:null,o.requireNumbers?i.numbers:null,o.requireSymbols?i.symbols:null,o.customValidation?i.custom:null].filter(a=>a===!0).length,n=l>0?Math.round(c/l*100):0;let m;return n<40?m="weak":n<60?m="fair":n<80?m="good":m="strong",{strength:m,score:n,checks:i}}const M=()=>t.localStorageProp({key:"bui_auth_email",defaultValue:null});function G({onSignIn:e,passwordRules:o,labels:i,showRememberMe:l}){const c=t.prop(!1),n=M(),m=E(o),a=p.useForm({schema:m,onSubmit:$({task:e,message:"Reset password failed",onStart:()=>{c.set(!0),a.controller.disable()},onEnd:()=>{c.set(!1),a.controller.enable()}}),initialValue:{email:"",password:""}}),{controller:r,submit:s}=a;c.on(r.setDisabled);const h=r.field("email"),f=r.field("password");return n.on(b=>{b!=null&&h.change(b)}),h.signal.on(b=>{n.value!=null&&(n.value=b)}),t.Use(y.AuthI18n,b=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(s),p.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(r.error,L=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(L))),p.Control(P.EmailInput,{controller:h,label:t.coalesce(i?.emailLabel,b.$.emailLabel)}),p.Control(P.PasswordInput,{controller:f,label:t.coalesce(i?.passwordLabel,b.$.passwordLabel)}),t.When(l??!0,()=>t.html.div(t.attr.class("bc-auth-form__remember-me"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),p.CheckboxInput({value:n.map(L=>L!=null),after:t.html.span(t.coalesce(i?.rememberMeLabel,b.$.rememberMeLabel)),onChange:L=>{L?n.value=h.signal.value??"":n.value=null}}))))),q.Button({type:"submit",variant:"filled",color:"primary",loading:c,disabled:r.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(i?.signInButton,b.$.signInButton))))}function j({password:e,rules:o=B,showLabel:i=!0,className:l}){const c=t.computedOf(e)(s=>!s||s.length===0?{strength:"weak",score:0,checks:{length:!1,uppercase:!1,lowercase:!1,numbers:!1,symbols:!1,custom:!1}}:U(s,o)),n=c.map(s=>s.strength),m=c.map(s=>s.score),a=c.map(s=>s.checks),r=t.computedOf(n,l)((s,h)=>["bc-password-strength",`bc-password-strength--${s}`,h].filter(Boolean).join(" "));return t.html.div(t.attr.class(r),t.html.div(t.attr.class("bc-password-strength__bar"),t.html.div(t.attr.class("bc-password-strength__fill"),t.attr.style(m.map(s=>`width: ${s}%`)))),t.When(i,()=>t.Use(y.AuthI18n,s=>t.html.div(t.attr.class("bc-password-strength__label"),t.computedOf(n,s)((h,f)=>{switch(h){case"weak":return f.passwordStrengthWeak;case"fair":return f.passwordStrengthFair;case"good":return f.passwordStrengthGood;case"strong":return f.passwordStrengthStrong;default:return f.passwordStrengthWeak}})))),t.html.div(t.attr.class("bc-password-strength__requirements"),t.When(o.minLength!==void 0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.length?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.length?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),`At least ${o.minLength} characters`))),t.When(o.requireUppercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.uppercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.uppercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One uppercase letter"))),t.When(o.requireLowercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.lowercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.lowercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One lowercase letter"))),t.When(o.requireNumbers===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.numbers?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.numbers?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One number"))),t.When(o.requireSymbols===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.symbols?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.symbols?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One special character")))))}function ut({password:e,rules:o=B,className:i}){const l=t.computedOf(e)(a=>!a||a.length===0?{strength:"weak",score:0}:U(a,o)),c=l.map(a=>a.strength),n=l.map(a=>a.score),m=t.computedOf(c,i)((a,r)=>["bc-password-strength-bar",`bc-password-strength-bar--${a}`,r].filter(Boolean).join(" "));return t.html.div(t.attr.class(m),t.html.div(t.attr.class("bc-password-strength-bar__fill"),t.attr.style(n.map(a=>`width: ${a}%`))))}function dt({password:e,rules:o=B,className:i}){const l=t.computedOf(e)(n=>!n||n.length===0?"weak":U(n,o).strength),c=t.computedOf(l,i)((n,m)=>["bc-password-strength-text",`bc-password-strength-text--${n}`,m].filter(Boolean).join(" "));return t.Fragment(t.Use(y.AuthI18n,n=>t.html.span(t.attr.class(c),t.computedOf(l,n)((m,a)=>{switch(m){case"weak":return a.passwordStrengthWeak;case"fair":return a.passwordStrengthFair;case"good":return a.passwordStrengthGood;case"strong":return a.passwordStrengthStrong;default:return a.passwordStrengthWeak}}))))}function H({passwordRules:e,labels:o,initialEmail:i,initialName:l,showPasswordStrength:c,onSignUp:n,showNameField:m,showConfirmPassword:a,showAcceptTermsAndConditions:r,termsAndConditions:s}){const h=t.prop(!1),f=e||B,b=O(f,{showNameField:m!==!1,showConfirmPassword:a!==!1,showAcceptTermsAndConditions:r!==!1}),L=p.useForm({schema:b,onSubmit:$({task:n!=null?_=>n({email:_.email,password:_.password,name:_.name,acceptTerms:_.acceptTerms}):void 0,message:"Reset password failed",onStart:()=>{h.set(!0),L.controller.disable()},onEnd:()=>{h.set(!1),L.controller.enable()}}),initialValue:{name:l??"",email:i??"",password:"",confirmPassword:"",acceptTerms:!1}}),{controller:k,submit:I}=L;h.on(k.setDisabled);const v=k.field("name"),A=k.field("email"),C=k.field("password"),W=k.field("confirmPassword"),S=k.field("acceptTerms");return t.Use(y.AuthI18n,_=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(I),p.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(k.error,w=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(w))),t.When(m!==!1,()=>p.Control(q.TextInput,{controller:v.transform(w=>w??"",w=>w===""?void 0:w),label:t.coalesce(o?.nameLabel,_.$.nameLabel)})),p.Control(P.EmailInput,{controller:A,label:t.coalesce(o?.emailLabel,_.$.emailLabel)}),p.Control(P.PasswordInput,{controller:C,label:t.coalesce(o?.passwordLabel,_.$.passwordLabel)}),t.When(c??!1,()=>j({password:C.signal,rules:f,showLabel:!0})),t.When(a??!1,()=>p.Control(P.PasswordInput,{controller:W,label:t.coalesce(o?.confirmPasswordLabel,_.$.confirmPasswordLabel)})),t.When(r??!1,()=>t.html.div(t.attr.class("bc-auth-form__terms"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),p.CheckboxInput({value:S.signal.map(w=>w??!1),onChange:w=>S.change(w)}),t.html.span(s||t.coalesce(o?.acceptTermsLabel,_.$.acceptTermsLabel))),t.When(S.errorVisible,()=>t.html.div(t.attr.class("bc-auth-form__field-error"),S.error.map(w=>w||"")))))),q.Button({type:"submit",variant:"filled",color:"primary",loading:h,disabled:k.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(o?.signUpButton,_.$.signUpButton))))}function X({onResetPassword:e,labels:o={}}){const i=M(),l=t.prop(!1),c=p.useForm({schema:R,onSubmit:$({task:e,message:"Reset password failed",onStart:()=>{l.set(!0),c.controller.disable()},onEnd:()=>{l.set(!1),c.controller.enable()}}),initialValue:{email:""}}),{controller:n,submit:m}=c;l.on(n.setDisabled);const a=n.field("email");return i.on(r=>{r!=null&&a.change(r)}),t.Use(y.AuthI18n,r=>t.html.form(t.attr.class("bc-auth-form__form"),t.Ensure(n.error,s=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(s))),t.html.p(t.attr.class("bc-auth-form__description"),t.coalesce(o?.resetPasswordDescription,r.$.resetPasswordDescription)),t.on.submit(m),p.Stack(t.attr.class("bc-auth-form__fields"),p.Control(P.EmailInput,{controller:a,label:t.coalesce(o?.emailLabel,r.$.emailLabel)})),q.Button({loading:l,type:"submit",variant:"filled",color:"primary",disabled:n.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(o?.resetPasswordButton,r.$.resetPasswordButton))))}function d({provider:e,onClick:o,size:i="md",name:l,icon:c,color:n,flow:m,labels:a}){const r=async()=>{if(o)try{m==="popup"?await o():await o()}catch(s){console.error(`Social login error for ${e} (${m||"redirect"} flow):`,s)}};return q.Button({type:"button",variant:"filled",size:i,color:n,onClick:r,roundedness:"full"},t.attr.class("bc-social-login-button"),t.attr.class(t.computedOf(e)(s=>`bc-social-login-button--${s}`)),t.html.span(t.attr.class("bc-social-login-button__inner"),t.html.span(t.attr.class("bc-social-login-button__icon"),q.Icon({icon:c,size:i},t.attr.class("bc-social-login-button__icon-inner"))),t.Use(y.AuthI18n,s=>t.html.span(t.attr.class("bc-social-login-button__label"),t.bind(t.coalesce(a?.continueWithProvider,s.$.continueWithProvider))(l)))))}function Y({providers:e,onProviderClick:o,size:i="md",className:l}){return p.Stack(t.attr.class("bc-social-login-buttons"),t.attr.class(l),t.ForEach(e,c=>d({provider:c.$.provider,flow:c.$.flow,color:c.map(({provider:n})=>u[n].color),name:c.map(({provider:n})=>u[n].name),icon:c.map(({provider:n})=>u[n].icon),onClick:async()=>{o&&await o(c.$.provider.value)},size:i})))}const u={google:{name:"Google",icon:"logos:google-icon",color:"red"},github:{name:"GitHub",icon:"logos:github-icon",color:"black"},apple:{name:"Apple",icon:"logos:apple",color:"stone"},facebook:{name:"Facebook",icon:"logos:facebook",color:"blue"},twitter:{name:"Twitter",icon:"logos:twitter",color:"sky"},x:{name:"X",icon:"logos:x",color:"zinc"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"amber"},discord:{name:"Discord",icon:"logos:discord-icon",color:"indigo"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"cyan"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"fuchsia"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"teal"},snapchat:{name:"Snapchat",icon:"simple-icons:snapchat",color:"yellow"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"orange"},pinterest:{name:"Pinterest",icon:"logos:pinterest",color:"rose"},twitch:{name:"Twitch",icon:"logos:twitch",color:"purple"},steam:{name:"Steam",icon:"logos:steam",color:"slate"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"neutral"},playstation:{name:"PlayStation",icon:"simple-icons:playstation",color:"violet"},xbox:{name:"Xbox",icon:"simple-icons:xbox",color:"green"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"emerald"},wechat:{name:"WeChat",icon:"simple-icons:wechat",color:"lime"},amazon:{name:"Amazon",icon:"simple-icons:amazon",color:"red"},yahoo:{name:"Yahoo",icon:"logos:yahoo",color:"rose"},paypal:{name:"PayPal",icon:"logos:paypal",color:"blue"}},pt=e=>d({...e,...u.google,provider:"google"}),ht=e=>d({...e,...u.github,provider:"github"}),gt=e=>d({...e,...u.apple,provider:"apple"}),ft=e=>d({...e,...u.facebook,provider:"facebook"}),bt=e=>d({...e,...u.x,provider:"x"}),wt=e=>d({...e,...u.twitter,provider:"twitter"}),Lt=e=>d({...e,...u.microsoft,provider:"microsoft"}),_t=e=>d({...e,...u.discord,provider:"discord"}),kt=e=>d({...e,...u.linkedin,provider:"linkedin"}),vt=e=>d({...e,...u.instagram,provider:"instagram"}),St=e=>d({...e,...u.tiktok,provider:"tiktok"}),Pt=e=>d({...e,...u.snapchat,provider:"snapchat"}),yt=e=>d({...e,...u.reddit,provider:"reddit"}),Bt=e=>d({...e,...u.pinterest,provider:"pinterest"}),It=e=>d({...e,...u.twitch,provider:"twitch"}),qt=e=>d({...e,...u.steam,provider:"steam"}),xt=e=>d({...e,...u.epic,provider:"epic"}),At=e=>d({...e,...u.playstation,provider:"playstation"}),Ct=e=>d({...e,...u.xbox,provider:"xbox"}),Tt=e=>d({...e,...u.whatsapp,provider:"whatsapp"}),$t=e=>d({...e,...u.wechat,provider:"wechat"}),zt=e=>d({...e,...u.amazon,provider:"amazon"}),Et=e=>d({...e,...u.yahoo,provider:"yahoo"}),Ot=e=>d({...e,...u.paypal,provider:"paypal"});function F({providers:e}){return p.Stack(Y({providers:e}))}function Z({mode:e,socialProviders:o,initialName:i,initialEmail:l,passwordRules:c,showRememberMe:n,showSocialDivider:m,showPasswordStrength:a,labels:r,onSignIn:s,onSignUp:h,onResetPassword:f,onModeChange:b,showContainer:L},...k){const I=e!=null?t.Value.deriveProp(e):t.prop("signin");return I.on(v=>b?.(v)),t.Use(y.AuthI18n,v=>{function A(){const S=t.coalesce(r?.hasAccountLink,v.$.hasAccountLink);return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("signin")),S)}function C(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("signup")),t.coalesce(r?.noAccountLink,v.$.noAccountLink))}function W(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("reset-password")),t.coalesce(r?.forgotPasswordLink,v.$.forgotPasswordLink))}return t.html.div(J.classes({"bc-auth-container":!0,"bc-auth-container--styled":t.Value.map(L??!0,S=>S)}),t.attr.class(I.map(S=>`bc-auth-container--${S}`)),t.attr.class("bc-auth-form"),t.OneOfValue(I,{signin:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signInTitle,v.$.signInTitle)),o!=null?t.Fragment(F({providers:o}),t.When(m??!1,V)):null,G({onSignIn:s,showRememberMe:n,passwordRules:c,labels:{emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,rememberMeLabel:r?.rememberMeLabel,signInButton:r?.signInButton,forgotPasswordLink:r?.forgotPasswordLink,noAccountLink:r?.noAccountLink}}),p.Stack(t.attr.class("bc-auth-form__footer"),C(),W())),signup:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signUpTitle,v.$.signUpTitle)),o!=null?t.Fragment(F({providers:o}),t.When(m??!1,V)):null,H({labels:{nameLabel:r?.nameLabel,emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,confirmPasswordLabel:r?.confirmPasswordLabel,acceptTermsLabel:r?.acceptTermsLabel,signUpButton:r?.signUpButton,hasAccountLink:r?.hasAccountLink},initialEmail:l,initialName:i,onSignUp:h,passwordRules:c,showPasswordStrength:a}),p.Stack(t.attr.class("bc-auth-form__footer"),A())),"reset-password":()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.resetPasswordTitle,v.$.resetPasswordTitle)),X({labels:{backToSignInLink:r?.backToSignInLink,emailLabel:r?.emailLabel,resetPasswordButton:r?.resetPasswordButton,resetPasswordDescription:r?.resetPasswordDescription},onResetPassword:f}),p.Stack(t.attr.class("bc-auth-form__footer"),A()))}),...k)})}function Ut(e){return g.Modal({size:"sm",dismissable:!0,showCloseButton:!0},(o,i)=>e(l=>o({body:Z({showContainer:!1,...l}),header:t.Use(y.AuthI18n,c=>t.coalesce(l.modalTitle,c.$.authenticationTitle))})))}function V({labels:e,className:o}={}){return t.html.div(t.attr.class("bc-auth-divider"),t.attr.class(o),t.html.div(t.attr.class("bc-auth-divider__line")),t.Use(y.AuthI18n,i=>t.html.span(t.attr.class("bc-auth-divider__text"),t.coalesce(e?.text,i.$.orDivider))),t.html.div(t.attr.class("bc-auth-divider__line")))}exports.AmazonLoginButton=zt;exports.AppleLoginButton=gt;exports.AuthContainer=Z;exports.AuthDivider=V;exports.AuthModal=Ut;exports.DiscordLoginButton=_t;exports.EpicLoginButton=xt;exports.FacebookLoginButton=ft;exports.GitHubLoginButton=ht;exports.GoogleLoginButton=pt;exports.InstagramLoginButton=vt;exports.LinkedInLoginButton=kt;exports.MicrosoftLoginButton=Lt;exports.PasswordStrengthBar=ut;exports.PasswordStrengthIndicator=j;exports.PasswordStrengthText=dt;exports.PayPalLoginButton=Ot;exports.PinterestLoginButton=Bt;exports.PlayStationLoginButton=At;exports.RedditLoginButton=yt;exports.ResetPasswordForm=X;exports.SignInForm=G;exports.SignUpForm=H;exports.SnapchatLoginButton=Pt;exports.SocialLoginButton=d;exports.SocialLoginButtons=Y;exports.SocialProviders=F;exports.SteamLoginButton=qt;exports.TiktokLoginButton=St;exports.TwitchLoginButton=It;exports.TwitterLoginButton=wt;exports.WeChatLoginButton=$t;exports.WhatsAppLoginButton=Tt;exports.XLoginButtin=bt;exports.XboxLoginButton=Ct;exports.YahooLoginButton=Et;exports.authSchemas=ct;exports.calculatePasswordStrength=U;exports.createPasswordSchema=z;exports.createSignInSchema=E;exports.createSignUpSchema=O;exports.createSocialLoginUrl=ot;exports.defaultPasswordRules=B;exports.defaultSignInSchema=st;exports.defaultSignUpSchema=it;exports.emailSchema=x;exports.formatAuthError=nt;exports.formatProviderName=N;exports.formatSocialLoginText=tt;exports.generateRandomString=D;exports.getProviderColor=Q;exports.getProviderIcon=K;exports.isBrowser=rt;exports.isValidEmail=et;exports.openSocialLoginPopup=at;exports.providerInfo=T;exports.requestToControllerValidation=$;exports.resetPasswordSchema=R;exports.socialProviderInfo=u;exports.useAuthEmailProp=M;exports.validateEmail=lt;exports.validatePassword=mt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@tempots/dom"),p=require("../use-form-D4JFOcjo.cjs"),g=require("../modal-cc8Ehngz.cjs"),y=require("../translations-DwGC_94w.cjs"),P=require("../notice-C_BWqu2K.cjs"),q=require("../translations-WPN3ibDg.cjs"),J=require("@tempots/ui"),T={google:{name:"Google",icon:"logos:google-icon",color:"#4285f4"},github:{name:"GitHub",icon:"logos:github-icon",color:"#333"},apple:{name:"Apple",icon:"logos:apple",color:"#000"},facebook:{name:"Facebook",icon:"logos:facebook",color:"#1877f2"},twitter:{name:"Twitter",icon:"logos:twitter",color:"#1da1f2"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"#00a4ef"},discord:{name:"Discord",icon:"logos:discord-icon",color:"#5865f2"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"#0077b5"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"#e4405f"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"#000"},snapchat:{name:"Snapchat",icon:"logos:snapchat-icon",color:"#fffc00"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"#ff4500"},pinterest:{name:"Pinterest",icon:"logos:pinterest-icon",color:"#bd081c"},twitch:{name:"Twitch",icon:"logos:twitch",color:"#9146ff"},steam:{name:"Steam",icon:"logos:steam-icon",color:"#000"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"#313131"},playstation:{name:"PlayStation",icon:"logos:playstation-icon",color:"#003791"},xbox:{name:"Xbox",icon:"logos:xbox-icon",color:"#107c10"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"#25d366"},wechat:{name:"WeChat",icon:"logos:wechat-icon",color:"#1aad19"},amazon:{name:"Amazon",icon:"logos:amazon-icon",color:"#ff9900"},yahoo:{name:"Yahoo",icon:"logos:yahoo-icon",color:"#720e9e"},paypal:{name:"PayPal",icon:"logos:paypal",color:"#0070ba"},x:{name:"X",icon:"simple-icons:x",color:"#000"}};function N(e){return T[e]?.name||e}function K(e){return T[e]?.icon||"mdi:account"}function Q(e){return T[e]?.color||"#666"}function tt(e,o="Continue with {provider}"){return o.replace("{provider}",N(e))}const B={minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!1};function et(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function D(e=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let l=0;l<e;l++)i+=o.charAt(Math.floor(Math.random()*o.length));return i}function ot(e,o,i,l=[],c={}){const n={google:"https://accounts.google.com/oauth/authorize",github:"https://github.com/login/oauth/authorize",apple:"https://appleid.apple.com/auth/authorize",facebook:"https://www.facebook.com/v18.0/dialog/oauth",twitter:"https://twitter.com/i/oauth2/authorize",microsoft:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",discord:"https://discord.com/api/oauth2/authorize",linkedin:"https://www.linkedin.com/oauth/v2/authorization",instagram:"https://api.instagram.com/oauth/authorize",tiktok:"https://www.tiktok.com/v2/auth/authorize",snapchat:"https://accounts.snapchat.com/accounts/oauth2/authorize",reddit:"https://www.reddit.com/api/v1/authorize",pinterest:"https://api.pinterest.com/oauth/",twitch:"https://id.twitch.tv/oauth2/authorize",steam:"https://steamcommunity.com/oauth/authorize",epic:"https://auth.epicgames.com/authorize",playstation:"https://auth.api.sonyentertainmentnetwork.com/oauth/authorize",xbox:"https://login.live.com/oauth20_authorize.srf",whatsapp:"https://web.whatsapp.com/oauth/authorize",wechat:"https://open.weixin.qq.com/connect/qrconnect",amazon:"https://www.amazon.com/ap/oa",yahoo:"https://api.login.yahoo.com/oauth2/request_auth",paypal:"https://www.paypal.com/signin/authorize",x:"https://api.twitter.com/oauth2/authorize"},m={google:["openid","email","profile"],github:["user:email"],apple:["email","name"],facebook:["email"],twitter:["users.read"],microsoft:["openid","email","profile"],discord:["identify","email"],linkedin:["r_liteprofile","r_emailaddress"],instagram:["user_profile","user_media"],tiktok:["user.info.basic","user.external.id"],snapchat:["user.info.basic","user.external.id"],reddit:["identity","email"],pinterest:["read_public","read_relationships"],twitch:["openid","email","profile"],steam:["openid","email","profile"],epic:["openid","email","profile"],playstation:["openid","email","profile"],xbox:["openid","email","profile"],whatsapp:["openid","email","profile"],wechat:["openid","email","profile"],amazon:["openid","email","profile"],yahoo:["openid","email","profile"],paypal:["openid","email","profile"],x:["openid","email","profile"]},a=n[e];if(!a)throw new Error(`Unsupported provider: ${e}`);const r=l.length>0?l:m[e],s=D(),h=new URLSearchParams({client_id:o,redirect_uri:i,scope:r.join(" "),state:s,response_type:"code",...c});return`${a}?${h.toString()}`}function at(e,o,i,l){const c=window.open(e,`${o}_login`,"width=500,height=600,scrollbars=yes,resizable=yes");if(!c){l?.(new Error("Failed to open popup window"));return}const n=setInterval(()=>{c.closed&&(clearInterval(n),l?.(new Error("Login cancelled")))},1e3),m=a=>{a.origin===window.location.origin&&(a.data.type==="SOCIAL_LOGIN_SUCCESS"?(clearInterval(n),c.close(),window.removeEventListener("message",m),i?.(a.data.result)):a.data.type==="SOCIAL_LOGIN_ERROR"&&(clearInterval(n),c.close(),window.removeEventListener("message",m),l?.(new Error(a.data.error))))};window.addEventListener("message",m)}function nt(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unexpected error occurred"}function rt(){return typeof window<"u"&&typeof document<"u"}function $({task:e,message:o,onStart:i,onEnd:l}){return async c=>{i?.();const n=await p.taskToValidation({task:e!=null?()=>e(c):async()=>null,errorMessage:o,errorPath:["root"],validation:m=>m!=null?p.i.invalid({message:m}):p.i.valid});return l?.(),n}}function z(e=B){let o=g.string();return e.minLength&&(o=o.min(e.minLength,`Password must be at least ${e.minLength} characters`)),e.requireUppercase&&(o=o.regex(/[A-Z]/,"Password must contain at least one uppercase letter")),e.requireLowercase&&(o=o.regex(/[a-z]/,"Password must contain at least one lowercase letter")),e.requireNumbers&&(o=o.regex(/[0-9]/,"Password must contain at least one number")),e.requireSymbols&&(o=o.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,"Password must contain at least one special character")),e.customValidation&&(o=o.refine(i=>e.customValidation(i))),o}const x=g.string().min(1,"Email is required").email("Please enter a valid email address");function E(e){const o=e?z(e):g.string().refine(i=>i.length>0?null:"Password is required");return g.object({email:x,password:o,rememberMe:g.boolean().default(!1)}).schema()}function O(e=B,o){const i=z(e),l=o?.showNameField!==!1,c=o?.showConfirmPassword!==!1,n=o?.showAcceptTermsAndConditions!==!1,m={name:l?g.string().min(1,"Name is required").optional():g.string().optional(),email:x,password:i,confirmPassword:c?g.string().min(1,"Please confirm your password"):g.string(),acceptTerms:n?g.boolean().refine(r=>r===!0,"You must accept the terms and conditions"):g.boolean().default(!0)},a=g.object(m);return c?a.refine(r=>r.password===r.confirmPassword?null:"Passwords don't match",{path:["confirmPassword"]}).schema():a.schema()}const R=g.object({email:x}).schema(),st=E(),it=O(),ct={signIn:E,signUp:O,resetPassword:()=>R};function lt(e){const o=x.validate(e);return o.success?null:o.errors[0]?.message||"Invalid email"}function mt(e,o=B){const l=z(o).validate(e);return l.success?null:l.errors[0]?.message||"Invalid password"}function U(e,o=B){const i={length:e.length>=(o.minLength||8),uppercase:/[A-Z]/.test(e),lowercase:/[a-z]/.test(e),numbers:/[0-9]/.test(e),symbols:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(e),custom:o.customValidation?o.customValidation(e)===null:e.length>0},l=[!0,o.requireUppercase,o.requireLowercase,o.requireNumbers,o.requireSymbols,!!o.customValidation].filter(Boolean).length,c=[i.length,o.requireUppercase?i.uppercase:null,o.requireLowercase?i.lowercase:null,o.requireNumbers?i.numbers:null,o.requireSymbols?i.symbols:null,o.customValidation?i.custom:null].filter(a=>a===!0).length,n=l>0?Math.round(c/l*100):0;let m;return n<40?m="weak":n<60?m="fair":n<80?m="good":m="strong",{strength:m,score:n,checks:i}}const M=()=>t.localStorageProp({key:"bui_auth_email",defaultValue:null});function G({onSignIn:e,passwordRules:o,labels:i,showRememberMe:l}){const c=t.prop(!1),n=M(),m=E(o),a=p.useForm({schema:m,onSubmit:$({task:e,message:"Reset password failed",onStart:()=>{c.set(!0),a.controller.disable()},onEnd:()=>{c.set(!1),a.controller.enable()}}),initialValue:{email:"",password:""}}),{controller:r,submit:s}=a;c.on(r.setDisabled);const h=r.field("email"),f=r.field("password");return n.on(b=>{b!=null&&h.change(b)}),h.signal.on(b=>{n.value!=null&&(n.value=b)}),t.Use(y.AuthI18n,b=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(s),p.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(r.error,L=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(L))),p.Control(P.EmailInput,{controller:h,label:t.coalesce(i?.emailLabel,b.$.emailLabel)}),p.Control(P.PasswordInput,{controller:f,label:t.coalesce(i?.passwordLabel,b.$.passwordLabel)}),t.When(l??!0,()=>t.html.div(t.attr.class("bc-auth-form__remember-me"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),p.CheckboxInput({value:n.map(L=>L!=null),after:t.html.span(t.coalesce(i?.rememberMeLabel,b.$.rememberMeLabel)),onChange:L=>{L?n.value=h.signal.value??"":n.value=null}}))))),q.Button({type:"submit",variant:"filled",color:"primary",loading:c,disabled:r.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(i?.signInButton,b.$.signInButton))))}function j({password:e,rules:o=B,showLabel:i=!0,className:l}){const c=t.computedOf(e)(s=>!s||s.length===0?{strength:"weak",score:0,checks:{length:!1,uppercase:!1,lowercase:!1,numbers:!1,symbols:!1,custom:!1}}:U(s,o)),n=c.map(s=>s.strength),m=c.map(s=>s.score),a=c.map(s=>s.checks),r=t.computedOf(n,l)((s,h)=>["bc-password-strength",`bc-password-strength--${s}`,h].filter(Boolean).join(" "));return t.html.div(t.attr.class(r),t.html.div(t.attr.class("bc-password-strength__bar"),t.html.div(t.attr.class("bc-password-strength__fill"),t.attr.style(m.map(s=>`width: ${s}%`)))),t.When(i,()=>t.Use(y.AuthI18n,s=>t.html.div(t.attr.class("bc-password-strength__label"),t.computedOf(n,s)((h,f)=>{switch(h){case"weak":return f.passwordStrengthWeak;case"fair":return f.passwordStrengthFair;case"good":return f.passwordStrengthGood;case"strong":return f.passwordStrengthStrong;default:return f.passwordStrengthWeak}})))),t.html.div(t.attr.class("bc-password-strength__requirements"),t.When(o.minLength!==void 0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.length?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.length?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),`At least ${o.minLength} characters`))),t.When(o.requireUppercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.uppercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.uppercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One uppercase letter"))),t.When(o.requireLowercase===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.lowercase?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.lowercase?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One lowercase letter"))),t.When(o.requireNumbers===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.numbers?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.numbers?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One number"))),t.When(o.requireSymbols===!0,()=>t.html.div(t.attr.class("bc-password-strength__requirement"),t.attr.class(t.computedOf(a)(s=>s.symbols?"bc-password-strength__requirement--met":"")),t.html.span(t.attr.class("bc-password-strength__requirement-icon"),t.computedOf(a)(s=>s.symbols?"✓":"○")),t.html.span(t.attr.class("bc-password-strength__requirement-text"),"One special character")))))}function ut({password:e,rules:o=B,className:i}){const l=t.computedOf(e)(a=>!a||a.length===0?{strength:"weak",score:0}:U(a,o)),c=l.map(a=>a.strength),n=l.map(a=>a.score),m=t.computedOf(c,i)((a,r)=>["bc-password-strength-bar",`bc-password-strength-bar--${a}`,r].filter(Boolean).join(" "));return t.html.div(t.attr.class(m),t.html.div(t.attr.class("bc-password-strength-bar__fill"),t.attr.style(n.map(a=>`width: ${a}%`))))}function dt({password:e,rules:o=B,className:i}){const l=t.computedOf(e)(n=>!n||n.length===0?"weak":U(n,o).strength),c=t.computedOf(l,i)((n,m)=>["bc-password-strength-text",`bc-password-strength-text--${n}`,m].filter(Boolean).join(" "));return t.Fragment(t.Use(y.AuthI18n,n=>t.html.span(t.attr.class(c),t.computedOf(l,n)((m,a)=>{switch(m){case"weak":return a.passwordStrengthWeak;case"fair":return a.passwordStrengthFair;case"good":return a.passwordStrengthGood;case"strong":return a.passwordStrengthStrong;default:return a.passwordStrengthWeak}}))))}function H({passwordRules:e,labels:o,initialEmail:i,initialName:l,showPasswordStrength:c,onSignUp:n,showNameField:m,showConfirmPassword:a,showAcceptTermsAndConditions:r,termsAndConditions:s}){const h=t.prop(!1),f=e||B,b=O(f,{showNameField:m!==!1,showConfirmPassword:a!==!1,showAcceptTermsAndConditions:r!==!1}),L=p.useForm({schema:b,onSubmit:$({task:n!=null?_=>n({email:_.email,password:_.password,name:_.name,acceptTerms:_.acceptTerms}):void 0,message:"Reset password failed",onStart:()=>{h.set(!0),L.controller.disable()},onEnd:()=>{h.set(!1),L.controller.enable()}}),initialValue:{name:l??"",email:i??"",password:"",confirmPassword:"",acceptTerms:!1}}),{controller:k,submit:I}=L;h.on(k.setDisabled);const v=k.field("name"),A=k.field("email"),C=k.field("password"),W=k.field("confirmPassword"),S=k.field("acceptTerms");return t.Use(y.AuthI18n,_=>t.html.form(t.attr.class("bc-auth-form__form"),t.on.submit(I),p.Stack(t.attr.class("bc-auth-form__fields"),t.Ensure(k.error,w=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(w))),t.When(m!==!1,()=>p.Control(q.TextInput,{controller:v.transform(w=>w??"",w=>w===""?void 0:w),label:t.coalesce(o?.nameLabel,_.$.nameLabel)})),p.Control(P.EmailInput,{controller:A,label:t.coalesce(o?.emailLabel,_.$.emailLabel)}),p.Control(P.PasswordInput,{controller:C,label:t.coalesce(o?.passwordLabel,_.$.passwordLabel)}),t.When(c??!1,()=>j({password:C.signal,rules:f,showLabel:!0})),t.When(a??!1,()=>p.Control(P.PasswordInput,{controller:W,label:t.coalesce(o?.confirmPasswordLabel,_.$.confirmPasswordLabel)})),t.When(r??!1,()=>t.html.div(t.attr.class("bc-auth-form__terms"),t.html.label(t.attr.class("bc-auth-form__checkbox-label"),p.CheckboxInput({value:S.signal.map(w=>w??!1),onChange:w=>S.change(w)}),t.html.span(s||t.coalesce(o?.acceptTermsLabel,_.$.acceptTermsLabel))),t.When(S.errorVisible,()=>t.html.div(t.attr.class("bc-auth-form__field-error"),S.error.map(w=>w||"")))))),q.Button({type:"submit",variant:"filled",color:"primary",loading:h,disabled:k.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(o?.signUpButton,_.$.signUpButton))))}function X({onResetPassword:e,labels:o={}}){const i=M(),l=t.prop(!1),c=p.useForm({schema:R,onSubmit:$({task:e,message:"Reset password failed",onStart:()=>{l.set(!0),c.controller.disable()},onEnd:()=>{l.set(!1),c.controller.enable()}}),initialValue:{email:""}}),{controller:n,submit:m}=c;l.on(n.setDisabled);const a=n.field("email");return i.on(r=>{r!=null&&a.change(r)}),t.Use(y.AuthI18n,r=>t.html.form(t.attr.class("bc-auth-form__form"),t.Ensure(n.error,s=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},t.html.div(s))),t.html.p(t.attr.class("bc-auth-form__description"),t.coalesce(o?.resetPasswordDescription,r.$.resetPasswordDescription)),t.on.submit(m),p.Stack(t.attr.class("bc-auth-form__fields"),p.Control(P.EmailInput,{controller:a,label:t.coalesce(o?.emailLabel,r.$.emailLabel)})),q.Button({loading:l,type:"submit",variant:"filled",color:"primary",disabled:n.disabledOrHasErrors},t.attr.class("bc-auth-form__submit"),t.coalesce(o?.resetPasswordButton,r.$.resetPasswordButton))))}function d({provider:e,onClick:o,size:i="md",name:l,icon:c,color:n,flow:m,labels:a}){const r=async()=>{if(o)try{m==="popup"?await o():await o()}catch(s){console.error(`Social login error for ${e} (${m||"redirect"} flow):`,s)}};return q.Button({type:"button",variant:"filled",size:i,color:n,onClick:r,roundedness:"full"},t.attr.class("bc-social-login-button"),t.attr.class(t.computedOf(e)(s=>`bc-social-login-button--${s}`)),t.html.span(t.attr.class("bc-social-login-button__inner"),t.html.span(t.attr.class("bc-social-login-button__icon"),q.Icon({icon:c,size:i},t.attr.class("bc-social-login-button__icon-inner"))),t.Use(y.AuthI18n,s=>t.html.span(t.attr.class("bc-social-login-button__label"),t.bind(t.coalesce(a?.continueWithProvider,s.$.continueWithProvider))(l)))))}function Y({providers:e,onProviderClick:o,size:i="md",className:l}){return p.Stack(t.attr.class("bc-social-login-buttons"),t.attr.class(l),t.ForEach(e,c=>d({provider:c.$.provider,flow:c.$.flow,color:c.map(({provider:n})=>u[n].color),name:c.map(({provider:n})=>u[n].name),icon:c.map(({provider:n})=>u[n].icon),onClick:async()=>{o&&await o(c.$.provider.value)},size:i})))}const u={google:{name:"Google",icon:"logos:google-icon",color:"red"},github:{name:"GitHub",icon:"logos:github-icon",color:"black"},apple:{name:"Apple",icon:"logos:apple",color:"stone"},facebook:{name:"Facebook",icon:"logos:facebook",color:"blue"},twitter:{name:"Twitter",icon:"logos:twitter",color:"sky"},x:{name:"X",icon:"logos:x",color:"zinc"},microsoft:{name:"Microsoft",icon:"logos:microsoft-icon",color:"amber"},discord:{name:"Discord",icon:"logos:discord-icon",color:"indigo"},linkedin:{name:"LinkedIn",icon:"logos:linkedin-icon",color:"cyan"},instagram:{name:"Instagram",icon:"logos:instagram-icon",color:"fuchsia"},tiktok:{name:"TikTok",icon:"logos:tiktok-icon",color:"teal"},snapchat:{name:"Snapchat",icon:"simple-icons:snapchat",color:"yellow"},reddit:{name:"Reddit",icon:"logos:reddit-icon",color:"orange"},pinterest:{name:"Pinterest",icon:"logos:pinterest",color:"rose"},twitch:{name:"Twitch",icon:"logos:twitch",color:"purple"},steam:{name:"Steam",icon:"logos:steam",color:"slate"},epic:{name:"Epic Games",icon:"simple-icons:epicgames",color:"neutral"},playstation:{name:"PlayStation",icon:"simple-icons:playstation",color:"violet"},xbox:{name:"Xbox",icon:"simple-icons:xbox",color:"green"},whatsapp:{name:"WhatsApp",icon:"logos:whatsapp-icon",color:"emerald"},wechat:{name:"WeChat",icon:"simple-icons:wechat",color:"lime"},amazon:{name:"Amazon",icon:"simple-icons:amazon",color:"red"},yahoo:{name:"Yahoo",icon:"logos:yahoo",color:"rose"},paypal:{name:"PayPal",icon:"logos:paypal",color:"blue"}},pt=e=>d({...e,...u.google,provider:"google"}),ht=e=>d({...e,...u.github,provider:"github"}),gt=e=>d({...e,...u.apple,provider:"apple"}),ft=e=>d({...e,...u.facebook,provider:"facebook"}),bt=e=>d({...e,...u.x,provider:"x"}),wt=e=>d({...e,...u.twitter,provider:"twitter"}),Lt=e=>d({...e,...u.microsoft,provider:"microsoft"}),_t=e=>d({...e,...u.discord,provider:"discord"}),kt=e=>d({...e,...u.linkedin,provider:"linkedin"}),vt=e=>d({...e,...u.instagram,provider:"instagram"}),St=e=>d({...e,...u.tiktok,provider:"tiktok"}),Pt=e=>d({...e,...u.snapchat,provider:"snapchat"}),yt=e=>d({...e,...u.reddit,provider:"reddit"}),Bt=e=>d({...e,...u.pinterest,provider:"pinterest"}),It=e=>d({...e,...u.twitch,provider:"twitch"}),qt=e=>d({...e,...u.steam,provider:"steam"}),xt=e=>d({...e,...u.epic,provider:"epic"}),At=e=>d({...e,...u.playstation,provider:"playstation"}),Ct=e=>d({...e,...u.xbox,provider:"xbox"}),Tt=e=>d({...e,...u.whatsapp,provider:"whatsapp"}),$t=e=>d({...e,...u.wechat,provider:"wechat"}),zt=e=>d({...e,...u.amazon,provider:"amazon"}),Et=e=>d({...e,...u.yahoo,provider:"yahoo"}),Ot=e=>d({...e,...u.paypal,provider:"paypal"});function F({providers:e}){return p.Stack(Y({providers:e}))}function Z({mode:e,socialProviders:o,initialName:i,initialEmail:l,passwordRules:c,showRememberMe:n,showSocialDivider:m,showPasswordStrength:a,labels:r,onSignIn:s,onSignUp:h,onResetPassword:f,onModeChange:b,showContainer:L},...k){const I=e!=null?t.Value.deriveProp(e):t.prop("signin");return I.on(v=>b?.(v)),t.Use(y.AuthI18n,v=>{function A(){const S=t.coalesce(r?.hasAccountLink,v.$.hasAccountLink);return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("signin")),S)}function C(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("signup")),t.coalesce(r?.noAccountLink,v.$.noAccountLink))}function W(){return t.html.button(t.attr.type("button"),t.attr.class("bc-auth-form__link"),t.on.click(()=>I.set("reset-password")),t.coalesce(r?.forgotPasswordLink,v.$.forgotPasswordLink))}return t.html.div(J.classes({"bc-auth-container":!0,"bc-auth-container--styled":t.Value.map(L??!0,S=>S)}),t.attr.class(I.map(S=>`bc-auth-container--${S}`)),t.attr.class("bc-auth-form"),t.OneOfValue(I,{signin:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signInTitle,v.$.signInTitle)),o!=null?t.Fragment(F({providers:o}),t.When(m??!1,V)):null,G({onSignIn:s,showRememberMe:n,passwordRules:c,labels:{emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,rememberMeLabel:r?.rememberMeLabel,signInButton:r?.signInButton,forgotPasswordLink:r?.forgotPasswordLink,noAccountLink:r?.noAccountLink}}),p.Stack(t.attr.class("bc-auth-form__footer"),C(),W())),signup:()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.signUpTitle,v.$.signUpTitle)),o!=null?t.Fragment(F({providers:o}),t.When(m??!1,V)):null,H({labels:{nameLabel:r?.nameLabel,emailLabel:r?.emailLabel,passwordLabel:r?.passwordLabel,confirmPasswordLabel:r?.confirmPasswordLabel,acceptTermsLabel:r?.acceptTermsLabel,signUpButton:r?.signUpButton,hasAccountLink:r?.hasAccountLink},initialEmail:l,initialName:i,onSignUp:h,passwordRules:c,showPasswordStrength:a}),p.Stack(t.attr.class("bc-auth-form__footer"),A())),"reset-password":()=>t.Fragment(t.html.h2(t.attr.class("bc-auth-form__title"),t.coalesce(r?.resetPasswordTitle,v.$.resetPasswordTitle)),X({labels:{backToSignInLink:r?.backToSignInLink,emailLabel:r?.emailLabel,resetPasswordButton:r?.resetPasswordButton,resetPasswordDescription:r?.resetPasswordDescription},onResetPassword:f}),p.Stack(t.attr.class("bc-auth-form__footer"),A()))}),...k)})}function Ut(e){return g.Modal({size:"sm",dismissable:!0,showCloseButton:!0},(o,i)=>e(l=>o({body:Z({showContainer:!1,...l}),header:t.Use(y.AuthI18n,c=>t.coalesce(l.modalTitle,c.$.authenticationTitle))})))}function V({labels:e,className:o}={}){return t.html.div(t.attr.class("bc-auth-divider"),t.attr.class(o),t.html.div(t.attr.class("bc-auth-divider__line")),t.Use(y.AuthI18n,i=>t.html.span(t.attr.class("bc-auth-divider__text"),t.coalesce(e?.text,i.$.orDivider))),t.html.div(t.attr.class("bc-auth-divider__line")))}exports.AmazonLoginButton=zt;exports.AppleLoginButton=gt;exports.AuthContainer=Z;exports.AuthDivider=V;exports.AuthModal=Ut;exports.DiscordLoginButton=_t;exports.EpicLoginButton=xt;exports.FacebookLoginButton=ft;exports.GitHubLoginButton=ht;exports.GoogleLoginButton=pt;exports.InstagramLoginButton=vt;exports.LinkedInLoginButton=kt;exports.MicrosoftLoginButton=Lt;exports.PasswordStrengthBar=ut;exports.PasswordStrengthIndicator=j;exports.PasswordStrengthText=dt;exports.PayPalLoginButton=Ot;exports.PinterestLoginButton=Bt;exports.PlayStationLoginButton=At;exports.RedditLoginButton=yt;exports.ResetPasswordForm=X;exports.SignInForm=G;exports.SignUpForm=H;exports.SnapchatLoginButton=Pt;exports.SocialLoginButton=d;exports.SocialLoginButtons=Y;exports.SocialProviders=F;exports.SteamLoginButton=qt;exports.TiktokLoginButton=St;exports.TwitchLoginButton=It;exports.TwitterLoginButton=wt;exports.WeChatLoginButton=$t;exports.WhatsAppLoginButton=Tt;exports.XLoginButtin=bt;exports.XboxLoginButton=Ct;exports.YahooLoginButton=Et;exports.authSchemas=ct;exports.calculatePasswordStrength=U;exports.createPasswordSchema=z;exports.createSignInSchema=E;exports.createSignUpSchema=O;exports.createSocialLoginUrl=ot;exports.defaultPasswordRules=B;exports.defaultSignInSchema=st;exports.defaultSignUpSchema=it;exports.emailSchema=x;exports.formatAuthError=nt;exports.formatProviderName=N;exports.formatSocialLoginText=tt;exports.generateRandomString=D;exports.getProviderColor=Q;exports.getProviderIcon=K;exports.isBrowser=rt;exports.isValidEmail=et;exports.openSocialLoginPopup=at;exports.providerInfo=T;exports.requestToControllerValidation=$;exports.resetPasswordSchema=R;exports.socialProviderInfo=u;exports.useAuthEmailProp=M;exports.validateEmail=lt;exports.validatePassword=mt;
@@ -1,9 +1,9 @@
1
1
  import { localStorageProp as ie, prop as V, Use as x, html as i, attr as t, on as z, When as b, coalesce as h, Ensure as D, computedOf as g, Fragment as C, bind as ce, ForEach as le, Value as ee, OneOfValue as me } from "@tempots/dom";
2
- import { t as ue, i as oe, u as W, S as $, a as se, b as I } from "../use-form-DMiCxK26.js";
3
- import { s as A, o as G, b as N, M as pe } from "../modal-oWbT46Rc.js";
4
- import { AuthI18n as q } from "../translations-CVfr2JXG.js";
5
- import { P as R, E as H, N as j } from "../notice-C0Brmeyi.js";
6
- import { B as F, T as de, c as he } from "../translations-BEMKy6-W.js";
2
+ import { t as ue, i as oe, u as W, S as $, a as se, b as I } from "../use-form-D4rqJkvG.js";
3
+ import { s as A, o as G, b as N, M as pe } from "../modal-CSHIhHvI.js";
4
+ import { AuthI18n as q } from "../translations-CfWR4loD.js";
5
+ import { P as R, E as H, N as j } from "../notice-C-964yaY.js";
6
+ import { B as F, T as de, c as he } from "../translations-0tLX4x7M.js";
7
7
  import { classes as ge } from "@tempots/ui";
8
8
  const X = {
9
9
  google: { name: "Google", icon: "logos:google-icon", color: "#4285f4" },
@@ -1,4 +1,4 @@
1
- import { f as a } from "./translations-BEMKy6-W.js";
1
+ import { f as s } from "./translations-0tLX4x7M.js";
2
2
  const o = {
3
3
  loadingExtended: "Lädt, bitte warten",
4
4
  loadingShort: "Lädt...",
@@ -8,6 +8,7 @@ const o = {
8
8
  failedToLoadIcon: "Symbol konnte nicht geladen werden",
9
9
  editLabel: "Bearbeiten",
10
10
  selectOne: "Eines auswählen",
11
+ selectNone: "Keines",
11
12
  selectMany: "Mehrere auswählen",
12
13
  noResults: "Keine Ergebnisse",
13
14
  passwordPlaceholderText: "Geheimes Passwort",
@@ -62,7 +63,7 @@ const o = {
62
63
  if (e || n) {
63
64
  const i = [];
64
65
  if (e != null && e > 1 && i.push(`bis zu ${e} Dateien`), n && t) {
65
- const l = a(n, {
66
+ const l = s(n, {
66
67
  units: t
67
68
  });
68
69
  i.push(`max ${l} je Datei`);
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./translations-WPN3ibDg.cjs"),a={loadingExtended:"Lädt, bitte warten",loadingShort:"Lädt...",iconDescription:"Symbol",loadingIcon:"Ladesymbol",locale:"Landesvariante",failedToLoadIcon:"Symbol konnte nicht geladen werden",editLabel:"Bearbeiten",selectOne:"Eines auswählen",selectNone:"Keines",selectMany:"Mehrere auswählen",noResults:"Keine Ergebnisse",passwordPlaceholderText:"Geheimes Passwort",togglePasswordVisibility:"Passwort-Sichtbarkeit umschalten",toggleMenu:"Menü umschalten",toggleAside:"Seitenleiste umschalten",mainNavigation:"Hauptnavigation",sidebar:"Seitenleiste",closeDrawer:"Schublade schließen",closeModal:"Modal schließen",confirm:"Bestätigen",cancel:"Abbrechen",addLabel:"Hinzufügen",removeItem:"Element entfernen",currentLocale:"Deutsch",ar:"Arabisch",de:"Deutsch",en:"Englisch",es:"Spanisch",fr:"Französisch",hi:"Hindi",it:"Italienisch",ja:"Japanisch",ko:"Koreanisch",nl:"Niederländisch",pl:"Polnisch",pt:"Portugiesisch",ru:"Russisch",tr:"Türkisch",vi:"Vietnamesisch",zh:"Chinesisch",he:"Hebräisch",fa:"Persisch",ur:"Urdu",emailPlaceholderText:"E-Mail eingeben",incrementValue:"Wert erhöhen",decrementValue:"Wert verringern",dropZoneInstructions:e=>e?"Klicken zum Auswählen oder Dateien hierher ziehen, oder Enter oder Leertaste drücken, um Dateiauswahl zu öffnen":"Dateien hierher ziehen",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Datei entfernen",clearAllFiles:"Alle Dateien löschen",clearValue:"Wert löschen",unknownType:"Unbekannter Typ",filesInputInstructions:(e,n,t)=>{let r=e==null||e>1?"Klicken zum Auswählen oder Dateien hierher ziehen":"Klicken zum Auswählen oder Datei hierher ziehen";if(e||n){const i=[];if(e!=null&&e>1&&i.push(`bis zu ${e} Dateien`),n&&t){const l=s.formatFileSize(n,{units:t});i.push(`max ${l} je Datei`)}i.length>0&&(r+=` (${i.join(", ")})`)}return r},prosemirror:{bold:"Fett",italic:"Kursiv",code:"Inline-Code",link:"Link einfügen",removeLink:"Link entfernen",heading:e=>`Überschrift ${e}`,bulletList:"Aufzählung",orderedList:"Nummerierte Liste",blockquote:"Zitat",codeBlock:"Code-Block",horizontalRule:"Horizontale Linie",linkUrlPlaceholder:"https://beispiel.com"},pdfPageViewer:{loading:"PDF wird geladen...",loadFailed:"PDF konnte nicht geladen werden",invalidPdf:"Ungültige PDF-Datei",pageOutOfRange:(e,n)=>`Seite ${e} liegt außerhalb des Bereichs (1-${n})`,renderFailed:"PDF-Seite konnte nicht gerendert werden"}};exports.default=a;
@@ -2,8 +2,8 @@ import { Use as F, Value as p, prop as ae, html as v, attr as l, on as $, WithEl
2
2
  import { l as Pe } from "./colors-DPo9GEJR.js";
3
3
  import { g as We } from "./timer-Rd2sKnvH.js";
4
4
  import { ElementRect as Ze } from "@tempots/ui";
5
- import { a as N, b as W, f as $e, c as O, C as Y, I as He, g as ge, h as Ye, B as pe } from "./translations-BEMKy6-W.js";
6
- import { C as ce, m as qe, c as Ge, I as Ae, S as ee, d as fe, O as Q, e as De } from "./use-form-DMiCxK26.js";
5
+ import { a as N, b as W, f as $e, c as O, C as Y, I as He, g as ge, h as Ye, B as pe } from "./translations-0tLX4x7M.js";
6
+ import { C as ce, m as qe, c as Ge, I as Ae, S as ee, d as fe, O as Q, e as De } from "./use-form-D4rqJkvG.js";
7
7
  class Je extends Error {
8
8
  constructor(e = "Missing implementation") {
9
9
  super(e), this.name = "MissingImplementationError";
@@ -1 +1 @@
1
- "use strict";const t=require("@tempots/dom"),gt=require("./colors-B2yrgHSW.cjs"),bt=require("./timer-BJHOsuS6.cjs"),vt=require("@tempots/ui"),v=require("./translations-eUtMHN9s.cjs"),$=require("./use-form-pSErMD6z.cjs");class xt extends Error{constructor(e="Missing implementation"){super(e),this.name="MissingImplementationError"}}const yt=n=>It(n).split("_").join(" "),It=n=>(n=n.replace(/::/g,"/"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),n=n.replace(/([a-z\d])([A-Z])/g,"$1_$2"),n=n.replace(/-/g,"_"),n.toLowerCase()),Vt=n=>n.substring(0,1).toUpperCase()+n.substring(1),wt=n=>{if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8");if(typeof atob<"u")return atob(n);throw new xt("No implementation found for base64 decoding")};function P({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:a,disabled:h=!1,allowMultiple:o}){return t.Use(v.BeatUII18n,d=>{const p=t.Value.deriveProp(e??[]),m=t.prop(!1),u=i=>{i.preventDefault(),i.stopPropagation(),m.value=!0},g=i=>{i.preventDefault(),i.stopPropagation(),(!i.currentTarget||!i.currentTarget.contains(i.relatedTarget))&&(m.value=!1)},I=i=>{i.preventDefault(),i.stopPropagation(),m.value=!1;const f=Array.from(i.dataTransfer?.files||[]);f.length>0&&(p.value=f,n(f,"dragdrop"))},c=i=>{t.Value.get(r)&&i.currentTarget.querySelector('input[type="file"]')?.click()};let b=null;const x=()=>{if(b==null)return;const i=Array.from(b.files??[]);i.length>0&&(p.value=i,n(i,"click")),b.value=""},C=i=>{t.Value.get(r)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),c(i))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,i=>i?0:-1)),t.attr.style("position: relative;"),t.on.dragover(u),t.on.dragleave(g),t.on.drop(I),t.on.click(c),t.on.keydown(C),t.html.input(t.attr.type("file"),t.attr.disabled(h),t.attr.accept(l),t.attr.multiple(o),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(x),t.WithElement(i=>(b=i,p.on(f=>{const _=globalThis.DataTransfer;if(_!=null){const k=new _;f.forEach(O=>k.items.add(O)),i.files=k.files}}),t.Empty))),t.aria.label(t.bind(d.$.dropZoneInstructions)(r)),a({files:p,clear:()=>p.value=[],change:p.set}))})}function Ct(n,e){return n.length===e.length&&n.every((l,r)=>l===e[r])}function _t(n,e){const l=["bc-segmented-input",`bc-segmented-input--size-${n}`];return e&&l.push("bc-segmented-input--disabled"),l.join(" ")}function kt({options:n,value:e,onChange:l,size:r="md",disabled:a=!1},...h){const o=gt.l(n).map(([d,p])=>({key:d,label:p}));return t.WithElement(()=>{const d=Object.fromEntries(o.map((m,u)=>[m.key,u])),p=t.prop(o.map(()=>({left:0,width:0})),Ct);return t.html.div(t.attr.class(t.computedOf(r,a)((m,u)=>_t(m??"md",u??!1))),t.html.div(t.attr.class("bc-segmented-input__container"),t.html.div(t.attr.class("bc-segmented-input__indicator"),t.style.width(t.computedOf(e,p)((m,u)=>{const{width:g}=u[d[m]??0];return`${g}px`})),t.style.left(t.computedOf(e,p)((m,u)=>{const{left:g}=u[d[m]??0];return`${g}px`}))),o.map(({label:m,key:u},g)=>t.html.button(t.attr.type("button"),t.on.click(I=>{I.preventDefault(),t.Value.get(a)||l?.(u)}),t.attr.disabled(a),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,I=>I===u?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),vt.ElementRect(I=>{function c(){p.update(x=>{const C=[...x];return C[g]={width:I.value.width,left:I.value.localLeft},C})}const b=bt.g(c);return t.OnDispose(b,I.on(c))}),m))),...h)})}function Et(n){const e=n.type.toLowerCase();return e.startsWith("image/")&&(e.includes("jpeg")||e.includes("jpg")||e.includes("png")||e.includes("gif")||e.includes("webp")||e.includes("svg"))}function Dt(n){const e=n.type.toLowerCase();return e.startsWith("image/")?"vscode-icons:file-type-image":e.startsWith("video/")?"vscode-icons:file-type-video":e.startsWith("audio/")?"vscode-icons:file-type-audio":e.includes("pdf")?"vscode-icons:file-type-pdf2":e.includes("word")||e.includes("document")?"vscode-icons:file-type-word":e.includes("excel")||e.includes("spreadsheet")?"vscode-icons:file-type-excel":e.includes("powerpoint")||e.includes("presentation")?"vscode-icons:file-type-powerpoint":e.includes("zip")||e.includes("archive")?"vscode-icons:file-type-zip":e.includes("text")?"vscode-icons:file-type-text":e.includes("json")?"vscode-icons:file-type-json-official":e.includes("csv")?"vscode-icons:file-type-csv":e.includes("xml")?"vscode-icons:file-type-xml":e.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function q(n){return t.When(n.map(Et),()=>{const e=t.prop(null);return n.on(l=>{e.value&&URL.revokeObjectURL(e.value);const r=URL.createObjectURL(l);e.value=r}),t.html.div(t.OnDispose(()=>{e.value&&URL.revokeObjectURL(e.value)}),t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(e),t.attr.alt(n.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail")))},()=>v.Icon({icon:n.map(Dt)}))}const Ut=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:a,maxFileSize:h,onChange:o,onBlur:d,disabled:p,hasError:m,mode:u="default",showFileList:g=!0,...I}=n,c=l,b=t.Value.map(u,w=>w==="input"),x=t.Value.map(u,w=>w==="compact"),C=w=>{let s=w;if(a!=null){const y=t.Value.get(a);s=s.slice(0,y)}if(h){const y=t.Value.get(h);s=s.filter(E=>E.size<=y)}o?.(s)},i=w=>{const y=c.value.filter((E,D)=>D!==w);o?.(y)},f=()=>{o?.([])},_=({files:w,clear:s,change:y})=>t.Use(v.BeatUII18n,E=>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"),v.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(E.$.filesInputInstructions)(a,h,E.$.fileSizeUnits.value))))),k=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(w.map(y=>y.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(w,(y,E)=>{const D=E.index;return t.html.div(t.attr.class("bc-file-input__compact-file-item"),t.html.div(t.attr.class("bc-file-input__compact-file-icon"),q(y)),t.html.div(t.attr.class("bc-file-input__compact-file-info"),t.html.div(t.attr.class("bc-file-input__compact-file-name"),t.attr.title(y.$.name),y.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(y.$.size,s.$.fileSizeUnits)((V,U)=>v.formatFileSize(V,{units:U}))," • ",t.computedOf(y.$.type,s.$.unknownType)((V,U)=>V||U))),$.CloseButton({size:"sm",label:s.$.removeFile,disabled:p,onClick:()=>i(D)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))))),O=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(w.map(y=>y.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(w,y=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),q(y),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),y.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))));return t.Use(v.BeatUII18n,w=>v.InputContainer({baseContainer:t.Value.map(b,s=>!s),disabled:p,hasError:m,after:t.When(b,()=>t.When(c.map(({length:s})=>s>0),()=>$.CloseButton({size:"sm",label:w.$.clearAllFiles,disabled:p,onClick:f},t.attr.class("bc-file-input__compact-clear")))),...I,input:t.When(b,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:O})),()=>t.When(x,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:_}),t.When(g,()=>t.NotEmpty(c,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(c,(s,y)=>{const E=y.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),q(s)),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(s.$.name),s.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(s.$.size,w.$.fileSizeUnits)((D,V)=>v.formatFileSize(D,{units:V}))," • ",t.computedOf(s.$.type,w.$.unknownType)((D,V)=>D||V))),$.CloseButton({size:"sm",label:w.$.removeFile,disabled:p,onClick:()=>i(E)},t.attr.class("bc-file-input__remove-button")))})),t.When(c.map(({length:s})=>s>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(p),w.$.clearAllFiles,t.on.click(s=>{s.preventDefault(),s.stopPropagation(),f()}))))))))))},...e))},Y="$$tts-exp-",rt=(n,e)=>t.WithElement(l=>{const r=`${Y}${n}`;return t.OnDispose(t.Value.on(e,a=>Reflect.set(l,r,a)))}),$t=(n,e)=>{const l=`${Y}${n}`;return r=>{e(Reflect.get(r.target,l))}},at=(n,e)=>{const l=`${Y}${n}`;return r=>{const a=r.target,h=a.selectedIndex,o=a.options[h];e(Reflect.get(o,l))}};function N(...n){return t.html.div(t.attr.class("bc-group"),...n)}const ot=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:a=>{const h=t.computedOf(a,l)((o,d)=>e(o.value,d));return t.html.option(t.attr.selected(h),rt("value",a.$.value),a.$.label)},group:a=>t.html.optgroup(t.attr.label(a.$.group),t.ForEach(a.$.options,h=>ot(h,e,l))),break:()=>t.html.hr()})),st=n=>{const{value:e,onBlur:l,onChange:r,options:a,unselectedLabel:h,equality:o=(m,u)=>m===u,after:d}=n;let p;return v.InputContainer({...n,after:t.Fragment(v.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),d),input:t.html.select(t.WithElement(m=>{p=m;const u=new MutationObserver(g=>{const{removedNodes:I}=g[0];I.length>0&&(p.selectedIndex=0)});return u.observe(m,{childList:!0}),t.OnDispose(()=>u.disconnect())}),v.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(v.BeatUII18n,m=>t.html.option(t.attr.hidden("hidden"),t.coalesce(h,m.$.selectOne))),t.ForEach(a,m=>ot(m,o,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(at("value",m=>r(m))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function it(n){const{controller:e,onChange:l,onBlur:r,...a}=n;return st({...a,value:e.signal,onChange:$.makeOnChangeHandler(e,l),onBlur:$.makeOnBlurHandler(e,r)})}function Ot(n){return $.InputWrapper({...n,content:it(n)})}function ut(n,e,l){const r=n.length.map(a=>a);return t.Fragment(t.Repeat(r,a=>{const h=n.item(a.index),o=[];return t.Fragment(t.OnDispose(()=>{o.forEach(d=>d())}),e({list:n,item:h,position:a,remove:()=>n.removeAt(a.index),move:d=>{switch(d){case"up":if(a.index===0)return;n.move(a.index,a.index-1);break;case"down":if(a.index===n.length.value-1)return;n.move(a.index,a.index+1);break;case"first":n.move(a.index,0);break;case"last":n.move(a.index,n.length.value-1)}},canMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index>0);case"down":return n.length.map(m=>a.index<m-1)}})();return o.push(()=>p.dispose()),p},cannotMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index===0);case"down":return n.length.map(m=>a.index===m-1)}})();return o.push(()=>p.dispose()),p}}))},l))}const K={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function ct(n,e,l){if(n==null)return[];const r=l?{...K,...e}:e??K,a=(o,d)=>{const p=r[d];p?o.push({type:"pattern",name:d,...p}):o.push({type:"literal",char:d})},h=[];if(typeof n=="string"){for(const o of n)a(h,o);return h}for(const o of n)if(typeof o=="string")if(o.length<=1)a(h,o);else for(const d of o)a(h,d);else Bt(o)?h.push({type:"pattern",pattern:o}):typeof o=="object"&&o&&h.push(o);return h}function St(n,e){return l=>{switch(n){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 e?.(l)??!0;default:return!0}}}function tt(n,e,l,r,a,h){const o={raw:n,previousConformed:e,cursor:a??n.length,completed:!1},d=r.definitions??{},p=typeof l=="function"?l(n,o):l,m=ct(p,d,r.useDefaultDefinitions??!0),u=St(r.allowMode,r.allow),g=new Set;for(const V of m)V.type==="literal"&&g.add(V.char);if(r.prefix)for(const V of r.prefix)g.add(V);if(r.suffix)for(const V of r.suffix)g.add(V);const I=Array.from(n).filter(V=>u(V)&&!g.has(V));if(I.length===0)return{value:"",cursor:0,completed:!1};const c=[],b=[];let x=0,C=0,i=0,f=-1;for(const V of m){if(V.type==="literal"){c.push(V.char),b.push({kind:"literal",filled:!0});continue}C+=V.optional?0:1;const U=I[x];if(U==null)break;if(V.type==="any"){i++,c.push(V.transform?V.transform(U):U),b.push({kind:"slot",filled:!0}),f=b.length-1,x++;continue}if(V.type==="pattern")if(V.pattern.test(U)){i++;const S=V.transform?V.transform(U):U;c.push(S),b.push({kind:"slot",filled:!0}),f=b.length-1,x++}else{x++;continue}}const _=c.join(""),k=(r.prefix??"")+_+(r.suffix??"");let w=(r.prefix??"").length;if(f>=0){let V=f+1;if((h?.policy??"smart")!=="sticky")for(;V<b.length&&b[V].kind==="literal";)V++;w+=V}const s=r.completion?.mode==="min"?(r.completion.minChars??0)<=i:r.completion?.mode==="custom"?!!r.completion.isComplete?.(k):C>0&&i>=C,y=r.pipe?.(k,{...o,completed:s});let E,D=w;return y===!1?(E=e,D=e.length):typeof y=="string"?(E=y,D=y.length):typeof y=="object"&&y?(E=y.value,D=y.cursor??y.value.length):E=k,{value:E,cursor:D,completed:s}}function Tt(n,e){const l=e?.strategy??"none";return l==="custom"&&e?.unmask?e.unmask(n):l==="strip"?n.replace(/[^A-Za-z0-9]/g,""):n}const G=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,onAccept:h,onComplete:o,mask:d,definitions:p,useDefaultDefinitions:m,extraLiterals:u,prefix:g,suffix:I,autofix:c,pipe:b,completion:x,unmask:C,allowMode:i,allow:f,placeholder:_,placeholderOptions:k}=n,O=t.computedOf(e,d,p,m,u,g,I,c,x,C,i,_,k)((s,y,E,D,V,U,S,M,L,z,A,W,T)=>y?tt(s??"","",y,{definitions:E??{},useDefaultDefinitions:D??!0,extraLiterals:V??[],autofix:M??"none",completion:L??{mode:"mask"},pipe:b??(B=>B),unmask:z??{strategy:"none"},allowMode:A??"all",allow:f,prefix:U,suffix:S}).value:s??""),w=(s,y)=>{const E=s.value??"",D=t.Value.get(e)??"",V=d!=null?t.Value.get(d):null,U=p!=null?t.Value.get(p):void 0,S=m!=null?t.Value.get(m):void 0,M=u!=null?t.Value.get(u):void 0,L=c!=null?t.Value.get(c):void 0,z=x!=null?t.Value.get(x):void 0,A=C!=null?t.Value.get(C):void 0,W=i!=null?t.Value.get(i):void 0,T=g!=null?t.Value.get(g):void 0,B=I!=null?t.Value.get(I):void 0,{value:F,cursor:Z,completed:X}=V?tt(E,D,V,{definitions:U??{},useDefaultDefinitions:S??!0,extraLiterals:M??[],autofix:L??"none",completion:z??{mode:"mask"},pipe:b??(ht=>ht),unmask:A??{strategy:"none"},allowMode:W??"all",allow:f,prefix:T,suffix:B},s.selectionStart??E.length,n.cursor?t.Value.get(n.cursor):void 0):{value:E,cursor:E.length,completed:!0};if(F!==E){s.value=F;try{s.setSelectionRange(Z,Z)}catch{}}const Q=Tt(F,A);h?.({raw:Q,conformed:F,completed:X,cursor:Z}),y==="input"?a?.(F):(r?.(F),X&&o?.({raw:Q,conformed:F}))};return t.Fragment(v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(s=>s instanceof HTMLInputElement?t.Fragment(t.on.input(()=>w(s,"input")),t.on.change(()=>w(s,"change")),t.on.keydown(y=>{if(y.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const D=s.selectionStart??0,V=s.selectionEnd??D;if(D!==V||D<=0)return;const U=s.value??"",S=d!=null?t.Value.get(d):null;if(!S)return;const M=p!=null?t.Value.get(p):void 0,L=m!=null?t.Value.get(m):!0,z=g!=null?t.Value.get(g):void 0,A=I!=null?t.Value.get(I):void 0,W=ct(typeof S=="function"?S(U,{raw:U,previousConformed:U,cursor:D,completed:!1}):S,M??{},L??!0),T=new Set;for(const B of W)B.type==="literal"&&T.add(B.char);if(z)for(const B of z)T.add(B);if(A)for(const B of A)T.add(B);if(T.has(U[D-1])){let B=D-1;for(;B>=0&&T.has(U[B]);)B--;B>=0&&(y.preventDefault(),y.stopPropagation(),s.value=U.slice(0,B)+U.slice(B+1),w(s,"input"))}})):t.Empty))}))};function J(n,e,l){const r=t.Value.map(n,o=>o!=null),a=t.computedOf(r,e??!1)((o,d)=>!o||d),h=v.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(h),t.attr.title(h),t.attr.disabled(a),v.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.stopPropagation(),l?.(null)}))}const At=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,rows:h}=n;return v.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(o=>v.generateInputContainerInputClasses(!1,o??"md"))),v.CommonInputAttributes(n),t.attr.rows(h??3),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},Ft=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=I=>{const c=r!=null?t.Value.get(r):void 0,b=a!=null?t.Value.get(a):void 0;return c!=null&&I<c?c:b!=null&&I>b?b:I},u=l!=null?t.Use(v.BeatUII18n,I=>{const c=t.computedOf(e,r)((i,f)=>f==null?!0:(i??0)>f),b=t.computedOf(e,a)((i,f)=>f==null?!0:(i??0)<f),x=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f-_*k,w=r!=null?t.Value.get(r):void 0;if(w!=null&&O<w)return;const s=m(O);s!==f&&o&&o(s)},C=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f+_*k,w=a!=null?t.Value.get(a):void 0;if(w!=null&&O>w)return;const s=m(O);s!==f&&o&&o(s)};return $.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(b,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>C(i)),t.aria.label(I.$.incrementValue),v.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(c,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>x(i)),t.aria.label(I.$.decrementValue),v.Icon({icon:"line-md:minus",size:"xs"})))}):null,g=p!=null&&u!=null?t.Fragment(u,p):p??u;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValueAsNumber(o)):t.Empty,d!=null?t.on.input(t.emitValueAsNumber(d)):t.Empty,l!=null?t.on.wheel(I=>{I.preventDefault();const c=t.Value.get(e)??0,b=t.Value.get(l),x=I.shiftKey?10:1,C=I.deltaY<0?b*x:-b*x,i=m(c+C);i!==c&&o&&o(i)}):t.Empty),after:g})},et=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},zt=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=c=>{const b=r!=null?t.Value.get(r):void 0,x=a!=null?t.Value.get(a):void 0;return b!=null&&c<b?b:x!=null&&c>x?x:c},u=(()=>{if(l==null)return null;const c=t.computedOf(e,r)((f,_)=>{const k=f??0;return _==null?!0:k>_}),b=t.computedOf(e,a)((f,_)=>{const k=f??0;return _==null?!0:k<_}),x=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_-k*O,s=r!=null?t.Value.get(r):void 0;if(s!=null&&w<s)return;const y=m(w);y!==_&&o&&o(y)},C=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_+k*O,s=a!=null?t.Value.get(a):void 0;if(s!=null&&w>s)return;const y=m(w);y!==_&&o&&o(y)};return((f,_)=>$.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(b,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>C(k)),t.aria.label(f),v.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(c,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>x(k)),t.aria.label(_),v.Icon({icon:"line-md:minus",size:"xs"}))))(v.defaultMessages.incrementValue,v.defaultMessages.decrementValue)})(),g=J(e,n.disabled,o??d),I=p!=null&&u!=null?t.Fragment(u,g,p):p!=null?t.Fragment(g,p):u!=null?t.Fragment(u,g):g;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,c=>c==null?"":String(c))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValue(c=>{const b=et(c);o(b)})):t.Empty,d!=null?t.on.input(t.emitValue(c=>{const b=et(c);d(b)})):t.Empty,l!=null?t.on.wheel(c=>{c.preventDefault();const b=t.Value.get(e)??0,x=t.Value.get(l),C=c.shiftKey?10:1,i=c.deltaY<0?x*C:-x*C,f=m(b+i);f!==b&&o&&o(f)}):t.Empty),after:I})},Mt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return G({...n,mask:[e,e,e,e,e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,e,e,e,e,e,e,e,e],placeholder:n.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})};let H=null;async function j(){const n=globalThis;return n.Temporal?n.Temporal:(H||(H=Promise.resolve().then(()=>require("./index.esm-C6lZ02yY.cjs")).then(e=>{const l=e.Temporal;return n.Temporal||(n.Temporal=l),l})),H)}const pt=(n,e)=>e?t.Task(j,{then:n,pending:e.pending,error:e.error}):t.Task(j,n),Lt=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,Nt=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function ft(n){return{mask:null,allowMode:"custom",allow:e=>/[0-9ptwdhms]/i.test(e),pipe:e=>{const l=e.toUpperCase();return l.length===0?l:!l.startsWith("P")||!Lt.test(l)?!1:l},completion:{mode:"custom",isComplete:e=>{const l=e.toUpperCase();if(!Nt.test(l))return!1;try{return n(l),!0}catch{return!1}}}}}const nt=(n,e)=>{if(n==null)return null;try{return n.Duration.from(e)}catch{return null}},Wt=n=>{const{value:e,onChange:l,onInput:r,after:a,disabled:h,onBlur:o}=n,d=()=>{const u=J(e,h,l??r);return a!=null?t.Fragment(u,a):u},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return pt(u=>G({...n,value:t.Value.map(e,g=>g?.toString()??""),onChange:l?g=>l(g===""?null:u.Duration.from(g)):void 0,onInput:void 0,...ft(u.Duration.from),placeholder:"P0DT0H0M0S",after:d()}),{pending:()=>{const u=g=>I=>{const b=I.currentTarget?.value??"";if(b===""){g(null);return}const x=globalThis.Temporal,C=nt(x,b);if(C!=null){g(C);return}j().then(i=>{const f=nt(i,b);f!=null&&g(f)}).catch(()=>{})};return v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,g=>g?.toString()??"")),t.attr.class("bc-input"),p,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(u(l)):t.Empty,r!=null?t.on.input(u(r)):t.Empty),after:d()})}})},Rt=n=>{const{value:e,onBlur:l,onChange:r,onInput:a}=n;return v.InputContainer({...n,input:t.input.url(v.CommonInputAttributes(n),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},dt=n=>{const{controller:e,element:l,separator:r,showMove:a=!0,showRemove:h=!0,showAdd:o=!0,createItem:d,addLabel:p,controlsLayout:m="aside",removeDisabled:u,addDisabled:g}=n,I=t.Value.toSignal(m).map(x=>x==="aside"),c=x=>{const C=t.When(a??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(I.map(f=>f?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("up"),disabled:x.cannotMove("up")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-up",title:f.$.incrementValue}))),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("down"),disabled:x.cannotMove("down")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-down",title:f.$.decrementValue}))))),i=t.When(h,()=>t.Use(v.BeatUII18n,f=>$.CloseButton({size:"xs",label:t.Value.map(f.$.removeItem,_=>_.toLowerCase()),color:"danger",disabled:u,onClick:x.remove})));return f=>t.When(I,()=>N(t.attr.class("bc-group--gap-1 bc-group--align-center"),$.Stack(t.attr.class("bc-stack--grow"),f),$.Stack(t.attr.class("bc-stack--align-center"),t.When(e.signal.map(_=>_.length>1),()=>C),i)),()=>$.Stack(t.attr.class("bc-stack--gap-2"),f,N(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(e.signal.map(_=>_.length>1),()=>C,()=>t.html.div()),i)))},b=t.When(t.computedOf(o,d)((x,C)=>x&&C!=null),()=>N(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),v.Button({size:"sm",variant:"filled",onClick:()=>e.push(d()),disabled:t.computedOf(e.disabled,g??!1)((x,C)=>x||C)},t.Use(v.BeatUII18n,x=>N(t.attr.class("bc-group--gap-2"),v.Icon({icon:"line-md:plus"}),p??x.$.addLabel)))));return t.Fragment(ut(e,x=>c(x)(l(x)),r),b)},Pt=(n,...e)=>{const{controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I,...c}=n;return $.InputWrapper({...c,content:dt({controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I})},...e)};class jt extends $.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,a,h,o,d=$.O){super(e,l,r,a,h,d),this.branches=o;const p=u=>{for(const g of o)if(g.detect(u))return g.key;return o[0]?.key??"unknown"};this.activeBranch=r.map(p,$.O);const m=u=>{if(this.#t.has(u))return this.#t.get(u);const g=o.find(c=>c.key===u);if(!g)throw new Error(`Unknown branch: ${u}`);const I=new $.Controller([...e,u],c=>{this.change(c)},this.signal.map(c=>g.detect(c)?c:g.defaultValue(),d),a.map($.makeMapValidation([u])),{disabled:this.disabled,validationMode:this.parent.validationMode},d);return this.#t.set(u,I),I};this.#e=this.activeBranch.map(u=>m(u),$.O),this.onDispose(()=>{for(const u of this.#t.values())u.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(e){const l=this.branches.find(a=>a.key===e);if(!l)throw new Error(`Unknown branch: ${e}`);if(this.#t.has(e))return this.#t.get(e);const r=new $.Controller([...this.path,e],a=>{this.change(a)},this.signal.map(a=>l.detect(a)?a:l.defaultValue(),$.O),this.status.map($.makeMapValidation([e])),{disabled:this.disabled,validationMode:this.parent.validationMode},$.O);return this.#t.set(e,r),r}switchToBranch(e,l=!1){const r=this.branches.find(o=>o.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const a=t.Value.get(this.signal);if(r.detect(a))return!0;if(r.convert){const o=r.convert(a);if(o.ok)return this.change(o.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const h=r.defaultValue();return this.change(h),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function Zt(n){return n.transform(e=>e??null,e=>e??void 0)}function qt(n){return n.transform(e=>e??"",e=>e===""?void 0:e)}function Ht(n){return n.transform(e=>e??void 0,e=>e??null)}function R(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function mt(n,e){if(e==null)return lt(n);if(n==null)return e;if(R(n)&&R(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=lt(n[r]):R(n[r])&&R(l[r])&&(l[r]=mt(n[r],l[r]));return l}return e}function lt(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.$t=wt;exports.BaseListControl=dt;exports.BaseNativeSelectControl=it;exports.Expando=rt;exports.FilesInput=Ut;exports.Group=N;exports.ListControl=Pt;exports.ListInput=ut;exports.MaskInput=G;exports.NativeSelect=st;exports.NativeSelectControl=Ot;exports.NullableDurationInput=Wt;exports.NullableNumberInput=zt;exports.NullableResetAfter=J;exports.NumberInput=Ft;exports.SegmentedInput=kt;exports.TextArea=At;exports.UUIDInput=Mt;exports.UnionController=jt;exports.UnstyledDropZone=P;exports.UrlInput=Rt;exports.WithTemporal=pt;exports._t=Vt;exports.deepMergeDefaults=mt;exports.durationMaskConfig=ft;exports.emitExpando=$t;exports.emitOptionExpando=at;exports.ensureTemporal=j;exports.gt=yt;exports.transformEmptyStringToUndefined=qt;exports.transformNullToUndefined=Zt;exports.transformUndefinedToNull=Ht;
1
+ "use strict";const t=require("@tempots/dom"),gt=require("./colors-B2yrgHSW.cjs"),bt=require("./timer-BJHOsuS6.cjs"),vt=require("@tempots/ui"),v=require("./translations-WPN3ibDg.cjs"),$=require("./use-form-D4JFOcjo.cjs");class xt extends Error{constructor(e="Missing implementation"){super(e),this.name="MissingImplementationError"}}const yt=n=>It(n).split("_").join(" "),It=n=>(n=n.replace(/::/g,"/"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),n=n.replace(/([a-z\d])([A-Z])/g,"$1_$2"),n=n.replace(/-/g,"_"),n.toLowerCase()),Vt=n=>n.substring(0,1).toUpperCase()+n.substring(1),wt=n=>{if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8");if(typeof atob<"u")return atob(n);throw new xt("No implementation found for base64 decoding")};function P({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:a,disabled:h=!1,allowMultiple:o}){return t.Use(v.BeatUII18n,d=>{const p=t.Value.deriveProp(e??[]),m=t.prop(!1),u=i=>{i.preventDefault(),i.stopPropagation(),m.value=!0},g=i=>{i.preventDefault(),i.stopPropagation(),(!i.currentTarget||!i.currentTarget.contains(i.relatedTarget))&&(m.value=!1)},I=i=>{i.preventDefault(),i.stopPropagation(),m.value=!1;const f=Array.from(i.dataTransfer?.files||[]);f.length>0&&(p.value=f,n(f,"dragdrop"))},c=i=>{t.Value.get(r)&&i.currentTarget.querySelector('input[type="file"]')?.click()};let b=null;const x=()=>{if(b==null)return;const i=Array.from(b.files??[]);i.length>0&&(p.value=i,n(i,"click")),b.value=""},C=i=>{t.Value.get(r)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),c(i))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,i=>i?0:-1)),t.attr.style("position: relative;"),t.on.dragover(u),t.on.dragleave(g),t.on.drop(I),t.on.click(c),t.on.keydown(C),t.html.input(t.attr.type("file"),t.attr.disabled(h),t.attr.accept(l),t.attr.multiple(o),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(x),t.WithElement(i=>(b=i,p.on(f=>{const _=globalThis.DataTransfer;if(_!=null){const k=new _;f.forEach(O=>k.items.add(O)),i.files=k.files}}),t.Empty))),t.aria.label(t.bind(d.$.dropZoneInstructions)(r)),a({files:p,clear:()=>p.value=[],change:p.set}))})}function Ct(n,e){return n.length===e.length&&n.every((l,r)=>l===e[r])}function _t(n,e){const l=["bc-segmented-input",`bc-segmented-input--size-${n}`];return e&&l.push("bc-segmented-input--disabled"),l.join(" ")}function kt({options:n,value:e,onChange:l,size:r="md",disabled:a=!1},...h){const o=gt.l(n).map(([d,p])=>({key:d,label:p}));return t.WithElement(()=>{const d=Object.fromEntries(o.map((m,u)=>[m.key,u])),p=t.prop(o.map(()=>({left:0,width:0})),Ct);return t.html.div(t.attr.class(t.computedOf(r,a)((m,u)=>_t(m??"md",u??!1))),t.html.div(t.attr.class("bc-segmented-input__container"),t.html.div(t.attr.class("bc-segmented-input__indicator"),t.style.width(t.computedOf(e,p)((m,u)=>{const{width:g}=u[d[m]??0];return`${g}px`})),t.style.left(t.computedOf(e,p)((m,u)=>{const{left:g}=u[d[m]??0];return`${g}px`}))),o.map(({label:m,key:u},g)=>t.html.button(t.attr.type("button"),t.on.click(I=>{I.preventDefault(),t.Value.get(a)||l?.(u)}),t.attr.disabled(a),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,I=>I===u?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),vt.ElementRect(I=>{function c(){p.update(x=>{const C=[...x];return C[g]={width:I.value.width,left:I.value.localLeft},C})}const b=bt.g(c);return t.OnDispose(b,I.on(c))}),m))),...h)})}function Et(n){const e=n.type.toLowerCase();return e.startsWith("image/")&&(e.includes("jpeg")||e.includes("jpg")||e.includes("png")||e.includes("gif")||e.includes("webp")||e.includes("svg"))}function Dt(n){const e=n.type.toLowerCase();return e.startsWith("image/")?"vscode-icons:file-type-image":e.startsWith("video/")?"vscode-icons:file-type-video":e.startsWith("audio/")?"vscode-icons:file-type-audio":e.includes("pdf")?"vscode-icons:file-type-pdf2":e.includes("word")||e.includes("document")?"vscode-icons:file-type-word":e.includes("excel")||e.includes("spreadsheet")?"vscode-icons:file-type-excel":e.includes("powerpoint")||e.includes("presentation")?"vscode-icons:file-type-powerpoint":e.includes("zip")||e.includes("archive")?"vscode-icons:file-type-zip":e.includes("text")?"vscode-icons:file-type-text":e.includes("json")?"vscode-icons:file-type-json-official":e.includes("csv")?"vscode-icons:file-type-csv":e.includes("xml")?"vscode-icons:file-type-xml":e.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function q(n){return t.When(n.map(Et),()=>{const e=t.prop(null);return n.on(l=>{e.value&&URL.revokeObjectURL(e.value);const r=URL.createObjectURL(l);e.value=r}),t.html.div(t.OnDispose(()=>{e.value&&URL.revokeObjectURL(e.value)}),t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(e),t.attr.alt(n.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail")))},()=>v.Icon({icon:n.map(Dt)}))}const Ut=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:a,maxFileSize:h,onChange:o,onBlur:d,disabled:p,hasError:m,mode:u="default",showFileList:g=!0,...I}=n,c=l,b=t.Value.map(u,w=>w==="input"),x=t.Value.map(u,w=>w==="compact"),C=w=>{let s=w;if(a!=null){const y=t.Value.get(a);s=s.slice(0,y)}if(h){const y=t.Value.get(h);s=s.filter(E=>E.size<=y)}o?.(s)},i=w=>{const y=c.value.filter((E,D)=>D!==w);o?.(y)},f=()=>{o?.([])},_=({files:w,clear:s,change:y})=>t.Use(v.BeatUII18n,E=>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"),v.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(E.$.filesInputInstructions)(a,h,E.$.fileSizeUnits.value))))),k=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(w.map(y=>y.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(w,(y,E)=>{const D=E.index;return t.html.div(t.attr.class("bc-file-input__compact-file-item"),t.html.div(t.attr.class("bc-file-input__compact-file-icon"),q(y)),t.html.div(t.attr.class("bc-file-input__compact-file-info"),t.html.div(t.attr.class("bc-file-input__compact-file-name"),t.attr.title(y.$.name),y.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(y.$.size,s.$.fileSizeUnits)((V,U)=>v.formatFileSize(V,{units:U}))," • ",t.computedOf(y.$.type,s.$.unknownType)((V,U)=>V||U))),$.CloseButton({size:"sm",label:s.$.removeFile,disabled:p,onClick:()=>i(D)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))))),O=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(w.map(y=>y.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(w,y=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),q(y),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),y.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))));return t.Use(v.BeatUII18n,w=>v.InputContainer({baseContainer:t.Value.map(b,s=>!s),disabled:p,hasError:m,after:t.When(b,()=>t.When(c.map(({length:s})=>s>0),()=>$.CloseButton({size:"sm",label:w.$.clearAllFiles,disabled:p,onClick:f},t.attr.class("bc-file-input__compact-clear")))),...I,input:t.When(b,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:O})),()=>t.When(x,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:_}),t.When(g,()=>t.NotEmpty(c,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(c,(s,y)=>{const E=y.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),q(s)),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(s.$.name),s.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(s.$.size,w.$.fileSizeUnits)((D,V)=>v.formatFileSize(D,{units:V}))," • ",t.computedOf(s.$.type,w.$.unknownType)((D,V)=>D||V))),$.CloseButton({size:"sm",label:w.$.removeFile,disabled:p,onClick:()=>i(E)},t.attr.class("bc-file-input__remove-button")))})),t.When(c.map(({length:s})=>s>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(p),w.$.clearAllFiles,t.on.click(s=>{s.preventDefault(),s.stopPropagation(),f()}))))))))))},...e))},Y="$$tts-exp-",rt=(n,e)=>t.WithElement(l=>{const r=`${Y}${n}`;return t.OnDispose(t.Value.on(e,a=>Reflect.set(l,r,a)))}),$t=(n,e)=>{const l=`${Y}${n}`;return r=>{e(Reflect.get(r.target,l))}},at=(n,e)=>{const l=`${Y}${n}`;return r=>{const a=r.target,h=a.selectedIndex,o=a.options[h];e(Reflect.get(o,l))}};function N(...n){return t.html.div(t.attr.class("bc-group"),...n)}const ot=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:a=>{const h=t.computedOf(a,l)((o,d)=>e(o.value,d));return t.html.option(t.attr.selected(h),rt("value",a.$.value),a.$.label)},group:a=>t.html.optgroup(t.attr.label(a.$.group),t.ForEach(a.$.options,h=>ot(h,e,l))),break:()=>t.html.hr()})),st=n=>{const{value:e,onBlur:l,onChange:r,options:a,unselectedLabel:h,equality:o=(m,u)=>m===u,after:d}=n;let p;return v.InputContainer({...n,after:t.Fragment(v.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),d),input:t.html.select(t.WithElement(m=>{p=m;const u=new MutationObserver(g=>{const{removedNodes:I}=g[0];I.length>0&&(p.selectedIndex=0)});return u.observe(m,{childList:!0}),t.OnDispose(()=>u.disconnect())}),v.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(v.BeatUII18n,m=>t.html.option(t.attr.hidden("hidden"),t.coalesce(h,m.$.selectOne))),t.ForEach(a,m=>ot(m,o,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(at("value",m=>r(m))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function it(n){const{controller:e,onChange:l,onBlur:r,...a}=n;return st({...a,value:e.signal,onChange:$.makeOnChangeHandler(e,l),onBlur:$.makeOnBlurHandler(e,r)})}function Ot(n){return $.InputWrapper({...n,content:it(n)})}function ut(n,e,l){const r=n.length.map(a=>a);return t.Fragment(t.Repeat(r,a=>{const h=n.item(a.index),o=[];return t.Fragment(t.OnDispose(()=>{o.forEach(d=>d())}),e({list:n,item:h,position:a,remove:()=>n.removeAt(a.index),move:d=>{switch(d){case"up":if(a.index===0)return;n.move(a.index,a.index-1);break;case"down":if(a.index===n.length.value-1)return;n.move(a.index,a.index+1);break;case"first":n.move(a.index,0);break;case"last":n.move(a.index,n.length.value-1)}},canMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index>0);case"down":return n.length.map(m=>a.index<m-1)}})();return o.push(()=>p.dispose()),p},cannotMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index===0);case"down":return n.length.map(m=>a.index===m-1)}})();return o.push(()=>p.dispose()),p}}))},l))}const K={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function ct(n,e,l){if(n==null)return[];const r=l?{...K,...e}:e??K,a=(o,d)=>{const p=r[d];p?o.push({type:"pattern",name:d,...p}):o.push({type:"literal",char:d})},h=[];if(typeof n=="string"){for(const o of n)a(h,o);return h}for(const o of n)if(typeof o=="string")if(o.length<=1)a(h,o);else for(const d of o)a(h,d);else Bt(o)?h.push({type:"pattern",pattern:o}):typeof o=="object"&&o&&h.push(o);return h}function St(n,e){return l=>{switch(n){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 e?.(l)??!0;default:return!0}}}function tt(n,e,l,r,a,h){const o={raw:n,previousConformed:e,cursor:a??n.length,completed:!1},d=r.definitions??{},p=typeof l=="function"?l(n,o):l,m=ct(p,d,r.useDefaultDefinitions??!0),u=St(r.allowMode,r.allow),g=new Set;for(const V of m)V.type==="literal"&&g.add(V.char);if(r.prefix)for(const V of r.prefix)g.add(V);if(r.suffix)for(const V of r.suffix)g.add(V);const I=Array.from(n).filter(V=>u(V)&&!g.has(V));if(I.length===0)return{value:"",cursor:0,completed:!1};const c=[],b=[];let x=0,C=0,i=0,f=-1;for(const V of m){if(V.type==="literal"){c.push(V.char),b.push({kind:"literal",filled:!0});continue}C+=V.optional?0:1;const U=I[x];if(U==null)break;if(V.type==="any"){i++,c.push(V.transform?V.transform(U):U),b.push({kind:"slot",filled:!0}),f=b.length-1,x++;continue}if(V.type==="pattern")if(V.pattern.test(U)){i++;const S=V.transform?V.transform(U):U;c.push(S),b.push({kind:"slot",filled:!0}),f=b.length-1,x++}else{x++;continue}}const _=c.join(""),k=(r.prefix??"")+_+(r.suffix??"");let w=(r.prefix??"").length;if(f>=0){let V=f+1;if((h?.policy??"smart")!=="sticky")for(;V<b.length&&b[V].kind==="literal";)V++;w+=V}const s=r.completion?.mode==="min"?(r.completion.minChars??0)<=i:r.completion?.mode==="custom"?!!r.completion.isComplete?.(k):C>0&&i>=C,y=r.pipe?.(k,{...o,completed:s});let E,D=w;return y===!1?(E=e,D=e.length):typeof y=="string"?(E=y,D=y.length):typeof y=="object"&&y?(E=y.value,D=y.cursor??y.value.length):E=k,{value:E,cursor:D,completed:s}}function Tt(n,e){const l=e?.strategy??"none";return l==="custom"&&e?.unmask?e.unmask(n):l==="strip"?n.replace(/[^A-Za-z0-9]/g,""):n}const G=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,onAccept:h,onComplete:o,mask:d,definitions:p,useDefaultDefinitions:m,extraLiterals:u,prefix:g,suffix:I,autofix:c,pipe:b,completion:x,unmask:C,allowMode:i,allow:f,placeholder:_,placeholderOptions:k}=n,O=t.computedOf(e,d,p,m,u,g,I,c,x,C,i,_,k)((s,y,E,D,V,U,S,M,L,z,A,W,T)=>y?tt(s??"","",y,{definitions:E??{},useDefaultDefinitions:D??!0,extraLiterals:V??[],autofix:M??"none",completion:L??{mode:"mask"},pipe:b??(B=>B),unmask:z??{strategy:"none"},allowMode:A??"all",allow:f,prefix:U,suffix:S}).value:s??""),w=(s,y)=>{const E=s.value??"",D=t.Value.get(e)??"",V=d!=null?t.Value.get(d):null,U=p!=null?t.Value.get(p):void 0,S=m!=null?t.Value.get(m):void 0,M=u!=null?t.Value.get(u):void 0,L=c!=null?t.Value.get(c):void 0,z=x!=null?t.Value.get(x):void 0,A=C!=null?t.Value.get(C):void 0,W=i!=null?t.Value.get(i):void 0,T=g!=null?t.Value.get(g):void 0,B=I!=null?t.Value.get(I):void 0,{value:F,cursor:Z,completed:X}=V?tt(E,D,V,{definitions:U??{},useDefaultDefinitions:S??!0,extraLiterals:M??[],autofix:L??"none",completion:z??{mode:"mask"},pipe:b??(ht=>ht),unmask:A??{strategy:"none"},allowMode:W??"all",allow:f,prefix:T,suffix:B},s.selectionStart??E.length,n.cursor?t.Value.get(n.cursor):void 0):{value:E,cursor:E.length,completed:!0};if(F!==E){s.value=F;try{s.setSelectionRange(Z,Z)}catch{}}const Q=Tt(F,A);h?.({raw:Q,conformed:F,completed:X,cursor:Z}),y==="input"?a?.(F):(r?.(F),X&&o?.({raw:Q,conformed:F}))};return t.Fragment(v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(s=>s instanceof HTMLInputElement?t.Fragment(t.on.input(()=>w(s,"input")),t.on.change(()=>w(s,"change")),t.on.keydown(y=>{if(y.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const D=s.selectionStart??0,V=s.selectionEnd??D;if(D!==V||D<=0)return;const U=s.value??"",S=d!=null?t.Value.get(d):null;if(!S)return;const M=p!=null?t.Value.get(p):void 0,L=m!=null?t.Value.get(m):!0,z=g!=null?t.Value.get(g):void 0,A=I!=null?t.Value.get(I):void 0,W=ct(typeof S=="function"?S(U,{raw:U,previousConformed:U,cursor:D,completed:!1}):S,M??{},L??!0),T=new Set;for(const B of W)B.type==="literal"&&T.add(B.char);if(z)for(const B of z)T.add(B);if(A)for(const B of A)T.add(B);if(T.has(U[D-1])){let B=D-1;for(;B>=0&&T.has(U[B]);)B--;B>=0&&(y.preventDefault(),y.stopPropagation(),s.value=U.slice(0,B)+U.slice(B+1),w(s,"input"))}})):t.Empty))}))};function J(n,e,l){const r=t.Value.map(n,o=>o!=null),a=t.computedOf(r,e??!1)((o,d)=>!o||d),h=v.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(h),t.attr.title(h),t.attr.disabled(a),v.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.stopPropagation(),l?.(null)}))}const At=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,rows:h}=n;return v.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(o=>v.generateInputContainerInputClasses(!1,o??"md"))),v.CommonInputAttributes(n),t.attr.rows(h??3),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},Ft=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=I=>{const c=r!=null?t.Value.get(r):void 0,b=a!=null?t.Value.get(a):void 0;return c!=null&&I<c?c:b!=null&&I>b?b:I},u=l!=null?t.Use(v.BeatUII18n,I=>{const c=t.computedOf(e,r)((i,f)=>f==null?!0:(i??0)>f),b=t.computedOf(e,a)((i,f)=>f==null?!0:(i??0)<f),x=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f-_*k,w=r!=null?t.Value.get(r):void 0;if(w!=null&&O<w)return;const s=m(O);s!==f&&o&&o(s)},C=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f+_*k,w=a!=null?t.Value.get(a):void 0;if(w!=null&&O>w)return;const s=m(O);s!==f&&o&&o(s)};return $.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(b,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>C(i)),t.aria.label(I.$.incrementValue),v.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(c,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>x(i)),t.aria.label(I.$.decrementValue),v.Icon({icon:"line-md:minus",size:"xs"})))}):null,g=p!=null&&u!=null?t.Fragment(u,p):p??u;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValueAsNumber(o)):t.Empty,d!=null?t.on.input(t.emitValueAsNumber(d)):t.Empty,l!=null?t.on.wheel(I=>{I.preventDefault();const c=t.Value.get(e)??0,b=t.Value.get(l),x=I.shiftKey?10:1,C=I.deltaY<0?b*x:-b*x,i=m(c+C);i!==c&&o&&o(i)}):t.Empty),after:g})},et=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},zt=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=c=>{const b=r!=null?t.Value.get(r):void 0,x=a!=null?t.Value.get(a):void 0;return b!=null&&c<b?b:x!=null&&c>x?x:c},u=(()=>{if(l==null)return null;const c=t.computedOf(e,r)((f,_)=>{const k=f??0;return _==null?!0:k>_}),b=t.computedOf(e,a)((f,_)=>{const k=f??0;return _==null?!0:k<_}),x=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_-k*O,s=r!=null?t.Value.get(r):void 0;if(s!=null&&w<s)return;const y=m(w);y!==_&&o&&o(y)},C=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_+k*O,s=a!=null?t.Value.get(a):void 0;if(s!=null&&w>s)return;const y=m(w);y!==_&&o&&o(y)};return((f,_)=>$.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(b,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>C(k)),t.aria.label(f),v.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(c,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>x(k)),t.aria.label(_),v.Icon({icon:"line-md:minus",size:"xs"}))))(v.defaultMessages.incrementValue,v.defaultMessages.decrementValue)})(),g=J(e,n.disabled,o??d),I=p!=null&&u!=null?t.Fragment(u,g,p):p!=null?t.Fragment(g,p):u!=null?t.Fragment(u,g):g;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,c=>c==null?"":String(c))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValue(c=>{const b=et(c);o(b)})):t.Empty,d!=null?t.on.input(t.emitValue(c=>{const b=et(c);d(b)})):t.Empty,l!=null?t.on.wheel(c=>{c.preventDefault();const b=t.Value.get(e)??0,x=t.Value.get(l),C=c.shiftKey?10:1,i=c.deltaY<0?x*C:-x*C,f=m(b+i);f!==b&&o&&o(f)}):t.Empty),after:I})},Mt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return G({...n,mask:[e,e,e,e,e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,e,e,e,e,e,e,e,e],placeholder:n.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})};let H=null;async function j(){const n=globalThis;return n.Temporal?n.Temporal:(H||(H=Promise.resolve().then(()=>require("./index.esm-C6lZ02yY.cjs")).then(e=>{const l=e.Temporal;return n.Temporal||(n.Temporal=l),l})),H)}const pt=(n,e)=>e?t.Task(j,{then:n,pending:e.pending,error:e.error}):t.Task(j,n),Lt=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,Nt=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function ft(n){return{mask:null,allowMode:"custom",allow:e=>/[0-9ptwdhms]/i.test(e),pipe:e=>{const l=e.toUpperCase();return l.length===0?l:!l.startsWith("P")||!Lt.test(l)?!1:l},completion:{mode:"custom",isComplete:e=>{const l=e.toUpperCase();if(!Nt.test(l))return!1;try{return n(l),!0}catch{return!1}}}}}const nt=(n,e)=>{if(n==null)return null;try{return n.Duration.from(e)}catch{return null}},Wt=n=>{const{value:e,onChange:l,onInput:r,after:a,disabled:h,onBlur:o}=n,d=()=>{const u=J(e,h,l??r);return a!=null?t.Fragment(u,a):u},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return pt(u=>G({...n,value:t.Value.map(e,g=>g?.toString()??""),onChange:l?g=>l(g===""?null:u.Duration.from(g)):void 0,onInput:void 0,...ft(u.Duration.from),placeholder:"P0DT0H0M0S",after:d()}),{pending:()=>{const u=g=>I=>{const b=I.currentTarget?.value??"";if(b===""){g(null);return}const x=globalThis.Temporal,C=nt(x,b);if(C!=null){g(C);return}j().then(i=>{const f=nt(i,b);f!=null&&g(f)}).catch(()=>{})};return v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,g=>g?.toString()??"")),t.attr.class("bc-input"),p,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(u(l)):t.Empty,r!=null?t.on.input(u(r)):t.Empty),after:d()})}})},Rt=n=>{const{value:e,onBlur:l,onChange:r,onInput:a}=n;return v.InputContainer({...n,input:t.input.url(v.CommonInputAttributes(n),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},dt=n=>{const{controller:e,element:l,separator:r,showMove:a=!0,showRemove:h=!0,showAdd:o=!0,createItem:d,addLabel:p,controlsLayout:m="aside",removeDisabled:u,addDisabled:g}=n,I=t.Value.toSignal(m).map(x=>x==="aside"),c=x=>{const C=t.When(a??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(I.map(f=>f?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("up"),disabled:x.cannotMove("up")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-up",title:f.$.incrementValue}))),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("down"),disabled:x.cannotMove("down")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-down",title:f.$.decrementValue}))))),i=t.When(h,()=>t.Use(v.BeatUII18n,f=>$.CloseButton({size:"xs",label:t.Value.map(f.$.removeItem,_=>_.toLowerCase()),color:"danger",disabled:u,onClick:x.remove})));return f=>t.When(I,()=>N(t.attr.class("bc-group--gap-1 bc-group--align-center"),$.Stack(t.attr.class("bc-stack--grow"),f),$.Stack(t.attr.class("bc-stack--align-center"),t.When(e.signal.map(_=>_.length>1),()=>C),i)),()=>$.Stack(t.attr.class("bc-stack--gap-2"),f,N(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(e.signal.map(_=>_.length>1),()=>C,()=>t.html.div()),i)))},b=t.When(t.computedOf(o,d)((x,C)=>x&&C!=null),()=>N(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),v.Button({size:"sm",variant:"filled",onClick:()=>e.push(d()),disabled:t.computedOf(e.disabled,g??!1)((x,C)=>x||C)},t.Use(v.BeatUII18n,x=>N(t.attr.class("bc-group--gap-2"),v.Icon({icon:"line-md:plus"}),p??x.$.addLabel)))));return t.Fragment(ut(e,x=>c(x)(l(x)),r),b)},Pt=(n,...e)=>{const{controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I,...c}=n;return $.InputWrapper({...c,content:dt({controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I})},...e)};class jt extends $.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,a,h,o,d=$.O){super(e,l,r,a,h,d),this.branches=o;const p=u=>{for(const g of o)if(g.detect(u))return g.key;return o[0]?.key??"unknown"};this.activeBranch=r.map(p,$.O);const m=u=>{if(this.#t.has(u))return this.#t.get(u);const g=o.find(c=>c.key===u);if(!g)throw new Error(`Unknown branch: ${u}`);const I=new $.Controller([...e,u],c=>{this.change(c)},this.signal.map(c=>g.detect(c)?c:g.defaultValue(),d),a.map($.makeMapValidation([u])),{disabled:this.disabled,validationMode:this.parent.validationMode},d);return this.#t.set(u,I),I};this.#e=this.activeBranch.map(u=>m(u),$.O),this.onDispose(()=>{for(const u of this.#t.values())u.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(e){const l=this.branches.find(a=>a.key===e);if(!l)throw new Error(`Unknown branch: ${e}`);if(this.#t.has(e))return this.#t.get(e);const r=new $.Controller([...this.path,e],a=>{this.change(a)},this.signal.map(a=>l.detect(a)?a:l.defaultValue(),$.O),this.status.map($.makeMapValidation([e])),{disabled:this.disabled,validationMode:this.parent.validationMode},$.O);return this.#t.set(e,r),r}switchToBranch(e,l=!1){const r=this.branches.find(o=>o.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const a=t.Value.get(this.signal);if(r.detect(a))return!0;if(r.convert){const o=r.convert(a);if(o.ok)return this.change(o.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const h=r.defaultValue();return this.change(h),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function Zt(n){return n.transform(e=>e??null,e=>e??void 0)}function qt(n){return n.transform(e=>e??"",e=>e===""?void 0:e)}function Ht(n){return n.transform(e=>e??void 0,e=>e??null)}function R(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function mt(n,e){if(e==null)return lt(n);if(n==null)return e;if(R(n)&&R(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=lt(n[r]):R(n[r])&&R(l[r])&&(l[r]=mt(n[r],l[r]));return l}return e}function lt(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.$t=wt;exports.BaseListControl=dt;exports.BaseNativeSelectControl=it;exports.Expando=rt;exports.FilesInput=Ut;exports.Group=N;exports.ListControl=Pt;exports.ListInput=ut;exports.MaskInput=G;exports.NativeSelect=st;exports.NativeSelectControl=Ot;exports.NullableDurationInput=Wt;exports.NullableNumberInput=zt;exports.NullableResetAfter=J;exports.NumberInput=Ft;exports.SegmentedInput=kt;exports.TextArea=At;exports.UUIDInput=Mt;exports.UnionController=jt;exports.UnstyledDropZone=P;exports.UrlInput=Rt;exports.WithTemporal=pt;exports._t=Vt;exports.deepMergeDefaults=mt;exports.durationMaskConfig=ft;exports.emitExpando=$t;exports.emitOptionExpando=at;exports.ensureTemporal=j;exports.gt=yt;exports.transformEmptyStringToUndefined=qt;exports.transformNullToUndefined=Zt;exports.transformUndefinedToNull=Ht;
@@ -1,7 +1,7 @@
1
1
  import { Value as i, Use as H, computedOf as S, html as k, attr as o, on as T, aria as F, Fragment as B, input as R, Empty as N, emitValue as x } from "@tempots/dom";
2
- import { F as X, M as A, N as j, W as $, d as Y } from "./deep-merge-Bsqkvp9-.js";
3
- import { a as q, c as M, b as G, C as L } from "./translations-BEMKy6-W.js";
4
- import { S as Q } from "./use-form-DMiCxK26.js";
2
+ import { F as X, M as A, N as j, W as $, d as Y } from "./deep-merge-1uN6CG6K.js";
3
+ import { a as q, c as M, b as G, C as L } from "./translations-0tLX4x7M.js";
4
+ import { S as Q } from "./use-form-D4rqJkvG.js";
5
5
  const en = (n) => {
6
6
  const {
7
7
  value: t,
@@ -1 +1 @@
1
- "use strict";const t=require("@tempots/dom"),V=require("./deep-merge-cQgRrtGF.cjs"),T=require("./translations-eUtMHN9s.cjs"),A=require("./use-form-pSErMD6z.cjs"),E=n=>{const{value:e,onInput:c,onChange:i,...u}=n;return V.FilesInput({...u,maxFiles:1,value:t.Value.map(e,a=>a==null?[]:[a]),onChange:a=>{i?.(a[0])},onInput:a=>{c?.(a[0])}})},x=n=>{try{return BigInt(n)}catch{return null}},q=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=m=>{const r=i!=null?t.Value.get(i):void 0,s=u!=null?t.Value.get(u):void 0;return r!=null&&m<r?r:s!=null&&m>s?s:m},g=c!=null?t.Use(T.BeatUII18n,m=>{const r=t.computedOf(e,i)((o,l)=>l==null?!0:(o??0n)>l),s=t.computedOf(e,u)((o,l)=>l==null?!0:(o??0n)<l),h=(o,l)=>{const b=t.Value.get(e)??0n,v=t.Value.get(c),k=l?.shiftKey?10n:1n,C=b+v*k*o,y=i!=null?t.Value.get(i):void 0,S=u!=null?t.Value.get(u):void 0;if(o<0n&&y!=null&&C<y||o>0n&&S!=null&&C>S)return;const D=f(C);D!==b&&a&&a(D)};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(s,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(1n,o)),t.aria.label(m.$.incrementValue),T.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(r,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(-1n,o)),t.aria.label(m.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=I!=null&&g!=null?t.Fragment(g,I):I??g,B=a?m=>{const r=x(m);r!=null&&a(f(r))}:void 0,O=d?m=>{const r=x(m);r!=null&&d(f(r))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,m=>m.toString()),onChange:B,onInput:O,after:p,mask:null,allowMode:"digits",class:"bc-number-input"})},M=n=>{if(n==null||n==="")return null;try{return BigInt(n)}catch{return null}},w=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=r=>{const s=i!=null?t.Value.get(i):void 0,h=u!=null?t.Value.get(u):void 0;return s!=null&&r<s?s:h!=null&&r>h?h:r},g=c!=null?t.Use(T.BeatUII18n,r=>{const s=t.computedOf(e,i)((l,b)=>{const v=l??0n;return b==null?!0:v>b}),h=t.computedOf(e,u)((l,b)=>{const v=l??0n;return b==null?!0:v<b}),o=(l,b)=>{const v=t.Value.get(e)??0n,k=t.Value.get(c),C=b?.shiftKey?10n:1n,y=v+k*C*l,S=i!=null?t.Value.get(i):void 0,D=u!=null?t.Value.get(u):void 0;if(l<0n&&S!=null&&y<S||l>0n&&D!=null&&y>D)return;const F=f(y);F!==v&&a&&a(F)};return A.Stack(t.attr.class("bc-number-input-steppers"),t.attr.type("button"),t.html.button(t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(h,n.disabled??!1)((l,b)=>!l||b)),t.on.click(l=>o(1n,l)),t.aria.label(r.$.incrementValue),T.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(s,n.disabled??!1)((l,b)=>!l||b)),t.on.click(l=>o(-1n,l)),t.aria.label(r.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=V.NullableResetAfter(e,n.disabled,a??d),B=I!=null&&g!=null?t.Fragment(g,p,I):I!=null?t.Fragment(p,I):g!=null?t.Fragment(g,p):p,O=a?r=>{const s=M(r);a(s===null?null:f(s))}:void 0,m=d?r=>{const s=M(r);d(s===null?null:f(s))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,r=>r==null?"":r.toString()),onChange:O,onInput:m,after:B,mask:null,allowMode:"digits",class:"bc-number-input"})};function P(n){return e=>{const{value:c,onBlur:i,onChange:u}=e;return V.WithTemporal(a=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,n.valueToString)),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(d=>u(n.parseValue(a,d)))):t.Empty)}))}}function N(n){return e=>{const{value:c,onBlur:i,onChange:u,onInput:a,after:d,disabled:I}=e,f=V.NullableResetAfter(c,I,u??a);return V.WithTemporal(g=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,p=>p==null?"":n.valueToString(p))),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(p=>u(p===""?null:n.parseValue(g,p)))):t.Empty,a!=null?t.on.input(t.emitValue(p=>a(p===""?null:n.parseValue(g,p)))):t.Empty),after:d!=null?t.Fragment(f,d):f}))}}const z=P({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),U=N({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),$=P({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),W=N({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),J=P({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),K=N({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),R=n=>{const{value:e,onChange:c}=n;return V.WithTemporal(i=>V.MaskInput({...n,value:t.Value.map(e,u=>u.toString()),onChange:c?u=>c(i.Duration.from(u)):void 0,onInput:void 0,...V.durationMaskConfig(i.Duration.from),placeholder:"P0DT0H0M0S"}))};exports.BigintInput=q;exports.DurationInput=R;exports.FileInput=E;exports.NullableBigintInput=w;exports.NullablePlainDateInput=U;exports.NullablePlainDateTimeInput=K;exports.NullablePlainTimeInput=W;exports.PlainDateInput=z;exports.PlainDateTimeInput=J;exports.PlainTimeInput=$;exports.createNullableTemporalInput=N;exports.createTemporalInput=P;
1
+ "use strict";const t=require("@tempots/dom"),V=require("./deep-merge-CBIkQM4E.cjs"),T=require("./translations-WPN3ibDg.cjs"),A=require("./use-form-D4JFOcjo.cjs"),E=n=>{const{value:e,onInput:c,onChange:i,...u}=n;return V.FilesInput({...u,maxFiles:1,value:t.Value.map(e,a=>a==null?[]:[a]),onChange:a=>{i?.(a[0])},onInput:a=>{c?.(a[0])}})},x=n=>{try{return BigInt(n)}catch{return null}},q=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=m=>{const r=i!=null?t.Value.get(i):void 0,s=u!=null?t.Value.get(u):void 0;return r!=null&&m<r?r:s!=null&&m>s?s:m},g=c!=null?t.Use(T.BeatUII18n,m=>{const r=t.computedOf(e,i)((o,l)=>l==null?!0:(o??0n)>l),s=t.computedOf(e,u)((o,l)=>l==null?!0:(o??0n)<l),h=(o,l)=>{const b=t.Value.get(e)??0n,v=t.Value.get(c),k=l?.shiftKey?10n:1n,C=b+v*k*o,y=i!=null?t.Value.get(i):void 0,S=u!=null?t.Value.get(u):void 0;if(o<0n&&y!=null&&C<y||o>0n&&S!=null&&C>S)return;const D=f(C);D!==b&&a&&a(D)};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(s,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(1n,o)),t.aria.label(m.$.incrementValue),T.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(r,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(-1n,o)),t.aria.label(m.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=I!=null&&g!=null?t.Fragment(g,I):I??g,B=a?m=>{const r=x(m);r!=null&&a(f(r))}:void 0,O=d?m=>{const r=x(m);r!=null&&d(f(r))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,m=>m.toString()),onChange:B,onInput:O,after:p,mask:null,allowMode:"digits",class:"bc-number-input"})},M=n=>{if(n==null||n==="")return null;try{return BigInt(n)}catch{return null}},w=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=r=>{const s=i!=null?t.Value.get(i):void 0,h=u!=null?t.Value.get(u):void 0;return s!=null&&r<s?s:h!=null&&r>h?h:r},g=c!=null?t.Use(T.BeatUII18n,r=>{const s=t.computedOf(e,i)((l,b)=>{const v=l??0n;return b==null?!0:v>b}),h=t.computedOf(e,u)((l,b)=>{const v=l??0n;return b==null?!0:v<b}),o=(l,b)=>{const v=t.Value.get(e)??0n,k=t.Value.get(c),C=b?.shiftKey?10n:1n,y=v+k*C*l,S=i!=null?t.Value.get(i):void 0,D=u!=null?t.Value.get(u):void 0;if(l<0n&&S!=null&&y<S||l>0n&&D!=null&&y>D)return;const F=f(y);F!==v&&a&&a(F)};return A.Stack(t.attr.class("bc-number-input-steppers"),t.attr.type("button"),t.html.button(t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(h,n.disabled??!1)((l,b)=>!l||b)),t.on.click(l=>o(1n,l)),t.aria.label(r.$.incrementValue),T.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(s,n.disabled??!1)((l,b)=>!l||b)),t.on.click(l=>o(-1n,l)),t.aria.label(r.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=V.NullableResetAfter(e,n.disabled,a??d),B=I!=null&&g!=null?t.Fragment(g,p,I):I!=null?t.Fragment(p,I):g!=null?t.Fragment(g,p):p,O=a?r=>{const s=M(r);a(s===null?null:f(s))}:void 0,m=d?r=>{const s=M(r);d(s===null?null:f(s))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,r=>r==null?"":r.toString()),onChange:O,onInput:m,after:B,mask:null,allowMode:"digits",class:"bc-number-input"})};function P(n){return e=>{const{value:c,onBlur:i,onChange:u}=e;return V.WithTemporal(a=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,n.valueToString)),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(d=>u(n.parseValue(a,d)))):t.Empty)}))}}function N(n){return e=>{const{value:c,onBlur:i,onChange:u,onInput:a,after:d,disabled:I}=e,f=V.NullableResetAfter(c,I,u??a);return V.WithTemporal(g=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,p=>p==null?"":n.valueToString(p))),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(p=>u(p===""?null:n.parseValue(g,p)))):t.Empty,a!=null?t.on.input(t.emitValue(p=>a(p===""?null:n.parseValue(g,p)))):t.Empty),after:d!=null?t.Fragment(f,d):f}))}}const z=P({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),U=N({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),$=P({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),W=N({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),J=P({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),K=N({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),R=n=>{const{value:e,onChange:c}=n;return V.WithTemporal(i=>V.MaskInput({...n,value:t.Value.map(e,u=>u.toString()),onChange:c?u=>c(i.Duration.from(u)):void 0,onInput:void 0,...V.durationMaskConfig(i.Duration.from),placeholder:"P0DT0H0M0S"}))};exports.BigintInput=q;exports.DurationInput=R;exports.FileInput=E;exports.NullableBigintInput=w;exports.NullablePlainDateInput=U;exports.NullablePlainDateTimeInput=K;exports.NullablePlainTimeInput=W;exports.PlainDateInput=z;exports.PlainDateTimeInput=J;exports.PlainTimeInput=$;exports.createNullableTemporalInput=N;exports.createTemporalInput=P;
@@ -1,4 +1,4 @@
1
- import { f as l } from "./translations-BEMKy6-W.js";
1
+ import { f as l } from "./translations-0tLX4x7M.js";
2
2
  const c = {
3
3
  loadingExtended: "Cargando, por favor espere",
4
4
  loadingShort: "Cargando...",
@@ -8,6 +8,7 @@ const c = {
8
8
  failedToLoadIcon: "Error al cargar el icono",
9
9
  editLabel: "Editar",
10
10
  selectOne: "Seleccionar uno",
11
+ selectNone: "Ninguno",
11
12
  selectMany: "Seleccionar varios",
12
13
  noResults: "Sin resultados",
13
14
  passwordPlaceholderText: "Contraseña Secreta",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./translations-WPN3ibDg.cjs"),t={loadingExtended:"Cargando, por favor espere",loadingShort:"Cargando...",locale:"Idioma",iconDescription:"Icono",loadingIcon:"Icono de carga",failedToLoadIcon:"Error al cargar el icono",editLabel:"Editar",selectOne:"Seleccionar uno",selectNone:"Ninguno",selectMany:"Seleccionar varios",noResults:"Sin resultados",passwordPlaceholderText:"Contraseña Secreta",togglePasswordVisibility:"Alternar visibilidad de contraseña",toggleMenu:"Alternar menú",toggleAside:"Alternar panel lateral",mainNavigation:"Navegación principal",sidebar:"Barra lateral",closeDrawer:"Cerrar cajón",closeModal:"Cerrar modal",confirm:"Confirmar",cancel:"Cancelar",addLabel:"Agregar",removeItem:"Eliminar elemento",currentLocale:"Español",ar:"Árabe",de:"Alemán",en:"Inglés",es:"Español",fr:"Francés",hi:"Hindi",it:"Italiano",ja:"Japonés",ko:"Coreano",nl:"Neerlandés",pl:"Polaco",pt:"Portugués",ru:"Ruso",tr:"Turco",vi:"Vietnamita",zh:"Chino",he:"Hebreo",fa:"Persa",ur:"Urdu",emailPlaceholderText:"Correo electrónico",incrementValue:"Incrementar valor",decrementValue:"Decrementar valor",dropZoneInstructions:a=>a?"Haz clic para elegir o arrastra archivos aquí, o presiona Enter o Espacio para abrir el selector de archivos":"Arrastra archivos aquí",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Eliminar archivo",clearAllFiles:"Borrar todos los archivos",clearValue:"Borrar valor",unknownType:"Tipo desconocido",filesInputInstructions:(a,e,o)=>{let n=a==null||a>1?"Haz clic para elegir o arrastra archivos aquí":"Haz clic para elegir o arrastra un archivo aquí";if(a||e){const r=[];if(a!=null&&a>1&&r.push(`hasta ${a} archivos`),e&&o){const i=l.formatFileSize(e,{units:o});r.push(`máx ${i} cada uno`)}r.length>0&&(n+=` (${r.join(", ")})`)}return n},prosemirror:{bold:"Negrita",italic:"Cursiva",code:"Código en línea",link:"Insertar enlace",removeLink:"Eliminar enlace",heading:a=>`Encabezado ${a}`,bulletList:"Lista con viñetas",orderedList:"Lista numerada",blockquote:"Cita",codeBlock:"Bloque de código",horizontalRule:"Línea horizontal",linkUrlPlaceholder:"https://ejemplo.com"},pdfPageViewer:{loading:"Cargando PDF...",loadFailed:"Error al cargar el PDF",invalidPdf:"Archivo PDF inválido",pageOutOfRange:(a,e)=>`La página ${a} está fuera de rango (1-${e})`,renderFailed:"Error al renderizar la página del PDF"}};exports.default=t;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-WPN3ibDg.cjs"),a={loadingExtended:"در حال بارگذاری، لطفاً صبر کنید",loadingShort:"در حال بارگذاری...",locale:"زبان",iconDescription:"نماد",loadingIcon:"نماد بارگذاری",failedToLoadIcon:"بارگذاری نماد ناموفق بود",editLabel:"ویرایش",selectOne:"یکی را انتخاب کنید",selectNone:"هیچکدام",selectMany:"چند مورد را انتخاب کنید",noResults:"بدون نتیجه",passwordPlaceholderText:"رمز عبور محرمانه",togglePasswordVisibility:"نمایش/مخفی کردن رمز عبور",toggleMenu:"نمایش/مخفی کردن منو",toggleAside:"نمایش/مخفی کردن پانل کناری",mainNavigation:"ناوبری اصلی",sidebar:"نوار کناری",closeDrawer:"بستن کشو",closeModal:"بستن پنجره",confirm:"تأیید",cancel:"لغو",addLabel:"افزودن",removeItem:"حذف مورد",currentLocale:"فارسی",ar:"عربی",de:"آلمانی",en:"انگلیسی",es:"اسپانیایی",fr:"فرانسوی",he:"عبری",hi:"هندی",it:"ایتالیایی",ja:"ژاپنی",ko:"کره‌ای",nl:"هلندی",pl:"لهستانی",pt:"پرتغالی",ru:"روسی",tr:"ترکی",vi:"ویتنامی",zh:"چینی",fa:"فارسی",ur:"اردو",emailPlaceholderText:"ایمیل خود را وارد کنید",incrementValue:"افزایش مقدار",decrementValue:"کاهش مقدار",dropZoneInstructions:e=>e?"برای انتخاب کلیک کنید یا فایل‌ها را بکشید، یا Enter یا Space را فشار دهید تا انتخابگر فایل باز شود":"فایل‌ها را بکشید",fileSizeUnits:["بایت","کیلوبایت","مگابایت","گیگابایت","ترابایت"],removeFile:"حذف فایل",clearAllFiles:"حذف همه فایل‌ها",clearValue:"حذف مقدار",unknownType:"نوع ناشناخته",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"برای انتخاب کلیک کنید یا فایل‌ها را بکشید":"برای انتخاب کلیک کنید یا فایل را بکشید";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`تا ${e} فایل`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`حداکثر ${i} هر کدام`)}l.length>0&&(n+=` (${l.join("، ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
@@ -1,4 +1,4 @@
1
- import { f as a } from "./translations-BEMKy6-W.js";
1
+ import { f as a } from "./translations-0tLX4x7M.js";
2
2
  const d = {
3
3
  loadingExtended: "در حال بارگذاری، لطفاً صبر کنید",
4
4
  loadingShort: "در حال بارگذاری...",
@@ -8,6 +8,7 @@ const d = {
8
8
  failedToLoadIcon: "بارگذاری نماد ناموفق بود",
9
9
  editLabel: "ویرایش",
10
10
  selectOne: "یکی را انتخاب کنید",
11
+ selectNone: "هیچکدام",
11
12
  selectMany: "چند مورد را انتخاب کنید",
12
13
  noResults: "بدون نتیجه",
13
14
  passwordPlaceholderText: "رمز عبور محرمانه",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-WPN3ibDg.cjs"),t={loadingExtended:"Chargement, veuillez patienter",loadingShort:"Chargement...",locale:"Langue",iconDescription:"Icône",loadingIcon:"Icône de chargement",failedToLoadIcon:"Échec du chargement de l'icône",editLabel:"Modifier",selectOne:"Sélectionner un",selectNone:"Aucun",selectMany:"Sélectionner plusieurs",noResults:"Aucun résultat",passwordPlaceholderText:"Mot de passe secret",togglePasswordVisibility:"Basculer la visibilité du mot de passe",toggleMenu:"Basculer le menu",toggleAside:"Basculer le panneau latéral",mainNavigation:"Navigation principale",sidebar:"Barre latérale",closeDrawer:"Fermer le tiroir",closeModal:"Fermer la modale",confirm:"Confirmer",cancel:"Annuler",addLabel:"Ajouter",removeItem:"Supprimer l’élément",currentLocale:"Français",ar:"Arabe",de:"Allemand",en:"Anglais",es:"Espagnol",fr:"Français",hi:"Hindi",it:"Italien",ja:"Japonais",ko:"Coréen",nl:"Néerlandais",pl:"Polonais",pt:"Portuguais",ru:"Russe",tr:"Turc",vi:"Vietnamien",zh:"Chinois",he:"Hébreu",fa:"Persan",ur:"Ourdou",emailPlaceholderText:"Entrez votre e-mail",incrementValue:"Incrémenter la valeur",decrementValue:"Décrémenter la valeur",dropZoneInstructions:e=>e?"Cliquez pour choisir ou glissez des fichiers ici, ou appuyez sur Entrée ou Espace pour ouvrir le sélecteur de fichiers":"Glissez des fichiers ici",fileSizeUnits:["Octets","Ko","Mo","Go","To"],removeFile:"Supprimer le fichier",clearAllFiles:"Effacer tous les fichiers",clearValue:"Réinitialiser",unknownType:"Type inconnu",filesInputInstructions:(e,i,n)=>{let l=e==null||e>1?"Cliquez pour choisir ou glissez des fichiers ici":"Cliquez pour choisir ou glissez un fichier ici";if(e||i){const r=[];if(e!=null&&e>1&&r.push(`jusqu'à ${e} fichiers`),i&&n){const o=a.formatFileSize(i,{units:n});r.push(`max ${o} chacun`)}r.length>0&&(l+=` (${r.join(", ")})`)}return l},prosemirror:{bold:"Gras",italic:"Italique",code:"Code en ligne",link:"Insérer un lien",removeLink:"Supprimer le lien",heading:e=>`Titre ${e}`,bulletList:"Liste à puces",orderedList:"Liste numérotée",blockquote:"Citation",codeBlock:"Bloc de code",horizontalRule:"Ligne horizontale",linkUrlPlaceholder:"https://exemple.com"},pdfPageViewer:{loading:"Chargement du PDF...",loadFailed:"Échec du chargement du PDF",invalidPdf:"Fichier PDF invalide",pageOutOfRange:(e,i)=>`La page ${e} est hors limites (1-${i})`,renderFailed:"Échec du rendu de la page PDF"}};exports.default=t;
@@ -1,4 +1,4 @@
1
- import { f as o } from "./translations-BEMKy6-W.js";
1
+ import { f as a } from "./translations-0tLX4x7M.js";
2
2
  const s = {
3
3
  loadingExtended: "Chargement, veuillez patienter",
4
4
  loadingShort: "Chargement...",
@@ -8,6 +8,7 @@ const s = {
8
8
  failedToLoadIcon: "Échec du chargement de l'icône",
9
9
  editLabel: "Modifier",
10
10
  selectOne: "Sélectionner un",
11
+ selectNone: "Aucun",
11
12
  selectMany: "Sélectionner plusieurs",
12
13
  noResults: "Aucun résultat",
13
14
  passwordPlaceholderText: "Mot de passe secret",
@@ -62,10 +63,10 @@ const s = {
62
63
  if (e || i) {
63
64
  const r = [];
64
65
  if (e != null && e > 1 && r.push(`jusqu'à ${e} fichiers`), i && n) {
65
- const a = o(i, {
66
+ const o = a(i, {
66
67
  units: n
67
68
  });
68
- r.push(`max ${a} chacun`);
69
+ r.push(`max ${o} chacun`);
69
70
  }
70
71
  r.length > 0 && (l += ` (${r.join(", ")})`);
71
72
  }
@@ -1,4 +1,4 @@
1
- import { f as r } from "./translations-BEMKy6-W.js";
1
+ import { f as r } from "./translations-0tLX4x7M.js";
2
2
  const d = {
3
3
  loadingExtended: "טוען, אנא המתן",
4
4
  loadingShort: "טוען...",
@@ -8,6 +8,7 @@ const d = {
8
8
  failedToLoadIcon: "נכשל בטעינת הסמל",
9
9
  editLabel: "עריכה",
10
10
  selectOne: "בחר אחד",
11
+ selectNone: "ללא",
11
12
  selectMany: "בחר מספר",
12
13
  noResults: "אין תוצאות",
13
14
  passwordPlaceholderText: "סיסמה סודית",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-WPN3ibDg.cjs"),a={loadingExtended:"טוען, אנא המתן",loadingShort:"טוען...",locale:"שפה",iconDescription:"סמל",loadingIcon:"סמל טעינה",failedToLoadIcon:"נכשל בטעינת הסמל",editLabel:"עריכה",selectOne:"בחר אחד",selectNone:"ללא",selectMany:"בחר מספר",noResults:"אין תוצאות",passwordPlaceholderText:"סיסמה סודית",togglePasswordVisibility:"הצג/הסתר סיסמה",toggleMenu:"הצג/הסתר תפריט",toggleAside:"הצג/הסתר פאנל צדדי",mainNavigation:"ניווט ראשי",sidebar:"סרגל צדדי",closeDrawer:"סגור מגירה",closeModal:"סגור חלון קופץ",confirm:"אישור",cancel:"ביטול",addLabel:"הוסף",removeItem:"הסר פריט",currentLocale:"עברית",ar:"ערבית",de:"גרמנית",en:"אנגלית",es:"ספרדית",fr:"צרפתית",he:"עברית",hi:"הינדי",it:"איטלקית",ja:"יפנית",ko:"קוריאנית",nl:"הולנדית",pl:"פולנית",pt:"פורטוגזית",ru:"רוסית",tr:"טורקית",vi:"וייטנאמית",zh:"סינית",fa:"פרסית",ur:"אורדו",emailPlaceholderText:'הכנס את כתובת הדוא"ל',incrementValue:"הגדלת ערך",decrementValue:"הקטנת ערך",dropZoneInstructions:e=>e?"לחץ לבחירה או גרור קבצים כאן, או לחץ Enter או רווח לפתיחת בורר הקבצים":"גרור קבצים כאן",fileSizeUnits:["בתים","ק״ב","מ״ב","ג״ב","ט״ב"],removeFile:"הסר קובץ",clearAllFiles:"נקה את כל הקבצים",clearValue:"נקה ערך",unknownType:"סוג לא ידוע",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"לחץ לבחירה או גרור קבצים כאן":"לחץ לבחירה או גרור קובץ כאן";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`עד ${e} קבצים`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`מקסימום ${i} כל אחד`)}l.length>0&&(n+=` (${l.join(", ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-WPN3ibDg.cjs"),a={loadingExtended:"लोड हो रहा है, कृपया प्रतीक्षा करें",loadingShort:"लोड हो रहा है...",locale:"स्थानीय",iconDescription:"आइकन",loadingIcon:"लोडिंग आइकन",failedToLoadIcon:"आइकन लोड करने में विफल",editLabel:"संपादित करें",selectOne:"एक चुनें",selectNone:"कोई नहीं",selectMany:"बहुत चुनें",noResults:"कोई परिणाम नहीं",passwordPlaceholderText:"गुप्त पासवर्ड",togglePasswordVisibility:"पासवर्ड दृश्यता टॉगल करें",toggleMenu:"मेनू टॉगल करें",toggleAside:"साइड पैनल टॉगल करें",mainNavigation:"मुख्य नेवीगेशन",sidebar:"साइडबार",closeDrawer:"ड्रॉअर बंद करें",closeModal:"मॉडल बंद करें",confirm:"पुष्टि करें",cancel:"रद्द करें",addLabel:"जोड़ें",removeItem:"आइटम हटाएं",currentLocale:"हिंदी",ar:"अरबी",de:"जर्मन",en:"अंग्रेज़ी",es:"स्पेनिश",fr:"फ्रेंच",hi:"हिन्दी",it:"इतालवी",ja:"जापानी",ko:"कोरियाई",nl:"डच",pl:"पोलिश",pt:"पोर्तुगीज",ru:"रूसी",tr:"तुर्की",vi:"वियतनामी",zh:"चीनी",he:"हिब्रू",fa:"फारसी",ur:"उर्दू",emailPlaceholderText:"अपना ईमेल दर्ज करें",incrementValue:"वृद्धि मान",decrementValue:"घटाना मान",dropZoneInstructions:e=>e?"चुनने के लिए क्लिक करें या फ़ाइलें यहाँ खींचें, या फाइल चयनकर्ता खोलने के लिए Enter या Space दबाएं":"फ़ाइलें यहाँ खींचें",fileSizeUnits:["बाइट्स","KB","MB","GB","TB"],removeFile:"फ़ाइल हटाएं",clearAllFiles:"सभी फ़ाइलें हटाएं",clearValue:"वृद्धि मान",unknownType:"अज्ञात प्रकार",filesInputInstructions:(e,o,t)=>{let n=e==null||e>1?"चुनने के लिए क्लिक करें या फ़ाइलें यहाँ खींचें":"चुनने के लिए क्लिक करें या फ़ाइल यहाँ खींचें";if(e||o){const l=[];if(e!=null&&e>1&&l.push(`अधिकतम ${e} फ़ाइलें`),o&&t){const i=r.formatFileSize(o,{units:t});l.push(`प्रत्येक अधिकतम ${i}`)}l.length>0&&(n+=` (${l.join(", ")})`)}return n},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=a;