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,MAAM,iCAAyB,IAAAH,EAAAA,EAAI,IAAI,GAClEI,GAA0D,QAA9CH,EAACF,EAAcI,MAAM,iCAAyB,IAAAF,EAAAA,EAAI,IAAI,GAExE,GAAIC,GAAaE,EAAW,CACxB,MAAMC,EAASC,KAAKC,MAAML,EAAYE,GACtCL,EAAgBA,EAAcD,QAC1B,QAAQ,eAADjC,OACQqC,EAAS,cAAArC,OAAawC,EAAM,MAEnD,CAEA,OAAON,CAAa,GAE5B,CAEA,SAASzB,IACL,OADuCI,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAC3BoB,QAAQ,mCAAmC,CAACC,EAAeS,KACtE,MAAMC,GAAcC,EAAAA,EAAAA,GAA0BF,GAE9C,OAAIC,EAAY9B,OAAS,EACf,oDAANd,OAEU4C,EACGE,KACGC,IAAA,IAAC,OAAEC,EAAM,MAAEC,GAAOF,EAAA,yBAAA/C,OAAwBgD,EAAM,aAAAhD,OAAYiD,EAAK,WAEpEC,KAAK,MAAK,0BAAAlD,OACbkC,EAAa,8CAIhBA,CACX,GAER,CAEA,SAASxB,IACL,OAD6BG,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IACjBoB,QAAQ,cAAc,IAC1B,8BAEf,CAEA,MAAMJ,EAAesB,IAAA,IAAC,qBAAE1D,EAAoB,sBAAEqC,GAAuBqB,EAAA,eAAAnD,OAC/DoD,EAAAA,GAAW,UAAApD,OACXqD,EAAAA,GAAY,UAAArD,OACZ8B,EAAqB,UAAA9B,OACrBP,GAAoB,cAAiB,oKAAAO,OAIGsD,EAAc,sCAItDA,EAAc,w7D","sources":["client/components/TextBoxClient.js"],"sourcesContent":["import React, { useMemo, useLayoutEffect, useRef } from 'react';\nimport sanitizeHtml from 'sanitize-html';\nimport PropTypes from 'prop-types';\nimport { css } from '@emotion/core';\nimport { froalaStyle, textBoxStyle } from 'fever-froala-editor/src/lib/cssFroala';\nimport { stylePropType } from 'utils/propTypes';\nimport generatePictureSourceData from 'client/utils/generatePictureSourceData';\nimport useGetFontFamilyByI18nLang from 'hooks/useGetFontFamilyByI18nLang';\nimport { IS_EDITOR_MODE } from 'config/envVariable';\n\nfunction TextBoxClient({\n onClick = () => {},\n style,\n content,\n ignoreContentPadding = false,\n shouldUseCompressedImg = false\n}) {\n const fontFamily = useGetFontFamilyByI18nLang({ isClient: !IS_EDITOR_MODE });\n const fontFamilyBaseOnLang = `\n font-family: \"${fontFamily}\";\n `;\n const divRef = useRef();\n const __html = useMemo(() => {\n let processes = [sanitizeHtml, setImageLazyloadStyle];\n if (shouldUseCompressedImg) {\n processes.push(replaceImageWithCompressed);\n }\n processes.push(replaceEmptyLink);\n\n return processCallbacks(content, processes);\n }, [shouldUseCompressedImg, content]);\n\n useLayoutEffect(() => {\n if (divRef.current) {\n const imgs = divRef.current.querySelectorAll('img');\n imgs.forEach(img => {\n img.onload = () => {\n img.classList.remove('lazyload');\n };\n });\n }\n }, [__html]);\n\n return (\n