1import{j as i,ac as x,F as ae,r as F,B as V,ah as wi}from"./main-DyjxXpTK.js";import{cN as lt,cO as ie,cP as S,cQ as Ci,cR as Ei,cS as Pn,cT as Tn,cU as _n,cV as ji,ay as Ai,cW as It,cy as ut,cX as Pi,cY as I,aD as T,cZ as Ti,c_ as Fn,c$ as A,d0 as Dn,d1 as _i,d2 as Se,d3 as Fi,d4 as Di,d5 as Ni,d6 as kt,d7 as Nn,d8 as Ri,d9 as Oi,h as Ae,da as Wi,db as Nt,dc as Li,dd as Rt,de as Ui,df as Pe,dg as Vi,dh as Rn,di as rn,dj as On,dk as Mi,dl as Hi,bV as Te,dm as Gi,dn as $i,dp as Bi,dq as Ki,an as Wn,dr as Ln,aC as be,ds as K,aU as at,dt as qi,aw as H,du as Un,dv as zi,dw as Qi,dx as Yi,dy as wt,dz as Ct,dA as Ot,dB as Xi,dC as Vn,dD as Zi,dE as yt,dF as R,dG as Ji,dH as ea,dI as ta,b1 as na,dJ as ia,dK as aa,dL as on,dM as sa,dN as Mn,b3 as ra,dO as oa,dP as da,dQ as ca,dR as la,dS as ua,dT as ha,dU as pa,dV as ma,dW as ga,dX as fa,dY as xa,dZ as ya,d_ as va,d$ as Sa,e0 as ba,e1 as Ia,e2 as ka,e3 as wa,e4 as Ca,am as dn,e5 as Ea,e6 as ja,e7 as Aa,e8 as Pa,e9 as Ta,aJ as _a,ea as Fa,eb as Da,ec as Na,ed as Ra,ee as Oa,ef as Wa,eg as La,eh as Ua}from"./App-V_-BsQ0z.js";import{P as Va,a as Ma,F as Ha,u as Ga,R as $a,g as Ba,b as Ka}from"./FollowUpTooltip-BRyl7rA8.js";import{S as st,a as Et,r as qa,N as za}from"./SignificanceIndicator-DAD4XZrx.js";import{u as Qa}from"./usePrevious-Bi1CWbeH.js";import{P as Ya,a as Hn,g as Xa,b as Gn}from"./PatternChart-Dmcm7_ym.js";import{C as jt,R as Za,u as Ja,a as es,b as ts}from"./useIsGuardedProfaneFeedbackCheck-Bsq8j3y4.js";import{V as Wt,s as ns,m as is,o as as}from"./ValueChangeIndicator-BsiscCC1.js";import{I as $n}from"./InfoTooltipContent-BtyGdCP8.js";import{M as ht}from"./index.esm-BHLZzMmQ.js";import{C as ss}from"./Calendar-CnausqXL.js";import{C as rs}from"./Clock-DdmY_uwA.js";import{M as os}from"./MapPin-DTuFTGgx.js";import{S as ds}from"./Star-Cvciczct.js";import{i as cs}from"./TargetIndex-CUwt7VA1.js";import{R as ls,C as cn}from"./generateCategoricalChart-DCzYJ1M3.js";import{N as us,a as hs,b as ps}from"./NpsRange-DGLcVIqn.js";import{g as Bn,M as ms}from"./ModifiedByAiBadge-C4FEBY2H.js";import{t as gs}from"./Smileys-_UC-jsL7.js";import{M as fs}from"./MessageSquare-DymLQLxr.js";import{m as xs,M as ys,O as vs}from"./mixpanelOpenFeedbackSummaryEvent-Bo0ev4rW.js";import"./CategorySelectorPopover-c3plWVVc.js";import"./FilterDropDownIcon-Cf1YSidC.js";import"./DropdownArrow-BfM1_YAx.js";import"./Search-BBx6O9Iu.js";import"./index.esm-CP3_4Rey.js";import"./ListItemIcon-SYeKIgu6.js";import"./debounce-B47o0crl.js";import"./useStateCallback-Zf3yKqr2.js";import"./HonLocalizationProvider-ByjuNsrO.js";import"./InputAdornment-1sHijusI.js";import"./Notification-BcQDZ-Ka.js";import"./smileyLinkAndQrCodeExportUtils-S3PLDcXH.js";import"./ActionConfirmationDialog-NYfquneF.js";import"./Trash-B8omX3Q0.js";import"./ChevronDown-yzzOW2OC.js";import"./Collapse-DuK_5wj9.js";import"./Check-CvTfBhrf.js";import"./AlertCircle-DiXl44kc.js";import"./Edit-BykuV2DU.js";import"./Download-Crmzpv7P.js";import"./Survey-zijhN6EB.js";import"./ResultTooltip-C6eVrlBE.js";import"./ComposedChart-Di97pvTf.js";import"./YAxis-7z7XdME-.js";import"./_baseExtremum-DeYCGTr7.js";function Kn(e){return i.jsx(lt,{id:e.id,title:{id:e.titleId},loading:e.loading,hasData:e.hasData,surveyInactive:e.surveyInactive,breakPointWidths:e.breakPointWidths,infoTooltip:i.jsx(Ya,{}),children:e.hasData&&e.children})}const Ss=e=>{const t=ae(),n=!ie(e.hourlyPatternData),{data:a,xLabels:r,yLabels:s}=n?Is(e.hourlyPatternData,e.indexType,t):{data:[],xLabels:[],yLabels:[]};return i.jsx(Kn,{id:"HourlyPatternWidget",titleId:S.HourlyPatternWidget.title,hasData:n,loading:e.loading,surveyInactive:e.surveyInactive,breakPointWidths:e.breakPointWidths,children:i.jsx(Hn,{className:e.className,data:a,xLabels:r,yLabels:s})})},bs=x(Ss)` 2 .pattern-y-labels { 3 width: 30px; 4 } 5 .pattern { 6 width: calc(100% - 30px); 7 } 8`;function Is(e,t,n){const a=e.map(c=>({weekday:c.weekday,hours:Ci(c.hours,l=>!l.metrics)})),{startHour:r,endHour:s}=Xa(a),o=Ei(r,s+1),d=a.map(c=>({weekday:c.weekday,hours:ks(c.hours,o)}));return{xLabels:o.map(c=>ji(c)),yLabels:d.map(c=>_n(c.weekday)),data:d.map(c=>c.hours.map(l=>({style:{backgroundColor:Gn(n,l.metrics?l.metrics.distance:void 0)},tooltip:{title:`${Pn(c.weekday)} ${Tn(l.hour)}`,indexType:t,indexValue:l.metrics&&l.metrics.index,responses:l.metrics&&l.metrics.responses}})))}}function ks(e,t){return t.map(n=>{const a=e.find(r=>r.hour===n);return a||{hour:n}})}const ws=F.forwardRef((e,t)=>
8i.jsx(Ai,{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M12,10 C13.1045695,10 14,10.8954305 14,12 C14,13.1045695 13.1045695,14 12,14 C10.8954305,14 10,13.1045695 10,12 C10,10.8954305 10.8954305,10 12,10 Z M19,10 C20.1045695,10 21,10.8954305 21,12 C21,13.1045695 20.1045695,14 19,14 C17.8954305,14 17,13.1045695 17,12 C17,10.8954305 17.8954305,10 19,10 Z M5,10 C6.1045695,10 7,10.8954305 7,12 C7,13.1045695 6.1045695,14 5,14 C3.8954305,14 3,13.1045695 3,12 C3,10.8954305 3.8954305,10 5,10 Z"})}));class Cs extends F.Component{state={showAll:!1};handleShowMoreClick=t=>{this.setState({showAll:!0}),this.props.rankingData&&this.props.showAllAction()};handleCloseDialogClick=t=>{this.setState({showAll:!1})};render(){const t=this.props.rankingData?this.props.rankingData.length>7:!1;return i.jsx(lt,{id:"RankingWidget",title:{id:S.RankingWidget.title},loading:this.props.isLoading,hasData:!ie(this.props.rankingData),surveyInactive:this.props.surveyInactive,infoTooltip:i.jsx($n,{textId:S.RankingWidget.infoTooltip,readMoreLink:Fn.analytics}),breakPointWidths:this.props.breakPointWidths,children:i.jsxs("div",{className:`${this.props.className} ${t?"withShowMore":""}`,children:[i.jsx(un,{items:this.props.rankingData,showIndexChange:ln(this.props.timePeriod)}),t||this.state.showAll?i.jsxs("div",{children:[i.jsx("button",{className:"showMore",onClick:this.handleShowMoreClick,children:i.jsx(I,{variant:"button",children:i.jsx(T,{id:S.General.ShowMore})})}),i.jsx(Ti,{open:this.state.showAll,onRequestClose:this.handleCloseDialogClick,title:i.jsx(T,{id:S.RankingWidget.title}),className:this.props.className,children:i.jsx(un,{items:this.props.rankingData,dialogMode:!0,showIndexChange:ln(this.props.timePeriod)})})]}):null]})})}}function ln(e){return[A.LAST_WEEK,A.LAST_MONTH,A.THIS_WEEK,A.THIS_MONTH,A.THIS_QUARTER,A.LAST_QUARTER].includes(e)}function un(e){const t=e.items,n=t.length,a=!e.dialogMode&&t.length>7,r=[];return t.slice(0,3).map((s,o)=>r.push(i.jsx(vt,{item:s,rowIndex:o,className:o%2===0?"striped":"",showIndexChange:e.showIndexChange},s.category.id))),r.push(i.jsx("div",{className:"top-bottom-separator",children:i.jsx(ws,{color:"disabled",className:"dots"})},"dots")),t.slice(-3).map((s,o)=>r.push(i.jsx(vt,{item:s,rowIndex:o+n-3,className:o%2===0?"striped":"",showIndexChange:e.showIndexChange},s.category.id))),i.jsx("div",{className:"locations",children:i.jsxs("div",{className:"list",children:[!a&&t.map((s,o)=>i.jsx(vt,{item:s,rowIndex:o,className:o%2===0?"striped":"",showIndexChange:e.showIndexChange},s.category.id)),a&&r]})})}function vt(e){return i.jsxs("div",{className:`location ${e.className?e.className:""}`,children:[i.jsxs(I,{variant:"body2",color:"textSecondary",className:"position",children:[e.rowIndex+1,"."]}),i.jsx(I,{variant:"body2",className:"name",children:i.jsx(jt,{categoryName:e.item.category.name,categoryId:e.item.category.id})}),i.jsx(I,{variant:"body2",className:"index",children:e.item.index}),e.showIndexChange&&i.jsx("div",{className:"index-change",children:i.jsx(Wt,{changeAmount:e.item.indexChange})})]})}const Es={showAllAction:Pi},js=x(ut(null,Es)(Cs))` 9 body:not(.print) &.withShowMore { 10 position: relative; 11 padding-bottom: 64px !important; 12 .showMore { 13 position: relative; 14 height: 30px; 15 } 16 } 17 .locations { 18 border-collapse: collapse; 19 .list { 20 width: 100%; 21 display: table; 22 .location { 23 margin: 16px auto; 24 display: table-row; 25 & > p { 26 display: table-cell; 27 padding: 8px; 28 } 29 &.striped { 30 background-color: ${e=>e.theme.honExtensions.surfaceColors.light}; 31 } 32 .position { 33 color: ${e=>e.theme.palette.text.disabled}; 34 padding-${It}: 20px; 35 } 36 .index, 37 .position { 38 width: 20px; 39 } 40 .index-change { 41 width: 40px; 42 } 43 } 44 .top-bottom-separator { 45 height: 50px; 46 .dots { 47 margin-top: 12px; 48 position: relative; 49 ${It}: 15px; 50 } 51 } 52 } 53 } 54`,At={precision:Se.FIFTEEN_MINUTES,dataKey:"dataDefault"};
54class As extends F.Component{state={width:0};render(){const{selectedCategoryName:t,startDate:n,endDate:a,startTime:r,endTime:s,timePeriod:o,comparePeriod:d,chartMode:c,indexType:l,isLoading:h,surveyInactive:m,weekdays:g,fullWidth:p,dataDefault:f,breakPointWidths:b}=this.props,E=this.state.width,{precision:j,dataKey:w}=f?Ts(E,n,r,s,f,o):At,q=this.props[w]?Fi(this.props[w],j,n,a,o,r,s,g):[],z=Di(o,d,!1),Q=z?Ni(o,{startDate:z.startDate,endDate:z.inclusiveEndDate}):{topRow:null,bottomRow:null};return i.jsx(ht,{bounds:!0,onResize:Y=>this.setState({width:Y.bounds?Y.bounds.width:0}),children:({measureRef:Y})=>i.jsx(Za,{showNoDataImage:!1,fullWidth:p,chartMode:c,indexType:l,showIndex:!0,surveyInactive:m,isLoading:h,timestampResults:q,showComparisonIndex:!0,selectedCategoryName:t,precision:j,tabs:void 0,previousPeriodLabel:`${Q.topRow} ${Q.bottomRow}`,contentRef:Y,breakPointWidths:b})})}}const Ps=e=>{const t=Dn(e),n=_i(e.surveyGroups.selectedSurveyGroup);return{selectedCategoryName:e.tree.selectedCategory?e.tree.selectedCategory.name:void 0,startDate:t.startDate,endDate:t.endD
54ate,startTime:t.startTime,endTime:t.endTime,weekdays:n,timePeriod:t.timePeriod,comparePeriod:t.comparePeriod,selectedCategoryId:t.getAvailableCategoryID(e.tree.selectedCategory),selectedSurveyGroupId:t.getAvailableSurveyGroupID(e.surveyGroups.selectedSurveyGroup)}},Ts=(e,t,n,a,r,s)=>{const o=r&&r.filter(m=>kt(m.feedbacks)>0);if(!o||o.length===0)return At;const d=o.length,c=o.reduce((m,g)=>m+kt(g.feedbacks),0)/d,l=_s(e,d,c),h=(m,g)=>Ae(o[o.length-1].timestamp).diff(Ae(o[0].timestamp),m)/g+1;if(Nn(s)){const m=(a-n)/15,g=h("minutes",15);return l(m,g)?{precision:Se.HOUR,dataKey:"dataFallback"}:{precision:Se.FIFTEEN_MINUTES,dataKey:"dataDefault"}}if(Ri(s))return{precision:Se.DAY,dataKey:"dataDefault"};if(Oi(s)){const m=Ae(t).daysInMonth(),g=h("days",1);return l(m,g)?{precision:Se.WEEK,dataKey:"dataFallback"}:{precision:Se.DAY,dataKey:"dataDefault"}}return Wi(s)?{precision:Se.WEEK,dataKey:"dataDefault"}:At};function _s(e,t,n){return(o,d)=>o*12>e||d>2*t||n<2.5}const Fs=ut(Ps)(As);function Ds(e){const{data:t}=e,n=ae(),a=t?.happyIndex??t?.npsIndex??t?.npsOfficialIndex??t?.averageIndex??0,r=cs(e.targetIndex)&&e.targetIndex.indexType===e.indexType,s=r?e.targetIndex.indexValue:0,o=a>=s,d=Li(a,e.indexType),c={data:[{value:d},{value:100-d}],dataKey:"value",cy:"50%",innerRadius:"92%",outerRadius:"100%",paddingAngle:0<d&&d<100?2:0,startAngle:90,endAngle:-270,isAnimationActive:!1},l=n.honExtensions;return i.jsxs("div",{className:e.className,children:[r&&i.jsxs("div",{className:`target-index ${o?"target-reached":""}`,children:[i.jsx(T,{id:S.General.Target}),": ",s]}),i.jsxs("div",{className:"pie-with-infos",children:[i.jsx(ls,{width:"100%",aspect:1,children:i.jsxs(Va,{children:[i.jsxs(Ma,{...c,children:[i.jsx(cn,{fill:l.happyScaleColors.index.main}),i.jsx(cn,{fill:l.surfaceColors.light})]}),i.jsx("text",{id:"indexInChart",x:"50%",y:"59%",textAnchor:"middle",fill:n.palette.text.primary,fontSize:"35px",fontWeight:"600",children:e.intl.formatNumber(a)})]})}),i.jsx("div",{className:"index-change",children:i.jsx(Ns,{changeAmount:e.data?.indexChange})}),i.jsx(Rs,{indexType:e.indexType})]})]})}const Ns=x(Wt)` 55 position: absolute; 56 left: 50%; 57 transform: translateX(-50%); 58 top: 94px; 59`;function Rs(e){const{renderIndexTooltip:t,onMouseEnterIndexTooltip:n,onMouseLeaveIndexTooltip:a}=Ja();return i.jsxs("div",{className:"index-info",children:[i.jsx(I,{variant:"caption",color:"textSecondary",onMouseEnter:n,onMouseLeave:a,children:i.jsx(T,{id:Ui[e.indexType]})}),t({position:"bottom"})]})}const Os=x(Nt(Ds))` 60 width: 150px; 61 padding-left: 16px; 62 padding-right: 16px; 63 margin-top: 8px; 64 margin-bottom: 8px; 65 text-align: center; 66 position: relative; 67 68 .pie-with-infos { 69 position: relative; 70 } 71 .index-info { 72 width: 100%; 73 display: block; 74 position: absolute; 75 left: 50%; 76 top: 34px; 77 transform: translateX(-50%); 78 z-index: 1; 79 } 80 .target-index { 81 display: block; 82 margin: 0 30px; 83 width: 50%; 84 z-index: 1; 85 background-color: #fcecec; 86 color: #e24e67; 87 border-radius: 3px; 88 padding: 2px 4px; 89 &.target-reached { 90 background-color: #e7f7e4; 91 color: #0daa5d; 92 } 93 } 94`;function Ws(e){const{topRow:t,bottomRow:n}=Vi(e.timePeriod.id,e.timePeriod.startDate,e.timePeriod.endDate);return i.jsx("div",{className:e.className,children:i.jsxs(I,{variant:"body1",color:"textSecondary",children:[t," ",n]})})}const Ls=x(Ws)` 95 text-align: center; 96`;function Us(e){return i.jsxs("div",{className:e.className,children:[i.jsx(I,{variant:"body1",className:"categoryName",children:e.categoryName}),i.jsx(I,{variant:"h5",className:"message",children:i.jsx(T,{id:Vs(e.timePeriod,e.changeAmount)})})]})}function Vs(e,t){const n=Nn(e)||t===0;let a="neutral";switch(!n&&t!==void 0&&(a=t<0?"bad":"good"),e){case A.LAST_QUARTER:return S.SummaryWidget.change.lastQuarter[a];case A.THIS_QUARTER:return S.SummaryWidget.change.thisQuarter[a];case A.LAST_MONTH:return S.SummaryWidget.change.lastMonth[a];case A.THIS_MONTH:return S.SummaryWidget.change.thisMonth[a];case A.LAST_WEEK:return S.SummaryWidget.change.lastWeek[a];case A.THIS_WEEK:return S.SummaryWidget.change.thisWeek[a];case A.YESTERDAY:return S.SummaryWidget.change.yesterday.neutral;case A.TODAY:case A.NOT_SET:default:return S.SummaryWidget.change.today.neutral}}const Ms=x(Us)` 97 .categoryName { 98 overflow: hidden; 99 white-space: nowrap; 100 text-overflow: ellipsis; 101 margin-bottom: 4px; 102 } 103`;function Hs(e,t,n){switch(n){case"happyIndex":return t;case"nspIndex":return t;case"hour":return Tn(Number(t));case"date":return Ae(t).format("ll");case"weekday":return Pn(t);case"areaName":return i.jsx(jt,{categoryName:t,categoryId:Number(e.areaId)});case"locationName":return i.jsx(jt,{categoryName:t,categoryId:Number(e.locationId)});case"percentile":return i.jsx(Pe,{style:"percent",value:t/100});default:return t}}const Gs=e=>({showIndustryIndex:!!e.surveyGroups.selectedSurveyGroup&&e.surveyGroups.selectedSurveyGroup.features.some(t=>t===Rt.IndustryComparison)}),tt="feedbackSVG",qn="feedback-values-container";function $s(e){const t=Rn(),n=Bs(e.data,t);return i.jsx(ht,{bounds:!0,children:({measureRef:a})=>i.jsx("div",{className:e.className,ref:a,children:n.map((r,s)=>i.jsx(Ks,{...r},s))})})}function Bs(e,t){const n=rn(e.feedbacks.values),a=rn(e.feedbackPercentages.values),r=s=>({intl:t,feedbackAmount:n[s],feedbackPercentage:a[s]});return[{...r(0),element:i.jsx(us,{className:tt})},{...r(1),element:i.jsx(hs,{className:tt})},{...r(2),element:i.jsx(ps,{className:tt})}]}function Ks(e){const{feedbackAmount:t,feedbackPercentage:n,element:a,intl:r}=e,{formatNumber:s}=r;return i.jsxs("div",{className:qn,children:[a,i.jsx(I,{variant:"h5",className:"percentage",children:On(r,n)}),i.jsx(I,{variant:"body2",color:"textSecondary",className:"responses",children:s(t)})]})}const qs=x($s)` 104 && { 105 display: flex; 106 } 107 gap: 16px; 108 margin-top: 16px; 109 min-width: 240px; 110 box-sizing: border-box; 111 justify-content: start; 112 .${qn} { 113 text-align: center; 114 padding: 4px; 115 } 116 .${tt} { 117 width: 32px; 118 height: 32px; 119 } 120 .percentage { 121 margin-top: 4px; 122 } 123 .responses { 124 margin-top: 8px; 125 } 126`,zn="feedbackSVG",Qn="feedback-values-container";function zs(e){const{feedbacks:t,feedbackPercentages:n}=e.data,a=Qs(t,n,t.feedbackScale,e.intl);return i.jsx(ht,{bounds:!0,children:({measureRef:r})=>i.jsx("div",{className:e.className,ref:r,children:a.map((s,o)=>i.jsx(Ys,{...s},o))})})}function Qs(e,t,n,a){const r=Mi(n),s=gs(r,o=>{const d=Bn(o,n);return{element:i.jsx(d,{className:zn}),intl:a,feedbackAmount:e.values[o],feedbackPercentage:t.values[o]}});return Hi(n)?s:s.reverse()}function Ys(e){const{feedbackAmount:t,feedbackPercentage:n,element:a,intl:r}=e,{formatNumber:s}=r;return i.jsxs("div",{className:Qn,children:[a,i.jsx(I,{variant:"h5",className:"percentage",children:On(r,n)}),i.jsx(I,{variant:"body1",color:"textSecondary",className:"responses",children:s(t)})]})}const Xs=Nt(x(zs)` 127 && { 128 display: flex; 129 } 130 margin-top: 16px; 131 min-width: 240px; 132 box-sizing: border-box; 133 justify-content: space-between; 134 .${Qn} { 135 text-align: center; 136 padding: 5px; 137 } 138 .${zn} { 139 width: 32px; 140 height: 32px; 141 } 142 .percentage { 143 margin-top: 4px; 144 } 145 .responses { 146 margin-top: 4px; 147 } 148`);function Zs(e){const t=Te(h=>
148h.surveyGroups.selectedSurveyGroup),n=Te(h=>h.surveyGroups.all),a=Te(h=>h.intl),{data:r,state:s}=n,d=s===Gi&&r&&r.length>0&&t?$i(t.question,a):s===Bi?{id:S.General.Loading}:{id:S.SurveyGroupSelector.noQuestions},c=Js(e),l=t?.feedbackScaleSettings.feedbackScale??Ki;return i.jsxs(nr,{children:[i.jsx(I,{variant:"body1",children:i.jsx(T,{text:d})}),l===Wn.NPS?i.jsxs(i.Fragment,{children:[i.jsx(er,{...c}),i.jsx(qs,{data:e.data})]}):i.jsxs(i.Fragment,{children:[i.jsx(tr,{...c}),i.jsx(Xs,{data:e.data})]})]})}function hn(e,t){const{feedbackScale:n}=t,a=Ln(n),r=s=>e?s>=a:s<a;return t.values.reduce((s,o,d)=>r(d)?s+o:s,0)}function Js(e){const{data:t}=e,{feedbacks:n,feedbackPercentages:a}=t;return{responseCount:kt(n),positivePercentage:hn(!0,a),negativePercentage:hn(!1,a)}}function er(e){const{responseCount:t}=e;return i.jsx(I,{variant:"body1",children:i.jsx(T,{id:S.SummaryWidget.responses.only,values:{responseCount:i.jsx(nt,{className:e.className,children:i.jsx(Pe,{value:t})})}})})}function tr(e){const{responseCount:t,positivePercentage:n,negativePercentage:a}=e;return i.jsx(I,{variant:"body1",children:i.jsx(T,{id:S.SummaryWidget.responses.withPercentages,values:{responseCount:i.jsx(nt,{className:e.className,children:i.jsx(Pe,{value:t})}),positivePercentage:i.jsx(nt,{className:e.className,children:i.jsx(Pe,{style:"percent",value:n/100})}),negativePercentage:i.jsx(nt,{className:e.className,children:i.jsx(Pe,{style:"percent",value:a/100})})}})})}const nr=x.div` 149 max-width: 350px; 150 margin-top: 8px; 151 margin-bottom: 8px; 152 ${e=>` 153 ${e.theme.breakpoints.down("lg")} { 154 text-align: center; 155 } 156 `} 157`,nt=x.span` 158 font-weight: 600; 159`,ir=e=>i.jsx(ht,{client:!0,onResize:t=>{t&&t.client&&(e.setHeight(t.client.height),e.setWidth(t.client.width))},children:({measureRef:t})=>i.jsx("div",{ref:t,children:e.children})}),pn=1150;function ar(e){const{data:t}=e,[n,a]=F.useState(pn);return i.jsx(lt,{id:"SummaryWidget",title:{id:S.SummaryWidget.title},hasData:mn(t),loading:e.loading,surveyInactive:e.surveyInactive,data:mn(t)?t:void 0,showNoDataImage:!0,breakPointWidths:e.breakPointWidths,children:i.jsxs(ir,{setHeight:e.setHeight,setWidth:a,children:[i.jsxs(rr,{children:[i.jsx(sr,{categoryName:e.categoryName,changeAmount:t.keyFindings?t.keyFindings.indexChange:0,timePeriod:e.timePeriod.id}),i.jsx(Ls,{timePeriod:e.timePeriod})]}),i.jsxs(gn,{children:[i.jsxs(gn,{children:[!!t.keyFindings&&i.jsx(Os,{data:t.keyFindings,targetIndex:t.targetIndex,indexType:e.indexType}),!!t.distribution&&i.jsx(Zs,{data:t.distribution})]}),!!t.keyFindings&&!ie(t.keyFindings.findings)&&i.jsx(dr,{data:t.keyFindings,className:n<pn?"narrow":""})]})]})})}function mn(e){return!!e.distribution&&!!e.keyFindings}const sr=x(Ms)` 160 text-align: center; 161 margin-bottom: 4px; 162`,rr=x.div` 163 margin-bottom: 24px; 164`,gn=x.div` 165 display: flex; 166 margin-bottom: 16px; 167 flex-wrap: wrap; 168 justify-content: space-around; 169 align-items: center; 170`;function or(e){const{findings:t}=e.data;return i.jsxs("div",{className:e.className,children:[i.jsx(cr,{findings:t,showIndustryIndex:e.showIndustryIndex}),i.jsx(lr,{findings:t}),i.jsx(ur,{findings:t}),i.jsx(hr,{findings:t})]})}const D={row:"keyFindingsRow",icon:"keyFindingsIcon",rankingIcon:"keyFindingsRankinIcon",findingContainer:"keyFinding"},fn="50px",dr=x(ut(Gs)(or))` 171 min-width: 45%; 172 &.narrow { 173 min-width: 100%; 174 } 175 .${D.row} { 176 display: flex; 177 justify-content: center; 178 align-items: center; 179 padding: 8px; 180 } 181 .${D.icon} { 182 width: ${fn}; 183 } 184 .${D.rankingIcon} { 185 margin-${be}: 8px; 186 } 187 .${D.findingContainer} { 188 width: calc((100% - ${fn}) / 2); 189 &:first-child { 190 text-align: right; 191 } 192 } 193`;function cr(e){const t=e.findings.find(r=>r.key===K.INDUSTRY_PERCENTILE.TOP||r.key===K.INDUSTRY_PERCENTILE.BOTTOM),n=e.findings.find(r=>r.key===K.LOCATION.RANKING),a="font-weight: 600;";return t||n?i.jsxs("div",{className:D.row,children:[i.jsx(ds,{color:"action",className:D.rankingIcon}),i.jsxs("div",{children:[n&&i.jsx(I,{variant:"body1",children:i.jsx(T,{id:He(n.key),values:{...Me(n.params,a)}})}),e.showIndustryIndex&&t&&i.jsx(I,{variant:"body1",children:i.jsx(T,{id:He(t.key),values:{...Me(t.params,a)}})})]})]}):null}function lr(e){const t=e.findings.find(a=>a.key===K.LOCATION.BEST),n=e.findings.find(a=>a.key===K.LOCATION.WORST);if(t&&n){const a=at(t.params,n.params);return i.jsxs("div",{className:D.row,children:[i.jsx("div",{className:D.findingContainer,children:i.jsx(rt,{finding:t})}),i.jsx(os,{color:"disabled",className:D.icon}),i.jsx("div",{className:D.findingContainer,children:a?i.jsx(dt,{finding:n}):i.jsx(ot,{finding:n})})]})}else return null}function ur(e){const t=e.findings.find(s=>s.key===K.HOUR.BEST),n=e.findings.find(s=>s.key===K.WEEKDAY.BEST),a=e.findings.find(s=>s.key===K.HOUR.WORST),r=e.findings.find(s=>s.key===K.WEEKDAY.WORST);if(t&&a){const s=at(t.params,a.params),o=n&&r&&at(n.params,r.params);return i.jsxs("div",{className:D.row,children:[i.jsxs("div",{className:D.findingContainer,children:[i.jsx(rt,{finding:t}),n&&i.jsx(rt,{finding:n})]}),i.jsx(rs,{color:"disabled",className:D.icon}),i.jsxs("div",{className:D.findingContainer,children:[s?i.jsx(dt,{finding:a}):i.jsx(ot,{finding:a}),r?o?i.jsx(dt,{finding:r}):i.jsx(ot,{finding:r}):null]})]})}else return null}function hr(e){const t=e.findings.find(a=>a.key===K.DATE.BEST),n=e.findings.find(a=>a.key===K.DATE.WORST);if(t&&n){const a=at(t.params,n.params);return i.jsxs("div",{className:D.row,children:[i.jsx("div",{className:D.findingContainer,children:i.jsx(rt,{finding:t})}),i.jsx(ss,{color:"disabled",className:D.icon}),i.jsx("div",{className:D.findingContainer,children:a?i.jsx(dt,{finding:n}):i.jsx(ot,{finding:n})})]})}else return null}function rt(e){const n=ae().honExtensions.happyScaleColors;return i.jsx(I,{variant:"body1",children:i.jsx(T,{id:He(e.finding.key),values:{...Me(e.finding.params,Lt(n.veryHappy))}})})}function ot(e){const n=ae().honExtensions.happyScaleColors;return i.jsx(I,{variant:"body1",children:i.jsx(T,{id:He(e.finding.key),values:{...Me(e.finding.params,Lt(n.veryUnhappy))}})})}function dt(e){const n=ae().honExtensions.happyScaleColors;return i.jsx(I,{variant:"body1",children:i.jsx(T,{id:He(e.finding.key),values:{...Me(e.finding.params,Lt(n.veryUnhappy),!0)}})})}function Lt(e){return` 194 font-weight: 600; 195 color: ${e}; 196 display: inline-block; 197 a { 198 display: block; 199 color: ${e}; 200 } 201 `}const pr=x.span` 202 ${e=>e.$valueStyle} 203`;function Me(e,t,n){return qi(e,(r,s)=>i.jsx(pr,{$valueStyle:t,children:n?i.jsx(T,{id:S.General.NotAvailable}):Hs(e,r,s)}))}const He=e=>S.SummaryWidget.finding[e];function Pt(e){if(e.constructor!==Array)throw new TypeError("Expected array.");if(e.length===16)return e;if(e.length===6){var t=Fe();return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function Fe(){for(var e=[],t=0;t<16;t++)t%5==0?e.push(1):e.push(0);return e}function mr(e,t){for(var n=Pt(e),a=Pt(t),r=[],s=0;s<4;s++)for(var o=[n[s],n[s+4],n[s+8],n[s+12]],d=0;d<4;d++){var c=d*4,l=[a[c],a[c+1],a[c+2],a[c+3]],h=o[0]*l[0]+o[1]*l[1]+o[2]*l[2]+o[3]*l[3];r[s+c]=h}return r}function gr(e){if(typeof e=="string"){var t=e.match(/matrix(3d)?\(([^)]+)\)/);if(t){var n=t[2].split(", ").map(parseFloat);return Pt(n)}}return Fe()}function fr(e){var t=Fe();return t[0]=e,t}function xr(e){var t=Fe();return t[5]=e,t}function yr(e){var t=Fe();return t[12]=e,t}function vr(e){var t=Fe();return t[13]=e,t}var it=function(e){return typeof e=="number"},Yn=function(e){return typeof e=="function"},Xn=function(e){return Object.prototype.toString.call(e)==="[object Object]"},_e=function(e){return Array.prototype.slice.apply(e)},Zn=function(e){var t=e.reduce(function(n,a){return n[a]=(n[a]||0)+1,n},{});return Object.keys(t).filter(function(n){return t[n]>1})};
203function ue(e){return[].slice.call(arguments,1).forEach(function(t){if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}var Tt,_t=function(e,t,n){return e+(t-e)*n},Jn={__proto__:null,isNumber:it,isFunction:Yn,isObject:Xn,toArray:_e,getDuplicateValsAsStrings:Zn,assign:ue,tweenProp:_t},Ut="data-flip-id",Vt="data-inverse-flip-id",Mt="data-portal-key",Sr="data-exit-container",Xe={__proto__:null,DATA_FLIP_ID:Ut,DATA_INVERSE_FLIP_ID:Vt,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Mt},Ft={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},xn=function(e){return Xn(e)?e:Object.keys(Ft).indexOf(e)>-1?Ft[e]:{}};typeof window<"u"&&(Tt=window.requestAnimationFrame);var br=Tt=Tt||function(e){window.setTimeout(e,1e3/60)},Ir=Date.now(),kr=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-Ir};function ei(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1)}var wr=(function(){function e(){}return e.prototype.run=function(){var t=this;br(function(){t.springSystem.loop(kr())})},e})(),St=function(){this.position=0,this.velocity=0},Cr=0,B=.001,Er=(function(){function e(n){this._id="s"+Cr++,this._springSystem=n,this.listeners=[],this._startValue=0,this._currentState=new St,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new St,this._restSpeedThreshold=.001,this._tempState=new St,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var t=e.prototype;return t.getId=function(){return this._id},t.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},t.setSpringConfig=function(n){return this._springConfig=n,this},t.getCurrentValue=function(){return this._currentState.position},t.getDisplacementDistanceForState=function(n){return Math.abs(this._endValue-n.position)},t.setEndValue=function(n){if(n===this._endValue)return this;if(this.prevEndValue=n,this._endValue===n&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=n,this._springSystem.activateSpring(this.getId());for(var a=0,r=this.listeners.length;a<r;a++){var s=this.listeners[a].onSpringEndStateChange;s&&s(this)}return this},t.setVelocity=function(n){return n===this._currentState.velocity||(this._currentState.velocity=n,this._springSystem.activateSpring(this.getId())),this},t.setCurrentValue=function(n){this._startValue=n,this._currentState.position=n;for(var a=0,r=this.listeners.length;a<r;a++){var s=this.listeners[a];s.onSpringUpdate&&s.onSpringUpdate(this)}return this},t.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},t.setOvershootClampingEnabled=function(n){return this._overshootClampingEnabled=n,this},t.isOvershooting=function(){var n=this._startValue,a=this._endValue;return this._springConfig.tension>0&&(n<a&&this.getCurrentValue()>a||n>a&&this.getCurrentValue()<a)},t.advance=function(n,a){var r=this.isAtRest();if(!r||!this._wasAtRest){var s=a;a>.064&&(s=.064),this._timeAccumulator+=s;for(var o,d,c,l,h,m,g=this._springConfig.tension,p=this._springConfig.friction,f=this._currentState.position,b=this._currentState.velocity,E=this._tempState.position,j=this._tempState.velocity;this._timeAccumulator>=B;)this._timeAccumulator-=B,this._timeAccumulator<B&&(this._previousState.position=f,this._previousState.velocity=b),d=g*(this._endValue-E)-p*b,l=g*(this._endValue-(E=f+(o=b)*B*.5))-p*(j=b+d*B*.5),m=g*(this._endValue-(E=f+(c=j)*B*.5))-p*(j=b+l*B*.5),E=f+(h=j)*B,f+=1/6*(o+2*(c+h)+(j=b+m*B))*B,b+=1/6*(d+2*(l+m)+(g*(this._endValue-E)-p*j))*B;this._tempState.position=E,this._tempState.velocity=j,this._currentState.position=f,this._currentState.velocity=b,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/B),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),r=!0);var w=!1;this._wasAtRest&&(this._wasAtRest=!1,w=!0);var q=!1;r&&(this._wasAtRest=!0,q=!0),this.notifyPositionUpdated(w,q)}},t.notifyPositionUpdated=function(n,a){var r=this;
203this.listeners.filter(Boolean).forEach(function(s){n&&s.onSpringActivate&&!r._onActivateCalled&&(s.onSpringActivate(r),r._onActivateCalled=!0),s.onSpringUpdate&&s.onSpringUpdate(r),a&&s.onSpringAtRest&&s.onSpringAtRest(r)})},t.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},t.wasAtRest=function(){return this._wasAtRest},t.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},t._interpolate=function(n){this._currentState.position=this._currentState.position*n+this._previousState.position*(1-n),this._currentState.velocity=this._currentState.velocity*n+this._previousState.velocity*(1-n)},t.addListener=function(n){return this.listeners.push(n),this},t.addOneTimeListener=function(n){var a=this;return Object.keys(n).forEach(function(r){var s;n[r]=(s=n[r],function(){s.apply(void 0,[].slice.call(arguments)),a.removeListener(n)})}),this.listeners.push(n),this},t.removeListener=function(n){return ei(this.listeners,n),this},e})(),ti=(function(){function e(n){this.looper=n||new wr,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var t=e.prototype;return t.createSpring=function(n,a){return this.createSpringWithConfig({tension:n,friction:a})},t.createSpringWithConfig=function(n){var a=new Er(this);return this.registerSpring(a),a.setSpringConfig(n),a},t.getIsIdle=function(){return this._isIdle},t.registerSpring=function(n){this._springRegistry[n.getId()]=n},t.deregisterSpring=function(n){ei(this._activeSprings,n),delete this._springRegistry[n.getId()]},t.advance=function(n,a){for(var r=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(o){o.systemShouldAdvance()?o.advance(n/1e3,a/1e3):r._idleSpringIndices.push(r._activeSprings.indexOf(o))});this._idleSpringIndices.length>0;){var s=this._idleSpringIndices.pop();s>=0&&this._activeSprings.splice(s,1)}},t.loop=function(n){var a;this._lastTimeMillis===-1&&(this._lastTimeMillis=n-1);var r=n-this._lastTimeMillis;this._lastTimeMillis=n;var s=0,o=this.listeners.length;for(s=0;s<o;s++)(a=this.listeners[s]).onBeforeIntegrate&&a.onBeforeIntegrate(this);for(this.advance(n,r),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),s=0;s<o;s++)(a=this.listeners[s]).onAfterIntegrate&&a.onAfterIntegrate(this);this._isIdle||this.looper.run()},t.activateSpring=function(n){var a=this._springRegistry[n];this._activeSprings.indexOf(a)===-1&&this._activeSprings.push(a),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},e})(),jr=new ti,ni=function(e){var t=e.springConfig,n=t.overshootClamping,a=e.getOnUpdateFunc,r=e.onAnimationEnd,s=e.onSpringActivate,o=jr.createSpring(t.stiffness,t.damping);o.setOvershootClampingEnabled(!!n);var d={onSpringActivate:s,onSpringAtRest:function(){o.destroy(),r()},onSpringUpdate:a({spring:o,onAnimationEnd:r})};return o.addListener(d),o},yn=function(e){var t=ni(e);return t.setEndValue(1),t},vn=function(e,t){if(t===void 0&&(t={}),e&&e.length){t.reverse&&e.reverse();var n,a=typeof(n=t.speed)!="number"?1.1:1+Math.min(Math.max(5*n,0),5),r=1/Math.max(Math.min(e.length,100),10),s=e.map(function(o,d){var c=o.getOnUpdateFunc;return o.getOnUpdateFunc=function(l){var h=c(l);return function(m){var g=m.getCurrentValue();(g=g<.01?0:g>.99?1:g)>=r&&s[d+1]&&s[d+1](Math.max(Math.min(g*a,1),0)),h(m)}},o}).map(function(o){var d=ni(o);if(d)return d.setEndValue.bind(d)}).filter(Boolean);s[0]&&s[0](1)}},Sn=function(e){return[0,1,4,5,12,13].map(function(t){return e[t]})},bn=function(e){return e.top<window.innerHeight&&e.bottom>0&&e.left<window.innerWidth&&e.right>0};function In(e){return JSON.parse(e.dataset.flipConfig||"{}")}var ii=function(e,t){var n;return ue(e,((n={})[t[0]]=t[1],n))},ai=function(e,t){return _e(t?document.querySelectorAll("["+Mt+'="'+t+'"]'):e.querySelectorAll("["+Ut+"]"))},si=function(e){return e.map(function(t){return[t,t.getBoundingClientRect()]})},Ar=function(e){var t=e.cachedOrderedFlipIds,n=t===void 0?[]:t,a=e.inProgressAnimations,r=a===void 0?{}:a,s=e.flippedElementPositionsBeforeUpdate,o=s===void 0?{}:s,d=e.flipCallbacks,c=d===void 0?{}:d,l=e.containerEl,h=e.applyTransformOrigin,m=e.spring,g=e.debug,p=e.portalKey,f=e.staggerConfig,b=f===void 0?{}:f,E=e.decisionData,j=E===void 0?{}:E,w=e.handleEnterUpdateDelete,q=e.onComplete,z=e.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var Q,Y=si(ai((Q={element:l,portalKey:p}).element,Q.portalKey)).map(function(y){var _=y[0],L=y[1],v=window.getComputedStyle(_);return[_.dataset.flipId,{element:_,rect:L,opacity:parseFloat(v.opacity),transform:v.transform}]}).reduce(ii,{}),Ge=(function(y){var _=y.containerEl,L=y.portalKey;return L?(function(v){return function(G){return _e(document.querySelectorAll("["+Mt+'="'+v+'"]'+G))}})(L):_?(function(v){var G=Math.random().toFixed(5);return v.dataset.flipperId=G,function(Z){return _e(v.querySelectorAll('[data-flipper-id="'+G+'"] '+Z))}})(_):function(){return[]}})({containerEl:l,portalKey:p}),pt=(function(y){return function(_){return y("["+Ut+'="'+_+'"]')[0]}})(Ge),$e=function(y){return o[y]&&Y[y]},mt=Object.keys(o).concat(Object.keys(Y)).filter(function(y){return!$e(y)}),Be={flipCallbacks:c,getElement:pt,flippedElementPositionsBeforeUpdate:o,flippedElementPositionsAfterUpdate:Y,inProgressAnimations:r,decisionData:j},Ie=(function(y){var _,L=y.unflippedIds,v=y.flipCallbacks,G=y.getElement,Z=y.flippedElementPositionsBeforeUpdate,re=y.flippedElementPositionsAfterUpdate,ke=y.inProgressAnimations,we=y.decisionData,Ce=L.filter(function(k){return re[k]}).filter(function(k){return v[k]&&v[k].onAppear}),Re=L.filter(function(k){return Z[k]&&v[k]&&v[k].onExit}),oe=new Promise(function(k){_=k}),J=[],he=0,P=Re.map(function(k,ee){var $=Z[k].domDataForExitAnimations,M=$.element,de=$.parent,pe=$.childPosition,te=pe.top,qe=pe.left,me=pe.width,ge=pe.height;getComputedStyle(de).position==="static"&&(de.style.position="relative"),M.style.transform="matrix(1, 0, 0, 1, 0, 0)",M.style.position="absolute",M.style.top=te+"px",M.style.left=qe+"px",M.style.height=ge+"px",M.style.width=me+"px";var fe=J.filter(function(Oe){return Oe[0]===de})[0];fe||(fe=[de,document.createDocumentFragment()],J.push(fe)),fe[1].appendChild(M),he+=1;var Ee=function(){try{de.removeChild(M)}catch{}finally{(he-=1)==0&&_()}};return ke[k]={stop:Ee},function(){return v[k].onExit(M,ee,Ee,we)}});return J.forEach(function(k){k[0].appendChild(k[1])}),P.length||_(),{hideEnteringElements:function(){Ce.forEach(function(k){var ee=G(k);ee&&(ee.style.opacity="0")})},animateEnteringElements:function(){Ce.forEach(function(k,ee){var $=G(k);$&&v[k].onAppear($,ee,we)})},animateExitingElements:function(){return P.forEach(function(k){return k()}),oe}}})(ue({},Be,{unflippedIds:mt})),De=Ie.hideEnteringElements,Ke=Ie.animateEnteringElements,X=Ie.animateExitingElements,se=ue({},Be,{containerEl:l,flippedIds:n.filter($e),applyTransformOrigin:h,spring:m,debug:g,staggerConfig:b,scopedSelector:Ge,onComplete:q});z&&z(l,j);var Ne=(function(y){var _,L=y.flippedIds,v=y.flipCallbacks,G=y.inProgressAnimations,Z=y.flippedElementPositionsBeforeUpdate,re=y.flippedElementPositionsAfterUpdate,ke=y.applyTransformOrigin,we=y.spring,Ce=y.getElement,Re=y.debug,oe=y.staggerConfig,J=oe===void 0?{}:oe,he=y.decisionData,P=he===void 0?{}:he,k=y.onComplete,ee=y.containerEl,$=new Promise(function(u){_=u});if(k&&$.then(function(){return k(ee,P)}),!L.length)return function(){return _([]),$};var M=[],de=Ce(L[0]),pe=de?de.ownerDocument.querySelector("body"):document.querySelector("body");Zn(L);
203var te=L.map(function(u){var C=Z[u].rect,N=re[u].rect,We=Z[u].opacity,Gt=re[u].opacity,$t=N.width<1||N.height<1,W=re[u].element;if(!bn(C)&&!bn(N)||!W)return!1;var Bt,Kt,qt,ne=In(W),zt=(qt=(Kt=(Bt={flipperSpring:we,flippedSpring:ne.spring})===void 0?{}:Bt).flippedSpring,ue({},Ft.noWobble,xn(Kt.flipperSpring),xn(qt))),Qt=ne.stagger===!0?"default":ne.stagger,gi={element:W,id:u,stagger:Qt,springConfig:zt};if(v[u]&&v[u].shouldFlip&&!v[u].shouldFlip(P.previous,P.current))return!1;var fi=Math.abs(C.left-N.left)+Math.abs(C.top-N.top),xi=Math.abs(C.width-N.width)+Math.abs(C.height-N.height),yi=Math.abs(Gt-We);if(C.height===0&&N.height===0||C.width===0&&N.width===0||fi<.5&&xi<.5&&yi<.01)return!1;var Yt=gr(re[u].transform),xe={matrix:Yt},ce={matrix:[]},Le=[Yt];ne.translate&&(Le.push(yr(C.left-N.left)),Le.push(vr(C.top-N.top))),ne.scale&&(Le.push(fr(Math.max(C.width,1)/Math.max(N.width,1))),Le.push(xr(Math.max(C.height,1)/Math.max(N.height,1)))),ne.opacity&&(ce.opacity=We,xe.opacity=Gt);var ze=[];if(!v[u]||!v[u].shouldInvert||v[u].shouldInvert(P.previous,P.current)){var vi=(function(O,U){return _e(O.querySelectorAll("["+Vt+'="'+U+'"]'))})(W,u);ze=vi.map(function(O){return[O,In(O)]})}ce.matrix=Sn(Le.reduce(mr)),xe.matrix=Sn(xe.matrix);var gt,Xt=(function(O){var U=O.element,ye=O.invertedChildren,Ue=O.body;return function(je){var ve=je.matrix,Qe=je.opacity,ft=je.forceMinVals;if(it(Qe)&&(U.style.opacity=Qe+""),ft&&(U.style.minHeight="1px",U.style.minWidth="1px"),ve){var bi=(function(Ve){return"matrix("+Ve.join(", ")+")"})(ve);U.style.transform=bi,ye&&(function(Ve){var Ye=Ve.matrix,Ii=Ve.body;Ve.invertedChildren.forEach(function(en){var tn=en[0],nn=en[1];if(Ii.contains(tn)){var an=Ye[0],sn=Ye[3],ki=Ye[5],le={translateX:0,translateY:0,scaleX:1,scaleY:1},xt="";nn.translate&&(le.translateX=-Ye[4]/an,le.translateY=-ki/sn,xt+="translate("+le.translateX+"px, "+le.translateY+"px)"),nn.scale&&(le.scaleX=1/an,le.scaleY=1/sn,xt+=" scale("+le.scaleX+", "+le.scaleY+")"),tn.style.transform=xt}})})({invertedChildren:ye,matrix:ve,body:Ue})}}})({element:W,invertedChildren:ze,body:pe});if(v[u]&&v[u].onComplete){var Si=v[u].onComplete;gt=function(){return Si(W,P)}}var Zt=it(ce.opacity)&&it(xe.opacity)&&ce.opacity!==xe.opacity,Jt=!1;return ue({},gi,{stagger:Qt,springConfig:zt,getOnUpdateFunc:function(O){var U=O.spring,ye=O.onAnimationEnd;return G[u]={destroy:U.destroy.bind(U),onAnimationEnd:ye},function(Ue){v[u]&&v[u].onSpringUpdate&&v[u].onSpringUpdate(Ue.getCurrentValue()),Jt||(Jt=!0,v[u]&&v[u].onStart&&v[u].onStart(W,P));var je=Ue.getCurrentValue();if(pe.contains(W)){var ve={matrix:[]};ve.matrix=ce.matrix.map(function(Qe,ft){return _t(Qe,xe.matrix[ft],je)}),Zt&&(ve.opacity=_t(ce.opacity,xe.opacity,je)),Xt(ve)}else Ue.destroy()}},initializeFlip:function(){Xt({matrix:ce.matrix,opacity:Zt?ce.opacity:void 0,forceMinVals:$t}),v[u]&&v[u].onStartImmediate&&v[u].onStartImmediate(W,P),ne.transformOrigin?W.style.transformOrigin=ne.transformOrigin:ke&&(W.style.transformOrigin="0 0"),ze.forEach(function(O){var U=O[0],ye=O[1];ye.transformOrigin?U.style.transformOrigin=ye.transformOrigin:ke&&(U.style.transformOrigin="0 0")})},onAnimationEnd:function(O){delete G[u],Yn(gt)&>(),W.style.transform="",ze.forEach(function(U){U[0].style.transform=""}),$t&&W&&(W.style.minHeight="",W.style.minWidth=""),O||(M.push(u),M.length>=te.length&&_(M))},delayUntil:ne.delayUntil})}).filter(Boolean);if(te.forEach(function(u){return(0,u.initializeFlip)()}),Re)return function(){};var qe=te.filter(function(u){return u.delayUntil&&(C=u.delayUntil,te.filter(function(N){return N.id===C}).length);var C}),me={},ge={},fe={};qe.forEach(function(u){u.stagger?(fe[u.stagger]=!0,ge[u.delayUntil]?ge[u.delayUntil].push(u.stagger):ge[u.delayUntil]=[u.stagger]):me[u.delayUntil]?me[u.delayUntil].push(u):me[u.delayUntil]=[u]});var Ee=te.filter(function(u){return u.stagger}).reduce(function(u,C){return u[C.stagger]?u[C.stagger].push(C):u[C.stagger]=[C],u},{}),Oe=te.filter(function(u){return qe.indexOf(u)===-1});return Oe.forEach(function(u){u.onSpringActivate=function(){me[u.id]&&me[u.id].forEach(yn),ge[u.id]&&Object.keys(ge[u.id].reduce(function(C,N){var We;return ue(C,((We={})[N]=!0,We))},{}
203)).forEach(function(C){vn(Ee[C],J[C])})}}),function(){return te.length||_([]),Oe.filter(function(u){return!u.stagger}).forEach(yn),Object.keys(Ee).forEach(function(u){fe[u]||vn(Ee[u],J[u])}),$}})(se);w?w({hideEnteringElements:De,animateEnteringElements:Ke,animateExitingElements:X,animateFlippedElements:Ne}):(De(),X().then(Ke),Ne())}},Pr=function(e){var t=e.element,n=e.flipCallbacks,a=n===void 0?{}:n,r=e.inProgressAnimations,s=r===void 0?{}:r,o=ai(t,e.portalKey),d=_e(t.querySelectorAll("["+Vt+"]")),c={},l=[],h={};o.filter(function(p){return a&&a[p.dataset.flipId]&&a[p.dataset.flipId].onExit}).forEach(function(p){var f=p.parentNode;if(p.closest){var b=p.closest("["+Sr+"]");b&&(f=b)}var E=l.findIndex(function(j){return j[0]===f});E===-1&&(l.push([f,f.getBoundingClientRect()]),E=l.length-1),c[p.dataset.flipId]=l[E][1],h[p.dataset.flipId]=f});var m=si(o),g=m.map(function(p){var f=p[0],b=p[1],E={};if(a&&a[f.dataset.flipId]&&a[f.dataset.flipId].onExit){var j=c[f.dataset.flipId];ue(E,{element:f,parent:h[f.dataset.flipId],childPosition:{top:b.top-j.top,left:b.left-j.left,width:b.
203width,height:b.height}})}return[f.dataset.flipId,{rect:b,opacity:parseFloat(window.getComputedStyle(f).opacity||"1"),domDataForExitAnimations:E}]}).reduce(ii,{});return(function(p,f){Object.keys(p).forEach(function(b){p[b].destroy&&p[b].destroy(),p[b].onAnimationEnd&&p[b].onAnimationEnd(!0),delete p[b]}),f.forEach(function(b){b.style.transform="",b.style.opacity=""})})(s,o.concat(d)),{flippedElementPositions:g,cachedOrderedFlipIds:m.map(function(p){return p[0].dataset.flipId})}};new ti;function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ct.apply(this,arguments)}function Dt(e,t){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Dt(e,t)}function ri(e,t){if(e==null)return{};var n,a,r={},s=Object.keys(e);for(a=0;a<s.length;a++)t.indexOf(n=s[a])>=0||(r[n]=e[n]);return r}var oi=F.createContext({}),di=F.createContext("portal"),ci=(function(e){var t,n;function a(){for(var s,o=arguments.length,d=new Array(o),c=0;c<o;c++)d[c]=arguments[c];return(s=e.call.apply(e,[this].concat(d))||this).inProgressAnimations={},s.flipCallbacks={},s.el=void 0,s}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,Dt(t,n);var r=a.prototype;return r.getSnapshotBeforeUpdate=function(s){return s.flipKey!==this.props.flipKey&&this.el?Pr({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},r.componentDidUpdate=function(s,o,d){this.props.flipKey!==s.flipKey&&this.el&&Ar({flippedElementPositionsBeforeUpdate:d.flippedElementPositions,cachedOrderedFlipIds:d.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:s.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},r.render=function(){var s=this,o=this.props,d=o.portalKey,c=V.createElement(oi.Provider,{value:this.flipCallbacks},V.createElement(o.element,{className:o.className,ref:function(l){return s.el=l}},this.props.children));return d&&(c=V.createElement(di.Provider,{value:d},c)),c},a})(F.Component);ci.defaultProps={applyTransformOrigin:!0,element:"div"};var Tr=["children","flipId","inverseFlipId","portalKey"],_r=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],kn=function(e){var t,n=e.children,a=e.flipId,r=e.inverseFlipId,s=e.portalKey,o=ri(e,Tr),d=n,c=(function(h){return typeof h=="function"})(d);if(!c)try{d=F.Children.only(n)}catch{throw new Error("Each Flipped component must wrap a single child")}o.scale||o.translate||o.opacity||Jn.assign(o,{translate:!0,scale:!0,opacity:!0});var l=((t={})[Xe.DATA_FLIP_CONFIG]=JSON.stringify(o),t);return a!==void 0?l[Xe.DATA_FLIP_ID]=String(a):r&&(l[Xe.DATA_INVERSE_FLIP_ID]=String(r)),s!==void 0&&(l[Xe.DATA_PORTAL_KEY]=s),c?d(l):F.cloneElement(d,l)},li=function(e){var t=e.children,n=e.flipId,a=e.shouldFlip,r=e.shouldInvert,s=e.onAppear,o=e.onStart,d=e.onStartImmediate,c=e.onComplete,l=e.onExit,h=e.onSpringUpdate,m=ri(e,_r);return t?m.inverseFlipId?V.createElement(kn,ct({},m),t):V.createElement(di.Consumer,null,function(g){return V.createElement(oi.Consumer,null,function(p){return Jn.isObject(p)&&n&&(p[n]={shouldFlip:a,shouldInvert:r,onAppear:s,onStart:o,onStartImmediate:d,onComplete:c,onExit:l,onSpringUpdate:h}),V.createElement(kn,ct({flipId:n},m,{portalKey:g}),t)})}):null};li.displayName="Flipped";function ui(e){const{even:t,openAnswer:n,categoryName:a,categoryId:r,timeReference:s,feedbackIcon:o,contentTypographyProps:d,guardedFeedbackConfig:c}=e,l=t?{sx:{ml:6.5,mr:"auto",textAlign:"left"}}:{sx:{ml:"auto",mr:6.5,textAlign:"right"}};return i.jsxs(H,{sx:{mb:1,minHeight:"15%"},children:[i.jsxs(H,{sx:{display:"flex",alignItems:"flex-end"},children:[i.jsx(H,{sx:{width:36,height:36,flexShrink:0,order:t?1:2,"& .quick-view-open-feedback-nps-button":{width:36,height:36}},children:o}),i.jsxs(Fr,{even:t,children:[i.jsx(H,{sx:{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3},children:i.jsx(I,{variant:"body1",...d,children:n.feedback.content})}),i.jsxs(H,{sx:{display:"flex",alignItems:"center",gap:1},children:[c?i.jsx(ms,{description:c.modificationDescription}):null,i.jsx(H,{component:es,categoryId:r,categoryName:a,sx:{width:"100%",overflow:"hidden"}})]})]})]}),i.jsx(H,{...l,children:i.jsx(I,{variant:"caption",color:"textSecondary",children:Ae(s).fromNow()})})]})}function Fr(e){const{even:t,children:n}=e,a=ae(),r=t?{ml:1,mr:"auto",order:2,borderRadius:"24px 24px 24px 0"}:{ml:"auto",mr:1,order:1,borderRadius:"24px 24px 0 24px"};return i.jsx(H,{sx:{maxWidth:"calc(100% - 88px - 32px)",maxHeight:80,py:1,px:2,bgcolor:a.honExtensions.surfaceColors.light,border:`1px solid ${a.honExtensions.borderColors.light}`,...r},children:n})}function Dr(e){const{localizations:t,openAnswer:n,...a}=e,{formatLocalizedText:r}=Un(),s=zi({openAnswer:n,formatter:r,localizations:t}),{isContentFullyHidden:o,guardedContent:d,description:c}=s,l={...n,feedback:{...n.feedback,content:d}};return i.jsx(ui,{...a,openAnswer:l,contentTypographyProps:o?Qi:void 0,guardedFeedbackConfig:{modificationDescription:c}})}function Nr(e){const t=Te(a=>a.surveyGroups.selectedSurveyGroup?.features);return ts(e.openAnswer,t)?i.jsx(Dr,{...e,localizations:Yi}):i.jsx(ui,{...e})}const Rr=12e3;function Or(e){const{allItems:t,flipItemCount:n}=e,[a,r]=V.useState([]),s=V.useRef(),o=V.useRef(0);V.useEffect(()=>
203(r(c()),l(),()=>{clearInterval(s.current)}),[]);const d=V.useCallback(()=>(o.current++).toString(),[]),c=V.useCallback(()=>t.slice(0,n).map((h,m)=>({openFeedback:h,even:m%2===0,flipId:d()})),[t,n,d]),l=V.useCallback(()=>{clearInterval(s.current),s.current=setInterval(()=>{r(h=>Wr(h,t,d()))},Rr)},[t,c,d]);return i.jsx(H,{sx:{pt:2,overflow:"hidden",position:"relative",minHeight:200},children:i.jsx(ci,{flipKey:a.map(h=>h.openFeedback.feedback.id).join("-"),children:i.jsx(H,{component:"ul",sx:{p:0,mt:0,listStyleType:"none"},children:a.map(h=>{const{feedbackScale:m,button:g}=h.openFeedback,p=Bn(g,m),f=i.jsx(p,{className:m===Wn.NPS?"quick-view-open-feedback-nps-button":"quick-view-open-feedback-smiley"});return i.jsx(li,{flipId:h.flipId,children:i.jsx("li",{children:i.jsx(Nr,{openAnswer:h.openFeedback,categoryName:h.openFeedback.category.name,categoryId:h.openFeedback.category.id,timeReference:h.openFeedback.timestamp,even:h.even,feedbackIcon:f})})},h.flipId)})})})})}function Wr(e,t,n){if(!(t.length>1&&e.length>0))return e;const r=e.slice(1),s=e.at(-1),o=t.findIndex(c=>c.feedback.id===s.openFeedback.feedback.id),d=t[o+1]??t[0];return r.some(c=>c.openFeedback.feedback.id===d.feedback.id)?e:e.length<=t.length?r.concat({openFeedback:d,even:!s.even,flipId:n}):r}function Lr(e){const t=ae();return i.jsx(Gr,{children:e.followUps.map((n,a)=>F.createElement(Ur,{...n,key:a,change:n.comparisonChange,theme:t,onMouseOverHandler:e.onMouseOverHandler,onMouseOutHandler:e.onMouseOutHandler}))})}function Ur(e){const{isPositive:t,feedbacks:n,significance:a,onMouseOutHandler:r,onMouseOverHandler:s}=e,o=t?wt(n):Ct(n);return i.jsxs(i.Fragment,{children:[i.jsxs($r,{onMouseOut:r,onMouseOver:d=>s(e,d),children:[i.jsx(Br,{children:i.jsx(Kr,{variant:"h5",$fontSize:Vr(e.maxValue),children:i.jsx(Pe,{value:o})})}),i.jsx(qr,{children:i.jsx(Hr,{maxValue:e.maxValue,valuesWithBarColors:Mr(n,e.theme,t)})})]}),i.jsxs(zr,{children:[i.jsx(Qr,{children:i.jsx(Wt,{changeAmount:e.change,invert:!e.isPositive})}),i.jsx(Yr,{children:i.jsx(I,{variant:"body1",noWrap:!0,children:i.jsx(st,{showMarker:!!a,showDescription:!1,significance:a||Et.Unknown,alwaysShowChildren:!0,children:e.followUp+Ot})})})]})]})}function Vr(e){return Math.min(22,60/e.toString().length)}function Mr(e,t,n){const{happyScaleColors:a}=t.honExtensions,r=e.values,s=e.feedbackScale,o=Ln(s),d=c=>c>=o?n:!n;return r.reduce((c,l,h)=>d(h)?[...c,{value:l,barColor:Xi(h,s,a)}]:c,[])}function Hr(e){const{valuesWithBarColors:t,maxValue:n}=e,a=Math.max(ns(t.map(s=>s.value)),n),r=s=>s===t.length-1||t.slice(s+1).every(o=>!o.value);return i.jsx(Xr,{children:t.map((s,o)=>{const c={$percentage:s.value/a*100,$barColor:s.barColor};return r(o)?i.jsx(Jr,{...c},o):i.jsx(Zr,{...c},o)})})}const Ht=x.div` 204 display: flex; 205 flex-direction: column; 206`,hi=x.div` 207 display: flex; 208 flex-direction: row; 209`,Gr=x(Ht)` 210 text-align: ${be}; 211`,$r=x(hi)` 212 height: 30px; 213`,Br=x(Ht)` 214 flex: 0 0 30%; 215 justify-content: center; 216 padding-${be}: 8px; 217 min-width: 40px; 218 max-width: 75px; 219`,Kr=x(I)` 220 &&& { 221 font-size: ${e=>e.$fontSize}px; 222 } 223`,qr=x(Ht)` 224 flex: 0 0 65%; 225 justify-content: center; 226`,zr=x(hi)` 227 height: 20px; 228 margin-bottom: 8px; 229 align-items: baseline; 230`,Qr=x.div` 231 flex: 0 0 30%; 232 padding-${be}: 8px; 233 min-width: 40px; 234 font-size: 12px; 235 max-width: 75px; 236 margin-top: -4px; 237`,Yr=x.div` 238 flex: 0 0 65%; 239 text-align: ${It}; 240 overflow: hidden; 241`,Xr=x.div` 242 display: inline-flex; 243`,Zr=x.div` 244 display: inline-flex; 245 width: ${e=>e.$percentage+"%"}; 246 background-color: ${e=>e.$barColor}; 247 height: 20px; 248`,Jr=x.div` 249 display: inline-flex; 250 width: ${e=>e.$percentage+"%"}; 251 background-color: ${e=>e.$barColor}; 252 border-top-${be}-radius: 3px; 253 border-bottom-${be}-radius: 3px; 254 height: 20px; 255`,eo=6,to=45,wn=4,Cn=425;function no(e){const{openFeedbackData:t,highlightData:n,painpointData:a,comparisonHighlightData:r,comparisonPainpointData:s,isAiSummaryAvailable:o}=e,[d,c]=F.useState({active:!1,item:void 0,tooltipCoordinates:""}),l=ae(),h=Un(),g=Te(w=>w.surveyGroups.selectedSurveyGroup?.features.includes(Rt.AiSummary))&&o!==void 0?i.jsx(oo,{isAiSummaryAvailable:o}):void 0,p=En(!0,n,r,wt,h).filter(w=>wt(w.feedbacks)>0).slice(0,wn),f=En(!1,a,s,Ct,h).filter(w=>Ct(w.feedbacks)>0).slice(0,wn),b=e.isLoading||ie(e.highlightData)&&ie(e.painpointData),E=(w,q)=>{const z=io(q,w.isPositive);c(Q=>({...Q,item:{...w,additionalTooltip:so(w.question,w.significance)},active:!0,tooltipCoordinates:z??Q.tooltipCoordinates}))},j=()=>{c(w=>({...w,active:!1}))};return i.jsx(lt,{id:"SupplementaryFeedbackWidget",title:{id:S.SupplementaryFeedbackWidget.followups.title},loading:e.isLoading,hasData:!ie(e.openFeedbackData)||!ie(p)||!ie(f),surveyInactive:e.surveyInactive,infoTooltip:b?void 0:i.jsx($n,{textId:S.SupplementaryFeedbackWidget.infoTooltip,children:e.significanceEnabled?i.jsx(ro,{}):i.jsx(i.Fragment,{})}),breakPointWidths:e.breakPointWidths,footer:g,children:i.jsxs(mo,{children:[i.jsxs(po,{$maxHeight:e.maxHeight,children:[i.jsxs(Vn,{container:!0,spacing:Zi(l),sx:{alignItems:"stretch"},children:[!!p.length&&i.jsx(jn,{followUps:p,isPositive:!0,isFullWidth:!f.length,onMouseOutHandler:j,onMouseOverHandler:E}),!!f.length&&i.jsx(jn,{followUps:f,isPositive:!1,isFullWidth:!p.length,onMouseOutHandler:j,onMouseOverHandler:E})]}),t&&!!t.length&&i.jsxs(i.Fragment,{children:[i.jsx(Or,{allItems:t,flipItemCount:eo}),i.jsx(fo,{$height:to,children:i.jsx(ho,{totalOpenFeedbackCount:t.length})}),i.jsx(go,{})]})]}),d.item&&i.jsx(Ha,{active:d.active,item:d.item,tooltipConfig:{showTotalResponses:!1,shownResponseIndexe
255s:ao(d.item)},tooltipCoordinates:d.tooltipCoordinates})]})})}function io(e,t){const a=e.currentTarget;if(a)return` 256 left: ${a.offsetParent.offsetWidth/2+(t?5:-100)}px; 257 top: ${a.offsetTop+5+80}px; 258 `}function ao(e){return e.isPositive?Ji(e.feedbacks.feedbackScale):ea(e.feedbacks.feedbackScale)}function so(e,t){return i.jsxs(i.Fragment,{children:[t&&i.jsx(yo,{children:i.jsx(I,{variant:"caption",children:i.jsx(st,{showMarker:!0,showDescription:!0,significance:t})})}),i.jsxs(vo,{children:[i.jsx(I,{variant:"caption",color:"textSecondary",children:i.jsx(T,{text:{id:S.General.Followup.Question.colon}})}),i.jsx(I,{variant:"caption",component:"div",color:"textSecondary",children:e})]})]})}function En(e,t,n,a,r){const s=m=>m.reduce((g,p)=>[...g,...p.results.map(f=>({...f,questionLocalizations:p.localizations})),...s(p.next??[])],[]),o=s(t||[]),d=s(n||[]),c=m=>a(m.feedbacks),l=is(o,c),h=l?a(l.feedbacks):0;return as(o,c,"desc").map(m=>{const g=d.find(f=>f.optionId===m.optionId)?.feedbacks,p=g?a(m.feedbacks)-a(g):void 0;return{isPositive:e,feedbacks:m.feedbacks,comparisonChange:e||!p?p:-p,maxValue:h,followUp:yt(m.localizations,r),optionId:m.optionId,significance:m.significance,label:yt(m.localizations,r)+(m.significance?Ot+qa(m.significance):""),question:yt(m.questionLocalizations,r)}})}function ro(){return i.jsx(i.Fragment,{children:[Et.Significant,Et.LikelySignificant].map(e=>i.jsxs(So,{variant:"body2",children:[i.jsx(st,{showMarker:!0,showDescription:!1,significance:e}),Ot,i.jsx(st,{showMarker:!1,showDescription:!0,significance:e})]},e))})}function jn(e){const{followUps:t,isPositive:n,isFullWidth:a,onMouseOutHandler:r,onMouseOverHandler:s}=e;return i.jsx(Vn,{size:{sm:a?R.FULL:R.HALF,xs:R.FULL},children:i.jsx(Lr,{isPositive:n,followUps:t,onMouseOutHandler:r,onMouseOverHandler:s})})}function oo(e){return e.isAiSummaryAvailable?i.jsx(lo,{}):i.jsx(co,{})}function co(){return i.jsx(pi,{children:i.jsx(I,{variant:"caption",color:"textSecondary",children:i.jsx(T,{text:{id:S.General.Widgets.infoText.openFeedbackSummary.notEnoughFeedback,values:{HelpCenterLink:i.jsx(ta,{href:Fn.openFeedbackSummary})}}})})})}function lo(){const e=na(),t=Ga(),n=uo(t),a=Te(o=>o.authenticatedUser.request.data);function r(){xs({operationType:vs.QuickViewSummaryClicked,modeValue:ys.QuickView,locale:a.locale,userData:{email:a.email,company:a.company}}),n?(e(sa({id:S.General.loading.generatingSummary})),Mn.getQuickViewOpenFeedbackSummaryLink(n).then(s).catch()):ra(S.General.error.generic)}function s(o){e(oa()),window.open(o)}return i.jsxs(pi,{children:[i.jsxs(H,{onClick:r,style:{cursor:"pointer"},sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(H,{component:ia,sx:{width:20,height:20}}),i.jsx(I,{variant:"button",color:"textPrimary",children:i.jsx(T,{id:S.General.Widgets.linkText.viewOpenFeedbackSummary})})]}),i.jsx(I,{variant:"caption",color:"textSecondary",align:"center",children:i.jsx(T,{id:S.General.info.poweredByAi})})]})}function uo(e){const{selectedCategoryId:t,selectedSurveyGroupId:n,timePeriod:a}=e;if(!t||!n)return;const r=aa(a,on,on,void 0,!0),{startDate:s,endDate:o}=r;return{categoryId:t,surveyGroupId:n,timePeriod:a,startDate:s,endDate:o}}function ho(e){const t=Rn();return i.jsxs(i.Fragment,{children:[i.jsx(xo,{color:"disabled"}),i.jsx(I,{variant:"caption",color:"textSecondary",align:"center",children:i.jsx(T,{text:{id:S.SupplementaryFeedbackWidget.openFeedback.count,values:{count:t.formatNumber(e.totalOpenFeedbackCount)}}})})]})}const po=x.div` 259 overflow: hidden; 260 position: relative; 261 max-height: ${e=>e.$maxHeight<Cn?Cn:e.$maxHeight}px; 262 z-index: 0; 263 @media screen and (max-width: 768px) { 264 max-height: 700px; 265 } 266`,mo=x.div``,go=x.div` 267 right: 0px; 268 left: 0px; 269 height: 90px; 270 position: absolute; 271 background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 55%); 272 bottom: 0px; 273`,pi=x.div` 274 display: flex; 275 padding: 12px 16px; 276 align-items: center; 277 justify-content: space-between; 278 background-color: ${e=>e.theme.honExtensions.surfaceColors.medium}; 279 280 /* max-width 625px and 1475px chosen based on the longest translation text (German) */ 281 @media (max-width: 625px), (min-width: 768px) and (max-width: 1475px) { 282 flex-direction: column; 283 } 284`,fo=x.div` 285 right: 0px; 286 left: 0px; 287 position: absolute; 288 background-color: transparent; 289 bottom: 0px; 290 height: ${e=>e.$height}px; 291 z-index: 1; 292 display: flex; 293 align-items: center; 294 justify-content: center; 295`,xo=x(fs)` 296 && { 297 width: 14px; 298 height: 14px; 299 margin-${be}: 8px; 300 vertical-align: middle; 301 } 302`,yo=x.div` 303 color: ${e=>e.theme.palette.text.secondary}; 304 padding: 0px 14px 5px 14px; 305`,vo=x.div` 306 background-color: ${e=>e.theme.honExtensions.surfaceColors.light}; 307 padding: 8px 14px; 308 text-align: center; 309`,So=x(I)` 310 && { 311 color: ${e=>e.theme.honExtensions.whiteTextColors.primary}; 312 } 313`,bo=e=>{const t=ae(),n=!ie(e.weekdayPatternData),a=n?e.weekdayPatternData.map(o=>da(o.week,e.formatDate)):[],r=n?e.weekdayPatternData[0].weekdays.map(o=>_n(o.weekday)):[],s=n?e.weekdayPatternData.map(o=>
313o.weekdays.map((d,c)=>{const l=Ae(o.week).isoWeekday(c+1),h=l.valueOf(),m=e.selectedTimePeriod.start&&h<e.selectedTimePeriod.start.getTime()||e.selectedTimePeriod.endInclusive&&h>e.selectedTimePeriod.endInclusive.getTime();return{style:{backgroundColor:Gn(t,d.metrics?d.metrics.distance:void 0)},tooltip:{title:ca(l),indexType:e.indexType,indexValue:d.metrics&&d.metrics.index,responses:d.metrics&&d.metrics.responses,outsideTimePeriod:m}}})):[];return i.jsx(Kn,{id:"WeekdayPatternWidget",titleId:S.WeekdayPatternWidget.title,hasData:n,loading:e.loading,surveyInactive:e.surveyInactive,breakPointWidths:e.breakPointWidths,children:i.jsx(Hn,{className:e.className,data:s,xLabels:r,yLabels:a})})},Io=x(bo)` 314 .row > div { 315 width: calc(100% / 8); 316 } 317`,ko=new Set([A.THIS_WEEK,A.LAST_WEEK,A.THIS_MONTH,A.LAST_MONTH,A.THIS_QUARTER,A.LAST_QUARTER]),wo=new Set([A.LAST_MONTH]),{isFetching:Ze,isSuccess:bt,hasData:Je,isInitialized:Co}=La;let mi;function Eo(e){const{isLoading:t,timePeriod:n,isUnitMode:a,allSelectorsHaveValue:r,hasSurveyGroups:s,selectedSurveyGroup:o,selectedSurveyGroupIsActive:d,category:c,intl:l,isLoadingAutoUpdate:h,quickView:m}=e,{summarizedData:g,openFeedbackData:p,highlightsData:f,highlightsComparisonData:b,painpointsData:E,painpointsComparisonData:j}=m,{indexType:w,keyFindings:q,distribution:z,targetIndex:Q,ranking:Y,hourlyPattern:Ge,weekdayPattern:pt,results:$e,resultsFallback:mt,openFeedbackData:Be,highlightData:Ie,painpointData:De,isAiSummaryAvailable:Ke}=he(),X=t&&!h,se=!d&&!!s,Ne=(p.data&&p.data.length>0||An(Ie)||An(De))&&!X,y=ko.has(n.id),_=wo.has(n.id),L=!a,v=g?.data?.indexType===dn.NPSOfficial,G=wi()/4,Z=!Co(g),re=!r||!Z?S.Filters.selectLocation:s?S.Filters.error:S.Filters.noSurveys,[ke,we]=F.useState(void 0),[Ce,Re]=F.useState(!1),oe=Qa(e)??e;F.useEffect(()=>(!o&&c.id!==Ea?e.fetchSurveyGroups(c.id,!0,e.surveyGroupId,location.hash):e.initialize(e)&&(J(),e.startDataPollingLoop(e)),Mn.putUserPreference(e.userId,ja,Aa.location.pathname),()=>{Pa(),et(),e.clearQuickViewData()}),[]),F.useEffect(()=>{e.allSelectorsHaveValue&&!oe.allSelectorsHaveValue&&e.quickView.summarizedData.state===Ta&&(J(),e.fetchWidgetData(e),e.startDataPollingLoop(e))},[e.allSelectorsHaveValue]),F.useEffect(()=>{const P=To(oe,e);P&&e.allSelectorsHaveValue?(J(),e.fetchWidgetData(e),et(),e.startDataPollingLoop(e)):P&&!e.allSelectorsHaveValue&&(et(),e.clearQuickViewData())},[e.category.id,e.surveyGroupId,e.timePeriod.id,e.comparePeriod]),F.useEffect(()=>{_o(oe,e)&&(et(),e.startDataPollingLoop(e))},[e.autoUpdateIntervalInMilliseconds]),F.useEffect(()=>{e.appDataLoaded&&!Ce&&(_a("QuickView page viewed",{categoryId:e.category.id.toString(),surveyGroupId:e.surveyGroupId.toString(),timePeriod:e.timePeriod.id}),Re(!0))},[e.appDataLoaded]),F.useEffect(()=>{e.isPrintMode?document.body.classList.add("print"):document.body.classList.remove("print")},[e.isPrintMode]);function J(){const P=l.formatMessage({id:S.SideMenu.quickView});Fa(P,e.filterValuesAsText,l)}function he(){const P=Je(g)?{indexType:g.data.indexType,keyFindings:g.data.keyFindings,distribution:g.data.distribution,targetIndex:g.data.targetIndex,ranking:g.data.ranking||[],hourlyPattern:g.data.hourlyPattern||[],weekdayPattern:g.data.weekdayPattern||[],results:g.data.results||[],resultsFallback:g.data.resultsFallback||[],isAiSummaryAvailable:g.data.isSummaryAvailable}:{indexType:dn.Happy,ranking:[],hourlyPattern:[],weekdayPattern:[],results:[],resultsFallback:[],isAiSummaryAvailable:void 0},k=Je(p)?{openFeedbackData:p.data}:{openFeedbackData:[]},ee=Je(f)?{highlightData:f.data}:{highlightData:[]},$=Je(E)?{painpointData:E.data}:{painpointData:[]};return{...P,...k,...ee,...$}}return i.jsxs(Da,{customNotificationsScopeId:Na,className:e.className,children:[i.jsx(Ka,{timePeriods:Ra,showCompareFilter:!0,showTimeLabels:!0,showExports:!1}),r&&Z?i.jsxs(Oa,{children:[i.jsx(ar,{categoryName:c.name,timePeriod:n,loading:X,surveyInactive:se,data:{keyFindings:q,distribution:z,targetIndex:Q},indexType:w,breakPointWidths:{sm:Ne?R.HALF:R.FULL,xs:R.FULL},setHeight:P=>we(P)}),Ne&&i.jsx(no,{openFeedbackData:Be,highlightData:Ie,painpointData:De,comparisonPainpointData:j.data,comparisonHighlightData:b.data,isLoading:X,breakPointWidths:{sm:R.HALF,xs:R.FULL},surveyInactive:se,maxHeight:ke||450,significanceEnabled:e.significanceEnabled,isAiSummaryAvailable:Ke}),i.jsx(Fs,{dataDefault:$e,dataFallback:mt,surveyInactive:se,chartMode:Wa.ChartAbsolute,fullWidth:a,indexType:w,isLoading:X,breakPointWidths:a?{xs:R.FULL}:{sm:R.HALF,xs:R.FULL}}),L&&i.jsx(js,{rankingData:Y,isLoading:X,surveyInactive:se,timePeriod:n.id,breakPointWidths:{sm:R.HALF,xs:R.FULL}}),y&&i.jsx(bs,{hourlyPatternData:Ge,indexType:w,loading:X,surveyInactive:se,breakPointWidths:{sm:R.HALF,xs:R.FULL}}),_&&i.jsx(Io,{selectedTimePeriod:{start:n.startDate,endInclusive:n.endDate},weekdayPatternData:pt,indexType:w,loading:X,formatDate:l.formatDate,surveyInactive:se,breakPointWidths:{sm:R.HALF,xs:R.FULL}})]}):i.jsx(H,{sx:{mt:`${G}px`,p:2},children:i.jsx(I,{variant:"h5",color:"textSecondary",align:"center",children:i.jsx(T,{id:re})})}),v&&i.jsx(za,{})]})}function jo(e){const t=Dn(e),{surveyGroup:n,timePeriod:a,comparePerio
317d:r,printMode:s}=t,o=ma(e.authenticatedUser.request.data,ga.AUTO_UPDATE_INTERVAL_IN_SECONDS),d=t.precision!==void 0||!fa(a)&&a!==xa;return{filterValuesAsText:Ba(e),quickView:e.quickView,category:{id:t.getAvailableCategoryID(e.tree.selectedCategory),name:e.tree.selectedCategory?e.tree.selectedCategory.name:""},selectedSurveyGroup:e.surveyGroups.selectedSurveyGroup,surveyGroupId:t.getAvailableSurveyGroupID(e.surveyGroups.selectedSurveyGroup),surveyGroupIndustry:e.surveyGroups.selectedSurveyGroup?e.surveyGroups.selectedSurveyGroup.industry:void 0,historyNeedsUpdate:d,timePeriod:{id:Ca(a,Ua),startDate:t.startDate,endDate:t.endDate},comparePeriod:ka(a,r,wa.PreviousPeriod),allSelectorsHaveValue:t.quickViewSelectorsHaveValue(e),isUnitMode:Fo(e),hasSurveyGroups:bt(e.surveyGroups.all)&&e.surveyGroups.all.data.length>0,selectedSurveyGroupIsActive:ba(e.surveyGroups,n,Ia(a).toDate()),isLoading:Ze(e.quickView.summarizedData)||Ze(e.quickView.openFeedbackData)||Ze(e.quickView.highlightsData)||Ze(e.quickView.painpointsData)||!bt(e.tree.request)||!bt(e.surveyGroups.all),isLoadingAutoUpdate:e.quickView.isLoadingAutoUpdate,appDataLoaded:e.authenticatedUser.appDataLoaded,isPrintMode:s,userId:e.authenticatedUser.request.data.id,autoUpdateIntervalInMilliseconds:Sa(o),isAutoUpdateEnabled:va(o),significanceEnabled:ya(e.authenticatedUser.request.data,Rt.FollowUpSignificanceIndicator)}}const Ao={initializeQuickView:pa,fetchQuickViewData:ha,clearQuickViewData:ua,fetchSurveyGroups:la},Po=(e,t)=>{function n(a,r){t.fetchQuickViewData(a.category.id,a.surveyGroupId,a.timePeriod.id,a.comparePeriod,a.significanceEnabled,r)}return{...e,initialize:a=>{const r=a.allSelectorsHaveValue;return r&&n(a,!1),t.initializeQuickView(a.category.id,a.surveyGroupId,a.timePeriod.id,a.historyNeedsUpdate),r},startDataPollingLoop:a=>{a.isAutoUpdateEnabled&&a.allSelectorsHaveValue&&(mi=setInterval(()=>n(a,!0),a.autoUpdateIntervalInMilliseconds))},clearQuickViewData:t.clearQuickViewData,fetchSurveyGroups:t.fetchSurveyGroups,fetchWidgetData:a=>n(a,!1)}};function To(e,t){return e.category.id!==t.category.id||e.surveyGroupId!==t.surveyGroupId||e.timePeriod.id!==t.timePeriod.id||e.comparePeriod!==t.comparePeriod}function _o(e,t){return e.autoUpdateIntervalInMilliseconds!==t.autoUpdateIntervalInMilliseconds}function Fo(e){const t=e.quickView.summarizedData.data;return e.tree.isUnitMode?!0:t&&t.ranking?t.ranking.length<=1:Do(e.tree.selectedCategory)}function An(e){return e.some(t=>t.results.some(n=>n.feedbacks.values.some(a=>a>0)))}function Do(e){if(!e)return!1;let t=[e],n=0;for(;t.length>0&&n<=1;){const a=t.pop();a.children.length===0?n=n+1:t=t.concat(a.children)}return n===1}function et(){clearInterval(mi)}const No=ut(jo,Ao,Po)(Nt(Eo)),jd=e=>i.jsx($a,{component:No,...e});export{jd as default};
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.