UNPKG

react-share

Version:

Social media share buttons and share counts for React.

1 lines 81.9 kB
{"version":3,"file":"index.cjs","sources":["../src/hocs/createIcon.tsx","../src/EmailIcon.ts","../src/utils/objectToGetParams.ts","../src/ShareButton.tsx","../src/hocs/createShareButton.tsx","../src/EmailShareButton.ts","../src/FacebookIcon.ts","../src/FacebookMessengerIcon.ts","../src/FacebookMessengerShareButton.ts","../src/utils/assert.ts","../src/FacebookShareButton.ts","../src/hooks/useIsMounted.ts","../src/hocs/createShareCount.tsx","../src/FacebookShareCount.ts","../src/HatenaIcon.ts","../src/HatenaShareButton.ts","../src/HatenaShareCount.ts","../src/InstapaperIcon.ts","../src/InstapaperShareButton.ts","../src/LineIcon.ts","../src/LineShareButton.ts","../src/LinkedinIcon.ts","../src/LinkedinShareButton.ts","../src/LivejournalIcon.ts","../src/LivejournalShareButton.ts","../src/MailruIcon.ts","../src/MailruShareButton.ts","../src/OKIcon.ts","../src/OKShareButton.ts","../src/OKShareCount.ts","../src/PinterestIcon.ts","../src/PinterestShareButton.ts","../src/PinterestShareCount.ts","../src/PocketIcon.ts","../src/PocketShareButton.ts","../src/RedditIcon.ts","../src/RedditShareButton.ts","../src/GabShareButton.ts","../src/GabIcon.ts","../src/RedditShareCount.ts","../src/TelegramIcon.ts","../src/TelegramShareButton.ts","../src/TumblrIcon.ts","../src/TumblrShareButton.ts","../src/TumblrShareCount.ts","../src/TwitterIcon.ts","../src/TwitterShareButton.ts","../src/ViberIcon.ts","../src/ViberShareButton.ts","../src/VKIcon.ts","../src/VKShareButton.ts","../src/VKShareCount.ts","../src/WeiboIcon.ts","../src/WeiboShareButton.ts","../src/WhatsappIcon.ts","../src/WhatsappShareButton.ts","../src/WorkplaceIcon.ts","../src/WorkplaceShareButton.ts","../src/XIcon.ts"],"sourcesContent":["import React from 'react';\n\ntype Props = Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height'> & {\n bgStyle?: React.CSSProperties;\n borderRadius?: number;\n iconFillColor?: string;\n round?: boolean;\n size?: number | string;\n};\n\ntype IconConfig = {\n color: string;\n networkName: string;\n /** SVG path */\n path: string;\n};\n\nexport default function createIcon(iconConfig: IconConfig) {\n const Icon: React.FC<Props> = ({\n bgStyle = {},\n borderRadius = 0,\n iconFillColor = 'white',\n round = false,\n size = 64,\n ...rest\n }) => (\n <svg viewBox=\"0 0 64 64\" width={size} height={size} {...rest}>\n {round ? (\n <circle cx=\"32\" cy=\"32\" r=\"32\" fill={iconConfig.color} style={bgStyle} />\n ) : (\n <rect\n width=\"64\"\n height=\"64\"\n rx={borderRadius}\n ry={borderRadius}\n fill={iconConfig.color}\n style={bgStyle}\n />\n )}\n\n <path d={iconConfig.path} fill={iconFillColor} />\n </svg>\n );\n\n return Icon;\n}\n","import createIcon from './hocs/createIcon';\n\nconst EmailIcon = createIcon({\n color: '#7f7f7f',\n networkName: 'email',\n path: 'M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z',\n});\n\nexport default EmailIcon;\n","export default function objectToGetParams(object: {\n [key: string]: string | number | undefined | null;\n}) {\n const params = Object.entries(object)\n .filter(([, value]) => value !== undefined && value !== null)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n\n return params.length > 0 ? `?${params.join('&')}` : '';\n}\n","import React, { Ref } from 'react';\nimport cx from 'classnames';\n\ntype NetworkLink<LinkOptions> = (url: string, options: LinkOptions) => string;\n\ntype WindowPosition = 'windowCenter' | 'screenCenter';\n\nconst isPromise = (obj: any): obj is Promise<unknown> =>\n !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n\nconst getBoxPositionOnWindowCenter = (width: number, height: number) => ({\n left: window.outerWidth / 2 + (window.screenX || window.screenLeft || 0) - width / 2,\n top: window.outerHeight / 2 + (window.screenY || window.screenTop || 0) - height / 2,\n});\n\nconst getBoxPositionOnScreenCenter = (width: number, height: number) => ({\n top: (window.screen.height - height) / 2,\n left: (window.screen.width - width) / 2,\n});\n\nfunction windowOpen(\n url: string,\n { height, width, ...configRest }: { height: number; width: number; [key: string]: any },\n onClose?: (dialog: Window | null) => void,\n) {\n const config: { [key: string]: string | number } = {\n height,\n width,\n location: 'no',\n toolbar: 'no',\n status: 'no',\n directories: 'no',\n menubar: 'no',\n scrollbars: 'yes',\n resizable: 'no',\n centerscreen: 'yes',\n chrome: 'yes',\n ...configRest,\n };\n\n const shareDialog = window.open(\n url,\n '',\n Object.keys(config)\n .map(key => `${key}=${config[key]}`)\n .join(', '),\n );\n\n if (onClose) {\n const interval = window.setInterval(() => {\n try {\n if (shareDialog === null || shareDialog.closed) {\n window.clearInterval(interval);\n onClose(shareDialog);\n }\n } catch (e) {\n /* eslint-disable no-console */\n console.error(e);\n /* eslint-enable no-console */\n }\n }, 1000);\n }\n\n return shareDialog;\n}\n\ninterface CustomProps<LinkOptions> {\n /**\n * Takes a function that returns a Promise to be fulfilled before calling\n * `onClick`. If you do not return promise, `onClick` is called immediately.\n */\n beforeOnClick?: () => Promise<void> | void;\n children: React.ReactNode;\n className?: string;\n /** Disables click action and adds `disabled` class */\n disabled?: boolean;\n /**\n * Style when button is disabled\n * @default { opacity: 0.6 }\n */\n disabledStyle?: React.CSSProperties;\n forwardedRef?: Ref<HTMLButtonElement>;\n /**\n * Passes as the native `title` atribute for the `button` element.\n */\n htmlTitle?: HTMLButtonElement['title'];\n networkName: string;\n networkLink: NetworkLink<LinkOptions>;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>, link: string) => void;\n /**\n * Takes a function to be called after closing share dialog.\n */\n onShareWindowClose?: () => void;\n openShareDialogOnClick?: boolean;\n opts: LinkOptions;\n resetButtonStyle?: boolean;\n /**\n * URL of the shared page\n */\n url: string;\n style?: React.CSSProperties;\n windowWidth?: number;\n windowHeight?: number;\n windowPosition?: WindowPosition;\n}\n\nexport type Props<LinkOptions extends Record<string, unknown>> = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof CustomProps<LinkOptions>\n> &\n CustomProps<LinkOptions>;\n\nexport default function ShareButton<LinkOptions extends Record<string, unknown>>({\n beforeOnClick,\n children,\n className,\n disabled,\n disabledStyle = { opacity: 0.6 },\n forwardedRef,\n htmlTitle,\n networkLink,\n networkName,\n onClick,\n onShareWindowClose,\n openShareDialogOnClick = true,\n opts,\n resetButtonStyle = true,\n style,\n url,\n windowHeight = 400,\n windowPosition = 'windowCenter',\n windowWidth = 550,\n ...rest\n}: Props<LinkOptions>) {\n const handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {\n const link = networkLink(url, opts);\n\n if (disabled) {\n return;\n }\n\n event.preventDefault();\n\n if (beforeOnClick) {\n const returnVal = beforeOnClick();\n\n if (isPromise(returnVal)) {\n await returnVal;\n }\n }\n\n if (openShareDialogOnClick) {\n const windowConfig = {\n height: windowHeight,\n width: windowWidth,\n ...(windowPosition === 'windowCenter'\n ? getBoxPositionOnWindowCenter(windowWidth, windowHeight)\n : getBoxPositionOnScreenCenter(windowWidth, windowHeight)),\n };\n\n windowOpen(link, windowConfig, onShareWindowClose);\n }\n\n if (onClick) {\n onClick(event, link);\n }\n };\n\n const newClassName = cx(\n 'react-share__ShareButton',\n {\n 'react-share__ShareButton--disabled': !!disabled,\n disabled: !!disabled,\n },\n className,\n );\n\n const newStyle = resetButtonStyle\n ? {\n backgroundColor: 'transparent',\n border: 'none',\n padding: 0,\n font: 'inherit',\n color: 'inherit',\n cursor: 'pointer',\n ...style,\n ...(disabled && disabledStyle),\n }\n : {\n ...style,\n ...(disabled && disabledStyle),\n };\n\n return (\n <button\n {...rest}\n className={newClassName}\n onClick={handleClick}\n ref={forwardedRef}\n style={newStyle}\n title={htmlTitle}\n >\n {children}\n </button>\n );\n}\n","import React, { Ref, forwardRef } from 'react';\n\nimport ShareButton, { Props as ShareButtonProps } from '../ShareButton';\n\nfunction createShareButton<\n OptionProps extends Record<string, any>,\n LinkOptions extends Record<string, unknown> = OptionProps,\n>(\n networkName: string,\n link: (url: string, options: LinkOptions) => string,\n optsMap: (props: OptionProps) => LinkOptions,\n defaultProps: Partial<ShareButtonProps<LinkOptions> & OptionProps>,\n) {\n type Props = Omit<\n ShareButtonProps<LinkOptions>,\n 'forwardedRef' | 'networkName' | 'networkLink' | 'opts'\n > &\n OptionProps;\n\n function CreatedButton(props: Props, ref: Ref<HTMLButtonElement>) {\n const opts = optsMap(props);\n const passedProps = { ...props };\n\n // remove keys from passed props that are passed as opts\n const optsKeys = Object.keys(opts);\n optsKeys.forEach(key => {\n delete passedProps[key];\n });\n\n return (\n <ShareButton<LinkOptions>\n {...defaultProps}\n {...passedProps}\n forwardedRef={ref}\n networkName={networkName}\n networkLink={link}\n opts={optsMap(props)}\n />\n );\n }\n\n CreatedButton.displayName = `ShareButton-${networkName}`;\n\n return forwardRef(CreatedButton);\n}\n\nexport default createShareButton;\n","import objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\ntype Options = {\n body?: string;\n separator?: string;\n subject?: string;\n};\n\nfunction emailLink(url: string, { subject, body, separator }: Options) {\n return 'mailto:' + objectToGetParams({ subject, body: body ? body + separator + url : url });\n}\n\nconst EmailShareButton = createShareButton<Options>(\n 'email',\n emailLink,\n props => ({\n subject: props.subject,\n body: props.body,\n separator: props.separator || ' ',\n }),\n {\n openShareDialogOnClick: false,\n onClick: (_, link: string) => {\n window.location.href = link;\n },\n },\n);\n\nexport default EmailShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst FacebookIcon = createIcon({\n color: '#0965FE',\n networkName: 'facebook',\n path: 'M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z',\n});\n\nexport default FacebookIcon;\n","import createIcon from './hocs/createIcon';\n\nconst FacebookMessengerIcon = createIcon({\n color: '#0A7CFF',\n networkName: 'facebookmessenger',\n path: 'M 53.066406 21.871094 C 52.667969 21.339844 51.941406 21.179688 51.359375 21.496094 L 37.492188 29.058594 L 28.867188 21.660156 C 28.339844 21.207031 27.550781 21.238281 27.054688 21.730469 L 11.058594 37.726562 C 10.539062 38.25 10.542969 39.09375 11.0625 39.613281 C 11.480469 40.027344 12.121094 40.121094 12.640625 39.839844 L 26.503906 32.28125 L 35.136719 39.679688 C 35.667969 40.132812 36.457031 40.101562 36.949219 39.609375 L 52.949219 23.613281 C 53.414062 23.140625 53.464844 22.398438 53.066406 21.871094 Z M 53.066406 21.871094',\n});\n\nexport default FacebookMessengerIcon;\n","import objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\ntype Options = {\n /** Your app's unique identifier. */\n appId: string;\n /** The URL to redirect to after a person clicks a button on the dialog.\n * Required when using URL redirection. */\n redirectUri?: string;\n /** A user ID of a recipient. Once the dialog comes up, the sender can\n * specify additional people as recipients. */\n to?: string;\n};\n\nfunction facebookMessengerLink(url: string, { appId, redirectUri, to }: Options) {\n return (\n 'https://www.facebook.com/dialog/send' +\n objectToGetParams({\n link: url,\n redirect_uri: redirectUri || url,\n app_id: appId,\n to,\n })\n );\n}\n\nconst FacebookMessengerShareButton = createShareButton<Options>(\n 'facebookmessenger',\n facebookMessengerLink,\n props => ({\n appId: props.appId,\n redirectUri: props.redirectUri,\n to: props.to,\n }),\n {\n windowWidth: 1000,\n windowHeight: 820,\n },\n);\n\nexport default FacebookMessengerShareButton;\n","class AssertionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'AssertionError';\n }\n}\n\nexport default function assert(value: any, message: string) {\n if (!value) {\n throw new AssertionError(message);\n }\n}\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction facebookLink(url: string, { hashtag }: { hashtag?: string }) {\n assert(url, 'facebook.url');\n\n return 'https://www.facebook.com/sharer/sharer.php' + objectToGetParams({ u: url, hashtag });\n}\n\nconst FacebookShareButton = createShareButton<{ hashtag?: string }>(\n 'facebook',\n facebookLink,\n props => ({ hashtag: props.hashtag }),\n {\n windowWidth: 550,\n windowHeight: 400,\n },\n);\n\nexport default FacebookShareButton;\n","import { useCallback, useEffect, useRef } from 'react';\n\nexport function useIsMounted() {\n const isMounted = useRef(false);\n\n useEffect(() => {\n isMounted.current = true;\n\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n return useCallback(() => isMounted.current, []);\n}\n","import React, { useEffect, useState } from 'react';\nimport cx from 'classnames';\nimport { useIsMounted } from '../hooks/useIsMounted';\n\ntype SocialMediaShareCountProps = Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> & {\n children?: (shareCount: number) => React.ReactNode;\n getCount: (url: string, callback: (shareCount?: number) => void) => void;\n url: string;\n};\n\nexport function SocialMediaShareCount({\n children = (shareCount: number) => shareCount,\n className,\n getCount,\n url,\n ...rest\n}: SocialMediaShareCountProps) {\n const isMounted = useIsMounted();\n const [count, setCount] = useState<number | undefined>(undefined);\n const [isLoading, setIsLoading] = useState(false);\n\n useEffect(() => {\n setIsLoading(true);\n\n getCount(url, count => {\n if (isMounted()) {\n setCount(count);\n setIsLoading(false);\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [url]);\n\n return (\n <span className={cx('react-share__ShareCount', className)} {...rest}>\n {!isLoading && count !== undefined && children(count)}\n </span>\n );\n}\n\nexport default function createShareCount(getCount: SocialMediaShareCountProps['getCount']) {\n const ShareCount = (props: Omit<SocialMediaShareCountProps, 'getCount'>) => (\n <SocialMediaShareCount getCount={getCount} {...props} />\n );\n\n ShareCount.displayName = `ShareCount(${getCount.name})`;\n\n return ShareCount;\n}\n","import jsonp from 'jsonp';\n\nimport createShareCount from './hocs/createShareCount';\n\nfunction getFacebookShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n const endpoint = `https://graph.facebook.com/?id=${shareUrl}&fields=og_object{engagement}`;\n\n jsonp(endpoint, (err, data) => {\n callback(\n !err && data && data.og_object && data.og_object.engagement\n ? data.og_object.engagement.count\n : undefined,\n );\n });\n}\n\nexport default createShareCount(getFacebookShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst HatenaIcon = createIcon({\n color: '#009ad9',\n networkName: 'hatena',\n path: 'M 36.164062 33.554688 C 34.988281 32.234375 33.347656 31.5 31.253906 31.34375 C 33.125 30.835938 34.476562 30.09375 35.335938 29.09375 C 36.191406 28.09375 36.609375 26.78125 36.609375 25.101562 C 36.628906 23.875 36.332031 22.660156 35.75 21.578125 C 35.160156 20.558594 34.292969 19.71875 33.253906 19.160156 C 32.304688 18.640625 31.175781 18.265625 29.847656 18.042969 C 28.523438 17.824219 26.195312 17.730469 22.867188 17.730469 L 14.769531 17.730469 L 14.769531 47.269531 L 23.113281 47.269531 C 26.46875 47.269531 28.886719 47.15625 30.367188 46.929688 C 31.851562 46.695312 33.085938 46.304688 34.085938 45.773438 C 35.289062 45.148438 36.28125 44.179688 36.933594 42.992188 C 37.597656 41.796875 37.933594 40.402344 37.933594 38.816406 C 37.933594 36.621094 37.347656 34.867188 36.164062 33.554688 Z M 22.257812 24.269531 L 23.984375 24.269531 C 25.988281 24.269531 27.332031 24.496094 28.015625 24.945312 C 28.703125 25.402344 29.042969 26.183594 29.042969 27.285156 C 29.042969 28.390625 28.664062 29.105469 27.9375 29.550781 C 27.210938 29.992188 25.84375 30.199219 23.855469 30.199219 L 22.257812 30.199219 Z M 29.121094 41.210938 C 28.328125 41.691406 26.976562 41.925781 25.078125 41.925781 L 22.257812 41.925781 L 22.257812 35.488281 L 25.195312 35.488281 C 27.144531 35.488281 28.496094 35.738281 29.210938 36.230469 C 29.925781 36.726562 30.304688 37.582031 30.304688 38.832031 C 30.304688 40.078125 29.914062 40.742188 29.105469 41.222656 Z M 29.121094 41.210938 M 46.488281 39.792969 C 44.421875 39.792969 42.742188 41.46875 42.742188 43.535156 C 42.742188 45.605469 44.421875 47.28125 46.488281 47.28125 C 48.554688 47.28125 50.230469 45.605469 50.230469 43.535156 C 50.230469 41.46875 48.554688 39.792969 46.488281 39.792969 Z M 46.488281 39.792969 M 43.238281 17.730469 L 49.738281 17.730469 L 49.738281 37.429688 L 43.238281 37.429688 Z M 43.238281 17.730469 ',\n});\n\nexport default HatenaIcon;\n","import assert from './utils/assert';\n\nimport createShareButton from './hocs/createShareButton';\n\nfunction hatenaLink(url: string, { title }: { title?: string }) {\n assert(url, 'hatena.url');\n\n return `http://b.hatena.ne.jp/add?mode=confirm&url=${url}&title=${title}`;\n}\n\nconst HatenaShareButton = createShareButton<{ title?: string }>(\n 'hatena',\n hatenaLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 660,\n windowHeight: 460,\n windowPosition: 'windowCenter',\n },\n);\n\nexport default HatenaShareButton;\n","import jsonp from 'jsonp';\n\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareCount from './hocs/createShareCount';\n\nfunction getHatenaShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n const url = 'https://bookmark.hatenaapis.com/count/entry';\n\n jsonp(\n url +\n objectToGetParams({\n url: shareUrl,\n }),\n (err, data) => {\n callback(data ?? undefined);\n },\n );\n}\n\nexport default createShareCount(getHatenaShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst InstapaperIcon = createIcon({\n color: '#1F1F1F',\n networkName: 'instapaper',\n path: 'M35.688 43.012c0 2.425.361 2.785 3.912 3.056V48H24.401v-1.932c3.555-.27 3.912-.63 3.912-3.056V20.944c0-2.379-.36-2.785-3.912-3.056V16H39.6v1.888c-3.55.27-3.912.675-3.912 3.056v22.068h.001z',\n});\n\nexport default InstapaperIcon;\n","import assert from './utils/assert';\nimport createShareButton from './hocs/createShareButton';\nimport objectToGetParams from './utils/objectToGetParams';\n\nfunction instapaperLink(\n url: string,\n { title, description }: { title?: string; description?: string },\n) {\n assert(url, 'instapaper.url');\n\n return (\n 'http://www.instapaper.com/hello2' +\n objectToGetParams({\n url,\n title,\n description,\n })\n );\n}\n\nconst InstapaperShareButton = createShareButton<{ title?: string; description?: string }>(\n 'instapaper',\n instapaperLink,\n props => ({\n title: props.title,\n description: props.description,\n }),\n {\n windowWidth: 500,\n windowHeight: 500,\n windowPosition: 'windowCenter',\n },\n);\n\nexport default InstapaperShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst LineIcon = createIcon({\n color: '#00b800',\n networkName: 'line',\n path: 'M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z',\n});\n\nexport default LineIcon;\n","import assert from './utils/assert';\nimport createShareButton from './hocs/createShareButton';\nimport objectToGetParams from './utils/objectToGetParams';\n\nfunction lineLink(url: string, { title }: { title?: string }) {\n assert(url, 'line.url');\n\n return (\n 'https://social-plugins.line.me/lineit/share' +\n objectToGetParams({\n url,\n text: title,\n })\n );\n}\n\nconst LineShareButton = createShareButton<{ title?: string }>(\n 'line',\n lineLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 500,\n windowHeight: 500,\n },\n);\n\nexport default LineShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst LinkedinIcon = createIcon({\n color: '#0077B5',\n networkName: 'linkedin',\n path: 'M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z',\n});\n\nexport default LinkedinIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\ntype Options = {\n /** The url-encoded title value that you wish you use. */\n title?: string;\n /** The url-encoded description that you wish you use. */\n summary?: string;\n /** The url-encoded source of the content (e.g. your website or application name) */\n source?: string;\n};\n\nfunction linkedinLink(url: string, { title, summary, source }: Options) {\n assert(url, 'linkedin.url');\n\n return (\n 'https://linkedin.com/shareArticle' +\n objectToGetParams({ url, mini: 'true', title, summary, source })\n );\n}\n\nconst LinkedinShareButton = createShareButton<Options>(\n 'linkedin',\n linkedinLink,\n ({ title, summary, source }) => ({ title, summary, source }),\n {\n windowWidth: 750,\n windowHeight: 600,\n },\n);\n\nexport default LinkedinShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst LivejournalIcon = createIcon({\n color: '#21A5D8',\n networkName: 'livejournal',\n path: 'M18.3407821,28.1764706 L21.9441341,31.789916 L33.0055865,42.882353 C33.0055865,42.882353 33.0893855,42.9663866 33.0893855,42.9663866 L46.6648046,47 C46.6648046,47 46.6648046,47 46.7486034,47 C46.8324022,47 46.8324022,47 46.9162012,46.9159664 C47,46.8319327 47,46.8319327 47,46.7478991 L42.9776536,33.1344537 C42.9776536,33.1344537 42.9776536,33.1344537 42.8938548,33.0504202 L31.1620111,21.3697479 L31.1620111,21.3697479 L28.1452514,18.2605042 C27.3072626,17.4201681 26.5530726,17 25.7150838,17 C24.2905028,17 23.0335195,18.3445378 21.5251397,19.8571429 C21.273743,20.1092437 20.9385475,20.4453781 20.6871508,20.697479 C20.3519553,21.0336134 20.1005586,21.2857143 19.849162,21.5378151 C18.3407821,22.9663866 17.0837989,24.2268908 17,25.7394958 C17.0837989,26.4957983 17.5027933,27.3361345 18.3407821,28.1764706 Z M39.9012319,39.6134454 C39.7336341,39.4453781 39.4822374,37.6806724 40.2364275,36.8403362 C40.9906174,36.0840337 41.6610084,36 42.1638017,36 C42.3313995,36 42.4989973,36 42.5827961,36 L44.8453659,43.5630253 L43.5883828,44.8235295 L36.0464833,42.5546218 C35.9626843,42.2184874 35.8788855,41.2100841 36.8844722,40.2016807 C37.2196676,39.8655463 37.8900587,39.6134454 38.5604498,39.6134454 C39.147042,39.6134454 39.5660364,39.7815126 39.5660364,39.7815126 C39.6498353,39.8655463 39.8174331,39.8655463 39.8174331,39.7815126 C39.9850307,39.7815126 39.9850307,39.697479 39.9012319,39.6134454 Z',\n});\n\nexport default LivejournalIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction livejournalLink(\n url: string,\n { title, description }: { title?: string; description?: string },\n) {\n assert(url, 'livejournal.url');\n\n return (\n 'https://www.livejournal.com/update.bml' +\n objectToGetParams({\n subject: title,\n event: description,\n })\n );\n}\n\nconst LivejournalShareButton = createShareButton<{ title?: string; description?: string }>(\n 'livejournal',\n livejournalLink,\n props => ({\n title: props.title,\n description: props.description,\n }),\n {\n windowWidth: 660,\n windowHeight: 460,\n },\n);\n\nexport default LivejournalShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst MailruIcon = createIcon({\n color: '#168DE2',\n networkName: 'mailru',\n path: 'M39.7107745,17 C41.6619755,17 43.3204965,18.732852 43.3204965,21.0072202 C43.3204965,23.2815885 41.7595357,25.0144404 39.7107745,25.0144404 C37.7595732,25.0144404 36.1010522,23.2815885 36.1010522,21.0072202 C36.1010522,18.732852 37.7595732,17 39.7107745,17 Z M24.3938451,17 C26.3450463,17 28.0035672,18.732852 28.0035672,21.0072202 C28.0035672,23.2815885 26.4426063,25.0144404 24.3938451,25.0144404 C22.4426439,25.0144404 20.7841229,23.2815885 20.7841229,21.0072202 C20.7841229,18.732852 22.4426439,17 24.3938451,17 Z M51.9057817,43.4259928 C51.7106617,44.0758123 51.4179815,44.6173285 50.9301812,44.9422383 C50.637501,45.1588448 50.2472607,45.267148 49.8570205,45.267148 C49.07654,45.267148 48.3936197,44.833935 48.0033795,44.0758123 L46.2472985,40.7184115 L45.759498,41.2599278 C42.5400162,44.9422383 37.466893,47 32.0035297,47 C26.5401664,47 21.5646034,44.9422383 18.2475614,41.2599278 L17.7597611,40.7184115 L16.00368,44.0758123 C15.6134398,44.833935 14.9305194,45.267148 14.1500389,45.267148 C13.7597986,45.267148 13.3695584,45.1588448 13.0768782,44.9422383 C12.0037176,44.2924187 11.7110374,42.7761733 12.2963978,41.5848375 L16.7841605,33.0288807 C17.1744007,32.270758 17.8573211,31.8375453 18.6378016,31.8375453 C19.0280418,31.8375453 19.4182821,31.9458485 19.7109623,32.1624548 C20.7841229,32.8122743 21.0768031,34.3285197 20.4914427,35.5198555 L20.1012025,36.2779783 L20.2963226,36.602888 C22.4426439,39.9602888 27.0279667,42.234657 31.9059697,42.234657 C36.7839727,42.234657 41.3692955,40.068592 43.5156167,36.602888 L43.7107367,36.2779783 L43.3204965,35.6281587 C43.0278165,35.0866425 42.9302562,34.436823 43.1253765,33.7870035 C43.3204965,33.137184 43.6131767,32.5956678 44.100977,32.270758 C44.3936572,32.0541515 44.7838975,31.9458485 45.1741377,31.9458485 C45.9546182,31.9458485 46.6375385,32.3790613 47.0277787,33.137184 L51.5155415,41.6931408 C52.003342,42.234657 52.100902,42.8844765 51.9057817,43.4259928 Z',\n});\n\nexport default MailruIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction mailruLink(\n url: string,\n { title, description, imageUrl }: { title?: string; description?: string; imageUrl?: string },\n) {\n assert(url, 'mailru.url');\n\n return (\n 'https://connect.mail.ru/share' +\n objectToGetParams({\n url,\n title,\n description,\n image_url: imageUrl,\n })\n );\n}\n\nconst MailruShareButton = createShareButton<{\n title?: string;\n description?: string;\n imageUrl?: string;\n}>(\n 'mailru',\n mailruLink,\n props => ({\n title: props.title,\n description: props.description,\n imageUrl: props.imageUrl,\n }),\n {\n windowWidth: 660,\n windowHeight: 460,\n },\n);\n\nexport default MailruShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst OKIcon = createIcon({\n color: '#F97400',\n networkName: 'ok',\n path: 'M39,30c-1,0-3,2-7,2s-6-2-7-2c-1.1,0-2,0.9-2,2c0,1,0.6,1.5,1,1.7c1.2,0.7,5,2.3,5,2.3l-4.3,5.4 c0,0-0.8,0.9-0.8,1.6c0,1.1,0.9,2,2,2c1,0,1.5-0.7,1.5-0.7S32,39,32,39c0,0,4.5,5.3,4.5,5.3S37,45,38,45c1.1,0,2-0.9,2-2 c0-0.6-0.8-1.6-0.8-1.6L35,36c0,0,3.8-1.6,5-2.3c0.4-0.3,1-0.7,1-1.7C41,30.9,40.1,30,39,30z M32,15c-3.9,0-7,3.1-7,7s3.1,7,7,7c3.9,0,7-3.1,7-7S35.9,15,32,15z M32,25.5 c-1.9,0-3.5-1.6-3.5-3.5c0-1.9,1.6-3.5,3.5-3.5c1.9,0,3.5,1.6,3.5,3.5C35.5,23.9,33.9,22.5,35,22.5z ',\n});\n\nexport default OKIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction okLink(\n url: string,\n { title, description, image }: { title?: string; description?: string; image?: string },\n) {\n assert(url, 'ok.url');\n\n return (\n 'https://connect.ok.ru/offer' +\n objectToGetParams({\n url,\n title,\n description,\n imageUrl: image,\n })\n );\n}\n\nconst OKShareButton = createShareButton<{ title?: string; description?: string; image?: string }>(\n 'ok',\n okLink,\n props => ({\n title: props.title,\n description: props.description,\n image: props.image,\n }),\n {\n windowWidth: 588,\n windowHeight: 480,\n windowPosition: 'screenCenter',\n },\n);\n\nexport default OKShareButton;\n","import jsonp from 'jsonp';\n\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareCount from './hocs/createShareCount';\n\ndeclare global {\n interface Window {\n OK: {\n Share: {\n count: (index: number, _count: number) => void;\n };\n callbacks: ((count?: number) => void)[];\n };\n ODKL: {\n updateCount: (index: string, count: string) => void;\n };\n }\n}\n\nfunction getOKShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n if (!window.OK) {\n window.OK = {\n Share: {\n count: function count(index, _count) {\n window.OK.callbacks[index]?.(_count);\n },\n },\n callbacks: [],\n };\n }\n\n const url = 'https://connect.ok.ru/dk';\n const index = window.OK.callbacks.length;\n\n window.ODKL = {\n updateCount(index, count) {\n const callbackIndex = index === '' ? 0 : parseInt(index.replace('react-share-', ''), 10);\n window.OK.callbacks[callbackIndex]?.(count === '' ? undefined : parseInt(count, 10));\n },\n };\n window.OK.callbacks.push(callback);\n\n return jsonp(\n url +\n objectToGetParams({\n 'st.cmd': 'extLike',\n uid: `react-share-${index}`,\n ref: shareUrl,\n }),\n );\n}\n\nexport default createShareCount(getOKShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst PinterestIcon = createIcon({\n color: '#E60023',\n networkName: 'pinterest',\n path: 'M32,16c-8.8,0-16,7.2-16,16c0,6.6,3.9,12.2,9.6,14.7c0-1.1,0-2.5,0.3-3.7 c0.3-1.3,2.1-8.7,2.1-8.7s-0.5-1-0.5-2.5c0-2.4,1.4-4.1,3.1-4.1c1.5,0,2.2,1.1,2.2,2.4c0,1.5-0.9,3.7-1.4,5.7 c-0.4,1.7,0.9,3.1,2.5,3.1c3,0,5.1-3.9,5.1-8.5c0-3.5-2.4-6.1-6.7-6.1c-4.9,0-7.9,3.6-7.9,7.7c0,1.4,0.4,2.4,1.1,3.1 c0.3,0.3,0.3,0.5,0.2,0.9c-0.1,0.3-0.3,1-0.3,1.3c-0.1,0.4-0.4,0.6-0.8,0.4c-2.2-0.9-3.3-3.4-3.3-6.1c0-4.5,3.8-10,11.4-10 c6.1,0,10.1,4.4,10.1,9.2c0,6.3-3.5,11-8.6,11c-1.7,0-3.4-0.9-3.9-2c0,0-0.9,3.7-1.1,4.4c-0.3,1.2-1,2.5-1.6,3.4 c1.4,0.4,3,0.7,4.5,0.7c8.8,0,16-7.2,16-16C48,23.2,40.8,16,32,16z',\n});\n\nexport default PinterestIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\ninterface PinterestShareProps {\n media: string;\n description?: string;\n pinId?: string;\n}\n\nfunction pinterestLink(url: string, { media, description, pinId }: PinterestShareProps) {\n if (pinId) {\n return `https://pinterest.com/pin/${pinId}/repin/x/`;\n }\n\n assert(url, 'pinterest.url');\n assert(media, 'pinterest.media');\n\n return (\n 'https://pinterest.com/pin/create/button/' +\n objectToGetParams({\n url,\n media,\n description,\n })\n );\n}\n\nconst PinterestShareButton = createShareButton<PinterestShareProps>(\n 'pinterest',\n pinterestLink,\n props => ({\n media: props.media,\n description: props.description,\n pinId: props.pinId,\n }),\n {\n windowWidth: 1000,\n windowHeight: 730,\n },\n);\n\nexport default PinterestShareButton;\n","import jsonp from 'jsonp';\n\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareCount from './hocs/createShareCount';\n\nfunction getPinterestShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n const url = 'https://api.pinterest.com/v1/urls/count.json';\n\n jsonp(\n url +\n objectToGetParams({\n url: shareUrl,\n }),\n (err, data) => {\n callback(data ? data.count : undefined);\n },\n );\n}\n\nexport default createShareCount(getPinterestShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst PocketIcon = createIcon({\n color: '#EF3F56',\n networkName: 'pocket',\n path: 'M41.084 29.065l-7.528 7.882a2.104 2.104 0 0 1-1.521.666 2.106 2.106 0 0 1-1.522-.666l-7.528-7.882c-.876-.914-.902-2.43-.065-3.384.84-.955 2.228-.987 3.1-.072l6.015 6.286 6.022-6.286c.88-.918 2.263-.883 3.102.071.841.938.82 2.465-.06 3.383l-.015.002zm6.777-10.976C47.463 16.84 46.361 16 45.14 16H18.905c-1.2 0-2.289.82-2.716 2.044-.125.363-.189.743-.189 1.125v10.539l.112 2.096c.464 4.766 2.73 8.933 6.243 11.838.06.053.125.102.19.153l.04.033c1.882 1.499 3.986 2.514 6.259 3.014a14.662 14.662 0 0 0 6.13.052c.118-.042.235-.065.353-.087.03 0 .065-.022.098-.042a15.395 15.395 0 0 0 6.011-2.945l.039-.045.18-.153c3.502-2.902 5.765-7.072 6.248-11.852L48 29.674v-10.52c0-.366-.041-.728-.161-1.08l.022.015z',\n});\n\nexport default PocketIcon;\n","import assert from './utils/assert';\nimport createShareButton from './hocs/createShareButton';\nimport objectToGetParams from './utils/objectToGetParams';\n\nfunction pocketLink(url: string, { title }: { title?: string }) {\n assert(url, 'pocket.url');\n\n return (\n 'https://getpocket.com/save' +\n objectToGetParams({\n url,\n title,\n })\n );\n}\n\nconst PocketShareButton = createShareButton<{ title?: string }>(\n 'pocket',\n pocketLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 500,\n windowHeight: 500,\n },\n);\n\nexport default PocketShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst RedditIcon = createIcon({\n color: '#FF5700',\n networkName: 'reddit',\n path: 'M 53.34375 32 C 53.277344 30.160156 52.136719 28.53125 50.429688 27.839844 C 48.722656 27.148438 46.769531 27.523438 45.441406 28.800781 C 41.800781 26.324219 37.519531 24.957031 33.121094 24.863281 L 35.199219 14.878906 L 42.046875 16.320312 C 42.214844 17.882812 43.496094 19.09375 45.066406 19.171875 C 46.636719 19.253906 48.03125 18.183594 48.359375 16.644531 C 48.6875 15.105469 47.847656 13.558594 46.382812 12.992188 C 44.914062 12.425781 43.253906 13.007812 42.464844 14.367188 L 34.625 12.800781 C 34.363281 12.742188 34.09375 12.792969 33.871094 12.9375 C 33.648438 13.082031 33.492188 13.308594 33.441406 13.566406 L 31.070312 24.671875 C 26.617188 24.738281 22.277344 26.105469 18.59375 28.609375 C 17.242188 27.339844 15.273438 26.988281 13.570312 27.707031 C 11.863281 28.429688 10.746094 30.089844 10.71875 31.941406 C 10.691406 33.789062 11.757812 35.484375 13.441406 36.257812 C 13.402344 36.726562 13.402344 37.195312 13.441406 37.664062 C 13.441406 44.832031 21.792969 50.65625 32.097656 50.65625 C 42.398438 50.65625 50.753906 44.832031 50.753906 37.664062 C 50.789062 37.195312 50.789062 36.726562 50.753906 36.257812 C 52.363281 35.453125 53.371094 33.800781 53.34375 32 Z M 21.34375 35.199219 C 21.34375 33.433594 22.777344 32 24.542969 32 C 26.3125 32 27.742188 33.433594 27.742188 35.199219 C 27.742188 36.96875 26.3125 38.398438 24.542969 38.398438 C 22.777344 38.398438 21.34375 36.96875 21.34375 35.199219 Z M 39.9375 44 C 37.664062 45.710938 34.871094 46.582031 32.03125 46.464844 C 29.191406 46.582031 26.398438 45.710938 24.128906 44 C 23.847656 43.65625 23.871094 43.15625 24.183594 42.839844 C 24.5 42.527344 25 42.503906 25.34375 42.785156 C 27.269531 44.195312 29.617188 44.90625 32 44.800781 C 34.386719 44.929688 36.746094 44.242188 38.6875 42.847656 C 39.042969 42.503906 39.605469 42.511719 39.953125 42.863281 C 40.296875 43.21875 40.289062 43.785156 39.9375 44.128906 Z M 39.359375 38.527344 C 37.59375 38.527344 36.160156 37.09375 36.160156 35.328125 C 36.160156 33.5625 37.59375 32.128906 39.359375 32.128906 C 41.128906 32.128906 42.558594 33.5625 42.558594 35.328125 C 42.59375 36.203125 42.269531 37.054688 41.65625 37.6875 C 41.046875 38.316406 40.203125 38.664062 39.328125 38.65625 Z M 39.359375 38.527344',\n});\n\nexport default RedditIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction redditLink(url: string, { title }: { title?: string }) {\n assert(url, 'reddit.url');\n\n return (\n 'https://www.reddit.com/web/submit' +\n objectToGetParams({\n url,\n title,\n })\n );\n}\n\nconst RedditShareButton = createShareButton<{ title?: string }>(\n 'reddit',\n redditLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 660,\n windowHeight: 460,\n windowPosition: 'windowCenter',\n },\n);\n\nexport default RedditShareButton;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction gabLink(url: string, { title }: { title?: string }) {\n assert(url, 'gab.url');\n\n return (\n 'https://gab.com/compose' +\n objectToGetParams({\n url,\n text: title,\n })\n );\n}\n\nconst GabShareButton = createShareButton<{ title?: string }>(\n 'gab',\n gabLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 660,\n windowHeight: 640,\n windowPosition: 'windowCenter',\n },\n);\n\nexport default GabShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst GabIcon = createIcon({\n color: '#00d178',\n networkName: 'gab',\n path: 'm17.0506,23.97457l5.18518,0l0,14.23933c0,6.82699 -3.72695,10.09328 -9.33471,10.09328c-2.55969,0 -4.82842,-0.87286 -6.22084,-2.0713l2.07477,-3.88283c1.19844,0.81051 2.33108,1.29543 3.85511,1.29543c2.75366,0 4.44049,-1.97432 4.44049,-4.82149l0,-0.87286c-1.16728,1.39242 -2.81947,2.0713 -4.63446,2.0713c-4.44048,0 -7.81068,-3.68885 -7.81068,-8.28521c0,-4.59289 3.37019,-8.28174 7.81068,-8.28174c1.81499,0 3.46718,0.67888 4.63446,2.0713l0,-1.55521zm-3.62997,11.39217c1.97777,0 3.62997,-1.6522 3.62997,-3.62652c0,-1.97432 -1.6522,-3.62305 -3.62997,-3.62305c-1.97778,0 -3.62997,1.64873 -3.62997,3.62305c0,1.97432 1.65219,3.62652 3.62997,3.62652zm25.7077,4.13913l-5.18518,0l0,-1.29197c-1.00448,1.13264 -2.3969,1.81152 -4.21188,1.81152c-3.62997,0 -5.63893,-2.52504 -5.63893,-5.4034c0,-4.27076 5.251,-5.85715 9.78846,-4.49937c-0.09698,-1.39241 -0.9733,-2.39343 -2.78829,-2.39343c-1.26426,0 -2.72248,0.48492 -3.62997,1.00102l-1.5552,-3.72003c1.19844,-0.77587 3.40136,-1.55174 5.96452,-1.55174c3.78931,0 7.25648,2.13365 7.25648,7.95962l0,8.08777zm-5.18518,-6.14809c-2.42806,-0.77587 -4.66563,-0.3533 -4.66563,1.36124c0,1.00101 0.84168,1.6799 1.84616,1.6799c1.20191,0 2.56315,-0.96984 2.81947,-3.04115zm13.00626,-17.66495l0,9.83695c1.16727,-1.39242 2.81946,-2.0713 4.63445,-2.0713c4.44048,0 7.81068,3.68885 7.81068,8.28174c0,4.59636 -3.37019,8.28521 -7.81068,8.28521c-1.81499,0 -3.46718,-0.67888 -4.63445,-2.0713l0,1.55174l-5.18519,0l0,-23.81304l5.18519,0zm3.62997,19.67391c1.97777,0 3.62997,-1.6522 3.62997,-3.62652c0,-1.97432 -1.6522,-3.62305 -3.62997,-3.62305c-1.97778,0 -3.62997,1.64873 -3.62997,3.62305c0,1.97432 1.65219,3.62652 3.62997,3.62652zm0,0',\n});\n\nexport default GabIcon;\n","import jsonp from 'jsonp';\n\nimport createShareCount from './hocs/createShareCount';\n\nfunction getRedditShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n const endpoint = `https://www.reddit.com/api/info.json?limit=1&url=${shareUrl}`;\n\n jsonp(endpoint, { param: 'jsonp' }, (err, response) => {\n callback(\n !err &&\n response &&\n response.data &&\n response.data.children.length > 0 &&\n response.data.children[0].data.score\n ? response.data.children[0].data.score\n : undefined,\n );\n });\n}\n\nexport default createShareCount(getRedditShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst TelegramIcon = createIcon({\n color: '#25A3E3',\n networkName: 'telegram',\n path: 'm45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957',\n});\n\nexport default TelegramIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction telegramLink(url: string, { title }: { title?: string }) {\n assert(url, 'telegram.url');\n\n return (\n 'https://telegram.me/share/url' +\n objectToGetParams({\n url,\n text: title,\n })\n );\n}\n\nconst TelegramShareButton = createShareButton<{ title?: string }>(\n 'telegram',\n telegramLink,\n props => ({\n title: props.title,\n }),\n {\n windowWidth: 550,\n windowHeight: 400,\n },\n);\n\nexport default TelegramShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst TumblrIcon = createIcon({\n color: '#34526f',\n networkName: 'tumblr',\n path: 'M39.2,41c-0.6,0.3-1.6,0.5-2.4,0.5c-2.4,0.1-2.9-1.7-2.9-3v-9.3h6v-4.5h-6V17c0,0-4.3,0-4.4,0 c-0.1,0-0.2,0.1-0.2,0.2c-0.3,2.3-1.4,6.4-5.9,8.1v3.9h3V39c0,3.4,2.5,8.1,9,8c2.2,0,4.7-1,5.2-1.8L39.2,41z',\n});\n\nexport default TumblrIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction tumblrLink(\n url: string,\n {\n title,\n caption,\n tags,\n posttype,\n }: { title?: string; caption?: string; tags?: string; posttype?: 'link' | string },\n) {\n assert(url, 'tumblr.url');\n\n return (\n 'https://www.tumblr.com/widgets/share/tool' +\n objectToGetParams({\n canonicalUrl: url,\n title,\n caption,\n tags,\n posttype,\n })\n );\n}\n\ntype Options = {\n title?: string;\n caption?: string;\n posttype?: 'link' | string;\n};\n\nconst TumblrShareButton = createShareButton<\n Options & { tags?: string[] },\n Options & { tags: string }\n>(\n 'tumblr',\n tumblrLink,\n props => ({\n title: props.title,\n tags: (props.tags || []).join(','),\n caption: props.caption,\n posttype: props.posttype || 'link',\n }),\n {\n windowWidth: 660,\n windowHeight: 460,\n },\n);\n\nexport default TumblrShareButton;\n","import jsonp from 'jsonp';\n\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareCount from './hocs/createShareCount';\n\nfunction getTumblrShareCount(shareUrl: string, callback: (shareCount?: number) => void) {\n const endpoint = 'https://api.tumblr.com/v2/share/stats';\n\n return jsonp(\n endpoint +\n objectToGetParams({\n url: shareUrl,\n }),\n (err, data) => {\n callback(!err && data && data.response ? data.response.note_count : undefined);\n },\n );\n}\n\nexport default createShareCount(getTumblrShareCount);\n","import createIcon from './hocs/createIcon';\n\nconst TwitterIcon = createIcon({\n color: '#00aced',\n networkName: 'twitter',\n path: 'M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1 c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,2.9,10.1,2.9c12.1,0,18.7-10,18.7-18.7 c0-0.3,0-0.6,0-0.8C46,24.5,47.1,23.4,48,22.1z',\n});\n\nexport default TwitterIcon;\n","import assert from './utils/assert';\nimport objectToGetParams from './utils/objectToGetParams';\nimport createShareButton from './hocs/createShareButton';\n\nfunction twitterLink(\n url: string,\n {\n title,\n via,\n hashtags = [],\n related = [],\n }: { title?: string; via?: string; hashtags?: string[]; related?: string[] },\n) {\n assert(url, 'twitter.url');\n assert(Array.isArray(hashtags), 'twitter.hashtags is not an array');\n assert(Array.isArray(related), 'twitter.related is not an array');\n\n return (\n 'https://twitter.com/intent/tweet' +\n objectToGetParams({\n url,\n text: title,\n via,\n hashtags: hashtags.length > 0 ? hashtags.join(',') : undefined,\n related: related.length > 0 ? related.join(',') : undefined,\n })\n );\n}\n\nconst TwitterShareButton = createShareButton<{\n title?: string;\n via?: string;\n hashtags?: string[];\n related?: string[];\n}>(\n 'twitter',\n twitterLink,\n props => ({\n hashtags: props.hashtags,\n title: props.title,\n via: props.via,\n related: props.related,\n }),\n {\n windowWidth: 550,\n windowHeight: 400,\n },\n);\n\nexport default TwitterShareButton;\n","import createIcon from './hocs/createIcon';\n\nconst ViberIcon = createIcon({\n color: '#7360f2',\n networkName: 'viber',\n path: 'm31.0,12.3c9.0,0.2 16.4,6.2 18.0,15.2c0.2,1.5 0.3,3.0 0.4,4.6a1.0,1.0 0 0 1 -0.8,1.2l-0.1,0a1.1,1.1 0 0 1 -1.0,-1.2l0,0c-0.0,-1.2 -0.1,-2.5 -0.3,-3.8a16.1,16.1 0 0 0 -13.0,-13.5c-1.0,-0.1 -2.0,-0.2 -3.0,-0.3c-0.6,-0.0 -1.4,-0.1 -1.6,-0.8a1.1,1.1 0 0 1 0.9,-1.2l0.6,0l0.0,-0.0zm10.6,39.2a19.9,19.9 0 0 1 -2.1,-0.6c-6.9,-2.9 -13.2,-6.6 -18.3,-12.2a47.5,47.5 0 0 1 -7.0,-10.7c-0.8,-1.8 -1.6,-3.7 -2.4,-5.6c-0.6,-1.7 0.3,-3.4 1.4,-4.7a11.3,11.3 0 0 1 3.7,-2.8a2.4,2.4 0 0 1 3.0,0.7a39.0,39.0 0 0 1 4.7,6.5a3.1,3.1 0 0 1 -0.8,4.2c-0.3,0.2 -0.6,0.5 -1.0,0.8a3.3,3.3 0 0 0 -0.7,0.7a2.1,2.1 0 0 0 -0.1,1.9c1.7,4.9 4.7,8.7 9.7,10.8a5.0