/*! For license information please see richdocuments-public.js.LICENSE.txt */ (()=>{"use strict";var e={70580:e=>{var t=/["'&<>]/;e.exports=function(e){var n,o=""+e,i=t.exec(o);if(!i)return o;var r="",a=0,l=0;for(a=i.index;a2?n-2:0),i=2;i1?t-1:0),o=1;o1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:y;i&&i(e,null);let o=t.length;for(;o--;){let i=t[o];if("string"==typeof i){const e=n(i);e!==i&&(r(t)||(t[o]=e),i=e)}e[i]=!0}return e}function O(e){for(let t=0;t/gm),$=s(/\$\{[\w\W]*/gm),q=s(/^data-[\-\w.\u00B7-\uFFFF]+$/),X=s(/^aria-[\-\w]+$/),V=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=s(/^(?:\w+script|data):/i),Z=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=s(/^html$/i),Q=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var ee=Object.freeze({__proto__:null,ARIA_ATTR:X,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:Q,DATA_ATTR:q,DOCTYPE_NAME:J,ERB_EXPR:j,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:K,MUSTACHE_EXPR:Y,TMPLIT_EXPR:$});const te=1,ne=3,oe=7,ie=8,re=9,ae=function(){return"undefined"==typeof window?null:window};(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae();const n=t=>e(t);if(n.version="3.3.0",n.removed=[],!t||!t.document||t.document.nodeType!==re||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,a=r.currentScript,{DocumentFragment:l,HTMLTemplateElement:s,Node:p,Element:m,NodeFilter:C,NamedNodeMap:R=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:O,DOMParser:Y,trustedTypes:j}=t,$=m.prototype,q=x($,"cloneNode"),X=x($,"remove"),K=x($,"nextSibling"),Z=x($,"childNodes"),Q=x($,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:pe,getElementsByTagName:me}=i,{importNode:fe}=r;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof o&&"function"==typeof Q&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:_e,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:Ae}=ee;let{IS_ALLOWED_URI:Se}=ee,Ne=null;const we=D({},[...L,...I,...M,...U,...F]);let ve=null;const Ce=D({},[...H,...B,...W,...G]);let Re=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,Oe=null;const ke=Object.seal(u(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xe=!0,Le=!0,Ie=!1,Me=!0,Pe=!1,Ue=!0,ze=!1,Fe=!1,He=!1,Be=!1,We=!1,Ge=!1,Ye=!0,je=!1,$e=!0,qe=!1,Xe={},Ve=null;const Ke=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ze=null;const Je=D({},["audio","video","img","source","image","track"]);let Qe=null;const et=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let it=ot,rt=!1,at=null;const lt=D({},[tt,nt,ot],_);let ct=D({},["mi","mo","mn","ms","mtext"]),st=D({},["annotation-xml"]);const ut=D({},["title","style","font","a","script"]);let pt=null;const mt=["application/xhtml+xml","text/html"];let ft=null,dt=null;const ht=i.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=k(e),pt=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ft="application/xhtml+xml"===pt?_:y,Ne=N(e,"ALLOWED_TAGS")?D({},e.ALLOWED_TAGS,ft):we,ve=N(e,"ALLOWED_ATTR")?D({},e.ALLOWED_ATTR,ft):Ce,at=N(e,"ALLOWED_NAMESPACES")?D({},e.ALLOWED_NAMESPACES,_):lt,Qe=N(e,"ADD_URI_SAFE_ATTR")?D(k(et),e.ADD_URI_SAFE_ATTR,ft):et,Ze=N(e,"ADD_DATA_URI_TAGS")?D(k(Je),e.ADD_DATA_URI_TAGS,ft):Je,Ve=N(e,"FORBID_CONTENTS")?D({},e.FORBID_CONTENTS,ft):Ke,De=N(e,"FORBID_TAGS")?D({},e.FORBID_TAGS,ft):k({}),Oe=N(e,"FORBID_ATTR")?D({},e.FORBID_ATTR,ft):k({}),Xe=!!N(e,"USE_PROFILES")&&e.USE_PROFILES,xe=!1!==e.ALLOW_ARIA_ATTR,Le=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Pe=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,We=e.RETURN_DOM_FRAGMENT||!1,Ge=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,$e=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||V,it=e.NAMESPACE||ot,ct=e.MATHML_TEXT_INTEGRATION_POINTS||ct,st=e.HTML_INTEGRATION_POINTS||st,Re=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Re.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Re.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Re.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(Le=!1),We&&(Be=!0),Xe&&(Ne=D({},F),ve=[],!0===Xe.html&&(D(Ne,L),D(ve,H)),!0===Xe.svg&&(D(Ne,I),D(ve,B),D(ve,G)),!0===Xe.svgFilters&&(D(Ne,M),D(ve,B),D(ve,G)),!0===Xe.mathMl&&(D(Ne,U),D(ve,W),D(ve,G))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?ke.tagCheck=e.ADD_TAGS:(Ne===we&&(Ne=k(Ne)),D(Ne,e.ADD_TAGS,ft))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?ke.attributeCheck=e.ADD_ATTR:(ve===Ce&&(ve=k(ve)),D(ve,e.ADD_ATTR,ft))),e.ADD_URI_SAFE_ATTR&&D(Qe,e.ADD_URI_SAFE_ATTR,ft),e.FORBID_CONTENTS&&(Ve===Ke&&(Ve=k(Ve)),D(Ve,e.FORBID_CONTENTS,ft)),$e&&(Ne["#text"]=!0),ze&&D(Ne,["html","head","body"]),Ne.table&&(D(Ne,["tbody"]),delete De.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw v('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(j,a)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));c&&c(e),dt=e}},yt=D({},[...I,...M,...P]),_t=D({},[...U,...z]),bt=function(e){g(n.removed,{element:e});try{Q(e).removeChild(e)}catch(t){X(e)}},Et=function(e,t){try{g(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Be||We)try{bt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},At=function(e){let t=null,n=null;if(He)e=""+e;else{const t=b(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===pt&&it===ot&&(e=''+e+"");const o=le?le.createHTML(e):e;if(it===ot)try{t=(new Y).parseFromString(o,pt)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(it,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),it===ot?me.call(t,ze?"html":"body")[0]:ze?t.documentElement:r},St=function(e){return ue.call(e.ownerDocument||e,e,C.SHOW_ELEMENT|C.SHOW_COMMENT|C.SHOW_TEXT|C.SHOW_PROCESSING_INSTRUCTION|C.SHOW_CDATA_SECTION,null)},Nt=function(e){return e instanceof O&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof R)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},wt=function(e){return"function"==typeof p&&e instanceof p};function vt(e,t,o){f(e,(e=>{e.call(n,t,o,dt)}))}const Ct=function(e){let t=null;if(vt(de.beforeSanitizeElements,e,null),Nt(e))return bt(e),!0;const o=ft(e.nodeName);if(vt(de.uponSanitizeElement,e,{tagName:o,allowedTags:Ne}),Ue&&e.hasChildNodes()&&!wt(e.firstElementChild)&&w(/<[/\w!]/g,e.innerHTML)&&w(/<[/\w!]/g,e.textContent))return bt(e),!0;if(e.nodeType===oe)return bt(e),!0;if(Ue&&e.nodeType===ie&&w(/<[/\w]/g,e.data))return bt(e),!0;if(!(ke.tagCheck instanceof Function&&ke.tagCheck(o))&&(!Ne[o]||De[o])){if(!De[o]&&Dt(o)){if(Re.tagNameCheck instanceof RegExp&&w(Re.tagNameCheck,o))return!1;if(Re.tagNameCheck instanceof Function&&Re.tagNameCheck(o))return!1}if($e&&!Ve[o]){const t=Q(e)||e.parentNode,n=Z(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const i=q(n[o],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,K(e))}}}return bt(e),!0}return e instanceof m&&!function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});const n=y(e.tagName),o=y(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===ot?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===o||ct[o]):Boolean(yt[n]):e.namespaceURI===tt?t.namespaceURI===ot?"math"===n:t.namespaceURI===nt?"math"===n&&st[o]:Boolean(_t[n]):e.namespaceURI===ot?!(t.namespaceURI===nt&&!st[o])&&!(t.namespaceURI===tt&&!ct[o])&&!_t[n]&&(ut[n]||!yt[n]):!("application/xhtml+xml"!==pt||!at[e.namespaceURI]))}(e)?(bt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!w(/<\/no(script|embed|frames)/i,e.innerHTML)?(Pe&&e.nodeType===ne&&(t=e.textContent,f([he,ge,Te],(e=>{t=E(t,e," ")})),e.textContent!==t&&(g(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt(de.afterSanitizeElements,e,null),!1):(bt(e),!0)},Rt=function(e,t,n){if(Ye&&("id"===t||"name"===t)&&(n in i||n in ht))return!1;if(Le&&!Oe[t]&&w(ye,t));else if(xe&&w(_e,t));else if(ke.attributeCheck instanceof Function&&ke.attributeCheck(t,e));else if(!ve[t]||Oe[t]){if(!(Dt(e)&&(Re.tagNameCheck instanceof RegExp&&w(Re.tagNameCheck,e)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(e))&&(Re.attributeNameCheck instanceof RegExp&&w(Re.attributeNameCheck,t)||Re.attributeNameCheck instanceof Function&&Re.attributeNameCheck(t,e))||"is"===t&&Re.allowCustomizedBuiltInElements&&(Re.tagNameCheck instanceof RegExp&&w(Re.tagNameCheck,n)||Re.tagNameCheck instanceof Function&&Re.tagNameCheck(n))))return!1}else if(Qe[t]);else if(w(Se,E(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!Ze[e]){if(Ie&&!w(be,E(n,Ee,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&b(e,Ae)},Ot=function(e){vt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Nt(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve,forceKeepAttr:void 0};let i=t.length;for(;i--;){const r=t[i],{name:a,namespaceURI:l,value:c}=r,s=ft(a),u=c;let p="value"===a?u:S(u);if(o.attrName=s,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,vt(de.uponSanitizeAttribute,e,o),p=o.attrValue,!je||"id"!==s&&"name"!==s||(Et(a,e),p="user-content-"+p),Ue&&w(/((--!?|])>)|<\/(style|title|textarea)/i,p)){Et(a,e);continue}if("attributename"===s&&b(p,"href")){Et(a,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){Et(a,e);continue}if(!Me&&w(/\/>/i,p)){Et(a,e);continue}Pe&&f([he,ge,Te],(e=>{p=E(p,e," ")}));const m=ft(e.nodeName);if(Rt(m,s,p)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(m,s)){case"TrustedHTML":p=le.createHTML(p);break;case"TrustedScriptURL":p=le.createScriptURL(p)}if(p!==u)try{l?e.setAttributeNS(l,a,p):e.setAttribute(a,p),Nt(e)?bt(e):h(n.removed)}catch(t){Et(a,e)}}else Et(a,e)}vt(de.afterSanitizeAttributes,e,null)},kt=function e(t){let n=null;const o=St(t);for(vt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)vt(de.uponSanitizeShadowNode,n,null),Ct(n),Ot(n),n.content instanceof l&&e(n.content);vt(de.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,a=null,c=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!wt(e)){if("function"!=typeof e.toString)throw v("toString is not a function");if("string"!=typeof(e=e.toString()))throw v("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Fe||Tt(t),n.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=ft(e.nodeName);if(!Ne[t]||De[t])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof p)o=At("\x3c!----\x3e"),i=o.ownerDocument.importNode(e,!0),i.nodeType===te&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Be&&!Pe&&!ze&&-1===e.indexOf("<"))return le&&Ge?le.createHTML(e):e;if(o=At(e),!o)return Be?null:Ge?ce:""}o&&He&&bt(o.firstChild);const s=St(qe?e:o);for(;a=s.nextNode();)Ct(a),Ot(a),a.content instanceof l&&kt(a.content);if(qe)return e;if(Be){if(We)for(c=pe.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(ve.shadowroot||ve.shadowrootmode)&&(c=fe.call(r,c,!0)),c}let u=ze?o.outerHTML:o.innerHTML;return ze&&Ne["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&w(J,o.ownerDocument.doctype.name)&&(u="\n"+u),Pe&&f([he,ge,Te],(e=>{u=E(u,e," ")})),le&&Ge?le.createHTML(u):u},n.setConfig=function(){Tt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},n.clearConfig=function(){dt=null,Fe=!1},n.isValidAttribute=function(e,t,n){dt||Tt({});const o=ft(e),i=ft(t);return Rt(o,i,n)},n.addHook=function(e,t){"function"==typeof t&&g(de[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=d(de[e],t);return-1===n?void 0:T(de[e],n,1)[0]}return h(de[e])},n.removeHooks=function(e){de[e]=[]},n.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n})(),function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}(70580);globalThis._nc_l10n_locale??="undefined"!=typeof document&&document.documentElement.dataset.locale||Intl.DateTimeFormat().resolvedOptions().locale.replaceAll(/-/g,"_"),globalThis._nc_l10n_language??="undefined"!=typeof document&&document.documentElement.lang||(globalThis.navigator?.language??"en"),globalThis._oc_l10n_registry_translations??={},globalThis._oc_l10n_registry_plural_functions??={};var le=function(){try{return n("core","capabilities")}catch(e){return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}}(),ce=new(function(){function e(){this.capabilities=le.richdocuments}return e.prototype.getCapabilities=function(){return this.capabilities},e.prototype.setCapabilities=function(e){this.capabilities=e},e.prototype.updateCapability=function(e,t){this.capabilities[e]=t},e}()),se=function(){return ce.getCapabilities()};const ue=se().mimetypes;const pe=function(){const e=document.getElementById("mimetype");return Boolean(e)&&ue.includes(e.value)};const me=function(){const e=document.getElementById("mimetype");return Boolean(e)&&"application/pdf"===e.value};const fe=function(){const e=document.getElementById("hideDownload");return Boolean(e)&&"true"===e.value};document.addEventListener("DOMContentLoaded",(()=>{if(!(n("files_sharing","isPublic",null)??null!==document.querySelector('input#isPublic[type="hidden"][name="isPublic"][value="1"]'))||!OCA.Viewer)return;const e=se().mimetypesNoDefaultOpen.includes("application/pdf");!fe()&&e||!me()?pe()&&OCA.Viewer.open({path:"/"}):OCA.Viewer.openWith("richdocuments",{path:"/"})}))})(); //# sourceMappingURL=richdocuments-public.js.map?v=c817312dadd7aa1677da