UNPKG

vanilla-context-menu

Version:

Easily create context menus using vanilla JavaScript and integrate them in any web application

2 lines 36.1 kB
/*! For license information please see vanilla-context-menu.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("VanillaContextMenu",[],t):"object"==typeof exports?exports.VanillaContextMenu=t():e.VanillaContextMenu=t()}(this,(()=>(()=>{var e={550:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(81),o=n.n(r),i=n(645),a=n.n(i)()(o());a.push([e.id,'.PJsSKU2kCXjeIsVSdFoI{font-family:"Open Sans",sans-serif;position:fixed;z-index:10000;width:150px;transform:scale(0);transition-property:transform;transition-timing-function:ease-in-out}.novl09c_yWe4MBqKpWyN{background:#1b1a1a}.novl09c_yWe4MBqKpWyN hr{background-color:#555}.novl09c_yWe4MBqKpWyN>*:not(hr){color:#eee}.novl09c_yWe4MBqKpWyN>*:not(hr):hover{background:#555}.F5LtzLqHVYZuI1H_SR9q{background:#fff}.F5LtzLqHVYZuI1H_SR9q hr{background-color:#e4e4e4}.F5LtzLqHVYZuI1H_SR9q>*:not(hr){color:#262626}.F5LtzLqHVYZuI1H_SR9q>*:not(hr):hover{background:#e4e4e4}.PJsSKU2kCXjeIsVSdFoI.ibAEWR3dINCWDsWq1G2P{transform:scale(1)}.PJsSKU2kCXjeIsVSdFoI hr{margin:2px 0;height:1px;border:0}.PJsSKU2kCXjeIsVSdFoI>*:not(hr){padding:8px 10px;font-size:15px;cursor:pointer;display:flex;align-items:center;gap:5px}.PJsSKU2kCXjeIsVSdFoI .gfl6YXq1tuGnYKHXwDHP{display:flex;align-items:center;justify-content:center}.PJsSKU2kCXjeIsVSdFoI .gfl6YXq1tuGnYKHXwDHP>*{margin:0;padding:0;font-size:16px}.PJsSKU2kCXjeIsVSdFoI .QkRci5U3hKz5RODdOkco{line-height:21px;font-size:26px;position:relative;margin-left:auto}',""]),a.locals={"context-menu":"PJsSKU2kCXjeIsVSdFoI","context-menu--black-theme":"novl09c_yWe4MBqKpWyN","context-menu--white-theme":"F5LtzLqHVYZuI1H_SR9q",visible:"ibAEWR3dINCWDsWq1G2P","menu-item-icon":"gfl6YXq1tuGnYKHXwDHP","nested-menu-arrow":"QkRci5U3hKz5RODdOkco"};const s=a},645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},81:e=>{"use strict";e.exports=function(e){return e[1]}},856:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,i){return r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var i=new(Function.bind.apply(e,o));return r&&t(i,r.prototype),i},r.apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var a=Object.hasOwnProperty,s=Object.setPrototypeOf,c=Object.isFrozen,l=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,p=Object.freeze,f=Object.seal,m=Object.create,d="undefined"!=typeof Reflect&&Reflect,h=d.apply,y=d.construct;h||(h=function(e,t,n){return e.apply(t,n)}),p||(p=function(e){return e}),f||(f=function(e){return e}),y||(y=function(e,t){return r(e,o(t))});var g,v=A(Array.prototype.forEach),b=A(Array.prototype.pop),x=A(Array.prototype.push),T=A(String.prototype.toLowerCase),w=A(String.prototype.match),k=A(String.prototype.replace),N=A(String.prototype.indexOf),S=A(String.prototype.trim),E=A(RegExp.prototype.test),M=(g=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y(g,t)});function A(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return h(e,t,r)}}function C(e,t,n){n=n||T,s&&s(e,null);for(var r=t.length;r--;){var o=t[r];if("string"==typeof o){var i=n(o);i!==o&&(c(t)||(t[r]=i),o=i)}e[o]=!0}return e}function O(e){var t,n=m(null);for(t in e)h(a,e,[t])&&(n[t]=e[t]);return n}function L(e,t){for(;null!==e;){var n=u(e,t);if(n){if(n.get)return A(n.get);if("function"==typeof n.value)return A(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var _=p(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),I=p(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),D=p(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=p(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),H=p(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),z=p(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),F=p(["#text"]),j=p(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),P=p(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=p(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),W=p(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=f(/\{\{[\w\W]*|[\w\W]*\}\}/gm),B=f(/<%[\w\W]*|[\w\W]*%>/gm),G=f(/^data-[\-\w.\u00B7-\uFFFF]/),$=f(/^aria-[\-\w]+$/),Y=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=f(/^(?:\w+script|data):/i),X=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=f(/^html$/i),J=function(){return"undefined"==typeof window?null:window},Z=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J(),r=function(e){return t(e)};if(r.version="2.4.0",r.removed=[],!n||!n.document||9!==n.document.nodeType)return r.isSupported=!1,r;var i=n.document,a=n.document,s=n.DocumentFragment,c=n.HTMLTemplateElement,l=n.Node,u=n.Element,f=n.NodeFilter,m=n.NamedNodeMap,d=void 0===m?n.NamedNodeMap||n.MozNamedAttrMap:m,h=n.HTMLFormElement,y=n.DOMParser,g=n.trustedTypes,A=u.prototype,Q=L(A,"cloneNode"),ee=L(A,"nextSibling"),te=L(A,"childNodes"),ne=L(A,"parentNode");if("function"==typeof c){var re=a.createElement("template");re.content&&re.content.ownerDocument&&(a=re.content.ownerDocument)}var oe=Z(g,i),ie=oe?oe.createHTML(""):"",ae=a,se=ae.implementation,ce=ae.createNodeIterator,le=ae.createDocumentFragment,ue=ae.getElementsByTagName,pe=i.importNode,fe={};try{fe=O(a).documentMode?a.documentMode:{}}catch(e){}var me={};r.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==fe;var de,he,ye=q,ge=B,ve=G,be=$,xe=K,Te=X,we=Y,ke=null,Ne=C({},[].concat(o(_),o(I),o(D),o(H),o(F))),Se=null,Ee=C({},[].concat(o(j),o(P),o(U),o(W))),Me=Object.seal(Object.create(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}})),Ae=null,Ce=null,Oe=!0,Le=!0,_e=!1,Ie=!1,De=!1,Re=!1,He=!1,ze=!1,Fe=!1,je=!1,Pe=!0,Ue=!1,We="user-content-",qe=!0,Be=!1,Ge={},$e=null,Ye=C({},["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"]),Ke=null,Xe=C({},["audio","video","img","source","image","track"]),Ve=null,Je=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml",tt=et,nt=!1,rt=["application/xhtml+xml","text/html"],ot="text/html",it=null,at=a.createElement("form"),st=function(e){return e instanceof RegExp||e instanceof Function},ct=function(t){it&&it===t||(t&&"object"===e(t)||(t={}),t=O(t),de=de=-1===rt.indexOf(t.PARSER_MEDIA_TYPE)?ot:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===de?function(e){return e}:T,ke="ALLOWED_TAGS"in t?C({},t.ALLOWED_TAGS,he):Ne,Se="ALLOWED_ATTR"in t?C({},t.ALLOWED_ATTR,he):Ee,Ve="ADD_URI_SAFE_ATTR"in t?C(O(Je),t.ADD_URI_SAFE_ATTR,he):Je,Ke="ADD_DATA_URI_TAGS"in t?C(O(Xe),t.ADD_DATA_URI_TAGS,he):Xe,$e="FORBID_CONTENTS"in t?C({},t.FORBID_CONTENTS,he):Ye,Ae="FORBID_TAGS"in t?C({},t.FORBID_TAGS,he):{},Ce="FORBID_ATTR"in t?C({},t.FORBID_ATTR,he):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,Oe=!1!==t.ALLOW_ARIA_ATTR,Le=!1!==t.ALLOW_DATA_ATTR,_e=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=t.SAFE_FOR_TEMPLATES||!1,De=t.WHOLE_DOCUMENT||!1,ze=t.RETURN_DOM||!1,Fe=t.RETURN_DOM_FRAGMENT||!1,je=t.RETURN_TRUSTED_TYPE||!1,He=t.FORCE_BODY||!1,Pe=!1!==t.SANITIZE_DOM,Ue=t.SANITIZE_NAMED_PROPS||!1,qe=!1!==t.KEEP_CONTENT,Be=t.IN_PLACE||!1,we=t.ALLOWED_URI_REGEXP||we,tt=t.NAMESPACE||et,t.CUSTOM_ELEMENT_HANDLING&&st(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&st(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Me.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Me.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Le=!1),Fe&&(ze=!0),Ge&&(ke=C({},o(F)),Se=[],!0===Ge.html&&(C(ke,_),C(Se,j)),!0===Ge.svg&&(C(ke,I),C(Se,P),C(Se,W)),!0===Ge.svgFilters&&(C(ke,D),C(Se,P),C(Se,W)),!0===Ge.mathMl&&(C(ke,H),C(Se,U),C(Se,W))),t.ADD_TAGS&&(ke===Ne&&(ke=O(ke)),C(ke,t.ADD_TAGS,he)),t.ADD_ATTR&&(Se===Ee&&(Se=O(Se)),C(Se,t.ADD_ATTR,he)),t.ADD_URI_SAFE_ATTR&&C(Ve,t.ADD_URI_SAFE_ATTR,he),t.FORBID_CONTENTS&&($e===Ye&&($e=O($e)),C($e,t.FORBID_CONTENTS,he)),qe&&(ke["#text"]=!0),De&&C(ke,["html","head","body"]),ke.table&&(C(ke,["tbody"]),delete Ae.tbody),p&&p(t),it=t)},lt=C({},["mi","mo","mn","ms","mtext"]),ut=C({},["foreignobject","desc","title","annotation-xml"]),pt=C({},["title","style","font","a","script"]),ft=C({},I);C(ft,D),C(ft,R);var mt=C({},H);C(mt,z);var dt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:et,tagName:"template"});var n=T(e.tagName),r=T(t.tagName);return e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Ze?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(ft[n]):e.namespaceURI===Ze?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&ut[r]:Boolean(mt[n]):e.namespaceURI===et&&!(t.namespaceURI===Qe&&!ut[r])&&!(t.namespaceURI===Ze&&!lt[r])&&!mt[n]&&(pt[n]||!ft[n])},ht=function(e){x(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},yt=function(e,t){try{x(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){x(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Se[e])if(ze||Fe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},gt=function(e){var t,n;if(He)e="<remove></remove>"+e;else{var r=w(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===de&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var o=oe?oe.createHTML(e):e;if(tt===et)try{t=(new y).parseFromString(o,de)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?"":o}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(a.createTextNode(n),i.childNodes[0]||null),tt===et?ue.call(t,De?"html":"body")[0]:De?t.documentElement:i},vt=function(e){return ce.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null,!1)},bt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},xt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Tt=function(e,t,n){me[e]&&v(me[e],(function(e){e.call(r,t,n,it)}))},wt=function(e){var t;if(Tt("beforeSanitizeElements",e,null),bt(e))return ht(e),!0;if(E(/[\u0080-\uFFFF]/,e.nodeName))return ht(e),!0;var n=he(e.nodeName);if(Tt("uponSanitizeElement",e,{tagName:n,allowedTags:ke}),e.hasChildNodes()&&!xt(e.firstElementChild)&&(!xt(e.content)||!xt(e.content.firstElementChild))&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return ht(e),!0;if("select"===n&&E(/<template/i,e.innerHTML))return ht(e),!0;if(!ke[n]||Ae[n]){if(!Ae[n]&&Nt(n)){if(Me.tagNameCheck instanceof RegExp&&E(Me.tagNameCheck,n))return!1;if(Me.tagNameCheck instanceof Function&&Me.tagNameCheck(n))return!1}if(qe&&!$e[n]){var o=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(Q(i[a],!0),ee(e))}return ht(e),!0}return e instanceof u&&!dt(e)?(ht(e),!0):"noscript"!==n&&"noembed"!==n||!E(/<\/no(script|embed)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,t=k(t,ye," "),t=k(t,ge," "),e.textContent!==t&&(x(r.removed,{element:e.cloneNode()}),e.textContent=t)),Tt("afterSanitizeElements",e,null),!1):(ht(e),!0)},kt=function(e,t,n){if(Pe&&("id"===t||"name"===t)&&(n in a||n in at))return!1;if(Le&&!Ce[t]&&E(ve,t));else if(Oe&&E(be,t));else if(!Se[t]||Ce[t]){if(!(Nt(e)&&(Me.tagNameCheck instanceof RegExp&&E(Me.tagNameCheck,e)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(e))&&(Me.attributeNameCheck instanceof RegExp&&E(Me.attributeNameCheck,t)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(t))||"is"===t&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&E(Me.tagNameCheck,n)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(n))))return!1}else if(Ve[t]);else if(E(we,k(n,Te,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==N(n,"data:")||!Ke[e])if(_e&&!E(xe,k(n,Te,"")));else if(n)return!1;return!0},Nt=function(e){return e.indexOf("-")>0},St=function(t){var n,o,i,a;Tt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se};for(a=s.length;a--;){var l=n=s[a],u=l.name,p=l.namespaceURI;if(o="value"===u?n.value:S(n.value),i=he(u),c.attrName=i,c.attrValue=o,c.keepAttr=!0,c.forceKeepAttr=void 0,Tt("uponSanitizeAttribute",t,c),o=c.attrValue,!c.forceKeepAttr&&(yt(u,t),c.keepAttr))if(E(/\/>/i,o))yt(u,t);else{Ie&&(o=k(o,ye," "),o=k(o,ge," "));var f=he(t.nodeName);if(kt(f,i,o)){if(!Ue||"id"!==i&&"name"!==i||(yt(u,t),o=We+o),oe&&"object"===e(g)&&"function"==typeof g.getAttributeType)if(p);else switch(g.getAttributeType(f,i)){case"TrustedHTML":o=oe.createHTML(o);break;case"TrustedScriptURL":o=oe.createScriptURL(o)}try{p?t.setAttributeNS(p,u,o):t.setAttribute(u,o),b(r.removed)}catch(e){}}}}Tt("afterSanitizeAttributes",t,null)}},Et=function e(t){var n,r=vt(t);for(Tt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Tt("uponSanitizeShadowNode",n,null),wt(n)||(n.content instanceof s&&e(n.content),St(n));Tt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t){var o,a,c,u,p,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((nt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!xt(t)){if("function"!=typeof t.toString)throw M("toString is not a function");if("string"!=typeof(t=t.toString()))throw M("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(xt(t))return n.toStaticHTML(t.outerHTML)}return t}if(Re||ct(f),r.removed=[],"string"==typeof t&&(Be=!1),Be){if(t.nodeName){var m=he(t.nodeName);if(!ke[m]||Ae[m])throw M("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)1===(a=(o=gt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!ze&&!Ie&&!De&&-1===t.indexOf("<"))return oe&&je?oe.createHTML(t):t;if(!(o=gt(t)))return ze?null:je?ie:""}o&&He&&ht(o.firstChild);for(var d=vt(Be?t:o);c=d.nextNode();)3===c.nodeType&&c===u||wt(c)||(c.content instanceof s&&Et(c.content),St(c),u=c);if(u=null,Be)return t;if(ze){if(Fe)for(p=le.call(o.ownerDocument);o.firstChild;)p.appendChild(o.firstChild);else p=o;return Se.shadowroot&&(p=pe.call(i,p,!0)),p}var h=De?o.outerHTML:o.innerHTML;return De&&ke["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&E(V,o.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+h),Ie&&(h=k(h,ye," "),h=k(h,ge," ")),oe&&je?oe.createHTML(h):h},r.setConfig=function(e){ct(e),Re=!0},r.clearConfig=function(){it=null,Re=!1},r.isValidAttribute=function(e,t,n){it||ct({});var r=he(e),o=he(t);return kt(r,o,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],x(me[e],t))},r.removeHook=function(e){if(me[e])return b(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}()}()},138:(e,t,n)=>{var r=n(55);e.exports=function(e){var t,n="",o=e||{};return function(e,o){n=n+"<div"+r.attr("class",r.classes([`${o["context-menu"]}`],[!0]),!1,!0)+"> ",function(){var i=e;if("number"==typeof i.length)for(var a=0,s=i.length;a<s;a++)"hr"===(c=i[a])?n+="<hr>":(n=n+"<div"+r.attr("id",`context-menu-item-${c._id}`,!0,!0)+"> ",(c.iconClass||c.iconHTML)&&(n=n+"<span"+r.attr("class",r.classes([`${o["menu-item-icon"]}`],[!0]),!1,!0)+">",c.iconClass&&(n=n+"<i"+r.attr("class",r.classes([`${c.iconClass}`],[!0]),!1,!0)+"></i>"),c.iconHTML&&(n+=null==(t=c.iconHTML)?"":t),n+="</span>"),n=n+"<span>"+r.escape(null==(t=c.label)?"":t)+"</span>",c.nestedMenu&&(n=n+"<span"+r.attr("class",r.classes([`${o["nested-menu-arrow"]}`],[!0]),!1,!0)+">&#x203A;</span>"),n+="</div>");else for(var a in s=0,i){var c;s++,"hr"===(c=i[a])?n+="<hr>":(n=n+"<div"+r.attr("id",`context-menu-item-${c._id}`,!0,!0)+"> ",(c.iconClass||c.iconHTML)&&(n=n+"<span"+r.attr("class",r.classes([`${o["menu-item-icon"]}`],[!0]),!1,!0)+">",c.iconClass&&(n=n+"<i"+r.attr("class",r.classes([`${c.iconClass}`],[!0]),!1,!0)+"></i>"),c.iconHTML&&(n+=null==(t=c.iconHTML)?"":t),n+="</span>"),n=n+"<span>"+r.escape(null==(t=c.label)?"":t)+"</span>",c.nestedMenu&&(n=n+"<span"+r.attr("class",r.classes([`${o["nested-menu-arrow"]}`],[!0]),!1,!0)+">&#x203A;</span>"),n+="</div>")}}.call(this),n+="</div>"}.call(this,"menuItems"in o?o.menuItems:"undefined"!=typeof menuItems?menuItems:void 0,"style"in o?o.style:"undefined"!=typeof style?style:void 0),n}},55:(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return Array.isArray(e)?function(e,t){for(var n,r="",i="",a=Array.isArray(t),s=0;s<e.length;s++)(n=o(e[s]))&&(a&&t[s]&&(n=c(n)),r=r+i+n,i=" ");return r}(e,t):e&&"object"==typeof e?function(e){var t="",n="";for(var o in e)o&&e[o]&&r.call(e,o)&&(t=t+n+o,n=" ");return t}(e):e||""}function i(e){if(!e)return"";if("object"==typeof e){var t="";for(var n in e)r.call(e,n)&&(t=t+n+":"+e[n]+";");return t}return e+""}function a(e,t,n,r){if(!1===t||null==t||!t&&("class"===e||"style"===e))return"";if(!0===t)return" "+(r?e:e+'="'+e+'"');var o=typeof t;return"object"!==o&&"function"!==o||"function"!=typeof t.toJSON||(t=t.toJSON()),"string"==typeof t||(t=JSON.stringify(t),n||-1===t.indexOf('"'))?(n&&(t=c(t))," "+e+'="'+t+'"'):" "+e+"='"+t.replace(/'/g,"&#39;")+"'"}t.merge=function e(t,n){if(1===arguments.length){for(var r=t[0],o=1;o<t.length;o++)r=e(r,t[o]);return r}for(var a in n)if("class"===a){var s=t[a]||[];t[a]=(Array.isArray(s)?s:[s]).concat(n[a]||[])}else if("style"===a){s=(s=i(t[a]))&&";"!==s[s.length-1]?s+";":s;var c=i(n[a]);c=c&&";"!==c[c.length-1]?c+";":c,t[a]=s+c}else t[a]=n[a];return t},t.classes=o,t.style=i,t.attr=a,t.attrs=function(e,t){var n="";for(var s in e)if(r.call(e,s)){var c=e[s];if("class"===s){n=a(s,c=o(c),!1,t)+n;continue}"style"===s&&(c=i(c)),n+=a(s,c,!1,t)}return n};var s=/["&<>]/;function c(e){var t=""+e,n=s.exec(t);if(!n)return e;var r,o,i,a="";for(r=n.index,o=0;r<t.length;r++){switch(t.charCodeAt(r)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}o!==r&&(a+=t.substring(o,r)),o=r+1,a+=i}return o!==r?a+t.substring(o,r):a}t.escape=c,t.rethrow=function e(t,r,o,i){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&r||i))throw t.message+=" on line "+o,t;var a,s,c,l;try{i=i||n(835).readFileSync(r,{encoding:"utf8"}),a=3,s=i.split("\n"),c=Math.max(o-a,0),l=Math.min(s.length,o+a)}catch(n){return t.message+=" - could not read from "+r+" ("+n.message+")",void e(t,null,o)}a=s.slice(c,l).map((function(e,t){var n=t+c+1;return(n==o?" > ":" ")+n+"| "+e})).join("\n"),t.path=r;try{t.message=(r||"Pug")+":"+o+"\n"+a+"\n\n"+t.message}catch(e){}throw t}},379:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],s=0;s<e.length;s++){var c=e[s],l=r.base?c[0]+r.base:c[0],u=i[l]||0,p="".concat(l," ").concat(u);i[l]=u+1;var f=n(p),m={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==f)t[f].references++,t[f].updater(m);else{var d=o(m,r);r.byIndex=s,t.splice(s,0,{identifier:p,updater:d,references:1})}a.push(p)}return a}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var s=n(i[a]);t[s].references--}for(var c=r(e,o),l=0;l<i.length;l++){var u=n(i[l]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}i=c}}},569:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},216:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},565:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},795:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},835:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var r={};return(()=>{"use strict";n.d(r,{default:()=>j});var e=n(856),t=n(379),o=n.n(t),i=n(795),a=n.n(i),s=n(569),c=n.n(s),l=n(565),u=n.n(l),p=n(216),f=n.n(p),m=n(589),d=n.n(m),h=n(550),y={};y.styleTagTransform=d(),y.setAttributes=u(),y.insert=c().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=f(),o()(h.Z,y);const g=h.Z&&h.Z.locals?h.Z.locals:void 0;var v,b,x,T,w,k,N,S,E,M,A,C,O,L,_,I,D=n(138),R=n.n(D),H=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class z{constructor(){v.add(this),b.set(this,{style:g,menuItems:[]}),x.set(this,{transformOrigin:["top","left"]}),T.set(this,{theme:"black",transitionDuration:200,normalizePosition:!0}),this.options={},w.set(this,(t=>t.map((t=>("object"==typeof t&&t.hasOwnProperty("iconHTML")&&(t.iconHTML=(0,e.sanitize)(t.iconHTML)),t))))),this.applyStyleOnContextMenu=(e,t,n)=>{e.style.transitionDuration=`${this.options.transitionDuration}ms`;const r=Array.from(this.options.transformOrigin);t&&(r[1]="right"),n&&(r[0]="bottom"),e.style.transformOrigin=r.join(" "),this.options.customThemeClass?e.classList.add(this.options.customThemeClass):e.classList.add(g[`context-menu--${this.options.theme}-theme`]),this.options.customClass&&e.classList.add(this.options.customClass)},this.buildContextMenu=()=>{const e=document.createElement("div");return e.innerHTML=R()(H(this,b,"f")),e.children[0]},this.getNormalizedPosition=(e,t,n)=>{let r=e,o=t;if(this.options.normalizePosition){const i=function(e,t,n){const{x:r,y:o}=e,{left:i,top:a}=n.getBoundingClientRect(),s=o-a,c=r-i+t.clientWidth>n.clientWidth,l=s+t.clientHeight>n.clientHeight;let u=r,p=o;return c&&(u=i+n.clientWidth-t.clientWidth),l&&(p=a+n.clientHeight-t.clientHeight),{normalizedX:u,normalizedY:p}}({x:e,y:t},n,this.options.scope);r=i.normalizedX,o=i.normalizedY}return{normalizedX:r,normalizedY:o}}}updateOptions(e){const t=H(this,w,"f").call(this,e.menuItems),n=H(this,v,"m",k).call(this,t);H(this,v,"m",N).call(this,n),Object.assign(this.options,H(this,T,"f")),Object.assign(this.options,Object.assign(Object.assign({},e),{menuItems:n})),Object.assign(this.options,H(this,x,"f")),H(this,b,"f").menuItems=this.options.menuItems}}b=new WeakMap,x=new WeakMap,T=new WeakMap,w=new WeakMap,v=new WeakSet,k=function(e){return e.filter((e=>"object"==typeof e&&e.hasOwnProperty("nestedMenu"))).map((e=>{const t=e.callback;e.callback=n=>{t&&t(n),new F(Object.assign(Object.assign({},this.options),{menuItems:e.nestedMenu}),n,document.getElementById(`context-menu-item-${e._id}`))}})),e},N=function e(t){t.filter((e=>"object"==typeof e)).forEach(((t,n)=>{t._id=Date.now()+n,t.nestedMenu&&H(this,v,"m",e).call(this,t.nestedMenu)}))};class F extends z{constructor(e,t,n){super(),S.add(this),E.set(this,(()=>{var e;null===(e=document.querySelector(`.${g["context-menu"]}.nested-context-menu`))||void 0===e||e.remove()})),M.set(this,(e=>{this.options.menuItems.forEach(((t,n)=>{"hr"!==t&&t.callback&&(e.children[n].onclick=()=>{var e,n,r;t.callback(this.initialContextMenuEvent),null!==(n=null!==(e=t.preventCloseOnClick)&&void 0!==e?e:this.options.preventCloseOnClick)&&void 0!==n&&n||(H(this,E,"f").call(this),null===(r=document.querySelector(`.${g["context-menu"]}`))||void 0===r||r.remove())})}))})),this.updateOptions(e),H(this,S,"m",A).call(this,t,n)}}E=new WeakMap,M=new WeakMap,S=new WeakSet,A=function(e,t){this.initialContextMenuEvent=e,H(this,E,"f").call(this);const n=this.buildContextMenu();n.classList.add("nested-context-menu"),document.querySelector("body").append(n),this.applyStyleOnContextMenu(n,!1,!1);const{x:r,y:o}=t.getBoundingClientRect();let{normalizedX:i,normalizedY:a}=this.getNormalizedPosition(r,o,n);i+=n.clientWidth,n.style.top=`${a}px`,n.style.left=`${i}px`,n.oncontextmenu=e=>e.preventDefault(),H(this,M,"f").call(this,n),setTimeout((()=>{n.classList.add(g.visible)}))};class j extends z{constructor(e){super(),C.set(this,(()=>{var e;H(this,O,"f").call(this),null===(e=document.querySelector(`.${g["context-menu"]}`))||void 0===e||e.remove()})),O.set(this,(()=>{document.querySelectorAll(`.${g["context-menu"]}.nested-context-menu`).forEach((e=>e.remove()))})),L.set(this,(e=>{this.options.menuItems.forEach(((t,n)=>{"hr"!==t&&t.callback&&(e.children[n].onclick=()=>{var e,n;t.callback(this.initialContextMenuEvent),null!==(n=null!==(e=t.preventCloseOnClick)&&void 0!==e?e:this.options.preventCloseOnClick)&&void 0!==n&&n||H(this,C,"f").call(this)})}))})),_.set(this,(e=>{e.preventDefault(),e.stopPropagation(),this.initialContextMenuEvent=e,H(this,C,"f").call(this);const t=this.buildContextMenu();document.querySelector("body").append(t);const{clientX:n,clientY:r}=e,{normalizedX:o,normalizedY:i}=this.getNormalizedPosition(n,r,t);t.style.top=`${i}px`,t.style.left=`${o}px`,this.applyStyleOnContextMenu(t,n!==o,r!==i),t.oncontextmenu=e=>e.preventDefault(),H(this,L,"f").call(this,t),setTimeout((()=>{t.classList.add(g.visible)}))})),I.set(this,(e=>{e.target.closest(`.${g["context-menu"]}`)||H(this,C,"f").call(this)})),this.updateOptions(e),this.options.scope.oncontextmenu=H(this,_,"f"),document.addEventListener("click",H(this,I,"f"))}off(){document.removeEventListener("click",H(this,I,"f")),this.options.scope.oncontextmenu=null}close(){H(this,C,"f").call(this)}}C=new WeakMap,O=new WeakMap,L=new WeakMap,_=new WeakMap,I=new WeakMap})(),r.default})()));