@strapi/design-system 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);
|
|
3
|
-
`)},
|
|
4
|
-
${({theme:
|
|
5
|
-
`,
|
|
6
|
-
${({theme:
|
|
7
|
-
`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("styled-components"),X=require("react"),xr=require("@radix-ui/react-use-callback-ref"),F=require("@internationalized/date"),r=require("react/jsx-runtime"),$r=require("@radix-ui/react-tooltip"),Zn=require("@radix-ui/react-dismissable-layer"),D=require("@strapi/ui-primitives"),Jn=require("@radix-ui/react-accordion"),O=require("@strapi/icons"),eo=require("@radix-ui/react-avatar"),to=require("@radix-ui/react-dropdown-menu"),ro=require("@radix-ui/react-checkbox"),no=require("@tanstack/react-virtual"),oo=require("@radix-ui/react-scroll-area"),ao=require("@radix-ui/react-alert-dialog"),Fe=require("@floating-ui/react-dom"),so=require("@radix-ui/react-focus-guards"),io=require("@radix-ui/react-focus-scope"),lo=require("react-remove-scroll"),co=require("react-dom"),Xt=require("@codemirror/lang-json"),uo=require("@uiw/react-codemirror"),Rt=require("@codemirror/state"),bt=require("@codemirror/view"),ho=require("@radix-ui/react-dialog"),Zt=require("@internationalized/number"),fo=require("@radix-ui/react-popover"),go=require("@radix-ui/react-progress"),po=require("@radix-ui/react-radio-group"),mo=require("@radix-ui/react-switch"),bo=require("@radix-ui/react-tabs"),Je=require("lodash");function ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=ee(X),xe=ee($r),xo=ee(Zn),Ue=ee(Jn),Tt=ee(eo),ce=ee(to),yr=ee(ro),ot=ee(oo),pe=ee(ao),Te=ee(ho),Le=ee(fo),wr=ee(go),It=ee(po),Cr=ee(mo),at=ee(bo),Oe=(e,t)=>{const n=l.createContext(t),o=i=>{const{children:c,...d}=i,u=l.useMemo(()=>d,Object.values(d));return r.jsx(n.Provider,{value:u,children:c})};function a(i){const c=l.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return o.displayName=`${e}Provider`,[o,a]};function $o(e,t){return typeof e=="string"?!1:t in e}function et(e){return e&&typeof e=="object"&&!Array.isArray(e)}function _e(e,t,n){return e&&t&&$o(e,t)?e[t]:n}const Jt={padding:["padding-block-start","padding-inline-end","padding-block-end","padding-inline-start"],paddingTop:"padding-block-start",paddingRight:"padding-inline-end",paddingBottom:"padding-block-end",paddingLeft:"padding-inline-start",margin:["margin-block-start","margin-inline-end","margin-block-end","margin-inline-start"],marginLeft:"margin-inline-start",marginRight:"margin-inline-end",marginTop:"margin-block-start",marginBottom:"margin-block-end",borderRadius:"border-radius",borderStyle:"border-style",borderWidth:"border-width",borderColor:"border-color",fontSize:"font-size",fontWeight:"font-weight",lineHeight:"line-height",zIndex:"z-index",boxShadow:"box-shadow",pointerEvents:"pointer-events",textAlign:"text-align",textTransform:"text-transform",textDecoration:"text-decoration",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexBasis:"flex-basis",minWidth:"min-width",maxWidth:"max-width",minHeight:"min-height",maxHeight:"max-height",order:"order",flexDirection:"flex-direction",flexWrap:"flex-wrap",justifyContent:"justify-content",alignItems:"align-items"},yo=e=>{const[t,n,o,a]=e,i=n??t;return[t,i,o??t,a??i]};function wo(e,t){switch(e){case"gap":case"padding":case"margin":case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":case"marginTop":case"marginLeft":case"marginRight":case"marginBottom":case"left":case"right":case"top":case"bottom":case"width":case"maxWidth":case"minWidth":case"height":case"maxHeight":case"minHeight":case"borderRadius":case"borderWidth":return t.spaces;case"color":case"background":case"borderColor":return t.colors;case"fontSize":return t.fontSizes;case"fontWeight":return t.fontWeights;case"lineHeight":return t.lineHeights;case"zIndex":return t.zIndices;case"boxShadow":return t.shadows;default:return null}}const ke=(e,t)=>{const n=Object.entries(e).reduce((o,a)=>{const[i,c]=a,d=wo(i,t),u=Object.prototype.hasOwnProperty.call(Jt,i)?Jt[i]:i;return u&&(c||c===0)&&(typeof c=="object"&&!Array.isArray(c)?Object.entries(c).forEach(([h,f])=>{o[h]={...o[h],...er(u,f,d)}}):o.initial={...o.initial,...er(u,c,d)}),o},{initial:{},small:{},medium:{},large:{}});return Object.entries(n).reduce((o,[a,i])=>{if(i&&Object.keys(i).length>0){const c=Object.entries(i).reduce((d,[u,h])=>(d.push(`${u}: ${h};`),d),[]).join(`
|
|
2
|
+
`);a==="initial"?o.push(c):o.push(`${t.breakpoints[a]}{ ${c} }`)}return o},[]).join(`
|
|
3
|
+
`)},er=(e,t,n)=>{if(Array.isArray(e)&&Array.isArray(t)){const o=yo(t);return e.reduce((a,i,c)=>(a[i]=_e(n,o[c],o[c]),a),{})}else return Array.isArray(e)&&!Array.isArray(t)?e.reduce((o,a)=>(o[a]=_e(n,t,t),o),{}):!Array.isArray(e)&&!Array.isArray(t)?{[e]:_e(n,t,t)}:(console.warn("You've passed an array of values to a property that does not support it. Please check the property and value you're passing."),{})},v=l.forwardRef(({animation:e,background:t,basis:n,borderColor:o,borderRadius:a,borderStyle:i,borderWidth:c,bottom:d,color:u,cursor:h,display:f,flex:g,fontSize:p,fontWeight:w,grow:m,hasRadius:$,height:k,left:y,lineHeight:x,margin:I,marginBottom:j,marginLeft:R,marginRight:b,marginTop:S,maxHeight:z,maxWidth:E,minHeight:A,minWidth:U,order:B,overflow:N,padding:H,paddingBottom:P,paddingLeft:K,paddingRight:L,paddingTop:M,pointerEvents:Z,position:G,right:oe,shadow:Y,shrink:J,tag:_,textAlign:Q,textTransform:de,top:$e,transform:ye,transition:fe,width:Ie,zIndex:we,...Be},Ne)=>{const Ce=_||"div",V={$animation:e,$background:t,$basis:n,$borderColor:o,$borderRadius:a,$borderStyle:i,$borderWidth:c,$bottom:d,$color:u,$cursor:h,$display:f,$flex:g,$fontSize:p,$fontWeight:w,$grow:m,$hasRadius:$,$height:k,$left:y,$lineHeight:x,$margin:I,$marginBottom:j,$marginLeft:R,$marginRight:b,$marginTop:S,$maxHeight:z,$maxWidth:E,$minHeight:A,$minWidth:U,$order:B,$overflow:N,$padding:H,$paddingBottom:P,$paddingLeft:K,$paddingRight:L,$paddingTop:M,$pointerEvents:Z,$position:G,$right:oe,$shadow:Y,$shrink:J,$textAlign:Q,$textTransform:de,$top:$e,$transform:ye,$transition:fe,$width:Ie,$zIndex:we};return r.jsx(Co,{as:Ce,ref:Ne,...V,...Be})}),Co=s.styled.div`
|
|
4
|
+
${({theme:e,...t})=>ke({animation:t.$animation,background:t.$background,borderColor:t.$borderColor,borderRadius:t.$hasRadius?e.borderRadius:t.$borderRadius,borderStyle:t.$borderColor&&!t.$borderStyle?"solid":t.$borderStyle,borderWidth:t.$borderColor&&!t.$borderWidth?"1px":t.$borderWidth,bottom:t.$bottom,boxShadow:t.$shadow,color:t.$color,cursor:t.$cursor,display:t.$display,flex:t.$flex,flexBasis:t.$basis,flexGrow:t.$grow,flexShrink:t.$shrink,fontSize:t.$fontSize,fontWeight:t.$fontWeight,height:t.$height,left:t.$left,lineHeight:t.$lineHeight,margin:t.$margin,marginBottom:t.$marginBottom,marginLeft:t.$marginLeft,marginRight:t.$marginRight,marginTop:t.$marginTop,maxHeight:t.$maxHeight,maxWidth:t.$maxWidth,minHeight:t.$minHeight,minWidth:t.$minWidth,order:t.$order,overflow:t.$overflow,padding:t.$padding,paddingBottom:t.$paddingBottom,paddingLeft:t.$paddingLeft,paddingRight:t.$paddingRight,paddingTop:t.$paddingTop,pointerEvents:t.$pointerEvents,position:t.$position,right:t.$right,textAlign:t.$textAlign,textTransform:t.$textTransform,top:t.$top,transform:t.$transform,transition:t.$transition,width:t.$width,zIndex:t.$zIndex},e)};
|
|
5
|
+
`,ae=l.forwardRef,C=ae((e,t)=>{const{className:n,alignItems:o,direction:a,inline:i,gap:c,justifyContent:d,wrap:u,...h}=e,f={$alignItems:o,$direction:a,$gap:c,$justifyContent:d,$wrap:u,$inline:i};return r.jsx(jo,{className:n,ref:t,...f,...h})}),jo=s.styled(v)`
|
|
6
|
+
${({theme:e,$display:t="flex",$alignItems:n="center",$direction:o="row",...a})=>ke({gap:a.$gap,alignItems:n,justifyContent:a.$justifyContent,flexWrap:a.$wrap,flexDirection:o,display:a.$inline?"inline-flex":t},e)};
|
|
7
|
+
`,vo="alpha",ko="beta",So="delta",Ro="epsilon",tr="omega",To="pi",Io="sigma",jr=s.css`
|
|
8
8
|
display: block;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
|
-
`,
|
|
13
|
-
font-weight: ${
|
|
12
|
+
`,Do=({$variant:e=tr,theme:t,$fontSize:n,$lineHeight:o})=>{const a=n&&ke({fontSize:n},t),i=o&&ke({lineHeight:o},t);switch(e){case vo:return s.css`
|
|
13
|
+
font-weight: ${t.fontWeights.bold};
|
|
14
14
|
|
|
15
15
|
/* -------------------------------------------------------------
|
|
16
16
|
* Font Size
|
|
17
17
|
* -------------------------------------------------------------*/
|
|
18
|
-
${
|
|
18
|
+
${a||s.css`
|
|
19
19
|
/* Mobile: 2.8rem */
|
|
20
|
-
font-size: ${
|
|
20
|
+
font-size: ${t.fontSizes[6]};
|
|
21
21
|
|
|
22
|
-
${
|
|
22
|
+
${t.breakpoints.medium} {
|
|
23
23
|
/* Tablet + Desktop: 3.2rem */
|
|
24
|
-
font-size: ${
|
|
24
|
+
font-size: ${t.fontSizes[7]};
|
|
25
25
|
}
|
|
26
26
|
`}
|
|
27
27
|
|
|
28
28
|
/* -------------------------------------------------------------
|
|
29
29
|
* Line Height
|
|
30
30
|
* -------------------------------------------------------------*/
|
|
31
|
-
${s
|
|
31
|
+
${i||s.css`
|
|
32
32
|
/* Mobile: 3.2rem */
|
|
33
|
-
line-height: ${
|
|
33
|
+
line-height: ${t.lineHeights[0]};
|
|
34
34
|
|
|
35
|
-
${
|
|
35
|
+
${t.breakpoints.medium} {
|
|
36
36
|
/* Tablet + Desktop: 4rem */
|
|
37
|
-
line-height: ${
|
|
37
|
+
line-height: ${t.lineHeights[2]};
|
|
38
38
|
}
|
|
39
39
|
`}
|
|
40
|
-
`;case
|
|
41
|
-
font-weight: ${
|
|
40
|
+
`;case ko:return s.css`
|
|
41
|
+
font-weight: ${t.fontWeights.bold};
|
|
42
42
|
|
|
43
43
|
/* -------------------------------------------------------------
|
|
44
44
|
* Font Size
|
|
45
45
|
* -------------------------------------------------------------*/
|
|
46
|
-
${
|
|
46
|
+
${a||s.css`
|
|
47
47
|
/* Mobile: 2rem */
|
|
48
|
-
font-size: ${
|
|
48
|
+
font-size: ${t.fontSizes[5]};
|
|
49
49
|
|
|
50
|
-
${
|
|
50
|
+
${t.breakpoints.medium} {
|
|
51
51
|
/* Tablet + Desktop: 1.8rem */
|
|
52
|
-
font-size: ${
|
|
52
|
+
font-size: ${t.fontSizes[4]};
|
|
53
53
|
}
|
|
54
54
|
`}
|
|
55
55
|
|
|
56
56
|
/* -------------------------------------------------------------
|
|
57
57
|
* Line Height
|
|
58
58
|
* -------------------------------------------------------------*/
|
|
59
|
-
${s
|
|
59
|
+
${i||s.css`
|
|
60
60
|
/* Mobile: 2.4rem */
|
|
61
|
-
line-height: ${
|
|
61
|
+
line-height: ${t.lineHeights[1]};
|
|
62
62
|
`}
|
|
63
|
-
`;case
|
|
64
|
-
font-weight: ${
|
|
63
|
+
`;case So:return s.css`
|
|
64
|
+
font-weight: ${t.fontWeights.semiBold};
|
|
65
65
|
|
|
66
66
|
/* -------------------------------------------------------------
|
|
67
67
|
* Font Size
|
|
68
68
|
* -------------------------------------------------------------*/
|
|
69
|
-
${
|
|
69
|
+
${a||s.css`
|
|
70
70
|
/* Mobile: 1.8rem */
|
|
71
|
-
font-size: ${
|
|
71
|
+
font-size: ${t.fontSizes[4]};
|
|
72
72
|
|
|
73
|
-
${
|
|
73
|
+
${t.breakpoints.medium} {
|
|
74
74
|
/* Tablet + Desktop: 1.6rem */
|
|
75
|
-
font-size: ${
|
|
75
|
+
font-size: ${t.fontSizes[3]};
|
|
76
76
|
}
|
|
77
77
|
`}
|
|
78
78
|
|
|
79
79
|
/* -------------------------------------------------------------
|
|
80
80
|
* Line Height
|
|
81
81
|
* -------------------------------------------------------------*/
|
|
82
|
-
${s
|
|
82
|
+
${i||s.css`
|
|
83
83
|
/* Mobile: 2.4rem */
|
|
84
|
-
line-height: ${
|
|
84
|
+
line-height: ${t.lineHeights[3]};
|
|
85
85
|
|
|
86
|
-
${
|
|
86
|
+
${t.breakpoints.medium} {
|
|
87
87
|
/* Tablet + Desktop: 2rem */
|
|
88
|
-
line-height: ${
|
|
88
|
+
line-height: ${t.lineHeights[2]};
|
|
89
89
|
}
|
|
90
90
|
`}
|
|
91
|
-
`;case
|
|
91
|
+
`;case Ro:return s.css`
|
|
92
92
|
/* -------------------------------------------------------------
|
|
93
93
|
* Font Size
|
|
94
94
|
* -------------------------------------------------------------*/
|
|
95
|
-
${
|
|
95
|
+
${a||s.css`
|
|
96
96
|
/* Mobile: 1.8rem */
|
|
97
|
-
font-size: ${
|
|
97
|
+
font-size: ${t.fontSizes[4]};
|
|
98
98
|
|
|
99
|
-
${
|
|
99
|
+
${t.breakpoints.medium} {
|
|
100
100
|
/* Tablet + Desktop: 1.6rem */
|
|
101
|
-
font-size: ${
|
|
101
|
+
font-size: ${t.fontSizes[3]};
|
|
102
102
|
}
|
|
103
103
|
`}
|
|
104
104
|
|
|
105
105
|
/* -------------------------------------------------------------
|
|
106
106
|
* Line Height
|
|
107
107
|
* -------------------------------------------------------------*/
|
|
108
|
-
${s
|
|
108
|
+
${i||s.css`
|
|
109
109
|
/* Mobile: 2.4rem */
|
|
110
|
-
line-height: ${
|
|
110
|
+
line-height: ${t.lineHeights[3]};
|
|
111
111
|
|
|
112
|
-
${
|
|
112
|
+
${t.breakpoints.medium} {
|
|
113
113
|
/* Tablet + Desktop: 2.4rem */
|
|
114
|
-
line-height: ${
|
|
114
|
+
line-height: ${t.lineHeights[6]};
|
|
115
115
|
}
|
|
116
116
|
`}
|
|
117
|
-
`;case
|
|
117
|
+
`;case tr:return s.css`
|
|
118
118
|
/* -------------------------------------------------------------
|
|
119
119
|
* Font Size
|
|
120
120
|
* -------------------------------------------------------------*/
|
|
121
|
-
${
|
|
121
|
+
${a||s.css`
|
|
122
122
|
/* Mobile: 1.6rem */
|
|
123
|
-
font-size: ${
|
|
123
|
+
font-size: ${t.fontSizes[3]};
|
|
124
124
|
|
|
125
|
-
${
|
|
125
|
+
${t.breakpoints.medium} {
|
|
126
126
|
/* Tablet + Desktop: 1.4rem */
|
|
127
|
-
font-size: ${
|
|
127
|
+
font-size: ${t.fontSizes[2]};
|
|
128
128
|
}
|
|
129
129
|
`}
|
|
130
130
|
|
|
131
131
|
/* -------------------------------------------------------------
|
|
132
132
|
* Line Height
|
|
133
133
|
* -------------------------------------------------------------*/
|
|
134
|
-
${s
|
|
134
|
+
${i||s.css`
|
|
135
135
|
/* Mobile: 2.4rem */
|
|
136
|
-
line-height: ${
|
|
136
|
+
line-height: ${t.lineHeights[6]};
|
|
137
137
|
|
|
138
|
-
${
|
|
138
|
+
${t.breakpoints.medium} {
|
|
139
139
|
/* Tablet + Desktop: 2.0rem */
|
|
140
|
-
line-height: ${
|
|
140
|
+
line-height: ${t.lineHeights[4]};
|
|
141
141
|
}
|
|
142
142
|
`}
|
|
143
|
-
`;case
|
|
143
|
+
`;case To:return s.css`
|
|
144
144
|
/* -------------------------------------------------------------
|
|
145
145
|
* Font Size
|
|
146
146
|
* -------------------------------------------------------------*/
|
|
147
|
-
${
|
|
147
|
+
${a||s.css`
|
|
148
148
|
/* All: 1.2rem */
|
|
149
|
-
font-size: ${
|
|
149
|
+
font-size: ${t.fontSizes[1]};
|
|
150
150
|
`}
|
|
151
151
|
|
|
152
152
|
/* -------------------------------------------------------------
|
|
153
153
|
* Line Height
|
|
154
154
|
* -------------------------------------------------------------*/
|
|
155
|
-
${s
|
|
155
|
+
${i||s.css`
|
|
156
156
|
/* All: 1.6rem */
|
|
157
|
-
line-height: ${
|
|
157
|
+
line-height: ${t.lineHeights[3]};
|
|
158
158
|
`}
|
|
159
|
-
`;case
|
|
160
|
-
font-weight: ${
|
|
159
|
+
`;case Io:return s.css`
|
|
160
|
+
font-weight: ${t.fontWeights.bold};
|
|
161
161
|
text-transform: uppercase;
|
|
162
162
|
|
|
163
163
|
/* -------------------------------------------------------------
|
|
164
164
|
* Font Size
|
|
165
165
|
* -------------------------------------------------------------*/
|
|
166
|
-
${
|
|
166
|
+
${a||s.css`
|
|
167
167
|
/* All: 1.1rem */
|
|
168
|
-
font-size: ${
|
|
168
|
+
font-size: ${t.fontSizes[0]};
|
|
169
169
|
`}
|
|
170
170
|
|
|
171
171
|
/* -------------------------------------------------------------
|
|
172
172
|
* Line Height
|
|
173
173
|
* -------------------------------------------------------------*/
|
|
174
|
-
${s
|
|
174
|
+
${i||s.css`
|
|
175
175
|
/* All: 1.6rem */
|
|
176
|
-
line-height: ${
|
|
176
|
+
line-height: ${t.lineHeights[5]};
|
|
177
177
|
`}
|
|
178
|
-
`;default:return
|
|
178
|
+
`;default:return s.css`
|
|
179
179
|
/* -------------------------------------------------------------
|
|
180
180
|
* Font Size
|
|
181
181
|
* -------------------------------------------------------------*/
|
|
182
|
-
${
|
|
182
|
+
${a||s.css`
|
|
183
183
|
/* Mobile: 1.6rem */
|
|
184
|
-
font-size: ${
|
|
184
|
+
font-size: ${t.fontSizes[3]};
|
|
185
185
|
|
|
186
|
-
${
|
|
186
|
+
${t.breakpoints.medium} {
|
|
187
187
|
/* Tablet + Desktop: 1.4rem */
|
|
188
|
-
font-size: ${
|
|
188
|
+
font-size: ${t.fontSizes[2]};
|
|
189
189
|
}
|
|
190
190
|
`}
|
|
191
|
-
`}},
|
|
192
|
-
${({$variant:
|
|
193
|
-
${({$ellipsis:
|
|
194
|
-
|
|
195
|
-
${({theme:
|
|
196
|
-
`,[
|
|
197
|
-
background-color: ${
|
|
198
|
-
|
|
199
|
-
${
|
|
200
|
-
border-radius: ${
|
|
201
|
-
border: solid 1px ${
|
|
202
|
-
`:
|
|
191
|
+
`}},T=ae((e,t)=>{const{ellipsis:n,textColor:o="currentcolor",textDecoration:a,textTransform:i,variant:c,lineHeight:d,fontWeight:u,fontSize:h,...f}=e,g={$ellipsis:n,$textColor:o,$textDecoration:a,$textTransform:i,$variant:c,$lineHeight:d,$fontWeight:u,$fontSize:h};return r.jsx(Eo,{ref:t,tag:"span",...g,...f})}),Eo=s.styled(v)`
|
|
192
|
+
${({$variant:e,$fontSize:t,$lineHeight:n,theme:o})=>Do({$variant:e,theme:o,$fontSize:t,$lineHeight:n})}
|
|
193
|
+
${({$ellipsis:e})=>e?jr:""}
|
|
194
|
+
|
|
195
|
+
${({theme:e,...t})=>ke({color:t.$textColor,textDecoration:t.$textDecoration,textTransform:t.$textTransform,lineHeight:t.$lineHeight,fontWeight:t.$fontWeight,fontSize:t.$fontSize},e)}
|
|
196
|
+
`,[Ao,Dt]=Oe("Accordion"),zo=l.forwardRef(({children:e,size:t="S",...n},o)=>r.jsx(Lo,{ref:o,$size:t,collapsible:!0,...n,type:"single",children:r.jsx(Ao,{size:t,children:e})})),Lo=s.styled(Ue.Root)`
|
|
197
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
198
|
+
|
|
199
|
+
${e=>e.$size==="S"?s.css`
|
|
200
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
201
|
+
border: solid 1px ${t=>t.theme.colors.neutral200};
|
|
202
|
+
`:s.css`
|
|
203
203
|
|
|
204
204
|
`}
|
|
205
|
-
`,
|
|
205
|
+
`,Oo=l.forwardRef((e,t)=>{const{size:n}=Dt("Item");return r.jsx(Po,{$size:n,"data-size":n,ref:t,...e})}),Po=s.styled(Ue.Item)`
|
|
206
206
|
overflow: hidden;
|
|
207
207
|
margin: 1px 0;
|
|
208
208
|
|
|
@@ -220,67 +220,67 @@
|
|
|
220
220
|
|
|
221
221
|
&[data-size='S'] {
|
|
222
222
|
& + & {
|
|
223
|
-
border-top: solid 1px ${
|
|
223
|
+
border-top: solid 1px ${e=>e.theme.colors.neutral200};
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
&[data-state='open'] {
|
|
228
|
-
box-shadow: 0 0 0 1px ${
|
|
228
|
+
box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary600};
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
&:not([data-disabled]):hover {
|
|
232
|
-
box-shadow: 0 0 0 1px ${
|
|
232
|
+
box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary600};
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/* This applies our desired focus effect correctly. */
|
|
236
236
|
&:focus-within {
|
|
237
237
|
position: relative;
|
|
238
238
|
z-index: 1;
|
|
239
|
-
box-shadow: 0 0 0 1px ${
|
|
239
|
+
box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary600};
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
@media (prefers-reduced-motion: no-preference) {
|
|
243
|
-
transition: box-shadow ${
|
|
244
|
-
${
|
|
243
|
+
transition: box-shadow ${e=>e.theme.motion.timings[120]}
|
|
244
|
+
${e=>e.theme.motion.easings.easeOutQuad};
|
|
245
245
|
}
|
|
246
|
-
`,
|
|
247
|
-
color: ${
|
|
246
|
+
`,Mo=l.forwardRef(({caretPosition:e="left",description:t,icon:n,iconProps:o,children:a,...i},c)=>{const{size:d}=Dt("Trigger");return r.jsxs(kr,{$caretPosition:e,$size:d,ref:c,...i,children:[e==="left"?r.jsx(tt,{$size:d,children:r.jsx(O.CaretDown,{width:d==="S"?"1.2rem":"1.6rem",height:d==="S"?"1.2rem":"1.6rem"})}):null,r.jsxs(C,{tag:"span",gap:2,overflow:"hidden",children:[n&&d==="S"?r.jsx(vr,{children:r.jsx(n,{...o})}):null,r.jsxs(C,{alignItems:"flex-start",direction:"column",tag:"span",ref:c,overflow:"hidden",children:[r.jsx(T,{fontWeight:d==="S"?"bold":void 0,ellipsis:!0,variant:d==="M"?"delta":void 0,textAlign:"left",width:"100%",children:a}),t&&d==="M"?r.jsx(T,{textAlign:"left",children:t}):null]})]}),e==="right"?r.jsx(tt,{$size:d,children:r.jsx(O.CaretDown,{width:d==="S"?"1.2rem":"1.6rem",height:d==="S"?"1.2rem":"1.6rem"})}):null]})}),vr=s.styled(v)`
|
|
247
|
+
color: ${e=>e.theme.colors.neutral500};
|
|
248
248
|
display: flex;
|
|
249
249
|
|
|
250
250
|
@media (prefers-reduced-motion: no-preference) {
|
|
251
|
-
transition: ${
|
|
251
|
+
transition: ${e=>e.theme.transitions.color};
|
|
252
252
|
}
|
|
253
|
-
`,
|
|
254
|
-
background-color: ${
|
|
255
|
-
width: ${
|
|
256
|
-
height: ${
|
|
257
|
-
flex: ${
|
|
253
|
+
`,tt=s.styled(C).attrs(e=>({...e,tag:"span"}))`
|
|
254
|
+
background-color: ${e=>e.theme.colors.neutral200};
|
|
255
|
+
width: ${e=>e.$size==="S"?"2.4rem":"3.2rem"};
|
|
256
|
+
height: ${e=>e.$size==="S"?"2.4rem":"3.2rem"};
|
|
257
|
+
flex: ${e=>e.$size==="S"?"0 0 2.4rem":"0 0 3.2rem"};
|
|
258
258
|
border-radius: 50%;
|
|
259
259
|
justify-content: center;
|
|
260
260
|
|
|
261
261
|
@media (prefers-reduced-motion: no-preference) {
|
|
262
262
|
transition:
|
|
263
|
-
transform ${
|
|
264
|
-
${
|
|
263
|
+
transform ${e=>e.theme.motion.timings[200]} ${e=>e.theme.motion.easings.authenticMotion},
|
|
264
|
+
${e=>e.theme.transitions.backgroundColor};
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`,kr=s.styled(Ue.Trigger)`
|
|
267
267
|
display: flex;
|
|
268
268
|
align-items: center;
|
|
269
|
-
justify-content: ${
|
|
269
|
+
justify-content: ${e=>e.$caretPosition==="left"?"flex-start":"space-between"};
|
|
270
270
|
width: 100%;
|
|
271
|
-
gap: ${
|
|
272
|
-
padding-inline: ${
|
|
273
|
-
padding-block: ${
|
|
271
|
+
gap: ${e=>e.theme.spaces[4]};
|
|
272
|
+
padding-inline: ${e=>e.$size==="S"?e.theme.spaces[4]:e.theme.spaces[6]};
|
|
273
|
+
padding-block: ${e=>e.$size==="S"?e.theme.spaces[3]:e.theme.spaces[6]};
|
|
274
274
|
cursor: pointer;
|
|
275
|
-
color: ${
|
|
275
|
+
color: ${e=>e.theme.colors.neutral800};
|
|
276
276
|
overflow: hidden;
|
|
277
277
|
|
|
278
278
|
&[data-disabled] {
|
|
279
279
|
cursor: default;
|
|
280
|
-
color: ${
|
|
280
|
+
color: ${e=>e.theme.colors.neutral600};
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
&[data-state='open'] > ${
|
|
283
|
+
&[data-state='open'] > ${tt} {
|
|
284
284
|
transform: rotate(180deg);
|
|
285
285
|
}
|
|
286
286
|
|
|
@@ -290,86 +290,86 @@
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
@media (prefers-reduced-motion: no-preference) {
|
|
293
|
-
transition: ${
|
|
293
|
+
transition: ${e=>e.theme.transitions.color};
|
|
294
294
|
}
|
|
295
|
-
`,
|
|
296
|
-
padding-inline: ${
|
|
297
|
-
padding-block: ${
|
|
295
|
+
`,Bo=l.forwardRef((e,t)=>{const{size:n}=Dt("Trigger");return r.jsx(Sr,{$size:n,...e,ref:t})}),Sr=s.styled(C).attrs(e=>({...e,tag:"span"}))`
|
|
296
|
+
padding-inline: ${e=>e.$size==="S"?e.theme.spaces[2]:e.theme.spaces[6]};
|
|
297
|
+
padding-block: ${e=>e.$size==="S"?e.theme.spaces[2]:e.theme.spaces[6]};
|
|
298
298
|
|
|
299
299
|
// Remove default IconButton styles so there are no backgrounds or borders.
|
|
300
300
|
& > button {
|
|
301
301
|
border: none;
|
|
302
302
|
background: none;
|
|
303
|
-
color: ${
|
|
303
|
+
color: ${e=>e.theme.colors.neutral600};
|
|
304
304
|
|
|
305
305
|
@media (prefers-reduced-motion: no-preference) {
|
|
306
|
-
transition: ${
|
|
306
|
+
transition: ${e=>e.theme.transitions.color};
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
`,
|
|
309
|
+
`,No=l.forwardRef(({variant:e="primary",...t},n)=>r.jsx(Wo,{$variant:e,ref:n,...t})),Wo=s.styled(Ue.Header)`
|
|
310
310
|
display: flex;
|
|
311
311
|
align-items: center;
|
|
312
|
-
background-color: ${
|
|
312
|
+
background-color: ${e=>e.$variant==="primary"?e.theme.colors.neutral0:e.theme.colors.neutral100};
|
|
313
313
|
|
|
314
314
|
&[data-disabled] {
|
|
315
|
-
background-color: ${
|
|
315
|
+
background-color: ${e=>e.theme.colors.neutral150};
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
&:not([data-disabled]) {
|
|
319
319
|
&:hover,
|
|
320
320
|
&[data-state='open'] {
|
|
321
|
-
background-color: ${
|
|
321
|
+
background-color: ${e=>e.theme.colors.primary100};
|
|
322
322
|
|
|
323
|
-
& > ${
|
|
324
|
-
color: ${
|
|
323
|
+
& > ${kr} {
|
|
324
|
+
color: ${e=>e.theme.colors.primary600};
|
|
325
325
|
|
|
326
|
-
& ${
|
|
327
|
-
color: ${
|
|
326
|
+
& ${vr} {
|
|
327
|
+
color: ${e=>e.theme.colors.primary600};
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
& ${
|
|
331
|
-
background-color: ${
|
|
330
|
+
& ${tt} {
|
|
331
|
+
background-color: ${e=>e.theme.colors.primary200};
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
& > ${
|
|
336
|
-
color: ${
|
|
335
|
+
& > ${Sr} > button {
|
|
336
|
+
color: ${e=>e.theme.colors.primary600};
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
@media (prefers-reduced-motion: no-preference) {
|
|
342
|
-
transition: ${
|
|
342
|
+
transition: ${e=>e.theme.transitions.backgroundColor};
|
|
343
343
|
}
|
|
344
|
-
`,
|
|
344
|
+
`,Fo=l.forwardRef((e,t)=>r.jsx(Vo,{ref:t,...e})),Ho=s.keyframes`
|
|
345
345
|
from {
|
|
346
346
|
height: 0;
|
|
347
347
|
}
|
|
348
348
|
to {
|
|
349
349
|
height: var(--radix-accordion-content-height);
|
|
350
350
|
}
|
|
351
|
-
`,
|
|
351
|
+
`,_o=s.keyframes`
|
|
352
352
|
from {
|
|
353
353
|
height: var(--radix-accordion-content-height);
|
|
354
354
|
}
|
|
355
355
|
to {
|
|
356
356
|
height: 0;
|
|
357
357
|
}
|
|
358
|
-
`,
|
|
358
|
+
`,Vo=s.styled(Ue.Content)`
|
|
359
359
|
overflow: hidden;
|
|
360
360
|
|
|
361
361
|
@media (prefers-reduced-motion: no-preference) {
|
|
362
362
|
&[data-state='open'] {
|
|
363
|
-
animation: ${
|
|
364
|
-
${
|
|
363
|
+
animation: ${Ho} ${e=>e.theme.motion.timings[320]}
|
|
364
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
&[data-state='closed'] {
|
|
368
|
-
animation: ${
|
|
369
|
-
${
|
|
368
|
+
animation: ${_o} ${e=>e.theme.motion.timings[320]}
|
|
369
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`,qo=Object.freeze(Object.defineProperty({__proto__:null,Actions:Bo,Content:Fo,Header:No,Item:Oo,Root:zo,Trigger:Mo},Symbol.toStringTag,{value:"Module"})),st=s.css`
|
|
373
373
|
position: relative;
|
|
374
374
|
outline: none;
|
|
375
375
|
|
|
@@ -397,10 +397,10 @@
|
|
|
397
397
|
bottom: -5px;
|
|
398
398
|
left: -5px;
|
|
399
399
|
right: -5px;
|
|
400
|
-
border: 2px solid ${
|
|
400
|
+
border: 2px solid ${e=>e.theme.colors.primary600};
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
`,
|
|
403
|
+
`,me=({tag:e,...t})=>{const n=e||"span";return r.jsx(Uo,{...t,as:n})},Uo=s.styled.span`
|
|
404
404
|
border: 0;
|
|
405
405
|
clip: rect(0 0 0 0);
|
|
406
406
|
height: 1px;
|
|
@@ -409,33 +409,33 @@
|
|
|
409
409
|
padding: 0;
|
|
410
410
|
position: absolute;
|
|
411
411
|
width: 1px;
|
|
412
|
-
`,
|
|
413
|
-
${
|
|
414
|
-
`,
|
|
412
|
+
`,Se=({children:e,label:t})=>{const n=l.Children.only(e);return r.jsxs(r.Fragment,{children:[l.cloneElement(n,{"aria-hidden":"true",focusable:"false"}),r.jsx(me,{children:t})]})};Se.displayName="AccessibleIcon";const Rr=e=>{switch(e){case"danger":return"danger100";case"success":return"success100";case"warning":return"warning100";default:return"primary100"}},Go=e=>Rr(e).replace("100","200"),xt=({theme:e,$variant:t})=>t==="danger"?e.colors.danger700:t==="success"?e.colors.success700:t==="warning"?e.colors.warning700:e.colors.primary700,Ko=s.styled(v)`
|
|
413
|
+
${st};
|
|
414
|
+
`,Yo=s.styled(C)`
|
|
415
415
|
svg {
|
|
416
416
|
height: 100%;
|
|
417
417
|
width: 100%;
|
|
418
418
|
|
|
419
419
|
path {
|
|
420
|
-
fill: ${
|
|
420
|
+
fill: ${xt};
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
`,
|
|
423
|
+
`,Qo=({variant:e,...t})=>e==="success"?r.jsx(O.CheckCircle,{...t}):e==="danger"||e==="warning"?r.jsx(O.WarningCircle,{...t}):r.jsx(O.Information,{...t}),Xo=s.styled(v)`
|
|
424
424
|
& a > span {
|
|
425
|
-
color: ${
|
|
425
|
+
color: ${xt};
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
svg path {
|
|
429
|
-
fill: ${
|
|
429
|
+
fill: ${xt};
|
|
430
430
|
}
|
|
431
|
-
`,
|
|
431
|
+
`,Zo=({title:e,children:t,variant:n="default",onClose:o,closeLabel:a,titleAs:i="p",action:c,...d})=>r.jsxs(C,{alignItems:"flex-start",background:Rr(n),borderColor:Go(n),shadow:"filterShadow",gap:3,hasRadius:!0,padding:5,paddingRight:6,...d,children:[r.jsx(Yo,{height:"2rem",shrink:0,$variant:n,width:"2rem",children:r.jsx(Qo,{"aria-hidden":!0,variant:n})}),r.jsxs(C,{alignItems:"start",gap:c?2:1,wrap:"wrap",role:n==="danger"?"alert":"status",width:"100%",children:[e&&r.jsx(T,{fontWeight:"bold",textColor:"neutral800",tag:i,children:e}),r.jsx(T,{tag:"p",textColor:"neutral800",children:t}),c&&r.jsx(Xo,{$variant:n,children:c})]}),r.jsx(Ko,{tag:"button",background:"transparent",borderColor:void 0,height:"1.6rem",width:"1.6rem",marginTop:1,onClick:o,color:"neutral700",children:r.jsx(Se,{label:a,children:r.jsx(O.Cross,{})})})]});function le({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=Et({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o,d=xr.useCallbackRef(n),u=l.useCallback(h=>{if(i){const g=typeof h=="function"?h(e):h;g!==e&&d(g)}else a(h)},[i,e,a,d]);return[c,u]}function Et({defaultProp:e,onChange:t}){const n=l.useState(e),[o]=n,a=l.useRef(o),i=xr.useCallbackRef(t);return l.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}const $t={easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInQuart:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",easeInOutFast:"cubic-bezier(1,0,0,1)",authenticMotion:"cubic-bezier(.4,0,.2,1)"},yt={320:"320ms",200:"200ms",120:"120ms"},Jo={color:`color ${yt[120]} ${$t.easeOutQuad}`,backgroundColor:`background-color ${yt[120]} ${$t.easeOutQuad}`},q={overlayFadeIn:s.keyframes`
|
|
432
432
|
from {
|
|
433
433
|
opacity: 0;
|
|
434
434
|
}
|
|
435
435
|
to {
|
|
436
436
|
opacity: 0.2;
|
|
437
437
|
}
|
|
438
|
-
`,modalPopIn:
|
|
438
|
+
`,modalPopIn:s.keyframes`
|
|
439
439
|
from {
|
|
440
440
|
transform:translate(-50%, -50%) scale(0.8);
|
|
441
441
|
opacity: 0;
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
transform: translate(-50%, -50%) scale(1);
|
|
445
445
|
opacity: 1;
|
|
446
446
|
}
|
|
447
|
-
`,modalPopOut:
|
|
447
|
+
`,modalPopOut:s.keyframes`
|
|
448
448
|
from {
|
|
449
449
|
transform: translate(-50%, -50%) scale(1);
|
|
450
450
|
opacity: 1;
|
|
@@ -453,7 +453,7 @@
|
|
|
453
453
|
transform:translate(-50%, -50%) scale(0.8);
|
|
454
454
|
opacity: 0;
|
|
455
455
|
}
|
|
456
|
-
`,popIn:
|
|
456
|
+
`,popIn:s.keyframes`
|
|
457
457
|
from {
|
|
458
458
|
transform: scale(0.8);
|
|
459
459
|
opacity: 0;
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
transform: scale(1);
|
|
463
463
|
opacity: 1;
|
|
464
464
|
}
|
|
465
|
-
`,popOut:
|
|
465
|
+
`,popOut:s.keyframes`
|
|
466
466
|
from {
|
|
467
467
|
transform: scale(1);
|
|
468
468
|
opacity: 1;
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
transform: scale(0.8);
|
|
472
472
|
opacity: 0;
|
|
473
473
|
}
|
|
474
|
-
`,slideDownIn:
|
|
474
|
+
`,slideDownIn:s.keyframes`
|
|
475
475
|
from {
|
|
476
476
|
opacity: 0;
|
|
477
477
|
transform: translateY(-10px);
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
opacity: 1;
|
|
481
481
|
transform: translateY(0);
|
|
482
482
|
}
|
|
483
|
-
`,slideDownOut:
|
|
483
|
+
`,slideDownOut:s.keyframes`
|
|
484
484
|
from {
|
|
485
485
|
opacity: 1;
|
|
486
486
|
transform: translateY(0);
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
opacity: 0;
|
|
490
490
|
transform: translateY(-10px);
|
|
491
491
|
}
|
|
492
|
-
`,slideUpIn:
|
|
492
|
+
`,slideUpIn:s.keyframes`
|
|
493
493
|
from {
|
|
494
494
|
opacity: 0;
|
|
495
495
|
transform: translateY(10px);
|
|
@@ -498,7 +498,7 @@
|
|
|
498
498
|
opacity: 1;
|
|
499
499
|
transform: translateY(0);
|
|
500
500
|
}
|
|
501
|
-
`,slideUpOut:
|
|
501
|
+
`,slideUpOut:s.keyframes`
|
|
502
502
|
from {
|
|
503
503
|
opacity: 1;
|
|
504
504
|
transform: translateY(0);
|
|
@@ -507,21 +507,21 @@
|
|
|
507
507
|
opacity: 0;
|
|
508
508
|
transform: translateY(10px);
|
|
509
509
|
}
|
|
510
|
-
`,fadeIn:
|
|
510
|
+
`,fadeIn:s.keyframes`
|
|
511
511
|
from {
|
|
512
512
|
opacity: 0;
|
|
513
513
|
}
|
|
514
514
|
to {
|
|
515
515
|
opacity: 1;
|
|
516
516
|
}
|
|
517
|
-
`,fadeOut:
|
|
517
|
+
`,fadeOut:s.keyframes`
|
|
518
518
|
from {
|
|
519
519
|
opacity: 1;
|
|
520
520
|
}
|
|
521
521
|
to {
|
|
522
522
|
opacity: 0;
|
|
523
523
|
}
|
|
524
|
-
`},
|
|
524
|
+
`},qe=32,rr=2,ea=l.forwardRef(({onLoadingStatusChange:e,delayMs:t=600,src:n,alt:o,crossOrigin:a,fallback:i,preview:c=!1,...d},u)=>{const[h,f]=le({onChange:e}),[g,p]=l.useState(!1),w=c&&h==="loaded",m=$=>{w&&p($)};return r.jsxs(xe.Root,{onOpenChange:m,children:[r.jsx(xe.Trigger,{asChild:!0,children:r.jsxs(wt,{ref:u,...d,children:[w?r.jsx(ta,{width:"100%",height:"100%",position:"absolute",background:"neutral0",zIndex:"overlay",style:{opacity:g?.4:0}}):null,r.jsx(ra,{src:n,alt:o,crossOrigin:a,onLoadingStatusChange:f}),r.jsx(Tt.Fallback,{delayMs:t,children:r.jsx(T,{fontWeight:"bold",textTransform:"uppercase",children:i})})]})}),w?r.jsx(xe.Portal,{children:r.jsx(na,{side:"top",sideOffset:4,children:r.jsx(oa,{src:n,alt:o,crossOrigin:a})})}):null]})}),Tr=s.css`
|
|
525
525
|
display: inline-flex;
|
|
526
526
|
align-items: center;
|
|
527
527
|
justify-content: center;
|
|
@@ -530,321 +530,321 @@
|
|
|
530
530
|
user-select: none;
|
|
531
531
|
overflow: hidden;
|
|
532
532
|
border-radius: 50%;
|
|
533
|
-
`,
|
|
533
|
+
`,Ir=s.css`
|
|
534
534
|
width: 100%;
|
|
535
535
|
height: 100%;
|
|
536
536
|
object-fit: cover;
|
|
537
537
|
border-radius: inherit;
|
|
538
|
-
`,
|
|
538
|
+
`,wt=s.styled(Tt.Root)`
|
|
539
539
|
position: relative;
|
|
540
540
|
z-index: 0;
|
|
541
|
-
${
|
|
542
|
-
width: ${
|
|
543
|
-
height: ${
|
|
541
|
+
${Tr}
|
|
542
|
+
width: ${qe/10}rem;
|
|
543
|
+
height: ${qe/10}rem;
|
|
544
544
|
/* TODO: we should get the user email & hash it to turn it into a hex-value so different emails can consistently get a different background */
|
|
545
|
-
background-color: ${
|
|
546
|
-
color: ${
|
|
547
|
-
`,
|
|
545
|
+
background-color: ${e=>e.theme.colors.primary600};
|
|
546
|
+
color: ${e=>e.theme.colors.neutral0};
|
|
547
|
+
`,ta=s.styled(v)`
|
|
548
548
|
@media (prefers-reduced-motion: no-preference) {
|
|
549
|
-
transition: opacity ${
|
|
550
|
-
${
|
|
549
|
+
transition: opacity ${e=>e.theme.motion.timings[200]}
|
|
550
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
551
551
|
}
|
|
552
|
-
`,
|
|
553
|
-
${
|
|
554
|
-
`,
|
|
555
|
-
${
|
|
556
|
-
width: ${
|
|
557
|
-
height: ${
|
|
552
|
+
`,ra=s.styled(Tt.Image)`
|
|
553
|
+
${Ir}
|
|
554
|
+
`,na=s.styled(xe.Content)`
|
|
555
|
+
${Tr}
|
|
556
|
+
width: ${qe*rr/10}rem;
|
|
557
|
+
height: ${qe*rr/10}rem;
|
|
558
558
|
|
|
559
559
|
@media (prefers-reduced-motion: no-preference) {
|
|
560
|
-
animation: ${
|
|
561
|
-
${
|
|
562
|
-
}
|
|
563
|
-
`,
|
|
564
|
-
${
|
|
565
|
-
`,
|
|
566
|
-
& > ${
|
|
567
|
-
margin-left: -${
|
|
568
|
-
}
|
|
569
|
-
`,
|
|
570
|
-
border-radius: ${({theme:
|
|
571
|
-
${({$size:
|
|
560
|
+
animation: ${q.fadeIn} ${e=>e.theme.motion.timings[200]}
|
|
561
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
562
|
+
}
|
|
563
|
+
`,oa=s.styled.img`
|
|
564
|
+
${Ir}
|
|
565
|
+
`,aa=l.forwardRef((e,t)=>r.jsx(sa,{...e,ref:t,tag:"div"})),sa=s.styled(C)`
|
|
566
|
+
& > ${wt} + ${wt} {
|
|
567
|
+
margin-left: -${qe/10/2}rem;
|
|
568
|
+
}
|
|
569
|
+
`,ia=Object.freeze(Object.defineProperty({__proto__:null,Group:aa,Item:ea},Symbol.toStringTag,{value:"Module"})),At=({active:e=!1,size:t="M",textColor:n="neutral600",backgroundColor:o="neutral150",variant:a,children:i,minWidth:c=5,...d})=>{const u=t==="S"?1:2,h=a?{backgroundColor:`${a}200`,textColor:`${a}700`}:{backgroundColor:o,textColor:n};return r.jsx(la,{inline:!0,alignItems:"center",justifyContent:"center",minWidth:c,paddingLeft:u,paddingRight:u,background:e?"primary200":h.backgroundColor,$size:t,...d,children:r.jsx(T,{variant:"sigma",textColor:e?"primary600":h.textColor,lineHeight:"1rem",children:i})})},la=s.styled(C)`
|
|
570
|
+
border-radius: ${({theme:e,$size:t})=>t==="S"?"2px":e.borderRadius};
|
|
571
|
+
${({$size:e,theme:t})=>e==="S"?s.css`
|
|
572
572
|
padding-block: 0.3rem;
|
|
573
|
-
padding-inline ${
|
|
574
|
-
`:
|
|
573
|
+
padding-inline ${t.spaces[1]}
|
|
574
|
+
`:s.css`
|
|
575
575
|
padding-block: 0.7rem;
|
|
576
|
-
padding-inline ${
|
|
576
|
+
padding-inline ${t.spaces[2]}
|
|
577
577
|
`};
|
|
578
|
-
`,
|
|
578
|
+
`,ca=s.styled(v)`
|
|
579
579
|
text-decoration: none;
|
|
580
580
|
|
|
581
581
|
&:visited {
|
|
582
582
|
color: inherit;
|
|
583
583
|
}
|
|
584
|
-
`,
|
|
584
|
+
`,Pe=ae(({href:e,disabled:t=!1,isExternal:n=!1,...o},a)=>r.jsx(ca,{tag:"a",ref:a,target:n?"_blank":void 0,rel:n?"noreferrer noopener":void 0,href:e,tabIndex:t?-1:void 0,"aria-disabled":t,pointerEvents:t?"none":void 0,cursor:t?void 0:"pointer",...o})),Dr=()=>r.jsx(v,{"aria-hidden":!0,paddingLeft:1,paddingRight:1,children:r.jsx(T,{variant:"pi",textColor:"neutral500",children:"/"})});Dr.displayName="Divider";const da=s.styled(C)`
|
|
585
585
|
// CrumbLinks do have padding-x, because they need to have a
|
|
586
586
|
// interaction effect, which mis-aligns the breadcrumbs on the left.
|
|
587
587
|
// This normalizes the behavior by moving the first item to left by
|
|
588
588
|
// the same amount it has inner padding
|
|
589
589
|
& > *:first-child {
|
|
590
|
-
margin-left: ${({theme:
|
|
591
|
-
}
|
|
592
|
-
`,
|
|
593
|
-
border-radius: ${({theme:
|
|
594
|
-
color: ${({theme:
|
|
595
|
-
font-size: ${({theme:
|
|
596
|
-
line-height: ${({theme:
|
|
597
|
-
padding: ${({theme:
|
|
590
|
+
margin-left: ${({theme:e})=>`calc(-1*${e.spaces[2]})`};
|
|
591
|
+
}
|
|
592
|
+
`,Er=l.forwardRef(({label:e,children:t,...n},o)=>{const a=l.Children.toArray(t);return r.jsx(v,{"aria-label":e,tag:"nav",...n,ref:o,children:r.jsx(da,{tag:"ol",children:l.Children.map(a,(i,c)=>{const d=a.length>1&&c+1<a.length;return r.jsxs(C,{inline:!0,tag:"li",children:[i,d&&r.jsx(Dr,{})]})})})})});Er.displayName="Breadcrumbs";const Ar=l.forwardRef(({children:e,isCurrent:t=!1,...n},o)=>r.jsx(v,{paddingLeft:2,paddingRight:2,paddingTop:1,paddingBottom:1,ref:o,children:r.jsx(T,{variant:"pi",textColor:"neutral800",fontWeight:t?"bold":"regular","aria-current":t,...n,children:e})}));Ar.displayName="Crumb";const ua=s.styled(Pe)`
|
|
593
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
594
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
595
|
+
font-size: ${({theme:e})=>e.fontSizes[1]};
|
|
596
|
+
line-height: ${({theme:e})=>e.lineHeights[4]};
|
|
597
|
+
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[2]}`};
|
|
598
598
|
text-decoration: none;
|
|
599
599
|
|
|
600
600
|
:hover,
|
|
601
601
|
:focus {
|
|
602
|
-
background-color: ${({theme:
|
|
603
|
-
color: ${({theme:
|
|
602
|
+
background-color: ${({theme:e})=>e.colors.neutral200};
|
|
603
|
+
color: ${({theme:e})=>e.colors.neutral700};
|
|
604
604
|
}
|
|
605
|
-
`,
|
|
606
|
-
border: 1px solid ${
|
|
607
|
-
background: ${
|
|
608
|
-
color: ${
|
|
605
|
+
`,zr=l.forwardRef(({children:e,...t},n)=>r.jsx(ua,{ref:n,...t,children:e}));zr.displayName="CrumbLink";const ze=e=>e.replaceAll(":","");function ha(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function zt(...e){return t=>e.forEach(n=>ha(n,t))}function te(...e){return l.useCallback(zt(...e),e)}function re(e){const t=X.useId();return(e==null?void 0:e.toString())??t}const Ge=(e,t,{selectorToWatch:n,skipWhen:o=!1})=>{const a=D.useCallbackRef(t);l.useEffect(()=>{if(o||!e.current)return;const i={root:e.current,rootMargin:"0px"},c=h=>{h.forEach(f=>{f.isIntersecting&&e.current&&e.current.scrollHeight>e.current.clientHeight&&a(f)})},d=new IntersectionObserver(c,i),u=e.current.querySelector(n);return u&&d.observe(u),()=>{d.disconnect()}},[o,a,n,e])},Lt="success-light",Ot="danger-light",it="default",Ke="tertiary",Ye="secondary",Lr="danger",Or="success",lt="ghost",Pt=[Lt,Ot],fa=[it,Ke,Ye,Lr,Or,lt,...Pt],ga=["XS","S","M","L"],ie=e=>e===Lt||e===Ot?`${e.substring(0,e.lastIndexOf("-"))}`:e===Ke?"neutral":e===it||e===Ye||fa.every(t=>t!==e)?"primary":`${e}`,Pr=({theme:e})=>s.css`
|
|
606
|
+
border: 1px solid ${e.colors.neutral200};
|
|
607
|
+
background: ${e.colors.neutral150};
|
|
608
|
+
color: ${e.colors.neutral600};
|
|
609
609
|
cursor: default;
|
|
610
|
-
`,
|
|
611
|
-
background-color: ${
|
|
612
|
-
`:
|
|
613
|
-
background-color: ${
|
|
614
|
-
`:
|
|
615
|
-
background-color: ${
|
|
616
|
-
`:
|
|
617
|
-
border: 1px solid ${
|
|
618
|
-
background: ${
|
|
619
|
-
`:
|
|
620
|
-
border: 1px solid ${
|
|
621
|
-
background: ${
|
|
622
|
-
`,
|
|
623
|
-
background-color: ${
|
|
624
|
-
border: 1px solid ${
|
|
625
|
-
color: ${
|
|
626
|
-
`:
|
|
627
|
-
background-color: ${
|
|
628
|
-
`:
|
|
629
|
-
border: 1px solid ${
|
|
630
|
-
background: ${
|
|
631
|
-
`,
|
|
632
|
-
border: 1px solid ${
|
|
633
|
-
background: ${
|
|
634
|
-
color: ${
|
|
635
|
-
`;case
|
|
636
|
-
border: 1px solid ${
|
|
637
|
-
background: ${
|
|
638
|
-
color: ${
|
|
639
|
-
`;case
|
|
610
|
+
`,Mr=({theme:e,$variant:t})=>[...Pt,Ye].includes(t)?s.css`
|
|
611
|
+
background-color: ${e.colors.neutral0};
|
|
612
|
+
`:t===Ke?s.css`
|
|
613
|
+
background-color: ${e.colors.neutral100};
|
|
614
|
+
`:t===lt?s.css`
|
|
615
|
+
background-color: ${e.colors.neutral100};
|
|
616
|
+
`:t===it?s.css`
|
|
617
|
+
border: 1px solid ${e.colors.buttonPrimary500};
|
|
618
|
+
background: ${e.colors.buttonPrimary500};
|
|
619
|
+
`:s.css`
|
|
620
|
+
border: 1px solid ${e.colors[`${ie(t)}500`]};
|
|
621
|
+
background: ${e.colors[`${ie(t)}500`]};
|
|
622
|
+
`,Br=({theme:e,$variant:t})=>[...Pt,Ye].includes(t)?s.css`
|
|
623
|
+
background-color: ${e.colors.neutral0};
|
|
624
|
+
border: 1px solid ${e.colors[`${ie(t)}600`]};
|
|
625
|
+
color: ${e.colors[`${ie(t)}600`]};
|
|
626
|
+
`:t===Ke||t===lt?s.css`
|
|
627
|
+
background-color: ${e.colors.neutral150};
|
|
628
|
+
`:s.css`
|
|
629
|
+
border: 1px solid ${e.colors[`${ie(t)}600`]};
|
|
630
|
+
background: ${e.colors[`${ie(t)}600`]};
|
|
631
|
+
`,Nr=({theme:e,$variant:t})=>{switch(t){case Ot:case Lt:case Ye:return s.css`
|
|
632
|
+
border: 1px solid ${e.colors[`${ie(t)}200`]};
|
|
633
|
+
background: ${e.colors[`${ie(t)}100`]};
|
|
634
|
+
color: ${e.colors[`${ie(t)}700`]};
|
|
635
|
+
`;case Ke:return s.css`
|
|
636
|
+
border: 1px solid ${e.colors.neutral200};
|
|
637
|
+
background: ${e.colors.neutral0};
|
|
638
|
+
color: ${e.colors.neutral800};
|
|
639
|
+
`;case lt:return s.css`
|
|
640
640
|
border: 1px solid transparent;
|
|
641
641
|
background: transparent;
|
|
642
|
-
color: ${
|
|
642
|
+
color: ${e.colors.neutral800};
|
|
643
643
|
|
|
644
644
|
svg {
|
|
645
|
-
fill: ${
|
|
645
|
+
fill: ${e.colors.neutral500};
|
|
646
646
|
}
|
|
647
|
-
`;case
|
|
648
|
-
border: 1px solid ${
|
|
649
|
-
background: ${
|
|
650
|
-
color: ${
|
|
651
|
-
`;default:return
|
|
652
|
-
border: 1px solid ${
|
|
653
|
-
background: ${
|
|
654
|
-
color: ${
|
|
655
|
-
`}},
|
|
647
|
+
`;case Or:case Lr:return s.css`
|
|
648
|
+
border: 1px solid ${e.colors[`${ie(t)}600`]};
|
|
649
|
+
background: ${e.colors[`${ie(t)}600`]};
|
|
650
|
+
color: ${e.colors.neutral0};
|
|
651
|
+
`;default:return s.css`
|
|
652
|
+
border: 1px solid ${e.colors.buttonPrimary600};
|
|
653
|
+
background: ${e.colors.buttonPrimary600};
|
|
654
|
+
color: ${e.colors.buttonNeutral0};
|
|
655
|
+
`}},rt=ae(({variant:e=it,startIcon:t,endIcon:n,disabled:o=!1,children:a,onClick:i,size:c=ga[1],loading:d=!1,fullWidth:u=!1,type:h="button",...f},g)=>{const p=o||d,w=k=>{!p&&i&&i(k)},m=f.tag??"button",$=m==="button"||m==="input"?h:void 0;return r.jsxs(ba,{ref:g,"aria-disabled":p,disabled:p,$size:c,$variant:e,tag:"button",onClick:w,hasRadius:!0,gap:2,inline:!0,alignItems:"center",justifyContent:"center",width:u?"100%":void 0,paddingLeft:4,paddingRight:4,cursor:"pointer",type:$,...f,children:[(t||d)&&r.jsx(C,{tag:"span","aria-hidden":!0,children:d?r.jsx(ma,{}):t}),r.jsx(T,{variant:c==="S"?"pi":void 0,fontWeight:"bold",children:a}),n&&r.jsx(C,{tag:"span","aria-hidden":!0,children:n})]})}),pa=s.keyframes`
|
|
656
656
|
from {
|
|
657
657
|
transform: rotate(0deg);
|
|
658
658
|
}
|
|
659
659
|
to {
|
|
660
660
|
transform: rotate(359deg);
|
|
661
661
|
}
|
|
662
|
-
`,
|
|
663
|
-
animation: ${
|
|
662
|
+
`,ma=s.styled(O.Loader)`
|
|
663
|
+
animation: ${pa} 2s infinite linear;
|
|
664
664
|
will-change: transform;
|
|
665
|
-
`,
|
|
666
|
-
${({theme:
|
|
665
|
+
`,ba=s.styled(C)`
|
|
666
|
+
${({theme:e,$size:t})=>{const n=e.sizes.button[t];if(typeof n=="string")return`height: ${n};`;const o=[];return Object.entries(n).forEach(([a,i])=>{if(i){if(a==="initial")o.push(`height: ${i};`);else if(a in e.breakpoints){const c=e.breakpoints[a];o.push(`${c} { height: ${i}; }`)}}}),o.join(`
|
|
667
667
|
`)}}
|
|
668
668
|
text-decoration: none;
|
|
669
|
-
${
|
|
669
|
+
${Nr}
|
|
670
670
|
|
|
671
671
|
&:hover {
|
|
672
|
-
${
|
|
672
|
+
${Mr}
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
&:active {
|
|
676
|
-
${
|
|
676
|
+
${Br}
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
&[aria-disabled='true'] {
|
|
680
|
-
${
|
|
680
|
+
${Pr}
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
@media (prefers-reduced-motion: no-preference) {
|
|
684
684
|
transition:
|
|
685
|
-
${
|
|
686
|
-
${
|
|
687
|
-
border-color ${
|
|
688
|
-
}
|
|
689
|
-
`,
|
|
690
|
-
background-color: ${
|
|
691
|
-
color: ${
|
|
692
|
-
padding-inline: ${
|
|
693
|
-
padding-block: ${
|
|
694
|
-
border-radius: ${
|
|
695
|
-
z-index: ${
|
|
685
|
+
${e=>e.theme.transitions.backgroundColor},
|
|
686
|
+
${e=>e.theme.transitions.color},
|
|
687
|
+
border-color ${e=>e.theme.motion.timings[200]} ${e=>e.theme.motion.easings.easeOutQuad};
|
|
688
|
+
}
|
|
689
|
+
`,ct=l.forwardRef(({children:e,description:t,label:n,defaultOpen:o,open:a,onOpenChange:i,delayDuration:c=500,disableHoverableContent:d,...u},h)=>!n&&!t?e:r.jsxs(xe.Root,{defaultOpen:o,open:a,onOpenChange:i,delayDuration:c,disableHoverableContent:d,children:[r.jsx(xe.Trigger,{asChild:!0,children:e}),r.jsx(xe.Portal,{children:r.jsx(xa,{ref:h,sideOffset:8,...u,children:r.jsx(T,{variant:"pi",fontWeight:"bold",children:n||t})})})]})),xa=s.styled(xe.Content)`
|
|
690
|
+
background-color: ${e=>e.theme.colors.neutral900};
|
|
691
|
+
color: ${e=>e.theme.colors.neutral0};
|
|
692
|
+
padding-inline: ${e=>e.theme.spaces[2]};
|
|
693
|
+
padding-block: ${e=>e.theme.spaces[2]};
|
|
694
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
695
|
+
z-index: ${e=>e.theme.zIndices.tooltip};
|
|
696
696
|
will-change: opacity;
|
|
697
697
|
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
698
698
|
|
|
699
699
|
@media (prefers-reduced-motion: no-preference) {
|
|
700
|
-
animation: ${
|
|
701
|
-
${
|
|
700
|
+
animation: ${q.fadeIn} ${e=>e.theme.motion.timings[200]}
|
|
701
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
702
702
|
}
|
|
703
|
-
`,
|
|
703
|
+
`,ge=ae(({label:e,background:t,children:n,disabled:o=!1,onClick:a,size:i="S",variant:c="tertiary",withTooltip:d=!0,type:u="button",...h},f)=>{const g=w=>{!o&&a&&a(w)},p=r.jsx(He,{"aria-disabled":o,background:o?"neutral150":t,tag:"button",display:"inline-flex",justifyContent:"center",hasRadius:!0,cursor:"pointer",...h,ref:f,$size:i,onClick:g,$variant:c,type:u,children:r.jsx(Se,{label:e,children:n})});return d?r.jsx(ct,{label:e,children:p}):p}),He=s.styled(C)`
|
|
704
704
|
text-decoration: none;
|
|
705
705
|
|
|
706
|
-
${
|
|
706
|
+
${e=>{switch(e.$size){case"XS":return s.css`
|
|
707
707
|
padding-block: 0.7rem;
|
|
708
708
|
padding-inline: 0.7rem;
|
|
709
709
|
|
|
710
|
-
${({theme:
|
|
710
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
711
711
|
padding-block: 0.2rem;
|
|
712
712
|
padding-inline: 0.2rem;
|
|
713
713
|
}
|
|
714
|
-
`;case"S":return
|
|
714
|
+
`;case"S":return s.css`
|
|
715
715
|
padding-block: 1.1rem;
|
|
716
716
|
padding-inline: 1.1rem;
|
|
717
717
|
|
|
718
|
-
${({theme:
|
|
718
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
719
719
|
padding-block: 0.7rem;
|
|
720
720
|
padding-inline: 0.7rem;
|
|
721
721
|
}
|
|
722
|
-
`;case"M":return
|
|
722
|
+
`;case"M":return s.css`
|
|
723
723
|
padding-block: 1.1rem;
|
|
724
724
|
padding-inline: 1.1rem;
|
|
725
725
|
|
|
726
|
-
${({theme:
|
|
726
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
727
727
|
padding-block: 0.9rem;
|
|
728
728
|
padding-inline: 0.9rem;
|
|
729
729
|
}
|
|
730
|
-
`;case"L":return
|
|
730
|
+
`;case"L":return s.css`
|
|
731
731
|
padding-block: 1.5rem;
|
|
732
732
|
padding-inline: 1.5rem;
|
|
733
733
|
|
|
734
|
-
${({theme:
|
|
734
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
735
735
|
padding-block: 1.1rem;
|
|
736
736
|
padding-inline: 1.1rem;
|
|
737
737
|
}
|
|
738
738
|
`}}}
|
|
739
|
-
${
|
|
740
|
-
${
|
|
741
|
-
color: ${
|
|
739
|
+
${Nr}
|
|
740
|
+
${e=>e.$variant==="tertiary"?s.css`
|
|
741
|
+
color: ${e.theme.colors.neutral500};
|
|
742
742
|
`:""}
|
|
743
743
|
|
|
744
744
|
&:hover {
|
|
745
|
-
${
|
|
746
|
-
${
|
|
747
|
-
color: ${
|
|
745
|
+
${Mr}
|
|
746
|
+
${e=>e.$variant==="tertiary"?s.css`
|
|
747
|
+
color: ${e.theme.colors.neutral600};
|
|
748
748
|
`:""}
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
&:active {
|
|
752
|
-
${
|
|
752
|
+
${Br}
|
|
753
753
|
}
|
|
754
754
|
|
|
755
755
|
&[aria-disabled='true'] {
|
|
756
|
-
${
|
|
756
|
+
${Pr}
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
@media (prefers-reduced-motion: no-preference) {
|
|
760
760
|
transition:
|
|
761
|
-
${
|
|
762
|
-
${
|
|
763
|
-
border-color ${
|
|
761
|
+
${e=>e.theme.transitions.backgroundColor},
|
|
762
|
+
${e=>e.theme.transitions.color},
|
|
763
|
+
border-color ${e=>e.theme.motion.timings[200]} ${e=>e.theme.motion.easings.easeOutQuad};
|
|
764
764
|
}
|
|
765
|
-
|
|
766
|
-
& ${
|
|
767
|
-
border-radius: ${({theme:
|
|
765
|
+
`,$a=s.styled(C)`
|
|
766
|
+
& ${He}:first-child {
|
|
767
|
+
border-radius: ${({theme:e})=>`${e.borderRadius} 0 0 ${e.borderRadius}`};
|
|
768
768
|
}
|
|
769
769
|
|
|
770
|
-
& ${
|
|
771
|
-
border-radius: ${({theme:
|
|
770
|
+
& ${He}:last-child {
|
|
771
|
+
border-radius: ${({theme:e})=>`0 ${e.borderRadius} ${e.borderRadius} 0`};
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
& ${
|
|
774
|
+
& ${He} {
|
|
775
775
|
border-radius: 0;
|
|
776
776
|
|
|
777
|
-
& + ${
|
|
777
|
+
& + ${He} {
|
|
778
778
|
border-left: none;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
`,
|
|
781
|
+
`,Wr=ae(({children:e,href:t,disabled:n=!1,startIcon:o,endIcon:a,isExternal:i=!1,color:c="primary600",activeColor:d="primary700",...u},h)=>r.jsxs(ya,{ref:h,href:t,disabled:n,isExternal:i,$activeColor:d,$color:c,...u,children:[o,r.jsx(T,{textColor:n?"neutral600":c,children:e}),a,t&&!a&&i&&r.jsx(O.ExternalLink,{fill:c})]})),ya=s.styled(Pe)`
|
|
782
782
|
display: inline-flex;
|
|
783
783
|
align-items: center;
|
|
784
784
|
text-decoration: none;
|
|
785
|
-
gap: ${({theme:
|
|
786
|
-
pointer-events: ${({disabled:
|
|
785
|
+
gap: ${({theme:e})=>e.spaces[2]};
|
|
786
|
+
pointer-events: ${({disabled:e})=>e?"none":void 0};
|
|
787
787
|
|
|
788
788
|
svg {
|
|
789
789
|
font-size: 1rem;
|
|
790
790
|
|
|
791
791
|
path {
|
|
792
|
-
fill: ${({disabled:
|
|
792
|
+
fill: ${({disabled:e,$color:t,theme:n})=>e?n.colors.neutral600:n.colors[t||"primary600"]};
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
&:hover {
|
|
797
797
|
& > span {
|
|
798
|
-
color: ${({theme:
|
|
798
|
+
color: ${({theme:e,$color:t})=>e.colors[t||"primary600"]};
|
|
799
799
|
}
|
|
800
800
|
|
|
801
801
|
svg path {
|
|
802
|
-
fill: ${({theme:
|
|
802
|
+
fill: ${({theme:e,$color:t})=>e.colors[t||"primary600"]};
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
|
|
806
806
|
&:active {
|
|
807
|
-
color: ${({theme:
|
|
807
|
+
color: ${({theme:e,$activeColor:t})=>e.colors[t||"primary700"]};
|
|
808
808
|
}
|
|
809
809
|
|
|
810
|
-
${
|
|
811
|
-
`,
|
|
810
|
+
${st};
|
|
811
|
+
`,wa=e=>{switch(e){case"danger":return"danger100";default:return"primary100"}},Ct=(e,t)=>{switch(e){case"danger":return t?"danger500":"danger700";default:return t?"neutral500":"neutral800"}},Ve=(e,t)=>{switch(e){case"danger":return t?"danger500":"danger700";default:return t?"neutral300":"neutral500"}},Ca=ce.Root,ja=l.forwardRef(({label:e,endIcon:t=r.jsx(O.CaretDown,{width:"1.2rem",height:"1.2rem","aria-hidden":!0}),tag:n=rt,icon:o,...a},i)=>{const c={...a,ref:i,type:"button"};return r.jsx(ce.Trigger,{asChild:!0,disabled:c.disabled,children:n===ge?r.jsx(ge,{label:e,variant:"tertiary",...c,children:o}):r.jsx(rt,{endIcon:t,variant:"ghost",...c})})}),va=l.forwardRef(({children:e,intersectionId:t,onCloseAutoFocus:n,popoverPlacement:o="bottom-start",...a},i)=>{const[c,d]=o.split("-");return r.jsx(ce.Portal,{children:r.jsx(ka,{align:d,side:c,loop:!0,onCloseAutoFocus:n,asChild:!0,children:r.jsxs(Fr,{ref:i,direction:"column",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,marginTop:1,marginBottom:1,alignItems:"flex-start",position:"relative",overflow:"auto",...a,children:[e,r.jsx(v,{id:t,width:"100%",height:"1px"})]})})})}),Fr=s.styled(C)`
|
|
812
812
|
scrollbar-width: none;
|
|
813
813
|
-ms-overflow-style: none;
|
|
814
814
|
-webkit-overflow-scrolling: touch;
|
|
815
|
-
z-index: ${
|
|
815
|
+
z-index: ${e=>e.theme.zIndices.popover};
|
|
816
816
|
|
|
817
817
|
&::-webkit-scrollbar {
|
|
818
818
|
display: none;
|
|
819
819
|
}
|
|
820
|
-
`,
|
|
820
|
+
`,ka=s.styled(ce.Content)`
|
|
821
821
|
@media (prefers-reduced-motion: no-preference) {
|
|
822
|
-
animation-duration: ${
|
|
822
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
823
823
|
|
|
824
824
|
&[data-state='open'] {
|
|
825
|
-
animation-timing-function: ${
|
|
825
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
826
826
|
|
|
827
827
|
&[data-side='top'] {
|
|
828
|
-
animation-name: ${
|
|
828
|
+
animation-name: ${q.slideUpIn};
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
&[data-side='bottom'] {
|
|
832
|
-
animation-name: ${
|
|
832
|
+
animation-name: ${q.slideDownIn};
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
`,
|
|
836
|
+
`,Sa=({onSelect:e,disabled:t=!1,isLink:n,startIcon:o,endIcon:a,isExternal:i,variant:c="default",...d})=>r.jsx(ce.Item,{asChild:!0,onSelect:e,disabled:t,children:n||i?r.jsx(Ra,{color:Ct(c,t),startIcon:o,endIcon:a,...d,isExternal:i??!1,$variant:c,children:d.children}):r.jsxs(_r,{cursor:"pointer",color:Ct(c,t),background:"transparent",borderStyle:"none",gap:2,$variant:c,...d,children:[o&&r.jsx(C,{tag:"span",color:Ve(c,t),"aria-hidden":!0,children:o}),r.jsx(T,{grow:1,children:d.children}),a&&r.jsx(C,{tag:"span",color:Ve(c,t),"aria-hidden":!0,children:a})]})}),Hr=({theme:e,$variant:t})=>s.css`
|
|
837
837
|
text-align: left;
|
|
838
838
|
width: 100%;
|
|
839
|
-
border-radius: ${
|
|
840
|
-
padding: ${
|
|
839
|
+
border-radius: ${e.borderRadius};
|
|
840
|
+
padding: ${e.spaces[2]} ${e.spaces[4]};
|
|
841
841
|
|
|
842
842
|
&[aria-disabled='true'] {
|
|
843
843
|
cursor: not-allowed;
|
|
844
844
|
}
|
|
845
845
|
|
|
846
846
|
&[data-highlighted] {
|
|
847
|
-
background-color: ${
|
|
847
|
+
background-color: ${e.colors[wa(t)]};
|
|
848
848
|
}
|
|
849
849
|
|
|
850
850
|
&:focus-visible {
|
|
@@ -855,12 +855,12 @@
|
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
|
|
858
|
-
color: ${
|
|
859
|
-
`,
|
|
860
|
-
${({theme:
|
|
861
|
-
`,
|
|
858
|
+
color: ${e.colors[Ct(t,!1)]};
|
|
859
|
+
`,_r=s.styled(C)`
|
|
860
|
+
${({theme:e,$variant:t})=>Hr({theme:e,$variant:t})}
|
|
861
|
+
`,Ra=s.styled(Wr)`
|
|
862
862
|
/* We include this here again because typically when people use OptionLink they provide an as prop which cancels the Box props */
|
|
863
|
-
color: ${({theme:
|
|
863
|
+
color: ${({theme:e,color:t})=>_e(e.colors,t,void 0)};
|
|
864
864
|
text-decoration: none;
|
|
865
865
|
|
|
866
866
|
&:hover {
|
|
@@ -868,13 +868,13 @@
|
|
|
868
868
|
|
|
869
869
|
> svg {
|
|
870
870
|
path {
|
|
871
|
-
fill: ${({theme:
|
|
871
|
+
fill: ${({theme:e,$variant:t})=>e.colors[Ve(t,!1)]};
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
> svg {
|
|
876
876
|
path {
|
|
877
|
-
fill: ${({theme:
|
|
877
|
+
fill: ${({theme:e,$variant:t})=>e.colors[Ve(t,!1)]};
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
&[aria-disabled='true'] {
|
|
@@ -882,40 +882,40 @@
|
|
|
882
882
|
|
|
883
883
|
> svg {
|
|
884
884
|
path {
|
|
885
|
-
fill: ${({theme:
|
|
885
|
+
fill: ${({theme:e,$variant:t})=>e.colors[Ve(t,!0)]};
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
889
|
|
|
890
|
-
${({theme:
|
|
891
|
-
`,
|
|
890
|
+
${({theme:e,$variant:t})=>Hr({theme:e,$variant:t})}
|
|
891
|
+
`,Ta=s.styled(v)`
|
|
892
892
|
/* Negative horizontal margin to compensate Menu.Content's padding */
|
|
893
|
-
margin: ${({theme:
|
|
894
|
-
width: calc(100% + ${({theme:
|
|
893
|
+
margin: ${({theme:e})=>e.spaces[1]} -${({theme:e})=>e.spaces[1]};
|
|
894
|
+
width: calc(100% + ${({theme:e})=>e.spaces[2]});
|
|
895
895
|
/* Hide separator if there's nothing above in the menu */
|
|
896
896
|
&:first-child {
|
|
897
897
|
display: none;
|
|
898
898
|
}
|
|
899
|
-
`,
|
|
900
|
-
padding: ${({theme:
|
|
901
|
-
`,
|
|
899
|
+
`,Ia=l.forwardRef((e,t)=>r.jsx(ce.Separator,{...e,asChild:!0,children:r.jsx(Ta,{height:"1px",shrink:0,background:"neutral150",ref:t})})),Da=l.forwardRef((e,t)=>r.jsx(ce.Label,{asChild:!0,children:r.jsx(Ea,{ref:t,variant:"sigma",textColor:"neutral600",...e})})),Ea=s.styled(T)`
|
|
900
|
+
padding: ${({theme:e})=>e.spaces[2]} ${({theme:e})=>e.spaces[4]};
|
|
901
|
+
`,Aa=ce.Sub,za=l.forwardRef(({disabled:e=!1,...t},n)=>r.jsx(ce.SubTrigger,{asChild:!0,disabled:e,children:r.jsxs(La,{ref:n,color:"neutral800",tag:"button",type:"button",background:"transparent",borderStyle:"none",gap:5,...t,children:[r.jsx(T,{children:t.children}),r.jsx(O.ChevronRight,{fill:"neutral500",height:"1.2rem",width:"1.2rem"})]})})),La=s.styled(_r)`
|
|
902
902
|
&[data-state='open'] {
|
|
903
|
-
background-color: ${({theme:
|
|
903
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
904
904
|
}
|
|
905
|
-
`,
|
|
906
|
-
padding: ${({theme:
|
|
905
|
+
`,Oa=l.forwardRef((e,t)=>r.jsx(ce.Portal,{children:r.jsx(ce.SubContent,{sideOffset:8,asChild:!0,children:r.jsx(Fr,{ref:t,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...e})})})),Vr=Ca,qr=ja,Ur=va,Gr=Sa,Pa=Ia,Ma=Da,Ba=Aa,Na=za,Wa=Oa,Fa=Object.freeze(Object.defineProperty({__proto__:null,Content:Ur,Item:Gr,Label:Ma,Root:Vr,Separator:Pa,SubContent:Wa,SubRoot:Ba,SubTrigger:Na,Trigger:qr},Symbol.toStringTag,{value:"Module"})),Kr=l.forwardRef(({children:e,onOpen:t,onClose:n,popoverPlacement:o,onReachEnd:a,...i},c)=>{const d=l.useRef(null),u=te(c,d),h=l.useRef(null),[f,g]=l.useState(!1),p=k=>{a&&a(k)},w=k=>{k&&typeof t=="function"?t():!k&&typeof n=="function"&&n(),g(k)},m=re(),$=`intersection-${ze(m)}`;return Ge(h,p,{selectorToWatch:`#${$}`,skipWhen:!f}),r.jsxs(Vr,{onOpenChange:w,children:[r.jsx(qr,{ref:u,...i,children:i.label}),r.jsx(Ur,{ref:h,intersectionId:$,popoverPlacement:o,children:e})]})}),Ha=Gr,_a=s.styled(Kr)`
|
|
906
|
+
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[2]}`};
|
|
907
907
|
height: unset;
|
|
908
908
|
|
|
909
909
|
:hover,
|
|
910
910
|
:focus {
|
|
911
|
-
background-color: ${({theme:
|
|
911
|
+
background-color: ${({theme:e})=>e.colors.neutral200};
|
|
912
912
|
}
|
|
913
|
-
`,
|
|
913
|
+
`,Yr=l.forwardRef(({children:e,...t},n)=>r.jsx(_a,{ref:n,endIcon:null,size:"S",...t,children:e}));Yr.displayName="CrumbSimpleMenu";const Qr=l.createContext({id:""}),Xr=()=>l.useContext(Qr),Va=l.forwardRef(({id:e,...t},n)=>{const o=re(e),a=l.useMemo(()=>({id:o}),[o]);return r.jsx(Qr.Provider,{value:a,children:r.jsx(v,{ref:n,id:e,tabIndex:0,hasRadius:!0,background:"neutral0",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",shadow:"tableShadow",tag:"article","aria-labelledby":`${o}-title`,...t})})}),Zr=l.forwardRef(({position:e,...t},n)=>r.jsx(qa,{ref:n,$position:e,...t,direction:"row",gap:2})),qa=s.styled(C)`
|
|
914
914
|
position: absolute;
|
|
915
|
-
top: ${({theme:
|
|
916
|
-
right: ${({$position:
|
|
917
|
-
left: ${({$position:
|
|
918
|
-
`,
|
|
915
|
+
top: ${({theme:e})=>e.spaces[3]};
|
|
916
|
+
right: ${({$position:e,theme:t})=>{if(e==="end")return t.spaces[3]}};
|
|
917
|
+
left: ${({$position:e,theme:t})=>{if(e==="start")return t.spaces[3]}};
|
|
918
|
+
`,Ua=({size:e="M",children:t,...n})=>r.jsx(Ka,{$size:e,children:t||r.jsx(Ga,{...n,"aria-hidden":!0})}),Ga=s.styled.img`
|
|
919
919
|
// inline flows is based on typography and displays an extra white space below the image
|
|
920
920
|
// switch to block is required in order to make the img stick the bottom of the container
|
|
921
921
|
// addition infos: https://stackoverflow.com/questions/5804256/image-inside-div-has-extra-space-below-the-image
|
|
@@ -924,26 +924,26 @@
|
|
|
924
924
|
max-height: 100%;
|
|
925
925
|
max-width: 100%;
|
|
926
926
|
object-fit: contain;
|
|
927
|
-
`,
|
|
927
|
+
`,Ka=s.styled.div`
|
|
928
928
|
display: flex;
|
|
929
929
|
justify-content: center;
|
|
930
|
-
height: ${({$size:
|
|
930
|
+
height: ${({$size:e})=>e==="S"?"8.8rem":"16.4rem"};
|
|
931
931
|
width: 100%;
|
|
932
|
-
background: repeating-conic-gradient(${({theme:
|
|
932
|
+
background: repeating-conic-gradient(${({theme:e})=>e.colors.neutral100} 0% 25%, transparent 0% 50%) 50% / 20px
|
|
933
933
|
20px;
|
|
934
|
-
border-top-left-radius: ${({theme:
|
|
935
|
-
border-top-right-radius: ${({theme:
|
|
936
|
-
`,
|
|
934
|
+
border-top-left-radius: ${({theme:e})=>e.borderRadius};
|
|
935
|
+
border-top-right-radius: ${({theme:e})=>e.borderRadius};
|
|
936
|
+
`,Ya=s.styled.div`
|
|
937
937
|
margin-left: auto;
|
|
938
938
|
flex-shrink: 0;
|
|
939
|
-
`,
|
|
940
|
-
margin-left: ${({theme:
|
|
941
|
-
`,
|
|
942
|
-
background: ${
|
|
939
|
+
`,Qa=s.styled(At)`
|
|
940
|
+
margin-left: ${({theme:e})=>e.spaces[1]};
|
|
941
|
+
`,Xa=e=>r.jsx(Ya,{children:r.jsx(Qa,{...e})}),Za=e=>r.jsx(v,{paddingLeft:3,paddingRight:3,paddingTop:2,paddingBottom:2,children:r.jsx(C,{...e,alignItems:"flex-start"})}),Ja=({fill:e,...t})=>{const{colors:n}=s.useTheme();return r.jsx(v,{tag:"svg",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:e?n[e]:void 0,...t,children:r.jsx("path",{d:"M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z"})})},nr=l.forwardRef(({defaultChecked:e,checked:t,onCheckedChange:n,...o},a)=>{const i=l.useRef(null),[c,d]=le({defaultProp:e,prop:t,onChange:n}),u=te(i,a);return r.jsx(es,{ref:u,checked:c,onCheckedChange:d,...o,children:r.jsxs(ts,{forceMount:!0,children:[c===!0?r.jsx(Ja,{width:"1.6rem",fill:"neutral0"}):null,c==="indeterminate"?r.jsx(O.Minus,{fill:"neutral0"}):null]})})}),es=s.styled(yr.Root)`
|
|
942
|
+
background: ${e=>e.theme.colors.neutral0};
|
|
943
943
|
width: 2rem;
|
|
944
944
|
height: 2rem;
|
|
945
|
-
border-radius: ${
|
|
946
|
-
border: 1px solid ${
|
|
945
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
946
|
+
border: 1px solid ${e=>e.theme.colors.neutral300};
|
|
947
947
|
position: relative;
|
|
948
948
|
z-index: 0;
|
|
949
949
|
display: flex;
|
|
@@ -954,12 +954,12 @@
|
|
|
954
954
|
|
|
955
955
|
&[data-state='checked']:not([data-disabled]),
|
|
956
956
|
&[data-state='indeterminate']:not([data-disabled]) {
|
|
957
|
-
border: 1px solid ${
|
|
958
|
-
background-color: ${
|
|
957
|
+
border: 1px solid ${e=>e.theme.colors.primary600};
|
|
958
|
+
background-color: ${e=>e.theme.colors.primary600};
|
|
959
959
|
}
|
|
960
960
|
|
|
961
961
|
&[data-disabled] {
|
|
962
|
-
background-color: ${
|
|
962
|
+
background-color: ${e=>e.theme.colors.neutral200};
|
|
963
963
|
}
|
|
964
964
|
|
|
965
965
|
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
@@ -975,7 +975,7 @@
|
|
|
975
975
|
min-width: 44px;
|
|
976
976
|
min-height: 44px;
|
|
977
977
|
}
|
|
978
|
-
`,
|
|
978
|
+
`,ts=s.styled(yr.Indicator)`
|
|
979
979
|
display: inline-flex;
|
|
980
980
|
pointer-events: auto !important;
|
|
981
981
|
width: 100%;
|
|
@@ -987,24 +987,24 @@
|
|
|
987
987
|
&[data-disabled] {
|
|
988
988
|
cursor: not-allowed;
|
|
989
989
|
}
|
|
990
|
-
`,
|
|
990
|
+
`,dt=l.forwardRef(({children:e,...t},n)=>{const o=re(t.id);return e?r.jsxs(C,{gap:2,children:[r.jsx(nr,{id:o,...t}),r.jsx(T,{tag:"label",textColor:"neutral800",htmlFor:o,children:e})]}):r.jsx(nr,{ref:n,...t})}),rs=l.forwardRef((e,t)=>{const{id:n}=Xr();return r.jsx(Zr,{position:"start",children:r.jsx(dt,{"aria-labelledby":`${n}-title`,...e,ref:t})})}),ns=s.styled(v)`
|
|
991
991
|
word-break: break-all;
|
|
992
|
-
`,
|
|
993
|
-
border-bottom: 1px solid ${({theme:
|
|
994
|
-
`,
|
|
992
|
+
`,os=({children:e,...t})=>r.jsx(ns,{...t,children:e}),as=s.styled(C)`
|
|
993
|
+
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
994
|
+
`,ss=e=>r.jsx(as,{position:"relative",justifyContent:"center",...e}),is=({children:e,...t})=>r.jsx(v,{tag:"time",background:"neutral800",bottom:1,right:1,color:"neutral0",hasRadius:!0,position:"absolute",padding:1,...t,children:r.jsx(T,{variant:"pi",textColor:"neutral0",children:e})}),ls=e=>{const{id:t}=Xr();return r.jsx(T,{variant:"pi",id:`${t}-title`,textColor:"neutral800",fontWeight:"bold",tag:"div",...e})},cs=e=>r.jsx(T,{variant:"pi",...e,textColor:"neutral600",tag:"div"}),W={DOWN:"ArrowDown",UP:"ArrowUp",RIGHT:"ArrowRight",LEFT:"ArrowLeft",ESCAPE:"Escape",ENTER:"Enter",SPACE:" ",TAB:"Tab",END:"End",HOME:"Home",DELETE:"Delete",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",CLEAR:"Clear"},ds=s.styled(v)`
|
|
995
995
|
grid-template-columns: auto 1fr auto;
|
|
996
996
|
grid-template-areas: 'startAction slides endAction';
|
|
997
|
-
`,
|
|
997
|
+
`,us=s.styled(C)`
|
|
998
998
|
grid-area: slides;
|
|
999
|
-
`,
|
|
1000
|
-
grid-area: ${({$area:
|
|
999
|
+
`,or=s.styled(v)`
|
|
1000
|
+
grid-area: ${({$area:e})=>e};
|
|
1001
1001
|
|
|
1002
1002
|
&:focus svg path,
|
|
1003
1003
|
&:hover svg path {
|
|
1004
|
-
fill: ${({theme:
|
|
1004
|
+
fill: ${({theme:e})=>e.colors.neutral900};
|
|
1005
1005
|
}
|
|
1006
|
-
`,
|
|
1007
|
-
${
|
|
1006
|
+
`,Jr=l.forwardRef(({actions:e,children:t,label:n,nextLabel:o,onNext:a,onPrevious:i,previousLabel:c,secondaryLabel:d,selectedSlide:u,...h},f)=>{const g=l.useRef(null),p=l.useRef(null),w=l.Children.map(t,($,k)=>l.cloneElement($,{selected:k===u})),m=$=>{switch($.key){case W.RIGHT:{$.preventDefault(),p!=null&&p.current&&p.current.focus(),a&&a();break}case W.LEFT:{$.preventDefault(),g!=null&&g.current&&g.current.focus(),i&&i();break}}};return r.jsx(v,{ref:f,...h,onKeyDown:m,children:r.jsxs(v,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[r.jsxs(ds,{tag:"section","aria-roledescription":"carousel","aria-label":n,display:"grid",position:"relative",children:[w&&w.length>1&&r.jsxs(r.Fragment,{children:[r.jsx(or,{tag:"button",onClick:i,$area:"startAction",ref:g,type:"button",children:r.jsx(Se,{label:c,children:r.jsx(O.ChevronLeft,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})}),r.jsx(or,{tag:"button",onClick:a,$area:"endAction",ref:p,type:"button",children:r.jsx(Se,{label:o,children:r.jsx(O.ChevronRight,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})})]}),r.jsx(us,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:w}),e]}),d&&r.jsx(v,{paddingTop:2,paddingLeft:4,paddingRight:4,children:r.jsx(ct,{label:d,children:r.jsx(C,{justifyContent:"center",children:r.jsx(T,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:d})})})})]})})}),hs={accordions:{S:"4.8rem",M:"8.8rem"},button:{S:{initial:"4rem",medium:"3.2rem"},M:{initial:"4.4rem",medium:"3.6rem"},L:{initial:"4.8rem",medium:"4rem"}}},en={sizes:hs,zIndices:{navigation:100,overlay:300,modal:310,dialog:320,popover:500,notification:700,tooltip:1e3},spaces:["0px","4px","8px","12px","16px","20px","24px","32px","40px","48px","56px","64px"],borderRadius:"4px",breakpoints:{initial:"@media(min-width: 0px)",small:"@media(min-width: 520px)",medium:"@media(min-width: 768px)",large:"@media(min-width: 1080px)"},fontSizes:["1.1rem","1.2rem","1.4rem","1.6rem","1.8rem","2rem","2.8rem","3.2rem"],lineHeights:[1.14,1.22,1.25,1.33,1.43,1.45,1.5],fontWeights:{regular:400,semiBold:500,bold:600},transitions:Jo,motion:{easings:$t,timings:yt}},fs={color:{alternative100:"#f6ecfc",alternative200:"#e0c1f4",alternative500:"#ac73e6",alternative600:"#9736e8",alternative700:"#8312d1",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#fcecea",danger200:"#f5c0b8",danger500:"#ee5e52",danger600:"#d02b20",danger700:"#b72b1a",neutral0:"#ffffff",neutral100:"#f6f6f9",neutral1000:"#181826",neutral150:"#eaeaef",neutral200:"#dcdce4",neutral300:"#c0c0cf",neutral400:"#a5a5ba",neutral500:"#8e8ea9",neutral600:"#666687",neutral700:"#4a4a6a",neutral800:"#32324d",neutral900:"#212134",primary100:"#f0f0ff",primary200:"#d9d8ff",primary500:"#7b79ff",primary600:"#4945ff",primary700:"#271fe0",secondary100:"#eaf5ff",secondary200:"#b8e1ff",secondary500:"#66b7f1",secondary600:"#0c75af",secondary700:"#006096",success100:"#eafbe7",success200:"#c6f0c2",success500:"#5cb176",success600:"#328048",success700:"#2f6846",warning100:"#fdf4dc",warning200:"#fae7b9",warning500:"#f29d41",warning600:"#d9822f",warning700:"#be5d01"}},gs={shadow:{filterShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"0px 2px 15px rgba(33, 33, 52, 0.1)",tableShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)"}},Mt={colorScheme:"light",colors:fs.color,shadows:gs.shadow,...en},ps={color:{alternative100:"#181826",alternative200:"#4a4a6a",alternative500:"#ac73e6",alternative600:"#ac73e6",alternative700:"#e0c1f4",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#181826",danger200:"#4a4a6a",danger500:"#ee5e52",danger600:"#ee5e52",danger700:"#ee5e52",neutral0:"#212134",neutral100:"#181826",neutral1000:"#ffffff",neutral150:"#32324d",neutral200:"#4a4a6a",neutral300:"#666687",neutral400:"#a5a5ba",neutral500:"#c0c0cf",neutral600:"#a5a5ba",neutral700:"#eaeaef",neutral800:"#ffffff",neutral900:"#ffffff",primary100:"#181826",primary200:"#4a4a6a",primary500:"#4945ff",primary600:"#7b79ff",primary700:"#7b79ff",secondary100:"#181826",secondary200:"#4a4a6a",secondary500:"#66b7f1",secondary600:"#66b7f1",secondary700:"#b8e1ff",success100:"#181826",success200:"#4a4a6a",success500:"#5cb176",success600:"#5cb176",success700:"#c6f0c2",warning100:"#181826",warning200:"#4a4a6a",warning500:"#f29d41",warning600:"#f29d41",warning700:"#fae7b9"}},ms={shadow:{filterShadow:"1px 1px 10px rgba(3, 3, 5, 0.35)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"1px 1px 10px rgba(3, 3, 5, 0.35)",tableShadow:"1px 1px 10px rgba(3, 3, 5, 0.2)"}},bs={colorScheme:"dark",colors:ps.color,shadows:ms.shadow,...en},ar=e=>`
|
|
1007
|
+
${e}
|
|
1008
1008
|
|
|
1009
1009
|
The following is an example:
|
|
1010
1010
|
|
|
@@ -1012,44 +1012,44 @@ The following is an example:
|
|
|
1012
1012
|
import { lightTheme, extendTheme } from '@strapi/design-system';
|
|
1013
1013
|
|
|
1014
1014
|
const myCustomTheme = extendTheme(lightTheme, {
|
|
1015
|
-
${Object.keys(
|
|
1015
|
+
${Object.keys(Mt).map(t=>`${t}: /* put the overrides for the ${t} key */,`).join(`
|
|
1016
1016
|
`)}
|
|
1017
1017
|
})
|
|
1018
|
-
|
|
1018
|
+
`,xs=(e,t)=>{if(!et(e)){const i=ar("The first argument should be an object and corresponds to the theme you want to extend.");throw new Error(i)}if(!et(t)){const i=ar("The second argument should be an object and corresponds to the keys of the theme you want to override.");throw new Error(i)}function n(i,c){if(Array.isArray(i))return c;if(et(i)&&et(c))return Je.merge(i,c)}const o=Je.cloneDeep(e??{}),a=Je.cloneDeep(t??{});return Je.assignWith(o,a,n),o},$s=e=>({theme:t,size:n})=>t.sizes[e][n],be=(e="&")=>({theme:t,$hasError:n=!1})=>s.css`
|
|
1019
1019
|
outline: none;
|
|
1020
1020
|
box-shadow: none;
|
|
1021
1021
|
transition-property: border-color, box-shadow, fill;
|
|
1022
1022
|
transition-duration: 0.2s;
|
|
1023
1023
|
|
|
1024
|
-
${
|
|
1025
|
-
border: 1px solid ${t
|
|
1026
|
-
box-shadow: ${t
|
|
1024
|
+
${e}:focus-within {
|
|
1025
|
+
border: 1px solid ${n?t.colors.danger600:t.colors.primary600};
|
|
1026
|
+
box-shadow: ${n?t.colors.danger600:t.colors.primary600} 0px 0px 0px 2px;
|
|
1027
1027
|
}
|
|
1028
|
-
`,[
|
|
1028
|
+
`,[ys,ne]=Oe("Field",{}),Re=l.forwardRef(({children:e,name:t,error:n=!1,hint:o,id:a,required:i=!1,...c},d)=>{const u=re(a),[h,f]=l.useState();return r.jsx(ys,{name:t,id:u,error:n,hint:o,required:i,labelNode:h,setLabelNode:f,children:r.jsx(C,{direction:"column",alignItems:"stretch",gap:1,ref:d,...c,children:e})})}),Bt=l.forwardRef(({children:e,action:t,...n},o)=>{const{id:a,required:i,setLabelNode:c}=ne("Label"),d=te(o,c);return e?r.jsxs(C,{alignItems:"center",children:[r.jsxs(ws,{ref:d,variant:"pi",textColor:"neutral800",fontWeight:"bold",...n,id:`${a}-label`,htmlFor:a,tag:"label",ellipsis:!0,children:[e,i&&r.jsx(T,{"aria-hidden":!0,lineHeight:"1em",textColor:"danger600",children:"*"})]}),t&&r.jsx(Cs,{marginLeft:1,children:t})]}):null}),ws=s.styled(T)`
|
|
1029
1029
|
display: block;
|
|
1030
|
-
`,
|
|
1030
|
+
`,Cs=s.styled(C)`
|
|
1031
1031
|
line-height: 0;
|
|
1032
|
-
color: ${({theme:
|
|
1033
|
-
`,
|
|
1032
|
+
color: ${({theme:e})=>e.colors.neutral500};
|
|
1033
|
+
`,ut=l.forwardRef(({endAction:e,startAction:t,disabled:n=!1,onChange:o,hasError:a,required:i,className:c,size:d="M",...u},h)=>{const{id:f,error:g,hint:p,name:w,required:m}=ne("Input");let $;g?$=`${f}-error`:p&&($=`${f}-hint`);const k=!!g,y=l.useRef(null),x=l.useRef(null),I=te(x,h),j=R=>{!n&&o&&o(R)};return l.useLayoutEffect(()=>{if(y.current&&x.current){const R=y.current.offsetWidth,b=x.current;if(b){const S=R+8+16;b.style.paddingRight=`${S}px`}}},[e]),r.jsxs(ks,{gap:2,justifyContent:"space-between",$hasError:k||a,$disabled:n,$size:d,$hasLeftAction:!!t,$hasRightAction:!!e,className:c,children:[t,r.jsx(js,{id:f,name:w,ref:I,$size:d,"aria-describedby":$,"aria-invalid":k||a,"aria-disabled":n,disabled:n,"data-disabled":n?"":void 0,onChange:j,"aria-required":m||i,$hasLeftAction:!!t,$hasRightAction:!!e,...u}),e&&r.jsx(vs,{ref:y,children:e})]})}),js=s.styled.input`
|
|
1034
1034
|
border: none;
|
|
1035
|
-
border-radius: ${({theme:
|
|
1036
|
-
cursor: ${
|
|
1035
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1036
|
+
cursor: ${e=>e["aria-disabled"]?"not-allowed":void 0};
|
|
1037
1037
|
|
|
1038
|
-
color: ${({theme:
|
|
1038
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
1039
1039
|
font-weight: 400;
|
|
1040
|
-
font-size: ${
|
|
1040
|
+
font-size: ${e=>e.theme.fontSizes[3]};
|
|
1041
1041
|
line-height: 2.4rem;
|
|
1042
1042
|
display: block;
|
|
1043
1043
|
width: 100%;
|
|
1044
1044
|
background: inherit;
|
|
1045
1045
|
|
|
1046
|
-
${({theme:
|
|
1047
|
-
font-size: ${({theme:
|
|
1046
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1047
|
+
font-size: ${({theme:e})=>e.fontSizes[2]};
|
|
1048
1048
|
line-height: 2.2rem;
|
|
1049
1049
|
}
|
|
1050
1050
|
|
|
1051
1051
|
&::placeholder {
|
|
1052
|
-
color: ${({theme:
|
|
1052
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1053
1053
|
opacity: 1;
|
|
1054
1054
|
}
|
|
1055
1055
|
|
|
@@ -1063,79 +1063,79 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1063
1063
|
box-shadow: none;
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
|
-
${
|
|
1067
|
-
padding-inline-start: ${
|
|
1068
|
-
padding-inline-end: ${
|
|
1069
|
-
padding-block: ${
|
|
1066
|
+
${e=>{switch(e.$size){case"S":return s.css`
|
|
1067
|
+
padding-inline-start: ${e.$hasLeftAction?0:e.theme.spaces[4]};
|
|
1068
|
+
padding-inline-end: ${e.$hasRightAction?0:e.theme.spaces[4]};
|
|
1069
|
+
padding-block: ${e.theme.spaces[2]};
|
|
1070
1070
|
|
|
1071
|
-
${({theme:
|
|
1072
|
-
padding-block: ${
|
|
1071
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
1072
|
+
padding-block: ${e.theme.spaces[1]};
|
|
1073
1073
|
}
|
|
1074
|
-
`;default:return
|
|
1075
|
-
padding-inline-start: ${
|
|
1076
|
-
padding-inline-end: ${
|
|
1077
|
-
padding-block: ${
|
|
1074
|
+
`;default:return s.css`
|
|
1075
|
+
padding-inline-start: ${e.$hasLeftAction?0:e.theme.spaces[4]};
|
|
1076
|
+
padding-inline-end: ${e.$hasRightAction?0:e.theme.spaces[4]};
|
|
1077
|
+
padding-block: ${e.theme.spaces[3]};
|
|
1078
1078
|
|
|
1079
|
-
${({theme:
|
|
1080
|
-
padding-block: ${
|
|
1079
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
1080
|
+
padding-block: ${e.theme.spaces[2]};
|
|
1081
1081
|
}
|
|
1082
1082
|
`}}}
|
|
1083
|
-
`,
|
|
1083
|
+
`,vs=s.styled(C)`
|
|
1084
1084
|
position: absolute;
|
|
1085
|
-
right: ${({theme:
|
|
1085
|
+
right: ${({theme:e})=>e.spaces[4]};
|
|
1086
1086
|
top: 50%;
|
|
1087
1087
|
transform: translateY(-50%);
|
|
1088
|
-
`,
|
|
1089
|
-
border: 1px solid ${({theme:
|
|
1090
|
-
border-radius: ${({theme:
|
|
1091
|
-
background: ${({theme:
|
|
1092
|
-
padding-inline-start: ${({$hasLeftAction:
|
|
1088
|
+
`,ks=s.styled(C)`
|
|
1089
|
+
border: 1px solid ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
1090
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1091
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1092
|
+
padding-inline-start: ${({$hasLeftAction:e,theme:t})=>e?t.spaces[4]:0};
|
|
1093
1093
|
position: relative;
|
|
1094
1094
|
|
|
1095
|
-
${
|
|
1096
|
-
${({theme:
|
|
1097
|
-
color: ${
|
|
1098
|
-
background: ${
|
|
1095
|
+
${be()}
|
|
1096
|
+
${({theme:e,$disabled:t})=>t?s.css`
|
|
1097
|
+
color: ${e.colors.neutral600};
|
|
1098
|
+
background: ${e.colors.neutral150};
|
|
1099
1099
|
`:void 0};
|
|
1100
|
-
`,
|
|
1100
|
+
`,tn=()=>{const{id:e,hint:t,error:n}=ne("Hint");return!t||n?null:r.jsx(T,{variant:"pi",tag:"p",id:`${e}-hint`,textColor:"neutral600",children:t})},rn=()=>{const{id:e,error:t}=ne("Error");return!t||typeof t!="string"?null:r.jsx(T,{variant:"pi",tag:"p",id:`${e}-error`,textColor:"danger600","data-strapi-field-error":!0,children:t})},Ss=l.forwardRef(({label:e,children:t,...n},o)=>r.jsx(Rs,{justifyContent:"unset",background:"transparent",borderStyle:"none",...n,type:"button",tag:"button",ref:o,children:r.jsx(Se,{label:e,children:t})})),Rs=s.styled(C)`
|
|
1101
1101
|
font-size: 1.6rem;
|
|
1102
1102
|
padding: 0;
|
|
1103
|
-
`,
|
|
1104
|
-
${
|
|
1105
|
-
`,
|
|
1106
|
-
display: ${({$selected:
|
|
1107
|
-
`,
|
|
1103
|
+
`,Ts=Object.freeze(Object.defineProperty({__proto__:null,Action:Ss,Error:rn,Hint:tn,Input:ut,Label:Bt,Root:Re,useField:ne},Symbol.toStringTag,{value:"Module"})),Is=l.forwardRef(({actions:e,children:t,error:n,hint:o,label:a,labelAction:i,nextLabel:c,onNext:d,onPrevious:u,previousLabel:h,required:f,secondaryLabel:g,selectedSlide:p,id:w,...m},$)=>{const k=re(w);return r.jsx(Re,{hint:o,error:n,id:k,required:f,children:r.jsxs(C,{direction:"column",alignItems:"stretch",gap:1,children:[a&&r.jsx(Bt,{action:i,children:a}),r.jsx(Jr,{ref:$,actions:e,label:a,nextLabel:c,onNext:d,onPrevious:u,previousLabel:h,secondaryLabel:g,selectedSlide:p,id:k,...m,children:t}),r.jsx(tn,{}),r.jsx(rn,{})]})})}),Ds=({horizontal:e=!0,...t})=>r.jsx(C,{justifyContent:"center",direction:e?"row":"column",alignItems:e?"center":"stretch",position:"absolute",width:"100%",bottom:1,gap:1,...t}),sr=s.styled(v)`
|
|
1104
|
+
${jr}
|
|
1105
|
+
`,Es=e=>{const[t,n]=l.useState(!1),o=()=>{n(!0)};return t?r.jsx(ct,{label:e.alt??"",children:r.jsx(sr,{tag:"img",height:"100%",maxWidth:"100%",...e})}):r.jsx(sr,{tag:"img",height:"100%",maxWidth:"100%",...e,onError:o})},As=s.styled(C)`
|
|
1106
|
+
display: ${({$selected:e})=>e?"flex":"none"};
|
|
1107
|
+
`,zs=({label:e,children:t,selected:n=!1,...o})=>r.jsx(As,{$selected:n,alignItems:"center",role:"group","aria-roledescription":"slide","aria-label":e,justifyContent:"center",height:"124px",width:"100%",...o,children:t}),nn=s.css`
|
|
1108
1108
|
font-size: 1.6rem;
|
|
1109
1109
|
line-height: 2.4rem;
|
|
1110
1110
|
|
|
1111
|
-
${({theme:
|
|
1111
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1112
1112
|
font-size: 1.4rem;
|
|
1113
1113
|
line-height: 2.2rem;
|
|
1114
1114
|
}
|
|
1115
|
-
`,
|
|
1115
|
+
`,Nt=({$size:e="M",$hasValue:t=!1,$hasClear:n=!1,theme:o})=>{switch(e){case"S":return s.css`
|
|
1116
1116
|
padding-block: calc(
|
|
1117
|
-
${
|
|
1117
|
+
${t&&n?o.spaces[1]:o.spaces[2]} - 1px
|
|
1118
1118
|
); // 1px to compensate for the border
|
|
1119
1119
|
|
|
1120
|
-
${
|
|
1121
|
-
padding-block: ${
|
|
1120
|
+
${o.breakpoints.medium} {
|
|
1121
|
+
padding-block: ${o.spaces[1]};
|
|
1122
1122
|
}
|
|
1123
|
-
`;default:return
|
|
1123
|
+
`;default:return s.css`
|
|
1124
1124
|
padding-block: calc(
|
|
1125
|
-
${
|
|
1125
|
+
${t&&n?o.spaces[2]:o.spaces[3]} - 1px
|
|
1126
1126
|
); // 1px to compensate for the border
|
|
1127
1127
|
|
|
1128
|
-
${
|
|
1129
|
-
padding-block: ${
|
|
1128
|
+
${o.breakpoints.medium} {
|
|
1129
|
+
padding-block: ${o.spaces[2]};
|
|
1130
1130
|
}
|
|
1131
|
-
`}},
|
|
1131
|
+
`}},Qe=l.forwardRef(({children:e,viewportRef:t,...n},o)=>r.jsxs(Ls,{ref:o,...n,children:[r.jsx(Os,{ref:t,children:e}),r.jsx(ir,{orientation:"vertical",children:r.jsx(lr,{})}),r.jsx(ir,{orientation:"horizontal",children:r.jsx(lr,{})})]})),Ls=s.styled(ot.Root)`
|
|
1132
1132
|
width: 100%;
|
|
1133
1133
|
height: 100%;
|
|
1134
1134
|
overflow: hidden;
|
|
1135
1135
|
display: flex;
|
|
1136
|
-
`,
|
|
1136
|
+
`,Os=s.styled(ot.Viewport)`
|
|
1137
1137
|
min-width: 100%;
|
|
1138
|
-
`,
|
|
1138
|
+
`,ir=s.styled(ot.Scrollbar)`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
/* ensures no selection */
|
|
1141
1141
|
user-select: none;
|
|
@@ -1152,10 +1152,10 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1152
1152
|
height: 0.4rem;
|
|
1153
1153
|
margin: 0.4rem;
|
|
1154
1154
|
}
|
|
1155
|
-
`,
|
|
1155
|
+
`,lr=s.styled(ot.Thumb)`
|
|
1156
1156
|
position: relative;
|
|
1157
1157
|
flex: 1;
|
|
1158
|
-
background-color: ${
|
|
1158
|
+
background-color: ${e=>e.theme.colors.neutral150};
|
|
1159
1159
|
border-radius: 0.4rem;
|
|
1160
1160
|
|
|
1161
1161
|
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
@@ -1172,56 +1172,53 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1172
1172
|
min-height: 44px;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
`,
|
|
1175
|
+
`,Ps="data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e",nt=l.forwardRef(({children:e,small:t=!1,...n},o)=>r.jsxs("div",{role:"alert","aria-live":"assertive",ref:o,...n,children:[r.jsx(me,{children:e}),r.jsx(Bs,{src:Ps,"aria-hidden":!0,$small:t})]})),Ms=s.keyframes`
|
|
1176
1176
|
from {
|
|
1177
1177
|
transform: rotate(0deg);
|
|
1178
1178
|
}
|
|
1179
1179
|
to {
|
|
1180
1180
|
transform: rotate(359deg);
|
|
1181
1181
|
}
|
|
1182
|
-
`,
|
|
1183
|
-
animation: ${
|
|
1182
|
+
`,Bs=s.styled.img`
|
|
1183
|
+
animation: ${Ms} 1s infinite linear;
|
|
1184
1184
|
will-change: transform;
|
|
1185
|
-
${({$small:
|
|
1186
|
-
|
|
1187
|
-
font-size: .6rem;
|
|
1188
|
-
font-weight: bold;
|
|
1189
|
-
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(c=t==null?void 0:t.onChange)==null||c.call(t,r),r}return s.updateDeps=o=>{n=o},s}function ds(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Kd=(i,e)=>Math.abs(i-e)<1.01,Ud=(i,e,t)=>{let n;return function(...r){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,r),t)}},us=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Gd=i=>i,Yd=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let r=e;r<=t;r++)n.push(r);return n},Xd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const r=o=>{const{width:l,height:a}=o;e({width:Math.round(l),height:Math.round(a)})};if(r(us(t)),!n.ResizeObserver)return()=>{};const s=new n.ResizeObserver(o=>{const l=()=>{const a=o[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(us(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(t,{box:"border-box"}),()=>{s.unobserve(t)}},fs={passive:!0},gs=typeof window>"u"?!0:"onscrollend"in window,Jd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let r=0;const s=i.options.useScrollendEvent&&gs?()=>{}:Ud(n,()=>{e(r,!1)},i.options.isScrollingResetDelay),o=h=>()=>{const{horizontal:u,isRtl:f}=i.options;r=u?t.scrollLeft*(f&&-1||1):t.scrollTop,s(),e(r,h)},l=o(!0),a=o(!1);a(),t.addEventListener("scroll",l,fs);const c=i.options.useScrollendEvent&&gs;return c&&t.addEventListener("scrollend",a,fs),()=>{t.removeEventListener("scroll",l),c&&t.removeEventListener("scrollend",a)}},Qd=(i,e,t)=>{if(e!=null&&e.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Zd=(i,{adjustments:e=0,behavior:t},n)=>{var r,s;const o=i+e;(s=(r=n.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[n.options.horizontal?"left":"top"]:o,behavior:t})};class eu{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(s=>{const o=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=n())==null||r.disconnect(),t=null},observe:r=>{var s;return(s=n())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=n())==null?void 0:s.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,r])=>{typeof r>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Gd,rangeExtractor:Yd,onChange:()=>{},measureElement:Qd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var n,r;(r=(n=this.options).onChange)==null||r.call(n,this,t)},this.maybeNotify=Rt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const r=new Map,s=new Map;for(let o=n-1;o>=0;o--){const l=t[o];if(r.has(l.lane))continue;const a=s.get(l.lane);if(a==null||l.end>a.end?s.set(l.lane,l):l.end<a.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,l)=>o.end===l.end?o.index-l.index:o.end-l.end)[0]:void 0},this.getMeasurementOptions=Rt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,n,r,s,o)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o}),{key:!1}),this.getMeasurements=Rt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o},l)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<t;h++){const u=s(h),f=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),g=f?f.end+this.options.gap:n+r,p=l.get(u),x=typeof p=="number"?p:this.options.estimateSize(h),w=g+x,y=f?f.lane:h%this.options.lanes;c[h]={index:h,start:g,size:x,end:w,key:u,lane:y}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Rt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,r,s)=>this.range=t.length>0&&n>0?tu({measurements:t,outerSize:n,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Rt(()=>{let t=null,n=null;const r=this.calculateRange();return r&&(t=r.startIndex,n=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,r,s,o)=>s===null||o===null?[]:t({startIndex:s,endIndex:o,overscan:n,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,r=t.getAttribute(n);return r?parseInt(r,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(t,n)=>{const r=this.indexFromElement(t),s=this.measurementsCache[r];if(!s)return;const o=s.key,l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,n,this))},this.resizeItem=(t,n)=>{const r=this.measurementsCache[t];if(!r)return;const s=this.itemSizeCache.get(r.key)??r.size,o=n-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((n,r)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Rt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const r=[];for(let s=0,o=t.length;s<o;s++){const l=t[s],a=n[l];r.push(a)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return ds(n[il(0,n.length-1,r=>ds(n[r]).start,t)])},this.getOffsetForAlignment=(t,n,r=0)=>{const s=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=t>=o+s?"end":"start"),n==="center"?t+=(r-s)/2:n==="end"&&(t-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const s=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(r.end>=o+s-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const l=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,r.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:n="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,n),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:n="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let s=0;const o=10,l=c=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(t,c);if(!h){console.warn("Failed to get offset for index:",t);return}const[u,f]=h;this._scrollToOffset(u,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),p=this.getOffsetForIndex(t,f);if(!p){console.warn("Failed to get offset for index:",t);return}Kd(p[0],g)||a(f)})},a=c=>{this.targetWindow&&(s++,s<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,o),this.targetWindow.requestAnimationFrame(()=>l(c))):console.warn(`Failed to scroll to index ${t} after ${o} attempts.`))};l(n)},this.scrollBy=(t,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let r;if(n.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=n[n.length-1])==null?void 0:t.end)??0;else{const s=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&s.some(l=>l===null);){const l=n[o];s[l.lane]===null&&(s[l.lane]=l.end),o--}r=Math.max(...s.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const il=(i,e,t,n)=>{for(;i<=e;){const r=(i+e)/2|0,s=t(r);if(s<n)i=r+1;else if(s>n)e=r-1;else return r}return i>0?i-1:0};function tu({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const r=i.length-1,s=a=>i[a].start;if(i.length<=n)return{startIndex:0,endIndex:r};let o=il(0,r,s,t),l=o;if(n===1)for(;l<r&&i[l].end<t+e;)l++;else if(n>1){const a=Array(n).fill(0);for(;l<r&&a.some(h=>h<t+e);){const h=i[l];a[h.lane]=h.end,l++}const c=Array(n).fill(t+e);for(;o>=0&&c.some(h=>h>=t);){const h=i[o];c[h.lane]=h.start,o--}o=Math.max(0,o-o%n),l=Math.min(r,l+(n-1-l%n))}return{startIndex:o,endIndex:l}}const ps=typeof document<"u"?b.useLayoutEffect:b.useEffect;function iu(i){const e=b.useReducer(()=>({}),{})[1],t={...i,onChange:(r,s)=>{var o;s?bo.flushSync(e):e(),(o=i.onChange)==null||o.call(i,r,s)}},[n]=b.useState(()=>new eu(t));return n.setOptions(t),ps(()=>n._didMount(),[]),ps(()=>n._willUpdate()),n}function nu(i){return iu({observeElementRect:Xd,observeElementOffset:Jd,scrollToFn:Zd,...i})}const ru=Ae((i,e)=>{const{gap:t=0,gridCols:n=12,...r}=i;return d.jsx(su,{ref:e,$gap:t,$gridCols:n,...r})}),su=m.styled(A)`
|
|
1185
|
+
${({$small:e,theme:t})=>e&&`width: ${t.spaces[6]}; height: ${t.spaces[6]};`}
|
|
1186
|
+
`,Ns=ae((e,t)=>{const{gap:n=0,gridCols:o=12,...a}=e;return r.jsx(Ws,{ref:t,$gap:n,$gridCols:o,...a})}),Ws=s.styled(v)`
|
|
1190
1187
|
display: grid;
|
|
1191
|
-
grid-template-columns: repeat(${({$gridCols:
|
|
1192
|
-
${({theme:
|
|
1193
|
-
`,
|
|
1194
|
-
grid-column: span ${({$xs:
|
|
1188
|
+
grid-template-columns: repeat(${({$gridCols:e})=>e}, 1fr);
|
|
1189
|
+
${({theme:e,$gap:t})=>ke({gap:t},e)}
|
|
1190
|
+
`,Fs=ae(({col:e,s:t,xs:n,m:o,...a},i)=>r.jsx(Hs,{ref:i,$col:e,$s:t,$xs:n,$m:o,...a})),Hs=s.styled(C)`
|
|
1191
|
+
grid-column: span ${({$xs:e,$col:t})=>e??t??12};
|
|
1195
1192
|
max-width: 100%;
|
|
1196
1193
|
|
|
1197
|
-
${({theme:
|
|
1198
|
-
grid-column: span ${({$s:
|
|
1194
|
+
${({theme:e})=>e.breakpoints.small} {
|
|
1195
|
+
grid-column: span ${({$s:e,$xs:t,$col:n})=>e??t??n??12};
|
|
1199
1196
|
}
|
|
1200
1197
|
|
|
1201
|
-
${({theme:
|
|
1202
|
-
grid-column: span ${({$m:
|
|
1198
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1199
|
+
grid-column: span ${({$m:e,$s:t,$xs:n,$col:o})=>e??t??n??o??12};
|
|
1203
1200
|
}
|
|
1204
1201
|
|
|
1205
|
-
${({theme:
|
|
1206
|
-
grid-column: span ${({$col:
|
|
1202
|
+
${({theme:e})=>e.breakpoints.large} {
|
|
1203
|
+
grid-column: span ${({$col:e,$m:t,$s:n,$xs:o})=>e??t??n??o??12};
|
|
1207
1204
|
}
|
|
1208
|
-
`,
|
|
1205
|
+
`,_s=Object.freeze(Object.defineProperty({__proto__:null,Item:Fs,Root:Ns},Symbol.toStringTag,{value:"Module"})),Vs=({children:e,estimatedItemSize:t=40,overscan:n=10,itemCount:o,renderItem:a})=>{const i=X.useRef(null),[c,d]=X.useState(!1),u=X.useRef(!0);X.useEffect(()=>(u.current=!0,typeof X.startTransition=="function"&&X.startTransition(()=>{u.current&&d(!0)}),()=>{u.current=!1}),[]);const h=X.useMemo(()=>a&&o!==void 0?[]:X.Children.toArray(e),[e,a,o]),f=o??h.length,g=no.useVirtualizer({count:f,getScrollElement:()=>i.current??null,estimateSize:X.useCallback(()=>t,[t]),overscan:n,scrollMargin:0,measureElement:void 0,lanes:1}),p=c&&u.current?g.getVirtualItems():[];return c?r.jsx(v,{ref:i,height:`${g.getTotalSize()>0?g.getTotalSize():0}px`,width:"100%",position:"relative","data-testid":"virtualized-list",style:{willChange:"transform"},children:p.map(w=>{const m=a?a(w.index):h[w.index];return r.jsx(v,{"data-index":w.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translate3d(0, ${w.start}px, 0)`},children:m},w.key)})}):r.jsx(v,{ref:i,height:"40px",width:"100%",position:"relative"})},on=l.forwardRef(({allowCustomValue:e,autocomplete:t,children:n,className:o,clearLabel:a="Clear",creatable:i=!1,creatableDisabled:c=!1,creatableStartIcon:d,createMessage:u=J=>`Create "${J}"`,defaultFilterValue:h,defaultTextValue:f,defaultOpen:g=!1,open:p,onOpenChange:w,disabled:m=!1,hasError:$,id:k,filterValue:y,hasMoreItems:x=!1,isPrintableCharacter:I,loading:j=!1,loadingMessage:R="Loading content...",name:b,noOptionsMessage:S=()=>"No results found",onChange:z,onClear:E,onCreateOption:A,onFilterValueChange:U,onInputChange:B,onTextValueChange:N,onLoadMore:H,placeholder:P="Select or enter a value",required:K=!1,size:L="M",startIcon:M,textValue:Z,value:G,...oe},Y)=>{const[J,_]=le({prop:p,defaultProp:g,onChange:w}),[Q,de]=le({prop:Z,defaultProp:e&&!f?G:f,onChange:N}),[$e,ye]=le({prop:y,defaultProp:h,onChange:U}),fe=l.useRef(null),Ie=l.useRef(null),we=te(fe,Y),Be=l.useRef(null),Ne=se=>{E&&!m&&(de(""),ye(""),E(se),fe.current.focus())},Ce=se=>{_(se)},V=se=>{de(se)},De=se=>{ye(se)},We=se=>{B&&B(se)},qn=se=>{z&&z(se)},Un=se=>{H&&x&&!j&&H(se)},Kt=()=>{A&&Q&&i!=="visible"?A(Q):A&&i==="visible"&&(A(),_(!1))},Gn=re(),Yt=`intersection-${ze(Gn)}`;Ge(Ie,Un,{selectorToWatch:`#${Yt}`,skipWhen:!J});const{error:ht,...Ze}=ne("Combobox"),Kn=!!ht||$,ft=Ze.id??k,Yn=Ze.name??b,Qn=Ze.required||K,Qt=l.Children.toArray(n).filter(Boolean).length,Xn=!!!(Q&&Q!==""||$e&&$e!=="")&&Qt>100;let gt;return ht?gt=`${ft}-error`:Ze.hint&&(gt=`${ft}-hint`),r.jsxs(D.Combobox.Root,{autocomplete:t||(i===!0?"list":"both"),onOpenChange:Ce,open:J,onTextValueChange:V,textValue:Q,allowCustomValue:!!i||e,disabled:m,required:Qn,value:G,onValueChange:qn,filterValue:$e,onFilterValueChange:De,isPrintableCharacter:I,visible:i==="visible",children:[r.jsxs(qs,{$hasError:Kn,$size:L,$hasTextValue:!!Q,$hasClear:!!(Q&&E),className:o,children:[r.jsxs(C,{flex:"1",tag:"span",gap:3,children:[M?r.jsx(C,{flex:"0 0 1.6rem",tag:"span","aria-hidden":!0,children:M}):null,r.jsx(Us,{placeholder:P,id:ft,"aria-invalid":!!ht,onChange:We,ref:we,name:Yn,"aria-describedby":gt,...oe})]}),r.jsxs(C,{tag:"span",gap:3,children:[Q&&E?r.jsx(ge,{size:"XS",variant:"ghost",onClick:Ne,"aria-disabled":m,"aria-label":a,label:a,ref:Be,children:r.jsx(O.Cross,{})}):null,j?r.jsx(nt,{small:!0,children:"Loading"}):r.jsx(Gs,{children:r.jsx(O.CaretDown,{fill:"neutral500"})})]})]}),r.jsx(D.Combobox.Portal,{children:r.jsxs(Ks,{sideOffset:4,children:[r.jsx(Qe,{viewportRef:Ie,children:r.jsx(D.Combobox.Viewport,{children:r.jsxs(v,{padding:1,children:[Xn?r.jsx(Vs,{itemCount:Qt,children:n}):n,i!==!0&&!j?r.jsx(D.Combobox.NoValueFound,{asChild:!0,children:r.jsx(jt,{$hasHover:!1,children:r.jsx(T,{children:S(Q??"")})})}):null,j?r.jsx(C,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:r.jsx(nt,{small:!0,children:R})}):null,r.jsx(v,{id:Yt,width:"100%",height:"1px"})]})})}),i?r.jsx(Ys,{onPointerUp:Kt,onClick:Kt,disabled:c,asChild:!0,children:r.jsx(jt,{children:r.jsxs(C,{gap:2,children:[d&&r.jsx(v,{tag:"span","aria-hidden":!0,display:"inline-flex",children:d}),r.jsx(T,{children:u(Q??"")})]})})}):null]})})]})}),qs=s.styled(D.Combobox.Trigger)`
|
|
1209
1206
|
position: relative;
|
|
1210
|
-
border: 1px solid ${({theme:
|
|
1211
|
-
border-radius: ${({theme:
|
|
1212
|
-
background: ${({theme:
|
|
1207
|
+
border: 1px solid ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
1208
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1209
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1213
1210
|
overflow: hidden;
|
|
1214
1211
|
display: flex;
|
|
1215
1212
|
align-items: center;
|
|
1216
1213
|
justify-content: space-between;
|
|
1217
|
-
gap: ${({theme:
|
|
1218
|
-
padding-inline-start: ${({theme:
|
|
1219
|
-
padding-inline-end: ${({theme:
|
|
1220
|
-
${({$size:
|
|
1214
|
+
gap: ${({theme:e})=>e.spaces[4]};
|
|
1215
|
+
padding-inline-start: ${({theme:e})=>e.spaces[4]};
|
|
1216
|
+
padding-inline-end: ${({theme:e})=>e.spaces[3]};
|
|
1217
|
+
${({$size:e,$hasTextValue:t,$hasClear:n,theme:o})=>Nt({$size:e||"M",$hasValue:t||!1,$hasClear:n||!1,theme:o})}
|
|
1221
1218
|
|
|
1222
1219
|
&[data-disabled] {
|
|
1223
|
-
color: ${({theme:
|
|
1224
|
-
background: ${({theme:
|
|
1220
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1221
|
+
background: ${({theme:e})=>e.colors.neutral150};
|
|
1225
1222
|
cursor: not-allowed;
|
|
1226
1223
|
}
|
|
1227
1224
|
|
|
@@ -1230,11 +1227,11 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1230
1227
|
outline: none;
|
|
1231
1228
|
}
|
|
1232
1229
|
|
|
1233
|
-
${({theme:
|
|
1234
|
-
`,
|
|
1230
|
+
${({theme:e,$hasError:t})=>be()({theme:e,$hasError:t})};
|
|
1231
|
+
`,Us=s.styled(D.Combobox.TextInput)`
|
|
1235
1232
|
width: 100%;
|
|
1236
|
-
${
|
|
1237
|
-
color: ${({theme:
|
|
1233
|
+
${nn}
|
|
1234
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
1238
1235
|
padding: 0;
|
|
1239
1236
|
border: none;
|
|
1240
1237
|
background-color: transparent;
|
|
@@ -1245,129 +1242,129 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1245
1242
|
}
|
|
1246
1243
|
|
|
1247
1244
|
&::placeholder {
|
|
1248
|
-
color: ${({theme:
|
|
1245
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1249
1246
|
opacity: 1;
|
|
1250
1247
|
}
|
|
1251
1248
|
|
|
1252
1249
|
&[aria-disabled='true'] {
|
|
1253
1250
|
cursor: inherit;
|
|
1254
1251
|
}
|
|
1255
|
-
`,
|
|
1252
|
+
`,Gs=s.styled(D.Combobox.Icon)`
|
|
1256
1253
|
border: none;
|
|
1257
1254
|
background: transparent;
|
|
1258
1255
|
padding: 0;
|
|
1259
|
-
color: ${({theme:
|
|
1256
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1260
1257
|
display: flex;
|
|
1261
1258
|
|
|
1262
1259
|
&[aria-disabled='true'] {
|
|
1263
1260
|
cursor: inherit;
|
|
1264
1261
|
}
|
|
1265
|
-
`,
|
|
1266
|
-
background: ${({theme:
|
|
1267
|
-
box-shadow: ${({theme:
|
|
1268
|
-
border: 1px solid ${({theme:
|
|
1269
|
-
border-radius: ${({theme:
|
|
1262
|
+
`,Ks=s.styled(D.Combobox.Content)`
|
|
1263
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1264
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
1265
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
1266
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1270
1267
|
width: var(--radix-combobox-trigger-width);
|
|
1271
1268
|
/* This is from the design-system figma file. */
|
|
1272
1269
|
max-height: 35.5rem;
|
|
1273
|
-
z-index: ${({theme:
|
|
1270
|
+
z-index: ${({theme:e})=>e.zIndices.popover};
|
|
1274
1271
|
|
|
1275
1272
|
&:focus-visible {
|
|
1276
|
-
outline: ${({theme:
|
|
1273
|
+
outline: ${({theme:e})=>`2px solid ${e.colors.primary600}`};
|
|
1277
1274
|
outline-offset: 2px;
|
|
1278
1275
|
}
|
|
1279
1276
|
|
|
1280
1277
|
@media (prefers-reduced-motion: no-preference) {
|
|
1281
|
-
animation-duration: ${
|
|
1278
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1282
1279
|
|
|
1283
1280
|
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
1284
1281
|
&[data-state='open'] {
|
|
1285
|
-
animation-timing-function: ${
|
|
1282
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1286
1283
|
|
|
1287
1284
|
&[data-side='top'] {
|
|
1288
|
-
animation-name: ${
|
|
1285
|
+
animation-name: ${q.slideUpIn};
|
|
1289
1286
|
}
|
|
1290
1287
|
|
|
1291
1288
|
&[data-side='bottom'] {
|
|
1292
|
-
animation-name: ${
|
|
1289
|
+
animation-name: ${q.slideDownIn};
|
|
1293
1290
|
}
|
|
1294
1291
|
}
|
|
1295
1292
|
}
|
|
1296
|
-
`,
|
|
1293
|
+
`,Ys=s.styled(D.Combobox.CreateItem)`
|
|
1297
1294
|
&& {
|
|
1298
|
-
border-top: 1px solid ${({theme:
|
|
1295
|
+
border-top: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
1299
1296
|
border-top-left-radius: 0;
|
|
1300
1297
|
border-top-right-radius: 0;
|
|
1301
|
-
background: ${({theme:
|
|
1298
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1302
1299
|
cursor: pointer;
|
|
1303
|
-
padding: ${({theme:
|
|
1300
|
+
padding: ${({theme:e})=>e.spaces[1]};
|
|
1304
1301
|
position: sticky;
|
|
1305
1302
|
bottom: 0;
|
|
1306
1303
|
left: 0;
|
|
1307
1304
|
}
|
|
1308
1305
|
&&:hover,
|
|
1309
1306
|
&&[data-highlighted] {
|
|
1310
|
-
background: ${({theme:
|
|
1307
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1311
1308
|
}
|
|
1312
1309
|
&&[data-disabled] {
|
|
1313
|
-
color: ${({theme:
|
|
1310
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1314
1311
|
cursor: not-allowed;
|
|
1315
1312
|
}
|
|
1316
1313
|
&&[data-disabled] svg {
|
|
1317
|
-
fill: ${({theme:
|
|
1314
|
+
fill: ${({theme:e})=>e.colors.neutral300};
|
|
1318
1315
|
}
|
|
1319
1316
|
&& > div {
|
|
1320
|
-
padding: ${({theme:
|
|
1317
|
+
padding: ${({theme:e})=>e.spaces[2]} ${({theme:e})=>e.spaces[4]};
|
|
1321
1318
|
}
|
|
1322
1319
|
&& > div:hover,
|
|
1323
1320
|
&&[data-highlighted] > div {
|
|
1324
|
-
background-color: ${({theme:
|
|
1325
|
-
border-radius: ${({theme:
|
|
1321
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
1322
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1326
1323
|
}
|
|
1327
1324
|
&&[data-disabled] > div {
|
|
1328
1325
|
background-color: inherit;
|
|
1329
1326
|
}
|
|
1330
|
-
`,
|
|
1327
|
+
`,an=l.forwardRef(({children:e,value:t,disabled:n,textValue:o,...a},i)=>r.jsx(D.Combobox.ComboboxItem,{asChild:!0,value:t,disabled:n,textValue:o,children:r.jsx(jt,{ref:i,...a,children:r.jsx(D.Combobox.ItemText,{asChild:!0,children:r.jsx(T,{children:e})})})})),jt=s.styled.div`
|
|
1331
1328
|
width: 100%;
|
|
1332
1329
|
border: none;
|
|
1333
1330
|
text-align: left;
|
|
1334
1331
|
outline-offset: -3px;
|
|
1335
|
-
padding: ${({theme:
|
|
1336
|
-
background-color: ${({theme:
|
|
1337
|
-
border-radius: ${({theme:
|
|
1332
|
+
padding: ${({theme:e})=>e.spaces[2]} ${({theme:e})=>e.spaces[4]};
|
|
1333
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
1334
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1338
1335
|
user-select: none;
|
|
1339
1336
|
|
|
1340
1337
|
&[data-state='checked'] {
|
|
1341
|
-
background-color: ${({theme:
|
|
1342
|
-
color: ${({theme:
|
|
1338
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
1339
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
1343
1340
|
font-weight: bold;
|
|
1344
1341
|
}
|
|
1345
1342
|
|
|
1346
1343
|
&:hover,
|
|
1347
1344
|
&[data-highlighted] {
|
|
1348
1345
|
outline: none;
|
|
1349
|
-
background-color: ${({theme:
|
|
1346
|
+
background-color: ${({theme:e,$hasHover:t=!0})=>t?e.colors.primary100:e.colors.neutral0};
|
|
1350
1347
|
}
|
|
1351
1348
|
|
|
1352
1349
|
&[data-highlighted] {
|
|
1353
|
-
color: ${({theme:
|
|
1350
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
1354
1351
|
font-weight: bold;
|
|
1355
1352
|
}
|
|
1356
|
-
`,
|
|
1357
|
-
background: ${
|
|
1353
|
+
`,Wt=(e,t)=>`${e}${Math.floor(t*255).toString(16).padStart(2,"0")}`,Qs=pe.Root,Xs=l.forwardRef((e,t)=>r.jsx(pe.Trigger,{...e,asChild:!0,ref:t})),Zs=l.forwardRef((e,t)=>r.jsx(pe.Portal,{children:r.jsx(Js,{children:r.jsx(ei,{ref:t,...e})})})),Js=s.styled(pe.Overlay)`
|
|
1354
|
+
background: ${e=>Wt(e.theme.colors.neutral800,.2)};
|
|
1358
1355
|
position: fixed;
|
|
1359
1356
|
inset: 0;
|
|
1360
|
-
z-index: ${
|
|
1357
|
+
z-index: ${e=>e.theme.zIndices.overlay};
|
|
1361
1358
|
will-change: opacity;
|
|
1362
1359
|
|
|
1363
1360
|
@media (prefers-reduced-motion: no-preference) {
|
|
1364
|
-
animation: ${
|
|
1365
|
-
${
|
|
1361
|
+
animation: ${q.overlayFadeIn} ${e=>e.theme.motion.timings[200]}
|
|
1362
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
1366
1363
|
}
|
|
1367
|
-
`,
|
|
1364
|
+
`,ei=s.styled(pe.Content)`
|
|
1368
1365
|
max-width: 42rem;
|
|
1369
1366
|
height: min-content;
|
|
1370
|
-
width: calc(100% - ${({theme:
|
|
1367
|
+
width: calc(100% - ${({theme:e})=>e.spaces[8]});
|
|
1371
1368
|
overflow: hidden;
|
|
1372
1369
|
margin: 0 auto;
|
|
1373
1370
|
display: flex;
|
|
@@ -1378,33 +1375,33 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1378
1375
|
left: 50%;
|
|
1379
1376
|
transform: translate(-50%, -50%);
|
|
1380
1377
|
|
|
1381
|
-
border-radius: ${
|
|
1382
|
-
background-color: ${
|
|
1383
|
-
box-shadow: ${
|
|
1384
|
-
z-index: ${
|
|
1378
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
1379
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
1380
|
+
box-shadow: ${e=>e.theme.shadows.popupShadow};
|
|
1381
|
+
z-index: ${e=>e.theme.zIndices.modal};
|
|
1385
1382
|
|
|
1386
1383
|
@media (prefers-reduced-motion: no-preference) {
|
|
1387
1384
|
&[data-state='open'] {
|
|
1388
|
-
animation-duration: ${
|
|
1389
|
-
animation-timing-function: ${
|
|
1390
|
-
animation-name: ${
|
|
1385
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1386
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1387
|
+
animation-name: ${q.modalPopIn};
|
|
1391
1388
|
}
|
|
1392
1389
|
|
|
1393
1390
|
&[data-state='closed'] {
|
|
1394
|
-
animation-duration: ${
|
|
1395
|
-
animation-timing-function: ${
|
|
1396
|
-
animation-name: ${
|
|
1391
|
+
animation-duration: ${e=>e.theme.motion.timings[120]};
|
|
1392
|
+
animation-timing-function: ${e=>e.theme.motion.easings.easeOutQuad};
|
|
1393
|
+
animation-name: ${q.modalPopOut};
|
|
1397
1394
|
}
|
|
1398
1395
|
}
|
|
1399
|
-
`,
|
|
1396
|
+
`,ti=l.forwardRef(({children:e,...t},n)=>r.jsx(pe.Title,{asChild:!0,children:r.jsx(ri,{tag:"h2",variant:"beta",ref:n,padding:6,fontWeight:"bold",...t,children:e})})),ri=s.styled(T)`
|
|
1400
1397
|
display: flex;
|
|
1401
1398
|
justify-content: center;
|
|
1402
|
-
border-bottom: solid 1px ${
|
|
1403
|
-
`,
|
|
1404
|
-
border-top: solid 1px ${
|
|
1399
|
+
border-bottom: solid 1px ${e=>e.theme.colors.neutral150};
|
|
1400
|
+
`,ni=l.forwardRef(({children:e,icon:t,...n},o)=>r.jsx(C,{ref:o,gap:2,direction:"column",paddingTop:8,paddingBottom:8,paddingLeft:6,paddingRight:6,...n,children:typeof e=="string"?r.jsxs(r.Fragment,{children:[t?l.cloneElement(t,{width:24,height:24}):null,r.jsx(sn,{children:e})]}):e})),sn=l.forwardRef((e,t)=>r.jsx(pe.Description,{asChild:!0,children:r.jsx(T,{ref:t,variant:"omega",...e,tag:"p"})})),oi=l.forwardRef((e,t)=>r.jsx(ai,{ref:t,gap:2,padding:4,justifyContent:"space-between",...e,tag:"footer"})),ai=s.styled(C)`
|
|
1401
|
+
border-top: solid 1px ${e=>e.theme.colors.neutral150};
|
|
1405
1402
|
flex: 1;
|
|
1406
|
-
|
|
1407
|
-
${
|
|
1403
|
+
`,si=l.forwardRef((e,t)=>r.jsx(pe.Cancel,{...e,asChild:!0,ref:t})),ii=l.forwardRef((e,t)=>r.jsx(pe.Action,{...e,asChild:!0,ref:t})),li=Object.freeze(Object.defineProperty({__proto__:null,Action:ii,Body:ni,Cancel:si,Content:Zs,Description:sn,Footer:oi,Header:ti,Root:Qs,Trigger:Xs},Symbol.toStringTag,{value:"Module"}));function ue(e,t){const n=l.useRef(null);return t&&n.current&&ci(t,n.current)&&(t=n.current),n.current=t??null,l.useMemo(()=>new F.DateFormatter(e,t),[e,t])}function ci(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const a of n)if(t[a]!==e[a])return!1;return!0}const ln=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),he=ln()?X.useEffect:X.useLayoutEffect,Ae={Log:"live-region-log",Status:"live-region-status",Alert:"live-region-alert"},cr=e=>{const t=document.querySelector(`#${Ae.Log}`);t&&(t.innerText=e)},dr=e=>{const t=document.querySelector(`#${Ae.Status}`);t&&(t.innerText=e)},ur=e=>{const t=document.querySelector(`#${Ae.Alert}`);t&&(t.innerText=e)},di=()=>(l.useEffect(()=>()=>{cr(""),ur(""),dr("")},[]),{notifyLog:cr,notifyAlert:ur,notifyStatus:dr}),cn=()=>r.jsxs(me,{children:[r.jsx("p",{role:"log","aria-live":"polite",id:Ae.Log,"aria-relevant":"all"}),r.jsx("p",{role:"status","aria-live":"polite",id:Ae.Status,"aria-relevant":"all"}),r.jsx("p",{role:"alert","aria-live":"assertive",id:Ae.Alert,"aria-relevant":"all"})]}),ui=s.createGlobalStyle`
|
|
1404
|
+
${s.css`
|
|
1408
1405
|
*,
|
|
1409
1406
|
*::before,
|
|
1410
1407
|
*::after {
|
|
@@ -1424,7 +1421,7 @@ ${m.css`
|
|
|
1424
1421
|
height: 100%;
|
|
1425
1422
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
1426
1423
|
'Helvetica Neue', sans-serif;
|
|
1427
|
-
color: ${({theme:
|
|
1424
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
1428
1425
|
line-height: 1.5;
|
|
1429
1426
|
-webkit-font-smoothing: antialiased;
|
|
1430
1427
|
}
|
|
@@ -1480,7 +1477,7 @@ ${m.css`
|
|
|
1480
1477
|
}
|
|
1481
1478
|
|
|
1482
1479
|
*:focus-visible {
|
|
1483
|
-
outline: 2px solid ${({theme:
|
|
1480
|
+
outline: 2px solid ${({theme:e})=>e.colors.primary600};
|
|
1484
1481
|
outline-offset: 2px;
|
|
1485
1482
|
}
|
|
1486
1483
|
|
|
@@ -1502,7 +1499,7 @@ ${m.css`
|
|
|
1502
1499
|
overflow-y: hidden;
|
|
1503
1500
|
}
|
|
1504
1501
|
`}
|
|
1505
|
-
`,
|
|
1502
|
+
`,hr="en-EN",dn=()=>typeof navigator>"u"?hr:navigator.language?navigator.language:hr,[hi,Xe]=Oe("StrapiDesignSystem",{locale:dn()}),fi=({children:e,locale:t=dn(),theme:n=Mt,tooltipConfig:o})=>(he(()=>{const a=document.createElement("style");a.type="text/css",a.appendChild(document.createTextNode(`
|
|
1506
1503
|
* {
|
|
1507
1504
|
-webkit-transition: none !important;
|
|
1508
1505
|
-moz-transition: none !important;
|
|
@@ -1511,24 +1508,24 @@ ${m.css`
|
|
|
1511
1508
|
transition: none !important;
|
|
1512
1509
|
animation: none !important;
|
|
1513
1510
|
}
|
|
1514
|
-
`)),document.head.appendChild(
|
|
1515
|
-
border: 1px solid ${({theme:
|
|
1516
|
-
padding-inline-start: ${({theme:
|
|
1517
|
-
padding-inline-end: ${({theme:
|
|
1511
|
+
`)),document.head.appendChild(a),window.getComputedStyle(a).opacity,document.head.removeChild(a)},[n]),r.jsx(hi,{locale:t,children:r.jsxs(s.ThemeProvider,{theme:n,children:[r.jsx($r.Provider,{...o,children:e}),r.jsx(cn,{}),r.jsx(ui,{})]})})),un=xo.Root,Ft=l.forwardRef(({container:e=(o=>(o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body)(),...t},n)=>e?co.createPortal(r.jsx(v,{ref:n,...t}),e):null);Ft.displayName="Portal";const gi=l.forwardRef(({onClear:e,clearLabel:t="Clear",startIcon:n,disabled:o,hasError:a,loading:i,children:c,id:d,size:u="M",withTags:h,...f},g)=>{const p=l.useRef(null),w=k=>{e&&!o&&(e(k),p.current.focus())},{labelNode:m}=ne("SelectTrigger"),$=te(p,g);return r.jsx(D.Select.Trigger,{asChild:!0,children:r.jsxs(pi,{"aria-disabled":o,$hasError:a,ref:$,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:o?"neutral150":"neutral0",gap:4,cursor:"default","aria-labelledby":m?`${d}-label`:void 0,$size:u,$withTags:h,$hasClear:!!e,...f,children:[r.jsxs(C,{flex:"1",tag:"span",gap:3,overflow:"hidden",children:[n&&r.jsx(C,{tag:"span","aria-hidden":!0,children:n}),c]}),r.jsxs(C,{tag:"span",gap:3,children:[e?r.jsx(ge,{size:"XS",variant:"ghost",onClick:w,"aria-disabled":o,"aria-label":t,label:t,children:r.jsx(O.Cross,{})}):null,i?r.jsx(nt,{small:!0,children:"Loading"}):r.jsx(mi,{children:r.jsx(O.CaretDown,{})})]})]})})}),pi=s.styled(C)`
|
|
1512
|
+
border: 1px solid ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
1513
|
+
padding-inline-start: ${({theme:e})=>e.spaces[4]};
|
|
1514
|
+
padding-inline-end: ${({theme:e})=>e.spaces[3]};
|
|
1518
1515
|
|
|
1519
|
-
${({$size:
|
|
1520
|
-
padding-inline-start: calc(${
|
|
1521
|
-
padding-block: calc(${
|
|
1516
|
+
${({$size:e,$hasClear:t,$withTags:n,theme:o})=>n?s.css`
|
|
1517
|
+
padding-inline-start: calc(${o.spaces[2]} - 1px);
|
|
1518
|
+
padding-block: calc(${o.spaces[2]} - 1px);
|
|
1522
1519
|
|
|
1523
|
-
${
|
|
1520
|
+
${o.breakpoints.medium} {
|
|
1524
1521
|
padding-inline-start: 0.3rem;
|
|
1525
1522
|
padding-block: 0.3rem;
|
|
1526
1523
|
}
|
|
1527
|
-
`:
|
|
1524
|
+
`:Nt({$size:e||"M",$hasValue:t,$hasClear:t,theme:o})}
|
|
1528
1525
|
cursor: pointer;
|
|
1529
1526
|
|
|
1530
1527
|
&[aria-disabled='true'] {
|
|
1531
|
-
color: ${
|
|
1528
|
+
color: ${e=>e.theme.colors.neutral500};
|
|
1532
1529
|
}
|
|
1533
1530
|
|
|
1534
1531
|
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
@@ -1536,93 +1533,93 @@ ${m.css`
|
|
|
1536
1533
|
outline: none;
|
|
1537
1534
|
}
|
|
1538
1535
|
|
|
1539
|
-
${({theme:
|
|
1540
|
-
`,
|
|
1536
|
+
${({theme:e,$hasError:t})=>be()({theme:e,$hasError:t})};
|
|
1537
|
+
`,mi=s.styled(D.Select.Icon)`
|
|
1541
1538
|
display: flex;
|
|
1542
1539
|
& > svg {
|
|
1543
|
-
fill: ${({theme:
|
|
1540
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
1544
1541
|
}
|
|
1545
|
-
`,
|
|
1542
|
+
`,bi=l.forwardRef(({children:e,placeholder:t,withTags:n,...o},a)=>r.jsx(xi,{ref:a,ellipsis:!0,...o,children:r.jsx($i,{placeholder:t,$withTags:n,children:e})})),xi=s.styled(T)`
|
|
1546
1543
|
flex: 1;
|
|
1547
1544
|
min-height: 2.4rem;
|
|
1548
1545
|
|
|
1549
|
-
${({theme:
|
|
1546
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1550
1547
|
min-height: 2.2rem;
|
|
1551
1548
|
}
|
|
1552
|
-
|
|
1553
|
-
${({$withTags:
|
|
1549
|
+
`,$i=s.styled(D.Select.Value)`
|
|
1550
|
+
${({$withTags:e})=>e?s.css`
|
|
1554
1551
|
display: flex;
|
|
1555
1552
|
flex-wrap: wrap;
|
|
1556
|
-
gap: ${({theme:
|
|
1553
|
+
gap: ${({theme:t})=>t.spaces[1]};
|
|
1557
1554
|
`:null};
|
|
1558
|
-
`,
|
|
1559
|
-
background: ${({theme:
|
|
1560
|
-
box-shadow: ${({theme:
|
|
1561
|
-
border: 1px solid ${({theme:
|
|
1562
|
-
border-radius: ${({theme:
|
|
1555
|
+
`,yi=l.forwardRef((e,t)=>r.jsx(wi,{ref:t,...e,children:r.jsx(Qe,{children:e.children})})),wi=s.styled(D.Select.Content)`
|
|
1556
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
1557
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
1558
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
1559
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1563
1560
|
min-width: var(--radix-select-trigger-width);
|
|
1564
1561
|
max-height: 15.6rem;
|
|
1565
|
-
z-index: ${({theme:
|
|
1562
|
+
z-index: ${({theme:e})=>e.zIndices.popover};
|
|
1566
1563
|
|
|
1567
1564
|
@media (prefers-reduced-motion: no-preference) {
|
|
1568
|
-
animation-duration: ${
|
|
1565
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1569
1566
|
|
|
1570
1567
|
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
1571
1568
|
&[data-state='open'] {
|
|
1572
|
-
animation-timing-function: ${
|
|
1569
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1573
1570
|
|
|
1574
1571
|
&[data-side='top'] {
|
|
1575
|
-
animation-name: ${
|
|
1572
|
+
animation-name: ${q.slideUpIn};
|
|
1576
1573
|
}
|
|
1577
1574
|
|
|
1578
1575
|
&[data-side='bottom'] {
|
|
1579
|
-
animation-name: ${
|
|
1576
|
+
animation-name: ${q.slideDownIn};
|
|
1580
1577
|
}
|
|
1581
1578
|
}
|
|
1582
1579
|
}
|
|
1583
|
-
`,
|
|
1584
|
-
padding: ${({theme:
|
|
1585
|
-
`,
|
|
1580
|
+
`,Ci=s.styled(D.Select.Viewport)`
|
|
1581
|
+
padding: ${({theme:e})=>e.spaces[1]};
|
|
1582
|
+
`,ji=l.forwardRef((e,t)=>r.jsx(ki,{ref:t,...e})),vi=s.css`
|
|
1586
1583
|
width: 100%;
|
|
1587
1584
|
border: none;
|
|
1588
1585
|
text-align: left;
|
|
1589
1586
|
outline-offset: -3px;
|
|
1590
|
-
border-radius: ${
|
|
1591
|
-
padding: ${
|
|
1592
|
-
padding-left: ${({theme:
|
|
1593
|
-
background-color: ${({theme:
|
|
1587
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
1588
|
+
padding: ${e=>`${e.theme.spaces[2]} ${e.theme.spaces[4]}`};
|
|
1589
|
+
padding-left: ${({theme:e})=>e.spaces[4]};
|
|
1590
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
1594
1591
|
display: flex;
|
|
1595
1592
|
align-items: center;
|
|
1596
|
-
gap: ${({theme:
|
|
1593
|
+
gap: ${({theme:e})=>e.spaces[2]};
|
|
1597
1594
|
white-space: nowrap;
|
|
1598
1595
|
user-select: none;
|
|
1599
|
-
color: ${({theme:
|
|
1596
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
1600
1597
|
|
|
1601
1598
|
&:focus-visible {
|
|
1602
1599
|
outline: none;
|
|
1603
|
-
background-color: ${({theme:
|
|
1600
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
1604
1601
|
cursor: pointer;
|
|
1605
1602
|
}
|
|
1606
|
-
`,
|
|
1607
|
-
${
|
|
1603
|
+
`,ki=s.styled(D.Select.Item)`
|
|
1604
|
+
${vi}
|
|
1608
1605
|
|
|
1609
1606
|
&:hover {
|
|
1610
|
-
background-color: ${({theme:
|
|
1607
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
1611
1608
|
cursor: pointer;
|
|
1612
1609
|
}
|
|
1613
|
-
`,
|
|
1614
|
-
min-width: ${({$hasOnClear:
|
|
1615
|
-
border: 1px solid ${({theme:
|
|
1616
|
-
padding-inline: ${({theme:
|
|
1617
|
-
${({$size:
|
|
1610
|
+
`,hn=D.Select.Root,fn=gi,gn=bi,pn=D.Select.Portal,mn=yi,bn=Ci,Ht=ji,xn=D.Select.ItemIndicator,$n=D.Select.ItemText,Si=D.Select.Group,vt=l.forwardRef(({children:e,clearLabel:t="Clear",customizeContent:n,disabled:o,hasError:a,id:i,loading:c,name:d,onChange:u,onClear:h,onCloseAutoFocus:f,onReachEnd:g,placeholder:p,required:w,size:m,startIcon:$,value:k,...y},x)=>{const[I,j]=l.useState(),[R,b]=l.useState(!1),S=Y=>{b(Y)},z=Y=>{h&&h(Y),u||j("")},E=Y=>{u?u(typeof k=="number"?Number(Y):Y):j(Y)},A=l.useRef(null),U=re(),B=`intersection-${ze(U)}`;Ge(A,Y=>{g&&g(Y)},{selectorToWatch:`#${B}`,skipWhen:!R});const{error:H,required:P,...K}=ne("SingleSelect"),L=!!H||a,M=K.id??i,Z=K.name??d;let G;H?G=`${M}-error`:K.hint&&(G=`${M}-hint`);const oe=(typeof k<"u"&&k!==null?k.toString():I)??"";return r.jsxs(hn,{onOpenChange:S,disabled:o,required:P??w,onValueChange:E,value:oe,...y,children:[r.jsx(fn,{ref:x,id:M,name:Z,startIcon:$,hasError:L,disabled:o,clearLabel:t,loading:c,onClear:oe&&h?z:void 0,"aria-label":y["aria-label"],"aria-describedby":G??y["aria-describedby"],size:m,children:r.jsx(gn,{placeholder:p,textColor:oe?"neutral800":"neutral600",children:oe&&n?n(oe):void 0})}),r.jsx(pn,{children:r.jsx(mn,{position:"popper",sideOffset:4,onCloseAutoFocus:f,children:r.jsxs(bn,{ref:A,children:[e,r.jsx(v,{id:B,width:"100%",height:"1px"})]})})})]})}),kt=l.forwardRef(({value:e,startIcon:t,children:n,...o},a)=>r.jsxs(Ht,{ref:a,value:e.toString(),...o,children:[t&&r.jsx(C,{tag:"span","aria-hidden":!0,children:t}),r.jsx(T,{lineHeight:"20px",width:"100%",children:r.jsx($n,{children:n})})]})),Ri=200,fr=15,[Ti,Me]=Oe("DatePicker"),Ii=l.forwardRef(({calendarLabel:e,className:t,initialDate:n,locale:o,maxDate:a,minDate:i,monthSelectLabel:c="Month",onChange:d,value:u,yearSelectLabel:h="Year",hasError:f,id:g,name:p,disabled:w=!1,required:m=!1,onClear:$,clearLabel:k="Clear",size:y="M",...x},I)=>{const j=F.getLocalTimeZone(),R=Xe("DatePicker"),b=o??R.locale,S=ue(b,{day:"2-digit",month:"2-digit",year:"numeric"}),[z,E]=l.useState(!1),[A,U]=l.useState(null),[B,N]=l.useState(null),[H,P]=l.useState(null),[K,L]=l.useState(),[M,Z]=le({defaultProp:n?je(n):void 0,prop:u?je(u):void 0,onChange(V){d&&d(V==null?void 0:V.toDate(j))}}),[G,oe]=l.useMemo(()=>{const V=n?je(n):F.today("UTC"),De=i?je(i):V.set({day:1,month:1,year:V.year-Ri});let We=a?je(a):V.set({day:31,month:12,year:V.year+fr});return We.compare(De)<0&&(We=De.set({day:31,month:12,year:De.year+fr})),[De,We]},[i,a,n]),[Y,J]=l.useState(Di({currentValue:M,minDate:G,maxDate:oe})),_=re(),Q=l.useRef(null),de=V=>{$&&!w&&(L(""),Z(void 0),$(V),B==null||B.focus())},$e=l.useCallback(V=>{V&&M&&J(M),E(V)},[M]);he(()=>{if(u){const V=je(u);L(S.format(V.toDate(j))),J(V)}else L("")},[u,S,j]),he(()=>{if(n&&K===void 0){const V=je(n);L(S.format(V.toDate(j)))}},[n,K,S,j]);const{error:ye,...fe}=ne("Combobox"),Ie=!!ye||f,we=fe.id??g,Be=fe.name??p,Ne=fe.required||m;let Ce;return ye?Ce=`${we}-error`:fe.hint&&(Ce=`${we}-hint`),r.jsxs(Ti,{calendarDate:Y,content:H,contentId:_,disabled:w,locale:b,minDate:G,maxDate:oe,open:z,onCalendarDateChange:J,onContentChange:P,onOpenChange:$e,onTextInputChange:N,onTextValueChange:L,onTriggerChange:U,onValueChange:Z,onClear:$,required:Ne,textInput:B,textValue:K,timeZone:j,trigger:A,value:M,children:[r.jsxs(Ai,{className:t,hasError:Ie,size:y,children:[r.jsx(O.Calendar,{fill:"neutral500","aria-hidden":!0}),r.jsx(Oi,{ref:I,"aria-describedby":Ce,id:we,name:Be,...x}),K&&$?r.jsx(ge,{size:"XS",variant:"ghost",onClick:de,"aria-disabled":w,"aria-label":k,label:k,ref:Q,children:r.jsx(O.Cross,{})}):null]}),r.jsx(Ft,{children:r.jsx(Ni,{label:e,children:r.jsx(Ui,{monthSelectLabel:c,yearSelectLabel:h})})})]})}),gr=e=>!!e.match(/^[^a-zA-Z]*$/),Di=({currentValue:e,minDate:t,maxDate:n})=>{const o=F.today("UTC");return e||(F.minDate(t,o)===t&&F.maxDate(n,o)===n?o:F.minDate(t,o)===o?t:F.maxDate(n,o)===o?n:o)},Ei="DatePickerTrigger",Ai=l.forwardRef(({hasError:e,size:t,...n},o)=>{const a=Me(Ei),i=te(o,d=>a.onTriggerChange(d)),c=()=>{a.disabled||a.onOpenChange(!0)};return r.jsx(io.FocusScope,{asChild:!0,trapped:a.open,onMountAutoFocus:d=>{d.preventDefault()},onUnmountAutoFocus:d=>{var u;(u=document.getSelection())==null||u.empty(),d.preventDefault()},children:r.jsx(zi,{ref:i,$hasError:e,$hasTextValue:!!a.textValue,$size:t,$hasOnClear:!!a.onClear,...n,hasRadius:!0,gap:3,overflow:"hidden",background:a.disabled?"neutral150":"neutral0",onClick:D.composeEventHandlers(n.onClick,()=>{var d;(d=a.textInput)==null||d.focus()}),onPointerDown:D.composeEventHandlers(n.onPointerDown,d=>{var f;const u=d.target;u.hasPointerCapture(d.pointerId)&&u.releasePointerCapture(d.pointerId),(u.closest("button")??u.closest("div"))===d.currentTarget&&d.button===0&&d.ctrlKey===!1&&(c(),(f=a.textInput)==null||f.focus())})})})}),zi=s.styled(C)`
|
|
1611
|
+
min-width: ${({$hasOnClear:e})=>e?"160px":"130px"};
|
|
1612
|
+
border: 1px solid ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
1613
|
+
padding-inline: ${({theme:e})=>e.spaces[3]};
|
|
1614
|
+
${({$size:e,$hasTextValue:t,$hasOnClear:n,theme:o})=>Nt({$size:e||"M",$hasValue:t||!1,$hasClear:n||!1,theme:o})}
|
|
1618
1615
|
|
|
1619
1616
|
& > svg {
|
|
1620
1617
|
flex: 1 0 auto;
|
|
1621
1618
|
}
|
|
1622
1619
|
|
|
1623
1620
|
&[data-disabled] {
|
|
1624
|
-
color: ${({theme:
|
|
1625
|
-
background: ${({theme:
|
|
1621
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1622
|
+
background: ${({theme:e})=>e.colors.neutral150};
|
|
1626
1623
|
cursor: not-allowed;
|
|
1627
1624
|
}
|
|
1628
1625
|
|
|
@@ -1631,11 +1628,11 @@ ${m.css`
|
|
|
1631
1628
|
outline: none;
|
|
1632
1629
|
}
|
|
1633
1630
|
|
|
1634
|
-
${({theme:
|
|
1635
|
-
`,
|
|
1631
|
+
${({theme:e,$hasError:t})=>be()({theme:e,$hasError:t})};
|
|
1632
|
+
`,Li="DatePickerTextInput",Oi=l.forwardRef(({placeholder:e,...t},n)=>{const o=Me(Li),{onTextValueChange:a,textValue:i,onTextInputChange:c,onOpenChange:d,disabled:u,locale:h}=o,f=te(n,y=>c(y)),g=()=>{u||d(!0)},p=ue(h,{year:"numeric",month:"2-digit",day:"2-digit"}),[w,m,$]=l.useMemo(()=>{var R;const y=p.formatToParts(new Date),x=y.filter(b=>b.type==="year"||b.type==="month"||b.type==="day"),I=x.map(b=>{switch(b.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),j=((R=y.find(b=>b.type==="literal"))==null?void 0:R.value)??"";return[I,j,x]},[p]),k=w.map(y=>`\\d{${y.length}}`).join(`\\${m}`);return r.jsx(Mi,{role:"combobox",type:"text",inputMode:"numeric",ref:f,"aria-autocomplete":"none","aria-controls":o.contentId,"aria-disabled":o.disabled,"aria-expanded":o.open,"aria-required":o.required,"aria-haspopup":"dialog","data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,pattern:k,placeholder:e??w.join(m),...t,value:i??"",onBlur:D.composeEventHandlers(t.onBlur,()=>{if(!o.textValue){o.onValueChange(void 0);return}o.onTextValueChange(p.format(o.calendarDate.toDate(o.timeZone))),o.onValueChange(o.calendarDate)}),onChange:D.composeEventHandlers(t.onChange,y=>{if(gr(y.target.value)){const x=y.target.value.split(m),[I,j,R]=$.map((N,H)=>{const P=x[H];return{...N,value:P}}).sort((N,H)=>N.type==="year"?1:H.type==="year"?-1:N.type==="month"?1:H.type==="month"?-1:0).map(N=>N.value),b=o.calendarDate.year;let S=o.calendarDate.year;if(R){const N=R.length===1?`0${R}`:R;S=R.length<3?Number(`${b}`.slice(0,4-N.length)+N):Number(N)}R&&R.length<3&&S>o.maxDate.year&&(S-=100);const z=o.calendarDate.set({year:S}),E=z.calendar.getMonthsInYear(z),A=z.set({month:j&&Number(j)<=E?Number(j):void 0}),U=A.calendar.getDaysInMonth(A),B=A.set({day:I&&Number(I)<=U?Number(I):void 0});o.onCalendarDateChange(Pi(B,o.minDate,o.maxDate)),o.onTextValueChange(y.target.value)}}),onKeyDown:D.composeEventHandlers(t.onKeyDown,y=>{if(!o.open&&(gr(y.key)||["ArrowDown","Backspace"].includes(y.key)))g();else if(["Tab"].includes(y.key)&&o.open)y.preventDefault();else if(["Escape"].includes(y.key))o.open?o.onOpenChange(!1):(o.onValueChange(void 0),o.onTextValueChange("")),y.preventDefault();else if(o.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(y.key))switch(y.preventDefault(),y.key){case"ArrowDown":{const x=o.calendarDate.add({weeks:1});if(o.maxDate&&x.compare(o.maxDate)>0)return;o.onCalendarDateChange(x);return}case"ArrowRight":{const x=o.calendarDate.add({days:1});if(o.maxDate&&x.compare(o.maxDate)>0)return;o.onCalendarDateChange(x);return}case"ArrowUp":{const x=o.calendarDate.subtract({weeks:1});if(o.minDate&&x.compare(o.minDate)<0)return;o.onCalendarDateChange(x);return}case"ArrowLeft":{const x=o.calendarDate.subtract({days:1});if(o.minDate&&x.compare(o.minDate)<0)return;o.onCalendarDateChange(x)}}else o.open&&["Enter"].includes(y.key)&&(y.preventDefault(),a(p.format(o.calendarDate.toDate(o.timeZone))),o.onValueChange(o.calendarDate),o.onOpenChange(!1))})})});function Pi(e,t,n){return t&&(e=F.maxDate(e,t)),n&&(e=F.minDate(e,n)),e}const Mi=s.styled.input`
|
|
1636
1633
|
width: 100%;
|
|
1637
|
-
${
|
|
1638
|
-
color: ${({theme:
|
|
1634
|
+
${nn}
|
|
1635
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
1639
1636
|
border: none;
|
|
1640
1637
|
background-color: transparent;
|
|
1641
1638
|
|
|
@@ -1644,51 +1641,51 @@ ${m.css`
|
|
|
1644
1641
|
}
|
|
1645
1642
|
|
|
1646
1643
|
&::placeholder {
|
|
1647
|
-
color: ${({theme:
|
|
1644
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
1648
1645
|
opacity: 1;
|
|
1649
1646
|
}
|
|
1650
1647
|
|
|
1651
1648
|
&[aria-disabled='true'] {
|
|
1652
1649
|
cursor: inherit;
|
|
1653
1650
|
}
|
|
1654
|
-
`,
|
|
1655
|
-
box-shadow: ${({theme:
|
|
1656
|
-
z-index: ${({theme:
|
|
1657
|
-
border: 1px solid ${({theme:
|
|
1651
|
+
`,Bi="DatePickerContent",Ni=l.forwardRef((e,t)=>{const n=Me(Bi),[o,a]=l.useState(!1);return l.useEffect(()=>{n.open&&!o&&a(!0)},[n.open,o]),!n.open&&!o||!n.open?null:r.jsx(Fi,{...e,ref:t})}),Wi="DatePickerContent",Fi=l.forwardRef((e,t)=>{const{label:n="Choose date",...o}=e,{onOpenChange:a,...i}=Me(Wi),{x:c,y:d,refs:u,strategy:h,placement:f}=Fe.useFloating({strategy:"fixed",placement:"bottom-start",middleware:[Fe.offset({mainAxis:4}),Fe.shift(),Fe.flip()],elements:{reference:i.trigger},whileElementsMounted:Fe.autoUpdate});l.useEffect(()=>{const p=()=>{a(!1)};return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[a]);const g=te(t,p=>i.onContentChange(p),u.setFloating);return so.useFocusGuards(),r.jsx(lo.RemoveScroll,{allowPinchZoom:!0,children:r.jsx(un,{asChild:!0,onFocusOutside:p=>{p.preventDefault()},onDismiss:()=>{a(!1)},children:r.jsx(Hi,{ref:g,"data-state":i.open?"open":"closed","data-side":f.includes("top")?"top":"bottom",onContextMenu:p=>p.preventDefault(),id:i.contentId,role:"dialog","aria-modal":"true","aria-label":n,style:{left:c,top:d,position:h},hasRadius:!0,background:"neutral0",padding:1,...o})})})}),Hi=s.styled(v)`
|
|
1652
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
1653
|
+
z-index: ${({theme:e})=>e.zIndices.popover};
|
|
1654
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
1658
1655
|
|
|
1659
1656
|
@media (prefers-reduced-motion: no-preference) {
|
|
1660
|
-
animation-duration: ${
|
|
1657
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1661
1658
|
|
|
1662
1659
|
&[data-state='open'] {
|
|
1663
|
-
animation-timing-function: ${
|
|
1660
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1664
1661
|
|
|
1665
1662
|
&[data-side='top'] {
|
|
1666
|
-
animation-name: ${
|
|
1663
|
+
animation-name: ${q.slideUpIn};
|
|
1667
1664
|
}
|
|
1668
1665
|
|
|
1669
1666
|
&[data-side='bottom'] {
|
|
1670
|
-
animation-name: ${
|
|
1667
|
+
animation-name: ${q.slideDownIn};
|
|
1671
1668
|
}
|
|
1672
1669
|
}
|
|
1673
1670
|
}
|
|
1674
|
-
`,
|
|
1671
|
+
`,_i="DatePickerCalendar",[Vi,qi]=Oe("DateFormatters"),Ui=l.forwardRef(({monthSelectLabel:e,yearSelectLabel:t,...n},o)=>{const{locale:a,timeZone:i,minDate:c,maxDate:d,calendarDate:u,onCalendarDateChange:h}=Me(_i),f=F.startOfMonth(u),g=l.useMemo(()=>{const b=c.year,S=d.year;return[...Array(S-b+1).keys()].map(z=>(b+z).toString())},[c,d]),p=ue(a,{month:"long"}),w=l.useMemo(()=>[...Array(u.calendar.getMonthsInYear(u)).keys()].map(b=>p.format(u.set({month:b+1}).toDate(i))),[u,p,i]),m=ue(a,{weekday:"short"}),$=l.useMemo(()=>{const b=F.startOfWeek(F.today(i),a);return[...new Array(7).keys()].map(S=>{const E=b.add({days:S}).toDate(i);return m.format(E)})},[i,a,m]),k=ue(a,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),y=ue(a,{day:"numeric",calendar:u.calendar.identifier}),x=ue(a,{day:"2-digit",month:"2-digit",year:"numeric"}),I=b=>{if(typeof b=="number")return;const S=u.set({month:w.indexOf(b)+1});h(S)},j=b=>{if(typeof b=="number")return;const S=u.set({year:parseInt(b,10)});h(S)},R=Gi(f,a);return r.jsx(Vi,{dateFormatter:k,cellDateFormatter:y,textValueFormatter:x,children:r.jsxs(C,{ref:o,direction:"column",alignItems:"stretch",padding:4,...n,children:[r.jsxs(Ki,{justifyContent:"flex-start",paddingBottom:4,paddingLeft:2,paddingRight:2,gap:2,children:[r.jsx(Re,{children:r.jsx(vt,{"aria-label":e,value:w[u.month-1],onChange:I,children:w.map(b=>r.jsx(kt,{value:b,children:b},b))})}),r.jsx(Re,{children:r.jsx(vt,{value:u.year.toString(),"aria-label":t,onChange:j,children:g.map(b=>r.jsx(kt,{value:b,children:b},b))})})]}),r.jsxs("table",{role:"grid",children:[r.jsx("thead",{"aria-hidden":!0,children:r.jsx("tr",{"aria-rowindex":0,children:$.map((b,S)=>r.jsx(Yi,{"aria-colindex":S,children:b},b))})}),r.jsx("tbody",{children:[...new Array(6).keys()].map(b=>r.jsx("tr",{"aria-rowindex":b+2,children:R(b).map((S,z)=>S?r.jsx(Zi,{"aria-colindex":z+1,date:S,startDate:f,disabled:c.compare(S)>0||S.compare(d)>0},S.toString()):r.jsx(yn,{"aria-colindex":z+1},z+1))},b))})]})]})})}),Gi=(e,t)=>n=>{let o=e.add({weeks:n});const a=[];o=F.startOfWeek(o,t);const i=F.getDayOfWeek(o,t);for(let c=0;c<i;c++)a.push(null);for(;a.length<7;){a.push(o);const c=o.add({days:1});if(F.isSameDay(o,c))break;o=c}for(;a.length<7;)a.push(null);return a},Ki=s.styled(C)`
|
|
1675
1672
|
div[role='combobox'] {
|
|
1676
1673
|
border: 1px solid transparent;
|
|
1677
1674
|
background: transparent;
|
|
1678
|
-
font-weight: ${
|
|
1675
|
+
font-weight: ${e=>e.theme.fontWeights.bold};
|
|
1679
1676
|
|
|
1680
1677
|
svg {
|
|
1681
|
-
fill: ${({theme:
|
|
1678
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
1682
1679
|
}
|
|
1683
1680
|
|
|
1684
1681
|
&:hover {
|
|
1685
|
-
background-color: ${({theme:
|
|
1682
|
+
background-color: ${({theme:e})=>e.colors.neutral100};
|
|
1686
1683
|
}
|
|
1687
1684
|
}
|
|
1688
|
-
`,
|
|
1689
|
-
border-radius: ${({theme:
|
|
1685
|
+
`,Yi=l.forwardRef(({children:e,...t},n)=>r.jsx(Qi,{tag:"th",role:"gridcell",ref:n,...t,height:"2.4rem",width:"3.2rem",children:r.jsx(T,{variant:"pi",fontWeight:"bold",color:"neutral800",children:e.slice(0,2)})})),Qi=s.styled(v)`
|
|
1686
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1690
1687
|
text-transform: capitalize;
|
|
1691
|
-
`,
|
|
1688
|
+
`,Xi="DatePickerCalendarCell",Zi=l.forwardRef(({date:e,startDate:t,disabled:n,...o},a)=>{const{timeZone:i,calendarDate:c,onValueChange:d,onOpenChange:u,onTextValueChange:h,onCalendarDateChange:f}=Me(Xi),{dateFormatter:g,cellDateFormatter:p,textValueFormatter:w}=qi("DatePickerCalendarCell"),m=F.isSameDay(c,e),$=l.useMemo(()=>g.format(e.toDate(i)),[g,e,i]),k=l.useMemo(()=>p.formatToParts(e.toDate(i)).find(j=>j.type==="day").value,[p,e,i]),y=F.endOfMonth(t),x=e.compare(t)<0||e.compare(y)>0;let I="neutral900";return m?I="primary600":x&&(I="neutral600"),r.jsx(yn,{tag:"td",role:"gridcell",ref:a,"aria-selected":m,...o,hasRadius:!0,"aria-label":$,tabIndex:m?0:-1,background:m?"primary100":"neutral0",cursor:"pointer",onPointerDown:D.composeEventHandlers(o.onPointerDown,j=>{j.preventDefault(),f(e),d(e),h(w.format(e.toDate(i))),u(!1)}),"aria-disabled":n,children:r.jsx(T,{variant:"pi",textColor:I,children:k})})}),yn=s.styled(v)`
|
|
1692
1689
|
text-align: center;
|
|
1693
1690
|
padding: 0.7rem;
|
|
1694
1691
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
@@ -1700,37 +1697,28 @@ ${m.css`
|
|
|
1700
1697
|
|
|
1701
1698
|
&[aria-disabled='false'] {
|
|
1702
1699
|
&:hover {
|
|
1703
|
-
background: ${({theme:
|
|
1704
|
-
color: ${({theme:
|
|
1700
|
+
background: ${({theme:e})=>e.colors.primary100};
|
|
1701
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
1705
1702
|
}
|
|
1706
1703
|
}
|
|
1707
|
-
`,
|
|
1708
|
-
min-width: ${({onClear:
|
|
1709
|
-
`,
|
|
1704
|
+
`,je=e=>{const t=e.toISOString(),n=F.parseAbsolute(t,"UTC");return F.toCalendarDate(n)},wn=l.memo(Ii),pt=e=>!!e.match(/^[^a-zA-Z]*$/);function Ji(e=""){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const el=s.styled(on)`
|
|
1705
|
+
min-width: ${({onClear:e})=>e?"160px":"130px"};
|
|
1706
|
+
`,Cn=l.forwardRef(({step:e=15,value:t,defaultValue:n,onChange:o,...a},i)=>{const c=Xe("TimePicker"),[d,u]=l.useState(""),[h,f]=le({prop:t,defaultProp:n,onChange:o}),g=ue(c.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),p=l.useMemo(()=>{const j=g.formatToParts(new Date),{value:R}=j.find(b=>b.type==="literal");return R},[g]),w=l.useMemo(()=>{const j=60/e;return[...Array(24).keys()].flatMap(R=>[...Array(j).keys()].map(b=>g.format(new Date(0,0,0,R,b*e))))},[e,g]),m=j=>{(!j||pt(j))&&u(j)},$=j=>{const[R,b]=j.split(p);if(!R&&!b)return;const S=Number(R??"0"),z=Number(b??"0");if(!(S>23||z>59))return g.format(new Date(0,0,0,S,z))},k=j=>{const R=$(j.target.value);R?(u(R),f(R)):u(h)},y=j=>{if(typeof j<"u"){const R=$(j);f(R)}else f(j)};l.useEffect(()=>{const j=typeof t>"u"?"":t;pt(j)&&u(j)},[t,u]);const I=`\\d{2}${Ji(p)}\\d{2}`;return r.jsx(el,{...a,ref:i,value:h,onChange:y,isPrintableCharacter:pt,allowCustomValue:!0,placeholder:`--${p}--`,autocomplete:"none",startIcon:r.jsx(O.Clock,{fill:"neutral500"}),inputMode:"numeric",pattern:I,textValue:d,onTextValueChange:m,onBlur:k,children:w.map(j=>r.jsx(an,{value:j,children:j},j))})}),tl=l.forwardRef(({clearLabel:e="clear",dateLabel:t="Choose date",timeLabel:n="Choose time",disabled:o=!1,hasError:a,onChange:i,onClear:c,required:d=!1,step:u,value:h,initialDate:f,size:g,...p},w)=>{const m=l.useRef(null),[$,k]=l.useState(!1),y=h?Ee(h,!1):void 0,[x,I]=le({defaultProp:f?Ee(f,!1):void 0,prop:$?void 0:y,onChange(L){i&&i(L==null?void 0:L.toDate(F.getLocalTimeZone()))}}),j=Xe("DateTimePicker"),R=ue(j.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),b=x?R.format(x.toDate(F.getLocalTimeZone())):"",S=l.useRef(h);he(()=>{$&&x&&I(void 0)},[$,x,I]),he(()=>{const L=S.current;h==null&&L!=null&&x&&I(void 0),$&&h!==L&&k(!1),S.current=h},[h,x,$,I,k]),he(()=>{$&&x===void 0&&h==null&&k(!1)},[$,x,h,k]);const z=L=>{let M=L?Ee(L):void 0;if(b&&M){const[Z,G]=b.split(":");M=M.set({hour:parseInt(Z,10),minute:parseInt(G,10)})}I(M)},E=L=>{if(!L)return;const[M,Z]=L.split(":"),G=x?x.set({hour:parseInt(M,10),minute:parseInt(Z,10)}):Ee(new Date).set({hour:parseInt(M,10),minute:parseInt(Z,10)});I(G)},A=L=>{L.preventDefault(),k(!0),c&&c(L)},U=()=>{const L=x?x.set({hour:0,minute:0}):Ee(new Date);I(L)},B=te(m,w),{error:N,id:H,labelNode:P}=ne("DateTimePicker"),K=!!N||a;return r.jsxs(C,{"aria-labelledby":P?`${H}-label`:void 0,role:"group",flex:"1",gap:1,wrap:"wrap",children:[r.jsx(Re,{flex:"1",children:r.jsx(wn,{...p,hasError:K,size:g,value:x==null?void 0:x.toDate("UTC"),onChange:z,required:d,onClear:c?A:void 0,clearLabel:`${e} date`,disabled:o,ref:B,"aria-label":t})}),r.jsx(Re,{flex:"1",children:r.jsx(Cn,{size:g,hasError:K,value:b,onChange:E,onClear:c&&b!==void 0&&b!=="00:00"?U:void 0,clearLabel:`${e} time`,required:d,disabled:o,step:u,"aria-label":n})})]})}),Ee=(e,t=!0)=>{const n=e.toISOString();let o=F.parseAbsoluteToLocal(n);return t&&(o=o.set({hour:0,minute:0})),F.toCalendarDateTime(o)},_t=l.forwardRef((e,t)=>r.jsx(rl,{ref:t,background:"neutral150",...e,"data-orientation":"horizontal",role:"separator",tag:"div"})),rl=s.styled(v)`
|
|
1710
1707
|
height: 1px;
|
|
1711
1708
|
border: none;
|
|
1712
1709
|
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
1713
1710
|
flex-shrink: 0;
|
|
1714
|
-
`,
|
|
1711
|
+
`,nl=s.styled(v)`
|
|
1715
1712
|
svg {
|
|
1716
1713
|
height: 8.8rem;
|
|
1717
1714
|
}
|
|
1718
|
-
`,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
`,this;e--}else if(r instanceof te){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof te?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class $l{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new ai(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Tl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},ai.prototype[Symbol.iterator]=$l.prototype[Symbol.iterator]=Tl.prototype[Symbol.iterator]=function(){return this});class Df{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function Bt(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Ye(i,e,t=!0,n=!0){return Tf(i,e,t,n)}const Wn=/\r\n?|\n/;var Me=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Me||(Me={}));class Qe{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,t=!1){Hn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new Qe(e)}composeDesc(e){return this.empty?e:e.empty?this:Al(this,e)}mapDesc(e,t=!1){return e.empty?this:Vn(this,e,t)}mapPos(e,t=-1,n=Me.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(n!=Me.Simple&&c>=e&&(n==Me.TrackDel&&r<e&&c>e||n==Me.TrackBefore&&r<e||n==Me.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qe(e)}static create(e){return new Qe(e)}}class le extends Qe{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Hn(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return Vn(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(N.empty);n.push(o?e.slice(s,s+o):N.empty)}s+=o}return new le(t,n)}compose(e){return this.empty?e:e.empty?this:Al(this,e,!0)}map(e,t=!1){return e.empty?this:Vn(this,e,t,!0)}iterChanges(e,t=!1){Hn(this,e,t)}get desc(){return Qe.create(this.sections)}filter(e){let t=[],n=[],r=[],s=new fi(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,a-l);ge(r,h,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;ge(t,h,u),u>0&&st(n,t,s.text),s.forward(h),l+=h}let c=e[o++];for(;l<c;){if(s.done)break e;let h=Math.min(s.len,c-l);ge(t,h,-1),ge(r,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new le(t,n),filtered:Qe.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(h=!1){if(!h&&!r.length)return;o<t&&ge(r,t-o,-1);let u=new le(r,s);l=l?l.compose(u.map(l)):u,r=[],s=[],o=0}function c(h){if(Array.isArray(h))for(let u of h)c(u);else if(h instanceof le){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:u,to:f=u,insert:g}=h;if(u>f||u<0||f>t)throw new RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let p=g?typeof g=="string"?N.of(g.split(n||Wn)):g:N.empty,x=p.length;if(u==f&&x==0)return;u<o&&a(),u>o&&ge(r,u-o,-1),ge(r,f-u,x),st(s,r,p),o=f}}return c(e),a(!l),l}static empty(e){return new le(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<r;)n.push(N.empty);n[r]=N.of(s.slice(1)),t.push(s[0],n[r].length)}}}return new le(t,n)}static createSet(e,t){return new le(e,t)}}function ge(i,e,t,n=!1){if(e==0&&t<=0)return;let r=i.length-2;r>=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function st(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<n;)i.push(N.empty);i.push(t)}}function Hn(i,e,t){let n=i.inserted;for(let r=0,s=0,o=0;o<i.sections.length;){let l=i.sections[o++],a=i.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,h=s,u=N.empty;for(;c+=l,h+=a,a&&n&&(u=u.append(n[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,c,s,h,u),r=c,s=h}}}function Vn(i,e,t,n=!1){let r=[],s=n?[]:null,o=new fi(i),l=new fi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);ge(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let c=l.len;for(ge(r,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(ge(r,0,o.ins),s&&st(s,r,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let u=Math.min(h,l.len);c+=u,h-=u,l.forward(u)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;ge(r,c,a<o.i?o.ins:0),s&&a<o.i&&st(s,r,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return s?le.createSet(r,s):Qe.create(r);throw new Error("Mismatched change set lengths")}}}function Al(i,e,t=!1){let n=[],r=t?[]:null,s=new fi(i),o=new fi(e);for(let l=!1;;){if(s.done&&o.done)return r?le.createSet(n,r):Qe.create(n);if(s.ins==0)ge(n,s.len,0,l),s.next();else if(o.len==0&&!o.done)ge(n,0,o.ins,l),r&&st(r,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=n.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;ge(n,a,h,l),r&&h&&st(r,n,o.text)}else o.ins==-1?(ge(n,s.off?0:s.len,a,l),r&&st(r,n,s.textBit(a))):(ge(n,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&st(r,n,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||n.length>c),s.forward2(a),o.forward(a)}}}}class fi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?N.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?N.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class mt{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new mt(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return M.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return M.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return M.range(e.anchor,e.head)}static create(e,t,n){return new mt(e,t,n)}}class M{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:M.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new M([this.main],0)}addRange(e,t=!0){return M.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,M.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new M(e.ranges.map(t=>mt.fromJSON(t)),e.main)}static single(e,t=e){return new M([M.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return M.normalized(e.slice(),t);n=s.to}return new M(e,t)}static cursor(e,t=0,n,r){return mt.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let s=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?mt.create(t,e,48|s):mt.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?M.range(a,l):M.range(l,a))}}return new M(e,t)}}function Rl(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Er=0;class j{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Er++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new j(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Ir),!!e.static,e.enables)}of(e){return new Vi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function Ir(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class Vi{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Er++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?c=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||h.push(e[u.id]);return{create(u){return u.values[o]=n(u),1},update(u,f){if(a&&f.docChanged||c&&(f.docChanged||f.selection)||qn(u,h)){let g=n(u);if(l?!Ts(g,u.values[o],r):!r(g,u.values[o]))return u.values[o]=g,1}return 0},reconfigure:(u,f)=>{let g,p=f.config.address[s];if(p!=null){let x=Qi(f,p);if(this.dependencies.every(w=>w instanceof j?f.facet(w)===u.facet(w):w instanceof $t?f.field(w,!1)==u.field(w,!1):!0)||(l?Ts(g=n(u),x,r):r(g=n(u),x)))return u.values[o]=x,0}else g=n(u);return u.values[o]=g,1}}}}function Ts(i,e,t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!t(i[n],e[n]))return!1;return!0}function qn(i,e){let t=!1;for(let n of e)hi(i,n)&1&&(t=!0);return t}function Mf(i,e,t){let n=t.map(a=>i[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let c=[];for(let h=0;h<n.length;h++){let u=Qi(a,n[h]);if(r[h]==2)for(let f of u)c.push(f);else c.push(u)}return e.combine(c)}return{create(a){for(let c of n)hi(a,c);return a.values[o]=l(a),1},update(a,c){if(!qn(a,s))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=qn(a,n),u=c.config.facets[e.id],f=c.facet(e);if(u&&!h&&Ir(t,u))return a.values[o]=f,0;let g=l(a);return e.compare(g,f)?(a.values[o]=f,0):(a.values[o]=g,1)}}}const Oi=j.define({static:!0});class $t{constructor(e,t,n,r,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new $t(Er++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Oi).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Oi),o=r.facet(Oi),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Oi.of({field:this,create:e})]}get extension(){return this}}const gt={lowest:4,low:3,default:2,high:1,highest:0};function ei(i){return e=>new Dl(e,i)}const Of={highest:ei(gt.highest),high:ei(gt.high),default:ei(gt.default),low:ei(gt.low),lowest:ei(gt.lowest)};class Dl{constructor(e,t){this.inner=e,this.prec=t}}class gn{of(e){return new _n(this,e)}reconfigure(e){return gn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class _n{constructor(e,t){this.compartment=e,this.inner=t}}class Ji{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of jf(e,t,o))f instanceof $t?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],c=[];for(let f of r)l[f.id]=c.length<<1,c.push(g=>f.slot(g));let h=n==null?void 0:n.config.facets;for(let f in s){let g=s[f],p=g[0].facet,x=h&&h[f]||[];if(g.every(w=>w.type==0))if(l[p.id]=a.length<<1|1,Ir(x,g))a.push(n.facet(p));else{let w=p.combine(g.map(y=>y.value));a.push(n&&p.compare(w,n.facet(p))?n.facet(p):w)}else{for(let w of g)w.type==0?(l[w.id]=a.length<<1|1,a.push(w.value)):(l[w.id]=c.length<<1,c.push(y=>w.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(w=>Mf(w,p,g))}}let u=c.map(f=>f(l));return new Ji(e,o,u,l,a,s)}}function jf(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=n[a].indexOf(o);c>-1&&n[a].splice(c,1),o instanceof _n&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof _n){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,l)}else if(o instanceof Dl)s(o.inner,o.prec);else if(o instanceof $t)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Vi)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,gt.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(i,gt.default),n.reduce((o,l)=>o.concat(l))}function hi(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Qi(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Ml=j.define(),Kn=j.define({combine:i=>i.some(e=>e),static:!0}),Ol=j.define({combine:i=>i.length?i[0]:void 0,static:!0}),jl=j.define(),El=j.define(),Il=j.define(),Pl=j.define({combine:i=>i.length?i[0]:!1});class Yt{constructor(e,t){this.type=e,this.value=t}static define(){return new Ef}}class Ef{of(e){return new Yt(this,e)}}class If{constructor(e){this.map=e}of(e){return new se(this,e)}}class se{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new se(this.type,t)}is(e){return this.type==e}static define(e={}){return new If(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}se.reconfigure=se.define();se.appendConfig=se.define();class me{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Rl(n,t.newLength),s.some(l=>l.type==me.time)||(this.annotations=s.concat(me.time.of(Date.now())))}static create(e,t,n,r,s,o){return new me(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(me.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}me.time=Yt.define();me.userEvent=Yt.define();me.addToHistory=Yt.define();me.remote=Yt.define();function Pf(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n<i.length&&(r==e.length||e[r]>=i[n]))s=i[n++],o=i[n++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Ll(i,e,t){var n;let r,s,o;return t?(r=e.changes,s=le.empty(e.changes.length),o=i.changes.compose(e.changes)):(r=e.changes.map(i.changes),s=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(n=i.selection)===null||n===void 0?void 0:n.map(r),effects:se.mapEffects(i.effects,r).concat(se.mapEffects(e.effects,s)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function Un(i,e,t){let n=e.selection,r=Et(e.annotations);return e.userEvent&&(r=r.concat(me.userEvent.of(e.userEvent))),{changes:e.changes instanceof le?e.changes:le.of(e.changes||[],t,i.facet(Ol)),selection:n&&(n instanceof M?n:M.single(n.anchor,n.head)),effects:Et(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function Bl(i,e,t){let n=Un(i,e.length?e[0]:{},i.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;n=Ll(n,Un(i,e[s],o?n.changes.newLength:i.doc.length),o)}let r=me.create(i,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return Bf(t?Lf(r):r)}function Lf(i){let e=i.startState,t=!0;for(let r of e.facet(jl)){let s=r(i);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Pf(t,s))}if(t!==!0){let r,s;if(t===!1)s=i.changes.invertedDesc,r=le.empty(e.doc.length);else{let o=i.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}i=me.create(e,r,i.selection&&i.selection.map(s),se.mapEffects(i.effects,s),i.annotations,i.scrollIntoView)}let n=e.facet(El);for(let r=n.length-1;r>=0;r--){let s=n[r](i);s instanceof me?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof me?i=s[0]:i=Bl(e,Et(s),!1)}return i}function Bf(i){let e=i.startState,t=e.facet(Il),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Ll(n,Un(e,s,i.changes.newLength),!0))}return n==i?i:me.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const zf=[];function Et(i){return i==null?zf:Array.isArray(i)?i:[i]}var Xe=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(Xe||(Xe={}));const Nf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Gn;try{Gn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Ff(i){if(Gn)return Gn.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Nf.test(t)))return!0}return!1}function Wf(i){return e=>{if(!/\S/.test(e))return Xe.Space;if(Ff(e))return Xe.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return Xe.Word;return Xe.Other}}class Y{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)hi(this,l<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return hi(this,n),Qi(this,n)}update(...e){return Bl(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:r}=t;for(let l of e.effects)l.is(gn.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,c)=>r.set(c,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(se.reconfigure)?(t=null,n=l.value):l.is(se.appendConfig)&&(t=null,n=Et(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Ji.resolve(n,r,this),s=new Y(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Kn)?e.newSelection:e.newSelection.asSingle();new Y(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:M.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Et(n.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),c=this.changes(a.changes),h=c.map(r);for(let f=0;f<l;f++)s[f]=s[f].map(h);let u=r.mapDesc(c,!0);s.push(a.range.map(u)),r=r.compose(h),o=se.mapEffects(o,h).concat(se.mapEffects(Et(a.effects),u))}return{changes:r,selection:M.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof le?e:le.of(e,this.doc.length,this.facet(Y.lineSeparator))}toText(e){return N.of(e.split(this.facet(Y.lineSeparator)||Wn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(hi(this,t),Qi(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof $t&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return Y.create({doc:e.doc,selection:M.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Ji.resolve(e.extensions||[],new Map),n=e.doc instanceof N?e.doc:N.of((e.doc||"").split(t.staticFacet(Y.lineSeparator)||Wn)),r=e.selection?e.selection instanceof M?e.selection:M.single(e.selection.anchor,e.selection.head):M.single(0);return Rl(r,n.length),t.staticFacet(Kn)||(r=r.asSingle()),new Y(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Y.tabSize)}get lineBreak(){return this.facet(Y.lineSeparator)||`
|
|
1722
|
-
`}get readOnly(){return this.facet(Pl)}phrase(e,...t){for(let n of this.facet(Y.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(Ml))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return Wf(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Ye(t,o,!1);if(s(t.slice(a,o))!=Xe.Word)break;o=a}for(;l<r;){let a=Ye(t,l);if(s(t.slice(l,a))!=Xe.Word)break;l=a}return o==l?null:M.range(o+n,l+n)}}Y.allowMultipleSelections=Kn;Y.tabSize=j.define({combine:i=>i.length?i[0]:4});Y.lineSeparator=Ol;Y.readOnly=Pl;Y.phrases=j.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});Y.languageData=Ml;Y.changeFilter=jl;Y.transactionFilter=El;Y.transactionExtender=Il;gn.reconfigure=se.define();class zt{eq(e){return this==e}range(e,t=e){return gi.create(e,t,this)}}zt.prototype.startSide=zt.prototype.endSide=0;zt.prototype.point=!1;zt.prototype.mapMode=Me.TrackDel;class gi{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new gi(e,t,n)}}function Yn(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class Pr{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+e,u=this.to[a]+e,f,g;if(h==u){let p=t.mapPos(h,c.startSide,c.mapMode);if(p==null||(f=g=p,c.startSide!=c.endSide&&(g=t.mapPos(h,c.endSide),g<f)))continue}else if(f=t.mapPos(h,c.startSide),g=t.mapPos(u,c.endSide),f>g||f==g&&c.startSide>0&&c.endSide<=0)continue;(g-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,g-f)),n.push(c),r.push(f-o),s.push(g-o))}return{mapped:n.length?new Pr(r,s,n,l):null,pos:o}}}class X{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new X(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Yn)),this.isEmpty)return t.length?X.of(t):this;let l=new zl(this,null,-1).goto(0),a=0,c=[],h=new Zi;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let u=t[a++];h.addInner(u.from,u.to,u.value)||c.push(u)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(gi.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?X.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(l));else if(c===!0){let{mapped:h,pos:u}=a.map(l,e);h&&(r=Math.max(r,h.maxPoint),t.push(h),n.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new X(n,t,s||X.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pi.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),l=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=As(o,l,n),c=new ti(o,a,s),h=new ti(l,a,s);n.iterGaps((u,f,g)=>Rs(c,u,h,f,g,r)),n.empty&&n.length==0&&Rs(c,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=As(s,o),a=new ti(s,l,0).goto(n),c=new ti(o,l,0).goto(n);for(;;){if(a.to!=c.to||!Xn(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,n,r,s=-1){let o=new ti(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),u=o.pointFrom<t?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);r.point(l,c,o.point,h,u,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new Zi;for(let r of e instanceof gi?[e]:t?Hf(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return X.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=X.empty;r=r.nextLayer)t=new X(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}X.empty=new X([],[],null,-1);function Hf(i){if(i.length>1)for(let e=i[0],t=1;t<i.length;t++){let n=i[t];if(Yn(e,n)>0)return i.slice().sort(Yn);e=n}return i}X.empty.nextLayer=X.empty;class Zi{finishChunk(e){this.chunks.push(new Pr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Zi)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(X.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=X.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function As(i,e,t){let n=new Map;for(let s of i)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=n.get(s.chunk[o]);l!=null&&(t?t.mapPos(l):l)==s.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+s.chunk[o].length))&&r.add(s.chunk[o])}return r}class zl{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class pi{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new zl(o,t,n,s));return r.length==1?r[0]:new pi(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cn(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cn(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Cn(this.heap,0)}}}function Cn(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1<i.length&&r.compare(i[n+1])>=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class ti{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ji(this.active,e),ji(this.activeTo,e),ji(this.activeRank,e),this.minActive=Ds(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Ei(this.active,t,n),Ei(this.activeTo,t,r),Ei(this.activeRank,t,s),e&&Ei(e,t,this.cursor.from),this.minActive=Ds(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ji(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Rs(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e;for(;;){let c=i.to+a-t.to,h=c||i.endSide-t.endSide,u=h<0?i.to+a:t.to,f=Math.min(u,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Xn(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,f,i.point,t.point):f>l&&!Xn(i.active,t.active)&&s.compareRange(l,f,i.active,t.active),u>o)break;(c||i.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(u),l=u,h<=0&&i.next(),h>=0&&t.next()}}function Xn(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t]&&!i[t].eq(e[t]))return!1;return!0}function ji(i,e){for(let t=e,n=i.length-1;t<n;t++)i[t]=i[t+1];i.pop()}function Ei(i,e,t){for(let n=i.length-1;n>=e;n--)i[n+1]=i[n];i[e]=t}function Ds(i,e){let t=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||i[r].endSide-i[t].endSide)<0&&(t=r,n=e[r]);return t}function Vf(i,e,t,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=Ye(i,r)}return i.length}const Jn="ͼ",Ms=typeof Symbol>"u"?"__"+Jn:Symbol.for(Jn),Qn=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nt{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let h=[],u=/^@(\w+)\b/.exec(o[0]),f=u&&u[1]=="keyframes";if(u&&l==null)return a.push(o[0]+";");for(let g in l){let p=l[g];if(/&/.test(g))s(g.split(/,\s*/).map(x=>o.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),p,a);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),p,h,f)}else p!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+p+";")}(h.length||f)&&a.push((n&&!u&&!c?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
1723
|
-
|
|
1724
|
-
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ft={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Zn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};for(var ue=0;ue<10;ue++)Ft[48+ue]=Ft[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Ft[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Ft[ue]=String.fromCharCode(ue+32),Zn[ue]=String.fromCharCode(ue);for(var kn in Ft)Zn.hasOwnProperty(kn)||(Zn[kn]=Ft[kn]);function mi(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function er(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function qi(i,e){if(!e.anchorNode)return!1;try{return er(i,e.anchorNode)}catch{return!1}}function bi(i){return i.nodeType==3?St(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function ci(i,e,t,n){return t?Es(i,e,t,n,-1)||Es(i,e,t,n,1):!1}function vt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function en(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Es(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Ke(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=vt(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Ke(i):0}else return!1}}function Ke(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function pn(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function _f(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Nl(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Kf(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let h=i,u=!1;h&&!u;)if(h.nodeType==1){let f,g=h==a.body,p=1,x=1;if(g)f=_f(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let v=h.getBoundingClientRect();({scaleX:p,scaleY:x}=Nl(h,v)),f={left:v.left,right:v.left+h.clientWidth*p,top:v.top,bottom:v.top+h.clientHeight*x}}let w=0,y=0;if(r=="nearest")e.top<f.top?(y=e.top-(f.top+o),t>0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(y=e.bottom-f.bottom+o,t<0&&e.top-y<f.top&&(y=e.top-(f.top+o)));else{let v=e.bottom-e.top,k=f.bottom-f.top;y=(r=="center"&&v<=k?e.top+v/2-k/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-k+o)-f.top}if(n=="nearest"?e.left<f.left?(w=e.left-(f.left+s),t>0&&e.right>f.right+w&&(w=e.right-f.right+s)):e.right>f.right&&(w=e.right-f.right+s,t<0&&e.left<f.left+w&&(w=e.left-(f.left+s))):w=(n=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:n=="start"==l?e.left-s:e.right-(f.right-f.left)+s)-f.left,w||y)if(g)c.scrollBy(w,y);else{let v=0,k=0;if(y){let S=h.scrollTop;h.scrollTop+=y/x,k=(h.scrollTop-S)*x}if(w){let S=h.scrollLeft;h.scrollLeft+=w/p,v=(h.scrollLeft-S)*p}e={left:e.left-v,top:e.top-k,right:e.right-v,bottom:e.bottom-k},v&&Math.abs(v-w)<1&&(n="nearest"),k&&Math.abs(k-y)<1&&(r="nearest")}if(g)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Uf(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}class Gf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Ke(t):0),n,Math.min(e.focusOffset,n?Ke(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Dt=null;function Fl(i){if(i.setActive)return i.setActive();if(Dt)return i.focus(Dt);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Dt==null?{get preventScroll(){return Dt={preventScroll:!0},!0}}:void 0),!Dt){Dt=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],s=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let Is;function St(i,e,t=e){let n=Is||(Is=document.createRange());return n.setEnd(i,t),n.setStart(i,e),n}function It(i,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,i.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,i.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function Yf(i){for(;i;){if(i&&(i.nodeType==9||i.nodeType==11&&i.host))return i;i=i.assignedSlot||i.parentNode}return null}function Wl(i){for(;i.attributes.length;)i.removeAttributeNode(i.attributes[0])}function Xf(i,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,Ke(t));;)if(n){if(t.nodeType!=1)return!1;let r=t.childNodes[n-1];r.contentEditable=="false"?n--:(t=r,n=Ke(t))}else{if(t==i)return!0;n=vt(t),t=t.parentNode}}function Hl(i){return i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function Vl(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Ke(t)}else if(t.parentNode&&!en(t))n=vt(t),t=t.parentNode;else return null}}function ql(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!en(t))n=vt(t)+1,t=t.parentNode;else return null}}class pe{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new pe(e.parentNode,vt(e),t)}static after(e,t){return new pe(e.parentNode,vt(e)+1,t)}}const Lr=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,r=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=r?r.nextSibling:n.firstChild)){let l=q.get(s);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&s!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;s&&s!=o.dom;)s=Ps(s);else n.insertBefore(o.dom,s);r=o.dom}for(s=r?r.nextSibling:n.firstChild,s&&t&&t.node==n&&(t.written=!0);s;)s=Ps(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=Ke(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;r==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?r=-1:r=1),e=s}r<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!q.get(n);)n=n.nextSibling;if(!n)return this.length;for(let r=0,s=0;;r++){let o=this.children[r];if(o.dom==n)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=n,h=n;a<this.children.length;a++){let u=this.children[a],f=c+u.length;if(c<e&&f>t)return u.domBoundsAround(e,t,c);if(f>=e&&r==-1&&(r=a,s=c),c>t&&u.dom.parentNode==this.dom){o=a,l=h;break}h=f,c=f+u.breakAfter}return{from:s,to:l<0?n+this.length:l,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Lr){this.markDirty();for(let r=e;r<t;r++){let s=this.children[r];s.parent==this&&n.indexOf(s)<0&&s.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let r=0;r<n.length;r++)n[r].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new _l(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}q.prototype.breakAfter=0;function Ps(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class _l{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Kl(i,e,t,n,r,s,o,l,a){let{children:c}=i,h=c.length?c[e]:null,u=s.length?s[s.length-1]:null,f=u?u.breakAfter:o;if(!(e==n&&h&&!o&&!f&&s.length<2&&h.merge(t,r,s.length?u:null,t==0,l,a))){if(n<c.length){let g=c[n];g&&(r<g.length||g.breakAfter&&(u!=null&&u.breakAfter))?(e==n&&(g=g.split(r),r=0),!f&&u&&g.merge(0,r,u,!0,0,a)?s[s.length-1]=g:((r||g.children.length&&!g.children[0].length)&&g.merge(0,r,null,!1,0,a),s.push(g))):g!=null&&g.breakAfter&&(u?u.breakAfter=1:o=1),n++}for(h&&(h.breakAfter=o,t>0&&(!o&&s.length&&h.merge(t,h.length,s[0],!1,l,0)?h.breakAfter=s.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),a=s.length?0:l;else if(c[e].become(s[0]))e++,s.shift(),l=s.length?0:a;else break;!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,l,a)&&e--,(e<n||s.length)&&i.replaceChildren(e,n,s)}}function Ul(i,e,t,n,r,s){let o=i.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),u=e-t;for(let f of n)u+=f.length;i.length+=u,Kl(i,c,h,l,a,n,0,r,s)}let Oe=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},tr=typeof document<"u"?document:{documentElement:{style:{}}};const ir=/Edge\/(\d+)/.exec(Oe.userAgent),Gl=/MSIE \d/.test(Oe.userAgent),nr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Oe.userAgent),mn=!!(Gl||nr||ir),Ls=!mn&&/gecko\/(\d+)/i.test(Oe.userAgent),$n=!mn&&/Chrome\/(\d+)/.exec(Oe.userAgent),Jf="webkitFontSmoothing"in tr.documentElement.style,Yl=!mn&&/Apple Computer/.test(Oe.vendor),Bs=Yl&&(/Mobile\/\w+/.test(Oe.userAgent)||Oe.maxTouchPoints>2);var D={mac:Bs||/Mac/.test(Oe.platform),ie:mn,ie_version:Gl?tr.documentMode||6:nr?+nr[1]:ir?+ir[1]:0,gecko:Ls,gecko_version:Ls?+(/Firefox\/(\d+)/.exec(Oe.userAgent)||[0,0])[1]:0,chrome:!!$n,chrome_version:$n?+$n[1]:0,ios:Bs,android:/Android\b/.test(Oe.userAgent),safari:Yl,webkit_version:Jf?+(/\bAppleWebKit\/(\d+)/.exec(Oe.userAgent)||[0,0])[1]:0,tabSize:tr.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Qf=256;class Be extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof Be)||this.length-(t-e)+n.length>Qf||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Be(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new pe(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Zf(this.dom,e,t)}}class tt extends q{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Wl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof tt&&n.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(Ul(this,e,t,n?n.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,r=-1,s=0;for(let l of this.children){let a=n+l.length;a>e&&t.push(n<e?l.split(e-n):l),r<0&&n>=e&&(r=s),n=a,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new tt(this.mark,t,o)}domAtPos(e){return Xl(this,e)}coordsAt(e,t){return Ql(this,e,t)}}function Zf(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?D.chrome||D.gecko||(e?(r--,o=1):s<n&&(s++,o=-1)):t<0?r--:s<n&&s++;let l=St(i,r,s).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?pn(a,o<0):a||null}class bt extends q{static create(e,t,n){return new bt(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=bt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof bt)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof bt&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return N.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):N.empty}domAtPos(e){return(this.length?e==0:this.side>0)?pe.before(this.dom):pe.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?r.length-1:0;s=r[l],!(e>0?l==0:l==r.length-1||s.top<s.bottom);l+=o?-1:1);return pn(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Wt extends q{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Wt&&e.side==this.side}split(){return new Wt(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?pe.before(this.dom):pe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}Be.prototype.children=bt.prototype.children=Wt.prototype.children=Lr;function Xl(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;r<n.length;r++){let o=n[r],l=s+o.length;if(!(l==s&&o.getSide()<=0)){if(e>s&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=l}}for(let s=r;s>0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s<n.length;s++){let o=n[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new pe(t,0)}function Jl(i,e,t){let n,{children:r}=i;t>0&&e instanceof tt&&r.length&&(n=r[r.length-1])instanceof tt&&n.mark.eq(e.mark)?Jl(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function Ql(i,e,t){let n=null,r=-1,s=null,o=-1;function l(c,h){for(let u=0,f=0;u<c.children.length&&f<=h;u++){let g=c.children[u],p=f+g.length;p>=h&&(g.children.length?l(g,h-f):(!s||s.isHidden&&(t>0||tg(s,g)))&&(p>h||f==p&&g.getSide()>0)?(s=g,o=h-f):(f<h||f==p&&g.getSide()<0&&!g.isHidden)&&(n=g,r=h-f)),f=p}}l(i,e);let a=(t<0?n:s)||n||s;return a?a.coordsAt(Math.max(0,a==n?r:o),t):eg(i)}function eg(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=bi(e);return t[t.length-1]||null}function tg(i,e){let t=i.coordsAt(0,1),n=e.coordsAt(0,1);return t&&n&&n.top<t.bottom}function rr(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const zs=Object.create(null);function tn(i,e,t){if(i==e)return!0;i||(i=zs),e||(e=zs);let n=Object.keys(i),r=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function sr(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function ig(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let n=i.attributes[t];e[n.name]=n.value}return e}class Br{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var _e=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(_e||(_e={}));class we extends zt{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Ti(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new at(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Zl(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new at(e,n,r,t,e.widget||null,!0)}static line(e){return new Ai(e)}static set(e,t=!1){return X.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}we.none=X.empty;class Ti extends we{constructor(e){let{start:t,end:n}=Zl(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Ti&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&tn(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ti.prototype.point=!1;class Ai extends we{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ai&&this.spec.class==e.spec.class&&tn(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ai.prototype.mapMode=Me.TrackBefore;Ai.prototype.point=!0;class at extends we{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Me.TrackBefore:Me.TrackAfter:Me.TrackDel}get type(){return this.startSide!=this.endSide?_e.WidgetRange:this.startSide<=0?_e.WidgetBefore:_e.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof at&&ng(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}at.prototype.point=!0;function Zl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function ng(i,e){return i==e||!!(i&&e&&i.compare(e))}function _i(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class re extends q{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof re))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Ul(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new re;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)t.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){tn(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Jl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=rr(t,this.attrs||{})),n&&(this.attrs=rr({class:n},this.attrs||{}))}domAtPos(e){return Xl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Wl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(sr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&q.get(r)instanceof tt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=q.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!D.ios||!this.children.some(s=>s instanceof Be))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof Be)||/[^ -~]/.test(n.text))return null;let r=bi(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Ql(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight<s){let o=(s-r.textHeight)/2;return{top:n.top+o,bottom:n.bottom-o,left:n.left,right:n.left}}}return n}become(e){return e instanceof re&&this.children.length==0&&e.children.length==0&&tn(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,r=0;n<e.children.length;n++){let s=e.children[n],o=r+s.length;if(o>=t){if(s instanceof re)return s;if(o>t)break}r=o+s.breakAfter}return null}}class Ze extends q{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof Ze)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?pe.before(this.dom):pe.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new Ze(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Lr}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):N.empty}domBoundsAround(){return null}become(e){return e instanceof Ze&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof or?null:pn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}}class or extends Br{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class di{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ze&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new re),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ii(new Wt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ze)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Ii(new Be(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof at){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof at)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ze(n.widget||Ht.block,l,n));else{let a=bt.create(n.widget||Ht.inline,l,l?0:n.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e<t||n.startSide>0),h=!a.isEditable&&(e<t||s>r.length||n.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(u.append(Ii(new Wt(1),r),s),s=r.length+Math.max(0,s-r.length)),u.append(Ii(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?e<t||s>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new di(e,t,n,s);return o.openEnd=X.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ii(i,e){for(let t of e)i=new tt(t,[i],i.length);return i}class Ht extends Br{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ht.inline=new Ht("span");Ht.block=new Ht("div");var ye=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(ye||(ye={}));const Ct=ye.LTR,zr=ye.RTL;function ea(i){let e=[];for(let t=0;t<i.length;t++)e.push(1<<+i[t]);return e}const rg=ea("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),sg=ea("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),lr=Object.create(null),Fe=[];for(let i of["()","[]","{}"]){let e=i.charCodeAt(0),t=i.charCodeAt(1);lr[e]=t,lr[t]=-e}function ta(i){return i<=247?rg[i]:1424<=i&&i<=1524?2:1536<=i&&i<=1785?sg[i-1536]:1774<=i&&i<=2220?4:8192<=i&&i<=8204?256:64336<=i&&i<=65023?4:1}const og=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ot{get dir(){return this.level%2?zr:Ct}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.from<t:l.to>t:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function ia(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++){let n=i[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!ia(n.inner,r.inner))return!1}return!0}const V=[];function lg(i,e,t,n,r){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,l=s<n.length?n[s].from:t,a=s?256:r;for(let c=o,h=a,u=a;c<l;c++){let f=ta(i.charCodeAt(c));f==512?f=h:f==8&&u==4&&(f=16),V[c]=f==4?2:f,f&7&&(u=f),h=f}for(let c=o,h=a,u=a;c<l;c++){let f=V[c];if(f==128)c<l-1&&h==V[c+1]&&h&24?f=V[c]=h:V[c]=256;else if(f==64){let g=c+1;for(;g<l&&V[g]==64;)g++;let p=c&&h==8||g<t&&V[g]==8?u==1?1:8:256;for(let x=c;x<g;x++)V[x]=p;c=g-1}else f==8&&u==1&&(V[c]=1);h=f,f&7&&(u=f)}}}function ag(i,e,t,n,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=n.length;o++){let c=o?n[o-1].to:e,h=o<n.length?n[o].from:t;for(let u=c,f,g,p;u<h;u++)if(g=lr[f=i.charCodeAt(u)])if(g<0){for(let x=l-3;x>=0;x-=3)if(Fe[x+1]==-g){let w=Fe[x+2],y=w&2?r:w&4?w&1?s:r:0;y&&(V[u]=V[Fe[x]]=y),l=x;break}}else{if(Fe.length==189)break;Fe[l++]=u,Fe[l++]=f,Fe[l++]=a}else if((p=V[u])==2||p==1){let x=p==r;a=x?0:1;for(let w=l-3;w>=0;w-=3){let y=Fe[w+2];if(y&2)break;if(x)Fe[w+2]|=2;else{if(y&4)break;Fe[w+2]|=4}}}}}function hg(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=r<t.length?t[r].from:e;for(let a=o;a<l;){let c=V[a];if(c==256){let h=a+1;for(;;)if(h==l){if(r==t.length)break;h=t[r++].to,l=r<t.length?t[r].from:e}else if(V[h]==256)h++;else break;let u=s==1,f=(h<e?V[h]:n)==1,g=u==f?u?1:2:n;for(let p=h,x=r,w=x?t[x-1].to:i;p>a;)p==w&&(p=t[--x].from,w=x?t[x-1].to:i),V[--p]=g;a=h}else s=c,a++}}}function ar(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,c=0;a<t;){let h=!0,u=!1;if(c==s.length||a<s[c].from){let x=V[a];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(u)break e;let x=s[c];if(!h)for(let w=x.to,y=c+1;;){if(w==t)break e;if(y<s.length&&s[y].from==w)w=s[y++].to;else{if(V[w]==l)break e;break}}if(c++,f)f.push(x);else{x.from>a&&o.push(new ot(a,x.from,g));let w=x.direction==Ct!=!(g%2);hr(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.to}p=x.to}else{if(p==t||(h?V[p]!=l:V[p]==l))break;p++}f?ar(i,a,p,n+1,r,f,o):a<p&&o.push(new ot(a,p,g)),a=p}else for(let a=t,c=s.length;a>e;){let h=!0,u=!1;if(!c||a>s[c-1].to){let x=V[a-1];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(u)break e;let x=s[--c];if(!h)for(let w=x.from,y=c;;){if(w==e)break e;if(y&&s[y-1].to==w)w=s[--y].from;else{if(V[w-1]==l)break e;break}}if(f)f.push(x);else{x.to<a&&o.push(new ot(x.to,a,g));let w=x.direction==Ct!=!(g%2);hr(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.from}p=x.from}else{if(p==e||(h?V[p-1]!=l:V[p-1]==l))break;p--}f?ar(i,p,a,n+1,r,f,o):p<a&&o.push(new ot(p,a,g)),a=p}}function hr(i,e,t,n,r,s,o){let l=e%2?2:1;lg(i,r,s,n,l),ag(i,r,s,n,l),hg(r,s,n,l),ar(i,r,s,e,t,n,o)}function cg(i,e,t){if(!i)return[new ot(0,0,e==zr?1:0)];if(e==Ct&&!t.length&&!og.test(i))return na(i.length);if(t.length)for(;i.length>V.length;)V[V.length]=256;let n=[],r=e==Ct?0:1;return hr(i,r,r,t,0,i.length,n),n}function na(i){return[new ot(0,i,0)]}let ra="";function dg(i,e,t,n,r){var s;let o=n.head-i.from,l=ot.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],c=a.side(r,t);if(o==c){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,t),c=a.side(r,t)}let h=Ye(i.text,o,a.forward(r,t));(h<a.from||h>a.to)&&(h=c),ra=i.text.slice(Math.min(o,h),Math.max(o,h));let u=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return u&&h==c&&u.level+(r?0:1)<a.level?M.cursor(u.side(!r,t)+i.from,u.forward(r,t)?1:-1,u.level):M.cursor(h+i.from,a.forward(r,t)?-1:1,a.level)}function ug(i,e,t){for(let n=e;n<t;n++){let r=ta(i.charCodeAt(n));if(r==1)return Ct;if(r==2||r==4)return zr}return Ct}const sa=j.define(),oa=j.define(),la=j.define(),aa=j.define(),cr=j.define(),ha=j.define(),ca=j.define(),Nr=j.define(),Fr=j.define(),da=j.define({combine:i=>i.some(e=>e)}),fg=j.define({combine:i=>i.some(e=>e)}),ua=j.define();class Pt{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Pt(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Pt(M.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Pi=se.define({map:(i,e)=>i.map(e)}),fa=se.define();function Je(i,e,t){let n=i.facet(aa);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Ge=j.define({combine:i=>i.length?i[0]:!0});let gg=0;const Ot=j.define({combine(i){return i.filter((e,t)=>{for(let n=0;n<t;n++)if(i[n].plugin==e.plugin)return!1;return!0})}});class xi{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Ot.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ot.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new xi(gg++,e,n,r,l=>{let a=[];return o&&a.push(yi.of(c=>{let h=c.plugin(l);return h?o(h):we.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return xi.define((n,r)=>new e(n,r),t)}}class Tn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Je(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Je(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Je(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ga=j.define(),Wr=j.define(),yi=j.define(),pa=j.define(),Hr=j.define(),ma=j.define();function Ns(i,e){let t=i.state.facet(ma);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return X.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,h=o-e.from,u=r;for(let f=l.length-1;f>=0;f--,a--){let g=l[f].spec.bidiIsolate,p;if(g==null&&(g=ug(e.text,c,h)),a>0&&u.length&&(p=u[u.length-1]).to==c&&p.direction==g)p.to=h,u=p.inner;else{let x={from:c,to:h,direction:g,inner:[]};u.push(x),u=x.inner}}}}),r}const ba=j.define();function xa(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(ba)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const ni=j.define();class je{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new je(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let r=0,s=0,o=0,l=0;;r++){let a=r==e.length?null:e[r],c=o-l,h=a?a.fromB:1e9;for(;s<t.length&&t[s]<h;){let u=t[s],f=t[s+1],g=Math.max(l,u),p=Math.min(h,f);if(g<=p&&new je(g+c,p+c,g,p).addToSet(n),f>h)break;s+=2}if(!a)return n;new je(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}}class nn{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=le.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new je(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new nn(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Fs extends q{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=we.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new re],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new je(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!vg(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?mg(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;n=new je(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(D.ie||D.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=yg(o,l,e.changes);return n=je.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Ze&&o.widget instanceof or&&s.push(o.dom);r.updateGaps(s)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=r.length-1;;o--){let l=o>=0?r[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:u}=l,f,g,p,x;if(n&&n.range.fromB<u&&n.range.toB>h){let S=di.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),$=di.build(this.view.state.doc,n.range.toB,u,this.decorations,this.dynamicDecorationMap);g=S.breakAtStart,p=S.openStart,x=$.openEnd;let C=this.compositionView(n);$.breakAtStart?C.breakAfter=1:$.content.length&&C.merge(C.length,C.length,$.content[0],!1,$.openStart,0)&&(C.breakAfter=$.content[0].breakAfter,$.content.shift()),S.content.length&&C.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),f=S.content.concat(C).concat($.content)}else({content:f,breakAtStart:g,openStart:p,openEnd:x}=di.build(this.view.state.doc,h,u,this.decorations,this.dynamicDecorationMap));let{i:w,off:y}=s.findPos(c,1),{i:v,off:k}=s.findPos(a,-1);Kl(this,v,k,w,y,f,g,p,x)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(fa)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new Be(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new tt(r,[t],t.length);let n=new re;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(s);l&&l!=o&&(l.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&!(this.view.state.facet(Ge)||this.dom.tabIndex>-1)&&qi(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&pg(a)){let u=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(u,a.node.childNodes[a.offset]||null)),a=c=new pe(u,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!ci(a.node,a.offset,h.anchorNode,h.anchorOffset)||!ci(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&wg(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let u=mi(this.view.root);if(u)if(l.empty){if(D.gecko){let f=bg(a.node,a.offset);if(f&&f!=3){let g=(f==1?Vl:ql)(a.node,a.offset);g&&(a=new pe(g.node,g.offset))}}u.collapse(a.node,a.offset),l.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=l.bidiLevel)}else if(u.extend){u.collapse(a.node,a.offset);try{u.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),f.setEnd(c.node,c.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new pe(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new pe(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ci(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=mi(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=re.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r<t.childNodes.length;r++){let s=q.get(t.childNodes[r]);s instanceof re&&(n=s.domAtPos(0))}for(let r=e.offset-1;!n&&r>=0;r--){let s=q.get(t.childNodes[r]);s instanceof re&&(n=s.domAtPos(s.length))}return n?new pe(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=q.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let r=this.children[t];if(n<r.length||r instanceof re)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=s-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!n||l instanceof re&&!(n instanceof re&&t>=0)))n=l,r=c;else if(n&&c==e&&a==e&&l instanceof Ze&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}s=c}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof re))return null;for(;r.children.length;){let{i:l,off:a}=r.childPos(n,1);for(;;l++){if(l==r.children.length)return null;if((r=r.children[l]).length)break}n=a}if(!(r instanceof Be))return null;let s=Ye(r.text,n);if(s==n)return null;let o=St(r.dom,n,s).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==ye.LTR;for(let c=0,h=0;h<this.children.length;h++){let u=this.children[h],f=c+u.length;if(f>r)break;if(c>=n){let g=u.dom.getBoundingClientRect();if(t.push(g.height),o){let p=u.dom.lastChild,x=p?bi(p):[];if(x.length){let w=x[x.length-1],y=a?w.right-g.left:g.right-w.left;y>l&&(l=y,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?ye.RTL:ye.LTR}measureTextSize(){for(let s of this.children)if(s instanceof re){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=bi(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new _l(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(we.replace({widget:new or(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return we.set(e)}updateDeco(){let e=1,t=this.view.state.facet(yi).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(pa).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(X.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(ua))try{if(c(this.view,e.range,e))return!0}catch(h){Je(this.view.state,h,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=xa(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Kf(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==ye.LTR)}}function pg(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function ya(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=Vl(t.focusNode,t.focusOffset),r=ql(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=q.get(r.node);if(!l||l instanceof Be&&l.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let a=q.get(n.node);!a||a instanceof Be&&a.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function mg(i,e,t){let n=ya(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||i.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc,c=new je(a.mapPos(s),a.mapPos(o),s,o),h=[];for(let u=r.parentNode;;u=u.parentNode){let f=q.get(u);if(f instanceof tt)h.push({node:u,deco:f.mark});else{if(f instanceof re||u.nodeName=="DIV"&&u.parentNode==i.contentDOM)return{range:c,text:r,marks:h,line:u};if(u!=i.contentDOM)h.push({node:u,deco:new Ti({inclusive:!0,attributes:ig(u),tagName:u.tagName.toLowerCase()})});else return null}}}function bg(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e<i.childNodes.length&&i.childNodes[e].contentEditable=="false"?2:0)}let xg=class{constructor(){this.changes=[]}compareRange(e,t){_i(e,t,this.changes)}comparePoint(e,t){_i(e,t,this.changes)}boundChange(e){_i(e,e,this.changes)}};function yg(i,e,t){let n=new xg;return X.compare(i,e,t,n),n.changes}function wg(i,e){for(let t=i;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function vg(i,e){let t=!1;return e&&i.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}function Sg(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return M.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=Ye(r.text,s,!1):l=Ye(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let c=Ye(r.text,o,!1);if(n(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=Ye(r.text,l);if(n(r.text.slice(l,c))!=a)break;l=c}return M.range(o+r.from,l+r.from)}function Cg(i,e){return e.left>i?e.left-i:Math.max(0,i-e.right)}function kg(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function An(i,e){return i.top<e.bottom-1&&i.bottom>e.top+1}function Ws(i,e){return e<i.top?{top:e,left:i.left,right:i.right,bottom:i.bottom}:i}function Hs(i,e){return e>i.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function dr(i,e,t){let n,r,s,o,l=!1,a,c,h,u;for(let p=i.firstChild;p;p=p.nextSibling){let x=bi(p);for(let w=0;w<x.length;w++){let y=x[w];r&&An(r,y)&&(y=Ws(Hs(y,r.bottom),r.top));let v=Cg(e,y),k=kg(t,y);if(v==0&&k==0)return p.nodeType==3?Vs(p,e,t):dr(p,e,t);(!n||o>k||o==k&&s>v)&&(n=p,r=y,s=v,o=k,l=v?e<y.left?w>0:w<x.length-1:!0),v==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!u||u.top>y.top)&&(c=p,u=y):h&&An(h,y)?h=Hs(h,y.bottom):u&&An(u,y)&&(u=Ws(u,y.top))}}if(h&&h.bottom>=t?(n=a,r=h):u&&u.top<=t&&(n=c,r=u),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return Vs(n,f,t);if(l&&n.contentEditable!="false")return dr(n,f,t);let g=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:g}}function Vs(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let l=0;l<n;l++){let a=St(i,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let u=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&u<s){let f=e>=(h.left+h.right)/2,g=f;if((D.chrome||D.gecko)&&St(i,l).getBoundingClientRect().left==h.right&&(g=!f),u<=0)return{node:i,offset:l+(g?1:0)};r=l+(g?1:0),s=u}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function wa(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:c}=i.viewState,{x:h,y:u}=e,f=u-l;if(f<0)return 0;if(f>c)return i.state.doc.length;for(let S=i.viewState.heightOracle.textHeight/2,$=!1;a=i.elementAtHeight(f),a.type!=_e.Text;)for(;f=n>0?a.bottom+S:a.top-S,!(f>=0&&f<=c);){if($)return t?null:0;$=!0,n=-n}u=l+f;let g=a.from;if(g<i.viewport.from)return i.viewport.from==0?0:t?null:qs(i,o,a,h,u);if(g>i.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:qs(i,o,a,h,u);let p=i.dom.ownerDocument,x=i.root.elementFromPoint?i.root:p,w=x.elementFromPoint(h,u);w&&!i.contentDOM.contains(w)&&(w=null),w||(h=Math.max(o.left+1,Math.min(o.right-1,h)),w=x.elementFromPoint(h,u),w&&!i.contentDOM.contains(w)&&(w=null));let y,v=-1;if(w&&((r=i.docView.nearest(w))===null||r===void 0?void 0:r.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(h,u);S&&({offsetNode:y,offset:v}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(h,u);S&&({startContainer:y,startOffset:v}=S,(!i.contentDOM.contains(y)||D.safari&&$g(y,v,h)||D.chrome&&Tg(y,v,h))&&(y=void 0))}y&&(v=Math.min(Ke(y),v))}if(!y||!i.docView.dom.contains(y)){let S=re.find(i.docView,g);if(!S)return f>a.top+a.height/2?a.to:a.from;({node:y,offset:v}=dr(S.dom,h,u))}let k=i.docView.nearest(y);if(!k)return null;if(k.isWidget&&((s=k.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=k.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?k.posAtStart:k.posAtEnd}else return k.localPosFromDOM(y,v)+k.posAtStart}function qs(i,e,t,n,r){let s=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Vf(o,s,i.state.tabSize)}function $g(i,e,t){let n,r=i;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(;;){let s=r.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=r.parentNode;if(!o||o.nodeName=="DIV")break;r=o}}return St(i,n-1,n).getBoundingClientRect().right>t}function Tg(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():St(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Ag(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==_e.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function Rg(i,e,t,n){let r=Ag(i,e.head,e.assoc||-1),s=!n||r.type!=_e.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==ye.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return M.cursor(a,t?-1:1)}return M.cursor(t?r.to:r.from,t?-1:1)}function _s(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let c=dg(r,s,o,l,t),h=ra;if(!c){if(r.number==(t?i.state.doc.lines:1))return l;h=`
|
|
1725
|
-
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),c=i.visualLineSide(r,!t)}if(a){if(!a(h))return l}else{if(!n)return c;a=n(h)}l=c}}function Dg(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==Xe.Space&&(r=o),r==o}}function Mg(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return M.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),c=i.coordsAtPos(r,e.assoc||-1),h=i.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let g=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+h}let u=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let p=l+(f+g)*s,x=wa(i,{x:u,y:p},!1,s);if(p<a.top||p>a.bottom||(s<0?x<r:x>r)){let w=i.docView.coordsForChar(x),y=!w||p<w.top?-1:1;return M.cursor(x,y,void 0,o)}}}function Ki(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||t||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function Rn(i,e,t){let n=Ki(i.state.facet(Hr).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:M.cursor(n,n<t.from?1:-1)}const ri="";class Og{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Y.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ri}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let l=q.get(r),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:en(r))||en(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(jg(e,n.node,n.offset)?t:0))}}function jg(i,e,t){for(;;){if(!e||t<Ke(e))return!1;if(e==i)return!0;t=vt(e)+1,e=e.parentNode}}class Ks{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Eg{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=s||o?[]:Lg(e),a=new Og(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Bg(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!er(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!er(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((D.ios||D.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let u=Math.min(a,c),f=Math.max(a,c),g=h.from-u,p=h.to-f;(g==0||g==1||u==0)&&(p==0||p==-1||f==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=M.single(c,a)}}}function va(i,e){let t,{newSel:n}=e,r=i.state.selection.main,s=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,c=null;(s===8||D.android&&e.text.length<l-o)&&(a=r.to,c="end");let h=Pg(i.state.doc.sliceString(o,l,ri),e.text,a-o,c);h&&(D.chrome&&s==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==ri+ri&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:N.of(e.text.slice(h.from,h.toB).split(ri))})}else n&&(!i.hasFocus&&i.state.facet(Ge)||n.main.eq(r))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!r.empty&&n&&n.main.empty?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,r.to)}:(D.mac||D.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=M.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:N.of([t.insert.toString().replace("."," ")])}):t&&t.from>=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:D.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==`
|
|
1726
|
-
`&&i.lineWrapping&&(n&&(n=M.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:N.of([" "])}),t)return Vr(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Vr(i,e,t,n=-1){if(D.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(D.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&It(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&It(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&It(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Ig(i,e,t));return i.state.facet(ha).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Ig(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",a=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,u=t&&ya(i,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to,g=s.to-s.from;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:a||p.map(l)};let x=p.to-f,w=x-c.length;if(p.to-p.from!=g||i.state.sliceDoc(w,x)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=r.changes({from:w,to:x,insert:e.insert}),v=p.to-s.to;return{changes:y,range:a?M.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(y)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function Pg(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function Lg(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new Ks(t,n)),(r!=t||s!=n)&&e.push(new Ks(r,s))),e}function Bg(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?M.single(t+e,n+e):null}class zg{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,D.safari&&e.contentDOM.addEventListener("input",()=>null),D.gecko&&tp(e.contentDOM.ownerDocument)}handleEvent(e){!Ug(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Ng(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Wg.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return D.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Sa.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||Fg.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,It(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Us(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Je(t.state,r)}}}function Ng(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(Us(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(Us(n.value,a))}}for(let n in ze)t(n).handlers.push(ze[n]);for(let n in Ee)t(n).observers.push(Ee[n]);return e}const Sa=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Fg="dthko",Wg=[16,17,18,20,91,92,224,225],Li=6;function Bi(i){return Math.max(0,i)*.7+8}function Hg(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class Vg{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Uf(e.contentDOM),this.atoms=e.state.facet(Hr).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Y.allowMultipleSelections)&&qg(e,t),this.dragging=Kg(e,t)&&$a(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Hg(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=xa(this.view);e.clientX-a.left<=r+Li?t=-Bi(r-e.clientX):e.clientX+a.right>=o-Li&&(t=Bi(e.clientX-o)),e.clientY-a.top<=s+Li?n=-Bi(s-e.clientY):e.clientY+a.bottom>=l-Li&&(n=Bi(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=Ki(this.atoms,r.from,0);o!=r.from&&(s=M.cursor(o,-1))}else{let o=Ki(this.atoms,r.from,-1),l=Ki(this.atoms,r.to,1);(o!=r.from||l!=r.to)&&(s=M.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?M.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function qg(i,e){let t=i.state.facet(sa);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function _g(i,e){let t=i.state.facet(oa);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function Kg(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=mi(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Ug(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=q.get(t))&&n.ignoreEvent(e))return!1;return!0}const ze=Object.create(null),Ee=Object.create(null),Ca=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Gg(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),ka(i,t.value)},50)}function bn(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function ka(i,e){e=bn(i.state,Nr,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(ur!=null&&t.selection.ranges.every(a=>a.empty)&&ur==s.toString()){let a=-1;n=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let u=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:u},range:M.cursor(c.from+u.length)}})}else o?n=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:M.cursor(a.from+c.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};ze.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Ee.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};ze.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(la))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Jg(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Vg(i,e,t,n)),n&&i.observer.ignore(()=>{Fl(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Gs(i,e,t,n){if(n==1)return M.cursor(e,t);if(n==2)return Sg(i.state,e,t);{let r=re.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<i.state.doc.length&&l==s.to&&l++,M.range(o,l)}}let Ys=(i,e,t)=>e>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function Yg(i,e,t,n){let r=re.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Ys(t,n,o))return-1;let l=r.coordsAt(s,1);return l&&Ys(t,n,l)?1:o&&o.bottom>=n?-1:1}function Xs(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Yg(i,t,e.clientX,e.clientY)}}const Xg=D.ie&&D.ie_version<=11;let Js=null,Qs=0,Zs=0;function $a(i){if(!Xg)return i.detail;let e=Js,t=Zs;return Js=i,Zs=Date.now(),Qs=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Qs+1)%3:1}function Jg(i,e){let t=Xs(i,e),n=$a(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=Xs(i,s),c,h=Gs(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let u=Gs(i,t.pos,t.bias,n),f=Math.min(u.from,h.from),g=Math.max(u.to,h.to);h=f<h.from?M.range(f,g):M.range(g,f)}return o?r.replaceRange(r.main.extend(h.from,h.to)):l&&n==1&&r.ranges.length>1&&(c=Qg(r,a.pos))?c:l?r.addRange(h):M.create([h])}}}function Qg(i,e){for(let t=0;t<i.ranges.length;t++){let{from:n,to:r}=i.ranges[t];if(n<=e&&r>=e)return M.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}ze.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=M.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",bn(i.state,Fr,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ze.dragend=i=>(i.inputState.draggedContent=null,!1);function eo(i,e,t,n){if(t=bn(i.state,Nr,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&_g(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}ze.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&eo(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return eo(i,e,n,!0),!0}return!1};ze.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Ca?null:e.clipboardData;return t?(ka(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Gg(i),!1)};function Zg(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ep(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:bn(i,Fr,e.join(i.lineBreak)),ranges:t,linewise:n}}let ur=null;ze.copy=ze.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=ep(i.state);if(!t&&!r)return!1;ur=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=Ca?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(Zg(i,t),!1)};const Ta=Yt.define();function Aa(i,e){let t=[];for(let n of i.facet(ca)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:Ta.of(!0)}):null}function Ra(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Aa(i.state,e);t?i.dispatch(t):i.update([])}},10)}Ee.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),Ra(i)};Ee.blur=i=>{i.observer.clearSelectionRange(),Ra(i)};Ee.compositionstart=Ee.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Ee.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,D.chrome&&D.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Ee.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};ze.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),c=i.posAtDOM(l.endContainer,l.endOffset);return Vr(i,{from:a,to:c,insert:i.state.toText(s)},null),!0}}let r;if(D.chrome&&D.android&&(r=Sa.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return D.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),D.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Ee.compositionend(i,e),20),!1};const to=new Set;function tp(i){to.has(i)||(to.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const io=["pre-wrap","normal","pre-line","break-spaces"];let Vt=!1;function no(){Vt=!1}class ip{constructor(e){this.lineWrapping=e,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return io.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,s,o){let l=io.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class np{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Ve{constructor(e,t,n,r,s){this.from=e,this.length=t,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?_e.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof at?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Ve(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var G=function(i){return i[i.ByPos=0]="ByPos",i[i.ByHeight=1]="ByHeight",i[i.ByPosNoHeight=2]="ByPosNoHeight",i}(G||(G={}));const Ui=.001;class ve{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ui&&(Vt=!0),this.height=e)}replace(e,t,n){return ve.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:u}=r[l],f=s.lineAt(a,G.ByPosNoHeight,n.setDoc(t),0,0),g=f.to>=c?f:s.lineAt(c,G.ByPosNoHeight,n,0,0);for(u+=g.to-c,c=g.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,h=r[l-1].fromB,l--,a<f.from&&(f=s.lineAt(a,G.ByPosNoHeight,n,0,0));h+=f.from-a,a=f.from;let p=qr.build(n.setDoc(o),e,h,u);s=rn(s,s.replace(a,c,p))}return s.updateHeight(n,0)}static empty(){return new De(0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,r=0,s=0;for(;;)if(t==n)if(r>s*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[t++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new rp(ve.of(e.slice(0,t)),o,ve.of(e.slice(n)))}}function rn(i,e){return i==e?i:(i.constructor!=e.constructor&&(Vt=!0),e)}ve.prototype.size=1;class Da extends ve{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new Ve(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,s){return this.blockAt(0,n,r,s)}forEachLine(e,t,n,r,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class De extends Da{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new Ve(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof De||r instanceof de&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof de?r=new De(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):ve.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class de extends ve{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),h=t.doc.lineAt(c),u=l+h.length*a,f=Math.max(n,e-u/2);return new Ve(h.from,h.length,f,u,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-n)/l))),{from:h,length:u}=t.doc.line(s+c);return new Ve(h,u,n+l*c,l,0)}}lineAt(e,t,n,r,s){if(t==G.ByHeight)return this.blockAt(e,n,r,s);if(t==G.ByPosNoHeight){let{from:g,to:p}=n.doc.lineAt(e);return new Ve(g,p-g,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(n,s),c=n.doc.lineAt(e),h=l+c.length*a,u=c.number-o,f=r+l*u+a*(c.from-s-u);return new Ve(c.from,c.length,Math.max(r,Math.min(f,r+this.height-h)),h,0)}forEachLine(e,t,n,r,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(n,s);for(let h=e,u=r;h<=t;){let f=n.doc.lineAt(h);if(h==e){let p=f.number-l;u+=a*p+c*(e-s-p)}let g=a+c*f.length;o(new Ve(f.from,f.length,u,g,0)),u+=g,h=f.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let s=n[n.length-1];s instanceof de?n[n.length-1]=new de(s.length+r):n.push(null,new de(r-1))}if(e>0){let s=n[0];s instanceof de?n[0]=new de(e+s.length):n.unshift(new de(e-1),null)}return ve.of(n)}decomposeLeft(e,t){t.push(new de(e-1),null)}decomposeRight(e,t){t.push(null,new de(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new de(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let u=r.heights[r.index++];a==-1?a=u:Math.abs(u-a)>=Ui&&(a=-2);let f=new De(h,u);f.outdated=!1,o.push(f),l+=h+1}l<=s&&o.push(null,new de(s-l).updateHeight(e,l));let c=ve.of(o);return(a<0||Math.abs(c.height-this.height)>=Ui||Math.abs(a-this.heightMetrics(e,t).perLine)>=Ui)&&(Vt=!0),rn(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class rp extends ve{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,n,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=t==G.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,n,r,s):this.right.lineAt(e,t,n,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,r,s).join(c)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,s,o),t>=a&&this.right.forEachLine(e,t,n,l,a,o);else{let c=this.lineAt(a,G.ByPos,n,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&ro(s,o-1),t<this.length){let l=s.length;this.decomposeRight(t,s),ro(s,l)}return ve.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ve.of(this.break?[e,null,t]:[e,t]):(this.left=rn(this.left,e),this.right=rn(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ro(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof de&&(n=i[e+1])instanceof de&&i.splice(e-1,3,new de(t.length+1+n.length))}const sp=5;class qr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof De?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new De(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new Da(o,r,n)):(o||s||r>=sp)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new De(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new de(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof De)return e;let t=new De(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof De)&&!this.isCovered?this.nodes.push(new De(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof De&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let s=new qr(n,e);return X.spans(t,n,r,s,0),s.finish(n)}}function op(i,e,t){let n=new lp;return X.compare(i,e,t,n,0),n.changes}class lp{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&_i(e,t,this.changes,5)}}function ap(i,e){let t=i.getBoundingClientRect(),n=i.ownerDocument,r=n.defaultView||window,s=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(r.innerHeight,t.bottom);for(let c=i.parentNode;c&&c!=n.body;)if(c.nodeType==1){let h=c,u=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&u.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(c==i.parentNode?r.innerHeight:a,f.bottom)}c=u.position=="absolute"||u.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function hp(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function cp(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Dn{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return we.replace({widget:new dp(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class dp extends Br{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class so{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=oo,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ye.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Wr).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new ip(t),this.stateDeco=e.facet(yi).filter(n=>typeof n!="function"),this.heightMap=ve.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(e.doc),[new je(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=we.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new zi(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?oo:new _r(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(si(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(yi).filter(h=>typeof h!="function");let r=e.changedRanges,s=je.extendWithRanges(r,op(n,this.stateDeco,e?e.changes:le.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);no(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Vt)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(fg)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?ye.RTL:ye.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:S,scaleY:$}=Nl(t,l);(S>.005&&Math.abs(this.scaleX-S)>.005||$>.005&&Math.abs(this.scaleY-$)>.005)&&(this.scaleX=S,this.scaleY=$,c|=16,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=f)&&(this.paddingTop=u,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=Hl(e.scrollDOM);let p=(this.printing?cp:ap)(t,this.paddingTop),x=p.top-this.pixelViewport.top,w=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!hp(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let S=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:$,charWidth:C,textHeight:R}=e.docView.measureTextSize();o=$>0&&r.refresh(s,$,C,R,Math.max(5,v/C),S),o&&(e.docView.minWidth=0,c|=16)}x>0&&w>0?h=Math.max(x,w):x<0&&w<0&&(h=Math.min(x,w)),no();for(let $ of this.viewports){let C=$.from==this.viewport.from?S:e.docView.measureVisibleLineHeights($);this.heightMap=(o?ve.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new je(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new np($.from,C))}Vt&&(c|=2)}let k=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new zi(r.lineAt(o-n*1e3,G.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,G.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=r.lineAt(c,G.ByPos,s,0,0),f;t.y=="center"?f=(u.top+u.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?f=u.top:f=u.bottom-h,a=new zi(r.lineAt(f-1e3/2,G.ByHeight,s,0,0).from,r.lineAt(f+h+1e3/2,G.ByHeight,s,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new zi(this.heightMap.lineAt(n,G.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,G.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Dn(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=ye.LTR&&!n)return[];let l=[],a=(h,u,f,g)=>{if(u-h<s)return;let p=this.state.selection.main,x=[p.from];p.empty||x.push(p.to);for(let y of x)if(y>h&&y<u){a(h,y-10,f,g),a(y+10,u,f,g);return}let w=fp(e,y=>y.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)<s&&Math.abs(y.to-u)<s&&!x.some(v=>y.from<v&&y.to>v));if(!w){if(u<f.to&&t&&n&&t.visibleRanges.some(k=>k.from<=u&&k.to>=u)){let k=t.moveToLineBoundary(M.cursor(u),!1,!0).head;k>h&&(u=k)}let y=this.gapSize(f,h,u,g),v=n||y<2e6?y:2e6;w=new Dn(h,u,y,v)}l.push(w)},c=h=>{if(h.length<o||h.type!=_e.Text)return;let u=up(h.from,h.to,this.stateDeco);if(u.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,g,p;if(n){let x=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,y;if(f!=null){let v=Fi(u,f),k=((this.visibleBottom-this.visibleTop)/2+x)/h.height;w=v-k,y=v+k}else w=(this.visibleTop-h.top-x)/h.height,y=(this.visibleBottom-h.top+x)/h.height;g=Ni(u,w),p=Ni(u,y)}else{let x=u.total*this.heightOracle.charWidth,w=r*this.heightOracle.charWidth,y=0;if(x>2e6)for(let C of e)C.from>=h.from&&C.from<h.to&&C.size!=C.displaySize&&C.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=C.size-C.displaySize);let v=this.pixelViewport.left+y,k=this.pixelViewport.right+y,S,$;if(f!=null){let C=Fi(u,f),R=((k-v)/2+w)/x;S=C-R,$=C+R}else S=(v-w)/x,$=(k+w)/x;g=Ni(u,S),p=Ni(u,$)}g>h.from&&a(h.from,g,h,u),p<h.to&&a(p,h.to,h,u)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,n,r){let s=Fi(r,n)-Fi(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Dn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=we.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];X.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let o=this.visibleRanges[s],l=n[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||si(this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||si(this.heightMap.lineAt(this.scaler.fromDOM(e),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return si(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class zi{constructor(e,t){this.from=e,this.to=t}}function up(i,e,t){let n=[],r=i,s=0;return X.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function Ni({total:i,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Fi(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function fp(i,e){for(let t of i)if(e(t))return t}const oo={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};class _r{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let c=t.lineAt(l,G.ByPos,e,0,0).top,h=t.lineAt(a,G.ByPos,e,0,0).bottom;return r+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof _r?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function si(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Ve(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>si(r,e)):i._content)}const Wi=j.define({combine:i=>i.join(" ")}),fr=j.define({combine:i=>i.indexOf(!0)>-1}),gr=Nt.newName(),Ma=Nt.newName(),Oa=Nt.newName(),ja={"&light":"."+Ma,"&dark":"."+Oa};function pr(i,e,t){return new Nt(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const gp=pr("."+gr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ja),pp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Mn=D.ie&&D.ie_version<=11;class mp{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Gf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&D.android&&e.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new xp(e),e.state.facet(Ge)&&(e.contentDOM.editContext=this.editContext.editContext)),Mn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ge)?n.root.activeElement!=this.dom:!qi(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!n.state.selection.main.empty&&r.focusNode&&ci(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=mi(e.root);if(!t)return!1;let n=D.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&bp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=qi(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Xf(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,pp),Mn&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Mn&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&It(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&qi(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Eg(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=va(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=lo(t,e.previousSibling||e.target.previousSibling,-1),r=lo(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ge)!=e.state.facet(Ge)&&(e.view.contentDOM.editContext=e.state.facet(Ge)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function lo(i,e,t){for(;e;){let n=q.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function ao(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return ci(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function bp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return ao(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?ao(i,t):null}class xp{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let c={from:l,to:a,insert:N.of(n.text.split(`
|
|
1727
|
-
`))};if(c.from==this.from&&s<this.from?c.from=s:c.to==this.to&&s>this.to&&(c.to=s),c.from==c.to&&!c.insert.length){let h=M.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(r)||e.dispatch({selection:h,userEvent:"select"});return}if((D.mac||D.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:N.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let h=this.to-this.from+(c.to-c.from+c.insert.length);Vr(e,c,M.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;r.push(we.mark({attributes:{style:h}}).range(a,c))}}}e.dispatch({effects:fa.of(we.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=mi(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(n)return;let h=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class W{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Yf(e.parent)||document,this.viewState=new so(e.state||Y.create(e)),e.scrollTo&&e.scrollTo.is(Pi)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ot).map(r=>new Tn(r));for(let r of this.plugins)r.update(this);this.observer=new mp(this),this.inputState=new zg(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof me?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(Ta))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Aa(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Y.phrases)!=this.state.facet(Y.phrases))return this.setState(s);r=nn.create(this,s,e),r.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(u&&(u=u.map(f.changes)),f.scrollIntoView){let{main:g}=f.state.selection;u=new Pt(g.empty?g:M.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of f.effects)g.is(Pi)&&(u=g.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=sn.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ni)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Wi)!=r.state.facet(Wi)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(cr))try{f(r)}catch(g){Je(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!va(this,h)&&c.force&&It(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new so(e),this.plugins=e.facet(Ot).map(n=>new Tn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Fs(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ot),n=e.state.facet(Ot);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new Tn(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(n){Je(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Hl(n))s=-1,o=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,o=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(p){return Je(this.state,p),ho}}),u=nn.create(this,this.state,[]),f=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u),f&&this.docViewUpdate());for(let g=0;g<c.length;g++)if(h[g]!=ho)try{let p=c[g];p.write&&p.write(h[g],this)}catch(p){Je(this.state,p)}if(f&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){r=r+p,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(cr))l(t)}get themeClasses(){return gr+" "+(this.state.facet(fr)?Oa:Ma)+" "+this.state.facet(Wi)}updateAttrs(){let e=co(this,ga,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ge)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),co(this,Wr,t);let n=this.observer.ignore(()=>{let r=sr(this.contentDOM,this.contentAttrs,t),s=sr(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(W.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ni);let e=this.state.facet(W.cspNonce);Nt.mount(this.root,this.styleModules.concat(gp).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Rn(this,e,_s(this,e,t,n))}moveByGroup(e,t){return Rn(this,e,_s(this,e,t,n=>Dg(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return M.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Rg(this,e,t,n)}moveVertically(e,t,n){return Rn(this,e,Mg(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),wa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ot.find(s,e-r.from,-1,t)];return pn(n,o.dir==ye.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(da)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yp)return na(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ia(s.isolates,n=Ns(this,e))))return s.order;n||(n=Ns(this,e));let r=cg(e.text,t,n);return this.bidiCache.push(new sn(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Fl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Pi.of(new Pt(typeof e=="number"?M.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Pi.of(new Pt(M.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return xi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return xi.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Nt.newName(),r=[Wi.of(n),ni.of(pr(`.${n}`,e))];return t&&t.dark&&r.push(fr.of(!0)),r}static baseTheme(e){return Of.lowest(ni.of(pr("."+gr,e,ja)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&q.get(n)||q.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}W.styleModule=ni;W.inputHandler=ha;W.clipboardInputFilter=Nr;W.clipboardOutputFilter=Fr;W.scrollHandler=ua;W.focusChangeEffect=ca;W.perLineTextDirection=da;W.exceptionSink=aa;W.updateListener=cr;W.editable=Ge;W.mouseSelectionStyle=la;W.dragMovesSelection=oa;W.clickAddsSelectionRange=sa;W.decorations=yi;W.outerDecorations=pa;W.atomicRanges=Hr;W.bidiIsolatedRanges=ma;W.scrollMargins=ba;W.darkTheme=fr;W.cspNonce=j.define({combine:i=>i.length?i[0]:""});W.contentAttributes=Wr;W.editorAttributes=ga;W.lineWrapping=W.contentAttributes.of({class:"cm-lineWrapping"});W.announce=se.define();const yp=4096,ho={};class sn{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:ye.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&n.push(new sn(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function co(i,e,t){for(let n=i.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&rr(o,t)}return t}class qt extends zt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qt.prototype.elementClass="";qt.prototype.toDOM=void 0;qt.prototype.mapMode=Me.TrackBefore;qt.prototype.startSide=qt.prototype.endSide=-1;qt.prototype.point=!0;const Ea=se.define(),Ia=se.define(),wp=we.mark({attributes:{style:"background-color: yellow; color: black"}}),vp=$t.define({create(){return we.none},update(i,e){return i=i.map(e.changes),e.effects.forEach(t=>{t.is(Ea)?i=i.update({add:t.value,sort:!0}):t.is(Ia)&&(i=i.update({filter:t.value}))}),i},provide:i=>W.decorations.from(i)}),Sp=b.forwardRef(({hasError:i,required:e,id:t,value:n="",disabled:r=!1,onChange:s=()=>null,...o},l)=>{const a=b.useRef(),c=b.useRef(),h=b.useRef(),{error:u,...f}=$e("JsonInput"),g=!!u||i,p=f.id??t,x=f.required||e;let w;u?w=`${p}-error`:f.hint&&(w=`${p}-hint`);const y=I=>{var ne,_;const P=(ne=c.current)==null?void 0:ne.doc;if(P){const{text:K,to:Q}=P.line(I),F=Q-K.trimStart().length;Q>F&&((_=h.current)==null||_.dispatch({effects:Ea.of([wp.range(F,Q)])}))}},v=()=>{var P,ne;const I=(P=c.current)==null?void 0:P.doc;if(I){const _=I.length||0;(ne=h.current)==null||ne.dispatch({effects:Ia.of((K,Q)=>Q<=0||K>=_)})}},k=({state:I,view:P})=>{h.current=P,c.current=I,v();const _=Zr.jsonParseLinter()(P);_.length&&y(I.doc.lineAt(_[0].from).number)},S=(I,P)=>{k(P),s(I)},$=(I,P)=>{h.current=I,c.current=P,k({view:I,state:P})},{setContainer:C,view:R}=xh.useCodeMirror({value:n,onCreateEditor:$,container:a.current,editable:!r,extensions:[Zr.json(),vp],onChange:S,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),L=Ce(a,C);return b.useImperativeHandle(l,()=>({...R==null?void 0:R.dom,focus(){R&&R.focus()},scrollIntoView(I){R&&R.dom.scrollIntoView(I)}}),[R]),d.jsx(Cp,{ref:L,$disabled:r,$hasError:g,alignItems:"stretch",hasRadius:!0,"aria-required":x,id:p,"aria-describedby":w,...o})}),Cp=m.styled(T)`
|
|
1728
|
-
font-size: ${({theme:i})=>i.fontSizes[3]};
|
|
1729
|
-
line-height: ${({theme:i})=>i.lineHeights[6]};
|
|
1730
|
-
|
|
1731
|
-
${({theme:i})=>i.breakpoints.medium} {
|
|
1732
|
-
font-size: ${({theme:i})=>i.fontSizes[2]};
|
|
1733
|
-
line-height: ${({theme:i})=>i.lineHeights[2]};
|
|
1715
|
+
`,ol=l.forwardRef(({icon:e,content:t,action:n,hasRadius:o=!0,shadow:a="tableShadow"},i)=>r.jsxs(C,{ref:i,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:o,shadow:a,children:[e?r.jsx(nl,{paddingBottom:6,"aria-hidden":!0,children:e}):null,r.jsx(v,{paddingBottom:4,children:r.jsx(T,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:t})}),n]})),jn=Rt.StateEffect.define(),vn=Rt.StateEffect.define(),al=bt.Decoration.mark({attributes:{style:"background-color: yellow; color: black"}}),sl=Rt.StateField.define({create(){return bt.Decoration.none},update(e,t){return e=e.map(t.changes),t.effects.forEach(n=>{n.is(jn)?e=e.update({add:n.value,sort:!0}):n.is(vn)&&(e=e.update({filter:n.value}))}),e},provide:e=>bt.EditorView.decorations.from(e)}),il=l.forwardRef(({hasError:e,required:t,id:n,value:o="",disabled:a=!1,onChange:i=()=>null,...c},d)=>{const u=l.useRef(),h=l.useRef(),f=l.useRef(),{error:g,...p}=ne("JsonInput"),w=!!g||e,m=p.id??n,$=p.required||t;let k;g?k=`${m}-error`:p.hint&&(k=`${m}-hint`);const y=E=>{var U,B;const A=(U=h.current)==null?void 0:U.doc;if(A){const{text:N,to:H}=A.line(E),P=H-N.trimStart().length;H>P&&((B=f.current)==null||B.dispatch({effects:jn.of([al.range(P,H)])}))}},x=()=>{var A,U;const E=(A=h.current)==null?void 0:A.doc;if(E){const B=E.length||0;(U=f.current)==null||U.dispatch({effects:vn.of((N,H)=>H<=0||N>=B)})}},I=({state:E,view:A})=>{f.current=A,h.current=E,x();const B=Xt.jsonParseLinter()(A);B.length&&y(E.doc.lineAt(B[0].from).number)},j=(E,A)=>{I(A),i(E)},R=(E,A)=>{f.current=E,h.current=A,I({view:E,state:A})},{setContainer:b,view:S}=uo.useCodeMirror({value:o,onCreateEditor:R,container:u.current,editable:!a,extensions:[Xt.json(),sl],onChange:j,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),z=te(u,b);return l.useImperativeHandle(d,()=>({...S==null?void 0:S.dom,focus(){S&&S.focus()},scrollIntoView(E){S&&S.dom.scrollIntoView(E)}}),[S]),r.jsx(ll,{ref:z,$disabled:a,$hasError:w,alignItems:"stretch",hasRadius:!0,"aria-required":$,id:m,"aria-describedby":k,...c})}),ll=s.styled(C)`
|
|
1716
|
+
font-size: ${({theme:e})=>e.fontSizes[3]};
|
|
1717
|
+
line-height: ${({theme:e})=>e.lineHeights[6]};
|
|
1718
|
+
|
|
1719
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1720
|
+
font-size: ${({theme:e})=>e.fontSizes[2]};
|
|
1721
|
+
line-height: ${({theme:e})=>e.lineHeights[2]};
|
|
1734
1722
|
}
|
|
1735
1723
|
.cm-editor {
|
|
1736
1724
|
/**
|
|
@@ -1740,18 +1728,18 @@ ${m.css`
|
|
|
1740
1728
|
background-color: #32324d;
|
|
1741
1729
|
width: 100%;
|
|
1742
1730
|
outline: none;
|
|
1743
|
-
cursor: ${({$disabled:
|
|
1731
|
+
cursor: ${({$disabled:e})=>e?"not-allowed":"text"};
|
|
1744
1732
|
}
|
|
1745
1733
|
|
|
1746
1734
|
.cm-scroller {
|
|
1747
|
-
border: 1px solid ${({theme:
|
|
1735
|
+
border: 1px solid ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.neutral200};
|
|
1748
1736
|
/* inputFocusStyle will receive hasError prop */
|
|
1749
|
-
${
|
|
1737
|
+
${be()}
|
|
1750
1738
|
}
|
|
1751
1739
|
|
|
1752
1740
|
.cm-editor,
|
|
1753
1741
|
.cm-scroller {
|
|
1754
|
-
border-radius: ${({theme:
|
|
1742
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1755
1743
|
}
|
|
1756
1744
|
|
|
1757
1745
|
.cm-gutters,
|
|
@@ -1762,34 +1750,34 @@ ${m.css`
|
|
|
1762
1750
|
*/
|
|
1763
1751
|
background-color: #4a4a6a;
|
|
1764
1752
|
}
|
|
1765
|
-
`,
|
|
1753
|
+
`,cl=ae(({disabled:e,...t},n)=>r.jsx(rt,{ref:n,tag:Pe,tabIndex:e?-1:void 0,disabled:e,...t})),dl=s.styled(v)`
|
|
1766
1754
|
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
1767
1755
|
&:focus-visible {
|
|
1768
1756
|
outline: none;
|
|
1769
1757
|
}
|
|
1770
|
-
`,
|
|
1758
|
+
`,ul=({labelledBy:e="main-content-title",...t})=>r.jsx(dl,{"aria-labelledby":e,tag:"main",id:"main-content",tabIndex:-1,...t}),hl=s.styled(v)`
|
|
1771
1759
|
text-decoration: none;
|
|
1772
1760
|
|
|
1773
1761
|
&:focus {
|
|
1774
|
-
left: ${({theme:
|
|
1775
|
-
top: ${({theme:
|
|
1762
|
+
left: ${({theme:e})=>e.spaces[3]};
|
|
1763
|
+
top: ${({theme:e})=>e.spaces[3]};
|
|
1776
1764
|
}
|
|
1777
|
-
`,
|
|
1778
|
-
background: ${
|
|
1765
|
+
`,fl=({children:e})=>r.jsx(hl,{tag:"a",href:"#main-content",background:"primary600",color:"neutral0",left:"-100%",padding:3,position:"absolute",top:"-100%",hasRadius:!0,zIndex:9999,children:e}),gl=Te.Root,pl=l.forwardRef((e,t)=>r.jsx(Te.Trigger,{...e,asChild:!0,ref:t})),ml=l.forwardRef((e,t)=>r.jsx(Te.Portal,{children:r.jsx(bl,{children:r.jsx(xl,{ref:t,...e})})})),bl=s.styled(Te.Overlay)`
|
|
1766
|
+
background: ${e=>Wt(e.theme.colors.neutral800,.2)};
|
|
1779
1767
|
position: fixed;
|
|
1780
1768
|
inset: 0;
|
|
1781
|
-
z-index: ${
|
|
1769
|
+
z-index: ${e=>e.theme.zIndices.overlay};
|
|
1782
1770
|
will-change: opacity;
|
|
1783
1771
|
|
|
1784
1772
|
@media (prefers-reduced-motion: no-preference) {
|
|
1785
|
-
animation: ${
|
|
1786
|
-
${
|
|
1773
|
+
animation: ${q.overlayFadeIn} ${e=>e.theme.motion.timings[200]}
|
|
1774
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
1787
1775
|
}
|
|
1788
|
-
`,
|
|
1776
|
+
`,xl=s.styled(Te.Content)`
|
|
1789
1777
|
max-width: 83rem;
|
|
1790
1778
|
max-height: 90vh;
|
|
1791
1779
|
height: auto;
|
|
1792
|
-
width: calc(100% - ${({theme:
|
|
1780
|
+
width: calc(100% - ${({theme:e})=>e.spaces[8]});
|
|
1793
1781
|
overflow: hidden;
|
|
1794
1782
|
margin: 0 auto;
|
|
1795
1783
|
display: flex;
|
|
@@ -1800,13 +1788,13 @@ ${m.css`
|
|
|
1800
1788
|
left: 50%;
|
|
1801
1789
|
transform: translate(-50%, -50%);
|
|
1802
1790
|
|
|
1803
|
-
border-radius: ${
|
|
1804
|
-
background-color: ${
|
|
1805
|
-
box-shadow: ${
|
|
1806
|
-
z-index: ${
|
|
1791
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
1792
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
1793
|
+
box-shadow: ${e=>e.theme.shadows.popupShadow};
|
|
1794
|
+
z-index: ${e=>e.theme.zIndices.modal};
|
|
1807
1795
|
|
|
1808
|
-
${({theme:
|
|
1809
|
-
width: calc(100% - ${({theme:
|
|
1796
|
+
${({theme:e})=>e.breakpoints.medium} {
|
|
1797
|
+
width: calc(100% - ${({theme:e})=>e.spaces[9]});
|
|
1810
1798
|
}
|
|
1811
1799
|
> form {
|
|
1812
1800
|
display: flex;
|
|
@@ -1815,24 +1803,24 @@ ${m.css`
|
|
|
1815
1803
|
}
|
|
1816
1804
|
@media (prefers-reduced-motion: no-preference) {
|
|
1817
1805
|
&[data-state='open'] {
|
|
1818
|
-
animation-duration: ${
|
|
1819
|
-
animation-timing-function: ${
|
|
1820
|
-
animation-name: ${
|
|
1806
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1807
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1808
|
+
animation-name: ${q.modalPopIn};
|
|
1821
1809
|
}
|
|
1822
1810
|
|
|
1823
1811
|
&[data-state='closed'] {
|
|
1824
|
-
animation-duration: ${
|
|
1825
|
-
animation-timing-function: ${
|
|
1826
|
-
animation-name: ${
|
|
1812
|
+
animation-duration: ${e=>e.theme.motion.timings[120]};
|
|
1813
|
+
animation-timing-function: ${e=>e.theme.motion.easings.easeOutQuad};
|
|
1814
|
+
animation-name: ${q.modalPopOut};
|
|
1827
1815
|
}
|
|
1828
1816
|
}
|
|
1829
|
-
`,
|
|
1830
|
-
border-bottom: solid 1px ${
|
|
1831
|
-
`,
|
|
1832
|
-
padding-inline: ${
|
|
1817
|
+
`,kn=l.forwardRef((e,t)=>r.jsx(Te.Close,{...e,asChild:!0,ref:t})),$l=l.forwardRef(({children:e,closeLabel:t="Close modal",...n},o)=>r.jsxs(yl,{ref:o,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...n,tag:"header",children:[e,r.jsx(kn,{children:r.jsx(ge,{withTooltip:!1,label:t,children:r.jsx(O.Cross,{})})})]})),yl=s.styled(C)`
|
|
1818
|
+
border-bottom: solid 1px ${e=>e.theme.colors.neutral150};
|
|
1819
|
+
`,wl=l.forwardRef((e,t)=>r.jsx(Te.Title,{asChild:!0,children:r.jsx(T,{tag:"h2",variant:"omega",fontWeight:"bold",ref:t,...e})})),Cl=l.forwardRef(({children:e,...t},n)=>r.jsx(jl,{ref:n,...t,children:e})),jl=s.styled(Qe)`
|
|
1820
|
+
padding-inline: ${e=>e.theme.spaces[7]};
|
|
1833
1821
|
|
|
1834
1822
|
& > div {
|
|
1835
|
-
padding-block: ${
|
|
1823
|
+
padding-block: ${e=>e.theme.spaces[8]};
|
|
1836
1824
|
/* Add negative margin and padding to avoid cropping the box shadow when the inputs are focused */
|
|
1837
1825
|
margin: 0 -2px 0 -2px;
|
|
1838
1826
|
padding-left: 2px;
|
|
@@ -1843,137 +1831,137 @@ ${m.css`
|
|
|
1843
1831
|
display: block !important;
|
|
1844
1832
|
}
|
|
1845
1833
|
}
|
|
1846
|
-
`,
|
|
1847
|
-
border-top: solid 1px ${
|
|
1834
|
+
`,vl=l.forwardRef((e,t)=>r.jsx(kl,{ref:t,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...e,tag:"footer"})),kl=s.styled(C)`
|
|
1835
|
+
border-top: solid 1px ${e=>e.theme.colors.neutral150};
|
|
1848
1836
|
flex: 1;
|
|
1849
|
-
`,
|
|
1837
|
+
`,Sl=Object.freeze(Object.defineProperty({__proto__:null,Body:Cl,Close:kn,Content:ml,Footer:vl,Header:$l,Root:gl,Title:wl,Trigger:pl},Symbol.toStringTag,{value:"Module"})),Rl="",Tl=l.forwardRef(({startAction:e,locale:t,onValueChange:n,value:o,step:a=1,disabled:i=!1,...c},d)=>{const u=Xe("NumberInput"),h=t||u.locale,f=l.useRef(new Zt.NumberParser(h,{style:"decimal"})),g=l.useRef(new Zt.NumberFormatter(h,{maximumFractionDigits:20})),[p,w]=Il({prop(b){const S=String(o);return isNaN(Number(S))||S!==b&&b!==""?b:g.current.format(Number(o))},defaultProp:Rl,onChange(b){if(!n)return;const S=f.current.parse(b??"");n(isNaN(S)?void 0:S)}}),m=b=>{w(String(b))},$=({target:{value:b}})=>{f.current.isValidPartialNumber(b)&&m(b)},y=(b=>{const S=b.toString();return S.includes(".")?S.split(".")[1].length:0})(a),x=()=>{if(!p){m(a);return}const b=f.current.parse(p),S=isNaN(b)?a:b+a,z=parseFloat(S.toFixed(y));m(g.current.format(z))},I=()=>{if(!p){m(-a);return}const b=f.current.parse(p),S=isNaN(b)?-a:b-a,z=parseFloat(S.toFixed(y));m(g.current.format(z))},j=b=>{if(!i)switch(b.key){case W.DOWN:{b.preventDefault(),I();break}case W.UP:{b.preventDefault(),x();break}}},R=()=>{if(p){const b=f.current.parse(p),S=isNaN(b)?"":g.current.format(b);m(S)}};return r.jsx(ut,{ref:d,startAction:e,disabled:i,type:"text",inputMode:"decimal",onChange:$,onKeyDown:j,onBlur:R,value:p,endAction:r.jsxs(C,{direction:"column",children:[r.jsx(pr,{disabled:i,"aria-hidden":!0,$reverse:!0,onClick:x,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:r.jsx(O.CaretDown,{fill:"neutral500"})}),r.jsx(pr,{disabled:i,"aria-hidden":!0,onClick:I,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:r.jsx(O.CaretDown,{fill:"neutral500"})})]}),...c})}),pr=s.styled.button`
|
|
1850
1838
|
display: flex;
|
|
1851
1839
|
justify-content: center;
|
|
1852
1840
|
align-items: center;
|
|
1853
|
-
transform: translateY(${({$reverse:
|
|
1854
|
-
cursor: ${({disabled:
|
|
1841
|
+
transform: translateY(${({$reverse:e})=>e?"-2px":"2px"});
|
|
1842
|
+
cursor: ${({disabled:e})=>e?"not-allowed":void 0};
|
|
1855
1843
|
height: 1.1rem;
|
|
1856
1844
|
|
|
1857
1845
|
svg {
|
|
1858
1846
|
width: 1.2rem;
|
|
1859
|
-
transform: ${({$reverse:
|
|
1847
|
+
transform: ${({$reverse:e})=>e?"rotateX(180deg)":void 0};
|
|
1860
1848
|
}
|
|
1861
|
-
`;function
|
|
1862
|
-
padding: ${({theme:
|
|
1863
|
-
border-radius: ${({theme:
|
|
1864
|
-
box-shadow: ${({$active:
|
|
1849
|
+
`;function Il({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=Et({defaultProp:t,onChange:n}),i=e!==void 0,c=e instanceof Function?e(o):e,d=i?c:o,u=D.useCallbackRef(n),h=l.useCallback(f=>{if(i){const p=typeof f=="function"?f(c):f;p!==c&&(u(p),a(f))}else a(f)},[i,c,a,u]);return[d,h]}const Sn=l.createContext({activePage:1,pageCount:1}),Vt=()=>l.useContext(Sn),Dl=({children:e,label:t="Pagination",activePage:n,pageCount:o})=>{const a=l.useMemo(()=>({activePage:n,pageCount:o}),[n,o]);return r.jsx(Sn.Provider,{value:a,children:r.jsx(v,{"aria-label":t,tag:"nav",children:r.jsx(C,{tag:"ol",gap:1,children:l.Children.map(e,(i,c)=>r.jsx("li",{children:i},c))})})})},El=ae(({children:e,...t},n)=>{const{activePage:o}=Vt(),a=o===1;return r.jsxs(Tn,{ref:n,"aria-disabled":a,tabIndex:a?-1:void 0,...t,children:[r.jsx(me,{children:e}),r.jsx(O.ChevronLeft,{"aria-hidden":!0})]})}),Al=ae(({children:e,...t},n)=>{const{activePage:o,pageCount:a}=Vt(),i=o===a;return r.jsxs(Tn,{ref:n,"aria-disabled":i,tabIndex:i?-1:void 0,...t,children:[r.jsx(me,{children:e}),r.jsx(O.ChevronRight,{"aria-hidden":!0})]})}),Rn=s.styled(Pe)`
|
|
1850
|
+
padding: ${({theme:e})=>e.spaces[3]};
|
|
1851
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1852
|
+
box-shadow: ${({$active:e,theme:t})=>e?t.shadows.filterShadow:void 0};
|
|
1865
1853
|
text-decoration: none;
|
|
1866
1854
|
display: flex;
|
|
1867
1855
|
|
|
1868
|
-
${
|
|
1869
|
-
`,
|
|
1856
|
+
${st}
|
|
1857
|
+
`,Tn=s.styled(Rn)`
|
|
1870
1858
|
font-size: 1.1rem;
|
|
1871
1859
|
|
|
1872
1860
|
svg path {
|
|
1873
|
-
fill: ${
|
|
1861
|
+
fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
|
|
1874
1862
|
}
|
|
1875
1863
|
|
|
1876
1864
|
&:focus,
|
|
1877
1865
|
&:hover {
|
|
1878
1866
|
svg path {
|
|
1879
|
-
fill: ${
|
|
1867
|
+
fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral700};
|
|
1880
1868
|
}
|
|
1881
1869
|
}
|
|
1882
1870
|
|
|
1883
|
-
${
|
|
1871
|
+
${e=>e["aria-disabled"]?`
|
|
1884
1872
|
pointer-events: none;
|
|
1885
1873
|
`:void 0}
|
|
1886
|
-
`,
|
|
1887
|
-
color: ${({theme:
|
|
1888
|
-
background: ${({theme:
|
|
1874
|
+
`,zl=ae(({number:e,children:t,...n},o)=>{const{activePage:a}=Vt(),i=a===e;return r.jsxs(Ll,{ref:o,...n,"aria-current":i,$active:i,children:[r.jsx(me,{children:t}),r.jsx(T,{"aria-hidden":!0,fontWeight:i?"bold":void 0,lineHeight:"revert",variant:"pi",children:e})]})}),Ll=s.styled(Rn)`
|
|
1875
|
+
color: ${({theme:e,$active:t})=>t?e.colors.primary700:e.colors.neutral800};
|
|
1876
|
+
background: ${({theme:e,$active:t})=>t?e.colors.neutral0:void 0};
|
|
1889
1877
|
|
|
1890
1878
|
&:hover {
|
|
1891
|
-
box-shadow: ${({theme:
|
|
1879
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
1892
1880
|
}
|
|
1893
|
-
`,
|
|
1894
|
-
box-shadow: ${({theme:
|
|
1895
|
-
z-index: ${({theme:
|
|
1896
|
-
background-color: ${
|
|
1897
|
-
border: 1px solid ${({theme:
|
|
1898
|
-
border-radius: ${({theme:
|
|
1881
|
+
`,Ol=({children:e,...t})=>r.jsxs(v,{...t,children:[r.jsx(me,{children:e}),r.jsx(T,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]}),Pl=Le.Root,Ml=Le.Anchor,Bl=Le.Arrow,Nl=l.forwardRef((e,t)=>r.jsx(Le.Trigger,{...e,asChild:!0,ref:t})),Wl=l.forwardRef((e,t)=>r.jsx(Le.Portal,{children:r.jsx(Fl,{sideOffset:4,side:"bottom",align:"start",...e,ref:t})})),Fl=s.styled(Le.Content)`
|
|
1882
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
1883
|
+
z-index: ${({theme:e})=>e.zIndices.popover};
|
|
1884
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
1885
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
1886
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1899
1887
|
|
|
1900
1888
|
@media (prefers-reduced-motion: no-preference) {
|
|
1901
|
-
animation-duration: ${
|
|
1889
|
+
animation-duration: ${e=>e.theme.motion.timings[200]};
|
|
1902
1890
|
|
|
1903
1891
|
&[data-state='open'] {
|
|
1904
|
-
animation-timing-function: ${
|
|
1892
|
+
animation-timing-function: ${e=>e.theme.motion.easings.authenticMotion};
|
|
1905
1893
|
|
|
1906
1894
|
&[data-side='top'] {
|
|
1907
|
-
animation-name: ${
|
|
1895
|
+
animation-name: ${q.slideUpIn};
|
|
1908
1896
|
}
|
|
1909
1897
|
|
|
1910
1898
|
&[data-side='bottom'] {
|
|
1911
|
-
animation-name: ${
|
|
1899
|
+
animation-name: ${q.slideDownIn};
|
|
1912
1900
|
}
|
|
1913
1901
|
}
|
|
1914
1902
|
|
|
1915
1903
|
&[data-state='closed'] {
|
|
1916
|
-
animation-timing-function: ${
|
|
1904
|
+
animation-timing-function: ${e=>e.theme.motion.easings.easeOutQuad};
|
|
1917
1905
|
|
|
1918
1906
|
&[data-side='top'] {
|
|
1919
|
-
animation-name: ${
|
|
1907
|
+
animation-name: ${q.slideUpOut};
|
|
1920
1908
|
}
|
|
1921
1909
|
|
|
1922
1910
|
&[data-side='bottom'] {
|
|
1923
|
-
animation-name: ${
|
|
1911
|
+
animation-name: ${q.slideDownOut};
|
|
1924
1912
|
}
|
|
1925
1913
|
}
|
|
1926
1914
|
}
|
|
1927
|
-
`,
|
|
1915
|
+
`,Hl=l.forwardRef(({children:e,intersectionId:t,onReachEnd:n,...o},a)=>{const i=l.useRef(null),c=te(i,a),d=re();return Ge(i,n??(()=>{}),{selectorToWatch:`#${ze(d)}`,skipWhen:!t||!n}),r.jsxs(_l,{ref:c,...o,children:[e,t&&n&&r.jsx(v,{id:ze(d),width:"100%",height:"1px"})]})}),_l=s.styled(Qe)`
|
|
1928
1916
|
height: 20rem;
|
|
1929
|
-
`,
|
|
1917
|
+
`,Vl=Object.freeze(Object.defineProperty({__proto__:null,Anchor:Ml,Arrow:Bl,Content:Wl,Root:Pl,ScrollArea:Hl,Trigger:Nl},Symbol.toStringTag,{value:"Module"})),ql=l.forwardRef(({size:e="M",value:t,...n},o)=>r.jsx(Ul,{ref:o,$size:e,...n,children:r.jsx(Gl,{style:{transform:`translate3D(-${100-(t??0)}%, 0, 0)`}})})),Ul=s.styled(wr.Root)`
|
|
1930
1918
|
position: relative;
|
|
1931
1919
|
overflow: hidden;
|
|
1932
|
-
width: ${
|
|
1933
|
-
height: ${
|
|
1934
|
-
background-color: ${
|
|
1935
|
-
border-radius: ${
|
|
1920
|
+
width: ${e=>e.$size==="S"?"7.8rem":"10.2rem"};
|
|
1921
|
+
height: ${e=>e.$size==="S"?"0.4rem":"0.8rem"};
|
|
1922
|
+
background-color: ${e=>e.theme.colors.neutral600};
|
|
1923
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
1936
1924
|
|
|
1937
1925
|
/* Fix overflow clipping in Safari */
|
|
1938
1926
|
/* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
|
|
1939
1927
|
transform: translateZ(0);
|
|
1940
|
-
`,
|
|
1941
|
-
background-color: ${({theme:
|
|
1942
|
-
border-radius: ${({theme:
|
|
1928
|
+
`,Gl=s.styled(wr.Indicator)`
|
|
1929
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
1930
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
1943
1931
|
width: 100%;
|
|
1944
1932
|
height: 100%;
|
|
1945
1933
|
|
|
1946
1934
|
@media (prefers-reduced-motion: no-preference) {
|
|
1947
|
-
transition: transform ${
|
|
1948
|
-
${
|
|
1935
|
+
transition: transform ${e=>e.theme.motion.timings[320]}
|
|
1936
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
1949
1937
|
}
|
|
1950
|
-
`,
|
|
1938
|
+
`,Kl=l.forwardRef((e,t)=>r.jsx(Yl,{ref:t,...e})),Yl=s.styled(It.Root)`
|
|
1951
1939
|
display: flex;
|
|
1952
1940
|
flex-direction: column;
|
|
1953
|
-
gap: ${
|
|
1954
|
-
`,
|
|
1955
|
-
background: ${
|
|
1941
|
+
gap: ${e=>e.theme.spaces[3]};
|
|
1942
|
+
`,Ql=l.forwardRef(({children:e,id:t,...n},o)=>{const a=re(t);return r.jsxs(C,{gap:2,children:[r.jsx(Xl,{id:a,ref:o,...n,children:r.jsx(Zl,{})}),r.jsx(T,{tag:"label",htmlFor:a,children:e})]})}),Xl=s.styled(It.Item)`
|
|
1943
|
+
background: ${e=>e.theme.colors.neutral0};
|
|
1956
1944
|
width: 2rem;
|
|
1957
1945
|
height: 2rem;
|
|
1958
1946
|
flex: 0 0 2rem;
|
|
1959
1947
|
border-radius: 50%;
|
|
1960
|
-
border: 1px solid ${
|
|
1948
|
+
border: 1px solid ${e=>e.theme.colors.neutral300};
|
|
1961
1949
|
position: relative;
|
|
1962
1950
|
cursor: pointer;
|
|
1963
1951
|
z-index: 0;
|
|
1964
1952
|
|
|
1965
1953
|
@media (prefers-reduced-motion: no-preference) {
|
|
1966
|
-
transition: border-color ${
|
|
1967
|
-
${
|
|
1954
|
+
transition: border-color ${e=>e.theme.motion.timings[120]}
|
|
1955
|
+
${e=>e.theme.motion.easings.easeOutQuad};
|
|
1968
1956
|
}
|
|
1969
1957
|
|
|
1970
1958
|
&[data-state='checked'] {
|
|
1971
|
-
border: 1px solid ${
|
|
1959
|
+
border: 1px solid ${e=>e.theme.colors.primary600};
|
|
1972
1960
|
}
|
|
1973
1961
|
|
|
1974
1962
|
&[data-disabled] {
|
|
1975
1963
|
cursor: not-allowed;
|
|
1976
|
-
background-color: ${
|
|
1964
|
+
background-color: ${e=>e.theme.colors.neutral200};
|
|
1977
1965
|
}
|
|
1978
1966
|
|
|
1979
1967
|
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
@@ -1988,7 +1976,7 @@ ${m.css`
|
|
|
1988
1976
|
min-width: 44px;
|
|
1989
1977
|
min-height: 44px;
|
|
1990
1978
|
}
|
|
1991
|
-
`,
|
|
1979
|
+
`,Zl=s.styled(It.Indicator)`
|
|
1992
1980
|
display: flex;
|
|
1993
1981
|
align-items: center;
|
|
1994
1982
|
justify-content: center;
|
|
@@ -1998,7 +1986,7 @@ ${m.css`
|
|
|
1998
1986
|
|
|
1999
1987
|
&[data-state='checked'] {
|
|
2000
1988
|
@media (prefers-reduced-motion: no-preference) {
|
|
2001
|
-
animation: ${
|
|
1989
|
+
animation: ${q.popIn} ${e=>e.theme.motion.timings[200]};
|
|
2002
1990
|
}
|
|
2003
1991
|
}
|
|
2004
1992
|
|
|
@@ -2008,31 +1996,31 @@ ${m.css`
|
|
|
2008
1996
|
width: 1rem;
|
|
2009
1997
|
height: 1rem;
|
|
2010
1998
|
border-radius: 50%;
|
|
2011
|
-
background: ${
|
|
1999
|
+
background: ${e=>e.theme.colors.primary600};
|
|
2012
2000
|
}
|
|
2013
|
-
`,
|
|
2001
|
+
`,Jl=Object.freeze(Object.defineProperty({__proto__:null,Group:Kl,Item:Ql},Symbol.toStringTag,{value:"Module"})),ec=e=>{const t=e.querySelector('[tabindex="0"]');t&&t.focus()},In=l.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),tc=()=>l.useContext(In),Dn=l.forwardRef(({colCount:e,rowCount:t,jumpStep:n=3,initialCol:o=0,initialRow:a=0,...i},c)=>{const d=l.useRef(null),u=l.useRef(!1),h=te(d,c),[f,g]=l.useState(a),[p,w]=l.useState(o),m=l.useCallback(({colIndex:y,rowIndex:x})=>{w(y),g(x)},[]);l.useEffect(()=>{u.current&&ec(d.current),u.current||(u.current=!0)},[p,f]);const $=y=>{switch(y.key){case W.RIGHT:{y.preventDefault(),w(x=>x<e-1?x+1:x);break}case W.LEFT:{y.preventDefault(),w(x=>x>0?x-1:x);break}case W.UP:{y.preventDefault(),g(x=>x>0?x-1:x);break}case W.DOWN:{y.preventDefault(),g(x=>x<t-1?x+1:x);break}case W.HOME:{y.preventDefault(),y.ctrlKey&&g(0),w(0);break}case W.END:{y.preventDefault(),y.ctrlKey&&g(t-1),w(e-1);break}case W.PAGE_DOWN:{y.preventDefault(),g(x=>x+n<t?x+n:t-1);break}case W.PAGE_UP:{y.preventDefault(),g(x=>x-n>0?x-n:0);break}}},k=l.useMemo(()=>({rowIndex:f,colIndex:p,setTableValues:m}),[p,f,m]);return r.jsx(In.Provider,{value:k,children:r.jsx("table",{role:"grid",ref:h,"aria-rowcount":t,"aria-colcount":e,onKeyDown:$,...i})})}),ve=(e,t)=>[...e.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(a=>a.hasAttribute("disabled")?!1:t?!0:a.getAttribute("tabindex")!=="-1"),mt=e=>e.filter(t=>t.tagName==="INPUT"?t.type!=="checkbox"&&t.type!=="radio":!1),qt=l.forwardRef(({coords:e={col:0,row:0},tag:t="td",...n},o)=>{const a=l.useRef(null),i=te(o,a),{rowIndex:c,colIndex:d,setTableValues:u}=tc(),[h,f]=l.useState(!1),g=m=>{var y;const $=ve(a.current,!0);if($.length===0||$.length===1&&mt($).length===0)return;if($.length>1&&!$.find(x=>x.tagName!=="BUTTON")){m.preventDefault();const x=$.findIndex(I=>I===document.activeElement);if(m.key===W.RIGHT){const I=$[x+1];I&&(m.stopPropagation(),I.focus())}else if(m.key===W.LEFT){const I=$[x-1];I&&(m.stopPropagation(),I.focus())}return}const k=m.key===W.ENTER;if(k&&!h)f(!0);else if((m.key===W.ESCAPE||k)&&h){if(k&&((y=document.activeElement)==null?void 0:y.tagName)==="A")return;f(!1),a.current.focus()}else h&&m.stopPropagation()},p=c===e.row-1&&d===e.col-1;he(()=>{const m=ve(a.current,!0);m.length===0||m.length===1&&mt(m).length!==0||m.length>1&&m.find($=>$.tagName!=="BUTTON")?(a.current.setAttribute("tabIndex",!h&&p?"0":"-1"),m.forEach(($,k)=>{$.setAttribute("tabIndex",h?"0":"-1"),h&&k===0&&$.focus()})):m.forEach($=>{$.setAttribute("tabIndex",p?"0":"-1")})},[h,p]);const w=l.useCallback(()=>{const m=ve(a.current,!0);m.length>=1&&(mt(m).length!==0||!m.find($=>$.tagName!=="BUTTON"))&&f(!0),u({rowIndex:e.row-1,colIndex:e.col-1})},[e,u]);return he(()=>{const m=a.current;return ve(m,!0).forEach(k=>{k.addEventListener("focus",w)}),()=>{ve(m,!0).forEach(y=>{y.removeEventListener("focus",w)})}},[w]),r.jsx(v,{role:"gridcell",tag:t,ref:i,onKeyDown:g,...n})}),En=e=>r.jsx(qt,{...e,tag:"th"}),An=({children:e,...t})=>{const n=l.Children.toArray(e).map(o=>l.isValidElement(o)?l.cloneElement(o,{"aria-rowindex":1}):o);return r.jsx("thead",{...t,children:n})},zn=({children:e,...t})=>{const n=l.Children.toArray(e).map((o,a)=>l.isValidElement(o)?l.cloneElement(o,{"aria-rowindex":a+2}):o);return r.jsx("tbody",{...t,children:n})},Ln=({children:e,...t})=>{const n=l.Children.toArray(e).map((o,a)=>l.isValidElement(o)?l.cloneElement(o,{"aria-colindex":a+1,coords:{col:a+1,row:t["aria-rowindex"]}}):o);return r.jsx(v,{tag:"tr",...t,children:n})},rc=s.styled(O.Cross)`
|
|
2014
2002
|
font-size: 0.5rem;
|
|
2015
2003
|
path {
|
|
2016
|
-
fill: ${({theme:
|
|
2004
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
2017
2005
|
}
|
|
2018
|
-
`,
|
|
2006
|
+
`,On=s.styled(O.Search)`
|
|
2019
2007
|
font-size: 1rem;
|
|
2020
2008
|
path {
|
|
2021
|
-
fill: ${({theme:
|
|
2009
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
2022
2010
|
}
|
|
2023
|
-
`,
|
|
2024
|
-
border-radius: ${({theme:
|
|
2025
|
-
border: 1px solid ${({theme:
|
|
2011
|
+
`,nc=s.styled.div`
|
|
2012
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
2013
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
2026
2014
|
|
|
2027
2015
|
&:focus-within {
|
|
2028
|
-
${
|
|
2029
|
-
fill: ${({theme:
|
|
2016
|
+
${On} {
|
|
2017
|
+
fill: ${({theme:e})=>e.colors.primary600};
|
|
2030
2018
|
}
|
|
2031
2019
|
}
|
|
2032
|
-
`,
|
|
2033
|
-
border: 1px solid ${({theme:
|
|
2020
|
+
`,oc=s.styled(ut)`
|
|
2021
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
2034
2022
|
padding: 0 0 0 8px;
|
|
2035
|
-
color: ${({theme:
|
|
2023
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
2036
2024
|
|
|
2037
2025
|
&:hover {
|
|
2038
2026
|
button {
|
|
@@ -2040,7 +2028,7 @@ ${m.css`
|
|
|
2040
2028
|
}
|
|
2041
2029
|
}
|
|
2042
2030
|
|
|
2043
|
-
${
|
|
2031
|
+
${be()}
|
|
2044
2032
|
|
|
2045
2033
|
> input::-ms-clear {
|
|
2046
2034
|
display: none;
|
|
@@ -2060,7 +2048,7 @@ ${m.css`
|
|
|
2060
2048
|
> input::-webkit-search-results-decoration {
|
|
2061
2049
|
display: none;
|
|
2062
2050
|
}
|
|
2063
|
-
`,
|
|
2051
|
+
`,Pn=l.forwardRef(({name:e,children:t,value:n="",onClear:o,clearLabel:a="Clear",...i},c)=>{const d=l.useRef(null),u=n.length>0,h=g=>{o(g),d.current.focus()},f=zt(c,d);return r.jsx(nc,{children:r.jsxs(Re,{name:e,children:[r.jsx(me,{children:r.jsx(Bt,{children:t})}),r.jsx(oc,{size:"S",type:"search",ref:f,value:n,startAction:r.jsx(On,{"aria-hidden":!0}),onKeyDown:g=>{g.stopPropagation(),g.key==="Escape"&&u&&h(g)},endAction:u?r.jsx(ge,{onClick:h,onMouseDown:g=>{g.preventDefault()},label:a,size:"XS",variant:"ghost",type:"button",children:r.jsx(rc,{})}):void 0,...i})]})})}),Mn=e=>r.jsx("form",{...e,role:"search"}),ac=s.styled(v)`
|
|
2064
2052
|
display: inline-flex;
|
|
2065
2053
|
border: none;
|
|
2066
2054
|
|
|
@@ -2070,100 +2058,100 @@ ${m.css`
|
|
|
2070
2058
|
}
|
|
2071
2059
|
|
|
2072
2060
|
& > svg path {
|
|
2073
|
-
fill: ${({theme:
|
|
2061
|
+
fill: ${({theme:e,...t})=>t["aria-disabled"]?e.colors.neutral600:e.colors.primary600};
|
|
2074
2062
|
}
|
|
2075
2063
|
|
|
2076
2064
|
&:hover {
|
|
2077
|
-
cursor: ${({$iconAction:
|
|
2065
|
+
cursor: ${({$iconAction:e})=>e?"pointer":"initial"};
|
|
2078
2066
|
}
|
|
2079
|
-
`,
|
|
2067
|
+
`,Bn=({children:e,icon:t,label:n,disabled:o=!1,onClick:a,...i})=>{const c=d=>{o||!a||a(d)};return r.jsxs(C,{inline:!0,background:o?"neutral200":"primary100",color:o?"neutral700":"primary600",paddingLeft:3,paddingRight:1,borderColor:o?"neutral300":"primary200",hasRadius:!0,height:"3.2rem",...i,children:[r.jsx(sc,{$disabled:o,variant:"pi",fontWeight:"bold",children:e}),r.jsx(ac,{tag:"button",disabled:o,"aria-disabled":o,"aria-label":n,padding:2,onClick:c,$iconAction:!!a,children:t})]})},sc=s.styled(T)`
|
|
2080
2068
|
color: inherit;
|
|
2081
|
-
border-right: 1px solid ${({theme:
|
|
2082
|
-
padding-right: ${({theme:
|
|
2083
|
-
`,
|
|
2084
|
-
padding-left: ${({theme:
|
|
2085
|
-
`,
|
|
2086
|
-
width: ${
|
|
2087
|
-
background: ${({theme:
|
|
2069
|
+
border-right: 1px solid ${({theme:e,$disabled:t})=>t?e.colors.neutral300:e.colors.primary200};
|
|
2070
|
+
padding-right: ${({theme:e})=>e.spaces[2]};
|
|
2071
|
+
`,Nn=l.forwardRef(({children:e,clearLabel:t="Clear",customizeContent:n,disabled:o,hasError:a,id:i,loading:c,name:d,onChange:u,onClear:h,onCloseAutoFocus:f,onReachEnd:g,placeholder:p,required:w,size:m,startIcon:$,value:k,withTags:y,...x},I)=>{const j=l.useRef(null),[R,b]=l.useState(),[S,z]=l.useState(!1),E=_=>{u?u(_):b(_)},A=_=>()=>{const Q=Array.isArray(k)?k.filter(de=>de!==_):(R??[]).filter(de=>de!==_);u?u(Q):b(Q)},U=_=>{z(_)},B=re(),N=`intersection-${ze(B)}`;Ge(j,_=>{g&&g(_)},{selectorToWatch:`#${N}`,skipWhen:!S});const P=typeof k<"u"&&k!==null?k:R,K=_=>_&&typeof _=="object"&&_.value?r.jsx(Bn,{tabIndex:-1,disabled:o,icon:r.jsx(O.Cross,{width:`${14/16}rem`,height:`${14/16}rem`}),onClick:A(_.value),children:_.textValue},_.value):null,{error:L,...M}=ne("MultiSelect"),Z=!!L||a,G=M.id??i,oe=M.name??d,Y=M.required??w;let J;return L?J=`${G}-error`:M.hint&&(J=`${G}-hint`),r.jsxs(hn,{onOpenChange:U,disabled:o,required:Y,onValueChange:E,value:P,...x,multi:!0,children:[r.jsx(fn,{ref:I,id:G,name:oe,"aria-label":x["aria-label"],"aria-describedby":J??x["aria-describedby"],startIcon:$,hasError:Z,disabled:o,clearLabel:t,loading:c,onClear:P!=null&&P.length?h:void 0,withTags:!!(y&&((P==null?void 0:P.length)??!1)),size:m,children:r.jsx(gn,{placeholder:p,textColor:P!=null&&P.length?"neutral800":"neutral600",withTags:y,children:P!=null&&P.length?y?K:n?n(P):void 0:void 0})}),r.jsx(pn,{children:r.jsx(mn,{position:"popper",sideOffset:4,onCloseAutoFocus:f,children:r.jsxs(bn,{ref:j,children:[e,r.jsx(v,{id:N,width:"100%",height:"1px"})]})})})]})}),Ut=l.forwardRef(({value:e,children:t,startIcon:n,...o},a)=>r.jsxs(Ht,{ref:a,value:e.toString(),...o,children:[n&&r.jsx(v,{tag:"span","aria-hidden":!0,children:n}),r.jsx(xn,{children:({isSelected:i,isIntermediate:c})=>r.jsx(dt,{checked:c?"indeterminate":i})}),r.jsx(T,{children:r.jsx($n,{children:t})})]})),Wn=l.forwardRef(({children:e,label:t,startIcon:n,values:o=[],...a},i)=>r.jsxs(Si,{ref:i,children:[r.jsxs(Ht,{value:o,...a,children:[n&&r.jsx(v,{tag:"span","aria-hidden":!0,children:n}),r.jsx(xn,{children:({isSelected:c,isIntermediate:d})=>r.jsx(dt,{checked:d?"indeterminate":c})}),r.jsx(T,{children:t})]}),e]})),ic=({options:e,...t})=>r.jsx(Nn,{...t,children:e.map(n=>"children"in n?r.jsx(Wn,{label:n.label,values:n.children.map(o=>o.value.toString()),children:n.children.map(o=>r.jsx(lc,{value:o.value,children:o.label},o.value))},n.label):r.jsx(Ut,{value:n.value,children:n.label},n.value))}),lc=s.styled(Ut)`
|
|
2072
|
+
padding-left: ${({theme:e})=>e.spaces[7]};
|
|
2073
|
+
`,cc=e=>e==="XS"?{paddingX:"0.6rem",paddingY:"0.2rem"}:e==="S"?{paddingX:2,paddingY:1}:{paddingX:5,paddingY:4},dc=({variant:e="primary",size:t="M",children:n,...o})=>{const a=`${e}100`,i=`${e}200`,c=`${e}600`,{paddingX:d,paddingY:u}=cc(t);return r.jsx(v,{borderColor:i,color:c,background:a,hasRadius:!0,paddingTop:u,paddingBottom:u,paddingLeft:d,paddingRight:d,...o,children:n})},uc="23.2rem",hc=l.forwardRef(({...e},t)=>r.jsx(fc,{ref:t,...e,tag:"nav"})),fc=s.styled(v)`
|
|
2074
|
+
width: ${uc};
|
|
2075
|
+
background: ${({theme:e})=>e.colors.neutral100};
|
|
2088
2076
|
position: sticky;
|
|
2089
2077
|
top: 0;
|
|
2090
2078
|
height: 100vh;
|
|
2091
2079
|
overflow-y: auto;
|
|
2092
|
-
border-right: 1px solid ${({theme:
|
|
2080
|
+
border-right: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
2093
2081
|
z-index: 1;
|
|
2094
|
-
`,
|
|
2082
|
+
`,mr=s.styled(_t)`
|
|
2095
2083
|
width: 2.4rem;
|
|
2096
|
-
background-color: ${({theme:
|
|
2097
|
-
`,
|
|
2084
|
+
background-color: ${({theme:e})=>e.colors.neutral200};
|
|
2085
|
+
`,gc=({tag:e="h2",label:t,searchLabel:n="",searchable:o=!1,onChange:a=()=>{},value:i="",onClear:c=()=>{},onSubmit:d=()=>{},id:u,placeholder:h})=>{const[f,g]=l.useState(!1),p=D.usePrev(f),w=re(u),m=l.useRef(void 0),$=l.useRef(void 0);l.useEffect(()=>{f&&m.current&&m.current.focus(),p&&!f&&$.current&&$.current.focus()},[f,p]);const k=()=>{g(j=>!j)},y=j=>{c(j),m.current.focus()},x=j=>{var R;((R=j.relatedTarget)==null?void 0:R.id)!==w&&g(!1)},I=j=>{j.key===W.ESCAPE&&g(!1)};return f?r.jsxs(v,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[r.jsx(Mn,{children:r.jsx(Pn,{name:"searchbar",value:i,onChange:a,placeholder:h,onKeyDown:I,ref:m,onBlur:x,onClear:y,onSubmit:d,clearLabel:"Clear",children:n})}),r.jsx(v,{paddingLeft:2,paddingTop:4,children:r.jsx(mr,{})})]}):r.jsxs(C,{direction:"column",alignItems:"flex-start",paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[r.jsxs(C,{justifyContent:"space-between",alignItems:"flex-start",width:"100%",gap:2,children:[r.jsx(T,{variant:"beta",tag:e,children:t}),o&&r.jsx(ge,{ref:$,onClick:k,label:n,children:r.jsx(O.Search,{})})]}),r.jsx(v,{paddingTop:4,children:r.jsx(mr,{})})]})},pc=ae(({active:e,children:t,icon:n=null,withBullet:o=!1,isSubSectionChild:a=!1,...i},c)=>r.jsxs(mc,{background:"neutral100",paddingLeft:a?9:7,paddingBottom:2,paddingTop:2,ref:c,...i,children:[r.jsxs(C,{children:[n?r.jsx(bc,{children:n}):r.jsx(St,{$active:e}),r.jsx(T,{paddingLeft:2,children:t})]}),o&&r.jsx(C,{paddingRight:4,children:r.jsx(St,{$active:!0})})]})),St=s.styled.span`
|
|
2098
2086
|
width: 0.4rem;
|
|
2099
2087
|
height: 0.4rem;
|
|
2100
|
-
background-color: ${({theme:
|
|
2088
|
+
background-color: ${({theme:e,$active:t})=>t?e.colors.primary600:e.colors.neutral600};
|
|
2101
2089
|
border-radius: 50%;
|
|
2102
|
-
`,
|
|
2090
|
+
`,mc=s.styled(Pe)`
|
|
2103
2091
|
display: flex;
|
|
2104
2092
|
align-items: center;
|
|
2105
2093
|
justify-content: space-between;
|
|
2106
2094
|
text-decoration: none;
|
|
2107
|
-
color: ${({theme:
|
|
2095
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
2108
2096
|
svg > * {
|
|
2109
|
-
fill: ${({theme:
|
|
2097
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
2110
2098
|
}
|
|
2111
2099
|
|
|
2112
2100
|
&.active {
|
|
2113
|
-
${({theme:
|
|
2114
|
-
background-color: ${
|
|
2115
|
-
border-right: 2px solid ${
|
|
2116
|
-
color: ${
|
|
2101
|
+
${({theme:e})=>s.css`
|
|
2102
|
+
background-color: ${e.colors.primary100};
|
|
2103
|
+
border-right: 2px solid ${e.colors.primary600};
|
|
2104
|
+
color: ${e.colors.primary700};
|
|
2117
2105
|
font-weight: 500;
|
|
2118
2106
|
`}
|
|
2119
2107
|
|
|
2120
|
-
${
|
|
2121
|
-
background-color: ${({theme:
|
|
2108
|
+
${St} {
|
|
2109
|
+
background-color: ${({theme:e})=>e.colors.primary600};
|
|
2122
2110
|
}
|
|
2123
2111
|
}
|
|
2124
2112
|
|
|
2125
2113
|
&:focus-visible {
|
|
2126
2114
|
outline-offset: -2px;
|
|
2127
2115
|
}
|
|
2128
|
-
`,
|
|
2116
|
+
`,bc=s.styled.div`
|
|
2129
2117
|
svg {
|
|
2130
2118
|
height: 1.6rem;
|
|
2131
2119
|
width: 1.6rem;
|
|
2132
2120
|
}
|
|
2133
|
-
`,
|
|
2121
|
+
`,xc=s.styled.button`
|
|
2134
2122
|
border: none;
|
|
2135
2123
|
padding: 0;
|
|
2136
2124
|
background: transparent;
|
|
2137
2125
|
display: flex;
|
|
2138
2126
|
align-items: center;
|
|
2139
|
-
|
|
2127
|
+
`,$c=({label:e,children:t,id:n})=>{const[o,a]=l.useState(!0),i=re(n),c=()=>{a(d=>!d)};return r.jsxs(v,{children:[r.jsx(v,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:r.jsx(C,{justifyContent:"space-between",children:r.jsxs(xc,{onClick:c,"aria-expanded":o,"aria-controls":i,children:[r.jsx(O.CaretDown,{width:"1.2rem",height:"1.2rem","aria-hidden":!0,fill:"neutral700",style:{transform:`rotateX(${o?"0deg":"180deg"})`}}),r.jsx(v,{paddingLeft:2,children:r.jsx(T,{tag:"span",fontWeight:"semiBold",textColor:"neutral800",children:e})})]})})}),o&&r.jsx("ul",{id:i,children:l.Children.map(t,(d,u)=>r.jsx("li",{children:d},u))})]})},yc=({collapsable:e=!1,label:t,onClick:n=()=>{},ariaExpanded:o,ariaControls:a})=>e?r.jsxs(C,{tag:"button",onClick:n,"aria-expanded":o,"aria-controls":a,textAlign:"left",alignItems:"center",children:[r.jsx(v,{paddingRight:1,children:r.jsx(T,{variant:"sigma",textColor:"neutral600",children:t})}),e&&r.jsx(O.CaretDown,{width:"1.2rem","aria-hidden":!0,fill:"neutral500",style:{transform:o?"rotateX(0deg)":"rotateX(180deg)"}})]}):r.jsx(C,{children:r.jsx(v,{paddingRight:1,children:r.jsx(T,{variant:"sigma",textColor:"neutral600",children:t})})}),wc=s.styled(v)`
|
|
2140
2128
|
& > svg {
|
|
2141
2129
|
height: 0.4rem;
|
|
2142
|
-
fill: ${({theme:
|
|
2130
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
2143
2131
|
}
|
|
2144
|
-
`,
|
|
2132
|
+
`,Cc=({collapsable:e=!1,label:t,badgeLabel:n,children:o,id:a})=>{const[i,c]=l.useState(!0),d=re(a),u=()=>{c(h=>!h)};return r.jsxs(C,{direction:"column",alignItems:"stretch",gap:1,children:[r.jsx(wc,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:r.jsxs(v,{position:"relative",paddingRight:n?6:0,children:[r.jsx(yc,{onClick:u,ariaExpanded:i,ariaControls:d,collapsable:e,label:t}),n&&r.jsx(At,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:n})]})}),(!e||i)&&r.jsx("ol",{id:d,children:l.Children.map(o,(h,f)=>r.jsx("li",{children:h},f))})]})},jc=({children:e,spacing:t=2,horizontal:n=!1,...o})=>r.jsx(v,{paddingTop:2,paddingBottom:4,children:r.jsx(C,{tag:"ol",gap:t,direction:n?"row":"column",alignItems:n?"center":"stretch",...o,children:l.Children.map(e,(a,i)=>r.jsx("li",{children:a},i))})}),vc=l.forwardRef(({visibleLabels:e,onLabel:t="On",offLabel:n="Off",onCheckedChange:o,checked:a,defaultChecked:i,disabled:c,...d},u)=>{const[h,f]=le({prop:a,defaultProp:i}),g=p=>{f(p)};return r.jsxs(C,{gap:3,children:[r.jsx(kc,{ref:u,onCheckedChange:D.composeEventHandlers(o,g),checked:h,disabled:c,...d,children:r.jsx(Sc,{})}),e?r.jsx(Rc,{"aria-hidden":!0,"data-disabled":c,"data-state":h?"checked":"unchecked",children:h?t:n}):null]})}),kc=s.styled(Cr.Root)`
|
|
2145
2133
|
width: 4rem;
|
|
2146
2134
|
height: 2.4rem;
|
|
2147
2135
|
border-radius: 1.2rem;
|
|
2148
|
-
background-color: ${({theme:
|
|
2136
|
+
background-color: ${({theme:e})=>e.colors.danger500};
|
|
2149
2137
|
|
|
2150
2138
|
&[data-state='checked'] {
|
|
2151
|
-
background-color: ${({theme:
|
|
2139
|
+
background-color: ${({theme:e})=>e.colors.success500};
|
|
2152
2140
|
}
|
|
2153
2141
|
|
|
2154
2142
|
&[data-disabled] {
|
|
2155
|
-
background-color: ${({theme:
|
|
2143
|
+
background-color: ${({theme:e})=>e.colors.neutral300};
|
|
2156
2144
|
}
|
|
2157
2145
|
|
|
2158
2146
|
@media (prefers-reduced-motion: no-preference) {
|
|
2159
|
-
transition: ${
|
|
2147
|
+
transition: ${e=>e.theme.transitions.backgroundColor};
|
|
2160
2148
|
}
|
|
2161
|
-
`,
|
|
2149
|
+
`,Sc=s.styled(Cr.Thumb)`
|
|
2162
2150
|
display: block;
|
|
2163
2151
|
height: 1.6rem;
|
|
2164
2152
|
width: 1.6rem;
|
|
2165
2153
|
border-radius: 50%;
|
|
2166
|
-
background-color: ${({theme:
|
|
2154
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
2167
2155
|
transform: translateX(4px);
|
|
2168
2156
|
|
|
2169
2157
|
&[data-state='checked'] {
|
|
@@ -2171,28 +2159,28 @@ ${m.css`
|
|
|
2171
2159
|
}
|
|
2172
2160
|
|
|
2173
2161
|
@media (prefers-reduced-motion: no-preference) {
|
|
2174
|
-
transition: transform ${
|
|
2175
|
-
${
|
|
2162
|
+
transition: transform ${e=>e.theme.motion.timings[120]}
|
|
2163
|
+
${e=>e.theme.motion.easings.authenticMotion};
|
|
2176
2164
|
}
|
|
2177
|
-
`,
|
|
2178
|
-
color: ${
|
|
2165
|
+
`,Rc=s.styled(T)`
|
|
2166
|
+
color: ${e=>e.theme.colors.danger600};
|
|
2179
2167
|
|
|
2180
2168
|
&[data-state='checked'] {
|
|
2181
|
-
color: ${
|
|
2169
|
+
color: ${e=>e.theme.colors.success600};
|
|
2182
2170
|
}
|
|
2183
2171
|
|
|
2184
2172
|
&[data-disabled='true'] {
|
|
2185
|
-
color: ${({theme:
|
|
2173
|
+
color: ${({theme:e})=>e.colors.neutral500};
|
|
2186
2174
|
}
|
|
2187
|
-
`,[
|
|
2175
|
+
`,[Tc,Gt]=Oe("Tabs"),Ic=l.forwardRef(({disabled:e=!1,variant:t="regular",hasError:n,...o},a)=>r.jsx(Tc,{disabled:e,hasError:n,variant:t,children:r.jsx(Dc,{ref:a,...o})})),Dc=s.styled(at.Root)`
|
|
2188
2176
|
width: 100%;
|
|
2189
2177
|
position: relative;
|
|
2190
|
-
`,
|
|
2178
|
+
`,Ec=l.forwardRef((e,t)=>{const{variant:n}=Gt("List");return r.jsx(Ac,{ref:t,...e,$variant:n})}),Ac=s.styled(at.List)`
|
|
2191
2179
|
display: flex;
|
|
2192
|
-
align-items: ${
|
|
2180
|
+
align-items: ${e=>e.$variant==="regular"?"flex-end":"unset"};
|
|
2193
2181
|
position: relative;
|
|
2194
2182
|
z-index: 0;
|
|
2195
|
-
`,
|
|
2183
|
+
`,zc=l.forwardRef(({children:e,disabled:t,...n},o)=>{const{disabled:a,variant:i,hasError:c}=Gt("Trigger"),d=a===!0||a===n.value||t,u=c===n.value;return r.jsxs(Lc,{ref:o,...n,$hasError:u,$variant:i,disabled:d,children:[r.jsx(Hn,{fontWeight:"bold",variant:i==="simple"?"sigma":void 0,children:e}),i==="simple"?r.jsx(Fn,{}):null]})}),Fn=s.styled.span`
|
|
2196
2184
|
display: block;
|
|
2197
2185
|
width: 100%;
|
|
2198
2186
|
background-color: currentColor;
|
|
@@ -2201,79 +2189,79 @@ ${m.css`
|
|
|
2201
2189
|
left: 0;
|
|
2202
2190
|
opacity: 0;
|
|
2203
2191
|
height: 0.2rem;
|
|
2204
|
-
`,
|
|
2192
|
+
`,Hn=s.styled(T)``,Lc=s.styled(at.Trigger)`
|
|
2205
2193
|
position: relative;
|
|
2206
|
-
color: ${
|
|
2194
|
+
color: ${e=>e.$hasError?e.theme.colors.danger600:e.theme.colors.neutral600};
|
|
2207
2195
|
cursor: pointer;
|
|
2208
2196
|
z-index: 0;
|
|
2209
2197
|
|
|
2210
|
-
${
|
|
2211
|
-
padding-block: ${
|
|
2212
|
-
padding-inline: ${
|
|
2198
|
+
${e=>e.$variant==="simple"?s.css`
|
|
2199
|
+
padding-block: ${t=>t.theme.spaces[4]};
|
|
2200
|
+
padding-inline: ${t=>t.theme.spaces[4]};
|
|
2213
2201
|
|
|
2214
|
-
& > ${
|
|
2202
|
+
& > ${Hn} {
|
|
2215
2203
|
line-height: 1.2rem;
|
|
2216
2204
|
}
|
|
2217
2205
|
|
|
2218
2206
|
&[data-state='active'] {
|
|
2219
|
-
color: ${
|
|
2207
|
+
color: ${e.$hasError?e.theme.colors.danger600:e.theme.colors.primary700};
|
|
2220
2208
|
|
|
2221
|
-
& > ${
|
|
2209
|
+
& > ${Fn} {
|
|
2222
2210
|
opacity: 1;
|
|
2223
2211
|
}
|
|
2224
2212
|
}
|
|
2225
|
-
`:
|
|
2226
|
-
padding-block: ${
|
|
2227
|
-
padding-inline: ${
|
|
2213
|
+
`:s.css`
|
|
2214
|
+
padding-block: ${t=>t.theme.spaces[3]};
|
|
2215
|
+
padding-inline: ${t=>t.theme.spaces[3]};
|
|
2228
2216
|
flex: 1;
|
|
2229
|
-
background-color: ${
|
|
2230
|
-
border-bottom: solid 1px ${
|
|
2217
|
+
background-color: ${t=>t.theme.colors.neutral100};
|
|
2218
|
+
border-bottom: solid 1px ${t=>t.theme.colors.neutral150};
|
|
2231
2219
|
|
|
2232
2220
|
&:not([data-state='active']) + &:not([data-state='active']) {
|
|
2233
|
-
border-left: solid 1px ${
|
|
2221
|
+
border-left: solid 1px ${t=>t.theme.colors.neutral150};
|
|
2234
2222
|
}
|
|
2235
2223
|
|
|
2236
2224
|
&[data-state='active'] {
|
|
2237
|
-
padding-block: ${
|
|
2238
|
-
padding-inline: ${
|
|
2239
|
-
color: ${
|
|
2240
|
-
border-top-right-radius: ${
|
|
2241
|
-
border-top-left-radius: ${
|
|
2242
|
-
background-color: ${
|
|
2243
|
-
border-bottom: solid 1px ${
|
|
2244
|
-
box-shadow: ${
|
|
2225
|
+
padding-block: ${t=>t.theme.spaces[4]};
|
|
2226
|
+
padding-inline: ${t=>t.theme.spaces[4]};
|
|
2227
|
+
color: ${e.$hasError?e.theme.colors.danger600:e.theme.colors.primary700};
|
|
2228
|
+
border-top-right-radius: ${t=>t.theme.borderRadius};
|
|
2229
|
+
border-top-left-radius: ${t=>t.theme.borderRadius};
|
|
2230
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
2231
|
+
border-bottom: solid 1px ${t=>t.theme.colors.neutral0};
|
|
2232
|
+
box-shadow: ${e.theme.shadows.tableShadow};
|
|
2245
2233
|
z-index: 1;
|
|
2246
2234
|
}
|
|
2247
2235
|
`}
|
|
2248
2236
|
|
|
2249
2237
|
&[data-disabled] {
|
|
2250
2238
|
cursor: not-allowed;
|
|
2251
|
-
color: ${
|
|
2239
|
+
color: ${e=>e.theme.colors.neutral400};
|
|
2252
2240
|
}
|
|
2253
|
-
`,
|
|
2254
|
-
${
|
|
2241
|
+
`,Oc=l.forwardRef((e,t)=>{const{variant:n}=Gt("Content");return r.jsx(Pc,{$variant:n,ref:t,...e})}),Pc=s.styled(at.Content)`
|
|
2242
|
+
${e=>e.$variant==="simple"?s.css`
|
|
2255
2243
|
|
|
2256
|
-
`:
|
|
2244
|
+
`:s.css`
|
|
2257
2245
|
position: relative;
|
|
2258
2246
|
z-index: 1;
|
|
2259
|
-
background-color: ${
|
|
2247
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
2260
2248
|
`}
|
|
2261
|
-
`,
|
|
2249
|
+
`,Mc=Object.freeze(Object.defineProperty({__proto__:null,Content:Oc,List:Ec,Root:Ic,Trigger:zc},Symbol.toStringTag,{value:"Module"})),Bc=s.styled(v)`
|
|
2262
2250
|
overflow: hidden;
|
|
2263
|
-
border: 1px solid ${({theme:
|
|
2264
|
-
`,
|
|
2251
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
2252
|
+
`,Nc=s.styled(Dn)`
|
|
2265
2253
|
width: 100%;
|
|
2266
2254
|
white-space: nowrap;
|
|
2267
|
-
`,
|
|
2255
|
+
`,Wc=s.styled(v)`
|
|
2268
2256
|
&:before {
|
|
2269
2257
|
// TODO: make sure to add a token for this weird stuff
|
|
2270
2258
|
background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
|
|
2271
2259
|
opacity: 0.2;
|
|
2272
2260
|
position: absolute;
|
|
2273
2261
|
height: 100%;
|
|
2274
|
-
content: ${({$overflowing:
|
|
2275
|
-
box-shadow: ${({theme:
|
|
2276
|
-
width: ${({theme:
|
|
2262
|
+
content: ${({$overflowing:e})=>e==="both"||e==="left"?"''":void 0};
|
|
2263
|
+
box-shadow: ${({theme:e})=>e.shadows.tableShadow};
|
|
2264
|
+
width: ${({theme:e})=>e.spaces[2]};
|
|
2277
2265
|
left: 0;
|
|
2278
2266
|
}
|
|
2279
2267
|
|
|
@@ -2283,31 +2271,31 @@ ${m.css`
|
|
|
2283
2271
|
opacity: 0.2;
|
|
2284
2272
|
position: absolute;
|
|
2285
2273
|
height: 100%;
|
|
2286
|
-
content: ${({$overflowing:
|
|
2287
|
-
box-shadow: ${({theme:
|
|
2288
|
-
width: ${({theme:
|
|
2274
|
+
content: ${({$overflowing:e})=>e==="both"||e==="right"?"''":void 0};
|
|
2275
|
+
box-shadow: ${({theme:e})=>e.shadows.tableShadow};
|
|
2276
|
+
width: ${({theme:e})=>e.spaces[2]};
|
|
2289
2277
|
right: 0;
|
|
2290
2278
|
top: 0;
|
|
2291
2279
|
}
|
|
2292
|
-
`,
|
|
2280
|
+
`,Fc=s.styled(v)`
|
|
2293
2281
|
overflow-x: auto;
|
|
2294
|
-
`,
|
|
2282
|
+
`,Hc=l.forwardRef(({footer:e,...t},n)=>{const o=l.useRef(null),[a,i]=l.useState(),c=d=>{const u=d.target.scrollWidth-d.target.clientWidth;if(d.target.scrollLeft===0){i("right");return}if(d.target.scrollLeft===u){i("left");return}d.target.scrollLeft>0&&i("both")};return l.useEffect(()=>{o.current.scrollWidth>o.current.clientWidth&&i("right")},[]),r.jsxs(Bc,{shadow:"tableShadow",hasRadius:!0,background:"neutral0",children:[r.jsx(Wc,{$overflowing:a,position:"relative",children:r.jsx(Fc,{ref:o,onScroll:c,paddingLeft:6,paddingRight:6,children:r.jsx(Nc,{ref:n,...t})})}),e]})}),_c=s.styled(zn)`
|
|
2295
2283
|
& tr:last-of-type {
|
|
2296
2284
|
border-bottom: none;
|
|
2297
2285
|
}
|
|
2298
|
-
`,
|
|
2299
|
-
border-bottom: 1px solid ${({theme:
|
|
2300
|
-
`,
|
|
2301
|
-
border-bottom: 1px solid ${({theme:
|
|
2286
|
+
`,Vc=({children:e,...t})=>r.jsx(_c,{...t,children:e}),qc=s.styled(An)`
|
|
2287
|
+
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
2288
|
+
`,Uc=({children:e,...t})=>r.jsx(qc,{...t,children:e}),Gc=s.styled(Ln)`
|
|
2289
|
+
border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
2302
2290
|
|
|
2303
2291
|
& td,
|
|
2304
2292
|
& th {
|
|
2305
|
-
padding: ${({theme:
|
|
2293
|
+
padding: ${({theme:e})=>e.spaces[4]};
|
|
2306
2294
|
}
|
|
2307
2295
|
|
|
2308
2296
|
& td:first-of-type,
|
|
2309
2297
|
& th:first-of-type {
|
|
2310
|
-
padding: 0 ${({theme:
|
|
2298
|
+
padding: 0 ${({theme:e})=>e.spaces[1]};
|
|
2311
2299
|
}
|
|
2312
2300
|
|
|
2313
2301
|
// Resetting padding values and fixing a height
|
|
@@ -2316,7 +2304,7 @@ ${m.css`
|
|
|
2316
2304
|
padding-bottom: 0;
|
|
2317
2305
|
height: 5.6rem;
|
|
2318
2306
|
}
|
|
2319
|
-
`,
|
|
2307
|
+
`,Kc=e=>r.jsx(Gc,{...e}),_n=s.styled(qt)`
|
|
2320
2308
|
vertical-align: middle;
|
|
2321
2309
|
text-align: left;
|
|
2322
2310
|
outline-offset: -4px;
|
|
@@ -2327,7 +2315,7 @@ ${m.css`
|
|
|
2327
2315
|
input {
|
|
2328
2316
|
vertical-align: sub;
|
|
2329
2317
|
}
|
|
2330
|
-
`,
|
|
2318
|
+
`,Yc=l.forwardRef(({children:e,action:t,...n},o)=>r.jsx(_n,{color:"neutral600",as:En,ref:o,...n,children:r.jsxs(C,{children:[e,t]})})),Qc=l.forwardRef(({children:e,...t},n)=>r.jsx(_n,{color:"neutral800",ref:n,...t,children:e})),Xc=s.styled(v)`
|
|
2331
2319
|
height: 2.4rem;
|
|
2332
2320
|
width: 2.4rem;
|
|
2333
2321
|
border-radius: 50%;
|
|
@@ -2341,56 +2329,56 @@ ${m.css`
|
|
|
2341
2329
|
}
|
|
2342
2330
|
|
|
2343
2331
|
svg path {
|
|
2344
|
-
fill: ${({theme:
|
|
2332
|
+
fill: ${({theme:e})=>e.colors.primary600};
|
|
2345
2333
|
}
|
|
2346
|
-
`,
|
|
2347
|
-
border-radius: 0 0 ${({theme:
|
|
2334
|
+
`,Zc=s.styled(v)`
|
|
2335
|
+
border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
|
|
2348
2336
|
display: block;
|
|
2349
2337
|
width: 100%;
|
|
2350
2338
|
border: none;
|
|
2351
|
-
`,
|
|
2339
|
+
`,Jc=({children:e,icon:t,...n})=>r.jsxs("div",{children:[r.jsx(_t,{}),r.jsx(Zc,{tag:"button",background:"primary100",padding:5,...n,children:r.jsxs(C,{children:[r.jsx(Xc,{"aria-hidden":!0,background:"primary200",children:t}),r.jsx(v,{paddingLeft:3,children:r.jsx(T,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:e})})]})})]}),ed=ae(({children:e,startIcon:t,endIcon:n,disabled:o=!1,loading:a=!1,type:i="button",...c},d)=>{const u=o||a;return r.jsxs(nd,{ref:d,disabled:u,"aria-disabled":u,tag:"button",type:i,gap:2,...c,children:[a?r.jsx(rd,{"aria-hidden":!0,children:r.jsx(O.Loader,{})}):t,r.jsx(T,{variant:"pi",children:e}),n]})}),td=s.keyframes`
|
|
2352
2340
|
from {
|
|
2353
2341
|
transform: rotate(0deg);
|
|
2354
2342
|
}
|
|
2355
2343
|
to {
|
|
2356
2344
|
transform: rotate(359deg);
|
|
2357
2345
|
}
|
|
2358
|
-
`,
|
|
2346
|
+
`,rd=s.styled.span`
|
|
2359
2347
|
display: flex;
|
|
2360
|
-
animation: ${
|
|
2348
|
+
animation: ${td} 2s infinite linear;
|
|
2361
2349
|
will-change: transform;
|
|
2362
|
-
`,
|
|
2350
|
+
`,nd=s.styled(C)`
|
|
2363
2351
|
border: none;
|
|
2364
2352
|
background-color: transparent;
|
|
2365
|
-
color: ${
|
|
2353
|
+
color: ${e=>e.theme.colors.primary600};
|
|
2366
2354
|
cursor: pointer;
|
|
2367
2355
|
|
|
2368
2356
|
&[aria-disabled='true'] {
|
|
2369
2357
|
pointer-events: none;
|
|
2370
|
-
color: ${
|
|
2358
|
+
color: ${e=>e.theme.colors.neutral600};
|
|
2371
2359
|
}
|
|
2372
2360
|
|
|
2373
|
-
${
|
|
2374
|
-
`,
|
|
2375
|
-
${
|
|
2376
|
-
`,
|
|
2361
|
+
${st}
|
|
2362
|
+
`,Vn=l.forwardRef((e,t)=>r.jsx(ut,{ref:t,...e}));Vn.displayName="TextInput";const od=l.forwardRef(({disabled:e,hasError:t,id:n,name:o,required:a,resizable:i=!0,...c},d)=>{const{error:u,...h}=ne("Textarea"),f=!!u||t,g=h.id??n,p=h.name??o,w=h.required||a;let m;return u?m=`${g}-error`:h.hint&&(m=`${g}-hint`),r.jsx(ad,{borderColor:f?"danger600":"neutral200",$hasError:f,hasRadius:!0,children:r.jsx(sd,{"aria-invalid":f,"aria-required":w,tag:"textarea",background:e?"neutral150":"neutral0",color:e?"neutral600":"neutral800",disabled:e,hasRadius:!0,ref:d,lineHeight:4,padding:4,width:"100%",height:"100%",id:g,name:p,"aria-describedby":m,$resizable:i,...c})})}),ad=s.styled(v)`
|
|
2363
|
+
${be()}
|
|
2364
|
+
`,sd=s.styled(v)`
|
|
2377
2365
|
display: block;
|
|
2378
2366
|
border: none;
|
|
2379
|
-
resize: ${({$resizable:
|
|
2380
|
-
min-height: ${({minHeight:
|
|
2381
|
-
font-size: ${({theme:
|
|
2367
|
+
resize: ${({$resizable:e})=>e?"vertical":"none"};
|
|
2368
|
+
min-height: ${({minHeight:e})=>e||"10.5rem"};
|
|
2369
|
+
font-size: ${({theme:e})=>e.fontSizes[3]};
|
|
2382
2370
|
|
|
2383
|
-
${({theme:
|
|
2384
|
-
font-size: ${({theme:
|
|
2371
|
+
${({theme:e})=>e.breakpoints.small} {
|
|
2372
|
+
font-size: ${({theme:e})=>e.fontSizes[2]};
|
|
2385
2373
|
}
|
|
2386
2374
|
|
|
2387
2375
|
&::placeholder {
|
|
2388
|
-
color: ${({theme:
|
|
2389
|
-
font-size: ${({theme:
|
|
2376
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
2377
|
+
font-size: ${({theme:e})=>e.fontSizes[3]};
|
|
2390
2378
|
opacity: 1;
|
|
2391
2379
|
|
|
2392
|
-
${({theme:
|
|
2393
|
-
font-size: ${({theme:
|
|
2380
|
+
${({theme:e})=>e.breakpoints.small} {
|
|
2381
|
+
font-size: ${({theme:e})=>e.fontSizes[2]};
|
|
2394
2382
|
}
|
|
2395
2383
|
}
|
|
2396
2384
|
|
|
@@ -2401,11 +2389,11 @@ ${m.css`
|
|
|
2401
2389
|
&:disabled {
|
|
2402
2390
|
cursor: not-allowed;
|
|
2403
2391
|
}
|
|
2404
|
-
`,
|
|
2405
|
-
${
|
|
2406
|
-
`,
|
|
2392
|
+
`,id=l.forwardRef(({offLabel:e,onLabel:t,disabled:n,hasError:o,required:a,id:i,name:c,checked:d,onChange:u,...h},f)=>{const[g=!1,p]=le({prop:d}),w=g!==null&&!g,{error:m,...$}=ne("Toggle"),k=!!m||o,y=$.id??i,x=$.name??c,I=$.required||a;let j;return m?j=`${y}-error`:$.hint&&(j=`${y}-hint`),r.jsxs(ld,{position:"relative",hasRadius:!0,padding:1,background:n?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:k?"danger600":"neutral200",wrap:"wrap",cursor:n?"not-allowed":"pointer",$hasError:k,children:[r.jsx(br,{hasRadius:!0,flex:"1 1 50%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&w?"neutral200":w?"neutral0":"transparent",borderColor:n&&w?"neutral300":w?"neutral200":n?"neutral150":"neutral100",children:r.jsx(T,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":w?"danger700":"neutral600",children:e})}),r.jsx(br,{hasRadius:!0,flex:"1 1 50%",paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&g?"neutral200":g?"neutral0":"transparent",borderColor:n&&g?"neutral300":g?"neutral200":n?"neutral150":"neutral100",children:r.jsx(T,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":g?"primary600":"neutral600",children:t})}),r.jsx(cd,{...h,id:y,name:x,ref:f,onChange:R=>{p(R.currentTarget.checked),u==null||u(R)},type:"checkbox","aria-required":I,disabled:n,"aria-disabled":n,checked:!!g,"aria-describedby":j})]})}),ld=s.styled(C)`
|
|
2393
|
+
${be()}
|
|
2394
|
+
`,br=s.styled(C)`
|
|
2407
2395
|
padding-block: 0.6rem;
|
|
2408
|
-
`,
|
|
2396
|
+
`,cd=s.styled.input`
|
|
2409
2397
|
height: 100%;
|
|
2410
2398
|
left: 0;
|
|
2411
2399
|
opacity: 0;
|
|
@@ -2413,4 +2401,4 @@ ${m.css`
|
|
|
2413
2401
|
top: 0;
|
|
2414
2402
|
z-index: 0;
|
|
2415
2403
|
width: 100%;
|
|
2416
|
-
|
|
2404
|
+
`,dd={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function ud(){const[e,t]=X.useState(null),[n,o]=X.useState(dd),a=X.useMemo(()=>new ResizeObserver(i=>{if(i[0]){const{x:c,y:d,width:u,height:h,top:f,left:g,bottom:p,right:w}=i[0].contentRect;o({x:c,y:d,width:u,height:h,top:f,left:g,bottom:p,right:w})}}),[]);return he(()=>{if(e)return a.observe(e),()=>{a.disconnect()}},[e,a]),[t,n]}const hd=({onEscape:e,restoreFocus:t=!0,skipAutoFocus:n=!1,...o})=>{const a=l.useRef(null);l.useEffect(()=>{let c=null;return t&&(c=document.activeElement),()=>{c&&c.focus()}},[t]),l.useEffect(()=>{if(!a.current||n)return;const c=ve(a.current);c.length>0?c[0].focus():console.warn("[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one.")},[n]);const i=c=>{if(c.key===W.ESCAPE&&e){e();return}if(c.key!==W.TAB)return;const d=ve(a.current);if(d.length>0){const u=d[0],h=d[d.length-1];c.shiftKey?u===document.activeElement&&(c.preventDefault(),h.focus()):h===document.activeElement&&(c.preventDefault(),u.focus())}};return r.jsx("div",{ref:a,onKeyDown:i,...o})},fd=({tagName:e,attributeName:t="",...n})=>{const o=()=>{const c=document.activeElement;return c?e?c.tagName.toLowerCase()===e:c.hasAttribute(t):!1},a=c=>e?c.querySelectorAll(e):c.querySelectorAll(`[${t}]`),i=c=>{switch(c.key){case W.RIGHT:case W.DOWN:{if(o()){c.preventDefault();const d=document.activeElement,u=[...a(c.currentTarget)],h=u.findIndex(g=>g===d),f=h+1<u.length?h+1:0;u[f].focus()}break}case W.LEFT:case W.UP:{if(o()){c.preventDefault();const d=document.activeElement,u=[...a(c.currentTarget)],h=u.findIndex(g=>g===d),f=h-1>-1?h-1:u.length-1;u[f].focus()}break}case W.HOME:{o()&&(c.preventDefault(),a(c.currentTarget).item(0).focus());break}case W.END:{if(o()){c.preventDefault();const d=a(c.currentTarget);d.item(d.length-1).focus()}break}}};return r.jsx(v,{onKeyDown:i,...n})};Object.defineProperty(exports,"composeEventHandlers",{enumerable:!0,get:()=>D.composeEventHandlers});Object.defineProperty(exports,"useCallbackRef",{enumerable:!0,get:()=>D.useCallbackRef});Object.defineProperty(exports,"useCollator",{enumerable:!0,get:()=>D.useCollator});Object.defineProperty(exports,"useFilter",{enumerable:!0,get:()=>D.useFilter});exports.AccessibleIcon=Se;exports.Accordion=qo;exports.Alert=Zo;exports.Avatar=ia;exports.Badge=At;exports.BaseLink=Pe;exports.Box=v;exports.Breadcrumbs=Er;exports.Button=rt;exports.Card=Va;exports.CardAction=Zr;exports.CardAsset=Ua;exports.CardBadge=Xa;exports.CardBody=Za;exports.CardCheckbox=rs;exports.CardContent=os;exports.CardHeader=ss;exports.CardSubtitle=cs;exports.CardTimer=is;exports.CardTitle=ls;exports.Carousel=Jr;exports.CarouselActions=Ds;exports.CarouselImage=Es;exports.CarouselInput=Is;exports.CarouselSlide=zs;exports.Checkbox=dt;exports.Combobox=on;exports.ComboboxOption=an;exports.Crumb=Ar;exports.CrumbLink=zr;exports.CrumbSimpleMenu=Yr;exports.DatePicker=wn;exports.DateTimePicker=tl;exports.DesignSystemProvider=fi;exports.Dialog=li;exports.DismissibleLayer=un;exports.Divider=_t;exports.Dots=Ol;exports.EmptyStateLayout=ol;exports.Field=Ts;exports.Flex=C;exports.FocusTrap=hd;exports.Grid=_s;exports.IconButton=ge;exports.IconButtonGroup=$a;exports.JSONInput=il;exports.KeyboardKeys=W;exports.KeyboardNavigable=fd;exports.Link=Wr;exports.LinkButton=cl;exports.LiveRegions=cn;exports.Loader=nt;exports.Main=ul;exports.Menu=Fa;exports.MenuItem=Ha;exports.Modal=Sl;exports.MultiSelect=Nn;exports.MultiSelectGroup=Wn;exports.MultiSelectNested=ic;exports.MultiSelectOption=Ut;exports.NextLink=Al;exports.NumberInput=Tl;exports.PageLink=zl;exports.Pagination=Dl;exports.Popover=Vl;exports.Portal=Ft;exports.PreviousLink=El;exports.ProgressBar=ql;exports.Radio=Jl;exports.RawTable=Dn;exports.RawTbody=zn;exports.RawTd=qt;exports.RawTh=En;exports.RawThead=An;exports.RawTr=Ln;exports.ScrollArea=Qe;exports.SearchForm=Mn;exports.Searchbar=Pn;exports.SimpleMenu=Kr;exports.SingleSelect=vt;exports.SingleSelectOption=kt;exports.SkipToContent=fl;exports.Status=dc;exports.SubNav=hc;exports.SubNavHeader=gc;exports.SubNavLink=pc;exports.SubNavLinkSection=$c;exports.SubNavSection=Cc;exports.SubNavSections=jc;exports.Switch=vc;exports.TFooter=Jc;exports.Table=Hc;exports.Tabs=Mc;exports.Tag=Bn;exports.Tbody=Vc;exports.Td=Qc;exports.TextButton=ed;exports.TextInput=Vn;exports.Textarea=od;exports.Th=Yc;exports.Thead=Uc;exports.TimePicker=Cn;exports.Toggle=id;exports.Tooltip=ct;exports.Tr=Kc;exports.Typography=T;exports.VisuallyHidden=me;exports._internaluseUncontrolledState=Et;exports.composeRefs=zt;exports.convertUTCDateToCalendarDateTime=Ee;exports.darkTheme=bs;exports.extendTheme=xs;exports.extractStyleFromTheme=_e;exports.getThemeSize=$s;exports.handleResponsiveValues=ke;exports.inputFocusStyle=be;exports.isSSR=ln;exports.lightTheme=Mt;exports.setOpacity=Wt;exports.useComposedRefs=te;exports.useControllableState=le;exports.useDateFormatter=ue;exports.useDesignSystem=Xe;exports.useField=ne;exports.useId=re;exports.useIsomorphicLayoutEffect=he;exports.useMeasure=ud;exports.useNotifyAT=di;
|