import{ao as n,eZ as x,e_ as g,ba as d,a_ as m,aI as u,c8 as o,de as w,p as h,L as j,by as k}from"./app-k0jcl5PQ.js";import{W as C}from"./CBiwFpxE.chunk.js";const f="_widgetTextButton_em1zx_1",t={widgetTextButton:f},N="shared.widgetHeader",i=j.encloseNamespace(N);function l(e){return n.jsx("div",{className:`ms-3 ${t.widgetTextButton}`,children:n.jsx(d,{appLink:e.appLink,analyticsData:e.analyticsData,analyticsOptions:{location:h.SlidingList,...e.analyticsOptions,descriptor:w.SeeMore},className:`text-decoration-none ${e.appLink?"curated-widget-link":""}`,children:n.jsx("p",{className:"hover-text-underline text-dark curated-widget-heading",children:i("seeAll")})})})}function v(e){return n.jsx("div",{className:`ms-3 ${t.widgetTextButton} text-decoration-none cursor-pointer`,onClick:e.onClose,children:n.jsx("p",{className:"hover-text-underline text-dark curated-widget-heading",children:i("hide")})})}function F(e){return n.jsx("div",{className:`ms-3 ${t.widgetTextButton} text-decoration-none`,children:e.showFollowSpinner?n.jsx(k,{as:"span",animation:"border",role:"status",size:"sm"}):n.jsx("p",{className:"hover-text-underline text-dark curated-widget-heading cursor-pointer",onClick:()=>e.onFollow(!e.isFollowing),children:i(e.isFollowing?"unfollow":"follow")})})}function S(e){var s;const a=!!e.description;if(!e.name&&!e.description)return n.jsx(n.Fragment,{});const c=x.isBelowContentMinimum(e.content,e.widgetTypeId),r=((s=g[e.widgetTypeId])==null?void 0:s.minContent)??0;return n.jsxs("div",{className:"curated-widget-header",children:[n.jsxs("div",{className:"d-flex justify-content-between",children:[!!e.name&&n.jsxs("div",{className:"d-flex align-items-center",children:[n.jsx(d,{appLink:e.appLink,analyticsData:e.analyticsData,className:`text-decoration-none ${e.appLink?"curated-widget-link text-reset":""}`,onClick:e.onAppLinkClick,children:n.jsxs("h2",{className:"h4 curated-widget-heading",children:[e.isPreviewing&&c&&n.jsx(m,{svg:C,title:`Widget is below the minimum content threshold of ${r} and won't be displayed.`,tooltipSpanHack:!0,tooltipSpanHackClassName:"d-inline text-danger me-1"}),e.name]})}),!!u.isValidElement(e.badgeComponent)&&e.badgeComponent]}),n.jsxs("div",{className:"d-flex justify-content-between align-items-center gap-2",children:[!!e.appLink&&!a&&!!e.showSeeMoreLink&&n.jsx(l,{...e}),o.isFunction(e.onFollow)&&n.jsx(F,{isFollowing:e.isFollowing,onFollow:e.onFollow,showFollowSpinner:e.showFollowSpinner}),o.isFunction(e.onClose)&&n.jsx(v,{onClose:e.onClose})]})]}),a&&n.jsxs("div",{className:"d-flex justify-content-between align-items-end",children:[n.jsx("p",{className:"description curated-widget-description",children:n.jsx("span",{children:e.description})}),!!e.appLink&&!!e.showSeeMoreLink&&n.jsx(l,{...e})]})]})}export{S as W};
//# sourceMappingURL=DdN4NAtQ.chunk.js.map
