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IAAKJ,EAAMhB,KACXF,UAAU,WACV,aAAW,UAIjBpB,EAAAA,cAAA,WACEA,EAAAA,cAAA,OAAKoB,UAAU,+BACXO,KAAKC,EAAE,gCAEX5B,EAAAA,cAAA,OAAKoB,UAAU,8BACXkB,EAAMhB,QAMdiB,EAASiB,SAAWxD,EAAAA,cAACwC,EAAoB,QAMjDxC,EAAAA,cAAA,OAAKoB,UAAU,+DACViB,GAAaE,EAASiB,SAAWxD,EAAAA,cAACwC,EAAoB,OAIjE,C","sources":["webpack:///./app/javascript/components/DetailedViewHeader/Contacts/SmallContactBlock.jsx","webpack:///./app/javascript/components/DetailedViewHeader/Contacts/index.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CryptoJS from \"crypto-js\";\n\nimport { postLocationContactDetailsShown } from '../../../utils/api';\nimport { SvgIco } from '../../SharedComponents/Icons';\n\n\nconst SmallContactBlock = ({ addressLine1,\n                             contact,\n                             locationId,\n                             siteKey,\n                             streetName,\n                           }) => {\n\n  const [isContactsShown, setIsContactsShown] = useState(false);\n  const [contactEmail, setContactEmail] = useState(null);\n\n  const address = streetName || addressLine1;\n\n\n  const handleEmail = () => {\n    const encodedEmail = CryptoJS.enc.Base64.parse(contact.tag);\n    const key = CryptoJS.enc.Utf8.parse('75smg2w68qmy2ori75smg2w68qmy2ori');\n    const iv = CryptoJS.enc.Utf8.parse('javatzwkbnkmih8t');\n    const decryptEmail  = CryptoJS.AES.decrypt({ ciphertext: encodedEmail }, key, { iv: iv, mode: CryptoJS.mode.CBC });\n    const originalEmail = decryptEmail.toString(CryptoJS.enc.Utf8);\n\n    return originalEmail;\n  };\n\n  const handleClick = () => {\n    setIsContactsShown(true);\n    setContactEmail(handleEmail());\n    postLocationContactDetailsShown(locationId)\n      .catch(error => console.log('Error: ', error));\n  };\n\n\n  return (\n    <div onClick={handleClick}>\n      <div className=\"contact-info-content__info-links\">\n        <SvgIco name=\"phone\" size={22}/>\n        { isContactsShown\n          ? <a className=\"contact-info-content__info-phone-link\" href={`tel://${contact.phone}`}>{ contact.phone }</a>\n          : I18n.t('generic.show_phone_number')\n        }\n      </div>\n      <div className=\"contact-info-content__info-links\">\n        <SvgIco name=\"mail\" size={22}/>\n        { isContactsShown\n          ? (siteKey === 'dk'\n              ?\n                <a href={`mailto:${contactEmail}?subject=Vedr.%20${address}%20på%20Lokalebasen.dk&body=%0D%0AHej%20${contact.name}%0D%0A%0D%0A%0D%0AJeg%20er%20interesseret%20I%20at%20høre%20mere%20om%20lejemålet%20på%20https://www.lokalebasen.dk/%20:%0D%0A%0D%0A${window.location.href}`}>\n                  { contactEmail }\n                </a>\n              :\n                <a href={`mailto:${contactEmail}?subject=Questions%20regarding%20${address}%20on%20Matchoffice.com&body=%0D%0AHi%20${contact.name}%0D%0A%0D%0A%0D%0AI%20would%20like%20to%20know%20more%20about%20commercial%20lease%20found%20on%20https://matchoffice.com%20:%0D%0A%0D%0A${window.location.href}`}>\n                  { contactEmail }\n                </a>\n            )\n          : I18n.t('generic.show_email')\n        }\n      </div>\n    </div>\n  )\n};\n\n\nexport default SmallContactBlock;\n","import React, { Fragment, useContext } from 'react';\n\nimport partnerBadge from \"../../../src/images/premium-partner-badge.png\";\nimport PersonPlaceholder from \"../../../src/images/placeholder_person.png\";\nimport { postLocationProviderAdvertsShown } from \"../../../utils/api\";\nimport SmallContactBlock from \"./SmallContactBlock\";\nimport { Context } from \"../index\";\n\nimport './index.sass';\n\n\nconst Contacts = () => {\n\n  const {\n    location: { addressLine1 },\n    locationClosed,\n    locationContactDetails,\n    locationId,\n    partnerBadgeUrl,\n    siteKey,\n    streetName,\n  } = useContext(Context);\n\n  const { available, contact, owner, provider } = locationContactDetails;\n\n\n  const ProviderBadgeSection = () => (\n    <div className=\"contact-info-content\">\n      <div className=\"contact-info-content__logo-wrapper\">\n        <img\n          data-src={partnerBadge}\n          alt={'Premium partner logo'}\n          className=\"lazyload\"\n          data-sizes=\"auto\"\n          data-expand=\"100\"\n          height={56}\n          width={56}\n        />\n      </div>\n      <div>\n        <div className=\"contact-info-content__title\">\n          { I18n.t('partner_badge.title') }\n        </div>\n        <div className=\"contact-info-content__name\">\n          { I18n.t('partner_badge.name') }\n        </div>\n        <a href={partnerBadgeUrl} className=\"contact-info-content__partner-link\">\n          { I18n.t('generic.read_more') }\n        </a>\n      </div>\n    </div>\n  );\n\n\n  return (\n    <Fragment>\n\n      { available && (\n        <div className=\"section contact-info-block\">\n          <p>{ I18n.t('generic.contact_details') }</p>\n\n          <div className=\"dv-info-section__contact-info-wrapper\">\n\n            { !locationClosed &&\n              <div className=\"contact-info-content\">\n                <div className=\"contact-info-content__photo-wrapper\">\n                  <img\n                    data-src={contact.photo || PersonPlaceholder}\n                    className=\"lazyload\"\n                    data-sizes=\"auto\"\n                    alt=\"Person\"\n                    height={56}\n                    width={56}\n                  />\n                </div>\n                <div>\n                  <div className=\"contact-info-content__title\">\n                    { I18n.t('generic.contact_person') }\n                  </div>\n                  <div className=\"contact-info-content__name\">\n                    { contact.name }\n                  </div>\n                  <SmallContactBlock\n                    contact={contact}\n                    locationId={locationId}\n                    siteKey={siteKey}\n                    streetName={streetName}\n                    addressLine1={addressLine1}\n                  />\n                </div>\n              </div>\n            }\n\n            <div className=\"contact-info-content\">\n              { provider.logo &&\n                <div className=\"contact-info-content__logo-wrapper\">\n                  <img\n                    data-src={provider.logo}\n                    alt={provider.name}\n                    className=\"lazyload\"\n                    data-sizes=\"auto\"\n                    width={56}\n                  />\n                </div>\n              }\n              <div className={`contact-info-content__provider-info ${!provider.logo ? 'with-indentation' : ''}`}>\n                <div className=\"contact-info-content__title\">\n                  { provider.title }\n                </div>\n\n                <div className=\"contact-info-content__name\">\n                  { provider.name }\n                </div>\n\n                { provider.info &&\n                  <a onClick={postLocationProviderAdvertsShown(locationId)} href={provider.info}>\n                    { I18n.t('generic.read_more') }\n                  </a>\n                }\n\n                { !locationClosed &&\n                  <div\n                    onClick={postLocationProviderAdvertsShown(locationId)}\n                    dangerouslySetInnerHTML={{ __html: provider.advertLink }}\n                  />\n                }\n              </div>\n            </div>\n\n            { owner && (owner.name || owner.logo) &&\n              <div className=\"contact-info-content\">\n                { owner.logo &&\n                  <div className=\"contact-info-content__logo-wrapper\">\n                    <img\n                      data-src={owner.logo}\n                      alt={owner.name}\n                      className=\"lazyload\"\n                      data-sizes=\"auto\"\n                    />\n                  </div>\n                }\n                <div>\n                  <div className=\"contact-info-content__title\">\n                    { I18n.t('locations.owner_box.heading') }\n                  </div>\n                  <div className=\"contact-info-content__name\">\n                    { owner.name }\n                  </div>\n                </div>\n              </div>\n            }\n\n            { provider.partner && <ProviderBadgeSection /> }\n\n          </div>\n        </div>\n      )}\n\n      <div className=\"contact-info-block contact-info-block--provider-badge-only\">\n        { !available && provider.partner && <ProviderBadgeSection /> }\n      </div>\n    </Fragment>\n  )\n}\n\nexport default Contacts;\n"],"names":["_ref","addressLine1","contact","locationId","siteKey","streetName","_useState","useState","_useState2","_slicedToArray","isContactsShown","setIsContactsShown","_useState3","_useState4","contactEmail","setContactEmail","address","React","onClick","encodedEmail","key","iv","CryptoJS","Base64","parse","tag","Utf8","decrypt","ciphertext","mode","CBC","toString","postLocationContactDetailsShown","catch","error","console","log","className","SvgIco","name","size","href","concat","phone","I18n","t","window","location","_useContext","useContext","Context","locationClosed","locationContactDetails","partnerBadgeUrl","available","owner","provider","ProviderBadgeSection","partnerBadge","alt","height","width","Fragment","photo","PersonPlaceholder","SmallContactBlock","logo","title","info","postLocationProviderAdvertsShown","dangerouslySetInnerHTML","__html","advertLink","partner"],"sourceRoot":""}