@sprig-technologies/sprig-bundled 2.47.0 → 2.48.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/conversational-styles-Cz5QI3hV.js +4 -0
  2. package/dist/conversational-styles-DKmvloou.cjs +1 -0
  3. package/dist/{conversational-ui-CEmVz2Vg.cjs → conversational-ui-7CP-cLZe.cjs} +2 -2
  4. package/dist/{conversational-ui-CXl_8HB_.js → conversational-ui-BA_Spq-D.js} +74 -75
  5. package/dist/conversational-v2-styles-C-VtU8rP.js +4 -0
  6. package/dist/conversational-v2-styles-DLvybr0T.cjs +1 -0
  7. package/dist/getAttributedUrl-DFRoHvvS.js +197 -0
  8. package/dist/getAttributedUrl-JjAfDdLt.cjs +12 -0
  9. package/dist/index-0iqjhKVX.js +4 -0
  10. package/dist/index-1BOPr1FN.cjs +1 -0
  11. package/dist/{index-BBiYWZkL.cjs → index-BzHQzSxf.cjs} +2 -2
  12. package/dist/index-CMTWNs3h.js +4 -0
  13. package/dist/index-Cvesqg_C.cjs +1 -0
  14. package/dist/index-D1-6eKzp.js +768 -0
  15. package/dist/index-ElJgds4s.cjs +1 -0
  16. package/dist/{index-BNI3IK7K.js → index-stTkpjhx.js} +4 -4
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +1 -1
  20. package/dist/view-CGsEDlvu.js +1834 -0
  21. package/dist/view-K9v6s8h_.cjs +1 -0
  22. package/package.json +1 -1
  23. package/dist/conversational-styles-BO6t2-y4.js +0 -4
  24. package/dist/conversational-styles-CWaKMg_f.cjs +0 -1
  25. package/dist/conversational-v2-styles-D5xNLWoE.cjs +0 -1
  26. package/dist/conversational-v2-styles-GH9tfuXI.js +0 -4
  27. package/dist/getAttributedUrl-D-vLs0_x.js +0 -194
  28. package/dist/getAttributedUrl-DNR4xoBk.cjs +0 -12
  29. package/dist/index-B-aCET7A.js +0 -737
  30. package/dist/index-DD639GNJ.cjs +0 -1
  31. package/dist/view-B4aVfDPi.cjs +0 -1
  32. package/dist/view-eRBVyC0l.js +0 -1831
@@ -0,0 +1,4 @@
1
+ const e = `html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;min-width:200px;justify-content:safe center;animation:enable-transitions 0s .3s forwards;min-height:0}@keyframes enable-transitions{to{transition:opacity .2s ease-in-out}}.ul-focus-transitions-active .ul-card,.ul-card--with-transitions{transition:opacity .2s ease-in-out}.ul-card__container--desktop{border:2px solid var(--border-color);box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container--desktop_longFormSurvey,.ul-card__container--mobile_longFormSurvey{margin:0}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-display-logic-preview-message{font-size:14px;line-height:20px;padding:24px 20px;text-align:center}.ul-card__container{background:var(--background-color);border-radius:6px;display:flex;flex-direction:column;flex:1 1 auto;font-size:17px;line-height:23px;padding:0;min-height:0;position:relative;text-align:center;word-break:normal}.ul-card__container--desktop_feedbackButton{box-shadow:unset}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:center;align-self:stretch}.sprig-question-footer-container{align-items:center;width:100%;height:fit-content;display:flex;flex-direction:column;padding:12px 20px 0}.long-form-question-footer-container{position:relative;width:100%;display:flex;justify-content:flex-end;align-items:center;gap:20px;padding:16px;pointer-events:none}.long-form-question-footer-container--mobile{padding:16px;flex:0 1}@media only screen and (max-width: 700px){.ul-lfs-nav-button-wrapper{padding:32px 0 0}}.long-form-question-footer-container-center{justify-content:center}.long-form-question-footer-container .long-form-question-footer-container-logo{width:auto;pointer-events:auto}.conversational-ui .long-form-question-footer-container-logo{position:sticky;bottom:32px;margin:16px;width:112px;padding:4px;background-color:var(--background-color);border-radius:24px}.long-form-question-footer-container-center .long-form-question-footer-container-logo{margin-left:0}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:var(--text-color);text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email,.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;z-index:2;height:fit-content;overflow:auto;scrollbar-width:thin;scroll-behavior:smooth}.sprig-border-bottom{border-bottom:1px solid var(--border-color)}.sprig-border-top{border-top:1px solid var(--border-color)}.question-header-container{z-index:1}.sprig-header-container{padding:16px}.question-header-button-container{display:grid;grid-template-columns:97fr 3fr;align-items:center;justify-content:space-between;width:100%;height:fit-content}.ul-card--thanks-content .question-header-button-container{justify-content:center}.sprig-question-body{padding:0 16px;min-height:fit-content;flex-shrink:1;overflow:auto;position:relative;align-self:stretch;width:100%}.sprig-stretch{align-self:stretch}.ul-question{color:var(--text-color);display:block;font-size:20px;line-height:140%;font-weight:500;cursor:default;text-align:start}.ul-question ol,.ul-question ul,.ul-caption ol,.ul-caption ul{margin-left:1em}.ul-caption{color:var(--text-color-light);flex:1 0 auto;font-size:15px;line-height:140%;font-weight:400;letter-spacing:.02em;text-align:start}.ul-card__choices{display:flex;flex-direction:column;align-items:flex-start;gap:6px;align-self:stretch;flex:1 0}.choice--desktop,.choice--mobile{border:none}.choice{align-items:center;color:var(--text-color);cursor:pointer;display:flex;flex-direction:row;flex-wrap:wrap;gap:12px;align-self:stretch;box-sizing:border-box;border-radius:8px;font-size:15px;line-height:140%;padding:8px 12px 8px 8px;background:var(--background-color-darker)}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:var(--thank-you-link-background-hover)}.choice-label-container{display:flex;flex-direction:row;flex:1;gap:12px;min-width:0;justify-content:flex-start}.choice-text-entry-container{width:100%;height:fit-content;flex:0 0 100%;overflow:hidden}.choice .choice-text-input--mobile{border:2px solid var(--border-color);max-height:63px}.choice .choice-text-input--desktop{border:1px solid var(--border-color);max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:var(--background-color);border-radius:8px;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:8px 12px;margin-top:0;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:var(--text-color-light)}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.select-checkbox{height:16px;width:16px;display:flex;box-sizing:border-box;background:var(--background-color);align-items:center;justify-content:center;border-radius:4px;border:1px solid var(--select-border-hover);flex-shrink:0;margin-top:3px}.select-radio{height:16px;width:16px;border-radius:22px;border:1px solid var(--select-border-hover);background:var(--background-color);display:flex;box-sizing:border-box;box-shadow:none;align-items:center;justify-content:center;flex-shrink:0;margin-top:3px}.footer{color:var(--text-color-lighter);width:100%;font-size:12px;line-height:140%}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center;align-self:stretch}.sprig-accordion{width:100%;margin-bottom:8px}.sprig-accordion-body{width:100%;overflow:hidden}.sprig-accordion-header-container{background:transparent;border:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;cursor:pointer;margin:8px 0 0;padding:0;font-family:inherit}.sprig-header-label-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;flex:1 1 0}.sprig-header-label{color:var(--text-color);font-size:15px;font-weight:590;line-height:21px;text-align:start;overflow:hidden}.sprig-check-background{flex:0 0 16px;height:16px;width:16px;border-radius:8px;margin-right:8px;background-color:var(--button-subtle-background);display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:var(--text-color-light);stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:var(--text-color)}.ul-card-longform__submit-button-container{display:flex;justify-content:flex-end}.ul-card__choices+.ul-card-longform__submit-button-container{margin-top:12px}.ul-card-longform__submit-button-container .ul-card-longform__submit-button{display:flex;flex-direction:row;align-items:center;white-space:nowrap;gap:4px;border-radius:8px;color:var(--button-secondary-text-color);cursor:pointer}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:hover{opacity:.8}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:disabled{opacity:.4;cursor:not-allowed}.ul-card-list-container--longform{display:flex;flex-direction:column;gap:2rem;width:100%;align-items:center;height:auto;justify-content:center;flex:1 0 auto}.ul-card-list-container--longform:has(.ul-card-scroll-wrapper:nth-child(2)){gap:88px;padding-block-start:40px;padding-block-end:40px}@media (max-width: 600px){.ul-websurvey-frame-mobile.long-form-survey>.ul-websurvey-sidebar-mobile{padding-top:0}.ul-card-list-container--longform{padding-bottom:40px}.ul-card-list-container--longform .ul-card-scroll-wrapper:last-child{padding-bottom:80px}.ul-card-list-container--longform:has(.ul-card-scroll-wrapper:nth-child(2)){padding-block-start:80px;padding-block-end:40px}}.ul-card-scroll-wrapper{width:100%;max-width:100vw;position:relative;display:flex;justify-content:center;flex:1 0 auto}.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable){width:100%;max-width:100%}.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable-fill){max-width:600px}@media (min-width: 601px){.ul-card-scroll-wrapper:has(.ul-card--matrix-expandable:not(.ul-card--matrix-expandable-fill)){width:fit-content;max-width:min(1200px,90vw)}}.sprig-image{object-fit:contain;width:100%;margin-bottom:12px;margin-top:8px;height:auto;border-radius:4px}.ul-card-scroll-wrapper:has(.ul-lfs-nav-button-wrapper){flex-direction:column;align-items:center;justify-content:center}.ul-card-scroll-wrapper:has(.ul-lfs-nav-button-wrapper)>.ul-card{flex:0 0 auto}.ul-lfs-nav-button-wrapper{display:flex;justify-content:flex-end;width:100%;max-width:600px;padding:32px 16px 0}.ul-lfs-nav-button-wrapper .long-form-button{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px;border-radius:8px;height:40px;width:80px}.ul-lfs-nav-button-wrapper .long-form-button .long-form-button-text-container{display:flex;align-items:center}.ul-consent-legal__name-input--mobile{border:2px solid var(--border-color)}.ul-consent-legal__name-input--desktop{border:1px solid var(--border-color)}.ul-consent-legal__name-input{background:var(--prototype-button-background);box-sizing:border-box;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:var(--text-color-light)}.ul-consent-legal__name-input:focus{outline:none;background:var(--background-color)}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:var(--thank-you-link-background-hover)}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:var(--prototype-button-background)}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:var(--thank-you-link-background-hover)}.ul-card__consent-legal .sprig-stretch{background:var(--background-color-darker);border-radius:8px;display:flex;flex-direction:column;gap:12px;padding:8px 12px 8px 8px}.ul-card__consent-legal .choice{background:transparent;border-radius:0;padding:0}.ul-card__consent-legal .choice--desktop:hover{background-color:transparent}.ul-consent-legal__name-input{background:var(--background-color);border-radius:8px;margin-bottom:0;padding:8px 12px}.ul-consent-legal__name-input--desktop,.ul-consent-legal__name-input--mobile{border:1px solid var(--border-color)}.ul-consent-legal__name-input:focus{background:var(--background-color)}.ul-card__consent-legal .ul-card__button-wrapper{margin-top:24px}.ul-card--likert__scale:has(.likert-number--desktop){width:fit-content;max-width:100%}.ul-card--likert__numbers{align-items:center;border-radius:4px;display:flex;flex-direction:row;flex:1 0;justify-content:flex-start;width:100%}.ul-card--likert__numbers:has(>.likert-number--desktop){flex:0 1 auto;width:fit-content;max-width:100%}.ul-card--likert__numbers:has(>.likert-number--mobile){flex:1 0;width:100%}.ul-card--likert__numbers:has(>.likert-number--mobile)>button{padding:5px 4px}.ul-card--likert__numbers>button{padding:10px 8px}.likert-number--mobile{border:1px solid var(--border-color)}.likert-number--mobile:not(:first-child){margin-inline-start:-1px}.likert-number--desktop{border:1px solid var(--border-color);width:67px;flex:0 0 67px}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;color:var(--text-color);background:var(--background-color);font-size:16px;line-height:1.4;height:67px}.likert-number:first-child{border-start-start-radius:4px;border-end-start-radius:4px}.likert-number:last-child{border-start-end-radius:4px;border-end-end-radius:4px}.likert-number:active{background-color:var(--background-color-darker);font-weight:500;position:relative;z-index:10}.ul-card--likert__numbers>.likert-number.likert-number--desktop:hover{background-color:var(--background-color-darker);border-color:var(--select-border-hover);font-weight:500;position:relative;z-index:10}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:var(--likert-symbol-color);font-size:18px;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:var(--likert-symbol-color);line-height:24px;background:unset;border:unset}.likert-smiley>svg{margin:0 auto}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:var(--text-color);display:flex;flex-direction:row;flex:1 0;font-size:14px;font-style:normal;font-weight:400;line-height:140%;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels>span:last-child{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.sprig-accordion-body .choice{margin-bottom:6px}.sprig-accordion-body .choice:last-child{margin-bottom:0}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(107px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:12px;width:max-content}.ul-card--matrix_grid_longform{width:100%}.ul-matrix-header-row,.ul-matrix-row{display:contents}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{align-items:center;display:flex;font-size:15px;justify-content:center;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix-expandable .ul-matrix-column-label{font-size:12px;max-width:90px;padding:8px 0}.ul-card--matrix_container{margin-bottom:16px}.ul-card__matrix .ul-card--matrix_container{overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-card__matrix .ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-card__matrix .ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-card__matrix .ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-card__matrix .ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:var(--text-color);padding:0;position:absolute;top:45%}.ul-card__matrix .ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:var(--background-color-darker);display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:8px;border-end-end-radius:8px}.ul-matrix-row-label{align-items:center;background:var(--background-color-darker);border-end-start-radius:8px;border-start-start-radius:8px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.ul-card.ul-card--matrix-expandable{flex:0 0 auto;align-self:center;box-sizing:border-box;max-width:100%;width:fit-content}.ul-card.ul-card--matrix-expandable-fill{width:100%}.ul-card.ul-card--matrix-expandable .ul-card--matrix_container,.ul-card.ul-card--matrix-expandable .sprig-question-body{overflow:visible}.ul-card--matrix-expandable .ul-matrix-header-row,.ul-card--matrix-expandable .ul-matrix-row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid}.ul-card--matrix-expandable .ul-matrix-row{background:var(--background-color-darker);border-radius:8px}.ul-card--matrix-expandable .ul-matrix-row-label{background:transparent;border-radius:0}.ul-card--matrix-expandable .ul-matrix-option-wrapper{background:transparent;border-radius:0;padding:8px 0}.ul-card--matrix-expandable .ul-card--matrix_grid{column-gap:16px;width:100%;max-width:100%;grid-template-columns:minmax(0,1fr) repeat(var(--numColumns),90px)}.ul-card--matrix-expandable-fill .ul-matrix-row-label{max-width:none;min-width:0}@media (max-width: 600px){.ul-card.ul-card--matrix-expandable{width:100%}.ul-card--matrix-expandable .ul-matrix-row-label{max-width:none;min-width:0}}@media (min-width: 601px){.ul-card--matrix-expandable:not(.ul-card--matrix-expandable-fill) .ul-card--matrix_grid{width:max-content;grid-template-columns:max-content repeat(var(--numColumns),90px)}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid var(--nps-unselected-border)}.nps-number--desktop{border:1px solid var(--nps-unselected-border)}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;color:var(--text-color);background-color:var(--nps-unselected);font-size:18px;line-height:24px;height:67px;padding:unset}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:var(--selection-background-color-hover);font-weight:500}.ul-card--nps__labels{align-items:center;color:var(--text-color);display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__numbers{align-items:center;border-radius:4px;display:flex;flex-direction:row;flex:1 0;justify-content:flex-start;width:100%}.ul-card--nps__numbers:has(>.nps-number--desktop){flex:0 1 auto;width:fit-content;max-width:100%}.ul-card--nps__numbers:has(>.nps-number--mobile){flex:1 0;width:100%}.ul-card--nps__numbers:has(>.nps-number--mobile)>button{padding:5px 4px}.ul-card--nps__numbers>button{padding:10px 8px}.nps-number--mobile{border:2px solid var(--border-color)}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid var(--border-color);width:67px;flex:0 0 67px}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;color:var(--text-color-light);background:var(--background-color);font-size:16px;line-height:1.4;height:67px;outline:none}.nps-number:first-child{border-start-start-radius:4px;border-end-start-radius:4px}.nps-number:last-child{border-start-end-radius:4px;border-end-end-radius:4px}.nps-number:active{background-color:var(--text-color);color:var(--background-color);font-weight:500;position:relative;z-index:10}.nps-number--mobile:active{border-color:var(--border-color)}.ul-card--nps__numbers>.nps-number.nps-number--desktop:hover{background-color:var(--background-color-darker);border-color:var(--select-border-hover)}.ul-card--nps__labels{align-items:center;color:var(--text-color-lighter);display:flex;flex-direction:row;flex:1 0;font-size:14px;font-style:normal;font-weight:400;line-height:140%;justify-content:space-between;margin:7px 0 10px}.ul-card--nps__labels>span:last-child{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.ul-card-rank__labels{font-size:14px;font-style:normal;font-weight:600;line-height:150%;text-align:left}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0}.ul-card-rank__option{display:flex;align-items:center;padding:8px;gap:8px;align-self:stretch;border:1px solid var(--rank-order-border);border-radius:8px;margin-bottom:4px;background:var(--background-color)}.ul-card-rank__option:last-child{margin-bottom:0}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid var(--rank-order-border);border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:var(--background-color);cursor:pointer;pointer-events:auto;color:var(--text-color)}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0;display:flex;flex-direction:column;gap:8px}.ul-card-rank__option{display:flex;min-height:40px;padding:8px 12px 8px 8px;align-items:center;gap:12px;align-self:stretch;border-radius:var(--radius-radius-m, 8px);border:1px solid var(--rank-order-border);background:var(--background-color-darker);margin-bottom:0}.ul-card-rank__drag-btn{display:inline-flex;align-items:center;justify-content:center;line-height:0;padding:0;width:25px;height:25px;margin-left:auto;color:var(--text-color);cursor:grab;background:transparent;border:0}.ul-card-rank__drag-btn:active,.ul-card-rank__option:active{cursor:grabbing}.ul-card-rank__option svg{display:block}.ul-card-rank__option.is-dragging{opacity:1;box-shadow:0 8px 25px #00000026,0 3px 10px #0000001a;z-index:1000;background:var(--background-color);border-color:var(--text-color);transition:none}.ul-card-rank__option.is-drop-target{background:var(--rank-order-background);border-radius:8px;border-color:var(--rank-order-border-hover)}.ul-card-rank__option.is-drop-target select,.ul-card-rank__option.is-drop-target span,.ul-card-rank__option.is-drop-target button{visibility:hidden}.ul-card-rank__option span{font-size:14px;font-weight:400;pointer-events:none}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid var(--rank-order-border);border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:var(--background-color);cursor:pointer;pointer-events:auto;color:var(--text-color)}.ul-card-rank__select.ul-card-rank__select--placeholder{color:var(--text-color-lighter)}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid var(--border-color);max-height:93px}.ul-card-text__input--desktop{border:1px solid var(--border-color);max-height:150px}.ul-card-text__input{background:var(--background-color);box-sizing:border-box;color:var(--text-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:93px;overflow:auto;padding:8px 12px;resize:none;width:100%;border-radius:8px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:var(--text-color-lighter)}.ul-card-text__input:focus{outline:none;background:var(--background-color)}.ul-card-text__input--desktop:hover:not(:focus){background-color:var(--thank-you-link-background-hover)}.ul-card-text__input__loading{background-image:linear-gradient(70deg,#e2e3e1,#f9f9f8,#e2e3e1);background-size:200% 100%;animation:shimmer 2s infinite linear}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:-webkit-fill-available}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:var(--record-task-background);text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:var(--text-color-light)}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:var(--text-color);text-decoration:underline;font-size:12px}.ul-permission-body{color:var(--text-color);margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:var(--background-color);border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:var(--text-color-light);margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:var(--text-color);background-color:var(--background-color)}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:var(--text-color-light)}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);color:#fff;border-radius:3px;border:none;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:hover{opacity:.8}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{opacity:.4;cursor:not-allowed}.ul-card-text__button.ul-button-inactive{background-color:transparent;color:#5d696f!important}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:var(--button-disabled-text-color)}.ul-card-skip__button{color:var(--text-color-light);background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center;flex-direction:column}.select-button{align-items:center;background:var(--background-color);border-radius:8px;border:1px solid var(--border-color);cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:4px;padding:8px 12px;width:100%;color:var(--text-color)}.select-button:hover{background-color:var(--select-background-hover)}.select-button:active{background-color:var(--selection-background-color-hover)}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:var(--text-color-lighter)}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:var(--select-background);border:1px solid var(--select-border);box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:auto;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:var(--select-background-hover)}.ul-card--maxdiff__question-inner-container{display:grid;grid-template-columns:1fr 2.5fr 1fr;grid-template-rows:repeat(3,minmax(40px,auto));grid-gap:6px;align-items:center}@media (max-width: 600px){.ul-card-maxdiff__labels-row{column-gap:30%}}.ul-card-maxdiff__label{font-weight:600;text-align:center;margin:auto;flex:1;padding:8px;overflow:auto;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__label-spacer{flex:6}.ul-card-maxdiff .ul-question{text-align:center}.ul-question a{color:var(--text-color)}.ul-card-maxdiff__option-row{display:flex;justify-content:space-between;margin-bottom:8px;padding:0 24px}.ul-card-maxdiff__option-label{flex:6;align-self:center;padding:12px;text-align:center;max-width:100%;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__option-control.smiley{display:flex;justify-content:center;align-items:center;min-width:86px;flex:1;padding:12px;border-radius:none;border:none;background:none;cursor:pointer}.ul-card-maxdiff__option-control .choice-label-container{justify-content:center}.ul-card-maxdiff p.ul-caption{text-align:center}.ul-card-maxdiff .question-header-button-container{display:flex;justify-content:center}.ul-card-maxdiff__option-selected{border-radius:100px}.ul-card-maxdiff__option-selected.good{background:var(--nps-selected-color-high)}.ul-card-maxdiff__option-selected.bad{background:var(--nps-selected-color-low)}.ul-card-maxdiff__option-btn{width:42px;height:42px;justify-content:center;align-items:center}.ul-card-maxdiff .question-header-button-container{display:grid;justify-content:start}.ul-card-maxdiff .sprig-header-container{padding-bottom:22px}.ul-card-maxdiff .ul-question,.ul-card-maxdiff p.ul-caption{text-align:start}.ul-card-maxdiff__label{flex:none;font-weight:400;text-align:start;padding:0;margin:0;overflow:visible}.ul-card-maxdiff .ul-card--maxdiff__question-inner-container{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%}.ul-card-maxdiff__labels-row{display:flex;justify-content:space-between;width:100%;padding:0 39px 22px}.ul-card-maxdiff__option-row{align-items:center;background:var(--background-color-darker);border-radius:8px;margin-bottom:0;min-height:36px;padding:8px 16px;width:100%;box-sizing:border-box}.ul-card-maxdiff__option-row .ul-card-maxdiff__option-label{padding:0}.ul-card-maxdiff__option-row .choice{background:transparent;border-radius:0;align-self:auto}.ul-card-maxdiff__option-row .ul-card-maxdiff__option-control{flex:1;display:flex;justify-content:center;align-items:center;min-width:86px}html{--background-color: #fff;--background-color-darker: #faf9f8;--text-color: #2f2e2c;--text-color-light: #575653;--text-color-lighter: #858481;--border-color: #ececec;--border-color-heavy: #ebebeb;--button-disabled-background: #f2f2f2;--button-disabled-text-color: #a8a8a8;--sprig-logo-background: #f9c600;--progress-bar-background: rgba(0, 0, 0, .1);--prototype-button-background: rgba(0, 0, 0, .01);--thank-you-link-background: rgba(0, 0, 0, .01);--thank-you-link-background-hover: rgba(0, 0, 0, .03);--selection-border-color: #c2c2c2;--selection-background-color: #f2f2f2;--selection-background-color-hover: #e6e6e6;--selection-indicator-color: #a8a8a8;--selection-indicator-color-selected: #000;--matrix-header-background: #f7f7f7;--nps-unselected: #fcfcfc;--nps-unselected-border: #e6e6e6;--nps-selected-color-low: #B06D6D;--nps-selected-color-high: #95A779;--rank-order-background: #f2f2f2;--rank-order-border: #e6e6e6;--rank-order-border-hover: #d9d9d9;--rank-order-number-background: #fff;--record-task-background: #f2f2f2;--record-task-border: #e6e6e6;--record-task-border-hover: #d9d9d9;--record-task-number-background: #fff;--select-border: #e6e6e6;--select-border-hover: #dddcd9;--select-background: #fff;--select-background-hover: #f2f2f2;--voice-video-background: #f2f2f2;--voice-video-border: #e6e6e6;--voice-video-border-hover: #d9d9d9;--voice-video-icon-color: #a8a8a8;--likert-symbol-color: transparent;--sprig-brand-color: #000000}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none;color:var(--text-color)}b{font-weight:500}form{margin-block-end:0;margin-block-start:0}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh;transition:opacity .3s ease-out}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:var(--background-color);border-bottom:2px solid var(--border-color-heavy);display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:auto;flex-grow:0;width:100%;min-height:10px;height:fit-content;flex-shrink:0;padding-bottom:16px}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:var(--thank-you-link-background);border:1px solid var(--border-color);border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:var(--thank-you-link-background-hover)}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:var(--sprig-logo-background);border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{position:absolute;top:8px;right:8px;cursor:pointer;height:16px;width:16px;z-index:2;color:var(--text-color)}.ul-center-horizontally{text-align:center}.ul-progress-bar-container{width:100%;height:2px;background-color:var(--progress-bar-background);border-radius:2px}.ul-progress-bar-container__footer{max-width:250px;margin:16px 0}.ul-progress-bar-container__header{position:fixed;top:80px;max-width:unset;margin:0;z-index:3}.ul-progress-bar-container--no-branding{top:16px}.ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:var(--prototype-button-background);border:1.5px solid var(--border-color);border-radius:4px 0 0 4px;flex:none;flex-grow:0;height:fit-content;line-height:16.5px;margin:0 20px;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}.sprig-logo{color:var(--sprig-brand-color)}.ul-video-btn{color:var(--text-color)}`;
2
+ export {
3
+ e as default
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-K9v6s8h_.cjs"),X=require("./index-BzHQzSxf.cjs"),y=require("./getAttributedUrl-JjAfDdLt.cjs"),Me=({className:i,message:n,next:l,properties:t,questionId:r,type:s})=>{const{useMobileStyling:m,border:h,isLongFormSurvey:c,focusedQuestionId:v,useNewSurveyUI:o}=e.useConfig(x=>{var O;return{useMobileStyling:x.useMobileStyling,border:x.border,isLongFormSurvey:X.isLongFormSurvey(x.studyType),focusedQuestionId:x.focusedQuestionId,useNewSurveyUI:!!((O=x.experimentFlags)!=null&&O["sdk-new-survey-ui"])}}),[g,p]=e.h(!1),[T,u]=e.h(""),[f,d]=e.h(!1),k=c&&v===r,_=t==null?void 0:t.collectName,M=(t==null?void 0:t.nameLabelText)||"Full Name",F=(t==null?void 0:t.consentText)||"I agree to the stated conditions",B=(t==null?void 0:t.submitButtonText)||"Submit",I=!!T.trim(),R=g&&(!_||I),W=(x,O=!1)=>{x.preventDefault(),x.stopPropagation();let q=null;if(!O){if(!R)return void d(!0);q={submitted:!0},_&&(q.name=T)}l({value:q,questionId:r,type:s},R)};return e.u("div",{className:e.cc(i,c&&!k&&"ul-card--unfocused","ul-card__consent-legal","fade-in-transition"),children:[e.u(y.Header,{isRequired:c&&(t==null?void 0:t.required),message:n,properties:{image:t.image,questionHtml:t.questionHtml,captionHtml:o?t.richTextBody:void 0,captionText:o?t.body:void 0}}),!o&&(t!=null&&t.richTextBody)?e.u(y.QuestionBodyWrapper,{children:e.u(y.Html,{className:"ul-rich-text-body",html:t.richTextBody,id:"ul-card__consent-legal-body-container"})}):null,e.u(y.MobileEmbedView,{embeddedType:"pdf",properties:t,children:e.u(y.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(y.Option,{allowTextEntry:!1,border:h,error:f&&!g,id:"consent",isRadio:!1,isSelected:g,label:F,onUserInputChanged:({selected:x})=>{x!==g&&p(!g)},useMobileStyling:m}),_&&e.u("input",{"aria-label":M,"aria-placeholder":M,className:e.cc(e.getClasses("ul-consent-legal__name-input",m)),"data-gramm":"false",maxLength:250,name:"name",onBlur:x=>{x.currentTarget.style.borderColor=f&&!I?X.ERROR_BORDER_COLOR:X.DEFAULT_BORDER_COLOR},onFocus:x=>{x.currentTarget.style.borderColor=f&&!I?X.ERROR_BORDER_COLOR:h},onInput:x=>{x.preventDefault(),x.stopPropagation(),u(x.currentTarget.value)},placeholder:M,style:f&&!I?{borderColor:X.ERROR_BORDER_COLOR}:{},tabIndex:0,value:T})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[e.u(y.Button,{className:R?"":"sprig-button-disabled",onClick:W,children:B}),t.required===!1&&!c&&e.u("button",{className:"ul-card-skip__button",onClick:x=>W(x,!0),children:e.getSkipButtonText(t)})]})]})})]},r)},ae=i=>n=>{n.pointerType!=="touch"&&i()},Be=({activeValue:i,border:n,icon:l,isPressed:t,onSubmit:r,range:s,scaleLabelType:m,selectedValue:h,setSelectedValue:c,setActiveValue:v,setIsPressed:o,useMobileStyling:g,value:p,viewDocument:T})=>{const{isLongFormSurvey:u,enableCspTrustedTypes:f}=e.useConfig(x=>({isLongFormSurvey:X.isLongFormSurvey(x.studyType),enableCspTrustedTypes:x.enableCspTrustedTypes})),d=`option-${p}`,k=m==="number",_=m==="star",M=m==="smiley",F=k&&p===i||p===h,[B,I]=(()=>{const x=_&&h!==null&&p<=h;return _&&p<=i||M&&p===i||x||p===i||p===h?[n,t||x||p===h?1:.3]:["",1]})(),R=e.F(()=>{const x=h===p,O={borderColor:F&&!g||x?B:"",fillOpacity:F?"":I,zIndex:F?3:"auto",color:x?"#fff":""};return k?{...O,backgroundColor:x?B:""}:{...O,color:_||M||x?B:""}},[F,B,I,h,p,k,_,M,g]),W=e.F(()=>X.getHtml((({icon:x,scaleLabelType:O,value:q,selectedValue:A})=>{if(O==="smiley"&&q===A){let C=0;return x.replace(/black/g,()=>++C==1?"black":"white")}return x})({icon:l,scaleLabelType:m,value:p,selectedValue:h}),f),[f,l,m,h,p]);return e.u("button",{"aria-label":k?void 0:String(p),className:(()=>{switch(m){case"star":return e.cc(e.getClasses("likert-star",g),e.getClasses(`likert-star-${p}`,g));case"smiley":return e.cc(e.getClasses("likert-smiley",g),e.getClasses(`likert-smiley-${p}`,g));default:return p===s?e.cc(e.getClasses("likert-number",g),e.getClasses(`likert-number-${p}`,g),e.getClasses("likert-last-option",g)):e.cc(e.getClasses("likert-number",g),e.getClasses(`likert-number-${p}`,g))}})(),dangerouslySetInnerHTML:{__html:W},id:d,onClick:x=>{u&&(x.preventDefault(),x.stopPropagation(),c(p)),r()},onKeyDown:x=>{var A,C;const O=T.querySelectorAll(`.likert-${m??"number"}`),q=p-1;x.key==="ArrowRight"?(A=O[q+1])==null||A.focus():x.key==="ArrowLeft"?(C=O[q-1])==null||C.focus():x.key!=="Enter"&&x.key!==" "||(u&&(x.preventDefault(),x.stopPropagation(),c(p)),r())},onPointerCancel:ae(()=>o(!1)),onPointerDown:ae(()=>{o(!0),v(p)}),onPointerEnter:ae(()=>v(p)),onPointerLeave:ae(()=>{v(-1),o(!1)}),onPointerUp:ae(()=>o(!1)),style:R,tabIndex:0})},Fe=({className:i,labels:n,message:l,next:t,properties:r,questionId:s,type:m})=>{const{border:h,useMobileStyling:c,viewDocument:v,isLongFormSurvey:o,focusedQuestionId:g,useNewSurveyUI:p}=e.useConfig(C=>{var E;return{border:C.border,useMobileStyling:C.useMobileStyling,viewDocument:C.viewDocument,isLongFormSurvey:X.isLongFormSurvey(C.studyType),focusedQuestionId:C.focusedQuestionId,useNewSurveyUI:!!((E=C.experimentFlags)!=null&&E["sdk-new-survey-ui"])}}),[T,u]=e.h(-1),[f,d]=e.h(!1),[k,_]=e.h(null);e.p(()=>{u(-1),d(!1),_(null)},[s]);const M=o&&g===s,F=n&&n.left,B=n&&n.right;let I;const{range:R,scaleLabelType:W,ratingIcons:x}=r;R&&(I=Number(R));const O=I||5,q=C=>{var E,L;switch(W){case"star":return(E=x[0])==null?void 0:E.svg;case"smiley":return(L=x[C])==null?void 0:L.svg;default:return String(C+1)}},A=e.u(e.g,{children:[e.u("div",{"aria-label":`Rating (1 - ${O})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(O)].map((C,E)=>{const L=E+1;return e.u(Be,{activeValue:T,border:h,icon:q(E),isPressed:f,onSubmit:()=>t({value:L,questionId:s,type:m},!0),range:O,scaleLabelType:W,selectedValue:k,setActiveValue:u,setIsPressed:d,setSelectedValue:_,useMobileStyling:c,value:L,viewDocument:v},E)})}),e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:F}),e.u("span",{children:B})]})]});return e.u("form",{className:e.cc(i,"ul-card--likert","fade-in-transition",o&&!M&&"ul-card--unfocused"),children:[e.u(y.Header,{isRequired:o&&(r==null?void 0:r.required),message:l,properties:r}),e.u(y.MobileEmbedView,{properties:r,children:e.u(e.g,{children:[e.u(y.QuestionBodyWrapper,{children:p?e.u("div",{className:"ul-card--likert__scale",children:A}):A}),!r.required&&!o&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(y.Button,{onClick:C=>{C.preventDefault(),C.stopPropagation(),t({value:null,questionId:s,type:m},!0)},children:e.getButtonText(r)})})})]})})]},s)},Re=({columns:i,onSelect:n,options:l,selectedOptions:t})=>{const r=e._([]),{border:s,useMobileStyling:m,cards:h,index:c}=e.useConfig(u=>({border:u.border,useMobileStyling:u.useMobileStyling,cards:u.cards,index:u.index})),v=l.findIndex(u=>t[u.id]===null),[o,g]=e.h(v),p=e.T((u,f)=>{var _;n(u,f);const d=o+1,k=l[d];if(k&&t[k.id]===null){g(d);const M=h[c];(M==null?void 0:M.groupId)!=null||((_=r.current[d])==null||_.scrollIntoView({block:"nearest",behavior:"smooth"}))}},[n,l,t,o,h,c]),T=e.T((u,f)=>{const d=o===u;return e.u(e.Accordion,{animate:!0,header:f.label,isOpen:d,onClick:()=>{var k;return g(d&&!((k=window.UserLeap)!=null&&k.isMobileSDK)?-1:u)},ref:k=>{k&&(r.current[u]=k)},showHeaderCheck:t[f.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:i.map(k=>e.u(y.Option,{allowTextEntry:!1,ariaLabel:`${f.label}-${k.label}`,border:s,error:!1,id:`${f.id}-${k.value}`,isRadio:!0,isSelected:t[f.id]===k.value,label:k.label,onUserInputChanged:()=>p(f.id,k.value),useMobileStyling:m},k.label))})},f.id)},[s,i,o,p,t,m]);return e.u("div",{children:l.map((u,f)=>T(f,u))})},De=({columns:i,onSelect:n,options:l,selectedOptions:t})=>{const{border:r,useMobileStyling:s,isLongFormSurvey:m}=e.useConfig(u=>({border:u.border,useMobileStyling:u.useMobileStyling,isLongFormSurvey:X.isLongFormSurvey(u.studyType)})),h=l.length,c=i.length,v=e._(null),[o,g]=e.h(!1),[p,T]=e.h(!1);return e.p(()=>{if(m)return;const u=v.current,f=new ResizeObserver(d=>{window.requestAnimationFrame(()=>{u&&(g(Math.round(d[0].contentRect.width)<u.scrollWidth),T(Math.round(d[0].contentRect.width)<u.scrollWidth))})});return u&&f.observe(u),()=>{u&&f.unobserve(u)}},[m]),e.u("div",{className:"ul-card--matrix_question_container",children:[e.u("div",{className:e.cc("ul-card--matrix_container",!m&&o&&"ul-matrix-scroll-gradient"),onScroll:m?void 0:()=>{const u=v.current;u&&g(u.clientWidth+Math.abs(u.scrollLeft)<u.scrollWidth)},ref:v,children:e.u("div",{className:e.cc(m&&"ul-card--matrix_grid_longform","ul-card--matrix_grid"),style:`--numColumns: ${c}; --numRows: ${h+1};`,children:[e.u("div",{className:"ul-matrix-header-row",children:[e.u("div",{})," ",i.map(u=>e.u("div",{className:"ul-matrix-column-label",children:u.label},u.label))]}),l.map(u=>e.u("div",{className:"ul-matrix-row",children:[e.u("div",{"aria-label":u.label,className:"ul-matrix-row-label",children:u.label}),e.u("div",{className:"ul-matrix-row-options",role:"radiogroup",children:i.map((f,d)=>{const k=d===c-1;return e.u("div",{className:e.cc("ul-matrix-option-wrapper",k&&"ul-matrix-last-option"),children:e.u(y.Option,{allowTextEntry:!1,ariaLabel:`${u.label}-${f.label}`,border:r,choiceStyle:{background:"transparent",border:"none",marginBottom:"0",padding:"0"},error:!1,id:`${u.id}-${f.value}`,isRadio:!0,isSelected:t[u.id]===f.value,onUserInputChanged:()=>n(u.id,f.value),useMobileStyling:s})},f.value)})})]},u.label))]})}),!m&&(o||p)&&e.u("button",{className:p&&!o?"ul-matrix-scroll-arrow left":"ul-matrix-scroll-arrow",onClick:p&&!o?u=>{u.preventDefault();const f=v.current;if(f){const d=getComputedStyle(f).direction==="rtl";f.scrollTo({left:d?f.scrollWidth-f.clientWidth:0,behavior:"smooth"})}}:u=>{u.preventDefault();const f=v.current;if(f){const d=getComputedStyle(f).direction==="rtl";f.scrollTo({left:d?f.clientWidth-f.scrollWidth:f.scrollWidth,behavior:"smooth"})}},children:p&&!o?e.u(Pe,{}):e.u(Qe,{})})]})},Pe=()=>e.u("svg",{fill:"currentColor",height:"32",transform:"matrix(-1,0,0,1,0,0)",version:"1.1",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Qe=()=>e.u("svg",{fill:"currentColor",height:"32",viewBox:"0 0 256 256",width:"32",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"})}),Ee=({className:i,message:n,next:l,options:t,properties:r,questionId:s,type:m,showIndividualSubmit:h=!1,onSubmitButtonClick:c})=>{const{useMobileStyling:v,isLongFormSurvey:o,focusedQuestionId:g,setFocusedQuestionId:p,update:T}=e.useConfig(L=>({useMobileStyling:L.useMobileStyling,isLongFormSurvey:X.isLongFormSurvey(L.studyType),focusedQuestionId:L.focusedQuestionId,setFocusedQuestionId:L.setFocusedQuestionId,update:L.update})),u=r.matrixColumn,f=r.required,d=o&&g===s,k=L=>Object.values(L).every(G=>G==null),_=L=>f&&k(L),M=L=>{if(L.preventDefault(),L.stopPropagation(),l({value:B,questionId:s,type:m},!0),c){const G=!k(B);c(G)}},F=t.reduce((L,G)=>(L[G.id]=null,L),{}),[B,I]=e.h(F),[R,W]=e.h(window.innerWidth),x=(L,G)=>{o&&l({value:{...B,[L]:G},questionId:s,type:m},!_({...B,[L]:G})),I(S=>({...S,[L]:G}))},O=r.displayMatrixAsAccordion||v,q=o&&!O&&e.shouldMatrixUseAccordionDueToSize(u.length,R),A=O||q,C=o&&!A,E=C&&e.shouldMatrixUseFillLayout(u.length,R);return e.p(()=>{if(!o)return;const L=X.debounce(()=>W(window.innerWidth),100);return window.addEventListener("resize",L),T(),()=>window.removeEventListener("resize",L)},[o,E,q,R,T]),e.u("form",{className:e.cc(i,!o&&"ul-card__matrix",C&&"ul-card--matrix-expandable",E&&"ul-card--matrix-expandable-fill","fade-in-transition",o&&!d&&"ul-card--unfocused"),id:"text-form",onClick:()=>{d&&p(s)},onSubmit:M,children:[e.u(y.Header,{isRequired:o&&(r==null?void 0:r.required),message:n,properties:r}),e.u(y.MobileEmbedView,{properties:r,children:[e.u(y.QuestionBodyWrapper,{children:[A?e.u(Re,{columns:u,onSelect:x,options:t,selectedOptions:B}):e.u(De,{columns:u,onSelect:x,options:t,selectedOptions:B}),h&&e.u(y.LongformSubmitButton,{handleSubmit:M,isSubmitDisabled:_(B)})]}),!o&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(y.Button,{disabled:_(B),children:e.getButtonText(r)})})})]})]},s)},Ce=({className:i,message:n,onSubmit:l,options:t=[],properties:r,questionId:s,type:m,showIndividualSubmit:h=!1,onSubmitButtonClick:c})=>{const{border:v,useMobileStyling:o,isLongFormSurvey:g,focusedQuestionId:p,setFocusedQuestionId:T}=e.useConfig(S=>({border:S.border,useMobileStyling:S.useMobileStyling,isLongFormSurvey:X.isLongFormSurvey(S.studyType),focusedQuestionId:S.focusedQuestionId,setFocusedQuestionId:S.setFocusedQuestionId})),u=g&&p===s,f=t.reduce((S,U)=>(S[U.id]={isSelected:!1},S),{}),[d,k]=e.h(f),_=m==="multiplechoice",M=r.required,F=t.find(S=>{var U;return(U=S.optionProperties)==null?void 0:U.noneOfTheAbove}),B=S=>Object.entries(S).some(([U,D])=>{var ie;const K=t.find(te=>`${te.id}`===U),j=D.userText===void 0||D.userText.trim()==="";return((ie=K==null?void 0:K.optionProperties)==null?void 0:ie.allowsTextEntry)&&j&&D.isSelected}),I=S=>Object.values(S).filter(U=>U.isSelected).length,R=S=>{const{minSelect:U=0,maxSelect:D=1/0,maxSelectMode:K}=r,j=I(S);switch(K){case e.MaxSelectModes.Maximum:return j<=D;case e.MaxSelectModes.Range:return j===0||j>=U;default:return!0}},W=r.minSelect&&r.minSelect>0&&r.maxSelectMode===e.MaxSelectModes.Range&&I(d)<r.minSelect&&(M||I(d)>0),x=S=>B(S)||M&&!I(S)||!R(S),O=S=>R(S)&&!B(S)&&I(S)>0,q=Object.entries(d).some(([S,U])=>{var D,K;return U.isSelected&&((K=(D=t.find(j=>`${j.id}`===S))==null?void 0:D.optionProperties)==null?void 0:K.allowsTextEntry)}),A=h&&(!_||q),C=S=>{G(S.id,S.selected,S.userText,S.noneOfTheAbove),S.selected&&g&&!_&&!u&&T(s)},E=S=>{var U;return(r==null?void 0:r.maxSelectMode)!==e.MaxSelectModes.Unlimited&&I(d)===(r==null?void 0:r.maxSelect)&&!((U=d[S])!=null&&U.isSelected)},L=S=>{if(S.preventDefault(),S.stopPropagation(),l(d,!0),c){const U=O(d);c(U)}},G=(S,U,D,K)=>{const j=Object.assign({},d);if((_||K)&&U)for(const ee of Object.values(j))ee.isSelected=!1,delete ee.userText;else F&&!K&&d[F.id].isSelected&&(j[F.id].isSelected=!1);j[S]={isSelected:U,userText:D};const ie=_&&Object.entries(j).some(([ee,ne])=>{var oe,a;return ne.isSelected&&((a=(oe=t.find(w=>`${w.id}`===ee))==null?void 0:oe.optionProperties)==null?void 0:a.allowsTextEntry)}),te=!x(j);if(g&&(l(j,te),_&&!ie&&te&&c)){const ee=O(j);c(ee)}k(j)};return e.u("form",{className:e.cc(i,"ul-card--multiple","fade-in-transition",g&&!u&&"ul-card--unfocused"),id:"text-form",onClick:m==="multipleselect"?()=>{g&&p!==s&&m==="multipleselect"&&T(s)}:void 0,onSubmit:L,children:[e.u(y.Header,{isRequired:g&&(r==null?void 0:r.required),message:n,properties:r}),e.u(y.MobileEmbedView,{properties:r,children:e.u(e.g,{children:[e.u(y.QuestionBodyWrapper,{children:[r.isDropdown?e.u(y.Select,{disabledOptions:t.filter(S=>E(S.id)),dropdownFooter:W?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[I(d),"/",r.minSelect]}):void 0,isMultiSelect:!_,multiselectText:r.dropdownMultiselectedText??"choices selected",onChange:S=>{const U={...d};for(const D of t)S.includes(D)?U[D.id].isSelected=!0:U[D.id].isSelected=!1;g&&l(U,!x(U)),k(U)},options:t,placeholderText:r.dropdownPlaceholderText??(_?"Select choice":"Select choice(s)"),value:t.filter(S=>d[S.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",o)),role:_?"radiogroup":"group",children:[t.map(({id:S,label:U,value:D,optionProperties:K})=>{var ee,ne;const j=`${S}`,{allowsTextEntry:ie,noneOfTheAbove:te}={allowsTextEntry:!1,noneOfTheAbove:!1,...K};return e.u(y.Option,{allowTextEntry:ie,border:v,disabled:E(j),error:B({[j]:d[j]}),id:j,isRadio:_,isSelected:!!((ee=d[j])!=null&&ee.isSelected),label:U,noneOfTheAbove:te,onUserInputChanged:C,promptText:(K==null?void 0:K.otherOptionPlaceholder)||"Please specify",text:(ne=d[S])==null?void 0:ne.userText,useMobileStyling:o,value:D},j)}),!!W&&e.u("div",{className:"ul-card__min-select-counter",children:[I(d),"/",r.minSelect]})]}),A&&e.u(y.LongformSubmitButton,{handleSubmit:L,isSubmitDisabled:x(d)})]}),!g&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(y.Button,{disabled:x(d),onClick:L,children:e.getButtonText(r)})})})]})})]},s)},Oe=i=>{const{questionId:n,type:l,next:t,options:r}=i,{setFocusedQuestionId:s}=e.useConfig(m=>({setFocusedQuestionId:m.setFocusedQuestionId}));return e.u(Ce,{...i,onSubmit:(m,h)=>{var T;const c=Object.entries(m).find(([,u])=>u.isSelected)||[void 0,void 0],[v,o]=c,g=r.find(u=>`${u.id}`===v);!((T=g==null?void 0:g.optionProperties)!=null&&T.allowsTextEntry)||o!=null&&o.userText&&o.userText.trim()!==""||s(n);const p=o!=null&&o.userText?{[v]:{userText:o.userText}}:null;t({value:g&&v?{[v]:g.value}:{},secondaryValue:p,questionId:n,type:l},h)}})},Ue=i=>{const{questionId:n,type:l,next:t}=i;return e.u(Ce,{...i,onSubmit:(r,s)=>{const m=Object.entries(r).reduce((c,[v,o])=>(c[v]=o.isSelected,c),{}),h=Object.entries(r).reduce((c,[v,o])=>{if(!o.userText)return c;const g=c||{};return g[v]={userText:o.userText},g},null);t({value:m,secondaryValue:h,questionId:n,type:l},s)}})},Ae=({className:i,labels:n,message:l,properties:t,next:r,questionId:s,type:m})=>{const[h,c]=e.h(null),{border:v,useMobileStyling:o,viewDocument:g,isLongFormSurvey:p,focusedQuestionId:T}=e.useConfig(k=>({border:k.border,useMobileStyling:k.useMobileStyling,viewDocument:k.viewDocument,isLongFormSurvey:X.isLongFormSurvey(k.studyType),focusedQuestionId:k.focusedQuestionId})),u=p&&T===s,f=n&&n.left,d=n&&n.right;return e.u("form",{className:e.cc(i,"ul-card--nps","fade-in-transition",p&&!u&&"ul-card--unfocused"),children:[e.u(y.Header,{isRequired:p&&(t==null?void 0:t.required),message:l,properties:t}),e.u(y.MobileEmbedView,{properties:t,children:[e.u(y.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((k,_)=>e.u("button",{className:e.cc(e.getClasses("nps-number",o),e.getClasses(`nps-number-${_}`,o)),id:`option-${_}`,onClick:M=>{p&&(M.preventDefault(),M.stopPropagation(),c(_)),r({value:_,questionId:s,type:m},!0)},onKeyDown:M=>{var B,I;const F=g.querySelectorAll("button.nps-number");M.key==="ArrowRight"?(B=F[_+1])==null||B.focus():M.key==="ArrowLeft"?(I=F[_-1])==null||I.focus():M.key!=="Enter"&&M.key!==" "||(p&&(M.preventDefault(),M.stopPropagation(),c(_)),r({value:_,questionId:s,type:m},!0))},onPointerDown:M=>{M.currentTarget.style.zIndex="2",M.currentTarget.style.borderColor=v},onPointerLeave:M=>{M.currentTarget.style.zIndex="auto",M.currentTarget.style.borderColor=""},style:h===_?{backgroundColor:v,color:"#fff"}:void 0,tabIndex:0,children:_},_))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:f}),e.u("span",{children:d})]})]}),!t.required&&!p&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-vertical-centered-container",children:e.u(y.Button,{onClick:k=>{k.preventDefault(),k.stopPropagation(),r({value:null,questionId:s,type:m},!0)},children:e.getButtonText(t)})})})]})]},s)},He=i=>{const{className:n,message:l,next:t,properties:r,questionId:s,type:m,showIndividualSubmit:h=!1,onSubmitButtonClick:c}=i,v=m==="aidynamicfollowup"||m==="aidynamicstandalone",o=v?i.loading:void 0,{border:g,useMobileStyling:p,update:T,isLongFormSurvey:u,focusedQuestionId:f,setFocusedQuestionId:d,isPreview:k}=e.useConfig(C=>({border:C.border,useMobileStyling:C.useMobileStyling,update:C.update,isLongFormSurvey:X.isLongFormSurvey(C.studyType),focusedQuestionId:C.focusedQuestionId,setFocusedQuestionId:C.setFocusedQuestionId,isPreview:C.isPreview})),[_,M]=e.h(""),F=e._(null),B=u&&f===s;e.p(()=>{var C,E;u&&!k&&(B?(C=F.current)==null||C.focus():(E=F.current)==null||E.blur())},[u,B,k]);const I=_.trim(),R=r.required===!0&&!I,W=y.useAutoSize(F,()=>T()),x=C=>{C.preventDefault(),C.stopPropagation();const E=I.length>0,L=!r.required||E;t({value:_,questionId:s,type:m},L),c&&c(E)},O=r&&r.openTextPlaceholder?r.openTextPlaceholder:"";if((o===e.DynamicQuestionLoadingStates.failure||o===void 0)&&v)return e.u(e.g,{});const q=o===e.DynamicQuestionLoadingStates.inFlight,A=q?"Preparing your next question":l;return e.u("form",{className:e.cc(n,"ul-card-text","fade-in-transition",u&&!B&&"ul-card--unfocused"),id:"text-form",onClick:()=>{u&&f!==s&&d(s)},children:[e.u(y.Header,{isRequired:u&&(r==null?void 0:r.required),message:A,properties:r}),e.u(y.MobileEmbedView,{properties:r,children:e.u("div",{className:"ul-card-text",children:e.u(y.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card-text__container",children:e.u("textarea",{"aria-describedby":"ul-caption","aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":O,className:e.cc(q&&"ul-card-text__input__loading",e.getClasses("ul-card-text__input",p)),"data-gramm":"false",disabled:q,maxLength:5e3,name:"text",onBlur:C=>{C.currentTarget.style.borderColor=X.DEFAULT_BORDER_COLOR},onChange:C=>{const{value:E}=C.currentTarget;if(W(),C.preventDefault(),C.stopPropagation(),M(E),u){const L=E.trim().length>0;t({value:E,questionId:s,type:m},L)}},onFocus:C=>{C.currentTarget.style.borderColor=g,d(s)},placeholder:O,ref:F,role:"textbox",tabIndex:0})}),r.footerHtml&&e.u(y.Html,{className:"footer",html:r.footerHtml}),h&&e.u(y.LongformSubmitButton,{handleSubmit:x,isSubmitDisabled:R}),e.u(y.QuestionBodyFooterContainer,{children:!u&&e.u(y.Button,{disabled:R||q,onClick:x,children:e.getButtonText(r)})})]})})})]},s)},pe=1,ke=2,Te=3,ue=i=>i.type==="av_permission",ve=i=>i.type==="screen_permission",we=(i,n)=>i===void 0?pe:i?((l,t)=>!(ue(t)?t.permissionDescriptors:[]).includes("camera")||l.getVideoTracks().length>0)(i,n)?Te:pe:ke,ye={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},se=e.create(i=>({...ye,reset:()=>{i(ye)},updatePage:n=>{i(n)}}));function me({currentPage:i,pages:n}){const{avStream:l,recordingMediaTypes:t,updatePage:r}=se.getState(),{recorderEventEmitter:s}=e.useConfig.getState();s.emit("av.permission",{"permission.descriptors":i.permissionDescriptors,"stream.ready":(m,h)=>{if(l===m)return;let c=i;if(m&&!i.permissionDescriptors.includes("camera")){const v=n.indexOf(i),o=h!=null&&h.active?v+2:v+1;h!=null&&h.active&&t&&s.emit("begin.recording",{"recording.media.types":t,"start.recording.callback":g=>r({mediaRecordingUids:g})}),c=n[o]}r({currentPage:c,avStream:m})}})}function ge({status:i}){const{nextQuestion:n,passthroughData:l,mediaRecordingUids:t,reset:r}=se.getState(),{recorderEventEmitter:s,handleUploadUpdate:m,index:h}=e.useConfig.getState(),c={value:{taskStatus:i},type:"recordedtask",questionId:(l==null?void 0:l.questionId)||1};l&&s.emit("finish.task",{"begin.callback":v=>{m({mediaRecordingUid:v,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(v,o)=>{m({mediaRecordingUid:v,progressPct:o.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":v=>{v&&m({mediaRecordingUid:v,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":l,"current.index":h,"task.response":c,"task.complete.callback":v=>{c.value.taskDurationMillisecond=v,t&&(c.value.mediaRecordingUids=t),r(),n(c)}})}function he({pages:i,setIsRequestingPermission:n}){const{recorderEventEmitter:l,eventEmitFn:t}=e.useConfig.getState(),{updatePage:r,currentPage:s,recordingMediaTypes:m,screenPermissionRequested:h}=se.getState();if(!s)return;const c=i.indexOf(s);switch(s.type){case"av_permission":{const v=h?c+2:c+1;return h&&m&&l.emit("begin.recording",{"recording.media.types":m,"start.recording.callback":o=>{r({mediaRecordingUids:o})}}),void r({currentPage:i[v]})}case"screen_permission":return void l.emit("screen.permission",{"screen.permission.requested":n,"stream.ready.callback":(v,o)=>{const g=o?i[c+1]:s;o&&m&&l.emit("begin.recording",{"recording.media.types":m,"start.recording.callback":p=>{r({captureStream:o,mediaRecordingUids:p})}}),r({currentPage:g,screenPermissionRequested:!0,captureStream:o})}});case"start_task":return t("recorded.task.start"),l.emit("recorded.task.start"),l.emit("start.task"),void r({currentPage:i[c+1],screenPermissionRequested:!0});case"complete_task":return}}const _e="ul-permission-graphics-container",Ie="ul-permission-body",Ne=e.cc(_e,"ul_recorded-task-inset-spacing"),de=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),Le=({richTextBody:i})=>e.u(y.Html,{className:"ul-rich-text-body",html:i,id:"ul-task-detail-container"}),ce=({required:i,skipButtonText:n,bottom:l=!1})=>i?null:e.u(y.Button,{className:e.cc(l&&"ul-skip-button-below","ul-button-inactive"),onClick:ge.bind(null,{status:"abandoned"}),children:n||"Skip"}),be=i=>{const{avStream:n,captureStream:l,recordingMediaTypes:t,updatePage:r}=se.getState(),s=(t==null?void 0:t.includes("audio"))||(t==null?void 0:t.includes("video"));e.p(()=>{const m=setInterval(()=>{s&&n&&!n.active?r({avStream:null,currentPage:i[0]}):l&&l.active||r({captureStream:void 0,currentPage:i[s?1:0]})},1e3);return()=>clearInterval(m)},[n,l,s,i,t,r])},$e=({content:i,pages:n,required:l})=>{const{buttonText:t,skipButtonText:r,taskDetail:s}=i;return be(n),e.u("div",{className:"ul-task-page",children:[s&&e.u(Le,{richTextBody:s}),e.u("div",{className:de,children:[e.u(y.Button,{onClick:he.bind(null,{pages:n}),children:t}),e.u(ce,{required:l,skipButtonText:r})]})]},"start-task")},Ve=({content:i,pages:n,properties:l})=>{const{buttonText:t,skipButtonText:r}=i;return be(n),e.u("div",{className:"ul-task-page",children:[i.taskDetail&&e.u(Le,{richTextBody:i.taskDetail}),e.u(y.MobileEmbedView,{properties:l,children:e.u("div",{className:de,children:[e.u(y.Button,{className:"ul-complete-task-button",onClick:ge.bind(null,{status:"completed"}),children:t}),e.u(y.Button,{className:e.cc("ul-button-inactive"),onClick:ge.bind(null,{status:"given.up"}),children:r})]})})]},"complete-task")},We=({content:i,pages:n,required:l})=>{const{buttonText:t,skipButtonText:r}=i,[s]=e.useConfig(c=>[c.tabTitle]),[m,h]=e.h(!1);return e.u("div",{children:[e.u("div",{className:Ne,children:[e.u("p",{style:{marginTop:"auto"},children:i.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Ie,children:s})})]}),e.u("div",{className:l?"":de,children:[e.u(y.Button,{disabled:m,onClick:he.bind(null,{pages:n,setIsRequestingPermission:h}),children:t}),e.u(ce,{required:l,skipButtonText:r})]})]})},je=({content:i})=>e.u(y.Html,{className:e.cc(_e,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:i.svg},"ul-permission-request-graphic"),ze=({content:i,pages:n,required:l})=>{const{permissionDeniedHeadline:t,permissionDeniedBody:r,skipButtonText:s,tryAgainButtonText:m}=i,h=ue(n[0])?n[0]:null;return e.p(()=>{const c=setInterval(()=>{h!==null&&me({currentPage:h,pages:n})},1e3);return()=>clearInterval(c)},[h,n]),h?e.u("div",{children:[e.u("div",{className:Ne,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:t}),e.u("span",{className:Ie,children:r})]})}),e.u("div",{className:de,children:[e.u(y.Button,{onClick:me.bind(null,{currentPage:h,pages:n}),children:m}),e.u(ce,{required:l,skipButtonText:s})]})]}):null},Ge=({stream:i})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:n=>{n&&(n.srcObject=i||null)}}),Ze=({content:i,pages:n,required:l})=>{const{skipButtonText:t}=i,{avStream:r}=se.getState();return be(n),e.u("div",{children:[e.u(Ge,{stream:r}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(y.Button,{onClick:he.bind(null,{pages:n}),children:i.buttonText}),e.u(ce,{bottom:!0,required:l,skipButtonText:t})]})]})},Ye=({properties:i})=>{const{pages:n,required:l}=i,{avStream:t,currentPage:r}=se.getState();if(r===void 0)return null;switch(r==null?void 0:r.type){case"av_permission":{const s=we(t,r);return s===pe?e.u(je,{content:r}):s===ke?e.u(ze,{content:r,pages:n,required:l}):e.u(Ze,{content:r,pages:n,required:l})}case"screen_permission":return e.u(We,{content:r,pages:n,required:l});case"start_task":return e.u($e,{content:r,pages:n,required:l});case"complete_task":return e.u(Ve,{content:r,pages:n,properties:i});default:return null}},Ke=({className:i,properties:n,next:l,questionId:t})=>{const r=e.useConfig(),{surveyId:s,responseGroupUid:m,userId:h,update:c}=r,v=se(),{screenPermissionRequested:o}=v,g=se(d=>d.avStream);let p=se(d=>d.currentPage);p||(p=function({pages:d,userId:k,responseGroupUid:_,surveyId:M,questionId:F,next:B}){const{updatePage:I}=se.getState(),{eventEmitFn:R,recorderEventEmitter:W}=e.useConfig.getState(),x={questionId:F,surveyId:M,visitorId:k,responseGroupUid:_};let O=0;W.emit("recorded.task.permission.screen"),R("recorded.task.permission.screen"),W.emit("permission.status",{"permission.status.callback":(A,C,E,L)=>{const G=d[O],{type:S}=G,U=["screen"];if(ue(G)){const{permissionDescriptors:D}=G,K=D==null?void 0:D.includes("microphone"),j=D==null?void 0:D.includes("camera");K&&U.push("audio"),j&&U.push("video"),(A!=null&&A.active&&!j||A!=null&&A.active&&C)&&O++}ve(d[O])&&E&&(O++,W.emit("begin.recording",{"recording.media.types":U,"start.recording.callback":D=>I({mediaRecordingUids:D})})),I({currentPage:d[O],avStream:A,screenPermissionRequested:E,nextQuestion:B,type:S,passthroughData:x,recordingMediaTypes:U,captureStream:L})}});const q=d[O];return q.type==="av_permission"&&me({currentPage:q,pages:d}),q}({questionId:t,surveyId:s,next:d=>{l(d,!0)},pages:n.pages,responseGroupUid:m,userId:h}));let T=p.headline,u=p.captionText;const f=we(g,p);return ve(p)&&o&&(T=p.permissionDeniedHeadline,u=p.permissionDeniedCaptionText),ue(p)&&f===Te&&(T=p.permissionGrantedHeadline,u=p.permissionGrantedCaptionText),e.p(()=>{c()},[c]),e.u("div",{className:e.cc(i,"ul-center-horizontally","fade-in-transition"),children:[e.u(y.Header,{isRequired:n==null?void 0:n.required,message:T,properties:{captionText:u}}),e.u(y.QuestionBodyWrapper,{children:e.u(Ye,{properties:n})})]})},Xe=({richTextBody:i,plaintextBody:n})=>i?e.u(y.Html,{className:"ul-rich-text-body",html:i,id:"ul-card__text-url-body-container"}):n?e.u("div",{className:"ul-rich-text-body",id:"ul-card__text-url-body-container",children:(n?n.split(/\n\s*\n/g):[]).map((l,t)=>e.u("p",{children:l},t))}):null,Je=({className:i,message:n,next:l,properties:t,questionId:r,type:s})=>{const{visitorAttributes:m,isLongFormSurvey:h,useNewSurveyUI:c}=e.useConfig(p=>{var T;return{visitorAttributes:p.visitorAttributes,isLongFormSurvey:X.isLongFormSurvey(p.studyType),useNewSurveyUI:!!((T=p.experimentFlags)!=null&&T["sdk-new-survey-ui"])}}),v=(p,T=!1)=>{l({value:T?{skipped:!0}:void 0,questionId:r,type:s},!0)},o=y.getAttributedUrl(t&&t.buttonUrl,m),g=!c&&h&&t.promptActionType===e.PromptActionTypeEnum.NO_BUTTON;return e.u("div",{className:e.cc(i,"ul-card__text-url-prompt","fade-in-transition"),children:[e.u(y.Header,{isRequired:h&&(t==null?void 0:t.required),message:n,properties:{image:t.image,questionHtml:t.questionHtml,captionHtml:c?t.richTextBody:void 0,captionText:c?t.body:void 0}}),!c&&e.u(y.QuestionBodyWrapper,{children:e.u(Xe,{plaintextBody:t==null?void 0:t.body,richTextBody:t==null?void 0:t.richTextBody})}),e.u(y.MobileEmbedView,{properties:t,children:!g&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card-button-group",children:[e.u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:o,id:"ul-card-text__button",onClick:v,onKeyPress:p=>{p.key!=="Enter"&&p.key!==" "||l({value:void 0,questionId:r,type:s},!0)},rel:"noreferrer",role:o?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(t)}),t.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:p=>v(0,!0),children:e.getSkipButtonText(t)})]})})})]},r)},et=({className:i,questionId:n})=>{const{border:l,destroy:t,endCard:r,forceBrandedLogo:s,quotaEndcardText:m,update:h}=e.useConfig(g=>({border:g.border,destroy:g.destroy,endCard:g.endCard,forceBrandedLogo:g.forceBrandedLogo,quotaEndcardText:g.quotaEndcardText,update:g.update}));e.p(()=>{setTimeout(()=>{t(X.APP_ID)},s?4e3:2e3)},[t,s]);const c=(m==null?void 0:m.subheader)??(r==null?void 0:r.subheader),v=c?e.u("p",{className:"ul-caption",children:c}):null,o=(m==null?void 0:m.headline)??(r==null?void 0:r.headline)??"";return e.p(()=>{h()},[h]),e.u("div",{className:e.cc(i,"ul-card--thanks","fade-in-transition"),children:e.u("div",{children:e.u("div",{className:"ul-card--thanks-content",children:[e.u("div",{className:"ul-thanks-check",children:e.u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[e.u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:l,fillRule:"evenodd"}),e.u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:l,fillRule:"evenodd"}),e.u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),e.u(y.Header,{message:o}),v]})})},n)},tt=({className:i})=>{const{uploadProgress:n}=e.useConfig(s=>({uploadProgress:s.uploadProgress}));let l,t;Object.values(n).filter(s=>s.isSubmitted).length>1?(l="Your responses are processing",t="Please keep this tab open until your responses are fully processed."):(l="Your response is processing",t="Please keep this tab open until your response is fully processed.");const r=Math.round(Math.min(99,...Object.values(n).filter(s=>s.isSubmitted).map(s=>s.progressPct||0)));return e.u("div",{className:e.cc(i,"ul-card--uploading","fade-in-transition"),children:[e.u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:e.u("div",{className:"ul-loading-spinner",children:[e.u("div",{className:"first"}),e.u("div",{className:"second"}),e.u("div",{className:"third"}),e.u("div",{className:"fourth"})]})}),e.u(y.Header,{message:`${l} (${r}% complete)`}),e.u("p",{className:"ul-caption",children:t})]})},qe=e.F$1(void 0),rt=({value:i,children:n})=>e.u(qe.Provider,{value:i,children:n}),it=({isRightLabel:i,isLeftLabel:n})=>i?e.MaxDiffChoice.RIGHT:n?e.MaxDiffChoice.LEFT:null,nt="Best",st="Worst",ot=({enableCspTrustedTypes:i,ariaPressed:n,className:l,html:t,id:r,onClick:s})=>{const m=e.F(()=>X.getHtml(t,i),[i,t]);return e.u("span",{"aria-pressed":n,className:l,dangerouslySetInnerHTML:{__html:m},id:r,onClick:s,tabIndex:0,type:"button"})},fe=({border:i,choice:n,choiceStyle:l,enableCspTrustedTypes:t,id:r,isSelected:s,label:m,onSelect:h,smileySvg:c,useMobileStyling:v})=>{const o=n===e.MaxDiffChoice.LEFT,g=o?"good":"bad";return e.u("div",{className:"ul-card-maxdiff__option-control "+(c?"smiley":""),children:c?e.u(ot,{ariaPressed:s,className:s?`ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected ${g}`:"ul-card-maxdiff__option-btn",enableCspTrustedTypes:t,html:c,id:`smiley-${g}-${r}`,onClick:h}):e.u(y.Option,{allowTextEntry:!1,ariaLabel:`${o?"best":"worst"}Label-${m}`,border:i,choiceStyle:l,error:!1,id:`${r}`,isRadio:!0,isSelected:s,onUserInputChanged:h,useMobileStyling:v})})},at=({id:i,label:n,isLeftLabel:l,isRightLabel:t,useNewSurveyUI:r,border:s,choiceStyle:m,enableCspTrustedTypes:h,goodSmileySvg:c,badSmileySvg:v,handleSelect:o,useMobileStyling:g})=>{const p={border:s,choiceStyle:m,enableCspTrustedTypes:h,id:i,label:n,useMobileStyling:g},T=e.u(e.g,{children:[e.u(fe,{...p,choice:e.MaxDiffChoice.LEFT,isSelected:l,onSelect:o(i,e.MaxDiffChoice.LEFT),smileySvg:c}),e.u("div",{className:"ul-card-maxdiff__option-label",children:n}),e.u(fe,{...p,choice:e.MaxDiffChoice.RIGHT,isSelected:t,onSelect:o(i,e.MaxDiffChoice.RIGHT),smileySvg:v})]});return r?e.u("div",{className:"ul-card-maxdiff__option-row",children:T}):T},lt=({className:i,labels:n,message:l,properties:t,options:r,questionId:s,type:m,next:h})=>{var R,W,x,O;const[c,v]=e.h(r.map((q,A)=>({...q,label:q.label===""?`Item ${A+1}`:q.label,isRightLabel:!1,isLeftLabel:!1}))),o=(()=>{const q=e.q(qe);if(q===void 0)throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");return q})(),[g,p]=e.h(!1);e.p(()=>{const q=c.findIndex(D=>D.isRightLabel),A=c.findIndex(D=>D.isLeftLabel),C=q!==-1&&A!==-1;p(C);const E=!t.required||t.required&&C,L=c.map(D=>({id:D.id,option:D.label,selected:it(D)})),G=Math.floor(s),S=Object.keys(o).filter(D=>D.startsWith(G.toString())).map(Number).sort((D,K)=>D-K).at(-1),U=[];if(typeof S=="number"){const D=o[S],K=JSON.parse(D);U.push(...K)}U.push(L),setTimeout(()=>{h({value:U,questionId:s,type:m},E,C),p(!1)},C?500:0)},[c]);const{border:T,useMobileStyling:u,enableCspTrustedTypes:f,useNewSurveyUI:d}=e.useConfig(q=>{var A;return{border:q.border,useMobileStyling:q.useMobileStyling,enableCspTrustedTypes:q.enableCspTrustedTypes,useNewSurveyUI:!!((A=q.experimentFlags)!=null&&A["sdk-new-survey-ui"])}}),k=d?{padding:"0",display:"flex",cursor:"pointer",width:"auto"}:{padding:"24px",display:"flex",cursor:"pointer",width:"auto"},_=(R=t.ratingIcons)==null?void 0:R[0].svg,M=(W=t.ratingIcons)==null?void 0:W[1].svg,F=(n==null?void 0:n.left)||((x=t==null?void 0:t.labels)==null?void 0:x.left)||nt,B=(n==null?void 0:n.right)||((O=t==null?void 0:t.labels)==null?void 0:O.right)||st,I={border:T,choiceStyle:k,enableCspTrustedTypes:f,goodSmileySvg:M,badSmileySvg:_,handleSelect:(q,A)=>()=>{g||v(C=>((E,L,G)=>E.map(S=>S.id===L?{...S,isRightLabel:G===e.MaxDiffChoice.RIGHT,isLeftLabel:G===e.MaxDiffChoice.LEFT}:G===e.MaxDiffChoice.RIGHT&&S.isRightLabel||G===e.MaxDiffChoice.LEFT&&S.isLeftLabel?{...S,isRightLabel:!1,isLeftLabel:!1}:S))(C,q,A))},useMobileStyling:u,useNewSurveyUI:d};return e.u("form",{className:e.cc(i,"ul-card-maxdiff","fade-in-transition"),children:[e.u(y.Header,{isRequired:t==null?void 0:t.required,message:l,properties:t}),e.u(y.QuestionBodyWrapper,{children:e.u("div",{className:"ul-card--maxdiff__question-inner-container",children:[d?e.u("div",{className:"ul-card-maxdiff__labels-row",children:[e.u("div",{className:"ul-card-maxdiff__label",children:F}),e.u("div",{className:"ul-card-maxdiff__label",children:B})]}):e.u(e.g,{children:[e.u("div",{className:"ul-card-maxdiff__label",children:F}),e.u("div",{children:" "}),e.u("div",{className:"ul-card-maxdiff__label",children:B})]}),c.map(({id:q,label:A,isLeftLabel:C,isRightLabel:E})=>e.u(at,{id:q,isLeftLabel:C,isRightLabel:E,label:A,...I},q))]})})]},s)},ut=({className:i,labels:n,message:l,next:t,properties:r,questionId:s,type:m,onSubmitButtonClick:h,options:c,showIndividualSubmit:v=!1})=>{const o=e._(null),g=e._(0),p=e._(0),T=e._(null),u=e._(!1),f=e._([]),[d,k]=e.h(()=>(r==null?void 0:r.required)===!0),[_,M]=e.h(!1),[F,B]=e.h(()=>c.map(b=>({...b,rank:null}))),I=e.F(()=>Array.from({length:c.length},(b,N)=>N+1),[c.length]),{isLongFormSurvey:R,focusedQuestionId:W,setFocusedQuestionId:x,useMobileStyling:O,isPreview:q,headers:A}=e.useConfig(b=>({useMobileStyling:b.useMobileStyling,isLongFormSurvey:X.isLongFormSurvey(b.studyType),focusedQuestionId:b.focusedQuestionId,setFocusedQuestionId:b.setFocusedQuestionId,isPreview:b.isPreview,headers:b.headers})),C=(A==null?void 0:A["userleap-platform"])==="android",E=O&&!q&&!C,L=!E&&!C,G=R&&W===s,S=b=>{b.preventDefault(),ee(F),h&&h(_)},U=(b,N)=>{B($=>{const Q=parseInt(N),Z=$.map(Y=>({...Y}));Z.some(Y=>Y.rank==null)&&Z.forEach((Y,re)=>Y.rank=re+1);const J=Z.findIndex(Y=>Y.id===b);if(J===-1)return $;const z=Z[J].rank;return Q<z?Z.forEach(Y=>{Y.id!==b&&Y.rank>=Q&&Y.rank<z&&(Y.rank=Y.rank+1)}):Q>z&&Z.forEach(Y=>{Y.id!==b&&Y.rank>z&&Y.rank<=Q&&(Y.rank=Y.rank-1)}),Z[J].rank=Q,Z.sort((Y,re)=>Y.rank-re.rank),ne(Z),Z})},D=(b,N)=>{for(let $=0;$<f.current.length;$++){const Q=f.current[$];if(!Q||Q===T.current)continue;const Z=Q.getBoundingClientRect();if(b>=Z.left&&b<=Z.right&&N>=Z.top&&N<=Z.bottom)return{element:Q,index:$}}return null},K=b=>N=>{if(!E)return;N.preventDefault(),N.stopPropagation(),u.current=!0,o.current=b;const $=N.touches[0];g.current=$.clientY,p.current=$.clientY;const Q=N.currentTarget.closest(".ul-card-rank__option");Q&&(T.current=Q,Q.classList.add("is-dragging"))},j=b=>{if(!E||!u.current||o.current===null)return;b.preventDefault(),b.stopPropagation();const N=b.touches[0];p.current=N.clientY;const $=p.current-g.current;T.current&&(T.current.style.transform=`translateY(${$}px)`,T.current.style.zIndex="1000"),f.current.forEach(Z=>{Z&&Z!==T.current&&Z.classList.remove("is-drop-target")});const Q=D(N.clientX,N.clientY);Q&&Q.element.classList.add("is-drop-target")},ie=b=>{if(!E||!u.current||o.current===null)return;b.preventDefault(),b.stopPropagation();const N=b.changedTouches[0],$=D(N.clientX,N.clientY);T.current&&(T.current.style.transform="",T.current.style.zIndex="",T.current.classList.remove("is-dragging")),f.current.forEach(Q=>{Q&&Q.classList.remove("is-drop-target")}),$&&$.index!==o.current&&te(o.current,$.index),o.current=null,T.current=null,u.current=!1},te=(b,N)=>{B($=>{const Q=$.map(J=>({...J})),[Z]=Q.splice(b,1);return Q.splice(N,0,Z),Q.forEach((J,z)=>{J.rank=z+1}),ne(Q),Q})},ee=b=>{const N={};b.reduce(($,Q)=>($[Q.id]=Q.rank,$),N),t({value:N,questionId:s,type:m},!0)},ne=b=>{k(!1),M(!0),R&&ee(b)},{left:oe,right:a}=n,w=c.length,P=b=>{b.preventDefault(),b.currentTarget.classList.add("is-drop-target")},V=b=>{b.currentTarget.classList.remove("is-drop-target")},H=b=>{o.current=null,b.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(i,"ul-card-rank","fade-in-transition",R&&!G&&"ul-card--unfocused"),onClick:R&&!G?()=>{x(s)}:void 0,onSubmit:S,children:[e.u(y.Header,{isRequired:r==null?void 0:r.required,message:l,properties:r}),e.u(y.MobileEmbedView,{properties:r,children:C?e.u(e.g,{children:[e.u(y.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",oe]})}),e.u("ol",{className:"ul-card-rank__list",children:F.map(({id:b,label:N,rank:$})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${N}`,className:e.cc("ul-card-rank__select",$==null&&"ul-card-rank__select--placeholder"),name:`rank[${b}]`,onChange:Q=>U(b,Q.currentTarget.value),value:$??"",children:[$==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),I.map(Q=>e.u("option",{className:"ul-card-rank__select-option",value:Q,children:Q},`${Q}-${s}`))]}),e.u("span",{children:N})]},b))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[w," - ",a]})})]}),v&&e.u(y.LongformSubmitButton,{handleSubmit:S,isSubmitDisabled:d})]}),!R&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(y.Button,{disabled:d,children:e.getButtonText(r)})})})]}):e.u(e.g,{children:[e.u(y.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",oe]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:C?void 0:b=>{b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="move")},children:F.map(({id:b,label:N,rank:$},Q)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!L||void 0,onDragEnd:L?H:void 0,onDragEnter:L?P:void 0,onDragLeave:L?V:void 0,onDragStart:L?(J=Q,z=>{o.current=J,z.dataTransfer&&(z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",String(J)),z.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:L?(Z=Q,z=>{var re,le;z.preventDefault(),z.currentTarget.classList.remove("is-drop-target");const Y=o.current;o.current=null,(le=(re=z.currentTarget.closest(".ul-card-rank__list"))==null?void 0:re.querySelector(".is-dragging"))==null||le.classList.remove("is-dragging"),Y!=null&&Y!==Z&&te(Y,Z)}):void 0,ref:z=>f.current[Q]=z,children:[e.u("select",{"aria-label":`Rank for ${N}`,className:e.cc("ul-card-rank__select",$==null&&"ul-card-rank__select--placeholder"),name:`rank[${b}]`,onChange:z=>U(b,z.currentTarget.value),value:$??"",children:[$==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),I.map(z=>e.u("option",{className:"ul-card-rank__select-option",value:z,children:z},`${z}-${s}`))]}),e.u("span",{children:N}),!C&&e.u("button",{"aria-label":`Drag ${N} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:E?ie:void 0,onTouchMove:E?j:void 0,onTouchStart:E?K(Q):void 0,title:"Drag to reorder",type:"button",children:e.u("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z",fill:"currentColor"})})})]},b);var Z,J})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[w," - ",a]})})]}),v&&e.u(y.LongformSubmitButton,{handleSubmit:S,isSubmitDisabled:d})]}),!R&&e.u(y.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(y.Button,{disabled:d,children:e.getButtonText(r)})})})]})})]},s)},dt=new Set(["consentlegal","texturlprompt","thanks","videovoice"]),ct=new Set(["aidynamicfollowup","aidynamicstandalone","open","matrix","multipleselect","multiplechoice","rankorder"]),Se=({cardInstance:i,moveToNextQuestion:n,showIndividualSubmit:l,submitQuestion:t,updateCardValues:r,allResponsesArray:s,onNavClick:m,isNavDisabled:h,isLastCard:c})=>{const{isLongFormSurvey:v,createDynamicFollowupQuestion:o,cards:g,surveyVisitorAttributes:p,useNewSurveyUI:T}=e.useConfig(I=>{var R;return{isLongFormSurvey:X.isLongFormSurvey(I.studyType),createDynamicFollowupQuestion:I.createDynamicFollowupQuestion,cards:I.cards,surveyVisitorAttributes:I.surveyVisitorAttributes,useNewSurveyUI:!!((R=I.experimentFlags)!=null&&R["sdk-new-survey-ui"])}});if(!i)return null;const{name:u,type:f,props:d,childId:k}=i,_=l&&ct.has(f),M=d==null?void 0:d.displayLogic;if(M!=null&&M.length&&!e.someDisplayLogicOptionMatches({displayLogic:M,allResponses:s,cards:g,surveyVisitorAttributes:p??{}}))return null;const F={className:"ul-card",next:(I,R,W=!0)=>t(I,R&&W),questionId:u,type:f,showIndividualSubmit:l,..._?{next:(I,R)=>{r(I.questionId,I,R??!0)},onSubmitButtonClick:(I=!1)=>{k?I?(n(u),o({parentQuestionId:u})):n(k):n(u)}}:{}},B=(()=>{switch(f){case"consentlegal":return e.u(Me,{...F,...d});case"likert":return e.u(Fe,{...F,...d});case"matrix":return e.u(Ee,{...F,...d});case"maxdiff":return e.u(lt,{...F,...d});case"multiplechoice":return e.u(Oe,{...F,...d});case"multipleselect":return e.u(Ue,{...F,...d});case"nps":return e.u(Ae,{...F,...d});case"open":case"aidynamicfollowup":case"aidynamicstandalone":return e.u(He,{...F,type:i.type,...d});case"rankorder":return e.u(ut,{...F,...d});case"recordedtask":return e.u(Ke,{...F,...d});case"texturlprompt":return e.u(Je,{...F,...d});case"thanks":return e.u(et,{...F,...d});case"uploading":return e.u(tt,{...F,...d});default:return null}})();return B?v?e.u("div",{className:"ul-card-scroll-wrapper",children:[B,T&&c&&!dt.has(f)&&e.u("div",{className:"ul-lfs-nav-button-wrapper",children:e.u(y.Button,{className:e.cc("long-form-button",h&&"sprig-button-disabled"),disabled:h,onClick:m,children:e.u("span",{className:"long-form-button-text-container",children:e.u(e.Arrow,{stroke:"white"})})})})]},u):B:null},pt=({isSubmitDisabled:i=!1,onSubmit:n,buttonText:l})=>{var f;const{cards:t,forceBrandedLogo:r,index:s,marketingUrl:m,showSurveyBrand:h,slugName:c,surveyId:v,useMobileStyling:o,useNewSurveyUI:g}=e.useConfig(d=>{var k;return{cards:d.cards,forceBrandedLogo:d.forceBrandedLogo,index:d.index,marketingUrl:d.marketingUrl,showSurveyBrand:d.showSurveyBrand,slugName:d.slugName,surveyId:d.surveyId,useMobileStyling:d.useMobileStyling,useNewSurveyUI:!!((k=d.experimentFlags)!=null&&k["sdk-new-survey-ui"])}}),p=((f=t[s])==null?void 0:f.type)==="thanks",T=!g&&!p,u=e.buildMarketingUrl({marketingUrl:m,slugName:c,surveyId:v,forceBrandedLogo:r});return e.u("footer",{className:e.cc("long-form-question-footer-container",o&&"long-form-question-footer-container--mobile",p&&"long-form-question-footer-container-center"),children:[p&&r?e.u(e.ThankYouLink,{marketingUrlLink:u}):e.u("div",{className:"long-form-question-footer-container-logo",children:h&&e.u(e.SprigBrandLogo,{forceBrandedLogo:r,marketingUrlLink:u})}),T&&e.u("div",{className:e.cc("ul-card__button-wrapper","ul-card-vertical__button-wrapper","long-form-question-footer-container-actions"),children:e.u(y.Button,{className:e.cc("long-form-button",i&&"sprig-button-disabled"),disabled:i,onClick:n,children:e.u("span",{className:"long-form-button-text-container",children:l??e.u(e.Arrow,{stroke:"white"})})})})]})},mt=new Set(["thanks","uploading"]),xe="Questions with Display Logic do not show in side-by-side previews.";exports.PageCard=({cards:i,next:n,previousResponses:l})=>{var ne,oe;const t=e._(null),[r,s]=e.h({}),[m,h]=e.h({}),{isLongFormSurvey:c,focusedQuestionId:v,setFocusedQuestionId:o,createDynamicFollowupQuestion:g,allResponses:p,cardIndexByName:T,surveyVisitorAttributes:u,cards:f,createDynamicStandaloneQuestion:d,isPreview:k,update:_,useNewSurveyUI:M}=e.useConfig(a=>{var w;return{isLongFormSurvey:X.isLongFormSurvey(a.studyType),focusedQuestionId:a.focusedQuestionId,setFocusedQuestionId:a.setFocusedQuestionId,createDynamicFollowupQuestion:a.createDynamicFollowupQuestion,allResponses:a.allResponses,cardIndexByName:a.cardIndexByName,surveyVisitorAttributes:a.surveyVisitorAttributes,cards:a.cards,createDynamicStandaloneQuestion:a.createDynamicStandaloneQuestion,isPreview:a.isPreview,update:a.update,useNewSurveyUI:!!((w=a.experimentFlags)!=null&&w["sdk-new-survey-ui"])}}),F=e.F(()=>({...l,...e.buildReadableResponseMap(i.map(a=>{var w,P;return{...a,value:((w=r[a.name])==null?void 0:w.value)??null,secondaryValue:((P=r[a.name])==null?void 0:P.secondaryValue)??null}}))}),[l,r,i]);y.useSetAllResponsesRaw(F);const B=e.pipeReadableResponsesIntoCards(i,F),I=e.F(()=>e.buildResponsesArrayForDisplayLogic({storeAllResponses:p,cards:i,cardValues:r,cardIndexByName:T}),[p,i,r,T]),R=e.F(()=>{const a=new Set;return i.forEach(w=>{var V;const P=(V=w.props)==null?void 0:V.displayLogic;if(!P||P.length===0)return void a.add(w.name);e.someDisplayLogicOptionMatches({displayLogic:P,allResponses:I,cards:f,surveyVisitorAttributes:u??{}})&&a.add(w.name)}),a},[i,I,u,f]),W=(({isPreview:a,cards:w,displayedCardNames:P})=>{var b;if(!a||P.size>0)return!1;const V=w.filter(N=>!mt.has(N.type));if(V.length!==1)return!1;const H=(b=V[0].props)==null?void 0:b.displayLogic;return!!(H!=null&&H.length)})({isPreview:!!k,cards:i,displayedCardNames:R});e.p(()=>{W&&requestAnimationFrame(()=>{_()})},[W,_]),e.p(()=>{i.some(a=>{if(a.type==="aidynamicstandalone"&&a.props&&R.has(a.name)){if(a.props.loading===e.DynamicQuestionLoadingStates.inFlight)return!0;if(a.props.loading===void 0)return d({questionId:a.name}),!0}return!1})},[i,d,R]);const x=e._(null);e.p(()=>{const a=R,w=x.current;if(w!==null)for(const P of w)a.has(P)||(s(V=>{const H={...V};return delete H[P],H}),h(V=>{const H={...V};return delete H[P],H}));x.current=new Set(a)},[R]);const O=e._(null),q=e._(!1),A=e._(null),C=e.T(a=>{var H,b;q.current=!0;const w=i.findIndex(N=>N.name===a);if(!c||a===null||w===-1)return void(q.current=!1);const P=(H=O.current)==null?void 0:H.querySelectorAll(".ul-card-scroll-wrapper")[w],V=(b=O.current)==null?void 0:b.closest(".ul-card-main-content");if(P&&V){if(P&&V){const N=P.getBoundingClientRect(),$=V.getBoundingClientRect(),Q=N.top-$.top+V.scrollTop,Z=Q+N.height/2,J=window.innerHeight-157;let z;N.height>=J?z=Q:z=Z-V.clientHeight/2;const Y=V.clientHeight,re=V.scrollHeight-Y,le=Math.max(0,Math.min(z,re));V.scrollTo({top:le,behavior:"smooth"}),setTimeout(()=>{q.current=!1},500)}}else q.current=!1},[c,i]);function E(){const a=L(i,r);if((B==null?void 0:B.length)===1&&(a==null?void 0:a.length)===1){const w=B[0],P=a[0];e.triggerFollowUpQuestionGeneration({displayCard:w,response:P,createDynamicFollowupQuestion:g})}n(a)}function L(a,w){return a.filter(P=>R.has(P.name)).map(P=>{const V=w[P.name],H=B.find(b=>b.name===P.name);return{...V,questionText:H?e.getProcessedQuestionText(H):void 0}})}e.p(()=>{v!==null&&i.findIndex(a=>a.name===v)!==-1||o(i[0].name)},[i,v,o]);const G=a=>{if(!c)return;let w=i.findIndex(P=>P.name===a)+1;for(;w<i.length&&!R.has(i[w].name);)w++;w<i.length?o(i[w].name):o(a)};e.p(()=>{c&&v!==null&&(A.current!==v?C(v):A.current=null)},[v,c,C]);const S=e.T(()=>{var $,Q;if(q.current)return;const a=($=O.current)==null?void 0:$.closest(".ul-card-main-content");if(!a)return;const w=(Q=O.current)==null?void 0:Q.querySelectorAll(".ul-card-scroll-wrapper");if(!w||w.length===0)return;const P=a.getBoundingClientRect(),V=P.top+P.height/2;let H=0,b=1/0;w.forEach((Z,J)=>{const z=Z.getBoundingClientRect(),Y=z.top+z.height/2,re=Math.abs(V-Y);re<b&&(b=re,H=J)});const N=i[H];A.current=N.name,o(N.name)},[i,o]);e.p(()=>{var w;if(!c)return;const a=((w=O.current)==null?void 0:w.closest(".ul-card__container"))||null;return a&&a.addEventListener("scroll",S,{passive:!0}),()=>{a&&a.removeEventListener("scroll",S)}},[S,c]);const U=e.F(()=>i.every(a=>{var w;return!R.has(a.name)||!(!(a!=null&&a.props)||!("properties"in a.props)||((w=a.props.properties)==null?void 0:w.required)!==!1)||m[a.name]}),[m,i,R]),D=async(a,w,P)=>{return h(H=>({...H,[a]:P})),await(V=H=>({...H,[a]:w}),new Promise(H=>{s(b=>{const N=V(b);return H(N),N})}));var V};e.p(()=>{var V;if(!c)return;const a=t.current,w=(V=i==null?void 0:i[0])==null?void 0:V.groupId;t.current=w;const P={};if(i.forEach(H=>{var b,N;e.appCardHasPropertiesWithRequired(H)&&(H.props.properties.required||(P[H.name]={value:((b=r[H.name])==null?void 0:b.value)??null,secondaryValue:((N=r[H.name])==null?void 0:N.secondaryValue)??null,questionId:H.name,type:H.type}))}),a==null||a!==w)s(P),h({});else{s(b=>({...b,...P}));const H=i.reduce((b,N)=>{var $;return N.type==="aidynamicfollowup"&&(($=N.props)==null?void 0:$.loading)===null&&(b[N.name]=!0),b},{});h(b=>({...b,...H}))}},[i,c]);const K=async(a,w)=>{const P=B.find(V=>V.name===a.questionId);if(c){const V=await D(a.questionId,a,w),H=j(a.type),b=ie(a.type);if(H&&(P!=null&&P.groupId&&e.triggerFollowUpQuestionGeneration({displayCard:P,response:a,createDynamicFollowupQuestion:g}),G(a.questionId)),b&&w){const N=L(i,V);n(N)}}else{const V={...a,questionText:P?e.getProcessedQuestionText(P):void 0};e.triggerFollowUpQuestionGeneration({displayCard:P,response:a,createDynamicFollowupQuestion:g}),n([V])}},j=a=>new Set(["nps","likert","multiplechoice"]).has(a),ie=a=>new Set(["videovoice","consentlegal","texturlprompt","maxdiff"]).has(a),te=((ne=i[0])==null?void 0:ne.type)==="thanks",ee=(oe=[...B].reverse().find(a=>R.has(a.name)))==null?void 0:oe.name;return c?e.u("div",{className:"ul-card-list-container--longform","data-testid":"ui-container",ref:O,children:W?e.u("div",{className:"ul-display-logic-preview-message","data-testid":"display-logic-preview-message",children:xe}):e.u(rt,{value:l,children:[B.map((a,w)=>{const P=a.name===ee;return e.u(Se,{allResponsesArray:I,cardInstance:a,isLastCard:P,isNavDisabled:!U,moveToNextQuestion:G,onNavClick:E,showIndividualSubmit:i.length>1&&w<i.length-1&&(!M||!!a.childId),submitQuestion:K,updateCardValues:D},(a==null?void 0:a.name)||w)}),!te&&e.u(pt,{isSubmitDisabled:!U,onSubmit:E})]})}):e.u(e.g,{children:[e.u("div",{"data-testid":"ui-container",style:{display:"none"}}),W?e.u("div",{className:"ul-display-logic-preview-message","data-testid":"display-logic-preview-message",children:xe}):B.map((a,w)=>e.u(Se,{allResponsesArray:I,cardInstance:a,moveToNextQuestion:G,showIndividualSubmit:!1,submitQuestion:K,updateCardValues:D},(a==null?void 0:a.name)||w))]})};