Commits

Juha Komulainen committed 6b3a53c

Initial revision.

Comments (0)

Files changed (21)

+syntax: glob
+
+*~
+.DS_Store
+out
+js
+.idea/ant.xml
+.idea/uiDesigner.xml
+.idea/workspace.xml
+angular-kotlin

.idea/compiler.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <option name="DEFAULT_COMPILER" value="Javac" />
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="?*.properties" />
+      <entry name="?*.xml" />
+      <entry name="?*.gif" />
+      <entry name="?*.png" />
+      <entry name="?*.jpeg" />
+      <entry name="?*.jpg" />
+      <entry name="?*.html" />
+      <entry name="?*.dtd" />
+      <entry name="?*.tld" />
+      <entry name="?*.ftl" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>
+

.idea/copyright/profiles_settings.xml

+<component name="CopyrightManager">
+  <settings default="">
+    <module2copyright />
+  </settings>
+</component>

.idea/dictionaries/komu.xml

+<component name="ProjectDictionaryState">
+  <dictionary name="komu">
+    <words>
+      <w>angularjs</w>
+      <w>ecma</w>
+      <w>todos</w>
+      <w>unstyled</w>
+    </words>
+  </dictionary>
+</component>

.idea/encodings.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="ISO-8859-1" />
+</project>
+

.idea/inspectionProfiles/Evident_Commit.xml

+<component name="InspectionProjectProfileManager">
+  <profile version="1.0" is_locked="false">
+    <option name="myName" value="Evident Commit" />
+    <option name="myLocal" value="true" />
+    <inspection_tool class="AssignmentToCatchBlockParameter" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="BadOddness" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="CanBeFinal" enabled="false" level="WARNING" enabled_by_default="false">
+      <option name="REPORT_CLASSES" value="false" />
+      <option name="REPORT_METHODS" value="false" />
+      <option name="REPORT_FIELDS" value="true" />
+    </inspection_tool>
+    <inspection_tool class="CdiDecoratorInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiDisposerMethodInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiInjectInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiInjectionPointsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="CdiInterceptorInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiManagedBeanInconsistencyInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiNormalScopeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="CdiObservesInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiSpecializesInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiStereotypeInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiStereotypeRestrictionsInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiTypedAnnotationInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="CdiUnproxyableBeanTypesInspection" enabled="false" level="ERROR" enabled_by_default="false" />
+    <inspection_tool class="ClassInTopLevelPackage" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ClassWithMultipleLoggers" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="loggerNamesString" value="java.util.logging.Logger,org.slf4j.Logger,org.apache.commons.logging.Log,org.apache.log4j.Logger" />
+    </inspection_tool>
+    <inspection_tool class="CloneableImplementsClone" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_ignoreCloneableDueToInheritance" value="true" />
+    </inspection_tool>
+    <inspection_tool class="CollectionContainsUrl" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="CollectionsFieldAccessReplaceableByMethodCall" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ConfusingMainMethod" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ConstantValueVariableUse" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="CssOptimizeSimilarPropertiesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
+    <inspection_tool class="CssUnusedSymbolInspection" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="DefaultNotLastCaseInSwitch" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="DivideByZero" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="DoubleLiteralMayBeFloatLiteral" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="DoubleNegation" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="EmptyMethod" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="EqualsAndHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="EqualsCalledOnEnumConstant" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ExceptionNameDoesntEndWithException" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="FieldCanBeLocal" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="FinalizeNotProtected" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="HtmlTagCanBeJavadocTag" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="myValues">
+        <value>
+          <list size="6">
+            <item index="0" class="java.lang.String" itemvalue="ng-app" />
+            <item index="1" class="java.lang.String" itemvalue="ng-disabled" />
+            <item index="2" class="java.lang.String" itemvalue="ng-controller" />
+            <item index="3" class="java.lang.String" itemvalue="ng-model" />
+            <item index="4" class="java.lang.String" itemvalue="ng-submit" />
+            <item index="5" class="java.lang.String" itemvalue="ng-repeat" />
+          </list>
+        </value>
+      </option>
+      <option name="myCustomValuesEnabled" value="true" />
+    </inspection_tool>
+    <inspection_tool class="IgnoreResultOfCall" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <option name="m_reportAllNonLibraryCalls" value="false" />
+      <option name="callCheckString" value="java.io.InputStream,read,java.io.InputStream,skip,java.lang.StringBuffer,toString,java.lang.StringBuilder,toString,java.lang.String,.*,java.math.BigInteger,.*,java.math.BigDecimal,.*,java.net.InetAddress,.*,java.io.File,.*,java.lang.Object,equals|hashCode" />
+    </inspection_tool>
+    <inspection_tool class="InnerClassMayBeStatic" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="TOP_LEVEL_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="INNER_CLASS_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="METHOD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="FIELD_OPTIONS">
+        <value>
+          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+          <option name="REQUIRED_TAGS" value="" />
+        </value>
+      </option>
+      <option name="IGNORE_DEPRECATED" value="false" />
+      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
+      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
+      <option name="myAdditionalJavadocTags" value="" />
+    </inspection_tool>
+    <inspection_tool class="KeySetIterationMayUseEntrySet" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="LengthOneStringInIndexOf" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ListIndexOfReplaceableByContains" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="LoggingConditionDisagreesWithLogStatement" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="MapReplaceableByEnumMap" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="MissingDeprecatedAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="MissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoreObjectMethods" value="false" />
+      <option name="ignoreAnonymousClassMethods" value="false" />
+    </inspection_tool>
+    <inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_requireAnnotationsFirst" value="true" />
+    </inspection_tool>
+    <inspection_tool class="NonFinalFieldInImmutable" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="NonFinalGuard" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="NullableProblems" enabled="false" level="WEAK WARNING" enabled_by_default="false">
+      <option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true" />
+      <option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="true" />
+      <option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="true" />
+      <option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true" />
+      <option name="REPORT_NOT_ANNOTATED_GETTER" value="true" />
+      <option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" />
+      <option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" />
+      <option name="REPORT_NULLS_PASSED_TO_NON_ANNOTATED_METHOD" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ObsoleteCollection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoreRequiredObsoleteCollectionTypes" value="false" />
+    </inspection_tool>
+    <inspection_tool class="PackageDotHtmlMayBePackageInfo" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="RandomDoubleForRandomInteger" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="RedundantImplements" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoreSerializable" value="false" />
+      <option name="ignoreCloneable" value="false" />
+    </inspection_tool>
+    <inspection_tool class="SameParameterValue" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="SameReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="SetReplaceableByEnumSet" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="SimplifiableAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="SizeReplaceableByIsEmpty" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="StaticInheritance" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="StringBufferToStringInConcatenation" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="StringConcatenationInLoops" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_ignoreUnlessAssigned" value="true" />
+    </inspection_tool>
+    <inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="TestOnlyProblems" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="TypeParameterExtendsFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UNUSED_SYMBOL" enabled="false" level="WARNING" enabled_by_default="false">
+      <option name="LOCAL_VARIABLE" value="true" />
+      <option name="FIELD" value="true" />
+      <option name="METHOD" value="true" />
+      <option name="CLASS" value="true" />
+      <option name="PARAMETER" value="true" />
+      <option name="REPORT_PARAMETER_FOR_PUBLIC_METHODS" value="true" />
+    </inspection_tool>
+    <inspection_tool class="UnaryPlus" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnknownGuard" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnnecessaryConstantArrayCreationExpression" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnnecessaryConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnnecessaryInheritDoc" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnnecessaryLocalVariable" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_ignoreImmediatelyReturnedVariables" value="true" />
+      <option name="m_ignoreAnnotatedVariables" value="true" />
+    </inspection_tool>
+    <inspection_tool class="UnnecessaryModuleDependencyInspection" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="UnnecessaryUnaryMinus" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UnpredictableBigDecimalConstructorCall" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoreReferences" value="true" />
+      <option name="ignoreComplexLiterals" value="false" />
+    </inspection_tool>
+    <inspection_tool class="UnusedDeclaration" enabled="false" level="WARNING" enabled_by_default="false">
+      <option name="ADD_MAINS_TO_ENTRIES" value="true" />
+      <option name="ADD_APPLET_TO_ENTRIES" value="true" />
+      <option name="ADD_SERVLET_TO_ENTRIES" value="true" />
+      <option name="ADD_NONJAVA_TO_ENTRIES" value="true" />
+    </inspection_tool>
+    <inspection_tool class="UnusedParameters" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="UnusedReturnValue" enabled="false" level="WARNING" enabled_by_default="false" />
+    <inspection_tool class="UseOfSunClasses" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="WeakerAccess" enabled="false" level="WARNING" enabled_by_default="false">
+      <option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
+      <option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" />
+      <option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
+    </inspection_tool>
+    <inspection_tool class="XmlUnboundNsPrefix" enabled="false" level="WARNING" enabled_by_default="false" />
+  </profile>
+</component>

.idea/inspectionProfiles/profiles_settings.xml

+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="PROJECT_PROFILE" value="Evident Commit" />
+    <option name="USE_PROJECT_PROFILE" value="true" />
+    <version value="1.0" />
+  </settings>
+</component>

.idea/jsLibraryMappings.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptLibraryMappings">
+    <file url="file://$PROJECT_DIR$/index.html" libraries="{angular}" />
+  </component>
+</project>
+
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+  <component name="masterDetails">
+    <states>
+      <state key="Copyright.UI">
+        <settings>
+          <last-edited>MIT</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="GlobalLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.20000002" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="JdkListConfigurable.UI">
+        <settings>
+          <last-edited>1.6</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.20000002" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ProjectJDKs.UI">
+        <settings>
+          <last-edited>1.6</last-edited>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.2" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+      <state key="ProjectLibrariesConfigurable.UI">
+        <settings>
+          <splitter-proportions>
+            <option name="proportions">
+              <list>
+                <option value="0.20000002" />
+              </list>
+            </option>
+          </splitter-proportions>
+        </settings>
+      </state>
+    </states>
+  </component>
+</project>
+

.idea/modules.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/angular-kotlin.iml" filepath="$PROJECT_DIR$/angular-kotlin.iml" />
+    </modules>
+  </component>
+</project>
+

.idea/scopes/scope_settings.xml

+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+  </component>
+</project>
+

angular-kotlin.iml

+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="K2JSModule">
+    <option name="javaScriptModule" value="true" />
+    <option name="pathToJavaScriptLibrary" value="/lib/kotlin-jslib.jar" />
+  </component>
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="kotlin-jslib.jar">
+        <CLASSES />
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/lib/kotlin-jslib.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="library" name="angular" level="application" />
+  </component>
+</module>
+
+<!DOCTYPE html>
+<html ng-app>
+<head>
+    <title></title>
+    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
+    <script src="lib/kotlinEcma3.js" type="text/javascript"></script>
+    <script type="text/javascript" src="js/angular-kotlin.js"></script>
+    <link rel="stylesheet" href="todo.css">
+    <!-- <script src="todo.js"></script> -->
+</head>
+<body>
+
+<script type="text/javascript">
+    window.TodoCtrl = Kotlin.modules["angular-kotlin"].todo.TodoCtrl
+</script>
+
+<h2>Todo</h2>
+<div ng-controller="TodoCtrl">
+    <span>{{remaining()}} of {{todos.length}} remaining</span>
+    [ <a href="" ng-click="archive()">archive</a> ]
+    <ul class="unstyled">
+        <li ng-repeat="todo in todos">
+            <label>
+                <input type="checkbox" ng-model="todo.done">
+                <span class="done-{{todo.done}}">{{todo.text}}</span>
+            </label>
+        </li>
+    </ul>
+    <form name="myForm" ng-submit="addTodo()">
+        <input type="text" ng-model="todoText" size="30" placeholder="add new todo here" required />
+        <input class="btn-primary" type="submit" value="add" ng-disabled="isClean() || myForm.$invalid" />
+    </form>
+</div>
+</body>
+</html>

lib/kotlin-jslib.jar

Binary file added.

lib/kotlinEcma3.js

+var Kotlin = {};
+(function() {
+  function e(c, d) {
+    for(var a in d) {
+      d.hasOwnProperty(a) && (c[a] = d[a])
+    }
+  }
+  var f = function() {
+  };
+  Kotlin.keys = Object.keys || function(c) {
+    var d = [], a = 0, b;
+    for(b in c) {
+      c.hasOwnProperty(b) && (d[a++] = b)
+    }
+    return d
+  };
+  Kotlin.argumentsToArrayLike = function(c) {
+    for(var d = c.length, a = Array(d);d--;) {
+      a[d] = c[d]
+    }
+    return a
+  };
+  Kotlin.isType = function(c, d) {
+    if(null === c || void 0 === c) {
+      return!1
+    }
+    for(var a = c.get_class();a !== d;) {
+      if(null === a) {
+        return!1
+      }
+      a = a.superclass
+    }
+    return!0
+  };
+  Kotlin.createTrait = function() {
+    return function() {
+      for(var c = arguments[0], d = 1, a = arguments.length;d < a;d++) {
+        e(c, arguments[d])
+      }
+      return c
+    }
+  }();
+  Kotlin.definePackage = function(c) {
+    return null === c ? {} : c
+  };
+  Kotlin.createClass = function() {
+    function c() {
+    }
+    function d(a) {
+      e(this.prototype, a);
+      return this
+    }
+    return function() {
+      function a() {
+        this.initializing = a;
+        this.initialize && this.initialize.apply(this, arguments)
+      }
+      var b = null, g = Kotlin.argumentsToArrayLike(arguments);
+      "function" == typeof g[0] && (b = g.shift());
+      a.addMethods = d;
+      a.superclass = b;
+      a.subclasses = [];
+      b && (c.prototype = b.prototype, a.prototype = new c, b.subclasses.push(a));
+      a.addMethods({get_class:function() {
+        return a
+      }});
+      null !== b && a.addMethods({super_init:function() {
+        this.initializing = this.initializing.superclass;
+        this.initializing.prototype.initialize.apply(this, arguments)
+      }});
+      for(var b = 0, h = g.length;b < h;b++) {
+        a.addMethods(g[b])
+      }
+      a.prototype.initialize || (a.prototype.initialize = f);
+      return a.prototype.constructor = a
+    }
+  }();
+  Kotlin.$createClass = Kotlin.createClass;
+  Kotlin.$new = function(c) {
+    var d = {__proto__:c.prototype};
+    return function() {
+      c.apply(d, arguments);
+      return d
+    }
+  };
+  Kotlin.createObject = function() {
+    return new (Kotlin.createClass.apply(null, arguments))
+  };
+  Kotlin.defineModule = function(c, d) {
+    if(c in Kotlin.modules) {
+      throw Kotlin.$new(Kotlin.IllegalArgumentException)();
+    }
+    Kotlin.modules[c] = d
+  }
+})();
+String.prototype.startsWith = function(e) {
+  return 0 === this.indexOf(e)
+};
+String.prototype.endsWith = function(e) {
+  return-1 !== this.indexOf(e, this.length - e.length)
+};
+String.prototype.contains = function(e) {
+  return-1 !== this.indexOf(e)
+};
+var kotlin = {set:function(e, f, c) {
+  return e.put(f, c)
+}};
+(function() {
+  function e(a) {
+    return function() {
+      throw new TypeError(void 0 !== a ? "Function " + a + " is abstract" : "Function is abstract");
+    }
+  }
+  Kotlin.equals = function(a, b) {
+    if(null === a || void 0 === a) {
+      return null === b
+    }
+    if(a instanceof Array) {
+      if(!(b instanceof Array) || a.length != b.length) {
+        return!1
+      }
+      for(var c = 0;c < a.length;c++) {
+        if(!Kotlin.equals(a[c], b[c])) {
+          return!1
+        }
+      }
+      return!0
+    }
+    return"object" == typeof a && void 0 !== a.equals ? a.equals(b) : a === b
+  };
+  Kotlin.array = function(a) {
+    return null === a || void 0 === a ? [] : a.slice()
+  };
+  Kotlin.intUpto = function(a, b) {
+    return Kotlin.$new(Kotlin.NumberRange)(a, b - a + 1, !1)
+  };
+  Kotlin.intDownto = function(a, b) {
+    return Kotlin.$new(Kotlin.NumberRange)(a, a - b + 1, !0)
+  };
+  Kotlin.modules = {};
+  Kotlin.Exception = Kotlin.$createClass();
+  Kotlin.RuntimeException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.IndexOutOfBounds = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.NullPointerException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.NoSuchElementException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.IllegalArgumentException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.IllegalStateException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.IndexOutOfBoundsException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.UnsupportedOperationException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.IOException = Kotlin.$createClass(Kotlin.Exception);
+  Kotlin.throwNPE = function() {
+    throw Kotlin.$new(Kotlin.NullPointerException)();
+  };
+  Kotlin.Iterator = Kotlin.$createClass({initialize:function() {
+  }, next:e("Iterator#next"), hasNext:e("Iterator#hasNext")});
+  var f = Kotlin.$createClass(Kotlin.Iterator, {initialize:function(a) {
+    this.array = a;
+    this.size = a.length;
+    this.index = 0
+  }, next:function() {
+    return this.array[this.index++]
+  }, get_hasNext:function() {
+    return this.index < this.size
+  }, hasNext:function() {
+    return this.index < this.size
+  }}), c = Kotlin.$createClass(f, {initialize:function(a) {
+    this.list = a;
+    this.size = a.size();
+    this.index = 0
+  }, next:function() {
+    return this.list.get(this.index++)
+  }, get_hasNext:function() {
+    return this.index < this.size
+  }});
+  Kotlin.Collection = Kotlin.$createClass();
+  Kotlin.AbstractList = Kotlin.$createClass(Kotlin.Collection, {iterator:function() {
+    return Kotlin.$new(c)(this)
+  }, isEmpty:function() {
+    return 0 === this.size()
+  }, addAll:function(a) {
+    for(var a = a.iterator(), b = this.$size;0 < b--;) {
+      this.add(a.next())
+    }
+  }, remove:function(a) {
+    a = this.indexOf(a);
+    -1 !== a && this.removeAt(a)
+  }, contains:function(a) {
+    return-1 !== this.indexOf(a)
+  }, equals:function(a) {
+    if(this.$size === a.$size) {
+      for(var b = this.iterator(), a = a.iterator(), c = this.$size;0 < c--;) {
+        if(!Kotlin.equals(b.next(), a.next())) {
+          return!1
+        }
+      }
+    }
+    return!0
+  }, toString:function() {
+    for(var a = "[", b = this.iterator(), c = !0, d = this.$size;0 < d--;) {
+      c ? c = !1 : a += ", ", a += b.next()
+    }
+    return a + "]"
+  }, toJSON:function() {
+    return this.toArray()
+  }});
+  Kotlin.ArrayList = Kotlin.$createClass(Kotlin.AbstractList, {initialize:function() {
+    this.array = [];
+    this.$size = 0
+  }, get:function(a) {
+    if(0 > a || a >= this.$size) {
+      throw Kotlin.IndexOutOfBounds;
+    }
+    return this.array[a]
+  }, set:function(a, b) {
+    if(0 > a || a >= this.$size) {
+      throw Kotlin.IndexOutOfBounds;
+    }
+    this.array[a] = b
+  }, toArray:function() {
+    return this.array.slice(0, this.$size)
+  }, size:function() {
+    return this.$size
+  }, iterator:function() {
+    return Kotlin.arrayIterator(this.array)
+  }, add:function(a) {
+    this.array[this.$size++] = a
+  }, addAt:function(a, b) {
+    this.array.splice(a, 0, b);
+    this.$size++
+  }, addAll:function(a) {
+    for(var b = a.iterator(), c = this.$size, d = a.size();0 < d--;) {
+      this.array[c++] = b.next()
+    }
+    this.$size += a.size()
+  }, removeAt:function(a) {
+    this.array.splice(a, 1);
+    this.$size--
+  }, clear:function() {
+    this.$size = this.array.length = 0
+  }, indexOf:function(a) {
+    for(var b = 0, c = this.$size;b < c;++b) {
+      if(Kotlin.equals(this.array[b], a)) {
+        return b
+      }
+    }
+    return-1
+  }, toString:function() {
+    return"[" + this.array.join(", ") + "]"
+  }, toJSON:function() {
+    return this.array
+  }});
+  Kotlin.Runnable = Kotlin.$createClass({initialize:function() {
+  }, run:e("Runnable#run")});
+  Kotlin.Comparable = Kotlin.$createClass({initialize:function() {
+  }, compareTo:e("Comparable#compareTo")});
+  Kotlin.Appendable = Kotlin.$createClass({initialize:function() {
+  }, append:e("Appendable#append")});
+  Kotlin.Closeable = Kotlin.$createClass({initialize:function() {
+  }, close:e("Closeable#close")});
+  Kotlin.parseInt = function(a) {
+    return parseInt(a, 10)
+  };
+  Kotlin.safeParseInt = function(a) {
+    a = parseInt(a, 10);
+    return isNaN(a) ? null : a
+  };
+  Kotlin.safeParseDouble = function(a) {
+    a = parseFloat(a);
+    return isNaN(a) ? null : a
+  };
+  Kotlin.System = function() {
+    var a = "", b = function(b) {
+      void 0 !== b && (a = null === b || "object" !== typeof b ? a + b : a + b.toString())
+    }, c = function(b) {
+      this.print(b);
+      a += "\n"
+    };
+    return{out:function() {
+      return{print:b, println:c}
+    }, output:function() {
+      return a
+    }, flush:function() {
+      a = ""
+    }}
+  }();
+  Kotlin.println = function(a) {
+    Kotlin.System.out().println(a)
+  };
+  Kotlin.print = function(a) {
+    Kotlin.System.out().print(a)
+  };
+  Kotlin.RangeIterator = Kotlin.$createClass(Kotlin.Iterator, {initialize:function(a, b, c) {
+    this.$start = a;
+    this.$count = b;
+    this.$reversed = c;
+    this.$i = this.get_start()
+  }, get_start:function() {
+    return this.$start
+  }, get_count:function() {
+    return this.$count
+  }, set_count:function(a) {
+    this.$count = a
+  }, get_reversed:function() {
+    return this.$reversed
+  }, get_i:function() {
+    return this.$i
+  }, set_i:function(a) {
+    this.$i = a
+  }, next:function() {
+    this.set_count(this.get_count() - 1);
+    if(this.get_reversed()) {
+      return this.set_i(this.get_i() - 1), this.get_i() + 1
+    }
+    this.set_i(this.get_i() + 1);
+    return this.get_i() - 1
+  }, get_hasNext:function() {
+    return 0 < this.get_count()
+  }});
+  Kotlin.NumberRange = Kotlin.$createClass({initialize:function(a, b, c) {
+    this.$start = a;
+    this.$size = b;
+    this.$reversed = c
+  }, get_start:function() {
+    return this.$start
+  }, get_size:function() {
+    return this.$size
+  }, get_reversed:function() {
+    return this.$reversed
+  }, get_end:function() {
+    return this.get_reversed() ? this.get_start() - this.get_size() + 1 : this.get_start() + this.get_size() - 1
+  }, contains:function(a) {
+    return this.get_reversed() ? a <= this.get_start() && a > this.get_start() - this.get_size() : a >= this.get_start() && a < this.get_start() + this.get_size()
+  }, iterator:function() {
+    return Kotlin.$new(Kotlin.RangeIterator)(this.get_start(), this.get_size(), this.get_reversed())
+  }});
+  Kotlin.Comparator = Kotlin.$createClass({initialize:function() {
+  }, compare:e("Comparator#compare")});
+  var d = Kotlin.$createClass(Kotlin.Comparator, {initialize:function(a) {
+    this.compare = a
+  }});
+  Kotlin.comparator = function(a) {
+    return Kotlin.$new(d)(a)
+  };
+  Kotlin.collectionsMax = function(a, b) {
+    var c = a.iterator();
+    if(a.isEmpty()) {
+      throw Kotlin.Exception();
+    }
+    for(var d = c.next();c.get_hasNext();) {
+      var e = c.next();
+      0 > b.compare(d, e) && (d = e)
+    }
+    return d
+  };
+  Kotlin.StringBuilder = Kotlin.$createClass({initialize:function() {
+    this.string = ""
+  }, append:function(a) {
+    this.string += a.toString()
+  }, toString:function() {
+    return this.string
+  }});
+  Kotlin.splitString = function(a, b) {
+    return a.split(b)
+  };
+  Kotlin.nullArray = function(a) {
+    for(var b = [];0 < a;) {
+      b[--a] = null
+    }
+    return b
+  };
+  Kotlin.arrayFromFun = function(a, b) {
+    for(var c = Array(a), d = 0;d < a;d++) {
+      c[d] = b(d)
+    }
+    return c
+  };
+  Kotlin.arrayIndices = function(a) {
+    return Kotlin.$new(Kotlin.NumberRange)(0, a.length)
+  };
+  Kotlin.arrayIterator = function(a) {
+    return Kotlin.$new(f)(a)
+  };
+  Kotlin.toString = function(a) {
+    return a.toString()
+  };
+  Kotlin.jsonFromTuples = function(a) {
+    for(var b = a.length, c = {};0 < b;) {
+      --b, c[a[b][0]] = a[b][1]
+    }
+    return c
+  };
+  Kotlin.jsonSet = function(a, b, c) {
+    a[b] = c
+  };
+  Kotlin.jsonGet = function(a, b) {
+    return a[b]
+  };
+  Kotlin.jsonAddProperties = function(a, b) {
+    for(var c in b) {
+      b.hasOwnProperty(c) && (a[c] = b[c])
+    }
+    return a
+  };
+  Kotlin.sure = function(a) {
+    return a
+  };
+  Kotlin.concat = function(a, b) {
+    for(var c = Array(a.length + b.length), d = 0, e = a.length;d < e;d++) {
+      c[d] = a[d]
+    }
+    for(var e = b.length, f = 0;f < e;) {
+      c[d++] = b[f++]
+    }
+    return c
+  }
+})();
+Kotlin.assignOwner = function(e, f) {
+  e.o = f;
+  return e
+};
+Kotlin.b0 = function(e, f, c) {
+  return function() {
+    return e.call(null !== f ? f : this, c)
+  }
+};
+Kotlin.b1 = function(e, f, c) {
+  return function() {
+    return e.apply(null !== f ? f : this, c)
+  }
+};
+Kotlin.b2 = function(e, f, c) {
+  return function() {
+    return e.apply(null !== f ? f : this, Kotlin.concat(c, arguments))
+  }
+};
+Kotlin.b3 = function(e, f) {
+  return function() {
+    return e.call(f)
+  }
+};
+Kotlin.b4 = function(e, f) {
+  return function() {
+    return e.apply(f, Kotlin.argumentsToArrayLike(arguments))
+  }
+};
+(function() {
+  function e(a) {
+    return"string" == typeof a ? a : typeof a.hashCode == i ? (a = a.hashCode(), "string" == typeof a ? a : e(a)) : typeof a.toString == i ? a.toString() : "" + a
+  }
+  function f(a, b) {
+    return a.equals(b)
+  }
+  function c(a, b) {
+    return typeof b.equals == i ? b.equals(a) : a === b
+  }
+  function d(a) {
+    return function(b) {
+      if(null === b) {
+        throw Error("null is not a valid " + a);
+      }
+      if("undefined" == typeof b) {
+        throw Error(a + " must not be undefined");
+      }
+    }
+  }
+  function a(a, b, c, d) {
+    this[0] = a;
+    this.entries = [];
+    this.addEntry(b, c);
+    null !== d && (this.getEqualityFunction = function() {
+      return d
+    })
+  }
+  function b(a) {
+    return function(b) {
+      for(var c = this.entries.length, d, e = this.getEqualityFunction(b);c--;) {
+        if(d = this.entries[c], e(b, d[0])) {
+          switch(a) {
+            case j:
+              return!0;
+            case o:
+              return d;
+            case p:
+              return[c, d[1]]
+          }
+        }
+      }
+      return!1
+    }
+  }
+  function g(a) {
+    return function(b) {
+      for(var c = b.length, d = 0, e = this.entries.length;d < e;++d) {
+        b[c + d] = this.entries[d][a]
+      }
+    }
+  }
+  function h(b, c) {
+    var d = b[c];
+    return d && d instanceof a ? d : null
+  }
+  var i = "function", n = typeof Array.prototype.splice == i ? function(a, b) {
+    a.splice(b, 1)
+  } : function(a, b) {
+    var c, d, e;
+    if(b === a.length - 1) {
+      a.length = b
+    }else {
+      c = a.slice(b + 1);
+      a.length = b;
+      d = 0;
+      for(e = c.length;d < e;++d) {
+        a[b + d] = c[d]
+      }
+    }
+  }, k = d("key"), q = d("value"), j = 0, o = 1, p = 2;
+  a.prototype = {getEqualityFunction:function(a) {
+    return typeof a.equals == i ? f : c
+  }, getEntryForKey:b(o), getEntryAndIndexForKey:b(p), removeEntryForKey:function(a) {
+    return(a = this.getEntryAndIndexForKey(a)) ? (n(this.entries, a[0]), a[1]) : null
+  }, addEntry:function(a, b) {
+    this.entries[this.entries.length] = [a, b]
+  }, keys:g(0), values:g(1), getEntries:function(a) {
+    for(var b = a.length, c = 0, d = this.entries.length;c < d;++c) {
+      a[b + c] = this.entries[c].slice(0)
+    }
+  }, containsKey:b(j), containsValue:function(a) {
+    for(var b = this.entries.length;b--;) {
+      if(a === this.entries[b][1]) {
+        return!0
+      }
+    }
+    return!1
+  }};
+  var r = function(b, c) {
+    var d = this, f = [], g = {}, l = typeof b == i ? b : e, j = typeof c == i ? c : null;
+    this.put = function(b, c) {
+      k(b);
+      q(c);
+      var d = l(b), e, i = null;
+      (e = h(g, d)) ? (d = e.getEntryForKey(b)) ? (i = d[1], d[1] = c) : e.addEntry(b, c) : (e = new a(d, b, c, j), f[f.length] = e, g[d] = e);
+      return i
+    };
+    this.get = function(a) {
+      k(a);
+      var b = l(a);
+      if(b = h(g, b)) {
+        if(a = b.getEntryForKey(a)) {
+          return a[1]
+        }
+      }
+      return null
+    };
+    this.containsKey = function(a) {
+      k(a);
+      var b = l(a);
+      return(b = h(g, b)) ? b.containsKey(a) : !1
+    };
+    this.containsValue = function(a) {
+      q(a);
+      for(var b = f.length;b--;) {
+        if(f[b].containsValue(a)) {
+          return!0
+        }
+      }
+      return!1
+    };
+    this.clear = function() {
+      f.length = 0;
+      g = {}
+    };
+    this.isEmpty = function() {
+      return!f.length
+    };
+    var m = function(a) {
+      return function() {
+        for(var b = [], c = f.length;c--;) {
+          f[c][a](b)
+        }
+        return b
+      }
+    };
+    this._keys = m("keys");
+    this._values = m("values");
+    this._entries = m("getEntries");
+    this.values = function() {
+      for(var a = this._values(), b = a.length, c = Kotlin.$new(Kotlin.ArrayList)();--b;) {
+        c.add(a[b])
+      }
+      return c
+    };
+    this.remove = function(a) {
+      k(a);
+      var b = l(a), c = null, d = h(g, b);
+      if(d && (c = d.removeEntryForKey(a), null !== c && !d.entries.length)) {
+        a: {
+          for(a = f.length;a--;) {
+            if(d = f[a], b === d[0]) {
+              break a
+            }
+          }
+          a = null
+        }
+        n(f, a);
+        delete g[b]
+      }
+      return c
+    };
+    this.size = function() {
+      for(var a = 0, b = f.length;b--;) {
+        a += f[b].entries.length
+      }
+      return a
+    };
+    this.each = function(a) {
+      for(var b = d.entries(), c = b.length, e;c--;) {
+        e = b[c], a(e[0], e[1])
+      }
+    };
+    this.putAll = function(a, b) {
+      for(var c = a.entries(), e, f, g, h = c.length, j = typeof b == i;h--;) {
+        e = c[h];
+        f = e[0];
+        e = e[1];
+        if(j && (g = d.get(f))) {
+          e = b(f, g, e)
+        }
+        d.put(f, e)
+      }
+    };
+    this.clone = function() {
+      var a = new r(b, c);
+      a.putAll(d);
+      return a
+    };
+    this.keySet = function() {
+      for(var a = Kotlin.$new(Kotlin.HashSet)(), b = this._keys(), c = b.length;c--;) {
+        a.add(b[c])
+      }
+      return a
+    }
+  };
+  Kotlin.HashTable = r
+})();
+Kotlin.Map = Kotlin.$createClass();
+Kotlin.HashMap = Kotlin.$createClass(Kotlin.Map, {initialize:function() {
+  Kotlin.HashTable.call(this)
+}});
+Kotlin.ComplexHashMap = Kotlin.HashMap;
+(function() {
+  var e = Kotlin.$createClass(Kotlin.Iterator, {initialize:function(c, d) {
+    this.map = c;
+    this.keys = d;
+    this.size = d.length;
+    this.index = 0
+  }, next:function() {
+    return this.map[this.keys[this.index++]]
+  }, get_hasNext:function() {
+    return this.index < this.size
+  }}), f = Kotlin.$createClass(Kotlin.Collection, {initialize:function(c) {
+    this.map = c
+  }, iterator:function() {
+    return Kotlin.$new(e)(this.map.map, Kotlin.keys(this.map.map))
+  }, isEmpty:function() {
+    return 0 === this.map.$size
+  }, contains:function(c) {
+    return this.map.containsValue(c)
+  }});
+  Kotlin.PrimitiveHashMap = Kotlin.$createClass(Kotlin.Map, {initialize:function() {
+    this.$size = 0;
+    this.map = {}
+  }, size:function() {
+    return this.$size
+  }, isEmpty:function() {
+    return 0 === this.$size
+  }, containsKey:function(c) {
+    return void 0 !== this.map[c]
+  }, containsValue:function(c) {
+    var d = this.map, a;
+    for(a in d) {
+      if(d.hasOwnProperty(a) && d[a] === c) {
+        return!0
+      }
+    }
+    return!1
+  }, get:function(c) {
+    return this.map[c]
+  }, put:function(c, d) {
+    var a = this.map[c];
+    this.map[c] = void 0 === d ? null : d;
+    void 0 === a && this.$size++;
+    return a
+  }, remove:function(c) {
+    var d = this.map[c];
+    void 0 !== d && (delete this.map[c], this.$size--);
+    return d
+  }, clear:function() {
+    this.$size = 0;
+    this.map = {}
+  }, putAll:function() {
+    throw Kotlin.$new(Kotlin.UnsupportedOperationException)();
+  }, keySet:function() {
+    var c = Kotlin.$new(Kotlin.HashSet)(), d = this.map, a;
+    for(a in d) {
+      d.hasOwnProperty(a) && c.add(a)
+    }
+    return c
+  }, values:function() {
+    return Kotlin.$new(f)(this)
+  }, toJSON:function() {
+    return this.map
+  }})
+})();
+(function() {
+  function e(f, c) {
+    var d = new Kotlin.HashTable(f, c);
+    this.add = function(a) {
+      d.put(a, !0)
+    };
+    this.addAll = function(a) {
+      for(var b = a.length;b--;) {
+        d.put(a[b], !0)
+      }
+    };
+    this.values = function() {
+      return d._keys()
+    };
+    this.iterator = function() {
+      return Kotlin.arrayIterator(this.values())
+    };
+    this.remove = function(a) {
+      return d.remove(a) ? a : null
+    };
+    this.contains = function(a) {
+      return d.containsKey(a)
+    };
+    this.clear = function() {
+      d.clear()
+    };
+    this.size = function() {
+      return d.size()
+    };
+    this.isEmpty = function() {
+      return d.isEmpty()
+    };
+    this.clone = function() {
+      var a = new e(f, c);
+      a.addAll(d.keys());
+      return a
+    };
+    this.equals = function(a) {
+      if(null === a || void 0 === a) {
+        return!1
+      }
+      if(this.size() === a.size()) {
+        for(var b = this.iterator(), a = a.iterator();;) {
+          var c = b.get_hasNext(), d = a.get_hasNext();
+          if(c != d) {
+            break
+          }
+          if(d) {
+            if(c = b.next(), d = a.next(), !Kotlin.equals(c, d)) {
+              break
+            }
+          }else {
+            return!0
+          }
+        }
+      }
+      return!1
+    };
+    this.toString = function() {
+      for(var a = "[", b = this.iterator(), c = !0;b.get_hasNext();) {
+        c ? c = !1 : a += ", ", a += b.next()
+      }
+      return a + "]"
+    };
+    this.intersection = function(a) {
+      for(var b = new e(f, c), a = a.values(), g = a.length, h;g--;) {
+        h = a[g], d.containsKey(h) && b.add(h)
+      }
+      return b
+    };
+    this.union = function(a) {
+      for(var b = this.clone(), a = a.values(), c = a.length, e;c--;) {
+        e = a[c], d.containsKey(e) || b.add(e)
+      }
+      return b
+    };
+    this.isSubsetOf = function(a) {
+      for(var b = d.keys(), c = b.length;c--;) {
+        if(!a.contains(b[c])) {
+          return!1
+        }
+      }
+      return!0
+    }
+  }
+  Kotlin.HashSet = Kotlin.$createClass({initialize:function() {
+    e.call(this)
+  }})
+})();
+

src/extensions.kt

+package extensions
+
+native fun <T> Array<T>.push(x: T) = noImpl
+
+fun <T> Array<T>.count(predicate: (T) -> Boolean): Int {
+    var matches = 0
+    for (item in this)
+        if (predicate(item))
+            matches++
+    return matches
+}
+
+fun <T> Array<T>.filter(predicate: (T) -> Boolean): Array<T> {
+    val result = array<T>()
+    for (item in this)
+        if (predicate(item))
+            result.push(item)
+    return result
+}
+package todo
+
+import extensions.*
+
+fun TodoCtrl(native("\$scope") scope: TodoScope) {
+    scope.todoText = ""
+    scope.todos = array(Todo("Learn AngularJS", true),
+                        Todo("Integrate AngularJS with Kotlin"))
+
+    scope.addTodo = {
+        scope.todos.push(Todo(scope.todoText))
+        scope.todoText = ""
+    }
+
+    scope.remaining = { scope.todos.count { it.done } }
+    scope.archive = { scope.todos = scope.todos.filter { !it.done } }
+}
+
+class Todo(text: String, done: Boolean = false) {
+    native var text = text
+    native var done = done
+}
+
+native trait TodoScope {
+    var todos: Array<Todo>
+    var todoText: String
+    var addTodo: () -> Unit
+    var remaining: () -> Int
+    var archive: () -> Unit
+}
+.done-true {
+    text-decoration: line-through;
+    color: grey;
+}
+function TodoCtrl($scope) {
+    $scope.todos = [
+        {text:'learn angular', done:true},
+        {text:'build an angular app', done:false}];
+
+    $scope.addTodo = function() {
+        $scope.todos.push({text:$scope.todoText, done:false});
+        $scope.todoText = '';
+    };
+
+    $scope.remaining = function() {
+        var count = 0;
+        angular.forEach($scope.todos, function(todo) {
+            count += todo.done ? 0 : 1;
+        });
+        return count;
+    };
+
+    $scope.archive = function() {
+        var oldTodos = $scope.todos;
+        $scope.todos = [];
+        angular.forEach(oldTodos, function(todo) {
+            if (!todo.done) $scope.todos.push(todo);
+        });
+    };
+}