@magicfeedback/popup-sdk 1.21.1 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/2.2.44-HO4Z2OYX.mjs +2421 -0
  3. package/dist/2.2.44-HO4Z2OYX.mjs.map +1 -0
  4. package/dist/2.2.44-NTG36TY5.mjs +2421 -0
  5. package/dist/2.2.44-NTG36TY5.mjs.map +1 -0
  6. package/dist/assets/assets/style.css +113 -36
  7. package/dist/assets/assets/survey-css/2.2.44.css +2413 -0
  8. package/dist/{chunk-NNWYOG43.mjs → chunk-36KEHE2P.mjs} +265 -40
  9. package/dist/chunk-36KEHE2P.mjs.map +1 -0
  10. package/dist/{chunk-4C3DSMUT.mjs → chunk-4MUHUL7W.mjs} +265 -40
  11. package/dist/chunk-4MUHUL7W.mjs.map +1 -0
  12. package/dist/{chunk-7KMBH25G.mjs → chunk-7PVEXIUG.mjs} +265 -40
  13. package/dist/chunk-7PVEXIUG.mjs.map +1 -0
  14. package/dist/index.d.mts +28 -1
  15. package/dist/index.d.ts +28 -1
  16. package/dist/index.js +4316 -1465
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +75 -26
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/index.native.d.mts +28 -1
  21. package/dist/index.native.d.ts +28 -1
  22. package/dist/index.native.js +4316 -1465
  23. package/dist/index.native.js.map +1 -1
  24. package/dist/index.native.mjs +75 -26
  25. package/dist/index.native.mjs.map +1 -1
  26. package/dist/react-native.d.mts +22 -0
  27. package/dist/react-native.d.ts +22 -0
  28. package/dist/react-native.js +2956 -229
  29. package/dist/react-native.js.map +1 -1
  30. package/dist/react-native.mjs +75 -26
  31. package/dist/react-native.mjs.map +1 -1
  32. package/dist/renderPopup-5VVYPKXP.mjs +3998 -0
  33. package/dist/renderPopup-5VVYPKXP.mjs.map +1 -0
  34. package/dist/{renderPopup-IKPXPDB7.mjs → renderPopup-I3LIC3W3.mjs} +67 -40
  35. package/dist/renderPopup-I3LIC3W3.mjs.map +1 -0
  36. package/dist/renderPopup-VS5XFGTI.mjs +3998 -0
  37. package/dist/renderPopup-VS5XFGTI.mjs.map +1 -0
  38. package/package.json +2 -2
  39. package/dist/chunk-4C3DSMUT.mjs.map +0 -1
  40. package/dist/chunk-7KMBH25G.mjs.map +0 -1
  41. package/dist/chunk-NNWYOG43.mjs.map +0 -1
  42. package/dist/renderPopup-IKPXPDB7.mjs.map +0 -1
  43. package/dist/renderPopup-M5ZIXNV6.mjs +0 -3847
  44. package/dist/renderPopup-M5ZIXNV6.mjs.map +0 -1
  45. package/dist/renderPopup-QVMBE4L4.mjs +0 -3847
  46. package/dist/renderPopup-QVMBE4L4.mjs.map +0 -1
@@ -33,12 +33,166 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
+ // src/ui/chromeContrast.ts
37
+ function chromePalette(dark) {
38
+ return {
39
+ popupBg: dark ? "#1e1e1e" : "#fff",
40
+ colorScheme: dark ? "dark" : "light",
41
+ textPrimary: dark ? "#f0f0f0" : "#111",
42
+ closeBtnHoverColor: dark ? "#fff" : "#000000",
43
+ textMuted: dark ? "#9ca3af" : "#6b7280",
44
+ progressTrack: dark ? "#3f3f46" : "#e5e7eb"
45
+ };
46
+ }
47
+ function parseColor(value) {
48
+ const v = (value ?? "").trim();
49
+ const hex = HEX.exec(v);
50
+ if (hex) {
51
+ let h = hex[1];
52
+ if (h.length <= 4) h = h.split("").map((c) => c + c).join("");
53
+ return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];
54
+ }
55
+ const rgb = RGB.exec(v);
56
+ if (rgb) {
57
+ const parts = [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])];
58
+ if (parts.every((n) => n <= 255)) return parts;
59
+ }
60
+ return null;
61
+ }
62
+ function relativeLuminance([r, g, b]) {
63
+ const lin = (c) => {
64
+ const s = c / 255;
65
+ return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
66
+ };
67
+ return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
68
+ }
69
+ function isDarkBackground(color) {
70
+ const rgb = parseColor(color);
71
+ return rgb ? relativeLuminance(rgb) < DARK_THRESHOLD : null;
72
+ }
73
+ var HEX, RGB, DARK_THRESHOLD, CHROME_CONTRAST_JS;
74
+ var init_chromeContrast = __esm({
75
+ "src/ui/chromeContrast.ts"() {
76
+ "use strict";
77
+ HEX = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
78
+ RGB = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*[\d.]+\s*)?\)$/i;
79
+ DARK_THRESHOLD = 0.2;
80
+ CHROME_CONTRAST_JS = `
81
+ function ddIsDarkBackground(value){
82
+ var v=(value||'').trim();
83
+ var rgb=null;
84
+ var hex=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(v);
85
+ if(hex){
86
+ var h=hex[1];
87
+ if(h.length<=4){ var e=''; for(var i=0;i<h.length;i++){ e+=h.charAt(i)+h.charAt(i); } h=e; }
88
+ rgb=[parseInt(h.slice(0,2),16),parseInt(h.slice(2,4),16),parseInt(h.slice(4,6),16)];
89
+ } else {
90
+ var m=/^rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*[\\d.]+\\s*)?\\)$/i.exec(v);
91
+ if(m && +m[1]<=255 && +m[2]<=255 && +m[3]<=255){ rgb=[+m[1],+m[2],+m[3]]; }
92
+ }
93
+ if(!rgb){ return null; }
94
+ var lin=function(c){ var s=c/255; return s<=0.03928 ? s/12.92 : Math.pow((s+0.055)/1.055,2.4); };
95
+ var l=0.2126*lin(rgb[0])+0.7152*lin(rgb[1])+0.0722*lin(rgb[2]);
96
+ return l<${DARK_THRESHOLD};
97
+ }
98
+ function ddChromePalette(dark){
99
+ return {
100
+ colorScheme: dark?'dark':'light',
101
+ textPrimary: dark?'#f0f0f0':'#111',
102
+ closeBtnHoverColor: dark?'#fff':'#000000',
103
+ textMuted: dark?'#9ca3af':'#6b7280',
104
+ progressTrack: dark?'#3f3f46':'#e5e7eb'
105
+ };
106
+ }`;
107
+ }
108
+ });
109
+
110
+ // src/ui/appearance.ts
111
+ function resolveForcedMode(appearance, systemDark) {
112
+ if (appearance === "light" || appearance === "dark") return appearance;
113
+ if (appearance === "system") return systemDark ? "dark" : "light";
114
+ return null;
115
+ }
116
+ function systemPrefersDark() {
117
+ try {
118
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
119
+ } catch {
120
+ return false;
121
+ }
122
+ }
123
+ function normalizeAppearance(value) {
124
+ return value === "system" || value === "light" || value === "dark" ? value : void 0;
125
+ }
126
+ function chromeColors(style, theme, forced) {
127
+ const box = style?.boxBackgroundColor || null;
128
+ const darkBlock = style?.dark || null;
129
+ let background;
130
+ if (forced === "dark") {
131
+ if (isDark(darkBlock?.boxBackgroundColor)) background = darkBlock.boxBackgroundColor;
132
+ else if (isDark(box)) background = box;
133
+ else background = DARK_DEFAULT_BG;
134
+ } else if (forced === "light") {
135
+ background = box || LIGHT_DEFAULT_BG;
136
+ } else {
137
+ background = box || (theme === "dark" ? DARK_DEFAULT_BG : LIGHT_DEFAULT_BG);
138
+ }
139
+ const parsed = isDarkBackground(background);
140
+ const dark = parsed === null ? forced ? forced === "dark" : theme === "dark" : parsed;
141
+ const primary = dark ? darkBlock?.buttonPrimaryColor || style?.buttonPrimaryColor || DARK_DEFAULT_PRIMARY : style?.buttonPrimaryColor || null;
142
+ const onPrimary = dark && primary && isDarkBackground(primary) === false ? ON_LIGHT_PRIMARY : "#fff";
143
+ return {
144
+ background,
145
+ dark,
146
+ primary,
147
+ onPrimary,
148
+ secondary: dark && darkBlock?.buttonSecondaryColor || style?.buttonSecondaryColor || null,
149
+ loadingBar: dark && darkBlock?.loadingBarColor || style?.loadingBarColor || null
150
+ };
151
+ }
152
+ var LIGHT_DEFAULT_BG, DARK_DEFAULT_BG, DARK_DEFAULT_PRIMARY, ON_LIGHT_PRIMARY, isDark, APPEARANCE_JS;
153
+ var init_appearance = __esm({
154
+ "src/ui/appearance.ts"() {
155
+ "use strict";
156
+ init_chromeContrast();
157
+ LIGHT_DEFAULT_BG = "#fff";
158
+ DARK_DEFAULT_BG = "#1e1e1e";
159
+ DARK_DEFAULT_PRIMARY = "#E2E8F0";
160
+ ON_LIGHT_PRIMARY = "#0F172A";
161
+ isDark = (c) => isDarkBackground(c) === true;
162
+ APPEARANCE_JS = `
163
+ function ddChromeColors(style, theme, forced){
164
+ var s=style||{}; var box=s.boxBackgroundColor||null; var d=s.dark||null;
165
+ var isDark=function(c){ return ddIsDarkBackground(c)===true; };
166
+ var bg;
167
+ if(forced==='dark'){ bg = (d && isDark(d.boxBackgroundColor)) ? d.boxBackgroundColor : (isDark(box) ? box : '${DARK_DEFAULT_BG}'); }
168
+ else if(forced==='light'){ bg = box || '${LIGHT_DEFAULT_BG}'; }
169
+ else { bg = box || (theme==='dark' ? '${DARK_DEFAULT_BG}' : '${LIGHT_DEFAULT_BG}'); }
170
+ var parsed=ddIsDarkBackground(bg);
171
+ var dark = parsed===null ? (forced ? forced==='dark' : theme==='dark') : parsed;
172
+ var primary = dark ? ((d && d.buttonPrimaryColor) || s.buttonPrimaryColor || '${DARK_DEFAULT_PRIMARY}') : (s.buttonPrimaryColor || null);
173
+ var onPrimary = (dark && primary && ddIsDarkBackground(primary)===false) ? '${ON_LIGHT_PRIMARY}' : '#fff';
174
+ return {
175
+ background: bg, dark: dark, primary: primary, onPrimary: onPrimary,
176
+ secondary: (dark && d && d.buttonSecondaryColor) || s.buttonSecondaryColor || null,
177
+ loadingBar: (dark && d && d.loadingBarColor) || s.loadingBarColor || null
178
+ };
179
+ }
180
+ function ddResolveForcedMode(appearance){
181
+ if(appearance==='light'||appearance==='dark'){ return appearance; }
182
+ if(appearance==='system'){
183
+ try { return (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light'; } catch(e){ return 'light'; }
184
+ }
185
+ return null;
186
+ }`;
187
+ }
188
+ });
189
+
36
190
  // src/version.ts
37
191
  var SDK_VERSION, SDK_IDENTIFIER, POPUP_CHANNEL;
38
192
  var init_version = __esm({
39
193
  "src/version.ts"() {
40
194
  "use strict";
41
- SDK_VERSION = "1.21.1";
195
+ SDK_VERSION = "1.22.0";
42
196
  SDK_IDENTIFIER = `${"react-native"}@${SDK_VERSION}`;
43
197
  POPUP_CHANNEL = "popup";
44
198
  }
@@ -200,8 +354,8 @@ var init_surveySdkVersion = __esm({
200
354
  "src/ui/surveySdkVersion.ts"() {
201
355
  "use strict";
202
356
  init_version();
203
- BUNDLED_SURVEY_SDK_VERSION = "2.2.39";
204
- SUPPORTED_SURVEY_SDK_VERSIONS = ["2.2.38", "2.2.39"];
357
+ BUNDLED_SURVEY_SDK_VERSION = "2.2.44";
358
+ SUPPORTED_SURVEY_SDK_VERSIONS = ["2.2.38", "2.2.39", "2.2.44"];
205
359
  SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
206
360
  }
207
361
  });
@@ -960,71 +1114,2555 @@ function setSurveyBusy(el, busy) {
960
1114
  el.inert = busy;
961
1115
  }
962
1116
  }
963
- var BUSY_JS;
964
- var init_busy = __esm({
965
- "src/ui/busy.ts"() {
1117
+ var BUSY_JS;
1118
+ var init_busy = __esm({
1119
+ "src/ui/busy.ts"() {
1120
+ "use strict";
1121
+ BUSY_JS = `
1122
+ function ddSetSurveyBusy(el, busy){
1123
+ if(!el){ return; }
1124
+ el.style.pointerEvents = busy ? 'none' : '';
1125
+ el.setAttribute('aria-busy', busy ? 'true' : 'false');
1126
+ if('inert' in el){ el.inert = busy; }
1127
+ }`;
1128
+ }
1129
+ });
1130
+
1131
+ // src/ui/submitError.ts
1132
+ function submitErrorText(error) {
1133
+ if (!error) return "";
1134
+ if (typeof error === "string") return error;
1135
+ const message = error.message;
1136
+ return typeof message === "string" ? message : String(error);
1137
+ }
1138
+ function classifySubmitError(error) {
1139
+ const message = submitErrorText(error).slice(0, SURVEY_ERROR_MESSAGE_MAX);
1140
+ const code = error && typeof error === "object" ? error.code : void 0;
1141
+ if (typeof code === "string" && REASON_BY_CODE[code]) return { reason: REASON_BY_CODE[code], message };
1142
+ if (message.toLowerCase().includes("no response")) return { reason: "required", message };
1143
+ return { reason: "unknown", message };
1144
+ }
1145
+ var SURVEY_ERROR_MESSAGE_MAX, REASON_BY_CODE, SUBMIT_ERROR_JS;
1146
+ var init_submitError = __esm({
1147
+ "src/ui/submitError.ts"() {
1148
+ "use strict";
1149
+ SURVEY_ERROR_MESSAGE_MAX = 300;
1150
+ REASON_BY_CODE = {
1151
+ REQUIRED: "required",
1152
+ INVALID_EMAIL: "invalid_email",
1153
+ SEND_FAILED: "send_failed",
1154
+ NO_PAGE: "no_page"
1155
+ };
1156
+ SUBMIT_ERROR_JS = `
1157
+ function ddClassifySubmitError(error){
1158
+ var message='';
1159
+ if(error){
1160
+ if(typeof error==='string'){ message=error; }
1161
+ else if(typeof error.message==='string'){ message=error.message; }
1162
+ else { message=String(error); }
1163
+ }
1164
+ message=message.slice(0, ${SURVEY_ERROR_MESSAGE_MAX});
1165
+ var byCode={ REQUIRED:'required', INVALID_EMAIL:'invalid_email', SEND_FAILED:'send_failed', NO_PAGE:'no_page' };
1166
+ var code=error && typeof error==='object' ? error.code : undefined;
1167
+ if(typeof code==='string' && byCode.hasOwnProperty(code)){ return { reason: byCode[code], message: message }; }
1168
+ if(message.toLowerCase().indexOf('no response')!==-1){ return { reason: 'required', message: message }; }
1169
+ return { reason: 'unknown', message: message };
1170
+ }`;
1171
+ }
1172
+ });
1173
+
1174
+ // src/assets/style.css
1175
+ var style_default;
1176
+ var init_style = __esm({
1177
+ "src/assets/style.css"() {
1178
+ style_default = `/**
1179
+ * NO EDITAR A MANO \u2014 generado por scripts/vendor-survey-css.mjs
1180
+ *
1181
+ * Copia de @magicfeedback/native@2.2.44 \u2192 dist/styles/magicfeedback-default.css
1182
+ * (la hoja can\xF3nica del paquete, la que apunta su campo "style"), con estos cambios locales:
1183
+ *
1184
+ * 1. Sin el @import de Google Fonts (Nunito): no queremos una petici\xF3n externa desde la
1185
+ * p\xE1gina del host, y la tipograf\xEDa la decide el popup.
1186
+ * 2. .magicfeedback-container hereda la fuente del popup (var(--deepdots-font, inherit)).
1187
+ * 3. Los selectores de elementos (h2, p, input\u2026) vienen acotados por el paquete con
1188
+ * :where(.magicfeedback-container, \u2026) desde 2.2.43 (DD-180); ese prefijo se cambia por
1189
+ * .deepdots-popup, el mismo alcance que antes (tambi\xE9n visten t\xEDtulo y mensaje final).
1190
+ * 4. El grupo .magicfeedback-radio se cualifica como div.magicfeedback-radio (la clase acaba
1191
+ * tambi\xE9n en el <input> del boolean).
1192
+ * 5. Todo :hover va dentro de @media (hover: hover): en t\xE1ctil WebKit deja el hover pegado
1193
+ * en el \xFAltimo punto tocado y la opci\xF3n de la p\xE1gina siguiente parec\xEDa seleccionada.
1194
+ * 6. Al final, un bloque de reglas propias del popup (fuente en los controles y padding del
1195
+ * radio nativo).
1196
+ *
1197
+ * Las variables --mf-* se dejan en :root a prop\xF3sito: el modal del priority-list se portea a
1198
+ * <body>, fuera de .deepdots-popup, y ah\xED las necesita.
1199
+ *
1200
+ * Para subir de versi\xF3n: npm i @magicfeedback/native@<v> && node scripts/vendor-survey-css.mjs
1201
+ */
1202
+
1203
+ /**
1204
+ * @magicfeedback/native - Default Styles
1205
+ * Clean, minimal, and elegant survey rendering
1206
+ */
1207
+
1208
+ /* @import de Google Fonts (Nunito) eliminado al vendorizar: la fuente la pone el popup. */
1209
+
1210
+ /* ========================================
1211
+ CSS VARIABLES - Design SYSTEM
1212
+ ======================================== */
1213
+ :root {
1214
+ /* Colors - Minimal Pastel */
1215
+ /* --mf-primary is the one source of truth for brand/accent color \u2014
1216
+ every token below derives from it via color-mix() (or references
1217
+ it directly) so changing this single value, here or via a
1218
+ per-integration override, keeps hover/light/border states in
1219
+ sync automatically instead of going stale independently. Scoped
1220
+ to genuinely interactive/accent surfaces (buttons, selected
1221
+ chips, focus rings) \u2014 general body text stays on its own neutral
1222
+ scale below, not tied to the brand color. */
1223
+ --mf-primary: #5d7bad;
1224
+ --mf-primary-hover: color-mix(in srgb, var(--mf-primary) 85%, black);
1225
+ /* --mf-tint-base is what light tints mix into: white here, the dark
1226
+ surface in dark mode (DD-238). */
1227
+ --mf-tint-base: #FFFFFF;
1228
+ --mf-primary-light-mix: 15%;
1229
+ --mf-primary-border-mix: 35%;
1230
+ --mf-primary-light: color-mix(in srgb, var(--mf-primary) var(--mf-primary-light-mix), var(--mf-tint-base));
1231
+ /* a translucent tint \u2014 mixed with transparent (opacity), not white,
1232
+ so it reads as a soft shadow of the brand color rather than a
1233
+ pastel of it. */
1234
+ --mf-primary-border: color-mix(in srgb, var(--mf-primary) var(--mf-primary-border-mix), transparent);
1235
+
1236
+ --mf-text-primary: #1E293B;
1237
+ --mf-text-secondary: #475569;
1238
+ --mf-text-muted: #94A3B8;
1239
+
1240
+ --mf-bg-primary: #F8FAFC;
1241
+ --mf-bg-secondary: #FFFFFF;
1242
+ --mf-bg-hover: #EEF2F6;
1243
+
1244
+ --mf-border: #E2E8F0;
1245
+ --mf-border-focus: var(--mf-primary);
1246
+
1247
+ --mf-success: #16A34A;
1248
+ --mf-error: #EF4444;
1249
+ --mf-warning: #F59E0B;
1250
+
1251
+ --mf-surface: #FFFFFF;
1252
+ --mf-surface-alt: #F1F5F9;
1253
+ --mf-accent: #38BDF8;
1254
+
1255
+ /* Colors that used to be hard-coded in rules and render code (DD-238) */
1256
+ --mf-on-primary: #FFFFFF;
1257
+ --mf-text-strong: #000000;
1258
+ --mf-danger-text: #C70039;
1259
+ --mf-star: #fbbf24;
1260
+ --mf-star-empty: #CCCCCC;
1261
+ --mf-overlay: rgba(0, 0, 0, 0.4);
1262
+ --mf-shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.2);
1263
+
1264
+ /* Spacing */
1265
+ --mf-space-xs: 0.25rem;
1266
+ --mf-space-sm: 0.5rem;
1267
+ --mf-space-md: 0.75rem;
1268
+ --mf-space-lg: 1rem;
1269
+ --mf-space-xl: 1.5rem;
1270
+
1271
+ /* Border Radius */
1272
+ --mf-radius-sm: 0.5rem;
1273
+ --mf-radius-md: 0.75rem;
1274
+ --mf-radius-lg: 1.25rem;
1275
+ --mf-radius-full: 9999px;
1276
+
1277
+ /* Shadows */
1278
+ --mf-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
1279
+ --mf-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
1280
+ --mf-shadow-lg: 0 16px 30px rgba(15, 23, 42, 0.12);
1281
+ --mf-shadow-focus: 0 0 0 3px rgba(30, 41, 59, 0.15);
1282
+ --mf-shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
1283
+
1284
+ /* Typography */
1285
+ --mf-font-sans: "Nunito", "Quicksand", "Avenir Next", "Trebuchet MS", sans-serif;
1286
+ --mf-font-size-sm: 0.875rem;
1287
+ --mf-font-size-base: 1rem;
1288
+ --mf-font-size-lg: 1.125rem;
1289
+ --mf-font-size-xl: 1.25rem;
1290
+ --mf-line-height: 1.6;
1291
+
1292
+ /* Font Weights */
1293
+ --mf-font-weight-normal: 400;
1294
+ --mf-font-weight-medium: 500;
1295
+ --mf-font-weight-semibold: 600;
1296
+ --mf-font-weight-bold: 700;
1297
+ --mf-font-weight-extrabold: 800;
1298
+
1299
+ /* Transitions */
1300
+ --mf-transition: all 0.2s ease;
1301
+ --mf-transition-fast: all 0.15s ease;
1302
+ }
1303
+
1304
+ /* ========================================
1305
+ DARK MODE (DD-238)
1306
+ Set by the SDK on the container (and the portaled modal backdrop) when the
1307
+ survey Style background is dark, or when the host forces mode: 'dark'.
1308
+ The Style's own dark background colors are written inline on the same
1309
+ element, so they win over the defaults below; the derived tokens use var()
1310
+ so they resolve against those inline values.
1311
+ ======================================== */
1312
+ .magicfeedback-container[data-mf-mode="dark"],
1313
+ .magicfeedback-preview[data-mf-mode="dark"],
1314
+ .magicfeedback-modal-backdrop[data-mf-mode="dark"] {
1315
+ color-scheme: dark;
1316
+
1317
+ --mf-text-primary: #F1F5F9;
1318
+ --mf-text-secondary: #CBD5E1;
1319
+ --mf-text-muted: #94A3B8;
1320
+ --mf-text-strong: #FFFFFF;
1321
+
1322
+ --mf-bg-primary: #0F172A;
1323
+ --mf-bg-secondary: #1E293B;
1324
+ --mf-surface: #1E293B;
1325
+ --mf-surface-alt: color-mix(in srgb, var(--mf-surface) 90%, white);
1326
+ --mf-bg-hover: color-mix(in srgb, var(--mf-surface) 84%, white);
1327
+ --mf-border: color-mix(in srgb, var(--mf-surface) 72%, white);
1328
+
1329
+ --mf-tint-base: var(--mf-surface);
1330
+ --mf-primary-light-mix: 30%;
1331
+ --mf-primary-border-mix: 55%;
1332
+ --mf-primary-light: color-mix(in srgb, var(--mf-primary) var(--mf-primary-light-mix), var(--mf-tint-base));
1333
+ --mf-primary-border: color-mix(in srgb, var(--mf-primary) var(--mf-primary-border-mix), transparent);
1334
+
1335
+ --mf-success: #4ADE80;
1336
+ --mf-error: #F87171;
1337
+ --mf-warning: #FBBF24;
1338
+ --mf-danger-text: #FF8FA3;
1339
+ --mf-star-empty: color-mix(in srgb, var(--mf-surface) 60%, white);
1340
+ --mf-overlay: rgba(0, 0, 0, 0.6);
1341
+
1342
+ --mf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
1343
+ --mf-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
1344
+ --mf-shadow-lg: 0 16px 30px rgba(0, 0, 0, 0.45);
1345
+ --mf-shadow-focus: 0 0 0 3px rgba(241, 245, 249, 0.25);
1346
+ --mf-shadow-card: 0 18px 40px rgba(0, 0, 0, 0.35);
1347
+ --mf-shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.6);
1348
+ }
1349
+
1350
+ /* Priority list arrows are a black SVG image: flip them to light. */
1351
+ [data-mf-mode="dark"] .magicfeedback-priority-list-arrow-up,
1352
+ [data-mf-mode="dark"] .magicfeedback-priority-list-arrow-down {
1353
+ filter: invert(1);
1354
+ }
1355
+
1356
+ /* ========================================
1357
+ ANIMATIONS
1358
+ ======================================== */
1359
+ @keyframes mf-fade-in {
1360
+ from {
1361
+ opacity: 0;
1362
+ transform: translateY(8px);
1363
+ }
1364
+ to {
1365
+ opacity: 1;
1366
+ transform: translateY(0);
1367
+ }
1368
+ }
1369
+
1370
+ @keyframes mf-slide-in {
1371
+ from {
1372
+ opacity: 0;
1373
+ transform: translateX(-16px);
1374
+ }
1375
+ to {
1376
+ opacity: 1;
1377
+ transform: translateX(0);
1378
+ }
1379
+ }
1380
+
1381
+ @keyframes mf-scale-in {
1382
+ from {
1383
+ opacity: 0;
1384
+ transform: scale(0.95);
1385
+ }
1386
+ to {
1387
+ opacity: 1;
1388
+ transform: scale(1);
1389
+ }
1390
+ }
1391
+
1392
+ @keyframes mf-pulse {
1393
+ 0%,
1394
+ 100% {
1395
+ opacity: 1;
1396
+ }
1397
+ 50% {
1398
+ opacity: 0.8;
1399
+ }
1400
+ }
1401
+
1402
+ /* ========================================
1403
+ BASE CONTAINER
1404
+ ======================================== */
1405
+ .magicfeedback-container {
1406
+ /* Local: hereda la fuente del popup; --deepdots-font viene de PopupStyle.font. */
1407
+ font-family: var(--deepdots-font, inherit);
1408
+ color: var(--mf-text-primary);
1409
+ line-height: var(--mf-line-height);
1410
+ animation: mf-fade-in 0.4s ease-out;
1411
+ border-radius: var(--mf-radius-lg);
1412
+ }
1413
+
1414
+ /* ========================================
1415
+ MESSAGES
1416
+ ======================================== */
1417
+ .magicfeedback-success-message,
1418
+ .magicfeedback-info-message,
1419
+ .magicfeedback-start-message {
1420
+ padding: var(--mf-space-lg);
1421
+ margin: var(--mf-space-lg) 0;
1422
+ animation: mf-scale-in 0.3s ease-out;
1423
+ }
1424
+
1425
+ /* .magicfeedback-info-message/-start-message are set via innerHTML (see
1426
+ renderInfoPage.ts / questions.service.ts's renderStartMessage) \u2014 whatever
1427
+ rich text a survey author writes lands here as real HTML, not just the
1428
+ <p>/<img> pair this used to style. Covering the rest of what a rich-text
1429
+ editor commonly outputs (headings, lists, links, emphasis, quotes, code,
1430
+ rules) keeps that content on the same type scale and palette as the rest
1431
+ of the widget instead of falling back to unstyled browser defaults. */
1432
+ .magicfeedback-success-message > :first-child,
1433
+ .magicfeedback-info-message > :first-child,
1434
+ .magicfeedback-start-message > :first-child {
1435
+ margin-top: 0;
1436
+ }
1437
+
1438
+ .magicfeedback-success-message > :last-child,
1439
+ .magicfeedback-info-message > :last-child,
1440
+ .magicfeedback-start-message > :last-child {
1441
+ margin-bottom: 0;
1442
+ }
1443
+
1444
+ .magicfeedback-success-message p,
1445
+ .magicfeedback-info-message p,
1446
+ .magicfeedback-start-message p {
1447
+ font-size: var(--mf-font-size-base);
1448
+ color: var(--mf-text-secondary);
1449
+ margin: 0 0 var(--mf-space-md);
1450
+ line-height: var(--mf-line-height);
1451
+ }
1452
+
1453
+ .magicfeedback-info-message h1,
1454
+ .magicfeedback-info-message h2,
1455
+ .magicfeedback-info-message h3,
1456
+ .magicfeedback-info-message h4,
1457
+ .magicfeedback-info-message h5,
1458
+ .magicfeedback-info-message h6,
1459
+ .magicfeedback-start-message h1,
1460
+ .magicfeedback-start-message h2,
1461
+ .magicfeedback-start-message h3,
1462
+ .magicfeedback-start-message h4,
1463
+ .magicfeedback-start-message h5,
1464
+ .magicfeedback-start-message h6 {
1465
+ color: var(--mf-text-primary);
1466
+ font-weight: var(--mf-font-weight-bold);
1467
+ line-height: 1.3;
1468
+ margin: var(--mf-space-lg) 0 var(--mf-space-sm);
1469
+ text-align: start;
1470
+ }
1471
+
1472
+ .magicfeedback-info-message h1, .magicfeedback-start-message h1 { font-size: var(--mf-font-size-xl); }
1473
+ .magicfeedback-info-message h2, .magicfeedback-start-message h2 { font-size: var(--mf-font-size-lg); }
1474
+ .magicfeedback-info-message h3,
1475
+ .magicfeedback-info-message h4,
1476
+ .magicfeedback-info-message h5,
1477
+ .magicfeedback-info-message h6,
1478
+ .magicfeedback-start-message h3,
1479
+ .magicfeedback-start-message h4,
1480
+ .magicfeedback-start-message h5,
1481
+ .magicfeedback-start-message h6 { font-size: var(--mf-font-size-base); }
1482
+
1483
+ .magicfeedback-info-message strong,
1484
+ .magicfeedback-info-message b,
1485
+ .magicfeedback-start-message strong,
1486
+ .magicfeedback-start-message b {
1487
+ font-weight: var(--mf-font-weight-bold);
1488
+ color: var(--mf-text-primary);
1489
+ }
1490
+
1491
+ .magicfeedback-info-message a,
1492
+ .magicfeedback-start-message a {
1493
+ color: var(--mf-primary);
1494
+ text-decoration: underline;
1495
+ text-underline-offset: 2px;
1496
+ }
1497
+
1498
+ @media (hover: hover) {
1499
+ .magicfeedback-info-message a:hover,
1500
+ .magicfeedback-start-message a:hover {
1501
+ color: var(--mf-primary-hover);
1502
+ }
1503
+ }
1504
+
1505
+ .magicfeedback-info-message ul,
1506
+ .magicfeedback-info-message ol,
1507
+ .magicfeedback-start-message ul,
1508
+ .magicfeedback-start-message ol {
1509
+ margin: 0 0 var(--mf-space-md);
1510
+ padding-inline-start: var(--mf-space-xl);
1511
+ color: var(--mf-text-secondary);
1512
+ line-height: var(--mf-line-height);
1513
+ }
1514
+
1515
+ .magicfeedback-info-message li + li,
1516
+ .magicfeedback-start-message li + li {
1517
+ margin-top: var(--mf-space-xs);
1518
+ }
1519
+
1520
+ .magicfeedback-info-message blockquote,
1521
+ .magicfeedback-start-message blockquote {
1522
+ margin: 0 0 var(--mf-space-md);
1523
+ padding: var(--mf-space-sm) var(--mf-space-md);
1524
+ border-inline-start: 3px solid var(--mf-primary-border);
1525
+ color: var(--mf-text-secondary);
1526
+ font-style: italic;
1527
+ }
1528
+
1529
+ .magicfeedback-info-message code,
1530
+ .magicfeedback-start-message code {
1531
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
1532
+ font-size: 0.9em;
1533
+ background: var(--mf-bg-hover);
1534
+ padding: 0.15em 0.4em;
1535
+ border-radius: var(--mf-radius-sm);
1536
+ }
1537
+
1538
+ .magicfeedback-info-message pre,
1539
+ .magicfeedback-start-message pre {
1540
+ margin: 0 0 var(--mf-space-md);
1541
+ padding: var(--mf-space-md);
1542
+ background: var(--mf-bg-hover);
1543
+ border-radius: var(--mf-radius-md);
1544
+ overflow-x: auto;
1545
+ }
1546
+
1547
+ .magicfeedback-info-message pre code,
1548
+ .magicfeedback-start-message pre code {
1549
+ background: none;
1550
+ padding: 0;
1551
+ }
1552
+
1553
+ .magicfeedback-info-message hr,
1554
+ .magicfeedback-start-message hr {
1555
+ border: none;
1556
+ border-top: 1px solid var(--mf-border);
1557
+ margin: var(--mf-space-lg) 0;
1558
+ }
1559
+
1560
+ .magicfeedback-success-message img,
1561
+ .magicfeedback-info-message img,
1562
+ .magicfeedback-start-message img {
1563
+ max-width: 100%;
1564
+ height: auto;
1565
+ margin: var(--mf-space-lg) auto;
1566
+ display: block;
1567
+ border-radius: var(--mf-radius-md);
1568
+ }
1569
+
1570
+ .magicfeedback-image {
1571
+ max-height: 400px;
1572
+ height: auto;
1573
+ max-width: 100%;
1574
+ margin: var(--mf-space-lg) auto;
1575
+ display: block;
1576
+ border-radius: var(--mf-radius-md);
1577
+ }
1578
+
1579
+ /* ========================================
1580
+ FORM STRUCTURE
1581
+ ======================================== */
1582
+ .magicfeedback-form {
1583
+ display: flex;
1584
+ flex-direction: column;
1585
+ gap: var(--mf-space-lg);
1586
+ padding: clamp(16px, 2.5vw, 28px);
1587
+ }
1588
+
1589
+ .magicfeedback-questions {
1590
+ display: flex;
1591
+ flex-direction: column;
1592
+ gap: var(--mf-space-xl);
1593
+ width: 100%;
1594
+ }
1595
+
1596
+ .magicfeedback-div {
1597
+ display: flex;
1598
+ flex-direction: column;
1599
+ gap: var(--mf-space-sm);
1600
+ animation: mf-slide-in 0.3s ease-out;
1601
+ background: var(--mf-bg-secondary);
1602
+ border-radius: var(--mf-radius-md);
1603
+ }
1604
+
1605
+ /* ========================================
1606
+ LABELS & TYPOGRAPHY
1607
+ ======================================== */
1608
+ .magicfeedback-label {
1609
+ font-size: var(--mf-font-size-lg);
1610
+ font-weight: var(--mf-font-weight-bold);
1611
+ color: var(--mf-text-primary);
1612
+ line-height: var(--mf-line-height);
1613
+ text-align: start;
1614
+ letter-spacing: -0.01em;
1615
+ }
1616
+
1617
+ .magicfeedback-sublabel {
1618
+ font-size: var(--mf-font-size-base);
1619
+ font-weight: var(--mf-font-weight-normal);
1620
+ color: var(--mf-text-secondary);
1621
+ margin-bottom: var(--mf-space-sm);
1622
+ }
1623
+
1624
+ /* Element rules (h2, p, inputs, ...) are scoped to the survey container, the
1625
+ previewQuestion() host and the priority-list modal, which is portaled to
1626
+ <body>. This sheet is
1627
+ loaded on the host page, so a bare \`p\` or \`input\` would restyle the host
1628
+ app too. :where() keeps the specificity of the bare selector, so every
1629
+ .magicfeedback-* rule still wins over these as before. */
1630
+ .deepdots-popup h2 {
1631
+ font-size: var(--mf-font-size-xl);
1632
+ font-weight: 600;
1633
+ color: var(--mf-text-primary);
1634
+ margin: 0 0 var(--mf-space-xl) 0;
1635
+ text-align: center;
1636
+ letter-spacing: -0.01em;
1637
+ }
1638
+
1639
+ .deepdots-popup p {
1640
+ margin: 0;
1641
+ font-size: var(--mf-font-size-sm);
1642
+ color: var(--mf-text-secondary);
1643
+ }
1644
+
1645
+ /* ========================================
1646
+ FORM INPUTS
1647
+ ======================================== */
1648
+ .deepdots-popup input[type="date"],
1649
+ .deepdots-popup input[type="text"],
1650
+ .deepdots-popup input[type="number"],
1651
+ .deepdots-popup input[type="email"],
1652
+ .deepdots-popup input[type="password"],
1653
+ .deepdots-popup textarea,
1654
+ .deepdots-popup select {
1655
+ padding: 0.75rem 0.9rem;
1656
+ font-size: var(--mf-font-size-base);
1657
+ font-family: inherit;
1658
+ color: var(--mf-text-primary);
1659
+ background-color: var(--mf-surface);
1660
+ border: 2px solid var(--mf-border);
1661
+ border-radius: var(--mf-radius-md);
1662
+ outline: none;
1663
+ transition: var(--mf-transition);
1664
+ -webkit-appearance: none;
1665
+ appearance: none;
1666
+ box-shadow: var(--mf-shadow-sm);
1667
+ }
1668
+
1669
+ .deepdots-popup textarea {
1670
+ min-height: 100px;
1671
+ resize: vertical;
1672
+ }
1673
+
1674
+ .deepdots-popup input::placeholder,
1675
+ .deepdots-popup textarea::placeholder {
1676
+ color: var(--mf-text-muted);
1677
+ }
1678
+
1679
+ /* Remove number input spinners */
1680
+ .deepdots-popup input::-webkit-outer-spin-button,
1681
+ .deepdots-popup input::-webkit-inner-spin-button {
1682
+ -webkit-appearance: none;
1683
+ margin: 0;
1684
+ }
1685
+
1686
+ .deepdots-popup input[type="number"] {
1687
+ /* -moz-appearance: textfield; removed for lint compatibility */
1688
+ }
1689
+
1690
+ /* Email @ button (assets.atButton). --mf-secondary is defined by MagicSurvey;
1691
+ the fallback is the same #2E2E2E. */
1692
+ .magicfeedback-email-container {
1693
+ display: flex;
1694
+ flex-direction: column;
1695
+ gap: var(--mf-space-sm);
1696
+ }
1697
+
1698
+ .magicfeedback-email-row {
1699
+ display: flex;
1700
+ align-items: stretch;
1701
+ gap: var(--mf-space-sm);
1702
+ }
1703
+
1704
+ .magicfeedback-email-row input[type="email"] {
1705
+ flex: 1 1 auto;
1706
+ min-width: 0;
1707
+ }
1708
+
1709
+ .magicfeedback-email-inset {
1710
+ position: relative;
1711
+ }
1712
+
1713
+ .magicfeedback-email-inset input[type="email"] {
1714
+ width: 100%;
1715
+ box-sizing: border-box;
1716
+ padding-inline-end: 3.6rem;
1717
+ }
1718
+
1719
+ .magicfeedback-email-row input[type="email"]:focus,
1720
+ .magicfeedback-email-inset input[type="email"]:focus {
1721
+ border-color: var(--mf-border-focus);
1722
+ }
1723
+
1724
+ .magicfeedback-email-at {
1725
+ flex: none;
1726
+ aspect-ratio: 1;
1727
+ align-self: stretch;
1728
+ min-width: 46px;
1729
+ display: grid;
1730
+ place-items: center;
1731
+ padding: 0;
1732
+ font-family: inherit;
1733
+ font-size: 1.35rem;
1734
+ font-weight: var(--mf-font-weight-extrabold);
1735
+ line-height: 1;
1736
+ color: var(--mf-on-primary);
1737
+ background-color: var(--mf-secondary, #2E2E2E);
1738
+ border: 2px solid var(--mf-secondary, #2E2E2E);
1739
+ border-radius: var(--mf-radius-full);
1740
+ cursor: pointer;
1741
+ box-shadow: var(--mf-shadow-sm);
1742
+ -webkit-tap-highlight-color: transparent;
1743
+ touch-action: manipulation;
1744
+ -webkit-user-select: none;
1745
+ user-select: none;
1746
+ transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
1747
+ }
1748
+
1749
+ .magicfeedback-email-at:active {
1750
+ background-color: color-mix(in srgb, var(--mf-secondary, #2E2E2E) 85%, black);
1751
+ transform: scale(0.92);
1752
+ box-shadow: none;
1753
+ }
1754
+
1755
+ .magicfeedback-email-at:focus-visible {
1756
+ outline: 3px solid var(--mf-primary-border);
1757
+ outline-offset: 2px;
1758
+ }
1759
+
1760
+ .magicfeedback-email-inset .magicfeedback-email-at {
1761
+ position: absolute;
1762
+ inset-inline-end: 7px;
1763
+ top: 50%;
1764
+ transform: translateY(-50%);
1765
+ width: 2.5rem;
1766
+ height: 2.5rem;
1767
+ min-width: 0;
1768
+ aspect-ratio: auto;
1769
+ font-size: 1.15rem;
1770
+ color: var(--mf-text-primary);
1771
+ background-color: var(--mf-surface-alt);
1772
+ border: 1px solid var(--mf-border);
1773
+ box-shadow: none;
1774
+ }
1775
+
1776
+ .magicfeedback-email-inset .magicfeedback-email-at:active {
1777
+ transform: translateY(-50%) scale(0.9);
1778
+ color: var(--mf-primary);
1779
+ background-color: var(--mf-primary-light);
1780
+ border-color: var(--mf-primary-border);
1781
+ }
1782
+
1783
+ .magicfeedback-email-hint {
1784
+ margin: 0;
1785
+ text-align: start;
1786
+ font-size: var(--mf-font-size-sm);
1787
+ line-height: 1.45;
1788
+ color: var(--mf-text-secondary);
1789
+ }
1790
+
1791
+ .magicfeedback-email-hint b {
1792
+ font-weight: var(--mf-font-weight-extrabold);
1793
+ color: var(--mf-text-primary);
1794
+ }
1795
+
1796
+ /* Custom Select Arrow */
1797
+ .deepdots-popup select {
1798
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
1799
+ background-repeat: no-repeat;
1800
+ background-position: right var(--mf-space-md) center;
1801
+ padding-inline-end: var(--mf-space-xl);
1802
+ }
1803
+
1804
+ /* Error State */
1805
+ .deepdots-popup input.error,
1806
+ .deepdots-popup select.error,
1807
+ .deepdots-popup textarea.error {
1808
+ border-color: var(--mf-error);
1809
+ }
1810
+
1811
+ .magicfeedback-error {
1812
+ margin-top: var(--mf-space-xs);
1813
+ font-size: var(--mf-font-size-sm);
1814
+ color: var(--mf-error);
1815
+ }
1816
+
1817
+ /* ========================================
1818
+ CHECKBOX & RADIO OPTIONS
1819
+ ======================================== */
1820
+ .magicfeedback-checkbox,
1821
+ div.magicfeedback-radio {
1822
+ display: flex;
1823
+ flex-direction: column;
1824
+ gap: var(--mf-space-sm);
1825
+ width: 100%;
1826
+ }
1827
+
1828
+ /* Single choice in a row (assets.direction "row"): one equal box per
1829
+ option. The "other" text field wraps to its own line below. Stacked
1830
+ (phone, or too narrow) it is the usual vertical list again. */
1831
+ .magicfeedback-radio--row {
1832
+ flex-direction: row;
1833
+ flex-wrap: wrap;
1834
+ }
1835
+
1836
+ .magicfeedback-radio--row > .magicfeedback-radio-container {
1837
+ flex: 1 1 0;
1838
+ min-width: 0;
1839
+ }
1840
+
1841
+ .magicfeedback-radio--row > .magicfeedback-extra-option {
1842
+ flex-basis: 100%;
1843
+ }
1844
+
1845
+ .magicfeedback-radio--row.magicfeedback-radio--stacked {
1846
+ flex-direction: column;
1847
+ flex-wrap: nowrap;
1848
+ }
1849
+
1850
+ .magicfeedback-radio--row.magicfeedback-radio--stacked > .magicfeedback-radio-container {
1851
+ flex: none;
1852
+ }
1853
+
1854
+ .magicfeedback-radio--row .magicfeedback-radio-container label {
1855
+ overflow-wrap: anywhere;
1856
+ }
1857
+
1858
+ .magicfeedback-checkbox-container,
1859
+ .magicfeedback-radio-container {
1860
+ display: flex;
1861
+ align-items: center;
1862
+ gap: var(--mf-space-sm);
1863
+ padding: var(--mf-space-md);
1864
+ border: 1.5px solid var(--mf-border);
1865
+ border-radius: var(--mf-radius-md);
1866
+ cursor: pointer;
1867
+ transition: var(--mf-transition-fast);
1868
+ }
1869
+
1870
+ @media (hover: hover) {
1871
+ .magicfeedback-checkbox-container:hover,
1872
+ .magicfeedback-radio-container:hover {
1873
+ background-color: var(--mf-bg-hover);
1874
+ border-color: var(--mf-primary);
1875
+ }
1876
+ }
1877
+
1878
+ .magicfeedback-checkbox-container:has(input:checked),
1879
+ .magicfeedback-radio-container:has(input:checked) {
1880
+ background-color: var(--mf-primary-light);
1881
+ border-color: var(--mf-primary);
1882
+ }
1883
+
1884
+ .magicfeedback-checkbox input[type="checkbox"],
1885
+ .magicfeedback-radio-container input[type="radio"] {
1886
+ width: 18px;
1887
+ height: 18px;
1888
+ margin: 0;
1889
+ cursor: pointer;
1890
+ flex-shrink: 0;
1891
+ accent-color: var(--mf-primary);
1892
+ }
1893
+
1894
+ .magicfeedback-checkbox label,
1895
+ .magicfeedback-radio-container label {
1896
+ font-size: var(--mf-font-size-base);
1897
+ text-align: start;
1898
+ color: var(--mf-text-primary);
1899
+ cursor: pointer;
1900
+ margin: 0;
1901
+ flex: 1;
1902
+ }
1903
+
1904
+ /* ========================================
1905
+ BOOLEAN OPTIONS
1906
+ ======================================== */
1907
+ .magicfeedback-boolean-container {
1908
+ display: flex;
1909
+ gap: var(--mf-space-md);
1910
+ width: 100%;
1911
+ }
1912
+
1913
+ .magicfeedback-boolean-option {
1914
+ flex: 1;
1915
+ position: relative;
1916
+ }
1917
+
1918
+ .magicfeedback-boolean-option input[type="radio"] {
1919
+ position: absolute;
1920
+ opacity: 0;
1921
+ width: 0;
1922
+ height: 0;
1923
+ }
1924
+
1925
+ .magicfeedback-boolean-option label {
1926
+ display: flex;
1927
+ align-items: center;
1928
+ justify-content: center;
1929
+ padding: var(--mf-space-md);
1930
+ font-size: var(--mf-font-size-base);
1931
+ font-weight: 500;
1932
+ color: var(--mf-text-secondary);
1933
+ border: 1.5px solid var(--mf-border);
1934
+ border-radius: var(--mf-radius-md);
1935
+ cursor: pointer;
1936
+ transition: var(--mf-transition-fast);
1937
+ margin: 0;
1938
+ width: -webkit-fill-available;
1939
+ height: inherit;
1940
+ }
1941
+
1942
+ @media (hover: hover) {
1943
+ .magicfeedback-boolean-option label:hover {
1944
+ background-color: var(--mf-bg-hover);
1945
+ border-color: var(--mf-primary);
1946
+ }
1947
+ }
1948
+
1949
+ .magicfeedback-boolean-option input[type="radio"]:checked + label {
1950
+ color: var(--mf-primary);
1951
+ background-color: var(--mf-primary-light);
1952
+ border-color: var(--mf-primary);
1953
+ font-weight: 600;
1954
+ }
1955
+
1956
+ /* ========================================
1957
+ RATING SYSTEMS
1958
+ ======================================== */
1959
+ .magicfeedback-rating,
1960
+ .magicfeedback-rating-number,
1961
+ .magicfeedback-rating-star {
1962
+ width: 100%;
1963
+ }
1964
+
1965
+ .magicfeedback-rating-container,
1966
+ .magicfeedback-rating-number-container,
1967
+ .magicfeedback-rating-star-container {
1968
+ display: flex;
1969
+ flex-wrap: wrap;
1970
+ gap: var(--mf-space-sm);
1971
+ justify-content: center;
1972
+ align-items: center;
1973
+ padding: var(--mf-space-md) 0;
1974
+ list-style: none;
1975
+ margin: 0;
1976
+ }
1977
+
1978
+ /* Caption line below the row \u2014 min on one side, max on the other (swapped
1979
+ for order: "rtl") \u2014 same simple, non-responsive pattern as the
1980
+ rating-number row caption. Used by rating-star and rating-emoji. */
1981
+ .magicfeedback-rating-placeholder {
1982
+ display: flex;
1983
+ justify-content: space-between;
1984
+ gap: var(--mf-space-md);
1985
+ width: 100%;
1986
+ margin-top: var(--mf-space-sm);
1987
+ font-size: var(--mf-font-size-sm);
1988
+ font-weight: var(--mf-font-weight-semibold);
1989
+ color: var(--mf-text-secondary);
1990
+ }
1991
+
1992
+ .magicfeedback-rating-placeholder-value {
1993
+ overflow-wrap: anywhere;
1994
+ }
1995
+
1996
+ .magicfeedback-rating-placeholder-value:last-child {
1997
+ text-align: end;
1998
+ }
1999
+
2000
+ /* Rating with Images */
2001
+ .magicfeedback-rating-option-label-container input[type="radio"] {
2002
+ position: absolute;
2003
+ opacity: 0;
2004
+ width: 0;
2005
+ height: 0;
2006
+ }
2007
+
2008
+ .magicfeedback-rating-option-label-container img {
2009
+ width: 56px;
2010
+ height: 56px;
2011
+ cursor: pointer;
2012
+ transition: var(--mf-transition-fast);
2013
+ border-radius: var(--mf-radius-full);
2014
+ border: 2px solid transparent;
2015
+ }
2016
+
2017
+ @media (hover: hover) {
2018
+ .magicfeedback-rating-option-label-container img:hover {
2019
+ transform: scale(1.1);
2020
+ border-color: var(--mf-primary);
2021
+ }
2022
+ }
2023
+
2024
+ .magicfeedback-rating-option-label-container input[type="radio"]:checked + img {
2025
+ border-color: var(--mf-primary);
2026
+ box-shadow: 0 0 0 3px var(--mf-primary-light);
2027
+ }
2028
+
2029
+ .magicfeedback-rating-option-label-container label {
2030
+ display: block;
2031
+ text-align: center;
2032
+ font-size: var(--mf-font-size-sm);
2033
+ color: var(--mf-text-secondary);
2034
+ margin-top: var(--mf-space-xs);
2035
+ cursor: pointer;
2036
+ }
2037
+
2038
+ /* Rating Numbers \u2014 each option is its own outlined chip in the survey's
2039
+ primary color, with a gap between them. Row and column use the same
2040
+ chip; column additionally has room to show each option's own text
2041
+ plainly next to its number. */
2042
+
2043
+ /* Every size here is width:100%/flex:1 combined with the chip's own
2044
+ padding and border. Without border-box, the browser's default
2045
+ content-box adds that padding/border on TOP of the declared size, so
2046
+ the chip quietly overflows past its flex slot \u2014 reading as "not quite
2047
+ full width" or, worse, pushing into the next chip. */
2048
+ .magicfeedback-rating-number-container,
2049
+ .magicfeedback-rating-number-option,
2050
+ .magicfeedback-rating-number-option-label-container,
2051
+ .magicfeedback-rating-number-value {
2052
+ box-sizing: border-box;
2053
+ }
2054
+
2055
+ /* The shared rating-container rule (above, reused by star rating) sets
2056
+ align-items:center for its row-of-chips layout \u2014 in a stacked column
2057
+ that still nudges a 100%-wide chip inward instead of a true 0 offset.
2058
+ Force stretch so every chip fills the exact same width, flush on
2059
+ both sides. */
2060
+ .magicfeedback-rating-number-container-column,
2061
+ .magicfeedback-rating-number-container-column-reverse {
2062
+ align-items: stretch;
2063
+ }
2064
+
2065
+ /* Caption line below the row \u2014 the single place min/max labels live
2066
+ for row mode, shared by mobile and desktop. */
2067
+ .magicfeedback-rating-number-scale-labels {
2068
+ display: flex;
2069
+ justify-content: space-between;
2070
+ gap: var(--mf-space-md);
2071
+ margin-top: var(--mf-space-sm);
2072
+ font-size: var(--mf-font-size-sm);
2073
+ font-weight: var(--mf-font-weight-semibold);
2074
+ color: var(--mf-text-secondary);
2075
+ }
2076
+
2077
+ .magicfeedback-rating-number-scale-label {
2078
+ overflow-wrap: anywhere;
2079
+ }
2080
+
2081
+ /* assets.minMaxPlaceholderPosition: the caption above or below the row. */
2082
+ .magicfeedback-rating-number-scale-labels--top {
2083
+ margin-top: 0;
2084
+ margin-bottom: var(--mf-space-sm);
2085
+ }
2086
+
2087
+ .magicfeedback-rating-number-scale-labels--bottom {
2088
+ margin-top: var(--mf-space-sm);
2089
+ margin-bottom: 0;
2090
+ }
2091
+
2092
+ /* Row with a text per number: the text sits above each chip (below with
2093
+ numberPlaceholdersPosition "bottom"). The option is a column laid out
2094
+ inline; this only spaces and styles the text. */
2095
+ .magicfeedback-rating-number-option--captioned {
2096
+ gap: var(--mf-space-xs);
2097
+ }
2098
+
2099
+ .magicfeedback-rating-number-option-caption {
2100
+ font-size: var(--mf-font-size-sm);
2101
+ font-weight: var(--mf-font-weight-semibold);
2102
+ color: var(--mf-text-secondary);
2103
+ text-align: center;
2104
+ line-height: 1.25;
2105
+ overflow-wrap: anywhere;
2106
+ cursor: pointer;
2107
+ }
2108
+
2109
+ .magicfeedback-rating-number-scale-label:last-child {
2110
+ text-align: end;
2111
+ }
2112
+
2113
+ /* Column, no per-option text: each row is its own separated chip, so
2114
+ the min/max labels bookend the stack from outside it \u2014 one line
2115
+ above the first chip, one below the last. Margin goes on whichever
2116
+ side actually faces the list \u2014 the "before" label (always the first
2117
+ child) gets space below it, the "after" one (always right after the
2118
+ container, extra option row or not) gets space above it \u2014 so both
2119
+ sit the same distance from the chips regardless of which one it is. */
2120
+ .magicfeedback-rating-number-scale-label-block {
2121
+ font-size: var(--mf-font-size-sm);
2122
+ font-weight: var(--mf-font-weight-semibold);
2123
+ color: var(--mf-text-secondary);
2124
+ text-align: center;
2125
+ }
2126
+
2127
+ .magicfeedback-rating-number-scale-label-block:first-child {
2128
+ margin-bottom: var(--mf-space-sm);
2129
+ }
2130
+
2131
+ .magicfeedback-rating-number-container + .magicfeedback-rating-number-scale-label-block {
2132
+ margin-top: var(--mf-space-sm);
2133
+ }
2134
+
2135
+ .magicfeedback-rating-number-option {
2136
+ display: flex;
2137
+ }
2138
+
2139
+ .magicfeedback-rating-number-option-label-container {
2140
+ position: relative;
2141
+ width: 100%;
2142
+ display: flex;
2143
+ cursor: pointer;
2144
+ }
2145
+
2146
+ .magicfeedback-rating-number-option-label-container input[type="radio"] {
2147
+ position: absolute;
2148
+ opacity: 0;
2149
+ width: 0;
2150
+ height: 0;
2151
+ }
2152
+
2153
+ .magicfeedback-rating-number-value {
2154
+ display: flex;
2155
+ align-items: center;
2156
+ justify-content: center;
2157
+ width: 100%;
2158
+ transition: var(--mf-transition-fast);
2159
+ color: var(--mf-text-secondary);
2160
+ font-weight: var(--mf-font-weight-semibold);
2161
+ }
2162
+
2163
+ /* Row: individual outlined chips in the survey's own primary color \u2014
2164
+ var(--mf-primary) so whatever brand color a given survey sets carries
2165
+ through automatically, no color hardcoded here. */
2166
+ .magicfeedback-rating-number-container-row,
2167
+ .magicfeedback-rating-number-container-row-reverse {
2168
+ flex-wrap: nowrap;
2169
+ gap: var(--mf-space-sm);
2170
+ }
2171
+
2172
+ .magicfeedback-rating-number-option-row,
2173
+ .magicfeedback-rating-number-option-row-reverse {
2174
+ flex: 1 1 0;
2175
+ min-width: 0;
2176
+ }
2177
+
2178
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
2179
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
2180
+ min-height: 56px;
2181
+ padding: var(--mf-space-sm);
2182
+ border: 2px solid var(--mf-primary-border);
2183
+ border-radius: var(--mf-radius-md);
2184
+ background: var(--mf-bg-secondary);
2185
+ color: var(--mf-primary);
2186
+ font-size: var(--mf-font-size-lg);
2187
+ font-weight: var(--mf-font-weight-bold);
2188
+ }
2189
+
2190
+ /* More than 6 options (e.g. a 0-10 NPS scale): still one row, never
2191
+ wraps \u2014 but scaled down on purpose, so it reads as a compact chip
2192
+ rather than the same 56px button stretched thin. */
2193
+ .magicfeedback-rating-number-container-row--dense .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
2194
+ .magicfeedback-rating-number-container-row--dense .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
2195
+ min-height: 36px;
2196
+ padding: var(--mf-space-xs);
2197
+ border-radius: var(--mf-radius-sm);
2198
+ font-size: 0.8rem;
2199
+ }
2200
+
2201
+ @media (hover: hover) {
2202
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value,
2203
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
2204
+ background: var(--mf-primary-light);
2205
+ }
2206
+ }
2207
+
2208
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
2209
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
2210
+ color: var(--mf-on-primary);
2211
+ background-color: var(--mf-primary);
2212
+ box-shadow: var(--mf-shadow-md);
2213
+ }
2214
+
2215
+ /* Extra option: always its own row below the scale, and styled like every
2216
+ other chip now \u2014 "doesn't apply" is still not a point on the 1..N
2217
+ continuum, but it no longer needs a different border style to say so. */
2218
+ .magicfeedback-rating-number-extra-row {
2219
+ display: flex;
2220
+ justify-content: center;
2221
+ margin-top: var(--mf-space-sm);
2222
+ }
2223
+
2224
+ .magicfeedback-rating-number-option--extra {
2225
+ flex: 0 1 auto;
2226
+ }
2227
+
2228
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container {
2229
+ width: auto;
2230
+ }
2231
+
2232
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-value {
2233
+ min-height: 36px;
2234
+ padding: 0 var(--mf-space-md);
2235
+ border: 2px solid var(--mf-primary-border);
2236
+ border-radius: var(--mf-radius-md);
2237
+ background: var(--mf-bg-secondary);
2238
+ color: var(--mf-primary);
2239
+ font-size: var(--mf-font-size-sm);
2240
+ }
2241
+
2242
+ @media (hover: hover) {
2243
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
2244
+ background: var(--mf-primary-light);
2245
+ }
2246
+ }
2247
+
2248
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
2249
+ color: var(--mf-on-primary);
2250
+ background-color: var(--mf-primary);
2251
+ box-shadow: var(--mf-shadow-md);
2252
+ }
2253
+
2254
+ /* Column: the same separated chips as row, just stacked \u2014 each option is
2255
+ its own outlined chip with a gap between them, not one shared box. */
2256
+ .magicfeedback-rating-number-container-column,
2257
+ .magicfeedback-rating-number-container-column-reverse {
2258
+ gap: var(--mf-space-sm);
2259
+ }
2260
+
2261
+ .magicfeedback-rating-number-option-column,
2262
+ .magicfeedback-rating-number-option-column-reverse {
2263
+ width: 100%;
2264
+ }
2265
+
2266
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-value,
2267
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-value {
2268
+ justify-content: flex-start;
2269
+ gap: var(--mf-space-sm);
2270
+ min-height: 48px;
2271
+ padding: var(--mf-space-sm) var(--mf-space-md);
2272
+ border: 2px solid var(--mf-primary-border);
2273
+ border-radius: var(--mf-radius-md);
2274
+ background: var(--mf-bg-secondary);
2275
+ color: var(--mf-primary);
2276
+ }
2277
+
2278
+ @media (hover: hover) {
2279
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value,
2280
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
2281
+ background: var(--mf-primary-light);
2282
+ }
2283
+ }
2284
+
2285
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
2286
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
2287
+ color: var(--mf-on-primary);
2288
+ background-color: var(--mf-primary);
2289
+ box-shadow: var(--mf-shadow-md);
2290
+ }
2291
+
2292
+ .magicfeedback-rating-number-value-num {
2293
+ font-weight: var(--mf-font-weight-bold);
2294
+ }
2295
+
2296
+ /* Column with per-option text: a min-width so "1".."9" and "10" line up,
2297
+ with the label text starting at the same x. Skipped entirely when the
2298
+ column has no per-option text at all (--bare below) \u2014 with nothing to
2299
+ align against, the same left-shift bug from row mode would resurface. */
2300
+ .magicfeedback-rating-number-container-column:not(.magicfeedback-rating-number-container-column--bare) .magicfeedback-rating-number-value-num,
2301
+ .magicfeedback-rating-number-container-column-reverse:not(.magicfeedback-rating-number-container-column--bare) .magicfeedback-rating-number-value-num {
2302
+ flex: none;
2303
+ min-width: 1.4em;
2304
+ }
2305
+
2306
+ /* Column, no per-option text at all (only min/max, or nothing): a bare
2307
+ numbered list has nothing to left-align against, so center each
2308
+ number instead of stranding it on the left with blank space beside it. */
2309
+ .magicfeedback-rating-number-container-column--bare .magicfeedback-rating-number-value {
2310
+ justify-content: center;
2311
+ }
2312
+
2313
+ .magicfeedback-rating-number-value-label {
2314
+ font-weight: var(--mf-font-weight-medium);
2315
+ }
2316
+
2317
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
2318
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
2319
+ color: var(--mf-on-primary);
2320
+ background-color: var(--mf-primary);
2321
+ }
2322
+
2323
+ /* Star Rating */
2324
+ .magicfeedback-rating-star-container {
2325
+ justify-content: center;
2326
+ }
2327
+
2328
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star {
2329
+ font-size: 40px;
2330
+ color: var(--mf-border);
2331
+ cursor: pointer;
2332
+ margin: 0 var(--mf-space-xs);
2333
+ transition: var(--mf-transition-fast);
2334
+ }
2335
+
2336
+ @media (hover: hover) {
2337
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover,
2338
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover ~ span {
2339
+ color: var(--mf-star);
2340
+ transform: scale(1.1);
2341
+ }
2342
+ }
2343
+
2344
+ .magicfeedback-rating-star-selected {
2345
+ color: var(--mf-star) !important;
2346
+ }
2347
+
2348
+ /* ========================================
2349
+ MULTIPLE CHOICE WITH IMAGES
2350
+ ======================================== */
2351
+ .magicfeedback-multiple-choice-image-option {
2352
+ display: flex;
2353
+ border-radius: var(--mf-radius-md);
2354
+ overflow: hidden;
2355
+ transition: var(--mf-transition-fast);
2356
+ }
2357
+
2358
+ .magicfeedback-image-option-label-container {
2359
+ cursor: pointer;
2360
+ border-radius: var(--mf-radius-md);
2361
+ overflow: hidden;
2362
+ transition: var(--mf-transition-fast);
2363
+ }
2364
+
2365
+ .magicfeedback-image-option-label-container input[type="radio"],
2366
+ .magicfeedback-image-option-label-container input[type="checkbox"] {
2367
+ position: absolute;
2368
+ opacity: 0;
2369
+ width: 0;
2370
+ height: 0;
2371
+ }
2372
+
2373
+ .magicfeedback-image-option-label-container img {
2374
+ width: 100%;
2375
+ height: auto;
2376
+ display: block;
2377
+ border: 2px solid var(--mf-border);
2378
+ border-radius: var(--mf-radius-md);
2379
+ transition: var(--mf-transition-fast);
2380
+ }
2381
+
2382
+ @media (hover: hover) {
2383
+ .magicfeedback-image-option-label-container:hover img {
2384
+ border-color: var(--mf-primary);
2385
+ box-shadow: var(--mf-shadow-md);
2386
+ }
2387
+ }
2388
+
2389
+ .magicfeedback-image-option-label-container input:checked + img {
2390
+ border-color: var(--mf-primary);
2391
+ box-shadow: 0 0 0 3px var(--mf-primary-light);
2392
+ }
2393
+
2394
+ /* ========================================
2395
+ MATRIX QUESTIONS
2396
+ ======================================== */
2397
+ .magicfeedback-multi-question-matrix-container {
2398
+ width: 100%;
2399
+ overflow-x: auto;
2400
+ border-radius: var(--mf-radius-md);
2401
+ /* the layout follows the space the survey gets (a pop-in, a sidebar),
2402
+ not the size of the window */
2403
+ container-type: inline-size;
2404
+ }
2405
+
2406
+ .magicfeedback-multi-question-matrix-table {
2407
+ width: 100%;
2408
+ border-collapse: separate;
2409
+ border-spacing: 0 var(--mf-space-xs);
2410
+ }
2411
+
2412
+ .magicfeedback-multi-question-matrix-table th {
2413
+ padding: var(--mf-space-md);
2414
+ text-align: center;
2415
+ font-size: var(--mf-font-size-sm);
2416
+ font-weight: 500;
2417
+ color: var(--mf-text-secondary);
2418
+ }
2419
+
2420
+ .magicfeedback-multi-question-matrix-row-tr {
2421
+ background-color: var(--mf-bg-primary);
2422
+ border-radius: var(--mf-radius-md);
2423
+ transition: var(--mf-transition-fast);
2424
+ }
2425
+
2426
+ .magicfeedback-multi-question-matrix-row-tr:nth-child(even) {
2427
+ background-color: var(--mf-bg-secondary);
2428
+ }
2429
+
2430
+ @media (hover: hover) {
2431
+ .magicfeedback-multi-question-matrix-row-tr:hover {
2432
+ background-color: var(--mf-bg-hover);
2433
+ box-shadow: var(--mf-shadow-sm);
2434
+ }
2435
+ }
2436
+
2437
+ .magicfeedback-multi-question-matrix-table td {
2438
+ padding: var(--mf-space-md);
2439
+ text-align: center;
2440
+ }
2441
+
2442
+ .magicfeedback-multi-question-matrix-label {
2443
+ text-align: start;
2444
+ font-size: var(--mf-font-size-base);
2445
+ color: var(--mf-text-primary);
2446
+ }
2447
+
2448
+ .magicfeedback-multi-question-matrix-table input[type="radio"] {
2449
+ width: 20px;
2450
+ height: 20px;
2451
+ cursor: pointer;
2452
+ accent-color: var(--mf-primary);
2453
+ }
2454
+
2455
+ .magicfeedback-multi-question-matrix-question {
2456
+ min-width: 200px;
2457
+ padding: 10px;
2458
+ }
2459
+
2460
+ /* the column header names the option in a table; the per-cell label is for
2461
+ screen readers until the rows stack */
2462
+ .magicfeedback-multi-question-matrix-option-label {
2463
+ position: absolute;
2464
+ width: 1px;
2465
+ height: 1px;
2466
+ overflow: hidden;
2467
+ clip: rect(0, 0, 0, 0);
2468
+ white-space: nowrap;
2469
+ }
2470
+
2471
+ /* narrow container: every row becomes its own question with the options
2472
+ stacked underneath, instead of a table cut off at the side */
2473
+ @container (max-width: 599px) {
2474
+ .magicfeedback-multi-question-matrix-table,
2475
+ .magicfeedback-multi-question-matrix-table tbody,
2476
+ .magicfeedback-multi-question-matrix-table tr,
2477
+ .magicfeedback-multi-question-matrix-table td {
2478
+ display: block;
2479
+ width: 100%;
2480
+ }
2481
+
2482
+ .magicfeedback-multi-question-matrix-table thead {
2483
+ display: none;
2484
+ }
2485
+
2486
+ .magicfeedback-multi-question-matrix-row-tr,
2487
+ .magicfeedback-multi-question-matrix-row-tr:nth-child(even) {
2488
+ margin-bottom: var(--mf-space-lg);
2489
+ background: transparent;
2490
+ box-shadow: none;
2491
+ }
2492
+
2493
+ @media (hover: hover) {
2494
+ .magicfeedback-multi-question-matrix-row-tr:hover {
2495
+ margin-bottom: var(--mf-space-lg);
2496
+ background: transparent;
2497
+ box-shadow: none;
2498
+ }
2499
+ }
2500
+
2501
+ .magicfeedback-multi-question-matrix-table td.magicfeedback-multi-question-matrix-question {
2502
+ min-width: 0;
2503
+ padding: 0 0 var(--mf-space-sm);
2504
+ text-align: start;
2505
+ }
2506
+
2507
+ .magicfeedback-multi-question-matrix-question .magicfeedback-multi-question-matrix-label {
2508
+ font-weight: 600;
2509
+ }
2510
+
2511
+ .magicfeedback-multi-question-matrix-table td.magicfeedback-multi-question-matrix-option {
2512
+ display: flex;
2513
+ align-items: center;
2514
+ gap: var(--mf-space-sm);
2515
+ margin-bottom: var(--mf-space-sm);
2516
+ padding: 0 var(--mf-space-md);
2517
+ text-align: start;
2518
+ background: var(--mf-bg-secondary);
2519
+ border: 2px solid var(--mf-border);
2520
+ border-radius: var(--mf-radius-md);
2521
+ cursor: pointer;
2522
+ transition: var(--mf-transition-fast);
2523
+ }
2524
+
2525
+ @media (hover: hover) {
2526
+ .magicfeedback-multi-question-matrix-option:hover {
2527
+ border-color: var(--mf-primary-border);
2528
+ }
2529
+ }
2530
+
2531
+ .magicfeedback-multi-question-matrix-option:has(input:checked) {
2532
+ border-color: var(--mf-primary);
2533
+ background: var(--mf-primary-light);
2534
+ }
2535
+
2536
+ .magicfeedback-multi-question-matrix-table .magicfeedback-multi-question-matrix-option input[type="radio"] {
2537
+ flex-shrink: 0;
2538
+ }
2539
+
2540
+ /* the whole card is the click target */
2541
+ .magicfeedback-multi-question-matrix-option-label {
2542
+ position: static;
2543
+ flex: 1;
2544
+ width: auto;
2545
+ height: auto;
2546
+ padding: var(--mf-space-md) 0;
2547
+ overflow: visible;
2548
+ clip: auto;
2549
+ white-space: normal;
2550
+ font-size: var(--mf-font-size-base);
2551
+ color: var(--mf-text-primary);
2552
+ cursor: pointer;
2553
+ }
2554
+ }
2555
+
2556
+ /* ========================================
2557
+ MAXDIFF (BEST\u2013WORST)
2558
+ ======================================== */
2559
+ .magicfeedback-max-diff {
2560
+ /* "least" gets its own hue, apart from the brand color "most" uses; dark
2561
+ enough to read as header text and to hold the white center dot */
2562
+ --mf-max-diff-worst: #b45309;
2563
+ width: 100%;
2564
+ }
2565
+
2566
+ [data-mf-mode="dark"] .magicfeedback-max-diff {
2567
+ --mf-max-diff-worst: #F59E0B;
2568
+ }
2569
+
2570
+ .magicfeedback-max-diff-container {
2571
+ width: 100%;
2572
+ /* the layout follows the space the survey gets (a pop-in, a sidebar),
2573
+ not the size of the window */
2574
+ container-type: inline-size;
2575
+ }
2576
+
2577
+ .magicfeedback-max-diff-progress {
2578
+ display: flex;
2579
+ align-items: center;
2580
+ gap: var(--mf-space-md);
2581
+ margin-bottom: var(--mf-space-lg);
2582
+ }
2583
+
2584
+ .magicfeedback-max-diff-progress-label {
2585
+ font-size: 0.8125rem;
2586
+ font-weight: var(--mf-font-weight-bold);
2587
+ letter-spacing: 0.04em;
2588
+ text-transform: uppercase;
2589
+ white-space: nowrap;
2590
+ color: var(--mf-text-secondary);
2591
+ }
2592
+
2593
+ .magicfeedback-max-diff-progress-track {
2594
+ flex: 1;
2595
+ height: 6px;
2596
+ overflow: hidden;
2597
+ border-radius: var(--mf-radius-full);
2598
+ background: var(--mf-border);
2599
+ }
2600
+
2601
+ .magicfeedback-max-diff-progress-fill {
2602
+ display: block;
2603
+ height: 100%;
2604
+ border-radius: var(--mf-radius-full);
2605
+ background: var(--mf-primary);
2606
+ }
2607
+
2608
+ .magicfeedback-max-diff-table {
2609
+ width: 100%;
2610
+ border-collapse: collapse;
2611
+ }
2612
+
2613
+ .magicfeedback-max-diff-head,
2614
+ .magicfeedback-max-diff-head-spacer {
2615
+ border-bottom: 1px solid var(--mf-border);
2616
+ }
2617
+
2618
+ .magicfeedback-max-diff-head {
2619
+ width: 11rem;
2620
+ padding: 0 var(--mf-space-sm) var(--mf-space-sm);
2621
+ font-size: 0.8125rem;
2622
+ font-weight: var(--mf-font-weight-extrabold);
2623
+ letter-spacing: 0.04em;
2624
+ text-transform: uppercase;
2625
+ text-align: center;
2626
+ vertical-align: bottom;
2627
+ }
2628
+
2629
+ .magicfeedback-max-diff-head-best {
2630
+ color: var(--mf-primary);
2631
+ }
2632
+
2633
+ .magicfeedback-max-diff-head-worst {
2634
+ color: var(--mf-max-diff-worst);
2635
+ }
2636
+
2637
+ .magicfeedback-max-diff-head-label {
2638
+ display: inline-flex;
2639
+ align-items: center;
2640
+ gap: 6px;
2641
+ }
2642
+
2643
+ .magicfeedback-max-diff-row {
2644
+ transition: background-color 0.15s ease;
2645
+ }
2646
+
2647
+ .magicfeedback-max-diff-row > * {
2648
+ border-bottom: 1px solid var(--mf-border);
2649
+ }
2650
+
2651
+ .magicfeedback-max-diff-row:has(.magicfeedback-max-diff-best:checked) {
2652
+ background-color: color-mix(in srgb, var(--mf-primary) 8%, transparent);
2653
+ }
2654
+
2655
+ .magicfeedback-max-diff-row:has(.magicfeedback-max-diff-worst:checked) {
2656
+ background-color: color-mix(in srgb, var(--mf-max-diff-worst) 8%, transparent);
2657
+ }
2658
+
2659
+ .magicfeedback-max-diff-item {
2660
+ padding: var(--mf-space-md) var(--mf-space-sm);
2661
+ font-size: 1.0625rem;
2662
+ font-weight: var(--mf-font-weight-semibold);
2663
+ line-height: 1.4;
2664
+ text-align: center;
2665
+ color: var(--mf-text-primary);
2666
+ }
2667
+
2668
+ .magicfeedback-max-diff-row:has(input:checked) .magicfeedback-max-diff-item {
2669
+ font-weight: var(--mf-font-weight-extrabold);
2670
+ }
2671
+
2672
+ .magicfeedback-max-diff-cell {
2673
+ padding: 0;
2674
+ }
2675
+
2676
+ /* the whole cell is the click target */
2677
+ .magicfeedback-max-diff-pick {
2678
+ display: flex;
2679
+ align-items: center;
2680
+ justify-content: center;
2681
+ min-height: 64px;
2682
+ cursor: pointer;
2683
+ }
2684
+
2685
+ .magicfeedback-max-diff-input {
2686
+ appearance: none;
2687
+ -webkit-appearance: none;
2688
+ flex-shrink: 0;
2689
+ width: 26px;
2690
+ height: 26px;
2691
+ margin: 0;
2692
+ border: 2px solid color-mix(in srgb, var(--mf-text-secondary) 80%, var(--mf-tint-base));
2693
+ border-radius: var(--mf-radius-full);
2694
+ background: var(--mf-bg-secondary);
2695
+ cursor: pointer;
2696
+ transition: var(--mf-transition-fast);
2697
+ }
2698
+
2699
+ @media (hover: hover) {
2700
+ .magicfeedback-max-diff-pick:hover .magicfeedback-max-diff-input {
2701
+ transform: scale(1.08);
2702
+ }
2703
+ }
2704
+
2705
+ .magicfeedback-max-diff-best:checked {
2706
+ border-color: var(--mf-primary);
2707
+ background: radial-gradient(circle, var(--mf-on-primary) 0 4px, var(--mf-primary) 4.5px);
2708
+ }
2709
+
2710
+ .magicfeedback-max-diff-worst:checked {
2711
+ border-color: var(--mf-max-diff-worst);
2712
+ background: radial-gradient(circle, var(--mf-on-primary) 0 4px, var(--mf-max-diff-worst) 4.5px);
2713
+ }
2714
+
2715
+ .magicfeedback-max-diff-input:focus-visible {
2716
+ outline: 3px solid var(--mf-primary-border);
2717
+ outline-offset: 3px;
2718
+ }
2719
+
2720
+ /* narrow container: same table, slimmer pick columns and the header icon
2721
+ stacked over its label */
2722
+ @container (max-width: 599px) {
2723
+ .magicfeedback-max-diff-head {
2724
+ width: 4.75rem;
2725
+ padding-inline: 2px;
2726
+ font-size: 0.6875rem;
2727
+ }
2728
+
2729
+ .magicfeedback-max-diff-head-label {
2730
+ flex-direction: column;
2731
+ gap: 2px;
2732
+ }
2733
+
2734
+ .magicfeedback-max-diff-item {
2735
+ padding-inline: 4px;
2736
+ font-size: var(--mf-font-size-base);
2737
+ }
2738
+
2739
+ .magicfeedback-max-diff-pick {
2740
+ min-height: 68px;
2741
+ }
2742
+
2743
+ .magicfeedback-max-diff-input {
2744
+ width: 28px;
2745
+ height: 28px;
2746
+ }
2747
+ }
2748
+
2749
+ /* ========================================
2750
+ PRIORITY LIST
2751
+ ======================================== */
2752
+ .magicfeedback-priority-list-item {
2753
+ display: flex;
2754
+ align-items: center;
2755
+ justify-content: space-between;
2756
+ padding: var(--mf-space-md);
2757
+ margin: var(--mf-space-sm) 0;
2758
+ background-color: var(--mf-bg-primary);
2759
+ border: 1.5px solid var(--mf-border);
2760
+ border-radius: var(--mf-radius-md);
2761
+ transition: var(--mf-transition-fast);
2762
+ }
2763
+
2764
+ @media (hover: hover) {
2765
+ .magicfeedback-priority-list-item:hover {
2766
+ box-shadow: var(--mf-shadow-sm);
2767
+ border-color: var(--mf-primary);
2768
+ }
2769
+ }
2770
+
2771
+ .magicfeedback-priority-list-item-label {
2772
+ flex: 1;
2773
+ font-size: var(--mf-font-size-base);
2774
+ text-align: start;
2775
+ color: var(--mf-text-primary);
2776
+ margin: 0;
2777
+ }
2778
+
2779
+ .magicfeedback-priority-list-arrow-up,
2780
+ .magicfeedback-priority-list-arrow-down {
2781
+ padding: var(--mf-space-xs);
2782
+ font-size: var(--mf-font-size-lg);
2783
+ color: var(--mf-text-secondary);
2784
+ cursor: pointer;
2785
+ transition: var(--mf-transition-fast);
2786
+ user-select: none;
2787
+ }
2788
+
2789
+ @media (hover: hover) {
2790
+ .magicfeedback-priority-list-arrow-up:hover,
2791
+ .magicfeedback-priority-list-arrow-down:hover {
2792
+ color: var(--mf-primary);
2793
+ transform: scale(1.2);
2794
+ }
2795
+ }
2796
+
2797
+ /* ========================================
2798
+ POINT SYSTEM
2799
+ ======================================== */
2800
+ .magicfeedback-point-system-item {
2801
+ display: flex;
2802
+ align-items: center;
2803
+ justify-content: space-between;
2804
+ padding: var(--mf-space-md);
2805
+ margin: var(--mf-space-sm) 0;
2806
+ background-color: var(--mf-bg-primary);
2807
+ border: 1.5px solid var(--mf-border);
2808
+ border-radius: var(--mf-radius-md);
2809
+ min-height: 45px;
2810
+ }
2811
+
2812
+ .magicfeedback-point-system-item label {
2813
+ flex: 1;
2814
+ font-size: var(--mf-font-size-base);
2815
+ color: var(--mf-text-primary);
2816
+ margin: 0;
2817
+ }
2818
+
2819
+ .magicfeedback-point-system-input-container {
2820
+ display: flex;
2821
+ align-items: center;
2822
+ gap: var(--mf-space-sm);
2823
+ }
2824
+
2825
+ .magicfeedback-point-system-item input {
2826
+ width: 80px;
2827
+ min-width: 80px;
2828
+ padding: var(--mf-space-sm);
2829
+ text-align: center;
2830
+ font-size: var(--mf-font-size-base);
2831
+ border: 1.5px solid var(--mf-border);
2832
+ border-radius: var(--mf-radius-md);
2833
+ margin: 0;
2834
+ }
2835
+
2836
+ .magicfeedback-point-system-total {
2837
+ display: flex;
2838
+ justify-content: flex-end;
2839
+ margin-top: var(--mf-space-md);
2840
+ font-size: var(--mf-font-size-base);
2841
+ font-weight: 600;
2842
+ color: var(--mf-text-primary);
2843
+ }
2844
+
2845
+ /* ========================================
2846
+ CONSENT
2847
+ ======================================== */
2848
+ .magicfeedback-consent-container {
2849
+ display: flex;
2850
+ flex-direction: row;
2851
+ align-items: center;
2852
+ gap: var(--mf-space-sm);
2853
+ padding: var(--mf-space-md);
2854
+ background-color: var(--mf-bg-secondary);
2855
+ border-radius: var(--mf-radius-md);
2856
+ margin: var(--mf-space-md) 0;
2857
+ }
2858
+
2859
+ .magicfeedback-consent-container input[type="checkbox"] {
2860
+ margin-top: 2px;
2861
+ flex-shrink: 0;
2862
+ accent-color: var(--mf-primary);
2863
+ }
2864
+
2865
+ .magicfeedback-consent-container label {
2866
+ flex: 1;
2867
+ font-size: var(--mf-font-size-sm);
2868
+ text-align: start;
2869
+ color: var(--mf-text-secondary);
2870
+ line-height: var(--mf-line-height);
2871
+ cursor: pointer;
2872
+ margin-bottom: 0;
2873
+ }
2874
+
2875
+ /* ========================================
2876
+ ACTION BUTTONS
2877
+ ======================================== */
2878
+ .magicfeedback-action-container {
2879
+ display: flex;
2880
+ align-items: center;
2881
+ justify-content: space-between;
2882
+ gap: var(--mf-space-md);
2883
+ margin-top: var(--mf-space-xl);
2884
+ padding-top: var(--mf-space-lg);
2885
+ border-top: 1px solid var(--mf-border);
2886
+ }
2887
+
2888
+ .magicfeedback-submit {
2889
+ padding: 0.8rem 1.6rem;
2890
+ font-size: var(--mf-font-size-base);
2891
+ font-weight: 800;
2892
+ color: var(--mf-on-primary);
2893
+ background-color: var(--mf-primary);
2894
+ border: 2px solid var(--mf-primary);
2895
+ border-radius: var(--mf-radius-full);
2896
+ cursor: pointer;
2897
+ transition: var(--mf-transition-fast);
2898
+ box-shadow: var(--mf-shadow-md);
2899
+ }
2900
+
2901
+ @media (hover: hover) {
2902
+ .magicfeedback-submit:hover {
2903
+ background-color: var(--mf-primary-hover);
2904
+ box-shadow: var(--mf-shadow-lg);
2905
+ transform: translateY(-2px);
2906
+ }
2907
+ }
2908
+
2909
+ .magicfeedback-submit:active {
2910
+ transform: translateY(0);
2911
+ box-shadow: var(--mf-shadow-sm);
2912
+ }
2913
+
2914
+ .magicfeedback-submit:disabled {
2915
+ opacity: 0.5;
2916
+ cursor: not-allowed;
2917
+ transform: none;
2918
+ }
2919
+
2920
+ .magicfeedback-back {
2921
+ padding: 0.65rem 1rem;
2922
+ font-size: var(--mf-font-size-base);
2923
+ font-weight: 700;
2924
+ color: var(--mf-primary);
2925
+ background-color: var(--mf-bg-secondary);
2926
+ border: 2px solid var(--mf-border);
2927
+ border-radius: var(--mf-radius-full);
2928
+ cursor: pointer;
2929
+ transition: var(--mf-transition-fast);
2930
+ }
2931
+
2932
+ @media (hover: hover) {
2933
+ .magicfeedback-back:hover {
2934
+ border-color: var(--mf-primary);
2935
+ background-color: var(--mf-bg-hover);
2936
+ }
2937
+ }
2938
+
2939
+ /* hidden on the first page; keep the submit button on the right */
2940
+ .magicfeedback-back[hidden] {
2941
+ display: none;
2942
+ }
2943
+
2944
+ .magicfeedback-action-container .magicfeedback-submit {
2945
+ margin-left: auto;
2946
+ }
2947
+
2948
+ /* ========================================
2949
+ SKIP & COUNTER
2950
+ ======================================== */
2951
+ .magicfeedback-skip-container {
2952
+ display: flex;
2953
+ align-items: center;
2954
+ gap: var(--mf-space-xs);
2955
+ padding: 0;
2956
+ margin: 0;
2957
+ font-size: var(--mf-font-size-sm);
2958
+ color: var(--mf-text-muted);
2959
+ background: transparent;
2960
+ border: none;
2961
+ cursor: pointer;
2962
+ transition: var(--mf-transition-fast);
2963
+ }
2964
+
2965
+ @media (hover: hover) {
2966
+ .magicfeedback-skip-container:hover {
2967
+ color: var(--mf-primary);
2968
+ }
2969
+ }
2970
+
2971
+ .magicfeedback-skip-container input[type="checkbox"] {
2972
+ margin: 0;
2973
+ cursor: pointer;
2974
+ accent-color: var(--mf-primary);
2975
+ }
2976
+
2977
+ .magicfeedback-counter {
2978
+ display: flex;
2979
+ justify-content: flex-end;
2980
+ margin-top: var(--mf-space-md);
2981
+ font-size: var(--mf-font-size-sm);
2982
+ color: var(--mf-text-muted);
2983
+ }
2984
+
2985
+ /* ========================================
2986
+ MODAL STYLES
2987
+ ======================================== */
2988
+ /* Modal backdrop */
2989
+ .magicfeedback-modal-backdrop {
2990
+ position: fixed;
2991
+ top: 0;
2992
+ left: 0;
2993
+ width: 100vw;
2994
+ height: 100vh;
2995
+ background: var(--mf-overlay);
2996
+ display: none; /* toggled to flex when open */
2997
+ align-items: center;
2998
+ justify-content: center;
2999
+ z-index: 9999;
3000
+ }
3001
+
3002
+ /* Modal container */
3003
+ .magicfeedback-modal {
3004
+ background: var(--mf-surface);
3005
+ color: var(--mf-text-primary);
3006
+ border-radius: 8px;
3007
+ box-shadow: var(--mf-shadow-modal);
3008
+ max-width: 520px;
3009
+ width: 90%;
3010
+ max-height: 80vh;
3011
+ /* Flex column so the options list scrolls while the actions footer
3012
+ (counter + confirm button) stays pinned and always visible. */
3013
+ display: flex;
3014
+ flex-direction: column;
3015
+ overflow: hidden;
3016
+ padding: 16px;
3017
+ position: relative;
3018
+ /* Portalled to document.body (see renderPriorityList.ts) to escape the
3019
+ host page's overflow/z-index \u2014 so it never inherits
3020
+ .magicfeedback-container's neutral text color and instead inherits
3021
+ whatever color the host page's own <body> happens to set. Needs its
3022
+ own explicit baseline rather than relying on that inheritance. */
3023
+ color: var(--mf-text-primary);
3024
+ }
3025
+
3026
+ /* Modal actions */
3027
+ .magicfeedback-modal-actions {
3028
+ display: flex;
3029
+ justify-content: flex-end;
3030
+ gap: 8px;
3031
+ margin-top: 12px;
3032
+ flex-shrink: 0;
3033
+ }
3034
+
3035
+ .magicfeedback-modal-counter {
3036
+ margin-inline-end: auto;
3037
+ display: flex;
3038
+ align-items: center;
3039
+ font-size: 14px;
3040
+ color: var(--mf-text-secondary);
3041
+ }
3042
+
3043
+ /* Modal list */
3044
+ .magicfeedback-modal-list {
3045
+ display: flex;
3046
+ flex-direction: column;
3047
+ gap: 8px;
3048
+ /* Scrollable area; footer stays fixed below it. */
3049
+ flex: 1 1 auto;
3050
+ overflow-y: auto;
3051
+ min-height: 0;
3052
+ }
3053
+
3054
+ .magicfeedback-modal-row {
3055
+ display: flex;
3056
+ align-items: center;
3057
+ gap: 10px;
3058
+ cursor: pointer;
3059
+ }
3060
+
3061
+ /* Priority list header */
3062
+ .magicfeedback-priority-list-header {
3063
+ display: flex;
3064
+ align-items: center;
3065
+ justify-content: space-between;
3066
+ gap: 12px;
3067
+ margin-bottom: 8px;
3068
+ }
3069
+
3070
+ .magicfeedback-priority-list-reorder {
3071
+ margin-top: 8px;
3072
+ }
3073
+
3074
+ .magicfeedback-priority-list-list {
3075
+ padding: 0;
3076
+ list-style: none;
3077
+ }
3078
+
3079
+ .magicfeedback-priority-list-item {
3080
+ display: flex;
3081
+ justify-content: space-between;
3082
+ align-items: center;
3083
+ margin: 5px 0;
3084
+ }
3085
+
3086
+ .magicfeedback-priority-list-item-label {
3087
+ font-size: 15px;
3088
+ }
3089
+
3090
+ .magicfeedback-priority-list-arrows {
3091
+ display: flex;
3092
+ align-items: center;
3093
+ gap: 6px;
3094
+ }
3095
+
3096
+ /* Buttons */
3097
+ .magicfeedback-button {
3098
+ appearance: none;
3099
+ border: 2px solid var(--mf-border);
3100
+ border-radius: var(--mf-radius-full);
3101
+ background: var(--mf-bg-secondary);
3102
+ color: var(--mf-text-primary);
3103
+ padding: 0.6rem 1rem;
3104
+ font-size: 14px;
3105
+ font-weight: 700;
3106
+ cursor: pointer;
3107
+ box-shadow: var(--mf-shadow-sm);
3108
+ }
3109
+
3110
+ @media (hover: hover) {
3111
+ .magicfeedback-button:hover {
3112
+ background: var(--mf-bg-hover);
3113
+ border-color: var(--mf-primary);
3114
+ }
3115
+ }
3116
+
3117
+ .magicfeedback-button:active {
3118
+ transform: translateY(1px);
3119
+ }
3120
+
3121
+ .magicfeedback-button-primary {
3122
+ border-color: var(--mf-primary);
3123
+ background: var(--mf-primary);
3124
+ color: var(--mf-on-primary);
3125
+ box-shadow: var(--mf-shadow-md);
3126
+ }
3127
+
3128
+ @media (hover: hover) {
3129
+ .magicfeedback-button-primary:hover {
3130
+ background: var(--mf-primary-hover);
3131
+ }
3132
+ }
3133
+
3134
+ .magicfeedback-button-primary:active {
3135
+ background: var(--mf-primary-hover);
3136
+ }
3137
+
3138
+ /* Warning flash */
3139
+ .magicfeedback-warning {
3140
+ color: var(--mf-danger-text);
3141
+ }
3142
+
3143
+ /* Start message button */
3144
+ .magicfeedback-start-message-button {
3145
+ appearance: none;
3146
+ border: 2px solid var(--mf-primary);
3147
+ border-radius: var(--mf-radius-full);
3148
+ background: var(--mf-primary);
3149
+ color: var(--mf-on-primary);
3150
+ padding: 0.8rem 1.4rem;
3151
+ font-size: 15px;
3152
+ font-weight: 800;
3153
+ cursor: pointer;
3154
+ box-shadow: var(--mf-shadow-md);
3155
+ }
3156
+
3157
+ @media (hover: hover) {
3158
+ .magicfeedback-start-message-button:hover {
3159
+ background: var(--mf-primary-hover);
3160
+ }
3161
+ }
3162
+
3163
+ /* ========================================
3164
+ RESPONSIVE DESIGN
3165
+ ======================================== */
3166
+ @media (max-width: 768px) {
3167
+ :root {
3168
+ --mf-space-lg: 1.25rem;
3169
+ --mf-space-xl: 1.5rem;
3170
+ }
3171
+
3172
+ .magicfeedback-container {
3173
+ padding: 12px;
3174
+ border-radius: var(--mf-radius-md);
3175
+ }
3176
+
3177
+ .magicfeedback-form {
3178
+ padding: 14px;
3179
+ border-radius: var(--mf-radius-md);
3180
+ }
3181
+
3182
+ .magicfeedback-div {
3183
+ padding: 12px;
3184
+ gap: var(--mf-space-lg)
3185
+ }
3186
+
3187
+ .magicfeedback-label {
3188
+ font-size: var(--mf-font-size-base);
3189
+ }
3190
+
3191
+ .deepdots-popup input[type="date"],
3192
+ .deepdots-popup input[type="text"],
3193
+ .deepdots-popup input[type="number"],
3194
+ .deepdots-popup input[type="email"],
3195
+ .deepdots-popup input[type="password"],
3196
+ .deepdots-popup textarea,
3197
+ .deepdots-popup select {
3198
+ padding: 0.85rem 0.95rem;
3199
+ font-size: 1rem;
3200
+ min-height: 46px;
3201
+ }
3202
+
3203
+ /*
3204
+ .magicfeedback-radio-container,
3205
+ .magicfeedback-checkbox-container,
3206
+ .magicfeedback-boolean-container,
3207
+ .magicfeedback-consent-container {
3208
+ width: 100%;
3209
+ }
3210
+ */
3211
+
3212
+ .magicfeedback-radio-container,
3213
+ .magicfeedback-checkbox-container {
3214
+ padding: 10px 12px;
3215
+ border-radius: var(--mf-radius-md);
3216
+ border: 1px solid var(--mf-border);
3217
+ gap: 10px;
3218
+ }
3219
+
3220
+ .magicfeedback-rating-container,
3221
+ .magicfeedback-rating-number-container,
3222
+ .magicfeedback-rating-star-container {
3223
+ gap: 10px;
3224
+ }
3225
+
3226
+ .magicfeedback-boolean-container {
3227
+ flex-direction: column;
3228
+ gap: 10px;
3229
+ }
3230
+
3231
+ .magicfeedback-rating-number-container-row,
3232
+ .magicfeedback-rating-number-container-row-reverse {
3233
+ gap: 6px;
3234
+ }
3235
+
3236
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
3237
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
3238
+ min-height: 44px;
3239
+ padding: var(--mf-space-xs);
3240
+ font-size: 0.9rem;
3241
+ }
3242
+
3243
+ .magicfeedback-action-container {
3244
+ flex-direction: column-reverse;
3245
+ }
3246
+
3247
+ .magicfeedback-submit,
3248
+ .magicfeedback-back {
3249
+ width: 100%;
3250
+ text-align: center;
3251
+ min-height: 48px;
3252
+ }
3253
+ }
3254
+
3255
+ /* ========================================
3256
+ ACCESSIBILITY
3257
+ ======================================== */
3258
+ @media (prefers-reduced-motion: reduce) {
3259
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop), .deepdots-popup *,
3260
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)::before, .deepdots-popup *::before,
3261
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)::after, .deepdots-popup *::after {
3262
+ animation-duration: 0.01ms !important;
3263
+ animation-iteration-count: 1 !important;
3264
+ transition-duration: 0.01ms !important;
3265
+ }
3266
+ }
3267
+
3268
+
3269
+ /* ========================================
3270
+ UTILITY CLASSES
3271
+ ======================================== */
3272
+ .magicfeedback-visually-hidden {
3273
+ position: absolute;
3274
+ width: 1px;
3275
+ height: 1px;
3276
+ padding: 0;
3277
+ margin: -1px;
3278
+ overflow: hidden;
3279
+ clip: rect(0, 0, 0, 0);
3280
+ white-space: nowrap;
3281
+ border-width: 0;
3282
+ }
3283
+
3284
+ .magicfeedback-modal-close {
3285
+ position: absolute;
3286
+ top: 8px;
3287
+ inset-inline-end: 8px;
3288
+ background: transparent;
3289
+ border: none;
3290
+ font-size: 20px;
3291
+ line-height: 1;
3292
+ cursor: pointer;
3293
+ color: var(--mf-text-muted);
3294
+ }
3295
+
3296
+ .magicfeedback-modal-close:focus {
3297
+ color: var(--mf-text-strong);
3298
+ outline: none;
3299
+ }
3300
+
3301
+ @media (hover: hover) {
3302
+ .magicfeedback-modal-close:hover {
3303
+ color: var(--mf-text-strong);
3304
+ outline: none;
3305
+ }
3306
+ }
3307
+
3308
+ /* ========================================
3309
+ FILE / IMAGE UPLOAD
3310
+ ======================================== */
3311
+ .magicfeedback-upload {
3312
+ display: flex;
3313
+ flex-direction: column;
3314
+ gap: var(--mf-space-md);
3315
+ width: 100%;
3316
+ margin: 10px 0;
3317
+ }
3318
+
3319
+ /* The native input is an invisible, focusable overlay covering the dropzone. */
3320
+ .magicfeedback-upload-native {
3321
+ position: absolute;
3322
+ inset: 0;
3323
+ width: 100%;
3324
+ height: 100%;
3325
+ margin: 0;
3326
+ padding: 0;
3327
+ opacity: 0;
3328
+ cursor: pointer;
3329
+ z-index: 2;
3330
+ }
3331
+
3332
+ .magicfeedback-upload-dropzone {
3333
+ position: relative;
3334
+ display: flex;
3335
+ flex-direction: column;
3336
+ align-items: center;
3337
+ justify-content: center;
3338
+ gap: var(--mf-space-sm);
3339
+ box-sizing: border-box;
3340
+ width: 100%;
3341
+ min-height: 150px;
3342
+ padding: var(--mf-space-xl);
3343
+ text-align: center;
3344
+ border: 2px dashed var(--mf-border);
3345
+ border-radius: var(--mf-radius-md);
3346
+ background-color: var(--mf-surface-alt);
3347
+ cursor: pointer;
3348
+ transition: var(--mf-transition);
3349
+ }
3350
+
3351
+ @media (hover: hover) {
3352
+ .magicfeedback-upload-dropzone:hover {
3353
+ border-color: var(--mf-primary);
3354
+ background-color: var(--mf-bg-hover);
3355
+ }
3356
+ }
3357
+
3358
+ .magicfeedback-upload-dropzone:focus-within {
3359
+ border-color: var(--mf-primary);
3360
+ box-shadow: var(--mf-shadow-focus);
3361
+ }
3362
+
3363
+ .magicfeedback-upload-dropzone.is-dragover {
3364
+ border-color: var(--mf-primary);
3365
+ border-style: solid;
3366
+ background-color: var(--mf-primary-light);
3367
+ box-shadow: var(--mf-shadow-focus);
3368
+ }
3369
+
3370
+ .magicfeedback-upload-icon {
3371
+ display: inline-flex;
3372
+ align-items: center;
3373
+ justify-content: center;
3374
+ width: 46px;
3375
+ height: 46px;
3376
+ color: var(--mf-primary);
3377
+ background-color: var(--mf-surface);
3378
+ border-radius: var(--mf-radius-full);
3379
+ box-shadow: var(--mf-shadow-sm);
3380
+ pointer-events: none;
3381
+ }
3382
+
3383
+ .magicfeedback-upload-icon svg {
3384
+ width: 24px;
3385
+ height: 24px;
3386
+ }
3387
+
3388
+ .magicfeedback-upload-cta {
3389
+ font-family: inherit;
3390
+ font-weight: var(--mf-font-weight-semibold);
3391
+ font-size: var(--mf-font-size-base);
3392
+ color: var(--mf-text-primary);
3393
+ pointer-events: none;
3394
+ }
3395
+
3396
+ .magicfeedback-upload-hint {
3397
+ font-family: inherit;
3398
+ font-size: var(--mf-font-size-sm);
3399
+ color: var(--mf-text-muted);
3400
+ pointer-events: none;
3401
+ }
3402
+
3403
+ .magicfeedback-upload-list {
3404
+ display: flex;
3405
+ flex-direction: column;
3406
+ gap: var(--mf-space-sm);
3407
+ width: 100%;
3408
+ margin: 0;
3409
+ padding: 0;
3410
+ list-style: none;
3411
+ }
3412
+
3413
+ .magicfeedback-upload-list:empty {
3414
+ display: none;
3415
+ }
3416
+
3417
+ .magicfeedback-upload-file-item {
3418
+ display: flex;
3419
+ align-items: center;
3420
+ gap: var(--mf-space-md);
3421
+ padding: var(--mf-space-sm) var(--mf-space-md);
3422
+ background-color: var(--mf-surface);
3423
+ border: 1px solid var(--mf-border);
3424
+ border-radius: var(--mf-radius-sm);
3425
+ box-shadow: var(--mf-shadow-sm);
3426
+ animation: mf-scale-in 0.2s ease-out;
3427
+ }
3428
+
3429
+ .magicfeedback-upload-thumb {
3430
+ flex: 0 0 auto;
3431
+ display: inline-flex;
3432
+ align-items: center;
3433
+ justify-content: center;
3434
+ width: 40px;
3435
+ height: 40px;
3436
+ overflow: hidden;
3437
+ color: var(--mf-text-secondary);
3438
+ background-color: var(--mf-surface-alt);
3439
+ border-radius: var(--mf-radius-sm);
3440
+ }
3441
+
3442
+ .magicfeedback-upload-thumb img {
3443
+ width: 100%;
3444
+ height: 100%;
3445
+ object-fit: cover;
3446
+ }
3447
+
3448
+ .magicfeedback-upload-thumb svg {
3449
+ width: 20px;
3450
+ height: 20px;
3451
+ }
3452
+
3453
+ .magicfeedback-upload-file-info {
3454
+ display: flex;
3455
+ flex-direction: column;
3456
+ flex: 1 1 auto;
3457
+ min-width: 0;
3458
+ text-align: start;
3459
+ }
3460
+
3461
+ .magicfeedback-upload-file-name {
3462
+ font-family: inherit;
3463
+ font-size: var(--mf-font-size-sm);
3464
+ font-weight: var(--mf-font-weight-semibold);
3465
+ color: var(--mf-text-primary);
3466
+ white-space: nowrap;
3467
+ overflow: hidden;
3468
+ text-overflow: ellipsis;
3469
+ }
3470
+
3471
+ .magicfeedback-upload-file-size {
3472
+ font-family: inherit;
3473
+ font-size: 0.75rem;
3474
+ color: var(--mf-text-muted);
3475
+ }
3476
+
3477
+ .magicfeedback-upload-remove {
3478
+ flex: 0 0 auto;
3479
+ display: inline-flex;
3480
+ align-items: center;
3481
+ justify-content: center;
3482
+ width: 30px;
3483
+ height: 30px;
3484
+ padding: 0;
3485
+ color: var(--mf-text-muted);
3486
+ background-color: transparent;
3487
+ border: none;
3488
+ border-radius: var(--mf-radius-full);
3489
+ cursor: pointer;
3490
+ transition: var(--mf-transition-fast);
3491
+ }
3492
+
3493
+ .magicfeedback-upload-remove:focus-visible {
3494
+ color: var(--mf-error);
3495
+ background-color: var(--mf-primary-light);
3496
+ outline: none;
3497
+ }
3498
+
3499
+ @media (hover: hover) {
3500
+ .magicfeedback-upload-remove:hover {
3501
+ color: var(--mf-error);
3502
+ background-color: var(--mf-primary-light);
3503
+ outline: none;
3504
+ }
3505
+ }
3506
+
3507
+ .magicfeedback-upload-remove svg {
3508
+ width: 16px;
3509
+ height: 16px;
3510
+ }
3511
+
3512
+ .magicfeedback-upload-error {
3513
+ display: none;
3514
+ font-family: inherit;
3515
+ font-size: var(--mf-font-size-sm);
3516
+ color: var(--mf-error);
3517
+ }
3518
+
3519
+ .magicfeedback-upload-error.is-visible {
3520
+ display: block;
3521
+ }
3522
+
3523
+ /* ========================================
3524
+ RTL (Arabic)
3525
+ ========================================
3526
+ The SDK stamps dir="rtl" (and .magicfeedback-rtl) on the survey container
3527
+ for right-to-left languages. Everything else in this stylesheet uses logical
3528
+ properties (text-align: start, padding-inline-*, inset-inline-*), so it
3529
+ mirrors on its own; only the handful of rules that cannot be expressed
3530
+ logically live here.
3531
+
3532
+ Rules are scoped to [dir="rtl"] inside our own subtree so a host page that is
3533
+ itself RTL, or one that embeds an Arabic survey in an LTR page, both render
3534
+ correctly. */
3535
+
3536
+ /* background-position has no logical form: move the select caret to the
3537
+ left edge, opposite the padding that inset-inline-end already mirrored. */
3538
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] select {
3539
+ background-position: left var(--mf-space-md) center;
3540
+ }
3541
+
3542
+ /* Emails, URLs, numbers, dates and phone numbers are latin/numeric content
3543
+ even in an Arabic survey: keep their own direction LTR so punctuation
3544
+ (@, ., +, /) lands where the user expects, but align them to the start of
3545
+ the RTL line so they still read as part of the form. */
3546
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="email"],
3547
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="url"],
3548
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="number"],
3549
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="tel"],
3550
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="date"],
3551
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="time"] {
3552
+ direction: ltr;
3553
+ text-align: right;
3554
+ }
3555
+
3556
+ /* Mirror of mf-slide-in: questions enter from the reading edge. */
3557
+ @keyframes mf-slide-in-rtl {
3558
+ from {
3559
+ opacity: 0;
3560
+ transform: translateX(16px);
3561
+ }
3562
+ to {
3563
+ opacity: 1;
3564
+ transform: translateX(0);
3565
+ }
3566
+ }
3567
+
3568
+ [dir="rtl"] .magicfeedback-div {
3569
+ animation-name: mf-slide-in-rtl;
3570
+ }
3571
+
3572
+ /* ========================================
3573
+ LOCAL \u2014 reglas del popup, no vienen del paquete
3574
+ ======================================== */
3575
+
3576
+ /* Los controles de formulario no heredan font-family: cuando el popup trae fuente propia
3577
+ (clase deepdots-has-font), se les fuerza la del contenedor. */
3578
+ .deepdots-popup.deepdots-has-font button,
3579
+ .deepdots-popup.deepdots-has-font input,
3580
+ .deepdots-popup.deepdots-has-font textarea,
3581
+ .deepdots-popup.deepdots-has-font select {
3582
+ font-family: var(--deepdots-font, inherit);
3583
+ }
3584
+
3585
+ /* WebKit s\xED aplica el padding al radio nativo: con padding el control se dibuja enorme (se vio
3586
+ en iOS, WebView de RN y Safari, no en Chrome). El paquete ya no lo pone, pero la regla es
3587
+ barata y evita que vuelva. */
3588
+ .deepdots-popup input[type="radio"] {
3589
+ padding: 0;
3590
+ }
3591
+ `;
3592
+ }
3593
+ });
3594
+
3595
+ // src/util/logger.ts
3596
+ function setLogger(logger) {
3597
+ active = logger ?? console;
3598
+ }
3599
+ function sdkLog(...args) {
3600
+ active.log(...args);
3601
+ }
3602
+ function sdkWarn(...args) {
3603
+ (active.warn ?? active.log)(...args);
3604
+ }
3605
+ function sdkError(...args) {
3606
+ (active.error ?? active.log)(...args);
3607
+ }
3608
+ var active;
3609
+ var init_logger = __esm({
3610
+ "src/util/logger.ts"() {
966
3611
  "use strict";
967
- BUSY_JS = `
968
- function ddSetSurveyBusy(el, busy){
969
- if(!el){ return; }
970
- el.style.pointerEvents = busy ? 'none' : '';
971
- el.setAttribute('aria-busy', busy ? 'true' : 'false');
972
- if('inert' in el){ el.inert = busy; }
973
- }`;
3612
+ active = console;
974
3613
  }
975
3614
  });
976
3615
 
977
- // src/ui/submitError.ts
978
- function submitErrorText(error) {
979
- if (!error) return "";
980
- if (typeof error === "string") return error;
981
- const message = error.message;
982
- return typeof message === "string" ? message : String(error);
983
- }
984
- function classifySubmitError(error) {
985
- const message = submitErrorText(error).slice(0, SURVEY_ERROR_MESSAGE_MAX);
986
- const code = error && typeof error === "object" ? error.code : void 0;
987
- if (typeof code === "string" && REASON_BY_CODE[code]) return { reason: REASON_BY_CODE[code], message };
988
- if (message.toLowerCase().includes("no response")) return { reason: "required", message };
989
- return { reason: "unknown", message };
3616
+ // src/ui/logo.ts
3617
+ function insertPopupLogo(parent, anchor, style, id) {
3618
+ if (!style?.logo) return null;
3619
+ if (parent.ownerDocument.getElementById(id)) return null;
3620
+ const img = parent.ownerDocument.createElement("img");
3621
+ img.id = id;
3622
+ img.src = style.logo;
3623
+ img.alt = "Logo";
3624
+ img.style.cssText = BASE_CSS;
3625
+ if (style.logoSize && MAX_HEIGHT[style.logoSize]) {
3626
+ img.style.maxHeight = MAX_HEIGHT[style.logoSize];
3627
+ }
3628
+ switch (style.logoPosition) {
3629
+ case "left":
3630
+ img.style.margin = "12px 0 0 0";
3631
+ img.style.setProperty("margin-inline-start", "0");
3632
+ img.style.setProperty("margin-inline-end", "16px");
3633
+ break;
3634
+ case "right":
3635
+ img.style.margin = "12px 0 0 0";
3636
+ img.style.setProperty("margin-inline-start", "auto");
3637
+ img.style.setProperty("margin-inline-end", "0");
3638
+ break;
3639
+ case "center":
3640
+ img.style.margin = "12px auto 0 auto";
3641
+ break;
3642
+ }
3643
+ parent.insertBefore(img, anchor);
3644
+ return img;
990
3645
  }
991
- var SURVEY_ERROR_MESSAGE_MAX, REASON_BY_CODE, SUBMIT_ERROR_JS;
992
- var init_submitError = __esm({
993
- "src/ui/submitError.ts"() {
3646
+ var BASE_CSS, MAX_HEIGHT;
3647
+ var init_logo = __esm({
3648
+ "src/ui/logo.ts"() {
994
3649
  "use strict";
995
- SURVEY_ERROR_MESSAGE_MAX = 300;
996
- REASON_BY_CODE = {
997
- REQUIRED: "required",
998
- INVALID_EMAIL: "invalid_email",
999
- SEND_FAILED: "send_failed",
1000
- NO_PAGE: "no_page"
3650
+ BASE_CSS = "max-height:40px; max-width:100%; object-fit:contain; display:block; margin:12px 0 0 0;";
3651
+ MAX_HEIGHT = {
3652
+ small: "30px",
3653
+ medium: "50px",
3654
+ large: "70px"
1001
3655
  };
1002
- SUBMIT_ERROR_JS = `
1003
- function ddClassifySubmitError(error){
1004
- var message='';
1005
- if(error){
1006
- if(typeof error==='string'){ message=error; }
1007
- else if(typeof error.message==='string'){ message=error.message; }
1008
- else { message=String(error); }
1009
- }
1010
- message=message.slice(0, ${SURVEY_ERROR_MESSAGE_MAX});
1011
- var byCode={ REQUIRED:'required', INVALID_EMAIL:'invalid_email', SEND_FAILED:'send_failed', NO_PAGE:'no_page' };
1012
- var code=error && typeof error==='object' ? error.code : undefined;
1013
- if(typeof code==='string' && byCode.hasOwnProperty(code)){ return { reason: byCode[code], message: message }; }
1014
- if(message.toLowerCase().indexOf('no response')!==-1){ return { reason: 'required', message: message }; }
1015
- return { reason: 'unknown', message: message };
1016
- }`;
1017
3656
  }
1018
3657
  });
1019
3658
 
1020
- // src/assets/style.css
1021
- var style_default;
1022
- var init_style = __esm({
1023
- "src/assets/style.css"() {
1024
- style_default = `/**
3659
+ // src/assets/survey-css/2.2.38.css
3660
+ var require__ = __commonJS({
3661
+ "src/assets/survey-css/2.2.38.css"(exports, module2) {
3662
+ module2.exports = `/**
1025
3663
  * NO EDITAR A MANO \u2014 generado por scripts/vendor-survey-css.mjs
1026
3664
  *
1027
- * Copia de @magicfeedback/native@2.2.39 \u2192 dist/styles/magicfeedback-default.css
3665
+ * Copia de @magicfeedback/native@2.2.38 \u2192 dist/styles/magicfeedback-default.css
1028
3666
  * (la hoja can\xF3nica del paquete, la que apunta su campo "style"), con estos cambios locales:
1029
3667
  *
1030
3668
  * 1. Sin el @import de Google Fonts (Nunito): no queremos una petici\xF3n externa desde la
@@ -1556,7 +4194,6 @@ var init_style = __esm({
1556
4194
 
1557
4195
  .magicfeedback-email-hint {
1558
4196
  margin: 0;
1559
- text-align: start;
1560
4197
  font-size: var(--mf-font-size-sm);
1561
4198
  line-height: 1.45;
1562
4199
  color: var(--mf-text-secondary);
@@ -3361,77 +5998,13 @@ div.magicfeedback-radio {
3361
5998
  }
3362
5999
  });
3363
6000
 
3364
- // src/util/logger.ts
3365
- function setLogger(logger) {
3366
- active = logger ?? console;
3367
- }
3368
- function sdkLog(...args) {
3369
- active.log(...args);
3370
- }
3371
- function sdkWarn(...args) {
3372
- (active.warn ?? active.log)(...args);
3373
- }
3374
- function sdkError(...args) {
3375
- (active.error ?? active.log)(...args);
3376
- }
3377
- var active;
3378
- var init_logger = __esm({
3379
- "src/util/logger.ts"() {
3380
- "use strict";
3381
- active = console;
3382
- }
3383
- });
3384
-
3385
- // src/ui/logo.ts
3386
- function insertPopupLogo(parent, anchor, style, id) {
3387
- if (!style?.logo) return null;
3388
- if (parent.ownerDocument.getElementById(id)) return null;
3389
- const img = parent.ownerDocument.createElement("img");
3390
- img.id = id;
3391
- img.src = style.logo;
3392
- img.alt = "Logo";
3393
- img.style.cssText = BASE_CSS;
3394
- if (style.logoSize && MAX_HEIGHT[style.logoSize]) {
3395
- img.style.maxHeight = MAX_HEIGHT[style.logoSize];
3396
- }
3397
- switch (style.logoPosition) {
3398
- case "left":
3399
- img.style.margin = "12px 0 0 0";
3400
- img.style.setProperty("margin-inline-start", "0");
3401
- img.style.setProperty("margin-inline-end", "16px");
3402
- break;
3403
- case "right":
3404
- img.style.margin = "12px 0 0 0";
3405
- img.style.setProperty("margin-inline-start", "auto");
3406
- img.style.setProperty("margin-inline-end", "0");
3407
- break;
3408
- case "center":
3409
- img.style.margin = "12px auto 0 auto";
3410
- break;
3411
- }
3412
- parent.insertBefore(img, anchor);
3413
- return img;
3414
- }
3415
- var BASE_CSS, MAX_HEIGHT;
3416
- var init_logo = __esm({
3417
- "src/ui/logo.ts"() {
3418
- "use strict";
3419
- BASE_CSS = "max-height:40px; max-width:100%; object-fit:contain; display:block; margin:12px 0 0 0;";
3420
- MAX_HEIGHT = {
3421
- small: "30px",
3422
- medium: "50px",
3423
- large: "70px"
3424
- };
3425
- }
3426
- });
3427
-
3428
- // src/assets/survey-css/2.2.38.css
3429
- var require__ = __commonJS({
3430
- "src/assets/survey-css/2.2.38.css"(exports, module2) {
6001
+ // src/assets/survey-css/2.2.39.css
6002
+ var require__2 = __commonJS({
6003
+ "src/assets/survey-css/2.2.39.css"(exports, module2) {
3431
6004
  module2.exports = `/**
3432
6005
  * NO EDITAR A MANO \u2014 generado por scripts/vendor-survey-css.mjs
3433
6006
  *
3434
- * Copia de @magicfeedback/native@2.2.38 \u2192 dist/styles/magicfeedback-default.css
6007
+ * Copia de @magicfeedback/native@2.2.39 \u2192 dist/styles/magicfeedback-default.css
3435
6008
  * (la hoja can\xF3nica del paquete, la que apunta su campo "style"), con estos cambios locales:
3436
6009
  *
3437
6010
  * 1. Sin el @import de Google Fonts (Nunito): no queremos una petici\xF3n externa desde la
@@ -3963,6 +6536,7 @@ var require__ = __commonJS({
3963
6536
 
3964
6537
  .magicfeedback-email-hint {
3965
6538
  margin: 0;
6539
+ text-align: start;
3966
6540
  font-size: var(--mf-font-size-sm);
3967
6541
  line-height: 1.45;
3968
6542
  color: var(--mf-text-secondary);
@@ -5767,21 +8341,21 @@ div.magicfeedback-radio {
5767
8341
  }
5768
8342
  });
5769
8343
 
5770
- // src/assets/survey-css/2.2.39.css
5771
- var require__2 = __commonJS({
5772
- "src/assets/survey-css/2.2.39.css"(exports, module2) {
8344
+ // src/assets/survey-css/2.2.44.css
8345
+ var require__3 = __commonJS({
8346
+ "src/assets/survey-css/2.2.44.css"(exports, module2) {
5773
8347
  module2.exports = `/**
5774
8348
  * NO EDITAR A MANO \u2014 generado por scripts/vendor-survey-css.mjs
5775
8349
  *
5776
- * Copia de @magicfeedback/native@2.2.39 \u2192 dist/styles/magicfeedback-default.css
8350
+ * Copia de @magicfeedback/native@2.2.44 \u2192 dist/styles/magicfeedback-default.css
5777
8351
  * (la hoja can\xF3nica del paquete, la que apunta su campo "style"), con estos cambios locales:
5778
8352
  *
5779
8353
  * 1. Sin el @import de Google Fonts (Nunito): no queremos una petici\xF3n externa desde la
5780
8354
  * p\xE1gina del host, y la tipograf\xEDa la decide el popup.
5781
8355
  * 2. .magicfeedback-container hereda la fuente del popup (var(--deepdots-font, inherit)).
5782
- * 3. Los selectores desnudos (h2, p, input, textarea, select, ::placeholder, .error) van
5783
- * acotados a .deepdots-popup: este CSS se inyecta en el <head> del host y sin acotar
5784
- * repintar\xEDa su web.
8356
+ * 3. Los selectores de elementos (h2, p, input\u2026) vienen acotados por el paquete con
8357
+ * :where(.magicfeedback-container, \u2026) desde 2.2.43 (DD-180); ese prefijo se cambia por
8358
+ * .deepdots-popup, el mismo alcance que antes (tambi\xE9n visten t\xEDtulo y mensaje final).
5785
8359
  * 4. El grupo .magicfeedback-radio se cualifica como div.magicfeedback-radio (la clase acaba
5786
8360
  * tambi\xE9n en el <input> del boolean).
5787
8361
  * 5. Todo :hover va dentro de @media (hover: hover): en t\xE1ctil WebKit deja el hover pegado
@@ -5817,11 +8391,16 @@ var require__2 = __commonJS({
5817
8391
  scale below, not tied to the brand color. */
5818
8392
  --mf-primary: #5d7bad;
5819
8393
  --mf-primary-hover: color-mix(in srgb, var(--mf-primary) 85%, black);
5820
- --mf-primary-light: color-mix(in srgb, var(--mf-primary) 15%, white);
8394
+ /* --mf-tint-base is what light tints mix into: white here, the dark
8395
+ surface in dark mode (DD-238). */
8396
+ --mf-tint-base: #FFFFFF;
8397
+ --mf-primary-light-mix: 15%;
8398
+ --mf-primary-border-mix: 35%;
8399
+ --mf-primary-light: color-mix(in srgb, var(--mf-primary) var(--mf-primary-light-mix), var(--mf-tint-base));
5821
8400
  /* a translucent tint \u2014 mixed with transparent (opacity), not white,
5822
8401
  so it reads as a soft shadow of the brand color rather than a
5823
8402
  pastel of it. */
5824
- --mf-primary-border: color-mix(in srgb, var(--mf-primary) 35%, transparent);
8403
+ --mf-primary-border: color-mix(in srgb, var(--mf-primary) var(--mf-primary-border-mix), transparent);
5825
8404
 
5826
8405
  --mf-text-primary: #1E293B;
5827
8406
  --mf-text-secondary: #475569;
@@ -5842,6 +8421,15 @@ var require__2 = __commonJS({
5842
8421
  --mf-surface-alt: #F1F5F9;
5843
8422
  --mf-accent: #38BDF8;
5844
8423
 
8424
+ /* Colors that used to be hard-coded in rules and render code (DD-238) */
8425
+ --mf-on-primary: #FFFFFF;
8426
+ --mf-text-strong: #000000;
8427
+ --mf-danger-text: #C70039;
8428
+ --mf-star: #fbbf24;
8429
+ --mf-star-empty: #CCCCCC;
8430
+ --mf-overlay: rgba(0, 0, 0, 0.4);
8431
+ --mf-shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.2);
8432
+
5845
8433
  /* Spacing */
5846
8434
  --mf-space-xs: 0.25rem;
5847
8435
  --mf-space-sm: 0.5rem;
@@ -5882,6 +8470,58 @@ var require__2 = __commonJS({
5882
8470
  --mf-transition-fast: all 0.15s ease;
5883
8471
  }
5884
8472
 
8473
+ /* ========================================
8474
+ DARK MODE (DD-238)
8475
+ Set by the SDK on the container (and the portaled modal backdrop) when the
8476
+ survey Style background is dark, or when the host forces mode: 'dark'.
8477
+ The Style's own dark background colors are written inline on the same
8478
+ element, so they win over the defaults below; the derived tokens use var()
8479
+ so they resolve against those inline values.
8480
+ ======================================== */
8481
+ .magicfeedback-container[data-mf-mode="dark"],
8482
+ .magicfeedback-preview[data-mf-mode="dark"],
8483
+ .magicfeedback-modal-backdrop[data-mf-mode="dark"] {
8484
+ color-scheme: dark;
8485
+
8486
+ --mf-text-primary: #F1F5F9;
8487
+ --mf-text-secondary: #CBD5E1;
8488
+ --mf-text-muted: #94A3B8;
8489
+ --mf-text-strong: #FFFFFF;
8490
+
8491
+ --mf-bg-primary: #0F172A;
8492
+ --mf-bg-secondary: #1E293B;
8493
+ --mf-surface: #1E293B;
8494
+ --mf-surface-alt: color-mix(in srgb, var(--mf-surface) 90%, white);
8495
+ --mf-bg-hover: color-mix(in srgb, var(--mf-surface) 84%, white);
8496
+ --mf-border: color-mix(in srgb, var(--mf-surface) 72%, white);
8497
+
8498
+ --mf-tint-base: var(--mf-surface);
8499
+ --mf-primary-light-mix: 30%;
8500
+ --mf-primary-border-mix: 55%;
8501
+ --mf-primary-light: color-mix(in srgb, var(--mf-primary) var(--mf-primary-light-mix), var(--mf-tint-base));
8502
+ --mf-primary-border: color-mix(in srgb, var(--mf-primary) var(--mf-primary-border-mix), transparent);
8503
+
8504
+ --mf-success: #4ADE80;
8505
+ --mf-error: #F87171;
8506
+ --mf-warning: #FBBF24;
8507
+ --mf-danger-text: #FF8FA3;
8508
+ --mf-star-empty: color-mix(in srgb, var(--mf-surface) 60%, white);
8509
+ --mf-overlay: rgba(0, 0, 0, 0.6);
8510
+
8511
+ --mf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
8512
+ --mf-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
8513
+ --mf-shadow-lg: 0 16px 30px rgba(0, 0, 0, 0.45);
8514
+ --mf-shadow-focus: 0 0 0 3px rgba(241, 245, 249, 0.25);
8515
+ --mf-shadow-card: 0 18px 40px rgba(0, 0, 0, 0.35);
8516
+ --mf-shadow-modal: 0 8px 24px rgba(0, 0, 0, 0.6);
8517
+ }
8518
+
8519
+ /* Priority list arrows are a black SVG image: flip them to light. */
8520
+ [data-mf-mode="dark"] .magicfeedback-priority-list-arrow-up,
8521
+ [data-mf-mode="dark"] .magicfeedback-priority-list-arrow-down {
8522
+ filter: invert(1);
8523
+ }
8524
+
5885
8525
  /* ========================================
5886
8526
  ANIMATIONS
5887
8527
  ======================================== */
@@ -6150,6 +8790,12 @@ var require__2 = __commonJS({
6150
8790
  margin-bottom: var(--mf-space-sm);
6151
8791
  }
6152
8792
 
8793
+ /* Element rules (h2, p, inputs, ...) are scoped to the survey container, the
8794
+ previewQuestion() host and the priority-list modal, which is portaled to
8795
+ <body>. This sheet is
8796
+ loaded on the host page, so a bare \`p\` or \`input\` would restyle the host
8797
+ app too. :where() keeps the specificity of the bare selector, so every
8798
+ .magicfeedback-* rule still wins over these as before. */
6153
8799
  .deepdots-popup h2 {
6154
8800
  font-size: var(--mf-font-size-xl);
6155
8801
  font-weight: 600;
@@ -6256,7 +8902,7 @@ var require__2 = __commonJS({
6256
8902
  font-size: 1.35rem;
6257
8903
  font-weight: var(--mf-font-weight-extrabold);
6258
8904
  line-height: 1;
6259
- color: #FFFFFF;
8905
+ color: var(--mf-on-primary);
6260
8906
  background-color: var(--mf-secondary, #2E2E2E);
6261
8907
  border: 2px solid var(--mf-secondary, #2E2E2E);
6262
8908
  border-radius: var(--mf-radius-full);
@@ -6730,7 +9376,7 @@ div.magicfeedback-radio {
6730
9376
 
6731
9377
  .magicfeedback-rating-number-option-row .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
6732
9378
  .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
6733
- color: #fff;
9379
+ color: var(--mf-on-primary);
6734
9380
  background-color: var(--mf-primary);
6735
9381
  box-shadow: var(--mf-shadow-md);
6736
9382
  }
@@ -6769,7 +9415,7 @@ div.magicfeedback-radio {
6769
9415
  }
6770
9416
 
6771
9417
  .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
6772
- color: #fff;
9418
+ color: var(--mf-on-primary);
6773
9419
  background-color: var(--mf-primary);
6774
9420
  box-shadow: var(--mf-shadow-md);
6775
9421
  }
@@ -6807,7 +9453,7 @@ div.magicfeedback-radio {
6807
9453
 
6808
9454
  .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
6809
9455
  .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
6810
- color: #fff;
9456
+ color: var(--mf-on-primary);
6811
9457
  background-color: var(--mf-primary);
6812
9458
  box-shadow: var(--mf-shadow-md);
6813
9459
  }
@@ -6839,7 +9485,7 @@ div.magicfeedback-radio {
6839
9485
 
6840
9486
  .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
6841
9487
  .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
6842
- color: #fff;
9488
+ color: var(--mf-on-primary);
6843
9489
  background-color: var(--mf-primary);
6844
9490
  }
6845
9491
 
@@ -6859,13 +9505,13 @@ div.magicfeedback-radio {
6859
9505
  @media (hover: hover) {
6860
9506
  .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover,
6861
9507
  .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover ~ span {
6862
- color: #fbbf24;
9508
+ color: var(--mf-star);
6863
9509
  transform: scale(1.1);
6864
9510
  }
6865
9511
  }
6866
9512
 
6867
9513
  .magicfeedback-rating-star-selected {
6868
- color: #fbbf24 !important;
9514
+ color: var(--mf-star) !important;
6869
9515
  }
6870
9516
 
6871
9517
  /* ========================================
@@ -7086,6 +9732,10 @@ div.magicfeedback-radio {
7086
9732
  width: 100%;
7087
9733
  }
7088
9734
 
9735
+ [data-mf-mode="dark"] .magicfeedback-max-diff {
9736
+ --mf-max-diff-worst: #F59E0B;
9737
+ }
9738
+
7089
9739
  .magicfeedback-max-diff-container {
7090
9740
  width: 100%;
7091
9741
  /* the layout follows the space the survey gets (a pop-in, a sidebar),
@@ -7208,7 +9858,7 @@ div.magicfeedback-radio {
7208
9858
  width: 26px;
7209
9859
  height: 26px;
7210
9860
  margin: 0;
7211
- border: 2px solid color-mix(in srgb, var(--mf-text-secondary) 80%, white);
9861
+ border: 2px solid color-mix(in srgb, var(--mf-text-secondary) 80%, var(--mf-tint-base));
7212
9862
  border-radius: var(--mf-radius-full);
7213
9863
  background: var(--mf-bg-secondary);
7214
9864
  cursor: pointer;
@@ -7223,12 +9873,12 @@ div.magicfeedback-radio {
7223
9873
 
7224
9874
  .magicfeedback-max-diff-best:checked {
7225
9875
  border-color: var(--mf-primary);
7226
- background: radial-gradient(circle, #FFFFFF 0 4px, var(--mf-primary) 4.5px);
9876
+ background: radial-gradient(circle, var(--mf-on-primary) 0 4px, var(--mf-primary) 4.5px);
7227
9877
  }
7228
9878
 
7229
9879
  .magicfeedback-max-diff-worst:checked {
7230
9880
  border-color: var(--mf-max-diff-worst);
7231
- background: radial-gradient(circle, #FFFFFF 0 4px, var(--mf-max-diff-worst) 4.5px);
9881
+ background: radial-gradient(circle, var(--mf-on-primary) 0 4px, var(--mf-max-diff-worst) 4.5px);
7232
9882
  }
7233
9883
 
7234
9884
  .magicfeedback-max-diff-input:focus-visible {
@@ -7408,7 +10058,7 @@ div.magicfeedback-radio {
7408
10058
  padding: 0.8rem 1.6rem;
7409
10059
  font-size: var(--mf-font-size-base);
7410
10060
  font-weight: 800;
7411
- color: #FFFFFF;
10061
+ color: var(--mf-on-primary);
7412
10062
  background-color: var(--mf-primary);
7413
10063
  border: 2px solid var(--mf-primary);
7414
10064
  border-radius: var(--mf-radius-full);
@@ -7511,7 +10161,7 @@ div.magicfeedback-radio {
7511
10161
  left: 0;
7512
10162
  width: 100vw;
7513
10163
  height: 100vh;
7514
- background: rgba(0,0,0,0.4);
10164
+ background: var(--mf-overlay);
7515
10165
  display: none; /* toggled to flex when open */
7516
10166
  align-items: center;
7517
10167
  justify-content: center;
@@ -7520,9 +10170,10 @@ div.magicfeedback-radio {
7520
10170
 
7521
10171
  /* Modal container */
7522
10172
  .magicfeedback-modal {
7523
- background: #fff;
10173
+ background: var(--mf-surface);
10174
+ color: var(--mf-text-primary);
7524
10175
  border-radius: 8px;
7525
- box-shadow: 0 8px 24px rgba(0,0,0,0.2);
10176
+ box-shadow: var(--mf-shadow-modal);
7526
10177
  max-width: 520px;
7527
10178
  width: 90%;
7528
10179
  max-height: 80vh;
@@ -7639,7 +10290,7 @@ div.magicfeedback-radio {
7639
10290
  .magicfeedback-button-primary {
7640
10291
  border-color: var(--mf-primary);
7641
10292
  background: var(--mf-primary);
7642
- color: #fff;
10293
+ color: var(--mf-on-primary);
7643
10294
  box-shadow: var(--mf-shadow-md);
7644
10295
  }
7645
10296
 
@@ -7655,7 +10306,7 @@ div.magicfeedback-radio {
7655
10306
 
7656
10307
  /* Warning flash */
7657
10308
  .magicfeedback-warning {
7658
- color: #C70039;
10309
+ color: var(--mf-danger-text);
7659
10310
  }
7660
10311
 
7661
10312
  /* Start message button */
@@ -7664,7 +10315,7 @@ div.magicfeedback-radio {
7664
10315
  border: 2px solid var(--mf-primary);
7665
10316
  border-radius: var(--mf-radius-full);
7666
10317
  background: var(--mf-primary);
7667
- color: #fff;
10318
+ color: var(--mf-on-primary);
7668
10319
  padding: 0.8rem 1.4rem;
7669
10320
  font-size: 15px;
7670
10321
  font-weight: 800;
@@ -7774,9 +10425,9 @@ div.magicfeedback-radio {
7774
10425
  ACCESSIBILITY
7775
10426
  ======================================== */
7776
10427
  @media (prefers-reduced-motion: reduce) {
7777
- *,
7778
- *::before,
7779
- *::after {
10428
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop), .deepdots-popup *,
10429
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)::before, .deepdots-popup *::before,
10430
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)::after, .deepdots-popup *::after {
7780
10431
  animation-duration: 0.01ms !important;
7781
10432
  animation-iteration-count: 1 !important;
7782
10433
  transition-duration: 0.01ms !important;
@@ -7808,17 +10459,17 @@ div.magicfeedback-radio {
7808
10459
  font-size: 20px;
7809
10460
  line-height: 1;
7810
10461
  cursor: pointer;
7811
- color: #666;
10462
+ color: var(--mf-text-muted);
7812
10463
  }
7813
10464
 
7814
10465
  .magicfeedback-modal-close:focus {
7815
- color: #000;
10466
+ color: var(--mf-text-strong);
7816
10467
  outline: none;
7817
10468
  }
7818
10469
 
7819
10470
  @media (hover: hover) {
7820
10471
  .magicfeedback-modal-close:hover {
7821
- color: #000;
10472
+ color: var(--mf-text-strong);
7822
10473
  outline: none;
7823
10474
  }
7824
10475
  }
@@ -8053,7 +10704,7 @@ div.magicfeedback-radio {
8053
10704
 
8054
10705
  /* background-position has no logical form: move the select caret to the
8055
10706
  left edge, opposite the padding that inset-inline-end already mirrored. */
8056
- [dir="rtl"] select {
10707
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] select {
8057
10708
  background-position: left var(--mf-space-md) center;
8058
10709
  }
8059
10710
 
@@ -8061,12 +10712,12 @@ div.magicfeedback-radio {
8061
10712
  even in an Arabic survey: keep their own direction LTR so punctuation
8062
10713
  (@, ., +, /) lands where the user expects, but align them to the start of
8063
10714
  the RTL line so they still read as part of the form. */
8064
- [dir="rtl"] input[type="email"],
8065
- [dir="rtl"] input[type="url"],
8066
- [dir="rtl"] input[type="number"],
8067
- [dir="rtl"] input[type="tel"],
8068
- [dir="rtl"] input[type="date"],
8069
- [dir="rtl"] input[type="time"] {
10715
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="email"],
10716
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="url"],
10717
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="number"],
10718
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="tel"],
10719
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="date"],
10720
+ :where(.magicfeedback-container, .magicfeedback-preview, .magicfeedback-modal-backdrop)[dir="rtl"] input[type="time"] {
8070
10721
  direction: ltr;
8071
10722
  text-align: right;
8072
10723
  }
@@ -8117,7 +10768,8 @@ var init_surveyCss = __esm({
8117
10768
  "use strict";
8118
10769
  SURVEY_CSS_LOADERS = {
8119
10770
  "2.2.38": () => Promise.resolve().then(() => __toESM(require__())),
8120
- "2.2.39": () => Promise.resolve().then(() => __toESM(require__2()))
10771
+ "2.2.39": () => Promise.resolve().then(() => __toESM(require__2())),
10772
+ "2.2.44": () => Promise.resolve().then(() => __toESM(require__3()))
8121
10773
  };
8122
10774
  }
8123
10775
  });
@@ -8344,19 +10996,9 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
8344
10996
  let labels = getLabels(options?.language);
8345
10997
  let actionLabels = resolveActionLabels(actions, options?.language);
8346
10998
  let direction = directionFor(options?.language);
8347
- const isDark = style?.theme === "dark";
8348
- const theme = {
8349
- popupBg: isDark ? "#1e1e1e" : "#fff",
8350
- // El popup fija su propio fondo, así que debe fijar también el esquema de color.
8351
- // Sin esto los controles de formulario (input/textarea/select) caen al estilo por
8352
- // defecto del navegador: en un host con `prefers-color-scheme: dark` se pintan
8353
- // oscuros con texto blanco sobre el fondo claro del popup.
8354
- colorScheme: isDark ? "dark" : "light",
8355
- textPrimary: isDark ? "#f0f0f0" : "#111",
8356
- closeBtnHoverColor: isDark ? "#fff" : "#000000",
8357
- textMuted: isDark ? "#9ca3af" : "#6b7280",
8358
- progressTrack: isDark ? "#3f3f46" : "#e5e7eb"
8359
- };
10999
+ const appearance = options?.appearance;
11000
+ let forcedMode = resolveForcedMode(appearance, systemPrefersDark());
11001
+ let theme = chromePalette(chromeColors(null, style?.theme, forcedMode).dark);
8360
11002
  const positionMap = {
8361
11003
  "center": { justifyContent: "center", alignItems: "center", background: "rgba(0,0,0,0.5)" },
8362
11004
  "bottom": { justifyContent: "center", alignItems: "flex-end", padding: "16px", background: "transparent" },
@@ -8587,6 +11229,17 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
8587
11229
  justify-content: center;
8588
11230
  text-align: center;
8589
11231
  `;
11232
+ const applyChromeContrast = (palette) => {
11233
+ theme = palette;
11234
+ popup.style.colorScheme = palette.colorScheme;
11235
+ titleEl.style.color = palette.textPrimary;
11236
+ closeBtn.style.color = palette.textPrimary;
11237
+ progressCurrent.style.color = palette.textPrimary;
11238
+ progressTotal.style.color = palette.textMuted;
11239
+ progressTrack.style.background = palette.progressTrack;
11240
+ loadErrorEl.style.color = palette.textPrimary;
11241
+ backButton.style.color = palette.textMuted;
11242
+ };
8590
11243
  backButton.onmouseenter = () => {
8591
11244
  backButton.style.filter = "brightness(0.9)";
8592
11245
  };
@@ -8859,6 +11512,47 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
8859
11512
  if (!container.contains(popup)) return;
8860
11513
  if (surveySdkCss) ensureStyle("magicfeedback-sdk-styles", surveySdkCss, cspNonce);
8861
11514
  else ensureMagicFeedbackStyles(cspNonce);
11515
+ const navDefaults = [submitButton, startButton, closeButton].map((b) => ({
11516
+ b,
11517
+ background: b.style.background,
11518
+ border: b.style.border,
11519
+ color: b.style.color
11520
+ }));
11521
+ const barDefault = { bar: progressBar.style.background, followUp: progressFollowUp.style.background };
11522
+ let loadedStyle = null;
11523
+ const applyAppearanceColors = (s) => {
11524
+ const c = chromeColors(s, style?.theme, forcedMode);
11525
+ popup.style.background = c.background;
11526
+ applyChromeContrast(chromePalette(c.dark));
11527
+ progressBar.style.background = c.loadingBar || barDefault.bar;
11528
+ progressFollowUp.style.background = c.loadingBar || barDefault.followUp;
11529
+ for (const d of navDefaults) {
11530
+ d.b.style.background = c.primary || d.background;
11531
+ d.b.style.border = c.primary ? "none" : d.border;
11532
+ d.b.style.color = c.primary ? c.onPrimary : d.color;
11533
+ }
11534
+ if (c.secondary) {
11535
+ backButton.style.background = "transparent";
11536
+ backButton.style.color = c.secondary;
11537
+ backButton.style.border = "none";
11538
+ }
11539
+ };
11540
+ if (forcedMode) applyAppearanceColors(null);
11541
+ if (appearance === "system" && typeof window !== "undefined" && typeof window.matchMedia === "function") {
11542
+ try {
11543
+ const mq = window.matchMedia("(prefers-color-scheme: dark)");
11544
+ const onSchemeChange = () => {
11545
+ if (!popup.isConnected) {
11546
+ mq.removeEventListener?.("change", onSchemeChange);
11547
+ return;
11548
+ }
11549
+ forcedMode = mq.matches ? "dark" : "light";
11550
+ applyAppearanceColors(loadedStyle);
11551
+ };
11552
+ mq.addEventListener?.("change", onSchemeChange);
11553
+ } catch {
11554
+ }
11555
+ }
8862
11556
  try {
8863
11557
  if (!magicfeedback || typeof magicfeedback.form !== "function") {
8864
11558
  sdkWarn("[MagicFeedback] form() no disponible. Fallback manual.");
@@ -8888,6 +11582,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
8888
11582
  // quitado el `inert`. La apertura va aparte (ver autofocusOnOpen).
8889
11583
  autofocus: "navigation"
8890
11584
  };
11585
+ if (forcedMode) generateOptions.mode = forcedMode;
8891
11586
  generateOptions.onLoadedEvent = ({ formData, lang, error }) => {
8892
11587
  if (error) {
8893
11588
  showLoadError(error);
@@ -8906,33 +11601,12 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
8906
11601
  if (options?.showProgressBar === void 0) progressEnabled = s.showProgressBar === true;
8907
11602
  if (s.showProgressUnit !== void 0) progressShowUnit = s.showProgressUnit !== false;
8908
11603
  if (s.progressUnit) progressUnit = s.progressUnit;
8909
- if (s.loadingBarColor) {
8910
- progressBar.style.background = s.loadingBarColor;
8911
- progressFollowUp.style.background = s.loadingBarColor;
8912
- }
8913
- if (s.boxBackgroundColor) {
8914
- popup.style.background = s.boxBackgroundColor;
8915
- }
11604
+ loadedStyle = s;
11605
+ applyAppearanceColors(loadedStyle);
8916
11606
  if (s.contentAlign) {
8917
11607
  main.style.justifyContent = s.contentAlign === "center" ? "center" : "flex-start";
8918
11608
  }
8919
11609
  applySurveyPrimaryColor(popup, s);
8920
- if (s.buttonPrimaryColor) {
8921
- submitButton.style.background = s.buttonPrimaryColor;
8922
- submitButton.style.border = "none";
8923
- submitButton.style.color = "#fff";
8924
- startButton.style.background = s.buttonPrimaryColor;
8925
- startButton.style.border = "none";
8926
- startButton.style.color = "#fff";
8927
- closeButton.style.background = s.buttonPrimaryColor;
8928
- closeButton.style.border = "none";
8929
- closeButton.style.color = "#fff";
8930
- }
8931
- if (s.buttonSecondaryColor) {
8932
- backButton.style.background = "transparent";
8933
- backButton.style.color = s.buttonSecondaryColor;
8934
- backButton.style.border = "none";
8935
- }
8936
11610
  insertPopupLogo(popup, progressEl, s, "deepdots-popup-logo");
8937
11611
  if (s.startMessage && s.startMessage !== "") {
8938
11612
  sdkLog(s.startMessage);
@@ -9011,6 +11685,8 @@ var init_renderPopup = __esm({
9011
11685
  init_font();
9012
11686
  init_logo();
9013
11687
  init_surveyPalette();
11688
+ init_chromeContrast();
11689
+ init_appearance();
9014
11690
  init_busy();
9015
11691
  init_logger();
9016
11692
  init_labels();
@@ -9036,6 +11712,9 @@ var import_react = require("react");
9036
11712
  var import_react_native = require("react-native");
9037
11713
  var import_react_native_webview = require("react-native-webview");
9038
11714
 
11715
+ // src/core/deepdots-popups.ts
11716
+ init_appearance();
11717
+
9039
11718
  // src/types/index.ts
9040
11719
  var POPUP_TRIGGER_CONDITION_STATUSES = [
9041
11720
  "SHOWED",
@@ -9233,6 +11912,8 @@ init_font();
9233
11912
  init_labels();
9234
11913
  init_reveal();
9235
11914
  init_surveyPalette();
11915
+ init_chromeContrast();
11916
+ init_appearance();
9236
11917
  init_busy();
9237
11918
  init_submitError();
9238
11919
  init_style();
@@ -9288,12 +11969,15 @@ function buildSurveyHtml(opts) {
9288
11969
  const fontFaceCss = opts.font ? buildFontFaceCss(opts.font.family, opts.font.url) : "";
9289
11970
  const fontFamilyValue = opts.font ? buildFontFamilyValue(opts.font.family) : "-apple-system,system-ui,sans-serif";
9290
11971
  const popupClass = opts.font?.family ? "deepdots-popup deepdots-has-font" : "deepdots-popup";
9291
- const isDark = opts.theme === "dark";
9292
- const popupBg = isDark ? "#1e1e1e" : "#fff";
9293
- const colorScheme = isDark ? "dark" : "light";
9294
- const textPrimary = isDark ? "#f0f0f0" : "#111";
9295
- const textMuted = isDark ? "#9ca3af" : "#6b7280";
9296
- const trackBg = isDark ? "#3f3f46" : "#e5e7eb";
11972
+ const appearance = normalizeAppearance(opts.appearance);
11973
+ const isDark2 = appearance === "dark" || appearance === "light" ? appearance === "dark" : opts.theme === "dark";
11974
+ const appearanceJson = jsonForScript(appearance ?? null);
11975
+ const themeJson = jsonForScript(opts.theme ?? null);
11976
+ const popupBg = isDark2 ? "#1e1e1e" : "#fff";
11977
+ const colorScheme = isDark2 ? "dark" : "light";
11978
+ const textPrimary = isDark2 ? "#f0f0f0" : "#111";
11979
+ const textMuted = isDark2 ? "#9ca3af" : "#6b7280";
11980
+ const trackBg = isDark2 ? "#3f3f46" : "#e5e7eb";
9297
11981
  const pos = POSITION_MAP[opts.position ?? "center"] ?? POSITION_MAP.center;
9298
11982
  const chrome = opts.chrome !== false;
9299
11983
  const bodyBg = chrome ? pos.background : "transparent";
@@ -9345,22 +12029,22 @@ body{display:${bodyDisplay};justify-content:${pos.justifyContent};align-items:${
9345
12029
  body.dd-ready{background:${bodyBg}}
9346
12030
  #dd-popup{visibility:hidden}
9347
12031
  body.dd-ready #dd-popup{visibility:visible}
9348
- .deepdots-popup{position:relative;display:flex;flex-direction:column;justify-content:flex-start;background:${cardBg};color-scheme:${colorScheme};border-radius:${cardRadius};padding:24px;box-shadow:${cardShadow};max-width:${cardMaxWidth};width:${cardWidth};min-height:${cardMinHeight};height:${cardHeight};max-height:${cardMaxHeight};box-sizing:border-box}
12032
+ .deepdots-popup{position:relative;display:flex;flex-direction:column;justify-content:flex-start;background:${cardBg};color-scheme:var(--dd-color-scheme,${colorScheme});border-radius:${cardRadius};padding:24px;box-shadow:${cardShadow};max-width:${cardMaxWidth};width:${cardWidth};min-height:${cardMinHeight};height:${cardHeight};max-height:${cardMaxHeight};box-sizing:border-box}
9349
12033
  .deepdots-popup-header{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;flex:0 0 auto}
9350
12034
  /* Neutraliza la regla \`.deepdots-popup h2\` del CSS del survey (uppercase, centrado y
9351
12035
  margin-bottom 40px), pensada para los enunciados y no para el t\xEDtulo de la cabecera. */
9352
- #dd-title{margin:0;font-family:var(--deepdots-font,'Montserrat',inherit);font-size:17px;font-weight:600;line-height:1.3;color:${textPrimary};text-transform:none;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
9353
- #dd-close{background:transparent;border:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;color:${textPrimary};padding:4px;flex:0 0 auto;margin-inline-start:auto}
12036
+ #dd-title{margin:0;font-family:var(--deepdots-font,'Montserrat',inherit);font-size:17px;font-weight:600;line-height:1.3;color:var(--dd-text-primary,${textPrimary});text-transform:none;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
12037
+ #dd-close{background:transparent;border:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;color:var(--dd-text-primary,${textPrimary});padding:4px;flex:0 0 auto;margin-inline-start:auto}
9354
12038
  /* Progreso alineado con la cabecera: sin padding horizontal propio, lo marca la tarjeta.
9355
12039
  El vertical es el mismo arriba y abajo, y del mismo valor que el padding de la tarjeta. */
9356
12040
  .deepdots-progress{display:none;flex-direction:column;gap:8px;width:100%;flex:0 0 auto;padding:16px 0;box-sizing:border-box}
9357
12041
  .deepdots-progress-head{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:100%;gap:8px}
9358
12042
  #dd-progress-label{font-size:13px;line-height:1.2}
9359
12043
  /* "Question 1" en negrita y "of 3" en regular gris, como el mockup. */
9360
- #dd-progress-current{font-weight:700;color:${textPrimary}}
9361
- #dd-progress-total{font-weight:400;color:${textMuted}}
12044
+ #dd-progress-current{font-weight:700;color:var(--dd-text-primary,${textPrimary})}
12045
+ #dd-progress-total{font-weight:400;color:var(--dd-text-muted,${textMuted})}
9362
12046
  #dd-progress-followup{display:none;font-size:12px;font-weight:600;color:#fff;background:rgba(59,130,246,0.44);border-radius:999px;padding:2px 10px}
9363
- .deepdots-progress-track{width:100%;height:4px;border-radius:999px;background:${trackBg};overflow:hidden}
12047
+ .deepdots-progress-track{width:100%;height:4px;border-radius:999px;background:var(--dd-progress-track,${trackBg});overflow:hidden}
9364
12048
  #dd-progress-bar{height:100%;width:0%;background:#22C55E;border-radius:999px;transition:width 450ms ease}
9365
12049
  /* El popup es una columna: solo el bloque de preguntas hace scroll, para que el footer
9366
12050
  con las acciones quede siempre visible en el borde inferior (antes viv\xEDa dentro del
@@ -9388,14 +12072,14 @@ body.dd-ready #dd-popup{visibility:visible}
9388
12072
  #dd-logo{max-height:40px;max-width:100%;object-fit:contain;display:block;margin:12px 0 0 0}
9389
12073
  .deepdots-error-hint{display:none;margin:12px 0 0 0;padding:10px 12px;border-radius:6px;background:#FEF3C7;color:#92400E;border:1px solid #FCD34D;font-size:13px}
9390
12074
  /* Pantalla final: el HTML del editor de la plataforma (imagen + texto), centrado. */
9391
- .deepdots-load-error{display:none;width:100%;text-align:center;padding:24px 0;font-size:15px;color:${textPrimary}}
9392
- .deepdots-success{display:none;width:100%;text-align:center;padding:24px 0;color:${textPrimary}}
12075
+ .deepdots-load-error{display:none;width:100%;text-align:center;padding:24px 0;font-size:15px;color:var(--dd-text-primary,${textPrimary})}
12076
+ .deepdots-success{display:none;width:100%;text-align:center;padding:24px 0;color:var(--dd-text-primary,${textPrimary})}
9393
12077
  .deepdots-success img{max-width:100%;height:auto;margin:0 auto 16px auto;display:block}
9394
12078
  .deepdots-success p{margin:0;font-size:16px;font-weight:600;line-height:1.4}
9395
12079
  .deepdots-popup-footer{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:4px;margin-top:auto;width:100%;padding-top:12px}
9396
12080
  .dd-nav-btn{display:none;border:none;min-height:44px;padding:12px 24px;border-radius:999px;cursor:pointer;font-size:15px;font-weight:600;align-items:center;justify-content:center;text-align:center}
9397
12081
  /* Secundario como bot\xF3n de texto: sin borde ni fondo, para que el primario sea la \xFAnica CTA. */
9398
- #dd-back{background:transparent;color:${textMuted};border:none}
12082
+ #dd-back{background:transparent;color:var(--dd-text-muted,${textMuted});border:none}
9399
12083
  #dd-start,#dd-complete,#dd-submit,#dd-cancel{background:#1E293B;color:#fff;border:none}
9400
12084
  #dd-submit:disabled,#dd-start:disabled,#dd-back:disabled,#dd-complete:disabled{opacity:0.6;cursor:not-allowed}
9401
12085
  .mf-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
@@ -9633,6 +12317,40 @@ ${customCss}
9633
12317
  }
9634
12318
 
9635
12319
  ${PRIMARY_COLOR_JS}
12320
+ ${CHROME_CONTRAST_JS}
12321
+ ${APPEARANCE_JS}
12322
+ // Textos del chrome y color-scheme seg\xFAn el fondo final (Style), no el theme. Van como variables
12323
+ // CSS para que el surveyCss del host, que va el \xFAltimo en la cascada, siga mandando.
12324
+ function ddApplyChromeContrast(bg){
12325
+ var dark=ddIsDarkBackground(bg);
12326
+ if(dark===null){ return; }
12327
+ var pal=ddChromePalette(dark);
12328
+ var el=document.getElementById('dd-popup');
12329
+ if(!el){ return; }
12330
+ el.style.setProperty('--dd-color-scheme', pal.colorScheme);
12331
+ el.style.setProperty('--dd-text-primary', pal.textPrimary);
12332
+ el.style.setProperty('--dd-text-muted', pal.textMuted);
12333
+ el.style.setProperty('--dd-progress-track', pal.progressTrack);
12334
+ var meta=document.querySelector('meta[name="color-scheme"]');
12335
+ if(meta){ meta.setAttribute('content', pal.colorScheme); }
12336
+ }
12337
+ // DD-241: modo de la app y colores del chrome (Style + theme + modo; bloque dark del Style).
12338
+ var ddTheme=${themeJson};
12339
+ var ddForcedMode=ddResolveForcedMode(${appearanceJson});
12340
+ function ddApplyAppearanceColors(s){
12341
+ var c=ddChromeColors(s, ddTheme, ddForcedMode);
12342
+ if(chromeOn){ popup.style.background=c.background; ddApplyChromeContrast(c.background); }
12343
+ if(c.loadingBar){ progressBar.style.background=c.loadingBar; progressFollowUp.style.background=c.loadingBar; }
12344
+ if(c.primary){
12345
+ var btns=[submitBtn,startBtn,completeBtn];
12346
+ for(var bi=0;bi<btns.length;bi++){ btns[bi].style.background=c.primary; btns[bi].style.border='none'; btns[bi].style.color=c.onPrimary; }
12347
+ }
12348
+ if(c.secondary){
12349
+ // Bot\xF3n de texto: solo ti\xF1e la etiqueta, sin recuperar fondo ni borde.
12350
+ backBtn.style.background='transparent'; backBtn.style.color=c.secondary; backBtn.style.border='none';
12351
+ }
12352
+ }
12353
+ if(ddForcedMode){ ddApplyAppearanceColors(null); }
9636
12354
  ${BUSY_JS}
9637
12355
  ${SUBMIT_ERROR_JS}
9638
12356
  ${REVEAL_JS}
@@ -9718,6 +12436,8 @@ ${REVEAL_JS}
9718
12436
  // Foco en la primera pregunta de escribir tras Start, Siguiente o Atr\xE1s. Las versiones
9719
12437
  // de native sin esta opci\xF3n la ignoran.
9720
12438
  autofocus:'navigation',
12439
+ // Paleta del survey (DD-238); las versiones sin la opci\xF3n la ignoran.
12440
+ mode: ddForcedMode||undefined,
9721
12441
  onLoadedEvent:function(args){
9722
12442
  if(args && args.error){ ddShowLoadError('error:load', args.error); return; }
9723
12443
  // Idioma en el que native muestra el survey: manda sobre el del init para que el
@@ -9738,22 +12458,13 @@ ${REVEAL_JS}
9738
12458
  if(progressPref===null){ progressEnabled=s.showProgressBar===true; }
9739
12459
  if(s.showProgressUnit!==undefined){ progressShowUnit=s.showProgressUnit!==false; }
9740
12460
  if(s.progressUnit){ progressUnit=s.progressUnit; }
9741
- if(s.loadingBarColor){ progressBar.style.background=s.loadingBarColor; progressFollowUp.style.background=s.loadingBarColor; }
9742
- if(chromeOn && s.boxBackgroundColor){ popup.style.background=s.boxBackgroundColor; }
12461
+ // Fondo, textos, botones y barra: Style + theme + modo de la app (DD-247, DD-241).
12462
+ ddApplyAppearanceColors(s);
9743
12463
  if(s.contentAlign){ main.style.justifyContent = s.contentAlign==='center' ? 'center' : 'flex-start'; }
9744
12464
  // El survey pinta sus controles con --mf-primary, que sale de primaryColor; si la
9745
12465
  // integraci\xF3n solo configura el del bot\xF3n, el popup mezclar\xEDa el color de la marca
9746
12466
  // con el gris azulado por defecto del paquete.
9747
12467
  ddApplySurveyPrimaryColor(popup, s);
9748
- if(s.buttonPrimaryColor){
9749
- submitBtn.style.background=s.buttonPrimaryColor; submitBtn.style.border='none'; submitBtn.style.color='#fff';
9750
- startBtn.style.background=s.buttonPrimaryColor; startBtn.style.border='none'; startBtn.style.color='#fff';
9751
- completeBtn.style.background=s.buttonPrimaryColor; completeBtn.style.border='none'; completeBtn.style.color='#fff';
9752
- }
9753
- if(s.buttonSecondaryColor){
9754
- // Bot\xF3n de texto: solo ti\xF1e la etiqueta, sin recuperar fondo ni borde.
9755
- backBtn.style.background='transparent'; backBtn.style.color=s.buttonSecondaryColor; backBtn.style.border='none';
9756
- }
9757
12468
  if(s.logo && !document.getElementById('dd-logo')){
9758
12469
  var logoImg=document.createElement('img');
9759
12470
  logoImg.id='dd-logo'; logoImg.src=s.logo; logoImg.alt='Logo';
@@ -9921,7 +12632,8 @@ var ReactNativePopupRenderer = class {
9921
12632
  title: options?.title,
9922
12633
  showProgressBar: options?.showProgressBar,
9923
12634
  surveyCss: options?.surveyCss,
9924
- language: options?.language
12635
+ language: options?.language,
12636
+ appearance: options?.appearance
9925
12637
  });
9926
12638
  if (this.options.onShow) {
9927
12639
  this.options.onShow({ surveyId, productId, html });
@@ -11415,6 +14127,8 @@ var DeepdotsPopups = class {
11415
14127
  /** CSS del host inyectado al final de los estilos del popup. */
11416
14128
  this.surveyCss = void 0;
11417
14129
  this.cspNonce = void 0;
14130
+ /** Claro/oscuro de la app (DD-241). undefined = mandan los colores del Style. */
14131
+ this.appearance = void 0;
11418
14132
  /** Identidad + sesión (Fase 1 tracking). Null hasta init(). */
11419
14133
  this.tracking = null;
11420
14134
  /** Capa de analytics (canal separado del feedback). Null hasta init(). */
@@ -11498,6 +14212,7 @@ var DeepdotsPopups = class {
11498
14212
  this.showProgressBar = config.showProgressBar;
11499
14213
  this.surveyCss = config.surveyCss;
11500
14214
  this.cspNonce = config.cspNonce;
14215
+ this.appearance = normalizeAppearance(config.appearance);
11501
14216
  this.onFeedbackSession = config.onFeedbackSession;
11502
14217
  this.autoTrackErrors = config.autoTrack?.errors !== false;
11503
14218
  this.config = {
@@ -11867,6 +14582,18 @@ var DeepdotsPopups = class {
11867
14582
  *
11868
14583
  * Equivale a llamar a `init()` otra vez con otro `userId`.
11869
14584
  */
14585
+ /**
14586
+ * Claro u oscuro desde la app, en cualquier momento (apps con su propio interruptor de modo
14587
+ * oscuro). `'system'` sigue al sistema; `null`/`undefined` vuelve a los colores del Style.
14588
+ * Se aplica al siguiente popup que se abra. Paridad con nativo `setAppearance()` (DD-240).
14589
+ */
14590
+ setAppearance(appearance) {
14591
+ this.appearance = normalizeAppearance(appearance);
14592
+ }
14593
+ /** El `appearance` actual de la app (`undefined` = mandan los colores del Style). */
14594
+ getAppearance() {
14595
+ return this.appearance;
14596
+ }
11870
14597
  setUserId(userId) {
11871
14598
  const next = userId || void 0;
11872
14599
  if (!this.initialized || !this.config || next === this.config.userId) return;
@@ -12790,7 +15517,7 @@ var DeepdotsPopups = class {
12790
15517
  miniService,
12791
15518
  analyticsFeedbackSessionId,
12792
15519
  this.renderChrome,
12793
- { title, showProgressBar: this.showProgressBar, surveyCss: this.surveyCss, language: this.language, cspNonce: this.cspNonce, surveySdkVersion, debug: this.config?.debug }
15520
+ { title, showProgressBar: this.showProgressBar, surveyCss: this.surveyCss, language: this.language, cspNonce: this.cspNonce, surveySdkVersion, debug: this.config?.debug, appearance: this.appearance }
12794
15521
  );
12795
15522
  }
12796
15523
  /** Hide the popup */