A kid sits at a laptop and smiles. He's surrounded by stars and a crescent moon.
Photo illustration by Slate. Photo by Getty Images Plus.

Care and Feeding is Slate’s parenting advice column. In addition to our traditional advice, every Thursday we feature an assortment of teachers from across the country answering your education questions. Have a question for our teachers? Email [email protected] or post it in the Slate Parenting Facebook group.

How do I teach my preteen son to be more proactive and not procrastinate? He’s recently had a few really late nights finishing up projects that he’d known about for a while (we did not know about them because we try not to be helicopter-ish), and the assignments wound up not being of great quality due to the lack of time he spent on them. Once we found out about the projects, my husband and I took turns sitting next to him reading a book just to be a presence and help him focus when he started to get distracted. He still ended up with good grades this semester, thankfully.

I’d love to start the next semester giving him some tools to use to create better homework habits. Currently we let him “chill” for a bit when he gets home to give his brain a break, but then we expect him to do his chores and start on homework before we get home from work.

–Dragging Feet

Dear Dragging,

It sounds like your son is in middle school or thereabouts. Starting around sixth grade, it’s common for assignments to get longer and more complex, or be completed in multiple stages with independent components. Completing tasks like these helps kids start to build and flex the executive functioning skills that are necessary for success in high school and beyond, but it’s a demanding new learning curve for sure, and it sounds like your son would benefit from some support right now. I think it’s admirable you don’t want to micromanage him, but it’s also not helicopter-ish to meet a demonstrated need. So while you don’t need to suddenly dial up the coaching and supervision to 11, I do think you need to get a bit more hands-on than you have been.

The unfortunate news is that there’s no perfect system or bulletproof strategy that I know of to immediately improve tweenage time management and procrastination. It’s a long-term learning process that requires multiple passes and, usually, a few failures to grasp. The good news is that your son’s procrastination sounds garden-variety, not chronic or severe. (If it were, I’d note that you should consider an evaluation for ADHD.) You also don’t describe any resistance or pushback from him, just poor time management that could use a tune-up. So I think you and he are already primed to succeed.

I’d start with getting him a planner and showing him how to use it. This often seems intuitive to adults; it is not at all to preteens. Middle schoolers need to be explicitly directed to write down each of their classes and list the assignments and due dates for each one, and to repeat this process every day. And then, make it your business to keep checking in. Take a look at the planner, ask about his classes and the material they’re covering, and chat with him about the concept of backward planning (both in terms of structuring his after-school time to avoid late nights and of not falling behind on longer-term projects). I’d try to frame the planner as a helpful tool and keep your conversations positive; you don’t want him to feel punished, and middle schoolers generally have a hair trigger for feeling oppressed by their parents, so use a light touch. I think you’re going for a happy medium between “totally hands-off” and “totally in his business” (or managing the tasks for him).

Then … you just see how it goes. Hopefully he’ll get a few strategies under his belt and demonstrate that he can keep himself on track, and you can dial back your involvement. If not, you (and possibly his teachers) might have to make another game plan. Procrastination is a very normal and understandable impulse, though, and one of the correctives is experiencing its natural consequences. He’ll either get the hang of it right away, or he won’t, but either way, he’ll learn something.

—Ms. Bauer (middle and high school teacher, New York)

Slate is looking to interview parents and children together—young parents and older ones, younger kids and adult children—for an upcoming project. To participate, send us an email at pandem[email protected] with a few words about your family.

My oldest child been a high-ability learner since he was under a year old. Now he is in first grade and testing in the top 98 percent of the state in math and reading. My husband grew up on a farm, and we have the opportunity to move close to family and build our dream home on over 50 acres of land. In many ways I know this will have a positive impact on my children, as they can help grandparents with farm chores and be close to cousins, and I truly believe nature is a nature stress reliever for my intelligent and anxious child.

The concern I have—and can’t seem to get a clear answer on the potential impact of—is the small-town public school. The school ratings show the students testing and performing below grade level, and I am concerned about the impact on my gifted student’s experience and education. I reached out to the school and they are working on making improvements, but there is no offering for gifted students or AP programs in high school. We tried private school for kindergarten, but the environment was too restrictive, and my child is also showing gender tendencies that may not be accepted in a religious school. In fact, I’m worried they may not be accepted in this small-town school either, for that matter. How important is school for a student’s success, particularly if parents are very involved too?

—Farm Life Calls?

Dear Farm Life,

This is such a difficult question for me to answer. As a teacher, of course I believe school is important! Conventional wisdom dictates that a quality education is paramount to adult success. Yet there are those who argue that socioeconomic status is actually more predictive of adult success than school ratings. (I should add that I am skeptical of school ratings in general; I believe they paint an incomplete picture.) I am honestly not qualified to parse out the competing data and give you a definitive answer.

Here’s what I can tell you from experience: Some gifted children who are not academically challenged will be unhappy in school. They may act out, disengage, or develop a negative attitude toward school. On the other hand, some high-achieving children love being the smartest kid in the room and don’t mind when everything is too easy. You may find that the teachers in this small-town school will figure out ways to challenge your child despite the lack of gifted-and-talented programming; if not, you may have to do a lot of heavy lifting to get him the enrichment he needs. However, there may be creative solutions. I know some high schoolers in rural areas take AP courses online, for example.

As far as your child’s gender expression, I think that whether or not he will be accepted depends on this specific town’s culture. Some small-town communities embrace each member in all their individuality; others ostracize people who are different. (I say this as someone who grew up in a small town.) Of course, this same thing can happen in an urban neighborhood, but large cities offer more opportunities to find your people, so to speak. Your husband and his siblings should be able to give you a sense of how your child will be received.

I think the bigger question is this: Which is more important to your child’s immediate happiness, a school with advanced academic opportunities in your current community or close proximity to family and nature in your husband’s hometown? His happiness in childhood is the most important factor to making this decision, in my opinion.

Best of luck!

—Ms. Holbrook (high school teacher, Texas)

Slate needs your support right now. Sign up for Slate Plus to keep reading the advice you crave every week.

I’m a first-year librarian at a large private school for middle and high school students (grades 6–12). We’re meeting in person, but pandemic restrictions mean that few students are able to visit the library. To make up for that, I’ve been trying new ways to get books into my students’ hands, including holding pop-up libraries during their outdoor recess time. During my most recent one, I was chatting with the kids as they walked by, talking about books and movies they liked in order to make recommendations and asking if anyone had suggestions for new books they’d like us to order. As one seventh grade girl walked by, I asked her if she’d like to look at the selection of books I’d brought. She told me, “No, every book at our school is about racism,” and kept walking. I was at a loss as to how I should respond. I normally place a lot of focus on building relationships with my students, but this year has been odd. I don’t even know what their faces look like under their masks, and I rarely get to speak with them.  It’s true that our school is highly intentional about diversity and being anti-racist, and our library collection follows that conviction, but I try to maintain a collection with something that will appeal to every kid.

Where do I go from here? I mentioned the incident to a school counselor, but without knowing the girl’s name, I can’t reach out to her to try to connect with her. Should I just let it go?

—Frustrated Librarian

Dear Frustrated Librarian,

Let me first commend you for your creative approach to getting books in kids’ hands. The pop-up library is a great idea.

Regarding the girl’s comment, “Why do you think that is?” or “What would you like to read books about?” both would have been helpful responses, but that’s esprit de l’escalier—I probably would have been rendered mute in the moment too.

I think you’re right that it’s probably too late to connect specifically with this girl. Between your being new and the mask wearing, it sounds like it will be tough to seek her out. You can’t exactly go into every class and say, “Hey, was anyone in here that girl at recess with the flippant response about the societal evil we’re trying to address?”

But I do think this has given you an opportunity to address the issue with the student body. If that girl is thinking it, other students are too. As adults, we understand why being anti-racist is germane to present-day American citizenship, but I can imagine kids might not get it, in the same way kids dismiss their parents’ concerns because they haven’t lived their struggles. This girl, and the others who agree, probably don’t need another adult to tell them why it’s important. Kids this age are going to be more easily persuaded by peers. It seems like a perfect opportunity for a Socratic/Paideia seminar, in which the instructor poses a question, such as “Why does our school emphasize anti-racism?” and then takes a back-seat role while the kids engage in a discussion with one another.

You could tell the seventh grade English/language arts and social studies teachers about the incident and your quandary and ask if they’d be willing to facilitate or let you facilitate a seminar in their classes.

The other thing you may have been asking is about how to promote books so your collection doesn’t appear one-note to students. Again, this is a job you could take on yourself or for which you could enlist surrogates who might have more sway. Who are the kids who always have a book in their hands, who are widely read, who like to talk about books? Ask if they’ll be your helpers at these pop-ups; better yet, have them hold the pop-ups and you be the helper. Have them create a book-recs bulletin board. See if they’ll do book talks for your TikTok account.

During my second year of teaching, a colleague looked at the elaborate bulletin boards I’d created and said, “I never do anything I can get a student to do for me.” Over the last couple decades, that one small sentence has helped my students learn countless skills and saved me thousands of hours of work.

Take care.

—Ms. Scott (eighth grade teacher, North Carolina)

My 9-year-old grandson is not comprehending his assigned reading at school. When questions are asked on a test, he gets less than half of them correct. These are multiple-choice questions. He reads well. He has an incredible memory when he is told something that he’s interested in. He does well in all other subjects. What are your thoughts and recommendations?

—Reading Between the Lines

Dear Reading,

Assuming you are your grandson’s legal guardian, my first recommendation is to speak to your grandson’s teacher and ask for strategies that can be practiced at home. While I have some suggestions, let me say that without knowing more details about your grandson and his reading abilities, I can offer some generic advice but not the targeted advice that he might need.

First, a partnership with your grandson’s teacher is essential. It’s hard to know whether his issue is his ability to comprehend the syntax of the text or perhaps a need to expand his vocabulary or decode longer words. (Of course, if you’re not your grandson’s legal guardian, you’ll want to talk to your son or daughter about partnering with your grandson’s teacher.)

He may also be rushing through the text and not monitoring his own comprehensions. When this happens, readers don’t know to stop and reread sections that might have initially confused them, so they finish the text confused and unsure how to clear up that confusion.

He may also need some strategies to help him better approach multiple-choice questions. Kids need to learn to read each choice carefully, use process of elimination to reduce the number of choices they face, and recognize the small but critical differences between two answers. They also need to learn to slow down. Test designers try to make all of the choices on a multiple-choice test seem somewhat reasonable, often with parts of the correct answer in all four choices, so students often jump on the first answer that looks correct without considering all of the possibilities. Teaching students to read through all of the possibilities before answering can make a huge difference in terms of their scores. When you know what to look for, reading becomes a more targeted, strategic process.

When your grandson is reading at home, here are some things that you (and all parents of elementary students) can do to help improve comprehension.

Retelling: When your grandson is finished reading a text, ask him to retell what he has just read. Retelling is a great way to practice comprehension strategies and help him (and you) determine if he is failing to comprehend the text and missing large parts of the story.

Summarize: Ask your grandson to summarize the text in three or fewer sentences. When the economy of words becomes the goal, students often read more carefully, monitor their comprehension more closely, and think harder about the words passing through their mind.

Conversation: Engage in a conversation about the text with your grandson when he has finished reading by asking questions like, “What was the most interesting fact you read today?” or “What was the most interesting part of the story?” or “Why do you think X character made X decision?” or “What did you like least about that chapter?”

The goal is to train students to be asking themselves these questions as they read, because when readers move beyond just reading the words to thinking about the text as they read, comprehension increases and the likelihood that the reader will self-monitor comprehension, reread when necessary, and even stop and ask questions increases dramatically.

A colleague of mine used to say that she needs to transform readers from “word callers to word thinkers.” I always liked that way of thinking about reading. Our goal as teachers of reading (yourself included) is to make kids understand that decoding the text is less than half the battle, even though, in kindergarten and first grade, it’s almost all of the battle. As the saying goes, first, kids learn to read. Then kids read to learn.

That second part is where comprehension becomes paramount. By using some of the strategies I’ve listed, I think you can help your grandson make some progress.

—Mr. Dicks

More Advice From Slate

My daughter is finishing up the third grade. I know her teacher is just trying to get by right now, with distance learning and the end of school so near, but I’m disappointed that her class hasn’t taken the time to talk at all about George Floyd, police brutality, and racism in our country. What’s reasonable to expect from a teacher in terms of them talking to their students about racism?

')}function tryGetCriteoFastBid(){try{var fastBidStorageKey="criteo_fast_bid",hashPrefix="// Hash: ",fastBidFromStorage=storage.getDataFromLocalStorage(fastBidStorageKey),firstLineEndPosition,firstLine,publisherTagHash,publisherTag;null!==fastBidFromStorage&&(firstLineEndPosition=fastBidFromStorage.indexOf("n"),firstLine=fastBidFromStorage.substr(0,firstLineEndPosition).trim(),firstLine.substr(0,hashPrefix.length)!==hashPrefix?(__WEBPACK_IMPORTED_MODULE_4__src_utils_js__.logWarn("No hash found in FastBid"),storage.removeDataFromLocalStorage(fastBidStorageKey)):(publisherTagHash=firstLine.substr(hashPrefix.length),publisherTag=fastBidFromStorage.substr(firstLineEndPosition+1),Object(__WEBPACK_IMPORTED_MODULE_6_criteo_direct_rsa_validate_build_verify_js__.verify)(publisherTag,publisherTagHash,FAST_BID_PUBKEY_N,FAST_BID_PUBKEY_E)?(__WEBPACK_IMPORTED_MODULE_4__src_utils_js__.logInfo("Using Criteo FastBid"),eval(publisherTag)):(__WEBPACK_IMPORTED_MODULE_4__src_utils_js__.logWarn("Invalid Criteo FastBid found"),storage.removeDataFromLocalStorage(fastBidStorageKey))))}catch(e){}}Object(__WEBPACK_IMPORTED_MODULE_1__src_adapters_bidderFactory_js__.registerBidder)(spec)},377:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(378),i=r(379);t.verify=function(e,t,r,o){var a=new n.BigInteger(n.b64toHex(t)),s=new n.BigInteger(n.b64toHex(r)),c=a.modPowInt(o,s);return n.removeExtraSymbols(c.toHexString())===i.Sha256.hash(e)}},378:function(e,t,r){var n;Object.defineProperty(t,"__esModule",{value:!0});var i=(o.prototype.toHexString=function(){if(this.s<0)return"-"+this.negate().toHexString();var e,t=!1,r="",n=this.t,i=this.DB-n*this.DB%4;if(0>i)&&(t=!0,r=l(e));0<=n;)i<4?(e=(this[n]&(1<>(i+=this.DB-4)):(e=this[n]>>(i-=4)&15,i<=0&&(i+=this.DB,--n)),0this.DB?(this[this.t-1]|=(i&(1<>this.DB-n):this[this.t-1]|=i<=this.DB&&(n-=this.DB))}this.clamp(),r&&o.ZERO.subTo(this,this)}},o.prototype.negate=function(){var e=a();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&0>n|a,a=(this[s]&i)<=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}0>this.F2:0),m=this.FV/g,b=(1<=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;0>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:0>15;0<=--o;){var c=32767&this[e],d=this[e++]>>15,u=s*c+d*a;i=((c=a*c+((32767&u)<<15)+r[n]+(1073741823&i))>>>30)+(u>>>15)+s*d+(i>>>30),r[n++]=1073741823&c}return i},o.prototype.am3=function(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;0<=--o;){var c=16383&this[e],d=this[e++]>>14,u=s*c+d*a;i=((c=a*c+((16383&u)<<14)+r[n]+i)>>28)+(u>>14)+s*d,r[n++]=268435455&c}return i},o);function o(e){null!==e&&this.fromHexString(e)}function a(){return new i(null)}function s(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}t.BigInteger=i,t.nbi=a,t.nbits=s;for(var c=[],d="0".charCodeAt(0),u=0;u<=9;++u)c[d++]=u;for(d="a".charCodeAt(0),u=10;u<36;++u)c[d++]=u;for(d="A".charCodeAt(0),u=10;u<36;++u)c[d++]=u;function p(e,t){var r=c[e.charCodeAt(t)];return null==r?-1:r}t.intAt=p;var f="0123456789abcdefghijklmnopqrstuvwxyz";function l(e){return f.charAt(e)}t.int2char=l,t.b64toHex=function(e){for(var t="",r=0,n=0,i=0;i>2),n=3&o,1):1==r?(t+=l(n<<2|o>>4),n=15&o,2):2==r?(t+=l(n),t+=l(o>>2),n=3&o,3):(t+=l(n<<2|o>>4),t+=l(15&o),0))}return 1==r&&(t+=l(n<<2)),t},t.removeExtraSymbols=function(e){return e.replace(/^1f+00/,"").replace("3031300d060960864801650304020105000420"https://r.search.yahoo.com/,"")};var g=(m.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},m.prototype.revert=function(e){return e},m.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m);function m(e){this.m=e}var b=(v.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&0>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v);function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>>0;for(a[o-1][14]=Math.floor(d),a[o-1][15]=u,s=0;s>>0;var l=r[0],g=r[1],m=r[2],b=r[3],v=r[4],y=r[5],h=r[6],_=r[7];for(f=0;f<64;f++){var S=_+i.z1(v)+i.Ch(v,y,h)+t[f]+p[f],I=i.z0(l)+i.Maj(l,g,m);_=h,h=y,y=v,v=b+S>>>0,b=m,m=g,g=l,l=S+I>>>0}r[0]=r[0]+l>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+v>>>0,r[5]=r[5]+y>>>0,r[6]=r[6]+h>>>0,r[7]=r[7]+_>>>0}var A=new Array(r.length);for(_=0;_>>e|t<<32-e},i.z0=function(e){return i.ROTR(2,e)^i.ROTR(13,e)^i.ROTR(22,e)},i.z1=function(e){return i.ROTR(6,e)^i.ROTR(11,e)^i.ROTR(25,e)},i.q0=function(e){return i.ROTR(7,e)^i.ROTR(18,e)^e>>>3},i.q1=function(e){return i.ROTR(17,e)^i.ROTR(19,e)^e>>>10},i.Ch=function(e,t,r){return e&t^~e&r},i.Maj=function(e,t,r){return e&t^e&r^t&r},i);function i(){}t.Sha256=n}},[375]),pbjsChunk([218],{501:function(e,t,r){e.exports=r(502)},502:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),r.d(t,"spec",function(){return A});var n=r(0),i=r(2),o=r(3),a=r(10),s=r.n(a),c=r(503),d=r.n(c),u=r(1);function p(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rnnnx3c!-- Rubicon Project Ad Tag --x3en


nn")),c=d(m[i.size_id].split("x").map(function(e){return Number(e)}),2),s.width=c[0],s.height=c[1]),s.rubiconTargeting=(Array.isArray(i.targeting)?i.targeting:[]).reduce(function(e,t){return e[t.key]=t.values[0],e},{rpfl_elemid:f.adUnitCode}),t.push(s)):n.logError("Rubicon: bidRequest undefined at index position:".concat(o),r,e),t},[]).sort(function(e,t){return(t.cpm||0)-(e.cpm||0)})},getUserSyncs:function(e,t,r,n){if(!x&&e.iframeEnabled){var i="";return r&&"string"==typeof r.consentString&&("boolean"==typeof r.gdprApplies?i+="?gdpr=".concat(Number(r.gdprApplies),"&gdpr_consent=").concat(r.consentString):i+="?gdpr_consent=".concat(r.consentString)),n&&(i+="".concat(i?"&":"?"https://r.search.yahoo.com/,"us_privacy=").concat(encodeURIComponent(n))),x=!0,{type:"iframe",url:"https://".concat(g.syncHost||"eus"https://r.search.yahoo.com/,".rubiconproject.com/usync.html")+i}}},transformBidParams:function(e){return n.convertTypes({accountId:"number",siteId:"number",zoneId:"number"},e)}};function v(e,t){var r=o.b.getConfig("pageUrl");r=e.params.referrer?e.params.referrer:r||t.refererInfo.referer;return e.params.secure?r.replace(/^http:/i,"https:"):r}function y(e,t){var r=e.params;if("video"===t){var i=[];return r.video&&r.video.playerWidth&&r.video.playerHeight?i=[r.video.playerWidth,r.video.playerHeight]:Array.isArray(n.deepAccess(e,"mediaTypes.video.playerSize"))&&1===e.mediaTypes.video.playerSize.length?i=e.mediaTypes.video.playerSize[0]:Array.isArray(e.sizes)&&0e.length)&&(t=e.length);for(var r=0,n=new Array(t);r‘;var i,o}},h=function(e){var t=0=e&&t.innerWidth‘+v.vast_url+”“:v.vast_string&&(y=v.vast_string),g.pre_market_bids.push({id:v.deal_id,seatbid:[{bid:[{impid:Date.now(),dealid:v.deal_id,price:v.price,adm:y}]}],cur:v.currency,ext:{event_log:[{}]}})}}var h=n.getBidIdParameter(“mimes”,e.params)||[“application/javascript”https://r.search.yahoo.com/,”video/mp4″https://r.search.yahoo.com/,”video/webm”],_={id:e.bidId,secure:l,video:{w:p,h:f,ext:g,mimes:h}};””!=n.getBidIdParameter(“price_floor”,e.params)&&(_.bidfloor=n.getBidIdParameter(“price_floor”,e.params)),””!=n.getBidIdParameter(“start_delay”,e.params)&&(_.video.startdelay=0+Boolean(n.getBidIdParameter(“start_delay”,e.params))),””!=n.getBidIdParameter(“min_duration”,e.params)&&(_.video.minduration=n.getBidIdParameter(“min_duration”,e.params)),””!=n.getBidIdParameter(“max_duration”,e.params)&&(_.video.maxduration=n.getBidIdParameter(“max_duration”,e.params)),””!=n.getBidIdParameter(“placement_type”,e.params)&&(_.video.ext.placement=n.getBidIdParameter(“placement_type”,e.params)),””!=n.getBidIdParameter(“position”,e.params)&&(_.video.ext.pos=n.getBidIdParameter(“position”,e.params)),e.crumbs&&e.crumbs.pubcid&&(c=e.crumbs.pubcid);var S=navigator.language?”language”:”userLanguage”,I={id:s,imp:_,site:{id:””,page:a,content:”content”},device:{h:screen.height,w:screen.width,dnt:n.getDNT()?1:0,language:navigator[S].split(“-“)[0],make:navigator.vendor?navigator.vendor:””,ua:navigator.userAgent},ext:{wrap_response:1}};n.getBidIdParameter(“number_of_ads”,e.params)&&(I.ext.number_of_ads=n.getBidIdParameter(“number_of_ads”,e.params));var A={};return 1==n.getBidIdParameter(“spotx_all_google_consent”,e.params)&&(A.consented_providers_settings=u),t&&t.gdprConsent&&(A.consent=t.gdprConsent.consentString,void 0!==t.gdprConsent.gdprApplies&&n.deepSetValue(I,”regs.ext.gdpr”,t.gdprConsent.gdprApplies?1:0)),t&&t.uspConsent&&n.deepSetValue(I,”regs.ext.us_privacy”,t.uspConsent),n.deepAccess(e,”userId.id5id.uid”)&&(A.eids=A.eids||[],A.eids.push({source:”id5-sync.com”,uids:[{id:e.userId.id5id.uid}],ext:e.userId.id5id.ext||{}})),c&&(A.fpc=c),e&&e.schain&&(I.source={ext:{schain:e.schain}}),e&&e.userId&&e.userId.tdid&&(A.eids=A.eids||[],A.eids.push({source:”adserver.org”,uids:[{id:e.userId.tdid,ext:{rtiPartner:”TDID”}}]})),n.isEmpty(A)||(I.user={ext:A}),{method:”POST”,url:”https://search.spotxchange.com/openrtb/2.3/dados/”+s,data:I,bidRequest:t}})},interpretResponse:function(e,t){var r=[],i=e.body;return i&&n.isArray(i.seatbid)&&n._each(i.seatbid,function(e){n._each(e.bid,function(e){var a={};for(var c in t.bidRequest.bids)e.impid==t.bidRequest.bids[c].bidId&&(a=t.bidRequest.bids[c]);n._each(a.params.pre_market_bids,function(t){t.deal_id==e.id&&(e.price=t.price,i.cur=t.currency)});var d={requestId:a.bidId,currency:i.cur||”USD”,cpm:e.price,creativeId:e.crid||””,dealId:e.dealid||””,ttl:360,netRevenue:!0,channel_id:i.id,cache_key:e.ext.cache_key,vastUrl:”https://search.spotxchange.com/ad/vast.html?key=”+e.ext.cache_key,videoCacheKey:e.ext.cache_key,mediaType:s.d,width:e.w,height:e.h};d.meta=d.meta||{},e&&e.adomain&&0e.length)&&(t=e.length);for(var r=0,n=new Array(t);rt?e:t}function d(e,t,n){!e.preload&&e.preloadThreshhold&&function(e,t,n,i){return t.top<=i+n&&u(e)}(t.target,t.rect,e.preloadThreshhold,n)&&(e.preload=!0,setTimeout(function(){e.trigger("preload",new r("preload",t))},15))}function c(n){var i=n.el.getBoundingClientRect(),o=t.innerHeight||e.documentElement.clientHeight,h=f(i,o),s=h/(i.height||o),l={target:n.el,rect:i,visiblePx:h,visiblePercent:s};!function(e,t){var n=t.visiblePx,i=t.visiblePercent;n&&i>=e.shownThreshold&&!e.seen?(e.seen=!0,setTimeout(function(){e.trigger(“shown”,new r(“shown”,t))},15)):(!n||i1&&(h+=e(r,Math.floor(n/o),i-1,o)),h},this.getVerticallyVisiblePixels=f,this.getViewportHeight=function(){return t.innerHeight||e.documentElement.clientHeight||e.body.clientHeight},this.getViewportWidth=function(){return t.innerWidth||e.documentElement.clientWidth||e.body.clientWidth},this.isElementNotHidden=u,this.isElementInViewport=function(n){var i=n.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(t.innerHeight||e.documentElement.clientHeight)&&i.right<=(t.innerWidth||e.documentElement.clientWidth)},this.Visible=o}]); }, {}]; require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(“Invalid attempt to iterate non-iterable instance.nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.”); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === “string”) return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === “Object” && o.constructor) n = o.constructor.name; if (n === “Map” || n === “Set”) return Array.from(o); if (n === “Arguments” || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function mountLegacyServices() { Object.keys(window.modules).filter(function (key) { return typeof key === 'string' && key.match(/.legacy$/); }).forEach(function (key) { return window.require(key); }); } function tryToMount(fn, el, name) { try { fn(el); // init the controller } catch (e) { var elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML)); console.error("Error initializing controller for "".concat(name, "" on "").concat(elementTag, """), e); } } /** * mount client.js component controllers */ function mountComponentModules() { Object.keys(window.modules).filter(function (key) { return typeof key === 'string' && key.match(/.client$/); }).forEach(function (key) { var controllerFn = window.require(key); if (typeof controllerFn === 'function') { var name = key.replace('.client"https://r.search.yahoo.com/,"'), instancesSelector = "[data-uri*="_components/".concat(name, "/"]"), defaultSelector = "[data-uri$="_components".concat(name, ""]"), instances = document.querySelectorAll(instancesSelector), defaults = document.querySelectorAll(defaultSelector); var _iterator = _createForOfIteratorHelper(instances), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var el = _step.value; tryToMount(controllerFn, el, name); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } var _iterator2 = _createForOfIteratorHelper(defaults), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var _el = _step2.value; tryToMount(controllerFn, _el, name); } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } }); } // Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies, // services, or components that could require it // note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.js window.process = window.process || {}; window.process.env = window.process.env || {}; if (!window.process.env.NODE_ENV) { window.process.env.NODE_ENV = ''; } // note: legacy controllers that require legacy services (e.g. dollar-slice) must // wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted first mountLegacyServices(); mountComponentModules(); // ]]

Source Article