fernwell 0.5.0 → 0.6.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/CHANGELOG.md +19 -0
- package/README.md +5 -1
- package/dist/_tokenData.d.cts +1 -1
- package/dist/_tokenData.d.ts +1 -1
- package/dist/fernwell.cjs +5 -5
- package/dist/fernwell.cjs.map +4 -4
- package/dist/fernwell.css +212 -20
- package/dist/fernwell.esm.js +5 -5
- package/dist/fernwell.esm.js.map +4 -4
- package/dist/fernwell.iife.js +5 -5
- package/dist/fernwell.iife.js.map +4 -4
- package/dist/fernwell.min.css +2 -2
- package/dist/fernwell.tokens.css +22 -1
- package/dist/icon.d.cts +14 -0
- package/dist/icon.d.ts +14 -0
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/number.d.cts +31 -0
- package/dist/number.d.ts +31 -0
- package/dist/tokens.json +12 -0
- package/package.json +1 -1
package/dist/fernwell.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fernwell v0.
|
|
1
|
+
/*! fernwell v0.6.1 | MIT | https://github.com/JacobKnaack/fernwell */
|
|
2
2
|
/* src/css/tokens.css */
|
|
3
3
|
@layer fw-tokens {
|
|
4
4
|
:root,
|
|
@@ -66,6 +66,16 @@
|
|
|
66
66
|
--fw-shadow-lg: 0 12px 32px rgba(31, 36, 48, 0.12), 0 4px 8px rgba(31, 36, 48, 0.06);
|
|
67
67
|
--fw-shadow-primary: 0 6px 16px color-mix(in srgb, var(--fw-primary) 35%, transparent);
|
|
68
68
|
--fw-shadow-success: 0 6px 16px color-mix(in srgb, var(--fw-success) 28%, transparent);
|
|
69
|
+
--fw-icon-size-xs: 14px;
|
|
70
|
+
--fw-icon-size-sm: 18px;
|
|
71
|
+
--fw-icon-size-md: 22px;
|
|
72
|
+
--fw-icon-size-lg: 28px;
|
|
73
|
+
--fw-icon-size-xl: 36px;
|
|
74
|
+
--fw-icon-stroke-xs: 1.75;
|
|
75
|
+
--fw-icon-stroke-sm: 1.5;
|
|
76
|
+
--fw-icon-stroke-md: 1.4;
|
|
77
|
+
--fw-icon-stroke-lg: 1.3;
|
|
78
|
+
--fw-icon-stroke-xl: 1.2;
|
|
69
79
|
--fw-border-w: 1.5px;
|
|
70
80
|
--fw-motion-fast: 120ms;
|
|
71
81
|
--fw-motion-base: 180ms;
|
|
@@ -108,6 +118,17 @@
|
|
|
108
118
|
--fw-shadow-primary: 0 6px 16px color-mix(in srgb, var(--fw-primary) 22%, transparent);
|
|
109
119
|
--fw-shadow-success: 0 6px 16px color-mix(in srgb, var(--fw-success) 22%, transparent);
|
|
110
120
|
}
|
|
121
|
+
@media (min-width: 640px) {
|
|
122
|
+
:root,
|
|
123
|
+
[data-theme=light],
|
|
124
|
+
[data-theme=dark] {
|
|
125
|
+
--fw-icon-size-xs: 12px;
|
|
126
|
+
--fw-icon-size-sm: 16px;
|
|
127
|
+
--fw-icon-size-md: 20px;
|
|
128
|
+
--fw-icon-size-lg: 24px;
|
|
129
|
+
--fw-icon-size-xl: 32px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
/* src/css/base.css */
|
|
@@ -444,15 +465,15 @@ html:has(body.fw-scroll-lock) {
|
|
|
444
465
|
box-shadow: var(--fw-focus-ring);
|
|
445
466
|
}
|
|
446
467
|
.fw-icon-btn svg {
|
|
447
|
-
width: 15px;
|
|
448
|
-
height: 15px;
|
|
468
|
+
width: var(--fw-icon-size, 15px);
|
|
469
|
+
height: var(--fw-icon-size, 15px);
|
|
449
470
|
}
|
|
450
471
|
|
|
451
472
|
/* src/css/components/icon.css */
|
|
452
473
|
.fw-icon {
|
|
453
474
|
display: inline-flex;
|
|
454
|
-
width: 1em;
|
|
455
|
-
height: 1em;
|
|
475
|
+
width: var(--fw-icon-size, 1em);
|
|
476
|
+
height: var(--fw-icon-size, 1em);
|
|
456
477
|
color: inherit;
|
|
457
478
|
vertical-align: -0.125em;
|
|
458
479
|
}
|
|
@@ -460,6 +481,36 @@ html:has(body.fw-scroll-lock) {
|
|
|
460
481
|
width: 100%;
|
|
461
482
|
height: 100%;
|
|
462
483
|
display: block;
|
|
484
|
+
stroke-width: var(--fw-icon-stroke, 1.4);
|
|
485
|
+
}
|
|
486
|
+
.fw-icon-xs {
|
|
487
|
+
--fw-icon-size: var(--fw-icon-size-xs);
|
|
488
|
+
--fw-icon-stroke: var(--fw-icon-stroke-xs);
|
|
489
|
+
}
|
|
490
|
+
.fw-icon-sm {
|
|
491
|
+
--fw-icon-size: var(--fw-icon-size-sm);
|
|
492
|
+
--fw-icon-stroke: var(--fw-icon-stroke-sm);
|
|
493
|
+
}
|
|
494
|
+
.fw-icon-md {
|
|
495
|
+
--fw-icon-size: var(--fw-icon-size-md);
|
|
496
|
+
--fw-icon-stroke: var(--fw-icon-stroke-md);
|
|
497
|
+
}
|
|
498
|
+
.fw-icon-lg {
|
|
499
|
+
--fw-icon-size: var(--fw-icon-size-lg);
|
|
500
|
+
--fw-icon-stroke: var(--fw-icon-stroke-lg);
|
|
501
|
+
}
|
|
502
|
+
.fw-icon-xl {
|
|
503
|
+
--fw-icon-size: var(--fw-icon-size-xl);
|
|
504
|
+
--fw-icon-stroke: var(--fw-icon-stroke-xl);
|
|
505
|
+
}
|
|
506
|
+
.fw-icon.fw-icon-stroke-thin {
|
|
507
|
+
--fw-icon-stroke: 1;
|
|
508
|
+
}
|
|
509
|
+
.fw-icon.fw-icon-stroke-regular {
|
|
510
|
+
--fw-icon-stroke: 1.4;
|
|
511
|
+
}
|
|
512
|
+
.fw-icon.fw-icon-stroke-bold {
|
|
513
|
+
--fw-icon-stroke: 2;
|
|
463
514
|
}
|
|
464
515
|
|
|
465
516
|
/* src/css/components/card.css */
|
|
@@ -807,6 +858,161 @@ textarea.fw-input,
|
|
|
807
858
|
opacity: 0.5;
|
|
808
859
|
}
|
|
809
860
|
|
|
861
|
+
/* src/css/components/number.css */
|
|
862
|
+
.fw-number {
|
|
863
|
+
display: flex;
|
|
864
|
+
align-items: stretch;
|
|
865
|
+
gap: var(--fw-sp-2);
|
|
866
|
+
width: 100%;
|
|
867
|
+
max-width: 320px;
|
|
868
|
+
font-family: var(--fw-font-body);
|
|
869
|
+
}
|
|
870
|
+
.fw-number-stepper .fw-number-input {
|
|
871
|
+
flex: 1;
|
|
872
|
+
min-width: 0;
|
|
873
|
+
text-align: center;
|
|
874
|
+
font-variant-numeric: tabular-nums;
|
|
875
|
+
appearance: textfield;
|
|
876
|
+
-moz-appearance: textfield;
|
|
877
|
+
}
|
|
878
|
+
.fw-number-stepper .fw-number-input::-webkit-inner-spin-button,
|
|
879
|
+
.fw-number-stepper .fw-number-input::-webkit-outer-spin-button {
|
|
880
|
+
-webkit-appearance: none;
|
|
881
|
+
margin: 0;
|
|
882
|
+
}
|
|
883
|
+
.fw-number-btn {
|
|
884
|
+
--fw-icon-size: var(--fw-icon-size-sm);
|
|
885
|
+
--fw-icon-stroke: var(--fw-icon-stroke-sm);
|
|
886
|
+
flex: 0 0 auto;
|
|
887
|
+
width: 44px;
|
|
888
|
+
padding: 0;
|
|
889
|
+
display: inline-flex;
|
|
890
|
+
align-items: center;
|
|
891
|
+
justify-content: center;
|
|
892
|
+
border-radius: var(--fw-r-sm);
|
|
893
|
+
border: var(--fw-border-w) solid var(--fw-bg-dim);
|
|
894
|
+
background: var(--fw-surface);
|
|
895
|
+
color: var(--fw-text-soft);
|
|
896
|
+
cursor: pointer;
|
|
897
|
+
user-select: none;
|
|
898
|
+
touch-action: manipulation;
|
|
899
|
+
transition:
|
|
900
|
+
border-color var(--fw-motion-fast) var(--fw-motion-ease),
|
|
901
|
+
color var(--fw-motion-fast) var(--fw-motion-ease),
|
|
902
|
+
background var(--fw-motion-base) var(--fw-motion-ease);
|
|
903
|
+
}
|
|
904
|
+
.fw-number-btn:hover {
|
|
905
|
+
border-color: var(--fw-secondary);
|
|
906
|
+
color: var(--fw-secondary);
|
|
907
|
+
}
|
|
908
|
+
.fw-number-btn:focus-visible {
|
|
909
|
+
outline: none;
|
|
910
|
+
box-shadow: var(--fw-focus-ring);
|
|
911
|
+
}
|
|
912
|
+
.fw-number-btn[aria-disabled=true] {
|
|
913
|
+
background: var(--fw-bg-dim);
|
|
914
|
+
border-color: var(--fw-bg-dim);
|
|
915
|
+
color: var(--fw-text-soft);
|
|
916
|
+
cursor: not-allowed;
|
|
917
|
+
}
|
|
918
|
+
.fw-number-slider {
|
|
919
|
+
align-items: center;
|
|
920
|
+
gap: var(--fw-sp-3);
|
|
921
|
+
}
|
|
922
|
+
.fw-number .fw-number-input[type=range],
|
|
923
|
+
.fw-field .fw-number .fw-number-input[type=range] {
|
|
924
|
+
flex: 1;
|
|
925
|
+
min-width: 0;
|
|
926
|
+
height: 24px;
|
|
927
|
+
margin: 0;
|
|
928
|
+
padding: 0;
|
|
929
|
+
border: 0;
|
|
930
|
+
border-radius: 0;
|
|
931
|
+
background: transparent;
|
|
932
|
+
box-shadow: none;
|
|
933
|
+
cursor: pointer;
|
|
934
|
+
outline: none;
|
|
935
|
+
appearance: none;
|
|
936
|
+
-webkit-appearance: none;
|
|
937
|
+
}
|
|
938
|
+
.fw-number-input[type=range]::-webkit-slider-runnable-track {
|
|
939
|
+
height: 6px;
|
|
940
|
+
border-radius: var(--fw-r-full);
|
|
941
|
+
background:
|
|
942
|
+
linear-gradient(
|
|
943
|
+
to right,
|
|
944
|
+
var(--fw-primary) var(--fw-number-fill, 0%),
|
|
945
|
+
var(--fw-bg-dim) var(--fw-number-fill, 0%));
|
|
946
|
+
}
|
|
947
|
+
.fw-number-input[type=range]::-moz-range-track {
|
|
948
|
+
height: 6px;
|
|
949
|
+
border-radius: var(--fw-r-full);
|
|
950
|
+
background: var(--fw-bg-dim);
|
|
951
|
+
}
|
|
952
|
+
.fw-number-input[type=range]::-moz-range-progress {
|
|
953
|
+
height: 6px;
|
|
954
|
+
border-radius: var(--fw-r-full);
|
|
955
|
+
background: var(--fw-primary);
|
|
956
|
+
}
|
|
957
|
+
.fw-number-input[type=range]::-webkit-slider-thumb {
|
|
958
|
+
-webkit-appearance: none;
|
|
959
|
+
width: 22px;
|
|
960
|
+
height: 22px;
|
|
961
|
+
margin-top: -8px;
|
|
962
|
+
border-radius: var(--fw-r-full);
|
|
963
|
+
border: var(--fw-border-w) solid var(--fw-primary);
|
|
964
|
+
background: var(--fw-surface);
|
|
965
|
+
box-shadow: var(--fw-shadow-sm);
|
|
966
|
+
transition: box-shadow var(--fw-motion-fast) var(--fw-motion-ease);
|
|
967
|
+
}
|
|
968
|
+
.fw-number-input[type=range]::-moz-range-thumb {
|
|
969
|
+
box-sizing: border-box;
|
|
970
|
+
width: 22px;
|
|
971
|
+
height: 22px;
|
|
972
|
+
border-radius: var(--fw-r-full);
|
|
973
|
+
border: var(--fw-border-w) solid var(--fw-primary);
|
|
974
|
+
background: var(--fw-surface);
|
|
975
|
+
box-shadow: var(--fw-shadow-sm);
|
|
976
|
+
transition: box-shadow var(--fw-motion-fast) var(--fw-motion-ease);
|
|
977
|
+
}
|
|
978
|
+
.fw-number-input[type=range]:focus-visible::-webkit-slider-thumb {
|
|
979
|
+
box-shadow: var(--fw-focus-ring);
|
|
980
|
+
}
|
|
981
|
+
.fw-number-input[type=range]:focus-visible::-moz-range-thumb {
|
|
982
|
+
box-shadow: var(--fw-focus-ring);
|
|
983
|
+
}
|
|
984
|
+
.fw-number-input[type=range]:disabled {
|
|
985
|
+
cursor: not-allowed;
|
|
986
|
+
}
|
|
987
|
+
.fw-number-input[type=range]:disabled::-webkit-slider-runnable-track {
|
|
988
|
+
background: var(--fw-bg-dim);
|
|
989
|
+
}
|
|
990
|
+
.fw-number-input[type=range]:disabled::-moz-range-progress {
|
|
991
|
+
background: var(--fw-bg-dim);
|
|
992
|
+
}
|
|
993
|
+
.fw-number-input[type=range]:disabled::-webkit-slider-thumb {
|
|
994
|
+
border-color: var(--fw-bg-dim);
|
|
995
|
+
}
|
|
996
|
+
.fw-number-input[type=range]:disabled::-moz-range-thumb {
|
|
997
|
+
border-color: var(--fw-bg-dim);
|
|
998
|
+
}
|
|
999
|
+
.fw-number-value {
|
|
1000
|
+
flex: 0 0 auto;
|
|
1001
|
+
min-width: 4ch;
|
|
1002
|
+
text-align: right;
|
|
1003
|
+
font-family: var(--fw-font-mono);
|
|
1004
|
+
font-size: 14px;
|
|
1005
|
+
font-variant-numeric: tabular-nums;
|
|
1006
|
+
color: var(--fw-text-soft);
|
|
1007
|
+
}
|
|
1008
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1009
|
+
.fw-number-btn,
|
|
1010
|
+
.fw-number-input[type=range]::-webkit-slider-thumb,
|
|
1011
|
+
.fw-number-input[type=range]::-moz-range-thumb {
|
|
1012
|
+
transition: none;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
|
|
810
1016
|
/* src/css/components/combobox.css */
|
|
811
1017
|
.fw-combobox {
|
|
812
1018
|
position: relative;
|
|
@@ -1948,6 +2154,7 @@ textarea.fw-input,
|
|
|
1948
2154
|
}
|
|
1949
2155
|
.fw-table-scroll {
|
|
1950
2156
|
overflow-x: auto;
|
|
2157
|
+
position: relative;
|
|
1951
2158
|
}
|
|
1952
2159
|
.fw-table-scroll:focus-visible {
|
|
1953
2160
|
outline: none;
|
|
@@ -2137,27 +2344,12 @@ th[aria-sort=descending] .fw-table-sort::after {
|
|
|
2137
2344
|
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
2138
2345
|
}
|
|
2139
2346
|
@media (max-width: 560px) {
|
|
2140
|
-
.fw-table {
|
|
2141
|
-
table-layout: fixed;
|
|
2142
|
-
}
|
|
2143
2347
|
.fw-table-select {
|
|
2144
2348
|
width: var(--fw-table-select-w, 44px);
|
|
2145
2349
|
}
|
|
2146
2350
|
.fw-table-actions {
|
|
2147
2351
|
width: var(--fw-table-actions-w, 96px);
|
|
2148
2352
|
}
|
|
2149
|
-
.fw-table td:not(.fw-table-select):not(.fw-table-actions):not(.fw-table-num) {
|
|
2150
|
-
white-space: normal;
|
|
2151
|
-
overflow-wrap: anywhere;
|
|
2152
|
-
}
|
|
2153
|
-
.fw-table-num {
|
|
2154
|
-
overflow: hidden;
|
|
2155
|
-
text-overflow: ellipsis;
|
|
2156
|
-
}
|
|
2157
|
-
.fw-table th {
|
|
2158
|
-
overflow: hidden;
|
|
2159
|
-
text-overflow: ellipsis;
|
|
2160
|
-
}
|
|
2161
2353
|
}
|
|
2162
2354
|
|
|
2163
2355
|
/* src/css/components/tabs.css */
|
package/dist/fernwell.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! fernwell v0.
|
|
2
|
-
var cn=Object.defineProperty;var b=(e,t)=>{for(var n in t)cn(e,n,{get:t[n],enumerable:!0})};var Ae={};b(Ae,{get:()=>ke,getToken:()=>Te,init:()=>He,resetTokens:()=>Ee,set:()=>re,setTokens:()=>W,toggle:()=>kt});var pe={};b(pe,{init:()=>me,render:()=>X});var dn={add:'<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',close:'<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',check:'<polyline points="5,13 10,18 19,7"/>',edit:'<path d="M16.8 3.5a2.1 2.1 0 0 1 3 3L8.5 17.8 4 19l1.2-4.5Z"/><line x1="14.5" y1="5.8" x2="17.7" y2="9"/>',trash:'<path d="M4 7h16"/><path d="M9 7V4.6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1V7"/><path d="M6.5 7l.8 12.4A2 2 0 0 0 9.3 21h5.4a2 2 0 0 0 2-1.6L18 7"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/>',save:'<path d="M5 4a1 1 0 0 1 1-1h9.2a1 1 0 0 1 .7.3l2.8 2.8a1 1 0 0 1 .3.7V20a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4Z"/><path d="M8 3v5h7V3"/><path d="M8 21v-6h8v6"/>',search:'<circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.6" y2="16.6"/>',settings:'<circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/>',download:'<line x1="12" y1="3" x2="12" y2="15"/><polyline points="7,10 12,15 17,10"/><line x1="5" y1="21" x2="19" y2="21"/>',upload:'<line x1="12" y1="15" x2="12" y2="3"/><polyline points="7,8 12,3 17,8"/><line x1="5" y1="21" x2="19" y2="21"/>',share:'<circle cx="6" cy="12" r="2.3"/><circle cx="18" cy="6" r="2.3"/><circle cx="18" cy="18" r="2.3"/><line x1="8.1" y1="10.8" x2="15.9" y2="7.2"/><line x1="8.1" y1="13.2" x2="15.9" y2="16.8"/>',copy:'<rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"/>',menu:'<line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/>',more:'<circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8"/>',bell:'<path d="M6 8a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6"/><path d="M10 20a2 2 0 0 0 4 0"/>',heart:'<path d="M12 20s-7-4.4-9.5-8.5C.8 8 2 4.5 5.5 4.5c2 0 3.5 1 6.5 4 3-3 4.5-4 6.5-4 3.5 0 4.7 3.5 3 7-2.5 4.1-9.5 8.5-9.5 8.5Z"/>',star:'<polygon points="12,3 14.6,9.1 21.2,9.3 16,13.4 17.8,19.8 12,16.3 6.2,19.8 8,13.4 2.8,9.3 9.4,9.1"/>',calendar:'<rect x="3" y="5" width="18" height="16" rx="2"/><line x1="8" y1="3" x2="8" y2="7"/><line x1="16" y1="3" x2="16" y2="7"/><line x1="3" y1="10" x2="21" y2="10"/>',refresh:'<path d="M20 11A8 8 0 0 0 6.3 6.3L4 8.6"/><path d="M4 4v5h5"/><path d="M4 13a8 8 0 0 0 13.7 4.7L20 15.4"/><path d="M20 20v-5h-5"/>',filter:'<polygon points="4,4 20,4 14,12 14,19 10,21 10,12"/>',info:'<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><circle cx="12" cy="8" r="1" fill="currentColor" stroke="none"/>',warning:'<path d="M12 3 22 20H2Z"/><line x1="12" y1="9.5" x2="12" y2="14.5"/><circle cx="12" cy="17.3" r="1" fill="currentColor" stroke="none"/>',lock:'<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',eye:'<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',"chevron-down":'<polyline points="6,9 12,15 18,9"/>',"arrow-left":'<line x1="19" y1="12" x2="5" y2="12"/><polyline points="12,5 5,12 12,19"/>',"arrow-right":'<line x1="5" y1="12" x2="19" y2="12"/><polyline points="12,5 19,12 12,19"/>',folder:'<path d="M3.5 6.5a1 1 0 0 1 1-1H10l2 2.2h7.5a1 1 0 0 1 1 1V18a1 1 0 0 1-1 1H4.5a1 1 0 0 1-1-1Z"/>',bookmark:'<path d="M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1Z"/>',home:'<path d="M4 11.5 12 4l8 7.5"/><path d="M6 10v10a1 1 0 0 0 1 1h3.5v-6h2.8v6H17a1 1 0 0 0 1-1V10"/>',logout:'<path d="M9 4H5.5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1H9"/><line x1="14" y1="12" x2="21" y2="12"/><polyline points="17.5,8.5 21,12 17.5,15.5"/>',paperclip:'<path d="M21 11.5 12.4 20a4.3 4.3 0 0 1-6-6.1L15 5.3a2.9 2.9 0 0 1 4.1 4.1l-8.6 8.6a1.4 1.4 0 0 1-2-2l7.9-7.9"/>',envelope:'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 6.5 12 13l8-6.5"/>',"chevron-up":'<polyline points="6,15 12,9 18,15"/>',"chevron-left":'<polyline points="15,6 9,12 15,18"/>',"chevron-right":'<polyline points="9,6 15,12 9,18"/>',"arrow-up":'<line x1="12" y1="19" x2="12" y2="5"/><polyline points="5,12 12,5 19,12"/>',"arrow-down":'<line x1="12" y1="5" x2="12" y2="19"/><polyline points="5,12 12,19 19,12"/>',unlock:'<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.8-1.3"/>',"thumbs-up":'<path d="M7 11v9H4.5a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1H7Z"/><path d="M7 11l4.3-7.3a1.4 1.4 0 0 1 2.6.8L13 9h5.6a2 2 0 0 1 1.9 2.6l-2 6.5A2 2 0 0 1 16.6 19.5H10a3 3 0 0 1-3-3"/>',"thumbs-down":'<path d="M7 13V4h2.5a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7Z"/><path d="M7 13l4.3 7.3a1.4 1.4 0 0 0 2.6-.8L13 15h5.6a2 2 0 0 0 1.9-2.6l-2-6.5A2 2 0 0 0 16.6 4.5H10a3 3 0 0 0-3 3"/>',"eye-closed":'<path d="M3.5 12S7 6 12 6s8.5 6 8.5 6-3.5 6-8.5 6-8.5-6-8.5-6Z"/><line x1="4" y1="19" x2="20" y2="5"/>',"help-circle":'<circle cx="12" cy="12" r="9"/><path d="M9.2 9.2a2.8 2.8 0 1 1 4.3 2.4c-.9.6-1.5 1.1-1.5 2.2"/><circle cx="12" cy="17" r="1" fill="currentColor" stroke="none"/>',chat:'<path d="M4 5.5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9.5L5 20.5V16.5H5a1 1 0 0 1-1-1Z"/>',kebab:'<circle cx="12" cy="5" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="19" r="1.4" fill="currentColor" stroke="none"/>',sun:'<circle cx="12" cy="12" r="4"/><line x1="12" y1="2" x2="12" y2="4.5"/><line x1="12" y1="19.5" x2="12" y2="22"/><line x1="2" y1="12" x2="4.5" y2="12"/><line x1="19.5" y1="12" x2="22" y2="12"/><line x1="4.9" y1="4.9" x2="6.6" y2="6.6"/><line x1="17.4" y1="17.4" x2="19.1" y2="19.1"/><line x1="4.9" y1="19.1" x2="6.6" y2="17.4"/><line x1="17.4" y1="6.6" x2="19.1" y2="4.9"/>',moon:'<path d="M20.5 14.2A8.5 8.5 0 1 1 9.8 3.5a7 7 0 0 0 10.7 10.7Z"/>'};function X(e){let t=dn[e];return t?`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${t}</svg>`:""}function me(e=document){e.querySelectorAll("[data-fw-icon]").forEach(t=>{var r;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=(r=t.dataset.fwIcon)!=null?r:"",o=X(n);o||console.warn(`fernwell: unknown icon "${n}"`),t.innerHTML=o,t.classList.add("fw-icon")})}var Le={};b(Le,{getToken:()=>Te,init:()=>xe,resetTokens:()=>Ee,restoreTokens:()=>gt,setTokens:()=>W});var ut=[{name:"primary-hover",light:"color-mix(in srgb, var(--fw-primary), var(--fw-text) 12%)",dark:"color-mix(in srgb, var(--fw-primary), var(--fw-text) 12%)",deps:["primary","text"]},{name:"primary-soft",light:"color-mix(in srgb, var(--fw-primary), white 35%)",dark:"color-mix(in srgb, var(--fw-primary), white 35%)",deps:["primary"]},{name:"secondary-hover",light:"color-mix(in srgb, var(--fw-secondary), var(--fw-text) 15%)",dark:"color-mix(in srgb, var(--fw-secondary), var(--fw-text) 15%)",deps:["secondary","text"]},{name:"secondary-bg",light:"color-mix(in srgb, var(--fw-secondary) 10%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-secondary) 16%, transparent)",deps:["secondary","surface"]},{name:"success-bg",light:"color-mix(in srgb, var(--fw-success) 12%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-success) 14%, transparent)",deps:["success","surface"]},{name:"warning-bg",light:"color-mix(in srgb, var(--fw-warning) 14%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-warning) 16%, transparent)",deps:["warning","surface"]},{name:"danger-bg",light:"color-mix(in srgb, var(--fw-danger) 13%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-danger) 14%, transparent)",deps:["danger","surface"]},{name:"info-bg",light:"color-mix(in srgb, var(--fw-info) 12%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-info) 14%, transparent)",deps:["info","surface"]},{name:"on-secondary-soft",light:"color-mix(in srgb, var(--fw-on-secondary) 72%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 72%, transparent)",deps:["on-secondary"]},{name:"on-secondary-fill",light:"color-mix(in srgb, var(--fw-on-secondary) 10%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 10%, transparent)",deps:["on-secondary"]},{name:"on-secondary-line",light:"color-mix(in srgb, var(--fw-on-secondary) 16%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 16%, transparent)",deps:["on-secondary"]},{name:"focus-ring",light:"0 0 0 4px color-mix(in srgb, var(--fw-primary) 25%, transparent)",dark:"0 0 0 4px color-mix(in srgb, var(--fw-primary) 25%, transparent)",deps:["primary"]},{name:"scrollbar-thumb",light:"var(--fw-text-soft)",dark:"var(--fw-text-soft)",deps:["text-soft"]},{name:"scrollbar-thumb-hover",light:"color-mix(in srgb, var(--fw-text-soft), var(--fw-text) 15%)",dark:"color-mix(in srgb, var(--fw-text-soft), var(--fw-text) 15%)",deps:["text-soft","text"]},{name:"shadow-primary",light:"0 6px 16px color-mix(in srgb, var(--fw-primary) 35%, transparent)",dark:"0 6px 16px color-mix(in srgb, var(--fw-primary) 22%, transparent)",deps:["primary"]},{name:"shadow-success",light:"0 6px 16px color-mix(in srgb, var(--fw-success) 28%, transparent)",dark:"0 6px 16px color-mix(in srgb, var(--fw-success) 22%, transparent)",deps:["success"]}];var K="--fw-",ft="data-fw-tokens",ve="fw-tokens",mt="fw-tokens-css",un="fw:tokenschange",ne=":root",k=new Map,Q=new Map,oe=!1,fn=0,_=new Map,ye=new WeakSet;function Tt(){try{return window.localStorage}catch{return null}}function xt(e){return e.startsWith("--")?e:`${K}${e}`}function mn(e){return e.startsWith(K)?e.slice(K.length):e}function ee(e){console.warn(`fernwell: ${e}`)}function Lt(e){try{return document.querySelector(e),!0}catch{return!1}}function pn(e){let t=0,n="";for(let o=0;o<e.length;o++){let r=e[o];if(r==="\\")o++;else if(n){if(r===n)n="";else if(r===`
|
|
3
|
-
`)return!1}else if(r==='"'||r==="'")n=r;else if(r==="(")t++;else if(r===")"&&--t<0)return!1}return t===0&&!n}function
|
|
4
|
-
`))}catch{}}function
|
|
5
|
-
`),document.dispatchEvent(new CustomEvent(un,{detail:{scope:e}}))}function wt(e,t){let n=new Map(Object.keys(t).map(o=>[o,o in e?e[o]:void 0]));return Object.assign(e,t),()=>n.forEach((o,r)=>{e[r]===t[r]&&(o===void 0?delete e[r]:e[r]=o)})}function W(e,t={}){var a,u;let n=(a=t.scope)!=null?a:ne;if(!Lt(n))return ee(`ignoring tokens for invalid scope "${n}"`),()=>{};oe||be();let o,r;vn(e)?(o=V(e.light),r=V(e.dark)):(o=V(e),r={...o});let s=t.persist?k:Q,i=(u=s.get(n))!=null?u:{light:{},dark:{}},l=wt(i.light,o),c=wt(i.dark,r);s.set(n,i),t.persist&&we(),te(n);let d=!1;return()=>{d||(d=!0,l(),c(),!Object.keys(i.light).length&&!Object.keys(i.dark).length&&s.get(n)===i&&s.delete(n),s===k&&we(),te(n))}}function Ee(e){oe||be(),_.forEach((n,o)=>{(!e||n.scope===e)&&_.delete(o)});let t=e?k.delete(e):k.size>0;e?Q.delete(e):(k.clear(),Q.clear()),t&&we(),te(e)}function gt(){be(),te()}function be(){var n;oe=!0,k.clear();let e=null;try{let o=(n=Tt())==null?void 0:n.getItem(ve);o&&(e=JSON.parse(o))}catch{}let t=e==null?void 0:e.scopes;if((e==null?void 0:e.v)===1&&t&&typeof t=="object")for(let[o,r]of Object.entries(t)){if(!Lt(o))continue;let s=V(r==null?void 0:r.light),i=V(r==null?void 0:r.dark);(Object.keys(s).length||Object.keys(i).length)&&k.set(o,{light:s,dark:i})}}function Te(e,t=document.documentElement){return getComputedStyle(t).getPropertyValue(xt(e)).trim()}function yt(e,t){try{let n=JSON.parse(e!=null?e:"");if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n}catch{}return ee(`${t} must be a JSON object of tokens`),null}function yn(){_.forEach((e,t)=>{t.isConnected||(_.delete(t),ye.add(t),e.undo())})}function Et(e){return!!e.dataset.fwTokensBound&&!ye.has(e)}function bt(e,t,n){e.dataset.fwTokensBound="1",ye.delete(e),e.isConnected&&_.set(e,{scope:t,undo:n})}function xe(e=document){oe||gt(),yn(),e.querySelectorAll('script[type="application/json"][data-fw-theme-tokens]').forEach(t=>{var i;if(Et(t))return;let n=yt(t.textContent,"data-fw-theme-tokens");if(t.dataset.fwTokensBound="1",!n)return;let o=t.hasAttribute("data-fw-persist"),r=(i=t.dataset.fwScope)!=null?i:ne,s=W(n,{scope:r,persist:o});o||bt(t,r,s)}),e.querySelectorAll("[data-fw-theme-scope]").forEach(t=>{var s;if(Et(t))return;let n=yt(t.getAttribute("data-fw-theme-scope"),"data-fw-theme-scope");if(t.dataset.fwTokensBound="1",!n)return;let o=(s=t.getAttribute("data-fw-scope-id"))!=null?s:`fw-s${++fn}`;t.setAttribute("data-fw-scope-id",o);let r=`[data-fw-scope-id="${o}"]`;bt(t,r,W(n,{scope:r}))})}var ge="fw-theme",En="fw:themechange",Mt="data-fw-theme-init";function Me(){try{return window.localStorage}catch{return null}}function ke(){var t;let e=document.documentElement.getAttribute("data-theme");return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function re(e,{persist:t=!0}={}){var n;document.documentElement.setAttribute("data-theme",e),t&&((n=Me())==null||n.setItem(ge,e)),document.querySelectorAll("[data-fw-theme-toggle]").forEach(o=>Ht(o,e)),document.dispatchEvent(new CustomEvent(En,{detail:e}))}function kt(){let e=ke()==="dark"?"light":"dark";return re(e),e}function Ht(e,t){e.setAttribute("aria-pressed",String(t==="dark"));let n=t==="dark"?e.dataset.fwThemeIconDark:e.dataset.fwThemeIconLight,o=t==="dark"?e.dataset.fwThemeLabelDark:e.dataset.fwThemeLabelLight;if(n!==void 0){let r=`<span class="fw-icon" aria-hidden="true">${X(n)}</span>`;e.innerHTML=o!==void 0?`${r} ${o}`:r}else o!==void 0&&(e.textContent=o)}function bn(e){let t=typeof requestAnimationFrame=="function"?requestAnimationFrame:n=>setTimeout(n,16);t(()=>t(e))}function He(e=document){var r,s,i,l;let t=(r=Me())==null?void 0:r.getItem(ge),n=t==="dark"||t==="light"?t:ke(),o=document.documentElement;o.setAttribute(Mt,""),re(n,{persist:!1}),bn(()=>o.removeAttribute(Mt)),e.querySelectorAll("[data-fw-theme-toggle]").forEach(c=>{c.dataset.fwBound||(c.dataset.fwBound="1",Ht(c,n),c.addEventListener("click",()=>kt()))}),(l=(s=window.matchMedia)==null?void 0:(i=s.call(window,"(prefers-color-scheme: dark)")).addEventListener)==null||l.call(i,"change",c=>{var d;(d=Me())!=null&&d.getItem(ge)||re(c.matches?"dark":"light",{persist:!1})})}var Oe={};b(Oe,{combobox:()=>At,init:()=>Se});var Tn=0;function Z(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function At(e,t={}){var w,B,C,dt;let n=(w=t.filter)!=null?w:((f,y)=>f.toLowerCase().includes(y)),o=(B=t.emptyText)!=null?B:"No matches",r=(C=t.options)!=null?C:xn(e),s=[],i=-1,l=!1,c=e.getAttribute("list");c&&(e.dataset.fwList=c,e.removeAttribute("list"));let d=(dt=e.closest(".fw-combobox"))!=null?dt:Ln(e),a=document.createElement("ul"),u=`fw-combobox-${++Tn}`;a.className="fw-combobox-list",a.id=u,a.setAttribute("role","listbox"),d.appendChild(a),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",u),e.autocomplete="off";function h(f){s=f,i=-1;let y=e.value.trim().toLowerCase();if(f.length===0){a.innerHTML=`<li class="fw-combobox-empty">${Z(o)}</li>`;return}a.innerHTML=f.map((M,F)=>{let j=y?M.toLowerCase().indexOf(y):-1,ln=j>-1?`${Z(M.slice(0,j))}<b>${Z(M.slice(j,j+y.length))}</b>${Z(M.slice(j+y.length))}`:Z(M);return`<li class="fw-combobox-option" role="option" id="${u}-${F}" data-index="${F}" aria-selected="false">${ln}</li>`}).join("")}function m(){let f=e.value.trim().toLowerCase();h(f?r.filter(y=>n(y,f)):r),a.classList.add("is-open"),e.setAttribute("aria-expanded","true")}function p(){a.classList.remove("is-open"),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),i=-1}function v(f){let y=a.querySelectorAll(".fw-combobox-option");y.forEach(F=>{F.classList.remove("is-active"),F.setAttribute("aria-selected","false")});let M=y[f];M&&(M.classList.add("is-active"),M.setAttribute("aria-selected","true"),M.scrollIntoView({block:"nearest"}),e.setAttribute("aria-activedescendant",M.id)),i=f}function x(f){var y;e.value=f,p(),l=!0,e.focus(),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),l=!1,(y=t.onSelect)==null||y.call(t,f)}let g=()=>{l||m()},E=()=>{l||m()},S=f=>{f.key==="ArrowDown"?(f.preventDefault(),a.classList.contains("is-open")||m(),v(Math.min(i+1,s.length-1))):f.key==="ArrowUp"?(f.preventDefault(),v(Math.max(i-1,0))):f.key==="Enter"?i>-1&&s[i]!==void 0&&(f.preventDefault(),x(s[i])):f.key==="Escape"&&p()},O=f=>{let y=f.target.closest(".fw-combobox-option");y&&(f.preventDefault(),x(s[Number(y.dataset.index)]))},$=f=>{d.contains(f.target)||p()};return e.addEventListener("input",g),e.addEventListener("focus",E),e.addEventListener("keydown",S),a.addEventListener("mousedown",O),document.addEventListener("click",$),{open:m,close:p,setOptions(f){r=f,a.classList.contains("is-open")&&m()},destroy(){e.removeEventListener("input",g),e.removeEventListener("focus",E),e.removeEventListener("keydown",S),a.removeEventListener("mousedown",O),document.removeEventListener("click",$),a.remove(),e.dataset.fwList&&e.setAttribute("list",e.dataset.fwList),delete e.dataset.fwBound}}}function xn(e){var o;let t=(o=e.getAttribute("list"))!=null?o:e.dataset.fwList,n=t?document.getElementById(t):null;return n?Array.from(n.querySelectorAll("option")).map(r=>r.value||r.textContent||""):[]}function Ln(e){var n;let t=document.createElement("div");return t.className="fw-combobox",(n=e.parentNode)==null||n.insertBefore(t,e),t.appendChild(e),t}function Se(e=document){e.querySelectorAll("input[data-fw-combobox]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",At(t))})}var qe={};b(qe,{bindOutsideClickToClose:()=>De,close:()=>D,init:()=>Be,open:()=>Pe,toggle:()=>Mn});var N="is-open",Ot="fw-scroll-lock",I=[],Ce=new WeakMap,gn='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ne(e){return typeof e=="string"?document.getElementById(e):e}function Ie(e){if(e.classList.contains("fw-modal-overlay"))return e;let t=e.id?document.querySelector(`[data-fw-drawer-overlay="${e.id}"]`):null;if(t)return t;let n=e.previousElementSibling;return n instanceof HTMLElement&&n.classList.contains("fw-drawer-overlay")?n:null}function Pe(e,t=(n=>(n=document.activeElement)!=null?n:null)()){var s;let o=Ne(e);if(!o||o.classList.contains(N))return;o.classList.add(N),(s=Ie(o))==null||s.classList.add(N),Ce.set(o,t),I.push(o),document.body.classList.add(Ot),o.dispatchEvent(new CustomEvent("fw:open",{bubbles:!0}));let r=o.querySelector(gn);r?r.focus({preventScroll:!0}):(o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.focus({preventScroll:!0}))}function D(e){var o,r,s;let t=Ne(e);if(!t||!t.classList.contains(N))return;t.classList.remove(N),(o=Ie(t))==null||o.classList.remove(N);let n=I.indexOf(t);n>-1&&I.splice(n,1),I.length===0&&document.body.classList.remove(Ot),t.dispatchEvent(new CustomEvent("fw:close",{bubbles:!0})),(s=(r=Ce.get(t))==null?void 0:r.focus)==null||s.call(r,{preventScroll:!0}),Ce.delete(t)}function Mn(e){let t=Ne(e);t&&(t.classList.contains(N)?D:Pe)(t)}function De(e,t){let n=!1;e.addEventListener("mousedown",o=>{n=o.target===e}),e.addEventListener("click",o=>{o.target===e&&n&&t()})}var St=!1;function Be(e=document){e.querySelectorAll("[data-fw-open-modal], [data-fw-open-drawer]").forEach(t=>{var o,r;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=(r=(o=t.dataset.fwOpenModal)!=null?o:t.dataset.fwOpenDrawer)!=null?r:"";t.addEventListener("click",()=>Pe(n,t))}),e.querySelectorAll(".fw-modal-overlay").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",De(t,()=>D(t)),t.querySelectorAll("[data-fw-close-modal]").forEach(n=>n.addEventListener("click",()=>D(t))))}),e.querySelectorAll(".fw-drawer").forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=Ie(t);n&&De(n,()=>D(t)),t.querySelectorAll("[data-fw-close-drawer]").forEach(o=>o.addEventListener("click",()=>D(t)))}),St||(St=!0,document.addEventListener("keydown",t=>{t.key==="Escape"&&I.length&&D(I[I.length-1])}))}var je={};b(je,{close:()=>ie,init:()=>Fe,open:()=>Ct});var Re="is-open";function Ct(e){let t=$e(e);t&&(t.classList.add(Re),e.setAttribute("aria-expanded","true"))}function ie(e){let t=$e(e);t&&(t.classList.remove(Re),e.setAttribute("aria-expanded","false"))}function $e(e){let t=e.getAttribute("aria-controls");return t?document.getElementById(t):null}function Fe(e=document){e.querySelectorAll("[data-fw-nav-toggle]").forEach(t=>{var r,s;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=$e(t);if(!n)return;let o=(s=(r=t.closest(".fw-nav"))!=null?r:t.parentElement)!=null?s:t;t.addEventListener("click",i=>{i.stopPropagation(),(n.classList.contains(Re)?ie:Ct)(t)}),document.addEventListener("click",i=>{!o.contains(i.target)&&!n.contains(i.target)&&ie(t)}),document.addEventListener("keydown",i=>{i.key==="Escape"&&ie(t)})})}var Ke={};b(Ke,{init:()=>Ve,resetAll:()=>Pt,resetButtonLoading:()=>It,setButtonLoading:()=>Nt});var U="fw-btn-loading";function Nt(e,t){var o,r;if(!e||e.classList.contains(U))return;e.dataset.fwOriginalHtml=e.innerHTML,e.disabled=!0,e.setAttribute("aria-busy","true"),e.classList.add(U);let n=(r=(o=t!=null?t:e.dataset.fwLoadingText)!=null?o:e.textContent)!=null?r:"";e.innerHTML='<span class="fw-spinner fw-spinner-sm" aria-hidden="true"></span>',e.appendChild(document.createTextNode(n))}function It(e){!e||!e.classList.contains(U)||(e.disabled=!1,e.removeAttribute("aria-busy"),e.classList.remove(U),e.dataset.fwOriginalHtml!==void 0&&(e.innerHTML=e.dataset.fwOriginalHtml,delete e.dataset.fwOriginalHtml))}function Pt(e=document){e.querySelectorAll(`.${U}`).forEach(It)}var Dt=!1;function Ve(e=document){e.querySelectorAll("form[data-fw-loading]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",t.addEventListener("submit",()=>{let n=t.querySelector('button[type="submit"], button:not([type])');Nt(n)}))}),Dt||(Dt=!0,window.addEventListener("pageshow",t=>{t.persisted&&Pt()}))}var _e={};b(_e,{hide:()=>Bt,show:()=>Hn});var T=null,q=null;function kn(){return T&&T.isConnected||(T=document.createElement("div"),T.className="fw-toast",T.setAttribute("role","status"),T.setAttribute("aria-live","polite"),T.innerHTML='<span class="fw-toast-dot" aria-hidden="true"></span><span class="fw-toast-text"></span>',document.body.appendChild(T)),T}function Hn(e,{variant:t="success",duration:n=4e3}={}){let o=kn();return o.className=`fw-toast${t==="success"?"":` fw-toast-${t}`}`,o.querySelector(".fw-toast-text").textContent=e,q&&clearTimeout(q),o.classList.remove("is-show"),o.offsetWidth,o.classList.add("is-show"),n>0&&(q=setTimeout(Bt,n)),o}function Bt(){T==null||T.classList.remove("is-show"),q&&clearTimeout(q),q=null}var Ye={};b(Ye,{getSelected:()=>ze,init:()=>Je,selectAll:()=>jt,setRowSelected:()=>Ft,sort:()=>We});var An="is-selected";function Ze(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function qt(e,t){var o,r,s;let n=e.cells[t];return(s=(r=n==null?void 0:n.dataset.fwSortValue)!=null?r:(o=n==null?void 0:n.textContent)==null?void 0:o.trim())!=null?s:""}function Sn(e,t){let n=Number(e),o=Number(t);return e!==""&&t!==""&&Number.isFinite(n)&&Number.isFinite(o)?n-o:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function $t(e){var t,n;return Array.from((n=(t=e.tHead)==null?void 0:t.querySelectorAll("th[data-fw-sort]"))!=null?n:[])}function Rt(e){return e.getAttribute("aria-sort")==="ascending"?"descending":"ascending"}function We(e,t,n){let o=e.tBodies[0];if(!o)return;let r=Array.from(o.rows),s=r.filter(d=>d.cells.length>t),i=r.filter(d=>d.cells.length<=t),l=n==="ascending"?1:-1;s.sort((d,a)=>l*Sn(qt(d,t),qt(a,t))),[...s,...i].forEach(d=>o.appendChild(d));let c=null;$t(e).forEach(d=>{let a=d.cellIndex===t;d.setAttribute("aria-sort",a?n:"none"),a&&(c=d)}),c&&Ze(e,"fw:sort",{column:t,direction:n,th:c})}function se(e){return Array.from(e.querySelectorAll("tbody input[data-fw-select-row]"))}function Ue(e,t){e.classList.toggle(An,t),e.setAttribute("aria-selected",t?"true":"false")}function Ge(e){let t=e.querySelector("[data-fw-select-all]");if(!t)return;let n=se(e),o=n.filter(r=>r.checked).length;t.checked=o>0&&o===n.length,t.indeterminate=o>0&&o<n.length}function ze(e){return se(e).filter(t=>t.checked).map(t=>t.closest("tr")).filter(t=>t!==null)}function Ft(e,t){let n=e.querySelector("input[data-fw-select-row]");n&&(n.checked=t),Ue(e,t);let o=e.closest("table");o&&(Ge(o),Ze(o,"fw:select",{rows:ze(o),all:!1}))}function jt(e,t){se(e).forEach(n=>{n.checked=t;let o=n.closest("tr");o&&Ue(o,t)}),Ge(e),Ze(e,"fw:select",{rows:ze(e),all:!0})}function Je(e=document){e.querySelectorAll("table[data-fw-table]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",$t(t).forEach(n=>{n.hasAttribute("aria-sort")||n.setAttribute("aria-sort","none")}),t.addEventListener("click",n=>{let o=n.target.closest("th[data-fw-sort]");o&&t.contains(o)&&We(t,o.cellIndex,Rt(o))}),t.addEventListener("keydown",n=>{if(n.key!=="Enter"&&n.key!==" ")return;let o=n.target;if(!o.matches("th[data-fw-sort], th[data-fw-sort] .fw-table-sort"))return;let r=o.closest("th[data-fw-sort]");r&&(n.preventDefault(),We(t,r.cellIndex,Rt(r)))}),t.addEventListener("change",n=>{let o=n.target;if(o.matches("[data-fw-select-all]"))jt(t,o.checked);else if(o.matches("[data-fw-select-row]")){let r=o.closest("tr");r&&Ft(r,o.checked)}}),se(t).forEach(n=>{let o=n.closest("tr");o&&n.checked&&Ue(o,!0)}),Ge(t))})}var Qe={};b(Qe,{close:()=>le,collapseAll:()=>In,expandAll:()=>Nn,init:()=>Xe,open:()=>ae,reveal:()=>_t,toggle:()=>Dn});var H=".fw-menu-group",Kt=".fw-menu-link, .fw-menu-summary",On="is-current";function Cn(e,t){e.dispatchEvent(new CustomEvent("fw:toggle",{bubbles:!0,detail:t}))}function ae(e){e.open=!0}function le(e){e.open=!1}function Dn(e,t){e.open=t!=null?t:!e.open}function Nn(e){e.querySelectorAll(H).forEach(ae)}function In(e){e.querySelectorAll(H).forEach(le)}function _t(e){var n,o,r,s;let t=(o=(n=e.parentElement)==null?void 0:n.closest(H))!=null?o:null;for(;t;)ae(t),t=(s=(r=t.parentElement)==null?void 0:r.closest(H))!=null?s:null}function Vt(e){e.querySelectorAll(H).forEach(t=>{let n=t.querySelector(":scope > .fw-menu-summary");if(!n)return;let o=!t.open&&t.querySelector("[aria-current]")!==null;n.classList.toggle(On,o)})}function Wt(e){return e.matches(".fw-menu-summary")?e.closest(H):null}function Zt(e){var n,o,r;return(r=(o=((n=Wt(e))!=null?n:e).parentElement)==null?void 0:o.closest(H))!=null?r:null}function Pn(e){var t,n;for(let o=Zt(e);o;o=(n=(t=o.parentElement)==null?void 0:t.closest(H))!=null?n:null)if(!o.open)return!1;return!0}function Bn(e){return Array.from(e.querySelectorAll(Kt)).filter(Pn)}function P(e){return e?(e.focus(),!0):!1}function qn(e){var n;let t=e.closest(".fw-menu-split");return(n=t==null?void 0:t.querySelector(":scope > .fw-menu-group > .fw-menu-summary"))!=null?n:null}function Rn(e,t){var l;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;let n=t.target instanceof HTMLElement&&t.target.matches(Kt)?t.target:null;if(!n||!e.contains(n))return;let o=Bn(e),r=o.indexOf(n),s=Wt(n),i=!0;switch(t.key){case"ArrowDown":P(o[r+1]);break;case"ArrowUp":P(o[r-1]);break;case"Home":P(o[0]);break;case"End":P(o[o.length-1]);break;case"ArrowRight":s?s.open?s.contains((l=o[r+1])!=null?l:e)&&P(o[r+1]):ae(s):P(qn(n));break;case"ArrowLeft":if(s!=null&&s.open)le(s);else{let c=Zt(n);P(c==null?void 0:c.querySelector(":scope > .fw-menu-summary"))}break;default:i=!1}i&&t.preventDefault()}function Xe(e=document){e.querySelectorAll("[data-fw-menu]").forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=t.hasAttribute("data-fw-menu-exclusive");t.addEventListener("toggle",o=>{let r=o.target;!(r instanceof HTMLDetailsElement)||!r.matches(H)||(n&&r.open&&r.parentElement&&Array.from(r.parentElement.children).forEach(s=>{s!==r&&s instanceof HTMLDetailsElement&&s.matches(H)&&le(s)}),Vt(t),Cn(r,{group:r,open:r.open}))},!0),t.addEventListener("keydown",o=>Rn(t,o)),t.querySelectorAll("[aria-current]").forEach(_t),Vt(t)})}var nt={};b(nt,{init:()=>tt,popover:()=>Jt});var $n={top:"bottom",bottom:"top",left:"right",right:"left"},R=10;function Fn(e){switch(e){case"top-left":return{side:"top",align:"end"};case"top-right":return{side:"top",align:"start"};case"bottom-left":return{side:"bottom",align:"end"};case"bottom-right":return{side:"bottom",align:"start"};default:return{side:e,align:"center"}}}var jn={start:"right",end:"left"};function Vn(e,t){return t==="center"?e:`${e}-${jn[t]}`}function et(e,t,n,o){switch(e){case"top":return t.top;case"bottom":return o-t.bottom;case"left":return t.left;case"right":return n-t.right}}function Ut(e,t,n,o){switch(e){case"top":return t.top-o-n.height;case"bottom":return t.bottom+o;case"left":return t.left-o-n.width;case"right":return t.right+o}}function Gt(e,t,n,o){switch(e){case"start":return t;case"end":return t+n-o;case"center":return t+n/2-o/2}}function ce(e,t,n){return Math.min(Math.max(e,t),n>t?n:t)}function de(e,t,n={}){var E,S,O;let o=(E=n.placement)!=null?E:"bottom",r=(S=n.offset)!=null?S:8,s=(O=n.padding)!=null?O:8,i=e.getBoundingClientRect(),l=t.getBoundingClientRect(),c=window.innerWidth,d=window.innerHeight,{side:a,align:u}=Fn(o),h=$n[a],m=a==="top"||a==="bottom"?l.height:l.width,p=et(a,i,c,d)-r<m&&et(h,i,c,d)-r>et(a,i,c,d)-r?h:a,v,x,g;return p==="top"||p==="bottom"?(v=Ut(p,i,l,r),x=ce(Gt(u,i.left,i.width,l.width),s,c-l.width-s),g=ce(i.left+i.width/2-x,R,Math.max(l.width-R,R))):(x=Ut(p,i,l,r),v=ce(Gt("center",i.top,i.height,l.height),s,d-l.height-s),g=ce(i.top+i.height/2-v,R,Math.max(l.height-R,R))),{placement:Vn(p,u),top:v,left:x,arrowOffset:g}}function zt(e,t){let n=i=>!e.some(l=>l.contains(i)),o=!1,r=i=>{o=n(i.target)},s=i=>{o&&n(i.target)&&t()};return document.addEventListener("mousedown",r,!0),document.addEventListener("click",s,!0),()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("click",s,!0)}}var Kn='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Jt(e,t,n={}){var O,$;let o=(O=n.placement)!=null?O:"bottom",r=($=n.offset)!=null?$:8;e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",t.id),e.setAttribute("aria-expanded","false"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.classList.add("fw-popover");let s=t.parentNode,i=t.nextSibling,l=!1,c=null,d=0;function a(){let w=de(e,t,{placement:o,offset:r});t.style.top=`${w.top}px`,t.style.left=`${w.left}px`,t.setAttribute("data-placement",w.placement)}function u(){cancelAnimationFrame(d),d=requestAnimationFrame(a)}function h(w){w.key==="Escape"&&(w.stopPropagation(),v())}function m(w){let B=w.relatedTarget;B&&(t.contains(B)||e.contains(B))||setTimeout(()=>{if(!l)return;let C=document.activeElement;C===document.body||C===null||t.contains(C)||e.contains(C)||v()},0)}function p(){if(l)return;l=!0,t.parentNode!==document.body&&document.body.appendChild(t),a(),t.classList.add("is-open"),e.setAttribute("aria-expanded","true");let w=t.querySelector(Kn);w?w.focus({preventScroll:!0}):(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})),c=zt([e,t],v),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),t.addEventListener("keydown",h),t.addEventListener("focusout",m),t.dispatchEvent(new CustomEvent("fw:open",{bubbles:!0}))}function v(){if(!l)return;l=!1,t.classList.remove("is-open"),e.setAttribute("aria-expanded","false"),c==null||c(),c=null,window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),t.removeEventListener("keydown",h),t.removeEventListener("focusout",m),cancelAnimationFrame(d),i===null||i.parentNode===s?s.insertBefore(t,i):s.appendChild(t),t.dispatchEvent(new CustomEvent("fw:close",{bubbles:!0})),e.focus({preventScroll:!0})}function x(){(l?v:p)()}let g=()=>x(),E=Array.from(t.querySelectorAll("[data-fw-popover-close]")),S=()=>v();return e.addEventListener("click",g),E.forEach(w=>w.addEventListener("click",S)),{open:p,close:v,toggle:x,destroy(){l&&v(),e.removeEventListener("click",g),E.forEach(w=>w.removeEventListener("click",S)),delete e.dataset.fwBound}}}function tt(e=document){e.querySelectorAll("[data-fw-popover-trigger]").forEach(t=>{var r;if(t.dataset.fwBound)return;let n=(r=t.dataset.fwPopoverTrigger)!=null?r:"",o=document.getElementById(n);if(!o){console.warn(`fernwell: popover trigger references missing panel #${n}`);return}t.dataset.fwBound="1",Jt(t,o,{placement:t.dataset.fwPopoverPlacement||void 0,offset:t.dataset.fwPopoverOffset?Number(t.dataset.fwPopoverOffset):void 0})})}var st={};b(st,{init:()=>it,tooltip:()=>nn});var _n=400,Wn=300,Zn=100,z=new WeakMap,L=null,A=null,J=0,Y=0,rt=0,Xt=0;function Un(){if(L&&L.isConnected)return L;let e=document.createElement("div");return e.className="fw-tooltip",e.id="fw-tooltip",e.setAttribute("role","tooltip"),document.body.appendChild(e),e.addEventListener("mouseenter",Qt),e.addEventListener("mouseleave",()=>tn()),L=e,e}function Qt(){clearTimeout(Y)}function en(){if(!A||!L)return;let e=z.get(A);if(!e)return;let t=de(A,L,{placement:e.placement,offset:e.offset});L.style.top=`${t.top}px`,L.style.left=`${t.left}px`,L.style.setProperty("--fw-tooltip-arrow-pos",`${t.arrowOffset}px`),L.setAttribute("data-placement",t.placement)}function ue(){cancelAnimationFrame(rt),rt=requestAnimationFrame(en)}function Yt(e){var o;if(clearTimeout(J),Qt(),!z.get(e))return;A=e;let n=Un();n.textContent=(o=e.dataset.fwTooltipText)!=null?o:"",en(),n.classList.add("is-open"),window.addEventListener("scroll",ue,!0),window.addEventListener("resize",ue)}function G(){clearTimeout(J),clearTimeout(Y),L&&L.classList.remove("is-open"),window.removeEventListener("scroll",ue,!0),window.removeEventListener("resize",ue),cancelAnimationFrame(rt),A&&(Xt=performance.now()),A=null}function ot(e,t){clearTimeout(Y),clearTimeout(J);let n=z.get(e);n&&(t||performance.now()-Xt<Wn?Yt(e):J=window.setTimeout(()=>Yt(e),n.delay))}function tn(){clearTimeout(J),clearTimeout(Y),Y=window.setTimeout(G,Zn)}function nn(e,t={}){var d,a,u;let n={placement:(d=t.placement)!=null?d:"top",offset:(a=t.offset)!=null?a:6,delay:(u=t.delay)!=null?u:_n};z.set(e,n);let o=e.getAttribute("title");o!==null&&(e.dataset.fwTooltipText=o,e.removeAttribute("title")),e.setAttribute("aria-describedby","fw-tooltip");let r=()=>ot(e,!1),s=()=>tn(),i=()=>ot(e,!0),l=()=>{A===e&&G()},c=h=>{h.key==="Escape"&&A===e&&G()};return e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",s),e.addEventListener("focus",i),e.addEventListener("blur",l),e.addEventListener("keydown",c),{show:()=>ot(e,!0),hide:()=>{A===e&&G()},destroy(){A===e&&G(),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",s),e.removeEventListener("focus",i),e.removeEventListener("blur",l),e.removeEventListener("keydown",c),e.removeAttribute("aria-describedby"),e.dataset.fwTooltipText!==void 0&&(e.setAttribute("title",e.dataset.fwTooltipText),delete e.dataset.fwTooltipText),z.delete(e),delete e.dataset.fwBound}}}function it(e=document){e.querySelectorAll("[data-fw-tooltip]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",nn(t,{placement:t.dataset.fwTooltipPlacement||void 0,offset:t.dataset.fwTooltipOffset?Number(t.dataset.fwTooltipOffset):void 0,delay:t.dataset.fwTooltipDelay?Number(t.dataset.fwTooltipDelay):void 0}))})}var ct={};b(ct,{init:()=>lt,tabs:()=>an});function Gn(e,t){e.dispatchEvent(new CustomEvent("fw:tabs-change",{bubbles:!0,detail:t}))}function fe(e){return e.getAttribute("aria-disabled")==="true"}function at(e){let t=e.getAttribute("aria-controls");return t?document.getElementById(t):null}function on(e){return e instanceof Element?e.closest('[role="tab"]'):null}function rn(e,t,n){for(let o=1;o<=e.length;o++){let r=((t+n*o)%e.length+e.length)%e.length;if(!fe(e[r]))return e[r]}}function sn(e){return e.find(t=>!fe(t))}function zn(e){for(let t=e.length-1;t>=0;t--)if(!fe(e[t]))return e[t]}function an(e,t={}){var d;let n=(d=t.activation)!=null?d:"automatic";function o(){return Array.from(e.querySelectorAll('[role="tab"]'))}function r(a,u=!1){if(fe(a))return;o().forEach(m=>{let p=m===a;m.setAttribute("aria-selected",String(p)),m.tabIndex=p?0:-1;let v=at(m);v&&(v.hidden=!p)}),u&&a.focus();let h=at(a);h&&Gn(e,{tab:a,panel:h})}function s(a){o().forEach(u=>{u.tabIndex=u===a?0:-1}),a.focus()}function i(){var h;let a=o(),u=(h=a.find(m=>m.getAttribute("aria-selected")==="true"))!=null?h:sn(a);a.forEach(m=>{let p=m===u;m.setAttribute("aria-selected",String(p)),m.tabIndex=p?0:-1;let v=at(m);v&&(v.hidden=!p)})}function l(a){let u=on(a.target);u&&e.contains(u)&&r(u,!1)}function c(a){let u=on(a.target);if(!u)return;let h=o(),m=h.indexOf(u);if(m===-1)return;if(a.key===" "||a.key==="Enter"){n==="manual"&&(a.preventDefault(),r(u,!1));return}let p=e.getAttribute("aria-orientation")==="vertical",v=getComputedStyle(e).direction==="rtl",x=p?"ArrowDown":v?"ArrowLeft":"ArrowRight",g=p?"ArrowUp":v?"ArrowRight":"ArrowLeft",E;if(a.key===x)E=rn(h,m,1);else if(a.key===g)E=rn(h,m,-1);else if(a.key==="Home")E=sn(h);else if(a.key==="End")E=zn(h);else return;E&&(a.preventDefault(),n==="manual"?s(E):r(E,!0))}return e.addEventListener("click",l),e.addEventListener("keydown",c),i(),{activate:r,destroy(){e.removeEventListener("click",l),e.removeEventListener("keydown",c),delete e.dataset.fwBound}}}function lt(e=document){e.querySelectorAll('[role="tablist"][data-fw-tabs]').forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=t.dataset.fwTabsActivation==="manual"?"manual":"automatic";an(t,{activation:n})})}var Jn="0.5.0";function Yn(e=document){He(e),xe(e),Se(e),Be(e),Fe(e),Ve(e),Je(e),Xe(e),me(e),tt(e),it(e),lt(e)}var Xn={version:Jn,init:Yn,theme:Ae,tokens:Le,combobox:Oe,modal:qe,nav:je,loading:Ke,toast:_e,table:Ye,menu:Qe,icon:pe,popover:nt,tooltip:st,tabs:ct},ao=Xn;export{Oe as combobox,ao as default,pe as icon,Yn as init,Ke as loading,Qe as menu,qe as modal,je as nav,nt as popover,Ye as table,ct as tabs,Ae as theme,_e as toast,Le as tokens,st as tooltip,Jn as version};
|
|
1
|
+
/*! fernwell v0.6.1 | MIT | https://github.com/JacobKnaack/fernwell */
|
|
2
|
+
var Nn=Object.defineProperty;var A=(e,t)=>{for(var n in t)Nn(e,n,{get:t[n],enumerable:!0})};var Be={};A(Be,{get:()=>Ie,getToken:()=>Ae,init:()=>De,resetTokens:()=>ke,set:()=>ue,setTokens:()=>Q,toggle:()=>zt});var xe={};A(xe,{init:()=>Ee,render:()=>F});var Cn={add:'<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',minus:'<line x1="5" y1="12" x2="19" y2="12"/>',close:'<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',check:'<polyline points="5,13 10,18 19,7"/>',edit:'<path d="M16.8 3.5a2.1 2.1 0 0 1 3 3L8.5 17.8 4 19l1.2-4.5Z"/><line x1="14.5" y1="5.8" x2="17.7" y2="9"/>',trash:'<path d="M4 7h16"/><path d="M9 7V4.6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1V7"/><path d="M6.5 7l.8 12.4A2 2 0 0 0 9.3 21h5.4a2 2 0 0 0 2-1.6L18 7"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/>',save:'<path d="M5 4a1 1 0 0 1 1-1h9.2a1 1 0 0 1 .7.3l2.8 2.8a1 1 0 0 1 .3.7V20a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4Z"/><path d="M8 3v5h7V3"/><path d="M8 21v-6h8v6"/>',search:'<circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.6" y2="16.6"/>',settings:'<circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/>',download:'<line x1="12" y1="3" x2="12" y2="15"/><polyline points="7,10 12,15 17,10"/><line x1="5" y1="21" x2="19" y2="21"/>',upload:'<line x1="12" y1="15" x2="12" y2="3"/><polyline points="7,8 12,3 17,8"/><line x1="5" y1="21" x2="19" y2="21"/>',share:'<circle cx="6" cy="12" r="2.3"/><circle cx="18" cy="6" r="2.3"/><circle cx="18" cy="18" r="2.3"/><line x1="8.1" y1="10.8" x2="15.9" y2="7.2"/><line x1="8.1" y1="13.2" x2="15.9" y2="16.8"/>',copy:'<rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1"/>',menu:'<line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/>',more:'<circle cx="5" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="19" cy="12" r="1.4" fill="currentColor" stroke="none"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8"/>',bell:'<path d="M6 8a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6"/><path d="M10 20a2 2 0 0 0 4 0"/>',heart:'<path d="M12 20s-7-4.4-9.5-8.5C.8 8 2 4.5 5.5 4.5c2 0 3.5 1 6.5 4 3-3 4.5-4 6.5-4 3.5 0 4.7 3.5 3 7-2.5 4.1-9.5 8.5-9.5 8.5Z"/>',star:'<polygon points="12,3 14.6,9.1 21.2,9.3 16,13.4 17.8,19.8 12,16.3 6.2,19.8 8,13.4 2.8,9.3 9.4,9.1"/>',calendar:'<rect x="3" y="5" width="18" height="16" rx="2"/><line x1="8" y1="3" x2="8" y2="7"/><line x1="16" y1="3" x2="16" y2="7"/><line x1="3" y1="10" x2="21" y2="10"/>',refresh:'<path d="M20 11A8 8 0 0 0 6.3 6.3L4 8.6"/><path d="M4 4v5h5"/><path d="M4 13a8 8 0 0 0 13.7 4.7L20 15.4"/><path d="M20 20v-5h-5"/>',filter:'<polygon points="4,4 20,4 14,12 14,19 10,21 10,12"/>',info:'<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><circle cx="12" cy="8" r="1" fill="currentColor" stroke="none"/>',warning:'<path d="M12 3 22 20H2Z"/><line x1="12" y1="9.5" x2="12" y2="14.5"/><circle cx="12" cy="17.3" r="1" fill="currentColor" stroke="none"/>',lock:'<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',eye:'<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',"chevron-down":'<polyline points="6,9 12,15 18,9"/>',"arrow-left":'<line x1="19" y1="12" x2="5" y2="12"/><polyline points="12,5 5,12 12,19"/>',"arrow-right":'<line x1="5" y1="12" x2="19" y2="12"/><polyline points="12,5 19,12 12,19"/>',folder:'<path d="M3.5 6.5a1 1 0 0 1 1-1H10l2 2.2h7.5a1 1 0 0 1 1 1V18a1 1 0 0 1-1 1H4.5a1 1 0 0 1-1-1Z"/>',bookmark:'<path d="M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1Z"/>',home:'<path d="M4 11.5 12 4l8 7.5"/><path d="M6 10v10a1 1 0 0 0 1 1h3.5v-6h2.8v6H17a1 1 0 0 0 1-1V10"/>',logout:'<path d="M9 4H5.5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1H9"/><line x1="14" y1="12" x2="21" y2="12"/><polyline points="17.5,8.5 21,12 17.5,15.5"/>',paperclip:'<path d="M21 11.5 12.4 20a4.3 4.3 0 0 1-6-6.1L15 5.3a2.9 2.9 0 0 1 4.1 4.1l-8.6 8.6a1.4 1.4 0 0 1-2-2l7.9-7.9"/>',envelope:'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 6.5 12 13l8-6.5"/>',"chevron-up":'<polyline points="6,15 12,9 18,15"/>',"chevron-left":'<polyline points="15,6 9,12 15,18"/>',"chevron-right":'<polyline points="9,6 15,12 9,18"/>',"arrow-up":'<line x1="12" y1="19" x2="12" y2="5"/><polyline points="5,12 12,5 19,12"/>',"arrow-down":'<line x1="12" y1="5" x2="12" y2="19"/><polyline points="5,12 12,19 19,12"/>',unlock:'<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 7.8-1.3"/>',"thumbs-up":'<path d="M7 11v9H4.5a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1H7Z"/><path d="M7 11l4.3-7.3a1.4 1.4 0 0 1 2.6.8L13 9h5.6a2 2 0 0 1 1.9 2.6l-2 6.5A2 2 0 0 1 16.6 19.5H10a3 3 0 0 1-3-3"/>',"thumbs-down":'<path d="M7 13V4h2.5a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7Z"/><path d="M7 13l4.3 7.3a1.4 1.4 0 0 0 2.6-.8L13 15h5.6a2 2 0 0 0 1.9-2.6l-2-6.5A2 2 0 0 0 16.6 4.5H10a3 3 0 0 0-3 3"/>',"eye-closed":'<path d="M3.5 12S7 6 12 6s8.5 6 8.5 6-3.5 6-8.5 6-8.5-6-8.5-6Z"/><line x1="4" y1="19" x2="20" y2="5"/>',"help-circle":'<circle cx="12" cy="12" r="9"/><path d="M9.2 9.2a2.8 2.8 0 1 1 4.3 2.4c-.9.6-1.5 1.1-1.5 2.2"/><circle cx="12" cy="17" r="1" fill="currentColor" stroke="none"/>',chat:'<path d="M4 5.5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9.5L5 20.5V16.5H5a1 1 0 0 1-1-1Z"/>',kebab:'<circle cx="12" cy="5" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.4" fill="currentColor" stroke="none"/><circle cx="12" cy="19" r="1.4" fill="currentColor" stroke="none"/>',sun:'<circle cx="12" cy="12" r="4"/><line x1="12" y1="2" x2="12" y2="4.5"/><line x1="12" y1="19.5" x2="12" y2="22"/><line x1="2" y1="12" x2="4.5" y2="12"/><line x1="19.5" y1="12" x2="22" y2="12"/><line x1="4.9" y1="4.9" x2="6.6" y2="6.6"/><line x1="17.4" y1="17.4" x2="19.1" y2="19.1"/><line x1="4.9" y1="19.1" x2="6.6" y2="17.4"/><line x1="17.4" y1="6.6" x2="19.1" y2="4.9"/>',moon:'<path d="M20.5 14.2A8.5 8.5 0 1 1 9.8 3.5a7 7 0 0 0 10.7 10.7Z"/>'},At=["xs","sm","md","lg","xl"],St=["thin","regular","bold"];function F(e){let t=Cn[e];return t?`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${t}</svg>`:""}function In(e,t){if(t){if(!At.includes(t)){console.warn(`fernwell: unknown icon size "${t}" (expected ${At.join(", ")})`);return}e.classList.add(`fw-icon-${t}`)}}function Dn(e,t){if(!t)return;if(St.includes(t)){e.classList.add(`fw-icon-stroke-${t}`);return}let n=Number(t);if(!Number.isFinite(n)||n<=0){console.warn(`fernwell: unknown icon stroke "${t}" (expected ${St.join(", ")} or a positive number)`);return}e.style.setProperty("--fw-icon-stroke",String(n))}function Ee(e=document){e.querySelectorAll("[data-fw-icon]").forEach(t=>{var r;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=(r=t.dataset.fwIcon)!=null?r:"",o=F(n);o||console.warn(`fernwell: unknown icon "${n}"`),t.innerHTML=o,t.classList.add("fw-icon"),In(t,t.dataset.fwIconSize),Dn(t,t.dataset.fwIconStroke)})}var Oe={};A(Oe,{getToken:()=>Ae,init:()=>Se,resetTokens:()=>ke,restoreTokens:()=>Kt,setTokens:()=>Q});var Ot=[{name:"primary-hover",light:"color-mix(in srgb, var(--fw-primary), var(--fw-text) 12%)",dark:"color-mix(in srgb, var(--fw-primary), var(--fw-text) 12%)",deps:["primary","text"]},{name:"primary-soft",light:"color-mix(in srgb, var(--fw-primary), white 35%)",dark:"color-mix(in srgb, var(--fw-primary), white 35%)",deps:["primary"]},{name:"secondary-hover",light:"color-mix(in srgb, var(--fw-secondary), var(--fw-text) 15%)",dark:"color-mix(in srgb, var(--fw-secondary), var(--fw-text) 15%)",deps:["secondary","text"]},{name:"secondary-bg",light:"color-mix(in srgb, var(--fw-secondary) 10%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-secondary) 16%, transparent)",deps:["secondary","surface"]},{name:"success-bg",light:"color-mix(in srgb, var(--fw-success) 12%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-success) 14%, transparent)",deps:["success","surface"]},{name:"warning-bg",light:"color-mix(in srgb, var(--fw-warning) 14%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-warning) 16%, transparent)",deps:["warning","surface"]},{name:"danger-bg",light:"color-mix(in srgb, var(--fw-danger) 13%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-danger) 14%, transparent)",deps:["danger","surface"]},{name:"info-bg",light:"color-mix(in srgb, var(--fw-info) 12%, var(--fw-surface))",dark:"color-mix(in srgb, var(--fw-info) 14%, transparent)",deps:["info","surface"]},{name:"on-secondary-soft",light:"color-mix(in srgb, var(--fw-on-secondary) 72%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 72%, transparent)",deps:["on-secondary"]},{name:"on-secondary-fill",light:"color-mix(in srgb, var(--fw-on-secondary) 10%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 10%, transparent)",deps:["on-secondary"]},{name:"on-secondary-line",light:"color-mix(in srgb, var(--fw-on-secondary) 16%, transparent)",dark:"color-mix(in srgb, var(--fw-on-secondary) 16%, transparent)",deps:["on-secondary"]},{name:"focus-ring",light:"0 0 0 4px color-mix(in srgb, var(--fw-primary) 25%, transparent)",dark:"0 0 0 4px color-mix(in srgb, var(--fw-primary) 25%, transparent)",deps:["primary"]},{name:"scrollbar-thumb",light:"var(--fw-text-soft)",dark:"var(--fw-text-soft)",deps:["text-soft"]},{name:"scrollbar-thumb-hover",light:"color-mix(in srgb, var(--fw-text-soft), var(--fw-text) 15%)",dark:"color-mix(in srgb, var(--fw-text-soft), var(--fw-text) 15%)",deps:["text-soft","text"]},{name:"shadow-primary",light:"0 6px 16px color-mix(in srgb, var(--fw-primary) 35%, transparent)",dark:"0 6px 16px color-mix(in srgb, var(--fw-primary) 22%, transparent)",deps:["primary"]},{name:"shadow-success",light:"0 6px 16px color-mix(in srgb, var(--fw-success) 28%, transparent)",dark:"0 6px 16px color-mix(in srgb, var(--fw-success) 22%, transparent)",deps:["success"]}];var Y="--fw-",Nt="data-fw-tokens",Te="fw-tokens",Ct="fw-tokens-css",Bn="fw:tokenschange",ce=":root",N=new Map,se=new Map,de=!1,Pn=0,X=new Map,Me=new WeakSet;function Ft(){try{return window.localStorage}catch{return null}}function jt(e){return e.startsWith("--")?e:`${Y}${e}`}function $n(e){return e.startsWith(Y)?e.slice(Y.length):e}function ae(e){console.warn(`fernwell: ${e}`)}function Vt(e){try{return document.querySelector(e),!0}catch{return!1}}function qn(e){let t=0,n="";for(let o=0;o<e.length;o++){let r=e[o];if(r==="\\")o++;else if(n){if(r===n)n="";else if(r===`
|
|
3
|
+
`)return!1}else if(r==='"'||r==="'")n=r;else if(r==="(")t++;else if(r===")"&&--t<0)return!1}return t===0&&!n}function J(e){let t={};if(e===null||typeof e!="object")return t;for(let[n,o]of Object.entries(e))/^(--)?[\w-]+$/.test(n)?typeof o!="string"||/[{};]|\/\*/.test(o)||!qn(o)?ae(`ignoring invalid value for token "${n}"`):t[jt(n)]=o.trim():ae(`ignoring token with invalid name "${n}"`);return t}function Rn(e){return Object.values(e).some(t=>t!==null&&typeof t=="object")}function Fn(e){let t=[],n=0,o="",r=0;for(let i=0;i<e.length;i++){let s=e[i];s==="\\"?i++:o?s===o&&(o=""):s==='"'||s==="'"?o=s:s==="("||s==="["?n++:s===")"||s==="]"?n--:s===","&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t.filter(Boolean)}function jn(e){return e===ce?'[data-theme="dark"]':Fn(e).map(t=>`[data-theme="dark"] ${t}, ${t}[data-theme="dark"]`).join(", ")}function It(e){return Object.entries(e).map(([t,n])=>`${t}:${n};`).join("")}function Dt(e,t){let n=new Set(Object.keys(e).map($n)),o=new Set(n),r={};for(let i=!0;i;){i=!1;for(let s of Ot)n.has(s.name)||`${Y}${s.name}`in r||s.deps.some(c=>o.has(c))&&(r[`${Y}${s.name}`]=s[t],o.add(s.name),i=!0)}return r}function Le(e){let t=[];return e.forEach(({light:n,dark:o},r)=>{let i=r===ce,s=i?n:{...Dt(n,"light"),...n},c=i?o:{...Dt(o,"dark"),...o};Object.keys(s).length&&t.push(`${r}{${It(s)}}`),Object.keys(c).length&&t.push(`${jn(r)}{${It(c)}}`)}),t}function Bt(e){let t=document.head.querySelector(`style[${Nt}]`);if(t)return e&&t!==document.head.lastElementChild&&document.head.appendChild(t),t;if(!e)return null;let n=document.createElement("style");return n.setAttribute(Nt,""),document.head.appendChild(n),n}function ge(){let e=Ft();if(e)try{if(N.size===0){e.removeItem(Te),e.removeItem(Ct);return}let t={};N.forEach((n,o)=>t[o]=n),e.setItem(Te,JSON.stringify({v:1,scopes:t})),e.setItem(Ct,Le(N).join(`
|
|
4
|
+
`))}catch{}}function le(e){var n;let t=[...Le(N),...Le(se)];t.length===0?(n=Bt(!1))==null||n.remove():Bt(!0).textContent=t.join(`
|
|
5
|
+
`),document.dispatchEvent(new CustomEvent(Bn,{detail:{scope:e}}))}function Pt(e,t){let n=new Map(Object.keys(t).map(o=>[o,o in e?e[o]:void 0]));return Object.assign(e,t),()=>n.forEach((o,r)=>{e[r]===t[r]&&(o===void 0?delete e[r]:e[r]=o)})}function Q(e,t={}){var a,m;let n=(a=t.scope)!=null?a:ce;if(!Vt(n))return ae(`ignoring tokens for invalid scope "${n}"`),()=>{};de||He();let o,r;Rn(e)?(o=J(e.light),r=J(e.dark)):(o=J(e),r={...o});let i=t.persist?N:se,s=(m=i.get(n))!=null?m:{light:{},dark:{}},c=Pt(s.light,o),d=Pt(s.dark,r);i.set(n,s),t.persist&&ge(),le(n);let u=!1;return()=>{u||(u=!0,c(),d(),!Object.keys(s.light).length&&!Object.keys(s.dark).length&&i.get(n)===s&&i.delete(n),i===N&&ge(),le(n))}}function ke(e){de||He(),X.forEach((n,o)=>{(!e||n.scope===e)&&X.delete(o)});let t=e?N.delete(e):N.size>0;e?se.delete(e):(N.clear(),se.clear()),t&&ge(),le(e)}function Kt(){He(),le()}function He(){var n;de=!0,N.clear();let e=null;try{let o=(n=Ft())==null?void 0:n.getItem(Te);o&&(e=JSON.parse(o))}catch{}let t=e==null?void 0:e.scopes;if((e==null?void 0:e.v)===1&&t&&typeof t=="object")for(let[o,r]of Object.entries(t)){if(!Vt(o))continue;let i=J(r==null?void 0:r.light),s=J(r==null?void 0:r.dark);(Object.keys(i).length||Object.keys(s).length)&&N.set(o,{light:i,dark:s})}}function Ae(e,t=document.documentElement){return getComputedStyle(t).getPropertyValue(jt(e)).trim()}function $t(e,t){try{let n=JSON.parse(e!=null?e:"");if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n}catch{}return ae(`${t} must be a JSON object of tokens`),null}function Vn(){X.forEach((e,t)=>{t.isConnected||(X.delete(t),Me.add(t),e.undo())})}function qt(e){return!!e.dataset.fwTokensBound&&!Me.has(e)}function Rt(e,t,n){e.dataset.fwTokensBound="1",Me.delete(e),e.isConnected&&X.set(e,{scope:t,undo:n})}function Se(e=document){de||Kt(),Vn(),e.querySelectorAll('script[type="application/json"][data-fw-theme-tokens]').forEach(t=>{var s;if(qt(t))return;let n=$t(t.textContent,"data-fw-theme-tokens");if(t.dataset.fwTokensBound="1",!n)return;let o=t.hasAttribute("data-fw-persist"),r=(s=t.dataset.fwScope)!=null?s:ce,i=Q(n,{scope:r,persist:o});o||Rt(t,r,i)}),e.querySelectorAll("[data-fw-theme-scope]").forEach(t=>{var i;if(qt(t))return;let n=$t(t.getAttribute("data-fw-theme-scope"),"data-fw-theme-scope");if(t.dataset.fwTokensBound="1",!n)return;let o=(i=t.getAttribute("data-fw-scope-id"))!=null?i:`fw-s${++Pn}`;t.setAttribute("data-fw-scope-id",o);let r=`[data-fw-scope-id="${o}"]`;Rt(t,r,Q(n,{scope:r}))})}var Ne="fw-theme",Kn="fw:themechange",_t="data-fw-theme-init";function Ce(){try{return window.localStorage}catch{return null}}function Ie(){var t;let e=document.documentElement.getAttribute("data-theme");return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}function ue(e,{persist:t=!0}={}){var n;document.documentElement.setAttribute("data-theme",e),t&&((n=Ce())==null||n.setItem(Ne,e)),document.querySelectorAll("[data-fw-theme-toggle]").forEach(o=>Ut(o,e)),document.dispatchEvent(new CustomEvent(Kn,{detail:e}))}function zt(){let e=Ie()==="dark"?"light":"dark";return ue(e),e}function Ut(e,t){e.setAttribute("aria-pressed",String(t==="dark"));let n=t==="dark"?e.dataset.fwThemeIconDark:e.dataset.fwThemeIconLight,o=t==="dark"?e.dataset.fwThemeLabelDark:e.dataset.fwThemeLabelLight;if(n!==void 0){let r=`<span class="fw-icon" aria-hidden="true">${F(n)}</span>`;e.innerHTML=o!==void 0?`${r} ${o}`:r}else o!==void 0&&(e.textContent=o)}function _n(e){let t=typeof requestAnimationFrame=="function"?requestAnimationFrame:n=>setTimeout(n,16);t(()=>t(e))}function De(e=document){var r,i,s,c;let t=(r=Ce())==null?void 0:r.getItem(Ne),n=t==="dark"||t==="light"?t:Ie(),o=document.documentElement;o.setAttribute(_t,""),ue(n,{persist:!1}),_n(()=>o.removeAttribute(_t)),e.querySelectorAll("[data-fw-theme-toggle]").forEach(d=>{d.dataset.fwBound||(d.dataset.fwBound="1",Ut(d,n),d.addEventListener("click",()=>zt()))}),(c=(i=window.matchMedia)==null?void 0:(s=i.call(window,"(prefers-color-scheme: dark)")).addEventListener)==null||c.call(s,"change",d=>{var u;(u=Ce())!=null&&u.getItem(Ne)||ue(d.matches?"dark":"light",{persist:!1})})}var $e={};A($e,{combobox:()=>Wt,init:()=>Pe});var zn=0;function ee(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function Wt(e,t={}){var b,B,C,z;let n=(b=t.filter)!=null?b:((p,y)=>p.toLowerCase().includes(y)),o=(B=t.emptyText)!=null?B:"No matches",r=(C=t.options)!=null?C:Un(e),i=[],s=-1,c=!1,d=e.getAttribute("list");d&&(e.dataset.fwList=d,e.removeAttribute("list"));let u=(z=e.closest(".fw-combobox"))!=null?z:Wn(e),a=document.createElement("ul"),m=`fw-combobox-${++zn}`;a.className="fw-combobox-list",a.id=m,a.setAttribute("role","listbox"),u.appendChild(a),e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",m),e.autocomplete="off";function E(p){i=p,s=-1;let y=e.value.trim().toLowerCase();if(p.length===0){a.innerHTML=`<li class="fw-combobox-empty">${ee(o)}</li>`;return}a.innerHTML=p.map((H,$)=>{let P=y?H.toLowerCase().indexOf(y):-1,G=P>-1?`${ee(H.slice(0,P))}<b>${ee(H.slice(P,P+y.length))}</b>${ee(H.slice(P+y.length))}`:ee(H);return`<li class="fw-combobox-option" role="option" id="${m}-${$}" data-index="${$}" aria-selected="false">${G}</li>`}).join("")}function w(){let p=e.value.trim().toLowerCase();E(p?r.filter(y=>n(y,p)):r),a.classList.add("is-open"),e.setAttribute("aria-expanded","true")}function v(){a.classList.remove("is-open"),e.setAttribute("aria-expanded","false"),e.removeAttribute("aria-activedescendant"),s=-1}function f(p){let y=a.querySelectorAll(".fw-combobox-option");y.forEach($=>{$.classList.remove("is-active"),$.setAttribute("aria-selected","false")});let H=y[p];H&&(H.classList.add("is-active"),H.setAttribute("aria-selected","true"),H.scrollIntoView({block:"nearest"}),e.setAttribute("aria-activedescendant",H.id)),s=p}function g(p){var y;e.value=p,v(),c=!0,e.focus(),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),c=!1,(y=t.onSelect)==null||y.call(t,p)}let M=()=>{c||w()},T=()=>{c||w()},k=p=>{p.key==="ArrowDown"?(p.preventDefault(),a.classList.contains("is-open")||w(),f(Math.min(s+1,i.length-1))):p.key==="ArrowUp"?(p.preventDefault(),f(Math.max(s-1,0))):p.key==="Enter"?s>-1&&i[s]!==void 0&&(p.preventDefault(),g(i[s])):p.key==="Escape"&&v()},x=p=>{let y=p.target.closest(".fw-combobox-option");y&&(p.preventDefault(),g(i[Number(y.dataset.index)]))},L=p=>{u.contains(p.target)||v()};return e.addEventListener("input",M),e.addEventListener("focus",T),e.addEventListener("keydown",k),a.addEventListener("mousedown",x),document.addEventListener("click",L),{open:w,close:v,setOptions(p){r=p,a.classList.contains("is-open")&&w()},destroy(){e.removeEventListener("input",M),e.removeEventListener("focus",T),e.removeEventListener("keydown",k),a.removeEventListener("mousedown",x),document.removeEventListener("click",L),a.remove(),e.dataset.fwList&&e.setAttribute("list",e.dataset.fwList),delete e.dataset.fwBound}}}function Un(e){var o;let t=(o=e.getAttribute("list"))!=null?o:e.dataset.fwList,n=t?document.getElementById(t):null;return n?Array.from(n.querySelectorAll("option")).map(r=>r.value||r.textContent||""):[]}function Wn(e){var n;let t=document.createElement("div");return t.className="fw-combobox",(n=e.parentNode)==null||n.insertBefore(t,e),t.appendChild(e),t}function Pe(e=document){e.querySelectorAll("input[data-fw-combobox]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",Wt(t))})}var _e={};A(_e,{bindOutsideClickToClose:()=>Re,close:()=>j,init:()=>Ke,open:()=>Ve,toggle:()=>Gn});var V="is-open",Gt="fw-scroll-lock",K=[],qe=new WeakMap,Zn='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Fe(e){return typeof e=="string"?document.getElementById(e):e}function je(e){if(e.classList.contains("fw-modal-overlay"))return e;let t=e.id?document.querySelector(`[data-fw-drawer-overlay="${e.id}"]`):null;if(t)return t;let n=e.previousElementSibling;return n instanceof HTMLElement&&n.classList.contains("fw-drawer-overlay")?n:null}function Ve(e,t=(n=>(n=document.activeElement)!=null?n:null)()){var i;let o=Fe(e);if(!o||o.classList.contains(V))return;o.classList.add(V),(i=je(o))==null||i.classList.add(V),qe.set(o,t),K.push(o),document.body.classList.add(Gt),o.dispatchEvent(new CustomEvent("fw:open",{bubbles:!0}));let r=o.querySelector(Zn);r?r.focus({preventScroll:!0}):(o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.focus({preventScroll:!0}))}function j(e){var o,r,i;let t=Fe(e);if(!t||!t.classList.contains(V))return;t.classList.remove(V),(o=je(t))==null||o.classList.remove(V);let n=K.indexOf(t);n>-1&&K.splice(n,1),K.length===0&&document.body.classList.remove(Gt),t.dispatchEvent(new CustomEvent("fw:close",{bubbles:!0})),(i=(r=qe.get(t))==null?void 0:r.focus)==null||i.call(r,{preventScroll:!0}),qe.delete(t)}function Gn(e){let t=Fe(e);t&&(t.classList.contains(V)?j:Ve)(t)}function Re(e,t){let n=!1;e.addEventListener("mousedown",o=>{n=o.target===e}),e.addEventListener("click",o=>{o.target===e&&n&&t()})}var Zt=!1;function Ke(e=document){e.querySelectorAll("[data-fw-open-modal], [data-fw-open-drawer]").forEach(t=>{var o,r;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=(r=(o=t.dataset.fwOpenModal)!=null?o:t.dataset.fwOpenDrawer)!=null?r:"";t.addEventListener("click",()=>Ve(n,t))}),e.querySelectorAll(".fw-modal-overlay").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",Re(t,()=>j(t)),t.querySelectorAll("[data-fw-close-modal]").forEach(n=>n.addEventListener("click",()=>j(t))))}),e.querySelectorAll(".fw-drawer").forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=je(t);n&&Re(n,()=>j(t)),t.querySelectorAll("[data-fw-close-drawer]").forEach(o=>o.addEventListener("click",()=>j(t)))}),Zt||(Zt=!0,document.addEventListener("keydown",t=>{t.key==="Escape"&&K.length&&j(K[K.length-1])}))}var Ze={};A(Ze,{close:()=>fe,init:()=>We,open:()=>Jt});var ze="is-open";function Jt(e){let t=Ue(e);t&&(t.classList.add(ze),e.setAttribute("aria-expanded","true"))}function fe(e){let t=Ue(e);t&&(t.classList.remove(ze),e.setAttribute("aria-expanded","false"))}function Ue(e){let t=e.getAttribute("aria-controls");return t?document.getElementById(t):null}function We(e=document){e.querySelectorAll("[data-fw-nav-toggle]").forEach(t=>{var r,i;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=Ue(t);if(!n)return;let o=(i=(r=t.closest(".fw-nav"))!=null?r:t.parentElement)!=null?i:t;t.addEventListener("click",s=>{s.stopPropagation(),(n.classList.contains(ze)?fe:Jt)(t)}),document.addEventListener("click",s=>{!o.contains(s.target)&&!n.contains(s.target)&&fe(t)}),document.addEventListener("keydown",s=>{s.key==="Escape"&&fe(t)})})}var Je={};A(Je,{init:()=>Ge,resetAll:()=>en,resetButtonLoading:()=>Qt,setButtonLoading:()=>Xt});var te="fw-btn-loading";function Xt(e,t){var o,r;if(!e||e.classList.contains(te))return;e.dataset.fwOriginalHtml=e.innerHTML,e.disabled=!0,e.setAttribute("aria-busy","true"),e.classList.add(te);let n=(r=(o=t!=null?t:e.dataset.fwLoadingText)!=null?o:e.textContent)!=null?r:"";e.innerHTML='<span class="fw-spinner fw-spinner-sm" aria-hidden="true"></span>',e.appendChild(document.createTextNode(n))}function Qt(e){!e||!e.classList.contains(te)||(e.disabled=!1,e.removeAttribute("aria-busy"),e.classList.remove(te),e.dataset.fwOriginalHtml!==void 0&&(e.innerHTML=e.dataset.fwOriginalHtml,delete e.dataset.fwOriginalHtml))}function en(e=document){e.querySelectorAll(`.${te}`).forEach(Qt)}var Yt=!1;function Ge(e=document){e.querySelectorAll("form[data-fw-loading]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",t.addEventListener("submit",()=>{let n=t.querySelector('button[type="submit"], button:not([type])');Xt(n)}))}),Yt||(Yt=!0,window.addEventListener("pageshow",t=>{t.persisted&&en()}))}var Ye={};A(Ye,{hide:()=>tn,show:()=>Yn});var S=null,W=null;function Jn(){return S&&S.isConnected||(S=document.createElement("div"),S.className="fw-toast",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.innerHTML='<span class="fw-toast-dot" aria-hidden="true"></span><span class="fw-toast-text"></span>',document.body.appendChild(S)),S}function Yn(e,{variant:t="success",duration:n=4e3}={}){let o=Jn();return o.className=`fw-toast${t==="success"?"":` fw-toast-${t}`}`,o.querySelector(".fw-toast-text").textContent=e,W&&clearTimeout(W),o.classList.remove("is-show"),o.offsetWidth,o.classList.add("is-show"),n>0&&(W=setTimeout(tn,n)),o}function tn(){S==null||S.classList.remove("is-show"),W&&clearTimeout(W),W=null}var rt={};A(rt,{getSelected:()=>nt,init:()=>ot,selectAll:()=>an,setRowSelected:()=>sn,sort:()=>Xe});var Xn="is-selected";function Qe(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function nn(e,t){var o,r,i;let n=e.cells[t];return(i=(r=n==null?void 0:n.dataset.fwSortValue)!=null?r:(o=n==null?void 0:n.textContent)==null?void 0:o.trim())!=null?i:""}function Qn(e,t){let n=Number(e),o=Number(t);return e!==""&&t!==""&&Number.isFinite(n)&&Number.isFinite(o)?n-o:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function rn(e){var t,n;return Array.from((n=(t=e.tHead)==null?void 0:t.querySelectorAll("th[data-fw-sort]"))!=null?n:[])}function on(e){return e.getAttribute("aria-sort")==="ascending"?"descending":"ascending"}function Xe(e,t,n){let o=e.tBodies[0];if(!o)return;let r=Array.from(o.rows),i=r.filter(u=>u.cells.length>t),s=r.filter(u=>u.cells.length<=t),c=n==="ascending"?1:-1;i.sort((u,a)=>c*Qn(nn(u,t),nn(a,t))),[...i,...s].forEach(u=>o.appendChild(u));let d=null;rn(e).forEach(u=>{let a=u.cellIndex===t;u.setAttribute("aria-sort",a?n:"none"),a&&(d=u)}),d&&Qe(e,"fw:sort",{column:t,direction:n,th:d})}function me(e){return Array.from(e.querySelectorAll("tbody input[data-fw-select-row]"))}function et(e,t){e.classList.toggle(Xn,t),e.setAttribute("aria-selected",t?"true":"false")}function tt(e){let t=e.querySelector("[data-fw-select-all]");if(!t)return;let n=me(e),o=n.filter(r=>r.checked).length;t.checked=o>0&&o===n.length,t.indeterminate=o>0&&o<n.length}function nt(e){return me(e).filter(t=>t.checked).map(t=>t.closest("tr")).filter(t=>t!==null)}function sn(e,t){let n=e.querySelector("input[data-fw-select-row]");n&&(n.checked=t),et(e,t);let o=e.closest("table");o&&(tt(o),Qe(o,"fw:select",{rows:nt(o),all:!1}))}function an(e,t){me(e).forEach(n=>{n.checked=t;let o=n.closest("tr");o&&et(o,t)}),tt(e),Qe(e,"fw:select",{rows:nt(e),all:!0})}function ot(e=document){e.querySelectorAll("table[data-fw-table]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",rn(t).forEach(n=>{n.hasAttribute("aria-sort")||n.setAttribute("aria-sort","none")}),t.addEventListener("click",n=>{let o=n.target.closest("th[data-fw-sort]");o&&t.contains(o)&&Xe(t,o.cellIndex,on(o))}),t.addEventListener("keydown",n=>{if(n.key!=="Enter"&&n.key!==" ")return;let o=n.target;if(!o.matches("th[data-fw-sort], th[data-fw-sort] .fw-table-sort"))return;let r=o.closest("th[data-fw-sort]");r&&(n.preventDefault(),Xe(t,r.cellIndex,on(r)))}),t.addEventListener("change",n=>{let o=n.target;if(o.matches("[data-fw-select-all]"))an(t,o.checked);else if(o.matches("[data-fw-select-row]")){let r=o.closest("tr");r&&sn(r,o.checked)}}),me(t).forEach(n=>{let o=n.closest("tr");o&&n.checked&&et(o,!0)}),tt(t))})}var st={};A(st,{close:()=>ve,collapseAll:()=>ro,expandAll:()=>oo,init:()=>it,open:()=>pe,reveal:()=>dn,toggle:()=>no});var I=".fw-menu-group",cn=".fw-menu-link, .fw-menu-summary",eo="is-current";function to(e,t){e.dispatchEvent(new CustomEvent("fw:toggle",{bubbles:!0,detail:t}))}function pe(e){e.open=!0}function ve(e){e.open=!1}function no(e,t){e.open=t!=null?t:!e.open}function oo(e){e.querySelectorAll(I).forEach(pe)}function ro(e){e.querySelectorAll(I).forEach(ve)}function dn(e){var n,o,r,i;let t=(o=(n=e.parentElement)==null?void 0:n.closest(I))!=null?o:null;for(;t;)pe(t),t=(i=(r=t.parentElement)==null?void 0:r.closest(I))!=null?i:null}function ln(e){e.querySelectorAll(I).forEach(t=>{let n=t.querySelector(":scope > .fw-menu-summary");if(!n)return;let o=!t.open&&t.querySelector("[aria-current]")!==null;n.classList.toggle(eo,o)})}function un(e){return e.matches(".fw-menu-summary")?e.closest(I):null}function fn(e){var n,o,r;return(r=(o=((n=un(e))!=null?n:e).parentElement)==null?void 0:o.closest(I))!=null?r:null}function io(e){var t,n;for(let o=fn(e);o;o=(n=(t=o.parentElement)==null?void 0:t.closest(I))!=null?n:null)if(!o.open)return!1;return!0}function so(e){return Array.from(e.querySelectorAll(cn)).filter(io)}function _(e){return e?(e.focus(),!0):!1}function ao(e){var n;let t=e.closest(".fw-menu-split");return(n=t==null?void 0:t.querySelector(":scope > .fw-menu-group > .fw-menu-summary"))!=null?n:null}function lo(e,t){var c;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return;let n=t.target instanceof HTMLElement&&t.target.matches(cn)?t.target:null;if(!n||!e.contains(n))return;let o=so(e),r=o.indexOf(n),i=un(n),s=!0;switch(t.key){case"ArrowDown":_(o[r+1]);break;case"ArrowUp":_(o[r-1]);break;case"Home":_(o[0]);break;case"End":_(o[o.length-1]);break;case"ArrowRight":i?i.open?i.contains((c=o[r+1])!=null?c:e)&&_(o[r+1]):pe(i):_(ao(n));break;case"ArrowLeft":if(i!=null&&i.open)ve(i);else{let d=fn(n);_(d==null?void 0:d.querySelector(":scope > .fw-menu-summary"))}break;default:s=!1}s&&t.preventDefault()}function it(e=document){e.querySelectorAll("[data-fw-menu]").forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=t.hasAttribute("data-fw-menu-exclusive");t.addEventListener("toggle",o=>{let r=o.target;!(r instanceof HTMLDetailsElement)||!r.matches(I)||(n&&r.open&&r.parentElement&&Array.from(r.parentElement.children).forEach(i=>{i!==r&&i instanceof HTMLDetailsElement&&i.matches(I)&&ve(i)}),ln(t),to(r,{group:r,open:r.open}))},!0),t.addEventListener("keydown",o=>lo(t,o)),t.querySelectorAll("[aria-current]").forEach(dn),ln(t)})}var ct={};A(ct,{init:()=>lt,popover:()=>bn});var co={top:"bottom",bottom:"top",left:"right",right:"left"},Z=10;function uo(e){switch(e){case"top-left":return{side:"top",align:"end"};case"top-right":return{side:"top",align:"start"};case"bottom-left":return{side:"bottom",align:"end"};case"bottom-right":return{side:"bottom",align:"start"};default:return{side:e,align:"center"}}}var fo={start:"right",end:"left"};function mo(e,t){return t==="center"?e:`${e}-${fo[t]}`}function at(e,t,n,o){switch(e){case"top":return t.top;case"bottom":return o-t.bottom;case"left":return t.left;case"right":return n-t.right}}function mn(e,t,n,o){switch(e){case"top":return t.top-o-n.height;case"bottom":return t.bottom+o;case"left":return t.left-o-n.width;case"right":return t.right+o}}function pn(e,t,n,o){switch(e){case"start":return t;case"end":return t+n-o;case"center":return t+n/2-o/2}}function be(e,t,n){return Math.min(Math.max(e,t),n>t?n:t)}function we(e,t,n={}){var T,k,x;let o=(T=n.placement)!=null?T:"bottom",r=(k=n.offset)!=null?k:8,i=(x=n.padding)!=null?x:8,s=e.getBoundingClientRect(),c=t.getBoundingClientRect(),d=window.innerWidth,u=window.innerHeight,{side:a,align:m}=uo(o),E=co[a],w=a==="top"||a==="bottom"?c.height:c.width,v=at(a,s,d,u)-r<w&&at(E,s,d,u)-r>at(a,s,d,u)-r?E:a,f,g,M;return v==="top"||v==="bottom"?(f=mn(v,s,c,r),g=be(pn(m,s.left,s.width,c.width),i,d-c.width-i),M=be(s.left+s.width/2-g,Z,Math.max(c.width-Z,Z))):(g=mn(v,s,c,r),f=be(pn("center",s.top,s.height,c.height),i,u-c.height-i),M=be(s.top+s.height/2-f,Z,Math.max(c.height-Z,Z))),{placement:mo(v,m),top:f,left:g,arrowOffset:M}}function vn(e,t){let n=s=>!e.some(c=>c.contains(s)),o=!1,r=s=>{o=n(s.target)},i=s=>{o&&n(s.target)&&t()};return document.addEventListener("mousedown",r,!0),document.addEventListener("click",i,!0),()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("click",i,!0)}}var po='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function bn(e,t,n={}){var x,L;let o=(x=n.placement)!=null?x:"bottom",r=(L=n.offset)!=null?L:8;e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-controls",t.id),e.setAttribute("aria-expanded","false"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.classList.add("fw-popover");let i=t.parentNode,s=t.nextSibling,c=!1,d=null,u=0;function a(){let b=we(e,t,{placement:o,offset:r});t.style.top=`${b.top}px`,t.style.left=`${b.left}px`,t.setAttribute("data-placement",b.placement)}function m(){cancelAnimationFrame(u),u=requestAnimationFrame(a)}function E(b){b.key==="Escape"&&(b.stopPropagation(),f())}function w(b){let B=b.relatedTarget;B&&(t.contains(B)||e.contains(B))||setTimeout(()=>{if(!c)return;let C=document.activeElement;C===document.body||C===null||t.contains(C)||e.contains(C)||f()},0)}function v(){if(c)return;c=!0,t.parentNode!==document.body&&document.body.appendChild(t),a(),t.classList.add("is-open"),e.setAttribute("aria-expanded","true");let b=t.querySelector(po);b?b.focus({preventScroll:!0}):(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})),d=vn([e,t],f),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),t.addEventListener("keydown",E),t.addEventListener("focusout",w),t.dispatchEvent(new CustomEvent("fw:open",{bubbles:!0}))}function f(){if(!c)return;c=!1,t.classList.remove("is-open"),e.setAttribute("aria-expanded","false"),d==null||d(),d=null,window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m),t.removeEventListener("keydown",E),t.removeEventListener("focusout",w),cancelAnimationFrame(u),s===null||s.parentNode===i?i.insertBefore(t,s):i.appendChild(t),t.dispatchEvent(new CustomEvent("fw:close",{bubbles:!0})),e.focus({preventScroll:!0})}function g(){(c?f:v)()}let M=()=>g(),T=Array.from(t.querySelectorAll("[data-fw-popover-close]")),k=()=>f();return e.addEventListener("click",M),T.forEach(b=>b.addEventListener("click",k)),{open:v,close:f,toggle:g,destroy(){c&&f(),e.removeEventListener("click",M),T.forEach(b=>b.removeEventListener("click",k)),delete e.dataset.fwBound}}}function lt(e=document){e.querySelectorAll("[data-fw-popover-trigger]").forEach(t=>{var r;if(t.dataset.fwBound)return;let n=(r=t.dataset.fwPopoverTrigger)!=null?r:"",o=document.getElementById(n);if(!o){console.warn(`fernwell: popover trigger references missing panel #${n}`);return}t.dataset.fwBound="1",bn(t,o,{placement:t.dataset.fwPopoverPlacement||void 0,offset:t.dataset.fwPopoverOffset?Number(t.dataset.fwPopoverOffset):void 0})})}var mt={};A(mt,{init:()=>ft,tooltip:()=>Tn});var vo=400,bo=300,wo=100,oe=new WeakMap,O=null,D=null,re=0,ie=0,ut=0,hn=0;function ho(){if(O&&O.isConnected)return O;let e=document.createElement("div");return e.className="fw-tooltip",e.id="fw-tooltip",e.setAttribute("role","tooltip"),document.body.appendChild(e),e.addEventListener("mouseenter",yn),e.addEventListener("mouseleave",()=>xn()),O=e,e}function yn(){clearTimeout(ie)}function En(){if(!D||!O)return;let e=oe.get(D);if(!e)return;let t=we(D,O,{placement:e.placement,offset:e.offset});O.style.top=`${t.top}px`,O.style.left=`${t.left}px`,O.style.setProperty("--fw-tooltip-arrow-pos",`${t.arrowOffset}px`),O.setAttribute("data-placement",t.placement)}function he(){cancelAnimationFrame(ut),ut=requestAnimationFrame(En)}function wn(e){var o;if(clearTimeout(re),yn(),!oe.get(e))return;D=e;let n=ho();n.textContent=(o=e.dataset.fwTooltipText)!=null?o:"",En(),n.classList.add("is-open"),window.addEventListener("scroll",he,!0),window.addEventListener("resize",he)}function ne(){clearTimeout(re),clearTimeout(ie),O&&O.classList.remove("is-open"),window.removeEventListener("scroll",he,!0),window.removeEventListener("resize",he),cancelAnimationFrame(ut),D&&(hn=performance.now()),D=null}function dt(e,t){clearTimeout(ie),clearTimeout(re);let n=oe.get(e);n&&(t||performance.now()-hn<bo?wn(e):re=window.setTimeout(()=>wn(e),n.delay))}function xn(){clearTimeout(re),clearTimeout(ie),ie=window.setTimeout(ne,wo)}function Tn(e,t={}){var u,a,m;let n={placement:(u=t.placement)!=null?u:"top",offset:(a=t.offset)!=null?a:6,delay:(m=t.delay)!=null?m:vo};oe.set(e,n);let o=e.getAttribute("title");o!==null&&(e.dataset.fwTooltipText=o,e.removeAttribute("title")),e.setAttribute("aria-describedby","fw-tooltip");let r=()=>dt(e,!1),i=()=>xn(),s=()=>dt(e,!0),c=()=>{D===e&&ne()},d=E=>{E.key==="Escape"&&D===e&&ne()};return e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",i),e.addEventListener("focus",s),e.addEventListener("blur",c),e.addEventListener("keydown",d),{show:()=>dt(e,!0),hide:()=>{D===e&&ne()},destroy(){D===e&&ne(),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",i),e.removeEventListener("focus",s),e.removeEventListener("blur",c),e.removeEventListener("keydown",d),e.removeAttribute("aria-describedby"),e.dataset.fwTooltipText!==void 0&&(e.setAttribute("title",e.dataset.fwTooltipText),delete e.dataset.fwTooltipText),oe.delete(e),delete e.dataset.fwBound}}}function ft(e=document){e.querySelectorAll("[data-fw-tooltip]").forEach(t=>{t.dataset.fwBound||(t.dataset.fwBound="1",Tn(t,{placement:t.dataset.fwTooltipPlacement||void 0,offset:t.dataset.fwTooltipOffset?Number(t.dataset.fwTooltipOffset):void 0,delay:t.dataset.fwTooltipDelay?Number(t.dataset.fwTooltipDelay):void 0}))})}var bt={};A(bt,{init:()=>vt,tabs:()=>kn});function yo(e,t){e.dispatchEvent(new CustomEvent("fw:tabs-change",{bubbles:!0,detail:t}))}function ye(e){return e.getAttribute("aria-disabled")==="true"}function pt(e){let t=e.getAttribute("aria-controls");return t?document.getElementById(t):null}function Ln(e){return e instanceof Element?e.closest('[role="tab"]'):null}function gn(e,t,n){for(let o=1;o<=e.length;o++){let r=((t+n*o)%e.length+e.length)%e.length;if(!ye(e[r]))return e[r]}}function Mn(e){return e.find(t=>!ye(t))}function Eo(e){for(let t=e.length-1;t>=0;t--)if(!ye(e[t]))return e[t]}function kn(e,t={}){var u;let n=(u=t.activation)!=null?u:"automatic";function o(){return Array.from(e.querySelectorAll('[role="tab"]'))}function r(a,m=!1){if(ye(a))return;o().forEach(w=>{let v=w===a;w.setAttribute("aria-selected",String(v)),w.tabIndex=v?0:-1;let f=pt(w);f&&(f.hidden=!v)}),m&&a.focus();let E=pt(a);E&&yo(e,{tab:a,panel:E})}function i(a){o().forEach(m=>{m.tabIndex=m===a?0:-1}),a.focus()}function s(){var E;let a=o(),m=(E=a.find(w=>w.getAttribute("aria-selected")==="true"))!=null?E:Mn(a);a.forEach(w=>{let v=w===m;w.setAttribute("aria-selected",String(v)),w.tabIndex=v?0:-1;let f=pt(w);f&&(f.hidden=!v)})}function c(a){let m=Ln(a.target);m&&e.contains(m)&&r(m,!1)}function d(a){let m=Ln(a.target);if(!m)return;let E=o(),w=E.indexOf(m);if(w===-1)return;if(a.key===" "||a.key==="Enter"){n==="manual"&&(a.preventDefault(),r(m,!1));return}let v=e.getAttribute("aria-orientation")==="vertical",f=getComputedStyle(e).direction==="rtl",g=v?"ArrowDown":f?"ArrowLeft":"ArrowRight",M=v?"ArrowUp":f?"ArrowRight":"ArrowLeft",T;if(a.key===g)T=gn(E,w,1);else if(a.key===M)T=gn(E,w,-1);else if(a.key==="Home")T=Mn(E);else if(a.key==="End")T=Eo(E);else return;T&&(a.preventDefault(),n==="manual"?i(T):r(T,!0))}return e.addEventListener("click",c),e.addEventListener("keydown",d),s(),{activate:r,destroy(){e.removeEventListener("click",c),e.removeEventListener("keydown",d),delete e.dataset.fwBound}}}function vt(e=document){e.querySelectorAll('[role="tablist"][data-fw-tabs]').forEach(t=>{if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=t.dataset.fwTabsActivation==="manual"?"manual":"automatic";kn(t,{activation:n})})}var Et={};A(Et,{init:()=>yt,numberInput:()=>An});var xo=400,To=60,Lo=0;function wt(e){if(e==null||e.trim()==="")return;let t=Number(e);return Number.isFinite(t)?t:void 0}function Hn(e){if(e===void 0)return 0;let t=String(e),n=t.indexOf(".");return n<0?0:t.length-n-1}function An(e,t={}){var Tt,Lt,gt,Mt,kt,Ht;let n=t.mode==="slider"?"slider":"stepper",o=n==="slider",r=(Tt=t.min)!=null?Tt:o?0:void 0,i=(Lt=t.max)!=null?Lt:o?100:void 0,s=(gt=t.step)!=null?gt:1,c=Number.isFinite(s)&&s>0?s:1,d=(Mt=t.unit)!=null?Mt:"",u=Math.max(Hn(c),Hn(r)),a=e.type,m=e.getAttribute("min"),E=e.getAttribute("max"),w=e.getAttribute("step");e.type=o?"range":"number",r!==void 0&&(e.min=String(r)),i!==void 0&&(e.max=String(i)),e.step=String(c),e.id||(e.id=`fw-number-${++Lo}`);let v=e.closest(".fw-number"),f=v!=null?v:go(e),g=!v;f.classList.add(o?"fw-number-slider":"fw-number-stepper"),e.classList.add("fw-number-input");let M=l=>Math.min(i!=null?i:1/0,Math.max(r!=null?r:-1/0,l)),T=l=>Number(l.toFixed(u)),k=()=>e.value.trim()===""?NaN:Number(e.value),x,L,b;if(o)b=document.createElement("output"),b.className="fw-number-value",b.setAttribute("for",e.id),f.appendChild(b);else{let l=e.getAttribute("aria-label");x=B("dec",F("minus"),(kt=t.decreaseLabel)!=null?kt:l?`Decrease ${l}`:"Decrease"),L=B("inc",F("add"),(Ht=t.increaseLabel)!=null?Ht:l?`Increase ${l}`:"Increase"),x.setAttribute("aria-controls",e.id),L.setAttribute("aria-controls",e.id),f.insertBefore(x,e),f.appendChild(L)}function B(l,h,q){let R=document.createElement("button");return R.type="button",R.className=`fw-number-btn fw-number-${l}`,R.setAttribute("aria-label",q),R.innerHTML=`<span class="fw-icon" aria-hidden="true">${h}</span>`,R}function C(){let l=k();if(o&&b){let h=Number.isFinite(l)?`${l}${d}`:"";b.textContent=h,e.setAttribute("aria-valuetext",h);let q=(i!=null?i:100)-(r!=null?r:0),R=Number.isFinite(l)&&q>0?(l-(r!=null?r:0))/q*100:0;e.style.setProperty("--fw-number-fill",`${Math.min(100,Math.max(0,R))}%`)}if(x&&L){let h=Number.isFinite(l)?l:void 0;x.setAttribute("aria-disabled",String(e.disabled||h!==void 0&&r!==void 0&&h<=r)),L.setAttribute("aria-disabled",String(e.disabled||h!==void 0&&i!==void 0&&h>=i))}}function z(l){return l.getAttribute("aria-disabled")==="true"}function p(l){if(!Number.isFinite(l))return;let h=T(M(l));h!==k()&&(e.value=String(h),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}function y(l){if(e.disabled||e.readOnly)return;let h=k();p((Number.isFinite(h)?h:M(0))+l*c)}let H=()=>{var h;C();let l=k();f.dispatchEvent(new CustomEvent("fw:number-change",{bubbles:!0,detail:{value:l,mode:n}})),(h=t.onChange)==null||h.call(t,l)},$=l=>{if(l.altKey||l.ctrlKey||l.metaKey)return;let h=!0;switch(l.key){case"ArrowUp":y(1);break;case"ArrowDown":y(-1);break;case"PageUp":y(10);break;case"PageDown":y(-10);break;default:h=!1}h&&l.preventDefault()},P,G,U=()=>{clearTimeout(P),clearInterval(G),P=G=void 0},xt=l=>l===x?-1:1,Sn=l=>{let h=l.currentTarget;if(l.button>0||z(h))return;let q=xt(h);y(q),U(),P=setTimeout(()=>{G=setInterval(()=>{if(z(h))return U();y(q)},To)},xo)},On=l=>{let h=l.currentTarget;l.detail!==0||z(h)||y(xt(h))};if(e.addEventListener("input",H),!o){e.addEventListener("keydown",$);for(let l of[x,L])l&&(l.addEventListener("pointerdown",Sn),l.addEventListener("pointerup",U),l.addEventListener("pointerleave",U),l.addEventListener("pointercancel",U),l.addEventListener("click",On))}return C(),{getValue:k,setValue:p,stepUp:(l=1)=>y(l),stepDown:(l=1)=>y(-l),destroy(){U(),e.removeEventListener("input",H),e.removeEventListener("keydown",$),x==null||x.remove(),L==null||L.remove(),b==null||b.remove(),e.style.removeProperty("--fw-number-fill"),e.removeAttribute("aria-valuetext"),e.classList.remove("fw-number-input"),f.classList.remove("fw-number-slider","fw-number-stepper"),e.type=a,ht(e,"min",m),ht(e,"max",E),ht(e,"step",w),g&&f.parentNode&&(f.parentNode.insertBefore(e,f),f.remove()),delete e.dataset.fwBound}}}function ht(e,t,n){n===null?e.removeAttribute(t):e.setAttribute(t,n)}function go(e){var n;let t=document.createElement("div");return t.className="fw-number",(n=e.parentNode)==null||n.insertBefore(t,e),t.appendChild(e),t}function yt(e=document){e.querySelectorAll("input[data-fw-number]").forEach(t=>{var o,r,i;if(t.dataset.fwBound)return;t.dataset.fwBound="1";let n=t.dataset;An(t,{mode:n.fwNumberMode==="slider"?"slider":"stepper",min:wt((o=n.fwNumberMin)!=null?o:t.getAttribute("min")),max:wt((r=n.fwNumberMax)!=null?r:t.getAttribute("max")),step:wt((i=n.fwNumberStep)!=null?i:t.getAttribute("step")),unit:n.fwNumberUnit})})}var Mo="0.6.1";function ko(e=document){De(e),Se(e),Pe(e),Ke(e),We(e),Ge(e),ot(e),it(e),Ee(e),lt(e),ft(e),vt(e),yt(e)}var Ho={version:Mo,init:ko,theme:Be,tokens:Oe,combobox:$e,modal:_e,nav:Ze,loading:Je,toast:Ye,table:rt,menu:st,icon:xe,popover:ct,tooltip:mt,tabs:bt,numberInput:Et},$o=Ho;export{$e as combobox,$o as default,xe as icon,ko as init,Je as loading,st as menu,_e as modal,Ze as nav,Et as numberInput,ct as popover,rt as table,bt as tabs,Be as theme,Ye as toast,Oe as tokens,mt as tooltip,Mo as version};
|
|
6
6
|
//# sourceMappingURL=fernwell.esm.js.map
|