import{L as v,cu as f,cz as h,cA as u,h as d,cB as x,cC as T,M as g}from"./app-k0jcl5PQ.js";import{V as l}from"./CKctgafI.chunk.js";const S="share.shareLinkInfo",e=v.encloseNamespace(S),y={getPrivateIconAndText:n=>{const{entityTypeId:r,privacy:a,hasStudentExp:t,entity:o,yearGroups:i}=n;if(r===g.Topic||r===g.Series)return{icon:l,text:e(t?"justMySchoolTeachers":"justMySchoolDescription")};if(!Array.isArray(a))switch(a.privacy){case"public":return{icon:l,text:e("publicDescription")};case"protected":return a.overrideRestrictions?{icon:l,text:e("clickViewOnly")}:{icon:u,text:y.getRespectRatingText(o,i,t)};case"just_my_customer":return a.overrideRestrictions?{icon:u,text:e(t?"justMySchoolTeachers":"justMySchoolDescription")}:{icon:u,text:y.getRespectRatingText(o,i,t)};case"restricted":case"private":return{icon:u,text:e("privateDescription")};default:return{}}},getIconAndText:n=>{const{linkExpireDate:r,isPasswordProtected:a,status:t}=n;if(!r&&!a)return y.getPrivateIconAndText(n);if(!r)return{icon:u,text:e("password")};const o=d.isToday(r),i=d.diffBetween(r,new Date,"day");if(!a){let p=o?e("expiryToday"):e("expiry",{days:i});return t===x.Expired&&(p=e("expired")),{icon:T,text:p}}let s=o?e("passwordExpiryToday"):e("passwordExpiry",{days:i});return t===x.Expired&&(s=e("passwordExpired")),{icon:u,text:s}},getRespectRatingText(n,r,a){var p;if(!n||!r)return null;if(a)return e("justMySchoolTeachers");if(!f.isVideoType(n))return e("collectionRating");const t=h.getWeightedRestriction((p=n._restrictions)==null?void 0:p.value);if(t&&!t.yearGroup)return e("onlyAdmins");const o=f.getRating(n);let i,s;for(const c of r)(!i||c.value>i.value)&&(i=c),!(t&&c.value<=t.yearGroup)&&(o&&c.rating.value<o.value||(!s||c.value<s.value)&&(s=c));return s?r.length===1?e("clickViewOnly"):s.value===i.value?e("maxYearGroup",{yearGroup:i.name}):e("yearGroupRange",{yearGroup:s.name}):e("onlyStaff")}};export{y as S};
//# sourceMappingURL=ChcDeudC.chunk.js.map
