import{r as De,j as F}from"./index-DAC_nvu_.js";import{a as wn,S as kt}from"./VideoPlayer-COpZnroV.js";const Cn="_carouselContainer_ekvxp_1",Mn="_carousel_ekvxp_1",xn="_carouselItem_ekvxp_22",Pn="_carouselPlaceholderIcon_ekvxp_34",kn="_imageClip_ekvxp_40",vn="_previewImage_ekvxp_47",Un="_scrollButton_ekvxp_54",Fn="_scrollButtonRight_ekvxp_67",zn="_scrollButtonLeft_ekvxp_72",Hn="_scrollIcon_ekvxp_77",Bn="_scrollIconLeft_ekvxp_81",x={carouselContainer:Cn,carousel:Mn,carouselItem:xn,carouselPlaceholderIcon:Pn,imageClip:kn,previewImage:vn,scrollButton:Un,scrollButtonRight:Fn,scrollButtonLeft:zn,scrollIcon:Hn,scrollIconLeft:Bn},Io=({photos:n,className:o=""})=>{const s=De.useRef(null),[l,u]=De.useState(!1),[m,S]=De.useState(!1),G=()=>{const y=s.current;y&&(u(y.scrollWidth-y.clientWidth-y.scrollLeft>4),S(y.scrollLeft>4))};De.useEffect(()=>{G()},[n]);const L=()=>{var y;(y=s.current)==null||y.scrollBy({left:220,behavior:"smooth"})},q=()=>{var y;(y=s.current)==null||y.scrollBy({left:-220,behavior:"smooth"})};return n.length===0?null:F.jsxs("div",{className:`${x.carouselContainer} ${o}`.trim(),children:[F.jsx("div",{className:x.carousel,ref:s,onScroll:G,children:n.map((y,te)=>F.jsx("div",{className:x.carouselItem,children:y?F.jsx("div",{className:x.imageClip,children:F.jsx("img",{src:y,alt:"",className:x.previewImage})}):F.jsx(wn,{className:x.carouselPlaceholderIcon})},te))}),m&&F.jsx("button",{type:"button",className:`${x.scrollButton} ${x.scrollButtonLeft}`,onClick:q,"aria-label":"Назад",children:F.jsx(kt,{className:`${x.scrollIcon} ${x.scrollIconLeft}`})}),l&&F.jsx("button",{type:"button",className:`${x.scrollButton} ${x.scrollButtonRight}`,onClick:L,"aria-label":"Дальше",children:F.jsx(kt,{className:x.scrollIcon})})]})};/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */function vt(n,o){(o==null||o>n.length)&&(o=n.length);for(var s=0,l=Array(o);s<o;s++)l[s]=n[s];return l}function Gn(n){if(Array.isArray(n))return n}function Wn(n,o){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var l,u,m,S,G=[],L=!0,q=!1;try{if(m=(s=s.call(n)).next,o!==0)for(;!(L=(l=m.call(s)).done)&&(G.push(l.value),G.length!==o);L=!0);}catch(y){q=!0,u=y}finally{try{if(!L&&s.return!=null&&(S=s.return(),Object(S)!==S))return}finally{if(q)throw u}}return G}}function jn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yn(n,o){return Gn(n)||Wn(n,o)||$n(n,o)||jn()}function $n(n,o){if(n){if(typeof n=="string")return vt(n,o);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?vt(n,o):void 0}}const Kt=Object.entries,Ut=Object.setPrototypeOf,Xn=Object.isFrozen,Vn=Object.getPrototypeOf,qn=Object.getOwnPropertyDescriptor;let I=Object.freeze,N=Object.seal,ce=Object.create,Zt=typeof Reflect<"u"&&Reflect,nt=Zt.apply,ot=Zt.construct;I||(I=function(o){return o});N||(N=function(o){return o});nt||(nt=function(o,s){for(var l=arguments.length,u=new Array(l>2?l-2:0),m=2;m<l;m++)u[m-2]=arguments[m];return o.apply(s,u)});ot||(ot=function(o){for(var s=arguments.length,l=new Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];return new o(...l)});const he=A(Array.prototype.forEach),Kn=A(Array.prototype.lastIndexOf),Ft=A(Array.prototype.pop),le=A(Array.prototype.push),Zn=A(Array.prototype.splice),V=Array.isArray,Ae=A(String.prototype.toLowerCase),Ze=A(String.prototype.toString),zt=A(String.prototype.match),ge=A(String.prototype.replace),Ht=A(String.prototype.indexOf),Jn=A(String.prototype.trim),Qn=A(Number.prototype.toString),eo=A(Boolean.prototype.toString),Bt=typeof BigInt>"u"?null:A(BigInt.prototype.toString),Gt=typeof Symbol>"u"?null:A(Symbol.prototype.toString),R=A(Object.prototype.hasOwnProperty),Ee=A(Object.prototype.toString),O=A(RegExp.prototype.test),ee=to(TypeError);function A(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var s=arguments.length,l=new Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];return nt(n,o,l)}}function to(n){return function(){for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return ot(n,s)}}function f(n,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ae;if(Ut&&Ut(n,null),!V(o))return n;let l=o.length;for(;l--;){let u=o[l];if(typeof u=="string"){const m=s(u);m!==u&&(Xn(o)||(o[l]=m),u=m)}n[u]=!0}return n}function no(n){for(let o=0;o<n.length;o++)R(n,o)||(n[o]=null);return n}function w(n){const o=ce(null);for(const l of Kt(n)){var s=Yn(l,2);const u=s[0],m=s[1];R(n,u)&&(V(m)?o[u]=no(m):m&&typeof m=="object"&&m.constructor===Object?o[u]=w(m):o[u]=m)}return o}function oo(n){switch(typeof n){case"string":return n;case"number":return Qn(n);case"boolean":return eo(n);case"bigint":return Bt?Bt(n):"0";case"symbol":return Gt?Gt(n):"Symbol()";case"undefined":return Ee(n);case"function":case"object":{if(n===null)return Ee(n);const o=n,s=H(o,"toString");if(typeof s=="function"){const l=s(o);return typeof l=="string"?l:Ee(l)}return Ee(n)}default:return Ee(n)}}function H(n,o){for(;n!==null;){const l=qn(n,o);if(l){if(l.get)return A(l.get);if(typeof l.value=="function")return A(l.value)}n=Vn(n)}function s(){return null}return s}function ro(n){try{return O(n,""),!0}catch{return!1}}const Wt=I(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Je=I(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qe=I(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),io=I(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),et=I(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),so=I(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jt=I(["#text"]),Yt=I(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),tt=I(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$t=I(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),we=I(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ao=N(/{{[\w\W]*|^[\w\W]*}}/g),lo=N(/<%[\w\W]*|^[\w\W]*%>/g),co=N(/\${[\w\W]*/g),uo=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),fo=N(/^aria-[\-\w]+$/),Xt=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),po=N(/^(?:\w+script|data):/i),mo=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),To=N(/^html$/i),_o=N(/^[a-z][.\w]*(-[.\w]+)+$/i),Vt=N(/<[/\w!]/g),ho=N(/<[/\w]/g),go=N(/<\/no(script|embed|frames)/i),Eo=N(/\/>/i),z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ao=function(){return typeof window>"u"?null:window},So=function(o,s){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let l=null;const u="data-tt-policy-suffix";s&&s.hasAttribute(u)&&(l=s.getAttribute(u));const m="dompurify"+(l?"#"+l:"");try{return o.createPolicy(m,{createHTML(S){return S},createScriptURL(S){return S}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},qt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},X=function(o,s,l,u){return R(o,s)&&V(o[s])?f(u.base?w(u.base):{},o[s],u.transform):l};function Jt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ao();const o=i=>Jt(i);if(o.version="3.4.11",o.removed=[],!n||!n.document||n.document.nodeType!==z.document||!n.Element)return o.isSupported=!1,o;let s=n.document;const l=s,u=l.currentScript;n.DocumentFragment;const m=n.HTMLTemplateElement,S=n.Node,G=n.Element,L=n.NodeFilter,q=n.NamedNodeMap;q===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,te=n.trustedTypes,K=G.prototype,Qt=H(K,"cloneNode"),rt=H(K,"remove"),en=H(K,"nextSibling"),ue=H(K,"childNodes"),fe=H(K,"parentNode"),it=H(K,"shadowRoot"),Ce=H(K,"attributes"),M=S&&S.prototype?H(S.prototype,"nodeType"):null,W=S&&S.prototype?H(S.prototype,"nodeName"):null;if(typeof m=="function"){const i=s.createElement("template");i.content&&i.content.ownerDocument&&(s=i.content.ownerDocument)}let C,Z="",Me,st=!1,pe=0;const at=function(){if(pe>0)throw ee('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ne=function(e){at(),pe++;try{return C.createHTML(e)}finally{pe--}},tn=function(e){at(),pe++;try{return C.createScriptURL(e)}finally{pe--}},nn=function(){return st||(Me=So(te,u),st=!0),Me},Se=s,xe=Se.implementation,lt=Se.createNodeIterator,on=Se.createDocumentFragment,rn=Se.getElementsByTagName,sn=l.importNode;let g=qt();o.isSupported=typeof Kt=="function"&&typeof fe=="function"&&xe&&xe.createHTMLDocument!==void 0;const an=ao,ln=lo,cn=co,un=uo,fn=fo,pn=po,ct=mo,mn=_o;let ut=Xt,d=null;const ft=f({},[...Wt,...Je,...Qe,...et,...jt]);let T=null;const pt=f({},[...Yt,...tt,...$t,...we]);let _=Object.seal(ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,mt=null;const j=Object.seal(ce(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let dt=!0,Pe=!0,Tt=!1,_t=!0,Y=!1,de=!0,J=!1,ke=!1,ve=null,Ue=null,Fe=!1,oe=!1,ye=!1,be=!1,ht=!0,gt=!1;const Et="user-content-";let ze=!0,He=!1,re={},v=null;const Be=f({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let At=null;const St=f({},["audio","video","img","source","image","track"]);let Ge=null;const yt=f({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Re="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",U="http://www.w3.org/1999/xhtml";let ie=U,We=!1,je=null;const dn=f({},[Re,Oe,U],Ze),bt=I(["mi","mo","mn","ms","mtext"]);let Ye=f({},bt);const Rt=I(["annotation-xml"]);let $e=f({},Rt);const Tn=f({},["title","style","font","a","script"]);let Te=null;const _n=["application/xhtml+xml","text/html"],hn="text/html";let h=null,se=null;const gn=s.createElement("form"),Ot=function(e){return e instanceof RegExp||e instanceof Function},Xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(se&&se===e)return;(!e||typeof e!="object")&&(e={}),e=w(e),Te=_n.indexOf(e.PARSER_MEDIA_TYPE)===-1?hn:e.PARSER_MEDIA_TYPE,h=Te==="application/xhtml+xml"?Ze:Ae,d=X(e,"ALLOWED_TAGS",ft,{transform:h}),T=X(e,"ALLOWED_ATTR",pt,{transform:h}),je=X(e,"ALLOWED_NAMESPACES",dn,{transform:Ze}),Ge=X(e,"ADD_URI_SAFE_ATTR",yt,{transform:h,base:yt}),At=X(e,"ADD_DATA_URI_TAGS",St,{transform:h,base:St}),v=X(e,"FORBID_CONTENTS",Be,{transform:h}),me=X(e,"FORBID_TAGS",w({}),{transform:h}),mt=X(e,"FORBID_ATTR",w({}),{transform:h}),re=R(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?w(e.USE_PROFILES):e.USE_PROFILES:!1,dt=e.ALLOW_ARIA_ATTR!==!1,Pe=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_t=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,de=e.SAFE_FOR_XML!==!1,J=e.WHOLE_DOCUMENT||!1,oe=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,be=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,ht=e.SANITIZE_DOM!==!1,gt=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,He=e.IN_PLACE||!1,ut=ro(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Xt,ie=typeof e.NAMESPACE=="string"?e.NAMESPACE:U,Ye=R(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?w(e.MATHML_TEXT_INTEGRATION_POINTS):f({},bt),$e=R(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?w(e.HTML_INTEGRATION_POINTS):f({},Rt);const t=R(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?w(e.CUSTOM_ELEMENT_HANDLING):ce(null);if(_=ce(null),R(t,"tagNameCheck")&&Ot(t.tagNameCheck)&&(_.tagNameCheck=t.tagNameCheck),R(t,"attributeNameCheck")&&Ot(t.attributeNameCheck)&&(_.attributeNameCheck=t.attributeNameCheck),R(t,"allowCustomizedBuiltInElements")&&typeof t.allowCustomizedBuiltInElements=="boolean"&&(_.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),N(_),Y&&(Pe=!1),ye&&(oe=!0),re&&(d=f({},jt),T=ce(null),re.html===!0&&(f(d,Wt),f(T,Yt)),re.svg===!0&&(f(d,Je),f(T,tt),f(T,we)),re.svgFilters===!0&&(f(d,Qe),f(T,tt),f(T,we)),re.mathMl===!0&&(f(d,et),f(T,$t),f(T,we))),j.tagCheck=null,j.attributeCheck=null,R(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?j.tagCheck=e.ADD_TAGS:V(e.ADD_TAGS)&&(d===ft&&(d=w(d)),f(d,e.ADD_TAGS,h))),R(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?j.attributeCheck=e.ADD_ATTR:V(e.ADD_ATTR)&&(T===pt&&(T=w(T)),f(T,e.ADD_ATTR,h))),R(e,"ADD_URI_SAFE_ATTR")&&V(e.ADD_URI_SAFE_ATTR)&&f(Ge,e.ADD_URI_SAFE_ATTR,h),R(e,"FORBID_CONTENTS")&&V(e.FORBID_CONTENTS)&&(v===Be&&(v=w(v)),f(v,e.FORBID_CONTENTS,h)),R(e,"ADD_FORBID_CONTENTS")&&V(e.ADD_FORBID_CONTENTS)&&(v===Be&&(v=w(v)),f(v,e.ADD_FORBID_CONTENTS,h)),ze&&(d["#text"]=!0),J&&f(d,["html","head","body"]),d.table&&(f(d,["tbody"]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ee('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=C;C=e.TRUSTED_TYPES_POLICY;try{Z=ne("")}catch(a){throw C=r,a}}else e.TRUSTED_TYPES_POLICY===null?(C=void 0,Z=""):(C===void 0&&(C=nn()),C&&typeof Z=="string"&&(Z=ne("")));I&&I(e),se=e},It=f({},[...Je,...Qe,...io]),Nt=f({},[...et,...so]),En=function(e,t,r){return t.namespaceURI===U?e==="svg":t.namespaceURI===Re?e==="svg"&&(r==="annotation-xml"||Ye[r]):!!It[e]},An=function(e,t,r){return t.namespaceURI===U?e==="math":t.namespaceURI===Oe?e==="math"&&$e[r]:!!Nt[e]},Sn=function(e,t,r){return t.namespaceURI===Oe&&!$e[r]||t.namespaceURI===Re&&!Ye[r]?!1:!Nt[e]&&(Tn[e]||!It[e])},yn=function(e){let t=fe(e);(!t||!t.tagName)&&(t={namespaceURI:ie,tagName:"template"});const r=Ae(e.tagName),a=Ae(t.tagName);return je[e.namespaceURI]?e.namespaceURI===Oe?En(r,t,a):e.namespaceURI===Re?An(r,t,a):e.namespaceURI===U?Sn(r,t,a):!!(Te==="application/xhtml+xml"&&je[e.namespaceURI]):!1},$=function(e){le(o.removed,{element:e});try{fe(e).removeChild(e)}catch{if(rt(e),!fe(e))throw ee("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Lt=function(e){const t=ue(e);if(t){const a=[];he(t,c=>{le(a,c)}),he(a,c=>{try{rt(c)}catch{}})}const r=Ce(e);if(r)for(let a=r.length-1;a>=0;--a){const c=r[a],p=c&&c.name;if(typeof p=="string")try{e.removeAttribute(p)}catch{}}},Q=function(e,t){try{le(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{le(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(oe||ye)try{$(t)}catch{}else try{t.setAttribute(e,"")}catch{}},bn=function(e){const t=Ce(e);if(t)for(let r=t.length-1;r>=0;--r){const a=t[r],c=a&&a.name;if(!(typeof c!="string"||T[h(c)]))try{e.removeAttribute(c)}catch{}}},Rn=function(e){const t=[e];for(;t.length>0;){const r=t.pop();(M?M(r):r.nodeType)===z.element&&bn(r);const c=ue(r);if(c)for(let p=c.length-1;p>=0;--p)t.push(c[p])}},Dt=function(e){let t=null,r=null;if(Fe)e="<remove></remove>"+e;else{const p=zt(e,/^[\r\n\t ]+/);r=p&&p[0]}Te==="application/xhtml+xml"&&ie===U&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const a=C?ne(e):e;if(ie===U)try{t=new y().parseFromString(a,Te)}catch{}if(!t||!t.documentElement){t=xe.createDocument(ie,"template",null);try{t.documentElement.innerHTML=We?Z:a}catch{}}const c=t.body||t.documentElement;return e&&r&&c.insertBefore(s.createTextNode(r),c.childNodes[0]||null),ie===U?rn.call(t,J?"html":"body")[0]:J?t.documentElement:c},wt=function(e){return lt.call(e.ownerDocument||e,e,L.SHOW_ELEMENT|L.SHOW_COMMENT|L.SHOW_TEXT|L.SHOW_PROCESSING_INSTRUCTION|L.SHOW_CDATA_SECTION,null)},Ie=function(e){return e=ge(e,an," "),e=ge(e,ln," "),e=ge(e,cn," "),e},Ve=function(e){var t;e.normalize();const r=lt.call(e.ownerDocument||e,e,L.SHOW_TEXT|L.SHOW_COMMENT|L.SHOW_CDATA_SECTION|L.SHOW_PROCESSING_INSTRUCTION,null);let a=r.nextNode();for(;a;)a.data=Ie(a.data),a=r.nextNode();const c=(t=e.querySelectorAll)===null||t===void 0?void 0:t.call(e,"template");c&&he(c,p=>{ae(p.content)&&Ve(p.content)})},Ne=function(e){const t=W?W(e):null;return typeof t!="string"||h(t)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==Ce(e)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==M(e)||e.childNodes!==ue(e)},ae=function(e){if(!M||typeof e!="object"||e===null)return!1;try{return M(e)===z.documentFragment}catch{return!1}},_e=function(e){if(!M||typeof e!="object"||e===null)return!1;try{return typeof M(e)=="number"}catch{return!1}};function B(i,e,t){i.length!==0&&he(i,r=>{r.call(o,e,t,se)})}const On=function(e,t){return!!(de&&e.hasChildNodes()&&!_e(e.firstElementChild)&&O(Vt,e.textContent)&&O(Vt,e.innerHTML)||de&&e.namespaceURI===U&&t==="style"&&_e(e.firstElementChild)||e.nodeType===z.processingInstruction||de&&e.nodeType===z.comment&&O(ho,e.data))},In=function(e,t){if(!me[t]&&xt(t)&&(_.tagNameCheck instanceof RegExp&&O(_.tagNameCheck,t)||_.tagNameCheck instanceof Function&&_.tagNameCheck(t)))return!1;if(ze&&!v[t]){const r=fe(e),a=ue(e);if(a&&r){const c=a.length;for(let p=c-1;p>=0;--p){const b=He?a[p]:Qt(a[p],!0);r.insertBefore(b,en(e))}}}return $(e),!0},Ct=function(e){if(B(g.beforeSanitizeElements,e,null),Ne(e))return $(e),!0;const t=h(W?W(e):e.nodeName);if(B(g.uponSanitizeElement,e,{tagName:t,allowedTags:d}),On(e,t))return $(e),!0;if(me[t]||!(j.tagCheck instanceof Function&&j.tagCheck(t))&&!d[t])return In(e,t);if((M?M(e):e.nodeType)===z.element&&!yn(e)||(t==="noscript"||t==="noembed"||t==="noframes")&&O(go,e.innerHTML))return $(e),!0;if(Y&&e.nodeType===z.text){const a=Ie(e.textContent);e.textContent!==a&&(le(o.removed,{element:e.cloneNode()}),e.textContent=a)}return B(g.afterSanitizeElements,e,null),!1},Mt=function(e,t,r){if(mt[t]||ht&&(t==="id"||t==="name")&&(r in s||r in gn))return!1;const a=T[t]||j.attributeCheck instanceof Function&&j.attributeCheck(t,e);if(!(Pe&&O(un,t))){if(!(dt&&O(fn,t))){if(a){if(!Ge[t]){if(!O(ut,ge(r,ct,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Ht(r,"data:")===0&&At[e])){if(!(Tt&&!O(pn,ge(r,ct,"")))){if(r)return!1}}}}}else if(!(xt(e)&&(_.tagNameCheck instanceof RegExp&&O(_.tagNameCheck,e)||_.tagNameCheck instanceof Function&&_.tagNameCheck(e))&&(_.attributeNameCheck instanceof RegExp&&O(_.attributeNameCheck,t)||_.attributeNameCheck instanceof Function&&_.attributeNameCheck(t,e))||t==="is"&&_.allowCustomizedBuiltInElements&&(_.tagNameCheck instanceof RegExp&&O(_.tagNameCheck,r)||_.tagNameCheck instanceof Function&&_.tagNameCheck(r))))return!1}}return!0},Nn=f({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),xt=function(e){return!Nn[Ae(e)]&&O(mn,e)},Ln=function(e,t,r,a){if(C&&typeof te=="object"&&typeof te.getAttributeType=="function"&&!r)switch(te.getAttributeType(e,t)){case"TrustedHTML":return ne(a);case"TrustedScriptURL":return tn(a)}return a},Dn=function(e,t,r,a){try{r?e.setAttributeNS(r,t,a):e.setAttribute(t,a),Ne(e)?$(e):Ft(o.removed)}catch{Q(t,e)}},Pt=function(e){B(g.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||Ne(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0};let a=t.length;const c=h(e.nodeName);for(;a--;){const p=t[a],b=p.name,E=p.namespaceURI,P=p.value,k=h(b),Ke=P;let D=b==="value"?Ke:Jn(Ke);if(r.attrName=k,r.attrValue=D,r.keepAttr=!0,r.forceKeepAttr=void 0,B(g.uponSanitizeAttribute,e,r),D=r.attrValue,gt&&(k==="id"||k==="name")&&Ht(D,Et)!==0&&(Q(b,e),D=Et+D),de&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,D)){Q(b,e);continue}if(k==="attributename"&&zt(D,"href")){Q(b,e);continue}if(!r.forceKeepAttr){if(!r.keepAttr){Q(b,e);continue}if(!_t&&O(Eo,D)){Q(b,e);continue}if(Y&&(D=Ie(D)),!Mt(c,k,D)){Q(b,e);continue}D=Ln(c,k,E,D),D!==Ke&&Dn(e,b,E,D)}}B(g.afterSanitizeAttributes,e,null)},Le=function(e){let t=null;const r=wt(e);for(B(g.beforeSanitizeShadowDOM,e,null);t=r.nextNode();)if(B(g.uponSanitizeShadowNode,t,null),Ct(t),Pt(t),ae(t.content)&&Le(t.content),(M?M(t):t.nodeType)===z.element){const c=it(t);ae(c)&&(qe(c),Le(c))}B(g.afterSanitizeShadowDOM,e,null)},qe=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const r=t.pop();if(r.shadow){Le(r.shadow);continue}const a=r.node,p=(M?M(a):a.nodeType)===z.element,b=ue(a);if(b)for(let E=b.length-1;E>=0;--E)t.push({node:b[E],shadow:null});if(p){const E=W?W(a):null;if(typeof E=="string"&&h(E)==="template"){const P=a.content;ae(P)&&t.push({node:P,shadow:null})}}if(p){const E=it(a);ae(E)&&t.push({node:null,shadow:E},{node:E,shadow:null})}}};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,r=null,a=null,c=null;if(We=!i,We&&(i="<!-->"),typeof i!="string"&&!_e(i)&&(i=oo(i),typeof i!="string"))throw ee("dirty is not a string, aborting");if(!o.isSupported)return i;ke?(d=ve,T=Ue):Xe(e),(g.uponSanitizeElement.length>0||g.uponSanitizeAttribute.length>0)&&(d=w(d)),g.uponSanitizeAttribute.length>0&&(T=w(T)),o.removed=[];const p=He&&typeof i!="string"&&_e(i);if(p){const P=W?W(i):i.nodeName;if(typeof P=="string"){const k=h(P);if(!d[k]||me[k])throw ee("root node is forbidden and cannot be sanitized in-place")}if(Ne(i))throw ee("root node is clobbered and cannot be sanitized in-place");try{qe(i)}catch(k){throw Lt(i),k}}else if(_e(i))t=Dt("<!---->"),r=t.ownerDocument.importNode(i,!0),r.nodeType===z.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?t=r:t.appendChild(r),qe(r);else{if(!oe&&!Y&&!J&&i.indexOf("<")===-1)return C&&be?ne(i):i;if(t=Dt(i),!t)return oe?null:be?Z:""}t&&Fe&&$(t.firstChild);const b=wt(p?i:t);try{for(;a=b.nextNode();)Ct(a),Pt(a),ae(a.content)&&Le(a.content)}catch(P){throw p&&Lt(i),P}if(p)return he(o.removed,P=>{P.element&&Rn(P.element)}),Y&&Ve(i),i;if(oe){if(Y&&Ve(t),ye)for(c=on.call(t.ownerDocument);t.firstChild;)c.appendChild(t.firstChild);else c=t;return(T.shadowroot||T.shadowrootmode)&&(c=sn.call(l,c,!0)),c}let E=J?t.outerHTML:t.innerHTML;return J&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&O(To,t.ownerDocument.doctype.name)&&(E="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
`+E),Y&&(E=Ie(E)),C&&be?ne(E):E},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xe(i),ke=!0,ve=d,Ue=T},o.clearConfig=function(){se=null,ke=!1,ve=null,Ue=null,C=Me,Z=""},o.isValidAttribute=function(i,e,t){se||Xe({});const r=h(i),a=h(e);return Mt(r,a,t)},o.addHook=function(i,e){typeof e=="function"&&R(g,i)&&le(g[i],e)},o.removeHook=function(i,e){if(R(g,i)){if(e!==void 0){const t=Kn(g[i],e);return t===-1?void 0:Zn(g[i],t,1)[0]}return Ft(g[i])}},o.removeHooks=function(i){R(g,i)&&(g[i]=[])},o.removeAllHooks=function(){g=qt()},o}var yo=Jt();const bo=["p","br","strong","em","u","s","a","ul","ol","li","h1","h2","h3","span"],No=n=>yo.sanitize(n||"",{ALLOWED_TAGS:bo,ALLOWED_ATTR:["href","target","rel","style","class"]});export{Io as P,No as s};