@goodhood-web/nebenan-base 3.5.0-development.7 → 3.5.0-development.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +73 -64
- package/lib/Feed/FeedItem/Marketplace/MarketplaceItemCardless/MarketplaceItemCardless.d.ts +1 -1
- package/lib/Feed/FeedItem/Marketplace/MarketplaceItemCardless/MarketplaceItemCardless.types.d.ts +1 -0
- package/lib/Feed/GridFeed/GridFeed.d.ts +1 -1
- package/lib/Feed/GridFeed/GridFeed.types.d.ts +4 -1
- package/lib/Feed/GridFeed/GridFeedAggregator/GridFeedAggregator.d.ts +1 -1
- package/lib/Feed/GridFeed/GridFeedAggregator/GridFeedAggregator.types.d.ts +1 -0
- package/lib/Feed/GridFeed/GridFeedAggregator/components/FeedDynamicRenderer/FeedDynamicRenderer.d.ts +1 -1
- package/lib/Feed/GridFeed/GridFeedAggregator/components/FeedDynamicRenderer/FeedDynamicRenderer.types.d.ts +1 -0
- package/lib/Feed/GridFeed/GridFeedDynamicRenderer/GridFeedDynamicRenderer.d.ts +1 -1
- package/lib/Feed/GridFeed/GridFeedDynamicRenderer/GridFeedDynamicRenderer.types.d.ts +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -841,7 +841,7 @@ vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
|
|
|
841
841
|
Or, to disable this warning, add the \`allowVulnerableTags\` option
|
|
842
842
|
and ensure you are accounting for this risk.
|
|
843
843
|
|
|
844
|
-
`)});const u=n.nonTextTags||["script","style","textarea","option"];let o,f;n.allowedAttributes&&(o={},f={},ga(n.allowedAttributes,function(F,T){o[T]=[];const P=[];F.forEach(function(S){typeof S=="string"&&S.indexOf("*")>=0?P.push(B2(S).replace(/\\\*/g,".*")):o[T].push(S)}),P.length&&(f[T]=new RegExp("^("+P.join("|")+")$"))}));const d={},c={},l={};ga(n.allowedClasses,function(F,T){if(o&&(St(o,T)||(o[T]=[]),o[T].push("class")),d[T]=F,Array.isArray(F)){const P=[];d[T]=[],l[T]=[],F.forEach(function(S){typeof S=="string"&&S.indexOf("*")>=0?P.push(B2(S).replace(/\\\*/g,".*")):S instanceof RegExp?l[T].push(S):d[T].push(S)}),P.length&&(c[T]=new RegExp("^("+P.join("|")+")$"))}});const h={};let m;ga(n.transformTags,function(F,T){let P;typeof F=="function"?P=F:typeof F=="string"&&(P=Na.simpleTransform(F)),T==="*"?m=P:h[T]=P});let b,k,A,y,x,B,z=!1;E();const R=new ZZ.Parser({onopentag:function(F,T){if(n.enforceHtmlBoundary&&F==="html"&&E(),x){B++;return}const P=new a(F,T);k.push(P);let S=!1;const G=!!P.text;let N;if(St(h,F)&&(N=h[F](F,T),P.attribs=T=N.attribs,N.text!==void 0&&(P.innerText=N.text),F!==N.tagName&&(P.name=F=N.tagName,y[b]=N.tagName)),m&&(N=m(F,T),P.attribs=T=N.attribs,F!==N.tagName&&(P.name=F=N.tagName,y[b]=N.tagName)),(!s(F)||n.disallowedTagsMode==="recursiveEscape"&&!KZ(A)||n.nestingLimit!=null&&b>=n.nestingLimit)&&(S=!0,A[b]=!0,(n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard")&&u.indexOf(F)!==-1&&(x=!0,B=1),A[b]=!0),b++,S){if(n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard"){if(P.innerText&&!G){const w=I(P.innerText);n.textFilter?i+=n.textFilter(w,F):i+=I(P.innerText),z=!0}return}r=i,i=""}i+="<"+F,F==="script"&&(n.allowedScriptHostnames||n.allowedScriptDomains)&&(P.innerText=""),(!o||St(o,F)||o["*"])&&ga(T,function(w,Z){if(!JZ.test(Z)){delete P.attribs[Z];return}if(w===""&&!n.allowedEmptyAttributes.includes(Z)&&(n.nonBooleanAttributes.includes(Z)||n.nonBooleanAttributes.includes("*"))){delete P.attribs[Z];return}let Q=!1;if(!o||St(o,F)&&o[F].indexOf(Z)!==-1||o["*"]&&o["*"].indexOf(Z)!==-1||St(f,F)&&f[F].test(Z)||f["*"]&&f["*"].test(Z))Q=!0;else if(o&&o[F]){for(const K of o[F])if(GZ(K)&&K.name&&K.name===Z){Q=!0;let U="";if(K.multiple===!0){const $=w.split(" ");for(const J of $)K.values.indexOf(J)!==-1&&(U===""?U=J:U+=" "+J)}else K.values.indexOf(w)>=0&&(U=w);w=U}}if(Q){if(n.allowedSchemesAppliedToAttributes.indexOf(Z)!==-1&&L(F,w)){delete P.attribs[Z];return}if(F==="script"&&Z==="src"){let K=!0;try{const U=D(w);if(n.allowedScriptHostnames||n.allowedScriptDomains){const $=(n.allowedScriptHostnames||[]).find(function(q){return q===U.url.hostname}),J=(n.allowedScriptDomains||[]).find(function(q){return U.url.hostname===q||U.url.hostname.endsWith(`.${q}`)});K=$||J}}catch{K=!1}if(!K){delete P.attribs[Z];return}}if(F==="iframe"&&Z==="src"){let K=!0;try{const U=D(w);if(U.isRelativeUrl)K=St(n,"allowIframeRelativeUrls")?n.allowIframeRelativeUrls:!n.allowedIframeHostnames&&!n.allowedIframeDomains;else if(n.allowedIframeHostnames||n.allowedIframeDomains){const $=(n.allowedIframeHostnames||[]).find(function(q){return q===U.url.hostname}),J=(n.allowedIframeDomains||[]).find(function(q){return U.url.hostname===q||U.url.hostname.endsWith(`.${q}`)});K=$||J}}catch{K=!1}if(!K){delete P.attribs[Z];return}}if(Z==="srcset")try{let K=WZ(w);if(K.forEach(function(U){L("srcset",U.url)&&(U.evil=!0)}),K=M2(K,function(U){return!U.evil}),K.length)w=UZ(M2(K,function(U){return!U.evil})),P.attribs[Z]=w;else{delete P.attribs[Z];return}}catch{delete P.attribs[Z];return}if(Z==="class"){const K=d[F],U=d["*"],$=c[F],J=l[F],q=l["*"],re=c["*"],ne=[$,re].concat(J,q).filter(function(le){return le});if(K&&U?w=H(w,O2(K,U),ne):w=H(w,K||U,ne),!w.length){delete P.attribs[Z];return}}if(Z==="style"){if(n.parseStyleAttributes)try{const K=YZ(F+" {"+w+"}",{map:!1}),U=C(K,n.allowedStyles);if(w=M(U),w.length===0){delete P.attribs[Z];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+F+" {"+w+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete P.attribs[Z];return}else if(n.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}i+=" "+Z,w&&w.length?i+='="'+I(w,!0)+'"':n.allowedEmptyAttributes.includes(Z)&&(i+='=""')}else delete P.attribs[Z]}),n.selfClosing.indexOf(F)!==-1?i+=" />":(i+=">",P.innerText&&!G&&!n.textFilter&&(i+=I(P.innerText),z=!0)),S&&(i=r+I(i),r="")},ontext:function(F){if(x)return;const T=k[k.length-1];let P;if(T&&(P=T.tag,F=T.innerText!==void 0?T.innerText:F),n.disallowedTagsMode==="completelyDiscard"&&!s(P))F="";else if((n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard")&&(P==="script"||P==="style"))i+=F;else{const S=I(F,!1);n.textFilter&&!z?i+=n.textFilter(S,P):z||(i+=S)}if(k.length){const S=k[k.length-1];S.text+=F}},onclosetag:function(F,T){if(x)if(B--,!B)x=!1;else return;const P=k.pop();if(!P)return;if(P.tag!==F){k.push(P);return}x=n.enforceHtmlBoundary?F==="html":!1,b--;const S=A[b];if(S){if(delete A[b],n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard"){P.updateParentNodeText();return}r=i,i=""}if(y[b]&&(F=y[b],delete y[b]),n.exclusiveFilter&&n.exclusiveFilter(P)){i=i.substr(0,P.tagPosition);return}if(P.updateParentNodeMediaChildren(),P.updateParentNodeText(),n.selfClosing.indexOf(F)!==-1||T&&!s(F)&&["escape","recursiveEscape"].indexOf(n.disallowedTagsMode)>=0){S&&(i=r,r="");return}i+="</"+F+">",S&&(i=r+I(i),r=""),z=!1}},n.parser);return R.write(e),R.end(),i;function E(){i="",b=0,k=[],A={},y={},x=!1,B=0}function I(F,T){return typeof F!="string"&&(F=F+""),n.parser.decodeEntities&&(F=F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),T&&(F=F.replace(/"/g,"""))),F=F.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),T&&(F=F.replace(/"/g,""")),F}function L(F,T){for(T=T.replace(/[\x00-\x20]+/g,"");;){const G=T.indexOf("<!--");if(G===-1)break;const N=T.indexOf("-->",G+4);if(N===-1)break;T=T.substring(0,G)+T.substring(N+3)}const P=T.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!P)return T.match(/^[/\\]{2}/)?!n.allowProtocolRelative:!1;const S=P[1].toLowerCase();return St(n.allowedSchemesByTag,F)?n.allowedSchemesByTag[F].indexOf(S)===-1:!n.allowedSchemes||n.allowedSchemes.indexOf(S)===-1}function D(F){if(F=F.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),F.startsWith("relative:"))throw new Error("relative: exploit attempt");let T="relative://relative-site";for(let G=0;G<100;G++)T+=`/${G}`;const P=new URL(F,T);return{isRelativeUrl:P&&P.hostname==="relative-site"&&P.protocol==="relative:",url:P}}function C(F,T){if(!T)return F;const P=F.nodes[0];let S;return T[P.selector]&&T["*"]?S=O2(T[P.selector],T["*"]):S=T[P.selector]||T["*"],S&&(F.nodes[0].nodes=P.nodes.reduce(j(S),[])),F}function M(F){return F.nodes[0].nodes.reduce(function(T,P){return T.push(`${P.prop}:${P.value}${P.important?" !important":""}`),T},[]).join(";")}function j(F){return function(T,P){return St(F,P.prop)&&F[P.prop].some(function(G){return G.test(P.value)})&&T.push(P),T}}function H(F,T,P){return T?(F=F.split(/\s+/),F.filter(function(S){return T.indexOf(S)!==-1||P.some(function(G){return G.test(S)})}).join(" ")):F}}const qZ={decodeEntities:!0};Na.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0};Na.simpleTransform=function(e,n,t){return t=t===void 0?!0:t,n=n||{},function(i,r){let a;if(t)for(a in n)r[a]=n[a];else r=n;return{tagName:e,attribs:r}}};const cp=Zn(VZ),_Z="_markdown_1jzce_141",E2={markdown:_Z,"markdown--external-links":"_markdown--external-links_1jzce_153"},$Z={allowedAttributes:{a:["href","target"]},allowedTags:["a"]};function eG({className:e,elementTag:n="span",inline:t=!1,isExternalLinksIcon:i,text:r}){const a=cp(r,$Z),s=n;return g.jsx(s,{className:ie(E2.markdown,{[E2["markdown--external-links"]]:i},e),dangerouslySetInnerHTML:{__html:t?Pe.parseInline(a,{breaks:!0}):Pe.parse(a,{breaks:!0})}})}const nG="_react-datepicker__day-names_1ftws_120",tG="_react-datepicker__week_1ftws_124",iG="_react-datepicker__day--outside-month_1ftws_131",rG="_react-datepicker_1ftws_120",aG="_typography-landing--claim_1ftws_141",sG="_typography-landing--claim-uppercase_1ftws_179",oG="_typography-landing--h1_1ftws_217",uG="_typography-landing--h1-uppercase_1ftws_255",fG="_typography-landing--h2_1ftws_293",dG="_typography-landing--h3_1ftws_331",lG="_typography-landing--h4_1ftws_369",cG="_typography-landing--h5_1ftws_394",hG="_typography-landing--h6_1ftws_419",gG="_typography-landing--overline_1ftws_444",mG="_typography-landing--body-large_1ftws_481",vG="_typography-landing--body-large-semibold_1ftws_505",pG="_typography-landing--body_1ftws_481",wG="_typography-landing--body-semibold_1ftws_540",AG="_typography-landing--body-italic_1ftws_551",bG="_typography-landing--quote-large_1ftws_563",kG="_typography-landing--detail-small_1ftws_588",yG="_typography-landing--detail-small-bold_1ftws_599",xG="_typography-landing_1ftws_141",CG="_typography-product_1ftws_628",zG="_typography-product--h1_1ftws_639",PG="_typography-product--h2_1ftws_650",BG="_typography-product--h3_1ftws_661",OG="_typography-product--h4_1ftws_672",MG="_typography-product--h5_1ftws_683",EG="_typography-product--h6_1ftws_694",FG="_typography-product--h7_1ftws_705",SG="_typography-product--h8_1ftws_716",RG="_typography-product--body-large_1ftws_727",jG="_typography-product--body-regular_1ftws_749",TG="_typography-product--body-semibold_1ftws_771",DG="_typography-product--body-italic_1ftws_793",IG="_typography-product--body-text-link_1ftws_816",HG="_typography-product--detail-medium_1ftws_827",LG="_typography-product--detail-bold_1ftws_849",NG="_typography-product--detail-upper-case_1ftws_871",ZG="_typography-product--detail-regular_1ftws_893",GG="_typography-product--detail-text-link_1ftws_915",F2={"react-datepicker__day-names":"_react-datepicker__day-names_1ftws_120",reactDatepickerDayNames:nG,"react-datepicker__week":"_react-datepicker__week_1ftws_124",reactDatepickerWeek:tG,"react-datepicker__day--outside-month":"_react-datepicker__day--outside-month_1ftws_131",reactDatepickerDayOutsideMonth:iG,"react-datepicker":"_react-datepicker_1ftws_120",reactDatepicker:rG,"typography-landing--claim":"_typography-landing--claim_1ftws_141",typographyLandingClaim:aG,"typography-landing--claim-uppercase":"_typography-landing--claim-uppercase_1ftws_179",typographyLandingClaimUppercase:sG,"typography-landing--h1":"_typography-landing--h1_1ftws_217",typographyLandingH1:oG,"typography-landing--h1-uppercase":"_typography-landing--h1-uppercase_1ftws_255",typographyLandingH1Uppercase:uG,"typography-landing--h2":"_typography-landing--h2_1ftws_293",typographyLandingH2:fG,"typography-landing--h3":"_typography-landing--h3_1ftws_331",typographyLandingH3:dG,"typography-landing--h4":"_typography-landing--h4_1ftws_369",typographyLandingH4:lG,"typography-landing--h5":"_typography-landing--h5_1ftws_394",typographyLandingH5:cG,"typography-landing--h6":"_typography-landing--h6_1ftws_419",typographyLandingH6:hG,"typography-landing--overline":"_typography-landing--overline_1ftws_444",typographyLandingOverline:gG,"typography-landing--body-large":"_typography-landing--body-large_1ftws_481",typographyLandingBodyLarge:mG,"typography-landing--body-large-semibold":"_typography-landing--body-large-semibold_1ftws_505",typographyLandingBodyLargeSemibold:vG,"typography-landing--body":"_typography-landing--body_1ftws_481",typographyLandingBody:pG,"typography-landing--body-semibold":"_typography-landing--body-semibold_1ftws_540",typographyLandingBodySemibold:wG,"typography-landing--body-italic":"_typography-landing--body-italic_1ftws_551",typographyLandingBodyItalic:AG,"typography-landing--quote-large":"_typography-landing--quote-large_1ftws_563",typographyLandingQuoteLarge:bG,"typography-landing--detail-small":"_typography-landing--detail-small_1ftws_588",typographyLandingDetailSmall:kG,"typography-landing--detail-small-bold":"_typography-landing--detail-small-bold_1ftws_599",typographyLandingDetailSmallBold:yG,"typography-landing":"_typography-landing_1ftws_141",typographyLanding:xG,"typography-product":"_typography-product_1ftws_628",typographyProduct:CG,"typography-product--h1":"_typography-product--h1_1ftws_639",typographyProductH1:zG,"typography-product--h2":"_typography-product--h2_1ftws_650",typographyProductH2:PG,"typography-product--h3":"_typography-product--h3_1ftws_661",typographyProductH3:BG,"typography-product--h4":"_typography-product--h4_1ftws_672",typographyProductH4:OG,"typography-product--h5":"_typography-product--h5_1ftws_683",typographyProductH5:MG,"typography-product--h6":"_typography-product--h6_1ftws_694",typographyProductH6:EG,"typography-product--h7":"_typography-product--h7_1ftws_705",typographyProductH7:FG,"typography-product--h8":"_typography-product--h8_1ftws_716",typographyProductH8:SG,"typography-product--body-large":"_typography-product--body-large_1ftws_727",typographyProductBodyLarge:RG,"typography-product--body-regular":"_typography-product--body-regular_1ftws_749",typographyProductBodyRegular:jG,"typography-product--body-semibold":"_typography-product--body-semibold_1ftws_771",typographyProductBodySemibold:TG,"typography-product--body-italic":"_typography-product--body-italic_1ftws_793",typographyProductBodyItalic:DG,"typography-product--body-text-link":"_typography-product--body-text-link_1ftws_816",typographyProductBodyTextLink:IG,"typography-product--detail-medium":"_typography-product--detail-medium_1ftws_827",typographyProductDetailMedium:HG,"typography-product--detail-bold":"_typography-product--detail-bold_1ftws_849",typographyProductDetailBold:LG,"typography-product--detail-upper-case":"_typography-product--detail-upper-case_1ftws_871",typographyProductDetailUpperCase:NG,"typography-product--detail-regular":"_typography-product--detail-regular_1ftws_893",typographyProductDetailRegular:ZG,"typography-product--detail-text-link":"_typography-product--detail-text-link_1ftws_915",typographyProductDetailTextLink:GG};function WG(e){switch(e){case"h1":case"h1-uppercase":return"h1";case"h2":case"claim":case"claim-uppercase":return"h2";case"h3":case"h4":case"h5":return e;case"h6":case"overline":return"h6";default:return"span"}}const ei=e=>{const{as:n,children:t,className:i,fontSet:r="product",markdown:a=r==="landing",markdownInline:s=!0,type:u}=e,o=n||WG(u),f=ie(F2[`typography-${r}`],F2[`typography-${r}--${u}`],i);return g.jsx(g.Fragment,{children:typeof t=="string"&&a?g.jsx(eG,{className:f,text:t,inline:s,elementTag:o,isExternalLinksIcon:r==="landing"}):g.jsx(o,{className:f,"data-testid":e["data-testid"],children:t})})},YG="_root_dikw3_141",QG="_root__content_dikw3_151",XG="_root__bookmark_dikw3_157",KG="_root__header_dikw3_163",UG="_root__header__reserved_dikw3_170",VG="_root__header__reserved__box_dikw3_183",JG="_root__header__imageContent_dikw3_192",qG="_root__info_dikw3_197",_G="_root__info__top_dikw3_204",$G="_root__info__price_dikw3_207",eW="_root__info__title_dikw3_213",nW="_root__info__timeStamp_dikw3_222",tW="_root__premiumFeature_dikw3_226",iW="_headerImage_dikw3_239",rW="_labelOnPhoto_dikw3_249",aW="_abTestBorderRadius_dikw3_258",Ye={root:YG,root__content:QG,root__bookmark:XG,root__header:KG,root__header__reserved:UG,"root__header__reserved--visible":"_root__header__reserved--visible_dikw3_180",root__header__reserved__box:VG,root__header__imageContent:JG,root__info:qG,root__info__top:_G,root__info__price:$G,"root__info__price--reserved":"_root__info__price--reserved_dikw3_210",root__info__title:eW,root__info__timeStamp:nW,root__premiumFeature:tW,"root__premiumFeature--withLabel":"_root__premiumFeature--withLabel_dikw3_231",headerImage:iW,"headerImage--outlineImage":"_headerImage--outlineImage_dikw3_243",labelOnPhoto:rW,abTestBorderRadius:aW},S2="Greif zu!";function lc({bookmarked:e,highlightAbTest:n,id:t,image:i,onClick:r,premiumFeature:a=!1,price:s,reserved:u,reservedText:o,timeStamp:f,title:d}){const c=Fn(),l=()=>{c(`/feed/${t}`),r&&r()};return g.jsxs("div",{className:Ye.root,children:[g.jsx(W3,{className:Ye.root__bookmark,isBookmarked:e,id:t}),g.jsxs(O.Button,{className:Ye.root__content,onClick:l,children:[g.jsxs("div",{className:Ye.root__header,children:[g.jsx("div",{className:ie(Ye.root__header__reserved,{[Ye["root__header__reserved--visible"]]:u}),children:g.jsx("div",{className:Ye.root__header__reserved__box,children:g.jsx(ei,{type:"detail-upper-case",children:o})})}),g.jsxs("div",{className:ie(Ye.headerImage,{[Ye["headerImage--outlineImage"]]:n==="outline_photo"&&a}),children:[a&&n==="label_on_photo"&&g.jsx("div",{className:Ye.labelOnPhoto,children:g.jsx(ei,{type:"detail-bold",children:S2})}),i?g.jsx(VI,{alt:"product image",src:i,className:ie(Ye.root__header__imageContent,{[Ye.abTestBorderRadius]:n==="outline_photo"})}):g.jsx(UI,{size:"large",style:"rounded",icon:g.jsx(Y3,{name:"camera_crossed"}),className:ie({[Ye.abTestBorderRadius]:n==="outline_photo"})})]})]}),g.jsxs("div",{className:Ye.root__info,children:[g.jsxs("div",{className:Ye.root__info__top,children:[g.jsx(ei,{type:"body-semibold",as:"p",className:ie(Ye.root__info__price,{[Ye["root__info__price--reserved"]]:u}),children:s}),g.jsx(ei,{type:"body-semibold",as:"p",className:Ye.root__info__title,children:d})]}),g.jsx(ei,{type:a?"detail-bold":"detail-medium",as:"p",className:ie(Ye.root__info__timeStamp,{[Ye.root__premiumFeature]:a,[Ye["root__premiumFeature--withLabel"]]:n==="label_under_description"&&a}),children:a?n!=="label_on_photo"?S2:null:Oo(f)})]})]})]})}const sW=({children:e,navigate:n})=>g.jsx(lg.Provider,{value:{navigate:n},children:e}),oW="_root_1fa52_141",uW={root:oW},cc={event:"event",feed:"feed",group:"group",marketplace:"marketplace",post:"post"},fW="_root_lpowo_141",dW="_root__list_lpowo_146",lW="_root__ctaButtonDesktop_lpowo_152",cW="_root__ctaButtonMobile_lpowo_155",hW="_root__itemCta_lpowo_169",gW="_root__item_lpowo_169",xi={root:fW,root__list:dW,root__ctaButtonDesktop:lW,root__ctaButtonMobile:cW,root__itemCta:hW,root__item:gW},mW={event:"",feed:"",group:"",marketplace:"/feed/marketplace",post:""},vW=({feedType:e,highlightAbTest:n,item:t})=>{switch(e){case cc[e]:return g.jsx(lc,{...t,highlightAbTest:n});default:return null}},pW=(e,n,t=6)=>{let i=[];if(!e.length)return[[]];const r=n?n.filter(l=>Number(l==null?void 0:l.position)>=0):[];let a=Array(t).fill(null),s=0,u=0,o=0;const f=()=>{let l=0;r.forEach(h=>{h.block===o&&(a.splice(h==null?void 0:h.position,1,h),l+=1)}),s=l};r.length&&f();const d=(l,h)=>{if(a[l]!==null&&s<t&&l<t){d(l+1,h);return}a.splice(l,1,h),s+=1,u+=1},c=(l=0,h=[])=>{if(l>e.length){if(s>0){const m=a.filter(b=>b!=null);m.length&&h.push(m)}return h}return d(u,e[l]),s===t&&a.filter(Boolean).length===t&&(h.push(a.filter(m=>m!=null)),a=Array(t).fill(null),s=0,u=0,o+=1,r.length&&f()),c(l+1,h)};return i=c(),n&&n.length>=0&&(i=n.sort((l,h)=>l.block-h.block).filter(l=>(l==null?void 0:l.position)==null).reduce((l,h,m)=>{if(i.length>h.block){const b=h.block+m+1;return[...l.slice(0,b),h,...l.slice(b)]}return l},[...i])),i},wW=e=>e?new Intl.NumberFormat("de-DE",{currency:"EUR",maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(e/100).replace("€","").trim()+" €":"Zu verschenken",AW=(e,n)=>{const t=[];return e.forEach(i=>{var r,a,s;typeof i=="number"?t.push({bookmarked:n[i].is_bookmarked,id:n[i].id,image:(a=(r=n[i])==null?void 0:r.images[0])==null?void 0:a.url,premiumFeature:H3((s=n[i])==null?void 0:s.paid_highlight_until),price:wW(n[i].price),reserved:mO(n[i].outcome),reservedText:"Reserviert",timeStamp:n[i].created_at,title:n[i].subject,type:"feed"}):t.push({type:"ad",...i})}),t},bW=(e,n="de-DE")=>e[n],kW={"de-DE":{marketplace:{description:"Gib deinen Sachen ein neues Zuhause.",title:"Etwas zu verkaufen?",cta:"Angebot erstellen",cta_small:"Angebot"},feed:{description:"",title:"",cta:""},event:{description:"",title:"",cta:""},group:{description:"",title:"",cta:""},post:{description:"",title:"",cta:""}}},yW=bW(kW),xW=(e,n)=>yW[cc[e]][n];function R2({classNameButtonDesktop:e,classNameButtonMobile:n,feedType:t,isCard:i=!1,onClick:r}){const a=u=>xW(t,u),s=()=>i?g.jsxs(g.Fragment,{children:[g.jsx(O.Typography,{className:e,type:"body-semibold",children:a("cta")}),g.jsxs(O.Typography,{className:n,type:"body-semibold",children:[a("cta_small"),g.jsx(O.Icon,{name:"plus",size:"24"})]})]}):g.jsx(O.Typography,{type:"h5",children:a("cta")});return g.jsx(O.EmptyState,{primaryText:a("title"),stickerProps:{color:"teal",icon:"marketplace"},secondaryText:a("description"),size:i?"small":"medium",buttons:[{buttonType:"primary",children:s(),onClick:r,size:i?"small":"large"}]})}const CW=(e,n)=>e?n%3!==0:n%2!==0;function hp({feedType:e,highlightAbTest:n,items:t}){const i=Fn(),r=Hi(800),a=CW(r,t.length),s=()=>{i(mW[e])};return g.jsx(g.Fragment,{children:t.length?g.jsx(O.Card,{className:ie(xi.root),borderRadius:!0,responsive:!0,children:g.jsx(O.CardBody,{className:xi.root__body,withoutPadding:!0,children:g.jsxs("ul",{className:xi.root__list,children:[t.map((u,o)=>g.jsx("li",{className:xi.root__item,children:u.type==="feed"?g.jsx(vW,{feedType:e,item:u,highlightAbTest:n}):u.content},`grid_item_${u.type}_${u.id}`)),a&&g.jsx("li",{className:xi.root__itemCta,children:g.jsx(R2,{isCard:!0,classNameButtonDesktop:xi.root__ctaButtonDesktop,classNameButtonMobile:xi.root__ctaButtonMobile,onClick:s,feedType:e})},"empty_state_cta_card")]})})}):g.jsx(R2,{onClick:s,feedType:e})})}const zW=({feedItem:e,feedItems:n,feedType:t,highlightAbTest:i})=>{switch(t){case cc[t]:return g.jsx(hp,{feedType:t,items:AW(e,n),highlightAbTest:i});default:return null}},PW=({ads:e,feedItems:n,feedType:t,highlightAbTest:i="control",items:r})=>{const a=pW(r,e);return a.length?g.jsx("section",{className:uW.root,children:a.map((s,u)=>Array.isArray(s)?g.jsx(zW,{feedItem:s,feedItems:n,feedType:t,highlightAbTest:i},`grid_block_${u}`):g.jsx(p.Fragment,{children:s.content},`ad_block_${u}_${s.id}`))}):null},BW="_root_1nq4l_141",OW="_reservedBanner_1nq4l_144",MW="_reservedBanner__text_1nq4l_157",pf={root:BW,reservedBanner:OW,reservedBanner__text:MW},EW="_placeholderCta_1s78b_141",FW={placeholderCta:EW},gp=({ctaSlot:e,type:n})=>g.jsxs(g.Fragment,{children:[g.jsx("div",{className:FW.placeholderCta,children:e}),n==="slideshow"?g.jsx(O.GalleryPlaceholder,{}):g.jsx(O.AvatarWithPlaceholder,{alt:"Image placeholder",type:"desktop"})]}),SW="_root_uw1sg_141",RW="_leftColumn_uw1sg_153",jW="_rightColumn_uw1sg_154",TW="_rightImage_uw1sg_164",DW="_image_uw1sg_172",IW="_button_uw1sg_180",HW="_label_uw1sg_185",LW="_sticker_uw1sg_191",qt={root:SW,leftColumn:RW,rightColumn:jW,rightImage:TW,image:DW,button:IW,label:HW,sticker:LW},NW=({ctaSlot:e,images:n,onImageClick:t,stickerSlot:i})=>{const r=n.length,a=u=>{const o=g.jsx(O.Button,{className:qt.button,onClick:()=>t(u),"data-testid":"image-attachment",children:g.jsx(O.Image,{className:qt.image,alt:`Image-${u}`,src:n[u]})});return u>0?g.jsx("div",{className:qt.rightImage,children:o}):o},s=()=>r<4?null:g.jsx(O.LabelPill,{className:qt.label,size:"medium",shape:"tile",label:`+${r-3}`});return g.jsxs("div",{className:qt.root,children:[g.jsx("div",{className:qt.sticker,children:i}),r===0?g.jsx(gp,{type:"collage",ctaSlot:e}):g.jsxs(g.Fragment,{children:[s(),g.jsx("div",{className:qt.leftColumn,children:a(0)}),r>=2&&g.jsxs("div",{className:qt.rightColumn,children:[a(1),r>=3&&a(2)]})]})]})},ZW="_root_3mqqw_141",GW="_swiperSlide_3mqqw_153",WW="_navigation_3mqqw_166",YW="_pagination_3mqqw_186",QW="_imageButton_3mqqw_193",XW="_sticker_3mqqw_198",sr={root:ZW,swiperSlide:GW,navigation:WW,pagination:YW,imageButton:QW,sticker:XW},KW=({activeIndex:e=0,ctaSlot:n,images:t,onImageClick:i,stickerSlot:r})=>{const[a,s]=p.useState(null),u=p.useRef(null),o=p.useRef(null),f=p.useRef(null),[d,c]=p.useState(e);p.useEffect(()=>{c(e),a==null||a.slideToLoop(e,0)},[e,a]);const l=m=>{c(m.realIndex)},h=()=>{i&&i(d)};return g.jsxs("div",{className:sr.root,children:[g.jsx("div",{className:sr.sticker,children:r}),t.length===0?g.jsx(gp,{type:"slideshow",ctaSlot:n}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:sr.pagination,children:g.jsx(O.CarouselIndicator,{currentStep:d+1||1,totalSteps:t.length,type:"numbers"})}),g.jsxs("div",{className:sr.navigation,children:[g.jsx(O.CarouselNavigation,{direction:"left",ref:o}),g.jsx(O.CarouselNavigation,{direction:"right",ref:f})]}),g.jsx(Ja,{onSwiper:s,initialSlide:d,ref:u,onRealIndexChange:l,init:!1,modules:[$o,eu],slidesPerView:1,loop:!0,draggable:!0,onBeforeInit:m=>{m.params.navigation.nextEl=f.current,m.params.navigation.prevEl=o.current},children:t.map((m,b)=>g.jsx(qa,{tabIndex:0,className:sr.swiperSlide,children:g.jsx(O.Button,{onClick:h,className:sr.imageButton,"data-testid":"image-attachment",children:g.jsx("img",{src:m,alt:"image"})})},b))})]})]})},mp=({activeIndex:e,ctaSlot:n,images:t,onImageClick:i,reserved:r,stickerSlot:a,type:s})=>g.jsxs("div",{className:pf.root,children:[r&&g.jsx("div",{className:pf.reservedBanner,"data-testId":"reserved-banner",children:g.jsx(O.Typography,{type:"h5",className:pf.reservedBanner__text,children:"Reserviert"})}),s==="collage"?g.jsx(NW,{images:t,onImageClick:i,ctaSlot:n,stickerSlot:a}):g.jsx(KW,{activeIndex:e,images:t,onImageClick:i,ctaSlot:n,stickerSlot:a})]});function UW(e,n,t="keypress"){p.useEffect(()=>{const i=Array.isArray(e)?e:[e],r=a=>{i.includes(a.key)&&(a.preventDefault(),n(a))};return window.addEventListener(t,r),()=>{window.removeEventListener(t,r)}},[e,n,t])}const VW="_modal_17mtw_141",JW="_header_17mtw_151",qW="_content_17mtw_161",_W="_closeButtonContainer_17mtw_180",$W="_closeButton_17mtw_180",eY="_swiper_17mtw_191",nY="_swiperSlide_17mtw_195",tY="_navigation_17mtw_205",iY="_pagination_17mtw_228",rY="_footer_17mtw_235",Rn={modal:VW,header:JW,content:qW,closeButtonContainer:_W,closeButton:$W,swiper:eY,swiperSlide:nY,navigation:tY,"navigation--hidden":"_navigation--hidden_17mtw_216",pagination:iY,"pagination--hidden":"_pagination--hidden_17mtw_231",footer:rY},j2=(e,n)=>{if(!On())return e.map((r,a)=>({hidden:!1,position:a,slideIndex:a,src:r,type:"image"}));const t=[],i=new Set(n==null?void 0:n.map(r=>r.position));return e.forEach((r,a)=>{let s=a;for(;i.has(s);)s++;i.add(s),t.push({hidden:!1,position:s,slideIndex:a,src:r,type:"image"})}),n==null||n.forEach(({position:r,render:a})=>{t.push({hidden:!1,position:r,render:a,type:"ad"})}),t.sort((r,a)=>r.position-a.position)},aY=({index:e,slides:n})=>{let t=0;if(!On())return t;n[e].type==="ad"&&(t+=1);const a=n.slice(0,e).filter(s=>s.type==="ad");return t+=a.length,t},wf=({activeIndex:e,slides:n})=>n.findIndex(t=>t.type==="image"&&t.slideIndex===e),sY=e=>e.length===0?e:[...e].sort((t,i)=>t.position-i.position).map((t,i)=>({...t,position:i})),vp=({activeIndex:e,ads:n,footerAd:t,images:i,onClose:r,open:a})=>{const s=j2(i,n),[u,o]=p.useState(null),f=p.useRef(null),d=p.useRef(null),c=p.useRef(null),[l,h]=p.useState(null),[m,b]=p.useState(s),[k,A]=p.useState(wf({activeIndex:e,slides:s})),y=Hi(800),x=()=>{b(j2(i,n))};p.useEffect(()=>{x()},[y]),p.useEffect(()=>{a&&A(wf({activeIndex:e,slides:s}))},[a]),p.useEffect(()=>{if(!a||!u)return;const E=wf({activeIndex:e,slides:m}),I=m[E];h(I.type==="ad"?null:I.slideIndex),u.slideToLoop(E,0)},[m,a,u,e]);const B=E=>{const I=m[E.realIndex];A(I.position),h(I.type==="ad"?null:I.slideIndex)},z=()=>{const E=aY({index:k,slides:m});r(k-E)},R=E=>{const I=m.filter(L=>L.position!==E);b(sY(I))};return UW(["Escape","Esc"],z,"keyup"),i.length===0?null:g.jsx(Li,{children:g.jsx(Qg,{open:a,className:Rn.modal,children:g.jsxs("div",{className:Rn.content,children:[g.jsxs("div",{className:Rn.header,children:[g.jsxs(O.Typography,{type:"h5",className:ie(Rn.pagination,{[Rn["pagination--hidden"]]:l===null}),children:[l?l+1:1," von ",i.length]}),g.jsx("span",{className:Rn.closeButtonContainer,children:g.jsx(O.IconButton,{ariaLabel:"Close",icon:"cross_circle",size:"large",onClick:z,className:Rn.closeButton})})]}),g.jsxs("div",{className:ie(Rn.navigation,{[Rn["navigation--hidden"]]:m[k].type!=="ad"&&On()}),children:[g.jsx(O.CarouselNavigation,{direction:"left",ref:d}),g.jsx(O.CarouselNavigation,{direction:"right",ref:c})]}),g.jsx(Ja,{keyboard:{enabled:!0},onSwiper:o,className:Rn.swiper,ref:f,onRealIndexChange:B,init:!1,initialSlide:k,zoom:!0,modules:[WC,$o,eu,TC,IC],slidesPerView:1,loop:!0,draggable:!0,grabCursor:!0,onBeforeInit:E=>{E.params.navigation.nextEl=c.current,E.params.navigation.prevEl=d.current},children:m.filter(E=>!E.hidden).map((E,I)=>g.jsx(qa,{className:Rn.swiperSlide,children:E.type==="image"?g.jsx("div",{className:"swiper-zoom-container",children:g.jsx("img",{src:E.src})}):E.render({onHide:()=>R(E.position)})},I))}),m[k].type!=="ad"&&g.jsx("div",{className:Rn.footer,children:t==null?void 0:t.render({onHide:G7.noop})})]})})})},oY=({ads:e=[],ctaSlot:n,footerAd:t,images:i,reserved:r,stickerSlot:a,type:s="slideshow"})=>{const[u,o]=p.useState(0),[f,d]=p.useState(!1),c=h=>{o(h),d(!0)},l=h=>{o(h),d(!1)};return g.jsxs("div",{children:[g.jsx(vp,{activeIndex:u,ads:e,footerAd:t,images:i,onClose:l,open:f}),g.jsx(mp,{activeIndex:u,ctaSlot:n,images:i,onImageClick:c,reserved:r,stickerSlot:a,type:s})]})};function uY(e){e.__scriptingEnabledHTMLContentHasBeenExecuted=!0}const fY=`(${uY.toString()})(document.currentScript);`,pp=p.forwardRef((e,n)=>{const t=p.useRef(null);return p.useImperativeHandle(n,()=>({get hasBeenExecuted(){const i=t.current;return i?!!i.__scriptingEnabledHTMLContentHasBeenExecuted:!1}})),g.jsx("script",{ref:t,dangerouslySetInnerHTML:{__html:fY}})});pp.displayName="InnerHTMLScript";const dY=(e,n)=>{const t=document.createRange().createContextualFragment(n);e.innerHTML="",e.appendChild(t)},lY=({html:e,...n})=>{const t=p.useRef(null),i=p.useRef(null);return p.useEffect(()=>{const r=i.current,a=t.current;!r||!a||a.hasBeenExecuted||dY(r,e)},[e]),g.jsxs(g.Fragment,{children:[g.jsx(pp,{ref:t}),g.jsx("div",{...n,ref:i,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:e}})]})};var Qd=function(e,n){return Qd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])},Qd(e,n)};function hc(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Qd(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var X=function(){return X=Object.assign||function(n){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},X.apply(this,arguments)};function Dr(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]]);return t}function T2(e,n,t,i){function r(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function u(d){try{f(i.next(d))}catch(c){s(c)}}function o(d){try{f(i.throw(d))}catch(c){s(c)}}function f(d){d.done?a(d.value):r(d.value).then(u,o)}f((i=i.apply(e,n||[])).next())})}function D2(e,n){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(d){return o([f,d])}}function o(f){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(t=0)),t;)try{if(i=1,r&&(a=f[0]&2?r.return:f[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,f[1])).done)return a;switch(r=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,r=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){t.label=f[1];break}if(f[0]===6&&t.label<a[1]){t.label=a[1],a=f;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(f);break}a[2]&&t.ops.pop(),t.trys.pop();continue}f=n.call(e,t)}catch(d){f=[6,d],r=0}finally{i=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function We(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],s;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return a}function cY(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;for(var i=Array(e),r=0,n=0;n<t;n++)for(var a=arguments[n],s=0,u=a.length;s<u;s++,r++)i[r]=a[s];return i}function Za(e,n,t){if(t||arguments.length===2)for(var i=0,r=n.length,a;i<r;i++)(a||!(i in n))&&(a||(a=Array.prototype.slice.call(n,0,i)),a[i]=n[i]);return e.concat(a||Array.prototype.slice.call(n))}function Xd(e,n){var t,i;return e&&n?(t=""+e+n[0].toUpperCase()+n.slice(1),i=e+"-"+n):(t=e||n,i=e||n),{camelCase:t,snakeCase:i}}function wp(e){return/^blob:/.test(e)}function hY(e){return/^data:/.test(e)}function Ap(e){return wp(e)||hY(e)}function gY(e){if(Ap(e))return!1;var n=window.location,t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,i=t.exec(e)||[],r={protocol:i[1]||"",host:i[2]||"",port:i[3]||""},a=function(u){return u==="http"?80:433},s=function(u){return u.port||a(u.protocol||n.protocol)};return!(!r.protocol&&!r.host&&!r.port||r.protocol&&r.protocol==n.protocol&&r.host&&r.host==n.host&&r.host&&s(r)==s(n))}function mY(e){return Array.isArray(e)}function ke(e){return typeof e=="function"}function Ke(e){return e===void 0}var Di=function(e){return e!==null&&typeof e=="object"};function os(e,n,t){t===void 0&&(t={});var i={};return Di(e)?(Object.keys(n).forEach(function(r){Ke(e[r])?i[r]=n[r]:Di(n[r])?Di(e[r])?i[r]=os(e[r],n[r],t[r]):i[r]=e[r]?n[r]:t[r]:n[r]===!0||n[r]===!1?i[r]=!!e[r]:i[r]=e[r]}),i):e?n:t}function ri(e){var n=Number(e);return Number.isNaN(n)?e:n}function I2(e){return e===!0||e===!1}function Te(e){return typeof e=="number"}function vY(e){return typeof e=="string"}function bp(e){return e!==e}function qn(e){return Te(e)&&!bp(e)||vY(e)&&!Number.isNaN(parseFloat(e))&&isFinite(parseFloat(e))}function kp(e,n){return Math.sqrt(Math.pow(e.left-n.left,2)+Math.pow(e.top-n.top,2))}function Dt(e,n,t){return t===void 0&&(t=.001),Math.abs(n-e)<t}function ui(e,n,t){return Dt(e,n,t)?!1:e>n}function Sr(e,n,t){return Dt(e,n,t)?!1:e<n}function pY(e){var n=+e;return n===0||bp(n)?n:n>0?1:-1}function H2(e){return new Promise(function(n){setTimeout(function(){n()},e)})}function Ga(e){if(!Di(e))return e;var n={};return Array.isArray(e)?n=e.map(function(t){return Ga(t)}):Object.keys(e).forEach(function(t){return n[t]=Ga(e[t])}),n}function kr(e,n,t){if(t===void 0&&(t=.001),Te(e)&&Te(n)&&Dt(e,n,t)||e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r=void 0;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!kr(e[r],n[r],t))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();var a=Object.keys(e);if(i=a.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;r--!==0;){var s=a[r];if(!kr(e[s],n[s],t))return!1}return!0}return e!==e&&n!==n}function yp(){return{left:0,top:0,width:0,height:0}}function wY(e){return e==="west"||e==="south"||e==="north"||e==="east"}function xp(e,n){var t,i;function r(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var o=Date.now()-t,f=ke(n)?n():n||0;o<f&&o>=0?i=setTimeout(function(){return r.apply(void 0,s)},f-o):e.apply(void 0,s)}function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t=Date.now(),i=setTimeout(function(){return r.apply(void 0,s)},ke(n)?n():n||0)}return a.clear=function(){clearTimeout(i)},a}var Jn=["left","right","top","bottom"],AY=["left","right"],bY=["top","bottom"];function _n(e,n){return{left:e.left-n.left,top:e.top-n.top}}function Ie(e){return{left:e.left+e.width/2,top:e.top+e.height/2}}function kY(e){return{left:"right",top:"bottom",right:"left",bottom:"top"}[e]}function L2(e,n){return Math.pow(e.width-n.width,2)+Math.pow(e.height-n.height,2)}function ct(e,n){return{left:e.left-n.left,top:e.top-n.top,width:e.width+n.left+n.right,height:e.height+n.top+n.bottom}}function gc(e){return{left:-e.left,top:-e.top}}function nn(e,n){return X(X({},e),{left:e.left+n.left,top:e.top+n.top})}function Mn(e){return{left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height}}function At(e,n,t,i){if(n!==1)if("left"in e||"top"in e)if(t){var r=Ie(e);return{width:e.width*n,height:e.height*n,left:e.left+e.width*(1-n)/2+(t.left-r.left)*(1-n),top:e.top+e.height*(1-n)/2+(t.top-r.top)*(1-n)}}else return{width:e.width*n,height:e.height*n,left:e.left+e.width*(1-n)/2,top:e.top+e.height*(1-n)/2};else return{width:e.width*n,height:e.height*n};else return e}function he(e){return e.width/e.height}function Kd(e,n){return Math.min(n.maxWidth?n.maxWidth/e.width:1/0,n.maxHeight?n.maxHeight/e.height:1/0)}function yY(e,n){return Math.max(n.minWidth?n.minWidth/e.width:0,n.minHeight?n.minHeight/e.height:0)}function Wa(e,n){var t;return n.minimum&&Sr(e,n.minimum)?t=n.minimum:n.maximum&&ui(e,n.maximum)&&(t=n.maximum),t}function mc(e,n){var t=he(e),i=1;return n.minWidth>0&&n.minHeight>0?t>n.minWidth/n.minHeight?e.height<n.minHeight&&(i=n.minHeight/e.height):e.width<n.minWidth&&(i=n.minWidth/e.width):n.minWidth>0?e.width<n.minWidth&&(i=n.minWidth/e.width):n.minHeight>0&&e.height<n.minHeight&&(i=n.minHeight/e.height),n.maxWidth<1/0&&n.maxHeight<1/0?t>n.maxWidth/n.maxHeight?e.width>n.maxWidth&&(i=n.maxWidth/e.width):e.height>n.maxHeight&&(i=n.maxHeight/e.height):n.maxWidth<1/0?e.width>n.maxWidth&&(i=n.maxWidth/e.width):n.maxHeight<1/0&&e.height>n.maxHeight&&(i=n.maxHeight/e.height),i}function No(e,n){var t={left:0,top:0,right:0,bottom:0};return Jn.forEach(function(i){var r=n[i],a=Mn(e)[i];r!==void 0&&a!==void 0?i==="left"||i==="top"?t[i]=Math.max(0,r-a):t[i]=Math.max(0,a-r):t[i]=0}),t}function lu(e,n){return At(e,mc(e,n))}function Cp(e,n){var t=n*Math.PI/180;return{width:Math.abs(e.width*Math.cos(t))+Math.abs(e.height*Math.sin(t)),height:Math.abs(e.width*Math.sin(t))+Math.abs(e.height*Math.cos(t))}}function Tt(e,n,t){var i=n*Math.PI/180;return t?{left:(e.left-t.left)*Math.cos(i)-(e.top-t.top)*Math.sin(i)+t.left,top:(e.left-t.left)*Math.sin(i)+(e.top-t.top)*Math.cos(i)+t.top}:{left:e.left*Math.cos(i)-e.top*Math.sin(i),top:e.left*Math.sin(i)+e.top*Math.cos(i)}}function zp(e){return{minWidth:0,minHeight:0,maxWidth:e.right!==void 0&&e.left!==void 0?e.right-e.left:1/0,maxHeight:e.bottom!==void 0&&e.top!==void 0?e.bottom-e.top:1/0}}function hi(e,n){var t={};return Jn.forEach(function(i){var r=e[i],a=n[i];r!==void 0&&a!==void 0?i==="left"||i==="top"?t[i]=Math.max(r,a):t[i]=Math.min(r,a):a!==void 0?t[i]=a:r!==void 0&&(t[i]=r)}),t}function cu(e,n){var t={left:0,top:0},i=No(e,n);return i.left&&i.left>0?t.left=i.left:i.right&&i.right>0&&(t.left=-i.right),i.top&&i.top>0?t.top=i.top:i.bottom&&i.bottom>0&&(t.top=-i.bottom),t}function Qe(e,n){return nn(e,cu(e,n))}function xY(e,n){return n?e?{minimum:Math.min(e.maximum,Math.max(e.minimum,n.minimum)),maximum:Math.max(e.minimum,Math.min(e.maximum,n.maximum))}:n:e}function $i(e){return e===void 0&&(e={}),Te(e)?{minimum:e,maximum:e}:{minimum:qn(e.minimum)?e.minimum:0,maximum:qn(e.maximum)?e.maximum:1/0}}function Ud(e,n){return(Ke(n.maxWidth)||!ui(e.width,n.maxWidth))&&(Ke(n.maxHeight)||!ui(e.height,n.maxHeight))&&(Ke(n.minHeight)||!Sr(e.height,n.minHeight))&&(Ke(n.minWidth)||!Sr(e.width,n.minWidth))}function N2(e,n){return(Ke(n.left)||!Sr(e.left,n.left))&&(Ke(n.top)||!Sr(e.top,n.top))&&(Ke(n.right)||!ui(e.left+e.width,n.right))&&(Ke(n.bottom)||!ui(e.top+e.height,n.bottom))}function CY(e,n,t,i){var r=function(a){return e.reduce(function(s,u){var o=ke(t)?t(u):t,f=o.maxHeight,d=o.maxWidth,c=o.minWidth,l=o.minHeight,h=$i(ke(i)?i(u):i),m=a?{maxWidth:d,maxHeight:f}:{maxWidth:d,maxHeight:f,minWidth:c,minHeight:l};return Ud(u,m)&&!Wa(he(u),h)&&u.width&&u.height&&(!s||Sr(L2(u,n),L2(s,n)))?u:s},null)};return r()||r(!0)}function Gn(e){return!!(e&&e.visibleArea&&e.coordinates)}function tt(e,n){return MY(e,n)}function $n(e,n){return ke(n.areaPositionRestrictions)?n.areaPositionRestrictions(e,n):n.areaPositionRestrictions}function it(e,n){return OY(e,n)}function En(e,n){return ke(n.positionRestrictions)?n.positionRestrictions(e,n):n.positionRestrictions}function er(e){return e.visibleArea?e.visibleArea.width/e.boundary.width:0}function vc(e){if(Gn(e)){var n=e.coordinates,t=n.width,i=n.height,r=n.left,a=n.top,s=er(e);return{width:t/s,height:i/s,left:(r-e.visibleArea.left)/s,top:(a-e.visibleArea.top)/s}}else return yp()}function gi(e,n){return $i(ke(n.aspectRatio)?n.aspectRatio(e,n):n.aspectRatio)}function Z2(e,n){return ke(n.defaultCoordinates)?n.defaultCoordinates(e,n):n.defaultCoordinates}function G2(e,n){return ke(n.defaultVisibleArea)?n.defaultVisibleArea(e,n):n.defaultVisibleArea}function zY(e,n){var t=X(X({},e.transforms),{flip:X({},e.transforms.flip)});if(n.defaultTransforms){var i=ke(n.defaultTransforms)?n.defaultTransforms(e,n):n.defaultTransforms;Te(i.rotate)&&(t.rotate=i.rotate),i.flip&&(I2(i.flip.horizontal)&&(t.flip.horizontal=i.flip.horizontal),I2(i.flip.vertical)&&(t.flip.vertical=i.flip.vertical))}return t}function Lt(e){return e.imageSize&&e.imageSize.width&&e.imageSize.height?Cp(e.imageSize,e.transforms.rotate):{width:0,height:0}}function PY(e){return e.coordinates?Math.min(e.coordinates.width,e.coordinates.height,20*er(e)):1}function BY(e,n){if(Gn(e)){var t=it(e,n),i=En(e,n),r={width:Math.round(e.coordinates.width),height:Math.round(e.coordinates.height),left:Math.round(e.coordinates.left),top:Math.round(e.coordinates.top)};return r.width>t.maxWidth?r.width=Math.floor(e.coordinates.width):r.width<t.minWidth&&(r.width=Math.ceil(e.coordinates.width)),r.height>t.maxHeight?r.height=Math.floor(e.coordinates.height):r.height<t.minHeight&&(r.height=Math.ceil(e.coordinates.height)),Qe(r,i)}else return null}function W2(e,n){return Gn(e)?!Wa(he(e.coordinates),gi(e,n))&&Ud(e.visibleArea,tt(e,n))&&Ud(e.coordinates,it(e,n))&&N2(e.visibleArea,$n(e,n))&&N2(e.coordinates,En(e,n)):!0}function pc(e){var n=X({},e);return n.minWidth>n.maxWidth&&(n.minWidth=n.maxWidth),n.minHeight>n.maxHeight&&(n.minHeight=n.maxHeight),n}function wc(e,n){var t=e,i=X({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},n);return pc({maxHeight:Math.min(t.maxHeight,i.maxHeight),minHeight:Math.max(t.minHeight,i.minHeight),maxWidth:Math.min(t.maxWidth,i.maxWidth),minWidth:Math.max(t.minWidth,i.minWidth)})}function OY(e,n){var t=ke(n.sizeRestrictions)?n.sizeRestrictions(e,n):n.sizeRestrictions,i=En(e,n),r={minWidth:qn(t.minWidth)?ri(t.minWidth):0,minHeight:qn(t.minHeight)?ri(t.minHeight):0,maxWidth:qn(t.maxWidth)?ri(t.maxWidth):1/0,maxHeight:qn(t.maxHeight)?ri(t.maxHeight):1/0};return i.left!==void 0&&i.right!==void 0&&(r.maxWidth=Math.min(r.maxWidth,i.right-i.left)),i.bottom!==void 0&&i.top!==void 0&&(r.maxHeight=Math.min(r.maxHeight,i.bottom-i.top)),pc(r)}function MY(e,n){var t=ke(n.areaSizeRestrictions)?n.areaSizeRestrictions(e,n):n.areaSizeRestrictions;return t.maxWidth<1/0&&t.maxHeight<1/0&&(he(e.boundary)>t.maxWidth/t.maxHeight?t.maxHeight=t.maxWidth/he(e.boundary):t.maxWidth=t.maxHeight*he(e.boundary)),pc(t)}function ln(e){return Ga(e)}var Qi;(function(e){e.fillArea="fillArea",e.fitArea="fitArea",e.stencil="stencil",e.none="none"})(Qi||(Qi={}));var Vd;(function(e){e.coordinates="coordinates",e.visibleArea="visibleArea"})(Vd||(Vd={}));function et(e){var n=e.width,t=e.height,i=e.sizeRestrictions||{minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},r=$i(e.aspectRatio),a={width:Math.max(i.minWidth,Math.min(i.maxWidth,n)),height:Math.max(i.minHeight,Math.min(i.maxHeight,t))},s=[a];return r&&[r.minimum,r.maximum].forEach(function(u){u&&s.push({width:a.width,height:a.width/u},{width:a.height*u,height:a.height})}),s=s.map(function(u){return lu(u,i)}),CY(s,{width:n,height:t},i,r)}function Pp(e,n){var t=ln(e);if(e.visibleArea){var i=tt(e,n);t.visibleArea=X(X({},e.visibleArea),et({width:e.visibleArea.width,height:e.visibleArea.height,aspectRatio:{minimum:he(t.boundary),maximum:he(t.boundary)},sizeRestrictions:i})),t.visibleArea=nn(t.visibleArea,_n(Ie(e.visibleArea),Ie(t.visibleArea))),t.visibleArea=Qe(t.visibleArea,$n(t,n))}return t}function Bp(e,n,t){var i=nn(e,n);return t?Qe(i,t):i}var mt;(function(e){e.limit="limit",e.zoom="zoom",e.unsafe="unsafe"})(mt||(mt={}));function Jd(e,n,t,i){i===void 0&&(i=!0);var r=i===!1?mt.unsafe:i===!0?mt.zoom:i,a=gi(e,n),s=it(e,n);e.visibleArea&&r===mt.limit&&(s=X(X({},s),{minWidth:Math.min(e.visibleArea.width,s.minWidth),minHeight:Math.min(e.visibleArea.height,s.minHeight),maxWidth:Math.min(e.visibleArea.width,s.maxWidth),maxHeight:Math.min(e.visibleArea.height,s.maxHeight)}));var u=En(e,n);e.visibleArea&&r===mt.limit&&(u=hi(u,Mn(e.visibleArea)));var o=function(A,y){return Bp(A,{left:y.left-(A.left||0),top:y.top-(A.top||0)},u)},f=function(A,y){var x=X(X(X({},A),et({width:y.width,height:y.height,sizeRestrictions:s,aspectRatio:a})),{left:0,top:0});return o(x,{left:A.left||0,top:A.top||0})},d=e.coordinates?X({},e.coordinates):yp(),c=Array.isArray(t)?t:[t];c.forEach(function(A){var y;typeof A=="function"?y=A(X(X({},e),{coordinates:d}),n):y=A,y&&((!Ke(y.width)||!Ke(y.height))&&(d=f(d,X(X({},d),y))),(!Ke(y.left)||!Ke(y.top))&&(d=o(d,X(X({},d),y))))});var l=X(X({},ln(e)),{coordinates:d});if(l.visibleArea&&r===mt.zoom){var h=Math.max(0,l.coordinates.width-l.visibleArea.width),m=Math.max(0,l.coordinates.height-l.visibleArea.height),b=tt(e,n),k=h>m?l.coordinates.width/l.visibleArea.width:l.coordinates.height/l.visibleArea.height;return k>1&&(l.visibleArea=At(l.visibleArea,Math.min(k,Kd(l.visibleArea,b)))),l.visibleArea=nn(l.visibleArea,gc(cu(l.coordinates,Mn(l.visibleArea)))),Pp(l,n)}else return l}function Op(e,n){if(e.coordinates){var t=ln(e),i=gi(e,n),r=it(e,n);return t.coordinates=X(X({},e.coordinates),et({width:e.coordinates.width,height:e.coordinates.height,aspectRatio:i,sizeRestrictions:e.visibleArea?{maxWidth:Math.min(e.visibleArea.width,r.maxWidth),maxHeight:Math.min(e.visibleArea.height,r.maxHeight),minHeight:Math.min(e.visibleArea.height,r.minHeight),minWidth:Math.min(e.visibleArea.width,r.minWidth)}:r})),t.coordinates=nn(t.coordinates,_n(Ie(e.coordinates),Ie(t.coordinates))),t.coordinates=Qe(t.coordinates,e.visibleArea?hi(Mn(e.visibleArea),En(t,n)):En(t,n)),t}return e}function qd(e,n,t,i){i===void 0&&(i=!0);var r=X(X({},ln(e)),{visibleArea:t});return r=Pp(r,n),i&&(r=Op(r,n)),r}function EY(e,n){var t,i,r,a,s,u=e.boundary,o=e.image,f={boundary:{width:u.width,height:u.height},imageSize:{width:o.width,height:o.height},transforms:{rotate:((t=o.transforms)===null||t===void 0?void 0:t.rotate)||0,flip:{horizontal:((r=(i=o.transforms)===null||i===void 0?void 0:i.flip)===null||r===void 0?void 0:r.horizontal)||!1,vertical:((s=(a=o.transforms)===null||a===void 0?void 0:a.flip)===null||s===void 0?void 0:s.vertical)||!1}},visibleArea:null,coordinates:null};return n.defaultTransforms&&(f.transforms=zY(f,n)),n.priority===Vd.visibleArea?(f=qd(f,n,G2(f,n),!1),f=Jd(f,n,Z2(f,n),mt.limit)):(f=Jd(f,n,Z2(f,n),mt.unsafe),f=qd(f,n,G2(f,n),!0)),f}function FY(e,n,t){if(Gn(e)){var i=ln(e);return i.coordinates=nn(i.coordinates,t),i.coordinates=Qe(i.coordinates,hi(Mn(i.visibleArea),En(i,n))),i}return e}function Y2(e){var n=e.coordinates,t=e.directions,i=e.positionRestrictions,r=e.sizeRestrictions,a=e.preserveRatio,s=e.allowedDirections,u=e.compensate,o=u===void 0?!0:u,f=X({},t),d=ct(n,f).width,c=ct(n,f).height;d<0&&(f.left<0&&f.right<0?(f.left=-(n.width-r.minWidth)/(f.left/f.right),f.right=-(n.width-r.minWidth)/(f.right/f.left)):f.left<0?f.left=-(n.width-r.minWidth):f.right<0&&(f.right=-(n.width-r.minWidth))),c<0&&(f.top<0&&f.bottom<0?(f.top=-(n.height-r.minHeight)/(f.top/f.bottom),f.bottom=-(n.height-r.minHeight)/(f.bottom/f.top)):f.top<0?f.top=-(n.height-r.minHeight):f.bottom<0&&(f.bottom=-(n.height-r.minHeight)));var l=No(ct(n,f),i),h=Jn.every(function(A){return!ui(l[kY(A)],0)||s[A]});o&&h&&(l.left&&l.left>0&&l.right===0?(f.right+=l.left,f.left-=l.left):l.right&&l.right>0&&l.left===0&&(f.left+=l.right,f.right-=l.right),l.top&&l.top>0&&l.bottom===0?(f.bottom+=l.top,f.top-=l.top):l.bottom&&l.bottom>0&&l.top===0&&(f.top+=l.bottom,f.bottom-=l.bottom),l=No(ct(n,f),i));var m={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Jn.forEach(function(A){var y=l[A];y&&f[A]&&(m[A]=Math.max(0,1-y/f[A]))}),a){var b=Math.min.apply(Math,Jn.map(function(A){return m[A]}));b!==1/0&&Jn.forEach(function(A){f[A]*=b})}else Jn.forEach(function(A){m[A]!==1/0&&(f[A]*=m[A])});if(d=ct(n,f).width,c=ct(n,f).height,f.right+f.left&&(d>r.maxWidth?m.width=(r.maxWidth-n.width)/(f.right+f.left):d<r.minWidth&&(m.width=(r.minWidth-n.width)/(f.right+f.left))),f.bottom+f.top&&(c>r.maxHeight?m.height=(r.maxHeight-n.height)/(f.bottom+f.top):c<r.minHeight&&(m.height=(r.minHeight-n.height)/(f.bottom+f.top))),a){var k=Math.min(m.width,m.height);k!==1/0&&Jn.forEach(function(A){f[A]*=k})}else m.width!==1/0&&AY.forEach(function(A){f[A]*=m.width}),m.height!==1/0&&bY.forEach(function(A){f[A]*=m.height});return f}function js(e,n,t){return Dt(n+t,0)?e/2:Dt(n,0)?0:Dt(t,0)?e:e*Math.abs(n/(n+t))}function SY(e,n,t,i){var r=i.aspectRatio,a=i.positionRestrictions,s=i.sizeRestrictions,u=X({},e);n=X({},n);var o=t.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};e.width<s.minWidth&&(n.left=0,n.right=0),e.height<s.minHeight&&(n.top=0,n.bottom=0),Jn.forEach(function(x){o[x]||(n[x]=0)}),n=Y2({coordinates:u,directions:n,sizeRestrictions:s,positionRestrictions:a,allowedDirections:o});var f=ct(u,n).width,d=ct(u,n).height,c=t.preserveAspectRatio?he(u):Wa(f/d,r);if(c){var l=t.respectDirection;if(l!=="width"&&l!=="height"&&(u.width>=u.height||c===1?l="width":l="height"),l==="width"){var h=f/c-u.height;if(o.top&&o.bottom){var m=n.top,b=n.bottom;n.bottom=js(h,b,m),n.top=js(h,m,b)}else o.bottom?n.bottom=h:o.top?n.top=h:o.right?n.right=0:o.left&&(n.left=0)}else if(l==="height"){var k=u.width-d*c;if(o.left&&o.right){var A=n.left,y=n.right;n.left=-js(k,A,y),n.right=-js(k,y,A)}else o.left?n.left=-k:o.right?n.right=-k:o.top?n.top=0:o.bottom&&(n.bottom=0)}n=Y2({directions:n,coordinates:u,sizeRestrictions:s,positionRestrictions:a,preserveRatio:!0,compensate:t.compensate,allowedDirections:o})}return f=ct(u,n).width,d=ct(u,n).height,c=t.preserveAspectRatio?he(u):Wa(f/d,r),c&&ui(Math.abs(c-f/d),0)&&Jn.forEach(function(x){n[x]=0}),Bp({width:e.width+n.right+n.left,height:e.height+n.top+n.bottom,left:e.left,top:e.top},{left:-n.left,top:-n.top},a)}function Q2(e,n){var t=n.toLowerCase();return{left:e.left+e.width*(t.indexOf("west")!==-1?1:t.indexOf("east")!==-1?0:.5),top:e.top+e.height*(t.indexOf("north")!==-1?1:t.indexOf("south")!==-1?0:.5)}}function Mp(e){var n=e.toLowerCase();return{left:n.indexOf("east")===-1,top:n.indexOf("south")===-1,right:n.indexOf("west")===-1,bottom:n.indexOf("north")===-1}}function RY(e,n){var t=e.toLowerCase(),i={left:t.indexOf("west")===-1?n.left:-n.left,top:-n.top,right:n.left,bottom:n.top};["north","south","center"].every(function(a){return t.indexOf(a)===-1})&&(i.top=0,i.bottom=0),["west","east","center"].every(function(a){return t.indexOf(a)===-1})&&(i.left=0,i.right=0);var r=Mp(e);return Jn.forEach(function(a){r[a]||(i[a]=0)}),i}function jY(e,n,t,i,r){var a=i.reference,s=RY(n,t),u=Mp(n),o=SY(e,s,X(X({},i),{allowedDirections:u}),r);return a&&(o=nn(o,_n(Q2(a,n),Q2(o,n)))),Qe(o,r.positionRestrictions)}function TY(e,n,t,i,r){var a=PY(e),s=it(e,n);return Gn(e)?X(X({},ln(e)),{coordinates:jY(e.coordinates,t,i,r,{positionRestrictions:hi(En(e,n),Mn(e.visibleArea)),sizeRestrictions:{maxWidth:Math.min(s.maxWidth,e.visibleArea.width),maxHeight:Math.min(s.maxHeight,e.visibleArea.height),minWidth:Math.max(Math.min(s.minWidth,e.visibleArea.width),a),minHeight:Math.max(Math.min(s.minHeight,e.visibleArea.height),a)},aspectRatio:gi(e,n)})}):e}function DY(e,n,t){var i=X(X({},ln(e)),{boundary:t});if(i.visibleArea&&i.coordinates&&e.visibleArea){i.visibleArea.height=i.visibleArea.width/he(t),i.visibleArea.top+=(e.visibleArea.height-i.visibleArea.height)/2;var r=it(i,n);(Math.max(r.minHeight,i.coordinates.height)-i.visibleArea.height>0||Math.max(r.minWidth,i.coordinates.width)-i.visibleArea.width>0)&&(i.visibleArea=At(i.visibleArea,Math.max(Math.max(r.minHeight,i.coordinates.height)/i.visibleArea.height,Math.max(r.minWidth,i.coordinates.width)/i.visibleArea.width))),i.visibleArea=lu(i.visibleArea,tt(i,n));var a=gc(cu(i.coordinates,Mn(i.visibleArea)));i.visibleArea.width<i.coordinates.width&&(a.left=0),i.visibleArea.height<i.coordinates.height&&(a.top=0),i.visibleArea=nn(i.visibleArea,a),i.visibleArea=Qe(i.visibleArea,$n(i,n)),i=Op(i,n)}return i}function IY(e,n,t){if(Gn(e)){var i=ln(e),r=Te(t)?t:t.angle,a=Tt(Ie(X({left:0,top:0},Lt(e))),r);i.transforms.rotate+=r,i.coordinates=X(X({},et({sizeRestrictions:it(i,n),aspectRatio:gi(i,n),width:i.coordinates.width,height:i.coordinates.height})),Tt(Ie(i.coordinates),r));var s=!Te(t)&&t.center?t.center:Ie(e.coordinates),u=_n(Ie(e.coordinates),Tt(Ie(e.coordinates),r,s)),o=Lt(i);return i.coordinates.left-=a.left-o.width/2+i.coordinates.width/2-u.left,i.coordinates.top-=a.top-o.height/2+i.coordinates.height/2-u.top,i.visibleArea=lu(i.visibleArea,wc(tt(i,n),{minWidth:i.coordinates.width,minHeight:i.coordinates.height})),i.coordinates=Qe(i.coordinates,En(i,n)),i.visibleArea=nn(i.visibleArea,_n(Ie(i.coordinates),Ie(e.coordinates))),i.visibleArea=Qe(i.visibleArea,$n(i,n)),i}return e}function HY(e,n,t,i){if(Gn(e)){var r=ln(e),a=e.transforms.rotate,s=Lt(e),u={horizontal:t,vertical:i};if(u.horizontal||u.vertical){var o=Tt({left:s.width/2,top:s.height/2},-a),f=Tt(Ie(r.coordinates),-a),d=Tt({left:u.horizontal?o.left-(f.left-o.left):f.left,top:u.vertical?o.top-(f.top-o.top):f.top},a);r.coordinates=nn(r.coordinates,_n(d,Ie(r.coordinates))),f=Tt(Ie(r.visibleArea),-a),d=Tt({left:u.horizontal?o.left-(f.left-o.left):f.left,top:u.vertical?o.top-(f.top-o.top):f.top},a),r.visibleArea=nn(r.visibleArea,_n(d,Ie(r.visibleArea))),r.visibleArea=Qe(r.visibleArea,$n(r,n))}return u.horizontal&&(r.transforms.flip.horizontal=!e.transforms.flip.horizontal),u.vertical&&(r.transforms.flip.vertical=!e.transforms.flip.vertical),r}return e}function LY(e,n,t){var i,r=t.scale,a=r===void 0?1:r,s=t.move,u=s===void 0?{}:s;if(Gn(e)){var o=ln(e),f=1/(Te(a)?a:a.factor),d=Te(a)?void 0:a.center,c=!Dt(f,1),l=1,h=1;o.visibleArea=nn(o.visibleArea,{left:u.left||0,top:u.top||0});var m=it(o,n),b=En(o,n),k=tt(o,n),A={stencil:{minimum:Math.max(m.minWidth?m.minWidth/o.coordinates.width:0,m.minHeight?m.minHeight/o.coordinates.height:0),maximum:Math.min(m.maxWidth?m.maxWidth/o.coordinates.width:1/0,m.maxHeight?m.maxHeight/o.coordinates.height:1/0,Kd(o.coordinates,zp(b)))},area:{maximum:Kd(o.visibleArea,k),minimum:yY(o.visibleArea,k)}};f&&c&&(f<1?(h=Math.max(f,Math.max(A.area.minimum,A.stencil.minimum)),h>1&&(h=1)):f>1&&(h=Math.min(f,Math.min(A.area.maximum,A.stencil.maximum)),h<1&&(h=1))),h&&(o.visibleArea=At(o.visibleArea,h,d));var y={left:e.coordinates.left-e.visibleArea.left,right:e.visibleArea.width+e.visibleArea.left-(e.coordinates.width+e.coordinates.left),top:e.coordinates.top-e.visibleArea.top,bottom:e.visibleArea.height+e.visibleArea.top-(e.coordinates.height+e.coordinates.top)};return o.visibleArea=Qe(o.visibleArea,{left:b.left!==void 0?b.left-y.left*h:void 0,top:b.top!==void 0?b.top-y.top*h:void 0,bottom:b.bottom!==void 0?b.bottom+y.bottom*h:void 0,right:b.right!==void 0?b.right+y.right*h:void 0}),o.visibleArea=Qe(o.visibleArea,$n(o,n)),o.coordinates.width=o.coordinates.width*h,o.coordinates.height=o.coordinates.height*h,o.coordinates.left=o.visibleArea.left+y.left*h,o.coordinates.top=o.visibleArea.top+y.top*h,o.coordinates=Qe(o.coordinates,hi(Mn(o.visibleArea),b)),c&&f&&(!((i=n.transformImage)===null||i===void 0)&&i.adjustStencil)&&(f>1?l=Math.min(A.area.maximum,f)/h:f<1&&(l=Math.max(o.coordinates.height/o.visibleArea.height,o.coordinates.width/o.visibleArea.width,f/h)),l!==1&&(o.visibleArea=At(o.visibleArea,l,f>1?d:Ie(o.coordinates)),o.visibleArea=Qe(o.visibleArea,$n(o,n)),o.visibleArea=nn(o.visibleArea,gc(cu(o.coordinates,Mn(o.visibleArea)))))),o}return e}function NY(e,n,t){return t.rotate&&(e=IY(e,n,t.rotate)),t.flip&&(e=HY(e,n,t.flip.horizontal,t.flip.vertical)),(t.move||t.scale)&&(e=LY(e,n,t)),e}function ZY(e,n){if(Gn(e)){var t=ln(e),i=gi(e,n),r=it(e,n),a=tt(e,n),s=Wa(he(e.coordinates),i),u=s?{height:e.coordinates.height,width:e.coordinates.height*s}:e.coordinates;t.coordinates=X(X({},t.coordinates),et({width:u.width,height:u.height,aspectRatio:i,sizeRestrictions:wc(a,r)})),t.coordinates=nn(t.coordinates,_n(Ie(e.coordinates),Ie(t.coordinates)));var o=Math.max(t.coordinates.width/t.visibleArea.width,t.coordinates.height/t.visibleArea.height,1);return t.visibleArea=X(X({},e.visibleArea),et({width:e.visibleArea.width*o,height:e.visibleArea.height*o,aspectRatio:{minimum:he(t.boundary),maximum:he(t.boundary)},sizeRestrictions:a})),t.visibleArea=nn(t.visibleArea,_n(Ie(e.visibleArea),Ie(t.visibleArea))),t.visibleArea=Qe(t.visibleArea,$n(t,n)),t.coordinates=Qe(t.coordinates,hi(Mn(t.visibleArea),En(t,n))),t}return e}function GY(e,n){var t=er(e);return{left:Te(n.left)?n.left*t:0,top:Te(n.top)?n.top*t:0,right:Te(n.right)?n.right*t:0,bottom:Te(n.bottom)?n.bottom*t:0}}function X2(e,n){var t=er(e);return e.visibleArea?{left:n.left*t+e.visibleArea.left,top:n.top*t+e.visibleArea.top}:n}function WY(e,n){if(e){var t=Math.abs(e.transforms.rotate%180);return t<=45||t>=135?n:{horizontal:n.vertical,vertical:n.horizontal}}return n}function YY(e){return{left:Te(e.left)?e.left:0,top:Te(e.top)?e.top:0}}function QY(e){return{left:Te(e.left)?e.left:0,top:Te(e.top)?e.top:0,right:Te(e.right)?e.right:0,bottom:Te(e.bottom)?e.bottom:0}}function Ep(e,n){var t=er(e);return{left:Te(n.left)?n.left*t:0,top:Te(n.top)?n.top*t:0}}function XY(e,n){return n.scale&&(n.scale={factor:Te(n.scale)?n.scale:n.scale.factor,center:!Te(n.scale)&&n.scale.center?X2(e,n.scale.center):void 0}),n.rotate&&(n.rotate={angle:Te(n.rotate)?n.rotate:n.rotate.angle,center:!Te(n.rotate)&&n.rotate.center?X2(e,n.rotate.center):void 0}),n.move&&(n.move=Ep(e,n.move)),n}function K2(e,n){var t=n.getBoundingClientRect(),i=t.left,r=t.top,a={left:0,top:0},s=0;return e.forEach(function(u){a.left+=(u.clientX-i)/e.length,a.top+=(u.clientY-r)/e.length}),e.forEach(function(u){s+=kp({left:a.left,top:a.top},{left:u.clientX-i,top:u.clientY-r})}),{centerMass:a,spread:s,count:e.length}}function KY(e,n,t,i){i===void 0&&(i={});var r,a,s;if(n.length===1&&e.length===1)i.move&&(r={left:n[0].clientX-e[0].clientX,top:n[0].clientY-e[0].clientY});else if(e.length>1){var u=K2(n,t),o=K2(e,t);if(i.rotate&&n.length===2&&e.length===2){var f={left:[e[0].clientX-e[1].clientX,n[0].clientX-n[1].clientX],top:[e[0].clientY-e[1].clientY,n[0].clientY-n[1].clientY]},d=f.left[0]*f.top[1]-f.left[1]*f.top[0],c=f.left[0]*f.left[1]+f.top[0]*f.top[1];if(!Dt(c,0)&&!Dt(d,0)){var l=Math.atan2(d,c),h=-(l*180)/Math.PI;s={center:o.centerMass,angle:h}}}i.move&&(r={left:u.centerMass.left-o.centerMass.left,top:u.centerMass.top-o.centerMass.top}),i.scale&&(a={factor:o.spread/u.spread,center:o.centerMass})}return{move:r,scale:a,rotate:s}}function UY(e,n,t){t===void 0&&(t=.1);var i=n.getBoundingClientRect(),r=i.left,a=i.top,s=1-t*pY(e.deltaY||e.detail||e.wheelDelta),u={left:e.clientX-r,top:e.clientY-a};return{scale:{factor:s,center:u}}}function Ts(e){return e.moveCoordinates||e.resizeCoordinates||e.transformImage.move||e.transformImage.rotate||e.transformImage.flip||e.transformImage.scale}function VY(){return{moveCoordinates:!1,resizeCoordinates:!1,transformImage:{rotate:!1,move:!1,scale:!1,flip:!1}}}function JY(e,n){var t=Lt(e),i={};return n.imageRestriction&&n.imageRestriction!=="none"&&(i={left:0,top:0,right:t.width,bottom:t.height}),i}function qY(e,n){var t=e.coordinates,i=e.boundary,r=Lt(e),a=he(i);if(t){var s={height:Math.max(t.height,r.height),width:Math.max(t.width,r.width)},u={left:0,top:0,width:he(s)>a?s.width:s.height*a,height:he(s)>a?s.width/a:s.height};u=lu(u,tt(e,n)),u.left=t.left+t.width/2-u.width/2,u.top=t.top+t.height/2-u.height/2;var o=No(t,Mn(X({left:0,top:0},r))),f={};return!o.left&&!o.right&&u.width<=r.width&&(f.left=0,f.right=r.width),!o.top&&!o.bottom&&u.height<=r.height&&(f.top=0,f.bottom=r.height),Qe(u,f)}else{var d=he(r),c={height:d<a?r.height:r.width/a,width:d<a?r.height*a:r.width};return{left:r.width/2-c.width/2,top:r.height/2-c.height/2,width:c.width,height:c.height}}}function _Y(e,n){var t=e.imageSize,i=e.visibleArea,r=it(e,n),a=gi(e,n),s;if(i)s=i;else{var u=zp(En(e,n));s={width:Math.max(u.minWidth,Math.min(u.maxWidth,t.width)),height:Math.max(u.minHeight,Math.min(u.maxHeight,t.height))}}var o=Math.min(a.maximum||1/0,Math.max(a.minimum||0,he(s))),f=s.width<s.height?{width:s.width*.8,height:s.width*.8/o}:{height:s.height*.8,width:s.height*.8*o};return et(X(X({},f),{aspectRatio:a,sizeRestrictions:r}))}function $Y(e){return{minWidth:qn(e.minWidth)?ri(e.minWidth):0,minHeight:qn(e.minHeight)?ri(e.minHeight):0,maxWidth:qn(e.maxWidth)?ri(e.maxWidth):1/0,maxHeight:qn(e.maxHeight)?ri(e.maxHeight):1/0}}function Fp(e,n){return $Y(n)}function eQ(e){var n=e.visibleArea,t=e.coordinates,i=n||Lt(e);return{left:(n?n.left:0)+i.width/2-(t?t.width/2:0),top:(n?n.top:0)+i.height/2-(t?t.height/2:0)}}function nQ(e,n){var t=e.visibleArea,i=e.boundary,r=n.imageRestriction,a=Lt(e),s={};return r===Qi.fillArea?s={left:0,top:0,right:a.width,bottom:a.height}:r===Qi.fitArea&&(he(i)>he(a)?(s={top:0,bottom:a.height},t&&(t.width>a.width?(s.left=-(t.width-a.width)/2,s.right=a.width-s.left):(s.left=0,s.right=a.width))):(s={left:0,right:a.width},t&&(t.height>a.height?(s.top=-(t.height-a.height)/2,s.bottom=a.height-s.top):(s.top=0,s.bottom=a.height)))),s}function tQ(e,n){var t=e.boundary,i=n.imageRestriction,r=Lt(e),a={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0};return i===Qi.fillArea?(a.maxWidth=r.width,a.maxHeight=r.height):i===Qi.fitArea&&(he(t)>he(r)?(a.maxHeight=r.height,a.maxWidth=r.height*he(t)):(a.maxWidth=r.width,a.maxHeight=r.width/he(t))),a}function iQ(e){var n=e.getBoundingClientRect(),t=n.width,i=n.height;return{width:t,height:i}}function Sp(e,n){return e.aspectRatio?{}:{aspectRatio:$i(ke(n.aspectRatio)?n.aspectRatio():n.aspectRatio)}}function rQ(e){return function(n,t){var i=ke(e)?e(n,t):e;return wc(Fp(n,t),i)}}function aQ(e){return X(X({},e),{sizeRestrictions:function(n,t){var i;return e.sizeRestrictions?i=ke(e.sizeRestrictions)?e.sizeRestrictions(n,t):e.sizeRestrictions:i=Fp(n,t),i},areaPositionRestrictions:function(n,t){return e.areaPositionRestrictions?ke(e.areaPositionRestrictions)?e.areaPositionRestrictions(n,t):e.areaPositionRestrictions:nQ(n,t)},areaSizeRestrictions:function(n,t){return e.areaSizeRestrictions?ke(e.areaSizeRestrictions)?e.areaSizeRestrictions(n,t):e.areaSizeRestrictions:tQ(n,t)},positionRestrictions:function(n,t){return e.positionRestrictions?ke(e.positionRestrictions)?e.positionRestrictions(n,t):e.positionRestrictions:JY(n,t)},defaultCoordinates:function(n,t){if(e.defaultCoordinates)return ke(e.defaultCoordinates)?e.defaultCoordinates(n,t):e.defaultCoordinates;var i=e.defaultSize;i||(i=_Y);var r=ke(i)?i(n,t):i,a=e.defaultPosition||eQ;return[r,function(s){return X({},ke(a)?a(s,t):a)}]},defaultVisibleArea:function(n,t){return e.defaultVisibleArea?ke(e.defaultVisibleArea)?e.defaultVisibleArea(n,t):e.defaultVisibleArea:qY(n,t)},aspectRatio:function(n,t){return $i(ke(e.aspectRatio)?e.aspectRatio(n,t):e.aspectRatio)}})}function ao(e,n){if(e&&n){var t=n();t&&e(t)}}function Af(e,n){e.forEach(function(t){ao(t,n)})}var sQ=function(){function e(){var n=this;this.getTransitions=function(){var t=n.getData(),i=n.getProps().transitions;return X(X({},os(i,{timingFunction:"ease-in-out",duration:350})),{active:t.transitions})},this.getInteractions=function(){var t=n.getData().interactions;return Ga(t)},this.hasInteractions=function(){var t=n.getData().interactions;return Ts(t)},this.startTransitions=function(){var t=n.getProps(),i=t.onTransitionsStart,r=t.onUpdate,a=t.getInstance,s=n.getData(),u=s.transitions,o=Dr(s,["transitions"]);n.setData(X(X({},o),{transitions:!0})),u||Af([i,r],a),n.endTransitions()},this.endTransitions=xp(function(){var t=n.getProps(),i=t.onTransitionsEnd,r=t.onUpdate,a=t.getInstance;n.setData(X(X({},n.getData()),{transitions:!1})),Af([i,r],a)},function(){return n.getTransitions().duration}),this.applyPostProcess=function(t,i){var r=n.getProps(),a=r.settings,s=r.postProcess,u=t.name,o=t.interaction,f=o===void 0?!1:o,d=t.transitions,c=d===void 0?!1:d,l=t.immediately,h=l===void 0?!1:l,m={name:u,interaction:f,transitions:c,immediately:h};return mY(s)?s.reduce(function(b,k){return k(b,a,m)},i):ke(s)?s(i,a,m):i},this.updateState=function(t,i,r){i===void 0&&(i={}),r===void 0&&(r=[]);var a=i.transitions,s=a===void 0?!1:a,u=n.getProps(),o=u.onTransitionsStart,f=u.getInstance,d=u.onChange,c=u.onUpdate,l=u.settings,h=n.getData(),m=ke(t)?t(h.state,l):t,b=m?.001*er(m):.001,k=!kr(h.state,m,b),A=["coordinates","boundary","visibleArea","imageSize","transforms"].some(function(x){var B;return!kr((B=h.state)===null||B===void 0?void 0:B[x],m==null?void 0:m[x],b)}),y=h;k&&(s&&A&&n.endTransitions(),y=X(X({},y),{state:ln(m),transitions:s&&A}),n.setData(y),ao(d,f)),y.transitions&&!h.transitions&&ao(o,f),Af(cY(r,[c]),f)},this.setInteractions=function(t){var i=n.getProps(),r=i.onInteractionStart,a=i.onInteractionEnd,s=i.getInstance,u=n.getInteractions(),o=X(X({},u),t);if(kr(u,o)||n.setData(X(X({},n.getData()),{interactions:o})),Ts(u)!==Ts(o))if(!Ts(u))ao(r,s);else{var f=n.getData().state;n.updateState(function(){return f&&n.applyPostProcess({name:"interactionEnd",immediately:!0,transitions:!0},f)},{transitions:!0},[a])}},this.resetState=function(t,i){n.updateState(n.createDefaultState(t,i))},this.clear=function(){n.updateState(null)},this.reconcileState=function(t){t===void 0&&(t={});var i=n.getProps(),r=i.reconcileStateAlgorithm,a=i.settings,s=n.getData().state,u=t.transitions,o=u===void 0?!1:u;if(s&&!W2(s,a)){var f=(r||ZY)(s,a);f=n.applyPostProcess({name:"reconcileState",immediately:!0,transitions:o},f),n.updateState(f,{transitions:o})}},this.transformImage=function(t,i){i===void 0&&(i={});var r=i.transitions,a=r===void 0?!0:r,s=i.interaction,u=s===void 0?!0:s,o=i.immediately,f=o===void 0?!1:o,d=i.normalize,c=d===void 0?!0:d,l=n.getProps(),h=l.transformImageAlgorithm,m=l.onTransformImage,b=l.onTransformImageEnd,k=l.settings,A=n.getData().state,y=[];if(A){c&&(t=XY(A,t));var x=n.applyPostProcess({name:"transformImage",transitions:a,immediately:f},(h||NY)(A,k,t));y.push(m),u?n.setInteractions({transformImage:{rotate:!Ke(t.rotate),flip:!Ke(t.flip),scale:!Ke(t.scale),move:!Ke(t.move)}}):(x=n.applyPostProcess({name:"transformImageEnd",transitions:a,immediately:!0},x),y.push(b)),n.updateState(x,{transitions:f&&a},y)}},this.transformImageEnd=function(t){t===void 0&&(t={});var i=t.immediately,r=i===void 0?!0:i,a=t.transitions,s=a===void 0?!0:a,u=n.getData().state,o=n.getProps().onTransformImageEnd;n.updateState(function(){return u&&n.applyPostProcess({name:"transformImageEnd",immediately:r,transitions:s},u)},{transitions:s},[o]),n.setInteractions({transformImage:{rotate:!1,flip:!1,scale:!1,move:!1}})},this.zoomImage=function(t,i){i===void 0&&(i={});var r=i.interaction,a=r===void 0?!1:r,s=i.immediately,u=s===void 0?!0:s,o=i.transitions,f=o===void 0?!0:o,d=i.normalize,c=d===void 0?!1:d;n.transformImage({scale:t},{interaction:a,immediately:u,transitions:f,normalize:c})},this.moveImage=function(t,i,r){r===void 0&&(r={});var a=r.interaction,s=a===void 0?!1:a,u=r.immediately,o=u===void 0?!0:u,f=r.transitions,d=f===void 0?!0:f,c=r.normalize,l=c===void 0?!1:c;n.transformImage({move:{left:t,top:i}},{interaction:s,immediately:o,transitions:d,normalize:l})},this.flipImage=function(t,i,r){r===void 0&&(r={});var a=r.interaction,s=a===void 0?!1:a,u=r.immediately,o=u===void 0?!0:u,f=r.transitions,d=f===void 0?!0:f,c=r.normalize,l=c===void 0?!0:c,h=n.getState(),m={horizontal:t,vertical:i};n.transformImage({flip:h&&l?WY(h,m):m},{interaction:s,immediately:o,transitions:d})},this.rotateImage=function(t,i){i===void 0&&(i={});var r=i.interaction,a=r===void 0?!1:r,s=i.immediately,u=s===void 0?!0:s,o=i.transitions,f=o===void 0?!0:o,d=i.normalize,c=d===void 0?!1:d;n.transformImage({rotate:t},{interaction:a,immediately:u,transitions:f,normalize:c})},this.reset=function(t,i){n.resetState(t,i)},this.setState=function(t,i){i===void 0&&(i={});var r=n.getSettings(),a=n.getData().state,s=i.transitions,u=s===void 0?!0:s,o=i.immediately,f=o===void 0?!1:o,d=i.interaction,c=d===void 0?!1:d,l=i.postprocess,h=l===void 0?!1:l,m=t&&(ke(t)?t(a,r):X(X({},a),t));n.updateState(function(){return h?m&&n.applyPostProcess({name:"setState",immediately:f,transitions:u,interaction:c},m):m},{transitions:u})},this.setCoordinates=function(t,i){i===void 0&&(i={});var r=n.getData().state,a=n.getProps(),s=a.setCoordinatesAlgorithm,u=a.settings,o=i.transitions,f=o===void 0?!0:o,d=i.immediately,c=d===void 0?!0:d;n.updateState(function(){return r&&n.applyPostProcess({name:"setCoordinates",immediately:c,transitions:f},(s||Jd)(r,u,t,mt.zoom))},{transitions:f})},this.setVisibleArea=function(t,i){i===void 0&&(i={});var r=i.transitions,a=r===void 0?!0:r,s=i.immediately,u=s===void 0?!0:s,o=n.getData().state,f=n.getProps(),d=f.setVisibleAreaAlgorithm,c=f.settings;n.updateState(function(){return o&&n.applyPostProcess({name:"setVisibleArea",immediately:u,transitions:a},(d||qd)(o,c,t))},{transitions:a})},this.setBoundary=function(t,i){i===void 0&&(i={});var r=n.getData().state,a=n.getProps(),s=a.setBoundaryAlgorithm,u=a.settings,o=i.transitions,f=o===void 0?!1:o,d=i.immediately,c=d===void 0?!0:d;t?n.updateState(function(){return r&&n.applyPostProcess({name:"setBoundary",immediately:c,transitions:f},(s||DY)(r,u,t))}):n.updateState(null)},this.moveCoordinates=function(t,i){i===void 0&&(i={});var r=n.getData(),a=n.getProps(),s=a.moveCoordinatesAlgorithm,u=a.onMove,o=a.onMoveEnd,f=a.settings,d=i.interaction,c=d===void 0?!0:d,l=i.transitions,h=l===void 0?!1:l,m=i.immediately,b=m===void 0?!1:m,k=i.normalize,A=k===void 0?!0:k,y=[];if(!r.transitions&&r.state){var x=A?Ep(r.state,t):YY(t),B=n.applyPostProcess({name:"moveCoordinates",interaction:c,immediately:b,transitions:h},(s||FY)(r.state,f,x));y.push(u),c?n.setInteractions({moveCoordinates:!0}):(B=n.applyPostProcess({name:"moveCoordinatesEnd",interaction:c,immediately:b,transitions:h},B),y.push(o)),n.updateState(B,{transitions:b&&h},y)}},this.moveCoordinatesEnd=function(t){t===void 0&&(t={});var i=n.getData().state,r=n.getProps().onMoveEnd,a=t.transitions,s=a===void 0?!0:a,u=t.immediately,o=u===void 0?!1:u;n.updateState(function(){return i&&n.applyPostProcess({name:"moveCoordinatesEnd",transitions:s,immediately:o},i)},{transitions:s},[r]),n.setInteractions({moveCoordinates:!1})},this.resizeCoordinates=function(t,i,r,a){a===void 0&&(a={});var s=n.getData().state,u=n.getProps(),o=u.resizeCoordinatesAlgorithm,f=u.onResize,d=u.onResizeEnd,c=u.settings,l=a.interaction,h=l===void 0?!0:l,m=a.transitions,b=m===void 0?!1:m,k=a.immediately,A=k===void 0?!1:k,y=a.normalize,x=y===void 0?!0:y,B=n.getTransitions();if(!B.active&&s){var z=[],R=x?GY(s,i):QY(i),E=n.applyPostProcess({name:"resizeCoordinates",interaction:h,immediately:A,transitions:b},(o||TY)(s,c,t,R,Di(r)?r:{}));z.push(f),h?n.setInteractions({resizeCoordinates:!0}):(E=n.applyPostProcess({name:"resizeCoordinatesEnd",interaction:h,immediately:A,transitions:b},E),z.push(d)),n.updateState(E,{transitions:A&&b},z)}},this.resizeCoordinatesEnd=function(t){t===void 0&&(t={});var i=n.getProps().onResizeEnd,r=n.getData().state,a=t.transitions,s=a===void 0?!0:a,u=t.immediately,o=u===void 0?!1:u;n.updateState(function(){return r&&n.applyPostProcess({name:"resizeCoordinatesEnd",transitions:s,immediately:o},r)},{transitions:s},[i]),n.setInteractions({resizeCoordinates:!1})},this.getStencilCoordinates=function(){var t=n.getData().state;return vc(t)},this.getCoordinates=function(t){t===void 0&&(t={});var i=n.getData().state,r=n.getProps().settings;if(i&&i.coordinates){var a=t.round,s=a===void 0?!0:a;return s?BY(i,r):X({},i.coordinates)}else return null},this.getVisibleArea=function(){var t=n.getData().state;return t!=null&&t.visibleArea?X({},t.visibleArea):null},this.getSettings=function(){var t=n.getProps().settings;return X({},t)},this.getState=function(){var t=n.getData().state;return ln(t)},this.getTransforms=function(){var t=n.getData().state;return t?Ga(t.transforms):{rotate:0,flip:{horizontal:!1,vertical:!1}}},this.createDefaultState=function(t,i){var r=n.getProps(),a=r.createStateAlgorithm,s=r.settings;return n.applyPostProcess({name:"createState",immediately:!0,transitions:!1},(a||EY)({image:i,boundary:t},s))},this.isConsistent=function(){var t=n.getData().state,i=n.getProps().settings;return t?W2(t,i):!0}}return e}(),U2={linear:function(e){return e},"ease-in":function(e){return Math.pow(e,1.675)},"ease-out":function(e){return 1-Math.pow(1-e,1.675)},"ease-in-out":function(e){return .5*(Math.sin((e-.5)*Math.PI)+1)}},oQ=function(){function e(){this.active=!1}return e.prototype.start=function(n){var t;this.onStart=n.onStart,this.onProgress=n.onProgress,this.onStop=n.onStop,this.active||(t=this.onStart)===null||t===void 0||t.call(this),this.id&&window.cancelAnimationFrame(this.id),this.startTime=performance.now(),this.timingFunction=n.timingFunction,this.endTime=this.startTime+n.duration,this.active=!0,this.animate()},e.prototype.animate=function(){var n=this;if(this.startTime&&this.endTime){var t=U2[this.timingFunction];t||(process.env.NODE_ENV!=="production"&&console.warn("[Animation] The timing function '"+t+"' is not supported. Available timing function: 'linear', 'ease-in', 'ease-in-out', 'ease-out'. Reset to 'ease-out'."),t=U2["ease-out"]);var i=1-(this.endTime-performance.now())/(this.endTime-this.startTime),r=Math.min(1,t(i));this.onProgress&&this.onProgress(r),i<1?this.id=window.requestAnimationFrame(function(){return n.animate()}):this.stop()}else this.stop()},e.prototype.stop=function(){this.active=!1,this.id&&window.cancelAnimationFrame(this.id),this.onStop&&this.onStop()},e}();function uQ(e,n,t){var i=t.rotate,r=t.flip,a={width:"naturalWidth"in n?n.naturalWidth:n.width,height:"naturalHeight"in n?n.naturalHeight:n.height},s=Cp(a,i),u=e.getContext("2d");if(e.height=s.height,e.width=s.width,u){u.save();var o=Tt(Ie(X({left:0,top:0},a)),i);u.translate(-(o.left-s.width/2),-(o.top-s.height/2)),u.rotate(i*Math.PI/180),u.translate(r.horizontal?a.width:0,r.vertical?a.height:0),u.scale(r.horizontal?-1:1,r.vertical?-1:1),u.drawImage(n,0,0,a.width,a.height),u.restore()}return e}function fQ(e,n,t,i,r){e.width=i?i.width:t.width,e.height=i?i.height:t.height;var a=e.getContext("2d");if(a){a.clearRect(0,0,e.width,e.height),r&&(r.imageSmoothingEnabled&&(a.imageSmoothingEnabled=r.imageSmoothingEnabled),r.imageSmoothingQuality&&(a.imageSmoothingQuality=r.imageSmoothingQuality),r.fillColor&&(a.fillStyle=r.fillColor,a.fillRect(0,0,e.width,e.height),a.save()));var s=t.left<0?-t.left:0,u=t.top<0?-t.top:0;a.drawImage(n,t.left+s,t.top+u,t.width,t.height,s*(e.width/t.width),u*(e.height/t.height),e.width,e.height)}return e}function dQ(e,n,t,i,r){if(Gn(e)){var a=e.transforms,s=e.coordinates,u=a.rotate!==0||a.flip.horizontal||a.flip.vertical,o=u?uQ(i,n,a):n,f=X({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:1/0,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},r),d=function(h){return h.find(function(m){return qn(m)})},c=et({sizeRestrictions:{minWidth:d([f.width,f.minWidth])||0,minHeight:d([f.height,f.minHeight])||0,maxWidth:d([f.width,f.maxWidth])||1/0,maxHeight:d([f.height,f.maxHeight])||1/0},width:s.width,height:s.height,aspectRatio:{minimum:s.width/s.height,maximum:s.width/s.height}});if(f.maxArea&&c.width*c.height>f.maxArea){var l=Math.sqrt(f.maxArea/(c.width*c.height));c={width:Math.round(l*c.width),height:Math.round(l*c.height)}}return fQ(t,o,s,c,f)}else return null}function lQ(e,n,t){n.style.width="0px",n.style.height="0px",n.style.width=Math.max(e.clientWidth,t.width)+"px";var i=t.width/t.height;n.style.height=Math.max(e.clientHeight,n.clientWidth/i)+"px",n.style.width=n.clientHeight*i+"px"}function cQ(e,n,t){n.style.width="0px",n.style.height="0px",n.style.width=Math.max(e.getBoundingClientRect().width,t.width)+"px";var i=t.width/t.height;n.style.height=Math.max(e.getBoundingClientRect().height,n.getBoundingClientRect().width/i)+"px",n.style.width=n.getBoundingClientRect().height*i+"px",n.clientWidth/n.clientHeight>e.clientWidth/e.clientHeight?n.clientWidth>e.clientWidth&&(n.style.width=e.clientWidth+"px",n.style.height=e.clientWidth/i+"px"):n.clientHeight>e.clientHeight&&(n.style.height=e.clientHeight+"px",n.style.width=e.clientHeight*i+"px")}var hQ=4;function gQ(e){e=e.replace(/^data:([^;]+);base64,/gim,"");for(var n=atob(e),t=n.length,i=new ArrayBuffer(t),r=new Uint8Array(i),a=0;a<t;a++)r[a]=n.charCodeAt(a);return i}function mQ(e,n){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="blob",t.onload=function(){(this.status==200||this.status===0)&&n(this.response)},t.send()}function vQ(e){var n={flip:{horizontal:!1,vertical:!1},rotate:0};if(e)switch(e){case 2:n.flip.horizontal=!0;break;case 3:n.rotate=-180;break;case 4:n.flip.vertical=!0;break;case 5:n.rotate=90,n.flip.vertical=!0;break;case 6:n.rotate=90;break;case 7:n.rotate=90,n.flip.horizontal=!0;break;case 8:n.rotate=-90;break}return n}function pQ(e){return new Promise(function(n,t){try{if(e)if(/^data:/i.test(e))n(gQ(e));else if(/^blob:/i.test(e)){var i=new FileReader;i.onload=function(a){var s;n((s=a.target)===null||s===void 0?void 0:s.result)},mQ(e,function(a){i.readAsArrayBuffer(a)})}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState===hQ&&(r.status===200||r.status===0?n(r.response):t("Warning: could not load an image to parse its orientation"))},r.onprogress=function(){r.getResponseHeader("content-type")!=="image/jpeg"&&r.abort()},r.withCredentials=!1,r.open("GET",e,!0),r.responseType="arraybuffer",r.send(null)}else t("Error: the image is empty")}catch(a){t(a)}})}function wQ(e){var n=e.rotate,t=n===void 0?0:n,i=e.flip,r=i===void 0?{horizontal:!1,vertical:!1}:i,a=e.scale,s=a===void 0?1:a;return" rotate("+t+"deg) scaleX("+s*(r.horizontal?-1:1)+") scaleY("+s*(r.vertical?-1:1)+")"}function AQ(e,n,t){var i="",r;for(r=n,t+=n;r<t;r++)i+=String.fromCharCode(e.getUint8(r));return i}function bQ(e){try{var n=new DataView(e),t,i=void 0,r=void 0,a=void 0,s=void 0,u=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var o=n.byteLength,f=2;f+1<o;){if(n.getUint8(f)===255&&n.getUint8(f+1)===225){s=f;break}f++}if(s&&(i=s+4,r=s+10,AQ(n,i,4)==="Exif")){var d=n.getUint16(r);if(a=d===18761,(a||d===19789)&&n.getUint16(r+2,a)===42){var c=n.getUint32(r+4,a);c>=8&&(u=r+c)}}if(u)for(var l=n.getUint16(u,a),h=0;h<l;h++){var f=u+h*12+2;if(n.getUint16(f,a)===274){f+=8,t=n.getUint16(f,a),n.setUint16(f,1,a);break}}return t}catch{return null}}function kQ(e){for(var n=[],t=8192,i=new Uint8Array(e);i.length>0;){var r=i.subarray(0,t);n.push(String.fromCharCode.apply(null,Array.from?Array.from(r):r.slice())),i=i.subarray(t)}return"data:image/jpeg;base64,"+btoa(n.join(""))}function bf(e){var n=e.src,t=e.arrayBuffer,i=t===void 0?null:t,r=e.orientation,a=r===void 0?null:r,s={src:n,arrayBuffer:i,revoke:!1,transforms:{flip:{horizontal:!1,vertical:!1},rotate:0}};return i&&a&&a>1?wp(n)||!Ap(n)?(s.src=URL.createObjectURL(new Blob([i])),s.revoke=!0):s.src=kQ(i):s.src=n,a&&(s.transforms=vQ(a)),s}function yQ(e,n){n===void 0&&(n={});var t=n.checkOrientation,i=n.parse;return new Promise(function(r){t||i?pQ(e).then(function(a){var s=bQ(a);r(bf(a?{src:e,arrayBuffer:a,orientation:s}:{src:e,arrayBuffer:null,orientation:null}))}).catch(function(a){console.warn(a),r(bf({src:e}))}):r(bf({src:e}))})}function xQ(e,n){return n===void 0&&(n={}),new Promise(function(t,i){var r=document.createElement("img");n.crossOrigin&&(r.crossOrigin=n.crossOrigin!==!0?n.crossOrigin:"anonymous"),r.src=e,r.style.visibility="hidden",r.style.position="fixed",document.body.appendChild(r),r.complete?(t(r),document.body.removeChild(r)):(r.addEventListener("load",function(){t(r),document.body.removeChild(r)}),r.addEventListener("error",function(){i(null),document.body.removeChild(r)}))})}function CQ(e,n){return n===void 0&&(n={}),yQ(e,X(X({},n),{crossOrigin:gY(e)&&n.crossOrigin})).then(function(t){return new Promise(function(i,r){xQ(t.src,n).then(function(a){i(X(X({},t),{width:a.naturalWidth,height:a.naturalHeight}))}).catch(function(){r(null)})})})}function Rp(e,n,t,i,r){r===void 0&&(r=null);var a=e.width>e.height?{width:Math.min(512,e.width),height:Math.min(512,e.width)/(e.width/e.height)}:{height:Math.min(512,e.height),width:Math.min(512,e.height)*(e.width/e.height)},s=Lt(n),u={rotate:n.transforms.rotate,flip:{horizontal:n.transforms.flip.horizontal,vertical:n.transforms.flip.vertical},translateX:t.left/i,translateY:t.top/i,scale:1/i},o={rotate:{left:(a.width-s.width)/(2*i),top:(a.height-s.height)/(2*i)},scale:{left:(1-1/i)*a.width/2,top:(1-1/i)*a.height/2}},f=X(X({},u),{scale:u.scale*(e.width/a.width)}),d={width:a.width+"px",height:a.height+"px",left:"0px",top:"0px",transition:"none",transform:"translate3d("+(-o.rotate.left-o.scale.left-u.translateX)+"px, "+(-o.rotate.top-o.scale.top-u.translateY)+"px, 0px)"+wQ(f),willChange:"none"};return r&&r.active&&(d.willChange="transform",d.transition=r.duration+"ms "+r.timingFunction),d}function zQ(e,n,t){return t===void 0&&(t=null),e&&n&&n.visibleArea?Rp(e,n,n.visibleArea,er(n),t):{}}function PQ(e,n,t,i){return i===void 0&&(i=null),e&&n&&n.visibleArea&&n.coordinates?Rp(e,n,n.coordinates,he(n.coordinates)>he(t)?n.coordinates.width/t.width:n.coordinates.height/t.height,i):{}}var jp={exports:{}};/*!
|
|
844
|
+
`)});const u=n.nonTextTags||["script","style","textarea","option"];let o,f;n.allowedAttributes&&(o={},f={},ga(n.allowedAttributes,function(F,T){o[T]=[];const P=[];F.forEach(function(S){typeof S=="string"&&S.indexOf("*")>=0?P.push(B2(S).replace(/\\\*/g,".*")):o[T].push(S)}),P.length&&(f[T]=new RegExp("^("+P.join("|")+")$"))}));const d={},c={},l={};ga(n.allowedClasses,function(F,T){if(o&&(St(o,T)||(o[T]=[]),o[T].push("class")),d[T]=F,Array.isArray(F)){const P=[];d[T]=[],l[T]=[],F.forEach(function(S){typeof S=="string"&&S.indexOf("*")>=0?P.push(B2(S).replace(/\\\*/g,".*")):S instanceof RegExp?l[T].push(S):d[T].push(S)}),P.length&&(c[T]=new RegExp("^("+P.join("|")+")$"))}});const h={};let m;ga(n.transformTags,function(F,T){let P;typeof F=="function"?P=F:typeof F=="string"&&(P=Na.simpleTransform(F)),T==="*"?m=P:h[T]=P});let b,k,A,y,x,B,z=!1;E();const R=new ZZ.Parser({onopentag:function(F,T){if(n.enforceHtmlBoundary&&F==="html"&&E(),x){B++;return}const P=new a(F,T);k.push(P);let S=!1;const G=!!P.text;let N;if(St(h,F)&&(N=h[F](F,T),P.attribs=T=N.attribs,N.text!==void 0&&(P.innerText=N.text),F!==N.tagName&&(P.name=F=N.tagName,y[b]=N.tagName)),m&&(N=m(F,T),P.attribs=T=N.attribs,F!==N.tagName&&(P.name=F=N.tagName,y[b]=N.tagName)),(!s(F)||n.disallowedTagsMode==="recursiveEscape"&&!KZ(A)||n.nestingLimit!=null&&b>=n.nestingLimit)&&(S=!0,A[b]=!0,(n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard")&&u.indexOf(F)!==-1&&(x=!0,B=1),A[b]=!0),b++,S){if(n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard"){if(P.innerText&&!G){const w=I(P.innerText);n.textFilter?i+=n.textFilter(w,F):i+=I(P.innerText),z=!0}return}r=i,i=""}i+="<"+F,F==="script"&&(n.allowedScriptHostnames||n.allowedScriptDomains)&&(P.innerText=""),(!o||St(o,F)||o["*"])&&ga(T,function(w,Z){if(!JZ.test(Z)){delete P.attribs[Z];return}if(w===""&&!n.allowedEmptyAttributes.includes(Z)&&(n.nonBooleanAttributes.includes(Z)||n.nonBooleanAttributes.includes("*"))){delete P.attribs[Z];return}let Q=!1;if(!o||St(o,F)&&o[F].indexOf(Z)!==-1||o["*"]&&o["*"].indexOf(Z)!==-1||St(f,F)&&f[F].test(Z)||f["*"]&&f["*"].test(Z))Q=!0;else if(o&&o[F]){for(const K of o[F])if(GZ(K)&&K.name&&K.name===Z){Q=!0;let U="";if(K.multiple===!0){const $=w.split(" ");for(const J of $)K.values.indexOf(J)!==-1&&(U===""?U=J:U+=" "+J)}else K.values.indexOf(w)>=0&&(U=w);w=U}}if(Q){if(n.allowedSchemesAppliedToAttributes.indexOf(Z)!==-1&&L(F,w)){delete P.attribs[Z];return}if(F==="script"&&Z==="src"){let K=!0;try{const U=D(w);if(n.allowedScriptHostnames||n.allowedScriptDomains){const $=(n.allowedScriptHostnames||[]).find(function(q){return q===U.url.hostname}),J=(n.allowedScriptDomains||[]).find(function(q){return U.url.hostname===q||U.url.hostname.endsWith(`.${q}`)});K=$||J}}catch{K=!1}if(!K){delete P.attribs[Z];return}}if(F==="iframe"&&Z==="src"){let K=!0;try{const U=D(w);if(U.isRelativeUrl)K=St(n,"allowIframeRelativeUrls")?n.allowIframeRelativeUrls:!n.allowedIframeHostnames&&!n.allowedIframeDomains;else if(n.allowedIframeHostnames||n.allowedIframeDomains){const $=(n.allowedIframeHostnames||[]).find(function(q){return q===U.url.hostname}),J=(n.allowedIframeDomains||[]).find(function(q){return U.url.hostname===q||U.url.hostname.endsWith(`.${q}`)});K=$||J}}catch{K=!1}if(!K){delete P.attribs[Z];return}}if(Z==="srcset")try{let K=WZ(w);if(K.forEach(function(U){L("srcset",U.url)&&(U.evil=!0)}),K=M2(K,function(U){return!U.evil}),K.length)w=UZ(M2(K,function(U){return!U.evil})),P.attribs[Z]=w;else{delete P.attribs[Z];return}}catch{delete P.attribs[Z];return}if(Z==="class"){const K=d[F],U=d["*"],$=c[F],J=l[F],q=l["*"],re=c["*"],ne=[$,re].concat(J,q).filter(function(le){return le});if(K&&U?w=H(w,O2(K,U),ne):w=H(w,K||U,ne),!w.length){delete P.attribs[Z];return}}if(Z==="style"){if(n.parseStyleAttributes)try{const K=YZ(F+" {"+w+"}",{map:!1}),U=C(K,n.allowedStyles);if(w=M(U),w.length===0){delete P.attribs[Z];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+F+" {"+w+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete P.attribs[Z];return}else if(n.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}i+=" "+Z,w&&w.length?i+='="'+I(w,!0)+'"':n.allowedEmptyAttributes.includes(Z)&&(i+='=""')}else delete P.attribs[Z]}),n.selfClosing.indexOf(F)!==-1?i+=" />":(i+=">",P.innerText&&!G&&!n.textFilter&&(i+=I(P.innerText),z=!0)),S&&(i=r+I(i),r="")},ontext:function(F){if(x)return;const T=k[k.length-1];let P;if(T&&(P=T.tag,F=T.innerText!==void 0?T.innerText:F),n.disallowedTagsMode==="completelyDiscard"&&!s(P))F="";else if((n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard")&&(P==="script"||P==="style"))i+=F;else{const S=I(F,!1);n.textFilter&&!z?i+=n.textFilter(S,P):z||(i+=S)}if(k.length){const S=k[k.length-1];S.text+=F}},onclosetag:function(F,T){if(x)if(B--,!B)x=!1;else return;const P=k.pop();if(!P)return;if(P.tag!==F){k.push(P);return}x=n.enforceHtmlBoundary?F==="html":!1,b--;const S=A[b];if(S){if(delete A[b],n.disallowedTagsMode==="discard"||n.disallowedTagsMode==="completelyDiscard"){P.updateParentNodeText();return}r=i,i=""}if(y[b]&&(F=y[b],delete y[b]),n.exclusiveFilter&&n.exclusiveFilter(P)){i=i.substr(0,P.tagPosition);return}if(P.updateParentNodeMediaChildren(),P.updateParentNodeText(),n.selfClosing.indexOf(F)!==-1||T&&!s(F)&&["escape","recursiveEscape"].indexOf(n.disallowedTagsMode)>=0){S&&(i=r,r="");return}i+="</"+F+">",S&&(i=r+I(i),r=""),z=!1}},n.parser);return R.write(e),R.end(),i;function E(){i="",b=0,k=[],A={},y={},x=!1,B=0}function I(F,T){return typeof F!="string"&&(F=F+""),n.parser.decodeEntities&&(F=F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),T&&(F=F.replace(/"/g,"""))),F=F.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),T&&(F=F.replace(/"/g,""")),F}function L(F,T){for(T=T.replace(/[\x00-\x20]+/g,"");;){const G=T.indexOf("<!--");if(G===-1)break;const N=T.indexOf("-->",G+4);if(N===-1)break;T=T.substring(0,G)+T.substring(N+3)}const P=T.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!P)return T.match(/^[/\\]{2}/)?!n.allowProtocolRelative:!1;const S=P[1].toLowerCase();return St(n.allowedSchemesByTag,F)?n.allowedSchemesByTag[F].indexOf(S)===-1:!n.allowedSchemes||n.allowedSchemes.indexOf(S)===-1}function D(F){if(F=F.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),F.startsWith("relative:"))throw new Error("relative: exploit attempt");let T="relative://relative-site";for(let G=0;G<100;G++)T+=`/${G}`;const P=new URL(F,T);return{isRelativeUrl:P&&P.hostname==="relative-site"&&P.protocol==="relative:",url:P}}function C(F,T){if(!T)return F;const P=F.nodes[0];let S;return T[P.selector]&&T["*"]?S=O2(T[P.selector],T["*"]):S=T[P.selector]||T["*"],S&&(F.nodes[0].nodes=P.nodes.reduce(j(S),[])),F}function M(F){return F.nodes[0].nodes.reduce(function(T,P){return T.push(`${P.prop}:${P.value}${P.important?" !important":""}`),T},[]).join(";")}function j(F){return function(T,P){return St(F,P.prop)&&F[P.prop].some(function(G){return G.test(P.value)})&&T.push(P),T}}function H(F,T,P){return T?(F=F.split(/\s+/),F.filter(function(S){return T.indexOf(S)!==-1||P.some(function(G){return G.test(S)})}).join(" ")):F}}const qZ={decodeEntities:!0};Na.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0};Na.simpleTransform=function(e,n,t){return t=t===void 0?!0:t,n=n||{},function(i,r){let a;if(t)for(a in n)r[a]=n[a];else r=n;return{tagName:e,attribs:r}}};const cp=Zn(VZ),_Z="_markdown_1jzce_141",E2={markdown:_Z,"markdown--external-links":"_markdown--external-links_1jzce_153"},$Z={allowedAttributes:{a:["href","target"]},allowedTags:["a","strong"]};function eG({className:e,elementTag:n="span",inline:t=!1,isExternalLinksIcon:i,text:r}){const a=cp(r,$Z),s=n;return g.jsx(s,{className:ie(E2.markdown,{[E2["markdown--external-links"]]:i},e),dangerouslySetInnerHTML:{__html:t?Pe.parseInline(a,{breaks:!0}):Pe.parse(a,{breaks:!0})}})}const nG="_react-datepicker__day-names_1ftws_120",tG="_react-datepicker__week_1ftws_124",iG="_react-datepicker__day--outside-month_1ftws_131",rG="_react-datepicker_1ftws_120",aG="_typography-landing--claim_1ftws_141",sG="_typography-landing--claim-uppercase_1ftws_179",oG="_typography-landing--h1_1ftws_217",uG="_typography-landing--h1-uppercase_1ftws_255",fG="_typography-landing--h2_1ftws_293",dG="_typography-landing--h3_1ftws_331",lG="_typography-landing--h4_1ftws_369",cG="_typography-landing--h5_1ftws_394",hG="_typography-landing--h6_1ftws_419",gG="_typography-landing--overline_1ftws_444",mG="_typography-landing--body-large_1ftws_481",vG="_typography-landing--body-large-semibold_1ftws_505",pG="_typography-landing--body_1ftws_481",wG="_typography-landing--body-semibold_1ftws_540",AG="_typography-landing--body-italic_1ftws_551",bG="_typography-landing--quote-large_1ftws_563",kG="_typography-landing--detail-small_1ftws_588",yG="_typography-landing--detail-small-bold_1ftws_599",xG="_typography-landing_1ftws_141",CG="_typography-product_1ftws_628",zG="_typography-product--h1_1ftws_639",PG="_typography-product--h2_1ftws_650",BG="_typography-product--h3_1ftws_661",OG="_typography-product--h4_1ftws_672",MG="_typography-product--h5_1ftws_683",EG="_typography-product--h6_1ftws_694",FG="_typography-product--h7_1ftws_705",SG="_typography-product--h8_1ftws_716",RG="_typography-product--body-large_1ftws_727",jG="_typography-product--body-regular_1ftws_749",TG="_typography-product--body-semibold_1ftws_771",DG="_typography-product--body-italic_1ftws_793",IG="_typography-product--body-text-link_1ftws_816",HG="_typography-product--detail-medium_1ftws_827",LG="_typography-product--detail-bold_1ftws_849",NG="_typography-product--detail-upper-case_1ftws_871",ZG="_typography-product--detail-regular_1ftws_893",GG="_typography-product--detail-text-link_1ftws_915",F2={"react-datepicker__day-names":"_react-datepicker__day-names_1ftws_120",reactDatepickerDayNames:nG,"react-datepicker__week":"_react-datepicker__week_1ftws_124",reactDatepickerWeek:tG,"react-datepicker__day--outside-month":"_react-datepicker__day--outside-month_1ftws_131",reactDatepickerDayOutsideMonth:iG,"react-datepicker":"_react-datepicker_1ftws_120",reactDatepicker:rG,"typography-landing--claim":"_typography-landing--claim_1ftws_141",typographyLandingClaim:aG,"typography-landing--claim-uppercase":"_typography-landing--claim-uppercase_1ftws_179",typographyLandingClaimUppercase:sG,"typography-landing--h1":"_typography-landing--h1_1ftws_217",typographyLandingH1:oG,"typography-landing--h1-uppercase":"_typography-landing--h1-uppercase_1ftws_255",typographyLandingH1Uppercase:uG,"typography-landing--h2":"_typography-landing--h2_1ftws_293",typographyLandingH2:fG,"typography-landing--h3":"_typography-landing--h3_1ftws_331",typographyLandingH3:dG,"typography-landing--h4":"_typography-landing--h4_1ftws_369",typographyLandingH4:lG,"typography-landing--h5":"_typography-landing--h5_1ftws_394",typographyLandingH5:cG,"typography-landing--h6":"_typography-landing--h6_1ftws_419",typographyLandingH6:hG,"typography-landing--overline":"_typography-landing--overline_1ftws_444",typographyLandingOverline:gG,"typography-landing--body-large":"_typography-landing--body-large_1ftws_481",typographyLandingBodyLarge:mG,"typography-landing--body-large-semibold":"_typography-landing--body-large-semibold_1ftws_505",typographyLandingBodyLargeSemibold:vG,"typography-landing--body":"_typography-landing--body_1ftws_481",typographyLandingBody:pG,"typography-landing--body-semibold":"_typography-landing--body-semibold_1ftws_540",typographyLandingBodySemibold:wG,"typography-landing--body-italic":"_typography-landing--body-italic_1ftws_551",typographyLandingBodyItalic:AG,"typography-landing--quote-large":"_typography-landing--quote-large_1ftws_563",typographyLandingQuoteLarge:bG,"typography-landing--detail-small":"_typography-landing--detail-small_1ftws_588",typographyLandingDetailSmall:kG,"typography-landing--detail-small-bold":"_typography-landing--detail-small-bold_1ftws_599",typographyLandingDetailSmallBold:yG,"typography-landing":"_typography-landing_1ftws_141",typographyLanding:xG,"typography-product":"_typography-product_1ftws_628",typographyProduct:CG,"typography-product--h1":"_typography-product--h1_1ftws_639",typographyProductH1:zG,"typography-product--h2":"_typography-product--h2_1ftws_650",typographyProductH2:PG,"typography-product--h3":"_typography-product--h3_1ftws_661",typographyProductH3:BG,"typography-product--h4":"_typography-product--h4_1ftws_672",typographyProductH4:OG,"typography-product--h5":"_typography-product--h5_1ftws_683",typographyProductH5:MG,"typography-product--h6":"_typography-product--h6_1ftws_694",typographyProductH6:EG,"typography-product--h7":"_typography-product--h7_1ftws_705",typographyProductH7:FG,"typography-product--h8":"_typography-product--h8_1ftws_716",typographyProductH8:SG,"typography-product--body-large":"_typography-product--body-large_1ftws_727",typographyProductBodyLarge:RG,"typography-product--body-regular":"_typography-product--body-regular_1ftws_749",typographyProductBodyRegular:jG,"typography-product--body-semibold":"_typography-product--body-semibold_1ftws_771",typographyProductBodySemibold:TG,"typography-product--body-italic":"_typography-product--body-italic_1ftws_793",typographyProductBodyItalic:DG,"typography-product--body-text-link":"_typography-product--body-text-link_1ftws_816",typographyProductBodyTextLink:IG,"typography-product--detail-medium":"_typography-product--detail-medium_1ftws_827",typographyProductDetailMedium:HG,"typography-product--detail-bold":"_typography-product--detail-bold_1ftws_849",typographyProductDetailBold:LG,"typography-product--detail-upper-case":"_typography-product--detail-upper-case_1ftws_871",typographyProductDetailUpperCase:NG,"typography-product--detail-regular":"_typography-product--detail-regular_1ftws_893",typographyProductDetailRegular:ZG,"typography-product--detail-text-link":"_typography-product--detail-text-link_1ftws_915",typographyProductDetailTextLink:GG};function WG(e){switch(e){case"h1":case"h1-uppercase":return"h1";case"h2":case"claim":case"claim-uppercase":return"h2";case"h3":case"h4":case"h5":return e;case"h6":case"overline":return"h6";default:return"span"}}const ei=e=>{const{as:n,children:t,className:i,fontSet:r="product",markdown:a=r==="landing",markdownInline:s=!0,type:u}=e,o=n||WG(u),f=ie(F2[`typography-${r}`],F2[`typography-${r}--${u}`],i);return g.jsx(g.Fragment,{children:typeof t=="string"&&a?g.jsx(eG,{className:f,text:t,inline:s,elementTag:o,isExternalLinksIcon:r==="landing"}):g.jsx(o,{className:f,"data-testid":e["data-testid"],children:t})})},YG="_root_14myq_141",QG="_root__content_14myq_151",XG="_root__bookmark_14myq_157",KG="_root__header_14myq_163",UG="_root__header__reserved_14myq_170",VG="_root__header__reserved__box_14myq_183",JG="_root__header__imageContent_14myq_192",qG="_root__info_14myq_197",_G="_root__info__top_14myq_204",$G="_root__info__price_14myq_207",eW="_root__info__title_14myq_213",nW="_root__info__timeStamp_14myq_222",tW="_root__premiumFeature_14myq_226",iW="_headerImage_14myq_240",rW="_labelOnPhoto_14myq_250",aW="_abTestBorderRadius_14myq_259",Ye={root:YG,root__content:QG,root__bookmark:XG,root__header:KG,root__header__reserved:UG,"root__header__reserved--visible":"_root__header__reserved--visible_14myq_180",root__header__reserved__box:VG,root__header__imageContent:JG,root__info:qG,root__info__top:_G,root__info__price:$G,"root__info__price--reserved":"_root__info__price--reserved_14myq_210",root__info__title:eW,root__info__timeStamp:nW,root__premiumFeature:tW,"root__premiumFeature--withLabel":"_root__premiumFeature--withLabel_14myq_231",headerImage:iW,"headerImage--outlineImage":"_headerImage--outlineImage_14myq_244",labelOnPhoto:rW,abTestBorderRadius:aW},S2="Greif zu!";function lc({bookmarked:e,finalizeTest:n,highlightAbTest:t,id:i,image:r,onClick:a,premiumFeature:s=!1,price:u,reserved:o,reservedText:f,timeStamp:d,title:c}){const l=Fn(),h=()=>{n&&n(),l(`/feed/${i}`),a&&a()};return g.jsxs("div",{className:Ye.root,children:[g.jsx(W3,{className:Ye.root__bookmark,isBookmarked:e,id:i}),g.jsxs(O.Button,{className:Ye.root__content,onClick:h,children:[g.jsxs("div",{className:Ye.root__header,children:[g.jsx("div",{className:ie(Ye.root__header__reserved,{[Ye["root__header__reserved--visible"]]:o}),children:g.jsx("div",{className:Ye.root__header__reserved__box,children:g.jsx(ei,{type:"detail-upper-case",children:f})})}),g.jsxs("div",{className:ie(Ye.headerImage,{[Ye["headerImage--outlineImage"]]:t==="outline_photo"&&s}),children:[s&&t==="label_on_photo"&&g.jsx("div",{className:Ye.labelOnPhoto,children:g.jsx(ei,{type:"detail-bold",children:S2})}),r?g.jsx(VI,{alt:"product image",src:r,className:ie(Ye.root__header__imageContent,{[Ye.abTestBorderRadius]:t==="outline_photo"})}):g.jsx(UI,{size:"large",style:"rounded",icon:g.jsx(Y3,{name:"camera_crossed"}),className:ie({[Ye.abTestBorderRadius]:t==="outline_photo"})})]})]}),g.jsxs("div",{className:Ye.root__info,children:[g.jsxs("div",{className:Ye.root__info__top,children:[g.jsx(ei,{type:"body-semibold",as:"p",className:ie(Ye.root__info__price,{[Ye["root__info__price--reserved"]]:o}),children:u}),g.jsx(ei,{type:"body-semibold",as:"p",className:Ye.root__info__title,children:c})]}),g.jsx(ei,{type:s?"detail-bold":"detail-medium",as:"p",className:ie(Ye.root__info__timeStamp,{[Ye.root__premiumFeature]:s,[Ye["root__premiumFeature--withLabel"]]:t==="label_under_description"&&s}),children:s?t!=="label_on_photo"?S2:null:Oo(d)})]})]})]})}const sW=({children:e,navigate:n})=>g.jsx(lg.Provider,{value:{navigate:n},children:e}),oW="_root_1fa52_141",uW={root:oW},cc={event:"event",feed:"feed",group:"group",marketplace:"marketplace",post:"post"},fW="_root_lpowo_141",dW="_root__list_lpowo_146",lW="_root__ctaButtonDesktop_lpowo_152",cW="_root__ctaButtonMobile_lpowo_155",hW="_root__itemCta_lpowo_169",gW="_root__item_lpowo_169",xi={root:fW,root__list:dW,root__ctaButtonDesktop:lW,root__ctaButtonMobile:cW,root__itemCta:hW,root__item:gW},mW={event:"",feed:"",group:"",marketplace:"/feed/marketplace",post:""},vW=({feedType:e,finalizeTest:n,highlightAbTest:t,item:i})=>{switch(e){case cc[e]:return g.jsx(lc,{...i,finalizeTest:n,highlightAbTest:t});default:return null}},pW=(e,n,t=6)=>{let i=[];if(!e.length)return[[]];const r=n?n.filter(l=>Number(l==null?void 0:l.position)>=0):[];let a=Array(t).fill(null),s=0,u=0,o=0;const f=()=>{let l=0;r.forEach(h=>{h.block===o&&(a.splice(h==null?void 0:h.position,1,h),l+=1)}),s=l};r.length&&f();const d=(l,h)=>{if(a[l]!==null&&s<t&&l<t){d(l+1,h);return}a.splice(l,1,h),s+=1,u+=1},c=(l=0,h=[])=>{if(l>e.length){if(s>0){const m=a.filter(b=>b!=null);m.length&&h.push(m)}return h}return d(u,e[l]),s===t&&a.filter(Boolean).length===t&&(h.push(a.filter(m=>m!=null)),a=Array(t).fill(null),s=0,u=0,o+=1,r.length&&f()),c(l+1,h)};return i=c(),n&&n.length>=0&&(i=n.sort((l,h)=>l.block-h.block).filter(l=>(l==null?void 0:l.position)==null).reduce((l,h,m)=>{if(i.length>h.block){const b=h.block+m+1;return[...l.slice(0,b),h,...l.slice(b)]}return l},[...i])),i},wW=e=>e?new Intl.NumberFormat("de-DE",{currency:"EUR",maximumFractionDigits:0,minimumFractionDigits:0,style:"currency"}).format(e/100).replace("€","").trim()+" €":"Zu verschenken",AW=(e,n)=>{const t=[];return e.forEach(i=>{var r,a,s;typeof i=="number"?t.push({bookmarked:n[i].is_bookmarked,id:n[i].id,image:(a=(r=n[i])==null?void 0:r.images[0])==null?void 0:a.url,premiumFeature:H3((s=n[i])==null?void 0:s.paid_highlight_until),price:wW(n[i].price),reserved:mO(n[i].outcome),reservedText:"Reserviert",timeStamp:n[i].created_at,title:n[i].subject,type:"feed"}):t.push({type:"ad",...i})}),t},bW=(e,n="de-DE")=>e[n],kW={"de-DE":{marketplace:{description:"Gib deinen Sachen ein neues Zuhause.",title:"Etwas zu verkaufen?",cta:"Angebot erstellen",cta_small:"Angebot"},feed:{description:"",title:"",cta:""},event:{description:"",title:"",cta:""},group:{description:"",title:"",cta:""},post:{description:"",title:"",cta:""}}},yW=bW(kW),xW=(e,n)=>yW[cc[e]][n];function R2({classNameButtonDesktop:e,classNameButtonMobile:n,feedType:t,isCard:i=!1,onClick:r}){const a=u=>xW(t,u),s=()=>i?g.jsxs(g.Fragment,{children:[g.jsx(O.Typography,{className:e,type:"body-semibold",children:a("cta")}),g.jsxs(O.Typography,{className:n,type:"body-semibold",children:[a("cta_small"),g.jsx(O.Icon,{name:"plus",size:"24"})]})]}):g.jsx(O.Typography,{type:"h5",children:a("cta")});return g.jsx(O.EmptyState,{primaryText:a("title"),stickerProps:{color:"teal",icon:"marketplace"},secondaryText:a("description"),size:i?"small":"medium",buttons:[{buttonType:"primary",children:s(),onClick:r,size:i?"small":"large"}]})}const CW=(e,n)=>e?n%3!==0:n%2!==0;function hp({feedType:e,finalizeTest:n,highlightAbTest:t,items:i}){const r=Fn(),a=Hi(800),s=CW(a,i.length),u=()=>{r(mW[e])};return g.jsx(g.Fragment,{children:i.length?g.jsx(O.Card,{className:ie(xi.root),borderRadius:!0,responsive:!0,children:g.jsx(O.CardBody,{className:xi.root__body,withoutPadding:!0,children:g.jsxs("ul",{className:xi.root__list,children:[i.map((o,f)=>g.jsx("li",{className:xi.root__item,children:o.type==="feed"?g.jsx(vW,{finalizeTest:n,feedType:e,item:o,highlightAbTest:t}):o.content},`grid_item_${o.type}_${o.id}`)),s&&g.jsx("li",{className:xi.root__itemCta,children:g.jsx(R2,{isCard:!0,classNameButtonDesktop:xi.root__ctaButtonDesktop,classNameButtonMobile:xi.root__ctaButtonMobile,onClick:u,feedType:e})},"empty_state_cta_card")]})})}):g.jsx(R2,{onClick:u,feedType:e})})}const zW=({feedItem:e,feedItems:n,feedType:t,finalizeTest:i,highlightAbTest:r})=>{switch(t){case cc[t]:return g.jsx(hp,{feedType:t,finalizeTest:i,items:AW(e,n),highlightAbTest:r});default:return null}},PW=({ads:e,feedItems:n,feedType:t,finalizeTest:i,highlightAbTest:r="control",items:a})=>{const s=pW(a,e);return s.length?g.jsx("section",{className:uW.root,children:s.map((u,o)=>Array.isArray(u)?g.jsx(zW,{feedItem:u,feedItems:n,feedType:t,finalizeTest:i,highlightAbTest:r},`grid_block_${o}`):g.jsx(p.Fragment,{children:u.content},`ad_block_${o}_${u.id}`))}):null},BW="_root_1nq4l_141",OW="_reservedBanner_1nq4l_144",MW="_reservedBanner__text_1nq4l_157",pf={root:BW,reservedBanner:OW,reservedBanner__text:MW},EW="_placeholderCta_1s78b_141",FW={placeholderCta:EW},gp=({ctaSlot:e,type:n})=>g.jsxs(g.Fragment,{children:[g.jsx("div",{className:FW.placeholderCta,children:e}),n==="slideshow"?g.jsx(O.GalleryPlaceholder,{}):g.jsx(O.AvatarWithPlaceholder,{alt:"Image placeholder",type:"desktop"})]}),SW="_root_uw1sg_141",RW="_leftColumn_uw1sg_153",jW="_rightColumn_uw1sg_154",TW="_rightImage_uw1sg_164",DW="_image_uw1sg_172",IW="_button_uw1sg_180",HW="_label_uw1sg_185",LW="_sticker_uw1sg_191",qt={root:SW,leftColumn:RW,rightColumn:jW,rightImage:TW,image:DW,button:IW,label:HW,sticker:LW},NW=({ctaSlot:e,images:n,onImageClick:t,stickerSlot:i})=>{const r=n.length,a=u=>{const o=g.jsx(O.Button,{className:qt.button,onClick:()=>t(u),"data-testid":"image-attachment",children:g.jsx(O.Image,{className:qt.image,alt:`Image-${u}`,src:n[u]})});return u>0?g.jsx("div",{className:qt.rightImage,children:o}):o},s=()=>r<4?null:g.jsx(O.LabelPill,{className:qt.label,size:"medium",shape:"tile",label:`+${r-3}`});return g.jsxs("div",{className:qt.root,children:[g.jsx("div",{className:qt.sticker,children:i}),r===0?g.jsx(gp,{type:"collage",ctaSlot:e}):g.jsxs(g.Fragment,{children:[s(),g.jsx("div",{className:qt.leftColumn,children:a(0)}),r>=2&&g.jsxs("div",{className:qt.rightColumn,children:[a(1),r>=3&&a(2)]})]})]})},ZW="_root_3mqqw_141",GW="_swiperSlide_3mqqw_153",WW="_navigation_3mqqw_166",YW="_pagination_3mqqw_186",QW="_imageButton_3mqqw_193",XW="_sticker_3mqqw_198",sr={root:ZW,swiperSlide:GW,navigation:WW,pagination:YW,imageButton:QW,sticker:XW},KW=({activeIndex:e=0,ctaSlot:n,images:t,onImageClick:i,stickerSlot:r})=>{const[a,s]=p.useState(null),u=p.useRef(null),o=p.useRef(null),f=p.useRef(null),[d,c]=p.useState(e);p.useEffect(()=>{c(e),a==null||a.slideToLoop(e,0)},[e,a]);const l=m=>{c(m.realIndex)},h=()=>{i&&i(d)};return g.jsxs("div",{className:sr.root,children:[g.jsx("div",{className:sr.sticker,children:r}),t.length===0?g.jsx(gp,{type:"slideshow",ctaSlot:n}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:sr.pagination,children:g.jsx(O.CarouselIndicator,{currentStep:d+1||1,totalSteps:t.length,type:"numbers"})}),g.jsxs("div",{className:sr.navigation,children:[g.jsx(O.CarouselNavigation,{direction:"left",ref:o}),g.jsx(O.CarouselNavigation,{direction:"right",ref:f})]}),g.jsx(Ja,{onSwiper:s,initialSlide:d,ref:u,onRealIndexChange:l,init:!1,modules:[$o,eu],slidesPerView:1,loop:!0,draggable:!0,onBeforeInit:m=>{m.params.navigation.nextEl=f.current,m.params.navigation.prevEl=o.current},children:t.map((m,b)=>g.jsx(qa,{tabIndex:0,className:sr.swiperSlide,children:g.jsx(O.Button,{onClick:h,className:sr.imageButton,"data-testid":"image-attachment",children:g.jsx("img",{src:m,alt:"image"})})},b))})]})]})},mp=({activeIndex:e,ctaSlot:n,images:t,onImageClick:i,reserved:r,stickerSlot:a,type:s})=>g.jsxs("div",{className:pf.root,children:[r&&g.jsx("div",{className:pf.reservedBanner,"data-testId":"reserved-banner",children:g.jsx(O.Typography,{type:"h5",className:pf.reservedBanner__text,children:"Reserviert"})}),s==="collage"?g.jsx(NW,{images:t,onImageClick:i,ctaSlot:n,stickerSlot:a}):g.jsx(KW,{activeIndex:e,images:t,onImageClick:i,ctaSlot:n,stickerSlot:a})]});function UW(e,n,t="keypress"){p.useEffect(()=>{const i=Array.isArray(e)?e:[e],r=a=>{i.includes(a.key)&&(a.preventDefault(),n(a))};return window.addEventListener(t,r),()=>{window.removeEventListener(t,r)}},[e,n,t])}const VW="_modal_17mtw_141",JW="_header_17mtw_151",qW="_content_17mtw_161",_W="_closeButtonContainer_17mtw_180",$W="_closeButton_17mtw_180",eY="_swiper_17mtw_191",nY="_swiperSlide_17mtw_195",tY="_navigation_17mtw_205",iY="_pagination_17mtw_228",rY="_footer_17mtw_235",Rn={modal:VW,header:JW,content:qW,closeButtonContainer:_W,closeButton:$W,swiper:eY,swiperSlide:nY,navigation:tY,"navigation--hidden":"_navigation--hidden_17mtw_216",pagination:iY,"pagination--hidden":"_pagination--hidden_17mtw_231",footer:rY},j2=(e,n)=>{if(!On())return e.map((r,a)=>({hidden:!1,position:a,slideIndex:a,src:r,type:"image"}));const t=[],i=new Set(n==null?void 0:n.map(r=>r.position));return e.forEach((r,a)=>{let s=a;for(;i.has(s);)s++;i.add(s),t.push({hidden:!1,position:s,slideIndex:a,src:r,type:"image"})}),n==null||n.forEach(({position:r,render:a})=>{t.push({hidden:!1,position:r,render:a,type:"ad"})}),t.sort((r,a)=>r.position-a.position)},aY=({index:e,slides:n})=>{let t=0;if(!On())return t;n[e].type==="ad"&&(t+=1);const a=n.slice(0,e).filter(s=>s.type==="ad");return t+=a.length,t},wf=({activeIndex:e,slides:n})=>n.findIndex(t=>t.type==="image"&&t.slideIndex===e),sY=e=>e.length===0?e:[...e].sort((t,i)=>t.position-i.position).map((t,i)=>({...t,position:i})),vp=({activeIndex:e,ads:n,footerAd:t,images:i,onClose:r,open:a})=>{const s=j2(i,n),[u,o]=p.useState(null),f=p.useRef(null),d=p.useRef(null),c=p.useRef(null),[l,h]=p.useState(null),[m,b]=p.useState(s),[k,A]=p.useState(wf({activeIndex:e,slides:s})),y=Hi(800),x=()=>{b(j2(i,n))};p.useEffect(()=>{x()},[y]),p.useEffect(()=>{a&&A(wf({activeIndex:e,slides:s}))},[a]),p.useEffect(()=>{if(!a||!u)return;const E=wf({activeIndex:e,slides:m}),I=m[E];h(I.type==="ad"?null:I.slideIndex),u.slideToLoop(E,0)},[m,a,u,e]);const B=E=>{const I=m[E.realIndex];A(I.position),h(I.type==="ad"?null:I.slideIndex)},z=()=>{const E=aY({index:k,slides:m});r(k-E)},R=E=>{const I=m.filter(L=>L.position!==E);b(sY(I))};return UW(["Escape","Esc"],z,"keyup"),i.length===0?null:g.jsx(Li,{children:g.jsx(Qg,{open:a,className:Rn.modal,children:g.jsxs("div",{className:Rn.content,children:[g.jsxs("div",{className:Rn.header,children:[g.jsxs(O.Typography,{type:"h5",className:ie(Rn.pagination,{[Rn["pagination--hidden"]]:l===null}),children:[l?l+1:1," von ",i.length]}),g.jsx("span",{className:Rn.closeButtonContainer,children:g.jsx(O.IconButton,{ariaLabel:"Close",icon:"cross_circle",size:"large",onClick:z,className:Rn.closeButton})})]}),g.jsxs("div",{className:ie(Rn.navigation,{[Rn["navigation--hidden"]]:m[k].type!=="ad"&&On()}),children:[g.jsx(O.CarouselNavigation,{direction:"left",ref:d}),g.jsx(O.CarouselNavigation,{direction:"right",ref:c})]}),g.jsx(Ja,{keyboard:{enabled:!0},onSwiper:o,className:Rn.swiper,ref:f,onRealIndexChange:B,init:!1,initialSlide:k,zoom:!0,modules:[WC,$o,eu,TC,IC],slidesPerView:1,loop:!0,draggable:!0,grabCursor:!0,onBeforeInit:E=>{E.params.navigation.nextEl=c.current,E.params.navigation.prevEl=d.current},children:m.filter(E=>!E.hidden).map((E,I)=>g.jsx(qa,{className:Rn.swiperSlide,children:E.type==="image"?g.jsx("div",{className:"swiper-zoom-container",children:g.jsx("img",{src:E.src})}):E.render({onHide:()=>R(E.position)})},I))}),m[k].type!=="ad"&&g.jsx("div",{className:Rn.footer,children:t==null?void 0:t.render({onHide:G7.noop})})]})})})},oY=({ads:e=[],ctaSlot:n,footerAd:t,images:i,reserved:r,stickerSlot:a,type:s="slideshow"})=>{const[u,o]=p.useState(0),[f,d]=p.useState(!1),c=h=>{o(h),d(!0)},l=h=>{o(h),d(!1)};return g.jsxs("div",{children:[g.jsx(vp,{activeIndex:u,ads:e,footerAd:t,images:i,onClose:l,open:f}),g.jsx(mp,{activeIndex:u,ctaSlot:n,images:i,onImageClick:c,reserved:r,stickerSlot:a,type:s})]})};function uY(e){e.__scriptingEnabledHTMLContentHasBeenExecuted=!0}const fY=`(${uY.toString()})(document.currentScript);`,pp=p.forwardRef((e,n)=>{const t=p.useRef(null);return p.useImperativeHandle(n,()=>({get hasBeenExecuted(){const i=t.current;return i?!!i.__scriptingEnabledHTMLContentHasBeenExecuted:!1}})),g.jsx("script",{ref:t,dangerouslySetInnerHTML:{__html:fY}})});pp.displayName="InnerHTMLScript";const dY=(e,n)=>{const t=document.createRange().createContextualFragment(n);e.innerHTML="",e.appendChild(t)},lY=({html:e,...n})=>{const t=p.useRef(null),i=p.useRef(null);return p.useEffect(()=>{const r=i.current,a=t.current;!r||!a||a.hasBeenExecuted||dY(r,e)},[e]),g.jsxs(g.Fragment,{children:[g.jsx(pp,{ref:t}),g.jsx("div",{...n,ref:i,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:e}})]})};var Qd=function(e,n){return Qd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])},Qd(e,n)};function hc(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Qd(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var X=function(){return X=Object.assign||function(n){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},X.apply(this,arguments)};function Dr(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]]);return t}function T2(e,n,t,i){function r(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function u(d){try{f(i.next(d))}catch(c){s(c)}}function o(d){try{f(i.throw(d))}catch(c){s(c)}}function f(d){d.done?a(d.value):r(d.value).then(u,o)}f((i=i.apply(e,n||[])).next())})}function D2(e,n){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(d){return o([f,d])}}function o(f){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(t=0)),t;)try{if(i=1,r&&(a=f[0]&2?r.return:f[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,f[1])).done)return a;switch(r=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,r=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){t.label=f[1];break}if(f[0]===6&&t.label<a[1]){t.label=a[1],a=f;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(f);break}a[2]&&t.ops.pop(),t.trys.pop();continue}f=n.call(e,t)}catch(d){f=[6,d],r=0}finally{i=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function We(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),r,a=[],s;try{for(;(n===void 0||n-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(u){s={error:u}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return a}function cY(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;for(var i=Array(e),r=0,n=0;n<t;n++)for(var a=arguments[n],s=0,u=a.length;s<u;s++,r++)i[r]=a[s];return i}function Za(e,n,t){if(t||arguments.length===2)for(var i=0,r=n.length,a;i<r;i++)(a||!(i in n))&&(a||(a=Array.prototype.slice.call(n,0,i)),a[i]=n[i]);return e.concat(a||Array.prototype.slice.call(n))}function Xd(e,n){var t,i;return e&&n?(t=""+e+n[0].toUpperCase()+n.slice(1),i=e+"-"+n):(t=e||n,i=e||n),{camelCase:t,snakeCase:i}}function wp(e){return/^blob:/.test(e)}function hY(e){return/^data:/.test(e)}function Ap(e){return wp(e)||hY(e)}function gY(e){if(Ap(e))return!1;var n=window.location,t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,i=t.exec(e)||[],r={protocol:i[1]||"",host:i[2]||"",port:i[3]||""},a=function(u){return u==="http"?80:433},s=function(u){return u.port||a(u.protocol||n.protocol)};return!(!r.protocol&&!r.host&&!r.port||r.protocol&&r.protocol==n.protocol&&r.host&&r.host==n.host&&r.host&&s(r)==s(n))}function mY(e){return Array.isArray(e)}function ke(e){return typeof e=="function"}function Ke(e){return e===void 0}var Di=function(e){return e!==null&&typeof e=="object"};function os(e,n,t){t===void 0&&(t={});var i={};return Di(e)?(Object.keys(n).forEach(function(r){Ke(e[r])?i[r]=n[r]:Di(n[r])?Di(e[r])?i[r]=os(e[r],n[r],t[r]):i[r]=e[r]?n[r]:t[r]:n[r]===!0||n[r]===!1?i[r]=!!e[r]:i[r]=e[r]}),i):e?n:t}function ri(e){var n=Number(e);return Number.isNaN(n)?e:n}function I2(e){return e===!0||e===!1}function Te(e){return typeof e=="number"}function vY(e){return typeof e=="string"}function bp(e){return e!==e}function qn(e){return Te(e)&&!bp(e)||vY(e)&&!Number.isNaN(parseFloat(e))&&isFinite(parseFloat(e))}function kp(e,n){return Math.sqrt(Math.pow(e.left-n.left,2)+Math.pow(e.top-n.top,2))}function Dt(e,n,t){return t===void 0&&(t=.001),Math.abs(n-e)<t}function ui(e,n,t){return Dt(e,n,t)?!1:e>n}function Sr(e,n,t){return Dt(e,n,t)?!1:e<n}function pY(e){var n=+e;return n===0||bp(n)?n:n>0?1:-1}function H2(e){return new Promise(function(n){setTimeout(function(){n()},e)})}function Ga(e){if(!Di(e))return e;var n={};return Array.isArray(e)?n=e.map(function(t){return Ga(t)}):Object.keys(e).forEach(function(t){return n[t]=Ga(e[t])}),n}function kr(e,n,t){if(t===void 0&&(t=.001),Te(e)&&Te(n)&&Dt(e,n,t)||e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r=void 0;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!kr(e[r],n[r],t))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();var a=Object.keys(e);if(i=a.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;r--!==0;){var s=a[r];if(!kr(e[s],n[s],t))return!1}return!0}return e!==e&&n!==n}function yp(){return{left:0,top:0,width:0,height:0}}function wY(e){return e==="west"||e==="south"||e==="north"||e==="east"}function xp(e,n){var t,i;function r(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var o=Date.now()-t,f=ke(n)?n():n||0;o<f&&o>=0?i=setTimeout(function(){return r.apply(void 0,s)},f-o):e.apply(void 0,s)}function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t=Date.now(),i=setTimeout(function(){return r.apply(void 0,s)},ke(n)?n():n||0)}return a.clear=function(){clearTimeout(i)},a}var Jn=["left","right","top","bottom"],AY=["left","right"],bY=["top","bottom"];function _n(e,n){return{left:e.left-n.left,top:e.top-n.top}}function Ie(e){return{left:e.left+e.width/2,top:e.top+e.height/2}}function kY(e){return{left:"right",top:"bottom",right:"left",bottom:"top"}[e]}function L2(e,n){return Math.pow(e.width-n.width,2)+Math.pow(e.height-n.height,2)}function ct(e,n){return{left:e.left-n.left,top:e.top-n.top,width:e.width+n.left+n.right,height:e.height+n.top+n.bottom}}function gc(e){return{left:-e.left,top:-e.top}}function nn(e,n){return X(X({},e),{left:e.left+n.left,top:e.top+n.top})}function Mn(e){return{left:e.left,top:e.top,right:e.left+e.width,bottom:e.top+e.height}}function At(e,n,t,i){if(n!==1)if("left"in e||"top"in e)if(t){var r=Ie(e);return{width:e.width*n,height:e.height*n,left:e.left+e.width*(1-n)/2+(t.left-r.left)*(1-n),top:e.top+e.height*(1-n)/2+(t.top-r.top)*(1-n)}}else return{width:e.width*n,height:e.height*n,left:e.left+e.width*(1-n)/2,top:e.top+e.height*(1-n)/2};else return{width:e.width*n,height:e.height*n};else return e}function he(e){return e.width/e.height}function Kd(e,n){return Math.min(n.maxWidth?n.maxWidth/e.width:1/0,n.maxHeight?n.maxHeight/e.height:1/0)}function yY(e,n){return Math.max(n.minWidth?n.minWidth/e.width:0,n.minHeight?n.minHeight/e.height:0)}function Wa(e,n){var t;return n.minimum&&Sr(e,n.minimum)?t=n.minimum:n.maximum&&ui(e,n.maximum)&&(t=n.maximum),t}function mc(e,n){var t=he(e),i=1;return n.minWidth>0&&n.minHeight>0?t>n.minWidth/n.minHeight?e.height<n.minHeight&&(i=n.minHeight/e.height):e.width<n.minWidth&&(i=n.minWidth/e.width):n.minWidth>0?e.width<n.minWidth&&(i=n.minWidth/e.width):n.minHeight>0&&e.height<n.minHeight&&(i=n.minHeight/e.height),n.maxWidth<1/0&&n.maxHeight<1/0?t>n.maxWidth/n.maxHeight?e.width>n.maxWidth&&(i=n.maxWidth/e.width):e.height>n.maxHeight&&(i=n.maxHeight/e.height):n.maxWidth<1/0?e.width>n.maxWidth&&(i=n.maxWidth/e.width):n.maxHeight<1/0&&e.height>n.maxHeight&&(i=n.maxHeight/e.height),i}function No(e,n){var t={left:0,top:0,right:0,bottom:0};return Jn.forEach(function(i){var r=n[i],a=Mn(e)[i];r!==void 0&&a!==void 0?i==="left"||i==="top"?t[i]=Math.max(0,r-a):t[i]=Math.max(0,a-r):t[i]=0}),t}function lu(e,n){return At(e,mc(e,n))}function Cp(e,n){var t=n*Math.PI/180;return{width:Math.abs(e.width*Math.cos(t))+Math.abs(e.height*Math.sin(t)),height:Math.abs(e.width*Math.sin(t))+Math.abs(e.height*Math.cos(t))}}function Tt(e,n,t){var i=n*Math.PI/180;return t?{left:(e.left-t.left)*Math.cos(i)-(e.top-t.top)*Math.sin(i)+t.left,top:(e.left-t.left)*Math.sin(i)+(e.top-t.top)*Math.cos(i)+t.top}:{left:e.left*Math.cos(i)-e.top*Math.sin(i),top:e.left*Math.sin(i)+e.top*Math.cos(i)}}function zp(e){return{minWidth:0,minHeight:0,maxWidth:e.right!==void 0&&e.left!==void 0?e.right-e.left:1/0,maxHeight:e.bottom!==void 0&&e.top!==void 0?e.bottom-e.top:1/0}}function hi(e,n){var t={};return Jn.forEach(function(i){var r=e[i],a=n[i];r!==void 0&&a!==void 0?i==="left"||i==="top"?t[i]=Math.max(r,a):t[i]=Math.min(r,a):a!==void 0?t[i]=a:r!==void 0&&(t[i]=r)}),t}function cu(e,n){var t={left:0,top:0},i=No(e,n);return i.left&&i.left>0?t.left=i.left:i.right&&i.right>0&&(t.left=-i.right),i.top&&i.top>0?t.top=i.top:i.bottom&&i.bottom>0&&(t.top=-i.bottom),t}function Qe(e,n){return nn(e,cu(e,n))}function xY(e,n){return n?e?{minimum:Math.min(e.maximum,Math.max(e.minimum,n.minimum)),maximum:Math.max(e.minimum,Math.min(e.maximum,n.maximum))}:n:e}function $i(e){return e===void 0&&(e={}),Te(e)?{minimum:e,maximum:e}:{minimum:qn(e.minimum)?e.minimum:0,maximum:qn(e.maximum)?e.maximum:1/0}}function Ud(e,n){return(Ke(n.maxWidth)||!ui(e.width,n.maxWidth))&&(Ke(n.maxHeight)||!ui(e.height,n.maxHeight))&&(Ke(n.minHeight)||!Sr(e.height,n.minHeight))&&(Ke(n.minWidth)||!Sr(e.width,n.minWidth))}function N2(e,n){return(Ke(n.left)||!Sr(e.left,n.left))&&(Ke(n.top)||!Sr(e.top,n.top))&&(Ke(n.right)||!ui(e.left+e.width,n.right))&&(Ke(n.bottom)||!ui(e.top+e.height,n.bottom))}function CY(e,n,t,i){var r=function(a){return e.reduce(function(s,u){var o=ke(t)?t(u):t,f=o.maxHeight,d=o.maxWidth,c=o.minWidth,l=o.minHeight,h=$i(ke(i)?i(u):i),m=a?{maxWidth:d,maxHeight:f}:{maxWidth:d,maxHeight:f,minWidth:c,minHeight:l};return Ud(u,m)&&!Wa(he(u),h)&&u.width&&u.height&&(!s||Sr(L2(u,n),L2(s,n)))?u:s},null)};return r()||r(!0)}function Gn(e){return!!(e&&e.visibleArea&&e.coordinates)}function tt(e,n){return MY(e,n)}function $n(e,n){return ke(n.areaPositionRestrictions)?n.areaPositionRestrictions(e,n):n.areaPositionRestrictions}function it(e,n){return OY(e,n)}function En(e,n){return ke(n.positionRestrictions)?n.positionRestrictions(e,n):n.positionRestrictions}function er(e){return e.visibleArea?e.visibleArea.width/e.boundary.width:0}function vc(e){if(Gn(e)){var n=e.coordinates,t=n.width,i=n.height,r=n.left,a=n.top,s=er(e);return{width:t/s,height:i/s,left:(r-e.visibleArea.left)/s,top:(a-e.visibleArea.top)/s}}else return yp()}function gi(e,n){return $i(ke(n.aspectRatio)?n.aspectRatio(e,n):n.aspectRatio)}function Z2(e,n){return ke(n.defaultCoordinates)?n.defaultCoordinates(e,n):n.defaultCoordinates}function G2(e,n){return ke(n.defaultVisibleArea)?n.defaultVisibleArea(e,n):n.defaultVisibleArea}function zY(e,n){var t=X(X({},e.transforms),{flip:X({},e.transforms.flip)});if(n.defaultTransforms){var i=ke(n.defaultTransforms)?n.defaultTransforms(e,n):n.defaultTransforms;Te(i.rotate)&&(t.rotate=i.rotate),i.flip&&(I2(i.flip.horizontal)&&(t.flip.horizontal=i.flip.horizontal),I2(i.flip.vertical)&&(t.flip.vertical=i.flip.vertical))}return t}function Lt(e){return e.imageSize&&e.imageSize.width&&e.imageSize.height?Cp(e.imageSize,e.transforms.rotate):{width:0,height:0}}function PY(e){return e.coordinates?Math.min(e.coordinates.width,e.coordinates.height,20*er(e)):1}function BY(e,n){if(Gn(e)){var t=it(e,n),i=En(e,n),r={width:Math.round(e.coordinates.width),height:Math.round(e.coordinates.height),left:Math.round(e.coordinates.left),top:Math.round(e.coordinates.top)};return r.width>t.maxWidth?r.width=Math.floor(e.coordinates.width):r.width<t.minWidth&&(r.width=Math.ceil(e.coordinates.width)),r.height>t.maxHeight?r.height=Math.floor(e.coordinates.height):r.height<t.minHeight&&(r.height=Math.ceil(e.coordinates.height)),Qe(r,i)}else return null}function W2(e,n){return Gn(e)?!Wa(he(e.coordinates),gi(e,n))&&Ud(e.visibleArea,tt(e,n))&&Ud(e.coordinates,it(e,n))&&N2(e.visibleArea,$n(e,n))&&N2(e.coordinates,En(e,n)):!0}function pc(e){var n=X({},e);return n.minWidth>n.maxWidth&&(n.minWidth=n.maxWidth),n.minHeight>n.maxHeight&&(n.minHeight=n.maxHeight),n}function wc(e,n){var t=e,i=X({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},n);return pc({maxHeight:Math.min(t.maxHeight,i.maxHeight),minHeight:Math.max(t.minHeight,i.minHeight),maxWidth:Math.min(t.maxWidth,i.maxWidth),minWidth:Math.max(t.minWidth,i.minWidth)})}function OY(e,n){var t=ke(n.sizeRestrictions)?n.sizeRestrictions(e,n):n.sizeRestrictions,i=En(e,n),r={minWidth:qn(t.minWidth)?ri(t.minWidth):0,minHeight:qn(t.minHeight)?ri(t.minHeight):0,maxWidth:qn(t.maxWidth)?ri(t.maxWidth):1/0,maxHeight:qn(t.maxHeight)?ri(t.maxHeight):1/0};return i.left!==void 0&&i.right!==void 0&&(r.maxWidth=Math.min(r.maxWidth,i.right-i.left)),i.bottom!==void 0&&i.top!==void 0&&(r.maxHeight=Math.min(r.maxHeight,i.bottom-i.top)),pc(r)}function MY(e,n){var t=ke(n.areaSizeRestrictions)?n.areaSizeRestrictions(e,n):n.areaSizeRestrictions;return t.maxWidth<1/0&&t.maxHeight<1/0&&(he(e.boundary)>t.maxWidth/t.maxHeight?t.maxHeight=t.maxWidth/he(e.boundary):t.maxWidth=t.maxHeight*he(e.boundary)),pc(t)}function ln(e){return Ga(e)}var Qi;(function(e){e.fillArea="fillArea",e.fitArea="fitArea",e.stencil="stencil",e.none="none"})(Qi||(Qi={}));var Vd;(function(e){e.coordinates="coordinates",e.visibleArea="visibleArea"})(Vd||(Vd={}));function et(e){var n=e.width,t=e.height,i=e.sizeRestrictions||{minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},r=$i(e.aspectRatio),a={width:Math.max(i.minWidth,Math.min(i.maxWidth,n)),height:Math.max(i.minHeight,Math.min(i.maxHeight,t))},s=[a];return r&&[r.minimum,r.maximum].forEach(function(u){u&&s.push({width:a.width,height:a.width/u},{width:a.height*u,height:a.height})}),s=s.map(function(u){return lu(u,i)}),CY(s,{width:n,height:t},i,r)}function Pp(e,n){var t=ln(e);if(e.visibleArea){var i=tt(e,n);t.visibleArea=X(X({},e.visibleArea),et({width:e.visibleArea.width,height:e.visibleArea.height,aspectRatio:{minimum:he(t.boundary),maximum:he(t.boundary)},sizeRestrictions:i})),t.visibleArea=nn(t.visibleArea,_n(Ie(e.visibleArea),Ie(t.visibleArea))),t.visibleArea=Qe(t.visibleArea,$n(t,n))}return t}function Bp(e,n,t){var i=nn(e,n);return t?Qe(i,t):i}var mt;(function(e){e.limit="limit",e.zoom="zoom",e.unsafe="unsafe"})(mt||(mt={}));function Jd(e,n,t,i){i===void 0&&(i=!0);var r=i===!1?mt.unsafe:i===!0?mt.zoom:i,a=gi(e,n),s=it(e,n);e.visibleArea&&r===mt.limit&&(s=X(X({},s),{minWidth:Math.min(e.visibleArea.width,s.minWidth),minHeight:Math.min(e.visibleArea.height,s.minHeight),maxWidth:Math.min(e.visibleArea.width,s.maxWidth),maxHeight:Math.min(e.visibleArea.height,s.maxHeight)}));var u=En(e,n);e.visibleArea&&r===mt.limit&&(u=hi(u,Mn(e.visibleArea)));var o=function(A,y){return Bp(A,{left:y.left-(A.left||0),top:y.top-(A.top||0)},u)},f=function(A,y){var x=X(X(X({},A),et({width:y.width,height:y.height,sizeRestrictions:s,aspectRatio:a})),{left:0,top:0});return o(x,{left:A.left||0,top:A.top||0})},d=e.coordinates?X({},e.coordinates):yp(),c=Array.isArray(t)?t:[t];c.forEach(function(A){var y;typeof A=="function"?y=A(X(X({},e),{coordinates:d}),n):y=A,y&&((!Ke(y.width)||!Ke(y.height))&&(d=f(d,X(X({},d),y))),(!Ke(y.left)||!Ke(y.top))&&(d=o(d,X(X({},d),y))))});var l=X(X({},ln(e)),{coordinates:d});if(l.visibleArea&&r===mt.zoom){var h=Math.max(0,l.coordinates.width-l.visibleArea.width),m=Math.max(0,l.coordinates.height-l.visibleArea.height),b=tt(e,n),k=h>m?l.coordinates.width/l.visibleArea.width:l.coordinates.height/l.visibleArea.height;return k>1&&(l.visibleArea=At(l.visibleArea,Math.min(k,Kd(l.visibleArea,b)))),l.visibleArea=nn(l.visibleArea,gc(cu(l.coordinates,Mn(l.visibleArea)))),Pp(l,n)}else return l}function Op(e,n){if(e.coordinates){var t=ln(e),i=gi(e,n),r=it(e,n);return t.coordinates=X(X({},e.coordinates),et({width:e.coordinates.width,height:e.coordinates.height,aspectRatio:i,sizeRestrictions:e.visibleArea?{maxWidth:Math.min(e.visibleArea.width,r.maxWidth),maxHeight:Math.min(e.visibleArea.height,r.maxHeight),minHeight:Math.min(e.visibleArea.height,r.minHeight),minWidth:Math.min(e.visibleArea.width,r.minWidth)}:r})),t.coordinates=nn(t.coordinates,_n(Ie(e.coordinates),Ie(t.coordinates))),t.coordinates=Qe(t.coordinates,e.visibleArea?hi(Mn(e.visibleArea),En(t,n)):En(t,n)),t}return e}function qd(e,n,t,i){i===void 0&&(i=!0);var r=X(X({},ln(e)),{visibleArea:t});return r=Pp(r,n),i&&(r=Op(r,n)),r}function EY(e,n){var t,i,r,a,s,u=e.boundary,o=e.image,f={boundary:{width:u.width,height:u.height},imageSize:{width:o.width,height:o.height},transforms:{rotate:((t=o.transforms)===null||t===void 0?void 0:t.rotate)||0,flip:{horizontal:((r=(i=o.transforms)===null||i===void 0?void 0:i.flip)===null||r===void 0?void 0:r.horizontal)||!1,vertical:((s=(a=o.transforms)===null||a===void 0?void 0:a.flip)===null||s===void 0?void 0:s.vertical)||!1}},visibleArea:null,coordinates:null};return n.defaultTransforms&&(f.transforms=zY(f,n)),n.priority===Vd.visibleArea?(f=qd(f,n,G2(f,n),!1),f=Jd(f,n,Z2(f,n),mt.limit)):(f=Jd(f,n,Z2(f,n),mt.unsafe),f=qd(f,n,G2(f,n),!0)),f}function FY(e,n,t){if(Gn(e)){var i=ln(e);return i.coordinates=nn(i.coordinates,t),i.coordinates=Qe(i.coordinates,hi(Mn(i.visibleArea),En(i,n))),i}return e}function Y2(e){var n=e.coordinates,t=e.directions,i=e.positionRestrictions,r=e.sizeRestrictions,a=e.preserveRatio,s=e.allowedDirections,u=e.compensate,o=u===void 0?!0:u,f=X({},t),d=ct(n,f).width,c=ct(n,f).height;d<0&&(f.left<0&&f.right<0?(f.left=-(n.width-r.minWidth)/(f.left/f.right),f.right=-(n.width-r.minWidth)/(f.right/f.left)):f.left<0?f.left=-(n.width-r.minWidth):f.right<0&&(f.right=-(n.width-r.minWidth))),c<0&&(f.top<0&&f.bottom<0?(f.top=-(n.height-r.minHeight)/(f.top/f.bottom),f.bottom=-(n.height-r.minHeight)/(f.bottom/f.top)):f.top<0?f.top=-(n.height-r.minHeight):f.bottom<0&&(f.bottom=-(n.height-r.minHeight)));var l=No(ct(n,f),i),h=Jn.every(function(A){return!ui(l[kY(A)],0)||s[A]});o&&h&&(l.left&&l.left>0&&l.right===0?(f.right+=l.left,f.left-=l.left):l.right&&l.right>0&&l.left===0&&(f.left+=l.right,f.right-=l.right),l.top&&l.top>0&&l.bottom===0?(f.bottom+=l.top,f.top-=l.top):l.bottom&&l.bottom>0&&l.top===0&&(f.top+=l.bottom,f.bottom-=l.bottom),l=No(ct(n,f),i));var m={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Jn.forEach(function(A){var y=l[A];y&&f[A]&&(m[A]=Math.max(0,1-y/f[A]))}),a){var b=Math.min.apply(Math,Jn.map(function(A){return m[A]}));b!==1/0&&Jn.forEach(function(A){f[A]*=b})}else Jn.forEach(function(A){m[A]!==1/0&&(f[A]*=m[A])});if(d=ct(n,f).width,c=ct(n,f).height,f.right+f.left&&(d>r.maxWidth?m.width=(r.maxWidth-n.width)/(f.right+f.left):d<r.minWidth&&(m.width=(r.minWidth-n.width)/(f.right+f.left))),f.bottom+f.top&&(c>r.maxHeight?m.height=(r.maxHeight-n.height)/(f.bottom+f.top):c<r.minHeight&&(m.height=(r.minHeight-n.height)/(f.bottom+f.top))),a){var k=Math.min(m.width,m.height);k!==1/0&&Jn.forEach(function(A){f[A]*=k})}else m.width!==1/0&&AY.forEach(function(A){f[A]*=m.width}),m.height!==1/0&&bY.forEach(function(A){f[A]*=m.height});return f}function js(e,n,t){return Dt(n+t,0)?e/2:Dt(n,0)?0:Dt(t,0)?e:e*Math.abs(n/(n+t))}function SY(e,n,t,i){var r=i.aspectRatio,a=i.positionRestrictions,s=i.sizeRestrictions,u=X({},e);n=X({},n);var o=t.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};e.width<s.minWidth&&(n.left=0,n.right=0),e.height<s.minHeight&&(n.top=0,n.bottom=0),Jn.forEach(function(x){o[x]||(n[x]=0)}),n=Y2({coordinates:u,directions:n,sizeRestrictions:s,positionRestrictions:a,allowedDirections:o});var f=ct(u,n).width,d=ct(u,n).height,c=t.preserveAspectRatio?he(u):Wa(f/d,r);if(c){var l=t.respectDirection;if(l!=="width"&&l!=="height"&&(u.width>=u.height||c===1?l="width":l="height"),l==="width"){var h=f/c-u.height;if(o.top&&o.bottom){var m=n.top,b=n.bottom;n.bottom=js(h,b,m),n.top=js(h,m,b)}else o.bottom?n.bottom=h:o.top?n.top=h:o.right?n.right=0:o.left&&(n.left=0)}else if(l==="height"){var k=u.width-d*c;if(o.left&&o.right){var A=n.left,y=n.right;n.left=-js(k,A,y),n.right=-js(k,y,A)}else o.left?n.left=-k:o.right?n.right=-k:o.top?n.top=0:o.bottom&&(n.bottom=0)}n=Y2({directions:n,coordinates:u,sizeRestrictions:s,positionRestrictions:a,preserveRatio:!0,compensate:t.compensate,allowedDirections:o})}return f=ct(u,n).width,d=ct(u,n).height,c=t.preserveAspectRatio?he(u):Wa(f/d,r),c&&ui(Math.abs(c-f/d),0)&&Jn.forEach(function(x){n[x]=0}),Bp({width:e.width+n.right+n.left,height:e.height+n.top+n.bottom,left:e.left,top:e.top},{left:-n.left,top:-n.top},a)}function Q2(e,n){var t=n.toLowerCase();return{left:e.left+e.width*(t.indexOf("west")!==-1?1:t.indexOf("east")!==-1?0:.5),top:e.top+e.height*(t.indexOf("north")!==-1?1:t.indexOf("south")!==-1?0:.5)}}function Mp(e){var n=e.toLowerCase();return{left:n.indexOf("east")===-1,top:n.indexOf("south")===-1,right:n.indexOf("west")===-1,bottom:n.indexOf("north")===-1}}function RY(e,n){var t=e.toLowerCase(),i={left:t.indexOf("west")===-1?n.left:-n.left,top:-n.top,right:n.left,bottom:n.top};["north","south","center"].every(function(a){return t.indexOf(a)===-1})&&(i.top=0,i.bottom=0),["west","east","center"].every(function(a){return t.indexOf(a)===-1})&&(i.left=0,i.right=0);var r=Mp(e);return Jn.forEach(function(a){r[a]||(i[a]=0)}),i}function jY(e,n,t,i,r){var a=i.reference,s=RY(n,t),u=Mp(n),o=SY(e,s,X(X({},i),{allowedDirections:u}),r);return a&&(o=nn(o,_n(Q2(a,n),Q2(o,n)))),Qe(o,r.positionRestrictions)}function TY(e,n,t,i,r){var a=PY(e),s=it(e,n);return Gn(e)?X(X({},ln(e)),{coordinates:jY(e.coordinates,t,i,r,{positionRestrictions:hi(En(e,n),Mn(e.visibleArea)),sizeRestrictions:{maxWidth:Math.min(s.maxWidth,e.visibleArea.width),maxHeight:Math.min(s.maxHeight,e.visibleArea.height),minWidth:Math.max(Math.min(s.minWidth,e.visibleArea.width),a),minHeight:Math.max(Math.min(s.minHeight,e.visibleArea.height),a)},aspectRatio:gi(e,n)})}):e}function DY(e,n,t){var i=X(X({},ln(e)),{boundary:t});if(i.visibleArea&&i.coordinates&&e.visibleArea){i.visibleArea.height=i.visibleArea.width/he(t),i.visibleArea.top+=(e.visibleArea.height-i.visibleArea.height)/2;var r=it(i,n);(Math.max(r.minHeight,i.coordinates.height)-i.visibleArea.height>0||Math.max(r.minWidth,i.coordinates.width)-i.visibleArea.width>0)&&(i.visibleArea=At(i.visibleArea,Math.max(Math.max(r.minHeight,i.coordinates.height)/i.visibleArea.height,Math.max(r.minWidth,i.coordinates.width)/i.visibleArea.width))),i.visibleArea=lu(i.visibleArea,tt(i,n));var a=gc(cu(i.coordinates,Mn(i.visibleArea)));i.visibleArea.width<i.coordinates.width&&(a.left=0),i.visibleArea.height<i.coordinates.height&&(a.top=0),i.visibleArea=nn(i.visibleArea,a),i.visibleArea=Qe(i.visibleArea,$n(i,n)),i=Op(i,n)}return i}function IY(e,n,t){if(Gn(e)){var i=ln(e),r=Te(t)?t:t.angle,a=Tt(Ie(X({left:0,top:0},Lt(e))),r);i.transforms.rotate+=r,i.coordinates=X(X({},et({sizeRestrictions:it(i,n),aspectRatio:gi(i,n),width:i.coordinates.width,height:i.coordinates.height})),Tt(Ie(i.coordinates),r));var s=!Te(t)&&t.center?t.center:Ie(e.coordinates),u=_n(Ie(e.coordinates),Tt(Ie(e.coordinates),r,s)),o=Lt(i);return i.coordinates.left-=a.left-o.width/2+i.coordinates.width/2-u.left,i.coordinates.top-=a.top-o.height/2+i.coordinates.height/2-u.top,i.visibleArea=lu(i.visibleArea,wc(tt(i,n),{minWidth:i.coordinates.width,minHeight:i.coordinates.height})),i.coordinates=Qe(i.coordinates,En(i,n)),i.visibleArea=nn(i.visibleArea,_n(Ie(i.coordinates),Ie(e.coordinates))),i.visibleArea=Qe(i.visibleArea,$n(i,n)),i}return e}function HY(e,n,t,i){if(Gn(e)){var r=ln(e),a=e.transforms.rotate,s=Lt(e),u={horizontal:t,vertical:i};if(u.horizontal||u.vertical){var o=Tt({left:s.width/2,top:s.height/2},-a),f=Tt(Ie(r.coordinates),-a),d=Tt({left:u.horizontal?o.left-(f.left-o.left):f.left,top:u.vertical?o.top-(f.top-o.top):f.top},a);r.coordinates=nn(r.coordinates,_n(d,Ie(r.coordinates))),f=Tt(Ie(r.visibleArea),-a),d=Tt({left:u.horizontal?o.left-(f.left-o.left):f.left,top:u.vertical?o.top-(f.top-o.top):f.top},a),r.visibleArea=nn(r.visibleArea,_n(d,Ie(r.visibleArea))),r.visibleArea=Qe(r.visibleArea,$n(r,n))}return u.horizontal&&(r.transforms.flip.horizontal=!e.transforms.flip.horizontal),u.vertical&&(r.transforms.flip.vertical=!e.transforms.flip.vertical),r}return e}function LY(e,n,t){var i,r=t.scale,a=r===void 0?1:r,s=t.move,u=s===void 0?{}:s;if(Gn(e)){var o=ln(e),f=1/(Te(a)?a:a.factor),d=Te(a)?void 0:a.center,c=!Dt(f,1),l=1,h=1;o.visibleArea=nn(o.visibleArea,{left:u.left||0,top:u.top||0});var m=it(o,n),b=En(o,n),k=tt(o,n),A={stencil:{minimum:Math.max(m.minWidth?m.minWidth/o.coordinates.width:0,m.minHeight?m.minHeight/o.coordinates.height:0),maximum:Math.min(m.maxWidth?m.maxWidth/o.coordinates.width:1/0,m.maxHeight?m.maxHeight/o.coordinates.height:1/0,Kd(o.coordinates,zp(b)))},area:{maximum:Kd(o.visibleArea,k),minimum:yY(o.visibleArea,k)}};f&&c&&(f<1?(h=Math.max(f,Math.max(A.area.minimum,A.stencil.minimum)),h>1&&(h=1)):f>1&&(h=Math.min(f,Math.min(A.area.maximum,A.stencil.maximum)),h<1&&(h=1))),h&&(o.visibleArea=At(o.visibleArea,h,d));var y={left:e.coordinates.left-e.visibleArea.left,right:e.visibleArea.width+e.visibleArea.left-(e.coordinates.width+e.coordinates.left),top:e.coordinates.top-e.visibleArea.top,bottom:e.visibleArea.height+e.visibleArea.top-(e.coordinates.height+e.coordinates.top)};return o.visibleArea=Qe(o.visibleArea,{left:b.left!==void 0?b.left-y.left*h:void 0,top:b.top!==void 0?b.top-y.top*h:void 0,bottom:b.bottom!==void 0?b.bottom+y.bottom*h:void 0,right:b.right!==void 0?b.right+y.right*h:void 0}),o.visibleArea=Qe(o.visibleArea,$n(o,n)),o.coordinates.width=o.coordinates.width*h,o.coordinates.height=o.coordinates.height*h,o.coordinates.left=o.visibleArea.left+y.left*h,o.coordinates.top=o.visibleArea.top+y.top*h,o.coordinates=Qe(o.coordinates,hi(Mn(o.visibleArea),b)),c&&f&&(!((i=n.transformImage)===null||i===void 0)&&i.adjustStencil)&&(f>1?l=Math.min(A.area.maximum,f)/h:f<1&&(l=Math.max(o.coordinates.height/o.visibleArea.height,o.coordinates.width/o.visibleArea.width,f/h)),l!==1&&(o.visibleArea=At(o.visibleArea,l,f>1?d:Ie(o.coordinates)),o.visibleArea=Qe(o.visibleArea,$n(o,n)),o.visibleArea=nn(o.visibleArea,gc(cu(o.coordinates,Mn(o.visibleArea)))))),o}return e}function NY(e,n,t){return t.rotate&&(e=IY(e,n,t.rotate)),t.flip&&(e=HY(e,n,t.flip.horizontal,t.flip.vertical)),(t.move||t.scale)&&(e=LY(e,n,t)),e}function ZY(e,n){if(Gn(e)){var t=ln(e),i=gi(e,n),r=it(e,n),a=tt(e,n),s=Wa(he(e.coordinates),i),u=s?{height:e.coordinates.height,width:e.coordinates.height*s}:e.coordinates;t.coordinates=X(X({},t.coordinates),et({width:u.width,height:u.height,aspectRatio:i,sizeRestrictions:wc(a,r)})),t.coordinates=nn(t.coordinates,_n(Ie(e.coordinates),Ie(t.coordinates)));var o=Math.max(t.coordinates.width/t.visibleArea.width,t.coordinates.height/t.visibleArea.height,1);return t.visibleArea=X(X({},e.visibleArea),et({width:e.visibleArea.width*o,height:e.visibleArea.height*o,aspectRatio:{minimum:he(t.boundary),maximum:he(t.boundary)},sizeRestrictions:a})),t.visibleArea=nn(t.visibleArea,_n(Ie(e.visibleArea),Ie(t.visibleArea))),t.visibleArea=Qe(t.visibleArea,$n(t,n)),t.coordinates=Qe(t.coordinates,hi(Mn(t.visibleArea),En(t,n))),t}return e}function GY(e,n){var t=er(e);return{left:Te(n.left)?n.left*t:0,top:Te(n.top)?n.top*t:0,right:Te(n.right)?n.right*t:0,bottom:Te(n.bottom)?n.bottom*t:0}}function X2(e,n){var t=er(e);return e.visibleArea?{left:n.left*t+e.visibleArea.left,top:n.top*t+e.visibleArea.top}:n}function WY(e,n){if(e){var t=Math.abs(e.transforms.rotate%180);return t<=45||t>=135?n:{horizontal:n.vertical,vertical:n.horizontal}}return n}function YY(e){return{left:Te(e.left)?e.left:0,top:Te(e.top)?e.top:0}}function QY(e){return{left:Te(e.left)?e.left:0,top:Te(e.top)?e.top:0,right:Te(e.right)?e.right:0,bottom:Te(e.bottom)?e.bottom:0}}function Ep(e,n){var t=er(e);return{left:Te(n.left)?n.left*t:0,top:Te(n.top)?n.top*t:0}}function XY(e,n){return n.scale&&(n.scale={factor:Te(n.scale)?n.scale:n.scale.factor,center:!Te(n.scale)&&n.scale.center?X2(e,n.scale.center):void 0}),n.rotate&&(n.rotate={angle:Te(n.rotate)?n.rotate:n.rotate.angle,center:!Te(n.rotate)&&n.rotate.center?X2(e,n.rotate.center):void 0}),n.move&&(n.move=Ep(e,n.move)),n}function K2(e,n){var t=n.getBoundingClientRect(),i=t.left,r=t.top,a={left:0,top:0},s=0;return e.forEach(function(u){a.left+=(u.clientX-i)/e.length,a.top+=(u.clientY-r)/e.length}),e.forEach(function(u){s+=kp({left:a.left,top:a.top},{left:u.clientX-i,top:u.clientY-r})}),{centerMass:a,spread:s,count:e.length}}function KY(e,n,t,i){i===void 0&&(i={});var r,a,s;if(n.length===1&&e.length===1)i.move&&(r={left:n[0].clientX-e[0].clientX,top:n[0].clientY-e[0].clientY});else if(e.length>1){var u=K2(n,t),o=K2(e,t);if(i.rotate&&n.length===2&&e.length===2){var f={left:[e[0].clientX-e[1].clientX,n[0].clientX-n[1].clientX],top:[e[0].clientY-e[1].clientY,n[0].clientY-n[1].clientY]},d=f.left[0]*f.top[1]-f.left[1]*f.top[0],c=f.left[0]*f.left[1]+f.top[0]*f.top[1];if(!Dt(c,0)&&!Dt(d,0)){var l=Math.atan2(d,c),h=-(l*180)/Math.PI;s={center:o.centerMass,angle:h}}}i.move&&(r={left:u.centerMass.left-o.centerMass.left,top:u.centerMass.top-o.centerMass.top}),i.scale&&(a={factor:o.spread/u.spread,center:o.centerMass})}return{move:r,scale:a,rotate:s}}function UY(e,n,t){t===void 0&&(t=.1);var i=n.getBoundingClientRect(),r=i.left,a=i.top,s=1-t*pY(e.deltaY||e.detail||e.wheelDelta),u={left:e.clientX-r,top:e.clientY-a};return{scale:{factor:s,center:u}}}function Ts(e){return e.moveCoordinates||e.resizeCoordinates||e.transformImage.move||e.transformImage.rotate||e.transformImage.flip||e.transformImage.scale}function VY(){return{moveCoordinates:!1,resizeCoordinates:!1,transformImage:{rotate:!1,move:!1,scale:!1,flip:!1}}}function JY(e,n){var t=Lt(e),i={};return n.imageRestriction&&n.imageRestriction!=="none"&&(i={left:0,top:0,right:t.width,bottom:t.height}),i}function qY(e,n){var t=e.coordinates,i=e.boundary,r=Lt(e),a=he(i);if(t){var s={height:Math.max(t.height,r.height),width:Math.max(t.width,r.width)},u={left:0,top:0,width:he(s)>a?s.width:s.height*a,height:he(s)>a?s.width/a:s.height};u=lu(u,tt(e,n)),u.left=t.left+t.width/2-u.width/2,u.top=t.top+t.height/2-u.height/2;var o=No(t,Mn(X({left:0,top:0},r))),f={};return!o.left&&!o.right&&u.width<=r.width&&(f.left=0,f.right=r.width),!o.top&&!o.bottom&&u.height<=r.height&&(f.top=0,f.bottom=r.height),Qe(u,f)}else{var d=he(r),c={height:d<a?r.height:r.width/a,width:d<a?r.height*a:r.width};return{left:r.width/2-c.width/2,top:r.height/2-c.height/2,width:c.width,height:c.height}}}function _Y(e,n){var t=e.imageSize,i=e.visibleArea,r=it(e,n),a=gi(e,n),s;if(i)s=i;else{var u=zp(En(e,n));s={width:Math.max(u.minWidth,Math.min(u.maxWidth,t.width)),height:Math.max(u.minHeight,Math.min(u.maxHeight,t.height))}}var o=Math.min(a.maximum||1/0,Math.max(a.minimum||0,he(s))),f=s.width<s.height?{width:s.width*.8,height:s.width*.8/o}:{height:s.height*.8,width:s.height*.8*o};return et(X(X({},f),{aspectRatio:a,sizeRestrictions:r}))}function $Y(e){return{minWidth:qn(e.minWidth)?ri(e.minWidth):0,minHeight:qn(e.minHeight)?ri(e.minHeight):0,maxWidth:qn(e.maxWidth)?ri(e.maxWidth):1/0,maxHeight:qn(e.maxHeight)?ri(e.maxHeight):1/0}}function Fp(e,n){return $Y(n)}function eQ(e){var n=e.visibleArea,t=e.coordinates,i=n||Lt(e);return{left:(n?n.left:0)+i.width/2-(t?t.width/2:0),top:(n?n.top:0)+i.height/2-(t?t.height/2:0)}}function nQ(e,n){var t=e.visibleArea,i=e.boundary,r=n.imageRestriction,a=Lt(e),s={};return r===Qi.fillArea?s={left:0,top:0,right:a.width,bottom:a.height}:r===Qi.fitArea&&(he(i)>he(a)?(s={top:0,bottom:a.height},t&&(t.width>a.width?(s.left=-(t.width-a.width)/2,s.right=a.width-s.left):(s.left=0,s.right=a.width))):(s={left:0,right:a.width},t&&(t.height>a.height?(s.top=-(t.height-a.height)/2,s.bottom=a.height-s.top):(s.top=0,s.bottom=a.height)))),s}function tQ(e,n){var t=e.boundary,i=n.imageRestriction,r=Lt(e),a={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0};return i===Qi.fillArea?(a.maxWidth=r.width,a.maxHeight=r.height):i===Qi.fitArea&&(he(t)>he(r)?(a.maxHeight=r.height,a.maxWidth=r.height*he(t)):(a.maxWidth=r.width,a.maxHeight=r.width/he(t))),a}function iQ(e){var n=e.getBoundingClientRect(),t=n.width,i=n.height;return{width:t,height:i}}function Sp(e,n){return e.aspectRatio?{}:{aspectRatio:$i(ke(n.aspectRatio)?n.aspectRatio():n.aspectRatio)}}function rQ(e){return function(n,t){var i=ke(e)?e(n,t):e;return wc(Fp(n,t),i)}}function aQ(e){return X(X({},e),{sizeRestrictions:function(n,t){var i;return e.sizeRestrictions?i=ke(e.sizeRestrictions)?e.sizeRestrictions(n,t):e.sizeRestrictions:i=Fp(n,t),i},areaPositionRestrictions:function(n,t){return e.areaPositionRestrictions?ke(e.areaPositionRestrictions)?e.areaPositionRestrictions(n,t):e.areaPositionRestrictions:nQ(n,t)},areaSizeRestrictions:function(n,t){return e.areaSizeRestrictions?ke(e.areaSizeRestrictions)?e.areaSizeRestrictions(n,t):e.areaSizeRestrictions:tQ(n,t)},positionRestrictions:function(n,t){return e.positionRestrictions?ke(e.positionRestrictions)?e.positionRestrictions(n,t):e.positionRestrictions:JY(n,t)},defaultCoordinates:function(n,t){if(e.defaultCoordinates)return ke(e.defaultCoordinates)?e.defaultCoordinates(n,t):e.defaultCoordinates;var i=e.defaultSize;i||(i=_Y);var r=ke(i)?i(n,t):i,a=e.defaultPosition||eQ;return[r,function(s){return X({},ke(a)?a(s,t):a)}]},defaultVisibleArea:function(n,t){return e.defaultVisibleArea?ke(e.defaultVisibleArea)?e.defaultVisibleArea(n,t):e.defaultVisibleArea:qY(n,t)},aspectRatio:function(n,t){return $i(ke(e.aspectRatio)?e.aspectRatio(n,t):e.aspectRatio)}})}function ao(e,n){if(e&&n){var t=n();t&&e(t)}}function Af(e,n){e.forEach(function(t){ao(t,n)})}var sQ=function(){function e(){var n=this;this.getTransitions=function(){var t=n.getData(),i=n.getProps().transitions;return X(X({},os(i,{timingFunction:"ease-in-out",duration:350})),{active:t.transitions})},this.getInteractions=function(){var t=n.getData().interactions;return Ga(t)},this.hasInteractions=function(){var t=n.getData().interactions;return Ts(t)},this.startTransitions=function(){var t=n.getProps(),i=t.onTransitionsStart,r=t.onUpdate,a=t.getInstance,s=n.getData(),u=s.transitions,o=Dr(s,["transitions"]);n.setData(X(X({},o),{transitions:!0})),u||Af([i,r],a),n.endTransitions()},this.endTransitions=xp(function(){var t=n.getProps(),i=t.onTransitionsEnd,r=t.onUpdate,a=t.getInstance;n.setData(X(X({},n.getData()),{transitions:!1})),Af([i,r],a)},function(){return n.getTransitions().duration}),this.applyPostProcess=function(t,i){var r=n.getProps(),a=r.settings,s=r.postProcess,u=t.name,o=t.interaction,f=o===void 0?!1:o,d=t.transitions,c=d===void 0?!1:d,l=t.immediately,h=l===void 0?!1:l,m={name:u,interaction:f,transitions:c,immediately:h};return mY(s)?s.reduce(function(b,k){return k(b,a,m)},i):ke(s)?s(i,a,m):i},this.updateState=function(t,i,r){i===void 0&&(i={}),r===void 0&&(r=[]);var a=i.transitions,s=a===void 0?!1:a,u=n.getProps(),o=u.onTransitionsStart,f=u.getInstance,d=u.onChange,c=u.onUpdate,l=u.settings,h=n.getData(),m=ke(t)?t(h.state,l):t,b=m?.001*er(m):.001,k=!kr(h.state,m,b),A=["coordinates","boundary","visibleArea","imageSize","transforms"].some(function(x){var B;return!kr((B=h.state)===null||B===void 0?void 0:B[x],m==null?void 0:m[x],b)}),y=h;k&&(s&&A&&n.endTransitions(),y=X(X({},y),{state:ln(m),transitions:s&&A}),n.setData(y),ao(d,f)),y.transitions&&!h.transitions&&ao(o,f),Af(cY(r,[c]),f)},this.setInteractions=function(t){var i=n.getProps(),r=i.onInteractionStart,a=i.onInteractionEnd,s=i.getInstance,u=n.getInteractions(),o=X(X({},u),t);if(kr(u,o)||n.setData(X(X({},n.getData()),{interactions:o})),Ts(u)!==Ts(o))if(!Ts(u))ao(r,s);else{var f=n.getData().state;n.updateState(function(){return f&&n.applyPostProcess({name:"interactionEnd",immediately:!0,transitions:!0},f)},{transitions:!0},[a])}},this.resetState=function(t,i){n.updateState(n.createDefaultState(t,i))},this.clear=function(){n.updateState(null)},this.reconcileState=function(t){t===void 0&&(t={});var i=n.getProps(),r=i.reconcileStateAlgorithm,a=i.settings,s=n.getData().state,u=t.transitions,o=u===void 0?!1:u;if(s&&!W2(s,a)){var f=(r||ZY)(s,a);f=n.applyPostProcess({name:"reconcileState",immediately:!0,transitions:o},f),n.updateState(f,{transitions:o})}},this.transformImage=function(t,i){i===void 0&&(i={});var r=i.transitions,a=r===void 0?!0:r,s=i.interaction,u=s===void 0?!0:s,o=i.immediately,f=o===void 0?!1:o,d=i.normalize,c=d===void 0?!0:d,l=n.getProps(),h=l.transformImageAlgorithm,m=l.onTransformImage,b=l.onTransformImageEnd,k=l.settings,A=n.getData().state,y=[];if(A){c&&(t=XY(A,t));var x=n.applyPostProcess({name:"transformImage",transitions:a,immediately:f},(h||NY)(A,k,t));y.push(m),u?n.setInteractions({transformImage:{rotate:!Ke(t.rotate),flip:!Ke(t.flip),scale:!Ke(t.scale),move:!Ke(t.move)}}):(x=n.applyPostProcess({name:"transformImageEnd",transitions:a,immediately:!0},x),y.push(b)),n.updateState(x,{transitions:f&&a},y)}},this.transformImageEnd=function(t){t===void 0&&(t={});var i=t.immediately,r=i===void 0?!0:i,a=t.transitions,s=a===void 0?!0:a,u=n.getData().state,o=n.getProps().onTransformImageEnd;n.updateState(function(){return u&&n.applyPostProcess({name:"transformImageEnd",immediately:r,transitions:s},u)},{transitions:s},[o]),n.setInteractions({transformImage:{rotate:!1,flip:!1,scale:!1,move:!1}})},this.zoomImage=function(t,i){i===void 0&&(i={});var r=i.interaction,a=r===void 0?!1:r,s=i.immediately,u=s===void 0?!0:s,o=i.transitions,f=o===void 0?!0:o,d=i.normalize,c=d===void 0?!1:d;n.transformImage({scale:t},{interaction:a,immediately:u,transitions:f,normalize:c})},this.moveImage=function(t,i,r){r===void 0&&(r={});var a=r.interaction,s=a===void 0?!1:a,u=r.immediately,o=u===void 0?!0:u,f=r.transitions,d=f===void 0?!0:f,c=r.normalize,l=c===void 0?!1:c;n.transformImage({move:{left:t,top:i}},{interaction:s,immediately:o,transitions:d,normalize:l})},this.flipImage=function(t,i,r){r===void 0&&(r={});var a=r.interaction,s=a===void 0?!1:a,u=r.immediately,o=u===void 0?!0:u,f=r.transitions,d=f===void 0?!0:f,c=r.normalize,l=c===void 0?!0:c,h=n.getState(),m={horizontal:t,vertical:i};n.transformImage({flip:h&&l?WY(h,m):m},{interaction:s,immediately:o,transitions:d})},this.rotateImage=function(t,i){i===void 0&&(i={});var r=i.interaction,a=r===void 0?!1:r,s=i.immediately,u=s===void 0?!0:s,o=i.transitions,f=o===void 0?!0:o,d=i.normalize,c=d===void 0?!1:d;n.transformImage({rotate:t},{interaction:a,immediately:u,transitions:f,normalize:c})},this.reset=function(t,i){n.resetState(t,i)},this.setState=function(t,i){i===void 0&&(i={});var r=n.getSettings(),a=n.getData().state,s=i.transitions,u=s===void 0?!0:s,o=i.immediately,f=o===void 0?!1:o,d=i.interaction,c=d===void 0?!1:d,l=i.postprocess,h=l===void 0?!1:l,m=t&&(ke(t)?t(a,r):X(X({},a),t));n.updateState(function(){return h?m&&n.applyPostProcess({name:"setState",immediately:f,transitions:u,interaction:c},m):m},{transitions:u})},this.setCoordinates=function(t,i){i===void 0&&(i={});var r=n.getData().state,a=n.getProps(),s=a.setCoordinatesAlgorithm,u=a.settings,o=i.transitions,f=o===void 0?!0:o,d=i.immediately,c=d===void 0?!0:d;n.updateState(function(){return r&&n.applyPostProcess({name:"setCoordinates",immediately:c,transitions:f},(s||Jd)(r,u,t,mt.zoom))},{transitions:f})},this.setVisibleArea=function(t,i){i===void 0&&(i={});var r=i.transitions,a=r===void 0?!0:r,s=i.immediately,u=s===void 0?!0:s,o=n.getData().state,f=n.getProps(),d=f.setVisibleAreaAlgorithm,c=f.settings;n.updateState(function(){return o&&n.applyPostProcess({name:"setVisibleArea",immediately:u,transitions:a},(d||qd)(o,c,t))},{transitions:a})},this.setBoundary=function(t,i){i===void 0&&(i={});var r=n.getData().state,a=n.getProps(),s=a.setBoundaryAlgorithm,u=a.settings,o=i.transitions,f=o===void 0?!1:o,d=i.immediately,c=d===void 0?!0:d;t?n.updateState(function(){return r&&n.applyPostProcess({name:"setBoundary",immediately:c,transitions:f},(s||DY)(r,u,t))}):n.updateState(null)},this.moveCoordinates=function(t,i){i===void 0&&(i={});var r=n.getData(),a=n.getProps(),s=a.moveCoordinatesAlgorithm,u=a.onMove,o=a.onMoveEnd,f=a.settings,d=i.interaction,c=d===void 0?!0:d,l=i.transitions,h=l===void 0?!1:l,m=i.immediately,b=m===void 0?!1:m,k=i.normalize,A=k===void 0?!0:k,y=[];if(!r.transitions&&r.state){var x=A?Ep(r.state,t):YY(t),B=n.applyPostProcess({name:"moveCoordinates",interaction:c,immediately:b,transitions:h},(s||FY)(r.state,f,x));y.push(u),c?n.setInteractions({moveCoordinates:!0}):(B=n.applyPostProcess({name:"moveCoordinatesEnd",interaction:c,immediately:b,transitions:h},B),y.push(o)),n.updateState(B,{transitions:b&&h},y)}},this.moveCoordinatesEnd=function(t){t===void 0&&(t={});var i=n.getData().state,r=n.getProps().onMoveEnd,a=t.transitions,s=a===void 0?!0:a,u=t.immediately,o=u===void 0?!1:u;n.updateState(function(){return i&&n.applyPostProcess({name:"moveCoordinatesEnd",transitions:s,immediately:o},i)},{transitions:s},[r]),n.setInteractions({moveCoordinates:!1})},this.resizeCoordinates=function(t,i,r,a){a===void 0&&(a={});var s=n.getData().state,u=n.getProps(),o=u.resizeCoordinatesAlgorithm,f=u.onResize,d=u.onResizeEnd,c=u.settings,l=a.interaction,h=l===void 0?!0:l,m=a.transitions,b=m===void 0?!1:m,k=a.immediately,A=k===void 0?!1:k,y=a.normalize,x=y===void 0?!0:y,B=n.getTransitions();if(!B.active&&s){var z=[],R=x?GY(s,i):QY(i),E=n.applyPostProcess({name:"resizeCoordinates",interaction:h,immediately:A,transitions:b},(o||TY)(s,c,t,R,Di(r)?r:{}));z.push(f),h?n.setInteractions({resizeCoordinates:!0}):(E=n.applyPostProcess({name:"resizeCoordinatesEnd",interaction:h,immediately:A,transitions:b},E),z.push(d)),n.updateState(E,{transitions:A&&b},z)}},this.resizeCoordinatesEnd=function(t){t===void 0&&(t={});var i=n.getProps().onResizeEnd,r=n.getData().state,a=t.transitions,s=a===void 0?!0:a,u=t.immediately,o=u===void 0?!1:u;n.updateState(function(){return r&&n.applyPostProcess({name:"resizeCoordinatesEnd",transitions:s,immediately:o},r)},{transitions:s},[i]),n.setInteractions({resizeCoordinates:!1})},this.getStencilCoordinates=function(){var t=n.getData().state;return vc(t)},this.getCoordinates=function(t){t===void 0&&(t={});var i=n.getData().state,r=n.getProps().settings;if(i&&i.coordinates){var a=t.round,s=a===void 0?!0:a;return s?BY(i,r):X({},i.coordinates)}else return null},this.getVisibleArea=function(){var t=n.getData().state;return t!=null&&t.visibleArea?X({},t.visibleArea):null},this.getSettings=function(){var t=n.getProps().settings;return X({},t)},this.getState=function(){var t=n.getData().state;return ln(t)},this.getTransforms=function(){var t=n.getData().state;return t?Ga(t.transforms):{rotate:0,flip:{horizontal:!1,vertical:!1}}},this.createDefaultState=function(t,i){var r=n.getProps(),a=r.createStateAlgorithm,s=r.settings;return n.applyPostProcess({name:"createState",immediately:!0,transitions:!1},(a||EY)({image:i,boundary:t},s))},this.isConsistent=function(){var t=n.getData().state,i=n.getProps().settings;return t?W2(t,i):!0}}return e}(),U2={linear:function(e){return e},"ease-in":function(e){return Math.pow(e,1.675)},"ease-out":function(e){return 1-Math.pow(1-e,1.675)},"ease-in-out":function(e){return .5*(Math.sin((e-.5)*Math.PI)+1)}},oQ=function(){function e(){this.active=!1}return e.prototype.start=function(n){var t;this.onStart=n.onStart,this.onProgress=n.onProgress,this.onStop=n.onStop,this.active||(t=this.onStart)===null||t===void 0||t.call(this),this.id&&window.cancelAnimationFrame(this.id),this.startTime=performance.now(),this.timingFunction=n.timingFunction,this.endTime=this.startTime+n.duration,this.active=!0,this.animate()},e.prototype.animate=function(){var n=this;if(this.startTime&&this.endTime){var t=U2[this.timingFunction];t||(process.env.NODE_ENV!=="production"&&console.warn("[Animation] The timing function '"+t+"' is not supported. Available timing function: 'linear', 'ease-in', 'ease-in-out', 'ease-out'. Reset to 'ease-out'."),t=U2["ease-out"]);var i=1-(this.endTime-performance.now())/(this.endTime-this.startTime),r=Math.min(1,t(i));this.onProgress&&this.onProgress(r),i<1?this.id=window.requestAnimationFrame(function(){return n.animate()}):this.stop()}else this.stop()},e.prototype.stop=function(){this.active=!1,this.id&&window.cancelAnimationFrame(this.id),this.onStop&&this.onStop()},e}();function uQ(e,n,t){var i=t.rotate,r=t.flip,a={width:"naturalWidth"in n?n.naturalWidth:n.width,height:"naturalHeight"in n?n.naturalHeight:n.height},s=Cp(a,i),u=e.getContext("2d");if(e.height=s.height,e.width=s.width,u){u.save();var o=Tt(Ie(X({left:0,top:0},a)),i);u.translate(-(o.left-s.width/2),-(o.top-s.height/2)),u.rotate(i*Math.PI/180),u.translate(r.horizontal?a.width:0,r.vertical?a.height:0),u.scale(r.horizontal?-1:1,r.vertical?-1:1),u.drawImage(n,0,0,a.width,a.height),u.restore()}return e}function fQ(e,n,t,i,r){e.width=i?i.width:t.width,e.height=i?i.height:t.height;var a=e.getContext("2d");if(a){a.clearRect(0,0,e.width,e.height),r&&(r.imageSmoothingEnabled&&(a.imageSmoothingEnabled=r.imageSmoothingEnabled),r.imageSmoothingQuality&&(a.imageSmoothingQuality=r.imageSmoothingQuality),r.fillColor&&(a.fillStyle=r.fillColor,a.fillRect(0,0,e.width,e.height),a.save()));var s=t.left<0?-t.left:0,u=t.top<0?-t.top:0;a.drawImage(n,t.left+s,t.top+u,t.width,t.height,s*(e.width/t.width),u*(e.height/t.height),e.width,e.height)}return e}function dQ(e,n,t,i,r){if(Gn(e)){var a=e.transforms,s=e.coordinates,u=a.rotate!==0||a.flip.horizontal||a.flip.vertical,o=u?uQ(i,n,a):n,f=X({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:1/0,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},r),d=function(h){return h.find(function(m){return qn(m)})},c=et({sizeRestrictions:{minWidth:d([f.width,f.minWidth])||0,minHeight:d([f.height,f.minHeight])||0,maxWidth:d([f.width,f.maxWidth])||1/0,maxHeight:d([f.height,f.maxHeight])||1/0},width:s.width,height:s.height,aspectRatio:{minimum:s.width/s.height,maximum:s.width/s.height}});if(f.maxArea&&c.width*c.height>f.maxArea){var l=Math.sqrt(f.maxArea/(c.width*c.height));c={width:Math.round(l*c.width),height:Math.round(l*c.height)}}return fQ(t,o,s,c,f)}else return null}function lQ(e,n,t){n.style.width="0px",n.style.height="0px",n.style.width=Math.max(e.clientWidth,t.width)+"px";var i=t.width/t.height;n.style.height=Math.max(e.clientHeight,n.clientWidth/i)+"px",n.style.width=n.clientHeight*i+"px"}function cQ(e,n,t){n.style.width="0px",n.style.height="0px",n.style.width=Math.max(e.getBoundingClientRect().width,t.width)+"px";var i=t.width/t.height;n.style.height=Math.max(e.getBoundingClientRect().height,n.getBoundingClientRect().width/i)+"px",n.style.width=n.getBoundingClientRect().height*i+"px",n.clientWidth/n.clientHeight>e.clientWidth/e.clientHeight?n.clientWidth>e.clientWidth&&(n.style.width=e.clientWidth+"px",n.style.height=e.clientWidth/i+"px"):n.clientHeight>e.clientHeight&&(n.style.height=e.clientHeight+"px",n.style.width=e.clientHeight*i+"px")}var hQ=4;function gQ(e){e=e.replace(/^data:([^;]+);base64,/gim,"");for(var n=atob(e),t=n.length,i=new ArrayBuffer(t),r=new Uint8Array(i),a=0;a<t;a++)r[a]=n.charCodeAt(a);return i}function mQ(e,n){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="blob",t.onload=function(){(this.status==200||this.status===0)&&n(this.response)},t.send()}function vQ(e){var n={flip:{horizontal:!1,vertical:!1},rotate:0};if(e)switch(e){case 2:n.flip.horizontal=!0;break;case 3:n.rotate=-180;break;case 4:n.flip.vertical=!0;break;case 5:n.rotate=90,n.flip.vertical=!0;break;case 6:n.rotate=90;break;case 7:n.rotate=90,n.flip.horizontal=!0;break;case 8:n.rotate=-90;break}return n}function pQ(e){return new Promise(function(n,t){try{if(e)if(/^data:/i.test(e))n(gQ(e));else if(/^blob:/i.test(e)){var i=new FileReader;i.onload=function(a){var s;n((s=a.target)===null||s===void 0?void 0:s.result)},mQ(e,function(a){i.readAsArrayBuffer(a)})}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState===hQ&&(r.status===200||r.status===0?n(r.response):t("Warning: could not load an image to parse its orientation"))},r.onprogress=function(){r.getResponseHeader("content-type")!=="image/jpeg"&&r.abort()},r.withCredentials=!1,r.open("GET",e,!0),r.responseType="arraybuffer",r.send(null)}else t("Error: the image is empty")}catch(a){t(a)}})}function wQ(e){var n=e.rotate,t=n===void 0?0:n,i=e.flip,r=i===void 0?{horizontal:!1,vertical:!1}:i,a=e.scale,s=a===void 0?1:a;return" rotate("+t+"deg) scaleX("+s*(r.horizontal?-1:1)+") scaleY("+s*(r.vertical?-1:1)+")"}function AQ(e,n,t){var i="",r;for(r=n,t+=n;r<t;r++)i+=String.fromCharCode(e.getUint8(r));return i}function bQ(e){try{var n=new DataView(e),t,i=void 0,r=void 0,a=void 0,s=void 0,u=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var o=n.byteLength,f=2;f+1<o;){if(n.getUint8(f)===255&&n.getUint8(f+1)===225){s=f;break}f++}if(s&&(i=s+4,r=s+10,AQ(n,i,4)==="Exif")){var d=n.getUint16(r);if(a=d===18761,(a||d===19789)&&n.getUint16(r+2,a)===42){var c=n.getUint32(r+4,a);c>=8&&(u=r+c)}}if(u)for(var l=n.getUint16(u,a),h=0;h<l;h++){var f=u+h*12+2;if(n.getUint16(f,a)===274){f+=8,t=n.getUint16(f,a),n.setUint16(f,1,a);break}}return t}catch{return null}}function kQ(e){for(var n=[],t=8192,i=new Uint8Array(e);i.length>0;){var r=i.subarray(0,t);n.push(String.fromCharCode.apply(null,Array.from?Array.from(r):r.slice())),i=i.subarray(t)}return"data:image/jpeg;base64,"+btoa(n.join(""))}function bf(e){var n=e.src,t=e.arrayBuffer,i=t===void 0?null:t,r=e.orientation,a=r===void 0?null:r,s={src:n,arrayBuffer:i,revoke:!1,transforms:{flip:{horizontal:!1,vertical:!1},rotate:0}};return i&&a&&a>1?wp(n)||!Ap(n)?(s.src=URL.createObjectURL(new Blob([i])),s.revoke=!0):s.src=kQ(i):s.src=n,a&&(s.transforms=vQ(a)),s}function yQ(e,n){n===void 0&&(n={});var t=n.checkOrientation,i=n.parse;return new Promise(function(r){t||i?pQ(e).then(function(a){var s=bQ(a);r(bf(a?{src:e,arrayBuffer:a,orientation:s}:{src:e,arrayBuffer:null,orientation:null}))}).catch(function(a){console.warn(a),r(bf({src:e}))}):r(bf({src:e}))})}function xQ(e,n){return n===void 0&&(n={}),new Promise(function(t,i){var r=document.createElement("img");n.crossOrigin&&(r.crossOrigin=n.crossOrigin!==!0?n.crossOrigin:"anonymous"),r.src=e,r.style.visibility="hidden",r.style.position="fixed",document.body.appendChild(r),r.complete?(t(r),document.body.removeChild(r)):(r.addEventListener("load",function(){t(r),document.body.removeChild(r)}),r.addEventListener("error",function(){i(null),document.body.removeChild(r)}))})}function CQ(e,n){return n===void 0&&(n={}),yQ(e,X(X({},n),{crossOrigin:gY(e)&&n.crossOrigin})).then(function(t){return new Promise(function(i,r){xQ(t.src,n).then(function(a){i(X(X({},t),{width:a.naturalWidth,height:a.naturalHeight}))}).catch(function(){r(null)})})})}function Rp(e,n,t,i,r){r===void 0&&(r=null);var a=e.width>e.height?{width:Math.min(512,e.width),height:Math.min(512,e.width)/(e.width/e.height)}:{height:Math.min(512,e.height),width:Math.min(512,e.height)*(e.width/e.height)},s=Lt(n),u={rotate:n.transforms.rotate,flip:{horizontal:n.transforms.flip.horizontal,vertical:n.transforms.flip.vertical},translateX:t.left/i,translateY:t.top/i,scale:1/i},o={rotate:{left:(a.width-s.width)/(2*i),top:(a.height-s.height)/(2*i)},scale:{left:(1-1/i)*a.width/2,top:(1-1/i)*a.height/2}},f=X(X({},u),{scale:u.scale*(e.width/a.width)}),d={width:a.width+"px",height:a.height+"px",left:"0px",top:"0px",transition:"none",transform:"translate3d("+(-o.rotate.left-o.scale.left-u.translateX)+"px, "+(-o.rotate.top-o.scale.top-u.translateY)+"px, 0px)"+wQ(f),willChange:"none"};return r&&r.active&&(d.willChange="transform",d.transition=r.duration+"ms "+r.timingFunction),d}function zQ(e,n,t){return t===void 0&&(t=null),e&&n&&n.visibleArea?Rp(e,n,n.visibleArea,er(n),t):{}}function PQ(e,n,t,i){return i===void 0&&(i=null),e&&n&&n.visibleArea&&n.coordinates?Rp(e,n,n.coordinates,he(n.coordinates)>he(t)?n.coordinates.width/t.width:n.coordinates.height/t.height,i):{}}var jp={exports:{}};/*!
|
|
845
845
|
Copyright (c) 2018 Jed Watson.
|
|
846
846
|
Licensed under the MIT License (MIT), see
|
|
847
847
|
http://jedwatson.github.io/classnames
|