"use strict";(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[459628],{454908:(e,t,r)=>{r.r(t),r.d(t,{WatermarkContainer:()=>s});var n=r(513432),a=r.n(n),i=(0,r(391567).O)({watermarkContainer:{qhf8xq:"f1euv43f",Bkecrkj:"f1aehjj5"},watermarkText:{Bhrd7zp:"f16wzh4i",ojy3ng:"f950ohy",B4ocmvd:"f1yic3nx",Bkfmm31:"f1pqnrdu",Bj69cb8:"f1z00a6s"}}),o=function(e){var t=e.id,r=e.text,a=e.width,o=e.height,l=e.offset,u=e.filter,d=i(),s=n.useRef(null),h=n.useRef(null),f=c(a,o),m=f.scaledFontSize,v=f.scaledBorderSize,g=f.scaledHorizontalGap,w=f.scaledVerticalGap;return n.useLayoutEffect((function(){var e=s.current,t=h.current;if(e&&t){var r=e.getBoundingClientRect(),n=r.width+Math.min(150,r.width*g),a=r.height*(w+1);t.setAttribute("width",n.toString()),t.setAttribute("height",a.toString());var i=.5*a;if(e.setAttribute("y",i.toString()),l){var o=n*l,c=a*l;t.setAttribute("x",o.toString()),t.setAttribute("y",c.toString())}}}),[s,h,m,v,g,w,l]),n.createElement("pattern",{id:t,patternUnits:"userSpaceOnUse",patternTransform:"rotate(-30)",ref:h},n.createElement("text",{className:d.watermarkText,fontSize:m,strokeWidth:v,filter:u,ref:s,fillOpacity:.3},r))},c=function(e,t){var r=Math.min(e,t)/800;return{scaledFontSize:Math.min(48,Math.max(18,24*r)),scaledHorizontalGap:Math.min(.5,Math.max(.25,.5*r)),scaledVerticalGap:Math.min(6,Math.max(3,6*r)),scaledBorderSize:Math.max(1,r)}},l=function(e){var t=e.text,r=e.width,a=e.height,c=e.svgRef,l=i().watermarkContainer,u="svgShadowId",d="svgFirstPatternId",s="svgSecondPatternId",h="url(#".concat(u,")");return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",className:l,ref:c,"data-testid":"watermark-tiled-pattern"},n.createElement("defs",null,n.createElement("filter",{id:u},n.createElement("feDropShadow",{dx:"0.5",dy:"0.5",stdDeviation:"1",floodColor:"black",floodOpacity:"0.1"})),n.createElement(o,{id:d,text:t,width:r,height:a,filter:h}),n.createElement(o,{id:s,text:t,width:r,height:a,offset:.5,filter:h})),n.createElement("rect",{width:"100%",height:"100%",fill:"url(#".concat(d,")")}),n.createElement("rect",{width:"100%",height:"100%",fill:"url(#".concat(s,")")}))},u=function(e,t,r){var a=n.useRef();n.useEffect((function(){var n,i=function(){var e;return null===(e=a.current)||void 0===e?void 0:e.disconnect()};i();var o=e();return o&&(a.current=new MutationObserver(t),null===(n=a.current)||void 0===n||n.observe(o,r)),i}),[e,t,r])},d=function(e){var t=e.context,r=e.text,a=e.width,i=e.height,o=n.useRef(null),c=n.useCallback((function(e){for(var r=0,n=e;r<n.length;r++){n[r].removedNodes.forEach((function(e){"svg"!==e.nodeName||t.log.warn("PlayerError","svg node removed",{name:"onParentMutation",isExpected:!0})}))}}),[t.log]);u((function(){var e;return null===(e=o.current)||void 0===e?void 0:e.parentElement}),c,{childList:!0});var d=n.useRef();d.current=void 0,n.useEffect((function(){var e;d.current=null===(e=o.current)||void 0===e?void 0:e.outerHTML}));var s=n.useCallback((function(){var e;d.current&&(null===(e=o.current)||void 0===e?void 0:e.outerHTML)!==d.current&&t.log.warn("PlayerError","svg node modified",{name:"onMutation",isExpected:!0})}),[t.log]);return u((function(){return o.current}),s,{attributes:!0,childList:!0,subtree:!0}),n.createElement(l,{text:r,svgRef:o,width:a,height:i})};var s=function(e){var t,r,n,i,o,c,l=e.width,u=e.height,s=e.userEmail,h=e.context,f=h.loc.getString("WatermarkAnonymousOverlay");if(s){h.log.appLogic("PlayerAppLogic",{name:"WatermarkAuthorizedUser"});var m=(r=17,n=(t=s).match(/^(.+)@([^@]+)$/),i=null==n?void 0:n[2],o=3===(null==n?void 0:n.length)?n[1]:t,c=o.length>r?"".concat(o.slice(0,r),"***"):o,i?"".concat(c,"@").concat(i):c);m?f=m:h.log.warn("PlayerError","Failed to parse user email",{name:"renderWatermarkOverlay",isExpected:!1})}else h.log.appLogic("PlayerAppLogic",{name:"WatermarkAnonymousUser"});return a().createElement(d,{width:l,height:u,text:f,context:h})}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/watermarkContainer-cd329e5df573890b.js.map