import{j as g,aw as vt,d1 as nt,d2 as Ct,r as q,aM as Nt,q as xt,af as At,s as yt,cb as Ut,an as Et,cU as Mt,aZ as wt,d3 as $t,c$ as bt,d0 as Z,d4 as _t,aB as Rt,x as Ht,d5 as Bt,aC as Lt,B as Dt,d6 as Wt}from"./index-BbiZcFRx.js";import{A as qt,P as Ft,R as Vt}from"./index-CdgVLRmz.js";import{F as Qt,C as Yt}from"./index-UjTYR_nl.js";import{a as Gt,B as Kt}from"./index-D40-0sj6.js";import{T as Xt}from"./index-BVq_teg5.js";import"./index-C-uYT597.js";import"./index-DQ6MvdSO.js";import"./getRequestCallBackUrl-CNSCnRZg.js";const Jt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAABi8KSDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACCSURBVHgBrY7LDYMwEER3nSgVpICUEiqJGwg4FaSEpAQ6oRTgzMfckMD2YIkLQiCQ4J12tW9WQ3QEq8NvV73V0u06FwGWVoiAtj6aOkpbrR5rDo9i9ANIOuc+DGSrcl+oJ1+Q+LnxyYa26EolfQVAhy/aw+kBMV1u938My4ExIl+SBzR1RzC/48kVAAAAAElFTkSuQmCC",Zt="_backToPage_17hvn_88",te="_image_17hvn_97",st={backToPage:Zt,image:te},ee=({className:n,text:l,url:a=""})=>g.jsx("div",{className:n,children:g.jsxs("a",{href:a,className:st.backToPage,children:[g.jsx("img",{className:st.image,alt:"back arrow",src:Jt}),l]})}),re="_articleDetailBanner_w8p2w_88",ne="_image_w8p2w_95",ie="_backToPage_w8p2w_99",lt={articleDetailBanner:re,image:ne,backToPage:ie},ae=({id:n})=>g.jsx("div",{className:lt.articleDetailBanner,id:n,onClick:()=>vt(nt),children:g.jsx(ee,{className:lt.backToPage,text:"Back to All Articles",url:Ct})}),oe="_pageHeading_wtak2_88",se={pageHeading:oe},le=({text:n,className:l=""})=>g.jsx("h2",{className:`${se.pageHeading} ${l}`,children:n}),ue="_articleCard_1wkpu_89",ce={articleCard:ue},fe=({className:n="",items:l=[]})=>{const a=q.useContext(Nt),u=xt(),[h,d]=q.useState(At("isPremiumContentEnabled")||a.isAuthenticated()),[v,w]=q.useState(null),[I,j]=q.useState(!1),P=y=>{j(!0),w(y)},$=()=>{j(!1),yt("isPremiumContentEnabled",!0),d(!0),Ut("premium_content_email_optin"),u.push(`/learning-center/${v.current}`)},L=y=>{var C,T,s,p;return(T=(C=y==null?void 0:y.slug)==null?void 0:C.current)!=null&&T.includes("/")?`/learning-center${(s=y==null?void 0:y.slug)==null?void 0:s.current}`:`/learning-center/${(p=y==null?void 0:y.slug)==null?void 0:p.current}`},H=y=>{var T,s;const C=(T=y==null?void 0:y.slug)!=null&&T.current?L(y):`/learning-center/${(s=y==null?void 0:y.title)==null?void 0:s.replace(" ","-")}`;u.push(C),Et()};if(!l.length)return null;const M=l.sort(()=>.5-Math.random()).slice(0,3);return g.jsxs(g.Fragment,{children:[g.jsx(qt,{cardClassName:ce.articleCard,className:n,items:M,onClick:H,onPremiumCardClick:P,hasPremiumAccess:h}),g.jsx(Ft,{isOpen:I,onClose:()=>j(!1),onSubmitSuccessfully:$})]})},he="_articleRecommendations_uic4c_88",de="_pageHeading_uic4c_96",ut={articleRecommendations:he,pageHeading:de},pe=({className:n="",items:l,articleType:a})=>g.jsxs("div",{className:`${ut.articleRecommendations} ${n}`,children:[g.jsx(le,{text:(a==null?void 0:a.toLowerCase())==="video"?"Continue":"Continue Reading",className:ut.pageHeading}),g.jsx(fe,{items:l})]}),me="_author_65zi9_88",ge="_heading5_65zi9_92",ve="_image_65zi9_102",et={author:me,heading5:ge,image:ve},xe=({className:n,image:l,name:a})=>{var h;const u=(h=l==null?void 0:l.asset)==null?void 0:h.url;return g.jsxs("div",{className:`${et.author} ${n}`,children:[g.jsx("img",{src:u,alt:"",className:et.image}),g.jsx(Mt,{className:et.heading5,text:a})]})};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var ct=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;function we(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function be(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var l={},a=0;a<10;a++)l["_"+String.fromCharCode(a)]=a;var u=Object.getOwnPropertyNames(l).map(function(d){return l[d]});if(u.join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(d){h[d]=d}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Y=be()?Object.assign:function(n,l){for(var a,u=we(n),h,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var v in a)Ae.call(a,v)&&(u[v]=a[v]);if(ct){h=ct(a);for(var w=0;w<h.length;w++)ye.call(a,h[w])&&(u[h[w]]=a[h[w]])}}return u},_e="https://docs.sanity.io/help/",Ie=function(l){return _e+l},It={exports:{}};(function(n,l){(function(a,u){n.exports=u()})(wt,function(){function a(){return a=Object.assign||function(o){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(o[e]=r[e])}return o},a.apply(this,arguments)}function u(o,t){if(o){if(typeof o=="string")return h(o,t);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(o,t)}}function h(o,t){(t==null||t>o.length)&&(t=o.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=o[r];return e}function d(o){var t=0;if(typeof Symbol>"u"||o[Symbol.iterator]==null){if(Array.isArray(o)||(o=u(o)))return function(){return t>=o.length?{done:!0}:{done:!1,value:o[t++]}};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return t=o[Symbol.iterator](),t.next.bind(t)}var v="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";function w(o){var t=o.split("-"),r=t[1],e=t[2],i=t[3];if(!r||!e||!i)throw new Error("Malformed asset _ref '"+o+`'. Expected an id like "`+v+'".');var f=e.split("x"),c=f[0],x=f[1],O=+c,S=+x,m=isFinite(O)&&isFinite(S);if(!m)throw new Error("Malformed asset _ref '"+o+`'. Expected an id like "`+v+'".');return{id:r,width:O,height:S,format:i}}var I=function(t){var r=t;return r?typeof r._ref=="string":!1},j=function(t){var r=t;return r?typeof r._id=="string":!1},P=function(t){var r=t;return r&&r.asset?typeof r.asset.url=="string":!1};function $(o){if(!o)return null;var t;if(typeof o=="string"&&L(o))t={asset:{_ref:H(o)}};else if(typeof o=="string")t={asset:{_ref:o}};else if(I(o))t={asset:o};else if(j(o))t={asset:{_ref:o._id||""}};else if(P(o))t={asset:{_ref:H(o.asset.url)}};else if(typeof o.asset=="object")t=o;else return null;var r=o;return r.crop&&(t.crop=r.crop),r.hotspot&&(t.hotspot=r.hotspot),M(t)}function L(o){return/^https?:\/\//.test(""+o)}function H(o){var t=o.split("/").slice(-1);return("image-"+t[0]).replace(/\.([a-z]+)$/,"-$1")}function M(o){if(o.crop&&o.hotspot)return o;var t=a({},o);return t.crop||(t.crop={left:0,top:0,bottom:0,right:0}),t.hotspot||(t.hotspot={x:.5,y:.5,height:1,width:1}),t}var y=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"]];function C(o){var t=a({},o||{}),r=t.source;delete t.source;var e=$(r);if(!e)return null;var i=e.asset._ref||e.asset._id||"",f=w(i),c=Math.round(e.crop.left*f.width),x=Math.round(e.crop.top*f.height),O={left:c,top:x,width:Math.round(f.width-e.crop.right*f.width-c),height:Math.round(f.height-e.crop.bottom*f.height-x)},S=e.hotspot.height*f.height/2,m=e.hotspot.width*f.width/2,A=e.hotspot.x*f.width,N=e.hotspot.y*f.height,k={left:A-m,top:N-S,right:A+m,bottom:N+S};return t.rect||t.focalPoint||t.ignoreImageParams||t.crop||(t=a(a({},t),s({crop:O,hotspot:k},t))),T(a(a({},t),{},{asset:f}))}function T(o){var t=o.baseUrl||"https://cdn.sanity.io",r=o.asset.id+"-"+o.asset.width+"x"+o.asset.height+"."+o.asset.format,e=t+"/images/"+o.projectId+"/"+o.dataset+"/"+r,i=[];if(o.rect){var f=o.rect,c=f.left,x=f.top,O=f.width,S=f.height,m=c!==0||x!==0||S!==o.asset.height||O!==o.asset.width;m&&i.push("rect="+c+","+x+","+O+","+S)}o.bg&&i.push("bg="+o.bg),o.focalPoint&&(i.push("fp-x="+o.focalPoint.x),i.push("fp-y="+o.focalPoint.y));var A=[o.flipHorizontal&&"h",o.flipVertical&&"v"].filter(Boolean).join("");return A&&i.push("flip="+A),y.forEach(function(N){var k=N[0],z=N[1];typeof o[k]<"u"?i.push(z+"="+encodeURIComponent(o[k])):typeof o[z]<"u"&&i.push(z+"="+encodeURIComponent(o[z]))}),i.length===0?e:e+"?"+i.join("&")}function s(o,t){var r,e=t.width,i=t.height;if(!(e&&i))return{width:e,height:i,rect:o.crop};var f=o.crop,c=o.hotspot,x=e/i,O=f.width/f.height;if(O>x){var S=f.height,m=S*x,A=f.top,N=(c.right-c.left)/2+c.left,k=N-m/2;k<f.left?k=f.left:k+m>f.left+f.width&&(k=f.left+f.width-m),r={left:Math.round(k),top:Math.round(A),width:Math.round(m),height:Math.round(S)}}else{var z=f.width,V=z/x,F=f.left,tt=(c.bottom-c.top)/2+c.top,Q=tt-V/2;Q<f.top?Q=f.top:Q+V>f.top+f.height&&(Q=f.top+f.height-V),r={left:Math.max(0,Math.floor(F)),top:Math.max(0,Math.floor(Q)),width:Math.round(z),height:Math.round(V)}}return{width:e,height:i,rect:r}}var p=["clip","crop","fill","fillmax","max","scale","min"],b=["top","bottom","left","right","center","focalpoint","entropy"],_=["format"];function U(o){return o?typeof o.clientConfig=="object":!1}function R(o){for(var t=y,r=d(t),e;!(e=r()).done;){var i=e.value,f=i[0],c=i[1];if(o===f||o===c)return f}return o}function B(o){var t=o;if(U(t)){var r=t.clientConfig,e=r.apiHost,i=r.projectId,f=r.dataset,c=e||"https://api.sanity.io";return new D(null,{baseUrl:c.replace(/^https:\/\/api\./,"https://cdn."),projectId:i,dataset:f})}return new D(null,o)}var D=function(){function o(r,e){this.options=r?a(a({},r.options||{}),e||{}):a({},e||{})}var t=o.prototype;return t.withOptions=function(e){var i=e.baseUrl||this.options.baseUrl,f={baseUrl:i};for(var c in e)if(e.hasOwnProperty(c)){var x=R(c);f[x]=e[c]}return new o(this,a({baseUrl:i},f))},t.image=function(e){return this.withOptions({source:e})},t.dataset=function(e){return this.withOptions({dataset:e})},t.projectId=function(e){return this.withOptions({projectId:e})},t.bg=function(e){return this.withOptions({bg:e})},t.dpr=function(e){return this.withOptions({dpr:e})},t.width=function(e){return this.withOptions({width:e})},t.height=function(e){return this.withOptions({height:e})},t.focalPoint=function(e,i){return this.withOptions({focalPoint:{x:e,y:i}})},t.maxWidth=function(e){return this.withOptions({maxWidth:e})},t.minWidth=function(e){return this.withOptions({minWidth:e})},t.maxHeight=function(e){return this.withOptions({maxHeight:e})},t.minHeight=function(e){return this.withOptions({minHeight:e})},t.size=function(e,i){return this.withOptions({width:e,height:i})},t.blur=function(e){return this.withOptions({blur:e})},t.sharpen=function(e){return this.withOptions({sharpen:e})},t.rect=function(e,i,f,c){return this.withOptions({rect:{left:e,top:i,width:f,height:c}})},t.format=function(e){return this.withOptions({format:e})},t.invert=function(e){return this.withOptions({invert:e})},t.orientation=function(e){return this.withOptions({orientation:e})},t.quality=function(e){return this.withOptions({quality:e})},t.forceDownload=function(e){return this.withOptions({download:e})},t.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},t.flipVertical=function(){return this.withOptions({flipVertical:!0})},t.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},t.fit=function(e){if(p.indexOf(e)===-1)throw new Error('Invalid fit mode "'+e+'"');return this.withOptions({fit:e})},t.crop=function(e){if(b.indexOf(e)===-1)throw new Error('Invalid crop mode "'+e+'"');return this.withOptions({crop:e})},t.saturation=function(e){return this.withOptions({saturation:e})},t.auto=function(e){if(_.indexOf(e)===-1)throw new Error('Invalid auto mode "'+e+'"');return this.withOptions({auto:e})},t.pad=function(e){return this.withOptions({pad:e})},t.url=function(){return C(this.options)},t.toString=function(){return this.url()},o}();return B})})(It);var Oe=It.exports,Se=Ie,je=Oe,Te=Y,ft=encodeURIComponent,ke="You must either:\n  - Pass `projectId` and `dataset` to the block renderer\n  - Materialize images to include the `url` field.\n\nFor more information, see ".concat(Se("block-content-image-materializing")),Pe=function(l){var a=l.imageOptions,u=Object.keys(a);if(!u.length)return"";var h=u.map(function(d){return"".concat(ft(d),"=").concat(ft(a[d]))});return"?".concat(h.join("&"))},ze=function(l){var a=l.node,u=l.options,h=u.projectId,d=u.dataset,v=a.asset;if(!v)throw new Error("Image does not have required `asset` property");if(v.url)return v.url+Pe(u);if(!h||!d)throw new Error(ke);var w=v._ref;if(!w)throw new Error("Invalid image reference in block, no `_ref` found on `asset`");return je(Te({projectId:h,dataset:d},u.imageOptions||{})).image(a).toString()},Ot=ze,Ce=Y,Ne=Ot,Ue=function(n,l){var a=l||{useDashedStyles:!1};function u(s){var p=s.node,b=s.serializers,_=s.options,U=s.isInline,R=s.children,B=p._type,D=b.types[B];if(!D){if(_.ignoreUnknownTypes)return console.warn('Unknown block type "'.concat(B,'", please specify a serializer for it in the `serializers.types` prop')),n(b.unknownType,{node:p,options:_,isInline:U},R);throw new Error('Unknown block type "'.concat(B,'", please specify a serializer for it in the `serializers.types` prop'))}return n(D,{node:p,options:_,isInline:U},R)}function h(s){var p=s.node,b=p.mark,_=p.children,U=typeof b=="string",R=U?b:b._type,B=s.serializers.marks[R];return B?n(B,s.node,_):(console.warn('Unknown mark type "'.concat(R,'", please specify a serializer for it in the `serializers.marks` prop')),n(s.serializers.unknownMark,null,_))}function d(s){var p=s.type==="bullet"?"ul":"ol";return n(p,null,s.children)}function v(s){var p=!s.node.style||s.node.style==="normal"?s.children:n(s.serializers.types.block,s,s.children);return n("li",null,p)}function w(s){return n("div",{style:{display:"none"}},'Unknown block type "'.concat(s.node._type,'", please specify a serializer for it in the `serializers.types` prop'))}function I(s){var p=s.node.style||"normal";return/^h\d/.test(p)?n(p,null,s.children):n(p==="blockquote"?"blockquote":"p",null,s.children)}function j(s,p){return n(s,null,p.children)}function P(s){var p=a.useDashedStyles?{"text-decoration":"underline"}:{textDecoration:"underline"};return n("span",{style:p},s.children)}function $(s){return n("del",null,s.children)}function L(s){return n("a",{href:s.mark.href},s.children)}function H(s){if(!s.node.asset)return null;var p=n("img",{src:Ne(s)});return s.isInline?p:n("figure",null,p)}function M(s,p,b,_){if(s===`
`&&p.hardBreak)return n(p.hardBreak,{key:"hb-".concat(b)});if(typeof s=="string")return p.text?n(p.text,{key:"text-".concat(b)},s):s;var U;s.children&&(U={children:s.children.map(function(B,D){return _.serializeNode(B,D,s.children,!0)})});var R=Ce({},s,U);return n(p.span,{key:s._key||"span-".concat(b),node:R,serializers:p})}var y=function(){return n("br")},C={strong:j.bind(null,"strong"),em:j.bind(null,"em"),code:j.bind(null,"code"),underline:P,"strike-through":$,link:L},T={types:{block:I,image:H},marks:C,list:d,listItem:v,block:u,span:h,hardBreak:y,unknownType:w,unknownMark:"span",container:"div",text:void 0,empty:""};return{defaultSerializers:T,serializeSpan:M}},ht=["strong","em","code","underline","strike-through"],Ee=function(l){var a=l.children,u=l.markDefs;if(!a||!a.length)return[];var h=a.map(Me),d={_type:"span",children:[]},v=[d];return a.forEach(function(w,I){var j=h[I];if(!j){var P=v[v.length-1];P.children.push(w);return}var $=1;if(v.length>1)for($;$<v.length;$++){var L=v[$].markKey,H=j.indexOf(L);if(H===-1)break;j.splice(H,1)}v=v.slice(0,$);var M=He(v);if(j.forEach(function(T){var s={_type:"span",_key:w._key,children:[],mark:u.find(function(p){return p._key===T})||T,markKey:T};M.children.push(s),v.push(s),M=s}),Re(w)){for(var y=w.text.split(`
`),C=y.length;C-- >1;)y.splice(C,0,`
`);M.children=M.children.concat(y)}else M.children=M.children.concat(w)}),d.children};function Me(n,l,a){if(!n.marks||n.marks.length===0)return n.marks||[];var u=n.marks.reduce(function(d,v){d[v]=d[v]?d[v]+1:1;for(var w=l+1;w<a.length;w++){var I=a[w];if(I.marks&&Array.isArray(I.marks)&&I.marks.indexOf(v)!==-1)d[v]++;else break}return d},{}),h=$e.bind(null,u);return n.marks.slice().sort(h)}function $e(n,l,a){var u=n[l]||0,h=n[a]||0;if(u!==h)return h-u;var d=ht.indexOf(l),v=ht.indexOf(a);return d!==v?d-v:l<a?-1:l>a?1:0}function Re(n){return n._type==="span"&&typeof n.text=="string"&&(Array.isArray(n.marks)||typeof n.marks>"u")}function He(n){for(var l=n.length-1;l>=0;l--){var a=n[l];if(a._type==="span"&&a.children)return a}}var Be=Ee,Le=Y;function De(n){for(var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"html",a=[],u,h=0;h<n.length;h++){var d=n[h];if(!We(d)){a.push(d),u=null;continue}if(!u){u=X(d),a.push(u);continue}if(qe(d,u)){u.children.push(d);continue}if(d.level>u.level){var v=X(d);if(l==="html"){var w=St(u),I=Le({},w,{children:w.children.concat(v)});u.children[u.children.length-1]=I}else u.children.push(v);u=v;continue}if(d.level<u.level){var j=it(a[a.length-1],d);if(j){u=j,u.children.push(d);continue}u=X(d),a.push(u);continue}if(d.listItem!==u.listItem){var P=it(a[a.length-1],{level:d.level});if(P&&P.listItem===d.listItem){u=P,u.children.push(d);continue}else{u=X(d),a.push(u);continue}}console.warn("Unknown state encountered for block",d),a.push(d)}return a}function We(n){return!!n.listItem}function qe(n,l){return n.level===l.level&&n.listItem===l.listItem}function X(n){return{_type:"list",_key:"".concat(n._key,"-parent"),level:n.level,listItem:n.listItem,children:[n]}}function St(n){return n.children&&n.children[n.children.length-1]}function it(n,l){var a=typeof l.listItem=="string";if(n._type==="list"&&n.level===l.level&&a&&n.listItem===l.listItem)return n;var u=St(n);return u?it(u,l):!1}var Fe=De,Ve=Y,Qe=function(n){return n.map(function(l){return l._key?l:Ve({_key:Ye(l)},l)})};function Ye(n){return Ge(JSON.stringify(n)).toString(36).replace(/[^A-Za-z0-9]/g,"")}function Ge(n){var l=0,a=n.length;if(a===0)return l;for(var u=0;u<a;u++)l=(l<<5)-l+n.charCodeAt(u),l&=l;return l}function J(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?J=function(a){return typeof a}:J=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},J(n)}var Ke=Y,Xe=function(l){return typeof l<"u"},jt=function(l,a){return Object.keys(l).reduce(function(u,h){var d=J(l[h]);return d==="function"?u[h]=Xe(a[h])?a[h]:l[h]:d==="object"?u[h]=Ke({},l[h],a[h]):u[h]=typeof a[h]>"u"?l[h]:a[h],u},{})},Je=Y,dt=Be,Ze=Fe,tr=Qe,er=jt,rr=["projectId","dataset","imageOptions","ignoreUnknownTypes"],nr=function(l){return typeof l<"u"},ir={imageOptions:{},ignoreUnknownTypes:!0};function ar(n,l,a,u){var h=Je({},ir,l),d=Array.isArray(h.blocks)?h.blocks:[h.blocks],v=tr(d),w=Ze(v,h.listNestMode),I=er(a,h.serializers||{}),j=rr.reduce(function(s,p){var b=h[p];return nr(b)&&(s[p]=b),s},{});function P(s,p,b,_){return or(s)?M(s):pt(s)?H(s,$(s,b)):sr(s)?u(s,I,p,{serializeNode:P}):L(s,p,_)}function $(s,p){for(var b=0,_=0;_<p.length;_++){if(p[_]===s)return b;pt(p[_])&&b++}return b}function L(s,p,b){var _=dt(s),U=_.map(function(B,D,o){return P(B,D,o,!0)}),R={key:s._key||"block-".concat(p),node:s,isInline:b,serializers:I,options:j};return n(I.block,R,U)}function H(s,p){var b=s._key,_=dt(s),U=_.map(P);return n(I.listItem,{node:s,serializers:I,index:p,key:b,options:j},U)}function M(s){var p=s.listItem,b=s.level,_=s._key,U=s.children.map(P);return n(I.list,{key:_,level:b,type:p,options:j},U)}var y=!!h.renderContainerOnSingleChild,C=w.map(P);if(y||C.length>1){var T=h.className?{className:h.className}:{};return n(I.container,T,C)}return C[0]?C[0]:typeof I.empty=="function"?n(I.empty):I.empty}function or(n){return n._type==="list"&&n.listItem}function pt(n){return n._type==="block"&&n.listItem}function sr(n){return typeof n=="string"||n.marks||n._type==="span"}var lr=ar,mt=Ue,gt=lr,ur=Ot,cr=jt,fr={blocksToNodes:function(l,a,u,h){if(u)return gt(l,a,u,h);var d=mt(l);return gt(l,a,d.defaultSerializers,d.serializeSpan)},getSerializers:mt,getImageUrl:ur,mergeSerializers:cr},Tt=fr,hr=q,dr=Tt,pr=dr.getSerializers,mr=hr.createElement,kt=pr(mr),gr=kt.defaultSerializers,vr=kt.serializeSpan,xr={serializeSpan:vr,serializers:gr,renderProps:{nestMarks:!0}},Ar=q,E=$t,at=Tt,ot=xr,Pt=ot.serializers,yr=ot.serializeSpan,wr=ot.renderProps,br=at.getImageUrl,_r=at.blocksToNodes,Ir=at.mergeSerializers,Or=Ar.createElement,K=function n(l){var a=Ir(n.defaultSerializers,l.serializers),u=Object.assign({},wr,l,{serializers:a,blocks:l.blocks||[]});return _r(Or,u,Pt,yr)};K.defaultSerializers=Pt;K.getImageUrl=br;K.propTypes={className:E.string,renderContainerOnSingleChild:E.bool,ignoreUnknownTypes:E.bool,projectId:E.string,dataset:E.string,imageOptions:E.object,serializers:E.shape({types:E.object,marks:E.object,list:E.func,listItem:E.func,block:E.func,span:E.func}),blocks:E.oneOfType([E.arrayOf(E.shape({_type:E.string.isRequired})),E.shape({_type:E.string.isRequired})]).isRequired};K.defaultProps={ignoreUnknownTypes:!0,renderContainerOnSingleChild:!1,serializers:{},imageOptions:{}};var Sr=K;const jr=bt(Sr),Tr="_portableTextBulletList_1xen5_88",kr={portableTextBulletList:Tr},Pr=({children:n})=>g.jsx(Gt,{className:kr.portableTextBulletList,children:n}),zr=({children:n})=>g.jsx(Kt,{children:n}),Cr="_portableTextEm_11bd7_88",Nr={portableTextEm:Cr},Ur=({children:n})=>g.jsx("em",{className:Nr.portableTextEm,children:n}),Er="_portableTextHeading2_4keh0_88",Mr={portableTextHeading2:Er},$r=({children:n})=>g.jsx("h2",{className:Mr.portableTextHeading2,children:n}),Rr="_portableTextHeading3_1szcz_88",Hr={portableTextHeading3:Rr},Br=({children:n})=>g.jsx("h3",{className:Hr.portableTextHeading3,children:n});var zt={exports:{}};(function(n,l){(function(a,u){n.exports=u()})(wt,function(){function a(){return a=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},a.apply(this,arguments)}function u(t,r){if(t){if(typeof t=="string")return h(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return h(t,r)}}function h(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,i=new Array(r);e<r;e++)i[e]=t[e];return i}function d(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=u(t))||r){e&&(t=e);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var v="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";function w(t){var r=t.split("-"),e=r[1],i=r[2],f=r[3];if(!e||!i||!f)throw new Error("Malformed asset _ref '"+t+`'. Expected an id like "`+v+'".');var c=i.split("x"),x=c[0],O=c[1],S=+x,m=+O,A=isFinite(S)&&isFinite(m);if(!A)throw new Error("Malformed asset _ref '"+t+`'. Expected an id like "`+v+'".');return{id:e,width:S,height:m,format:f}}var I=function(r){var e=r;return e?typeof e._ref=="string":!1},j=function(r){var e=r;return e?typeof e._id=="string":!1},P=function(r){var e=r;return e&&e.asset?typeof e.asset.url=="string":!1};function $(t){if(!t)return null;var r;if(typeof t=="string"&&L(t))r={asset:{_ref:H(t)}};else if(typeof t=="string")r={asset:{_ref:t}};else if(I(t))r={asset:t};else if(j(t))r={asset:{_ref:t._id||""}};else if(P(t))r={asset:{_ref:H(t.asset.url)}};else if(typeof t.asset=="object")r=a({},t);else return null;var e=t;return e.crop&&(r.crop=e.crop),e.hotspot&&(r.hotspot=e.hotspot),M(r)}function L(t){return/^https?:\/\//.test(""+t)}function H(t){var r=t.split("/").slice(-1);return("image-"+r[0]).replace(/\.([a-z]+)$/,"-$1")}function M(t){if(t.crop&&t.hotspot)return t;var r=a({},t);return r.crop||(r.crop={left:0,top:0,bottom:0,right:0}),r.hotspot||(r.hotspot={x:.5,y:.5,height:1,width:1}),r}var y=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"],["frame","frame"]];function C(t){var r=a({},t||{}),e=r.source;delete r.source;var i=$(e);if(!i)throw new Error("Unable to resolve image URL from source ("+JSON.stringify(e)+")");var f=i.asset._ref||i.asset._id||"",c=w(f),x=Math.round(i.crop.left*c.width),O=Math.round(i.crop.top*c.height),S={left:x,top:O,width:Math.round(c.width-i.crop.right*c.width-x),height:Math.round(c.height-i.crop.bottom*c.height-O)},m=i.hotspot.height*c.height/2,A=i.hotspot.width*c.width/2,N=i.hotspot.x*c.width,k=i.hotspot.y*c.height,z={left:N-A,top:k-m,right:N+A,bottom:k+m};return r.rect||r.focalPoint||r.ignoreImageParams||r.crop||(r=a({},r,s({crop:S,hotspot:z},r))),T(a({},r,{asset:c}))}function T(t){var r=(t.baseUrl||"https://cdn.sanity.io").replace(/\/+$/,""),e=t.vanityName?"/"+t.vanityName:"",i=t.asset.id+"-"+t.asset.width+"x"+t.asset.height+"."+t.asset.format+e,f=r+"/images/"+t.projectId+"/"+t.dataset+"/"+i,c=[];if(t.rect){var x=t.rect,O=x.left,S=x.top,m=x.width,A=x.height,N=O!==0||S!==0||A!==t.asset.height||m!==t.asset.width;N&&c.push("rect="+O+","+S+","+m+","+A)}t.bg&&c.push("bg="+t.bg),t.focalPoint&&(c.push("fp-x="+t.focalPoint.x),c.push("fp-y="+t.focalPoint.y));var k=[t.flipHorizontal&&"h",t.flipVertical&&"v"].filter(Boolean).join("");return k&&c.push("flip="+k),y.forEach(function(z){var V=z[0],F=z[1];typeof t[V]<"u"?c.push(F+"="+encodeURIComponent(t[V])):typeof t[F]<"u"&&c.push(F+"="+encodeURIComponent(t[F]))}),c.length===0?f:f+"?"+c.join("&")}function s(t,r){var e,i=r.width,f=r.height;if(!(i&&f))return{width:i,height:f,rect:t.crop};var c=t.crop,x=t.hotspot,O=i/f,S=c.width/c.height;if(S>O){var m=Math.round(c.height),A=Math.round(m*O),N=Math.max(0,Math.round(c.top)),k=Math.round((x.right-x.left)/2+x.left),z=Math.max(0,Math.round(k-A/2));z<c.left?z=c.left:z+A>c.left+c.width&&(z=c.left+c.width-A),e={left:z,top:N,width:A,height:m}}else{var V=c.width,F=Math.round(V/O),tt=Math.max(0,Math.round(c.left)),Q=Math.round((x.bottom-x.top)/2+x.top),G=Math.max(0,Math.round(Q-F/2));G<c.top?G=c.top:G+F>c.top+c.height&&(G=c.top+c.height-F),e={left:tt,top:G,width:V,height:F}}return{width:i,height:f,rect:e}}var p=["clip","crop","fill","fillmax","max","scale","min"],b=["top","bottom","left","right","center","focalpoint","entropy"],_=["format"];function U(t){return t&&"config"in t?typeof t.config=="function":!1}function R(t){return t&&"clientConfig"in t?typeof t.clientConfig=="object":!1}function B(t){for(var r=y,e=d(r),i;!(i=e()).done;){var f=i.value,c=f[0],x=f[1];if(t===c||t===x)return c}return t}function D(t){if(U(t)){var r=t.config(),e=r.apiHost,i=r.projectId,f=r.dataset,c=e||"https://api.sanity.io";return new o(null,{baseUrl:c.replace(/^https:\/\/api\./,"https://cdn."),projectId:i,dataset:f})}if(R(t)){var x=t.clientConfig,O=x.apiHost,S=x.projectId,m=x.dataset,A=O||"https://api.sanity.io";return new o(null,{baseUrl:A.replace(/^https:\/\/api\./,"https://cdn."),projectId:S,dataset:m})}return new o(null,t||{})}var o=function(){function t(e,i){this.options=void 0,this.options=e?a({},e.options||{},i||{}):a({},i||{})}var r=t.prototype;return r.withOptions=function(i){var f=i.baseUrl||this.options.baseUrl,c={baseUrl:f};for(var x in i)if(i.hasOwnProperty(x)){var O=B(x);c[O]=i[x]}return new t(this,a({baseUrl:f},c))},r.image=function(i){return this.withOptions({source:i})},r.dataset=function(i){return this.withOptions({dataset:i})},r.projectId=function(i){return this.withOptions({projectId:i})},r.bg=function(i){return this.withOptions({bg:i})},r.dpr=function(i){return this.withOptions(i&&i!==1?{dpr:i}:{})},r.width=function(i){return this.withOptions({width:i})},r.height=function(i){return this.withOptions({height:i})},r.focalPoint=function(i,f){return this.withOptions({focalPoint:{x:i,y:f}})},r.maxWidth=function(i){return this.withOptions({maxWidth:i})},r.minWidth=function(i){return this.withOptions({minWidth:i})},r.maxHeight=function(i){return this.withOptions({maxHeight:i})},r.minHeight=function(i){return this.withOptions({minHeight:i})},r.size=function(i,f){return this.withOptions({width:i,height:f})},r.blur=function(i){return this.withOptions({blur:i})},r.sharpen=function(i){return this.withOptions({sharpen:i})},r.rect=function(i,f,c,x){return this.withOptions({rect:{left:i,top:f,width:c,height:x}})},r.format=function(i){return this.withOptions({format:i})},r.invert=function(i){return this.withOptions({invert:i})},r.orientation=function(i){return this.withOptions({orientation:i})},r.quality=function(i){return this.withOptions({quality:i})},r.forceDownload=function(i){return this.withOptions({download:i})},r.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},r.flipVertical=function(){return this.withOptions({flipVertical:!0})},r.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},r.fit=function(i){if(p.indexOf(i)===-1)throw new Error('Invalid fit mode "'+i+'"');return this.withOptions({fit:i})},r.crop=function(i){if(b.indexOf(i)===-1)throw new Error('Invalid crop mode "'+i+'"');return this.withOptions({crop:i})},r.saturation=function(i){return this.withOptions({saturation:i})},r.auto=function(i){if(_.indexOf(i)===-1)throw new Error('Invalid auto mode "'+i+'"');return this.withOptions({auto:i})},r.pad=function(i){return this.withOptions({pad:i})},r.vanityName=function(i){return this.withOptions({vanityName:i})},r.frame=function(i){if(i!==1)throw new Error('Invalid frame value "'+i+'"');return this.withOptions({frame:i})},r.url=function(){return C(this.options)},r.toString=function(){return this.url()},t}();return D})})(zt);var Lr=zt.exports;const Dr=bt(Lr),Wr=Dr(Z);function qr(n){return Wr.image(n)}const Fr="_caption_10mk3_88",Vr="_image_10mk3_99",Qr="_portableTextImage_10mk3_103",rt={caption:Fr,image:Vr,portableTextImage:Qr},Yr=({node:n})=>{const{alt:l,asset:a,caption:u}=n;return g.jsxs("div",{className:rt.portableTextImage,children:[g.jsx("img",{className:rt.image,src:qr(a),alt:l}),g.jsx("span",{className:rt.caption,children:u})]})},Gr="_portableTextNumberList_12pu3_88",Kr={portableTextNumberList:Gr},Xr=({children:n})=>g.jsx("ol",{className:Kr.portableTextNumberList,children:n}),Jr="_portableTextNumberListItem_1kejp_88",Zr={portableTextNumberListItem:Jr},tn=({children:n})=>g.jsx("li",{className:Zr.portableTextNumberListItem,children:n}),en="_portableTextParagraph_1t7v4_88",rn={portableTextParagraph:en},nn=({children:n})=>g.jsx("p",{className:rn.portableTextParagraph,children:n}),an={list:n=>n.type==="bullet"?Pr(n):Xr(n),listItem:n=>n.node.listItem==="bullet"?zr(n):tn(n),marks:{em:Ur},types:{block:n=>{const{node:l}=n,{style:a}=l;return a==="h2"?$r(n):a==="h3"?Br(n):nn(n)},image:Yr}},on="_portableText_x7sag_88",sn={portableText:on},ln=({data:n})=>n?g.jsx(jr,{blocks:n,className:sn.portableText,client:Z,serializers:an}):null,un=()=>Z.fetch([`*[ _type == "articles"][0..7]{
            ...,
            tags[]->,
            mainImage{
                ...,
                asset->{
                    url
                }
            }
        }`]),cn=n=>()=>Z.fetch([`*[ _type == "articles" && slug.current == "${n}"]{
            ...,
            mainImage{
                ...,
                asset->{
                    url
                }
            },
            author->{
                  ...,
                  image{
                    asset->{
                        url
                    }
                }
            },
            tags[]->,
            ctaItems[]->{
                ...,
                mainImage{
                   asset->{
                       url
                   }
                }
            },
            articleVideo{
              ...,
              asset->{
                  url
              }
            },
            articleThumbnail {
              ...,
              asset->{
                  url
              }
            },
            guideDocument{
                ...,
                asset->{
                    url
                }
            },
            guideDocumentPurl{
                   ...,
                   asset->{
                       url
                 }
            }
        }`]),fn=n=>_t(cn(n),[]),hn=_t(un,[]),dn="_author_dgsf7_88",pn="_contentContainer_dgsf7_92",mn="_articleRecommendations_dgsf7_98",gn="_video_dgsf7_104",vn="_downloadWrapper_dgsf7_108",xn="_downloadButton_dgsf7_112",An="_content_dgsf7_92",yn="_ctaItems_dgsf7_124",wn="_featureTitle_dgsf7_130",bn="_image_dgsf7_134",_n="_videoPlayerContainer_dgsf7_139",In="_meta_dgsf7_143",On="_tagItems_dgsf7_147",W={author:dn,contentContainer:pn,articleRecommendations:mn,video:gn,downloadWrapper:vn,downloadButton:xn,content:An,ctaItems:yn,featureTitle:wn,image:bn,videoPlayerContainer:_n,meta:In,tagItems:On},Un=({match:n})=>{var f,c,x,O,S;const[l,a]=q.useState({}),[u,h]=q.useState([]),{contentId:d}=q.useContext(Rt),v=xt(),w=Ht(),I=n.params.articleName;q.useEffect(()=>{(async()=>{const A=await(await fn(I))();A!=null&&A.length&&(a(A[0]),w(Bt(A[0].productType||"medicare")))})()},[I]),q.useEffect(()=>{(async()=>{const m=await hn();m&&h(m)})()},[]);const{author:j={},ctaItems:P=[],individualResource:$,mainImage:L={},metaDescription:H="",metaTitle:M="",tags:y,title:C,articleVideo:T,articleThumbnail:s={},articleType:p,guideDocument:b,guideDocumentPurl:_}=l,{alt:U,asset:R}=L||{},B=R==null?void 0:R.url,{image:D,name:o}=j,t=m=>{var A,N,k,z;return(N=(A=m==null?void 0:m.slug)==null?void 0:A.current)!=null&&N.includes("/")?`/learning-center${(k=m==null?void 0:m.slug)==null?void 0:k.current}`:`/learning-center/${(z=m==null?void 0:m.slug)==null?void 0:z.current}`},r=m=>{var N,k;const A=(N=m==null?void 0:m.slug)!=null&&N.current?t(m):`/learning-center/${(k=m==null?void 0:m.title)==null?void 0:k.replace(" ","-")}`;v.push(A)},e=()=>{var m,A;if((m=s==null?void 0:s.asset)!=null&&m.url)return(A=s==null?void 0:s.asset)==null?void 0:A.url},i=()=>{var m;At(Wt,"")&&((m=_==null?void 0:_.asset)!=null&&m.url)?window.open(`${_.asset.url}?dl`):window.open(`${b.asset.url}?dl`)};return q.useEffect(()=>(yt(nt,!0),()=>{vt(nt)}),[]),g.jsxs(g.Fragment,{children:[g.jsx(Lt,{description:H,title:M}),g.jsx(ae,{id:d}),g.jsxs("div",{className:W.contentContainer,children:[g.jsx(Qt,{className:W.featureTitle,text:C}),g.jsxs("div",{className:W.meta,children:[g.jsx(xe,{className:W.author,image:D,name:o}),g.jsx(Xt,{className:W.tagItems,items:y,onClick:r})]}),g.jsxs("div",{className:W.content,children:[(p==null?void 0:p.toLowerCase())==="video"?(O=(x=(c=(f=T==null?void 0:T.asset)==null?void 0:f.url)==null?void 0:c.toString())==null?void 0:x.trim())!=null&&O.length?g.jsx("div",{className:W.videoPlayerContainer,children:g.jsx(Vt,{className:W.video,controls:!0,height:"360px",light:e(),playing:!0,playsinline:!0,url:((S=T==null?void 0:T.asset)==null?void 0:S.url)||"",volume:1,width:"100%"})}):null:g.jsx("img",{className:W.image,src:B,alt:U}),(p==null?void 0:p.toLowerCase())==="guide"&&g.jsx("div",{className:W.downloadWrapper,children:g.jsx(Dt,{onClick:i,label:"Download",className:W.downloadButton})}),g.jsx(ln,{data:$})]}),g.jsx(Yt,{className:W.ctaItems,items:P})]}),g.jsx(pe,{className:W.articleRecommendations,items:u,articleType:p})]})};export{Un as default};
//# sourceMappingURL=index-c1L1nAJh.js.map