@sprig-technologies/sprig-bundled 2.46.0 → 2.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conversational-styles-BO6t2-y4.js +4 -0
- package/dist/conversational-styles-CWaKMg_f.cjs +1 -0
- package/dist/conversational-ui-CEmVz2Vg.cjs +658 -0
- package/dist/conversational-ui-CXl_8HB_.js +1517 -0
- package/dist/conversational-v2-styles-D5xNLWoE.cjs +1 -0
- package/dist/conversational-v2-styles-GH9tfuXI.js +4 -0
- package/dist/getAttributedUrl-D-vLs0_x.js +194 -0
- package/dist/getAttributedUrl-DNR4xoBk.cjs +12 -0
- package/dist/index-B-aCET7A.js +737 -0
- package/dist/index-BBiYWZkL.cjs +66 -0
- package/dist/{index-ssZu7abp.js → index-BNI3IK7K.js} +993 -993
- package/dist/index-DD639GNJ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +42 -0
- package/dist/index.js +1 -1
- package/dist/view-B4aVfDPi.cjs +1 -0
- package/dist/view-eRBVyC0l.js +1831 -0
- package/package.json +1 -1
- package/dist/conversational-styles-B-bImmUK.js +0 -4
- package/dist/conversational-styles-vDq05r1U.cjs +0 -1
- package/dist/conversational-ui-BFVjhjtp.cjs +0 -658
- package/dist/conversational-ui-DR7m5fTX.js +0 -1511
- package/dist/conversational-v2-styles-DeqT460S.js +0 -4
- package/dist/conversational-v2-styles-DkN3ff79.cjs +0 -1
- package/dist/getAttributedUrl-CrSHEuDU.js +0 -193
- package/dist/getAttributedUrl-IcC63CWO.cjs +0 -12
- package/dist/index-8IqBkL-J.cjs +0 -66
- package/dist/index-B9EDtB3L.js +0 -734
- package/dist/index-nfe0p3os.cjs +0 -1
- package/dist/view-RRtNaAXH.js +0 -1789
- package/dist/view-iopAAugx.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default='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-card-text__button{background-color:var(--theme);border-radius:8px;padding:11px 16px;gap:5px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:var(--sprig-button-disabled-bg);color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:transparent;color:#5d696f}.ul-card-skip__button{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}.sprig-question-footer-container{padding:0;align-items:center}.ul-card__button-checkmark{display:flex;align-items:center;font-size:15px;gap:5px;padding:11px 16px;border-radius:8px;background-color:var(--theme);color:#fff}.ul-card__button-checkmark:disabled{background-color:var(--theme);opacity:.5;color:#fff}.ul-card__button-checkmark:disabled>svg path{stroke:#fff}.ul-conversational-ui{width:100%;height:100%;display:flex;flex-direction:column;min-height:500px;font-size:15px;position:relative}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:right;align-self:stretch}.conversational-close-btn{position:fixed;top:20px;right:16px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:pointer;z-index:1000}.conversational-close-btn:hover{background:var(--chat-close-hover-bg)}.chat-container{flex:1;display:flex;flex-direction:column;align-items:center}.chat-messages{flex:1;display:flex;flex-direction:column;max-width:600px;width:100%;padding:36px 16px 44px;gap:8px;box-sizing:border-box}.chat-message-no-response{font-style:italic;color:var(--chat-msg-no-response)}.chat-card .choice{margin-bottom:0;background-color:var(--chat-choice-bg);padding:0;line-height:2;border:none;min-height:28px}.chat-card .choice.ul-select-active-dynamic-style{border:none}.chat-bubble-container{display:flex;flex-direction:row;align-items:flex-start;width:100%;animation:fadeInUp .3s ease-out}.chat-bubble-container .chat-avatar{display:none}.chat-left{align-self:flex-start;width:auto;justify-content:flex-start}.chat-container .chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:0}.chat-right{align-self:flex-end;width:100%;justify-content:flex-end;margin-top:8px}.sprig-question-body{word-wrap:break-word;position:relative;border-radius:8px;box-sizing:border-box;max-width:448px;gap:8px;padding:0;overflow:unset}.chat-bubble-text-only{width:auto;max-width:286px}.chat-bubble.chat-bubble-right .chat-message-text{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-bubble-left{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-left-bg)}.chat-bubble.chat-bubble-right:has(.answered-card) .sprig-question-body{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-bubble.chat-bubble-right:not(:has(.chat-bubble-text-only)) .sprig-question-body{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-message-text{line-height:1.4;margin:0;text-align:left;color:var(--text-color);font-size:14px;font-weight:400;word-wrap:break-word}.chat-persona-label{margin-top:-4px;text-align:left;color:var(--chat-end-text);font-size:14px;font-weight:400;line-height:140%}.chat-card-container{padding:0;background:transparent}@media (max-width: 600px){.conversational-ui .long-form-question-footer-container-logo{position:unset}}.chat-card-container .chat-card{display:flex;flex-direction:column;gap:8px}.chat-thanks-card{background:transparent;box-shadow:none;text-align:center}.end-of-survey-text{text-align:center;color:var(--chat-end-text);font-size:14px;margin-top:8px;font-weight:400}.answered-card{pointer-events:none;opacity:.7;position:relative}.footer{width:100%;margin-top:12px;font-size:12px;font-weight:400;line-height:12px;color:var(--chat-footer)}.answered-card:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--chat-answered-overlay-bg);pointer-events:none;border-radius:inherit}.answered-card button,.answered-card input,.answered-card textarea,.answered-card select{pointer-events:none}.answered-card:not(.ul-card__consent-legal):not(.ul-card__text-url-prompt) .ul-card-button-group *{display:none}.sprig-question-footer-container{padding:0;align-items:end}.chat-card.ul-card--video .sprig-question-footer-container{flex-direction:row;justify-content:flex-end;align-items:center}.ul-card-text__button{font-size:13px}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:42px}.ul-card-vertical__button-wrapper{align-items:end}.ul-card-skip__button{padding:0 16px}.sprig-stretch{padding:16px;display:flex;flex-direction:column;gap:8px;border-radius:8px;background:var(--consent-sprig-stretch-bg)}.sprig-stretch input{background-color:var(--consent-input-bg)}.ul-card--likert__numbers{background-color:#fff;display:flex;width:100%;box-sizing:border-box;flex-wrap:nowrap;justify-content:space-between;align-items:center}.ul-card--likert__numbers:has(.likert-star,.likert-smiley){background-color:transparent;justify-content:space-between;gap:2px}.likert-smiley>svg{scale:1.176}.ul-card--likert__numbers .likert-star,.ul-card--likert__numbers .likert-smiley{min-width:24px;min-height:57px;max-width:38px;max-height:38px;flex:0 1 auto;transition:height .2s,width .2s}.ul-card--likert__labels{font-weight:400;color:var(--text-color);text-align:center;word-break:break-word;font-size:.95rem}.likert-number,.likert-smiley,.likert-star{aspect-ratio:1 / 1;min-height:57px;max-height:57px;box-sizing:border-box;flex:1 1 auto;display:flex;align-items:center;justify-content:center;transition:height .2s,width .2s,font-size .2s}.ul-card--likert__numbers:has(>:nth-child(6))>.likert-number,.ul-card--likert__numbers:has(>:nth-child(6))>.likert-smiley,.ul-card--likert__numbers:has(>:nth-child(6))>.likert-star{aspect-ratio:unset;min-height:57px;min-width:42px}.ul-card--likert__numbers:has(>:nth-child(8))>.likert-number,.ul-card--likert__numbers:has(>:nth-child(8))>.likert-smiley,.ul-card--likert__numbers:has(>:nth-child(8))>.likert-star{aspect-ratio:unset;min-height:57px;min-width:32px}.sprig-question-body:has(.likert-number,.likert-smiley,.likert-star){max-width:100%;padding:0 .5rem;display:flex;flex-direction:column}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:700px}@media (min-width: 1200px){.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:900px}}@media (max-width: 768px){.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:100%;width:100%;padding:0 4px}}.chat-card-container .ul-card--matrix_container{max-width:100%;overflow-x:auto}.chat-card-container .ul-card--matrix_grid{min-width:100%}.chat-card-container .ul-card__matrix{width:100%}.chat-card-container .choice-label-container{gap:8px}@media (max-width: 768px){.sprig-header-label-container,.sprig-header-label,.choice{font-size:14px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:100%;width:100%}.chat-card-container .ul-card--matrix_container{overflow-x:auto;-webkit-overflow-scrolling:touch}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-conversational-ui .chat-card-container .chat-card.ul-card--nps{width:100%;min-width:262px;max-width:500px;box-sizing:border-box}.ul-conversational-ui .ul-card--nps__numbers{background-color:#fff}.ul-conversational-ui .nps-number{color:var(--text-color);border:2px solid var(--nps-number-border)}@media (max-width: 768px){.ul-conversational-ui .nps-number{font-size:16px;height:35px}.ul-conversational-ui .ul-card--nps__labels{font-size:12px;font-weight:400;color:var(--text-color)}}@media (min-width: 769px){.ul-conversational-ui .nps-number{font-size:20px;height:40px}.ul-conversational-ui .ul-card--nps__labels{font-size:14px;font-weight:400;color:#2f2e2c}}.ul-card-rank__option{text-align:left;background:#0000000d;margin-bottom:8px}.ul-card-rank__option.is-dragging{background-color:#0000000d;border:none}.ul-card-rank__labels{font-weight:400;color:var(--text-color)}@media (min-width: 1200px){.ul-card--rank__question-inner-container{max-width:900px}}@media (max-width: 768px){.ul-card--rank__question-inner-container{min-width:0;max-width:100%;width:100%;font-size:14px}.ul-card-rank__labels{font-size:14px}.ul-card-rank__option>span{font-size:14px}.ul-card-rank__option>select{font-size:14px}}.select-button{align-items:center;background-color:var(--select-button-bg);border-radius:8px;border:1px solid #E8E7E6;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:var(--select-button-hover)}.select-button:active{background-color:var(--select-button-bg)}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:var(--select-list-bg);border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:8px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:var(--select-checkbox-hover-bg)}.chat-card .select-checkbox{border:1px solid var(--select-checkbox-border);background-color:var(--select-checkbox-bg)}.chat-card .select-radio{box-shadow:unset;border:1px solid var(--select-checkbox-border);background-color:var(--select-radio-bg)}.chat-card .select-radio.ul-select-active-dynamic-style{border:1px solid var(--select-checkbox-border);background-color:var(--select-radio-active-bg);box-shadow:inset 0 0 1px 3px #fff}.ul-card-text{margin-top:2px;margin-bottom:3px;gap:8px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;display:flex;justify-content:center;margin-bottom:12px;flex:1 1 auto;flex-direction:row;border-radius:8px;gap:0;width:auto;min-width:180px;max-width:100%}@media (max-width: 768px){.ul-card-text__container{max-width:100%;width:100%;margin-bottom:8px}}.ul-card-text__container textarea{border-radius:8px;width:60vw;box-sizing:border-box}.ul-card-text__container textarea:focus{border:1px solid #0B2330}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px;background-color:var(--text-card-input-bg)}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px;background-color:var(--text-card-input-bg)}.ul-card-text__input{background-color:var(--text-card-input-bg);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:63px;overflow:auto;padding:8px;resize:none;width:100%;border-radius:3px;line-height:20px;overflow-wrap:break-word;min-width:180px;max-width:100%;border-color:var(--text-card-border)}@media (max-width: 768px){.ul-card-text__input{min-width:0;max-width:100%;width:100%;font-size:14px}}.ul-card-text__input::placeholder{color:#6c6c6e80;background-color:var(--text-card-input-bg)}.ul-card-text__input:focus{outline:none;background-color:var(--text-card-input-bg)}.ul-card-text__input--desktop:hover:not(:focus){background-color:var(--text-card-input-bg)}@media (max-width: 768px){.ul-card-text__input{font-size:16px}}.ul-card__text-url-prompt .sprig-question-body{padding:0}.ul-card__text-url-prompt .ul-card-button-group{padding:10px}.chat-card.ul-card__text-url-prompt .ul-card-button-group{align-items:flex-end;padding:0}@keyframes flashingDot{0%{background-color:#262136}50%,to{background-color:#f8f9fa}}.thinking-dots-container{display:flex;justify-content:center;align-items:flex-end;position:relative;width:18px;margin-top:.5em}.thinking-dot{position:relative;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite linear alternate;animation-delay:.5s}.thinking-dot:before,.thinking-dot:after{content:"";display:inline-block;position:absolute;top:0;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite alternate}.thinking-dot:before{left:-5px;animation-delay:0s}.thinking-dot:after{left:5px;animation-delay:1s}[id^=ul-card-video__player_recorder],[id^=ul-card-video__question_player]{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.answered-card [id^=ul-card-video__player_recorder] .ul-control-panel{display:none!important}html{--root-bg: #e8e7e6;--root-input-bg: #ffffff;--root-input-border: #e8e7e6;--root-input-border-dark: #333;--chat-close-hover-bg: rgba(255, 255, 255, .5);--chat-msg-no-response: #666;--chat-right-bg: var(--root-bg);--chat-left-bg: #F7F6F5;--chat-end-text: #999;--chat-footer: #000000;--chat-answered-overlay-bg: rgba(255, 255, 255, .3);--chat-choice-bg: unset;--consent-sprig-stretch-bg: var(--root-bg);--consent-input-bg: var(--root-bg);--text-card-input-bg: var(--root-input-bg);--text-card-border: var(--root-input-border);--select-checkbox-bg: #fff;--select-checkbox-hover-bg: var(--root-input-bg);--select-checkbox-border: var(--root-input-border-dark);--select-radio-bg: var(--root-input-bg);--select-radio-active-bg: #000;--select-radio-active-border-bg: var(--root-bg);--select-list-bg: #fff;--select-button-bg: #fff;--select-button-hover: #f2f2f2;--select-option-bg: #fff;--select-multiselect-checkbox-label-bg: var(--root-bg);--nps-number-border: var(--root-input-border);--nps-unselected: #fff;--sprig-button-disabled-bg: rgba(0, 0, 0, .1)}';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const t = '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-card-text__button{background-color:var(--theme);border-radius:8px;padding:11px 16px;gap:5px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:var(--sprig-button-disabled-bg);color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:transparent;color:#5d696f}.ul-card-skip__button{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}.sprig-question-footer-container{padding:0;align-items:center}.ul-card__button-checkmark{display:flex;align-items:center;font-size:15px;gap:5px;padding:11px 16px;border-radius:8px;background-color:var(--theme);color:#fff}.ul-card__button-checkmark:disabled{background-color:var(--theme);opacity:.5;color:#fff}.ul-card__button-checkmark:disabled>svg path{stroke:#fff}.ul-conversational-ui{width:100%;height:100%;display:flex;flex-direction:column;min-height:500px;font-size:15px;position:relative}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:right;align-self:stretch}.conversational-close-btn{position:fixed;top:20px;right:16px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:pointer;z-index:1000}.conversational-close-btn:hover{background:var(--chat-close-hover-bg)}.chat-container{flex:1;display:flex;flex-direction:column;align-items:center}.chat-messages{flex:1;display:flex;flex-direction:column;max-width:600px;width:100%;padding:36px 16px 44px;gap:8px;box-sizing:border-box}.chat-message-no-response{font-style:italic;color:var(--chat-msg-no-response)}.chat-card .choice{margin-bottom:0;background-color:var(--chat-choice-bg);padding:0;line-height:2;border:none;min-height:28px}.chat-card .choice.ul-select-active-dynamic-style{border:none}.chat-bubble-container{display:flex;flex-direction:row;align-items:flex-start;width:100%;animation:fadeInUp .3s ease-out}.chat-bubble-container .chat-avatar{display:none}.chat-left{align-self:flex-start;width:auto;justify-content:flex-start}.chat-container .chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:0}.chat-right{align-self:flex-end;width:100%;justify-content:flex-end;margin-top:8px}.sprig-question-body{word-wrap:break-word;position:relative;border-radius:8px;box-sizing:border-box;max-width:448px;gap:8px;padding:0;overflow:unset}.chat-bubble-text-only{width:auto;max-width:286px}.chat-bubble.chat-bubble-right .chat-message-text{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-bubble-left{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-left-bg)}.chat-bubble.chat-bubble-right:has(.answered-card) .sprig-question-body{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-bubble.chat-bubble-right:not(:has(.chat-bubble-text-only)) .sprig-question-body{border-radius:8px;word-wrap:break-word;position:relative;padding:16px;color:var(--text-color);background:var(--chat-right-bg)}.chat-message-text{line-height:1.4;margin:0;text-align:left;color:var(--text-color);font-size:14px;font-weight:400;word-wrap:break-word}.chat-persona-label{margin-top:-4px;text-align:left;color:var(--chat-end-text);font-size:14px;font-weight:400;line-height:140%}.chat-card-container{padding:0;background:transparent}@media (max-width: 600px){.conversational-ui .long-form-question-footer-container-logo{position:unset}}.chat-card-container .chat-card{display:flex;flex-direction:column;gap:8px}.chat-thanks-card{background:transparent;box-shadow:none;text-align:center}.end-of-survey-text{text-align:center;color:var(--chat-end-text);font-size:14px;margin-top:8px;font-weight:400}.answered-card{pointer-events:none;opacity:.7;position:relative}.footer{width:100%;margin-top:12px;font-size:12px;font-weight:400;line-height:12px;color:var(--chat-footer)}.answered-card:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:var(--chat-answered-overlay-bg);pointer-events:none;border-radius:inherit}.answered-card button,.answered-card input,.answered-card textarea,.answered-card select{pointer-events:none}.answered-card:not(.ul-card__consent-legal):not(.ul-card__text-url-prompt) .ul-card-button-group *{display:none}.sprig-question-footer-container{padding:0;align-items:end}.chat-card.ul-card--video .sprig-question-footer-container{flex-direction:row;justify-content:flex-end;align-items:center}.ul-card-text__button{font-size:13px}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:42px}.ul-card-vertical__button-wrapper{align-items:end}.ul-card-skip__button{padding:0 16px}.sprig-stretch{padding:16px;display:flex;flex-direction:column;gap:8px;border-radius:8px;background:var(--consent-sprig-stretch-bg)}.sprig-stretch input{background-color:var(--consent-input-bg)}.ul-card--likert__numbers{background-color:#fff;display:flex;width:100%;box-sizing:border-box;flex-wrap:nowrap;justify-content:space-between;align-items:center}.ul-card--likert__numbers:has(.likert-star,.likert-smiley){background-color:transparent;justify-content:space-between;gap:2px}.likert-smiley>svg{scale:1.176}.ul-card--likert__numbers .likert-star,.ul-card--likert__numbers .likert-smiley{min-width:24px;min-height:57px;max-width:38px;max-height:38px;flex:0 1 auto;transition:height .2s,width .2s}.ul-card--likert__labels{font-weight:400;color:var(--text-color);text-align:center;word-break:break-word;font-size:.95rem}.likert-number,.likert-smiley,.likert-star{aspect-ratio:1 / 1;min-height:57px;max-height:57px;box-sizing:border-box;flex:1 1 auto;display:flex;align-items:center;justify-content:center;transition:height .2s,width .2s,font-size .2s}.ul-card--likert__numbers:has(>:nth-child(6))>.likert-number,.ul-card--likert__numbers:has(>:nth-child(6))>.likert-smiley,.ul-card--likert__numbers:has(>:nth-child(6))>.likert-star{aspect-ratio:unset;min-height:57px;min-width:42px}.ul-card--likert__numbers:has(>:nth-child(8))>.likert-number,.ul-card--likert__numbers:has(>:nth-child(8))>.likert-smiley,.ul-card--likert__numbers:has(>:nth-child(8))>.likert-star{aspect-ratio:unset;min-height:57px;min-width:32px}.sprig-question-body:has(.likert-number,.likert-smiley,.likert-star){max-width:100%;padding:0 .5rem;display:flex;flex-direction:column}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:700px}@media (min-width: 1200px){.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:900px}}@media (max-width: 768px){.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:100%;width:100%;padding:0 4px}}.chat-card-container .ul-card--matrix_container{max-width:100%;overflow-x:auto}.chat-card-container .ul-card--matrix_grid{min-width:100%}.chat-card-container .ul-card__matrix{width:100%}.chat-card-container .choice-label-container{gap:8px}@media (max-width: 768px){.sprig-header-label-container,.sprig-header-label,.choice{font-size:14px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:280px;max-width:100%;width:100%}.chat-card-container .ul-card--matrix_container{overflow-x:auto;-webkit-overflow-scrolling:touch}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-conversational-ui .chat-card-container .chat-card.ul-card--nps{width:100%;min-width:262px;max-width:500px;box-sizing:border-box}.ul-conversational-ui .ul-card--nps__numbers{background-color:#fff}.ul-conversational-ui .nps-number{color:var(--text-color);border:2px solid var(--nps-number-border)}@media (max-width: 768px){.ul-conversational-ui .nps-number{font-size:16px;height:35px}.ul-conversational-ui .ul-card--nps__labels{font-size:12px;font-weight:400;color:var(--text-color)}}@media (min-width: 769px){.ul-conversational-ui .nps-number{font-size:20px;height:40px}.ul-conversational-ui .ul-card--nps__labels{font-size:14px;font-weight:400;color:#2f2e2c}}.ul-card-rank__option{text-align:left;background:#0000000d;margin-bottom:8px}.ul-card-rank__option.is-dragging{background-color:#0000000d;border:none}.ul-card-rank__labels{font-weight:400;color:var(--text-color)}@media (min-width: 1200px){.ul-card--rank__question-inner-container{max-width:900px}}@media (max-width: 768px){.ul-card--rank__question-inner-container{min-width:0;max-width:100%;width:100%;font-size:14px}.ul-card-rank__labels{font-size:14px}.ul-card-rank__option>span{font-size:14px}.ul-card-rank__option>select{font-size:14px}}.select-button{align-items:center;background-color:var(--select-button-bg);border-radius:8px;border:1px solid #E8E7E6;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:var(--select-button-hover)}.select-button:active{background-color:var(--select-button-bg)}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:var(--select-list-bg);border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:8px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:var(--select-checkbox-hover-bg)}.chat-card .select-checkbox{border:1px solid var(--select-checkbox-border);background-color:var(--select-checkbox-bg)}.chat-card .select-radio{box-shadow:unset;border:1px solid var(--select-checkbox-border);background-color:var(--select-radio-bg)}.chat-card .select-radio.ul-select-active-dynamic-style{border:1px solid var(--select-checkbox-border);background-color:var(--select-radio-active-bg);box-shadow:inset 0 0 1px 3px #fff}.ul-card-text{margin-top:2px;margin-bottom:3px;gap:8px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;display:flex;justify-content:center;margin-bottom:12px;flex:1 1 auto;flex-direction:row;border-radius:8px;gap:0;width:auto;min-width:180px;max-width:100%}@media (max-width: 768px){.ul-card-text__container{max-width:100%;width:100%;margin-bottom:8px}}.ul-card-text__container textarea{border-radius:8px;width:60vw;box-sizing:border-box}.ul-card-text__container textarea:focus{border:1px solid #0B2330}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px;background-color:var(--text-card-input-bg)}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px;background-color:var(--text-card-input-bg)}.ul-card-text__input{background-color:var(--text-card-input-bg);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:63px;overflow:auto;padding:8px;resize:none;width:100%;border-radius:3px;line-height:20px;overflow-wrap:break-word;min-width:180px;max-width:100%;border-color:var(--text-card-border)}@media (max-width: 768px){.ul-card-text__input{min-width:0;max-width:100%;width:100%;font-size:14px}}.ul-card-text__input::placeholder{color:#6c6c6e80;background-color:var(--text-card-input-bg)}.ul-card-text__input:focus{outline:none;background-color:var(--text-card-input-bg)}.ul-card-text__input--desktop:hover:not(:focus){background-color:var(--text-card-input-bg)}@media (max-width: 768px){.ul-card-text__input{font-size:16px}}.ul-card__text-url-prompt .sprig-question-body{padding:0}.ul-card__text-url-prompt .ul-card-button-group{padding:10px}.chat-card.ul-card__text-url-prompt .ul-card-button-group{align-items:flex-end;padding:0}@keyframes flashingDot{0%{background-color:#262136}50%,to{background-color:#f8f9fa}}.thinking-dots-container{display:flex;justify-content:center;align-items:flex-end;position:relative;width:18px;margin-top:.5em}.thinking-dot{position:relative;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite linear alternate;animation-delay:.5s}.thinking-dot:before,.thinking-dot:after{content:"";display:inline-block;position:absolute;top:0;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite alternate}.thinking-dot:before{left:-5px;animation-delay:0s}.thinking-dot:after{left:5px;animation-delay:1s}[id^=ul-card-video__player_recorder],[id^=ul-card-video__question_player]{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.answered-card [id^=ul-card-video__player_recorder] .ul-control-panel{display:none!important}html{--root-bg: #e8e7e6;--root-input-bg: #ffffff;--root-input-border: #e8e7e6;--root-input-border-dark: #333;--chat-close-hover-bg: rgba(255, 255, 255, .5);--chat-msg-no-response: #666;--chat-right-bg: var(--root-bg);--chat-left-bg: #F7F6F5;--chat-end-text: #999;--chat-footer: #000000;--chat-answered-overlay-bg: rgba(255, 255, 255, .3);--chat-choice-bg: unset;--consent-sprig-stretch-bg: var(--root-bg);--consent-input-bg: var(--root-bg);--text-card-input-bg: var(--root-input-bg);--text-card-border: var(--root-input-border);--select-checkbox-bg: #fff;--select-checkbox-hover-bg: var(--root-input-bg);--select-checkbox-border: var(--root-input-border-dark);--select-radio-bg: var(--root-input-bg);--select-radio-active-bg: #000;--select-radio-active-border-bg: var(--root-bg);--select-list-bg: #fff;--select-button-bg: #fff;--select-button-hover: #f2f2f2;--select-option-bg: #fff;--select-multiselect-checkbox-label-bg: var(--root-bg);--nps-number-border: var(--root-input-border);--nps-unselected: #fff;--sprig-button-disabled-bg: rgba(0, 0, 0, .1)}';
|
|
2
|
+
export {
|
|
3
|
+
t as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { a as i, c as x, u as C, F as Z, h as U, p as I, _ as E, d as H, C as G, b as P, E as _, G as Q } from "./view-eRBVyC0l.js";
|
|
2
|
+
import { k as J, i as X, l as Y, m as ee, E as M } from "./index-BNI3IK7K.js";
|
|
3
|
+
const te = (e) => i("button", { ...e, className: x("ul-card-text__button", e.className), id: "ul-card-text__button" }), oe = ({ image: e, isConversationalUi: o = !1 }) => i("img", { alt: e.altText ?? "", className: x("sprig-question-image", o ? "sprig-conversation-ui-image" : null), height: e.height, sizes: "auto", src: e.src, srcSet: e.srcSet, width: e.width }), se = ({ html: e, ...o }) => {
|
|
4
|
+
const { enableCspTrustedTypes: n } = C((s) => ({ enableCspTrustedTypes: s.enableCspTrustedTypes })), t = Z(() => J(e, n), [n, e]);
|
|
5
|
+
return i("div", { ...o, dangerouslySetInnerHTML: { __html: t } });
|
|
6
|
+
}, V = () => {
|
|
7
|
+
const { viewDocument: e } = C((t) => ({ viewDocument: t.viewDocument })), [o, n] = U(!1);
|
|
8
|
+
return I(() => {
|
|
9
|
+
const t = e.querySelector(".sprig-question-body"), s = new ResizeObserver(() => {
|
|
10
|
+
window.requestAnimationFrame(() => {
|
|
11
|
+
n(!!(t && X(t) && t.scrollHeight > t.offsetHeight));
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
return t && s.observe(t), () => {
|
|
15
|
+
t && s.disconnect();
|
|
16
|
+
};
|
|
17
|
+
}, [e]), o;
|
|
18
|
+
}, A = ({ plainText: e, richText: o, id: n, className: t, isHeader: s, showAsterisk: r }) => o ? i(se, { className: t, html: o, id: n }) : e ? s ? i("h1", { className: t, id: n, children: [e, r && "*"] }) : i("p", { className: t, id: n, children: e }) : null, he = ({ message: e, properties: o, isRequired: n }) => {
|
|
19
|
+
const t = E(null), s = o == null ? void 0 : o.captionText, r = V();
|
|
20
|
+
return i("div", { className: x("question-header-container", "sprig-header-container", r ? "sprig-border-bottom" : null), ref: t, children: [(o == null ? void 0 : o.image) && i(oe, { image: o.image }), i("div", { className: "question-header-button-container", children: i(A, { className: "ul-question", id: "ul-question", isHeader: !0, plainText: e, richText: o == null ? void 0 : o.questionHtml, showAsterisk: n }) }), i(A, { className: "ul-caption", id: "ul-caption", plainText: s, richText: o == null ? void 0 : o.captionHtml })] });
|
|
21
|
+
}, ie = () => i("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: i("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#FFFFFF", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), pe = ({ isSubmitDisabled: e, handleSubmit: o }) => i("div", { className: "ul-card-longform__submit-button-container", children: i(te, { className: "ul-card-longform__submit-button", disabled: e, onClick: o, children: ["OK ", i(ie, {})] }) }), me = (e, o) => {
|
|
22
|
+
const n = E(0);
|
|
23
|
+
return () => {
|
|
24
|
+
if (e.current) {
|
|
25
|
+
const t = e.current;
|
|
26
|
+
t.style.height = "1px";
|
|
27
|
+
const s = t.scrollHeight + (t.offsetHeight - t.clientHeight), r = parseInt(window.getComputedStyle(t).getPropertyValue("max-height")), l = s <= r ? s : r;
|
|
28
|
+
n.current !== l && requestAnimationFrame(() => {
|
|
29
|
+
o();
|
|
30
|
+
}), n.current = l, t.style.height = `${l}px`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, be = (e) => {
|
|
34
|
+
const o = E(), { setAllResponsesRaw: n } = C((t) => ({ setAllResponsesRaw: t.setAllResponsesRaw }));
|
|
35
|
+
I(() => {
|
|
36
|
+
const t = o.current;
|
|
37
|
+
(!t || Object.keys(e).length !== Object.keys(t).length || Object.keys(e).some((s) => e[s] !== t[s])) && (n(e), o.current = e);
|
|
38
|
+
}, [e, n]);
|
|
39
|
+
}, F = ({ buttonText: e = "View Prototype", handleClick: o }) => i("button", { className: "prototype-button", onClick: o, children: e }, "prototype-btn"), ve = ({ embeddedType: e = "prototype", properties: o, children: n }) => {
|
|
40
|
+
var y;
|
|
41
|
+
const { handleClickEmbedButton: t, hasViewedEmbed: s, headers: r, useDesktopPrototype: l } = C((u) => ({ handleClickEmbedButton: u.handleClickEmbedButton, hasViewedEmbed: u.hasViewedEmbed, headers: u.headers, useDesktopPrototype: u.useDesktopPrototype })), p = (o == null ? void 0 : o.conceptUrl) || ((y = o == null ? void 0 : o.consentDocument) == null ? void 0 : y.url), a = window.innerWidth < ee, h = r["userleap-platform"], d = (u, f) => {
|
|
42
|
+
u.preventDefault(), t(f);
|
|
43
|
+
};
|
|
44
|
+
if ((() => {
|
|
45
|
+
const { update: u, index: f, isConversationalUI: v, viewDocument: T } = C(({ update: b, index: m, isConversationalUI: g, viewDocument: k }) => ({ update: b, index: m, isConversationalUI: g, viewDocument: k })), c = Y(u, 100);
|
|
46
|
+
I(() => {
|
|
47
|
+
if (v) return;
|
|
48
|
+
const b = new ResizeObserver(c), m = T.querySelector(".ul-card__container");
|
|
49
|
+
return m && b.observe(m, { box: "border-box" }), () => {
|
|
50
|
+
b.disconnect();
|
|
51
|
+
};
|
|
52
|
+
}, [c, u, f, v, T]);
|
|
53
|
+
})(), !l && a && !s && p && ["email", "link"].includes(h)) {
|
|
54
|
+
if (e === "prototype") return i(F, { handleClick: (u) => {
|
|
55
|
+
d(u, "question.prototype.click");
|
|
56
|
+
} });
|
|
57
|
+
if (e === "pdf") return i(F, { buttonText: (o == null ? void 0 : o.viewDocumentText) || "View Document", handleClick: (u) => {
|
|
58
|
+
d(u, "question.agreement.click");
|
|
59
|
+
} });
|
|
60
|
+
}
|
|
61
|
+
return i(H, { children: n });
|
|
62
|
+
}, j = ({ isSelected: e, id: o, divId: n, themeColor: t, disabled: s = !1 }) => i("div", { "aria-checked": e, "aria-disabled": s, "aria-labelledby": `label-${o}`, className: "select-checkbox", id: n, role: "checkbox", style: { ...e ? { backgroundColor: t, borderColor: t, boxShadow: "none" } : {}, ...s ? { opacity: 0.5 } : {} }, tabIndex: s ? -1 : 0, children: e && i(G, {}) }), ge = ({ ariaLabel: e, border: o, choiceStyle: n = {}, label: t, isSelected: s, value: r, text: l, id: p, isRadio: a, useMobileStyling: h, error: d, allowTextEntry: y, noneOfTheAbove: u, promptText: f, disabled: v = !1, onUserInputChanged: T }) => {
|
|
63
|
+
const { styleNonce: c, viewDocument: b } = C((w) => ({ styleNonce: w.styleNonce, viewDocument: w.viewDocument })), [m, g] = U(!1);
|
|
64
|
+
re(b, o, c);
|
|
65
|
+
const k = ({ isSelected: w, userText: S }) => {
|
|
66
|
+
T && T({ id: p, selected: w, value: r, userText: S, noneOfTheAbove: u });
|
|
67
|
+
}, D = (w) => {
|
|
68
|
+
v || (w.stopPropagation(), k({ isSelected: a || !s, userText: l }), g(!1));
|
|
69
|
+
}, z = () => {
|
|
70
|
+
m || g(!0);
|
|
71
|
+
}, $ = () => {
|
|
72
|
+
m && g(!1);
|
|
73
|
+
}, N = { onClick: (w) => D(w), onKeyPress: (w) => ((S) => {
|
|
74
|
+
v || S.key !== "Enter" && S.key !== " " || D(S);
|
|
75
|
+
})(w) };
|
|
76
|
+
"ontouchstart" in b.documentElement ? (N.onTouchStart = $, N.onTouchCancel = $, N.onTouchEnd = $) : (N.onMouseDown = z, N.onMouseLeave = $);
|
|
77
|
+
const O = a ? `radio-${p}` : `checkbox-${p}`, q = s || m ? [L] : [], K = [...d ? [B] : [], ...q, ...v ? ["ul-choice-disabled"] : []], W = t ? { "aria-labelledby": `label-${p}` } : { "aria-label": e };
|
|
78
|
+
return i("div", { className: x(P("choice", h), ...K), id: `choice-div-${p}`, style: { ...n, ...d ? { borderColor: M } : {}, ...v ? { opacity: 0.5, cursor: "not-allowed" } : {} }, ...v ? {} : N, "aria-disabled": v, children: [i("div", { className: x("choice-label-container"), children: [a ? i("div", { ...W, className: x("select-radio", ...q), id: O, role: "radio", tabIndex: 0 }) : i(j, { disabled: v, divId: O, id: p, isSelected: s, themeColor: o }), t && i("label", { className: x(P("select-label", h)), htmlFor: O, id: `label-${p}`, children: t })] }), y && s && i("div", { className: x("choice-text-entry-container", ...q), children: i(ne, { onTextChange: (w) => k({ isSelected: s, userText: w }), promptText: f || "Please specify", textValue: l, useMobileStyling: h }) })] });
|
|
79
|
+
}, ne = ({ promptText: e, textValue: o, onTextChange: n, useMobileStyling: t }) => {
|
|
80
|
+
const s = E(null);
|
|
81
|
+
return I(() => {
|
|
82
|
+
s.current && s.current.focus();
|
|
83
|
+
}, []), i("textarea", { "aria-label": e, "aria-multiline": "true", "aria-placeholder": e, className: x(P("choice-text-input", t)), "data-gramm": "false", maxLength: 5e3, name: "text", onChange: (r) => {
|
|
84
|
+
r.stopPropagation(), n(r.currentTarget.value);
|
|
85
|
+
}, onClick: (r) => {
|
|
86
|
+
r.stopPropagation();
|
|
87
|
+
}, onKeyPress: (r) => {
|
|
88
|
+
r.stopPropagation();
|
|
89
|
+
}, placeholder: e, ref: s, role: "textbox", rows: 1, value: o });
|
|
90
|
+
}, R = "ul-select-style-element", L = "ul-select-active-dynamic-style", B = "ul-select-error-dynamic-style", re = (e, o, n) => {
|
|
91
|
+
let t = e.getElementById(R), s = !1;
|
|
92
|
+
t || (t = e.createElement("style"), s = !0), t.tagName.toLowerCase() === "style" && (t.id = R, n && (t.nonce = n), t.textContent = ae(o), s && e.head.appendChild(t));
|
|
93
|
+
}, ae = (e) => `
|
|
94
|
+
.${L} {
|
|
95
|
+
border-color: ${e};
|
|
96
|
+
}
|
|
97
|
+
.${L} .select-radio, .${L}.select-radio {
|
|
98
|
+
border: 6px solid ${e};
|
|
99
|
+
box-shadow: none;
|
|
100
|
+
}
|
|
101
|
+
.${B} {
|
|
102
|
+
border-color: ${M};
|
|
103
|
+
}
|
|
104
|
+
`, we = ({ children: e }) => i("div", { className: "sprig-question-body", children: e }), xe = ({ children: e }) => {
|
|
105
|
+
const o = V(), { isConversationalUI: n } = C((t) => ({ isConversationalUI: t.isConversationalUI }));
|
|
106
|
+
return i("div", { className: x("sprig-question-footer-container", o && !n ? "sprig-border-top" : null), children: e });
|
|
107
|
+
}, le = ({ options: e, selectItem: o, selectedOptions: n, showCheckbox: t, disabledOptions: s, dropdownFooter: r, panelRef: l }) => {
|
|
108
|
+
const { themeColor: p } = C((a) => ({ doc: a.viewDocument, themeColor: a.border }));
|
|
109
|
+
return i("div", { className: "select-list", ref: l, children: [e.map((a) => {
|
|
110
|
+
return i("div", { "aria-disabled": s == null ? void 0 : s.includes(a), className: x("select-option", s != null && s.includes(a) ? "ul-choice-disabled" : ""), onClick: (d) => {
|
|
111
|
+
s != null && s.includes(a) || (o(a), d.stopPropagation());
|
|
112
|
+
}, role: "option", style: { ...s != null && s.includes(a) ? { opacity: 0.5, cursor: "not-allowed" } : {} }, children: [t && i(j, { divId: (h = a.id, `checkbox-div-${h}`), id: a.id, isSelected: n.includes(a), themeColor: p }), a.label] }, a.id);
|
|
113
|
+
var h;
|
|
114
|
+
}), r] });
|
|
115
|
+
}, ye = ({ isMultiSelect: e = !1, multiselectText: o = "choices selected", onChange: n, options: t, placeholderText: s, value: r, disabledOptions: l = [], dropdownFooter: p }) => {
|
|
116
|
+
const [a, h] = U(!1), d = E(null), { viewDocument: y, update: u, isConversationalUI: f } = C((c) => ({ viewDocument: c.viewDocument, update: c.update, isConversationalUI: c.isConversationalUI })), v = () => {
|
|
117
|
+
h(!a);
|
|
118
|
+
};
|
|
119
|
+
_(() => {
|
|
120
|
+
f || u();
|
|
121
|
+
}, [a, f, u]), _(() => {
|
|
122
|
+
a && d.current && d.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
123
|
+
}, [a]), I(() => {
|
|
124
|
+
var b;
|
|
125
|
+
const c = (m) => {
|
|
126
|
+
const g = m.target;
|
|
127
|
+
(g == null ? void 0 : g.closest(".select-option.ul-choice-disabled")) || h(!1);
|
|
128
|
+
};
|
|
129
|
+
y.addEventListener("click", c);
|
|
130
|
+
try {
|
|
131
|
+
(b = window.parent) == null || b.addEventListener("click", c);
|
|
132
|
+
} catch {
|
|
133
|
+
window.addEventListener("click", c);
|
|
134
|
+
}
|
|
135
|
+
return () => {
|
|
136
|
+
var m;
|
|
137
|
+
y.removeEventListener("click", c);
|
|
138
|
+
try {
|
|
139
|
+
(m = window.parent) == null || m.removeEventListener("click", c);
|
|
140
|
+
} catch {
|
|
141
|
+
window.removeEventListener("click", c);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}, [y]);
|
|
145
|
+
const T = r.length === 0 ? ["select-button-placeholder"] : [];
|
|
146
|
+
return i(H, { children: [i("button", { "aria-label": "choice dropdown button", className: x("select-button", ...T), onClick: (c) => {
|
|
147
|
+
c.stopPropagation(), v();
|
|
148
|
+
}, type: "button", children: [i("span", { children: r.length === 0 ? s : r.length === 1 ? r[0].label : `${r.length} ${o}` }), i(Q, {})] }), a && i(le, { disabledOptions: l, dropdownFooter: p, options: t, panelRef: d, selectedOptions: r, selectItem: (c) => {
|
|
149
|
+
var g;
|
|
150
|
+
const b = r.some((k) => k.id === c.id), m = r.some((k) => {
|
|
151
|
+
var D;
|
|
152
|
+
return (D = k.optionProperties) == null ? void 0 : D.noneOfTheAbove;
|
|
153
|
+
});
|
|
154
|
+
(g = c.optionProperties) != null && g.noneOfTheAbove && !b ? n([c]) : e ? n(b ? r.filter((k) => k.id !== c.id) : m ? [c] : [...r, c]) : b || n([c]), e || v();
|
|
155
|
+
}, showCheckbox: e })] });
|
|
156
|
+
}, ce = { "{{user_id}}": "externalUserId", "{{email}}": "email" }, ke = (e = void 0, o = {}) => {
|
|
157
|
+
if (!e) return e;
|
|
158
|
+
const n = ["http:", "https:", "itms-apps:", "market:"], t = ((l) => /^[a-zA-Z][a-zA-Z0-9+\-.]*:\/\//.test(l) ? l : `http://${l}`)(e);
|
|
159
|
+
if (!t) return;
|
|
160
|
+
try {
|
|
161
|
+
const l = new URL(t);
|
|
162
|
+
if (!l.protocol || !n.includes(l.protocol)) return;
|
|
163
|
+
} catch {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const s = [], r = ((l, p, a) => {
|
|
167
|
+
let h = l;
|
|
168
|
+
for (const [d, y] of Object.entries(ce)) if (h.toLowerCase().includes(d)) if (p[y]) {
|
|
169
|
+
const u = new RegExp(d, "gi");
|
|
170
|
+
h = h.replace(u, p[y]);
|
|
171
|
+
} else a.push(d);
|
|
172
|
+
return h;
|
|
173
|
+
})(t, o, s);
|
|
174
|
+
return s.length === 0 ? r : ((l, p) => {
|
|
175
|
+
if (!l.includes("?")) return l;
|
|
176
|
+
const a = l.slice(0, l.indexOf("?")), h = l.slice(l.indexOf("?") + 1).split("&").map((d) => d.split("=")).filter((d) => !p.includes(d[1]));
|
|
177
|
+
return h.length === 0 ? a : `${a}?${h.map((d) => d.join("=")).join("&")}`;
|
|
178
|
+
})(r, s);
|
|
179
|
+
};
|
|
180
|
+
export {
|
|
181
|
+
te as B,
|
|
182
|
+
oe as D,
|
|
183
|
+
he as H,
|
|
184
|
+
pe as L,
|
|
185
|
+
ve as M,
|
|
186
|
+
ge as O,
|
|
187
|
+
we as Q,
|
|
188
|
+
ye as S,
|
|
189
|
+
se as a,
|
|
190
|
+
xe as b,
|
|
191
|
+
be as c,
|
|
192
|
+
ke as g,
|
|
193
|
+
me as u
|
|
194
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";const e=require("./view-B4aVfDPi.cjs"),T=require("./index-BBiYWZkL.cjs"),I=t=>e.u("button",{...t,className:e.cc("ul-card-text__button",t.className),id:"ul-card-text__button"}),_=({image:t,isConversationalUi:n=!1})=>e.u("img",{alt:t.altText??"",className:e.cc("sprig-question-image",n?"sprig-conversation-ui-image":null),height:t.height,sizes:"auto",src:t.src,srcSet:t.srcSet,width:t.width}),P=({html:t,...n})=>{const{enableCspTrustedTypes:s}=e.useConfig(i=>({enableCspTrustedTypes:i.enableCspTrustedTypes})),o=e.F(()=>T.getHtml(t,s),[s,t]);return e.u("div",{...n,dangerouslySetInnerHTML:{__html:o}})},L=()=>{const{viewDocument:t}=e.useConfig(o=>({viewDocument:o.viewDocument})),[n,s]=e.h(!1);return e.p(()=>{const o=t.querySelector(".sprig-question-body"),i=new ResizeObserver(()=>{window.requestAnimationFrame(()=>{s(!!(o&&T.isHTMLElement(o)&&o.scrollHeight>o.offsetHeight))})});return o&&i.observe(o),()=>{o&&i.disconnect()}},[t]),n},$=({plainText:t,richText:n,id:s,className:o,isHeader:i,showAsterisk:l})=>n?e.u(P,{className:o,html:n,id:s}):t?i?e.u("h1",{className:o,id:s,children:[t,l&&"*"]}):e.u("p",{className:o,id:s,children:t}):null,V=()=>e.u("svg",{fill:"none",height:"10",viewBox:"0 0 13 10",width:"13",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M11.5 1.5L4.5 8.5L1 5",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),q=({buttonText:t="View Prototype",handleClick:n})=>e.u("button",{className:"prototype-button",onClick:n,children:t},"prototype-btn"),H=({isSelected:t,id:n,divId:s,themeColor:o,disabled:i=!1})=>e.u("div",{"aria-checked":t,"aria-disabled":i,"aria-labelledby":`label-${n}`,className:"select-checkbox",id:s,role:"checkbox",style:{...t?{backgroundColor:o,borderColor:o,boxShadow:"none"}:{},...i?{opacity:.5}:{}},tabIndex:i?-1:0,children:t&&e.u(e.SvgCheckmark,{})}),j=({promptText:t,textValue:n,onTextChange:s,useMobileStyling:o})=>{const i=e._(null);return e.p(()=>{i.current&&i.current.focus()},[]),e.u("textarea",{"aria-label":t,"aria-multiline":"true","aria-placeholder":t,className:e.cc(e.getClasses("choice-text-input",o)),"data-gramm":"false",maxLength:5e3,name:"text",onChange:l=>{l.stopPropagation(),s(l.currentTarget.value)},onClick:l=>{l.stopPropagation()},onKeyPress:l=>{l.stopPropagation()},placeholder:t,ref:i,role:"textbox",rows:1,value:n})},A="ul-select-style-element",R="ul-select-active-dynamic-style",U="ul-select-error-dynamic-style",z=(t,n,s)=>{let o=t.getElementById(A),i=!1;o||(o=t.createElement("style"),i=!0),o.tagName.toLowerCase()==="style"&&(o.id=A,s&&(o.nonce=s),o.textContent=W(n),i&&t.head.appendChild(o))},W=t=>`
|
|
2
|
+
.${R} {
|
|
3
|
+
border-color: ${t};
|
|
4
|
+
}
|
|
5
|
+
.${R} .select-radio, .${R}.select-radio {
|
|
6
|
+
border: 6px solid ${t};
|
|
7
|
+
box-shadow: none;
|
|
8
|
+
}
|
|
9
|
+
.${U} {
|
|
10
|
+
border-color: ${T.ERROR_BORDER_COLOR};
|
|
11
|
+
}
|
|
12
|
+
`,K=({options:t,selectItem:n,selectedOptions:s,showCheckbox:o,disabledOptions:i,dropdownFooter:l,panelRef:c})=>{const{themeColor:h}=e.useConfig(r=>({doc:r.viewDocument,themeColor:r.border}));return e.u("div",{className:"select-list",ref:c,children:[t.map(r=>{return e.u("div",{"aria-disabled":i==null?void 0:i.includes(r),className:e.cc("select-option",i!=null&&i.includes(r)?"ul-choice-disabled":""),onClick:d=>{i!=null&&i.includes(r)||(n(r),d.stopPropagation())},role:"option",style:{...i!=null&&i.includes(r)?{opacity:.5,cursor:"not-allowed"}:{}},children:[o&&e.u(H,{divId:(p=r.id,`checkbox-div-${p}`),id:r.id,isSelected:s.includes(r),themeColor:h}),r.label]},r.id);var p}),l]})},Q={"{{user_id}}":"externalUserId","{{email}}":"email"};exports.Button=I,exports.DisplayQuestionImage=_,exports.Header=({message:t,properties:n,isRequired:s})=>{const o=e._(null),i=n==null?void 0:n.captionText,l=L();return e.u("div",{className:e.cc("question-header-container","sprig-header-container",l?"sprig-border-bottom":null),ref:o,children:[(n==null?void 0:n.image)&&e.u(_,{image:n.image}),e.u("div",{className:"question-header-button-container",children:e.u($,{className:"ul-question",id:"ul-question",isHeader:!0,plainText:t,richText:n==null?void 0:n.questionHtml,showAsterisk:s})}),e.u($,{className:"ul-caption",id:"ul-caption",plainText:i,richText:n==null?void 0:n.captionHtml})]})},exports.Html=P,exports.LongformSubmitButton=({isSubmitDisabled:t,handleSubmit:n})=>e.u("div",{className:"ul-card-longform__submit-button-container",children:e.u(I,{className:"ul-card-longform__submit-button",disabled:t,onClick:n,children:["OK ",e.u(V,{})]})}),exports.MobileEmbedView=({embeddedType:t="prototype",properties:n,children:s})=>{var y;const{handleClickEmbedButton:o,hasViewedEmbed:i,headers:l,useDesktopPrototype:c}=e.useConfig(u=>({handleClickEmbedButton:u.handleClickEmbedButton,hasViewedEmbed:u.hasViewedEmbed,headers:u.headers,useDesktopPrototype:u.useDesktopPrototype})),h=(n==null?void 0:n.conceptUrl)||((y=n==null?void 0:n.consentDocument)==null?void 0:y.url),r=window.innerWidth<T.EMBED_MOBILE_MAX_WIDTH,p=l["userleap-platform"],d=(u,C)=>{u.preventDefault(),o(C)};if((()=>{const{update:u,index:C,isConversationalUI:g,viewDocument:f}=e.useConfig(({update:b,index:m,isConversationalUI:v,viewDocument:x})=>({update:b,index:m,isConversationalUI:v,viewDocument:x})),a=T.debounce(u,100);e.p(()=>{if(g)return;const b=new ResizeObserver(a),m=f.querySelector(".ul-card__container");return m&&b.observe(m,{box:"border-box"}),()=>{b.disconnect()}},[a,u,C,g,f])})(),!c&&r&&!i&&h&&["email","link"].includes(p)){if(t==="prototype")return e.u(q,{handleClick:u=>{d(u,"question.prototype.click")}});if(t==="pdf")return e.u(q,{buttonText:(n==null?void 0:n.viewDocumentText)||"View Document",handleClick:u=>{d(u,"question.agreement.click")}})}return e.u(e.g,{children:s})},exports.Option=({ariaLabel:t,border:n,choiceStyle:s={},label:o,isSelected:i,value:l,text:c,id:h,isRadio:r,useMobileStyling:p,error:d,allowTextEntry:y,noneOfTheAbove:u,promptText:C,disabled:g=!1,onUserInputChanged:f})=>{const{styleNonce:a,viewDocument:b}=e.useConfig(w=>({styleNonce:w.styleNonce,viewDocument:w.viewDocument})),[m,v]=e.h(!1);z(b,n,a);const x=({isSelected:w,userText:E})=>{f&&f({id:h,selected:w,value:l,userText:E,noneOfTheAbove:u})},N=w=>{g||(w.stopPropagation(),x({isSelected:r||!i,userText:c}),v(!1))},F=()=>{m||v(!0)},O=()=>{m&&v(!1)},k={onClick:w=>N(w),onKeyPress:w=>(E=>{g||E.key!=="Enter"&&E.key!==" "||N(E)})(w)};"ontouchstart"in b.documentElement?(k.onTouchStart=O,k.onTouchCancel=O,k.onTouchEnd=O):(k.onMouseDown=F,k.onMouseLeave=O);const S=r?`radio-${h}`:`checkbox-${h}`,D=i||m?[R]:[],B=[...d?[U]:[],...D,...g?["ul-choice-disabled"]:[]],M=o?{"aria-labelledby":`label-${h}`}:{"aria-label":t};return e.u("div",{className:e.cc(e.getClasses("choice",p),...B),id:`choice-div-${h}`,style:{...s,...d?{borderColor:T.ERROR_BORDER_COLOR}:{},...g?{opacity:.5,cursor:"not-allowed"}:{}},...g?{}:k,"aria-disabled":g,children:[e.u("div",{className:e.cc("choice-label-container"),children:[r?e.u("div",{...M,className:e.cc("select-radio",...D),id:S,role:"radio",tabIndex:0}):e.u(H,{disabled:g,divId:S,id:h,isSelected:i,themeColor:n}),o&&e.u("label",{className:e.cc(e.getClasses("select-label",p)),htmlFor:S,id:`label-${h}`,children:o})]}),y&&i&&e.u("div",{className:e.cc("choice-text-entry-container",...D),children:e.u(j,{onTextChange:w=>x({isSelected:i,userText:w}),promptText:C||"Please specify",textValue:c,useMobileStyling:p})})]})},exports.QuestionBodyFooterContainer=({children:t})=>{const n=L(),{isConversationalUI:s}=e.useConfig(o=>({isConversationalUI:o.isConversationalUI}));return e.u("div",{className:e.cc("sprig-question-footer-container",n&&!s?"sprig-border-top":null),children:t})},exports.QuestionBodyWrapper=({children:t})=>e.u("div",{className:"sprig-question-body",children:t}),exports.Select=({isMultiSelect:t=!1,multiselectText:n="choices selected",onChange:s,options:o,placeholderText:i,value:l,disabledOptions:c=[],dropdownFooter:h})=>{const[r,p]=e.h(!1),d=e._(null),{viewDocument:y,update:u,isConversationalUI:C}=e.useConfig(a=>({viewDocument:a.viewDocument,update:a.update,isConversationalUI:a.isConversationalUI})),g=()=>{p(!r)};e.y(()=>{C||u()},[r,C,u]),e.y(()=>{r&&d.current&&d.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[r]),e.p(()=>{var b;const a=m=>{const v=m.target;(v==null?void 0:v.closest(".select-option.ul-choice-disabled"))||p(!1)};y.addEventListener("click",a);try{(b=window.parent)==null||b.addEventListener("click",a)}catch{window.addEventListener("click",a)}return()=>{var m;y.removeEventListener("click",a);try{(m=window.parent)==null||m.removeEventListener("click",a)}catch{window.removeEventListener("click",a)}}},[y]);const f=l.length===0?["select-button-placeholder"]:[];return e.u(e.g,{children:[e.u("button",{"aria-label":"choice dropdown button",className:e.cc("select-button",...f),onClick:a=>{a.stopPropagation(),g()},type:"button",children:[e.u("span",{children:l.length===0?i:l.length===1?l[0].label:`${l.length} ${n}`}),e.u(e.SvgCaret,{})]}),r&&e.u(K,{disabledOptions:c,dropdownFooter:h,options:o,panelRef:d,selectedOptions:l,selectItem:a=>{var v;const b=l.some(x=>x.id===a.id),m=l.some(x=>{var N;return(N=x.optionProperties)==null?void 0:N.noneOfTheAbove});(v=a.optionProperties)!=null&&v.noneOfTheAbove&&!b?s([a]):t?s(b?l.filter(x=>x.id!==a.id):m?[a]:[...l,a]):b||s([a]),t||g()},showCheckbox:t})]})},exports.getAttributedUrl=(t=void 0,n={})=>{if(!t)return t;const s=["http:","https:","itms-apps:","market:"],o=(c=>/^[a-zA-Z][a-zA-Z0-9+\-.]*:\/\//.test(c)?c:`http://${c}`)(t);if(!o)return;try{const c=new URL(o);if(!c.protocol||!s.includes(c.protocol))return}catch{return}const i=[],l=((c,h,r)=>{let p=c;for(const[d,y]of Object.entries(Q))if(p.toLowerCase().includes(d))if(h[y]){const u=new RegExp(d,"gi");p=p.replace(u,h[y])}else r.push(d);return p})(o,n,i);return i.length===0?l:((c,h)=>{if(!c.includes("?"))return c;const r=c.slice(0,c.indexOf("?")),p=c.slice(c.indexOf("?")+1).split("&").map(d=>d.split("=")).filter(d=>!h.includes(d[1]));return p.length===0?r:`${r}?${p.map(d=>d.join("=")).join("&")}`})(l,i)},exports.useAutoSize=(t,n)=>{const s=e._(0);return()=>{if(t.current){const o=t.current;o.style.height="1px";const i=o.scrollHeight+(o.offsetHeight-o.clientHeight),l=parseInt(window.getComputedStyle(o).getPropertyValue("max-height")),c=i<=l?i:l;s.current!==c&&requestAnimationFrame(()=>{n()}),s.current=c,o.style.height=`${c}px`}}},exports.useSetAllResponsesRaw=t=>{const n=e._(),{setAllResponsesRaw:s}=e.useConfig(o=>({setAllResponsesRaw:o.setAllResponsesRaw}));e.p(()=>{const o=n.current;(!o||Object.keys(t).length!==Object.keys(o).length||Object.keys(t).some(i=>t[i]!==o[i]))&&(s(t),n.current=t)},[t,s])};
|