@tempots/beatui 1.1.4 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ar-CZ07-PLK.js → ar-C-kUt6f9.js} +1 -1
- package/dist/{ar-CFd5Xkva.cjs → ar-Dc56zcjW.cjs} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-CvQ0TQwi.js → auth-divider-D_3gKZ6g.js} +469 -461
- package/dist/auth-divider-itm5-j5G.cjs +1 -0
- package/dist/beatui.css +20 -7
- package/dist/beatui.tailwind.css +20 -7
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +55 -51
- package/dist/{colors-DwufPN8S.js → colors-C2sgnzFH.js} +7 -7
- package/dist/{colors-B-p6IzX9.cjs → colors-DPCHjRMj.cjs} +1 -1
- package/dist/{de-Dpx6i3Pv.js → de-CP0kbElb.js} +1 -1
- package/dist/{de-BJG9UqDS.cjs → de-DboQlEC4.cjs} +1 -1
- package/dist/{deep-merge-DEEd-Tte.cjs → deep-merge-Bjv1NvKj.cjs} +1 -1
- package/dist/{deep-merge-D1cBNWZX.js → deep-merge-DwXDd3iF.js} +234 -233
- package/dist/{duration-input-CdgMuk2b.cjs → duration-input-CjNZyVkf.cjs} +1 -1
- package/dist/{duration-input-Dpqj2Am9.js → duration-input-CnMMvPgT.js} +4 -4
- package/dist/{editor-toolbar-group-7eMZbEvH.js → editor-toolbar-group-DWUWUO-B.js} +2 -2
- package/dist/{editor-toolbar-group-BJWRgYtv.cjs → editor-toolbar-group-QVdBUbB8.cjs} +1 -1
- package/dist/{es-apq3F_om.js → es-BtIkcnsw.js} +1 -1
- package/dist/{es-BBqPUxJF.cjs → es-CAmE_0Ph.cjs} +1 -1
- package/dist/{fa-BYpfIkLu.js → fa-11-rZmQ-.js} +1 -1
- package/dist/{fa-d0o3KlIu.cjs → fa-D9LrFZdW.cjs} +1 -1
- package/dist/{fr-Ba5_hcn7.js → fr-C-L2F8w2.js} +1 -1
- package/dist/{fr-DzXA-sjH.cjs → fr-DKogQyss.cjs} +1 -1
- package/dist/{he-Dff_I80g.js → he-Bu1xGoQ9.js} +1 -1
- package/dist/{he-Cnx-qg1P.cjs → he-CVx91Jdr.cjs} +1 -1
- package/dist/{hi-BeJ8Q4O6.cjs → hi-BgrHV72l.cjs} +1 -1
- package/dist/{hi-7G-frHVR.js → hi-CewH-MAH.js} +1 -1
- package/dist/{index-C3o9GSH6.js → index-BGKz2Nol.js} +1 -1
- package/dist/{index-B5MAsOC-.cjs → index-DFF7Uahh.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +26 -26
- package/dist/{input-container-BZwpJgx6.cjs → input-container-BkPcNDaZ.cjs} +1 -1
- package/dist/{input-container-Q9wL2BUl.js → input-container-CO3DNqpp.js} +2 -2
- package/dist/{it-dSE5UgTZ.js → it-5hiKQO_p.js} +1 -1
- package/dist/{it-DE3pe-gS.cjs → it-B1rA1F9l.cjs} +1 -1
- package/dist/{ja-DRzjr2YR.js → ja-CGfEmZrm.js} +1 -1
- package/dist/{ja-yzk8mwox.cjs → ja-DZnjjqoi.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +10 -10
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/{ko-rKqndOMO.cjs → ko-CDnYKYWU.cjs} +1 -1
- package/dist/{ko-7gpweMh7.js → ko-DZthvREd.js} +1 -1
- package/dist/lexical/index.cjs.js +1 -1
- package/dist/lexical/index.es.js +4 -4
- package/dist/{modal-ClnvWxzi.cjs → modal-DCxNGrzk.cjs} +1 -1
- package/dist/{modal-DXWQ-HUs.js → modal-YKqlh4Dk.js} +3 -3
- package/dist/{nl-DKHslb-6.cjs → nl-Bj8QnDEY.cjs} +1 -1
- package/dist/{nl-DAe4B7fb.js → nl-CcKyHlQ7.js} +1 -1
- package/dist/{notice-Dx4D1UOf.js → notice-Du3tWJTW.js} +4 -4
- package/dist/{notice-dOOD80F7.cjs → notice-Q0A1gIho.cjs} +1 -1
- package/dist/{oneof-branch-detection-bQKKfV32.cjs → oneof-branch-detection-BEkAezNi.cjs} +1 -1
- package/dist/{oneof-branch-detection-B57ZDbzM.js → oneof-branch-detection-DSzC0PkO.js} +1 -1
- package/dist/{pl-9yeqi1Kn.cjs → pl-BmuuxxVd.cjs} +1 -1
- package/dist/{pl-4xrzOC4A.js → pl-Mwtjp4MV.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +4 -4
- package/dist/{pt-DYQOe1Td.js → pt-BaTsY-8f.js} +1 -1
- package/dist/{pt-CCfVWHz4.cjs → pt-RiC0yeVA.cjs} +1 -1
- package/dist/{ru-FofxuqAJ.js → ru-CvbGmz5s.js} +1 -1
- package/dist/{ru-Cct0jttM.cjs → ru-pRqtOQHF.cjs} +1 -1
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.cjs.js +1 -1
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/{text-input-DEAddaOi.js → text-input-BAn02BzO.js} +1 -1
- package/dist/{text-input-CynkbBpH.cjs → text-input-D_IxFd0M.cjs} +1 -1
- package/dist/{toolbar-e9POle8o.js → toolbar-BKan3NHw.js} +1 -1
- package/dist/{toolbar-Dz7R1kV3.cjs → toolbar-CnecqhaU.cjs} +1 -1
- package/dist/{tr-DhKxAXK0.cjs → tr-B9JhBJeL.cjs} +1 -1
- package/dist/{tr-BfKjkfhE.js → tr-YFqQdZjM.js} +1 -1
- package/dist/{translations-D8Jwi_d0.cjs → translations-C_-cObaF.cjs} +1 -1
- package/dist/{translations-BplmL3nb.js → translations-CxDUnbXn.js} +1 -1
- package/dist/{translations-B96REXIk.js → translations-DT5QQ4WO.js} +19 -19
- package/dist/{translations-BDGa_4jx.cjs → translations-qefRsdGi.cjs} +1 -1
- package/dist/types/better-auth/types.d.ts +5 -1
- package/dist/types/components/auth/auth-container.d.ts +1 -1
- package/dist/types/components/form/input/date-input.d.ts +4 -4
- package/dist/types/components/form/input/date-time-input.d.ts +4 -4
- package/dist/types/components/form/input/input-container.d.ts +1 -1
- package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
- package/dist/{ur-DmfFC6MV.cjs → ur-BZakU0iv.cjs} +1 -1
- package/dist/{ur-COVuSAxC.js → ur-CdnwwnG_.js} +1 -1
- package/dist/{use-form-Ca0kF4af.cjs → use-form-BvBkVEKi.cjs} +1 -1
- package/dist/{use-form-CEY-gUUT.js → use-form-D_TJyZhP.js} +2 -2
- package/dist/{vi-DI3te8d5.js → vi-Bwvz1d_n.js} +1 -1
- package/dist/{vi-DvY-zvIr.cjs → vi-D1nly0nb.cjs} +1 -1
- package/dist/{widget-customization-CHxaaaEV.cjs → widget-customization-CD_NyRQ8.cjs} +1 -1
- package/dist/{widget-customization-BZ8aKWRK.js → widget-customization-D2a6SVP3.js} +5 -5
- package/dist/{zh-DJhzbpi2.cjs → zh-DBk7sSD9.cjs} +1 -1
- package/dist/{zh-DKIbNXv8.js → zh-hy7Uw6c5.js} +1 -1
- package/package.json +1 -1
- package/dist/auth-divider-BHAbd_PS.cjs +0 -1
|
@@ -13,10 +13,10 @@ import { InputOptions } from './input-options';
|
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* import { prop } from '@tempots/dom'
|
|
16
|
-
* import {
|
|
16
|
+
* import { DateTimeInput } from '@tempots/beatui'
|
|
17
17
|
*
|
|
18
18
|
* const appointment = prop(new Date())
|
|
19
|
-
*
|
|
19
|
+
* DateTimeInput({
|
|
20
20
|
* value: appointment,
|
|
21
21
|
* onChange: appointment.set,
|
|
22
22
|
* })
|
|
@@ -25,7 +25,7 @@ import { InputOptions } from './input-options';
|
|
|
25
25
|
* @example
|
|
26
26
|
* ```ts
|
|
27
27
|
* // With label via InputWrapper
|
|
28
|
-
*
|
|
28
|
+
* DateTimeInput({
|
|
29
29
|
* value: prop(new Date()),
|
|
30
30
|
* onChange: (d) => console.log('Selected:', d.toISOString()),
|
|
31
31
|
* disabled: false,
|
|
@@ -33,4 +33,4 @@ import { InputOptions } from './input-options';
|
|
|
33
33
|
* })
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare const
|
|
36
|
+
export declare const DateTimeInput: (options: InputOptions<Date>) => import("@tempots/dom").Renderable;
|
|
@@ -20,7 +20,7 @@ export declare function generateInputContainerInputClasses(baseContainer: boolea
|
|
|
20
20
|
* - Click-to-focus behavior (clicking the container focuses the input)
|
|
21
21
|
* - Responsive sizing based on the `size` prop
|
|
22
22
|
*
|
|
23
|
-
* Used by most form inputs (TextInput, NumberInput,
|
|
23
|
+
* Used by most form inputs (TextInput, NumberInput, DateInput, etc.) to ensure
|
|
24
24
|
* visual consistency across the component library.
|
|
25
25
|
*
|
|
26
26
|
* @param options - Container configuration options
|
|
@@ -11,10 +11,10 @@ import { InputOptions } from './input-options';
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
-
*
|
|
14
|
+
* NullableDateInput({
|
|
15
15
|
* value: prop<Date | null>(null),
|
|
16
16
|
* onChange: date => console.log('Date:', date),
|
|
17
17
|
* })
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const NullableDateInput: (options: InputOptions<Date | null>) => import("@tempots/dom").Renderable;
|
|
@@ -12,10 +12,10 @@ import { InputOptions } from './input-options';
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
|
-
*
|
|
15
|
+
* NullableDateTimeInput({
|
|
16
16
|
* value: prop<Date | null>(new Date()),
|
|
17
17
|
* onChange: date => console.log('DateTime:', date),
|
|
18
18
|
* })
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const NullableDateTimeInput: (options: InputOptions<Date | null>) => import("@tempots/dom").Renderable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./translations-qefRsdGi.cjs"),r={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:["بائٹس","KB","MB","GB","TB"],removeFile:"فائل حذف کریں",clearAllFiles:"تمام فائلیں صاف کریں",clearValue:"قدر صاف کریں",unknownType:"نامعلوم قسم",filesInputInstructions:(e,t,l)=>{let o=e==null||e>1?"منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں":"منتخب کرنے کے لیے کلک کریں یا فائل یہاں گھسیٹیں";if(e||t){const n=[];if(e!=null&&e>1&&n.push(`زیادہ سے زیادہ ${e} فائلیں`),t&&l){const a=i.formatFileSize(t,{units:l});n.push(`ہر ایک زیادہ سے زیادہ ${a}`)}n.length>0&&(o+=` (${n.join("، ")})`)}return o},paginationLabel:"صفحہ بندی",paginationRange:(e,t,l,o)=>o>l?`قطاریں ${e} سے ${t} تک، ${l} میں سے ${o} میں سے`:`قطاریں ${e} سے ${t} تک، ${l} میں سے`,firstPage:"پہلا صفحہ",previousPage:"پچھلا صفحہ",nextPage:"اگلا صفحہ",lastPage:"آخری صفحہ",breadcrumbs:"بریڈ کرمبز",commandPalette:"کمانڈ پیلیٹ",typeACommand:"کمانڈ ٹائپ کریں...",noResultsFound:"کوئی نتیجہ نہیں ملا",noMatchingCommands:"کوئی مماثل کمانڈ نہیں ملی",appearanceSystem:"سسٹم",appearanceLight:"ہلکا",appearanceDark:"گہرا",ok:"OK",changeTypeConfirmation:"قسم تبدیل کرنے سے موجودہ قدر صاف ہو جائے گی۔ جاری رکھیں؟",notifications:"اطلاعات",markAllAsRead:"سب کو پڑھا ہوا نشان زد کریں",noNotifications:"کوئی اطلاع نہیں",schemaConflictsDetected:"اسکیما تنازعات کا پتا چلا",schemaViolationsDetected:"اسکیما خلاف ورزیوں کا پتا چلا",properties:"خصوصیات",uploading:"اپ لوڈ ہو رہا ہے...",dropFilesOrBrowse:"فائلیں یہاں چھوڑیں یا براؤز کرنے کے لیے کلک کریں",acceptedTypes:e=>`قابل قبول اقسام: ${e}`,enterUrlPrompt:"URL درج کریں:",exceeded:"(حد سے تجاوز)",pdfPreview:"PDF پیش نظارہ",lexical:{fontFamily:"فونٹ فیملی",fontSize:"فونٹ سائز",lineHeight:"لائن کی اونچائی",fontColor:"فونٹ رنگ",highlightColor:"ہائی لائٹ رنگ",backgroundColor:"پس منظر رنگ",bold:"بولڈ",italic:"ترچھا",underline:"خط کشیدہ",strikethrough:"کٹا ہوا",code:"کوڈ",clearFormatting:"فارمیٹنگ صاف کریں",normal:"عام",heading:e=>`سرخی ${e}`,bulletList:"بلٹ فہرست",orderedList:"نمبر شدہ فہرست",checkList:"چیک فہرست",indent:"اندر کریں",outdent:"باہر کریں",blockquote:"اقتباس",codeBlock:"کوڈ بلاک",horizontalRule:"افقی لکیر",insertTable:"ٹیبل داخل کریں",link:"لنک",undo:"واپس",redo:"دوبارہ",cut:"کاٹیں",copy:"نقل",paste:"چسپاں",defaultOption:"پہلے سے طے شدہ",slashCommands:"سلیش کمانڈز",noCommandsFound:"کوئی کمانڈ نہیں ملی",changeBlockType:"بلاک کی قسم تبدیل کریں",blockTypes:"بلاک کی اقسام",enterUrl:"URL درج کریں:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},dataTable:{sortAscending:"صعودی ترتیب",sortDescending:"نزولی ترتیب",clearSort:"ترتیب صاف کریں",filterPlaceholder:"فلٹر...",clearFilter:"فلٹر صاف کریں",selectAll:"سب منتخب کریں",deselectAll:"سب غیر منتخب کریں",selectedCount:e=>`${e} منتخب`,resetAll:"سب ری سیٹ کریں",noResults:"کوئی نتائج نہیں ملے",loading:"لوڈ ہو رہا ہے...",filterPanelAddCondition:"شرط شامل کریں",filterPanelApply:"لاگو کریں",filterPanelClear:"فلٹرز صاف کریں",filterPanelAnd:"اور",filterPanelOr:"یا",filterPanelContains:"شامل ہے",filterPanelNotContains:"شامل نہیں ہے",filterPanelEquals:"برابر ہے",filterPanelNotEquals:"برابر نہیں ہے",filterPanelStartsWith:"سے شروع ہوتا ہے",filterPanelEndsWith:"پر ختم ہوتا ہے",filterPanelIsNull:"خالی ہے",filterPanelIsNotNull:"خالی نہیں ہے",filterPanelGt:"سے بڑا",filterPanelGte:"سے بڑا یا برابر",filterPanelLt:"سے چھوٹا",filterPanelLte:"سے چھوٹا یا برابر",filterPanelBetween:"کے درمیان",filterPanelValuePlaceholder:"قدر...",sortMultiHint:"متعدد کالموں کو ترتیب دینے کے لیے Shift دبائیں",columnVisibility:"کالم",showAllColumns:"سب دکھائیں",menuSortAsc:"صعودی ترتیب",menuSortDesc:"نزولی ترتیب",menuClearSort:"ترتیب ہٹائیں",menuHideColumn:"کالم چھپائیں",menuChooseColumns:"کالم منتخب کریں",menuResetColumns:"کالم ری سیٹ کریں",menuFilter:"فلٹر",rowCount:(e,t)=>`قطاریں: ${e} کل قطاریں: ${t}`,filterTagsPlaceholder:"قدریں منتخب کریں...",groupCount:e=>`${e} آئٹم`,collapseGroup:"گروپ سکیڑیں",expandGroup:"گروپ پھیلائیں",describeFilter:{textContains:(e,t)=>`${e} "${t}" پر مشتمل`,textNotContains:(e,t)=>`${e} "${t}" پر مشتمل نہیں`,textEquals:(e,t)=>`${e} "${t}" کے برابر`,textNotEquals:(e,t)=>`${e} "${t}" کے برابر نہیں`,textStartsWith:(e,t)=>`${e} "${t}" سے شروع ہوتا ہے`,textEndsWith:(e,t)=>`${e} "${t}" پر ختم ہوتا ہے`,compareEq:(e,t)=>`${e} = ${t}`,compareNeq:(e,t)=>`${e} ≠ ${t}`,compareGt:(e,t)=>`${e} > ${t}`,compareGte:(e,t)=>`${e} ≥ ${t}`,compareLt:(e,t)=>`${e} < ${t}`,compareLte:(e,t)=>`${e} ≤ ${t}`,rangeBetween:(e,t,l)=>`${e} ${t} اور ${l} کے درمیان`,rangeGte:(e,t)=>`${e} ≥ ${t}`,rangeLte:(e,t)=>`${e} ≤ ${t}`,setIn:(e,t)=>`${e} [${t}] میں`,setNotIn:(e,t)=>`${e} [${t}] میں نہیں`,booleanIs:(e,t)=>`${e} ${t} ہے`,isNull:e=>`${e} خالی ہے`,isNotNull:e=>`${e} خالی نہیں ہے`,compositeAnd:e=>e.join(" اور "),compositeOr:e=>e.join(" یا ")}},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,t)=>`Page ${e} is out of range (1-${t})`,renderFailed:"Failed to render PDF page"}};exports.default=r;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("@tempots/dom"),_=require("./translations-BDGa_4jx.cjs"),B=require("./input-container-BZwpJgx6.cjs"),j=require("./stack-dwLevGa2.cjs"),T=require("./session-id-B5lJMzbB.cjs"),p=require("@tempots/std"),P=e.html.span(e.attr.class("bc-input-wrapper__required")," *");function G(n){const t=["bc-input-wrapper"];return n!=="vertical"&&t.push(`bc-input-wrapper--${n}`),t.join(" ")}function J(n,t){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):t?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Q(n,t){if(n==="horizontal-fixed"&&t!=null)return`--input-wrapper-label-width: ${t}`}const O=({fullWidth:n=!1,required:t,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:m,labelWidth:g},...v)=>{const f=d??a!=null,h=u??!1,y=m??"vertical",w=T.sessionId("input-wrapper"),D=l?`${w}-description`:void 0,I=a!=null?`${w}-error`:void 0,A=e.computedOf(y)(b=>b!=="vertical"),K=e.computedOf(y,g??void 0)((b,C)=>Q(b,C));return e.html.div(e.attr.class(e.Value.map(y,b=>G(b))),e.attr.class(e.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),e.attr.style(K),s!=null||r!=null?e.html.div(e.attr.class("bc-input-wrapper__header"),e.html.div(e.attr.class("bc-input-wrapper__label-section"),e.html.label(e.attr.class("bc-input-wrapper__label"),c!=null?e.attr.for(c):e.Empty,e.html.span(e.attr.class(e.computedOf(f,h)((b,C)=>J(b??!1,C??!1))),s),s!=null&&t?P:e.Empty),e.When(e.computedOf(A,l)((b,C)=>b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),e.attr.id(D),l))),r!=null?j.Label(r):e.Empty,i):e.Empty,e.html.div(e.attr.class("bc-input-wrapper__content"),[D,I].filter(Boolean).length>0?e.dataAttr("describedby",[D,I].filter(Boolean).join(" ")):e.Empty,t?e.dataAttr("required","true"):e.Empty,e.When(f,()=>e.dataAttr("invalid","true")),o),e.When(e.computedOf(A,l)((b,C)=>!b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description"),e.attr.id(D),l)),e.When(f,()=>e.html.div(e.attr.class("bc-input-wrapper__error"),e.attr.id(I),e.aria.live("polite"),e.attr.role("alert"),a)),...v)};function X({size:n="sm",icon:t="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return e.Use(_.BeatUII18n,c=>{const d=e.coalesce(o,c.$.closeModal);return B.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},e.attr.title(d),e.aria.label(d),...a,_.Icon({icon:t,size:n??"sm"}))})}const Y=n=>{const{value:t,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,activeIcon:c,inactiveIcon:d,size:u="md"}=n,m=a??T.sessionId("checkbox"),g=`${m}-label`,v=()=>{if(e.Value.get(o??!1))return;const h=e.Value.get(t);i?.(!h),r?.(!h)},f=h=>{e.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),v())};return B.InputContainer({baseContainer:!0,growInput:!1,...n,input:e.html.span(e.attr.class("bc-checkbox-input"),e.html.span(e.attr.class("bc-checkbox-input__checkbox"),e.attr.class(e.Value.map(t,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),e.attr.class(e.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),e.attr.id(m),e.attr.role("checkbox"),e.attr.tabindex(e.Value.map(o??!1,h=>h?-1:0)),e.aria.checked(t),e.aria.disabled(o),l!=null?e.aria.labelledby(g):e.Empty,e.on.keydown(f),s!=null?e.on.blur(s):e.Empty,_.Icon({icon:e.computedOf(t,c,d)((h,y,w)=>h?y??"ri:checkbox-fill":w??"mdi:checkbox-blank-outline"),accessibility:"decorative",size:u})),l!=null?e.html.label(e.attr.class("bc-checkbox-input__label"),e.attr.id(g),e.attr.for(m),j.MutedLabel(l)):e.Empty)},e.on.click(v))},q=((n,t)=>()=>{n.markTouched(),t?.()}),E=(n,t)=>s=>{n.change(s),t?.(s)};function M(n,t){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=t;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?E(s,r):void 0,onChange:o!=="input"?E(s,r):void 0,onBlur:q(s,i)})}function Z(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control"),o=s??l;return O({...i,hasError:i.controller.errorVisible,error:e.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:M(a=>n({...a,id:l}),i)},...r)}function H(n,t){const{toInput:s,fromInput:i,controller:r,...l}=t,o=r.transform(s,i);return M(n,{...l,controller:o})}function tt(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control");return O({...i,labelFor:s??l,content:H(n,{...i,id:l})},...r)}function et(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function F(n){return typeof n=="number"?`[${n}]`:`.${n}`}function $(n){if(n.length===0)return"";const[t,...s]=n;return[typeof t=="number"?`[${t}]`:t,...s.map(F)].join("")}const st={valid:p.Validation.valid,invalid(n){return p.Validation.invalid({message:n})},invalidFields(n){const t={};for(const[s,i]of Object.entries(n))t[s]=typeof i=="string"?{message:i}:i;return p.Validation.invalid({dependencies:t})},fromError(n){return p.Validation.invalid(n)}};function V(n){return function(s){if(s.type==="valid")return s;let i=s.error;for(const r of n)if(i=i?.dependencies?.[r],i==null)return p.Validation.valid;return p.Validation.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#t={disabled:e.prop(!1),touched:e.prop(!1)};#s;#e=e.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(t,s,i,r,l,o=p.strictEqual){this.path=t,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#e.set(i.value),this.error=r.map(a=>a?.type==="invalid"?a.error?.message:void 0),this.hasError=this.error.map(a=>a!=null),this.touched=this.#t.touched,l.validationMode?this.errorVisible=e.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=e.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=e.computedOf(this.signal,this.#e)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=e.computedOf(this.#t.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=e.computedOf(this.disabled,this.hasError)((a,c)=>a||c),this.onDispose(()=>{this.#t.disabled.dispose(),this.#t.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#e.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return $(this.path)}onDispose=t=>{this.#n.push(t)};dispose=()=>{for(const t of this.#n)try{t()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=t=>{this.#t.disabled.set(t)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#t.touched.set(!0)};resetTouched=()=>{this.#t.touched.set(!1)};markPristine=()=>{this.#e.set(this.signal.value)};reset=()=>{this.change(this.#e.value)};array=(t=p.strictEqual)=>new N(this.path,this.change,this.signal,this.status,this.parent,t);object=(t=p.strictEqual)=>new W(this.path,this.change,this.signal,this.status,this.parent,t);transform=(t,s,i=[],r=p.strictEqual)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(t,r),this.status.map(V(i)),this.parent,r);asyncTransform=(t,s,i,r=[],l=p.strictEqual)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(t,i,void 0,l),this.status.map(V(r)),this.parent,l)}class W extends k{#t=new Map;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){super(t,s,i.map(c=>c??{},o),r,l,o),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const a=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const c of this.#t.values())c.dispose();this.#t.clear();for(const c of this.#e.values())c();this.#e.clear(),this.#s.clear(),this.#n.dispose();for(const c of this.#i.values())c();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),a()})}field=t=>{if(this.#t.has(t))return this.#t.get(t);const s=async o=>{this.change({...this.signal.value,[t]:o})},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t.set(t,i);const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};markAllTouched=()=>{this.markTouched();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markTouched();for(const s of this.#t.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markPristine?.();for(const s of this.#t.values())s.markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}class N extends k{#t=new Array;length;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){const a=i.map(u=>u??[],o);super(t,s,a,r,l,o);const c=a.on(u=>{const m=this.#t.length-u.length;m>0&&(this.#t.splice(u.length,m).forEach((g,v)=>{const f=u.length+v;g.dispose(),this.#e.get(f)?.(),this.#e.delete(f),this.#s.delete(f),this.#i.get(f)?.(),this.#i.delete(f),this.#r.delete(f)}),this.#l(),this.#a())});this.length=a.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const d=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const u of this.#t)u.dispose();this.length.dispose(),this.#t.length=0,c(),a.dispose();for(const u of this.#e.values())u();this.#e.clear(),this.#s.clear(),this.#n.dispose();for(const u of this.#i.values())u();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),d()})}item=t=>{if(this.#t[t])return this.#t[t];const s=async o=>{const a=this.signal.value.slice();a[t]=o,this.change(a)},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t[t]=i;const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};push=(...t)=>{this.change([...this.signal.value,...t])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...t)=>{this.change([...t,...this.signal.value])};removeAt=t=>{this.splice(t,1)};splice=(t,s)=>{const i=this.signal.value.slice();i.splice(t,s),this.change(i)};move=(t,s,i=1)=>{if(i<1||t===s)return;const r=this.signal.value.slice(),l=r.splice(t,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}function z(n){function t(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?t(s.key):t(s))}function L(n){const t=n.filter(r=>r.path==null||r.path.length===0).map(r=>r.message),s=n.filter(r=>r.path!=null&&r.path.length>0).reduce((r,l)=>{const o=z(l.path),a=o.pop();let c=r;for(const d of o)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[a]={message:l.message},r},{}),i=t.join(`
|
|
1
|
+
"use strict";const e=require("@tempots/dom"),_=require("./translations-qefRsdGi.cjs"),B=require("./input-container-BkPcNDaZ.cjs"),j=require("./stack-dwLevGa2.cjs"),T=require("./session-id-B5lJMzbB.cjs"),p=require("@tempots/std"),P=e.html.span(e.attr.class("bc-input-wrapper__required")," *");function G(n){const t=["bc-input-wrapper"];return n!=="vertical"&&t.push(`bc-input-wrapper--${n}`),t.join(" ")}function J(n,t){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):t?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Q(n,t){if(n==="horizontal-fixed"&&t!=null)return`--input-wrapper-label-width: ${t}`}const O=({fullWidth:n=!1,required:t,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:m,labelWidth:g},...v)=>{const f=d??a!=null,h=u??!1,y=m??"vertical",w=T.sessionId("input-wrapper"),D=l?`${w}-description`:void 0,I=a!=null?`${w}-error`:void 0,A=e.computedOf(y)(b=>b!=="vertical"),K=e.computedOf(y,g??void 0)((b,C)=>Q(b,C));return e.html.div(e.attr.class(e.Value.map(y,b=>G(b))),e.attr.class(e.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),e.attr.style(K),s!=null||r!=null?e.html.div(e.attr.class("bc-input-wrapper__header"),e.html.div(e.attr.class("bc-input-wrapper__label-section"),e.html.label(e.attr.class("bc-input-wrapper__label"),c!=null?e.attr.for(c):e.Empty,e.html.span(e.attr.class(e.computedOf(f,h)((b,C)=>J(b??!1,C??!1))),s),s!=null&&t?P:e.Empty),e.When(e.computedOf(A,l)((b,C)=>b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),e.attr.id(D),l))),r!=null?j.Label(r):e.Empty,i):e.Empty,e.html.div(e.attr.class("bc-input-wrapper__content"),[D,I].filter(Boolean).length>0?e.dataAttr("describedby",[D,I].filter(Boolean).join(" ")):e.Empty,t?e.dataAttr("required","true"):e.Empty,e.When(f,()=>e.dataAttr("invalid","true")),o),e.When(e.computedOf(A,l)((b,C)=>!b&&C!=null),()=>e.html.div(e.attr.class("bc-input-wrapper__description"),e.attr.id(D),l)),e.When(f,()=>e.html.div(e.attr.class("bc-input-wrapper__error"),e.attr.id(I),e.aria.live("polite"),e.attr.role("alert"),a)),...v)};function X({size:n="sm",icon:t="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return e.Use(_.BeatUII18n,c=>{const d=e.coalesce(o,c.$.closeModal);return B.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},e.attr.title(d),e.aria.label(d),...a,_.Icon({icon:t,size:n??"sm"}))})}const Y=n=>{const{value:t,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,activeIcon:c,inactiveIcon:d,size:u="md"}=n,m=a??T.sessionId("checkbox"),g=`${m}-label`,v=()=>{if(e.Value.get(o??!1))return;const h=e.Value.get(t);i?.(!h),r?.(!h)},f=h=>{e.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),v())};return B.InputContainer({baseContainer:!0,growInput:!1,...n,input:e.html.span(e.attr.class("bc-checkbox-input"),e.html.span(e.attr.class("bc-checkbox-input__checkbox"),e.attr.class(e.Value.map(t,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),e.attr.class(e.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),e.attr.id(m),e.attr.role("checkbox"),e.attr.tabindex(e.Value.map(o??!1,h=>h?-1:0)),e.aria.checked(t),e.aria.disabled(o),l!=null?e.aria.labelledby(g):e.Empty,e.on.keydown(f),s!=null?e.on.blur(s):e.Empty,_.Icon({icon:e.computedOf(t,c,d)((h,y,w)=>h?y??"ri:checkbox-fill":w??"mdi:checkbox-blank-outline"),accessibility:"decorative",size:u})),l!=null?e.html.label(e.attr.class("bc-checkbox-input__label"),e.attr.id(g),e.attr.for(m),j.MutedLabel(l)):e.Empty)},e.on.click(v))},q=((n,t)=>()=>{n.markTouched(),t?.()}),E=(n,t)=>s=>{n.change(s),t?.(s)};function M(n,t){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=t;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?E(s,r):void 0,onChange:o!=="input"?E(s,r):void 0,onBlur:q(s,i)})}function Z(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control"),o=s??l;return O({...i,hasError:i.controller.errorVisible,error:e.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:M(a=>n({...a,id:l}),i)},...r)}function H(n,t){const{toInput:s,fromInput:i,controller:r,...l}=t,o=r.transform(s,i);return M(n,{...l,controller:o})}function tt(n,{id:t,labelFor:s,...i},...r){const l=t??i.controller.name??T.sessionId("control");return O({...i,labelFor:s??l,content:H(n,{...i,id:l})},...r)}function et(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function F(n){return typeof n=="number"?`[${n}]`:`.${n}`}function $(n){if(n.length===0)return"";const[t,...s]=n;return[typeof t=="number"?`[${t}]`:t,...s.map(F)].join("")}const st={valid:p.Validation.valid,invalid(n){return p.Validation.invalid({message:n})},invalidFields(n){const t={};for(const[s,i]of Object.entries(n))t[s]=typeof i=="string"?{message:i}:i;return p.Validation.invalid({dependencies:t})},fromError(n){return p.Validation.invalid(n)}};function V(n){return function(s){if(s.type==="valid")return s;let i=s.error;for(const r of n)if(i=i?.dependencies?.[r],i==null)return p.Validation.valid;return p.Validation.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#t={disabled:e.prop(!1),touched:e.prop(!1)};#s;#e=e.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(t,s,i,r,l,o=p.strictEqual){this.path=t,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#e.set(i.value),this.error=r.map(a=>a?.type==="invalid"?a.error?.message:void 0),this.hasError=this.error.map(a=>a!=null),this.touched=this.#t.touched,l.validationMode?this.errorVisible=e.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=e.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=e.computedOf(this.signal,this.#e)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=e.computedOf(this.#t.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=e.computedOf(this.disabled,this.hasError)((a,c)=>a||c),this.onDispose(()=>{this.#t.disabled.dispose(),this.#t.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#e.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return $(this.path)}onDispose=t=>{this.#n.push(t)};dispose=()=>{for(const t of this.#n)try{t()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=t=>{this.#t.disabled.set(t)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#t.touched.set(!0)};resetTouched=()=>{this.#t.touched.set(!1)};markPristine=()=>{this.#e.set(this.signal.value)};reset=()=>{this.change(this.#e.value)};array=(t=p.strictEqual)=>new N(this.path,this.change,this.signal,this.status,this.parent,t);object=(t=p.strictEqual)=>new W(this.path,this.change,this.signal,this.status,this.parent,t);transform=(t,s,i=[],r=p.strictEqual)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(t,r),this.status.map(V(i)),this.parent,r);asyncTransform=(t,s,i,r=[],l=p.strictEqual)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(t,i,void 0,l),this.status.map(V(r)),this.parent,l)}class W extends k{#t=new Map;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){super(t,s,i.map(c=>c??{},o),r,l,o),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const a=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const c of this.#t.values())c.dispose();this.#t.clear();for(const c of this.#e.values())c();this.#e.clear(),this.#s.clear(),this.#n.dispose();for(const c of this.#i.values())c();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),a()})}field=t=>{if(this.#t.has(t))return this.#t.get(t);const s=async o=>{this.change({...this.signal.value,[t]:o})},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t.set(t,i);const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};markAllTouched=()=>{this.markTouched();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markTouched();for(const s of this.#t.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value;for(const s of Object.keys(t))this.field(s).markPristine?.();for(const s of this.#t.values())s.markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}class N extends k{#t=new Array;length;#s=new Map;#e=new Map;#n=e.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=e.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let t=!1;for(const s of this.#s.values())if(s){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,s,i,r,l,o){const a=i.map(u=>u??[],o);super(t,s,a,r,l,o);const c=a.on(u=>{const m=this.#t.length-u.length;m>0&&(this.#t.splice(u.length,m).forEach((g,v)=>{const f=u.length+v;g.dispose(),this.#e.get(f)?.(),this.#e.delete(f),this.#s.delete(f),this.#i.get(f)?.(),this.#i.delete(f),this.#r.delete(f)}),this.#l(),this.#a())});this.length=a.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const d=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const u of this.#t)u.dispose();this.length.dispose(),this.#t.length=0,c(),a.dispose();for(const u of this.#e.values())u();this.#e.clear(),this.#s.clear(),this.#n.dispose();for(const u of this.#i.values())u();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),d()})}item=t=>{if(this.#t[t])return this.#t[t];const s=async o=>{const a=this.signal.value.slice();a[t]=o,this.change(a)},i=new k([...this.path,t],s,this.signal.map(o=>o[t]),this.status.map(V([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#t[t]=i;const r=i.touched.on(o=>{this.#s.set(t,o),this.#l()});this.#e.set(t,r);const l=i.dirty.on(o=>{this.#r.set(t,o),this.#a()});return this.#i.set(t,l),i};push=(...t)=>{this.change([...this.signal.value,...t])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...t)=>{this.change([...t,...this.signal.value])};removeAt=t=>{this.splice(t,1)};splice=(t,s)=>{const i=this.signal.value.slice();i.splice(t,s),this.change(i)};move=(t,s,i=1)=>{if(i<1||t===s)return;const r=this.signal.value.slice(),l=r.splice(t,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const t=this.signal.value.length;for(let s=0;s<t;s++)this.item(s).markPristine?.()};#a=()=>{let t=!1;for(const s of this.#r.values())if(s){t=!0;break}this.#o.set(this.dirty.value||t)}}function z(n){function t(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?t(s.key):t(s))}function L(n){const t=n.filter(r=>r.path==null||r.path.length===0).map(r=>r.message),s=n.filter(r=>r.path!=null&&r.path.length>0).reduce((r,l)=>{const o=z(l.path),a=o.pop();let c=r;for(const d of o)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[a]={message:l.message},r},{}),i=t.join(`
|
|
2
2
|
`);return{...s,message:i!=""?i:void 0}}function R({initialValue:n,onChange:t,validate:s,equals:i,validationMode:r,validateDebounceMs:l}){const o=e.Value.deriveProp(n),a=e.prop(p.Validation.valid),c=e.prop(!1),d=e.prop(r??"onTouched"),u=h=>{a.set(h)};let m;const g=async h=>{if(s!=null){const y=await s(h);u(y)}},v=async h=>{o.set(h),t?.(h);const y=d.value;if(s!=null){if(y==="onSubmit")return;const w=l??0;w>0?(m&&clearTimeout(m),m=setTimeout(()=>{g(h)},w)):await g(h)}},f=new k([],v,o,a,{disabled:c,validationMode:d},i??p.strictEqual);return f.onDispose(()=>{c.dispose(),o.dispose(),a.dispose(),d.dispose(),m&&clearTimeout(m)}),{controller:f,setStatus:u}}function x(n){return e.Fragment(e.attr.disabled(n.disabled),e.attr.name(n.name))}function nt(n,{triggerOn:t="change"}={}){return e.Fragment(x(n),e.attr.value(n.signal),(t==="input"?e.on.input:e.on.change)(e.emitValue(n.change)))}function it(n,{triggerOn:t="change"}={}){return e.Fragment(x(n),e.attr.valueAsNumber(n.signal),(t==="input"?e.on.input:e.on.change)(e.emitValueAsNumber(n.change)))}function S(n){return n.issues!=null?p.Validation.invalid(L(n.issues)):p.Validation.valid}async function rt({task:n,errorMessage:t,errorPath:s=["root"],validation:i}){try{const r=await n();return i!=null?i(r):p.Validation.valid}catch(r){const l=t??(r instanceof Error?r.message:"Operation failed");return s.length===1&&s[0]==="root"?p.Validation.invalid({message:l}):p.Validation.invalid({dependencies:U(s,l)})}}function U(n,t){if(n.length===1)return{[n[0]]:{message:t}};const[s,...i]=n;return{[s]:{dependencies:U(i,t)}}}function at({initialValue:n={},schema:t,onSubmit:s=async()=>p.Validation.valid,validationMode:i,validateDebounceMs:r}){const{controller:l,setStatus:o}=R({initialValue:n,validationMode:i??"onTouched",validateDebounceMs:r,validate:(i??"onTouched")==="onSubmit"||t==null?void 0:async u=>S(await t["~standard"].validate(u))}),a=e.prop(!1),c=l.object();return c.onDispose(()=>a.dispose()),{controller:c,setStatus:o,submit:async u=>{if(a.set(!0),u?.preventDefault(),c.markAllTouched(),t!=null){const g=c.signal.value,v=S(await t["~standard"].validate(g));if(o(v),v.type==="invalid"){a.set(!1);return}}const m=await s(c.signal.value);a.set(!1),m.type==="invalid"&&o(m)},submitting:a}}exports.ArrayController=N;exports.BaseControl=M;exports.BaseMappedControl=H;exports.CheckboxInput=Y;exports.CloseButton=X;exports.Control=Z;exports.Controller=k;exports.ControllerValidation=st;exports.InputWrapper=O;exports.MappedControl=tt;exports.ObjectController=W;exports.RequiredSymbol=P;exports.connectCommonAttributes=x;exports.connectNumberInput=it;exports.connectStringInput=nt;exports.convertStandardSchemaIssues=L;exports.convertStandardSchemaPathToPath=z;exports.makeMapValidation=V;exports.makeOnBlurHandler=q;exports.makeOnChangeHandler=E;exports.parsePath=et;exports.pathToString=$;exports.standardSchemaResultToValidation=S;exports.taskToValidation=rt;exports.useController=R;exports.useForm=at;exports.wrapSegment=F;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computedOf as k, html as m, attr as c, Value as C, Empty as T, When as A, dataAttr as P, aria as x, Use as q, coalesce as G, on as E, TextNode as J, prop as w, Fragment as $, emitValueAsNumber as Q, emitValue as X } from "@tempots/dom";
|
|
2
|
-
import { B as Y, I as L } from "./translations-
|
|
3
|
-
import { B as Z, I as ee } from "./input-container-
|
|
2
|
+
import { B as Y, I as L } from "./translations-DT5QQ4WO.js";
|
|
3
|
+
import { B as Z, I as ee } from "./input-container-CO3DNqpp.js";
|
|
4
4
|
import { L as te, M as se } from "./stack-BLMteGTn.js";
|
|
5
5
|
import { s as j } from "./session-id-3KiilioY.js";
|
|
6
6
|
import { Validation as g, strictEqual as V } from "@tempots/std";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-qefRsdGi.cjs"),h={loadingExtended:"Đang tải, vui lòng đợi",loadingShort:"Đang tải...",locale:"Ngôn ngữ",iconDescription:"Biểu tượng",loadingIcon:"Biểu tượng tải",failedToLoadIcon:"Không thể tải biểu tượng",editLabel:"Chỉnh sửa",selectOne:"Chọn một",selectNone:"Không có",selectMany:"Chọn nhiều",noResults:"Không có kết quả",passwordPlaceholderText:"Mật khẩu bí mật",togglePasswordVisibility:"Chuyển đổi hiển thị mật khẩu",toggleMenu:"Chuyển đổi menu",toggleAside:"Chuyển đổi bảng bên",mainNavigation:"Điều hướng chính",sidebar:"Thanh bên",closeDrawer:"Đóng ngăn kéo",closeModal:"Đóng modal",confirm:"Xác nhận",cancel:"Hủy",addLabel:"Thêm",removeItem:"Xóa mục",currentLocale:"Tiếng Việt",ar:"Tiếng Ả Rập",de:"Tiếng Đức",en:"Tiếng Anh",es:"Tiếng Tây Ban Nha",fr:"Tiếng Pháp",hi:"Tiếng Hindi",it:"Tiếng Ý",ja:"Tiếng Nhật",ko:"Tiếng Hàn",nl:"Tiếng Hà Lan",pl:"Tiếng Ba Lan",pt:"Tiếng Bồ Đào Nha",ru:"Tiếng Nga",tr:"Tiếng Thổ Nhĩ Kỳ",vi:"Tiếng Việt",zh:"Tiếng Trung",he:"Tiếng Do Thái",fa:"Tiếng Ba Tư",ur:"Tiếng Urdu",emailPlaceholderText:"Nhập email của bạn",incrementValue:"Tăng giá trị",decrementValue:"Giảm giá trị",dropZoneInstructions:n=>n?"Nhấp để chọn hoặc kéo tệp vào đây, hoặc nhấn Enter hoặc Space để mở trình chọn tệp":"Kéo tệp vào đây",fileSizeUnits:["Byte","KB","MB","GB","TB"],removeFile:"Xóa tệp",clearAllFiles:"Xóa tất cả tệp",clearValue:"Xóa giá trị",unknownType:"Loại không xác định",filesInputInstructions:(n,t,e)=>{let i=n==null||n>1?"Nhấp để chọn hoặc kéo tệp vào đây":"Nhấp để chọn hoặc kéo một tệp vào đây";if(n||t){const o=[];if(n!=null&&n>1&&o.push(`tối đa ${n} tệp`),t&&e){const l=a.formatFileSize(t,{units:e});o.push(`mỗi tệp tối đa ${l}`)}o.length>0&&(i+=` (${o.join(", ")})`)}return i},paginationLabel:"Phân trang",paginationRange:(n,t,e,i)=>i>e?`Hàng ${n} đến ${t} trong ${e} trên ${i}`:`Hàng ${n} đến ${t} trong ${e}`,firstPage:"Trang đầu",previousPage:"Trang trước",nextPage:"Trang tiếp",lastPage:"Trang cuối",breadcrumbs:"Thanh điều hướng",commandPalette:"Bảng lệnh",typeACommand:"Nhập lệnh...",noResultsFound:"Không tìm thấy kết quả",noMatchingCommands:"Không có lệnh phù hợp",appearanceSystem:"Hệ thống",appearanceLight:"Sáng",appearanceDark:"Tối",ok:"OK",changeTypeConfirmation:"Thay đổi loại sẽ xóa giá trị hiện tại. Tiếp tục?",notifications:"Thông báo",markAllAsRead:"Đánh dấu tất cả đã đọc",noNotifications:"Không có thông báo",schemaConflictsDetected:"Phát hiện xung đột lược đồ",schemaViolationsDetected:"Phát hiện vi phạm lược đồ",properties:"Thuộc tính",uploading:"Đang tải lên...",dropFilesOrBrowse:"Kéo thả tệp vào đây hoặc nhấp để duyệt",acceptedTypes:n=>`Loại tệp được chấp nhận: ${n}`,enterUrlPrompt:"Nhập URL:",exceeded:"(vượt quá)",pdfPreview:"Xem trước PDF",lexical:{fontFamily:"Phông chữ",fontSize:"Cỡ chữ",lineHeight:"Chiều cao dòng",fontColor:"Màu chữ",highlightColor:"Màu đánh dấu",backgroundColor:"Màu nền",bold:"Đậm",italic:"Nghiêng",underline:"Gạch chân",strikethrough:"Gạch ngang",code:"Mã",clearFormatting:"Xóa định dạng",normal:"Bình thường",heading:n=>`Tiêu đề ${n}`,bulletList:"Danh sách dấu đầu dòng",orderedList:"Danh sách đánh số",checkList:"Danh sách kiểm tra",indent:"Thụt lề",outdent:"Giảm thụt lề",blockquote:"Trích dẫn",codeBlock:"Khối mã",horizontalRule:"Đường kẻ ngang",insertTable:"Chèn bảng",link:"Liên kết",undo:"Hoàn tác",redo:"Làm lại",cut:"Cắt",copy:"Sao chép",paste:"Dán",defaultOption:"Mặc định",slashCommands:"Lệnh gạch chéo",noCommandsFound:"Không tìm thấy lệnh",changeBlockType:"Đổi loại khối",blockTypes:"Loại khối",enterUrl:"Nhập URL:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},dataTable:{sortAscending:"Sắp xếp tăng dần",sortDescending:"Sắp xếp giảm dần",clearSort:"Xóa sắp xếp",filterPlaceholder:"Lọc...",clearFilter:"Xóa bộ lọc",selectAll:"Chọn tất cả",deselectAll:"Bỏ chọn tất cả",selectedCount:n=>`${n} đã chọn`,resetAll:"Đặt lại tất cả",noResults:"Không tìm thấy kết quả",loading:"Đang tải...",filterPanelAddCondition:"Thêm điều kiện",filterPanelApply:"Áp dụng",filterPanelClear:"Xóa bộ lọc",filterPanelAnd:"VÀ",filterPanelOr:"HOẶC",filterPanelContains:"Chứa",filterPanelNotContains:"Không chứa",filterPanelEquals:"Bằng",filterPanelNotEquals:"Không bằng",filterPanelStartsWith:"Bắt đầu với",filterPanelEndsWith:"Kết thúc với",filterPanelIsNull:"Trống",filterPanelIsNotNull:"Không trống",filterPanelGt:"Lớn hơn",filterPanelGte:"Lớn hơn hoặc bằng",filterPanelLt:"Nhỏ hơn",filterPanelLte:"Nhỏ hơn hoặc bằng",filterPanelBetween:"Trong khoảng",filterPanelValuePlaceholder:"Giá trị...",sortMultiHint:"Giữ Shift để sắp xếp nhiều cột",columnVisibility:"Cột",showAllColumns:"Hiển thị tất cả",menuSortAsc:"Sắp xếp tăng dần",menuSortDesc:"Sắp xếp giảm dần",menuClearSort:"Xóa sắp xếp",menuHideColumn:"Ẩn cột",menuChooseColumns:"Chọn cột",menuResetColumns:"Đặt lại cột",menuFilter:"Lọc",rowCount:(n,t)=>`Hàng: ${n} Tổng hàng: ${t}`,filterTagsPlaceholder:"Chọn giá trị...",groupCount:n=>`${n} mục`,collapseGroup:"Thu gọn nhóm",expandGroup:"Mở rộng nhóm",describeFilter:{textContains:(n,t)=>`${n} chứa "${t}"`,textNotContains:(n,t)=>`${n} không chứa "${t}"`,textEquals:(n,t)=>`${n} bằng "${t}"`,textNotEquals:(n,t)=>`${n} không bằng "${t}"`,textStartsWith:(n,t)=>`${n} bắt đầu bằng "${t}"`,textEndsWith:(n,t)=>`${n} kết thúc bằng "${t}"`,compareEq:(n,t)=>`${n} = ${t}`,compareNeq:(n,t)=>`${n} ≠ ${t}`,compareGt:(n,t)=>`${n} > ${t}`,compareGte:(n,t)=>`${n} ≥ ${t}`,compareLt:(n,t)=>`${n} < ${t}`,compareLte:(n,t)=>`${n} ≤ ${t}`,rangeBetween:(n,t,e)=>`${n} giữa ${t} và ${e}`,rangeGte:(n,t)=>`${n} ≥ ${t}`,rangeLte:(n,t)=>`${n} ≤ ${t}`,setIn:(n,t)=>`${n} trong [${t}]`,setNotIn:(n,t)=>`${n} không trong [${t}]`,booleanIs:(n,t)=>`${n} là ${t}`,isNull:n=>`${n} trống`,isNotNull:n=>`${n} không trống`,compositeAnd:n=>n.join(" VÀ "),compositeOr:n=>n.join(" HOẶC ")}},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:n=>`Heading ${n}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Đang tải PDF...",loadFailed:"Không thể tải PDF",invalidPdf:"Tệp PDF không hợp lệ",pageOutOfRange:(n,t)=>`Trang ${n} nằm ngoài phạm vi (1-${t})`,renderFailed:"Không thể hiển thị trang PDF"}};exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),k=require("./deep-merge-DEEd-Tte.cjs"),mt=require("@tempots/std"),B=require("./input-container-BZwpJgx6.cjs"),N=require("./text-input-CynkbBpH.cjs"),v=require("./translations-BDGa_4jx.cjs"),ft=require("@tempots/ui"),Q=require("./notice-dOOD80F7.cjs"),bt=require("./session-id-B5lJMzbB.cjs"),yt=require("./utils-DmEuG3Np.cjs");function Y(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function Z(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function J(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function tt(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function wt(e){return Y(e)||Z(e)||J(e)||tt(e)}function et(e){if(!Y(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function q(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function D(e){const n=et(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function It(e,n){const s=D(e),a=D(n);if(!s||!a)return null;const o=(u,p,d)=>{const[b,g,h]=[u,p,d].map(y=>(y=y/255,y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)));return .2126*b+.7152*g+.0722*h},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function nt(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),d=parseInt(u.slice(2,4),16),b=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,d,b,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,d,b,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16);return[p,d,b,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),d=parseFloat(r[3]),b=r[4]!=null?parseFloat(r[4]):1,[g,h,y]=G(u,p/100,d/100);return[g,h,y,b]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,b=l[4]!=null?parseFloat(l[4]):1,[g,h,y]=st(u,p,d);return[g,h,y,b]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),d=parseFloat(i[3]),b=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[h,y,M]=lt(g,p,d);return[h,y,M,b]}const c=D(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function at(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function rt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function G(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function st(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=G(e,1,.5).map(d=>d/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function z(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function ot(e,n,s){const[a]=z(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function U(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function L(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function lt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,d=c*c*c,b=4.0767416621*u-3.3077115913*p+.2309699292*d,g=-1.2684380046*u+2.6097574011*p-.3413193965*d,h=-.0041960863*u-.7034186147*p+1.707614701*d;return[L(b),L(g),L(h)]}function it(e,n,s){const a=U(e),o=U(n),r=U(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),d=Math.cbrt(c),b=.2104542553*u+.793617785*p-.0040720468*d,g=1.9779984951*u-2.428592205*p+.4505937099*d,h=.0259040371*u+.7827717662*p-.808675766*d,y=Math.sqrt(g*g+h*h);let M=Math.atan2(h,g)*180/Math.PI;return M<0&&(M+=360),[b,y,M]}function R(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return q(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=z(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=z(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=ot(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=it(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),d=(Math.round(c*10)/10).toFixed(1),b=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${d} / ${b})`:`oklch(${u} ${p} ${d})`}}}function E(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function ct(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function Vt(e){return Promise.all(e.map(ct))}function xt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Mt(e){const n=mt.decodeBase64(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function ut(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((d,b)=>{const g=r.get(d),h=Mt(d??""),y=g?.type||xt(h),M=g?.name??`file-${b}`,_=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),w=new Blob([_],{type:y});return new File([w],M,{type:y})})),i=p=>d=>{p&&Vt(d).then(b=>{for(const[g,h]of b.entries())r.set(h,{name:d[g].name,type:d[g].type});p(b)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function $t(e){const{value:n,onInput:s,onChange:a,...o}=e;return ut({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function _t(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=rt(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const h=g/i*Math.PI*2,y=n*(1+(l()*2-1)*c),M=Math.cos(h)*y,_=Math.sin(h)*y;u.push({x:M,y:_})}const p=(u[0].x+u[i-1].x)/2,d=(u[0].y+u[i-1].y)/2;let b=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let g=0;g<i;g++){const h=u[g],y=u[(g+1)%i],M=(h.x+y.x)/2,_=(h.y+y.y)/2;b+=` Q ${h.x.toFixed(3)} ${h.y.toFixed(3)} ${M.toFixed(3)} ${_.toFixed(3)}`}return b+=" Z",b}const Ct=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,swatchSize:l,withAlpha:i}=e,c={xs:20,sm:26,md:32,lg:40,xl:52},u=l!=null?t.Value.map(l,m=>Number(m)):t.Value.map(e.size??"md",m=>c[m]??32),p=t.Value.map(n,m=>nt(m??"#000000")),d=t.Value.map(p,([m,V,$])=>[m,V,$]),b=t.Value.map(p,([,,,m])=>m),g=t.prop(t.Value.get(b)??1),h=t.Value.map(i??!1,m=>m),y=t.Value.map(e.colorTextFormat??"rgb",m=>m),M=t.computedOf(d,g,y,h)(([m,V,$],T,A,F)=>R(m,V,$,T??1,E(A,F),F)),_=t.Value.map(e.colorTextFormat??"hex",m=>m),w=t.Value.map(u,m=>`${-m/2} ${-m/2} ${m} ${m}`),f=t.computedOf(d,u)((m,V)=>_t(m,V/2)),I=t.computedOf(d,g,h)(([m,V,$],T,A)=>A||T<1?at(m,V,$,T):q(m,V,$)),C=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(h,m=>m?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(u)(m=>`width:${m+2}px;height:${m+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(w),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(I))),t.html.input(t.attr.type("color"),N.CommonInputAttributes(e),t.attr.value(t.Value.map(d,([m,V,$])=>q(m,V,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(m=>{const V=m.target.value;if(!a)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=R($,T,A,F,S,t.Value.get(h));a(X)}):t.Empty,o!=null?t.on.input(m=>{const V=m.target.value;if(!o)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=R($,T,A,F,S,t.Value.get(h));o(X)}):t.Empty)),x=t.When(h,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(g,m=>String(m??1))),t.attr.disabled(e.disabled),t.on.input(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=R($,T,A,V,F,t.Value.get(h));o?.(S)}),t.on.change(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=R($,T,A,V,F,t.Value.get(h));a?.(S)}))),{swatchSize:W,displayValue:H,withAlpha:j,colorTextFormat:K,...P}=e;return B.InputContainer({baseContainer:!0,...P,growInput:!1,input:C,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),M)),x,e.after)})},pt=e=>typeof e=="string"&&e.trim()===""?null:e,dt=e=>e??"";function O(e){return n=>{const{after:s,disabled:a}=n,o=N.mapInputOptions(n,dt,pt),r=k.NullableResetAfter(n.value,a,n.onChange??n.onInput);return e({...o,after:s!=null?t.Fragment(r,s):r})}}const Tt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ft.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(v.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),v.Icon({icon:"line-md/pencil",color:"neutral"}))))))},At=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input.date(N.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},Ft=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},kt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?Ft(u):null),c=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input["datetime-local"](N.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},Nt=O(Q.EmailInput),St=O(N.TextInput),vt=O(Q.PasswordInput),Rt=O(k.TextArea),Et=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:d=!0,ariaLabel:b})=>{const g=c??bt.sessionId("switch");function h(w,f){const I=["bc-switch",`bc-switch--size-${f}`,`bc-switch--${f}`];return d&&I.push("bc-switch--match-input"),w&&I.push("bc-switch--disabled"),I.join(" ")}function y(w){const f=w??"primary",I=new Map,C=v.backgroundValue(f,"solid","light"),x=v.backgroundValue(f,"solid","dark");return I.set("--switch-track-on-bg",C.backgroundColor),I.set("--switch-track-on-label",C.textColor),I.set("--switch-track-on-bg-dark",x.backgroundColor),I.set("--switch-track-on-label-dark",x.textColor),I.set("--switch-track-on-border-dark",v.borderColorValue(f,"dark")),Array.from(I.entries()).map(([W,H])=>`${W}: ${H}`).join("; ")}const M=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},_=w=>{t.Value.get(l)||(w.key===" "||w.key==="Enter")&&(w.preventDefault(),M())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((w,f)=>h(w??!1,f??"md"))),t.attr.style(t.computedOf(u)(w=>y(w))),t.attr.id(g),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((w,f)=>w?-1:f??0)),t.aria.checked(e),t.aria.disabled(l),b!=null?t.aria.label(b):null,t.on.click(M),t.on.keydown(_),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Dt=O(k.UuidInput),Bt="line-md:star-alt-filled",Ot="line-md:star-alt",ht=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",activeIcon:c=Bt,inactiveIcon:u=Ot,size:p="md",onBlur:d,rounding:b=1}=e,g=()=>{const f=t.Value.get(b);return f>0?f:1},h=f=>Math.min(Math.max(f,0),t.Value.get(r)),y=(f,I)=>{if(t.Value.get(o??!1))return;const x=f.currentTarget.getBoundingClientRect(),W=(f.clientX-x.left)/x.width,H=I-1+W,j=g(),K=Math.ceil(H/j)*j,P=h(K);s?.(P),a?.(P)},M=f=>{if(t.Value.get(o??!1))return;const I=g(),C=t.Value.get(n)??0;let x;switch(f.key){case"ArrowRight":case"ArrowUp":x=h(C+I);break;case"ArrowLeft":case"ArrowDown":x=h(C-I);break;case"Home":x=0;break;case"End":x=t.Value.get(r);break;default:return}f.preventDefault(),s?.(x),a?.(x)},_=t.Value.map(p,f=>`bc-icon--${f}`),w=({index:f,counter:I})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(_),t.on.click(t.emit(C=>y(C,I),{preventDefault:!0,stopPropagation:!0})),v.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(_),t.style.width(t.Value.map(n,C=>{const x=Math.floor(C);return x>f?"100%":x<f?"0%":`${(C-f)*100}%`})),v.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))));return B.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(N.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,f=>f?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,r)((f,I)=>{const C=f??0,x=I??0;return`${String(C)} / ${String(x)}`})),t.on.keydown(M),d!=null?t.on.blur(d):null,t.Repeat(r,w))})},Wt=e=>{const{after:n,disabled:s}=e,a=N.mapInputOptions(e,r=>r??0,r=>r),o=k.NullableResetAfter(e.value,s,e.onChange??e.onInput);return ht({...a,after:n!=null?t.Fragment(o,n):o})},Ht=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return B.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Pt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return B.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Ut=O(k.UrlInput);class gt{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=yt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Lt=new gt;function qt(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function zt(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function jt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Xt(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=$t;exports.Base64sInput=ut;exports.ColorSwatchInput=Ct;exports.EditableText=Tt;exports.NativeNullableDateInput=At;exports.NativeNullableDateTimeInput=kt;exports.NullableEmailInput=Nt;exports.NullablePasswordInput=vt;exports.NullableRatingInput=Wt;exports.NullableSliderInput=Pt;exports.NullableTextArea=Rt;exports.NullableTextInput=St;exports.NullableUrlInput=Ut;exports.NullableUuidInput=Dt;exports.RatingInput=ht;exports.SliderInput=Ht;exports.Switch=Et;exports.WidgetRegistry=gt;exports.createDiagnosticWidget=Xt;exports.emptyToNull=pt;exports.fileToBase64=ct;exports.forFormat=zt;exports.forTypeAndFormat=jt;exports.forXUI=qt;exports.formatColor=R;exports.getContrastRatio=It;exports.globalWidgetRegistry=Lt;exports.hexToRgb=D;exports.hslToRgb=G;exports.hwbToRgb=st;exports.isValidColor=wt;exports.isValidHexColor=Y;exports.isValidHslColor=tt;exports.isValidRgbColor=Z;exports.isValidRgbaColor=J;exports.linearToSrgb=L;exports.mulberry32=rt;exports.normalizeHexColor=et;exports.nullToEmpty=dt;exports.oklchToRgb=lt;exports.parseAnyColor=nt;exports.resolveEffectiveFormat=E;exports.rgbToHex=q;exports.rgbToHsl=z;exports.rgbToHwb=ot;exports.rgbToOklch=it;exports.srgbToLinear=U;exports.toRgbaString=at;
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),k=require("./deep-merge-Bjv1NvKj.cjs"),mt=require("@tempots/std"),B=require("./input-container-BkPcNDaZ.cjs"),N=require("./text-input-D_IxFd0M.cjs"),R=require("./translations-qefRsdGi.cjs"),ft=require("@tempots/ui"),Q=require("./notice-Q0A1gIho.cjs"),bt=require("./session-id-B5lJMzbB.cjs"),yt=require("./utils-DmEuG3Np.cjs");function Y(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function Z(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function J(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function tt(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function wt(e){return Y(e)||Z(e)||J(e)||tt(e)}function et(e){if(!Y(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function q(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function D(e){const n=et(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function It(e,n){const s=D(e),a=D(n);if(!s||!a)return null;const o=(u,p,d)=>{const[b,g,h]=[u,p,d].map(y=>(y=y/255,y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)));return .2126*b+.7152*g+.0722*h},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function nt(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),d=parseInt(u.slice(2,4),16),b=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,d,b,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,d,b,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),d=parseInt(u[1]+u[1],16),b=parseInt(u[2]+u[2],16);return[p,d,b,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),d=parseFloat(r[3]),b=r[4]!=null?parseFloat(r[4]):1,[g,h,y]=G(u,p/100,d/100);return[g,h,y,b]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,d=parseFloat(l[3])/100,b=l[4]!=null?parseFloat(l[4]):1,[g,h,y]=st(u,p,d);return[g,h,y,b]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),d=parseFloat(i[3]),b=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[h,y,M]=lt(g,p,d);return[h,y,M,b]}const c=D(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function at(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function rt(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function G(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function st(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=G(e,1,.5).map(d=>d/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function z(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function ot(e,n,s){const[a]=z(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function U(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function L(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function lt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,d=c*c*c,b=4.0767416621*u-3.3077115913*p+.2309699292*d,g=-1.2684380046*u+2.6097574011*p-.3413193965*d,h=-.0041960863*u-.7034186147*p+1.707614701*d;return[L(b),L(g),L(h)]}function it(e,n,s){const a=U(e),o=U(n),r=U(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),d=Math.cbrt(c),b=.2104542553*u+.793617785*p-.0040720468*d,g=1.9779984951*u-2.428592205*p+.4505937099*d,h=.0259040371*u+.7827717662*p-.808675766*d,y=Math.sqrt(g*g+h*h);let M=Math.atan2(h,g)*180/Math.PI;return M<0&&(M+=360),[b,y,M]}function v(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return q(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=z(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=z(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=ot(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=it(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),d=(Math.round(c*10)/10).toFixed(1),b=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${d} / ${b})`:`oklch(${u} ${p} ${d})`}}}function E(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function ct(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function Vt(e){return Promise.all(e.map(ct))}function xt(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function Mt(e){const n=mt.decodeBase64(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function ut(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((d,b)=>{const g=r.get(d),h=Mt(d??""),y=g?.type||xt(h),M=g?.name??`file-${b}`,_=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),w=new Blob([_],{type:y});return new File([w],M,{type:y})})),i=p=>d=>{p&&Vt(d).then(b=>{for(const[g,h]of b.entries())r.set(h,{name:d[g].name,type:d[g].type});p(b)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function $t(e){const{value:n,onInput:s,onChange:a,...o}=e;return ut({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function _t(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=rt(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const h=g/i*Math.PI*2,y=n*(1+(l()*2-1)*c),M=Math.cos(h)*y,_=Math.sin(h)*y;u.push({x:M,y:_})}const p=(u[0].x+u[i-1].x)/2,d=(u[0].y+u[i-1].y)/2;let b=`M ${p.toFixed(3)} ${d.toFixed(3)}`;for(let g=0;g<i;g++){const h=u[g],y=u[(g+1)%i],M=(h.x+y.x)/2,_=(h.y+y.y)/2;b+=` Q ${h.x.toFixed(3)} ${h.y.toFixed(3)} ${M.toFixed(3)} ${_.toFixed(3)}`}return b+=" Z",b}const Ct=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,swatchSize:l,withAlpha:i}=e,c={xs:20,sm:26,md:32,lg:40,xl:52},u=l!=null?t.Value.map(l,m=>Number(m)):t.Value.map(e.size??"md",m=>c[m]??32),p=t.Value.map(n,m=>nt(m??"#000000")),d=t.Value.map(p,([m,V,$])=>[m,V,$]),b=t.Value.map(p,([,,,m])=>m),g=t.prop(t.Value.get(b)??1),h=t.Value.map(i??!1,m=>m),y=t.Value.map(e.colorTextFormat??"rgb",m=>m),M=t.computedOf(d,g,y,h)(([m,V,$],T,A,F)=>v(m,V,$,T??1,E(A,F),F)),_=t.Value.map(e.colorTextFormat??"hex",m=>m),w=t.Value.map(u,m=>`${-m/2} ${-m/2} ${m} ${m}`),f=t.computedOf(d,u)((m,V)=>_t(m,V/2)),I=t.computedOf(d,g,h)(([m,V,$],T,A)=>A||T<1?at(m,V,$,T):q(m,V,$)),C=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(h,m=>m?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(u)(m=>`width:${m+2}px;height:${m+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(w),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(I))),t.html.input(t.attr.type("color"),N.CommonInputAttributes(e),t.attr.value(t.Value.map(d,([m,V,$])=>q(m,V,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(m=>{const V=m.target.value;if(!a)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=v($,T,A,F,S,t.Value.get(h));a(X)}):t.Empty,o!=null?t.on.input(m=>{const V=m.target.value;if(!o)return;const{r:$,g:T,b:A}=D(V)??{r:0,g:0,b:0},F=t.Value.get(g)??1,S=E(t.Value.get(_),t.Value.get(h)),X=v($,T,A,F,S,t.Value.get(h));o(X)}):t.Empty)),x=t.When(h,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(g,m=>String(m??1))),t.attr.disabled(e.disabled),t.on.input(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=v($,T,A,V,F,t.Value.get(h));o?.(S)}),t.on.change(m=>{const V=parseFloat(m.target.value);g.set(V);const[$,T,A]=t.Value.get(d),F=E(t.Value.get(_),t.Value.get(h)),S=v($,T,A,V,F,t.Value.get(h));a?.(S)}))),{swatchSize:W,displayValue:H,withAlpha:j,colorTextFormat:K,...P}=e;return B.InputContainer({baseContainer:!0,...P,growInput:!1,input:C,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),M)),x,e.after)})},pt=e=>typeof e=="string"&&e.trim()===""?null:e,dt=e=>e??"";function O(e){return n=>{const{after:s,disabled:a}=n,o=N.mapInputOptions(n,dt,pt),r=k.NullableResetAfter(n.value,a,n.onChange??n.onInput);return e({...o,after:s!=null?t.Fragment(r,s):r})}}const Tt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ft.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(R.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),R.Icon({icon:"line-md/pencil",color:"neutral"}))))))},At=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input.date(N.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},Ft=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},kt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?Ft(u):null),c=k.NullableResetAfter(n,l,a??o);return B.InputContainer({...e,input:t.input["datetime-local"](N.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},Nt=O(Q.EmailInput),St=O(N.TextInput),Rt=O(Q.PasswordInput),vt=O(k.TextArea),Et=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:d=!0,ariaLabel:b})=>{const g=c??bt.sessionId("switch");function h(w,f){const I=["bc-switch",`bc-switch--size-${f}`,`bc-switch--${f}`];return d&&I.push("bc-switch--match-input"),w&&I.push("bc-switch--disabled"),I.join(" ")}function y(w){const f=w??"primary",I=new Map,C=R.backgroundValue(f,"solid","light"),x=R.backgroundValue(f,"solid","dark");return I.set("--switch-track-on-bg",C.backgroundColor),I.set("--switch-track-on-label",C.textColor),I.set("--switch-track-on-bg-dark",x.backgroundColor),I.set("--switch-track-on-label-dark",x.textColor),I.set("--switch-track-on-border-dark",R.borderColorValue(f,"dark")),Array.from(I.entries()).map(([W,H])=>`${W}: ${H}`).join("; ")}const M=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},_=w=>{t.Value.get(l)||(w.key===" "||w.key==="Enter")&&(w.preventDefault(),M())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((w,f)=>h(w??!1,f??"md"))),t.attr.style(t.computedOf(u)(w=>y(w))),t.attr.id(g),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((w,f)=>w?-1:f??0)),t.aria.checked(e),t.aria.disabled(l),b!=null?t.aria.label(b):null,t.on.click(M),t.on.keydown(_),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,w=>w?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Dt=O(k.UuidInput),Bt="line-md:star-alt-filled",Ot="line-md:star-alt",ht=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",activeIcon:c=Bt,inactiveIcon:u=Ot,size:p="md",onBlur:d,rounding:b=1}=e,g=()=>{const f=t.Value.get(b);return f>0?f:1},h=f=>Math.min(Math.max(f,0),t.Value.get(r)),y=(f,I)=>{if(t.Value.get(o??!1))return;const x=f.currentTarget.getBoundingClientRect(),W=(f.clientX-x.left)/x.width,H=I-1+W,j=g(),K=Math.ceil(H/j)*j,P=h(K);s?.(P),a?.(P)},M=f=>{if(t.Value.get(o??!1))return;const I=g(),C=t.Value.get(n)??0;let x;switch(f.key){case"ArrowRight":case"ArrowUp":x=h(C+I);break;case"ArrowLeft":case"ArrowDown":x=h(C-I);break;case"Home":x=0;break;case"End":x=t.Value.get(r);break;default:return}f.preventDefault(),s?.(x),a?.(x)},_=t.Value.map(p,f=>`bc-icon--${f}`),w=({index:f,counter:I})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(_),t.on.click(t.emit(C=>y(C,I),{preventDefault:!0,stopPropagation:!0})),R.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(_),t.style.width(t.Value.map(n,C=>{const x=Math.floor(C);return x>f?"100%":x<f?"0%":`${(C-f)*100}%`})),R.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))));return B.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(N.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,f=>f?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,r)((f,I)=>{const C=f??0,x=I??0;return`${String(C)} / ${String(x)}`})),t.on.keydown(M),d!=null?t.on.blur(d):null,t.Repeat(r,w))})},Wt=e=>{const{after:n,disabled:s}=e,a=N.mapInputOptions(e,r=>r??0,r=>r),o=k.NullableResetAfter(e.value,s,e.onChange??e.onInput);return ht({...a,after:n!=null?t.Fragment(o,n):o})},Ht=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return B.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Pt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const d=a!=null?t.Value.get(a):void 0;return typeof d=="number"?d:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return B.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),N.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Ut=O(k.UrlInput);class gt{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=yt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Lt=new gt;function qt(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function zt(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function jt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Xt(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=$t;exports.Base64sInput=ut;exports.ColorSwatchInput=Ct;exports.EditableText=Tt;exports.NullableDateInput=At;exports.NullableDateTimeInput=kt;exports.NullableEmailInput=Nt;exports.NullablePasswordInput=Rt;exports.NullableRatingInput=Wt;exports.NullableSliderInput=Pt;exports.NullableTextArea=vt;exports.NullableTextInput=St;exports.NullableUrlInput=Ut;exports.NullableUuidInput=Dt;exports.RatingInput=ht;exports.SliderInput=Ht;exports.Switch=Et;exports.WidgetRegistry=gt;exports.createDiagnosticWidget=Xt;exports.emptyToNull=pt;exports.fileToBase64=ct;exports.forFormat=zt;exports.forTypeAndFormat=jt;exports.forXUI=qt;exports.formatColor=v;exports.getContrastRatio=It;exports.globalWidgetRegistry=Lt;exports.hexToRgb=D;exports.hslToRgb=G;exports.hwbToRgb=st;exports.isValidColor=wt;exports.isValidHexColor=Y;exports.isValidHslColor=tt;exports.isValidRgbColor=Z;exports.isValidRgbaColor=J;exports.linearToSrgb=L;exports.mulberry32=rt;exports.normalizeHexColor=et;exports.nullToEmpty=dt;exports.oklchToRgb=lt;exports.parseAnyColor=nt;exports.resolveEffectiveFormat=E;exports.rgbToHex=q;exports.rgbToHsl=z;exports.rgbToHwb=ot;exports.rgbToOklch=it;exports.srgbToLinear=U;exports.toRgbaString=at;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Value as p, prop as ut, computedOf as D, html as _, attr as u, svg as ot, svgAttr as J, Empty as A, on as I, When as z, Fragment as j, aria as R, emitValue as at, Use as ft, input as pt, emitValueAsNullableDate as ct, emitValueAsNullableDateTime as it, Repeat as mt, emit as bt, style as wt, emitValueAsNumber as E } from "@tempots/dom";
|
|
2
|
-
import { F as yt, N as X, T as Mt, U as It, a as $t } from "./deep-merge-
|
|
2
|
+
import { F as yt, N as X, T as Mt, U as It, a as $t } from "./deep-merge-DwXDd3iF.js";
|
|
3
3
|
import { decodeBase64 as xt } from "@tempots/std";
|
|
4
|
-
import { I as P } from "./input-container-
|
|
5
|
-
import { C as O, m as dt, T as _t } from "./text-input-
|
|
6
|
-
import { B as kt, I as et, b as lt, a as Ft } from "./translations-
|
|
4
|
+
import { I as P } from "./input-container-CO3DNqpp.js";
|
|
5
|
+
import { C as O, m as dt, T as _t } from "./text-input-BAn02BzO.js";
|
|
6
|
+
import { B as kt, I as et, b as lt, a as Ft } from "./translations-DT5QQ4WO.js";
|
|
7
7
|
import { AutoSelect as Ct } from "@tempots/ui";
|
|
8
|
-
import { E as Tt, P as St } from "./notice-
|
|
8
|
+
import { E as Tt, P as St } from "./notice-Du3tWJTW.js";
|
|
9
9
|
import { s as At } from "./session-id-3KiilioY.js";
|
|
10
10
|
import { r as vt } from "./utils-vUtP6iPG.js";
|
|
11
11
|
function ht(t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-qefRsdGi.cjs"),r={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:" Hindi",it:"意大利语",ja:"日语",ko:"韩语",nl:"荷兰语",pl:"波兰语",pt:"葡萄牙语",ru:"俄语",tr:"土耳其语",vi:"越南语",zh:"简体中文",he:"希伯来语",fa:"波斯语",ur:"乌尔都语",emailPlaceholderText:"请输入邮箱",incrementValue:"增加值",decrementValue:"减少值",dropZoneInstructions:e=>e?"点击选择或将文件拖拽到此处,或按 Enter 或空格键打开文件选择器":"将文件拖拽到此处",fileSizeUnits:["字节","KB","MB","GB","TB"],removeFile:"删除文件",clearAllFiles:"清除所有文件",clearValue:"清除值",unknownType:"未知类型",filesInputInstructions:(e,t,l)=>{let o=(e==null||e>1,"点击选择或将文件拖拽到此处");if(e||t){const n=[];if(e!=null&&e>1&&n.push(`最多${e}个文件`),t&&l){const i=a.formatFileSize(t,{units:l});n.push(`每个最大${i}`)}n.length>0&&(o+=` (${n.join(",")})`)}return o},paginationLabel:"分页",paginationRange:(e,t,l,o)=>o>l?`第 ${e} 至 ${t} 行,共 ${l} 条(总计 ${o} 条)`:`第 ${e} 至 ${t} 行,共 ${l} 条`,firstPage:"第一页",previousPage:"上一页",nextPage:"下一页",lastPage:"最后一页",breadcrumbs:"面包屑导航",commandPalette:"命令面板",typeACommand:"输入命令...",noResultsFound:"未找到结果",noMatchingCommands:"没有匹配的命令",appearanceSystem:"跟随系统",appearanceLight:"浅色",appearanceDark:"深色",ok:"OK",changeTypeConfirmation:"更改类型将清除当前值。是否继续?",notifications:"通知",markAllAsRead:"全部标为已读",noNotifications:"没有通知",schemaConflictsDetected:"检测到架构冲突",schemaViolationsDetected:"检测到架构违规",properties:"属性",uploading:"上传中...",dropFilesOrBrowse:"将文件拖放到此处或点击浏览",acceptedTypes:e=>`支持的类型:${e}`,enterUrlPrompt:"请输入网址:",exceeded:"(已超出)",pdfPreview:"PDF 预览",lexical:{fontFamily:"字体",fontSize:"字号",lineHeight:"行高",fontColor:"字体颜色",highlightColor:"高亮颜色",backgroundColor:"背景颜色",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",code:"代码",clearFormatting:"清除格式",normal:"正文",heading:e=>`标题 ${e}`,bulletList:"无序列表",orderedList:"有序列表",checkList:"任务列表",indent:"增加缩进",outdent:"减少缩进",blockquote:"引用",codeBlock:"代码块",horizontalRule:"水平分割线",insertTable:"插入表格",link:"链接",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",defaultOption:"默认",slashCommands:"斜杠命令",noCommandsFound:"未找到命令",changeBlockType:"更改块类型",blockTypes:"块类型",enterUrl:"输入网址:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},dataTable:{sortAscending:"升序排列",sortDescending:"降序排列",clearSort:"清除排序",filterPlaceholder:"筛选...",clearFilter:"清除筛选",selectAll:"全选",deselectAll:"取消全选",selectedCount:e=>`已选择 ${e} 项`,resetAll:"重置全部",noResults:"未找到结果",loading:"加载中...",filterPanelAddCondition:"添加条件",filterPanelApply:"应用",filterPanelClear:"清除筛选",filterPanelAnd:"且",filterPanelOr:"或",filterPanelContains:"包含",filterPanelNotContains:"不包含",filterPanelEquals:"等于",filterPanelNotEquals:"不等于",filterPanelStartsWith:"开头是",filterPanelEndsWith:"结尾是",filterPanelIsNull:"为空",filterPanelIsNotNull:"不为空",filterPanelGt:"大于",filterPanelGte:"大于或等于",filterPanelLt:"小于",filterPanelLte:"小于或等于",filterPanelBetween:"介于",filterPanelValuePlaceholder:"值...",sortMultiHint:"按住 Shift 可对多列排序",columnVisibility:"列",showAllColumns:"显示全部",menuSortAsc:"升序排列",menuSortDesc:"降序排列",menuClearSort:"清除排序",menuHideColumn:"隐藏列",menuChooseColumns:"选择列",menuResetColumns:"重置列",menuFilter:"筛选",rowCount:(e,t)=>`行数:${e} 总行数:${t}`,filterTagsPlaceholder:"选择值...",groupCount:e=>`${e} 项`,collapseGroup:"收起分组",expandGroup:"展开分组",describeFilter:{textContains:(e,t)=>`${e} 包含 "${t}"`,textNotContains:(e,t)=>`${e} 不包含 "${t}"`,textEquals:(e,t)=>`${e} 等于 "${t}"`,textNotEquals:(e,t)=>`${e} 不等于 "${t}"`,textStartsWith:(e,t)=>`${e} 以 "${t}" 开头`,textEndsWith:(e,t)=>`${e} 以 "${t}" 结尾`,compareEq:(e,t)=>`${e} = ${t}`,compareNeq:(e,t)=>`${e} ≠ ${t}`,compareGt:(e,t)=>`${e} > ${t}`,compareGte:(e,t)=>`${e} ≥ ${t}`,compareLt:(e,t)=>`${e} < ${t}`,compareLte:(e,t)=>`${e} ≤ ${t}`,rangeBetween:(e,t,l)=>`${e} 在 ${t} 到 ${l} 之间`,rangeGte:(e,t)=>`${e} ≥ ${t}`,rangeLte:(e,t)=>`${e} ≤ ${t}`,setIn:(e,t)=>`${e} 在 [${t}] 中`,setNotIn:(e,t)=>`${e} 不在 [${t}] 中`,booleanIs:(e,t)=>`${e} 为 ${t}`,isNull:e=>`${e} 为空`,isNotNull:e=>`${e} 不为空`,compositeAnd:e=>e.join(" 且 "),compositeOr:e=>e.join(" 或 ")}},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:"正在加载PDF...",loadFailed:"加载PDF失败",invalidPdf:"无效的PDF文件",pageOutOfRange:(e,t)=>`页面 ${e} 超出范围 (1-${t})`,renderFailed:"渲染PDF页面失败"}};exports.default=r;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("@tempots/dom"),q=require("./stack-dwLevGa2.cjs"),L=require("./use-form-Ca0kF4af.cjs"),f=require("./modal-ClnvWxzi.cjs"),G=require("@tempots/std"),m=require("./translations-D8Jwi_d0.cjs"),P=require("./notice-dOOD80F7.cjs"),C=require("./input-container-BZwpJgx6.cjs"),ee=require("./text-input-CynkbBpH.cjs"),te=require("./translations-BDGa_4jx.cjs"),oe=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 j(t){return T[t]?.name||t}function ae(t){return T[t]?.icon||"mdi:account"}function ne(t){return T[t]?.color||"#666"}function re(t,o="Continue with {provider}"){return o.replace("{provider}",j(t))}const y={minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!1};function se(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}function H(t=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let a=0;a<t;a++)n+=o.charAt(Math.floor(Math.random()*o.length));return n}function ie(t,o,n,a=[],c={}){const s={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"},u={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"]},r=s[t];if(!r)throw new Error(`Unsupported provider: ${t}`);const l=a.length>0?a:u[t],i=H(),h=new URLSearchParams({client_id:o,redirect_uri:n,scope:l.join(" "),state:i,response_type:"code",...c});return`${r}?${h.toString()}`}function ce(t,o,n,a){const c=window.open(t,`${o}_login`,"width=500,height=600,scrollbars=yes,resizable=yes");if(!c){a?.(new Error("Failed to open popup window"));return}const s=setInterval(()=>{c.closed&&(clearInterval(s),a?.(new Error("Login cancelled")))},1e3),u=r=>{r.origin===window.location.origin&&(r.data.type==="SOCIAL_LOGIN_SUCCESS"?(clearInterval(s),c.close(),window.removeEventListener("message",u),n?.(r.data.result)):r.data.type==="SOCIAL_LOGIN_ERROR"&&(clearInterval(s),c.close(),window.removeEventListener("message",u),a?.(new Error(r.data.error))))};window.addEventListener("message",u)}function le(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t?String(t.message):"An unexpected error occurred"}function ue(){return typeof window<"u"&&typeof document<"u"}function $({task:t,message:o,onStart:n,onEnd:a}){return async c=>{n?.();const s=await L.taskToValidation({task:t!=null?()=>t(c):async()=>null,errorMessage:o,errorPath:["root"],validation:u=>u!=null?G.Validation.invalid({message:u}):G.Validation.valid});return a?.(),s}}function E(t=y,o){const n=o??m.defaultMessages;let a=f.string();return t.minLength&&(a=a.min(t.minLength,(n.passwordMinLength??m.defaultMessages.passwordMinLength)(t.minLength))),t.requireUppercase&&(a=a.regex(/[A-Z]/,n.passwordRequireUppercase??m.defaultMessages.passwordRequireUppercase)),t.requireLowercase&&(a=a.regex(/[a-z]/,n.passwordRequireLowercase??m.defaultMessages.passwordRequireLowercase)),t.requireNumbers&&(a=a.regex(/[0-9]/,n.passwordRequireNumber??m.defaultMessages.passwordRequireNumber)),t.requireSymbols&&(a=a.regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,n.passwordRequireSpecialChar??m.defaultMessages.passwordRequireSpecialChar)),t.customValidation&&(a=a.refine(c=>t.customValidation(c))),a}function A(t){const o=t??m.defaultMessages;return f.string().min(1,o.emailRequired??m.defaultMessages.emailRequired).email(o.invalidEmail??m.defaultMessages.invalidEmail)}const V=A();function M(t,o){const n=o??m.defaultMessages,a=t?E(t,o):f.string().refine(c=>c.length>0?null:n.passwordRequired??m.defaultMessages.passwordRequired);return f.object({email:A(o),password:a,rememberMe:f.boolean().default(!1)}).schema()}function z(t=y,o,n){const a=n??m.defaultMessages,c=E(t,n),s=o?.showNameField!==!1,u=o?.showConfirmPassword!==!1,r=o?.showAcceptTermsAndConditions!==!1,l={name:s?f.string().min(1,a.nameRequired??m.defaultMessages.nameRequired).optional():f.string().optional(),email:A(n),password:c,confirmPassword:u?f.string().min(1,a.confirmPasswordRequired??m.defaultMessages.confirmPasswordRequired):f.string(),acceptTerms:r?f.boolean().refine(h=>h===!0,a.acceptTermsRequired??m.defaultMessages.acceptTermsRequired):f.boolean().default(!0)},i=f.object(l);return u?i.refine(h=>h.password===h.confirmPassword?null:a.passwordsDoNotMatch??m.defaultMessages.passwordsDoNotMatch,{path:["confirmPassword"]}).schema():i.schema()}const N=f.object({email:V}).schema(),me=M(),de=z(),pe={signIn:M,signUp:z,resetPassword:()=>N};function he(t,o){const n=o??m.defaultMessages,c=(o?A(o):V).validate(t);return c.success?null:c.errors[0]?.message||(n.invalidEmailAddress??m.defaultMessages.invalidEmailAddress)}function ge(t,o=y,n){const a=n??m.defaultMessages,s=E(o,n).validate(t);return s.success?null:s.errors[0]?.message||(a.invalidPassword??m.defaultMessages.invalidPassword)}function R(t,o=y){const n={length:t.length>=(o.minLength||8),uppercase:/[A-Z]/.test(t),lowercase:/[a-z]/.test(t),numbers:/[0-9]/.test(t),symbols:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(t),custom:o.customValidation?o.customValidation(t)===null:t.length>0},a=[!0,o.requireUppercase,o.requireLowercase,o.requireNumbers,o.requireSymbols,!!o.customValidation].filter(Boolean).length,c=[n.length,o.requireUppercase?n.uppercase:null,o.requireLowercase?n.lowercase:null,o.requireNumbers?n.numbers:null,o.requireSymbols?n.symbols:null,o.customValidation?n.custom:null].filter(r=>r===!0).length,s=a>0?Math.round(c/a*100):0;let u;return s<40?u="weak":s<60?u="fair":s<80?u="good":u="strong",{strength:u,score:s,checks:n}}const D=()=>e.localStorageProp({key:"bui_auth_email",defaultValue:null});function X({onSignIn:t,passwordRules:o,labels:n,showRememberMe:a}){const c=e.prop(!1),s=D(),u=M(o),r=L.useForm({schema:u,onSubmit:$({task:t,message:"Reset password failed",onStart:()=>{c.set(!0),r.controller.disable()},onEnd:()=>{c.set(!1),r.controller.enable()}}),initialValue:{email:"",password:""}}),{controller:l,submit:i}=r;c.on(l.setDisabled);const h=l.field("email"),w=l.field("password");return s.on(b=>{b!=null&&h.change(b)}),h.signal.on(b=>{s.value!=null&&(s.value=b)}),e.Use(m.AuthI18n,b=>e.html.form(e.attr.class("bc-auth-form__form"),e.on.submit(i),q.Stack(e.attr.class("bc-auth-form__fields"),e.Ensure(l.error,_=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},e.html.div(_))),L.Control(P.EmailInput,{controller:h,label:e.coalesce(n?.emailLabel,b.$.emailLabel)}),L.Control(P.PasswordInput,{controller:w,label:e.coalesce(n?.passwordLabel,b.$.passwordLabel)}),e.When(a??!0,()=>e.html.div(e.attr.class("bc-auth-form__remember-me"),e.html.label(e.attr.class("bc-auth-form__checkbox-label"),L.CheckboxInput({value:s.map(_=>_!=null),after:e.html.span(e.coalesce(n?.rememberMeLabel,b.$.rememberMeLabel)),onChange:_=>{_?s.value=h.signal.value??"":s.value=null}}))))),C.Button({type:"submit",variant:"filled",color:"primary",loading:c,disabled:l.disabledOrHasErrors},e.attr.class("bc-auth-form__submit"),e.coalesce(n?.signInButton,b.$.signInButton))))}function Y({password:t,rules:o=y,showLabel:n=!0,className:a}){const c=e.computedOf(t)(i=>!i||i.length===0?{strength:"weak",score:0,checks:{length:!1,uppercase:!1,lowercase:!1,numbers:!1,symbols:!1,custom:!1}}:R(i,o)),s=c.map(i=>i.strength),u=c.map(i=>i.score),r=c.map(i=>i.checks),l=e.computedOf(s,a)((i,h)=>["bc-password-strength",`bc-password-strength--${i}`,h].filter(Boolean).join(" "));return e.html.div(e.attr.class(l),e.html.div(e.attr.class("bc-password-strength__bar"),e.html.div(e.attr.class("bc-password-strength__fill"),e.attr.style(u.map(i=>`width: ${i}%`)))),e.When(n,()=>e.Use(m.AuthI18n,i=>e.html.div(e.attr.class("bc-password-strength__label"),e.computedOf(s,i)((h,w)=>{switch(h){case"weak":return w.passwordStrengthWeak;case"fair":return w.passwordStrengthFair;case"good":return w.passwordStrengthGood;case"strong":return w.passwordStrengthStrong;default:return w.passwordStrengthWeak}})))),e.html.div(e.attr.class("bc-password-strength__requirements"),e.When(o.minLength!==void 0,()=>e.html.div(e.attr.class("bc-password-strength__requirement"),e.attr.class(e.computedOf(r)(i=>i.length?"bc-password-strength__requirement--met":"")),e.html.span(e.attr.class("bc-password-strength__requirement-icon"),e.computedOf(r)(i=>i.length?"✓":"○")),e.html.span(e.attr.class("bc-password-strength__requirement-text"),`At least ${o.minLength} characters`))),e.When(o.requireUppercase===!0,()=>e.html.div(e.attr.class("bc-password-strength__requirement"),e.attr.class(e.computedOf(r)(i=>i.uppercase?"bc-password-strength__requirement--met":"")),e.html.span(e.attr.class("bc-password-strength__requirement-icon"),e.computedOf(r)(i=>i.uppercase?"✓":"○")),e.html.span(e.attr.class("bc-password-strength__requirement-text"),"One uppercase letter"))),e.When(o.requireLowercase===!0,()=>e.html.div(e.attr.class("bc-password-strength__requirement"),e.attr.class(e.computedOf(r)(i=>i.lowercase?"bc-password-strength__requirement--met":"")),e.html.span(e.attr.class("bc-password-strength__requirement-icon"),e.computedOf(r)(i=>i.lowercase?"✓":"○")),e.html.span(e.attr.class("bc-password-strength__requirement-text"),"One lowercase letter"))),e.When(o.requireNumbers===!0,()=>e.html.div(e.attr.class("bc-password-strength__requirement"),e.attr.class(e.computedOf(r)(i=>i.numbers?"bc-password-strength__requirement--met":"")),e.html.span(e.attr.class("bc-password-strength__requirement-icon"),e.computedOf(r)(i=>i.numbers?"✓":"○")),e.html.span(e.attr.class("bc-password-strength__requirement-text"),"One number"))),e.When(o.requireSymbols===!0,()=>e.html.div(e.attr.class("bc-password-strength__requirement"),e.attr.class(e.computedOf(r)(i=>i.symbols?"bc-password-strength__requirement--met":"")),e.html.span(e.attr.class("bc-password-strength__requirement-icon"),e.computedOf(r)(i=>i.symbols?"✓":"○")),e.html.span(e.attr.class("bc-password-strength__requirement-text"),"One special character")))))}function fe({password:t,rules:o=y,className:n}){const a=e.computedOf(t)(r=>!r||r.length===0?{strength:"weak",score:0}:R(r,o)),c=a.map(r=>r.strength),s=a.map(r=>r.score),u=e.computedOf(c,n)((r,l)=>["bc-password-strength-bar",`bc-password-strength-bar--${r}`,l].filter(Boolean).join(" "));return e.html.div(e.attr.class(u),e.html.div(e.attr.class("bc-password-strength-bar__fill"),e.attr.style(s.map(r=>`width: ${r}%`))))}function we({password:t,rules:o=y,className:n}){const a=e.computedOf(t)(s=>!s||s.length===0?"weak":R(s,o).strength),c=e.computedOf(a,n)((s,u)=>["bc-password-strength-text",`bc-password-strength-text--${s}`,u].filter(Boolean).join(" "));return e.Use(m.AuthI18n,s=>e.html.span(e.attr.class(c),e.computedOf(a,s)((u,r)=>{switch(u){case"weak":return r.passwordStrengthWeak;case"fair":return r.passwordStrengthFair;case"good":return r.passwordStrengthGood;case"strong":return r.passwordStrengthStrong;default:return r.passwordStrengthWeak}})))}function Z({passwordRules:t,labels:o,initialEmail:n,initialName:a,showPasswordStrength:c,onSignUp:s,showNameField:u,showConfirmPassword:r,showAcceptTermsAndConditions:l,termsAndConditions:i}){const h=e.prop(!1),w=t||y,b=z(w,{showNameField:u!==!1,showConfirmPassword:r!==!1,showAcceptTermsAndConditions:l!==!1}),_=L.useForm({schema:b,onSubmit:$({task:s!=null?g=>s({email:g.email,password:g.password,name:g.name,acceptTerms:g.acceptTerms}):void 0,message:"Reset password failed",onStart:()=>{h.set(!0),_.controller.disable()},onEnd:()=>{h.set(!1),_.controller.enable()}}),initialValue:{name:a??"",email:n??"",password:"",confirmPassword:"",acceptTerms:!1}}),{controller:v,submit:U}=_;h.on(v.setDisabled);const B=v.field("name"),S=v.field("email"),x=v.field("password"),O=v.field("confirmPassword"),I=v.field("acceptTerms");return e.Use(m.AuthI18n,g=>e.html.form(e.attr.class("bc-auth-form__form"),e.on.submit(U),q.Stack(e.attr.class("bc-auth-form__fields"),e.Ensure(v.error,k=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},e.html.div(k))),e.When(u!==!1,()=>L.Control(ee.TextInput,{controller:B.transform(k=>k??"",k=>k===""?void 0:k),label:e.coalesce(o?.nameLabel,g.$.nameLabel)})),L.Control(P.EmailInput,{controller:S,label:e.coalesce(o?.emailLabel,g.$.emailLabel)}),L.Control(P.PasswordInput,{controller:x,label:e.coalesce(o?.passwordLabel,g.$.passwordLabel)}),e.When(c??!1,()=>Y({password:x.signal,rules:w,showLabel:!0})),e.When(r??!1,()=>L.Control(P.PasswordInput,{controller:O,label:e.coalesce(o?.confirmPasswordLabel,g.$.confirmPasswordLabel)})),e.When(l??!1,()=>e.html.div(e.attr.class("bc-auth-form__terms"),e.html.label(e.attr.class("bc-auth-form__checkbox-label"),L.CheckboxInput({value:I.signal.map(k=>k??!1),onChange:k=>I.change(k)}),e.html.span(i||e.coalesce(o?.acceptTermsLabel,g.$.acceptTermsLabel))),e.When(I.errorVisible,()=>e.html.div(e.attr.class("bc-auth-form__field-error"),I.error.map(k=>k||"")))))),C.Button({type:"submit",variant:"filled",color:"primary",loading:h,disabled:v.disabledOrHasErrors},e.attr.class("bc-auth-form__submit"),e.coalesce(o?.signUpButton,g.$.signUpButton))))}function J({onResetPassword:t,labels:o={}}){const n=D(),a=e.prop(!1),c=L.useForm({schema:N,onSubmit:$({task:t,message:"Reset password failed",onStart:()=>{a.set(!0),c.controller.disable()},onEnd:()=>{a.set(!1),c.controller.enable()}}),initialValue:{email:""}}),{controller:s,submit:u}=c;a.on(s.setDisabled);const r=s.field("email");return n.on(l=>{l!=null&&r.change(l)}),e.Use(m.AuthI18n,l=>e.html.form(e.attr.class("bc-auth-form__form"),e.Ensure(s.error,i=>P.Notice({variant:"danger",tone:"prominent",role:"alert"},e.html.div(i))),e.html.p(e.attr.class("bc-auth-form__description"),e.coalesce(o?.resetPasswordDescription,l.$.resetPasswordDescription)),e.on.submit(u),q.Stack(e.attr.class("bc-auth-form__fields"),L.Control(P.EmailInput,{controller:r,label:e.coalesce(o?.emailLabel,l.$.emailLabel)})),C.Button({loading:a,type:"submit",variant:"filled",color:"primary",disabled:s.disabledOrHasErrors},e.attr.class("bc-auth-form__submit"),e.coalesce(o?.resetPasswordButton,l.$.resetPasswordButton))))}function p({provider:t,onClick:o,size:n="md",name:a,icon:c,color:s,flow:u,labels:r}){const l=async()=>{if(o)try{u==="popup"?await o():await o()}catch(i){console.error(`Social login error for ${t} (${u||"redirect"} flow):`,i)}};return C.Button({type:"button",variant:"filled",size:n,color:s,onClick:l,roundedness:"full"},e.attr.class("bc-social-login-button"),e.attr.class(e.computedOf(t)(i=>`bc-social-login-button--${i}`)),e.html.span(e.attr.class("bc-social-login-button__inner"),e.html.span(e.attr.class("bc-social-login-button__icon"),te.Icon({icon:c,size:n},e.attr.class("bc-social-login-button__icon-inner"))),e.Use(m.AuthI18n,i=>e.html.span(e.attr.class("bc-social-login-button__label"),e.bind(e.coalesce(r?.continueWithProvider,i.$.continueWithProvider))(a)))))}function K({providers:t,onProviderClick:o,size:n="md",className:a}){return q.Stack(e.attr.class("bc-social-login-buttons"),e.attr.class(a),e.ForEach(t,c=>p({provider:c.$.provider,flow:c.$.flow,color:c.map(({provider:s})=>d[s].color),name:c.map(({provider:s})=>d[s].name),icon:c.map(({provider:s})=>d[s].icon),onClick:async()=>{o&&await o(c.$.provider.value)},size:n})))}const d={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"}},be=t=>p({...t,...d.google,provider:"google"}),Le=t=>p({...t,...d.github,provider:"github"}),_e=t=>p({...t,...d.apple,provider:"apple"}),ke=t=>p({...t,...d.facebook,provider:"facebook"}),ve=t=>p({...t,...d.x,provider:"x"}),Se=t=>p({...t,...d.twitter,provider:"twitter"}),Pe=t=>p({...t,...d.microsoft,provider:"microsoft"}),ye=t=>p({...t,...d.discord,provider:"discord"}),Be=t=>p({...t,...d.linkedin,provider:"linkedin"}),qe=t=>p({...t,...d.instagram,provider:"instagram"}),Ie=t=>p({...t,...d.tiktok,provider:"tiktok"}),xe=t=>p({...t,...d.snapchat,provider:"snapchat"}),Ae=t=>p({...t,...d.reddit,provider:"reddit"}),Ce=t=>p({...t,...d.pinterest,provider:"pinterest"}),Te=t=>p({...t,...d.twitch,provider:"twitch"}),$e=t=>p({...t,...d.steam,provider:"steam"}),Ee=t=>p({...t,...d.epic,provider:"epic"}),Me=t=>p({...t,...d.playstation,provider:"playstation"}),ze=t=>p({...t,...d.xbox,provider:"xbox"}),Re=t=>p({...t,...d.whatsapp,provider:"whatsapp"}),Ue=t=>p({...t,...d.wechat,provider:"wechat"}),Oe=t=>p({...t,...d.amazon,provider:"amazon"}),We=t=>p({...t,...d.yahoo,provider:"yahoo"}),Fe=t=>p({...t,...d.paypal,provider:"paypal"});function W({providers:t,onSocialLogin:o}){return q.Stack(K({providers:t,onProviderClick:o}))}function Q({mode:t,socialProviders:o,initialName:n,initialEmail:a,passwordRules:c,showRememberMe:s,showSocialDivider:u,showPasswordStrength:r,labels:l,onSignIn:i,onSignUp:h,onResetPassword:w,onModeChange:b,onSocialLogin:_,showContainer:v},...U){const B=t!=null?e.Value.deriveProp(t):e.prop("signin");return B.on(S=>b?.(S)),e.Use(m.AuthI18n,S=>{function x(){const g=e.coalesce(l?.hasAccountLink,S.$.hasAccountLink);return e.html.button(e.attr.type("button"),e.attr.class("bc-auth-form__link"),e.on.click(()=>B.set("signin")),g)}function O(){return e.html.button(e.attr.type("button"),e.attr.class("bc-auth-form__link"),e.on.click(()=>B.set("signup")),e.coalesce(l?.noAccountLink,S.$.noAccountLink))}function I(){return e.html.button(e.attr.type("button"),e.attr.class("bc-auth-form__link"),e.on.click(()=>B.set("reset-password")),e.coalesce(l?.forgotPasswordLink,S.$.forgotPasswordLink))}return e.html.div(oe.classes({"bc-auth-container":!0,"bc-auth-container--styled":e.Value.map(v??!0,g=>g)}),e.attr.class(B.map(g=>`bc-auth-container--${g}`)),e.attr.class("bc-auth-form"),e.OneOfValue(B,{signin:()=>e.Fragment(e.html.h2(e.attr.class("bc-auth-form__title"),e.coalesce(l?.signInTitle,S.$.signInTitle)),o!=null?e.Fragment(W({providers:o,onSocialLogin:_}),e.When(u??!1,F)):null,X({onSignIn:i,showRememberMe:s,passwordRules:c,labels:{emailLabel:l?.emailLabel,passwordLabel:l?.passwordLabel,rememberMeLabel:l?.rememberMeLabel,signInButton:l?.signInButton,forgotPasswordLink:l?.forgotPasswordLink,noAccountLink:l?.noAccountLink}}),q.Stack(e.attr.class("bc-auth-form__footer"),O(),I())),signup:()=>e.Fragment(e.html.h2(e.attr.class("bc-auth-form__title"),e.coalesce(l?.signUpTitle,S.$.signUpTitle)),o!=null?e.Fragment(W({providers:o,onSocialLogin:_}),e.When(u??!1,F)):null,Z({labels:{nameLabel:l?.nameLabel,emailLabel:l?.emailLabel,passwordLabel:l?.passwordLabel,confirmPasswordLabel:l?.confirmPasswordLabel,acceptTermsLabel:l?.acceptTermsLabel,signUpButton:l?.signUpButton,hasAccountLink:l?.hasAccountLink},initialEmail:a,initialName:n,onSignUp:h,passwordRules:c,showPasswordStrength:r}),q.Stack(e.attr.class("bc-auth-form__footer"),x())),"reset-password":()=>e.Fragment(e.html.h2(e.attr.class("bc-auth-form__title"),e.coalesce(l?.resetPasswordTitle,S.$.resetPasswordTitle)),J({labels:{backToSignInLink:l?.backToSignInLink,emailLabel:l?.emailLabel,resetPasswordButton:l?.resetPasswordButton,resetPasswordDescription:l?.resetPasswordDescription},onResetPassword:w}),q.Stack(e.attr.class("bc-auth-form__footer"),x()))}),...U)})}function Ve(t){return f.Modal({size:"sm",dismissable:!0,showCloseButton:!0},(o,n)=>t(a=>o({body:Q({showContainer:!1,...a}),header:e.Use(m.AuthI18n,c=>e.coalesce(a.modalTitle,c.$.authenticationTitle))})))}function F({labels:t,className:o}={}){return e.html.div(e.attr.class("bc-auth-divider"),e.attr.class(o),e.html.div(e.attr.class("bc-auth-divider__line")),e.Use(m.AuthI18n,n=>e.html.span(e.attr.class("bc-auth-divider__text"),e.coalesce(t?.text,n.$.orDivider))),e.html.div(e.attr.class("bc-auth-divider__line")))}exports.AmazonLoginButton=Oe;exports.AppleLoginButton=_e;exports.AuthContainer=Q;exports.AuthDivider=F;exports.AuthModal=Ve;exports.DiscordLoginButton=ye;exports.EpicLoginButton=Ee;exports.FacebookLoginButton=ke;exports.GitHubLoginButton=Le;exports.GoogleLoginButton=be;exports.InstagramLoginButton=qe;exports.LinkedInLoginButton=Be;exports.MicrosoftLoginButton=Pe;exports.PasswordStrengthBar=fe;exports.PasswordStrengthIndicator=Y;exports.PasswordStrengthText=we;exports.PayPalLoginButton=Fe;exports.PinterestLoginButton=Ce;exports.PlayStationLoginButton=Me;exports.RedditLoginButton=Ae;exports.ResetPasswordForm=J;exports.SignInForm=X;exports.SignUpForm=Z;exports.SnapchatLoginButton=xe;exports.SocialLoginButton=p;exports.SocialLoginButtons=K;exports.SocialProviders=W;exports.SteamLoginButton=$e;exports.TiktokLoginButton=Ie;exports.TwitchLoginButton=Te;exports.TwitterLoginButton=Se;exports.WeChatLoginButton=Ue;exports.WhatsAppLoginButton=Re;exports.XLoginButtin=ve;exports.XboxLoginButton=ze;exports.YahooLoginButton=We;exports.authSchemas=pe;exports.calculatePasswordStrength=R;exports.createEmailSchema=A;exports.createPasswordSchema=E;exports.createSignInSchema=M;exports.createSignUpSchema=z;exports.createSocialLoginUrl=ie;exports.defaultPasswordRules=y;exports.defaultSignInSchema=me;exports.defaultSignUpSchema=de;exports.emailSchema=V;exports.formatAuthError=le;exports.formatProviderName=j;exports.formatSocialLoginText=re;exports.generateRandomString=H;exports.getProviderColor=ne;exports.getProviderIcon=ae;exports.isBrowser=ue;exports.isValidEmail=se;exports.openSocialLoginPopup=ce;exports.providerInfo=T;exports.requestToControllerValidation=$;exports.resetPasswordSchema=N;exports.socialProviderInfo=d;exports.useAuthEmailProp=D;exports.validateEmail=he;exports.validatePassword=ge;
|