PageSourceSearch

https://panel.survicate.com/1790839042034/js/insights.bundle.js

js survicate.com collected 2026-10-01 08:42:33 UTC 105,162 bytes, 13 lines download raw bytes

1"use strict";(self.webpackChunksurvicatejs=self.webpackChunksurvicatejs||[]).push([[200],{99040:(function(ke,z,t){t.d(z,{HH:function(){return n},rk:function(){return i},wk:function(){return $}});var e=t(50953);const s=(0,e.IJ)(null);function n(){return(0,e.nD)(s)}function $(I){s.value=I}function i(I){s.value===I&&(s.value=null)}}),19875:(function(ke,z,t){t.d(z,{LT:function(){return o},Mi:function(){return ee},XI:function(){return te},_A:function(){return he},fz:function(){return u},lm:function(){return I}});var e=t(41552),s=t.n(e),n=t(11619),$=t(53806),i=t(85655);class I extends Error{code;constructor(k,R){super(k),this.name="StreamError",this.code=R}}const r=new(s()).Converter({tables:!0,disableForced4SpacesIndentedSublists:!0});function d(v,k){return r.makeHtml(k?k(v):v)}function c(v){const k=v.match(/\d+/g)??[];return` <button type="button" class="annotation-badge" data-ids="${k.join(",")}">${k.length}</button>`}function u(v){return v.replace(/【\d+(?:(?:】【|,\s*)\d+)*】/gm,c)}function o(v,k){return v.role==="assistant"?{...v,content:d(v.content,k)}:v}const p="breathing",x="Thinking",y={thinking:"breathing",checking_dataset_size:"working",filtering_by_date_range:"solving",analyzing_sentiment:"breathing",searching_keywords:"working",inspecting_attributes:"working",removing_duplicates:"weaving",sampling_notes:"solving",expanding_date_range:"weaving",looking_up_surveys:"working",reading_support_docs:"searching",generating:"working",citing_sources:"connecting",preparing_edit:"weaving",reading_report:"listening",drafting_edit:"shaping"},H={thinking:"Thinking",checking_dataset_size:"Checking dataset size",filtering_by_date_range:"Filtering by date range",analyzing_sentiment:"Analyzing sentiment",searching_keywords:"Searching keywords",inspecting_attributes:"Inspecting attributes",removing_duplicates:"Removing duplicates",sampling_notes:"Sampling notes",expanding_date_range:"Expanding date range",looking_up_surveys:"Looking up surveys",reading_support_docs:"Checking documentation",generating:"Generating",citing_sources:"Citing sources",preparing_edit:"Preparing the edit",reading_report:"Reading the report",drafting_edit:"Drafting the edit"};function he(v){return`${v?H[v]??v:x}\u2026`}function ee(v){return v?y[v]??p:p}const xe=(0,n.lw)("GENIUS_SERVER");function we(v){let k=null,R=null;for(const b of v.split(`
2`))if(b.startsWith("event: "))k=b.slice(7).trim();else if(b.startsWith("data: ")){const L=b.slice(6);R=R?`${R}
3${L}`:L}return R?{type:k||"chunk",data:R}:null}async function*$e(v,k){const R=v.getReader(),b=new TextDecoder;let L="";try{for(;;){if(k?.aborted){R.cancel();return}const{done:Ie,value:le}=await R.read();if(Ie)break;L+=b.decode(le,{stream:!0});let fe=L.indexOf(`
4
5`);for(;fe!==-1;){const Pe=L.slice(0,fe);L=L.slice(fe+2);const De=we(Pe);De&&(yield De),fe=L.indexOf(`
6
7`)}}}finally{R.releaseLock()}}function We(v,k,R,b){const L=b.question;L&&(k.isNewQuestion=L.id!==v.threadId,k.isNewQuestion&&(L.id=v.threadId),k.messageIndex=L.messages.length-1,R.callbacks?.onInit?.(v))}function Ce(v,k,R,b){if(b.streamingStatus.stage=v.stage,!b.question?.messages.length||k.messageIndex===null)throw new Error("No active question or messages found for stage update.");R.callbacks?.onStage?.(v.stage)}function Ae(v,k,R,b){if(b.streamingStatus.stage=null,!b.question?.messages.length)throw new Error("No active question or messages found for chunk event.");const L=b.question.messages[b.question.messages.length-1];L?.role==="assistant"&&(k.chunkContent+=v.content,L.content=d(k.chunkContent,R.transform),R.callbacks?.onChunk?.())}function be(v,k,R,b){if(!b.question)throw new Error("No active question found for done event.");if(b.question.title=v.title,b.question.created_at=v.created_at,b.question.user_id=v.user_id,b.question.source_user_name=v.source_user_name,b.question.messages=v.messages.map(L=>o(L,R.transform)),k.isNewQuestion){b.questions?.unshift({id:b.question.id,title:b.question.title,created_at:b.question.created_at,user_id:v.user_id,source_user_name:v.source_user_name});const L=(0,i.E)();L.organization.subscription?.usage&&L.organization.subscription.usage.organization_assistant_chats++}
7R.callbacks?.onDone?.(v)}function pe(v,k,R,b){const L=v.message||"Stream error occurred";k.hasError=!0,k.errorMessage=L,k.errorCode=v.code,R.isFollowUp?b.question?.messages.splice(-2,2):b.question?.messages.splice(1),k.messageIndex=null,R.callbacks?.onError?.({message:L,code:v.code})}function J(v,k,R,b){R.callbacks?.onSuggestion?.(v)}function _e(v,k,R,b){const L=b.question?.messages[b.question.messages.length-1];L?.role==="assistant"&&(L.support_action=v)}function oe(v,k,R,b){try{b.streamingStatus.status=v.type;const L=JSON.parse(v.data);switch(v.type){case"init":We(L,k,R,b);break;case"stage":Ce(L,k,R,b);break;case"chunk":Ae(L,k,R,b);break;case"done":be(L,k,R,b);break;case"error":pe(L,k,R,b);break;case"suggestion":J(L,k,R,b);break;case"support_action":_e(L,k,R,b);break;default:console.warn(`Unknown event type: ${v.type}`,L)}}catch(L){const Ie=(0,n.zc)(L||"An unknown error occurred while handling stream event.");throw k.hasError=!0,R.callbacks?.onError?.({message:Ie}),new Error(Ie,{cause:L})}}async function te(v,k){const{url:R,payload:b,callbacks:L,transform:Ie,signal:le}=k;v.streamingStatus.isStreaming=!0;const fe=new Date().toISOString(),Pe=!!b.id&&v.question?.id===b.id;if(Pe)v.question.messages.push({content:b.prompt,created_at:fe,role:"user"},{content:"",created_at:fe,role:"assistant"});
7else{const de=(0,$.n)();v.question={id:0,title:b.prompt,created_at:fe,user_id:de.user?.id??null,messages:[{content:b.prompt,created_at:fe,role:"user"},{content:"",created_at:fe,role:"assistant"}]}}const{prompt:De,...me}=b,Se=await xe.post(R,{...me,messages:[{role:"user",content:De}]},{signal:le,responseType:"stream",adapter:"fetch",headers:{"Content-Type":"application/json",Accept:"text/event-stream"}}).catch(de=>{throw v.streamingStatus.isStreaming=!1,Pe?v.question.messages.splice(-2,2):v.question?.messages.splice(1),de});if(!Se.data||typeof Se.data.getReader!="function"){v.streamingStatus.isStreaming=!1;const de="Response data is not a readable stream.";throw L?.onError?.({message:de}),new Error(de)}L?.onStart?.();const Re={chunkContent:"",messageIndex:null,isNewQuestion:!1,hasError:!1,errorMessage:""},Me={prompt:b.prompt,isFollowUp:Pe,transform:Ie,callbacks:L,signal:le};try{for await(const de of $e(Se.data,le)){if(Re.hasError)break;oe(de,Re,Me,v)}}finally{v.streamingStatus.isStreaming=!1,v.streamingStatus.stage=null,v.streamingStatus.status=null}if(Re.hasError)throw new I(Re.errorMessage,Re.errorCode)}}),75733:(function(ke,z,t){var e=t(96231),s=t(11619);const n=(0,s.lw)("FEEDBACKHUB_API"),$=(0,e.nY)("assistantData",{state:()=>({noteCount:0,note:null}),actions:{async fetchNotesCount(i){const I=await n.get(`${i}/info`);return I&&I.status===200&&(this.noteCount=I.data.note_count),I},async fetchNote(i,I,r){this.note=null;const d={date_range:[],filters_group_operator:"and",filters_group:[]};if(r){const u=[];r.topicId&&r.topicId!=="all"&&u.push({uid:(0,s.v6)(),id:"topic",condition:"equals",value:[r.topicId]}),r.insightId&&u.push({uid:(0,s.v6)(),id:"insight",condition:"equals",value:[r.insightId]}),r.noteIds&&u.push({uid:(0,s.v6)(),id:"note_ids",condition:"equals",value:r.noteIds}),u.length&&d.filters_group.push({filters:u,operator:"and"})}const c=await n.post(`${i}/notes/${I}`,d);return c&&c.status===200&&(this.note=c.data),c},async updateNoteConversation(i,I){const r=await n.get(`${i}/notes/${I}`);return r&&r.status===200&&this.note&&(this.note.content=r.data.content,this.note.conversation=r.data.conversation),r},async deleteNote(i,I){const r=await n.delete(`${i}/notes/${I}`);return r&&r.status===204&&(this.note=null,this.noteCount-=1),r},async updateNote(i,I,r){const d=await n.patch(`${i}/notes/${I}`,r);return d&&d.status===200&&(this.note=d.data),d},fetchListing(i,I){return n.post(`${i}/listing`,I)},fetchAnnotationNotes(i,I,r){return n.post(`${i}/notes/search`,{date_range:[],filters_group_operator:"and",filters_group:[{filters:[{uid:(0,s.v6)(),id:"note_ids",condition:"equals",value:I}],operator:"and"}],items_per_page:50},{signal:r})}}});t.d(z,["t",0,$])}),7417:(function(ke,z,t){t.d(z,{Mj:function(){return I},gL:function(){return $}});var e=t(11619),s=t(85655);function n(r){const d=r?(r.name||r.email||"Anonymous").replace(/\./g,""):"Anonymous";return(0,e.Y0)(d)}function $(r,d){if(r===null)return{name:d||"Anonymous",email:null,profile_url:"https://assets.survicate.com/integrations/slack/ic-slack-logo.svg"};const u=(0,s.E)().getUser("user_id",r);return u?{name:u.name,email:u.email,profile_url:u.profile_url||n(u)}:{name:"Anonymous",email:null,profile_url:n()}}function i(r){const d=r.match(/(survey-\w+|\d+)/g);return` <button class="note-annotation" data-ids="${d}">${d?.length}</button>`}function I(r){return r.replace(/【\d+(?:(?:】【|,\s*)\d+)*】/gm,i).replace(/【survey-\w+(?:(?:】【|,\s*)survey-\w+)*】/gm,i)}}),4121:(function(ke,z,t){var e=t(96231),s=t(11619),n=t(19875),$=t(7417),i=t(53806);const I=(0,s.lw)("GENIUS_SERVER"),r=(0,e.nY)("assistant",{state:()=>({questions:[],question:null,streamingStatus:{isStreaming:!1,status:null,stage:null}}),actions:{async ask(d,c,u,o){const p={prompt:c.prompt};return"id"in c?p.id=c.id:(p.date_range=c.date_range,p.provider=c.provider),(0,n.XI)(this,{url:`${d}/question/stream`,payload:p,callbacks:{...u,onStart:()=>{s.l7.emit("Segment/track",{name:"hub_assistant_question",data:{question:c.prompt,source:"in-app"}}),u?.onStart?.()},onDone:x=>{const y=this.question?.messages[this.question.messages.length-1];
7y&&s.l7.emit("Segment/track",{name:"hub_assistant_response",data:{question:c.prompt,answer:y.content,characters_count:y.content.length,annotations_count:y.relevant_notes?.length||0,source:"in-app"}}),u?.onDone?.(x)}},transform:$.Mj,signal:o})},async fetchQuestions(d,c){const u=await I.get(`${d}/questions`,{signal:c});return u&&u.status===200&&(this.questions=u.data.questions),u},async fetchQuestion(d,c,u){const o=await I.get(`${d}/question/${c}`,{signal:u});return o&&o.status===200&&(this.question={...o.data,messages:o.data.messages.map(p=>(0,n.LT)(p,$.Mj))}),o},async removeQuestion(d,c){const u=I.delete(`${d}/question/${c}`),o=this.questions.findIndex(p=>p.id===c);return o!==-1&&this.questions.splice(o,1),u},async fetchStatus(d){const c=await(0,i.n)().getCurrentUser();return c?await I.get(`${d}/user/${c.id}/status`):null}}});t.d(z,["J",0,r])}),76011:(function(ke,z,t){t.d(z,{Iq:function(){return c},JY:function(){return d},LJ:function(){return I},Oz:function(){return n},aF:function(){return u},i_:function(){return r},nt:function(){return i}});var e=t(11619);const s=(0,e.No)({fallback:"We couldn't load this integration's settings. Please try again, or contact support if the problem keeps happening."});function n(o){return{provider:o,enabled:!1,authorized:!1,authorize_url:""}}function $(o,p){return Object.keys(o).reduce((x,y)=>{if(p===y)return x;const H=o[y];if(Array.isArray(H)){const he=H.map(ee=>typeof ee=="object"?$(ee,p):ee);return x[y]=he,x}return H!==null&&typeof H=="object"?(x[y]=$(H,p),x):(x[y]=H,x)},{})}function i(o,p){const x="___is_object";return o.points.forEach(y=>{"tags"in y&&(y.tags=$(y.tags,x)),"bindings"in y&&y.bindings&&y.bindings.forEac
7h((H,he)=>{y.bindings[he]=$(H,x)}),"mapping"in y&&(y.mapping=$(y.mapping,x))}),"survey"in o&&(Array.isArray(o.survey)?o.survey={}:o.survey=$(o.survey,x)),"workspace"in o&&Array.isArray(o.workspace)&&(o.workspace=n(p)),o}function I(o){if("workspace"in o){const x={provider:o.workspace.provider,enabled:o.workspace.enabled};return"authorized"in o.workspace&&(x.authorized=o.workspace.authorized),x}const p={provider:o.provider,enabled:o.enabled};return"authorized"in o&&(p.authorized=o.authorized),p}function r(o,p,x){const y=window.open(o,p,"toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=920, height=640");if(!y)return;const H=window.setInterval(()=>{y.closed&&(clearInterval(H),e.l7.emit("Integration/fetch",{provider:p,callback:x}))},1e3)}function d(o){return"workspace"in o?"authorized"in o.workspace&&o.workspace.authorized&&o.workspace.enabled:"authorized"in o&&o.authorized&&o.enabled}function c(o){return"workspace"in o?o.workspace.enabled:o.enabled}function u(o){const p={title:"Are you sure you want to cancel?",description:"You haven't finished working to this integration.",buttonCopy:"Yes, cancel",...o};return new Promise((x,y)=>{(0,e.to)({type:"confirm-modal",data:p,closeHandler:H=>{if(!H){y(Error("User canceled"));return}x(!0)}})})}t.d(z,["R",0,s])}),1087:(function(ke,z,t){var e=t(96231),s=t(11619),n=t(80672),$=t(76011);const i=(0,s.lw)("INTEGRATIONS_SERVER"),I=(0,e.nY)("integration",{state:()=>({integration:null}),getters:{get:r=>d=>{if(r.integration)return"workspace"in r.integration?r.integration.workspace[d]:r.integration[d]},accounts:r=>r.integration?("workspace"in r.integration?r.integration.workspace:r.integration).accounts:void 0,isSurveyIntegration:r=>r.integration?["points","survey","workspace"].every(d=>d in r.integration):!1},actions:{async fetch(r,d,c){const u=c?await i.get(`workspaces/${r}/surveys/${c}/integrations/${d}.json`).catch(o=>{throw this.integration={workspace:{provider:d,enabled:!1},points:[],survey:{}},o}):await i.get(`workspaces/${r}/integrations/${d}.json`).catch(o=>{throw this.integration={provider:d,enabled:!1},o});return u&&u.status===200&&(c?this.integration=(0,$.nt)(u.data,d):this.integration=Array.isArray(u.data)?(0,$.Oz)(d):u.data,this.updateIntegrationsListState((0,$.LJ)(this.integration))),u},connect(r,d){return i.patch(`workspaces/${r}/integrations/${d}.json`,{enabled:!0})},async disconnect(r,d){const c=await i.delete(`workspaces/${r}/integrations/${d}.json`);return c&&c.status===200&&this.updateIntegrationsListState(c.data),c},async updateSurvey(r,d,c,u){const o=await i.patch(`workspaces/${r}/surveys/${c}/integrations/${d}.json`,u);if(o&&o.status===200&&"survey"in this.integration){const{survey:p,points:x}=(0,$.nt)(o.data,d);this.integration.survey=p,this.integration.points=x}return o},async updatePoint(r,d,c,u){const o=await i.patch(`workspaces/${r}/surveys/${c}/surveypoints/${u.id}/integrations/${d}.json`,u);if(o&&o.status===200&&"survey"in this.integration){const{survey:p,points:x}=(0,$.nt)(o.data,d);this.integration.survey=p,this.integration.points=x}return o},async updateIntegration(r,d,c){const u=await i.patch(`workspaces/${r}/integrations/${d}.json`,c);return u&&u.status===200&&Object.keys(u.data).forEach(o=>{this.integration[o]=u.data[o]}),u},updateIntegrationsListState(r){if(!this.integration)return;const d="workspace"in this.integration?this.integration.workspace:this.integration,u=(0,n.Q)().getIntegrationByProvider(r.provider);Object.keys(r).filter(o=>o!=="provider").forEach(o=>{d[o]=r[o],u&&(u[o]=r[o])})},set(r,d){this.integration&&("workspace"in this.integration?this.integration.workspace[r]=d:this.integration[r]=d)}}});t.d(z,["D",0,I])}),54675:(function(ke,z){const t="https://assets.survicate.com/integrations",e=["https://assets.survicate.com/logos/icon-24.svg","https://assets.survicate.com/logos/icon-white.svg"],s={activecampaign:{src:`${t}/activecampaign/ic-active-campaign-logo2.svg`},amplitude:{src:`${t}/amplitude/Amplitude_shorthand_Blue.svg`},appstore:{src:`${t}/appstore/Appstore-logo.svg`},asana:{src:`${t}/asana/asana.svg`},attentive:{src:[`${t}/attentive/attentive.svg`,`${t}/attentive/attentive_darkmode.svg`]},bloomreach:{src:`${t}/bloomreach/bloomreach.svg`},braze:{src:[`${t}/braze/braze-logo.svg`,`${t}/braze/braze-logo-darkmode.svg`]},csvimport:{src:[`${t}/cloud-import/cloud-import.svg`,`${t}/cloud-import/cloud-import-dark.svg`]},customerio:{src:[`${t}/customerio/customerio.svg`,`${t}/customerio/customerio_darkmode.svg`]},drip:{src:[`${t}/drip/drip-brandmark-black.png`,`${t}/drip/drip_logo_darkmode.svg`]},email_notifications:{src:`${t}/email-notifications/notifications-2.svg`},front_app:{src:`${t}/front/front-logo.png`},fullstory:{src:[`${t}/fullstory/fullstory-mark-24-fix.svg`,`${t}/fullstory/fullstory_logo_darkmode.webp`]},g2:{src:`${t}/g2/G2_logo.svg`},gong:{src:`${t}/gong/gong-logo.webp`},google_analytics:{src:`${t}/g_analytics/logo_analytics.svg`},google_big_query:{src:`${t}/bigquery/bigquery-mark-24.svg`},google_meet:{src:`${t}/googlemeet/google-meet-logo.svg`},google_reviews:{src:`${t}/googlereviews/Google__G__logo.svg`},googleplay:{src:`${t}/googleplay/GooglePlay-logo.svg`},googlesheets:{src:`${t}/googlesheets/sheets.svg`},hubspot:{src:`${t}/hubspot/HubSpot_Logo.svg`},inbox_email:{src:`${t}/email-inbox/open-email.svg`},intercom:{src:[`${t}/intercom/ic-intercom-black4.svg`,`${t}/intercom/intercom_logo_darkmode.svg`]},intercom20:{src:[`${t}/intercom/ic-intercom-black4.svg`,`${t}/intercom/intercom_logo_darkmode.svg`]},iterable:{src:`${t}/iterable/iterable.svg`},jira:{src:`${t}/jira/jira-1.svg`},klaviyo:{src:[`${t}/klaviyo/klaviyo-mark.svg`,`${t}/klaviyo/klaviyo_logo_darkmode.svg`]},linear:{src:`${t}/linear/linear.svg`},livechat:{src:"https://www.livechat.com/favicon.ico"},mailchimp:{src:[`${t}/mailchimp/mailchimp.svg`,`${t}/mailchimp/mailchimp_logo_darkmode.svg`]},marketo:{src:`${t}/Marketo/ic-marketo-logo.svg`},microsoft:{src:`${t}/microsoft/microsoft.svg`},microsoft_teams:{src:`${t}/microsoft-teams/ms-teams-logo.svg`},mixpanel:{src:`${t}/mixpanel/mixpanel-mark-24.svg`},notion:{src:[`${t}/notion/notion.svg`,`${t}
7/notion/notion_darkmode.svg`]},one_signal:{src:`${t}/one_signal/one_signal.svg`},optimizely:{src:`${t}/optimizely/optimizely.svg`},pardot:{src:`${t}/salesforce/ic-sf-logo.svg`},productboard:{src:`${t}/productboard/productboard_logo.svg`},salesforce:{src:`${t}/salesforce/salesforce-mark-24.svg`},segment:{src:`${t}/Segment/segment-mark-24.svg`},segment_web:{src:`${t}/Segment/ic-logo-segment.svg`},sessioncam:{src:`${t}/sessioncam/glassbox-mark-24.svg`},slack:{src:`${t}/slack/ic-slack-logo.svg`},smartlook:{src:`${t}/Smartlook/loop.svg`},spotify:{src:`${t}/spotify/spotify.svg`},survicate:{src:e},tldv:{src:`${t}/tldv/tldv logo.png`},transcription:{src:[`${t}/transcription/transcription_logo_default.svg`,`${t}/transcription/transcription_logo_dark.svg`]},uxcam:{src:[`${t}/uxcam/uxcam_logo.svg`,`${t}/uxcam/uxcam_logo_darkmode.svg`]},webhooks:{src:e},woopra:{src:[`${t}/woopra/ic-woopra-logo.svg`,`${t}/woopra/woopra_logo_darkmode2.svg`]},wordpress:{src:[`${t}/wordpress/wordpress.svg`,`${t}/wordpress/wordpress_darkmode.svg`]},zapier:{src:`${t}/Zapier/zapier-mark-24.svg`},zendesk:{src:[`${t}/zendesk/zendesk-icon2.svg`,`${t}/zendesk/zendesk_darkmode.svg`]}};z.A=s}),10395:(function(ke,z,t){t.r(z),t.d(z,{default:function(){return Ce}});var e=t(20641),s=t(50953),n=t(53751),$=t(21678),i=t(63093),I=t(51082),r=t(11619),d=t(4121),c=t(75733),u=t(39245),o=t(90033),p=t(34744),x=t(46852),y=(0,e.pM)({__name:"Welcome",setup(Ae){function be(){(0,r.to)({type:"create-survey",size:"large"})}return(pe,J)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,o.C4)(["l-flex direction-column justify-center align-center text-center",pe.$style.component])},[(0,e.bF)((0,s.R1)(I.Og),{src:["insights/illustration-connect.svg","insights/illustration-connect-dark.svg"],style:{"max-width":"280px"}}),J[2]||(J[2]=(0,e.Lk)("h2",null,"Welcome to Research Hub!",-1)),J[3]||(J[3]=(0,e.Lk)("p",null," The Research Hub turns your customer feedback into actionable insights. With your guidance, AI automatically synthesizes feedback to provide you with valuable insights. To start, create and launch a survey or connect a data source. ",-1)),(0,e.Lk)("div",null,[(0,e.bF)((0,s.R1)(I.eF),{icon:(0,s.R1)(p.A),onClick:be},{default:(0,e.k6)(()=>[...J[0]||(J[0]=[(0,e.eW)(" Create survey ",-1)])]),_:1},8,["icon"]),(0,e.bF)((0,s.R1)(I.eF),{class:"air-left",icon:(0,s.R1)(x.A),tag:"router-link",to:{name:"research-hub-settings-data-sources"}},{default:(0,e.k6)(()=>[...J[1]||(J[1]=[(0,e.eW)(" Connect data source ",-1)])]),_:1},8,["icon"])])],2))}}),H={component:"Welcome_f215cb148e"},he=t(66262);const ee={};ee.$style=H;var we=(0,he.A)(y,[["__cssModules",ee]]),$e=(0,e.pM)({__name:"Assistant",setup(Ae){const be=(0,$.t)(),pe=(0,d.J)(),J=(0,c.t)(),_e=(0,u.M)(),oe=new AbortController,te=(0,s.KR)(!0);Promise.allSettled([pe.fetchQuestions(be.params.wId,oe.signal).catch(k=>{k.name!=="AbortError"&&(0,r.S7)({type:"danger",message:`Failed to load chats: ${(0,r.zc)(k)}`})}),J.fetchNotesCount(be.params.wId).catch(k=>k)]).finally(()=>{te.value=!1});const v=(0,e.EW)(()=>!_e.workspace.surveys_count&&J.noteCount===0);return(0,i.o)(()=>{oe.abort()}),(0,e.xo)(()=>{pe.$reset()}),(k,R)=>{const b=(0,e.g2)("router-view");return te.value?((0,e.uX)(),(0,e.Wv)((0,s.R1)(I.M6),{key:0})):((0,e.uX)(),(0,e.Wv)(b,{key:1},{default:(0,e.k6)(({Component:L})=>[(0,e.bF)(n.eB,{name:"component-fade",mode:"out-in",appear:""},{default:(0,e.k6)(()=>[v.value?((0,e.uX)(),(0,e.Wv)(we,{key:"welcome",style:{height:"100%"}})):((0,e.uX)(),(0,e.Wv)((0,e.$y)(L),{key:k.$route.path}))]),_:2},1024)]),_:1}))}}}),Ce=$e}),14345:(function(ke,z,t){t.r(z),t.d(z,{default:function(){return oe}});var e=t(20641),s=t(90033),n=t(50953),$=t(21678),i=t(16798),I=t(94394),r=t.n(I),d=t(51082),c=t(11619),u=t(53221),o=t(4121),p=t(85655),x=t(53751),y=t(53378),H=t(7417),he=t(95010),ee=(0,e.pM)({__name:"Item",props:{questionId:{},title:{},userId:{default:null},sourceUserName:{default:()=>{}}},emits:["delete"],setup(te){const v=(0,e.EW)(()=>(0,H.gL)(te.userId,te.sourceUserName));return(k,R)=>{const b=(0,e.g2)("router-link"),L=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("li",{class:(0,s.C4)(["relative",k.$style.component])},[(0,e.bo)(((0,e.uX)(),(0,e.Wv)(b,{"exact-active-class":"is-active",to:{name:"insights-assistant-question",params:{questionId:te.questionId}}},{default:(0,e.k6)(()=>[(0,e.bF)(he.A,{class:"air-right-double-spacing",tooltip:v.value.name||v.value.email,src:v.value.profile_url,"full-name":v.value.name||v.value.email||"A"},null,8,["tooltip","src","full-name"]),(0,e.eW)(" "+(0,s.v_)(te.title),
71)]),_:1},8,["to"])),[[L,te.title.length>25?te.title:void 0,void 0,{right:!0}]]),(0,e.bF)((0,n.R1)(d.eF),{class:(0,s.C4)(["type-icon",k.$style["delete-btn"]]),icon:{name:(0,n.R1)(y.A),size:15},onClick:R[0]||(R[0]=(0,x.D$)(Ie=>k.$emit("delete",te.questionId),["stop"]))},null,8,["icon","class"])],2)}}}),xe={component:"Item_b1f52079fa","delete-btn":"Item_c60b5735ff"},we=t(66262);const $e={};$e.$style=xe;var Ce=(0,we.A)(ee,[["__cssModules",$e]]);const Ae={class:"color-muted"};var be=(0,e.pM)({__name:"Navigation",props:{errorMessage:{default:""}},setup(te){const v=(0,p.E)(),k=(0,e.EW)(()=>v.organization.subscription.usage.organization_assistant_chats),R=(0,$.n)();function b(){R.push({name:"insights-assistant-new"})}const L={Today:0,"Previous 7 days":7,"Previous 30 days":30,"This year":365};function Ie(me){const Se=(0,i.B)(me.created_at,{unit:"day",addSuffix:!1});return Object.keys(L).find(Re=>parseInt(Se.split(" ")[0],10)<=L[Re])||"Older"}const le=(0,o.J)(),fe=(0,e.EW)(()=>le.questions.length),Pe=(0,e.EW)(()=>r()(le.questions,Ie));function De(me){c.l7.emit("Insights/showModal",{type:"remove-question",size:"small",data:{questionId:me}})}return(me,Se)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex direction-column",me.$style.component])},[(0,e.bF)(u.A,{"item-count":fe.value,"limit-usage":k.value,"limit-name":"organization_assistant_chats","limit-message":`
8        You can't create new chats on your current plan.
9        <br><strong>Upgrade</strong> your account to continue using research assistant.
10      `,onCreate:b},{default:(0,e.k6)(()=>[...Se[0]||(Se[0]=[(0,e.Lk)("strong",null,"Chats",-1)])]),_:1},8,["item-count","limit-usage"]),(0,e.Lk)("div",{class:(0,s.C4)([me.$style["list-wrapper"],"grow"])},[te.errorMessage?((0,e.uX)(),(0,e.Wv)((0,n.R1)(d.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(te.errorMessage),1)]),_:1})):((0,e.uX)(!0),(0,e.CE)(e.FK,{key:1},(0,e.pI)(Pe.value,(Re,Me)=>((0,e.uX)(),(0,e.CE)(e.FK,{key:Me},[(0,e.Lk)("h4",Ae,(0,s.v_)(Me),1),(0,e.Lk)("ul",{class:(0,s.C4)(["list-style-sidebar air",me.$style.list])},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(Re,de=>((0,e.uX)(),(0,e.Wv)(Ce,{key:de.id,"question-id":de.id,title:de.title,"user-id":de.user_id,"source-user-name":de.source_user_name,onDelete:De},null,8,["question-id","title","user-id","source-user-name"]))),128))],2)],64))),128))],2)],2))}}),pe={"component-fade-enter-active":"Navigation_f21bae9667","component-fade-leave-active":"Navigation_a660c4235b","component-fade-enter-from":"Navigation_fe08994448","component-fade-leave-to":"Navigation_d26186e1d3",component:"Navigation_bb8dab9afa","list-wrapper":"Navigation_f79b17ad48",list:"Navigation_d97cd04816",fadeIn:"Navigation_ec4a7b861d",pulseDanger:"Navigation_b67c3ebda8",pulseSuccess:"Navigation_a3dc266d74",pulseInfo:"Navigation_c842c456d8",pulseBrand:"Navigation_ede3c029a5",pulseBrandDark:"Navigation_f33bead578",fadeInFromNone:"Navigation_d018d07c3a",fadeInFromTop:"Navigation_ae4c10c51e",scaleUpDown:"Navigation_c743dd04ae","skeleton-pulse":"Navigation_e761376d9a",spin:"Navigation_c242092056"};const J={};J.$style=pe;var oe=(0,we.A)(be,[["__cssModules",J]])}),27620:(function(ke,z,t){t.r(z),t.d(z,{default:function(){return ct}});var e=t(20641),s=t(90033),n=t(50953),$=t(53751),i=t(5896),I=t(29867),r=t(6463),d=t(69821),c=t(34744),u=t(91830),o=t(72010),p=t(18987),x=t(21678),y=t(51082),H=t(11619),he=t(78980),ee=t(94579),xe=t(85655),we=t(53806),$e=t(4121),We=t(1334),Ce=t(75733),Ae=t(39245),be=t(35634),pe=t(54675),J=t(83076),_e=(0,e.pM)({__name:"LoadingIcon",props:{isLoading:{type:Boolean,default:!1}},setup(je){return(U,Xe)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["air",[U.$style.component,{"is-loading":je.isLoading}]])},[...Xe[0]||(Xe[0]=[(0,e.Lk)("svg",{xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",viewBox:"0 0 24 24"},[(0,e.Lk)("path",{d:"M15.175,6.525L16.957,11.87C17.051,12.15 17.27,12.37 17.549,12.462L22.894,14.243L17.549,16.026C17.27,16.119 17.05,16.339 16.957,16.618L15.175,21.963L13.393,16.618C13.3,16.339 13.081,16.119 12.802,16.026L7.457,14.243L12.802,12.462C13.081,12.369 13.301,12.149 13.394,11.87L15.175,6.524L15.175,6.525Z"}),(0,e.Lk)("path",{d:"M4.965,4.54L5.782,6.991C5.875,7.27 6.095,7.49 6.374,7.583L8.824,8.4L6.374,9.217C6.095,9.31 5.875,9.53 5.782,9.809L4.965,12.259L4.148,9.809C4.055,9.53 3.835,9.31 3.556,9.217L1.106,8.4L3.556,7.583C3.835,7.49 4.055,7.27 4.148,6.991L4.965,4.541L4.965,4.54Z"}),(0,e.Lk)("path",{d:"M10.743,2.037L11.174,3.331C11.267,3.61 11.487,3.829 11.765,3.922L13.058,4.352L11.765,4.784C11.486,4.877 11.267,5.097 11.174,5.376L10.743,6.669L10.313,5.376C10.22,5.097 10,4.877 9.72,4.784L8.427,4.354L9.72,3.922C9.999,3.829 10.219,3.61 10.312,3.331L10.742,2.037L10.743,2.037Z"})],-1)])],2))}}),oe={"component-fade-enter-active":"LoadingIcon_f6717380e6","component-fade-leave-active":"LoadingIcon_abc660cbb8","component-fade-enter-from":"LoadingIcon_fdf3a1614e","component-fade-leave-to":"LoadingIcon_caa768c811",component:"LoadingIcon_aed8abb01d",scaleUpDown:"LoadingIcon_c5ee922699",pulseDanger:"LoadingIcon_c4e392ec92",pulseSuccess:"LoadingIcon_fbfc484650",pulseInfo:"LoadingIcon_ee1a6dfefe",pulseBrand:"LoadingIcon_c2e512e7a7",pulseBrandDark:"LoadingIcon_ad24a51b2e",fadeInFromNone:"LoadingIcon_b9d985c3cc",fadeIn:"LoadingIcon_a4b01822f3",fadeInFromTop:"Lo
10adingIcon_b47136c27f","skeleton-pulse":"LoadingIcon_b0d207eacd",spin:"LoadingIcon_ccc51466cd"},te=t(66262);const v={};v.$style=oe;var R=(0,te.A)(_e,[["__cssModules",v]]),b=t(51736),L=t(78172),Ie=t(71747),le=t(54817),fe=t(61038),Pe=t(72853),De=t(52124),me=t(8158),Se=t(10200);const Re={class:"l-flex"},Me={class:"s-box s-small no-air"},de={class:"l-flex"},et=["onClick"],Ze=3,tt=5e3;var nt=(0,e.pM)({__name:"Onboarding",emits:["close"],setup(je){const U=(0,n.KR)(0);let Xe;function Qe(){Xe=window.setInterval(()=>{U.value<Ze-1?U.value+=1:U.value=0},tt)}(0,e.sV)(()=>{Qe()});function F(O){U.value=O,clearInterval(Xe),Qe()}return(0,e.xo)(()=>{clearInterval(Xe)}),(O,C)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["relative l-flex direction-column justify-center align-center",O.$style.component])},[(0,e.bF)((0,n.R1)(y.eF),{class:(0,s.C4)(["type-icon",O.$style["close-button"]]),icon:(0,n.R1)(b.A),onClick:C[0]||(C[0]=X=>O.$emit("close"))},null,8,["icon","class"]),(0,e.bF)($.eB,{name:"component-fade",mode:"out-in",duration:500},{default:(0,e.k6)(()=>[U.value===0?((0,e.uX)(),(0,e.CE)("div",{key:"slide-1",class:(0,s.C4)([O.$style.slide,O.$style["slide-1"]])},[C[2]||(C[2]=(0,e.Lk)("div",{class:"text-right air"},[(0,e.Lk)("div",null,"What are the most requested features?")],-1)),(0,e.Lk)("div",Re,[(0,e.Lk)("div",{class:(0,s.C4)(["air-right-double-spacing",O.$style.author])},[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(Se.kc)},null,8,["icon"])],2),C[1]||(C[1]=(0,e.Lk)("div",{class:"grow"},[(0,e.Lk)("span",null,[(0,e.eW)(" Based on 1,247 feedback entries, advanced filtering is the top request at 78% "),(0,e.Lk)("span",null,"1"),(0,e.eW)(". ")]),(0,e.Lk)("span",null,[(0,e.eW)(" Custom dashboards follow at 64%, especially from enterprise users "),(0,e.Lk)("span",null,"2"),(0,e.eW)(". ")]),(0,e.Lk)("span",null,[(0,e.eW)(" Mobile app support and dark mode are also highly requested "),(0,e.Lk)("span",null,"3"),(0,e.eW)("... ")])],-1))])],2)):U.value===1?((0,e.uX)(),(0,e.CE)("div",{key:"slide-2",class:(0,s.C4)([O.$style.slide,O.$style["slide-2"]])},[C[11]||(C[11]=(0,e.Lk)("h2",{class:"air"},[(0,e.Lk)("strong",null,"All your feedback in one place")],-1)),(0,e.Lk)("div",Me,[(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(L.A)},null,8,["icon"])]),C[3]||(C[3]=(0,e.eW)(" Reviews ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(Ie.A)},null,8,["icon"])]),C[4]||(C[4]=(0,e.eW)(" Chats ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(le.A)},null,8,["icon"])]),C[5]||(C[5]=(0,e.eW)(" Emails ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(fe.A)},null,8,["icon"])]),C[6]||(C[6]=(0,e.eW)(" Sheets ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(Pe.A)},null,8,["icon"])]),C[7]||(C[7]=(0,e.eW)(" Interviews ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(De.A)},null,8,["icon"])]),C[8]||(C[8]=(0,e.eW)(" Calls ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(me.A)},null,8,["icon"])]),C[9]||(C[9]=(0,e.eW)(" Surveys ",-1))]),(0,e.Lk)("div",null,[(0,e.Lk)("span",null,[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(Ie.A)},null,8,["icon"])]),C[10]||(C[10]=(0,e.eW)(" Tickets ",-1))])])],2)):U.value===2?((0,e.uX)(),(0,e.CE)("div",{key:"slide-3",class:(0,s.C4)([O.$style.slide,O.$style["slide-3"]])},[C[13]||(C[13]=(0,e.Lk)("div",{class:"text-right air"},[(0,e.Lk)("div",null,"What are users complaining about most?")],-1)),(0,e.Lk)("div",de,[(0,e.Lk)("div",{class:(0,s.C4)(["air-right-double-spacing",O.$style.author])},[(0,e.bF)((0,n.R1)(y.hj),{icon:(0,n.R1)(Se.kc)},null,8,["icon"])],2),C[12]||(C[12]=(0,e.Lk)("div",{class:"grow"},[(0,e.Lk)("span",null,[(0,e.eW)(" From 892 complaints, loading speed issues top the list at 67% "),(0,e.Lk)("span",null,"1"),(0,e.eW)(". ")]),(0,e.Lk)("span",null,[(0,e.eW)(" Navigation confusion affects 42% of users who can't find key features "),(0,e.Lk)("span",null,"2"),(0,e.eW)(". ")]),(0,e.Lk)("span",null,[(0,e.eW)(" Mobile responsiveness issues impact 38%, especially for new users "),(0,e.Lk)("span",null,"3"),(0,e.eW)("... ")])],-1))])],2)):(0,e.Q3)("v-if",!0)]),_:1}),(0,e.Lk)("div",{class:(0,s.C4)(["l-flex align-center",O.$style.indicator])},[((0,e.uX)(),(0,e.CE)(e.FK,null,(0,e.pI)(Ze,(X,B)=>(0,e.Lk)("button",{key:B,type:"button",class:(0,s.C4)({"is-active":U.value===B}),onClick:ae=>F(B)},null,10,et)),64))],2)],2))}}),He={"component-fade-enter-active":"Onboarding_ad827b8ff0","component-fade-leave-active":"Onboarding_fab942b6ba","component-fade-enter-from":"Onboarding_acbcd9e27a","component-fade-leave-to":"Onboarding_eaff8856b9",component:"Onboarding_e6fcc74299",fadeIn:"Onboarding_cd8198e362","close-button":"Onboarding_feb1ea7329",slide:"Onboarding_b90cc7f57b","slide-1":"Onboarding_a6a9e4ce35","slide-3":"Onboarding_fd137e9474",fadeInAnswer:"Onboarding_ae73b24713",author:"Onboarding_fbee77c7bf","slide-2":"Onboarding_ad8e46a67b",indicator:"Onboarding_f616825c03",pulseDanger:"Onboarding_f579c5cfd9",pulseSuccess:"Onboarding_ed76290070",pulseInfo:"Onboarding_ef79982b0f",pulseBrand:"Onboarding_d66b576fee",pulseBrandDark:"Onboarding_dbdafd619a",fadeInFromNone:"Onboarding_cd85ff99c9",fadeInFromTop:"Onboarding_ffe9c55540",scaleUpDown:"Onboarding_f1b37b0f00","skeleton-pulse":"Onboarding_cad197ea10",
10spin:"Onboarding_eb19574102"};const ft={};ft.$style=He;var st=(0,te.A)(nt,[["__cssModules",ft]]);const ot={class:"grow air-right"},at={class:"color-muted"},Je={key:0},rt={key:1,class:"text-center"},it={key:2},lt={class:"text-center air-double"},Ye={class:"grow air-right"},gt=2e3;var ut=(0,e.pM)({__name:"New",setup(je){const U=(0,n.Kh)({prompt:"",rangeIndex:5,provider:[]}),{isDarkMode:Xe}=(0,ee.W4)(),Qe=(0,e.EW)(()=>{if(!(U.provider.length<2))return U.provider.map(w=>{const K=pe.A[w]||pe.A.survicate;return{src:typeof K.src!="string"?K.src[Number(Xe.value)]:K.src,alt:w.charAt(0).toUpperCase()}})}),F=(0,n.KR)([]),O=(0,e.EW)(()=>U.provider.length===F.value.length?"All Feedback Sources":`${U.provider.length} ${(0,he.A)("Source",U.provider.length)} Selected`),C=(0,Ce.t)(),X=(0,Ae.M)(),B=(0,x.t)(),ae=(0,n.KR)(!0);C.fetchListing(B.params.wId,{id:"source",items_per_page:100}).then(w=>{F.value=w.data.values;const K=F.value.some(ue=>ue.value==="survicate");X.workspace.surveys_count>0&&!K&&F.value.unshift({label:"Surveys",value:"survicate"}),U.provider=F.value.map(ue=>ue.value)}).catch(w=>{H.l7.emit("Common/showAlert",{type:"danger",message:`Failed to fetch Integrations: ${(0,H.zc)(w)}`,flash:!0,timeout:5e3})}).finally(()=>{ae.value=!1});const Ne=(0,e.EW)(()=>[{label:"Select Feedback Sources",tooltip:F.value.length<2?{content:"Feature becomes available as you connect more sources",placement:"right"}:void 0,disabled:F.value.length<2,handler:()=>{H.l7.emit("Insights/showModal",{type:"select-feedback-sources",size:"small",data:{providerOptions:F.value,providers:U.provider},closeHandler:w=>{w&&(U.provider=w)}})}},{label:"Connect Integration",icon:(0,n.IG)(c.A),attr:{to:{name:"integrations-list",params:{category:"feedback-source"}}}}]),ne=[{label:"Past hour",value:w=>(0,i.x)((0,I.O)(w,1))},{label:"Past day",value:w=>(0,i.x)((0,r.o)(w))},{label:"Past week",value:w=>(0,i.x)((0,r.o)((0,d.e)(w,7)))},{label:"Past month",value:w=>(0,i.x)((0,r.o)((0,d.e)(w,30)))},{label:"Past quarter",value:w=>(0,i.x)((0,r.o)((0,d.e)(w,90)))},{label:"Past year",value:w=>(0,i.x)((0,r.o)((0,d.e)(w,365)))}],re=(0,e.EW)(()=>ne.map((w,K)=>({label:w.label,handler:()=>U.rangeIndex=K})).filter((w,K)=>K!==U.rangeIndex)),q=(0,e.EW)(()=>ne[U.rangeIndex]?.label),ie=(0,We.S)(),Le=(0,e.EW)(()=>ie.limitReached("organization_assistant_chats")),Be=(0,xe.E)(),Ee=(0,e.EW)(()=>({usage:Be.organization.subscription.usage.organization_assistant_chats,limit:Be.organization.subscription.limits.organization_assistant_chats})),Ke=(0,we.n)(),Te=(0,e.EW)(()=>Ke.user?.first_name||"User"),Fe=[{label:"\u{1F50D}&nbsp;&nbsp;Find common issues",value:"What are the most common issues among our users?"},{label:"\u{1F440}&nbsp;&nbsp;Read popular requests",value:"What do our users suggest we should improve or introduce?"},{label:"\u{1F914}&nbsp;&nbsp;Learn what's confusing",value:"Is there anything our users find confusing, or difficult to understand?"},{label:"\u{1F4DD}&nbsp;&nbsp;Sum up feature feedback",value:"How should we improve [type in your feature, or product name here]"}],Ue=(0,$e.J)(),ce=(0,x.n)(),V=(0,n.KR)(!1),Z=(0,n.KR)(!1);function ve(){if(!U.prompt)return;V.value=!0,Z.value=!1;const w=new Date,K={prompt:U.prompt,date_range:[ne[U.rangeIndex].value(w),(0,i.x)(w)],provider:U.provider.length===F.value.length?[]:U.provider};Ue.ask(B.params.wId,K,{onInit:ue=>{ce.push({name:"insights-assistant-question",params:{questionId:`${ue.threadId}`}})}}).catch(ue=>{Z.value=!0,H.l7.emit("Common/showAlert",{id:"insights-assistant-error",type:"danger",message:`Failed to generate answer: ${(0,H.zc)(ue)}`,flash:!0,timeout:15e3})}).finally(()=>{V.value=!1})}const ge=(0,n.KR)(!p.A.get("survicate.assistant-onboarding-closed")),P=(0,be.c)();ge.value&&P.toggleSubNavigation(!1),(0,e.wB)(()=>P.showSubNavigation,w=>{w&&ge.value?ge.value=!1:!w&&!p.A.get("survicate.assistant-onboarding-closed")&&(ge.value=!0)});function G(){p.A.set("survicate.assistant-onboarding-closed","true",{expires:90}),ge.value=!1}function ze(w){const K=w.replace(/\+/g," ").trim();return K.startsWith("[")&&K.endsWith("]")?K.slice(1,-1).trim():K}return(0,e.sV)(()=>{const w=(sessionStorage.getItem("INSIGHTS_ASSISTANT_QUERY")||"").trim();sessionStorage.removeItem("INSIGHTS_ASSISTANT_QUERY");const K=typeof B.params.prompt=="string"?B.params.prompt:"",ue=typeof B.query.prompt=="string"?B.query.prompt:"",Ge=ze(K||ue),qe=(w||Ge).slice(0,gt);if(qe){if(U.prompt=qe,Le.value){(0,H.S7)({id:"insights-assistant-limit",type:"warning",message:"You've reached your chat limit. Upgrade to continue using Research Assistant.",timeout:1e4});return}Ge&&!w&&ce.replace({name:"insights-assistant-new",query:{...B.query,prompt:void 0}}),ve()}}),(w,K)=>{const ue=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex direction-column",w.$style.component])},[((0,e.uX)(),(0,e.Wv)(e.Im,{to:"#survicate-module-header"},[(0,e.Lk)("div",ot,[(0,e.Lk)("span",at,[Ee.value.limit!==null?((0,e.uX)(),(0,e.CE)(e.FK,{key:0},[(0,e.eW)((0,s.v_)(Ee.value.usage)+"/"+(0,s.v_)(Ee.value.limit)+" chats used this month ",1)],64)):((0,e.uX)(),(0,e.CE)(e.FK,{key:1},[(0,e.eW)((0,s.v_)(Ee.value.usage)+" chats used this month ",1)],64))])]),(0,e.bF)((0,n.R1)(y.eF),{tag:"router-link",img:[{src:"assistant/intercom.svg",alt:"Intercom"},{src:"assistant/hubspot.svg",alt:"HubSpot"},{src:"assistant/zendesk.svg",alt:"Zendesk"}],to:{name:"integrations-list",params:{category:"feedback-source"}}},{default:(0,e.k6)(()=>[...K[2]||(K[2]=[(0,e.eW)(" Connect Feedback ",-1)])]),_:1})])),(0,e.Lk)("div",{class:(0,s.C4)(["l-flex align-center justify-center grow",[w.$style.content,{"has-onboarding":ge.value}]])},[(0,e.bF)($.eB,{name:"component-fade",mode:"out-in"},{default:(0,e.k6)(()=>[V.value?((0,e.uX)(),(0,e.CE)("div",Je,[(0,e.bF)((0,n.R1)(y.M6))])):Z.value?((0,e.uX)(),(0,e.CE)("div",rt,[(0,e.bF)((0,n.R1)(y.Og),{class:"air",src:["survey/widget-uninstalled.svg","survey/widget-uninstalled-dark.svg"],style:{"max-width":"280px"}}),K[4]||(K[4]=(0,e.Lk)("h2",null,[(0,e.Lk)("strong",null,"Oops! Trouble loading your answer")],-1)),K[5]||(K[5]=(0,e.Lk)("p",null,"We're really sorry for the inconvenience. It seems we're having a bit of trouble fetching the answer you requested. These glitches are usually temporary, so a quick retry often fixes it right up.",-1)),(0,e.bF)((0,n.R1)(y.eF),{onClick:ve},{default:(0,e.k6)(()=>[...K[3]||(K[3]=[(0,e.eW)(" Try again ",-1)])]),_:1})])):((0,e.uX)(),(0,e.CE)("div",it,[(0,e.Lk)("div",lt,[(0,e.bF)(R),(0,e.Lk)("h1",null,[(0,e.Lk)("strong",null,"What can I help you with"+(0,s.v_)(Te.value?`, ${Te.value}
10`:"")+"?",1)])]),(0,e.bF)((0,n.R1)(y.uo),{class:"relative air","display-block":"","flag-check":!Le.value,"flag-title":"Limit reached!","flag-message":`
11              You can't create new chats on your current plan.
12              <br><strong>Upgrade</strong> your account to continue using research assistant.
13            `},{default:(0,e.k6)(({isDisabled:Ge})=>[(0,e.bF)((0,n.R1)(y.kz),{modelValue:U.prompt,"onUpdate:modelValue":K[0]||(K[0]=qe=>U.prompt=qe),class:(0,s.C4)(["no-air",w.$style["prompt-textarea"]]),"is-loading":V.value,"shift-new-line":"",disabled:Ge||!q.value,placeholder:"Ask about your feedback\u2026",rows:"4",onSubmit:ve},null,8,["modelValue","class","is-loading","disabled"]),(0,e.Lk)("div",{class:(0,s.C4)(["l-flex align-center",w.$style["actions-bar"]])},[(0,e.Lk)("div",Ye,[(0,e.bF)((0,n.R1)(y.Jc),{menu:Ne.value},{default:(0,e.k6)(()=>[(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,n.R1)(y.eF),{class:"type-icon s-small","is-loading":ae.value,img:Qe.value,"img-limit":2,icon:{name:(0,n.R1)(u.A),position:"right"},external:""},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(O.value),1)]),_:1},8,["is-loading","img","icon"])),[[ue,"Feedback sources used in the chat"]])]),_:1},8,["menu"]),(0,e.bF)((0,n.R1)(y.Jc),{menu:re.value},{default:(0,e.k6)(()=>[(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,n.R1)(y.eF),{class:"type-icon s-small",icon:{name:(0,n.R1)(u.A),position:"right"}},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(q.value),1)]),_:1},8,["icon"])),[[ue,"Feedback date range used"]])]),_:1},8,["menu"])]),(0,e.bF)((0,n.R1)(y.eF),{class:"color-brand s-small",icon:(0,n.R1)(o.A),disabled:Le.value||!U.prompt||V.value||ae.value||!q.value,onClick:ve},null,8,["icon","disabled"])],2)]),_:1},8,["flag-check"]),(0,e.bF)(J.A,{modelValue:U.prompt,"onUpdate:modelValue":K[1]||(K[1]=Ge=>U.prompt=Ge),options:Fe},null,8,["modelValue"])]))]),_:1})],2),ge.value?((0,e.uX)(),(0,e.Wv)(st,{key:0,class:(0,s.C4)(w.$style["onboarding-screen"]),onClose:G},null,8,["class"])):(0,e.Q3)("v-if",!0)],2)}}}),dt={"component-fade-enter-active":"New_c6bfdff4c8","component-fade-leave-active":"New_ccfdfd4da1","component-fade-enter-from":"New_eb5c724864","component-fade-leave-to":"New_c545b9480f",component:"New_ec48df1910",fadeIn:"New_a97a2d5792",content:"New_f384d9a3d9","actions-bar":"New_c55363f3ff","prompt-textarea":"New_ed5be35a44","onboarding-screen":"New_bcd8c8ecfe",pulseDanger:"New_ca644b4824",pulseSuccess:"New_cd515118f1",pulseInfo:"New_d7189f4349",pulseBrand:"New_a31a0b0f35",pulseBrandDark:"New_a7385f181b",fadeInFromNone:"New_b1783fcc90",fadeInFromTop:"New_d1dccbd751",scaleUpDown:"New_cb630211d4","skeleton-pulse":"New_bad7829dfa",spin:"New_d62ab78e7a"};const Ve={};Ve.$style=dt;var ct=(0,te.A)(ut,[["__cssModules",Ve]])}),19799:(function(ke,z,t){t.r(z),t.d(z,{default:function(){return Qe}});var e=t(20641),s=t(90033),n=t(50953),$=t(53751),i=t(43172),I=t(38221),r=t.n(I),d=t(44282),c=t(21678),u=t(63093),o=t(51082),p=t(11619),x=t(4121),y=t(75733),H=t(7417),he=t(95010),ee=t(32041),xe=t(56348),we=t(35105),$e=t(96166),We=t(28896),Ce=t(66603);const Ae={class:"l-flex align-center"},be={class:"no-air"};var pe=(0,e.pM)({__name:"SurveyPreview",props:{id:{},name:{}},emits:["close"],setup(F){const O=(0,c.t)(),C=(0,e.EW)(()=>{const X=O.params.oId,B=O.params.wId;if(X&&B)return{name:"surveyBuilder-analysis",params:{oId:X,wId:B,surveyId:F.id}}});return(X,B)=>{const ae=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(X.$style.component)},[(0,e.Lk)("div",Ae,[(0,e.bF)(Ce.A,{class:"s-small air-right",provider:"survicate"}),(0,e.Lk)("div",{class:(0,s.C4)(["grow l-flex align-center",X.$style["survey-title"]])},[(0,e.bo)(((0,e.uX)(),(0,e.CE)("h4",be,[(0,e.Lk)("strong",null,(0,s.v_)(F.name),1)])),[[ae,F.name]])],2),(0,e.bF)((0,n.R1)(o.eF),{class:"type-link size-text air-left no-wrap",tag:"router-link",to:C.value,target:"_blank",icon:{name:(0,n.R1)(We.A),position:"right"}},{default:(0,e.k6)(()=>[...B[0]||(B[0]=[(0,e.eW)(" See results ",-1)])]),_:1},8,["to","icon"])]),B[1]||(B[1]=(0,e.Lk)("hr",{class:"s-small"},null,-1))],2)}}}),J={component:"SurveyPreview_ba4d1b8e1e","survey-title":"SurveyPreview_b36e9e75c8"},_e=t(66262);const oe={};oe.$style=J;var v=(0,_e.A)(pe,[["__cssModules",oe]]),k=t(55781);const R={class:"l-flex align-center"},b={class:"no-air"};var L=(0,e.pM)({__name:"NotePreview",props:{id:{},created_at:{},provider:{},title:{},content_introduction:{},rating:{default:null},noteIds:{default:()=>{}}},emits:["close"],setup(F,{emit:O}){const C=O;
13function X(){p.l7.emit("Insights/showNote",{noteId:`${F.id}`,fetchPayload:F.noteIds?.length?{noteIds:F.noteIds}:void 0}),C("close")}return(B,ae)=>{const Ne=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(B.$style.component)},[(0,e.Lk)("div",R,[(0,e.bF)(Ce.A,{class:"s-small air-right",provider:F.provider},null,8,["provider"]),(0,e.Lk)("div",{class:(0,s.C4)(["grow l-flex align-center",B.$style["note-title"]])},[(0,e.bo)(((0,e.uX)(),(0,e.CE)("h4",b,[(0,e.Lk)("strong",null,(0,s.v_)(F.title),1)])),[[Ne,F.title]]),F.rating?((0,e.uX)(),(0,e.Wv)(k.A,{key:0,class:"air-left",rating:F.rating},null,8,["rating"])):(0,e.Q3)("v-if",!0)],2),(0,e.bF)((0,n.R1)(o.eF),{class:"type-link size-text air-left no-wrap",icon:{name:(0,n.R1)(We.A),position:"right"},onClick:X},{default:(0,e.k6)(()=>[...ae[0]||(ae[0]=[(0,e.eW)(" See full note ",-1)])]),_:1},8,["icon"])]),ae[1]||(ae[1]=(0,e.Lk)("hr",{class:"s-small"},null,-1)),(0,e.Lk)("p",null,(0,s.v_)(F.content_introduction),1)],2)}}}),Ie={component:"NotePreview_debaee0186","note-title":"NotePreview_ffacb61dd6"};const le={};le.$style=Ie;var Pe=(0,_e.A)(L,[["__cssModules",le]]);const De={key:1},me=15;var Se=(0,e.pM)({__name:"Annotation",props:{isActive:{type:Boolean},position:{},ids:{}},emits:["close"],setup(F){const O=(0,n.KR)([]),C=(0,n.KR)(0),X=(0,e.EW)(()=>O.value[C.value]);function B(){C.value>0&&(C.value-=1)}function ae(){C.value<O.value.length-1&&(C.value+=1)}const Ne={survey:v,note:Pe},ne=(0,y.t)(),re=(0,c.t)(),q=(0,n.KR)(!0),ie=(0,n.KR)(""),Le=new AbortController,Be=(0,$e.S)();async function Ee(V){let Z=[];const ve=await Be.fetch(re.params.wId,{filters_group:[{filters:[{id:"survey_id",condition:"equals",value:V}],operator:"and"}],items_per_page:V.length}).catch(ge=>{ie.value=(0,p.zc)(ge)});ve&&ve.status===200&&(Z=V.map(ge=>{const P=ve.data.surveys.find(({id:G})=>G===ge);return P?{id:P.id,name:P.name,type:"survey"}:null}).filter(ge=>ge!==null)),O.value.push(...Z)}function Ke(V){return ie.value="",ne.fetchAnnotationNotes(re.params.wId,V,Le.signal).then(Z=>{!Z||Z.status!==200||(O.value.push(...Z.data.items.map(ve=>({...ve,type:"note",noteIds:V}))),O.value.length||(ie.value=`No data found for the selected annotations: ${V.join(", ")}`))}).catch(Z=>{ie.value=(0,p.zc)(Z)})}const Te=[],Fe=[];if(F.ids.forEach(V=>{V.startsWith("survey-")?Te.push(V.replace("survey-","")):Fe.push(parseInt(V,10))}),Te.length||Fe.length){const V=[];Te.length&&V.push(Ee(Te)),Fe.length&&V.push(Ke(Fe)),Promise.allSettled(V).finally(()=>{q.value=!1})}else q.value=!1;(0,e.xo)(()=>{Le.abort()});const Ue=(0,n.Kh)({top:`${F.position.top-5}px`,left:`${F.position.left}px`}),ce=(0,e.rk)("componentEl");return(0,e.sV)(()=>{if(!ce.value||!ce.value.parentElement)return;const V=ce.value.parentElement.getBoundingClientRect(),Z=ce.value.getBoundingClientRect(),ve=V.left+ce.value.parentElement.clientWidth;Z.right>=ve?Ue.left=`${F.position.left-me-(Z.right-ve)}px`:Z.left<=V.left&&(Ue.left=`${F.position.left+me+(V.left-Z.left)}px`)}),(V,Z)=>((0,e.uX)(),(0,e.CE)("div",{ref:"componentEl",class:(0,s.C4)(V.$style.component),style:(0,s.Tr)(Ue)},[(0,e.bF)(we.A,{"is-loading":q.value,"loading-config":{height:"40px"},"error-message":ie.value,"display-condition":!!O.value.length},{default:(0,e.k6)(()=>[X.value?((0,e.uX)(),(0,e.Wv)((0,e.$y)(Ne[X.value.type]),(0,e.v6)({ke
13y:0},X.value,{class:{"air-half":O.value.length>1},onClose:Z[0]||(Z[0]=ve=>V.$emit("close"))}),null,16,["class"])):(0,e.Q3)("v-if",!0),O.value.length>1?((0,e.uX)(),(0,e.CE)("div",De,[(0,e.bF)((0,n.R1)(o.eF),{class:"type-icon s-small",icon:(0,n.R1)(ee.A),disabled:C.value===0,onClick:B},null,8,["icon","disabled"]),(0,e.eW)(" "+(0,s.v_)(C.value+1)+" of "+(0,s.v_)(O.value.length)+" ",1),(0,e.bF)((0,n.R1)(o.eF),{class:"type-icon s-small",icon:(0,n.R1)(xe.A),disabled:C.value===O.value.length-1,onClick:ae},null,8,["icon","disabled"])])):(0,e.Q3)("v-if",!0)]),_:1},8,["is-loading","error-message","display-condition"])],6))}}),Re={"component-fade-enter-active":"Annotation_ec2e235145","component-fade-leave-active":"Annotation_c107eeb8a9","component-fade-enter-from":"Annotation_a913c0df1c","component-fade-leave-to":"Annotation_ca09dacfeb",component:"Annotation_ef831ca7a4",fadeIn:"Annotation_a076a64bb7",pulseDanger:"Annotation_d5b23d95a7",pulseSuccess:"Annotation_b8eb0c8ade",pulseInfo:"Annotation_d4f66ef5a3",pulseBrand:"Annotation_ae0032defb",pulseBrandDark:"Annotation_ffd397d521",fadeInFromNone:"Annotation_a7b32c325c",fadeInFromTop:"Annotation_cf1d7ebdf6",scaleUpDown:"Annotation_f1c09386d6","skeleton-pulse":"Annotation_dadb25c80c",spin:"Annotation_a4c85b9e74"};const Me={};Me.$style=Re;var et=(0,_e.A)(Se,[["__cssModules",Me]]),Ze=t(72010),tt=(0,e.pM)({__name:"PromptTextarea",props:{questionId:{}},emits:["init","success","error"],setup(F,{emit:O}){const C=O,X=(0,n.Kh)({prompt:""}),B=(0,x.J)(),ae=(0,e.EW)(()=>B.streamingStatus.isStreaming),Ne=(0,e.rk)("promptTextarea");(0,e.wB)(ae,q=>{q||(0,e.dY)(()=>{Ne.value?.$el.querySelector("textarea")?.focus()})});const ne=(0,c.t)();function re(q){q&&(X.prompt="",C("error",{text:"",buttonConfig:void 0}),B.ask(ne.params.wId,{id:parseInt(F.questionId,10),prompt:q},{onInit:()=>C("init"),onDone:()=>C("success")}).catch(ie=>{C("error",{text:(0,p.zc)(ie),buttonConfig:{text:"Try again",handler:()=>re(q)}})}))}return(q,ie)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["relative",q.$style.component])},[(0,e.bF)((0,n.R1)(o.kz),{ref:"promptTextarea",modelValue:X.prompt,"onUpdate:modelValue":ie[0]||(ie[0]=Le=>X.prompt=Le),class:(0,s.C4)(["no-air",q.$style["prompt-textarea"]]),"shift-new-line":"",disabled:ae.value,placeholder:"Ask follow-up...",onSubmit:ie[1]||(ie[1]=Le=>re(X.prompt))},null,8,["modelValue","class","disabled"]),(0,e.bF)((0,n.R1)(o.eF),{class:(0,s.C4)(["color-brand s-small",q.$style["submit-btn"]]),disabled:!X.prompt,"is-loading":ae.value,icon:(0,n.R1)(Ze.A),onClick:ie[2]||(ie[2]=Le=>re(X.prompt))},null,8,["class","disabled","is-loading","icon"])],2))}}),nt={"component-fade-enter-active":"PromptTextarea_c8b3b722ab","component-fade-leave-active":"PromptTextarea_a63dc60617","component-fade-enter-from":"PromptTextarea_f08dd7f0fd","component-fade-leave-to":"PromptTextarea_a184511586",component:"PromptTextarea_ddfb81b568",fadeIn:"PromptTextarea_d5e943bc98","prompt-textarea":"PromptTextarea_bd70a7c1dd","submit-btn":"PromptTextarea_ee85bd16f5",pulseDanger:"PromptTextarea_d4e8cd930a",pulseSuccess:"PromptTextarea_bfd2efa58f",pulseInfo:"PromptTextarea_a912291248",pulseBrand:"PromptTextarea_e25fb56ab4",pulseBrandDark:"PromptTextarea_b62d6bdc97",fadeInFromNone:"PromptTextarea_df5e28b5e6",fadeInFromTop:"PromptTextarea_f1a2e2f65c",scaleUpDown:"PromptTextarea_aa1173328d","skeleton-pulse":"PromptTextarea_d7b1b768e5",spin:"PromptTextarea_ee6c907741"};const He={};He.$style=nt;var mt=(0,_e.A)(tt,[["__cssModules",He]]),st=t(14271),ot=t(63748),at=t(65283),Je=t(19875);const rt={key:1,class:"grow"};var it=(0,e.pM)({__name:"AiAnswer",props:{isStreaming:{type:Boolean,default:!1},message:{default:""},stage:{default:null}},emits:["click"],setup(F){const O=(0,e.EW)(()=>(0,Je._A)(F.stage)),C=(0,e.EW)(()=>(0,Je.Mi)(F.stage)),X="_sva"in window,B=(0,n.KR)(!1),ae=(0,c.t)();function Ne(ne){B.value=!0,p.l7.emit("Segment/track",{name:"assistant_response_rated",data:{sentiment:ne,workspace_id:ae.params.wId,chat_url:window.location.href}}),ne==="negative"&&window._sva?window._sva.showSurvey("f357ee71348380fb",{forceDisplay:!0,displayMethod:"immediately"}
13):(0,p.S7)({type:"success",message:"Thank you for your feedback!"})}return(ne,re)=>{const q=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("li",{class:(0,s.C4)(ne.$style.component)},[(0,e.Lk)("div",{class:(0,s.C4)(["l-flex justify-end",{"air-half":X}])},[!F.message&&F.isStreaming?((0,e.uX)(),(0,e.CE)("div",{key:0,class:(0,s.C4)(["grow l-flex align-center",ne.$style.content])},[(0,e.bF)((0,n.R1)(o.$i),{class:"air-right-double-spacing",state:C.value},null,8,["state"]),(0,e.bF)((0,n.R1)(o.Sx),null,{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(O.value),1)]),_:1})],2)):((0,e.uX)(),(0,e.CE)("div",rt,[(0,e.bo)((0,e.Lk)("div",{class:(0,s.C4)(ne.$style.content),onClick:re[0]||(re[0]=ie=>ne.$emit("click",ie))},null,2),[[(0,n.R1)(at.Zr),F.message,"assistant"]]),F.isStreaming&&F.stage?((0,e.uX)(),(0,e.CE)("div",{key:0,class:(0,s.C4)(["l-flex align-center",ne.$style.content])},[(0,e.bF)((0,n.R1)(o.$i),{class:"air-right-double-spacing",state:C.value},null,8,["state"]),(0,e.bF)((0,n.R1)(o.Sx),null,{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(O.value),1)]),_:1})],2)):(0,e.Q3)("v-if",!0)]))],2),X?((0,e.uX)(),(0,e.CE)("div",{key:0,class:(0,s.C4)([ne.$style.actions,{"is-hidden":F.isStreaming}])},[(0,e.bo)((0,e.bF)((0,n.R1)(o.eF),{class:"type-icon",icon:(0,n.R1)(st.A),disabled:B.value,onClick:re[1]||(re[1]=ie=>Ne("positive"))},null,8,["icon","disabled"]),[[q,"Good response"]]),(0,e.bo)((0,e.bF)((0,n.R1)(o.eF),{class:"type-icon air-left-spacing",disabled:B.value,icon:(0,n.R1)(ot.A),onClick:re[2]||(re[2]=ie=>Ne("negative"))},null,8,["disabled","icon"]),[[q,"Bad response"]])],2)):(0,e.Q3)("v-if",!0)],2)}}}),lt={component:"AiAnswer_ee62ba23be",content:"AiAnswer_a1ca63636a",actions:"AiAnswer_b5e3927e2e"};const Ye={};Ye.$style=lt;var ut=(0,_e.A)(it,[["__cssModules",Ye]]);const dt={class:"grow"},Ve={class:"no-air"},yt={class:"color-muted"};var ct=(0,e.pM)({__name:"Question",props:{questionId:{},oId:{},wId:{}},setup(F){const O=(0,e.rk)("listEl"),C=(0,x.J)(),X=(0,e.EW)(()=>C.question),B=(0,e.EW)(()=>X.value?(0,H.gL)(X.value.user_id,X.value.source_user_name):null),ae=(0,e.EW)(()=>X.value?X.value.messages.reduce((P,G)=>P+(G.relevant_notes?.length||0),0):0),Ne=(0,e.EW)(()=>X.value?(0,d.B)(X.value.created_at,new Date,{addSuffix:!0}):"-"),ne=(0,y.t)(),re=(0,c.t)();function q(P){if(ne.noteCount){p.l7.emit("Segment/track",{name:P,data:{notes_count:ne.noteCount,annotations_count:ae.value}});return}ne.fetchNotesCount(re.params.wId).then(()=>{p.l7.emit("Segment/track",{name:P,data:{notes_count:ne.noteCount,annotations_count:ae.value}})})}function ie(){(0,p.lW)(window.location.href).then(()=>{p.l7.emit("Common/showAlert",{type:"success",message:`URL ${window.location.href} copied to clipboard`,flash:!0,timeout:3e3}),q("hub_assistant_response_shared")}).catch(P=>{p.l7.emit("Common/showAlert",{type:"danger",message:P,flash:!0,timeout:3e3})})}async function Le(){await(0,e.dY)(),p.l7.emit("ModuleContent/scrollToBottom")}const Be=(0,n.KR)(!0),Ee=(0,n.KR)("");let Ke=new AbortController;function Te(P){Ke.abort(),Ke=new AbortController,Be.value=!0,Ee.value="",C.fetchQuestion(re.params.wId,P,Ke.signal).then(()=>{if(X.value===null){Ee.value="Oops! There's been an issue loading this page. Please contact support for help";return}q("hub_assistant_response_viewed")}).catch(G=>{G.name!=="AbortError"&&(Ee.value=`Failed to fetch chat: ${(0,p.zc)(G)}`)}).finally(()=>{Be.value=!1})}!C.question||`${C.question.id}`!==F.questionId?Te(F.questionId):(Be.value=!1,q("hub_assistant_response_viewed")),(0,e.wB)(()=>F.questionId,P=>{`${C.question?.id}`!==P&&Te(P)}),(0,e.wB)(X,P=>{P===null&&(Ee.value="Oops! There's been an issue loading this page. Please contact support for help")}),(0,u.s)(()=>{Ke.abort()}),(0,u.o)(()=>{Ke.abort()});const Fe=(0,n.Kh)({type:"danger",text:"",buttonConfig:void 0});async function Ue(P){Fe.text=P.text,Fe.buttonConfig=P.buttonConfig,await(0,e.dY)(),Le()}const ce=(0,n.Kh)({isActive:!1,ids:[],position:{top:0,left:0}});function V(P){const G=P.target;if(ce.isActive=!1,G instanceof HTMLButtonElement&&G.dataset.ids){if(!G.dataset.ids.includes("survey-")){const K=G.dataset.ids.split(",").map(ue=>parseInt(ue,10));
13p.l7.emit("Insights/showNote",{noteId:`${K[0]}`,fetchPayload:{noteIds:K}});return}G.classList.toggle("is-active");let ze=G.offsetTop,w=G.offsetLeft;G.offsetParent&&G.offsetParent.tagName==="TD"&&(ze+=G.offsetParent.offsetTop,w+=G.offsetParent.offsetLeft),ce.position={top:ze,left:w},ce.ids=G.dataset.ids.split(","),ce.isActive=!0}}const Z=r()(()=>{O.value?.querySelectorAll("button.note-annotation").forEach(P=>{P.classList.remove("is-active")}),ce.isActive&&(ce.isActive=!1)},100,{leading:!0,trailing:!1});document.addEventListener("mousedown",Z),window.addEventListener("resize",Z);const ve=(0,c.n)();function ge(P){ve.replace({name:"insights-assistant-question",query:{...re.query,noteId:P.noteId,noteIds:P.fetchPayload?.noteIds.join(",")||void 0}})}return(0,e.wB)(()=>re.query.noteId,P=>{if(!P)return;const G=re.query.noteIds,ze=typeof G=="string"&&G.length?G.split(",").map(w=>parseInt(w,10)).filter(w=>!isNaN(w)):[];p.l7.emit("Insights/showModal",{type:"note-details",size:"large",hideCloseButton:!0,fixedPosition:!0,data:{wId:re.params.wId,noteId:`${P}`,fetchPayload:ze.length?{noteIds:ze}:void 0},closeHandler:()=>{ve.replace({name:"insights-assistant-question",query:{...re.query,noteId:void 0,noteIds:void 0}})}})},{immediate:!0}),p.l7.on("Insights/showNote",ge),(0,e.xo)(()=>{p.l7.off("Insights/showNote",ge),Ke.abort(),document.removeEventListener("mousedown",Z),window.removeEventListener("resize",Z)}),(P,G)=>{const ze=(0,e.gN)("tooltip"),w=(0,e.gN)("sticky");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex direction-column",P.$style.component])},[Be.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(o.M6),{key:0})):!X.value||Ee.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(o.gN),{key:1,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(Ee.value),1)]),_:1})):((0,e.uX)(),(0,e.CE)(e.FK,{key:2},[((0,e.uX)(),(0,e.Wv)(e.Im,{to:"#survicate-module-header"},[(0,e.bo)((0,e.bF)(he.A,{class:"air-right",src:B.value?.profile_url,"full-name":B.value?.name||B.value?.email||"A"},null,8,["src","full-name"]),[[ze,"Chat author: "+(B.value?.name||B.value?.email)]]),(0,e.Lk)("div",dt,[(0,e.Lk)("h4",Ve,[(0,e.Lk)("strong",null,(0,s.v_)(B.value?.name||B.value?.email||"Anonymous"),1)]),(0,e.Lk)("small",yt,(0,s.v_)(Ne.value),1)]),(0,e.bF)((0,n.R1)(o.eF),{icon:(0,n.R1)(i.A),onClick:ie},{default:(0,e.k6)(()=>[...G[1]||(G[1]=[(0,e.eW)(" Share ",-1)])]),_:1},8,["icon"])])),(0,e.Lk)("ul",{ref:"listEl",class:(0,s.C4)(["list-style-none relative grow",P.$style["answer-list"]])},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(X.value.messages,(K,ue)=>((0,e.uX)(),(0,e.CE)(e.FK,{key:K.role+ue},[K.role==="user"?((0,e.uX)(),(0,e.CE)("li",{key:0,class:(0,s.C4)(["text-right air",P.$style.question])},[(0,e.Lk)("div",null,(0,s.v_)(K.content),1)],2)):((0,e.uX)(),(0,e.Wv)(ut,{key:1,class:"air",message:K.content,"is-streaming":(0,n.R1)(C).streamingStatus.isStreaming&&ue===X.value.messages.length-1,stage:ue===X.value.messages.length-1?(0,n.R1)(C).streamingStatus.stage:null,onClick:V},null,8,["message","is-streaming","stage"]))],64))),128)),Fe.text?((0,e.uX)(),(0,e.CE)("li",{key:0,class:(0,s.C4)(["air",P.$style["prompt-error"]])},[(0,e.bF)((0,n.R1)(o.gN),{class:"no-air",type:Fe.type,"button-config":Fe.buttonConfig},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(Fe.text),1)]),_:1},8,["type","button-config"])],2)):(0,e.Q3)("v-if",!0),ce.isActive?((0,e.uX)(),(0,e.Wv)(et,(0,e.v6)({ke
13y:ce.ids[0]},ce,{onMousedown:G[0]||(G[0]=(0,$.D$)(()=>{},["stop"])),onClose:(0,n.R1)(Z)}),null,16,["onClose"])):(0,e.Q3)("v-if",!0)],2),(0,e.Q3)(" -30px is the module content's bottom padding (gutter * 2), so the bar sticks to the visible edge instead of hovering above it "),(0,e.bo)(((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(P.$style["prompt-dock"])},[(0,e.Lk)("div",{class:(0,s.C4)(P.$style["prompt-textarea"])},[(0,e.bF)(mt,{"question-id":F.questionId,onInit:Le,onSuccess:Le,onError:Ue},null,8,["question-id"])],2)],2)),[[w,{offset:"-30px"},void 0,{bottom:!0}]])],64))],2)}}}),je={"component-fade-enter-active":"Question_f7b9183951","component-fade-leave-active":"Question_a3d757bad6","component-fade-enter-from":"Question_e5c4912e76","component-fade-leave-to":"Question_cb34cb9a1e",component:"Question_c33609acce","answer-list":"Question_d2578d5a10",fadeIn:"Question_e3b6974a96",question:"Question_c83fe29493","prompt-error":"Question_fd47bef503","prompt-dock":"Question_badeaa03dd","prompt-textarea":"Question_bf990797c9",pulseDanger:"Question_f4be2cd341",pulseSuccess:"Question_a9a67386d1",pulseInfo:"Question_dc58e64ac4",pulseBrand:"Question_ee1a6790bd",pulseBrandDark:"Question_b727e9446b",fadeInFromNone:"Question_daf057aa3a",fadeInFromTop:"Question_d469a5c392",scaleUpDown:"Question_b92368d0ea","skeleton-pulse":"Question_d127196dc8",spin:"Question_cf55f616c8"};const U={};U.$style=je;var Qe=(0,_e.A)(ct,[["__cssModules",U]])}),59507:(function(ke,z,t){t.r(z),t.d(z,{default:function(){return Rt}});var e=t(20641),s=t(90033),n=t(50953),$=t(21678),i=t(51082),I=t(4121),r=t(75733),d=t(1087),c=t(80672),u=t(11619),o=t(94579),p=t(33907);const x={class:"text-right"};var y=(0,e.pM)({__name:"CreateIssue",props:{source:{},description:{default:()=>{}},label:{default:()=>{}},id:{}},emits:["close","set-close-handler-payload"],setup(a,{emit:M}){const _=M,m=(0,r.t)(),l=(0,n.Kh)({title:"",description:"",team:"",status:"",priority:"",project:"",assignee:"",labels:[]});m.note&&(l.title=m.note.title,l.description=m.note.content),a.label&&a.description&&(l.title=a.label,l.description=a.description);const D={title:{required:p.A},description:{required:p.A},team:{required:p.A}},{validation:E}=(0,o.$i)(l,D),N=(0,d.D)(),A=(0,e.EW)(()=>N.integration),g=(0,e.EW)(()=>(A.value?.priorities||[]).map(T=>({label:T.label,value:`${T.value}`})));function h(T,f){return!A.value||!A.value[T]?[]:A.value[T][f]||[]}
13const j=(0,e.EW)(()=>[{label:"Team",key:"team",options:A.value?.teams||[],placeholder:"Select one option",error:E.team.error,allowSearch:!0,focus:()=>E.team.$reset(),blur:()=>E.team.$touch(),handler:()=>{l.status="",l.priority="",l.project="",l.assignee="",l.labels=[]}},{label:"Status (optional)",key:"status",options:h("workflowStates",l.team),placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Priority (optional)",key:"priority",options:g.value,placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Project (optional)",key:"project",options:h("projects",l.team),placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Assignee (optional)",key:"assignee",options:A.value?.users||[],placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Add label (optional)",key:"labels",options:h("issueLabels",l.team),placeholder:"Select one or multiple options",allowClear:!0,allowSearch:!0}]),se=(0,$.t)(),Q=(0,n.KR)(!1),S=(0,n.KR)("");async function ye(){await E.$validate()&&(Q.value=!0,S.value="",(0,u.lw)("INTEGRATIONS_SERVER").post(`workspaces/${se.params.wId}/integrations/linear/issue`,{...l,priority:parseInt(l.priority,10),link:window.location.href,object_id:a.id,source:a.source}).then(T=>{u.l7.emit("Common/showAlert",{type:"success",message:"Linear issue created successfully",timeout:1e4,flash:!0,buttonConfig:{text:"Go to Linear issue",props:{tag:"a",href:`${T.data.url}`,target:"_blank"}}}),N.fetch(se.params.wId,"linear").catch(()=>null),_("set-close-handler-payload",!0),_("close")}).catch(T=>{S.value=`Failed to create Linear issue: ${(0,u.zc)(T)}`}).finally(()=>{Q.value=!1}))}return(T,f)=>((0,e.uX)(),(0,e.CE)(e.FK,null,[S.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(S.value),1)]),_:1})):(0,e.Q3)("v-if",!0),f[11]||(f[11]=(0,e.Lk)("h2",{class:"h1 air"}," Create a new Linear issue from the insight ",-1)),(0,e.bF)((0,n.R1)(i.yF),{modelValue:l.title,"onUpdate:modelValue":f[0]||(f[0]=W=>l.title=W),placeholder:"Title",error:(0,n.R1)(E).title.error,onFocus:f[1]||(f[1]=W=>(0,n.R1)(E).title.$reset()),onBlur:f[2]||(f[2]=W=>(0,n.R1)(E).title.$touch())},{default:(0,e.k6)(()=>[...f[7]||(f[7]=[(0,e.eW)(" Title ",-1)])]),_:1},8,["modelValue","error"]),(0,e.bF)((0,n.R1)(i.kz),{modelValue:l.description,"onUpdate:modelValue":f[3]||(f[3]=W=>l.description=W),placeholder:"Description","max-rows":6,error:(0,n.R1)(E).description.error,onFocus:f[4]||(f[4]=W=>(0,n.R1)(E).description.$reset()),onBlur:f[5]||(f[5]=W=>(0,n.R1)(E).description.$touch())},{default:(0,e.k6)(()=>[...f[8]||(f[8]=[(0,e.eW)(" Description ",-1)])]),_:1},8,["modelValue","error"]),((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(j.value,W=>((0,e.uX)(),(0,e.CE)("div",{key:W.key},[(0,e.bF)((0,n.R1)(i.G9),{modelValue:l[W.key],"onUpdate:modelValue":vt=>l[W.key]=vt,options:W.options,placeholder:W.placeholder,error:W.error,"allow-search":W.allowSearch,"allow-clear":W.allowClear,onFocus:W.focus,onBlur:W.blur,onChange:W.handler},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(W.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","options","placeholder","error","allow-search","allow-clear","onFocus","onBlur","onChange"])]))),128)),(0,e.Lk)("div",x,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",onClick:f[6]||(f[6]=W=>T.$emit("close"))},{default:(0,e.k6)(()=>[...f[9]||(f[9]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,n.R1)(i.eF),{class:"color-brand air-left-double","is-loading":Q.value,onClick:ye},{default:(0,e.k6)(()=>[...f[10]||(f[10]=[(0,e.eW)(" Submit ",-1)])]),_:1},8,["is-loading"])])],64))}}),he=y,ee=t(14493);const xe={class:"text-right"};var we=(0,e.pM)({__name:"RemoveQuestion",props:{questionId:{type:Number,required:!0}},emits:["close","set-close-handler-payload"],setup(a,{emit:M}){const _=a,m=M,l=(0,I.J)(),D=(0,$.t)(),E=(0,$.n)(),N=(0,n.KR)(!1),A=(0,n.KR)("");function g(){N.value=!0,A.value="",l.removeQuestion(D.params.wId,_.questionId).then(async()=>{const h={id:"chat-removed",type:"success",message:"Chat removed successfully",flash:!0,timeout:5e3};D.params.questionId===`${_.questionId}`?(await(0,u.yy)(500),E.push({name:"insights-assistant"}).then(()=>{u.l7.emit("Common/showAlert",h)})):u.l7.emit("Common/showAlert",h),m("close")}).catch(h=>{A.value=`Failed to remove chat: ${(0,u.zc)(h)}`}).finally(()=>{N.value=!1})}return(h,j)=>((0,e.uX)(),(0,e.CE)(e.FK,null,[A.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:0,t
13ype:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(A.value),1)]),_:1})):(0,e.Q3)("v-if",!0),j[3]||(j[3]=(0,e.Lk)("h2",{class:"h1"}," Remove chat? ",-1)),j[4]||(j[4]=(0,e.Lk)("p",null,"Are you sure you want to remove this chat? This cannot be undone.",-1)),(0,e.Lk)("div",xe,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",onClick:j[0]||(j[0]=se=>h.$emit("close"))},{default:(0,e.k6)(()=>[...j[1]||(j[1]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,n.R1)(i.eF),{class:"color-danger air-left-double","is-loading":N.value,onClick:g},{default:(0,e.k6)(()=>[...j[2]||(j[2]=[(0,e.eW)(" Remove chat ",-1)])]),_:1},8,["is-loading"])])],64))}}),We=we,Ce=t(6821),Ae=t(52806),be=t(43172),pe=t(53378),J=t(51736),_e=t(48117),oe=t(91830),te=t(38221),v=t.n(te),k=t(66603);const R={class:"no-air air-right grow"},b={class:"color-muted"};var L=(0,e.pM)({__name:"Header",props:{noteId:{default:()=>{}},title:{},provider:{},provider_url:{default:null},feedback_attributes:{default:null},navigation:{default:null},requestedNoteId:{default:()=>{}},fetchPayload:{default:()=>{}}},emits:["close","remove","show-notification","show-linear-modal"],setup(a,{emit:M}){const _=M,m=(0,e.EW)(()=>{if(a.fetchPayload&&"noteIds"in a.fetchPayload&&a.requestedNoteId){const S=a.fetchPayload.noteIds.indexOf(parseInt(a.requestedNoteId,10));if(S===-1)return null;let ye=null,T=null;return S>0&&(ye=a.fetchPayload.noteIds[S-1]),S<a.fetchPayload.noteIds.length-1&&(T=a.fetchPayload.noteIds[S+1]),{total_items:a.fetchPayload.noteIds.length,current_position:S+1,prev_id:ye,next_id:T}}return a.navigation}),l=(0,$.n)(),D=(0,$.t)();function E(){!m.value||!m.value.prev_id||l.push({name:D.name,query:{...D.query,noteId:m.value.prev_id}})}function N(){!m.value||!m.value.next_id||l.push({name:D.name,query:{...D.query,noteId:m.value.next_id}})}const A=v()(S=>{S.key==="o"&&E(),S.key==="p"&&N()},100);document.addEventListener("keyup",A),(0,e.xo)(()=>{document.removeEventListener("keyup",A)});const g=(0,d.D)(),h=(0,c.Q)(),j=(0,e.EW)(()=>!!h.getIntegrationByProvider("linear")?.enabled),se=(0,e.EW)(()=>{const S=g.integration;return!S?.links||!a.noteId?!1:!!Object.keys(S.links.feedback).length&&!!S.links.feedback[a.noteId]}),Q=(0,e.EW)(()=>{let S=[{label:"Linear issues",icon:(0,n.IG)(Ce.A),disabled:!a.noteId,hidden:!j.value||D.query.tab==="Insights",handler:()=>{if(!se.value){_("show-linear-modal",{type:"create-linear-issue",source:"feedback"});return}_("show-linear-modal",{type:"linear-issues-list"})}},{label:"Create Linear issue",icon:(0,n.IG)(Ce.A),disabled:!a.noteId,hidden:!j.value||D.query.tab!=="Insights",handler:()=>{_("show-linear-modal",{type:"create-linear-issue",source:"insight"})}},{label:"View in source",icon:(0,n.IG)(Ae.A),disabled:!a.noteId,hidden:!a.provider_url,href:a.provider_url},{label:"View in source app",icon:(0,n.IG)(Ae.A),disabled:!a.noteId,hidden:!a.feedback_attributes?.URL,href:a.feedback_attributes?.URL},{label:"Copy feedback URL",icon:(0,n.IG)(be.A),disabled:!a.noteId,handler:()=>{const{href:ye}=l.resolve({name:D.name,query:{...D.query,noteId:a.noteId}}),T=`${window.location.origin}${ye}`;(0,u.lW)(T).then(()=>{_("show-notification",{type:"success",message:"URL copied to clipboard"}),u.l7.emit("Segment/track",{name:"hub_note_shared",data:{note_source:a.provider}})}).catch(f=>{_("show-notification",{type:"danger",message:f})})}},{label:"Delete feedback",icon:(0,n.IG)(pe.A),disabled:!a.noteId,handler:()=>_("remove")},{label:"Close",icon:(0,n.IG)(J.A),handler:()=>_("close")}];return S=S.filter(ye=>!ye.hidden),S});return(S,ye)=>{const T=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex align-center",S.$style.component])},[(0,e.bF)(k.A,{class:"air-right",provider:a.provider},null,8,["provider"]),(0,e.Lk)("h2",R,[(0,e.Lk)("strong",null,(0,s.v_)(a.title),1)]),(0,e.Lk)("div",{class:(0,s.C4)(["no-wrap l-flex align-center",S.$style.actions])},[m.value&&m.value.total_items>1?((0,e.uX)(),(0,e.CE)(e.FK,{key:0},[(0,e.Lk)("span",null,[(0,e.eW)((0,s.v_)(m.value.current_position)+" ",1),(0,e.Lk)("span",b," / "+(0,s.v_)(m.value.total_items),1)]),(0,e.bo)((0,e.bF)((0,n.R1)(i.eF),{class:"type-icon air-left-double-spacing",icon:(0,n.R1)(_e.A),disabled:m.value.prev_id===null,onClick:E},null,8,["icon","disabled"]),[[T,{content:"Previous Note (Keyboard: O)",container:"#survicate-active-modal"}]]),(0,e.bo)((0,e.bF)((0,n.R1)(i.eF),{class:"type-icon air-left-spacing",icon:(0,n.R1)(oe.A),disabled:m.value.next_id===null,onClick:N},null,8,["icon","disabled"]),[[T,{content:"Next Note (Keyboard: P)",container:"#survicate-active-modal"}]]),(0,e.Lk)("div",{class:(0,s.C4)(S.$style.separator)},null,2)],64)):(0,e.Q3)("v-if",!0),((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(Q.value,f=>((0,e.uX)(),(0,e.CE)(e.FK,{key:f.label},[f.href?(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.eF),{key:0,class:"type-icon",icon:f.icon,tag:"a",href:f.href,target:"_blank",disabled:f.disabled},null,8,["icon","href","disabled"])),[[T,{content:f.label,container:"#survicate-active-modal"}]]):(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.eF),{key:1,class:"type-icon",icon:f.icon,disabled:f.disabled,onClick:f.handler},null,8,["icon","disabled","onClick"])),[[T,{content:f.label,container:"#survicate-active-modal"}]])],64))),128))],2)],2)}}}),Ie={component:"Header_da7b6ad508",separator:"Header_b3befb05b7"}
13,le=t(66262);const fe={};fe.$style=Ie;var De=(0,le.A)(L,[["__cssModules",fe]]),me=t(53751),Se=t(48173),Re=t(81756),Me=t(65283);const de={class:"l-flex"},et={key:0},Ze={class:"s-button-group is-vertical air-right-double"};var tt=(0,e.pM)({__name:"Content",props:{content:{},conversation:{default:()=>{}}},emits:["edit-authors"],setup(a){const M=(0,n.KR)(!!a.conversation&&!a.content);function _(m){M.value=m,u.l7.emit("Segment/track",{name:"hub_feedback_view_switched",data:{view:m?"full_content":"insights"}})}return(m,l)=>{const D=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(m.$style.component)},[(0,e.Lk)("div",de,[a.conversation?((0,e.uX)(),(0,e.CE)("div",et,[(0,e.Lk)("div",Ze,[(0,e.bo)((0,e.bF)((0,n.R1)(i.eF),{class:(0,s.C4)(["type-icon",{"is-active":!M.value}]),icon:(0,n.R1)(Se.A),disabled:!a.content,onClick:l[0]||(l[0]=E=>_(!1))},null,8,["icon","disabled","class"]),[[D,{content:a.content?"Insights":"Insights unavailable",container:"#survicate-active-modal"},void 0,{right:!0}]]),(0,e.bo)((0,e.bF)((0,n.R1)(i.eF),{class:(0,s.C4)(["type-icon",{"is-active":M.value}]),icon:(0,n.R1)(Re.A),onClick:l[1]||(l[1]=E=>_(!0))},null,8,["icon","class"]),[[D,{content:"Full content",container:"#survicate-active-modal"},void 0,{right:!0}]])])])):(0,e.Q3)("v-if",!0),(0,e.bF)(me.eB,{name:"component-fade",mode:"out-in"},{default:(0,e.k6)(()=>[M.value?a.conversation&&M.value?((0,e.uX)(),(0,e.CE)("ul",{key:"messages",class:(0,s.C4)(["list-style-none",m.$style["message-list"]])},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(a.conversation.messages,E=>((0,e.uX)(),(0,e.CE)("li",{key:E.content,class:"l-flex align-start air-half"},[(0,e.Lk)("button",{class:"h4 air-right",type:"button",onClick:l[2]||(l[2]=N=>m.$emit("edit-authors"))},(0,s.v_)(E.author),1),(0,e.bo)((0,e.Lk)("div",null,null,512),[[(0,n.R1)(Me.Zr),E.content,"analysis"]])]))),128))],2)):(0,e.Q3)("v-if",!0):(0,e.bo)(((0,e.uX)(),(0,e.CE)("div",{key:"content",class:(0,s.C4)(m.$style.content)},null,2)),[[(0,n.R1)(Me.Zr),a.content,"analysis"]])]),_:1})])],2)}}}),nt={component:"Content_bb55b2919a",content:"Content_e6a3f87d41","message-list":"Content_d5a449c475"};const He={};He.$style=nt;var mt=(0,le.A)(tt,[["__cssModules",He]]),st=t(59093),ot=t(55781),at=t(70135),Je=t.n(at);const rt={key:0,class:"no-air air-right"},it={class:"grow"},lt=["onClick"],Ye=["onClick"],gt=["onClick"];var ut=(0,e.pM)({__name:"EditableList",props:(0,e.zz)({options:{},align:{default:"left"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const M=(0,e.fn)(a,"modelValue"),_=(0,n.KR)(!1),m=(0,e.EW)(()=>a.options.filter(N=>Array.isArray(M.value)?!M.value.includes(N.value):M.value!==N.value)),l=(0,e.EW)(()=>{if(Array.isArray(M.value))return M.value.map(A=>({label:Je()(a.options.find(g=>g.value===A)?.label||"",{length:30}),value:A})).filter(A=>A.label);const N=a.options.find(({value:A})=>A===M.value);return{label:N?.label||"",class:N?.class||null}});function D(N){Array.isArray(M.value)?M.value=[...M.value,N]:M.value=N}function E(N){if(_.value=!1,Array.isArray(M.value)){const A=[...M.value],g=A.indexOf(N);g!==-1&&(A.splice(g,1),M.value=A)}else M.value=N}return(N,A)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex",N.$style.component])},[N.$slots.default?((0,e.uX)(),(0,e.CE)("h4",rt,[(0,e.RG)(N.$slots,"default")])):(0,e.Q3)("v-if",!0),(0,e.Lk)("div",it,[(0,e.bF)((0,n.R1)(i.dz),{placement:"bottom-end",container:"#survicate-active-modal","auto-size":"","is-open":_.value,"onUpdate:isOpen":A[1]||(A[1]=g=>_.value=g)},{trigger:(0,e.k6)(({toggle:g})=>[(0,e.Lk)("button",{type:"button",class:(0,s.C4)([N.$style["dropdown-button"],"text-"+a.align]),onClick:h=>g()},[Array.isArray(l.value)?((0,e.uX)(!0),(0,e.CE)(e.FK,{key:0},(0,e.pI)(l.value,h=>((0,e.uX)(),(0,e.CE)("span",{key:h.value,class:(0,s.C4)(["s-tag style-solid",{"has-close-btn":_.value}])},[(0,e.eW)((0,s.v_)(h.label)+" ",1),_.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.eF),{key:0,icon:(0,n.R1)(J.A),onClick:(0,me.D$)(j=>E(h.value),["stop"])},null,8,["icon","onClick"])):(0,e.Q3)("v-if",!0)],2))),128)):l.value.label?((0,e.uX)(),(0,e.CE)("span",{key:1,class:(0,s.C4)(["s-tag style-solid",[l.value.class,{"has-close-btn":_.value}]])},[(0,e.eW)((0,s.v_)(l.value.label)+" ",1),_.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.eF),{key:0,icon:(0,n.R1)(J.A),onClick:A[0]||(A[0]=(0,me.D$)(h=>E(""),["stop"]))},null,8,["icon"])):(0,e.Q3)("v-if",!0)],2)):(0,e.Q3)("v-if",!0)],10,lt)]),default:(0,e.k6)(({hide:g})=>[m.value.length?((0,e.uX)(),(0,e.CE)("ul",{key:0,class:(0,s.C4)(["list-style-dropdown",N.$style["dropdown-list"]]),onClick:h=>g()},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(m.value,h=>((0,e.uX)(),(0,e.CE)("li",{key:h.value},[(0,e.Lk)("button",{type:"button",onClick:j=>D(h.value)},(0,s.v_)(h.label),9,gt)]))),128))],10,Ye)):(0,e.Q3)("v-if",!0)]),_:1},8,["is-open"])])],2))}}),dt={component:"EditableList_b791bf492f","dropdown-button":"EditableList_bd25e81ff7","dropdown-list":"EditableList_f9a7ba0477"};const Ve={};Ve.$style=dt;var ct=(0,le.A)(ut,[["__cssModules",Ve]]);const je={key:0},U={class:"color-muted"},Xe={class:"color-muted"};var Qe=(0,e.pM)({__name:"Details",props:{wId:{},noteId:{},sentiment:{default:""},created_at:{},rating:{default:null},provider_pretty_name:{},user_attributes:{default:null},feedback_attributes:{default:null}},emits:["show-notification"],setup(a,{emit:M}){const _=M,m=(0,n.Kh)({sentiment:a.sentiment||""}),l=(0,r.t)(),D=[{label:"Positive",value:"positive",class:"color-success"},{label:"Neutral",value:"neutral",class:null},{label:"Negative",value:"negative",class:"color-danger"},{label:"Mixed",value:"mixed",class:"color-warning"}];(0,e.wB)(()=>a.sentiment,g=>{m.sentiment=g||""});const E=(0,n.KR)(!1);function N(g){E.value=!0,g.sentiment===""&&(g.sentiment=null),l.updateNote(a.wId,a.noteId,g).then(()=>{_("show-notification",{type:"success",message:"Message updated successfully"}),g.sentiment&&u.l7.emit("Segment/track",{name:"hub_note_sentiment_changed"})}).catch(h=>{m.sentiment=a.sentiment||"",_("show-notification",{type:"danger",message:`Failed to update message: ${(0,u.zc)(h)}`})}).finally(()=>{E.value=!1})}const A=(0,e.EW)(()=>
13{if(!a.feedback_attributes)return{};const g={...a.feedback_attributes};return delete g.URL,g});return(g,h)=>{const j=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(g.$style.component)},[(0,e.bF)(ct,{modelValue:m.sentiment,"onUpdate:modelValue":[h[0]||(h[0]=se=>m.sentiment=se),h[1]||(h[1]=se=>N({sentiment:se}))],options:D,align:"right"},{default:(0,e.k6)(()=>[...h[2]||(h[2]=[(0,e.Lk)("strong",null,"Sentiment",-1)])]),_:1},8,["modelValue"]),h[7]||(h[7]=(0,e.Lk)("hr",{class:"s-small"},null,-1)),h[8]||(h[8]=(0,e.Lk)("h4",null,[(0,e.Lk)("strong",null,"Feedback attributes")],-1)),(0,e.Lk)("ul",{class:(0,s.C4)(["list-style-none",[g.$style.list,{air:a.user_attributes}]])},[(0,e.Lk)("li",null,[h[3]||(h[3]=(0,e.Lk)("span",{class:"color-muted"}," Date: ",-1)),(0,e.Lk)("span",null,(0,s.v_)((0,n.R1)(st.A)(a.created_at)),1)]),a.rating?((0,e.uX)(),(0,e.CE)("li",je,[h[4]||(h[4]=(0,e.Lk)("span",{class:"color-muted"}," Rating: ",-1)),(0,e.bF)(ot.A,{class:"air-left",rating:a.rating},null,8,["rating"])])):(0,e.Q3)("v-if",!0),(0,e.Lk)("li",null,[h[5]||(h[5]=(0,e.Lk)("span",{class:"color-muted"}," Source: ",-1)),(0,e.Lk)("span",null,(0,s.v_)(a.provider_pretty_name),1)]),((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(A.value,(se,Q)=>((0,e.uX)(),(0,e.CE)("li",{key:Q},[(0,e.Lk)("span",U,(0,s.v_)(Q)+": ",1),(0,e.bo)((0,e.Lk)("span",null,null,512),[[(0,n.R1)(Me.Zr),se,"analysis"],[j,{content:Q+": "+se,container:"#survicate-active-modal",theme:"tooltip-long"}]])]))),128))],2),a.user_attributes?((0,e.uX)(),(0,e.CE)(e.FK,{key:0},[h[6]||(h[6]=(0,e.Lk)("h4",null,[(0,e.Lk)("strong",null,"User attributes")],-1)),(0,e.Lk)("ul",{class:(0,s.C4)(["list-style-none",g.$style.list])},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(a.user_attributes,(se,Q)=>((0,e.uX)(),(0,e.CE)("li",{key:Q},[(0,e.Lk)("span",Xe,(0,s.v_)(Q)+": ",1),(0,e.bo)((0,e.Lk)("span",null,null,512),[[(0,n.R1)(Me.Zr),se,"analysis"],[j,{content:Q+": "+se,container:"#survicate-active-modal",theme:"tooltip-long"}]])]))),128))],2)],64)):(0,e.Q3)("v-if",!0)],2)}}}),F={component:"Details_bd54bbfeb0",list:"Details_cc0aa9a437"};const O={};O.$style=F;var X=(0,le.A)(Qe,[["__cssModules",O]]);const B={class:"text-right"};var ae=(0,e.pM)({__name:"Confirm",props:{isLoading:{type:Boolean,required:!0}},emits:["cancel","confirm"],setup(a){return(M,_)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(M.$style.component)},[(0,e.Lk)("div",{class:(0,s.C4)(M.$style.content)},[_[4]||(_[4]=(0,e.Lk)("h2",{class:"h1"}," Remove note? ",-1)),_[5]||(_[5]=(0,e.Lk)("p",null," Are you sure you want to remove this feedback note? This cannot be undone. ",-1)),(0,e.Lk)("div",B,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",disabled:a.isLoading,onClick:_[0]||(_[0]=m=>M.$emit("cancel"))},{default:(0,e.k6)(()=>[..._[2]||(_[2]=[(0,e.eW)(" Cancel ",-1)])]),_:1},8,["disabled"]),(0,e.bF)((0,n.R1)(i.eF),{class:"color-danger air-left-double","is-loading":a.isLoading,onClick:_[1]||(_[1]=m=>M.$emit("confirm"))},{default:(0,e.k6)(()=>[..._[3]||(_[3]=[(0,e.eW)(" Remove note ",-1)])]),_:1},8,["is-loading"])])],2)],2))}}),Ne={"component-fade-enter-active":"Confirm_de50e5e407","component-fade-leave-active":"Confirm_cbe2c02a24","component-fade-enter-from":"Confirm_a30b9ef7da","component-fade-leave-to":"Confirm_f6fe764f6a",component:"Confirm_dba0a09dbc",fadeIn:"Confirm_add623f84f",content:"Confirm_a45262036e",pulseDanger:"Confirm_c87be30134",pulseSuccess:"Confirm_c19e3224d8",pulseInfo:"Confirm_c0976863a1",pulseBrand:"Confirm_f52b49f60d",pulseBrandDark:"Confirm_e2de788bd8",fadeInFromNone:"Confirm_fa2dc48e39",fadeInFromTop:"Confirm_df19d20af2",scaleUpDown:"Confirm_a251152096","skeleton-pulse":"Confirm_bf5546e4f2",spin:"Confirm_a57affd8af"};const ne={};ne.$style=Ne;var q=(0,le.A)(ae,[["__cssModules",ne]]);const ie={class:"text-right"};var Le=(0,e.pM)({__name:"EditAuthors",props:{wId:{type:String,required:!0},noteId:{type:Number,required:!0},authors:{type:Array,required:!0}},emits:["cancel","update"],setup(a,{emit:M}){const _=a,m=M,l=_.authors.reduce((Q,S)=>(Q[S.id]=S.name,Q),{}),D=(0,n.Kh)({...l}),E=(0,e.EW)(()=>_.authors.some(({id:Q,name:S})=>D[Q]!==S)),N={...Object.keys(D).reduce((Q,S)=>(Q[S]={required:p.A},Q),{})},{validation:A}=(0,o.$i)(D,N),g=(0,n.KR)(!1),h=(0,n.KR)(""),j=(0,r.t)();async function se(){await A.$validate()&&(g.value=!0,h.value="",(0,u.lw)("FEEDBACKHUB_API").patch(`${_.wId}/notes/${_.noteId}/authors`,D).then(async()=>{await j.updateNoteConversation(_.wId,_.noteId),m("update")}).catch(Q=>{h.value=`Failed to update: ${(0,u.zc)(Q)}`}).finally(()=>{g.value=!1}))}return(Q,S)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(Q.$style.component)},[(0,e.Lk)("div",{class:(0,s.C4)(Q.$style.content)}
13,[h.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(h.value),1)]),_:1})):(0,e.Q3)("v-if",!0),S[3]||(S[3]=(0,e.Lk)("h2",{class:"h1"}," Recording participants ",-1)),S[4]||(S[4]=(0,e.Lk)("p",null,"Change the names of the recording participants.",-1)),(0,e.Lk)("div",null,[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(D,(ye,T)=>((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.yF),{key:T,modelValue:D[T],"onUpdate:modelValue":f=>D[T]=f,error:(0,n.R1)(A)[T].error,onFocus:f=>(0,n.R1)(A)[T].$reset(),onBlur:f=>(0,n.R1)(A)[T].$touch()},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)((0,n.R1)(l)[T]),1)]),_:2},1032,["modelValue","onUpdate:modelValue","error","onFocus","onBlur"]))),128))]),(0,e.Lk)("div",ie,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",disabled:g.value,onClick:S[0]||(S[0]=ye=>Q.$emit("cancel"))},{default:(0,e.k6)(()=>[...S[1]||(S[1]=[(0,e.eW)(" Cancel ",-1)])]),_:1},8,["disabled"]),(0,e.bF)((0,n.R1)(i.eF),{class:"color-brand air-left-double","is-loading":g.value,disabled:!E.value,onClick:se},{default:(0,e.k6)(()=>[...S[2]||(S[2]=[(0,e.eW)(" Save ",-1)])]),_:1},8,["is-loading","disabled"])])],2)],2))}}),Be={"component-fade-enter-active":"EditAuthors_a347228321","component-fade-leave-active":"EditAuthors_fbcb1c171a","component-fade-enter-from":"EditAuthors_f6b90f876a","component-fade-leave-to":"EditAuthors_f1a752901c",component:"EditAuthors_f7d46fe06b",fadeIn:"EditAuthors_f692f82a81",content:"EditAuthors_a174e44bbe",pulseDanger:"EditAuthors_c47b58b56c",pulseSuccess:"EditAuthors_f0a447764f",pulseInfo:"EditAuthors_f3c1867647",pulseBrand:"EditAuthors_b9fe44296b",pulseBrandDark:"EditAuthors_ff2427b92f",fadeInFromNone:"EditAuthors_f8e4c35961",fadeInFromTop:"EditAuthors_e5113c6f4b",scaleUpDown:"EditAuthors_b8eda491bf","skeleton-pulse":"EditAuthors_f684d5203c",spin:"EditAuthors_e771d27a3b"};const Ee={};Ee.$style=Be;var Te=(0,le.A)(Le,[["__cssModules",Ee]]);const Fe={class:"text-right"};var Ue=(0,e.pM)({__name:"CreateIssue",props:{source:{},description:{default:()=>{}},label:{default:()=>{}},id:{}},emits:["cancel","show-notification"],setup(a,{emit:M}){const _=M,m=(0,r.t)(),l=(0,n.Kh)({title:"",description:"",team:"",status:"",priority:"",project:"",assignee:"",labels:[]});m.note&&(l.title=m.note.title,l.description=m.note.content),a.label&&a.description&&(l.title=a.label,l.description=a.description);const D={title:{required:p.A},description:{required:p.A},team:{required:p.A}},{validation:E}=(0,o.$i)(l,D),N=(0,d.D)(),A=(0,e.EW)(()=>N.integration),g=(0,e.EW)(()=>(A.value?.priorities||[]).map(T=>({label:T.label,value:`${T.value}`})));function h(T,f){return!A.value||!A.value[T]?[]:A.value[T][f]||[]}
13const j=(0,e.EW)(()=>[{label:"Team",key:"team",options:A.value?.teams||[],placeholder:"Select one option",error:E.team.error,allowSearch:!0,focus:()=>E.team.$reset(),blur:()=>E.team.$touch(),handler:()=>{l.status="",l.priority="",l.project="",l.assignee="",l.labels=[]}},{label:"Status (optional)",key:"status",options:h("workflowStates",l.team),placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Priority (optional)",key:"priority",options:g.value,placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Project (optional)",key:"project",options:h("projects",l.team),placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Assignee (optional)",key:"assignee",options:A.value?.users||[],placeholder:"Select one option",allowClear:!0,allowSearch:!0},{label:"Add label (optional)",key:"labels",options:h("issueLabels",l.team),placeholder:"Select one or multiple options",allowClear:!0,allowSearch:!0}]),se=(0,$.t)(),Q=(0,n.KR)(!1),S=(0,n.KR)("");async function ye(){await E.$validate()&&(Q.value=!0,S.value="",(0,u.lw)("INTEGRATIONS_SERVER").post(`workspaces/${se.params.wId}/integrations/linear/issue`,{...l,priority:parseInt(l.priority,10),link:window.location.href,object_id:a.id,source:a.source}).then(T=>{_("show-notification",{type:"success",message:"Linear issue created successfully",buttonConfig:{text:"Go to Linear issue",props:{tag:"a",href:`${T.data.url}`,target:"_blank"}}}),N.fetch(se.params.wId,"linear").catch(()=>null),_("cancel")}).catch(T=>{S.value=`Failed to create Linear issue: ${(0,u.zc)(T)}`}).finally(()=>{Q.value=!1}))}return(T,f)=>((0,e.uX)(),(0,e.CE)("div",null,[S.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(S.value),1)]),_:1})):(0,e.Q3)("v-if",!0),f[11]||(f[11]=(0,e.Lk)("h2",{class:"h1 air"}," Create a new Linear issue from the insight ",-1)),(0,e.bF)((0,n.R1)(i.yF),{modelValue:l.title,"onUpdate:modelValue":f[0]||(f[0]=W=>l.title=W),placeholder:"Title",error:(0,n.R1)(E).title.error,onFocus:f[1]||(f[1]=W=>(0,n.R1)(E).title.$reset()),onBlur:f[2]||(f[2]=W=>(0,n.R1)(E).title.$touch())},{default:(0,e.k6)(()=>[...f[7]||(f[7]=[(0,e.eW)(" Title ",-1)])]),_:1},8,["modelValue","error"]),(0,e.bF)((0,n.R1)(i.kz),{modelValue:l.description,"onUpdate:modelValue":f[3]||(f[3]=W=>l.description=W),placeholder:"Description","max-rows":6,error:(0,n.R1)(E).description.error,onFocus:f[4]||(f[4]=W=>(0,n.R1)(E).description.$reset()),onBlur:f[5]||(f[5]=W=>(0,n.R1)(E).description.$touch())},{default:(0,e.k6)(()=>[...f[8]||(f[8]=[(0,e.eW)(" Description ",-1)])]),_:1},8,["modelValue","error"]),((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(j.value,W=>((0,e.uX)(),(0,e.CE)("div",{key:W.key},[(0,e.bF)((0,n.R1)(i.G9),{modelValue:l[W.key],"onUpdate:modelValue":vt=>l[W.key]=vt,options:W.options,placeholder:W.placeholder,error:W.error,"allow-search":W.allowSearch,"allow-clear":W.allowClear,onFocus:W.focus,onBlur:W.blur,onChange:W.handler},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(W.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","options","placeholder","error","allow-search","allow-clear","onFocus","onBlur","onChange"])]))),128)),(0,e.Lk)("div",Fe,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",onClick:f[6]||(f[6]=W=>T.$emit("cancel"))},{default:(0,e.k6)(()=>[...f[9]||(f[9]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,n.R1)(i.eF),{class:"color-brand air-left-double","is-loading":Q.value,onClick:ye},{default:(0,e.k6)(()=>[...f[10]||(f[10]=[(0,e.eW)(" Submit ",-1)])]),_:1},8,["is-loading"])])]))}}),V=Ue;const Z={class:"text-right"};var ve=(0,e.pM)({__name:"IssuesList",props:{issuesList:{},id:{}},emits:["cancel","show-notification"],setup(a){function M(){u.l7.emit("Insights/showModal",{type:"create-linear-issue",size:"small",data:{source:"feedback",id:a.id}})}return(_,m)=>((0,e.uX)(),(0,e.CE)("div",null,[m[4]||(m[4]=(0,e.Lk)("h2",{class:"h1"}," Linear issues ",-1)),m[5]||(m[5]=(0,e.Lk)("p",null,"Go to the issue created from this feedback or create a new one.",-1)),((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(a.issuesList[a.id],l=>((0,e.uX)(),(0,e.CE)("div",{key:l.value,class:(0,s.C4)(["l-flex space-between align-baseline air",_.$style["list-item"]])},[(0,e.Lk)("h4",null,[(0,e.Lk)("strong",null,(0,s.v_)(l.label),1)]),(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",tag:"a",href:l.value,target:"_blank",title:"Opens in new window"},{default:(0,e.k6)(()=>[...m[1]||(m[1]=[(0,e.eW)(" Open in Linear ",-1)])]),_:1},8,["href"])],2))),128)),(0,e.Lk)("div",Z,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",onClick:m[0]||(m[0]=l=>_.$emit("cancel"))},{default:(0,e.k6)(()=>[...m[2]||(m[2]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,n.R1)(i.eF),{class:"air-left-double color-brand",onClick:M},{default:(0,e.k6)(()=>[...m[3]||(m[3]=[(0,e.eW)(" Create new issue ",-1)])]),_:1})])]))}}),ge={"list-item":"IssuesList_ecb699b65b"};const P={};P.$style=ge;var ze=(0,le.A)(ve,[["__cssModules",P]]),w=(0,e.pM)({__name:"LinearModalIssue",props:{modalData:{}},emits:["cancel","show-notification"],setup(a,{emit:M}){const _=M,m=(0,d.D)(),l=(0,e.EW)(()=>m.integration?.links?.feedback||{});return(D,E)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(D.$style.component)},[(0,e.Lk)("div",{class:(0,s.C4)(D.$style.content)},[a.modalData.type==="create-linear-issue"?((0,e.uX)(),(0,e.Wv)(V,{key:0,id:a.modalData.id,source:a.modalData.source,onCancel:E[0]||(E[0]=N=>D.$emit("cancel")),onShowNotification:E[1]||(E[1]=N=>_("show-notification",N))},null,8,["id","source"])):a.modalData.type==="linear-issues-list"?((0,e.uX)(),(0,e.Wv)(ze,{key:1,id:a.modalData.id,"issues-list":l.value,onCancel:E[2]||(E[2]=N=>D.$emit("cancel"))},null,8,["id","issues-list"])):(0,e.Q3)("v-if",!0)],2)],2))}}),K={"component-fade-enter-active":"LinearModalIssue_cd1ca566de","component-fade-leave-active":"LinearModalIssue_e16753d67b","component-fade-enter-from":"LinearModalIssue_bf44f3caee","component-fade-leave-to":"LinearModalIssue_c176f6ca21",component:"LinearModalIssue_f82f977dbc",fadeIn:"LinearModalIssue_b575ee722a",content:"LinearModalIssue_dc8c8df378",pulseDanger:"LinearModalIssue_be306c74f1",pulseSuccess:"LinearModalIssue_bc9d3a4894",pulseInfo:"LinearModalIssue_ed8124d9ea",pulseBrand:"LinearModalIssue_cd062169c1",pulseBrandDark:"LinearModalIssue_c2d9e3f6d6",fadeInFromNone:"LinearModalIssue_eba7
13d50b35",fadeInFromTop:"LinearModalIssue_f67232b0ba",scaleUpDown:"LinearModalIssue_a03a1fa42b","skeleton-pulse":"LinearModalIssue_f13275c6c7",spin:"LinearModalIssue_b9e69fdcce"};const ue={};ue.$style=K;var qe=(0,le.A)(w,[["__cssModules",ue]]);const bt={key:0,style:{"min-height":"461px"}};var _t=(0,e.pM)({__name:"Note",props:{wId:{},noteId:{},fetchPayload:{default:()=>{}}},emits:["close","set-close-handler-payload"],setup(a,{emit:M}){const _=M,m=(0,r.t)(),l=(0,e.EW)(()=>m.note),D=(0,n.KR)(!0),E=(0,n.KR)(""),N=(0,n.KR)(!1);function A(){m.fetchNote(a.wId,a.noteId,a.fetchPayload).then(Y=>{u.l7.emit("Segment/track",{name:"hub_note_viewed",data:{click_source:"assistant",note_source:Y.data.provider}})}).catch(Y=>{if(Y.response&&Y.response.status===404){N.value=!0;return}E.value=`Failed to fetch message: ${(0,u.zc)(Y)}`}).finally(()=>{D.value=!1})}(0,e.wB)(()=>a.noteId,Y=>{Y&&(D.value=!0,E.value="",N.value=!1,A())},{immediate:!0});const g=(0,n.Kh)({type:"danger",message:"",timeout:5e3});let h;async function j(Y){h&&(clearTimeout(h),g.message="",g.buttonConfig=void 0),await(0,e.dY)(),g.type=Y.type,g.message=Y.message,g.timeout=Y.timeout||5e3,Y.buttonConfig&&(g.buttonConfig=Y.buttonConfig),h=window.setTimeout(()=>{g.message="",g.buttonConfig=void 0},g.timeout)}const se=(0,n.KR)(!1),Q=(0,n.KR)(!1);function S(){Q.value=!0,m.deleteNote(a.wId,parseInt(a.noteId,10)).then(()=>{u.l7.emit("Segment/track",{name:"hub_note_deleted",data:{note_source:l.value?.provider}}),setTimeout(()=>{u.l7.emit("Common/showAlert",{type:"success",message:"Feedback deleted",flash:!0,timeout:5e3})},500),_("close")}).catch(Y=>{j({type:"danger",message:`Failed to remove message: ${(0,u.zc)(Y)}`})}).finally(()=>{Q.value=!1,se.value=!1})}(0,e.xo)(()=>{const Y=document.activeElement;Y?.blur&&Y.blur()});const ye=(0,n.KR)(!1);async function T(){ye.value=!1,j({type:"success",message:"Authors updated successfully",timeout:2e3})}const f=(0,n.KR)(!1),W=(0,n.Kh)({type:"create-linear-issue",source:"feedback",id:""});function vt(Y){W.type=Y.type,W.source=Y.source??"feedback",W.id=a.noteId,f.value=!0}return(Y,Oe)=>((0,e.uX)(),(0,e.CE)("div",null,[D.value?((0,e.uX)(),(0,e.CE)("div",bt,[(0,e.bF)((0,n.R1)(i.M6))])):E.value?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:1,class:"no-air",type:"danger","button-config":{text:"Close",handler:()=>Y.$emit("close")}},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(E.value),1)]),_:1},8,["button-config"])):l.value||N.value?((0,e.uX)(),(0,e.CE)("div",{key:2,class:(0,s.C4)(["relative",Y.$style.container])},[f.value?((0,e.uX)(),(0,e.Wv)(qe,{key:0,"modal-data":W,onCancel:Oe[0]||(Oe[0]=pt=>f.value=!1),onShowNotification:j},null,8,["modal-data"])):(0,e.Q3)("v-if",!0),se.value?((0,e.uX)(),(0,e.Wv)(q,{key:1,"is-loading":Q.value,onCancel:Oe[1]||(Oe[1]=pt=>se.value=!1),onConfirm:S},null,8,["is-loading"])):(0,e.Q3)("v-if",!0),l.value&&ye.value?((0,e.uX)(),(0,e.Wv)(Te,{key:2,"w-id":a.wId,"note-id":l.value.id,authors:l.value.conversation.authors,onCancel:Oe[2]||(Oe[2]=pt=>ye.value=!1),onUpdate:T},null,8,["w-id","note-id","authors"])):(0,e.Q3)("v-if",!0),g.message?((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.gN),{key:3,class:(0,s.C4)(["no-air",Y.$style.notification]),type:g.type,timeout:g.timeout,"button-config":g.buttonConfig},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,s.v_)(g.message),1)]),_:1},8,["type","timeout","button-config","class"])):(0,e.Q3)("v-if",!0),(0,e.bF)(De,{title:l.value?.title||"-",provider:l.value?.provider||"",provider_url:l.value?.provider_url,"note-id":l.value?.id,feedback_attributes:l.value?.feedback_attributes,navigation:l.value?.navigation,"fetch-payload":a.fetchPayload,"requested-note-id":a.noteId,onClose:Oe[3]||(Oe[3]=pt=>Y.$emit("close")),onRemove:Oe[4]||(Oe[4]=pt=>se.value=!0),onShowLinearModal:vt,onShowNotification:j},null,8,["title","provider","provider_url","note-id","feedback_attributes","navigation","fetch-payload","requested-note-id"]),(0,e.Lk)("div",{class:(0,s.C4)(["l-flex",[Y.$style["content-wrapper"],{"direction-column":N.value}]])},[l.value?((0,e.uX)(),(0,e.CE)(e.FK,{key:1},[(0,e.bF)(mt,{class:"grow",content:l.value.content,conversation:l.value.conversation,onEditAuthors:Oe[5]||(Oe[5]=pt=>ye.value=!0)},null,8,["content","conversation"]),(0,e.bF)(X,{"w-id":a.wId,"note-id":l.value.id,sentiment:l.value.sentiment,created_at:l.value.created_at,rating:l.value.rating,provider_pretty_name:l.value.provider_pretty_name,user_attributes:l.value.user_attributes,feedback_attributes:l.value.feedback_attributes,onShowNotification:j},null,8,["w-id","note-id","sentiment","created_at","rating","provider_pretty_name","user_attributes","feedback_attributes"])],64)):((0,e.uX)(),(0,e.Wv)((0,n.R1)(i.Af),{key:0,class:"grow",orientation:"horizontal",src:["feedback-hub/empty-state.svg","feedback-hub/empty-state-dark.svg"],header:"Oops! Feedback deleted",content:"Apparently the piece of feedback you're trying to access has been deleted."}))],2)],2)):(0,e.Q3)("v-if",!0)]))}}),kt={"component-fade-enter-active":"Note_aab2dffb02","component-fade-leave-active":"Note_b9c62af695","component-fade-enter-from":"Note_d9c9e77a7c","component-fade-leave-to":"Note_a09e2e8665",container:"Note_fa14e9e86d",fadeIn:"Note_f2d550c5d9","content-wrapper":"Note_f479ef362c",notification:"Note_b50b33d84f",pulseDanger:"Note_c85dff4acc",pulseSuccess:"Note_a2bc0887fa",pulseInfo:"Note_fc7a7af3fc",pulseBrand:"Note_fad44af5e2",pulseBrandDark:"Note_b68778fdf9",fadeInFromNone:"Note_f68623dac1",fadeInFromTop:"Note_acf09fcf96",scaleUpDown:"Note_b2e4580d6a","skeleton-pulse":"Note_e364f2faa4",spin:"Note_ea889afd9c"};const ht={};ht.$style=kt;var Ct=(0,le.A)(_t,[["__cssModules",ht]]);const It={class:"l-flex align-center space-between"},Lt={class:"s-tag style-rounded no-air"},Et={class:"text-right"};var wt=(0,e.pM)({__name:"SelectFeedbackSources",props:{providerOptions:{},providers:{}},emits:["close","set-close-handler-payload"],setup(a,{emit:M}){const _=M,m=(0,n.Kh)({providers:[...a.providers]}),l=(0,e.EW)(()=>m.providers.length===a.providerOptions.length);function D(){m.providers=a.providerOptions.map(A=>A.value)}
13const E=(0,e.EW)(()=>m.providers.length>1?[]:m.providers);function N(){_("set-close-handler-payload",m.providers),_("close")}return(A,g)=>((0,e.uX)(),(0,e.CE)(e.FK,null,[g[7]||(g[7]=(0,e.Lk)("h2",{class:"h1 air"}," Select Feedback Sources ",-1)),a.providerOptions.length>5?((0,e.uX)(),(0,e.CE)(e.FK,{key:0},[(0,e.Lk)("div",It,[(0,e.bF)((0,n.R1)(i.HA),{class:"no-air","model-value":l.value,"onUpdate:modelValue":D},{default:(0,e.k6)(()=>[...g[2]||(g[2]=[(0,e.eW)(" Select all sources ",-1)])]),_:1},8,["model-value"]),(0,e.Lk)("span",Lt,(0,s.v_)(m.providers.length)+"/"+(0,s.v_)(a.providerOptions.length),1)]),g[3]||(g[3]=(0,e.Lk)("hr",null,null,-1))],64)):(0,e.Q3)("v-if",!0),(0,e.Lk)("div",null,[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(a.providerOptions,h=>((0,e.uX)(),(0,e.CE)(e.FK,{key:h.value},[(0,e.bF)((0,n.R1)(i.HA),{modelValue:m.providers,"onUpdate:modelValue":g[0]||(g[0]=j=>m.providers=j),"true-value":h.value,disabled:E.value.includes(h.value)},{default:(0,e.k6)(()=>[(0,e.eW)((0,s.v_)(h.label),1)]),_:2},1032,["modelValue","true-value","disabled"]),g[4]||(g[4]=(0,e.Lk)("br",null,null,-1))],64))),128))]),(0,e.Lk)("div",Et,[(0,e.bF)((0,n.R1)(i.eF),{class:"type-link",onClick:g[1]||(g[1]=h=>A.$emit("close"))},{default:(0,e.k6)(()=>[...g[5]||(g[5]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,n.R1)(i.eF),{class:"color-brand air-left-double",onClick:N},{default:(0,e.k6)(()=>[...g[6]||(g[6]=[(0,e.eW)(" Apply ",-1)])]),_:1})])],64))}}),$t=wt;const At={class:"h3 no-air"};var St=(0,e.pM)({__name:"Insights",setup(a){const M=(0,$.t)(),_=(0,e.EW)(()=>M.meta.headerTitle),m=()=>({"remove-question":We,"note-details":Ct,"create-linear-issue":he,"select-feedback-sources":$t}),l=(0,I.J)(),D=(0,r.t)(),E=(0,d.D)(),N=(0,c.Q)();return N.fetch(M.params.wId,!1,["linear"]).catch(()=>null),E.fetch(M.params.wId,"linear").catch(()=>null),(0,e.xo)(()=>{l.$reset(),D.$reset(),E.$reset(),N.$reset()}),(A,g)=>{const h=(0,e.g2)("router-view");return(0,e.uX)(),(0,e.Wv)(ee.A,null,{default:(0,e.k6)(()=>[_.value?((0,e.uX)(),(0,e.Wv)(e.Im,{key:0,to:"#survicate-module-header"},[(0,e.Lk)("h1",At,[(0,e.Lk)("strong",null,(0,s.v_)(_.value),1)])])):(0,e.Q3)("v-if",!0),(0,e.bF)(h),(0,e.bF)((0,n.R1)(i.aK),{"event-id":"Insights","modal-components":m})]),_:1})}}}),Rt=St}),35105:(function(ke,z,t){t.d(z,{A:function(){return d}});var e=t(20641),s=t(53751),n=t(90033),$=t(50953),i=t(51082),I=(0,e.pM)({__name:"DataFlowWrapper",props:{isLoading:{type:Boolean,default:!1},loadingConfig:{default:()=>({height:"330px",type:"s-loading"})},errorMessage:{default:""},errorMessageConfig:{default:()=>({type:"danger",props:{}})},displayCondition:{type:Boolean,default:!1},emptyState:{type:[Boolean,Object],default:!1},contentAttrs:{default:()=>({})}},setup(c){return(u,o)=>((0,e.uX)(),(0,e.Wv)(s.eB,{name:"component-fade",mode:"out-in"},{default:(0,e.k6)(()=>[c.isLoading?((0,e.uX)(),(0,e.CE)("div",{key:"loading",style:(0,n.Tr)({"min-height":c.loadingConfig.height||"330px"})},[c.loadingConfig.type==="s-loading-animation"?((0,e.uX)(),(0,e.Wv)((0,$.R1)(i.u8),{key:0})):((0,e.uX)(),(0,e.Wv)((0,$.R1)(i.M6),{key:1}))],4)):c.errorMessage?((0,e.uX)(),(0,e.Wv)((0,$.R1)(i.gN),(0,e.v6)({ke
13y:"error",class:"no-air no-fade-in",type:c.errorMessageConfig.type||"danger"},c.errorMessageConfig.props),{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,n.v_)(c.errorMessage),1)]),_:1},16,["type"])):c.displayCondition?((0,e.uX)(),(0,e.CE)("div",(0,e.v6)({key:"content"},c.contentAttrs),[(0,e.RG)(u.$slots,"default")],16)):c.emptyState?((0,e.uX)(),(0,e.Wv)((0,$.R1)(i.Af),(0,e.v6)({key:"no-results",src:c.emptyState.img},c.emptyState.props),{header:(0,e.k6)(()=>[(0,e.eW)((0,n.v_)(c.emptyState.header),1)]),content:(0,e.k6)(()=>[(0,e.eW)((0,n.v_)(c.emptyState.content),1)]),_:1},16,["src"])):(0,e.Q3)("v-if",!0)]),_:3}))}}),d=I}),14493:(function(ke,z,t){t.d(z,{A:function(){return H}});var e=t(20641),s=t(90033),n=t(50953),$=t(21678),i=t(37248),I=t(51082),r=t(11619),d=t(35634),c=t(99040),u=(0,e.pM)({__name:"ModuleContent",setup(he){const ee=(0,e.rk)("contentEl"),xe=(0,e.rk)("footerEl"),we=(0,n.KR)(!1),$e=(0,d.c)();(0,e.sV)(()=>{$e.container=ee.value,(0,c.wk)(xe.value),we.value=!0,document.body.classList.add("has-module-content")});function We(){$e.toggleSubNavigation()}function Ce(){ee.value&&ee.value.scrollTo({top:0})}function Ae(){ee.value&&ee.value.scrollTo({top:ee.value.scrollHeight,behavior:"smooth"})}function be(oe){ee.value&&ee.value.scrollBy(0,oe)}r.l7.on("ModuleContent/scrollToTop",Ce),r.l7.on("ModuleContent/scrollToBottom",Ae),r.l7.on("ModuleContent/scrollBy",be),(0,e.xo)(()=>{r.l7.off("ModuleContent/scrollToTop",Ce),r.l7.off("ModuleContent/scrollToBottom",Ae),r.l7.off("ModuleContent/scrollBy",be),$e.container=null,(0,c.rk)(xe.value),document.body.classList.remove("has-module-content")});const pe=(0,$.t)(),J=(0,e.EW)(()=>!!pe.meta.hideModuleHeader),_e=(0,e.EW)(()=>!!pe.meta.navigationComponent);return(oe,te)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["l-flex direction-column",oe.$style.component])},[(0,e.Lk)("div",{class:(0,s.C4)(["l-flex direction-column grow",oe.$style.wrapper])},[J.value?(0,e.Q3)("v-if",!0):((0,e.uX)(),(0,e.CE)("div",{key:0,id:"survicate-module-header",class:(0,s.C4)(["l-flex align-center flex-wrap",oe.$style.header])},[(0,e.bF)((0,n.R1)(I.eF),{class:"type-icon s-small",icon:(0,n.R1)(i.A),disabled:!_e.value,onClick:We},null,8,["icon","disabled"]),te[0]||(te[0]=(0,e.Lk)("div",{class:"header-separator air-right"},null,-1)),(0,e.RG)(oe.$slots,"header")],2)),(0,e.Lk)("div",{id:"survicate-module-sub-header",class:(0,s.C4)(["l-flex align-center flex-wrap",oe.$style["sub-header"]])},null,2),(0,e.Lk)("div",{id:"survicate-module-content",ref:"contentEl",class:(0,s.C4)(["grow relative",[oe.$style.content,{"full-border-radius":J.value}]])},[we.value?(0,e.RG)(oe.$slots,"default",{},void 0,void 0,0):(0,e.Q3)("v-if",!0)],2)],2),(0,e.Lk)("div",{id:"survicate-module-footer",ref:"footerEl",class:(0,s.C4)(["relative",oe.$style.footer])},null,2)],2))}}),o={component:"ModuleContent_acf7bde734",wrapper:"ModuleContent_f5426014c2",header:"ModuleContent_c7f2063afd","sub-header":"ModuleContent_d2ca9ae2b8",content:"ModuleContent_dad692735e",footer:"ModuleContent_df864ddee4"},p=t(66262);const x={};x.$style=o;var H=(0,p.A)(u,[["__cssModules",x]])}),66603:(function(ke,z,t){t.d(z,{A:function(){return o}});var e=t(20641),s=t(90033),n=t(50953),$=t(51082),i=t(54675),I=(0,e.pM)({__name:"ProviderLogo",props:{provider:{},tag:{default:"div"}},setup(p){const x=(0,e.EW)(()=>
13i.A[p.provider]??i.A.survicate),y=(0,e.EW)(()=>p.provider.substring(0,1).toUpperCase());return(H,he)=>((0,e.uX)(),(0,e.Wv)((0,e.$y)(p.tag),{class:(0,s.C4)(["l-flex align-center justify-center",H.$style.component])},{default:(0,e.k6)(()=>[(0,e.bF)((0,n.R1)($.Og),{src:x.value.src,"is-responsive":!1,alt:y.value},null,8,["src","alt"])]),_:1},8,["class"]))}}),r={component:"ProviderLogo_b5cdb58e72"},d=t(66262);const c={};c.$style=r;var o=(0,d.A)(I,[["__cssModules",c]])}),55781:(function(ke,z,t){t.d(z,{A:function(){return d}});var e=t(20641),s=t(90033),n=(0,e.pM)({__name:"StarRating",props:{rating:{},starCount:{default:5}},setup(c){const u=(0,e.EW)(()=>{const o=Math.trunc(c.rating)-1,p=c.rating%1!==0;return Array.from({length:c.starCount},(x,y)=>({class:y<=o?"is-active":"",isHalf:y===o&&p}))});return(o,p)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,s.C4)(["no-wrap",o.$style.component])},[((0,e.uX)(!0),(0,e.CE)(e.FK,null,(0,e.pI)(u.value,(x,y)=>((0,e.uX)(),(0,e.CE)(e.FK,{key:y},[x.isHalf?((0,e.uX)(),(0,e.CE)("svg",{key:1,class:(0,s.C4)(o.$style.star),style:{fill:"url(#half-star)"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[...p[1]||(p[1]=[(0,e.Lk)("defs",null,[(0,e.Lk)("linearGradient",{id:"half-star"},[(0,e.Lk)("stop",{class:"half-1","stop-opacity":"1",offset:"50%"}),(0,e.Lk)("stop",{class:"half-2","stop-opacity":"1",offset:"50%"})])],-1),(0,e.Lk)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27Z","fill-rule":"nonzero"},null,-1)])],2)):((0,e.uX)(),(0,e.CE)("svg",{key:0,class:(0,s.C4)([o.$style.star,x.class]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[...p[0]||(p[0]=[(0,e.Lk)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27Z","fill-rule":"nonzero"},null,-1)])],2))],64))),128))],2))}}),$={component:"StarRating_dcf2b5ae53",star:"StarRating_b958a040b7"},i=t(66262);const I={};I.$style=$;var d=(0,i.A)(n,[["__cssModules",I]])})}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.