@sprig-technologies/sprig-bundled 2.47.0 → 2.48.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-ui-CXl_8HB_.js → conversational-ui-CoOUaxMV.js} +74 -75
- package/dist/{conversational-ui-CEmVz2Vg.cjs → conversational-ui-D4JFc07q.cjs} +2 -2
- package/dist/{conversational-v2-styles-D5xNLWoE.cjs → conversational-v2-styles-BCsmmSE3.cjs} +1 -1
- package/dist/{conversational-v2-styles-GH9tfuXI.js → conversational-v2-styles-BK9YvF7Q.js} +1 -1
- package/dist/getAttributedUrl-Cy6ZmssZ.js +197 -0
- package/dist/getAttributedUrl-GFl2RKI_.cjs +12 -0
- package/dist/index-Cg785YpL.js +4 -0
- package/dist/index-DDZBH-vP.js +768 -0
- package/dist/index-DYrVxSAM.cjs +1 -0
- package/dist/index-D_IOfB4u.cjs +1 -0
- package/dist/index-Dm2nk1lh.js +4 -0
- package/dist/{index-BNI3IK7K.js → index-Q_m-uWR7.js} +4 -4
- package/dist/{index-BBiYWZkL.cjs → index-pfR5IQvc.cjs} +2 -2
- package/dist/index-rJoqOgIc.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/view-bHnS65wz.js +1834 -0
- package/dist/view-umqtk1IA.cjs +1 -0
- package/package.json +1 -1
- package/dist/getAttributedUrl-D-vLs0_x.js +0 -194
- package/dist/getAttributedUrl-DNR4xoBk.cjs +0 -12
- package/dist/index-B-aCET7A.js +0 -737
- package/dist/index-DD639GNJ.cjs +0 -1
- package/dist/view-B4aVfDPi.cjs +0 -1
- package/dist/view-eRBVyC0l.js +0 -1831
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-umqtk1IA.cjs"),Y=require("./index-pfR5IQvc.cjs"),j=require("./getAttributedUrl-GFl2RKI_.cjs"),se="https://cdn.sprig.com",R={document:void 0,videojs:void 0},Ee=n=>n+"-loading-spiner",Z="hidden",_e=".m3u8",ve="questionId",ge="ul-video-recorder-camera-off-button",he="ul-recording-in-session",Je=[{type:"link",content:`${se}/dependencies/videojs-record-4.5.0.min.css`},{type:"script",content:`${se}/dependencies/RecordRTC-5.6.2.js`},{type:"script",content:`${se}/dependencies/adapter.8.0.0.min.js`},{type:"script",content:`${se}/dependencies/videojs-record-4.5.0.min.js`},{type:"script",content:`${se}/userleap-web-upchunk-v2.2.2.js`}],Ne=[{type:"link",content:`${se}/dependencies/video-js-7.18.0.min.css`},{type:"script",content:`${se}/dependencies/video-js-7.18.0.min.js`},{type:"style",content:`/* progress control styles */
|
|
2
2
|
.video-js .vjs-control {
|
|
3
3
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
4
4
|
}
|
|
@@ -655,4 +655,4 @@ span.ul-button-text {
|
|
|
655
655
|
.vjs-poster {
|
|
656
656
|
background-size: cover;
|
|
657
657
|
}
|
|
658
|
-
`}],De="-secondary-video-player",qe="-video-recorder";let ne,Se;const ie=async({event:n,apiBase:r,headers:t,visitorId:o,envId:i,metadata:s})=>{const l=R.document.documentElement;if(!o||!i)return;const d={event:`SDK - ${n}`,visitorId:o,environmentId:i,metadata:{...s||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${r}/sdk/1/visitors/${o}/analytics`,{method:"POST",cache:"no-cache",headers:t,body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",n)},re=async(n,r,t,o,i,s)=>{ie({event:`Video Error ${r}`,apiBase:t,headers:o,visitorId:i,envId:s,metadata:{errorMessage:n.message}});const l=R.document.documentElement,d={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language},a={action:r,err:{message:n.message,stack:n.stack},meta:d,vid:i,envId:s};(await fetch(`${t}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...o,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},Oe=(n,r)=>{if(n.length===0)return r&&r();Promise.all(n.reduce((t,o)=>(t.push(((i,{type:s,content:l})=>new Promise(function(d,a){let u;s==="script"?(u=R.document.createElement("script"),u.src=l):s==="link"?(u=R.document.createElement("link"),u.rel="stylesheet",u.href=l,u.type="text/css"):(u=R.document.createElement("style"),u.innerHTML=l),u.onload=function(){d(l)},u.onerror=function(){a(l)},u.async=!1,u.id=btoa(l),i.appendChild(u)}))(R.document.head,o)),t),[])).then(()=>{R.videojs=R.document.defaultView.videojs,r&&r()}).catch(function(t){console.log(t+" failed to load")})},Re=(n,r,t)=>{if(r==="start"&&(n.style.visibility="visible"),r==="none")n.style.visibility=W;else if(r==="success")n.style.visibility=W,n.innerHTML="Upload succeeded!";else{const o=Math.round(parseFloat(t));n.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${o}%</span>`,n.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${o}%, #FCFCFD ${o}%, #FCFCFD 100%)`}},be=(n,r)=>{const t=R.videojs(n.id());return t==null?void 0:t.payload[r]},Ue=(n,r)=>{const t=new(R.videojs.getComponent("Component"))(n);return t.addClass("ul-buttons-panel"),r.map(o=>{t.addChild(o)}),Xe(t),t},Xe=n=>{n.children().forEach(r=>{if(J[r.name_]){const t=ce(J[r.name_],`ul-${J[r.name_]}`);r.el_.appendChild(t)}})},ce=(n,r="")=>{const t=R.document.createElement("span");return t.className="ul-button-text",t.innerHTML=n,t.id=r,t},Ae=(n,r,t,o,i=!1,s)=>{n.addClass("ul-video-player");const l=new(R.videojs.getComponent("Component"))(n);l.addClass("ul-control-panel"),n.progressBar=l.addChild("ProgressControl"),t&&n.src(t),n.audioPlayerPlaceholder=new(R.videojs.getComponent("Component"))(n),n.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const d=t&&t.src?rn(t.src):null;!t||!i&&d?(n.audioPlayerPlaceholder.hide(),R.document.getElementById(`${n.id()}_html5_api`).style.height="100%",d&&n.poster(d)):(n.children()[0].classList.add("vjs-hidden"),R.document.getElementById(`${n.id()}_html5_api`).style.height="0px"),n.on("play",()=>{i||!t||d||nn(n),s==null||s.play()}),n.on("pause",()=>{s==null||s.pause()}),n.on("seeked",()=>{s==null||s.currentTime(n.currentTime())}),n.on("ratechange",()=>{s==null||s.playbackRate(n.playbackRate())}),n.addChild(n.audioPlayerPlaceholder,{},1),l.addChild(r),n.addChild(l),o&&o(n)},en=(n,r,t,o,i,s,l,d=!1)=>{Se=Date.now();const a=Ce(r,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!a)return;a.payload=t;const{surveyId:u,questionId:C,responseGroupUid:b,visitorId:m,envId:y}=t;let L;const f=v=>{const g=ge,c=ge+"-audio-only";Re(a.uploadProgressLabel,"none"),ne&&ne.startTime>=Se&&ne.abort();const T=R.document.getElementById("ul-camera-button");v?(a.children()[0].classList.add("vjs-hidden"),I.removeClass(g),I.addClass(c),T.innerHTML=J.TurnOnCamera,a.audioPlayerPlaceholder.removeClass("vjs-hidden"),L==null||L.getTracks().forEach(w=>{w.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(w=>{L=w,w.getVideoTracks().forEach(B=>{B.enabled=!1}),a.record().onDeviceReady(w)}).catch(a.record().onDeviceError.bind(a.record()))):(L==null||L.getVideoTracks().forEach(w=>{w.enabled=!0}),a.children()[0].classList.remove("vjs-hidden"),a.record().getDevice(),I.removeClass(c),I.addClass(g),T.innerHTML=J.TurnOffCamera,a.audioPlayerPlaceholder.addClass("vjs-hidden"))},x=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{x.hasClass(W)||(ie({event:"Video Delete Button Clicked",apiBase:o,headers:l,visitorId:m,envId:y,metadata:{questionId:C,responseGroupUid:b,surveyId:u}}),f(a.cameraOff),i(q.DELETE,{}),I.removeClass(W),x.addClass(W))}});x.addClass("ul-video-recorder-delete-button"),x.el_.appendChild(ce(J.DeleteButton,"ul-delete-button"));const S=R.document.getElementById(r),E=()=>{S.classList.contains("vjs-fullscreen")&&a.cameraOff?S.style.display="table":S.style.display="flex"};E();const I=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{a.record().isRecording()||(a.cameraOff=!a.cameraOff,ie({event:"Video Camera Button Clicked",apiBase:o,headers:l,visitorId:t.visitorId,envId:t.envId,metadata:{questionId:C,responseGroupUid:b,surveyId:u,cameraOff:a.cameraOff}}),f(a.cameraOff),!x.hasClass(W)&&x.addClass(W),i(q.DELETE,{}),E())}});I.addClass(ge),I.el_.appendChild(ce(J.TurnOffCamera,"ul-camera-button"));const _=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{const v=R.document.getElementById("ul-recorder-toggle");if(a.record().isRecording())a.record().stop(),v&&(v.innerHTML=J.RecordButton),_.removeClass(he),x.removeClass(W);else{const g=R.document.getElementById("ul-recording-countdown-screen");if(g)g.remove(),v&&(v.innerHTML=J.RecordButton),f(a.cameraOff),i(q.DELETE,{}),I.removeClass(W),x.addClass(W),_.removeClass(he),p.show();else{_.addClass(he),p.hide(),I.addClass(W),x.addClass(W),v&&(v.innerHTML=J.StopButton);const c=R.document.createElement("div");c.id="ul-recording-countdown-screen",S.insertBefore(c,S.children[1]),c.style.height=`${S.offsetHeight}px`,He(a,3)}}}});_.addClass("ul-video-recorder-toggle-button"),_.el_.appendChild(ce(J.RecordButton,"ul-recorder-toggle"));const O=R.document.createElement("p");O.style.visibility="hidden",O.className="ul-upload-progress-label",n.appendChild(O),a.uploadProgressLabel=O;const F=Ue(a,[x,I,"PlayToggle",_,"FullscreenToggle"]),p=F.children().find(v=>v.name_==="FullscreenToggle");p.hasClass("vjs-disabled")&&p.hide();const h=F.children().find(v=>v.name_==="PlayToggle");h.hide(),x.addClass(W),Ae(a,F,s,!1,d),a.on("stopRecord",()=>{_.hide(),h.show(),p.show(),x.removeClass(W)}),a.on("deviceReady",()=>{_.show(),h.hide(),x.addClass(W)}),((v,g,c,T,w)=>{const{surveyId:B,responseGroupUid:M,visitorId:P,envId:U}=v.payload;v.on("deviceError",function(){console.warn("device error: ",v.deviceErrorCode),v.deviceErrorCode.message==="Permission denied"?(v.deviceButton.addClass("permission-denied"),c&&c(q.ERROR,{type:q.PERMISSION_DENIED}),ie({event:"Video Permission Denied",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{questionId:be(v,ve),responseGroupUid:M,surveyId:B}})):(c&&c(q.ERROR,{type:q.OTHER}),re(new Error(v.deviceErrorCode.message),"recorderDeviceError",g,w,P,U))}),v.on("error",function(z,G){re(G||v.error(),"recorderError",g,w,P,U)}),v.on("startRecord",function(z,G){T(v.uploadProgressLabel,"none"),ie({event:"Video Record Start",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{questionId:be(v,ve),responseGroupUid:M,surveyId:B}})}),v.on("finishRecord",async function(){T(v.uploadProgressLabel,"start",0);const z=be(v,ve);if(!B){const k="internal error: missing fields in payload";return c&&c(q.ERROR,{type:q.OTHER}),re(new Error(k),"finishRecord",g,w,P,U),null}v.record().stopDevice();const G=v.cameraOff?q.MEDIA_TYPE_AUDIO:q.MEDIA_TYPE_VIDEO,Z=Y.v4();ie({event:"Video Record Finish",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:Z,questionId:z,responseGroupUid:M,surveyId:B,mediaType:G}});const X={surveyId:B,updatedAt:new Date().toISOString(),mediaType:G,mediaRecordingUid:Z};z&&(X.questionId=z),M&&(X.responseGroupUid=M),P&&(X.visitorId=P);const ee=await(async()=>{const k=await fetch(`${g}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)});if(k.ok){const A=await k.json();return c&&c(q.UPLOAD_STARTED,{[q.UPLOAD_ID]:A.upload.id,[q.MEDIA_TYPE]:G,[q.MEDIA_RECORDING_UID]:Z}),A.upload.url}return c&&c(q.ERROR,{type:q.OTHER,response:k}),re(new Error("failed to get upload response with url"),"finishRecord",g,w,P,U),null})();ee&&(ne=R.document.defaultView.UpChunk.createUpload({endpoint:ee,file:new R.document.defaultView.File([v.recordedData],`recording ${G} ${Date.now()}`),chunkSize:5120}),ne.startTime=Date.now(),ie({event:"Video Upload Start",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:Z,questionId:z,responseGroupUid:M,surveyId:B,mediaType:G,url:ee}}),ne.on("error",k=>{T(v.uploadProgressLabel,"none"),c&&c(q.UPLOAD_FINISHED,{[q.MEDIA_RECORDING_UID]:Z}),re(k,"finishRecord",g,w,P,U)}),ne.on("progress",k=>{c&&c(q.UPLOAD_PROGRESS,{[q.MEDIA_RECORDING_UID]:Z,[q.UPLOAD_PROGRESS_PCT]:k.detail}),T(v.uploadProgressLabel,"progress",k.detail)}),ne.on("success",()=>{T(v.uploadProgressLabel,"success"),c&&c(q.UPLOAD_FINISHED,{[q.MEDIA_RECORDING_UID]:Z}),ie({event:"Video Upload Success",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:Z,questionId:z,responseGroupUid:M,surveyId:B,mediaType:G,url:ee,elapsedMs:ne.startTime&&Date.now()-ne.startTime}})}))})})(a,o,i,Re,l);const D=[{name:"microphone"}];!a.cameraOff&&D.push({name:"camera"}),Promise.all(D.map(v=>{var g;return(g=navigator==null?void 0:navigator.permissions)==null?void 0:g.query(v)})).then(v=>{v.reduce((g,c)=>g&c.state==="granted",!0)&&a&&(a.deviceButton&&a.deviceButton.hide(),a.record().getDevice())}).catch(v=>{})},He=(n,r=3)=>{const t=R.document.getElementById("ul-recording-countdown-screen");t&&r===0?(t.remove(),n.record().start()):t&&(t.innerHTML=`<span class='ul-countdown-text'>Recording in... ${r}</span>`,setTimeout(()=>{He(n,r-1)},1e3))},Fe=n=>{const r=R.document.createElement("div");return r.className="ul-video-container",r.appendChild((t=>{const o=R.document.createElement("div");return o.className="ul-video-player-loading",o.id=Ee(t),["first","second","third","fourth"].map(i=>{const s=R.document.createElement("div");s.className=i,o.appendChild(s)}),o})(n)),r},ye=(n,r)=>{const t=R.document.createElement("video");t.id=n,t.className="video-js vjs-default-skin ul-video-player-video";const o=R.document.createElement("p");o.className="vjs-no-js",o.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const i=R.document.createElement("a");return i.href="https://videojs.com/html5-video-support/",i.target="_blank",i.innerHTML="supports HTML5 video",o.appendChild(i),t.appendChild(o),r.appendChild(t),r},nn=(n,r)=>{n.children()[0].classList.remove("vjs-hidden"),n.audioPlayerPlaceholder.hide(),R.document.getElementById(`${n.id()}_html5_api`).style.height="100%"},Ce=(n,r)=>R.document.getElementById(n)?r?R.videojs(n,r):R.videojs(n):(console.error(`Error in finding player element with ID, ${n}`),null),tn=(n,r,t,o=!1,i="https://api.sprig.com",s=document,l=null,d=null)=>{R.document=s;const a=n+"-video-player",u=Fe(a);return R.document.addEventListener("securitypolicyviolation",C=>{re(new Error(`Voice & Video feature violates ${C.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",i,{})}),Oe(Ne,()=>{R.document.getElementById(Ee(a)).remove(),ye(a,u);const C={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const b=n+De;ye(b,u);const m=Ce(a,C),y=Ce(b,{muted:!0,...C});if(!m||!y)return;((x,S,E)=>{x.addClass(`ul${De}`);const I=new(R.videojs.getComponent("Component"))(x);S&&x.src(S),x.addChild(I),E&&E(x)})(y,l,d),l||y.addClass(W);const L=Ue(m,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),f=L.children().find(x=>x.name_==="FullscreenToggle");f.hasClass("vjs-disabled")&&f.hide(),Ae(m,L,r,t,o,y)}catch(b){return void re(new Error(`Error when creating video player object ${b}`),"playerDeviceError",i,{})}}),u},Le=n=>{const r=n+qe;if(R.document.getElementById(r)&&R.videojs){try{if(!R.videojs(r).record().stream)return}catch{return}R.videojs(r).record().stop(),R.videojs(r).record().stopDevice()}},rn=n=>{if(!n)return null;const r=n.match(/https:\/\/stream.mux.com\/(.*)/);let t=r?r[1]:null;return t.includes(_e)&&(t=t.replace(_e,"")),t?`https://image.mux.com/${t}/thumbnail.jpg?time=0`:null},q={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},J={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},on=({properties:n,surveyVideoUrl:r,questionId:t})=>{const o=`ul-card-video__question_player-q${t}`,{apiURL:i,viewDocument:s}=e.useConfig(l=>({apiURL:l.apiURL,viewDocument:l.viewDocument}));return e.u("div",{id:o,ref:l=>{if((l==null?void 0:l.children.length)===0&&!n.properties.hideRecordedPrompt){const d=tn(o,{src:r,type:"application/x-mpegURL"},void 0,n.properties.mediaType===q.MEDIA_TYPE_AUDIO,i,s);l.appendChild(d)}}})},sn=()=>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"})}),oe=({isDisabled:n,onClick:r,children:t,style:o,showCheckmark:i})=>{const s=i??(typeof t=="string"&&t.toLowerCase()==="finish");return e.u(j.Button,{disabled:!!n,onClick:r,style:o,type:"button",children:[s&&e.u("span",{style:{paddingRight:"4px"},children:e.u(sn,{})}),t]})},an=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{useMobileStyling:l,border:d,cards:a}=e.useConfig(h=>({useMobileStyling:h.useMobileStyling,border:h.border,cards:h.cards})),[u,C]=e.h(!1),[b,m]=e.h(""),[y,L]=e.h(!1),f=t==null?void 0:t.collectName,x=(t==null?void 0:t.nameLabelText)||"Full Name",S=(t==null?void 0:t.consentText)||"I agree to the stated conditions",E=(t==null?void 0:t.submitButtonText)||"Submit",I=e.getButtonText({buttonText:E}),_=e.isLastQuestion(o,a),O=!!b.trim(),F=u&&(!f||O),p=(h,D=!1)=>{h.preventDefault(),h.stopPropagation();let v=null;if(!D){if(!F)return void L(!0);v={submitted:!0},f&&(v.name=b)}r({value:v,questionId:o,type:i},!!D||F)};return e.u("div",{className:e.cc(n,"ul-card__consent-legal","fade-in-transition"),children:e.u(j.MobileEmbedView,{embeddedType:"pdf",properties:t,children:e.u(j.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(j.Option,{allowTextEntry:!1,border:d,error:y&&!u,id:"consent",isRadio:!1,isSelected:u,label:S,onUserInputChanged:({selected:h})=>{h!==u&&C(!u)},useMobileStyling:l}),f&&e.u("input",{"aria-label":x,"aria-placeholder":x,className:e.cc(e.getClasses("ul-consent-legal__name-input",l)),"data-gramm":"false",maxLength:250,name:"name",onBlur:h=>{h.currentTarget.style.borderColor=y&&!O?Y.ERROR_BORDER_COLOR:Y.DEFAULT_BORDER_COLOR},onFocus:h=>{h.currentTarget.style.borderColor=y&&!O?Y.ERROR_BORDER_COLOR:d},onInput:h=>{h.preventDefault(),h.stopPropagation(),m(h.currentTarget.value)},placeholder:x,style:y&&!O?{borderColor:Y.ERROR_BORDER_COLOR}:{},tabIndex:0,value:b})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:!s&&(t.required?e.u(oe,{isDisabled:!F,onClick:h=>p(new SubmitEvent(h.type)),showCheckmark:_,children:I}):e.u(e.g,{children:[e.u(oe,{isDisabled:!F,onClick:h=>p(new SubmitEvent(h.type)),showCheckmark:_,children:I}),e.u("button",{className:"ul-card-skip__button",onClick:h=>p(new SubmitEvent(h.type),!0),children:e.getSkipButtonText(t)})]}))})]})})},o)},ln=()=>{const{destroy:n,forceBrandedLogo:r}=e.useConfig(t=>({destroy:t.destroy,forceBrandedLogo:t.forceBrandedLogo}));return e.p(()=>{setTimeout(()=>{n(Y.APP_ID)},r?4e3:2e3)},[n,r]),e.u("div",{className:"end-of-survey-text",children:"End of survey"})},dn=({activeValue:n,border:r,icon:t,enableCspTrustedTypes:o,isPressed:i,range:s,scaleLabelType:l,selectedValue:d,setSelectedValue:a,setActiveValue:u,setIsPressed:C,useMobileStyling:b,value:m,viewDocument:y})=>{const L=`option-${m}`,f=l==="number",x=l==="star",S=l==="smiley",E=f&&m===n||m===d,[I,_]=(()=>{const p=x&&d!==null&&m<=d;return x&&m<=n||S&&m===n||p||m===n||m===d?[r,i||p||m===d?1:.3]:["",1]})(),O=e.F(()=>{const p={borderColor:E?I:"",fillOpacity:E?"":_,zIndex:E?3:"auto",color:d===m?"#fff":""};return f?{...p,backgroundColor:d===m?I:""}:{...p,color:x||S||d===m?I:""}},[E,I,_,d,m,f,x,S]),F=e.F(()=>Y.getHtml((({icon:p,scaleLabelType:h,value:D,selectedValue:v})=>{if(h==="smiley"&&D===v){let g=0;return p.replace(/black/g,()=>++g==1?"black":"white")}return p})({icon:t,scaleLabelType:l,value:m,selectedValue:d}),o),[o,t,l,d,m]);return e.u("button",{"aria-label":f?void 0:String(m),className:(()=>{switch(l){case"star":return e.cc(e.getClasses("likert-star",b),e.getClasses(`likert-star-${m}`,b));case"smiley":return e.cc(e.getClasses("likert-smiley",b),e.getClasses(`likert-smiley-${m}`,b));default:return m===s?e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${m}`,b),e.getClasses("likert-last-option",b)):e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${m}`,b))}})(),dangerouslySetInnerHTML:{__html:F},id:L,onClick:p=>{p.preventDefault(),p.stopPropagation(),a(m)},onKeyDown:p=>{var v,g;const h=y.querySelectorAll(`.likert-${l??"number"}`),D=m-1;p.key==="ArrowRight"?(v=h[D+1])==null||v.focus():p.key==="ArrowLeft"?(g=h[D-1])==null||g.focus():p.key!=="Enter"&&p.key!==" "||(p.preventDefault(),p.stopPropagation(),a(m))},onPointerDown:()=>C(!0),onPointerEnter:()=>u(m),onPointerLeave:()=>{u(-1),C(!1)},style:O,tabIndex:0})},cn=({className:n,labels:r,next:t,properties:o,questionId:i,type:s,isAnswered:l})=>{const{border:d,useMobileStyling:a,viewDocument:u,enableCspTrustedTypes:C,cards:b}=e.useConfig(c=>({border:c.border,useMobileStyling:c.useMobileStyling,viewDocument:c.viewDocument,enableCspTrustedTypes:c.enableCspTrustedTypes,cards:c.cards})),[m,y]=e.h(-1),[L,f]=e.h(!1),[x,S]=e.h(null),E=r&&r.left,I=r&&r.right;let _;const{range:O,scaleLabelType:F,ratingIcons:p}=o;O&&(_=Number(O));const h=_||5,D=c=>{var T,w;switch(F){case"star":return(T=p[0])==null?void 0:T.svg;case"smiley":return(w=p[c])==null?void 0:w.svg;default:return String(c+1)}},v=e.getButtonText(o),g=e.isLastQuestion(i,b);return e.u("form",{className:e.cc(n,"ul-card--likert","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${h})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(h)].map((c,T)=>{const w=T+1;return e.u(dn,{activeValue:m,border:d,enableCspTrustedTypes:C,icon:D(T),isPressed:L,range:h,scaleLabelType:F,selectedValue:x,setActiveValue:y,setIsPressed:f,setSelectedValue:S,useMobileStyling:a,value:w,viewDocument:u},T)})}),(E||I)&&e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:E}),e.u("span",{children:I})]})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:x===null&&o.required,onClick:()=>{t({value:x,questionId:i,type:s},!0)},showCheckmark:g,children:v})})]})},i)},un=({columns:n,onSelect:r,options:t,selectedOptions:o})=>{const i=e._([]),{border:s,useMobileStyling:l}=e.useConfig(m=>({border:m.border,useMobileStyling:m.useMobileStyling})),d=t.findIndex(m=>o[m.id]===null),[a,u]=e.h(d),C=e.T((m,y)=>{r(m,y);const L=a+1,f=t[L];f&&o[f.id]===null&&u(L)},[r,t,o,a]),b=e.T((m,y)=>{const L=a===m;return e.u(e.Accordion,{animate:!0,header:y.label,isOpen:L,onClick:()=>{var f;return u(L&&!((f=window.UserLeap)!=null&&f.isMobileSDK)?-1:m)},ref:f=>{f&&(i.current[m]=f)},showHeaderCheck:o[y.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:n.map(f=>e.u(j.Option,{allowTextEntry:!1,ariaLabel:`${y.label}-${f.label}`,border:s,error:!1,id:`${y.id}-${f.value}`,isRadio:!0,isSelected:o[y.id]===f.value,label:f.label,onUserInputChanged:()=>C(y.id,f.value),useMobileStyling:l},f.label))})},y.id)},[s,n,a,C,o,l]);return e.u("div",{children:t.map((m,y)=>b(y,m))})},pn=({className:n,next:r,options:t,properties:o,questionId:i,type:s,onSubmitButtonClick:l,isAnswered:d})=>{const{cards:a}=e.useConfig(E=>({cards:E.cards})),u=o.matrixColumn,C=o.required,b=E=>{E.preventDefault(),E.stopPropagation(),r({value:y,questionId:i,type:s},!0),l&&l()},m=t.reduce((E,I)=>(E[I.id]=null,E),{}),[y,L]=e.h(m),f=e.getButtonText(o),x=e.isLastQuestion(i,a);return e.u("form",{className:e.cc(n,"ul-card__matrix","fade-in-transition"),id:"text-form",onSubmit:b,children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:e.u(un,{columns:u,onSelect:(E,I)=>{L(_=>({..._,[E]:I}))},options:t,selectedOptions:y})}),e.u(j.QuestionBodyFooterContainer,{children:!d&&e.u(oe,{isDisabled:(S=y,C&&Object.values(S).every(E=>E==null)),onClick:()=>b(new SubmitEvent("submit")),showCheckmark:x,children:f})})]})},i);var S},$e=({className:n,onSubmit:r,options:t=[],properties:o,questionId:i,type:s,showIndividualSubmit:l=!1,onSubmitButtonClick:d,isAnswered:a})=>{const{border:u,useMobileStyling:C,cards:b}=e.useConfig(c=>({border:c.border,useMobileStyling:c.useMobileStyling,cards:c.cards})),m=t.reduce((c,T)=>(c[T.id]={isSelected:!1},c),{}),[y,L]=e.h(m),f=s==="multiplechoice",x=o.required,S=t.find(c=>{var T;return(T=c.optionProperties)==null?void 0:T.noneOfTheAbove}),E=c=>Object.entries(c).some(([T,w])=>{var P;const B=t.find(U=>`${U.id}`===T),M=w.userText===void 0||w.userText.trim()==="";return((P=B==null?void 0:B.optionProperties)==null?void 0:P.allowsTextEntry)&&M&&w.isSelected}),I=c=>Object.values(c).filter(T=>T.isSelected).length,_=o.minSelect&&o.minSelect>0&&o.maxSelectMode===e.MaxSelectModes.Range&&I(y)<o.minSelect&&(x||I(y)>0),O=c=>E(c)||x&&!I(c)||!(T=>{const{minSelect:w=0,maxSelect:B=1/0,maxSelectMode:M}=o,P=I(T);switch(M){case e.MaxSelectModes.Maximum:return P<=B;case e.MaxSelectModes.Range:return P===0||P>=w;default:return!0}})(c),F=Object.entries(y).some(([c,T])=>{var w,B;return T.isSelected&&((B=(w=t.find(M=>`${M.id}`===c))==null?void 0:w.optionProperties)==null?void 0:B.allowsTextEntry)}),p=l&&(!f||F),h=c=>{g(c.id,c.selected,c.userText,c.noneOfTheAbove)},D=c=>{var T;return(o==null?void 0:o.maxSelectMode)!==e.MaxSelectModes.Unlimited&&I(y)===(o==null?void 0:o.maxSelect)&&!((T=y[c])!=null&&T.isSelected)},v=()=>{r(y,!0),d&&d()},g=(c,T,w,B)=>{const M=Object.assign({},y);if((f||B)&&T)for(const P of Object.values(M))P.isSelected=!1,delete P.userText;else S&&!B&&y[S.id].isSelected&&(M[S.id].isSelected=!1);M[c]={isSelected:T,userText:w},L(M)};return e.u("form",{className:e.cc(n,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:v,children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:[o.isDropdown?e.u(j.Select,{disabledOptions:t.filter(c=>D(c.id)),dropdownFooter:_?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[I(y),"/",o.minSelect]}):void 0,isMultiSelect:!f,multiselectText:o.dropdownMultiselectedText??"choices selected",onChange:c=>{const T={...y};for(const w of t)c.includes(w)?T[w.id].isSelected=!0:T[w.id].isSelected=!1;L(T)},options:t,placeholderText:o.dropdownPlaceholderText??(f?"Select choice":"Select choice(s)"),value:t.filter(c=>y[c.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",C)),role:f?"radiogroup":"group",children:[t.map(({id:c,label:T,value:w,optionProperties:B})=>{var G,Z;const M=`${c}`,{allowsTextEntry:P,noneOfTheAbove:U}={allowsTextEntry:!1,noneOfTheAbove:!1,...B};return e.u(j.Option,{allowTextEntry:P,border:u,disabled:D(M),error:(z=y,E(z)),id:M,isRadio:f,isSelected:!!((G=y[M])!=null&&G.isSelected),label:T,noneOfTheAbove:U,onUserInputChanged:h,promptText:(B==null?void 0:B.otherOptionPlaceholder)||"Please specify",text:(Z=y[c])==null?void 0:Z.userText,useMobileStyling:C,value:w},M);var z}),!!_&&e.u("div",{className:"ul-card__min-select-counter",children:[I(y),"/",o.minSelect]})]}),p&&e.u(j.LongformSubmitButton,{handleSubmit:v,isSubmitDisabled:O(y)})]}),!a&&e.u(j.QuestionBodyFooterContainer,{children:e.u(oe,{isDisabled:O(y),onClick:v,showCheckmark:e.isLastQuestion(i,b),children:e.getButtonText(o)})})]})},i)},mn=n=>{const{questionId:r,type:t,next:o,options:i}=n;return e.u($e,{...n,onSubmit:(s,l)=>{const d=Object.entries(s).find(([,m])=>m.isSelected)||[void 0,void 0],[a,u]=d,C=i.find(m=>`${m.id}`===a),b=u!=null&&u.userText?{[a]:{userText:u.userText}}:null;o({value:C&&a?{[a]:C.value}:{},secondaryValue:b,questionId:r,type:t},l)}})},vn=n=>{const{questionId:r,type:t,next:o}=n;return e.u($e,{...n,onSubmit:(i,s)=>{const l=Object.entries(i).reduce((a,[u,C])=>(a[u]=C.isSelected,a),{}),d=Object.entries(i).reduce((a,[u,C])=>{if(!C.userText)return a;const b=a||{};return b[u]={userText:C.userText},b},null);o({value:l,secondaryValue:d,questionId:r,type:t},s)}})},gn=({className:n,labels:r,properties:t,next:o,questionId:i,type:s,isAnswered:l})=>{const[d,a]=e.h(null),{border:u,useMobileStyling:C,viewDocument:b,cards:m}=e.useConfig(x=>({border:x.border,useMobileStyling:x.useMobileStyling,viewDocument:x.viewDocument,cards:x.cards})),y=r&&r.left,L=r&&r.right,f=e.isLastQuestion(i,m);return e.u("form",{className:e.cc(n,"ul-card--nps","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:t,children:[e.u(j.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((x,S)=>e.u("button",{className:e.cc(e.getClasses("nps-number",C),e.getClasses(`nps-number-${S}`,C)),id:`option-${S}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),a(S)},onKeyDown:E=>{var _,O;const I=b.querySelectorAll("button.nps-number");E.key==="ArrowRight"?(_=I[S+1])==null||_.focus():E.key==="ArrowLeft"?(O=I[S-1])==null||O.focus():E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),E.stopPropagation(),a(S))},onPointerDown:E=>{E.currentTarget.style.zIndex="2"},onPointerLeave:E=>{E.currentTarget.style.zIndex="auto"},style:d===S?{backgroundColor:u,color:"#fff"}:void 0,tabIndex:0,children:S},S))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:y}),e.u("span",{children:L})]})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:d===null&&t.required,onClick:()=>{o({value:d,questionId:i,type:s},!0)},showCheckmark:f,children:e.getButtonText(t)})})]})},i)},hn=({className:n,next:r,properties:t,questionId:o,type:i,onSubmitButtonClick:s,isAnswered:l})=>{const{border:d,useMobileStyling:a,update:u,cards:C}=e.useConfig(_=>({border:_.border,useMobileStyling:_.useMobileStyling,update:_.update,cards:_.cards})),[b,m]=e.h(""),y=e._(null),L=b.trim(),f=t.required===!0&&!L,x=j.useAutoSize(y,()=>u()),S=t&&t.openTextPlaceholder?t.openTextPlaceholder:"",E=e.getButtonText(t),I=e.isLastQuestion(o,C);return e.u("form",{className:e.cc(n,"ul-card-text","fade-in-transition"),id:"text-form",children:e.u(j.MobileEmbedView,{properties:t,children:e.u("div",{className:"ul-card-text",children:[e.u(j.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":S,className:e.cc(e.getClasses("ul-card-text__input",a)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:_=>{_.currentTarget.style.borderColor=Y.DEFAULT_BORDER_COLOR},onChange:_=>{const{value:O}=_.currentTarget;x(),_.preventDefault(),_.stopPropagation(),m(O)},onFocus:_=>{_.currentTarget.style.borderColor=d},placeholder:S,ref:y,role:"textbox",tabIndex:0})}),t.footerHtml&&e.u(j.Html,{className:"footer",html:t.footerHtml})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:f,onClick:_=>{_.preventDefault(),_.stopPropagation();const O=t.required!==!0||L.length>0;r({value:b,questionId:o,type:i},O),s&&s()},showCheckmark:I,children:E})})]})})},o)},bn=({className:n,labels:r,next:t,properties:o,questionId:i,type:s,onSubmitButtonClick:l,options:d,isAnswered:a})=>{const u=e._(null),C=e._(0),b=e._(0),m=e._(null),y=e._(!1),L=e._([]),[f,x]=e.h(()=>(o==null?void 0:o.required)===!0),[S,E]=e.h(()=>d.map(k=>({...k,rank:null}))),I=e.F(()=>Array.from({length:d.length},(k,A)=>A+1),[d.length]),{useMobileStyling:_,isPreview:O,headers:F}=e.useConfig(k=>({useMobileStyling:k.useMobileStyling,isPreview:k.isPreview,headers:k.headers})),p=(F==null?void 0:F["userleap-platform"])==="android",h=_&&!O&&!p,D=!h&&!p,v=(k,A)=>{E(H=>{const N=parseInt(A),V=H.map($=>({...$}));V.some($=>$.rank==null)&&V.forEach(($,le)=>$.rank=le+1);const K=V.findIndex($=>$.id===k);if(K===-1)return H;const Q=V[K].rank;return N<Q?V.forEach($=>{$.id!==k&&$.rank>=N&&$.rank<Q&&($.rank=$.rank+1)}):N>Q&&V.forEach($=>{$.id!==k&&$.rank>Q&&$.rank<=N&&($.rank=$.rank-1)}),V[K].rank=N,V.sort(($,le)=>$.rank-le.rank),P(),V})},g=(k,A)=>{for(let H=0;H<L.current.length;H++){const N=L.current[H];if(!N||N===m.current)continue;const V=N.getBoundingClientRect();if(k>=V.left&&k<=V.right&&A>=V.top&&A<=V.bottom)return{element:N,index:H}}return null},c=k=>A=>{if(!h)return;A.preventDefault(),A.stopPropagation(),y.current=!0,u.current=k;const H=A.touches[0];C.current=H.clientY,b.current=H.clientY;const N=A.currentTarget.closest(".ul-card-rank__option");N&&(m.current=N,N.classList.add("is-dragging"))},T=k=>{if(!h||!y.current||u.current===null)return;k.preventDefault(),k.stopPropagation();const A=k.touches[0];b.current=A.clientY;const H=b.current-C.current;m.current&&(m.current.style.transform=`translateY(${H}px)`,m.current.style.zIndex="1000"),L.current.forEach(V=>{V&&V!==m.current&&V.classList.remove("is-drop-target")});const N=g(A.clientX,A.clientY);N&&N.element.classList.add("is-drop-target")},w=k=>{if(!h||!y.current||u.current===null)return;k.preventDefault(),k.stopPropagation();const A=k.changedTouches[0],H=g(A.clientX,A.clientY);m.current&&(m.current.style.transform="",m.current.style.zIndex="",m.current.classList.remove("is-dragging")),L.current.forEach(N=>{N&&N.classList.remove("is-drop-target")}),H&&H.index!==u.current&&B(u.current,H.index),u.current=null,m.current=null,y.current=!1},B=(k,A)=>{E(H=>{const N=H.map(K=>({...K})),[V]=N.splice(k,1);return N.splice(A,0,V),N.forEach((K,Q)=>{K.rank=Q+1}),P(),N})},M=k=>{const A={};k.reduce((H,N)=>(H[N.id]=N.rank,H),A),t({value:A,questionId:i,type:s},!0)},P=()=>{x(!1)},{left:U,right:z}=r,G=d.length,Z=k=>{k.preventDefault(),k.currentTarget.classList.add("is-drop-target")},X=k=>{k.currentTarget.classList.remove("is-drop-target")},ee=k=>{u.current=null,k.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(n,"ul-card-rank","fade-in-transition"),onSubmit:k=>{k.preventDefault(),M(S),l&&l()},children:e.u(j.MobileEmbedView,{properties:o,children:p?e.u(e.g,{children:[e.u(j.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 - ",U]})}),e.u("ol",{className:"ul-card-rank__list",children:S.map(({id:k,label:A,rank:H})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${A}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${k}]`,onChange:N=>v(k,N.currentTarget.value),value:H??"",children:[H==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),I.map(N=>e.u("option",{className:"ul-card-rank__select-option",value:N,children:N},`${N}-${i}`))]}),e.u("span",{children:A})]},k))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",z]})})]})}),e.u(j.QuestionBodyFooterContainer,{children:!a&&e.u("div",{className:"ul-card__button-wrapper",children:e.u(j.Button,{disabled:f,children:e.getButtonText(o)})})})]}):e.u(e.g,{children:[e.u(j.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 - ",U]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:p?void 0:k=>{k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect="move")},children:S.map(({id:k,label:A,rank:H},N)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!D||void 0,onDragEnd:D?ee:void 0,onDragEnter:D?Z:void 0,onDragLeave:D?X:void 0,onDragStart:D?(K=N,Q=>{u.current=K,Q.dataTransfer&&(Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",String(K)),Q.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:D?(V=N,Q=>{var le,Ie;Q.preventDefault(),Q.currentTarget.classList.remove("is-drop-target");const $=u.current;u.current=null,(Ie=(le=Q.currentTarget.closest(".ul-card-rank__list"))==null?void 0:le.querySelector(".is-dragging"))==null||Ie.classList.remove("is-dragging"),$!=null&&$!==V&&B($,V)}):void 0,ref:Q=>L.current[N]=Q,children:[e.u("select",{"aria-label":`Rank for ${A}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${k}]`,onChange:Q=>v(k,Q.currentTarget.value),value:H??"",children:[H==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))]}),e.u("span",{children:A}),!p&&e.u("button",{"aria-label":`Drag ${A} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:h?w:void 0,onTouchMove:h?T:void 0,onTouchStart:h?c(N):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"})})})]},k);var V,K})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",z]})})]})}),e.u(j.QuestionBodyFooterContainer,{children:!a&&e.u("div",{className:"ul-card__button-wrapper",children:e.u(j.Button,{disabled:f,children:e.getButtonText(o)})})})]})})},i)},xe=1,Ve=2,Qe=3,ue=n=>n.type==="av_permission",Pe=n=>n.type==="screen_permission",ze=(n,r)=>n===void 0?xe:n?((t,o)=>!(ue(o)?o.permissionDescriptors:[]).includes("camera")||t.getVideoTracks().length>0)(n,r)?Qe:xe:Ve,Be={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},te=e.create(n=>({...Be,reset:()=>{n(Be)},updatePage:r=>{n(r)}}));function ke({currentPage:n,pages:r}){const{avStream:t,recordingMediaTypes:o,updatePage:i}=te.getState(),{recorderEventEmitter:s}=e.useConfig.getState();s.emit("av.permission",{"permission.descriptors":n.permissionDescriptors,"stream.ready":(l,d)=>{if(t===l)return;let a=n;if(l&&!n.permissionDescriptors.includes("camera")){const u=r.indexOf(n),C=d!=null&&d.active?u+2:u+1;d!=null&&d.active&&o&&s.emit("begin.recording",{"recording.media.types":o,"start.recording.callback":b=>i({mediaRecordingUids:b})}),a=r[C]}i({currentPage:a,avStream:l})}})}function we({status:n}){const{nextQuestion:r,passthroughData:t,mediaRecordingUids:o,reset:i}=te.getState(),{recorderEventEmitter:s,handleUploadUpdate:l,index:d}=e.useConfig.getState(),a={value:{taskStatus:n},type:"recordedtask",questionId:(t==null?void 0:t.questionId)||1};t&&s.emit("finish.task",{"begin.callback":u=>{l({mediaRecordingUid:u,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(u,C)=>{l({mediaRecordingUid:u,progressPct:C.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":u=>{u&&l({mediaRecordingUid:u,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":t,"current.index":d,"task.response":a,"task.complete.callback":u=>{a.value.taskDurationMillisecond=u,o&&(a.value.mediaRecordingUids=o),i(),r(a)}})}function je({pages:n,setIsRequestingPermission:r}){const{recorderEventEmitter:t,eventEmitFn:o}=e.useConfig.getState(),{updatePage:i,currentPage:s,recordingMediaTypes:l,screenPermissionRequested:d}=te.getState();if(!s)return;const a=n.indexOf(s);switch(s.type){case"av_permission":{const u=d?a+2:a+1;return d&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":C=>{i({mediaRecordingUids:C})}}),void i({currentPage:n[u]})}case"screen_permission":return void t.emit("screen.permission",{"screen.permission.requested":r,"stream.ready.callback":(u,C)=>{const b=C?n[a+1]:s;C&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":m=>{i({captureStream:C,mediaRecordingUids:m})}}),i({currentPage:b,screenPermissionRequested:!0,captureStream:C})}});case"start_task":return o("recorded.task.start"),t.emit("recorded.task.start"),t.emit("start.task"),void i({currentPage:n[a+1],screenPermissionRequested:!0});case"complete_task":return}}const Ge="ul-permission-graphics-container",Ze="ul-permission-body",We=e.cc(Ge,"ul_recorded-task-inset-spacing"),pe=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),Ye=({richTextBody:n})=>e.u(j.Html,{className:"ul-rich-text-body",html:n,id:"ul-task-detail-container"}),me=({required:n,skipButtonText:r,bottom:t=!1})=>n?null:e.u(j.Button,{className:e.cc(t&&"ul-skip-button-below","ul-button-inactive"),onClick:we.bind(null,{status:"abandoned"}),children:r||"Skip"}),Te=n=>{const{avStream:r,captureStream:t,recordingMediaTypes:o,updatePage:i}=te.getState(),s=(o==null?void 0:o.includes("audio"))||(o==null?void 0:o.includes("video"));e.p(()=>{const l=setInterval(()=>{s&&r&&!r.active?i({avStream:null,currentPage:n[0]}):t&&t.active||i({captureStream:void 0,currentPage:n[s?1:0]})},1e3);return()=>clearInterval(l)},[r,t,s,n,o,i])},fn=({content:n,pages:r,required:t})=>{const{buttonText:o,skipButtonText:i,taskDetail:s}=n;return Te(r),e.u("div",{className:"ul-task-page",children:[s&&e.u(Ye,{richTextBody:s}),e.u("div",{className:pe,children:[e.u(j.Button,{onClick:je.bind(null,{pages:r}),children:o}),e.u(me,{required:t,skipButtonText:i})]})]},"start-task")},yn=({content:n,pages:r,properties:t})=>{const{buttonText:o,skipButtonText:i}=n;return Te(r),e.u("div",{className:"ul-task-page",children:[n.taskDetail&&e.u(Ye,{richTextBody:n.taskDetail}),e.u(j.MobileEmbedView,{properties:t,children:e.u("div",{className:pe,children:[e.u(j.Button,{className:"ul-complete-task-button",onClick:we.bind(null,{status:"completed"}),children:o}),e.u(j.Button,{className:e.cc("ul-button-inactive"),onClick:we.bind(null,{status:"given.up"}),children:i})]})})]},"complete-task")},Cn=({content:n,pages:r,required:t})=>{const{buttonText:o,skipButtonText:i}=n,[s]=e.useConfig(a=>[a.tabTitle]),[l,d]=e.h(!1);return e.u("div",{children:[e.u("div",{className:We,children:[e.u("p",{style:{marginTop:"auto"},children:n.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Ze,children:s})})]}),e.u("div",{className:t?"":pe,children:[e.u(j.Button,{disabled:l,onClick:je.bind(null,{pages:r,setIsRequestingPermission:d}),children:o}),e.u(me,{required:t,skipButtonText:i})]})]})},xn=({content:n})=>e.u(j.Html,{className:e.cc(Ge,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:n.svg},"ul-permission-request-graphic"),kn=({content:n,pages:r,required:t})=>{const{permissionDeniedHeadline:o,permissionDeniedBody:i,skipButtonText:s,tryAgainButtonText:l}=n,d=ue(r[0])?r[0]:null;return e.p(()=>{const a=setInterval(()=>{d!==null&&ke({currentPage:d,pages:r})},1e3);return()=>clearInterval(a)},[d,r]),d?e.u("div",{children:[e.u("div",{className:We,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:o}),e.u("span",{className:Ze,children:i})]})}),e.u("div",{className:pe,children:[e.u(j.Button,{onClick:ke.bind(null,{currentPage:d,pages:r}),children:l}),e.u(me,{required:t,skipButtonText:s})]})]}):null},wn=({stream:n})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:r=>{r&&(r.srcObject=n||null)}}),En=({content:n,pages:r,required:t})=>{const{skipButtonText:o}=n,{avStream:i}=te.getState();return Te(r),e.u("div",{children:[e.u(wn,{stream:i}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(j.Button,{onClick:je.bind(null,{pages:r}),children:n.buttonText}),e.u(me,{bottom:!0,required:t,skipButtonText:o})]})]})},jn=({properties:n})=>{const{pages:r,required:t}=n,{avStream:o,currentPage:i}=te.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case"av_permission":{const s=ze(o,i);return s===xe?e.u(xn,{content:i}):s===Ve?e.u(kn,{content:i,pages:r,required:t}):e.u(En,{content:i,pages:r,required:t})}case"screen_permission":return e.u(Cn,{content:i,pages:r,required:t});case"start_task":return e.u(fn,{content:i,pages:r,required:t});case"complete_task":return e.u(yn,{content:i,pages:r,properties:n});default:return null}},Tn=({className:n,properties:r,next:t,questionId:o})=>{const i=e.useConfig(),{surveyId:s,responseGroupUid:l,userId:d}=i,a=te(),{screenPermissionRequested:u}=a,C=te(f=>f.avStream);let b=te(f=>f.currentPage);b||(b=function({pages:f,userId:x,responseGroupUid:S,surveyId:E,questionId:I,next:_}){const{updatePage:O}=te.getState(),{eventEmitFn:F,recorderEventEmitter:p}=e.useConfig.getState(),h={questionId:I,surveyId:E,visitorId:x,responseGroupUid:S};let D=0;p.emit("recorded.task.permission.screen"),F("recorded.task.permission.screen"),p.emit("permission.status",{"permission.status.callback":(g,c,T,w)=>{const B=f[D],{type:M}=B,P=["screen"];if(ue(B)){const{permissionDescriptors:U}=B,z=U==null?void 0:U.includes("microphone"),G=U==null?void 0:U.includes("camera");z&&P.push("audio"),G&&P.push("video"),(g!=null&&g.active&&!G||g!=null&&g.active&&c)&&D++}Pe(f[D])&&T&&(D++,p.emit("begin.recording",{"recording.media.types":P,"start.recording.callback":U=>O({mediaRecordingUids:U})})),O({currentPage:f[D],avStream:g,screenPermissionRequested:T,nextQuestion:_,type:M,passthroughData:h,recordingMediaTypes:P,captureStream:w})}});const v=f[D];return v.type==="av_permission"&&ke({currentPage:v,pages:f}),v}({questionId:o,surveyId:s,next:f=>{t(f,!0)},pages:r.pages,responseGroupUid:l,userId:d}));let m=b.headline,y=b.captionText;const L=ze(C,b);return Pe(b)&&u&&(m=b.permissionDeniedHeadline,y=b.permissionDeniedCaptionText),ue(b)&&L===Qe&&(m=b.permissionGrantedHeadline,y=b.permissionGrantedCaptionText),e.u("div",{className:e.cc(n,"ul-center-horizontally","fade-in-transition"),children:[e.u(j.Header,{isRequired:r==null?void 0:r.required,message:m,properties:{captionText:y}}),e.u(j.QuestionBodyWrapper,{children:e.u(jn,{properties:r})})]})},In=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{visitorAttributes:l,isLongFormSurvey:d}=e.useConfig(b=>({visitorAttributes:b.visitorAttributes,isLongFormSurvey:Y.isLongFormSurvey(b.studyType)})),a=(b,m=!1)=>{r({value:m?{skipped:!0}:void 0,questionId:o,type:i},!0)},u=j.getAttributedUrl(t&&t.buttonUrl,l),C=d&&t.promptActionType===e.PromptActionTypeEnum.NO_BUTTON;return e.u("div",{className:e.cc(n,"ul-card__text-url-prompt","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:t,children:!s&&!C&&e.u("div",{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:u,id:"ul-card-text__button",onClick:a,onKeyPress:b=>{b.key!=="Enter"&&b.key!==" "||r({value:void 0,questionId:o,type:i},!0)},rel:"noreferrer",role:u?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(t)}),t.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:b=>a(0,!0),children:e.getSkipButtonText(t)})]})})})},o)},_n=({className:n,questionId:r})=>{const{border:t,destroy:o,endCard:i,forceBrandedLogo:s,quotaEndcardText:l}=e.useConfig(C=>({border:C.border,destroy:C.destroy,endCard:C.endCard,forceBrandedLogo:C.forceBrandedLogo,quotaEndcardText:C.quotaEndcardText}));e.p(()=>{setTimeout(()=>{o(Y.APP_ID)},s?4e3:2e3)},[o,s]);const d=(l==null?void 0:l.subheader)??(i==null?void 0:i.subheader),a=d?e.u("p",{className:"ul-caption",children:d}):null,u=(l==null?void 0:l.headline)??(i==null?void 0:i.headline)??"";return e.u("div",{className:e.cc(n,"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:t,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:t,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(j.Header,{message:u}),a]})})},r)},Dn=()=>e.u("div",{className:"thinking-dots-container",children:e.u("div",{className:"thinking-dot"})}),Sn=({className:n})=>{const{uploadProgress:r}=e.useConfig(s=>({uploadProgress:s.uploadProgress}));let t,o;Object.values(r).filter(s=>s.isSubmitted).length>1?(t="Your responses are processing",o="Please keep this tab open until your responses are fully processed."):(t="Your response is processing",o="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(r).filter(s=>s.isSubmitted).map(s=>s.progressPct||0)));return e.u("div",{className:e.cc(n,"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(j.Header,{message:`${t} (${i}% complete)`}),e.u("p",{className:"ul-caption",children:o})]})},Me=0,Rn=1,Ln=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{apiURL:l,envId:d,handleUploadUpdate:a,headers:u,responseGroupUid:C,surveyId:b,viewDocument:m,visitorId:y,cards:L}=e.useConfig(g=>({apiURL:g.apiURL,envId:g.envId,handleUploadUpdate:g.handleUploadUpdate,headers:g.headers,responseGroupUid:g.responseGroupUid,surveyId:g.surveyId,viewDocument:g.viewDocument,visitorId:g.userId,cards:g.cards})),[f,x]=e.h(!1),[S,E]=e.h(null),[I,_]=e.h(null),[O]=e.h(Me),F=e.getButtonText(t),p=e.isLastQuestion(o,L);if(s)return null;const h=`ul-card-video__player_recorder-q${o}`,D=(g,c)=>{g===q.UPLOAD_STARTED?(E(c[q.UPLOAD_ID]),_(c[q.MEDIA_RECORDING_UID]),x(!0)):g===q.DELETE?(E(null),_(null),x(!1)):g===q.UPLOAD_PROGRESS?isNaN(c[q.UPLOAD_PROGRESS_PCT])?a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],isComplete:!0}):a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],progressPct:c[q.UPLOAD_PROGRESS_PCT]}):g===q.UPLOAD_FINISHED&&a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],isComplete:!0})},v=g=>{g.preventDefault(),g.stopPropagation(),document.getElementById(h)&&Le(h),S&&I?(a({mediaRecordingUid:I,isSubmitted:!0}),r({value:{mediaRecordingUid:I},questionId:o,type:i},!0)):r({value:null,questionId:o,type:i},!0)};return e.u("form",{className:e.cc(n,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[e.u(j.QuestionBodyWrapper,{children:!s&&e.u("div",{id:"ul-question-player-container",style:{display:O===Me?"":"none"},children:e.u(j.MobileEmbedView,{properties:t,children:[e.u(oe,{isDisabled:!f,onClick:()=>{Le(),r({value:{uploadId:S,mediaRecordingUid:I},questionId:o,type:i},!0)},showCheckmark:p,children:F}),e.u("div",{style:{display:O===Rn?"block":"none"},children:e.u("div",{id:"ul-recorder-player-container",ref:g=>{if(g&&g.children.length===0){const c=((T,w={},B="https://api.userleap.com",M,P,U,z=!1,G=document)=>{R.document=G;const Z=T+qe,X=Fe(Z);return R.document.addEventListener("securitypolicyviolation",ee=>{re(new Error(`Voice & Video feature violates ${ee.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",B,U,w.visitorId,w.envId)}),Oe(Ne.concat(Je),()=>{ye(Z,X),R.document.getElementById(Ee(Z)).remove();try{en(X,Z,w,B,M,P,U,z)}catch(ee){return void re(new Error(`Error when creating video recorder player object ${ee}`),"recorderDeviceError",B,U,w.visitorId,w.envId)}}),X})(h,{surveyId:b,responseGroupUid:C,questionId:o,visitorId:y,envId:d},l,D,void 0,{...u,"x-ul-video-recorder-origin":"sdk"},t.mediaType===q.MEDIA_TYPE_AUDIO,m);g.appendChild(c)}}})})]})})}),!s&&e.u(j.QuestionBodyFooterContainer,{children:[e.u(oe,{isDisabled:!!t.required&&!f,onClick:v,showCheckmark:p,children:e.getButtonText(t)}),e.u("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:v,style:{...t.required?{display:"none"}:{},...f?{display:"none"}:{}},children:e.getSkipButtonText(t)})]})]})},de=n=>n.type==="aidynamicfollowup"||n.type==="aidynamicstandalone",fe=n=>{var r;return de(n)&&((r=n.props)==null?void 0:r.loading)===e.DynamicQuestionLoadingStates.inFlight},Ke=n=>n.type==="thanks"||n.type==="uploading",Pn=({card:n,avatars:r,isThinking:t,isCurrentQuestion:o,currentQuestionBubbleRef:i})=>{const s=(d=>"properties"in d.props&&d.props.properties&&"questionHtml"in d.props.properties&&d.props.properties.questionHtml?{content:d.props.properties.questionHtml,image:d.props.properties.image,isHtml:!0}:"message"in d.props?"image"in d.props.properties&&d.props.properties.image?{content:d.props.message,image:d.props.properties.image,isHtml:!1}:{content:d.props.message,isHtml:!1}:{content:"Question",isHtml:!1})(n),l=o&&!(s!=null&&s.image)?i:null;return e.u(e.g,{children:[(s==null?void 0:s.image)&&e.u(ae,{avatars:r,isLeft:!0,ref:o?i:null,children:!t&&e.u(j.DisplayQuestionImage,{image:s.image,isConversationalUi:!0})}),e.u(ae,{avatars:r,isLeft:!0,message:{id:`question-${n.name}`,type:"question",content:s.content},ref:l,children:t?e.u(Dn,{}):e.u(e.g,{children:[s.isHtml?e.u(j.Html,{className:"chat-message-text",html:s.content}):e.u("div",{className:"chat-message-text",children:s.content}),n.type==="videovoice"&&e.u(on,{properties:n.props,questionId:n.name,surveyVideoUrl:n.props.properties.videoUrl})]})})]})},Bn=({card:n,avatars:r})=>{const t=(o=>{if(!("properties"in o.props)||!o.props.properties||typeof o.props.properties!="object")return null;const i=o.props.properties,s=[{key:"captionHtml",isHtml:!0},{key:"captionText",isHtml:!1},{key:"richTextBody",isHtml:!0},{key:"body",isHtml:!1}];for(const{key:l,isHtml:d}of s){const a=i[l];if(typeof a!="string")continue;const u=a.trim();if(u){if(d&&!u.replaceAll(/<[^>]*>/g,"").trim())continue;return{content:u,isHtml:d}}}return null})(n);return t?e.u(ae,{avatars:r,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:t.content},children:t.isHtml?e.u(j.Html,{className:"chat-message-text",html:t.content}):e.u("div",{className:"chat-message-text",children:t.content})}):null},Mn=()=>{const{providerPersona:n,showProviderPersona:r,experimentFlags:t}=e.useConfig(i=>({providerPersona:i.providerPersona,showProviderPersona:i.showProviderPersona,experimentFlags:i.experimentFlags}));return(t==null?void 0:t["sdk-new-convo-ui"])&&r&&n?e.u("div",{className:"chat-persona-label",children:n}):null},Nn=({card:n,userResponse:r,avatars:t})=>{const o=((i,s)=>{if((i.type==="open"||i.type==="aidynamicfollowup"||i.type==="aidynamicstandalone")&&s&&typeof s=="object"&&"value"in s)return s.value})(n,r);return e.u("div",{className:"chat-bubble-container chat-right",children:[e.u("div",{className:"chat-bubble chat-bubble-right chat-bubble-text-only",children:e.u("div",{className:"chat-message-text",children:o||e.u("div",{className:"chat-message-no-response",children:"No response"})})}),e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${t.respondentAvatar["1x"]} 1x, ${t.respondentAvatar["2x"]} 2x`})]})},qn=({card:n,avatars:r,isCurrentQuestion:t,currentQuestionBubbleRef:o})=>{const{endCard:i,quotaEndcardText:s}=e.useConfig(a=>({endCard:a.endCard,quotaEndcardText:a.quotaEndcardText})),l=(s==null?void 0:s.headline)??(i==null?void 0:i.headline)??"Great! Thank you for your participation.",d=(s==null?void 0:s.subheader)??(i==null?void 0:i.subheader);return e.u(e.g,{children:[e.u(ae,{avatars:r,isLeft:!0,message:{id:`thanks-${n.name}`,type:"question",content:l},ref:t?o:null}),d&&e.u(ae,{avatars:r,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:d}}),e.u(ln,{})]})},On=({card:n,cardIndex:r,index:t,avatars:o,cardResponses:i,questionThinkingStates:s,startingQuestionIdx:l,currentQuestionBubbleRef:d,handleCardResponse:a})=>{const u=r===t,C=r<t,b=Ke(n);if(b)return e.u(qn,{avatars:o,card:n,currentQuestionBubbleRef:d,isCurrentQuestion:u});const m=`${n.name}`,y=i.get(m),L=n.type==="open"||n.type==="aidynamicfollowup"||n.type==="aidynamicstandalone",f=s.get(m);if(n.type==="aidynamicfollowup"&&(n.props.loading===e.DynamicQuestionLoadingStates.failure||n.props.loading===void 0)||n.type==="aidynamicstandalone"&&n.props.loading===e.DynamicQuestionLoadingStates.failure)return e.u(e.g,{});const x=(r>(l??0)||de(n))&&n.type!=="thanks"&&n.type!=="uploading"&&(f===!0||f===void 0);return e.u(e.wn.Fragment,{children:[e.u(Pn,{avatars:o,card:n,currentQuestionBubbleRef:d,isCurrentQuestion:u,isThinking:x}),!x&&e.u(e.g,{children:[e.u(Bn,{avatars:o,card:n}),e.u(Mn,{})]}),C&&L?e.u(Nn,{avatars:o,card:n,userResponse:y}):(!C||!L)&&!x&&e.u(ae,{avatars:o,isLeft:!1,message:{id:`card-${n.name}`,type:"card",content:""},children:e.u("div",{className:"chat-card-container",children:e.u(An,{card:n,className:b?"chat-thanks-card":"chat-card",isAnswered:C,next:u?a:()=>{}})})})]},`question-card-${n.name}`)},ae=e.wn.forwardRef(({message:n,isLeft:r=!1,children:t,avatars:o,hideAvatar:i=!1},s)=>{const l=r?"chat-bubble-left":"chat-bubble-right";return e.u("div",{className:`chat-bubble-container ${r?"chat-left":"chat-right"}${r&&i?" chat-no-avatar":""}`,ref:s,children:[r&&!i&&e.u("img",{alt:"AI Avatar",className:"chat-avatar chat-avatar-left",srcSet:`${o.agentAvatar["1x"]} 1x, ${o.agentAvatar["2x"]} 2x`}),e.u("div",{className:`chat-bubble ${l}`,children:t||e.u("div",{className:"chat-message-text",children:n==null?void 0:n.content})}),!r&&!i&&e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${o.respondentAvatar["1x"]} 1x, ${o.respondentAvatar["2x"]} 2x`})]})});ae.displayName="ChatBubble";const Un=()=>{const n=e.useConfig(t=>t.close),r=e.F(()=>()=>n(Y.APP_ID),[n]);return e.u("div",{"aria-label":"Close button",className:"conversational-close-btn",onClick:r,onKeyPress:t=>{t.key==="Enter"&&r()},role:"button",tabIndex:0,children:e.u("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})},An=({card:n,next:r,className:t="",isAnswered:o=!1})=>{const i={className:o?`${t} answered-card`:t,next:o?()=>{}:r,questionId:n.name,type:n.type,isAnswered:o};switch(n.type){case"consentlegal":return e.u(an,{...i,...n.props});case"likert":return e.u(cn,{...i,...n.props});case"matrix":return e.u(pn,{...i,...n.props});case"multiplechoice":return e.u(mn,{...i,...n.props});case"multipleselect":return e.u(vn,{...i,...n.props});case"nps":return e.u(gn,{...i,...n.props});case"aidynamicstandalone":case"aidynamicfollowup":case"open":return e.u(hn,{...i,type:n.type,...n.props});case"rankorder":return e.u(bn,{...i,...n.props});case"recordedtask":return e.u(Tn,{...i,...n.props});case"texturlprompt":return e.u(In,{...i,...n.props});case"thanks":return e.u(_n,{...i,...n.props});case"uploading":return e.u(Sn,{...i,...n.props});case"videovoice":return e.u(Ln,{...i,...n.props});default:return null}};exports.default=({cards:n,next:r,previousResponses:t})=>{const{cardResponses:o,setCardResponse:i}=(()=>{const[p,h]=e.h(new Map);return{cardResponses:p,setCardResponse:e.T((D,v)=>{h(g=>new Map(g).set(D,v))},[])}})(),{index:s,isLongFormSurvey:l,avatars:d,showSurveyBrand:a,forceBrandedLogo:u,marketingUrlLink:C,startingQuestionIdx:b,viewDocument:m,createDynamicFollowupQuestion:y,update:L}=e.useConfig(p=>({index:p.index,isLongFormSurvey:Y.isLongFormSurvey(p.studyType),avatars:p.avatars,forceBrandedLogo:p.forceBrandedLogo,startingQuestionIdx:p.startingQuestionIdx,showSurveyBrand:p.showSurveyBrand,marketingUrlLink:e.buildMarketingUrl({marketingUrl:p.marketingUrl,slugName:p.slugName,surveyId:p.surveyId,forceBrandedLogo:p.forceBrandedLogo}),viewDocument:p.viewDocument,createDynamicFollowupQuestion:p.createDynamicFollowupQuestion,update:p.update})),{currentQuestionBubbleRef:f,scrollToCurrentQuestion:x}=(({viewDocument:p})=>{const h=e._(null),D=e.T(()=>{const v=p.querySelector(".ul-card-main-content");if(h.current&&v&&v instanceof HTMLElement){const g=h.current.offsetTop-v.offsetTop-16;v.scrollTo({top:Math.max(0,g),behavior:"smooth"})}},[]);return{currentQuestionBubbleRef:h,scrollToCurrentQuestion:D}})({viewDocument:m}),S=((p,h,D)=>{const[v,g]=e.h(new Map);return e.p(()=>{if(p.length>0&&h<p.length){const c=p[h],T=`${c.name}`,w=M=>{if(h>0){const P=p[h-1];if(de(P)){const U=`${P.name}`,z=fe(P);if(M.get(U)!==z)return new Map(M).set(U,z)}}return M};if((h<=(D??0)||Ke(c))&&(c==null?void 0:c.type)!=="aidynamicstandalone")return g(M=>w(new Map(M).set(T,!1)));g(M=>{const P=!de(c)||fe(c);return w(new Map(M).set(T,P))});const B=setTimeout(()=>{g(M=>{const P=!!de(c)&&fe(c);return w(new Map(M).set(T,P))})},1e3);return()=>clearTimeout(B)}},[h,p,D]),v})(n,s,b);((p,h)=>{const{createDynamicStandaloneQuestion:D}=e.useConfig(c=>({createDynamicStandaloneQuestion:c.createDynamicStandaloneQuestion})),v=p[h],g=(v==null?void 0:v.type)==="aidynamicstandalone"&&v.props.loading===void 0?v.name:null;e.p(()=>{g!==null&&D({questionId:g})},[g,D])})(n,s);const E=((p,h)=>{const[D,v]=e.h(()=>new Set([p]));return e.p(()=>{v(g=>new Set(g).add(p))},[p]),e.p(()=>{const g=h??0;g>0&&v(c=>{const T=new Set(c);for(let w=0;w<=g;w++)T.add(w);return T})},[h]),D})(s,b),I=e.F(()=>({...t,...e.buildReadableResponseMap(n.map((p,h)=>{var D,v;return{...p,value:h<s?((D=o.get(`${p.name}`))==null?void 0:D.value)??null:null,secondaryValue:h<s?((v=o.get(`${p.name}`))==null?void 0:v.secondaryValue)??null:null}}))}),[t,o,n,s]);j.useSetAllResponsesRaw(I);const _=e.pipeReadableResponsesIntoCards(n,I);e.p(()=>{requestAnimationFrame(()=>{x()}),L()},[s,x,S,L]);const O=e.T((p,h)=>{if(!h)return;const D=_[s];if(!D)return;const v=`${D.name}`;i(v,p);const g={...p,questionText:e.getProcessedQuestionText(D)};D.childId&&(g==null?void 0:g.value)!=null&&e.triggerFollowUpQuestionGeneration({displayCard:D,response:g,createDynamicFollowupQuestion:y}),r([g])},[_,s,r,i]),F=_.map((p,h)=>({card:p,cardIndex:h})).filter(({cardIndex:p})=>E.has(p));return e.u("div",{className:"conversational-ui ul-conversational-ui","data-testid":"ui-container",children:[!l&&e.u(Un,{}),e.u("div",{className:"chat-container",children:e.u("div",{className:"chat-messages",children:F.map(({card:p,cardIndex:h})=>e.u(On,{avatars:d,card:p,cardIndex:h,cardResponses:o,currentQuestionBubbleRef:f,handleCardResponse:O,index:s,questionThinkingStates:S,startingQuestionIdx:b},`question-card-${p.name}`))})}),l&&e.u("div",{className:"long-form-question-footer-container-logo",children:a&&e.u(e.SprigBrandLogo,{forceBrandedLogo:u,marketingUrlLink:C})})]})};
|
|
658
|
+
`}],De="-secondary-video-player",qe="-video-recorder";let ne,Se;const ie=async({event:n,apiBase:r,headers:t,visitorId:o,envId:i,metadata:s})=>{const l=R.document.documentElement;if(!o||!i)return;const d={event:`SDK - ${n}`,visitorId:o,environmentId:i,metadata:{...s||{},screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language}};(await fetch(`${r}/sdk/1/visitors/${o}/analytics`,{method:"POST",cache:"no-cache",headers:t,body:JSON.stringify(d)})).ok||console.warn("[Sprig] (ERR-444) Failed to track analytics",n)},re=async(n,r,t,o,i,s)=>{ie({event:`Video Error ${r}`,apiBase:t,headers:o,visitorId:i,envId:s,metadata:{errorMessage:n.message}});const l=R.document.documentElement,d={screenWidth:window.screen.width,screenHeight:window.screen.height,clientWidth:l.clientWidth,clientHeight:l.clientHeight,location:window.location.href,language:navigator.language},a={action:r,err:{message:n.message,stack:n.stack},meta:d,vid:i,envId:s};(await fetch(`${t}/sdk/1/errors`,{method:"POST",cache:"no-cache",headers:{...o,"userleap-platform":"video_recorder","x-ul-error":window.btoa(`userleap-${Date.now()}-error`)},body:JSON.stringify(a)})).ok||console.warn("[Sprig] (ERR-444) Failed to report error to API",n)},Oe=(n,r)=>{if(n.length===0)return r&&r();Promise.all(n.reduce((t,o)=>(t.push(((i,{type:s,content:l})=>new Promise(function(d,a){let u;s==="script"?(u=R.document.createElement("script"),u.src=l):s==="link"?(u=R.document.createElement("link"),u.rel="stylesheet",u.href=l,u.type="text/css"):(u=R.document.createElement("style"),u.innerHTML=l),u.onload=function(){d(l)},u.onerror=function(){a(l)},u.async=!1,u.id=btoa(l),i.appendChild(u)}))(R.document.head,o)),t),[])).then(()=>{R.videojs=R.document.defaultView.videojs,r&&r()}).catch(function(t){console.log(t+" failed to load")})},Re=(n,r,t)=>{if(r==="start"&&(n.style.visibility="visible"),r==="none")n.style.visibility=Z;else if(r==="success")n.style.visibility=Z,n.innerHTML="Upload succeeded!";else{const o=Math.round(parseFloat(t));n.innerHTML=`Uploading <span class="ul-upload-progress-label__time">${o}%</span>`,n.style.background=`linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${o}%, #FCFCFD ${o}%, #FCFCFD 100%)`}},be=(n,r)=>{const t=R.videojs(n.id());return t==null?void 0:t.payload[r]},Ue=(n,r)=>{const t=new(R.videojs.getComponent("Component"))(n);return t.addClass("ul-buttons-panel"),r.map(o=>{t.addChild(o)}),Xe(t),t},Xe=n=>{n.children().forEach(r=>{if(J[r.name_]){const t=ce(J[r.name_],`ul-${J[r.name_]}`);r.el_.appendChild(t)}})},ce=(n,r="")=>{const t=R.document.createElement("span");return t.className="ul-button-text",t.innerHTML=n,t.id=r,t},Ae=(n,r,t,o,i=!1,s)=>{n.addClass("ul-video-player");const l=new(R.videojs.getComponent("Component"))(n);l.addClass("ul-control-panel"),n.progressBar=l.addChild("ProgressControl"),t&&n.src(t),n.audioPlayerPlaceholder=new(R.videojs.getComponent("Component"))(n),n.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");const d=t&&t.src?rn(t.src):null;!t||!i&&d?(n.audioPlayerPlaceholder.hide(),R.document.getElementById(`${n.id()}_html5_api`).style.height="100%",d&&n.poster(d)):(n.children()[0].classList.add("vjs-hidden"),R.document.getElementById(`${n.id()}_html5_api`).style.height="0px"),n.on("play",()=>{i||!t||d||nn(n),s==null||s.play()}),n.on("pause",()=>{s==null||s.pause()}),n.on("seeked",()=>{s==null||s.currentTime(n.currentTime())}),n.on("ratechange",()=>{s==null||s.playbackRate(n.playbackRate())}),n.addChild(n.audioPlayerPlaceholder,{},1),l.addChild(r),n.addChild(l),o&&o(n)},en=(n,r,t,o,i,s,l,d=!1)=>{Se=Date.now();const a=Ce(r,{controls:!1,bigPlayButton:!1,fluid:!1,width:1280,height:720,playsinline:!0,plugins:{record:{audio:!0,video:{mandatory:{minWidth:1280,minHeight:720}},frameWidth:1280,frameHeight:720,maxLength:600,autoMuteDevice:!0}}});if(!a)return;a.payload=t;const{surveyId:u,questionId:C,responseGroupUid:b,visitorId:m,envId:y}=t;let L;const f=v=>{const g=ge,c=ge+"-audio-only";Re(a.uploadProgressLabel,"none"),ne&&ne.startTime>=Se&&ne.abort();const T=R.document.getElementById("ul-camera-button");v?(a.children()[0].classList.add("vjs-hidden"),I.removeClass(g),I.addClass(c),T.innerHTML=J.TurnOnCamera,a.audioPlayerPlaceholder.removeClass("vjs-hidden"),L==null||L.getTracks().forEach(w=>{w.stop()}),window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then(w=>{L=w,w.getVideoTracks().forEach(M=>{M.enabled=!1}),a.record().onDeviceReady(w)}).catch(a.record().onDeviceError.bind(a.record()))):(L==null||L.getVideoTracks().forEach(w=>{w.enabled=!0}),a.children()[0].classList.remove("vjs-hidden"),a.record().getDevice(),I.removeClass(c),I.addClass(g),T.innerHTML=J.TurnOffCamera,a.audioPlayerPlaceholder.addClass("vjs-hidden"))},x=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{x.hasClass(Z)||(ie({event:"Video Delete Button Clicked",apiBase:o,headers:l,visitorId:m,envId:y,metadata:{questionId:C,responseGroupUid:b,surveyId:u}}),f(a.cameraOff),i(q.DELETE,{}),I.removeClass(Z),x.addClass(Z))}});x.addClass("ul-video-recorder-delete-button"),x.el_.appendChild(ce(J.DeleteButton,"ul-delete-button"));const S=R.document.getElementById(r),E=()=>{S.classList.contains("vjs-fullscreen")&&a.cameraOff?S.style.display="table":S.style.display="flex"};E();const I=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{a.record().isRecording()||(a.cameraOff=!a.cameraOff,ie({event:"Video Camera Button Clicked",apiBase:o,headers:l,visitorId:t.visitorId,envId:t.envId,metadata:{questionId:C,responseGroupUid:b,surveyId:u,cameraOff:a.cameraOff}}),f(a.cameraOff),!x.hasClass(Z)&&x.addClass(Z),i(q.DELETE,{}),E())}});I.addClass(ge),I.el_.appendChild(ce(J.TurnOffCamera,"ul-camera-button"));const _=new(R.videojs.getComponent("Button"))(a,{clickHandler:()=>{const v=R.document.getElementById("ul-recorder-toggle");if(a.record().isRecording())a.record().stop(),v&&(v.innerHTML=J.RecordButton),_.removeClass(he),x.removeClass(Z);else{const g=R.document.getElementById("ul-recording-countdown-screen");if(g)g.remove(),v&&(v.innerHTML=J.RecordButton),f(a.cameraOff),i(q.DELETE,{}),I.removeClass(Z),x.addClass(Z),_.removeClass(he),p.show();else{_.addClass(he),p.hide(),I.addClass(Z),x.addClass(Z),v&&(v.innerHTML=J.StopButton);const c=R.document.createElement("div");c.id="ul-recording-countdown-screen",S.insertBefore(c,S.children[1]),c.style.height=`${S.offsetHeight}px`,He(a,3)}}}});_.addClass("ul-video-recorder-toggle-button"),_.el_.appendChild(ce(J.RecordButton,"ul-recorder-toggle"));const O=R.document.createElement("p");O.style.visibility="hidden",O.className="ul-upload-progress-label",n.appendChild(O),a.uploadProgressLabel=O;const F=Ue(a,[x,I,"PlayToggle",_,"FullscreenToggle"]),p=F.children().find(v=>v.name_==="FullscreenToggle");p.hasClass("vjs-disabled")&&p.hide();const h=F.children().find(v=>v.name_==="PlayToggle");h.hide(),x.addClass(Z),Ae(a,F,s,!1,d),a.on("stopRecord",()=>{_.hide(),h.show(),p.show(),x.removeClass(Z)}),a.on("deviceReady",()=>{_.show(),h.hide(),x.addClass(Z)}),((v,g,c,T,w)=>{const{surveyId:M,responseGroupUid:B,visitorId:P,envId:U}=v.payload;v.on("deviceError",function(){console.warn("device error: ",v.deviceErrorCode),v.deviceErrorCode.message==="Permission denied"?(v.deviceButton.addClass("permission-denied"),c&&c(q.ERROR,{type:q.PERMISSION_DENIED}),ie({event:"Video Permission Denied",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{questionId:be(v,ve),responseGroupUid:B,surveyId:M}})):(c&&c(q.ERROR,{type:q.OTHER}),re(new Error(v.deviceErrorCode.message),"recorderDeviceError",g,w,P,U))}),v.on("error",function(z,G){re(G||v.error(),"recorderError",g,w,P,U)}),v.on("startRecord",function(z,G){T(v.uploadProgressLabel,"none"),ie({event:"Video Record Start",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{questionId:be(v,ve),responseGroupUid:B,surveyId:M}})}),v.on("finishRecord",async function(){T(v.uploadProgressLabel,"start",0);const z=be(v,ve);if(!M){const k="internal error: missing fields in payload";return c&&c(q.ERROR,{type:q.OTHER}),re(new Error(k),"finishRecord",g,w,P,U),null}v.record().stopDevice();const G=v.cameraOff?q.MEDIA_TYPE_AUDIO:q.MEDIA_TYPE_VIDEO,W=Y.v4();ie({event:"Video Record Finish",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:W,questionId:z,responseGroupUid:B,surveyId:M,mediaType:G}});const X={surveyId:M,updatedAt:new Date().toISOString(),mediaType:G,mediaRecordingUid:W};z&&(X.questionId=z),B&&(X.responseGroupUid=B),P&&(X.visitorId=P);const ee=await(async()=>{const k=await fetch(`${g}/2/environments/integrations/upload`,{method:"POST",cache:"no-cache",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)});if(k.ok){const A=await k.json();return c&&c(q.UPLOAD_STARTED,{[q.UPLOAD_ID]:A.upload.id,[q.MEDIA_TYPE]:G,[q.MEDIA_RECORDING_UID]:W}),A.upload.url}return c&&c(q.ERROR,{type:q.OTHER,response:k}),re(new Error("failed to get upload response with url"),"finishRecord",g,w,P,U),null})();ee&&(ne=R.document.defaultView.UpChunk.createUpload({endpoint:ee,file:new R.document.defaultView.File([v.recordedData],`recording ${G} ${Date.now()}`),chunkSize:5120}),ne.startTime=Date.now(),ie({event:"Video Upload Start",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:W,questionId:z,responseGroupUid:B,surveyId:M,mediaType:G,url:ee}}),ne.on("error",k=>{T(v.uploadProgressLabel,"none"),c&&c(q.UPLOAD_FINISHED,{[q.MEDIA_RECORDING_UID]:W}),re(k,"finishRecord",g,w,P,U)}),ne.on("progress",k=>{c&&c(q.UPLOAD_PROGRESS,{[q.MEDIA_RECORDING_UID]:W,[q.UPLOAD_PROGRESS_PCT]:k.detail}),T(v.uploadProgressLabel,"progress",k.detail)}),ne.on("success",()=>{T(v.uploadProgressLabel,"success"),c&&c(q.UPLOAD_FINISHED,{[q.MEDIA_RECORDING_UID]:W}),ie({event:"Video Upload Success",apiBase:g,headers:w,visitorId:P,envId:U,metadata:{mediaRecordingUid:W,questionId:z,responseGroupUid:B,surveyId:M,mediaType:G,url:ee,elapsedMs:ne.startTime&&Date.now()-ne.startTime}})}))})})(a,o,i,Re,l);const D=[{name:"microphone"}];!a.cameraOff&&D.push({name:"camera"}),Promise.all(D.map(v=>{var g;return(g=navigator==null?void 0:navigator.permissions)==null?void 0:g.query(v)})).then(v=>{v.reduce((g,c)=>g&c.state==="granted",!0)&&a&&(a.deviceButton&&a.deviceButton.hide(),a.record().getDevice())}).catch(v=>{})},He=(n,r=3)=>{const t=R.document.getElementById("ul-recording-countdown-screen");t&&r===0?(t.remove(),n.record().start()):t&&(t.innerHTML=`<span class='ul-countdown-text'>Recording in... ${r}</span>`,setTimeout(()=>{He(n,r-1)},1e3))},Fe=n=>{const r=R.document.createElement("div");return r.className="ul-video-container",r.appendChild((t=>{const o=R.document.createElement("div");return o.className="ul-video-player-loading",o.id=Ee(t),["first","second","third","fourth"].map(i=>{const s=R.document.createElement("div");s.className=i,o.appendChild(s)}),o})(n)),r},ye=(n,r)=>{const t=R.document.createElement("video");t.id=n,t.className="video-js vjs-default-skin ul-video-player-video";const o=R.document.createElement("p");o.className="vjs-no-js",o.innerHTML="To view this video please enable JavaScript, and consider upgrading to a web browser that";const i=R.document.createElement("a");return i.href="https://videojs.com/html5-video-support/",i.target="_blank",i.innerHTML="supports HTML5 video",o.appendChild(i),t.appendChild(o),r.appendChild(t),r},nn=(n,r)=>{n.children()[0].classList.remove("vjs-hidden"),n.audioPlayerPlaceholder.hide(),R.document.getElementById(`${n.id()}_html5_api`).style.height="100%"},Ce=(n,r)=>R.document.getElementById(n)?r?R.videojs(n,r):R.videojs(n):(console.error(`Error in finding player element with ID, ${n}`),null),tn=(n,r,t,o=!1,i="https://api.sprig.com",s=document,l=null,d=null)=>{R.document=s;const a=n+"-video-player",u=Fe(a);return R.document.addEventListener("securitypolicyviolation",C=>{re(new Error(`Voice & Video feature violates ${C.violatedDirective} web page CSP policies for the question player.`),"playerDeviceError",i,{})}),Oe(Ne,()=>{R.document.getElementById(Ee(a)).remove(),ye(a,u);const C={playsinline:!0,playbackRates:[.5,1,1.5,2],fill:!0};try{const b=n+De;ye(b,u);const m=Ce(a,C),y=Ce(b,{muted:!0,...C});if(!m||!y)return;((x,S,E)=>{x.addClass(`ul${De}`);const I=new(R.videojs.getComponent("Component"))(x);S&&x.src(S),x.addChild(I),E&&E(x)})(y,l,d),l||y.addClass(Z);const L=Ue(m,["PlaybackRateMenuButton","PlayToggle","FullscreenToggle"]),f=L.children().find(x=>x.name_==="FullscreenToggle");f.hasClass("vjs-disabled")&&f.hide(),Ae(m,L,r,t,o,y)}catch(b){return void re(new Error(`Error when creating video player object ${b}`),"playerDeviceError",i,{})}}),u},Le=n=>{const r=n+qe;if(R.document.getElementById(r)&&R.videojs){try{if(!R.videojs(r).record().stream)return}catch{return}R.videojs(r).record().stop(),R.videojs(r).record().stopDevice()}},rn=n=>{if(!n)return null;const r=n.match(/https:\/\/stream.mux.com\/(.*)/);let t=r?r[1]:null;return t.includes(_e)&&(t=t.replace(_e,"")),t?`https://image.mux.com/${t}/thumbnail.jpg?time=0`:null},q={UPLOAD_STARTED:"upload.started",UPLOAD_PROGRESS:"upload.progress",UPLOAD_FINISHED:"upload.finished",DELETE:"delete",ERROR:"error",MEDIA_TYPE:"media.type",PERMISSION_DENIED:"permission_denied",OTHER:"other",UPLOAD_ID:"upload.id",UPLOAD_PROGRESS_PCT:"upload.progress.pct",MEDIA_RECORDING_UID:"media.recording.uid",MEDIA_TYPE_VIDEO:"video",MEDIA_TYPE_AUDIO:"audio"},J={PlaybackRateMenuButton:"Speed",PlayToggle:"Play",FullscreenToggle:"Expand",TurnOnCamera:"Turn on",TurnOffCamera:"Turn off",DeleteButton:"Delete",RecordButton:"Record",StopButton:"Stop",PauseButton:"Pause"},on=({properties:n,surveyVideoUrl:r,questionId:t})=>{const o=`ul-card-video__question_player-q${t}`,{apiURL:i,viewDocument:s}=e.useConfig(l=>({apiURL:l.apiURL,viewDocument:l.viewDocument}));return e.u("div",{id:o,ref:l=>{if((l==null?void 0:l.children.length)===0&&!n.properties.hideRecordedPrompt){const d=tn(o,{src:r,type:"application/x-mpegURL"},void 0,n.properties.mediaType===q.MEDIA_TYPE_AUDIO,i,s);l.appendChild(d)}}})},sn=()=>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"})}),oe=({isDisabled:n,onClick:r,children:t,style:o,showCheckmark:i})=>{const s=i??(typeof t=="string"&&t.toLowerCase()==="finish");return e.u(j.Button,{disabled:!!n,onClick:r,style:o,type:"button",children:[s&&e.u("span",{style:{paddingRight:"4px"},children:e.u(sn,{})}),t]})},an=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{useMobileStyling:l,border:d,cards:a}=e.useConfig(h=>({useMobileStyling:h.useMobileStyling,border:h.border,cards:h.cards})),[u,C]=e.h(!1),[b,m]=e.h(""),[y,L]=e.h(!1),f=t==null?void 0:t.collectName,x=(t==null?void 0:t.nameLabelText)||"Full Name",S=(t==null?void 0:t.consentText)||"I agree to the stated conditions",E=(t==null?void 0:t.submitButtonText)||"Submit",I=e.getButtonText({buttonText:E}),_=e.isLastQuestion(o,a),O=!!b.trim(),F=u&&(!f||O),p=(h,D=!1)=>{h.preventDefault(),h.stopPropagation();let v=null;if(!D){if(!F)return void L(!0);v={submitted:!0},f&&(v.name=b)}r({value:v,questionId:o,type:i},!!D||F)};return e.u("div",{className:e.cc(n,"ul-card__consent-legal","fade-in-transition"),children:e.u(j.MobileEmbedView,{embeddedType:"pdf",properties:t,children:e.u(j.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(j.Option,{allowTextEntry:!1,border:d,error:y&&!u,id:"consent",isRadio:!1,isSelected:u,label:S,onUserInputChanged:({selected:h})=>{h!==u&&C(!u)},useMobileStyling:l}),f&&e.u("input",{"aria-label":x,"aria-placeholder":x,className:e.cc(e.getClasses("ul-consent-legal__name-input",l)),"data-gramm":"false",maxLength:250,name:"name",onBlur:h=>{h.currentTarget.style.borderColor=y&&!O?Y.ERROR_BORDER_COLOR:Y.DEFAULT_BORDER_COLOR},onFocus:h=>{h.currentTarget.style.borderColor=y&&!O?Y.ERROR_BORDER_COLOR:d},onInput:h=>{h.preventDefault(),h.stopPropagation(),m(h.currentTarget.value)},placeholder:x,style:y&&!O?{borderColor:Y.ERROR_BORDER_COLOR}:{},tabIndex:0,value:b})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:!s&&(t.required?e.u(oe,{isDisabled:!F,onClick:h=>p(new SubmitEvent(h.type)),showCheckmark:_,children:I}):e.u(e.g,{children:[e.u(oe,{isDisabled:!F,onClick:h=>p(new SubmitEvent(h.type)),showCheckmark:_,children:I}),e.u("button",{className:"ul-card-skip__button",onClick:h=>p(new SubmitEvent(h.type),!0),children:e.getSkipButtonText(t)})]}))})]})})},o)},ln=()=>{const{destroy:n,forceBrandedLogo:r}=e.useConfig(t=>({destroy:t.destroy,forceBrandedLogo:t.forceBrandedLogo}));return e.p(()=>{setTimeout(()=>{n(Y.APP_ID)},r?4e3:2e3)},[n,r]),e.u("div",{className:"end-of-survey-text",children:"End of survey"})},dn=({activeValue:n,border:r,icon:t,enableCspTrustedTypes:o,isPressed:i,range:s,scaleLabelType:l,selectedValue:d,setSelectedValue:a,setActiveValue:u,setIsPressed:C,useMobileStyling:b,value:m,viewDocument:y})=>{const L=`option-${m}`,f=l==="number",x=l==="star",S=l==="smiley",E=f&&m===n||m===d,[I,_]=(()=>{const p=x&&d!==null&&m<=d;return x&&m<=n||S&&m===n||p||m===n||m===d?[r,i||p||m===d?1:.3]:["",1]})(),O=e.F(()=>{const p={borderColor:E?I:"",fillOpacity:E?"":_,zIndex:E?3:"auto",color:d===m?"#fff":""};return f?{...p,backgroundColor:d===m?I:""}:{...p,color:x||S||d===m?I:""}},[E,I,_,d,m,f,x,S]),F=e.F(()=>Y.getHtml((({icon:p,scaleLabelType:h,value:D,selectedValue:v})=>{if(h==="smiley"&&D===v){let g=0;return p.replace(/black/g,()=>++g==1?"black":"white")}return p})({icon:t,scaleLabelType:l,value:m,selectedValue:d}),o),[o,t,l,d,m]);return e.u("button",{"aria-label":f?void 0:String(m),className:(()=>{switch(l){case"star":return e.cc(e.getClasses("likert-star",b),e.getClasses(`likert-star-${m}`,b));case"smiley":return e.cc(e.getClasses("likert-smiley",b),e.getClasses(`likert-smiley-${m}`,b));default:return m===s?e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${m}`,b),e.getClasses("likert-last-option",b)):e.cc(e.getClasses("likert-number",b),e.getClasses(`likert-number-${m}`,b))}})(),dangerouslySetInnerHTML:{__html:F},id:L,onClick:p=>{p.preventDefault(),p.stopPropagation(),a(m)},onKeyDown:p=>{var v,g;const h=y.querySelectorAll(`.likert-${l??"number"}`),D=m-1;p.key==="ArrowRight"?(v=h[D+1])==null||v.focus():p.key==="ArrowLeft"?(g=h[D-1])==null||g.focus():p.key!=="Enter"&&p.key!==" "||(p.preventDefault(),p.stopPropagation(),a(m))},onPointerDown:()=>C(!0),onPointerEnter:()=>u(m),onPointerLeave:()=>{u(-1),C(!1)},style:O,tabIndex:0})},cn=({className:n,labels:r,next:t,properties:o,questionId:i,type:s,isAnswered:l})=>{const{border:d,useMobileStyling:a,viewDocument:u,enableCspTrustedTypes:C,cards:b}=e.useConfig(c=>({border:c.border,useMobileStyling:c.useMobileStyling,viewDocument:c.viewDocument,enableCspTrustedTypes:c.enableCspTrustedTypes,cards:c.cards})),[m,y]=e.h(-1),[L,f]=e.h(!1),[x,S]=e.h(null),E=r&&r.left,I=r&&r.right;let _;const{range:O,scaleLabelType:F,ratingIcons:p}=o;O&&(_=Number(O));const h=_||5,D=c=>{var T,w;switch(F){case"star":return(T=p[0])==null?void 0:T.svg;case"smiley":return(w=p[c])==null?void 0:w.svg;default:return String(c+1)}},v=e.getButtonText(o),g=e.isLastQuestion(i,b);return e.u("form",{className:e.cc(n,"ul-card--likert","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${h})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(h)].map((c,T)=>{const w=T+1;return e.u(dn,{activeValue:m,border:d,enableCspTrustedTypes:C,icon:D(T),isPressed:L,range:h,scaleLabelType:F,selectedValue:x,setActiveValue:y,setIsPressed:f,setSelectedValue:S,useMobileStyling:a,value:w,viewDocument:u},T)})}),(E||I)&&e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:E}),e.u("span",{children:I})]})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:x===null&&o.required,onClick:()=>{t({value:x,questionId:i,type:s},!0)},showCheckmark:g,children:v})})]})},i)},un=({columns:n,onSelect:r,options:t,selectedOptions:o})=>{const i=e._([]),{border:s,useMobileStyling:l}=e.useConfig(m=>({border:m.border,useMobileStyling:m.useMobileStyling})),d=t.findIndex(m=>o[m.id]===null),[a,u]=e.h(d),C=e.T((m,y)=>{r(m,y);const L=a+1,f=t[L];f&&o[f.id]===null&&u(L)},[r,t,o,a]),b=e.T((m,y)=>{const L=a===m;return e.u(e.Accordion,{animate:!0,header:y.label,isOpen:L,onClick:()=>{var f;return u(L&&!((f=window.UserLeap)!=null&&f.isMobileSDK)?-1:m)},ref:f=>{f&&(i.current[m]=f)},showHeaderCheck:o[y.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:n.map(f=>e.u(j.Option,{allowTextEntry:!1,ariaLabel:`${y.label}-${f.label}`,border:s,error:!1,id:`${y.id}-${f.value}`,isRadio:!0,isSelected:o[y.id]===f.value,label:f.label,onUserInputChanged:()=>C(y.id,f.value),useMobileStyling:l},f.label))})},y.id)},[s,n,a,C,o,l]);return e.u("div",{children:t.map((m,y)=>b(y,m))})},pn=({className:n,next:r,options:t,properties:o,questionId:i,type:s,onSubmitButtonClick:l,isAnswered:d})=>{const{cards:a}=e.useConfig(E=>({cards:E.cards})),u=o.matrixColumn,C=o.required,b=E=>{E.preventDefault(),E.stopPropagation(),r({value:y,questionId:i,type:s},!0),l&&l()},m=t.reduce((E,I)=>(E[I.id]=null,E),{}),[y,L]=e.h(m),f=e.getButtonText(o),x=e.isLastQuestion(i,a);return e.u("form",{className:e.cc(n,"ul-card__matrix","fade-in-transition"),id:"text-form",onSubmit:b,children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:e.u(un,{columns:u,onSelect:(E,I)=>{L(_=>({..._,[E]:I}))},options:t,selectedOptions:y})}),e.u(j.QuestionBodyFooterContainer,{children:!d&&e.u(oe,{isDisabled:(S=y,C&&Object.values(S).every(E=>E==null)),onClick:()=>b(new SubmitEvent("submit")),showCheckmark:x,children:f})})]})},i);var S},$e=({className:n,onSubmit:r,options:t=[],properties:o,questionId:i,type:s,showIndividualSubmit:l=!1,onSubmitButtonClick:d,isAnswered:a})=>{const{border:u,useMobileStyling:C,cards:b}=e.useConfig(c=>({border:c.border,useMobileStyling:c.useMobileStyling,cards:c.cards})),m=t.reduce((c,T)=>(c[T.id]={isSelected:!1},c),{}),[y,L]=e.h(m),f=s==="multiplechoice",x=o.required,S=t.find(c=>{var T;return(T=c.optionProperties)==null?void 0:T.noneOfTheAbove}),E=c=>Object.entries(c).some(([T,w])=>{var P;const M=t.find(U=>`${U.id}`===T),B=w.userText===void 0||w.userText.trim()==="";return((P=M==null?void 0:M.optionProperties)==null?void 0:P.allowsTextEntry)&&B&&w.isSelected}),I=c=>Object.values(c).filter(T=>T.isSelected).length,_=o.minSelect&&o.minSelect>0&&o.maxSelectMode===e.MaxSelectModes.Range&&I(y)<o.minSelect&&(x||I(y)>0),O=c=>E(c)||x&&!I(c)||!(T=>{const{minSelect:w=0,maxSelect:M=1/0,maxSelectMode:B}=o,P=I(T);switch(B){case e.MaxSelectModes.Maximum:return P<=M;case e.MaxSelectModes.Range:return P===0||P>=w;default:return!0}})(c),F=Object.entries(y).some(([c,T])=>{var w,M;return T.isSelected&&((M=(w=t.find(B=>`${B.id}`===c))==null?void 0:w.optionProperties)==null?void 0:M.allowsTextEntry)}),p=l&&(!f||F),h=c=>{g(c.id,c.selected,c.userText,c.noneOfTheAbove)},D=c=>{var T;return(o==null?void 0:o.maxSelectMode)!==e.MaxSelectModes.Unlimited&&I(y)===(o==null?void 0:o.maxSelect)&&!((T=y[c])!=null&&T.isSelected)},v=()=>{r(y,!0),d&&d()},g=(c,T,w,M)=>{const B=Object.assign({},y);if((f||M)&&T)for(const P of Object.values(B))P.isSelected=!1,delete P.userText;else S&&!M&&y[S.id].isSelected&&(B[S.id].isSelected=!1);B[c]={isSelected:T,userText:w},L(B)};return e.u("form",{className:e.cc(n,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:v,children:e.u(j.MobileEmbedView,{properties:o,children:[e.u(j.QuestionBodyWrapper,{children:[o.isDropdown?e.u(j.Select,{disabledOptions:t.filter(c=>D(c.id)),dropdownFooter:_?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[I(y),"/",o.minSelect]}):void 0,isMultiSelect:!f,multiselectText:o.dropdownMultiselectedText??"choices selected",onChange:c=>{const T={...y};for(const w of t)c.includes(w)?T[w.id].isSelected=!0:T[w.id].isSelected=!1;L(T)},options:t,placeholderText:o.dropdownPlaceholderText??(f?"Select choice":"Select choice(s)"),value:t.filter(c=>y[c.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",C)),role:f?"radiogroup":"group",children:[t.map(({id:c,label:T,value:w,optionProperties:M})=>{var z,G;const B=`${c}`,{allowsTextEntry:P,noneOfTheAbove:U}={allowsTextEntry:!1,noneOfTheAbove:!1,...M};return e.u(j.Option,{allowTextEntry:P,border:u,disabled:D(B),error:E({[B]:y[B]}),id:B,isRadio:f,isSelected:!!((z=y[B])!=null&&z.isSelected),label:T,noneOfTheAbove:U,onUserInputChanged:h,promptText:(M==null?void 0:M.otherOptionPlaceholder)||"Please specify",text:(G=y[c])==null?void 0:G.userText,useMobileStyling:C,value:w},B)}),!!_&&e.u("div",{className:"ul-card__min-select-counter",children:[I(y),"/",o.minSelect]})]}),p&&e.u(j.LongformSubmitButton,{handleSubmit:v,isSubmitDisabled:O(y)})]}),!a&&e.u(j.QuestionBodyFooterContainer,{children:e.u(oe,{isDisabled:O(y),onClick:v,showCheckmark:e.isLastQuestion(i,b),children:e.getButtonText(o)})})]})},i)},mn=n=>{const{questionId:r,type:t,next:o,options:i}=n;return e.u($e,{...n,onSubmit:(s,l)=>{const d=Object.entries(s).find(([,m])=>m.isSelected)||[void 0,void 0],[a,u]=d,C=i.find(m=>`${m.id}`===a),b=u!=null&&u.userText?{[a]:{userText:u.userText}}:null;o({value:C&&a?{[a]:C.value}:{},secondaryValue:b,questionId:r,type:t},l)}})},vn=n=>{const{questionId:r,type:t,next:o}=n;return e.u($e,{...n,onSubmit:(i,s)=>{const l=Object.entries(i).reduce((a,[u,C])=>(a[u]=C.isSelected,a),{}),d=Object.entries(i).reduce((a,[u,C])=>{if(!C.userText)return a;const b=a||{};return b[u]={userText:C.userText},b},null);o({value:l,secondaryValue:d,questionId:r,type:t},s)}})},gn=({className:n,labels:r,properties:t,next:o,questionId:i,type:s,isAnswered:l})=>{const[d,a]=e.h(null),{border:u,useMobileStyling:C,viewDocument:b,cards:m}=e.useConfig(x=>({border:x.border,useMobileStyling:x.useMobileStyling,viewDocument:x.viewDocument,cards:x.cards})),y=r&&r.left,L=r&&r.right,f=e.isLastQuestion(i,m);return e.u("form",{className:e.cc(n,"ul-card--nps","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:t,children:[e.u(j.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((x,S)=>e.u("button",{className:e.cc(e.getClasses("nps-number",C),e.getClasses(`nps-number-${S}`,C)),id:`option-${S}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),a(S)},onKeyDown:E=>{var _,O;const I=b.querySelectorAll("button.nps-number");E.key==="ArrowRight"?(_=I[S+1])==null||_.focus():E.key==="ArrowLeft"?(O=I[S-1])==null||O.focus():E.key!=="Enter"&&E.key!==" "||(E.preventDefault(),E.stopPropagation(),a(S))},onPointerDown:E=>{E.currentTarget.style.zIndex="2"},onPointerLeave:E=>{E.currentTarget.style.zIndex="auto"},style:d===S?{backgroundColor:u,color:"#fff"}:void 0,tabIndex:0,children:S},S))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:y}),e.u("span",{children:L})]})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:d===null&&t.required,onClick:()=>{o({value:d,questionId:i,type:s},!0)},showCheckmark:f,children:e.getButtonText(t)})})]})},i)},hn=({className:n,next:r,properties:t,questionId:o,type:i,onSubmitButtonClick:s,isAnswered:l})=>{const{border:d,useMobileStyling:a,update:u,cards:C}=e.useConfig(_=>({border:_.border,useMobileStyling:_.useMobileStyling,update:_.update,cards:_.cards})),[b,m]=e.h(""),y=e._(null),L=b.trim(),f=t.required===!0&&!L,x=j.useAutoSize(y,()=>u()),S=t&&t.openTextPlaceholder?t.openTextPlaceholder:"",E=e.getButtonText(t),I=e.isLastQuestion(o,C);return e.u("form",{className:e.cc(n,"ul-card-text","fade-in-transition"),id:"text-form",children:e.u(j.MobileEmbedView,{properties:t,children:e.u("div",{className:"ul-card-text",children:[e.u(j.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":S,className:e.cc(e.getClasses("ul-card-text__input",a)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:_=>{_.currentTarget.style.borderColor=Y.DEFAULT_BORDER_COLOR},onChange:_=>{const{value:O}=_.currentTarget;x(),_.preventDefault(),_.stopPropagation(),m(O)},onFocus:_=>{_.currentTarget.style.borderColor=d},placeholder:S,ref:y,role:"textbox",tabIndex:0})}),t.footerHtml&&e.u(j.Html,{className:"footer",html:t.footerHtml})]}),e.u(j.QuestionBodyFooterContainer,{children:!l&&e.u(oe,{isDisabled:f,onClick:_=>{_.preventDefault(),_.stopPropagation();const O=t.required!==!0||L.length>0;r({value:b,questionId:o,type:i},O),s&&s()},showCheckmark:I,children:E})})]})})},o)},bn=({className:n,labels:r,next:t,properties:o,questionId:i,type:s,onSubmitButtonClick:l,options:d,isAnswered:a})=>{const u=e._(null),C=e._(0),b=e._(0),m=e._(null),y=e._(!1),L=e._([]),[f,x]=e.h(()=>(o==null?void 0:o.required)===!0),[S,E]=e.h(()=>d.map(k=>({...k,rank:null}))),I=e.F(()=>Array.from({length:d.length},(k,A)=>A+1),[d.length]),{useMobileStyling:_,isPreview:O,headers:F}=e.useConfig(k=>({useMobileStyling:k.useMobileStyling,isPreview:k.isPreview,headers:k.headers})),p=(F==null?void 0:F["userleap-platform"])==="android",h=_&&!O&&!p,D=!h&&!p,v=(k,A)=>{E(H=>{const N=parseInt(A),V=H.map($=>({...$}));V.some($=>$.rank==null)&&V.forEach(($,le)=>$.rank=le+1);const K=V.findIndex($=>$.id===k);if(K===-1)return H;const Q=V[K].rank;return N<Q?V.forEach($=>{$.id!==k&&$.rank>=N&&$.rank<Q&&($.rank=$.rank+1)}):N>Q&&V.forEach($=>{$.id!==k&&$.rank>Q&&$.rank<=N&&($.rank=$.rank-1)}),V[K].rank=N,V.sort(($,le)=>$.rank-le.rank),P(),V})},g=(k,A)=>{for(let H=0;H<L.current.length;H++){const N=L.current[H];if(!N||N===m.current)continue;const V=N.getBoundingClientRect();if(k>=V.left&&k<=V.right&&A>=V.top&&A<=V.bottom)return{element:N,index:H}}return null},c=k=>A=>{if(!h)return;A.preventDefault(),A.stopPropagation(),y.current=!0,u.current=k;const H=A.touches[0];C.current=H.clientY,b.current=H.clientY;const N=A.currentTarget.closest(".ul-card-rank__option");N&&(m.current=N,N.classList.add("is-dragging"))},T=k=>{if(!h||!y.current||u.current===null)return;k.preventDefault(),k.stopPropagation();const A=k.touches[0];b.current=A.clientY;const H=b.current-C.current;m.current&&(m.current.style.transform=`translateY(${H}px)`,m.current.style.zIndex="1000"),L.current.forEach(V=>{V&&V!==m.current&&V.classList.remove("is-drop-target")});const N=g(A.clientX,A.clientY);N&&N.element.classList.add("is-drop-target")},w=k=>{if(!h||!y.current||u.current===null)return;k.preventDefault(),k.stopPropagation();const A=k.changedTouches[0],H=g(A.clientX,A.clientY);m.current&&(m.current.style.transform="",m.current.style.zIndex="",m.current.classList.remove("is-dragging")),L.current.forEach(N=>{N&&N.classList.remove("is-drop-target")}),H&&H.index!==u.current&&M(u.current,H.index),u.current=null,m.current=null,y.current=!1},M=(k,A)=>{E(H=>{const N=H.map(K=>({...K})),[V]=N.splice(k,1);return N.splice(A,0,V),N.forEach((K,Q)=>{K.rank=Q+1}),P(),N})},B=k=>{const A={};k.reduce((H,N)=>(H[N.id]=N.rank,H),A),t({value:A,questionId:i,type:s},!0)},P=()=>{x(!1)},{left:U,right:z}=r,G=d.length,W=k=>{k.preventDefault(),k.currentTarget.classList.add("is-drop-target")},X=k=>{k.currentTarget.classList.remove("is-drop-target")},ee=k=>{u.current=null,k.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(n,"ul-card-rank","fade-in-transition"),onSubmit:k=>{k.preventDefault(),B(S),l&&l()},children:e.u(j.MobileEmbedView,{properties:o,children:p?e.u(e.g,{children:[e.u(j.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 - ",U]})}),e.u("ol",{className:"ul-card-rank__list",children:S.map(({id:k,label:A,rank:H})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${A}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${k}]`,onChange:N=>v(k,N.currentTarget.value),value:H??"",children:[H==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),I.map(N=>e.u("option",{className:"ul-card-rank__select-option",value:N,children:N},`${N}-${i}`))]}),e.u("span",{children:A})]},k))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",z]})})]})}),e.u(j.QuestionBodyFooterContainer,{children:!a&&e.u("div",{className:"ul-card__button-wrapper",children:e.u(j.Button,{disabled:f,children:e.getButtonText(o)})})})]}):e.u(e.g,{children:[e.u(j.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 - ",U]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:p?void 0:k=>{k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect="move")},children:S.map(({id:k,label:A,rank:H},N)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!D||void 0,onDragEnd:D?ee:void 0,onDragEnter:D?W:void 0,onDragLeave:D?X:void 0,onDragStart:D?(K=N,Q=>{u.current=K,Q.dataTransfer&&(Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",String(K)),Q.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:D?(V=N,Q=>{var le,Ie;Q.preventDefault(),Q.currentTarget.classList.remove("is-drop-target");const $=u.current;u.current=null,(Ie=(le=Q.currentTarget.closest(".ul-card-rank__list"))==null?void 0:le.querySelector(".is-dragging"))==null||Ie.classList.remove("is-dragging"),$!=null&&$!==V&&M($,V)}):void 0,ref:Q=>L.current[N]=Q,children:[e.u("select",{"aria-label":`Rank for ${A}`,className:e.cc("ul-card-rank__select",H==null&&"ul-card-rank__select--placeholder"),name:`rank[${k}]`,onChange:Q=>v(k,Q.currentTarget.value),value:H??"",children:[H==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))]}),e.u("span",{children:A}),!p&&e.u("button",{"aria-label":`Drag ${A} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:h?w:void 0,onTouchMove:h?T:void 0,onTouchStart:h?c(N):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"})})})]},k);var V,K})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[G," - ",z]})})]})}),e.u(j.QuestionBodyFooterContainer,{children:!a&&e.u("div",{className:"ul-card__button-wrapper",children:e.u(j.Button,{disabled:f,children:e.getButtonText(o)})})})]})})},i)},xe=1,Ve=2,Qe=3,ue=n=>n.type==="av_permission",Pe=n=>n.type==="screen_permission",ze=(n,r)=>n===void 0?xe:n?((t,o)=>!(ue(o)?o.permissionDescriptors:[]).includes("camera")||t.getVideoTracks().length>0)(n,r)?Qe:xe:Ve,Be={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},te=e.create(n=>({...Be,reset:()=>{n(Be)},updatePage:r=>{n(r)}}));function ke({currentPage:n,pages:r}){const{avStream:t,recordingMediaTypes:o,updatePage:i}=te.getState(),{recorderEventEmitter:s}=e.useConfig.getState();s.emit("av.permission",{"permission.descriptors":n.permissionDescriptors,"stream.ready":(l,d)=>{if(t===l)return;let a=n;if(l&&!n.permissionDescriptors.includes("camera")){const u=r.indexOf(n),C=d!=null&&d.active?u+2:u+1;d!=null&&d.active&&o&&s.emit("begin.recording",{"recording.media.types":o,"start.recording.callback":b=>i({mediaRecordingUids:b})}),a=r[C]}i({currentPage:a,avStream:l})}})}function we({status:n}){const{nextQuestion:r,passthroughData:t,mediaRecordingUids:o,reset:i}=te.getState(),{recorderEventEmitter:s,handleUploadUpdate:l,index:d}=e.useConfig.getState(),a={value:{taskStatus:n},type:"recordedtask",questionId:(t==null?void 0:t.questionId)||1};t&&s.emit("finish.task",{"begin.callback":u=>{l({mediaRecordingUid:u,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(u,C)=>{l({mediaRecordingUid:u,progressPct:C.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":u=>{u&&l({mediaRecordingUid:u,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":t,"current.index":d,"task.response":a,"task.complete.callback":u=>{a.value.taskDurationMillisecond=u,o&&(a.value.mediaRecordingUids=o),i(),r(a)}})}function je({pages:n,setIsRequestingPermission:r}){const{recorderEventEmitter:t,eventEmitFn:o}=e.useConfig.getState(),{updatePage:i,currentPage:s,recordingMediaTypes:l,screenPermissionRequested:d}=te.getState();if(!s)return;const a=n.indexOf(s);switch(s.type){case"av_permission":{const u=d?a+2:a+1;return d&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":C=>{i({mediaRecordingUids:C})}}),void i({currentPage:n[u]})}case"screen_permission":return void t.emit("screen.permission",{"screen.permission.requested":r,"stream.ready.callback":(u,C)=>{const b=C?n[a+1]:s;C&&l&&t.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":m=>{i({captureStream:C,mediaRecordingUids:m})}}),i({currentPage:b,screenPermissionRequested:!0,captureStream:C})}});case"start_task":return o("recorded.task.start"),t.emit("recorded.task.start"),t.emit("start.task"),void i({currentPage:n[a+1],screenPermissionRequested:!0});case"complete_task":return}}const Ge="ul-permission-graphics-container",Ze="ul-permission-body",We=e.cc(Ge,"ul_recorded-task-inset-spacing"),pe=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),Ye=({richTextBody:n})=>e.u(j.Html,{className:"ul-rich-text-body",html:n,id:"ul-task-detail-container"}),me=({required:n,skipButtonText:r,bottom:t=!1})=>n?null:e.u(j.Button,{className:e.cc(t&&"ul-skip-button-below","ul-button-inactive"),onClick:we.bind(null,{status:"abandoned"}),children:r||"Skip"}),Te=n=>{const{avStream:r,captureStream:t,recordingMediaTypes:o,updatePage:i}=te.getState(),s=(o==null?void 0:o.includes("audio"))||(o==null?void 0:o.includes("video"));e.p(()=>{const l=setInterval(()=>{s&&r&&!r.active?i({avStream:null,currentPage:n[0]}):t&&t.active||i({captureStream:void 0,currentPage:n[s?1:0]})},1e3);return()=>clearInterval(l)},[r,t,s,n,o,i])},fn=({content:n,pages:r,required:t})=>{const{buttonText:o,skipButtonText:i,taskDetail:s}=n;return Te(r),e.u("div",{className:"ul-task-page",children:[s&&e.u(Ye,{richTextBody:s}),e.u("div",{className:pe,children:[e.u(j.Button,{onClick:je.bind(null,{pages:r}),children:o}),e.u(me,{required:t,skipButtonText:i})]})]},"start-task")},yn=({content:n,pages:r,properties:t})=>{const{buttonText:o,skipButtonText:i}=n;return Te(r),e.u("div",{className:"ul-task-page",children:[n.taskDetail&&e.u(Ye,{richTextBody:n.taskDetail}),e.u(j.MobileEmbedView,{properties:t,children:e.u("div",{className:pe,children:[e.u(j.Button,{className:"ul-complete-task-button",onClick:we.bind(null,{status:"completed"}),children:o}),e.u(j.Button,{className:e.cc("ul-button-inactive"),onClick:we.bind(null,{status:"given.up"}),children:i})]})})]},"complete-task")},Cn=({content:n,pages:r,required:t})=>{const{buttonText:o,skipButtonText:i}=n,[s]=e.useConfig(a=>[a.tabTitle]),[l,d]=e.h(!1);return e.u("div",{children:[e.u("div",{className:We,children:[e.u("p",{style:{marginTop:"auto"},children:n.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:Ze,children:s})})]}),e.u("div",{className:t?"":pe,children:[e.u(j.Button,{disabled:l,onClick:je.bind(null,{pages:r,setIsRequestingPermission:d}),children:o}),e.u(me,{required:t,skipButtonText:i})]})]})},xn=({content:n})=>e.u(j.Html,{className:e.cc(Ge,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:n.svg},"ul-permission-request-graphic"),kn=({content:n,pages:r,required:t})=>{const{permissionDeniedHeadline:o,permissionDeniedBody:i,skipButtonText:s,tryAgainButtonText:l}=n,d=ue(r[0])?r[0]:null;return e.p(()=>{const a=setInterval(()=>{d!==null&&ke({currentPage:d,pages:r})},1e3);return()=>clearInterval(a)},[d,r]),d?e.u("div",{children:[e.u("div",{className:We,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:o}),e.u("span",{className:Ze,children:i})]})}),e.u("div",{className:pe,children:[e.u(j.Button,{onClick:ke.bind(null,{currentPage:d,pages:r}),children:l}),e.u(me,{required:t,skipButtonText:s})]})]}):null},wn=({stream:n})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:r=>{r&&(r.srcObject=n||null)}}),En=({content:n,pages:r,required:t})=>{const{skipButtonText:o}=n,{avStream:i}=te.getState();return Te(r),e.u("div",{children:[e.u(wn,{stream:i}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(j.Button,{onClick:je.bind(null,{pages:r}),children:n.buttonText}),e.u(me,{bottom:!0,required:t,skipButtonText:o})]})]})},jn=({properties:n})=>{const{pages:r,required:t}=n,{avStream:o,currentPage:i}=te.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case"av_permission":{const s=ze(o,i);return s===xe?e.u(xn,{content:i}):s===Ve?e.u(kn,{content:i,pages:r,required:t}):e.u(En,{content:i,pages:r,required:t})}case"screen_permission":return e.u(Cn,{content:i,pages:r,required:t});case"start_task":return e.u(fn,{content:i,pages:r,required:t});case"complete_task":return e.u(yn,{content:i,pages:r,properties:n});default:return null}},Tn=({className:n,properties:r,next:t,questionId:o})=>{const i=e.useConfig(),{surveyId:s,responseGroupUid:l,userId:d}=i,a=te(),{screenPermissionRequested:u}=a,C=te(f=>f.avStream);let b=te(f=>f.currentPage);b||(b=function({pages:f,userId:x,responseGroupUid:S,surveyId:E,questionId:I,next:_}){const{updatePage:O}=te.getState(),{eventEmitFn:F,recorderEventEmitter:p}=e.useConfig.getState(),h={questionId:I,surveyId:E,visitorId:x,responseGroupUid:S};let D=0;p.emit("recorded.task.permission.screen"),F("recorded.task.permission.screen"),p.emit("permission.status",{"permission.status.callback":(g,c,T,w)=>{const M=f[D],{type:B}=M,P=["screen"];if(ue(M)){const{permissionDescriptors:U}=M,z=U==null?void 0:U.includes("microphone"),G=U==null?void 0:U.includes("camera");z&&P.push("audio"),G&&P.push("video"),(g!=null&&g.active&&!G||g!=null&&g.active&&c)&&D++}Pe(f[D])&&T&&(D++,p.emit("begin.recording",{"recording.media.types":P,"start.recording.callback":U=>O({mediaRecordingUids:U})})),O({currentPage:f[D],avStream:g,screenPermissionRequested:T,nextQuestion:_,type:B,passthroughData:h,recordingMediaTypes:P,captureStream:w})}});const v=f[D];return v.type==="av_permission"&&ke({currentPage:v,pages:f}),v}({questionId:o,surveyId:s,next:f=>{t(f,!0)},pages:r.pages,responseGroupUid:l,userId:d}));let m=b.headline,y=b.captionText;const L=ze(C,b);return Pe(b)&&u&&(m=b.permissionDeniedHeadline,y=b.permissionDeniedCaptionText),ue(b)&&L===Qe&&(m=b.permissionGrantedHeadline,y=b.permissionGrantedCaptionText),e.u("div",{className:e.cc(n,"ul-center-horizontally","fade-in-transition"),children:[e.u(j.Header,{isRequired:r==null?void 0:r.required,message:m,properties:{captionText:y}}),e.u(j.QuestionBodyWrapper,{children:e.u(jn,{properties:r})})]})},In=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{visitorAttributes:l,isLongFormSurvey:d}=e.useConfig(b=>({visitorAttributes:b.visitorAttributes,isLongFormSurvey:Y.isLongFormSurvey(b.studyType)})),a=(b,m=!1)=>{r({value:m?{skipped:!0}:void 0,questionId:o,type:i},!0)},u=j.getAttributedUrl(t&&t.buttonUrl,l),C=d&&t.promptActionType===e.PromptActionTypeEnum.NO_BUTTON;return e.u("div",{className:e.cc(n,"ul-card__text-url-prompt","fade-in-transition"),children:e.u(j.MobileEmbedView,{properties:t,children:!s&&!C&&e.u("div",{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:u,id:"ul-card-text__button",onClick:a,onKeyPress:b=>{b.key!=="Enter"&&b.key!==" "||r({value:void 0,questionId:o,type:i},!0)},rel:"noreferrer",role:u?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(t)}),t.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:b=>a(0,!0),children:e.getSkipButtonText(t)})]})})})},o)},_n=({className:n,questionId:r})=>{const{border:t,destroy:o,endCard:i,forceBrandedLogo:s,quotaEndcardText:l}=e.useConfig(C=>({border:C.border,destroy:C.destroy,endCard:C.endCard,forceBrandedLogo:C.forceBrandedLogo,quotaEndcardText:C.quotaEndcardText}));e.p(()=>{setTimeout(()=>{o(Y.APP_ID)},s?4e3:2e3)},[o,s]);const d=(l==null?void 0:l.subheader)??(i==null?void 0:i.subheader),a=d?e.u("p",{className:"ul-caption",children:d}):null,u=(l==null?void 0:l.headline)??(i==null?void 0:i.headline)??"";return e.u("div",{className:e.cc(n,"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:t,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:t,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(j.Header,{message:u}),a]})})},r)},Dn=()=>e.u("div",{className:"thinking-dots-container",children:e.u("div",{className:"thinking-dot"})}),Sn=({className:n})=>{const{uploadProgress:r}=e.useConfig(s=>({uploadProgress:s.uploadProgress}));let t,o;Object.values(r).filter(s=>s.isSubmitted).length>1?(t="Your responses are processing",o="Please keep this tab open until your responses are fully processed."):(t="Your response is processing",o="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(r).filter(s=>s.isSubmitted).map(s=>s.progressPct||0)));return e.u("div",{className:e.cc(n,"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(j.Header,{message:`${t} (${i}% complete)`}),e.u("p",{className:"ul-caption",children:o})]})},Me=0,Rn=1,Ln=({className:n,next:r,properties:t,questionId:o,type:i,isAnswered:s})=>{const{apiURL:l,envId:d,handleUploadUpdate:a,headers:u,responseGroupUid:C,surveyId:b,viewDocument:m,visitorId:y,cards:L}=e.useConfig(g=>({apiURL:g.apiURL,envId:g.envId,handleUploadUpdate:g.handleUploadUpdate,headers:g.headers,responseGroupUid:g.responseGroupUid,surveyId:g.surveyId,viewDocument:g.viewDocument,visitorId:g.userId,cards:g.cards})),[f,x]=e.h(!1),[S,E]=e.h(null),[I,_]=e.h(null),[O]=e.h(Me),F=e.getButtonText(t),p=e.isLastQuestion(o,L);if(s)return null;const h=`ul-card-video__player_recorder-q${o}`,D=(g,c)=>{g===q.UPLOAD_STARTED?(E(c[q.UPLOAD_ID]),_(c[q.MEDIA_RECORDING_UID]),x(!0)):g===q.DELETE?(E(null),_(null),x(!1)):g===q.UPLOAD_PROGRESS?isNaN(c[q.UPLOAD_PROGRESS_PCT])?a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],isComplete:!0}):a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],progressPct:c[q.UPLOAD_PROGRESS_PCT]}):g===q.UPLOAD_FINISHED&&a({mediaRecordingUid:c[q.MEDIA_RECORDING_UID],isComplete:!0})},v=g=>{g.preventDefault(),g.stopPropagation(),document.getElementById(h)&&Le(h),S&&I?(a({mediaRecordingUid:I,isSubmitted:!0}),r({value:{mediaRecordingUid:I},questionId:o,type:i},!0)):r({value:null,questionId:o,type:i},!0)};return e.u("form",{className:e.cc(n,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[e.u(j.QuestionBodyWrapper,{children:!s&&e.u("div",{id:"ul-question-player-container",style:{display:O===Me?"":"none"},children:e.u(j.MobileEmbedView,{properties:t,children:[e.u(oe,{isDisabled:!f,onClick:()=>{Le(),r({value:{uploadId:S,mediaRecordingUid:I},questionId:o,type:i},!0)},showCheckmark:p,children:F}),e.u("div",{style:{display:O===Rn?"block":"none"},children:e.u("div",{id:"ul-recorder-player-container",ref:g=>{if(g&&g.children.length===0){const c=((T,w={},M="https://api.userleap.com",B,P,U,z=!1,G=document)=>{R.document=G;const W=T+qe,X=Fe(W);return R.document.addEventListener("securitypolicyviolation",ee=>{re(new Error(`Voice & Video feature violates ${ee.violatedDirective} web page CSP policies for the recorder player.`),"recorderDeviceError",M,U,w.visitorId,w.envId)}),Oe(Ne.concat(Je),()=>{ye(W,X),R.document.getElementById(Ee(W)).remove();try{en(X,W,w,M,B,P,U,z)}catch(ee){return void re(new Error(`Error when creating video recorder player object ${ee}`),"recorderDeviceError",M,U,w.visitorId,w.envId)}}),X})(h,{surveyId:b,responseGroupUid:C,questionId:o,visitorId:y,envId:d},l,D,void 0,{...u,"x-ul-video-recorder-origin":"sdk"},t.mediaType===q.MEDIA_TYPE_AUDIO,m);g.appendChild(c)}}})})]})})}),!s&&e.u(j.QuestionBodyFooterContainer,{children:[e.u(oe,{isDisabled:!!t.required&&!f,onClick:v,showCheckmark:p,children:e.getButtonText(t)}),e.u("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:v,style:{...t.required?{display:"none"}:{},...f?{display:"none"}:{}},children:e.getSkipButtonText(t)})]})]})},de=n=>n.type==="aidynamicfollowup"||n.type==="aidynamicstandalone",fe=n=>{var r;return de(n)&&((r=n.props)==null?void 0:r.loading)===e.DynamicQuestionLoadingStates.inFlight},Ke=n=>n.type==="thanks"||n.type==="uploading",Pn=({card:n,avatars:r,isThinking:t,isCurrentQuestion:o,currentQuestionBubbleRef:i})=>{const s=(d=>"properties"in d.props&&d.props.properties&&"questionHtml"in d.props.properties&&d.props.properties.questionHtml?{content:d.props.properties.questionHtml,image:d.props.properties.image,isHtml:!0}:"message"in d.props?"image"in d.props.properties&&d.props.properties.image?{content:d.props.message,image:d.props.properties.image,isHtml:!1}:{content:d.props.message,isHtml:!1}:{content:"Question",isHtml:!1})(n),l=o&&!(s!=null&&s.image)?i:null;return e.u(e.g,{children:[(s==null?void 0:s.image)&&e.u(ae,{avatars:r,isLeft:!0,ref:o?i:null,children:!t&&e.u(j.DisplayQuestionImage,{image:s.image})}),e.u(ae,{avatars:r,isLeft:!0,message:{id:`question-${n.name}`,type:"question",content:s.content},ref:l,children:t?e.u(Dn,{}):e.u(e.g,{children:[s.isHtml?e.u(j.Html,{className:"chat-message-text",html:s.content}):e.u("div",{className:"chat-message-text",children:s.content}),n.type==="videovoice"&&e.u(on,{properties:n.props,questionId:n.name,surveyVideoUrl:n.props.properties.videoUrl})]})})]})},Bn=({card:n,avatars:r})=>{const t=(o=>{if(!("properties"in o.props)||!o.props.properties||typeof o.props.properties!="object")return null;const i=o.props.properties,s=[{key:"captionHtml",isHtml:!0},{key:"captionText",isHtml:!1},{key:"richTextBody",isHtml:!0},{key:"body",isHtml:!1}];for(const{key:l,isHtml:d}of s){const a=i[l];if(typeof a!="string")continue;const u=a.trim();if(u){if(d&&!u.replaceAll(/<[^>]*>/g,"").trim())continue;return{content:u,isHtml:d}}}return null})(n);return t?e.u(ae,{avatars:r,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:t.content},children:t.isHtml?e.u(j.Html,{className:"chat-message-text",html:t.content}):e.u("div",{className:"chat-message-text",children:t.content})}):null},Mn=()=>{const{providerPersona:n,showProviderPersona:r,experimentFlags:t}=e.useConfig(i=>({providerPersona:i.providerPersona,showProviderPersona:i.showProviderPersona,experimentFlags:i.experimentFlags}));return(t==null?void 0:t["sdk-new-convo-ui"])&&r&&n?e.u("div",{className:"chat-persona-label",children:n}):null},Nn=({card:n,userResponse:r,avatars:t})=>{const o=((i,s)=>{if((i.type==="open"||i.type==="aidynamicfollowup"||i.type==="aidynamicstandalone")&&s&&typeof s=="object"&&"value"in s)return s.value})(n,r);return e.u("div",{className:"chat-bubble-container chat-right",children:[e.u("div",{className:"chat-bubble chat-bubble-right chat-bubble-text-only",children:e.u("div",{className:"chat-message-text",children:o||e.u("div",{className:"chat-message-no-response",children:"No response"})})}),e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${t.respondentAvatar["1x"]} 1x, ${t.respondentAvatar["2x"]} 2x`})]})},qn=({card:n,avatars:r,isCurrentQuestion:t,currentQuestionBubbleRef:o})=>{const{endCard:i,quotaEndcardText:s}=e.useConfig(a=>({endCard:a.endCard,quotaEndcardText:a.quotaEndcardText})),l=(s==null?void 0:s.headline)??(i==null?void 0:i.headline)??"Great! Thank you for your participation.",d=(s==null?void 0:s.subheader)??(i==null?void 0:i.subheader);return e.u(e.g,{children:[e.u(ae,{avatars:r,isLeft:!0,message:{id:`thanks-${n.name}`,type:"question",content:l},ref:t?o:null}),d&&e.u(ae,{avatars:r,hideAvatar:!0,isLeft:!0,message:{id:`caption-${n.name}`,type:"question",content:d}}),e.u(ln,{})]})},On=({card:n,cardIndex:r,index:t,avatars:o,cardResponses:i,questionThinkingStates:s,startingQuestionIdx:l,currentQuestionBubbleRef:d,handleCardResponse:a})=>{const u=r===t,C=r<t,b=Ke(n);if(b)return e.u(qn,{avatars:o,card:n,currentQuestionBubbleRef:d,isCurrentQuestion:u});const m=`${n.name}`,y=i.get(m),L=n.type==="open"||n.type==="aidynamicfollowup"||n.type==="aidynamicstandalone",f=s.get(m);if(n.type==="aidynamicfollowup"&&(n.props.loading===e.DynamicQuestionLoadingStates.failure||n.props.loading===void 0)||n.type==="aidynamicstandalone"&&n.props.loading===e.DynamicQuestionLoadingStates.failure)return e.u(e.g,{});const x=(r>(l??0)||de(n))&&n.type!=="thanks"&&n.type!=="uploading"&&(f===!0||f===void 0);return e.u(e.wn.Fragment,{children:[e.u(Pn,{avatars:o,card:n,currentQuestionBubbleRef:d,isCurrentQuestion:u,isThinking:x}),!x&&e.u(e.g,{children:[e.u(Bn,{avatars:o,card:n}),e.u(Mn,{})]}),C&&L?e.u(Nn,{avatars:o,card:n,userResponse:y}):(!C||!L)&&!x&&e.u(ae,{avatars:o,isLeft:!1,message:{id:`card-${n.name}`,type:"card",content:""},children:e.u("div",{className:"chat-card-container",children:e.u(An,{card:n,className:b?"chat-thanks-card":"chat-card",isAnswered:C,next:u?a:()=>{}})})})]},`question-card-${n.name}`)},ae=e.wn.forwardRef(({message:n,isLeft:r=!1,children:t,avatars:o,hideAvatar:i=!1},s)=>{const l=r?"chat-bubble-left":"chat-bubble-right";return e.u("div",{className:`chat-bubble-container ${r?"chat-left":"chat-right"}${r&&i?" chat-no-avatar":""}`,ref:s,children:[r&&!i&&e.u("img",{alt:"AI Avatar",className:"chat-avatar chat-avatar-left",srcSet:`${o.agentAvatar["1x"]} 1x, ${o.agentAvatar["2x"]} 2x`}),e.u("div",{className:`chat-bubble ${l}`,children:t||e.u("div",{className:"chat-message-text",children:n==null?void 0:n.content})}),!r&&!i&&e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${o.respondentAvatar["1x"]} 1x, ${o.respondentAvatar["2x"]} 2x`})]})});ae.displayName="ChatBubble";const Un=()=>{const n=e.useConfig(t=>t.close),r=e.F(()=>()=>n(Y.APP_ID),[n]);return e.u("div",{"aria-label":"Close button",className:"conversational-close-btn",onClick:r,onKeyPress:t=>{t.key==="Enter"&&r()},role:"button",tabIndex:0,children:e.u("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})},An=({card:n,next:r,className:t="",isAnswered:o=!1})=>{const i={className:o?`${t} answered-card`:t,next:o?()=>{}:r,questionId:n.name,type:n.type,isAnswered:o};switch(n.type){case"consentlegal":return e.u(an,{...i,...n.props});case"likert":return e.u(cn,{...i,...n.props});case"matrix":return e.u(pn,{...i,...n.props});case"multiplechoice":return e.u(mn,{...i,...n.props});case"multipleselect":return e.u(vn,{...i,...n.props});case"nps":return e.u(gn,{...i,...n.props});case"aidynamicstandalone":case"aidynamicfollowup":case"open":return e.u(hn,{...i,type:n.type,...n.props});case"rankorder":return e.u(bn,{...i,...n.props});case"recordedtask":return e.u(Tn,{...i,...n.props});case"texturlprompt":return e.u(In,{...i,...n.props});case"thanks":return e.u(_n,{...i,...n.props});case"uploading":return e.u(Sn,{...i,...n.props});case"videovoice":return e.u(Ln,{...i,...n.props});default:return null}};exports.default=({cards:n,next:r,previousResponses:t})=>{const{cardResponses:o,setCardResponse:i}=(()=>{const[p,h]=e.h(new Map);return{cardResponses:p,setCardResponse:e.T((D,v)=>{h(g=>new Map(g).set(D,v))},[])}})(),{index:s,isLongFormSurvey:l,avatars:d,showSurveyBrand:a,forceBrandedLogo:u,marketingUrlLink:C,startingQuestionIdx:b,viewDocument:m,createDynamicFollowupQuestion:y,update:L}=e.useConfig(p=>({index:p.index,isLongFormSurvey:Y.isLongFormSurvey(p.studyType),avatars:p.avatars,forceBrandedLogo:p.forceBrandedLogo,startingQuestionIdx:p.startingQuestionIdx,showSurveyBrand:p.showSurveyBrand,marketingUrlLink:e.buildMarketingUrl({marketingUrl:p.marketingUrl,slugName:p.slugName,surveyId:p.surveyId,forceBrandedLogo:p.forceBrandedLogo}),viewDocument:p.viewDocument,createDynamicFollowupQuestion:p.createDynamicFollowupQuestion,update:p.update})),{currentQuestionBubbleRef:f,scrollToCurrentQuestion:x}=(({viewDocument:p})=>{const h=e._(null),D=e.T(()=>{const v=p.querySelector(".ul-card-main-content");if(h.current&&v&&v instanceof HTMLElement){const g=h.current.offsetTop-v.offsetTop-16;v.scrollTo({top:Math.max(0,g),behavior:"smooth"})}},[]);return{currentQuestionBubbleRef:h,scrollToCurrentQuestion:D}})({viewDocument:m}),S=((p,h,D)=>{const[v,g]=e.h(new Map);return e.p(()=>{if(p.length>0&&h<p.length){const c=p[h],T=`${c.name}`,w=B=>{if(h>0){const P=p[h-1];if(de(P)){const U=`${P.name}`,z=fe(P);if(B.get(U)!==z)return new Map(B).set(U,z)}}return B};if((h<=(D??0)||Ke(c))&&(c==null?void 0:c.type)!=="aidynamicstandalone")return g(B=>w(new Map(B).set(T,!1)));g(B=>{const P=!de(c)||fe(c);return w(new Map(B).set(T,P))});const M=setTimeout(()=>{g(B=>{const P=!!de(c)&&fe(c);return w(new Map(B).set(T,P))})},1e3);return()=>clearTimeout(M)}},[h,p,D]),v})(n,s,b);((p,h)=>{const{createDynamicStandaloneQuestion:D}=e.useConfig(c=>({createDynamicStandaloneQuestion:c.createDynamicStandaloneQuestion})),v=p[h],g=(v==null?void 0:v.type)==="aidynamicstandalone"&&v.props.loading===void 0?v.name:null;e.p(()=>{g!==null&&D({questionId:g})},[g,D])})(n,s);const E=((p,h)=>{const[D,v]=e.h(()=>new Set([p]));return e.p(()=>{v(g=>new Set(g).add(p))},[p]),e.p(()=>{const g=h??0;g>0&&v(c=>{const T=new Set(c);for(let w=0;w<=g;w++)T.add(w);return T})},[h]),D})(s,b),I=e.F(()=>({...t,...e.buildReadableResponseMap(n.map((p,h)=>{var D,v;return{...p,value:h<s?((D=o.get(`${p.name}`))==null?void 0:D.value)??null:null,secondaryValue:h<s?((v=o.get(`${p.name}`))==null?void 0:v.secondaryValue)??null:null}}))}),[t,o,n,s]);j.useSetAllResponsesRaw(I);const _=e.pipeReadableResponsesIntoCards(n,I);e.p(()=>{requestAnimationFrame(()=>{x()}),L()},[s,x,S,L]);const O=e.T((p,h)=>{if(!h)return;const D=_[s];if(!D)return;const v=`${D.name}`;i(v,p);const g={...p,questionText:e.getProcessedQuestionText(D)};D.childId&&(g==null?void 0:g.value)!=null&&e.triggerFollowUpQuestionGeneration({displayCard:D,response:g,createDynamicFollowupQuestion:y}),r([g])},[_,s,r,i]),F=_.map((p,h)=>({card:p,cardIndex:h})).filter(({cardIndex:p})=>E.has(p));return e.u("div",{className:"conversational-ui ul-conversational-ui","data-testid":"ui-container",children:[!l&&e.u(Un,{}),e.u("div",{className:"chat-container",children:e.u("div",{className:"chat-messages",children:F.map(({card:p,cardIndex:h})=>e.u(On,{avatars:d,card:p,cardIndex:h,cardResponses:o,currentQuestionBubbleRef:f,handleCardResponse:O,index:s,questionThinkingStates:S,startingQuestionIdx:b},`question-card-${p.name}`))})}),l&&e.u("div",{className:"long-form-question-footer-container-logo",children:a&&e.u(e.SprigBrandLogo,{forceBrandedLogo:u,marketingUrlLink:C})})]})};
|
package/dist/{conversational-v2-styles-D5xNLWoE.cjs → conversational-v2-styles-BCsmmSE3.cjs}
RENAMED
|
@@ -1 +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)}';
|
|
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{margin-top:6px;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)}';
|
|
@@ -1,4 +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)}';
|
|
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{margin-top:6px;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
2
|
export {
|
|
3
3
|
t as default
|
|
4
4
|
};
|