nextcloud-server/dist/files_external-init.js

2 lines
47 KiB
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(()=>{var e,t,r,n={15340:()=>{},47790:()=>{},51069:()=>{},63779:()=>{},64688:()=>{},64755:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(71354),i=r.n(n),a=r(76314),s=r.n(a)()(i());s.push([e.id,"/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */.files-list__row-status{display:flex;min-width:44px;justify-content:center;align-items:center;height:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.files-list__row-status svg{width:24px;height:24px}.files-list__row-status svg path{fill:currentColor}.files-list__row-status--error,.files-list__row-status--warning{position:absolute;display:block;top:0;inset-inline:0;bottom:0;opacity:.1;z-index:-1}.files-list__row-status--error{background:var(--color-error)}.files-list__row-status--warning{background:var(--color-warning)}","",{version:3,sources:["webpack://./apps/files_external/src/css/fileEntryStatus.scss"],names:[],mappings:"AAAA;;;EAAA,CAIA,wBACC,YAAA,CACA,cAAA,CACA,sBAAA,CACA,kBAAA,CACA,WAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CAEA,4BACC,UAAA,CACA,WAAA,CAEA,iCACC,iBAAA,CAIF,gEAEC,iBAAA,CACA,aAAA,CACA,KAAA,CACA,cAAA,CACA,QAAA,CACA,UAAA,CACA,UAAA,CAGD,+BACC,6BAAA,CAGD,iCACC,+BAAA",sourcesContent:["/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n.files-list__row-status {\n\tdisplay: flex;\n\tmin-width: 44px;\n\tjustify-content: center;\n\talign-items: center;\n\theight: 100%;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\n\tsvg {\n\t\twidth: 24px;\n\t\theight: 24px;\n\n\t\tpath {\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n\n\t&--error,\n\t&--warning {\n\t\tposition: absolute;\n\t\tdisplay: block;\n\t\ttop: 0;\n\t\tinset-inline: 0;\n\t\tbottom: 0;\n\t\topacity: .1;\n\t\tz-index: -1;\n\t}\n\n\t&--error {\n\t\tbackground: var(--color-error);\n\t}\n\n\t&--warning {\n\t\tbackground: var(--color-warning);\n\t}\n}\n"],sourceRoot:""}]);const o=s},66089:()=>{},66265:(e,t,r)=>{"use strict";var n=r(92958),i=r(380),a=r(83141),s=(r(43627),r(53334)),o=r(65606),c=r(62045).hp,l=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(l||{});class u{_action;constructor(e){this.validateAction(e),this._action=e}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get hotkey(){return this._action.hotkey}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get destructive(){return this._action.destructive}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(l).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function");if("hotkey"in e&&void 0!==e.hotkey){if("object"!=typeof e.hotkey)throw new Error("Invalid hotkey configuration");if("string"!=typeof e.hotkey.key||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if("string"!=typeof e.hotkey.description||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}}}const E=function(e){void 0===window._nc_fileactions&&(window._nc_fileactions=[],n.l.debug("FileActions initialized")),window._nc_fileactions.find(t=>t.id===e.id)?n.l.error(`FileAction ${e.id} already registered`,{action:e}):window._nc_fileactions.push(e)};function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,f,h,m;function T(){if(f)return d;f=1;const e="object"==typeof o&&o.env&&o.env.NODE_DEBUG&&/\bsemver\b/i.test(o.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return d=e}function g(){if(m)return h;m=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return h={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}var A,I,N,w,_,v,C,b,O,y,R,L,S,D={exports:{}};function x(){if(C)return v;C=1;const e=T(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=g(),{safeRe:n,t:i}=(A||(A=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=g(),a=T(),s=(t=e.exports={}).re=[],o=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let E=0;const p="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[p,n]],f=(e,t,r)=>{const n=(e=>{for(const[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=E++;a(e,i,t),u[e]=i,c[i]=t,l[i]=n,s[i]=new RegExp(t,r?"g":void 0),o[i]=new RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),f("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${p}+`),f("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),f("FULL",`^${c[u.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),f("LOOSE",`^${c[u.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),f("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),f("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[u.COERCE],!0),f("COERCERTLFULL",c[u.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(D,D.exports)),D.exports),a=function(){if(N)return I;N=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return I=r=>r?"object"!=typeof r?e:r:t,I}(),{compareIdentifiers:s}=function(){if(_)return w;_=1;const e=/^[0-9]+$/,t=(t,r)=>{if("number"==typeof t&&"number"==typeof r)return t===r?0:t<r?-1:1;const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};return w={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}();class o{constructor(s,c){if(c=a(c),s instanceof o){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?n[i.LOOSE]:n[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof o)){if("string"==typeof t&&t===this.version)return 0;t=new o(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof o||(e=new o(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof o||(t=new o(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(e("prerelease compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}compareBuild(t){t instanceof o||(t=new o(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(e("build compare",r,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return s(n,i)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return v=o}!function(){if(O)return b;O=1;const e=x();b=(t,r)=>new e(t,r).major}(),function(){if(S)return L;S=1;const e=function(){if(R)return y;R=1;const e=x();return y=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}},y}();L=(t,r)=>{const n=e(t,r);return n?n.version:null}}(),i.m;class P extends i.m{_views=[];_currentView=null;register(e){if(this._views.find(t=>t.id===e.id))throw new Error(`View id ${e.id} is already registered`);this._views.push(e),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(e){const t=this._views.findIndex(t=>t.id===e);-1!==t&&(this._views.splice(t,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(e){this._currentView=e;const t=new CustomEvent("updateActive",{detail:e});this.dispatchTypedEvent("updateActive",t)}get active(){return this._currentView}get views(){return this._views}}class F{_column;constructor(e){U(e),this._column=e}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const U=function(e){if(!e.id||"string"!=typeof e.id)throw new Error("A column id is required");if(!e.title||"string"!=typeof e.title)throw new Error("A column title is required");if(!e.render||"function"!=typeof e.render)throw new Error("A render function is required");if(e.sort&&"function"!=typeof e.sort)throw new Error("Column sortFunction must be a function");if(e.summary&&"function"!=typeof e.summary)throw new Error("Column summary must be a function");return!0};var M,$={};const G=p((M||(M=1,function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=s,e.createStream=function(e,t){return new s(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(t,i){if(!(this instanceof n))return new n(t,i);var a=this;!function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=""}(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=i||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!(!t&&!a.opt.noscript),a.state=C.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(p)),void 0===a.opt.unquotedAttributeValues&&(a.opt.unquotedAttributeValues=!t),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),O(a,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}),n.prototype={end:function(){D(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return S(n,"Cannot write after close. Assign an onready handler.");if(null===t)return D(n);"object"==typeof t&&(t=t.toString());for(var i=0,a="";a=B(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case C.BEGIN:if(n.state=C.BEGIN_WHITESPACE,"\ufeff"===a)continue;V(n,a);continue;case C.BEGIN_WHITESPACE:V(n,a);continue;case C.TEXT:if(n.sawRoot&&!n.closedRoot){for(var s=i-1;a&&"<"!==a&&"&"!==a;)(a=B(t,i++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(s,i-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(T(a)||n.sawRoot&&!n.closedRoot||x(n,"Text data outside of root node."),"&"===a?n.state=C.TEXT_ENTITY:n.textNode+=a):(n.state=C.OPEN_WAKA,n.startTagPosition=n.position);continue;case C.SCRIPT:"<"===a?n.state=C.SCRIPT_ENDING:n.script+=a;continue;case C.SCRIPT_ENDING:"/"===a?n.state=C.CLOSE_TAG:(n.script+="<"+a,n.state=C.SCRIPT);continue;case C.OPEN_WAKA:if("!"===a)n.state=C.SGML_DECL,n.sgmlDecl="";else if(T(a));else if(I(d,a))n.state=C.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=C.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=C.PROC_INST,n.procInstName=n.procInstBody="";else{if(x(n,"Unencoded <"),n.startTagPosition+1<n.position){var c=n.position-n.startTagPosition;a=new Array(c).join(" ")+a}n.textNode+="<"+a,n.state=C.TEXT}continue;case C.SGML_DECL:if(n.sgmlDecl+a==="--"){n.state=C.COMMENT,n.comment="",n.sgmlDecl="";continue}n.doctype&&!0!==n.doctype&&n.sgmlDecl?(n.state=C.DOCTYPE_DTD,n.doctype+="<!"+n.sgmlDecl+a,n.sgmlDecl=""):(n.sgmlDecl+a).toUpperCase()===o?(y(n,"onopencdata"),n.state=C.CDATA,n.sgmlDecl="",n.cdata=""):(n.sgmlDecl+a).toUpperCase()===l?(n.state=C.DOCTYPE,(n.doctype||n.sawRoot)&&x(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(y(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=C.TEXT):g(a)?(n.state=C.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case C.SGML_DECL_QUOTED:a===n.q&&(n.state=C.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case C.DOCTYPE:">"===a?(n.state=C.TEXT,y(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=C.DOCTYPE_DTD:g(a)&&(n.state=C.DOCTYPE_QUOTED,n.q=a));continue;case C.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=C.DOCTYPE);continue;case C.DOCTYPE_DTD:"]"===a?(n.doctype+=a,n.state=C.DOCTYPE):"<"===a?(n.state=C.OPEN_WAKA,n.startTagPosition=n.position):g(a)?(n.doctype+=a,n.state=C.DOCTYPE_DTD_QUOTED,n.q=a):n.doctype+=a;continue;case C.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=C.DOCTYPE_DTD,n.q="");continue;case C.COMMENT:"-"===a?n.state=C.COMMENT_ENDING:n.comment+=a;continue;case C.COMMENT_ENDING:"-"===a?(n.state=C.COMMENT_ENDED,n.comment=L(n.opt,n.comment),n.comment&&y(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=C.COMMENT);continue;case C.COMMENT_ENDED:">"!==a?(x(n,"Malformed comment"),n.comment+="--"+a,n.state=C.COMMENT):n.doctype&&!0!==n.doctype?n.state=C.DOCTYPE_DTD:n.state=C.TEXT;continue;case C.CDATA:"]"===a?n.state=C.CDATA_ENDING:n.cdata+=a;continue;case C.CDATA_ENDING:"]"===a?n.state=C.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=C.CDATA);continue;case C.CDATA_ENDING_2:">"===a?(n.cdata&&y(n,"oncdata",n.cdata),y(n,"onclosecdata"),n.cdata="",n.state=C.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=C.CDATA);continue;case C.PROC_INST:"?"===a?n.state=C.PROC_INST_ENDING:T(a)?n.state=C.PROC_INST_BODY:n.procInstName+=a;continue;case C.PROC_INST_BODY:if(!n.procInstBody&&T(a))continue;"?"===a?n.state=C.PROC_INST_ENDING:n.procInstBody+=a;continue;case C.PROC_INST_ENDING:">"===a?(y(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=C.TEXT):(n.procInstBody+="?"+a,n.state=C.PROC_INST_BODY);continue;case C.OPEN_TAG:I(f,a)?n.tagName+=a:(P(n),">"===a?M(n):"/"===a?n.state=C.OPEN_TAG_SLASH:(T(a)||x(n,"Invalid character in tag name"),n.state=C.ATTRIB));continue;case C.OPEN_TAG_SLASH:">"===a?(M(n,!0),$(n)):(x(n,"Forward-slash in opening tag not followed by >"),n.state=C.ATTRIB);continue;case C.ATTRIB:if(T(a))continue;">"===a?M(n):"/"===a?n.state=C.OPEN_TAG_SLASH:I(d,a)?(n.attribName=a,n.attribValue="",n.state=C.ATTRIB_NAME):x(n,"Invalid attribute name");continue;case C.ATTRIB_NAME:"="===a?n.state=C.ATTRIB_VALUE:">"===a?(x(n,"Attribute without value"),n.attribValue=n.attribName,U(n),M(n)):T(a)?n.state=C.ATTRIB_NAME_SAW_WHITE:I(f,a)?n.attribName+=a:x(n,"Invalid attribute name");continue;case C.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=C.ATTRIB_VALUE;else{if(T(a))continue;x(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",y(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?M(n):I(d,a)?(n.attribName=a,n.state=C.ATTRIB_NAME):(x(n,"Invalid attribute name"),n.state=C.ATTRIB)}continue;case C.ATTRIB_VALUE:if(T(a))continue;g(a)?(n.q=a,n.state=C.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||S(n,"Unquoted attribute value"),n.state=C.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case C.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=C.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}U(n),n.q="",n.state=C.ATTRIB_VALUE_CLOSED;continue;case C.ATTRIB_VALUE_CLOSED:T(a)?n.state=C.ATTRIB:">"===a?M(n):"/"===a?n.state=C.OPEN_TAG_SLASH:I(d,a)?(x(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=C.ATTRIB_NAME):x(n,"Invalid attribute name");continue;case C.ATTRIB_VALUE_UNQUOTED:if(!A(a)){"&"===a?n.state=C.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}U(n),">"===a?M(n):n.state=C.ATTRIB;continue;case C.CLOSE_TAG:if(n.tagName)">"===a?$(n):I(f,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=C.SCRIPT):(T(a)||x(n,"Invalid tagname in closing tag"),n.state=C.CLOSE_TAG_SAW_WHITE);else{if(T(a))continue;N(d,a)?n.script?(n.script+="</"+a,n.state=C.SCRIPT):x(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case C.CLOSE_TAG_SAW_WHITE:if(T(a))continue;">"===a?$(n):x(n,"Invalid characters in closing tag");continue;case C.TEXT_ENTITY:case C.ATTRIB_VALUE_ENTITY_Q:case C.ATTRIB_VALUE_ENTITY_U:var u,E;switch(n.state){case C.TEXT_ENTITY:u=C.TEXT,E="textNode";break;case C.ATTRIB_VALUE_ENTITY_Q:u=C.ATTRIB_VALUE_QUOTED,E="attribValue";break;case C.ATTRIB_VALUE_ENTITY_U:u=C.ATTRIB_VALUE_UNQUOTED,E="attribValue"}if(";"===a){var p=G(n);n.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(p)?(n.entity="",n.state=u,n.write(p)):(n[E]+=p,n.entity="",n.state=u)}else I(n.entity.length?m:h,a)?n.entity+=a:(x(n,"Invalid character in entity name"),n[E]+="&"+n.entity+a,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,s=r.length;a<s;a++){var o=t[r[a]].length;if(o>n)switch(r[a]){case"textNode":R(t);break;case"cdata":y(t,"oncdata",t.cdata),t.cdata="";break;case"script":y(t,"onscript",t.script),t.script="";break;default:S(t,"Max buffer length exceeded: "+r[a])}i=Math.max(i,o)}var c=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=c+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;R(e=this),""!==e.cdata&&(y(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(y(e,"onscript",e.script),e.script="")}};try{t=require("stream").Stream}catch(e){t=function(){}}t||(t=function(){});var i=e.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function s(e,r){if(!(this instanceof s))return new s(e,r);t.apply(this),this._parser=new n(e,r),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(e){a.emit("error",e),a._parser.error=null},this._decoder=null,i.forEach(function(e){Object.defineProperty(a,"on"+e,{get:function(){return a._parser["on"+e]},set:function(t){if(!t)return a.removeAllListeners(e),a._parser["on"+e]=t,t;a.on(e,t)},enumerable:!0,configurable:!1})})}s.prototype=Object.create(t.prototype,{constructor:{value:s}}),s.prototype.write=function(e){if("function"==typeof c&&"function"==typeof c.isBuffer&&c.isBuffer(e)){if(!this._decoder){var t=a.I;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,r){var n=this;return n._parser["on"+e]||-1===i.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),t.prototype.on.call(n,e,r)};var o="[CDATA[",l="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",E="http://www.w3.org/2000/xmlns/",p={xml:u,xmlns:E},d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,h=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function T(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function g(e){return'"'===e||"'"===e}function A(e){return">"===e||T(e)}function I(e,t){return e.test(t)}function N(e,t){return!I(e,t)}var w,_,v,C=0;for(var b in e.STATE={BEGIN:C++,BEGIN_WHITESPACE:C++,TEXT:C++,TEXT_ENTITY:C++,OPEN_WAKA:C++,SGML_DECL:C++,SGML_DECL_QUOTED:C++,DOCTYPE:C++,DOCTYPE_QUOTED:C++,DOCTYPE_DTD:C++,DOCTYPE_DTD_QUOTED:C++,COMMENT_STARTING:C++,COMMENT:C++,COMMENT_ENDING:C++,COMMENT_ENDED:C++,CDATA:C++,CDATA_ENDING:C++,CDATA_ENDING_2:C++,PROC_INST:C++,PROC_INST_BODY:C++,PROC_INST_ENDING:C++,OPEN_TAG:C++,OPEN_TAG_SLASH:C++,ATTRIB:C++,ATTRIB_NAME:C++,ATTRIB_NAME_SAW_WHITE:C++,ATTRIB_VALUE:C++,ATTRIB_VALUE_QUOTED:C++,ATTRIB_VALUE_CLOSED:C++,ATTRIB_VALUE_UNQUOTED:C++,ATTRIB_VALUE_ENTITY_Q:C++,ATTRIB_VALUE_ENTITY_U:C++,CLOSE_TAG:C++,CLOSE_TAG_SAW_WHITE:C++,SCRIPT:C++,SCRIPT_ENDING:C++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(t){var r=e.ENTITIES[t],n="number"==typeof r?String.fromCharCode(r):r;e.ENTITIES[t]=n}),e.STATE)e.STATE[e.STATE[b]]=b;function O(e,t,r){e[t]&&e[t](r)}function y(e,t,r){e.textNode&&R(e),O(e,t,r)}function R(e){e.textNode=L(e.opt,e.textNode),e.textNode&&O(e,"ontext",e.textNode),e.textNode=""}function L(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function S(e,t){return R(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,O(e,"onerror",t),e}function D(e){return e.sawRoot&&!e.closedRoot&&x(e,"Unclosed root tag"),e.state!==C.BEGIN&&e.state!==C.BEGIN_WHITESPACE&&e.state!==C.TEXT&&S(e,"Unexpected end"),R(e),e.c="",e.closed=!0,O(e,"onend"),n.call(e,e.strict,e.opt),e}function x(e,t){if("object"!=typeof e||!(e instanceof n))throw new Error("bad call to strictFail");e.strict&&S(e,t)}function P(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,r=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(r.ns=t.ns),e.attribList.length=0,y(e,"onopentagstart",r)}function F(e,t){var r=e.indexOf(":")<0?["",e]:e.split(":"),n=r[0],i=r[1];return t&&"xmlns"===e&&(n="xmlns",i=""),{prefix:n,local:i}}function U(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=F(e.attribName,!0),r=t.prefix,n=t.local;if("xmlns"===r)if("xml"===n&&e.attribValue!==u)x(e,"xml: prefix must be bound to "+u+"\nActual: "+e.attribValue);else if("xmlns"===n&&e.attribValue!==E)x(e,"xmlns: prefix must be bound to "+E+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[n]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,y(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function M(e,t){if(e.opt.xmlns){var r=e.tag,n=F(e.tagName);r.prefix=n.prefix,r.local=n.local,r.uri=r.ns[n.prefix]||"",r.prefix&&!r.uri&&(x(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),r.uri=n.prefix);var i=e.tags[e.tags.length-1]||e;r.ns&&i.ns!==r.ns&&Object.keys(r.ns).forEach(function(t){y(e,"onopennamespace",{prefix:t,uri:r.ns[t]})});for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],c=o[0],l=o[1],u=F(c,!0),E=u.prefix,p=u.local,d=""===E?"":r.ns[E]||"",f={name:c,value:l,prefix:E,local:p,uri:d};E&&"xmlns"!==E&&!d&&(x(e,"Unbound namespace prefix: "+JSON.stringify(E)),f.uri=E),e.tag.attributes[c]=f,y(e,"onattribute",f)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),y(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=C.TEXT:e.state=C.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function $(e){if(!e.tagName)return x(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=C.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=C.SCRIPT);y(e,"onscript",e.script),e.script=""}var t=e.tags.length,r=e.tagName;e.strict||(r=r[e.looseCase]());for(var n=r;t--&&e.tags[t].name!==n;)x(e,"Unexpected close tag");if(t<0)return x(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=C.TEXT);e.tagName=r;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,y(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var c=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==c.ns&&Object.keys(a.ns).forEach(function(t){var r=a.ns[t];y(e,"onclosenamespace",{prefix:t,uri:r})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=C.TEXT}function G(e){var t,r=e.entity,n=r.toLowerCase(),i="";return e.ENTITIES[r]?e.ENTITIES[r]:e.ENTITIES[n]?e.ENTITIES[n]:("#"===(r=n).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),i=(t=parseInt(r,16)).toString(16)):(r=r.slice(1),i=(t=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(t)||i.toLowerCase()!==r?(x(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function V(e,t){"<"===t?(e.state=C.OPEN_WAKA,e.startTagPosition=e.position):T(t)||(x(e,"Non-whitespace before first tag."),e.textNode=t,e.state=C.TEXT)}function B(e,t){var r="";return t<e.length&&(r=e.charAt(t)),r}C=e.STATE,String.fromCodePoint||(w=String.fromCharCode,_=Math.floor,v=function(){var e,t,r=[],n=-1,i=arguments.length;if(!i)return"";for(var a="";++n<i;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||_(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,r.push(e,t)),(n+1===i||r.length>16384)&&(a+=w.apply(null,r),r.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:v,configurable:!0,writable:!0}):String.fromCodePoint=v)}($)),$)),V={"http://www.w3.org/2000/svg":{ext:"svg",mime:"image/svg+xml"},"http://www.w3.org/1999/xhtml":{ext:"xhtml",mime:"application/xhtml+xml"},"http://www.opengis.net/kml/2.2":{ext:"kml",mime:"application/vnd.google-earth.kml+xml"},"http://www.opengis.net/gml":{ext:"gml",mime:"application/gml+xml"}},B={rss:{ext:"rss",mime:"application/rss+xml"},"score-partwise":{ext:"musicxml",mime:"application/vnd.recordare.musicxml+xml"},svg:{ext:"svg",mime:"image/svg+xml"}};class k{constructor(e){this.options=e??{},this.firstTag=!0,this.onEnd=!1,this.parser=G.parser(!0,{xmlns:!0}),this.nesting=0,this.parser.onerror=e=>{e.message.startsWith("Invalid character entity")||(this.fileType=void 0,this.onEnd=!0)},this.parser.onopentag=e=>{++this.nesting,this.firstTag&&!this.onEnd&&(this.firstTag=!1,e.uri?this.fileType=V[e.uri]:e.name&&(this.fileType=B[e.name.toLowerCase()]),this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.onclosetag=()=>{--this.nesting}}write(e){this.parser.write(e)}close(){this.parser.close(),this.onEnd=!0}isValid(){return 0===this.nesting}}Error;var H,X=r(81222),j=r(19051),Y=r(85168),q=r(47176),W=r(63814),Q=r(98469),z=r(85471);function K(e){return!(!e.status||e.status===H.SUCCESS)&&(e.userProvided||"password::global::user"===e.authMechanism)}function Z(e){if(e.type===n.F.File)return!1;const t=e.attributes;return!(!t.scope||!t.backend||"personal"!==t.scope&&"system"!==t.scope)}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.INDETERMINATE=2]="INDETERMINATE",e[e.INCOMPLETE_CONF=3]="INCOMPLETE_CONF",e[e.UNAUTHORIZED=4]="UNAUTHORIZED",e[e.TIMEOUT=5]="TIMEOUT",e[e.NETWORK_ERROR=6]="NETWORK_ERROR"}(H||(H={})),(0,q.IF)(j.Ay);const J=new u({id:"credentials-external-storage",displayName:()=>(0,s.t)("files","Enter missing credentials"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-login" viewBox="0 0 24 24"><path d="M11 7L9.6 8.4L12.2 11H2V13H12.2L9.6 15.6L11 17L16 12L11 7M20 19H12V21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3H12V5H20V19Z" /></svg>',enabled:({nodes:e})=>{if(1!==e.length||!e[0])return!1;const t=e[0];return!!Z(t)&&!!K(t.attributes?.config||{})},async exec({nodes:e}){const{login:t,password:n}=await new Promise(e=>(0,Q.S)((0,z.$V)(()=>Promise.all([r.e(4208),r.e(6358)]).then(r.bind(r,16358))),{},t=>{e(t)}));if(t&&n)try{await async function(e,t,r){const n=(await j.Ay.request({method:"PUT",url:(0,W.Jv)("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:q.mH.Strict,data:{backendOptions:{user:t,password:r}}})).data;return n.status!==H.SUCCESS?((0,Y.Qg)((0,s.t)("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:n?.statusMessage||""})),null):((0,Y.Te)((0,s.t)("files_external","New configuration successfully saved")),z.Ay.set(e.attributes,"config",n),!0)}(e[0],t,n),(0,Y.Te)((0,s.t)("files_external","Credentials successfully set"))}catch(e){(0,Y.Qg)((0,s.t)("files_external","Error while setting credentials: {error}",{error:e.message}))}return null},order:-1e3,default:l.DEFAULT,inline:()=>!0});var ee=r(21777);const te=`/files/${(0,ee.HW)()?.uid}`;function re(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new n.b({id:e.id,source:(0,W.dC)("dav"+te+"/"+t),root:te,owner:(0,ee.HW)()?.uid||null,permissions:e.config.status!==H.SUCCESS?n.P.NONE:e?.permissions||n.P.READ,attributes:{displayName:t,...e}})}var ne=r(85072),ie=r.n(ne),ae=r(97825),se=r.n(ae),oe=r(77659),ce=r.n(oe),le=r(55056),ue=r.n(le),Ee=r(10540),pe=r.n(Ee),de=r(41113),fe=r.n(de),he=r(64755),me={};me.styleTagTransform=fe(),me.setAttributes=ue(),me.insert=ce().bind(null,"head"),me.domAPI=se(),me.insertStyleElement=pe(),ie()(he.A,me),he.A&&he.A.locals&&he.A.locals;const Te=new u({id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:({nodes:e})=>e.every(e=>!0===Z(e)),exec:async()=>null,async renderInline({nodes:e}){if(1!==e.length||!e[0])return null;const t=e[0],r=document.createElement("span");r.className="files-list__row-status",r.innerHTML=(0,s.Tl)("files_external","Checking storage …");let n=null;return function(e,t=!0){const r=t?"userglobalstorages":"userstorages";return j.Ay.get((0,W.Jv)(`apps/files_external/${r}/${e}?testOnly=false`))}(t.attributes.id,"system"===t.attributes.scope).then(e=>{if(n=e.data,z.Ay.set(t.attributes,"config",n),n.status!==H.SUCCESS)throw new Error(n?.statusMessage||(0,s.Tl)("files_external","There was an error with this external storage."));r.remove()}).catch(e=>{e.response&&!n&&(0,Y.I9)((0,s.Tl)("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),r.innerHTML="";const i=!!n&&K(n),a=document.createElement("span");a.classList.add("files-list__row-status--"+(i?"warning":"error")),i||(r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alert-circle" viewBox="0 0 24 24"><path d="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" /></svg>',r.title=e.message),r.prepend(a)}),r},order:10}),ge=new u({id:"open-in-files-external-storage",displayName:({nodes:e})=>(e?.[0]?.attributes?.config||{status:H.INDETERMINATE}).status!==H.SUCCESS?(0,s.Tl)("files_external","Examine this faulty external storage configuration"):(0,s.Tl)("files","Open in Files"),iconSvgInline:()=>"",enabled:({view:e})=>"extstoragemounts"===e.id,async exec({nodes:e}){const t=e[0]?.attributes?.config;return t?.status!==H.SUCCESS?(window.OC.dialogs.confirm((0,s.Tl)("files_external","There was an error with this external storage. Do you want to review this mount point config in the settings page?"),(0,s.Tl)("files_external","External mount error"),e=>{if(!0===e){const e=(0,ee.HW)()?.isAdmin?"admin":"user";window.location.href=(0,W.Jv)(`/settings/${e}/externalstorages`)}}),null):(window.OCP.Files.Router.goToRoute(null,{view:"files"},{dir:e[0].path}),null)},order:-1e3,default:l.HIDDEN}),Ae=(0,X.C)("files_external","allowUserMounting",!1);(void 0===window._nc_navigation&&(window._nc_navigation=new P,n.l.debug("Navigation service initialized")),window._nc_navigation).register(new class{_view;constructor(e){(function(e){if(!e.id||"string"!=typeof e.id)throw new Error("View id is required and must be a string");if(!e.name||"string"!=typeof e.name)throw new Error("View name is required and must be a string");if("caption"in e&&"string"!=typeof e.caption)throw new Error("View caption must be a string");if(!e.getContents||"function"!=typeof e.getContents)throw new Error("View getContents is required and must be a function");if("hidden"in e&&"boolean"!=typeof e.hidden)throw new Error("View hidden must be a boolean");if(!e.icon||"string"!=typeof e.icon||!function(e,{validate:t=!0}={}){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);if(0===(e=e.trim()).length)return!1;const r=new k({fullScan:t});if(t){if(r.write(e),!r.isValid())return!1}else{const t=128;let n=0;for(;e.length>n&&!r.onEnd;)r.write(e.slice(n,Math.min(n+t,e.length))),n+=t}return"svg"===r.fileType?.ext}(e.icon))throw new Error("View icon is required and must be a valid svg string");if("order"in e&&"number"!=typeof e.order)throw new Error("View order must be a number");if(e.columns&&e.columns.forEach(e=>{if(!(e instanceof F))throw new Error("View columns must be an array of Column. Invalid column found")}),e.emptyView&&"function"!=typeof e.emptyView)throw new Error("View emptyView must be a function");if(e.parent&&"string"!=typeof e.parent)throw new Error("View parent must be a string");if("sticky"in e&&"boolean"!=typeof e.sticky)throw new Error("View sticky must be a boolean");if("expanded"in e&&"boolean"!=typeof e.expanded)throw new Error("View expanded must be a boolean");if(e.defaultSortKey&&"string"!=typeof e.defaultSortKey)throw new Error("View defaultSortKey must be a string");if(e.loadChildViews&&"function"!=typeof e.loadChildViews)throw new Error("View loadChildViews must be a function")})(e),this._view=e}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get hidden(){return this._view.hidden}get icon(){return this._view.icon}set icon(e){this._view.icon=e}get order(){return this._view.order}set order(e){this._view.order=e}get params(){return this._view.params}set params(e){this._view.params=e}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(e){this._view.expanded=e}get defaultSortKey(){return this._view.defaultSortKey}get loadChildViews(){return this._view.loadChildViews}}({id:"extstoragemounts",name:(0,s.Tl)("files_external","External storage"),caption:(0,s.Tl)("files_external","List of external storage."),emptyCaption:Ae?(0,s.Tl)("files_external","There is no external storage configured. You can configure them in your Personal settings."):(0,s.Tl)("files_external","There is no external storage configured and you don't have the permission to configure them."),emptyTitle:(0,s.Tl)("files_external","No external storage"),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-network-outline" viewBox="0 0 24 24"><path d="M15 20C15 19.45 14.55 19 14 19H13V17H19C20.11 17 21 16.11 21 15V7C21 5.9 20.11 5 19 5H13L11 3H5C3.9 3 3 3.9 3 5V15C3 16.11 3.9 17 5 17H11V19H10C9.45 19 9 19.45 9 20H2V22H9C9 22.55 9.45 23 10 23H14C14.55 23 15 22.55 15 22H22V20H15M5 15V7H19V15H5Z" /></svg>',order:30,columns:[new F({id:"storage-type",title:(0,s.Tl)("files_external","Storage type"),render(e){const t=e.attributes?.backend||(0,s.Tl)("files_external","Unknown"),r=document.createElement("span");return r.textContent=t,r}}),new F({id:"scope",title:(0,s.Tl)("files_external","Scope"),render(e){const t=document.createElement("span");let r=(0,s.Tl)("files_external","Personal");return"system"===e.attributes?.scope&&(r=(0,s.Tl)("files_external","System")),t.textContent=r,t}})],getContents:async function(){const e=(await j.Ay.get((0,W.KT)("apps/files_external/api/v1/mounts"))).data.ocs.data.map(re);return{folder:new n.b({id:0,source:(0,W.dC)("dav"+te),root:te,owner:(0,ee.HW)()?.uid||null,permissions:n.P.READ}),contents:e}}})),E(J),E(Te),E(ge)},73776:()=>{},77199:()=>{},77965:()=>{},78982:()=>{},79368:()=>{},79838:()=>{}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=n,e=[],a.O=(t,r,n,i)=>{if(!r){var s=1/0;for(u=0;u<e.length;u++){for(var[r,n,i]=e[u],o=!0,c=0;c<r.length;c++)(!1&i||s>=i)&&Object.keys(a.O).every(e=>a.O[e](r[c]))?r.splice(c--,1):(o=!1,i<s&&(s=i));if(o){e.splice(u--,1);var l=n();void 0!==l&&(t=l)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,n,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>e+"-"+e+".js?v="+{594:"2c86902dfae9a5006399",620:"1faa6454ab9a6286ffeb",2391:"908fc68e4bc9b878c937",2880:"96ff2de012f3b8c1e3a4",4325:"11e9d860db6a9bc25aac",5862:"d020c05f13d21afee82a",6358:"9fb808429110b09cc272",7145:"d9c518ca34bfdbd7ff70",8339:"6cdca71a6b3b2d7bef33"}[e],a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="nextcloud-ui-legacy:",a.l=(e,n,i,s)=>{if(t[e])t[e].push(n);else{var o,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var E=l[u];if(E.getAttribute("src")==e||E.getAttribute("data-webpack")==r+i){o=E;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",r+i),o.src=e),t[e]=[n];var p=(r,n)=>{o.onerror=o.onload=null,clearTimeout(d);var i=t[e];if(delete t[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(n)),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=1873,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={1873:0};a.f.j=(t,r)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((r,i)=>n=e[t]=[r,i]);r.push(n[2]=i);var s=a.p+a.u(t),o=new Error;a.l(s,r=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,n[1](o)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,[s,o,c]=r,l=0;if(s.some(t=>0!==e[t])){for(n in o)a.o(o,n)&&(a.m[n]=o[n]);if(c)var u=c(a)}for(t&&t(r);l<s.length;l++)i=s[l],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return a.O(u)},r=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),a.nc=void 0;var s=a.O(void 0,[4208],()=>a(66265));s=a.O(s)})();
//# sourceMappingURL=files_external-init.js.map?v=a787d5d46d3bd7225bfc