mcanoglu/cwe-class-group huggingface dataset:
mxUtils.extend(Ka,mxActor);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));x=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(p,0),new mxPoint(p,x),new mxPoint(l,x),
new mxPoint(l,v),new mxPoint(0,v)],this.isRounded,A,!0);c.end()};mxCellRenderer.registerShape("corner",Ka);mxUtils.extend(bb,mxActor);bb.prototype.redrawPath=function(c,l,x,p,v){c.moveTo(0,0);c.lineTo(0,v);c.end();c.moveTo(p,0);c.lineTo(p,v);c.end();c.moveTo(0,v/2);c.lineTo(p,v/2);c.end()};mxCellRenderer.registerShape("crossbar",bb);mxUtils.extend(Pa,mxActor);Pa.prototype.dx=20;Pa.prototype.dy=20;Pa.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,

// Vulnerability class: CWE-20
function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(u,E,J){var T=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(T/u,T/E))};Editor.prototype.exportToCanvas=function(u,E,J,T,N,Q,R,Y,ba,ea,Z,fa,aa,va,ja,Ba,Ha,ra){try{Q=null!=Q?Q:!0;R=null!=R?R:!0;fa=null!=fa?fa:this.graph;aa=null!=aa?aa:0;var Ca=ba?null:fa.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=T);null==Ca&&0==ba&&(Ca=Ba?this.graph.defaultPageBackgroundColor:"#ffffff");

// Vulnerability class: CWE-20
module.exports.tile = function (inPath, outPath, pattern, options) {
    options = options || {};
    var tileSize = options.tileSize || 256;
    var tmpDir = options.tmpDir || process.env.TMPDIR || '/tmp';
    var tempDir = tmpDir + '/image-tiler_' + process.pid;
    var zoom = 0;
    var zoomToDisplay = 0;
    var quality = options.quality || 100;
    if (!options.invertZoom) {
        var size = sizeOf(inPath);
        var halvingsWidth = Math.ceil(Math.log2(Math.ceil(size.width / tileSize)));
        var halvingsheight = Math.ceil(Math.log2(Math.ceil(size.height / tileSize)));
        zoomToDisplay = Math.max(halvingsWidth, halvingsheight);
    }
    return mkdirp(tempDir)
        .then(()=>tileRec(inPath, outPath, zoom, tileSize, tempDir, pattern, zoomToDisplay, options.invertZoom, quality))
        .then(()=>rimraf(tempDir));
};

// Vulnerability class: CWE-77
function getBlockNodes(nodes) {
  // TODO(perf): update `nodes` instead of creating a new object?
  var node = nodes[0];
  var endNode = nodes[nodes.length - 1];
  var blockNodes;

  for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
    if (blockNodes || nodes[i] !== node) {
      if (!blockNodes) {
        blockNodes = jqLite(slice.call(nodes, 0, i));
      }
      blockNodes.push(node);
    }
  }

  return blockNodes || nodes;
}

// Vulnerability class: CWE-74
[H];!u(H)&&!d(H)||D(H)||x.traverse(H,!0,function(U,Q){var W=null!=Q&&x.isTreeEdge(Q);W&&0>mxUtils.indexOf(S,Q)&&S.push(Q);(null==Q||W)&&0>mxUtils.indexOf(S,U)&&S.push(U);return null==Q||W});return S};var G=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){G.apply(this,arguments);(u(this.state.cell)||d(this.state.cell))&&!D(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title",
"Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(H){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(H),mxEvent.getClientY(H),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(H);
this.graph.isMouseDown=!0;v.hoverIcons.reset();mxEvent.consume(H)})))};var N=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){N.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var J=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(H){J.apply(this,

// Vulnerability class: CWE-20
(new mxCodec(p.ownerDocument)).decode(p)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=function(p,C,I,T,P,O,R,Y,da,ha,Z,ea,aa,ua){var la=null,Aa=null,Fa=null;ea||null==this.themes||"darkTheme"!=this.defaultThemeName||(la=this.stylesheet,Aa=this.shapeForegroundColor,Fa=this.shapeBackgroundColor,this.shapeForegroundColor="darkTheme"==this.defaultThemeName?"#000000":Editor.lightColor,this.shapeBackgroundColor=
"darkTheme"==this.defaultThemeName?"#ffffff":Editor.darkColor,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var xa=K.apply(this,arguments),Da=this.getCustomFonts();if(Z&&0<Da.length){var Ba=xa.ownerDocument,Ka=null!=Ba.createElementNS?Ba.createElementNS(mxConstants.NS_SVG,"style"):Ba.createElement("style");null!=Ba.setAttributeNS?Ka.setAttributeNS("type","text/css"):Ka.setAttribute("type","text/css");for(var Oa="",Ia="",Ea=0;Ea<Da.length;Ea++){var Ca=Da[Ea].name,Ma=Da[Ea].url;Graph.isCssFontUrl(Ma)?
Oa+="@import url("+Ma+");\n":Ia+='@font-face {\nfont-family: "'+Ca+'";\nsrc: url("'+Ma+'");\n}\n'}Ka.appendChild(Ba.createTextNode(Oa+Ia));xa.getElementsByTagName("defs")[0].appendChild(Ka)}null!=la&&(this.shapeBackgroundColor=Fa,this.shapeForegroundColor=Aa,this.stylesheet=la,this.refresh());return xa};var B=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var p=B.apply(this,arguments);if(this.mathEnabled){var C=p.drawText;p.drawText=function(I,T){if(null!=I.text&&

// Vulnerability class: CWE-20
mxEvent.consume(ca)});mxEvent.addGestureListeners(document.body,null,function(ca){var ba=!1;null!=va&&(E.diagramContainer.style.width=Math.max(20,wa+mxEvent.getClientX(ca)-va)+"px",ba=!0);null!=ra&&(E.diagramContainer.style.height=Math.max(20,fa+mxEvent.getClientY(ca)-ra)+"px",ba=!0);ba&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:E.diagramContainer.getBoundingClientRect()}),"*"),R(),E.refresh())},function(ca){null==va&&null==

// Vulnerability class: CWE-20
this.convertImages(ea.getSvg(null,null,aa,ua,null,R,null,null,null,ha,null,Aa,Fa,xa),mxUtils.bind(this,function(Ba){try{var Ka=new Image;Ka.onload=mxUtils.bind(this,function(){try{var Ia=function(){mxClient.IS_SF?window.setTimeout(function(){za.drawImage(Ka,0,0);p(Ea,Ba)},0):(za.drawImage(Ka,0,0),p(Ea,Ba))},Ea=document.createElement("canvas"),Ca=parseInt(Ba.getAttribute("width")),Ma=parseInt(Ba.getAttribute("height"));Y=null!=Y?Y:1;null!=C&&(Y=O?Math.min(1,Math.min(3*C/(4*Ma),C/Ca)):C/Ca);Y=this.getMaxCanvasScale(Ca,

// Vulnerability class: CWE-20
function makeDirectory (path, stats, cb) {
  cb = inflight('makeDirectory:' + path, cb)
  if (!cb) {
    return log.silly('makeDirectory', path, 'creation already in flight; waiting')
  } else {
    log.silly('makeDirectory', path, 'creation not in flight; initializing')
  }

  var owner = calculateOwner()

  if (!process.getuid) {
    return mkdirp(path, function (er) {
      log.verbose('makeCacheDir', 'UID & GID are irrelevant on', process.platform)

      stats[path] = owner
      return cb(er, stats[path])
    })
  }

  if (owner.uid !== 0 || !process.env.HOME) {
    log.silly(
      'makeDirectory', path,
      'uid:', owner.uid,
      'gid:', owner.gid
    )
    stats[path] = owner
    mkdirp(path, afterMkdir)
  } else {
    fs.stat(process.env.HOME, function (er, st) {
      if (er) {
        log.error('makeDirectory', 'homeless?')
        return cb(er)
      }

      log.silly(
        'makeDirectory', path,
        'uid:', st.uid,
        'gid:', st.gid
      )
      stats[path] = st
      mkdirp(path, afterMkdir)
    })
  }

  function afterMkdir (er, made) {
    if (er || !stats[path] || isNaN(stats[path].uid) || isNaN(stats[path].gid)) {
      return cb(er, stats[path])
    }

    if (!made) return cb(er, stats[path])

    setPermissions(made, stats[path], cb)
  }
}

// Vulnerability class: CWE-732
null;else{var c=0;try{c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}catch(C){}var m=function(){var C=document.createElement("div");C.className="geSidebarContainer";C.style.position="absolute";C.style.width="100%";C.style.height="100%";C.style.border="1px solid whiteSmoke";C.style.overflowX="hidden";C.style.overflowY="auto";return C},n=function(C,D,G,P,K,F,H){var S=m();H(S);this.window=new mxWindow(D,S,G,P,K,F,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.setLocation=function(V,M){var W=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,U=this.table.firstChild.firstChild.firstChild;V=Math.max(0,Math.min(V,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-U.clientWidth-2));M=Math.max(0,Math.min(M,W-U.clientHeight-2));this.getX()==V&&this.getY()==M||mxWindow.prototype.setLocation.apply(this,
arguments)};mxClient.IS_SF&&(this.window.div.onselectstart=mxUtils.bind(this,function(V){null==V&&(V=window.event);return null!=V&&C.isSelectionAllowed(V)}))};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;

// Vulnerability class: CWE-20
else{U=function(){var N=Math.max(l.container.scrollLeft,Math.min(l.container.scrollLeft+l.container.clientWidth-M.cursor.clientWidth,E)),Q=Math.max(l.container.scrollTop-22,Math.min(l.container.scrollTop+l.container.clientHeight-M.cursor.clientHeight,J));T.style.opacity=N!=E||Q!=J?0:1;M.cursor.style.left=N+"px";M.cursor.style.top=Q+"px";M.cursor.style.display=""};var X=l.view.translate,u=l.view.scale,E=(X.x+M.lastCursor.x)*u+8,J=(X.y+M.lastCursor.y)*u-12,T=M.cursor.getElementsByTagName("img")[0];

// Vulnerability class: CWE-20
u.freehand.stopDrawing():u.freehand.startDrawing(),this.freehandWindow.window.setVisible(u.freehand.isDrawing()))})).isEnabled=function(){return t()&&mxClient.IS_SVG});d.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var n=document.createElement("div");n.style.whiteSpace="nowrap";var y=null==d.pages||1>=d.pages.length,K=document.createElement("h3");mxUtils.write(K,mxResources.get("formatXml"));K.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";

// Vulnerability class: CWE-20
function(){return null!=q?q.readyState:3};this.getLastError=function(){return S};this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(M,W){},mouseMove:function(M,W){var U,X=-1;return function(){clearTimeout(U);var u=this,E=arguments,J=function(){U=null;X=Date.now();M.apply(u,E)};Date.now()-X>W?J():U=setTimeout(J,W)}}(function(M,W){m(W)},200),mouseUp:function(M,W){m(W)}};l.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||
c("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);this.selectionChangeListener=function(M,W){M=function(u){return null!=u?u.id:null};var U=null!=b.currentPage?b.currentPage.getId():null,X=W.getProperty("added");W=W.getProperty("removed");c("selectionChange",{pageId:U,removed:X?X.map(M):[],added:W?W.map(M):[]})};l.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var M in y)n(y[M])});

// Vulnerability class: CWE-20
function(B){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=B?B:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var z=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),

// Vulnerability class: CWE-20
EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,f,l,d,u){if(null!=f)for(var t=0;t<f.length;t++)null!=f[t]&&(b=this.patchPages(b,f[t],l,d,u));return b};

// Vulnerability class: CWE-20
function preprocessRFC2822(s) {
    // Remove comments and folding whitespace and replace multiple-spaces with a single space
    return s
        .replace(/\([^)]*\)|[\n\t]/g, ' ')
        .replace(/(\s\s+)/g, ' ')
        .replace(/^\s\s*/, '')
        .replace(/\s\s*$/, '');
}

// Vulnerability class: CWE-400
_removePhoto( e ) {
			e.preventDefault();

			// eslint-disable-next-line no-alert
			if ( ! confirm( 'Are you sure?' ) ) {
				return;
			}

			this.$().removeAttr( 'data-custom' );
			this.$( '.profile-picture' ).toggleClass( 'profile-avatar-current' );
			this.$( '#submit' ).prop( 'disabled', false );

			$( '.lp-user-profile-avatar' ).html( this.$( '.profile-avatar-current' ).find( 'img' ).clone() );
		},

// Vulnerability class: CWE-610
"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(E))});this.editor.graph.mathEnabled&&this.editor.addMathCss(F);var J=mxUtils.bind(this,function(E){q?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(E,N,this.thumbImageCache)):N(E)});n?this.embedFonts(F,J):(this.editor.addFontCss(F),J(F))}catch(E){this.handleError(E)}};EditorUi.prototype.addRadiobox=function(c,e,g,k,m,q,v){return this.addCheckbox(c,g,k,m,q,v,!0,e)};EditorUi.prototype.addCheckbox=function(c,e,g,k,m,q,v,
x){q=null!=q?q:!0;var A=document.createElement("input");A.style.marginRight="8px";A.style.marginTop="16px";A.setAttribute("type",v?"radio":"checkbox");v="geCheckbox-"+Editor.guid();A.id=v;null!=x&&A.setAttribute("name",x);g&&(A.setAttribute("checked","checked"),A.defaultChecked=!0);k&&A.setAttribute("disabled","disabled");q&&(c.appendChild(A),g=document.createElement("label"),mxUtils.write(g,e),g.setAttribute("for",v),c.appendChild(g),m||mxUtils.br(c));return A};EditorUi.prototype.addEditButton=function(c,

// Vulnerability class: CWE-20
1?0:Ua.y*ia);this.shape.bounds.height=ma.height-(Ta==Ma.length-1?0:(Ua.height+Ua.y)*ia)}this.shape.redraw()}};var Ya=!1;za.setPosition=function(Ua,eb,jb){La=Math.max(Graph.minTableColumnWidth-Ea.width,eb.x-Ua.x-Ea.width);Ya=mxEvent.isShiftDown(jb.getEvent());null==Da||Ya||(La=Math.min(La,Da.width-Graph.minTableColumnWidth))};za.execute=function(Ua){if(0!=La)T.setTableColumnWidth(this.state.cell,La,Ya);else if(!M.blockDelayedSelection){var eb=T.getCellAt(Ua.getGraphX(),Ua.getGraphY())||ma.cell;T.graphHandler.selectCellForEvent(eb,

// Vulnerability class: CWE-20
x.push(function(z){g(null,z||"Unkown Error")}),this[k].apply(this,x);else{var A=this[k].apply(this,x);g([A])}}else g(null,"Invalid Call: "+k+" is not found.")}catch(z){g(null,"Invalid Call: An error occurred, "+z.message)}};EditorUi.prototype.openDatabase=function(c,e){if(null==this.database){var g=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=g)try{var k=g.open("database",2);k.onupgradeneeded=function(m){try{var q=k.result;1>m.oldVersion&&q.createObjectStore("objects",{keyPath:"key"});
2>m.oldVersion&&(q.createObjectStore("files",{keyPath:"title"}),q.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(v){null!=e&&e(v)}};k.onsuccess=mxUtils.bind(this,function(m){var q=k.result;this.database=q;EditorUi.migrateStorageFiles&&(StorageFile.migrate(q),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(v){if(!v||

// Vulnerability class: CWE-20
focus:function(){k.focus()}}};EditorUi.prototype.createUrlParameters=function(c,e,g,k,m,q,v){v=null!=v?v:[];k&&("https://viewer.diagrams.net"==EditorUi.lightboxHost&&"1"!=urlParams.dev||v.push("lightbox=1"),"auto"!=c&&v.push("target="+c),null!=e&&e!=mxConstants.NONE&&v.push("highlight="+("#"==e.charAt(0)?e.substring(1):e)),null!=m&&0<m.length&&v.push("edit="+encodeURIComponent(m)),q&&v.push("layers=1"),this.editor.graph.foldingEnabled&&v.push("nav=1"));g&&null!=this.currentPage&&null!=this.pages&&
this.currentPage!=this.pages[0]&&v.push("page-id="+this.currentPage.getId());return v};EditorUi.prototype.createLink=function(c,e,g,k,m,q,v,x,A,z){A=this.createUrlParameters(c,e,g,k,m,q,A);c=this.getCurrentFile();e=!0;null!=v?g="#U"+encodeURIComponent(v):(c=this.getCurrentFile(),x||null==c||c.constructor!=window.DriveFile?g="#R"+encodeURIComponent(g?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(g="#"+c.getHash(),e=!1));e&&

// Vulnerability class: CWE-20
A=this.editor.graph,B=null,I=null,O=null,t=null,z=null,L=null,C=null,D="whiteSpace=wrap;html=1;",G=null,P=null,K="",F="auto",H="auto",S=null,V=null,M=40,W=40,U=100,X=0,u=function(){null!=g?g(ta):(A.setSelectionCells(ta),A.scrollCellToVisible(A.getSelectionCell()))},E=A.getFreeInsertPoint(),J=E.x,T=E.y;E=T;var N=null,Q="auto";P=null;for(var R=[],Y=null,ba=null,ea=0;ea<k.length&&"#"==k[ea].charAt(0);){d=k[ea].replace(/\r$/,"");for(ea++;ea<k.length&&"\\"==d.charAt(d.length-1)&&"#"==k[ea].charAt(0);)d=

// Vulnerability class: CWE-20
(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="18.0.3";EditorUi.compactUi="atlas"!=uiTheme;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=

// Vulnerability class: CWE-20
"dblclick",function(La){n();mxEvent.consume(La)})}else if(!ja&&null!=pa&&0<pa.length){var Na=function(La){U.setAttribute("disabled","disabled");na.style.backgroundColor="transparent";na.style.border="1px solid transparent";S.spin(Z);ma(pa,function(Ta,Ua){S.stop();null!=Ta&&(y(na,Ta,sa,null,null,ia,Ua),La&&n())})};ra=ba||TEMPLATE_PATH+"/"+pa.substring(0,pa.length-4)+".png";na.style.backgroundImage="url("+ra+")";na.style.backgroundPosition="center center";na.style.backgroundRepeat="no-repeat";if(null!=

// Vulnerability class: CWE-20
Editor.createRoughCanvas=function(u){var E=rough.canvas({getContext:function(){return u}});E.draw=function(J){var T=J.sets||[];J=J.options||this.getDefaultOptions();for(var N=0;N<T.length;N++){var Q=T[N];switch(Q.type){case "path":null!=J.stroke&&this._drawToContext(u,Q,J);break;case "fillPath":this._drawToContext(u,Q,J);break;case "fillSketch":this.fillSketch(u,Q,J)}}};E.fillSketch=function(J,T,N){var Q=u.state.strokeColor,R=u.state.strokeWidth,Y=u.state.strokeAlpha,ba=u.state.dashed,ea=N.fillWeight;
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
n)for(v=0;v<n.length;v++)n[v].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,m=this.guidesArrHor;if(null!=c){for(var n=0;n<c.length;n++)c[n].destroy();this.guidesArrVer=null}if(null!=m){for(n=0;n<m.length;n++)m[n].destroy();this.guidesArrHor=null}}})();function mxRuler(b,e,f,c){function m(){var t=b.diagramContainer;p.style.top=t.offsetTop-g+"px";p.style.left=t.offsetLeft-g+"px";p.style.width=(f?0:t.offsetWidth)+g+"px";p.style.height=(f?t.offsetHeight:0)+g+"px"}function n(t,z,L){if(null!=v)return t;var C;return function(){var D=this,G=arguments,P=L&&!C;clearTimeout(C);C=setTimeout(function(){C=null;L||t.apply(D,G)},z);P&&t.apply(D,G)}}var v=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,

// Vulnerability class: CWE-20
"checked"),M.style.visibility="visible"):A.setAttribute("checked","checked")):l=null}else l=null}catch(I){}v.style=x+(l?l:u());v.vertex=!0;k.addCell(v,null,null,null,null);k.selectAll();k.addListener(mxEvent.CELLS_MOVED,B);k.addListener(mxEvent.CELLS_RESIZED,B);var X=k.graphHandler.mouseUp,p=k.graphHandler.mouseDown;k.graphHandler.mouseUp=function(){X.apply(this,arguments);g.style.backgroundColor="#fff9"};k.graphHandler.mouseDown=function(){p.apply(this,arguments);g.style.backgroundColor=""};k.dblClick=

// Vulnerability class: CWE-20
{},I=p.vertices,T=p.edges,P=0;P<I.length;P++)this.findCommonProperties(I[P],C,0==P);for(P=0;P<T.length;P++)this.findCommonProperties(T[P],C,0==I.length&&0==P);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(C).length&&this.container.appendChild(this.addProperties(this.createPanel(),C,p))}};var x=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(p){this.addActions(p,["copyStyle","pasteStyle"]);return x.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=

// Vulnerability class: CWE-20
"...");mxEvent.addListener(L,"click",function(K){function F(){d(H,S,function(V){k(S);b.addComment(V,function(M){V.id=M;D.push(V);p(S)},function(M){l(S);F();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var H=b.newComment("",b.getCurrentUser()),S=q(H,D,null,0);F();K.preventDefault();mxEvent.consume(K)});z.appendChild(L)}L=I.cloneNode();L.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';L.setAttribute("title",mxResources.get("showResolved"));

// Vulnerability class: CWE-20
(k?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(K);null!=m&&m(K);return K});e.mathEnabled&&this.editor.addMathCss(q);if(null!=m)this.embedFonts(q,mxUtils.bind(this,function(K){x?this.editor.convertImages(K,mxUtils.bind(this,function(B){y(B)})):y(K)}));else return y(q)};EditorUi.prototype.embedFonts=function(c,e){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),
this.editor.embedExtFonts(mxUtils.bind(this,function(g){try{null!=g&&this.editor.addFontCss(c,g),e(c)}catch(k){e(c)}}))}catch(g){e(c)}}))};EditorUi.prototype.exportImage=function(c,e,g,k,m,q,v,x,A,z,L,M,n){A=null!=A?A:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var y=this.editor.graph.isSelectionEmpty();g=null!=g?g:y;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(K){this.spinner.stop();try{this.saveCanvas(K,

// Vulnerability class: CWE-20
static parseOpReturnToChunks(script: Buffer, allow_op_0=false, allow_op_number=false) {
        // """Extract pushed bytes after opreturn. Returns list of bytes() objects,
        // one per push.
        let ops: PushDataOperation[];
    
        // Strict refusal of non-push opcodes; bad scripts throw OpreturnError."""
        try {
            ops = this.getScriptOperations(script);
        } catch(e) {
            //console.log(e);
            throw Error('Script error');
        }

        if(ops[0].opcode !== Script.opcodes.OP_RETURN)
            throw Error('No OP_RETURN');
        let chunks: (Buffer|null)[] = [];
        ops.slice(1).forEach(opitem => {
            if(opitem.opcode > Script.opcodes.OP_16)
                throw Error("Non-push opcode");
            if(opitem.opcode > Script.opcodes.OP_PUSHDATA4) {
                if(opitem.opcode === 80)
                    throw Error('Non-push opcode');
                if(!allow_op_number)
                    throw Error('OP_1NEGATE to OP_16 not allowed');
                if(opitem.opcode === Script.opcodes.OP_1NEGATE)
                    opitem.data = Buffer.from([0x81]);
                else // OP_1 - OP_16
                    opitem.data = Buffer.from([opitem.opcode - 80]);
            }
            if(opitem.opcode === Script.opcodes.OP_0 && !allow_op_0){
                throw Error('OP_0 not allowed');
            }
            chunks.push(opitem.data)
        });
        //console.log(chunks);
        return chunks
    }

// Vulnerability class: CWE-20
function addGroup() {
  var name = $("#new_name").val();
  var desc = $("#new_desc").val();

  utils.disableAll();
  utils.showAlert("info", "", "Adding group...", name);

  if (name.length === 0) {
    utils.showAlert("warning", "", "Warning", "Please specify a group name");
    return;
  }

  $.ajax({
    url: "scripts/pi-hole/php/groups.php",
    method: "post",
    dataType: "json",
    data: { action: "add_group", name: name, desc: desc, token: token },
    success: function (response) {
      utils.enableAll();
      if (response.success) {
        utils.showAlert("success", "fas fa-plus", "Successfully added group", name);
        $("#new_name").val("");
        $("#new_desc").val("");
        table.ajax.reload();
      } else {
        utils.showAlert("error", "", "Error while adding new group", response.message);
      }
    },
    error: function (jqXHR, exception) {
      utils.enableAll();
      utils.showAlert("error", "", "Error while adding new group", jqXHR.responseText);
      console.log(exception); // eslint-disable-line no-console
    }
  });
}

// Vulnerability class: CWE-862
c,b){var e=function(h,f,l){var p=function(n){n&&(this.res=n)};p.prototype=h;p.prototype.constructor=p;h=new p(l);for(var k in f||{})l=f[k],h[k]=l.slice?l.slice():l;return h},g={res:e(c.res,b.res)};g.formatter=e(c.formatter,b.formatter,g.res);g.parser=e(c.parser,b.parser,g.res);t[a]=g};d.compile=function(a){for(var c=/\[([^\[\]]*|\[[^\[\]]*\])*\]|([A-Za-z])\2+|\.{3}|./g,b,e=[a];b=c.exec(a);)e[e.length]=b[0];return e};d.format=function(a,c,b){c="string"===typeof c?d.compile(c):c;a=d.addMinutes(a,b?

// Vulnerability class: CWE-400
function(e){var f=e.split("/");return 1<f.length?{driveId:f[0],id:f[1]}:{id:e}};OneDriveClient.prototype.getItemURL=function(e,f){var c=e.split("/");return 1<c.length?(e=c[1],(f?"":this.baseUrl)+"/drives/"+c[0]+("root"==e?"/root":"/items/"+e)):(f?"":this.baseUrl)+"/me/drive/items/"+e};OneDriveClient.prototype.getLibrary=function(e,f,c){this.getFile(e,f,c,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(e){var f=e.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');
0<f&&(e=e.substring(0,f));return e};OneDriveClient.prototype.getFile=function(e,f,c,m,n){n=null!=n?n:!1;this.executeRequest(this.getItemURL(e),mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus()){var d=JSON.parse(v.getText()),g=/\.png$/i.test(d.name);if(/\.v(dx|sdx?)$/i.test(d.name)||/\.gliffy$/i.test(d.name)||/\.pdf$/i.test(d.name)||!this.ui.useCanvasForExport&&g)this.ui.convertFile(d["@microsoft.graph.downloadUrl"],d.name,null!=d.file?d.file.mimeType:null,this.extension,f,c);

// Vulnerability class: CWE-20
document.createElement("div");pa.className="geTempDlgNewDiagramCatItemLbl";pa.innerHTML=qa;ma.appendChild(pa);Ca.appendChild(ma);mxEvent.addListener(ma,"click",function(){function Ka(){var Ra=Ia.querySelector(".geTemplateDrawioCatLink");null!=Ra?Ra.click():setTimeout(Ka,200)}Z=!0;var Ia=M.querySelector(".geTemplatesList");Ia.style.display="block";Ba.style.width="";Na.style.display="";Na.value="";ba=null;Ka()});fa.style.display=ha.length<=ca?"none":""}function G(ha,da,ca){function la(Qa,Ya){var Ma=

// Vulnerability class: CWE-20
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(c,e,g,k){function m(x,A,z){c1=x>>2;c2=(x&3)<<4|A>>4;c3=(A&15)<<2|z>>6;c4=z&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(x){if(10>x)return String.fromCharCode(48+x);x-=10;if(26>x)return String.fromCharCode(65+x);x-=26;if(26>x)return String.fromCharCode(97+x);x-=26;return 0==x?"-":1==x?"_":"?"}var v=new XMLHttpRequest;v.open("GET",("txt"==e?PLANT_URL+"/txt/":"png"==e?PLANT_URL+"/png/":
PLANT_URL+"/svg/")+function(x){r="";for(i=0;i<x.length;i+=3)r=i+2==x.length?r+m(x.charCodeAt(i),x.charCodeAt(i+1),0):i+1==x.length?r+m(x.charCodeAt(i),0,0):r+m(x.charCodeAt(i),x.charCodeAt(i+1),x.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=e&&(v.responseType="blob");v.onload=function(x){if(200<=this.status&&300>this.status)if("txt"==e)g(this.response);else{var A=new FileReader;A.readAsDataURL(this.response);A.onloadend=function(z){var L=new Image;L.onload=
function(){try{var M=L.width,n=L.height;if(0==M&&0==n){var y=A.result,K=y.indexOf(","),B=decodeURIComponent(escape(atob(y.substring(K+1)))),F=mxUtils.parseXml(B).getElementsByTagName("svg");0<F.length&&(M=parseFloat(F[0].getAttribute("width")),n=parseFloat(F[0].getAttribute("height")))}g(A.result,M,n)}catch(G){k(G)}};L.src=A.result};A.onerror=function(z){k(z)}}else k(x)};v.onerror=function(x){k(x)};v.send()};EditorUi.prototype.insertAsPreText=function(c,e,g){var k=this.editor.graph,m=null;k.getModel().beginUpdate();

// Vulnerability class: CWE-20
Menus.prototype.createPopupMenu=function(B,F,G){var N=this.editorUi.editor.graph;B.smartSeparators=!0;x.apply(this,arguments);"1"==urlParams.sketch?N.isEnabled()&&(B.addSeparator(),1==N.getSelectionCount()&&this.addMenuItems(B,["-","lockUnlock"],null,G)):1==N.getSelectionCount()?(N.isCellFoldable(N.getSelectionCell())&&this.addMenuItems(B,N.isCellCollapsed(F)?["expand"]:["collapse"],null,G),this.addMenuItems(B,["collapsible","-","lockUnlock","enterGroup"],null,G),B.addSeparator(),this.addSubmenu("layout",
B)):N.isSelectionEmpty()&&N.isEnabled()?(B.addSeparator(),this.addMenuItems(B,["editData"],null,G),B.addSeparator(),this.addSubmenu("layout",B),this.addSubmenu("insert",B),this.addMenuItems(B,["-","exitGroup"],null,G)):N.isEnabled()&&this.addMenuItems(B,["-","lockUnlock"],null,G)};var A=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(B,F,G){A.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&this.addMenuItems(B,["copyAsImage"],null,G)};EditorUi.prototype.toggleFormatPanel=

// Vulnerability class: CWE-20
function(J){k=J};this.setAutoScroll=function(J){m=J};this.setOpenFill=function(J){q=J};this.setStopClickEnabled=function(J){A=J};this.setSelectInserted=function(J){z=J};this.setSmoothing=function(J){l=J};this.setPerfectFreehandMode=function(J){M=J};this.setBrushSize=function(J){L.size=J};this.getBrushSize=function(){return L.size};var n=function(J){x=J;b.getRubberband().setEnabled(!J);b.graphHandler.setSelectEnabled(!J);b.graphHandler.setMoveEnabled(!J);b.container.style.cursor=J?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};

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

// Vulnerability class: CWE-20
ConversationSchema.findOneAndUpdate({ _id: cId }, { updatedAt: new Date() }, { new: false }, function (
          err,
          convo
        ) {
          if (err) return done(err)
          if (convo === null || convo === undefined) {
            return done('Invalid Conversation: ' + convo)
          }
          return done(null, convo)
        })
      },

// Vulnerability class: CWE-662
"-","lockUnlock","enterGroup"],null,ea),O.addSeparator(),this.addSubmenu("layout",O)):ka.isSelectionEmpty()&&ka.isEnabled()?(O.addSeparator(),this.addMenuItems(O,["editData"],null,ea),O.addSeparator(),this.addSubmenu("layout",O),this.addSubmenu("insert",O),this.addMenuItems(O,["-","exitGroup"],null,ea)):ka.isEnabled()&&this.addMenuItems(O,["-","lockUnlock"],null,ea)};var H=Menus.prototype.addPopupMenuEditItems;Menus.prototype.addPopupMenuEditItems=function(O,X,ea){H.apply(this,arguments);this.editorUi.editor.graph.isSelectionEmpty()&&
this.addMenuItems(O,["copyAsImage"],null,ea)};EditorUi.prototype.toggleFormatPanel=function(O){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=O?O:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&

// Vulnerability class: CWE-20
arguments):(this.addOp(this.lineOp,O,R),this.lastX=O,this.lastY=R)};p.prototype.moveTo=function(O,R){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,O,R),this.lastX=O,this.lastY=R,this.firstX=O,this.firstY=R)};p.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};p.prototype.quadTo=function(O,R,Y,da){this.passThrough?this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,O,
R,Y,da),this.lastX=Y,this.lastY=da)};p.prototype.curveTo=function(O,R,Y,da,ha,Z){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,O,R,Y,da,ha,Z),this.lastX=ha,this.lastY=Z)};p.prototype.arcTo=function(O,R,Y,da,ha,Z,ea){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var aa=mxUtils.arcToCurves(this.lastX,this.lastY,O,R,Y,da,ha,Z,ea);if(null!=aa)for(var ua=0;ua<aa.length;ua+=6)this.curveTo(aa[ua],aa[ua+1],aa[ua+2],aa[ua+3],aa[ua+4],

// Vulnerability class: CWE-20
E);null!=T&&J.setAttribute("backgroundImage",JSON.stringify(T));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(T=this.graph.extFonts.map(function(N){return N.name+"^"+N.url}),J.setAttribute("extFonts",T.join("|")));return J};Editor.prototype.isDataSvg=function(u){try{var E=mxUtils.parseXml(u).documentElement.getAttribute("content");if(null!=E&&(null!=E&&"<"!=E.charAt(0)&&"%"!=
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=

// Vulnerability class: CWE-20
function(){this.openInNewWindow(A.substring(A.indexOf(",")+1),"image/png",!0);m.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}),null,null,null,null,null,null,null,Editor.defaultBorder);mxEvent.addListener(this.editor.graph.container,"click",m);document.body.appendChild(this.exportDialog)}mxEvent.consume(k)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,e,g,k,m){this.isLocalFileSave()?
this.saveLocalFile(g,c,k,m,e):this.saveRequest(c,e,mxUtils.bind(this,function(q,v){return this.createEchoRequest(g,q,k,m,e,v)}),g,m,k)};EditorUi.prototype.saveRequest=function(c,e,g,k,m,q,v){v=null!=v?v:!mxClient.IS_IOS||!navigator.standalone;var x=this.getServiceCount(!1);isLocalStorage&&x++;var A=4>=x?2:6<x?4:3;c=new CreateDialog(this,c,mxUtils.bind(this,function(z,L){if("_blank"==L||null!=z&&0<z.length){var M=g("_blank"==L?null:z,L==App.MODE_DEVICE||"download"==L||null==L||"_blank"==L?"0":"1");

// Vulnerability class: CWE-20
Math.min(Y,Math.max(parseInt(aa.value),parseInt(ea.value))));ea.value=Math.max(1,Math.min(Y,Math.min(parseInt(aa.value),parseInt(ea.value))))}function T(ya){function va(Ha,Na,Pa){var Qa=Ha.useCssTransforms,Ya=Ha.currentTranslate,La=Ha.currentScale,Ta=Ha.view.translate,Ua=Ha.view.scale;Ha.useCssTransforms&&(Ha.useCssTransforms=!1,Ha.currentTranslate=new mxPoint(0,0),Ha.currentScale=1,Ha.view.translate=new mxPoint(0,0),Ha.view.scale=1);var Za=Ha.getGraphBounds(),Wa=0,bb=0,Va=pa.get(),ab=1/Ha.pageScale,
$a=xa.checked;if($a){ab=parseInt(ta.value);var hb=parseInt(ka.value);ab=Math.min(Va.height*hb/(Za.height/Ha.view.scale),Va.width*ab/(Za.width/Ha.view.scale))}else ab=parseInt(Fa.value)/(100*Ha.pageScale),isNaN(ab)&&(ra=1/Ha.pageScale,Fa.value="100 %");Va=mxRectangle.fromRectangle(Va);Va.width=Math.ceil(Va.width*ra);Va.height=Math.ceil(Va.height*ra);ab*=ra;!$a&&Ha.pageVisible?(Za=Ha.getPageLayout(),Wa-=Za.x*Va.width,bb-=Za.y*Va.height):$a=!0;if(null==Na){Na=PrintDialog.createPrintPreview(Ha,ab,Va,

// Vulnerability class: CWE-20
ka-aa,fa=ra+(ya.y-ra)/ka-aa,ca=new Image;ca.onload=function(){try{for(var ba=-Math.round(sa-mxUtils.mod((va-wa)*Y,sa)),ja=-Math.round(sa-mxUtils.mod((ra-fa)*Y,sa));ba<Ca;ba+=sa)for(var ia=ja;ia<Ma;ia+=sa)za.drawImage(ca,ba/Y,ia/Y);Ia()}catch(ma){null!=P&&P(ma)}};ca.onerror=function(ba){null!=P&&P(ba)};ca.src=pa}else Ia()}catch(ba){null!=P&&P(ba)}});Ka.onerror=function(Ia){null!=P&&P(Ia)};ha&&this.graph.addSvgShadow(Ba);this.graph.mathEnabled&&this.addMathCss(Ba);var Oa=mxUtils.bind(this,function(){try{null!=

// Vulnerability class: CWE-20
b.handleError(la,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Y,da)}function Z(){c(aa,ua,function(la){ha()},!0)}var ea=W().pdiv,aa=b.newComment(P,b.getCurrentUser());aa.pCommentId=J.id;null==J.replies&&(J.replies=[]);var ua=q(aa,J.replies,ea,S+1);O?Z():ha()}if(U||!J.isResolved){n.style.display="none";var X=document.createElement("div");X.className="geCommentContainer";X.setAttribute("data-commentId",J.id);X.style.marginLeft=20*S+5+"px";J.isResolved&&!Editor.isDarkMode()&&

// Vulnerability class: CWE-20
mxClient.IS_IOS?(O.style.padding="0px 10px 20px 10px",O.style.top="6px"):mxClient.IS_FF&&(t.style.paddingTop="0px",t.style.marginTop="-2px");if(null!=A)for(p=0;p<A.length;p++)mxUtils.br(t),mxUtils.write(t,A[p]);if(null!=y&&null==b[y]){z.style.visibility="hidden";mxUtils.setOpacity(t,10);var L=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:Editor.isDarkMode()?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});L.spin(O);var C=window.setTimeout(function(){null==
b[y]&&(L.stop(),O.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(D,G){null!=b[y]&&G.getProperty("client")==b[y]&&(window.clearTimeout(C),mxUtils.setOpacity(t,100),z.style.visibility="",L.stop(),I(),"drive"==y&&null!=k.parentNode&&k.parentNode.removeChild(k))}))}else I();g.appendChild(O)}f=null!=f?f:2;var m=document.createElement("div");m.style.textAlign="center";m.style.whiteSpace="nowrap";m.style.paddingTop="0px";m.style.paddingBottom="20px";var n=document.createElement("div");

// Vulnerability class: CWE-20
this.editorUi.editor.graph,X=U.getSelectionCell();P.call(this,M,X,null,W);this.addMenuItems(M,["editTooltip"],W);U.model.isVertex(X)&&this.addMenuItems(M,["editGeometry"],W);this.addMenuItems(M,["-","edit"],W)})));this.addPopupMenuCellEditItems=function(M,W,U,X){M.addSeparator();this.addSubmenu("editCell",M,X,mxResources.get("edit"))};this.put("file",new Menu(mxUtils.bind(this,function(M,W){var U=C.getCurrentFile();C.menus.addMenuItems(M,["new"],W);C.menus.addSubmenu("openFrom",M,W);isLocalStorage&&

// Vulnerability class: CWE-20
Ia),!0,null,!0);var Ja=document.createElement("div");Ja.className="geTempDlgDialogMask";M.appendChild(Ja);var Oa=b.sidebar.hideTooltip;b.sidebar.hideTooltip=function(){Ja&&(M.removeChild(Ja),Ja=null,Oa.apply(this,arguments),b.sidebar.hideTooltip=Oa)};mxEvent.addListener(Ja,"click",function(){b.sidebar.hideTooltip()})}}var qa=null;if(Da||b.sidebar.currentElt==da)b.sidebar.hideTooltip();else{var pa=function(na){Da&&b.sidebar.currentElt==da&&ma(na,mxEvent.getClientX(la),mxEvent.getClientY(la));Da=!1;

// Vulnerability class: CWE-20
(W.removeAttribute("disabled"),W.checked=!m.pageVisible):(W.setAttribute("disabled","disabled"),W.checked=!1)};L=200;var D=1,G=null;if(c.pdfPageExport&&!t){var P=function(){V.value=Math.max(1,Math.min(D,Math.max(parseInt(V.value),parseInt(H.value))));H.value=Math.max(1,Math.min(D,Math.min(parseInt(V.value),parseInt(H.value))))},K=c.addRadiobox(z,"pages",mxResources.get("allPages"),!0),F=c.addRadiobox(z,"pages",mxResources.get("pages")+":",!1,null,!0),H=document.createElement("input");H.style.cssText=

// Vulnerability class: CWE-20
module.exports = function correctMkdir (path, cb) {
  cb = dezalgo(cb)
  cb = inflight('correctMkdir:' + path, cb)
  if (!cb) {
    return log.silly('correctMkdir', path, 'correctMkdir already in flight; waiting')
  } else {
    log.silly('correctMkdir', path, 'correctMkdir not in flight; initializing')
  }
  var stats = {}

  if (stats[path]) return cb(null, stats[path])

  fs.stat(path, function (er, st) {
    if (er) return makeDirectory(path, stats, cb)

    if (!st.isDirectory()) {
      log.error('correctMkdir', 'invalid dir %s', path)
      return cb(er)
    }

    var ownerStats = calculateOwner()
    // there's always a chance the permissions could have been frobbed, so fix
    if (st.uid !== ownerStats.uid) {
      stats[path] = ownerStats
      setPermissions(path, ownerStats, cb)
    } else {
      stats[path] = st
      cb(null, stats[path])
    }
  })
}

// Vulnerability class: CWE-732
exports.quote = function (xs) {
    return xs.map(function (s) {
        if (s && typeof s === 'object') {
            return s.op.replace(/(.)/g, '\\$1');
        }
        else if (/["\s]/.test(s) && !/'/.test(s)) {
            return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
        }
        else if (/["'\s]/.test(s)) {
            return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
        }
        else {
            return String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2');
        }
    }).join(' ');
};

// Vulnerability class: CWE-77
1E3<=D&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=D||"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 O=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(C){C=O.apply(this,arguments);
var D=this.editorUi,G=D.editor.graph;if(G.isEnabled()&&"1"==urlParams.sketch){var P=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(K,F){D.setSketchMode(!Editor.sketchMode);null!=F&&mxEvent.isShiftDown(F)||G.updateCellStyles({sketch:K?"1":null},G.getVerticesAndEdges())},{install:function(K){this.listener=function(){K(Editor.sketchMode)};D.addListener("sketchModeChanged",this.listener)},destroy:function(){D.removeListener(this.listener)}});C.appendChild(P)}return C};

// Vulnerability class: CWE-20
function(k){this.actions.get("shapes").funct();mxEvent.consume(k)}));c.appendChild(e);return c};EditorUi.prototype.handleError=function(c,e,g,k,m,q,v){var x=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},A=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{v?null!=window.console&&console.error("EditorUi.handleError:",c):EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,c.lineNumber,

// Vulnerability class: CWE-20
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(d,g,k,l){function p(y,A,B){c1=y>>2;c2=(y&3)<<4|A>>4;c3=(A&15)<<2|B>>6;c4=B&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(y){if(10>y)return String.fromCharCode(48+y);y-=10;if(26>y)return String.fromCharCode(65+y);y-=26;if(26>y)return String.fromCharCode(97+y);y-=26;return 0==y?"-":1==y?"_":"?"}var x=new XMLHttpRequest;x.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":
PLANT_URL+"/svg/")+function(y){r="";for(i=0;i<y.length;i+=3)r=i+2==y.length?r+p(y.charCodeAt(i),y.charCodeAt(i+1),0):i+1==y.length?r+p(y.charCodeAt(i),0,0):r+p(y.charCodeAt(i),y.charCodeAt(i+1),y.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),!0);"txt"!=g&&(x.responseType="blob");x.onload=function(y){if(200<=this.status&&300>this.status)if("txt"==g)k(this.response);else{var A=new FileReader;A.readAsDataURL(this.response);A.onloadend=function(B){var I=new Image;I.onload=
function(){try{var O=I.width,t=I.height;if(0==O&&0==t){var z=A.result,L=z.indexOf(","),C=decodeURIComponent(escape(atob(z.substring(L+1)))),D=mxUtils.parseXml(C).getElementsByTagName("svg");0<D.length&&(O=parseFloat(D[0].getAttribute("width")),t=parseFloat(D[0].getAttribute("height")))}k(A.result,O,t)}catch(G){l(G)}};I.src=A.result};A.onerror=function(B){l(B)}}else l(y)};x.onerror=function(y){l(y)};x.send()};EditorUi.prototype.insertAsPreText=function(d,g,k){var l=this.editor.graph,p=null;l.getModel().beginUpdate();

// Vulnerability class: CWE-20
EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,e,g,k,m){k=null!=k?k:c.name;g=null!=g?g:mxUtils.bind(this,function(v){this.handleError(v)});var q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var v=this.isRemoteVisioFormat(k);try{var x="UNKNOWN-VISIO",A=k.lastIndexOf(".");if(0<=A&&A<k.length)x=k.substring(A+1).toUpperCase();else{var z=k.lastIndexOf("/");0<=

// Vulnerability class: CWE-20