mcanoglu/cwe-class-group huggingface dataset:
mxEvent.getClientX(za);I.popupMenuHandler.hideMenu();mxEvent.consume(za)});mxEvent.addGestureListeners(document.body,null,function(za){var wa=!1;null!=Ma&&(U.diagramContainer.style.width=Math.max(20,Qa+mxEvent.getClientX(za)-Ma)+"px",wa=!0);null!=Oa&&(U.diagramContainer.style.height=Math.max(20,Ta+mxEvent.getClientY(za)-Oa)+"px",wa=!0);wa&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:U.diagramContainer.getBoundingClientRect()}),
"*"),Z(),U.refresh())},function(za){null==Ma&&null==Oa||mxEvent.consume(za);Oa=Ma=null});this.diagramContainer.style.borderRadius="4px";document.body.style.backgroundColor="transparent";U.bottomResizer.style.visibility="hidden";U.rightResizer.style.visibility="hidden";P.style.visibility="hidden";W.style.visibility="hidden";S.style.display="none"}"1"==urlParams.prefetchFonts&&U.editor.loadFonts()}}};

// Vulnerability class: CWE-20
function(c,e){if(Graph.isPageLink(e)){var g=c[e.substring(e.indexOf(",")+1)];e=null!=g?"data:page/id,"+g:null}else if("data:action/json,"==e.substring(0,17))try{var k=JSON.parse(e.substring(17));if(null!=k.actions){for(var m=0;m<k.actions.length;m++){var q=k.actions[m];if(null!=q.open&&Graph.isPageLink(q.open)){var v=q.open.substring(q.open.indexOf(",")+1);g=c[v];null!=g?q.open="data:page/id,"+g:null==this.getPageById(v)&&delete q.open}}e="data:action/json,"+JSON.stringify(k)}}catch(x){}return e};

// Vulnerability class: CWE-20
v.apply(this,arguments)};m.getLinkForCell=function(){return null};var x=m.view.getState(q);k=m.getAllConnectionConstraints(x);for(var A=0;null!=k&&A<k.length;A++){var z=m.getConnectionPoint(x,k[A]);t(z.x-3,z.y-3)}m.fit(8);m.center();A=mxUtils.button("",function(){m.zoomIn()});A.className="geSprite geSprite-zoomin";A.setAttribute("title",mxResources.get("zoomIn"));A.style.position="relative";A.style.outline="none";A.style.border="none";A.style.margin="2px";A.style.cursor="pointer";A.style.top=mxClient.IS_FF?

// Vulnerability class: CWE-20
'binary+': function(left, right, context) {
    return function(scope, locals, assign, inputs) {
      var lhs = left(scope, locals, assign, inputs);
      var rhs = right(scope, locals, assign, inputs);
      var arg = plusFn(lhs, rhs);
      return context ? {value: arg} : arg;
    };
  },

// Vulnerability class: CWE-74
NewListFromSelection.prototype.convertToAddToList = function (listId, dialogState) {
    var that = this;
    var addToList = this.massActionsManager.massActionObjects['addToList'];
    var newListName = this.dialogElem$.find ('.new-list-name');
    var listName = $(newListName).val ();
    addToList.addListOption (listId, listName);
    addToList.setListId (listId);
    addToList.progressBar = this.progressBar;
    addToList.recordCount = this.recordCount;
    dialogState.superExecuteParams.listId = listId;
    dialogState.superExecuteParams.massAction = addToList.massActionName;

    return addToList;
};

// Vulnerability class: CWE-20
mxResources.get("pageWithNumber",[k+1]));m.setAttribute("value","data:page/id,"+b.pages[k].getId());b.pages[k]==b.currentPage&&m.setAttribute("disabled","disabled");null!=l&&l.originalSrc==m.getAttribute("value")&&(m.setAttribute("selected","selected"),u=!0);g.appendChild(m)}t||null!=b.pages&&1!=b.pages.length||(D.style.display="none",c.style.display="none",g.style.display="none");var q=document.createElement("option"),v=!1,x=!1,A=function(y,K){v||null!=y&&x||(c.checked?null!=K&&K(q.selected?null:
g.value):""==e.value||b.isOffline()?(L.value="",M.value="",null!=K&&K("")):(e.value=mxUtils.trim(e.value),b.loadImage(e.value,function(B){L.value=B.width;M.value=B.height;null!=K&&K(e.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));L.value="";M.value="";null!=K&&K(null)})))},z=mxUtils.bind(this,function(y){b.importFiles(y,0,0,b.maxBackgroundSize,function(K,B,F,G,N,J){e.value=K;A();e.focus()},function(){},function(K){return"image/"==K.type.substring(0,

// Vulnerability class: CWE-20
this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.window.setVisible(!1),this.menus.findReplaceWindow.window.destroy(),this.menus.findReplaceWindow=null);G.apply(this,arguments)};var aa=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(O){aa.apply(this,arguments);if(O){var X=window.innerWidth||
document.documentElement.clientWidth||document.body.clientWidth;1E3<=X&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=X||"1"==urlParams.sketch)&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var da=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=

// Vulnerability class: CWE-20
var M=mxText.prototype.redraw;mxText.prototype.redraw=function(){M.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(p,C,I){function T(){for(var la=R.getSelectionCells(),Aa=[],Fa=0;Fa<la.length;Fa++)R.isCellVisible(la[Fa])&&Aa.push(la[Fa]);R.setSelectionCells(Aa)}function P(la){R.hiddenTags=la?[]:Y.slice();T();R.refresh()}function O(la,Aa){ha.innerHTML="";if(0<la.length){var Fa=document.createElement("table");

// Vulnerability class: CWE-20
"6px";this.editor.fireEvent(new mxEventObject("statusChanged"))}};var x=Sidebar.prototype.getTooltipOffset;Sidebar.prototype.getTooltipOffset=function(C,D){if(null==this.editorUi.sidebarWindow||mxUtils.isAncestorNode(this.editorUi.picker,C)){var G=mxUtils.getOffset(this.editorUi.picker);G.x+=this.editorUi.picker.offsetWidth+4;G.y+=C.offsetTop-D.height/2+16;return G}var P=x.apply(this,arguments);G=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);P.x+=G.x-16;P.y+=G.y;return P};var y=Menus.prototype.createPopupMenu;

// Vulnerability class: CWE-20
function(c){var e=c.msgMarkers,g=this.remoteInvokeCallbacks[e.callbackId];if(null==g)throw Error("No callback for "+(null!=e?e.callbackId:"null"));c.error?g.error&&g.error(c.error.errResp):g.callback&&g.callback.apply(this,c.resp);this.remoteInvokeCallbacks[e.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,e,g,k,m){var q=!0,v=window.setTimeout(mxUtils.bind(this,function(){q=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),x=mxUtils.bind(this,function(){window.clearTimeout(v);

// Vulnerability class: CWE-20
L.value=null==l||t?"":l.width;d.appendChild(L);mxUtils.write(d,mxResources.get("height")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.width="60px";M.style.marginLeft="8px";M.style.marginRight="16px";M.value=null==l||t?"":l.height;d.appendChild(M);mxUtils.br(d);mxUtils.br(d);mxEvent.addListener(e,"change",A);ImageDialog.filePicked=function(y){y.action==google.picker.Action.PICKED&&null!=y.docs[0].thumbnails&&(y=y.docs[0].thumbnails[y.docs[0].thumbnails.length-1],
null!=y&&(e.value=y.url,A()));e.focus()};d.appendChild(c);d.appendChild(g);mxUtils.br(d);t?(c.setAttribute("checked","checked"),c.checked=!0):(D.setAttribute("checked","checked"),D.checked=!0);!u&&c.checked&&(mxUtils.write(q,mxResources.get("pageNotFound")),q.setAttribute("disabled","disabled"),q.setAttribute("selected","selected"),q.setAttribute("value","pageNotFound"),g.appendChild(q),mxEvent.addListener(g,"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)}));l=document.createElement("div");

// Vulnerability class: CWE-20
"4px";pa.style.margin="2px";pa.style.border="1px solid black";pa.style.background=ta&&"none"!=ta?ta:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(Z,function(sa){this.editorUi.pickColor(ta,function(ya){pa.style.background="none"==ya?"url('"+Dialog.prototype.noColorImage+"')":ya;T(za,ya,ka)});mxEvent.consume(sa)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(pa);return btn}function R(za,ta,ka,pa,sa,ya,va){null!=ta&&(ta=ta.split(","),
aa.push({name:za,values:ta,type:ka,defVal:pa,countProperty:sa,parentRow:ya,isDeletable:!0,flipBkg:va}));btn=mxUtils.button("+",mxUtils.bind(Z,function(ra){for(var wa=ya,fa=0;null!=wa.nextSibling;)if(wa.nextSibling.getAttribute("data-pName")==za)wa=wa.nextSibling,fa++;else break;var ca={type:ka,parentRow:ya,index:fa,isDeletable:!0,defVal:pa,countProperty:sa};fa=ha(za,"",ca,0==fa%2,va);T(za,pa,ca);wa.parentNode.insertBefore(fa,wa.nextSibling);mxEvent.consume(ra)}));btn.style.height="16px";btn.style.width=
"25px";btn.className="geColorBtn";return btn}function Y(za,ta,ka,pa,sa,ya,va){if(0<sa){var ra=Array(sa);ta=null!=ta?ta.split(","):[];for(var wa=0;wa<sa;wa++)ra[wa]=null!=ta[wa]?ta[wa]:null!=pa?pa:"";aa.push({name:za,values:ra,type:ka,defVal:pa,parentRow:ya,flipBkg:va,size:sa})}return document.createElement("div")}function da(za,ta,ka){var pa=document.createElement("input");pa.type="checkbox";pa.checked="1"==ta;mxEvent.addListener(pa,"change",function(){T(za,pa.checked?"1":"0",ka)});return pa}function ha(za,

// Vulnerability class: CWE-20
document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?D.removeAttribute("disabled"):(D.checked=!1,D.setAttribute("disabled","disabled"))):l.container.focus()}));this.window.setLocation=function(U,X){var u=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;U=Math.max(0,Math.min(U,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));X=Math.max(0,Math.min(X,u-this.table.clientHeight-("1"==
urlParams.sketch?3:48)));this.getX()==U&&this.getY()==X||mxWindow.prototype.setLocation.apply(this,arguments)};var W=mxUtils.bind(this,function(){var U=this.window.getX(),X=this.window.getY();this.window.setLocation(U,X)});mxEvent.addListener(window,"resize",W);this.destroy=function(){mxEvent.removeListener(window,"resize",W);this.window.destroy()}},FreehandWindow=function(b,e,f,c,m,n){var v=b.editor.graph;b=document.createElement("div");b.style.textAlign="center";b.style.userSelect="none";b.style.overflow=

// Vulnerability class: CWE-20
!0,d=JSON.parse(this.getPersistentToken(!0));null!=d?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(g){200<=g.getStatus()&&299>=g.getStatus()?this.updateAuthInfo(JSON.parse(g.getText()),d.remember,!1,f,c):(this.clearPersistentToken(),this.setUser(null),b=null,401!=g.getStatus()||m?c({message:mxResources.get("accessDenied"),retry:n}):n())}),c):this.ui.showAuthDialog(this,

// Vulnerability class: CWE-20
(ma=ka[ja],null==ma&&(ma={},ka[ja]=ma),ja=ma[ba],null==ja&&(ja=[],ma[ba]=ja),ja.push(ia))}fa=fa.nextSibling}G(ta,pa,va)}})}function J(fa){D&&(Aa.scrollTop=0,aa.innerHTML="",Ea.spin(aa),V=!1,W=!0,ua.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),da=null,D(ra,function(){A(mxResources.get("cannotLoad"));ra([])},fa?null:t))}function E(fa){if(""==fa)null!=p&&(p.click(),p=null);else{if(null==TemplatesDialog.tagsList[d]){var ca={};for(Ja in ta)for(var ba=ta[Ja],ja=0;ja<ba.length;ja++){var ia=

// Vulnerability class: CWE-20
function forEach(obj, iterator, context) {
  var key, length;
  if (obj) {
    if (isFunction(obj)) {
      for (key in obj) {
        if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {
          iterator.call(context, obj[key], key, obj);
        }
      }
    } else if (isArray(obj) || isArrayLike(obj)) {
      var isPrimitive = typeof obj !== 'object';
      for (key = 0, length = obj.length; key < length; key++) {
        if (isPrimitive || key in obj) {
          iterator.call(context, obj[key], key, obj);
        }
      }
    } else if (obj.forEach && obj.forEach !== forEach) {
        obj.forEach(iterator, context, obj);
    } else if (isBlankObject(obj)) {
      // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
      for (key in obj) {
        iterator.call(context, obj[key], key, obj);
      }
    } else if (typeof obj.hasOwnProperty === 'function') {
      // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed
      for (key in obj) {
        if (obj.hasOwnProperty(key)) {
          iterator.call(context, obj[key], key, obj);
        }
      }
    } else {
      // Slow path for objects which do not have a method `hasOwnProperty`
      for (key in obj) {
        if (hasOwnProperty.call(obj, key)) {
          iterator.call(context, obj[key], key, obj);
        }
      }
    }
  }
  return obj;
}

// Vulnerability class: CWE-74
X){null!=X.shortcut&&900>n&&!mxClient.IS_IOS?O.firstChild.nextSibling.setAttribute("title",X.shortcut):m.apply(this,arguments)};var q=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){q.apply(this,arguments);if(null!=this.userElement){var O=this.userElement;O.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+O.style.display;O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage="url("+Editor.userImage+")";O.style.backgroundPosition="center center";
O.style.backgroundRepeat="no-repeat";O.style.backgroundSize="24px 24px";O.style.height="24px";O.style.width="24px";O.style.cssFloat="right";O.setAttribute("title",mxResources.get("changeUser"));if("none"!=O.style.display){O.style.display="inline-block";var X=this.getCurrentFile();if(null!=X&&X.isRealtimeEnabled()&&X.isRealtimeSupported()){var ea=document.createElement("img");ea.setAttribute("border","0");ea.style.position="absolute";ea.style.left="18px";ea.style.top="2px";ea.style.width="12px";ea.style.height=
"12px";ea.style.cursor="default";var ka=X.getRealtimeError(),ja=X.getRealtimeState();X=mxResources.get("realtimeCollaboration");1==ja?(ea.src=Editor.syncImage,X+=" ("+mxResources.get("online")+")"):(ea.src=Editor.syncProblemImage,X=null!=ka&&null!=ka.message?X+(" ("+ka.message+")"):X+(" ("+mxResources.get("disconnected")+")"));mxEvent.addListener(ea,"click",mxUtils.bind(this,function(U){this.showError(mxResources.get("realtimeCollaboration"),mxUtils.htmlEntities(1==ja?mxResources.get("online"):null!=
ka&&null!=ka.message?ka.message:mxResources.get("disconnected")));mxEvent.consume(U)}));ea.setAttribute("title",X);O.style.paddingRight="4px";O.appendChild(ea)}}}};var y=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){y.apply(this,arguments);if(null!=this.shareButton){var O=this.shareButton;O.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage=

// Vulnerability class: CWE-20
C=new mxAsyncCanvas(this.thumbImageCache);L.images=this.thumbImageCache.images;var D=new mxImageExport;D.drawShape=function(G,P){G.shape instanceof mxShape&&G.shape.checkBounds()&&(P.save(),P.translate(.5,.5),G.shape.paint(P),P.translate(-.5,-.5),P.restore())};D.drawText=function(G,P){};D.drawState(v.getView().getState(v.model.root),C);C.finish(mxUtils.bind(this,function(){try{D.drawState(v.getView().getState(v.model.root),L),v!=this.editor.graph&&null!=v.container.parentNode&&v.container.parentNode.removeChild(v.container)}catch(G){p=

// Vulnerability class: CWE-20
window.parent;q="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";v.postMessage(q,"*");if("json"==urlParams.proto){var x=this.editor.graph.openLink;this.editor.graph.openLink=function(A,z,L){x.apply(this,arguments);v.postMessage(JSON.stringify({event:"openLink",href:A,target:z,allowOpener:L}),"*")}}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar&&"1"!=urlParams.embedInline){var c=document.createElement("div");c.style.display="inline-block";c.style.position=

// Vulnerability class: CWE-20
E="")}null==J&&(J=Editor.extractGraphModelFromXref(Q));null!=J&&(J=decodeURIComponent(J.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return J};Editor.extractGraphModelFromXref=function(u){var E=u.trailer,J=null;null!=E&&(E=/.* \/Info (\d+) (\d+) R/g.exec(E.join("\n")),null!=E&&0<E.length&&(E=u[E[1]],null!=E&&(E=/.* \/Subject (\d+) (\d+) R/g.exec(E.join("\n")),null!=E&&0<E.length&&(u=u[E[1]],null!=u&&(u=u.join("\n"),J=u.substring(1,u.length-1))))));return J};Editor.extractParserError=function(u,E){var J=

// Vulnerability class: CWE-20
[H],"{1} ago"));E.setAttribute("title",J.toLocaleDateString()+" "+J.toLocaleTimeString())}function g(J){var E=document.createElement("img");E.className="geCommentBusyImg";E.src=IMAGE_PATH+"/spin.gif";J.appendChild(E);J.busyImg=E}function k(J){J.style.border="1px solid red";J.removeChild(J.busyImg)}function m(J){J.style.border="";J.removeChild(J.busyImg)}function q(J,E,H,S,U){function Q(P,O,R){var Y=document.createElement("li");Y.className="geCommentAction";var da=document.createElement("a");da.className=
"geCommentActionLnk";mxUtils.write(da,P);Y.appendChild(da);mxEvent.addListener(da,"click",function(ha){O(ha,J);ha.preventDefault();mxEvent.consume(ha)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function P(Y){O.push(R);if(null!=Y.replies)for(var da=0;da<Y.replies.length;da++)R=R.nextSibling,P(Y.replies[da])}var O=[],R=X;P(J);return{pdiv:R,replies:O}}function V(P,O,R,Y,da){function ha(){g(ua);J.addReply(aa,function(la){aa.id=la;J.replies.push(aa);m(ua);R&&R()},function(la){Z();k(ua);

// Vulnerability class: CWE-20
function(K){var F=x.length;if(1===F%2||F>=f){var H=0,S=0,V,M=0;for(V=K;V<F;V++)M++,K=x[V],H+=K.x,S+=K.y;return{x:H/M,y:S/M}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(M,W){if(!P){var U=e.file.getCurrentUser();if(G&&null!=U&&null!=U.email&&(W=JSON.stringify({from:z,id:A,type:M,sessionId:e.clientId,userId:U.id,username:U.displayName,data:W,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION}),K&&"cursor"!=M&&EditorUi.debug("P2PCollab: sending to socket server",[W]),A++,M=!K&&("cursor"==M||"selectionChange"==M),D&&!M&&V("message",W),M))for(p2pId in C)C[p2pId].send(W)}}function m(M){if(b.shareCursorPosition&&!l.isMouseDown){var W=

// Vulnerability class: CWE-20
k.scrollHeight-k.offsetHeight&&D()},mxEvent.addListener(k,"scroll",B))}}),y)});p.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(k,mxResources.get("loading"));var t=mxUtils.bind(this,function(z){var L=this.ui.spinner,C=0;this.ui.spinner.stop();var D=function(){L.spin(k,mxResources.get("loading"));C+=1},G=function(){--C;0===C&&L.stop()};null==z&&(k.innerHTML="",z=1);null!=B&&(mxEvent.removeListener(k,"scroll",B),B=null);null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A);A=document.createElement("a");

// Vulnerability class: CWE-20
function removeDir (pkg, log, next) {
  var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES')

  move(path.join(pkg.path, 'node_modules'), modpath).then(unbuildPackage, unbuildPackage)

  function unbuildPackage (moveEr) {
    rimraf(pkg.path, moveEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack)
  }

  function andRemoveEmptyParents (path) {
    return function (er) {
      if (er) return next(er)
      removeEmptyParents(pkg.path)
    }
  }

  function moveModulesBack () {
    fs.readdir(modpath, makeTarget)
  }

  function makeTarget (readdirEr, files) {
    if (readdirEr) return cleanup()
    if (!files.length) return cleanup()
    correctMkdir(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) })
  }

  function moveModules (mkdirEr, files) {
    if (mkdirEr) return next(mkdirEr)
    asyncMap(files, function (file, done) {
      var from = path.join(modpath, file)
      var to = path.join(pkg.path, 'node_modules', file)
      // we ignore errors here, because they can legitimately happen, for instance,
      // bundled modules will be in both node_modules folders
      move(from, to).then(andIgnoreErrors(done), andIgnoreErrors(done))
    }, cleanup)
  }

  function cleanup () {
    rimraf(modpath, afterCleanup)
  }

  function afterCleanup (rimrafEr) {
    if (rimrafEr) log.warn('remove', rimrafEr)
    removeEmptyParents(path.resolve(pkg.path, '..'))
  }

  function removeEmptyParents (pkgdir) {
    fs.rmdir(pkgdir, function (er) {
      // FIXME: Make sure windows does what we want here
      if (er && er.code !== 'ENOENT') return next()
      removeEmptyParents(path.resolve(pkgdir, '..'))
    })
  }
}

// Vulnerability class: CWE-732
function timezoneToOffset(timezone, fallback) {
  // IE/Edge do not "understand" colon (`:`) in timezone
  timezone = timezone.replace(ALL_COLONS, '');
  var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
  return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}

// Vulnerability class: CWE-74
mxResources.get(Qa);null==Ma&&(Ma=Qa.substring(0,1).toUpperCase()+Qa.substring(1));Qa=Ma+" ("+Ya.length+")";var Ta=Ma=mxUtils.htmlEntities(Ma);15<Ma.length&&(Ma=Ma.substring(0,15)+"&hellip;");return{lbl:Ma+" ("+Ya.length+")",fullLbl:Qa,lblOnly:Ta}}function ia(Qa,Ya,Ma,Ta,Ua){mxEvent.addListener(Ma,"click",function(){X!=Ma&&(null!=X?(X.style.fontWeight="normal",X.style.textDecoration="none"):(ra.style.display="none",Ha.style.minHeight="100%"),X=Ma,X.style.fontWeight="bold",X.style.textDecoration="underline",
Ba.scrollTop=0,W&&(U=!0),va.innerHTML=Ya,ja.style.display="none",C(Ua?da[Qa]:Ta?ka[Qa][Ta]:ha[Qa],Ua?!1:!0))})}var ma=M.querySelector(".geTemplatesList");if(0<ca){ca=document.createElement("div");ca.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;margin-top: 10px;";mxUtils.write(ca,mxResources.get("custom"));ma.appendChild(ca);for(var qa in da){ca=document.createElement("div");var pa=da[qa];pa=la(qa,pa);ca.className="geTemplateCatLink";ca.setAttribute("title",

// Vulnerability class: CWE-20
this.handleError(J)}return x};EditorUi.prototype.updatePageLinks=function(c,e){for(var g=0;g<e.length;g++)this.updatePageLinksForCell(c,e[g].root),null!=e[g].viewState&&this.updateBackgroundPageLink(c,e[g].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,e){try{if(null!=e&&Graph.isPageLink(e.originalSrc)){var g=c[e.originalSrc.substring(e.originalSrc.indexOf(",")+1)];null!=g&&(e.originalSrc="data:page/id,"+g)}}catch(k){}};EditorUi.prototype.updatePageLinksForCell=

// Vulnerability class: CWE-20
async function httpProxy (fastify, opts) {
  if (!opts.upstream) {
    throw new Error('upstream must be specified')
  }

  const preHandler = opts.preHandler || opts.beforeHandler
  const rewritePrefix = opts.rewritePrefix || ''

  const fromOpts = Object.assign({}, opts)
  fromOpts.base = opts.upstream
  fromOpts.prefix = undefined

  const oldRewriteHeaders = (opts.replyOptions || {}).rewriteHeaders
  const replyOpts = Object.assign({}, opts.replyOptions, {
    rewriteHeaders
  })
  fromOpts.rewriteHeaders = rewriteHeaders

  fastify.register(From, fromOpts)

  if (opts.proxyPayloads !== false) {
    fastify.addContentTypeParser('application/json', bodyParser)
    fastify.addContentTypeParser('*', bodyParser)
  }

  function rewriteHeaders (headers) {
    const location = headers.location
    if (location) {
      headers.location = location.replace(rewritePrefix, fastify.prefix)
    }
    if (oldRewriteHeaders) {
      headers = oldRewriteHeaders(headers)
    }
    return headers
  }

  function bodyParser (req, payload, done) {
    done(null, payload)
  }

  fastify.route({
    url: '/',
    method: httpMethods,
    preHandler,
    config: opts.config || {},
    handler
  })
  fastify.route({
    url: '/*',
    method: httpMethods,
    preHandler,
    config: opts.config || {},
    handler
  })

  function handler (request, reply) {
    let dest = request.raw.url
    dest = dest.replace(this.prefix, rewritePrefix)
    reply.from(dest || '/', replyOpts)
  }

  if (opts.websocket) {
    setupWebSocketProxy(fastify, opts)
  }
}

// Vulnerability class: CWE-20
export default function parseUrl(href, part, parseQuery) {
    href = String(href);
    var match = href.match(_parse_url_exp)
        , map = _parse_url_map
        , i, ret = false
        ;
    if (match) {
        if (part && part in map) {
            ret = match[map[part]] || NIL;
            if (part == 'pathname') {
                if (!ret) ret = '/';
            }
            if (parseQuery && part == 'query') {
                ret = toObject(ret || NIL);
            }
        }
        else {
            let _ = this;
            if(typeof _ != 'function') {
                _ = typeof URL == 'function' && URL.createObjectURL ? URL : Object;
                ret = new _(href);
                // ret.toString = function _uri_to_string_() {
                //     return fromLocation(this);
                // };
            }
            else {
                ret = new _(); // URLJS() constructor?
            }

            for (i in map) if (map.hasOwnProperty(i)) {
                ret[i] = match[map[i]] || NIL;
            }
            if (part && part in ret) return ret[part];

            if (!ret.pathname) ret.pathname = '/';
            if (!ret.path) ret.path = ret.pathname + ret.search;
            if (!ret.origin) ret.origin = ret.protocol + '//' + ret.host;
            if (!ret.domain) ret.domain = getDomainName(ret.hostname);
            if (parseQuery) ret.query = toObject(ret.query || NIL);
            if (!ret.origin) ret.href = String(href); // ??? may need some parse

            if (part) ret = ret[part];
        }
    }
    return ret;
}

// Vulnerability class: CWE-20
640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(c,e){for(var g=this.editor.graph,k=g.getSelectionCells(),m=0;m<c.length;m++){var q=new window[c[m].layout](g);if(null!=c[m].config)for(var v in c[m].config)q[v]=c[m].config[v];this.executeLayout(function(){q.execute(g.getDefaultParent(),0==k.length?null:k)},m==c.length-1,e)}};EditorUi.prototype.importCsv=function(c,e){try{var g=c.split("\n"),k=[],m=[],q=[],v={};if(0<g.length){var x={},

// Vulnerability class: CWE-20
!0));q.push(C)}this.updatePageLinks(d,q)}}if(null!=I&&"mxGraphModel"===I.nodeName){y=A.importGraphModel(I,g,k,l);if(null!=y)for(z=0;z<y.length;z++)this.updatePageLinksForCell(d,y[z]);var G=A.parseBackgroundImage(I.getAttribute("backgroundImage"));if(null!=G&&null!=G.originalSrc){this.updateBackgroundPageLink(d,G);var P=new ChangePageSetup(this,null,G);P.ignoreColor=!0;A.model.execute(P)}}x&&this.insertHandler(y,null,null,A.defaultVertexStyle,A.defaultEdgeStyle,!1,!0)}finally{A.model.endUpdate()}}}catch(K){if(p)throw K;
this.handleError(K)}return y};EditorUi.prototype.updatePageLinks=function(d,g){for(var k=0;k<g.length;k++)this.updatePageLinksForCell(d,g[k].root),null!=g[k].viewState&&this.updateBackgroundPageLink(d,g[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var k=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=k&&(g.originalSrc="data:page/id,"+k)}}catch(l){}};EditorUi.prototype.updatePageLinksForCell=

// Vulnerability class: CWE-20
success: function (response) {
            if (response.success) {
              // Check if on conversation
              var $convo = $('#message-content[data-conversation-id="' + response.conversation._id + '"]')
              if ($convo.length > 0) {
                History.pushState(null, null, '/messages', false)
              } else {
                var $convoLI = $('#convo-list').find('li[data-conversation-id="' + response.conversation._id + '"]')
                if ($convoLI.length > 0) {
                  $convoLI.remove()
                }
              }

              $.event.trigger('$trudesk:chat:conversation:deleted', {
                conversation: response.conversation
              })

              helpers.UI.showSnackbar('Conversation Deleted.', false)
            }
          },

// Vulnerability class: CWE-662
function addCustomDNS() {
  var ip = $("#ip").val();
  var domain = $("#domain").val();

  showAlert("info");
  $.ajax({
    url: "scripts/pi-hole/php/customdns.php",
    method: "post",
    dataType: "json",
    data: { action: "add", ip: ip, domain: domain, token: token },
    success: function (response) {
      if (response.success) {
        showAlert("success");
        table.ajax.reload();
      } else showAlert("error", response.message);
    },
    error: function () {
      showAlert("error", "Error while adding this custom DNS entry");
    }
  });
}

// Vulnerability class: CWE-862
Graph.compressNode(x))));c(v)}return m};EditorUi.prototype.anonymizeString=function(c,e){for(var g=[],k=0;k<c.length;k++){var m=c.charAt(k);0<=EditorUi.ignoredAnonymizedChars.indexOf(m)?g.push(m):isNaN(parseInt(m))?m.toLowerCase()!=m?g.push(String.fromCharCode(65+Math.round(25*Math.random()))):m.toUpperCase()!=m?g.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(m)?g.push(" "):g.push("?"):g.push(e?"0":Math.round(9*Math.random()))}return g.join("")};EditorUi.prototype.anonymizePatch=

// Vulnerability class: CWE-20
"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(u){var E=null;null!=u&&0<u.length&&("ER"==u.substring(0,2)?E="mxgraph.er":"sysML"==u.substring(0,5)&&(E="mxgraph.sysml"));return E};var V=mxMarker.createMarker;mxMarker.createMarker=

// Vulnerability class: CWE-20
V,X,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(W)+";"),M.setAttributeForCell(p,"plantUmlData",JSON.stringify({data:U,format:Q},null,2))}finally{M.getModel().endUpdate()}null!=p&&(M.setSelectionCell(p),M.scrollCellToVisible(p))},M=b.editor.graph,n="plantUmlTxt"==x?"txt":"plantUmlPng"==x?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==

// Vulnerability class: CWE-20
nonComputedMember: function(left, right, context, create) {
    return function(scope, locals, assign, inputs) {
      var lhs = left(scope, locals, assign, inputs);
      if (create && create !== 1) {
        if (lhs && lhs[right] == null) {
          lhs[right] = {};
        }
      }
      var value = lhs != null ? lhs[right] : undefined;
      if (context) {
        return {context: lhs, name: right, value: value};
      } else {
        return value;
      }
    };
  },

// Vulnerability class: CWE-74
O.scrollCellToVisible(O.getSelectionCell())}}}else{K=function(V){var M=H[V];null==M&&(M=new mxCell(V,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),M.vertex=!0,H[V]=M,z.push(M));return M};var H={};z=[];for(D=0;D<B.length;D++)if(";"!=B[D].charAt(0)){var S=B[D].split("->");2<=S.length&&(P=K(S[0]),F=K(S[S.length-1]),S=new mxCell(2<S.length?S[1]:"",new mxGeometry),S.edge=!0,P.insertEdge(S,!0),F.insertEdge(S,!1),z.push(S))}if(0<z.length){B=document.createElement("div");B.style.visibility="hidden";

// Vulnerability class: CWE-20
function(H,S,U,Q){var W=x.model,V=null;W.beginUpdate();try{if(V=y.apply(this,arguments),d(H))for(var X=0;X<V.length;X++)if(W.isEdge(V[X])&&null==W.getTerminal(V[X],!0)){W.setTerminal(V[X],H,!0);var p=x.getCellGeometry(V[X]);p.points=null;null!=p.getTerminalPoint(!0)&&p.setTerminalPoint(null,!0)}}finally{W.endUpdate()}return V}}var K={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},B=v.onKeyDown;v.onKeyDown=function(H){try{if(x.isEnabled()&&

// Vulnerability class: CWE-20
encodeURIComponent(K):"")+"&extras="+encodeURIComponent(JSON.stringify(y))+(0<v?"&dpi="+v:"")+"&bg="+(null!=k?k:"none")+"&w="+M+"&h="+n+"&border="+q+"&xml="+encodeURIComponent(z))})}else"png"==g?c.exportImage(m,null==k||"none"==k,!0,!1,!1,q,!0,!1,null,x,v):c.exportImage(m,!1,!0,!1,!1,q,!0,!1,"jpeg",x);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,e="";if(null!=this.pages)for(var g=
0;g<this.pages.length;g++){var k=c;this.currentPage!=this.pages[g]&&(k=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[g]),k.model.setRoot(this.pages[g].root));e+=this.pages[g].getName()+" "+k.getIndexableText()+" "}else e=c.getIndexableText();this.editor.graph.setEnabled(!0);return e};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var e={},g=document.createElement("div");g.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,mxUtils.htmlEntities(c));

// Vulnerability class: CWE-20
"pagecount"==F?null!=c.pages?c.pages.length:1:M.apply(this,arguments)};var n=e.labelLinkClicked;e.labelLinkClicked=function(F,G,N){var J=G.getAttribute("href");if(null==J||!e.isCustomLink(J)||!mxEvent.isTouchEvent(N)&&mxEvent.isPopupTrigger(N))n.apply(this,arguments);else{if(!e.isEnabled()||null!=F&&e.isCellLocked(F.cell))e.customLinkClicked(J),e.getRubberband().reset();mxEvent.consume(N)}};this.editor.getOrCreateFilename=function(){var F=c.defaultFilename,G=c.getCurrentFile();null!=G&&(F=null!=G.getTitle()?
G.getTitle():F);return F};var y=this.actions.get("print");y.setEnabled(!mxClient.IS_IOS||!navigator.standalone);y.visible=y.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(67,!0,"copyStyle",!0),this.keyHandler.bindAction(86,!0,"pasteStyle",!0),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(88,!0,"insertText",!0),this.keyHandler.bindAction(75,!0,"insertRectangle"),this.keyHandler.bindAction(75,

// Vulnerability class: CWE-20
b.setSelectionCells([F])}}for(F=0;F<m.length;F++)m[F].parentNode.removeChild(m[F]);c=null;m=[];v=[]}t(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(K,F){K=F.getProperty("eventName");F=F.getProperty("event");K==mxEvent.MOUSE_MOVE&&y&&(null!=F.sourceState&&F.sourceState.setCursor("crosshair"),F.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(K,F){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(K=F.getEvent(),y&&!mxEvent.isPopupTrigger(K)&&!mxEvent.isMultiTouchEvent(K))){var H=
parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);H=Math.max(1,H*b.view.scale);var S=C();c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("fill",O?S:"none");c.setAttribute("stroke",S);c.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(S=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",S=S.split(" ").map(function(V){return parseFloat(V)*H}).join(" "),c.setAttribute("stroke-dasharray",S));x=[];K=D(K);G(K);
n="M"+K.x+" "+K.y;v.push(K);d=[];c.setAttribute("d",O?PerfectFreehand.getSvgPathFromStroke([[K.x,K.y]],I):n);e.appendChild(c);F.consume()}}),mouseMove:mxUtils.bind(this,function(K,F){if(c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){K=F.getEvent();K=D(K);G(K);var H=P(0);if(H)if(v.push(H),O){var S=[];for(H=0;H<v.length;H++)S.push([v[H].x,v[H].y]);d=[];for(var V=2;V<x.length;V+=2)H=P(V),S.push([H.x,H.y]),d.push(H);c.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(S,I))}else{n+=" L"+

// Vulnerability class: CWE-20
consume: function(e1) {
    if (this.tokens.length === 0) {
      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
    }

    var token = this.expect(e1);
    if (!token) {
      this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
    }
    return token;
  },

// Vulnerability class: CWE-74
H+J));var S=(G.x-E)/N*100;N=100-(G.x+G.width-E)/N*100;E=(G.y-H)/J*100;G=100-(G.y+G.height-H)/J*100;return"inset("+mxUtils.format(E)+"% "+mxUtils.format(N)+"% "+mxUtils.format(G)+"% "+mxUtils.format(S)+"%"+(B?" round "+q+"%":F?" round 50%":"")+")"}function t(B){null!=k&&(!0!==B&&(k.model.setGeometry(v,m.clone()),q=5,n.value=q),k.model.setStyle(v,x+u()),k.selectAll(),M.style.visibility=z.checked?"visible":"hidden")}var D=document.createElement("div"),c=document.createElement("div");c.style.height="300px";

// Vulnerability class: CWE-20
J("img","src");0==N&&E(u)};Editor.base64Encode=function(u){for(var E="",J=0,T=u.length,N,Q,R;J<T;){N=u.charCodeAt(J++)&255;if(J==T){E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&3)<<4);E+="==";break}Q=u.charCodeAt(J++);if(J==T){E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&
3)<<4|(Q&240)>>4);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2);E+="=";break}R=u.charCodeAt(J++);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&3)<<4|(Q&240)>>4);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((Q&15)<<2|(R&192)>>6);E+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R&63)}return E};

// Vulnerability class: CWE-20
v[F].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0<B.length?B.join(";"):"",z.checked);b.hideDialog()});e.className="geBtn gePrimaryBtn";l=document.createElement("div");l.style.marginTop="26px";l.style.textAlign="right"}b.editor.cancelFirst?(l.appendChild(t),l.appendChild(e)):(l.appendChild(e),l.appendChild(t));d.appendChild(l);this.container=d},PluginsDialog=function(b,f,l,d){function u(){e=!0;if(0==c.length)D.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{D.innerHTML=
"";for(var x=0;x<c.length;x++){var A=document.createElement("span");A.style.whiteSpace="nowrap";var z=document.createElement("span");z.className="geSprite geSprite-delete";z.style.position="relative";z.style.cursor="pointer";z.style.top="5px";z.style.marginRight="4px";z.style.display="inline-block";A.appendChild(z);mxUtils.write(A,c[x]);D.appendChild(A);mxUtils.br(D);mxEvent.addListener(z,"click",function(L){return function(){b.confirm(mxResources.get("delete")+' "'+c[L]+'"?',function(){null!=l&&
l(c[L]);c.splice(L,1);u()})}}(x))}}}var t=document.createElement("div"),D=document.createElement("div");D.style.height="180px";D.style.overflow="auto";var c=mxSettings.getPlugins().slice(),e=!1;t.appendChild(D);u();e=!1;var g=mxUtils.button(mxResources.get("add"),null!=f?function(){f(function(x){x&&0>mxUtils.indexOf(c,x)&&c.push(x);u()})}:function(){var x=document.createElement("div"),A=document.createElement("span");A.style.marginTop="6px";mxUtils.write(A,mxResources.get("builtinPlugins")+": ");

// Vulnerability class: CWE-20
mxResources.get("dragImagesHere"));l.appendChild(x);var A={},z=null,L=null,M=null;f=function(F){"true"!=mxEvent.getSource(F).getAttribute("contentEditable")&&null!=M&&(M(),M=null,mxEvent.consume(F))};mxEvent.addListener(v,"mousedown",f);mxEvent.addListener(v,"pointerdown",f);mxEvent.addListener(v,"touchstart",f);var n=new mxUrlConverter,y=!1;if(null!=d)for(f=0;f<d.length;f++)m=d[f],c(m.data,null,0,0,m.w,m.h,m,m.aspect,m.title);mxEvent.addListener(v,"dragleave",function(F){x.style.cursor="";for(var G=

// Vulnerability class: CWE-20
ka&&null!=ka.message?ka.message:mxResources.get("disconnected")));mxEvent.consume(U)}));ea.setAttribute("title",X);O.style.paddingRight="4px";O.appendChild(ea)}}}};var y=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){y.apply(this,arguments);if(null!=this.shareButton){var O=this.shareButton;O.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage=
"url("+Editor.shareImage+")";O.style.backgroundPosition="center center";O.style.backgroundRepeat="no-repeat";O.style.backgroundSize="24px 24px";O.style.height="24px";O.style.width="24px";"1"==urlParams.sketch&&(this.shareButton.style.display="none")}null!=this.buttonContainer&&(this.buttonContainer.style.marginTop="-2px",this.buttonContainer.style.paddingTop="4px")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer&&"1"!=urlParams.embedInline){var O=document.createElement("div");

// Vulnerability class: CWE-20
function assertArgFn(arg, name, acceptArrayAnnotation) {
  if (acceptArrayAnnotation && isArray(arg)) {
      arg = arg[arg.length - 1];
  }

  assertArg(isFunction(arg), name, 'not a function, got ' +
      (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
  return arg;
}

// Vulnerability class: CWE-74
function afterUser () {
    // globalconfig and globalignorefile defaults
    // need to respond to the 'prefix' setting up to this point.
    // Eg, `npm config get globalconfig --prefix ~/local` should
    // return `~/local/etc/npmrc`
    // annoying humans and their expectations!
    if (conf.get('prefix')) {
      var etc = path.resolve(conf.get('prefix'), 'etc')
      correctMkdir(etc, function () {
        defaults.globalconfig = path.resolve(etc, 'npmrc')
        defaults.globalignorefile = path.resolve(etc, 'npmignore')
        afterUserContinuation()
      })
    } else {
      afterUserContinuation()
    }
  }

// Vulnerability class: CWE-732
0>ea&&(ea=N.strokeWidth/2);u.setStrokeAlpha(u.state.fillAlpha);u.setStrokeColor(N.fill||"");u.setStrokeWidth(ea);u.setDashed(!1);this._drawToContext(J,T,N);u.setDashed(ba);u.setStrokeWidth(R);u.setStrokeColor(Q);u.setStrokeAlpha(Y)};E._drawToContext=function(J,T,N){J.begin();for(var Q=0;Q<T.ops.length;Q++){var R=T.ops[Q],Y=R.data;switch(R.op){case "move":J.moveTo(Y[0],Y[1]);break;case "bcurveTo":J.curveTo(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]);break;case "lineTo":J.lineTo(Y[0],Y[1])}}J.end();"fillPath"===
T.type&&N.filled?J.fill():J.stroke()};return E};(function(){function u(Q,R,Y){this.canvas=Q;this.rc=R;this.shape=Y;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,u.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,u.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,u.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=

// Vulnerability class: CWE-20
function loadMoreMessages () {
        if (!$enabled || $loading) return false
        if (_.isUndefined($convoId)) return false
        $loading = true
        $spinner.removeClass('uk-hidden')

        // Load Messages
        $.ajax({
          url: '/api/v1/messages/conversation/' + $convoId + '?page=' + $nextPage
        })
          .done(function (data) {
            $spinner.addClass('uk-hidden')
            var messages = data.messages
            if (_.size(messages) < 1) {
              $enabled = false
              $loading = false
              return false
            }

            var html = ''

            _.each(messages, function (m) {
              var h = buildMessageHTML(m)
              if (h.length > 0) html += h
            })

            var stage = $('<div></div>')
              .appendTo('body')
              .addClass('stage')
              .css({
                opacity: 0,
                visibility: 'hidden',
                position: 'absolute',
                top: '-9999em',
                left: '-9999em'
              })
              .append(html)
            var height = $(stage).outerHeight()
            $(stage).remove()

            $messagesWrapper.prepend(html)

            UIKit.$html.trigger('changed.uk.dom')
            $messageScroller.scrollTop(height, true)

            $nextPage = $nextPage + 1
            $loading = false
          })
          .error(function (err) {
            console.log(err)
          })
      }

// Vulnerability class: CWE-662
E.charAt(0)&&(E=unescape(window.atob?atob(E):Base64.decode(cont,E))),null!=E&&"%"==E.charAt(0)&&(E=decodeURIComponent(E)),null!=E&&0<E.length)){var J=mxUtils.parseXml(E).documentElement;return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(T){}return!1};Editor.prototype.extractGraphModel=function(u,E,J){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){c.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?

// Vulnerability class: CWE-20
function deleteDomain() {
  var tr = $(this).closest("tr");
  var id = tr.attr("data-id");
  var domain = tr.find("#domain_" + id).text();
  var type = tr.find("#type_" + id).val();

  var domainRegex;
  if (type === "0" || type === "1") {
    domainRegex = "domain";
  } else if (type === "2" || type === "3") {
    domainRegex = "regex";
  }

  utils.disableAll();
  utils.showAlert("info", "", "Deleting " + domainRegex + "...", domain);
  $.ajax({
    url: "scripts/pi-hole/php/groups.php",
    method: "post",
    dataType: "json",
    data: { action: "delete_domain", id: id, token: token },
    success: function (response) {
      utils.enableAll();
      if (response.success) {
        utils.showAlert(
          "success",
          "far fa-trash-alt",
          "Successfully deleted " + domainRegex,
          domain
        );
        table.row(tr).remove().draw(false).ajax.reload(null, false);
      } else {
        utils.showAlert(
          "error",
          "",
          "Error while deleting " + domainRegex + " with ID " + id,
          response.message
        );
      }
    },
    error: function (jqXHR, exception) {
      utils.enableAll();
      utils.showAlert(
        "error",
        "",
        "Error while deleting " + domainRegex + " with ID " + id,
        jqXHR.responseText
      );
      console.log(exception); // eslint-disable-line no-console
    }
  });
}

// Vulnerability class: CWE-862
urlParams.sketch&&1E3<=n||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])k(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));var U=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==U.embedViewport)mxUtils.fit(this.div);else{var za=parseInt(this.div.offsetLeft),wa=parseInt(this.div.offsetWidth),Ea=U.embedViewport.x+
U.embedViewport.width,Da=parseInt(this.div.offsetTop),La=parseInt(this.div.offsetHeight),Ya=U.embedViewport.y+U.embedViewport.height;this.div.style.left=Math.max(U.embedViewport.x,Math.min(za,Ea-wa))+"px";this.div.style.top=Math.max(U.embedViewport.y,Math.min(Da,Ya-La))+"px";this.div.style.height=Math.min(U.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(U.embedViewport.width,parseInt(this.div.style.width))+"px"}};this.keyHandler.bindAction(75,!0,"toggleShapes",

// Vulnerability class: CWE-20
'binary-': function(left, right, context) {
    return function(scope, locals, assign, inputs) {
      var lhs = left(scope, locals, assign, inputs);
      var rhs = right(scope, locals, assign, inputs);
      var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
      return context ? {value: arg} : arg;
    };
  },

// Vulnerability class: CWE-74