2 lines
134 KiB
JavaScript
2 lines
134 KiB
JavaScript
|
"use strict";(self.webpackChunklite=self.webpackChunklite||[]).push([[6546],{70370:(e,t,n)=>{n.d(t,{B:()=>o,_I:()=>i});var a=n(96540),r={updateWatchedBounds:function(){},watchedBounds:new Map},i=a.createContext(r),o=function(e){var t=e.children,n=e.className,r=e.name,o=e.type,l=e.offset,c=a.useContext(i).updateWatchedBounds,u=a.useRef(null);return a.useEffect((function(){c&&c(r,u,{type:o,offset:l})}),[]),a.createElement("div",{className:n,ref:u},t)}},15706:(e,t,n)=>{n.d(t,{G:()=>E,r:()=>b});var a=n(80296),r=n(64467),i=n(96540),o=n(90280),l=n(77865),c=n(52290),u=n(20239),d=n(44402),s=n(66305),p=n(42976),m=n(39160),f=n(90383);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v={xs:-40,sm:-40,md:-45,lg:-80},k={xs:-55,sm:-60,md:-65,lg:-130},y={xs:0,sm:350,md:490,lg:680},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=(0,m.d4)((function(e){return e.client.hydrated})),n=h(h({},y),e),r=i.useState("lg"),o=(0,a.A)(r,2),l=o[0],c=o[1];return i.useEffect((function(){var e=function(){window.innerWidth>=n.lg?c("lg"):window.innerWidth>=n.md?c("md"):window.innerWidth>=n.sm?c("sm"):window.innerWidth>=n.xs&&c("xs")};return t&&(e(),s.R5.on("resize",e)),function(){t&&s.R5.off("resize",e)}}),[t,n.lg,n.md,n.sm,n.xs]),l},N=function(e,t,n){return function(a){var r=n&&("xs"===t||"sm"===t),i=r?3*v[t]:k[t],o=1===e?"".concat(r?2*v[t]:v[t],"px"):2===e?"".concat(i,"px"):void 0;return{position:"relative",borderRight:e<2?"".concat(3,"px solid ").concat(a.colorTokens.background.neutral.tertiary.base):void 0,backgroundColor:a.colorTokens.background.neutral.tertiary.base,zIndex:3-e,marginLeft:o,paddingLeft:0===e?"0":"4px"}}},S=function(e){var t,n=e.catalogItem,a=e.width,r=e.height,d=e.isMobile,s=null==n?void 0:n.entity,p=(0,u.D)(),m=i.createElement(c.a,{height:"inherit",minHeight:"".concat(r,"px"),width:"".concat(a,"px"),background:p.colorTokens.background.neutral.secondary.base});return s&&"Post"===s.__typename&&null!==(t=s.previewImage)&&void 0!==t&&t.id&&(m=i.createElement(o.pg,{miroId:s.previewImage.id,alt:s.previewImage.alt||"",width:a,height:r,aspectRatio:d?o.l8.FourToThree:void 0,strategy:f.qY.Crop,loading:l.u.LAZY,rules:d?void 0:{height:"100%"}})),i.createElement(c.a,{height:"100%"},m)},E=function(e){var t=e.catalogItems,n=e.isEmbeded,a=void 0!==n&&n,r=e.coverWidth,o=e.coverHeight,l=e.breakpoints,u=(0,d.l)(),s=b(l),m=t.filter((function(e){var t,n=e.entity;return!("Post"!==(null==n?void 0:n.__typename)||null===(t=n.previewImage)||void 0===t||!t.id||n.visibility===p.dL.UNLISTED)})),f=[m[0],m[1],m[2]],g="sm"===s||"xs"===s,h=function(e,t){return 3*t+v[e]+k[e]+6}(s,r);return i.createElement(c.a,{display:"flex",overflow:"hidden",justifyContent:g?a?"space-between":"flex-start":"flex-end",width:g?"100%":"".concat(h,"px"),height:"100%",borderRadius:g?"0 0 3px 3px":"0 3px 3px 0",position:"relative",flexShrink:"0"},f.map((function(e,t){return i.createElement("div",{key:(null==e?void 0:e.catalogItemId)||t,className:u(N(t,s,a))},i.createElement(S,{isMobile:g,catalogItem:e,height:o,width:r}))})))}},66496:(e,t,n)=>{n.d(t,{V:()=>c});var a=n(45458),r=n(77485),i=n(59265),o=n(73114),l={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"EmbedCatalog_user"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"FragmentSpread",name:{kind:"Name",value:"UserAvatar_user"}},{kind:"FragmentSpread",name:{kind:"Name",value:"userUrl_user"}}]}}].concat((0,a.A)(r.R.definitions),(0,a.A)
|
||
|
//# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/6546.cd03f950.chunk.js.map
|