@magicfeedback/popup-sdk 1.5.0 → 1.6.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.
package/dist/index.js CHANGED
@@ -185,7 +185,1775 @@ var init_font = __esm({
185
185
  var style_default;
186
186
  var init_style = __esm({
187
187
  "src/assets/style.css"() {
188
- style_default = '.magicfeedback-container {\n width: 100%;\n}\n\n\n.magicfeedback-success-message,\n.magicfeedback-info-message,\n.magicfeedback-start-message,\n.magicfeedback-container{\n animation-duration: 0.5s;\n animation-name: animate-fade;\n animation-delay: 0.25s;\n animation-fill-mode: backwards;\n\n font-style: normal;\n text-align: justify;\n font-weight: 400;\n font-size: 1.2rem;\n color: #475569;\n line-height: 1.5;\n}\n\n@keyframes animate-fade {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n}\n\n.magicfeedback-form {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n}\n.magicfeedback-questions {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 100%;\n}\n\n.magicfeedback-div {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n margin-bottom: 10px;\n width: 100%;\n}\n\n.magicfeedback-label {\n margin-bottom: 25px;\n margin-top: 20px;\n font-weight: 400;\n font-family: inherit;\n font-size: 1.2rem;\n color: #212529;\n text-align: start;\n word-wrap: break-word;\n white-space: normal;\n\n}\n\n.magicfeedback-checkbox {\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n width: 100%;\n}\n\n.magicfeedback-checkbox-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 5px;\n margin-top: 5px;\n}\n\n/* Cualificado con `div`: @magicfeedback/native reutiliza la clase "magicfeedback-radio"\n tambi\xE9n en el <input> de cada opci\xF3n (rating), y sin el tag este selector lo capturaba\n tambi\xE9n, rompiendo su tama\xF1o (el input pasaba a display:flex; width:100%). */\ndiv.magicfeedback-radio {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n flex-wrap: wrap;\n width: 100%;\n margin-right: 5px;\n padding: 5px;\n box-sizing: border-box;\n}\n\n.magicfeedback-checkbox-container,\n.magicfeedback-radio-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin: 5px;\n padding: 5px 0;\n background-color: #fff;\n border-radius: 5px;\n box-shadow: 0 0 3px #ccc;\n}\n\n.deepdots-popup input::-webkit-outer-spin-button,\n.deepdots-popup input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n -moz-appearance: textfield;\n}\n\n.magicfeedback-checkbox input[type="checkbox"] {\n margin-right: 5px;\n margin-left: 5px;\n width: 20px;\n height: 20px;\n cursor: pointer;\n}\n\n\n.magicfeedback-checkbox label,\n.magicfeedback-radio-container label {\n margin-left: 5px;\n font-weight: 400;\n font-family: inherit;\n font-size: 16px;\n color: #212529;\n text-align: start;\n width: 100%;\n}\n\n.deepdots-popup p {\n margin-bottom: 0px;\n font-size: 12px;\n}\n\n.deepdots-popup h2 {\n line-height: 1.66;\n margin: 0;\n padding: 0;\n font-weight: 900;\n color: #222;\n font-family: var(--deepdots-font, \'Montserrat\');\n font-size: 18px;\n text-transform: uppercase;\n text-align: center;\n margin-bottom: 40px;\n}\n\n/* Los controles de formulario no heredan font-family por defecto: cuando hay\n fuente custom (clase deepdots-has-font), los forzamos a usar la del contenedor. */\n.deepdots-popup.deepdots-has-font button,\n.deepdots-popup.deepdots-has-font input,\n.deepdots-popup.deepdots-has-font textarea,\n.deepdots-popup.deepdots-has-font select {\n font-family: var(--deepdots-font, inherit);\n}\n\n.deepdots-popup h6 {\n margin-bottom: 1rem;\n}\n\n.deepdots-popup input[type="date"],\n.deepdots-popup input[type="text"],\n.deepdots-popup input[type="number"],\n.deepdots-popup input[type="email"],\n.deepdots-popup input[type="password"],\n.deepdots-popup textarea,\n.deepdots-popup select {\n box-sizing: border-box;\n padding: 10px;\n margin: 10px 0;\n width: 100%;\n border: 2px solid #ccc; /* Default border color - you can customize this */\n border-radius: 5px;\n font-size: 18px;\n outline: none;\n transition: border-color 0.3s ease;\n min-height: 50px;\n font-family: inherit;\n -webkit-appearance: none;\n}\n\n.deepdots-popup select {\n background-image: linear-gradient(45deg, transparent 50%, gray 50%),\n linear-gradient(135deg, gray 50%, transparent 50%),\n linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 20px) calc(1em + 2px),\n calc(100% - 15px) calc(1em + 2px),\n calc(100% - 2.5em) 0.5em;\n background-size: 5px 5px,\n 5px 5px,\n 1px 1.5em;\n background-repeat: no-repeat;\n}\n\n.magicfeedback-boolean-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin: 10px 0;\n width: 100%;\n}\n\n.magicfeedback-boolean-container label {\n margin-left: 10px;\n font-weight: 400;\n font-size: 16px;\n width: 100%;\n padding-top: 5px;\n}\n\n.magicfeedback-boolean-option {\n margin-right: 10px;\n margin-left: 10px;\n width: 100%;\n height: 38px;\n border-radius: 8px;\n font-size: 16px;\n cursor: pointer;\n border: 1px solid #ced4da !important;\n}\n\n.magicfeedback-boolean-option label {\n font-weight: 400;\n font-size: 16px;\n color: #475569;\n cursor: pointer;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: inherit;\n}\n\n.magicfeedback-boolean-option input[type=radio] + label:hover {\n color: #007bff;\n}\n\n.magicfeedback-boolean-option input[type=radio]:checked + label {\n color: #007bff;\n background-color: #cadff8;\n}\n\n/* Tama\xF1o expl\xEDcito y sin padding: un radio nativo con `padding: 20px` y solo `width` (sin\n `height`) se dibujaba enorme en WebKit, que s\xED aplica el padding al control. Se ve\xEDa en\n iOS (WebView de React Native y Safari) y no en Chrome. `flex: 0 0 auto` evita que el\n contenedor flex de la opci\xF3n lo estire. */\n.deepdots-popup input[type="radio"] {\n padding: 0;\n margin: 10px 0 10px 15px;\n width: 20px;\n height: 20px;\n min-width: 20px;\n flex: 0 0 auto;\n background-color: #fff;\n box-shadow: none;\n}\n\n/* Style for focused input/select */\n.deepdots-popup input:focus, .deepdots-popup select:focus {\n border-color: #4CAF50; /* Highlight color when focused - you can customize this */\n}\n\n/* Style for invalid input (example: validation error) */\n.deepdots-popup input.error, .deepdots-popup select.error {\n border-color: #ff3333; /* Red color for error state - you can customize this */\n}\n\n.magicfeedback-action-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n width: 100%;\n}\n\n.magicfeedback-action-container .magicfeedback-submit {\n cursor: pointer;\n padding: 10px;\n margin: 10px 0;\n width: 100px;\n border-radius: 8px;\n font-size: 16px;\n outline: none;\n transition: border-color 0.3s ease;\n background-color: #1E293B;\n color: white;\n}\n\n.magicfeedback-action-container .magicfeedback-back {\n cursor: pointer;\n padding: 10px;\n margin: 10px 0;\n width: 100px;\n border: 0;\n border-radius: 8px;\n font-size: 16px;\n outline: none;\n transition: border-color 0.3s ease;\n background-color: transparent;\n color: #212529;\n}\n\n\n\n/* Rating styles */\n.magicfeedback-rating {\n width: 100%;\n}\n\n.magicfeedback-rating-container {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n flex-wrap: wrap;\n align-items: center;\n\n margin: 15px 5px;\n padding: 0;\n\n list-style: none;\n font-size: 1.5rem;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n}\n\n.magicfeedback-rating-placeholder-value,\n.magicfeedback-rating-placeholder{\n text-align: center;\n align-content: center;\n justify-content: center;\n text-wrap: wrap;\n}\n\n.magicfeedback-rating-option {\n margin: 0 0.5rem;\n padding: 0;\n}\n\n@media (max-width: 1024px) {\n .magicfeedback-rating-option {\n margin: 10px 0;\n padding: 0;\n width: 20%;\n display: flex;\n justify-content: center;\n }\n\n .magicfeedback-rating-placeholder-value {\n font-size: 0.75rem;\n margin-bottom: 1px;\n }\n .magicfeedback-rating-placeholder{\n justify-content: center;\n }\n\n .magicfeedback-rating-container {\n flex-wrap: wrap;\n justify-content: flex-start;\n }\n}\n\n\n.magicfeedback-rating-option-label-container {\n display: flex;\n flex-direction: column;\n}\n\n\n.magicfeedback-rating-option-label-container label {\n display: inline-block;\n text-align: center;\n margin-bottom: 0;\n font-weight: 600;\n font-size: 18px;\n color: #475569;\n}\n\n.magicfeedback-rating-option-label-container input[type=radio] {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n}\n\n/* IMAGE STYLES */\n.magicfeedback-rating-option-label-container input[type=radio] + img {\n cursor: pointer;\n height: 48px;\n width: 48px;\n}\n\n/* LABEL STYLES */\n.magicfeedback-rating-option-label-container input[type=radio] + label {\n cursor: pointer;\n}\n\n/* CHECKED STYLES */\n.magicfeedback-rating-option-label-container input[type=radio]:checked + img {\n box-shadow: #007bff 0px 1px 4px, #007BFFA0 0px 0px 0px 2px;\n border-radius: 50%;\n}\n\n.magicfeedback-rating-number {\n width: 100%;\n}\n.magicfeedback-rating-container,\n.magicfeedback-rating-number-container {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n\n margin: 15px 0;\n padding: 0;\n\n list-style: none;\n font-size: 1.5rem;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n}\n\n/* Cuando hay placeholders (Very bad / Very good), el placeholder ocupa\n el 100% de la primera l\xEDnea y los boxes bajan a la siguiente */\n.magicfeedback-rating-number-container--with-placeholder {\n flex-wrap: wrap;\n align-items: flex-start;\n}\n\n.magicfeedback-rating-number-container--with-placeholder .magicfeedback-rating-placeholder {\n width: 100%;\n margin-bottom: 8px;\n}\n\n.magicfeedback-rating-number-container--with-placeholder .magicfeedback-rating-number-option {\n width: auto;\n flex: 1;\n}\n\n.magicfeedback-rating-number-option {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin: 5px;\n padding: 0;\n list-style: none;\n font-size: 1.5rem;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n width: 100%;\n}\n\n.magicfeedback-rating-number-option-row{\n max-width: 100% !important;\n}\n\n.magicfeedback-rating-number-top-placeholder,\n.magicfeedback-rating-number-bottom-placeholder{\n text-align: center !important;\n align-content: center;\n justify-content: center;\n text-wrap: wrap;\n\n font-size: 15px;\n color: #475569;\n\n width: 100%;\n margin: auto;\n}\n\n@media (min-width: 650px) {\n .magicfeedback-rating-number-option-row +.magicfeedback-rating-number-container-ltr:first-child,\n .magicfeedback-rating-number-option-row + +.magicfeedback-rating-number-container-rtl:last-child {\n margin-left: 0;\n width: calc(100% - 10px);\n }\n\n .magicfeedback-rating-number-option-row +.magicfeedback-rating-number-container-rtl:first-child,\n .magicfeedback-rating-number-option-row + +.magicfeedback-rating-number-container-ltr:last-child {\n margin-right: 0;\n width: calc(100% - 10px);\n }\n}\n\n\n.magicfeedback-rating-number-option-label-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n\n.magicfeedback-rating-number-option-label-container label {\n display: flex;\n align-items: center;\n justify-content: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0 10px;\n font-weight: 600;\n font-size: 14px;\n color: #475569;\n cursor: pointer;\n width: 100%;\n height: 100%;\n min-height: 50px;\n text-align: center;\n padding: 0;\n border-radius: 4px;\n border: 1px solid #ced4da;\n background-color: rgba(246, 246, 246, 0.3);\n transition: background-color 0.15s ease-in-out;\n}\n\n.magicfeedback-rating-number-option-label-container input[type=radio] {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n}\n\n.magicfeedback-rating-number-option-label-container input[type=radio] + label {\n cursor: pointer;\n}\n\n.magicfeedback-rating-number-option-label-container input[type=radio] + label:hover,\n.magicfeedback-rating-number-option-label-container input[type=radio]:checked + label {\n color: #007bff;\n border: 1px solid #007bff;\n background-color: rgba(86, 168, 253, 0.29);\n}\n\n.magicfeedback-rating-number-container-column{\n align-items: flex-start !important;\n}\n\n@media (max-width: 650px) {\n .magicfeedback-rating-number-container-ltr {\n justify-content: center;\n flex-wrap: wrap;\n }\n\n .magicfeedback-rating-number-container-rtl {\n justify-content: center;\n flex-wrap: wrap-reverse;\n }\n\n .magicfeedback-rating-number-option {\n max-width: 100%;\n height: 55px;\n margin: 5px 0;\n }\n}\n\n.magicfeedback-rating-star {\n width: 100%;\n}\n\n.magicfeedback-rating-star-container {\n display: flex !important;\n flex-direction: row !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: wrap;\n margin: 15px 5px;\n padding: 0;\n list-style: none;\n font-size: 1.5rem;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n}\n\n.magicfeedback-rating-star-option:not(:checked) > .rating__star {\n float: right;\n width: 1em;\n overflow: hidden;\n white-space: nowrap;\n cursor: pointer;\n font-size: 30px;\n color: #ccc;\n margin: 0 10px;\n}\n\n.magicfeedback-rating-star-option:not(:checked) > .rating__star:hover,\n.magicfeedback-rating-star-option:not(:checked) > .rating__star:hover ~ span {\n color: #deb217 !important;\n}\n\n.magicfeedback-rating-star-selected {\n color: #ffc700 !important;\n}\n\n\n/* Style for multiple choice image */\n.magicfeedback-image-option-label-container:hover {\n cursor: pointer;\n border: 0 !important;\n}\n\n.magicfeedback-image-option-label-container input[type=radio]:checked + img,\n.magicfeedback-image-option-label-container input[type=checkbox]:checked + img {\n border: 1px solid #007bff !important;\n box-shadow: 0 0 3px #007bff !important;\n}\n\n.magicfeedback-image-option-label-container input[type=radio] + img,\n.magicfeedback-image-option-label-container input[type=checkbox] + img {\n border: 1px solid transparent !important;\n}\n\n.magicfeedback-image-option-label-container{\n margin: 10px !important;\n height: calc(100% - 20px) !important;\n width: calc(100% - 20px) !important;\n}\n\n.magicfeedback-multiple-choice-image-option {\n display: flex;\n height: auto !important;\n box-shadow: 0 0 3px #ccc;\n}\n\n.magicfeedback-multiple-choice-image-label {\n font-size: 1rem;\n}\n\n.magicfeedback-consent-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin: 10px 0;\n width: 100%;\n}\n\n.magicfeedback-consent-container label {\n margin-left: 10px;\n}\n\n.magicfeedback-start-message-container {\n /* ... add your start message container styles here ... */\n}\n\n.magicfeedback-success-message,\n.magicfeedback-info-message,\n.magicfeedback-start-message {\n margin: 35px 5px;\n}\n\n.magicfeedback-success-message p,\n.magicfeedback-info-message p,\n.magicfeedback-start-message p {\n font-style: normal;\n text-align: start;\n font-weight: 400;\n font-size: 16px;\n color: #475569;\n line-height: 1.5;\n}\n\n.magicfeedback-success-message img,\n.magicfeedback-info-message img,\n.magicfeedback-start-message img {\n width: 400px;\n max-width: 80%;\n height: auto;\n margin: 10px auto;\n}\n\n.magicfeedback-counter,\n.magicfeedback-point-system-total {\n margin: 10px 0 0 0 !important;\n display: flex !important;\n justify-content: right !important;\n align-items: center !important;\n width: 100%;\n}\n\n.magicfeedback-skip-container {\n background-color: transparent !important;\n border: 0 !important;\n color: #999999FF !important;\n padding: 0 !important;\n margin: 0 !important;\n cursor: pointer !important;\n font-size: 0.5em !important;\n font-weight: 400 !important;\n box-shadow: 0 0 0 !important;\n\n &:hover {\n color: #0066ff;\n }\n}\n\n.magicfeedback-skip-container input[type=checkbox] {\n border-color: #999999FF !important;\n border: 0 !important;\n cursor: pointer !important;\n\n}\n\n.magicfeedback-multi-question-matrix,\n.magicfeedback-point-system,\n.magicfeedback-priority-list {\n width: 100% !important;\n}\n\n.magicfeedback-multi-question-matrix-container,\n.magicfeedback-point-system-container,\n.magicfeedback-priority-list-container {\n width: 100% !important;\n overflow-x: auto;\n}\n\n.magicfeedback-point-system-list,\n.magicfeedback-priority-list-list,\n.magicfeedback-multi-question-matrix-table {\n width: 100% !important;\n padding: 0 !important;\n overflow-x: auto;\n}\n\n.magicfeedback-multi-question-matrix {\n position: relative !important;\n}\n\n.magicfeedback-multi-question-matrix-container {\n overflow: auto !important;\n padding-bottom: 10px;\n}\n\n.magicfeedback-multi-question-matrix-label{\n text-align: left !important;\n}\n.magicfeedback-priority-list-item {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px 0 10px 10px;\n\n border: 1px solid #ced4da;\n border-radius: 5px;\n margin: 10px 0 !important;\n}\n\n.magicfeedback-point-system-item {\n height: 45px;\n margin: 5px 0 !important;\n}\n\n.magicfeedback-point-system-item label,\n.magicfeedback-priority-list-item-label {\n font-family: inherit;\n font-size: 18px !important;\n color: #212529;\n text-align: start;\n word-wrap: break-word;\n white-space: normal;\n padding: 0 10px 0 0;\n}\n\n.magicfeedback-point-system-input-container {\n padding: 0 10px 0 0;\n border-radius: 5px;\n font-size: 14px;\n border: 1px solid #ced4da;\n height: 42px;\n margin: auto 0;\n}\n\n.magicfeedback-multi-question-matrix-table thead {\n margin-bottom: 20px;\n}\n\n.magicfeedback-multi-question-matrix-table th{\n text-align: center;\n font-weight: 400 !important;\n font-size: 1rem !important;\n padding: 0 10px !important;\n}\n\n.magicfeedback-multi-question-matrix-table th,\n.magicfeedback-multi-question-matrix-table td label,\n.magicfeedback-priority-list-arrow-up,\n.magicfeedback-priority-list-arrow-down {\n font-style: normal !important;\n font-weight: 400 !important;\n font-size: 1rem !important;\n color: #475569 !important;\n cursor: pointer !important;\n margin: 0 !important;\n line-height: inherit;\n}\n\n.magicfeedback-multi-question-matrix-table tr {\n align-items: center;\n margin: 5px 0;\n}\n\n.magicfeedback-multi-question-matrix-row-tr{\n border-radius: 5px;\n margin: 10px 0 !important;\n}\n\n.magicfeedback-multi-question-matrix-row-tr:nth-child(odd) {\n background-color: #f1f6f6; /* Light gray background for odd rows */\n}\n\n.magicfeedback-multi-question-matrix-row-tr:nth-child(even) {\n background-color: #ffffff; /* White background for even rows */\n}\n\n.magicfeedback-multi-question-matrix-row-label {\n text-align: left !important;\n}\n\n.magicfeedback-point-system-item span {\n color: #475569 !important;\n}\n\n.magicfeedback-point-system-item input {\n padding: 0;\n margin: 0 !important;\n width: auto !important;\n min-width: 100px !important;\n height: auto !important;\n min-height: 42px;\n cursor: pointer;\n font-size: 14px;\n text-align: center !important;\n}\n\n.magicfeedback-multi-question-matrix-table input {\n margin: auto !important;\n padding: 20px !important;\n width: 100% !important;\n height: 15px;\n border: 1px solid #ced4da;\n cursor: pointer;\n}\n\n.magicfeedback-image{\n max-height: 400px !important;\n height: auto !important;\n max-width: 100% !important;\n margin: 10px auto !important;\n}\n\n.magicfeedback-error{\n margin-top: 5px;\n}';
188
+ style_default = `/**
189
+ * NO EDITAR A MANO \u2014 generado por scripts/vendor-survey-css.mjs
190
+ *
191
+ * Copia de @magicfeedback/native@2.2.8 \u2192 dist/styles/magicfeedback-default.css
192
+ * (la hoja can\xF3nica del paquete, la que apunta su campo "style"), con estos cambios locales:
193
+ *
194
+ * 1. Sin el @import de Google Fonts (Nunito): no queremos una petici\xF3n externa desde la
195
+ * p\xE1gina del host, y la tipograf\xEDa la decide el popup.
196
+ * 2. .magicfeedback-container hereda la fuente del popup (var(--deepdots-font, inherit)).
197
+ * 3. Los selectores desnudos (h2, p, input, textarea, select, ::placeholder, .error) van
198
+ * acotados a .deepdots-popup: este CSS se inyecta en el <head> del host y sin acotar
199
+ * repintar\xEDa su web.
200
+ * 4. El grupo .magicfeedback-radio se cualifica como div.magicfeedback-radio (la clase acaba
201
+ * tambi\xE9n en el <input> del boolean).
202
+ * 5. Al final, un bloque de reglas propias del popup (fuente en los controles y padding del
203
+ * radio nativo).
204
+ *
205
+ * Las variables --mf-* se dejan en :root a prop\xF3sito: el modal del priority-list se portea a
206
+ * <body>, fuera de .deepdots-popup, y ah\xED las necesita.
207
+ *
208
+ * Para subir de versi\xF3n: npm i @magicfeedback/native@<v> && node scripts/vendor-survey-css.mjs
209
+ */
210
+
211
+ /**
212
+ * @magicfeedback/native - Default Styles
213
+ * Clean, minimal, and elegant survey rendering
214
+ */
215
+
216
+ /* @import de Google Fonts (Nunito) eliminado al vendorizar: la fuente la pone el popup. */
217
+
218
+ /* ========================================
219
+ CSS VARIABLES - Design SYSTEM
220
+ ======================================== */
221
+ :root {
222
+ /* Colors - Minimal Pastel */
223
+ /* --mf-primary is the one source of truth for brand/accent color \u2014
224
+ every token below derives from it via color-mix() (or references
225
+ it directly) so changing this single value, here or via a
226
+ per-integration override, keeps hover/light/border states in
227
+ sync automatically instead of going stale independently. Scoped
228
+ to genuinely interactive/accent surfaces (buttons, selected
229
+ chips, focus rings) \u2014 general body text stays on its own neutral
230
+ scale below, not tied to the brand color. */
231
+ --mf-primary: #5d7bad;
232
+ --mf-primary-hover: color-mix(in srgb, var(--mf-primary) 85%, black);
233
+ --mf-primary-light: color-mix(in srgb, var(--mf-primary) 15%, white);
234
+ /* a translucent tint \u2014 mixed with transparent (opacity), not white,
235
+ so it reads as a soft shadow of the brand color rather than a
236
+ pastel of it. */
237
+ --mf-primary-border: color-mix(in srgb, var(--mf-primary) 35%, transparent);
238
+
239
+ --mf-text-primary: #1E293B;
240
+ --mf-text-secondary: #475569;
241
+ --mf-text-muted: #94A3B8;
242
+
243
+ --mf-bg-primary: #F8FAFC;
244
+ --mf-bg-secondary: #FFFFFF;
245
+ --mf-bg-hover: #EEF2F6;
246
+
247
+ --mf-border: #E2E8F0;
248
+ --mf-border-focus: var(--mf-primary);
249
+
250
+ --mf-success: #16A34A;
251
+ --mf-error: #EF4444;
252
+ --mf-warning: #F59E0B;
253
+
254
+ --mf-surface: #FFFFFF;
255
+ --mf-surface-alt: #F1F5F9;
256
+ --mf-accent: #38BDF8;
257
+
258
+ /* Spacing */
259
+ --mf-space-xs: 0.25rem;
260
+ --mf-space-sm: 0.5rem;
261
+ --mf-space-md: 0.75rem;
262
+ --mf-space-lg: 1rem;
263
+ --mf-space-xl: 1.5rem;
264
+
265
+ /* Border Radius */
266
+ --mf-radius-sm: 0.5rem;
267
+ --mf-radius-md: 0.75rem;
268
+ --mf-radius-lg: 1.25rem;
269
+ --mf-radius-full: 9999px;
270
+
271
+ /* Shadows */
272
+ --mf-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
273
+ --mf-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
274
+ --mf-shadow-lg: 0 16px 30px rgba(15, 23, 42, 0.12);
275
+ --mf-shadow-focus: 0 0 0 3px rgba(30, 41, 59, 0.15);
276
+ --mf-shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
277
+
278
+ /* Typography */
279
+ --mf-font-sans: "Nunito", "Quicksand", "Avenir Next", "Trebuchet MS", sans-serif;
280
+ --mf-font-size-sm: 0.875rem;
281
+ --mf-font-size-base: 1rem;
282
+ --mf-font-size-lg: 1.125rem;
283
+ --mf-font-size-xl: 1.25rem;
284
+ --mf-line-height: 1.6;
285
+
286
+ /* Font Weights */
287
+ --mf-font-weight-normal: 400;
288
+ --mf-font-weight-medium: 500;
289
+ --mf-font-weight-semibold: 600;
290
+ --mf-font-weight-bold: 700;
291
+ --mf-font-weight-extrabold: 800;
292
+
293
+ /* Transitions */
294
+ --mf-transition: all 0.2s ease;
295
+ --mf-transition-fast: all 0.15s ease;
296
+ }
297
+
298
+ /* ========================================
299
+ ANIMATIONS
300
+ ======================================== */
301
+ @keyframes mf-fade-in {
302
+ from {
303
+ opacity: 0;
304
+ transform: translateY(8px);
305
+ }
306
+ to {
307
+ opacity: 1;
308
+ transform: translateY(0);
309
+ }
310
+ }
311
+
312
+ @keyframes mf-slide-in {
313
+ from {
314
+ opacity: 0;
315
+ transform: translateX(-16px);
316
+ }
317
+ to {
318
+ opacity: 1;
319
+ transform: translateX(0);
320
+ }
321
+ }
322
+
323
+ @keyframes mf-scale-in {
324
+ from {
325
+ opacity: 0;
326
+ transform: scale(0.95);
327
+ }
328
+ to {
329
+ opacity: 1;
330
+ transform: scale(1);
331
+ }
332
+ }
333
+
334
+ @keyframes mf-pulse {
335
+ 0%,
336
+ 100% {
337
+ opacity: 1;
338
+ }
339
+ 50% {
340
+ opacity: 0.8;
341
+ }
342
+ }
343
+
344
+ /* ========================================
345
+ BASE CONTAINER
346
+ ======================================== */
347
+ .magicfeedback-container {
348
+ /* Local: hereda la fuente del popup; --deepdots-font viene de PopupStyle.font. */
349
+ font-family: var(--deepdots-font, inherit);
350
+ color: var(--mf-text-primary);
351
+ line-height: var(--mf-line-height);
352
+ animation: mf-fade-in 0.4s ease-out;
353
+ border-radius: var(--mf-radius-lg);
354
+ }
355
+
356
+ /* ========================================
357
+ MESSAGES
358
+ ======================================== */
359
+ .magicfeedback-success-message,
360
+ .magicfeedback-info-message,
361
+ .magicfeedback-start-message {
362
+ padding: var(--mf-space-lg);
363
+ margin: var(--mf-space-lg) 0;
364
+ animation: mf-scale-in 0.3s ease-out;
365
+ }
366
+
367
+ /* .magicfeedback-info-message/-start-message are set via innerHTML (see
368
+ renderInfoPage.ts / questions.service.ts's renderStartMessage) \u2014 whatever
369
+ rich text a survey author writes lands here as real HTML, not just the
370
+ <p>/<img> pair this used to style. Covering the rest of what a rich-text
371
+ editor commonly outputs (headings, lists, links, emphasis, quotes, code,
372
+ rules) keeps that content on the same type scale and palette as the rest
373
+ of the widget instead of falling back to unstyled browser defaults. */
374
+ .magicfeedback-success-message > :first-child,
375
+ .magicfeedback-info-message > :first-child,
376
+ .magicfeedback-start-message > :first-child {
377
+ margin-top: 0;
378
+ }
379
+
380
+ .magicfeedback-success-message > :last-child,
381
+ .magicfeedback-info-message > :last-child,
382
+ .magicfeedback-start-message > :last-child {
383
+ margin-bottom: 0;
384
+ }
385
+
386
+ .magicfeedback-success-message p,
387
+ .magicfeedback-info-message p,
388
+ .magicfeedback-start-message p {
389
+ font-size: var(--mf-font-size-base);
390
+ color: var(--mf-text-secondary);
391
+ margin: 0 0 var(--mf-space-md);
392
+ line-height: var(--mf-line-height);
393
+ }
394
+
395
+ .magicfeedback-info-message h1,
396
+ .magicfeedback-info-message h2,
397
+ .magicfeedback-info-message h3,
398
+ .magicfeedback-info-message h4,
399
+ .magicfeedback-info-message h5,
400
+ .magicfeedback-info-message h6,
401
+ .magicfeedback-start-message h1,
402
+ .magicfeedback-start-message h2,
403
+ .magicfeedback-start-message h3,
404
+ .magicfeedback-start-message h4,
405
+ .magicfeedback-start-message h5,
406
+ .magicfeedback-start-message h6 {
407
+ color: var(--mf-text-primary);
408
+ font-weight: var(--mf-font-weight-bold);
409
+ line-height: 1.3;
410
+ margin: var(--mf-space-lg) 0 var(--mf-space-sm);
411
+ text-align: left;
412
+ }
413
+
414
+ .magicfeedback-info-message h1, .magicfeedback-start-message h1 { font-size: var(--mf-font-size-xl); }
415
+ .magicfeedback-info-message h2, .magicfeedback-start-message h2 { font-size: var(--mf-font-size-lg); }
416
+ .magicfeedback-info-message h3,
417
+ .magicfeedback-info-message h4,
418
+ .magicfeedback-info-message h5,
419
+ .magicfeedback-info-message h6,
420
+ .magicfeedback-start-message h3,
421
+ .magicfeedback-start-message h4,
422
+ .magicfeedback-start-message h5,
423
+ .magicfeedback-start-message h6 { font-size: var(--mf-font-size-base); }
424
+
425
+ .magicfeedback-info-message strong,
426
+ .magicfeedback-info-message b,
427
+ .magicfeedback-start-message strong,
428
+ .magicfeedback-start-message b {
429
+ font-weight: var(--mf-font-weight-bold);
430
+ color: var(--mf-text-primary);
431
+ }
432
+
433
+ .magicfeedback-info-message a,
434
+ .magicfeedback-start-message a {
435
+ color: var(--mf-primary);
436
+ text-decoration: underline;
437
+ text-underline-offset: 2px;
438
+ }
439
+
440
+ .magicfeedback-info-message a:hover,
441
+ .magicfeedback-start-message a:hover {
442
+ color: var(--mf-primary-hover);
443
+ }
444
+
445
+ .magicfeedback-info-message ul,
446
+ .magicfeedback-info-message ol,
447
+ .magicfeedback-start-message ul,
448
+ .magicfeedback-start-message ol {
449
+ margin: 0 0 var(--mf-space-md);
450
+ padding-left: var(--mf-space-xl);
451
+ color: var(--mf-text-secondary);
452
+ line-height: var(--mf-line-height);
453
+ }
454
+
455
+ .magicfeedback-info-message li + li,
456
+ .magicfeedback-start-message li + li {
457
+ margin-top: var(--mf-space-xs);
458
+ }
459
+
460
+ .magicfeedback-info-message blockquote,
461
+ .magicfeedback-start-message blockquote {
462
+ margin: 0 0 var(--mf-space-md);
463
+ padding: var(--mf-space-sm) var(--mf-space-md);
464
+ border-left: 3px solid var(--mf-primary-border);
465
+ color: var(--mf-text-secondary);
466
+ font-style: italic;
467
+ }
468
+
469
+ .magicfeedback-info-message code,
470
+ .magicfeedback-start-message code {
471
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
472
+ font-size: 0.9em;
473
+ background: var(--mf-bg-hover);
474
+ padding: 0.15em 0.4em;
475
+ border-radius: var(--mf-radius-sm);
476
+ }
477
+
478
+ .magicfeedback-info-message pre,
479
+ .magicfeedback-start-message pre {
480
+ margin: 0 0 var(--mf-space-md);
481
+ padding: var(--mf-space-md);
482
+ background: var(--mf-bg-hover);
483
+ border-radius: var(--mf-radius-md);
484
+ overflow-x: auto;
485
+ }
486
+
487
+ .magicfeedback-info-message pre code,
488
+ .magicfeedback-start-message pre code {
489
+ background: none;
490
+ padding: 0;
491
+ }
492
+
493
+ .magicfeedback-info-message hr,
494
+ .magicfeedback-start-message hr {
495
+ border: none;
496
+ border-top: 1px solid var(--mf-border);
497
+ margin: var(--mf-space-lg) 0;
498
+ }
499
+
500
+ .magicfeedback-success-message img,
501
+ .magicfeedback-info-message img,
502
+ .magicfeedback-start-message img {
503
+ max-width: 100%;
504
+ height: auto;
505
+ margin: var(--mf-space-lg) auto;
506
+ display: block;
507
+ border-radius: var(--mf-radius-md);
508
+ }
509
+
510
+ .magicfeedback-image {
511
+ max-height: 400px;
512
+ height: auto;
513
+ max-width: 100%;
514
+ margin: var(--mf-space-lg) auto;
515
+ display: block;
516
+ border-radius: var(--mf-radius-md);
517
+ }
518
+
519
+ /* ========================================
520
+ FORM STRUCTURE
521
+ ======================================== */
522
+ .magicfeedback-form {
523
+ display: flex;
524
+ flex-direction: column;
525
+ gap: var(--mf-space-lg);
526
+ padding: clamp(16px, 2.5vw, 28px);
527
+ }
528
+
529
+ .magicfeedback-questions {
530
+ display: flex;
531
+ flex-direction: column;
532
+ gap: var(--mf-space-xl);
533
+ width: 100%;
534
+ }
535
+
536
+ .magicfeedback-div {
537
+ display: flex;
538
+ flex-direction: column;
539
+ gap: var(--mf-space-sm);
540
+ animation: mf-slide-in 0.3s ease-out;
541
+ background: var(--mf-bg-secondary);
542
+ border-radius: var(--mf-radius-md);
543
+ }
544
+
545
+ /* ========================================
546
+ LABELS & TYPOGRAPHY
547
+ ======================================== */
548
+ .magicfeedback-label {
549
+ font-size: var(--mf-font-size-lg);
550
+ font-weight: var(--mf-font-weight-bold);
551
+ color: var(--mf-text-primary);
552
+ line-height: var(--mf-line-height);
553
+ text-align: left;
554
+ letter-spacing: -0.01em;
555
+ }
556
+
557
+ .magicfeedback-sublabel {
558
+ font-size: var(--mf-font-size-base);
559
+ font-weight: var(--mf-font-weight-normal);
560
+ color: var(--mf-text-secondary);
561
+ margin-bottom: var(--mf-space-sm);
562
+ }
563
+
564
+ .deepdots-popup h2 {
565
+ font-size: var(--mf-font-size-xl);
566
+ font-weight: 600;
567
+ color: var(--mf-text-primary);
568
+ margin: 0 0 var(--mf-space-xl) 0;
569
+ text-align: center;
570
+ letter-spacing: -0.01em;
571
+ }
572
+
573
+ .deepdots-popup p {
574
+ margin: 0;
575
+ font-size: var(--mf-font-size-sm);
576
+ color: var(--mf-text-secondary);
577
+ }
578
+
579
+ /* ========================================
580
+ FORM INPUTS
581
+ ======================================== */
582
+ .deepdots-popup input[type="date"],
583
+ .deepdots-popup input[type="text"],
584
+ .deepdots-popup input[type="number"],
585
+ .deepdots-popup input[type="email"],
586
+ .deepdots-popup input[type="password"],
587
+ .deepdots-popup textarea,
588
+ .deepdots-popup select {
589
+ padding: 0.75rem 0.9rem;
590
+ font-size: var(--mf-font-size-base);
591
+ font-family: inherit;
592
+ color: var(--mf-text-primary);
593
+ background-color: var(--mf-surface);
594
+ border: 2px solid var(--mf-border);
595
+ border-radius: var(--mf-radius-md);
596
+ outline: none;
597
+ transition: var(--mf-transition);
598
+ -webkit-appearance: none;
599
+ appearance: none;
600
+ box-shadow: var(--mf-shadow-sm);
601
+ }
602
+
603
+ .deepdots-popup textarea {
604
+ min-height: 100px;
605
+ resize: vertical;
606
+ }
607
+
608
+ .deepdots-popup input::placeholder,
609
+ .deepdots-popup textarea::placeholder {
610
+ color: var(--mf-text-muted);
611
+ }
612
+
613
+ /* Remove number input spinners */
614
+ .deepdots-popup input::-webkit-outer-spin-button,
615
+ .deepdots-popup input::-webkit-inner-spin-button {
616
+ -webkit-appearance: none;
617
+ margin: 0;
618
+ }
619
+
620
+ .deepdots-popup input[type="number"] {
621
+ /* -moz-appearance: textfield; removed for lint compatibility */
622
+ }
623
+
624
+ /* Custom Select Arrow */
625
+ .deepdots-popup select {
626
+ 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");
627
+ background-repeat: no-repeat;
628
+ background-position: right var(--mf-space-md) center;
629
+ padding-right: var(--mf-space-xl);
630
+ }
631
+
632
+ /* Error State */
633
+ .deepdots-popup input.error,
634
+ .deepdots-popup select.error,
635
+ .deepdots-popup textarea.error {
636
+ border-color: var(--mf-error);
637
+ }
638
+
639
+ .magicfeedback-error {
640
+ margin-top: var(--mf-space-xs);
641
+ font-size: var(--mf-font-size-sm);
642
+ color: var(--mf-error);
643
+ }
644
+
645
+ /* ========================================
646
+ CHECKBOX & RADIO OPTIONS
647
+ ======================================== */
648
+ .magicfeedback-checkbox,
649
+ div.magicfeedback-radio {
650
+ display: flex;
651
+ flex-direction: column;
652
+ gap: var(--mf-space-sm);
653
+ width: 100%;
654
+ }
655
+
656
+ .magicfeedback-checkbox-container,
657
+ .magicfeedback-radio-container {
658
+ display: flex;
659
+ align-items: center;
660
+ gap: var(--mf-space-sm);
661
+ padding: var(--mf-space-md);
662
+ border: 1.5px solid var(--mf-border);
663
+ border-radius: var(--mf-radius-md);
664
+ cursor: pointer;
665
+ transition: var(--mf-transition-fast);
666
+ }
667
+
668
+ .magicfeedback-checkbox-container:hover,
669
+ .magicfeedback-radio-container:hover {
670
+ background-color: var(--mf-bg-hover);
671
+ border-color: var(--mf-primary);
672
+ }
673
+
674
+ .magicfeedback-checkbox-container:has(input:checked),
675
+ .magicfeedback-radio-container:has(input:checked) {
676
+ background-color: var(--mf-primary-light);
677
+ border-color: var(--mf-primary);
678
+ }
679
+
680
+ .magicfeedback-checkbox input[type="checkbox"],
681
+ .magicfeedback-radio-container input[type="radio"] {
682
+ width: 18px;
683
+ height: 18px;
684
+ margin: 0;
685
+ cursor: pointer;
686
+ flex-shrink: 0;
687
+ accent-color: var(--mf-primary);
688
+ }
689
+
690
+ .magicfeedback-checkbox label,
691
+ .magicfeedback-radio-container label {
692
+ font-size: var(--mf-font-size-base);
693
+ text-align: left;
694
+ color: var(--mf-text-primary);
695
+ cursor: pointer;
696
+ margin: 0;
697
+ flex: 1;
698
+ }
699
+
700
+ /* ========================================
701
+ BOOLEAN OPTIONS
702
+ ======================================== */
703
+ .magicfeedback-boolean-container {
704
+ display: flex;
705
+ gap: var(--mf-space-md);
706
+ width: 100%;
707
+ }
708
+
709
+ .magicfeedback-boolean-option {
710
+ flex: 1;
711
+ position: relative;
712
+ }
713
+
714
+ .magicfeedback-boolean-option input[type="radio"] {
715
+ position: absolute;
716
+ opacity: 0;
717
+ width: 0;
718
+ height: 0;
719
+ }
720
+
721
+ .magicfeedback-boolean-option label {
722
+ display: flex;
723
+ align-items: center;
724
+ justify-content: center;
725
+ padding: var(--mf-space-md);
726
+ font-size: var(--mf-font-size-base);
727
+ font-weight: 500;
728
+ color: var(--mf-text-secondary);
729
+ border: 1.5px solid var(--mf-border);
730
+ border-radius: var(--mf-radius-md);
731
+ cursor: pointer;
732
+ transition: var(--mf-transition-fast);
733
+ margin: 0;
734
+ width: -webkit-fill-available;
735
+ height: inherit;
736
+ }
737
+
738
+ .magicfeedback-boolean-option label:hover {
739
+ background-color: var(--mf-bg-hover);
740
+ border-color: var(--mf-primary);
741
+ }
742
+
743
+ .magicfeedback-boolean-option input[type="radio"]:checked + label {
744
+ color: var(--mf-primary);
745
+ background-color: var(--mf-primary-light);
746
+ border-color: var(--mf-primary);
747
+ font-weight: 600;
748
+ }
749
+
750
+ /* ========================================
751
+ RATING SYSTEMS
752
+ ======================================== */
753
+ .magicfeedback-rating,
754
+ .magicfeedback-rating-number,
755
+ .magicfeedback-rating-star {
756
+ width: 100%;
757
+ }
758
+
759
+ .magicfeedback-rating-container,
760
+ .magicfeedback-rating-number-container,
761
+ .magicfeedback-rating-star-container {
762
+ display: flex;
763
+ flex-wrap: wrap;
764
+ gap: var(--mf-space-sm);
765
+ justify-content: center;
766
+ align-items: center;
767
+ padding: var(--mf-space-md) 0;
768
+ list-style: none;
769
+ margin: 0;
770
+ }
771
+
772
+ /* Caption line below the row \u2014 min on one side, max on the other (swapped
773
+ for order: "rtl") \u2014 same simple, non-responsive pattern as the
774
+ rating-number row caption. Used by rating-star and rating-emoji. */
775
+ .magicfeedback-rating-placeholder {
776
+ display: flex;
777
+ justify-content: space-between;
778
+ gap: var(--mf-space-md);
779
+ width: 100%;
780
+ margin-top: var(--mf-space-sm);
781
+ font-size: var(--mf-font-size-sm);
782
+ font-weight: var(--mf-font-weight-semibold);
783
+ color: var(--mf-text-secondary);
784
+ }
785
+
786
+ .magicfeedback-rating-placeholder-value {
787
+ overflow-wrap: anywhere;
788
+ }
789
+
790
+ .magicfeedback-rating-placeholder-value:last-child {
791
+ text-align: right;
792
+ }
793
+
794
+ /* Rating with Images */
795
+ .magicfeedback-rating-option-label-container input[type="radio"] {
796
+ position: absolute;
797
+ opacity: 0;
798
+ width: 0;
799
+ height: 0;
800
+ }
801
+
802
+ .magicfeedback-rating-option-label-container img {
803
+ width: 56px;
804
+ height: 56px;
805
+ cursor: pointer;
806
+ transition: var(--mf-transition-fast);
807
+ border-radius: var(--mf-radius-full);
808
+ border: 2px solid transparent;
809
+ }
810
+
811
+ .magicfeedback-rating-option-label-container img:hover {
812
+ transform: scale(1.1);
813
+ border-color: var(--mf-primary);
814
+ }
815
+
816
+ .magicfeedback-rating-option-label-container input[type="radio"]:checked + img {
817
+ border-color: var(--mf-primary);
818
+ box-shadow: 0 0 0 3px var(--mf-primary-light);
819
+ }
820
+
821
+ .magicfeedback-rating-option-label-container label {
822
+ display: block;
823
+ text-align: center;
824
+ font-size: var(--mf-font-size-sm);
825
+ color: var(--mf-text-secondary);
826
+ margin-top: var(--mf-space-xs);
827
+ cursor: pointer;
828
+ }
829
+
830
+ /* Rating Numbers \u2014 each option is its own outlined chip in the survey's
831
+ primary color, with a gap between them. Row and column use the same
832
+ chip; column additionally has room to show each option's own text
833
+ plainly next to its number. */
834
+
835
+ /* Every size here is width:100%/flex:1 combined with the chip's own
836
+ padding and border. Without border-box, the browser's default
837
+ content-box adds that padding/border on TOP of the declared size, so
838
+ the chip quietly overflows past its flex slot \u2014 reading as "not quite
839
+ full width" or, worse, pushing into the next chip. */
840
+ .magicfeedback-rating-number-container,
841
+ .magicfeedback-rating-number-option,
842
+ .magicfeedback-rating-number-option-label-container,
843
+ .magicfeedback-rating-number-value {
844
+ box-sizing: border-box;
845
+ }
846
+
847
+ /* The shared rating-container rule (above, reused by star rating) sets
848
+ align-items:center for its row-of-chips layout \u2014 in a stacked column
849
+ that still nudges a 100%-wide chip inward instead of a true 0 offset.
850
+ Force stretch so every chip fills the exact same width, flush on
851
+ both sides. */
852
+ .magicfeedback-rating-number-container-column,
853
+ .magicfeedback-rating-number-container-column-reverse {
854
+ align-items: stretch;
855
+ }
856
+
857
+ /* Caption line below the row \u2014 the single place min/max labels live
858
+ for row mode, shared by mobile and desktop. */
859
+ .magicfeedback-rating-number-scale-labels {
860
+ display: flex;
861
+ justify-content: space-between;
862
+ gap: var(--mf-space-md);
863
+ margin-top: var(--mf-space-sm);
864
+ font-size: var(--mf-font-size-sm);
865
+ font-weight: var(--mf-font-weight-semibold);
866
+ color: var(--mf-text-secondary);
867
+ }
868
+
869
+ .magicfeedback-rating-number-scale-label {
870
+ overflow-wrap: anywhere;
871
+ }
872
+
873
+ .magicfeedback-rating-number-scale-label:last-child {
874
+ text-align: right;
875
+ }
876
+
877
+ /* Column, no per-option text: each row is its own separated chip, so
878
+ the min/max labels bookend the stack from outside it \u2014 one line
879
+ above the first chip, one below the last. Margin goes on whichever
880
+ side actually faces the list \u2014 the "before" label (always the first
881
+ child) gets space below it, the "after" one (always right after the
882
+ container, extra option row or not) gets space above it \u2014 so both
883
+ sit the same distance from the chips regardless of which one it is. */
884
+ .magicfeedback-rating-number-scale-label-block {
885
+ font-size: var(--mf-font-size-sm);
886
+ font-weight: var(--mf-font-weight-semibold);
887
+ color: var(--mf-text-secondary);
888
+ text-align: center;
889
+ }
890
+
891
+ .magicfeedback-rating-number-scale-label-block:first-child {
892
+ margin-bottom: var(--mf-space-sm);
893
+ }
894
+
895
+ .magicfeedback-rating-number-container + .magicfeedback-rating-number-scale-label-block {
896
+ margin-top: var(--mf-space-sm);
897
+ }
898
+
899
+ .magicfeedback-rating-number-option {
900
+ display: flex;
901
+ }
902
+
903
+ .magicfeedback-rating-number-option-label-container {
904
+ position: relative;
905
+ width: 100%;
906
+ display: flex;
907
+ cursor: pointer;
908
+ }
909
+
910
+ .magicfeedback-rating-number-option-label-container input[type="radio"] {
911
+ position: absolute;
912
+ opacity: 0;
913
+ width: 0;
914
+ height: 0;
915
+ }
916
+
917
+ .magicfeedback-rating-number-value {
918
+ display: flex;
919
+ align-items: center;
920
+ justify-content: center;
921
+ width: 100%;
922
+ transition: var(--mf-transition-fast);
923
+ color: var(--mf-text-secondary);
924
+ font-weight: var(--mf-font-weight-semibold);
925
+ }
926
+
927
+ /* Row: individual outlined chips in the survey's own primary color \u2014
928
+ var(--mf-primary) so whatever brand color a given survey sets carries
929
+ through automatically, no color hardcoded here. */
930
+ .magicfeedback-rating-number-container-row,
931
+ .magicfeedback-rating-number-container-row-reverse {
932
+ flex-wrap: nowrap;
933
+ gap: var(--mf-space-sm);
934
+ }
935
+
936
+ .magicfeedback-rating-number-option-row,
937
+ .magicfeedback-rating-number-option-row-reverse {
938
+ flex: 1 1 0;
939
+ min-width: 0;
940
+ }
941
+
942
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
943
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
944
+ min-height: 56px;
945
+ padding: var(--mf-space-sm);
946
+ border: 2px solid var(--mf-primary-border);
947
+ border-radius: var(--mf-radius-md);
948
+ background: var(--mf-bg-secondary);
949
+ color: var(--mf-primary);
950
+ font-size: var(--mf-font-size-lg);
951
+ font-weight: var(--mf-font-weight-bold);
952
+ }
953
+
954
+ /* More than 6 options (e.g. a 0-10 NPS scale): still one row, never
955
+ wraps \u2014 but scaled down on purpose, so it reads as a compact chip
956
+ rather than the same 56px button stretched thin. */
957
+ .magicfeedback-rating-number-container-row--dense .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
958
+ .magicfeedback-rating-number-container-row--dense .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
959
+ min-height: 36px;
960
+ padding: var(--mf-space-xs);
961
+ border-radius: var(--mf-radius-sm);
962
+ font-size: 0.8rem;
963
+ }
964
+
965
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value,
966
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
967
+ background: var(--mf-primary-light);
968
+ }
969
+
970
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
971
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
972
+ color: #fff;
973
+ background-color: var(--mf-primary);
974
+ box-shadow: var(--mf-shadow-md);
975
+ }
976
+
977
+ /* Extra option: always its own row below the scale, and styled like every
978
+ other chip now \u2014 "doesn't apply" is still not a point on the 1..N
979
+ continuum, but it no longer needs a different border style to say so. */
980
+ .magicfeedback-rating-number-extra-row {
981
+ display: flex;
982
+ justify-content: center;
983
+ margin-top: var(--mf-space-sm);
984
+ }
985
+
986
+ .magicfeedback-rating-number-option--extra {
987
+ flex: 0 1 auto;
988
+ }
989
+
990
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container {
991
+ width: auto;
992
+ }
993
+
994
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-value {
995
+ min-height: 36px;
996
+ padding: 0 var(--mf-space-md);
997
+ border: 2px solid var(--mf-primary-border);
998
+ border-radius: var(--mf-radius-md);
999
+ background: var(--mf-bg-secondary);
1000
+ color: var(--mf-primary);
1001
+ font-size: var(--mf-font-size-sm);
1002
+ }
1003
+
1004
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
1005
+ background: var(--mf-primary-light);
1006
+ }
1007
+
1008
+ .magicfeedback-rating-number-option--extra .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
1009
+ color: #fff;
1010
+ background-color: var(--mf-primary);
1011
+ box-shadow: var(--mf-shadow-md);
1012
+ }
1013
+
1014
+ /* Column: the same separated chips as row, just stacked \u2014 each option is
1015
+ its own outlined chip with a gap between them, not one shared box. */
1016
+ .magicfeedback-rating-number-container-column,
1017
+ .magicfeedback-rating-number-container-column-reverse {
1018
+ gap: var(--mf-space-sm);
1019
+ }
1020
+
1021
+ .magicfeedback-rating-number-option-column,
1022
+ .magicfeedback-rating-number-option-column-reverse {
1023
+ width: 100%;
1024
+ }
1025
+
1026
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-value,
1027
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-value {
1028
+ justify-content: flex-start;
1029
+ gap: var(--mf-space-sm);
1030
+ min-height: 48px;
1031
+ padding: var(--mf-space-sm) var(--mf-space-md);
1032
+ border: 2px solid var(--mf-primary-border);
1033
+ border-radius: var(--mf-radius-md);
1034
+ background: var(--mf-bg-secondary);
1035
+ color: var(--mf-primary);
1036
+ }
1037
+
1038
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value,
1039
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container:hover .magicfeedback-rating-number-value {
1040
+ background: var(--mf-primary-light);
1041
+ }
1042
+
1043
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
1044
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
1045
+ color: #fff;
1046
+ background-color: var(--mf-primary);
1047
+ box-shadow: var(--mf-shadow-md);
1048
+ }
1049
+
1050
+ .magicfeedback-rating-number-value-num {
1051
+ font-weight: var(--mf-font-weight-bold);
1052
+ }
1053
+
1054
+ /* Column with per-option text: a min-width so "1".."9" and "10" line up,
1055
+ with the label text starting at the same x. Skipped entirely when the
1056
+ column has no per-option text at all (--bare below) \u2014 with nothing to
1057
+ align against, the same left-shift bug from row mode would resurface. */
1058
+ .magicfeedback-rating-number-container-column:not(.magicfeedback-rating-number-container-column--bare) .magicfeedback-rating-number-value-num,
1059
+ .magicfeedback-rating-number-container-column-reverse:not(.magicfeedback-rating-number-container-column--bare) .magicfeedback-rating-number-value-num {
1060
+ flex: none;
1061
+ min-width: 1.4em;
1062
+ }
1063
+
1064
+ /* Column, no per-option text at all (only min/max, or nothing): a bare
1065
+ numbered list has nothing to left-align against, so center each
1066
+ number instead of stranding it on the left with blank space beside it. */
1067
+ .magicfeedback-rating-number-container-column--bare .magicfeedback-rating-number-value {
1068
+ justify-content: center;
1069
+ }
1070
+
1071
+ .magicfeedback-rating-number-value-label {
1072
+ font-weight: var(--mf-font-weight-medium);
1073
+ }
1074
+
1075
+ .magicfeedback-rating-number-option-column .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value,
1076
+ .magicfeedback-rating-number-option-column-reverse .magicfeedback-rating-number-option-label-container input[type="radio"]:checked + .magicfeedback-rating-number-value {
1077
+ color: #fff;
1078
+ background-color: var(--mf-primary);
1079
+ }
1080
+
1081
+ /* Star Rating */
1082
+ .magicfeedback-rating-star-container {
1083
+ justify-content: center;
1084
+ }
1085
+
1086
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star {
1087
+ font-size: 40px;
1088
+ color: var(--mf-border);
1089
+ cursor: pointer;
1090
+ margin: 0 var(--mf-space-xs);
1091
+ transition: var(--mf-transition-fast);
1092
+ }
1093
+
1094
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover,
1095
+ .magicfeedback-rating-star-option:not(:checked) > .rating__star:hover ~ span {
1096
+ color: #fbbf24;
1097
+ transform: scale(1.1);
1098
+ }
1099
+
1100
+ .magicfeedback-rating-star-selected {
1101
+ color: #fbbf24 !important;
1102
+ }
1103
+
1104
+ /* ========================================
1105
+ MULTIPLE CHOICE WITH IMAGES
1106
+ ======================================== */
1107
+ .magicfeedback-multiple-choice-image-option {
1108
+ display: flex;
1109
+ border-radius: var(--mf-radius-md);
1110
+ overflow: hidden;
1111
+ transition: var(--mf-transition-fast);
1112
+ }
1113
+
1114
+ .magicfeedback-image-option-label-container {
1115
+ cursor: pointer;
1116
+ border-radius: var(--mf-radius-md);
1117
+ overflow: hidden;
1118
+ transition: var(--mf-transition-fast);
1119
+ }
1120
+
1121
+ .magicfeedback-image-option-label-container input[type="radio"],
1122
+ .magicfeedback-image-option-label-container input[type="checkbox"] {
1123
+ position: absolute;
1124
+ opacity: 0;
1125
+ width: 0;
1126
+ height: 0;
1127
+ }
1128
+
1129
+ .magicfeedback-image-option-label-container img {
1130
+ width: 100%;
1131
+ height: auto;
1132
+ display: block;
1133
+ border: 2px solid var(--mf-border);
1134
+ border-radius: var(--mf-radius-md);
1135
+ transition: var(--mf-transition-fast);
1136
+ }
1137
+
1138
+ .magicfeedback-image-option-label-container:hover img {
1139
+ border-color: var(--mf-primary);
1140
+ box-shadow: var(--mf-shadow-md);
1141
+ }
1142
+
1143
+ .magicfeedback-image-option-label-container input:checked + img {
1144
+ border-color: var(--mf-primary);
1145
+ box-shadow: 0 0 0 3px var(--mf-primary-light);
1146
+ }
1147
+
1148
+ /* ========================================
1149
+ MATRIX QUESTIONS
1150
+ ======================================== */
1151
+ .magicfeedback-multi-question-matrix-container {
1152
+ width: 100%;
1153
+ overflow-x: auto;
1154
+ border-radius: var(--mf-radius-md);
1155
+ }
1156
+
1157
+ .magicfeedback-multi-question-matrix-table {
1158
+ width: 100%;
1159
+ border-collapse: separate;
1160
+ border-spacing: 0 var(--mf-space-xs);
1161
+ }
1162
+
1163
+ .magicfeedback-multi-question-matrix-table th {
1164
+ padding: var(--mf-space-md);
1165
+ text-align: center;
1166
+ font-size: var(--mf-font-size-sm);
1167
+ font-weight: 500;
1168
+ color: var(--mf-text-secondary);
1169
+ }
1170
+
1171
+ .magicfeedback-multi-question-matrix-row-tr {
1172
+ background-color: var(--mf-bg-primary);
1173
+ border-radius: var(--mf-radius-md);
1174
+ transition: var(--mf-transition-fast);
1175
+ }
1176
+
1177
+ .magicfeedback-multi-question-matrix-row-tr:nth-child(even) {
1178
+ background-color: var(--mf-bg-secondary);
1179
+ }
1180
+
1181
+ .magicfeedback-multi-question-matrix-row-tr:hover {
1182
+ background-color: var(--mf-bg-hover);
1183
+ box-shadow: var(--mf-shadow-sm);
1184
+ }
1185
+
1186
+ .magicfeedback-multi-question-matrix-table td {
1187
+ padding: var(--mf-space-md);
1188
+ text-align: center;
1189
+ }
1190
+
1191
+ .magicfeedback-multi-question-matrix-label {
1192
+ text-align: left;
1193
+ font-size: var(--mf-font-size-base);
1194
+ color: var(--mf-text-primary);
1195
+ }
1196
+
1197
+ .magicfeedback-multi-question-matrix-table input[type="radio"] {
1198
+ width: 20px;
1199
+ height: 20px;
1200
+ cursor: pointer;
1201
+ accent-color: var(--mf-primary);
1202
+ }
1203
+
1204
+ /* ========================================
1205
+ PRIORITY LIST
1206
+ ======================================== */
1207
+ .magicfeedback-priority-list-item {
1208
+ display: flex;
1209
+ align-items: center;
1210
+ justify-content: space-between;
1211
+ padding: var(--mf-space-md);
1212
+ margin: var(--mf-space-sm) 0;
1213
+ background-color: var(--mf-bg-primary);
1214
+ border: 1.5px solid var(--mf-border);
1215
+ border-radius: var(--mf-radius-md);
1216
+ transition: var(--mf-transition-fast);
1217
+ }
1218
+
1219
+ .magicfeedback-priority-list-item:hover {
1220
+ box-shadow: var(--mf-shadow-sm);
1221
+ border-color: var(--mf-primary);
1222
+ }
1223
+
1224
+ .magicfeedback-priority-list-item-label {
1225
+ flex: 1;
1226
+ font-size: var(--mf-font-size-base);
1227
+ text-align: left;
1228
+ color: var(--mf-text-primary);
1229
+ margin: 0;
1230
+ }
1231
+
1232
+ .magicfeedback-priority-list-arrow-up,
1233
+ .magicfeedback-priority-list-arrow-down {
1234
+ padding: var(--mf-space-xs);
1235
+ font-size: var(--mf-font-size-lg);
1236
+ color: var(--mf-text-secondary);
1237
+ cursor: pointer;
1238
+ transition: var(--mf-transition-fast);
1239
+ user-select: none;
1240
+ }
1241
+
1242
+ .magicfeedback-priority-list-arrow-up:hover,
1243
+ .magicfeedback-priority-list-arrow-down:hover {
1244
+ color: var(--mf-primary);
1245
+ transform: scale(1.2);
1246
+ }
1247
+
1248
+ /* ========================================
1249
+ POINT SYSTEM
1250
+ ======================================== */
1251
+ .magicfeedback-point-system-item {
1252
+ display: flex;
1253
+ align-items: center;
1254
+ justify-content: space-between;
1255
+ padding: var(--mf-space-md);
1256
+ margin: var(--mf-space-sm) 0;
1257
+ background-color: var(--mf-bg-primary);
1258
+ border: 1.5px solid var(--mf-border);
1259
+ border-radius: var(--mf-radius-md);
1260
+ min-height: 45px;
1261
+ }
1262
+
1263
+ .magicfeedback-point-system-item label {
1264
+ flex: 1;
1265
+ font-size: var(--mf-font-size-base);
1266
+ color: var(--mf-text-primary);
1267
+ margin: 0;
1268
+ }
1269
+
1270
+ .magicfeedback-point-system-input-container {
1271
+ display: flex;
1272
+ align-items: center;
1273
+ gap: var(--mf-space-sm);
1274
+ }
1275
+
1276
+ .magicfeedback-point-system-item input {
1277
+ width: 80px;
1278
+ min-width: 80px;
1279
+ padding: var(--mf-space-sm);
1280
+ text-align: center;
1281
+ font-size: var(--mf-font-size-base);
1282
+ border: 1.5px solid var(--mf-border);
1283
+ border-radius: var(--mf-radius-md);
1284
+ margin: 0;
1285
+ }
1286
+
1287
+ .magicfeedback-point-system-total {
1288
+ display: flex;
1289
+ justify-content: flex-end;
1290
+ margin-top: var(--mf-space-md);
1291
+ font-size: var(--mf-font-size-base);
1292
+ font-weight: 600;
1293
+ color: var(--mf-text-primary);
1294
+ }
1295
+
1296
+ /* ========================================
1297
+ CONSENT
1298
+ ======================================== */
1299
+ .magicfeedback-consent-container {
1300
+ display: flex;
1301
+ flex-direction: row;
1302
+ align-items: center;
1303
+ gap: var(--mf-space-sm);
1304
+ padding: var(--mf-space-md);
1305
+ background-color: var(--mf-bg-secondary);
1306
+ border-radius: var(--mf-radius-md);
1307
+ margin: var(--mf-space-md) 0;
1308
+ }
1309
+
1310
+ .magicfeedback-consent-container input[type="checkbox"] {
1311
+ margin-top: 2px;
1312
+ flex-shrink: 0;
1313
+ accent-color: var(--mf-primary);
1314
+ }
1315
+
1316
+ .magicfeedback-consent-container label {
1317
+ flex: 1;
1318
+ font-size: var(--mf-font-size-sm);
1319
+ text-align: left;
1320
+ color: var(--mf-text-secondary);
1321
+ line-height: var(--mf-line-height);
1322
+ cursor: pointer;
1323
+ margin-bottom: 0;
1324
+ }
1325
+
1326
+ /* ========================================
1327
+ ACTION BUTTONS
1328
+ ======================================== */
1329
+ .magicfeedback-action-container {
1330
+ display: flex;
1331
+ align-items: center;
1332
+ justify-content: space-between;
1333
+ gap: var(--mf-space-md);
1334
+ margin-top: var(--mf-space-xl);
1335
+ padding-top: var(--mf-space-lg);
1336
+ border-top: 1px solid var(--mf-border);
1337
+ }
1338
+
1339
+ .magicfeedback-submit {
1340
+ padding: 0.8rem 1.6rem;
1341
+ font-size: var(--mf-font-size-base);
1342
+ font-weight: 800;
1343
+ color: #FFFFFF;
1344
+ background-color: var(--mf-primary);
1345
+ border: 2px solid var(--mf-primary);
1346
+ border-radius: var(--mf-radius-full);
1347
+ cursor: pointer;
1348
+ transition: var(--mf-transition-fast);
1349
+ box-shadow: var(--mf-shadow-md);
1350
+ }
1351
+
1352
+ .magicfeedback-submit:hover {
1353
+ background-color: var(--mf-primary-hover);
1354
+ box-shadow: var(--mf-shadow-lg);
1355
+ transform: translateY(-2px);
1356
+ }
1357
+
1358
+ .magicfeedback-submit:active {
1359
+ transform: translateY(0);
1360
+ box-shadow: var(--mf-shadow-sm);
1361
+ }
1362
+
1363
+ .magicfeedback-submit:disabled {
1364
+ opacity: 0.5;
1365
+ cursor: not-allowed;
1366
+ transform: none;
1367
+ }
1368
+
1369
+ .magicfeedback-back {
1370
+ padding: 0.65rem 1rem;
1371
+ font-size: var(--mf-font-size-base);
1372
+ font-weight: 700;
1373
+ color: var(--mf-primary);
1374
+ background-color: var(--mf-bg-secondary);
1375
+ border: 2px solid var(--mf-border);
1376
+ border-radius: var(--mf-radius-full);
1377
+ cursor: pointer;
1378
+ transition: var(--mf-transition-fast);
1379
+ }
1380
+
1381
+ .magicfeedback-back:hover {
1382
+ border-color: var(--mf-primary);
1383
+ background-color: var(--mf-bg-hover);
1384
+ }
1385
+
1386
+ /* ========================================
1387
+ SKIP & COUNTER
1388
+ ======================================== */
1389
+ .magicfeedback-skip-container {
1390
+ display: flex;
1391
+ align-items: center;
1392
+ gap: var(--mf-space-xs);
1393
+ padding: 0;
1394
+ margin: 0;
1395
+ font-size: var(--mf-font-size-sm);
1396
+ color: var(--mf-text-muted);
1397
+ background: transparent;
1398
+ border: none;
1399
+ cursor: pointer;
1400
+ transition: var(--mf-transition-fast);
1401
+ }
1402
+
1403
+ .magicfeedback-skip-container:hover {
1404
+ color: var(--mf-primary);
1405
+ }
1406
+
1407
+ .magicfeedback-skip-container input[type="checkbox"] {
1408
+ margin: 0;
1409
+ cursor: pointer;
1410
+ accent-color: var(--mf-primary);
1411
+ }
1412
+
1413
+ .magicfeedback-counter {
1414
+ display: flex;
1415
+ justify-content: flex-end;
1416
+ margin-top: var(--mf-space-md);
1417
+ font-size: var(--mf-font-size-sm);
1418
+ color: var(--mf-text-muted);
1419
+ }
1420
+
1421
+ /* ========================================
1422
+ MODAL STYLES
1423
+ ======================================== */
1424
+ /* Modal backdrop */
1425
+ .magicfeedback-modal-backdrop {
1426
+ position: fixed;
1427
+ top: 0;
1428
+ left: 0;
1429
+ width: 100vw;
1430
+ height: 100vh;
1431
+ background: rgba(0,0,0,0.4);
1432
+ display: none; /* toggled to flex when open */
1433
+ align-items: center;
1434
+ justify-content: center;
1435
+ z-index: 9999;
1436
+ }
1437
+
1438
+ /* Modal container */
1439
+ .magicfeedback-modal {
1440
+ background: #fff;
1441
+ border-radius: 8px;
1442
+ box-shadow: 0 8px 24px rgba(0,0,0,0.2);
1443
+ max-width: 520px;
1444
+ width: 90%;
1445
+ max-height: 80vh;
1446
+ /* Flex column so the options list scrolls while the actions footer
1447
+ (counter + confirm button) stays pinned and always visible. */
1448
+ display: flex;
1449
+ flex-direction: column;
1450
+ overflow: hidden;
1451
+ padding: 16px;
1452
+ position: relative;
1453
+ /* Portalled to document.body (see renderPriorityList.ts) to escape the
1454
+ host page's overflow/z-index \u2014 so it never inherits
1455
+ .magicfeedback-container's neutral text color and instead inherits
1456
+ whatever color the host page's own <body> happens to set. Needs its
1457
+ own explicit baseline rather than relying on that inheritance. */
1458
+ color: var(--mf-text-primary);
1459
+ }
1460
+
1461
+ /* Modal actions */
1462
+ .magicfeedback-modal-actions {
1463
+ display: flex;
1464
+ justify-content: flex-end;
1465
+ gap: 8px;
1466
+ margin-top: 12px;
1467
+ flex-shrink: 0;
1468
+ }
1469
+
1470
+ .magicfeedback-modal-counter {
1471
+ margin-right: auto;
1472
+ display: flex;
1473
+ align-items: center;
1474
+ font-size: 14px;
1475
+ color: var(--mf-text-secondary);
1476
+ }
1477
+
1478
+ /* Modal list */
1479
+ .magicfeedback-modal-list {
1480
+ display: flex;
1481
+ flex-direction: column;
1482
+ gap: 8px;
1483
+ /* Scrollable area; footer stays fixed below it. */
1484
+ flex: 1 1 auto;
1485
+ overflow-y: auto;
1486
+ min-height: 0;
1487
+ }
1488
+
1489
+ .magicfeedback-modal-row {
1490
+ display: flex;
1491
+ align-items: center;
1492
+ gap: 10px;
1493
+ cursor: pointer;
1494
+ }
1495
+
1496
+ /* Priority list header */
1497
+ .magicfeedback-priority-list-header {
1498
+ display: flex;
1499
+ align-items: center;
1500
+ justify-content: space-between;
1501
+ gap: 12px;
1502
+ margin-bottom: 8px;
1503
+ }
1504
+
1505
+ .magicfeedback-priority-list-reorder {
1506
+ margin-top: 8px;
1507
+ }
1508
+
1509
+ .magicfeedback-priority-list-list {
1510
+ padding: 0;
1511
+ list-style: none;
1512
+ }
1513
+
1514
+ .magicfeedback-priority-list-item {
1515
+ display: flex;
1516
+ justify-content: space-between;
1517
+ align-items: center;
1518
+ margin: 5px 0;
1519
+ }
1520
+
1521
+ .magicfeedback-priority-list-item-label {
1522
+ font-size: 15px;
1523
+ }
1524
+
1525
+ .magicfeedback-priority-list-arrows {
1526
+ display: flex;
1527
+ align-items: center;
1528
+ gap: 6px;
1529
+ }
1530
+
1531
+ /* Buttons */
1532
+ .magicfeedback-button {
1533
+ appearance: none;
1534
+ border: 2px solid var(--mf-border);
1535
+ border-radius: var(--mf-radius-full);
1536
+ background: var(--mf-bg-secondary);
1537
+ color: var(--mf-text-primary);
1538
+ padding: 0.6rem 1rem;
1539
+ font-size: 14px;
1540
+ font-weight: 700;
1541
+ cursor: pointer;
1542
+ box-shadow: var(--mf-shadow-sm);
1543
+ }
1544
+
1545
+ .magicfeedback-button:hover {
1546
+ background: var(--mf-bg-hover);
1547
+ border-color: var(--mf-primary);
1548
+ }
1549
+
1550
+ .magicfeedback-button:active {
1551
+ transform: translateY(1px);
1552
+ }
1553
+
1554
+ .magicfeedback-button-primary {
1555
+ border-color: var(--mf-primary);
1556
+ background: var(--mf-primary);
1557
+ color: #fff;
1558
+ box-shadow: var(--mf-shadow-md);
1559
+ }
1560
+
1561
+ .magicfeedback-button-primary:hover {
1562
+ background: var(--mf-primary-hover);
1563
+ }
1564
+
1565
+ .magicfeedback-button-primary:active {
1566
+ background: var(--mf-primary-hover);
1567
+ }
1568
+
1569
+ /* Warning flash */
1570
+ .magicfeedback-warning {
1571
+ color: #C70039;
1572
+ }
1573
+
1574
+ /* Start message button */
1575
+ .magicfeedback-start-message-button {
1576
+ appearance: none;
1577
+ border: 2px solid var(--mf-primary);
1578
+ border-radius: var(--mf-radius-full);
1579
+ background: var(--mf-primary);
1580
+ color: #fff;
1581
+ padding: 0.8rem 1.4rem;
1582
+ font-size: 15px;
1583
+ font-weight: 800;
1584
+ cursor: pointer;
1585
+ box-shadow: var(--mf-shadow-md);
1586
+ }
1587
+
1588
+ .magicfeedback-start-message-button:hover {
1589
+ background: var(--mf-primary-hover);
1590
+ }
1591
+
1592
+ /* ========================================
1593
+ RESPONSIVE DESIGN
1594
+ ======================================== */
1595
+ @media (max-width: 768px) {
1596
+ :root {
1597
+ --mf-space-lg: 1.25rem;
1598
+ --mf-space-xl: 1.5rem;
1599
+ }
1600
+
1601
+ .magicfeedback-container {
1602
+ padding: 12px;
1603
+ border-radius: var(--mf-radius-md);
1604
+ }
1605
+
1606
+ .magicfeedback-form {
1607
+ padding: 14px;
1608
+ border-radius: var(--mf-radius-md);
1609
+ }
1610
+
1611
+ .magicfeedback-div {
1612
+ padding: 12px;
1613
+ gap: var(--mf-space-lg)
1614
+ }
1615
+
1616
+ .magicfeedback-label {
1617
+ font-size: var(--mf-font-size-base);
1618
+ }
1619
+
1620
+ .deepdots-popup input[type="date"],
1621
+ .deepdots-popup input[type="text"],
1622
+ .deepdots-popup input[type="number"],
1623
+ .deepdots-popup input[type="email"],
1624
+ .deepdots-popup input[type="password"],
1625
+ .deepdots-popup textarea,
1626
+ .deepdots-popup select {
1627
+ padding: 0.85rem 0.95rem;
1628
+ font-size: 1rem;
1629
+ min-height: 46px;
1630
+ }
1631
+
1632
+ /*
1633
+ .magicfeedback-radio-container,
1634
+ .magicfeedback-checkbox-container,
1635
+ .magicfeedback-boolean-container,
1636
+ .magicfeedback-consent-container {
1637
+ width: 100%;
1638
+ }
1639
+ */
1640
+
1641
+ .magicfeedback-radio-container,
1642
+ .magicfeedback-checkbox-container {
1643
+ padding: 10px 12px;
1644
+ border-radius: var(--mf-radius-md);
1645
+ border: 1px solid var(--mf-border);
1646
+ gap: 10px;
1647
+ }
1648
+
1649
+ .magicfeedback-rating-container,
1650
+ .magicfeedback-rating-number-container,
1651
+ .magicfeedback-rating-star-container {
1652
+ gap: 10px;
1653
+ }
1654
+
1655
+ .magicfeedback-boolean-container {
1656
+ flex-direction: column;
1657
+ gap: 10px;
1658
+ }
1659
+
1660
+ .magicfeedback-rating-number-container-row,
1661
+ .magicfeedback-rating-number-container-row-reverse {
1662
+ gap: 6px;
1663
+ }
1664
+
1665
+ .magicfeedback-rating-number-option-row .magicfeedback-rating-number-value,
1666
+ .magicfeedback-rating-number-option-row-reverse .magicfeedback-rating-number-value {
1667
+ min-height: 44px;
1668
+ padding: var(--mf-space-xs);
1669
+ font-size: 0.9rem;
1670
+ }
1671
+
1672
+ .magicfeedback-action-container {
1673
+ flex-direction: column-reverse;
1674
+ }
1675
+
1676
+ .magicfeedback-submit,
1677
+ .magicfeedback-back {
1678
+ width: 100%;
1679
+ text-align: center;
1680
+ min-height: 48px;
1681
+ }
1682
+ }
1683
+
1684
+ /* ========================================
1685
+ ACCESSIBILITY
1686
+ ======================================== */
1687
+ @media (prefers-reduced-motion: reduce) {
1688
+ *,
1689
+ *::before,
1690
+ *::after {
1691
+ animation-duration: 0.01ms !important;
1692
+ animation-iteration-count: 1 !important;
1693
+ transition-duration: 0.01ms !important;
1694
+ }
1695
+ }
1696
+
1697
+
1698
+ /* ========================================
1699
+ UTILITY CLASSES
1700
+ ======================================== */
1701
+ .magicfeedback-visually-hidden {
1702
+ position: absolute;
1703
+ width: 1px;
1704
+ height: 1px;
1705
+ padding: 0;
1706
+ margin: -1px;
1707
+ overflow: hidden;
1708
+ clip: rect(0, 0, 0, 0);
1709
+ white-space: nowrap;
1710
+ border-width: 0;
1711
+ }
1712
+
1713
+ .magicfeedback-modal-close {
1714
+ position: absolute;
1715
+ top: 8px;
1716
+ right: 8px;
1717
+ background: transparent;
1718
+ border: none;
1719
+ font-size: 20px;
1720
+ line-height: 1;
1721
+ cursor: pointer;
1722
+ color: #666;
1723
+ }
1724
+
1725
+ .magicfeedback-modal-close:hover,
1726
+ .magicfeedback-modal-close:focus {
1727
+ color: #000;
1728
+ outline: none;
1729
+ }
1730
+
1731
+ /* ========================================
1732
+ FILE / IMAGE UPLOAD
1733
+ ======================================== */
1734
+ .magicfeedback-upload {
1735
+ display: flex;
1736
+ flex-direction: column;
1737
+ gap: var(--mf-space-md);
1738
+ width: 100%;
1739
+ margin: 10px 0;
1740
+ }
1741
+
1742
+ /* The native input is an invisible, focusable overlay covering the dropzone. */
1743
+ .magicfeedback-upload-native {
1744
+ position: absolute;
1745
+ inset: 0;
1746
+ width: 100%;
1747
+ height: 100%;
1748
+ margin: 0;
1749
+ padding: 0;
1750
+ opacity: 0;
1751
+ cursor: pointer;
1752
+ z-index: 2;
1753
+ }
1754
+
1755
+ .magicfeedback-upload-dropzone {
1756
+ position: relative;
1757
+ display: flex;
1758
+ flex-direction: column;
1759
+ align-items: center;
1760
+ justify-content: center;
1761
+ gap: var(--mf-space-sm);
1762
+ box-sizing: border-box;
1763
+ width: 100%;
1764
+ min-height: 150px;
1765
+ padding: var(--mf-space-xl);
1766
+ text-align: center;
1767
+ border: 2px dashed var(--mf-border);
1768
+ border-radius: var(--mf-radius-md);
1769
+ background-color: var(--mf-surface-alt);
1770
+ cursor: pointer;
1771
+ transition: var(--mf-transition);
1772
+ }
1773
+
1774
+ .magicfeedback-upload-dropzone:hover {
1775
+ border-color: var(--mf-primary);
1776
+ background-color: var(--mf-bg-hover);
1777
+ }
1778
+
1779
+ .magicfeedback-upload-dropzone:focus-within {
1780
+ border-color: var(--mf-primary);
1781
+ box-shadow: var(--mf-shadow-focus);
1782
+ }
1783
+
1784
+ .magicfeedback-upload-dropzone.is-dragover {
1785
+ border-color: var(--mf-primary);
1786
+ border-style: solid;
1787
+ background-color: var(--mf-primary-light);
1788
+ box-shadow: var(--mf-shadow-focus);
1789
+ }
1790
+
1791
+ .magicfeedback-upload-icon {
1792
+ display: inline-flex;
1793
+ align-items: center;
1794
+ justify-content: center;
1795
+ width: 46px;
1796
+ height: 46px;
1797
+ color: var(--mf-primary);
1798
+ background-color: var(--mf-surface);
1799
+ border-radius: var(--mf-radius-full);
1800
+ box-shadow: var(--mf-shadow-sm);
1801
+ pointer-events: none;
1802
+ }
1803
+
1804
+ .magicfeedback-upload-icon svg {
1805
+ width: 24px;
1806
+ height: 24px;
1807
+ }
1808
+
1809
+ .magicfeedback-upload-cta {
1810
+ font-family: inherit;
1811
+ font-weight: var(--mf-font-weight-semibold);
1812
+ font-size: var(--mf-font-size-base);
1813
+ color: var(--mf-text-primary);
1814
+ pointer-events: none;
1815
+ }
1816
+
1817
+ .magicfeedback-upload-hint {
1818
+ font-family: inherit;
1819
+ font-size: var(--mf-font-size-sm);
1820
+ color: var(--mf-text-muted);
1821
+ pointer-events: none;
1822
+ }
1823
+
1824
+ .magicfeedback-upload-list {
1825
+ display: flex;
1826
+ flex-direction: column;
1827
+ gap: var(--mf-space-sm);
1828
+ width: 100%;
1829
+ margin: 0;
1830
+ padding: 0;
1831
+ list-style: none;
1832
+ }
1833
+
1834
+ .magicfeedback-upload-list:empty {
1835
+ display: none;
1836
+ }
1837
+
1838
+ .magicfeedback-upload-file-item {
1839
+ display: flex;
1840
+ align-items: center;
1841
+ gap: var(--mf-space-md);
1842
+ padding: var(--mf-space-sm) var(--mf-space-md);
1843
+ background-color: var(--mf-surface);
1844
+ border: 1px solid var(--mf-border);
1845
+ border-radius: var(--mf-radius-sm);
1846
+ box-shadow: var(--mf-shadow-sm);
1847
+ animation: mf-scale-in 0.2s ease-out;
1848
+ }
1849
+
1850
+ .magicfeedback-upload-thumb {
1851
+ flex: 0 0 auto;
1852
+ display: inline-flex;
1853
+ align-items: center;
1854
+ justify-content: center;
1855
+ width: 40px;
1856
+ height: 40px;
1857
+ overflow: hidden;
1858
+ color: var(--mf-text-secondary);
1859
+ background-color: var(--mf-surface-alt);
1860
+ border-radius: var(--mf-radius-sm);
1861
+ }
1862
+
1863
+ .magicfeedback-upload-thumb img {
1864
+ width: 100%;
1865
+ height: 100%;
1866
+ object-fit: cover;
1867
+ }
1868
+
1869
+ .magicfeedback-upload-thumb svg {
1870
+ width: 20px;
1871
+ height: 20px;
1872
+ }
1873
+
1874
+ .magicfeedback-upload-file-info {
1875
+ display: flex;
1876
+ flex-direction: column;
1877
+ flex: 1 1 auto;
1878
+ min-width: 0;
1879
+ text-align: start;
1880
+ }
1881
+
1882
+ .magicfeedback-upload-file-name {
1883
+ font-family: inherit;
1884
+ font-size: var(--mf-font-size-sm);
1885
+ font-weight: var(--mf-font-weight-semibold);
1886
+ color: var(--mf-text-primary);
1887
+ white-space: nowrap;
1888
+ overflow: hidden;
1889
+ text-overflow: ellipsis;
1890
+ }
1891
+
1892
+ .magicfeedback-upload-file-size {
1893
+ font-family: inherit;
1894
+ font-size: 0.75rem;
1895
+ color: var(--mf-text-muted);
1896
+ }
1897
+
1898
+ .magicfeedback-upload-remove {
1899
+ flex: 0 0 auto;
1900
+ display: inline-flex;
1901
+ align-items: center;
1902
+ justify-content: center;
1903
+ width: 30px;
1904
+ height: 30px;
1905
+ padding: 0;
1906
+ color: var(--mf-text-muted);
1907
+ background-color: transparent;
1908
+ border: none;
1909
+ border-radius: var(--mf-radius-full);
1910
+ cursor: pointer;
1911
+ transition: var(--mf-transition-fast);
1912
+ }
1913
+
1914
+ .magicfeedback-upload-remove:hover,
1915
+ .magicfeedback-upload-remove:focus-visible {
1916
+ color: var(--mf-error);
1917
+ background-color: var(--mf-primary-light);
1918
+ outline: none;
1919
+ }
1920
+
1921
+ .magicfeedback-upload-remove svg {
1922
+ width: 16px;
1923
+ height: 16px;
1924
+ }
1925
+
1926
+ .magicfeedback-upload-error {
1927
+ display: none;
1928
+ font-family: inherit;
1929
+ font-size: var(--mf-font-size-sm);
1930
+ color: var(--mf-error);
1931
+ }
1932
+
1933
+ .magicfeedback-upload-error.is-visible {
1934
+ display: block;
1935
+ }
1936
+
1937
+ /* ========================================
1938
+ LOCAL \u2014 reglas del popup, no vienen del paquete
1939
+ ======================================== */
1940
+
1941
+ /* Los controles de formulario no heredan font-family: cuando el popup trae fuente propia
1942
+ (clase deepdots-has-font), se les fuerza la del contenedor. */
1943
+ .deepdots-popup.deepdots-has-font button,
1944
+ .deepdots-popup.deepdots-has-font input,
1945
+ .deepdots-popup.deepdots-has-font textarea,
1946
+ .deepdots-popup.deepdots-has-font select {
1947
+ font-family: var(--deepdots-font, inherit);
1948
+ }
1949
+
1950
+ /* WebKit s\xED aplica el padding al radio nativo: con padding el control se dibuja enorme (se vio
1951
+ en iOS, WebView de RN y Safari, no en Chrome). El paquete ya no lo pone, pero la regla es
1952
+ barata y evita que vuelva. */
1953
+ .deepdots-popup input[type="radio"] {
1954
+ padding: 0;
1955
+ }
1956
+ `;
189
1957
  }
190
1958
  });
191
1959
 
@@ -210,6 +1978,47 @@ var init_logger = __esm({
210
1978
  }
211
1979
  });
212
1980
 
1981
+ // src/ui/logo.ts
1982
+ function insertPopupLogo(parent, anchor, style, id) {
1983
+ if (!style?.logo) return null;
1984
+ if (parent.ownerDocument.getElementById(id)) return null;
1985
+ const img = parent.ownerDocument.createElement("img");
1986
+ img.id = id;
1987
+ img.src = style.logo;
1988
+ img.alt = "Logo";
1989
+ img.style.cssText = BASE_CSS;
1990
+ if (style.logoSize && MAX_HEIGHT[style.logoSize]) {
1991
+ img.style.maxHeight = MAX_HEIGHT[style.logoSize];
1992
+ }
1993
+ switch (style.logoPosition) {
1994
+ case "left":
1995
+ img.style.margin = "12px 16px 0 0";
1996
+ img.style.marginLeft = "0";
1997
+ break;
1998
+ case "right":
1999
+ img.style.margin = "12px 0 0 16px";
2000
+ img.style.marginLeft = "auto";
2001
+ break;
2002
+ case "center":
2003
+ img.style.margin = "12px auto 0 auto";
2004
+ break;
2005
+ }
2006
+ parent.insertBefore(img, anchor);
2007
+ return img;
2008
+ }
2009
+ var BASE_CSS, MAX_HEIGHT;
2010
+ var init_logo = __esm({
2011
+ "src/ui/logo.ts"() {
2012
+ "use strict";
2013
+ BASE_CSS = "max-height:40px; max-width:100%; object-fit:contain; display:block; margin:12px 0 0 0;";
2014
+ MAX_HEIGHT = {
2015
+ small: "30px",
2016
+ medium: "50px",
2017
+ large: "70px"
2018
+ };
2019
+ }
2020
+ });
2021
+
213
2022
  // node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js
214
2023
  var require_magicfeedback_sdk_browser = __commonJS({
215
2024
  "node_modules/@magicfeedback/native/dist/magicfeedback-sdk.browser.js"(exports, module2) {
@@ -217,7 +2026,7 @@ var require_magicfeedback_sdk_browser = __commonJS({
217
2026
  !(function(e, t) {
218
2027
  "object" == typeof exports && "object" == typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.magicfeedback = t() : e.magicfeedback = t();
219
2028
  })(self, (() => {
220
- return e = { 945: function(e2, t2) {
2029
+ return e = { 326: function(e2, t2) {
221
2030
  var i = "undefined" != typeof self ? self : this, n = (function() {
222
2031
  function e3() {
223
2032
  this.fetch = false, this.DOMException = i.DOMException;
@@ -232,9 +2041,9 @@ var require_magicfeedback_sdk_browser = __commonJS({
232
2041
  } catch (e4) {
233
2042
  return false;
234
2043
  }
235
- })(), s = "FormData" in e3, a = "ArrayBuffer" in e3;
236
- if (a) var o = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], l = ArrayBuffer.isView || function(e4) {
237
- return e4 && o.indexOf(Object.prototype.toString.call(e4)) > -1;
2044
+ })(), s = "FormData" in e3, o = "ArrayBuffer" in e3;
2045
+ if (o) var a = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"], l = ArrayBuffer.isView || function(e4) {
2046
+ return e4 && a.indexOf(Object.prototype.toString.call(e4)) > -1;
238
2047
  };
239
2048
  function d(e4) {
240
2049
  if ("string" != typeof e4 && (e4 = String(e4)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e4)) throw new TypeError("Invalid character in header field name");
@@ -261,11 +2070,11 @@ var require_magicfeedback_sdk_browser = __commonJS({
261
2070
  this.append(t4, e4[t4]);
262
2071
  }), this);
263
2072
  }
264
- function m(e4) {
2073
+ function h(e4) {
265
2074
  if (e4.bodyUsed) return Promise.reject(new TypeError("Already read"));
266
2075
  e4.bodyUsed = true;
267
2076
  }
268
- function h(e4) {
2077
+ function m(e4) {
269
2078
  return new Promise((function(t4, i3) {
270
2079
  e4.onload = function() {
271
2080
  t4(e4.result);
@@ -275,31 +2084,31 @@ var require_magicfeedback_sdk_browser = __commonJS({
275
2084
  }));
276
2085
  }
277
2086
  function f(e4) {
278
- var t4 = new FileReader(), i3 = h(t4);
2087
+ var t4 = new FileReader(), i3 = m(t4);
279
2088
  return t4.readAsArrayBuffer(e4), i3;
280
2089
  }
281
- function v(e4) {
2090
+ function g(e4) {
282
2091
  if (e4.slice) return e4.slice(0);
283
2092
  var t4 = new Uint8Array(e4.byteLength);
284
2093
  return t4.set(new Uint8Array(e4)), t4.buffer;
285
2094
  }
286
- function g() {
2095
+ function v() {
287
2096
  return this.bodyUsed = false, this._initBody = function(e4) {
288
2097
  var t4;
289
- this._bodyInit = e4, e4 ? "string" == typeof e4 ? this._bodyText = e4 : r2 && Blob.prototype.isPrototypeOf(e4) ? this._bodyBlob = e4 : s && FormData.prototype.isPrototypeOf(e4) ? this._bodyFormData = e4 : i2 && URLSearchParams.prototype.isPrototypeOf(e4) ? this._bodyText = e4.toString() : a && r2 && (t4 = e4) && DataView.prototype.isPrototypeOf(t4) ? (this._bodyArrayBuffer = v(e4.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a && (ArrayBuffer.prototype.isPrototypeOf(e4) || l(e4)) ? this._bodyArrayBuffer = v(e4) : this._bodyText = e4 = Object.prototype.toString.call(e4) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e4 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : i2 && URLSearchParams.prototype.isPrototypeOf(e4) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2098
+ this._bodyInit = e4, e4 ? "string" == typeof e4 ? this._bodyText = e4 : r2 && Blob.prototype.isPrototypeOf(e4) ? this._bodyBlob = e4 : s && FormData.prototype.isPrototypeOf(e4) ? this._bodyFormData = e4 : i2 && URLSearchParams.prototype.isPrototypeOf(e4) ? this._bodyText = e4.toString() : o && r2 && (t4 = e4) && DataView.prototype.isPrototypeOf(t4) ? (this._bodyArrayBuffer = g(e4.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : o && (ArrayBuffer.prototype.isPrototypeOf(e4) || l(e4)) ? this._bodyArrayBuffer = g(e4) : this._bodyText = e4 = Object.prototype.toString.call(e4) : this._bodyText = "", this.headers.get("content-type") || ("string" == typeof e4 ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : i2 && URLSearchParams.prototype.isPrototypeOf(e4) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
290
2099
  }, r2 && (this.blob = function() {
291
- var e4 = m(this);
2100
+ var e4 = h(this);
292
2101
  if (e4) return e4;
293
2102
  if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
294
2103
  if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
295
2104
  if (this._bodyFormData) throw new Error("could not read FormData body as blob");
296
2105
  return Promise.resolve(new Blob([this._bodyText]));
297
2106
  }, this.arrayBuffer = function() {
298
- return this._bodyArrayBuffer ? m(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(f);
2107
+ return this._bodyArrayBuffer ? h(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(f);
299
2108
  }), this.text = function() {
300
- var e4, t4, i3, n3 = m(this);
2109
+ var e4, t4, i3, n3 = h(this);
301
2110
  if (n3) return n3;
302
- if (this._bodyBlob) return e4 = this._bodyBlob, i3 = h(t4 = new FileReader()), t4.readAsText(e4), i3;
2111
+ if (this._bodyBlob) return e4 = this._bodyBlob, i3 = m(t4 = new FileReader()), t4.readAsText(e4), i3;
303
2112
  if (this._bodyArrayBuffer) return Promise.resolve((function(e5) {
304
2113
  for (var t5 = new Uint8Array(e5), i4 = new Array(t5.length), n4 = 0; n4 < t5.length; n4++) i4[n4] = String.fromCharCode(t5[n4]);
305
2114
  return i4.join("");
@@ -361,21 +2170,21 @@ var require_magicfeedback_sdk_browser = __commonJS({
361
2170
  }
362
2171
  })), t4;
363
2172
  }
364
- function k(e4, t4) {
2173
+ function A(e4, t4) {
365
2174
  t4 || (t4 = {}), this.type = "default", this.status = void 0 === t4.status ? 200 : t4.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in t4 ? t4.statusText : "OK", this.headers = new p(t4.headers), this.url = t4.url || "", this._initBody(e4);
366
2175
  }
367
2176
  b.prototype.clone = function() {
368
2177
  return new b(this, { body: this._bodyInit });
369
- }, g.call(b.prototype), g.call(k.prototype), k.prototype.clone = function() {
370
- return new k(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new p(this.headers), url: this.url });
371
- }, k.error = function() {
372
- var e4 = new k(null, { status: 0, statusText: "" });
2178
+ }, v.call(b.prototype), v.call(A.prototype), A.prototype.clone = function() {
2179
+ return new A(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new p(this.headers), url: this.url });
2180
+ }, A.error = function() {
2181
+ var e4 = new A(null, { status: 0, statusText: "" });
373
2182
  return e4.type = "error", e4;
374
2183
  };
375
- var A = [301, 302, 303, 307, 308];
376
- k.redirect = function(e4, t4) {
377
- if (-1 === A.indexOf(t4)) throw new RangeError("Invalid status code");
378
- return new k(null, { status: t4, headers: { location: e4 } });
2184
+ var k = [301, 302, 303, 307, 308];
2185
+ A.redirect = function(e4, t4) {
2186
+ if (-1 === k.indexOf(t4)) throw new RangeError("Invalid status code");
2187
+ return new A(null, { status: t4, headers: { location: e4 } });
379
2188
  }, t3.DOMException = e3.DOMException;
380
2189
  try {
381
2190
  new t3.DOMException();
@@ -388,37 +2197,37 @@ var require_magicfeedback_sdk_browser = __commonJS({
388
2197
  }
389
2198
  function C(e4, i3) {
390
2199
  return new Promise((function(n3, s2) {
391
- var a2 = new b(e4, i3);
392
- if (a2.signal && a2.signal.aborted) return s2(new t3.DOMException("Aborted", "AbortError"));
393
- var o2 = new XMLHttpRequest();
2200
+ var o2 = new b(e4, i3);
2201
+ if (o2.signal && o2.signal.aborted) return s2(new t3.DOMException("Aborted", "AbortError"));
2202
+ var a2 = new XMLHttpRequest();
394
2203
  function l2() {
395
- o2.abort();
2204
+ a2.abort();
396
2205
  }
397
- o2.onload = function() {
398
- var e5, t4, i4 = { status: o2.status, statusText: o2.statusText, headers: (e5 = o2.getAllResponseHeaders() || "", t4 = new p(), e5.replace(/\r?\n[\t ]+/g, " ").split(/\r?\n/).forEach((function(e6) {
2206
+ a2.onload = function() {
2207
+ var e5, t4, i4 = { status: a2.status, statusText: a2.statusText, headers: (e5 = a2.getAllResponseHeaders() || "", t4 = new p(), e5.replace(/\r?\n[\t ]+/g, " ").split(/\r?\n/).forEach((function(e6) {
399
2208
  var i5 = e6.split(":"), n4 = i5.shift().trim();
400
2209
  if (n4) {
401
2210
  var r4 = i5.join(":").trim();
402
2211
  t4.append(n4, r4);
403
2212
  }
404
2213
  })), t4) };
405
- i4.url = "responseURL" in o2 ? o2.responseURL : i4.headers.get("X-Request-URL");
406
- var r3 = "response" in o2 ? o2.response : o2.responseText;
407
- n3(new k(r3, i4));
408
- }, o2.onerror = function() {
2214
+ i4.url = "responseURL" in a2 ? a2.responseURL : i4.headers.get("X-Request-URL");
2215
+ var r3 = "response" in a2 ? a2.response : a2.responseText;
2216
+ n3(new A(r3, i4));
2217
+ }, a2.onerror = function() {
409
2218
  s2(new TypeError("Network request failed"));
410
- }, o2.ontimeout = function() {
2219
+ }, a2.ontimeout = function() {
411
2220
  s2(new TypeError("Network request failed"));
412
- }, o2.onabort = function() {
2221
+ }, a2.onabort = function() {
413
2222
  s2(new t3.DOMException("Aborted", "AbortError"));
414
- }, o2.open(a2.method, a2.url, true), "include" === a2.credentials ? o2.withCredentials = true : "omit" === a2.credentials && (o2.withCredentials = false), "responseType" in o2 && r2 && (o2.responseType = "blob"), a2.headers.forEach((function(e5, t4) {
415
- o2.setRequestHeader(t4, e5);
416
- })), a2.signal && (a2.signal.addEventListener("abort", l2), o2.onreadystatechange = function() {
417
- 4 === o2.readyState && a2.signal.removeEventListener("abort", l2);
418
- }), o2.send(void 0 === a2._bodyInit ? null : a2._bodyInit);
2223
+ }, a2.open(o2.method, o2.url, true), "include" === o2.credentials ? a2.withCredentials = true : "omit" === o2.credentials && (a2.withCredentials = false), "responseType" in a2 && r2 && (a2.responseType = "blob"), o2.headers.forEach((function(e5, t4) {
2224
+ a2.setRequestHeader(t4, e5);
2225
+ })), o2.signal && (o2.signal.addEventListener("abort", l2), a2.onreadystatechange = function() {
2226
+ 4 === a2.readyState && o2.signal.removeEventListener("abort", l2);
2227
+ }), a2.send(void 0 === o2._bodyInit ? null : o2._bodyInit);
419
2228
  }));
420
2229
  }
421
- C.polyfill = true, e3.fetch || (e3.fetch = C, e3.Headers = p, e3.Request = b, e3.Response = k), t3.Headers = p, t3.Request = b, t3.Response = k, t3.fetch = C, Object.defineProperty(t3, "__esModule", { value: true });
2230
+ C.polyfill = true, e3.fetch || (e3.fetch = C, e3.Headers = p, e3.Request = b, e3.Response = A), t3.Headers = p, t3.Request = b, t3.Response = A, t3.fetch = C, Object.defineProperty(t3, "__esModule", { value: true });
422
2231
  })({});
423
2232
  })(n), n.fetch.ponyfill = true, delete n.fetch.polyfill;
424
2233
  var r = n;
@@ -439,14 +2248,14 @@ var require_magicfeedback_sdk_browser = __commonJS({
439
2248
  "use strict";
440
2249
  var n = this && this.__awaiter || function(e3, t3, i2, n2) {
441
2250
  return new (i2 || (i2 = Promise))((function(r2, s2) {
442
- function a2(e4) {
2251
+ function o2(e4) {
443
2252
  try {
444
2253
  l2(n2.next(e4));
445
2254
  } catch (e5) {
446
2255
  s2(e5);
447
2256
  }
448
2257
  }
449
- function o2(e4) {
2258
+ function a2(e4) {
450
2259
  try {
451
2260
  l2(n2.throw(e4));
452
2261
  } catch (e5) {
@@ -457,34 +2266,42 @@ var require_magicfeedback_sdk_browser = __commonJS({
457
2266
  var t4;
458
2267
  e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
459
2268
  e5(t4);
460
- }))).then(a2, o2);
2269
+ }))).then(o2, a2);
461
2270
  }
462
2271
  l2((n2 = n2.apply(e3, t3 || [])).next());
463
2272
  }));
464
2273
  };
465
2274
  Object.defineProperty(t2, "__esModule", { value: true });
466
- const r = i(57), s = i(665), a = i(256), o = i(313), l = i(317);
2275
+ const r = i(57), s = i(544), o = i(665), a = i(256), l = i(313), d = i(317);
467
2276
  t2.default = function() {
468
- const e3 = new s.Config();
2277
+ const e3 = new o.Config();
469
2278
  let t3 = new a.Log(e3);
470
2279
  return { init: function(i2) {
471
- "boolean" == typeof (null == i2 ? void 0 : i2.debug) && e3.set("debug", i2.debug), "boolean" == typeof (null == i2 ? void 0 : i2.dryRun) && e3.set("dryRun", i2.dryRun), e3.set("url", (null == i2 ? void 0 : i2.env) && "dev" === (null == i2 ? void 0 : i2.env) ? l.HOST_API_URL_DEV : l.HOST_API_URL), e3.set("env", null == i2 ? void 0 : i2.env), t3.log("Initialized Magicfeedback", e3);
472
- }, send: function(i2, r2, s2, a2 = true, l2, d) {
2280
+ "boolean" == typeof (null == i2 ? void 0 : i2.debug) && e3.set("debug", i2.debug), "boolean" == typeof (null == i2 ? void 0 : i2.dryRun) && e3.set("dryRun", i2.dryRun), e3.set("url", (null == i2 ? void 0 : i2.env) && "dev" === (null == i2 ? void 0 : i2.env) ? d.HOST_API_URL_DEV : d.HOST_API_URL), e3.set("env", null == i2 ? void 0 : i2.env), t3.log("Initialized Magicfeedback", e3);
2281
+ }, send: function(i2, r2, s2, o2 = true, a2, d2) {
473
2282
  return n(this, void 0, void 0, (function* () {
474
2283
  i2 || t3.err("No appID provided"), r2 || t3.err("No publicKey provided"), s2 || t3.err("No feedback provided"), s2.answers || s2.profile || s2.metrics || s2.metadata || t3.err("No feedback data provided");
475
- const n2 = e3.get("url"), c = { integration: i2, publicKey: r2, privateKey: d, completed: a2, id: l2, feedback: s2 };
2284
+ const n2 = e3.get("url"), c = { integration: i2, publicKey: r2, privateKey: d2, completed: o2, id: a2, feedback: s2 };
476
2285
  try {
477
2286
  if (e3.get("dryRun")) return t3.log("Dry run enabled: skipping native feedback submit"), `dry-run-${Date.now()}`;
478
- const i3 = yield (0, o.sendFeedback)(n2, c, t3);
2287
+ const i3 = yield (0, l.sendFeedback)(n2, c, t3);
479
2288
  return t3.log("sent native feedback"), i3;
480
2289
  } catch (e4) {
481
2290
  return t3.err("error native feedback", e4), false;
482
2291
  }
483
2292
  }));
484
- }, form: function(i2, n2, s2, a2) {
485
- return i2 || t3.err("No appID provided"), n2 || t3.err("No publicKey provided"), new r.Form(e3, i2, n2, s2, a2);
2293
+ }, form: function(i2, n2, s2, o2) {
2294
+ return i2 || t3.err("No appID provided"), n2 || t3.err("No publicKey provided"), new r.Form(e3, i2, n2, s2, o2);
2295
+ }, agentForm: function(i2, n2, r2) {
2296
+ return i2 || t3.err("No integrationId provided"), n2 || t3.err("No publicKey provided"), new s.AgentForm(e3, i2, n2, r2);
486
2297
  }, session: function(i2) {
487
2298
  return i2 || t3.err("No sessionId provided"), new r.Form(e3, i2);
2299
+ }, previewPage: function(i2, s2, o2) {
2300
+ return n(this, void 0, void 0, (function* () {
2301
+ i2 || t3.err("No selector provided"), s2 && s2.page || t3.err("No page provided for preview");
2302
+ const n2 = (null == s2 ? void 0 : s2.appId) || `preview-${Date.now()}`, a2 = new r.Form(e3, n2);
2303
+ return yield a2.previewPage(i2, s2, o2), a2;
2304
+ }));
488
2305
  } };
489
2306
  };
490
2307
  }, 79: (e2, t2) => {
@@ -493,29 +2310,266 @@ var require_magicfeedback_sdk_browser = __commonJS({
493
2310
  constructor() {
494
2311
  this.items = [];
495
2312
  }
496
- enqueue(e3) {
497
- this.items.push(e3);
2313
+ enqueue(e3) {
2314
+ this.items.push(e3);
2315
+ }
2316
+ dequeue() {
2317
+ return this.items.shift();
2318
+ }
2319
+ rollback() {
2320
+ return this.items.pop();
2321
+ }
2322
+ front() {
2323
+ return this.items[0];
2324
+ }
2325
+ back() {
2326
+ return this.items[this.items.length - 1];
2327
+ }
2328
+ isEmpty() {
2329
+ return 0 === this.items.length;
2330
+ }
2331
+ size() {
2332
+ return this.items.length;
2333
+ }
2334
+ get(e3) {
2335
+ return this.items[e3];
2336
+ }
2337
+ };
2338
+ }, 544: function(e2, t2, i) {
2339
+ "use strict";
2340
+ var n = this && this.__awaiter || function(e3, t3, i2, n2) {
2341
+ return new (i2 || (i2 = Promise))((function(r2, s2) {
2342
+ function o2(e4) {
2343
+ try {
2344
+ l2(n2.next(e4));
2345
+ } catch (e5) {
2346
+ s2(e5);
2347
+ }
2348
+ }
2349
+ function a2(e4) {
2350
+ try {
2351
+ l2(n2.throw(e4));
2352
+ } catch (e5) {
2353
+ s2(e5);
2354
+ }
2355
+ }
2356
+ function l2(e4) {
2357
+ var t4;
2358
+ e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
2359
+ e5(t4);
2360
+ }))).then(o2, a2);
2361
+ }
2362
+ l2((n2 = n2.apply(e3, t3 || [])).next());
2363
+ }));
2364
+ };
2365
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.AgentForm = void 0;
2366
+ const r = i(256), s = i(279), o = i(945), a = i(177), l = i(107), d = i(565), c = i(571), u = i(213);
2367
+ t2.AgentForm = class {
2368
+ constructor(e3, t3, i2, n2) {
2369
+ this.config = e3, this.log = new r.Log(e3), this.url = e3.get("url"), this.integrationId = t3, this.publicKey = i2, this.privateKey = n2, this.formOptionsConfig = { addButton: true, sendButtonText: "Send", backButtonText: "Back", nextButtonText: "Next", addSuccessScreen: true, questionFormat: "standard", answerDelimiter: a.DEFAULT_ANSWER_DELIMITER, resume: true, allowBack: false, emptyAnswerText: "" }, this.selector = "", this.language = "en", this.product = { customIcons: false }, this.sessionId = "", this.conversation = [], this.askedRefs = [], this.currentTurn = 1, this.maxTurns = 0, this.currentQuestion = null, this.questionHistory = [], this.busy = false, this.rateLimitTimer = null, this.progress = 0, this.total = 0, this.completed = false, this.timeToCompleted = 0;
2370
+ }
2371
+ generate(e3, t3 = {}) {
2372
+ var i2;
2373
+ return n(this, void 0, void 0, (function* () {
2374
+ this.formOptionsConfig = Object.assign(Object.assign({}, this.formOptionsConfig), t3), this.selector = e3, t3.lang && (this.language = t3.lang), t3.primaryColor && (this.primaryColor = t3.primaryColor), this.config.get("dryRun") && this.log.log("dryRun has no effect in agent mode: the server drives the conversation");
2375
+ try {
2376
+ const e4 = false !== this.formOptionsConfig.resume ? this.restore() : null;
2377
+ if (e4) this.log.log(`Resuming agent session ${e4.sessionId} at turn ${e4.currentTurn}`), this.mountForm(), this.renderStep();
2378
+ else {
2379
+ const e5 = yield this.startWithRetry();
2380
+ this.sessionId = e5.sessionId, this.maxTurns = e5.maxTurns, this.currentTurn = null !== (i2 = e5.currentTurn) && void 0 !== i2 ? i2 : 1, this.total = Math.max(this.maxTurns - 1, 0);
2381
+ const t4 = (0, a.toAgentStep)(e5, this.adapterContext());
2382
+ if (this.mountForm(), "END" === t4.kind) return yield this.renderEnd(t4), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, progress: this.progress, total: this.total, sessionId: this.sessionId, completed: true })));
2383
+ this.acceptQuestion(t4), this.renderStep(), this.persist();
2384
+ }
2385
+ this.timeToCompleted = Date.now(), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, progress: this.progress, total: this.total, sessionId: this.sessionId, formOptionsConfig: this.formOptionsConfig }));
2386
+ } catch (e4) {
2387
+ this.log.err(`Could not start the agent survey ${this.integrationId}:`, e4), this.renderFatal(e4), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
2388
+ }
2389
+ }));
2390
+ }
2391
+ next() {
2392
+ return n(this, void 0, void 0, (function* () {
2393
+ return this.runTurn();
2394
+ }));
2395
+ }
2396
+ answer() {
2397
+ const e3 = document.getElementById(this.formId());
2398
+ return e3 ? (0, l.scrapeInputs)(e3) : [];
2399
+ }
2400
+ getConversation() {
2401
+ return [...this.conversation];
2402
+ }
2403
+ getSessionId() {
2404
+ return this.sessionId;
2405
+ }
2406
+ reset() {
2407
+ this.sessionId = "", this.conversation = [], this.askedRefs = [], this.currentTurn = 1, this.maxTurns = 0, this.currentQuestion = null, this.questionHistory = [], this.busy = false, this.completed = false, this.progress = 0, this.clearRateLimitTimer(), this.clearPersisted();
2408
+ }
2409
+ runTurn() {
2410
+ var e3;
2411
+ return n(this, void 0, void 0, (function* () {
2412
+ if (this.busy || this.completed || !this.currentQuestion) return;
2413
+ this.busy = true, this.setSubmitDisabled(true), this.clearError();
2414
+ const t3 = this.currentQuestion;
2415
+ try {
2416
+ const i2 = document.getElementById(this.formId()), n2 = document.getElementById(this.questionsId());
2417
+ if (!i2) throw new Error("Agent form not found");
2418
+ yield (0, c.awaitUploadReady)(n2);
2419
+ const r2 = (0, l.scrapeInputs)(i2);
2420
+ let s2 = (0, a.encodeAnswer)(r2, t3, this.formOptionsConfig.answerDelimiter);
2421
+ if ("" === s2) {
2422
+ if (t3.require) return void this.showError(this.formOptionsConfig.requiredMessage || "Please answer before continuing.");
2423
+ s2 = this.formOptionsConfig.emptyAnswerText || "";
2424
+ }
2425
+ this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
2426
+ const d2 = { role: "user", content: s2, questionType: t3.type, questionRef: t3.ref }, u2 = this.currentTurn + 1, p = yield (0, o.nextAgentTurn)(this.url, { publicKey: this.publicKey, privateKey: this.privateKey, integrationId: this.integrationId, sessionId: this.sessionId, conversation: [...this.conversation], currentTurn: u2, lastAnswer: s2, lastQuestionRef: t3.ref, askedRefs: [...this.askedRefs] }, this.log);
2427
+ this.conversation.push(d2), this.currentTurn = null !== (e3 = p.currentTurn) && void 0 !== e3 ? e3 : u2, p.maxTurns && (this.maxTurns = p.maxTurns), this.total = Math.max(this.maxTurns - 1, 0);
2428
+ const h = (0, a.toAgentStep)(p, this.adapterContext());
2429
+ if ("END" === h.kind) return void (yield this.renderEnd(h));
2430
+ if (this.maxTurns > 0 && this.currentTurn > this.maxTurns + 1) return void (yield this.renderEnd({ kind: "END", reason: "MAX_TURNS", currentTurn: this.currentTurn, maxTurns: this.maxTurns }));
2431
+ this.acceptQuestion(h), this.renderStep(), this.persist(), this.formOptionsConfig.onAgentTurnEvent && (yield this.formOptionsConfig.onAgentTurnEvent({ turn: this.currentTurn, maxTurns: this.maxTurns, question: h.question, isFromBase: h.isFromBase, topic: h.topic, coverageGaps: h.coverageGaps, coverageSummary: h.coverageSummary, conversation: this.getConversation() })), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.sessionId, loading: false, progress: this.progress, total: this.total, completed: false, error: null }));
2432
+ } catch (e4) {
2433
+ yield this.handleTurnError(e4);
2434
+ } finally {
2435
+ this.completed || (this.busy = false, this.rateLimitTimer || this.setSubmitDisabled(false));
2436
+ }
2437
+ }));
2438
+ }
2439
+ handleTurnError(e3) {
2440
+ return n(this, void 0, void 0, (function* () {
2441
+ this.log.err(`An error occurred during the agent turn ${this.integrationId}:`, e3), e3 instanceof s.AgentApiError && "RATE_LIMITED" === e3.kind ? this.startRateLimitCountdown(e3.retryAfterMs || 6e4) : this.showError(this.errorMessageFor(e3)), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total, completed: false, error: e3 }));
2442
+ }));
2443
+ }
2444
+ acceptQuestion(e3) {
2445
+ const t3 = e3.question;
2446
+ e3.isFromBase && t3.ref && !this.askedRefs.includes(t3.ref) && this.askedRefs.push(t3.ref), this.conversation.push({ role: "agent", content: t3.title, questionType: t3.type, questionRef: t3.ref }), this.currentQuestion = t3, this.questionHistory.push(t3), this.progress = Math.max(this.currentTurn - 1, 0);
2447
+ }
2448
+ formId() {
2449
+ return "magicfeedback-agent-" + this.integrationId;
2450
+ }
2451
+ questionsId() {
2452
+ return "magicfeedback-agent-questions-" + this.integrationId;
2453
+ }
2454
+ mountForm() {
2455
+ const e3 = (0, d.generateContainer)(this.selector, this.integrationId);
2456
+ this.primaryColor && (0, d.applyPrimaryColor)(e3, this.primaryColor);
2457
+ const t3 = document.createElement("form");
2458
+ t3.classList.add("magicfeedback-form"), t3.classList.add("magicfeedback-agent-form"), t3.id = this.formId(), t3.addEventListener("submit", ((e4) => {
2459
+ e4.preventDefault(), this.runTurn();
2460
+ }));
2461
+ const i2 = document.createElement("div");
2462
+ i2.classList.add("magicfeedback-questions"), i2.id = this.questionsId(), t3.appendChild(i2), this.formOptionsConfig.addButton && t3.appendChild((0, u.renderActions)(this.formOptionsConfig.allowBack ? "MAGICSURVEY" : "MAGICFORM", (() => this.back()), this.formOptionsConfig.sendButtonText, this.formOptionsConfig.backButtonText, this.formOptionsConfig.nextButtonText)), e3.appendChild(t3);
2463
+ }
2464
+ renderStep() {
2465
+ const e3 = document.getElementById(this.questionsId());
2466
+ e3 && this.currentQuestion && (e3.innerHTML = "", (0, u.renderQuestions)([this.currentQuestion], this.formOptionsConfig.questionFormat, this.language, this.product, (() => this.runTurn())).forEach(((t3) => e3.appendChild(t3))));
2467
+ }
2468
+ renderEnd(e3) {
2469
+ return n(this, void 0, void 0, (function* () {
2470
+ this.completed = true, this.currentQuestion = null, this.busy = false, this.timeToCompleted = this.timeToCompleted ? Date.now() - this.timeToCompleted : 0, this.clearRateLimitTimer(), this.clearPersisted();
2471
+ const t3 = document.getElementById("magicfeedback-container-" + this.integrationId);
2472
+ if (t3 && false !== this.formOptionsConfig.addSuccessScreen) {
2473
+ t3.innerHTML = "";
2474
+ const i2 = "BLOCKED" === e3.reason ? this.formOptionsConfig.blockedMessage || "Thanks for your time \u2014 we'll end the conversation here." : this.formOptionsConfig.successMessage || "Thank you for your feedback!", n2 = (0, u.renderSuccess)(i2);
2475
+ n2.classList.add("magicfeedback-success-message"), n2.classList.add("magicfeedback-agent-end"), "BLOCKED" === e3.reason && n2.classList.add("magicfeedback-agent-end--blocked"), t3.appendChild(n2);
2476
+ }
2477
+ this.formOptionsConfig.onFinishEvent && (yield this.formOptionsConfig.onFinishEvent({ sessionId: this.sessionId, reason: e3.reason, turns: this.currentTurn, maxTurns: this.maxTurns, conversation: this.getConversation(), coverageSummary: e3.coverageSummary, timeToCompleted: this.timeToCompleted })), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.sessionId, loading: false, progress: this.progress, total: this.total, completed: true, error: null }));
2478
+ }));
2479
+ }
2480
+ back() {
2481
+ return n(this, void 0, void 0, (function* () {
2482
+ this.busy || this.completed || this.formOptionsConfig.allowBack && (this.questionHistory.length < 2 || (this.questionHistory.pop(), this.conversation.pop(), this.conversation.pop(), this.currentQuestion = this.questionHistory[this.questionHistory.length - 1], this.currentTurn = Math.max(this.currentTurn - 1, 1), this.progress = Math.max(this.currentTurn - 1, 0), this.clearError(), this.renderStep(), this.persist(), this.formOptionsConfig.onBackEvent && (yield this.formOptionsConfig.onBackEvent({ progress: this.progress, total: this.total }))));
2483
+ }));
2484
+ }
2485
+ renderFatal(e3) {
2486
+ try {
2487
+ (0, d.generateContainer)(this.selector, this.integrationId).appendChild((0, u.renderError)(this.errorMessageFor(e3)));
2488
+ } catch (e4) {
2489
+ }
2490
+ }
2491
+ errorMessageFor(e3) {
2492
+ if (!(e3 instanceof s.AgentApiError)) return "Something went wrong. Please try again.";
2493
+ switch (e3.kind) {
2494
+ case "AUTH":
2495
+ case "NOT_FOUND":
2496
+ case "BAD_CONFIG":
2497
+ return "This survey is not available right now.";
2498
+ case "AI_UNAVAILABLE":
2499
+ return "We couldn't start the survey. Please try again in a moment.";
2500
+ default:
2501
+ return "Something went wrong. Please try again.";
2502
+ }
2503
+ }
2504
+ adapterContext() {
2505
+ return { integrationId: this.integrationId, sessionId: this.sessionId, language: this.language, log: this.log };
498
2506
  }
499
- dequeue() {
500
- return this.items.shift();
2507
+ startWithRetry() {
2508
+ return n(this, void 0, void 0, (function* () {
2509
+ const e3 = { publicKey: this.publicKey, privateKey: this.privateKey, integrationId: this.integrationId };
2510
+ try {
2511
+ return yield (0, o.startAgentSurvey)(this.url, e3, this.log);
2512
+ } catch (t3) {
2513
+ if (t3 instanceof s.AgentApiError && "AI_UNAVAILABLE" === t3.kind) return this.log.log("Retrying /start after a transient AI failure"), yield new Promise(((e4) => setTimeout(e4, 1500))), yield (0, o.startAgentSurvey)(this.url, e3, this.log);
2514
+ throw t3;
2515
+ }
2516
+ }));
501
2517
  }
502
- rollback() {
503
- return this.items.pop();
2518
+ setSubmitDisabled(e3) {
2519
+ const t3 = document.getElementById("magicfeedback-submit");
2520
+ t3 && (t3.disabled = e3);
504
2521
  }
505
- front() {
506
- return this.items[0];
2522
+ clearError() {
2523
+ const e3 = document.getElementById(this.questionsId());
2524
+ null == e3 || e3.querySelectorAll(".magicfeedback-error").forEach(((e4) => e4.remove()));
507
2525
  }
508
- back() {
509
- return this.items[this.items.length - 1];
2526
+ showError(e3) {
2527
+ const t3 = document.getElementById(this.questionsId());
2528
+ t3 && (this.clearError(), t3.insertBefore((0, u.renderError)(e3), t3.firstChild));
510
2529
  }
511
- isEmpty() {
512
- return 0 === this.items.length;
2530
+ startRateLimitCountdown(e3) {
2531
+ this.clearRateLimitTimer(), this.setSubmitDisabled(true);
2532
+ let t3 = Math.ceil(e3 / 1e3);
2533
+ const i2 = this.formOptionsConfig.rateLimitMessage || "Too many requests. Retrying in {seconds}s\u2026", n2 = () => {
2534
+ if (t3 <= 0) return this.clearRateLimitTimer(), this.clearError(), void this.setSubmitDisabled(false);
2535
+ this.showError(i2.replace("{seconds}", String(t3))), t3 -= 1;
2536
+ };
2537
+ n2(), this.rateLimitTimer = setInterval(n2, 1e3);
513
2538
  }
514
- size() {
515
- return this.items.length;
2539
+ clearRateLimitTimer() {
2540
+ this.rateLimitTimer && (clearInterval(this.rateLimitTimer), this.rateLimitTimer = null);
516
2541
  }
517
- get(e3) {
518
- return this.items[e3];
2542
+ storageKey() {
2543
+ return `magicfeedback-agent-${this.integrationId}`;
2544
+ }
2545
+ persist() {
2546
+ if (false !== this.formOptionsConfig.resume) try {
2547
+ const e3 = { sessionId: this.sessionId, conversation: this.conversation, currentTurn: this.currentTurn, maxTurns: this.maxTurns, askedRefs: this.askedRefs, questionHistory: this.questionHistory, savedAt: Date.now() };
2548
+ localStorage.setItem(this.storageKey(), JSON.stringify(e3));
2549
+ } catch (e3) {
2550
+ this.log.log("Could not persist the agent session", e3);
2551
+ }
2552
+ }
2553
+ restore() {
2554
+ var e3;
2555
+ try {
2556
+ const t3 = localStorage.getItem(this.storageKey());
2557
+ if (!t3) return null;
2558
+ const i2 = JSON.parse(t3);
2559
+ return (null == i2 ? void 0 : i2.sessionId) && (null === (e3 = i2.questionHistory) || void 0 === e3 ? void 0 : e3.length) ? Date.now() - (i2.savedAt || 0) > 18e5 ? (this.clearPersisted(), null) : (this.sessionId = i2.sessionId, this.conversation = i2.conversation || [], this.currentTurn = i2.currentTurn || 1, this.maxTurns = i2.maxTurns || 0, this.askedRefs = i2.askedRefs || [], this.questionHistory = i2.questionHistory, this.currentQuestion = this.questionHistory[this.questionHistory.length - 1], this.total = Math.max(this.maxTurns - 1, 0), this.progress = Math.max(this.currentTurn - 1, 0), i2) : null;
2560
+ } catch (e4) {
2561
+ return this.log.log("Could not restore the agent session", e4), null;
2562
+ }
2563
+ }
2564
+ clearPersisted() {
2565
+ try {
2566
+ localStorage.removeItem(this.storageKey());
2567
+ } catch (e3) {
2568
+ }
2569
+ }
2570
+ applyIntegrationContext(e3) {
2571
+ var t3, i2;
2572
+ (null === (t3 = null == e3 ? void 0 : e3.lang) || void 0 === t3 ? void 0 : t3.length) && (this.language = e3.lang[0]), (null == e3 ? void 0 : e3.product) && (this.product = e3.product), (null === (i2 = null == e3 ? void 0 : e3.style) || void 0 === i2 ? void 0 : i2.primaryColor) && (this.primaryColor = e3.style.primaryColor);
519
2573
  }
520
2574
  };
521
2575
  }, 665: (e2, t2) => {
@@ -535,14 +2589,14 @@ var require_magicfeedback_sdk_browser = __commonJS({
535
2589
  "use strict";
536
2590
  var n = this && this.__awaiter || function(e3, t3, i2, n2) {
537
2591
  return new (i2 || (i2 = Promise))((function(r2, s2) {
538
- function a2(e4) {
2592
+ function o2(e4) {
539
2593
  try {
540
2594
  l2(n2.next(e4));
541
2595
  } catch (e5) {
542
2596
  s2(e5);
543
2597
  }
544
2598
  }
545
- function o2(e4) {
2599
+ function a2(e4) {
546
2600
  try {
547
2601
  l2(n2.throw(e4));
548
2602
  } catch (e5) {
@@ -553,33 +2607,48 @@ var require_magicfeedback_sdk_browser = __commonJS({
553
2607
  var t4;
554
2608
  e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
555
2609
  e5(t4);
556
- }))).then(a2, o2);
2610
+ }))).then(o2, a2);
557
2611
  }
558
2612
  l2((n2 = n2.apply(e3, t3 || [])).next());
559
2613
  }));
560
2614
  };
561
2615
  Object.defineProperty(t2, "__esModule", { value: true }), t2.Form = void 0;
562
- const r = i(558), s = i(256), a = i(313), o = i(213), l = i(989), d = i(700), c = i(591), u = i(79), p = i(636);
2616
+ const r = i(558), s = i(544), o = i(256), a = i(313), l = i(213), d = i(571), c = i(565), u = i(107), p = i(989), h = i(700), m = i(591), f = i(79), g = i(636);
563
2617
  t2.Form = class {
564
2618
  constructor(e3, t3, i2, n2, r2) {
565
- this.config = e3, this.log = new s.Log(e3), this.formOptionsConfig = { addButton: true, sendButtonText: "Send", backButtonText: "Back", nextButtonText: "Next", addSuccessScreen: true, getMetaData: true, customMetaData: [], questionFormat: "standard" }, this.selector = "", this.appId = t3, this.publicKey = i2 || "", this.url = e3.get("url"), this.id = "", this.formData = null, this.feedback = { text: "", answers: [], profile: null != n2 ? n2 : [], metrics: [], metadata: null != r2 ? r2 : [] }, this.history = new u.History(), this.graph = new l.PageGraph([]), this.progress = 0, this.total = 0, this.completed = false, this.timeToCompleted = 0;
2619
+ this.config = e3, this.log = new o.Log(e3), this.formOptionsConfig = { addButton: true, sendButtonText: "Send", backButtonText: "Back", nextButtonText: "Next", addSuccessScreen: true, getMetaData: true, customMetaData: [], questionFormat: "standard" }, this.selector = "", this.appId = t3, this.publicKey = i2 || "", this.url = e3.get("url"), this.id = "", this.formData = null, this.feedback = { text: "", answers: [], profile: null != n2 ? n2 : [], metrics: [], metadata: null != r2 ? r2 : [] }, this.history = new f.History(), this.agentForm = null, this.graph = new p.PageGraph([]), this.progress = 0, this.total = 0, this.completed = false, this.timeToCompleted = 0;
566
2620
  }
567
2621
  generate(e3, t3) {
568
- var i2, r2, s2, o2, l2, d2, c2;
2622
+ var i2, r2, o2, l2, d2, c2, u2;
569
2623
  return n(this, void 0, void 0, (function* () {
570
2624
  try {
571
2625
  this.formOptionsConfig = Object.assign(Object.assign({}, this.formOptionsConfig), t3), this.selector = e3;
572
2626
  let n2 = this.formData;
573
2627
  if (void 0 !== this.formData && this.formData || (n2 = "" !== this.publicKey ? yield (0, a.getForm)(this.url, this.appId, this.publicKey, this.log) : yield (0, a.getSessionForm)(this.url, this.appId, this.log)), void 0 === n2 || !n2) throw new Error(`No data for app ${this.appId}`);
574
2628
  if (null === (i2 = n2.error) || void 0 === i2 ? void 0 : i2.message) throw new Error(n2.error.message);
575
- if (n2.questions = (null === (r2 = n2.questions) || void 0 === r2 ? void 0 : r2.filter(((e4) => "ACTIVE" === e4.status))) || [], n2.pages = (null === (s2 = n2.pages) || void 0 === s2 ? void 0 : s2.filter(((e4) => "ACTIVE" === e4.status))) || [], null === (o2 = n2.pages) || void 0 === o2 || o2.forEach(((e4) => {
2629
+ if ("AGENT" === n2.mode) return this.agentForm = new s.AgentForm(this.config, this.appId, this.publicKey), this.agentForm.applyIntegrationContext(n2), void (yield this.agentForm.generate(e3, t3));
2630
+ if (n2.questions = (null === (r2 = n2.questions) || void 0 === r2 ? void 0 : r2.filter(((e4) => "ACTIVE" === e4.status))) || [], n2.pages = (null === (o2 = n2.pages) || void 0 === o2 ? void 0 : o2.filter(((e4) => "ACTIVE" === e4.status))) || [], null === (l2 = n2.pages) || void 0 === l2 || l2.forEach(((e4) => {
576
2631
  var t4;
577
2632
  return e4.integrationQuestions = null === (t4 = e4.integrationQuestions) || void 0 === t4 ? void 0 : t4.filter(((e5) => "ACTIVE" === e5.status));
578
2633
  })), this.formData = n2, this.formData.savedAt || (this.formData.savedAt = /* @__PURE__ */ new Date(), localStorage.setItem(`magicfeedback-${this.appId}`, JSON.stringify(this.formData))), void 0 === this.formData.questions || !this.formData.questions) throw new Error(`No questions for app ${this.appId}`);
579
- this.formData.pages && 0 !== (null === (l2 = this.formData.pages) || void 0 === l2 ? void 0 : l2.length) || this.formatPages(), null === (d2 = this.formData.questions) || void 0 === d2 || d2.sort(((e4, t4) => e4.position - t4.position)), this.formData.pages = this.formData.pages.filter(((e4) => {
2634
+ this.formData.pages && 0 !== (null === (d2 = this.formData.pages) || void 0 === d2 ? void 0 : d2.length) || this.formatPages(), null === (c2 = this.formData.questions) || void 0 === c2 || c2.sort(((e4, t4) => e4.position - t4.position)), this.formData.pages = this.formData.pages.filter(((e4) => {
580
2635
  var t4;
581
2636
  return (null === (t4 = e4.integrationQuestions) || void 0 === t4 ? void 0 : t4.length) > 0;
582
- })), this.formOptionsConfig.getMetaData && this.getMetaData(), (null === (c2 = this.formData.style) || void 0 === c2 ? void 0 : c2.startMessage) ? yield this.generateWelcomeMessage(this.formData.style.startMessage) : this.startForm();
2637
+ })), this.formOptionsConfig.getMetaData && this.getMetaData(), (null === (u2 = this.formData.style) || void 0 === u2 ? void 0 : u2.startMessage) ? yield this.generateWelcomeMessage(this.formData.style.startMessage) : this.startForm();
2638
+ } catch (e4) {
2639
+ return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 })));
2640
+ }
2641
+ }));
2642
+ }
2643
+ previewPage(e3, t3, i2 = {}) {
2644
+ var r2, s2, o2, a2, l2, d2, c2, u2, p2;
2645
+ return n(this, void 0, void 0, (function* () {
2646
+ try {
2647
+ if (!t3 || !t3.page) throw new Error("[MagicFeedback] No page provided for preview");
2648
+ if (!t3.page.integrationQuestions || 0 === t3.page.integrationQuestions.length) throw new Error("[MagicFeedback] No questions provided for preview");
2649
+ this.config.set("dryRun", true), this.formOptionsConfig = Object.assign(Object.assign(Object.assign({}, this.formOptionsConfig), { getMetaData: false }), i2), this.selector = e3;
2650
+ const n2 = (t3.page.integrationQuestions || []).filter(((e4) => !e4.status || "ACTIVE" === e4.status)).sort(((e4, t4) => e4.position - t4.position)), m2 = new h.Page(null !== (r2 = t3.page.id) && void 0 !== r2 ? r2 : "1", null !== (s2 = t3.page.position) && void 0 !== s2 ? s2 : 1, null !== (o2 = t3.appId) && void 0 !== o2 ? o2 : this.appId, n2, null !== (a2 = t3.page.integrationPageRoutes) && void 0 !== a2 ? a2 : []);
2651
+ this.formData = { id: null !== (l2 = t3.appId) && void 0 !== l2 ? l2 : this.appId, identity: null !== (d2 = t3.identity) && void 0 !== d2 ? d2 : "MAGICFORM", lang: [null !== (c2 = t3.lang) && void 0 !== c2 ? c2 : "en"], product: null !== (u2 = t3.product) && void 0 !== u2 ? u2 : { customIcons: false }, style: null !== (p2 = t3.style) && void 0 !== p2 ? p2 : {}, questions: n2, pages: [m2] }, yield this.generateForm();
583
2652
  } catch (e4) {
584
2653
  return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 })));
585
2654
  }
@@ -591,35 +2660,35 @@ var require_magicfeedback_sdk_browser = __commonJS({
591
2660
  case "MAGICSURVEY":
592
2661
  this.formData.pages = [], null === (e3 = this.formData.questions) || void 0 === e3 || e3.forEach(((e4) => {
593
2662
  var t4, i2;
594
- const n2 = new c.PageRoute(e4.id, e4.ref, c.OperatorType.NOEQUAL, [], c.TransitionType.PAGE, (e4.position + 1).toString(), e4.position.toString()), r2 = new d.Page(e4.position.toString(), e4.position, this.appId, [e4], [n2]);
2663
+ const n2 = new m.PageRoute(e4.id, e4.ref, m.OperatorType.NOEQUAL, [], m.TransitionType.PAGE, (e4.position + 1).toString(), e4.position.toString()), r2 = new h.Page(e4.position.toString(), e4.position, this.appId, [e4], [n2]);
595
2664
  null === (i2 = null === (t4 = this.formData) || void 0 === t4 ? void 0 : t4.pages) || void 0 === i2 || i2.push(r2);
596
2665
  }));
597
2666
  break;
598
2667
  case "MAGICFORM":
599
- const t3 = new d.Page("1", 1, this.appId, this.formData.questions, []);
2668
+ const t3 = new h.Page("1", 1, this.appId, this.formData.questions, []);
600
2669
  this.formData.pages = [t3];
601
2670
  }
602
2671
  }
603
2672
  generateContainer() {
604
- let e3 = document.getElementById(this.selector);
605
- if (!e3 && (e3 = document.getElementById("magicfeedback-container-" + this.appId), !e3)) throw new Error(`Element with ID '${this.selector}' not found.`);
606
- return e3.classList.add("magicfeedback-container"), e3.id = "magicfeedback-container-" + this.appId, e3.innerHTML = "", e3;
2673
+ var e3, t3;
2674
+ const i2 = (0, c.generateContainer)(this.selector, this.appId), n2 = null === (t3 = null === (e3 = this.formData) || void 0 === e3 ? void 0 : e3.style) || void 0 === t3 ? void 0 : t3.primaryColor;
2675
+ return n2 && (0, c.applyPrimaryColor)(i2, n2), i2;
607
2676
  }
608
2677
  generateForm() {
609
2678
  var e3, t3, i2, r2;
610
2679
  return n(this, void 0, void 0, (function* () {
611
2680
  try {
612
2681
  if (!this.formData || !this.formData.pages || 0 === this.formData.pages.length) throw new Error("No form data");
613
- this.graph = new l.PageGraph(this.formData.pages.sort(((e4, t4) => e4.position - t4.position)));
2682
+ this.graph = new p.PageGraph(this.formData.pages.sort(((e4, t4) => e4.position - t4.position)));
614
2683
  let n2 = this.generateContainer();
615
2684
  const s2 = document.createElement("form");
616
2685
  s2.classList.add("magicfeedback-form"), s2.id = "magicfeedback-" + this.appId, s2.addEventListener("submit", ((e4) => e4.preventDefault()));
617
- const a2 = document.createElement("div");
618
- a2.classList.add("magicfeedback-questions"), a2.id = "magicfeedback-questions-" + this.appId;
619
- const d2 = this.graph.getFirstPage();
620
- if (!d2) throw new Error("No page found");
621
- if (this.total = this.graph.findMaxDepth(), d2.elements = (0, o.renderQuestions)(d2.questions, this.formOptionsConfig.questionFormat, null === (e3 = this.formData) || void 0 === e3 ? void 0 : e3.lang[0], null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.product, (() => this.send())), null === (i2 = d2.elements) || void 0 === i2 || i2.forEach(((e4) => a2.appendChild(e4))), s2.appendChild(a2), this.history.enqueue(d2), n2.appendChild(s2), this.progress = this.total - this.graph.findMaxDepth(d2), this.formOptionsConfig.addButton) {
622
- const e4 = (0, o.renderActions)(null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.identity, (() => this.back()), this.formOptionsConfig.sendButtonText, this.formOptionsConfig.backButtonText, this.formOptionsConfig.nextButtonText);
2686
+ const o2 = document.createElement("div");
2687
+ o2.classList.add("magicfeedback-questions"), o2.id = "magicfeedback-questions-" + this.appId;
2688
+ const a2 = this.graph.getFirstPage();
2689
+ if (!a2) throw new Error("No page found");
2690
+ if (this.total = this.graph.findMaxDepth(), a2.elements = (0, l.renderQuestions)(a2.questions, this.formOptionsConfig.questionFormat, null === (e3 = this.formData) || void 0 === e3 ? void 0 : e3.lang[0], null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.product, (() => this.send())), null === (i2 = a2.elements) || void 0 === i2 || i2.forEach(((e4) => o2.appendChild(e4))), s2.appendChild(o2), this.history.enqueue(a2), n2.appendChild(s2), this.progress = this.total - this.graph.findMaxDepth(a2), this.formOptionsConfig.addButton) {
2691
+ const e4 = (0, l.renderActions)(null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.identity, (() => this.back()), this.formOptionsConfig.sendButtonText, this.formOptionsConfig.backButtonText, this.formOptionsConfig.nextButtonText);
623
2692
  s2.appendChild(e4);
624
2693
  }
625
2694
  this.formOptionsConfig.addButton && s2.addEventListener("submit", ((e4) => {
@@ -636,7 +2705,7 @@ var require_magicfeedback_sdk_browser = __commonJS({
636
2705
  generateWelcomeMessage(e3) {
637
2706
  return n(this, void 0, void 0, (function* () {
638
2707
  try {
639
- const t3 = this.generateContainer(), i2 = (0, o.renderStartMessage)(e3, this.formOptionsConfig.addButton, this.formOptionsConfig.startButtonText, (() => this.startForm()));
2708
+ const t3 = this.generateContainer(), i2 = (0, l.renderStartMessage)(e3, this.formOptionsConfig.addButton, this.formOptionsConfig.startButtonText, (() => this.startForm()));
640
2709
  t3.appendChild(i2), this.formOptionsConfig.onLoadedEvent && (yield this.formOptionsConfig.onLoadedEvent({ loading: false, formData: this.formData }));
641
2710
  } catch (e4) {
642
2711
  return this.log.err(e4), void (this.formOptionsConfig.onLoadedEvent && this.formOptionsConfig.onLoadedEvent({ loading: false, error: e4 }));
@@ -651,14 +2720,21 @@ var require_magicfeedback_sdk_browser = __commonJS({
651
2720
  i2.length > 0 && this.feedback.metadata.push({ key: `query-${t3}`, value: i2 });
652
2721
  })), this.feedback.metadata.push({ key: "navigator-user", value: [navigator.userAgent] }), this.feedback.metadata.push({ key: "navigator-language", value: [navigator.language] }), this.feedback.metadata.push({ key: "navigator-platform", value: [navigator.platform] }), this.feedback.metadata.push({ key: "navigator-appVersion", value: [navigator.appVersion] }), this.feedback.metadata.push({ key: "navigator-appName", value: [navigator.appName] }), this.feedback.metadata.push({ key: "navigator-product", value: [navigator.product] }), this.feedback.metadata.push({ key: "screen-width", value: [window.screen.width.toString()] }), this.feedback.metadata.push({ key: "screen-height", value: [window.screen.height.toString()] }), this.appId && "" === this.publicKey && this.feedback.metadata.push({ key: "MAGICFEEDBACK_SESSION", value: [this.appId] });
653
2722
  }
654
- send(e3, t3, i2) {
2723
+ send(e3, t3, i2, s2) {
655
2724
  return n(this, void 0, void 0, (function* () {
2725
+ if (this.agentForm) return this.agentForm.next();
656
2726
  const n2 = document.getElementById("magicfeedback-questions-" + this.appId);
657
2727
  try {
658
- i2 && (this.feedback.profile = [...this.feedback.profile, ...i2]), t3 && (this.feedback.metrics = [...this.feedback.metrics, ...t3]), e3 && (this.feedback.metadata = [...this.feedback.metadata, ...e3]), this.answer(), this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
659
- const s2 = this.history.back();
660
- if (!s2) throw new Error("No page found");
661
- for (const e4 of s2.questions.filter(((e5) => e5.require && ![r.FEEDBACKAPPANSWERTYPE.CONSENT, r.FEEDBACKAPPANSWERTYPE.INFO_PAGE].includes(e5.type)))) {
2728
+ if (i2 && (this.feedback.profile = [...this.feedback.profile, ...i2]), t3 && (this.feedback.metrics = [...this.feedback.metrics, ...t3]), e3 && (this.feedback.metadata = [...this.feedback.metadata, ...e3]), s2) {
2729
+ this.feedback.answers = [...this.feedback.answers, ...s2], this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
2730
+ const e4 = yield this.pushAnswers(false);
2731
+ if (!e4) throw new Error("No response");
2732
+ return this.id = e4, void (this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ loading: false, progress: this.progress, total: this.total })));
2733
+ }
2734
+ yield (0, d.awaitUploadReady)(n2), this.answer(), this.formOptionsConfig.beforeSubmitEvent && (yield this.formOptionsConfig.beforeSubmitEvent({ loading: true, progress: this.progress, total: this.total }));
2735
+ const o2 = this.history.back();
2736
+ if (!o2) throw new Error("No page found");
2737
+ for (const e4 of o2.questions.filter(((e5) => e5.require && ![r.FEEDBACKAPPANSWERTYPE.CONSENT, r.FEEDBACKAPPANSWERTYPE.INFO_PAGE].includes(e5.type)))) {
662
2738
  const t4 = e4.assets, i3 = this.feedback.answers.filter(((t5) => t5.key.includes(e4.ref) && !t5.key.includes("extra-option")));
663
2739
  if (0 === i3.length || i3.find(((e5) => 0 === e5.value.length))) throw this.log.err(`The question ${e4.ref} is required`), new Error("No response");
664
2740
  if (null == t4 ? void 0 : t4.minOptions) {
@@ -689,35 +2765,17 @@ var require_magicfeedback_sdk_browser = __commonJS({
689
2765
  const e3 = document.getElementById("magicfeedback-" + this.appId);
690
2766
  if (!e3) return this.log.err(`Form "${e3}" not found.`), this.feedback.answers = [], [];
691
2767
  const t3 = this.history.back();
692
- if (!t3) {
693
- const t4 = e3.querySelectorAll(".magicfeedback-input"), i3 = [], n3 = {};
694
- return t4.forEach(((e4) => {
695
- var t5;
696
- const r2 = e4, s3 = r2.name;
697
- if (!s3) return;
698
- const a2 = r2.type;
699
- if (("radio" === a2 || "checkbox" === a2) && !r2.checked) return;
700
- const o3 = r2.value, l3 = r2.classList[0];
701
- if ((null == l3 ? void 0 : l3.includes("magicfeedback-priority-list")) || (null === (t5 = r2.id) || void 0 === t5 ? void 0 : t5.startsWith("priority-list-"))) return n3[s3] || (n3[s3] = []), void n3[s3].push(o3);
702
- const d3 = "magicfeedback-consent" === l3 ? r2.checked.toString() : o3;
703
- if (null == d3) return;
704
- const c2 = { key: s3, value: [d3] };
705
- i3.push(c2);
706
- })), Object.entries(n3).forEach((([e4, t5]) => {
707
- const n4 = t5.slice().sort(((e5, t6) => Number(e5.split(".")[0]) - Number(t6.split(".")[0])));
708
- i3.push({ key: e4, value: n4 });
709
- })), this.feedback.answers = i3, i3;
710
- }
2768
+ if (!t3) return this.feedback.answers = (0, u.scrapeInputs)(e3), this.feedback.answers;
711
2769
  const i2 = [];
712
2770
  let n2 = false;
713
- const s2 = e3.querySelectorAll(".magicfeedback-input"), o2 = {}, l2 = {}, d2 = {};
2771
+ const s2 = e3.querySelectorAll(".magicfeedback-input"), o2 = {}, l2 = {}, c2 = {};
714
2772
  if (s2.forEach(((e4) => {
715
- const s3 = e4, c2 = t3.questions.find(((e5) => {
2773
+ const s3 = e4, u2 = t3.questions.find(((e5) => {
716
2774
  var t4;
717
2775
  return null === (t4 = s3.name) || void 0 === t4 ? void 0 : t4.includes(e5.ref);
718
- })), u2 = s3.type, p2 = s3.classList[0], m = { key: s3.name, value: [] }, h = "magicfeedback-consent" === p2 ? s3.checked.toString() : s3.value;
719
- if (m.key && "" !== m.key) if (m.key.startsWith("extra-option-")) "" !== h && (m.value.push(h), i2.push(m));
720
- else switch (null == c2 ? void 0 : c2.type) {
2776
+ })), p2 = s3.type, h2 = s3.classList[0], m2 = { key: s3.name, value: [] }, f2 = "magicfeedback-consent" === h2 ? s3.checked.toString() : s3.value;
2777
+ if (m2.key && "" !== m2.key) if (m2.key.startsWith("extra-option-")) "" !== f2 && (m2.value.push(f2), i2.push(m2));
2778
+ else switch (null == u2 ? void 0 : u2.type) {
721
2779
  case r.FEEDBACKAPPANSWERTYPE.EMAIL:
722
2780
  case r.FEEDBACKAPPANSWERTYPE.TEXT:
723
2781
  case r.FEEDBACKAPPANSWERTYPE.LONGTEXT:
@@ -725,44 +2783,49 @@ var require_magicfeedback_sdk_browser = __commonJS({
725
2783
  case r.FEEDBACKAPPANSWERTYPE.DATE:
726
2784
  case r.FEEDBACKAPPANSWERTYPE.CONTACT:
727
2785
  case r.FEEDBACKAPPANSWERTYPE.PASSWORD:
728
- "" !== h && ("email" === u2 ? (0, a.validateEmail)(h) ? (this.feedback.profile.push({ key: "email", value: [h] }), m.value.push(h), i2.push(m)) : (this.log.err("Invalid email"), n2 = true) : (m.value.push(h), i2.push(m)));
2786
+ "" !== f2 && ("email" === p2 ? (0, a.validateEmail)(f2) ? (this.feedback.profile.push({ key: "email", value: [f2] }), m2.value.push(f2), i2.push(m2)) : (this.log.err("Invalid email"), n2 = true) : (m2.value.push(f2), i2.push(m2)));
729
2787
  break;
730
2788
  case r.FEEDBACKAPPANSWERTYPE.RADIO:
731
- s3.checked && (m.value.push(h), i2.push(m));
2789
+ s3.checked && (m2.value.push(f2), i2.push(m2));
732
2790
  break;
733
2791
  case r.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE:
734
2792
  case r.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE:
735
- s3.checked && (l2[m.key] || (l2[m.key] = []), l2[m.key].push(h));
2793
+ s3.checked && (l2[m2.key] || (l2[m2.key] = []), l2[m2.key].push(f2));
736
2794
  break;
737
2795
  case r.FEEDBACKAPPANSWERTYPE.BOOLEAN:
738
- s3.checked && (m.value.push(h), i2.push(m));
2796
+ s3.checked && (m2.value.push(f2), i2.push(m2));
739
2797
  break;
740
2798
  case r.FEEDBACKAPPANSWERTYPE.CONSENT:
741
- m.value.push(s3.checked.toString()), i2.push(m);
2799
+ m2.value.push(s3.checked.toString()), i2.push(m2);
742
2800
  break;
743
2801
  case r.FEEDBACKAPPANSWERTYPE.RATING_EMOJI:
744
2802
  case r.FEEDBACKAPPANSWERTYPE.RATING_NUMBER:
745
2803
  case r.FEEDBACKAPPANSWERTYPE.RATING_STAR:
746
- s3.checked && (m.value.push(h), i2.push(m));
2804
+ s3.checked && (m2.value.push(f2), i2.push(m2));
747
2805
  break;
748
2806
  case r.FEEDBACKAPPANSWERTYPE.SELECT:
749
- "" !== h && (m.value.push(h), i2.push(m));
2807
+ "" !== f2 && (m2.value.push(f2), i2.push(m2));
750
2808
  break;
751
2809
  case r.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM:
752
- "number" === u2 && s3.id && (d2[m.key] || (d2[m.key] = []), "" !== h && d2[m.key].push(`${s3.id}:${h}%`));
2810
+ "number" === p2 && s3.id && (c2[m2.key] || (c2[m2.key] = []), "" !== f2 && c2[m2.key].push(`${s3.id}:${f2}%`));
753
2811
  break;
754
2812
  case r.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST:
755
- "hidden" === u2 && (o2[m.key] || (o2[m.key] = []), o2[m.key].push(h));
2813
+ "hidden" === p2 && (o2[m2.key] || (o2[m2.key] = []), o2[m2.key].push(f2));
756
2814
  break;
757
2815
  case r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX:
758
- e4.checked && (m.value.push(h), i2.push(m));
2816
+ e4.checked && (m2.value.push(f2), i2.push(m2));
2817
+ break;
759
2818
  case r.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE:
760
- case r.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE:
2819
+ case r.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE: {
2820
+ const e5 = (0, d.getUploadValues)(s3);
2821
+ e5.length && (m2.value.push(...e5), i2.push(m2));
2822
+ break;
2823
+ }
761
2824
  }
762
2825
  })), n2) return [];
763
2826
  Object.entries(l2).forEach((([e4, t4]) => {
764
2827
  t4 && 0 !== t4.length && i2.push({ key: e4, value: t4 });
765
- })), Object.entries(d2).forEach((([e4, t4]) => {
2828
+ })), Object.entries(c2).forEach((([e4, t4]) => {
766
2829
  t4 && 0 !== t4.length && i2.push({ key: e4, value: t4 });
767
2830
  })), Object.entries(o2).forEach((([e4, t4]) => {
768
2831
  if (!t4 || 0 === t4.length) return;
@@ -778,8 +2841,8 @@ var require_magicfeedback_sdk_browser = __commonJS({
778
2841
  const t5 = i2.findIndex(((t6) => t6.key === e5.key));
779
2842
  -1 !== t5 && i2.splice(t5, 1);
780
2843
  }
781
- const a2 = i2.findIndex(((t5) => t5.key === e4.ref));
782
- -1 !== a2 ? i2[a2] = s3 : i2.push(s3);
2844
+ const o3 = i2.findIndex(((t5) => t5.key === e4.ref));
2845
+ -1 !== o3 ? i2[o3] = s3 : i2.push(s3);
783
2846
  }));
784
2847
  } catch (e4) {
785
2848
  this.log.err("Error agrupando MULTI_QUESTION_MATRIX", e4);
@@ -791,7 +2854,7 @@ var require_magicfeedback_sdk_browser = __commonJS({
791
2854
  if (this.completed = true, this.timeToCompleted = Date.now() - this.timeToCompleted, this.feedback.metadata.push({ key: "time-to-complete", value: [this.timeToCompleted.toString()] }), this.formOptionsConfig.addSuccessScreen) {
792
2855
  const e3 = document.getElementById("magicfeedback-container-" + this.appId);
793
2856
  e3.childNodes.length > 0 && e3.removeChild(e3.childNodes[0]);
794
- const t3 = (0, o.renderSuccess)(this.formOptionsConfig.successMessage || "Thank you for your feedback!");
2857
+ const t3 = (0, l.renderSuccess)(this.formOptionsConfig.successMessage || "Thank you for your feedback!");
795
2858
  e3.appendChild(t3);
796
2859
  }
797
2860
  this.answer();
@@ -823,7 +2886,6 @@ var require_magicfeedback_sdk_browser = __commonJS({
823
2886
  return n(this, void 0, void 0, (function* () {
824
2887
  if (!(null == e3 ? void 0 : e3.followup)) return null;
825
2888
  try {
826
- if (this.config.get("dryRun")) return this.log.log(`Dry run enabled: skipping follow up API for question ${e3.ref}`), null;
827
2889
  if (0 === this.feedback.answers.length) throw new Error("No answers provided");
828
2890
  const i2 = this.config.get("url"), n2 = Object.assign(Object.assign(Object.assign({ answer: null === (t3 = this.feedback.answers.find(((t4) => t4.key === e3.ref))) || void 0 === t3 ? void 0 : t3.value[0] }, "" !== this.publicKey && { publicKey: this.publicKey }), "" === this.publicKey && { campaignSessionId: this.appId }), { sessionId: this.id, question: e3 });
829
2891
  return yield (0, a.getFollowUpQuestion)(i2, n2, this.log);
@@ -839,66 +2901,66 @@ var require_magicfeedback_sdk_browser = __commonJS({
839
2901
  if (!n2) throw new Error("No page found");
840
2902
  const s2 = n2.getFollowupQuestions();
841
2903
  if (0 === (null == s2 ? void 0 : s2.length)) return void (yield this.renderNextQuestion(e3, n2));
842
- const a2 = [];
2904
+ const o2 = [];
843
2905
  for (const e4 of s2) {
844
2906
  const t4 = n2.questions.find(((t5) => t5.ref === e4));
845
2907
  if (t4) {
846
2908
  const e5 = yield this.callFollowUpQuestion(t4);
847
- e5 && a2.push(e5);
2909
+ e5 && o2.push(e5);
848
2910
  }
849
2911
  }
850
- if (0 === a2.length) return void (yield this.renderNextQuestion(e3, n2));
851
- const l2 = new d.Page(n2.id, n2.position, this.appId, a2, n2.edges), c2 = new p.PageNode(n2.id, n2.position, n2.edges, l2, a2, true);
852
- c2.elements = (0, o.renderQuestions)(a2, this.formOptionsConfig.questionFormat, null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.lang[0], null === (i2 = this.formData) || void 0 === i2 ? void 0 : i2.product, (() => this.send())), this.history.enqueue(c2), this.progress += 0.5, e3.innerHTML = "", null === (r2 = c2.elements) || void 0 === r2 || r2.forEach(((t4) => e3.appendChild(t4))), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: c2.isFollowup, completed: this.completed, error: null }));
2912
+ if (0 === o2.length) return void (yield this.renderNextQuestion(e3, n2));
2913
+ const a2 = new h.Page(n2.id, n2.position, this.appId, o2, n2.edges), d2 = new g.PageNode(n2.id, n2.position, n2.edges, a2, o2, true);
2914
+ d2.elements = (0, l.renderQuestions)(o2, this.formOptionsConfig.questionFormat, null === (t3 = this.formData) || void 0 === t3 ? void 0 : t3.lang[0], null === (i2 = this.formData) || void 0 === i2 ? void 0 : i2.product, (() => this.send())), this.history.enqueue(d2), this.progress += 0.5, e3.innerHTML = "", null === (r2 = d2.elements) || void 0 === r2 || r2.forEach(((t4) => e3.appendChild(t4))), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: d2.isFollowup, completed: this.completed, error: null }));
853
2915
  }));
854
2916
  }
855
2917
  renderNextQuestion(e3, t3) {
856
- var i2, s2, a2, l2, d2;
2918
+ var i2, s2, o2, a2, d2;
857
2919
  return n(this, void 0, void 0, (function* () {
858
2920
  let n2 = this.graph.getNextPage(t3, this.feedback.answers);
859
2921
  if (!n2) return void this.finish();
860
- const u2 = n2.edges.filter(((e4) => "PRECONDITIONAL" === e4.typeCondition)).sort(((e4, t4) => e4.position < t4.position ? -1 : e4.position > t4.position ? 1 : 0));
861
- if ((null == u2 ? void 0 : u2.length) > 0) {
862
- const t4 = u2.some(((e4) => e4.transition === c.TransitionType.ALLOW));
863
- let a3 = t4;
864
- for (const t5 of u2) {
865
- let o2;
2922
+ const c2 = n2.edges.filter(((e4) => "PRECONDITIONAL" === e4.typeCondition)).sort(((e4, t4) => e4.position < t4.position ? -1 : e4.position > t4.position ? 1 : 0));
2923
+ if ((null == c2 ? void 0 : c2.length) > 0) {
2924
+ const t4 = c2.some(((e4) => e4.transition === m.TransitionType.ALLOW));
2925
+ let o3 = t4;
2926
+ for (const t5 of c2) {
2927
+ let a3;
866
2928
  for (let e4 = this.history.size() - 1; e4 >= 0; e4--) {
867
2929
  const n3 = this.history.get(e4);
868
- if (n3 && (o2 = null === (i2 = n3.answers) || void 0 === i2 ? void 0 : i2.find(((e5) => e5.key === t5.questionRef)), o2)) break;
2930
+ if (n3 && (a3 = null === (i2 = n3.answers) || void 0 === i2 ? void 0 : i2.find(((e5) => e5.key === t5.questionRef)), a3)) break;
869
2931
  }
870
- let l3 = false;
871
- if (o2) {
872
- const e4 = null === (s2 = this.formData) || void 0 === s2 ? void 0 : s2.questions.find(((e5) => e5.ref === t5.questionRef)), i3 = Array.isArray(o2.value) ? o2.value : [o2.value], n3 = Array.isArray(t5.value) ? t5.value : [t5.value];
873
- if ((null == e4 ? void 0 : e4.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) l3 = this.evaluateMatrixPreconditional(t5, o2);
2932
+ let l2 = false;
2933
+ if (a3) {
2934
+ const e4 = null === (s2 = this.formData) || void 0 === s2 ? void 0 : s2.questions.find(((e5) => e5.ref === t5.questionRef)), i3 = Array.isArray(a3.value) ? a3.value : [a3.value], n3 = Array.isArray(t5.value) ? t5.value : [t5.value];
2935
+ if ((null == e4 ? void 0 : e4.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) l2 = this.evaluateMatrixPreconditional(t5, a3);
874
2936
  else switch (t5.typeOperator) {
875
2937
  case "EQUAL":
876
2938
  case "INQ":
877
- l3 = i3.some(((e5) => n3.includes(e5)));
2939
+ l2 = i3.some(((e5) => n3.includes(e5)));
878
2940
  break;
879
2941
  case "NOEQUAL":
880
2942
  case "NINQ":
881
- l3 = i3.every(((e5) => !n3.includes(e5)));
2943
+ l2 = i3.every(((e5) => !n3.includes(e5)));
882
2944
  break;
883
2945
  case "GREATER":
884
- l3 = i3.some(((e5) => Number(e5) > Number(n3[0])));
2946
+ l2 = i3.some(((e5) => Number(e5) > Number(n3[0])));
885
2947
  break;
886
2948
  case "LESS":
887
- l3 = i3.some(((e5) => Number(e5) < Number(n3[0])));
2949
+ l2 = i3.some(((e5) => Number(e5) < Number(n3[0])));
888
2950
  break;
889
2951
  case "GREATEREQUAL":
890
- l3 = i3.some(((e5) => Number(e5) >= Number(n3[0])));
2952
+ l2 = i3.some(((e5) => Number(e5) >= Number(n3[0])));
891
2953
  break;
892
2954
  case "LESSEQUAL":
893
- l3 = i3.some(((e5) => Number(e5) <= Number(n3[0])));
2955
+ l2 = i3.some(((e5) => Number(e5) <= Number(n3[0])));
894
2956
  }
895
2957
  }
896
- if (t5.transition === c.TransitionType.ALLOW) l3 || (a3 = false);
897
- else if (t5.transition === c.TransitionType.NEXT && l3) return this.feedback.answers = [], void (n2 && (yield this.renderNextQuestion(e3, n2)));
2958
+ if (t5.transition === m.TransitionType.ALLOW) l2 || (o3 = false);
2959
+ else if (t5.transition === m.TransitionType.NEXT && l2) return this.feedback.answers = [], void (n2 && (yield this.renderNextQuestion(e3, n2)));
898
2960
  }
899
- if (t4 && !a3) return this.feedback.answers = [], void (n2 && (yield this.renderNextQuestion(e3, n2)));
2961
+ if (t4 && !o3) return this.feedback.answers = [], void (n2 && (yield this.renderNextQuestion(e3, n2)));
900
2962
  }
901
- n2.elements = (0, o.renderQuestions)(n2.questions, this.formOptionsConfig.questionFormat, null === (a2 = this.formData) || void 0 === a2 ? void 0 : a2.lang[0], null === (l2 = this.formData) || void 0 === l2 ? void 0 : l2.product, (() => this.send())), e3.innerHTML = "", null === (d2 = n2.elements) || void 0 === d2 || d2.forEach(((t4) => e3.appendChild(t4))), this.history.enqueue(n2), this.progress = this.total - this.graph.findMaxDepth(n2), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: n2.isFollowup, completed: this.completed, error: null }));
2963
+ n2.elements = (0, l.renderQuestions)(n2.questions, this.formOptionsConfig.questionFormat, null === (o2 = this.formData) || void 0 === o2 ? void 0 : o2.lang[0], null === (a2 = this.formData) || void 0 === a2 ? void 0 : a2.product, (() => this.send())), e3.innerHTML = "", null === (d2 = n2.elements) || void 0 === d2 || d2.forEach(((t4) => e3.appendChild(t4))), this.history.enqueue(n2), this.progress = this.total - this.graph.findMaxDepth(n2), this.formOptionsConfig.afterSubmitEvent && (yield this.formOptionsConfig.afterSubmitEvent({ response: this.id, loading: false, progress: this.progress, total: this.total, followup: n2.isFollowup, completed: this.completed, error: null }));
902
2964
  }));
903
2965
  }
904
2966
  back() {
@@ -912,25 +2974,25 @@ var require_magicfeedback_sdk_browser = __commonJS({
912
2974
  }));
913
2975
  }
914
2976
  previewQuestion(e3, t3, i2) {
915
- var n2, r2;
916
- const s2 = Array.isArray(t3) ? t3 : [t3];
917
- if (!s2 || 0 === s2.length) throw new Error("[MagicFeedback] No question provided for preview");
2977
+ var n2, r2, s2;
2978
+ const o2 = Array.isArray(t3) ? t3 : [t3];
2979
+ if (!o2 || 0 === o2.length) throw new Error("[MagicFeedback] No question provided for preview");
918
2980
  const a2 = document.getElementById(e3);
919
2981
  if (!a2) throw new Error(`[MagicFeedback] Element with ID '${e3}' not found.`);
920
- const { format: l2 = this.formOptionsConfig.questionFormat || "standard", language: d2 = (null === (n2 = this.formData) || void 0 === n2 ? void 0 : n2.lang) && this.formData.lang[0] || "en", product: c2 = (null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.product) || { customIcons: false }, clearContainer: u2 = true, wrap: p2 = true } = i2 || {};
921
- u2 && (a2.innerHTML = "");
922
- let m = [];
2982
+ const { format: d2 = this.formOptionsConfig.questionFormat || "standard", language: u2 = (null === (n2 = this.formData) || void 0 === n2 ? void 0 : n2.lang) && this.formData.lang[0] || "en", product: p2 = (null === (r2 = this.formData) || void 0 === r2 ? void 0 : r2.product) || { customIcons: false }, style: h2 = (null === (s2 = this.formData) || void 0 === s2 ? void 0 : s2.style) || {}, clearContainer: m2 = true, wrap: f2 = true } = i2 || {};
2983
+ m2 && (a2.innerHTML = ""), (null == h2 ? void 0 : h2.primaryColor) && (0, c.applyPrimaryColor)(a2, h2.primaryColor);
2984
+ let g2 = [];
923
2985
  try {
924
- m = (0, o.renderQuestions)(s2, l2, d2, c2);
2986
+ g2 = (0, l.renderQuestions)(o2, d2, u2, p2);
925
2987
  } catch (e4) {
926
2988
  throw this.log.err(e4), e4;
927
2989
  }
928
- let h = a2;
929
- if (p2) {
2990
+ let v = a2;
2991
+ if (f2) {
930
2992
  const e4 = document.createElement("div");
931
- e4.classList.add("magicfeedback-preview-question"), h.appendChild(e4), h = e4;
2993
+ e4.classList.add("magicfeedback-preview-question"), v.appendChild(e4), v = e4;
932
2994
  }
933
- return m.forEach(((e4) => h.appendChild(e4))), a2;
2995
+ return g2.forEach(((e4) => v.appendChild(e4))), a2;
934
2996
  }
935
2997
  parseMatrixAnswerPre(e3) {
936
2998
  if (!e3 || !e3.value) return [];
@@ -1014,28 +3076,28 @@ var require_magicfeedback_sdk_browser = __commonJS({
1014
3076
  if (!e3) return;
1015
3077
  e3.edges.sort(((e4, t4) => "DIRECT" === e4.typeCondition ? 1 : "DIRECT" === t4.typeCondition ? -1 : 0));
1016
3078
  const n2 = e3.edges.find(((i3) => {
1017
- const n3 = e3.questions.find(((e4) => e4.ref === i3.questionRef)), a = null == t3 ? void 0 : t3.filter(((e4) => e4.key === i3.questionRef));
3079
+ const n3 = e3.questions.find(((e4) => e4.ref === i3.questionRef)), o = null == t3 ? void 0 : t3.filter(((e4) => e4.key === i3.questionRef));
1018
3080
  if ("DIRECT" === i3.typeCondition) return true;
1019
- if (!a || 0 === a.length) return false;
1020
- if ((null == n3 ? void 0 : n3.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) return this.evaluateMatrixCondition(i3, a);
1021
- const o = Array.isArray(i3.value) ? i3.value : [i3.value];
3081
+ if (!o || 0 === o.length) return false;
3082
+ if ((null == n3 ? void 0 : n3.type) === r.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX) return this.evaluateMatrixCondition(i3, o);
3083
+ const a = Array.isArray(i3.value) ? i3.value : [i3.value];
1022
3084
  switch (i3.typeOperator) {
1023
3085
  case s.OperatorType.EQUAL:
1024
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.includes(e5)))));
3086
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.includes(e5)))));
1025
3087
  case s.OperatorType.NOEQUAL:
1026
- return a.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !o.includes(e5)))));
3088
+ return o.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !a.includes(e5)))));
1027
3089
  case s.OperatorType.GREATER:
1028
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.some(((t4) => Number(e5) > Number(t4)))))));
3090
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.some(((t4) => Number(e5) > Number(t4)))))));
1029
3091
  case s.OperatorType.LESS:
1030
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.some(((t4) => Number(e5) < Number(t4)))))));
3092
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.some(((t4) => Number(e5) < Number(t4)))))));
1031
3093
  case s.OperatorType.GREATEREQUAL:
1032
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.some(((t4) => Number(e5) >= Number(t4)))))));
3094
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.some(((t4) => Number(e5) >= Number(t4)))))));
1033
3095
  case s.OperatorType.LESSEQUAL:
1034
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.some(((t4) => Number(e5) <= Number(t4)))))));
3096
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.some(((t4) => Number(e5) <= Number(t4)))))));
1035
3097
  case s.OperatorType.INQ:
1036
- return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => o.includes(e5)))));
3098
+ return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => a.includes(e5)))));
1037
3099
  case s.OperatorType.NINQ:
1038
- return a.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !o.includes(e5)))));
3100
+ return o.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !a.includes(e5)))));
1039
3101
  default:
1040
3102
  return false;
1041
3103
  }
@@ -1072,17 +3134,17 @@ var require_magicfeedback_sdk_browser = __commonJS({
1072
3134
  DFSUtil(e3, t3, i2) {
1073
3135
  t3.add(e3);
1074
3136
  let n2 = i2;
1075
- const r2 = [...e3.edges.filter(((e4) => e4.typeCondition !== s.ConditionType.PRECONDITIONAL)) || []], a = this.getNextEdgeByDefault(e3);
1076
- if (a) {
1077
- const i3 = this.getNodeById(a);
3137
+ const r2 = [...e3.edges.filter(((e4) => e4.typeCondition !== s.ConditionType.PRECONDITIONAL)) || []], o = this.getNextEdgeByDefault(e3);
3138
+ if (o) {
3139
+ const i3 = this.getNodeById(o);
1078
3140
  i3 && !t3.has(i3) && r2.push(new s.PageRoute(i3.id, "", s.OperatorType.DEFAULT, [""], s.TransitionType.PAGE, i3.id, e3.id));
1079
3141
  }
1080
3142
  for (const e4 of r2) {
1081
3143
  if (!e4.transitionDestiny) continue;
1082
3144
  const r3 = this.getNodeById(e4.transitionDestiny);
1083
3145
  if (r3 && !t3.has(r3)) {
1084
- const e5 = i2 + 1, s2 = new Set(t3), a2 = this.DFSUtil(r3, s2, e5);
1085
- n2 = Math.max(n2, a2);
3146
+ const e5 = i2 + 1, s2 = new Set(t3), o2 = this.DFSUtil(r3, s2, e5);
3147
+ n2 = Math.max(n2, o2);
1086
3148
  }
1087
3149
  }
1088
3150
  return n2;
@@ -1098,25 +3160,25 @@ var require_magicfeedback_sdk_browser = __commonJS({
1098
3160
  return Array.isArray(e3.value) && e3.value.length > 0 && "object" == typeof e3.value[0] && null !== e3.value[0] && "key" in e3.value[0] ? e3.value : [];
1099
3161
  }
1100
3162
  evaluateMatrixCondition(e3, t3) {
1101
- const i2 = Array.isArray(e3.value) ? e3.value : [e3.value], n2 = new Set(e3.option || []), r2 = t3[0], a = this.parseMatrixAnswer(r2);
1102
- if (!a.length) return false;
1103
- const o = n2.size > 0 ? a.filter(((e4) => n2.has(e4.key))) : a;
3163
+ const i2 = Array.isArray(e3.value) ? e3.value : [e3.value], n2 = new Set(e3.option || []), r2 = t3[0], o = this.parseMatrixAnswer(r2);
1104
3164
  if (!o.length) return false;
3165
+ const a = n2.size > 0 ? o.filter(((e4) => n2.has(e4.key))) : o;
3166
+ if (!a.length) return false;
1105
3167
  switch (e3.typeOperator) {
1106
3168
  case s.OperatorType.EQUAL:
1107
3169
  case s.OperatorType.INQ:
1108
- return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.includes(e5)))));
3170
+ return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.includes(e5)))));
1109
3171
  case s.OperatorType.NOEQUAL:
1110
3172
  case s.OperatorType.NINQ:
1111
- return o.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !i2.includes(e5)))));
3173
+ return a.every(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).every(((e5) => !i2.includes(e5)))));
1112
3174
  case s.OperatorType.GREATER:
1113
- return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) > Number(t4)))))));
3175
+ return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) > Number(t4)))))));
1114
3176
  case s.OperatorType.LESS:
1115
- return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) < Number(t4)))))));
3177
+ return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) < Number(t4)))))));
1116
3178
  case s.OperatorType.GREATEREQUAL:
1117
- return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) >= Number(t4)))))));
3179
+ return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) >= Number(t4)))))));
1118
3180
  case s.OperatorType.LESSEQUAL:
1119
- return o.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) <= Number(t4)))))));
3181
+ return a.some(((e4) => (Array.isArray(e4.value) ? e4.value : [e4.value]).some(((e5) => i2.some(((t4) => Number(e5) <= Number(t4)))))));
1120
3182
  default:
1121
3183
  return false;
1122
3184
  }
@@ -1146,17 +3208,26 @@ var require_magicfeedback_sdk_browser = __commonJS({
1146
3208
  })(i = t2.ConditionType || (t2.ConditionType = {})), (r = t2.OperatorType || (t2.OperatorType = {})).EQUAL = "EQUAL", r.NOEQUAL = "NOEQUAL", r.GREATER = "GREATER", r.LESS = "LESS", r.GREATEREQUAL = "GREATEREQUAL", r.LESSEQUAL = "LESSEQUAL", r.INQ = "INQ", r.NINQ = "NINQ", r.DEFAULT = "DEFAULT", (function(e3) {
1147
3209
  e3.ACTIVE = "ACTIVE", e3.DEPRECATED = "DEPRECATED", e3.DELETE = "DELETE";
1148
3210
  })(n = t2.StatusType || (t2.StatusType = {})), t2.PageRoute = class {
1149
- constructor(e3, t3, r2, s2, a, o, l, d, c, u) {
1150
- this.id = e3, this.questionRef = t3, this.typeCondition = d || i.LOGICAL, this.typeOperator = r2, this.value = s2 || [], this.transition = a, this.transitionDestiny = o, this.status = n.ACTIVE, this.generatedAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.integrationPageId = l, this.position = c || 0, this.option = u || [];
3211
+ constructor(e3, t3, r2, s2, o, a, l, d, c, u) {
3212
+ this.id = e3, this.questionRef = t3, this.typeCondition = d || i.LOGICAL, this.typeOperator = r2, this.value = s2 || [], this.transition = o, this.transitionDestiny = a, this.status = n.ACTIVE, this.generatedAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.integrationPageId = l, this.position = c || 0, this.option = u || [];
1151
3213
  }
1152
3214
  };
1153
3215
  }, 558: (e2, t2) => {
1154
3216
  "use strict";
1155
3217
  var i, n;
1156
- Object.defineProperty(t2, "__esModule", { value: true }), t2.QuestionType = t2.FEEDBACKAPPANSWERTYPE = void 0, (n = t2.FEEDBACKAPPANSWERTYPE || (t2.FEEDBACKAPPANSWERTYPE = {})).CONTACT = "CONTACT", n.MULTIPLECHOISE_IMAGE = "MULTIPLECHOISE_IMAGE", n.EMAIL = "EMAIL", n.RATING_STAR = "RATING_STAR", n.RADIO = "RADIO", n.MULTIPLECHOICE = "MULTIPLECHOICE", n.SELECT = "SELECT", n.TEXT = "TEXT", n.LONGTEXT = "LONGTEXT", n.NUMBER = "NUMBER", n.RATING_EMOJI = "RATING_EMOJI", n.RATING_NUMBER = "RATING_NUMBER", n.DATE = "DATE", n.BOOLEAN = "BOOLEAN", n.PASSWORD = "PASSWORD", n.CONSENT = "CONSENT", n.MULTI_QUESTION_MATRIX = "MULTI_QUESTION_MATRIX", n.POINT_SYSTEM = "POINT_SYSTEM", n.PRIORITY_LIST = "PRIORITY_LIST", n.INFO_PAGE = "INFO_PAGE", n.UPLOAD_FILE = "UPLOAD_FILE", n.UPLOAD_IMAGE = "UPLOAD_IMAGE", t2.QuestionType = class {
1157
- }, (function(e3) {
3218
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.AGENT_ANSWER_TYPE_BLOCKED = t2.QuestionType = t2.FEEDBACKAPPANSWERTYPE = void 0, (n = t2.FEEDBACKAPPANSWERTYPE || (t2.FEEDBACKAPPANSWERTYPE = {})).CONTACT = "CONTACT", n.MULTIPLECHOISE_IMAGE = "MULTIPLECHOISE_IMAGE", n.EMAIL = "EMAIL", n.RATING_STAR = "RATING_STAR", n.RADIO = "RADIO", n.MULTIPLECHOICE = "MULTIPLECHOICE", n.SELECT = "SELECT", n.TEXT = "TEXT", n.LONGTEXT = "LONGTEXT", n.NUMBER = "NUMBER", n.RATING_EMOJI = "RATING_EMOJI", n.RATING_NUMBER = "RATING_NUMBER", n.DATE = "DATE", n.BOOLEAN = "BOOLEAN", n.PASSWORD = "PASSWORD", n.CONSENT = "CONSENT", n.MULTI_QUESTION_MATRIX = "MULTI_QUESTION_MATRIX", n.POINT_SYSTEM = "POINT_SYSTEM", n.PRIORITY_LIST = "PRIORITY_LIST", n.INFO_PAGE = "INFO_PAGE", n.UPLOAD_FILE = "UPLOAD_FILE", n.UPLOAD_IMAGE = "UPLOAD_IMAGE", t2.QuestionType = class {
3219
+ }, t2.AGENT_ANSWER_TYPE_BLOCKED = "ABUSIVE_OR_OFFENSIVE", (function(e3) {
1158
3220
  e3.FORM = "form", e3.DIV = "div";
1159
3221
  })(i || (i = {}));
3222
+ }, 565: (e2, t2) => {
3223
+ "use strict";
3224
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.applyPrimaryColor = t2.generateContainer = void 0, t2.generateContainer = function(e3, t3) {
3225
+ let i = document.getElementById(e3);
3226
+ if (!i && (i = document.getElementById("magicfeedback-container-" + t3), !i)) throw new Error(`Element with ID '${e3}' not found.`);
3227
+ return i.classList.add("magicfeedback-container"), i.id = "magicfeedback-container-" + t3, i.innerHTML = "", i;
3228
+ }, t2.applyPrimaryColor = function(e3, t3) {
3229
+ e3.style.setProperty("--mf-primary", t3), e3.style.setProperty("--mf-primary-hover", `color-mix(in srgb, ${t3} 85%, black)`), e3.style.setProperty("--mf-primary-light", `color-mix(in srgb, ${t3} 15%, white)`), e3.style.setProperty("--mf-primary-border", `color-mix(in srgb, ${t3} 35%, transparent)`), e3.style.setProperty("--mf-border-focus", t3);
3230
+ };
1160
3231
  }, 516: (e2, t2) => {
1161
3232
  "use strict";
1162
3233
  Object.defineProperty(t2, "__esModule", { value: true }), t2.getUrlParam = t2.getBooleanOptions = t2.parseTitle = void 0, t2.parseTitle = function(e3, t3) {
@@ -1204,81 +3275,106 @@ var require_magicfeedback_sdk_browser = __commonJS({
1204
3275
  };
1205
3276
  }, 559: (e2, t2) => {
1206
3277
  "use strict";
1207
- function i(e3, t3, i2, n, r = false, s = true, a = "ltr", o = "row") {
1208
- const l = document.createElement("div");
1209
- l.classList.add("magicfeedback-rating-placeholder"), l.style.display = "flex", l.style.flexDirection = o, l.style.alignItems = "center", l.style.justifyContent = "space-between", l.style.width = r ? `calc(100% - (100% / ${t3 + 1}))` : "100%", l.style.marginRight = "auto", s && window.innerWidth < 600 && (l.style.flexDirection = "column");
1210
- const d = document.createElement("span");
1211
- d.textContent = null != i2 ? i2 : null, d.classList.add("magicfeedback-rating-placeholder-value"), d.style.fontSize = "15px", d.style.display = "block", d.style.minWidth = "0", d.style.overflowWrap = "anywhere", d.style.wordBreak = "break-word", d.style.textAlign = "ltr" === a ? "left" : "right", d.style.width = "50%", (s && window.innerWidth < 600 || "column" === o) && (d.textContent = `${e3} = ${i2}`, d.style.width = "100%", d.style.textAlign = "left", d.style.marginBottom = "5px");
1212
- const c = document.createElement("span");
1213
- return c.textContent = null != n ? n : null, c.classList.add("magicfeedback-rating-placeholder-value"), c.style.fontSize = "15px", c.style.display = "block", c.style.minWidth = "0", c.style.overflowWrap = "anywhere", c.style.wordBreak = "break-word", c.style.textAlign = "ltr" === a ? "right" : "left", c.style.width = "50%", (s && window.innerWidth < 600 || "column" === o) && (c.textContent = `${t3} = ${n}`, c.style.width = "100%", c.style.textAlign = "left", c.style.marginBottom = "5px"), "ltr" === a ? (i2 && l.appendChild(d), n && l.appendChild(c)) : (n && l.appendChild(c), i2 && l.appendChild(d)), l;
3278
+ function i(e3, t3, i2 = "ltr") {
3279
+ const n = document.createElement("div");
3280
+ n.classList.add("magicfeedback-rating-placeholder");
3281
+ const r = document.createElement("span");
3282
+ r.textContent = null != e3 ? e3 : "", r.classList.add("magicfeedback-rating-placeholder-value");
3283
+ const s = document.createElement("span");
3284
+ return s.textContent = null != t3 ? t3 : "", s.classList.add("magicfeedback-rating-placeholder-value"), "ltr" === i2 ? (e3 && n.appendChild(r), t3 && n.appendChild(s)) : (t3 && n.appendChild(s), e3 && n.appendChild(r)), n;
1214
3285
  }
1215
3286
  Object.defineProperty(t2, "__esModule", { value: true }), t2.createRatingNumberElement = t2.createStarRating = t2.createRatingPlaceholder = void 0, t2.createRatingPlaceholder = i, t2.createStarRating = function(e3, t3, n, r = () => {
1216
3287
  }, s) {
1217
- const a = "magicfeedback-rating-star-selected", o = document.createElement("div");
1218
- o.classList.add("magicfeedback-rating-star-container"), o.style.maxWidth = "300px", o.style.margin = "auto", o.dataset.originalSelection = "0";
3288
+ const o = "magicfeedback-rating-star-selected", a = document.createElement("div");
3289
+ a.classList.add("magicfeedback-rating-star-container"), a.style.maxWidth = "300px", a.style.margin = "auto", a.dataset.originalSelection = "0";
1219
3290
  for (let t4 = 1; t4 <= 5; t4++) {
1220
3291
  const i2 = document.createElement("label");
1221
3292
  i2.classList.add("magicfeedback-rating-star-option");
1222
3293
  const n2 = document.createElement("input");
1223
3294
  n2.id = `rating-${e3}-${t4}`, n2.type = "radio", n2.name = e3, n2.value = t4.toString(), n2.style.position = "absolute", n2.style.opacity = "0", n2.style.width = "0", n2.style.height = "0", n2.classList.add("magicfeedback-input"), s && s === n2.value && (n2.checked = true), n2.addEventListener("change", (() => {
1224
- const e4 = o.querySelectorAll(".rating__star");
1225
- for (let t5 = 0; t5 < e4.length; t5++) t5 + 1 <= Number(n2.value) ? e4[t5].classList.contains(a) || e4[t5].classList.add(a) : e4[t5].classList.contains(a) && e4[t5].classList.remove(a);
1226
- o.dataset.originalSelection = n2.value, r && r();
3295
+ const e4 = a.querySelectorAll(".rating__star");
3296
+ for (let t5 = 0; t5 < e4.length; t5++) t5 + 1 <= Number(n2.value) ? e4[t5].classList.contains(o) || e4[t5].classList.add(o) : e4[t5].classList.contains(o) && e4[t5].classList.remove(o);
3297
+ a.dataset.originalSelection = n2.value, r && r();
1227
3298
  })), i2.appendChild(n2);
1228
3299
  const l2 = document.createElement("label");
1229
3300
  l2.htmlFor = `rating-${e3}-${t4}`, l2.classList.add("rating__star"), l2.textContent = "\u2605", l2.style.fontSize = "40px", l2.style.color = "#CCCCCC", l2.style.cursor = "pointer", l2.addEventListener("mouseenter", (() => {
1230
- const e4 = o.querySelectorAll(".rating__star"), i3 = t4 - 1;
3301
+ const e4 = a.querySelectorAll(".rating__star"), i3 = t4 - 1;
1231
3302
  e4.forEach(((e5, t5) => {
1232
- t5 <= i3 ? e5.classList.contains(a) || e5.classList.add(a) : e5.classList.contains(a) && e5.classList.remove(a);
3303
+ t5 <= i3 ? e5.classList.contains(o) || e5.classList.add(o) : e5.classList.contains(o) && e5.classList.remove(o);
1233
3304
  }));
1234
3305
  })), l2.addEventListener("mouseleave", (() => {
1235
- const e4 = Number(o.dataset.originalSelection || "0");
1236
- o.querySelectorAll(".rating__star").forEach(((t5, i3) => {
1237
- i3 < e4 ? t5.classList.contains(a) || t5.classList.add(a) : t5.classList.contains(a) && t5.classList.remove(a);
3306
+ const e4 = Number(a.dataset.originalSelection || "0");
3307
+ a.querySelectorAll(".rating__star").forEach(((t5, i3) => {
3308
+ i3 < e4 ? t5.classList.contains(o) || t5.classList.add(o) : t5.classList.contains(o) && t5.classList.remove(o);
1238
3309
  }));
1239
- })), i2.appendChild(l2), o.appendChild(i2);
3310
+ })), i2.appendChild(l2), a.appendChild(i2);
1240
3311
  }
1241
- const l = i(1, 5, t3, n, false, false);
1242
- return l.childElementCount > 0 && (o.classList.add("magicfeedback-rating-container--with-placeholder"), o.insertBefore(l, o.firstChild)), o;
1243
- }, t2.createRatingNumberElement = function(e3, t3, n, r, s, a, o, l) {
1244
- var d;
1245
- const c = document.createElement("div");
1246
- c.classList.add("magicfeedback-rating-number");
1247
- const u = "ltr" === n ? r : `${r}-reverse`, p = document.createElement("div");
1248
- p.classList.add("magicfeedback-rating-number-container"), p.classList.add(`magicfeedback-rating-number-container-${n}`), p.classList.add(`magicfeedback-rating-number-container-${r}`), p.style.display = "flex", p.style.flexDirection = u, p.setAttribute("role", "radiogroup"), p.setAttribute("aria-label", (null == t3 ? void 0 : t3.ariaLabel) || "Rating");
1249
- const m = (null == t3 ? void 0 : t3.max) ? Number(null == t3 ? void 0 : t3.max) : 10, h = (null == t3 ? void 0 : t3.min) ? Number(null == t3 ? void 0 : t3.min) : 0, f = (null == t3 ? void 0 : t3.numberPlaceholders) || null, v = !(s || "column" === r) && ((null == t3 ? void 0 : t3.minPlaceholder) || (null == t3 ? void 0 : t3.maxPlaceholder));
1250
- if (v) {
1251
- const e4 = i(h, m, null == t3 ? void 0 : t3.minPlaceholder, null == t3 ? void 0 : t3.maxPlaceholder, null !== (d = null == t3 ? void 0 : t3.extraOption) && void 0 !== d && d, false, n, "row");
1252
- e4.childElementCount > 0 && (p.classList.add("magicfeedback-rating-number-container--with-placeholder"), p.insertBefore(e4, p.firstChild));
3312
+ const l = i(t3, n);
3313
+ return l.childElementCount > 0 && a.appendChild(l), a;
3314
+ }, t2.createRatingNumberElement = function(e3, t3, i2, n, r, s, o) {
3315
+ var a, l;
3316
+ const d = document.createElement("div");
3317
+ d.classList.add("magicfeedback-rating-number");
3318
+ const c = "column" === n, u = "ltr" === i2 ? n : `${n}-reverse`, p = document.createElement("div");
3319
+ p.classList.add("magicfeedback-rating-number-container"), p.classList.add(`magicfeedback-rating-number-container-${i2}`), p.classList.add(`magicfeedback-rating-number-container-${n}`), p.style.display = "flex", p.style.flexDirection = u, p.setAttribute("role", "radiogroup"), p.setAttribute("aria-label", (null == t3 ? void 0 : t3.ariaLabel) || "Rating");
3320
+ const h = (null == t3 ? void 0 : t3.max) ? Number(null == t3 ? void 0 : t3.max) : 10, m = (null == t3 ? void 0 : t3.min) ? Number(null == t3 ? void 0 : t3.min) : 0;
3321
+ !c && h - m + 1 > 6 && p.classList.add("magicfeedback-rating-number-container-row--dense");
3322
+ const f = (null == t3 ? void 0 : t3.numberPlaceholders) || null, g = !(!f || !Object.keys(f).length);
3323
+ let v = null;
3324
+ if (!c && ((null == t3 ? void 0 : t3.minPlaceholder) || (null == t3 ? void 0 : t3.maxPlaceholder))) {
3325
+ v = document.createElement("div"), v.classList.add("magicfeedback-rating-number-scale-labels");
3326
+ const e4 = document.createElement("span");
3327
+ e4.classList.add("magicfeedback-rating-number-scale-label"), e4.textContent = null !== (a = null == t3 ? void 0 : t3.minPlaceholder) && void 0 !== a ? a : "";
3328
+ const n2 = document.createElement("span");
3329
+ n2.classList.add("magicfeedback-rating-number-scale-label"), n2.textContent = null !== (l = null == t3 ? void 0 : t3.maxPlaceholder) && void 0 !== l ? l : "", "ltr" === i2 ? (v.appendChild(e4), v.appendChild(n2)) : (v.appendChild(n2), v.appendChild(e4));
1253
3330
  }
1254
- for (let i2 = h; i2 <= m; i2++) {
1255
- const n2 = document.createElement("div");
1256
- n2.classList.add("magicfeedback-rating-number-option"), n2.classList.add(`magicfeedback-rating-number-option-${r}`);
1257
- const d2 = document.createElement("label");
1258
- d2.htmlFor = `rating-${e3}-${i2}`, d2.classList.add("magicfeedback-rating-number-option-label-container");
1259
- let c2 = i2.toString();
1260
- v ? f && f[i2] && !s && (d2.title = f[i2]) : f && f[i2] ? c2 += ` = ${f[i2]}` : i2 === h && (null == t3 ? void 0 : t3.minPlaceholder) ? c2 += ` = ${null == t3 ? void 0 : t3.minPlaceholder}` : i2 === m && (null == t3 ? void 0 : t3.maxPlaceholder) && (c2 += ` = ${null == t3 ? void 0 : t3.maxPlaceholder}`);
1261
- const u2 = document.createElement("input");
1262
- u2.id = `rating-${e3}-${i2}`, u2.type = "radio", u2.name = e3, u2.value = i2.toString(), u2.classList.add(a), u2.classList.add("magicfeedback-input"), u2.setAttribute("aria-label", `${i2}`), o && u2.addEventListener("change", (() => o())), l && l === u2.value && (u2.checked = true);
1263
- const g = document.createElement("label");
1264
- g.htmlFor = `rating-${e3}-${i2}`, g.textContent = c2, g.classList.add("magicfeedback-rating-number-value"), d2.appendChild(u2), d2.appendChild(g), n2.appendChild(d2), p.appendChild(n2);
3331
+ let y = null;
3332
+ if (c && !g && (p.classList.add("magicfeedback-rating-number-container-column--bare"), (null == t3 ? void 0 : t3.minPlaceholder) || (null == t3 ? void 0 : t3.maxPlaceholder))) {
3333
+ const e4 = "ltr" === i2 ? null == t3 ? void 0 : t3.minPlaceholder : null == t3 ? void 0 : t3.maxPlaceholder, n2 = "ltr" === i2 ? null == t3 ? void 0 : t3.maxPlaceholder : null == t3 ? void 0 : t3.minPlaceholder;
3334
+ if (e4) {
3335
+ const t4 = document.createElement("div");
3336
+ t4.classList.add("magicfeedback-rating-number-scale-label-block"), t4.textContent = e4, d.appendChild(t4);
3337
+ }
3338
+ n2 && (y = document.createElement("div"), y.classList.add("magicfeedback-rating-number-scale-label-block"), y.textContent = n2);
1265
3339
  }
1266
- if ((null == t3 ? void 0 : t3.extraOption) && (null == t3 ? void 0 : t3.extraOptionText)) {
1267
- const i2 = document.createElement("div");
1268
- i2.classList.add("magicfeedback-rating-number-option");
1269
- const r2 = document.createElement("label");
1270
- r2.htmlFor = `rating-${e3}-extra`, r2.classList.add("magicfeedback-rating-number-option-label-container");
1271
- const s2 = document.createElement("input");
1272
- s2.id = `rating-${e3}-extra`, s2.type = "radio", s2.name = e3, s2.value = "-", s2.classList.add(a), s2.classList.add("magicfeedback-input"), s2.setAttribute("aria-label", null == t3 ? void 0 : t3.extraOptionText), o && s2.addEventListener("change", (() => o()));
3340
+ for (let i3 = m; i3 <= h; i3++) {
3341
+ const a2 = document.createElement("div");
3342
+ a2.classList.add("magicfeedback-rating-number-option"), a2.classList.add(`magicfeedback-rating-number-option-${n}`);
1273
3343
  const l2 = document.createElement("label");
1274
- l2.htmlFor = `rating-${e3}-extra`, l2.textContent = null == t3 ? void 0 : t3.extraOptionText, l2.classList.add("magicfeedback-rating-number-value"), r2.appendChild(s2), r2.appendChild(l2), i2.appendChild(r2), "ltr" === n ? p.appendChild(i2) : p.insertBefore(i2, p.firstChild);
3344
+ l2.htmlFor = `rating-${e3}-${i3}`, l2.classList.add("magicfeedback-rating-number-option-label-container");
3345
+ const d2 = g && (f[i3] || (i3 === m ? null == t3 ? void 0 : t3.minPlaceholder : void 0) || (i3 === h ? null == t3 ? void 0 : t3.maxPlaceholder : void 0)), u2 = document.createElement("input");
3346
+ u2.id = `rating-${e3}-${i3}`, u2.type = "radio", u2.name = e3, u2.value = i3.toString(), u2.classList.add(r), u2.classList.add("magicfeedback-input"), u2.setAttribute("aria-label", d2 ? `${i3} \u2014 ${d2}` : `${i3}`), s && u2.addEventListener("change", (() => s())), o && o === u2.value && (u2.checked = true), l2.appendChild(u2);
3347
+ const v2 = document.createElement("span");
3348
+ v2.classList.add("magicfeedback-rating-number-value");
3349
+ const y2 = document.createElement("span");
3350
+ if (y2.textContent = i3.toString(), y2.classList.add("magicfeedback-rating-number-value-num"), v2.appendChild(y2), c) {
3351
+ if (d2) {
3352
+ const e4 = document.createElement("span");
3353
+ e4.textContent = d2, e4.classList.add("magicfeedback-rating-number-value-label"), v2.appendChild(e4);
3354
+ }
3355
+ } else f && f[i3] && (l2.title = f[i3]);
3356
+ l2.appendChild(v2), a2.appendChild(l2), p.appendChild(a2);
1275
3357
  }
1276
- return c.appendChild(p), c;
3358
+ if (d.appendChild(p), v && d.appendChild(v), y && d.appendChild(y), (null == t3 ? void 0 : t3.extraOption) && (null == t3 ? void 0 : t3.extraOptionText)) {
3359
+ const i3 = document.createElement("div");
3360
+ i3.classList.add("magicfeedback-rating-number-extra-row");
3361
+ const n2 = document.createElement("div");
3362
+ n2.classList.add("magicfeedback-rating-number-option"), n2.classList.add("magicfeedback-rating-number-option--extra");
3363
+ const o2 = document.createElement("label");
3364
+ o2.htmlFor = `rating-${e3}-extra`, o2.classList.add("magicfeedback-rating-number-option-label-container");
3365
+ const a2 = document.createElement("input");
3366
+ a2.id = `rating-${e3}-extra`, a2.type = "radio", a2.name = e3, a2.value = "-", a2.classList.add(r), a2.classList.add("magicfeedback-input"), a2.setAttribute("aria-label", null == t3 ? void 0 : t3.extraOptionText), s && a2.addEventListener("change", (() => s()));
3367
+ const l2 = document.createElement("span");
3368
+ l2.classList.add("magicfeedback-rating-number-value");
3369
+ const c2 = document.createElement("span");
3370
+ c2.textContent = null == t3 ? void 0 : t3.extraOptionText, c2.classList.add("magicfeedback-rating-number-value-label"), l2.appendChild(c2), o2.appendChild(a2), o2.appendChild(l2), n2.appendChild(o2), i3.appendChild(n2), d.appendChild(i3);
3371
+ }
3372
+ return d;
1277
3373
  };
1278
3374
  }, 42: (e2, t2, i) => {
1279
3375
  "use strict";
1280
3376
  Object.defineProperty(t2, "__esModule", { value: true }), t2.getQuestionRenderer = void 0;
1281
- const n = i(558), r = i(998), s = i(72), a = i(732), o = i(90), l = i(65), d = i(85), c = i(817), u = i(965), p = i(180), m = i(991), h = i(152), f = i(917), v = i(452), g = i(644), y = i(773), b = i(66), E = i(843), k = i(250), A = i(409), C = i(282), T = /* @__PURE__ */ new Map([[n.FEEDBACKAPPANSWERTYPE.TEXT, o.renderText], [n.FEEDBACKAPPANSWERTYPE.LONGTEXT, s.renderLongText], [n.FEEDBACKAPPANSWERTYPE.NUMBER, a.renderNumber], [n.FEEDBACKAPPANSWERTYPE.RADIO, r.renderChoice], [n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, r.renderChoice], [n.FEEDBACKAPPANSWERTYPE.BOOLEAN, l.renderBoolean], [n.FEEDBACKAPPANSWERTYPE.SELECT, d.renderSelect], [n.FEEDBACKAPPANSWERTYPE.DATE, c.renderDate], [n.FEEDBACKAPPANSWERTYPE.EMAIL, u.renderEmail], [n.FEEDBACKAPPANSWERTYPE.PASSWORD, p.renderPassword], [n.FEEDBACKAPPANSWERTYPE.CONSENT, m.renderConsent], [n.FEEDBACKAPPANSWERTYPE.RATING_EMOJI, h.renderRatingEmoji], [n.FEEDBACKAPPANSWERTYPE.RATING_NUMBER, f.renderRatingNumber], [n.FEEDBACKAPPANSWERTYPE.RATING_STAR, v.renderRatingStar], [n.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX, g.renderMatrix], [n.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST, y.renderPriorityList], [n.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM, b.renderPointSystem], [n.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE, E.renderUploadImage], [n.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE, k.renderUploadFile], [n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE, A.renderMultipleChoiceImage], [n.FEEDBACKAPPANSWERTYPE.INFO_PAGE, C.renderInfoPage]]);
3377
+ const n = i(558), r = i(998), s = i(72), o = i(732), a = i(90), l = i(65), d = i(85), c = i(817), u = i(965), p = i(180), h = i(991), m = i(152), f = i(917), g = i(452), v = i(644), y = i(773), b = i(66), E = i(843), A = i(250), k = i(409), C = i(282), T = /* @__PURE__ */ new Map([[n.FEEDBACKAPPANSWERTYPE.TEXT, a.renderText], [n.FEEDBACKAPPANSWERTYPE.LONGTEXT, s.renderLongText], [n.FEEDBACKAPPANSWERTYPE.NUMBER, o.renderNumber], [n.FEEDBACKAPPANSWERTYPE.RADIO, r.renderChoice], [n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, r.renderChoice], [n.FEEDBACKAPPANSWERTYPE.BOOLEAN, l.renderBoolean], [n.FEEDBACKAPPANSWERTYPE.SELECT, d.renderSelect], [n.FEEDBACKAPPANSWERTYPE.DATE, c.renderDate], [n.FEEDBACKAPPANSWERTYPE.EMAIL, u.renderEmail], [n.FEEDBACKAPPANSWERTYPE.PASSWORD, p.renderPassword], [n.FEEDBACKAPPANSWERTYPE.CONSENT, h.renderConsent], [n.FEEDBACKAPPANSWERTYPE.RATING_EMOJI, m.renderRatingEmoji], [n.FEEDBACKAPPANSWERTYPE.RATING_NUMBER, f.renderRatingNumber], [n.FEEDBACKAPPANSWERTYPE.RATING_STAR, g.renderRatingStar], [n.FEEDBACKAPPANSWERTYPE.MULTI_QUESTION_MATRIX, v.renderMatrix], [n.FEEDBACKAPPANSWERTYPE.PRIORITY_LIST, y.renderPriorityList], [n.FEEDBACKAPPANSWERTYPE.POINT_SYSTEM, b.renderPointSystem], [n.FEEDBACKAPPANSWERTYPE.UPLOAD_IMAGE, E.renderUploadImage], [n.FEEDBACKAPPANSWERTYPE.UPLOAD_FILE, A.renderUploadFile], [n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE, k.renderMultipleChoiceImage], [n.FEEDBACKAPPANSWERTYPE.INFO_PAGE, C.renderInfoPage]]);
1282
3378
  t2.getQuestionRenderer = function(e3) {
1283
3379
  return T.get(e3);
1284
3380
  };
@@ -1287,59 +3383,59 @@ var require_magicfeedback_sdk_browser = __commonJS({
1287
3383
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderBoolean = void 0;
1288
3384
  const n = i(516);
1289
3385
  t2.renderBoolean = ({ question: e3, language: t3, urlParamValue: i2, send: r }) => {
1290
- const { ref: s, assets: a } = e3, o = document.createElement("div"), l = "magicfeedback-radio", d = document.createElement("div");
1291
- return d.classList.add("magicfeedback-boolean-container"), d.style.display = "flex", d.style.flexDirection = "row", d.style.justifyContent = "space-between", d.style.width = "70%", d.style.margin = "auto", ((null == a ? void 0 : a.addIcon) ? ["\u{1F44D}", "\u{1F44E}"] : (0, n.getBooleanOptions)(t3)).forEach(((e4, t4) => {
3386
+ const { ref: s, assets: o } = e3, a = document.createElement("div"), l = "magicfeedback-radio", d = document.createElement("div");
3387
+ return d.classList.add("magicfeedback-boolean-container"), d.style.display = "flex", d.style.flexDirection = "row", d.style.justifyContent = "space-between", d.style.width = "70%", d.style.margin = "auto", ((null == o ? void 0 : o.addIcon) ? ["\u{1F44D}", "\u{1F44E}"] : (0, n.getBooleanOptions)(t3)).forEach(((e4, t4) => {
1292
3388
  const n2 = document.createElement("label");
1293
3389
  n2.classList.add("magicfeedback-boolean-option"), n2.htmlFor = `rating-${s}-${t4}`, n2.style.cursor = "pointer", n2.style.display = "flex", n2.style.justifyContent = "center", n2.style.alignItems = "center", n2.style.margin = "auto", n2.style.padding = "0", n2.style.width = "45%", n2.style.height = "38px";
1294
- const a2 = document.createElement("label");
1295
- a2.htmlFor = `rating-${s}-${t4}`, a2.textContent = e4, a2.style.margin = "0", a2.style.padding = "0";
1296
- const o2 = document.createElement("input");
1297
- o2.id = `rating-${s}-${t4}`, o2.type = "radio", o2.name = s, o2.value = ["Yes", "No"][t4], o2.classList.add(l), o2.classList.add("magicfeedback-input"), o2.style.position = "absolute", o2.style.opacity = "0", o2.style.width = "0", o2.style.height = "0", o2.style.margin = "0", o2.addEventListener("change", (() => {
3390
+ const o2 = document.createElement("label");
3391
+ o2.htmlFor = `rating-${s}-${t4}`, o2.textContent = e4, o2.style.margin = "0", o2.style.padding = "0";
3392
+ const a2 = document.createElement("input");
3393
+ a2.id = `rating-${s}-${t4}`, a2.type = "radio", a2.name = s, a2.value = ["Yes", "No"][t4], a2.classList.add(l), a2.classList.add("magicfeedback-input"), a2.style.position = "absolute", a2.style.opacity = "0", a2.style.width = "0", a2.style.height = "0", a2.style.margin = "0", a2.addEventListener("change", (() => {
1298
3394
  r && r();
1299
- })), i2 && i2.toLowerCase() === o2.value.toLowerCase() && (o2.checked = true), n2.appendChild(o2), n2.appendChild(a2), d.appendChild(n2);
1300
- })), o.appendChild(d), { element: o, elementTypeClass: l };
3395
+ })), i2 && i2.toLowerCase() === a2.value.toLowerCase() && (a2.checked = true), n2.appendChild(a2), n2.appendChild(o2), d.appendChild(n2);
3396
+ })), a.appendChild(d), { element: a, elementTypeClass: l };
1301
3397
  };
1302
3398
  }, 998: (e2, t2, i) => {
1303
3399
  "use strict";
1304
3400
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderChoice = void 0;
1305
3401
  const n = i(558), r = i(784);
1306
- t2.renderChoice = ({ question: e3, language: t3, urlParamValue: i2, randomPosition: s, send: a }) => {
1307
- const { type: o, ref: l, value: d, defaultValue: c, assets: u } = e3, p = document.createElement("div"), m = "magicfeedback-" + ("MULTIPLECHOICE" === o ? "checkbox" : "radio");
1308
- let h = d || [];
1309
- s && (h = h.sort((() => Math.random() - 0.5)));
3402
+ t2.renderChoice = ({ question: e3, language: t3, urlParamValue: i2, randomPosition: s, send: o }) => {
3403
+ const { type: a, ref: l, value: d, defaultValue: c, assets: u } = e3, p = document.createElement("div"), h = "magicfeedback-" + ("MULTIPLECHOICE" === a ? "checkbox" : "radio");
3404
+ let m = d || [];
3405
+ s && (m = m.sort((() => Math.random() - 0.5)));
1310
3406
  let f = (null == u ? void 0 : u.exclusiveAnswers) || [];
1311
3407
  (null == u ? void 0 : u.extraOption) && (f = f.filter(((e4) => e4 !== u.extraOptionText))), f.length > 0 && (null == f || f.forEach(((e4) => {
1312
- h.includes(e4) || h.push(e4);
3408
+ m.includes(e4) || m.push(e4);
1313
3409
  })));
1314
- const v = null == u ? void 0 : u.extraOptionText;
1315
- return (null == u ? void 0 : u.extraOption) && v && !h.includes(v) && h.push(v), h.forEach(((e4, s2) => {
3410
+ const g = null == u ? void 0 : u.extraOptionText;
3411
+ return (null == u ? void 0 : u.extraOption) && g && !m.includes(g) && m.push(g), m.forEach(((e4, s2) => {
1316
3412
  const d2 = document.createElement("div");
1317
- d2.classList.add(`magicfeedback-${"MULTIPLECHOICE" === o ? "checkbox" : "radio"}-container`);
1318
- const v2 = document.createElement("label"), g = document.createElement("input");
1319
- if (g.id = `rating-${l}-${s2}`, g.type = "MULTIPLECHOICE" === o ? "checkbox" : "radio", g.name = l, g.value = e4, g.classList.add(m), g.classList.add("magicfeedback-input"), o === n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE && (null == u ? void 0 : u.maxOptions) && (null == u ? void 0 : u.maxOptions) > 0 && g.addEventListener("change", (() => {
1320
- document.querySelectorAll(`input[name="${l}"]:checked`).length > (null == u ? void 0 : u.maxOptions) && (g.checked = false);
1321
- })), o === n.FEEDBACKAPPANSWERTYPE.RADIO && a && (!(null == u ? void 0 : u.extraOptionText) || (null == u ? void 0 : u.extraOptionText) && e4 !== (null == u ? void 0 : u.extraOptionText)) && g.addEventListener("change", (() => {
1322
- a();
1323
- })), e4 !== c && e4 !== i2 || (g.checked = true), v2.textContent = e4, v2.htmlFor = `rating-${l}-${s2}`, g.addEventListener("change", ((t4) => {
3413
+ d2.classList.add(`magicfeedback-${"MULTIPLECHOICE" === a ? "checkbox" : "radio"}-container`);
3414
+ const g2 = document.createElement("label"), v = document.createElement("input");
3415
+ if (v.id = `rating-${l}-${s2}`, v.type = "MULTIPLECHOICE" === a ? "checkbox" : "radio", v.name = l, v.value = e4, v.classList.add(h), v.classList.add("magicfeedback-input"), a === n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE && (null == u ? void 0 : u.maxOptions) && (null == u ? void 0 : u.maxOptions) > 0 && v.addEventListener("change", (() => {
3416
+ document.querySelectorAll(`input[name="${l}"]:checked`).length > (null == u ? void 0 : u.maxOptions) && (v.checked = false);
3417
+ })), a === n.FEEDBACKAPPANSWERTYPE.RADIO && o && (!(null == u ? void 0 : u.extraOptionText) || (null == u ? void 0 : u.extraOptionText) && e4 !== (null == u ? void 0 : u.extraOptionText)) && v.addEventListener("change", (() => {
3418
+ o();
3419
+ })), e4 !== c && e4 !== i2 || (v.checked = true), g2.textContent = e4, g2.htmlFor = `rating-${l}-${s2}`, v.addEventListener("change", ((t4) => {
1324
3420
  const i3 = document.getElementById(`extra-option-${l}`);
1325
- t4.target.checked && f.includes(e4) ? (h.forEach(((t5) => {
3421
+ t4.target.checked && f.includes(e4) ? (m.forEach(((t5) => {
1326
3422
  t5 !== e4 && (document.querySelector(`input[value="${t5}"]`).checked = false);
1327
3423
  })), i3 && (i3.style.display = "none")) : f.forEach(((t5) => {
1328
3424
  t5 !== e4 && (document.querySelector(`input[value="${t5}"]`).checked = false);
1329
3425
  })), (null == u ? void 0 : u.extraOption) && e4 === (null == u ? void 0 : u.extraOptionText) && i3 && (i3.style.display = t4.target.checked ? "block" : "none");
1330
- })), d2.appendChild(g), d2.appendChild(v2), p.appendChild(d2), (null == u ? void 0 : u.extraOption) && e4 === (null == u ? void 0 : u.extraOptionText)) {
3426
+ })), d2.appendChild(v), d2.appendChild(g2), p.appendChild(d2), (null == u ? void 0 : u.extraOption) && e4 === (null == u ? void 0 : u.extraOptionText)) {
1331
3427
  const e5 = document.createElement("input");
1332
3428
  e5.type = "text", e5.placeholder = (null == u ? void 0 : u.extraOptionPlaceholder) || r.placeholder.answer(t3 || "en"), e5.classList.add("magicfeedback-extra-option"), e5.classList.add("magicfeedback-input"), e5.id = `extra-option-${l}`, e5.name = `extra-option-${l}`, e5.style.display = "none", p.appendChild(e5);
1333
3429
  }
1334
- })), { element: p, elementTypeClass: m };
3430
+ })), { element: p, elementTypeClass: h };
1335
3431
  };
1336
3432
  }, 991: (e2, t2) => {
1337
3433
  "use strict";
1338
3434
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderConsent = void 0, t2.renderConsent = ({ question: e3, urlParamValue: t3, send: i }) => {
1339
- const { id: n, ref: r, value: s, require: a } = e3, o = document.createElement("input");
1340
- return o.type = "checkbox", o.id = `magicfeedback-${n}`, o.name = r, o.value = "true", o.required = a, o.classList.add("magicfeedback-consent"), o.classList.add("magicfeedback-input"), t3 && s.includes(t3) && (o.checked = true), i && o.addEventListener("change", (() => {
3435
+ const { id: n, ref: r, value: s, require: o } = e3, a = document.createElement("input");
3436
+ return a.type = "checkbox", a.id = `magicfeedback-${n}`, a.name = r, a.value = "true", a.required = o, a.classList.add("magicfeedback-consent"), a.classList.add("magicfeedback-input"), t3 && s.includes(t3) && (a.checked = true), i && a.addEventListener("change", (() => {
1341
3437
  i();
1342
- })), { element: o, elementTypeClass: "magicfeedback-consent" };
3438
+ })), { element: a, elementTypeClass: "magicfeedback-consent" };
1343
3439
  };
1344
3440
  }, 817: (e2, t2, i) => {
1345
3441
  "use strict";
@@ -1377,8 +3473,8 @@ var require_magicfeedback_sdk_browser = __commonJS({
1377
3473
  }, 644: (e2, t2) => {
1378
3474
  "use strict";
1379
3475
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderMatrix = void 0, t2.renderMatrix = ({ question: e3, isPhone: t3, randomPosition: i }) => {
1380
- const { ref: n, value: r, assets: s } = e3, a = document.createElement("div"), o = document.createElement("div");
1381
- o.classList.add("magicfeedback-multi-question-matrix-container");
3476
+ const { ref: n, value: r, assets: s } = e3, o = document.createElement("div"), a = document.createElement("div");
3477
+ a.classList.add("magicfeedback-multi-question-matrix-container");
1382
3478
  let l = (null == s ? void 0 : s.options) || [], d = [...r], c = [];
1383
3479
  if (i && (l = null == l ? void 0 : l.sort((() => Math.random() - 0.5)), d = [...d].sort((() => Math.random() - 0.5))), (null == s ? void 0 : s.exclusiveAnswers) && (c = null == s ? void 0 : s.exclusiveAnswers, null == c || c.forEach(((e4) => {
1384
3480
  d.includes(e4) || d.push(e4);
@@ -1391,10 +3487,10 @@ var require_magicfeedback_sdk_browser = __commonJS({
1391
3487
  r2.classList.add("magicfeedback-multi-question-matrix-label"), r2.style.paddingBottom = "10px", r2.textContent = t4, i2.appendChild(r2), d.forEach(((e5) => {
1392
3488
  const r3 = document.createElement("div");
1393
3489
  r3.classList.add("magicfeedback-radio-container"), r3.style.display = "flex", r3.style.alignItems = "center", r3.style.justifyContent = "flex-start", r3.style.width = "99%", r3.style.margin = "5px auto";
1394
- const s2 = document.createElement("label"), a2 = document.createElement("input");
1395
- a2.id = `${n}-${t4}-${e5}`, a2.type = "radio", a2.name = `${n}-${t4}`, a2.value = e5, a2.classList.add("magicfeedback-input"), s2.textContent = e5, s2.htmlFor = `${n}-${t4}-${e5}`, r3.appendChild(a2), r3.appendChild(s2), i2.appendChild(r3);
3490
+ const s2 = document.createElement("label"), o2 = document.createElement("input");
3491
+ o2.id = `${n}-${t4}-${e5}`, o2.type = "radio", o2.name = `${n}-${t4}`, o2.value = e5, o2.classList.add("magicfeedback-input"), s2.textContent = e5, s2.htmlFor = `${n}-${t4}-${e5}`, r3.appendChild(o2), r3.appendChild(s2), i2.appendChild(r3);
1396
3492
  })), e4.appendChild(i2);
1397
- })), o.appendChild(e4);
3493
+ })), a.appendChild(e4);
1398
3494
  } else {
1399
3495
  const e4 = document.createElement("table");
1400
3496
  e4.classList.add("magicfeedback-multi-question-matrix-table");
@@ -1416,18 +3512,18 @@ var require_magicfeedback_sdk_browser = __commonJS({
1416
3512
  const r4 = document.createElement("td"), s3 = document.createElement("input");
1417
3513
  s3.type = "radio", s3.name = `${n}-${e5}`, s3.value = i4, s3.id = `${n}-${e5}-${i4}`, s3.classList.add("magicfeedback-input"), r4.appendChild(s3), t5.appendChild(r4);
1418
3514
  })), s2.appendChild(t5);
1419
- })), e4.appendChild(s2), o.appendChild(e4);
3515
+ })), e4.appendChild(s2), a.appendChild(e4);
1420
3516
  }
1421
- return a.appendChild(o), { element: a, elementTypeClass: "magicfeedback-multi-question-matrix" };
3517
+ return o.appendChild(a), { element: o, elementTypeClass: "magicfeedback-multi-question-matrix" };
1422
3518
  };
1423
3519
  }, 409: (e2, t2) => {
1424
3520
  "use strict";
1425
3521
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderMultipleChoiceImage = void 0, t2.renderMultipleChoiceImage = ({ question: e3, randomPosition: t3, urlParamValue: i, send: n }) => {
1426
- const r = document.createElement("div"), { ref: s, assets: a } = e3;
1427
- let o = [...e3.value];
3522
+ const r = document.createElement("div"), { ref: s, assets: o } = e3;
3523
+ let a = [...e3.value];
1428
3524
  const l = document.createElement("div");
1429
3525
  l.classList.add("magicfeedback-multiple-choice-image-container"), l.style.display = "flex", l.style.flexDirection = "row", l.style.flexWrap = "wrap", l.style.justifyContent = "center";
1430
- const d = o.length;
3526
+ const d = a.length;
1431
3527
  let c = 1, u = 1;
1432
3528
  if (window.innerWidth < 600) c = 1, u = d;
1433
3529
  else switch (d) {
@@ -1449,38 +3545,38 @@ var require_magicfeedback_sdk_browser = __commonJS({
1449
3545
  default:
1450
3546
  u = 4, c = Math.ceil(d / u);
1451
3547
  }
1452
- const p = void 0 !== (null == a ? void 0 : a.addTitle) && (null == a ? void 0 : a.addTitle), m = void 0 !== (null == a ? void 0 : a.multiOption) && (null == a ? void 0 : a.multiOption), h = void 0 !== (null == a ? void 0 : a.extraOption) && (null == a ? void 0 : a.extraOption);
3548
+ const p = void 0 !== (null == o ? void 0 : o.addTitle) && (null == o ? void 0 : o.addTitle), h = void 0 !== (null == o ? void 0 : o.multiOption) && (null == o ? void 0 : o.multiOption), m = void 0 !== (null == o ? void 0 : o.extraOption) && (null == o ? void 0 : o.extraOption);
1453
3549
  function f(e4) {
1454
3550
  try {
1455
- const { position: t4, url: r2, value: a2 } = e4, o2 = document.createElement("div");
1456
- o2.classList.add("magicfeedback-multiple-choice-image-option"), o2.style.width = `calc(100% / ${c} - 2px)`, o2.style.height = `calc(100% / ${u} - 2px)`, o2.style.padding = "8px", o2.style.margin = "0";
3551
+ const { position: t4, url: r2, value: o2 } = e4, a2 = document.createElement("div");
3552
+ a2.classList.add("magicfeedback-multiple-choice-image-option"), a2.style.width = `calc(100% / ${c} - 2px)`, a2.style.height = `calc(100% / ${u} - 2px)`, a2.style.padding = "8px", a2.style.margin = "0";
1457
3553
  const d2 = document.createElement("label");
1458
3554
  d2.classList.add("magicfeedback-image-option-label-container"), d2.htmlFor = `rating-${s}-${t4}`, d2.style.cursor = "pointer", d2.addEventListener("click", (() => {
1459
3555
  d2.style.border = "2px solid #000";
1460
3556
  }));
1461
- const h2 = document.createElement("label");
1462
- h2.textContent = a2, h2.classList.add("magicfeedback-multiple-choice-image-label");
3557
+ const m2 = document.createElement("label");
3558
+ m2.textContent = o2, m2.classList.add("magicfeedback-multiple-choice-image-label");
1463
3559
  const f2 = document.createElement("input");
1464
- f2.id = `rating-${s}-${t4}`, f2.type = m ? "checkbox" : "radio", f2.name = s, f2.value = a2, f2.style.position = "absolute", f2.style.opacity = "0", f2.style.width = "0", f2.style.height = "0", f2.classList.add("magicfeedback-input"), i && i === f2.value && (f2.checked = true), !m && n && f2.addEventListener("change", (() => {
3560
+ f2.id = `rating-${s}-${t4}`, f2.type = h ? "checkbox" : "radio", f2.name = s, f2.value = o2, f2.style.position = "absolute", f2.style.opacity = "0", f2.style.width = "0", f2.style.height = "0", f2.classList.add("magicfeedback-input"), i && i === f2.value && (f2.checked = true), !h && n && f2.addEventListener("change", (() => {
1465
3561
  n();
1466
3562
  }));
1467
- const v = document.createElement("img");
1468
- v.classList.add("magicfeedback-multiple-choice-image-image"), v.src = r2, v.style.cursor = "pointer", v.style.backgroundSize = "cover", v.style.backgroundPosition = "center", v.style.width = "100%", v.style.height = "100%", v.style.objectFit = "cover", v.style.margin = "auto", d2.appendChild(f2), d2.appendChild(v), p && d2.appendChild(h2), o2.appendChild(d2), l.appendChild(o2);
3563
+ const g = document.createElement("img");
3564
+ g.classList.add("magicfeedback-multiple-choice-image-image"), g.src = r2, g.style.cursor = "pointer", g.style.backgroundSize = "cover", g.style.backgroundPosition = "center", g.style.width = "100%", g.style.height = "100%", g.style.objectFit = "cover", g.style.margin = "auto", d2.appendChild(f2), d2.appendChild(g), p && d2.appendChild(m2), a2.appendChild(d2), l.appendChild(a2);
1469
3565
  } catch (e5) {
1470
3566
  console.error(e5);
1471
3567
  }
1472
3568
  }
1473
- return t3 && (o = o.sort((() => Math.random() - 0.5))), o.forEach(((e4) => f(JSON.parse(e4)))), h && (null == a ? void 0 : a.extraOptionValue) && (null == a ? void 0 : a.extraOptionValue.length) > 0 && f(null == a ? void 0 : a.extraOptionValue[0]), r.appendChild(l), { element: r, elementTypeClass: "magicfeedback-multiple-choice-image" };
3569
+ return t3 && (a = a.sort((() => Math.random() - 0.5))), a.forEach(((e4) => f(JSON.parse(e4)))), m && (null == o ? void 0 : o.extraOptionValue) && (null == o ? void 0 : o.extraOptionValue.length) > 0 && f(null == o ? void 0 : o.extraOptionValue[0]), r.appendChild(l), { element: r, elementTypeClass: "magicfeedback-multiple-choice-image" };
1474
3570
  };
1475
3571
  }, 732: (e2, t2, i) => {
1476
3572
  "use strict";
1477
3573
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderNumber = void 0;
1478
3574
  const n = i(784), r = i(516);
1479
3575
  t2.renderNumber = ({ question: e3, format: t3, language: i2, urlParamValue: s }) => {
1480
- const a = document.createElement("input");
1481
- a.type = "number", a.placeholder = "slim" === t3 ? (0, r.parseTitle)(e3.title, i2) : n.placeholder.number(i2 || "en");
1482
- const { value: o } = e3;
1483
- return o.length && (o.sort(((e4, t4) => Number(e4) - Number(t4))), a.max = o[o.length - 1], a.min = o[0], a.value = o[0]), s && !isNaN(Number(s)) && (a.value = s), { element: a, elementTypeClass: "magicfeedback-number" };
3576
+ const o = document.createElement("input");
3577
+ o.type = "number", o.placeholder = "slim" === t3 ? (0, r.parseTitle)(e3.title, i2) : n.placeholder.number(i2 || "en");
3578
+ const { value: a } = e3;
3579
+ return a.length && (a.sort(((e4, t4) => Number(e4) - Number(t4))), o.max = a[a.length - 1], o.min = a[0], o.value = a[0]), s && !isNaN(Number(s)) && (o.value = s), { element: o, elementTypeClass: "magicfeedback-number" };
1484
3580
  };
1485
3581
  }, 180: (e2, t2, i) => {
1486
3582
  "use strict";
@@ -1495,10 +3591,10 @@ var require_magicfeedback_sdk_browser = __commonJS({
1495
3591
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderPointSystem = void 0;
1496
3592
  const n = i(784);
1497
3593
  t2.renderPointSystem = ({ question: e3, language: t3 }) => {
1498
- const { ref: i2, value: r } = e3, s = document.createElement("div"), a = document.createElement("div");
1499
- a.classList.add("magicfeedback-point-system-container");
1500
- const o = document.createElement("ul");
1501
- o.classList.add("magicfeedback-point-system-list"), o.style.padding = "0";
3594
+ const { ref: i2, value: r } = e3, s = document.createElement("div"), o = document.createElement("div");
3595
+ o.classList.add("magicfeedback-point-system-container");
3596
+ const a = document.createElement("ul");
3597
+ a.classList.add("magicfeedback-point-system-list"), a.style.padding = "0";
1502
3598
  const l = 100 / r.length, d = document.createElement("div");
1503
3599
  d.classList.add("magicfeedback-error"), d.textContent = n.placeholder.pointsystemerror(t3 || "en"), d.style.color = "#C70039", d.style.fontSize = "14px", d.style.textAlign = "right", d.style.width = "100%", d.style.display = "none";
1504
3600
  const c = document.createElement("div");
@@ -1509,108 +3605,108 @@ var require_magicfeedback_sdk_browser = __commonJS({
1509
3605
  r2.textContent = e4, r2.style.fontSize = "15px", n2.appendChild(r2);
1510
3606
  const s2 = document.createElement("span");
1511
3607
  s2.classList.add("magicfeedback-point-system-input-container");
1512
- const a2 = document.createElement("input");
1513
- a2.name = i2, a2.id = `${e4}`, a2.type = "number", a2.min = "0", a2.max = "100", a2.value = "0", a2.classList.add("magicfeedback-input"), a2.style.width = "40px", a2.style.border = "0", a2.style.textAlign = "center", a2.style.margin = "0 5px", a2.autofocus = 0 === t4;
3608
+ const o2 = document.createElement("input");
3609
+ o2.name = i2, o2.id = `${e4}`, o2.type = "number", o2.min = "0", o2.max = "100", o2.value = "0", o2.classList.add("magicfeedback-input"), o2.style.width = "40px", o2.style.border = "0", o2.style.textAlign = "center", o2.style.margin = "0 5px", o2.autofocus = 0 === t4;
1514
3610
  const u = document.createElement("span");
1515
- u.textContent = "%", u.style.color = "#000", a2.addEventListener("input", (() => {
1516
- const e5 = o.querySelectorAll("input");
3611
+ u.textContent = "%", u.style.color = "#000", o2.addEventListener("input", (() => {
3612
+ const e5 = a.querySelectorAll("input");
1517
3613
  let t5 = 0;
1518
3614
  e5.forEach(((e6) => {
1519
3615
  t5 += Number(e6.value);
1520
- })), t5 > 100 && (a2.value = `${l}%`, t5 -= Number(a2.value));
3616
+ })), t5 > 100 && (o2.value = `${l}%`, t5 -= Number(o2.value));
1521
3617
  const i3 = document.getElementById("magicfeedback-submit");
1522
3618
  i3 && (t5 < 100 ? (c.style.color = "orange", i3.setAttribute("disabled", "true")) : (d.style.display = "none", c.style.color = "green", i3.removeAttribute("disabled"))), c.textContent = `${t5} / 100 %`;
1523
- })), a2.addEventListener("focus", (() => {
3619
+ })), o2.addEventListener("focus", (() => {
1524
3620
  const e5 = document.getElementById("magicfeedback-submit");
1525
3621
  e5 && (e5.setAttribute("disabled", "true"), e5.addEventListener("pointerover", (() => {
1526
- const e6 = o.querySelectorAll("input");
3622
+ const e6 = a.querySelectorAll("input");
1527
3623
  let t5 = 0;
1528
3624
  e6.forEach(((e7) => {
1529
3625
  t5 += Number(e7.value);
1530
3626
  })), t5 < 100 && (d.style.display = "block");
1531
3627
  })));
1532
- })), s2.appendChild(a2), s2.appendChild(u), n2.appendChild(s2), o.appendChild(n2);
1533
- })), a.appendChild(o), a.appendChild(c), a.appendChild(d), s.appendChild(a), { element: s, elementTypeClass: "magicfeedback-point-system" };
3628
+ })), s2.appendChild(o2), s2.appendChild(u), n2.appendChild(s2), a.appendChild(n2);
3629
+ })), o.appendChild(a), o.appendChild(c), o.appendChild(d), s.appendChild(o), { element: s, elementTypeClass: "magicfeedback-point-system" };
1534
3630
  };
1535
3631
  }, 773: (e2, t2) => {
1536
3632
  "use strict";
1537
3633
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderPriorityList = void 0, t2.renderPriorityList = ({ question: e3, randomPosition: t3, language: i }) => {
1538
3634
  var n, r, s;
1539
- const a = document.createElement("div"), o = (function(e4) {
1540
- const { value: t4, ref: i2, randomPosition: n2 = false, limitPriority: r2 = false, maxPriority: s2 = 0, language: a2 = "en", placeholder: o2 = "" } = e4, l = (e5) => {
3635
+ const o = document.createElement("div"), a = (function(e4) {
3636
+ const { value: t4, ref: i2, randomPosition: n2 = false, limitPriority: r2 = false, maxPriority: s2 = 0, language: o2 = "en", placeholder: a2 = "" } = e4, l = (e5) => {
1541
3637
  const t5 = { en: { selectUpTo: "Select up to", options: "options", thenOrder: "and then order them", selectOptions: "Select options", cancel: "Cancel", confirm: "Confirm", selectOptionNumber: "Select option #", prioritized: "Prioritized", of: "of", instruction: "Your priority list can be seen below. If you wish, you can rearrange your choices using the arrows. Click 'Next' to confirm your selection and proceed." }, es: { selectUpTo: "Selecciona hasta", options: "opciones", thenOrder: "y luego ord\xE9nalas", selectOptions: "Seleccionar opciones", cancel: "Cancelar", confirm: "Confirmar", selectOptionNumber: "Selecciona la opci\xF3n #", prioritized: "Priorizadas", of: "de", instruction: 'Tu lista priorizada se muestra abajo. Si deseas, puedes reordenar las opciones con las flechas. Haz clic en "Siguiente" para confirmar y continuar.' }, pt: { selectUpTo: "Selecione at\xE9", options: "op\xE7\xF5es", thenOrder: "e depois ordene-as", selectOptions: "Selecionar op\xE7\xF5es", cancel: "Cancelar", confirm: "Confirmar", selectOptionNumber: "Selecione a op\xE7\xE3o #", prioritized: "Priorizadas", of: "de", instruction: 'Sua lista de prioridades pode ser vista abaixo. Se quiser, voc\xEA pode reorganizar suas escolhas usando as setas. Clique em "Pr\xF3ximo" para confirmar sua sele\xE7\xE3o e continuar.' }, fr: { selectUpTo: "S\xE9lectionnez jusqu'\xE0", options: "options", thenOrder: "puis classez-les", selectOptions: "S\xE9lectionner des options", cancel: "Annuler", confirm: "Confirmer", selectOptionNumber: "S\xE9lectionnez l'option #", prioritized: "Prioris\xE9es", of: "sur", instruction: `Votre liste de priorit\xE9s est affich\xE9e ci-dessous. Si vous le souhaitez, vous pouvez r\xE9organiser vos choix \xE0 l'aide des fl\xE8ches. Cliquez sur "Suivant" pour confirmer votre s\xE9lection et continuer.` }, de: { selectUpTo: "W\xE4hlen Sie bis zu", options: "Optionen", thenOrder: "und ordnen Sie sie dann", selectOptions: "Optionen ausw\xE4hlen", cancel: "Abbrechen", confirm: "Best\xE4tigen", selectOptionNumber: "W\xE4hlen Sie Option #", prioritized: "Priorisiert", of: "von", instruction: 'Ihre Priorit\xE4tenliste wird unten angezeigt. Wenn Sie m\xF6chten, k\xF6nnen Sie Ihre Auswahl mit den Pfeilen neu anordnen. Klicken Sie auf "Weiter", um Ihre Auswahl zu best\xE4tigen und fortzufahren.' }, it: { selectUpTo: "Seleziona fino a", options: "opzioni", thenOrder: "e poi ordinali", selectOptions: "Seleziona opzioni", cancel: "Annulla", confirm: "Conferma", selectOptionNumber: "Seleziona opzione #", prioritized: "Prioritizzate", of: "di", instruction: 'La tua lista di priorit\xE0 \xE8 mostrata qui sotto. Se vuoi, puoi riordinare le tue scelte usando le frecce. Clicca su "Avanti" per confermare la selezione e continuare.' }, nl: { selectUpTo: "Selecteer tot", options: "opties", thenOrder: "en rangschik ze vervolgens", selectOptions: "Selecteer opties", cancel: "Annuleren", confirm: "Bevestigen", selectOptionNumber: "Selecteer optie #", prioritized: "Geprioriteerd", of: "van", instruction: 'Je prioriteitenlijst wordt hieronder weergegeven. Als je wilt, kun je je keuzes herschikken met behulp van de pijlen. Klik op "Volgende" om je selectie te bevestigen en door te gaan.' }, pl: { selectUpTo: "Wybierz do", options: "opcje", thenOrder: "a nast\u0119pnie je uporz\u0105dkuj", selectOptions: "Wybierz opcje", cancel: "Anuluj", confirm: "Potwierd\u017A", selectOptionNumber: "Wybierz opcj\u0119 #", prioritized: "Priorytetowe", of: "z", instruction: 'Twoja lista priorytet\xF3w jest pokazana poni\u017Cej. Je\u015Bli chcesz, mo\u017Cesz zmieni\u0107 kolejno\u015B\u0107 swoich wybor\xF3w za pomoc\u0105 strza\u0142ek. Kliknij "Dalej", aby potwierdzi\u0107 wyb\xF3r i kontynuowa\u0107.' }, ru: { selectUpTo: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u043E", options: "\u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432", thenOrder: "\u0430 \u0437\u0430\u0442\u0435\u043C \u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u044C\u0442\u0435 \u0438\u0445", selectOptions: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u044B", cancel: "\u041E\u0442\u043C\u0435\u043D\u0430", confirm: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C", selectOptionNumber: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 #", prioritized: "\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u044B", of: "\u0438\u0437", instruction: '\u0412\u0430\u0448 \u0441\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u043E\u0432 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0438\u0436\u0435. \u0415\u0441\u043B\u0438 \u0445\u043E\u0442\u0438\u0442\u0435, \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0440\u044F\u0434\u043E\u043A \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u043E\u0432 \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0441\u0442\u0440\u0435\u043B\u043E\u043A. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 "\u0414\u0430\u043B\u0435\u0435", \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440 \u0438 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C.' }, ja: { selectUpTo: "\u6700\u5927", options: "\u500B\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E", thenOrder: "\u305D\u306E\u5F8C\u4E26\u3079\u66FF\u3048\u3066\u304F\u3060\u3055\u3044", selectOptions: "\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E", cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB", confirm: "\u78BA\u8A8D", selectOptionNumber: "\u30AA\u30D7\u30B7\u30E7\u30F3 # \u3092\u9078\u629E", prioritized: "\u512A\u5148\u9806\u4F4D", of: "\u306E\u3046\u3061", instruction: "\u512A\u5148\u9806\u4F4D\u30EA\u30B9\u30C8\u306F\u4EE5\u4E0B\u306B\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u3001\u77E2\u5370\u3092\u4F7F\u3063\u3066\u9078\u629E\u80A2\u3092\u4E26\u3079\u66FF\u3048\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u300C\u6B21\u3078\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9078\u629E\u3092\u78BA\u5B9A\u3057\u3001\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002" }, zh: { selectUpTo: "\u6700\u591A\u9009\u62E9", options: "\u4E2A\u9009\u9879", thenOrder: "\u7136\u540E\u6392\u5E8F\u5B83\u4EEC", selectOptions: "\u9009\u62E9\u9009\u9879", cancel: "\u53D6\u6D88", confirm: "\u786E\u8BA4", selectOptionNumber: "\u9009\u62E9\u9009\u9879 #", prioritized: "\u5DF2\u4F18\u5148", of: "\u5171", instruction: "\u4F60\u7684\u4F18\u5148\u5217\u8868\u5982\u4E0B\u6240\u793A\u3002\u5982\u6709\u9700\u8981\uFF0C\u53EF\u4EE5\u4F7F\u7528\u7BAD\u5934\u91CD\u65B0\u6392\u5E8F\u9009\u9879\u3002\u70B9\u51FB\u201C\u4E0B\u4E00\u6B65\u201D\u786E\u8BA4\u9009\u62E9\u5E76\u7EE7\u7EED\u3002" }, ko: { selectUpTo: "\uCD5C\uB300", options: "\uAC1C\uC758 \uC635\uC158 \uC120\uD0DD", thenOrder: "\uADF8\uB7F0 \uB2E4\uC74C \uC815\uB82C\uD558\uC138\uC694", selectOptions: "\uC635\uC158 \uC120\uD0DD", cancel: "\uCDE8\uC18C", confirm: "\uD655\uC778", selectOptionNumber: "\uC635\uC158 # \uC120\uD0DD", prioritized: "\uC6B0\uC120\uC21C\uC704", of: "\uC911", instruction: '\uC6B0\uC120\uC21C\uC704 \uBAA9\uB85D\uC740 \uC544\uB798\uC5D0 \uD45C\uC2DC\uB429\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uD654\uC0B4\uD45C\uB97C \uC0AC\uC6A9\uD574 \uC120\uD0DD \uD56D\uBAA9\uC744 \uC7AC\uC815\uB82C\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. "\uB2E4\uC74C"\uC744 \uD074\uB9AD\uD558\uC5EC \uC120\uD0DD\uC744 \uD655\uC778\uD558\uACE0 \uACC4\uC18D\uD558\uC138\uC694.' }, ar: { selectUpTo: "\u0627\u062E\u062A\u0631 \u062D\u062A\u0649", options: "\u062E\u064A\u0627\u0631\u0627\u062A", thenOrder: "\u062B\u0645 \u0631\u062A\u0628\u0647\u0627", selectOptions: "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A", cancel: "\u0625\u0644\u063A\u0627\u0621", confirm: "\u062A\u0623\u0643\u064A\u062F", selectOptionNumber: "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631 #", prioritized: "\u062A\u0645 \u0627\u0644\u062A\u0631\u062A\u064A\u0628", of: "\u0645\u0646", instruction: '\u062A\u0638\u0647\u0631 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0623\u0648\u0644\u0648\u064A\u0627\u062A \u0627\u0644\u062E\u0627\u0635\u0629 \u0628\u0643 \u0623\u062F\u0646\u0627\u0647. \u0625\u0630\u0627 \u0631\u063A\u0628\u062A\u060C \u064A\u0645\u0643\u0646\u0643 \u0625\u0639\u0627\u062F\u0629 \u062A\u0631\u062A\u064A\u0628 \u0627\u062E\u062A\u064A\u0627\u0631\u0627\u062A\u0643 \u0628\u0627\u0633\u062A\u062E\u062F\u0627\u0645 \u0627\u0644\u0623\u0633\u0647\u0645. \u0627\u0646\u0642\u0631 \u0639\u0644\u0649 "\u0627\u0644\u062A\u0627\u0644\u064A" \u0644\u062A\u0623\u0643\u064A\u062F \u0627\u062E\u062A\u064A\u0627\u0631\u0643 \u0648\u0627\u0644\u0645\u062A\u0627\u0628\u0639\u0629.' }, bn: { selectUpTo: "\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", options: "\u099F\u09BF \u09AC\u09BF\u0995\u09B2\u09CD\u09AA", thenOrder: "\u09A4\u09BE\u09B0\u09AA\u09B0 \u09B8\u09C7\u0997\u09C1\u09B2\u09CB \u09B8\u09BE\u099C\u09BE\u09A8", selectOptions: "\u09AC\u09BF\u0995\u09B2\u09CD\u09AA \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", cancel: "\u09AC\u09BE\u09A4\u09BF\u09B2", confirm: "\u09A8\u09BF\u09B6\u09CD\u099A\u09BF\u09A4 \u0995\u09B0\u09C1\u09A8", selectOptionNumber: "\u09AC\u09BF\u0995\u09B2\u09CD\u09AA # \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u0995\u09B0\u09C1\u09A8", prioritized: "\u0985\u0997\u09CD\u09B0\u09BE\u09A7\u09BF\u0995\u09BE\u09B0\u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4", of: "\u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7", instruction: "\u0986\u09AA\u09A8\u09BE\u09B0 \u0985\u0997\u09CD\u09B0\u09BE\u09A7\u09BF\u0995\u09BE\u09B0 \u09A4\u09BE\u09B2\u09BF\u0995\u09BE \u09A8\u09BF\u099A\u09C7 \u09A6\u09C7\u0996\u09BE\u09A8\u09CB \u09B9\u09AF\u09BC\u09C7\u099B\u09C7\u0964 \u099A\u09BE\u0987\u09B2\u09C7 \u09A4\u09C0\u09B0 \u099A\u09BF\u09B9\u09CD\u09A8 \u09AC\u09CD\u09AF\u09AC\u09B9\u09BE\u09B0 \u0995\u09B0\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09AA\u099B\u09A8\u09CD\u09A6\u0997\u09C1\u09B2\u09CB \u09AA\u09C1\u09A8\u09B0\u09BE\u09AF\u09BC \u09B8\u09BE\u099C\u09BE\u09A4\u09C7 \u09AA\u09BE\u09B0\u09C7\u09A8\u0964 \u201C\u09AA\u09B0\u09AC\u09B0\u09CD\u09A4\u09C0\u201D \u0995\u09CD\u09B2\u09BF\u0995 \u0995\u09B0\u09C7 \u0986\u09AA\u09A8\u09BE\u09B0 \u09A8\u09BF\u09B0\u09CD\u09AC\u09BE\u099A\u09A8 \u09A8\u09BF\u09B6\u09CD\u099A\u09BF\u09A4 \u0995\u09B0\u09C1\u09A8 \u098F\u09AC\u0982 \u098F\u0997\u09BF\u09AF\u09BC\u09C7 \u09AF\u09BE\u09A8\u0964" }, da: { selectUpTo: "V\xE6lg op til", options: "muligheder", thenOrder: "og sorter dem derefter", selectOptions: "V\xE6lg muligheder", cancel: "Annuller", confirm: "Bekr\xE6ft", selectOptionNumber: "V\xE6lg mulighed #", prioritized: "Prioriteret", of: "af", instruction: 'Din prioritetsliste vises nedenfor. Hvis du \xF8nsker det, kan du omarrangere dine valg ved hj\xE6lp af pilene. Klik p\xE5 "N\xE6ste" for at bekr\xE6fte dit valg og forts\xE6tte.' }, fi: { selectUpTo: "Valitse enint\xE4\xE4n", options: "vaihtoehtoa", thenOrder: "ja j\xE4rjest\xE4 ne sitten", selectOptions: "Valitse vaihtoehdot", cancel: "Peruuta", confirm: "Vahvista", selectOptionNumber: "Valitse vaihtoehto #", prioritized: "Priorisoitu", of: " / ", instruction: 'Prioriteettilistasi n\xE4kyy alla. Voit halutessasi j\xE4rjest\xE4\xE4 valinnat uudelleen nuolien avulla. Napsauta "Seuraava" vahvistaaksesi valinnan ja jatkaaksesi.' }, sv: { selectUpTo: "V\xE4lj upp till", options: "alternativ", thenOrder: "och ordna dem sedan", selectOptions: "V\xE4lj alternativ", cancel: "Avbryt", confirm: "Bekr\xE4fta", selectOptionNumber: "V\xE4lj alternativ #", prioritized: "Prioriterat", of: "av", instruction: 'Din prioriteringslista visas nedan. Om du vill kan du ordna om dina val med hj\xE4lp av pilarna. Klicka p\xE5 "N\xE4sta" f\xF6r att bekr\xE4fta ditt val och forts\xE4tta.' }, no: { selectUpTo: "Velg opptil", options: "alternativer", thenOrder: "og ordne dem deretter", selectOptions: "Velg alternativer", cancel: "Avbryt", confirm: "Bekreft", selectOptionNumber: "Velg alternativ #", prioritized: "Prioritert", of: "av", instruction: 'Prioriteringslisten din vises nedenfor. Hvis du \xF8nsker det, kan du ordne valgene dine ved hjelp av pilene. Klikk p\xE5 "Neste" for \xE5 bekrefte valget ditt og fortsette.' } };
1542
- return t5[t5[a2] ? a2 : "en"][e5];
3638
+ return t5[t5[o2] ? o2 : "en"][e5];
1543
3639
  }, d = document.createElement("div");
1544
3640
  if (d.classList.add("magicfeedback-priority-list-container"), r2 && s2 && s2 > 0) {
1545
3641
  const e5 = [], r3 = document.createElement("div");
1546
3642
  r3.classList.add("magicfeedback-priority-list-header");
1547
- const a3 = document.createElement("div");
1548
- a3.classList.add("magicfeedback-priority-list-instruction"), a3.textContent = "" !== o2 ? o2 : `${l("instruction")}`, a3.style.display = "none";
3643
+ const o3 = document.createElement("div");
3644
+ o3.classList.add("magicfeedback-priority-list-instruction"), o3.textContent = "" !== a2 ? a2 : `${l("instruction")}`, o3.style.display = "none";
1549
3645
  const c2 = document.createElement("button");
1550
- c2.type = "button", c2.textContent = l("selectOptions"), c2.classList.add("magicfeedback-button"), c2.classList.add("magicfeedback-priority-list-open-btn"), r3.appendChild(c2), r3.appendChild(a3);
3646
+ c2.type = "button", c2.textContent = l("selectOptions"), c2.classList.add("magicfeedback-button"), c2.classList.add("magicfeedback-priority-list-open-btn"), r3.appendChild(c2), r3.appendChild(o3);
1551
3647
  const u2 = document.createElement("div");
1552
3648
  u2.classList.add("magicfeedback-priority-list-reorder");
1553
3649
  const p = document.createElement("ul");
1554
3650
  p.classList.add("magicfeedback-priority-list-list"), u2.appendChild(p);
1555
- const m = () => {
3651
+ const h = () => {
1556
3652
  p.innerHTML = "", e5.forEach(((t5, n3) => {
1557
3653
  const r4 = document.createElement("li");
1558
3654
  r4.classList.add("magicfeedback-priority-list-item");
1559
3655
  const s3 = document.createElement("input");
1560
3656
  s3.classList.add("magicfeedback-input-magicfeedback-priority-list"), s3.classList.add("magicfeedback-input"), s3.type = "hidden", s3.id = `priority-list-${i2}`, s3.name = i2, s3.value = `${n3 + 1}. ${t5}`, r4.appendChild(s3);
1561
- const a4 = document.createElement("label");
1562
- a4.classList.add("magicfeedback-priority-list-item-label"), a4.textContent = `${n3 + 1}. ${t5}`, r4.appendChild(a4);
1563
- const o3 = document.createElement("div");
1564
- o3.classList.add("magicfeedback-priority-list-arrows");
3657
+ const o4 = document.createElement("label");
3658
+ o4.classList.add("magicfeedback-priority-list-item-label"), o4.textContent = `${n3 + 1}. ${t5}`, r4.appendChild(o4);
3659
+ const a3 = document.createElement("div");
3660
+ a3.classList.add("magicfeedback-priority-list-arrows");
1565
3661
  const l2 = document.createElement("img");
1566
3662
  l2.classList.add("magicfeedback-priority-list-arrow-up"), l2.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", l2.style.visibility = 0 === n3 ? "hidden" : "visible";
1567
3663
  const d2 = document.createElement("img");
1568
3664
  d2.classList.add("magicfeedback-priority-list-arrow-down"), d2.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", d2.style.transform = "rotate(180deg)", d2.style.visibility = n3 === e5.length - 1 ? "hidden" : "visible", l2.addEventListener("click", (() => {
1569
- var i3, n4, o4, c3;
3665
+ var i3, n4, a4, c3;
1570
3666
  const u3 = r4.previousElementSibling;
1571
3667
  if (u3) {
1572
- const m2 = Number(null === (i3 = s3.value) || void 0 === i3 ? void 0 : i3.split(".")[0]) - 1;
1573
- s3.value = `${m2}. ${t5}`, a4.textContent = `${m2}. ${t5}`, l2.style.visibility = 1 === m2 ? "hidden" : "visible", d2.style.visibility = m2 === e5.length ? "hidden" : "visible";
1574
- const h2 = u3.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f2 = u3.querySelector(".magicfeedback-priority-list-item-label"), v2 = u3.querySelector(".magicfeedback-priority-list-arrow-up"), g2 = u3.querySelector(".magicfeedback-priority-list-arrow-down");
1575
- if (h2 && f2 && v2 && g2) {
1576
- const t6 = Number(null === (n4 = h2.value) || void 0 === n4 ? void 0 : n4.split(".")[0]) + 1;
1577
- h2.value = `${t6}.${null === (o4 = f2.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f2.textContent = `${t6}.${null === (c3 = f2.textContent) || void 0 === c3 ? void 0 : c3.split(".")[1]}`, v2.style.visibility = 1 === t6 ? "hidden" : "visible", g2.style.visibility = t6 === e5.length ? "hidden" : "visible";
3668
+ const h2 = Number(null === (i3 = s3.value) || void 0 === i3 ? void 0 : i3.split(".")[0]) - 1;
3669
+ s3.value = `${h2}. ${t5}`, o4.textContent = `${h2}. ${t5}`, l2.style.visibility = 1 === h2 ? "hidden" : "visible", d2.style.visibility = h2 === e5.length ? "hidden" : "visible";
3670
+ const m2 = u3.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f2 = u3.querySelector(".magicfeedback-priority-list-item-label"), g2 = u3.querySelector(".magicfeedback-priority-list-arrow-up"), v2 = u3.querySelector(".magicfeedback-priority-list-arrow-down");
3671
+ if (m2 && f2 && g2 && v2) {
3672
+ const t6 = Number(null === (n4 = m2.value) || void 0 === n4 ? void 0 : n4.split(".")[0]) + 1;
3673
+ m2.value = `${t6}.${null === (a4 = f2.textContent) || void 0 === a4 ? void 0 : a4.split(".")[1]}`, f2.textContent = `${t6}.${null === (c3 = f2.textContent) || void 0 === c3 ? void 0 : c3.split(".")[1]}`, g2.style.visibility = 1 === t6 ? "hidden" : "visible", v2.style.visibility = t6 === e5.length ? "hidden" : "visible";
1578
3674
  }
1579
3675
  p.insertBefore(r4, u3);
1580
3676
  }
1581
3677
  })), d2.addEventListener("click", (() => {
1582
- var i3, n4, o4;
3678
+ var i3, n4, a4;
1583
3679
  const c3 = r4.nextElementSibling;
1584
3680
  if (c3) {
1585
3681
  const u3 = Number(null === (i3 = s3.value) || void 0 === i3 ? void 0 : i3.split(".")[0]) + 1;
1586
- s3.value = `${u3}. ${t5}`, a4.textContent = `${u3}. ${t5}`, l2.style.visibility = 1 === u3 ? "hidden" : "visible", d2.style.visibility = u3 === e5.length ? "hidden" : "visible";
1587
- const m2 = c3.querySelector(".magicfeedback-input-magicfeedback-priority-list"), h2 = c3.querySelector(".magicfeedback-priority-list-item-label"), f2 = c3.querySelector(".magicfeedback-priority-list-arrow-up"), v2 = c3.querySelector(".magicfeedback-priority-list-arrow-down");
1588
- if (m2 && h2 && f2 && v2) {
1589
- const t6 = Number(m2.value.split(".")[0]) - 1;
1590
- m2.value = `${t6}.${null === (n4 = h2.textContent) || void 0 === n4 ? void 0 : n4.split(".")[1]}`, h2.textContent = `${t6}.${null === (o4 = h2.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f2.style.visibility = 1 === t6 ? "hidden" : "visible", v2.style.visibility = t6 === e5.length ? "hidden" : "visible";
3682
+ s3.value = `${u3}. ${t5}`, o4.textContent = `${u3}. ${t5}`, l2.style.visibility = 1 === u3 ? "hidden" : "visible", d2.style.visibility = u3 === e5.length ? "hidden" : "visible";
3683
+ const h2 = c3.querySelector(".magicfeedback-input-magicfeedback-priority-list"), m2 = c3.querySelector(".magicfeedback-priority-list-item-label"), f2 = c3.querySelector(".magicfeedback-priority-list-arrow-up"), g2 = c3.querySelector(".magicfeedback-priority-list-arrow-down");
3684
+ if (h2 && m2 && f2 && g2) {
3685
+ const t6 = Number(h2.value.split(".")[0]) - 1;
3686
+ h2.value = `${t6}.${null === (n4 = m2.textContent) || void 0 === n4 ? void 0 : n4.split(".")[1]}`, m2.textContent = `${t6}.${null === (a4 = m2.textContent) || void 0 === a4 ? void 0 : a4.split(".")[1]}`, f2.style.visibility = 1 === t6 ? "hidden" : "visible", g2.style.visibility = t6 === e5.length ? "hidden" : "visible";
1591
3687
  }
1592
3688
  p.insertBefore(c3, r4);
1593
3689
  }
1594
- })), o3.appendChild(l2), o3.appendChild(d2), r4.appendChild(o3), p.appendChild(r4);
3690
+ })), a3.appendChild(l2), a3.appendChild(d2), r4.appendChild(a3), p.appendChild(r4);
1595
3691
  }));
1596
- }, h = document.createElement("div");
1597
- h.classList.add("magicfeedback-modal-backdrop"), h.style.position = "fixed", h.style.top = "0", h.style.left = "0", h.style.width = "100vw", h.style.height = "100vh", h.style.background = "rgba(0,0,0,0.4)", h.style.display = "none", h.style.alignItems = "center", h.style.justifyContent = "center", h.style.zIndex = "9999";
3692
+ }, m = document.createElement("div");
3693
+ m.classList.add("magicfeedback-modal-backdrop"), m.style.position = "fixed", m.style.top = "0", m.style.left = "0", m.style.width = "100vw", m.style.height = "100vh", m.style.background = "rgba(0,0,0,0.4)", m.style.display = "none", m.style.alignItems = "center", m.style.justifyContent = "center", m.style.zIndex = "9999";
1598
3694
  const f = document.createElement("div");
1599
- f.classList.add("magicfeedback-modal"), f.style.background = "#fff", f.style.borderRadius = "8px", f.style.boxShadow = "0 8px 24px rgba(0,0,0,0.2)", f.style.maxWidth = "520px", f.style.width = "90%", f.style.maxHeight = "80vh", f.style.overflow = "auto", f.style.padding = "16px", f.style.position = "relative";
1600
- const v = document.createElement("h5");
1601
- v.classList.add("magicfeedback-modal-title");
1602
- const g = () => Math.min(e5.length + 1, s2), y = () => {
1603
- v.textContent = `${l("selectOptionNumber")}${g()}`;
3695
+ f.classList.add("magicfeedback-modal"), f.style.background = "#fff", f.style.borderRadius = "8px", f.style.boxShadow = "0 8px 24px rgba(0,0,0,0.2)", f.style.maxWidth = "520px", f.style.width = "90%", f.style.maxHeight = "80vh", f.style.display = "flex", f.style.flexDirection = "column", f.style.overflow = "hidden", f.style.padding = "16px", f.style.position = "relative";
3696
+ const g = document.createElement("h5");
3697
+ g.classList.add("magicfeedback-modal-title"), g.style.flexShrink = "0", g.style.marginTop = "0";
3698
+ const v = () => Math.min(e5.length + 1, s2), y = () => {
3699
+ g.textContent = `${l("selectOptionNumber")}${v()}`;
1604
3700
  };
1605
3701
  y();
1606
3702
  const b = document.createElement("div");
1607
- b.classList.add("magicfeedback-modal-list"), (n2 ? [...t4].sort((() => Math.random() - 0.5)) : [...t4]).forEach(((t5) => {
3703
+ b.classList.add("magicfeedback-modal-list"), b.style.flex = "1 1 auto", b.style.overflowY = "auto", b.style.minHeight = "0", (n2 ? [...t4].sort((() => Math.random() - 0.5)) : [...t4]).forEach(((t5) => {
1608
3704
  const n3 = document.createElement("label");
1609
3705
  n3.classList.add("magicfeedback-modal-row");
1610
3706
  const r4 = document.createElement("input");
1611
3707
  r4.type = "checkbox", r4.classList.add("magicfeedback-input"), r4.name = `${i2}-selection`, r4.value = t5;
1612
- const a4 = document.createElement("span");
1613
- a4.textContent = t5, r4.addEventListener("change", (() => {
3708
+ const o4 = document.createElement("span");
3709
+ o4.textContent = t5, r4.addEventListener("change", (() => {
1614
3710
  if (r4.checked) {
1615
3711
  if (e5.length >= s2) return r4.checked = false, n3.classList.add("magicfeedback-warning"), void setTimeout((() => {
1616
3712
  n3.classList.remove("magicfeedback-warning");
@@ -1620,30 +3716,36 @@ var require_magicfeedback_sdk_browser = __commonJS({
1620
3716
  const i3 = e5.indexOf(t5);
1621
3717
  -1 !== i3 && e5.splice(i3, 1);
1622
3718
  }
1623
- y(), A();
1624
- })), n3.appendChild(r4), n3.appendChild(a4), b.appendChild(n3);
3719
+ y(), k();
3720
+ })), n3.appendChild(r4), n3.appendChild(o4), b.appendChild(n3);
1625
3721
  }));
1626
3722
  const E = document.createElement("div");
1627
- E.classList.add("magicfeedback-modal-actions");
1628
- const k = document.createElement("div");
1629
- k.classList.add("magicfeedback-modal-counter");
1630
- const A = () => {
3723
+ E.classList.add("magicfeedback-modal-actions"), E.style.flexShrink = "0";
3724
+ const A = document.createElement("div");
3725
+ A.classList.add("magicfeedback-modal-counter");
3726
+ const k = () => {
1631
3727
  const t5 = l("of");
1632
- k.textContent = `${l("prioritized")} ${e5.length} ${t5} ${s2}`, a3.style.display = e5.length > 0 ? "block" : "none";
3728
+ A.textContent = `${l("prioritized")} ${e5.length} ${t5} ${s2}`, o3.style.display = e5.length > 0 ? "block" : "none";
1633
3729
  };
1634
- A();
3730
+ k();
1635
3731
  const C = document.createElement("button");
1636
- C.type = "button", C.classList.add("magicfeedback-modal-close"), C.setAttribute("aria-label", l("cancel")), C.title = l("cancel"), C.textContent = "\xD7", C.style.position = "absolute", C.style.top = "8px", C.style.right = "8px", C.style.border = "none", C.style.background = "transparent", C.style.fontSize = "24px", C.style.cursor = "pointer", C.addEventListener("click", (() => {
1637
- h.style.display = "none";
3732
+ C.type = "button", C.classList.add("magicfeedback-modal-close"), C.setAttribute("aria-label", l("cancel")), C.title = l("cancel"), C.textContent = "\xD7", C.style.position = "absolute", C.style.top = "8px", C.style.right = "8px", C.style.border = "none", C.style.background = "transparent", C.style.fontSize = "24px", C.style.cursor = "pointer";
3733
+ const T = () => {
3734
+ document.body.appendChild(m), m.style.display = "flex", y(), k();
3735
+ }, P = () => {
3736
+ m.style.display = "none", d.appendChild(m);
3737
+ };
3738
+ C.addEventListener("click", (() => {
3739
+ P();
1638
3740
  }));
1639
- const T = document.createElement("button");
1640
- return T.type = "button", T.textContent = l("confirm"), T.classList.add("magicfeedback-button"), T.classList.add("magicfeedback-button-primary"), T.addEventListener("click", (() => {
1641
- h.style.display = "none", m();
1642
- })), E.appendChild(k), E.appendChild(T), f.appendChild(C), f.appendChild(v), f.appendChild(b), f.appendChild(E), h.appendChild(f), c2.addEventListener("click", (() => {
1643
- h.style.display = "flex", y(), A();
1644
- })), h.addEventListener("click", ((e6) => {
1645
- e6.target === h && (h.style.display = "none");
1646
- })), d.appendChild(r3), d.appendChild(u2), d.appendChild(h), m(), d;
3741
+ const O = document.createElement("button");
3742
+ return O.type = "button", O.textContent = l("confirm"), O.classList.add("magicfeedback-button"), O.classList.add("magicfeedback-button-primary"), O.addEventListener("click", (() => {
3743
+ P(), h();
3744
+ })), E.appendChild(A), E.appendChild(O), f.appendChild(C), f.appendChild(g), f.appendChild(b), f.appendChild(E), m.appendChild(f), c2.addEventListener("click", (() => {
3745
+ T();
3746
+ })), m.addEventListener("click", ((e6) => {
3747
+ e6.target === m && P();
3748
+ })), d.appendChild(r3), d.appendChild(u2), d.appendChild(m), h(), d;
1647
3749
  }
1648
3750
  const c = document.createElement("ul");
1649
3751
  c.classList.add("magicfeedback-priority-list-list");
@@ -1655,108 +3757,107 @@ var require_magicfeedback_sdk_browser = __commonJS({
1655
3757
  r3.classList.add("magicfeedback-input-magicfeedback-priority-list"), r3.classList.add("magicfeedback-input"), r3.type = "hidden", r3.id = `priority-list-${i2}`, r3.name = i2, r3.value = `${t5 + 1}. ${e5}`, n3.appendChild(r3);
1656
3758
  const s3 = document.createElement("label");
1657
3759
  s3.classList.add("magicfeedback-priority-list-item-label"), s3.textContent = `${t5 + 1}. ${e5}`, n3.appendChild(s3);
1658
- const a3 = document.createElement("div");
1659
- a3.style.display = "flex", a3.style.alignItems = "center", a3.style.justifyContent = "space-between";
1660
- const o3 = document.createElement("img");
1661
- o3.classList.add("magicfeedback-priority-list-arrow-up"), o3.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", o3.style.width = "20px", o3.style.height = "20px", o3.style.cursor = "pointer", o3.style.margin = "0 5px", o3.style.color = "#000", o3.style.visibility = 0 === t5 ? "hidden" : "visible", o3.addEventListener("click", (() => {
1662
- var t6, i3, a4, d2;
3760
+ const o3 = document.createElement("div");
3761
+ o3.style.display = "flex", o3.style.alignItems = "center", o3.style.justifyContent = "space-between";
3762
+ const a3 = document.createElement("img");
3763
+ a3.classList.add("magicfeedback-priority-list-arrow-up"), a3.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", a3.style.width = "20px", a3.style.height = "20px", a3.style.cursor = "pointer", a3.style.margin = "0 5px", a3.style.color = "#000", a3.style.visibility = 0 === t5 ? "hidden" : "visible", a3.addEventListener("click", (() => {
3764
+ var t6, i3, o4, d2;
1663
3765
  const p = n3.previousElementSibling;
1664
3766
  if (p) {
1665
- const m = Number(null === (t6 = r3.value) || void 0 === t6 ? void 0 : t6.split(".")[0]) - 1;
1666
- r3.value = `${m}. ${e5}`, s3.textContent = `${m}. ${e5}`, o3.style.visibility = 1 === m ? "hidden" : "visible", l2.style.visibility = m === u.length ? "hidden" : "visible";
1667
- const h = p.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f = p.querySelector(".magicfeedback-priority-list-item-label"), v = p.querySelector(".magicfeedback-priority-list-arrow-up"), g = p.querySelector(".magicfeedback-priority-list-arrow-down");
1668
- if (h && f && v && g) {
1669
- const e6 = Number(null === (i3 = h.value) || void 0 === i3 ? void 0 : i3.split(".")[0]) + 1;
1670
- h.value = `${e6}.${null === (a4 = f.textContent) || void 0 === a4 ? void 0 : a4.split(".")[1]}`, f.textContent = `${e6}.${null === (d2 = f.textContent) || void 0 === d2 ? void 0 : d2.split(".")[1]}`, v.style.visibility = 1 === e6 ? "hidden" : "visible", g.style.visibility = e6 === u.length ? "hidden" : "visible";
3767
+ const h = Number(null === (t6 = r3.value) || void 0 === t6 ? void 0 : t6.split(".")[0]) - 1;
3768
+ r3.value = `${h}. ${e5}`, s3.textContent = `${h}. ${e5}`, a3.style.visibility = 1 === h ? "hidden" : "visible", l2.style.visibility = h === u.length ? "hidden" : "visible";
3769
+ const m = p.querySelector(".magicfeedback-input-magicfeedback-priority-list"), f = p.querySelector(".magicfeedback-priority-list-item-label"), g = p.querySelector(".magicfeedback-priority-list-arrow-up"), v = p.querySelector(".magicfeedback-priority-list-arrow-down");
3770
+ if (m && f && g && v) {
3771
+ const e6 = Number(null === (i3 = m.value) || void 0 === i3 ? void 0 : i3.split(".")[0]) + 1;
3772
+ m.value = `${e6}.${null === (o4 = f.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f.textContent = `${e6}.${null === (d2 = f.textContent) || void 0 === d2 ? void 0 : d2.split(".")[1]}`, g.style.visibility = 1 === e6 ? "hidden" : "visible", v.style.visibility = e6 === u.length ? "hidden" : "visible";
1671
3773
  }
1672
3774
  c.insertBefore(n3, p);
1673
3775
  }
1674
3776
  }));
1675
3777
  const l2 = document.createElement("img");
1676
3778
  l2.classList.add("magicfeedback-priority-list-arrow-down"), l2.src = "https://magicfeedback-c6458-dev.web.app/assets/arrow.svg", l2.style.width = "20px", l2.style.height = "20px", l2.style.cursor = "pointer", l2.style.margin = "0 5px", l2.style.color = "#000", l2.style.transform = "rotate(180deg)", l2.style.visibility = t5 === u.length - 1 ? "hidden" : "visible", l2.addEventListener("click", (() => {
1677
- var t6, i3, a4;
3779
+ var t6, i3, o4;
1678
3780
  const d2 = n3.nextElementSibling;
1679
3781
  if (d2) {
1680
3782
  const p = Number(null === (t6 = r3.value) || void 0 === t6 ? void 0 : t6.split(".")[0]) + 1;
1681
- r3.value = `${p}. ${e5}`, s3.textContent = `${p}. ${e5}`, o3.style.visibility = 1 === p ? "hidden" : "visible", l2.style.visibility = p === u.length ? "hidden" : "visible";
1682
- const m = d2.querySelector(".magicfeedback-input-magicfeedback-priority-list"), h = d2.querySelector(".magicfeedback-priority-list-item-label"), f = d2.querySelector(".magicfeedback-priority-list-arrow-up"), v = d2.querySelector(".magicfeedback-priority-list-arrow-down");
1683
- if (m && h && f && v) {
1684
- const e6 = Number(m.value.split(".")[0]) - 1;
1685
- m.value = `${e6}.${null === (i3 = h.textContent) || void 0 === i3 ? void 0 : i3.split(".")[1]}`, h.textContent = `${e6}.${null === (a4 = h.textContent) || void 0 === a4 ? void 0 : a4.split(".")[1]}`, f.style.visibility = 1 === e6 ? "hidden" : "visible", v.style.visibility = e6 === u.length ? "hidden" : "visible";
3783
+ r3.value = `${p}. ${e5}`, s3.textContent = `${p}. ${e5}`, a3.style.visibility = 1 === p ? "hidden" : "visible", l2.style.visibility = p === u.length ? "hidden" : "visible";
3784
+ const h = d2.querySelector(".magicfeedback-input-magicfeedback-priority-list"), m = d2.querySelector(".magicfeedback-priority-list-item-label"), f = d2.querySelector(".magicfeedback-priority-list-arrow-up"), g = d2.querySelector(".magicfeedback-priority-list-arrow-down");
3785
+ if (h && m && f && g) {
3786
+ const e6 = Number(h.value.split(".")[0]) - 1;
3787
+ h.value = `${e6}.${null === (i3 = m.textContent) || void 0 === i3 ? void 0 : i3.split(".")[1]}`, m.textContent = `${e6}.${null === (o4 = m.textContent) || void 0 === o4 ? void 0 : o4.split(".")[1]}`, f.style.visibility = 1 === e6 ? "hidden" : "visible", g.style.visibility = e6 === u.length ? "hidden" : "visible";
1686
3788
  }
1687
3789
  c.insertBefore(d2, n3);
1688
3790
  }
1689
- })), a3.appendChild(o3), a3.appendChild(l2), n3.appendChild(a3), c.appendChild(n3);
3791
+ })), o3.appendChild(a3), o3.appendChild(l2), n3.appendChild(o3), c.appendChild(n3);
1690
3792
  })), d.appendChild(c), d;
1691
3793
  })({ value: e3.value, ref: e3.ref, randomPosition: t3, limitPriority: (null === (n = e3.assets) || void 0 === n ? void 0 : n.limitPriority) || false, maxPriority: (null === (r = e3.assets) || void 0 === r ? void 0 : r.maxPriority) || 0, placeholder: (null === (s = e3.assets) || void 0 === s ? void 0 : s.placeholder) || "", language: i || "en" });
1692
- return a.appendChild(o), { element: a, elementTypeClass: "magicfeedback-priority-list" };
3794
+ return o.appendChild(a), { element: o, elementTypeClass: "magicfeedback-priority-list" };
1693
3795
  };
1694
3796
  }, 152: (e2, t2, i) => {
1695
3797
  "use strict";
1696
3798
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderRatingEmoji = void 0;
1697
3799
  const n = i(559), r = "https://survey-dev.magicfeedback.io/assets/emojis";
1698
3800
  t2.renderRatingEmoji = ({ question: e3, url: t3, send: i2, urlParamValue: s }) => {
1699
- var a;
1700
- const { ref: o, assets: l } = e3, d = document.createElement("div"), c = "magicfeedback-rating", u = document.createElement("div");
1701
- u.classList.add("magicfeedback-rating-container");
1702
- const p = (null == l ? void 0 : l.max) ? Number(null == l ? void 0 : l.max) : 5, m = (null == l ? void 0 : l.min) ? Number(null == l ? void 0 : l.min) : 1, h = (0, n.createRatingPlaceholder)(m, p, null == l ? void 0 : l.minPlaceholder, null == l ? void 0 : l.maxPlaceholder, null !== (a = null == l ? void 0 : l.extraOption) && void 0 !== a && a);
1703
- for (let e4 = m; e4 <= p; e4++) {
3801
+ const { ref: o, assets: a } = e3, l = document.createElement("div"), d = "magicfeedback-rating", c = document.createElement("div");
3802
+ c.classList.add("magicfeedback-rating-container");
3803
+ const u = (null == a ? void 0 : a.max) ? Number(null == a ? void 0 : a.max) : 5, p = (null == a ? void 0 : a.min) ? Number(null == a ? void 0 : a.min) : 1, h = (0, n.createRatingPlaceholder)(null == a ? void 0 : a.minPlaceholder, null == a ? void 0 : a.maxPlaceholder);
3804
+ for (let e4 = p; e4 <= u; e4++) {
1704
3805
  const n2 = document.createElement("div");
1705
3806
  n2.classList.add("magicfeedback-rating-option");
1706
3807
  const a2 = document.createElement("label");
1707
3808
  a2.htmlFor = `rating-${o}-${e4}`, a2.classList.add("magicfeedback-rating-option-label-container");
1708
3809
  const l2 = document.createElement("label");
1709
3810
  l2.htmlFor = `rating-${o}-${e4}`, l2.textContent = e4.toString();
1710
- const d2 = document.createElement("img");
1711
- if (d2.alt = `face-${o}-${e4}`, d2.className = `rating-image${e4}`, 0 === m && 10 === p) d2.src = `${t3}/${e4}.svg`, d2.onerror = () => d2.src = `${r}/${e4}.svg`;
1712
- else if (1 === m && 5 === p) switch (e4) {
3811
+ const h2 = document.createElement("img");
3812
+ if (h2.alt = `face-${o}-${e4}`, h2.className = `rating-image${e4}`, 0 === p && 10 === u) h2.src = `${t3}/${e4}.svg`, h2.onerror = () => h2.src = `${r}/${e4}.svg`;
3813
+ else if (1 === p && 5 === u) switch (e4) {
1713
3814
  case 1:
1714
- d2.src = `${t3}/1.svg`, d2.onerror = () => d2.src = `${r}/1.svg`;
3815
+ h2.src = `${t3}/1.svg`, h2.onerror = () => h2.src = `${r}/1.svg`;
1715
3816
  break;
1716
3817
  case 2:
1717
- d2.src = `${t3}/2.svg`, d2.onerror = () => d2.src = `${r}/2.svg`;
3818
+ h2.src = `${t3}/2.svg`, h2.onerror = () => h2.src = `${r}/2.svg`;
1718
3819
  break;
1719
3820
  case 3:
1720
- d2.src = `${t3}/6.svg`, d2.onerror = () => d2.src = `${r}/6.svg`;
3821
+ h2.src = `${t3}/6.svg`, h2.onerror = () => h2.src = `${r}/6.svg`;
1721
3822
  break;
1722
3823
  case 4:
1723
- d2.src = `${t3}/9.svg`, d2.onerror = () => d2.src = `${r}/9.svg`;
3824
+ h2.src = `${t3}/9.svg`, h2.onerror = () => h2.src = `${r}/9.svg`;
1724
3825
  break;
1725
3826
  case 5:
1726
- d2.src = `${t3}/10.svg`, d2.onerror = () => d2.src = `${r}/10.svg`;
3827
+ h2.src = `${t3}/10.svg`, h2.onerror = () => h2.src = `${r}/10.svg`;
1727
3828
  }
1728
3829
  else {
1729
- const i3 = Math.round(10 / (p - m) * (e4 - m));
1730
- d2.src = `${t3}/${i3}.svg`, d2.onerror = () => d2.src = `${r}/${i3}.svg`;
3830
+ const i3 = Math.round(10 / (u - p) * (e4 - p));
3831
+ h2.src = `${t3}/${i3}.svg`, h2.onerror = () => h2.src = `${r}/${i3}.svg`;
1731
3832
  }
1732
- const h2 = document.createElement("input");
1733
- h2.id = `rating-${o}-${e4}`, h2.type = "radio", h2.name = o, h2.value = e4.toString(), h2.classList.add(c), h2.classList.add("magicfeedback-input"), i2 && h2.addEventListener("change", (() => {
3833
+ const m = document.createElement("input");
3834
+ m.id = `rating-${o}-${e4}`, m.type = "radio", m.name = o, m.value = e4.toString(), m.classList.add(d), m.classList.add("magicfeedback-input"), i2 && m.addEventListener("change", (() => {
1734
3835
  i2();
1735
- })), s && s === h2.value && (h2.checked = true), a2.appendChild(h2), a2.appendChild(d2), a2.appendChild(l2), n2.appendChild(a2), u.appendChild(n2);
3836
+ })), s && s === m.value && (m.checked = true), a2.appendChild(m), a2.appendChild(h2), a2.appendChild(l2), n2.appendChild(a2), c.appendChild(n2);
1736
3837
  }
1737
- if ((null == l ? void 0 : l.extraOption) && (null == l ? void 0 : l.extraOptionText)) {
3838
+ if ((null == a ? void 0 : a.extraOption) && (null == a ? void 0 : a.extraOptionText)) {
1738
3839
  const e4 = document.createElement("div");
1739
3840
  e4.classList.add("magicfeedback-rating-option");
1740
3841
  const t4 = document.createElement("label");
1741
3842
  t4.htmlFor = `rating-${o}-extra`, t4.classList.add("magicfeedback-rating-option-label-container");
1742
3843
  const n2 = document.createElement("label");
1743
- n2.htmlFor = `rating-${o}-extra`, n2.textContent = null == l ? void 0 : l.extraOptionText;
3844
+ n2.htmlFor = `rating-${o}-extra`, n2.textContent = null == a ? void 0 : a.extraOptionText;
1744
3845
  const r2 = document.createElement("img");
1745
3846
  r2.src = "https://magicfeedback-c6458-dev.web.app/assets/question.svg", r2.alt = `face-${o}-extra`, r2.className = "magicfeedback-rating-image-extra";
1746
3847
  const s2 = document.createElement("input");
1747
- s2.id = `rating-${o}-extra`, s2.type = "radio", s2.name = o, s2.value = "-", s2.classList.add(c), s2.classList.add("magicfeedback-input"), i2 && s2.addEventListener("change", (() => {
3848
+ s2.id = `rating-${o}-extra`, s2.type = "radio", s2.name = o, s2.value = "-", s2.classList.add(d), s2.classList.add("magicfeedback-input"), i2 && s2.addEventListener("change", (() => {
1748
3849
  i2();
1749
- })), t4.appendChild(s2), t4.appendChild(r2), t4.appendChild(n2), e4.appendChild(t4), u.appendChild(e4);
3850
+ })), t4.appendChild(s2), t4.appendChild(r2), t4.appendChild(n2), e4.appendChild(t4), c.appendChild(e4);
1750
3851
  }
1751
- return h.childElementCount > 0 && (u.classList.add("magicfeedback-rating-container--with-placeholder"), u.insertBefore(h, u.firstChild)), d.appendChild(u), { element: d, elementTypeClass: c };
3852
+ return h.childElementCount > 0 && c.appendChild(h), l.appendChild(c), { element: l, elementTypeClass: d };
1752
3853
  };
1753
3854
  }, 917: (e2, t2, i) => {
1754
3855
  "use strict";
1755
3856
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderRatingNumber = void 0;
1756
3857
  const n = i(559);
1757
- t2.renderRatingNumber = ({ question: e3, order: t3, direction: i2, isPhone: r, send: s, urlParamValue: a }) => {
3858
+ t2.renderRatingNumber = ({ question: e3, order: t3, direction: i2, send: r, urlParamValue: s }) => {
1758
3859
  const o = "magicfeedback-rating-number";
1759
- return { element: (0, n.createRatingNumberElement)(e3.ref, e3.assets, t3, i2, r, o, s, a), elementTypeClass: o };
3860
+ return { element: (0, n.createRatingNumberElement)(e3.ref, e3.assets, t3, i2, o, r, s), elementTypeClass: o };
1760
3861
  };
1761
3862
  }, 452: (e2, t2, i) => {
1762
3863
  "use strict";
@@ -1764,21 +3865,19 @@ var require_magicfeedback_sdk_browser = __commonJS({
1764
3865
  const n = i(559);
1765
3866
  t2.renderRatingStar = ({ question: e3, send: t3, urlParamValue: i2 }) => {
1766
3867
  var r, s;
1767
- const a = document.createElement("div"), o = (0, n.createStarRating)(e3.ref, null === (r = e3.assets) || void 0 === r ? void 0 : r.minPlaceholder, null === (s = e3.assets) || void 0 === s ? void 0 : s.maxPlaceholder, t3, i2);
1768
- return a.appendChild(o), { element: a, elementTypeClass: "magicfeedback-rating-star" };
3868
+ const o = document.createElement("div"), a = (0, n.createStarRating)(e3.ref, null === (r = e3.assets) || void 0 === r ? void 0 : r.minPlaceholder, null === (s = e3.assets) || void 0 === s ? void 0 : s.maxPlaceholder, t3, i2);
3869
+ return o.appendChild(a), { element: o, elementTypeClass: "magicfeedback-rating-star" };
1769
3870
  };
1770
3871
  }, 85: (e2, t2, i) => {
1771
3872
  "use strict";
1772
3873
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderSelect = void 0;
1773
3874
  const n = i(516);
1774
- t2.renderSelect = ({ question: e3, format: t3, language: i2, urlParamValue: r, send: s }) => {
1775
- const { title: a, value: o, defaultValue: l } = e3, d = document.createElement("select"), c = document.createElement("option");
1776
- return c.value = "", c.text = "slim" === t3 ? (0, n.parseTitle)(a, i2) : l || "Select an option", c.disabled = true, c.selected = true, d.appendChild(c), o.forEach(((e4) => {
3875
+ t2.renderSelect = ({ question: e3, format: t3, language: i2, urlParamValue: r }) => {
3876
+ const { title: s, value: o, defaultValue: a } = e3, l = document.createElement("select"), d = document.createElement("option");
3877
+ return d.value = "", d.text = "slim" === t3 ? (0, n.parseTitle)(s, i2) : a || "Select an option", d.disabled = true, d.selected = true, l.appendChild(d), o.forEach(((e4) => {
1777
3878
  const t4 = document.createElement("option");
1778
- t4.value = e4, t4.text = e4, d.appendChild(t4);
1779
- })), r && o.includes(r) && (d.value = r), s && d.addEventListener("change", (() => {
1780
- s();
1781
- })), { element: d, elementTypeClass: "magicfeedback-select" };
3879
+ t4.value = e4, t4.text = e4, l.appendChild(t4);
3880
+ })), r && o.includes(r) && (l.value = r), { element: l, elementTypeClass: "magicfeedback-select" };
1782
3881
  };
1783
3882
  }, 90: (e2, t2, i) => {
1784
3883
  "use strict";
@@ -1790,23 +3889,314 @@ var require_magicfeedback_sdk_browser = __commonJS({
1790
3889
  e4.preventDefault(), "Enter" === e4.key && r && r();
1791
3890
  })), { element: s, elementTypeClass: "magicfeedback-text" };
1792
3891
  };
1793
- }, 250: (e2, t2) => {
3892
+ }, 250: (e2, t2, i) => {
3893
+ "use strict";
3894
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.renderUploadFile = void 0;
3895
+ const n = i(571);
3896
+ t2.renderUploadFile = ({ question: e3, language: t3 }) => (0, n.createUploadControl)(e3, t3, "file");
3897
+ }, 843: (e2, t2, i) => {
3898
+ "use strict";
3899
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.renderUploadImage = void 0;
3900
+ const n = i(571);
3901
+ t2.renderUploadImage = ({ question: e3, language: t3 }) => (0, n.createUploadControl)(e3, t3, "image");
3902
+ }, 571: function(e2, t2, i) {
3903
+ "use strict";
3904
+ var n = this && this.__awaiter || function(e3, t3, i2, n2) {
3905
+ return new (i2 || (i2 = Promise))((function(r2, s2) {
3906
+ function o2(e4) {
3907
+ try {
3908
+ l2(n2.next(e4));
3909
+ } catch (e5) {
3910
+ s2(e5);
3911
+ }
3912
+ }
3913
+ function a2(e4) {
3914
+ try {
3915
+ l2(n2.throw(e4));
3916
+ } catch (e5) {
3917
+ s2(e5);
3918
+ }
3919
+ }
3920
+ function l2(e4) {
3921
+ var t4;
3922
+ e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
3923
+ e5(t4);
3924
+ }))).then(o2, a2);
3925
+ }
3926
+ l2((n2 = n2.apply(e3, t3 || [])).next());
3927
+ }));
3928
+ };
3929
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.createUploadControl = t2.awaitUploadReady = t2.getUploadValues = t2.formatFileSize = void 0;
3930
+ const r = i(784), s = i(516), o = "__mfUploadValues", a = "__mfUploadReady";
3931
+ function l(e3) {
3932
+ if ("number" != typeof e3 || isNaN(e3)) return "";
3933
+ if (e3 < 1024) return `${e3} B`;
3934
+ const t3 = e3 / 1024;
3935
+ if (t3 < 1024) return `${t3 < 10 ? t3.toFixed(1) : Math.round(t3)} KB`;
3936
+ const i2 = t3 / 1024;
3937
+ return `${i2 < 10 ? i2.toFixed(1) : Math.round(i2)} MB`;
3938
+ }
3939
+ t2.formatFileSize = l, t2.getUploadValues = function(e3) {
3940
+ const t3 = e3[o];
3941
+ return Array.isArray(t3) ? t3 : [];
3942
+ }, t2.awaitUploadReady = function(e3) {
3943
+ return n(this, void 0, void 0, (function* () {
3944
+ if (!e3) return;
3945
+ const t3 = Array.from(e3.querySelectorAll(".magicfeedback-upload-native"));
3946
+ yield Promise.all(t3.map(((e4) => e4[a])).filter(Boolean));
3947
+ }));
3948
+ }, t2.createUploadControl = function(e3, t3, i2) {
3949
+ const { ref: n2, require: d, title: c, assets: u } = e3, p = "image" === i2 ? "magicfeedback-upload-image" : "magicfeedback-upload-file", h = (null == u ? void 0 : u.multiple) || false, m = h ? (null == u ? void 0 : u.maxFiles) || 0 : 1, f = Number(null == u ? void 0 : u.maxFileSize) > 0 ? Number(null == u ? void 0 : u.maxFileSize) : 0, g = 1024 * f * 1024, v = document.createElement("div");
3950
+ v.classList.add("magicfeedback-upload");
3951
+ const y = document.createElement("input");
3952
+ y.type = "file", "image" === i2 && (y.accept = "image/*"), y.multiple = h, y.required = d, y.name = n2, y.id = `magicfeedback-upload-input-${n2}`, y.classList.add(p), y.classList.add("magicfeedback-input"), y.classList.add("magicfeedback-upload-native"), y[o] = [], y[a] = Promise.resolve();
3953
+ const b = (0, s.parseTitle)(c, t3);
3954
+ b && y.setAttribute("aria-label", b);
3955
+ const E = document.createElement("div");
3956
+ E.classList.add("magicfeedback-upload-dropzone");
3957
+ const A = document.createElement("span");
3958
+ A.classList.add("magicfeedback-upload-icon"), A.innerHTML = "image" === i2 ? '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>' : '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16 16l-4-4-4 4"/><path d="M12 12v9"/><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"/></svg>';
3959
+ const k = document.createElement("span");
3960
+ k.classList.add("magicfeedback-upload-cta"), k.textContent = r.placeholder.upload.cta(t3);
3961
+ const C = document.createElement("span");
3962
+ C.classList.add("magicfeedback-upload-hint"), C.textContent = (function(e4, t4, i3, n3, s2) {
3963
+ const o2 = [r.placeholder.upload.formats(e4, t4)];
3964
+ return i3 && n3 > 0 && o2.push(r.placeholder.upload.maxFiles(e4, n3)), s2 > 0 && o2.push(r.placeholder.upload.maxSize(e4, s2)), o2.filter(Boolean).join(" \xB7 ");
3965
+ })(t3, i2, h, m, f), E.appendChild(y), E.appendChild(A), E.appendChild(k), E.appendChild(C);
3966
+ const T = document.createElement("div");
3967
+ T.classList.add("magicfeedback-upload-error");
3968
+ const P = document.createElement("ul");
3969
+ P.classList.add("magicfeedback-upload-list"), v.appendChild(E), v.appendChild(T), v.appendChild(P);
3970
+ const O = /* @__PURE__ */ new WeakMap(), x = (e4) => {
3971
+ const t4 = O.get(e4);
3972
+ return t4 ? Promise.resolve(t4) : new Promise(((t5) => {
3973
+ const i3 = new FileReader(), n3 = (i4) => {
3974
+ const n4 = JSON.stringify({ name: e4.name, type: e4.type, size: e4.size, content: i4 });
3975
+ O.set(e4, n4), t5(n4);
3976
+ };
3977
+ i3.onload = () => n3("string" == typeof i3.result ? i3.result : ""), i3.onerror = () => n3(""), i3.readAsDataURL(e4);
3978
+ }));
3979
+ }, w = [], L = (e4) => {
3980
+ try {
3981
+ const t4 = m > 0 ? e4.slice(0, m) : e4, i3 = new DataTransfer();
3982
+ t4.forEach(((e5) => i3.items.add(e5))), y.files = i3.files;
3983
+ } catch (e5) {
3984
+ }
3985
+ !(function() {
3986
+ w.forEach(((e6) => URL.revokeObjectURL(e6))), w.length = 0, P.innerHTML = "";
3987
+ const e5 = Array.from(y.files || []);
3988
+ v.classList.toggle("magicfeedback-upload--has-files", e5.length > 0), e5.forEach(((e6, n3) => {
3989
+ const s2 = document.createElement("li");
3990
+ s2.classList.add("magicfeedback-upload-file-item");
3991
+ const o2 = document.createElement("span");
3992
+ if (o2.classList.add("magicfeedback-upload-thumb"), "image" === i2 && e6.type.startsWith("image/")) {
3993
+ const t4 = URL.createObjectURL(e6);
3994
+ w.push(t4);
3995
+ const i3 = document.createElement("img");
3996
+ i3.src = t4, i3.alt = e6.name, o2.appendChild(i3);
3997
+ } else o2.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>';
3998
+ const a2 = document.createElement("span");
3999
+ a2.classList.add("magicfeedback-upload-file-info");
4000
+ const d2 = document.createElement("span");
4001
+ d2.classList.add("magicfeedback-upload-file-name"), d2.textContent = e6.name, d2.title = e6.name;
4002
+ const c2 = document.createElement("span");
4003
+ c2.classList.add("magicfeedback-upload-file-size"), c2.textContent = l(e6.size), a2.appendChild(d2), a2.appendChild(c2);
4004
+ const u2 = document.createElement("button");
4005
+ u2.type = "button", u2.classList.add("magicfeedback-upload-remove"), u2.setAttribute("aria-label", `${r.placeholder.upload.remove(t3)}: ${e6.name}`), u2.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', u2.addEventListener("click", ((e7) => {
4006
+ e7.preventDefault(), e7.stopPropagation(), L(Array.from(y.files || []).filter(((e8, t4) => t4 !== n3)));
4007
+ })), s2.appendChild(o2), s2.appendChild(a2), s2.appendChild(u2), P.appendChild(s2);
4008
+ }));
4009
+ })(), (() => {
4010
+ const e5 = Array.from(y.files || []), t4 = Promise.all(e5.map(x)).then(((e6) => {
4011
+ y[o] = e6;
4012
+ }));
4013
+ y[a] = t4;
4014
+ })();
4015
+ }, S = (e4) => {
4016
+ if (!e4.length) return T.textContent = "", void T.classList.remove("is-visible");
4017
+ const i3 = e4.map(((e5) => e5.name)).join(", ");
4018
+ T.textContent = `${r.placeholder.upload.tooLarge(t3, f)}: ${i3}`, T.classList.add("is-visible");
4019
+ }, N = (e4) => {
4020
+ if (!g) return { accepted: e4, rejected: [] };
4021
+ const t4 = [], i3 = [];
4022
+ return e4.forEach(((e5) => (e5.size <= g ? t4 : i3).push(e5))), { accepted: t4, rejected: i3 };
4023
+ };
4024
+ y.addEventListener("change", (() => {
4025
+ const { accepted: e4, rejected: t4 } = N(Array.from(y.files || []));
4026
+ S(t4), L(e4);
4027
+ }));
4028
+ const I = (e4) => {
4029
+ e4.preventDefault(), e4.stopPropagation();
4030
+ };
4031
+ return ["dragenter", "dragover"].forEach(((e4) => E.addEventListener(e4, ((e5) => {
4032
+ I(e5), E.classList.add("is-dragover");
4033
+ })))), ["dragleave", "dragend"].forEach(((e4) => E.addEventListener(e4, ((e5) => {
4034
+ I(e5), E.classList.remove("is-dragover");
4035
+ })))), E.addEventListener("drop", ((e4) => {
4036
+ I(e4), E.classList.remove("is-dragover");
4037
+ const t4 = e4.dataTransfer;
4038
+ let n3 = t4 ? Array.from(t4.files) : [];
4039
+ if ("image" === i2 && (n3 = n3.filter(((e5) => e5.type.startsWith("image/")))), !n3.length) return;
4040
+ const { accepted: r2, rejected: s2 } = N(n3);
4041
+ if (S(s2), !r2.length) return;
4042
+ const o2 = h ? Array.from(y.files || []) : [];
4043
+ L(o2.concat(r2));
4044
+ })), { element: v, elementTypeClass: p };
4045
+ };
4046
+ }, 945: function(e2, t2, i) {
4047
+ "use strict";
4048
+ var n = this && this.__awaiter || function(e3, t3, i2, n2) {
4049
+ return new (i2 || (i2 = Promise))((function(r2, s2) {
4050
+ function o2(e4) {
4051
+ try {
4052
+ l2(n2.next(e4));
4053
+ } catch (e5) {
4054
+ s2(e5);
4055
+ }
4056
+ }
4057
+ function a2(e4) {
4058
+ try {
4059
+ l2(n2.throw(e4));
4060
+ } catch (e5) {
4061
+ s2(e5);
4062
+ }
4063
+ }
4064
+ function l2(e4) {
4065
+ var t4;
4066
+ e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
4067
+ e5(t4);
4068
+ }))).then(o2, a2);
4069
+ }
4070
+ l2((n2 = n2.apply(e3, t3 || [])).next());
4071
+ }));
4072
+ }, r = this && this.__importDefault || function(e3) {
4073
+ return e3 && e3.__esModule ? e3 : { default: e3 };
4074
+ };
4075
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.nextAgentTurn = t2.startAgentSurvey = void 0;
4076
+ const s = r(i(326)), o = i(313), a = i(857), l = i(279);
4077
+ function d(e3, t3, i2, r2, a2) {
4078
+ var d2;
4079
+ return n(this, void 0, void 0, (function* () {
4080
+ let n2;
4081
+ try {
4082
+ n2 = yield (0, s.default)(e3 + t3, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, o.header), body: JSON.stringify(i2) });
4083
+ } catch (e4) {
4084
+ throw r2.err(`[agentSurvey/${a2}] network error`, e4), new l.AgentApiError("NETWORK", (null == e4 ? void 0 : e4.message) || "Network error");
4085
+ }
4086
+ if (!n2.ok) {
4087
+ let e4 = null;
4088
+ try {
4089
+ e4 = yield n2.json();
4090
+ } catch (e5) {
4091
+ }
4092
+ const t4 = (0, l.mapAgentStatus)(n2.status, a2);
4093
+ throw r2.err(`[agentSurvey/${a2}] ${n2.status}`, e4), new l.AgentApiError(t4, (null === (d2 = null == e4 ? void 0 : e4.error) || void 0 === d2 ? void 0 : d2.message) || (null == e4 ? void 0 : e4.message) || n2.statusText, n2.status, "RATE_LIMITED" === t4 ? (function(e5) {
4094
+ var t5, i3;
4095
+ const n3 = null === (i3 = null === (t5 = null == e5 ? void 0 : e5.headers) || void 0 === t5 ? void 0 : t5.get) || void 0 === i3 ? void 0 : i3.call(t5, "Retry-After"), r3 = n3 ? Number(n3) : NaN;
4096
+ return Number.isFinite(r3) && r3 > 0 ? 1e3 * r3 : 6e4;
4097
+ })(n2) : void 0, e4);
4098
+ }
4099
+ try {
4100
+ const e4 = yield n2.json();
4101
+ return r2.log(`[agentSurvey/${a2}] ok`, e4), e4;
4102
+ } catch (e4) {
4103
+ throw new l.AgentApiError("MALFORMED", "Unreadable response body", n2.status);
4104
+ }
4105
+ }));
4106
+ }
4107
+ t2.startAgentSurvey = function(e3, t3, i2) {
4108
+ return d(e3, a.endpoints.sdk.agentSurveyStart, t3, i2, "start");
4109
+ }, t2.nextAgentTurn = function(e3, t3, i2) {
4110
+ return d(e3, a.endpoints.sdk.agentSurveyNext, t3, i2, "next");
4111
+ };
4112
+ }, 279: (e2, t2) => {
4113
+ "use strict";
4114
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.mapAgentStatus = t2.AgentApiError = void 0;
4115
+ class i extends Error {
4116
+ constructor(e3, t3, n, r, s) {
4117
+ super(t3), this.kind = e3, this.status = n, this.retryAfterMs = r, this.body = s, this.name = "AgentApiError", Object.setPrototypeOf(this, i.prototype);
4118
+ }
4119
+ get retryable() {
4120
+ return "RATE_LIMITED" === this.kind || "AI_UNAVAILABLE" === this.kind || "NETWORK" === this.kind;
4121
+ }
4122
+ }
4123
+ t2.AgentApiError = i, t2.mapAgentStatus = function(e3, t3) {
4124
+ return 429 === e3 ? "RATE_LIMITED" : 406 === e3 || 401 === e3 || 403 === e3 ? "AUTH" : 404 === e3 ? "NOT_FOUND" : 400 === e3 || 422 === e3 ? "BAD_CONFIG" : e3 >= 500 ? "start" === t3 ? "AI_UNAVAILABLE" : "NETWORK" : "MALFORMED";
4125
+ };
4126
+ }, 177: (e2, t2, i) => {
1794
4127
  "use strict";
1795
- Object.defineProperty(t2, "__esModule", { value: true }), t2.renderUploadFile = void 0, t2.renderUploadFile = ({ question: e3 }) => {
1796
- var t3, i;
1797
- const n = document.createElement("input");
1798
- return n.type = "file", n.required = e3.require, n.multiple = (null === (t3 = e3.assets) || void 0 === t3 ? void 0 : t3.multiple) || false, n.maxLength = (null === (i = e3.assets) || void 0 === i ? void 0 : i.maxFiles) || 1, { element: n, elementTypeClass: "magicfeedback-upload-file" };
4128
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.encodeAnswer = t2.toAgentStep = t2.ratingBounds = t2.mapAgentType = t2.DEFAULT_ANSWER_DELIMITER = void 0;
4129
+ const n = i(558), r = i(516);
4130
+ t2.DEFAULT_ANSWER_DELIMITER = ", ";
4131
+ const s = [n.FEEDBACKAPPANSWERTYPE.RADIO, n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOICE, n.FEEDBACKAPPANSWERTYPE.SELECT, n.FEEDBACKAPPANSWERTYPE.MULTIPLECHOISE_IMAGE], o = Object.values(n.FEEDBACKAPPANSWERTYPE);
4132
+ function a(e3, t3, i2) {
4133
+ var a2, l2, d2;
4134
+ const c2 = String(e3 || "").trim().toUpperCase();
4135
+ return "RATING" === c2 ? n.FEEDBACKAPPANSWERTYPE.RATING_NUMBER : c2 === n.FEEDBACKAPPANSWERTYPE.CONTACT ? (null === (a2 = i2.log) || void 0 === a2 || a2.log("[agentSurvey] CONTACT has no renderer, falling back to TEXT"), n.FEEDBACKAPPANSWERTYPE.TEXT) : o.includes(c2) ? s.includes(c2) && 0 === t3.length ? (null === (d2 = i2.log) || void 0 === d2 || d2.err(`[agentSurvey] ${c2} arrived with no options, falling back to TEXT`), n.FEEDBACKAPPANSWERTYPE.TEXT) : c2 !== n.FEEDBACKAPPANSWERTYPE.BOOLEAN || 2 !== t3.length || (function(e4, t4) {
4136
+ if (2 !== e4.length) return false;
4137
+ const i3 = e4.map(((e5) => String(e5).trim().toLowerCase())), n2 = (0, r.getBooleanOptions)(t4).map(((e5) => e5.toLowerCase())), s2 = ["yes", "no"];
4138
+ return i3[0] === s2[0] && i3[1] === s2[1] || i3[0] === n2[0] && i3[1] === n2[1];
4139
+ })(t3, i2.language) ? c2 : n.FEEDBACKAPPANSWERTYPE.RADIO : (null === (l2 = i2.log) || void 0 === l2 || l2.err(`[agentSurvey] unknown question type "${e3}", falling back to TEXT`), n.FEEDBACKAPPANSWERTYPE.TEXT);
4140
+ }
4141
+ function l(e3) {
4142
+ const t3 = e3.map(Number).filter(((e4) => Number.isFinite(e4)));
4143
+ return t3.length >= 2 ? { min: Math.min(...t3), max: Math.max(...t3) } : { min: 1, max: 5 };
4144
+ }
4145
+ function d(e3, t3, i2) {
4146
+ const r2 = { randomPosition: false, direction: "row", order: "ltr" };
4147
+ return e3 !== n.FEEDBACKAPPANSWERTYPE.RATING_NUMBER && e3 !== n.FEEDBACKAPPANSWERTYPE.RATING_EMOJI || Object.assign(r2, l(t3)), e3 === n.FEEDBACKAPPANSWERTYPE.LONGTEXT && (r2.maxCharacters = 0), Object.assign(Object.assign({}, r2), (null == i2 ? void 0 : i2.assets) || {});
4148
+ }
4149
+ function c(e3, t3, i2) {
4150
+ var n2, r2, s2, o2;
4151
+ const { full: l2, title: c2 } = t3, u = [...null !== (r2 = null !== (n2 = e3.questionValues) && void 0 !== n2 ? n2 : null == l2 ? void 0 : l2.value) && void 0 !== r2 ? r2 : []], p = a(null !== (s2 = null == l2 ? void 0 : l2.type) && void 0 !== s2 ? s2 : e3.questionType, u, i2), h = e3.questionRef || (null == l2 ? void 0 : l2.ref) || `agent-q-${e3.currentTurn}`;
4152
+ return { id: (null == l2 ? void 0 : l2.id) || `agent-${i2.sessionId}-${e3.currentTurn}`, title: c2 || "", type: p, questionType: { conf: null }, ref: h, require: null === (o2 = null == l2 ? void 0 : l2.require) || void 0 === o2 || o2, external_id: (null == l2 ? void 0 : l2.external_id) || "", value: u, defaultValue: (null == l2 ? void 0 : l2.defaultValue) || "", followup: false, position: e3.currentTurn, assets: d(p, u, l2), refMetric: (null == l2 ? void 0 : l2.refMetric) || "", integrationId: i2.integrationId, integrationPageId: "", status: "ACTIVE" };
4153
+ }
4154
+ t2.mapAgentType = a, t2.ratingBounds = l, t2.toAgentStep = function(e3, t3) {
4155
+ var i2, r2, s2;
4156
+ const o2 = e3, a2 = e3.currentTurn, l2 = e3.maxTurns, d2 = o2.coverageSummary, u = (e4) => ({ kind: "END", reason: e4, currentTurn: a2, maxTurns: l2, coverageSummary: d2 });
4157
+ if (o2.answerType === n.AGENT_ANSWER_TYPE_BLOCKED) return u("BLOCKED");
4158
+ if (true === o2.shouldEnd) return u("SHOULD_END");
4159
+ const p = (function(e4) {
4160
+ const t4 = e4.question && "object" == typeof e4.question ? e4.question : e4.nextQuestion && "object" == typeof e4.nextQuestion ? e4.nextQuestion : null;
4161
+ if (t4) {
4162
+ const e5 = t4, i3 = e5.title;
4163
+ return { full: e5, title: "string" == typeof i3 ? i3 : i3 ? JSON.stringify(i3) : null };
4164
+ }
4165
+ return { full: null, title: "string" == typeof e4.nextQuestion ? e4.nextQuestion : null };
4166
+ })(e3);
4167
+ return "NONE" === String(null !== (s2 = null !== (r2 = null === (i2 = p.full) || void 0 === i2 ? void 0 : i2.type) && void 0 !== r2 ? r2 : e3.questionType) && void 0 !== s2 ? s2 : "").trim().toUpperCase() ? u("TYPE_NONE") : p.title && p.title.trim() ? { kind: "QUESTION", question: c(e3, p, t3), isFromBase: true === e3.isFromBase, currentTurn: a2, maxTurns: l2, topic: o2.topic, coverageGaps: e3.coverageGaps, coverageSummary: d2 } : u("NO_QUESTION");
4168
+ }, t2.encodeAnswer = function(e3, i2, n2 = t2.DEFAULT_ANSWER_DELIMITER) {
4169
+ const r2 = i2.ref, s2 = (e4) => e4.flatMap(((e5) => Array.isArray(e5.value) ? e5.value : [e5.value])).map(((e5) => "string" == typeof e5 ? e5 : JSON.stringify(e5))).map(((e5) => (e5 || "").trim())).filter(((e5) => "" !== e5)), o2 = s2(e3.filter(((e4) => e4.key === r2))), a2 = s2(e3.filter(((e4) => e4.key === `extra-option-${r2}`)));
4170
+ return [o2.filter(((e4, t3) => o2.indexOf(e4) === t3)).join(n2), a2.join(n2)].filter(((e4) => "" !== e4)).join(n2);
1799
4171
  };
1800
- }, 843: (e2, t2) => {
4172
+ }, 107: (e2, t2, i) => {
1801
4173
  "use strict";
1802
- Object.defineProperty(t2, "__esModule", { value: true }), t2.renderUploadImage = void 0, t2.renderUploadImage = ({ question: e3 }) => {
1803
- var t3, i;
1804
- const n = document.createElement("input");
1805
- return n.type = "file", n.accept = "image/*", n.required = e3.require, n.multiple = (null === (t3 = e3.assets) || void 0 === t3 ? void 0 : t3.multiple) || false, n.maxLength = (null === (i = e3.assets) || void 0 === i ? void 0 : i.maxFiles) || 1, { element: n, elementTypeClass: "magicfeedback-upload-image" };
4174
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.scrapeInputs = void 0;
4175
+ const n = i(571);
4176
+ t2.scrapeInputs = function(e3) {
4177
+ const t3 = e3.querySelectorAll(".magicfeedback-input"), i2 = [], r = {};
4178
+ return t3.forEach(((e4) => {
4179
+ var t4;
4180
+ const s = e4, o = s.name;
4181
+ if (!o) return;
4182
+ const a = s.type;
4183
+ if (("radio" === a || "checkbox" === a) && !s.checked) return;
4184
+ const l = s.value, d = s.classList[0];
4185
+ if ((null == d ? void 0 : d.includes("magicfeedback-priority-list")) || (null === (t4 = s.id) || void 0 === t4 ? void 0 : t4.startsWith("priority-list-"))) return r[o] || (r[o] = []), void r[o].push(l);
4186
+ if (null == d ? void 0 : d.includes("magicfeedback-upload")) {
4187
+ const e5 = (0, n.getUploadValues)(s);
4188
+ return void (e5.length && i2.push({ key: o, value: e5 }));
4189
+ }
4190
+ const c = "magicfeedback-consent" === d ? s.checked.toString() : l;
4191
+ null != c && i2.push({ key: o, value: [c] });
4192
+ })), Object.entries(r).forEach((([e4, t4]) => {
4193
+ const n2 = t4.slice().sort(((e5, t5) => Number(e5.split(".")[0]) - Number(t5.split(".")[0])));
4194
+ i2.push({ key: e4, value: n2 });
4195
+ })), i2;
1806
4196
  };
1807
4197
  }, 857: (e2, t2) => {
1808
4198
  "use strict";
1809
- Object.defineProperty(t2, "__esModule", { value: true }), t2.endpoints = void 0, t2.endpoints = { sdk: { app: (e3, t3) => `sdk/app/${e3}/${t3}`, app_info: (e3, t3) => `sdk/app/${e3}/${t3}/info`, session: (e3) => `sdk/app/session/${e3}/info`, feedback: "sdk/feedback", followUpQuestion: "sdk/followUpQuestion" } };
4199
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.endpoints = void 0, t2.endpoints = { sdk: { app: (e3, t3) => `sdk/app/${e3}/${t3}`, app_info: (e3, t3) => `sdk/app/${e3}/${t3}/info`, session: (e3) => `sdk/app/session/${e3}/info`, feedback: "sdk/feedback", followUpQuestion: "sdk/followUpQuestion", agentSurveyStart: "sdk/agentSurvey/start", agentSurveyNext: "sdk/agentSurvey/next" } };
1810
4200
  }, 784: (e2, t2) => {
1811
4201
  "use strict";
1812
4202
  Object.defineProperty(t2, "__esModule", { value: true }), t2.placeholder = void 0, t2.placeholder = { answer: (e3) => {
@@ -1929,44 +4319,175 @@ var require_magicfeedback_sdk_browser = __commonJS({
1929
4319
  case "bn":
1930
4320
  return "\u09AE\u09CB\u099F \u09AA\u09AF\u09BC\u09C7\u09A8\u09CD\u099F 100 % \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7";
1931
4321
  }
1932
- } };
4322
+ }, upload: { cta: (e3) => {
4323
+ switch (e3) {
4324
+ case "es":
4325
+ return "Arrastra y suelta o haz clic para subir";
4326
+ case "da":
4327
+ return "Tr\xE6k og slip eller klik for at uploade";
4328
+ case "fi":
4329
+ return "Ved\xE4 ja pudota tai napsauta ladataksesi";
4330
+ case "sv":
4331
+ return "Dra och sl\xE4pp eller klicka f\xF6r att ladda upp";
4332
+ case "no":
4333
+ return "Dra og slipp eller klikk for \xE5 laste opp";
4334
+ case "ar":
4335
+ return "\u0627\u0633\u062D\u0628 \u0648\u0623\u0641\u0644\u062A \u0623\u0648 \u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u062D\u0645\u064A\u0644";
4336
+ case "bn":
4337
+ return "\u099F\u09C7\u09A8\u09C7 \u0986\u09A8\u09C1\u09A8 \u09AC\u09BE \u0986\u09AA\u09B2\u09CB\u09A1 \u0995\u09B0\u09A4\u09C7 \u0995\u09CD\u09B2\u09BF\u0995 \u0995\u09B0\u09C1\u09A8";
4338
+ default:
4339
+ return "Drag & drop or click to upload";
4340
+ }
4341
+ }, formats: (e3, t3) => {
4342
+ if ("image" === t3) switch (e3) {
4343
+ case "es":
4344
+ return "Solo im\xE1genes";
4345
+ case "da":
4346
+ return "Kun billeder";
4347
+ case "fi":
4348
+ return "Vain kuvat";
4349
+ case "sv":
4350
+ return "Endast bilder";
4351
+ case "no":
4352
+ return "Kun bilder";
4353
+ case "ar":
4354
+ return "\u0627\u0644\u0635\u0648\u0631 \u0641\u0642\u0637";
4355
+ case "bn":
4356
+ return "\u09B6\u09C1\u09A7\u09C1\u09AE\u09BE\u09A4\u09CD\u09B0 \u099B\u09AC\u09BF";
4357
+ default:
4358
+ return "Images only";
4359
+ }
4360
+ switch (e3) {
4361
+ case "es":
4362
+ return "Cualquier tipo de archivo";
4363
+ case "da":
4364
+ return "Enhver filtype";
4365
+ case "fi":
4366
+ return "Mik\xE4 tahansa tiedostotyyppi";
4367
+ case "sv":
4368
+ return "Alla filtyper";
4369
+ case "no":
4370
+ return "Alle filtyper";
4371
+ case "ar":
4372
+ return "\u0623\u064A \u0646\u0648\u0639 \u0645\u0646 \u0627\u0644\u0645\u0644\u0641\u0627\u062A";
4373
+ case "bn":
4374
+ return "\u09AF\u09C7\u0995\u09CB\u09A8\u09CB \u09A7\u09B0\u09A8\u09C7\u09B0 \u09AB\u09BE\u0987\u09B2";
4375
+ default:
4376
+ return "Any file type";
4377
+ }
4378
+ }, maxFiles: (e3, t3) => {
4379
+ switch (e3) {
4380
+ case "es":
4381
+ return `M\xE1x. ${t3} archivos`;
4382
+ case "da":
4383
+ return `Maks. ${t3} filer`;
4384
+ case "fi":
4385
+ return `Enint\xE4\xE4n ${t3} tiedostoa`;
4386
+ case "sv":
4387
+ return `Max ${t3} filer`;
4388
+ case "no":
4389
+ return `Maks ${t3} filer`;
4390
+ case "ar":
4391
+ return `${t3} \u0645\u0644\u0641\u0627\u062A \u0643\u062D\u062F \u0623\u0642\u0635\u0649`;
4392
+ case "bn":
4393
+ return `\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A ${t3}\u099F\u09BF \u09AB\u09BE\u0987\u09B2`;
4394
+ default:
4395
+ return `Max ${t3} files`;
4396
+ }
4397
+ }, maxSize: (e3, t3) => {
4398
+ switch (e3) {
4399
+ case "es":
4400
+ return `M\xE1x. ${t3} MB`;
4401
+ case "da":
4402
+ return `Maks. ${t3} MB`;
4403
+ case "fi":
4404
+ return `Enint\xE4\xE4n ${t3} MB`;
4405
+ case "sv":
4406
+ case "en":
4407
+ default:
4408
+ return `Max ${t3} MB`;
4409
+ case "no":
4410
+ return `Maks ${t3} MB`;
4411
+ case "ar":
4412
+ return `${t3} \u0645\u064A\u063A\u0627\u0628\u0627\u064A\u062A \u0643\u062D\u062F \u0623\u0642\u0635\u0649`;
4413
+ case "bn":
4414
+ return `\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A ${t3} MB`;
4415
+ }
4416
+ }, tooLarge: (e3, t3) => {
4417
+ switch (e3) {
4418
+ case "es":
4419
+ return `Archivo demasiado grande (m\xE1x. ${t3} MB)`;
4420
+ case "da":
4421
+ return `Filen er for stor (maks. ${t3} MB)`;
4422
+ case "fi":
4423
+ return `Tiedosto on liian suuri (enint\xE4\xE4n ${t3} MB)`;
4424
+ case "sv":
4425
+ return `Filen \xE4r f\xF6r stor (max ${t3} MB)`;
4426
+ case "no":
4427
+ return `Filen er for stor (maks ${t3} MB)`;
4428
+ case "ar":
4429
+ return `\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 ${t3} \u0645\u064A\u063A\u0627\u0628\u0627\u064A\u062A)`;
4430
+ case "bn":
4431
+ return `\u09AB\u09BE\u0987\u09B2\u099F\u09BF \u0996\u09C1\u09AC \u09AC\u09A1\u09BC (\u09B8\u09B0\u09CD\u09AC\u09CB\u099A\u09CD\u099A ${t3} MB)`;
4432
+ default:
4433
+ return `File is too large (max ${t3} MB)`;
4434
+ }
4435
+ }, remove: (e3) => {
4436
+ switch (e3) {
4437
+ case "es":
4438
+ return "Eliminar";
4439
+ case "da":
4440
+ case "no":
4441
+ return "Fjern";
4442
+ case "fi":
4443
+ return "Poista";
4444
+ case "sv":
4445
+ return "Ta bort";
4446
+ case "ar":
4447
+ return "\u0625\u0632\u0627\u0644\u0629";
4448
+ case "bn":
4449
+ return "\u09B8\u09B0\u09BE\u09A8";
4450
+ default:
4451
+ return "Remove";
4452
+ }
4453
+ } } };
1933
4454
  }, 213: (e2, t2, i) => {
1934
4455
  "use strict";
1935
4456
  Object.defineProperty(t2, "__esModule", { value: true }), t2.renderStartMessage = t2.renderSuccess = t2.renderError = t2.renderActions = t2.renderQuestions = void 0;
1936
4457
  const n = i(42), r = i(516), s = { small: "1rem", medium: "1.2rem", large: "1.5rem" };
1937
- t2.renderQuestions = function e3(t3, i2 = "standard", a = "en", o = { customIcons: false }, l) {
4458
+ t2.renderQuestions = function e3(t3, i2 = "standard", o = "en", a = { customIcons: false }, l) {
1938
4459
  if (!t3) throw new Error("[MagicFeedback] No questions provided");
1939
- const d = [], { customIcons: c, id: u } = o;
4460
+ const d = [], { customIcons: c, id: u } = a;
1940
4461
  return t3.forEach(((p) => {
1941
- var m, h;
1942
- if ((null === (h = null === (m = null == p ? void 0 : p.questionType) || void 0 === m ? void 0 : m.conf) || void 0 === h ? void 0 : h.length) > 0) {
4462
+ var h, m;
4463
+ if ((null === (m = null === (h = null == p ? void 0 : p.questionType) || void 0 === h ? void 0 : h.conf) || void 0 === m ? void 0 : m.length) > 0) {
1943
4464
  let t4 = document.createElement("div");
1944
4465
  t4.classList.add("magicfeedback-div");
1945
4466
  const n2 = document.createElement("label");
1946
- n2.setAttribute("for", `magicfeedback-${p.id}`), n2.textContent = (0, r.parseTitle)(p.title, a), n2.classList.add("magicfeedback-label"), t4.appendChild(n2), p.questionType.conf.forEach(((e4) => {
4467
+ n2.setAttribute("for", `magicfeedback-${p.id}`), n2.textContent = (0, r.parseTitle)(p.title, o), n2.classList.add("magicfeedback-label"), t4.appendChild(n2), p.questionType.conf.forEach(((e4) => {
1947
4468
  e4.ref = p.ref, p.assets[e4.id] && (e4.assets = { placeholder: p.assets[e4.id] });
1948
- })), e3(p.questionType.conf, i2, a, o, l).forEach(((e4) => {
4469
+ })), e3(p.questionType.conf, i2, o, a, l).forEach(((e4) => {
1949
4470
  t4.appendChild(e4);
1950
4471
  })), d.push(t4);
1951
4472
  } else {
1952
- const e4 = (function(e5, t4, i3, a2, o2) {
4473
+ const e4 = (function(e5, t4, i3, o2, a2) {
1953
4474
  var l2, d2, c2;
1954
- let u2, p2, { id: m2, title: h2, type: f, ref: v, require: g, defaultValue: y, assets: b } = e5, E = document.createElement("div");
4475
+ let u2, p2, { id: h2, title: m2, type: f, ref: g, require: v, defaultValue: y, assets: b } = e5, E = document.createElement("div");
1955
4476
  E.classList.add("magicfeedback-div");
1956
- const k = window.innerWidth < 600, A = "slim" === t4 ? (0, r.parseTitle)(h2, i3) : null == b ? void 0 : b.placeholder, C = (0, r.getUrlParam)(v), T = (null == b ? void 0 : b.maxCharacters) || 0, P = void 0 !== (null == b ? void 0 : b.randomPosition) && (null == b ? void 0 : b.randomPosition), w = (null == b ? void 0 : b.direction) || "row", x = (null == b ? void 0 : b.order) || "ltr", O = (0, n.getQuestionRenderer)(f);
1957
- if (!O) return E;
4477
+ const A = window.innerWidth < 600, k = "slim" === t4 ? (0, r.parseTitle)(m2, i3) : null == b ? void 0 : b.placeholder, C = (0, r.getUrlParam)(g), T = (null == b ? void 0 : b.maxCharacters) || 0, P = void 0 !== (null == b ? void 0 : b.randomPosition) && (null == b ? void 0 : b.randomPosition), O = (null == b ? void 0 : b.direction) || "row", x = (null == b ? void 0 : b.order) || "ltr", w = (0, n.getQuestionRenderer)(f);
4478
+ if (!w) return E;
1958
4479
  {
1959
- const n2 = O({ question: e5, format: t4, language: i3, url: a2, send: o2, isPhone: k, urlParamValue: C, placeholderText: A, maxCharacters: T, randomPosition: P, direction: w, order: x });
4480
+ const n2 = w({ question: e5, format: t4, language: i3, url: o2, send: a2, isPhone: A, urlParamValue: C, placeholderText: k, maxCharacters: T, randomPosition: P, direction: O, order: x });
1960
4481
  u2 = n2.element, p2 = n2.elementTypeClass;
1961
4482
  }
1962
- u2.id = `magicfeedback-${m2}`, u2.setAttribute("name", v), u2.classList.add(p2), (void 0 !== y || null !== C) && (u2.value = C || y), ["RADIO", "MULTIPLECHOICE"].includes(f) || (u2.classList.add("magicfeedback-input"), u2.required = g);
4483
+ u2.id = `magicfeedback-${h2}`, u2.setAttribute("name", g), u2.classList.add(p2), (void 0 !== y || null !== C) && (u2.value = C || y), ["RADIO", "MULTIPLECHOICE", "UPLOAD_IMAGE", "UPLOAD_FILE"].includes(f) || (u2.classList.add("magicfeedback-input"), u2.required = v);
1963
4484
  const L = document.createElement("label");
1964
- L.setAttribute("for", `magicfeedback-${m2}`), L.textContent = (0, r.parseTitle)(h2, i3), L.classList.add("magicfeedback-label"), (function(e6, t5) {
4485
+ L.setAttribute("for", `magicfeedback-${h2}`), L.textContent = (0, r.parseTitle)(m2, i3), L.classList.add("magicfeedback-label"), (function(e6, t5) {
1965
4486
  if ("INFO_PAGE" !== t5.type) return;
1966
4487
  const { assets: i4 } = t5, n2 = (function(e7) {
1967
4488
  if (e7) return s[e7] || e7;
1968
- })(null == i4 ? void 0 : i4.titleSize), r2 = (a3 = null == i4 ? void 0 : i4.titleStyle, Array.isArray(a3) ? a3 : a3 ? [a3] : []);
1969
- var a3;
4489
+ })(null == i4 ? void 0 : i4.titleSize), r2 = (o3 = null == i4 ? void 0 : i4.titleStyle, Array.isArray(o3) ? o3 : o3 ? [o3] : []);
4490
+ var o3;
1970
4491
  n2 && e6.style.setProperty("font-size", n2, "important"), (null == i4 ? void 0 : i4.titleAlign) && (e6.style.setProperty("width", "100%", "important"), e6.style.setProperty("align-self", "stretch", "important"), e6.style.setProperty("text-align", i4.titleAlign, "important")), r2.includes("italic") && e6.style.setProperty("font-style", "italic", "important"), r2.includes("bold") && e6.style.setProperty("font-weight", "bold", "important"), r2.includes("underline") && e6.style.setProperty("text-decoration", "underline", "important");
1971
4492
  })(L, e5);
1972
4493
  const S = document.createElement("label");
@@ -1984,28 +4505,28 @@ var require_magicfeedback_sdk_browser = __commonJS({
1984
4505
  const e7 = document.createElement("div");
1985
4506
  e7.classList.add("magicfeedback-skip-container"), e7.classList.add("magicfeedback-checkbox-container"), e7.style.display = "flex", e7.style.justifyContent = "flex-start";
1986
4507
  const t5 = document.createElement("input");
1987
- t5.classList.add("magicfeedback-skip"), t5.type = "checkbox", t5.id = `skip-${v}`, t5.name = v, t5.value = "-", t5.style.cursor = "pointer";
4508
+ t5.classList.add("magicfeedback-skip"), t5.type = "checkbox", t5.id = `skip-${g}`, t5.name = g, t5.value = "-", t5.style.cursor = "pointer";
1988
4509
  const i4 = document.createElement("label");
1989
- i4.htmlFor = `skip-${v}`, i4.textContent = null == b ? void 0 : b.extraOptionText, i4.style.fontSize = "15px", i4.style.cursor = "pointer", i4.style.margin = "0 5px", t5.addEventListener("click", (() => {
1990
- u2.value = "-", o2 && o2();
4510
+ i4.htmlFor = `skip-${g}`, i4.textContent = null == b ? void 0 : b.extraOptionText, i4.style.fontSize = "15px", i4.style.cursor = "pointer", i4.style.margin = "0 5px", t5.addEventListener("click", (() => {
4511
+ u2.value = "-", a2 && a2();
1991
4512
  })), e7.appendChild(t5), e7.appendChild(i4), E.appendChild(e7);
1992
4513
  }
1993
4514
  } else E.appendChild(u2);
1994
4515
  }
1995
4516
  return E;
1996
- })(p, i2, a, "https://survey-dev.magicfeedback.io/assets/emojis" + (c ? `/${u}` : ""), 1 === t3.length ? l : void 0);
4517
+ })(p, i2, o, "https://survey-dev.magicfeedback.io/assets/emojis" + (c ? `/${u}` : ""), 1 === t3.length ? l : void 0);
1997
4518
  d.push(e4);
1998
4519
  }
1999
4520
  })), d;
2000
4521
  }, t2.renderActions = function(e3 = "", t3, i2 = "Submit", n2 = "Back", r2 = "Next") {
2001
4522
  const s2 = document.createElement("div");
2002
4523
  s2.classList.add("magicfeedback-action-container");
2003
- const a = document.createElement("button");
2004
- a.id = "magicfeedback-submit", a.type = "submit", a.classList.add("magicfeedback-submit"), a.textContent = "MAGICSURVEY" === e3 ? r2 || "Next" : i2 || "Submit";
2005
4524
  const o = document.createElement("button");
2006
- return o.id = "magicfeedback-back", o.type = "button", o.classList.add("magicfeedback-back"), o.textContent = n2 || "Back", o.addEventListener("click", t3), o.addEventListener("click", (() => {
2007
- a.removeAttribute("disabled");
2008
- })), "MAGICSURVEY" === e3 && s2.appendChild(o), s2.appendChild(a), s2;
4525
+ o.id = "magicfeedback-submit", o.type = "submit", o.classList.add("magicfeedback-submit"), o.textContent = "MAGICSURVEY" === e3 ? r2 || "Next" : i2 || "Submit";
4526
+ const a = document.createElement("button");
4527
+ return a.id = "magicfeedback-back", a.type = "button", a.classList.add("magicfeedback-back"), a.textContent = n2 || "Back", a.addEventListener("click", t3), a.addEventListener("click", (() => {
4528
+ o.removeAttribute("disabled");
4529
+ })), "MAGICSURVEY" === e3 && s2.appendChild(a), s2.appendChild(o), s2;
2009
4530
  }, t2.renderError = function(e3) {
2010
4531
  const t3 = document.createElement("div");
2011
4532
  return t3.classList.add("magicfeedback-error"), t3.textContent = e3, t3;
@@ -2027,84 +4548,84 @@ var require_magicfeedback_sdk_browser = __commonJS({
2027
4548
  "use strict";
2028
4549
  var n = this && this.__awaiter || function(e3, t3, i2, n2) {
2029
4550
  return new (i2 || (i2 = Promise))((function(r2, s2) {
2030
- function a2(e4) {
4551
+ function o2(e4) {
2031
4552
  try {
2032
- l2(n2.next(e4));
4553
+ l(n2.next(e4));
2033
4554
  } catch (e5) {
2034
4555
  s2(e5);
2035
4556
  }
2036
4557
  }
2037
- function o2(e4) {
4558
+ function a2(e4) {
2038
4559
  try {
2039
- l2(n2.throw(e4));
4560
+ l(n2.throw(e4));
2040
4561
  } catch (e5) {
2041
4562
  s2(e5);
2042
4563
  }
2043
4564
  }
2044
- function l2(e4) {
4565
+ function l(e4) {
2045
4566
  var t4;
2046
4567
  e4.done ? r2(e4.value) : (t4 = e4.value, t4 instanceof i2 ? t4 : new i2((function(e5) {
2047
4568
  e5(t4);
2048
- }))).then(a2, o2);
4569
+ }))).then(o2, a2);
2049
4570
  }
2050
- l2((n2 = n2.apply(e3, t3 || [])).next());
4571
+ l((n2 = n2.apply(e3, t3 || [])).next());
2051
4572
  }));
2052
4573
  }, r = this && this.__importDefault || function(e3) {
2053
4574
  return e3 && e3.__esModule ? e3 : { default: e3 };
2054
4575
  };
2055
- Object.defineProperty(t2, "__esModule", { value: true }), t2.getFollowUpQuestion = t2.sendFeedback = t2.getQuestions = t2.getSessionForm = t2.getForm = t2.validateEmail = void 0;
2056
- const s = r(i(945)), a = r(i(330)), o = i(857), l = { Accept: "application/json", "Magicfeedback-Sdk-Version": a.default.version, "x-magicfeedback-parameters": window.location.search || "" };
2057
- t2.validateEmail = function(e3) {
4576
+ Object.defineProperty(t2, "__esModule", { value: true }), t2.getFollowUpQuestion = t2.sendFeedback = t2.getQuestions = t2.getSessionForm = t2.getForm = t2.validateEmail = t2.header = void 0;
4577
+ const s = r(i(326)), o = r(i(330)), a = i(857);
4578
+ t2.header = { Accept: "application/json", "Magicfeedback-Sdk-Version": o.default.version, "x-magicfeedback-parameters": window.location.search || "" }, t2.validateEmail = function(e3) {
2058
4579
  return /\S+@\S+\.\S+/.test(e3);
2059
- }, t2.getForm = function(e3, t3, i2, r2) {
4580
+ }, t2.getForm = function(e3, i2, r2, o2) {
2060
4581
  return n(this, void 0, void 0, (function* () {
2061
4582
  try {
2062
- const n2 = yield (0, s.default)(e3 + o.endpoints.sdk.app_info(t3, i2), { method: "GET", headers: l });
4583
+ const n2 = yield (0, s.default)(e3 + a.endpoints.sdk.app_info(i2, r2), { method: "GET", headers: t2.header });
2063
4584
  return yield n2.json();
2064
4585
  } catch (e4) {
2065
- r2.err(e4);
4586
+ o2.err(e4);
2066
4587
  }
2067
4588
  }));
2068
- }, t2.getSessionForm = function(e3, t3, i2) {
4589
+ }, t2.getSessionForm = function(e3, i2, r2) {
2069
4590
  return n(this, void 0, void 0, (function* () {
2070
4591
  try {
2071
- const i3 = yield (0, s.default)(e3 + o.endpoints.sdk.session(t3), { method: "GET", headers: l });
2072
- return yield i3.json();
4592
+ const n2 = yield (0, s.default)(e3 + a.endpoints.sdk.session(i2), { method: "GET", headers: t2.header });
4593
+ return yield n2.json();
2073
4594
  } catch (e4) {
2074
- i2.err(e4);
4595
+ r2.err(e4);
2075
4596
  }
2076
4597
  }));
2077
- }, t2.getQuestions = function(e3, t3, i2, r2) {
4598
+ }, t2.getQuestions = function(e3, i2, r2, o2) {
2078
4599
  return n(this, void 0, void 0, (function* () {
2079
4600
  try {
2080
- const n2 = yield (0, s.default)(e3 + o.endpoints.sdk.app(t3, i2), { method: "GET", headers: l });
4601
+ const n2 = yield (0, s.default)(e3 + a.endpoints.sdk.app(i2, r2), { method: "GET", headers: t2.header });
2081
4602
  if (n2.ok) {
2082
4603
  const e4 = yield n2.json();
2083
- return r2.log(`Received questions for app ${t3}`, e4), e4;
4604
+ return o2.log(`Received questions for app ${i2}`, e4), e4;
2084
4605
  }
2085
- throw r2.err(`Failed to get questions for app ${t3}:`, n2.status, n2.statusText), new Error("[MagicFeedback] Bad response from server");
4606
+ throw o2.err(`Failed to get questions for app ${i2}:`, n2.status, n2.statusText), new Error("[MagicFeedback] Bad response from server");
2086
4607
  } catch (e4) {
2087
- return r2.err(e4), [];
4608
+ return o2.err(e4), [];
2088
4609
  }
2089
4610
  }));
2090
- }, t2.sendFeedback = function(e3, t3, i2) {
4611
+ }, t2.sendFeedback = function(e3, i2, r2) {
2091
4612
  return n(this, void 0, void 0, (function* () {
2092
4613
  try {
2093
- const n2 = yield (0, s.default)(e3 + o.endpoints.sdk.feedback, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, l), body: JSON.stringify(t3) });
2094
- if (n2.ok) return i2.log(`Form ${t3.integration} submitted successfully!`), (yield n2.json()).sessionId;
2095
- throw i2.err(`Failed to submit form ${t3.integration}:`, n2.status, n2.statusText), new Error(n2.statusText);
4614
+ const n2 = yield (0, s.default)(e3 + a.endpoints.sdk.feedback, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, t2.header), body: JSON.stringify(i2) });
4615
+ if (n2.ok) return r2.log(`Form ${i2.integration} submitted successfully!`), (yield n2.json()).sessionId;
4616
+ throw r2.err(`Failed to submit form ${i2.integration}:`, n2.status, n2.statusText), new Error(n2.statusText);
2096
4617
  } catch (e4) {
2097
- return i2.err(e4), "";
4618
+ return r2.err(e4), "";
2098
4619
  }
2099
4620
  }));
2100
- }, t2.getFollowUpQuestion = function(e3, t3, i2) {
4621
+ }, t2.getFollowUpQuestion = function(e3, i2, r2) {
2101
4622
  return n(this, void 0, void 0, (function* () {
2102
4623
  try {
2103
- const n2 = yield (0, s.default)(e3 + o.endpoints.sdk.followUpQuestion, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, l), body: JSON.stringify(t3) });
2104
- if (n2.ok) return i2.log(`Received follow up question for form ${t3.integration}`), (yield n2.json()) || "";
2105
- throw i2.err(`Failed to get follow up question for form ${t3.integration}:`, n2.status, n2.statusText), new Error(n2.statusText);
4624
+ const n2 = yield (0, s.default)(e3 + a.endpoints.sdk.followUpQuestion, { method: "POST", headers: Object.assign({ "Content-Type": "application/json" }, t2.header), body: JSON.stringify(i2) });
4625
+ if (n2.ok) return r2.log(`Received follow up question for form ${i2.integration}`), (yield n2.json()) || "";
4626
+ throw r2.err(`Failed to get follow up question for form ${i2.integration}:`, n2.status, n2.statusText), new Error(n2.statusText);
2106
4627
  } catch (e4) {
2107
- return i2.err(e4), "";
4628
+ return r2.err(e4), "";
2108
4629
  }
2109
4630
  }));
2110
4631
  };
@@ -2123,7 +4644,7 @@ var require_magicfeedback_sdk_browser = __commonJS({
2123
4644
  };
2124
4645
  }, 330: (e2) => {
2125
4646
  "use strict";
2126
- e2.exports = JSON.parse('{"name":"@magicfeedback/native","version":"2.2.1","main":"./dist/magicfeedback-sdk.node.js","browser":"./dist/magicfeedback-sdk.browser.js","types":"./dist/types/src/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/MagicFeedback/magicfeedback-sdk.git"},"author":"farias@magicfeedback.io","license":"MIT","private":false,"scripts":{"dev":"vite","build":"webpack","build:watch":"webpack --watch --mode development","release":"npm publish --access public","release:beta":"npm publish --access public --tag beta","release:alpha":"npm publish --access public --tag alpha","test":"jest","test:watch":"jest --watchAll","coverage":"vitest run --coverage","publish:sdk":"bash publish.sh","publish:sdk:dry-run":"NPM_DRY_RUN=1 bash publish.sh"},"files":["dist"],"devDependencies":{"@babel/preset-typescript":"^7.22.5","@types/node":"^17.0.21","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.3","c8":"^7.11.0","copy-webpack-plugin":"^11.0.0","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","jest-fetch-mock":"^3.0.3","nock":"^13.2.4","ts-jest":"^29.1.0","ts-loader":"^9.2.7","ts-node":"^10.7.0","typescript":"^4.6.2","vite":"^2.8.0","vite-plugin-dts":"^0.9.9","vitest":"^0.5.9","webpack":"^5.70.0","webpack-cli":"^4.9.2","webpack-node-externals":"^3.0.0"},"dependencies":{"cross-fetch":"^3.1.5","is-bundling-for-browser-or-node":"^1.1.1"},"description":"MagicFeedbackAI JavaScript Library for [MagicFeedback.io](https://magicfeedback.io/)","bugs":{"url":"https://github.com/MagicFeedback/magicfeedback-sdk/issues"},"homepage":"https://github.com/MagicFeedback/magicfeedback-sdk#readme","directories":{"example":"examples","test":"test"},"style":"./dist/styles/magicfeedback-default.css"}');
4647
+ e2.exports = JSON.parse('{"name":"@magicfeedback/native","version":"2.2.8","main":"./dist/magicfeedback-sdk.node.js","browser":"./dist/magicfeedback-sdk.browser.js","types":"./dist/types/src/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/MagicFeedback/magicfeedback-sdk.git"},"author":"farias@magicfeedback.io","license":"MIT","private":false,"scripts":{"dev":"vite","build":"webpack","build:watch":"webpack --watch --mode development","release":"npm publish --access public","release:beta":"npm publish --access public --tag beta","release:alpha":"npm publish --access public --tag alpha","test":"jest","test:watch":"jest --watchAll","coverage":"vitest run --coverage","publish:sdk":"bash publish.sh","publish:sdk:dry-run":"NPM_DRY_RUN=1 bash publish.sh"},"files":["dist"],"devDependencies":{"@babel/preset-typescript":"^7.22.5","@types/node":"^17.0.21","@types/webpack":"^5.28.0","@types/webpack-node-externals":"^2.5.3","c8":"^7.11.0","copy-webpack-plugin":"^11.0.0","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","jest-fetch-mock":"^3.0.3","nock":"^13.2.4","ts-jest":"^29.1.0","ts-loader":"^9.2.7","ts-node":"^10.7.0","typescript":"^4.6.2","vite":"^2.8.0","vite-plugin-dts":"^0.9.9","vitest":"^0.5.9","webpack":"^5.70.0","webpack-cli":"^4.9.2","webpack-node-externals":"^3.0.0"},"dependencies":{"cross-fetch":"^3.1.5","is-bundling-for-browser-or-node":"^1.1.1"},"description":"MagicFeedbackAI JavaScript Library for [MagicFeedback.io](https://magicfeedback.io/)","bugs":{"url":"https://github.com/MagicFeedback/magicfeedback-sdk/issues"},"homepage":"https://github.com/MagicFeedback/magicfeedback-sdk#readme","directories":{"example":"examples","test":"test"},"style":"./dist/styles/magicfeedback-default.css"}');
2127
4648
  } }, t = {}, (function i(n) {
2128
4649
  var r = t[n];
2129
4650
  if (void 0 !== r) return r.exports;
@@ -2241,7 +4762,6 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2241
4762
  // oscuros con texto blanco sobre el fondo claro del popup.
2242
4763
  colorScheme: isDark ? "dark" : "light",
2243
4764
  textPrimary: isDark ? "#f0f0f0" : "#111",
2244
- closeBtnHoverBg: isDark ? "rgba(255,255,255,0.10)" : "rgba(0,0,0,0.06)",
2245
4765
  closeBtnHoverColor: isDark ? "#fff" : "#000000",
2246
4766
  textMuted: isDark ? "#9ca3af" : "#6b7280",
2247
4767
  progressTrack: isDark ? "#3f3f46" : "#e5e7eb"
@@ -2302,8 +4822,8 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2302
4822
  closeBtn.type = "button";
2303
4823
  closeBtn.setAttribute("aria-label", "Close popup");
2304
4824
  closeBtn.innerHTML = `
2305
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2306
- <path d="M6 6L18 18M6 18L18 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
4825
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4826
+ <path d="M5 5L19 19M5 19L19 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="butt"/>
2307
4827
  </svg>
2308
4828
  `;
2309
4829
  closeBtn.style.cssText = `
@@ -2318,17 +4838,15 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2318
4838
  cursor:pointer;
2319
4839
  color:${theme.textPrimary};
2320
4840
  padding:4px;
2321
- transition: color .15s ease, transform .15s ease, background .15s ease;
4841
+ transition: color .15s ease, transform .15s ease;
2322
4842
  box-shadow: none !important;
2323
4843
  `;
2324
4844
  closeBtn.onmouseenter = () => {
2325
4845
  closeBtn.style.color = theme.closeBtnHoverColor;
2326
- closeBtn.style.background = theme.closeBtnHoverBg;
2327
4846
  closeBtn.style.transform = "scale(1.06)";
2328
4847
  };
2329
4848
  closeBtn.onmouseleave = () => {
2330
4849
  closeBtn.style.color = theme.textPrimary;
2331
- closeBtn.style.background = "transparent";
2332
4850
  closeBtn.style.transform = "scale(1)";
2333
4851
  };
2334
4852
  closeBtn.onclick = () => {
@@ -2718,47 +5236,7 @@ async function renderPopup(container, surveyId, productId, actions, emit, onClos
2718
5236
  backButton.style.color = s.buttonSecondaryColor;
2719
5237
  backButton.style.border = "none";
2720
5238
  }
2721
- if (s.logo) {
2722
- if (!document.getElementById("deepdots-popup-logo")) {
2723
- const logoImg = document.createElement("img");
2724
- logoImg.id = "deepdots-popup-logo";
2725
- logoImg.src = s.logo;
2726
- logoImg.alt = "Logo";
2727
- logoImg.style.cssText = "max-height:40px; max-width:100%; object-fit:contain;";
2728
- if (s.logoSize) {
2729
- switch (s.logoSize) {
2730
- case "small":
2731
- logoImg.style.maxHeight = "30px";
2732
- break;
2733
- case "medium":
2734
- logoImg.style.maxHeight = "50px";
2735
- break;
2736
- case "large":
2737
- logoImg.style.maxHeight = "70px";
2738
- break;
2739
- }
2740
- }
2741
- if (s.logoPosition) {
2742
- switch (s.logoPosition) {
2743
- case "left":
2744
- logoImg.style.margin = "0 16px 42px 0";
2745
- logoImg.style.display = "block";
2746
- logoImg.style.marginLeft = "0";
2747
- break;
2748
- case "right":
2749
- logoImg.style.margin = "0 0 42px 16px";
2750
- logoImg.style.display = "block";
2751
- logoImg.style.marginLeft = "auto";
2752
- break;
2753
- case "center":
2754
- logoImg.style.margin = "0 auto 42px auto";
2755
- logoImg.style.display = "block";
2756
- break;
2757
- }
2758
- }
2759
- containerContent.insertBefore(logoImg, main);
2760
- }
2761
- }
5239
+ insertPopupLogo(popup, progressEl, s, "deepdots-popup-logo");
2762
5240
  if (s.startMessage && s.startMessage !== "") {
2763
5241
  sdkLog(s.startMessage);
2764
5242
  onStartPage = true;
@@ -2829,6 +5307,7 @@ var init_renderPopup = __esm({
2829
5307
  "use strict";
2830
5308
  init_tracking_manager();
2831
5309
  init_font();
5310
+ init_logo();
2832
5311
  init_logger();
2833
5312
  import_native = __toESM(require_magicfeedback_sdk_browser());
2834
5313
  init_style();
@@ -3069,7 +5548,7 @@ function jsonForScript(value) {
3069
5548
  }
3070
5549
  function buildSurveyHtml(opts) {
3071
5550
  const env = opts.env === "development" ? "dev" : "prod";
3072
- const version = opts.version ?? "2.2.4";
5551
+ const version = opts.version ?? "2.2.8";
3073
5552
  const cdn = `https://cdn.jsdelivr.net/npm/@magicfeedback/native@${version}/dist/magicfeedback-sdk.browser.js`;
3074
5553
  const sid = jsonForScript(opts.surveyId);
3075
5554
  const pid = jsonForScript(opts.productId);
@@ -3146,7 +5625,7 @@ body{display:${bodyDisplay};justify-content:${pos.justifyContent};align-items:${
3146
5625
  #dd-form-wrapper{width:100%;flex:1 1 auto}
3147
5626
  #mf{width:100%;box-sizing:border-box;visibility:hidden}
3148
5627
  .deepdots-popup-main *{max-width:100%;box-sizing:border-box}
3149
- #dd-logo{max-height:40px;max-width:100%;object-fit:contain}
5628
+ #dd-logo{max-height:40px;max-width:100%;object-fit:contain;display:block;margin:12px 0 0 0}
3150
5629
  .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}
3151
5630
  /* Pantalla final: el HTML del editor de la plataforma (imagen + texto), centrado. */
3152
5631
  .deepdots-success{display:none;width:100%;text-align:center;padding:24px 0;color:${textPrimary}}
@@ -3179,8 +5658,8 @@ ${customCss}
3179
5658
  <div class="deepdots-popup-header">
3180
5659
  <h2 id="dd-title" class="deepdots-popup-title" hidden></h2>
3181
5660
  <button type="button" id="dd-close" aria-label="Close popup">
3182
- <svg width="28" height="28" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
3183
- <path d="M6 6L18 18M6 18L18 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5661
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5662
+ <path d="M5 5L19 19M5 19L19 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="butt"/>
3184
5663
  </svg>
3185
5664
  </button>
3186
5665
  </div>
@@ -3404,10 +5883,12 @@ ${customCss}
3404
5883
  if(s.logoSize==='small'){ logoImg.style.maxHeight='30px'; }
3405
5884
  else if(s.logoSize==='medium'){ logoImg.style.maxHeight='50px'; }
3406
5885
  else if(s.logoSize==='large'){ logoImg.style.maxHeight='70px'; }
3407
- if(s.logoPosition==='left'){ logoImg.style.margin='0 16px 20px 0'; logoImg.style.display='block'; logoImg.style.marginLeft='0'; }
3408
- else if(s.logoPosition==='right'){ logoImg.style.margin='0 0 20px 16px'; logoImg.style.display='block'; logoImg.style.marginLeft='auto'; }
3409
- else if(s.logoPosition==='center'){ logoImg.style.margin='0 auto 20px auto'; logoImg.style.display='block'; }
3410
- main.insertBefore(logoImg, document.getElementById('dd-form-wrapper'));
5886
+ if(s.logoPosition==='left'){ logoImg.style.margin='12px 16px 0 0'; logoImg.style.marginLeft='0'; }
5887
+ else if(s.logoPosition==='right'){ logoImg.style.margin='12px 0 0 16px'; logoImg.style.marginLeft='auto'; }
5888
+ else if(s.logoPosition==='center'){ logoImg.style.margin='12px auto 0 auto'; }
5889
+ // Encima de la barra de progreso, como hermano del header (espejo de ui/logo.ts en
5890
+ // web). Fuera de #dd-main, as\xED el logo no se va con el scroll del formulario.
5891
+ popup.insertBefore(logoImg, progressEl);
3411
5892
  }
3412
5893
  if(s.startMessage && s.startMessage!==''){ onStartPage=true; updateButtons('start'); }
3413
5894
  else { updateButtons('in_progress_first'); }