This article was originally published on June 13, 2019. It’s been updated to include more episodes and we’re recirculating it for Father’s Day.
Father’s Day is the perfect time to thank your dad for all his hard work with cards, whiskey, and golf-themed socks. Or, if you’re really cheap, you can just watch a really good father-oriented episode of television with him.
There are a lot of different types of dads, and over time, TV has evolved to represent the myriad kinds of men we have in our own lives. Wherein once upon a time we were presented with the ideal, masculine, briefcase-toting, working father, we now have dads to match the men we actually know. Soft, funny, angry, drunk, absent, silly: dads and father figures of all shapes are represented on shows these days.
No matter your own relationship with your dad, there’s likely a father-child relationship on TV that matches even the most awkward of familial situations, and we’ve put together a list of some of the best dad-centric TV episodes to celebrate that.
Michael Blurth, Arrested Development
“The Cabin Show” (Season 3, Episode One)
There are so many father-son relationships in Arrested Development that it gets a little hard to keep track, and in “The Cabin Show,” no one is winning dad of the year. Michael (Jason Bateman) has sold the family cabin to keep the company afloat. Neither Michael nor his older brother G.O.B. (Will Arnett) ever got to see the cabin because their father, George Sr. (Jeffery Tambor), was never around, so they plan to go together, but Michael flakes on G.O.B. to take his son instead, George Michael (Michael Cera). A trip Michael ends up canceling anyway when he learns that George Sr. has escaped prison by switching places with his identical twin brother (no one here is winning brother of the year either). G.O.B. goes to an event to reunite fathers and sons and hangs out with Steve Holt — not realizing that he’s actually the teen’s real dad — and the pair decide to go on a “son-son” camping trip, that is until G.O.B learns the truth of their connection and promptly abandons his son. Michael, wanting to be a better father than his brother and father, does make it out to the cabin with George Michael, but their trip is ruined when they wake up to find George Sr. driving the cabin away from the woods. (Stream on Netflix.)
Johnny Rose, Schitt’s Creek,
“Meet the Parents” (Season 5, Episode 11)
On Schitt’s Creek, Johnny Rose (Eugene Levy) emerged as one of the all-time great TV dads. He’s funny, loving, and a little out of touch while always wanting the best for his family and others in their close inner circle. In “Meet the Parents,” David (Eugene’s IRL son, Dan Levy) is throwing a surprise party for his boyfriend, Patrick (Noah Reid). He invites Patrick’s parents, but finds out way too late that they don’t actually know Patrick is gay. When Johnny welcomes Patrick’s parents to town and accidentally outs him and David as a couple, Johnny’s anxiety goes into overtime. He rushes to support David, who is shocked by the revelation that he’s been portrayed by Patrick as merely a business partner and not romantic partner, and awkwardly tries to smooth over what could be a very big deal. Luckily, this being Schitt’s Creek, when Patrick comes out to his parents at the end of the episode, they’re both accepting — just a little upset that he didn’t tell them sooner. (Stream on Hulu or Prime Video.)
Jim Hopper, Stranger Things
“Pollywog” (Season Two, Episode 3)
When Eleven (Millie Bobby Brown), a powerful kid raised in a lab as a test subject, meets the chief of the Hopkins Police Department, Jim Hopper (David Harbour), he goes pretty soft on her and wants to make her a real home. He adopts her, giving her the name Jane Hopper and a new life with some sense of normalcy. They have a ton of cute bonding moments throughout the whole series, but in season two’s “Pollywog,” we get to see how they became a family. In flashbacks, we learn that Hopper found Eleven hiding in the woods and offered to keep her in his grandfather’s old hunting cabin on one condition: that she not leave. Of course, she does, seeking out her friends and not understanding just how dangerous it is. That’s kids for you, and this episode dives into that parental dynamic. (Stream on Netflix.)
Logan Roy, Succession
“This Is Not for Tears” (Season Two, Episode 10)
There are many different kinds of fathers, and Logan Roy (Brian Cox) is the kind that instilled fear into not only his own children but everyone else around him. Central to Succession is, of course, the grapple for power over who is going to take control of the family business — a massive media conglomerate — if and when Logan finally steps down. There are hints of Logan’s true nature and cruelty woven throughout Succession,but on “This Is Not for Tears,” with the family trapped onboard a yacht, it becomes clear just how much Logan loves to play puppet master and watch his family fight for his approval and forgiveness. It’s a key turning point for Logan’s relationship with Kendall (Jeremy Strong) in particular, with Logan urging Kendall to take the fall for covering up a company sexual-misconduct scandal, while telling his son that he’s “not a killer.” Kendall proves his father wrong, betraying him with a press conference in which he calls Logan a “malignant presence, a bully, and a liar.” It’s the moment that Logan loses his hold over Kendall, something he never quite regains. (Stream on Max.)
Hal Wilkerson, Malcolm in the Middle
“Rollerskates” (Season One, Episode 13)
Serious mom paired with silly dad is a regular trope on TV, and Malcolm in the Middle’s Hal and Lois are the king and queen of it. In “Rollerskates,” Lois throws out her back screaming at Reese and ends up bedbound, fighting against Hal’s attempts to medicate her. Meanwhile, Hal teaches Malcolm to roller-skate so he can beat Reese’s team, showing off his skills and even impressing his son. “Rollerskates” is memorable mostly for Hal’s ridiculous, timeless scenes that see him rolling out full-blown figure-skating routines in a head-to-toe blue sparkly outfit, epitomizing his ridiculous, silly, extremely dad energy. Hal is mostly seen as pretty useless, but “Rollerskates” sees him finding something he’s really, really good at. (Stream on Hulu.)
Luke Danes, GilmoreGirls
“Wedding Blues” (Season 5, Episode 13)
As Luke finds out later in the series, he is an actual dad to daughter April, but his most notable father-child relationships aren’t actually with his own kid. They’re with Jess, the nephew he constantly spars with, and Rory, future-girlfriend Lorelai’s daughter, who he feeds and cares for every day. In season seven, Lorelai writes a letter commending Luke for his involvement: “Luke has been a sort of father figure in my daughter’s life,” she wrote. But “Wedding Blues” sees his unspoken competition with “real” father Christopher come to a head, as they fight and Luke gets hurt that Christopher says he isn’t her father: “Well, then where the hell were you when she got the chicken pox and would only eat mashed potatoes for a week, or where were you when she graduated high school, or started college?” he yells, cementing his status as lovable, stoic pseudo-dad. (Stream on Netflix.)
Frank Reynolds, It’s Always Sunny in Philadelphia
“The Gang Gives Frank an Intervention” (Season 5, Episode 4)
Now, Frank is not a good dad by any stretch. But there are many bad, selfish dads out there, and maybe they just need representing on TV, too, if only so we can be grateful that ours aren’t quite as bad as Frank. In “The Gang Gives Frank an Intervention,” all of Frank’s badness reaches a truly terrible peak. When he starts to go off the rails, his children and friends step in as they believe he is no longer fun to drink with. He attempts to sleep with Dennis and Dee’s aunt but ends up with their cousin, Gail the Snail. They call in professional reinforcements for a full-blown intervention (complete with gun!) and end up being united by just how awful they all are to, well, everyone. Including each other. A happy ending! (Stream on Hulu.)
Phil Dunphy, ModernFamily
“Good Cop Bad Dog” (Season 2, Episode 22)
Phil and Claire also partake in the silly dad/serious mom trope, even if it’s a more toned-down version than Hal and Lois. In “Good Cop Bad Dog” Claire tries to teach Phil a lesson about undermining her by forcing him to be the bad cop for once and yell at Alex and Haley for not cleaning their bathroom. Claire takes on Phil’s more fun “job” of taking Manny and Luke go-karting, but both parents take their new roles too far, with Claire forcing the boys to eat too much junk food and Phil turning into something of a dictator. It doesn’t quite work out — “You poked the bear!” Phil screams at one point — and they both return to their old roles of good cop/bad cop, the natural order of things for many families. (Stream on Hulu and Peacock.)
Sandy Cohen, The O.C.
“The My Two Dads” (Season 4, Episode 9)
Sandy Cohen is a great dad to his actual son Seth, but where he really excels is with his adopted tearaway Ryan. From the first couple of episodes wherein he convinces his wife to take in Ryan, then his client in his work as a public defender, Sandy has been staunchly defensive of Ryan and of his role as his stand-in dad. In season four, Ryan’s long-absent real dad shows up, fresh out of prison and claiming to be suffering with cancer. Sandy invites him over for dinner, but they soon get into a scrap — and sweet, calm Sandy ends up punching Frank in the face (an Atwood specialty!). Chatting about the altercation later on, Sandy apologizes that it didn’t work out with his dad — to which Ryan says, “Hey, my dad is right here” (cue tears). It might not always work out with your real dad, but families come in all shapes. (Stream on Hulu and Max.)
Louis Huang, Fresh Off the Boat
“Louisween” (Season 3, Episode 3)
Louis Huang often tends to be the king of silly dads, with Jessica serving as the firm hand. While she loves Christmas, an opportunity for organization and showing off, Louis adores the silliness of Halloween. Jessica, naturally, hates it. Desperate to instill the spirit of Halloween in his wife, Louis dresses up as Pete Vampras (Pete Sampras’s bloodsucking cousin from Transylvania). Jessica, staying home from the festivities to work on her novel, resists Louis’s desperate attempts to scare her — from ghost stories to heads in the oven. When he eventually confesses to her how much it hurts his feelings that she hates Halloween, they compromise with an early morning November trick or treat. Family life: It’s all about compromise! (Stream on Hulu.)
Ron Swanson, Parks and Recreation
“Women in Garbage” (Season 5, Episode 11)
Ron Swanson, famously, hates kids. Really, he hates anything fun or cuddly or silly. So when he starts dating a woman who has two daughters, it looks like a recipe for disaster. In “Women in Garbage,” Ron stays at the office to babysit Diane’s daughter, finding himself massively snowed under. On the second day of babysitting, he enlists Ann’s help, and when it all goes horribly wrong he’s terrified to tell his new girlfriend that he messed up. But it’s all okay: Diane laughs it all off, and is touched by Ron’s concern and investment in the well-being of her daughters. She tells him she loves him for the first time, and eventually, they have their own little baby together. It just goes to show that however messy parenthood can be, if you’ve got love for your kids, you can probably figure it out one way or another. (Stream on Peacock.)
Frank Costanza, Seinfeld
“The Serenity Now” (Season 9, Episode 3)
Some dads often tend to get worked up over, well, nothing. Frank Costanza, much like his son George, blows up at the slightest thing, so in the iconic Seinfeld episode “The Serenity Now,” he is advised by his doctor to keep calm in order to keep his blood pressure down. He’s told to say “serenity now” anytime he feels himself getting stressed, but chooses to yell it instead — something that catches on with Kramer and other characters throughout the episode. “The Serenity Now” perfectly showcases Jerry Stiller’s comedic yelling and both of the Costanzas’ beautiful, ridiculous tempers. Maybe try to teach “Serenity Now” to your dad next time he can’t get the TV to work? (Stream on Netflix.)
Martin Crane, Frasier
“Our Father Whose Art Ain’t Heaven” (Season 4, Episode 8)
If there’s one thing that’s pretty much universal with fathers and sons everywhere, it’s that they find it difficult to express their emotions. In “Our Father Whose Art Ain’t Heaven,” Martin, feeling uncomfortable that his sons are always providing for and looking after him, wants to repay them. Thinking that they like a piece of art at a restaurant because they compliment it to get a table, he buys it for Frasier, despite the price. Unable to tell his dad how he really feels, Frasier puts it above his fireplace, avoiding spending time at home so as not to look at it. Eventually he bites the bullet and comes clean, leading to Martin crying. This then leads to Frasier crying, which sets off Niles, for a full minute and a half of manly expressing of built-up stress. If there’s a lesson in here somewhere, it’s that having a little crying sesh with your dad might be the best way to get it all out this Father’s Day. (Stream on Hulu, Paramount+, Pluto TV, and Prime Video.)
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(3),auth=require(12),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(1),appendLandingPageParams=require(136),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),auth.isSubscriber()&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"1":1,"3":3,"12":12,"124":124,"136":136}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(408),Fingerprint2=require(407),DS=require(406),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(408),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"408":408,"409":409}];
window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});
}, {}];
window.modules["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy"}];
window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);
}, {}];
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 typeof key === 'string' && key.match(/\.legacy$/)).forEach(key => window.require(key));
}
function tryToMount(fn, el, name) {
try {
fn(el); // init the controller
} catch (e) {
const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML));
console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e);
}
}
/**
* mount client.js component controllers
*/
function mountComponentModules() {
Object.keys(window.modules).filter(key => typeof key === 'string' && key.match(/\.client$/)).forEach(key => {
let controllerFn = window.require(key);
if (typeof controllerFn === 'function') {
const name = key.replace('.client', ''),
instancesSelector = `[data-uri*="_components/${name}/"]`,
defaultSelector = `[data-uri$="_components${name}"]`,
instances = document.querySelectorAll(instancesSelector),
defaults = document.querySelectorAll(defaultSelector);
for (let el of instances) {
tryToMount(controllerFn, el, name);
}
for (let el of defaults) {
tryToMount(controllerFn, el, name);
}
}
});
}
// 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();
// ]]