Jelajahi Sumber

6.5.6 release

Former-commit-id: e9ea0e8c1edd93b24e4c956755fa3e9eeaa1719c
Gaudenz Alder 8 tahun lalu
induk
melakukan
b081763f0b
100 mengubah file dengan 16010 tambahan dan 868 penghapusan
  1. 21 0
      ChangeLog
  2. 1 1
      VERSION
  3. 8 8
      etc/mxgraph/mxClient.js
  4. 74 20
      src/com/mxgraph/io/mxVsdxCodec.java
  5. 13 5
      src/com/mxgraph/io/vsdx/Shape.java
  6. 3 21
      src/com/mxgraph/io/vsdx/Style.java
  7. 75 52
      src/com/mxgraph/io/vsdx/VsdxShape.java
  8. 1 1
      src/com/mxgraph/io/vsdx/geometry/ArcTo.java
  9. 153 12
      src/com/mxgraph/io/vsdx/geometry/Ellipse.java
  10. 19 1
      src/com/mxgraph/io/vsdx/geometry/RelQuadBezTo.java
  11. 1 1
      src/com/mxgraph/io/vsdx/mxPropertiesManager.java
  12. 0 3
      src/com/mxgraph/io/vsdx/mxVsdxConstants.java
  13. 2 23
      src/com/mxgraph/io/vsdx/mxVsdxGeometry.java
  14. 80 5
      src/com/mxgraph/io/vsdx/mxVsdxGeometryList.java
  15. 10 11
      src/com/mxgraph/io/vsdx/mxVsdxPage.java
  16. 0 1
      src/com/mxgraph/io/vsdx/mxVsdxTheme.java
  17. 0 16
      src/com/mxgraph/online/SaveServlet.java
  18. 4 0
      war/WEB-INF/appengine-web.xml
  19. TEMPAT SAMPAH
      war/WEB-INF/lib/im4java-1.4.0.jar
  20. 1 1
      war/cache.manifest
  21. TEMPAT SAMPAH
      war/images/sidebar-clipart.jpg
  22. TEMPAT SAMPAH
      war/images/sidebar-clipart.png
  23. 193 187
      war/js/app.min.js
  24. 87 87
      war/js/atlas-viewer.min.js
  25. 176 173
      war/js/atlas.min.js
  26. 43 22
      war/js/diagramly/App.js
  27. 69 17
      war/js/diagramly/Dialogs.js
  28. 15 9
      war/js/diagramly/EditorUi.js
  29. 18 6
      war/js/diagramly/GitHubClient.js
  30. 12 4
      war/js/diagramly/GraphViewer.js
  31. 60 37
      war/js/diagramly/OneDriveClient.js
  32. 29 7
      war/js/diagramly/sidebar/Sidebar.js
  33. 8 8
      war/js/embed-static.min.js
  34. 1 1
      war/js/mxgraph/Dialogs.js
  35. 3 3
      war/js/mxgraph/Format.js
  36. 33 29
      war/js/mxgraph/Sidebar.js
  37. 8 8
      war/js/reader.min.js
  38. 88 88
      war/js/viewer.min.js
  39. 10 0
      war/node_modules/.bin/electron
  40. 19 0
      war/node_modules/.bin/electron-download
  41. 139 0
      war/node_modules/.bin/esparse
  42. 236 0
      war/node_modules/.bin/esvalidate
  43. 20 0
      war/node_modules/.bin/extract-zip
  44. 132 0
      war/node_modules/.bin/js-yaml
  45. 33 0
      war/node_modules/.bin/mkdirp
  46. 32 0
      war/node_modules/.bin/nugget
  47. 32 0
      war/node_modules/.bin/pretty-bytes
  48. 60 0
      war/node_modules/.bin/rc
  49. 50 0
      war/node_modules/.bin/rimraf
  50. 133 0
      war/node_modules/.bin/semver
  51. 201 0
      war/node_modules/.bin/sshpk-conv
  52. 191 0
      war/node_modules/.bin/sshpk-sign
  53. 166 0
      war/node_modules/.bin/sshpk-verify
  54. 49 0
      war/node_modules/.bin/strip-indent
  55. 26 0
      war/node_modules/.bin/uuid
  56. 20 0
      war/node_modules/ajv/.tonic_example.js
  57. 22 0
      war/node_modules/ajv/LICENSE
  58. 1213 0
      war/node_modules/ajv/README.md
  59. 8023 0
      war/node_modules/ajv/dist/ajv.bundle.js
  60. 6 0
      war/node_modules/ajv/dist/ajv.min.js
  61. 1 0
      war/node_modules/ajv/dist/ajv.min.js.map
  62. 8 0
      war/node_modules/ajv/dist/nodent.min.js
  63. 32 0
      war/node_modules/ajv/dist/regenerator.min.js
  64. 284 0
      war/node_modules/ajv/lib/ajv.d.ts
  65. 420 0
      war/node_modules/ajv/lib/ajv.js
  66. 218 0
      war/node_modules/ajv/lib/async.js
  67. 26 0
      war/node_modules/ajv/lib/cache.js
  68. 28 0
      war/node_modules/ajv/lib/compile/_rules.js
  69. 45 0
      war/node_modules/ajv/lib/compile/equal.js
  70. 164 0
      war/node_modules/ajv/lib/compile/formats.js
  71. 390 0
      war/node_modules/ajv/lib/compile/index.js
  72. 267 0
      war/node_modules/ajv/lib/compile/resolve.js
  73. 40 0
      war/node_modules/ajv/lib/compile/rules.js
  74. 9 0
      war/node_modules/ajv/lib/compile/schema_obj.js
  75. 20 0
      war/node_modules/ajv/lib/compile/ucs2length.js
  76. 257 0
      war/node_modules/ajv/lib/compile/util.js
  77. 14 0
      war/node_modules/ajv/lib/compile/validation_error.js
  78. 49 0
      war/node_modules/ajv/lib/dot/_limit.jst
  79. 10 0
      war/node_modules/ajv/lib/dot/_limitItems.jst
  80. 10 0
      war/node_modules/ajv/lib/dot/_limitLength.jst
  81. 10 0
      war/node_modules/ajv/lib/dot/_limitProperties.jst
  82. 34 0
      war/node_modules/ajv/lib/dot/allOf.jst
  83. 48 0
      war/node_modules/ajv/lib/dot/anyOf.jst
  84. 61 0
      war/node_modules/ajv/lib/dot/coerce.def
  85. 184 0
      war/node_modules/ajv/lib/dot/custom.jst
  86. 32 0
      war/node_modules/ajv/lib/dot/defaults.def
  87. 182 0
      war/node_modules/ajv/lib/dot/definitions.def
  88. 69 0
      war/node_modules/ajv/lib/dot/dependencies.jst
  89. 30 0
      war/node_modules/ajv/lib/dot/enum.jst
  90. 185 0
      war/node_modules/ajv/lib/dot/errors.def
  91. 100 0
      war/node_modules/ajv/lib/dot/format.jst
  92. 101 0
      war/node_modules/ajv/lib/dot/items.jst
  93. 34 0
      war/node_modules/ajv/lib/dot/missing.def
  94. 20 0
      war/node_modules/ajv/lib/dot/multipleOf.jst
  95. 43 0
      war/node_modules/ajv/lib/dot/not.jst
  96. 44 0
      war/node_modules/ajv/lib/dot/oneOf.jst
  97. 14 0
      war/node_modules/ajv/lib/dot/pattern.jst
  98. 319 0
      war/node_modules/ajv/lib/dot/properties.jst
  99. 86 0
      war/node_modules/ajv/lib/dot/ref.jst
  100. 0 0
      war/node_modules/ajv/lib/dot/required.jst

+ 21 - 0
ChangeLog

@@ -1,3 +1,24 @@
+27-APR-2017: 6.5.6
+
+- Adds arrows and textbox to general sidebar
+- Fixes possible data loss when opening local files
+- Removes minimum of 120% for line height in format panel
+- Fixes highlight for scaled, selected arrows in realtime
+- Removes fix for cloned start/end arrow when splitting edge
+- Fixes touch events in Chrome for hiding modal dialogs
+- Uses mxGraph 3.7.3 beta 2
+
+24-APR-2017: 6.5.5
+
+- Fixes OneDrive file picker
+- Uses mxGraph 3.7.3 beta 1
+- Adds error handling in Google Docs add-on auth callback
+- Fixes cancel for access denied dialog in GitHub client
+- Adds sign out option for backends in splash screen
+- Fixes changes lost warning when saving draft
+- Removes clipart icons due to complaints
+- Fixes close icon in Chrome app footer
+
 20-APR-2017: 6.5.4
 
 - Updates Sandstorm build

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.5.4
+6.5.6

File diff ditekan karena terlalu besar
+ 8 - 8
etc/mxgraph/mxClient.js


+ 74 - 20
src/com/mxgraph/io/mxVsdxCodec.java

@@ -9,6 +9,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -156,14 +157,18 @@ public class mxVsdxCodec
 				if (filename.toLowerCase().endsWith(".xml") | filename
 							.toLowerCase().endsWith(".xml.rels"))
 				{
-					Document doc = mxXmlUtils.parseXml(out.toString(charset));
-					// Hack to be able to find the filename from an element in the XML
-					doc.setDocumentURI(filename);
-					docData.put(filename, doc);
+					String str = out.toString(charset);
+					if (!str.isEmpty())
+					{
+						Document doc = mxXmlUtils.parseXml(str);
+						// Hack to be able to find the filename from an element in the XML
+						doc.setDocumentURI(filename);
+						docData.put(filename, doc);
+					}
 				}
 				else if (filename.toLowerCase().startsWith(mxVsdxCodec.vsdxPlaceholder + "/media"))
 				{
-					String base64Str;
+					String base64Str = "";
 					//Some BMP images are huge and doesn't show up in the browser, so, it is better to compress it as PNG 
 					if (filename.toLowerCase().endsWith(".bmp")) 
 					{
@@ -203,6 +208,27 @@ public class mxVsdxCodec
 							base64Str = StringUtils.newStringUtf8(Base64.encodeBase64(out.toByteArray(), false));
 						}
 					}
+					else if (filename.toLowerCase().endsWith(".emf")) //extract jpg or png images from emf file 
+					{
+						byte[] emfData = out.toByteArray();
+						boolean imageFound = false;
+						//search for jpg or png header
+						for (int i = 0; i < emfData.length - 8; i++) //we subtract 8 from the length to be safe when testing image headers
+						{
+							if (isPng(emfData, i) || isJpg(emfData, i)) //png or jpg?
+							{
+								//although the resulting file is larger than the actual image but any extra bytes after the image are ignored
+								base64Str = StringUtils.newStringUtf8(Base64.encodeBase64(Arrays.copyOfRange(emfData, i, emfData.length), false));
+								imageFound = true;
+								break;
+							}
+							
+						}
+						if (!imageFound)
+						{
+							base64Str = StringUtils.newStringUtf8(Base64.encodeBase64(out.toByteArray(), false));
+						}
+					}
 					else
 					{
 						base64Str = StringUtils.newStringUtf8(Base64.encodeBase64(out.toByteArray(), false));
@@ -328,6 +354,22 @@ public class mxVsdxCodec
 		return xmlBuilder.toString();
 	}
 
+	private boolean isJpg(byte[] emfData, int i) 
+	{
+		//the loop calling this function make sure that we still have 3 bytes in the buffer
+		return emfData[i  ] == (byte) 0xFF && emfData[i+1] == (byte) 0xD8 &&
+			   emfData[i+2] == (byte) 0xFF;
+	}
+
+	private boolean isPng(byte[] emfData, int i) 
+	{
+		//the loop calling this function make sure that we still have 8 bytes in the buffer
+		return emfData[i  ] == (byte) 0x89 && emfData[i+1] == (byte) 0x50 &&
+			   emfData[i+2] == (byte) 0x4E && emfData[i+3] == (byte) 0x47 &&
+			   emfData[i+4] == (byte) 0x0D && emfData[i+5] == (byte) 0x0A &&
+			   emfData[i+6] == (byte) 0x1A && emfData[i+7] == (byte) 0x0A;
+	}
+
 	/**
 	 * Scale a point in place
 	 * 
@@ -564,6 +606,8 @@ public class mxVsdxCodec
 			}
 			else
 			{
+				//remember the edge order to maintain the shapes order (back to front)
+				shape.setShapeIndex(graph.getModel().getChildCount(parent));
 				edgeShapeMap.put(new ShapePageId(pageId, id), shape);
 				parentsMap.put(new ShapePageId(pageId, id), parent);
 			}
@@ -591,12 +635,6 @@ public class mxVsdxCodec
 		//		{
 		//			t = (text.getTextContent());
 		//		}
-		String textLabel = "";
-		
-		if (!shape.isDisplacedLabel() && !shape.isRotatedLabel())
-		{
-			textLabel = shape.getTextLabel();
-		}
 		
 		//Define dimensions
 		mxPoint d = shape.getDimensions();
@@ -636,6 +674,7 @@ public class mxVsdxCodec
 		}
 		else
 		{
+			String textLabel = shape.getTextLabel();
 			group = (mxCell) graph.insertVertex(parent, null, textLabel,
 					o.getX(), o.getY(), d.getX(), d.getY(), style);
 		}
@@ -752,7 +791,9 @@ public class mxVsdxCodec
 		//Defines Text Label.
 		String textLabel = "";
 
-		if (!shape.isRotatedLabel())
+		boolean hasSubLabel = shape.isDisplacedLabel() || shape.isRotatedLabel();// || shape.getRotation() != 0;
+
+		if (!hasSubLabel)
 		{
 			textLabel = shape.getTextLabel();
 		}
@@ -795,7 +836,6 @@ public class mxVsdxCodec
 			String style = mxVsdxUtils.getStyleString(styleMap, "=");
 
 			mxCell v1 = null;
-			boolean hasSubLabel = shape.isDisplacedLabel() || shape.isRotatedLabel();// || shape.getRotation() != 0;
 
 			if (hasSubLabel)
 			{
@@ -923,7 +963,7 @@ public class mxVsdxCodec
 			edge = graph.insertEdge(parent, null, edgeShape.getTextLabel(), source,
 					target, mxVsdxUtils.getStyleString(styleMap, "="));
 			
-			mxPoint lblOffset = edgeShape.getLblEdgeOffset(beginXY, endXY, points);
+			mxPoint lblOffset = edgeShape.getLblEdgeOffset(graph.getView(), points);
 			((mxCell)edge).getGeometry().setOffset(lblOffset);
 		}
 		
@@ -994,7 +1034,6 @@ public class mxVsdxCodec
 		}
 
 		mxPoint beginXY = edgeShape.getStartXY(parentHeight);
-		mxPoint origBeginXY = new mxPoint(beginXY);
 		mxPoint endXY = edgeShape.getEndXY(parentHeight);
 
 		//Define style of the edge
@@ -1004,12 +1043,19 @@ public class mxVsdxCodec
 		
 		//Insert new edge and set constraints.
 		Object edge;
-		List<mxPoint> points = edgeShape.getRoutingPoints(parentHeight, origBeginXY, edgeShape.getRotation());
+		List<mxPoint> points = edgeShape.getRoutingPoints(parentHeight, beginXY, edgeShape.getRotation());
 		double rotation = edgeShape.getRotation();
 		if (rotation != 0)
 		{
-			edge = graph.insertEdge(parent, null, null, null, null, mxVsdxUtils.getStyleString(styleMap, "="));
-			
+			if (edgeShape.getShapeIndex() == 0)
+			{
+				edge = graph.insertEdge(parent, null, null, null, null, mxVsdxUtils.getStyleString(styleMap, "="));
+			}
+			else
+			{
+				edge = graph.createEdge(parent, null, null, null, null, mxVsdxUtils.getStyleString(styleMap, "="));
+				edge = graph.addEdge(edge, parent, null, null, edgeShape.getShapeIndex());
+			}
 			mxCell label = edgeShape.createLabelSubShape(graph, (mxCell) edge);
 			if (label != null)
 			{
@@ -1024,9 +1070,17 @@ public class mxVsdxCodec
 		}
 		else
 		{
-			edge = graph.insertEdge(parent, null, edgeShape.getTextLabel(), null, null, mxVsdxUtils.getStyleString(styleMap, "="));
+			if (edgeShape.getShapeIndex() == 0)
+			{
+				edge = graph.insertEdge(parent, null, edgeShape.getTextLabel(), null, null, mxVsdxUtils.getStyleString(styleMap, "="));
+			}
+			else
+			{
+				edge = graph.createEdge(parent, null, edgeShape.getTextLabel(), null, null, mxVsdxUtils.getStyleString(styleMap, "="));
+				edge = graph.addEdge(edge, parent, null, null, edgeShape.getShapeIndex());
+			}
 			
-			mxPoint lblOffset = edgeShape.getLblEdgeOffset(beginXY, endXY, points);
+			mxPoint lblOffset = edgeShape.getLblEdgeOffset(graph.getView(), points);
 			((mxCell)edge).getGeometry().setOffset(lblOffset);
 		}
 		mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);

+ 13 - 5
src/com/mxgraph/io/vsdx/Shape.java

@@ -211,13 +211,20 @@ public class Shape extends Style
 								if (type != null && type.endsWith("image"))
 								{
 									this.imageData = new HashMap<String, String>();
-									this.imageData.put("iData", model.getMedia(mxVsdxCodec.vsdxPlaceholder + "/media/" + target));
+									String iData = model.getMedia(mxVsdxCodec.vsdxPlaceholder + "/media/" + target);
+									this.imageData.put("iData", iData);
 									
 									//since we convert BMP files to PNG, we set the compression to PNG
 									if (target.toLowerCase().endsWith(".bmp"))
 									{
 										compression = "png";
 									}
+									else if (target.toLowerCase().endsWith(".emf"))
+									{
+										//emf can be a png or jpg or vector (which is not supported yet)
+										//We use a number of bytes equal to file header length (which is safe as header in base64 requires 4n/3 bytes
+										compression = iData.startsWith("iVBORw0K") ? "png" : (iData.startsWith("/9j/") ? "jpg" : compression);
+									}
 
 									this.imageData.put("iType", compression);
 								}
@@ -505,6 +512,7 @@ public class Shape extends Style
 		String direction = "direction:" + this.getRtlText(cp) + ";";
 		String space = "letter-spacing:" + (Double.parseDouble(this.getLetterSpace(cp)) / 0.71) + "px;";
 		String lineHeight = "line-height:" + getSpcLine(pp);
+		String opacity = ";opacity:" + getTextOpacity(cp);
 		String pos = this.getTextPos(cp);
 		String tCase = getTextCase(cp);
 		
@@ -532,7 +540,7 @@ public class Shape extends Style
 		text = this.getTextStrike(cp) ? mxVsdxUtils.surroundByTags(text, "s") : text;
 		text = this.isSmallCaps(cp) ? mxVsdxUtils.toSmallCaps(text, this.getTextSize(cp)) : text;
 
-		ret += "<font style=\"" + size + font + color + direction + space + lineHeight + "\">" + text + "</font>";
+		ret += "<font style=\"" + size + font + color + direction + space + lineHeight + opacity + "\">" + text + "</font>";
 		return ret;
 	}
 	
@@ -775,12 +783,12 @@ public class Shape extends Style
 	public String getTextOpacity(String index)
 	{
 		Element colorTrans = getCellElement(mxVsdxConstants.COLOR_TRANS, index, mxVsdxConstants.CHARACTER);
-		String trans = getValue(colorTrans, "0");
-		String result = "100";
+		String trans = getValue(colorTrans, "1");
+		String result = "1";
 		
 		if (trans != null && !trans.isEmpty())
 		{
-			double tmp = 100 - (Double.valueOf(trans) * 100.0);
+			double tmp = 1.0 - Double.valueOf(trans);
 			result = String.valueOf(tmp);
 		}
 		

+ 3 - 21
src/com/mxgraph/io/vsdx/Style.java

@@ -304,25 +304,6 @@ public class Style
 		return Math.round(conVal * 100.0) / 100.0;
 	}
 
-	/**
-	 * Returns the value of the element with tag name = 'tag' in the children
-	 * of 'primary' in his double representation.<br/>
-	 * @param tag Name of the Element to be found.
-	 * @return Numerical value of the element.
-	 */
-	public String getAttribute(String parentTag, String tag, String attribute, String defaultValue)
-	{
-		String result = defaultValue;
-		Element cell = this.cellElements.get(tag);
-		
-		if (cell != null)
-		{
-			result = cell.getAttribute(attribute);
-		}
-
-		return result;
-	}
-	
 	/**
 	 * Returns the value of the attribute of the element with tag name = 'tag' in the children
 	 * of the shape element<br/>
@@ -570,7 +551,8 @@ public class Style
 			}
 			else
 			{
-				fillForeColor = "";
+				//One sample file has fill color as white when no theme is used and value is Themed!
+				fillForeColor = "#FFFFFF";
 			}
 		}
 
@@ -615,7 +597,7 @@ public class Style
 				return "none";
 			}
 
-			return pm.getColor(color);
+			return pm.getColor(String.valueOf(Integer.parseInt(color) - 1));
 		}
 		
 		return color;

+ 75 - 52
src/com/mxgraph/io/vsdx/VsdxShape.java

@@ -35,7 +35,9 @@ import com.mxgraph.online.Utils;
 import com.mxgraph.util.mxConstants;
 import com.mxgraph.util.mxPoint;
 import com.mxgraph.util.mxResources;
+import com.mxgraph.view.mxCellState;
 import com.mxgraph.view.mxGraph;
+import com.mxgraph.view.mxGraphView;
 
 /**
  * This class is a wrapper for one Shape Element.<br/>
@@ -84,6 +86,11 @@ public class VsdxShape extends Shape
 	 */
 	protected String shapeName = null;
 	
+	/**
+	 * Shape index
+	 */
+	protected int shapeIndex = 0;
+	
 	/**
 	 * Whether this cell is a vertex
 	 */
@@ -252,8 +259,6 @@ public class VsdxShape extends Shape
 		this.rotation = rotation * 100/100;
 		this.rotation = this.rotation % 360.0;
 		
-		this.vertex = vertex;
-		
 		mxVsdxTheme	theme = model.getThemes().get(page.getCellIntValue("ThemeIndex", 33));
 		int variant = page.getCellIntValue("VariationColorIndex", 0);
 		
@@ -286,6 +291,9 @@ public class VsdxShape extends Shape
 		{
 			processGeomList(null);
 		}
+		//several shapes have beginX/Y and also has a fill color, thus it is better to render it as a vertex
+		//vsdx can have an edge as a group!
+		this.vertex = vertex || isGroup() || (geomList != null && !geomList.isNoFill());
 	}
 	
 	/**
@@ -463,7 +471,8 @@ public class VsdxShape extends Shape
 		fontStyle |= isUnderline(index) ? mxConstants.FONT_UNDERLINE : 0;
 		this.styleMap.put("fontStyle", String.valueOf(fontStyle));
 		
-		this.styleMap.put(mxConstants.STYLE_TEXT_OPACITY, getTextOpacity(index));
+		//Commented out as the method getTextOpacity returns value between 0 and 1 instead of 0 - 100
+//		this.styleMap.put(mxConstants.STYLE_TEXT_OPACITY, getTextOpacity(index));
 
 		int numValues = para.numValues();
 		String result = null;
@@ -750,7 +759,9 @@ public class VsdxShape extends Shape
 		String gradient = "";
 		String fillPattern = this.getValue(this.getCellElement(mxVsdxConstants.FILL_PATTERN), "0");
 
-		if (fillPattern.equals("25") || fillPattern.equals("27") || fillPattern.equals("28") || fillPattern.equals("30"))
+//		if (fillPattern.equals("25") || fillPattern.equals("27") || fillPattern.equals("28") || fillPattern.equals("30"))
+		//approximate all gradients of vsdx with mxGraph one
+		if (Integer.parseInt(fillPattern) >= 25)
 		{
 			gradient = this.getColor(this.getCellElement(mxVsdxConstants.FILL_BKGND));
 		}
@@ -905,13 +916,14 @@ public class VsdxShape extends Shape
 		styleMap.put("vsdxID", this.getId().toString());
 		
 		// Rotation.		
-		String labelRotation = getLabelRotation() ? "1" : "0";
+//		String labelRotation = getLabelRotation() ? "1" : "0";
 		this.rotation = Math.round(this.rotation);
 
-		if (!labelRotation.equals("1") && this.rotation != 90 && this.rotation != 270)
-		{
-			styleMap.put(mxConstants.STYLE_HORIZONTAL, labelRotation);
-		}
+		//It gives wrong results, may be it is needed in other scenarios
+//		if (!labelRotation.equals("1") && this.rotation != 90 && this.rotation != 270)
+//		{
+//			styleMap.put(mxConstants.STYLE_HORIZONTAL, labelRotation);
+//		}
 
 		if (this.rotation != 0)
 		{
@@ -1056,24 +1068,19 @@ public class VsdxShape extends Shape
 			styleMap.put(mxConstants.STYLE_DIRECTION, direction);
 		}
 		
-		Element xForm = (Element) shape.getElementsByTagName(mxVsdxConstants.X_FORM).item(0);
+		String flibX = getValue(this.getCellElement(mxVsdxConstants.FLIP_X), "0");
+		String flibY = getValue(this.getCellElement(mxVsdxConstants.FLIP_X), "0");
 		
-		if (xForm != null)
+		if ("1".equals(flibX))
 		{
-			Node flipX = xForm.getElementsByTagName(mxVsdxConstants.FLIP_X).item(0); 
-			Node flipY = xForm.getElementsByTagName(mxVsdxConstants.FLIP_Y).item(0); 
-			
-			if (flipX != null && flipX.getTextContent().equals("1"))
-			{
-				styleMap.put(mxConstants.STYLE_FLIPH, "1");
-			}
-			
-			if (flipY != null && flipY.getTextContent().equals("1"))
-			{
-				styleMap.put(mxConstants.STYLE_FLIPV, "1");
-			}
+			styleMap.put(mxConstants.STYLE_FLIPH, "1");
 		}
 		
+		if ("1".equals(flibY))
+		{
+			styleMap.put(mxConstants.STYLE_FLIPV, "1");
+		}
+
 		resolveCommonStyles();
 
 		return this.styleMap;
@@ -1144,15 +1151,9 @@ public class VsdxShape extends Shape
 	 */
 	public double getLineWidth()
 	{
-		//if an edge has a fill geometry, then the line width matches the min of the shape width & height 
-		if (!isVertex() && geomList != null && !geomList.isNoFill())
-		{
-			return Math.min(height, width);
-		}
-
-		String lineWeight = getValue(this.getCellElement(mxVsdxConstants.LINE_WEIGHT), "0");
+		String lineWeight = getValue(this.getCellElement(mxVsdxConstants.LINE_WEIGHT), "1");
 		
-		double lWeight = 0;
+		double lWeight = 1;
 		try
 		{
 			if (lineWeight.equals("Themed"))
@@ -1756,31 +1757,31 @@ public class VsdxShape extends Shape
 	
 	public boolean isDisplacedLabel()
 	{
-		String txtPinXF = this.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_PIN_X, "F", "");
-		String txtPinYF = this.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_PIN_Y, "F", "");
-		String txtWidthF = this.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_WIDTH, "F", "");
-		String txtHeightF = this.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_HEIGHT, "F", "");
+		String txtPinXF = this.getAttribute(mxVsdxConstants.TXT_PIN_X, "F", "");
+		String txtPinYF = this.getAttribute(mxVsdxConstants.TXT_PIN_Y, "F", "");
+		String txtWidthF = this.getAttribute(mxVsdxConstants.TXT_WIDTH, "F", "");
+		String txtHeightF = this.getAttribute(mxVsdxConstants.TXT_HEIGHT, "F", "");
 
 		if (masterShape != null)
 		{
 			if (txtPinXF == "" || txtPinXF.toLowerCase().equals("inh"))
 			{
-				txtPinXF = masterShape.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_PIN_X, "F", "");
+				txtPinXF = masterShape.getAttribute(mxVsdxConstants.TXT_PIN_X, "F", "");
 			}
 
 			if (txtPinYF == "" || txtPinYF.toLowerCase().equals("inh"))
 			{
-				txtPinYF = masterShape.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_PIN_Y, "F", "");
+				txtPinYF = masterShape.getAttribute(mxVsdxConstants.TXT_PIN_Y, "F", "");
 			}
 
 			if (txtWidthF == "" || txtWidthF.toLowerCase().equals("inh"))
 			{
-				txtWidthF = masterShape.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_WIDTH, "F", "");
+				txtWidthF = masterShape.getAttribute(mxVsdxConstants.TXT_WIDTH, "F", "");
 			}
 
 			if (txtHeightF == "" || txtHeightF.toLowerCase().equals("inh"))
 			{
-				txtHeightF = masterShape.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_HEIGHT, "F", "");
+				txtHeightF = masterShape.getAttribute(mxVsdxConstants.TXT_HEIGHT, "F", "");
 			}
 		}
 
@@ -1811,13 +1812,13 @@ public class VsdxShape extends Shape
 	
 	public boolean isRotatedLabel()
 	{
-		String txtAngleValue = this.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_ANGLE, "V", "");
+		String txtAngleValue = this.getAttribute(mxVsdxConstants.TXT_ANGLE, "V", "");
 
 		if (masterShape != null)
 		{
 			if (txtAngleValue.equals(""))
 			{
-				txtAngleValue = masterShape.getAttribute(mxVsdxConstants.TEXT_X_FORM, mxVsdxConstants.TXT_ANGLE, "V", "");
+				txtAngleValue = masterShape.getAttribute(mxVsdxConstants.TXT_ANGLE, "V", "");
 			}
 
 		}
@@ -1873,7 +1874,7 @@ public class VsdxShape extends Shape
 	 * @param parentHeight Height of the parent of the shape.
 	 * @return List of mxPoint that represents the routing points.
 	 */
-	public List<mxPoint> getRoutingPoints(double parentHeight, mxPoint startPoint, double rotation/*, boolean flibX, boolean flibY*/)
+	public List<mxPoint> getRoutingPoints(double parentHeight, mxPoint startPoint, double rotation/*, boolean flipX, boolean flipY*/)
 	{
 		if (geomList != null)
 		{
@@ -2227,6 +2228,8 @@ public class VsdxShape extends Shape
 			
 			// Doesn't make sense to set a shape, it's not rendered and doesn't affect the text perimeter
 			styleMap.remove("shape");
+			//image should be set for the parent shape only
+			styleMap.remove("image");
 			//styleMap.put("html", "1");
 
 			if (txtAngleV != 0)
@@ -2254,28 +2257,48 @@ public class VsdxShape extends Shape
 		return null;
 	}
 
-	public mxPoint getLblEdgeOffset(mxPoint beginXY, mxPoint endXY, List<mxPoint> points) 
+	public mxPoint getLblEdgeOffset(mxGraphView view, List<mxPoint> points) 
 	{
-		//currently, edges with multiple segments are not supported
-		//TODO use the code from https://github.com/jgraph/mxgraph/blob/master/javascript/src/js/view/mxGraphView.js#L1953 to calculate mxGraph label offset instead of the default mid point (width/2, height/2)
-		if (points == null || points.isEmpty() || points.size() == 2) //points can hold two points representing begin and end point
+		if (points != null && points.size() > 1)
 		{
-	        //Calculate the text offset
+			//find mxGraph label offset
+			mxCellState state = new mxCellState();
+			state.setAbsolutePoints(points);
+			view.updateEdgeBounds(state);
+			mxPoint mxOffset = view.getPoint(state);
+			mxPoint p0 = points.get(0);
+			mxPoint pe = points.get(points.size()-1);
+
+			//Calculate the text offset
 	        double txtWV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_WIDTH), getWidth());
 	        double txtHV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_HEIGHT), getHeight());
 	        double txtLocPinXV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_LOC_PIN_X), 0);
 	        double txtLocPinYV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_LOC_PIN_Y), 0);
 	        double txtPinXV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_PIN_X), 0);
 	        double txtPinYV = getScreenNumericalValue(getShapeNode(mxVsdxConstants.TXT_PIN_Y), 0);
-	
-			double y = getHeight()/2 - (txtPinYV - txtLocPinYV + txtHV/2);
-			double x = txtPinXV - txtLocPinXV + txtWV/2 - getWidth()/2;
-	
-	        return new mxPoint(x, y);
+
+	        double y = (getHeight() - (p0.getY() - pe.getY()))/2 + p0.getY() - mxOffset.getY() - (txtPinYV - txtLocPinYV + txtHV/2);
+			double x = txtPinXV - txtLocPinXV + txtWV/2 + (p0.getX() - mxOffset.getX());
+
+			//FIXME one file has txtPinX/Y values extremely high which cause draw.io to hang
+//			<Cell N='TxtPinX' V='-1.651384506429589E199' F='SETATREF(Controls.TextPosition)'/>
+//			<Cell N='TxtPinY' V='1.183491078740126E185' F='SETATREF(Controls.TextPosition.Y)'/>
+			if (Math.abs(x) > 10e10) return null;
+			
+			return new mxPoint(x, y);
 		}
 		else
 		{
 			return null;
 		}
 	}
+
+	public int getShapeIndex() {
+		return shapeIndex;
+	}
+
+	public void setShapeIndex(int shapeIndex) {
+		this.shapeIndex = shapeIndex;
+	}
+	
 }

+ 1 - 1
src/com/mxgraph/io/vsdx/geometry/ArcTo.java

@@ -20,7 +20,7 @@ public class ArcTo extends Row
 			double h = shape.getHeight();
 			double w = shape.getWidth();
 			double x0 = Math.round(shape.getLastX() * w) / 100;
-			double y0 = Math.round(shape.getLastX() * h) / 100;
+			double y0 = Math.round(shape.getLastY() * h) / 100;
 			double x = this.x * mxVsdxUtils.conversionFactor;
 			
 			double y = this.y * mxVsdxUtils.conversionFactor;

+ 153 - 12
src/com/mxgraph/io/vsdx/geometry/Ellipse.java

@@ -40,24 +40,165 @@ public class Ellipse extends Row
 			double dx2 = Math.abs(c - x);
 			double dy2 = Math.abs(d - y);
 			double r2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
-			double newX = (x - r1) * 100 / w;
-			double newY = (y - r2) * 100 / h;
-			double newW = 2 * r1 * 100 / w;
-			double newH = 2 * r2 * 100 / h;
+			double newX = x * 100 / w;
+			double newY = y * 100 / h;
+			double newW = (r1 * 100 / w)/2;
+			double newH = (r2 * 100 / h)/2;
 			newH = Math.round(newH * 100.0) / 100.0;
 			newW = Math.round(newW * 100.0) / 100.0;
-			newX = Math.round(newX * 100.0) / 100.0;
+			double newX1 = Math.round((newX - 2 * newW) * 100.0) / 100.0;
+			double newX2 = Math.round((newX + 2 * newW) * 100.0) / 100.0;
 			newY = Math.round(newY * 100.0) / 100.0;
 			
-			return "<ellipse" + 
-					" x=\"" + String.valueOf(newX) + 
-					"\" y=\"" + String.valueOf(newY) + 
-					"\" w=\"" + String.valueOf(newW) + 
-					"\" h=\"" + String.valueOf(newH) + 
-					"\"/>";
+			
+			return  "<move x=\"" + String.valueOf(newX1) + "\" y=\"" + String.valueOf(newY) + "\"/>" +
+								"<arc" +
+								" rx=\"" + String.valueOf(newW) + 
+								"\" ry=\"" + String.valueOf(newH) + 
+								"\" x=\"" + String.valueOf(newX2) + 
+								"\" y=\"" + String.valueOf(newY) + 
+								"\" x-axis-rotation=\"0\" large-arc-flag=\"1\" sweep-flag=\"0\"/>" +
+								
+								"<arc" +
+								" rx=\"" + String.valueOf(newW) + 
+								"\" ry=\"" + String.valueOf(newH) + 
+								"\" x=\"" + String.valueOf(newX1) + 
+								"\" y=\"" + String.valueOf(newY) + 
+								"\" x-axis-rotation=\"0\" large-arc-flag=\"1\" sweep-flag=\"0\"/>";
 		}
 		
 		return "";
 	}
-
+	
+//	public String handle1(mxPoint p, Shape1 shape)
+//	{
+//		if (this.x != null && this.y != null && this.a != null && this.b != null && this.c != null && this.d != null)
+//		{
+//			double h = shape.getHeight();
+//			double w = shape.getWidth();
+//
+//			double x = this.x * mxVsdxUtils.conversionFactor;
+//			double y = this.y * mxVsdxUtils.conversionFactor;
+//			y = h - y;
+//			double a = this.a * mxVsdxUtils.conversionFactor;
+//			double b = this.b * mxVsdxUtils.conversionFactor;
+//			b = h - b;
+//			double c = this.c * mxVsdxUtils.conversionFactor;
+//			double d = this.d * mxVsdxUtils.conversionFactor;
+//			d = h - d;
+//			
+//			double dx1 = Math.abs(a - x);
+//			double dy1 = Math.abs(b - y);
+//			double r1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
+//
+//			double dx2 = Math.abs(c - x);
+//			double dy2 = Math.abs(d - y);
+//			double r2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
+//			double newX = x * 100 / w;
+//			double newY = y * 100 / h;
+//			double newW = (r1 * 100 / w)/2;
+//			double newH = (r2 * 100 / h)/2;
+//			newH = Math.round(newH * 100.0) / 100.0;
+//			newW = Math.round(newW * 100.0) / 100.0;
+//			double newX1 = Math.round((newX - 2 * newW) * 100.0) / 100.0;
+//			double newX2 = Math.round((newX + 2 * newW) * 100.0) / 100.0;
+//			newY = Math.round(newY * 100.0) / 100.0;
+//			
+//			
+//			return  "<move x=\"" + String.valueOf(newX1) + "\" y=\"" + String.valueOf(newY) + "\"/>" +
+//								"<arc" +
+//								" rx=\"" + String.valueOf(newW) + 
+//								"\" ry=\"" + String.valueOf(newH) + 
+//								"\" x=\"" + String.valueOf(newX2) + 
+//								"\" y=\"" + String.valueOf(newY) + 
+//								"\" x-axis-rotation=\"0\" large-arc-flag=\"1\" sweep-flag=\"0\"/>" +
+//								
+//								"<arc" +
+//								" rx=\"" + String.valueOf(newW) + 
+//								"\" ry=\"" + String.valueOf(newH) + 
+//								"\" x=\"" + String.valueOf(newX1) + 
+//								"\" y=\"" + String.valueOf(newY) + 
+//								"\" x-axis-rotation=\"0\" large-arc-flag=\"1\" sweep-flag=\"0\"/>";
+//		}
+//		
+//		return "";
+//	}
+//
+//	
+//	public String handle2(mxPoint p, Shape1 shape)
+//	{
+//		if (this.x != null && this.y != null && this.a != null && this.b != null && this.c != null && this.d != null)
+//		{
+//			double h = shape.getHeight();
+//			double w = shape.getWidth();
+//
+//			double x = this.x * mxVsdxUtils.conversionFactor;
+//			double y = this.y * mxVsdxUtils.conversionFactor;
+//			y = h - y;
+//			double a = this.a * mxVsdxUtils.conversionFactor;
+//			double b = this.b * mxVsdxUtils.conversionFactor;
+//			b = h - b;
+//			double c = this.c * mxVsdxUtils.conversionFactor;
+//			double d = this.d * mxVsdxUtils.conversionFactor;
+//			d = h - d;
+//			
+//			double dx1 = Math.abs(a - x);
+//			double dy1 = Math.abs(b - y);
+//			double r1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
+//
+//			double dx2 = Math.abs(c - x);
+//			double dy2 = Math.abs(d - y);
+//			double r2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
+//			double newX = (x - r1) * 100 / w;
+//			double newY = (y - r2) * 100 / h;
+//			double newW = 2 * r1 * 100 / w;
+//			double newH = 2 * r2 * 100 / h;
+//			newH = Math.round(newH * 100.0) / 100.0;
+//			newW = Math.round(newW * 100.0) / 100.0;
+//			newX = Math.round(newX * 100.0) / 100.0;
+//			newY = Math.round(newY * 100.0) / 100.0;
+//			
+//			return "<ellipse" + 
+//					" x=\"" + String.valueOf(newX) + 
+//					"\" y=\"" + String.valueOf(newY) + 
+//					"\" w=\"" + String.valueOf(newW) + 
+//					"\" h=\"" + String.valueOf(newH) + 
+//					"\"/>";
+//		}
+//		
+//		return "";
+//	}
+//	
+//	
+//	public static class Shape1 {
+//		double width, height;
+//
+//		public double getWidth() {
+//			return width;
+//		}
+//
+//		public double getHeight() {
+//			return height;
+//		}
+//
+//		public void setWidth(double width) {
+//			this.width = width;
+//		}
+//
+//		public void setHeight(double height) {
+//			this.height = height;
+//		}
+//
+//		public Shape1(double width, double height) {
+//			this.width = width;
+//			this.height = height;
+//		}
+//		
+//	}
+//	public static void main(String[] args) {
+//		Shape1 shape = new Shape1(160.91, 76.2);
+//		Ellipse ellipse = new Ellipse(0, 0.5, 0.1, 0.93, 0.1, 0.90, 0.50);
+//		System.out.println(ellipse.handle1(null, shape));
+//		System.out.println(ellipse.handle2(null, shape));
+//	}
 }

+ 19 - 1
src/com/mxgraph/io/vsdx/geometry/RelQuadBezTo.java

@@ -15,7 +15,25 @@ public class RelQuadBezTo extends Row
 	@Override
 	public String handle(mxPoint p, Shape shape)
 	{
-		//TODO implement this!
+		if (this.x != null && this.y != null && this.a != null && this.b != null)
+		{
+			double x = this.x * 100;
+			double y = 100 - this.y * 100;
+			double x1 = this.a * 100.0;
+			double y1 = 100 - this.b * 100.0;
+
+			x = Math.round(x * 100.0) / 100.0;
+			y = Math.round(y * 100.0) / 100.0;
+			x1 = Math.round(x1 * 100.0) / 100.0;
+			y1 = Math.round(y1 * 100.0) / 100.0;
+
+			shape.setLastX(x);
+			shape.setLastY(y);
+		
+			return "<quad x1=\"" + String.valueOf(x1) + "\" y1=\"" + String.valueOf(y1) + 
+					      "\" x2=\"" + String.valueOf(x) + "\" y2=\"" + String.valueOf(y) + "\"/>";
+		}
+
 		return "";
 	}
 

+ 1 - 1
src/com/mxgraph/io/vsdx/mxPropertiesManager.java

@@ -50,7 +50,7 @@ public class mxPropertiesManager
 	{
 		defaultColors.put("0", "#000000");
 		defaultColors.put("1", "#FFFFFF");
-		defaultColors.put("2", "#FFFFFF"); // Multiple label background test cases suggest white, flow3.vsdx for example
+		defaultColors.put("2", "#FF0000");
 		defaultColors.put("3", "#00FF00");
 		defaultColors.put("4", "#0000FF");
 		defaultColors.put("5", "#FFFF00");

+ 0 - 3
src/com/mxgraph/io/vsdx/mxVsdxConstants.java

@@ -117,7 +117,6 @@ public class mxVsdxConstants
 	public static String TEXT_BKGND = "TextBkgnd";
 	public static String TEXT_BLOCK = "TextBlock";
 	public static String TEXT_STYLE = "TextStyle";
-	public static String TEXT_X_FORM = "TextXForm";
 	public static String TO_PART = "ToPart";
 	public static String TO_SHEET = "ToSheet";
 	public static String TOP_MARGIN = "TopMargin";
@@ -137,8 +136,6 @@ public class mxVsdxConstants
 	public static String WIDTH = "Width";
 	public static String X_CON = "XCon";
 	public static String X_DYN = "XDyn";
-	public static String X_FORM = "XForm";
-	public static String X_FORM_1D = "XForm1D";
 	public static String X = "X";
 	public static String Y_CON = "YCon";
 	public static String Y_DYN = "YDyn";

+ 2 - 23
src/com/mxgraph/io/vsdx/mxVsdxGeometry.java

@@ -157,34 +157,13 @@ public class mxVsdxGeometry {
 	{
 		if (noShow) return "";
 		
-		StringBuilder geomElemParsed = new StringBuilder("<path>");
-		int initSize = geomElemParsed.length();
+		StringBuilder geomElemParsed = new StringBuilder();
 		
 		for (Row row : rows)
 		{
 			geomElemParsed.append(row.handle(p, shape));
 		}
-
-		if (geomElemParsed.length() > initSize)
-		{
-			geomElemParsed.append("</path>");
-			
-			if (!noLine && !noFill)
-			{
-				geomElemParsed.append("<fillstroke/>");
-			}
-			else if (!noFill)
-			{
-				geomElemParsed.append("<fill/>");
-			}
-			else if (!noLine)
-			{
-				geomElemParsed.append("<stroke/>");
-			}
-			
-			return geomElemParsed.toString();
-		}
 		
-		return "";
+		return geomElemParsed.toString();
 	}
 }

+ 80 - 5
src/com/mxgraph/io/vsdx/mxVsdxGeometryList.java

@@ -103,7 +103,7 @@ public class mxVsdxGeometryList
 	 * @param parentHeight Height of the parent of the shape.
 	 * @return List of mxPoint that represents the routing points.
 	 */
-	public List<mxPoint> getRoutingPoints(double parentHeight, mxPoint startPoint, double rotation/*, boolean flibX, boolean flibY*/)
+	public List<mxPoint> getRoutingPoints(double parentHeight, mxPoint startPoint, double rotation)
 	{
 		sort();
 		
@@ -167,20 +167,95 @@ public class mxVsdxGeometryList
 		StringBuilder parsedGeom = new StringBuilder("<shape strokewidth=\"inherit\"><foreground>");
 		int initSize = parsedGeom.length();
 		
-		for (mxVsdxGeometry geo : geomList)
-		{
-			parsedGeom.append(geo.getPathXML(p, shape));
-		}
+		int lastGeoStyle = -1;
+
+		//first all geo with fill then without
+		lastGeoStyle = processGeo(shape, p, parsedGeom, lastGeoStyle, true);
+
+		lastGeoStyle = processGeo(shape, p, parsedGeom, lastGeoStyle, false);
 
 		if (parsedGeom.length() == initSize)
 		{
 			return "";
 		}
+		else
+		{
+			closePath(parsedGeom, lastGeoStyle);
+		}
 		
 		//System.out.println(parsedGeom);
 		
 		parsedGeom.append("</foreground></shape>");
 		return parsedGeom.toString();
 	}
+
+	private int processGeo(Shape shape, mxPoint p, StringBuilder parsedGeom, int lastGeoStyle, boolean withFill) {
+		for (mxVsdxGeometry geo : geomList)
+		{
+			
+			if (withFill == geo.isNoFill()) continue;
+			
+			String str = geo.getPathXML(p, shape);
+			
+			if (!str.isEmpty())
+			{
+				int geoStyle = getGeoStyle(geo);
+				 
+				if (lastGeoStyle == -1) //first one
+				{
+					parsedGeom.append("<path>");
+					parsedGeom.append(str);
+				}
+				else if (lastGeoStyle != geoStyle) 
+				{
+					closePath(parsedGeom, lastGeoStyle);
+					parsedGeom.append("<path>");
+					parsedGeom.append(str);
+				}
+				else
+				{
+					//parsedGeom.append("<close/>");
+					parsedGeom.append(str);
+				}
+				lastGeoStyle = geoStyle;
+			}
+		}
+		return lastGeoStyle;
+	}
+
+	private int getGeoStyle(mxVsdxGeometry geo) 
+	{
+		int geoStyle = 0;
+		if (!geo.isNoLine() && !geo.isNoFill())
+		{
+			geoStyle = 1;
+		}
+		else if (!geo.isNoFill())
+		{
+			geoStyle = 2;
+		}
+		else if (!geo.isNoLine())
+		{
+			geoStyle = 3;
+		}
+		return geoStyle;
+	}
+
+	private void closePath(StringBuilder parsedGeom, int geoStyle) 
+	{
+		parsedGeom.append("</path>");
+		if (geoStyle == 1)
+		{
+			parsedGeom.append("<fillstroke/>");
+		}
+		else if (geoStyle == 2)
+		{
+			parsedGeom.append("<fill/>");
+		}
+		else if (geoStyle == 3)
+		{
+			parsedGeom.append("<stroke/>");
+		}
+	}
 	
 }

+ 10 - 11
src/com/mxgraph/io/vsdx/mxVsdxPage.java

@@ -211,26 +211,25 @@ public class mxVsdxPage {
 					{
 						masterTmp = model.getMaster(masterId);
 					}
-					else
-					{
-						masterId = shapeElem.getAttribute(mxVsdxConstants.MASTER_SHAPE);
-	
-						if (masterId != null && !masterId.equals(""))
-						{
-							masterTmp = model.getMaster(masterId);
-						}					
-					}
 				}
 				
 				boolean isEdge = isEdge(shapeElem);
-				//String type = mxVdxShape.getType(shapeElem);
 				
 				// If the master of the shape has an xform1D, it's an edge
 				if (!isEdge && masterTmp != null)
 				{
-					isEdge = isEdge(masterTmp.getMasterElement());
+					String masterId = shapeElem.getAttribute(mxVsdxConstants.MASTER_SHAPE);
+
+					Element elem = masterTmp.getMasterElement();
+					if (masterId != null && !masterId.equals(""))
+					{
+						elem = masterTmp.getSubShape(masterId).getShape();
+					}
+					isEdge = isEdge(elem);
 				}
 				
+				//String type = mxVdxShape.getType(shapeElem);
+				
 				VsdxShape shape = this.createCell(shapeElem, !isEdge, masterTmp);
 				
 				shapes.put(shape.getId(), shape);

+ 0 - 1
src/com/mxgraph/io/vsdx/mxVsdxTheme.java

@@ -11,7 +11,6 @@ import com.mxgraph.io.vsdx.theme.Color;
 import com.mxgraph.io.vsdx.theme.FillStyle;
 import com.mxgraph.io.vsdx.theme.FillStyleFactory;
 import com.mxgraph.io.vsdx.theme.GradFill;
-import com.mxgraph.io.vsdx.theme.HSLColor;
 import com.mxgraph.io.vsdx.theme.LineStyle;
 import com.mxgraph.io.vsdx.theme.LineStyleExt;
 import com.mxgraph.io.vsdx.theme.OoxmlColor;

+ 0 - 16
src/com/mxgraph/online/SaveServlet.java

@@ -123,22 +123,6 @@ public class SaveServlet extends HttpServlet
 						format = "xml";
 					}
 
-					if (mime == null)
-					{
-						if (format.equals("xml"))
-						{
-							mime = "application/xml";
-						}
-						else if (format.equals("svg"))
-						{
-							mime = "image/svg+xml";
-						}
-						else
-						{
-							mime = "text/plain";
-						}
-					}
-
 					if (filename != null && filename.length() > 0
 							&& !filename.toLowerCase().endsWith(".svg")
 							&& !filename.toLowerCase().endsWith(".html")

+ 4 - 0
war/WEB-INF/appengine-web.xml

@@ -26,6 +26,10 @@
     	<include path="/**" />
 	</static-files>
 	
+	<resource-files>
+        <exclude path="/node_modules/**" />
+    </resource-files>
+	
 	<instance-class>F2</instance-class>
 	<automatic-scaling>
     	<min-idle-instances>1</min-idle-instances>

TEMPAT SAMPAH
war/WEB-INF/lib/im4java-1.4.0.jar


+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 04/20/2017 10:15 AM
+# 04/27/2017 09:16 AM
 
 app.html
 index.html?offline=1

TEMPAT SAMPAH
war/images/sidebar-clipart.jpg


TEMPAT SAMPAH
war/images/sidebar-clipart.png


File diff ditekan karena terlalu besar
+ 193 - 187
war/js/app.min.js


File diff ditekan karena terlalu besar
+ 87 - 87
war/js/atlas-viewer.min.js


File diff ditekan karena terlalu besar
+ 176 - 173
war/js/atlas.min.js


+ 43 - 22
war/js/diagramly/App.js

@@ -157,6 +157,21 @@ App.MODE_BROWSER = 'browser';
  */
 App.DROPBOX_APPKEY = 'libwls2fa9szdji';
 
+/**
+ * Sets the delay for autosave in milliseconds. Default is 2000.
+ */
+App.DROPBOX_URL = 'https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js';
+
+/**
+ * Sets the delay for autosave in milliseconds. Default is 2000.
+ */
+App.DROPINS_URL = 'https://www.dropbox.com/static/api/2/dropins.js';
+
+/**
+ * Sets the delay for autosave in milliseconds. Default is 2000.
+ */
+App.ONEDRIVE_URL = 'https://js.live.net/v7.0/OneDrive.js';
+
 /**
  * Defines plugin IDs for loading via p URL parameter. Update the table at
  * https://desk.draw.io/solution/articles/16000042546
@@ -283,11 +298,10 @@ App.getStoredMode = function()
 						if (App.mode == App.MODE_DROPBOX || (window.location.hash != null &&
 							window.location.hash.substring(0, 2) == '#D'))
 						{
-							mxscript('https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js');
+							mxscript(App.DROPBOX_URL);
 							
 							// Must load this after the dropbox SDK since they use the same namespace
-							mxscript('https://www.dropbox.com/static/api/2/dropins.js',
-									null, 'dropboxjs', App.DROPBOX_APPKEY);
+							mxscript(App.DROPINS_URL, null, 'dropboxjs', App.DROPBOX_APPKEY);
 						}
 						else if (urlParams['chrome'] == '0')
 						{
@@ -311,7 +325,7 @@ App.getStoredMode = function()
 						if (App.mode == App.MODE_ONEDRIVE || (window.location.hash != null &&
 							window.location.hash.substring(0, 2) == '#W'))
 						{
-							mxscript('https://js.live.net/v5.0/wl.js');
+							mxscript(App.ONEDRIVE_URL);
 						}
 						else if (urlParams['chrome'] == '0')
 						{
@@ -592,10 +606,10 @@ App.main = function(callback)
 				(urlParams['embed'] == '1' && urlParams['db'] == '1')) &&
 				isSvgBrowser && (document.documentMode == null || document.documentMode > 9))))
 			{
-				mxscript('https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js', function()
+				mxscript(App.DROPBOX_URL, function()
 				{
 					// Must load this after the dropbox SDK since they use the same namespace
-					mxscript('https://www.dropbox.com/static/api/2/dropins.js', function()
+					mxscript(App.DROPINS_URL, function()
 					{
 						DrawDropboxClientCallback();
 					}, 'dropboxjs', App.DROPBOX_APPKEY);
@@ -609,15 +623,15 @@ App.main = function(callback)
 				
 			// Loads OneDrive for all browsers but IE6/IOS if not disabled or if enabled and in embed mode
 			if (typeof window.OneDriveClient === 'function' &&
-				(typeof WL === 'undefined' && window.DrawOneDriveClientCallback != null &&
+				(typeof OneDrive === 'undefined' && window.DrawOneDriveClientCallback != null &&
 				(((urlParams['embed'] != '1' && urlParams['od'] != '0') || (urlParams['embed'] == '1' &&
 				urlParams['od'] == '1')) && !/(iPad|iPhone|iPod)/.test(navigator.userAgent) &&
 				(navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 10))))
 			{
-				mxscript('https://js.live.net/v5.0/wl.js', window.DrawOneDriveClientCallback);
+				mxscript(App.ONEDRIVE_URL, window.DrawOneDriveClientCallback);
 			}
 			// Disables client
-			else if (typeof window.WL === 'undefined')
+			else if (typeof window.OneDrive === 'undefined')
 			{
 				window.OneDriveClient = null;
 			}
@@ -747,7 +761,7 @@ App.prototype.init = function()
 		 */
 		var initOneDriveClient = mxUtils.bind(this, function()
 		{
-			if (typeof WL !== 'undefined')
+			if (typeof OneDrive !== 'undefined')
 			{
 				/**
 				 * Holds the x-coordinate of the point.
@@ -2079,7 +2093,7 @@ App.prototype.start = function()
 	this.bg.parentNode.removeChild(this.bg);
 	this.restoreLibraries();
 	this.spinner.stop();
-
+	
 	try
 	{
 		// Listens to changes of the hash if not in embed or client mode
@@ -2100,11 +2114,15 @@ App.prototype.start = function()
 				}
 				catch (e)
 				{
-					this.handleError(e, mxResources.get('errorLoadingFile'), mxUtils.bind(this, function()
+					// Workaround for possible scrollWidth of null in Dialog ctor
+					if (document.body != null)
 					{
-						var file = this.getCurrentFile();
-						window.location.hash = (file != null) ? file.getHash() : '';
-					}));
+						this.handleError(e, mxResources.get('errorLoadingFile'), mxUtils.bind(this, function()
+						{
+							var file = this.getCurrentFile();
+							window.location.hash = (file != null) ? file.getHash() : '';
+						}));
+					}
 				}
 			}));
 		}
@@ -3259,6 +3277,11 @@ App.prototype.fileCreated = function(file, libs, replace, done)
 				window.openFile = null;
 				this.fileLoaded(file);
 				
+				if (replace)
+				{
+					this.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+				}
+				
 				if (libs != null)
 				{
 					this.sidebar.showEntries(libs);
@@ -3267,7 +3290,7 @@ App.prototype.fileCreated = function(file, libs, replace, done)
 
 			var fn2 = mxUtils.bind(this, function()
 			{
-				if (currentFile == null || !currentFile.isModified())
+				if (replace || currentFile == null || !currentFile.isModified())
 				{
 					fn3();
 				}
@@ -3281,7 +3304,7 @@ App.prototype.fileCreated = function(file, libs, replace, done)
 			{
 				done();
 			}
-
+			
 			// Opens the file in a new window
 			if (replace != null && !replace)
 			{
@@ -3946,16 +3969,14 @@ App.prototype.pickFolder = function(mode, fn, enabled)
 	}
 	else if (enabled && mode == App.MODE_ONEDRIVE && this.oneDrive != null)
 	{
-		this.oneDrive.pickFolder(mxUtils.bind(this, function(evt)
+		this.oneDrive.pickFolder(mxUtils.bind(this, function(files)
 		{
 			var folderId = null;
 			resume();
 			
-			if (evt != null && evt.data != null && evt.data.folders != null &&
-				evt.data.folders.length > 0)
+			if (files != null && files.value != null && files.value.length > 0)
 			{
-				folderId = evt.data.folders[0].id;
-        		folderId = folderId.substring(folderId.lastIndexOf('.') + 1);
+				folderId = files.value[0].id;
         		fn(folderId);
 			}
 		}));

+ 69 - 17
war/js/diagramly/Dialogs.js

@@ -533,25 +533,34 @@ var SplashDialog = function(editorUi)
 		storage = mxResources.get('browser');
 	}
 	
-	if (!mxClient.IS_CHROMEAPP && serviceCount > 1)
+	if (!mxClient.IS_CHROMEAPP)
 	{
-		var link = document.createElement('a');
-		link.setAttribute('href', 'javascript:void(0)');
-		link.style.display = 'block';
-		link.style.marginTop = '6px';
-		mxUtils.write(link, mxResources.get('notUsingService', [storage]));
+		var driveUser = (editorUi.drive != null) ? editorUi.drive.getUser() : null;
 		
-		mxEvent.addListener(link, 'click', function()
+		function addLogout(logout)
 		{
-			editorUi.hideDialog(false);
-			editorUi.setMode(null);
-			editorUi.clearMode();
-			editorUi.showSplash(true);
-		});
-		
-		buttons.appendChild(link);
+			btn.style.marginBottom = '24px';
+			
+			var link = document.createElement('a');
+			link.setAttribute('href', 'javascript:void(0)');
+			link.style.display = 'block';
+			link.style.marginTop = '6px';
+			mxUtils.write(link, mxResources.get('signOut'));
 
-		var driveUser = (editorUi.drive != null) ? editorUi.drive.getUser() : null;
+			// Makes room after last big buttons
+			btn.style.marginBottom = '16px';
+			buttons.style.paddingBottom = '18px';
+			
+			mxEvent.addListener(link, 'click', function()
+			{
+				editorUi.confirm(mxResources.get('areYouSure'), function()
+				{
+					logout();
+				});
+			});
+			
+			buttons.appendChild(link);
+		};
 		
 		if (editorUi.mode == App.MODE_GOOGLE && driveUser != null)
 		{
@@ -560,7 +569,7 @@ var SplashDialog = function(editorUi)
 			var link = document.createElement('a');
 			link.setAttribute('href', 'javascript:void(0)');
 			link.style.display = 'block';
-			link.style.marginTop = '2px';
+			link.style.marginTop = '6px';
 			mxUtils.write(link, mxResources.get('changeUser') + ' (' + driveUser.displayName + ')');
 
 			// Makes room after last big buttons
@@ -594,6 +603,49 @@ var SplashDialog = function(editorUi)
 				}));
 			});
 
+			buttons.appendChild(link);
+		}
+		else if (editorUi.mode == App.MODE_ONEDRIVE && editorUi.oneDrive != null)
+		{
+			addLogout(function()
+			{
+				editorUi.oneDrive.logout();
+			});
+		}
+		else if (editorUi.mode == App.MODE_GITHUB && editorUi.gitHub != null)
+		{
+			addLogout(function()
+			{
+				editorUi.gitHub.logout();
+				window.open('https://www.github.com/logout');
+			});
+		}
+		else if (editorUi.mode == App.MODE_DROPBOX && editorUi.dropbox != null)
+		{
+			// NOTE: Dropbox has a logout option in the picker
+			addLogout(function()
+			{
+				editorUi.dropbox.logout();
+				window.open('https://www.dropbox.com/logout');
+			});
+		}
+		
+		if (serviceCount > 1)
+		{
+			var link = document.createElement('a');
+			link.setAttribute('href', 'javascript:void(0)');
+			link.style.display = 'block';
+			link.style.marginTop = '8px';
+			mxUtils.write(link, mxResources.get('notUsingService', [storage]));
+			
+			mxEvent.addListener(link, 'click', function()
+			{
+				editorUi.hideDialog(false);
+				editorUi.setMode(null);
+				editorUi.clearMode();
+				editorUi.showSplash(true);
+			});
+			
 			buttons.appendChild(link);
 		}
 	}
@@ -4589,7 +4641,7 @@ var FeedbackDialog = function(editorUi)
 			
 			if (editorUi.spinner.spin(document.body))
 			{
-				var postUrl = FeedbackDialog.feedbackUrl ? FeedbackDialog.feedbackUrl : '/email';
+				var postUrl = (FeedbackDialog.feedbackUrl != null) ? FeedbackDialog.feedbackUrl : '/email';
 				mxUtils.post(postUrl, 'email=' + encodeURIComponent(email.value) +
 						'&version=' + encodeURIComponent(EditorUi.VERSION) +
 						'&url=' + encodeURIComponent(window.location.href) +

+ 15 - 9
war/js/diagramly/EditorUi.js

@@ -15,9 +15,10 @@
 	EditorUi.compactUi = uiTheme != 'atlas';
 
 	/**
-	 * Overrides compact UI setting.
+	 * https://github.com/electron/electron/issues/2288
 	 */
-	EditorUi.isElectronApp = window && window.process && window.process.type; // https://github.com/electron/electron/issues/2288
+	EditorUi.isElectronApp = window != null && window.process != null &&
+		window.process.versions != null && window.process.versions['electron'] != null;
 
 	/**
 	 * Contains the default XML for an empty diagram.
@@ -6715,6 +6716,8 @@
 	 */
 	EditorUi.prototype.openLocalFile = function(data, name, temp)
 	{
+		var currentFile = this.getCurrentFile();
+		
 		var fn = mxUtils.bind(this, function()
 		{
 			window.openFile = null;
@@ -6734,10 +6737,14 @@
 				this.fileLoaded(new LocalFile(this, data, name || this.defaultFilename, temp));
 			}
 		});
-		
+
 		if (data != null && data.length > 0)
 		{
-			if (this.getCurrentFile() != null && !this.isDiagramEmpty())
+			if (currentFile == null || !currentFile.isModified())
+			{
+				fn();
+			}
+			else
 			{
 				window.openFile = new OpenFile(function()
 				{
@@ -6745,11 +6752,10 @@
 				});
 				
 				window.openFile.setData(data, name);
-				window.openWindow(this.getUrl(), null, fn);
-			}
-			else
-			{
-				fn();
+				window.openWindow(this.getUrl(), null, mxUtils.bind(this, function()
+				{
+					this.confirm(mxResources.get('allChangesLost'), fn);
+				}));
 			}
 		}
 	};

+ 18 - 6
war/js/diagramly/GitHubClient.js

@@ -771,12 +771,19 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		{
 			this.ui.spinner.stop();
 			
-			org = null;
-			repo = null;
-			ref = null;
-			path = null;
-			
-			selectRepo();
+			if (this.getUser() != null)
+			{
+				org = null;
+				repo = null;
+				ref = null;
+				path = null;
+				
+				selectRepo();
+			}
+			else
+			{
+				this.ui.hideDialog();
+			}
 		}));
 	});
 	
@@ -971,6 +978,11 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 									this.ui.handleError({message: mxResources.get('fileNotFound')});
 								}));
 							}
+							else
+							{
+								this.ui.spinner.stop();
+								this.ui.handleError({message: mxResources.get('invalidName')});
+							}
 						}
 					}), mxResources.get('enterValue'));
 					this.ui.showDialog(dlg.container, 300, 80, true, false);

+ 12 - 4
war/js/diagramly/GraphViewer.js

@@ -3,7 +3,7 @@
  */
 /**
  * No CSS and resources available in embed mode. Parameters and docs:
- * https://support.draw.io/pages/viewpage.action?pageId=12878123
+ * https://desk.draw.io/solution/articles/16000042542-how-to-embed-html-
  */
 GraphViewer = function(container, xmlNode, graphConfig)
 {
@@ -58,6 +58,11 @@ GraphViewer.prototype.imageBaseUrl = 'https://www.draw.io/';
  */
 GraphViewer.prototype.autoFit = true;
 
+/**
+ * Specifies if zooming in for auto fir is allowed. Default is false.
+ */
+GraphViewer.prototype.allowZoomIn = false;
+
 /**
  * Whether the title should be shown as a tooltip if the toolbar is disabled.
  * Default is false.
@@ -78,6 +83,8 @@ GraphViewer.prototype.init = function(container, xmlNode, graphConfig)
 	this.graphConfig = (graphConfig != null) ? graphConfig : {};
 	this.autoFit = (graphConfig['auto-fit'] != null) ?
 		graphConfig['auto-fit'] : this.autoFit;
+	this.allowZoomIn = (graphConfig['allow-zoom-in'] != null) ?
+		graphConfig['allow-zoom-in'] : this.allowZoomIn;
 	this.checkVisibleState = (graphConfig['check-visible-state'] != null) ?
 		graphConfig['check-visible-state'] : this.checkVisibleState;
 	this.toolbarItems = (this.graphConfig.toolbar != null) ?
@@ -428,7 +435,8 @@ GraphViewer.prototype.addSizeHandler = function()
 			{
 				handlingResize = true;
 
-				this.graph.maxFitScale = (maxScale != null) ? maxScale : (this.graphConfig.zoom || 1);
+				this.graph.maxFitScale = (maxScale != null) ? maxScale : (this.graphConfig.zoom ||
+					((this.allowZoomIn) ? null : 1));
 				this.graph.fit(null, null, null, null, false, true);
 				this.graph.maxFitScale = null;
 				
@@ -519,9 +527,9 @@ GraphViewer.prototype.addSizeHandler = function()
 			container.style.minWidth = '100%';
 		}
 		
-		if (container.offsetWidth > 0 &&
+		if (container.offsetWidth > 0 && (this.allowZoomIn ||
 			(bounds.width + 2 * this.graph.border > container.offsetWidth ||
-			bounds.height + 2 * this.graph.border > this.graphConfig['max-height']))
+			bounds.height + 2 * this.graph.border > this.graphConfig['max-height'])))
 		{
 			var maxScale = null;
 			

+ 60 - 37
war/js/diagramly/OneDriveClient.js

@@ -7,7 +7,6 @@ OneDriveClient = function(editorUi)
 	DrawioClient.call(this, editorUi, 'odauth');
 	
 	this.token = this.token;
-	WL.init({client_id: this.clientId, redirect_uri: this.redirectUri});
 };
 
 // Extends DrawioClient
@@ -21,6 +20,14 @@ mxUtils.extend(OneDriveClient, DrawioClient);
 OneDriveClient.prototype.clientId = (window.location.hostname == 'test.draw.io') ? '0000000048148130' :
 	((window.location.hostname == 'drive.draw.io') ? '000000004413EC37' : '0000000040145A19');
 
+/**
+ * Specifies if thumbnails should be enabled. Default is true.
+ * LATER: If thumbnails are disabled, make sure to replace the
+ * existing thumbnail with the placeholder only once.
+ */
+OneDriveClient.prototype.clientId2 = (window.location.hostname == 'test.draw.io') ?
+	'2e598409-107f-4b59-89ca-d7723c8e00a4' : '45c10911-200f-4e27-a666-9e9fca147395';
+
 /**
  * OAuth 2.0 scopes for installing Drive Apps.
  */
@@ -31,6 +38,11 @@ OneDriveClient.prototype.scopes = 'wl.skydrive_update wl.signin';
  */
 OneDriveClient.prototype.redirectUri = 'https://' + window.location.hostname + '/onedrive.html';
 
+/**
+ * OAuth 2.0 scopes for installing Drive Apps.
+ */
+OneDriveClient.prototype.redirectUri2 = 'https://' + window.location.hostname + '/onedrive2.html';
+
 /**
  * Executes the first step for connecting to Google Drive.
  */
@@ -637,19 +649,28 @@ OneDriveClient.prototype.pickLibrary = function(fn)
  */
 OneDriveClient.prototype.pickFolder = function(fn)
 {
-    WL.fileDialog(
-    {
-        mode: 'save'
-    }).then(
-        function (resp)
-        {
-    		fn(resp);
-        },
-        function (responseFailed)
-        {
-        	fn(null);
-        }
-    );
+	OneDrive.save(
+	{
+		clientId: this.clientId2,
+		action: 'query',
+		openInNewWindow: true,
+		advanced:
+		{
+			'redirectUri': this.redirectUri2
+		},
+		success: function(files)
+		{
+			fn(files);
+		},
+		cancel: function()
+		{
+			// do nothing
+		},
+		error: mxUtils.bind(this, function(e)
+		{
+			this.ui.showError(mxResources.get('error'), e);
+		})
+	});
 };
 
 /**
@@ -662,26 +683,31 @@ OneDriveClient.prototype.pickFile = function(fn)
 		this.ui.loadFile('W' + encodeURIComponent(id));
 	});
 	
-    WL.fileDialog(
-    {
-        mode: 'open',
-        select: 'multi'
-    }).then(
-        function (resp)
-        {
-        	if (resp != null && resp.data != null && resp.data.files != null)
-        	{
-            	for (var i = 0; i < resp.data.files.length; i++)
-            	{
-            		var id = resp.data.files[i].id;
-            		id = id.substring(id.lastIndexOf('.') + 1);
-            		
-            		fn(id);
-            	}
-        	}
-        },
-        function (responseFailed) {}
-    );
+	OneDrive.open(
+	{
+		clientId: this.clientId2,
+		action: 'query',
+		multiSelect: false,
+		advanced:
+		{
+			'redirectUri': this.redirectUri2
+		},
+		success: function(files)
+		{
+			if (files != null && files.value != null && files.value.length > 0)
+			{
+				fn(files.value[0].id);
+			}
+		},
+		cancel: function()
+		{
+			// do nothing
+		},
+		error: mxUtils.bind(this, function(e)
+		{
+			this.ui.showError(mxResources.get('error'), e);
+		})
+	});
 };
 
 /**
@@ -692,7 +718,4 @@ OneDriveClient.prototype.logout = function()
 	this.clearPersistentToken();
 	this.setUser(null);
 	this.token = null;
-	
-	// LATER: Check why async callback does not work
-	WL.logout();
 };

+ 29 - 7
war/js/diagramly/sidebar/Sidebar.js

@@ -156,7 +156,8 @@
 			{
 				// Checks if any of the following keywords are in the search terms
 				var words = ['line', 'lines', 'arrow', 'arrows', 'connect', 'connection', 'connections',
-				             'connector', 'connectors', 'curve', 'curves', 'link', 'links'];
+				             'connector', 'connectors', 'curve', 'curves', 'link', 'links', 'directed',
+				             'directional', 'bidirectional'];
 				
 				for (var i = 0; i < words.length; i++)
 				{
@@ -168,7 +169,7 @@
 				}
 			}
 			
-			if (hintText != null)
+			if (hintText != null && !this.hideSearchHint)
 			{
 				var link = document.createElement('a');
 				link.setAttribute('href', 'https://www.youtube.com/watch?v=8OaMWa4R1SE&t=1');
@@ -177,9 +178,30 @@
 				link.style.cssText = 'background-color:#ffd350;border-radius:6px;color:black;' +
 					'border:1px solid black !important;text-align:center;white-space:normal;' +
 					'padding:6px 0px 6px 0px !important;margin:4px 4px 8px 2px;';
-				
 				mxUtils.write(link, hintText);
+				
+				// Adds close button
+				var img = document.createElement('img');
+				img.setAttribute('src', Dialog.prototype.closeImage);
+				img.setAttribute('title', mxResources.get('hide'));
+				img.className = 'geDialogClose';
+				img.style.position = 'relative';
+				img.style.cursor = 'default';
+				img.style.top = '1px';
+				img.style.right = '0px';
+				
+				mxEvent.addListener(img, 'click', mxUtils.bind(this, function(evt)
+				{
+					link.parentNode.removeChild(link);
+					this.hideSearchHint = true;
+					mxEvent.consume(evt);
+				}));
+				
+				link.appendChild(img);
 				div.appendChild(link);
+				
+				// Shows hint only once
+				this.hideSearchHint = true;
 			}
 		}
 		
@@ -290,7 +312,7 @@
             			entries: [{title: mxResources.get('general'), id: 'general', image: IMAGE_PATH + '/sidebar-general.png'},
             			          {title: mxResources.get('arrows'), id: 'arrows2', image: IMAGE_PATH + '/sidebar-arrows2.png'},
             			          {title: mxResources.get('basic'), id: 'basic', image: IMAGE_PATH + '/sidebar-basic.png'},
-            			          {title: mxResources.get('clipart'), id: 'clipart', image: IMAGE_PATH + '/sidebar-clipart.jpg'},
+            			          {title: mxResources.get('clipart'), id: 'clipart', image: IMAGE_PATH + '/sidebar-clipart.png'},
             			          {title: mxResources.get('flowchart'), id: 'flowchart', image: IMAGE_PATH + '/sidebar-flowchart.png'}]},
             			{title: mxResources.get('software'),
             			entries: [{title: mxResources.get('android'), id: 'android', image: IMAGE_PATH + '/sidebar-android.png'},
@@ -700,15 +722,15 @@
 				'Doctor_Man_Black', 'Doctor_Woman', 'Doctor_Woman_Black',
 				'Farmer_Man', 'Farmer_Man_Black', 'Farmer_Woman',
 				'Farmer_Woman_Black', 'Nurse_Man', 'Nurse_Man_Black',
-				'Nurse_Man_Green', 'Nurse_Man_Red', 'Nurse_Woman',
-				'Nurse_Woman_Black', 'Nurse_Woman_Green', 'Nurse_Woman_Red',
+				'Nurse_Woman',
+				'Nurse_Woman_Black',
 				'Military_Officer', 'Military_Officer_Black',
 				'Military_Officer_Woman', 'Military_Officer_Woman_Black',
 				'Pilot_Man', 'Pilot_Man_Black', 'Pilot_Woman',
 				'Pilot_Woman_Black', 'Scientist_Man', 'Scientist_Man_Black',
 				'Scientist_Woman', 'Scientist_Woman_Black', 'Security_Man',
 				'Security_Man_Black', 'Security_Woman', 'Security_Woman_Black',
-				'Soldier', 'Soldier_Black', 'Tech_Man', 'Tech_Man_Black',
+				'Tech_Man', 'Tech_Man_Black',
 				'Telesales_Man', 'Telesales_Man_Black', 'Telesales_Woman',
 				'Telesales_Woman_Black', 'Waiter', 'Waiter_Black',
 				'Waiter_Woman', 'Waiter_Woman_Black', 'Worker_Black',

File diff ditekan karena terlalu besar
+ 8 - 8
war/js/embed-static.min.js


+ 1 - 1
war/js/mxgraph/Dialogs.js

@@ -80,7 +80,7 @@ function Dialog(editorUi, elt, w, h, modal, closable, onClose)
 		document.body.appendChild(img);
 		this.dialogImg = img;
 		
-		mxEvent.addListener(this.bg, 'click', mxUtils.bind(this, function()
+		mxEvent.addGestureListeners(this.bg, null, null, mxUtils.bind(this, function(evt)
 		{
 			editorUi.hideDialog(true);
 		}));

+ 3 - 3
war/js/mxgraph/Format.js

@@ -2684,7 +2684,7 @@ TextFormatPanel.prototype.addFont = function(container)
 		container.appendChild(this.createRelativeOption(mxResources.get('lineheight'), null, null, function(input)
 		{
 			var value = (input.value == '') ? 120 : parseInt(input.value);
-			value = Math.max(120, (isNaN(value)) ? 120 : value);
+			value = Math.max(0, (isNaN(value)) ? 120 : value);
 
 			if (selState != null)
 			{
@@ -2702,9 +2702,9 @@ TextFormatPanel.prototype.addFont = function(container)
 			
 			if (node != null && node == graph.cellEditor.textarea && graph.cellEditor.textarea.firstChild != null)
 			{
-				if (graph.cellEditor.textarea.firstChild.nodeName != 'FONT')
+				if (graph.cellEditor.textarea.firstChild.nodeName != 'P')
 				{
-					graph.cellEditor.textarea.innerHTML = '<font>' + graph.cellEditor.textarea.innerHTML + '</font>';
+					graph.cellEditor.textarea.innerHTML = '<p>' + graph.cellEditor.textarea.innerHTML + '</p>';
 				}
 				
 				node = graph.cellEditor.textarea.firstChild;

+ 33 - 29
war/js/mxgraph/Sidebar.js

@@ -899,22 +899,27 @@ Sidebar.prototype.insertSearchHint = function(div, searchTerm, count, page, resu
  */
 Sidebar.prototype.addGeneralPalette = function(expand)
 {
+	var lineTags = 'line lines connector connectors connection connections arrow arrows ';
+	
 	var fns = [
 	 	this.createVertexTemplateEntry('whiteSpace=wrap;html=1;', 120, 60, '', 'Rectangle', null, null, 'rect rectangle box'),
 	 	this.createVertexTemplateEntry('rounded=1;whiteSpace=wrap;html=1;', 120, 60, '', 'Rounded Rectangle', null, null, 'rounded rect rectangle box'),
- 		this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;', 120, 80, '', 'Ellipse', null, null, 'oval ellipse state'),
 	 	// Explicit strokecolor/fillcolor=none is a workaround to maintain transparent background regardless of current style
- 		this.createVertexTemplateEntry('text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;',
+	 	this.createVertexTemplateEntry('text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;',
  			40, 20, 'Text', 'Text', null, null, 'text textbox textarea label'),
- 		this.createVertexTemplateEntry('shape=ext;double=1;whiteSpace=wrap;html=1;', 120, 60, '', 'Double Rectangle', null, null, 'rect rectangle box double'),
+	 	this.createVertexTemplateEntry('text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;', 190, 120,
+			'<h1>Heading</h1><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
+			'Textbox', null, null, 'text textbox textarea'),
+		this.createVertexTemplateEntry('shape=ext;double=1;whiteSpace=wrap;html=1;', 120, 60, '', 'Double Rectangle', null, null, 'rect rectangle box double'),
 	 	this.createVertexTemplateEntry('shape=ext;double=1;rounded=1;whiteSpace=wrap;html=1;', 120, 60, '', 'Double Rounded Rectangle', null, null, 'rounded rect rectangle box double'),
+ 		this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;', 120, 80, '', 'Ellipse', null, null, 'oval ellipse state'),
 	 	this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;', 120, 80, '', 'Double Ellipse', null, null, 'oval ellipse start end state double'),
+	 	this.createVertexTemplateEntry('shape=process;whiteSpace=wrap;html=1;', 120, 60, '', 'Process', null, null, 'process task'),
 	 	this.createVertexTemplateEntry('rhombus;whiteSpace=wrap;html=1;', 80, 80, '', 'Diamond', null, null, 'diamond rhombus if condition decision conditional question test'),
 	 	this.createVertexTemplateEntry('shape=parallelogram;whiteSpace=wrap;html=1;', 120, 60, '', 'Parallelogram'),
+	 	this.createVertexTemplateEntry('shape=hexagon;perimeter=hexagonPerimeter;whiteSpace=wrap;html=1;', 120, 80, '', 'Hexagon', null, null, 'hexagon preparation'),
 	 	this.createVertexTemplateEntry('triangle;whiteSpace=wrap;html=1;', 60, 80, '', 'Triangle', null, null, 'triangle logic inverter buffer'),
 	 	this.createVertexTemplateEntry('shape=cylinder;whiteSpace=wrap;html=1;', 60, 80, '', 'Cylinder', null, null, 'cylinder data database'),
-	 	this.createVertexTemplateEntry('shape=hexagon;perimeter=hexagonPerimeter;whiteSpace=wrap;html=1;', 120, 80, '', 'Hexagon', null, null, 'hexagon preparation'),
-	 	this.createVertexTemplateEntry('shape=process;whiteSpace=wrap;html=1;', 120, 60, '', 'Process', null, null, 'process task'),
 	 	this.createVertexTemplateEntry('ellipse;shape=cloud;whiteSpace=wrap;html=1;', 120, 80, '', 'Cloud', null, null, 'cloud network'),
 	 	this.createVertexTemplateEntry('shape=document;whiteSpace=wrap;html=1;', 120, 80, '', 'Document'),
 	 	this.createVertexTemplateEntry('shape=internalStorage;whiteSpace=wrap;html=1;', 80, 80, '', 'Internal Storage'),
@@ -924,9 +929,12 @@ Sidebar.prototype.addGeneralPalette = function(expand)
 	 	this.createVertexTemplateEntry('shape=tape;whiteSpace=wrap;html=1;', 120, 100, '', 'Tape'),
 	 	this.createVertexTemplateEntry('shape=note;whiteSpace=wrap;html=1;', 80, 100, '', 'Note'),
 	    this.createVertexTemplateEntry('shape=card;whiteSpace=wrap;html=1;', 80, 100, '', 'Card'),
-	 	this.createEdgeTemplateEntry('endArrow=classic;html=1;', 50, 50, '', 'Connection'),
-	 	this.createEdgeTemplateEntry('endArrow=classic;startArrow=classic;html=1;', 50, 50, '', 'Connection')
-	];
+	 	this.createEdgeTemplateEntry('endArrow=classic;html=1;', 50, 50, '', 'Directional Connector', null, lineTags + 'directional directed'),
+	    this.createEdgeTemplateEntry('endArrow=none;html=1;dashed=1;dashPattern=1 4;', 50, 50, '', 'Dotted Line', null, lineTags + 'dotted undirected no'),
+	 	this.createEdgeTemplateEntry('endArrow=none;dashed=1;html=1;', 50, 50, '', 'Dashed Line', null, lineTags + 'dashed undirected no'),
+	 	this.createEdgeTemplateEntry('endArrow=none;html=1;', 50, 50, '', 'Line', null, lineTags + 'simple undirected plain blank no'),
+	 	this.createEdgeTemplateEntry('endArrow=classic;startArrow=classic;html=1;', 50, 50, '', 'Bidirectional Connector', null, lineTags + 'bidirectional')
+	 ];
 	
 	this.addPaletteFunctions('general', mxResources.get('general'), (expand != null) ? expand : true, fns);
 };
@@ -951,40 +959,39 @@ Sidebar.prototype.addBasicPalette = function(dir)
  */
 Sidebar.prototype.addMiscPalette = function(expand)
 {
+	var lineTags = 'line lines connector connectors connection connections arrow arrows '
+	
 	var fns = [
-   	 	this.createVertexTemplateEntry('text;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;', 100, 40, 'Title', 'Title', null, null, 'text heading title'),
-	 	this.createVertexTemplateEntry('text;html=1;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;', 190, 120,
-			'<h1>Heading</h1><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
-			'Textbox', null, null, 'text textbox textarea'),
-	 	this.createVertexTemplateEntry('text;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;', 100, 80,
+   	 	this.createVertexTemplateEntry('text;strokeColor=none;fillColor=none;html=1;fontSize=24;fontStyle=1;verticalAlign=middle;align=center;', 100, 40, 'Title', 'Title', null, null, 'text heading title'),
+	 	this.createVertexTemplateEntry('text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;', 100, 80,
  			'<ul><li>Value 1</li><li>Value 2</li><li>Value 3</li></ul>', 'Unordered List'),
-	 	this.createVertexTemplateEntry('text;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;', 100, 80,
+	 	this.createVertexTemplateEntry('text;strokeColor=none;fillColor=none;html=1;whiteSpace=wrap;verticalAlign=middle;overflow=hidden;', 100, 80,
  			'<ol><li>Value 1</li><li>Value 2</li><li>Value 3</li></ol>', 'Ordered List'),
-	 	this.createVertexTemplateEntry('text;html=1;fillColor=#ffffff;overflow=fill;rounded=0;', 280, 160,
+	 	this.createVertexTemplateEntry('text;html=1;strokeColor=#c0c0c0;fillColor=#ffffff;overflow=fill;rounded=0;', 280, 160,
  			'<table border="1" width="100%" height="100%" cellpadding="4" style="width:100%;height:100%;border-collapse:collapse;">' +
  			'<tr style="background-color:#A7C942;color:#ffffff;border:1px solid #98bf21;"><th align="left">Title 1</th><th align="left">Title 2</th><th align="left">Title 3</th></tr>' +
  			'<tr style="border:1px solid #98bf21;"><td>Value 1</td><td>Value 2</td><td>Value 3</td></tr>' +
  			'<tr style="background-color:#EAF2D3;border:1px solid #98bf21;"><td>Value 4</td><td>Value 5</td><td>Value 6</td></tr>' +
  			'<tr style="border:1px solid #98bf21;"><td>Value 7</td><td>Value 8</td><td>Value 9</td></tr>' +
  			'<tr style="background-color:#EAF2D3;border:1px solid #98bf21;"><td>Value 10</td><td>Value 11</td><td>Value 12</td></tr></table>', 'Table 1'),
-		this.createVertexTemplateEntry('text;html=1;strokeColor=#c0c0c0;overflow=fill;', 180, 140,
+		this.createVertexTemplateEntry('text;html=1;strokeColor=#c0c0c0;fillColor=none;overflow=fill;', 180, 140,
  			'<table border="0" width="100%" height="100%" style="width:100%;height:100%;border-collapse:collapse;">' +
  			'<tr><td align="center">Value 1</td><td align="center">Value 2</td><td align="center">Value 3</td></tr>' +
  			'<tr><td align="center">Value 4</td><td align="center">Value 5</td><td align="center">Value 6</td></tr>' +
  			'<tr><td align="center">Value 7</td><td align="center">Value 8</td><td align="center">Value 9</td></tr></table>', 'Table 2'),
-	 	this.createVertexTemplateEntry('text;html=1;overflow=fill;', 180, 140,
+	 	this.createVertexTemplateEntry('text;html=1;strokeColor=none;fillColor=none;overflow=fill;', 180, 140,
  			'<table border="1" width="100%" height="100%" style="width:100%;height:100%;border-collapse:collapse;">' +
  			'<tr><td align="center">Value 1</td><td align="center">Value 2</td><td align="center">Value 3</td></tr>' +
  			'<tr><td align="center">Value 4</td><td align="center">Value 5</td><td align="center">Value 6</td></tr>' +
  			'<tr><td align="center">Value 7</td><td align="center">Value 8</td><td align="center">Value 9</td></tr></table>', 'Table 3'),
-	 	this.createVertexTemplateEntry('text;html=1;overflow=fill;', 160, 140,
+	 	this.createVertexTemplateEntry('text;html=1;strokeColor=none;fillColor=none;overflow=fill;', 160, 140,
  			'<table border="1" width="100%" height="100%" cellpadding="4" style="width:100%;height:100%;border-collapse:collapse;">' +
  			'<tr><th align="center"><b>Title</b></th></tr>' +
  			'<tr><td align="center">Section 1.1\nSection 1.2\nSection 1.3</td></tr>' +
  			'<tr><td align="center">Section 2.1\nSection 2.2\nSection 2.3</td></tr></table>', 'Table 4'),
 	 	this.addEntry('link hyperlink', mxUtils.bind(this, function()
 	 	{
-	 		var cell = new mxCell('Link', new mxGeometry(0, 0, 60, 40), 'text;html=1;whiteSpace=wrap;align=center;verticalAlign=middle;fontColor=#0000EE;fontStyle=4;');
+	 		var cell = new mxCell('Link', new mxGeometry(0, 0, 60, 40), 'text;html=1;strokeColor=none;fillColor=none;whiteSpace=wrap;align=center;verticalAlign=middle;fontColor=#0000EE;fontStyle=4;');
 	 		cell.vertex = true;
 	 		this.graph.setLinkForCell(cell, 'https://www.draw.io');
 
@@ -1026,14 +1033,11 @@ Sidebar.prototype.addMiscPalette = function(expand)
 	 	this.createVertexTemplateEntry('icon;html=1;image=' + this.gearImage, 60, 60, 'Icon', 'Icon', false, null, 'icon image symbol'),
 	 	this.createVertexTemplateEntry('label;whiteSpace=wrap;html=1;image=' + this.gearImage, 140, 60, 'Label', 'Label 1', null, null, 'label image icon symbol'),
 	 	this.createVertexTemplateEntry('label;whiteSpace=wrap;html=1;align=center;verticalAlign=bottom;spacingLeft=0;spacingBottom=4;imageAlign=center;imageVerticalAlign=top;image=' + this.gearImage, 120, 80, 'Label', 'Label 2', null, null, 'label image icon symbol'),
-	    this.createEdgeTemplateEntry('shape=flexArrow;endArrow=classic;html=1;fillColor=#ffffff;', 50, 50, '', 'Arrow'),
-	    this.createEdgeTemplateEntry('shape=flexArrow;endArrow=classic;startArrow=classic;html=1;fillColor=#ffffff;', 50, 50, '', 'Arrow'),
-	 	this.createEdgeTemplateEntry('endArrow=none;html=1;dashed=1;dashPattern=1 4;', 50, 50, '', 'Dotted Line'),
-	 	this.createEdgeTemplateEntry('endArrow=none;dashed=1;html=1;', 50, 50, '', 'Dashed Line'),
-	 	this.createEdgeTemplateEntry('endArrow=none;html=1;', 50, 50, '', 'Line'),
-	 	this.createEdgeTemplateEntry('edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;', 50, 50, '', 'Manual Line'),
-	 	this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;', 50, 50, '', 'Horizontal Elbow'),
-	 	this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;', 50, 50, '', 'Vertical Elbow'),
+	    this.createEdgeTemplateEntry('shape=flexArrow;endArrow=classic;html=1;fillColor=#ffffff;', 50, 50, '', 'Directional Arrow', null, lineTags + 'directional directed'),
+	    this.createEdgeTemplateEntry('shape=flexArrow;endArrow=classic;startArrow=classic;html=1;fillColor=#ffffff;', 50, 50, '', 'Bidirectional Arrow', null, lineTags + 'bidirectional'),
+	 	this.createEdgeTemplateEntry('edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;', 50, 50, '', 'Manual Line', null, lineTags + 'manual'),
+	 	this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;', 50, 50, '', 'Horizontal Elbow', null, lineTags + 'elbow horizontal'),
+	 	this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;', 50, 50, '', 'Vertical Elbow', null, lineTags + 'elbow vertical'),
 	 	this.addEntry('curve', mxUtils.bind(this, function()
 	 	{
 			var cell = new mxCell('', new mxGeometry(0, 0, 50, 50), 'curved=1;endArrow=classic;html=1;');
@@ -1043,9 +1047,9 @@ Sidebar.prototype.addMiscPalette = function(expand)
 			cell.geometry.relative = true;
 			cell.edge = true;
 			
-		    return this.createEdgeTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Curve');
+		    return this.createEdgeTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Bidirectional Curve');
 	 	})),
-	 	this.createEdgeTemplateEntry('shape=link;html=1;', 50, 50, '', 'Link')
+	 	this.createEdgeTemplateEntry('shape=link;html=1;', 50, 50, '', 'Link', null, lineTags + 'link')
 	];
 
 	this.addPaletteFunctions('misc', mxResources.get('misc'), (expand != null) ? expand : true, fns);

File diff ditekan karena terlalu besar
+ 8 - 8
war/js/reader.min.js


File diff ditekan karena terlalu besar
+ 88 - 88
war/js/viewer.min.js


+ 10 - 0
war/node_modules/.bin/electron

@@ -0,0 +1,10 @@
+#!/usr/bin/env node
+
+var electron = require('./')
+
+var proc = require('child_process')
+
+var child = proc.spawn(electron, process.argv.slice(2), {stdio: 'inherit'})
+child.on('close', function (code) {
+  process.exit(code)
+})

+ 19 - 0
war/node_modules/.bin/electron-download

@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+
+'use strict';
+
+var download = require('./');
+var minimist = require('minimist');
+
+var opts = minimist(process.argv.slice(2));
+
+if (opts['strict-ssl'] === false) {
+  opts.strictSSL = false;
+}
+
+download(opts, function (err, zipPath) {
+  if (err) throw err;
+  console.log('Downloaded zip:', zipPath);
+  process.exit(0);
+});

+ 139 - 0
war/node_modules/.bin/esparse

@@ -0,0 +1,139 @@
+#!/usr/bin/env node
+/*
+  Copyright JS Foundation and other contributors, https://js.foundation/
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true node:true rhino:true */
+
+var fs, esprima, fname, forceFile, content, options, syntax;
+
+if (typeof require === 'function') {
+    fs = require('fs');
+    try {
+        esprima = require('esprima');
+    } catch (e) {
+        esprima = require('../');
+    }
+} else if (typeof load === 'function') {
+    try {
+        load('esprima.js');
+    } catch (e) {
+        load('../esprima.js');
+    }
+}
+
+// Shims to Node.js objects when running under Rhino.
+if (typeof console === 'undefined' && typeof process === 'undefined') {
+    console = { log: print };
+    fs = { readFileSync: readFile };
+    process = { argv: arguments, exit: quit };
+    process.argv.unshift('esparse.js');
+    process.argv.unshift('rhino');
+}
+
+function showUsage() {
+    console.log('Usage:');
+    console.log('   esparse [options] [file.js]');
+    console.log();
+    console.log('Available options:');
+    console.log();
+    console.log('  --comment      Gather all line and block comments in an array');
+    console.log('  --loc          Include line-column location info for each syntax node');
+    console.log('  --range        Include index-based range for each syntax node');
+    console.log('  --raw          Display the raw value of literals');
+    console.log('  --tokens       List all tokens in an array');
+    console.log('  --tolerant     Tolerate errors on a best-effort basis (experimental)');
+    console.log('  -v, --version  Shows program version');
+    console.log();
+    process.exit(1);
+}
+
+options = {};
+
+process.argv.splice(2).forEach(function (entry) {
+
+    if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
+        if (typeof fname === 'string') {
+            console.log('Error: more than one input file.');
+            process.exit(1);
+        } else {
+            fname = entry;
+        }
+    } else if (entry === '-h' || entry === '--help') {
+        showUsage();
+    } else if (entry === '-v' || entry === '--version') {
+        console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
+        console.log();
+        process.exit(0);
+    } else if (entry === '--comment') {
+        options.comment = true;
+    } else if (entry === '--loc') {
+        options.loc = true;
+    } else if (entry === '--range') {
+        options.range = true;
+    } else if (entry === '--raw') {
+        options.raw = true;
+    } else if (entry === '--tokens') {
+        options.tokens = true;
+    } else if (entry === '--tolerant') {
+        options.tolerant = true;
+    } else if (entry === '--') {
+        forceFile = true;
+    } else {
+        console.log('Error: unknown option ' + entry + '.');
+        process.exit(1);
+    }
+});
+
+// Special handling for regular expression literal since we need to
+// convert it to a string literal, otherwise it will be decoded
+// as object "{}" and the regular expression would be lost.
+function adjustRegexLiteral(key, value) {
+    if (key === 'value' && value instanceof RegExp) {
+        value = value.toString();
+    }
+    return value;
+}
+
+function run(content) {
+    syntax = esprima.parse(content, options);
+    console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
+}
+
+try {
+    if (fname && (fname !== '-' || forceFile)) {
+        run(fs.readFileSync(fname, 'utf-8'));
+    } else {
+        var content = '';
+        process.stdin.resume();
+        process.stdin.on('data', function(chunk) {
+            content += chunk;
+        });
+        process.stdin.on('end', function() {
+            run(content);
+        });
+    }
+} catch (e) {
+    console.log('Error: ' + e.message);
+    process.exit(1);
+}

+ 236 - 0
war/node_modules/.bin/esvalidate

@@ -0,0 +1,236 @@
+#!/usr/bin/env node
+/*
+  Copyright JS Foundation and other contributors, https://js.foundation/
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true plusplus:true node:true rhino:true */
+/*global phantom:true */
+
+var fs, system, esprima, options, fnames, forceFile, count;
+
+if (typeof esprima === 'undefined') {
+    // PhantomJS can only require() relative files
+    if (typeof phantom === 'object') {
+        fs = require('fs');
+        system = require('system');
+        esprima = require('./esprima');
+    } else if (typeof require === 'function') {
+        fs = require('fs');
+        try {
+            esprima = require('esprima');
+        } catch (e) {
+            esprima = require('../');
+        }
+    } else if (typeof load === 'function') {
+        try {
+            load('esprima.js');
+        } catch (e) {
+            load('../esprima.js');
+        }
+    }
+}
+
+// Shims to Node.js objects when running under PhantomJS 1.7+.
+if (typeof phantom === 'object') {
+    fs.readFileSync = fs.read;
+    process = {
+        argv: [].slice.call(system.args),
+        exit: phantom.exit,
+        on: function (evt, callback) {
+            callback();
+        }
+    };
+    process.argv.unshift('phantomjs');
+}
+
+// Shims to Node.js objects when running under Rhino.
+if (typeof console === 'undefined' && typeof process === 'undefined') {
+    console = { log: print };
+    fs = { readFileSync: readFile };
+    process = {
+        argv: arguments,
+        exit: quit,
+        on: function (evt, callback) {
+            callback();
+        }
+    };
+    process.argv.unshift('esvalidate.js');
+    process.argv.unshift('rhino');
+}
+
+function showUsage() {
+    console.log('Usage:');
+    console.log('   esvalidate [options] [file.js...]');
+    console.log();
+    console.log('Available options:');
+    console.log();
+    console.log('  --format=type  Set the report format, plain (default) or junit');
+    console.log('  -v, --version  Print program version');
+    console.log();
+    process.exit(1);
+}
+
+options = {
+    format: 'plain'
+};
+
+fnames = [];
+
+process.argv.splice(2).forEach(function (entry) {
+
+    if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
+        fnames.push(entry);
+    } else if (entry === '-h' || entry === '--help') {
+        showUsage();
+    } else if (entry === '-v' || entry === '--version') {
+        console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
+        console.log();
+        process.exit(0);
+    } else if (entry.slice(0, 9) === '--format=') {
+        options.format = entry.slice(9);
+        if (options.format !== 'plain' && options.format !== 'junit') {
+            console.log('Error: unknown report format ' + options.format + '.');
+            process.exit(1);
+        }
+    } else if (entry === '--') {
+        forceFile = true;
+    } else {
+        console.log('Error: unknown option ' + entry + '.');
+        process.exit(1);
+    }
+});
+
+if (fnames.length === 0) {
+    fnames.push('');
+}
+
+if (options.format === 'junit') {
+    console.log('<?xml version="1.0" encoding="UTF-8"?>');
+    console.log('<testsuites>');
+}
+
+count = 0;
+
+function run(fname, content) {
+    var timestamp, syntax, name;
+    try {
+        if (typeof content !== 'string') {
+            throw content;
+        }
+
+        if (content[0] === '#' && content[1] === '!') {
+            content = '//' + content.substr(2, content.length);
+        }
+
+        timestamp = Date.now();
+        syntax = esprima.parse(content, { tolerant: true });
+
+        if (options.format === 'junit') {
+
+            name = fname;
+            if (name.lastIndexOf('/') >= 0) {
+                name = name.slice(name.lastIndexOf('/') + 1);
+            }
+
+            console.log('<testsuite name="' + fname + '" errors="0" ' +
+                ' failures="' + syntax.errors.length + '" ' +
+                ' tests="' + syntax.errors.length + '" ' +
+                ' time="' + Math.round((Date.now() - timestamp) / 1000) +
+                '">');
+
+            syntax.errors.forEach(function (error) {
+                var msg = error.message;
+                msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
+                console.log('  <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
+                    ' time="0">');
+                console.log('    <error type="SyntaxError" message="' + error.message + '">' +
+                    error.message + '(' + name + ':' + error.lineNumber + ')' +
+                    '</error>');
+                console.log('  </testcase>');
+            });
+
+            console.log('</testsuite>');
+
+        } else if (options.format === 'plain') {
+
+            syntax.errors.forEach(function (error) {
+                var msg = error.message;
+                msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
+                msg = fname + ':' + error.lineNumber + ': ' + msg;
+                console.log(msg);
+                ++count;
+            });
+
+        }
+    } catch (e) {
+        ++count;
+        if (options.format === 'junit') {
+            console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
+                ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
+            console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
+            console.log(' <error type="ParseError" message="' + e.message + '">' +
+                e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
+                ')</error>');
+            console.log(' </testcase>');
+            console.log('</testsuite>');
+        } else {
+            console.log('Error: ' + e.message);
+        }
+    }
+}
+
+fnames.forEach(function (fname) {
+    var content = '';
+    try {
+        if (fname && (fname !== '-' || forceFile)) {
+            content = fs.readFileSync(fname, 'utf-8');
+        } else {
+            fname = '';
+            process.stdin.resume();
+            process.stdin.on('data', function(chunk) {
+                content += chunk;
+            });
+            process.stdin.on('end', function() {
+                run(fname, content);
+            });
+            return;
+        }
+    } catch (e) {
+        content = e;
+    }
+    run(fname, content);
+});
+
+process.on('exit', function () {
+    if (options.format === 'junit') {
+        console.log('</testsuites>');
+    }
+
+    if (count > 0) {
+        process.exit(1);
+    }
+
+    if (count === 0 && typeof phantom === 'object') {
+        process.exit(0);
+    }
+});

+ 20 - 0
war/node_modules/.bin/extract-zip

@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+var extract = require('./')
+
+var args = process.argv.slice(2)
+var source = args[0]
+var dest = args[1] || process.cwd()
+if (!source) {
+  console.error('Usage: extract-zip foo.zip <targetDirectory>')
+  process.exit(1)
+}
+
+extract(source, {dir: dest}, function (err, results) {
+  if (err) {
+    console.error('error!', err)
+    process.exit(1)
+  } else {
+    process.exit(0)
+  }
+})

+ 132 - 0
war/node_modules/.bin/js-yaml

@@ -0,0 +1,132 @@
+#!/usr/bin/env node
+
+
+'use strict';
+
+/*eslint-disable no-console*/
+
+
+// stdlib
+var fs    = require('fs');
+
+
+// 3rd-party
+var argparse = require('argparse');
+
+
+// internal
+var yaml = require('..');
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+var cli = new argparse.ArgumentParser({
+  prog:     'js-yaml',
+  version:  require('../package.json').version,
+  addHelp:  true
+});
+
+
+cli.addArgument([ '-c', '--compact' ], {
+  help:   'Display errors in compact mode',
+  action: 'storeTrue'
+});
+
+
+// deprecated (not needed after we removed output colors)
+// option suppressed, but not completely removed for compatibility
+cli.addArgument([ '-j', '--to-json' ], {
+  help:   argparse.Const.SUPPRESS,
+  dest:   'json',
+  action: 'storeTrue'
+});
+
+
+cli.addArgument([ '-t', '--trace' ], {
+  help:   'Show stack trace on error',
+  action: 'storeTrue'
+});
+
+cli.addArgument([ 'file' ], {
+  help:   'File to read, utf-8 encoded without BOM',
+  nargs:  '?',
+  defaultValue: '-'
+});
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+var options = cli.parseArgs();
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+function readFile(filename, encoding, callback) {
+  if (options.file === '-') {
+    // read from stdin
+
+    var chunks = [];
+
+    process.stdin.on('data', function (chunk) {
+      chunks.push(chunk);
+    });
+
+    process.stdin.on('end', function () {
+      return callback(null, Buffer.concat(chunks).toString(encoding));
+    });
+  } else {
+    fs.readFile(filename, encoding, callback);
+  }
+}
+
+readFile(options.file, 'utf8', function (error, input) {
+  var output, isYaml;
+
+  if (error) {
+    if (error.code === 'ENOENT') {
+      console.error('File not found: ' + options.file);
+      process.exit(2);
+    }
+
+    console.error(
+      options.trace && error.stack ||
+      error.message ||
+      String(error));
+
+    process.exit(1);
+  }
+
+  try {
+    output = JSON.parse(input);
+    isYaml = false;
+  } catch (err) {
+    if (err instanceof SyntaxError) {
+      try {
+        output = [];
+        yaml.loadAll(input, function (doc) { output.push(doc); }, {});
+        isYaml = true;
+
+        if (output.length === 0) output = null;
+        else if (output.length === 1) output = output[0];
+
+      } catch (e) {
+        if (options.trace && err.stack) console.error(e.stack);
+        else console.error(e.toString(options.compact));
+
+        process.exit(1);
+      }
+    } else {
+      console.error(
+        options.trace && err.stack ||
+        err.message ||
+        String(err));
+
+      process.exit(1);
+    }
+  }
+
+  if (isYaml) console.log(JSON.stringify(output, null, '  '));
+  else console.log(yaml.dump(output));
+});

+ 33 - 0
war/node_modules/.bin/mkdirp

@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+
+var mkdirp = require('../');
+var minimist = require('minimist');
+var fs = require('fs');
+
+var argv = minimist(process.argv.slice(2), {
+    alias: { m: 'mode', h: 'help' },
+    string: [ 'mode' ]
+});
+if (argv.help) {
+    fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
+    return;
+}
+
+var paths = argv._.slice();
+var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
+
+(function next () {
+    if (paths.length === 0) return;
+    var p = paths.shift();
+    
+    if (mode === undefined) mkdirp(p, cb)
+    else mkdirp(p, mode, cb)
+    
+    function cb (err) {
+        if (err) {
+            console.error(err.message);
+            process.exit(1);
+        }
+        else next();
+    }
+})();

+ 32 - 0
war/node_modules/.bin/nugget

@@ -0,0 +1,32 @@
+#!/usr/bin/env node
+
+var fs = require('fs')
+var path = require('path')
+var nugget = require('./')
+var args = require('minimist')(process.argv.slice(2))
+
+var urls = args._
+if (urls.length === 0) {
+  console.log(fs.readFileSync(path.join(__dirname, 'usage.txt')).toString())
+  process.exit(1)
+}
+
+var opts = {
+  target: args.o || args.O || args.out,
+  dir: args.d || args.dir,
+  resume: args.c || args.continue,
+  force: args.f || args.force,
+  sockets: args.s || args.sockets,
+  quiet: args.q || args.quiet,
+  frequency: args.frequency ? +args.frequency : null,
+  proxy: args.proxy ? args.proxy : null,
+  strictSSL: args['strict-ssl']
+}
+
+nugget(urls, opts, function (err) {
+  if (err) {
+    console.error('Error:', err)
+    process.exit(1)
+  }
+  process.exit(0)
+})

+ 32 - 0
war/node_modules/.bin/pretty-bytes

@@ -0,0 +1,32 @@
+#!/usr/bin/env node
+'use strict';
+var getStdin = require('get-stdin');
+var meow = require('meow');
+var prettyBytes = require('./pretty-bytes');
+
+var cli = meow({
+	help: [
+		'Usage',
+		'  $ pretty-bytes <number>',
+		'  $ echo <number> | pretty-bytes',
+		'',
+		'Example',
+		'  $ pretty-bytes 1337',
+		'  1.34 kB'
+	].join('\n')
+});
+
+function init(data) {
+	console.log(prettyBytes(Number(data)));
+}
+
+if (process.stdin.isTTY) {
+	if (!cli.input[0]) {
+		console.error('Number required');
+		process.exit(1);
+	}
+
+	init(cli.input[0]);
+} else {
+	getStdin(init);
+}

+ 60 - 0
war/node_modules/.bin/rc

@@ -0,0 +1,60 @@
+#! /usr/bin/env node
+var cc   = require('./lib/utils')
+var join = require('path').join
+var deepExtend = require('deep-extend')
+var etc = '/etc'
+var win = process.platform === "win32"
+var home = win
+           ? process.env.USERPROFILE
+           : process.env.HOME
+
+module.exports = function (name, defaults, argv, parse) {
+  if('string' !== typeof name)
+    throw new Error('rc(name): name *must* be string')
+  if(!argv)
+    argv = require('minimist')(process.argv.slice(2))
+  defaults = (
+      'string' === typeof defaults
+    ? cc.json(defaults) : defaults
+    ) || {}
+
+  parse = parse || cc.parse
+
+  var env = cc.env(name + '_')
+
+  var configs = [defaults]
+  var configFiles = []
+  function addConfigFile (file) {
+    if (configFiles.indexOf(file) >= 0) return
+    var fileConfig = cc.file(file)
+    if (fileConfig) {
+      configs.push(parse(fileConfig))
+      configFiles.push(file)
+    }
+  }
+
+  // which files do we look at?
+  if (!win)
+   [join(etc, name, 'config'),
+    join(etc, name + 'rc')].forEach(addConfigFile)
+  if (home)
+   [join(home, '.config', name, 'config'),
+    join(home, '.config', name),
+    join(home, '.' + name, 'config'),
+    join(home, '.' + name + 'rc')].forEach(addConfigFile)
+  addConfigFile(cc.find('.'+name+'rc'))
+  if (env.config) addConfigFile(env.config)
+  if (argv.config) addConfigFile(argv.config)
+
+  return deepExtend.apply(null, configs.concat([
+    env,
+    argv,
+    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
+  ]))
+}
+
+if(!module.parent) {
+  console.log(
+    JSON.stringify(module.exports(process.argv[2]), false, 2)
+  )
+}

+ 50 - 0
war/node_modules/.bin/rimraf

@@ -0,0 +1,50 @@
+#!/usr/bin/env node
+
+var rimraf = require('./')
+
+var help = false
+var dashdash = false
+var noglob = false
+var args = process.argv.slice(2).filter(function(arg) {
+  if (dashdash)
+    return !!arg
+  else if (arg === '--')
+    dashdash = true
+  else if (arg === '--no-glob' || arg === '-G')
+    noglob = true
+  else if (arg === '--glob' || arg === '-g')
+    noglob = false
+  else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
+    help = true
+  else
+    return !!arg
+})
+
+if (help || args.length === 0) {
+  // If they didn't ask for help, then this is not a "success"
+  var log = help ? console.log : console.error
+  log('Usage: rimraf <path> [<path> ...]')
+  log('')
+  log('  Deletes all files and folders at "path" recursively.')
+  log('')
+  log('Options:')
+  log('')
+  log('  -h, --help     Display this usage info')
+  log('  -G, --no-glob  Do not expand glob patterns in arguments')
+  log('  -g, --glob     Expand glob patterns in arguments (default)')
+  process.exit(help ? 0 : 1)
+} else
+  go(0)
+
+function go (n) {
+  if (n >= args.length)
+    return
+  var options = {}
+  if (noglob)
+    options = { glob: false }
+  rimraf(args[n], options, function (er) {
+    if (er)
+      throw er
+    go(n+1)
+  })
+}

+ 133 - 0
war/node_modules/.bin/semver

@@ -0,0 +1,133 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+  , versions = []
+  , range = []
+  , gt = []
+  , lt = []
+  , eq = []
+  , inc = null
+  , version = require("../package.json").version
+  , loose = false
+  , identifier = undefined
+  , semver = require("../semver")
+  , reverse = false
+
+main()
+
+function main () {
+  if (!argv.length) return help()
+  while (argv.length) {
+    var a = argv.shift()
+    var i = a.indexOf('=')
+    if (i !== -1) {
+      a = a.slice(0, i)
+      argv.unshift(a.slice(i + 1))
+    }
+    switch (a) {
+      case "-rv": case "-rev": case "--rev": case "--reverse":
+        reverse = true
+        break
+      case "-l": case "--loose":
+        loose = true
+        break
+      case "-v": case "--version":
+        versions.push(argv.shift())
+        break
+      case "-i": case "--inc": case "--increment":
+        switch (argv[0]) {
+          case "major": case "minor": case "patch": case "prerelease":
+          case "premajor": case "preminor": case "prepatch":
+            inc = argv.shift()
+            break
+          default:
+            inc = "patch"
+            break
+        }
+        break
+      case "--preid":
+        identifier = argv.shift()
+        break
+      case "-r": case "--range":
+        range.push(argv.shift())
+        break
+      case "-h": case "--help": case "-?":
+        return help()
+      default:
+        versions.push(a)
+        break
+    }
+  }
+
+  versions = versions.filter(function (v) {
+    return semver.valid(v, loose)
+  })
+  if (!versions.length) return fail()
+  if (inc && (versions.length !== 1 || range.length))
+    return failInc()
+
+  for (var i = 0, l = range.length; i < l ; i ++) {
+    versions = versions.filter(function (v) {
+      return semver.satisfies(v, range[i], loose)
+    })
+    if (!versions.length) return fail()
+  }
+  return success(versions)
+}
+
+function failInc () {
+  console.error("--inc can only be used on a single version with no range")
+  fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+  var compare = reverse ? "rcompare" : "compare"
+  versions.sort(function (a, b) {
+    return semver[compare](a, b, loose)
+  }).map(function (v) {
+    return semver.clean(v, loose)
+  }).map(function (v) {
+    return inc ? semver.inc(v, inc, loose, identifier) : v
+  }).forEach(function (v,i,_) { console.log(v) })
+}
+
+function help () {
+  console.log(["SemVer " + version
+              ,""
+              ,"A JavaScript implementation of the http://semver.org/ specification"
+              ,"Copyright Isaac Z. Schlueter"
+              ,""
+              ,"Usage: semver [options] <version> [<version> [...]]"
+              ,"Prints valid versions sorted by SemVer precedence"
+              ,""
+              ,"Options:"
+              ,"-r --range <range>"
+              ,"        Print versions that match the specified range."
+              ,""
+              ,"-i --increment [<level>]"
+              ,"        Increment a version by the specified level.  Level can"
+              ,"        be one of: major, minor, patch, premajor, preminor,"
+              ,"        prepatch, or prerelease.  Default level is 'patch'."
+              ,"        Only one version may be specified."
+              ,""
+              ,"--preid <identifier>"
+              ,"        Identifier to be used to prefix premajor, preminor,"
+              ,"        prepatch or prerelease version increments."
+              ,""
+              ,"-l --loose"
+              ,"        Interpret versions and ranges loosely"
+              ,""
+              ,"Program exits successfully if any valid version satisfies"
+              ,"all supplied ranges, and prints all satisfying versions."
+              ,""
+              ,"If no satisfying versions are found, then exits failure."
+              ,""
+              ,"Versions are printed in ascending order, so supplying"
+              ,"multiple versions to the utility will just sort them."
+              ].join("\n"))
+}

+ 201 - 0
war/node_modules/.bin/sshpk-conv

@@ -0,0 +1,201 @@
+#!/usr/bin/env node
+// -*- mode: js -*-
+// vim: set filetype=javascript :
+// Copyright 2015 Joyent, Inc.  All rights reserved.
+
+var dashdash = require('dashdash');
+var sshpk = require('../lib/index');
+var fs = require('fs');
+var path = require('path');
+var tty = require('tty');
+var readline = require('readline');
+var getPassword = require('getpass').getPass;
+
+var options = [
+	{
+		names: ['outformat', 't'],
+		type: 'string',
+		help: 'Output format'
+	},
+	{
+		names: ['informat', 'T'],
+		type: 'string',
+		help: 'Input format'
+	},
+	{
+		names: ['file', 'f'],
+		type: 'string',
+		help: 'Input file name (default stdin)'
+	},
+	{
+		names: ['out', 'o'],
+		type: 'string',
+		help: 'Output file name (default stdout)'
+	},
+	{
+		names: ['private', 'p'],
+		type: 'bool',
+		help: 'Produce a private key as output'
+	},
+	{
+		names: ['derive', 'd'],
+		type: 'string',
+		help: 'Output a new key derived from this one, with given algo'
+	},
+	{
+		names: ['identify', 'i'],
+		type: 'bool',
+		help: 'Print key metadata instead of converting'
+	},
+	{
+		names: ['comment', 'c'],
+		type: 'string',
+		help: 'Set key comment, if output format supports'
+	},
+	{
+		names: ['help', 'h'],
+		type: 'bool',
+		help: 'Shows this help text'
+	}
+];
+
+if (require.main === module) {
+	var parser = dashdash.createParser({
+		options: options
+	});
+
+	try {
+		var opts = parser.parse(process.argv);
+	} catch (e) {
+		console.error('sshpk-conv: error: %s', e.message);
+		process.exit(1);
+	}
+
+	if (opts.help || opts._args.length > 1) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-conv: converts between SSH key formats\n');
+		console.error(help);
+		console.error('\navailable formats:');
+		console.error('  - pem, pkcs1     eg id_rsa');
+		console.error('  - ssh            eg id_rsa.pub');
+		console.error('  - pkcs8          format you want for openssl');
+		console.error('  - openssh        like output of ssh-keygen -o');
+		console.error('  - rfc4253        raw OpenSSH wire format');
+		process.exit(1);
+	}
+
+	/*
+	 * Key derivation can only be done on private keys, so use of the -d
+	 * option necessarily implies -p.
+	 */
+	if (opts.derive)
+		opts.private = true;
+
+	var inFile = process.stdin;
+	var inFileName = 'stdin';
+
+	var inFilePath;
+	if (opts.file) {
+		inFilePath = opts.file;
+	} else if (opts._args.length === 1) {
+		inFilePath = opts._args[0];
+	}
+
+	if (inFilePath)
+		inFileName = path.basename(inFilePath);
+
+	try {
+		if (inFilePath) {
+			fs.accessSync(inFilePath, fs.R_OK);
+			inFile = fs.createReadStream(inFilePath);
+		}
+	} catch (e) {
+		console.error('sshpk-conv: error opening input file' +
+		     ': ' + e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	var outFile = process.stdout;
+
+	try {
+		if (opts.out && !opts.identify) {
+			fs.accessSync(path.dirname(opts.out), fs.W_OK);
+			outFile = fs.createWriteStream(opts.out);
+		}
+	} catch (e) {
+		console.error('sshpk-conv: error opening output file' +
+		    ': ' + e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	var bufs = [];
+	inFile.on('readable', function () {
+		var data;
+		while ((data = inFile.read()))
+			bufs.push(data);
+	});
+	var parseOpts = {};
+	parseOpts.filename = inFileName;
+	inFile.on('end', function processKey() {
+		var buf = Buffer.concat(bufs);
+		var fmt = 'auto';
+		if (opts.informat)
+			fmt = opts.informat;
+		var f = sshpk.parseKey;
+		if (opts.private)
+			f = sshpk.parsePrivateKey;
+		try {
+			var key = f(buf, fmt, parseOpts);
+		} catch (e) {
+			if (e.name === 'KeyEncryptedError') {
+				getPassword(function (err, pw) {
+					if (err) {
+						console.log('sshpk-conv: ' +
+						    err.name + ': ' +
+						    err.message);
+						process.exit(1);
+					}
+					parseOpts.passphrase = pw;
+					processKey();
+				});
+				return;
+			}
+			console.error('sshpk-conv: ' +
+			    e.name + ': ' + e.message);
+			process.exit(1);
+		}
+
+		if (opts.derive)
+			key = key.derive(opts.derive);
+
+		if (opts.comment)
+			key.comment = opts.comment;
+
+		if (!opts.identify) {
+			fmt = undefined;
+			if (opts.outformat)
+				fmt = opts.outformat;
+			outFile.write(key.toBuffer(fmt));
+			if (fmt === 'ssh' ||
+			    (!opts.private && fmt === undefined))
+				outFile.write('\n');
+			outFile.once('drain', function () {
+				process.exit(0);
+			});
+		} else {
+			var kind = 'public';
+			if (sshpk.PrivateKey.isPrivateKey(key))
+				kind = 'private';
+			console.log('%s: a %d bit %s %s key', inFileName,
+			    key.size, key.type.toUpperCase(), kind);
+			if (key.type === 'ecdsa')
+				console.log('ECDSA curve: %s', key.curve);
+			if (key.comment)
+				console.log('Comment: %s', key.comment);
+			console.log('Fingerprint:');
+			console.log('  ' + key.fingerprint().toString());
+			console.log('  ' + key.fingerprint('md5').toString());
+			process.exit(0);
+		}
+	});
+}

+ 191 - 0
war/node_modules/.bin/sshpk-sign

@@ -0,0 +1,191 @@
+#!/usr/bin/env node
+// -*- mode: js -*-
+// vim: set filetype=javascript :
+// Copyright 2015 Joyent, Inc.  All rights reserved.
+
+var dashdash = require('dashdash');
+var sshpk = require('../lib/index');
+var fs = require('fs');
+var path = require('path');
+var getPassword = require('getpass').getPass;
+
+var options = [
+	{
+		names: ['hash', 'H'],
+		type: 'string',
+		help: 'Hash algorithm (sha1, sha256, sha384, sha512)'
+	},
+	{
+		names: ['verbose', 'v'],
+		type: 'bool',
+		help: 'Display verbose info about key and hash used'
+	},
+	{
+		names: ['identity', 'i'],
+		type: 'string',
+		help: 'Path to key to use'
+	},
+	{
+		names: ['file', 'f'],
+		type: 'string',
+		help: 'Input filename'
+	},
+	{
+		names: ['out', 'o'],
+		type: 'string',
+		help: 'Output filename'
+	},
+	{
+		names: ['format', 't'],
+		type: 'string',
+		help: 'Signature format (asn1, ssh, raw)'
+	},
+	{
+		names: ['binary', 'b'],
+		type: 'bool',
+		help: 'Output raw binary instead of base64'
+	},
+	{
+		names: ['help', 'h'],
+		type: 'bool',
+		help: 'Shows this help text'
+	}
+];
+
+var parseOpts = {};
+
+if (require.main === module) {
+	var parser = dashdash.createParser({
+		options: options
+	});
+
+	try {
+		var opts = parser.parse(process.argv);
+	} catch (e) {
+		console.error('sshpk-sign: error: %s', e.message);
+		process.exit(1);
+	}
+
+	if (opts.help || opts._args.length > 1) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-sign: sign data using an SSH key\n');
+		console.error(help);
+		process.exit(1);
+	}
+
+	if (!opts.identity) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-sign: the -i or --identity option ' +
+		    'is required\n');
+		console.error(help);
+		process.exit(1);
+	}
+
+	var keyData = fs.readFileSync(opts.identity);
+	parseOpts.filename = opts.identity;
+
+	run();
+}
+
+function run() {
+	var key;
+	try {
+		key = sshpk.parsePrivateKey(keyData, 'auto', parseOpts);
+	} catch (e) {
+		if (e.name === 'KeyEncryptedError') {
+			getPassword(function (err, pw) {
+				parseOpts.passphrase = pw;
+				run();
+			});
+			return;
+		}
+		console.error('sshpk-sign: error loading private key "' +
+		    opts.identity + '": ' + e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	var hash = opts.hash || key.defaultHashAlgorithm();
+
+	var signer;
+	try {
+		signer = key.createSign(hash);
+	} catch (e) {
+		console.error('sshpk-sign: error creating signer: ' +
+		    e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	if (opts.verbose) {
+		console.error('sshpk-sign: using %s-%s with a %d bit key',
+		    key.type, hash, key.size);
+	}
+
+	var inFile = process.stdin;
+	var inFileName = 'stdin';
+
+	var inFilePath;
+	if (opts.file) {
+		inFilePath = opts.file;
+	} else if (opts._args.length === 1) {
+		inFilePath = opts._args[0];
+	}
+
+	if (inFilePath)
+		inFileName = path.basename(inFilePath);
+
+	try {
+		if (inFilePath) {
+			fs.accessSync(inFilePath, fs.R_OK);
+			inFile = fs.createReadStream(inFilePath);
+		}
+	} catch (e) {
+		console.error('sshpk-sign: error opening input file' +
+		     ': ' + e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	var outFile = process.stdout;
+
+	try {
+		if (opts.out && !opts.identify) {
+			fs.accessSync(path.dirname(opts.out), fs.W_OK);
+			outFile = fs.createWriteStream(opts.out);
+		}
+	} catch (e) {
+		console.error('sshpk-sign: error opening output file' +
+		    ': ' + e.name + ': ' + e.message);
+		process.exit(1);
+	}
+
+	inFile.pipe(signer);
+	inFile.on('end', function () {
+		var sig;
+		try {
+			sig = signer.sign();
+		} catch (e) {
+			console.error('sshpk-sign: error signing data: ' +
+			    e.name + ': ' + e.message);
+			process.exit(1);
+		}
+
+		var fmt = opts.format || 'asn1';
+		var output;
+		try {
+			output = sig.toBuffer(fmt);
+			if (!opts.binary)
+				output = output.toString('base64');
+		} catch (e) {
+			console.error('sshpk-sign: error converting signature' +
+			    ' to ' + fmt + ' format: ' + e.name + ': ' +
+			    e.message);
+			process.exit(1);
+		}
+
+		outFile.write(output);
+		if (!opts.binary)
+			outFile.write('\n');
+		outFile.once('drain', function () {
+			process.exit(0);
+		});
+	});
+}

+ 166 - 0
war/node_modules/.bin/sshpk-verify

@@ -0,0 +1,166 @@
+#!/usr/bin/env node
+// -*- mode: js -*-
+// vim: set filetype=javascript :
+// Copyright 2015 Joyent, Inc.  All rights reserved.
+
+var dashdash = require('dashdash');
+var sshpk = require('../lib/index');
+var fs = require('fs');
+var path = require('path');
+
+var options = [
+	{
+		names: ['hash', 'H'],
+		type: 'string',
+		help: 'Hash algorithm (sha1, sha256, sha384, sha512)'
+	},
+	{
+		names: ['verbose', 'v'],
+		type: 'bool',
+		help: 'Display verbose info about key and hash used'
+	},
+	{
+		names: ['identity', 'i'],
+		type: 'string',
+		help: 'Path to (public) key to use'
+	},
+	{
+		names: ['file', 'f'],
+		type: 'string',
+		help: 'Input filename'
+	},
+	{
+		names: ['format', 't'],
+		type: 'string',
+		help: 'Signature format (asn1, ssh, raw)'
+	},
+	{
+		names: ['signature', 's'],
+		type: 'string',
+		help: 'base64-encoded signature data'
+	},
+	{
+		names: ['help', 'h'],
+		type: 'bool',
+		help: 'Shows this help text'
+	}
+];
+
+if (require.main === module) {
+	var parser = dashdash.createParser({
+		options: options
+	});
+
+	try {
+		var opts = parser.parse(process.argv);
+	} catch (e) {
+		console.error('sshpk-verify: error: %s', e.message);
+		process.exit(3);
+	}
+
+	if (opts.help || opts._args.length > 1) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-verify: sign data using an SSH key\n');
+		console.error(help);
+		process.exit(3);
+	}
+
+	if (!opts.identity) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-verify: the -i or --identity option ' +
+		    'is required\n');
+		console.error(help);
+		process.exit(3);
+	}
+
+	if (!opts.signature) {
+		var help = parser.help({}).trimRight();
+		console.error('sshpk-verify: the -s or --signature option ' +
+		    'is required\n');
+		console.error(help);
+		process.exit(3);
+	}
+
+	var keyData = fs.readFileSync(opts.identity);
+
+	var key;
+	try {
+		key = sshpk.parseKey(keyData);
+	} catch (e) {
+		console.error('sshpk-verify: error loading key "' +
+		    opts.identity + '": ' + e.name + ': ' + e.message);
+		process.exit(2);
+	}
+
+	var fmt = opts.format || 'asn1';
+	var sigData = new Buffer(opts.signature, 'base64');
+
+	var sig;
+	try {
+		sig = sshpk.parseSignature(sigData, key.type, fmt);
+	} catch (e) {
+		console.error('sshpk-verify: error parsing signature: ' +
+		    e.name + ': ' + e.message);
+		process.exit(2);
+	}
+
+	var hash = opts.hash || key.defaultHashAlgorithm();
+
+	var verifier;
+	try {
+		verifier = key.createVerify(hash);
+	} catch (e) {
+		console.error('sshpk-verify: error creating verifier: ' +
+		    e.name + ': ' + e.message);
+		process.exit(2);
+	}
+
+	if (opts.verbose) {
+		console.error('sshpk-verify: using %s-%s with a %d bit key',
+		    key.type, hash, key.size);
+	}
+
+	var inFile = process.stdin;
+	var inFileName = 'stdin';
+
+	var inFilePath;
+	if (opts.file) {
+		inFilePath = opts.file;
+	} else if (opts._args.length === 1) {
+		inFilePath = opts._args[0];
+	}
+
+	if (inFilePath)
+		inFileName = path.basename(inFilePath);
+
+	try {
+		if (inFilePath) {
+			fs.accessSync(inFilePath, fs.R_OK);
+			inFile = fs.createReadStream(inFilePath);
+		}
+	} catch (e) {
+		console.error('sshpk-verify: error opening input file' +
+		     ': ' + e.name + ': ' + e.message);
+		process.exit(2);
+	}
+
+	inFile.pipe(verifier);
+	inFile.on('end', function () {
+		var ret;
+		try {
+			ret = verifier.verify(sig);
+		} catch (e) {
+			console.error('sshpk-verify: error verifying data: ' +
+			    e.name + ': ' + e.message);
+			process.exit(1);
+		}
+
+		if (ret) {
+			console.error('OK');
+			process.exit(0);
+		}
+
+		console.error('NOT OK');
+		process.exit(1);
+	});
+}

+ 49 - 0
war/node_modules/.bin/strip-indent

@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var stdin = require('get-stdin');
+var pkg = require('./package.json');
+var stripIndent = require('./');
+var argv = process.argv.slice(2);
+var input = argv[0];
+
+function help() {
+	console.log([
+		'',
+		'  ' + pkg.description,
+		'',
+		'  Usage',
+		'    strip-indent <file>',
+		'    echo <string> | strip-indent',
+		'',
+		'  Example',
+		'    echo \'\\tunicorn\\n\\t\\tcake\' | strip-indent',
+		'    unicorn',
+		'    \tcake'
+	].join('\n'));
+}
+
+function init(data) {
+	console.log(stripIndent(data));
+}
+
+if (argv.indexOf('--help') !== -1) {
+	help();
+	return;
+}
+
+if (argv.indexOf('--version') !== -1) {
+	console.log(pkg.version);
+	return;
+}
+
+if (process.stdin.isTTY) {
+	if (!input) {
+		help();
+		return;
+	}
+
+	init(fs.readFileSync(input, 'utf8'));
+} else {
+	stdin(init);
+}

+ 26 - 0
war/node_modules/.bin/uuid

@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var uuid = require(path.join(__dirname, '..'));
+
+var arg = process.argv[2];
+
+if ('--help' === arg) {
+  console.log('\n  USAGE: uuid [version] [options]\n\n');
+  console.log('  options:\n');
+  console.log('  --help                     Display this message and exit\n');
+  process.exit(0);
+}
+
+if (null == arg) {
+  console.log(uuid());
+  process.exit(0);
+}
+
+if ('v1' !== arg && 'v4' !== arg) {
+  console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"');
+  process.exit(1);
+}
+
+console.log(uuid[arg]());
+process.exit(0);

+ 20 - 0
war/node_modules/ajv/.tonic_example.js

@@ -0,0 +1,20 @@
+var Ajv = require('ajv');
+var ajv = Ajv({allErrors: true});
+
+var schema = {
+  "properties": {
+    "foo": { "type": "string" },
+    "bar": { "type": "number", "maximum": 3 }
+  }
+};
+
+var validate = ajv.compile(schema);
+
+test({"foo": "abc", "bar": 2});
+test({"foo": 2, "bar": 4});
+
+function test(data) {
+  var valid = validate(data);
+  if (valid) console.log('Valid!');
+  else console.log('Invalid: ' + ajv.errorsText(validate.errors));
+}

+ 22 - 0
war/node_modules/ajv/LICENSE

@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Evgeny Poberezkin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+

File diff ditekan karena terlalu besar
+ 1213 - 0
war/node_modules/ajv/README.md


File diff ditekan karena terlalu besar
+ 8023 - 0
war/node_modules/ajv/dist/ajv.bundle.js


File diff ditekan karena terlalu besar
+ 6 - 0
war/node_modules/ajv/dist/ajv.min.js


File diff ditekan karena terlalu besar
+ 1 - 0
war/node_modules/ajv/dist/ajv.min.js.map


File diff ditekan karena terlalu besar
+ 8 - 0
war/node_modules/ajv/dist/nodent.min.js


File diff ditekan karena terlalu besar
+ 32 - 0
war/node_modules/ajv/dist/regenerator.min.js


+ 284 - 0
war/node_modules/ajv/lib/ajv.d.ts

@@ -0,0 +1,284 @@
+declare var ajv: { 
+  (options?: ajv.Options): ajv.Ajv;
+  new (options?: ajv.Options): ajv.Ajv;
+}
+
+declare namespace ajv {
+  interface Ajv {
+    /**
+    * Validate data using schema
+    * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize.
+    * @param  {String|Object} schemaKeyRef key, ref or schema object
+    * @param  {Any} data to be validated
+    * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
+    */
+    validate(schemaKeyRef: Object | string, data: any): boolean;
+    /**
+    * Create validating function for passed schema.
+    * @param  {Object} schema schema object
+    * @return {Function} validating function
+    */
+    compile(schema: Object): ValidateFunction;
+    /**
+    * Creates validating function for passed schema with asynchronous loading of missing schemas.
+    * `loadSchema` option should be a function that accepts schema uri and node-style callback.
+    * @this  Ajv
+    * @param {Object}   schema schema object
+    * @param {Function} callback node-style callback, it is always called with 2 parameters: error (or null) and validating function.
+    */
+    compileAsync(schema: Object, callback: (err: Error, validate: ValidateFunction) => any): void;
+    /**
+    * Adds schema to the instance.
+    * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
+    * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
+    */
+    addSchema(schema: Array<Object> | Object, key?: string): void;
+    /**
+    * Add schema that will be used to validate other schemas
+    * options in META_IGNORE_OPTIONS are alway set to false
+    * @param {Object} schema schema object
+    * @param {String} key optional schema key
+    */
+    addMetaSchema(schema: Object, key?: string): void;
+    /**
+    * Validate schema
+    * @param {Object} schema schema to validate
+    * @return {Boolean} true if schema is valid
+    */
+    validateSchema(schema: Object): boolean;
+    /**
+    * Get compiled schema from the instance by `key` or `ref`.
+    * @param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
+    * @return {Function} schema validating function (with property `schema`).
+    */
+    getSchema(keyRef: string): ValidateFunction;
+    /**
+    * Remove cached schema(s).
+    * If no parameter is passed all schemas but meta-schemas are removed.
+    * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
+    * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
+    * @param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
+    */
+    removeSchema(schemaKeyRef?: Object | string | RegExp): void;
+    /**
+    * Add custom format
+    * @param {String} name format name
+    * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
+    */
+    addFormat(name: string, format: FormatValidator | FormatDefinition): void;
+    /**
+    * Define custom keyword
+    * @this  Ajv
+    * @param {String} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords.
+    * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
+    */
+    addKeyword(keyword: string, definition: KeywordDefinition): void;
+    /**
+    * Get keyword definition
+    * @this  Ajv
+    * @param {String} keyword pre-defined or custom keyword.
+    * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
+    */
+    getKeyword(keyword: string): Object | boolean;
+    /**
+    * Remove keyword
+    * @this  Ajv
+    * @param {String} keyword pre-defined or custom keyword.
+    */
+    removeKeyword(keyword: string): void;
+    /**
+    * Convert array of error message objects to string
+    * @param  {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
+    * @param  {Object} options optional options with properties `separator` and `dataVar`.
+    * @return {String} human readable string with all errors descriptions
+    */
+    errorsText(errors?: Array<ErrorObject>, options?: ErrorsTextOptions): string;
+    errors?: Array<ErrorObject>;
+  }
+
+  interface Thenable <R> {
+    then <U> (onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
+  }
+
+  interface ValidateFunction {
+    (
+      data: any,
+      dataPath?: string,
+      parentData?: Object | Array<any>,
+      parentDataProperty?: string | number,
+      rootData?: Object | Array<any>
+    ): boolean | Thenable<boolean>;
+    errors?: Array<ErrorObject>;
+    schema?: Object;
+  }
+
+  interface Options {
+    v5?: boolean;
+    allErrors?: boolean;
+    verbose?: boolean;
+    jsonPointers?: boolean;
+    uniqueItems?: boolean;
+    unicode?: boolean;
+    format?: string;
+    formats?: Object;
+    unknownFormats?: boolean | string | Array<string>;
+    schemas?: Array<Object> | Object;
+    ownProperties?: boolean;
+    missingRefs?: boolean | string;
+    extendRefs?: boolean | string;
+    loadSchema?: (uri: string, cb: (err: Error, schema: Object) => any) => any;
+    removeAdditional?: boolean | string;
+    useDefaults?: boolean | string;
+    coerceTypes?: boolean | string;
+    async?: boolean | string;
+    transpile?: string | ((code: string) => string);
+    meta?: boolean | Object;
+    validateSchema?: boolean | string;
+    addUsedSchema?: boolean;
+    inlineRefs?: boolean | number;
+    passContext?: boolean;
+    loopRequired?: number;
+    multipleOfPrecision?: number;
+    errorDataPath?: string;
+    messages?: boolean;
+    sourceCode?: boolean;
+    beautify?: boolean | Object;
+    cache?: Object;
+  }
+
+  type FormatValidator = string | RegExp | ((data: string) => boolean);
+
+  interface FormatDefinition {
+    validate: FormatValidator;
+    compare: (data1: string, data2: string) => number;
+    async?: boolean;
+  }
+
+  interface KeywordDefinition {
+    type?: string | Array<string>;
+    async?: boolean;
+    errors?: boolean | string;
+    // schema: false makes validate not to expect schema (ValidateFunction)
+    schema?: boolean;
+    modifying?: boolean;
+    valid?: boolean;
+    // one and only one of the following properties should be present
+    validate?: ValidateFunction | SchemaValidateFunction;
+    compile?: (schema: Object, parentSchema: Object) => ValidateFunction;
+    macro?: (schema: Object, parentSchema: Object) => Object;
+    inline?: (it: Object, keyword: string, schema: Object, parentSchema: Object) => string;
+  }
+
+  interface SchemaValidateFunction {
+    (
+      schema: Object,
+      data: any,
+      parentSchema?: Object,
+      dataPath?: string,
+      parentData?: Object | Array<any>,
+      parentDataProperty?: string | number
+    ): boolean | Thenable<boolean>;
+    errors?: Array<ErrorObject>;
+  }
+
+  interface ErrorsTextOptions {
+    separator?: string;
+    dataVar?: string;
+  }
+
+  interface ErrorObject {
+    keyword: string;
+    dataPath: string;
+    schemaPath: string;
+    params: ErrorParameters;
+    // Excluded if messages set to false.
+    message?: string;
+    // These are added with the `verbose` option.
+    schema?: Object;
+    parentSchema?: Object;
+    data?: any;
+  }
+
+  type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams |
+                          DependenciesParams | FormatParams | ComparisonParams |
+                          MultipleOfParams | PatternParams | RequiredParams |
+                          TypeParams | UniqueItemsParams | CustomParams |
+                          PatternGroupsParams | PatternRequiredParams |
+                          SwitchParams | NoParams | EnumParams;
+
+  interface RefParams {
+    ref: string;
+  }
+
+  interface LimitParams {
+    limit: number;
+  }
+
+  interface AdditionalPropertiesParams {
+    additionalProperty: string;
+  }
+
+  interface DependenciesParams {
+    property: string;
+    missingProperty: string;
+    depsCount: number;
+    deps: string;
+  }
+
+  interface FormatParams {
+    format: string
+  }
+
+  interface ComparisonParams {
+    comparison: string;
+    limit: number | string;
+    exclusive: boolean;
+  }
+
+  interface MultipleOfParams {
+    multipleOf: number;
+  }
+
+  interface PatternParams {
+    pattern: string;
+  }
+
+  interface RequiredParams {
+    missingProperty: string;
+  }
+
+  interface TypeParams {
+    type: string;
+  }
+
+  interface UniqueItemsParams {
+    i: number;
+    j: number;
+  }
+
+  interface CustomParams {
+    keyword: string;
+  }
+
+  interface PatternGroupsParams {
+    reason: string;
+    limit: number;
+    pattern: string;
+  }
+
+  interface PatternRequiredParams {
+    missingPattern: string;
+  }
+
+  interface SwitchParams {
+    caseIndex: number;
+  }
+
+  interface NoParams {}
+
+  interface EnumParams {
+    allowedValues: Array<any>;
+  }
+}
+
+export = ajv;

+ 420 - 0
war/node_modules/ajv/lib/ajv.js

@@ -0,0 +1,420 @@
+'use strict';
+
+var compileSchema = require('./compile')
+  , resolve = require('./compile/resolve')
+  , Cache = require('./cache')
+  , SchemaObject = require('./compile/schema_obj')
+  , stableStringify = require('json-stable-stringify')
+  , formats = require('./compile/formats')
+  , rules = require('./compile/rules')
+  , v5 = require('./v5')
+  , util = require('./compile/util')
+  , async = require('./async')
+  , co = require('co');
+
+module.exports = Ajv;
+
+Ajv.prototype.compileAsync = async.compile;
+
+var customKeyword = require('./keyword');
+Ajv.prototype.addKeyword = customKeyword.add;
+Ajv.prototype.getKeyword = customKeyword.get;
+Ajv.prototype.removeKeyword = customKeyword.remove;
+Ajv.ValidationError = require('./compile/validation_error');
+
+var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema';
+var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i;
+function SCHEMA_URI_FORMAT_FUNC(str) {
+  return SCHEMA_URI_FORMAT.test(str);
+}
+
+var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ];
+
+/**
+ * Creates validator instance.
+ * Usage: `Ajv(opts)`
+ * @param {Object} opts optional options
+ * @return {Object} ajv instance
+ */
+function Ajv(opts) {
+  if (!(this instanceof Ajv)) return new Ajv(opts);
+  var self = this;
+
+  opts = this._opts = util.copy(opts) || {};
+  this._schemas = {};
+  this._refs = {};
+  this._fragments = {};
+  this._formats = formats(opts.format);
+  this._cache = opts.cache || new Cache;
+  this._loadingSchemas = {};
+  this._compilations = [];
+  this.RULES = rules();
+
+  // this is done on purpose, so that methods are bound to the instance
+  // (without using bind) so that they can be used without the instance
+  this.validate = validate;
+  this.compile = compile;
+  this.addSchema = addSchema;
+  this.addMetaSchema = addMetaSchema;
+  this.validateSchema = validateSchema;
+  this.getSchema = getSchema;
+  this.removeSchema = removeSchema;
+  this.addFormat = addFormat;
+  this.errorsText = errorsText;
+
+  this._addSchema = _addSchema;
+  this._compile = _compile;
+
+  opts.loopRequired = opts.loopRequired || Infinity;
+  if (opts.async || opts.transpile) async.setup(opts);
+  if (opts.beautify === true) opts.beautify = { indent_size: 2 };
+  if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
+  this._metaOpts = getMetaSchemaOptions();
+
+  if (opts.formats) addInitialFormats();
+  addDraft4MetaSchema();
+  if (opts.v5) v5.enable(this);
+  if (typeof opts.meta == 'object') addMetaSchema(opts.meta);
+  addInitialSchemas();
+
+
+  /**
+   * Validate data using schema
+   * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize.
+   * @param  {String|Object} schemaKeyRef key, ref or schema object
+   * @param  {Any} data to be validated
+   * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
+   */
+  function validate(schemaKeyRef, data) {
+    var v;
+    if (typeof schemaKeyRef == 'string') {
+      v = getSchema(schemaKeyRef);
+      if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
+    } else {
+      var schemaObj = _addSchema(schemaKeyRef);
+      v = schemaObj.validate || _compile(schemaObj);
+    }
+
+    var valid = v(data);
+    if (v.$async === true)
+      return self._opts.async == '*' ? co(valid) : valid;
+    self.errors = v.errors;
+    return valid;
+  }
+
+
+  /**
+   * Create validating function for passed schema.
+   * @param  {Object} schema schema object
+   * @param  {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
+   * @return {Function} validating function
+   */
+  function compile(schema, _meta) {
+    var schemaObj = _addSchema(schema, undefined, _meta);
+    return schemaObj.validate || _compile(schemaObj);
+  }
+
+
+  /**
+   * Adds schema to the instance.
+   * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
+   * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
+   * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
+   * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
+   */
+  function addSchema(schema, key, _skipValidation, _meta) {
+    if (Array.isArray(schema)){
+      for (var i=0; i<schema.length; i++) addSchema(schema[i], undefined, _skipValidation, _meta);
+      return;
+    }
+    // can key/id have # inside?
+    key = resolve.normalizeId(key || schema.id);
+    checkUnique(key);
+    self._schemas[key] = _addSchema(schema, _skipValidation, _meta, true);
+  }
+
+
+  /**
+   * Add schema that will be used to validate other schemas
+   * options in META_IGNORE_OPTIONS are alway set to false
+   * @param {Object} schema schema object
+   * @param {String} key optional schema key
+   * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
+   */
+  function addMetaSchema(schema, key, skipValidation) {
+    addSchema(schema, key, skipValidation, true);
+  }
+
+
+  /**
+   * Validate schema
+   * @param {Object} schema schema to validate
+   * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
+   * @return {Boolean} true if schema is valid
+   */
+  function validateSchema(schema, throwOrLogError) {
+    var $schema = schema.$schema || self._opts.defaultMeta || defaultMeta();
+    var currentUriFormat = self._formats.uri;
+    self._formats.uri = typeof currentUriFormat == 'function'
+                        ? SCHEMA_URI_FORMAT_FUNC
+                        : SCHEMA_URI_FORMAT;
+    var valid;
+    try { valid = validate($schema, schema); }
+    finally { self._formats.uri = currentUriFormat; }
+    if (!valid && throwOrLogError) {
+      var message = 'schema is invalid: ' + errorsText();
+      if (self._opts.validateSchema == 'log') console.error(message);
+      else throw new Error(message);
+    }
+    return valid;
+  }
+
+
+  function defaultMeta() {
+    var meta = self._opts.meta;
+    self._opts.defaultMeta = typeof meta == 'object'
+                              ? meta.id || meta
+                              : self._opts.v5
+                                ? v5.META_SCHEMA_ID
+                                : META_SCHEMA_ID;
+    return self._opts.defaultMeta;
+  }
+
+
+  /**
+   * Get compiled schema from the instance by `key` or `ref`.
+   * @param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
+   * @return {Function} schema validating function (with property `schema`).
+   */
+  function getSchema(keyRef) {
+    var schemaObj = _getSchemaObj(keyRef);
+    switch (typeof schemaObj) {
+      case 'object': return schemaObj.validate || _compile(schemaObj);
+      case 'string': return getSchema(schemaObj);
+      case 'undefined': return _getSchemaFragment(keyRef);
+    }
+  }
+
+
+  function _getSchemaFragment(ref) {
+    var res = resolve.schema.call(self, { schema: {} }, ref);
+    if (res) {
+      var schema = res.schema
+        , root = res.root
+        , baseId = res.baseId;
+      var v = compileSchema.call(self, schema, root, undefined, baseId);
+      self._fragments[ref] = new SchemaObject({
+        ref: ref,
+        fragment: true,
+        schema: schema,
+        root: root,
+        baseId: baseId,
+        validate: v
+      });
+      return v;
+    }
+  }
+
+
+  function _getSchemaObj(keyRef) {
+    keyRef = resolve.normalizeId(keyRef);
+    return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
+  }
+
+
+  /**
+   * Remove cached schema(s).
+   * If no parameter is passed all schemas but meta-schemas are removed.
+   * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
+   * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
+   * @param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
+   */
+  function removeSchema(schemaKeyRef) {
+    if (schemaKeyRef instanceof RegExp) {
+      _removeAllSchemas(self._schemas, schemaKeyRef);
+      _removeAllSchemas(self._refs, schemaKeyRef);
+      return;
+    }
+    switch (typeof schemaKeyRef) {
+      case 'undefined':
+        _removeAllSchemas(self._schemas);
+        _removeAllSchemas(self._refs);
+        self._cache.clear();
+        return;
+      case 'string':
+        var schemaObj = _getSchemaObj(schemaKeyRef);
+        if (schemaObj) self._cache.del(schemaObj.jsonStr);
+        delete self._schemas[schemaKeyRef];
+        delete self._refs[schemaKeyRef];
+        return;
+      case 'object':
+        var jsonStr = stableStringify(schemaKeyRef);
+        self._cache.del(jsonStr);
+        var id = schemaKeyRef.id;
+        if (id) {
+          id = resolve.normalizeId(id);
+          delete self._schemas[id];
+          delete self._refs[id];
+        }
+    }
+  }
+
+
+  function _removeAllSchemas(schemas, regex) {
+    for (var keyRef in schemas) {
+      var schemaObj = schemas[keyRef];
+      if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
+        self._cache.del(schemaObj.jsonStr);
+        delete schemas[keyRef];
+      }
+    }
+  }
+
+
+  function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
+    if (typeof schema != 'object') throw new Error('schema should be object');
+    var jsonStr = stableStringify(schema);
+    var cached = self._cache.get(jsonStr);
+    if (cached) return cached;
+
+    shouldAddSchema = shouldAddSchema || self._opts.addUsedSchema !== false;
+
+    var id = resolve.normalizeId(schema.id);
+    if (id && shouldAddSchema) checkUnique(id);
+
+    var willValidate = self._opts.validateSchema !== false && !skipValidation;
+    var recursiveMeta;
+    if (willValidate && !(recursiveMeta = schema.id && schema.id == schema.$schema))
+      validateSchema(schema, true);
+
+    var localRefs = resolve.ids.call(self, schema);
+
+    var schemaObj = new SchemaObject({
+      id: id,
+      schema: schema,
+      localRefs: localRefs,
+      jsonStr: jsonStr,
+      meta: meta
+    });
+
+    if (id[0] != '#' && shouldAddSchema) self._refs[id] = schemaObj;
+    self._cache.put(jsonStr, schemaObj);
+
+    if (willValidate && recursiveMeta) validateSchema(schema, true);
+
+    return schemaObj;
+  }
+
+
+  function _compile(schemaObj, root) {
+    if (schemaObj.compiling) {
+      schemaObj.validate = callValidate;
+      callValidate.schema = schemaObj.schema;
+      callValidate.errors = null;
+      callValidate.root = root ? root : callValidate;
+      if (schemaObj.schema.$async === true)
+        callValidate.$async = true;
+      return callValidate;
+    }
+    schemaObj.compiling = true;
+
+    var currentOpts;
+    if (schemaObj.meta) {
+      currentOpts = self._opts;
+      self._opts = self._metaOpts;
+    }
+
+    var v;
+    try { v = compileSchema.call(self, schemaObj.schema, root, schemaObj.localRefs); }
+    finally {
+      schemaObj.compiling = false;
+      if (schemaObj.meta) self._opts = currentOpts;
+    }
+
+    schemaObj.validate = v;
+    schemaObj.refs = v.refs;
+    schemaObj.refVal = v.refVal;
+    schemaObj.root = v.root;
+    return v;
+
+
+    function callValidate() {
+      var _validate = schemaObj.validate;
+      var result = _validate.apply(null, arguments);
+      callValidate.errors = _validate.errors;
+      return result;
+    }
+  }
+
+
+  /**
+   * Convert array of error message objects to string
+   * @param  {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
+   * @param  {Object} options optional options with properties `separator` and `dataVar`.
+   * @return {String} human readable string with all errors descriptions
+   */
+  function errorsText(errors, options) {
+    errors = errors || self.errors;
+    if (!errors) return 'No errors';
+    options = options || {};
+    var separator = options.separator === undefined ? ', ' : options.separator;
+    var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;
+
+    var text = '';
+    for (var i=0; i<errors.length; i++) {
+      var e = errors[i];
+      if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
+    }
+    return text.slice(0, -separator.length);
+  }
+
+
+  /**
+   * Add custom format
+   * @param {String} name format name
+   * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
+   */
+  function addFormat(name, format) {
+    if (typeof format == 'string') format = new RegExp(format);
+    self._formats[name] = format;
+  }
+
+
+  function addDraft4MetaSchema() {
+    if (self._opts.meta !== false) {
+      var metaSchema = require('./refs/json-schema-draft-04.json');
+      addMetaSchema(metaSchema, META_SCHEMA_ID, true);
+      self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
+    }
+  }
+
+
+  function addInitialSchemas() {
+    var optsSchemas = self._opts.schemas;
+    if (!optsSchemas) return;
+    if (Array.isArray(optsSchemas)) addSchema(optsSchemas);
+    else for (var key in optsSchemas) addSchema(optsSchemas[key], key);
+  }
+
+
+  function addInitialFormats() {
+    for (var name in self._opts.formats) {
+      var format = self._opts.formats[name];
+      addFormat(name, format);
+    }
+  }
+
+
+  function checkUnique(id) {
+    if (self._schemas[id] || self._refs[id])
+      throw new Error('schema with key or id "' + id + '" already exists');
+  }
+
+
+  function getMetaSchemaOptions() {
+    var metaOpts = util.copy(self._opts);
+    for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
+      delete metaOpts[META_IGNORE_OPTIONS[i]];
+    return metaOpts;
+  }
+}

+ 218 - 0
war/node_modules/ajv/lib/async.js

@@ -0,0 +1,218 @@
+'use strict';
+
+module.exports = {
+  setup: setupAsync,
+  compile: compileAsync
+};
+
+
+var util = require('./compile/util');
+
+var ASYNC = {
+  '*': checkGenerators,
+  'co*': checkGenerators,
+  'es7': checkAsyncFunction
+};
+
+var TRANSPILE = {
+  'nodent': getNodent,
+  'regenerator': getRegenerator
+};
+
+var MODES = [
+  { async: 'co*' },
+  { async: 'es7', transpile: 'nodent' },
+  { async: 'co*', transpile: 'regenerator' }
+];
+
+
+var regenerator, nodent;
+
+
+function setupAsync(opts, required) {
+  if (required !== false) required = true;
+  var async = opts.async
+    , transpile = opts.transpile
+    , check;
+
+  switch (typeof transpile) {
+    case 'string':
+      var get = TRANSPILE[transpile];
+      if (!get) throw new Error('bad transpiler: ' + transpile);
+      return (opts._transpileFunc = get(opts, required));
+    case 'undefined':
+    case 'boolean':
+      if (typeof async == 'string') {
+        check = ASYNC[async];
+        if (!check) throw new Error('bad async mode: ' + async);
+        return (opts.transpile = check(opts, required));
+      }
+
+      for (var i=0; i<MODES.length; i++) {
+        var _opts = MODES[i];
+        if (setupAsync(_opts, false)) {
+          util.copy(_opts, opts);
+          return opts.transpile;
+        }
+      }
+      /* istanbul ignore next */
+      throw new Error('generators, nodent and regenerator are not available');
+    case 'function':
+      return (opts._transpileFunc = opts.transpile);
+    default:
+      throw new Error('bad transpiler: ' + transpile);
+  }
+}
+
+
+function checkGenerators(opts, required) {
+  /* jshint evil: true */
+  try {
+    (new Function('(function*(){})()'))();
+    return true;
+  } catch(e) {
+    /* istanbul ignore next */
+    if (required) throw new Error('generators not supported');
+  }
+}
+
+
+function checkAsyncFunction(opts, required) {
+  /* jshint evil: true */
+  try {
+    (new Function('(async function(){})()'))();
+    /* istanbul ignore next */
+    return true;
+  } catch(e) {
+    if (required) throw new Error('es7 async functions not supported');
+  }
+}
+
+
+function getRegenerator(opts, required) {
+  try {
+    if (!regenerator) {
+      var name = 'regenerator';
+      regenerator = require(name);
+      regenerator.runtime();
+    }
+    if (!opts.async || opts.async === true)
+      opts.async = 'es7';
+    return regeneratorTranspile;
+  } catch(e) {
+    /* istanbul ignore next */
+    if (required) throw new Error('regenerator not available');
+  }
+}
+
+
+function regeneratorTranspile(code) {
+  return regenerator.compile(code).code;
+}
+
+
+function getNodent(opts, required) {
+  /* jshint evil: true */
+  try {
+    if (!nodent) {
+      var name = 'nodent';
+      nodent = require(name)({ log: false, dontInstallRequireHook: true });
+    }
+    if (opts.async != 'es7') {
+      if (opts.async && opts.async !== true) console.warn('nodent transpiles only es7 async functions');
+      opts.async = 'es7';
+    }
+    return nodentTranspile;
+  } catch(e) {
+    /* istanbul ignore next */
+    if (required) throw new Error('nodent not available');
+  }
+}
+
+
+function nodentTranspile(code) {
+  return nodent.compile(code, '', { promises: true, sourcemap: false }).code;
+}
+
+
+/**
+ * Creates validating function for passed schema with asynchronous loading of missing schemas.
+ * `loadSchema` option should be a function that accepts schema uri and node-style callback.
+ * @this  Ajv
+ * @param {Object}   schema schema object
+ * @param {Function} callback node-style callback, it is always called with 2 parameters: error (or null) and validating function.
+ */
+function compileAsync(schema, callback) {
+  /* eslint no-shadow: 0 */
+  /* jshint validthis: true */
+  var schemaObj;
+  var self = this;
+  try {
+    schemaObj = this._addSchema(schema);
+  } catch(e) {
+    setTimeout(function() { callback(e); });
+    return;
+  }
+  if (schemaObj.validate) {
+    setTimeout(function() { callback(null, schemaObj.validate); });
+  } else {
+    if (typeof this._opts.loadSchema != 'function')
+      throw new Error('options.loadSchema should be a function');
+    _compileAsync(schema, callback, true);
+  }
+
+
+  function _compileAsync(schema, callback, firstCall) {
+    var validate;
+    try { validate = self.compile(schema); }
+    catch(e) {
+      if (e.missingSchema) loadMissingSchema(e);
+      else deferCallback(e);
+      return;
+    }
+    deferCallback(null, validate);
+
+    function loadMissingSchema(e) {
+      var ref = e.missingSchema;
+      if (self._refs[ref] || self._schemas[ref])
+        return callback(new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'));
+      var _callbacks = self._loadingSchemas[ref];
+      if (_callbacks) {
+        if (typeof _callbacks == 'function')
+          self._loadingSchemas[ref] = [_callbacks, schemaLoaded];
+        else
+          _callbacks[_callbacks.length] = schemaLoaded;
+      } else {
+        self._loadingSchemas[ref] = schemaLoaded;
+        self._opts.loadSchema(ref, function (err, sch) {
+          var _callbacks = self._loadingSchemas[ref];
+          delete self._loadingSchemas[ref];
+          if (typeof _callbacks == 'function') {
+            _callbacks(err, sch);
+          } else {
+            for (var i=0; i<_callbacks.length; i++)
+              _callbacks[i](err, sch);
+          }
+        });
+      }
+
+      function schemaLoaded(err, sch) {
+        if (err) return callback(err);
+        if (!(self._refs[ref] || self._schemas[ref])) {
+          try {
+            self.addSchema(sch, ref);
+          } catch(e) {
+            callback(e);
+            return;
+          }
+        }
+        _compileAsync(schema, callback);
+      }
+    }
+
+    function deferCallback(err, validate) {
+      if (firstCall) setTimeout(function() { callback(err, validate); });
+      else return callback(err, validate);
+    }
+  }
+}

+ 26 - 0
war/node_modules/ajv/lib/cache.js

@@ -0,0 +1,26 @@
+'use strict';
+
+
+var Cache = module.exports = function Cache() {
+  this._cache = {};
+};
+
+
+Cache.prototype.put = function Cache_put(key, value) {
+  this._cache[key] = value;
+};
+
+
+Cache.prototype.get = function Cache_get(key) {
+  return this._cache[key];
+};
+
+
+Cache.prototype.del = function Cache_del(key) {
+  delete this._cache[key];
+};
+
+
+Cache.prototype.clear = function Cache_clear() {
+  this._cache = {};
+};

+ 28 - 0
war/node_modules/ajv/lib/compile/_rules.js

@@ -0,0 +1,28 @@
+'use strict';
+
+//all requires must be explicit because browserify won't work with dynamic requires
+module.exports = {
+  '$ref': require('../dotjs/ref'),
+  allOf: require('../dotjs/allOf'),
+  anyOf: require('../dotjs/anyOf'),
+  dependencies: require('../dotjs/dependencies'),
+  'enum': require('../dotjs/enum'),
+  format: require('../dotjs/format'),
+  items: require('../dotjs/items'),
+  maximum: require('../dotjs/_limit'),
+  minimum: require('../dotjs/_limit'),
+  maxItems: require('../dotjs/_limitItems'),
+  minItems: require('../dotjs/_limitItems'),
+  maxLength: require('../dotjs/_limitLength'),
+  minLength: require('../dotjs/_limitLength'),
+  maxProperties: require('../dotjs/_limitProperties'),
+  minProperties: require('../dotjs/_limitProperties'),
+  multipleOf: require('../dotjs/multipleOf'),
+  not: require('../dotjs/not'),
+  oneOf: require('../dotjs/oneOf'),
+  pattern: require('../dotjs/pattern'),
+  properties: require('../dotjs/properties'),
+  required: require('../dotjs/required'),
+  uniqueItems: require('../dotjs/uniqueItems'),
+  validate: require('../dotjs/validate')
+};

+ 45 - 0
war/node_modules/ajv/lib/compile/equal.js

@@ -0,0 +1,45 @@
+'use strict';
+
+/*eslint complexity: 0*/
+
+module.exports = function equal(a, b) {
+  if (a === b) return true;
+
+  var arrA = Array.isArray(a)
+    , arrB = Array.isArray(b)
+    , i;
+
+  if (arrA && arrB) {
+    if (a.length != b.length) return false;
+    for (i = 0; i < a.length; i++)
+      if (!equal(a[i], b[i])) return false;
+    return true;
+  }
+
+  if (arrA != arrB) return false;
+
+  if (a && b && typeof a === 'object' && typeof b === 'object') {
+    var keys = Object.keys(a);
+    if (keys.length !== Object.keys(b).length) return false;
+
+    var dateA = a instanceof Date
+      , dateB = b instanceof Date;
+    if (dateA && dateB) return a.getTime() == b.getTime();
+    if (dateA != dateB) return false;
+
+    var regexpA = a instanceof RegExp
+      , regexpB = b instanceof RegExp;
+    if (regexpA && regexpB) return a.toString() == b.toString();
+    if (regexpA != regexpB) return false;
+
+    for (i = 0; i < keys.length; i++)
+      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+    for (i = 0; i < keys.length; i++)
+      if(!equal(a[keys[i]], b[keys[i]])) return false;
+
+    return true;
+  }
+
+  return false;
+};

File diff ditekan karena terlalu besar
+ 164 - 0
war/node_modules/ajv/lib/compile/formats.js


+ 390 - 0
war/node_modules/ajv/lib/compile/index.js

@@ -0,0 +1,390 @@
+'use strict';
+
+var resolve = require('./resolve')
+  , util = require('./util')
+  , stableStringify = require('json-stable-stringify')
+  , async = require('../async');
+
+var beautify;
+
+function loadBeautify(){
+  if (beautify === undefined) {
+    var name = 'js-beautify';
+    try { beautify = require(name).js_beautify; }
+    catch(e) { beautify = false; }
+  }
+}
+
+var validateGenerator = require('../dotjs/validate');
+
+/**
+ * Functions below are used inside compiled validations function
+ */
+
+var co = require('co');
+var ucs2length = util.ucs2length;
+var equal = require('./equal');
+
+// this error is thrown by async schemas to return validation errors via exception
+var ValidationError = require('./validation_error');
+
+module.exports = compile;
+
+
+/**
+ * Compiles schema to validation function
+ * @this   Ajv
+ * @param  {Object} schema schema object
+ * @param  {Object} root object with information about the root schema for this schema
+ * @param  {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
+ * @param  {String} baseId base ID for IDs in the schema
+ * @return {Function} validation function
+ */
+function compile(schema, root, localRefs, baseId) {
+  /* jshint validthis: true, evil: true */
+  /* eslint no-shadow: 0 */
+  var self = this
+    , opts = this._opts
+    , refVal = [ undefined ]
+    , refs = {}
+    , patterns = []
+    , patternsHash = {}
+    , defaults = []
+    , defaultsHash = {}
+    , customRules = []
+    , keepSourceCode = opts.sourceCode !== false;
+
+  root = root || { schema: schema, refVal: refVal, refs: refs };
+
+  var c = checkCompiling.call(this, schema, root, baseId);
+  var compilation = this._compilations[c.index];
+  if (c.compiling) return (compilation.callValidate = callValidate);
+
+  var formats = this._formats;
+  var RULES = this.RULES;
+
+  try {
+    var v = localCompile(schema, root, localRefs, baseId);
+    compilation.validate = v;
+    var cv = compilation.callValidate;
+    if (cv) {
+      cv.schema = v.schema;
+      cv.errors = null;
+      cv.refs = v.refs;
+      cv.refVal = v.refVal;
+      cv.root = v.root;
+      cv.$async = v.$async;
+      if (keepSourceCode) cv.sourceCode = v.sourceCode;
+    }
+    return v;
+  } finally {
+    endCompiling.call(this, schema, root, baseId);
+  }
+
+  function callValidate() {
+    var validate = compilation.validate;
+    var result = validate.apply(null, arguments);
+    callValidate.errors = validate.errors;
+    return result;
+  }
+
+  function localCompile(_schema, _root, localRefs, baseId) {
+    var isRoot = !_root || (_root && _root.schema == _schema);
+    if (_root.schema != root.schema)
+      return compile.call(self, _schema, _root, localRefs, baseId);
+
+    var $async = _schema.$async === true;
+    if ($async && !opts.transpile) async.setup(opts);
+
+    var sourceCode = validateGenerator({
+      isTop: true,
+      schema: _schema,
+      isRoot: isRoot,
+      baseId: baseId,
+      root: _root,
+      schemaPath: '',
+      errSchemaPath: '#',
+      errorPath: '""',
+      RULES: RULES,
+      validate: validateGenerator,
+      util: util,
+      resolve: resolve,
+      resolveRef: resolveRef,
+      usePattern: usePattern,
+      useDefault: useDefault,
+      useCustomRule: useCustomRule,
+      opts: opts,
+      formats: formats,
+      self: self
+    });
+
+    sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
+                   + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
+                   + sourceCode;
+
+    if (opts.beautify) {
+      loadBeautify();
+      /* istanbul ignore else */
+      if (beautify) sourceCode = beautify(sourceCode, opts.beautify);
+      else console.error('"npm install js-beautify" to use beautify option');
+    }
+    // console.log('\n\n\n *** \n', sourceCode);
+    var validate, validateCode
+      , transpile = opts._transpileFunc;
+    try {
+      validateCode = $async && transpile
+                      ? transpile(sourceCode)
+                      : sourceCode;
+
+      var makeValidate = new Function(
+        'self',
+        'RULES',
+        'formats',
+        'root',
+        'refVal',
+        'defaults',
+        'customRules',
+        'co',
+        'equal',
+        'ucs2length',
+        'ValidationError',
+        validateCode
+      );
+
+      validate = makeValidate(
+        self,
+        RULES,
+        formats,
+        root,
+        refVal,
+        defaults,
+        customRules,
+        co,
+        equal,
+        ucs2length,
+        ValidationError
+      );
+
+      refVal[0] = validate;
+    } catch(e) {
+      console.error('Error compiling schema, function code:', validateCode);
+      throw e;
+    }
+
+    validate.schema = _schema;
+    validate.errors = null;
+    validate.refs = refs;
+    validate.refVal = refVal;
+    validate.root = isRoot ? validate : _root;
+    if ($async) validate.$async = true;
+    if (keepSourceCode) validate.sourceCode = sourceCode;
+    if (opts.sourceCode === true) {
+      validate.source = {
+        patterns: patterns,
+        defaults: defaults
+      };
+    }
+
+    return validate;
+  }
+
+  function resolveRef(baseId, ref, isRoot) {
+    ref = resolve.url(baseId, ref);
+    var refIndex = refs[ref];
+    var _refVal, refCode;
+    if (refIndex !== undefined) {
+      _refVal = refVal[refIndex];
+      refCode = 'refVal[' + refIndex + ']';
+      return resolvedRef(_refVal, refCode);
+    }
+    if (!isRoot && root.refs) {
+      var rootRefId = root.refs[ref];
+      if (rootRefId !== undefined) {
+        _refVal = root.refVal[rootRefId];
+        refCode = addLocalRef(ref, _refVal);
+        return resolvedRef(_refVal, refCode);
+      }
+    }
+
+    refCode = addLocalRef(ref);
+    var v = resolve.call(self, localCompile, root, ref);
+    if (!v) {
+      var localSchema = localRefs && localRefs[ref];
+      if (localSchema) {
+        v = resolve.inlineRef(localSchema, opts.inlineRefs)
+            ? localSchema
+            : compile.call(self, localSchema, root, localRefs, baseId);
+      }
+    }
+
+    if (v) {
+      replaceLocalRef(ref, v);
+      return resolvedRef(v, refCode);
+    }
+  }
+
+  function addLocalRef(ref, v) {
+    var refId = refVal.length;
+    refVal[refId] = v;
+    refs[ref] = refId;
+    return 'refVal' + refId;
+  }
+
+  function replaceLocalRef(ref, v) {
+    var refId = refs[ref];
+    refVal[refId] = v;
+  }
+
+  function resolvedRef(refVal, code) {
+    return typeof refVal == 'object'
+            ? { code: code, schema: refVal, inline: true }
+            : { code: code, $async: refVal && refVal.$async };
+  }
+
+  function usePattern(regexStr) {
+    var index = patternsHash[regexStr];
+    if (index === undefined) {
+      index = patternsHash[regexStr] = patterns.length;
+      patterns[index] = regexStr;
+    }
+    return 'pattern' + index;
+  }
+
+  function useDefault(value) {
+    switch (typeof value) {
+      case 'boolean':
+      case 'number':
+        return '' + value;
+      case 'string':
+        return util.toQuotedString(value);
+      case 'object':
+        if (value === null) return 'null';
+        var valueStr = stableStringify(value);
+        var index = defaultsHash[valueStr];
+        if (index === undefined) {
+          index = defaultsHash[valueStr] = defaults.length;
+          defaults[index] = value;
+        }
+        return 'default' + index;
+    }
+  }
+
+  function useCustomRule(rule, schema, parentSchema, it) {
+    var validateSchema = rule.definition.validateSchema;
+    if (validateSchema && self._opts.validateSchema !== false) {
+      var valid = validateSchema(schema);
+      if (!valid) {
+        var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
+        if (self._opts.validateSchema == 'log') console.error(message);
+        else throw new Error(message);
+      }
+    }
+
+    var compile = rule.definition.compile
+      , inline = rule.definition.inline
+      , macro = rule.definition.macro;
+
+    var validate;
+    if (compile) {
+      validate = compile.call(self, schema, parentSchema, it);
+    } else if (macro) {
+      validate = macro.call(self, schema, parentSchema, it);
+      if (opts.validateSchema !== false) self.validateSchema(validate, true);
+    } else if (inline) {
+      validate = inline.call(self, it, rule.keyword, schema, parentSchema);
+    } else {
+      validate = rule.definition.validate;
+    }
+
+    var index = customRules.length;
+    customRules[index] = validate;
+
+    return {
+      code: 'customRule' + index,
+      validate: validate
+    };
+  }
+}
+
+
+/**
+ * Checks if the schema is currently compiled
+ * @this   Ajv
+ * @param  {Object} schema schema to compile
+ * @param  {Object} root root object
+ * @param  {String} baseId base schema ID
+ * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
+ */
+function checkCompiling(schema, root, baseId) {
+  /* jshint validthis: true */
+  var index = compIndex.call(this, schema, root, baseId);
+  if (index >= 0) return { index: index, compiling: true };
+  index = this._compilations.length;
+  this._compilations[index] = {
+    schema: schema,
+    root: root,
+    baseId: baseId
+  };
+  return { index: index, compiling: false };
+}
+
+
+/**
+ * Removes the schema from the currently compiled list
+ * @this   Ajv
+ * @param  {Object} schema schema to compile
+ * @param  {Object} root root object
+ * @param  {String} baseId base schema ID
+ */
+function endCompiling(schema, root, baseId) {
+  /* jshint validthis: true */
+  var i = compIndex.call(this, schema, root, baseId);
+  if (i >= 0) this._compilations.splice(i, 1);
+}
+
+
+/**
+ * Index of schema compilation in the currently compiled list
+ * @this   Ajv
+ * @param  {Object} schema schema to compile
+ * @param  {Object} root root object
+ * @param  {String} baseId base schema ID
+ * @return {Integer} compilation index
+ */
+function compIndex(schema, root, baseId) {
+  /* jshint validthis: true */
+  for (var i=0; i<this._compilations.length; i++) {
+    var c = this._compilations[i];
+    if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
+  }
+  return -1;
+}
+
+
+function patternCode(i, patterns) {
+  return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
+}
+
+
+function defaultCode(i) {
+  return 'var default' + i + ' = defaults[' + i + '];';
+}
+
+
+function refValCode(i, refVal) {
+  return refVal[i] ? 'var refVal' + i + ' = refVal[' + i + '];' : '';
+}
+
+
+function customRuleCode(i) {
+  return 'var customRule' + i + ' = customRules[' + i + '];';
+}
+
+
+function vars(arr, statement) {
+  if (!arr.length) return '';
+  var code = '';
+  for (var i=0; i<arr.length; i++)
+    code += statement(i, arr);
+  return code;
+}

+ 267 - 0
war/node_modules/ajv/lib/compile/resolve.js

@@ -0,0 +1,267 @@
+'use strict';
+
+var url = require('url')
+  , equal = require('./equal')
+  , util = require('./util')
+  , SchemaObject = require('./schema_obj');
+
+module.exports = resolve;
+
+resolve.normalizeId = normalizeId;
+resolve.fullPath = getFullPath;
+resolve.url = resolveUrl;
+resolve.ids = resolveIds;
+resolve.inlineRef = inlineRef;
+resolve.schema = resolveSchema;
+
+/**
+ * [resolve and compile the references ($ref)]
+ * @this   Ajv
+ * @param  {Function} compile reference to schema compilation funciton (localCompile)
+ * @param  {Object} root object with information about the root schema for the current schema
+ * @param  {String} ref reference to resolve
+ * @return {Object|Function} schema object (if the schema can be inlined) or validation function
+ */
+function resolve(compile, root, ref) {
+  /* jshint validthis: true */
+  var refVal = this._refs[ref];
+  if (typeof refVal == 'string') {
+    if (this._refs[refVal]) refVal = this._refs[refVal];
+    else return resolve.call(this, compile, root, refVal);
+  }
+
+  refVal = refVal || this._schemas[ref];
+  if (refVal instanceof SchemaObject) {
+    return inlineRef(refVal.schema, this._opts.inlineRefs)
+            ? refVal.schema
+            : refVal.validate || this._compile(refVal);
+  }
+
+  var res = resolveSchema.call(this, root, ref);
+  var schema, v, baseId;
+  if (res) {
+    schema = res.schema;
+    root = res.root;
+    baseId = res.baseId;
+  }
+
+  if (schema instanceof SchemaObject) {
+    v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
+  } else if (schema) {
+    v = inlineRef(schema, this._opts.inlineRefs)
+        ? schema
+        : compile.call(this, schema, root, undefined, baseId);
+  }
+
+  return v;
+}
+
+
+/**
+ * Resolve schema, its root and baseId
+ * @this Ajv
+ * @param  {Object} root root object with properties schema, refVal, refs
+ * @param  {String} ref  reference to resolve
+ * @return {Object} object with properties schema, root, baseId
+ */
+function resolveSchema(root, ref) {
+  /* jshint validthis: true */
+  var p = url.parse(ref, false, true)
+    , refPath = _getFullPath(p)
+    , baseId = getFullPath(root.schema.id);
+  if (refPath !== baseId) {
+    var id = normalizeId(refPath);
+    var refVal = this._refs[id];
+    if (typeof refVal == 'string') {
+      return resolveRecursive.call(this, root, refVal, p);
+    } else if (refVal instanceof SchemaObject) {
+      if (!refVal.validate) this._compile(refVal);
+      root = refVal;
+    } else {
+      refVal = this._schemas[id];
+      if (refVal instanceof SchemaObject) {
+        if (!refVal.validate) this._compile(refVal);
+        if (id == normalizeId(ref))
+          return { schema: refVal, root: root, baseId: baseId };
+        root = refVal;
+      } else {
+        return;
+      }
+    }
+    if (!root.schema) return;
+    baseId = getFullPath(root.schema.id);
+  }
+  return getJsonPointer.call(this, p, baseId, root.schema, root);
+}
+
+
+/* @this Ajv */
+function resolveRecursive(root, ref, parsedRef) {
+  /* jshint validthis: true */
+  var res = resolveSchema.call(this, root, ref);
+  if (res) {
+    var schema = res.schema;
+    var baseId = res.baseId;
+    root = res.root;
+    if (schema.id) baseId = resolveUrl(baseId, schema.id);
+    return getJsonPointer.call(this, parsedRef, baseId, schema, root);
+  }
+}
+
+
+var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
+/* @this Ajv */
+function getJsonPointer(parsedRef, baseId, schema, root) {
+  /* jshint validthis: true */
+  parsedRef.hash = parsedRef.hash || '';
+  if (parsedRef.hash.slice(0,2) != '#/') return;
+  var parts = parsedRef.hash.split('/');
+
+  for (var i = 1; i < parts.length; i++) {
+    var part = parts[i];
+    if (part) {
+      part = util.unescapeFragment(part);
+      schema = schema[part];
+      if (!schema) break;
+      if (schema.id && !PREVENT_SCOPE_CHANGE[part]) baseId = resolveUrl(baseId, schema.id);
+      if (schema.$ref) {
+        var $ref = resolveUrl(baseId, schema.$ref);
+        var res = resolveSchema.call(this, root, $ref);
+        if (res) {
+          schema = res.schema;
+          root = res.root;
+          baseId = res.baseId;
+        }
+      }
+    }
+  }
+  if (schema && schema != root.schema)
+    return { schema: schema, root: root, baseId: baseId };
+}
+
+
+var SIMPLE_INLINED = util.toHash([
+  'type', 'format', 'pattern',
+  'maxLength', 'minLength',
+  'maxProperties', 'minProperties',
+  'maxItems', 'minItems',
+  'maximum', 'minimum',
+  'uniqueItems', 'multipleOf',
+  'required', 'enum'
+]);
+function inlineRef(schema, limit) {
+  if (limit === false) return false;
+  if (limit === undefined || limit === true) return checkNoRef(schema);
+  else if (limit) return countKeys(schema) <= limit;
+}
+
+
+function checkNoRef(schema) {
+  var item;
+  if (Array.isArray(schema)) {
+    for (var i=0; i<schema.length; i++) {
+      item = schema[i];
+      if (typeof item == 'object' && !checkNoRef(item)) return false;
+    }
+  } else {
+    for (var key in schema) {
+      if (key == '$ref') return false;
+      item = schema[key];
+      if (typeof item == 'object' && !checkNoRef(item)) return false;
+    }
+  }
+  return true;
+}
+
+
+function countKeys(schema) {
+  var count = 0, item;
+  if (Array.isArray(schema)) {
+    for (var i=0; i<schema.length; i++) {
+      item = schema[i];
+      if (typeof item == 'object') count += countKeys(item);
+      if (count == Infinity) return Infinity;
+    }
+  } else {
+    for (var key in schema) {
+      if (key == '$ref') return Infinity;
+      if (SIMPLE_INLINED[key]) {
+        count++;
+      } else {
+        item = schema[key];
+        if (typeof item == 'object') count += countKeys(item) + 1;
+        if (count == Infinity) return Infinity;
+      }
+    }
+  }
+  return count;
+}
+
+
+function getFullPath(id, normalize) {
+  if (normalize !== false) id = normalizeId(id);
+  var p = url.parse(id, false, true);
+  return _getFullPath(p);
+}
+
+
+function _getFullPath(p) {
+  var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : '';
+  return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'')  + '#';
+}
+
+
+var TRAILING_SLASH_HASH = /#\/?$/;
+function normalizeId(id) {
+  return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
+}
+
+
+function resolveUrl(baseId, id) {
+  id = normalizeId(id);
+  return url.resolve(baseId, id);
+}
+
+
+/* @this Ajv */
+function resolveIds(schema) {
+  /* eslint no-shadow: 0 */
+  /* jshint validthis: true */
+  var id = normalizeId(schema.id);
+  var localRefs = {};
+  _resolveIds.call(this, schema, getFullPath(id, false), id);
+  return localRefs;
+
+  /* @this Ajv */
+  function _resolveIds(schema, fullPath, baseId) {
+    /* jshint validthis: true */
+    if (Array.isArray(schema)) {
+      for (var i=0; i<schema.length; i++)
+        _resolveIds.call(this, schema[i], fullPath+'/'+i, baseId);
+    } else if (schema && typeof schema == 'object') {
+      if (typeof schema.id == 'string') {
+        var id = baseId = baseId
+                          ? url.resolve(baseId, schema.id)
+                          : schema.id;
+        id = normalizeId(id);
+
+        var refVal = this._refs[id];
+        if (typeof refVal == 'string') refVal = this._refs[refVal];
+        if (refVal && refVal.schema) {
+          if (!equal(schema, refVal.schema))
+            throw new Error('id "' + id + '" resolves to more than one schema');
+        } else if (id != normalizeId(fullPath)) {
+          if (id[0] == '#') {
+            if (localRefs[id] && !equal(schema, localRefs[id]))
+              throw new Error('id "' + id + '" resolves to more than one schema');
+            localRefs[id] = schema;
+          } else {
+            this._refs[id] = fullPath;
+          }
+        }
+      }
+      for (var key in schema)
+        _resolveIds.call(this, schema[key], fullPath+'/'+util.escapeFragment(key), baseId);
+    }
+  }
+}

+ 40 - 0
war/node_modules/ajv/lib/compile/rules.js

@@ -0,0 +1,40 @@
+'use strict';
+
+var ruleModules = require('./_rules')
+  , toHash = require('./util').toHash;
+
+module.exports = function rules() {
+  var RULES = [
+    { type: 'number',
+      rules: [ 'maximum', 'minimum', 'multipleOf'] },
+    { type: 'string',
+      rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
+    { type: 'array',
+      rules: [ 'maxItems', 'minItems', 'uniqueItems', 'items' ] },
+    { type: 'object',
+      rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'properties' ] },
+    { rules: [ '$ref', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] }
+  ];
+
+  var ALL = [ 'type', 'additionalProperties', 'patternProperties' ];
+  var KEYWORDS = [ 'additionalItems', '$schema', 'id', 'title', 'description', 'default' ];
+  var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
+  RULES.all = toHash(ALL);
+
+  RULES.forEach(function (group) {
+    group.rules = group.rules.map(function (keyword) {
+      ALL.push(keyword);
+      var rule = RULES.all[keyword] = {
+        keyword: keyword,
+        code: ruleModules[keyword]
+      };
+      return rule;
+    });
+  });
+
+  RULES.keywords = toHash(ALL.concat(KEYWORDS));
+  RULES.types = toHash(TYPES);
+  RULES.custom = {};
+
+  return RULES;
+};

+ 9 - 0
war/node_modules/ajv/lib/compile/schema_obj.js

@@ -0,0 +1,9 @@
+'use strict';
+
+var util = require('./util');
+
+module.exports = SchemaObject;
+
+function SchemaObject(obj) {
+  util.copy(obj, this);
+}

+ 20 - 0
war/node_modules/ajv/lib/compile/ucs2length.js

@@ -0,0 +1,20 @@
+'use strict';
+
+// https://mathiasbynens.be/notes/javascript-encoding
+// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
+module.exports = function ucs2length(str) {
+  var length = 0
+    , len = str.length
+    , pos = 0
+    , value;
+  while (pos < len) {
+    length++;
+    value = str.charCodeAt(pos++);
+    if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
+      // high surrogate, and there is a next character
+      value = str.charCodeAt(pos);
+      if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
+    }
+  }
+  return length;
+};

+ 257 - 0
war/node_modules/ajv/lib/compile/util.js

@@ -0,0 +1,257 @@
+'use strict';
+
+
+module.exports = {
+  copy: copy,
+  checkDataType: checkDataType,
+  checkDataTypes: checkDataTypes,
+  coerceToTypes: coerceToTypes,
+  toHash: toHash,
+  getProperty: getProperty,
+  escapeQuotes: escapeQuotes,
+  ucs2length: require('./ucs2length'),
+  varOccurences: varOccurences,
+  varReplace: varReplace,
+  cleanUpCode: cleanUpCode,
+  cleanUpVarErrors: cleanUpVarErrors,
+  schemaHasRules: schemaHasRules,
+  schemaHasRulesExcept: schemaHasRulesExcept,
+  stableStringify: require('json-stable-stringify'),
+  toQuotedString: toQuotedString,
+  getPathExpr: getPathExpr,
+  getPath: getPath,
+  getData: getData,
+  unescapeFragment: unescapeFragment,
+  escapeFragment: escapeFragment,
+  escapeJsonPointer: escapeJsonPointer
+};
+
+
+function copy(o, to) {
+  to = to || {};
+  for (var key in o) to[key] = o[key];
+  return to;
+}
+
+
+function checkDataType(dataType, data, negate) {
+  var EQUAL = negate ? ' !== ' : ' === '
+    , AND = negate ? ' || ' : ' && '
+    , OK = negate ? '!' : ''
+    , NOT = negate ? '' : '!';
+  switch (dataType) {
+    case 'null': return data + EQUAL + 'null';
+    case 'array': return OK + 'Array.isArray(' + data + ')';
+    case 'object': return '(' + OK + data + AND +
+                          'typeof ' + data + EQUAL + '"object"' + AND +
+                          NOT + 'Array.isArray(' + data + '))';
+    case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
+                           NOT + '(' + data + ' % 1)' +
+                           AND + data + EQUAL + data + ')';
+    default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
+  }
+}
+
+
+function checkDataTypes(dataTypes, data) {
+  switch (dataTypes.length) {
+    case 1: return checkDataType(dataTypes[0], data, true);
+    default:
+      var code = '';
+      var types = toHash(dataTypes);
+      if (types.array && types.object) {
+        code = types.null ? '(': '(!' + data + ' || ';
+        code += 'typeof ' + data + ' !== "object")';
+        delete types.null;
+        delete types.array;
+        delete types.object;
+      }
+      if (types.number) delete types.integer;
+      for (var t in types)
+        code += (code ? ' && ' : '' ) + checkDataType(t, data, true);
+
+      return code;
+  }
+}
+
+
+var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
+function coerceToTypes(optionCoerceTypes, dataTypes) {
+  if (Array.isArray(dataTypes)) {
+    var types = [];
+    for (var i=0; i<dataTypes.length; i++) {
+      var t = dataTypes[i];
+      if (COERCE_TO_TYPES[t]) types[types.length] = t;
+      else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
+    }
+    if (types.length) return types;
+  } else if (COERCE_TO_TYPES[dataTypes]) {
+    return [dataTypes];
+  } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
+    return ['array'];
+  }
+}
+
+
+function toHash(arr) {
+  var hash = {};
+  for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
+  return hash;
+}
+
+
+var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
+var SINGLE_QUOTE = /'|\\/g;
+function getProperty(key) {
+  return typeof key == 'number'
+          ? '[' + key + ']'
+          : IDENTIFIER.test(key)
+            ? '.' + key
+            : "['" + escapeQuotes(key) + "']";
+}
+
+
+function escapeQuotes(str) {
+  return str.replace(SINGLE_QUOTE, '\\$&')
+            .replace(/\n/g, '\\n')
+            .replace(/\r/g, '\\r')
+            .replace(/\f/g, '\\f')
+            .replace(/\t/g, '\\t');
+}
+
+
+function varOccurences(str, dataVar) {
+  dataVar += '[^0-9]';
+  var matches = str.match(new RegExp(dataVar, 'g'));
+  return matches ? matches.length : 0;
+}
+
+
+function varReplace(str, dataVar, expr) {
+  dataVar += '([^0-9])';
+  expr = expr.replace(/\$/g, '$$$$');
+  return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
+}
+
+
+var EMPTY_ELSE = /else\s*{\s*}/g
+  , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g
+  , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;
+function cleanUpCode(out) {
+  return out.replace(EMPTY_ELSE, '')
+            .replace(EMPTY_IF_NO_ELSE, '')
+            .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');
+}
+
+
+var ERRORS_REGEXP = /[^v\.]errors/g
+  , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g
+  , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g
+  , RETURN_VALID = 'return errors === 0;'
+  , RETURN_TRUE = 'validate.errors = null; return true;'
+  , RETURN_ASYNC = /if \(errors === 0\) return true;\s*else throw new ValidationError\(vErrors\);/
+  , RETURN_TRUE_ASYNC = 'return true;';
+
+function cleanUpVarErrors(out, async) {
+  var matches = out.match(ERRORS_REGEXP);
+  if (!matches || matches.length !== 2) return out;
+  return async
+          ? out.replace(REMOVE_ERRORS_ASYNC, '')
+               .replace(RETURN_ASYNC, RETURN_TRUE_ASYNC)
+          : out.replace(REMOVE_ERRORS, '')
+               .replace(RETURN_VALID, RETURN_TRUE);
+}
+
+
+function schemaHasRules(schema, rules) {
+  for (var key in schema) if (rules[key]) return true;
+}
+
+
+function schemaHasRulesExcept(schema, rules, exceptKeyword) {
+  for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
+}
+
+
+function toQuotedString(str) {
+  return '\'' + escapeQuotes(str) + '\'';
+}
+
+
+function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
+  var path = jsonPointers // false by default
+              ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
+              : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
+  return joinPaths(currentPath, path);
+}
+
+
+function getPath(currentPath, prop, jsonPointers) {
+  var path = jsonPointers // false by default
+              ? toQuotedString('/' + escapeJsonPointer(prop))
+              : toQuotedString(getProperty(prop));
+  return joinPaths(currentPath, path);
+}
+
+
+var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
+var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
+function getData($data, lvl, paths) {
+  var up, jsonPointer, data, matches;
+  if ($data === '') return 'rootData';
+  if ($data[0] == '/') {
+    if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
+    jsonPointer = $data;
+    data = 'rootData';
+  } else {
+    matches = $data.match(RELATIVE_JSON_POINTER);
+    if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
+    up = +matches[1];
+    jsonPointer = matches[2];
+    if (jsonPointer == '#') {
+      if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
+      return paths[lvl - up];
+    }
+
+    if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
+    data = 'data' + ((lvl - up) || '');
+    if (!jsonPointer) return data;
+  }
+
+  var expr = data;
+  var segments = jsonPointer.split('/');
+  for (var i=0; i<segments.length; i++) {
+    var segment = segments[i];
+    if (segment) {
+      data += getProperty(unescapeJsonPointer(segment));
+      expr += ' && ' + data;
+    }
+  }
+  return expr;
+}
+
+
+function joinPaths (a, b) {
+  if (a == '""') return b;
+  return (a + ' + ' + b).replace(/' \+ '/g, '');
+}
+
+
+function unescapeFragment(str) {
+  return unescapeJsonPointer(decodeURIComponent(str));
+}
+
+
+function escapeFragment(str) {
+  return encodeURIComponent(escapeJsonPointer(str));
+}
+
+
+function escapeJsonPointer(str) {
+  return str.replace(/~/g, '~0').replace(/\//g, '~1');
+}
+
+
+function unescapeJsonPointer(str) {
+  return str.replace(/~1/g, '/').replace(/~0/g, '~');
+}

+ 14 - 0
war/node_modules/ajv/lib/compile/validation_error.js

@@ -0,0 +1,14 @@
+'use strict';
+
+module.exports = ValidationError;
+
+
+function ValidationError(errors) {
+  this.message = 'validation failed';
+  this.errors = errors;
+  this.ajv = this.validation = true;
+}
+
+
+ValidationError.prototype = Object.create(Error.prototype);
+ValidationError.prototype.constructor = ValidationError;

+ 49 - 0
war/node_modules/ajv/lib/dot/_limit.jst

@@ -0,0 +1,49 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{
+  var $isMax = $keyword == 'maximum'
+    , $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum'
+    , $schemaExcl = it.schema[$exclusiveKeyword]
+    , $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data
+    , $op = $isMax ? '<' : '>'
+    , $notOp = $isMax ? '>' : '<';
+}}
+
+{{? $isDataExcl }}
+  {{
+    var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr)
+      , $exclusive = 'exclusive' + $lvl
+      , $opExpr = 'op' + $lvl
+      , $opStr = '\' + ' + $opExpr + ' + \'';
+  }}
+  var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}};
+  {{ $schemaValueExcl = 'schemaExcl' + $lvl; }}
+
+  var exclusive{{=$lvl}};
+  if (typeof {{=$schemaValueExcl}} != 'boolean' && typeof {{=$schemaValueExcl}} != 'undefined') {
+    {{ var $errorKeyword = $exclusiveKeyword; }}
+    {{# def.error:'_exclusiveLimit' }}
+  } else if({{# def.$dataNotType:'number' }}
+            ((exclusive{{=$lvl}} = {{=$schemaValueExcl}} === true)
+              ? {{=$data}} {{=$notOp}}= {{=$schemaValue}}
+              : {{=$data}} {{=$notOp}} {{=$schemaValue}})
+            || {{=$data}} !== {{=$data}}) {
+    var op{{=$lvl}} = exclusive{{=$lvl}} ? '{{=$op}}' : '{{=$op}}=';
+{{??}}
+  {{
+    var $exclusive = $schemaExcl === true
+      , $opStr = $op;  /*used in error*/
+    if (!$exclusive) $opStr += '=';
+    var $opExpr = '\'' + $opStr + '\''; /*used in error*/
+  }}
+
+  if ({{# def.$dataNotType:'number' }}
+      {{=$data}} {{=$notOp}}{{?$exclusive}}={{?}} {{=$schemaValue}}
+      || {{=$data}} !== {{=$data}}) {
+{{?}}
+    {{ var $errorKeyword = $keyword; }}
+    {{# def.error:'_limit' }}
+  } {{? $breakOnError }} else { {{?}}

+ 10 - 0
war/node_modules/ajv/lib/dot/_limitItems.jst

@@ -0,0 +1,10 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }}
+if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) {
+  {{ var $errorKeyword = $keyword; }}
+  {{# def.error:'_limitItems' }}
+} {{? $breakOnError }} else { {{?}}

+ 10 - 0
war/node_modules/ajv/lib/dot/_limitLength.jst

@@ -0,0 +1,10 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }}
+if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) {
+  {{ var $errorKeyword = $keyword; }}
+  {{# def.error:'_limitLength' }}
+} {{? $breakOnError }} else { {{?}}

+ 10 - 0
war/node_modules/ajv/lib/dot/_limitProperties.jst

@@ -0,0 +1,10 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }}
+if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) {
+  {{ var $errorKeyword = $keyword; }}
+  {{# def.error:'_limitProperties' }}
+} {{? $breakOnError }} else { {{?}}

+ 34 - 0
war/node_modules/ajv/lib/dot/allOf.jst

@@ -0,0 +1,34 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+{{
+  var $currentBaseId = $it.baseId
+    , $allSchemasEmpty = true;
+}}
+
+{{~ $schema:$sch:$i }}
+  {{? {{# def.nonEmptySchema:$sch }} }}
+    {{
+      $allSchemasEmpty = false;
+      $it.schema = $sch;
+      $it.schemaPath = $schemaPath + '[' + $i + ']';
+      $it.errSchemaPath = $errSchemaPath + '/' + $i;
+    }}
+
+    {{# def.insertSubschemaCode }}
+
+    {{# def.ifResultValid }}
+  {{?}}
+{{~}}
+
+{{? $breakOnError }}
+  {{? $allSchemasEmpty }}
+    if (true) {
+  {{??}}
+    {{= $closingBraces.slice(0,-1) }}
+  {{?}}
+{{?}}
+
+{{# def.cleanUp }}

+ 48 - 0
war/node_modules/ajv/lib/dot/anyOf.jst

@@ -0,0 +1,48 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+{{
+  var $noEmptySchema = $schema.every(function($sch) {
+    return {{# def.nonEmptySchema:$sch }};
+  });
+}}
+{{? $noEmptySchema }}
+  {{ var $currentBaseId = $it.baseId; }}
+  var {{=$errs}} = errors;
+  var {{=$valid}} = false;
+
+  {{# def.setCompositeRule }}
+
+  {{~ $schema:$sch:$i }}
+    {{
+      $it.schema = $sch;
+      $it.schemaPath = $schemaPath + '[' + $i + ']';
+      $it.errSchemaPath = $errSchemaPath + '/' + $i;
+    }}
+
+    {{# def.insertSubschemaCode }}
+
+    {{=$valid}} = {{=$valid}} || {{=$nextValid}};
+
+    if (!{{=$valid}}) {
+    {{ $closingBraces += '}'; }}
+  {{~}}
+
+  {{# def.resetCompositeRule }}
+
+  {{= $closingBraces }}
+
+  if (!{{=$valid}}) {
+    {{# def.addError:'anyOf' }}
+  } else {
+    {{# def.resetErrors }}
+  {{? it.opts.allErrors }} } {{?}}
+
+  {{# def.cleanUp }}
+{{??}}
+  {{? $breakOnError }}
+    if (true) {
+  {{?}}
+{{?}}

+ 61 - 0
war/node_modules/ajv/lib/dot/coerce.def

@@ -0,0 +1,61 @@
+{{## def.coerceType:
+  {{
+    var $dataType = 'dataType' + $lvl
+      , $coerced = 'coerced' + $lvl;
+  }}
+  var {{=$dataType}} = typeof {{=$data}};
+  {{? it.opts.coerceTypes == 'array'}}
+    if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';
+  {{?}}
+
+  var {{=$coerced}} = undefined;
+
+  {{ var $bracesCoercion = ''; }}
+  {{~ $coerceToTypes:$type:$i }}
+    {{? $i }}
+      if ({{=$coerced}} === undefined) {
+      {{ $bracesCoercion += '}'; }}
+    {{?}}
+
+    {{? it.opts.coerceTypes == 'array' && $type != 'array' }}
+      if ({{=$dataType}} == 'array' && {{=$data}}.length == 1) {
+        {{=$coerced}} = {{=$data}} = {{=$data}}[0];
+        {{=$dataType}} = typeof {{=$data}};
+        /*if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';*/
+      }
+    {{?}}
+
+    {{? $type == 'string' }}
+      if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean')
+        {{=$coerced}} = '' + {{=$data}};
+      else if ({{=$data}} === null) {{=$coerced}} = '';
+    {{?? $type == 'number' || $type == 'integer' }}
+      if ({{=$dataType}} == 'boolean' || {{=$data}} === null
+          || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}}
+          {{? $type == 'integer' }} && !({{=$data}} % 1){{?}}))
+        {{=$coerced}} = +{{=$data}};
+    {{?? $type == 'boolean' }}
+      if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null)
+        {{=$coerced}} = false;
+      else if ({{=$data}} === 'true' || {{=$data}} === 1)
+        {{=$coerced}} = true;
+    {{?? $type == 'null' }}
+      if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false)
+        {{=$coerced}} = null;
+    {{?? it.opts.coerceTypes == 'array' && $type == 'array' }}
+      if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null)
+        {{=$coerced}} = [{{=$data}}];
+    {{?}}
+  {{~}}
+
+  {{= $bracesCoercion }}
+
+  if ({{=$coerced}} === undefined) {
+    {{# def.error:'type' }}
+  } else {
+    {{# def.setParentData }}
+    {{=$data}} = {{=$coerced}};
+    {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}}
+      {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}};
+  }
+#}}

+ 184 - 0
war/node_modules/ajv/lib/dot/custom.jst

@@ -0,0 +1,184 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{
+  var $rule = this
+    , $definition = 'definition' + $lvl
+    , $rDef = $rule.definition;
+  var $validate = $rDef.validate;
+  var $compile, $inline, $macro, $ruleValidate, $validateCode;
+}}
+
+{{? $isData && $rDef.$data }}
+  {{
+    $validateCode = 'keywordValidate' + $lvl;
+    var $validateSchema = $rDef.validateSchema;
+  }}
+  var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition;
+  var {{=$validateCode}} = {{=$definition}}.validate;
+{{??}}
+  {{
+    $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
+    $schemaValue = 'validate.schema' + $schemaPath;
+    $validateCode = $ruleValidate.code;
+    $compile = $rDef.compile;
+    $inline = $rDef.inline;
+    $macro = $rDef.macro;
+  }}
+{{?}}
+
+{{
+  var $ruleErrs = $validateCode + '.errors'
+    , $i = 'i' + $lvl
+    , $ruleErr = 'ruleErr' + $lvl
+    , $asyncKeyword = $rDef.async;
+
+  if ($asyncKeyword && !it.async)
+    throw new Error('async keyword in sync schema');
+}}
+
+
+{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}}
+var {{=$errs}} = errors;
+var {{=$valid}};
+
+{{## def.callRuleValidate:
+  {{=$validateCode}}.call(
+    {{? it.opts.passContext }}this{{??}}self{{?}}
+    {{? $compile || $rDef.schema === false }}
+      , {{=$data}}
+    {{??}}
+      , {{=$schemaValue}}
+      , {{=$data}}
+      , validate.schema{{=it.schemaPath}}
+    {{?}}
+    , {{# def.dataPath }}
+    {{# def.passParentData }}
+    , rootData
+  )
+#}}
+
+{{## def.extendErrors:_inline:
+  for (var {{=$i}}={{=$errs}}; {{=$i}}<errors; {{=$i}}++) {
+    var {{=$ruleErr}} = vErrors[{{=$i}}];
+    if ({{=$ruleErr}}.dataPath === undefined)
+      {{=$ruleErr}}.dataPath = (dataPath || '') + {{= it.errorPath }};
+    {{# _inline ? 'if (\{\{=$ruleErr\}\}.schemaPath === undefined) {' : '' }}
+      {{=$ruleErr}}.schemaPath = "{{=$errSchemaPath}}";
+    {{# _inline ? '}' : '' }}
+    {{? it.opts.verbose }}
+      {{=$ruleErr}}.schema = {{=$schemaValue}};
+      {{=$ruleErr}}.data = {{=$data}};
+    {{?}}
+  }
+#}}
+
+
+{{? $validateSchema }}
+  {{=$valid}} = {{=$definition}}.validateSchema({{=$schemaValue}});
+  if ({{=$valid}}) {
+{{?}}
+
+{{? $inline }}
+  {{? $rDef.statements }}
+    {{= $ruleValidate.validate }}
+  {{??}}
+    {{=$valid}} = {{= $ruleValidate.validate }};
+  {{?}}
+{{?? $macro }}
+  {{# def.setupNextLevel }}
+  {{
+    $it.schema = $ruleValidate.validate;
+    $it.schemaPath = '';
+  }}
+  {{# def.setCompositeRule }}
+  {{ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); }}
+  {{# def.resetCompositeRule }}
+  {{= $code }}
+{{??}}
+  {{# def.beginDefOut}}
+    {{# def.callRuleValidate }}
+  {{# def.storeDefOut:def_callRuleValidate }}
+
+  {{? $rDef.errors === false }}
+    {{=$valid}} = {{? $asyncKeyword }}{{=it.yieldAwait}}{{?}}{{= def_callRuleValidate }};
+  {{??}}
+    {{? $asyncKeyword }}
+      {{ $ruleErrs = 'customErrors' + $lvl; }}
+      var {{=$ruleErrs}} = null;
+      try {
+        {{=$valid}} = {{=it.yieldAwait}}{{= def_callRuleValidate }};
+      } catch (e) {
+        {{=$valid}} = false;
+        if (e instanceof ValidationError) {{=$ruleErrs}} = e.errors;
+        else throw e;
+      }
+    {{??}}
+      {{=$ruleErrs}} = null;
+      {{=$valid}} = {{= def_callRuleValidate }};
+    {{?}}
+  {{?}}
+{{?}}
+
+{{? $rDef.modifying }}
+  {{=$data}} = {{=$parentData}}[{{=$parentDataProperty}}];
+{{?}}
+
+{{? $validateSchema }}
+  }
+{{?}}
+
+{{## def.notValidationResult:
+  {{? $rDef.valid === undefined }}
+    !{{? $macro }}{{=$nextValid}}{{??}}{{=$valid}}{{?}}
+  {{??}}
+    {{= !$rDef.valid }}
+  {{?}}
+#}}
+
+{{? $rDef.valid }}
+  {{? $breakOnError }} if (true) { {{?}}
+{{??}}
+  if ({{# def.notValidationResult }}) {
+    {{ $errorKeyword = $rule.keyword; }}
+    {{# def.beginDefOut}}
+      {{# def.error:'custom' }}
+    {{# def.storeDefOut:def_customError }}
+
+    {{? $inline }}
+      {{? $rDef.errors }}
+        {{? $rDef.errors != 'full' }}
+          {{# def.extendErrors:true }}
+        {{?}}
+      {{??}}
+        {{? $rDef.errors === false}}
+          {{= def_customError }}
+        {{??}}
+          if ({{=$errs}} == errors) {
+            {{= def_customError }}
+          } else {
+            {{# def.extendErrors:true }}
+          }
+        {{?}}
+      {{?}}
+    {{?? $macro }}
+      {{# def.extraError:'custom' }}
+    {{??}}
+      {{? $rDef.errors === false}}
+        {{= def_customError }}
+      {{??}}
+        if (Array.isArray({{=$ruleErrs}})) {
+          if (vErrors === null) vErrors = {{=$ruleErrs}};
+          else vErrors = vErrors.concat({{=$ruleErrs}});
+          errors = vErrors.length;
+          {{# def.extendErrors:false }}
+        } else {
+          {{= def_customError }}
+        }
+      {{?}}
+    {{?}}
+
+  } {{? $breakOnError }} else { {{?}}
+{{?}}

+ 32 - 0
war/node_modules/ajv/lib/dot/defaults.def

@@ -0,0 +1,32 @@
+{{## def.assignDefault:
+  if ({{=$passData}} === undefined)
+    {{=$passData}} = {{? it.opts.useDefaults == 'shared' }}
+                       {{= it.useDefault($sch.default) }}
+                     {{??}}
+                       {{= JSON.stringify($sch.default) }}
+                     {{?}};
+#}}
+
+
+{{## def.defaultProperties:
+  {{
+    var $schema = it.schema.properties
+      , $schemaKeys = Object.keys($schema); }}
+  {{~ $schemaKeys:$propertyKey }}
+    {{ var $sch = $schema[$propertyKey]; }}
+    {{? $sch.default !== undefined }}
+      {{ var $passData = $data + it.util.getProperty($propertyKey); }}
+      {{# def.assignDefault }}
+    {{?}}
+  {{~}}
+#}}
+
+
+{{## def.defaultItems:
+  {{~ it.schema.items:$sch:$i }}
+    {{? $sch.default !== undefined }}
+      {{ var $passData = $data + '[' + $i + ']'; }}
+      {{# def.assignDefault }}
+    {{?}}
+  {{~}}
+#}}

+ 182 - 0
war/node_modules/ajv/lib/dot/definitions.def

@@ -0,0 +1,182 @@
+{{## def.setupKeyword:
+  {{
+    var $lvl = it.level;
+    var $dataLvl = it.dataLevel;
+    var $schema = it.schema[$keyword];
+    var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
+    var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
+    var $breakOnError = !it.opts.allErrors;
+    var $errorKeyword;
+
+    var $data = 'data' + ($dataLvl || '');
+    var $valid = 'valid' + $lvl;
+    var $errs = 'errs__' + $lvl;
+  }}
+#}}
+
+
+{{## def.setCompositeRule:
+  {{
+    var $wasComposite = it.compositeRule;
+    it.compositeRule = $it.compositeRule = true;
+  }}
+#}}
+
+
+{{## def.resetCompositeRule:
+  {{ it.compositeRule = $it.compositeRule = $wasComposite; }}
+#}}
+
+
+{{## def.setupNextLevel:
+  {{
+    var $it = it.util.copy(it);
+    var $closingBraces = '';
+    $it.level++;
+    var $nextValid = 'valid' + $it.level;
+  }}
+#}}
+
+
+{{## def.ifValid:
+  {{? $breakOnError }}
+    if ({{=$valid}}) {
+    {{ $closingBraces += '}'; }}
+  {{?}}
+#}}
+
+
+{{## def.ifResultValid:
+  {{? $breakOnError }}
+    if ({{=$nextValid}}) {
+    {{ $closingBraces += '}'; }}
+  {{?}}
+#}}
+
+
+{{## def.elseIfValid:
+  {{? $breakOnError }}
+    {{ $closingBraces += '}'; }}
+    else {
+  {{?}}
+#}}
+
+
+{{## def.nonEmptySchema:_schema:
+  it.util.schemaHasRules(_schema, it.RULES.all)
+#}}
+
+
+{{## def.strLength:
+  {{? it.opts.unicode === false }}
+    {{=$data}}.length
+  {{??}}
+    ucs2length({{=$data}})
+  {{?}}
+#}}
+
+
+{{## def.willOptimize:
+  it.util.varOccurences($code, $nextData) < 2
+#}}
+
+
+{{## def.generateSubschemaCode:
+  {{
+    var $code = it.validate($it);
+    $it.baseId = $currentBaseId;
+  }}
+#}}
+
+
+{{## def.insertSubschemaCode:
+  {{= it.validate($it) }}
+  {{ $it.baseId = $currentBaseId; }}
+#}}
+
+
+{{## def._optimizeValidate:
+  it.util.varReplace($code, $nextData, $passData)
+#}}
+
+
+{{## def.optimizeValidate:
+  {{? {{# def.willOptimize}} }}
+    {{= {{# def._optimizeValidate }} }}
+  {{??}}
+    var {{=$nextData}} = {{=$passData}};
+    {{= $code }}
+  {{?}}
+#}}
+
+
+{{## def.cleanUp: {{ out = it.util.cleanUpCode(out); }} #}}
+
+
+{{## def.cleanUpVarErrors: {{ out = it.util.cleanUpVarErrors(out, $async); }} #}}
+
+
+{{## def.$data:
+  {{
+    var $isData = it.opts.v5 && $schema && $schema.$data
+      , $schemaValue;
+  }}
+  {{? $isData }}
+    var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }};
+    {{ $schemaValue = 'schema' + $lvl; }}
+  {{??}}
+    {{ $schemaValue = $schema; }}
+  {{?}}
+#}}
+
+
+{{## def.$dataNotType:_type:
+  {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}}
+#}}
+
+
+{{## def.check$dataIsArray:
+  if (schema{{=$lvl}} === undefined) {{=$valid}} = true;
+  else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false;
+  else {
+#}}
+
+
+{{## def.beginDefOut:
+  {{
+    var $$outStack = $$outStack || [];
+    $$outStack.push(out);
+    out = '';
+  }}
+#}}
+
+
+{{## def.storeDefOut:_variable:
+  {{
+    var _variable = out;
+    out = $$outStack.pop();
+  }}
+#}}
+
+
+{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}}
+
+{{## def.setParentData:
+  {{
+    var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData'
+      , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
+  }}
+#}}
+
+{{## def.passParentData:
+  {{# def.setParentData }}
+  , {{= $parentData }}
+  , {{= $parentDataProperty }}
+#}}
+
+
+{{## def.checkOwnProperty:
+  {{? $ownProperties }}
+    if (!Object.prototype.hasOwnProperty.call({{=$data}}, {{=$key}})) continue;
+  {{?}}
+#}}

+ 69 - 0
war/node_modules/ajv/lib/dot/dependencies.jst

@@ -0,0 +1,69 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.missing }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+
+{{
+  var $schemaDeps = {}
+    , $propertyDeps = {};
+
+  for ($property in $schema) {
+    var $sch = $schema[$property];
+    var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
+    $deps[$property] = $sch;
+  }
+}}
+
+var {{=$errs}} = errors;
+
+{{ var $currentErrorPath = it.errorPath; }}
+
+var missing{{=$lvl}};
+{{ for (var $property in $propertyDeps) { }}
+  {{ $deps = $propertyDeps[$property]; }}
+  if ({{=$data}}{{= it.util.getProperty($property) }} !== undefined
+    {{? $breakOnError }}
+        && ({{# def.checkMissingProperty:$deps }})) {
+        {{# def.errorMissingProperty:'dependencies' }}
+    {{??}}
+      ) {
+        {{~ $deps:$reqProperty }}
+          {{# def.allErrorsMissingProperty:'dependencies' }}
+        {{~}}
+    {{?}}
+  } {{# def.elseIfValid }}
+{{ } }}
+
+{{
+  it.errorPath = $currentErrorPath;
+  var $currentBaseId = $it.baseId;
+}}
+
+
+{{ for (var $property in $schemaDeps) { }}
+  {{ var $sch = $schemaDeps[$property]; }}
+  {{? {{# def.nonEmptySchema:$sch }} }}
+    {{=$nextValid}} = true;
+
+    if ({{=$data}}{{= it.util.getProperty($property) }} !== undefined) {
+      {{ 
+        $it.schema = $sch;
+        $it.schemaPath = $schemaPath + it.util.getProperty($property);
+        $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
+      }}
+
+      {{# def.insertSubschemaCode }}
+    }
+
+    {{# def.ifResultValid }}
+  {{?}}
+{{ } }}
+
+{{? $breakOnError }} 
+  {{= $closingBraces }}
+  if ({{=$errs}} == errors) {
+{{?}}
+
+{{# def.cleanUp }}

+ 30 - 0
war/node_modules/ajv/lib/dot/enum.jst

@@ -0,0 +1,30 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{
+  var $i = 'i' + $lvl
+    , $vSchema = 'schema' + $lvl;
+}}
+
+{{? !$isData }}
+  var {{=$vSchema}} = validate.schema{{=$schemaPath}};
+{{?}}
+var {{=$valid}};
+
+{{?$isData}}{{# def.check$dataIsArray }}{{?}}
+
+{{=$valid}} = false;
+
+for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++)
+  if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) {
+    {{=$valid}} = true;
+    break;
+  }
+
+{{? $isData }}  }  {{?}}
+
+{{# def.checkError:'enum' }}
+
+{{? $breakOnError }} else { {{?}}

+ 185 - 0
war/node_modules/ajv/lib/dot/errors.def

@@ -0,0 +1,185 @@
+{{# def.definitions }}
+
+{{## def._error:_rule:
+  {{ 'istanbul ignore else'; }}
+  {{? it.createErrors !== false }}
+    {
+      keyword: '{{= $errorKeyword || _rule }}'
+      , dataPath: (dataPath || '') + {{= it.errorPath }}
+      , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}}
+      , params: {{# def._errorParams[_rule] }}
+      {{? it.opts.messages !== false }}
+        , message: {{# def._errorMessages[_rule] }}
+      {{?}}
+      {{? it.opts.verbose }}
+        , schema: {{# def._errorSchemas[_rule] }}
+        , parentSchema: validate.schema{{=it.schemaPath}}
+        , data: {{=$data}}
+      {{?}}
+    }
+  {{??}}
+    {}
+  {{?}}
+#}}
+
+
+{{## def._addError:_rule:
+  if (vErrors === null) vErrors = [err];
+  else vErrors.push(err);
+  errors++;
+#}}
+
+
+{{## def.addError:_rule:
+  var err = {{# def._error:_rule }};
+  {{# def._addError:_rule }}
+#}}
+
+
+{{## def.error:_rule:
+  {{# def.beginDefOut}}
+    {{# def._error:_rule }}
+  {{# def.storeDefOut:__err }}
+
+  {{? !it.compositeRule && $breakOnError }}
+    {{ 'istanbul ignore if'; }}
+    {{? it.async }}
+      throw new ValidationError([{{=__err}}]);
+    {{??}}
+      validate.errors = [{{=__err}}];
+      return false;
+    {{?}}
+  {{??}}
+    var err = {{=__err}};
+    {{# def._addError:_rule }}
+  {{?}}
+#}}
+
+
+{{## def.extraError:_rule:
+  {{# def.addError:_rule}}
+  {{? !it.compositeRule && $breakOnError }}
+    {{ 'istanbul ignore if'; }}
+    {{? it.async }}
+      throw new ValidationError(vErrors);
+    {{??}}
+      validate.errors = vErrors;
+      return false;
+    {{?}}
+  {{?}}
+#}}
+
+
+{{## def.checkError:_rule:
+  if (!{{=$valid}}) {
+    {{# def.error:_rule }}
+  }
+#}}
+
+
+{{## def.resetErrors:
+  errors = {{=$errs}};
+  if (vErrors !== null) {
+    if ({{=$errs}}) vErrors.length = {{=$errs}};
+    else vErrors = null;
+  }
+#}}
+
+
+{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}}
+{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schema}}'{{?}}#}}
+{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}}
+
+{{## def._errorMessages = {
+  $ref:            "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'",
+  additionalItems: "'should NOT have more than {{=$schema.length}} items'",
+  additionalProperties: "'should NOT have additional properties'",
+  anyOf:           "'should match some schema in anyOf'",
+  dependencies:    "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'",
+  'enum':          "'should be equal to one of the allowed values'",
+  format:          "'should match format \"{{#def.concatSchemaEQ}}\"'",
+  _limit:          "'should be {{=$opStr}} {{#def.appendSchema}}",
+  _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'",
+  _limitItems:     "'should NOT have {{?$keyword=='maxItems'}}more{{??}}less{{?}} than {{#def.concatSchema}} items'",
+  _limitLength:    "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'",
+  _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}less{{?}} than {{#def.concatSchema}} properties'",
+  multipleOf:      "'should be multiple of {{#def.appendSchema}}",
+  not:             "'should NOT be valid'",
+  oneOf:           "'should match exactly one schema in oneOf'",
+  pattern:         "'should match pattern \"{{#def.concatSchemaEQ}}\"'",
+  required:        "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'",
+  type:            "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'",
+  uniqueItems:     "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'",
+  custom:          "'should pass \"{{=$rule.keyword}}\" keyword validation'",
+  patternGroups:   "'should NOT have {{=$moreOrLess}} than {{=$limit}} properties matching pattern \"{{=it.util.escapeQuotes($pgProperty)}}\"'",
+  patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''",
+  switch:          "'should pass \"switch\" keyword validation'",
+  constant:        "'should be equal to constant'",
+  _formatLimit:    "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'",
+  _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'"
+} #}}
+
+
+{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}}
+{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}}
+
+{{## def._errorSchemas = {
+  $ref:            "{{=it.util.toQuotedString($schema)}}",
+  additionalItems: "false",
+  additionalProperties: "false",
+  anyOf:           "validate.schema{{=$schemaPath}}",
+  dependencies:    "validate.schema{{=$schemaPath}}",
+  'enum':          "validate.schema{{=$schemaPath}}",
+  format:          "{{#def.schemaRefOrQS}}",
+  _limit:          "{{#def.schemaRefOrVal}}",
+  _exclusiveLimit: "validate.schema{{=$schemaPath}}",
+  _limitItems:     "{{#def.schemaRefOrVal}}",
+  _limitLength:    "{{#def.schemaRefOrVal}}",
+  _limitProperties:"{{#def.schemaRefOrVal}}",
+  multipleOf:      "{{#def.schemaRefOrVal}}",
+  not:             "validate.schema{{=$schemaPath}}",
+  oneOf:           "validate.schema{{=$schemaPath}}",
+  pattern:         "{{#def.schemaRefOrQS}}",
+  required:        "validate.schema{{=$schemaPath}}",
+  type:            "validate.schema{{=$schemaPath}}",
+  uniqueItems:     "{{#def.schemaRefOrVal}}",
+  custom:          "validate.schema{{=$schemaPath}}",
+  patternGroups:   "validate.schema{{=$schemaPath}}",
+  patternRequired: "validate.schema{{=$schemaPath}}",
+  switch:          "validate.schema{{=$schemaPath}}",
+  constant:        "validate.schema{{=$schemaPath}}",
+  _formatLimit:    "{{#def.schemaRefOrQS}}",
+  _formatExclusiveLimit: "validate.schema{{=$schemaPath}}"
+} #}}
+
+
+{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}}
+
+{{## def._errorParams = {
+  $ref:            "{ ref: '{{=it.util.escapeQuotes($schema)}}' }",
+  additionalItems: "{ limit: {{=$schema.length}} }",
+  additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }",
+  anyOf:           "{}",
+  dependencies:    "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }",
+  'enum':          "{ allowedValues: schema{{=$lvl}} }",
+  format:          "{ format: {{#def.schemaValueQS}} }",
+  _limit:          "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }",
+  _exclusiveLimit: "{}",
+  _limitItems:     "{ limit: {{=$schemaValue}} }",
+  _limitLength:    "{ limit: {{=$schemaValue}} }",
+  _limitProperties:"{ limit: {{=$schemaValue}} }",
+  multipleOf:      "{ multipleOf: {{=$schemaValue}} }",
+  not:             "{}",
+  oneOf:           "{}",
+  pattern:         "{ pattern: {{#def.schemaValueQS}} }",
+  required:        "{ missingProperty: '{{=$missingProperty}}' }",
+  type:            "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }",
+  uniqueItems:     "{ i: i, j: j }",
+  custom:          "{ keyword: '{{=$rule.keyword}}' }",
+  patternGroups:   "{ reason: '{{=$reason}}', limit: {{=$limit}}, pattern: '{{=it.util.escapeQuotes($pgProperty)}}' }",
+  patternRequired: "{ missingPattern: '{{=$missingPattern}}' }",
+  switch:          "{ caseIndex: {{=$caseIndex}} }",
+  constant:        "{}",
+  _formatLimit:    "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }",
+  _formatExclusiveLimit: "{}"
+} #}}

+ 100 - 0
war/node_modules/ajv/lib/dot/format.jst

@@ -0,0 +1,100 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+
+{{## def.skipFormat:
+  {{? $breakOnError }} if (true) { {{?}}
+  {{ return out; }}
+#}}
+
+{{? it.opts.format === false }}{{# def.skipFormat }}{{?}}
+
+
+{{# def.$data }}
+
+
+{{## def.$dataCheckFormat:
+  {{# def.$dataNotType:'string' }}
+  ({{? $unknownFormats === true || $allowUnknown }}
+     ({{=$schemaValue}} && !{{=$format}}
+      {{? $allowUnknown }}
+        && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1
+      {{?}}) ||
+   {{?}}
+   ({{=$format}} && !(typeof {{=$format}} == 'function'
+                     ? {{? it.async}}
+                        (async{{=$lvl}} ? {{=it.yieldAwait}} {{=$format}}({{=$data}}) : {{=$format}}({{=$data}}))
+                       {{??}}
+                        {{=$format}}({{=$data}})
+                       {{?}}
+                     : {{=$format}}.test({{=$data}}))))
+#}}
+
+{{## def.checkFormat:
+  {{
+    var $formatRef = 'formats' + it.util.getProperty($schema);
+    if ($isObject) $formatRef += '.validate';
+  }}
+  {{? typeof $format == 'function' }}
+    {{=$formatRef}}({{=$data}})
+  {{??}}
+    {{=$formatRef}}.test({{=$data}})
+  {{?}}
+#}}
+
+
+{{
+  var $unknownFormats = it.opts.unknownFormats
+    , $allowUnknown = Array.isArray($unknownFormats);
+}}
+
+{{? $isData }}
+  {{ var $format = 'format' + $lvl; }}
+  var {{=$format}} = formats[{{=$schemaValue}}];
+  var isObject{{=$lvl}} = typeof {{=$format}} == 'object'
+                          && !({{=$format}} instanceof RegExp)
+                          && {{=$format}}.validate;
+  if (isObject{{=$lvl}}) {
+    {{? it.async}}
+      var async{{=$lvl}} = {{=$format}}.async;
+    {{?}}
+    {{=$format}} = {{=$format}}.validate;
+  }
+  if ({{# def.$dataCheckFormat }}) {
+{{??}}
+  {{ var $format = it.formats[$schema]; }}
+  {{? !$format }}
+    {{? $unknownFormats === true || ($allowUnknown && $unknownFormats.indexOf($schema) == -1) }}
+      {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }}
+    {{??}}
+      {{
+        if (!$allowUnknown) {
+          console.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
+          if ($unknownFormats !== 'ignore')
+            console.warn('In the next major version it will throw exception. See option unknownFormats for more information');
+        }
+      }}
+      {{# def.skipFormat }}
+    {{?}}
+  {{?}}
+  {{
+    var $isObject = typeof $format == 'object'
+                    && !($format instanceof RegExp)
+                    && $format.validate;
+    if ($isObject) {
+      var $async = $format.async === true;
+      $format = $format.validate;
+    }
+  }}
+  {{? $async }}
+    {{
+      if (!it.async) throw new Error('async format in sync schema');
+      var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
+    }}
+    if (!({{=it.yieldAwait}} {{=$formatRef}}({{=$data}}))) {
+  {{??}}
+    if (!{{# def.checkFormat }}) {
+  {{?}}
+{{?}}
+    {{# def.error:'format' }}
+  } {{? $breakOnError }} else { {{?}}

+ 101 - 0
war/node_modules/ajv/lib/dot/items.jst

@@ -0,0 +1,101 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+
+{{## def.validateItems:startFrom:
+  for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) {
+    {{
+      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
+      var $passData = $data + '[' + $idx + ']';
+      $it.dataPathArr[$dataNxt] = $idx;
+    }}
+
+    {{# def.generateSubschemaCode }}
+    {{# def.optimizeValidate }}
+
+    {{? $breakOnError }}
+      if (!{{=$nextValid}}) break;
+    {{?}}
+  }
+#}}
+
+{{
+  var $idx = 'i' + $lvl
+    , $dataNxt = $it.dataLevel = it.dataLevel + 1
+    , $nextData = 'data' + $dataNxt
+    , $currentBaseId = it.baseId;
+}}
+
+var {{=$errs}} = errors;
+var {{=$valid}};
+
+{{? Array.isArray($schema) }}
+  {{ /* 'items' is an array of schemas */}}
+  {{ var $additionalItems = it.schema.additionalItems; }}
+  {{? $additionalItems === false }}
+    {{=$valid}} = {{=$data}}.length <= {{= $schema.length }};
+    {{
+      var $currErrSchemaPath = $errSchemaPath;
+      $errSchemaPath = it.errSchemaPath + '/additionalItems';      
+    }}
+    {{# def.checkError:'additionalItems' }}
+    {{ $errSchemaPath = $currErrSchemaPath; }}
+    {{# def.elseIfValid}}
+  {{?}}
+
+  {{~ $schema:$sch:$i }}
+    {{? {{# def.nonEmptySchema:$sch }} }}
+      {{=$nextValid}} = true;
+
+      if ({{=$data}}.length > {{=$i}}) {
+        {{
+          var $passData = $data + '[' + $i + ']';
+          $it.schema = $sch;
+          $it.schemaPath = $schemaPath + '[' + $i + ']';
+          $it.errSchemaPath = $errSchemaPath + '/' + $i;
+          $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
+          $it.dataPathArr[$dataNxt] = $i;
+        }}
+
+        {{# def.generateSubschemaCode }}
+        {{# def.optimizeValidate }}
+      }
+
+      {{# def.ifResultValid }}
+    {{?}}
+  {{~}}
+
+  {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }}
+    {{
+      $it.schema = $additionalItems;
+      $it.schemaPath = it.schemaPath + '.additionalItems';
+      $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
+    }}
+    {{=$nextValid}} = true;
+
+    if ({{=$data}}.length > {{= $schema.length }}) {
+      {{# def.validateItems: $schema.length }}
+    }
+
+    {{# def.ifResultValid }}
+  {{?}}
+
+{{?? {{# def.nonEmptySchema:$schema }} }}
+  {{ /* 'items' is a single schema */}}
+  {{
+    $it.schema = $schema;
+    $it.schemaPath = $schemaPath;
+    $it.errSchemaPath = $errSchemaPath;
+  }}
+  {{# def.validateItems: 0 }}
+  {{# def.ifResultValid }}
+{{?}}
+
+{{? $breakOnError }}
+  {{= $closingBraces }}
+  if ({{=$errs}} == errors) {
+{{?}}
+
+{{# def.cleanUp }}

+ 34 - 0
war/node_modules/ajv/lib/dot/missing.def

@@ -0,0 +1,34 @@
+{{## def.checkMissingProperty:_properties:
+  {{~ _properties:_$property:$i }}
+    {{?$i}} || {{?}}
+    {{ var $prop = it.util.getProperty(_$property); }}
+    ( {{=$data}}{{=$prop}} === undefined && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop) }}) )
+  {{~}}
+#}}
+
+
+{{## def.errorMissingProperty:_error:
+  {{
+    var $propertyPath = 'missing' + $lvl
+      , $missingProperty = '\' + ' + $propertyPath + ' + \'';
+    if (it.opts._errorDataPathProperty) {
+      it.errorPath = it.opts.jsonPointers
+                      ? it.util.getPathExpr($currentErrorPath,  $propertyPath, true)
+                      : $currentErrorPath + ' + ' + $propertyPath;
+    }
+  }}
+  {{# def.error:_error }}
+#}}
+
+{{## def.allErrorsMissingProperty:_error:
+  {{
+    var $prop = it.util.getProperty($reqProperty)
+      , $missingProperty = it.util.escapeQuotes($reqProperty);
+    if (it.opts._errorDataPathProperty) {
+      it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers);
+    }
+  }}
+  if ({{=$data}}{{=$prop}} === undefined) {
+    {{# def.addError:_error }}
+  }
+#}}

+ 20 - 0
war/node_modules/ajv/lib/dot/multipleOf.jst

@@ -0,0 +1,20 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+var division{{=$lvl}};
+if ({{?$isData}}
+      {{=$schemaValue}} !== undefined && (
+      typeof {{=$schemaValue}} != 'number' ||
+    {{?}}
+      (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}},
+      {{? it.opts.multipleOfPrecision }}
+        Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}}
+      {{??}}
+        division{{=$lvl}} !== parseInt(division{{=$lvl}})
+      {{?}}
+      )
+    {{?$isData}}  )  {{?}} ) {
+  {{# def.error:'multipleOf' }}
+} {{? $breakOnError }} else { {{?}}

+ 43 - 0
war/node_modules/ajv/lib/dot/not.jst

@@ -0,0 +1,43 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+{{? {{# def.nonEmptySchema:$schema }} }}
+  {{
+    $it.schema = $schema;
+    $it.schemaPath = $schemaPath;
+    $it.errSchemaPath = $errSchemaPath;
+  }}
+
+  var {{=$errs}} = errors;
+
+  {{# def.setCompositeRule }}
+
+  {{
+    $it.createErrors = false;
+    var $allErrorsOption;
+    if ($it.opts.allErrors) {
+      $allErrorsOption = $it.opts.allErrors;
+      $it.opts.allErrors = false;
+    }
+  }}
+  {{= it.validate($it) }}
+  {{
+    $it.createErrors = true;
+    if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
+  }}
+
+  {{# def.resetCompositeRule }}
+
+  if ({{=$nextValid}}) {
+    {{# def.error:'not' }}
+  } else {
+    {{# def.resetErrors }}
+  {{? it.opts.allErrors }} } {{?}}
+{{??}}
+  {{# def.addError:'not' }}
+  {{? $breakOnError}}
+    if (false) {
+  {{?}}
+{{?}}

+ 44 - 0
war/node_modules/ajv/lib/dot/oneOf.jst

@@ -0,0 +1,44 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+var {{=$errs}} = errors;
+var prevValid{{=$lvl}} = false;
+var {{=$valid}} = false;
+
+{{ var $currentBaseId = $it.baseId; }}
+{{# def.setCompositeRule }}
+
+{{~ $schema:$sch:$i }}
+  {{? {{# def.nonEmptySchema:$sch }} }}
+    {{
+      $it.schema = $sch;
+      $it.schemaPath = $schemaPath + '[' + $i + ']';
+      $it.errSchemaPath = $errSchemaPath + '/' + $i;
+    }}
+
+    {{# def.insertSubschemaCode }}
+  {{??}}
+    var {{=$nextValid}} = true;
+  {{?}}
+
+  {{? $i }}
+    if ({{=$nextValid}} && prevValid{{=$lvl}})
+      {{=$valid}} = false;
+    else {
+    {{ $closingBraces += '}'; }}
+  {{?}}
+
+    if ({{=$nextValid}}) {{=$valid}} = prevValid{{=$lvl}} = true;
+{{~}}
+
+{{# def.resetCompositeRule }}
+
+{{= $closingBraces }}
+
+if (!{{=$valid}}) {
+  {{# def.error:'oneOf' }}
+} else {
+  {{# def.resetErrors }}
+{{? it.opts.allErrors }} } {{?}}

+ 14 - 0
war/node_modules/ajv/lib/dot/pattern.jst

@@ -0,0 +1,14 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.$data }}
+
+{{
+  var $regexp = $isData
+                ? '(new RegExp(' + $schemaValue + '))'
+                : it.usePattern($schema);
+}}
+
+if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
+  {{# def.error:'pattern' }}
+} {{? $breakOnError }} else { {{?}}

+ 319 - 0
war/node_modules/ajv/lib/dot/properties.jst

@@ -0,0 +1,319 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+
+{{## def.validateAdditional:
+  {{ /* additionalProperties is schema */
+    $it.schema = $aProperties;
+    $it.schemaPath = it.schemaPath + '.additionalProperties';
+    $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
+    $it.errorPath = it.opts._errorDataPathProperty
+                    ? it.errorPath
+                    : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+    var $passData = $data + '[' + $key + ']';
+    $it.dataPathArr[$dataNxt] = $key;
+  }}
+
+  {{# def.generateSubschemaCode }}
+  {{# def.optimizeValidate }}
+#}}
+
+
+{{
+  var $key = 'key' + $lvl
+    , $dataNxt = $it.dataLevel = it.dataLevel + 1
+    , $nextData = 'data' + $dataNxt;
+
+  var $schemaKeys = Object.keys($schema || {})
+    , $pProperties = it.schema.patternProperties || {}
+    , $pPropertyKeys = Object.keys($pProperties)
+    , $aProperties = it.schema.additionalProperties
+    , $someProperties = $schemaKeys.length || $pPropertyKeys.length
+    , $noAdditional = $aProperties === false
+    , $additionalIsSchema = typeof $aProperties == 'object'
+                              && Object.keys($aProperties).length
+    , $removeAdditional = it.opts.removeAdditional
+    , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional
+    , $ownProperties = it.opts.ownProperties
+    , $currentBaseId = it.baseId;
+
+  var $required = it.schema.required;
+  if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired)
+    var $requiredHash = it.util.toHash($required);
+
+  if (it.opts.v5) {
+    var $pgProperties = it.schema.patternGroups || {}
+      , $pgPropertyKeys = Object.keys($pgProperties);
+  }
+}}
+
+
+var {{=$errs}} = errors;
+var {{=$nextValid}} = true;
+
+{{? $checkAdditional }}
+  for (var {{=$key}} in {{=$data}}) {
+    {{# def.checkOwnProperty }}
+    {{? $someProperties }}
+      var isAdditional{{=$lvl}} = !(false
+        {{? $schemaKeys.length }}
+          {{? $schemaKeys.length > 5 }}
+            || validate.schema{{=$schemaPath}}[{{=$key}}]
+          {{??}}
+            {{~ $schemaKeys:$propertyKey }}
+              || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }}
+            {{~}}
+          {{?}}
+        {{?}}
+        {{? $pPropertyKeys.length }}
+          {{~ $pPropertyKeys:$pProperty:$i }}
+            || {{= it.usePattern($pProperty) }}.test({{=$key}})
+          {{~}}
+        {{?}}
+        {{? it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length }}
+          {{~ $pgPropertyKeys:$pgProperty:$i }}
+            || {{= it.usePattern($pgProperty) }}.test({{=$key}})
+          {{~}}
+        {{?}}
+      );
+
+      if (isAdditional{{=$lvl}}) {
+    {{?}}
+    {{? $removeAdditional == 'all' }}
+      delete {{=$data}}[{{=$key}}];
+    {{??}}
+      {{
+        var $currentErrorPath = it.errorPath;
+        var $additionalProperty = '\' + ' + $key + ' + \'';
+        if (it.opts._errorDataPathProperty) {
+          it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+        }
+      }}
+      {{? $noAdditional }}
+        {{? $removeAdditional }}
+          delete {{=$data}}[{{=$key}}];
+        {{??}}
+          {{=$nextValid}} = false;
+          {{
+            var $currErrSchemaPath = $errSchemaPath;
+            $errSchemaPath = it.errSchemaPath + '/additionalProperties';
+          }}
+          {{# def.error:'additionalProperties' }}
+          {{ $errSchemaPath = $currErrSchemaPath; }}
+          {{? $breakOnError }} break; {{?}}
+        {{?}}
+      {{?? $additionalIsSchema }}
+        {{? $removeAdditional == 'failing' }}
+          var {{=$errs}} = errors;
+          {{# def.setCompositeRule }}
+
+          {{# def.validateAdditional }}
+
+          if (!{{=$nextValid}}) {
+            errors = {{=$errs}};
+            if (validate.errors !== null) {
+              if (errors) validate.errors.length = errors;
+              else validate.errors = null;
+            }
+            delete {{=$data}}[{{=$key}}];
+          }
+
+          {{# def.resetCompositeRule }}
+        {{??}}
+          {{# def.validateAdditional }}
+          {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
+        {{?}}
+      {{?}}
+      {{ it.errorPath = $currentErrorPath; }}
+    {{?}}
+    {{? $someProperties }}
+      }
+    {{?}}
+  }
+
+  {{# def.ifResultValid }}
+{{?}}
+
+{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }}
+
+{{? $schemaKeys.length }}
+  {{~ $schemaKeys:$propertyKey }}
+    {{ var $sch = $schema[$propertyKey]; }}
+
+    {{? {{# def.nonEmptySchema:$sch}} }}
+      {{
+        var $prop = it.util.getProperty($propertyKey)
+          , $passData = $data + $prop
+          , $hasDefault = $useDefaults && $sch.default !== undefined;
+        $it.schema = $sch;
+        $it.schemaPath = $schemaPath + $prop;
+        $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
+        $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
+        $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
+      }}
+
+      {{# def.generateSubschemaCode }}
+
+      {{? {{# def.willOptimize }} }}
+        {{
+          $code = {{# def._optimizeValidate }};
+          var $useData = $passData;
+        }}
+      {{??}}
+        {{ var $useData = $nextData; }}
+        var {{=$nextData}} = {{=$passData}};
+      {{?}}
+
+      {{? $hasDefault }}
+        {{= $code }}
+      {{??}}
+        {{? $requiredHash && $requiredHash[$propertyKey] }}
+          if ({{=$useData}} === undefined) {
+            {{=$nextValid}} = false;
+            {{
+              var $currentErrorPath = it.errorPath
+                , $currErrSchemaPath = $errSchemaPath
+                , $missingProperty = it.util.escapeQuotes($propertyKey);
+              if (it.opts._errorDataPathProperty) {
+                it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
+              }
+              $errSchemaPath = it.errSchemaPath + '/required';
+            }}
+            {{# def.error:'required' }}
+            {{ $errSchemaPath = $currErrSchemaPath; }}
+            {{ it.errorPath = $currentErrorPath; }}
+          } else {
+        {{??}}
+          {{? $breakOnError }}
+            if ({{=$useData}} === undefined) {
+              {{=$nextValid}} = true;
+            } else {
+          {{??}}
+            if ({{=$useData}} !== undefined) {
+          {{?}}
+        {{?}}
+
+          {{= $code }}
+        }
+      {{?}}  {{ /* $hasDefault */ }}
+    {{?}} {{ /* def.nonEmptySchema */ }}
+
+    {{# def.ifResultValid }}
+  {{~}}
+{{?}}
+
+{{~ $pPropertyKeys:$pProperty }}
+  {{ var $sch = $pProperties[$pProperty]; }}
+
+  {{? {{# def.nonEmptySchema:$sch}} }}
+    {{
+      $it.schema = $sch;
+      $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
+      $it.errSchemaPath = it.errSchemaPath + '/patternProperties/'
+                                           + it.util.escapeFragment($pProperty);
+    }}
+
+    for (var {{=$key}} in {{=$data}}) {
+      {{# def.checkOwnProperty }}
+      if ({{= it.usePattern($pProperty) }}.test({{=$key}})) {
+        {{
+          $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+          var $passData = $data + '[' + $key + ']';
+          $it.dataPathArr[$dataNxt] = $key;
+        }}
+
+        {{# def.generateSubschemaCode }}
+        {{# def.optimizeValidate }}
+
+        {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
+      }
+      {{? $breakOnError }} else {{=$nextValid}} = true; {{?}}
+    }
+
+    {{# def.ifResultValid }}
+  {{?}} {{ /* def.nonEmptySchema */ }}
+{{~}}
+
+
+{{? it.opts.v5 }}
+  {{~ $pgPropertyKeys:$pgProperty }}
+    {{
+      var $pgSchema = $pgProperties[$pgProperty]
+        , $sch = $pgSchema.schema;
+    }}
+
+    {{? {{# def.nonEmptySchema:$sch}} }}
+      {{
+        $it.schema = $sch;
+        $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema';
+        $it.errSchemaPath = it.errSchemaPath + '/patternGroups/'
+                                             + it.util.escapeFragment($pgProperty)
+                                             + '/schema';
+      }}
+
+      var pgPropCount{{=$lvl}} = 0;
+
+      for (var {{=$key}} in {{=$data}}) {
+        {{# def.checkOwnProperty }}
+        if ({{= it.usePattern($pgProperty) }}.test({{=$key}})) {
+          pgPropCount{{=$lvl}}++;
+
+          {{
+            $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
+            var $passData = $data + '[' + $key + ']';
+            $it.dataPathArr[$dataNxt] = $key;
+          }}
+
+          {{# def.generateSubschemaCode }}
+          {{# def.optimizeValidate }}
+
+          {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
+        }
+        {{? $breakOnError }} else {{=$nextValid}} = true; {{?}}
+      }
+
+      {{# def.ifResultValid }}
+
+      {{
+        var $pgMin = $pgSchema.minimum
+          , $pgMax = $pgSchema.maximum;
+      }}
+      {{? $pgMin !== undefined || $pgMax !== undefined }}
+        var {{=$valid}} = true;
+
+        {{ var $currErrSchemaPath = $errSchemaPath; }}
+
+        {{? $pgMin !== undefined }}
+          {{ var $limit = $pgMin, $reason = 'minimum', $moreOrLess = 'less'; }}
+          {{=$valid}} = pgPropCount{{=$lvl}} >= {{=$pgMin}};
+          {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; }}
+          {{# def.checkError:'patternGroups' }}
+          {{? $pgMax !== undefined }}
+            else
+          {{?}}
+        {{?}}
+
+        {{? $pgMax !== undefined }}
+          {{ var $limit = $pgMax, $reason = 'maximum', $moreOrLess = 'more'; }}
+          {{=$valid}} = pgPropCount{{=$lvl}} <= {{=$pgMax}};
+          {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; }}
+          {{# def.checkError:'patternGroups' }}
+        {{?}}
+
+        {{ $errSchemaPath = $currErrSchemaPath; }}
+
+        {{# def.ifValid }}
+      {{?}}
+    {{?}} {{ /* def.nonEmptySchema */ }}
+  {{~}}
+{{?}}
+
+
+{{? $breakOnError }}
+  {{= $closingBraces }}
+  if ({{=$errs}} == errors) {
+{{?}}
+
+{{# def.cleanUp }}

+ 86 - 0
war/node_modules/ajv/lib/dot/ref.jst

@@ -0,0 +1,86 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+
+{{## def._validateRef:_v:
+  {{? it.opts.passContext }}
+    {{=_v}}.call(this,
+  {{??}}
+    {{=_v}}(
+  {{?}}
+    {{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData)
+#}}
+
+{{ var $async, $refCode; }}
+{{? $schema == '#' || $schema == '#/' }}
+  {{
+    if (it.isRoot) {
+      $async = it.async;
+      $refCode = 'validate';
+    } else {
+      $async = it.root.schema.$async === true;
+      $refCode = 'root.refVal[0]';
+    }
+  }}
+{{??}}
+  {{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }}
+  {{? $refVal === undefined }}
+    {{ var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; }}
+    {{? it.opts.missingRefs == 'fail' }}
+      {{ console.log($message); }}
+      {{# def.error:'$ref' }}
+      {{? $breakOnError }} if (false) { {{?}}
+    {{?? it.opts.missingRefs == 'ignore' }}
+      {{ console.log($message); }}
+      {{? $breakOnError }} if (true) { {{?}}
+    {{??}}
+      {{
+        var $error = new Error($message);
+        $error.missingRef = it.resolve.url(it.baseId, $schema);
+        $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef));
+        throw $error;
+      }}
+    {{?}}
+  {{?? $refVal.inline }}
+    {{# def.setupNextLevel }}
+    {{
+      $it.schema = $refVal.schema;
+      $it.schemaPath = '';
+      $it.errSchemaPath = $schema;
+    }}
+    {{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }}
+    {{= $code }}
+    {{? $breakOnError}}
+      if ({{=$nextValid}}) {
+    {{?}}
+  {{??}}
+    {{
+      $async = $refVal.$async === true;
+      $refCode = $refVal.code;
+    }}
+  {{?}}
+{{?}}
+
+{{? $refCode }}
+  {{# def.beginDefOut}}
+    {{# def._validateRef:$refCode }}
+  {{# def.storeDefOut:__callValidate }}
+
+  {{? $async }}
+    {{ if (!it.async) throw new Error('async schema referenced by sync schema'); }}
+    try { {{? $breakOnError }}var {{=$valid}} ={{?}} {{=it.yieldAwait}} {{=__callValidate}}; }
+    catch (e) {
+      if (!(e instanceof ValidationError)) throw e;
+      if (vErrors === null) vErrors = e.errors;
+      else vErrors = vErrors.concat(e.errors);
+      errors = vErrors.length;
+    }
+    {{? $breakOnError }} if ({{=$valid}}) { {{?}}
+  {{??}}
+    if (!{{=__callValidate}}) {
+      if (vErrors === null) vErrors = {{=$refCode}}.errors;
+      else vErrors = vErrors.concat({{=$refCode}}.errors);
+      errors = vErrors.length;
+    } {{? $breakOnError }} else { {{?}}
+  {{?}}
+{{?}}

+ 0 - 0
war/node_modules/ajv/lib/dot/required.jst


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini