"use strict";(("undefined"!=typeof self?self:this).webpackJsonp__wix_communities_blog_ooi=("undefined"!=typeof self?self:this).webpackJsonp__wix_communities_blog_ooi||[]).push([[4123],{60912:(e,t,n)=>{n.d(t,{BL:()=>m,By:()=>i,C6:()=>s,Dl:()=>a,EL:()=>l,EU:()=>o,H1:()=>u,MO:()=>d,Oq:()=>r,Sk:()=>c,tq:()=>h});const a="HtmlComponent",i="iframeComponent",o="baseToolbarButton_edit",s="htmlEditPanel",r="htmlEditPanel_htmlRadioGroup",l="htmlEditPanel_radioHtml",d="htmlEditPanel_radioUrl",m="htmlEditPanel_htmlInput",h="htmlEditPanel_urlInput",c="htmlEditPanel_Cancel",u="htmlEditPanel_Update"},38551:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var a=n(60751),i=n.n(a),o=n(82569),s=n(26637),r=n(97635);var l=({node:e,nodeIndex:t,NodeViewContainer:n})=>{const{iframeSandboxDomain:l,config:d}=(0,a.useContext)(o.u);return i().createElement(n,{node:e,nodeIndex:t},i().createElement(r.a,{componentData:e.htmlData,settings:d[s.d],iframeSandboxDomain:l,isViewer:!0}))}},97635:(e,t,n)=>{n.d(t,{a:()=>E});var a=n(60751),i=n.n(a),o=n(47574),s=n(80134),r=n(60912),l=n(48396);var d=n(62688),m=n.n(d),h="_2SEXw";var c=({iframeRef:e,isViewer:t,...n})=>{const{tabIndex:s}=(0,a.useContext)(o.iB);return i().createElement("iframe",{ref:e,className:h,title:"remote content","data-hook":r.By,style:{backgroundColor:"transparent"},allow:t?"fullscreen; autoplay; encrypted-media":"fullscreen; encrypted-media",allowFullScreen:!0,...n,tabIndex:s})},u=Object.defineProperty,p=(e,t,n)=>((e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const f="undefined"==typeof window;class g extends a.Component{constructor(){super(...arguments),p(this,"state",{shouldRender:!1}),p(this,"id",Math.random().toString(36).substr(2,9)),p(this,"updateIframeContent",(e=>{this.shouldIgnoreLoad=!0,this.iframe?.contentWindow.postMessage({type:"htmlPlugin:updateContent",id:this.id,content:e},"*")})),p(this,"handleIframeMessage",(({data:e})=>{const{type:t,id:n,height:a}=e;"htmlPlugin:heightResize"===t&&n===this.id&&this.props.onHeightChange(a)})),p(this,"handleIframeLoad",(()=>{!this.shouldIgnoreLoad&&this.updateIframeContent(this.props.html)}))}componentDidMount(){this.setState({shouldRender:!0}),!f&&window.addEventListener("message",this.handleIframeMessage)}componentWillUnmount(){!f&&window.removeEventListener("message",this.handleIframeMessage)}componentWillReceiveProps(e){this.props.html!==e.html&&this.updateIframeContent(e.html)}render(){const{iframeSandboxDomain:e,isViewer:t}=this.props,n=e.replace(/\/$/,"");return this.state.shouldRender?i().createElement(c,{style:{backgroundColor:"transparent"},onLoad:this.handleIframeLoad,iframeRef:e=>this.iframe=e,isViewer:t,src:n+"/html/2b2e4b_d767b483cae16e027c4ea8ac7906fbf4.html"}):null}}g.propTypes={html:m().string.isRequired,onHeightChange:m().any,iframeSandboxDomain:m().string,isViewer:m().bool};var w=g;var b=e=>i().createElement(c,{...e,sandbox:"allow-popups allow-presentation allow-forms allow-same-origin allow-scripts"}),x="_-5jxR",y="xTpaH";const E=({settings:e,componentData:t,iframeSandboxDomain:n,isViewer:d=!1})=>{const{isMobile:m}=(0,a.useContext)(o.iB),[h,c]=i().useState(null),[u,p]=i().useState();(0,a.useEffect)((()=>{const{width:n,height:a}=e,{containerData:i}=t;i.width||(i.width=n?{custom:n}:h?{custom:h.getBoundingClientRect().width}:{custom:l.ec}),i.height||(i.height={custom:a||l.rU})}),[h]);const f={width:m?"auto":t.containerData.width?.custom||e.width||l.ec+"px",height:(()=>{const{containerData:n}=t,a=u&&Math.min(50,.1*u);let i=u;const o=n.height?.custom;if(o){if("string"==typeof o&&o.endsWith("%"))return i||e.height||l.rU;isNaN(parseInt(o))||(i=u&&ou?u:o)}return i||e.height||l.rU})()+"px",maxHeight:u};let g;if(t.html){const n=(e=>{if(!e)return;const t=/http.+com/gm.exec(e);return t?t[0]:void 0})(e.siteDomain);g=((e,t)=>{const n=e?.includes("adsbygoogle"),a=e?.includes("data-page-url=");if(t&&n&&!a){const n=`{e>0&&e!==u&&p(e)},isViewer:d}):t.url&&(0,s.containsUrl)(t.url)?i().createElement(b,{key:l.GG,tabIndex:0,src:(0,s.normalizeUrl)(t.url),isViewer:d}):i().createElement("div",{className:y}))}}}]); //# sourceMappingURL=ricos_plugin_html.chunk.min.js.map