{"version":3,"sources":["webpack:///./src/js/modules/resource-listing/ResourceListing.js","webpack:///./src/js/modules/resource-listing/index.js"],"names":["CourseListing","props","favoriteBtn","favoritedBtn","barAddedHeading","barAddedCopy","barRemovedHeading","barRemovedCopy","barViewFavoritesBtn","barViewFavoritesUrl","barDismissBtn","JSON","parse","labels","displayNotification","setDisplayNotification","useState","handleShowNotification","add","handleNotificationDismiss","handleViewFavorites","window","location","href","renderItems","items","favoriteId","handleFavoriteId","className","map","item","key","Id","Icon","src","alt","Heading","CanFavorite","FavoriteButton","favorited","Favorited","id","labelFavorite","labelFavorited","loggedIn","postEndpoint","onHandleNotification","Url","Teaser","Tags","length","tag","notificationProps","dismiss","timer","timeout","onDismiss","heading","subdata","copy","buttons","label","action","NotificationBar","renderNotification","Module"],"mappings":"gWAiJeA,MA5If,SAAuBC,GACrB,MAAM,YACJC,EADI,aAEJC,EAFI,gBAGJC,EAHI,aAIJC,EAJI,kBAKJC,EALI,eAMJC,EANI,oBAOJC,EAPI,oBAQJC,EARI,cASJC,GACEC,KAAKC,MAAMX,EAAMY,SAEdC,EAAqBC,GAA0BC,mBAAS,GAEzDC,EAAyBC,IACzBA,EAC0B,IAAxBJ,GACFC,EAAuB,GAGG,IAAxBD,GACFC,EAAuB,IAKvBI,EAA4B,KAChCJ,EAAuB,IAGnBK,EAAsB,KAC1BC,OAAOC,SAASC,KAAOd,GAoGzB,OACE,oCACE,kBAAC,IAAD,KAAaR,EAAb,CAAoBuB,YA9DF,CAACC,EAAOC,EAAYC,IACxC,wBAAIC,UAAU,2BACXH,EAAMI,IAAIC,IAAI,aACb,wBAAIF,UAAU,wBAAwBG,IAAKD,EAAKE,IAC9C,yBAAKJ,UAAU,+BACb,yBAAKA,UAAU,0BACb,+BACKE,EAAKG,MACN,oCACE,yBACEC,IAAKJ,EAAKG,KACVE,IAAKL,EAAKM,QACVR,UAAU,uBAEZ,yBAAKA,UAAU,qBAIlBE,EAAKO,aACN,kBAACC,EAAA,EAAD,CACEC,UAAWT,EAAKU,UAChBC,GAAIX,EAAKE,GACTN,WAAYA,EACZC,iBAAkBA,EAClBe,cAAexC,EACfyC,eAAgBxC,EAChByC,SAAU3C,EAAM2C,SAChBC,aAAc5C,EAAM4C,aACpBC,qBAAsB7B,OAIzBa,EAAKM,SACN,uBACEb,KAAMO,EAAKiB,IACXnB,UAAU,uCAEV,wBAAIA,UAAU,kCACXE,EAAKM,YAITN,EAAKkB,QACN,uBAAGpB,UAAU,iCAAiCE,EAAKkB,UAEnD,UAAClB,EAAKmB,YAAN,QAAC,EAAWC,SACZ,wBAAItB,UAAU,0BACXE,EAAKmB,KAAKpB,IAAIsB,GACb,wBAAIvB,UAAU,wBAAwBG,IAAKoB,GACxCA,aAcdrC,EAAsB,GApGA,MACzB,MAAMsC,EAAoB,CACxBC,SAAS,EACTC,MAAOrD,EAAMsD,QACbC,UAAWrC,EACXsB,GAAI,GACJgB,QAAS,GACTC,QAAS,GACTC,KAAM,GACNC,QAAS,CACP,CACEC,MAAOrD,EACPsD,OAAQ1C,GAEV,CACEyC,MAAOnD,EACPoD,OAAQ3C,KAKd,OAAQL,GACR,KAAK,EACHsC,EAAkBK,QAAUrD,EAC5BgD,EAAkBO,KAAOtD,EACzB,MACF,KAAK,EACH+C,EAAkBK,QAAUnD,EAC5B8C,EAAkBO,KAAOpD,EACzB,MACF,QACE,OAGF,OAAO,kBAACwD,EAAA,EAAoBX,IAkEEY,KC1InBC","file":"82.e8d61d.js","sourcesContent":["import React, { useState } from 'react';\nimport Listing from '../listing';\nimport NotificationBar from '../favorites-listing/NotificationBar';\nimport FavoriteButton from '../listing/FavoriteButton';\n\nfunction CourseListing(props) {\n const {\n favoriteBtn,\n favoritedBtn,\n barAddedHeading,\n barAddedCopy,\n barRemovedHeading,\n barRemovedCopy,\n barViewFavoritesBtn,\n barViewFavoritesUrl,\n barDismissBtn\n } = JSON.parse(props.labels);\n\n const [displayNotification, setDisplayNotification] = useState(0);\n\n const handleShowNotification = add => {\n if (add) {\n if (displayNotification !== 1) {\n setDisplayNotification(1);\n }\n } else {\n if (displayNotification !== 2) {\n setDisplayNotification(2);\n }\n }\n };\n\n const handleNotificationDismiss = () => {\n setDisplayNotification(0);\n };\n\n const handleViewFavorites = () => {\n window.location.href = barViewFavoritesUrl;\n };\n\n const renderNotification = () => {\n const notificationProps = {\n dismiss: true,\n timer: props.timeout,\n onDismiss: handleNotificationDismiss,\n id: '',\n heading: '',\n subdata: '',\n copy: '',\n buttons: [\n {\n label: barViewFavoritesBtn,\n action: handleViewFavorites\n },\n {\n label: barDismissBtn,\n action: handleNotificationDismiss\n }\n ]\n };\n\n switch (displayNotification) {\n case 1:\n notificationProps.heading = barAddedHeading;\n notificationProps.copy = barAddedCopy;\n break;\n case 2:\n notificationProps.heading = barRemovedHeading;\n notificationProps.copy = barRemovedCopy;\n break;\n default:\n return;\n }\n\n return ;\n };\n\n const renderListing = (items, favoriteId, handleFavoriteId) => (\n \n );\n\n return (\n <>\n \n {displayNotification > 0 && renderNotification()}\n \n );\n}\n\nexport default CourseListing;\n","import Module from './ResourceListing';\n\nexport default Module;\n"],"sourceRoot":""}