(window.webpackJsonp=window.webpackJsonp||[]).push([["kMzt"],{zAHC:function(e,t,r){"use strict";var n=r("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.userIsCoachOrParent=t.default=t.STANDARD_DESCRIPTION_QUERY=void 0;var l=r("mR6N"),o=n(r("lTCR")),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=C(t);if(r&&r.has(e))return r.get(e);var n={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=l?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}n.default=e,r&&r.set(e,n);return n}(r("q1tI")),a=r("sExA"),i=n(r("Pwnf")),d=r("Vxy9"),c=n(r("SGU3")),p=n(r("Q8Wn")),u=r("8r+/"),h=n(r("ety3")),f=r("ZpD3"),m=n(r("hWmx")),k=n(r("cfQQ"));let y;function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(C=function(e){return e?r:t})(e)}const S=e=>{const t=e.map((e=>e.code)).filter((e=>/[a-z]$/.test(e))).map((e=>e.slice(0,-1)));return e.filter((e=>!t.includes(e.code)))};const g=e=>!!e&&(e.get("hasChildStudents")||e.get("hasStudents"));t.userIsCoachOrParent=g;const w=(0,u.gqlOp)((0,o.default)(y||(y=(e=>e)`
        query getDescriptionForStandard($setId: String!, $standardId: String!) {
            publishedStandard(setId: $setId, standardId: $standardId) {
                id
                description
            }
        }
    `)));t.STANDARD_DESCRIPTION_QUERY=w;const b=e=>s.createElement(m.default,{content:s.createElement(d.Body,{style:[v.description,e.small&&v.small]},s.createElement("span",{dangerouslySetInnerHTML:{__html:e.tooltip}})),side:"bottom",offset:12},s.createElement("span",{className:(0,l.css)(v.tooltipChild)},e.child));class D extends s.Component{constructor(...e){super(...e),this.renderDescriptionTooltip=e=>{const{standard:t,small:r}=this.props;return t.descriptionHtml?s.createElement(b,{tooltip:t.descriptionHtml,small:r,child:e}):s.createElement(h.default,{query:w,variables:{setId:t.set.id,standardId:t.code},curriculum:p.default.curriculum},(t=>!t.loading&&!t.error&&t.data&&t.data.publishedStandard&&t.data.publishedStandard.description?s.createElement(b,{tooltip:t.data.publishedStandard.description,small:r,child:e}):e))}}render(){const{standard:e,small:t,linkColor:r,showDescription:n}=this.props,o=e.code.replace(/-/g,"‑"),a=e.link||function(e){if("CCSS.Math"!==e.set.id)return null;const t=e.code.split(".");let r="";return t.length<2?"/commoncore/map":(t.length>=4&&(t.length=4,r="#"+t.join(".")),t[0].startsWith("HS")?`/commoncore/grade-${t[0]}-${t[0][t[0].length-1]}-${t[1]}${r.replace(".","-")}`:`/commoncore/grade-${t[0]}-${t[1]}${r}`)}(e),d=a?s.createElement(c.default,{style:[r!==i.default.white&&v.linkColorBlue,r===i.default.white&&v.linkColorWhite,v.link,t&&v.small],href:a,target:"_blank",safeWithNav:()=>(0,f.markMinorConversions)([{id:"standard_click",extra:{code:e.code}}])},o):s.createElement("span",{className:(0,l.css)(t&&v.small)},o);return n?this.renderDescriptionTooltip(d):d}}class E extends s.Component{constructor(...e){super(...e),this.renderStandard=e=>{const{standards:t,showSetPrefix:r,small:n,linkColor:l}=this.props,o=(c=e=>e.set.prefix,t.reduce(((e,t)=>{const r=c(t);return(e[r]=e[r]||[]).push(t),e}),{}));var c;const p=(0,a.keys)(o);for(const e of p)e.startsWith("Common Core")&&(o[e]=S(o[e]));return s.createElement("div",null,p.map(((t,a)=>s.createElement(d.Body,{key:t,style:[v.set,n&&v.small,l===i.default.white&&v.linkColorWhite]},r&&`${t}: `,o[t].map(((r,a)=>s.createElement("span",{key:r.code},s.createElement(D,{standard:r,small:null!=n&&n,linkColor:l,showDescription:e}),a!==o[t].length-1&&", "))),a!==p.length-1&&" "))))}}render(){const{showDescriptionsForLearners:e,profile:t}=this.props,r=!!g(t)||!!e;return this.renderStandard(r)}}E.defaultProps={showSetPrefix:!0,small:!1,linkColor:i.default.blue,showDescriptionsForLearners:!0};const v=l.StyleSheet.create({description:{display:"block",maxWidth:360},tooltipChild:{display:"inline-block"},linkColorBlue:{color:i.default.blue},linkColorWhite:{color:i.default.white},link:{textDecoration:"none",":hover":{textDecoration:"underline"}},set:{display:"block"},small:{fontSize:12,lineHeight:"14px"}});var I=(0,k.default)(E);t.default=I}}]);
//# sourceMappingURL=../../sourcemaps/en/kMzt.cd81c1ef00806551a5a2.js.map