@fluid-topics/ft-reader-feedback 1.0.53 → 1.0.55
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/build/ft-reader-feedback.js +7 -3
- package/build/ft-reader-feedback.light.js +267 -267
- package/build/ft-reader-feedback.min.js +340 -340
- package/package.json +8 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,
|
|
1
|
+
!function(t,i,e,o,s,n,r){var a=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const h=Symbol("registerInterval");class d extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[h]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[h]):this.dispatchEvent(new l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=h,a([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}const f=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),c={color:f,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",f),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:i.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},p=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),u=p,v=i.FtCssVariableFactory.extend("--ft-ripple-background-color",p),b=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),g=b,x=i.FtCssVariableFactory.extend("--ft-ripple-background-color",b),y=e.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
13
13
|
overflow: hidden;
|
|
14
|
-
border-radius: ${
|
|
14
|
+
border-radius: ${c.borderRadius};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.ft-ripple .ft-ripple--background,
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.ft-ripple .ft-ripple--background {
|
|
24
|
-
background-color: ${
|
|
24
|
+
background-color: ${c.backgroundColor};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.ft-ripple .ft-ripple--effect {
|
|
28
|
-
background-color: ${
|
|
28
|
+
background-color: ${c.color};
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
@@ -73,22 +73,22 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
76
|
-
opacity: ${
|
|
76
|
+
opacity: ${c.opacityContentOnSurfaceHover};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
80
|
-
opacity: ${
|
|
80
|
+
opacity: ${c.opacityContentOnSurfaceSelected};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
84
|
-
opacity: ${
|
|
84
|
+
opacity: ${c.opacityContentOnSurfaceFocused};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
88
|
-
opacity: ${
|
|
88
|
+
opacity: ${c.opacityContentOnSurfacePressed};
|
|
89
89
|
transform: translate(-50%, -50%) scale(1);
|
|
90
90
|
}
|
|
91
|
-
`,m=
|
|
91
|
+
`,m=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),$=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),w={fontFamily:$,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},k={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-title-font-family",m),fontSize:i.FtCssVariableFactory.extend("--ft-typography-title-font-size",w.fontSize,"20px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",w.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",w.letterSpacing,"0.15px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-title-line-height",w.lineHeight,"1.2"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",w.textTransform,"inherit")},S={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",m),fontSize:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",w.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",w.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",w.letterSpacing,"0.105px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",w.lineHeight,"1.7"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",w.textTransform,"inherit")},_=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",$),E=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",w.fontSize,"16px"),I=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",w.fontWeight,"600"),T=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",w.letterSpacing,"0.144px"),R=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",w.lineHeight,"1.5"),O=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",w.textTransform,"inherit"),A=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",$),C=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",w.fontSize,"14px"),N=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",w.fontWeight,"normal"),U=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",w.letterSpacing,"0.098px"),D=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",w.lineHeight,"1.7"),z=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",w.textTransform,"inherit"),B={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",$),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",w.fontSize,"16px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",w.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",w.letterSpacing,"0.496px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",w.lineHeight,"1.5"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",w.textTransform,"inherit")},M=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",$),F=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",w.fontSize,"14px"),L=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",w.fontWeight,"normal"),P=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",w.letterSpacing,"0.252px"),j=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",w.lineHeight,"1.4"),H=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",w.textTransform,"inherit"),Z={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",$),fontSize:i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",w.fontSize,"12px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",w.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",w.letterSpacing,"0.396px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",w.lineHeight,"1.33"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",w.textTransform,"inherit")},K=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",$),V=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",w.fontSize,"10px"),G=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",w.fontWeight,"normal"),W=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",w.letterSpacing,"0.33px"),X=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",w.lineHeight,"1.6"),Y=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",w.textTransform,"inherit"),q=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",$),J=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",w.fontSize,"10px"),Q=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",w.fontWeight,"normal"),tt=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",w.letterSpacing,"1.5px"),it=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",w.lineHeight,"1.6"),et=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",w.textTransform,"uppercase"),ot={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",$),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",w.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",w.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",w.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",w.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",w.textTransform,"uppercase")},st=e.css`
|
|
92
92
|
.ft-typography--title {
|
|
93
93
|
font-family: ${k.fontFamily};
|
|
94
94
|
font-size: ${k.fontSize};
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
line-height: ${k.lineHeight};
|
|
98
98
|
text-transform: ${k.textTransform};
|
|
99
99
|
}
|
|
100
|
-
`,nt=
|
|
100
|
+
`,nt=e.css`
|
|
101
101
|
.ft-typography--title-dense {
|
|
102
102
|
font-family: ${S.fontFamily};
|
|
103
103
|
font-size: ${S.fontSize};
|
|
@@ -106,71 +106,71 @@
|
|
|
106
106
|
line-height: ${S.lineHeight};
|
|
107
107
|
text-transform: ${S.textTransform};
|
|
108
108
|
}
|
|
109
|
-
`,rt=
|
|
109
|
+
`,rt=e.css`
|
|
110
110
|
.ft-typography--subtitle1 {
|
|
111
111
|
font-family: ${_};
|
|
112
|
-
font-size: ${
|
|
113
|
-
font-weight: ${
|
|
114
|
-
letter-spacing: ${
|
|
115
|
-
line-height: ${
|
|
112
|
+
font-size: ${E};
|
|
113
|
+
font-weight: ${I};
|
|
114
|
+
letter-spacing: ${T};
|
|
115
|
+
line-height: ${R};
|
|
116
116
|
text-transform: ${O};
|
|
117
117
|
}
|
|
118
|
-
`,at=
|
|
118
|
+
`,at=e.css`
|
|
119
119
|
.ft-typography--subtitle2 {
|
|
120
|
-
font-family: ${
|
|
121
|
-
font-size: ${
|
|
122
|
-
font-weight: ${
|
|
123
|
-
letter-spacing: ${
|
|
124
|
-
line-height: ${
|
|
125
|
-
text-transform: ${
|
|
120
|
+
font-family: ${A};
|
|
121
|
+
font-size: ${C};
|
|
122
|
+
font-weight: ${N};
|
|
123
|
+
letter-spacing: ${U};
|
|
124
|
+
line-height: ${D};
|
|
125
|
+
text-transform: ${z};
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
`,lt=
|
|
128
|
+
`,lt=e.css`
|
|
129
129
|
.ft-typography--body1 {
|
|
130
|
-
font-family: ${
|
|
131
|
-
font-size: ${
|
|
132
|
-
font-weight: ${
|
|
133
|
-
letter-spacing: ${
|
|
134
|
-
line-height: ${
|
|
135
|
-
text-transform: ${
|
|
136
|
-
}
|
|
137
|
-
`,
|
|
130
|
+
font-family: ${B.fontFamily};
|
|
131
|
+
font-size: ${B.fontSize};
|
|
132
|
+
font-weight: ${B.fontWeight};
|
|
133
|
+
letter-spacing: ${B.letterSpacing};
|
|
134
|
+
line-height: ${B.lineHeight};
|
|
135
|
+
text-transform: ${B.textTransform};
|
|
136
|
+
}
|
|
137
|
+
`,ht=e.css`
|
|
138
138
|
.ft-typography--body2 {
|
|
139
|
-
font-family: ${
|
|
140
|
-
font-size: ${
|
|
141
|
-
font-weight: ${
|
|
142
|
-
letter-spacing: ${
|
|
143
|
-
line-height: ${
|
|
144
|
-
text-transform: ${
|
|
145
|
-
}
|
|
146
|
-
`,
|
|
139
|
+
font-family: ${M};
|
|
140
|
+
font-size: ${F};
|
|
141
|
+
font-weight: ${L};
|
|
142
|
+
letter-spacing: ${P};
|
|
143
|
+
line-height: ${j};
|
|
144
|
+
text-transform: ${H};
|
|
145
|
+
}
|
|
146
|
+
`,dt=e.css`
|
|
147
147
|
.ft-typography--caption {
|
|
148
|
-
font-family: ${
|
|
149
|
-
font-size: ${
|
|
150
|
-
font-weight: ${
|
|
151
|
-
letter-spacing: ${
|
|
152
|
-
line-height: ${
|
|
153
|
-
text-transform: ${
|
|
154
|
-
}
|
|
155
|
-
`,ft=
|
|
148
|
+
font-family: ${Z.fontFamily};
|
|
149
|
+
font-size: ${Z.fontSize};
|
|
150
|
+
font-weight: ${Z.fontWeight};
|
|
151
|
+
letter-spacing: ${Z.letterSpacing};
|
|
152
|
+
line-height: ${Z.lineHeight};
|
|
153
|
+
text-transform: ${Z.textTransform};
|
|
154
|
+
}
|
|
155
|
+
`,ft=e.css`
|
|
156
156
|
.ft-typography--breadcrumb {
|
|
157
|
-
font-family: ${
|
|
157
|
+
font-family: ${K};
|
|
158
158
|
font-size: ${V};
|
|
159
159
|
font-weight: ${G};
|
|
160
|
-
letter-spacing: ${
|
|
161
|
-
line-height: ${
|
|
162
|
-
text-transform: ${
|
|
160
|
+
letter-spacing: ${W};
|
|
161
|
+
line-height: ${X};
|
|
162
|
+
text-transform: ${Y};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,ct=e.css`
|
|
165
165
|
.ft-typography--overline {
|
|
166
|
-
font-family: ${
|
|
166
|
+
font-family: ${q};
|
|
167
167
|
font-size: ${J};
|
|
168
168
|
font-weight: ${Q};
|
|
169
169
|
letter-spacing: ${tt};
|
|
170
|
-
line-height: ${
|
|
171
|
-
text-transform: ${
|
|
170
|
+
line-height: ${it};
|
|
171
|
+
text-transform: ${et};
|
|
172
172
|
}
|
|
173
|
-
`,
|
|
173
|
+
`,pt=e.css`
|
|
174
174
|
.ft-typography--button {
|
|
175
175
|
font-family: ${ot.fontFamily};
|
|
176
176
|
font-size: ${ot.fontSize};
|
|
@@ -179,11 +179,11 @@
|
|
|
179
179
|
line-height: ${ot.lineHeight};
|
|
180
180
|
text-transform: ${ot.textTransform};
|
|
181
181
|
}
|
|
182
|
-
`,ut=
|
|
182
|
+
`,ut=e.css`
|
|
183
183
|
.ft-typography {
|
|
184
184
|
vertical-align: inherit;
|
|
185
185
|
}
|
|
186
|
-
`,vt={color:
|
|
186
|
+
`,vt={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},bt=e.css`
|
|
187
187
|
:host {
|
|
188
188
|
line-height: 0;
|
|
189
189
|
}
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
transform: translate(calc(0.35 * ${vt.size}), 0);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
`,gt={size:
|
|
255
|
+
`,gt={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},xt=e.css`
|
|
256
256
|
:host, i.ft-icon {
|
|
257
257
|
display: inline-flex;
|
|
258
258
|
align-items: center;
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
.ft-icon--material {
|
|
301
301
|
font-family: ${gt.materialFontFamily}, "Material Icons", sans-serif;
|
|
302
302
|
}
|
|
303
|
-
`,yt=
|
|
303
|
+
`,yt=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),mt={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:yt,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",ot.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",yt),verticalPadding:i.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:i.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:i.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},$t=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),wt={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:$t,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",$t)},kt=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),St=i.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),_t=i.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),Et=i.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),It=[e.css`
|
|
304
304
|
:host {
|
|
305
305
|
display: inline-block;
|
|
306
306
|
max-width: 100%;
|
|
@@ -342,8 +342,8 @@
|
|
|
342
342
|
|
|
343
343
|
--ft-button-internal-line-height: max(calc(${mt.fontSize} + 2px), ${mt.iconSize});
|
|
344
344
|
--ft-button-internal-color: ${mt.color};
|
|
345
|
-
${
|
|
346
|
-
${
|
|
345
|
+
${i.setVariable(gt.size,mt.iconSize)};
|
|
346
|
+
${i.setVariable(c.color,mt.rippleColor)};
|
|
347
347
|
|
|
348
348
|
border-radius: ${mt.borderRadius};
|
|
349
349
|
padding: ${mt.verticalPadding} ${mt.horizontalPadding};
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
.ft-button.ft-button--dense {
|
|
361
361
|
padding: ${St} ${_t};
|
|
362
362
|
border-radius: ${kt};
|
|
363
|
-
gap: ${
|
|
363
|
+
gap: ${Et};
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
.ft-button.ft-button--dense.ft-button--outlined {
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
.ft-button.ft-button--primary {
|
|
388
388
|
background-color: ${wt.backgroundColor};
|
|
389
389
|
--ft-button-internal-color: ${wt.color};
|
|
390
|
-
${
|
|
390
|
+
${i.setVariable(c.color,wt.rippleColor)};
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
.ft-button:focus {
|
|
@@ -401,12 +401,12 @@
|
|
|
401
401
|
text-overflow: ellipsis;
|
|
402
402
|
display: block;
|
|
403
403
|
margin: 0 ${mt.iconPadding};
|
|
404
|
-
${
|
|
405
|
-
${
|
|
404
|
+
${i.setVariable(ot.fontSize,"1em")};
|
|
405
|
+
${i.setVariable(ot.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
.ft-button--dense .ft-button--label {
|
|
409
|
-
margin: 0 ${
|
|
409
|
+
margin: 0 ${Et};
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
.ft-button--label[hidden] {
|
|
@@ -434,10 +434,10 @@
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
ft-loader {
|
|
437
|
-
${
|
|
438
|
-
${
|
|
437
|
+
${i.setVariable(vt.size,mt.iconSize)};
|
|
438
|
+
${i.setVariable(vt.color,"var(--ft-button-internal-color)")};
|
|
439
439
|
}
|
|
440
|
-
`,
|
|
440
|
+
`,i.noTextSelect],Tt={textColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceHigh),backgroundColor:i.FtCssVariableFactory.extend("--ft-switch-background-color",i.designSystemVariables.colorSurface),selectedTextColor:i.FtCssVariableFactory.extend("--ft-switch-selected-text-color",i.designSystemVariables.colorPrimary),selectedBackgroundColor:i.FtCssVariableFactory.extend("--ft-switch-selected-background-color",i.designSystemVariables.colorPrimary),borderColor:i.FtCssVariableFactory.extend("--ft-switch-border-color",i.designSystemVariables.colorOutline),borderRadius:i.FtCssVariableFactory.extend("--ft-switch-border-radius",i.designSystemVariables.borderRadiusL),fontSize:i.FtCssVariableFactory.extend("--ft-switch-font-size",ot.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-switch-icon-size","SIZE","24px"),iconColor:i.FtCssVariableFactory.extend("--ft-switch-text-color",i.designSystemVariables.colorOnSurfaceMedium),rippleColor:i.FtCssVariableFactory.extend("--ft-switch-ripple-color",i.designSystemVariables.colorPrimary),outlineColor:i.FtCssVariableFactory.extend("--ft-switch-outline-color",i.designSystemVariables.colorPrimary)},Rt={feedbackInputMinWidth:i.FtCssVariableFactory.create("--ft-reader-feedback-input-min-width","SIZE","300px"),ratedDateColor:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),sendFeedbackColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-color",i.designSystemVariables.colorOnPrimary),sendFeedbackBackgroundColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-send-feedback-background-color",i.designSystemVariables.colorPrimary),filledRatingColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-filled-rating-color",i.designSystemVariables.colorPrimary),emptyRatingColor:i.FtCssVariableFactory.extend("--ft-reader-feedback-empty-rating-color",i.designSystemVariables.colorOnSurfaceMedium),mainTitleFontSize:i.FtCssVariableFactory.external(k.fontSize,"Typography"),sectionTitleFontSize:i.FtCssVariableFactory.external(S.fontSize,"Typography")},Ot=e.css`
|
|
441
441
|
.ft-reader-feedback {
|
|
442
442
|
box-sizing: border-box;
|
|
443
443
|
display: flex;
|
|
@@ -483,14 +483,14 @@
|
|
|
483
483
|
}
|
|
484
484
|
|
|
485
485
|
.ft-reader-feedback--rating {
|
|
486
|
-
${
|
|
487
|
-
${
|
|
488
|
-
${
|
|
489
|
-
${
|
|
486
|
+
${i.setVariable(mt.color,Rt.emptyRatingColor)};
|
|
487
|
+
${i.setVariable(mt.rippleColor,Rt.filledRatingColor)};
|
|
488
|
+
${i.setVariable(Tt.textColor,Rt.emptyRatingColor)};
|
|
489
|
+
${i.setVariable(Tt.selectedTextColor,Rt.filledRatingColor)};
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
.ft-reader-feedback--rating .ft-reader-feedback--active {
|
|
493
|
-
${
|
|
493
|
+
${i.setVariable(mt.color,Rt.filledRatingColor)};
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
.ft-reader-feedback--feedback {
|
|
@@ -498,42 +498,42 @@
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
.ft-reader-feedback--rating-date {
|
|
501
|
-
color: ${
|
|
501
|
+
color: ${Rt.ratedDateColor};
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
.ft-reader-feedback--feedback ft-text-area {
|
|
505
|
-
min-width: ${
|
|
505
|
+
min-width: ${Rt.feedbackInputMinWidth};
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
.ft-reader-feedback--send-feedback, .ft-reader-feedback--feedback-link {
|
|
509
509
|
align-self: flex-end;
|
|
510
|
-
${
|
|
511
|
-
${
|
|
510
|
+
${i.setVariable(mt.color,Rt.sendFeedbackColor)};
|
|
511
|
+
${i.setVariable(mt.backgroundColor,Rt.sendFeedbackBackgroundColor)};
|
|
512
512
|
}
|
|
513
|
-
`
|
|
513
|
+
`;!function(t){!function(i){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function a(t){var i={next:function(){var i=t.shift();return{done:void 0===i,value:i}}};return e.iterable&&(i[Symbol.iterator]=function(){return i}),i}function l(t){this.map={},t instanceof l?t.forEach((function(t,i){this.append(i,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(i){this.append(i,t[i])}),this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(i,e){t.onload=function(){i(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var i=new FileReader,e=d(i);return i.readAsArrayBuffer(t),e}function c(t){if(t.slice)return t.slice(0);var i=new Uint8Array(t.byteLength);return i.set(new Uint8Array(t)),i.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var i;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((i=t)&&DataView.prototype.isPrototypeOf(i))?(this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||s(t))?this._bodyArrayBuffer=c(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,i,e,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,i=new FileReader,e=d(i),i.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var i=new Uint8Array(t),e=new Array(i.length),o=0;o<i.length;o++)e[o]=String.fromCharCode(i[o]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,i){t=n(t),i=r(i);var e=this.map[t];this.map[t]=e?e+", "+i:i},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,i){this.map[n(t)]=r(i)},l.prototype.forEach=function(t,i){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(i,this.map[e],e,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(i,e){t.push(e)})),a(t)},l.prototype.values=function(){var t=[];return this.forEach((function(i){t.push(i)})),a(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(i,e){t.push([e,i])})),a(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,i){var e,o,s=(i=i||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,i.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=i.credentials||this.credentials||"same-origin",!i.headers&&this.headers||(this.headers=new l(i.headers)),this.method=(e=i.method||this.method||"GET",o=e.toUpperCase(),u.indexOf(o)>-1?o:e),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s)}function b(t){var i=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),o=e.shift().replace(/\+/g," "),s=e.join("=").replace(/\+/g," ");i.append(decodeURIComponent(o),decodeURIComponent(s))}})),i}function g(t,i){i||(i={}),this.type="default",this.status=void 0===i.status?200:i.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in i?i.statusText:"OK",this.headers=new l(i.headers),this.url=i.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},p.call(v.prototype),p.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];g.redirect=function(t,i){if(-1===x.indexOf(i))throw new RangeError("Invalid status code");return new g(null,{status:i,headers:{location:t}})},i.DOMException=t.DOMException;try{new i.DOMException}catch(t){i.DOMException=function(t,i){this.message=t,this.name=i;var e=Error(t);this.stack=e.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function y(t,o){return new Promise((function(s,n){var r=new v(t,o);if(r.signal&&r.signal.aborted)return n(new i.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,i,e={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",i=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),o=e.shift().trim();if(o){var s=e.join(":").trim();i.append(o,s)}})),i)};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;s(new g(o,e))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new i.DOMException("Aborted","AbortError"))},a.open(r.method,r.url,!0),"include"===r.credentials?a.withCredentials=!0:"omit"===r.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),r.headers.forEach((function(t,i){a.setRequestHeader(i,t)})),r.signal&&(r.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&r.signal.removeEventListener("abort",h)}),a.send(void 0===r._bodyInit?null:r._bodyInit)}))}y.polyfill=!0,t.fetch||(t.fetch=y,t.Headers=l,t.Request=v,t.Response=g),i.Headers=l,i.Request=v,i.Response=g,i.fetch=y,Object.defineProperty(i,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0);const At=t=>"object"==typeof t&&null!=t,Ct=t=>"string"==typeof t;var Nt,Ut,Dt,zt,Bt,Mt,Ft,Lt,Pt,jt,Ht,Zt;!function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Nt||(Nt={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(Ut||(Ut={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(Dt||(Dt={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(zt||(zt={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Bt||(Bt={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Mt||(Mt={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ft||(Ft={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK"}(Lt||(Lt={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Pt||(Pt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(jt||(jt={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Ht||(Ht={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Zt||(Zt={}));const Kt=t=>At(t)&&(null==t.authenticationIdentifier||(t=>At(t)&&Ct(t.identifier)&&Ct(t.realm))(t.authenticationIdentifier))&&(t=>"number"==typeof t)(t.idleTimeoutInMillis)&&Vt(t.profile)&&(t=>"boolean"==typeof t)(t.sessionAuthenticated),Vt=t=>At(t)&&(null==t.emailAddress||Ct(t.emailAddress))&&(null==t.displayName||Ct(t.displayName))&&Array.isArray(t.roles)&&t.roles.every((t=>(t=>["PERSONAL_BOOK_USER","PERSONAL_BOOK_SHARE_USER","HTML_EXPORT_USER","PDF_EXPORT_USER","SAVED_SEARCH_USER","COLLECTION_USER","OFFLINE_USER","ANALYTICS_USER","BETA_USER","DEBUG_USER","PRINT_USER","RATING_USER","FEEDBACK_USER","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(t))(t)))&&(null==t.userId||Ct(t.userId)),Gt={[Zt.PERSONAL_BOOK_SHARE_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.HTML_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.PDF_EXPORT_USER]:[Zt.PERSONAL_BOOK_USER],[Zt.KHUB_ADMIN]:[Zt.CONTENT_PUBLISHER],[Zt.ADMIN]:[Zt.KHUB_ADMIN,Zt.USERS_ADMIN,Zt.PORTAL_ADMIN],[Zt.DEVELOPER]:[Zt.BETA_USER,Zt.DEBUG_USER]};function Wt(t,i){return t===i||(Gt[t]??[]).some((t=>Wt(t,i)))}function Xt(t,i){return(Kt(t)?t.profile.roles:Vt(t)?t.roles:t).some((t=>Wt(t,i)))}
|
|
514
514
|
/**
|
|
515
515
|
* @license
|
|
516
516
|
* Copyright 2017 Google LLC
|
|
517
517
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
518
|
-
|
|
518
|
+
*/var Yt;const qt=window,Jt=qt.trustedTypes,Qt=Jt?Jt.createPolicy("lit-html",{createHTML:t=>t}):void 0,ti="$lit$",ii=`lit$${(Math.random()+"").slice(9)}$`,ei="?"+ii,oi=`<${ei}>`,si=document,ni=()=>si.createComment(""),ri=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ai=Array.isArray,li="[ \t\n\f\r]",hi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,di=/-->/g,fi=/>/g,ci=RegExp(`>|${li}(?:([^\\s"'>=/]+)(${li}*=${li}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pi=/'/g,ui=/"/g,vi=/^(?:script|style|textarea|title)$/i,bi=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),gi=Symbol.for("lit-noChange"),xi=Symbol.for("lit-nothing"),yi=new WeakMap,mi=si.createTreeWalker(si,129,null,!1),$i=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=hi;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(r.lastIndex=d,l=r.exec(e),null!==l);)d=r.lastIndex,r===hi?"!--"===l[1]?r=di:void 0!==l[1]?r=fi:void 0!==l[2]?(vi.test(l[2])&&(s=RegExp("</"+l[2],"g")),r=ci):void 0!==l[3]&&(r=ci):r===ci?">"===l[0]?(r=null!=s?s:hi,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?ci:'"'===l[3]?ui:pi):r===ui||r===pi?r=ci:r===di||r===fi?r=hi:(r=ci,s=void 0);const f=r===ci&&t[i+1].startsWith("/>")?" ":"";n+=r===hi?e+oi:h>=0?(o.push(a),e.slice(0,h)+ti+e.slice(h)+ii+f):e+ii+(-2===h?(o.push(void 0),i):f)}const a=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Qt?Qt.createHTML(a):a,o]};class wi{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,a=this.parts,[l,h]=$i(t,i);if(this.el=wi.createElement(l,e),mi.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=mi.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith(ti)||i.startsWith(ii)){const e=h[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+ti).split(ii),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?Ii:"?"===i[1]?Ri:"@"===i[1]?Oi:Ei})}else a.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(vi.test(o.tagName)){const t=o.textContent.split(ii),i=t.length-1;if(i>0){o.textContent=Jt?Jt.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],ni()),mi.nextNode(),a.push({type:2,index:++s});o.append(t[i],ni())}}}else if(8===o.nodeType)if(o.data===ei)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(ii,t+1));)a.push({type:7,index:s}),t+=ii.length-1}s++}}static createElement(t,i){const e=si.createElement("template");return e.innerHTML=t,e}}function ki(t,i,e=t,o){var s,n,r,a;if(i===gi)return i;let l=void 0!==o?null===(s=e._$Co)||void 0===s?void 0:s[o]:e._$Cl;const h=ri(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,o)),void 0!==o?(null!==(r=(a=e)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:e._$Cl=l),void 0!==l&&(i=ki(t,l._$AS(t,i.values),l,o)),i}class Si{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:si).importNode(e,!0);mi.currentNode=s;let n=mi.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new _i(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new Ai(n,this,t)),this._$AV.push(i),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=mi.nextNode(),r++)}return s}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class _i{constructor(t,i,e,o){var s;this.type=2,this._$AH=xi,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=ki(this,t,i),ri(t)?t===xi||null==t||""===t?(this._$AH!==xi&&this._$AR(),this._$AH=xi):t!==this._$AH&&t!==gi&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ai(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==xi&&ri(this._$AH)?this._$AA.nextSibling.data=t:this.$(si.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=wi.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.v(e);else{const t=new Si(s,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=yi.get(t.strings);return void 0===i&&yi.set(t.strings,i=new wi(t)),i}T(t){ai(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new _i(this.k(ni()),this.k(ni()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Ei{constructor(t,i,e,o,s){this.type=1,this._$AH=xi,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=xi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=ki(this,t,i,0),n=!ri(t)||t!==this._$AH&&t!==gi,n&&(this._$AH=t);else{const o=t;let r,a;for(t=s[0],r=0;r<s.length-1;r++)a=ki(this,o[e+r],i,r),a===gi&&(a=this._$AH[r]),n||(n=!ri(a)||a!==this._$AH[r]),a===xi?t=xi:t!==xi&&(t+=(null!=a?a:"")+s[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===xi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ii extends Ei{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xi?void 0:t}}const Ti=Jt?Jt.emptyScript:"";class Ri extends Ei{constructor(){super(...arguments),this.type=4}j(t){t&&t!==xi?this.element.setAttribute(this.name,Ti):this.element.removeAttribute(this.name)}}class Oi extends Ei{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=ki(this,t,i,0))&&void 0!==e?e:xi)===gi)return;const o=this._$AH,s=t===xi&&o!==xi||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==xi&&(o===xi||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Ai{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){ki(this,t)}}const Ci=qt.litHtmlPolyfillSupport;null==Ci||Ci(wi,_i),(null!==(Yt=qt.litHtmlVersions)&&void 0!==Yt?Yt:qt.litHtmlVersions=[]).push("2.7.3");
|
|
519
519
|
/**
|
|
520
520
|
* @license
|
|
521
521
|
* Copyright 2020 Google LLC
|
|
522
522
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
523
523
|
*/
|
|
524
|
-
const
|
|
525
|
-
<${
|
|
524
|
+
const Ni=Symbol.for(""),Ui=t=>{if((null==t?void 0:t.r)===Ni)return null==t?void 0:t._$litStatic$},Di=t=>({_$litStatic$:t,r:Ni}),zi=new Map,Bi=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],a=[];let l,h=0,d=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(n=e[h],s=Ui(n));)l+=s+i[++h],d=!0;h!==o&&a.push(n),r.push(l),h++}if(h===o&&r.push(i[o]),d){const t=r.join("$$lit$$");void 0===(i=zi.get(t))&&(r.raw=r,zi.set(t,i=r)),e=a}return t(i,...e)})(bi);var Mi;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Mi||(Mi={}));var Fi,Li,Pi,ji=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Hi extends i.FtLitElement{constructor(){super(...arguments),this.variant=Mi.body1}render(){return this.element?Bi`
|
|
525
|
+
<${Di(this.element)}
|
|
526
526
|
class="ft-typography ft-typography--${this.variant}">
|
|
527
527
|
<slot></slot>
|
|
528
|
-
</${
|
|
529
|
-
`:
|
|
528
|
+
</${Di(this.element)}>
|
|
529
|
+
`:Bi`
|
|
530
530
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
531
|
-
`}}
|
|
531
|
+
`}}Hi.styles=[st,nt,rt,at,lt,ht,dt,ft,ct,pt,ut],ji([o.property()],Hi.prototype,"element",void 0),ji([o.property()],Hi.prototype,"variant",void 0),i.customElement("ft-typography")(Hi),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Fi||(Fi={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Li||(Li={})),new Map([...["abw"].map((t=>[t,Li.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Li.AUDIO])),...["avi"].map((t=>[t,Li.AVI])),...["chm","xhs"].map((t=>[t,Li.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Li.CODE])),...["csv"].map((t=>[t,Li.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Li.DITA])),...["epub"].map((t=>[t,Li.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Li.EXCEL])),...["flac"].map((t=>[t,Li.FLAC])),...["gif"].map((t=>[t,Li.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Li.GZIP])),...["html","htm","xhtml"].map((t=>[t,Li.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Li.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Li.JPEG])),...["json"].map((t=>[t,Li.JSON])),...["m4a","m4p"].map((t=>[t,Li.M4A])),...["mov","qt"].map((t=>[t,Li.MOV])),...["mp3"].map((t=>[t,Li.MP3])),...["mp4","m4v"].map((t=>[t,Li.MP4])),...["ogg","oga"].map((t=>[t,Li.OGG])),...["pdf","ps"].map((t=>[t,Li.PDF])),...["png"].map((t=>[t,Li.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Li.POWERPOINT])),...["rar"].map((t=>[t,Li.RAR])),...["stp"].map((t=>[t,Li.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Li.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Li.VIDEO])),...["wav"].map((t=>[t,Li.WAV])),...["wma"].map((t=>[t,Li.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Li.WORD])),...["xml","xsl","rdf"].map((t=>[t,Li.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Li.YAML])),...["zip"].map((t=>[t,Li.ZIP]))]),function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Pi||(Pi={}));var Zi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ki extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(Pi).includes(this.variant)?this.variant:Pi.fluid_topics,i=t!==Pi.material||!!this.value;return e.html`
|
|
532
532
|
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
533
533
|
${s.unsafeHTML(this.resolvedIcon)}
|
|
534
|
-
<slot ?hidden=${
|
|
534
|
+
<slot ?hidden=${i}></slot>
|
|
535
535
|
</i>
|
|
536
|
-
`}get textContent(){var t,
|
|
536
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case Pi.file_format:this.resolvedIcon=null!==(t=Li[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Pi.material:this.resolvedIcon=this.value||e.nothing;break;default:this.resolvedIcon=null!==(i=Fi[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Ki.elementDefinitions={},Ki.styles=xt,Zi([o.property()],Ki.prototype,"variant",void 0),Zi([o.property()],Ki.prototype,"value",void 0),Zi([o.state()],Ki.prototype,"resolvedIcon",void 0),Zi([o.query("slot")],Ki.prototype,"slottedContent",void 0),i.customElement("ft-icon")(Ki);const Vi=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Gi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),Wi=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Xi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","100"),Yi=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),qi=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Ji=e.css`
|
|
537
537
|
.ft-tooltip--container {
|
|
538
538
|
display: block;
|
|
539
539
|
}
|
|
@@ -548,21 +548,21 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
548
548
|
box-sizing: border-box;
|
|
549
549
|
overflow: hidden;
|
|
550
550
|
width: max-content;
|
|
551
|
-
max-width: ${
|
|
551
|
+
max-width: ${qi};
|
|
552
552
|
text-align: center;
|
|
553
|
-
padding: ${
|
|
554
|
-
z-index: ${
|
|
553
|
+
padding: ${Vi};
|
|
554
|
+
z-index: ${Xi};
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
.ft-tooltip--content {
|
|
558
558
|
padding: 4px 8px;
|
|
559
|
-
border-radius: ${
|
|
560
|
-
background-color: ${
|
|
561
|
-
color: ${
|
|
559
|
+
border-radius: ${Yi};
|
|
560
|
+
background-color: ${Wi};
|
|
561
|
+
color: ${Gi};
|
|
562
562
|
position: relative;
|
|
563
563
|
word-break: break-word;
|
|
564
564
|
}
|
|
565
|
-
`;var
|
|
565
|
+
`;var Qi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class te extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
566
566
|
<div part="container"
|
|
567
567
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
568
568
|
@mouseenter=${this.onHover}
|
|
@@ -580,7 +580,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
580
580
|
</div>
|
|
581
581
|
</div>
|
|
582
582
|
</div>
|
|
583
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((
|
|
583
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=this.tooltip.offsetWidth,e=this.tooltip.offsetHeight,o=(t.offsetHeight-e)/2,s=(t.offsetWidth-i)/2;let n=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-e-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,n=t.offsetLeft+s-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft-i-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,n=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const a=this.tooltip.style;a.left=n+"px",a.top=r+"px";const l=this.tooltip.getBoundingClientRect();let h=-l.x,d=l.x+l.width-window.innerWidth;a.left=n+Math.round(this.correctOutOfWindowPixels(h,d))+"px";let f=-l.y,c=l.y+l.height-window.innerHeight;a.top=r+Math.round(this.correctOutOfWindowPixels(f,c))+"px",a.maxWidth=`max(${t.offsetWidth}px, ${qi})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,i){return Math.max(t,Math.min(0,-i))}}te.elementDefinitions={"ft-typography":Hi},te.styles=Ji,Qi([o.property()],te.prototype,"text",void 0),Qi([o.property({type:Boolean})],te.prototype,"manual",void 0),Qi([o.property({type:Boolean})],te.prototype,"inline",void 0),Qi([o.property({type:Number})],te.prototype,"delay",void 0),Qi([o.property()],te.prototype,"position",void 0),Qi([o.queryAssignedNodes("",!0)],te.prototype,"slotNodes",void 0),Qi([o.query(".ft-tooltip--container")],te.prototype,"container",void 0),Qi([o.query(".ft-tooltip")],te.prototype,"tooltip",void 0),Qi([o.query(".ft-tooltip--content")],te.prototype,"tooltipContent",void 0),Qi([o.state()],te.prototype,"visible",void 0),i.customElement("ft-tooltip")(te);var ie=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ee extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),n=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
584
584
|
<style>
|
|
585
585
|
.ft-ripple .ft-ripple--effect,
|
|
586
586
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -597,7 +597,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
597
597
|
<div class="ft-ripple--background"></div>
|
|
598
598
|
<div class="ft-ripple--effect"></div>
|
|
599
599
|
</div>
|
|
600
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e
|
|
600
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e),this.setRippleSize()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}ee.elementDefinitions={},ee.styles=y,ie([o.property({type:Boolean})],ee.prototype,"primary",void 0),ie([o.property({type:Boolean})],ee.prototype,"secondary",void 0),ie([o.property({type:Boolean})],ee.prototype,"unbounded",void 0),ie([o.property({type:Boolean})],ee.prototype,"activated",void 0),ie([o.property({type:Boolean})],ee.prototype,"selected",void 0),ie([o.property({type:Boolean})],ee.prototype,"disabled",void 0),ie([o.state()],ee.prototype,"hovered",void 0),ie([o.state()],ee.prototype,"focused",void 0),ie([o.state()],ee.prototype,"pressed",void 0),ie([o.state()],ee.prototype,"rippling",void 0),ie([o.state()],ee.prototype,"rippleSize",void 0),ie([o.state()],ee.prototype,"originX",void 0),ie([o.state()],ee.prototype,"originY",void 0),ie([o.query(".ft-ripple")],ee.prototype,"ripple",void 0),ie([o.query(".ft-ripple--effect")],ee.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(ee);const oe={borderRadiusLeft:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left",i.designSystemVariables.borderRadiusL),borderRadiusRight:i.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right",i.designSystemVariables.borderRadiusL),borderWidthLeft:i.FtCssVariableFactory.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:i.FtCssVariableFactory.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:i.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","SIZE","1px")},se=e.css`
|
|
601
601
|
.ft-switch-option {
|
|
602
602
|
position: relative;
|
|
603
603
|
display: inline-block;
|
|
@@ -611,20 +611,20 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
.ft-switch-option--content {
|
|
614
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
615
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
614
|
+
--ft-switch-option-internal-line-height: calc(${Tt.fontSize} + 2px);
|
|
615
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Tt.iconSize});
|
|
616
616
|
|
|
617
617
|
border-style: solid;
|
|
618
|
-
border-color: ${
|
|
619
|
-
border-width: ${
|
|
620
|
-
border-radius: ${
|
|
618
|
+
border-color: ${Tt.borderColor};
|
|
619
|
+
border-width: ${oe.borderWidthVertical} ${oe.borderWidthRight} ${oe.borderWidthVertical} ${oe.borderWidthLeft};
|
|
620
|
+
border-radius: ${oe.borderRadiusLeft} ${oe.borderRadiusRight} ${oe.borderRadiusRight} ${oe.borderRadiusLeft};
|
|
621
621
|
display: flex;
|
|
622
622
|
align-items: center;
|
|
623
623
|
justify-content: center;
|
|
624
624
|
overflow: hidden;
|
|
625
|
-
${
|
|
625
|
+
${i.setVariable(gt.size,Tt.iconSize)};
|
|
626
626
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
627
|
-
background-color: ${
|
|
627
|
+
background-color: ${Tt.backgroundColor};
|
|
628
628
|
-webkit-mask-image: radial-gradient(white, black);
|
|
629
629
|
}
|
|
630
630
|
|
|
@@ -633,28 +633,28 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
633
633
|
}
|
|
634
634
|
|
|
635
635
|
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
636
|
-
background-color: ${
|
|
637
|
-
border-radius: ${
|
|
636
|
+
background-color: ${Tt.selectedBackgroundColor};
|
|
637
|
+
border-radius: ${oe.borderRadiusLeft} ${oe.borderRadiusRight} ${oe.borderRadiusRight} ${oe.borderRadiusLeft};
|
|
638
638
|
position: absolute;
|
|
639
639
|
inset: 0;
|
|
640
640
|
content: "";
|
|
641
641
|
z-index: 1;
|
|
642
|
-
opacity: ${
|
|
642
|
+
opacity: ${i.designSystemVariables.opacityPrimaryOnSurfaceSelected};
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
.ft-switch-option--label {
|
|
646
|
-
color: ${
|
|
646
|
+
color: ${Tt.textColor};
|
|
647
647
|
overflow: hidden;
|
|
648
648
|
white-space: nowrap;
|
|
649
649
|
text-overflow: ellipsis;
|
|
650
650
|
display: block;
|
|
651
651
|
margin: 0 8px;
|
|
652
|
-
${
|
|
653
|
-
${
|
|
652
|
+
${i.setVariable(ot.fontSize,Tt.fontSize)};
|
|
653
|
+
${i.setVariable(ot.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
654
654
|
}
|
|
655
655
|
|
|
656
656
|
.ft-switch-option--selected .ft-switch-option--label {
|
|
657
|
-
color: ${
|
|
657
|
+
color: ${Tt.selectedTextColor};
|
|
658
658
|
}
|
|
659
659
|
|
|
660
660
|
.ft-switch-option--label[hidden] {
|
|
@@ -662,7 +662,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
.ft-switch-option--ripple {
|
|
665
|
-
${
|
|
665
|
+
${i.setVariable(c.color,Tt.rippleColor)};
|
|
666
666
|
}
|
|
667
667
|
|
|
668
668
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -675,20 +675,20 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
675
675
|
|
|
676
676
|
ft-icon {
|
|
677
677
|
flex-shrink: 0;
|
|
678
|
-
color: ${
|
|
678
|
+
color: ${Tt.iconColor};
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
.ft-switch-option--selected ft-icon {
|
|
682
|
-
color: ${
|
|
682
|
+
color: ${Tt.selectedTextColor};
|
|
683
683
|
}
|
|
684
|
-
`;var
|
|
684
|
+
`;var ne=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class re extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class ae extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class le extends i.FtLitElement{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new ae(this.selected))}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(e.html`
|
|
685
685
|
<label part="label" for="input" class=${n.classMap(t)}
|
|
686
686
|
@click=${this.onChange}>
|
|
687
687
|
<div class="ft-switch-option--content">
|
|
688
688
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
689
689
|
<ft-typography part="text"
|
|
690
690
|
variant="button"
|
|
691
|
-
class="ft-switch-option--label ${
|
|
691
|
+
class="ft-switch-option--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
692
692
|
?hidden=${!this.hasTextContent()}>
|
|
693
693
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
694
694
|
</ft-typography>
|
|
@@ -697,29 +697,29 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
697
697
|
</label>
|
|
698
698
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
699
699
|
.checked=${this.selected}>
|
|
700
|
-
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:
|
|
700
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:e.html`
|
|
701
701
|
<ft-tooltip part="tooltip"
|
|
702
702
|
text="${this.getLabel()}"
|
|
703
703
|
position="${this.tooltipPosition}">
|
|
704
704
|
${t}
|
|
705
705
|
</ft-tooltip>
|
|
706
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new
|
|
706
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new re(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
707
707
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
708
|
-
`:
|
|
708
|
+
`:e.nothing}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}le.elementDefinitions={"ft-ripple":ee,"ft-typography":Hi,"ft-tooltip":te,"ft-icon":Ki},le.styles=[i.safariEllipsisFix,se],ne([o.property()],le.prototype,"value",void 0),ne([o.property()],le.prototype,"icon",void 0),ne([o.property()],le.prototype,"iconVariant",void 0),ne([o.property()],le.prototype,"label",void 0),ne([o.property()],le.prototype,"tooltipPosition",void 0),ne([o.property({type:Boolean,reflect:!0})],le.prototype,"selected",void 0),ne([o.property({type:Boolean})],le.prototype,"trailingIcon",void 0),ne([o.property({type:Boolean})],le.prototype,"unselectable",void 0),ne([o.query(".ft-switch-option--content slot")],le.prototype,"slottedContent",void 0),ne([o.query(".ft-switch-option--input")],le.prototype,"input",void 0);var he=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class de extends CustomEvent{constructor(t){super("change",{detail:t})}}class fe extends i.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){super.updated(t),t.has("selectedOption")&&this.updateOptions(),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return e.html`
|
|
709
709
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${n.classMap(t)}">
|
|
710
710
|
<slot @slotchange=${this.onSlotchange}
|
|
711
711
|
@option-change=${this.onOptionChangeByScript}
|
|
712
712
|
@option-change-by-user=${this.onOptionChangeByUser}
|
|
713
713
|
></slot>
|
|
714
714
|
</div>
|
|
715
|
-
`}onKeyDown(t){let
|
|
715
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof le&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChangeByScript(t){t.stopPropagation();let i=t.target;this.onOptionChange(i)}onOptionChangeByUser(t){var i;t.stopPropagation(),this.onOptionChange(t.target),this.dispatchEvent(new de(null===(i=this.selectedOption)||void 0===i?void 0:i.value))}onOptionChange(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}private(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}fe.elementDefinitions={},fe.styles=e.css`
|
|
716
716
|
:host {
|
|
717
717
|
display: inline-block;
|
|
718
718
|
}
|
|
719
719
|
|
|
720
720
|
.ft-switch {
|
|
721
|
-
border-radius: ${
|
|
722
|
-
outline-color: ${
|
|
721
|
+
border-radius: ${Tt.borderRadius};
|
|
722
|
+
outline-color: ${Tt.outlineColor};
|
|
723
723
|
}
|
|
724
724
|
|
|
725
725
|
.ft-switch slot {
|
|
@@ -728,25 +728,25 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
728
728
|
}
|
|
729
729
|
|
|
730
730
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
731
|
-
${
|
|
732
|
-
${
|
|
733
|
-
${
|
|
731
|
+
${i.setVariable(oe.borderRadiusLeft,"0")};
|
|
732
|
+
${i.setVariable(oe.borderRadiusRight,"0")};
|
|
733
|
+
${i.setVariable(oe.borderWidthLeft,"0")};
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
737
|
-
${
|
|
738
|
-
${
|
|
737
|
+
${i.setVariable(oe.borderRadiusLeft,Tt.borderRadius)};
|
|
738
|
+
${i.setVariable(oe.borderWidthLeft,"1px")};
|
|
739
739
|
}
|
|
740
740
|
|
|
741
741
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
742
|
-
${
|
|
742
|
+
${i.setVariable(oe.borderRadiusRight,Tt.borderRadius)};
|
|
743
743
|
}
|
|
744
744
|
|
|
745
745
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
746
746
|
--ft-switch-internal-vertical-padding: 2px;
|
|
747
747
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
748
748
|
}
|
|
749
|
-
`,
|
|
749
|
+
`,he([o.property({type:Boolean})],fe.prototype,"dense",void 0),he([o.property({type:Boolean})],fe.prototype,"unselectable",void 0),he([o.query(".ft-switch slot")],fe.prototype,"slottedContent",void 0),he([o.state()],fe.prototype,"selectedOption",void 0),he([o.query(".ft-switch")],fe.prototype,"ftSwitchDiv",void 0),i.customElement("ft-switch")(fe),i.customElement("ft-switch-option")(le);const ce=i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),pe=i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceMedium,"Design system"),ue=e.css`
|
|
750
750
|
:host {
|
|
751
751
|
display: block;
|
|
752
752
|
}
|
|
@@ -757,17 +757,17 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
757
757
|
|
|
758
758
|
ft-icon {
|
|
759
759
|
transform: rotate(-45deg);
|
|
760
|
-
color: ${
|
|
760
|
+
color: ${ce};
|
|
761
761
|
}
|
|
762
762
|
|
|
763
763
|
.ft-resizer--dragging ft-icon,
|
|
764
764
|
.ft-resizer:hover ft-icon {
|
|
765
|
-
color: ${
|
|
765
|
+
color: ${pe};
|
|
766
766
|
}
|
|
767
|
-
`;var
|
|
767
|
+
`;var ve=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class be extends CustomEvent{constructor(t,i){super("resize",{detail:{width:t,height:i}})}}class ge extends i.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=Pi.material,this.cursor="nwse-resize",this.dragging=!1,this.fixedWidth=0,this.fixedHeight=0,this.startX=0,this.startY=0,this.doDragFromMouse=t=>this.doDrag(t.clientX,t.clientY),this.doDragFromTouch=t=>this.doDrag(t.touches[0].clientX,t.touches[0].clientY),this.stopDrag=()=>{this.dragging=!1,document.removeEventListener("mousemove",this.doDragFromMouse,!1),document.removeEventListener("mouseup",this.stopDrag,!1),document.removeEventListener("touchmove",this.doDragFromTouch,!1),document.removeEventListener("touchend",this.stopDrag,!1),document.removeEventListener("touchcancel",this.stopDrag,!1)}}render(){return e.html`
|
|
768
768
|
<style>
|
|
769
769
|
.ft-resizer {
|
|
770
|
-
cursor: ${
|
|
770
|
+
cursor: ${e.unsafeCSS(this.cursor)}
|
|
771
771
|
}
|
|
772
772
|
</style>
|
|
773
773
|
<div class="ft-resizer ft-no-text-select ${this.dragging?"ft-resizer--dragging":""}"
|
|
@@ -775,25 +775,25 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
775
775
|
@touchstart=${this.initDragFromTouch}>
|
|
776
776
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
777
777
|
</div>
|
|
778
|
-
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,
|
|
778
|
+
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,i){this.dragging=!0,this.startX=t,this.startY=i,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,i){let e=this.fixedWidth+t-this.startX,o=this.fixedHeight+i-this.startY;this.dispatchEvent(new be(e,o))}}ge.elementDefinitions={"ft-icon":Ki},ge.styles=[i.noTextSelect,ue],ve([o.property({type:Number})],ge.prototype,"initialWidth",void 0),ve([o.property({type:Number})],ge.prototype,"initialHeight",void 0),ve([o.property()],ge.prototype,"icon",void 0),ve([o.property()],ge.prototype,"iconVariant",void 0),ve([o.property()],ge.prototype,"cursor",void 0),ve([o.state()],ge.prototype,"dragging",void 0),i.customElement("ft-resizer")(ge);const xe={fontSize:i.FtCssVariableFactory.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:i.FtCssVariableFactory.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:i.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:i.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","SIZE","12px"),labelMaxWidth:i.FtCssVariableFactory.create("--ft-input-label-max-width","SIZE","100%"),borderColor:i.FtCssVariableFactory.extend("--ft-input-label-border-color",i.designSystemVariables.colorOutline),textColor:i.FtCssVariableFactory.extend("--ft-input-label-text-color",i.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:i.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color",i.designSystemVariables.colorOnSurfaceDisabled),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},ye=e.css`
|
|
779
779
|
.ft-input-label {
|
|
780
780
|
position: absolute;
|
|
781
781
|
inset: 0;
|
|
782
782
|
display: flex;
|
|
783
|
-
background-color: ${
|
|
784
|
-
border-radius: ${
|
|
783
|
+
background-color: ${xe.colorSurface};
|
|
784
|
+
border-radius: ${xe.borderRadiusS} ${xe.borderRadiusS} 0 0;
|
|
785
785
|
}
|
|
786
786
|
|
|
787
787
|
.ft-input-label--outlined {
|
|
788
|
-
border-radius: ${
|
|
788
|
+
border-radius: ${xe.borderRadiusS};
|
|
789
789
|
}
|
|
790
790
|
|
|
791
791
|
.ft-input-label {
|
|
792
|
-
border-color: ${
|
|
792
|
+
border-color: ${xe.borderColor};
|
|
793
793
|
}
|
|
794
794
|
|
|
795
795
|
.ft-input-label.ft-input-label--in-error {
|
|
796
|
-
border-color: ${
|
|
796
|
+
border-color: ${xe.colorError}
|
|
797
797
|
}
|
|
798
798
|
|
|
799
799
|
.ft-input-label:before,
|
|
@@ -806,7 +806,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
806
806
|
}
|
|
807
807
|
|
|
808
808
|
.ft-input-label:before {
|
|
809
|
-
width: calc(${
|
|
809
|
+
width: calc(${xe.horizontalSpacing} - 4px);
|
|
810
810
|
flex-shrink: 0;
|
|
811
811
|
}
|
|
812
812
|
|
|
@@ -822,20 +822,20 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
822
822
|
border-bottom-width: 1px;
|
|
823
823
|
border-bottom-style: solid;
|
|
824
824
|
border-color: inherit;
|
|
825
|
-
color: ${
|
|
825
|
+
color: ${xe.textColor};
|
|
826
826
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
827
|
-
max-width: calc(${
|
|
827
|
+
max-width: calc(${xe.labelMaxWidth} - 2 * (${xe.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
828
828
|
text-overflow: ellipsis;
|
|
829
|
-
${
|
|
830
|
-
${
|
|
829
|
+
${i.setVariable(Z.fontSize,xe.fontSize)};
|
|
830
|
+
${i.setVariable(Z.lineHeight,xe.fontSize)};
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
.ft-input-label--in-error .ft-input-label--text {
|
|
834
|
-
color: ${
|
|
834
|
+
color: ${xe.colorError}
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
.ft-input-label--disabled .ft-input-label--text {
|
|
838
|
-
color: ${
|
|
838
|
+
color: ${xe.disabledTextColor};
|
|
839
839
|
}
|
|
840
840
|
|
|
841
841
|
.ft-input-label--hidden-text {
|
|
@@ -852,19 +852,19 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
852
852
|
overflow: hidden;
|
|
853
853
|
white-space: nowrap;
|
|
854
854
|
text-overflow: ellipsis;
|
|
855
|
-
padding: ${
|
|
856
|
-
margin: calc(${
|
|
855
|
+
padding: ${xe.verticalSpacing} 4px;
|
|
856
|
+
margin: calc(${xe.verticalSpacing} * -1) 0;
|
|
857
857
|
max-width: 100%;
|
|
858
858
|
box-sizing: border-box;
|
|
859
859
|
}
|
|
860
860
|
|
|
861
861
|
.ft-input-label--raised .ft-input-label--text {
|
|
862
|
-
${
|
|
863
|
-
${
|
|
862
|
+
${i.setVariable(Z.fontSize,xe.raisedFontSize)};
|
|
863
|
+
${i.setVariable(Z.lineHeight,xe.raisedFontSize)};
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
867
|
-
top: ${
|
|
867
|
+
top: ${xe.verticalSpacing};
|
|
868
868
|
}
|
|
869
869
|
|
|
870
870
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -877,36 +877,36 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
877
877
|
.ft-input-label--outlined:before {
|
|
878
878
|
border-left-width: 1px;
|
|
879
879
|
border-left-style: solid;
|
|
880
|
-
border-radius: ${
|
|
880
|
+
border-radius: ${xe.borderRadiusS} 0 0 ${xe.borderRadiusS};
|
|
881
881
|
}
|
|
882
882
|
|
|
883
883
|
.ft-input-label--outlined:after {
|
|
884
884
|
border-right-width: 1px;
|
|
885
885
|
border-right-style: solid;
|
|
886
|
-
border-radius: 0 ${
|
|
886
|
+
border-radius: 0 ${xe.borderRadiusS} ${xe.borderRadiusS} 0;
|
|
887
887
|
}
|
|
888
888
|
|
|
889
889
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
890
890
|
padding: 2px 4px;
|
|
891
|
-
z-index: ${
|
|
892
|
-
background-color: ${
|
|
893
|
-
border-radius: ${
|
|
891
|
+
z-index: ${xe.raisedZIndex};
|
|
892
|
+
background-color: ${xe.colorSurface};
|
|
893
|
+
border-radius: ${xe.borderRadiusS};
|
|
894
894
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
895
895
|
}
|
|
896
896
|
|
|
897
897
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
898
898
|
border-top: none;
|
|
899
899
|
}
|
|
900
|
-
`;var
|
|
900
|
+
`;var me=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class $e extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return e.html`
|
|
901
901
|
<div class="${n.classMap(t)}">
|
|
902
|
-
${this.text?
|
|
902
|
+
${this.text?e.html`
|
|
903
903
|
<div class="ft-input-label--text ft-typography--caption">
|
|
904
904
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
905
905
|
<span class="ft-input-label--hidden-text" aria-hidden="true">${this.text}</span>
|
|
906
906
|
</div>
|
|
907
907
|
`:null}
|
|
908
908
|
</div>
|
|
909
|
-
`}}
|
|
909
|
+
`}}$e.elementDefinitions={},$e.styles=[dt,ye],me([o.property({type:String})],$e.prototype,"text",void 0),me([o.property({type:Boolean})],$e.prototype,"raised",void 0),me([o.property({type:Boolean})],$e.prototype,"outlined",void 0),me([o.property({type:Boolean})],$e.prototype,"disabled",void 0),me([o.property({type:Boolean})],$e.prototype,"error",void 0),i.customElement("ft-input-label")($e);const we={fontSize:i.FtCssVariableFactory.create("--ft-text-area-font-size","SIZE","14px"),labelSize:i.FtCssVariableFactory.create("--ft-text-area-label-size","SIZE","11px"),verticalSpacing:i.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","SIZE","16px"),helperColor:i.FtCssVariableFactory.extend("--ft-text-area-helper-color",i.designSystemVariables.colorOnSurfaceMedium),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system")},ke=e.css`
|
|
910
910
|
*:focus {
|
|
911
911
|
outline: none;
|
|
912
912
|
}
|
|
@@ -918,10 +918,10 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
ft-input-label {
|
|
921
|
-
${
|
|
922
|
-
${
|
|
923
|
-
${
|
|
924
|
-
${
|
|
921
|
+
${i.setVariable(xe.fontSize,we.fontSize)};
|
|
922
|
+
${i.setVariable(xe.raisedFontSize,we.labelSize)};
|
|
923
|
+
${i.setVariable(xe.verticalSpacing,we.verticalSpacing)};
|
|
924
|
+
${i.setVariable(xe.horizontalSpacing,we.horizontalSpacing)};
|
|
925
925
|
}
|
|
926
926
|
|
|
927
927
|
.ft-text-area--main-panel {
|
|
@@ -939,8 +939,8 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
939
939
|
}
|
|
940
940
|
|
|
941
941
|
.ft-text-area--input-panel ft-ripple {
|
|
942
|
-
${
|
|
943
|
-
${
|
|
942
|
+
${i.setVariable(c.opacityContentOnSurfaceHover,"0.08")};
|
|
943
|
+
${i.setVariable(c.opacityContentOnSurfacePressed,"0.04")};
|
|
944
944
|
}
|
|
945
945
|
|
|
946
946
|
.ft-text-area--input {
|
|
@@ -952,12 +952,12 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
952
952
|
align-self: stretch;
|
|
953
953
|
resize: none;
|
|
954
954
|
|
|
955
|
-
${
|
|
956
|
-
${
|
|
957
|
-
color: ${
|
|
955
|
+
${i.setVariable(B.fontSize,we.fontSize)};
|
|
956
|
+
${i.setVariable(B.lineHeight,we.fontSize)};
|
|
957
|
+
color: ${we.colorOnSurface};
|
|
958
958
|
|
|
959
|
-
padding: 0 ${
|
|
960
|
-
margin: calc(${
|
|
959
|
+
padding: 0 ${we.horizontalSpacing};
|
|
960
|
+
margin: calc(${we.verticalSpacing} + ${we.labelSize} / 2) 0 ${we.verticalSpacing} 0;
|
|
961
961
|
|
|
962
962
|
border: none;
|
|
963
963
|
background: none;
|
|
@@ -966,7 +966,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
966
966
|
}
|
|
967
967
|
|
|
968
968
|
.ft-text-area--disabled .ft-text-area--input {
|
|
969
|
-
color: ${
|
|
969
|
+
color: ${we.colorOnSurfaceDisabled};
|
|
970
970
|
}
|
|
971
971
|
|
|
972
972
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -974,42 +974,42 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
977
|
-
${
|
|
978
|
-
${
|
|
977
|
+
${i.setVariable(xe.borderColor,we.colorPrimary)};
|
|
978
|
+
${i.setVariable(xe.textColor,we.colorPrimary)};
|
|
979
979
|
}
|
|
980
980
|
|
|
981
981
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
982
|
-
border-radius: ${
|
|
982
|
+
border-radius: ${we.borderRadiusS} ${we.borderRadiusS} 0 0;
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
986
986
|
align-self: stretch;
|
|
987
|
-
margin-bottom: ${
|
|
988
|
-
margin-top: calc(${
|
|
987
|
+
margin-bottom: ${we.verticalSpacing};
|
|
988
|
+
margin-top: calc(${we.labelSize} + 2 * ${we.verticalSpacing});
|
|
989
989
|
}
|
|
990
990
|
|
|
991
991
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
992
|
-
border-radius: ${
|
|
992
|
+
border-radius: ${we.borderRadiusS};
|
|
993
993
|
}
|
|
994
994
|
|
|
995
995
|
.ft-text-area--helper-text {
|
|
996
|
-
padding: 0 12px 0 ${
|
|
997
|
-
color: ${
|
|
996
|
+
padding: 0 12px 0 ${we.horizontalSpacing};
|
|
997
|
+
color: ${we.helperColor};
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
1000
|
.ft-text-area--in-error .ft-text-area--input,
|
|
1001
1001
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
1002
|
-
color: ${
|
|
1002
|
+
color: ${we.colorError};
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
1005
|
ft-resizer {
|
|
1006
1006
|
position: absolute;
|
|
1007
1007
|
bottom: 0;
|
|
1008
1008
|
}
|
|
1009
|
-
`;var
|
|
1009
|
+
`;var Se=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class _e extends i.FtLitElement{constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return e.html`
|
|
1010
1010
|
<style>
|
|
1011
1011
|
.ft-text-area--main-panel {
|
|
1012
|
-
height: calc(4 * ${
|
|
1012
|
+
height: calc(4 * ${we.verticalSpacing} + ${we.labelSize} + ${we.fontSize} + ${this.height}px);
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
1015
|
ft-resizer {
|
|
@@ -1026,7 +1026,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1026
1026
|
></ft-input-label>
|
|
1027
1027
|
<div class="ft-text-area--input-panel"
|
|
1028
1028
|
aria-label="${this.label}">
|
|
1029
|
-
${this.outlined?null:
|
|
1029
|
+
${this.outlined?null:e.html`
|
|
1030
1030
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1031
1031
|
`}
|
|
1032
1032
|
<textarea class="ft-typography--body1 ft-text-area--input"
|
|
@@ -1043,19 +1043,19 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1043
1043
|
initialHeight="${this.height}"
|
|
1044
1044
|
cursor="ns-resize"></ft-resizer>
|
|
1045
1045
|
</div>
|
|
1046
|
-
${this.helper?
|
|
1046
|
+
${this.helper?e.html`
|
|
1047
1047
|
<ft-typography class="ft-text-area--helper-text" variant="caption">
|
|
1048
1048
|
${this.helper}
|
|
1049
1049
|
</ft-typography>`:void 0}
|
|
1050
1050
|
</div>
|
|
1051
|
-
`}setValue(t,
|
|
1051
|
+
`}setValue(t,i=!1){this.value=t,i&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}_e.elementDefinitions={"ft-input-label":$e,"ft-resizer":ge,"ft-ripple":ee,"ft-typography":Hi},_e.styles=[lt,ke],Se([o.property({type:String})],_e.prototype,"label",void 0),Se([o.property({reflect:!0})],_e.prototype,"value",void 0),Se([o.property({type:String})],_e.prototype,"helper",void 0),Se([o.property({type:Boolean})],_e.prototype,"outlined",void 0),Se([o.property({type:Boolean})],_e.prototype,"disabled",void 0),Se([o.property({type:Boolean})],_e.prototype,"error",void 0),Se([o.property({type:Number,reflect:!0})],_e.prototype,"height",void 0),Se([o.query("textarea")],_e.prototype,"textarea",void 0),Se([o.state()],_e.prototype,"focused",void 0),i.customElement("ft-text-area")(_e);class Ee extends i.FtLitElement{render(){return e.html`
|
|
1052
1052
|
<div class="ft-loader">
|
|
1053
1053
|
<div></div>
|
|
1054
1054
|
<div></div>
|
|
1055
1055
|
<div></div>
|
|
1056
1056
|
<div></div>
|
|
1057
1057
|
</div>
|
|
1058
|
-
`}}
|
|
1058
|
+
`}}Ee.styles=bt,i.customElement("ft-loader")(Ee);var Ie=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Te extends i.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
1059
1059
|
<button part="button"
|
|
1060
1060
|
class="${n.classMap(t)}"
|
|
1061
1061
|
aria-label="${this.getLabel()}"
|
|
@@ -1064,29 +1064,29 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1064
1064
|
<ft-typography part="label"
|
|
1065
1065
|
variant="button"
|
|
1066
1066
|
element="span"
|
|
1067
|
-
class="ft-button--label ${
|
|
1067
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
1068
1068
|
?hidden=${!this.hasTextContent()}>
|
|
1069
1069
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
1070
1070
|
</ft-typography>
|
|
1071
1071
|
${this.resolveIcon()}
|
|
1072
1072
|
</button>
|
|
1073
|
-
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?
|
|
1073
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
1074
1074
|
<ft-tooltip part="tooltip"
|
|
1075
1075
|
text="${this.getLabel()}"
|
|
1076
1076
|
position="${this.tooltipPosition}">
|
|
1077
1077
|
${t}
|
|
1078
1078
|
</ft-tooltip>
|
|
1079
|
-
`:t}resolveIcon(){return this.loading?
|
|
1080
|
-
<ft-loader part="loader icon"></ft-loader> `:this.icon?
|
|
1081
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:
|
|
1082
|
-
`,
|
|
1083
|
-
`,
|
|
1079
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
1080
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
1081
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Te.elementDefinitions={"ft-ripple":ee,"ft-tooltip":te,"ft-typography":Hi,"ft-icon":Ki,"ft-loader":Ee},Te.styles=[i.safariEllipsisFix,It],Ie([o.property({type:String,reflect:!0})],Te.prototype,"role",void 0),Ie([o.property({type:Boolean})],Te.prototype,"primary",void 0),Ie([o.property({type:Boolean})],Te.prototype,"outlined",void 0),Ie([o.property({type:Boolean})],Te.prototype,"disabled",void 0),Ie([o.property({type:Boolean})],Te.prototype,"dense",void 0),Ie([o.property({type:Boolean})],Te.prototype,"round",void 0),Ie([o.property()],Te.prototype,"label",void 0),Ie([o.property()],Te.prototype,"icon",void 0),Ie([o.property()],Te.prototype,"iconVariant",void 0),Ie([o.property({type:Boolean})],Te.prototype,"trailingIcon",void 0),Ie([o.property({type:Boolean})],Te.prototype,"loading",void 0),Ie([o.property()],Te.prototype,"tooltipPosition",void 0),Ie([o.property({type:Boolean})],Te.prototype,"hideTooltip",void 0),Ie([o.property({type:Boolean})],Te.prototype,"forceTooltip",void 0),Ie([o.query(".ft-button")],Te.prototype,"button",void 0),Ie([o.query(".ft-button--label slot")],Te.prototype,"slottedContent",void 0),i.customElement("ft-button")(Te);const Re=e.css`
|
|
1082
|
+
`,Oe=e.css`
|
|
1083
|
+
`,Ae=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Ce{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Ae.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?Ce.build(t):null!==(i=Ce.API)&&void 0!==i?i:Ce.API=Ce.build()}static await(t){return new Promise((i=>{let e=Ce.get(t);if(e)i(e);else{const o=Ae.subscribe((()=>{e=Ce.get(t),e&&(o(),i(e))}))}}))}}var Ne;const Ue=Symbol("clearAfterUnitTest");class De{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ne]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Ae.getState().uiLocale,Ae.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ae.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const s={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],s)||(this.defaultMessages[t]=s,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var s,n,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(s=this.cache.getNow(t))||void 0===s?void 0:s.messages)&&void 0!==n?n:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}Ne=Ue,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new De((async(t,i)=>(await Ce.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new De((async(t,i)=>(await Ce.await()).getCustomMessageContext(t,i))));const ze=window.FluidTopicsI18nService,Be=window.FluidTopicsCustomI18nService;var Me=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Fe extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Ce.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
1084
1084
|
<slot></slot>
|
|
1085
|
-
`}updated(t){super.updated(t),t.has("baseUrl")&&
|
|
1085
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&Ae.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Ae.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ae.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Ae.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Ae.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Ae.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Ae.actions.setSession(this.session),t.has("availableUiLocales")&&Ae.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>ze.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}Fe.elementDefinitions={},Fe.styles=Oe,Me([o.property()],Fe.prototype,"baseUrl",void 0),Me([o.property()],Fe.prototype,"apiIntegrationIdentifier",void 0),Me([o.property()],Fe.prototype,"uiLocale",void 0),Me([i.jsonProperty([])],Fe.prototype,"availableUiLocales",void 0),Me([o.property({type:Boolean})],Fe.prototype,"editorMode",void 0),Me([o.property({type:Boolean})],Fe.prototype,"noCustom",void 0),Me([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Fe.prototype,"noCustomComponent",void 0),Me([o.property({type:Boolean})],Fe.prototype,"withManualResources",void 0),Me([i.jsonProperty([])],Fe.prototype,"messageContexts",void 0),Me([i.jsonProperty(void 0)],Fe.prototype,"session",void 0),Me([o.property({type:Object})],Fe.prototype,"apiProvider",void 0);class Le{async listMySearches(){var t;return(null===(t=Ae.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ce.await()).listMySearches(Ae.getState().session.profile.userId):[]}}const Pe=new i.CacheRegistry;class je{async listMyBookmarks(){return Pe.get("bookmarks",(async()=>(await Ce.await()).listMyBookmarks(Ae.getState().session.profile.userId)))}clearCache(){Pe.clear("bookmarks")}}const He=i.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Ae.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new je,Ae.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ae.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){He.actions.savedSearches(void 0)}clearMyBookmarks(){He.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Le,i=await t.listMySearches();He.actions.savedSearches(i)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;He.actions.bookmarks(i)}}},i.customElement("ft-app-context")(Fe);var Ze=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const Ke=Symbol("i18nProperties"),Ve=Symbol("i18nUnsubs");function Ge(t){var i;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[i]=new Map}get i18nService(){return this.useCustomMessageContexts?Be:ze}i18n(t,i,...e){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,i,...e);const s=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...s)}onI18nUpdate(t){var i;null===(i=this[Ke])||void 0===i||i.forEach(((i,e)=>{i.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(i))})),setTimeout((()=>this.requestUpdate()),0)}updated(t){var i;super.updated(t),null===(i=this[Ke])||void 0===i||i.forEach(((t,i)=>{null!=t.argsProvider&&(this[i]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Ke]&&new Set([...this[Ke].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,i){t=t.toLowerCase(),this[Ve].has(t)||this[Ve].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=i?i:{})}addI18nContext(t,i){this.addI18nMessages(t.name,i)}disconnectedCallback(){super.disconnectedCallback(),this[Ve].forEach((t=>t())),this[Ve].clear()}}return i=Ve,Ze([o.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class We extends(Ge(i.FtLitElement)){}class Xe extends(Ge(i.FtLitElementRedux)){}var Ye=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class qe extends Xe{constructor(){super(),this.editorMode=!1,this.addStore(Ae)}render(){return this.key&&this.context?e.html`
|
|
1086
1086
|
<span class="ft-i18n">
|
|
1087
1087
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1088
1088
|
</span>
|
|
1089
|
-
`:this.editorMode?"Select a context and a label key.":
|
|
1089
|
+
`:this.editorMode?"Select a context and a label key.":e.nothing}update(t){super.update(t),this.context&&this.key&&this.defaultMessage&&this.addI18nMessages(this.context,{[this.key]:this.defaultMessage})}}qe.elementDefinitions={},qe.styles=Re,Ye([i.redux()],qe.prototype,"editorMode",void 0),Ye([o.property()],qe.prototype,"context",void 0),Ye([o.property()],qe.prototype,"key",void 0),Ye([i.jsonProperty([])],qe.prototype,"args",void 0),Ye([o.property()],qe.prototype,"defaultMessage",void 0);class Je{static build(t){return new Je(t)}static fromGwt(t){return new Je(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,i)=>{const e=i;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,i)=>(...t)=>ze.resolveMessage(this.name,i,...t)})}}const Qe=(t,i)=>(e,o)=>{var s,n;e.constructor.createProperty(o,null!=i?i:{attribute:!1,type:String});const r={...t,key:null!==(s=t.key)&&void 0!==s?s:o};e[Ke]=null!==(n=e[Ke])&&void 0!==n?n:new Map,e[Ke].set(o,r)};i.customElement("ft-i18n")(qe);const to=Je.build("integratedFeedbackComponent"),io={starsRating:"{0} stars","starsRating[\\=1]":"1 star",like:"Like",dislike:"Dislike",dichotomousYes:"Yes",dichotomousNo:"No",notRated:"Not rated",ratedNow:"Rated now",ratedToday:"Rated today",ratedOn:"Rated on {0, date}",feedbackInputLabel:"How can we improve it?",feedbackfromEmail:"Your email",feedbackfromEmailInvalid:"Please enter a valid email address",okButton:"Send feedback",cancelButton:"Cancel",feedbackSuccess:"Feedback successfully sent. Thank you!",feedbackFailure:"Failed to send feedback. Please try again later.",ratingSuccess:"Rating successfully sent. Thank you!",ratingFailure:"Failed to send rating. Please try again later.",mapFeedbackMainTitle:"Send feedback",mapRatingSectionTitle:"Rate this document",mapDichotomousRatingSectionTitle:"Did it solve your problem?",mapFeedbackSectionTitle:"Write your review",topicFeedbackMainTitle:"Send feedback",topicRatingSectionTitle:"Rate this content",topicDichotomousRatingSectionTitle:"Did this content solve your problem?",topicFeedbackSectionTitle:"Write your review"},eo=Je.build("inDesignerFeedbackComponent"),oo={ratingNotConfigured:"Rating unavailable: no rating configured for this content.",missingRatingRole:"Rating unavailable: missing role RATING_USER.",missingFeedbackRole:"Feedback unavailable: missing role FEEDBACK_USER.",inDesignerOnlyNotice:"This notice will not appear outside this designer.",feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."},so={fontSize:i.FtCssVariableFactory.create("--ft-text-field-font-size","SIZE","14px"),labelSize:i.FtCssVariableFactory.create("--ft-text-field-label-size","SIZE","11px"),verticalSpacing:i.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","SIZE","4px"),horizontalSpacing:i.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","SIZE","16px"),helperColor:i.FtCssVariableFactory.extend("--ft-text-field-helper-color",i.designSystemVariables.colorOnSurfaceMedium),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),colorError:i.FtCssVariableFactory.external(i.designSystemVariables.colorError,"Design system"),prefixColor:i.FtCssVariableFactory.extend("--ft-text-field-prefix-color",i.designSystemVariables.colorOnSurfaceMedium),iconColor:i.FtCssVariableFactory.extend("--ft-text-field-icon-color",i.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:i.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","NUMBER","3"),colorSurface:i.FtCssVariableFactory.external(i.designSystemVariables.colorSurface,"Design system"),colorOutline:i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),elevation02:i.FtCssVariableFactory.external(i.designSystemVariables.elevation02,"Design system"),suggestSize:i.FtCssVariableFactory.create("--ft-text-field-suggest-size","SIZE","300px")},no=e.css`
|
|
1090
1090
|
*:focus {
|
|
1091
1091
|
outline: none;
|
|
1092
1092
|
}
|
|
@@ -1099,16 +1099,16 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
ft-input-label {
|
|
1102
|
-
${
|
|
1103
|
-
${
|
|
1104
|
-
${
|
|
1105
|
-
${
|
|
1102
|
+
${i.setVariable(xe.fontSize,so.fontSize)};
|
|
1103
|
+
${i.setVariable(xe.raisedFontSize,so.labelSize)};
|
|
1104
|
+
${i.setVariable(xe.verticalSpacing,so.verticalSpacing)};
|
|
1105
|
+
${i.setVariable(xe.horizontalSpacing,so.horizontalSpacing)};
|
|
1106
1106
|
}
|
|
1107
1107
|
|
|
1108
1108
|
.ft-text-field--main-panel {
|
|
1109
1109
|
position: relative;
|
|
1110
1110
|
display: flex;
|
|
1111
|
-
height: calc(4 * ${
|
|
1111
|
+
height: calc(4 * ${so.verticalSpacing} + ${so.labelSize} + ${so.fontSize});
|
|
1112
1112
|
}
|
|
1113
1113
|
|
|
1114
1114
|
.ft-text-field--input-panel {
|
|
@@ -1117,24 +1117,24 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1117
1117
|
display: flex;
|
|
1118
1118
|
align-items: center;
|
|
1119
1119
|
overflow: hidden;
|
|
1120
|
-
padding: 0 ${
|
|
1120
|
+
padding: 0 ${so.horizontalSpacing};
|
|
1121
1121
|
|
|
1122
|
-
${
|
|
1123
|
-
${
|
|
1122
|
+
${i.setVariable(B.fontSize,so.fontSize)};
|
|
1123
|
+
${i.setVariable(B.lineHeight,so.fontSize)};
|
|
1124
1124
|
}
|
|
1125
1125
|
|
|
1126
1126
|
.ft-text-field--input-panel ft-ripple {
|
|
1127
|
-
${
|
|
1128
|
-
${
|
|
1127
|
+
${i.setVariable(c.opacityContentOnSurfaceHover,"0.08")};
|
|
1128
|
+
${i.setVariable(c.opacityContentOnSurfacePressed,"0.04")};
|
|
1129
1129
|
}
|
|
1130
1130
|
|
|
1131
1131
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
1132
1132
|
align-items: flex-end;
|
|
1133
|
-
padding: 0 ${
|
|
1133
|
+
padding: 0 ${so.horizontalSpacing} ${so.verticalSpacing} ${so.horizontalSpacing};
|
|
1134
1134
|
}
|
|
1135
1135
|
|
|
1136
1136
|
.ft-text-field--prefix {
|
|
1137
|
-
color: ${
|
|
1137
|
+
color: ${so.prefixColor};
|
|
1138
1138
|
margin-right: 2px;
|
|
1139
1139
|
flex-shrink: 1;
|
|
1140
1140
|
overflow: hidden;
|
|
@@ -1153,15 +1153,15 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1153
1153
|
flex-shrink: 1;
|
|
1154
1154
|
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
1155
1155
|
|
|
1156
|
-
color: ${
|
|
1157
|
-
padding: calc(2 * ${
|
|
1156
|
+
color: ${so.colorOnSurface};
|
|
1157
|
+
padding: calc(2 * ${so.verticalSpacing}) 0;
|
|
1158
1158
|
border: none;
|
|
1159
1159
|
background: none;
|
|
1160
1160
|
}
|
|
1161
1161
|
|
|
1162
1162
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
|
|
1163
1163
|
padding-bottom: 0;
|
|
1164
|
-
padding-top: calc(${
|
|
1164
|
+
padding-top: calc(${so.labelSize} + 2 * ${so.verticalSpacing});
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
1167
|
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
@@ -1170,37 +1170,37 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
1172
|
.ft-text-field--disabled .ft-text-field--input {
|
|
1173
|
-
color: ${
|
|
1173
|
+
color: ${so.colorOnSurfaceDisabled};
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
1176
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
1177
|
-
${
|
|
1178
|
-
${
|
|
1177
|
+
${i.setVariable(xe.borderColor,so.colorPrimary)};
|
|
1178
|
+
${i.setVariable(xe.textColor,so.colorPrimary)};
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
1181
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
1182
|
-
border-radius: ${
|
|
1182
|
+
border-radius: ${so.borderRadiusS} ${so.borderRadiusS} 0 0;
|
|
1183
1183
|
}
|
|
1184
1184
|
|
|
1185
1185
|
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
1186
|
-
border-radius: ${
|
|
1186
|
+
border-radius: ${so.borderRadiusS};
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
.ft-text-field--helper-text {
|
|
1190
|
-
padding: 0 12px 0 ${
|
|
1191
|
-
color: ${
|
|
1190
|
+
padding: 0 12px 0 ${so.horizontalSpacing};
|
|
1191
|
+
color: ${so.helperColor};
|
|
1192
1192
|
}
|
|
1193
1193
|
|
|
1194
1194
|
.ft-text-field--in-error .ft-text-field--input,
|
|
1195
1195
|
.ft-text-field--in-error .ft-text-field--helper-text,
|
|
1196
1196
|
.ft-text-field--in-error .ft-text-field--prefix {
|
|
1197
|
-
color: ${
|
|
1197
|
+
color: ${so.colorError};
|
|
1198
1198
|
}
|
|
1199
1199
|
|
|
1200
1200
|
.ft-text-field--icon {
|
|
1201
1201
|
align-self: center;
|
|
1202
1202
|
margin-left: 8px;
|
|
1203
|
-
color: ${
|
|
1203
|
+
color: ${so.iconColor};
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
1206
|
.ft-text-field--container {
|
|
@@ -1213,13 +1213,13 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1213
1213
|
position: absolute;
|
|
1214
1214
|
left: 0;
|
|
1215
1215
|
right: 0;
|
|
1216
|
-
z-index: ${
|
|
1217
|
-
background: ${
|
|
1218
|
-
border: 1px solid ${
|
|
1219
|
-
border-radius: 0 0 ${
|
|
1220
|
-
box-shadow: ${
|
|
1216
|
+
z-index: ${so.floatingZIndex};
|
|
1217
|
+
background: ${so.colorSurface};
|
|
1218
|
+
border: 1px solid ${so.colorOutline};
|
|
1219
|
+
border-radius: 0 0 ${so.borderRadiusS} ${so.borderRadiusS};
|
|
1220
|
+
box-shadow: ${so.elevation02};
|
|
1221
1221
|
outline: none;
|
|
1222
|
-
max-height: ${
|
|
1222
|
+
max-height: ${so.suggestSize};
|
|
1223
1223
|
overflow-y: auto;
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
@@ -1236,13 +1236,13 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
1238
|
.ft-text-field--with-icon {
|
|
1239
|
-
${
|
|
1239
|
+
${i.setVariable(xe.labelMaxWidth,`calc(100% - ${gt.size} - ${xe.horizontalSpacing})`)};
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
.ft-text-field--with-password ft-icon:hover {
|
|
1243
1243
|
cursor: pointer;
|
|
1244
1244
|
}
|
|
1245
|
-
`;var
|
|
1245
|
+
`;var ro=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ao extends i.FtLitElement{constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Fi.EYE_SLASH,this.passwordRevealedIcon=Fi.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const i=this._value;this._value=t||"",this.requestUpdate("value",i)}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.password};return e.html`
|
|
1246
1246
|
<div class="${n.classMap(t)}">
|
|
1247
1247
|
<div class="ft-text-field--main-panel"
|
|
1248
1248
|
@keydown=${this.handleKeyboardNavigation}
|
|
@@ -1253,16 +1253,16 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1253
1253
|
?raised=${this.focused||""!=this.value}
|
|
1254
1254
|
?error=${this.error}></ft-input-label>
|
|
1255
1255
|
<div class="ft-text-field--input-panel">
|
|
1256
|
-
${this.outlined?
|
|
1256
|
+
${this.outlined?e.nothing:e.html`
|
|
1257
1257
|
<ft-ripple ?disabled=${this.disabled} activated></ft-ripple>
|
|
1258
1258
|
`}
|
|
1259
|
-
${this.prefix?
|
|
1259
|
+
${this.prefix?e.html`
|
|
1260
1260
|
<ft-typography class="ft-text-field--prefix" vaiant="body1">
|
|
1261
1261
|
${this.prefix}
|
|
1262
1262
|
</ft-typography>
|
|
1263
|
-
`:
|
|
1263
|
+
`:e.nothing}
|
|
1264
1264
|
<input type=${this.password&&this.hidePassword?"password":"text"}
|
|
1265
|
-
maxlength=${(t=>null!=t?t:
|
|
1265
|
+
maxlength=${(t=>null!=t?t:xi)(this.maxLength||void 0)}
|
|
1266
1266
|
aria-label="${this.label}"
|
|
1267
1267
|
class="ft-typography--body1 ft-text-field--input"
|
|
1268
1268
|
?disabled=${this.disabled}
|
|
@@ -1277,23 +1277,23 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1277
1277
|
<slot @slotchange=${()=>this.filterSuggestionsIfNeeded()}></slot>
|
|
1278
1278
|
</div>
|
|
1279
1279
|
</div>
|
|
1280
|
-
${this.helper?
|
|
1280
|
+
${this.helper?e.html`
|
|
1281
1281
|
<ft-typography class="ft-text-field--helper-text" variant="caption">
|
|
1282
1282
|
${this.helper}
|
|
1283
1283
|
</ft-typography>
|
|
1284
|
-
`:
|
|
1284
|
+
`:e.nothing}
|
|
1285
1285
|
</div>
|
|
1286
|
-
`}renderPasswordIcon(){return
|
|
1286
|
+
`}renderPasswordIcon(){return e.html`
|
|
1287
1287
|
<ft-icon class="ft-text-field--icon"
|
|
1288
1288
|
.variant=${this.iconVariant}
|
|
1289
1289
|
.value=${this.hidePassword?this.passwordHiddenIcon:this.passwordRevealedIcon}
|
|
1290
1290
|
@click=${()=>this.togglePasswordVisibility()}></ft-icon>
|
|
1291
|
-
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?
|
|
1291
|
+
`}renderIcon(){return this.password?this.renderPasswordIcon():this.icon?e.html`
|
|
1292
1292
|
<ft-icon class="ft-text-field--icon"
|
|
1293
1293
|
.variant=${this.iconVariant}
|
|
1294
1294
|
.value=${this.icon}
|
|
1295
1295
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
1296
|
-
`:
|
|
1296
|
+
`:e.nothing}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var i,e;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(i=this.input)||void 0===i?void 0:i.getBoundingClientRect(),o=null===(e=this.suggestionsContainer)||void 0===e?void 0:e.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,i=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),i&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var i;const e=(null===(i=this.input)||void 0===i?void 0:i.value)||"";this.setValue(e,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var i;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const e=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?e<this.visibleSuggestions.length-1?e+1:0:e>0?e-1:this.visibleSuggestions.length-1,null===(i=this.visibleSuggestions[o])||void 0===i||i.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var i;this.setValue(t.detail,!0),null===(i=this.input)||void 0===i||i.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,i;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(i=this.input)||void 0===i?void 0:i.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}ao.elementDefinitions={"ft-input-label":$e,"ft-ripple":ee,"ft-typography":Hi,"ft-icon":Ki},ao.styles=[lt,no],ro([o.property()],ao.prototype,"label",void 0),ro([o.property({noAccessor:!0})],ao.prototype,"value",null),ro([o.state()],ao.prototype,"dispatchedValue",void 0),ro([o.property()],ao.prototype,"helper",void 0),ro([o.property({type:Boolean})],ao.prototype,"outlined",void 0),ro([o.property({type:Boolean})],ao.prototype,"disabled",void 0),ro([o.property({type:Boolean})],ao.prototype,"error",void 0),ro([o.property()],ao.prototype,"prefix",void 0),ro([o.property()],ao.prototype,"icon",void 0),ro([o.property()],ao.prototype,"passwordHiddenIcon",void 0),ro([o.property()],ao.prototype,"passwordRevealedIcon",void 0),ro([o.property()],ao.prototype,"iconVariant",void 0),ro([o.property({type:Boolean})],ao.prototype,"filterSuggestions",void 0),ro([o.property({type:Number})],ao.prototype,"maxLength",void 0),ro([o.property({type:Boolean})],ao.prototype,"password",void 0),ro([o.state()],ao.prototype,"focused",void 0),ro([o.state()],ao.prototype,"hidePassword",void 0),ro([o.state()],ao.prototype,"suggestionsOnTop",void 0),ro([o.state()],ao.prototype,"hideSuggestions",void 0),ro([o.state()],ao.prototype,"visibleSuggestions",void 0),ro([o.query(".ft-text-field--main-panel")],ao.prototype,"mainPanel",void 0),ro([o.query(".ft-text-field--input")],ao.prototype,"input",void 0),ro([o.query(".ft-text-field--suggestions")],ao.prototype,"suggestionsContainer",void 0),ro([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],ao.prototype,"suggestions",void 0);const lo=e.css`
|
|
1297
1297
|
.ft-text-field-suggestion {
|
|
1298
1298
|
position: relative;
|
|
1299
1299
|
padding: 8px 16px;
|
|
@@ -1318,7 +1318,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1318
1318
|
slot {
|
|
1319
1319
|
pointer-events: none;
|
|
1320
1320
|
}
|
|
1321
|
-
`;var
|
|
1321
|
+
`;var ho,fo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class co extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class po extends i.FtLitElement{render(){return e.html`
|
|
1322
1322
|
<div class="ft-text-field-suggestion"
|
|
1323
1323
|
tabindex="-1"
|
|
1324
1324
|
@keydown=${this.onKeyDown}
|
|
@@ -1330,9 +1330,9 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1330
1330
|
<slot></slot>
|
|
1331
1331
|
</ft-typography>
|
|
1332
1332
|
</div>
|
|
1333
|
-
`}focus(t){var
|
|
1333
|
+
`}focus(t){var i;null===(i=this.container)||void 0===i||i.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new co(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}po.elementDefinitions={"ft-ripple":ee,"ft-typography":Hi,"ft-icon":Ki},po.styles=lo,fo([o.property()],po.prototype,"value",void 0),fo([o.query(".ft-text-field-suggestion")],po.prototype,"container",void 0),fo([o.queryAssignedNodes()],po.prototype,"assignedNodes",void 0),i.customElement("ft-text-field")(ao),i.customElement("ft-text-field-suggestion")(po),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(ho||(ho={}));var uo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class vo extends(Ge(d)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(to,io),this.addI18nContext(eo,oo)}get canAccessFeedback(){var t;return this.user&&Xt(this.user.roles,"FEEDBACK_USER")&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.FEEDBACK))}get canAccessRating(){var t;return this.userHasRatingRole&&"NO_RATING"!==this.configuredRatingType&&(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(ho.RATING))}get userHasRatingRole(){return this.user&&Xt(this.user.roles,"RATING_USER")}get configuredRatingType(){var t,i;return null!==(i=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==i?i:"NO_RATING"}get ratingType(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.type)&&void 0!==e?e:"NO_RATING"}get ratingValue(){var t,i,e;return null!==(e=null===(i=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===i?void 0:i.value)&&void 0!==e?e:-1}get ratingDate(){var t,e;const o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.date;return"string"==typeof o?i.parseDate(o):o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?e.html`
|
|
1334
1334
|
<div class="ft-reader-feedback">
|
|
1335
|
-
${this.hideTitle?
|
|
1335
|
+
${this.hideTitle?e.nothing:e.html`
|
|
1336
1336
|
<ft-typography variant="title" part="main-title">
|
|
1337
1337
|
${this.i18n(this.i18nProperties.feedbackMainTitle)}
|
|
1338
1338
|
</ft-typography>
|
|
@@ -1340,7 +1340,7 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1340
1340
|
${this.renderRatingSection()}
|
|
1341
1341
|
${this.renderFeedbackSection()}
|
|
1342
1342
|
</div>
|
|
1343
|
-
`:
|
|
1343
|
+
`:e.nothing}renderRatingSection(){return this.canAccessRating?e.html`
|
|
1344
1344
|
<div class="ft-reader-feedback--rating" part="rating-container">
|
|
1345
1345
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1346
1346
|
${this.i18n("DICHOTOMOUS"===this.ratingSummary.type?this.i18nProperties.dichotomousRatingSectionTitle:this.i18nProperties.ratingSectionTitle)}
|
|
@@ -1350,11 +1350,11 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1350
1350
|
${this.renderRatingDate()}
|
|
1351
1351
|
</ft-typography>
|
|
1352
1352
|
</div>
|
|
1353
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1353
|
+
`:this.placeholderInEditor(this.userHasRatingRole?eo.messages.ratingNotConfigured():eo.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return to.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return to.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?to.messages.ratedToday():to.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return e.html`
|
|
1354
1354
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1355
|
-
${r.repeat(new Array(5),((t,
|
|
1355
|
+
${r.repeat(new Array(5),((t,i)=>i),((t,i)=>{let o="STARS"===this.ratingType&&this.ratingValue>i;const s=i+1;return e.html`
|
|
1356
1356
|
<ft-button round part="rating-stars-${s}"
|
|
1357
|
-
label="${
|
|
1357
|
+
label="${to.messages.starsRating(s)}"
|
|
1358
1358
|
tooltipPosition="top"
|
|
1359
1359
|
.iconVariant=${this.iconVariant}
|
|
1360
1360
|
icon="${o?this.filledStarIcon:this.emptyStarIcon}"
|
|
@@ -1363,78 +1363,78 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1363
1363
|
></ft-button>
|
|
1364
1364
|
`}))}
|
|
1365
1365
|
</div>
|
|
1366
|
-
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,
|
|
1366
|
+
`;case"LIKE":const t="LIKE"===this.ratingType&&0===this.ratingValue,i="LIKE"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1367
1367
|
<ft-switch unselectable
|
|
1368
1368
|
@change=${t=>this.rate(t.detail)}
|
|
1369
1369
|
part="rating rating-like">
|
|
1370
1370
|
<ft-switch-option .value=${1}
|
|
1371
|
-
?selected=${
|
|
1371
|
+
?selected=${i}
|
|
1372
1372
|
.iconVariant=${this.iconVariant}
|
|
1373
|
-
icon="${
|
|
1374
|
-
${
|
|
1373
|
+
icon="${i?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1374
|
+
${to.messages.like()}
|
|
1375
1375
|
</ft-switch-option>
|
|
1376
1376
|
<ft-switch-option .value=${0}
|
|
1377
1377
|
?selected=${t}
|
|
1378
1378
|
.iconVariant=${this.iconVariant}
|
|
1379
1379
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1380
|
-
${
|
|
1380
|
+
${to.messages.dislike()}
|
|
1381
1381
|
</ft-switch-option>
|
|
1382
1382
|
</ft-switch>
|
|
1383
|
-
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return
|
|
1383
|
+
`;case"DICHOTOMOUS":const o="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,s="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return e.html`
|
|
1384
1384
|
<ft-switch unselectable
|
|
1385
1385
|
@change=${t=>this.rate(t.detail)}
|
|
1386
1386
|
part="rating rating-dichotomous">
|
|
1387
1387
|
<ft-switch-option .value=${1}
|
|
1388
1388
|
?selected=${s}>
|
|
1389
|
-
${
|
|
1389
|
+
${to.messages.dichotomousYes()}
|
|
1390
1390
|
</ft-switch-option>
|
|
1391
1391
|
<ft-switch-option .value=${0}
|
|
1392
1392
|
?selected=${o}>
|
|
1393
|
-
${
|
|
1393
|
+
${to.messages.dichotomousNo()}
|
|
1394
1394
|
</ft-switch-option>
|
|
1395
1395
|
</ft-switch>
|
|
1396
|
-
`}return
|
|
1396
|
+
`}return e.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,i;if(this.canAccessFeedback){const o=this.feedbackMailLinkBuilder(this.feedbackMessage);let s=e.html`
|
|
1397
1397
|
<ft-button primary
|
|
1398
1398
|
class="ft-reader-feedback--send-feedback"
|
|
1399
1399
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
1400
1400
|
@click=${()=>o?this.onMailerFeedbackSent():this.sendFeedback()}
|
|
1401
1401
|
part="send-feedback">
|
|
1402
|
-
${
|
|
1402
|
+
${to.messages.okButton()}
|
|
1403
1403
|
</ft-button>
|
|
1404
|
-
`;return o&&(s=
|
|
1404
|
+
`;return o&&(s=e.html`
|
|
1405
1405
|
<a class="ft-reader-feedback--feedback-link" href="${o}">
|
|
1406
1406
|
${s}
|
|
1407
1407
|
</a>
|
|
1408
|
-
`),
|
|
1408
|
+
`),e.html`
|
|
1409
1409
|
<div class="ft-reader-feedback--feedback" part="feedback-container">
|
|
1410
1410
|
<ft-typography variant="title-dense" part="section-title" class="ft-reader-feedback--section-title">
|
|
1411
1411
|
${this.i18n(this.i18nProperties.feedbackSectionTitle)}
|
|
1412
1412
|
</ft-typography>
|
|
1413
|
-
${null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(
|
|
1413
|
+
${null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers)?e.html`
|
|
1414
1414
|
<ft-text-field
|
|
1415
1415
|
class="ft-reader-feedback--from-input"
|
|
1416
|
-
label=${
|
|
1416
|
+
label=${to.messages.feedbackfromEmail()}
|
|
1417
1417
|
@live-change=${t=>this.from=t.detail.trim()}
|
|
1418
1418
|
?error=${this.from&&!this.validFromEmail()}
|
|
1419
|
-
helper=${this.from&&!this.validFromEmail()?
|
|
1419
|
+
helper=${this.from&&!this.validFromEmail()?to.messages.feedbackfromEmailInvalid():""}
|
|
1420
1420
|
/>
|
|
1421
|
-
`:
|
|
1421
|
+
`:e.nothing}
|
|
1422
1422
|
<ft-text-area outlined
|
|
1423
1423
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1424
|
-
label="${
|
|
1424
|
+
label="${to.messages.feedbackInputLabel()}"
|
|
1425
1425
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1426
1426
|
></ft-text-area>
|
|
1427
1427
|
${s}
|
|
1428
1428
|
</div>
|
|
1429
|
-
`}return this.placeholderInEditor(
|
|
1429
|
+
`}return this.placeholderInEditor(eo.messages.missingFeedbackRole())}validFromEmail(){var t,i;return!(null==(null===(t=this.user)||void 0===t?void 0:t.userId)&&(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?e.html`
|
|
1430
1430
|
<div class="ft-reader-feedback--placeholder">
|
|
1431
1431
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1432
1432
|
<ft-tooltip position="left"
|
|
1433
|
-
text="${
|
|
1433
|
+
text="${eo.messages.inDesignerOnlyNotice()}">
|
|
1434
1434
|
<ft-icon>INFO</ft-icon>
|
|
1435
1435
|
</ft-tooltip>
|
|
1436
1436
|
</div>
|
|
1437
|
-
`:
|
|
1437
|
+
`:e.nothing}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}vo.elementDefinitions={"ft-button":Te,"ft-typography":Hi,"ft-icon":Ki,"ft-tooltip":te,"ft-switch":fe,"ft-switch-option":le,"ft-text-area":_e,"ft-text-field":ao},vo.styles=Ot,uo([o.property({type:Boolean})],vo.prototype,"editorMode",void 0),uo([o.property({type:Boolean})],vo.prototype,"hideTitle",void 0),uo([o.property({type:Boolean})],vo.prototype,"ratingAllowed",void 0),uo([o.property({attribute:!1})],vo.prototype,"i18nProperties",void 0),uo([o.property({attribute:!1})],vo.prototype,"ratingSummary",void 0),uo([o.property({attribute:!1})],vo.prototype,"user",void 0),uo([o.query(".ft-reader-feedback--feedback-input")],vo.prototype,"feedbackInput",void 0),uo([o.state()],vo.prototype,"from",void 0),uo([o.state()],vo.prototype,"feedbackMessage",void 0),uo([o.property()],vo.prototype,"iconVariant",void 0),uo([o.property()],vo.prototype,"emptyStarIcon",void 0),uo([o.property()],vo.prototype,"filledStarIcon",void 0),uo([o.property()],vo.prototype,"emptyLikeIcon",void 0),uo([o.property()],vo.prototype,"filledLikeIcon",void 0),uo([o.property()],vo.prototype,"emptyDislikeIcon",void 0),uo([o.property()],vo.prototype,"filledDislikeIcon",void 0),uo([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],vo.prototype,"configuration",void 0),uo([o.property()],vo.prototype,"feedbackMailLinkBuilder",void 0);const bo=Je.fromGwt("server");class go{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,i,e,o,s){var n;this.subject=t,this.url=i,this.configuration=o,this.isAuthenticated=s,this.subjectMetadata=this.filterMetadata(e,o.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(e,null!==(n=o.bodyMetadataIds)&&void 0!==n?n:[]).map((t=>"["+t.values.join(", ")+"]")).join(" ")}filterMetadata(t,i){return i.map((i=>t.find((t=>t.key===i)))).filter((t=>null!=t&&t.values.length>0))}build(t){var i,e,o;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopics))||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers))return;const s=encodeURIComponent(this.subject+" "+this.subjectMetadata),n=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${bo.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(o=this.configuration)||void 0===o?void 0:o.recipients.join(",")}?subject=${s}&body=${n}`}}var xo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class yo extends(Ge(d)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=Pi.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new go,this.i18nProperties={feedbackMainTitle:to.properties.mapFeedbackMainTitle(),ratingSectionTitle:to.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:to.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:to.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new i.Debouncer(100),this.sendRatingDebouncer=new i.Debouncer(500),this.addStore(Ae)}render(){return this.map&&(this.editorMode||this.componentVisible)?e.html`
|
|
1438
1438
|
<ft-reader-feedback
|
|
1439
1439
|
ratingAllowed
|
|
1440
1440
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1454,13 +1454,13 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1454
1454
|
@send-feedback=${this.sendFeedback}
|
|
1455
1455
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1456
1456
|
></ft-reader-feedback>
|
|
1457
|
-
`:
|
|
1457
|
+
`:e.html`
|
|
1458
1458
|
<style>
|
|
1459
1459
|
:host {
|
|
1460
1460
|
display: none !important;
|
|
1461
1461
|
}
|
|
1462
1462
|
</style>
|
|
1463
|
-
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,
|
|
1463
|
+
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var i,e,o;super.updated(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((i=>t.has(i)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink())&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,i;this.map&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,o,s;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateMap()):await(null===(o=this.service)||void 0===o?void 0:o.rateMap(null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:to.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{this.editorMode?this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(e=this.service)||void 0===e?void 0:e.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:to.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:to.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}yo.elementDefinitions={"ft-reader-feedback":vo},xo([i.redux({store:Ae.name,selector:t=>{var i;return null===(i=t.session)||void 0===i?void 0:i.profile}})],yo.prototype,"user",void 0),xo([i.redux({store:"reader"})],yo.prototype,"map",void 0),xo([i.redux({store:Ae.name})],yo.prototype,"editorMode",void 0),xo([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],yo.prototype,"configuration",void 0),xo([o.state()],yo.prototype,"ratingSummary",void 0),xo([o.property({type:Boolean})],yo.prototype,"hideTitle",void 0),xo([o.property()],yo.prototype,"iconVariant",void 0),xo([o.property()],yo.prototype,"emptyStarIcon",void 0),xo([o.property()],yo.prototype,"filledStarIcon",void 0),xo([o.property()],yo.prototype,"emptyLikeIcon",void 0),xo([o.property()],yo.prototype,"filledLikeIcon",void 0),xo([o.property()],yo.prototype,"emptyDislikeIcon",void 0),xo([o.property()],yo.prototype,"filledDislikeIcon",void 0),xo([o.query("ft-reader-feedback")],yo.prototype,"readerFeedback",void 0),xo([Qe(bo.properties["mail.map_feedback.subject"]((t=>{var i;return[null===(i=t.map)||void 0===i?void 0:i.title]})))],yo.prototype,"mailSubject",void 0);var mo=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class $o extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const wo=Symbol("registerInterval");class ko extends(function(t){var i;class e extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[i]=0}connectedCallback(){super.connectedCallback(),this[wo]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[wo]):this.dispatchEvent(new $o)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return i=wo,mo([o.state()],e.prototype,"tocNode",void 0),mo([o.state()],e.prototype,"disableContextInteractions",void 0),e}(d)){}var So=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class _o extends(Ge(ko)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=Pi.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new go,this.i18nProperties={feedbackMainTitle:to.properties.topicFeedbackMainTitle(),ratingSectionTitle:to.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:to.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:to.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new i.Debouncer(100),this.sendRatingDebouncer=new i.Debouncer(500),this.addStore(Ae)}render(){return this.map&&this.tocNode&&(this.editorMode||this.componentVisible)?e.html`
|
|
1464
1464
|
<ft-reader-feedback
|
|
1465
1465
|
.i18nProperties=${this.i18nProperties}
|
|
1466
1466
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1480,10 +1480,10 @@ const ue=Symbol.for(""),ve=t=>{if((null==t?void 0:t.r)===ue)return null==t?void
|
|
|
1480
1480
|
@send-feedback=${this.sendFeedback}
|
|
1481
1481
|
@mailer-feedback=${this.onMailerFeedbackSent}
|
|
1482
1482
|
></ft-reader-feedback>
|
|
1483
|
-
`:
|
|
1483
|
+
`:e.html`
|
|
1484
1484
|
<style>
|
|
1485
1485
|
:host {
|
|
1486
1486
|
display: none !important;
|
|
1487
1487
|
}
|
|
1488
1488
|
</style>
|
|
1489
|
-
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var e,
|
|
1489
|
+
`}get componentVisible(){var t;return!!this.user&&this.user.roles.includes("FEEDBACK_USER")||!!this.user&&this.user.roles.includes("RATING_USER")&&"NO_RATING"!==(null===(t=this.ratingSummary)||void 0===t?void 0:t.type)}updated(t){var i,e,o;super.updated(t),["tocNode","user"].some((i=>t.has(i)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((i=>t.has(i)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(e=null===(i=this.service)||void 0===i?void 0:i.getLink(this.tocNode.tocId))&&void 0!==e?e:"",this.map.metadata,this.configuration,null!=(null===(o=this.user)||void 0===o?void 0:o.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,i;this.tocNode&&((null===(t=this.user)||void 0===t?void 0:t.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,o,s;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateTopic(this.tocNode.tocId)):await(null===(o=this.service)||void 0===o?void 0:o.rateTopic(this.tocNode.tocId,null===(s=this.ratingSummary)||void 0===s?void 0:s.type,t))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:to.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{!this.editorMode&&this.tocNode?(await(null===(e=this.service)||void 0===e?void 0:e.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:to.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new i.FtNotificationEvent({type:"info",message:eo.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new i.FtNotificationEvent({type:"error",message:to.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}_o.elementDefinitions={"ft-reader-feedback":vo},So([i.redux({store:Ae.name,selector:t=>{var i;return null===(i=t.session)||void 0===i?void 0:i.profile}})],_o.prototype,"user",void 0),So([i.redux({store:"reader"})],_o.prototype,"map",void 0),So([i.redux({store:Ae.name})],_o.prototype,"editorMode",void 0),So([i.redux({store:"reader",selector:t=>{var i;return null===(i=t.configuration)||void 0===i?void 0:i.feedback}})],_o.prototype,"configuration",void 0),So([o.state()],_o.prototype,"ratingSummary",void 0),So([o.property({type:Boolean})],_o.prototype,"hideTitle",void 0),So([o.property()],_o.prototype,"iconVariant",void 0),So([o.property()],_o.prototype,"emptyStarIcon",void 0),So([o.property()],_o.prototype,"filledStarIcon",void 0),So([o.property()],_o.prototype,"emptyLikeIcon",void 0),So([o.property()],_o.prototype,"filledLikeIcon",void 0),So([o.property()],_o.prototype,"emptyDislikeIcon",void 0),So([o.property()],_o.prototype,"filledDislikeIcon",void 0),So([o.query("ft-reader-feedback")],_o.prototype,"readerFeedback",void 0),So([Qe(bo.properties["mail.feedback.subject"]((t=>{var i,e;return[null===(i=t.tocNode)||void 0===i?void 0:i.title,null===(e=t.map)||void 0===e?void 0:e.title]})))],_o.prototype,"mailSubject",void 0),i.customElement("ft-reader-map-feedback")(yo),i.customElement("ft-reader-topic-feedback")(_o),t.FtReaderFeedbackCssVariables=Rt,t.FtReaderMapFeedback=yo,t.FtReaderTopicFeedback=_o,t.styles=Ot}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
|