[
  {
    "path": ".gitignore",
    "content": "*/bin\n*/obj\n*.suo\n*.userprefs\npackages\n.vs\n"
  },
  {
    "path": "CodeHub/CodeHub.csproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProjectGuid>{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}</ProjectGuid>\r\n    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r\n    <UseMSBuildEngine>true</UseMSBuildEngine>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>CodeHub</RootNamespace>\r\n    <AssemblyName>CodeHub</AssemblyName>\r\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r\n    <TargetFrameworkProfile>Profile111</TargetFrameworkProfile>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG;</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"WebViews\\UpgradeDetailsWebView.cs\">\r\n      <DependentUpon>UpgradeDetailsWebView.cshtml</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"WebViews\\UpgradeDetailsModel.cs\" />\r\n    <Compile Include=\"WebViews\\SyntaxHighlighterModel.cs\" />\r\n    <Compile Include=\"WebViews\\SyntaxHighlighterWebView.cs\">\r\n      <DependentUpon>SyntaxHighlighterWebView.cshtml</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"WebViews\\CommentsWebView.cs\">\r\n      <DependentUpon>CommentsWebView.cshtml</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"WebViews\\CommentsModel.cs\" />\r\n    <Compile Include=\"WebViews\\MarkdownModel.cs\" />\r\n    <Compile Include=\"WebViews\\MarkdownWebView.cs\">\r\n      <DependentUpon>MarkdownWebView.cshtml</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"Octicons.cs\" />\r\n    <Compile Include=\"WebViews\\DiffModel.cs\" />\r\n    <Compile Include=\"WebViews\\DiffWebView.cs\">\r\n      <DependentUpon>DiffWebView.cshtml</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"WebViews\\DiffCommentModel.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Folder Include=\"WebViews\\\" />\r\n    <Folder Include=\"Resources\\\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"WebViews\\UpgradeDetailsWebView.cshtml\">\r\n      <Generator>RazorTemplatePreprocessor</Generator>\r\n      <LastGenOutput>UpgradeDetailsWebView.cs</LastGenOutput>\r\n    </None>\r\n    <None Include=\"WebViews\\SyntaxHighlighterWebView.cshtml\">\r\n      <Generator>RazorTemplatePreprocessor</Generator>\r\n      <LastGenOutput>SyntaxHighlighterWebView.cs</LastGenOutput>\r\n    </None>\r\n    <None Include=\"WebViews\\CommentsWebView.cshtml\">\r\n      <Generator>RazorTemplatePreprocessor</Generator>\r\n      <LastGenOutput>CommentsWebView.cs</LastGenOutput>\r\n    </None>\r\n    <None Include=\"WebViews\\MarkdownWebView.cshtml\">\r\n      <Generator>RazorTemplatePreprocessor</Generator>\r\n      <LastGenOutput>MarkdownWebView.cs</LastGenOutput>\r\n    </None>\r\n    <None Include=\"packages.config\" />\r\n    <None Include=\"WebViews\\DiffWebView.cshtml\">\r\n      <Generator>RazorTemplatePreprocessor</Generator>\r\n      <LastGenOutput>DiffWebView.cs</LastGenOutput>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"Humanizer\">\r\n      <HintPath>..\\packages\\Humanizer.Core.2.2.0\\lib\\netstandard1.0\\Humanizer.dll</HintPath>\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <BundleResource Include=\"Resources\\octicons.ttf\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\Portable\\$(TargetFrameworkVersion)\\Microsoft.Portable.CSharp.targets\" />\r\n</Project>"
  },
  {
    "path": "CodeHub/Octicons.cs",
    "content": "﻿namespace CodeHub\n{\n    public class Octicon\n    {\n        public char CharacterCode { get; private set; }\n\n        public Octicon(char characterCode)\n        {\n            CharacterCode = characterCode;\n        }\n\n        public static implicit operator Octicon(char d)\n        {\n            return new Octicon(d);\n        }\n\n        public static Octicon Heart = (char)9829;\n        public static Octicon Zap = (char)9889;\n        public static Octicon LightBulb = (char)61440;\n        public static Octicon Repo = (char)61441;\n        public static Octicon RepoForked = (char)61442;\n        public static Octicon RepoPush = (char)61445;\n        public static Octicon RepoPull = (char)61446;\n        public static Octicon Book = (char)61447;\n        public static Octicon Octoface = (char)61448;\n        public static Octicon GitPullRequest = (char)61449;\n        public static Octicon MarkGithub = (char)61450;\n        public static Octicon CloudDownload = (char)61451;\n        public static Octicon CloudUpload = (char)61452;\n        public static Octicon Keyboard = (char)61453;\n        public static Octicon Gist = (char)61454;\n        public static Octicon FileCode = (char)61456;\n        public static Octicon FileText = (char)61457;\n        public static Octicon FileMedia = (char)61458;\n        public static Octicon FileZip = (char)61459;\n        public static Octicon FilePdf = (char)61460;\n        public static Octicon Tag = (char)61461;\n        public static Octicon FileDirectory = (char)61462;\n        public static Octicon FileSubmodule = (char)61463;\n        public static Octicon Person = (char)61464;\n        public static Octicon Jersey = (char)61465;\n        public static Octicon GitCommit = (char)61471;\n        public static Octicon GitBranch = (char)61472;\n        public static Octicon GitMerge = (char)61475;\n        public static Octicon Mirror = (char)61476;\n        public static Octicon IssueOpened = (char)61478;\n        public static Octicon IssueReopened = (char)61479;\n        public static Octicon IssueClosed = (char)61480;\n        public static Octicon Star = (char)61482;\n        public static Octicon Comment = (char)61483;\n        public static Octicon Question = (char)61484;\n        public static Octicon Alert = (char)61485;\n        public static Octicon Search = (char)61486;\n        public static Octicon Gear = (char)61487;\n        public static Octicon RadioTower = (char)61488;\n        public static Octicon Tools = (char)61489;\n        public static Octicon SignOut = (char)61490;\n        public static Octicon Rocket = (char)61491;\n        public static Octicon Rss = (char)61492;\n        public static Octicon Clippy = (char)61493;\n        public static Octicon SignIn = (char)61494;\n        public static Octicon Organization = (char)61495;\n        public static Octicon DeviceMobile = (char)61496;\n        public static Octicon Unfold = (char)61497;\n        public static Octicon Check = (char)61498;\n        public static Octicon Mail = (char)61499;\n        public static Octicon MailRead = (char)61500;\n        public static Octicon ArrowUp = (char)61501;\n        public static Octicon ArrowRight = (char)61502;\n        public static Octicon ArrowDown = (char)61503;\n        public static Octicon ArrowLeft = (char)61504;\n        public static Octicon Pin = (char)61505;\n        public static Octicon Gift = (char)61506;\n        public static Octicon Graph = (char)61507;\n        public static Octicon TriangleLeft = (char)61508;\n        public static Octicon CreditCard = (char)61509;\n        public static Octicon Clock = (char)61510;\n        public static Octicon Ruby = (char)61511;\n        public static Octicon Broadcast = (char)61512;\n        public static Octicon Key = (char)61513;\n        public static Octicon RepoForcePush = (char)61514;\n        public static Octicon RepoClone = (char)61516;\n        public static Octicon Diff = (char)61517;\n        public static Octicon Eye = (char)61518;\n        public static Octicon CommentDiscussion = (char)61519;\n        public static Octicon MailReply = (char)61521;\n        public static Octicon PrimitiveDot = (char)61522;\n        public static Octicon PrimitiveSquare = (char)61523;\n        public static Octicon DeviceCamera = (char)61526;\n        public static Octicon DeviceCameraVideo = (char)61527;\n        public static Octicon Pencil = (char)61528;\n        public static Octicon Info = (char)61529;\n        public static Octicon TriangleRight = (char)61530;\n        public static Octicon TriangleDown = (char)61531;\n        public static Octicon Link = (char)61532;\n        public static Octicon Plus = (char)61533;\n        public static Octicon ThreeBars = (char)61534;\n        public static Octicon Code = (char)61535;\n        public static Octicon Location = (char)61536;\n        public static Octicon ListUnordered = (char)61537;\n        public static Octicon ListOrdered = (char)61538;\n        public static Octicon Quote = (char)61539;\n        public static Octicon Versions = (char)61540;\n        public static Octicon ColorMode = (char)61541;\n        public static Octicon ScreenFull = (char)61542;\n        public static Octicon ScreenNormal = (char)61543;\n        public static Octicon Calendar = (char)61544;\n        public static Octicon Beer = (char)61545;\n        public static Octicon Lock = (char)61546;\n        public static Octicon DiffAdded = (char)61547;\n        public static Octicon DiffRemoved = (char)61548;\n        public static Octicon DiffModified = (char)61549;\n        public static Octicon DiffRenamed = (char)61550;\n        public static Octicon HorizontalRule = (char)61552;\n        public static Octicon ArrowSmallRight = (char)61553;\n        public static Octicon JumpDown = (char)61554;\n        public static Octicon JumpUp = (char)61555;\n        public static Octicon MoveLeft = (char)61556;\n        public static Octicon Milestone = (char)61557;\n        public static Octicon Checklist = (char)61558;\n        public static Octicon Megaphone = (char)61559;\n        public static Octicon ChevronRight = (char)61560;\n        public static Octicon Bookmark = (char)61563;\n        public static Octicon Settings = (char)61564;\n        public static Octicon Dashboard = (char)61565;\n        public static Octicon History = (char)61566;\n        public static Octicon LinkExternal = (char)61567;\n        public static Octicon Mute = (char)61568;\n        public static Octicon X = (char)61569;\n        public static Octicon CircleSlash = (char)61572;\n        public static Octicon Pulse = (char)61573;\n        public static Octicon Sync = (char)61575;\n        public static Octicon Telescope = (char)61576;\n        public static Octicon Microscope = (char)61577;\n        public static Octicon AlignmentAlign = (char)61578;\n        public static Octicon AlignmentUnalign = (char)61579;\n        public static Octicon GistSecret = (char)61580;\n        public static Octicon Home = (char)61581;\n        public static Octicon AlignmentAlignedTo = (char)61582;\n        public static Octicon Stop = (char)61583;\n        public static Octicon Bug = (char)61585;\n        public static Octicon LogoGithub = (char)61586;\n        public static Octicon FileBinary = (char)61588;\n        public static Octicon Database = (char)61590;\n        public static Octicon Server = (char)61591;\n        public static Octicon DiffIgnored = (char)61593;\n        public static Octicon Ellipsis = (char)61594;\n        public static Octicon NoNewline = (char)61596;\n        public static Octicon Hubot = (char)61597;\n        public static Octicon Hourglass = (char)61598;\n        public static Octicon ArrowSmallUp = (char)61599;\n        public static Octicon ArrowSmallDown = (char)61600;\n        public static Octicon ArrowSmallLeft = (char)61601;\n        public static Octicon ChevronUp = (char)61602;\n        public static Octicon ChevronDown = (char)61603;\n        public static Octicon ChevronLeft = (char)61604;\n        public static Octicon JumpLeft = (char)61605;\n        public static Octicon JumpRight = (char)61606;\n        public static Octicon MoveUp = (char)61607;\n        public static Octicon MoveDown = (char)61608;\n        public static Octicon MoveRight = (char)61609;\n        public static Octicon TriangleUp = (char)61610;\n        public static Octicon GitCompare = (char)61612;\n        public static Octicon Podium = (char)61615;\n        public static Octicon FileSymlinkFile = (char)61616;\n        public static Octicon FileSymlinkDirectory = (char)61617;\n        public static Octicon Squirrel = (char)61618;\n        public static Octicon Globe = (char)61622;\n        public static Octicon Unmute = (char)61626;\n        public static Octicon PlaybackPause = (char)61627;\n        public static Octicon PlaybackRewind = (char)61628;\n        public static Octicon PlaybackFastForward = (char)61629;\n        public static Octicon Mention = (char)61630;\n        public static Octicon PlaybackPlay = (char)61631;\n        public static Octicon Puzzle = (char)61632;\n        public static Octicon Package = (char)61636;\n        public static Octicon Browser = (char)61637;\n        public static Octicon Split = (char)61638;\n        public static Octicon Steps = (char)61639;\n        public static Octicon Terminal = (char)61640;\n        public static Octicon Markdown = (char)61641;\n        public static Octicon Dash = (char)61642;\n        public static Octicon Fold = (char)61644;\n        public static Octicon Inbox = (char)61647;\n        public static Octicon Trashcan = (char)61648;\n        public static Octicon Paintcan = (char)61649;\n        public static Octicon Flame = (char)61650;\n        public static Octicon Briefcase = (char)61651;\n        public static Octicon Plug = (char)61652;\n        public static Octicon CircuitBoard = (char)61654;\n        public static Octicon MortarBoard = (char)61655;\n        public static Octicon Law = (char)61656;\n        public static Octicon DeviceDesktop = (char)62076;\n    }\n}\n\n"
  },
  {
    "path": "CodeHub/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\n\n// Information about this assembly is defined by the following attributes. \n// Change them to the values specific to your project.\n\n[assembly: AssemblyTitle(\"CodeHub\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"\")]\n[assembly: AssemblyCopyright(\"(c) Dillon Buchanan\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// The assembly version has the format \"{Major}.{Minor}.{Build}.{Revision}\".\n// The form \"{Major}.{Minor}.*\" will automatically update the build and revision,\n// and \"{Major}.{Minor}.{Build}.*\" will update just the revision.\n\n[assembly: AssemblyVersion(\"1.0.*\")]\n\n// The following attributes are used to specify the signing key for the assembly, \n// if desired. See the Mono documentation for more information about signing.\n\n//[assembly: AssemblyDelaySign(false)]\n//[assembly: AssemblyKeyFile(\"\")]\n"
  },
  {
    "path": "CodeHub/WebViews/CommentsModel.cs",
    "content": "﻿using System.Collections.Generic;\nusing System;\nusing System.Linq;\nusing Humanizer;\n\nnamespace CodeHub.WebViews\n{\n    public class Comment\n    {\n        public string AvatarUrl { get; }\n\n        public string Name { get; }\n\n        public DateTimeOffset Date { get; }\n\n        public string DateString => Date.Humanize();\n\n        public string Body { get; }\n\n        public Comment(string avatar, string name, string body, DateTimeOffset date)\n        {\n            AvatarUrl = avatar;\n            Name = name;\n            Body = body;\n            Date = date;\n        }\n    }\n\n    public class CommentsModel\n    {\n        public IList<Comment> Comments { get; }\n\n        public int FontSize { get; }\n\n        public CommentsModel(IEnumerable<Comment> comments, int fontSize)\n        {\n            Comments = (comments ?? Enumerable.Empty<Comment>()).ToList();\n            FontSize = fontSize;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub/WebViews/CommentsWebView.cs",
    "content": "#pragma warning disable 1591\n// ------------------------------------------------------------------------------\n//  <autogenerated>\n//      This code was generated by a tool.\n//      Mono Runtime Version: 4.0.30319.42000\n// \n//      Changes to this file may cause incorrect behavior and will be lost if \n//      the code is regenerated.\n//  </autogenerated>\n// ------------------------------------------------------------------------------\n\nnamespace CodeHub.WebViews\n{\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n[System.CodeDom.Compiler.GeneratedCodeAttribute(\"RazorTemplatePreprocessor\", \"2.6.0.0\")]\npublic partial class CommentsWebView : CommentsWebViewBase\n{\n\n#line hidden\n\n#line 1 \"CommentsWebView.cshtml\"\npublic CommentsModel Model { get; set; }\n\n#line default\n#line hidden\n\n\npublic override void Execute()\n{\nWriteLiteral(\"<html><head>\\n<meta\");\n\nWriteLiteral(\" name=\\\"viewport\\\"\");\n\nWriteLiteral(\" content=\\\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable\" +\n\"=0\\\"\");\n\nWriteLiteral(\"/>\\n<style>\\n* {\\n-webkit-touch-callout: none;\\n-webkit-user-select: none;\\n\\n}\\n\\nhtml {\" +\n\"\\n    -webkit-text-size-adjust: none;\\n}\\n\\nbody{\\n    font-family: \\\"Helvetica Neue\\\",\" +\n\" Helvetica;\\n    font-size: \");\n\n\n#line 17 \"CommentsWebView.cshtml\"\n           Write(Model.FontSize);\n\n\n#line default\n#line hidden\nWriteLiteral(@\"px;\n    margin: 0px;\n    word-wrap: break-word;\n}\n\na {\n    color: #406fb9;\n    text-decoration: none;\n}\n\n#main > .comment:first-child {\nborder-top: none;\n}\n\n#main > .comment {\n    border-top: 1px solid #c8c8c8;\n    padding: 8px 0 0 0;\n}\n\n#main > .comment > img {\n    position: absolute;\n    border-radius: 16px;\n    margin-left: 8px;\n    margin-top: 1px;\n    margin-bottom: 8px;\n    width: 32px;\n    height: 32px;\n}\n\n#main > .comment > div {\nmargin-left: 48px;\nmargin-right: 8px;\n}\n\n#main > .comment > div > h1 {\nfont-size: \");\n\n\n#line 52 \"CommentsWebView.cshtml\"\n       Write(Model.FontSize);\n\n\n#line default\n#line hidden\nWriteLiteral(\"px;\\nmargin: 0;\\ncolor: #406fb9;\\nwhite-space: nowrap;\\noverflow: hidden;\\n}\\n\\n#main > \" +\n\".comment > div > h2 {\\nfont-size: \");\n\n\n#line 60 \"CommentsWebView.cshtml\"\n       Write(Model.FontSize - 2);\n\n\n#line default\n#line hidden\nWriteLiteral(\"px;\\nmargin: 0 0 4px 0;\\nfont-weight: normal;\\ncolor: #404040;\\nwhite-space: nowrap;\\n\" +\n\"overflow: hidden;\\n}\\n\\n#main > .comment > div > div {\\nmargin: 0;\\nword-wrap: break-\" +\n\"word;\\n}\\n\\n#main > .comment > div > .mark {\\n    margin-top: 8px;\\n    margin-bottom\" +\n\": 8px;\\n    margin-right: 8px;\\n}\\n\\n#main > .comment > div > div img {\\nmax-width: 1\" +\n\"00%;\\n}\\n\\n#main { width: 100%; }\\n\\nimg { max-width: 100%; } \\np { margin: 10px 0; wh\" +\n\"ite-space: pre-wrap; } \\npre, li, ul { word-wrap: break-word; } \\n\\n.mark h1, .mark\" +\n\" h2, .mark h3, .mark h4, .mark h5, .mark h6 {\\nmargin: 1em 0 15px;\\npadding: 0;\\nfo\" +\n\"nt-weight: bold;\\nline-height: 1.7;\\ncursor: text;\\nposition: relative;\\n}\\n\\nul, ol {\" +\n\"\\npadding: 0;\\nmargin-top: 0;\\nmargin-bottom: 0;\\npadding-left: 20px;\\n}\\n\\npre {\\nbackg\" +\n\"round-color: #f8f8f8;\\nborder: 1px solid #ddd;\\nline-height: 19px;\\noverflow: auto;\" +\n\"\\npadding: 6px 10px;\\nborder-radius: 3px;\\nword-wrap: normal;\\n}\\ndl dt {\\nfont-weight\" +\n\": bold;\\nfont-style: italic;\\npadding: 0;\\nmargin-top: 15px;\\n}\\nblockquote {\\nborder-\" +\n\"left: 4px solid #DDD;\\npadding: 0 15px;\\ncolor: #777;\\n}\\ntable {\\nwidth: 100%;\\noverf\" +\n\"low: auto;\\ndisplay: block;\\n}\\ntable tr {\\nborder-top: 1px solid #ccc;\\nbackground-c\" +\n\"olor: #fff;\\n}\\ntable th {\\nfont-weight: bold;\\n}\\ntable th, table td {\\nborder: 1px s\" +\n\"olid #d9d9e0;\\nborder: 0.5px solid #d9d9d9;\\npadding: 4px 11px;\\n}\\ntable tr:nth-chi\" +\n\"ld(2n) {\\nbackground-color: #f8f8f8;\\n}\\n.mark h2 {\\nfont-size: 1.2em;\\nborder-bottom\" +\n\": 1px solid #eee;\\n}\\n.mark h1 {\\nfont-size: 1.6em;\\nborder-bottom: 1px solid #ddd;\\n\" +\n\"}\\n\\n.mark .label {\\ndisplay: inline;\\npadding: .2em .6em .2em;\\nfont-size: 85%;\\nfont\" +\n\"-weight: 700;\\nline-height: 1;\\ncolor: #fff;\\ntext-align: center;\\nwhite-space: nowr\" +\n\"ap;\\nvertical-align: baseline;\\nborder-radius: .25em;\\n}\\n.label-danger {\\nbackground\" +\n\"-color: #d9534f;\\n}\\n.label-success {\\nbackground-color: #5cb85c;\\n}\\n.label-info {\\nb\" +\n\"ackground-color: #6e5494;\\n}\\n.label-default {\\nbackground-color: #999;\\n}\\nul.task-l\" +\n\"ist > li.task-list-item {\\n  list-style-type: none;\\n}\\n.task-list-item-checkbox {\\n\" +\n\"  margin-left: -20px;\\n  vertical-align: middle;\\n}\\n</style>\\n<script>\\nfunction siz\" +\n\"e() { return document.body.scrollHeight; }\\nfunction rs() { document.location.hre\" +\n\"f = \\'app://resize\\'; }; window.onsize = rs;\\nvar h = 0; setInterval(function() { i\" +\n\"f (size() != h) { h = size(); rs(); } }, 300);\\n</script>\\n</head>\\n<body>\\n    <div\" +\n\"\");\n\nWriteLiteral(\" id=\\\"main\\\"\");\n\nWriteLiteral(\">\\n\");\n\n\n#line 194 \"CommentsWebView.cshtml\"\n        \n\n#line default\n#line hidden\n\n#line 194 \"CommentsWebView.cshtml\"\n         foreach (var comment in Model.Comments)\n        {\n\n\n#line default\n#line hidden\nWriteLiteral(\"            <div\");\n\nWriteLiteral(\" class=\\\"comment\\\"\");\n\nWriteLiteral(\">\\n                <img\");\n\nWriteAttribute (\"src\", \" src=\\\"\", \"\\\"\"\n\n#line 197 \"CommentsWebView.cshtml\"\n, Tuple.Create<string,object,bool> (\"\", comment.AvatarUrl\n\n#line default\n#line hidden\n, false)\n);\nWriteLiteral(\">\\n                <div>\\n                    <h1>\");\n\n\n#line 199 \"CommentsWebView.cshtml\"\n                   Write(comment.Name);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</h1>\\n                    <h2>\");\n\n\n#line 200 \"CommentsWebView.cshtml\"\n                   Write(comment.DateString);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</h2>\\n                    <div\");\n\nWriteLiteral(\" class=\\\"mark\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 201 \"CommentsWebView.cshtml\"\n                                        WriteLiteral(comment.Body);\n\n#line default\n#line hidden\nWriteLiteral(\"</div>\\n                </div>\\n            </div>\\n\");\n\n\n#line 204 \"CommentsWebView.cshtml\"\n        }\n\n\n#line default\n#line hidden\nWriteLiteral(\"    </div>\\n</body>\\n</html\");\n\n}\n}\n\n// NOTE: this is the default generated helper class. You may choose to extract it to a separate file \n// in order to customize it or share it between multiple templates, and specify the template's base \n// class via the @inherits directive.\npublic abstract class CommentsWebViewBase\n{\n\n\t\t// This field is OPTIONAL, but used by the default implementation of Generate, Write, WriteAttribute and WriteLiteral\n\t\t//\n\t\tSystem.IO.TextWriter __razor_writer;\n\n\t\t// This method is OPTIONAL\n\t\t//\n\t\t/// <summary>Executes the template and returns the output as a string.</summary>\n\t\t/// <returns>The template output.</returns>\n\t\tpublic string GenerateString ()\n\t\t{\n\t\t\tusing (var sw = new System.IO.StringWriter ()) {\n\t\t\t\tGenerate (sw);\n\t\t\t\treturn sw.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer\n\t\t// and provide another means of invoking Execute.\n\t\t//\n\t\t/// <summary>Executes the template, writing to the provided text writer.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the template output.</param>\n\t\tpublic void Generate (System.IO.TextWriter writer)\n\t\t{\n\t\t\t__razor_writer = writer;\n\t\t\tExecute ();\n\t\t\t__razor_writer = null;\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the template output without HTML escaping it.</summary>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected void WriteLiteral (string value)\n\t\t{\n\t\t\t__razor_writer.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the literal.</param>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected static void WriteLiteralTo (System.IO.TextWriter writer, string value)\n\t\t{\n\t\t\twriter.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a value to the template output, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected void Write (object value)\n\t\t{\n\t\t\tWriteTo (__razor_writer, value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes an object value to the TextWriter, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the value.</param>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected static void WriteTo (System.IO.TextWriter writer, object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn;\n\n\t\t\tvar write = value as Action<System.IO.TextWriter>;\n\t\t\tif (write != null) {\n\t\t\t\twrite (writer);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//NOTE: a more sophisticated implementation would write safe and pre-escaped values directly to the\n\t\t\t//instead of double-escaping. See System.Web.IHtmlString in ASP.NET 4.0 for an example of this.\n\t\t\twriter.Write(System.Net.WebUtility.HtmlEncode (value.ToString ()));\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to the template output.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\tprotected void WriteAttribute (string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\tWriteAttributeTo (__razor_writer, name, prefix, suffix, values);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to a TextWriter.\n\t\t/// </summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the attribute.</param>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\t///<remarks>Used by Razor helpers to write attributes.</remarks>\n\t\tprotected static void WriteAttributeTo (System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\t// this is based on System.Web.WebPages.WebPageExecutingBase\n\t\t\t// Copyright (c) Microsoft Open Technologies, Inc.\n\t\t\t// Licensed under the Apache License, Version 2.0\n\t\t\tif (values.Length == 0) {\n\t\t\t\t// Explicitly empty attribute, so write the prefix and suffix\n\t\t\t\twriter.Write (prefix);\n\t\t\t\twriter.Write (suffix);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool first = true;\n\t\t\tbool wroteSomething = false;\n\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tTuple<string,object,bool> attrVal = values [i];\n\t\t\t\tstring attPrefix = attrVal.Item1;\n\t\t\t\tobject value = attrVal.Item2;\n\t\t\t\tbool isLiteral = attrVal.Item3;\n\n\t\t\t\tif (value == null) {\n\t\t\t\t\t// Nothing to write\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The special cases here are that the value we're writing might already be a string, or that the \n\t\t\t\t// value might be a bool. If the value is the bool 'true' we want to write the attribute name instead\n\t\t\t\t// of the string 'true'. If the value is the bool 'false' we don't want to write anything.\n\t\t\t\t//\n\t\t\t\t// Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself.\n\t\t\t\tstring stringValue;\n\t\t\t\tbool? boolValue = value as bool?;\n\t\t\t\tif (boolValue == true) {\n\t\t\t\t\tstringValue = name;\n\t\t\t\t} else if (boolValue == false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tstringValue = value as string;\n\t\t\t\t}\n\n\t\t\t\tif (first) {\n\t\t\t\t\twriter.Write (prefix);\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.Write (attPrefix);\n\t\t\t\t}\n\n\t\t\t\tif (isLiteral) {\n\t\t\t\t\twriter.Write (stringValue ?? value);\n\t\t\t\t} else {\n\t\t\t\t\tWriteTo (writer, stringValue ?? value);\n\t\t\t\t}\n\t\t\t\twroteSomething = true;\n\t\t\t}\n\t\t\tif (wroteSomething) {\n\t\t\t\twriter.Write (suffix);\n\t\t\t}\n\t\t}\n\t\t// This method is REQUIRED. The generated Razor subclass will override it with the generated code.\n\t\t//\n\t\t///<summary>Executes the template, writing output to the Write and WriteLiteral methods.</summary>.\n\t\t///<remarks>Not intended to be called directly. Call the Generate method instead.</remarks>\n\t\tpublic abstract void Execute ();\n\n}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "CodeHub/WebViews/CommentsWebView.cshtml",
    "content": "﻿@model CommentsModel\n<html><head>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\"/>\n<style>\n* {\n-webkit-touch-callout: none;\n-webkit-user-select: none;\n\n}\n\nhtml {\n    -webkit-text-size-adjust: none;\n}\n\nbody{\n    font-family: \"Helvetica Neue\", Helvetica;\n    font-size: @(Model.FontSize)px;\n    margin: 0px;\n    word-wrap: break-word;\n}\n\na {\n    color: #406fb9;\n    text-decoration: none;\n}\n\n#main > .comment:first-child {\nborder-top: none;\n}\n\n#main > .comment {\n    border-top: 1px solid #c8c8c8;\n    padding: 8px 0 0 0;\n}\n\n#main > .comment > img {\n    position: absolute;\n    border-radius: 16px;\n    margin-left: 8px;\n    margin-top: 1px;\n    margin-bottom: 8px;\n    width: 32px;\n    height: 32px;\n}\n\n#main > .comment > div {\nmargin-left: 48px;\nmargin-right: 8px;\n}\n\n#main > .comment > div > h1 {\nfont-size: @(Model.FontSize)px;\nmargin: 0;\ncolor: #406fb9;\nwhite-space: nowrap;\noverflow: hidden;\n}\n\n#main > .comment > div > h2 {\nfont-size: @(Model.FontSize - 2)px;\nmargin: 0 0 4px 0;\nfont-weight: normal;\ncolor: #404040;\nwhite-space: nowrap;\noverflow: hidden;\n}\n\n#main > .comment > div > div {\nmargin: 0;\nword-wrap: break-word;\n}\n\n#main > .comment > div > .mark {\n    margin-top: 8px;\n    margin-bottom: 8px;\n    margin-right: 8px;\n}\n\n#main > .comment > div > div img {\nmax-width: 100%;\n}\n\n#main { width: 100%; }\n\nimg { max-width: 100%; } \np { margin: 10px 0; white-space: pre-wrap; } \npre, li, ul { word-wrap: break-word; } \n\n.mark h1, .mark h2, .mark h3, .mark h4, .mark h5, .mark h6 {\nmargin: 1em 0 15px;\npadding: 0;\nfont-weight: bold;\nline-height: 1.7;\ncursor: text;\nposition: relative;\n}\n\nul, ol {\npadding: 0;\nmargin-top: 0;\nmargin-bottom: 0;\npadding-left: 20px;\n}\n\npre {\nbackground-color: #f8f8f8;\nborder: 1px solid #ddd;\nline-height: 19px;\noverflow: auto;\npadding: 6px 10px;\nborder-radius: 3px;\nword-wrap: normal;\n}\ndl dt {\nfont-weight: bold;\nfont-style: italic;\npadding: 0;\nmargin-top: 15px;\n}\nblockquote {\nborder-left: 4px solid #DDD;\npadding: 0 15px;\ncolor: #777;\n}\ntable {\nwidth: 100%;\noverflow: auto;\ndisplay: block;\n}\ntable tr {\nborder-top: 1px solid #ccc;\nbackground-color: #fff;\n}\ntable th {\nfont-weight: bold;\n}\ntable th, table td {\nborder: 1px solid #d9d9e0;\nborder: 0.5px solid #d9d9d9;\npadding: 4px 11px;\n}\ntable tr:nth-child(2n) {\nbackground-color: #f8f8f8;\n}\n.mark h2 {\nfont-size: 1.2em;\nborder-bottom: 1px solid #eee;\n}\n.mark h1 {\nfont-size: 1.6em;\nborder-bottom: 1px solid #ddd;\n}\n\n.mark .label {\ndisplay: inline;\npadding: .2em .6em .2em;\nfont-size: 85%;\nfont-weight: 700;\nline-height: 1;\ncolor: #fff;\ntext-align: center;\nwhite-space: nowrap;\nvertical-align: baseline;\nborder-radius: .25em;\n}\n.label-danger {\nbackground-color: #d9534f;\n}\n.label-success {\nbackground-color: #5cb85c;\n}\n.label-info {\nbackground-color: #6e5494;\n}\n.label-default {\nbackground-color: #999;\n}\nul.task-list > li.task-list-item {\n  list-style-type: none;\n}\n.task-list-item-checkbox {\n  margin-left: -20px;\n  vertical-align: middle;\n}\n</style>\n<script>\nfunction size() { return document.body.scrollHeight; }\nfunction rs() { document.location.href = 'app://resize'; }; window.onsize = rs;\nvar h = 0; setInterval(function() { if (size() != h) { h = size(); rs(); } }, 300);\n</script>\n</head>\n<body>\n    <div id=\"main\">\n        @foreach (var comment in Model.Comments)\n        {\n            <div class=\"comment\">\n                <img src=\"@comment.AvatarUrl\">\n                <div>\n                    <h1>@comment.Name</h1>\n                    <h2>@comment.DateString</h2>\n                    <div class=\"mark\">@{WriteLiteral(comment.Body);}</div>\n                </div>\n            </div>\n        }\n    </div>\n</body>\n</html"
  },
  {
    "path": "CodeHub/WebViews/DiffCommentModel.cs",
    "content": "﻿namespace CodeHub.WebViews\n{\n    public class DiffCommentModel\n    {\n        public int Id;\n        public int? GroupId;\n        public string Username;\n        public string AvatarUrl;\n        public int? LineTo;\n        public int? LineFrom;\n        public string Body;\n        public string Date;\n    }\n}\n"
  },
  {
    "path": "CodeHub/WebViews/DiffModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nnamespace CodeHub.WebViews\n{\n    public class DiffModel\n    {\n        static Regex ContextRegex = new Regex(\"^@@ -(\\\\d+).+\\\\+(\\\\d+)\");\n\n        public List<Context> Chunks { get; }\n\n        public List<DiffCommentModel> FileComments { get; }\n\n        public int FontSize { get; }\n\n        public DiffModel(\n            IEnumerable<string> patchLines,\n            IEnumerable<DiffCommentModel> comments,\n            int fontSize)\n        {\n            FontSize = fontSize;\n\n            var diffComments = comments.GroupBy(x => x.LineFrom).ToDictionary(x => x.Key ?? -1, x => x.ToList());\n            FileComments = diffComments.ContainsKey(-1) ? diffComments[-1] : new List<DiffCommentModel>();\n            Chunks = ParsePatchLines(patchLines, diffComments).ToList();\n        }\n\n        static IEnumerable<Context> ParsePatchLines(IEnumerable<string> patchLines, Dictionary<int, List<DiffCommentModel>> comments)\n        {\n            int baseLine = 0;\n            int newLine = 0;\n            string contextLine = null;\n            LinkedList<Line> lines = null;\n\n            foreach (var patchLine in patchLines.Select((line, idx) => new { line, idx }))\n            {\n                var line = patchLine.line;\n                var idx = patchLine.idx;\n\n                if (line.StartsWith(\"@@\", StringComparison.Ordinal))\n                {\n                    if (lines != null)\n                        yield return new Context(contextLine, lines);\n\n                    lines = new LinkedList<Line>();\n                    var match = ContextRegex.Match(line);\n                    int.TryParse(match.Groups[1].Value, out baseLine);\n                    int.TryParse(match.Groups[2].Value, out newLine);\n                    contextLine = line;\n                    continue;\n                }\n\n                if (lines == null)\n                    continue;\n\n\n                comments.TryGetValue(idx, out List<DiffCommentModel> lineComments);\n            \n                if (line.StartsWith(\"+\", StringComparison.Ordinal))\n                {\n                    lines.AddLast(new Line(baseLine, newLine, LineEquality.Insert, line.Substring(1), idx, lineComments));\n                    newLine++;\n                }\n                else if (line.StartsWith(\"-\", StringComparison.Ordinal))\n                {\n                    lines.AddLast(new Line(baseLine, newLine, LineEquality.Delete, line.Substring(1), idx, lineComments));\n                    baseLine++;\n                }\n                else if (line.StartsWith(\"\\\\\", StringComparison.Ordinal))\n                {\n                    continue;\n                }\n                else\n                {\n                    lines.AddLast(new Line(baseLine, newLine, LineEquality.Equal, line.Substring(1), idx, lineComments));\n                    baseLine++;\n                    newLine++;\n                }\n            }\n\n            if (lines != null)\n                yield return new Context(contextLine, lines);\n        }\n\n        public class Context\n        {\n            public string Content { get; }\n            public List<Line> Lines { get; }\n\n            public Context(string content, IEnumerable<Line> lines)\n            {\n                Content = content;\n                Lines = lines.ToList();\n            }\n        }\n\n        public class Line\n        {\n            public int? BaseLine { get; }\n            public int? NewLine { get; }\n            public LineEquality LineEquality { get; }\n            public string Content { get; }\n            public List<KeyValuePair<int, List<DiffCommentModel>>> CommentSets { get; }\n            public int Index { get; }\n\n            public Line(int? baseLine, int? newLine, LineEquality lineEquality, string content, int index, IEnumerable<DiffCommentModel> comments)\n            {\n                BaseLine = baseLine;\n                NewLine = newLine;\n                LineEquality = lineEquality;\n                Content = content;\n                Index = index;\n\n                CommentSets = (comments ?? Enumerable.Empty<DiffCommentModel>())\n                    .GroupBy(x => x.GroupId ?? index)\n                    .ToDictionary(x => x.Key, x => x.ToList())\n                    .ToList();\n            }\n        }\n\n        public enum LineEquality\n        {\n            Equal,\n            Insert,\n            Delete\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub/WebViews/DiffWebView.cs",
    "content": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace CodeHub.WebViews\n{\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n[System.CodeDom.Compiler.GeneratedCodeAttribute(\"RazorTemplatePreprocessor\", \"2.6.0.0\")]\npublic partial class DiffWebView : DiffWebViewBase\n{\n\n#line hidden\n\n#line 1 \"DiffWebView.cshtml\"\npublic DiffModel Model { get; set; }\n\n#line default\n#line hidden\n\n\npublic override void Execute()\n{\nWriteLiteral(\"<!DOCTYPE html>\\n<html>\\n  <head>\\n    <title></title>\\n    <meta\");\n\nWriteLiteral(\" charset=\\\"utf-8\\\"\");\n\nWriteLiteral(\">\\n    <meta\");\n\nWriteLiteral(\" name=\\\"viewport\\\"\");\n\nWriteLiteral(\" content=\\\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable\" +\n\"=0\\\"\");\n\nWriteLiteral(@\"/>\n    <style>\n      head, body {\n        margin: 0;\n        -webkit-text-size-adjust: none;\n        -moz-text-size-adjust: none;\n      }\n\n      table {\n        width: 100%;\n        border-collapse: collapse;\n        font-family: Menlo,Consolas,monospace;\n        font-size: \");\n\n\n#line 19 \"DiffWebView.cshtml\"\n               Write(Model.FontSize);\n\n\n#line default\n#line hidden\nWriteLiteral(\"px;\\n      }\\n\\n      td {\\n        height: 20px;\\n        line-height: 20px;\\n      }\\n\" +\n\"\\n      .content {\\n        white-space: nowrap;\\n        padding: 0 10px;\\n        \" +\n\"border-left: 1px solid #eee;\\n      }\\n\\n      .code-line {\\n        display: inline\" +\n\";\\n        background: 0 0;\\n        padding: 0;\\n        word-wrap: normal;\\n      \" +\n\"  white-space: pre;\\n      }\\n\\n      .line-prefix {\\n        -webkit-touch-callout:\" +\n\" none;\\n        -webkit-user-select: none;\\n        -moz-user-select: none;\\n      \" +\n\"  -ms-user-select: none;\\n        user-select: none;\\n\\n        display: inline;\\n  \" +\n\"      background: 0 0;\\n        padding: 0;\\n        word-wrap: normal;\\n        wh\" +\n\"ite-space: pre;\\n      }\\n\\n      tr.insert > td {\\n        background-color: #dfd;\\n\" +\n\"        border-color: #b4e2b4;\\n      }\\n\\n      tr.delete > td {\\n        backgroun\" +\n\"d-color: #fee8e9;\\n        border-color: #e9aeae;\\n      }\\n\\n      tr.info > td {\\n \" +\n\"       background-color: #f8fafd;\\n        color: rgba(0,0,0,.3);\\n        border-\" +\n\"color: #d5e4f2;\\n      }\\n\\n      .line-number {\\n        -webkit-touch-callout: non\" +\n\"e;\\n        -webkit-user-select: none;\\n        -moz-user-select: none;\\n        -m\" +\n\"s-user-select: none;\\n        user-select: none;\\n        width: 40px;\\n        col\" +\n\"or: rgba(0,0,0,.3);\\n        text-align: right;\\n        cursor: pointer;\\n        \" +\n\"padding: 0 10px 0 0;\\n      }\\n\\n      .comment > td {\\n        padding: 5px;\\n      \" +\n\"  border-top: 1px solid #d5e4f2;\\n        border-bottom: 1px solid #d5e4f2;\\n     \" +\n\" }\\n\\n      .comment-inner {\\n        border: 1px solid #d5e4f2;\\n        border-rad\" +\n\"ius: 2px;\\n      }\\n\\n      .reply-line {\\n        border-top: 1px solid #d5e4f2;\\n  \" +\n\"      padding: 0;\\n      }\\n\\n      .reply-line button {\\n        width: 100%;\\n     \" +\n\"   background: #f6f8fa;\\n        height: 32px;\\n        border: none;\\n        font\" +\n\"-weight: 700;\\n      }\\n\\n      .reply-line button:active {\\n        background: #e6\" +\n\"e8eb;\\n        border: 1px solid #c4c4c4;\\n      }\\n\\n      img.avatar {\\n        mar\" +\n\"gin-top: 4px;\\n        border-radius: 2px;\\n        float: left;\\n      }\\n\\n      .c\" +\n\"omment-content {\\n        margin-left: 44px;\\n      }\\n\\n      .comment-line {\\n     \" +\n\"   padding: 8px 8px\\n      }\\n\\n      .comment-content h4 {\\n        display: inline\" +\n\" !important;\\n        margin-top: 0;\\n        margin-bottom: 0;\\n        font-weigh\" +\n\"t: 400;\\n      }\\n\\n      .text-gray {\\n        color: #586069 !important\\n      }\\n\\n \" +\n\"     .comment-body {\\n        width: 100%;\\n        padding: 0;\\n        overflow: \" +\n\"visible;\\n      }\\n      .comment-body > :first-child {\\n        margin-top: 0 !imp\" +\n\"ortant;\\n      }\\n\\t\\t\\t.comment-body > :last-child {\\n  \\t\\t\\tmargin-bottom: 0 !importan\" +\n\"t;\\n\\t\\t\\t}\\n      .comment-body h1,\\n      .comment-body h2,\\n      .comment-body h3,\\n\" +\n\"      .comment-body h4,\\n      .comment-body h5,\\n      .comment-body h6 {\\n       \" +\n\" margin: 1em 0 15px;\\n        padding: 0;\\n        font-weight: bold;\\n        line\" +\n\"-height: 1.7;\\n        cursor: text;\\n        position: relative;\\n      }\\n      .c\" +\n\"omment-body h1 {\\n        font-size: 1.8em;\\n        border-bottom: 1px solid #ddd\" +\n\";\\n      }\\n      .comment-body p,\\n      .comment-body blockquote,\\n      .comment-\" +\n\"body ul,\\n      .comment-body ol,\\n      .comment-body dl,\\n      .comment-body tab\" +\n\"le,\\n      .comment-body pre {\\n        margin: 15px 0;\\n      }\\n      .comment-bod\" +\n\"y h2 {\\n        font-size: 1.4em;\\n        border-bottom: 1px solid #eee;\\n      }\\n\" +\n\"      .comment-body ul,\\n      .comment-body ol {\\n        padding-left: 20px;\\n   \" +\n\"   }\\n      .comment-body a {\\n        color: #4183c4;\\n        text-decoration: no\" +\n\"ne;\\n        text-decoration: none;\\n      }\\n      .comment-body .highlight pre,\\n \" +\n\"     .comment-body pre {\\n        background-color: #f8f8f8;\\n        border: 1px \" +\n\"solid #ddd;\\n        line-height: 19px;\\n        overflow: auto;\\n        padding: \" +\n\"6px 10px;\\n        border-radius: 3px;\\n      }\\n      .comment-body pre {\\n        \" +\n\"word-wrap: normal;\\n      }\\n      .comment-body dl {\\n        padding: 0;\\n      }\\n\" +\n\"      .comment-body dl dt {\\n        font-weight: bold;\\n        font-style: itali\" +\n\"c;\\n        padding: 0;\\n        margin-top: 15px;\\n      }\\n      .comment-body dl \" +\n\"dd {\\n        margin-bottom: 15px;\\n        padding: 0 15px;\\n      }\\n      .commen\" +\n\"t-body table {\\n        width: 100%;\\n        overflow: auto;\\n        display: blo\" +\n\"ck;\\n      }\\n      .comment-body table tr {\\n        border-top: 1px solid #ccc;\\n \" +\n\"       background-color: #fff;\\n      }\\n      .comment-body table tr:nth-child(2n\" +\n\") {\\n        background-color: #f8f8f8;\\n      }\\n      .comment-body table th,\\n   \" +\n\"   .comment-body table td {\\n        border: 1px solid #ddd;\\n        padding: 6px\" +\n\" 13px;\\n      }\\n      .comment-body table th {\\n        font-weight: bold;\\n      }\" +\n\"\\n      .comment-body img {\\n        max-width: 100%;\\n        -moz-box-sizing: bor\" +\n\"der-box;\\n        box-sizing: border-box;\\n      }\\n      .comment-body ul.task-lis\" +\n\"t > li.task-list-item {\\n        list-style-type: none;\\n      }\\n      .comment-bo\" +\n\"dy .task-list-item-checkbox {\\n        margin-left: -20px;\\n        vertical-align\" +\n\": middle;\\n      }\\n\\n    </style>\\n\\t<script>\\n    function invokeNative(functionName\" +\n\", args) {\\n      try {\\n        var iframe = document.createElement(\\'IFRAME\\');\\n   \" +\n\"     iframe.setAttribute(\\'src\\', \\'app://\\' + functionName + \\'#\\' + JSON.stringify(a\" +\n\"rgs));\\n        document.body.appendChild(iframe);\\n        iframe.parentNode.remo\" +\n\"veChild(iframe);\\n        iframe = null;  \\n      } catch (err) {\\n          alert(\" +\n\"err.message);\\n      }\\n    }\\n    function lineClick(fileLine, patchLine) {\\n  \\t\\tin\" +\n\"vokeNative(\\\"comment\\\", { fileLine, patchLine });\\n  \\t}\\n  \\tfunction replyTo(id) {\\n \" +\n\" \\t\\tinvokeNative(\\\"reply-to\\\", { id });\\n  \\t}\\n\\t</script>\\n  </head>\\n  <body>\\n    <tab\" +\n\"le>\\n      <tbody>\\t\\n\");\n\n\n#line 270 \"DiffWebView.cshtml\"\n        \n\n#line default\n#line hidden\n\n#line 270 \"DiffWebView.cshtml\"\n         foreach (var chunk in Model.Chunks)\n    \t\t{\n\n\n#line default\n#line hidden\nWriteLiteral(\"\\t        <tr\");\n\nWriteLiteral(\" class=\\\"info\\\"\");\n\nWriteLiteral(\">\\n            <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">...</td>\\n            <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">...</td>\\n            <td\");\n\nWriteLiteral(\" class=\\\"content\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 275 \"DiffWebView.cshtml\"\n                           Write(chunk.Content);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</td>\\n          </tr>\\n\");\n\n\n#line 277 \"DiffWebView.cshtml\"\n\n    \t\tforeach (var line in chunk.Lines)\n  \t\t\t{\n  \t\t\t\tif (line.LineEquality == DiffModel.LineEquality.Equal)\n  \t\t\t\t{\n\n\n#line default\n#line hidden\nWriteLiteral(\"            <tr\");\n\nWriteAttribute (\"onclick\", \" onclick=\\\"\", \"\\\"\"\n, Tuple.Create<string,object,bool> (\"\", \"lineClick(\", true)\n\n#line 282 \"DiffWebView.cshtml\"\n, Tuple.Create<string,object,bool> (\"\", line.Index\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \",\", true)\n\n#line 282 \"DiffWebView.cshtml\"\n        , Tuple.Create<string,object,bool> (\" \", line.NewLine\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \")\", true)\n);\nWriteLiteral(\">\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 283 \"DiffWebView.cshtml\"\n                                 Write(line.BaseLine);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 284 \"DiffWebView.cshtml\"\n                                 Write(line.NewLine);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"content\\\"\");\n\nWriteLiteral(\">\\n                <span\");\n\nWriteLiteral(\" class=\\\"line-prefix\\\"\");\n\nWriteLiteral(\">&nbsp;</span>\\n                <span\");\n\nWriteLiteral(\" class=\\\"code-line\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 287 \"DiffWebView.cshtml\"\n                                   Write(line.Content);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</span>\\n              </td>\\n            </tr>\\n\");\n\n\n#line 290 \"DiffWebView.cshtml\"\n  \t\t\t\t}\n  \t\t\t\telse if (line.LineEquality == DiffModel.LineEquality.Insert)\n          {\n\n\n#line default\n#line hidden\nWriteLiteral(\"            <tr\");\n\nWriteLiteral(\" class=\\\"insert\\\"\");\n\nWriteAttribute (\"onclick\", \" onclick=\\\"\", \"\\\"\"\n, Tuple.Create<string,object,bool> (\"\", \"lineClick(\", true)\n\n#line 293 \"DiffWebView.cshtml\"\n           , Tuple.Create<string,object,bool> (\"\", line.Index\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \",\", true)\n\n#line 293 \"DiffWebView.cshtml\"\n                       , Tuple.Create<string,object,bool> (\" \", line.NewLine\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \")\", true)\n);\nWriteLiteral(\">\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\"></td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 295 \"DiffWebView.cshtml\"\n                                 Write(line.NewLine);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"content\\\"\");\n\nWriteLiteral(\">\\n                <span\");\n\nWriteLiteral(\" class=\\\"line-prefix\\\"\");\n\nWriteLiteral(\">+</span>\\n                <span\");\n\nWriteLiteral(\" class=\\\"code-line\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 298 \"DiffWebView.cshtml\"\n                                   Write(line.Content);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</span>\\n              </td>\\n            </tr>\\n\");\n\n\n#line 301 \"DiffWebView.cshtml\"\n          }\n  \t\t\t\telse if (line.LineEquality == DiffModel.LineEquality.Delete)\n          {\n\n\n#line default\n#line hidden\nWriteLiteral(\"            <tr\");\n\nWriteLiteral(\" class=\\\"delete\\\"\");\n\nWriteAttribute (\"onclick\", \" onclick=\\\"\", \"\\\"\"\n, Tuple.Create<string,object,bool> (\"\", \"lineClick(\", true)\n\n#line 304 \"DiffWebView.cshtml\"\n           , Tuple.Create<string,object,bool> (\"\", line.Index\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \",\", true)\n\n#line 304 \"DiffWebView.cshtml\"\n                       , Tuple.Create<string,object,bool> (\" \", line.BaseLine\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \")\", true)\n);\nWriteLiteral(\">\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 305 \"DiffWebView.cshtml\"\n                                 Write(line.BaseLine);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"line-number\\\"\");\n\nWriteLiteral(\"></td>\\n              <td\");\n\nWriteLiteral(\" class=\\\"content\\\"\");\n\nWriteLiteral(\">\\n                <span\");\n\nWriteLiteral(\" class=\\\"line-prefix\\\"\");\n\nWriteLiteral(\">-</span>\\n                <span\");\n\nWriteLiteral(\" class=\\\"code-line\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 309 \"DiffWebView.cshtml\"\n                                   Write(line.Content);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</span>\\n              </td>\\n            </tr>\\n\");\n\n\n#line 312 \"DiffWebView.cshtml\"\n          }\n\n  \t\t\t\tforeach (var commentSet in line.CommentSets)\n  \t\t\t\t{\n\n\n#line default\n#line hidden\nWriteLiteral(\"  \\t\\t      <tr\");\n\nWriteLiteral(\" class=\\\"comment\\\"\");\n\nWriteLiteral(\">\\n              <td\");\n\nWriteLiteral(\" colspan=\\\"3\\\"\");\n\nWriteLiteral(\">\\n                <div\");\n\nWriteLiteral(\" class=\\\"comment-inner\\\"\");\n\nWriteLiteral(\">\\n\");\n\n\n#line 319 \"DiffWebView.cshtml\"\n                  \n\n#line default\n#line hidden\n\n#line 319 \"DiffWebView.cshtml\"\n                   foreach (var comment in commentSet.Value)\n                  {\n\n\n#line default\n#line hidden\nWriteLiteral(\"                    <div\");\n\nWriteLiteral(\" class=\\\"comment-line\\\"\");\n\nWriteLiteral(\">\\n                      <img\");\n\nWriteAttribute (\"src\", \" src=\\\"\", \"\\\"\"\n\n#line 322 \"DiffWebView.cshtml\"\n, Tuple.Create<string,object,bool> (\"\", comment.AvatarUrl\n\n#line default\n#line hidden\n, false)\n);\nWriteLiteral(\" class=\\\"avatar\\\"\");\n\nWriteLiteral(\" width=\\\"28\\\"\");\n\nWriteLiteral(\" height=\\\"28\\\"\");\n\nWriteLiteral(\" />\\n                      <div\");\n\nWriteLiteral(\" class=\\\"comment-content\\\"\");\n\nWriteLiteral(\">\\n                        <h4><strong>\");\n\n\n#line 324 \"DiffWebView.cshtml\"\n                               Write(comment.Username);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</strong> <span\");\n\nWriteLiteral(\" class=\\\"text-gray\\\"\");\n\nWriteLiteral(\">\");\n\n\n#line 324 \"DiffWebView.cshtml\"\n                                                                                  Write(comment.Date);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</span></h4>\\n                        <div\");\n\nWriteLiteral(\" class=\\\"comment-body\\\"\");\n\nWriteLiteral(\">\\n\");\n\n\n#line 326 \"DiffWebView.cshtml\"\n          \t\t\t\t\t\t\t\t\n\n#line default\n#line hidden\n\n#line 326 \"DiffWebView.cshtml\"\n                                          WriteLiteral(comment.Body);\n\n#line default\n#line hidden\nWriteLiteral(\"\\n                        </div>\\n                      </div>\\n                    \" +\n\"</div>\\n\");\n\n\n#line 330 \"DiffWebView.cshtml\"\n  \t\t\t\t        }\n\n\n#line default\n#line hidden\nWriteLiteral(\"                  <div\");\n\nWriteLiteral(\" class=\\\"reply-line\\\"\");\n\nWriteLiteral(\">\\n                    <button\");\n\nWriteAttribute (\"onclick\", \" onclick=\\\"\", \"\\\"\"\n, Tuple.Create<string,object,bool> (\"\", \"replyTo(\", true)\n\n#line 332 \"DiffWebView.cshtml\"\n      , Tuple.Create<string,object,bool> (\"\", commentSet.Key\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \")\", true)\n);\nWriteLiteral(\">Reply</button>\\n                  </div>\\n                </div>\\n              </t\" +\n\"d>\\n            </tr>\\n\");\n\n\n#line 337 \"DiffWebView.cshtml\"\n  \t\t\t\t}\n  \t\t\t}\n  \t\t}\n\n\n#line default\n#line hidden\nWriteLiteral(\"      </tbody>\\n    </table>\\n  </body>\\n</html>\");\n\n}\n}\n\n// NOTE: this is the default generated helper class. You may choose to extract it to a separate file \n// in order to customize it or share it between multiple templates, and specify the template's base \n// class via the @inherits directive.\npublic abstract class DiffWebViewBase\n{\n\n\t\t// This field is OPTIONAL, but used by the default implementation of Generate, Write, WriteAttribute and WriteLiteral\n\t\t//\n\t\tSystem.IO.TextWriter __razor_writer;\n\n\t\t// This method is OPTIONAL\n\t\t//\n\t\t/// <summary>Executes the template and returns the output as a string.</summary>\n\t\t/// <returns>The template output.</returns>\n\t\tpublic string GenerateString ()\n\t\t{\n\t\t\tusing (var sw = new System.IO.StringWriter ()) {\n\t\t\t\tGenerate (sw);\n\t\t\t\treturn sw.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer\n\t\t// and provide another means of invoking Execute.\n\t\t//\n\t\t/// <summary>Executes the template, writing to the provided text writer.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the template output.</param>\n\t\tpublic void Generate (System.IO.TextWriter writer)\n\t\t{\n\t\t\t__razor_writer = writer;\n\t\t\tExecute ();\n\t\t\t__razor_writer = null;\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the template output without HTML escaping it.</summary>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected void WriteLiteral (string value)\n\t\t{\n\t\t\t__razor_writer.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the literal.</param>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected static void WriteLiteralTo (System.IO.TextWriter writer, string value)\n\t\t{\n\t\t\twriter.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a value to the template output, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected void Write (object value)\n\t\t{\n\t\t\tWriteTo (__razor_writer, value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes an object value to the TextWriter, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the value.</param>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected static void WriteTo (System.IO.TextWriter writer, object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn;\n\n\t\t\tvar write = value as Action<System.IO.TextWriter>;\n\t\t\tif (write != null) {\n\t\t\t\twrite (writer);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//NOTE: a more sophisticated implementation would write safe and pre-escaped values directly to the\n\t\t\t//instead of double-escaping. See System.Web.IHtmlString in ASP.NET 4.0 for an example of this.\n\t\t\twriter.Write(System.Net.WebUtility.HtmlEncode (value.ToString ()));\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to the template output.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\tprotected void WriteAttribute (string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\tWriteAttributeTo (__razor_writer, name, prefix, suffix, values);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to a TextWriter.\n\t\t/// </summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the attribute.</param>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\t///<remarks>Used by Razor helpers to write attributes.</remarks>\n\t\tprotected static void WriteAttributeTo (System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\t// this is based on System.Web.WebPages.WebPageExecutingBase\n\t\t\t// Copyright (c) Microsoft Open Technologies, Inc.\n\t\t\t// Licensed under the Apache License, Version 2.0\n\t\t\tif (values.Length == 0) {\n\t\t\t\t// Explicitly empty attribute, so write the prefix and suffix\n\t\t\t\twriter.Write (prefix);\n\t\t\t\twriter.Write (suffix);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool first = true;\n\t\t\tbool wroteSomething = false;\n\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tTuple<string,object,bool> attrVal = values [i];\n\t\t\t\tstring attPrefix = attrVal.Item1;\n\t\t\t\tobject value = attrVal.Item2;\n\t\t\t\tbool isLiteral = attrVal.Item3;\n\n\t\t\t\tif (value == null) {\n\t\t\t\t\t// Nothing to write\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The special cases here are that the value we're writing might already be a string, or that the \n\t\t\t\t// value might be a bool. If the value is the bool 'true' we want to write the attribute name instead\n\t\t\t\t// of the string 'true'. If the value is the bool 'false' we don't want to write anything.\n\t\t\t\t//\n\t\t\t\t// Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself.\n\t\t\t\tstring stringValue;\n\t\t\t\tbool? boolValue = value as bool?;\n\t\t\t\tif (boolValue == true) {\n\t\t\t\t\tstringValue = name;\n\t\t\t\t} else if (boolValue == false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tstringValue = value as string;\n\t\t\t\t}\n\n\t\t\t\tif (first) {\n\t\t\t\t\twriter.Write (prefix);\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.Write (attPrefix);\n\t\t\t\t}\n\n\t\t\t\tif (isLiteral) {\n\t\t\t\t\twriter.Write (stringValue ?? value);\n\t\t\t\t} else {\n\t\t\t\t\tWriteTo (writer, stringValue ?? value);\n\t\t\t\t}\n\t\t\t\twroteSomething = true;\n\t\t\t}\n\t\t\tif (wroteSomething) {\n\t\t\t\twriter.Write (suffix);\n\t\t\t}\n\t\t}\n\t\t// This method is REQUIRED. The generated Razor subclass will override it with the generated code.\n\t\t//\n\t\t///<summary>Executes the template, writing output to the Write and WriteLiteral methods.</summary>.\n\t\t///<remarks>Not intended to be called directly. Call the Generate method instead.</remarks>\n\t\tpublic abstract void Execute ();\n\n}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "CodeHub/WebViews/DiffWebView.cshtml",
    "content": "﻿@model DiffModel\n<!DOCTYPE html>\n<html>\n  <head>\n    <title></title>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\"/>\n    <style>\n      head, body {\n        margin: 0;\n        -webkit-text-size-adjust: none;\n        -moz-text-size-adjust: none;\n      }\n\n      table {\n        width: 100%;\n        border-collapse: collapse;\n        font-family: Menlo,Consolas,monospace;\n        font-size: @(Model.FontSize)px;\n      }\n\n      td {\n        height: 20px;\n        line-height: 20px;\n      }\n\n      .content {\n        white-space: nowrap;\n        padding: 0 10px;\n        border-left: 1px solid #eee;\n      }\n\n      .code-line {\n        display: inline;\n        background: 0 0;\n        padding: 0;\n        word-wrap: normal;\n        white-space: pre;\n      }\n\n      .line-prefix {\n        -webkit-touch-callout: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        user-select: none;\n\n        display: inline;\n        background: 0 0;\n        padding: 0;\n        word-wrap: normal;\n        white-space: pre;\n      }\n\n      tr.insert > td {\n        background-color: #dfd;\n        border-color: #b4e2b4;\n      }\n\n      tr.delete > td {\n        background-color: #fee8e9;\n        border-color: #e9aeae;\n      }\n\n      tr.info > td {\n        background-color: #f8fafd;\n        color: rgba(0,0,0,.3);\n        border-color: #d5e4f2;\n      }\n\n      .line-number {\n        -webkit-touch-callout: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        user-select: none;\n        width: 40px;\n        color: rgba(0,0,0,.3);\n        text-align: right;\n        cursor: pointer;\n        padding: 0 10px 0 0;\n      }\n\n      .comment > td {\n        padding: 5px;\n        border-top: 1px solid #d5e4f2;\n        border-bottom: 1px solid #d5e4f2;\n      }\n\n      .comment-inner {\n        border: 1px solid #d5e4f2;\n        border-radius: 2px;\n      }\n\n      .reply-line {\n        border-top: 1px solid #d5e4f2;\n        padding: 0;\n      }\n\n      .reply-line button {\n        width: 100%;\n        background: #f6f8fa;\n        height: 32px;\n        border: none;\n        font-weight: 700;\n      }\n\n      .reply-line button:active {\n        background: #e6e8eb;\n        border: 1px solid #c4c4c4;\n      }\n\n      img.avatar {\n        margin-top: 4px;\n        border-radius: 2px;\n        float: left;\n      }\n\n      .comment-content {\n        margin-left: 44px;\n      }\n\n      .comment-line {\n        padding: 8px 8px\n      }\n\n      .comment-content h4 {\n        display: inline !important;\n        margin-top: 0;\n        margin-bottom: 0;\n        font-weight: 400;\n      }\n\n      .text-gray {\n        color: #586069 !important\n      }\n\n      .comment-body {\n        width: 100%;\n        padding: 0;\n        overflow: visible;\n      }\n      .comment-body > :first-child {\n        margin-top: 0 !important;\n      }\n\t\t\t.comment-body > :last-child {\n  \t\t\tmargin-bottom: 0 !important;\n\t\t\t}\n      .comment-body h1,\n      .comment-body h2,\n      .comment-body h3,\n      .comment-body h4,\n      .comment-body h5,\n      .comment-body h6 {\n        margin: 1em 0 15px;\n        padding: 0;\n        font-weight: bold;\n        line-height: 1.7;\n        cursor: text;\n        position: relative;\n      }\n      .comment-body h1 {\n        font-size: 1.8em;\n        border-bottom: 1px solid #ddd;\n      }\n      .comment-body p,\n      .comment-body blockquote,\n      .comment-body ul,\n      .comment-body ol,\n      .comment-body dl,\n      .comment-body table,\n      .comment-body pre {\n        margin: 15px 0;\n      }\n      .comment-body h2 {\n        font-size: 1.4em;\n        border-bottom: 1px solid #eee;\n      }\n      .comment-body ul,\n      .comment-body ol {\n        padding-left: 20px;\n      }\n      .comment-body a {\n        color: #4183c4;\n        text-decoration: none;\n        text-decoration: none;\n      }\n      .comment-body .highlight pre,\n      .comment-body pre {\n        background-color: #f8f8f8;\n        border: 1px solid #ddd;\n        line-height: 19px;\n        overflow: auto;\n        padding: 6px 10px;\n        border-radius: 3px;\n      }\n      .comment-body pre {\n        word-wrap: normal;\n      }\n      .comment-body dl {\n        padding: 0;\n      }\n      .comment-body dl dt {\n        font-weight: bold;\n        font-style: italic;\n        padding: 0;\n        margin-top: 15px;\n      }\n      .comment-body dl dd {\n        margin-bottom: 15px;\n        padding: 0 15px;\n      }\n      .comment-body table {\n        width: 100%;\n        overflow: auto;\n        display: block;\n      }\n      .comment-body table tr {\n        border-top: 1px solid #ccc;\n        background-color: #fff;\n      }\n      .comment-body table tr:nth-child(2n) {\n        background-color: #f8f8f8;\n      }\n      .comment-body table th,\n      .comment-body table td {\n        border: 1px solid #ddd;\n        padding: 6px 13px;\n      }\n      .comment-body table th {\n        font-weight: bold;\n      }\n      .comment-body img {\n        max-width: 100%;\n        -moz-box-sizing: border-box;\n        box-sizing: border-box;\n      }\n      .comment-body ul.task-list > li.task-list-item {\n        list-style-type: none;\n      }\n      .comment-body .task-list-item-checkbox {\n        margin-left: -20px;\n        vertical-align: middle;\n      }\n\n    </style>\n\t<script>\n    function invokeNative(functionName, args) {\n      try {\n        var iframe = document.createElement('IFRAME');\n        iframe.setAttribute('src', 'app://' + functionName + '#' + JSON.stringify(args));\n        document.body.appendChild(iframe);\n        iframe.parentNode.removeChild(iframe);\n        iframe = null;  \n      } catch (err) {\n          alert(err.message);\n      }\n    }\n    function lineClick(fileLine, patchLine) {\n  \t\tinvokeNative(\"comment\", { fileLine, patchLine });\n  \t}\n  \tfunction replyTo(id) {\n  \t\tinvokeNative(\"reply-to\", { id });\n  \t}\n\t</script>\n  </head>\n  <body>\n    <table>\n      <tbody>\t\n        @foreach (var chunk in Model.Chunks)\n    \t\t{\n\t        <tr class=\"info\">\n            <td class=\"line-number\">...</td>\n            <td class=\"line-number\">...</td>\n            <td class=\"content\">@chunk.Content</td>\n          </tr>\n\n    \t\tforeach (var line in chunk.Lines)\n  \t\t\t{\n  \t\t\t\tif (line.LineEquality == DiffModel.LineEquality.Equal)\n  \t\t\t\t{\n            <tr onclick=\"lineClick(@line.Index, @line.NewLine)\">\n              <td class=\"line-number\">@line.BaseLine</td>\n              <td class=\"line-number\">@line.NewLine</td>\n              <td class=\"content\">\n                <span class=\"line-prefix\">&nbsp;</span>\n                <span class=\"code-line\">@line.Content</span>\n              </td>\n            </tr>\n  \t\t\t\t}\n  \t\t\t\telse if (line.LineEquality == DiffModel.LineEquality.Insert)\n          {\n            <tr class=\"insert\" onclick=\"lineClick(@line.Index, @line.NewLine)\">\n              <td class=\"line-number\"></td>\n              <td class=\"line-number\">@line.NewLine</td>\n              <td class=\"content\">\n                <span class=\"line-prefix\">+</span>\n                <span class=\"code-line\">@line.Content</span>\n              </td>\n            </tr>\n          }\n  \t\t\t\telse if (line.LineEquality == DiffModel.LineEquality.Delete)\n          {\n            <tr class=\"delete\" onclick=\"lineClick(@line.Index, @line.BaseLine)\">\n              <td class=\"line-number\">@line.BaseLine</td>\n              <td class=\"line-number\"></td>\n              <td class=\"content\">\n                <span class=\"line-prefix\">-</span>\n                <span class=\"code-line\">@line.Content</span>\n              </td>\n            </tr>\n          }\n\n  \t\t\t\tforeach (var commentSet in line.CommentSets)\n  \t\t\t\t{\n  \t\t      <tr class=\"comment\">\n              <td colspan=\"3\">\n                <div class=\"comment-inner\">\n                  @foreach (var comment in commentSet.Value)\n                  {\n                    <div class=\"comment-line\">\n                      <img src=\"@comment.AvatarUrl\" class=\"avatar\" width=\"28\" height=\"28\" />\n                      <div class=\"comment-content\">\n                        <h4><strong>@comment.Username</strong> <span class=\"text-gray\">@comment.Date</span></h4>\n                        <div class=\"comment-body\">\n          \t\t\t\t\t\t\t\t@{WriteLiteral(comment.Body);}\n                        </div>\n                      </div>\n                    </div>\n  \t\t\t\t        }\n                  <div class=\"reply-line\">\n                    <button onclick=\"replyTo(@commentSet.Key)\">Reply</button>\n                  </div>\n                </div>\n              </td>\n            </tr>\n  \t\t\t\t}\n  \t\t\t}\n  \t\t}\n      </tbody>\n    </table>\n  </body>\n</html>"
  },
  {
    "path": "CodeHub/WebViews/MarkdownModel.cs",
    "content": "﻿namespace CodeHub.WebViews\n{\n    public class MarkdownModel\n    {\n        public string Body { get; }\n\n        public int FontSize { get; }\n\n        public bool ContinuousResize { get; }\n\n        public MarkdownModel(string body, int fontSize, bool continuousResize = false)\n        {\n            Body = body;\n            FontSize = fontSize;\n            ContinuousResize = continuousResize;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub/WebViews/MarkdownWebView.cs",
    "content": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace CodeHub.WebViews\n{\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n[System.CodeDom.Compiler.GeneratedCodeAttribute(\"RazorTemplatePreprocessor\", \"2.6.0.0\")]\npublic partial class MarkdownWebView : MarkdownWebViewBase\n{\n\n#line hidden\n\n#line 1 \"MarkdownWebView.cshtml\"\npublic MarkdownModel Model { get; set; }\n\n#line default\n#line hidden\n\n\npublic override void Execute()\n{\nWriteLiteral(\"<html><head>\\n<meta\");\n\nWriteLiteral(\" name=\\\"viewport\\\"\");\n\nWriteLiteral(\" content=\\\"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable\" +\n\"=0\\\"\");\n\nWriteLiteral(\"/>\\n<style>\\n* {\\n    box-sizing: border-box;\\n}\\n\\nhtml {\\n    -webkit-text-size-adjust\" +\n\": none;\\n}\\n\\nbody {\\n    color: #333;\\n    font-family: Helvetica, Arial, sans-serif\" +\n\";\\n    line-height: 1.42;\\n    font-size: \");\n\n\n#line 17 \"MarkdownWebView.cshtml\"\n           Write(Model.FontSize);\n\n\n#line default\n#line hidden\nWriteLiteral(@\"px;\n    line-height: 1.7;\n    word-wrap: break-word;\n}\nh1, h2, h3, h4, h5, h6 {\nmargin: 1em 0 15px;\npadding: 0;\nfont-weight: bold;\nline-height: 1.7;\ncursor: text;\nposition: relative;\n}\nh1 {\nfont-size: 1.8em;\nborder-bottom: 1px solid #ddd;\n}\np, blockquote, ul, ol, dl, table, pre {\nmargin: 15px 0;\n}\nh2 {\nfont-size: 1.4em;\nborder-bottom: 1px solid #eee;\n}\nul, ol {\npadding-left: 20px;\n}\na {\ncolor: #4183c4;\ntext-decoration: none;\ntext-decoration: none;\n}\n.highlight pre, pre {\nbackground-color: #f8f8f8;\nborder: 1px solid #ddd;\nline-height: 19px;\noverflow: auto;\npadding: 6px 10px;\nborder-radius: 3px;\n}\npre {\nword-wrap: normal;\n}\ndl {\npadding: 0;\n}\ndl dt {\nfont-weight: bold;\nfont-style: italic;\npadding: 0;\nmargin-top: 15px;\n}\ndl dd {\nmargin-bottom: 15px;\npadding: 0 15px;\n}\ntable {\nwidth: 100%;\noverflow: auto;\ndisplay: block;\n}\ntable tr {\nborder-top: 1px solid #ccc;\nbackground-color: #fff;\n}\ntable tr:nth-child(2n) {\nbackground-color: #f8f8f8;\n}\ntable th, table td {\nborder: 1px solid #ddd;\npadding: 6px 13px;\n}\ntable th {\nfont-weight: bold;\n}\nimg {\nmax-width: 100%;\n-moz-box-sizing: border-box;\nbox-sizing: border-box;\n}\nul.task-list > li.task-list-item {\n  list-style-type: none;\n}\n.task-list-item-checkbox {\n  margin-left: -20px;\n  vertical-align: middle;\n}\n</style>\n\");\n\n\n#line 104 \"MarkdownWebView.cshtml\"\n if (Model.ContinuousResize) {\n\n\n#line default\n#line hidden\nWriteLiteral(@\"    <script>\n    function size() { return document.body.scrollHeight; }\n    function rs() { document.location.href = 'app://resize'; }; window.onsize = rs;\n    var h = 0; setInterval(function() { if (size() != h) { h = size(); rs(); } }, 300);\n    </script>\n\");\n\n\n#line 110 \"MarkdownWebView.cshtml\"\n}\n\n\n#line default\n#line hidden\nWriteLiteral(\"<title>Readme</title></head>\\n<body>\");\n\n\n#line 112 \"MarkdownWebView.cshtml\"\n        WriteLiteral(Model.Body);\n\n#line default\n#line hidden\nWriteLiteral(\"</body>\\n</html>\");\n\n}\n}\n\n// NOTE: this is the default generated helper class. You may choose to extract it to a separate file \n// in order to customize it or share it between multiple templates, and specify the template's base \n// class via the @inherits directive.\npublic abstract class MarkdownWebViewBase\n{\n\n\t\t// This field is OPTIONAL, but used by the default implementation of Generate, Write, WriteAttribute and WriteLiteral\n\t\t//\n\t\tSystem.IO.TextWriter __razor_writer;\n\n\t\t// This method is OPTIONAL\n\t\t//\n\t\t/// <summary>Executes the template and returns the output as a string.</summary>\n\t\t/// <returns>The template output.</returns>\n\t\tpublic string GenerateString ()\n\t\t{\n\t\t\tusing (var sw = new System.IO.StringWriter ()) {\n\t\t\t\tGenerate (sw);\n\t\t\t\treturn sw.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer\n\t\t// and provide another means of invoking Execute.\n\t\t//\n\t\t/// <summary>Executes the template, writing to the provided text writer.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the template output.</param>\n\t\tpublic void Generate (System.IO.TextWriter writer)\n\t\t{\n\t\t\t__razor_writer = writer;\n\t\t\tExecute ();\n\t\t\t__razor_writer = null;\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the template output without HTML escaping it.</summary>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected void WriteLiteral (string value)\n\t\t{\n\t\t\t__razor_writer.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the literal.</param>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected static void WriteLiteralTo (System.IO.TextWriter writer, string value)\n\t\t{\n\t\t\twriter.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a value to the template output, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected void Write (object value)\n\t\t{\n\t\t\tWriteTo (__razor_writer, value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes an object value to the TextWriter, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the value.</param>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected static void WriteTo (System.IO.TextWriter writer, object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn;\n\n\t\t\tvar write = value as Action<System.IO.TextWriter>;\n\t\t\tif (write != null) {\n\t\t\t\twrite (writer);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//NOTE: a more sophisticated implementation would write safe and pre-escaped values directly to the\n\t\t\t//instead of double-escaping. See System.Web.IHtmlString in ASP.NET 4.0 for an example of this.\n\t\t\twriter.Write(System.Net.WebUtility.HtmlEncode (value.ToString ()));\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to the template output.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\tprotected void WriteAttribute (string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\tWriteAttributeTo (__razor_writer, name, prefix, suffix, values);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to a TextWriter.\n\t\t/// </summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the attribute.</param>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\t///<remarks>Used by Razor helpers to write attributes.</remarks>\n\t\tprotected static void WriteAttributeTo (System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\t// this is based on System.Web.WebPages.WebPageExecutingBase\n\t\t\t// Copyright (c) Microsoft Open Technologies, Inc.\n\t\t\t// Licensed under the Apache License, Version 2.0\n\t\t\tif (values.Length == 0) {\n\t\t\t\t// Explicitly empty attribute, so write the prefix and suffix\n\t\t\t\twriter.Write (prefix);\n\t\t\t\twriter.Write (suffix);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool first = true;\n\t\t\tbool wroteSomething = false;\n\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tTuple<string,object,bool> attrVal = values [i];\n\t\t\t\tstring attPrefix = attrVal.Item1;\n\t\t\t\tobject value = attrVal.Item2;\n\t\t\t\tbool isLiteral = attrVal.Item3;\n\n\t\t\t\tif (value == null) {\n\t\t\t\t\t// Nothing to write\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The special cases here are that the value we're writing might already be a string, or that the \n\t\t\t\t// value might be a bool. If the value is the bool 'true' we want to write the attribute name instead\n\t\t\t\t// of the string 'true'. If the value is the bool 'false' we don't want to write anything.\n\t\t\t\t//\n\t\t\t\t// Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself.\n\t\t\t\tstring stringValue;\n\t\t\t\tbool? boolValue = value as bool?;\n\t\t\t\tif (boolValue == true) {\n\t\t\t\t\tstringValue = name;\n\t\t\t\t} else if (boolValue == false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tstringValue = value as string;\n\t\t\t\t}\n\n\t\t\t\tif (first) {\n\t\t\t\t\twriter.Write (prefix);\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.Write (attPrefix);\n\t\t\t\t}\n\n\t\t\t\tif (isLiteral) {\n\t\t\t\t\twriter.Write (stringValue ?? value);\n\t\t\t\t} else {\n\t\t\t\t\tWriteTo (writer, stringValue ?? value);\n\t\t\t\t}\n\t\t\t\twroteSomething = true;\n\t\t\t}\n\t\t\tif (wroteSomething) {\n\t\t\t\twriter.Write (suffix);\n\t\t\t}\n\t\t}\n\t\t// This method is REQUIRED. The generated Razor subclass will override it with the generated code.\n\t\t//\n\t\t///<summary>Executes the template, writing output to the Write and WriteLiteral methods.</summary>.\n\t\t///<remarks>Not intended to be called directly. Call the Generate method instead.</remarks>\n\t\tpublic abstract void Execute ();\n\n}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "CodeHub/WebViews/MarkdownWebView.cshtml",
    "content": "﻿@model MarkdownModel\n<html><head>\n<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0\"/>\n<style>\n* {\n    box-sizing: border-box;\n}\n\nhtml {\n    -webkit-text-size-adjust: none;\n}\n\nbody {\n    color: #333;\n    font-family: Helvetica, Arial, sans-serif;\n    line-height: 1.42;\n    font-size: @(Model.FontSize)px;\n    line-height: 1.7;\n    word-wrap: break-word;\n}\nh1, h2, h3, h4, h5, h6 {\nmargin: 1em 0 15px;\npadding: 0;\nfont-weight: bold;\nline-height: 1.7;\ncursor: text;\nposition: relative;\n}\nh1 {\nfont-size: 1.8em;\nborder-bottom: 1px solid #ddd;\n}\np, blockquote, ul, ol, dl, table, pre {\nmargin: 15px 0;\n}\nh2 {\nfont-size: 1.4em;\nborder-bottom: 1px solid #eee;\n}\nul, ol {\npadding-left: 20px;\n}\na {\ncolor: #4183c4;\ntext-decoration: none;\ntext-decoration: none;\n}\n.highlight pre, pre {\nbackground-color: #f8f8f8;\nborder: 1px solid #ddd;\nline-height: 19px;\noverflow: auto;\npadding: 6px 10px;\nborder-radius: 3px;\n}\npre {\nword-wrap: normal;\n}\ndl {\npadding: 0;\n}\ndl dt {\nfont-weight: bold;\nfont-style: italic;\npadding: 0;\nmargin-top: 15px;\n}\ndl dd {\nmargin-bottom: 15px;\npadding: 0 15px;\n}\ntable {\nwidth: 100%;\noverflow: auto;\ndisplay: block;\n}\ntable tr {\nborder-top: 1px solid #ccc;\nbackground-color: #fff;\n}\ntable tr:nth-child(2n) {\nbackground-color: #f8f8f8;\n}\ntable th, table td {\nborder: 1px solid #ddd;\npadding: 6px 13px;\n}\ntable th {\nfont-weight: bold;\n}\nimg {\nmax-width: 100%;\n-moz-box-sizing: border-box;\nbox-sizing: border-box;\n}\nul.task-list > li.task-list-item {\n  list-style-type: none;\n}\n.task-list-item-checkbox {\n  margin-left: -20px;\n  vertical-align: middle;\n}\n</style>\n@if (Model.ContinuousResize) {\n    <script>\n    function size() { return document.body.scrollHeight; }\n    function rs() { document.location.href = 'app://resize'; }; window.onsize = rs;\n    var h = 0; setInterval(function() { if (size() != h) { h = size(); rs(); } }, 300);\n    </script>\n}\n<title>Readme</title></head>\n<body>@{WriteLiteral(Model.Body);}</body>\n</html>"
  },
  {
    "path": "CodeHub/WebViews/SyntaxHighlighterModel.cs",
    "content": "﻿namespace CodeHub.WebViews\n{\n    public class SyntaxHighlighterModel\n    {\n        public string Content { get; }\n        public string Theme { get; }\n        public string Language { get; }\n        public int FontSize { get; }\n        public string Viewport { get; }\n\n        public SyntaxHighlighterModel(string content, string theme, int fontSize, bool shouldZoom, bool lockWidth = false, string file = null)\n        {\n            Content = content;\n            Theme = theme;\n            FontSize = fontSize;\n\n            var scale = shouldZoom ? 1.0m : 0.4m;\n            var width = lockWidth ? \"width=device-width\" : string.Empty;\n            Viewport = $\"minimum-scale={scale} maximum-scale=4.0 {width}\";\n\n            if (file != null)\n                Language = CalculateLanguage(System.IO.Path.GetExtension(file));\n        }\n\n        private static string CalculateLanguage(string extension)\n        {\n            if (extension != null)\n            {\n                switch (extension.ToLower().Trim('.', ' '))\n                {\n                    case \"rb\":\n                    case \"erb\":\n                        return \"ruby\";\n                    case \"go\":\n                        return \"go\";\n                    case \"cs\":\n                        return \"cs\";\n                    case \"fs\":\n                        return \"fsharp\";\n                    case \"py\":\n                        return \"python\";\n                    case \"js\":\n                        return \"javascript\";\n                    case \"css\":\n                        return \"css\";\n                }\n            }\n\n            return string.Empty;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub/WebViews/SyntaxHighlighterWebView.cs",
    "content": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace CodeHub.WebViews\n{\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n[System.CodeDom.Compiler.GeneratedCodeAttribute(\"RazorTemplatePreprocessor\", \"2.6.0.0\")]\npublic partial class SyntaxHighlighterWebView : SyntaxHighlighterWebViewBase\n{\n\n#line hidden\n\n#line 1 \"SyntaxHighlighterWebView.cshtml\"\npublic SyntaxHighlighterModel Model { get; set; }\n\n#line default\n#line hidden\n\n\npublic override void Execute()\n{\nWriteLiteral(\"<!DOCTYPE html>\\n<html>\\n<head>\\n<meta\");\n\nWriteLiteral(\" charset=\\'utf-8\\'\");\n\nWriteLiteral(\">\\n<meta\");\n\nWriteLiteral(\" name=\\\"viewport\\\"\");\n\nWriteAttribute (\"content\", \" content=\\\"\", \"\\\"\"\n\n#line 6 \"SyntaxHighlighterWebView.cshtml\"\n, Tuple.Create<string,object,bool> (\" \", Model.Viewport\n\n#line default\n#line hidden\n, false)\n);\nWriteLiteral(\">\\n<link\");\n\nWriteLiteral(\" rel=\\\"stylesheet\\\"\");\n\nWriteAttribute (\"href\", \" href=\\\"\", \"\\\"\"\n, Tuple.Create<string,object,bool> (\"\", \"WebResources/styles/\", true)\n\n#line 7 \"SyntaxHighlighterWebView.cshtml\"\n           , Tuple.Create<string,object,bool> (\"\", Model.Theme\n\n#line default\n#line hidden\n, false)\n, Tuple.Create<string,object,bool> (\"\", \".css\", true)\n);\nWriteLiteral(\" />\\n<script\");\n\nWriteLiteral(\" src=\\\"WebResources/highlight.pack.js\\\"\");\n\nWriteLiteral(\"></script>\\n<script\");\n\nWriteLiteral(\" src=\\\"WebResources/highlight-line-numbers.min.js\\\"\");\n\nWriteLiteral(@\"></script>\n<script>\n  hljs.initHighlightingOnLoad();\n  hljs.initLineNumbersOnLoad();\n\n  window.onload = function() {\n    var elem = document.querySelector('.hljs');\n    var style = getComputedStyle(elem);\n    document.body.style.backgroundColor = style.backgroundColor;\n  }\n</script>\n<style>\nhtml {\n    height: 100%;\n    width: 100%;\n}\nbody { \n    margin: 0; \n    min-height: 100%; \n    min-width: 100%;\n    -webkit-text-size-adjust: none;\n    -moz-text-size-adjust: none;\n    font-size: \");\n\n\n#line 31 \"SyntaxHighlighterWebView.cshtml\"\n           Write(Model.FontSize);\n\n\n#line default\n#line hidden\nWriteLiteral(@\"px;\n}\n\nbody > pre { \n    margin: 0em; \n    min-width: 100%; \n    min-height: 100%; \n    overflow: none;\n}\n\nbody > pre * {\n    overflow: none;\n}\n\n.hljs { \n    width: 100%;\n    min-width: 100%;\n    min-height: 100%; \n    box-sizing: border-box; \n    overflow: none;\n}\n\ncode {\n  display: block;\n  width: 100%;\n  min-width: 100%;\n}\n\n/* for block of numbers */\ntd.hljs-ln-numbers {\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -khtml-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n\n  text-align: center;\n  color: #ccc;\n  border-right: 1px solid #CCC;\n  vertical-align: top;\n  padding-right: 5px;\n\n  /* your custom style here */\n}\n\n/* for block of code */\ntd.hljs-ln-code {\n  padding-left: 10px;\n}\n</style>\n</head>\n<body>\n    <pre><code\");\n\nWriteLiteral(\" id=\\\"code\\\"\");\n\nWriteAttribute (\"class\", \" class=\\\"\", \"\\\"\"\n\n#line 84 \"SyntaxHighlighterWebView.cshtml\"\n, Tuple.Create<string,object,bool> (\"\", Model.Language\n\n#line default\n#line hidden\n, false)\n);\nWriteLiteral(\">\");\n\n\n#line 84 \"SyntaxHighlighterWebView.cshtml\"\n                                            Write(Model.Content);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</code></pre>\\n</body>\\n</html> \");\n\n}\n}\n\n// NOTE: this is the default generated helper class. You may choose to extract it to a separate file \n// in order to customize it or share it between multiple templates, and specify the template's base \n// class via the @inherits directive.\npublic abstract class SyntaxHighlighterWebViewBase\n{\n\n\t\t// This field is OPTIONAL, but used by the default implementation of Generate, Write, WriteAttribute and WriteLiteral\n\t\t//\n\t\tSystem.IO.TextWriter __razor_writer;\n\n\t\t// This method is OPTIONAL\n\t\t//\n\t\t/// <summary>Executes the template and returns the output as a string.</summary>\n\t\t/// <returns>The template output.</returns>\n\t\tpublic string GenerateString ()\n\t\t{\n\t\t\tusing (var sw = new System.IO.StringWriter ()) {\n\t\t\t\tGenerate (sw);\n\t\t\t\treturn sw.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer\n\t\t// and provide another means of invoking Execute.\n\t\t//\n\t\t/// <summary>Executes the template, writing to the provided text writer.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the template output.</param>\n\t\tpublic void Generate (System.IO.TextWriter writer)\n\t\t{\n\t\t\t__razor_writer = writer;\n\t\t\tExecute ();\n\t\t\t__razor_writer = null;\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the template output without HTML escaping it.</summary>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected void WriteLiteral (string value)\n\t\t{\n\t\t\t__razor_writer.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the literal.</param>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected static void WriteLiteralTo (System.IO.TextWriter writer, string value)\n\t\t{\n\t\t\twriter.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a value to the template output, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected void Write (object value)\n\t\t{\n\t\t\tWriteTo (__razor_writer, value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes an object value to the TextWriter, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the value.</param>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected static void WriteTo (System.IO.TextWriter writer, object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn;\n\n\t\t\tvar write = value as Action<System.IO.TextWriter>;\n\t\t\tif (write != null) {\n\t\t\t\twrite (writer);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//NOTE: a more sophisticated implementation would write safe and pre-escaped values directly to the\n\t\t\t//instead of double-escaping. See System.Web.IHtmlString in ASP.NET 4.0 for an example of this.\n\t\t\twriter.Write(System.Net.WebUtility.HtmlEncode (value.ToString ()));\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to the template output.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\tprotected void WriteAttribute (string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\tWriteAttributeTo (__razor_writer, name, prefix, suffix, values);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to a TextWriter.\n\t\t/// </summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the attribute.</param>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\t///<remarks>Used by Razor helpers to write attributes.</remarks>\n\t\tprotected static void WriteAttributeTo (System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\t// this is based on System.Web.WebPages.WebPageExecutingBase\n\t\t\t// Copyright (c) Microsoft Open Technologies, Inc.\n\t\t\t// Licensed under the Apache License, Version 2.0\n\t\t\tif (values.Length == 0) {\n\t\t\t\t// Explicitly empty attribute, so write the prefix and suffix\n\t\t\t\twriter.Write (prefix);\n\t\t\t\twriter.Write (suffix);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool first = true;\n\t\t\tbool wroteSomething = false;\n\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tTuple<string,object,bool> attrVal = values [i];\n\t\t\t\tstring attPrefix = attrVal.Item1;\n\t\t\t\tobject value = attrVal.Item2;\n\t\t\t\tbool isLiteral = attrVal.Item3;\n\n\t\t\t\tif (value == null) {\n\t\t\t\t\t// Nothing to write\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The special cases here are that the value we're writing might already be a string, or that the \n\t\t\t\t// value might be a bool. If the value is the bool 'true' we want to write the attribute name instead\n\t\t\t\t// of the string 'true'. If the value is the bool 'false' we don't want to write anything.\n\t\t\t\t//\n\t\t\t\t// Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself.\n\t\t\t\tstring stringValue;\n\t\t\t\tbool? boolValue = value as bool?;\n\t\t\t\tif (boolValue == true) {\n\t\t\t\t\tstringValue = name;\n\t\t\t\t} else if (boolValue == false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tstringValue = value as string;\n\t\t\t\t}\n\n\t\t\t\tif (first) {\n\t\t\t\t\twriter.Write (prefix);\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.Write (attPrefix);\n\t\t\t\t}\n\n\t\t\t\tif (isLiteral) {\n\t\t\t\t\twriter.Write (stringValue ?? value);\n\t\t\t\t} else {\n\t\t\t\t\tWriteTo (writer, stringValue ?? value);\n\t\t\t\t}\n\t\t\t\twroteSomething = true;\n\t\t\t}\n\t\t\tif (wroteSomething) {\n\t\t\t\twriter.Write (suffix);\n\t\t\t}\n\t\t}\n\t\t// This method is REQUIRED. The generated Razor subclass will override it with the generated code.\n\t\t//\n\t\t///<summary>Executes the template, writing output to the Write and WriteLiteral methods.</summary>.\n\t\t///<remarks>Not intended to be called directly. Call the Generate method instead.</remarks>\n\t\tpublic abstract void Execute ();\n\n}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "CodeHub/WebViews/SyntaxHighlighterWebView.cshtml",
    "content": "﻿@model SyntaxHighlighterModel\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset='utf-8'>\n<meta name=\"viewport\" content=\" @(Model.Viewport)\">\n<link rel=\"stylesheet\" href=\"WebResources/styles/@(Model.Theme).css\" />\n<script src=\"WebResources/highlight.pack.js\"></script>\n<script src=\"WebResources/highlight-line-numbers.min.js\"></script>\n<script>\n  hljs.initHighlightingOnLoad();\n  hljs.initLineNumbersOnLoad();\n\n  window.onload = function() {\n    var elem = document.querySelector('.hljs');\n    var style = getComputedStyle(elem);\n    document.body.style.backgroundColor = style.backgroundColor;\n  }\n</script>\n<style>\nhtml {\n    height: 100%;\n    width: 100%;\n}\nbody { \n    margin: 0; \n    min-height: 100%; \n    min-width: 100%;\n    -webkit-text-size-adjust: none;\n    -moz-text-size-adjust: none;\n    font-size: @(Model.FontSize)px;\n}\n\nbody > pre { \n    margin: 0em; \n    min-width: 100%; \n    min-height: 100%; \n    overflow: none;\n}\n\nbody > pre * {\n    overflow: none;\n}\n\n.hljs { \n    width: 100%;\n    min-width: 100%;\n    min-height: 100%; \n    box-sizing: border-box; \n    overflow: none;\n}\n\ncode {\n  display: block;\n  width: 100%;\n  min-width: 100%;\n}\n\n/* for block of numbers */\ntd.hljs-ln-numbers {\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -khtml-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n\n  text-align: center;\n  color: #ccc;\n  border-right: 1px solid #CCC;\n  vertical-align: top;\n  padding-right: 5px;\n\n  /* your custom style here */\n}\n\n/* for block of code */\ntd.hljs-ln-code {\n  padding-left: 10px;\n}\n</style>\n</head>\n<body>\n    <pre><code id=\"code\" class=\"@Model.Language\">@Model.Content</code></pre>\n</body>\n</html> "
  },
  {
    "path": "CodeHub/WebViews/UpgradeDetailsModel.cs",
    "content": "﻿namespace CodeHub.WebViews\n{\n    public class UpgradeDetailsModel\n    {\n        public string Price { get; }\n\n        public bool IsPurchased { get; }\n\n        public UpgradeDetailsModel(string price, bool isPurchased)\n        {\n            Price = price;\n            IsPurchased = isPurchased;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub/WebViews/UpgradeDetailsWebView.cs",
    "content": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace CodeHub.WebViews\n{\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n\n[System.CodeDom.Compiler.GeneratedCodeAttribute(\"RazorTemplatePreprocessor\", \"2.6.0.0\")]\npublic partial class UpgradeDetailsWebView : UpgradeDetailsWebViewBase\n{\n\n#line hidden\n\n#line 1 \"UpgradeDetailsWebView.cshtml\"\npublic UpgradeDetailsModel Model { get; set; }\n\n#line default\n#line hidden\n\n\npublic override void Execute()\n{\nWriteLiteral(\"<html><head>\\n<meta\");\n\nWriteLiteral(\" name=\\\"viewport\\\"\");\n\nWriteLiteral(\" content=\\\"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable\" +\n\"=0\\\"\");\n\nWriteLiteral(\"/>\\n<style>\\n* {\\n    box-sizing: border-box;\\n}\\nhtml {\\n    -webkit-text-size-adjust:\" +\n\" none;\\n}\\nbody {\\n    color: #333;\\n    font-family: Helvetica, Arial, sans-serif;\\n\" +\n\"    line-height: 1.42;\\n    font-size: 16px;\\n    line-height: 1.7;\\n    word-wrap:\" +\n\" break-word;\\n}\\nh1,\\nh2,\\nh3,\\nh4,\\nh5,\\nh6 {\\n    margin: 1em 0 15px;\\n    padding: 0;\\n\" +\n\"    font-weight: bold;\\n    line-height: 1.7;\\n    cursor: text;\\n    position: rel\" +\n\"ative;\\n}\\nh1 {\\n    font-size: 1.8em;\\n    border-bottom: 1px solid #ddd;\\n}\\np,\\nbloc\" +\n\"kquote,\\nul,\\nol,\\ndl,\\ntable,\\npre {\\n    margin: 15px 0;\\n}\\nh2 {\\n    font-size: 1.4em\" +\n\";\\n    border-bottom: 1px solid #eee;\\n}\\nul,\\nol {\\n    padding-left: 20px;\\n}\\na {\\n  \" +\n\"  color: #4183c4;\\n    text-decoration: none;\\n    text-decoration: none;\\n}\\n.highl\" +\n\"ight pre,\\npre {\\n    background-color: #f8f8f8;\\n    border: 1px solid #ddd;\\n    l\" +\n\"ine-height: 19px;\\n    overflow: auto;\\n    padding: 6px 10px;\\n    border-radius: \" +\n\"3px;\\n}\\npre {\\n    word-wrap: normal;\\n}\\ndl {\\n    padding: 0;\\n}\\ndl dt {\\n    font-we\" +\n\"ight: bold;\\n    font-style: italic;\\n    padding: 0;\\n    margin-top: 15px;\\n}\\ndl d\" +\n\"d {\\n    margin-bottom: 15px;\\n    padding: 0 15px;\\n}\\ntable {\\n    width: 100%;\\n   \" +\n\" overflow: auto;\\n    display: block;\\n}\\ntable tr {\\n    border-top: 1px solid #ccc\" +\n\";\\n    background-color: #fff;\\n}\\ntable tr:nth-child(2n) {\\n    background-color: #\" +\n\"f8f8f8;\\n}\\ntable th,\\ntable td {\\n    border: 1px solid #ddd;\\n    padding: 6px 13px\" +\n\";\\n}\\ntable th {\\n    font-weight: bold;\\n}\\nimg {\\n    max-width: 100%;\\n    -moz-box-\" +\n\"sizing: border-box;\\n    box-sizing: border-box;\\n}\\nul.task-list > li.task-list-it\" +\n\"em {\\n    list-style-type: none;\\n}\\n.task-list-item-checkbox {\\n    margin-left: -2\" +\n\"0px;\\n    vertical-align: middle;\\n}\\n.btn {\\n    margin-top: 1.50em;\\n    margin-bot\" +\n\"tom: 1em;\\n    padding: 1em 2em;\\n    text-align: center;\\n    display: inline-bloc\" +\n\"k;\\n    border-radius: 15px;\\n    border: none;\\n    transform: translateY(1px);\\n  \" +\n\"  color: #fff;\\n}\\n#buy {\\n    background-color: #2ecc71;\\n    box-shadow: 0 3px #27\" +\n\"ae60;\\n}\\n#purchased {\\n    background-color: #34495e;\\n    box-shadow: 0 3px #2c3e5\" +\n\"0;\\n}\\n\");\n\nWriteLiteral(@\"@media (max-width: 640px) {\n    .btn,\n    #restore {\n        display: block;\n    }\n    #restore {\n        text-align: center;\n    }\n}\n</style>\n    <title>Pro Version</title>\n</head>\n<body>\n    <p>\n        <b>CodeHub Pro</b> gives you access the all the great features below:\n    </p>\n\n    <ul>\n        <li><a\");\n\nWriteLiteral(\" href=\\\"#private\\\"\");\n\nWriteLiteral(\">Private Repositories</a></li>\\n        <li><a\");\n\nWriteLiteral(\" href=\\\"#enterprise\\\"\");\n\nWriteLiteral(\">Enterprise Support</a></li>\\n        <li><a\");\n\nWriteLiteral(\" href=\\\"#push\\\"\");\n\nWriteLiteral(\">Push Notifications</a></li>\\n    </ul>\\n\\n    <p>\\n        Before you buy please tak\" +\n\"e a look at the detailed description for each feature below. \\n        If you\\'re \" +\n\"unsure about any aspect of the Pro version, please feel free to \\n        <a\");\n\nWriteLiteral(\" href=\\\"mailto:codehubapp@gmail.com?Subject=CodeHub%20Pro%20Question\\\"\");\n\nWriteLiteral(\" target=\\\"_blank\\\"\");\n\nWriteLiteral(\">contact me</a>!\\n    </p>\\n\\n\");\n\n\n#line 163 \"UpgradeDetailsWebView.cshtml\"\n    \n\n#line default\n#line hidden\n\n#line 163 \"UpgradeDetailsWebView.cshtml\"\n     if (Model.IsPurchased)\n    {\n\n\n#line default\n#line hidden\nWriteLiteral(\"        <p>\\n            <a\");\n\nWriteLiteral(\" id=\\\"purchased\\\"\");\n\nWriteLiteral(\" class=\\\"btn\\\"\");\n\nWriteLiteral(\">Pro Already Enabled!</a>\\n        </p>\\n\");\n\n\n#line 168 \"UpgradeDetailsWebView.cshtml\"\n    }\n    else\n    {\n        if (Model.Price != null)\n        {\n\n\n#line default\n#line hidden\nWriteLiteral(\"            <p>\\n                <a\");\n\nWriteLiteral(\" id=\\\"buy\\\"\");\n\nWriteLiteral(\" href=\\\"app://buy\\\"\");\n\nWriteLiteral(\" class=\\\"btn\\\"\");\n\nWriteLiteral(\">Purchase CodeHub Pro for \");\n\n\n#line 174 \"UpgradeDetailsWebView.cshtml\"\n                                                                             Write(Model.Price);\n\n\n#line default\n#line hidden\nWriteLiteral(\"</a>\\n            </p>\\n\");\n\nWriteLiteral(\"            <p\");\n\nWriteLiteral(\" id=\\\"restore\\\"\");\n\nWriteLiteral(\">\\n                <a\");\n\nWriteLiteral(\" href=\\\"app://restore\\\"\");\n\nWriteLiteral(\">Click here</a> to restore a previous purchase.\\n            </p>\\n\");\n\n\n#line 179 \"UpgradeDetailsWebView.cshtml\"\n        }\n    }\n\n\n#line default\n#line hidden\nWriteLiteral(\"\\n    <h2>Feature Details</h2>\\n    <p>Below are the features that are available wh\" +\n\"en purchasing CodeHub Pro.</p>\\n\\n    <h3\");\n\nWriteLiteral(\" id=\\\"private\\\"\");\n\nWriteLiteral(@\">Private Repositories</h3>\n    <p>\n        While CodeHub is free for all public projects, private repositories are only available with CodeHub Pro.\n        The Pro edition allows access to all your private repositories and any private repositories any of your organizations have.\n        Access to your private repositories is completely unrestricted. With CodeHub Pro, anything you are able to do with your open source repositories\n        you are also capable of doing with your private repositories. Even more, access to private repositories, with CodeHub Pro, is applied to\n        all your CodeHub accounts.\n    </p>\n\n    <h3\");\n\nWriteLiteral(\" id=\\\"enterprise\\\"\");\n\nWriteLiteral(@\">Enterprise Support</h3>\n    <p>\n        With CodeHub Pro, access to GitHub Enterprise instances becomes available for use. \n        Enterprise support allows for unlimited accounts, in CodeHub, accessing unlimited Enterprise instances - there are no restrictions!\n        You can authenticate with your GitHub Enterprise instance in two ways: Basic Auth, or OAuth token. Unlike authentication\n        with GitHub.com, there is no avilable web application flow, which means that you will be prompted for your credentials in a view that\n        is native to CodeHub, not GitHub. This method, also known as Basic Auth, is safe. The username and password pair is <b>NOT</b> saved on the device\n        nor is it ever sent anywhere but GitHub. Even more, the username and password is exchanged for an OAuth token on GitHub so you may revoke access\n        at any time.\n    </p>\n\n    <p>\n        If you feel unsafe authenticating with a username and password pair, you may choose to generate your own OAuth token on your enterprise instance and\n        use it in CodeHub directly. This completely removes the need to type in your username and password within CodeHub. \n    </p>\n\n    <h3\");\n\nWriteLiteral(\" id=\\\"push\\\"\");\n\nWriteLiteral(\">Push Notifications</h3>\\n    <p><b>Note: Push Notifications are only available fo\" +\n\"r GitHub.com accounts. Details below</b></p>\\n\\n    <img\");\n\nWriteLiteral(\" width=\\\"400\\\"\");\n\nWriteLiteral(\" src=\\\"http://codehub-app.com/assets/push-notification.png\\\"\");\n\nWriteLiteral(@\" />\n\n    <p>\n        Push notifications allow you to take your typical GitHub notifications and push them directly to your mobile device.\n        Users receive notifications for conversations in repositories they watch including:\n    </p>\n\n    <ul>\n        <li>Issues and their comments</li>\n        <li>Pull Requests and their comments</li>\n        <li>Comments on any commits</li>\n    </ul>\n\n    <p>Notifications are also sent for conversations in unwatched repositories when the user is involved including:</p>\n\n    <ul>\n        <li>Mentions</li>\n        <li>Issue assignments</li>\n        <li>Commits the user authors or commits</li>\n        <li>Any discussion in which the user actively participates</li>\n    </ul>\n\n    <p>\n        Notifications are generated via a service owned and operated by Dillon Buchanan, creator of CodeHub. \n        These notifications are harvested from GitHub.com using a OAuth identification token generated just for \n        querying notifications on behalf of the user. This service, aptly called CodeHub-Push, is also open source and \n        <a\");\n\nWriteLiteral(\" href=\\\"https://github.com/CodeHubApp/CodeHub-Push\\\"\");\n\nWriteLiteral(@\">available for viewing on GitHub.</a>\n    </p>\n    <p>\n        As mentioned above, push notifications are only available for GitHub.com accounts. Push notifications for \n        GitHub enterprise accounts are not available. This limitation is due to the fact that the notification service, \n        <a\");\n\nWriteLiteral(\" href=\\\"https://github.com/CodeHubApp/CodeHub-Push\\\"\");\n\nWriteLiteral(@\">CodeHub-Push</a>, cannot retrieve information from a enterprise\n        instance. External access to a enterprise instance is almost always impossible due to network limitations as well as\n        permission. For this reason, push notifications are unavailable for enterprise users - sorry.\n    </p>\n        \n</body>\n</html>\");\n\n}\n}\n\n// NOTE: this is the default generated helper class. You may choose to extract it to a separate file \n// in order to customize it or share it between multiple templates, and specify the template's base \n// class via the @inherits directive.\npublic abstract class UpgradeDetailsWebViewBase\n{\n\n\t\t// This field is OPTIONAL, but used by the default implementation of Generate, Write, WriteAttribute and WriteLiteral\n\t\t//\n\t\tSystem.IO.TextWriter __razor_writer;\n\n\t\t// This method is OPTIONAL\n\t\t//\n\t\t/// <summary>Executes the template and returns the output as a string.</summary>\n\t\t/// <returns>The template output.</returns>\n\t\tpublic string GenerateString ()\n\t\t{\n\t\t\tusing (var sw = new System.IO.StringWriter ()) {\n\t\t\t\tGenerate (sw);\n\t\t\t\treturn sw.ToString ();\n\t\t\t}\n\t\t}\n\n\t\t// This method is OPTIONAL, you may choose to implement Write and WriteLiteral without use of __razor_writer\n\t\t// and provide another means of invoking Execute.\n\t\t//\n\t\t/// <summary>Executes the template, writing to the provided text writer.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the template output.</param>\n\t\tpublic void Generate (System.IO.TextWriter writer)\n\t\t{\n\t\t\t__razor_writer = writer;\n\t\t\tExecute ();\n\t\t\t__razor_writer = null;\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the template output without HTML escaping it.</summary>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected void WriteLiteral (string value)\n\t\t{\n\t\t\t__razor_writer.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a literal value to the TextWriter without HTML escaping it.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the literal.</param>\n\t\t/// <param name=\"value\">The literal value.</param>\n\t\tprotected static void WriteLiteralTo (System.IO.TextWriter writer, string value)\n\t\t{\n\t\t\twriter.Write (value);\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes a value to the template output, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected void Write (object value)\n\t\t{\n\t\t\tWriteTo (__razor_writer, value);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>Writes an object value to the TextWriter, HTML escaping it if necessary.</summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the value.</param>\n\t\t/// <param name=\"value\">The value.</param>\n\t\t/// <remarks>The value may be a Action<System.IO.TextWriter>, as returned by Razor helpers.</remarks>\n\t\tprotected static void WriteTo (System.IO.TextWriter writer, object value)\n\t\t{\n\t\t\tif (value == null)\n\t\t\t\treturn;\n\n\t\t\tvar write = value as Action<System.IO.TextWriter>;\n\t\t\tif (write != null) {\n\t\t\t\twrite (writer);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//NOTE: a more sophisticated implementation would write safe and pre-escaped values directly to the\n\t\t\t//instead of double-escaping. See System.Web.IHtmlString in ASP.NET 4.0 for an example of this.\n\t\t\twriter.Write(System.Net.WebUtility.HtmlEncode (value.ToString ()));\n\t\t}\n\n\t\t// This method is REQUIRED, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to the template output.\n\t\t/// </summary>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\tprotected void WriteAttribute (string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\tWriteAttributeTo (__razor_writer, name, prefix, suffix, values);\n\t\t}\n\n\t\t// This method is REQUIRED if the template contains any Razor helpers, but you may choose to implement it differently\n\t\t//\n\t\t/// <summary>\n\t\t/// Conditionally writes an attribute to a TextWriter.\n\t\t/// </summary>\n\t\t/// <param name=\"writer\">The TextWriter to which to write the attribute.</param>\n\t\t/// <param name=\"name\">The name of the attribute.</param>\n\t\t/// <param name=\"prefix\">The prefix of the attribute.</param>\n\t\t/// <param name=\"suffix\">The suffix of the attribute.</param>\n\t\t/// <param name=\"values\">Attribute values, each specifying a prefix, value and whether it's a literal.</param>\n\t\t///<remarks>Used by Razor helpers to write attributes.</remarks>\n\t\tprotected static void WriteAttributeTo (System.IO.TextWriter writer, string name, string prefix, string suffix, params Tuple<string,object,bool>[] values)\n\t\t{\n\t\t\t// this is based on System.Web.WebPages.WebPageExecutingBase\n\t\t\t// Copyright (c) Microsoft Open Technologies, Inc.\n\t\t\t// Licensed under the Apache License, Version 2.0\n\t\t\tif (values.Length == 0) {\n\t\t\t\t// Explicitly empty attribute, so write the prefix and suffix\n\t\t\t\twriter.Write (prefix);\n\t\t\t\twriter.Write (suffix);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tbool first = true;\n\t\t\tbool wroteSomething = false;\n\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tTuple<string,object,bool> attrVal = values [i];\n\t\t\t\tstring attPrefix = attrVal.Item1;\n\t\t\t\tobject value = attrVal.Item2;\n\t\t\t\tbool isLiteral = attrVal.Item3;\n\n\t\t\t\tif (value == null) {\n\t\t\t\t\t// Nothing to write\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// The special cases here are that the value we're writing might already be a string, or that the \n\t\t\t\t// value might be a bool. If the value is the bool 'true' we want to write the attribute name instead\n\t\t\t\t// of the string 'true'. If the value is the bool 'false' we don't want to write anything.\n\t\t\t\t//\n\t\t\t\t// Otherwise the value is another object (perhaps an IHtmlString), and we'll ask it to format itself.\n\t\t\t\tstring stringValue;\n\t\t\t\tbool? boolValue = value as bool?;\n\t\t\t\tif (boolValue == true) {\n\t\t\t\t\tstringValue = name;\n\t\t\t\t} else if (boolValue == false) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tstringValue = value as string;\n\t\t\t\t}\n\n\t\t\t\tif (first) {\n\t\t\t\t\twriter.Write (prefix);\n\t\t\t\t\tfirst = false;\n\t\t\t\t} else {\n\t\t\t\t\twriter.Write (attPrefix);\n\t\t\t\t}\n\n\t\t\t\tif (isLiteral) {\n\t\t\t\t\twriter.Write (stringValue ?? value);\n\t\t\t\t} else {\n\t\t\t\t\tWriteTo (writer, stringValue ?? value);\n\t\t\t\t}\n\t\t\t\twroteSomething = true;\n\t\t\t}\n\t\t\tif (wroteSomething) {\n\t\t\t\twriter.Write (suffix);\n\t\t\t}\n\t\t}\n\t\t// This method is REQUIRED. The generated Razor subclass will override it with the generated code.\n\t\t//\n\t\t///<summary>Executes the template, writing output to the Write and WriteLiteral methods.</summary>.\n\t\t///<remarks>Not intended to be called directly. Call the Generate method instead.</remarks>\n\t\tpublic abstract void Execute ();\n\n}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "CodeHub/WebViews/UpgradeDetailsWebView.cshtml",
    "content": "﻿@model UpgradeDetailsModel\n<html><head>\n<meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0\"/>\n<style>\n* {\n    box-sizing: border-box;\n}\nhtml {\n    -webkit-text-size-adjust: none;\n}\nbody {\n    color: #333;\n    font-family: Helvetica, Arial, sans-serif;\n    line-height: 1.42;\n    font-size: 16px;\n    line-height: 1.7;\n    word-wrap: break-word;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n    margin: 1em 0 15px;\n    padding: 0;\n    font-weight: bold;\n    line-height: 1.7;\n    cursor: text;\n    position: relative;\n}\nh1 {\n    font-size: 1.8em;\n    border-bottom: 1px solid #ddd;\n}\np,\nblockquote,\nul,\nol,\ndl,\ntable,\npre {\n    margin: 15px 0;\n}\nh2 {\n    font-size: 1.4em;\n    border-bottom: 1px solid #eee;\n}\nul,\nol {\n    padding-left: 20px;\n}\na {\n    color: #4183c4;\n    text-decoration: none;\n    text-decoration: none;\n}\n.highlight pre,\npre {\n    background-color: #f8f8f8;\n    border: 1px solid #ddd;\n    line-height: 19px;\n    overflow: auto;\n    padding: 6px 10px;\n    border-radius: 3px;\n}\npre {\n    word-wrap: normal;\n}\ndl {\n    padding: 0;\n}\ndl dt {\n    font-weight: bold;\n    font-style: italic;\n    padding: 0;\n    margin-top: 15px;\n}\ndl dd {\n    margin-bottom: 15px;\n    padding: 0 15px;\n}\ntable {\n    width: 100%;\n    overflow: auto;\n    display: block;\n}\ntable tr {\n    border-top: 1px solid #ccc;\n    background-color: #fff;\n}\ntable tr:nth-child(2n) {\n    background-color: #f8f8f8;\n}\ntable th,\ntable td {\n    border: 1px solid #ddd;\n    padding: 6px 13px;\n}\ntable th {\n    font-weight: bold;\n}\nimg {\n    max-width: 100%;\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n}\nul.task-list > li.task-list-item {\n    list-style-type: none;\n}\n.task-list-item-checkbox {\n    margin-left: -20px;\n    vertical-align: middle;\n}\n.btn {\n    margin-top: 1.50em;\n    margin-bottom: 1em;\n    padding: 1em 2em;\n    text-align: center;\n    display: inline-block;\n    border-radius: 15px;\n    border: none;\n    transform: translateY(1px);\n    color: #fff;\n}\n#buy {\n    background-color: #2ecc71;\n    box-shadow: 0 3px #27ae60;\n}\n#purchased {\n    background-color: #34495e;\n    box-shadow: 0 3px #2c3e50;\n}\n@@media (max-width: 640px) {\n    .btn,\n    #restore {\n        display: block;\n    }\n    #restore {\n        text-align: center;\n    }\n}\n</style>\n    <title>Pro Version</title>\n</head>\n<body>\n    <p>\n        <b>CodeHub Pro</b> gives you access the all the great features below:\n    </p>\n\n    <ul>\n        <li><a href=\"#private\">Private Repositories</a></li>\n        <li><a href=\"#enterprise\">Enterprise Support</a></li>\n        <li><a href=\"#push\">Push Notifications</a></li>\n    </ul>\n\n    <p>\n        Before you buy please take a look at the detailed description for each feature below. \n        If you're unsure about any aspect of the Pro version, please feel free to \n        <a href=\"mailto:codehubapp@gmail.com?Subject=CodeHub%20Pro%20Question\" target=\"_blank\">contact me</a>!\n    </p>\n\n    @if (Model.IsPurchased)\n    {\n        <p>\n            <a id=\"purchased\" class=\"btn\">Pro Already Enabled!</a>\n        </p>\n    }\n    else\n    {\n        if (Model.Price != null)\n        {\n            <p>\n                <a id=\"buy\" href=\"app://buy\" class=\"btn\">Purchase CodeHub Pro for @Model.Price</a>\n            </p>\n            <p id=\"restore\">\n                <a href=\"app://restore\">Click here</a> to restore a previous purchase.\n            </p>\n        }\n    }\n\n    <h2>Feature Details</h2>\n    <p>Below are the features that are available when purchasing CodeHub Pro.</p>\n\n    <h3 id=\"private\">Private Repositories</h3>\n    <p>\n        While CodeHub is free for all public projects, private repositories are only available with CodeHub Pro.\n        The Pro edition allows access to all your private repositories and any private repositories any of your organizations have.\n        Access to your private repositories is completely unrestricted. With CodeHub Pro, anything you are able to do with your open source repositories\n        you are also capable of doing with your private repositories. Even more, access to private repositories, with CodeHub Pro, is applied to\n        all your CodeHub accounts.\n    </p>\n\n    <h3 id=\"enterprise\">Enterprise Support</h3>\n    <p>\n        With CodeHub Pro, access to GitHub Enterprise instances becomes available for use. \n        Enterprise support allows for unlimited accounts, in CodeHub, accessing unlimited Enterprise instances - there are no restrictions!\n        You can authenticate with your GitHub Enterprise instance in two ways: Basic Auth, or OAuth token. Unlike authentication\n        with GitHub.com, there is no avilable web application flow, which means that you will be prompted for your credentials in a view that\n        is native to CodeHub, not GitHub. This method, also known as Basic Auth, is safe. The username and password pair is <b>NOT</b> saved on the device\n        nor is it ever sent anywhere but GitHub. Even more, the username and password is exchanged for an OAuth token on GitHub so you may revoke access\n        at any time.\n    </p>\n\n    <p>\n        If you feel unsafe authenticating with a username and password pair, you may choose to generate your own OAuth token on your enterprise instance and\n        use it in CodeHub directly. This completely removes the need to type in your username and password within CodeHub. \n    </p>\n\n    <h3 id=\"push\">Push Notifications</h3>\n    <p><b>Note: Push Notifications are only available for GitHub.com accounts. Details below</b></p>\n\n    <img width=\"400\" src=\"http://codehub-app.com/assets/push-notification.png\" />\n\n    <p>\n        Push notifications allow you to take your typical GitHub notifications and push them directly to your mobile device.\n        Users receive notifications for conversations in repositories they watch including:\n    </p>\n\n    <ul>\n        <li>Issues and their comments</li>\n        <li>Pull Requests and their comments</li>\n        <li>Comments on any commits</li>\n    </ul>\n\n    <p>Notifications are also sent for conversations in unwatched repositories when the user is involved including:</p>\n\n    <ul>\n        <li>Mentions</li>\n        <li>Issue assignments</li>\n        <li>Commits the user authors or commits</li>\n        <li>Any discussion in which the user actively participates</li>\n    </ul>\n\n    <p>\n        Notifications are generated via a service owned and operated by Dillon Buchanan, creator of CodeHub. \n        These notifications are harvested from GitHub.com using a OAuth identification token generated just for \n        querying notifications on behalf of the user. This service, aptly called CodeHub-Push, is also open source and \n        <a href=\"https://github.com/CodeHubApp/CodeHub-Push\">available for viewing on GitHub.</a>\n    </p>\n    <p>\n        As mentioned above, push notifications are only available for GitHub.com accounts. Push notifications for \n        GitHub enterprise accounts are not available. This limitation is due to the fact that the notification service, \n        <a href=\"https://github.com/CodeHubApp/CodeHub-Push\">CodeHub-Push</a>, cannot retrieve information from a enterprise\n        instance. External access to a enterprise instance is almost always impossible due to network limitations as well as\n        permission. For this reason, push notifications are unavailable for enterprise users - sorry.\n    </p>\n        \n</body>\n</html>"
  },
  {
    "path": "CodeHub/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Humanizer.Core\" version=\"2.2.0\" targetFramework=\"portable45-net45+win8+wpa81\" />\n</packages>"
  },
  {
    "path": "CodeHub.Core/App.cs",
    "content": "using System.Net;\nusing MvvmCross.Core.ViewModels;\n\nnamespace CodeHub.Core\n{\n    /// <summary>\n    /// Define the App type.\n    /// </summary>\n    public class App : MvxApplication\n    {\n        /// <summary>\n        /// Initializes this instance.\n        /// </summary>\n        public override void Initialize()\n        {\n            ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/CodeHub.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProjectGuid>{B7970173-9022-466B-B57A-7AB1E1F3145F}</ProjectGuid>\r\n    <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r\n    <OutputType>Library</OutputType>\r\n    <RootNamespace>CodeHub.Core</RootNamespace>\r\n    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>\r\n    <AssemblyName>CodeHub.Core</AssemblyName>\r\n    <TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>\r\n    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\iPhone\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <MtouchDebug>true</MtouchDebug>\r\n    <CodesignKey>iPhone Developer</CodesignKey>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\iPhone\\Release</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <CodesignKey>iPhone Developer</CodesignKey>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"App.cs\" />\r\n    <Compile Include=\"Filters\\IssuesFilterModel.cs\" />\r\n    <Compile Include=\"Filters\\MyIssuesFilterModel.cs\" />\r\n    <Compile Include=\"Filters\\NotificationsFilterModel.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"Services\\ApplicationService.cs\" />\r\n    <Compile Include=\"Services\\IApplicationService.cs\" />\r\n    <Compile Include=\"ViewModels\\Accounts\\AddAccountViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Events\\OrganizationEventsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Events\\UserEventsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\MenuViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\ViewModelExtensions.cs\" />\r\n    <Compile Include=\"ViewModels\\Events\\BaseEventsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Gists\\GistsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Gists\\GistViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueMilestonesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssuesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\MyIssuesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Events\\NewsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Organizations\\OrganizationsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Organizations\\OrganizationViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\PullRequests\\PullRequestCommitsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\PullRequests\\PullRequestFilesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\PullRequests\\PullRequestsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\PullRequests\\PullRequestViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Repositories\\RepositoriesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Events\\RepositoryEventsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Repositories\\RepositoryViewModel.cs\" />\r\n    <Compile Include=\"Utils\\ViewModelExtensions.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\StartupViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\BaseIssuesViewModel.cs\" />\r\n    <Compile Include=\"Filters\\BaseIssuesFilterModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueEditViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueAddViewModel.cs\" />\r\n    <Compile Include=\"Messages\\SelectIssueLabelsMessage.cs\" />\r\n    <Compile Include=\"Messages\\SelectedMilestoneMessage.cs\" />\r\n    <Compile Include=\"Messages\\SelectedAssignedToMessage.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueAssignedToViewModel.cs\" />\r\n    <Compile Include=\"Messages\\IssueAddMessage.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueModifyViewModel.cs\" />\r\n    <Compile Include=\"Messages\\IssueEditMessage.cs\" />\r\n    <Compile Include=\"ViewModels\\Accounts\\OAuthLoginViewModel.cs\" />\r\n    <Compile Include=\"Messages\\NotificationCountMessage.cs\" />\r\n    <Compile Include=\"Services\\IPushNotificationsService.cs\" />\r\n    <Compile Include=\"ViewModels\\Source\\EditSourceViewModel.cs\" />\r\n    <Compile Include=\"Messages\\SourceEditMessage.cs\" />\r\n    <Compile Include=\"Services\\IMarkdownService.cs\" />\r\n    <Compile Include=\"Services\\IFeaturesService.cs\" />\r\n    <Compile Include=\"ViewModels\\Gists\\GistCreateViewModel.cs\" />\r\n    <Compile Include=\"Messages\\GistAddMessage.cs\" />\r\n    <Compile Include=\"ViewModels\\Changesets\\ChangesetsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Changesets\\ChangesetViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Changesets\\CommitsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Notifications\\NotificationsViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\LoadableViewModel.cs\" />\r\n    <Compile Include=\"Messages\\PullRequestEditMessage.cs\" />\r\n    <Compile Include=\"Services\\AccountsService.cs\" />\r\n    <Compile Include=\"Services\\IAccountsService.cs\" />\r\n    <Compile Include=\"Services\\IAlertDialogService.cs\" />\r\n    <Compile Include=\"Services\\IViewModelTxService.cs\" />\r\n    <Compile Include=\"Services\\ViewModelTxService.cs\" />\r\n    <Compile Include=\"Utils\\CustomObservableCollection.cs\" />\r\n    <Compile Include=\"Utils\\DateTimeExtensions.cs\" />\r\n    <Compile Include=\"Utils\\FilterGroup.cs\" />\r\n    <Compile Include=\"Utils\\RepositoryIdentifier.cs\" />\r\n    <Compile Include=\"ViewModels\\BaseViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\CollectionViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\FilterableCollectionViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\FilterGroup.cs\" />\r\n    <Compile Include=\"ViewModels\\FilterModel.cs\" />\r\n    <Compile Include=\"ViewModels\\IFilterableViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\WebBrowserViewModel.cs\" />\r\n    <Compile Include=\"PresentationValues.cs\" />\r\n    <Compile Include=\"Utils\\GitHubAvatar.cs\" />\r\n    <Compile Include=\"Utils\\GitHubExtensions.cs\" />\r\n    <Compile Include=\"Utils\\WeakReferenceExtensions.cs\" />\r\n    <Compile Include=\"Data\\Language.cs\" />\r\n    <Compile Include=\"Data\\LanguageRepository.cs\" />\r\n    <Compile Include=\"Data\\TrendingRepository.cs\" />\r\n    <Compile Include=\"Messages\\LogoutMessage.cs\" />\r\n    <Compile Include=\"Extensions\\ObservableExtensions.cs\" />\r\n    <Compile Include=\"Extensions\\TaskExtensions.cs\" />\r\n    <Compile Include=\"Extensions\\StringExtensions.cs\" />\r\n    <Compile Include=\"Extensions\\ReactiveListExtensions.cs\" />\r\n    <Compile Include=\"ViewModels\\Organizations\\TeamsViewModel.cs\" />\r\n    <Compile Include=\"Secrets.cs\" />\r\n    <Compile Include=\"Extensions\\CommandExtensions.cs\" />\r\n    <Compile Include=\"ViewModels\\Users\\UserViewModel.cs\" />\r\n    <Compile Include=\"Data\\Account.cs\" />\r\n    <Compile Include=\"Settings.cs\" />\r\n    <Compile Include=\"Services\\IMessageService.cs\" />\r\n    <Compile Include=\"Services\\MessageService.cs\" />\r\n    <Compile Include=\"ViewModels\\Repositories\\RepositoryItemViewModel.cs\" />\r\n    <Compile Include=\"Utils\\Emojis.cs\" />\r\n    <Compile Include=\"ViewModels\\ICanGoToViewModel.cs\" />\r\n    <Compile Include=\"Utils\\OctokitClientFactory.cs\" />\r\n    <Compile Include=\"Utils\\OctokitNetworkClient.cs\" />\r\n    <Compile Include=\"Services\\INetworkActivityService.cs\" />\r\n    <Compile Include=\"ViewModels\\Search\\RepositoryExploreViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Repositories\\TrendingRepositoriesViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Users\\UsersViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Users\\UserItemViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Gists\\GistItemViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Issues\\IssueLabelsViewModel.cs\" />\r\n    <Compile Include=\"Extensions\\ExceptionExtensions.cs\" />\r\n    <Compile Include=\"Services\\LoginService.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\SupportViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\FeedbackItemViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\FeedbackViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\IProvidesSearchKeyword.cs\" />\r\n    <Compile Include=\"ViewModels\\ILoadableViewModel.cs\" />\r\n    <Compile Include=\"Extensions\\GitHubClientExtensions.cs\" />\r\n    <Compile Include=\"Utils\\GitHubList.cs\" />\r\n    <Compile Include=\"ViewModels\\IListViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\App\\FeedbackComposerViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\MarkdownAccessoryViewModel.cs\" />\r\n    <Compile Include=\"Services\\IImgurService.cs\" />\r\n    <Compile Include=\"Services\\ImgurService.cs\" />\r\n    <Compile Include=\"Data\\ImgurResponse.cs\" />\r\n    <Compile Include=\"ViewModels\\Search\\UserExploreViewModel.cs\" />\r\n    <Compile Include=\"ViewModels\\Search\\ExploreViewModel.cs\" />\r\n    <Compile Include=\"Interactions.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup />\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Windows\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.Net.Http\" />\r\n    <Reference Include=\"Xamarin.iOS\" />\r\n    <Reference Include=\"System.Reactive.Interfaces\">\r\n      <HintPath>..\\packages\\Rx-Interfaces.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Interfaces.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.Core\">\r\n      <HintPath>..\\packages\\Rx-Core.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.Linq\">\r\n      <HintPath>..\\packages\\Rx-Linq.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Linq.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.PlatformServices\">\r\n      <HintPath>..\\packages\\Rx-PlatformServices.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.PlatformServices.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Splat\">\r\n      <HintPath>..\\packages\\Splat.1.6.2\\lib\\Xamarin.iOS10\\Splat.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"GitHubSharp\">\r\n      <HintPath>..\\packages\\GitHubClient.1.0.15\\lib\\portable45-net45+win8+wpa81\\GitHubSharp.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"PCLStorage\">\r\n      <HintPath>..\\packages\\PCLStorage.1.0.2\\lib\\portable-Xamarin.iOS+Xamarin.Mac\\PCLStorage.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"PCLStorage.Abstractions\">\r\n      <HintPath>..\\packages\\PCLStorage.1.0.2\\lib\\portable-Xamarin.iOS+Xamarin.Mac\\PCLStorage.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Akavache\">\r\n      <HintPath>..\\packages\\akavache.core.5.0.0\\lib\\Xamarin.iOS10\\Akavache.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Akavache.Sqlite3\">\r\n      <HintPath>..\\packages\\akavache.sqlite3.5.0.0\\lib\\Portable-Net45+Win8+WP8+Wpa81\\Akavache.Sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Platform\">\r\n      <HintPath>..\\packages\\MvvmCross.Platform.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Platform.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Platform.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Platform.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Platform.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Core\">\r\n      <HintPath>..\\packages\\MvvmCross.Core.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Core.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Binding\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Binding.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Binding.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Binding.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Localization\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Localization.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Net.Http.Extensions\">\r\n      <HintPath>..\\packages\\Microsoft.Net.Http.2.2.29\\lib\\Xamarin.iOS10\\System.Net.Http.Extensions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Net.Http.Primitives\">\r\n      <HintPath>..\\packages\\Microsoft.Net.Http.2.2.29\\lib\\Xamarin.iOS10\\System.Net.Http.Primitives.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Humanizer\">\r\n      <HintPath>..\\packages\\Humanizer.Core.2.2.0\\lib\\netstandard1.0\\Humanizer.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"ReactiveUI\">\r\n      <HintPath>..\\packages\\reactiveui-core.7.4.0\\lib\\Xamarin.iOS10\\ReactiveUI.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.CSharp\" />\r\n    <Reference Include=\"Newtonsoft.Json\">\r\n      <HintPath>..\\packages\\Newtonsoft.Json.10.0.3\\lib\\netstandard1.3\\Newtonsoft.Json.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.core\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.core.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.lib.e_sqlite3\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.lib.e_sqlite3.ios_unified.static.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.lib.e_sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.provider.internal\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.provider.internal.ios_unified.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.provider.internal.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.batteries_e_sqlite3\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.bundle_e_sqlite3.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.batteries_e_sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.batteries_v2\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.bundle_e_sqlite3.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.batteries_v2.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Settings.Abstractions\">\r\n      <HintPath>..\\packages\\Xam.Plugins.Settings.3.1.1\\lib\\Xamarin.iOS10\\Plugin.Settings.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Settings\">\r\n      <HintPath>..\\packages\\Xam.Plugins.Settings.3.1.1\\lib\\Xamarin.iOS10\\Plugin.Settings.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Octokit\">\r\n      <HintPath>..\\packages\\Octokit.0.29.0\\lib\\netstandard1.1\\Octokit.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Permissions.Abstractions\">\r\n      <HintPath>..\\packages\\Plugin.Permissions.2.2.1\\lib\\Xamarin.iOS10\\Plugin.Permissions.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Permissions\">\r\n      <HintPath>..\\packages\\Plugin.Permissions.2.2.1\\lib\\Xamarin.iOS10\\Plugin.Permissions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Media.Abstractions\">\r\n      <HintPath>..\\packages\\Xam.Plugin.Media.3.1.3\\lib\\Xamarin.iOS10\\Plugin.Media.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Media\">\r\n      <HintPath>..\\packages\\Xam.Plugin.Media.3.1.3\\lib\\Xamarin.iOS10\\Plugin.Media.dll</HintPath>\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup />\r\n  <ItemGroup>\r\n    <Folder Include=\"ViewModels\\Changesets\\\" />\r\n    <Folder Include=\"ViewModels\\Notifications\\\" />\r\n    <Folder Include=\"Extensions\\\" />\r\n    <Folder Include=\"ViewModels\\Search\\\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"packages.config\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.CSharp.targets\" />\r\n  <Import Project=\"..\\packages\\SQLitePCL.raw_basic.0.8.6\\build\\Xamarin.iOS10\\SQLitePCL.raw_basic.targets\" Condition=\"Exists('..\\packages\\SQLitePCL.raw_basic.0.8.6\\build\\Xamarin.iOS10\\SQLitePCL.raw_basic.targets')\" />\r\n  <Import Project=\"..\\packages\\Microsoft.Bcl.Build.1.0.21\\build\\Microsoft.Bcl.Build.targets\" Condition=\"Exists('..\\packages\\Microsoft.Bcl.Build.1.0.21\\build\\Microsoft.Bcl.Build.targets')\" />\r\n  <Import Project=\"..\\packages\\NETStandard.Library.2.0.1\\build\\netstandard2.0\\NETStandard.Library.targets\" Condition=\"Exists('..\\packages\\NETStandard.Library.2.0.1\\build\\netstandard2.0\\NETStandard.Library.targets')\" />\r\n</Project>"
  },
  {
    "path": "CodeHub.Core/Data/Account.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace CodeHub.Core.Data\n{\n    public class Account\n    {\n        public string Id => Username + Domain;\n\n        public string OAuth { get; set; }\n\n        public string Password { get; set; }\n\n        public string Domain { get; set; }\n\n        public string WebDomain { get; set; }\n\n        public bool IsEnterprise { get; set; }\n\n        public bool ShowOrganizationsInEvents { get; set; } = true;\n\n        public bool ExpandOrganizations { get; set; } = true;\n\n        public bool ShowRepositoryDescriptionInList { get; set; } = true;\n\n        public bool? IsPushNotificationsEnabled { get; set; }\n\n        public string Username { get; set; }\n\n        public string AvatarUrl { get; set; }\n\n        public string DefaultStartupView { get; set; }\n\n        public string CodeEditTheme { get; set; } = \"idea\";\n\n        private List<PinnedRepository> _pinnedRepositories = new List<PinnedRepository>();\n        public List<PinnedRepository> PinnedRepositories\n        {\n            get { return _pinnedRepositories ?? new List<PinnedRepository>(); }\n            set { _pinnedRepositories = value ?? new List<PinnedRepository>(); }\n        }\n\n        private Dictionary<string, Filter> _filters = new Dictionary<string, Filter>();\n        public Dictionary<string, Filter> Filters\n        {\n            get { return _filters ?? new Dictionary<string, Filter>(); }\n            set { _filters = value ?? new Dictionary<string, Filter>(); }\n        }\n    }\n\n    public static class AccountExtensions\n    {\n        public static T GetFilter<T>(this Account account, string key) where T : class, new()\n        {\n            Filter filter = null;\n            if (account.Filters?.TryGetValue(key, out filter) == false)\n                return default(T);\n            return filter?.GetData<T>() ?? new T();\n        }\n\n        public static void SetFilter(this Account account, string key, object filter)\n        {\n            var f = new Filter();\n            f.SetData(filter);\n            if (account.Filters == null)\n                account.Filters = new Dictionary<string, Filter>();\n            account.Filters[key] = f;\n        }\n    }\n\n    public class PinnedRepository\n    {\n        public string Owner { get; set; }\n\n        public string Slug { get; set; }\n\n        public string Name { get; set; }\n\n        public string ImageUri { get; set; }\n    }\n\n    public class Filter\n    {\n        public string RawData { get; set; }\n    }\n\n    public static class FilterExtensions\n    {\n        public static T GetData<T>(this Filter filter) where T : new()\n        {\n            try\n            {\n                return JsonConvert.DeserializeObject<T>(filter.RawData);\n            }\n            catch\n            {\n                return default(T);\n            }\n        }\n\n        public static void SetData(this Filter filter, object o)\n        {\n            filter.RawData = JsonConvert.SerializeObject(o);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Data/ImgurResponse.cs",
    "content": "﻿namespace CodeHub.Core.Data\n{\n    public class ImgurResponse\n    {\n        public ImgurDataModel Data { get; set; }\n\n        public bool Success { get; set; }\n\n        public class ImgurDataModel\n        {\n            public string Link { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Data/Language.cs",
    "content": "using System.Diagnostics;\n\nnamespace CodeHub.Core.Data\n{\n    [DebuggerDisplay(\"{Name}\")]\n    public class Language\n    {\n        public Language() { }\n\n        public Language(string name, string slug)\n        {\n            Name = name;\n            Slug = slug;\n        }\n\n        public string Name { get; set; }\n\n        public string Slug { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            if (obj == null)\n                return false;\n            if (ReferenceEquals(this, obj))\n                return true;\n            if (obj.GetType() != typeof(Language))\n                return false;\n            var other = (Language)obj;\n            return Name == other.Name && Slug == other.Slug;\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return (Name != null ? Name.GetHashCode() : 0) ^ (Slug != null ? Slug.GetHashCode() : 0);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Data/LanguageRepository.cs",
    "content": "﻿using System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Net.Http;\nusing GitHubSharp;\n\nnamespace CodeHub.Core.Data\n{\n    public class LanguageRepository\n    {\n        public static Language DefaultLanguage = new Language(\"All Languages\", null);\n        private const string LanguagesUrl = \"http://trending.codehub-app.com/v2/languages\";\n\n        public async Task<List<Language>> GetLanguages()\n        {\n            var client = new HttpClient();\n            var serializer = new SimpleJsonSerializer();\n            var msg = await client.GetAsync(LanguagesUrl).ConfigureAwait(false);\n            var content = await msg.Content.ReadAsStringAsync().ConfigureAwait(false);\n            return serializer.Deserialize<List<Language>>(content);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Data/TrendingRepository.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Net.Http;\n\nnamespace CodeHub.Core.Data\n{\n    public interface ITrendingRepository\n    {\n        Task<IList<Octokit.Repository>> GetTrendingRepositories(string since, string language = null);\n    }\n\n    public class TrendingRepository : ITrendingRepository\n    {\n        private const string TrendingUrl = \"http://trending.codehub-app.com/v2/trending\";\n\n        public async Task<IList<Octokit.Repository>> GetTrendingRepositories(string since, string language = null)\n        {\n            var query = \"?since=\" + Uri.EscapeDataString(since);\n            if (!string.IsNullOrEmpty(language))\n                query += string.Format(\"&language={0}\", Uri.EscapeDataString(language));\n\n            var client = new HttpClient();\n            var serializer = new Octokit.Internal.SimpleJsonSerializer();\n            var msg = await client.GetAsync(TrendingUrl + query).ConfigureAwait(false);\n            var content = await msg.Content.ReadAsStringAsync().ConfigureAwait(false);\n            return serializer.Deserialize<List<Octokit.Repository>>(content);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Extensions/CommandExtensions.cs",
    "content": "using System;\nusing System.Reactive.Linq;\n\n// ReSharper disable once CheckNamespace\nnamespace ReactiveUI\n{\n    public static class ReactiveCommandExtensions\n    {\n        public static IDisposable ExecuteNow<TParam, TResult>(\n            this ReactiveCommand<TParam, TResult> cmd, TParam param = default(TParam))\n            => cmd.CanExecute.Take(1).Where(x => x).Select(_ => param).InvokeReactiveCommand(cmd);\n\n        public static IDisposable InvokeReactiveCommand<TParam, TResult>(\n            this IObservable<TParam> obs, ReactiveCommand<TParam, TResult> cmd)\n            => obs.InvokeCommand(cmd);\n\n        public static IDisposable InvokeReactiveCommand<TParam, TResult>(\n            this IObservable<TParam> obs, CombinedReactiveCommand<TParam, TResult> cmd)\n            => obs.InvokeCommand(cmd);\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Extensions/ExceptionExtensions.cs",
    "content": "﻿namespace System\n{\n    public static class ExceptionExtensions\n    {\n        public static Exception GetInnerException(this Exception This)\n        {\n            var ex = This;\n            while (ex.InnerException != null)\n                ex = ex.InnerException;\n            return ex;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Extensions/GitHubClientExtensions.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing CodeHub.Core.Utils;\n\nnamespace Octokit\n{\n    public static class GitHubClientExtensions\n    {\n        public static GitHubList<T> RetrieveList<T>(\r\n            this GitHubClient client,\n            Uri uri,\r\n            IDictionary<string, string> parameters = null)\n        {\r\n            return new GitHubList<T>(client, uri, parameters);\r\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Extensions/ObservableExtensions.cs",
    "content": "﻿// Analysis disable once CheckNamespace\nnamespace System\n{\n    using System;\n    using System.Windows.Input;\n    using System.Reactive.Disposables;\n    using System.Reactive.Linq;\n\n    public static class ObservableExtensions\n    {\n        public static IDisposable BindCommand<T>(this IObservable<T> @this, ICommand command)\n        {\n            return command == null ? Disposable.Empty : @this.Where(x => command.CanExecute(x)).Subscribe(x => command.Execute(x));\n        }\n\n        public static IDisposable SubscribeError<T>(this IObservable<T> @this, Action<Exception> onError)\n        {\n            return @this.Subscribe(_ => { }, onError);\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Extensions/ReactiveListExtensions.cs",
    "content": "using System.Collections.Generic;\n\n// ReSharper disable once CheckNamespace\nnamespace ReactiveUI\n{\n    public static class ReactiveListExtensions\n    {\n        public static void Reset<T>(this IReactiveList<T> @this, IEnumerable<T> items)\n        {\n            using (@this.SuppressChangeNotifications())\n            {\n                @this.Clear();\n                @this.AddRange(items);\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Extensions/StringExtensions.cs",
    "content": "﻿// Analysis disable once CheckNamespace\nnamespace System\n{\n    public static class StringExtensions\n    {\n        public static bool ContainsKeyword(this string @this, string keyword)\n        {\n            if (string.IsNullOrEmpty(keyword))\n                return true;\n            if (string.IsNullOrEmpty(@this))\n                return false;\n            return @this.IndexOf(keyword, StringComparison.OrdinalIgnoreCase) >= 0;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Extensions/TaskExtensions.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Reactive.Threading.Tasks;\nusing System.Reactive.Linq;\nusing ReactiveUI;\n\n// Analysis disable once CheckNamespace\npublic static class TaskExtensions\n{\n    public static Task<T> WithTimeout<T>(this Task<T> task, TimeSpan timeout)\n    {\n        return task.ToObservable().Timeout(timeout).ToTask();\n    }\n\n    public static Task WithTimeout(this Task task, TimeSpan timeout)\n    {\n        return task.ToObservable().Timeout(timeout).ToTask();\n    }\n\n    public static IDisposable ToBackground<T>(this Task<T> task, Action<T> action)\n    {\n        return task.ToObservable()\n            .ObserveOn(RxApp.MainThreadScheduler)\n            .Subscribe(action, HandleError);\n    }\n\n    public static IDisposable ToBackground<T>(this Task<T> task)\n    {\n        return task.ToObservable()\n            .Subscribe(a => {}, HandleError);\n    }\n\n    public static IDisposable ToBackground(this Task task)\n    {\n        return task.ToObservable()\n            .Subscribe(a => {}, HandleError);\n    }\n\n    public static IDisposable ToBackground(this Task task, Action action)\n    {\n        return task.ToObservable()\n            .ObserveOn(RxApp.MainThreadScheduler)\n            .Subscribe(_ => action(), HandleError);\n    }\n\n    private static void HandleError(Exception e)\n    {\n        System.Diagnostics.Debug.WriteLine(\"Unable to process background task: \" + e.Message);\n    }\n}\n\n\n"
  },
  {
    "path": "CodeHub.Core/Filters/BaseIssuesFilterModel.cs",
    "content": "using CodeHub.Core.ViewModels;\n\nnamespace CodeHub.Core.Filters\n{\n    public abstract class BaseIssuesFilterModel<T> : FilterModel<T>\n    {\n        public bool Ascending { get; set; }\n\n        public Sort SortType { get; set; }\r\n\r\n        protected BaseIssuesFilterModel()\n        {\n            SortType = Sort.None;\n            Ascending = false;\n        }\n\n        public enum Sort\r\n        {\n            None,\n            Created,\n            Updated,\n            Comments\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Filters/IssuesFilterModel.cs",
    "content": "using System;\r\n\r\nnamespace CodeHub.Core.Filters\n{\n    public class IssuesFilterModel : BaseIssuesFilterModel<IssuesFilterModel>\n    {\n        public string Labels { get; set; }\n\n        public bool Open { get; set; }\n\n        public DateTime? Since { get; set; }\n\n        public string Mentioned { get; set; }\n\n        public string Creator { get; set; }\n\n        public string Assignee { get; set; }\n\n        public MilestoneKeyValue Milestone { get; set; }\n\n        public class MilestoneKeyValue\n        {\n            public string Name { get; set; }\n            public bool IsMilestone { get; set; }\n            public string Value { get; set; }\n        }\n\n        public IssuesFilterModel()\n        {\n            Ascending = false;\n            Open = true;\n        }\n\n        /// <summary>\n        /// Predefined 'Open' filter\n        /// </summary>\n        public static IssuesFilterModel CreateOpenFilter()\n        {\n            return new IssuesFilterModel { Open = true };\n        }\n\n        /// <summary>\n        /// Predefined 'Closed' filter\n        /// </summary>\n        public static IssuesFilterModel CreateClosedFilter()\n        {\n            return new IssuesFilterModel { Open = false };\n        }\n\n        /// <summary>\n        /// Predefined 'Mine' filter\n        /// </summary>\n        /// <returns>The mine filter.</returns>\n        /// <param name=\"username\">Username.</param>\n        public static IssuesFilterModel CreateMineFilter(string username)\n        {\n            return new IssuesFilterModel { Assignee = username, Open = true };\n        }\n\n        public override IssuesFilterModel Clone()\n        {\n            return (IssuesFilterModel)this.MemberwiseClone();\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (obj == null)\n                return false;\n            if (ReferenceEquals(this, obj))\n                return true;\n            if (obj.GetType() != typeof(IssuesFilterModel))\n                return false;\n            var other = (IssuesFilterModel)obj;\n            return Ascending == other.Ascending && Labels == other.Labels && Open == other.Open && Since == other.Since && SortType == other.SortType && Mentioned == other.Mentioned && Creator == other.Creator && Assignee == other.Assignee && Milestone == other.Milestone;\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return Ascending.GetHashCode() ^ (Labels != null ? Labels.GetHashCode() : 0) ^ Open.GetHashCode() ^ Since.GetHashCode() ^ SortType.GetHashCode() ^ (Mentioned != null ? Mentioned.GetHashCode() : 0) ^ (Creator != null ? Creator.GetHashCode() : 0) ^ (Assignee != null ? Assignee.GetHashCode() : 0) ^ (Milestone != null ? Milestone.GetHashCode() : 0);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Filters/MyIssuesFilterModel.cs",
    "content": "using System;\r\nusing System.ComponentModel;\r\n\r\nnamespace CodeHub.Core.Filters\n{\n    public class MyIssuesFilterModel : BaseIssuesFilterModel<MyIssuesFilterModel>\n    {\n        public string Labels { get; set; }\n\n        public Filter FilterType { get; set; }\n\n        public bool Open { get; set; }\n\n        public DateTime? Since { get; set; }\n\n        public MyIssuesFilterModel()\n        {\n            Open = true;\n            FilterType = Filter.All;\n        }\n\n        /// <summary>\n        /// Predefined 'Open' filter\n        /// </summary>\n        public static MyIssuesFilterModel CreateOpenFilter()\n        {\n            return new MyIssuesFilterModel { FilterType = Filter.All, Open = true };\n        }\n\n        /// <summary>\n        /// Predefined 'Closed' filter\n        /// </summary>\n        public static MyIssuesFilterModel CreateClosedFilter()\n        {\n            return new MyIssuesFilterModel { FilterType = Filter.All, Open = false };\n        }\n\n        public override MyIssuesFilterModel Clone()\n        {\n            return (MyIssuesFilterModel)this.MemberwiseClone();\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (obj == null)\n                return false;\n            if (ReferenceEquals(this, obj))\n                return true;\n            if (obj.GetType() != typeof(MyIssuesFilterModel))\n                return false;\n            var other = (MyIssuesFilterModel)obj;\n            return Ascending == other.Ascending && Labels == other.Labels && FilterType == other.FilterType && Open == other.Open && Since == other.Since && SortType == other.SortType;\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return Ascending.GetHashCode() ^ (Labels != null ? Labels.GetHashCode() : 0) ^ FilterType.GetHashCode() ^ Open.GetHashCode() ^ Since.GetHashCode() ^ SortType.GetHashCode();\n            }\n        }\n        \n        public enum Filter\r\n        {\n            [Description(\"Assigned To You\")]\n            Assigned,\n            [Description(\"Created By You\")]\n            Created,\n            [Description(\"Mentioning You\")]\n            Mentioned,\n            [Description(\"Issues Subscribed To\")]\n            Subscribed,\n            All\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Filters/NotificationsFilterModel.cs",
    "content": "using CodeHub.Core.ViewModels;\r\n\r\nnamespace CodeHub.Core.Filters\n{\n    public class NotificationsFilterModel : FilterModel<NotificationsFilterModel>\n    {\n        public bool All { get; set; }\n\n        public bool Participating { get; set; }\n\n        public NotificationsFilterModel()\n        {\n            All = false;\n            Participating = false;\n        }\n\n        public override bool Equals(object obj)\n        {\n            if (obj == null)\n                return false;\n            if (ReferenceEquals(this, obj))\n                return true;\n            if (obj.GetType() != typeof(NotificationsFilterModel))\n                return false;\n            var other = (NotificationsFilterModel)obj;\n            return All == other.All && Participating == other.Participating;\n        }\n        \n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                return All.GetHashCode() ^ Participating.GetHashCode();\n            }\n        }\n\n        public override NotificationsFilterModel Clone()\n        {\n            return (NotificationsFilterModel)this.MemberwiseClone();\n        }\n\n        public static NotificationsFilterModel CreateUnreadFilter()\n        {\n            return new NotificationsFilterModel { All = false, Participating = false };\n        }\n\n        public static NotificationsFilterModel CreateParticipatingFilter()\n        {\n            return new NotificationsFilterModel { All = false, Participating = true };\n        }\n\n        public static NotificationsFilterModel CreateAllFilter()\n        {\n            return new NotificationsFilterModel { All = true, Participating = false };\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Interactions.cs",
    "content": "﻿using System;\r\nusing System.Reactive;\nusing System.Threading.Tasks;\nusing ReactiveUI;\n\nnamespace CodeHub.Core\n{\r\n    public class UserError\r\n    {\n        public string Title { get; }\r\n        public string Message { get; }\n\n        public UserError(string message, Exception exception = null)\n            : this(\"Error\", message, exception)\n        {\n        }\n        \r\n        public UserError(string title, string message, Exception exception = null)\r\n        {\n            Title = title;\r\n            Message = exception == null ? message : $\"{message} {ExceptionMessage(exception)}\";\r\n        }\r\n\r\n        private static string ExceptionMessage(Exception exception)\r\n        {\r\n            if (exception is TaskCanceledException)\r\n                return \"The request timed out waiting for the server to respond.\";\r\n            else\r\n                return exception?.Message;\r\n        }\r\n    }\r\n\n    public static class Interactions\n    {\n        public static readonly Interaction<UserError, Unit> Errors = new Interaction<UserError, Unit>();\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Messages/GistAddMessage.cs",
    "content": "namespace CodeHub.Core.Messages\n{\n    public class GistAddMessage\n    {\n        public Octokit.Gist Gist { get; }\n\n        public GistAddMessage(Octokit.Gist gist)\n        {\n            Gist = gist;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/IssueAddMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class IssueAddMessage\n    {\n        public IssueModel Issue { get; }\n\n        public IssueAddMessage(IssueModel issue)\n        {\n            Issue = issue;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/IssueEditMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class IssueEditMessage\n    {\n        public IssueModel Issue { get; }\n\n        public IssueEditMessage(IssueModel issue)\n        {\n            Issue = issue;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/LogoutMessage.cs",
    "content": "﻿namespace CodeHub.Core.Messages\n{\n    public class LogoutMessage\n    {\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/NotificationCountMessage.cs",
    "content": "namespace CodeHub.Core.Messages\n{\n    public class NotificationCountMessage\n    {\n        public int Count { get; }\n\n        public NotificationCountMessage(int count)\n        {\n            Count = count;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/PullRequestEditMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class PullRequestEditMessage\n    {\n        public PullRequestModel PullRequest { get; }\n\n        public PullRequestEditMessage(PullRequestModel pullRequest)\n        {\n            PullRequest = pullRequest;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/SelectIssueLabelsMessage.cs",
    "content": "using System.Collections.Generic;\r\nusing System.Linq;\nusing GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class SelectIssueLabelsMessage\n    {\n        public LabelModel[] Labels { get; }\n\n        public SelectIssueLabelsMessage(IEnumerable<LabelModel> labels)\n        {\n            Labels = labels.ToArray();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/SelectedAssignedToMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class SelectedAssignedToMessage\n    {\n        public BasicUserModel User { get; }\n\n        public SelectedAssignedToMessage(BasicUserModel user)\n        {\n            User = user;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/SelectedMilestoneMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class SelectedMilestoneMessage\n    {\n        public MilestoneModel Milestone { get; }\n\n        public SelectedMilestoneMessage(MilestoneModel milestone)\n        {\n            Milestone = milestone;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Messages/SourceEditMessage.cs",
    "content": "using GitHubSharp.Models;\n\nnamespace CodeHub.Core.Messages\n{\n    public class SourceEditMessage\n    {\n        public string OldSha;\n        public string Data;\n        public ContentUpdateModel Update;\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/PresentationValues.cs",
    "content": "namespace CodeHub.Core\r\n{\r\n    public class PresentationValues\r\n    {\r\n        /// <summary>\r\n        /// Some sort of presentation value to indicate the view that we're switching to belongs at the root of the slideout\r\n        /// </summary>\r\n        public const string SlideoutRootPresentation = \"__Slideout_Root_Presentation__\";\r\n    }\r\n}\r\n"
  },
  {
    "path": "CodeHub.Core/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"CodeHub.Core\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"CodeHub.Core\")]\r\n[assembly: AssemblyCopyright(\"Copyright ©  2013\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components.  If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"71b12732-c50c-4058-91d9-0be37f71af21\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n//      Major Version\r\n//      Minor Version \r\n//      Build Number\r\n//      Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n"
  },
  {
    "path": "CodeHub.Core/Secrets.cs",
    "content": "﻿using System;\n\nnamespace CodeHub.Core\n{\n    public static class Secrets\n    {\n        public static string GithubOAuthId\n        {\n            get { throw new InvalidOperationException(\"You must get your own Key\"); }\n        }\n\n        public static string GithubOAuthSecret\n        {\n            get { throw new InvalidOperationException(\"You must get your own Secret\"); }\n        }\n\n        public static string ErrorReportingKey\n        {\n            get { throw new InvalidOperationException(\"You must have a valid error reporting key\"); }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Services/AccountsService.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Reactive.Threading.Tasks;\nusing System.Threading.Tasks;\nusing Akavache;\nusing CodeHub.Core.Data;\n\nnamespace CodeHub.Core.Services\n{\n    public class AccountsService : IAccountsService\n    {\n        public Task<Account> GetActiveAccount() \n            => Get(Settings.DefaultAccount);\n\n        public Task SetActiveAccount(Account account)\n        {\n            Settings.DefaultAccount = account == null ? null : GetKey(account);\n            return Task.FromResult(false);\n        }\n\n        public Task<IEnumerable<Account>> GetAccounts()\n            => BlobCache.UserAccount.GetAllObjects<Account>()\n                        .Select(x => x.OrderBy(y => y.Username).AsEnumerable())\n                        .ToTask();\n\n        public Task Save(Account account)\n            => BlobCache.UserAccount.InsertObject(GetKey(account), account).ToTask();\n\n        public Task Remove(Account account)\n            => BlobCache.UserAccount.Invalidate(GetKey(account)).ToTask();\n\n        public Task<Account> Get(string domain, string username) => Get(GetKey(username, domain));\n\n        public Task<Account> Get(string key)\n            => BlobCache.UserAccount.GetObject<Account>(key)\n                        .Catch(Observable.Return<Account>(null))\n                        .ToTask();\n\n        private string GetKey(Account account) \n            => GetKey(account.Username, account.Domain);\n\n        private string GetKey(string username, string domain) \n            => \"account_\" + username + domain;\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Services/ApplicationService.cs",
    "content": "using CodeHub.Core.Data;\nusing GitHubSharp;\nusing System;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.Core.Services\n{\n    public class ApplicationService : IApplicationService\n    {\n        private readonly IAccountsService _accountsService;\n\n        public Client Client { get; private set; }\n\n        public Octokit.GitHubClient GitHubClient { get; private set; }\n\n        public Account Account { get; private set; }\n\n        public Action ActivationAction { get; set; }\n\n        public ApplicationService(IAccountsService accountsService)\n        {\n            _accountsService = accountsService;\n        }\n\n        public void DeactivateUser()\n        {\n            _accountsService.SetActiveAccount(null).Wait();\n            Account = null;\n            Client = null;\n        }\n\n        public void SetUserActivationAction(Action action)\n        {\n            if (Account != null)\n                action();\n            else\n                ActivationAction = action;\n        }\n\n        public Task UpdateActiveAccount() => _accountsService.Save(Account);\n\n        public async Task LoginAccount(Account account)\n        {\n            var domain = account.Domain ?? Client.DefaultApi;\n            Client client = null;\n            Octokit.Credentials credentials = null;\n\n            if (!string.IsNullOrEmpty(account.OAuth))\n            {\n                client = Client.BasicOAuth(account.OAuth, domain);\n                credentials = new Octokit.Credentials(account.OAuth);\n            }\n            else if (account.IsEnterprise || !string.IsNullOrEmpty(account.Password))\n            {\n                client = Client.Basic(account.Username, account.Password, domain);\n                credentials = new Octokit.Credentials(account.Username, account.Password);\n            }\n\n            var octoClient = OctokitClientFactory.Create(new Uri(domain), credentials);\n            var user = await octoClient.User.Current();\n            account.Username = user.Login;\n            account.AvatarUrl = user.AvatarUrl;\n            client.Username = user.Login;\n\n            await _accountsService.Save(account);\n            await _accountsService.SetActiveAccount(account);\n\n            Account = account;\n            Client = client;\n            GitHubClient = octoClient;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Services/IAccountsService.cs",
    "content": "using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Data;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IAccountsService\n    {\n        Task<Account> GetActiveAccount();\n\n        Task SetActiveAccount(Account account);\n\n        Task<IEnumerable<Account>> GetAccounts();\n\n        Task Save(Account account);\n\n        Task Remove(Account account);\n\n        Task<Account> Get(string domain, string username);\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Services/IAlertDialogService.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing System.Reactive.Disposables;\nusing ReactiveUI;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IAlertDialogService\n    {\n        Task<bool> PromptYesNo(string title, string message);\n\n        Task Alert(string title, string message);\n\n        Task<string> PromptTextBox(string title, string message, string defaultValue, string okTitle);\n\n        void Show(string text);\n\n        void Hide();\n    }\n\n    public static class AlertDialogServiceExtensions\n    {\n        public static IDisposable Activate(this IAlertDialogService @this, string text)\n        {\n            @this.Show(text);\n            return Disposable.Create(@this.Hide);\n        }\n\n        public static IDisposable Activate(this IAlertDialogService @this, IObservable<bool> observable, string text)\n        {\n            return observable.Subscribe(x =>\n            {\n                if (x)\n                    @this.Show(text);\n                else\n                    @this.Hide();\n            });\n        }\n\n        public static IDisposable Activate(this IAlertDialogService @this, ReactiveCommand command, string text)\n        {\n            return command.IsExecuting.Subscribe(x =>\n            {\n                if (x)\n                    @this.Show(text);\n                else\n                    @this.Hide();\n            });\n        }\n\n        public static IDisposable AlertExecuting(this ReactiveCommand @this, IAlertDialogService dialogFactory, string text)\n        {\n            return @this.IsExecuting.Subscribe(x =>\n            {\n                if (x)\n                    dialogFactory.Show(text);\n                else\n                    dialogFactory.Hide();\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/IApplicationService.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Data;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IApplicationService\n    {\n        GitHubSharp.Client Client { get; }\n\n        Octokit.GitHubClient GitHubClient { get; }\n \n        Account Account { get; }\n\n        Task UpdateActiveAccount();\n\n        void DeactivateUser();\n\n        void SetUserActivationAction(Action action);\n\n        Action ActivationAction { get; set; }\n\n        Task LoginAccount(Account account);\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Services/IFeaturesService.cs",
    "content": "using System.Threading.Tasks;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IFeaturesService\n    {\n        bool IsProEnabled { get; }\n\n        void ActivateProDirect();\n\n        Task ActivatePro();\n\n        Task RestorePro();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/IImgurService.cs",
    "content": "﻿using System.Threading.Tasks;\nusing CodeHub.Core.Data;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IImgurService\n    {\n        Task<ImgurResponse> SendImage(byte[] data);\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/IMarkdownService.cs",
    "content": "using System.Threading.Tasks;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IMarkdownService\n    {\n        Task<string> Convert(string s);\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/IMessageService.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IMessageService\n    {\n        void Send<T>(T message);\n\n        IDisposable Listen<T>(Action<T> action);\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Services/INetworkActivityService.cs",
    "content": "﻿using System;\nusing System.Reactive.Disposables;\n\nnamespace CodeHub.Core.Services\n{\n    public interface INetworkActivityService\n    {\n        void PushNetworkActive();\n\n        void PopNetworkActive();\n    }\n\n    public static class NetworkActivityServiceExtensions\n    {\n        public static IDisposable ActivateNetwork(this INetworkActivityService @this)\n        {\n            @this.PushNetworkActive();\n            return Disposable.Create(@this.PopNetworkActive);\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Services/IPushNotificationsService.cs",
    "content": "using System.Threading.Tasks;\n\nnamespace CodeHub.Core.Services\n{\n    public interface IPushNotificationsService\n    {\n        Task Register();\n\n        Task Deregister();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/IViewModelTxService.cs",
    "content": "namespace CodeHub.Core.Services\n{\n    public interface IViewModelTxService\n    {\n        void Add(object obj);\n\n        object Get();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/ImgurService.cs",
    "content": "﻿using System;\nusing System.Threading.Tasks;\nusing System.Net.Http;\nusing Newtonsoft.Json;\nusing CodeHub.Core.Data;\n\nnamespace CodeHub.Core.Services\n{\n    public class ImgurService : IImgurService\n    {\n        private const string AuthorizationClientId = \"4d2779fd2cc56cb\";\n        private const string ImgurPostUrl = \"https://api.imgur.com/3/image\";\n\n        public async Task<ImgurResponse> SendImage(byte[] data)\n        {\n            var client = new HttpClient();\n            client.Timeout = new TimeSpan(0, 0, 30);\n            client.DefaultRequestHeaders.Add(\"Authorization\", \"Client-ID \" + AuthorizationClientId);\n            var body = JsonConvert.SerializeObject(new { image = Convert.ToBase64String(data) });\n            var content = new StringContent(body, System.Text.Encoding.UTF8, \"application/json\");\n            var response = await client.PostAsync(ImgurPostUrl, content).ConfigureAwait(false);\n            if (!response.IsSuccessStatusCode)\n                throw new InvalidOperationException(\"Unable to post to Imgur! \" + response.ReasonPhrase);\n            var responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false);\n            return JsonConvert.DeserializeObject<ImgurResponse>(responseBody);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Services/LoginService.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Data;\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.Core.Services\n{\n    public interface ILoginService\n    {\n        Task LoginWithToken(string clientId, string clientSecret, string code, string redirect, string requestDomain, string apiDomain);\n\n        Task LoginWithToken(string apiDomain, string webDomain, string token, bool enterprise);\n\n        Task LoginWithBasic(string domain, string user, string pass, string twoFactor = null);\n    }\n\n    public class LoginService : ILoginService\n    {\n        private static readonly string[] Scopes = { \"user\", \"repo\", \"notifications\", \"gist\" };\n\n        private readonly IApplicationService _applicationService;\n        private readonly IAccountsService _accountsService;\n\n        public LoginService(\n            IAccountsService accountsService,\n            IApplicationService applicationService)\n        {\n            _accountsService = accountsService;\n            _applicationService = applicationService;\n        }\n\n        public async Task LoginWithToken(string clientId, string clientSecret, string code, string redirect, string requestDomain, string apiDomain)\n        {\n            var oauthRequest = new Octokit.OauthTokenRequest(clientId, clientSecret, code)\n            {\n                RedirectUri = new Uri(redirect)\n            };\n\n            var client = new Octokit.GitHubClient(OctokitClientFactory.UserAgent);\n            var token = await client.Oauth.CreateAccessToken(oauthRequest);\n\n            var credentials = new Octokit.Credentials(token.AccessToken);\n            client = OctokitClientFactory.Create(new Uri(apiDomain), credentials);\n\n            var user = await client.User.Current();\n            var account = await _accountsService.Get(apiDomain, user.Login);\n\n            account = account ?? new Account { Username = user.Login };\n            account.OAuth = token.AccessToken;\n            account.AvatarUrl = user.AvatarUrl;\n            account.Domain = apiDomain;\n            account.WebDomain = requestDomain;\n\n            await _accountsService.Save(account);\n            await _applicationService.LoginAccount(account);\n        }\n\n        public async Task LoginWithToken(string apiDomain, string webDomain, string token, bool enterprise)\n        {\n            if (string.IsNullOrEmpty(token))\n                throw new ArgumentException(\"Token is invalid\");\n            if (apiDomain != null && !Uri.IsWellFormedUriString(apiDomain, UriKind.Absolute))\n                throw new ArgumentException(\"API Domain is invalid\");\n            if (webDomain != null && !Uri.IsWellFormedUriString(webDomain, UriKind.Absolute))\n                throw new ArgumentException(\"Web Domain is invalid\");\n\n            var credentials = new Octokit.Credentials(token);\n            var client = OctokitClientFactory.Create(new Uri(apiDomain), credentials);\n            var userInfo = await client.User.Current();\n\n            var scopes = await GetScopes(apiDomain, userInfo.Login, token);\n            CheckScopes(scopes);\n\n            var account = (await _accountsService.Get(apiDomain, userInfo.Login)) ?? new Account();\n            account.Username = userInfo.Login;\n            account.Domain = apiDomain;\n            account.WebDomain = webDomain;\n            account.IsEnterprise = enterprise;\n            account.OAuth = token;\n            account.AvatarUrl = userInfo.AvatarUrl;\n\n            await _accountsService.Save(account);\n            await _applicationService.LoginAccount(account);\n        }\n\n        public async Task LoginWithBasic(string domain, string user, string pass, string twoFactor = null)\n        {\n            if (string.IsNullOrEmpty(user))\n                throw new ArgumentException(\"Username is invalid\");\n            if (string.IsNullOrEmpty(pass))\n                throw new ArgumentException(\"Password is invalid\");\n            if (domain == null || !Uri.IsWellFormedUriString(domain, UriKind.Absolute))\n                throw new ArgumentException(\"Domain is invalid\");\n\n            var newAuthorization = new Octokit.NewAuthorization(\n                $\"CodeHub: {user}\", Scopes, Guid.NewGuid().ToString());\n\n            var credentials = new Octokit.Credentials(user, pass);\n            var client = OctokitClientFactory.Create(new Uri(domain), credentials);\n\n            var authorization = await (twoFactor == null\n                                ? client.Authorization.Create(newAuthorization)\n                                : client.Authorization.Create(newAuthorization, twoFactor));\n\n            var existingAccount = await _accountsService.Get(domain, user);\n            var account = existingAccount ?? new Account\n            {\n                Username = user,\n                IsEnterprise = true,\n                WebDomain = domain,\n                Domain = domain\n            };\n\n            account.OAuth = authorization.Token;\n\n            await _applicationService.LoginAccount(account);\n        }\n\n        private static async Task<List<string>> GetScopes(string domain, string username, string token)\n        {\n            var client = new HttpClient();\n            var authToken = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format(\"{0}:{1}\", username, token)));\n            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(\"Basic\", authToken);\n            domain = (domain.EndsWith(\"/\", StringComparison.Ordinal) ? domain : domain + \"/\") + \"user\";\n            var response = await client.GetAsync(domain);\n\n            if (!response.Headers.TryGetValues(\"X-OAuth-Scopes\", out IEnumerable<string> scopes))\n                return new List<string>();\n\n            var values = scopes.FirstOrDefault() ?? string.Empty;\n            return values.Split(',').Select(x => x.Trim()).ToList();\n        }\n\n        private static void CheckScopes(IEnumerable<string> scopes)\n        {\n            var missing = OctokitClientFactory.Scopes.Except(scopes).ToList();\n            if (missing.Any())\n                throw new InvalidOperationException(\"Missing scopes! You are missing access to the following \" +\n                    \"scopes that are necessary for CodeHub to operate correctly: \" + string.Join(\", \", missing));\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Services/MessageService.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace CodeHub.Core.Services\n{\n    public class MessageService : IMessageService\n    {\n        private readonly IList<Tuple<Type, WeakReference>> _subscriptions = new List<Tuple<Type, WeakReference>>();\n\n        public IDisposable Listen<T>(Action<T> action)\n        {\n            var obj = Tuple.Create(typeof(T), new WeakReference(action));\n            lock (_subscriptions)\n                _subscriptions.Add(obj);\n            return new Reference(action, () => _subscriptions.Remove(obj));\n        }\n\n        public void Send<T>(T message)\n        {\n            lock (_subscriptions)\n            {\n                var shouldRemove = new LinkedList<Tuple<Type, WeakReference>>();\n\n                foreach (var sub in _subscriptions)\n                {\n                    if (!sub.Item2.IsAlive)\n                        shouldRemove.AddLast(sub);\n\n                    if (sub.Item1 == typeof(T))\n                    {\n                        var handle = sub.Item2.Target;\n                        if (handle != null)\n                        {\n                            ((Action<T>)handle).Invoke(message);\n                        }\n                    }\n                }\n\n                foreach (var r in shouldRemove)\n                    _subscriptions.Remove(r);\n            }\n        }\n\n        private class Reference : IDisposable\n        {\n            private readonly Action _removal;\n            private readonly object _handle;\n\n            public Reference(object handle, Action removal)\n            {\n                _handle = handle;\n                _removal = removal;\n            }\n\n            public void Dispose() => _removal.Invoke();\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Services/ViewModelTxService.cs",
    "content": "namespace CodeHub.Core.Services\n{\n    public class ViewModelTxService : IViewModelTxService\n    {\n        private object _data;\n\n        public void Add(object obj)\n        {\n            _data = obj;\n        }\n\n        public object Get()\n        {\n            return _data;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Settings.cs",
    "content": "﻿using Plugin.Settings;\nusing Plugin.Settings.Abstractions;\n\nnamespace CodeHub.Core\n{\n    public static class Settings\n    {\n        private const string DefaultAccountKey = \"DEFAULT_ACCOUNT\";\n        private const string ShouldStarKey = \"SHOULD_STAR_CODEHUB\";\n        private const string ShouldWatchKey = \"SHOULD_WATCH_CODEHUB\";\n        private const string HasSeenWelcomeKey = \"HAS_SEEN_WELCOME_INTRO\";\n        private const string ProEditionKey = \"com.dillonbuchanan.codehub.pro\";\n        private const string HasSeenOAuthKey = \"HAS_SEEN_OAUTH_INFO\";\n        private const string ImgurUploadWarn = \"IMGUR_UPLOAD_WARN\";\n\n        private static ISettings AppSettings => CrossSettings.Current;\n\n        public static string DefaultAccount\n        {\n            get => AppSettings.GetValueOrDefault(DefaultAccountKey, null);\n            set => AppSettings.AddOrUpdateValue(DefaultAccountKey, value);\n        }\n\n        public static bool ShouldStar\n        {\n            get => AppSettings.GetValueOrDefault(ShouldStarKey, false);\n            set => AppSettings.AddOrUpdateValue(ShouldStarKey, value);\n        }\n\n        public static bool ShouldWatch\n        {\n            get => AppSettings.GetValueOrDefault(ShouldWatchKey, false);\n            set => AppSettings.AddOrUpdateValue(ShouldWatchKey, value);\n        }\n\n        public static bool HasSeenWelcome\n        {\n            get => AppSettings.GetValueOrDefault(HasSeenWelcomeKey, false);\n            set => AppSettings.AddOrUpdateValue(HasSeenWelcomeKey, value);\n        }\n\n        public static bool IsProEnabled\n        {\n            get => AppSettings.GetValueOrDefault(ProEditionKey, false);\n            set => AppSettings.AddOrUpdateValue(ProEditionKey, value);\n        }\n\n        public static bool HasSeenOAuthWelcome\n        {\n            get => AppSettings.GetValueOrDefault(HasSeenOAuthKey, false);\n            set => AppSettings.AddOrUpdateValue(HasSeenOAuthKey, value);\n        }\n\n        public static bool HasSeenImgurUploadWarn\n        {\n            get => AppSettings.GetValueOrDefault(ImgurUploadWarn, false);\n            set => AppSettings.AddOrUpdateValue(ImgurUploadWarn, value);\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/Utils/CustomObservableCollection.cs",
    "content": "using System;\nusing System.Collections.ObjectModel;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Collections.Specialized;\n\nnamespace CodeHub.Core.Utils\n{\n    public class CustomObservableCollection<T> : ObservableCollection<T>\n    {\n        public CustomObservableCollection()\r\n        {\n\n        }\n\n        public CustomObservableCollection(IEnumerable<T> collection)\n            : base(collection)\n        {\n\n        }\n\n        public CustomObservableCollection(List<T> list)\n            : base(list)\n        {\n\n        }\n\n        public virtual void AddRange(IEnumerable<T> collection)\n        {\n            if (collection == null) \n                throw new ArgumentNullException(\"collection\");\n\n            var added = false;\r\n            var enumerable = collection as IList<T> ?? collection.ToList();\r\n            foreach (var item in enumerable)\n            {\n                this.Items.Add(item);\n                added = true;\n            }\n\n            if (added)\n            {\n                this.OnPropertyChanged(new PropertyChangedEventArgs(\"Count\"));\n                this.OnPropertyChanged(new PropertyChangedEventArgs(\"Item[]\"));\n                this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, enumerable.ToList()));\n                // Cannot use NotifyCollectionChangedAction.Add, because Constructor supports only the 'Reset' action.\n            }\n        }\n\n        public virtual void RemoveRange(IEnumerable<T> collection)\n        {\n            if (collection == null) \n                throw new ArgumentNullException(\"collection\");\n\n            var removed = false;\r\n            var enumerable = collection as T[] ?? collection.ToArray();\r\n            foreach (var item in enumerable.Where(item => this.Items.Remove(item)))\r\n                removed = true;\r\n\r\n            if (!removed) return;\r\n            this.OnPropertyChanged(new PropertyChangedEventArgs(\"Count\"));\n            this.OnPropertyChanged(new PropertyChangedEventArgs(\"Item[]\"));\n            OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, enumerable.ToList()));\n            // Cannot use NotifyCollectionChangedAction.Remove, because Constructor supports only the 'Reset' action.\r\n        }\n\n        public virtual void Reset(T item)\n        {\n            this.Reset(new List<T> { item });\n        }\n\n        public virtual void Reset(IEnumerable<T> collection)\n        {\n            if (collection == null)\n                return;\n\n            int count = this.Count;\n\n            // Step 1: Clear the old items\n            this.Items.Clear();\n\n            // Step 2: Add new items\n            foreach (T item in collection)\n                this.Items.Add(item);\n\n            // Step 3: Don't forget the event\n            if (this.Count != count)\n                this.OnPropertyChanged(new PropertyChangedEventArgs(\"Count\"));\n            this.OnPropertyChanged(new PropertyChangedEventArgs(\"Item[]\"));\n            this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/DateTimeExtensions.cs",
    "content": "namespace System\n{\n    public static class DateTimeExtensions\n    {\n        public static int TotalDaysAgo(this DateTimeOffset d)\n        {\n            return Convert.ToInt32(Math.Round(DateTimeOffset.Now.Subtract(d).TotalDays));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/Emojis.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\n\nnamespace CodeHub.Core.Utilities\n{\n    public static class Emojis\n    {\n        private static readonly IDictionary<string, string> _emojis;\n\n        static Emojis()\n        {\n            _emojis = new Dictionary<string, string>(1000, StringComparer.OrdinalIgnoreCase)\n            {\n                {\"smile\", \"😄\"},\n                {\"smiley\", \"😃\"},\n                {\"grinning\", \"😀\"},\n                {\"blush\", \"😊\"},\n                {\"relaxed\", \"☺️\"},\n                {\"wink\", \"😉\"},\n                {\"heart_eyes\", \"😍\"},\n                {\"kissing_heart\", \"😘\"},\n                {\"kissing_closed_eyes\", \"😚\"},\n                {\"kissing\", \"😗\"},\n                {\"kissing_smiling_eyes\", \"😙\"},\n                {\"stuck_out_tongue_winking_eye\", \"😜\"},\n                {\"stuck_out_tongue_closed_eyes\", \"😝\"},\n                {\"stuck_out_tongue\", \"😛\"},\n                {\"flushed\", \"😳\"},\n                {\"grin\", \"😁\"},\n                {\"pensive\", \"😔\"},\n                {\"relieved\", \"😌\"},\n                {\"unamused\", \"😒\"},\n                {\"disappointed\", \"😞\"},\n                {\"persevere\", \"😣\"},\n                {\"cry\", \"😢\"},\n                {\"joy\", \"😂\"},\n                {\"sob\", \"😭\"},\n                {\"sleepy\", \"😪\"},\n                {\"disappointed_relieved\", \"😥\"},\n                {\"cold_sweat\", \"😰\"},\n                {\"sweat_smile\", \"😅\"},\n                {\"sweat\", \"😓\"},\n                {\"weary\", \"😩\"},\n                {\"tired_face\", \"😫\"},\n                {\"fearful\", \"😨\"},\n                {\"scream\", \"😱\"},\n                {\"angry\", \"😠\"},\n                {\"rage\", \"😡\"},\n                {\"triumph\", \"😤\"},\n                {\"confounded\", \"😖\"},\n                {\"laughing\", \"😆\"},\n                {\"satisfied\", \"😆\"},\n                {\"yum\", \"😋\"},\n                {\"mask\", \"😷\"},\n                {\"sunglasses\", \"😎\"},\n                {\"sleeping\", \"😴\"},\n                {\"dizzy_face\", \"😵\"},\n                {\"astonished\", \"😲\"},\n                {\"worried\", \"😟\"},\n                {\"frowning\", \"😦\"},\n                {\"anguished\", \"😧\"},\n                {\"smiling_imp\", \"😈\"},\n                {\"imp\", \"👿\"},\n                {\"open_mouth\", \"😮\"},\n                {\"grimacing\", \"😬\"},\n                {\"neutral_face\", \"😐\"},\n                {\"confused\", \"😕\"},\n                {\"hushed\", \"😯\"},\n                {\"no_mouth\", \"😶\"},\n                {\"innocent\", \"😇\"},\n                {\"smirk\", \"😏\"},\n                {\"expressionless\", \"😑\"},\n                {\"man_with_gua_pi_mao\", \"👲\"},\n                {\"man_with_turban\", \"👳\"},\n                {\"cop\", \"👮\"},\n                {\"construction_worker\", \"👷\"},\n                {\"guardsman\", \"💂\"},\n                {\"baby\", \"👶\"},\n                {\"boy\", \"👦\"},\n                {\"girl\", \"👧\"},\n                {\"man\", \"👨\"},\n                {\"woman\", \"👩\"},\n                {\"older_man\", \"👴\"},\n                {\"older_woman\", \"👵\"},\n                {\"person_with_blond_hair\", \"👱\"},\n                {\"angel\", \"👼\"},\n                {\"princess\", \"👸\"},\n                {\"smiley_cat\", \"😺\"},\n                {\"smile_cat\", \"😸\"},\n                {\"heart_eyes_cat\", \"😻\"},\n                {\"kissing_cat\", \"😽\"},\n                {\"smirk_cat\", \"😼\"},\n                {\"scream_cat\", \"🙀\"},\n                {\"crying_cat_face\", \"😿\"},\n                {\"joy_cat\", \"😹\"},\n                {\"pouting_cat\", \"😾\"},\n                {\"japanese_ogre\", \"👹\"},\n                {\"japanese_goblin\", \"👺\"},\n                {\"see_no_evil\", \"🙈\"},\n                {\"hear_no_evil\", \"🙉\"},\n                {\"speak_no_evil\", \"🙊\"},\n                {\"skull\", \"💀\"},\n                {\"alien\", \"👽\"},\n                {\"hankey\", \"💩\"},\n                {\"poop\", \"💩\"},\n                {\"shit\", \"💩\"},\n                {\"fire\", \"🔥\"},\n                {\"sparkles\", \"✨\"},\n                {\"star2\", \"🌟\"},\n                {\"dizzy\", \"💫\"},\n                {\"boom\", \"💥\"},\n                {\"collision\", \"💥\"},\n                {\"anger\", \"💢\"},\n                {\"sweat_drops\", \"💦\"},\n                {\"droplet\", \"💧\"},\n                {\"zzz\", \"💤\"},\n                {\"dash\", \"💨\"},\n                {\"ear\", \"👂\"},\n                {\"eyes\", \"👀\"},\n                {\"nose\", \"👃\"},\n                {\"tongue\", \"👅\"},\n                {\"lips\", \"👄\"},\n                {\"+1\", \"👍\"},\n                {\"thumbsup\", \"👍\"},\n                {\"-1\", \"👎\"},\n                {\"thumbsdown\", \"👎\"},\n                {\"ok_hand\", \"👌\"},\n                {\"facepunch\", \"👊\"},\n                {\"punch\", \"👊\"},\n                {\"fist\", \"✊\"},\n                {\"v\", \"✌️\"},\n                {\"wave\", \"👋\"},\n                {\"hand\", \"✋\"},\n                {\"raised_hand\", \"✋\"},\n                {\"open_hands\", \"👐\"},\n                {\"point_up_2\", \"👆\"},\n                {\"point_down\", \"👇\"},\n                {\"point_right\", \"👉\"},\n                {\"point_left\", \"👈\"},\n                {\"raised_hands\", \"🙌\"},\n                {\"pray\", \"🙏\"},\n                {\"point_up\", \"☝️\"},\n                {\"clap\", \"👏\"},\n                {\"muscle\", \"💪\"},\n                {\"walking\", \"🚶\"},\n                {\"runner\", \"🏃\"},\n                {\"running\", \"🏃\"},\n                {\"dancer\", \"💃\"},\n                {\"couple\", \"👫\"},\n                {\"family\", \"👪\"},\n                {\"two_men_holding_hands\", \"👬\"},\n                {\"two_women_holding_hands\", \"👭\"},\n                {\"couplekiss\", \"💏\"},\n                {\"couple_with_heart\", \"💑\"},\n                {\"dancers\", \"👯\"},\n                {\"ok_woman\", \"🙆\"},\n                {\"no_good\", \"🙅\"},\n                {\"information_desk_person\", \"💁\"},\n                {\"raising_hand\", \"🙋\"},\n                {\"massage\", \"💆\"},\n                {\"haircut\", \"💇\"},\n                {\"nail_care\", \"💅\"},\n                {\"bride_with_veil\", \"👰\"},\n                {\"person_with_pouting_face\", \"🙎\"},\n                {\"person_frowning\", \"🙍\"},\n                {\"bow\", \"🙇\"},\n                {\"tophat\", \"🎩\"},\n                {\"crown\", \"👑\"},\n                {\"womans_hat\", \"👒\"},\n                {\"athletic_shoe\", \"👟\"},\n                {\"mans_shoe\", \"👞\"},\n                {\"shoe\", \"👞\"},\n                {\"sandal\", \"👡\"},\n                {\"high_heel\", \"👠\"},\n                {\"boot\", \"👢\"},\n                {\"shirt\", \"👕\"},\n                {\"tshirt\", \"👕\"},\n                {\"necktie\", \"👔\"},\n                {\"womans_clothes\", \"👚\"},\n                {\"dress\", \"👗\"},\n                {\"running_shirt_with_sash\", \"🎽\"},\n                {\"jeans\", \"👖\"},\n                {\"kimono\", \"👘\"},\n                {\"bikini\", \"👙\"},\n                {\"briefcase\", \"💼\"},\n                {\"handbag\", \"👜\"},\n                {\"pouch\", \"👝\"},\n                {\"purse\", \"👛\"},\n                {\"eyeglasses\", \"👓\"},\n                {\"ribbon\", \"🎀\"},\n                {\"closed_umbrella\", \"🌂\"},\n                {\"lipstick\", \"💄\"},\n                {\"yellow_heart\", \"💛\"},\n                {\"blue_heart\", \"💙\"},\n                {\"purple_heart\", \"💜\"},\n                {\"green_heart\", \"💚\"},\n                {\"heart\", \"❤️\"},\n                {\"broken_heart\", \"💔\"},\n                {\"heartpulse\", \"💗\"},\n                {\"heartbeat\", \"💓\"},\n                {\"two_hearts\", \"💕\"},\n                {\"sparkling_heart\", \"💖\"},\n                {\"revolving_hearts\", \"💞\"},\n                {\"cupid\", \"💘\"},\n                {\"love_letter\", \"💌\"},\n                {\"kiss\", \"💋\"},\n                {\"ring\", \"💍\"},\n                {\"gem\", \"💎\"},\n                {\"bust_in_silhouette\", \"👤\"},\n                {\"busts_in_silhouette\", \"👥\"},\n                {\"speech_balloon\", \"💬\"},\n                {\"footprints\", \"👣\"},\n                {\"thought_balloon\", \"💭\"},\n                {\"dog\", \"🐶\"},\n                {\"wolf\", \"🐺\"},\n                {\"cat\", \"🐱\"},\n                {\"mouse\", \"🐭\"},\n                {\"hamster\", \"🐹\"},\n                {\"rabbit\", \"🐰\"},\n                {\"frog\", \"🐸\"},\n                {\"tiger\", \"🐯\"},\n                {\"koala\", \"🐨\"},\n                {\"bear\", \"🐻\"},\n                {\"pig\", \"🐷\"},\n                {\"pig_nose\", \"🐽\"},\n                {\"cow\", \"🐮\"},\n                {\"boar\", \"🐗\"},\n                {\"monkey_face\", \"🐵\"},\n                {\"monkey\", \"🐒\"},\n                {\"horse\", \"🐴\"},\n                {\"sheep\", \"🐑\"},\n                {\"elephant\", \"🐘\"},\n                {\"panda_face\", \"🐼\"},\n                {\"penguin\", \"🐧\"},\n                {\"bird\", \"🐦\"},\n                {\"baby_chick\", \"🐤\"},\n                {\"hatched_chick\", \"🐥\"},\n                {\"hatching_chick\", \"🐣\"},\n                {\"chicken\", \"🐔\"},\n                {\"snake\", \"🐍\"},\n                {\"turtle\", \"🐢\"},\n                {\"bug\", \"🐛\"},\n                {\"bee\", \"🐝\"},\n                {\"honeybee\", \"🐝\"},\n                {\"ant\", \"🐜\"},\n                {\"beetle\", \"🐞\"},\n                {\"snail\", \"🐌\"},\n                {\"octopus\", \"🐙\"},\n                {\"shell\", \"🐚\"},\n                {\"tropical_fish\", \"🐠\"},\n                {\"fish\", \"🐟\"},\n                {\"dolphin\", \"🐬\"},\n                {\"flipper\", \"🐬\"},\n                {\"whale\", \"🐳\"},\n                {\"whale2\", \"🐋\"},\n                {\"cow2\", \"🐄\"},\n                {\"ram\", \"🐏\"},\n                {\"rat\", \"🐀\"},\n                {\"water_buffalo\", \"🐃\"},\n                {\"tiger2\", \"🐅\"},\n                {\"rabbit2\", \"🐇\"},\n                {\"dragon\", \"🐉\"},\n                {\"racehorse\", \"🐎\"},\n                {\"goat\", \"🐐\"},\n                {\"rooster\", \"🐓\"},\n                {\"dog2\", \"🐕\"},\n                {\"pig2\", \"🐖\"},\n                {\"mouse2\", \"🐁\"},\n                {\"ox\", \"🐂\"},\n                {\"dragon_face\", \"🐲\"},\n                {\"blowfish\", \"🐡\"},\n                {\"crocodile\", \"🐊\"},\n                {\"camel\", \"🐫\"},\n                {\"dromedary_camel\", \"🐪\"},\n                {\"leopard\", \"🐆\"},\n                {\"cat2\", \"🐈\"},\n                {\"poodle\", \"🐩\"},\n                {\"feet\", \"🐾\"},\n                {\"paw_prints\", \"🐾\"},\n                {\"bouquet\", \"💐\"},\n                {\"cherry_blossom\", \"🌸\"},\n                {\"tulip\", \"🌷\"},\n                {\"four_leaf_clover\", \"🍀\"},\n                {\"rose\", \"🌹\"},\n                {\"sunflower\", \"🌻\"},\n                {\"hibiscus\", \"🌺\"},\n                {\"maple_leaf\", \"🍁\"},\n                {\"leaves\", \"🍃\"},\n                {\"fallen_leaf\", \"🍂\"},\n                {\"herb\", \"🌿\"},\n                {\"ear_of_rice\", \"🌾\"},\n                {\"mushroom\", \"🍄\"},\n                {\"cactus\", \"🌵\"},\n                {\"palm_tree\", \"🌴\"},\n                {\"evergreen_tree\", \"🌲\"},\n                {\"deciduous_tree\", \"🌳\"},\n                {\"chestnut\", \"🌰\"},\n                {\"seedling\", \"🌱\"},\n                {\"blossom\", \"🌼\"},\n                {\"globe_with_meridians\", \"🌐\"},\n                {\"sun_with_face\", \"🌞\"},\n                {\"full_moon_with_face\", \"🌝\"},\n                {\"new_moon_with_face\", \"🌚\"},\n                {\"new_moon\", \"🌑\"},\n                {\"waxing_crescent_moon\", \"🌒\"},\n                {\"first_quarter_moon\", \"🌓\"},\n                {\"moon\", \"🌔\"},\n                {\"waxing_gibbous_moon\", \"🌔\"},\n                {\"full_moon\", \"🌕\"},\n                {\"waning_gibbous_moon\", \"🌖\"},\n                {\"last_quarter_moon\", \"🌗\"},\n                {\"waning_crescent_moon\", \"🌘\"},\n                {\"last_quarter_moon_with_face\", \"🌜\"},\n                {\"first_quarter_moon_with_face\", \"🌛\"},\n                {\"crescent_moon\", \"🌙\"},\n                {\"earth_africa\", \"🌍\"},\n                {\"earth_americas\", \"🌎\"},\n                {\"earth_asia\", \"🌏\"},\n                {\"volcano\", \"🌋\"},\n                {\"milky_way\", \"🌌\"},\n                {\"stars\", \"🌠\"},\n                {\"star\", \"⭐\"},\n                {\"sunny\", \"☀️\"},\n                {\"partly_sunny\", \"⛅\"},\n                {\"cloud\", \"☁️\"},\n                {\"zap\", \"⚡\"},\n                {\"umbrella\", \"☔\"},\n                {\"snowflake\", \"❄️\"},\n                {\"snowman\", \"⛄\"},\n                {\"cyclone\", \"🌀\"},\n                {\"foggy\", \"🌁\"},\n                {\"rainbow\", \"🌈\"},\n                {\"ocean\", \"🌊\"},\n                {\"bamboo\", \"🎍\"},\n                {\"gift_heart\", \"💝\"},\n                {\"dolls\", \"🎎\"},\n                {\"school_satchel\", \"🎒\"},\n                {\"mortar_board\", \"🎓\"},\n                {\"flags\", \"🎏\"},\n                {\"fireworks\", \"🎆\"},\n                {\"sparkler\", \"🎇\"},\n                {\"wind_chime\", \"🎐\"},\n                {\"rice_scene\", \"🎑\"},\n                {\"jack_o_lantern\", \"🎃\"},\n                {\"ghost\", \"👻\"},\n                {\"santa\", \"🎅\"},\n                {\"christmas_tree\", \"🎄\"},\n                {\"gift\", \"🎁\"},\n                {\"tanabata_tree\", \"🎋\"},\n                {\"tada\", \"🎉\"},\n                {\"confetti_ball\", \"🎊\"},\n                {\"balloon\", \"🎈\"},\n                {\"crossed_flags\", \"🎌\"},\n                {\"crystal_ball\", \"🔮\"},\n                {\"movie_camera\", \"🎥\"},\n                {\"camera\", \"📷\"},\n                {\"video_camera\", \"📹\"},\n                {\"vhs\", \"📼\"},\n                {\"cd\", \"💿\"},\n                {\"dvd\", \"📀\"},\n                {\"minidisc\", \"💽\"},\n                {\"floppy_disk\", \"💾\"},\n                {\"computer\", \"💻\"},\n                {\"iphone\", \"📱\"},\n                {\"phone\", \"☎️\"},\n                {\"telephone\", \"☎️\"},\n                {\"telephone_receiver\", \"📞\"},\n                {\"pager\", \"📟\"},\n                {\"fax\", \"📠\"},\n                {\"satellite\", \"📡\"},\n                {\"tv\", \"📺\"},\n                {\"radio\", \"📻\"},\n                {\"loud_sound\", \"🔊\"},\n                {\"sound\", \"🔉\"},\n                {\"speaker\", \"🔈\"},\n                {\"mute\", \"🔇\"},\n                {\"bell\", \"🔔\"},\n                {\"no_bell\", \"🔕\"},\n                {\"loudspeaker\", \"📢\"},\n                {\"mega\", \"📣\"},\n                {\"hourglass_flowing_sand\", \"⏳\"},\n                {\"hourglass\", \"⌛\"},\n                {\"alarm_clock\", \"⏰\"},\n                {\"watch\", \"⌚\"},\n                {\"unlock\", \"🔓\"},\n                {\"lock\", \"🔒\"},\n                {\"lock_with_ink_pen\", \"🔏\"},\n                {\"closed_lock_with_key\", \"🔐\"},\n                {\"key\", \"🔑\"},\n                {\"mag_right\", \"🔎\"},\n                {\"bulb\", \"💡\"},\n                {\"flashlight\", \"🔦\"},\n                {\"high_brightness\", \"🔆\"},\n                {\"low_brightness\", \"🔅\"},\n                {\"electric_plug\", \"🔌\"},\n                {\"battery\", \"🔋\"},\n                {\"mag\", \"🔍\"},\n                {\"bathtub\", \"🛁\"},\n                {\"bath\", \"🛀\"},\n                {\"shower\", \"🚿\"},\n                {\"toilet\", \"🚽\"},\n                {\"wrench\", \"🔧\"},\n                {\"nut_and_bolt\", \"🔩\"},\n                {\"hammer\", \"🔨\"},\n                {\"door\", \"🚪\"},\n                {\"smoking\", \"🚬\"},\n                {\"bomb\", \"💣\"},\n                {\"gun\", \"🔫\"},\n                {\"hocho\", \"🔪\"},\n                {\"knife\", \"🔪\"},\n                {\"pill\", \"💊\"},\n                {\"syringe\", \"💉\"},\n                {\"moneybag\", \"💰\"},\n                {\"yen\", \"💴\"},\n                {\"dollar\", \"💵\"},\n                {\"pound\", \"💷\"},\n                {\"euro\", \"💶\"},\n                {\"credit_card\", \"💳\"},\n                {\"money_with_wings\", \"💸\"},\n                {\"calling\", \"📲\"},\n                {\"e-mail\", \"📧\"},\n                {\"inbox_tray\", \"📥\"},\n                {\"outbox_tray\", \"📤\"},\n                {\"email\", \"✉️\"},\n                {\"envelope\", \"✉️\"},\n                {\"envelope_with_arrow\", \"📩\"},\n                {\"incoming_envelope\", \"📨\"},\n                {\"postal_horn\", \"📯\"},\n                {\"mailbox\", \"📫\"},\n                {\"mailbox_closed\", \"📪\"},\n                {\"mailbox_with_mail\", \"📬\"},\n                {\"mailbox_with_no_mail\", \"📭\"},\n                {\"postbox\", \"📮\"},\n                {\"package\", \"📦\"},\n                {\"memo\", \"📝\"},\n                {\"pencil\", \"📝\"},\n                {\"page_facing_up\", \"📄\"},\n                {\"page_with_curl\", \"📃\"},\n                {\"bookmark_tabs\", \"📑\"},\n                {\"bar_chart\", \"📊\"},\n                {\"chart_with_upwards_trend\", \"📈\"},\n                {\"chart_with_downwards_trend\", \"📉\"},\n                {\"scroll\", \"📜\"},\n                {\"clipboard\", \"📋\"},\n                {\"date\", \"📅\"},\n                {\"calendar\", \"📆\"},\n                {\"card_index\", \"📇\"},\n                {\"file_folder\", \"📁\"},\n                {\"open_file_folder\", \"📂\"},\n                {\"scissors\", \"✂️\"},\n                {\"pushpin\", \"📌\"},\n                {\"paperclip\", \"📎\"},\n                {\"black_nib\", \"✒️\"},\n                {\"pencil2\", \"✏️\"},\n                {\"straight_ruler\", \"📏\"},\n                {\"triangular_ruler\", \"📐\"},\n                {\"closed_book\", \"📕\"},\n                {\"green_book\", \"📗\"},\n                {\"blue_book\", \"📘\"},\n                {\"orange_book\", \"📙\"},\n                {\"notebook\", \"📓\"},\n                {\"notebook_with_decorative_cover\", \"📔\"},\n                {\"ledger\", \"📒\"},\n                {\"books\", \"📚\"},\n                {\"book\", \"📖\"},\n                {\"open_book\", \"📖\"},\n                {\"bookmark\", \"🔖\"},\n                {\"name_badge\", \"📛\"},\n                {\"microscope\", \"🔬\"},\n                {\"telescope\", \"🔭\"},\n                {\"newspaper\", \"📰\"},\n                {\"art\", \"🎨\"},\n                {\"clapper\", \"🎬\"},\n                {\"microphone\", \"🎤\"},\n                {\"headphones\", \"🎧\"},\n                {\"musical_score\", \"🎼\"},\n                {\"musical_note\", \"🎵\"},\n                {\"notes\", \"🎶\"},\n                {\"musical_keyboard\", \"🎹\"},\n                {\"violin\", \"🎻\"},\n                {\"trumpet\", \"🎺\"},\n                {\"saxophone\", \"🎷\"},\n                {\"guitar\", \"🎸\"},\n                {\"space_invader\", \"👾\"},\n                {\"video_game\", \"🎮\"},\n                {\"black_joker\", \"🃏\"},\n                {\"flower_playing_cards\", \"🎴\"},\n                {\"mahjong\", \"🀄\"},\n                {\"game_die\", \"🎲\"},\n                {\"dart\", \"🎯\"},\n                {\"football\", \"🏈\"},\n                {\"basketball\", \"🏀\"},\n                {\"soccer\", \"⚽\"},\n                {\"baseball\", \"⚾️\"},\n                {\"tennis\", \"🎾\"},\n                {\"8ball\", \"🎱\"},\n                {\"rugby_football\", \"🏉\"},\n                {\"bowling\", \"🎳\"},\n                {\"golf\", \"⛳\"},\n                {\"mountain_bicyclist\", \"🚵\"},\n                {\"bicyclist\", \"🚴\"},\n                {\"checkered_flag\", \"🏁\"},\n                {\"horse_racing\", \"🏇\"},\n                {\"trophy\", \"🏆\"},\n                {\"ski\", \"🎿\"},\n                {\"snowboarder\", \"🏂\"},\n                {\"swimmer\", \"🏊\"},\n                {\"surfer\", \"🏄\"},\n                {\"fishing_pole_and_fish\", \"🎣\"},\n                {\"coffee\", \"☕\"},\n                {\"tea\", \"🍵\"},\n                {\"sake\", \"🍶\"},\n                {\"baby_bottle\", \"🍼\"},\n                {\"beer\", \"🍺\"},\n                {\"beers\", \"🍻\"},\n                {\"cocktail\", \"🍸\"},\n                {\"tropical_drink\", \"🍹\"},\n                {\"wine_glass\", \"🍷\"},\n                {\"fork_and_knife\", \"🍴\"},\n                {\"pizza\", \"🍕\"},\n                {\"hamburger\", \"🍔\"},\n                {\"fries\", \"🍟\"},\n                {\"poultry_leg\", \"🍗\"},\n                {\"meat_on_bone\", \"🍖\"},\n                {\"spaghetti\", \"🍝\"},\n                {\"curry\", \"🍛\"},\n                {\"fried_shrimp\", \"🍤\"},\n                {\"bento\", \"🍱\"},\n                {\"sushi\", \"🍣\"},\n                {\"fish_cake\", \"🍥\"},\n                {\"rice_ball\", \"🍙\"},\n                {\"rice_cracker\", \"🍘\"},\n                {\"rice\", \"🍚\"},\n                {\"ramen\", \"🍜\"},\n                {\"stew\", \"🍲\"},\n                {\"oden\", \"🍢\"},\n                {\"dango\", \"🍡\"},\n                {\"egg\", \"🍳\"},\n                {\"bread\", \"🍞\"},\n                {\"doughnut\", \"🍩\"},\n                {\"custard\", \"🍮\"},\n                {\"icecream\", \"🍦\"},\n                {\"ice_cream\", \"🍨\"},\n                {\"shaved_ice\", \"🍧\"},\n                {\"birthday\", \"🎂\"},\n                {\"cake\", \"🍰\"},\n                {\"cookie\", \"🍪\"},\n                {\"chocolate_bar\", \"🍫\"},\n                {\"candy\", \"🍬\"},\n                {\"lollipop\", \"🍭\"},\n                {\"honey_pot\", \"🍯\"},\n                {\"apple\", \"🍎\"},\n                {\"green_apple\", \"🍏\"},\n                {\"tangerine\", \"🍊\"},\n                {\"lemon\", \"🍋\"},\n                {\"cherries\", \"🍒\"},\n                {\"grapes\", \"🍇\"},\n                {\"watermelon\", \"🍉\"},\n                {\"strawberry\", \"🍓\"},\n                {\"peach\", \"🍑\"},\n                {\"melon\", \"🍈\"},\n                {\"banana\", \"🍌\"},\n                {\"pear\", \"🍐\"},\n                {\"pineapple\", \"🍍\"},\n                {\"sweet_potato\", \"🍠\"},\n                {\"eggplant\", \"🍆\"},\n                {\"tomato\", \"🍅\"},\n                {\"corn\", \"🌽\"},\n                {\"house\", \"🏠\"},\n                {\"house_with_garden\", \"🏡\"},\n                {\"school\", \"🏫\"},\n                {\"office\", \"🏢\"},\n                {\"post_office\", \"🏣\"},\n                {\"hospital\", \"🏥\"},\n                {\"bank\", \"🏦\"},\n                {\"convenience_store\", \"🏪\"},\n                {\"love_hotel\", \"🏩\"},\n                {\"hotel\", \"🏨\"},\n                {\"wedding\", \"💒\"},\n                {\"church\", \"⛪\"},\n                {\"department_store\", \"🏬\"},\n                {\"european_post_office\", \"🏤\"},\n                {\"city_sunrise\", \"🌇\"},\n                {\"city_sunset\", \"🌆\"},\n                {\"japanese_castle\", \"🏯\"},\n                {\"european_castle\", \"🏰\"},\n                {\"tent\", \"⛺\"},\n                {\"factory\", \"🏭\"},\n                {\"tokyo_tower\", \"🗼\"},\n                {\"japan\", \"🗾\"},\n                {\"mount_fuji\", \"🗻\"},\n                {\"sunrise_over_mountains\", \"🌄\"},\n                {\"sunrise\", \"🌅\"},\n                {\"night_with_stars\", \"🌃\"},\n                {\"statue_of_liberty\", \"🗽\"},\n                {\"bridge_at_night\", \"🌉\"},\n                {\"carousel_horse\", \"🎠\"},\n                {\"ferris_wheel\", \"🎡\"},\n                {\"fountain\", \"⛲\"},\n                {\"roller_coaster\", \"🎢\"},\n                {\"ship\", \"🚢\"},\n                {\"boat\", \"⛵\"},\n                {\"sailboat\", \"⛵\"},\n                {\"speedboat\", \"🚤\"},\n                {\"rowboat\", \"🚣\"},\n                {\"anchor\", \"⚓\"},\n                {\"rocket\", \"🚀\"},\n                {\"airplane\", \"✈️\"},\n                {\"seat\", \"💺\"},\n                {\"helicopter\", \"🚁\"},\n                {\"steam_locomotive\", \"🚂\"},\n                {\"tram\", \"🚊\"},\n                {\"station\", \"🚉\"},\n                {\"mountain_railway\", \"🚞\"},\n                {\"train2\", \"🚆\"},\n                {\"bullettrain_side\", \"🚄\"},\n                {\"bullettrain_front\", \"🚅\"},\n                {\"light_rail\", \"🚈\"},\n                {\"metro\", \"🚇\"},\n                {\"monorail\", \"🚝\"},\n                {\"train\", \"🚋\"},\n                {\"railway_car\", \"🚃\"},\n                {\"trolleybus\", \"🚎\"},\n                {\"bus\", \"🚌\"},\n                {\"oncoming_bus\", \"🚍\"},\n                {\"blue_car\", \"🚙\"},\n                {\"oncoming_automobile\", \"🚘\"},\n                {\"car\", \"🚗\"},\n                {\"red_car\", \"🚗\"},\n                {\"taxi\", \"🚕\"},\n                {\"oncoming_taxi\", \"🚖\"},\n                {\"articulated_lorry\", \"🚛\"},\n                {\"truck\", \"🚚\"},\n                {\"rotating_light\", \"🚨\"},\n                {\"police_car\", \"🚓\"},\n                {\"oncoming_police_car\", \"🚔\"},\n                {\"fire_engine\", \"🚒\"},\n                {\"ambulance\", \"🚑\"},\n                {\"minibus\", \"🚐\"},\n                {\"bike\", \"🚲\"},\n                {\"aerial_tramway\", \"🚡\"},\n                {\"suspension_railway\", \"🚟\"},\n                {\"mountain_cableway\", \"🚠\"},\n                {\"tractor\", \"🚜\"},\n                {\"barber\", \"💈\"},\n                {\"busstop\", \"🚏\"},\n                {\"ticket\", \"🎫\"},\n                {\"vertical_traffic_light\", \"🚦\"},\n                {\"traffic_light\", \"🚥\"},\n                {\"warning\", \"⚠️\"},\n                {\"construction\", \"🚧\"},\n                {\"beginner\", \"🔰\"},\n                {\"fuelpump\", \"⛽\"},\n                {\"izakaya_lantern\", \"🏮\"},\n                {\"lantern\", \"🏮\"},\n                {\"slot_machine\", \"🎰\"},\n                {\"hotsprings\", \"♨️\"},\n                {\"moyai\", \"🗿\"},\n                {\"circus_tent\", \"🎪\"},\n                {\"performing_arts\", \"🎭\"},\n                {\"round_pushpin\", \"📍\"},\n                {\"triangular_flag_on_post\", \"🚩\"},\n                {\"jp\", \"🇯🇵\"},\n                {\"kr\", \"🇰🇷\"},\n                {\"de\", \"🇩🇪\"},\n                {\"cn\", \"🇨🇳\"},\n                {\"us\", \"🇺🇸\"},\n                {\"fr\", \"🇫🇷\"},\n                {\"es\", \"🇪🇸\"},\n                {\"it\", \"🇮🇹\"},\n                {\"ru\", \"🇷🇺\"},\n                {\"gb\", \"🇬🇧\"},\n                {\"uk\", \"🇬🇧\"},\n                {\"one\", \"1️⃣\"},\n                {\"two\", \"2️⃣\"},\n                {\"three\", \"3️⃣\"},\n                {\"four\", \"4️⃣\"},\n                {\"five\", \"5️⃣\"},\n                {\"six\", \"6️⃣\"},\n                {\"seven\", \"7️⃣\"},\n                {\"eight\", \"8️⃣\"},\n                {\"nine\", \"9️⃣\"},\n                {\"zero\", \"0️⃣\"},\n                {\"keycap_ten\", \"🔟\"},\n                {\"1234\", \"🔢\"},\n                {\"hash\", \"#️⃣\"},\n                {\"symbols\", \"🔣\"},\n                {\"arrow_up\", \"⬆️\"},\n                {\"arrow_down\", \"⬇️\"},\n                {\"arrow_left\", \"⬅️\"},\n                {\"arrow_right\", \"➡️\"},\n                {\"capital_abcd\", \"🔠\"},\n                {\"abcd\", \"🔡\"},\n                {\"abc\", \"🔤\"},\n                {\"arrow_upper_right\", \"↗️\"},\n                {\"arrow_upper_left\", \"↖️\"},\n                {\"arrow_lower_right\", \"↘️\"},\n                {\"arrow_lower_left\", \"↙️\"},\n                {\"left_right_arrow\", \"↔️\"},\n                {\"arrow_up_down\", \"↕️\"},\n                {\"arrows_counterclockwise\", \"🔄\"},\n                {\"arrow_backward\", \"◀️\"},\n                {\"arrow_forward\", \"▶️\"},\n                {\"arrow_up_small\", \"🔼\"},\n                {\"arrow_down_small\", \"🔽\"},\n                {\"leftwards_arrow_with_hook\", \"↩️\"},\n                {\"arrow_right_hook\", \"↪️\"},\n                {\"information_source\", \"ℹ️\"},\n                {\"rewind\", \"⏪\"},\n                {\"fast_forward\", \"⏩\"},\n                {\"arrow_double_up\", \"⏫\"},\n                {\"arrow_double_down\", \"⏬\"},\n                {\"arrow_heading_down\", \"⤵️\"},\n                {\"arrow_heading_up\", \"⤴️\"},\n                {\"ok\", \"🆗\"},\n                {\"twisted_rightwards_arrows\", \"🔀\"},\n                {\"repeat\", \"🔁\"},\n                {\"repeat_one\", \"🔂\"},\n                {\"new\", \"🆕\"},\n                {\"up\", \"🆙\"},\n                {\"cool\", \"🆒\"},\n                {\"free\", \"🆓\"},\n                {\"ng\", \"🆖\"},\n                {\"signal_strength\", \"📶\"},\n                {\"cinema\", \"🎦\"},\n                {\"koko\", \"🈁\"},\n                {\"u6307\", \"🈯\"},\n                {\"u7a7a\", \"🈳\"},\n                {\"u6e80\", \"🈵\"},\n                {\"u5408\", \"🈴\"},\n                {\"u7981\", \"🈲\"},\n                {\"ideograph_advantage\", \"🉐\"},\n                {\"u5272\", \"🈹\"},\n                {\"u55b6\", \"🈺\"},\n                {\"u6709\", \"🈶\"},\n                {\"u7121\", \"🈚\"},\n                {\"restroom\", \"🚻\"},\n                {\"mens\", \"🚹\"},\n                {\"womens\", \"🚺\"},\n                {\"baby_symbol\", \"🚼\"},\n                {\"wc\", \"🚾\"},\n                {\"potable_water\", \"🚰\"},\n                {\"put_litter_in_its_place\", \"🚮\"},\n                {\"parking\", \"🅿️\"},\n                {\"wheelchair\", \"♿\"},\n                {\"no_smoking\", \"🚭\"},\n                {\"u6708\", \"🈷️\"},\n                {\"u7533\", \"🈸\"},\n                {\"sa\", \"🈂️\"},\n                {\"m\", \"Ⓜ️\"},\n                {\"passport_control\", \"🛂\"},\n                {\"baggage_claim\", \"🛄\"},\n                {\"left_luggage\", \"🛅\"},\n                {\"customs\", \"🛃\"},\n                {\"accept\", \"🉑\"},\n                {\"secret\", \"㊙️\"},\n                {\"congratulations\", \"㊗️\"},\n                {\"cl\", \"🆑\"},\n                {\"sos\", \"🆘\"},\n                {\"id\", \"🆔\"},\n                {\"no_entry_sign\", \"🚫\"},\n                {\"underage\", \"🔞\"},\n                {\"no_mobile_phones\", \"📵\"},\n                {\"do_not_litter\", \"🚯\"},\n                {\"non-potable_water\", \"🚱\"},\n                {\"no_bicycles\", \"🚳\"},\n                {\"no_pedestrians\", \"🚷\"},\n                {\"children_crossing\", \"🚸\"},\n                {\"no_entry\", \"⛔\"},\n                {\"eight_spoked_asterisk\", \"✳️\"},\n                {\"sparkle\", \"❇️\"},\n                {\"negative_squared_cross_mark\", \"❎\"},\n                {\"white_check_mark\", \"✅\"},\n                {\"eight_pointed_black_star\", \"✴️\"},\n                {\"heart_decoration\", \"💟\"},\n                {\"vs\", \"🆚\"},\n                {\"vibration_mode\", \"📳\"},\n                {\"mobile_phone_off\", \"📴\"},\n                {\"a\", \"🅰️\"},\n                {\"b\", \"🅱️\"},\n                {\"ab\", \"🆎\"},\n                {\"o2\", \"🅾️\"},\n                {\"diamond_shape_with_a_dot_inside\", \"💠\"},\n                {\"loop\", \"➿\"},\n                {\"recycle\", \"♻️\"},\n                {\"aries\", \"♈\"},\n                {\"taurus\", \"♉\"},\n                {\"gemini\", \"♊\"},\n                {\"cancer\", \"♋\"},\n                {\"leo\", \"♌\"},\n                {\"virgo\", \"♍\"},\n                {\"libra\", \"♎\"},\n                {\"scorpius\", \"♏\"},\n                {\"sagittarius\", \"♐\"},\n                {\"capricorn\", \"♑\"},\n                {\"aquarius\", \"♒\"},\n                {\"pisces\", \"♓\"},\n                {\"ophiuchus\", \"⛎\"},\n                {\"six_pointed_star\", \"🔯\"},\n                {\"atm\", \"🏧\"},\n                {\"chart\", \"💹\"},\n                {\"heavy_dollar_sign\", \"💲\"},\n                {\"currency_exchange\", \"💱\"},\n                {\"copyright\", \"©️\"},\n                {\"registered\", \"®️\"},\n                {\"tm\", \"™️\"},\n                {\"x\", \"❌\"},\n                {\"bangbang\", \"‼️\"},\n                {\"interrobang\", \"⁉️\"},\n                {\"exclamation\", \"❗\"},\n                {\"heavy_exclamation_mark\", \"❗\"},\n                {\"question\", \"❓\"},\n                {\"grey_exclamation\", \"❕\"},\n                {\"grey_question\", \"❔\"},\n                {\"o\", \"⭕\"},\n                {\"top\", \"🔝\"},\n                {\"end\", \"🔚\"},\n                {\"back\", \"🔙\"},\n                {\"on\", \"🔛\"},\n                {\"soon\", \"🔜\"},\n                {\"arrows_clockwise\", \"🔃\"},\n                {\"clock12\", \"🕛\"},\n                {\"clock1230\", \"🕧\"},\n                {\"clock1\", \"🕐\"},\n                {\"clock130\", \"🕜\"},\n                {\"clock2\", \"🕑\"},\n                {\"clock230\", \"🕝\"},\n                {\"clock3\", \"🕒\"},\n                {\"clock330\", \"🕞\"},\n                {\"clock4\", \"🕓\"},\n                {\"clock430\", \"🕟\"},\n                {\"clock5\", \"🕔\"},\n                {\"clock530\", \"🕠\"},\n                {\"clock6\", \"🕕\"},\n                {\"clock7\", \"🕖\"},\n                {\"clock8\", \"🕗\"},\n                {\"clock9\", \"🕘\"},\n                {\"clock10\", \"🕙\"},\n                {\"clock11\", \"🕚\"},\n                {\"clock630\", \"🕡\"},\n                {\"clock730\", \"🕢\"},\n                {\"clock830\", \"🕣\"},\n                {\"clock930\", \"🕤\"},\n                {\"clock1030\", \"🕥\"},\n                {\"clock1130\", \"🕦\"},\n                {\"heavy_multiplication_x\", \"✖️\"},\n                {\"heavy_plus_sign\", \"➕\"},\n                {\"heavy_minus_sign\", \"➖\"},\n                {\"heavy_division_sign\", \"➗\"},\n                {\"spades\", \"♠️\"},\n                {\"hearts\", \"♥️\"},\n                {\"clubs\", \"♣️\"},\n                {\"diamonds\", \"♦️\"},\n                {\"white_flower\", \"💮\"},\n                {\"100\", \"💯\"},\n                {\"heavy_check_mark\", \"✔️\"},\n                {\"ballot_box_with_check\", \"☑️\"},\n                {\"radio_button\", \"🔘\"},\n                {\"link\", \"🔗\"},\n                {\"curly_loop\", \"➰\"},\n                {\"wavy_dash\", \"〰️\"},\n                {\"part_alternation_mark\", \"〽️\"},\n                {\"trident\", \"🔱\"},\n                {\"black_medium_square\", \"◼️\"},\n                {\"white_medium_square\", \"◻️\"},\n                {\"black_medium_small_square\", \"◾\"},\n                {\"white_medium_small_square\", \"◽\"},\n                {\"black_small_square\", \"▪️\"},\n                {\"white_small_square\", \"▫️\"},\n                {\"small_red_triangle\", \"🔺\"},\n                {\"black_square_button\", \"🔲\"},\n                {\"white_square_button\", \"🔳\"},\n                {\"black_circle\", \"⚫\"},\n                {\"white_circle\", \"⚪\"},\n                {\"red_circle\", \"🔴\"},\n                {\"large_blue_circle\", \"🔵\"},\n                {\"small_red_triangle_down\", \"🔻\"},\n                {\"white_large_square\", \"⬜\"},\n                {\"black_large_square\", \"⬛\"},\n                {\"large_orange_diamond\", \"🔶\"},\n                {\"large_blue_diamond\", \"🔷\"},\n                {\"small_orange_diamond\", \"🔸\"},\n                {\"small_blue_diamond\", \"🔹\"}\n            };\n        }\n\n        public static string FindAndReplace(string text)\n        {\n            if (string.IsNullOrEmpty(text))\n                return text;\n            \n            var match = Regex.Match(text, @\":(\\w+):\");\n            if (match.Success)\n            {\n                for (var i = 1; i < match.Groups.Count; i++)\n                {\n                    string emoji;\n                    if (_emojis.TryGetValue(match.Groups[i].Value, out emoji))\n                        text = text.Replace(\":\" + match.Groups[i].Value + \":\", emoji);\n                }\n            }\n\n            return text;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/FilterGroup.cs",
    "content": "using System.Collections.Generic;\r\nusing System.Linq;\r\nusing CodeHub.Core.ViewModels;\r\n\r\nnamespace CodeHub.Core.Utils\n{\n    public static class FilterGroup\n    {\n        public static int[] IntegerCeilings = { 6, 11, 21, 31, 41, 51, 61, 71, 81, 91, 101, 251, 501, 1001, 2001, 4001, 8001, 16001, int.MaxValue };\n\n        private static string CreateRangeString(int key)\n        {\n            return IntegerCeilings.LastOrDefault(x => x < key) + \" to \" + (key - 1);\n        }\n\n        public static List<IGrouping<string, TElement>> CreateNumberedGroup<TElement>(IEnumerable<IGrouping<int, TElement>> results, string title, string prefix = null)\n        {\n            return results.Select(x => {\n                var text = (prefix != null ? prefix + \" \" : \"\") + CreateRangeString(x.Key) + \" \" + title;\n                return (IGrouping<string, TElement>)new FilterGroup<TElement>(text, x.ToList());\n            }).ToList();\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/GitHubAvatar.cs",
    "content": "﻿using System;\r\nusing CodeHub.Core.Utilities;\r\n\r\nnamespace CodeHub.Core.Utilities\r\n{\r\n    public class GitHubAvatar\r\n    {\r\n        public string AvatarUrl { get; }\r\n\r\n        public static GitHubAvatar Empty\r\n        {\r\n            get { return new GitHubAvatar((string)null); }\r\n        }\r\n\r\n        public GitHubAvatar(string avatarUrl)\r\n        {\r\n            AvatarUrl = avatarUrl;\r\n        }\r\n\r\n        public GitHubAvatar(Uri avatarUri)\r\n        {\r\n            AvatarUrl = avatarUri?.AbsoluteUri;\r\n        }\r\n    }\r\n}\r\n\r\npublic static class GitHubAvatarExtensions\r\n{\r\n    public static Uri ToUri(this GitHubAvatar @this, int? size = null)\r\n    {\r\n        if (@this == null || @this.AvatarUrl == null)\r\n            return null;\r\n\r\n        try\r\n        {\r\n            var baseUri = new UriBuilder(@this.AvatarUrl);\r\n\r\n            if (size == null)\r\n                return baseUri.Uri;\r\n\r\n            var queryToAppend = \"size=\" + size.Value;\r\n            if (baseUri.Query != null && baseUri.Query.Length > 1)\r\n                baseUri.Query = baseUri.Query.Substring(1) + \"&\" + queryToAppend; \r\n            else\r\n                baseUri.Query = queryToAppend; \r\n            return baseUri.Uri;\r\n        }\r\n        catch\r\n        {\r\n            return null;\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.Core/Utils/GitHubExtensions.cs",
    "content": "﻿using System;\nusing GitHubSharp.Models;\nusing System.Text;\nusing System.Security.Cryptography;\n\n\npublic static class GitHubExtensions\n{\n    private const string GitHubDefaultGravitar = \"https%3A%2F%2Fassets-cdn.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png&r=x&s=140\";\n\n    public static string GenerateCommiterName(this CommitModel x)\n    {\n        if (x.Commit.Author != null && !string.IsNullOrEmpty(x.Commit.Author.Name))\n            return x.Commit.Author.Name;\n        if (x.Commit.Committer != null && !string.IsNullOrEmpty(x.Commit.Committer.Name))\n            return x.Commit.Committer.Name;\n        if (x.Author != null)\n            return x.Author.Login;\n        return x.Committer != null ? x.Committer.Login : \"Unknown\";\n    }\n\n    public static Uri GenerateGravatarUrl(this CommitModel x)\n    {\n        if (x == null)\n            return null;\n\n        try\n        {\n            if (x.Author != null && !string.IsNullOrEmpty(x.Author.AvatarUrl))\n                return new Uri(x.Author.AvatarUrl);\n\n            var inputBytes = Encoding.UTF8.GetBytes(x.Commit.Author.Email.Trim().ToLower());\n            var hash = MD5.Create().ComputeHash(inputBytes);\n            var sb = new StringBuilder();\n            for (int i = 0; i < hash.Length; i++)\n                sb.Append(hash[i].ToString(\"x2\"));\n            return new Uri(string.Format(\"http://www.gravatar.com/avatar/{0}?d={1}\", sb, GitHubDefaultGravitar));\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}\n\n    "
  },
  {
    "path": "CodeHub.Core/Utils/GitHubList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Octokit;\n\nnamespace CodeHub.Core.Utils\n{\n    public class GitHubList<T>\n    {\n        private readonly GitHubClient _client;\n        private Uri _uri;\n        private readonly IDictionary<string, string> _parameters;\n\n        public GitHubList(\n            GitHubClient client,\n            Uri uri,\n            IDictionary<string, string> parameters = null)\n        {\n            _client = client;\n            _uri = uri;\n            _parameters = parameters;\n        }\n\n        public async Task<IReadOnlyList<T>> Next() \n        {\n            if (_uri == null)\n                return null;\n\n            var ret = await _client.Connection.Get<IReadOnlyList<T>>(\n                _uri, _parameters, \"application/json\");\n\n            _uri = ret.HttpResponse.ApiInfo.Links.ContainsKey(\"next\")\n\t\t\t\t? ret.HttpResponse.ApiInfo.Links[\"next\"]\n\t\t\t\t: null;\n\n            return ret.Body;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/Utils/OctokitClientFactory.cs",
    "content": "﻿using System;\nusing Octokit.Internal;\nusing Splat;\nusing Octokit;\nusing System.Net.Http;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.Utilities\n{\n    public static class OctokitClientFactory\n    {\n        public static Func<HttpClientHandler> CreateMessageHandler = () => new HttpClientHandler();\n        public static readonly string[] Scopes = { \"user\", \"repo\", \"gist\", \"notifications\" };\n        public static readonly ProductHeaderValue UserAgent = new ProductHeaderValue(\"CodeHub\");\n\n        public static GitHubClient Create(\n            Uri domain,\n            Credentials credentials,\n            TimeSpan? requestTimeout = null)\n        {\n            var networkActivityService = Locator.Current.GetService<INetworkActivityService>();\n            var client = new HttpClientAdapter(CreateMessageHandler);\n            var httpClient = new OctokitNetworkClient(client, networkActivityService);\n\n            var connection = new Connection(\n                UserAgent,\n                domain,\n                new InMemoryCredentialStore(credentials),\n                httpClient,\n                new SimpleJsonSerializer());\n            \n            var gitHubClient = new GitHubClient(connection);\n            gitHubClient.SetRequestTimeout(requestTimeout ?? TimeSpan.FromSeconds(20));\n            return gitHubClient;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/OctokitNetworkClient.cs",
    "content": "﻿using Octokit.Internal;\nusing Octokit;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing System;\n\nnamespace CodeHub.Core.Utilities\n{\n    /// <summary>\n    /// A decorator class for the <see cref=\"IHttpClient\"/> object which will \n    /// trigger the network activity spinner\n    /// </summary>\n    class OctokitNetworkClient : IHttpClient\n    {\n        private readonly IHttpClient _httpClient;\n        private readonly INetworkActivityService _networkActivity;\n\n        public OctokitNetworkClient(IHttpClient httpClient, INetworkActivityService networkActivity)\n        {\n            _httpClient = httpClient;\n            _networkActivity = networkActivity;\n        }\n\n        public async Task<IResponse> Send(IRequest request, System.Threading.CancellationToken cancellationToken)\n        {\n            using (_networkActivity.ActivateNetwork())\n                return await _httpClient.Send(request, cancellationToken);\n        }\n\n        public void Dispose() => _httpClient.Dispose();\n\n        public void SetRequestTimeout(TimeSpan timeout) => _httpClient.SetRequestTimeout(timeout);\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/RepositoryIdentifier.cs",
    "content": "using System.Linq;\n\nnamespace CodeHub.Core.Utils\n{\n    public class RepositoryIdentifier\n    {\n        public string Owner { get; }\n        public string Name { get; }\n\n        public RepositoryIdentifier(string owner, string name)\n        {\n            Owner = owner;\n            Name = name;\n        }\n\n        public static RepositoryIdentifier FromFullName(string id)\n        {\n            var split = id.Split(new [] { '/' }, 2);\n            if (split.Length != 2 || split.Any(string.IsNullOrEmpty))\n                return null;\n            return new RepositoryIdentifier(split[0], split[1]);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/ViewModelExtensions.cs",
    "content": "using CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels;\nusing MvvmCross.Platform;\n\npublic static class ViewModelExtensions\n{\n    public static IApplicationService GetApplication(this BaseViewModel vm)\n    {\n        return Mvx.Resolve<IApplicationService>();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/Utils/WeakReferenceExtensions.cs",
    "content": "﻿using System;\n\npublic static class WeakReferenceExtensions\n{\n    public static T Get<T>(this WeakReference<T> @this) where T : class\n    {\n        T t;\n        @this.TryGetTarget(out t);\n        return t;\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Accounts/AddAccountViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.Messages;\nusing System.Reactive;\nusing ReactiveUI;\nusing Splat;\nusing System.Reactive.Linq;\nusing GitHubSharp;\nusing System.Reactive.Threading.Tasks;\n\nnamespace CodeHub.Core.ViewModels.Accounts\n{\n    public class AddAccountViewModel : ReactiveObject \n    {\n        private readonly ILoginService _loginService;\n        private readonly IAlertDialogService _alertDialogService;\n\n        private string _username;\n        public string Username\n        {\n            get { return _username; }\n            set { this.RaiseAndSetIfChanged(ref _username, value); }\n        }\n\n        private string _password;\n        public string Password\n        {\n            get { return _password; }\n            set { this.RaiseAndSetIfChanged(ref _password, value); }\n        }\n\n        private string _domain;\n        public string Domain\n        {\n            get { return _domain; }\n            set { this.RaiseAndSetIfChanged(ref _domain, value); }\n        }\n\n        private string _token;\n        public string Token\n        {\n            get { return _token; }\n            set { this.RaiseAndSetIfChanged(ref _token, value); }\n        }\n\n        private bool _tokenAuthentication;\n        public bool TokenAuthentication\n        {\n            get { return _tokenAuthentication; }\n            set { this.RaiseAndSetIfChanged(ref _tokenAuthentication, value); }\n        }\n\n        public string TwoFactor { get; set; }\n\n        public ReactiveCommand<Unit, Unit> LoginCommand { get; }\n\n        public AddAccountViewModel(\n            ILoginService loginService = null,\n            IAlertDialogService alertDialogService = null)\n        {\n            _loginService = loginService ?? Locator.Current.GetService<ILoginService>();\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            LoginCommand = ReactiveCommand.CreateFromTask(Login);\n\n            LoginCommand\n                .Subscribe(x => MessageBus.Current.SendMessage(new LogoutMessage()));\n\n            LoginCommand\n                .ThrownExceptions\n                .SelectMany(HandleLoginException)\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n        }\n\n        private IObservable<UserError> HandleLoginException(Exception e)\n        {\n            TwoFactor = null;\n\n            if (e is Octokit.TwoFactorRequiredException)\n            {\n                _alertDialogService\n                    .PromptTextBox(\"Authentication Error\",\n                                   \"Please provide the two-factor authentication code for this account.\",\n                                   string.Empty, \"Login\")\n                    .ToObservable()\n                    .Do(x => TwoFactor = x)\n                    .Select(_ => Unit.Default)\n                    .InvokeReactiveCommand(LoginCommand);\n\n                return Observable.Empty<UserError>();\n            }\n\n            if (e is Octokit.NotFoundException err)\n            {\n                return Observable.Return(\n                    new UserError($\"The provided domain was incorrect. The host could not be found.\"));\n            }\n\n            if (e is Octokit.ForbiddenException && TokenAuthentication)\n            {\n                return Observable.Return(\n                    new UserError(\"The provided token is invalid! Please try again or \" +\n                                  \"create a new token as this one might have been revoked.\"));\n            }\n\n            return Observable.Return(new UserError(\"Unable to login!\", e));\n        }\n\n        private async Task Login()\n        {\n            if (string.IsNullOrEmpty(Domain))\n                throw new ArgumentException(\"Must have a valid GitHub domain\");\n            if (!Uri.TryCreate(Domain, UriKind.Absolute, out Uri domainUri))\n                throw new Exception(\"The provided domain is not a valid URL.\");\n\n            var apiUrl = Domain;\n            if (apiUrl != null)\n            {\n                if (!apiUrl.EndsWith(\"/\", StringComparison.Ordinal))\n                    apiUrl += \"/\";\n                if (!apiUrl.Contains(\"/api/\"))\n                    apiUrl += \"api/v3/\";\n            }\n\n            if (TokenAuthentication)\n            {\n                var trimmedToken = Token?.Trim() ?? string.Empty;\n\n                if (string.IsNullOrEmpty(trimmedToken))\n                    throw new ArgumentException(\"Must have a valid token\");\n\n                await _loginService.LoginWithToken(apiUrl, Domain, trimmedToken, true);\n            }\n            else\n            {\n                if (string.IsNullOrEmpty(Username))\n                    throw new ArgumentException(\"Must have a valid username\");\n                if (string.IsNullOrEmpty(Password))\n                    throw new ArgumentException(\"Must have a valid password\");\n                \n                await _loginService.LoginWithBasic(apiUrl, Username, Password, TwoFactor);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Accounts/OAuthLoginViewModel.cs",
    "content": "using System;\nusing ReactiveUI;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.Services;\nusing Splat;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.Accounts\n{\n    public class OAuthLoginViewModel : ReactiveObject\n    {\n        public static readonly string RedirectUri = \"http://dillonbuchanan.com/\";\n        private readonly ILoginService _loginService;\n        private readonly IAlertDialogService _alertDialogService;\n\n        public string LoginUrl\n        {\n            get\n            {\n                var web = WebDomain.TrimEnd('/');\n                return string.Format(\n                    web + \"/login/oauth/authorize?client_id={0}&redirect_uri={1}&scope={2}\",\n                    Secrets.GithubOAuthId,\n                    Uri.EscapeDataString(OAuthLoginViewModel.RedirectUri),\n                    Uri.EscapeDataString(\"user:follow,repo,notifications,gist,read:org\"));\n            }\n        }\n\n        public string WebDomain { get; set; } = GitHubSharp.Client.AccessTokenUri;\n\n        public ReactiveCommand<string, Unit> LoginCommand { get; }\n\n        public OAuthLoginViewModel(\n            ILoginService loginService = null,\n            IAlertDialogService alertDialogService = null)\n        {\n            _loginService = loginService ?? Locator.Current.GetService<ILoginService>();\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            LoginCommand = ReactiveCommand.CreateFromTask<string>(async code =>\n            {\n                await _loginService.LoginWithToken(\n                    Secrets.GithubOAuthId, Secrets.GithubOAuthSecret,\n                    code, RedirectUri, WebDomain, GitHubSharp.Client.DefaultApi);\n                MessageBus.Current.SendMessage(new LogoutMessage());\n            });\n\n            LoginCommand\n                .ThrownExceptions\n                .Subscribe(err => _alertDialogService.Alert(\"Error!\", err.Message).ToBackground());\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/FeedbackComposerViewModel.cs",
    "content": "﻿using ReactiveUI;\nusing System.Reactive;\nusing CodeHub.Core.Services;\nusing System;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing Humanizer;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class FeedbackComposerViewModel : ReactiveObject\n    {\n        private const string CodeHubOwner = \"codehubapp\";\n        private const string CodeHubName = \"codehub\";\n\n        private string _subject;\n        public string Subject\n        {\n            get { return _subject; }\n            set { this.RaiseAndSetIfChanged(ref _subject, value); }\n        }\n\n        private string _description;\n        public string Description\n        {\n            get { return _description; }\n            set { this.RaiseAndSetIfChanged(ref _description, value); }\n        }\n\n        public string Title => \"Open Issue\";\n\n        public ReactiveCommand<Unit, Unit> SubmitCommand { get; private set; }\n\n        public ReactiveCommand<Unit, bool> DismissCommand { get; private set; }\n\n        public FeedbackComposerViewModel(\n            IApplicationService applicationService = null,\n            IAlertDialogService alertDialogService = null)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            SubmitCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                if (string.IsNullOrEmpty(Subject))\n                    throw new ArgumentException(\"You must provide a title for this issue!\");\n\n                var createIssueRequest = new Octokit.NewIssue(Subject) { Body = Description };\n\n                await applicationService.GitHubClient.Issue.Create(CodeHubOwner, CodeHubName, createIssueRequest);\n            }, this.WhenAnyValue(x => x.Subject).Select(x => !string.IsNullOrEmpty(x)));\n\n            SubmitCommand\n                .ThrownExceptions\n                .Select(ex => new UserError(\"There was a problem trying to post your feedback.\", ex))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            DismissCommand = ReactiveCommand.CreateFromTask(async t =>\n            {\n                if (string.IsNullOrEmpty(Description) && string.IsNullOrEmpty(Subject))\n                    return true;\n                \n                return await alertDialogService.PromptYesNo(\n                    \"Discard Issue?\",\n                    \"Are you sure you want to discard this issue?\");\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/FeedbackItemViewModel.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing Humanizer;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class FeedbackItemViewModel : ReactiveObject, ICanGoToViewModel\n    {\n        public string Title { get; }\n\n        public string ImageUrl { get; }\n\n        public ReactiveCommand<Unit, Unit> GoToCommand { get; } = ReactiveCommand.Create(() => { });\n\n        public DateTimeOffset Created { get; }\n\n        public string CreatedString { get; }\n\n        public string RepositoryName { get; }\n\n        public string RepositoryOwner { get; }\n\n        public int IssueId { get; }\n\n        internal FeedbackItemViewModel(string repositoryOwner, string repositoryName, Octokit.Issue issue)\n        {\n            RepositoryOwner = repositoryOwner;\n            RepositoryName = repositoryName;\n            IssueId = issue.Number;\n            Title = issue.Title;\n            ImageUrl = issue.User.AvatarUrl;\n            Created = issue.CreatedAt;\n            CreatedString = Created.Humanize();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/FeedbackViewModel.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing CodeHub.Core.Services;\nusing System.Reactive;\nusing Splat;\nusing Octokit;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class FeedbackViewModel : ReactiveObject, IProvidesSearchKeyword\n    {\n        private const string CodeHubOwner = \"codehubapp\";\n        private const string CodeHubName = \"codehub\";\n\n        public IReadOnlyReactiveList<FeedbackItemViewModel> Items { get; }\n\n        private string _searchKeyword;\n        public string SearchKeyword\n        {\n            get { return _searchKeyword; }\n            set { this.RaiseAndSetIfChanged(ref _searchKeyword, value); }\n        }\n\n        private bool? _isEmpty;\n        public bool? IsEmpty\n        {\n            get { return _isEmpty; }\n            set { this.RaiseAndSetIfChanged(ref _isEmpty, value); }\n        }\n\n        public string Title => \"Feedback\";\n\n        public ReactiveCommand<Unit, Unit> LoadCommand { get; private set; }\n\n        public FeedbackViewModel(IApplicationService applicationService = null)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            var items = new ReactiveList<Issue>(resetChangeThreshold: 1);\n            var feedbackItems = items.CreateDerivedCollection(\n                x => new FeedbackItemViewModel(CodeHubOwner, CodeHubName, x));\n\n            Items = feedbackItems.CreateDerivedCollection(\n                x => x,\n                x => x.Title.ContainsKeyword(SearchKeyword),\n                signalReset: this.WhenAnyValue(x => x.SearchKeyword));\n\n            LoadCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                items.Clear();\n\n                var list = applicationService.GitHubClient.RetrieveList<Issue>(\n                    ApiUrls.Issues(CodeHubOwner, CodeHubName));\n\n                var issues = await list.Next();\n                IsEmpty = issues?.Count > 0;\n\n                while (issues != null)\n                {\n                    items.AddRange(issues);\n                    issues = await list.Next();\n                }\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/MenuViewModel.cs",
    "content": "using System.Collections.Generic;\nusing System.Windows.Input;\nusing CodeHub.Core.Data;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Events;\nusing CodeHub.Core.ViewModels.Issues;\nusing CodeHub.Core.ViewModels.User;\nusing System.Linq;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.ViewModels.Notifications;\nusing GitHubSharp.Models;\nusing MvvmCross.Core.ViewModels;\nusing System;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class MenuViewModel : BaseViewModel\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IFeaturesService _featuresService;\n        private int _notifications;\n        private List<BasicUserModel> _organizations;\n        private readonly IDisposable _notificationCountToken;\n\n        public int Notifications\n        {\n            get { return _notifications; }\n            set { _notifications = value; RaisePropertyChanged(); }\n        }\n\n        public List<BasicUserModel> Organizations\n        {\n            get { return _organizations; }\n            set { _organizations = value; RaisePropertyChanged(); }\n        }\n        \n        public Account Account\n        {\n            get { return _applicationService.Account; }\n        }\n\n        public bool ShouldShowUpgrades\n        {\n            get { return !_featuresService.IsProEnabled; }\n        }\n        \n        public MenuViewModel(IApplicationService application = null,\n                             IFeaturesService featuresService = null,\n                             IMessageService messageService = null)\n        {\n            _applicationService = application ?? GetService<IApplicationService>();\n            _featuresService = featuresService ?? GetService<IFeaturesService>();\n            messageService = messageService ?? GetService<IMessageService>();\n\n            _notificationCountToken = messageService.Listen<NotificationCountMessage>(OnNotificationCountMessage);\n        }\n\n        private void OnNotificationCountMessage(NotificationCountMessage msg)\n        {\n            Notifications = msg.Count;\n        }\n\n        public ICommand GoToProfileCommand\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<UserViewModel>(new UserViewModel.NavObject { Username = _applicationService.Account.Username })); }\n        }\n\n        public ICommand GoToNotificationsCommand\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<NotificationsViewModel>(null)); }\n        }\n\n        public ICommand GoToMyIssuesCommand\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<MyIssuesViewModel>(null)); }\n        }\n\n        public ICommand GoToMyEvents\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<UserEventsViewModel>(new UserEventsViewModel.NavObject { Username = Account.Username })); }\n        }\n\n        public ICommand GoToOrganizationEventsCommand\n        {\n            get { return new MvxCommand<string>(x => ShowMenuViewModel<Events.UserEventsViewModel>(new Events.UserEventsViewModel.NavObject { Username = x }));}\n        }\n\n        public ICommand GoToOrganizationCommand\n        {\n            get { return new MvxCommand<string>(x => ShowMenuViewModel<Organizations.OrganizationViewModel>(new Organizations.OrganizationViewModel.NavObject { Name = x }));}\n        }\n\n        public ICommand GoToOrganizationsCommand\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<Organizations.OrganizationsViewModel>(new Organizations.OrganizationsViewModel.NavObject { Username = Account.Username }));}\n        }\n\n        public ICommand GoToNewsCommand\n        {\n            get { return new MvxCommand(() => ShowMenuViewModel<NewsViewModel>(null));}\n        }\n\n        public ICommand LoadCommand\n        {\n            get { return new MvxCommand(Load);}    \n        }\n\n        private void Load()\n        {\n            var notificationRequest = this.GetApplication().Client.Notifications.GetAll();\n            this.GetApplication().Client.ExecuteAsync(notificationRequest)\n                .ToBackground(x => Notifications = x.Data.Count);\n\n            var organizationsRequest = this.GetApplication().Client.AuthenticatedUser.GetOrganizations();\n            this.GetApplication().Client.ExecuteAsync(organizationsRequest)\n                .ToBackground(x => Organizations = x.Data.ToList());\n        }\n\n        //\n        //        private async Task PromptForPushNotifications()\n        //        {\n        //            // Push notifications are not enabled for enterprise\n        //            if (Account.IsEnterprise)\n        //                return;\n        //\n        //            try\n        //            {\n        //                var features = Mvx.Resolve<IFeaturesService>();\n        //                var alertDialog = Mvx.Resolve<IAlertDialogService>();\n        //                var push = Mvx.Resolve<IPushNotificationsService>();\n        //                var \n        //                // Check for push notifications\n        //                if (Account.IsPushNotificationsEnabled == null && features.IsPushNotificationsActivated)\n        //                {\n        //                    var result = await alertDialog.PromptYesNo(\"Push Notifications\", \"Would you like to enable push notifications for this account?\");\n        //                    if (result)\n        //                        Task.Run(() => push.Register()).FireAndForget();\n        //                    Account.IsPushNotificationsEnabled = result;\n        //                    Accounts.Update(Account);\n        //                }\n        //                else if (Account.IsPushNotificationsEnabled.HasValue && Account.IsPushNotificationsEnabled.Value)\n        //                {\n        //                    Task.Run(() => push.Register()).FireAndForget();\n        //                }\n        //            }\n        //            catch (Exception e)\n        //            {\n        //                _alertDialogService.Alert(\"Error\", e.Message);\n        //            }\n        //        }\n\n        private static readonly IDictionary<string, string> Presentation = new Dictionary<string, string> { { PresentationValues.SlideoutRootPresentation, string.Empty } };\n\n        public ICommand DeletePinnedRepositoryCommand\n        {\n            get\n            {\n                return new MvxCommand<PinnedRepository>(x =>\n                {\n                    Account.PinnedRepositories.Remove(x);\n                    _applicationService.UpdateActiveAccount().ToBackground();\n                }, x => x != null);\n            }\n        }\n\n        protected bool ShowMenuViewModel<T>(object data) where T : IMvxViewModel\n        {\n            return this.ShowViewModel<T>(data, new MvxBundle(Presentation));\n        }\n\n        public IEnumerable<PinnedRepository> PinnedRepositories\n        {\n            get { return Account.PinnedRepositories; }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/StartupViewModel.cs",
    "content": "using System;\nusing CodeHub.Core.Services;\nusing System.Linq;\nusing System.Windows.Input;\nusing Dumb = MvvmCross.Core.ViewModels;\nusing System.Threading.Tasks;\nusing ReactiveUI;\nusing System.Reactive.Threading.Tasks;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class StartupViewModel : BaseViewModel\n    {\n        private bool _isLoggingIn;\n        private string _status;\n        private Uri _imageUrl;\n        private readonly IApplicationService _applicationService;\n        private readonly IAccountsService _accountsService;\n\n        public bool IsLoggingIn\n        {\n            get { return _isLoggingIn; }\n            private set { this.RaiseAndSetIfChanged(ref _isLoggingIn, value); }\n        }\n\n        public string Status\n        {\n            get { return _status; }\n            private set { this.RaiseAndSetIfChanged(ref _status, value); }\n        }\n\n        public Uri ImageUrl\n        {\n            get { return _imageUrl; }\n            private set { this.RaiseAndSetIfChanged(ref _imageUrl, value); }\n        }\n\n        public ICommand StartupCommand\n        {\n            get { return new Dumb.MvxAsyncCommand(Startup); }\n        }\n\n        public Data.Account Account => _applicationService.Account;\n\n        public ReactiveCommand<Unit, Unit> GoToMenu { get; } = ReactiveCommand.Create(() => { });\n\n        public ReactiveCommand<Unit, Unit> GoToAccounts { get; } = ReactiveCommand.Create(() => { });\n\n        public ReactiveCommand<Unit, Unit> GoToNewAccount { get; } = ReactiveCommand.Create(() => { });\n\n        public StartupViewModel(\n            IApplicationService applicationService = null,\n            IAccountsService accountsService = null)\n        {\n            _applicationService = applicationService ?? GetService<IApplicationService>();\n            _accountsService = accountsService ?? GetService<IAccountsService>();\n        }\n\n        protected async Task Startup()\n        {\n            var accounts = (await _accountsService.GetAccounts()).ToList();\n            if (!accounts.Any())\n            {\n                GoToNewAccount.ExecuteNow();\n                return;\n            }\n\n            var account = await _accountsService.GetActiveAccount();\n            if (account == null)\n            {\n                GoToAccounts.ExecuteNow();\n                return;\n            }\n\n            var isEnterprise = account.IsEnterprise || !string.IsNullOrEmpty(account.Password);\n\n            //Lets login!\n            try\n            {\n                ImageUrl = null;\n                Status = null;\n                IsLoggingIn = true;\n\n                Uri accountAvatarUri = null;\n                Uri.TryCreate(account.AvatarUrl, UriKind.Absolute, out accountAvatarUri);\n                ImageUrl = accountAvatarUri;\n                Status = \"Logging in as \" + account.Username;\n\n                await _applicationService.LoginAccount(account);\n\n                if (!isEnterprise)\n                    StarOrWatch();\n\n                GoToMenu.ExecuteNow();\n            }\n            catch (Octokit.AuthorizationException e)\n            {\n                DisplayAlertAsync(\"The credentials for the selected account are not valid. \" + e.Message)\n                    .ToObservable()\n                    .BindCommand(GoToAccounts);\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(e.Message);\n                GoToAccounts.ExecuteNow();\n            }\n            finally\n            {\n                IsLoggingIn = false;\n            }\n        }\n\n        private void StarOrWatch()\n        {\n            if (Settings.ShouldStar)\n            {\n                Settings.ShouldStar = false;\n\n                _applicationService\n                    .GitHubClient.Activity.Starring\n                    .StarRepo(\"codehubapp\", \"codehub\")\n                    .ToBackground();\n            }\n\n            if (Settings.ShouldWatch)\n            {\n                Settings.ShouldWatch = false;\n\n                var subscription = new Octokit.NewSubscription\n                {\n                    Subscribed = true\n                };\n\n                _applicationService\n                    .GitHubClient.Activity.Watching\n                    .WatchRepo(\"codehubapp\", \"codehub\", subscription)\n                    .ToBackground();\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/App/SupportViewModel.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing CodeHub.Core.Services;\nusing System.Reactive.Linq;\nusing System.Reactive;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.App\n{\n    public class SupportViewModel : ReactiveObject, ILoadableViewModel\n    {\n        public readonly static string CodeHubOwner = \"codehubapp\";\n        public readonly static string CodeHubName = \"codehub\";\n\n        private int? _contributors;\n        public int? Contributors\n        {\n            get { return _contributors; }\n            private set { this.RaiseAndSetIfChanged(ref _contributors, value); }\n        }\n\n        public string Title => \"Feedback & Support\";\n\n        private readonly ObservableAsPropertyHelper<DateTimeOffset?> _lastCommit;\n        public DateTimeOffset? LastCommit => _lastCommit.Value;\n\n        private Octokit.Repository _repository;\n        public Octokit.Repository Repository\n        {\n            get { return _repository; }\n            private set { this.RaiseAndSetIfChanged(ref _repository, value); }\n        }\n\n        public ReactiveCommand<Unit, Unit> LoadCommand { get; }\n\n        public SupportViewModel(IApplicationService applicationService = null)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            _lastCommit = this\n                .WhenAnyValue(x => x.Repository).Where(x => x != null)\n                .Select(x => x.PushedAt).ToProperty(this, x => x.LastCommit);\n\n            LoadCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                applicationService.GitHubClient.Repository.GetAllContributors(CodeHubOwner, CodeHubName)\n                        .ToBackground(x => Contributors = x.Count);\n                Repository = await applicationService.GitHubClient.Repository.Get(CodeHubOwner, CodeHubName);\n            });\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/BaseViewModel.cs",
    "content": "using CodeHub.Core.Services;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing MvvmCross.Platform;\nusing ReactiveUI;\nusing System;\nusing System.Reactive;\nusing System.Reactive.Subjects;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public interface IProvidesTitle\n    {\n        string Title { get; }\n    }\n\n    public interface IRoutingViewModel\n    {\n        IObservable<IBaseViewModel> RequestNavigation { get; }\n\n        IObservable<Unit> RequestDismiss { get; }\n    }\n\n    public interface IBaseViewModel : ISupportsActivation, IProvidesTitle, IRoutingViewModel\n    {\n    }\n\n    /// <summary>\n    ///    Defines the BaseViewModel type.\n    /// </summary>\n    public abstract class BaseViewModel : MvxViewModel, IBaseViewModel, IReactiveObject\n    {\n        private readonly ViewModelActivator _viewModelActivator = new ViewModelActivator();\n        private readonly ISubject<IBaseViewModel> _requestNavigationSubject = new Subject<IBaseViewModel>();\n        private readonly ISubject<Unit> _requestDismissSubject = new Subject<Unit>();\n\n        public event PropertyChangingEventHandler PropertyChanging;\n\n        public void RaisePropertyChanging(PropertyChangingEventArgs args)\n        {\n            this.RaisePropertyChanged(args.PropertyName);\n        }\n\n\n        ViewModelActivator ISupportsActivation.Activator\n        {\n            get { return _viewModelActivator; }\n        }\n\n        private string _title;\n        public string Title\n        {\n            get { return _title; }\n            protected set\n            {\n                if (value != _title)\n                {\n                    _title = value;\n                    this.RaisePropertyChanged();\n                }\n            }\n        }\n\n        protected void NavigateTo(IBaseViewModel viewModel)\n        {\n            _requestNavigationSubject.OnNext(viewModel);\n        }\n\n        protected void Dismiss()\n        {\n            _requestDismissSubject.OnNext(Unit.Default);\n        }\n\n        IObservable<IBaseViewModel> IRoutingViewModel.RequestNavigation\n        {\n            get { return _requestNavigationSubject; }\n        }\n\n        IObservable<Unit> IRoutingViewModel.RequestDismiss\n        {\n            get { return _requestDismissSubject; }\n        }\n\n        /// <summary>\n        /// Gets the go to URL command.\n        /// </summary>\n        /// <value>The go to URL command.</value>\n        public ICommand GoToUrlCommand\n        {\n            get { return new MvxCommand<string>(x => ShowViewModel<WebBrowserViewModel>(new WebBrowserViewModel.NavObject { Url = x })); }\n        }\n\n        /// <summary>\n        /// Gets the ViewModelTxService\n        /// </summary>\n        /// <value>The tx sevice.</value>\n        protected IViewModelTxService TxSevice\n        {\n            get { return GetService<IViewModelTxService>(); }\n        }\n\n        /// <summary>\n        /// Gets the alert service\n        /// </summary>\n        /// <value>The alert service.</value>\n        protected IAlertDialogService AlertService\n        {\n            get { return GetService<IAlertDialogService>(); }\n        }\n\n        /// <summary>\n        /// Gets the service.\n        /// </summary>\n        /// <typeparam name=\"TService\">The type of the service.</typeparam>\n        /// <returns>An instance of the service.</returns>\n        protected TService GetService<TService>() where TService : class\n        {\n            return Mvx.Resolve<TService>();\n        }\n\n        /// <summary>\n        /// Display an error message to the user\n        /// </summary>\n        /// <param name=\"message\">Message.</param>\n        protected void DisplayAlert(string message)\n        {\n            AlertService.Alert(\"Error!\", message).ToBackground();\n        }\n\n        /// <summary>\n        /// Display an error message to the user\n        /// </summary>\n        /// <param name=\"message\">Message.</param>\n        protected Task DisplayAlertAsync(string message)\n        {\n            return AlertService.Alert(\"Error!\", message);\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Changesets/ChangesetViewModel.cs",
    "content": "using System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Repositories;\nusing GitHubSharp.Models;\nusing System.Threading.Tasks;\nusing CodeHub.Core.ViewModels.Source;\nusing MvvmCross.Platform;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.User;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.Changesets\n{\n    public class ChangesetViewModel : LoadableViewModel\n    {\n        private readonly CollectionViewModel<CommentModel> _comments = new CollectionViewModel<CommentModel>();\n        private readonly IApplicationService _applicationService;\n        private readonly IFeaturesService _featuresService;\n        private CommitModel _commitModel;\n\n        public string Node { get; private set; }\n\n        public string User { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public bool ShowRepository { get; private set; }\n\n        public CommitModel Changeset\n        {\n            get { return _commitModel; }\n            private set { this.RaiseAndSetIfChanged(ref _commitModel, value); }\n        }\n\n        private bool _shouldShowPro; \n        public bool ShouldShowPro\n        {\n            get { return _shouldShowPro; }\n            protected set { this.RaiseAndSetIfChanged(ref _shouldShowPro, value); }\n        }\n\n        public ICommand GoToRepositoryCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<RepositoryViewModel>(new RepositoryViewModel.NavObject { Username = User, Repository = Repository })); }\n        }\n\n        public ICommand GoToHtmlUrlCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<WebBrowserViewModel>(new WebBrowserViewModel.NavObject { Url = _commitModel.Url }), () => _commitModel != null); }\n        }\n\n        public CollectionViewModel<CommentModel> Comments\n        {\n            get { return _comments; }\n        }\n\n        public ReactiveUI.ReactiveCommand<Unit, bool> GoToOwner { get; }\n\n        public ChangesetViewModel(IApplicationService application, IFeaturesService featuresService)\n        {\n            _applicationService = application;\n            _featuresService = featuresService;\n\n            GoToOwner = ReactiveUI.ReactiveCommand.Create(\n                () => ShowViewModel<UserViewModel>(new UserViewModel.NavObject { Username = Changeset?.Author?.Login }),\n                this.Bind(x => x.Changeset, true).Select(x => x?.Author?.Login != null));\n        }\n\n        public void Init(NavObject navObject)\n        {\n            User = navObject.Username;\n            Repository = navObject.Repository;\n            Node = navObject.Node;\n            ShowRepository = navObject.ShowRepository;\n            Title = \"Commit \" + (Node.Length > 6 ? Node.Substring(0, 6) : Node);\n        }\n\n        protected override Task Load()\n        {\n            if (_featuresService.IsProEnabled)\n                ShouldShowPro = false;\n            else\n            {\n                var request = _applicationService.Client.Users[User].Repositories[Repository].Get();\n                _applicationService.Client.ExecuteAsync(request)\n                    .ToBackground(x => ShouldShowPro = x.Data.Private && !_featuresService.IsProEnabled);\n            }\n\n            var t1 = this.RequestModel(_applicationService.Client.Users[User].Repositories[Repository].Commits[Node].Get(), response => Changeset = response.Data);\n            Comments.SimpleCollectionLoad(_applicationService.Client.Users[User].Repositories[Repository].Commits[Node].Comments.GetAll()).ToBackground();\n            return t1;\n        }\n\n        public async Task AddComment(string text)\n        {\n            var c = await _applicationService.Client.ExecuteAsync(_applicationService.Client.Users[User].Repositories[Repository].Commits[Node].Comments.Create(text));\n            Comments.Items.Add(c.Data);\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public string Node { get; set; }\n            public bool ShowRepository { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Changesets/ChangesetsViewModel.cs",
    "content": "using GitHubSharp;\nusing System.Collections.Generic;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Changesets\n{\n    public class ChangesetsViewModel : CommitsViewModel\n    {\n        public string Branch { get; private set; }\n\n        public ChangesetsViewModel(\n            IApplicationService applicationService = null,\n            IFeaturesService featuresService = null)\n            : base(applicationService, featuresService)\n        {\n        }\n\n        public void Init(NavObject navObject)\n        {\n            base.Init(navObject);\n            Branch = navObject.Branch;\n        }\n\n        protected override GitHubRequest<List<CommitModel>> GetRequest()\n        {\n            return this.GetApplication().Client.Users[Username].Repositories[Repository].Commits.GetAll(Branch);\n        }\n\n        public new class NavObject : CommitsViewModel.NavObject\n        {\n            public string Branch { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Changesets/CommitsViewModel.cs",
    "content": "using GitHubSharp.Models;\nusing System.Windows.Input;\nusing System.Threading.Tasks;\nusing GitHubSharp;\nusing System.Collections.Generic;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Services;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.Changesets\n{\n    public abstract class CommitsViewModel : LoadableViewModel\n    {\n        private readonly CollectionViewModel<CommitModel> _commits = new CollectionViewModel<CommitModel>();\n        private readonly IFeaturesService _featuresService;\n        private readonly IApplicationService _applicationService;\n\n        public string Username\n        {\n            get;\n            private set;\n        }\n\n        public string Repository\n        {\n            get;\n            private set;\n        }\n\n        private bool _shouldShowPro; \n        public bool ShouldShowPro\n        {\n            get { return _shouldShowPro; }\n            protected set { this.RaiseAndSetIfChanged(ref _shouldShowPro, value); }\n        }\n\n        public ICommand GoToChangesetCommand\n        {\n            get { return new MvxCommand<CommitModel>(x => ShowViewModel<ChangesetViewModel>(new ChangesetViewModel.NavObject { Username = Username, Repository = Repository, Node = x.Sha })); }\n        }\n\n        public CollectionViewModel<CommitModel> Commits\n        {\n            get { return _commits; }\n        }\n\n        protected CommitsViewModel(\n            IApplicationService applicationService = null,\n            IFeaturesService featuresService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _featuresService = featuresService ?? Locator.Current.GetService<IFeaturesService>();\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n        }\n\n        protected override Task Load()\n        {\n            if (_featuresService.IsProEnabled)\n                ShouldShowPro = false;\n            else\n            {\n                var repoRequest = _applicationService.Client.Users[Username].Repositories[Repository].Get();\n                _applicationService.Client.ExecuteAsync(repoRequest)\n                    .ToBackground(x => ShouldShowPro = x.Data.Private && !_featuresService.IsProEnabled);\n            }\n            \n            return Commits.SimpleCollectionLoad(GetRequest());\n        }\n\n        protected abstract GitHubRequest<List<CommitModel>> GetRequest();\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/CollectionViewModel.cs",
    "content": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.Specialized;\r\nusing System.Linq;\r\nusing CodeHub.Core.Utils;\r\nusing MvvmCross.Core.ViewModels;\r\n\r\nnamespace CodeHub.Core.ViewModels\n{\r\n    public class CollectionViewModel<TItem> : MvxViewModel, IEnumerable<TItem>, INotifyCollectionChanged\n    {\n        private readonly CustomObservableCollection<TItem> _source = new CustomObservableCollection<TItem>();\n        private Func<IEnumerable<TItem>, IEnumerable<IGrouping<string, TItem>>> _groupingFunction;\n        private Func<IEnumerable<TItem>, IEnumerable<TItem>> _sortingFunction;\n        private Func<IEnumerable<TItem>, IEnumerable<TItem>> _filteringFunction;\n        private Action _moreItems;\n        private int _deferLevel;\n\n        public event NotifyCollectionChangedEventHandler CollectionChanged;\n\n        public CustomObservableCollection<TItem> Items\n        {\n            get { return _source; }\n        }\n\n        public bool IsDefering\n        {\n            get\n            {\n                return _deferLevel > 0;\n            }\n        }\n\n        public Action MoreItems\n        {\n            get { return _moreItems; }\n            set \n            {\n                _moreItems = value;\n                if (!IsDefering)\n                    RaisePropertyChanged(() => MoreItems);\n            }\n        }\n\n        public Func<IEnumerable<TItem>, IEnumerable<TItem>> SortingFunction\n        {\n            get { return _sortingFunction; }\n            set\n            {\n                _sortingFunction = value;\n                if (!IsDefering)\r\n                    RaisePropertyChanged(() => SortingFunction);\n            }\n        }\n\n        public Func<IEnumerable<TItem>, IEnumerable<TItem>> FilteringFunction\n        {\n            get { return _filteringFunction; }\n            set\n            {\n                _filteringFunction = value;\n                if (!IsDefering)\r\n                    RaisePropertyChanged(() => FilteringFunction);\n            }\n        }\n\n        public Func<IEnumerable<TItem>, IEnumerable<IGrouping<string, TItem>>> GroupingFunction\n        {\n            get { return _groupingFunction; }\n            set\n            {\n                _groupingFunction = value;\n                if (!IsDefering)\r\n                    RaisePropertyChanged(() => GroupingFunction);\n            }\n        }\n\n        public CollectionViewModel()\n            : this (new CustomObservableCollection<TItem>())\n        {\n        }\n\n        public CollectionViewModel(CustomObservableCollection<TItem> source)\n        {\n            //Forward events\n            _source = source;\n            _source.CollectionChanged += (sender, e) => \n            {\n                if (IsDefering)\n                    return;\n\n                var eventHandler = CollectionChanged;\n                if (eventHandler != null)\n                    eventHandler(sender, e);\n            };\n        }\n\n        public void Refresh()\n        {\n            if (IsDefering)\n                return;\n\n            var eventHandler = CollectionChanged;\n            if (eventHandler != null)\n                eventHandler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n        }\n\n        public IDisposable DeferRefresh()\n        {\n            ++_deferLevel;\n            return new DeferHelper(this);\n        }\n\n        private void EndDefer()\n        {\n            --_deferLevel;\n            if (_deferLevel == 0)\n                Refresh();\n        }\n\n        public IEnumerator<TItem> GetEnumerator()\n        {\r\n            if (SortingFunction != null)\r\n                return SortingFunction(Items).GetEnumerator();\r\n            return Items.GetEnumerator();\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        private class DeferHelper : IDisposable\n        {\n            private readonly CollectionViewModel<TItem> _parent;\n\n            public DeferHelper(CollectionViewModel<TItem> parent)\n            {\n                _parent = parent;\n            }\n\n            public void Dispose()\n            {\n                if (_parent != null)\n                    _parent.EndDefer();\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Events/BaseEventsViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.ViewModels.Gists;\nusing CodeHub.Core.ViewModels.Issues;\nusing CodeHub.Core.ViewModels.PullRequests;\nusing CodeHub.Core.ViewModels.Repositories;\nusing CodeHub.Core.ViewModels.User;\nusing GitHubSharp;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Utils;\nusing CodeHub.Core.ViewModels.Changesets;\nusing System.Reactive;\nusing System.Reactive.Subjects;\n\nnamespace CodeHub.Core.ViewModels.Events\n{\n    public abstract class BaseEventsViewModel : LoadableViewModel\n    {\n        private readonly CollectionViewModel<Tuple<EventModel, EventBlock>> _events = new CollectionViewModel<Tuple<EventModel, EventBlock>>();\n\n        public readonly ISubject<Tuple<RepositoryIdentifier, string>> GoToTagCommand = new Subject<Tuple<RepositoryIdentifier, string>>();\n\n        public readonly ISubject<Tuple<RepositoryIdentifier, string>> GoToBranchCommand = new Subject<Tuple<RepositoryIdentifier, string>>();\n\n        public CollectionViewModel<Tuple<EventModel, EventBlock>> Events => _events;\n\n        public bool ReportRepository { get; private set; }\n\n        protected BaseEventsViewModel()\n        {\n            ReportRepository = true;\n        }\n\n        protected override Task Load()\n        {\n            return this.RequestModel(CreateRequest(0, 100), response => {\n                this.CreateMore(response, m => Events.MoreItems = m, d => Events.Items.AddRange(CreateDataFromLoad(d)));\n                Events.Items.Reset(CreateDataFromLoad(response.Data));\n            });\n        }\n\n        private IEnumerable<Tuple<EventModel, EventBlock>> CreateDataFromLoad(List<EventModel> events)\n        {\n            var transformedEvents = new List<Tuple<EventModel, EventBlock>>(events.Count);\n            foreach (var e in events)\n            {\n                try\n                {\n                    transformedEvents.Add(new Tuple<EventModel, EventBlock>(e, CreateEventTextBlocks(e)));\n                }\n                catch (Exception ex)\n                {\n                    System.Diagnostics.Debug.WriteLine(ex.ToString());\n                }\n            }\n            return transformedEvents;\n        }\n        \n        protected abstract GitHubRequest<List<EventModel>> CreateRequest(int page, int perPage);\n\n        private void GoToCommits(EventModel.RepoModel repoModel, string branch)\n        {\n            var repoId = RepositoryIdentifier.FromFullName(repoModel.Name);\n            if (repoId == null)\n                return;\n            \n            ShowViewModel<ChangesetsViewModel>(new ChangesetsViewModel.NavObject\n            {\n                Username = repoId?.Owner,\n                Repository = repoId?.Name,\n                Branch = branch\n            });\n        }\n\n        public ICommand GoToRepositoryCommand\n        {\n            get { return new MvxCommand<EventModel.RepoModel>(GoToRepository, x => x != null); }\n        }\n\n        private void GoToRepository(EventModel.RepoModel eventModel)\n        {\n            var repoId = RepositoryIdentifier.FromFullName(eventModel.Name);\n            if (repoId == null)\n                return;\n\n            ShowViewModel<RepositoryViewModel>(new RepositoryViewModel.NavObject\n            {\n                Username = repoId?.Owner,\n                Repository = repoId?.Name\n            });\n        }\n\n        private void GoToUser(string username)\n        {\n            if (string.IsNullOrEmpty(username))\n                return;\n            ShowViewModel<UserViewModel>(new UserViewModel.NavObject {Username = username});\n        }\n\n        private void GoToBranch(RepositoryIdentifier repoId, string branchName)\n        {\n            if (repoId == null)\n                return;\n            \n            GoToBranchCommand.OnNext(Tuple.Create(repoId, branchName));\n        }\n\n        private void GoToTag(EventModel.RepoModel eventModel, string tagName)\n        {\n            var repoId = RepositoryIdentifier.FromFullName(eventModel.Name);\n            if (repoId == null)\n                return;\n\n            GoToTagCommand.OnNext(Tuple.Create(repoId, tagName));\n        }\n\n        public ICommand GoToGistCommand\n        {\n            get { return new MvxCommand<EventModel.GistEvent>(x => ShowViewModel<GistViewModel>(new GistViewModel.NavObject { Id = x.Gist.Id }), x => x != null && x.Gist != null); }\n        }\n\n        private void GoToIssue(RepositoryIdentifier repo, long id)\n        {\n            if (repo == null || string.IsNullOrEmpty(repo.Name) || string.IsNullOrEmpty(repo.Owner))\n                return;\n            \n            ShowViewModel<IssueViewModel>(new IssueViewModel.NavObject\n            {\n                Username = repo.Owner,\n                Repository = repo.Name,\n                Id = id\n            });\n        }\n\n        private void GoToPullRequest(RepositoryIdentifier repo, long id)\n        {\n            if (repo == null || string.IsNullOrEmpty(repo.Name) || string.IsNullOrEmpty(repo.Owner))\n                return;\n            ShowViewModel<PullRequestViewModel>(new PullRequestViewModel.NavObject\n            {\n                Username = repo.Owner,\n                Repository = repo.Name,\n                Id = id\n            });\n        }\n\n        private void GoToPullRequests(RepositoryIdentifier repo)\n        {\n            if (repo == null || string.IsNullOrEmpty(repo.Name) || string.IsNullOrEmpty(repo.Owner))\n                return;\n            ShowViewModel<PullRequestsViewModel>(new PullRequestsViewModel.NavObject\n            {\n                Username = repo.Owner,\n                Repository = repo.Name\n            });\n        }\n\n        private void GoToChangeset(RepositoryIdentifier repo, string sha)\n        {\n            if (repo == null || string.IsNullOrEmpty(repo.Name) || string.IsNullOrEmpty(repo.Owner))\n                return;\n            ShowViewModel<ChangesetViewModel>(new ChangesetViewModel.NavObject\n            {\n                Username = repo.Owner,\n                Repository = repo.Name,\n                Node = sha\n            });\n        }\n\n        private EventBlock CreateEventTextBlocks(EventModel eventModel)\n        {\n            var eventBlock = new EventBlock();\n            var repoId = eventModel.Repo != null ? RepositoryIdentifier.FromFullName(eventModel.Repo.Name) \n                : new RepositoryIdentifier(string.Empty, string.Empty);\n            var username = eventModel.Actor != null ? eventModel.Actor.Login : null;\n\n            // Insert the actor\n            eventBlock.Header.Add(new AnchorBlock(username, () => GoToUser(username)));\n\n            var commitCommentEvent = eventModel.PayloadObject as EventModel.CommitCommentEvent;\n            if (commitCommentEvent != null)\n            {\n                var node = commitCommentEvent.Comment.CommitId.Substring(0, commitCommentEvent.Comment.CommitId.Length > 6 ? 6 : commitCommentEvent.Comment.CommitId.Length);\n                eventBlock.Tapped = () => GoToChangeset(repoId, commitCommentEvent.Comment.CommitId);\n                eventBlock.Header.Add(new TextBlock(\" commented on commit \"));\n                eventBlock.Header.Add(new AnchorBlock(node, eventBlock.Tapped));\n\n                if (ReportRepository)\n                {\n                    eventBlock.Header.Add(new TextBlock(\" in \"));\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                }\n\n                eventBlock.Body.Add(new TextBlock(commitCommentEvent.Comment.Body));\n                return eventBlock;\n            }\n\n            var createEvent = eventModel.PayloadObject as EventModel.CreateEvent;\n            if (createEvent != null)\n            {\n                if (createEvent.RefType.Equals(\"repository\"))\n                {\n                    if (ReportRepository)\n                    {\n                        eventBlock.Tapped = () => GoToRepositoryCommand.Execute(eventModel.Repo);\n                        eventBlock.Header.Add(new TextBlock(\" created repository \"));\n                        eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                    }\n                    else\n                        eventBlock.Header.Add(new TextBlock(\" created this repository\"));\n                }\n                else if (createEvent.RefType.Equals(\"branch\"))\n                {\n                    eventBlock.Tapped = () => GoToBranch(repoId, createEvent.Ref);\n                    eventBlock.Header.Add(new TextBlock(\" created branch \"));\n                    eventBlock.Header.Add(new AnchorBlock(createEvent.Ref, eventBlock.Tapped));\n\n                    if (ReportRepository)\n                    {\n                        eventBlock.Header.Add(new TextBlock(\" in \"));\n                        eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                    }\n                }\n                else if (createEvent.RefType.Equals(\"tag\"))\n                {\n                    eventBlock.Tapped = () => GoToTag(eventModel.Repo, createEvent.Ref);\n                    eventBlock.Header.Add(new TextBlock(\" created tag \"));\n                    eventBlock.Header.Add(new AnchorBlock(createEvent.Ref, eventBlock.Tapped));\n\n                    if (ReportRepository)\n                    {\n                        eventBlock.Header.Add(new TextBlock(\" in \"));\n                        eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                    }\n                }\n            }\n\n\n            var deleteEvent = eventModel.PayloadObject as EventModel.DeleteEvent;\n            if (deleteEvent != null)\n            {\n                if (deleteEvent.RefType.Equals(\"branch\"))\n                {\n                    eventBlock.Tapped = () => GoToRepository(eventModel.Repo);\n                    eventBlock.Header.Add(new TextBlock(\" deleted branch \"));\n                }\n                else if (deleteEvent.RefType.Equals(\"tag\"))\n                {\n                    eventBlock.Tapped = () => GoToRepository(eventModel.Repo);\n                    eventBlock.Header.Add(new TextBlock(\" deleted tag \"));\n                }\n                else\n                    return null;\n\n                eventBlock.Header.Add(new AnchorBlock(deleteEvent.Ref, eventBlock.Tapped));\n                if (!ReportRepository) return eventBlock;\n                eventBlock.Header.Add(new TextBlock(\" in \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                return eventBlock;\n            }\n\n\n            if (eventModel.PayloadObject is EventModel.DownloadEvent)\n            {\n                // Don't show the download event for now...\n                return null;\n            }\n\n\n            var followEvent = eventModel.PayloadObject as EventModel.FollowEvent;\n            if (followEvent != null)\n            {\n                eventBlock.Tapped = () => GoToUser(followEvent.Target.Login);\n                eventBlock.Header.Add(new TextBlock(\" started following \"));\n                eventBlock.Header.Add(new AnchorBlock(followEvent.Target.Login, eventBlock.Tapped));\n                return eventBlock;\n            }\n            /*\n             * FORK EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.ForkEvent)\n            {\n                var forkEvent = (EventModel.ForkEvent)eventModel.PayloadObject;\n                var forkedRepo = new EventModel.RepoModel {Id = forkEvent.Forkee.Id, Name = forkEvent.Forkee.FullName, Url = forkEvent.Forkee.Url};\n                eventBlock.Tapped = () => GoToRepositoryCommand.Execute(forkedRepo);\n                eventBlock.Header.Add(new TextBlock(\" forked \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                eventBlock.Header.Add(new TextBlock(\" to \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(forkedRepo));\n            }\n            /*\n             * FORK APPLY EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.ForkApplyEvent)\n            {\n                var forkEvent = (EventModel.ForkApplyEvent)eventModel.PayloadObject;\n                eventBlock.Tapped = () => GoToRepositoryCommand.Execute(eventModel.Repo);\n                eventBlock.Header.Add(new TextBlock(\" applied fork to \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                eventBlock.Header.Add(new TextBlock(\" on branch \"));\n                eventBlock.Header.Add(new AnchorBlock(forkEvent.Head, () => GoToBranch(repoId, forkEvent.Head)));\n            }\n            /*\n             * GIST EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.GistEvent)\n            {\n                var gistEvent = (EventModel.GistEvent)eventModel.PayloadObject;\n                eventBlock.Tapped = () => GoToGistCommand.Execute(gistEvent);\n\n                if (string.Equals(gistEvent.Action, \"create\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" created Gist #\"));\n                else if (string.Equals(gistEvent.Action, \"update\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" updated Gist #\"));\n                else if (string.Equals(gistEvent.Action, \"fork\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" forked Gist #\"));\n\n                eventBlock.Header.Add(new AnchorBlock(gistEvent.Gist.Id, eventBlock.Tapped));\n                eventBlock.Body.Add(new TextBlock(gistEvent.Gist.Description.Replace('\\n', ' ').Replace(\"\\r\", \"\").Trim()));\n            }\n            /*\n             * GOLLUM EVENT (WIKI)\n             */\n            else if (eventModel.PayloadObject is EventModel.GollumEvent)\n            {\n                var gollumEvent = eventModel.PayloadObject as EventModel.GollumEvent;\n                eventBlock.Header.Add(new TextBlock(\" modified the wiki in \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n\n                if (gollumEvent != null && gollumEvent.Pages != null)\n                {\n                    foreach (var page in gollumEvent.Pages)\n                    {\n                        var p = page;\n                        eventBlock.Body.Add(new AnchorBlock(page.PageName, () => GoToUrlCommand.Execute(p.HtmlUrl)));\n                        eventBlock.Body.Add(new TextBlock(\" - \" + page.Action + \"\\n\"));\n                    }\n\n                    eventBlock.Multilined = true;\n                }\n            }\n            /*\n             * ISSUE COMMENT EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.IssueCommentEvent)\n            {\n                var commentEvent = (EventModel.IssueCommentEvent)eventModel.PayloadObject;\n\n                if (commentEvent.Issue.PullRequest != null && !string.IsNullOrEmpty(commentEvent.Issue.PullRequest.HtmlUrl))\n                {\n                    eventBlock.Tapped = () => GoToPullRequest(repoId, commentEvent.Issue.Number);\n                    eventBlock.Header.Add(new TextBlock(\" commented on pull request \"));\n                }\n                else\n                {\n                    eventBlock.Tapped = () => GoToIssue(repoId, commentEvent.Issue.Number);\n                    eventBlock.Header.Add(new TextBlock(\" commented on issue \"));\n                }\n\n                eventBlock.Header.Add(new AnchorBlock(\"#\" + commentEvent.Issue.Number, eventBlock.Tapped));\n                eventBlock.Header.Add(new TextBlock(\" in \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n\n                eventBlock.Body.Add(new TextBlock(commentEvent.Comment.Body.Replace('\\n', ' ').Replace(\"\\r\", \"\").Trim()));\n            }\n            /*\n             * ISSUES EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.IssuesEvent)\n            {\n                var issueEvent = (EventModel.IssuesEvent)eventModel.PayloadObject;\n                eventBlock.Tapped  = () => GoToIssue(repoId, issueEvent.Issue.Number);\n\n                if (string.Equals(issueEvent.Action, \"opened\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" opened issue \"));\n                else if (string.Equals(issueEvent.Action, \"closed\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" closed issue \"));\n                else if (string.Equals(issueEvent.Action, \"reopened\", StringComparison.OrdinalIgnoreCase))\n                    eventBlock.Header.Add(new TextBlock(\" reopened issue \"));\n\n                eventBlock.Header.Add(new AnchorBlock(\"#\" + issueEvent.Issue.Number, eventBlock.Tapped));\n                eventBlock.Header.Add(new TextBlock(\" in \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                eventBlock.Body.Add(new TextBlock(issueEvent.Issue.Title.Trim()));\n            }\n            /*\n             * MEMBER EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.MemberEvent)\n            {\n                var memberEvent = (EventModel.MemberEvent)eventModel.PayloadObject;\n                eventBlock.Tapped = () => GoToRepositoryCommand.Execute(eventModel.Repo);\n\n                if (memberEvent.Action.Equals(\"added\"))\n                    eventBlock.Header.Add(new TextBlock(\" added \"));\n                else if (memberEvent.Action.Equals(\"removed\"))\n                    eventBlock.Header.Add(new TextBlock(\" removed \"));\n\n                var memberName = memberEvent.Member?.Login;\n                if (memberName != null)\n                    eventBlock.Header.Add(new AnchorBlock(memberName, () => GoToUser(memberName)));\n                else\n                    eventBlock.Header.Add(new TextBlock(\"<deleted user>\"));\n\n                eventBlock.Header.Add(new TextBlock(\" as a collaborator\"));\n\n                if (ReportRepository)\n                {\n                    eventBlock.Header.Add(new TextBlock(\" to \"));\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                }\n            }\n            /*\n             * PUBLIC EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.PublicEvent)\n            {\n                eventBlock.Tapped = () => GoToRepositoryCommand.Execute(eventModel.Repo);\n                if (ReportRepository)\n                {\n                    eventBlock.Header.Add(new TextBlock(\" has open sourced \"));\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                }\n                else\n                    eventBlock.Header.Add(new TextBlock(\" has been open sourced this repository!\"));\n            }\n            /*\n             * PULL REQUEST EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.PullRequestEvent)\n            {\n                var pullEvent = (EventModel.PullRequestEvent)eventModel.PayloadObject;\n                eventBlock.Tapped = () => GoToPullRequest(repoId, pullEvent.Number);\n\n                if (pullEvent.Action.Equals(\"closed\"))\n                    eventBlock.Header.Add(new TextBlock(\" closed pull request \"));\n                else if (pullEvent.Action.Equals(\"opened\"))\n                    eventBlock.Header.Add(new TextBlock(\" opened pull request \"));\n                else if (pullEvent.Action.Equals(\"synchronize\"))\n                    eventBlock.Header.Add(new TextBlock(\" synchronized pull request \"));\n                else if (pullEvent.Action.Equals(\"reopened\"))\n                    eventBlock.Header.Add(new TextBlock(\" reopened pull request \"));\n\n                eventBlock.Header.Add(new AnchorBlock(\"#\" + pullEvent.PullRequest.Number, eventBlock.Tapped));\n                eventBlock.Header.Add(new TextBlock(\" in \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n\n                eventBlock.Body.Add(new TextBlock(pullEvent.PullRequest.Title));\n            }\n            /*\n             * PULL REQUEST REVIEW COMMENT EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.PullRequestReviewCommentEvent)\n            {\n                var commentEvent = (EventModel.PullRequestReviewCommentEvent)eventModel.PayloadObject;\n                eventBlock.Tapped = () => GoToPullRequests(repoId);\n                eventBlock.Header.Add(new TextBlock(\" commented on pull request \"));\n                if (ReportRepository)\n                {\n                    eventBlock.Header.Add(new TextBlock(\" in \"));\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                }\n\n                eventBlock.Body.Add(new TextBlock(commentEvent.Comment.Body.Replace('\\n', ' ').Replace(\"\\r\", \"\").Trim()));\n            }\n            /*\n             * PUSH EVENT\n             */\n            else if (eventModel.PayloadObject is EventModel.PushEvent)\n            {\n                var pushEvent = (EventModel.PushEvent)eventModel.PayloadObject;\n\n                string branchRef = null;\n                if (!string.IsNullOrEmpty(pushEvent.Ref))\n                {\n                    var lastSlash = pushEvent.Ref.LastIndexOf(\"/\", StringComparison.Ordinal) + 1;\n                    branchRef = pushEvent.Ref.Substring(lastSlash);\n                }\n\n                if (eventModel.Repo != null)\n                    eventBlock.Tapped = () => GoToCommits(eventModel.Repo, pushEvent.Ref);\n\n                eventBlock.Header.Add(new TextBlock(\" pushed to \"));\n                if (branchRef != null)\n                    eventBlock.Header.Add(new AnchorBlock(branchRef, () => GoToBranch(repoId, branchRef)));\n\n                if (ReportRepository)\n                {\n                    eventBlock.Header.Add(new TextBlock(\" at \"));\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                }\n\n                if (pushEvent.Commits != null)\n                {\n                    foreach (var commit in pushEvent.Commits)\n                    {\n                        var desc = (commit.Message ?? \"\");\n                        var sha = commit.Sha;\n                        var firstNewLine = desc.IndexOf(\"\\n\");\n                        if (firstNewLine <= 0)\n                            firstNewLine = desc.Length;\n\n                        desc = desc.Substring(0, firstNewLine);\n                        var shortSha = commit.Sha;\n                        if (shortSha.Length > 6)\n                            shortSha = shortSha.Substring(0, 6);\n\n                        eventBlock.Body.Add(new AnchorBlock(shortSha, () => GoToChangeset(repoId, sha)));\n                        eventBlock.Body.Add(new TextBlock(\" - \" + desc + \"\\n\"));\n                        eventBlock.Multilined = true;\n                    }\n                }\n            }\n\n\n            var teamAddEvent = eventModel.PayloadObject as EventModel.TeamAddEvent;\n            if (teamAddEvent != null)\n            {\n                eventBlock.Header.Add(new TextBlock(\" added \"));\n\n                if (teamAddEvent.User != null)\n                    eventBlock.Header.Add(new AnchorBlock(teamAddEvent.User.Login, () => GoToUser(teamAddEvent.User.Login)));\n                else if (teamAddEvent.Repo != null)\n                    eventBlock.Header.Add(CreateRepositoryTextBlock(new EventModel.RepoModel { Id = teamAddEvent.Repo.Id, Name = teamAddEvent.Repo.FullName, Url = teamAddEvent.Repo.Url }));\n                else\n                    return null;\n\n                if (teamAddEvent.Team == null) return eventBlock;\n                eventBlock.Header.Add(new TextBlock(\" to team \"));\n                eventBlock.Header.Add(new AnchorBlock(teamAddEvent.Team.Name, () => { }));\n                return eventBlock;\n            }\n\n\n            var watchEvent = eventModel.PayloadObject as EventModel.WatchEvent;\n            if (watchEvent != null)\n            {\n                eventBlock.Tapped = () => GoToRepositoryCommand.Execute(eventModel.Repo);\n                eventBlock.Header.Add(watchEvent.Action.Equals(\"started\") ? \n                    new TextBlock(\" starred \") : new TextBlock(\" unstarred \"));\n                eventBlock.Header.Add(CreateRepositoryTextBlock(eventModel.Repo));\n                return eventBlock;\n            }\n\n            var releaseEvent = eventModel.PayloadObject as EventModel.ReleaseEvent;\n            if (releaseEvent != null)\n            {\n                eventBlock.Tapped = () => GoToUrlCommand.Execute(releaseEvent.Release.HtmlUrl);\n                eventBlock.Header.Add(new TextBlock(\" \" + releaseEvent.Action + \" release \" + releaseEvent.Release.Name));\n                return eventBlock;\n            }\n\n            return eventBlock;\n        }\n\n        private TextBlock CreateRepositoryTextBlock(EventModel.RepoModel repoModel)\n        {\n            //Most likely indicates a deleted repository\n            if (repoModel == null)\n                return new TextBlock(\"Unknown Repository\");\n            if (repoModel.Name == null)\n                return new TextBlock(\"<Deleted Repository>\");\n\n            var repoSplit = repoModel.Name.Split('/');\n            if (repoSplit.Length < 2)\n                return new TextBlock(repoModel.Name);\n\n//            var repoOwner = repoSplit[0];\n//            var repoName = repoSplit[1];\n            return new AnchorBlock(repoModel.Name, () => GoToRepositoryCommand.Execute(repoModel));\n        }\n\n\n        public class EventBlock\n        {\n            public IList<TextBlock> Header { get; private set; }\n            public IList<TextBlock> Body { get; private set; } \n            public Action Tapped { get; set; }\n            public bool Multilined { get; set; }\n\n            public EventBlock()\n            {\n                Header = new List<TextBlock>(6);\n                Body = new List<TextBlock>();\n            }\n        }\n\n        public class TextBlock\n        {\n            public string Text { get; set; }\n\n            public TextBlock()\n            {\n            }\n\n            public TextBlock(string text)\n            {\n                Text = text;\n            }\n        }\n\n        public class AnchorBlock : TextBlock\n        {\n            public AnchorBlock(string text, Action tapped) : base(text)\n            {\n                Tapped = tapped;\n            }\n\n            public Action Tapped { get; set; }\n\n            public AnchorBlock(Action tapped)\n            {\n                Tapped = tapped;\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/ViewModels/Events/NewsViewModel.cs",
    "content": "using System.Collections.Generic;\r\nusing GitHubSharp.Models;\r\n\r\nnamespace CodeHub.Core.ViewModels.Events\n{\n    public class NewsViewModel : BaseEventsViewModel\n    {\n        protected override GitHubSharp.GitHubRequest<List<EventModel>> CreateRequest(int page, int perPage)\n        {\n            return this.GetApplication().Client.Users[this.GetApplication().Account.Username].GetReceivedEvents(page, perPage);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Events/OrganizationEventsViewModel.cs",
    "content": "using System.Collections.Generic;\r\nusing GitHubSharp;\r\nusing GitHubSharp.Models;\r\n\r\nnamespace CodeHub.Core.ViewModels.Events\r\n{\r\n    public class OrganizationEventsViewModel : BaseEventsViewModel\r\n    {\r\n        public string OrganizationName\r\n        {\r\n            get;\r\n            private set;\r\n        }\r\n\r\n        public string Username\r\n        {\r\n            get;\r\n            private set;\r\n        }\r\n\r\n        public void Init(NavObject navobject)\r\n        {\r\n            Username = navobject.Username;\r\n            OrganizationName = navobject.OrganizagtionName;\r\n        }\r\n\r\n        protected override GitHubRequest<List<EventModel>> CreateRequest(int page, int perPage)\r\n        {\r\n            return this.GetApplication().Client.Users[Username].GetOrganizationEvents(OrganizationName, page, perPage);\r\n        }\r\n\r\n        public class NavObject\r\n        {\r\n            public string Username { get; set; }\r\n            public string OrganizagtionName { get; set; }\r\n        }\r\n    }\n\r\n}\r\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Events/RepositoryEventsViewModel.cs",
    "content": "using System.Collections.Generic;\r\nusing GitHubSharp;\r\nusing GitHubSharp.Models;\r\n\r\nnamespace CodeHub.Core.ViewModels.Events\n{\n    public class RepositoryEventsViewModel : BaseEventsViewModel\n    {\n        public string Repository \n        { \n            get; \n            private set; \n        }\n\n        public string Username\n        {\n            get;\n            private set;\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n        }\n\n        protected override GitHubRequest<List<EventModel>> CreateRequest(int page, int perPage)\n        {\n            return this.GetApplication().Client.Users[Username].Repositories[Repository].GetEvents(page, perPage);\n        }\r\n\r\n        public class NavObject\r\n        {\r\n            public string Username { get; set; }\r\n            public string Repository { get; set; }\r\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/ViewModels/Events/UserEventsViewModel.cs",
    "content": "using System.Collections.Generic;\r\nusing GitHubSharp;\r\nusing GitHubSharp.Models;\r\n\r\nnamespace CodeHub.Core.ViewModels.Events\r\n{\r\n    public class UserEventsViewModel : BaseEventsViewModel\r\n    {\r\n        public string Username\r\n        {\r\n            get;\r\n            private set;\r\n        }\r\n\r\n        public void Init(NavObject navObject)\r\n        {\r\n            Username = navObject.Username;\r\n        }\r\n\r\n        protected override GitHubRequest<List<EventModel>> CreateRequest(int page, int perPage)\r\n        {\r\n            return this.GetApplication().Client.Users[Username].GetEvents(page, perPage);\r\n        }\r\n\r\n        public class NavObject\r\n        {\r\n            public string Username { get; set; }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/FilterGroup.cs",
    "content": "using System.Collections.Generic;\r\nusing System.Linq;\r\n\r\nnamespace CodeHub.Core.ViewModels\n{\n    public class FilterGroup<TElement> : IGrouping<string, TElement>\n    {\n        readonly List<TElement> _elements;\n\n        public FilterGroup(string key, List<TElement> elements)\n        {\n            Key = key;\n            _elements = elements;\n        }\n\n        public IEnumerator<TElement> GetEnumerator()\n        {\n            return this._elements.GetEnumerator();\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n\n        public string Key { get; private set; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/FilterModel.cs",
    "content": "using System;\r\n\r\nnamespace CodeHub.Core.ViewModels\n{\n    [Serializable]\n    public abstract class FilterModel<TF>\n    {\n        public abstract TF Clone();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/FilterableCollectionViewModel.cs",
    "content": "using CodeHub.Core.Data;\nusing CodeHub.Core.Services;\nusing MvvmCross.Platform;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public class FilterableCollectionViewModel<T, TF> : CollectionViewModel<T>, IFilterableViewModel<TF> where TF : FilterModel<TF>, new()\n    {\n        protected TF _filter;\n        private readonly string _filterKey;\n\n        public TF Filter\n        {\n            get { return _filter; }\n            set\n            {\n                _filter = value;\n                RaisePropertyChanged(() => Filter);\n            }\n        }\n\n        public FilterableCollectionViewModel(string filterKey)\n        {\n            _filterKey = filterKey;\n            var application = Mvx.Resolve<IApplicationService>();\n            var accounts = Mvx.Resolve<IAccountsService>();\n            _filter = application.Account.GetFilter<TF>(_filterKey) ?? new TF();\n            accounts.Save(application.Account).ToBackground();\n        }\n\n        public void ApplyFilter(TF filter, bool saveAsDefault = false)\n        {\n            Filter = filter;\n            if (saveAsDefault)\n            {\n                var application = Mvx.Resolve<IApplicationService>();\n                application.Account.SetFilter(_filterKey, _filter);\n                application.UpdateActiveAccount().ToBackground();\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Gists/GistCreateViewModel.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Messages;\nusing ReactiveUI;\nusing System.Reactive;\nusing CodeHub.Core.Services;\nusing Octokit;\n\nnamespace CodeHub.Core.ViewModels.Gists\n{\n    public class GistCreateViewModel : BaseViewModel \n    {\n        private readonly IMessageService _messageService;\n        private string _description;\n        private bool _public;\n        private IDictionary<string, string> _files = new Dictionary<string, string>();\n        private bool _saving;\n\n        public bool IsSaving\n        {\n            get { return _saving; }\n            private set { this.RaiseAndSetIfChanged(ref _saving, value); }\n        }\n\n        public string Description\n        {\n            get { return _description; }\n            set { this.RaiseAndSetIfChanged(ref _description, value); }\n        }\n\n        public bool Public\n        {\n            get { return _public; }\n            set { this.RaiseAndSetIfChanged(ref _public, value); }\n        }\n\n        public IDictionary<string, string> Files\n        {\n            get { return _files; }\n            set { this.RaiseAndSetIfChanged(ref _files, value); }\n        }\n\n        public ReactiveCommand<Unit, Gist> SaveCommand { get; }\n\n        public ReactiveCommand<Unit, Unit> CancelCommand { get; }\n\n\n        public GistCreateViewModel(IMessageService messageService = null)\n        {\n            _messageService = messageService ?? GetService<IMessageService>();\n\n            CancelCommand = ReactiveCommand.Create(() => { });\n            SaveCommand = ReactiveCommand.CreateFromTask(Save);\n            SaveCommand.ThrownExceptions.Subscribe(x => DisplayAlert(x.Message));\n        }\n\n        private async Task<Gist> Save()\n        {\n            if (_files.Count == 0)\n                throw new Exception(\"You cannot create a Gist without atleast one file! Please correct and try again.\");\n\n            try\n            {\n                var newGist = new NewGist()\n                {\n                    Description = Description ?? string.Empty,\n                    Public = Public\n                };\n\n                foreach (var kv in Files)\n                    newGist.Files.Add(kv.Key, kv.Value);\n\n                IsSaving = true;\n                var gist = await this.GetApplication().GitHubClient.Gist.Create(newGist);\n                _messageService.Send(new GistAddMessage(gist));\n                return gist;\n            }\n            finally\n            {\n                IsSaving = false;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Gists/GistItemViewModel.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing CodeHub.Core.Utilities;\nusing Humanizer;\nusing System.Reactive;\nusing Octokit;\nusing System.Linq;\n\nnamespace CodeHub.Core.ViewModels.Gists\n{\n    public class GistItemViewModel : ReactiveObject, ICanGoToViewModel\n    {\n        public GitHubAvatar Avatar { get; }\n\n        public string Title { get; }\n\n        public string Description { get; }\n\n        public DateTimeOffset UpdatedAt { get; }\n\n        public string UpdatedString { get; }\n\n        public ReactiveCommand<Unit, Unit> GoToCommand { get; }\n\n        public string Id { get; }\n\n        public Gist Gist { get; }\n\n        private static string GetGistTitle(Gist gist)\n        {\n            var title = (gist.Owner == null) ? \"Anonymous\" : gist.Owner.Login;\n            if (gist.Files.Count > 0)\n                title = gist.Files.First().Key;\n            return title;\n        }\n\n        public GistItemViewModel(Gist gist, Action<GistItemViewModel> gotoAction)\n        {\n            Gist = gist;\n            Id = gist.Id;\n            Title = GetGistTitle(gist);\n            Description = string.IsNullOrEmpty(gist.Description) ? \"Gist \" + gist.Id : gist.Description;\n            Avatar = new GitHubAvatar(gist.Owner?.AvatarUrl);\n            UpdatedAt = gist.UpdatedAt;\n            UpdatedString = UpdatedAt.Humanize();\n            GoToCommand = ReactiveCommand.Create(() => gotoAction(this));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Gists/GistViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing CodeHub.Core.ViewModels.User;\nusing MvvmCross.Core.ViewModels;\nusing Octokit;\n\nnamespace CodeHub.Core.ViewModels.Gists\n{\n    public class GistViewModel : LoadableViewModel\n    {\n        private readonly CollectionViewModel<GistComment> _comments = new CollectionViewModel<GistComment>();\n        private Gist _gist;\n        private bool _starred;\n\n        public string Id\n        {\n            get;\n            private set;\n        }\n\n        public Gist Gist\n        {\n            get { return _gist; }\n            set { this.RaiseAndSetIfChanged(ref _gist, value); }\n        }\n\n        public bool IsStarred\n        {\n            get { return _starred; }\n            private set { this.RaiseAndSetIfChanged(ref _starred, value); }\n        }\n\n        public CollectionViewModel<GistComment> Comments\n        {\n            get { return _comments; }\n        }\n\n        public ICommand GoToUserCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<UserViewModel>(new UserViewModel.NavObject { Username = Gist.Owner.Login }), () => Gist != null && Gist.Owner != null); }\n        }\n\n        public ICommand GoToHtmlUrlCommand\n        {\n            get { return new MvxCommand(() => GoToUrlCommand.Execute(_gist.HtmlUrl), () => _gist != null); }\n        }\n\n        public ICommand ForkCommand\n        {\n            get\n            {\n                return new MvxCommand(() => ForkGist());\n            }\n        }\n\n        public ICommand ToggleStarCommand\n        {\n            get\n            {\n                return new MvxCommand(() => ToggleStarred(), () => Gist != null);\n            }\n        }\n\n        public static GistViewModel FromGist(Gist gist)\n        {\n            return new GistViewModel\n            {\n                Gist = gist,\n                Id = gist.Id\n            };\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Id = navObject.Id;\n        }\n\n        private async Task ToggleStarred()\n        {\n            try\n            {\n                var request = IsStarred ? this.GetApplication().Client.Gists[Id].Unstar() : this.GetApplication().Client.Gists[Id].Star();\n                await this.GetApplication().Client.ExecuteAsync(request);\n                IsStarred = !IsStarred;\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to start gist. Please try again.\");\n            }\n        }\n\n        public async Task ForkGist()\n        {\n            var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Gists[Id].ForkGist());\n            var forkedGist = data.Data;\n            ShowViewModel<GistViewModel>(new GistViewModel.NavObject { Id = forkedGist.Id });\n        }\n\n        protected override async Task Load()\n        {\n            Comments.Items.Clear();\n\n            this.GetApplication().GitHubClient.Gist.IsStarred(Id)\n                .ToBackground(x => IsStarred = x);\n\n            this.GetApplication().GitHubClient.Gist.Comment.GetAllForGist(Id)\n                .ToBackground(Comments.Items.AddRange);\n\n            Gist = await this.GetApplication().GitHubClient.Gist.Get(Id);\n        }\n\n        public async Task Edit(GistUpdate editModel)\n        {\n            Gist = await this.GetApplication().GitHubClient.Gist.Edit(Id, editModel);\n        }\n\n        public class NavObject\n        {\n            public string Id { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Gists/GistsViewModel.cs",
    "content": "using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ReactiveUI;\nusing CodeHub.Core.Services;\nusing System.Reactive;\nusing System;\nusing Octokit;\nusing System.Reactive.Linq;\nusing Splat;\nusing CodeHub.Core.Messages;\n\nnamespace CodeHub.Core.ViewModels.Gists\n{\n    public class CurrentUserGistsViewModel : GistsViewModel\n    {\n        private readonly IDisposable _addToken;\n\n        public CurrentUserGistsViewModel(string username, IMessageService messageService = null)\n            : base(ApiUrls.UsersGists(username))\n        {\n            messageService = messageService ?? Locator.Current.GetService<IMessageService>();\n            _addToken = messageService.Listen<GistAddMessage>(msg => Gists.Insert(0, msg.Gist));\n        }\n    }\n\n    public class GistsViewModel : ReactiveObject\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IAlertDialogService _dialogService;\n        private readonly ReactiveList<Gist> _internalItems\n            = new ReactiveList<Gist>(resetChangeThreshold: double.MaxValue);\n\n        public ReactiveCommand<Unit, bool> LoadCommand { get; }\n\n        public ReactiveCommand<Unit, bool> LoadMoreCommand { get; }\n\n        public IReadOnlyReactiveList<GistItemViewModel> Items { get; private set; }\n\n        protected ReactiveList<Gist> Gists => _internalItems;\n\n        public ReactiveCommand<GistItemViewModel, GistItemViewModel> ItemSelected { get; }\n\n        private ObservableAsPropertyHelper<bool> _hasMore;\n        public bool HasMore => _hasMore.Value;\n\n        private Uri _nextPage;\n        private Uri NextPage\n        {\n            get { return _nextPage; }\n            set { this.RaiseAndSetIfChanged(ref _nextPage, value); }\n        }\n\n        private string _searchText;\n        public string SearchText\n        {\n            get { return _searchText; }\n            set { this.RaiseAndSetIfChanged(ref _searchText, value); }\n        }\n\n        private readonly ObservableAsPropertyHelper<bool> _isEmpty;\n        public bool IsEmpty => _isEmpty.Value;\n\n        public static GistsViewModel CreatePublicGistsViewModel()\n            => new GistsViewModel(ApiUrls.PublicGists());\n\n        public static GistsViewModel CreateStarredGistsViewModel()\n            => new GistsViewModel(ApiUrls.StarredGists());\n\n        public static GistsViewModel CreateUserGistsViewModel(string username)\n            => new GistsViewModel(ApiUrls.UsersGists(username));\n\n        public GistsViewModel(\n           Uri uri,\n           IApplicationService applicationService = null,\n           IAlertDialogService dialogService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _dialogService = dialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            NextPage = uri;\n\n            var showDescription = _applicationService.Account.ShowRepositoryDescriptionInList;\n\n            ItemSelected = ReactiveCommand.Create<GistItemViewModel, GistItemViewModel>(x => x);\n\n            var gistItems = _internalItems.CreateDerivedCollection(\n                x => new GistItemViewModel(x, GoToItem));\n\n            var searchUpdated = this.WhenAnyValue(x => x.SearchText)\n                .Throttle(TimeSpan.FromMilliseconds(400), RxApp.MainThreadScheduler);\n\n            Items = gistItems.CreateDerivedCollection(\n                x => x,\n                x => x.Title.ContainsKeyword(SearchText) || x.Description.ContainsKeyword(SearchText),\n                signalReset: searchUpdated);\n\n            LoadCommand = ReactiveCommand.CreateFromTask(async t =>\n            {\n                _internalItems.Clear();\n                var parameters = new Dictionary<string, string> { [\"per_page\"] = 100.ToString() };\n                var items = await RetrieveItems(uri, parameters);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            });\n\n            var canLoadMore = this.WhenAnyValue(x => x.NextPage).Select(x => x != null);\n            LoadMoreCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                var items = await RetrieveItems(NextPage);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            }, canLoadMore);\n\n            LoadCommand.Select(_ => _internalItems.Count == 0)\n                .ToProperty(this, x => x.IsEmpty, out _isEmpty, true);\n\n            LoadCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            LoadMoreCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            _hasMore = this.WhenAnyValue(x => x.NextPage)\n                .Select(x => x != null)\n                .ToProperty(this, x => x.HasMore);\n        }\n\n        private void LoadingError(Exception err)\n        {\n            _dialogService.Alert(\"Error Loading\", err.Message).ToBackground();\n        }\n\n        private void GoToItem(GistItemViewModel item)\n        {\n            ItemSelected.ExecuteNow(item);\n        }\n\n        private async Task<IReadOnlyList<Gist>> RetrieveItems(\n            Uri repositoriesUri, IDictionary<string, string> parameters = null)\n        {\n            try\n            {\n                var connection = _applicationService.GitHubClient.Connection;\n                var ret = await connection.Get<IReadOnlyList<Gist>>(repositoriesUri, parameters, \"application/json\");\n                NextPage = ret.HttpResponse.ApiInfo.Links.ContainsKey(\"next\")\n                              ? ret.HttpResponse.ApiInfo.Links[\"next\"]\n                              : null;\n                return ret.Body;\n            }\n            catch\n            {\n                NextPage = null;\n                throw;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/ICanGoToViewModel.cs",
    "content": "﻿using System.Reactive;\nusing ReactiveUI;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public interface ICanGoToViewModel\n    {\n        ReactiveCommand<Unit, Unit> GoToCommand { get; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/IFilterableViewModel.cs",
    "content": "namespace CodeHub.Core.ViewModels\n{\n    public interface IFilterableViewModel<TFilter> where TFilter : FilterModel<TFilter>, new()\n    {\n        TFilter Filter { get; }\n\n        void ApplyFilter(TFilter filter, bool saveAsDefault = false);\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/IListViewModel.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing ReactiveUI;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public interface IListViewModel<T>\n    {\n        ReactiveCommand<Unit, bool> LoadCommand { get; }\n\n        ReactiveCommand<Unit, bool> LoadMoreCommand { get; }\n\n        IReadOnlyReactiveList<T> Items { get; }\n\n        bool HasMore { get; }\n\n        string SearchText { get; }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/ILoadableViewModel.cs",
    "content": "﻿using ReactiveUI;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public interface ILoadableViewModel\n    {\n        ReactiveCommand<Unit, Unit> LoadCommand { get; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/IProvidesSearchKeyword.cs",
    "content": "﻿namespace CodeHub.Core.ViewModels\n{\n    public interface IProvidesSearchKeyword\n    {\n        string SearchKeyword { get; set; }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/BaseIssuesViewModel.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Filters;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.ViewModels.PullRequests;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CodeHub.Core.Utils;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public abstract class BaseIssuesViewModel<TFilterModel> : LoadableViewModel, IBaseIssuesViewModel where TFilterModel : BaseIssuesFilterModel<TFilterModel>, new()\n    {\n        protected FilterableCollectionViewModel<IssueModel, TFilterModel> _issues;\n\n        public FilterableCollectionViewModel<IssueModel, TFilterModel> Issues\n        {\n            get { return _issues; }\n        }\n\n        public ICommand GoToIssueCommand\n        {\n            get \n            { \n                return new MvxCommand<IssueModel>(x => {\n                    var isPullRequest = x.PullRequest != null && !(string.IsNullOrEmpty(x.PullRequest.HtmlUrl));\n                    var s1 = x.Url.Substring(x.Url.IndexOf(\"/repos/\") + 7);\n                    var issuesIndex = s1.LastIndexOf(\"/issues\");\n                    issuesIndex = issuesIndex < 0 ? 0 : issuesIndex;\n                    var repoId = RepositoryIdentifier.FromFullName(s1.Substring(0, issuesIndex));\n\n                    if (repoId == null)\n                        return;\n\n                    if (isPullRequest)\n                        ShowViewModel<PullRequestViewModel>(new PullRequestViewModel.NavObject { Username = repoId.Owner, Repository = repoId.Name, Id = x.Number });\n                    else\n                        ShowViewModel<IssueViewModel>(new IssueViewModel.NavObject { Username = repoId.Owner, Repository = repoId.Name, Id = x.Number });\n                });\n            }\n        }\n\n        protected virtual List<IGrouping<string, IssueModel>> Group(IEnumerable<IssueModel> model)\n        {\n            var order = Issues.Filter.SortType;\n            if (order == BaseIssuesFilterModel<TFilterModel>.Sort.Comments)\n            {\n                var a = Issues.Filter.Ascending ? model.OrderBy(x => x.Comments) : model.OrderByDescending(x => x.Comments);\n                var g = a.GroupBy(x => FilterGroup.IntegerCeilings.First(r => r > x.Comments)).ToList();\n                return FilterGroup.CreateNumberedGroup(g, \"Comments\");\n            }\n            if (order == BaseIssuesFilterModel<TFilterModel>.Sort.Updated)\n            {\n                var a = Issues.Filter.Ascending ? model.OrderBy(x => x.UpdatedAt) : model.OrderByDescending(x => x.UpdatedAt);\n                var g = a.GroupBy(x => FilterGroup.IntegerCeilings.First(r => r > x.UpdatedAt.TotalDaysAgo()));\n                return FilterGroup.CreateNumberedGroup(g, \"Days Ago\", \"Updated\");\n            }\n            if (order == BaseIssuesFilterModel<TFilterModel>.Sort.Created)\n            {\n                var a = Issues.Filter.Ascending ? model.OrderBy(x => x.CreatedAt) : model.OrderByDescending(x => x.CreatedAt);\n                var g = a.GroupBy(x => FilterGroup.IntegerCeilings.First(r => r > x.CreatedAt.TotalDaysAgo()));\n                return FilterGroup.CreateNumberedGroup(g, \"Days Ago\", \"Created\");\n            }\n\n            return null;\n        }\n    }\n\n    public interface IBaseIssuesViewModel : IMvxViewModel\n    {\n        ICommand GoToIssueCommand { get; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueAddViewModel.cs",
    "content": "using System;\nusing MvvmCross.Core.ViewModels;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Messages;\nusing System.Linq;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueAddViewModel : IssueModifyViewModel\n    {\n        private readonly IMessageService _messageService;\n\n        public IssueAddViewModel(IMessageService messageService)\n            : base(messageService)\n        {\n            _messageService = messageService;\n        }\n\n        protected override async Task Save()\n        {\n            if (string.IsNullOrEmpty(IssueTitle))\n            {\n                DisplayAlert(\"Unable to save the issue: you must provide a title!\");\n                return;\n            }\n\n            try\n            {\n                string assignedTo = AssignedTo == null ? null : AssignedTo.Login;\n                int? milestone = null;\n                if (Milestone != null) \n                    milestone = Milestone.Number;\n                string[] labels = Labels.Items.Select(x => x.Name).ToArray();\n                var content = Content ?? string.Empty;\n\n                IsSaving = true;\n                var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues.Create(IssueTitle, content, assignedTo, milestone, labels));\n                _messageService.Send(new IssueAddMessage(data.Data));\n                ChangePresentation(new MvxClosePresentationHint(this));\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to save new issue! Please try again.\");\n            }\n            finally\n            {\n                IsSaving = false;\n            }\n        }\n\n        public void Init(NavObject navObject)\n        {\n            base.Init(navObject.Username, navObject.Repository);\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueAssignedToViewModel.cs",
    "content": "using System;\nusing GitHubSharp.Models;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Messages;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueAssignedToViewModel : LoadableViewModel\n    {\n        private readonly IMessageService _messageService;\n\n        private BasicUserModel _selectedUser;\n        public BasicUserModel SelectedUser\n        {\n            get\n            {\n                return _selectedUser;\n            }\n            set\n            {\n                _selectedUser = value;\n                RaisePropertyChanged(() => SelectedUser);\n            }\n        }\n\n        private bool _isSaving;\n        public bool IsSaving\n        {\n            get { return _isSaving; }\n            private set {\n                _isSaving = value;\n                RaisePropertyChanged(() => IsSaving);\n            }\n        }\n\n        private readonly CollectionViewModel<BasicUserModel> _users = new CollectionViewModel<BasicUserModel>();\n        public CollectionViewModel<BasicUserModel> Users\n        {\n            get { return _users; }\n        }\n\n        public string Username  { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public long Id { get; private set; }\n\n        public bool SaveOnSelect { get; private set; }\n\n        public IssueAssignedToViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n        }\n\n        public void Init(NavObject navObject) \n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Id = navObject.Id;\n            SaveOnSelect = navObject.SaveOnSelect;\n\n            SelectedUser = TxSevice.Get() as BasicUserModel;\n            this.Bind(x => x.SelectedUser).Subscribe(x => SelectUser(x));\n        }\n\n        private async Task SelectUser(BasicUserModel x)\n        {\n            if (SaveOnSelect)\n            {\n                try\n                {\n                    IsSaving = true;\n                    var assignee = x != null ? x.Login : null;\n                    var updateReq = this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].UpdateAssignee(assignee);\n                    var newIssue = await this.GetApplication().Client.ExecuteAsync(updateReq);\n                    _messageService.Send(new IssueEditMessage(newIssue.Data));\n        \n                }\n                catch\n                {\n                    DisplayAlert(\"Unable to assign issue to selected user! Please try again.\");\n                }\n                finally\n                {\n                    IsSaving = false;\n                }\n            }\n            else\n            {\n                _messageService.Send(new SelectedAssignedToMessage(x));\n            }\n\n            ChangePresentation(new MvxClosePresentationHint(this));\n        }\n\n        protected override Task Load()\n        {\n            return Users.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].GetAssignees());\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public long Id { get; set; }\n            public bool SaveOnSelect { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueEditViewModel.cs",
    "content": "using MvvmCross.Core.ViewModels;\nusing System.Threading.Tasks;\nusing GitHubSharp.Models;\nusing System;\nusing CodeHub.Core.Messages;\nusing System.Linq;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueEditViewModel : IssueModifyViewModel\n    {\n        private readonly IMessageService _messageService;\n        private IssueModel _issue;\n        private bool _open;\n\n        public bool IsOpen\n        {\n            get { return _open; }\n            set { this.RaiseAndSetIfChanged(ref _open, value); }\n        }\n\n        public IssueModel Issue\n        {\n            get { return _issue; }\n            set { this.RaiseAndSetIfChanged(ref _issue, value); }\n        }\n\n        public long Id { get; private set; }\n\n        public IssueEditViewModel(IMessageService messageService)\n            : base(messageService)\n        {\n            _messageService = messageService;\n        }\n\n        protected override async Task Save()\n        {\n            try\n            {\n                if (string.IsNullOrEmpty(IssueTitle))\n                    throw new Exception(\"Issue must have a title!\");\n\n                string assignedTo = AssignedTo == null ? null : AssignedTo.Login;\n                int? milestone = null;\n                if (Milestone != null) \n                    milestone = Milestone.Number;\n                string[] labels = Labels.Items.Select(x => x.Name).ToArray();\n                var content = Content ?? string.Empty;\n                var state = IsOpen ? \"open\" : \"closed\";\n                var retried = false;\n\n                IsSaving = true;\n\n                // For some reason github needs to try again during an internal server error\n                tryagain:\n\n                try\n                {\n                    var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Issue.Number].Update(IssueTitle, content, state, assignedTo, milestone, labels)); \n                    _messageService.Send(new IssueEditMessage(data.Data));\n                }\n                catch (GitHubSharp.InternalServerException)\n                {\n                    if (retried)\n                        throw;\n\n                    //Do nothing. Something is wrong with github's service\n                    retried = true;\n                    goto tryagain;\n                }\n\n                ChangePresentation(new MvxClosePresentationHint(this));\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to save the issue! Please try again\");\n            }\n            finally\n            {\n                IsSaving = false;\n            }\n\n//            //There is a wierd bug in GitHub when editing an existing issue and the assignedTo is null\n//            catch (GitHubSharp.InternalServerException)\n//            {\n//                if (ExistingIssue != null && assignedTo == null)\n//                    tryEditAgain = true;\n//                else\n//                    throw;\n//            }\n//\n//            if (tryEditAgain)\n//            {\n//                var response = await Application.Client.ExecuteAsync(Application.Client.Users[Username].Repositories[RepoSlug].Issues[ExistingIssue.Number].Update(title, content, state, assignedTo, milestone, labels)); \n//                model = response.Data;\n//            }\n        }\n\n//        protected override Task Load(bool forceCacheInvalidation)\n//        {\n//            if (forceCacheInvalidation || Issue == null)\n//                return Task.Run(() => this.RequestModel(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].Get(), forceCacheInvalidation, response => Issue = response.Data));\n//            return Task.Delay(0);\n//        }\n\n        public void Init(NavObject navObject)\n        {\n            base.Init(navObject.Username, navObject.Repository);\n            Id = navObject.Id;\n            Issue = GetService<CodeHub.Core.Services.IViewModelTxService>().Get() as IssueModel;\n            if (Issue != null)\n            {\n                IssueTitle = Issue.Title;\n                AssignedTo = Issue.Assignee;\n                Milestone = Issue.Milestone;\n                Labels.Items.Reset(Issue.Labels);\n                Content = Issue.Body;\n                IsOpen = string.Equals(Issue.State, \"open\");\n            }\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public long Id { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueLabelsViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing GitHubSharp.Models;\nusing System.Collections.Generic;\nusing CodeHub.Core.Messages;\nusing System.Linq;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueLabelsViewModel : LoadableViewModel\n    {\n        private readonly IMessageService _messageService;\n        private IEnumerable<LabelModel> _originalLables;\n\n        private bool _isSaving;\n        public bool IsSaving\n        {\n            get { return _isSaving; }\n            private set {\n                _isSaving = value;\n                RaisePropertyChanged(() => IsSaving);\n            }\n        }\n\n        private readonly CollectionViewModel<LabelModel> _labels = new CollectionViewModel<LabelModel>();\n        public CollectionViewModel<LabelModel> Labels\n        {\n            get { return _labels; }\n        }\n\n        private readonly CollectionViewModel<LabelModel> _selectedLabels = new CollectionViewModel<LabelModel>();\n        public CollectionViewModel<LabelModel> SelectedLabels\n        {\n            get { return _selectedLabels; }\n        }\n\n        public string Username  { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public long Id { get; private set; }\n\n        public bool SaveOnSelect { get; private set; }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Id = navObject.Id;\n            SaveOnSelect = navObject.SaveOnSelect;\n\n            _originalLables = GetService<CodeHub.Core.Services.IViewModelTxService>().Get() as IEnumerable<LabelModel>;\n            SelectedLabels.Items.Reset(_originalLables);\n        }\n\n        public ICommand SaveLabelChoices\n        {\n            get { return new MvxCommand(() => SelectLabels(SelectedLabels)); }\n        }\n\n        public IssueLabelsViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n        }\n\n        private async Task SelectLabels(IEnumerable<LabelModel> x)\n        {\n            //If nothing has changed, dont do anything...\n            if (_originalLables != null && _originalLables.Count() == x.Count() && _originalLables.Intersect(x).Count() == x.Count())\n            {\n                ChangePresentation(new MvxClosePresentationHint(this));\n                return;\n            }\n                \n            if (SaveOnSelect)\n            {\n                try\n                {\n                    IsSaving = true;\n                    var labels = x != null ? x.Select(y => y.Name).ToArray() : null;\n                    var updateReq = this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].UpdateLabels(labels);\n                    var newIssue = await this.GetApplication().Client.ExecuteAsync(updateReq);\n                    _messageService.Send(new IssueEditMessage(newIssue.Data));\n                }\n                catch\n                {\n                    DisplayAlert(\"Unable to save labels! Please try again.\");\n                }\n                finally\n                {\n                    IsSaving = false;\n                }\n            }\n            else\n            {\n                _messageService.Send(new SelectIssueLabelsMessage(SelectedLabels.Items));\n            }\n\n            ChangePresentation(new MvxClosePresentationHint(this));\n        }\n\n        protected override Task Load()\n        {\n            return Labels.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].Labels.GetAll());\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public long Id { get; set; }\n            public bool SaveOnSelect { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueMilestonesViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Messages;\nusing System;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueMilestonesViewModel : LoadableViewModel\n    {\n        private readonly IMessageService _messageService;\n\n        private MilestoneModel _selectedMilestone;\n        public MilestoneModel SelectedMilestone\n        {\n            get\n            {\n                return _selectedMilestone;\n            }\n            set\n            {\n                _selectedMilestone = value;\n                RaisePropertyChanged(() => SelectedMilestone);\n            }\n        }\n\n        private bool _isSaving;\n        public bool IsSaving\n        {\n            get { return _isSaving; }\n            private set {\n                _isSaving = value;\n                RaisePropertyChanged(() => IsSaving);\n            }\n        }\n\n        private readonly CollectionViewModel<MilestoneModel> _milestones = new CollectionViewModel<MilestoneModel>();\n        public CollectionViewModel<MilestoneModel> Milestones\n        {\n            get { return _milestones; }\n        }\n\n        public string Username  { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public long Id { get; private set; }\n\n        public bool SaveOnSelect { get; private set; }\n\n        public IssueMilestonesViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Id = navObject.Id;\n            SaveOnSelect = navObject.SaveOnSelect;\n            SelectedMilestone = TxSevice.Get() as MilestoneModel;\n\n            this.Bind(x => x.SelectedMilestone).Subscribe(x => SelectMilestone(x));\n        }\n\n        private async Task SelectMilestone(MilestoneModel x)\n        {\n            if (SaveOnSelect)\n            {\n                try\n                {\n                    IsSaving = true;\n                    int? milestone = null;\n                    if (x != null) milestone = x.Number;\n                    var updateReq = this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].UpdateMilestone(milestone);\n                    var newIssue = await this.GetApplication().Client.ExecuteAsync(updateReq);\n                    _messageService.Send(new IssueEditMessage(newIssue.Data));\n                }\n                catch\n                {\n                    DisplayAlert(\"Unable to to save milestone! Please try again.\");\n                }\n                finally\n                {\n                    IsSaving = false;\n                }\n            }\n            else\n            {\n                _messageService.Send(new SelectedMilestoneMessage(x));\n            }\n\n            ChangePresentation(new MvvmCross.Core.ViewModels.MvxClosePresentationHint(this));\n        }\n\n        protected override Task Load()\n        {\n            return Milestones.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].Milestones.GetAll());\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public long Id { get; set; }\n            public bool SaveOnSelect { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueModifyViewModel.cs",
    "content": "using System;\nusing GitHubSharp.Models;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public abstract class IssueModifyViewModel : BaseViewModel\n    {\n        private readonly IMessageService _messageService;\n        private string _title;\n        private string _content;\n        private BasicUserModel _assignedTo;\n        private readonly CollectionViewModel<LabelModel> _labels = new CollectionViewModel<LabelModel>();\n        private MilestoneModel _milestone;\n        private IDisposable _labelsToken, _milestoneToken, _assignedToken;\n        private bool _isSaving;\n\n        public string IssueTitle\n        {\n            get { return _title; }\n            set { this.RaiseAndSetIfChanged(ref _title, value); }\n        }\n\n        public string Content\n        {\n            get { return _content; }\n            set { this.RaiseAndSetIfChanged(ref _content, value); }\n        }\n\n        public MilestoneModel Milestone\n        {\n            get { return _milestone; }\n            set { this.RaiseAndSetIfChanged(ref _milestone, value); }\n        }\n\n        public CollectionViewModel<LabelModel> Labels\n        {\n            get { return _labels; }\n        }\n\n        public BasicUserModel AssignedTo\n        {\n            get { return _assignedTo; }\n            set { this.RaiseAndSetIfChanged(ref _assignedTo, value); }\n        }\n\n        public bool IsSaving\n        {\n            get { return _isSaving; }\n            protected set { this.RaiseAndSetIfChanged(ref _isSaving, value); }\n        }\n\n        public string Username { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public ICommand GoToLabelsCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<CodeHub.Core.Services.IViewModelTxService>().Add(Labels);\n                    ShowViewModel<IssueLabelsViewModel>(new IssueLabelsViewModel.NavObject { Username = Username, Repository = Repository });\n                }); \n            }\n        }\n\n        public ICommand GoToMilestonesCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<CodeHub.Core.Services.IViewModelTxService>().Add(Milestone);\n                    ShowViewModel<IssueMilestonesViewModel>(new IssueMilestonesViewModel.NavObject { Username = Username, Repository = Repository });\n                });\n            }\n        }\n\n        public ICommand GoToAssigneeCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<CodeHub.Core.Services.IViewModelTxService>().Add(AssignedTo);\n                    ShowViewModel<IssueAssignedToViewModel>(new IssueAssignedToViewModel.NavObject { Username = Username, Repository = Repository });\n                }); \n            }\n        }\n\n        public ICommand SaveCommand\n        {\n            get { return new MvxCommand(() => Save()); }\n        }\n\n        public IssueModifyViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n        }\n\n        protected void Init(string username, string repository)\n        {\n            Username = username;\n            Repository = repository;\n\n            _labelsToken = _messageService.Listen<SelectIssueLabelsMessage>(x => Labels.Items.Reset(x.Labels));\n            _milestoneToken = _messageService.Listen<SelectedMilestoneMessage>(x => Milestone = x.Milestone);\n            _assignedToken = _messageService.Listen<SelectedAssignedToMessage>(x => AssignedTo = x.User);\n        }\n\n        protected abstract Task Save();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssueViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing GitHubSharp.Models;\nusing System.Windows.Input;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.Services;\nusing System;\nusing MvvmCross.Core.ViewModels;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.User;\nusing System.Reactive;\nusing Splat;\nusing System.Reactive.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssueViewModel : LoadableViewModel\n    {\n        private IDisposable _editToken;\n        private readonly IFeaturesService _featuresService;\n        private readonly IApplicationService _applicationService;\n        private readonly IMessageService _messageService;\n        private readonly IMarkdownService _markdownService;\n\n        public long Id \n        { \n            get; \n            private set; \n        }\n\n        public string Username \n        { \n            get; \n            private set; \n        }\n\n        public string Repository \n        { \n            get; \n            private set; \n        }\n\n        private string _markdownDescription;\n        public string MarkdownDescription\n        {\n            get { return _markdownDescription; }\n            private set { this.RaiseAndSetIfChanged(ref _markdownDescription, value); }\n        }\n\n        private bool? _isClosed;\n        public bool? IsClosed\n        {\n            get { return _isClosed; }\n            private set { this.RaiseAndSetIfChanged(ref _isClosed, value); }\n        }\n\n        private bool _shouldShowPro; \n        public bool ShouldShowPro\n        {\n            get { return _shouldShowPro; }\n            protected set { this.RaiseAndSetIfChanged(ref _shouldShowPro, value); }\n        }\n\n        private bool _isCollaborator;\n        public bool IsCollaborator\n        {\n            get { return _isCollaborator; }\n            private set { this.RaiseAndSetIfChanged(ref _isCollaborator, value); }\n        }\n\n        private IssueModel _issueModel;\n        public IssueModel Issue\n        {\n            get { return _issueModel; }\n            private set { this.RaiseAndSetIfChanged(ref _issueModel, value); }\n        }\n\n        private bool _isModifying;\n        public bool IsModifying\n        {\n            get { return _isModifying; }\n            set { this.RaiseAndSetIfChanged(ref _isModifying, value); }\n        }\n\n        private int? _participants;\n        public int? Participants\n        {\n            get { return _participants; }\n            set { this.RaiseAndSetIfChanged(ref _participants, value); }\n        }\n\n        private IReadOnlyList<Octokit.IssueComment> _comments;\n        public IReadOnlyList<Octokit.IssueComment> Comments\n        {\n            get { return _comments ?? new List<Octokit.IssueComment>(); }\n            private set { this.RaiseAndSetIfChanged(ref _comments, value); }\n        }\n\n        private IReadOnlyList<Octokit.EventInfo> _events;\n        public IReadOnlyList<Octokit.EventInfo> Events\n        {\n            get { return _events ?? new List<Octokit.EventInfo>(); }\n            private set { this.RaiseAndSetIfChanged(ref _events, value); }\n        }\n\n        public ReactiveUI.ReactiveCommand<Unit, bool> GoToOwner { get; }\n\n        public ICommand GoToAssigneeCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<IViewModelTxService>().Add(Issue.Assignee);\n                    ShowViewModel<IssueAssignedToViewModel>(new IssueAssignedToViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                }, () =>  IsCollaborator); \n            }\n        }\n\n        public ICommand GoToMilestoneCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<IViewModelTxService>().Add(Issue.Milestone);\n                    ShowViewModel<IssueMilestonesViewModel>(new IssueMilestonesViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                }, () =>  IsCollaborator); \n            }\n        }\n\n        public ICommand GoToLabelsCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<IViewModelTxService>().Add(Issue.Labels);\n                    ShowViewModel<IssueLabelsViewModel>(new IssueLabelsViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                }, () =>  IsCollaborator); \n            }\n        }\n\n        public ICommand GoToEditCommand\n        {\n            get \n            { \n                return new MvxCommand(() => {\n                    GetService<IViewModelTxService>().Add(Issue);\n                    ShowViewModel<IssueEditViewModel>(new IssueEditViewModel.NavObject { Username = Username, Repository = Repository, Id = Id });\n                }, () => Issue != null && IsCollaborator); \n            }\n        }\n\n        public ICommand ToggleStateCommand\n        {\n            get \n            {\n                return new MvxCommand(() => ToggleState(Issue.State == \"open\"), () => Issue != null);\n            }\n        }\n\n        protected override Task Load()\n        {\n            if (_featuresService.IsProEnabled)\n                ShouldShowPro = false;\n            else\n            {\n                _applicationService\n                    .GitHubClient.Repository.Get(Username, Repository)\n                    .ToBackground(x => ShouldShowPro = x.Private && !_featuresService.IsProEnabled);\n            }\n\n            _applicationService\n                .GitHubClient.Issue.Comment.GetAllForIssue(Username, Repository, (int)Id)\n                .ToBackground(x => Comments = x);\n\n            _applicationService\n                .GitHubClient.Issue.Events.GetAllForIssue(Username, Repository, (int)Id)\n                .ToBackground(events =>\n                {\n                    Events = events;\n                    Participants = events.Select(x => x.Actor?.Login).Distinct().Count();\n                });\n\n            _applicationService\n                .GitHubClient.Repository.Collaborator.IsCollaborator(Username, Repository, _applicationService.Account.Username)\n                .ToBackground(x => IsCollaborator = x);\n\n            return this.RequestModel(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].Get(), response => Issue = response.Data);\n        }\n\n        public IssueViewModel(\n            IApplicationService applicationService = null,\n            IFeaturesService featuresService = null,\n            IMessageService messageService = null,\n            IMarkdownService markdownService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _featuresService = featuresService ?? Locator.Current.GetService<IFeaturesService>();\n            _messageService = messageService ?? Locator.Current.GetService<IMessageService>();\n            _markdownService = markdownService ?? Locator.Current.GetService<IMarkdownService>();\n\n            this.Bind(x => x.Issue, true)\n                .Where(x => x != null)\n                .Select(x => string.Equals(x.State, \"closed\"))\n                .Subscribe(x => IsClosed = x);\n\n            this.Bind(x => x.Issue, true)\n                .SelectMany(issue => _markdownService.Convert(issue?.Body).ToObservable())\n                .Subscribe(x => MarkdownDescription = x);\n\n            GoToOwner = ReactiveUI.ReactiveCommand.Create(\n                () => ShowViewModel<UserViewModel>(new UserViewModel.NavObject { Username = Issue?.User?.Login }),\n                this.Bind(x => x.Issue, true).Select(x => x != null));\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Id = navObject.Id;\n\n            _editToken = _messageService.Listen<IssueEditMessage>(x =>\n            {\n                if (x.Issue == null || x.Issue.Number != Issue.Number)\n                    return;\n                Issue = x.Issue;\n            });\n        }\n\n        public async Task<bool> AddComment(string text)\n        {\n            try\n            {\n                var comment = await _applicationService.GitHubClient.Issue.Comment.Create(Username, Repository, (int)Id, text);\n                var newCommentList = new List<Octokit.IssueComment>(Comments) { comment };\n                Comments = newCommentList;\n                return true;\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(e.Message);\n                return false;\n            }\n        }\n\n        private async Task ToggleState(bool closed)\n        {\n            try\n            {\n                IsModifying = true;\n                var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Issue.Number].UpdateState(closed ? \"closed\" : \"open\")); \n                _messageService.Send(new IssueEditMessage(data.Data));\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(\"Unable to \" + (closed ? \"close\" : \"open\") + \" the item. \" + e.Message);\n            }\n            finally\n            {\n                IsModifying = false;\n            }\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public long Id { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/IssuesViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Filters;\nusing GitHubSharp.Models;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Messages;\nusing System.Linq;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class IssuesViewModel : BaseIssuesViewModel<IssuesFilterModel>\n    {\n        private readonly IMessageService _messageService;\n        private IDisposable _addToken, _editToken;\n\n        public string Username { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public ICommand GoToNewIssueCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<IssueAddViewModel>(new IssueAddViewModel.NavObject { Username = Username, Repository = Repository })); }\n        }\n\n        public IssuesViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n        }\n\n        public void Init(NavObject nav)\n        {\n            Username = nav.Username;\n            Repository = nav.Repository;\n            _issues = new FilterableCollectionViewModel<IssueModel, IssuesFilterModel>(\"IssuesViewModel:\" + Username + \"/\" + Repository);\n            _issues.GroupingFunction = Group;\n            _issues.Bind(x => x.Filter).Subscribe(_ => LoadCommand.Execute(true));\n\n            _addToken = _messageService.Listen<IssueAddMessage>(x =>\n            {\n                if (x.Issue == null || !DoesIssueBelong(x.Issue))\n                    return;\n                Issues.Items.Insert(0, x.Issue);\n            });\n\n            _editToken = _messageService.Listen<IssueEditMessage>(x =>\n            {\n                if (x.Issue == null || !DoesIssueBelong(x.Issue))\n                    return;\n                \n                var item = Issues.Items.FirstOrDefault(y => y.Number == x.Issue.Number);\n                if (item == null)\n                    return;\n\n                var index = Issues.Items.IndexOf(item);\n\n                using (Issues.DeferRefresh())\n                {\n                    Issues.Items.RemoveAt(index);\n                    Issues.Items.Insert(index, x.Issue);\n                }\n            });\n        }\n\n        protected override Task Load()\n        {\n            string direction = _issues.Filter.Ascending ? \"asc\" : \"desc\";\n            string state = _issues.Filter.Open ? \"open\" : \"closed\";\n            string sort = _issues.Filter.SortType == IssuesFilterModel.Sort.None ? null : _issues.Filter.SortType.ToString().ToLower();\n            string labels = string.IsNullOrEmpty(_issues.Filter.Labels) ? null : _issues.Filter.Labels;\n            string assignee = string.IsNullOrEmpty(_issues.Filter.Assignee) ? null : _issues.Filter.Assignee;\n            string creator = string.IsNullOrEmpty(_issues.Filter.Creator) ? null : _issues.Filter.Creator;\n            string mentioned = string.IsNullOrEmpty(_issues.Filter.Mentioned) ? null : _issues.Filter.Mentioned;\n            string milestone = _issues.Filter.Milestone == null ? null : _issues.Filter.Milestone.Value;\n\n            var request = this.GetApplication().Client.Users[Username].Repositories[Repository].Issues.GetAll(sort: sort, labels: labels, state: state, direction: direction, \n                                                                                          assignee: assignee, creator: creator, mentioned: mentioned, milestone: milestone);\n            return Issues.SimpleCollectionLoad(request);\n        }\n\n        public void CreateIssue(IssueModel issue)\n        {\n            if (!DoesIssueBelong(issue))\n                return;\n            Issues.Items.Add(issue);\n        }\n\n        private bool DoesIssueBelong(IssueModel model)\n        {\n            if (Issues.Filter == null)\n                return true;\n            if (Issues.Filter.Open != model.State.Equals(\"open\"))\n                return false;\n            return true;\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Issues/MyIssuesViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing CodeHub.Core.Filters;\nusing GitHubSharp.Models;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.Issues\n{\n    public class MyIssuesViewModel : BaseIssuesViewModel<MyIssuesFilterModel>\n    {\n        private IDisposable _editToken;\n\n        private int _selectedFilter;\n        public int SelectedFilter\n        {\n            get { return _selectedFilter; }\n            set \n            {\n                _selectedFilter = value;\n                RaisePropertyChanged(() => SelectedFilter);\n            }\n        }\n\n        public MyIssuesViewModel(IMessageService messageService = null)\n        {\n            messageService = messageService ?? GetService<IMessageService>();\n            \n            _issues = new FilterableCollectionViewModel<IssueModel, MyIssuesFilterModel>(\"MyIssues\");\n            _issues.GroupingFunction = Group;\n            _issues.Bind(x => x.Filter).Subscribe(_ => LoadCommand.Execute(false));\n\n            this.Bind(x => x.SelectedFilter).Subscribe(x =>\n            {\n                if (x == 0)\n                    _issues.Filter = MyIssuesFilterModel.CreateOpenFilter();\n                else if (x == 1)\n                    _issues.Filter = MyIssuesFilterModel.CreateClosedFilter();\n            });\n\n            _editToken = messageService.Listen<IssueEditMessage>(x =>\n            {\n                if (x.Issue == null)\n                    return;\n\n                var item = Issues.Items.FirstOrDefault(y => y.Number == x.Issue.Number);\n                if (item == null)\n                    return;\n\n                var index = Issues.Items.IndexOf(item);\n\n                using (Issues.DeferRefresh())\n                {\n                    Issues.Items.RemoveAt(index);\n                    Issues.Items.Insert(index, x.Issue);\n                }\n            });\n        }\n\n        protected override List<IGrouping<string, IssueModel>> Group(IEnumerable<IssueModel> model)\n        {\n            var group = base.Group(model);\n            if (group == null)\n            {\n                try\n                {\n                    var regex = new System.Text.RegularExpressions.Regex(\"repos/(.+)/issues/\");\n                    return model.GroupBy(x => regex.Match(x.Url).Groups[1].Value).ToList();\n                }\n                catch\n                {\n                    return null;\n                }\n            }\n\n            return group;\n        }\n\n        protected override Task Load()\n        {\n            string filter = Issues.Filter.FilterType.ToString().ToLower();\n            string direction = Issues.Filter.Ascending ? \"asc\" : \"desc\";\n            string state = Issues.Filter.Open ? \"open\" : \"closed\";\n            string sort = Issues.Filter.SortType == MyIssuesFilterModel.Sort.None ? null : Issues.Filter.SortType.ToString().ToLower();\n            string labels = string.IsNullOrEmpty(Issues.Filter.Labels) ? null : Issues.Filter.Labels;\n\n            var request = this.GetApplication().Client.AuthenticatedUser.Issues.GetAll(sort: sort, labels: labels, state: state, direction: direction, filter: filter);\n            return Issues.SimpleCollectionLoad(request);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/LoadableViewModel.cs",
    "content": "using GitHubSharp;\nusing System.Threading.Tasks;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.ViewModels;\nusing System.Windows.Input;\nusing System.Net;\nusing System;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public abstract class LoadableViewModel : BaseViewModel\n    {\n        public ICommand LoadCommand { get; }\n\n        private bool _isLoading;\n        public bool IsLoading\n        {\n            get { return _isLoading; }\n            private set { this.RaiseAndSetIfChanged(ref _isLoading, value); }\n        }\n\n        private async Task LoadResource()\n        {\n            var retry = false;\n            while (true)\n            {\n                if (retry)\n                    await Task.Delay(100);\n\n                try\n                {\n                    await Load();\n                    return;\n                }\n                catch (WebException)\n                {\n                    if (!retry)\n                        retry = true;\n                    else\n                        throw;\n                }\n            }\n        }\n\n        protected async Task ExecuteLoadResource()\n        {\n            try\n            {\n                await LoadResource();\n            }\n            catch (System.IO.IOException)\n            {\n                DisplayAlert(\"Unable to communicate with GitHub as the transmission was interrupted! Please try again.\");\n            }\n            catch (StatusCodeException e)\n            {\n                DisplayAlert(e.Message);\n            }\n        }\n\n        protected LoadableViewModel()\n        {\n            LoadCommand = new MvxCommand<bool?>(x => HandleLoadCommand(), _ => !IsLoading);\n        }\n\n        private async Task HandleLoadCommand()\n        {\n            try\n            {\n                IsLoading = true;\n                await ExecuteLoadResource();\n            }\n            catch (OperationCanceledException e)\n            {\n                // The operation was canceled... Don't worry\n                System.Diagnostics.Debug.WriteLine(\"The operation was canceled: \" + e.Message);\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(\"The request to load this item did not complete successfuly! \" + e.Message);\n            }\n            finally\n            {\n                IsLoading = false;\n            }\n        }\n\n        protected abstract Task Load();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/MarkdownAccessoryViewModel.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing CodeHub.Core.Services;\nusing System.IO;\nusing System.Threading.Tasks;\nusing System.Reactive.Linq;\nusing System.Reactive;\nusing Splat;\nusing Plugin.Media.Abstractions;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public class MarkdownAccessoryViewModel : ReactiveObject\n    {\n        private const string IMGUR_UPLOAD_WARN = \"IMGUR_UPLOAD_WARN\";\n        private const string IMGUR_UPLOAD_WARN_MESSAGE = \n            \"Because GitHub's image upload API is not public images you upload here are hosted by Imgur. \" + \n            \"Please be aware of this when posting confidential information\";\n\n        public ReactiveCommand<Unit, string> PostToImgurCommand { get; private set; }\n\n        public MarkdownAccessoryViewModel(\n            IImgurService imgurService = null, \n            IMedia mediaPicker = null, \n            IAlertDialogService alertDialog = null)\n        {\n            imgurService = imgurService ?? Locator.Current.GetService<IImgurService>();\n            mediaPicker = mediaPicker ?? Plugin.Media.CrossMedia.Current;\n            alertDialog = alertDialog ?? Locator.Current.GetService<IAlertDialogService>();\n\n            PostToImgurCommand = ReactiveCommand.CreateFromTask(async _ => {\n                \n                if (!Settings.HasSeenImgurUploadWarn)\n                {\n                    Settings.HasSeenImgurUploadWarn = true;\n                    await alertDialog.Alert(\"Please Read!\", IMGUR_UPLOAD_WARN_MESSAGE);\n                }\n\n                var photo = await mediaPicker.PickPhotoAsync(new PickMediaOptions\n                {\n                    CompressionQuality = 80\n                });\n\n                var memoryStream = new MemoryStream();\n                await photo.GetStream().CopyToAsync(memoryStream);\n                     \n                using (alertDialog.Activate(\"Uploading...\"))\n                {\n                    var model = await imgurService.SendImage(memoryStream.ToArray());\n                    if (model == null || model.Data == null || model.Data.Link == null)\n                        throw new InvalidOperationException(\"Unable to upload to Imgur. Please try again later.\");\n                    return model.Data.Link;\n                }\n            });\n\n            PostToImgurCommand.ThrownExceptions\n                .Where(x => !(x is TaskCanceledException))\n                .Subscribe(x => alertDialog.Alert(\"Upload Error\", x.Message));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Notifications/NotificationsViewModel.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.Filters;\nusing CodeHub.Core.ViewModels.Issues;\nusing CodeHub.Core.ViewModels.PullRequests;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.ViewModels.Changesets;\nusing CodeHub.Core.Utils;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Repositories;\n\nnamespace CodeHub.Core.ViewModels.Notifications\n{\n    public class NotificationsViewModel : LoadableViewModel\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IMessageService _messageService;\n        private readonly FilterableCollectionViewModel<Octokit.Notification, NotificationsFilterModel> _notifications;\n        private ICommand _readAllCommand;\n        private ICommand _readReposCommand;\n        private int _shownIndex;\n        private bool _isMarking;\n\n        public FilterableCollectionViewModel<Octokit.Notification, NotificationsFilterModel> Notifications\n        {\n            get { return _notifications; }\n        }\n\n        public int ShownIndex\n        {\n            get { return _shownIndex; }\n            set { this.RaiseAndSetIfChanged(ref _shownIndex, value); }\n        }\n\n        public bool IsMarking\n        {\n            get { return _isMarking; }\n            set { this.RaiseAndSetIfChanged(ref _isMarking, value); }\n        }\n\n        public ICommand ReadRepositoriesCommand\n        {\n            get { return _readReposCommand ?? (_readReposCommand = new MvxAsyncCommand<string>(x => MarkRepoAsRead(x))); }\n        }\n\n        public ICommand ReadAllCommand\n        {\n            get { return _readAllCommand ?? (_readAllCommand = new MvxAsyncCommand(() => MarkAllAsRead(), () => ShownIndex != 2 && !IsLoading && !IsMarking && Notifications.Any())); }\n        }\n\n        public ICommand GoToNotificationCommand\n        {\n            get { return new MvxCommand<Octokit.Notification>(GoToNotification); }\n        }\n        \n        private void GoToNotification(Octokit.Notification x)\n        {\n            var subject = x.Subject.Type.ToLower();\n            if (subject.Equals(\"issue\"))\n            {\n                Read(x).ToBackground();\n                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);\n                ShowViewModel<IssueViewModel>(new IssueViewModel.NavObject { Username = x.Repository.Owner.Login,Repository = x.Repository.Name, Id = long.Parse(node) });\n            }\n            else if (subject.Equals(\"pullrequest\"))\n            {\n                Read(x).ToBackground();\n                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);\n                ShowViewModel<PullRequestViewModel>(new PullRequestViewModel.NavObject { Username = x.Repository.Owner.Login, Repository = x.Repository.Name, Id = long.Parse(node) });\n            }\n            else if (subject.Equals(\"commit\"))\n            {\n                Read(x).ToBackground();\n                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);\n                ShowViewModel<ChangesetViewModel>(new ChangesetViewModel.NavObject { Username = x.Repository.Owner.Login, Repository = x.Repository.Name, Node = node });\n            }\n            else if (subject.Equals(\"release\"))\n            {\n                Read(x).ToBackground();\n                ShowViewModel<RepositoryViewModel>(new RepositoryViewModel.NavObject { Username = x.Repository.Owner.Login, Repository = x.Repository.Name });\n            }\n        }\n\n        public NotificationsViewModel(\n            IMessageService messageService = null,\n            IApplicationService applicationService = null)\n        {\n            _messageService = messageService ?? GetService<IMessageService>();\n            _applicationService = applicationService ?? GetService<IApplicationService>();\n            _notifications = new FilterableCollectionViewModel<Octokit.Notification, NotificationsFilterModel>(\"Notifications\");\n            _notifications.GroupingFunction = (n) => n.GroupBy(x => x.Repository.FullName);\n            _notifications.Bind(x => x.Filter).Subscribe(_ => LoadCommand.Execute(false));\n\n            this.Bind(x => x.ShownIndex).Subscribe(x => {\n                if (x == 0) _notifications.Filter = NotificationsFilterModel.CreateUnreadFilter();\n                else if (x == 1) _notifications.Filter = NotificationsFilterModel.CreateParticipatingFilter();\n                else _notifications.Filter = NotificationsFilterModel.CreateAllFilter();\n                ((IMvxCommand)ReadAllCommand).RaiseCanExecuteChanged();\n            });\n            this.Bind(x => x.IsLoading).Subscribe(_ => ((IMvxCommand)ReadAllCommand).RaiseCanExecuteChanged());\n\n            if (_notifications.Filter.Equals(NotificationsFilterModel.CreateUnreadFilter()))\n                _shownIndex = 0;\n            else if (_notifications.Filter.Equals(NotificationsFilterModel.CreateParticipatingFilter()))\n                _shownIndex = 1;\n            else\n                _shownIndex = 2;\n\n        }\n\n        protected override async Task Load()\n        {\n            var req = new Octokit.NotificationsRequest\n            {\n                All = Notifications.Filter.All,\n                Participating = Notifications.Filter.Participating\n            };\n\n            var notifications = await _applicationService.GitHubClient.Activity.Notifications.GetAllForCurrent(req);\n            Notifications.Items.Reset(notifications);\n            UpdateAccountNotificationsCount();\n        }\n\n        private async Task Read(Octokit.Notification model)\n        {\n            // If its already read, ignore it\n            if (!model.Unread)\n                return;\n\n            try\n            {\n                if (!int.TryParse(model.Id, out int id))\n                    return;\n\n                await _applicationService.GitHubClient.Activity.Notifications.MarkAsRead(id);\n\n                if (_shownIndex != 2)\n                    Notifications.Items.Remove(model);\n\n                UpdateAccountNotificationsCount();\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to mark notification as read. Please try again.\");\n            }\n        }\n\n        private async Task MarkRepoAsRead(string repo)\n        {\n            try\n            {\n                IsMarking = true;\n                var repoId = RepositoryIdentifier.FromFullName(repo);\n                if (repoId == null) return;\n                await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Notifications.MarkRepoAsRead(repoId.Owner, repoId.Name));\n                Notifications.Items.RemoveRange(Notifications.Items.Where(x => string.Equals(x.Repository.FullName, repo, StringComparison.OrdinalIgnoreCase)).ToList());\n                UpdateAccountNotificationsCount();\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to mark repositories' notifications as read. Please try again.\");\n            }\n            finally\n            {\n                IsMarking = false;\n            }\n        }\n\n        private async Task MarkAllAsRead()\n        {\n            // Make sure theres some sort of notification\n            if (!Notifications.Any())\n                return;\n\n            try\n            {\n                IsMarking = true;\n                await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Notifications.MarkAsRead());\n                Notifications.Items.Clear();\n                UpdateAccountNotificationsCount();\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to mark all notifications as read. Please try again.\");\n            }\n            finally\n            {\n                IsMarking = false;\n            }\n        }\n\n        private void UpdateAccountNotificationsCount()\n        {\n            // Only update if we're looking at \n            if (!Notifications.Filter.All && !Notifications.Filter.Participating)\n            {\n                var count = Notifications.Items.Sum(x => x.Unread ? 1 : 0);\n                _messageService.Send(new NotificationCountMessage(count));\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Organizations/OrganizationViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.Core.ViewModels.Events;\nusing GitHubSharp.Models;\n\nnamespace CodeHub.Core.ViewModels.Organizations\n{\n    public class OrganizationViewModel : LoadableViewModel\n    {\n        private UserModel _userModel;\n\n        public string Name { get; private set; }\n\n        public void Init(NavObject navObject)\n        {\n            Name = navObject.Name;\n        }\n\n        public UserModel Organization\n        {\n            get { return _userModel; }\n            private set { this.RaiseAndSetIfChanged(ref _userModel, value); }\n        }\n\n        public ICommand GoToTeamsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<TeamsViewModel>(new TeamsViewModel.NavObject { Name = Name })); }\n        }\n\n        public ICommand GoToEventsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<UserEventsViewModel>(new UserEventsViewModel.NavObject { Username = Name })); }\n        }\n\n        protected override Task Load()\n        {\n            return this.RequestModel(this.GetApplication().Client.Organizations[Name].Get(), response => Organization = response.Data);\n        }\n\n        public class NavObject\n        {\n            public string Name { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Organizations/OrganizationsViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing System.Windows.Input;\nusing CodeHub.Core.ViewModels;\nusing GitHubSharp.Models;\nusing MvvmCross.Core.ViewModels;\n\nnamespace CodeHub.Core.ViewModels.Organizations\n{\n    public class OrganizationsViewModel : LoadableViewModel\n    {\n        public CollectionViewModel<BasicUserModel> Organizations { get; }\n\n        public string Username { get; private set; }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n        }\n\n        public OrganizationsViewModel()\n        {\n            Title = \"Organizations\";\n            Organizations = new CollectionViewModel<BasicUserModel>();\n        }\n\n        public ICommand GoToOrganizationCommand\n        {\n            get { return new MvxCommand<BasicUserModel>(x => ShowViewModel<OrganizationViewModel>(new OrganizationViewModel.NavObject { Name = x.Login }));}\n        }\n\n        protected override Task Load()\n        {\n            return Organizations.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].GetOrganizations());\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Organizations/TeamsViewModel.cs",
    "content": "using GitHubSharp.Models;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.Core.ViewModels.Organizations\n{\n    public class TeamsViewModel : LoadableViewModel\n    {\n        public CollectionViewModel<TeamShortModel> Teams { get; }\n\n        public string OrganizationName { get; private set; }\n\n        public TeamsViewModel()\n        {\n            Title = \"Teams\";\n            Teams = new CollectionViewModel<TeamShortModel>();\n        }\n\n        public void Init(NavObject navObject)\n        {\n            OrganizationName = navObject.Name;\n        }\n\n        protected override Task Load()\n        {\n            return Teams.SimpleCollectionLoad(this.GetApplication().Client.Organizations[OrganizationName].GetTeams());\n        }\n\n        public class NavObject\n        {\n            public string Name { get; set; }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/ViewModels/PullRequests/PullRequestCommitsViewModel.cs",
    "content": "using GitHubSharp.Models;\nusing GitHubSharp;\nusing System.Collections.Generic;\nusing CodeHub.Core.ViewModels.Changesets;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.PullRequests\n{\n    public class PullRequestCommitsViewModel : ChangesetsViewModel\n    {\n        public long PullRequestId \n        { \n            get; \n            private set; \n        }\n\n        public PullRequestCommitsViewModel(IApplicationService applicationService, IFeaturesService featuresService)\n            : base(applicationService, featuresService)\n        {\n        }\n\n        public void Init(NavObject navObject)\n        {\n            base.Init(navObject);\n            PullRequestId = navObject.PullRequestId;\n        }\n\n        protected override GitHubRequest<List<CommitModel>> GetRequest()\n        {\n            return this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[PullRequestId].GetCommits();\n        }\n\n        public new class NavObject : CommitsViewModel.NavObject\n        {\n            public long PullRequestId { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/PullRequests/PullRequestFilesViewModel.cs",
    "content": "using System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Source;\nusing GitHubSharp.Models;\nusing MvvmCross.Core.ViewModels;\nusing MvvmCross.Platform;\n\nnamespace CodeHub.Core.ViewModels.PullRequests\n{\n    public class PullRequestFilesViewModel : LoadableViewModel\n    {\n        private readonly CollectionViewModel<CommitModel.CommitFileModel> _files = new CollectionViewModel<CommitModel.CommitFileModel>();\n\n        public CollectionViewModel<CommitModel.CommitFileModel> Files\n        {\n            get { return _files; }\n        }\n\n        public long PullRequestId { get; private set; }\n\n        public string Username { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public string Sha { get; private set; }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            PullRequestId = navObject.PullRequestId;\n            Sha = navObject.Sha;\n\n            _files.GroupingFunction = (x) => x.GroupBy(y => {\n                var filename = \"/\" + y.Filename;\n                return filename.Substring(0, filename.LastIndexOf(\"/\", System.StringComparison.Ordinal) + 1);\n            }).OrderBy(y => y.Key);\n        }\n\n        protected override Task Load()\n        {\n            return Files.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[PullRequestId].GetFiles());\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public string Sha { get; set; }\n            public long PullRequestId { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/PullRequests/PullRequestViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Issues;\nusing CodeHub.Core.Messages;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.User;\nusing System.Reactive;\nusing System.Reactive.Threading.Tasks;\nusing System.Collections.Generic;\n\nnamespace CodeHub.Core.ViewModels.PullRequests\n{\n    public class PullRequestViewModel : LoadableViewModel\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IMessageService _messageService;\n        private IDisposable _issueEditSubscription;\n        private IDisposable _pullRequestEditSubscription;\n        private readonly IFeaturesService _featuresService;\n        private readonly IMarkdownService _markdownService;\n\n        public long Id\n        { \n            get; \n            private set; \n        }\n\n        public string Username\n        { \n            get; \n            private set; \n        }\n\n        public string Repository\n        { \n            get; \n            private set; \n        }\n\n        private string _markdownDescription;\n        public string MarkdownDescription\n        {\n            get { return _markdownDescription; }\n            private set { this.RaiseAndSetIfChanged(ref _markdownDescription, value); }\n        }\n\n        private bool _canPush;\n        public bool CanPush\n        {\n            get { return _canPush; }\n            private set { this.RaiseAndSetIfChanged(ref _canPush, value); }\n        }\n\n        private bool _isCollaborator;\n        public bool IsCollaborator\n        {\n            get { return _isCollaborator; }\n            private set { this.RaiseAndSetIfChanged(ref _isCollaborator, value); }\n        }\n\n        private bool _merged;\n        public bool Merged\n        {\n            get { return _merged; }\n            set { this.RaiseAndSetIfChanged(ref _merged, value); }\n        }\n\n        private IssueModel _issueModel;\n        public IssueModel Issue\n        {\n            get { return _issueModel; }\n            private set { this.RaiseAndSetIfChanged(ref _issueModel, value); }\n        }\n\n        private PullRequestModel _model;\n        public PullRequestModel PullRequest\n        { \n            get { return _model; }\n            private set { this.RaiseAndSetIfChanged(ref _model, value); }\n        }\n\n        private bool _isModifying;\n        public bool IsModifying\n        {\n            get { return _isModifying; }\n            set { this.RaiseAndSetIfChanged(ref _isModifying, value); }\n        }\n\n        private bool? _isClosed;\n        public bool? IsClosed\n        {\n            get { return _isClosed; }\n            private set { this.RaiseAndSetIfChanged(ref _isClosed, value); }\n        }\n\n        private IReadOnlyList<Octokit.IssueComment> _comments;\n        public IReadOnlyList<Octokit.IssueComment> Comments\n        {\n            get { return _comments ?? new List<Octokit.IssueComment>(); }\n            private set { this.RaiseAndSetIfChanged(ref _comments, value); }\n        }\n\n        private IReadOnlyList<Octokit.EventInfo> _events;\n        public IReadOnlyList<Octokit.EventInfo> Events\n        {\n            get { return _events ?? new List<Octokit.EventInfo>(); }\n            private set { this.RaiseAndSetIfChanged(ref _events, value); }\n        }\n\n        private ICommand _goToAssigneeCommand;\n\n        public ICommand GoToAssigneeCommand\n        {\n            get\n            {\n                if (_goToAssigneeCommand == null)\n                {\n                    var cmd = new MvxCommand(() =>\n                    {\n                        GetService<IViewModelTxService>().Add(Issue.Assignee);\n                        ShowViewModel<IssueAssignedToViewModel>(new IssueAssignedToViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                    }, () => Issue != null && IsCollaborator);\n\n                    this.Bind(x => Issue).Subscribe(_ => cmd.RaiseCanExecuteChanged());\n                    _goToAssigneeCommand = cmd;\n                }\n\n                return _goToAssigneeCommand;\n            }\n        }\n\n        private ICommand _goToMilestoneCommand;\n\n        public ICommand GoToMilestoneCommand\n        {\n            get\n            { \n                if (_goToMilestoneCommand == null)\n                {\n                    var cmd = new MvxCommand(() =>\n                    {\n                        GetService<IViewModelTxService>().Add(Issue.Milestone);\n                        ShowViewModel<IssueMilestonesViewModel>(new IssueMilestonesViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                    }, () => Issue != null && IsCollaborator);\n\n                    this.Bind(x => Issue).Subscribe(_ => cmd.RaiseCanExecuteChanged());\n                    _goToMilestoneCommand = cmd;\n                }\n\n                return _goToMilestoneCommand;\n            }\n        }\n\n        private ICommand _goToLabelsCommand;\n\n        public ICommand GoToLabelsCommand\n        {\n            get\n            { \n                if (_goToLabelsCommand == null)\n                {\n                    var cmd = new MvxCommand(() =>\n                    {\n                        GetService<IViewModelTxService>().Add(Issue.Labels);\n                        ShowViewModel<IssueLabelsViewModel>(new IssueLabelsViewModel.NavObject { Username = Username, Repository = Repository, Id = Id, SaveOnSelect = true });\n                    }, () => Issue != null && IsCollaborator);\n\n                    this.Bind(x => Issue).Subscribe(_ => cmd.RaiseCanExecuteChanged());\n                    _goToLabelsCommand = cmd;\n                }\n\n                return _goToLabelsCommand;\n            }\n        }\n\n        public ICommand GoToEditCommand\n        {\n            get\n            { \n                return new MvxCommand(() =>\n                {\n                    GetService<IViewModelTxService>().Add(Issue);\n                    ShowViewModel<IssueEditViewModel>(new IssueEditViewModel.NavObject { Username = Username, Repository = Repository, Id = Id });\n                }, () => Issue != null && IsCollaborator); \n            }\n        }\n\n        public ICommand ToggleStateCommand\n        {\n            get { return new MvxCommand(() => ToggleState(PullRequest.State == \"open\")); }\n        }\n\n        public ReactiveUI.ReactiveCommand<Unit, bool> GoToOwner { get; }\n\n        public ICommand GoToCommitsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<PullRequestCommitsViewModel>(new PullRequestCommitsViewModel.NavObject { Username = Username, Repository = Repository, PullRequestId = Id })); }\n        }\n\n        public ICommand GoToFilesCommand\n        {\n            get {\n                return new MvxCommand(() =>\n                {\n                    ShowViewModel<PullRequestFilesViewModel>(new PullRequestFilesViewModel.NavObject {\n                        Username = Username,\n                        Repository = Repository,\n                        PullRequestId = Id,\n                        Sha = PullRequest.Head?.Sha\n                    });   \n                });\n            }\n        }\n\n        public PullRequestViewModel(\n            IApplicationService applicationService,\n            IFeaturesService featuresService,\n            IMessageService messageService,\n            IMarkdownService markdownService)\n        {\n            _applicationService = applicationService;\n            _featuresService = featuresService;\n            _messageService = messageService;\n            _markdownService = markdownService;\n\n            this.Bind(x => x.PullRequest, true)\n                .Where(x => x != null)\n                .Select(x => string.Equals(x.State, \"closed\"))\n                .Subscribe(x => IsClosed = x);\n\n            this.Bind(x => x.Issue, true)\n                .SelectMany(issue => _markdownService.Convert(issue?.Body).ToObservable())\n                .Subscribe(x => MarkdownDescription = x);\n            \n            GoToOwner = ReactiveUI.ReactiveCommand.Create(\n                () => ShowViewModel<UserViewModel>(new UserViewModel.NavObject { Username = Issue?.User?.Login }),\n                this.Bind(x => x.Issue, true).Select(x => x != null));\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Id = navObject.Id;\n\n            _issueEditSubscription = _messageService.Listen<IssueEditMessage>(x =>\n            {\n                if (x.Issue == null || x.Issue.Number != Id)\n                    return;\n                Issue = x.Issue;\n            });\n\n            _pullRequestEditSubscription = _messageService.Listen<PullRequestEditMessage>(x =>\n            {\n                if (x.PullRequest == null || x.PullRequest.Number != Id)\n                    return;\n                PullRequest = x.PullRequest;\n            });\n        }\n\n        public async Task<bool> AddComment(string text)\n        {\n            try\n            {\n                var comment = await _applicationService.GitHubClient.Issue.Comment.Create(Username, Repository, (int)Id, text);\n                var newCommentList = new List<Octokit.IssueComment>(Comments) { comment };\n                Comments = newCommentList;\n                return true;\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(e.Message);\n                return false;\n            }\n        }\n\n        private async Task ToggleState(bool closed)\n        {\n            try\n            {\n                IsModifying = true;\n                var data = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].UpdateState(closed ? \"closed\" : \"open\")); \n                _messageService.Send(new PullRequestEditMessage(data.Data));\n            }\n            catch (Exception e)\n            {\n                DisplayAlert(\"Unable to \" + (closed ? \"close\" : \"open\") + \" the item. \" + e.Message);\n            }\n            finally\n            {\n                IsModifying = false;\n            }\n        }\n\n        private bool _shouldShowPro; \n        public bool ShouldShowPro\n        {\n            get { return _shouldShowPro; }\n            protected set { this.RaiseAndSetIfChanged(ref _shouldShowPro, value); }\n        }\n\n        protected override Task Load()\n        {\n            ShouldShowPro = false;\n\n            _applicationService\n                .GitHubClient.Issue.Comment.GetAllForIssue(Username, Repository, (int)Id)\n                .ToBackground(x => Comments = x);\n\n            _applicationService\n                .GitHubClient.Issue.Events.GetAllForIssue(Username, Repository, (int)Id)\n                .ToBackground(x => Events = x);\n\n            var pullRequest = this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Get();\n            var t1 = this.RequestModel(pullRequest, response => PullRequest = response.Data);\n            this.RequestModel(this.GetApplication().Client.Users[Username].Repositories[Repository].Issues[Id].Get(), response => Issue = response.Data).ToBackground();\n\n            _applicationService\n                .GitHubClient.Repository.Get(Username, Repository)\n                .ToBackground(x => \n                {\n                    CanPush = x.Permissions.Push;\n                    ShouldShowPro = x.Private && !_featuresService.IsProEnabled;\n                });\n\n            _applicationService\n                .GitHubClient.Repository.Collaborator.IsCollaborator(Username, Repository, _applicationService.Account.Username)\n                .ToBackground(x => IsCollaborator = x);\n            \n            return t1;\n        }\n\n        public async Task Merge()\n        {\n            try\n            {\n                var response = await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests[Id].Merge(string.Empty));\n                if (!response.Data.Merged)\n                    throw new Exception(response.Data.Message);\n\n            }\n            catch (Exception e)\n            {\n                this.AlertService.Alert(\"Unable to Merge!\", e.Message).ToBackground();\n            }\n\n            await Load();\n        }\n\n        public ICommand MergeCommand\n        {\n            get { return new MvxCommand(() => Merge(), CanMerge); }\n        }\n\n        private bool CanMerge()\n        {\n            if (PullRequest == null)\n                return false;\n            \n            var isClosed = string.Equals(PullRequest.State, \"closed\", StringComparison.OrdinalIgnoreCase);\n            var isMerged = PullRequest.Merged.GetValueOrDefault();\n\n            return CanPush && !isClosed && !isMerged;\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n\n            public string Repository { get; set; }\n\n            public long Id { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/PullRequests/PullRequestsViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing GitHubSharp.Models;\nusing CodeHub.Core.Messages;\nusing System.Linq;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.Core.ViewModels.PullRequests\n{\n    public class PullRequestsViewModel : LoadableViewModel\n    {\n        private readonly IMessageService _messageService;\n        private IDisposable _pullRequestEditSubscription;\n\n        private readonly CollectionViewModel<PullRequestModel> _pullrequests = new CollectionViewModel<PullRequestModel>();\n        public CollectionViewModel<PullRequestModel> PullRequests\n        {\n            get { return _pullrequests; }\n        }\n\n        public string Username { get; private set; }\n\n        public string Repository { get; private set; }\n\n        private int _selectedFilter;\n        public int SelectedFilter\n        {\n            get { return _selectedFilter; }\n            set \n            {\n                _selectedFilter = value;\n                RaisePropertyChanged(() => SelectedFilter);\n            }\n        }\n\n        public ICommand GoToPullRequestCommand\n        {\n            get { return new MvxCommand<PullRequestModel>(x => ShowViewModel<PullRequestViewModel>(new PullRequestViewModel.NavObject { Username = Username, Repository = Repository, Id = x.Number })); }\n        }\n\n        public PullRequestsViewModel(IMessageService messageService)\n        {\n            _messageService = messageService;\n            this.Bind(x => x.SelectedFilter).Subscribe(_ => LoadCommand.Execute(null));\n        }\n\n        public void Init(NavObject navObject) \n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n\n            PullRequests.FilteringFunction = x => {\n                var state = SelectedFilter == 0 ? \"open\" : \"closed\";\n                return x.Where(y => y.State == state);\n            };\n\n            _pullRequestEditSubscription = _messageService.Listen<PullRequestEditMessage>(x =>\n            {\n                if (x.PullRequest == null)\n                    return;\n          \n                var index = PullRequests.Items.IndexOf(x.PullRequest);\n                if (index < 0)\n                    return;\n                PullRequests.Items[index] = x.PullRequest;\n                PullRequests.Refresh();\n            });\n        }\n\n        protected override Task Load()\n        {\n            var state = SelectedFilter == 0 ? \"open\" : \"closed\";\n            var request = this.GetApplication().Client.Users[Username].Repositories[Repository].PullRequests.GetAll(state: state);\n            return PullRequests.SimpleCollectionLoad(request);\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Repositories/RepositoriesViewModel.cs",
    "content": "using ReactiveUI;\nusing System.Reactive;\nusing CodeHub.Core.Services;\nusing Octokit;\nusing Splat;\nusing System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System.Linq;\n\nnamespace CodeHub.Core.ViewModels.Repositories\n{\n    public class RepositoriesViewModel : ReactiveObject\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IAlertDialogService _dialogService;\n        private readonly ReactiveList<Repository> _internalItems\n            = new ReactiveList<Repository>(resetChangeThreshold: double.MaxValue);\n\n        public ReactiveCommand<Unit, bool> LoadCommand { get; }\n\n        public ReactiveCommand<Unit, bool> LoadMoreCommand { get; }\n\n        public IReadOnlyReactiveList<RepositoryItemViewModel> Items { get; private set; }\n\n        public ReactiveCommand<RepositoryItemViewModel, RepositoryItemViewModel> RepositoryItemSelected { get; }\n        \n        private ObservableAsPropertyHelper<bool> _hasMore;\n        public bool HasMore => _hasMore.Value;\n\n        private Uri _nextPage;\n        private Uri NextPage\n        {\n            get { return _nextPage; }\n            set { this.RaiseAndSetIfChanged(ref _nextPage, value); }\n        }\n\n        private string _searchText;\n        public string SearchText\n        {\n            get { return _searchText; }\n            set { this.RaiseAndSetIfChanged(ref _searchText, value); }\n        }\n\n        private readonly ObservableAsPropertyHelper<bool> _isEmpty;\n        public bool IsEmpty => _isEmpty.Value;\n\n        public static RepositoriesViewModel CreateWatchedViewModel()\n            => new RepositoriesViewModel(ApiUrls.Watched());\n\n        public static RepositoriesViewModel CreateStarredViewModel()\n            => new RepositoriesViewModel(ApiUrls.Starred());\n\n        public static RepositoriesViewModel CreateForkedViewModel(string username, string repository)\n            => new RepositoriesViewModel(ApiUrls.RepositoryForks(username, repository));\n\n        public static RepositoriesViewModel CreateOrganizationViewModel(string org)\n            => new RepositoriesViewModel(ApiUrls.OrganizationRepositories(org));\n\n        public static RepositoriesViewModel CreateTeamViewModel(int id)\n            => new RepositoriesViewModel(ApiUrls.TeamRepositories(id));\n\n        public static RepositoriesViewModel CreateMineViewModel()\n            => new RepositoriesViewModel(ApiUrls.Repositories(), false, \"owner,collaborator\");\n\n        public static RepositoriesViewModel CreateUsersViewModel(string username)\n        {\n            var applicationService = Locator.Current.GetService<IApplicationService>();\n            var isCurrent = string.Equals(applicationService.Account.Username, username, StringComparison.OrdinalIgnoreCase);\n\n            return isCurrent\n                ? CreateMineViewModel()\n                : new RepositoriesViewModel(ApiUrls.Repositories(username));\n        }\n\n        public RepositoriesViewModel(\n            Uri repositoriesUri,\n            bool showOwner = true,\n            string affiliation = null,\n            IApplicationService applicationService = null,\n            IAlertDialogService dialogService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _dialogService = dialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            NextPage = repositoriesUri;\n\n            var showDescription = _applicationService.Account.ShowRepositoryDescriptionInList;\n\n            RepositoryItemSelected = ReactiveCommand.Create<RepositoryItemViewModel, RepositoryItemViewModel>(x => x);\n\n            var repositoryItems = _internalItems.CreateDerivedCollection(\n                x => new RepositoryItemViewModel(x, showOwner, showDescription, GoToRepository));\n\n            var searchUpdated = this.WhenAnyValue(x => x.SearchText)\n                .Throttle(TimeSpan.FromMilliseconds(400), RxApp.MainThreadScheduler);\n\n            Items = repositoryItems\n                .CreateDerivedCollection(\n                    x => x,\n                    x => x.Name.ContainsKeyword(SearchText),\n                    signalReset: searchUpdated);\n\n            LoadCommand = ReactiveCommand.CreateFromTask(async t =>\n            {\n                _internalItems.Clear();\n                var parameters = new Dictionary<string, string>\n                {\n                    [\"per_page\"] = 75.ToString()\n                };\n\n                if (affiliation != null)\n                {\n                    parameters[\"affiliation\"] = affiliation;\n                }\n\n                var items = await RetrieveRepositories(repositoriesUri, parameters);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            });\n\n            var canLoadMore = this.WhenAnyValue(x => x.NextPage).Select(x => x != null);\n            LoadMoreCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                var items = await RetrieveRepositories(NextPage);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            }, canLoadMore);\n\n            LoadCommand.Select(_ => _internalItems.Count == 0)\n                .ToProperty(this, x => x.IsEmpty, out _isEmpty, true);\n\n            LoadCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            LoadMoreCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            _hasMore = this.WhenAnyValue(x => x.NextPage)\n                .Select(x => x != null)\n                .ToProperty(this, x => x.HasMore);\n        }\n\n        private void LoadingError(Exception err)\n        {\n            var message = err.Message;\n            var baseException = err.GetInnerException();\n            if (baseException is System.Net.Sockets.SocketException)\n            {\n                message = \"Unable to communicate with GitHub. \" + baseException.Message;\n            }\n\n            _dialogService.Alert(\"Error Loading\", message).ToBackground();\n        }\n\n        private void GoToRepository(RepositoryItemViewModel item)\n        {\n            RepositoryItemSelected.ExecuteNow(item);\n        }\n\n        private async Task<IReadOnlyList<Repository>> RetrieveRepositories(\n            Uri repositoriesUri, IDictionary<string, string> parameters = null)\n        {\n            var connection = _applicationService.GitHubClient.Connection;\n            var ret = await connection.Get<IReadOnlyList<Repository>>(repositoriesUri, parameters, \"application/json\");\n            NextPage = ret.HttpResponse.ApiInfo.Links.ContainsKey(\"next\")\n                          ? ret.HttpResponse.ApiInfo.Links[\"next\"]\n                          : null;\n            return ret.Body;\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.Core/ViewModels/Repositories/RepositoryItemViewModel.cs",
    "content": "﻿using ReactiveUI;\nusing System;\nusing CodeHub.Core.Utilities;\nusing System.Diagnostics;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.Repositories\n{\n    [DebuggerDisplay(\"{Owner}/{Name}\")]\n    public class RepositoryItemViewModel : ReactiveObject, ICanGoToViewModel\n    {\n        public string Name => Repository.Name;\n\n        public string Owner => Repository.Owner?.Login ?? string.Empty;\n\n        public GitHubAvatar Avatar => new GitHubAvatar(Repository.Owner?.AvatarUrl);\n\n        public string Description { get; }\n\n        public string Stars => Repository.StargazersCount.ToString();\n\n        public string Forks => Repository.ForksCount.ToString();\n            \n        public bool ShowOwner { get; }\n\n        public Octokit.Repository Repository { get; }\n\n        public ReactiveCommand<Unit, Unit> GoToCommand { get; }\n\n        public RepositoryItemViewModel(Octokit.Repository repository, bool showOwner, bool showDescription, Action<RepositoryItemViewModel> gotoCommand)\n        {\n            if (showDescription)\n            {\n                if (!string.IsNullOrEmpty(repository.Description) && repository.Description.IndexOf(':') >= 0)\n                    Description = Emojis.FindAndReplace(repository.Description);\n                else\n                    Description = repository.Description;\n            }\n            else\n            {\n                Description = null;\n            }\n\n            Repository = repository;\n            ShowOwner = showOwner;\n            GoToCommand = ReactiveCommand.Create(() => gotoCommand?.Invoke(this));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Repositories/RepositoryViewModel.cs",
    "content": "using System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing MvvmCross.Core.ViewModels;\nusing GitHubSharp.Models;\nusing CodeHub.Core.ViewModels.User;\nusing CodeHub.Core.ViewModels.Events;\nusing CodeHub.Core.ViewModels.Changesets;\nusing System.Linq;\nusing System;\nusing CodeHub.Core.Services;\nusing Splat;\nusing CodeHub.Core.ViewModels.Source;\n\nnamespace CodeHub.Core.ViewModels.Repositories\n{\n    public class RepositoryViewModel : LoadableViewModel\n    {\n        private readonly IApplicationService _applicationService;\n        \n        public string Username { get; private set; }\n\n        public string RepositoryName { get; private set; }\n\n        public string ImageUrl { get; set; }\n\n        private bool? _starred;\n        public bool? IsStarred\n        {\n            get { return _starred; }\n            private set { this.RaiseAndSetIfChanged(ref _starred, value); }\n        }\n\n        private bool? _watched;\n        public bool? IsWatched\n        {\n            get { return _watched; }\n            private set { this.RaiseAndSetIfChanged(ref _watched, value); }\n        }\n\n        private Octokit.Repository _repository;\n        public Octokit.Repository Repository\n        {\n            get { return _repository; }\n            set { this.RaiseAndSetIfChanged(ref _repository, value); }\n        }\n\n        private Octokit.Readme _readme;\n        public Octokit.Readme Readme\n        {\n            get { return _readme; }\n            private set { this.RaiseAndSetIfChanged(ref _readme, value); }\n        }\n\n        private IReadOnlyList<Octokit.Branch> _branches;\n        public IReadOnlyList<Octokit.Branch> Branches\n        {\n            get { return _branches; }\n            private set { this.RaiseAndSetIfChanged(ref _branches, value); }\n        }\n\n        public RepositoryViewModel(IApplicationService applicationService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Title = RepositoryName = navObject.Repository;\n        }\n\n        public ICommand GoToEventsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<RepositoryEventsViewModel>(new RepositoryEventsViewModel.NavObject { Username = Username, Repository = RepositoryName })); }\n        }\n\n        public ICommand GoToIssuesCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<Issues.IssuesViewModel>(new Issues.IssuesViewModel.NavObject { Username = Username, Repository = RepositoryName })); }\n        }\n\n        public ICommand GoToPullRequestsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<PullRequests.PullRequestsViewModel>(new PullRequests.PullRequestsViewModel.NavObject { Username = Username, Repository = RepositoryName })); }\n        }\n\n        public ICommand GoToHtmlUrlCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<WebBrowserViewModel>(new WebBrowserViewModel.NavObject { Url = Repository.HtmlUrl }), () => Repository != null); }\n        }\n\n        public ICommand PinCommand\n        {\n            get { return new MvxCommand(PinRepository, () => Repository != null); }\n        }\n\n        private void PinRepository()\n        {\n            var repoOwner = Repository.Owner.Login;\n            var repoName = Repository.Name;\n            var account = this.GetApplication().Account;\n            var pinnedRepository = \n                account.PinnedRepositories\n                    .FirstOrDefault(x => string.Equals(repoName, x.Name, StringComparison.OrdinalIgnoreCase) &&\n                                         string.Equals(repoOwner, x.Owner, StringComparison.OrdinalIgnoreCase));\n\n            //Is it pinned already or not?\n            if (pinnedRepository == null)\n            {\n                account.PinnedRepositories.Add(new Data.PinnedRepository\n                {\n                    Name = repoName,\n                    Owner = repoOwner,\n                    ImageUri = ImageUrl,\n                    Slug = repoName\n                });\n\n                _applicationService.UpdateActiveAccount().ToBackground();\n                \n            }\n            else\n            {\n                account.PinnedRepositories.Remove(pinnedRepository);\n                _applicationService.UpdateActiveAccount().ToBackground();\n            }\n        }\n\n\n        protected override async Task Load()\n        {\n            _applicationService.GitHubClient.Repository.Content\n                 .GetReadme(Username, RepositoryName).ToBackground(x => Readme = x);\n\n            _applicationService.GitHubClient.Repository.Branch\n                 .GetAll(Username, RepositoryName).ToBackground(x => Branches = x);\n\n            _applicationService.GitHubClient.Activity.Starring\n                .CheckStarred(Username, RepositoryName).ToBackground(x => IsStarred = x);\n\n            _applicationService.GitHubClient.Activity.Watching\n                .CheckWatched(Username, RepositoryName).ToBackground(x => IsWatched = x);\n\n            var retrieveRepository = _applicationService.GitHubClient.Repository.Get(Username, RepositoryName);\n\n            if (Repository == null)\n                Repository = await retrieveRepository;\n            else\n                retrieveRepository.ToBackground(repo => Repository = repo);\n        }\n\n        public ICommand ToggleWatchCommand\n        {\n            get { return new MvxCommand(() => ToggleWatch(), () => IsWatched != null); }\n        }\n\n        private async Task ToggleWatch()\n        {\n            if (IsWatched == null)\n                return;\n\n            try\n            {\n                if (IsWatched.Value)\n                    await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[RepositoryName].StopWatching());\n                else\n                    await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[RepositoryName].Watch());\n                IsWatched = !IsWatched;\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to toggle repository as \" + (IsWatched.Value ? \"unwatched\" : \"watched\") + \"! Please try again.\");\n            }\n        }\n\n        public ICommand ToggleStarCommand\n        {\n            get { return new MvxCommand(() => ToggleStar(), () => IsStarred != null); }\n        }\n\n        public bool IsPinned\n        {\n            get \n            {\n                var repos = this.GetApplication().Account.PinnedRepositories;\n                return repos.Any(x => string.Equals(x.Owner, Username, StringComparison.OrdinalIgnoreCase) &&\n                                 string.Equals(x.Slug, RepositoryName, StringComparison.OrdinalIgnoreCase));\n            }\n        }\n\n        private async Task ToggleStar()\n        {\n            if (IsStarred == null)\n                return;\n\n            try\n            {\n                if (IsStarred.Value)\n                    await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[RepositoryName].Unstar());\n                else\n                    await this.GetApplication().Client.ExecuteAsync(this.GetApplication().Client.Users[Username].Repositories[RepositoryName].Star());\n                IsStarred = !IsStarred;\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to \" + (IsStarred.Value ? \"unstar\" : \"star\") + \" this repository! Please try again.\");\n            }\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Repositories/TrendingRepositoriesViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing System.Collections.Generic;\nusing CodeHub.Core.Data;\nusing ReactiveUI;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Linq;\nusing CodeHub.Core.Services;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.Repositories\n{\n    public class RepositoriesTrendingViewModel : ReactiveObject\n    {\n        private readonly Language _defaultLanguage = new Language(\"All Languages\", null);\n        private readonly ITrendingRepository _trendingRepository;\n        private readonly IAlertDialogService _dialogService;\n\n        private static readonly Tuple<string, string>[] Times = {\n            Tuple.Create(\"Daily\", \"daily\"),\n            Tuple.Create(\"Weekly\", \"weekly\"),\n            Tuple.Create(\"Monthly\", \"monthly\"),\n        };\n\n        private IList<Tuple<string, IList<RepositoryItemViewModel>>> _items;\n        public IList<Tuple<string, IList<RepositoryItemViewModel>>> Items\n        {\n            get { return _items ?? new List<Tuple<string, IList<RepositoryItemViewModel>>>(); }\n            private set { this.RaiseAndSetIfChanged(ref _items, value); }\n        }\n\n        private Language _selectedLanguage;\n        public Language SelectedLanguage\n        {\n            get { return _selectedLanguage; }\n            set { this.RaiseAndSetIfChanged(ref _selectedLanguage, value); }\n        }\n\n        public ReactiveCommand<Unit, Unit> LoadCommand { get; }\n\n        public ReactiveCommand<RepositoryItemViewModel, RepositoryItemViewModel> RepositoryItemSelected { get; }\n\n        public RepositoriesTrendingViewModel(\n            ITrendingRepository trendingRepository = null, \n            IAlertDialogService dialogService = null)\n        {\n            _trendingRepository = trendingRepository ?? new TrendingRepository();\n            _dialogService = dialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            RepositoryItemSelected = ReactiveCommand.Create<RepositoryItemViewModel, RepositoryItemViewModel>(x => x);\n\n            LoadCommand = ReactiveCommand.CreateFromTask(Load);\n            LoadCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            SelectedLanguage = _defaultLanguage;\n\n            this.WhenAnyValue(x => x.SelectedLanguage)\n                .Skip(1)\n                .Select(_ => Unit.Default)\n                .Do(_ => Items = null)\n                .InvokeReactiveCommand(LoadCommand);\n        }\n\n        private void LoadingError(Exception err)\n        {\n            var message = err.Message;\n            var baseException = err.GetInnerException();\n            if (baseException is System.Net.Sockets.SocketException)\n            {\n                message = \"Unable to communicate with GitHub. \" + baseException.Message;\n            }\n\n            _dialogService.Alert(\"Error Loading\", message).ToBackground();\n        }\n\n        private async Task Load()\n        {\n            var items = new List<Tuple<string, IList<RepositoryItemViewModel>>>();\n\n            foreach (var t in Times)\n            {\n                var repos = await _trendingRepository.GetTrendingRepositories(t.Item2, SelectedLanguage.Slug);\n                var viewModels = repos\n                    .Select(x => new RepositoryItemViewModel(x, true, true, vm => RepositoryItemSelected.ExecuteNow(vm)))\n                    .ToList();\n                \n                items.Add(Tuple.Create(t.Item1, viewModels as IList<RepositoryItemViewModel>));\n            }\n\n            Items = items;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Search/ExploreViewModel.cs",
    "content": "﻿using ReactiveUI;\n\nnamespace CodeHub.Core.ViewModels.Search\n{\n    public class ExploreViewModel : ReactiveObject\n    {\n        public RepositoryExploreViewModel Repositories { get; } = new RepositoryExploreViewModel();\n\n        public UserExploreViewModel Users { get; } = new UserExploreViewModel();\n\n        private SearchType _searchFilter = SearchType.Repositories;\n        public SearchType SearchFilter\n        {\n            get { return _searchFilter; }\n            set { this.RaiseAndSetIfChanged(ref _searchFilter, value); }\n        }\n  \n        public enum SearchType\n        {\n            Repositories = 0,\n            Users\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Search/RepositoryExploreViewModel.cs",
    "content": "using System;\nusing System.Reactive;\nusing CodeHub.Core.Services;\nusing ReactiveUI;\nusing Octokit;\nusing System.Reactive.Linq;\nusing Splat;\nusing CodeHub.Core.ViewModels.Repositories;\n\nnamespace CodeHub.Core.ViewModels.Search\n{\n    public class RepositoryExploreViewModel : ReactiveObject\n    {\n        private readonly IApplicationService _applicationService;\n\n        public ReactiveCommand<Unit, Unit> SearchCommand { get; }\n\n        public IReadOnlyReactiveList<RepositoryItemViewModel> Items { get; private set; }\n\n        public ReactiveCommand<RepositoryItemViewModel, RepositoryItemViewModel> RepositoryItemSelected { get; }\n\n        private string _searchText;\n        public string SearchText\n        {\n            get { return _searchText; }\n            set { this.RaiseAndSetIfChanged(ref _searchText, value); }\n        }\n\n        public RepositoryExploreViewModel(\n            IApplicationService applicationService = null,\n            IAlertDialogService dialogService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            dialogService = dialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            RepositoryItemSelected = ReactiveCommand.Create<RepositoryItemViewModel, RepositoryItemViewModel>(x => x);\n            var showDescription = _applicationService.Account.ShowRepositoryDescriptionInList;\n\n            var internalItems = new ReactiveList<Repository>(resetChangeThreshold: double.MaxValue);\n\n            Items = internalItems.CreateDerivedCollection(x =>\n                new RepositoryItemViewModel(x, true, showDescription, y => RepositoryItemSelected.ExecuteNow(y)));\n\n            var canSearch = this.WhenAnyValue(x => x.SearchText).Select(x => !string.IsNullOrEmpty(x));\n            SearchCommand = ReactiveCommand.CreateFromTask(async t =>\n            {\n                try\n                {\n                    internalItems.Clear();\n                    var request = new SearchRepositoriesRequest(SearchText);\n                    var response = await _applicationService.GitHubClient.Search.SearchRepo(request);\n                    internalItems.Reset(response.Items);\n                }\n                catch (Exception e)\n                {\n                    var msg = string.Format(\"Unable to search for {0}. Please try again.\", SearchText);\n                    throw new Exception(msg, e);\n                }\n            }, canSearch);\n\n            SearchCommand\n                .ThrownExceptions\n                .Subscribe(err => dialogService.Alert(\"Error Searching\", err.Message).ToBackground());\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Search/UserExploreViewModel.cs",
    "content": "﻿using System;\nusing CodeHub.Core.Services;\nusing ReactiveUI;\nusing Octokit;\nusing CodeHub.Core.ViewModels.Users;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing Humanizer;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.Search\n{\n    public class UserExploreViewModel : ReactiveObject\n    {\n        public ReactiveCommand<Unit, Unit> SearchCommand { get; }\n\n        public IReadOnlyReactiveList<UserItemViewModel> Items { get; private set; }\n\n        public ReactiveCommand<UserItemViewModel, UserItemViewModel> RepositoryItemSelected { get; }\n\n        private string _searchText;\n        public string SearchText\n        {\n            get { return _searchText; }\n            set { this.RaiseAndSetIfChanged(ref _searchText, value); }\n        }\n\n        public UserExploreViewModel(IApplicationService applicationService = null)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            \n            var items = new ReactiveList<Octokit.User>();\n            var itemSelected = ReactiveCommand.Create<UserItemViewModel, UserItemViewModel>(x => x);\n\n            Items = items.CreateDerivedCollection(\n                x => new UserItemViewModel(x, y => itemSelected.ExecuteNow(y)));\n\n            RepositoryItemSelected = itemSelected;\n\n            var canSearch = this.WhenAnyValue(x => x.SearchText).Select(x => !string.IsNullOrEmpty(x));\n            SearchCommand = ReactiveCommand.CreateFromTask(async t => {\n                try\n                {\n                    items.Clear();\n                    var request = new SearchUsersRequest(SearchText);\n                    var response = await applicationService.GitHubClient.Search.SearchUsers(request);\n                    items.Reset(response.Items);\n                }\n                catch (Exception e)\n                {\n                    var msg = string.Format(\"Unable to search for {0}. Please try again.\", SearchText.Humanize());\n                    throw new Exception(msg, e);\n                }\n            }, canSearch);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Source/EditSourceViewModel.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Messages;\nusing CodeHub.Core.Services;\nusing MvvmCross.Core.ViewModels;\n\nnamespace CodeHub.Core.ViewModels.Source\n{\n    public class EditSourceViewModel : LoadableViewModel\n    {\n        private readonly IMessageService _messageService;\n\n        private string _text;\n        public string Text\n        {\n            get { return _text; }\n            private set { this.RaiseAndSetIfChanged(ref _text, value); }\n        }\n\n        public string Username { get; private set; }\n\n        public string Repository { get; private set; }\n\n        public string Path { get; private set; }\n\n        public string BlobSha { get; private set; }\n\n        public string Branch { get; private set; }\n\n        public EditSourceViewModel(IMessageService messageService = null)\n        {\n            _messageService = messageService ?? GetService<IMessageService>();\n        }\n\n        public void Init(NavObject navObject)\n        {\n            Username = navObject.Username;\n            Repository = navObject.Repository;\n            Path = navObject.Path ?? string.Empty;\n            Branch = navObject.Branch ?? \"master\";\n\n            if (!Path.StartsWith(\"/\", StringComparison.Ordinal))\n                Path = \"/\" + Path;\n        }\n\n        protected override async Task Load()\n        {\n            var request = this.GetApplication().Client.Users[Username].Repositories[Repository].GetContentFile(Path, Branch);\n            var data = await this.GetApplication().Client.ExecuteAsync(request);\n            BlobSha = data.Data.Sha;\n            Text = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(data.Data.Content));\n        }\n\n        public async Task Commit(string data, string message)\n        {\n            var request = this.GetApplication().Client.Users[Username].Repositories[Repository].UpdateContentFile(Path, message, data, BlobSha, Branch);\n            var response = await this.GetApplication().Client.ExecuteAsync(request);\n            _messageService.Send(new SourceEditMessage { OldSha = BlobSha, Data = data, Update = response.Data });\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n            public string Repository { get; set; }\n            public string Path { get; set; }\n            public string Branch { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Users/UserItemViewModel.cs",
    "content": "﻿using ReactiveUI;\nusing System;\nusing CodeHub.Core.Utilities;\nusing System.Reactive;\n\nnamespace CodeHub.Core.ViewModels.Users\n{\n\tpublic class UserItemViewModel : ReactiveObject, ICanGoToViewModel\n\t{\n        public string Login => User.Login;\n\n        public string Name => User.Name;\n\n        public GitHubAvatar Avatar => new GitHubAvatar(User.AvatarUrl);\n\n        public ReactiveCommand<Unit, Unit> GoToCommand { get; }\n\n        public Octokit.User User { get; }\n\n\t\tinternal UserItemViewModel(Octokit.User user, Action<UserItemViewModel> gotoAction)\n\t\t{\n            User = user;\n\t\t\tGoToCommand = ReactiveCommand.Create(() => gotoAction?.Invoke(this));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Users/UserViewModel.cs",
    "content": "using System.Threading.Tasks;\nusing System.Windows.Input;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Events;\nusing CodeHub.Core.ViewModels.Organizations;\nusing MvvmCross.Core.ViewModels;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.User\n{\n    public class UserViewModel : LoadableViewModel\n    {\n        private readonly IApplicationService _applicationService = Locator.Current.GetService<IApplicationService>();\n\n        public string Username { get; private set; }\n\n        private Octokit.User _user;\n        public Octokit.User User\n        {\n            get { return _user; }\n            set { this.RaiseAndSetIfChanged(ref _user, value); }\n        }\n\n        private bool _isFollowing;\n        public bool IsFollowing\n        {\n            get { return _isFollowing; }\n            private set { this.RaiseAndSetIfChanged(ref _isFollowing, value); }\n        }\n\n        public bool IsLoggedInUser\n        {\n            get\n            {\n                return string.Equals(Username, this.GetApplication().Account.Username);\n            }\n        }\n\n        public ICommand GoToEventsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<UserEventsViewModel>(new UserEventsViewModel.NavObject { Username = Username })); }\n        }\n\n        public ICommand GoToOrganizationsCommand\n        {\n            get { return new MvxCommand(() => ShowViewModel<OrganizationsViewModel>(new OrganizationsViewModel.NavObject { Username = Username })); }\n        }\n\n        public ICommand ToggleFollowingCommand\n        {\n            get { return new MvxCommand(() => ToggleFollowing().ToBackground()); }\n        }\n\n        private async Task ToggleFollowing()\n        {\n            try\n            {\n                if (IsFollowing)\n                    await _applicationService.GitHubClient.User.Followers.Unfollow(Username);\n                else\n                    await _applicationService.GitHubClient.User.Followers.Follow(Username);\n                IsFollowing = !IsFollowing;\n            }\n            catch\n            {\n                DisplayAlert(\"Unable to follow user! Please try again.\");\n            }\n        }\n  \n        public void Init(NavObject navObject)\n        {\n            Title = Username = navObject.Username;\n        }\n\n        protected override async Task Load()\n        {\n            _applicationService.GitHubClient.User.Followers\n                .IsFollowingForCurrent(Username).ToBackground(x => IsFollowing = x);\n\n            if (User != null)\n                _applicationService.GitHubClient.User.Get(Username).ToBackground(x => User = x);\n            else\n                User = await _applicationService.GitHubClient.User.Get(Username);\n        }\n\n        public class NavObject\n        {\n            public string Username { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/Users/UsersViewModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing Octokit;\nusing ReactiveUI;\nusing Splat;\n\nnamespace CodeHub.Core.ViewModels.Users\n{\n    public class UsersViewModel : ReactiveObject\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IAlertDialogService _dialogService;\n        private readonly ReactiveList<Octokit.User> _internalItems\n            = new ReactiveList<Octokit.User>(resetChangeThreshold: double.MaxValue);\n\n        public ReactiveCommand<Unit, bool> LoadCommand { get; }\n\n        public ReactiveCommand<Unit, bool> LoadMoreCommand { get; }\n\n        public IReadOnlyReactiveList<UserItemViewModel> Items { get; private set; }\n\n        public ReactiveCommand<UserItemViewModel, UserItemViewModel> ItemSelected { get; }\n\n        private ObservableAsPropertyHelper<bool> _hasMore;\n        public bool HasMore => _hasMore.Value;\n\n        private Uri _nextPage;\n        private Uri NextPage\n        {\n            get { return _nextPage; }\n            set { this.RaiseAndSetIfChanged(ref _nextPage, value); }\n        }\n\n        private string _searchText;\n        public string SearchText\n        {\n            get { return _searchText; }\n            set { this.RaiseAndSetIfChanged(ref _searchText, value); }\n        }\n\n        private readonly ObservableAsPropertyHelper<bool> _isEmpty;\n        public bool IsEmpty => _isEmpty.Value;\n\n        public static UsersViewModel CreateWatchersViewModel(string owner, string name)\n            => new UsersViewModel(ApiUrls.Watchers(owner, name));\n\n        public static UsersViewModel CreateFollowersViewModel(string user)\n            => new UsersViewModel(ApiUrls.Followers(user));\n\n        public static UsersViewModel CreateFollowingViewModel(string user)\n            => new UsersViewModel(ApiUrls.Following(user));\n\n        public static UsersViewModel CreateTeamMembersViewModel(int id)\n            => new UsersViewModel(ApiUrls.TeamMembers(id));\n\n        public static UsersViewModel CreateOrgMembersViewModel(string org)\n            => new UsersViewModel(ApiUrls.Members(org));\n\n        public static UsersViewModel CreateStargazersViewModel(string owner, string name)\n            => new UsersViewModel(ApiUrls.Stargazers(owner, name));\n\n        public static UsersViewModel CreateCollaboratorsViewModel(string owner, string name)\n            => new UsersViewModel(ApiUrls.RepoCollaborators(owner, name));\n\n        public UsersViewModel(\n           Uri uri,\n           IApplicationService applicationService = null,\n           IAlertDialogService dialogService = null)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _dialogService = dialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            NextPage = uri;\n\n            var showDescription = _applicationService.Account.ShowRepositoryDescriptionInList;\n\n            ItemSelected = ReactiveCommand.Create<UserItemViewModel, UserItemViewModel>(x => x);\n\n            var userItems = _internalItems.CreateDerivedCollection(\n                x => new UserItemViewModel(x, GoToUser));\n\n            var searchUpdated = this.WhenAnyValue(x => x.SearchText)\n                .Throttle(TimeSpan.FromMilliseconds(400), RxApp.MainThreadScheduler);\n\n            Items = userItems\n                .CreateDerivedCollection(\n                    x => x,\n                    x => x.Login.ContainsKeyword(SearchText),\n                    signalReset: searchUpdated);\n\n            LoadCommand = ReactiveCommand.CreateFromTask(async t =>\n            {\n                _internalItems.Clear();\n                var parameters = new Dictionary<string, string>();\n                parameters[\"per_page\"] = 100.ToString();\n                var items = await RetrieveItems(uri, parameters);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            });\n\n            var canLoadMore = this.WhenAnyValue(x => x.NextPage).Select(x => x != null);\n            LoadMoreCommand = ReactiveCommand.CreateFromTask(async _ =>\n            {\n                var items = await RetrieveItems(NextPage);\n                _internalItems.AddRange(items);\n                return items.Count > 0;\n            }, canLoadMore);\n\n            LoadCommand.Select(_ => _internalItems.Count == 0)\n                .ToProperty(this, x => x.IsEmpty, out _isEmpty, true);\n\n            LoadCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            LoadMoreCommand.ThrownExceptions.Subscribe(LoadingError);\n\n            _hasMore = this.WhenAnyValue(x => x.NextPage)\n                .Select(x => x != null)\n                .ToProperty(this, x => x.HasMore);\n        }\n\n        private void LoadingError(Exception err)\n        {\n            _dialogService.Alert(\"Error Loading\", err.Message).ToBackground();\n        }\n\n        private void GoToUser(UserItemViewModel item)\n        {\n            ItemSelected.ExecuteNow(item);\n        }\n\n        private async Task<IReadOnlyList<Octokit.User>> RetrieveItems(\n            Uri repositoriesUri, IDictionary<string, string> parameters = null)\n        {\n            try\n            {\n                var connection = _applicationService.GitHubClient.Connection;\n                var ret = await connection.Get<IReadOnlyList<Octokit.User>>(repositoriesUri, parameters, \"application/json\");\n                NextPage = ret.HttpResponse.ApiInfo.Links.ContainsKey(\"next\")\n                              ? ret.HttpResponse.ApiInfo.Links[\"next\"]\n                              : null;\n                return ret.Body;\n            }\n            catch\n            {\n                NextPage = null;\n                throw;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.Core/ViewModels/ViewModelExtensions.cs",
    "content": "using System;\nusing System.Threading.Tasks;\nusing MvvmCross.Core.ViewModels;\nusing GitHubSharp;\nusing System.Collections.Generic;\nusing CodeHub.Core.Services;\nusing System.ComponentModel;\nusing System.Collections.Specialized;\nusing MvvmCross.Platform;\nusing System.Reactive.Linq;\nusing System.Reactive;\nusing System.Reactive.Disposables;\n\nnamespace CodeHub.Core.ViewModels\n{\n    public static class ViewModelExtensions\n    {\n        public static async Task RequestModel<TRequest>(this MvxViewModel viewModel, GitHubRequest<TRequest> request, Action<GitHubResponse<TRequest>> update) where TRequest : new()\n        {\n            var application = Mvx.Resolve<IApplicationService>();\n            var result = await application.Client.ExecuteAsync(request);\n            update(result);\n        }\n\n        public static void CreateMore<T>(this MvxViewModel viewModel, GitHubResponse<T> response, \n                                         Action<Action> assignMore, Action<T> newDataAction) where T : new()\n        {\n            if (response.More == null)\n            {\n                assignMore(null);\n                return;\n            }\n\n            Action task = () =>\n            {\n                var moreResponse = Mvx.Resolve<IApplicationService>().Client.ExecuteAsync(response.More).Result;\n                viewModel.CreateMore(moreResponse, assignMore, newDataAction);\n                newDataAction(moreResponse.Data);\n            };\n\n            assignMore(task);\n        }\n\n        public static Task SimpleCollectionLoad<T>(this CollectionViewModel<T> viewModel, GitHubRequest<List<T>> request) where T : new()\n        {\n            var weakVm = new WeakReference<CollectionViewModel<T>>(viewModel);\n            return viewModel.RequestModel(request, response =>\n            {\n                weakVm.Get()?.CreateMore(response, m => {\n                    var weak = weakVm.Get();\n                    if (weak != null)\n                        weak.MoreItems = m;\n                }, viewModel.Items.AddRange);\n                weakVm.Get()?.Items.Reset(response.Data);\n            });\n        }\n    }\n}\n\npublic static class BindExtensions\n{\n    public static IObservable<TR> Bind<T, TR>(this T viewModel, System.Linq.Expressions.Expression<Func<T, TR>> outExpr, bool activate = false) where T : INotifyPropertyChanged\n    {\n        var expr = (System.Linq.Expressions.MemberExpression) outExpr.Body;\n        var prop = (System.Reflection.PropertyInfo) expr.Member;\n        var name = prop.Name;\n        var comp = outExpr.Compile();\n\n        var ret = Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>(t => viewModel.PropertyChanged += t, t => viewModel.PropertyChanged -= t)\n            .Where(x => string.Equals(x.EventArgs.PropertyName, name))\n            .Select(x => comp(viewModel));\n\n        if (!activate)\n            return ret;\n\n        var o = Observable.Create<TR>(obs => {\n            try\n            {\n                obs.OnNext(comp(viewModel));\n            }\n            catch (Exception e)\n            {\n                obs.OnError(e);\n            }\n\n            obs.OnCompleted();\n\n            return Disposable.Empty;\n        });\n\n        return o.Concat(ret);\n    }\n\n    public static IObservable<Unit> BindCollection<T>(this T viewModel, System.Linq.Expressions.Expression<Func<T, INotifyCollectionChanged>> outExpr, bool activate = false) where T : INotifyPropertyChanged\n    {\n        var exp = outExpr.Compile();\n        var m = exp(viewModel);\n\n        var ret = Observable.FromEventPattern<NotifyCollectionChangedEventHandler, NotifyCollectionChangedEventArgs>(t => m.CollectionChanged += t, t => m.CollectionChanged -= t)\n            .Select(_ => Unit.Default);\n        return activate ? ret.StartWith(Unit.Default) : ret;\n    }\n}"
  },
  {
    "path": "CodeHub.Core/ViewModels/WebBrowserViewModel.cs",
    "content": "namespace CodeHub.Core.ViewModels\n{\n    public class WebBrowserViewModel : BaseViewModel\n    {\n        public string Url { get; private set; }\n\n        public void Init(NavObject navObject)\n        {\n            Url = navObject.Url;\n        }\n\n        public class NavObject\n        {\n            public string Url { get; set; }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.Core/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"akavache\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"akavache.core\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"akavache.sqlite3\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"GitHubClient\" version=\"1.0.15\" targetFramework=\"xamarinios10\" />\n  <package id=\"Humanizer.Core\" version=\"2.2.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.Bcl\" version=\"1.1.10\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.Bcl.Build\" version=\"1.0.21\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.CSharp\" version=\"4.4.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.Net.Http\" version=\"2.2.29\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.NETCore.Platforms\" version=\"2.0.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Binding\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Core\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Platform\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"NETStandard.Library\" version=\"2.0.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"Newtonsoft.Json\" version=\"10.0.3\" targetFramework=\"xamarinios10\" />\n  <package id=\"Octokit\" version=\"0.29.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"PCLStorage\" version=\"1.0.2\" targetFramework=\"xamarinios10\" />\n  <package id=\"Plugin.Permissions\" version=\"2.2.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"reactiveui\" version=\"7.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"reactiveui-core\" version=\"7.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Core\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Interfaces\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Linq\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Main\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-PlatformServices\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Splat\" version=\"1.6.2\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCL.raw_basic\" version=\"0.8.6\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.bundle_e_sqlite3\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.core\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.lib.e_sqlite3.ios_unified.static\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.provider.internal.ios_unified\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.ComponentModel.TypeConverter\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Runtime.Serialization.Formatters\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Runtime.Serialization.Primitives\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Xml.XmlDocument\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Xam.Plugin.Media\" version=\"3.1.3\" targetFramework=\"xamarinios10\" />\n  <package id=\"Xam.Plugins.Settings\" version=\"3.1.1\" targetFramework=\"xamarinios10\" />\n</packages>"
  },
  {
    "path": "CodeHub.iOS/AkavacheSqliteLinkerOverride.cs",
    "content": "using System;\nusing Akavache.Sqlite3;\n\n// Note: This class file is *required* for iOS to work correctly, and is \n// also a good idea for Android if you enable \"Link All Assemblies\".\nnamespace CodeHub.iOS\n{\n    [Preserve]\n    public static class LinkerPreserve\n    {\n        static LinkerPreserve()\n        {\n            throw new Exception(typeof(SQLitePersistentBlobCache).FullName);\n        }\n    }\n\n\n    public class PreserveAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/AppDelegate.cs",
    "content": "using System.Collections.Generic;\nusing System;\nusing MvvmCross.Core.ViewModels;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.Utils;\nusing CodeHub.Core.Services;\nusing System.Threading.Tasks;\nusing System.Linq;\nusing ObjCRuntime;\nusing MvvmCross.iOS.Platform;\nusing MvvmCross.Platform;\nusing MvvmCross.Core.Views;\nusing System.Net.Http;\nusing CodeHub.iOS.Services;\nusing ReactiveUI;\nusing CodeHub.Core.Messages;\nusing CodeHub.iOS.XCallback;\nusing System.Reactive.Linq;\nusing Splat;\nusing Microsoft.AppCenter;\nusing Microsoft.AppCenter.Analytics;\nusing Microsoft.AppCenter.Crashes;\n\nnamespace CodeHub.iOS\n{\n    [Register(\"AppDelegate\")]\n    public class AppDelegate : MvxApplicationDelegate\n    {\n        public string DeviceToken;\n\n        public override UIWindow Window { get; set; }\n\n        public IosViewPresenter Presenter { get; private set; }\n\n        public static AppDelegate Instance => UIApplication.SharedApplication.Delegate as AppDelegate;\n\n        /// <summary>\n        /// This is the main entry point of the application.\n        /// </summary>\n        /// <param name=\"args\">The args.</param>\n        public static void Main(string[] args)\n        {\n            UIApplication.Main(args, null, \"AppDelegate\");\n        }\n\n        /// <summary>\n        /// Finished the launching.\n        /// </summary>\n        /// <param name=\"app\">The app.</param>\n        /// <param name=\"options\">The options.</param>\n        /// <returns>True or false.</returns>\n        public override bool FinishedLaunching(UIApplication app, NSDictionary options)\n        {\n            AppCenter.Start(\"eef367be-437c-4c67-abe0-79779b3b8392\", typeof(Analytics), typeof(Crashes));\n\n            Window = new UIWindow(UIScreen.MainScreen.Bounds);\n            Presenter = new IosViewPresenter(this.Window);\n            var setup = new Setup(this, Presenter);\n            setup.Initialize();\n\n            var culture = new System.Globalization.CultureInfo(\"en\");\n            System.Threading.Thread.CurrentThread.CurrentCulture = culture;\n            System.Threading.Thread.CurrentThread.CurrentUICulture = culture;\n            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = culture;\n            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = culture;\n\n            // Setup theme\n            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, true);\n            Theme.Setup();\n\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IApplicationService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IAccountsService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IAlertDialogService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<INetworkActivityService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IMessageService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IInAppPurchaseService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IFeaturesService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<ILoginService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IMarkdownService>());\n            Locator.CurrentMutable.RegisterConstant(Mvx.Resolve<IPushNotificationsService>());\n\n            Locator.CurrentMutable.RegisterLazySingleton(\n                () => new ImgurService(), typeof(IImgurService));\n\n            var features = Mvx.Resolve<IFeaturesService>();\n            var purchaseService = Mvx.Resolve<IInAppPurchaseService>();\n\n            purchaseService.ThrownExceptions.Subscribe(ex =>\n            {\n                var error = new Core.UserError(\"Error Purchasing\", ex.Message);\n                Core.Interactions.Errors.Handle(error).Subscribe();\n            });\n\n            Core.Interactions.Errors.RegisterHandler(interaction =>\n            {\n                var error = interaction.Input;\n                AlertDialogService.ShowAlert(error.Title, error.Message);\n                interaction.SetOutput(System.Reactive.Unit.Default);\n            });\n\n#if DEBUG\n            features.ActivateProDirect();\n#endif \n\n            //options = new NSDictionary (UIApplication.LaunchOptionsRemoteNotificationKey, \n                //new NSDictionary (\"r\", \"octokit/octokit.net\", \"i\", \"739\", \"u\", \"thedillonb\"));\n\n            if (options != null)\n            {\n                if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) \n                {\n                    var remoteNotification = options[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary;\n                    if(remoteNotification != null) {\n                        HandleNotification(remoteNotification, true);\n                    }\n                }\n            }\n\n            // Set the client constructor\n            GitHubSharp.Client.ClientConstructor = () => new HttpClient(new CustomHttpMessageHandler());\n\n            if (!Core.Settings.HasSeenWelcome)\n            {\n                Core.Settings.HasSeenWelcome = true;\n                var welcomeViewController = new ViewControllers.Walkthrough.WelcomePageViewController();\n                welcomeViewController.WantsToDimiss += GoToStartupView;\n                TransitionToViewController(welcomeViewController);\n            }\n            else\n            {\n                GoToStartupView();\n            }\n\n            Window.MakeKeyAndVisible();\n\n            // Notifications don't work on teh simulator so don't bother\n            if (Runtime.Arch != Arch.SIMULATOR && features.IsProEnabled)\n                RegisterUserForNotifications();\n\n            return true;\n        }\n\n        public void RegisterUserForNotifications()\n        {\n            var notificationTypes = UIUserNotificationSettings.GetSettingsForTypes (UIUserNotificationType.Alert | UIUserNotificationType.Sound, null);\n            UIApplication.SharedApplication.RegisterUserNotificationSettings(notificationTypes);\n        }\n\n        private void GoToStartupView()\n        {\n            TransitionToViewController(new ViewControllers.Application.StartupViewController());\n\n            MessageBus\n                .Current.Listen<LogoutMessage>()\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Select(_ => new ViewControllers.Application.StartupViewController())\n                .Subscribe(TransitionToViewController);\n        }\n\n        public void TransitionToViewController(UIViewController viewController)\n        {\n            UIView.Transition(Window, 0.35, UIViewAnimationOptions.TransitionCrossDissolve, () => \n                Window.RootViewController = viewController, null);\n        }\n\n        class CustomHttpMessageHandler : DelegatingHandler\n        {\n            public CustomHttpMessageHandler()\n                : base(new HttpClientHandler())\n            {\n            }\n\n            protected override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)\n            {\n                if (!string.Equals(request.Method.ToString(), \"get\", StringComparison.OrdinalIgnoreCase))\n                    NSUrlCache.SharedCache.RemoveAllCachedResponses();\n                return base.SendAsync(request, cancellationToken);\n            }\n        }\n\n        public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)\n        {\n            if (application.ApplicationState == UIApplicationState.Active)\n                return;\n            HandleNotification(userInfo, false);\n        }\n\n        private void HandleNotification(NSDictionary data, bool fromBootup)\n        {\n            try\n            {\n                var viewDispatcher = Mvx.Resolve<IMvxViewDispatcher>();\n                var appService = Mvx.Resolve<IApplicationService>();\n                var accountsService = Mvx.Resolve<IAccountsService>();\n                var repoId = RepositoryIdentifier.FromFullName(data[\"r\"].ToString());\n                var parameters = new Dictionary<string, string>() {{\"Username\", repoId?.Owner}, {\"Repository\", repoId?.Name}};\n\n                MvxViewModelRequest request;\n                if (data.ContainsKey(new NSString(\"c\")))\n                {\n                    request = MvxViewModelRequest<CodeHub.Core.ViewModels.Changesets.ChangesetViewModel>.GetDefaultRequest();\n                    parameters.Add(\"Node\", data[\"c\"].ToString());\n                    parameters.Add(\"ShowRepository\", \"True\");\n                }\n                else if (data.ContainsKey(new NSString(\"i\")))\n                {\n                    request = MvxViewModelRequest<CodeHub.Core.ViewModels.Issues.IssueViewModel>.GetDefaultRequest();\n                    parameters.Add(\"Id\", data[\"i\"].ToString());\n                }\n                else if (data.ContainsKey(new NSString(\"p\")))\n                {\n                    request = MvxViewModelRequest<CodeHub.Core.ViewModels.PullRequests.PullRequestViewModel>.GetDefaultRequest();\n                    parameters.Add(\"Id\", data[\"p\"].ToString());\n                }\n                else\n                {\n                    request = MvxViewModelRequest<CodeHub.Core.ViewModels.Repositories.RepositoryViewModel>.GetDefaultRequest();\n                }\n\n                request.ParameterValues = parameters;\n                request.PresentationValues = new Dictionary<string, string>\n                {\n                    { Core.PresentationValues.SlideoutRootPresentation, string.Empty }\n                };\n\n                var username = data[\"u\"].ToString();\n\n                if (appService.Account == null || !appService.Account.Username.Equals(username))\n                {\n                    var accounts = accountsService.GetAccounts().Result.ToList();\n\n                    var user = accounts.FirstOrDefault(x => x.Username.Equals(username));\n                    if (user != null)\n                    {\n                        appService.DeactivateUser();\n                        accountsService.SetActiveAccount(user).Wait();\n                    }\n                }\n\n                appService.SetUserActivationAction(() => viewDispatcher.ShowViewModel(request));\n\n                if (appService.Account == null && !fromBootup)\n                {\n                    MessageBus.Current.SendMessage(new LogoutMessage());\n                }\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(\"Handle Notifications issue: \" + e);\n            }\n        }\n\n        public override void DidRegisterUserNotificationSettings (UIApplication application, UIUserNotificationSettings notificationSettings)\n        {\n            application.RegisterForRemoteNotifications ();\n        }\n\n        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)\n        {\n            DeviceToken = deviceToken.Description.Trim('<', '>').Replace(\" \", \"\");\n\n            var app = Mvx.Resolve<IApplicationService>();\n            var accounts = Mvx.Resolve<IAccountsService>();\n            if (app.Account != null && !app.Account.IsPushNotificationsEnabled.HasValue)\n            {\n                Mvx.Resolve<IPushNotificationsService>().Register().ToBackground();\n                app.Account.IsPushNotificationsEnabled = true;\n                accounts.Save(app.Account);\n            }\n        }\n\n        public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)\n        {\n            AlertDialogService.ShowAlert(\"Error Registering for Notifications\", error.LocalizedDescription);\n        }\n\n        public override bool OpenUrl(UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)\n        {\n            var uri = new Uri(url.AbsoluteString);\n\n            if (uri.Host == \"x-callback-url\")\n            {\n                XCallbackProvider.Handle(new XCallbackQuery(url.AbsoluteString));\n                return true;\n            }\n            else\n            {\n                var path = url.AbsoluteString.Replace(\"codehub://\", \"\");\n                var queryMarker = path.IndexOf(\"?\", StringComparison.Ordinal);\n                if (queryMarker > 0)\n                    path = path.Substring(0, queryMarker);\n\n                if (!path.EndsWith(\"/\", StringComparison.Ordinal))\n                    path += \"/\";\n//                var first = path.Substring(0, path.IndexOf(\"/\", StringComparison.Ordinal));\n                return UrlRouteProvider.Handle(path);\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/CodeHub.iOS.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">iPhoneSimulator</Platform>\r\n    <ProjectGuid>{B061316A-F386-4FE2-93B7-555584234FF8}</ProjectGuid>\r\n    <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r\n    <OutputType>Exe</OutputType>\r\n    <RootNamespace>CodeHub.iOS</RootNamespace>\r\n    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>\r\n    <AssemblyName>CodeHubiOS</AssemblyName>\r\n    <TargetFrameworkProfile />\r\n    <TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>\r\n    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\iPhoneSimulator\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <MtouchLink>SdkOnly</MtouchLink>\r\n    <MtouchDebug>true</MtouchDebug>\r\n    <MtouchArch>x86_64</MtouchArch>\r\n    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>\r\n    <CodesignKey>iPhone Developer</CodesignKey>\r\n    <MtouchProfiling>true</MtouchProfiling>\r\n    <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>\r\n    <MtouchTlsProvider>Default</MtouchTlsProvider>\r\n    <DeviceSpecificBuild>false</DeviceSpecificBuild>\r\n    <MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|iPhone' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\iPhone\\Debug</OutputPath>\r\n    <DefineConstants>DEBUG</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>false</ConsolePause>\r\n    <CodesignKey>iPhone Developer</CodesignKey>\r\n    <MtouchUseThumb>true</MtouchUseThumb>\r\n    <MtouchArch>ARM64</MtouchArch>\r\n    <MtouchDebug>true</MtouchDebug>\r\n    <BuildIpa>true</BuildIpa>\r\n    <IpaPackageName>\r\n    </IpaPackageName>\r\n    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>\r\n<CodesignProvision></CodesignProvision>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <OutputPath>bin\\iPhone\\Ad-Hoc</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>False</ConsolePause>\r\n    <CodesignKey>iPhone Distribution</CodesignKey>\r\n    <BuildIpa>True</BuildIpa>\r\n    <IpaPackageName>\r\n    </IpaPackageName>\r\n    <MtouchArch>ARMv7, ARM64</MtouchArch>\r\n    <CodesignProvision>Automatic:AdHoc</CodesignProvision>\r\n    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>\r\n    <MtouchExtraArgs>--linkskip=CodeHubiOS --linkskip=CodeHub.Core --linkskip=GitHubSharp</MtouchExtraArgs>\r\n    <MtouchLink>SdkOnly</MtouchLink>\r\n    <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>\r\n    <MtouchTlsProvider>Default</MtouchTlsProvider>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' \">\r\n    <DebugType>none</DebugType>\r\n    <Optimize>True</Optimize>\r\n    <OutputPath>bin\\iPhone\\AppStore</OutputPath>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n    <ConsolePause>False</ConsolePause>\r\n    <CodesignKey>iPhone Distribution: Dillon Buchanan (T39PW4C23Z)</CodesignKey>\r\n    <CodesignProvision></CodesignProvision>\r\n    <IpaPackageName>\r\n    </IpaPackageName>\r\n    <MtouchArch>ARMv7, ARM64</MtouchArch>\r\n    <BuildIpa>true</BuildIpa>\r\n    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>\r\n    <MtouchExtraArgs>--linkskip=CodeHubiOS --linkskip=CodeHub.Core --linkskip=GitHubSharp</MtouchExtraArgs>\r\n    <MtouchLink>SdkOnly</MtouchLink>\r\n    <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Images\\Images.cs\" />\r\n    <Compile Include=\"AppDelegate.cs\" />\r\n    <Compile Include=\"Services\\MarkdownService.cs\" />\r\n    <Compile Include=\"Setup.cs\" />\r\n    <Compile Include=\"Theme.cs\" />\r\n    <Compile Include=\"Views\\Issues\\BaseIssuesView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueEditView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueMilestonesView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssuesView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\MyIssuesView.cs\" />\r\n    <Compile Include=\"Views\\NotificationsView.cs\" />\r\n    <Compile Include=\"Views\\PullRequests\\PullRequestsView.cs\" />\r\n    <Compile Include=\"Views\\PullRequests\\PullRequestView.cs\" />\r\n    <Compile Include=\"Views\\Source\\ChangesetView.cs\" />\r\n    <None Include=\"Info.plist\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"Views\\Source\\ChangesetsView.cs\" />\r\n    <Compile Include=\"Views\\PullRequests\\PullRequestFilesView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueAddView.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueAssignedToView.cs\" />\r\n    <Compile Include=\"Views\\Source\\CommitsView.cs\" />\r\n    <Compile Include=\"Views\\PullRequests\\PullRequestCommitsView.cs\" />\r\n    <Compile Include=\"Services\\PushNotificationsService.cs\" />\r\n    <Compile Include=\"Views\\Source\\EditSourceView.cs\" />\r\n    <Compile Include=\"Services\\FeaturesService.cs\" />\r\n    <Compile Include=\"UrlRouterProvider.cs\" />\r\n    <None Include=\"Entitlements.plist\" />\r\n    <Compile Include=\"ViewControllers\\MarkdownComposerViewController.cs\" />\r\n    <None Include=\"packages.config\" />\r\n    <Compile Include=\"Services\\AlertDialogService.cs\" />\r\n    <Compile Include=\"ViewControllers\\Composer.cs\" />\r\n    <Compile Include=\"ViewControllers\\FilterViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\MultipleChoiceViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\ViewModelCollectionDrivenDialogViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\ViewModelDrivenDialogViewController.cs\" />\r\n    <Compile Include=\"Views\\AddRemoveView.cs\" />\r\n    <Compile Include=\"Views\\MenuSectionView.cs\" />\r\n    <Compile Include=\"Views\\MilestoneView.cs\" />\r\n    <Compile Include=\"Views\\ProgressBarView.cs\" />\r\n    <Compile Include=\"Views\\ScrollingToolbarView.cs\" />\r\n    <Compile Include=\"Views\\UILabelWithLinks.cs\" />\r\n    <Compile Include=\"XCallback\\XCallbackQuery.cs\" />\r\n    <Compile Include=\"TouchViewPresenter.cs\" />\r\n    <Compile Include=\"ViewControllers\\DialogViewController.cs\" />\r\n    <InterfaceDefinition Include=\"Launch.storyboard\" />\r\n    <Compile Include=\"Views\\ImageAndTitleHeaderView.cs\" />\r\n    <Compile Include=\"Views\\SlideUpTitleView.cs\" />\r\n    <Compile Include=\"Utilities\\Hud.cs\" />\r\n    <Compile Include=\"Utilities\\UIImageExtensions.cs\" />\r\n    <Compile Include=\"Utilities\\ViewControllerExtensions.cs\" />\r\n    <Compile Include=\"Utilities\\Graphics.cs\" />\r\n    <Compile Include=\"Utilities\\EasyLayout.cs\" />\r\n    <Compile Include=\"OcticonExtensions.cs\" />\r\n    <Compile Include=\"Views\\ProfileButton.cs\" />\r\n    <Compile Include=\"TableViewCells\\IssueCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\IssueCellView.designer.cs\">\r\n      <DependentUpon>IssueCellView.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"TableViewCells\\NewsCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\NewsCellView.designer.cs\">\r\n      <DependentUpon>NewsCellView.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"TableViewCells\\RepositoryCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\RepositoryCellView.designer.cs\">\r\n      <DependentUpon>RepositoryCellView.cs</DependentUpon>\r\n    </Compile>\r\n    <InterfaceDefinition Include=\"TableViewCells\\IssueCellView.xib\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\NewsCellView.xib\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\RepositoryCellView.xib\" />\r\n    <Compile Include=\"TableViewCells\\MilestoneTableViewCell.cs\" />\r\n    <Compile Include=\"TableViewCells\\GistCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\GistCellView.designer.cs\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\GistCellView.xib\" />\r\n    <Compile Include=\"Utilities\\UIImageViewExtensions.cs\" />\r\n    <Compile Include=\"TableViewCells\\PullRequestCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\PullRequestCellView.designer.cs\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\PullRequestCellView.xib\" />\r\n    <Compile Include=\"TableViewCells\\CommitCellView.cs\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\CommitCellView.xib\" />\r\n    <Compile Include=\"TableViewCells\\CommitCellView.designer.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\AboutViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\AboutViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\AboutViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\CardPageViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\CardPageViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\CardPageViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\FeedbackViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\FeedbackViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\FeedbackViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\GoProViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\GoProViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\GoProViewController.xib\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\PromoteViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\WelcomePageViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\WelcomeViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\WelcomeViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\WelcomeViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\BaseViewController.cs\" />\r\n    <Compile Include=\"Utilities\\UIKitExtensions.cs\" />\r\n    <Compile Include=\"ViewControllers\\ThemedNavigationController.cs\" />\r\n    <Compile Include=\"ViewControllers\\WebBrowserViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\PromoteViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\PromoteViewController.designer.cs\" />\r\n    <Compile Include=\"Services\\InAppPurchaseService.cs\" />\r\n    <Compile Include=\"Utilities\\UIWindowExtensions.cs\" />\r\n    <Compile Include=\"Utilities\\NetworkActivity.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Repositories\\PrivateRepositoryViewController.xib\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\PrivateRepositoryViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\PrivateRepositoryViewController.designer.cs\">\r\n      <DependentUpon>PrivateRepositoryViewController.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"ViewControllers\\TableViewController.cs\" />\r\n    <Compile Include=\"DialogElements\\Element.cs\" />\r\n    <Compile Include=\"DialogElements\\RootElement.cs\" />\r\n    <Compile Include=\"DialogElements\\Section.cs\" />\r\n    <Compile Include=\"DialogElements\\BooleanElement.cs\" />\r\n    <Compile Include=\"DialogElements\\StringElement.cs\" />\r\n    <Compile Include=\"DialogElements\\CommitElement.cs\" />\r\n    <Compile Include=\"DialogElements\\ChangesetElement.cs\" />\r\n    <Compile Include=\"DialogElements\\MilestoneElement.cs\" />\r\n    <Compile Include=\"DialogElements\\LabelElement.cs\" />\r\n    <Compile Include=\"DialogElements\\SplitButtonElement.cs\" />\r\n    <Compile Include=\"DialogElements\\PullRequestElement.cs\" />\r\n    <Compile Include=\"DialogElements\\SplitViewElement.cs\" />\r\n    <Compile Include=\"DialogElements\\CommentElement.cs\" />\r\n    <Compile Include=\"DialogElements\\IssueElement.cs\" />\r\n    <Compile Include=\"DialogElements\\UserElement.cs\" />\r\n    <Compile Include=\"DialogElements\\NewsFeedElement.cs\" />\r\n    <Compile Include=\"DialogElements\\EntryElement.cs\" />\r\n    <Compile Include=\"DialogElements\\IElementSizing.cs\" />\r\n    <Compile Include=\"DialogElements\\MultilinedElement.cs\" />\r\n    <Compile Include=\"DialogElements\\OwnerDrawnElement.cs\" />\r\n    <Compile Include=\"DialogElements\\LoadMoreElement.cs\" />\r\n    <Compile Include=\"DialogElements\\PaginateElement.cs\" />\r\n    <Compile Include=\"Transitions\\SlideDownTransition.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\LanguagesViewController.cs\" />\r\n    <Compile Include=\"Views\\TrendingTitleButton.cs\" />\r\n    <Compile Include=\"ViewControllers\\Accounts\\NewAccountViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\BaseWebViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Accounts\\OAuthLoginViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Accounts\\AccountsViewController.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Accounts\\AddAccountView.xib\" />\r\n    <Compile Include=\"ViewControllers\\Accounts\\AddAccountViewController.designer.cs\" />\r\n    <Compile Include=\"ViewControllers\\Accounts\\AddAccountViewController.cs\" />\r\n    <Compile Include=\"XCallback\\XCallbackProvider.cs\" />\r\n    <Compile Include=\"TableViewCells\\MultilinedCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\MultilinedCellView.designer.cs\" />\r\n    <InterfaceDefinition Include=\"TableViewCells\\MultilinedCellView.xib\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\OrgViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Walkthrough\\OrgViewController.designer.cs\" />\r\n    <InterfaceDefinition Include=\"ViewControllers\\Walkthrough\\OrgViewController.xib\" />\r\n    <Compile Include=\"LinkerPleaseInclude.cs\" />\r\n    <Compile Include=\"DialogElements\\HtmlElement.cs\" />\r\n    <Compile Include=\"Views\\BlurredAlertView.cs\" />\r\n    <Compile Include=\"Views\\EmptyListView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Organizations\\OrganizationsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Organizations\\OrganizationViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\MenuViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\StartupViewController.cs\" />\r\n    <Compile Include=\"Views\\LoadingIndicatorView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistFileViewController.cs\" />\r\n    <Compile Include=\"DialogElements\\MenuElement.cs\" />\r\n    <Compile Include=\"DialogElements\\ExpandingInputElement.cs\" />\r\n    <Compile Include=\"DialogElements\\DummyInputElement.cs\" />\r\n    <Compile Include=\"Views\\ExtendedUITextView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistFileModifyViewController.cs\" />\r\n    <None Include=\"WebResources\\highlight-LICENSE\" />\r\n    <Compile Include=\"ViewControllers\\Users\\UserViewController.cs\" />\r\n    <Compile Include=\"AkavacheSqliteLinkerOverride.cs\" />\r\n    <Compile Include=\"TableViewSources\\RepositoryTableViewSource.cs\" />\r\n    <Compile Include=\"TableViewSources\\ReactiveTableViewSource.cs\" />\r\n    <Compile Include=\"ViewControllers\\Search\\ExploreViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\RepositoryViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\RepositoriesViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\TrendingRepositoriesViewController.cs\" />\r\n    <Compile Include=\"Services\\NetworkActivityService.cs\" />\r\n    <Compile Include=\"TableViewSources\\UserTableViewSource.cs\" />\r\n    <Compile Include=\"TableViewCells\\UserTableViewCell.cs\" />\r\n    <Compile Include=\"ViewControllers\\Users\\UsersViewController.cs\" />\r\n    <Compile Include=\"TableViewSources\\GistTableViewSource.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistCreateViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Gists\\GistEditViewController.cs\" />\r\n    <Compile Include=\"TableViewSources\\DialogTableViewSource.cs\" />\r\n    <Compile Include=\"ViewControllers\\Events\\BaseEventsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Events\\NewsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Events\\OrganizationEventsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Events\\RepositoryEventsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Events\\UserEventsViewController.cs\" />\r\n    <Compile Include=\"Views\\Issues\\IssueLabelsView.cs\" />\r\n    <Compile Include=\"Views\\RetryListView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\SupportViewController.cs\" />\r\n    <Compile Include=\"TableViewCells\\FeedbackCellView.cs\" />\r\n    <Compile Include=\"TableViewCells\\FeedbackCellView.designer.cs\">\r\n      <DependentUpon>FeedbackCellView.cs</DependentUpon>\r\n    </Compile>\r\n    <InterfaceDefinition Include=\"TableViewCells\\FeedbackCellView.xib\" />\r\n    <Compile Include=\"TableViewSources\\FeedbackTableViewSource.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\FeedbackViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\EnterpriseSupportViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\BaseDialogViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Organizations\\TeamsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\FeedbackComposerViewController.cs\" />\r\n    <Compile Include=\"Views\\MarkdownAccessoryView.cs\" />\r\n    <Compile Include=\"Views\\ButtonAccessoryView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Search\\RepositoryExploreViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Search\\UserExploreViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\BranchesAndTagsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\BranchesViewController.cs\" />\r\n    <Compile Include=\"Views\\SourceTitleView.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\TagsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\SourceTreeViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\FileSourceViewController.cs\" />\r\n    <Compile Include=\"Utilities\\ShaType.cs\" />\r\n    <Compile Include=\"ViewControllers\\PullRequests\\PullRequestDiffViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\CommitDiffViewController.cs\" />\r\n    <None Include=\"WebResources\\highlight-line-numbers-LICENSE\" />\r\n    <Compile Include=\"ViewControllers\\Filters\\IssueMilestonesFilterViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Filters\\IssuesFilterViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Filters\\MyIssuesFilterViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Repositories\\ReadmeViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Settings\\SettingsViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Settings\\SyntaxHighlighterViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Settings\\DefaultStartupViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Application\\UpgradeViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\Source\\AddSourceViewController.cs\" />\r\n    <Compile Include=\"ViewControllers\\MessageComposerViewController.cs\" />\r\n    <Compile Include=\"Utilities\\ReactiveCommandExtensions.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"Xamarin.iOS\" />\r\n    <Reference Include=\"System.Web.Services\" />\r\n    <Reference Include=\"MonoTouch.Slideout\">\r\n      <HintPath>..\\packages\\MonoTouch.SlideoutNavigation.1.0.1\\lib\\Xamarin.iOS10\\MonoTouch.Slideout.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SDWebImage\">\r\n      <HintPath>..\\packages\\Xamarin.SDWebImage.3.7.5\\lib\\Xamarin.iOS\\SDWebImage.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.Interfaces\">\r\n      <HintPath>..\\packages\\Rx-Interfaces.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Interfaces.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.Core\">\r\n      <HintPath>..\\packages\\Rx-Core.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.Linq\">\r\n      <HintPath>..\\packages\\Rx-Linq.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.Linq.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Reactive.PlatformServices\">\r\n      <HintPath>..\\packages\\Rx-PlatformServices.2.2.5\\lib\\portable-windows8+net45+wp8\\System.Reactive.PlatformServices.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Splat\">\r\n      <HintPath>..\\packages\\Splat.1.6.2\\lib\\Xamarin.iOS10\\Splat.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"GitHubSharp\">\r\n      <HintPath>..\\packages\\GitHubClient.1.0.15\\lib\\portable45-net45+win8+wpa81\\GitHubSharp.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Xamarin.TTTAttributedLabel\">\r\n      <HintPath>lib\\Xamarin.TTTAttributedLabel.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"PCLStorage\">\r\n      <HintPath>..\\packages\\PCLStorage.1.0.2\\lib\\portable-Xamarin.iOS+Xamarin.Mac\\PCLStorage.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"PCLStorage.Abstractions\">\r\n      <HintPath>..\\packages\\PCLStorage.1.0.2\\lib\\portable-Xamarin.iOS+Xamarin.Mac\\PCLStorage.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Akavache\">\r\n      <HintPath>..\\packages\\akavache.core.5.0.0\\lib\\Xamarin.iOS10\\Akavache.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Akavache.Sqlite3\">\r\n      <HintPath>..\\packages\\akavache.sqlite3.5.0.0\\lib\\Portable-Net45+Win8+WP8+Wpa81\\Akavache.Sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Platform\">\r\n      <HintPath>..\\packages\\MvvmCross.Platform.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Platform.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Platform.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Platform.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Platform.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Core\">\r\n      <HintPath>..\\packages\\MvvmCross.Core.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Core.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Binding\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Binding.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Binding.iOS\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Binding.iOS.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"MvvmCross.Localization\">\r\n      <HintPath>..\\packages\\MvvmCross.Binding.4.4.0\\lib\\Xamarin.iOS10\\MvvmCross.Localization.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Humanizer\">\r\n      <HintPath>..\\packages\\Humanizer.Core.2.2.0\\lib\\netstandard1.0\\Humanizer.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"ReactiveUI\">\r\n      <HintPath>..\\packages\\reactiveui-core.7.4.0\\lib\\Xamarin.iOS10\\ReactiveUI.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.CSharp\" />\r\n    <Reference Include=\"Newtonsoft.Json\">\r\n      <HintPath>..\\packages\\Newtonsoft.Json.10.0.3\\lib\\netstandard1.3\\Newtonsoft.Json.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"BTProgressHUD\">\r\n      <HintPath>..\\packages\\BTProgressHUD.1.2.0.6\\lib\\Xamarin.iOS10\\BTProgressHUD.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.core\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.core.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.core.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.lib.e_sqlite3\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.lib.e_sqlite3.ios_unified.static.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.lib.e_sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.provider.internal\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.provider.internal.ios_unified.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.provider.internal.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.batteries_e_sqlite3\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.bundle_e_sqlite3.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.batteries_e_sqlite3.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"SQLitePCLRaw.batteries_v2\">\r\n      <HintPath>..\\packages\\SQLitePCLRaw.bundle_e_sqlite3.1.1.9\\lib\\Xamarin.iOS10\\SQLitePCLRaw.batteries_v2.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Settings.Abstractions\">\r\n      <HintPath>..\\packages\\Xam.Plugins.Settings.3.1.1\\lib\\Xamarin.iOS10\\Plugin.Settings.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Settings\">\r\n      <HintPath>..\\packages\\Xam.Plugins.Settings.3.1.1\\lib\\Xamarin.iOS10\\Plugin.Settings.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"System.Net.Http\" />\r\n    <Reference Include=\"Octokit\">\r\n      <HintPath>..\\packages\\Octokit.0.29.0\\lib\\netstandard1.1\\Octokit.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter.iOS.Bindings\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.iOS.Bindings.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter.Analytics\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.Analytics.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.Analytics.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter.Analytics.iOS.Bindings\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.Analytics.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.Analytics.iOS.Bindings.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter.Crashes\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.Crashes.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.Crashes.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Microsoft.AppCenter.Crashes.iOS.Bindings\">\r\n      <HintPath>..\\packages\\Microsoft.AppCenter.Crashes.1.5.0\\lib\\Xamarin.iOS10\\Microsoft.AppCenter.Crashes.iOS.Bindings.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Permissions.Abstractions\">\r\n      <HintPath>..\\packages\\Plugin.Permissions.2.2.1\\lib\\Xamarin.iOS10\\Plugin.Permissions.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Permissions\">\r\n      <HintPath>..\\packages\\Plugin.Permissions.2.2.1\\lib\\Xamarin.iOS10\\Plugin.Permissions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Media.Abstractions\">\r\n      <HintPath>..\\packages\\Xam.Plugin.Media.3.1.3\\lib\\Xamarin.iOS10\\Plugin.Media.Abstractions.dll</HintPath>\r\n    </Reference>\r\n    <Reference Include=\"Plugin.Media\">\r\n      <HintPath>..\\packages\\Xam.Plugin.Media.3.1.3\\lib\\Xamarin.iOS10\\Plugin.Media.dll</HintPath>\r\n    </Reference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Content Include=\"Images\\Buttons\\black_button%402x.png\" />\r\n    <Content Include=\"Images\\Buttons\\black_button.png\" />\r\n    <BundleResource Include=\"Resources\\iTunesArtwork.png\" />\r\n    <BundleResource Include=\"Resources\\iTunesArtwork%402x.png\" />\r\n    <BundleResource Include=\"Images\\Web\\back.png\" />\r\n    <BundleResource Include=\"Images\\Web\\back%402x.png\" />\r\n    <BundleResource Include=\"Images\\Web\\forward.png\" />\r\n    <BundleResource Include=\"Images\\Web\\forward%402x.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\back%402x.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\back.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\three_lines.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\three_lines%402x.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\sort%402x.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\sort.png\" />\r\n    <BundleResource Include=\"Images\\Logos\\dotcom-mascot.png\" />\r\n    <BundleResource Include=\"Images\\Logos\\enterprise-mascot.png\" />\r\n    <BundleResource Include=\"Images\\down_chevron.png\" />\r\n    <BundleResource Include=\"Images\\down_chevron%402x.png\" />\r\n    <Content Include=\"WebResources\\marked.js\" />\r\n    <BundleResource Include=\"Images\\Buttons\\check%402x.png\" />\r\n    <BundleResource Include=\"Images\\Buttons\\check.png\" />\r\n    <Content Include=\"WebResources\\highlight.pack.js\" />\r\n    <BundleResource Include=\"..\\CodeHub\\Resources\\octicons.ttf\">\r\n      <Link>Resources\\octicons.ttf</Link>\r\n    </BundleResource>\r\n    <BundleResource Include=\"Resources\\Briefcase.png\" />\r\n    <BundleResource Include=\"Resources\\Feedback.png\" />\r\n    <BundleResource Include=\"Resources\\Heart.png\" />\r\n    <BundleResource Include=\"Resources\\Organizations.png\" />\r\n    <BundleResource Include=\"Resources\\Rocket.png\" />\r\n    <BundleResource Include=\"Resources\\CodeHubRound.png\" />\r\n    <BundleResource Include=\"Resources\\CodeHubLaunch.png\" />\r\n    <Content Include=\"WebResources\\styles\\agate.css\" />\r\n    <Content Include=\"WebResources\\styles\\androidstudio.css\" />\r\n    <Content Include=\"WebResources\\styles\\arduino-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\arta.css\" />\r\n    <Content Include=\"WebResources\\styles\\ascetic.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-cave-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-cave-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-dune-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-dune-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-estuary-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-estuary-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-forest-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-forest-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-heath-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-heath-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-lakeside-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-lakeside-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-plateau-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-plateau-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-savanna-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-savanna-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-seaside-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-seaside-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-sulphurpool-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atelier-sulphurpool-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\atom-one-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\atom-one-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\brown-paper.css\" />\r\n    <Content Include=\"WebResources\\styles\\brown-papersq.png\" />\r\n    <Content Include=\"WebResources\\styles\\codepen-embed.css\" />\r\n    <Content Include=\"WebResources\\styles\\color-brewer.css\" />\r\n    <Content Include=\"WebResources\\styles\\darcula.css\" />\r\n    <Content Include=\"WebResources\\styles\\dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\darkula.css\" />\r\n    <Content Include=\"WebResources\\styles\\default.css\" />\r\n    <Content Include=\"WebResources\\styles\\docco.css\" />\r\n    <Content Include=\"WebResources\\styles\\dracula.css\" />\r\n    <Content Include=\"WebResources\\styles\\far.css\" />\r\n    <Content Include=\"WebResources\\styles\\foundation.css\" />\r\n    <Content Include=\"WebResources\\styles\\github-gist.css\" />\r\n    <Content Include=\"WebResources\\styles\\github.css\" />\r\n    <Content Include=\"WebResources\\styles\\googlecode.css\" />\r\n    <Content Include=\"WebResources\\styles\\grayscale.css\" />\r\n    <Content Include=\"WebResources\\styles\\gruvbox-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\gruvbox-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\hopscotch.css\" />\r\n    <Content Include=\"WebResources\\styles\\hybrid.css\" />\r\n    <Content Include=\"WebResources\\styles\\idea.css\" />\r\n    <Content Include=\"WebResources\\styles\\ir-black.css\" />\r\n    <Content Include=\"WebResources\\styles\\kimbie.dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\kimbie.light.css\" />\r\n    <Content Include=\"WebResources\\styles\\magula.css\" />\r\n    <Content Include=\"WebResources\\styles\\mono-blue.css\" />\r\n    <Content Include=\"WebResources\\styles\\monokai-sublime.css\" />\r\n    <Content Include=\"WebResources\\styles\\monokai.css\" />\r\n    <Content Include=\"WebResources\\styles\\obsidian.css\" />\r\n    <Content Include=\"WebResources\\styles\\ocean.css\" />\r\n    <Content Include=\"WebResources\\styles\\paraiso-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\paraiso-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\pojoaque.css\" />\r\n    <Content Include=\"WebResources\\styles\\pojoaque.jpg\" />\r\n    <Content Include=\"WebResources\\styles\\purebasic.css\" />\r\n    <Content Include=\"WebResources\\styles\\qtcreator_dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\qtcreator_light.css\" />\r\n    <Content Include=\"WebResources\\styles\\railscasts.css\" />\r\n    <Content Include=\"WebResources\\styles\\rainbow.css\" />\r\n    <Content Include=\"WebResources\\styles\\routeros.css\" />\r\n    <Content Include=\"WebResources\\styles\\school-book.css\" />\r\n    <Content Include=\"WebResources\\styles\\school-book.png\" />\r\n    <Content Include=\"WebResources\\styles\\solarized-dark.css\" />\r\n    <Content Include=\"WebResources\\styles\\solarized-light.css\" />\r\n    <Content Include=\"WebResources\\styles\\sunburst.css\" />\r\n    <Content Include=\"WebResources\\styles\\tomorrow-night-blue.css\" />\r\n    <Content Include=\"WebResources\\styles\\tomorrow-night-bright.css\" />\r\n    <Content Include=\"WebResources\\styles\\tomorrow-night-eighties.css\" />\r\n    <Content Include=\"WebResources\\styles\\tomorrow-night.css\" />\r\n    <Content Include=\"WebResources\\styles\\tomorrow.css\" />\r\n    <Content Include=\"WebResources\\styles\\vs.css\" />\r\n    <Content Include=\"WebResources\\styles\\vs2015.css\" />\r\n    <Content Include=\"WebResources\\styles\\xcode.css\" />\r\n    <Content Include=\"WebResources\\styles\\xt256.css\" />\r\n    <Content Include=\"WebResources\\styles\\zenburn.css\" />\r\n    <Content Include=\"WebResources\\highlight-line-numbers.min.js\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ITunesArtwork Include=\"iTunesArtwork\" />\r\n    <ITunesArtwork Include=\"iTunesArtwork%402x\" />\r\n  </ItemGroup>\r\n  <ItemGroup />\r\n  <ItemGroup>\r\n    <Folder Include=\"ViewControllers\\\" />\r\n    <Folder Include=\"Images\\Logos\\\" />\r\n    <Folder Include=\"WebResources\\\" />\r\n    <Folder Include=\"ViewControllers\\Application\\\" />\r\n    <Folder Include=\"ViewControllers\\Repositories\\\" />\r\n    <Folder Include=\"DialogElements\\\" />\r\n    <Folder Include=\"Transitions\\\" />\r\n    <Folder Include=\"ViewControllers\\Accounts\\\" />\r\n    <Folder Include=\"ViewControllers\\Users\\\" />\r\n    <Folder Include=\"ViewControllers\\Organizations\\\" />\r\n    <Folder Include=\"ViewControllers\\Gists\\\" />\r\n    <Folder Include=\"TableViewSources\\\" />\r\n    <Folder Include=\"ViewControllers\\Search\\\" />\r\n    <Folder Include=\"ViewControllers\\Events\\\" />\r\n    <Folder Include=\"Resources\\Images.xcassets\\UnknownUser.imageset\\\" />\r\n    <Folder Include=\"Resources\\Images.xcassets\\Avatar.imageset\\\" />\r\n    <Folder Include=\"ViewControllers\\Source\\\" />\r\n    <Folder Include=\"ViewControllers\\PullRequests\\\" />\r\n    <Folder Include=\"WebResources\\styles\\\" />\r\n    <Folder Include=\"ViewControllers\\Filters\\\" />\r\n    <Folder Include=\"ViewControllers\\Settings\\\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.CSharp.targets\" />\r\n  <ItemGroup>\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Contents.json\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-60%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-72.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-72%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-76.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-76%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small-50.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small-50%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small-40.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small-40%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small%403x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-Small-40%403x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-60%403x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\Icon-167.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\UnknownUser.imageset\\Contents.json\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\UnknownUser.imageset\\login_user_unknown.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\UnknownUser.imageset\\login_user_unknown%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\Avatar.imageset\\avatar.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\Avatar.imageset\\avatar%402x.png\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\Avatar.imageset\\Contents.json\" />\r\n    <ImageAsset Include=\"Resources\\Images.xcassets\\AppIcons.appiconset\\appstore.png\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"..\\CodeHub.Core\\CodeHub.Core.csproj\">\r\n      <Project>{B7970173-9022-466B-B57A-7AB1E1F3145F}</Project>\r\n      <Name>CodeHub.Core</Name>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"..\\CodeHub\\CodeHub.csproj\">\r\n      <Project>{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}</Project>\r\n      <Name>CodeHub</Name>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <EmbeddedResource Include=\"ViewControllers\\Settings\\SyntaxHighlightExample\" />\r\n  </ItemGroup>\r\n  <Import Project=\"..\\packages\\SQLitePCL.raw_basic.0.8.6\\build\\Xamarin.iOS10\\SQLitePCL.raw_basic.targets\" Condition=\"Exists('..\\packages\\SQLitePCL.raw_basic.0.8.6\\build\\Xamarin.iOS10\\SQLitePCL.raw_basic.targets')\" />\r\n  <Import Project=\"..\\packages\\Microsoft.Bcl.Build.1.0.21\\build\\Microsoft.Bcl.Build.targets\" Condition=\"Exists('..\\packages\\Microsoft.Bcl.Build.1.0.21\\build\\Microsoft.Bcl.Build.targets')\" />\r\n  <Import Project=\"..\\packages\\NETStandard.Library.2.0.1\\build\\netstandard2.0\\NETStandard.Library.targets\" Condition=\"Exists('..\\packages\\NETStandard.Library.2.0.1\\build\\netstandard2.0\\NETStandard.Library.targets')\" />\r\n</Project>\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/BooleanElement.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive.Subjects;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class BooleanElement : Element \n    {\n        private readonly Subject<bool> _changedSubject = new Subject<bool>();\n        private bool _value;\n\n        public IObservable<bool> Changed\n        {\n            get { return _changedSubject.AsObservable(); }\n        }\n\n        private string _caption;\n        public string Caption\n        {\n            get { return _caption; }\n            set\n            {\n                if (_caption == value)\n                    return;\n\n                _caption = value;\n                var cell = GetActiveCell();\n                if (cell != null && cell.TextLabel != null)\n                    cell.TextLabel.Text = value ?? string.Empty;\n            }\n        }\n\n        public bool Value \n        {\n            get \n            {\n                return _value;\n            }\n            set \n            {\n                if (_value == value)\n                    return;\n                \n                _value = value;\n                _changedSubject.OnNext(value);\n                var cell = GetActiveCell() as BooleanCellView;\n                if (cell != null)\n                    cell.Switch.On = value;\n            }\n        }\n\n        public BooleanElement (string caption, bool value = false) \n        {  \n            Caption = caption;\n            _value = value;\n        }\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(\"boolean_element\") as BooleanCellView ?? new BooleanCellView();\n            cell.Switch.On = Value;\n            cell.BackgroundColor = StringElement.BgColor;\n            cell.TextLabel.Font = UIFont.PreferredBody;\n            cell.TextLabel.TextColor = StringElement.DefaultTitleColor;\n            cell.TextLabel.Text = Caption;\n\n            var weakThis = new WeakReference<BooleanElement>(this);\n            cell.Switch.ValueChanged += UpdateValueChanged(weakThis);\n\n            return cell;\n        }\n\n        private static EventHandler UpdateValueChanged(WeakReference<BooleanElement> weakThis)\n        {\n            return new EventHandler((s, _) => {\n                BooleanElement parent;\n                if (weakThis.TryGetTarget(out parent))\n                    parent.Value = ((UISwitch)s).On;\n            });\n        }\n\n        private class BooleanCellView : UITableViewCell\n        {\n            public UISwitch Switch { get; }\n\n            public BooleanCellView()\n                : base(UITableViewCellStyle.Default, \"boolean_element\")\n            {\n                Switch = new UISwitch();\n                Switch.BackgroundColor = UIColor.Clear;\n                SelectionStyle = UITableViewCellSelectionStyle.None;\n            }\n\n            public override void WillMoveToSuperview(UIView newsuper)\n            {\n                base.WillMoveToSuperview(newsuper);\n                AccessoryView = newsuper == null ? null : Switch;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/ChangesetElement.cs",
    "content": "using CodeHub.iOS.Views;\r\n\r\nnamespace CodeHub.iOS.DialogElements\n{\n    public class ChangesetElement : StringElement\n    {\n        private readonly int? _added;\n        private readonly int? _removed;\n\n        public ChangesetElement(string title, string subtitle, int? added, int? removed)\n            : base(title, subtitle, UIKit.UITableViewCellStyle.Subtitle)\n        {\n            Accessory = UIKit.UITableViewCellAccessory.DisclosureIndicator;\n            LineBreakMode = UIKit.UILineBreakMode.TailTruncation;\n            Lines = 1;\n            _added = added;\n            _removed = removed;\n        }\n\n        protected override string GetKey(int style)\n        {\n            return \"changeset\";\n        }\n\n        protected override UIKit.UITableViewCell CreateTableViewCell(UIKit.UITableViewCellStyle style, string key)\n        {\n            return new ChangesetCell(key);\n        }\n\n        public override UIKit.UITableViewCell GetCell(UIKit.UITableView tv)\n        {\n            var cell = base.GetCell(tv);\n            var addRemove = ((ChangesetCell)cell).AddRemoveView;\n            addRemove.Added = _added;\n            addRemove.Removed = _removed;\n            addRemove.SetNeedsDisplay();\n            return cell;\n        }\n\n        /// Bastardized version. I'll redo this code later...\n        private sealed class ChangesetCell : UIKit.UITableViewCell\n        {\n            public AddRemoveView AddRemoveView { get; private set; }\n\n            public ChangesetCell(string key)\n                : base(UIKit.UITableViewCellStyle.Subtitle, key)\n            {\n                AddRemoveView = new AddRemoveView();\n                ContentView.AddSubview(AddRemoveView);\n                TextLabel.LineBreakMode = UIKit.UILineBreakMode.TailTruncation;\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n                var addRemoveX = ContentView.Frame.Width - 90f;\r\n                var addRemoveY = (ContentView.Frame.Height / 2) - 9f;\n                AddRemoveView.Frame = new CoreGraphics.CGRect(addRemoveX, addRemoveY, 80f, 18f);\n\n                var textFrame = TextLabel.Frame;\n                textFrame.Width = addRemoveX - textFrame.X - 5f;\n                TextLabel.Frame = textFrame;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/CommentElement.cs",
    "content": "using UIKit;\r\nusing CodeHub.iOS.TableViewCells;\r\nusing System;\r\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class CommentElement : Element\r\n    {   \r\n        private readonly string _title, _message, _avatar;\r\n        private readonly DateTimeOffset _date;\r\n\r\n        public CommentElement(string title, string message, DateTimeOffset date, string avatar)\r\n        {\r\n            _title = title;\r\n            _message = message;\r\n            _date = date;\r\n            _avatar = avatar;\r\n        }\r\n\r\n        public override UITableViewCell GetCell (UITableView tv)\r\n        {\r\n            var c = tv.DequeueReusableCell(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();\r\n            c.Set(_title, _message, _date, new GitHubAvatar(_avatar));\r\n            return c;\r\n        }\r\n\r\n        public override bool Matches(string text)\r\n        {\r\n            return _message?.ToLower().Contains(text.ToLower()) ?? false;\r\n        }\r\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/CommitElement.cs",
    "content": "﻿using System;\nusing GitHubSharp.Models;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.Utilities;\nusing CodeHub.iOS.TableViewCells;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class CommitElement : Element\n    {   \n        private readonly Action _action;    \n        private readonly CommitModel _model;\n        private readonly GitHubAvatar _avatar;\n        private readonly string _name;\n        private readonly string _description;\n\n        public CommitElement(CommitModel model, Action action)\n        {\n            _model = model;\n            _action = action;\n            _avatar = new GitHubAvatar(_model.GenerateGravatarUrl());\n            _name = _model.GenerateCommiterName();\n\n            var msg = _model?.Commit?.Message ?? string.Empty;\n            var firstLine = msg.IndexOf(\"\\n\", StringComparison.Ordinal);\n            _description = firstLine > 0 ? msg.Substring(0, firstLine) : msg;\n        }\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var c = tv.DequeueReusableCell(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();\n            var time = DateTimeOffset.MinValue;\n            if (_model.Commit.Committer != null)\n                time = _model.Commit.Committer.Date;\n            c.Set(_name, _description, time, _avatar);\n            return c;\n        }\n\n        public override bool Matches(string text)\n        {\n            return _model?.Commit?.Message?.ToLower().Contains(text.ToLower()) ?? false;\n        }\n\n        public override void Selected(UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            _action?.Invoke();\n        }\n    }\n}\n\n\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/DummyInputElement.cs",
    "content": "using UIKit;\nusing CoreGraphics;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    class DummyInputElement : EntryElement\n    {\n        public bool SpellChecking { get; set; }\n\n        public DummyInputElement(string name)\n            : base(name, name, string.Empty)\n        {\n            SpellChecking = true;\n        }\n\n        protected override UITextField CreateTextField(CGRect frame)\n        {\n            var txt = base.CreateTextField(frame);\n            txt.AutocorrectionType = SpellChecking ? UITextAutocorrectionType.Default : UITextAutocorrectionType.No;\n            txt.SpellCheckingType = SpellChecking ? UITextSpellCheckingType.Default : UITextSpellCheckingType.No;\n            txt.AutocapitalizationType = SpellChecking ? txt.AutocapitalizationType : UITextAutocapitalizationType.None;\n            return txt;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/Element.cs",
    "content": "﻿using System;\r\nusing Foundation;\r\nusing UIKit;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public abstract class Element \r\n    {\r\n        private WeakReference<Section> _weakSection;\r\n\r\n        public Section Section => _weakSection?.Get();\r\n\r\n        internal void SetSection(Section section)\r\n        {\r\n            _weakSection = new WeakReference<Section>(section);\r\n        }\r\n\r\n        protected Element()\r\n        {\r\n        }\r\n\r\n        public abstract UITableViewCell GetCell(UITableView tv);\r\n\r\n        public virtual void Deselected (UITableView tableView, NSIndexPath path)\r\n        {\r\n        }\r\n\r\n        public virtual void Selected (UITableView tableView, NSIndexPath path)\r\n        {\r\n            tableView.DeselectRow (path, true);\r\n        }\r\n\r\n        public RootElement GetRootElement()\r\n        {\r\n            var section = Section;\r\n            return section == null ? null : section.Root;\r\n        }\r\n\r\n        public UITableView GetContainerTableView()\r\n        {\r\n            var root = GetRootElement ();\r\n            return root == null ? null : root.TableView;\r\n        }\r\n\r\n        public UITableViewCell GetActiveCell()\r\n        {\r\n            var tv = GetContainerTableView();\r\n            if (tv == null)\r\n                return null;\r\n            var path = IndexPath;\r\n            return path == null ? null : tv.CellAt(path);\r\n        }\r\n\r\n        public NSIndexPath IndexPath { \r\n            get \r\n            {\r\n                if (Section == null || Section.Root == null)\r\n                    return null;\r\n\r\n                int row = 0;\r\n                foreach (var element in Section)\r\n                {\r\n                    if (element == this)\r\n                    {\r\n                        int nsect = 0;\r\n                        foreach (var sect in Section.Root)\r\n                        {\r\n                            if (Section == sect){\r\n                                return NSIndexPath.FromRowSection (row, nsect);\r\n                            }\r\n                            nsect++;\r\n                        }\r\n                    }\r\n                    row++;\r\n                }\r\n                return null;\r\n            }\r\n        }\r\n\r\n        public virtual bool Matches (string text)\r\n        {\r\n            return false;\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/EntryElement.cs",
    "content": "﻿using System;\r\nusing UIKit;\r\nusing CoreGraphics;\r\nusing Foundation;\r\nusing System.Reactive.Linq;\r\nusing System.Reactive.Subjects;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public class EntryElement : Element \r\n    {\r\n        private string _currentValue;\r\n\r\n        /// <summary>\r\n        ///   The value of the EntryElement\r\n        /// </summary>\r\n        public string Value \r\n        { \r\n            get { return _currentValue; }\r\n            set {\r\n                if (string.Equals(_currentValue, value))\r\n                    return;\r\n                \r\n                _currentValue = value;\r\n                if (entry != null)\r\n                    entry.Text = value;\r\n                _changedSubject.OnNext(value);\r\n            }\r\n        }\r\n\r\n        private string _caption;\r\n        public string Caption\r\n        {\r\n            get { return _caption; }\r\n            set\r\n            {\r\n                if (_caption == value)\r\n                    return;\r\n\r\n                _caption = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null && cell.TextLabel != null)\r\n                    cell.TextLabel.Text = value ?? string.Empty;\r\n            }\r\n        }\r\n\r\n        public UIKeyboardType KeyboardType {\r\n            get {\r\n                return keyboardType;\r\n            }\r\n            set {\r\n                keyboardType = value;\r\n                if (entry != null)\r\n                    entry.KeyboardType = value;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The type of Return Key that is displayed on the\r\n        /// keyboard, you can change this to use this for\r\n        /// Done, Return, Save, etc. keys on the keyboard\r\n        /// </summary>\r\n        public UIReturnKeyType? ReturnKeyType {\r\n            get {\r\n                return returnKeyType;\r\n            }\r\n            set {\r\n                returnKeyType = value;\r\n                if (entry != null && returnKeyType.HasValue)\r\n                    entry.ReturnKeyType = returnKeyType.Value;\r\n            }\r\n        }\r\n\r\n        public UITextAutocapitalizationType AutocapitalizationType {\r\n            get {\r\n                return autocapitalizationType;  \r\n            }\r\n            set { \r\n                autocapitalizationType = value;\r\n                if (entry != null)\r\n                    entry.AutocapitalizationType = value;\r\n            }\r\n        }\r\n\r\n        public UITextAutocorrectionType AutocorrectionType { \r\n            get { \r\n                return autocorrectionType;\r\n            }\r\n            set { \r\n                autocorrectionType = value;\r\n                if (entry != null)\r\n                    this.autocorrectionType = value;\r\n            }\r\n        }\r\n\r\n        public UITextFieldViewMode ClearButtonMode { \r\n            get { \r\n                return clearButtonMode;\r\n            }\r\n            set { \r\n                clearButtonMode = value;\r\n                if (entry != null)\r\n                    entry.ClearButtonMode = value;\r\n            }\r\n        }\r\n\r\n        public UITextAlignment TextAlignment {\r\n            get {\r\n                return textalignment;\r\n            }\r\n            set{\r\n                textalignment = value;\r\n                if (entry != null) {\r\n                    entry.TextAlignment = textalignment;\r\n                }\r\n            }\r\n        }\r\n        UITextAlignment textalignment = UITextAlignment.Left;\r\n        UIKeyboardType keyboardType = UIKeyboardType.Default;\r\n        UIReturnKeyType? returnKeyType = null;\r\n        UITextAutocapitalizationType autocapitalizationType = UITextAutocapitalizationType.Sentences;\r\n        UITextAutocorrectionType autocorrectionType = UITextAutocorrectionType.Default;\r\n        UITextFieldViewMode clearButtonMode = UITextFieldViewMode.Never;\r\n        bool isPassword, becomeResponder;\r\n        UITextField entry;\r\n        string placeholder;\r\n        private readonly Subject<string> _changedSubject = new Subject<string>();\r\n\r\n        public event Func<bool> ShouldReturn;\r\n        public UIFont TitleFont { get; set; }\r\n        public UIFont EntryFont { get; set; }\r\n        public UIColor TitleColor { get; set; }\r\n\r\n        public IObservable<string> Changed\r\n        {\r\n            get { return _changedSubject.AsObservable(); }\r\n        }\r\n\r\n        public EntryElement (string caption, string placeholder, string value)\r\n            : this(caption, placeholder, value, false)\r\n        { \r\n        }\r\n\r\n        public EntryElement (string caption, string placeholder, string value, bool isPassword)\r\n        {\r\n            TitleFont = UIFont.PreferredBody;\r\n            EntryFont = UIFont.PreferredBody;\r\n            TitleColor = StringElement.DefaultTitleColor;\r\n            Value = value;\r\n            Caption = caption;\r\n            this.isPassword = isPassword;\r\n            this.placeholder = placeholder;\r\n        }\r\n\r\n        // \r\n        // Computes the X position for the entry by aligning all the entries in the Section\r\n        //\r\n        CGSize ComputeEntryPosition (UITableView tv, UITableViewCell cell)\r\n        {\r\n            if (Section.EntryAlignment.Width != 0)\r\n                return Section.EntryAlignment;\r\n\r\n            // If all EntryElements have a null Caption, align UITextField with the Caption\r\n            // offset of normal cells (at 10px).\r\n            var max = new CGSize (-15, UIStringDrawing.StringSize (\"M\", TitleFont).Height);\r\n            foreach (var e in Section){\r\n                var ee = e as EntryElement;\r\n                if (ee == null)\r\n                    continue;\r\n\r\n                if (ee.Caption != null) {\r\n                    var size = UIStringDrawing.StringSize (ee.Caption, TitleFont);\r\n                    if (size.Width > max.Width)\r\n                        max = size;\r\n                }\r\n            }\r\n\r\n            Section.EntryAlignment = new CGSize (25f + (nfloat)Math.Min (max.Width, 160), max.Height);\r\n            return Section.EntryAlignment;\r\n        }\r\n\r\n        protected virtual UITextField CreateTextField (CGRect frame)\r\n        {\r\n            return new UITextField (frame) {\r\n                AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleLeftMargin,\r\n                Placeholder = placeholder ?? \"\",\r\n                SecureTextEntry = isPassword,\r\n                Text = Value ?? \"\",\r\n                Tag = 1,\r\n                TextAlignment = textalignment,\r\n                ClearButtonMode = ClearButtonMode,\r\n                Font = EntryFont,\r\n            };\r\n        }\r\n\r\n        static NSString cellkey = new NSString (\"EntryElement\");\r\n\r\n        UITableViewCell cell;\r\n        public override UITableViewCell GetCell (UITableView tv)\r\n        {\r\n            if (cell == null) {\r\n                cell = new UITableViewCell (UITableViewCellStyle.Default, cellkey);\r\n                cell.SelectionStyle = UITableViewCellSelectionStyle.None;\r\n\r\n            } \r\n            cell.TextLabel.Text = Caption;\r\n\r\n            var offset = (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) ? 20 : 90;\r\n            cell.Frame = new CGRect(cell.Frame.X, cell.Frame.Y, tv.Frame.Width-offset, cell.Frame.Height);\r\n            CGSize size = ComputeEntryPosition (tv, cell);\r\n            var yOffset = (cell.ContentView.Bounds.Height - size.Height) / 2 - 1;\r\n            var width = cell.ContentView.Bounds.Width - size.Width;\r\n            if (textalignment == UITextAlignment.Right) {\r\n                // Add padding if right aligned\r\n                width -= 10;\r\n            }\r\n            var entryFrame = new CGRect (size.Width, yOffset + 2f, width, size.Height);\r\n\r\n            if (entry == null) {\r\n                entry = CreateTextField (entryFrame);\r\n                entry.ValueChanged += (sender, e) => Value = entry.Text;\r\n                entry.EditingChanged += (sender, e) => Value = entry.Text;\r\n                entry.Ended += (sender, e) => Value = entry.Text;\r\n                entry.AllEditingEvents += (sender, e) => Value = entry.Text;\r\n                entry.ShouldReturn += delegate {\r\n\r\n                    if (ShouldReturn != null)\r\n                        return ShouldReturn ();\r\n\r\n                    RootElement root = GetRootElement();\r\n                    EntryElement focus = null;\r\n\r\n                    if (root == null)\r\n                        return true;\r\n\r\n                    foreach (var s in root) {\r\n                        foreach (var e in s) {\r\n                            if (e == this) {\r\n                                focus = this;\r\n                            } else if (focus != null && e is EntryElement) {\r\n                                focus = e as EntryElement;\r\n                                break;\r\n                            }\r\n                        }\r\n\r\n                        if (focus != null && focus != this)\r\n                            break;\r\n                    }\r\n\r\n                    if (focus != this)\r\n                        focus.BecomeFirstResponder (true);\r\n                    else \r\n                        focus.ResignFirstResponder (true);\r\n\r\n                    return true;\r\n                };\r\n                entry.Started += delegate {\r\n                    EntryElement self = null;\r\n\r\n                    if (!returnKeyType.HasValue) {\r\n                        var returnType = UIReturnKeyType.Default;\r\n\r\n                        foreach (var e in Section) {\r\n                            if (e == this)\r\n                                self = this;\r\n                            else if (self != null && e is EntryElement)\r\n                                returnType = UIReturnKeyType.Next;\r\n                        }\r\n                        entry.ReturnKeyType = returnType;\r\n                    } else\r\n                        entry.ReturnKeyType = returnKeyType.Value;\r\n\r\n                    tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, true);\r\n                };\r\n                cell.ContentView.AddSubview (entry);\r\n            } else\r\n                entry.Frame = entryFrame;\r\n\r\n            if (becomeResponder){\r\n                entry.BecomeFirstResponder ();\r\n                becomeResponder = false;\r\n            }\r\n            entry.KeyboardType = KeyboardType;\r\n\r\n            entry.AutocapitalizationType = AutocapitalizationType;\r\n            entry.AutocorrectionType = AutocorrectionType;\r\n            cell.TextLabel.Text = Caption;\r\n            cell.TextLabel.Font = TitleFont;\r\n            cell.TextLabel.TextColor = TitleColor;\r\n\r\n            return cell;\r\n        }\r\n\r\n        public override void Selected (UITableView tableView, NSIndexPath indexPath)\r\n        {\r\n            BecomeFirstResponder(true);\r\n            base.Selected(tableView, indexPath);\r\n        }\r\n\r\n        public override bool Matches (string text)\r\n        {\r\n            return (Value != null && Value.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) != -1) || base.Matches (text);\r\n        }\r\n\r\n        /// <summary>\r\n        /// Makes this cell the first responder (get the focus)\r\n        /// </summary>\r\n        /// <param name=\"animated\">\r\n        /// Whether scrolling to the location of this cell should be animated\r\n        /// </param>\r\n        public virtual void BecomeFirstResponder (bool animated)\r\n        {\r\n            becomeResponder = true;\r\n            var tv = GetContainerTableView ();\r\n            if (tv == null)\r\n                return;\r\n            tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, animated);\r\n            if (entry != null){\r\n                entry.BecomeFirstResponder ();\r\n                becomeResponder = false;\r\n            }\r\n        }\r\n\r\n        public virtual void ResignFirstResponder (bool animated)\r\n        {\r\n            becomeResponder = false;\r\n            var tv = GetContainerTableView ();\r\n            if (tv == null)\r\n                return;\r\n            tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, animated);\r\n            if (entry != null)\r\n                entry.ResignFirstResponder ();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/ExpandingInputElement.cs",
    "content": "using System;\nusing UIKit;\nusing Foundation;\nusing CoreGraphics;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing System.Reactive.Subjects;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class ExpandingInputElement : Element, IElementSizing\n    {\n        private string _val;\n        private readonly string _description;\n        private IDisposable _textEditEnded;\n        private IDisposable _textEditChanged;\n        private readonly Subject<string> _changedSubject = new Subject<string>();\n\n        public string Value\n        {\n            get { return _val; }\n            set\n            {\n                if (_val == value)\n                    return;\n\n                _val = value;\n                _changedSubject.OnNext(value);\n\n                var cell = GetActiveCell() as CustomInputCell;\n                if (cell != null)\n                    cell.TextView.Text = value;\n            }\n        }\n\n        public IObservable<string> Changed\n        {\n            get { return _changedSubject.AsObservable(); }\n        }\n\n        public UIFont Font { get; set; }\n\n        public bool SpellChecking { get; set; }\n\n        public Func<UITextView, UIView> AccessoryView { get; set; }\n\n        public bool HiddenSeperator { get; set; }\n\n        public ExpandingInputElement(string description)\n        {\n            SpellChecking = true;\n            _description = description;\n            Font = UIFont.PreferredBody;\n            HiddenSeperator = true;\n        }\n\n        public override UITableViewCell GetCell(UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(CustomInputCell.Key) as CustomInputCell;\n            if (cell == null)\n            {\n                cell = new CustomInputCell(_description);\n                cell.SelectionStyle = UITableViewCellSelectionStyle.None;\n                cell.TextView.Font = Font;\n                cell.TextView.InputAccessoryView = AccessoryView != null ? AccessoryView(cell.TextView) : new UIView();\n                cell.TextView.AutocorrectionType = SpellChecking ? UITextAutocorrectionType.Default : UITextAutocorrectionType.No;\n                cell.TextView.SpellCheckingType = SpellChecking ? UITextSpellCheckingType.Default : UITextSpellCheckingType.No;\n                cell.TextView.AutocapitalizationType = SpellChecking ? UITextAutocapitalizationType.Sentences : UITextAutocapitalizationType.None;\n            }\n\n            cell.HiddenSeperator = HiddenSeperator;\n\n            if (_textEditEnded != null)\n                _textEditEnded.Dispose();\n\n            _textEditEnded = Observable.FromEventPattern(x => cell.TextView.Ended += x, x => cell.TextView.Ended -= x)\n                .Subscribe(x => Value = cell.TextView.Text);\n\n            if (_textEditChanged != null)\n                _textEditChanged.Dispose();\n\n            _textEditChanged = Observable.FromEventPattern(x => cell.TextView.Changed += x, x => cell.TextView.Changed -= x)\n                .Subscribe(x => \n                {\n                    Value = cell.TextView.Text;\n\n                    tv.BeginUpdates();\n                    tv.EndUpdates();\n\n                    var caret = cell.TextView.GetCaretRectForPosition(cell.TextView.SelectedTextRange.Start);\n                    var cursorRect = tv.ConvertRectFromView(caret, cell.TextView);\n                    var kk = cursorRect.Size;\n                    kk.Height += 8.0f;\n                    cursorRect.Size = kk;\n                    tv.ScrollRectToVisible(cursorRect, false);\n                });\n\n            cell.TextView.Text = Value ?? string.Empty;\n            return cell;\n        }\n\n        private class CustomInputCell : UITableViewCell\n        {\n            public static NSString Key = new NSString(\"CustomInputCell\");\n            public static UIFont InputFont = UIFont.PreferredBody;\n            public readonly UITextView TextView;\n\n            public bool HiddenSeperator { get; set; }\n\n            public CustomInputCell(string placeholder)\n                : base(UITableViewCellStyle.Default, Key)\n            {\n                HiddenSeperator = true;\n                TextView = new ExtendedUITextView()\n                { \n                    Frame = new CGRect(12, 0, ContentView.Frame.Width - 24f, ContentView.Frame.Height),\n                    ScrollEnabled = false,\n                    Placeholder = placeholder\n                };\n\n                TextView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n                TextView.BackgroundColor = UIColor.Clear;\n                TextView.Font = InputFont;\n                TextView.TextColor = UIColor.Black;\n                ContentView.Add(TextView);\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n                SeparatorInset = new UIEdgeInsets(0, HiddenSeperator ? Bounds.Width : 0, 0, 0);\n            }\n        }\n\n        public nfloat GetHeight(UITableView tableView, NSIndexPath indexPath)\n        {\n            var str = new NSString(Value ?? string.Empty);\n            var height = (int)str.StringSize(CustomInputCell.InputFont, new CGSize(tableView.Bounds.Width - 24f, 10000), UILineBreakMode.WordWrap).Height + 60f;\n            return height > 120 ? height : 120;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/HtmlElement.cs",
    "content": "using System;\nusing UIKit;\nusing Foundation;\nusing CoreGraphics;\nusing System.Reactive.Subjects;\nusing System.Reactive.Linq;\nusing WebKit;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class HtmlElement : Element, IElementSizing, IDisposable\n    {\n        private readonly ISubject<string> _urlSubject = new Subject<string>();\n        private readonly Lazy<WKWebView> _webView;\n        private nfloat _height;\n        protected readonly NSString Key;\n\n        public IObservable<string> UrlRequested\n        {\n            get { return _urlSubject.AsObservable(); }\n        }\n\n        private WKWebView WebView\n        {\n            get { return _webView.Value; }\n        }\n\n        public bool HasValue { get; private set; }\n\n        public nfloat Height\n        {\n            get { return _height; }\n        }\n\n        public void SetValue(string value)\n        {\n            if (value == null)\n            {\n                WebView.LoadHtmlString(string.Empty, NSBundle.MainBundle.BundleUrl);\n            }\n            else\n            {\n                WebView.LoadHtmlString(value, NSBundle.MainBundle.BundleUrl);\n            }\n\n            HasValue = value != null;\n        }\n\n        public void SetLayout()\n        {\n            WebView.SetNeedsLayout();\n        }\n\n        private async Task<nfloat> GetSize()\n        {\n            if (HasValue)\n            {\n                try\n                {\n                    var size = await WebView.EvaluateJavaScriptAsync(\"size();\");\n                    if (size != null)\n                    {\n                        nfloat newsize;\n                        if (nfloat.TryParse(size.ToString(), out newsize))\n                            return newsize;\n                    }\n                }\n                catch\n                {\n                }\n            }\n\n            return _height;\n        }\n\n        private async Task RefreshSize()\n        {\n            var size = await GetSize();\n            if (_height != size)\n            {\n                _height = size;\n                Reload();\n            }\n        }\n\n        public void Dispose()\n        {\n            WebView.RemoveFromSuperview();\n            WebView.Dispose();\n        }\n\n        public async Task ForceResize()\n        {\n            var f = WebView.Frame;\n            f.Height = 1;\n            WebView.Frame = f;\n            f.Height = _height = await GetSize();\n            WebView.Frame = f;\n        }\n\n        public HtmlElement (string cellKey) \n        {\n            Key = new NSString(cellKey);\n            _height = 0f;\n\n            _webView = new Lazy<WKWebView>(() =>\n            {\n                var bounds = UIScreen.MainScreen.Bounds;\n                var webView = new WKWebView(new CGRect(0, 0, bounds.Width, 44f), new WKWebViewConfiguration());\n                webView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;\n                webView.ScrollView.ScrollEnabled = false;\n                webView.ScrollView.Bounces = false;\n                webView.NavigationDelegate = new NavigationDelegate(this);\n                return webView;\n            });\n        }\n\n        public void CheckHeight()\n        {\n//            var f = WebView.Frame;\n//            f.Height = 1;\n//            WebView.Frame = f;\n//            f.Height = _height = await GetSize();\n//            WebView.Frame = f;\n            Reload();\n        }\n\n        public void Reload()\n        {\n            GetRootElement()?.Reload(this);\n        }\n\n        public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath)\n        {\n            return _height;\n        }\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell (Key);\n            if (cell == null){\n                cell = new UITableViewCell (UITableViewCellStyle.Default, Key);\n                cell.SelectionStyle = UITableViewCellSelectionStyle.None;\n            }  \n\n            WebView.Frame = new CGRect(0, 0, cell.ContentView.Frame.Width, cell.ContentView.Frame.Height);\n            WebView.RemoveFromSuperview();\n            cell.ContentView.AddSubview (WebView);\n            cell.ContentView.Layer.MasksToBounds = true;\n            cell.ContentView.AutosizesSubviews = true;\n            cell.SeparatorInset = new UIEdgeInsets(0, 0, 0, 0);\n            return cell;\n        }\n\n        private void OnLoadFinished()\n        {\n            RefreshSize().ToBackground();\n        }\n\n        private bool OnLoadStart(WKNavigationAction navigation)\n        {\n            if (navigation.Request.Url.AbsoluteString.StartsWith(\"app://resize\"))\n            {\n                RefreshSize().ToBackground();\n                return false;\n            }\n\n            if (!navigation.Request.Url.AbsoluteString.StartsWith(\"file://\"))\n            {\n                if (UrlRequested != null)\n                    _urlSubject.OnNext(navigation.Request.Url.AbsoluteString);\n                return false;\n            }\n\n            return true;\n        }\n\n        private class NavigationDelegate : WKNavigationDelegate\n        {\n            private readonly WeakReference<HtmlElement> _parent;\n\n            public NavigationDelegate(HtmlElement parent)\n            {\n                _parent = new WeakReference<HtmlElement>(parent);\n            }\n\n            public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)\n            {\n                _parent.Get()?.OnLoadFinished();\n            }\n\n            public override void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, Action<WKNavigationActionPolicy> decisionHandler)\n            {\n                var ret = _parent.Get()?.OnLoadStart(navigationAction) ?? true;\n                decisionHandler(ret ? WKNavigationActionPolicy.Allow : WKNavigationActionPolicy.Cancel);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/IElementSizing.cs",
    "content": "﻿using UIKit;\r\nusing Foundation;\r\nusing System;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public interface IElementSizing \r\n    {\r\n        nfloat GetHeight (UITableView tableView, NSIndexPath indexPath);\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/IssueElement.cs",
    "content": "using System;\r\nusing UIKit;\nusing Foundation;\r\nusing CodeHub.iOS.TableViewCells;\r\n\r\nnamespace CodeHub.iOS.DialogElements\n{\n    public class IssueElement : Element, IElementSizing\n    {       \n        public UITableViewCellStyle Style { get; set; }\n        public UIColor BackgroundColor { get; set; }\n\n        public string Id { get; set; }\n        public string Title { get; set; }\n        public string Assigned { get; set; }\n        public string Status { get; set; }\n        public string Priority { get; set; }\n        public string Kind { get; set; }\r\n        public DateTimeOffset LastUpdated { get; set; }\r\n\r\n        public IssueElement(string id, string title, string assigned, string status, string priority, string kind, DateTimeOffset lastUpdated) \n        {\n            if (string.IsNullOrEmpty(assigned))\n                assigned = \"unassigned\";\n\n            Id = id;\n            Title = title;\n            Assigned = assigned;\n            Status = status;\n            Priority = priority;\n            Kind = kind;\n            LastUpdated = lastUpdated;\n            Style = UITableViewCellStyle.Default;\n        }\n\n        public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath)\n        {\n            return 69f;\n        }\n\n        public event Action Tapped;\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(IssueCellView.Key) as IssueCellView ?? IssueCellView.Create();\n            cell.Bind(Title, Status, Priority, Assigned, LastUpdated, Id, Kind);\r\n            return cell;\n        }\n\n        public override void Selected(UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            Tapped?.Invoke();\n        }\n\n        public override bool Matches(string text)\n        {\n            var id = Id ?? string.Empty;\r\n            var title = Title ?? string.Empty;\r\n\n            return id.IndexOf(text, StringComparison.OrdinalIgnoreCase) != -1 || title.IndexOf(text, StringComparison.OrdinalIgnoreCase) != -1;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/LabelElement.cs",
    "content": "using CoreGraphics;\nusing UIKit;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class LabelElement : StringElement\n    {\n        public string Name { get; private set; }\n\n        public LabelElement(string name, string color)\n            : base(name)\n        {\n            Name = name;\n            Image = CreateImage(color);\n        }\n\n        private static UIImage CreateImage(string color)\n        {\n            try\n            {\n                var red = color.Substring(0, 2);\n                var green = color.Substring(2, 2);\n                var blue = color.Substring(4, 2);\n\n                var redB = System.Convert.ToByte(red, 16);\n                var greenB = System.Convert.ToByte(green, 16);\n                var blueB = System.Convert.ToByte(blue, 16);\n\n                var size = new CGSize(28f, 28f);\n                var cgColor = UIColor.FromRGB(redB, greenB, blueB).CGColor;\n\n                UIGraphics.BeginImageContextWithOptions(size, false, 0);\n                var ctx = UIGraphics.GetCurrentContext();\n                ctx.SetLineWidth(1.0f);\n                ctx.SetStrokeColor(cgColor);\n                ctx.AddEllipseInRect(new CGRect(0, 0, size.Width, size.Height));\n                ctx.SetFillColor(cgColor);\n                ctx.FillPath();\n\n                var image = UIGraphics.GetImageFromCurrentImageContext();\n                UIGraphics.EndImageContext();\n                return image;\n            }\n            catch\n            {\n                return null;\n            }\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/LoadMoreElement.cs",
    "content": "//\n// This cell does not perform cell recycling, do not use as\n// sample code for new elements. \n//\nusing System;\nusing CoreGraphics;\nusing System.Threading;\nusing CoreFoundation;\nusing Foundation;\nusing UIKit;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class LoadMoreElement : OwnerDrawnElement\n    {\n        static NSString key = new NSString (\"LoadMoreElement\");\n        public string NormalCaption { get; set; }\n        public string LoadingCaption { get; set; }\n        public UIColor TextColor { get; set; }\n        public UIColor BackgroundColor { get; set; }\n        public bool AutoLoadOnVisible { get; set; }\n        public event Action<LoadMoreElement> Tapped = null;\n        public UIFont Font;\n        UITextAlignment alignment = UITextAlignment.Center;\n        bool animating;\n        UILabel _caption;\n        \n        public LoadMoreElement () \n            : base (UITableViewCellStyle.Default, key.ToString())\n        {\n        }\n        \n        public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped) : this (normalCaption, loadingCaption, tapped, UIFont.BoldSystemFontOfSize (16), UIColor.Black)\n        {\n        }\n        \n        public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) \n            : base (UITableViewCellStyle.Default, key.ToString())\n        {\n            NormalCaption = normalCaption;\n            LoadingCaption = loadingCaption;\n            Tapped += tapped;\n            Font = font;\n            TextColor = textColor;\n        }\n\n        public override void Draw(CGRect bounds, CoreGraphics.CGContext context, UIView view)\n        {\n            if (AutoLoadOnVisible)\n            {\n                LoadMore();\n            }\n        }\n\n        protected override void CellCreated(UITableViewCell cell, UIView view)\n        {\n            var activityIndicator = new UIActivityIndicatorView () {\n                ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray,\n                Tag = 1\n            };\n            _caption = new UILabel () {\n                AdjustsFontSizeToFitWidth = false,\n                Tag = 2,\n                HighlightedTextColor = UIColor.White,\n                AutoresizingMask = UIViewAutoresizing.FlexibleWidth,\n            };\n            cell.ContentView.AddSubview (_caption);\n            cell.ContentView.AddSubview (activityIndicator);\n            view.BackgroundColor = BackgroundColor ?? UIColor.Clear;\n        }\n        \n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var cell = base.GetCell(tv);\n            var activityIndicator = cell.ContentView.ViewWithTag (1) as UIActivityIndicatorView;\n            var caption = cell.ContentView.ViewWithTag (2) as UILabel;\n\n            if (Animating){\n                caption.Text = LoadingCaption;\n                activityIndicator.Hidden = false;\n                activityIndicator.StartAnimating ();\n            } else {\n                caption.Text = NormalCaption;\n                activityIndicator.Hidden = true;\n                activityIndicator.StopAnimating ();\n            }\n            if (BackgroundColor != null){\n                cell.ContentView.BackgroundColor = BackgroundColor ?? UIColor.Clear;\n            } else {\n                cell.ContentView.BackgroundColor = null;\n            }\n            caption.BackgroundColor = UIColor.Clear;\n            caption.TextColor = TextColor ?? UIColor.Black;\n            caption.Font = Font ?? UIFont.BoldSystemFontOfSize (16);\n            caption.TextAlignment = Alignment;\n            Layout (cell, activityIndicator, caption);\n            return cell;\n        }\n        \n        public bool Animating {\n            get {\n                return animating;\n            }\n            set {\n                if (animating == value)\n                    return;\n                animating = value;\n                var cell = GetActiveCell ();\n                if (cell == null)\n                    return;\n                var activityIndicator = cell.ContentView.ViewWithTag (1) as UIActivityIndicatorView;\n                var caption = cell.ContentView.ViewWithTag (2) as UILabel;\n                if (value){\n                    caption.Text = LoadingCaption;\n                    activityIndicator.Hidden = false;\n                    activityIndicator.StartAnimating ();\n                } else {\n                    activityIndicator.StopAnimating ();\n                    activityIndicator.Hidden = true;\n                    caption.Text = NormalCaption;\n                }\n                Layout (cell, activityIndicator, caption);\n            }\n        }\n                \n        public override void Selected (UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            LoadMore();\n        }\n\n        private void LoadMore()\n        {\n            if (Animating)\n                return;\n\n            if (Tapped != null){\n                Animating = true;\n                Tapped (this);\n            }\n        }\n        \n        CGSize GetTextSize (string text)\n        {\n            return new NSString (text).StringSize (Font, UIScreen.MainScreen.Bounds.Width, UILineBreakMode.TailTruncation);\n        }\n        \n        public static int Padding = 10;\n        public static int IndicatorSize = 20;\n\n        public override nfloat Height(CGRect bounds)\n        {\n            return GetTextSize (Animating ? LoadingCaption : NormalCaption).Height + 2*Padding;\n        }\n        \n        void Layout (UITableViewCell cell, UIActivityIndicatorView activityIndicator, UILabel caption)\n        {\n            var sbounds = cell.ContentView.Bounds;\n\n            var size = GetTextSize (Animating ? LoadingCaption : NormalCaption);\n            \n            if (!activityIndicator.Hidden)\n                activityIndicator.Frame = new CGRect ((sbounds.Width-size.Width)/2-IndicatorSize*2, Padding, IndicatorSize, IndicatorSize);\n\n            caption.Frame = new CGRect (10, Padding, sbounds.Width-20, size.Height);\n        }\n        \n        public UITextAlignment Alignment { \n            get { return alignment; } \n            set { alignment = value; }\n        }\n        public UITableViewCellAccessory Accessory { get; set; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/MenuElement.cs",
    "content": "﻿using System;\nusing UIKit;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class MenuElement : StringElement\n    {\n        private int _notificationNumber;\n        public int NotificationNumber\n        {\n            get { return _notificationNumber; }\n            set\n            {\n                if (value == _notificationNumber)\n                    return;\n                _notificationNumber = value;\n                var cell = GetActiveCell() as Cell;\n                if (cell != null)\n                    cell.NotificationNumber = value;\n            }\n        }\n\n        public MenuElement(string title, Action tapped, UIImage image, Uri imageUrl = null) : base(title)\n        {\n            Clicked.Subscribe(_ => tapped?.Invoke());\n            TextColor = UIColor.FromRGB(213, 213, 213);\n            Image = image;\n            ImageUri = imageUrl;\n            Accessory = UITableViewCellAccessory.None;\n        }\n\n        //We want everything to be the same size as far as images go.\n        //So, during layout, we'll resize the imageview and pin it to a specific size!\n        private class Cell : UITableViewCell\n        {\n            private const float ImageSize = 20f;\n            private readonly UILabel _numberView;\n\n            private int _notificationNumber;\n            public int NotificationNumber \n            {\n                get { return _notificationNumber; }\n                set\n                {\n                    _notificationNumber = value;\n                    SetNeedsLayout();\n                    LayoutIfNeeded();\n                }\n            }\n\n            public Cell(UITableViewCellStyle style, string key)\n                : base(style, key)\n            {\n                SelectedBackgroundView = new UIView { BackgroundColor = UIColor.FromRGB(25, 25, 25) };\n\n                _numberView = new UILabel { BackgroundColor = UIColor.FromRGB(54, 54, 54) };\n                _numberView.Layer.MasksToBounds = true;\n                _numberView.Layer.CornerRadius = 5f;\n                _numberView.TextAlignment = UITextAlignment.Center;\n                _numberView.TextColor = UIColor.White;\n                _numberView.Font = UIFont.SystemFontOfSize(12f);\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n                if (ImageView != null)\n                {\n                    var center = ImageView.Center;\n                    ImageView.Frame = new CGRect(0, 0, ImageSize, ImageSize);\n                    ImageView.Center = new CGPoint(ImageSize, center.Y);\n\n                    if (TextLabel != null)\n                    {\n                        var frame = TextLabel.Frame;\n                        frame.X = ImageSize * 2;\n                        frame.Width += (TextLabel.Frame.X - frame.X);\n                        TextLabel.Frame = frame;\n                    }\n                }\n\n                if (NotificationNumber > 0)\n                {\n                    _numberView.Frame = new CGRect(ContentView.Bounds.Width - 44, 11, 34, 22f);\n                    _numberView.Text = NotificationNumber.ToString();\n                    AddSubview(_numberView);\n                }\n                else\n                {\n                    _numberView.RemoveFromSuperview();\n                }\n            }\n        }\n\n        public override UITableViewCell GetCell(UITableView tv)\n        {\n            var cell = base.GetCell(tv) as Cell;\n            cell.NotificationNumber = NotificationNumber;\n            cell.ImageView.Layer.CornerRadius = ImageUri != null ? (cell.ImageView.Frame.Height / 2) : 0;\n            cell.BackgroundColor = UIColor.Clear;\n            return cell;\n        }\n\n        protected override UITableViewCell CreateTableViewCell(UITableViewCellStyle style, string key)\n        {\n            var cell = new Cell(style, key);\n            cell.ImageView.Layer.MasksToBounds = true;\n            cell.ImageView.TintColor = UIColor.FromRGB(0xd5, 0xd5, 0xd5);\n            return cell;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/MilestoneElement.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.iOS.TableViewCells;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class MilestoneElement : Element\n    {\n        private readonly string _title;\n        private readonly int _openIssues;\n        private readonly int _closedIssues;\n        private readonly DateTimeOffset? _dueDate;\n\n        public event Action Tapped;\n\n        public UITableViewCellAccessory Accessory = UITableViewCellAccessory.None;\n\n        public int Number { get; private set; }\n\n        public MilestoneElement(int number, string title, int openIssues, int closedIssues, DateTimeOffset? dueDate)\n        {\n            Number = number;\n            _title = title;\n            _openIssues = openIssues;\n            _closedIssues = closedIssues;\n            _dueDate = dueDate;\n        }\n\n        public override UITableViewCell GetCell(UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(MilestoneTableViewCell.Key) as MilestoneTableViewCell ?? new MilestoneTableViewCell\n            {\n                SelectionStyle = UITableViewCellSelectionStyle.Blue\n            };\n\n            cell.Accessory = Accessory;\n            cell.Init(_title, _openIssues, _closedIssues, _dueDate);\n            return cell;\n        }\n\n        public override void Selected(UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            Tapped?.Invoke();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/MultilinedElement.cs",
    "content": "using UIKit;\r\nusing CodeHub.iOS.TableViewCells;\r\nusing System.Reactive.Subjects;\r\nusing System;\r\nusing System.Reactive.Linq;\r\nusing Foundation;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public class MultilinedElement : Element\r\n    {\r\n        private readonly Subject<object> _tapped = new Subject<object>();\r\n\r\n        private string _caption;\r\n        public string Caption\r\n        {\r\n            get\r\n            {\r\n                return _caption;\r\n            }\r\n            set\r\n            {\r\n                if (_caption == value)\r\n                    return;\r\n                \r\n                _caption = value;\r\n                var cell = GetActiveCell() as MultilinedCellView;\r\n                if (cell != null)\r\n                    cell.Caption = value;\r\n            }\r\n        }\r\n\r\n        private string _details;\r\n        public string Details\r\n        {\r\n            get\r\n            {\r\n                return _details;\r\n            }\r\n            set\r\n            {\r\n                if (_details == value)\r\n                    return;\r\n                _details = value;\r\n                var cell = GetActiveCell() as MultilinedCellView;\r\n                if (cell != null)\r\n                    cell.Details = value;\r\n            }\r\n        }\r\n\r\n        public IObservable<object> Clicked\r\n        {\r\n            get { return _tapped.AsObservable(); }\r\n        }\r\n\r\n        public MultilinedElement(string caption = null, string details = null)\r\n        {\r\n            Caption = caption;\r\n            Details = details;\r\n        }\r\n\r\n        public override UITableViewCell GetCell(UITableView tv)\r\n        {\r\n            var cell = tv.DequeueReusableCell(MultilinedCellView.Key) as MultilinedCellView ?? MultilinedCellView.Create();\r\n            cell.Caption = Caption;\r\n            cell.Details = Details;\r\n            return cell;\r\n        }\r\n\r\n        public override void Selected (UITableView tableView, NSIndexPath indexPath)\r\n        {\r\n            base.Selected(tableView, indexPath);\r\n            _tapped.OnNext(this);\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/NewsFeedElement.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing CoreGraphics;\nusing Foundation;\nusing UIKit;\nusing CodeHub.iOS.TableViewCells;\nusing Humanizer;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class NewsFeedElement : Element\n    {\n        private readonly string _time;\n        private readonly Uri _imageUri;\n        private readonly UIImage _actionImage;\n        private readonly Action _tapped;\n        private readonly bool _multilined;\n\n        private readonly NSMutableAttributedString _attributedHeader;\n        private readonly NSMutableAttributedString _attributedBody;\n        private readonly List<NewsCellView.Link> _headerLinks;\n        private readonly List<NewsCellView.Link> _bodyLinks;\n\n        public static UIColor LinkColor = Theme.CurrentTheme.MainTitleColor;\n\n        public Action<NSUrl> WebLinkClicked;\n\n        public class TextBlock\n        {\n            public string Value;\n            public Action Tapped;\n\n            public TextBlock()\n            {\n            }\n\n            public TextBlock(string value)\n            {\n                Value = value;\n            }\n\n            public TextBlock(string value, Action tapped = null)\n                : this (value)\n            {\n                Tapped = tapped;\n            }\n        }\n\n        public NewsFeedElement(string imageUrl, DateTimeOffset time, IEnumerable<TextBlock> headerBlocks, IEnumerable<TextBlock> bodyBlocks, UIImage littleImage, Action tapped, bool multilined)\n        {\n            Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);\n            _time = time.Humanize();\n            _actionImage = littleImage;\n            _tapped = tapped;\n            _multilined = multilined;\n\n            var header = CreateAttributedStringFromBlocks(UIFont.PreferredBody, Theme.CurrentTheme.MainTextColor, headerBlocks);\n            _attributedHeader = header.Item1;\n            _headerLinks = header.Item2;\n\n            var body = CreateAttributedStringFromBlocks(UIFont.PreferredSubheadline, Theme.CurrentTheme.MainSubtitleColor, bodyBlocks);\n            _attributedBody = body.Item1;\n            _bodyLinks = body.Item2;\n        }\n\n        private static Tuple<NSMutableAttributedString,List<NewsCellView.Link>> CreateAttributedStringFromBlocks(UIFont font, UIColor primaryColor, IEnumerable<TextBlock> blocks)\n        {\n            var attributedString = new NSMutableAttributedString();\n            var links = new List<NewsCellView.Link>();\n\n            nint lengthCounter = 0;\n            int i = 0;\n\n            CoreText.CTFont ctFont;\n\n            try\n            {\n                ctFont = new CoreText.CTFont(font.FamilyName, font.PointSize);\n            }\n            catch\n            {\n                ctFont = CGFont.CreateWithFontName(font.Name).ToCTFont(font.PointSize);\n            }\n            \n            foreach (var b in blocks)\n            {\n                UIColor color = null;\n                if (b.Tapped != null)\n                    color = LinkColor;\n\n                color = color ?? primaryColor;\n\n                var str = new NSAttributedString(b.Value, new CoreText.CTStringAttributes() { ForegroundColor = color.CGColor, Font = ctFont });\n                attributedString.Append(str);\n                var strLength = str.Length;\n\n                if (b.Tapped != null)\n                {\n                    var weakTapped = new WeakReference<Action>(b.Tapped);\n                    links.Add(new NewsCellView.Link { Range = new NSRange(lengthCounter, strLength), Callback = () => weakTapped.Get()?.Invoke(), Id = i++ });\n                }\n\n                lengthCounter += strLength;\n            }\n\n            return new Tuple<NSMutableAttributedString, List<NewsCellView.Link>>(attributedString, links);\n        }\n\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(NewsCellView.Key) as NewsCellView ?? NewsCellView.Create();\n            cell.Set(_imageUri, _time, _actionImage, _attributedHeader, _attributedBody, _headerLinks, _bodyLinks, WebLinkClicked, _multilined);\n            return cell;\n        }\n\n        public override void Selected(UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            _tapped?.Invoke();\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/DialogElements/OwnerDrawnElement.cs",
    "content": "using System;\nusing CoreGraphics;\nusing UIKit;\nusing Foundation;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public abstract class OwnerDrawnElement : Element, IElementSizing\n    {        \n        public string CellReuseIdentifier\n        {\n            get;set;    \n        }\n        \n        public UITableViewCellStyle Style\n        {\n            get;set;    \n        }\n        \n        public OwnerDrawnElement (UITableViewCellStyle style, string cellIdentifier)\n        {\n            this.CellReuseIdentifier = cellIdentifier;\n            this.Style = style;\n        }\n        \n        public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath)\n        {\n            return Height(tableView.Bounds);\n        }\n        \n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            OwnerDrawnCell cell = tv.DequeueReusableCell(this.CellReuseIdentifier) as OwnerDrawnCell;\n            \n            if (cell == null)\n            {\n                cell = new OwnerDrawnCell(this, this.Style, this.CellReuseIdentifier);\n                cell.AutosizesSubviews = true;\n                cell.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n                CellCreated(cell, cell.view);\n            }\n            else\n            {\n                cell.Element = this;\n            }\n            \n            cell.Update();\n            return cell;\n        }    \n        \n        protected virtual void CellCreated(UITableViewCell cell, UIView view)\n        {\n        }\n\n        public abstract void Draw(CGRect bounds, CGContext context, UIView view);\n        \n        public abstract nfloat Height(CGRect bounds);\n        \n        class OwnerDrawnCell : UITableViewCell\n        {\n            public OwnerDrawnCellView view;\n            \n            public OwnerDrawnCell(OwnerDrawnElement element, UITableViewCellStyle style, string cellReuseIdentifier) : base(style, cellReuseIdentifier)\n            {\n                Element = element;\n            }\n            \n            public OwnerDrawnElement Element\n            {\n                get {\n                    return view.Element;\n                }\n                set {\n                    if (view == null)\n                    {\n                        view = new OwnerDrawnCellView (value);\n                        ContentView.Add (view);\n                    }\n                    else\n                    {\n                        view.Element = value;\n                    }\n                }\n            }\n                \n            \n\n            public void Update()\n            {\n                SetNeedsDisplay();\n                view.SetNeedsDisplay();\n            }        \n    \n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n                \n                view.Frame = ContentView.Bounds;\n            }\n        }\n        \n        class OwnerDrawnCellView : UIView\n        {                \n            OwnerDrawnElement element;\n            \n            public OwnerDrawnCellView(OwnerDrawnElement element)\n            {\n                this.element = element;\n                this.AutosizesSubviews = true;\n                this.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n                this.BackgroundColor = UIColor.Clear;\n            }\n            \n            \n            public OwnerDrawnElement Element\n            {\n                get { return element; }\n                set {\n                    element = value; \n                }\n            }\n            \n            public void Update()\n            {\n                SetNeedsDisplay();\n            \n            }\n            \n            public override void Draw (CGRect rect)\n            {\n                CGContext context = UIGraphics.GetCurrentContext();\n                element.Draw(rect, context, this);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/PaginateElement.cs",
    "content": "using UIKit;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class PaginateElement : LoadMoreElement\n    {\n        static PaginateElement()\n        {\n            Padding = 20;\n        }\n\n        public PaginateElement(string normal, string loading)\n        {\n            NormalCaption = normal;\n            LoadingCaption = loading;\n            Font = UIFont.PreferredBody;\n            TextColor = StringElement.DefaultTitleColor;\n        }\n\n        protected override void CellCreated(UITableViewCell cell, UIView view)\n        {\n            base.CellCreated(cell, view);\n            cell.BackgroundColor = UIColor.White;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/PullRequestElement.cs",
    "content": "﻿using System;\nusing GitHubSharp.Models;\nusing Foundation;\nusing CodeHub.iOS.Cells;\nusing UIKit;\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class PullRequestElement : Element\n    {   \n        private readonly Action _action;    \n        private readonly PullRequestModel _model;\n\n        public PullRequestElement(PullRequestModel model, Action action)\n        {\n            _model = model;\n            _action = action;\n        }\n\n        public override UITableViewCell GetCell (UITableView tv)\n        {\n            var c = tv.DequeueReusableCell(PullRequestCellView.Key) as PullRequestCellView ?? PullRequestCellView.Create();\n            c.Set(_model.Title, _model.CreatedAt, new GitHubAvatar(_model.User?.AvatarUrl));\n            return c;\n        }\n\n        public override bool Matches(string text)\n        {\n            return _model.Title.ToLower().Contains(text.ToLower());\n        }\n\n        public override void Selected(UITableView tableView, NSIndexPath path)\n        {\n            base.Selected(tableView, path);\n            _action?.Invoke();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/RootElement.cs",
    "content": "﻿using System;\nusing Foundation;\nusing System.Collections.Generic;\nusing UIKit;\nusing System.Collections.ObjectModel;\nusing System.Linq;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class RootElement : IEnumerable<Section> \n    {\n        private readonly List<Section> _sections = new List<Section>();\n        private readonly WeakReference<UITableView> _tableView;\n\n        public UITableView TableView\n        {\n            get { return _tableView.Get(); }\n        }\n\n        public IReadOnlyList<Section> Sections\n        {\n            get { return new ReadOnlyCollection<Section>(_sections); }\n        }\n\n        public RootElement(UITableView tableView)\n        {\n            _tableView = new WeakReference<UITableView>(tableView);\n        }\n\n        public int Count \n        { \n            get { return _sections.Count; }\n        }\n\n        public Section this [int idx] \n        {\n            get { return _sections[idx]; }\n        }\n\n        internal int IndexOf (Section target)\n        {\n            int idx = 0;\n            foreach (Section s in _sections){\n                if (s == target)\n                    return idx;\n                idx++;\n            }\n            return -1;\n        }\n\n        public void Add (Section section)\n        {\n            if (section == null)\n                return;\n\n            _sections.Add (section);\n            section.Root = this;\n            _tableView.Get()?.InsertSections (MakeIndexSet (_sections.Count-1, 1), UITableViewRowAnimation.None);\n        }\n\n        public void Add (IEnumerable<Section> sections)\n        {\n            foreach (var s in sections)\n                Add (s);\n        }\n\n        public void Add(params Section[] sections)\n        {\n            Add((IEnumerable<Section>)sections);\n        }\n\n        NSIndexSet MakeIndexSet (int start, int count)\n        {\n            NSRange range;\n            range.Location = start;\n            range.Length = count;\n            return NSIndexSet.FromNSRange (range);\n        }\n\n        public void Insert (int idx, UITableViewRowAnimation anim, params Section [] newSections)\n        {\n            if (idx < 0 || idx > _sections.Count)\n                return;\n            if (newSections == null)\n                return;\n\n            _tableView.Get()?.BeginUpdates ();\n\n            int pos = idx;\n            foreach (var s in newSections){\n                s.Root = this;\n                _sections.Insert (pos++, s);\n            }\n\n            _tableView.Get()?.InsertSections (MakeIndexSet (idx, newSections.Length), anim);\n            _tableView.Get()?.EndUpdates ();\n        }\n\n        public void Insert (int idx, Section section)\n        {\n            Insert (idx, UITableViewRowAnimation.None, section);\n        }\n\n        public void RemoveAt (int idx, UITableViewRowAnimation anim)\n        {\n            if (idx < 0 || idx >= _sections.Count)\n                return;\n\n            _sections.RemoveAt (idx);\n            _tableView.Get()?.DeleteSections (NSIndexSet.FromIndex (idx), anim);\n        }\n\n        public void Remove (Section s)\n        {\n            if (s == null)\n                return;\n            int idx = _sections.IndexOf (s);\n            if (idx == -1)\n                return;\n            RemoveAt (idx, UITableViewRowAnimation.Fade);\n        }\n\n        public void Remove (Section s, UITableViewRowAnimation anim)\n        {\n            if (s == null)\n                return;\n            int idx = _sections.IndexOf (s);\n            if (idx == -1)\n                return;\n            RemoveAt (idx, anim);\n        }\n\n        public void Clear ()\n        {\n            foreach (var s in _sections)\n                s.Root = null;\n            _sections.Clear();\n            _tableView.Get()?.ReloadData ();\n        }\n\n        public void Reset(IEnumerable<Section> sections)\n        {\n            foreach (var s in _sections)\n                s.Root = null;\n            _sections.Clear();\n\n            foreach (var s in sections)\n            {\n                s.Root = this;\n                _sections.Add(s);\n            }\n\n            _tableView.Get()?.ReloadData();\n        }\n\n        public void Reset(params Section[] sections)\n        {\n            Reset((IEnumerable<Section>)sections);\n        }\n\n        public void Reload (Element element)\n        {\n            Reload(new [] { element });\n        }\n\n        public void Reload (Element[] elements)\n        {\n            var paths = (elements ?? Enumerable.Empty<Element>())\n                .Where(x => x.Section != null && x.Section.Root != null)\n                .Select(x => x.IndexPath);\n\n            try\n            {\n                _tableView.Get()?.BeginUpdates();\n                _tableView.Get()?.ReloadRows(paths.ToArray(), UITableViewRowAnimation.None);\n            }\n            finally\n            {\n                _tableView.Get()?.EndUpdates();\n            }\n        }\n\n        public IEnumerator<Section> GetEnumerator()\n        {\n            return _sections.GetEnumerator();\n        }\n\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\n        {\n            return GetEnumerator();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/Section.cs",
    "content": "﻿using System.Collections.Generic;\r\nusing UIKit;\r\nusing CoreGraphics;\r\nusing Foundation;\r\nusing System.Collections.ObjectModel;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public class Section : IEnumerable<Element> {\r\n        object header, footer;\r\n        private readonly List<Element> _elements = new List<Element> ();\r\n\r\n        public RootElement Root\r\n        {\r\n            get;\r\n            internal set;\r\n        }\r\n\r\n        public IReadOnlyList<Element> Elements\r\n        {\r\n            get { return new ReadOnlyCollection<Element>(_elements); }\r\n        }\r\n\r\n        // X corresponds to the alignment, Y to the height of the password\r\n        public CGSize EntryAlignment;\r\n\r\n        public Section()\r\n        {\r\n        }\r\n\r\n        public Section(UIView header, UIView footer = null)\r\n        {\r\n            HeaderView = header;\r\n            FooterView = footer;\r\n        }\r\n\r\n        public Section(string header, string footer = null)\r\n        {\r\n            Header = header;\r\n            Footer = footer;\r\n        }\r\n\r\n        /// <summary>\r\n        ///    The section header, as a string\r\n        /// </summary>\r\n        public string Header {\r\n            get {\r\n                return header as string;\r\n            }\r\n            set {\r\n                header = value;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The section footer, as a string.\r\n        /// </summary>\r\n        public string Footer {\r\n            get {\r\n                return footer as string;\r\n            }\r\n\r\n            set {\r\n                footer = value;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The section's header view.  \r\n        /// </summary>\r\n        public UIView HeaderView {\r\n            get {\r\n                return header as UIView;\r\n            }\r\n            set {\r\n                header = value;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The section's footer view.\r\n        /// </summary>\r\n        public UIView FooterView {\r\n            get {\r\n                return footer as UIView;\r\n            }\r\n            set {\r\n                footer = value;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// Adds a new child Element to the Section\r\n        /// </summary>\r\n        /// <param name=\"element\">\r\n        /// An element to add to the section.\r\n        /// </param>\r\n        public void Add (Element element)\r\n        {\r\n            if (element == null)\r\n                return;\r\n\r\n            _elements.Add (element);\r\n            element.SetSection(this);\r\n\r\n            if (Root != null)\r\n                InsertVisual (_elements.Count-1, UITableViewRowAnimation.None, 1);\r\n        }\r\n\r\n        public void Add(IEnumerable<Element> elements)\r\n        {\r\n            AddAll(elements);\r\n        }\r\n\r\n        /// <summary>\r\n        ///    Add version that can be used with LINQ\r\n        /// </summary>\r\n        /// <param name=\"elements\">\r\n        /// An enumerable list that can be produced by something like:\r\n        ///    from x in ... select (Element) new MyElement (...)\r\n        /// </param>\r\n        public int AddAll(IEnumerable<Element> elements)\r\n        {\r\n            int count = 0;\r\n            foreach (var e in elements){\r\n                Add (e);\r\n                count++;\r\n            }\r\n            return count;\r\n        }\r\n\r\n        /// <summary>\r\n        /// Inserts a series of elements into the Section using the specified animation\r\n        /// </summary>\r\n        /// <param name=\"idx\">\r\n        /// The index where the elements are inserted\r\n        /// </param>\r\n        /// <param name=\"anim\">\r\n        /// The animation to use\r\n        /// </param>\r\n        /// <param name=\"newElements\">\r\n        /// A series of elements.\r\n        /// </param>\r\n        public void Insert (int idx, UITableViewRowAnimation anim, params Element [] newElements)\r\n        {\r\n            if (newElements == null)\r\n                return;\r\n\r\n            int pos = idx;\r\n            foreach (var e in newElements)\r\n            {\r\n                _elements.Insert (pos++, e);\r\n                e.SetSection(this);\r\n            }\r\n\r\n            if (Root != null && Root.TableView != null)\r\n            {\r\n                if (anim == UITableViewRowAnimation.None)\r\n                    Root.TableView.ReloadData ();\r\n                else\r\n                    InsertVisual (idx, anim, newElements.Length);\r\n            }\r\n        }\r\n\r\n        public int Insert (int idx, UITableViewRowAnimation anim, IEnumerable<Element> newElements)\r\n        {\r\n            if (newElements == null)\r\n                return 0;\r\n\r\n            int pos = idx;\r\n            int count = 0;\r\n            foreach (var e in newElements)\r\n            {\r\n                _elements.Insert (pos++, e);\r\n                e.SetSection(this);\r\n                count++;\r\n            }\r\n\r\n            if (Root != null && Root.TableView != null)\r\n            {                \r\n                if (anim == UITableViewRowAnimation.None)\r\n                    Root.TableView.ReloadData ();\r\n                else\r\n                    InsertVisual (idx, anim, pos-idx);\r\n            }\r\n            return count;\r\n        }\r\n\r\n        void InsertVisual (int idx, UITableViewRowAnimation anim, int count)\r\n        {\r\n            if (Root == null || Root.TableView == null)\r\n                return;\r\n\r\n            int sidx = Root.IndexOf (this);\r\n            var paths = new NSIndexPath [count];\r\n            for (int i = 0; i < count; i++)\r\n                paths [i] = NSIndexPath.FromRowSection (idx+i, sidx);\r\n            Root.TableView.InsertRows (paths, anim);\r\n        }\r\n\r\n        public void Insert (int index, params Element [] newElements)\r\n        {\r\n            Insert (index, UITableViewRowAnimation.None, newElements);\r\n        }\r\n\r\n        public void Remove (Element e, UITableViewRowAnimation animation = UITableViewRowAnimation.Automatic)\r\n        {\r\n            if (e == null)\r\n                return;\r\n\r\n            for (int i = _elements.Count; i > 0;)\r\n            {\r\n                i--;\r\n                if (_elements [i] == e)\r\n                {\r\n                    RemoveRange (i, 1, animation);\r\n                    e.SetSection(null);\r\n                    return;\r\n                }\r\n            }\r\n        }\r\n\r\n        public void Remove (int idx)\r\n        {\r\n            RemoveRange (idx, 1);\r\n        }\r\n\r\n        /// <summary>\r\n        /// Remove a range of elements from the section with the given animation\r\n        /// </summary>\r\n        /// <param name=\"start\">\r\n        /// Starting position\r\n        /// </param>\r\n        /// <param name=\"count\">\r\n        /// Number of elements to remove form the section\r\n        /// </param>\r\n        /// <param name=\"anim\">\r\n        /// The animation to use while removing the elements\r\n        /// </param>\r\n        public void RemoveRange (int start, int count, UITableViewRowAnimation anim = UITableViewRowAnimation.Fade)\r\n        {\r\n            if (start < 0 || start >= _elements.Count)\r\n                return;\r\n            if (count == 0)\r\n                return;\r\n\r\n            if (start+count > _elements.Count)\r\n                count = _elements.Count-start;\r\n\r\n            _elements.RemoveRange (start, count);\r\n\r\n            if (Root != null && Root.TableView != null)\r\n            {\r\n                int sidx = Root.IndexOf(this);\r\n                var paths = new NSIndexPath [count];\r\n                for (int i = 0; i < count; i++)\r\n                    paths[i] = NSIndexPath.FromRowSection(start + i, sidx);\r\n                Root.TableView.DeleteRows(paths, anim);\r\n\r\n                //Root.TableView.ReloadData();\r\n            }\r\n        }\r\n\r\n        public int Count \r\n        {\r\n            get { return _elements.Count; }\r\n        }\r\n\r\n        public IEnumerator<Element> GetEnumerator()\r\n        {\r\n            return _elements.GetEnumerator();\r\n        }\r\n\r\n        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()\r\n        {\r\n            return GetEnumerator();\r\n        }\r\n\r\n        public Element this [int idx] \r\n        {\r\n            get { return _elements[idx]; }\r\n        }\r\n\r\n        public void Clear ()\r\n        {\r\n            foreach (var e in _elements)\r\n                e.SetSection(null);\r\n            _elements.Clear();\r\n            if (Root != null && Root.TableView != null)\r\n                Root.TableView.ReloadData ();\r\n        }\r\n\r\n        public void Reset(IEnumerable<Element> elements, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade)\r\n        {\r\n            _elements.Clear();\r\n            _elements.AddRange(elements);\r\n            foreach (var e in _elements)\r\n                e.SetSection(this);\r\n            if (Root != null && Root.TableView != null)\r\n                Root.TableView.ReloadData();\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/SplitButtonElement.cs",
    "content": "using UIKit;\nusing CoreGraphics;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Subjects;\n\nnamespace CodeHub.iOS.DialogElements\n{\n    public class SplitButtonElement : Element\n    {\n        public static UIColor CaptionColor = UIColor.FromRGB(41, 41, 41);\n        public static UIFont CaptionFont = UIFont.SystemFontOfSize(14f);\n        public static UIColor TextColor = UIColor.FromRGB(100, 100, 100);\n        public static UIFont TextFont = UIFont.BoldSystemFontOfSize(14f);\n        private readonly List<Button> _buttons = new List<Button>();\n\n        public class Button\n        {\n            private readonly SplitButtonElement _element;\n            private string _text, _caption;\n\n            public Button(SplitButtonElement element, string text, string caption)\n            {\n                _element = element;\n                _text = text;\n                _caption = caption;\n                Clicked = new Subject<Unit>();\n            }\n\n            public ISubject<Unit> Clicked { get; }\n\n            public string Text\n            {\n                get { return _text; }\n                set\n                {\n                    _text = value;\n                    _element.GetRootElement()?.Reload(_element);\n                }\n            }\n            public string Caption\n            {\n                get { return _caption; }\n                set\n                {\n                    _caption = value;\n                    _element.GetRootElement()?.Reload(_element);\n                }\n            }\n        }\n\n        public Button AddButton(string caption, string text = null)\n        {\n            var btn = new Button(this, text, caption);\n            _buttons.Add(btn);\n            return btn;\n        }\n\n        public SplitButtonElement()\n        {\n        }\n\n        public override UITableViewCell GetCell(UITableView tv)\n        {\n            var cell = tv.DequeueReusableCell(\"splitbuttonelement\") as SplitButtonCell;\n            if (cell == null)\n            {\n                cell = new SplitButtonCell(_buttons.Count);\n                cell.SelectionStyle = UITableViewCellSelectionStyle.None;\n                cell.SeparatorInset = UIEdgeInsets.Zero;\n                cell.BackgroundColor = tv.SeparatorColor;\n            }\n            cell.SetButtons(_buttons);\n            return cell;\n        }\n\n        private class SplitButtonCell : UITableViewCell\n        {\n            private readonly static float SeperatorWidth = 1.0f;\n            private readonly SplitButton[] _buttons;\n\n            static SplitButtonCell()\n            {\n                if (UIScreen.MainScreen.Scale > 1.0f)\n                    SeperatorWidth = 0.5f;\n            }\n\n\n            public SplitButtonCell(int buttons)\n                : base(UITableViewCellStyle.Default, \"splitbuttonelement\")\n            {\n                _buttons = Enumerable.Range(0, buttons)\n                    .Select(x => new SplitButton())\n                    .ToArray();\n\n                foreach (var b in _buttons)\n                    ContentView.Add(b);\n            }\n\n            public void SetButtons(List<Button> items)\n            {\n                foreach (var b in _buttons.Zip(items, (x, y) => new { Button = x, Data = y }))\n                {\n                    b.Button.Caption = b.Data.Caption;\n                    b.Button.Text = b.Data.Text;\n                    b.Button.UserInteractionEnabled = true;\n                    var weakRef = new WeakReference<Button>(b.Data);\n                    b.Button.Touch = () => weakRef.Get()?.Clicked.OnNext(Unit.Default);\n                }\n            }\n\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n\n                var width = this.Bounds.Width;\n                var space = width / (float)_buttons.Length;\n\n                for (var i = 0; i < _buttons.Length; i++)\n                {\n                    _buttons[i].Frame = new CGRect(i * space, 0, space - SeperatorWidth, Bounds.Height);\n                    _buttons[i].LayoutSubviews();\n                }\n            }\n        }\n\n\n        private class SplitButton : UIButton\n        {\n            private readonly UILabel _caption;\n            private readonly UILabel _text;\n\n            public string Text\n            {\n                get { return _text.Text; }\n                set \n                { \n                    if (_text.Text == value)\n                        return;\n                    _text.Text = value; \n                    SetNeedsDisplay();\n                }\n            }\n\n            public string Caption\n            {\n                get { return _caption.Text; }\n                set \n                { \n                    if (_caption.Text == value)\n                        return;\n                    _caption.Text = value; \n                    SetNeedsDisplay();\n                }\n            }\n\n            public Action Touch;\n\n            public SplitButton()\n            {\n                AutosizesSubviews = true;\n\n                BackgroundColor = UIColor.White;\n\n                _caption = new UILabel();\n                _caption.TextColor = CaptionColor;\n                _caption.Font = CaptionFont;\n                _caption.TextAlignment = UITextAlignment.Center;\n                this.Add(_caption);\n\n                _text = new UILabel();\n                _text.TextColor = TextColor;\n                _text.Font = TextFont;\n                _text.TextAlignment = UITextAlignment.Center;\n                this.Add(_text);\n\n                this.TouchUpInside += (sender, e) => Touch?.Invoke();\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n\n                _text.Frame = new CGRect(12, 3, (int)Math.Floor(this.Bounds.Width) - 24f, (int)Math.Ceiling(TextFont.LineHeight) + 1);\n                _caption.Frame = new CGRect(12, _text.Frame.Bottom, (int)Math.Floor(this.Bounds.Width) - 24f, (int)Math.Ceiling(CaptionFont.LineHeight));\n            }\n        }\n\n    }\n\n}\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/SplitViewElement.cs",
    "content": "﻿using System;\r\nusing UIKit;\r\nusing CoreGraphics;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public class SplitViewElement : Element, IElementSizing\r\n    {\r\n        public static UIColor DefaulTextColor = UIColor.FromWhiteAlpha(0.1f, 1.0f);\r\n        public static UIFont TextFont = UIFont.SystemFontOfSize(14f);\r\n\r\n        public SplitButton Button1 { get; }\r\n\r\n        public SplitButton Button2 { get; }\r\n\r\n        public SplitViewElement(UIImage image1, UIImage image2, string text1 = null, string text2 = null)\r\n        {\r\n            Button1 = new SplitButton(image1, text1);\r\n            Button2 = new SplitButton(image2, text2);\r\n        }\r\n\r\n        public nfloat GetHeight(UITableView tableView, Foundation.NSIndexPath indexPath)\r\n        {\r\n            return 44f;\r\n        }\r\n\r\n        public override UITableViewCell GetCell(UITableView tv)\r\n        {\r\n            var cell = tv.DequeueReusableCell(\"splitelement\") as SplitCell ?? new SplitCell();\r\n            cell.SetButtons(tv, new [] { Button1, Button2 });\r\n            cell.SeparatorInset = UIEdgeInsets.Zero;\r\n            cell.PreservesSuperviewLayoutMargins = false;\r\n            cell.LayoutMargins = UIEdgeInsets.Zero;\r\n            return cell;\r\n        }\r\n\r\n        private class SplitCell : UITableViewCell\r\n        {\r\n            private readonly static float SeperatorWidth = 1.0f;\r\n            private UIButton[] _buttons;\r\n            private UIView[] _seperatorViews;\r\n\r\n            static SplitCell()\r\n            {\r\n                if (UIScreen.MainScreen.Scale > 1.0f)\r\n                    SeperatorWidth = 0.5f;\r\n            }\r\n\r\n            public SplitCell()\r\n                : base(UITableViewCellStyle.Default, \"splitelement\")\r\n            {\r\n                SelectionStyle = UITableViewCellSelectionStyle.None;\r\n            }\r\n\r\n            public void SetButtons(UITableView tableView, SplitButton[] items)\r\n            {\r\n                if (_buttons != null)\r\n                {\r\n                    foreach (var btn in _buttons)\r\n                    {\r\n                        btn.RemoveFromSuperview();\r\n                    }\r\n                }\r\n\r\n                _buttons = new UIButton[items.Length];\r\n\r\n                for (var i = 0; i < items.Length; i++)\r\n                {\r\n                    _buttons[i] = items[i];\r\n                    ContentView.Add(_buttons[i]);\r\n                }\r\n\r\n                if (_seperatorViews != null)\r\n                {\r\n                    foreach (var v in _seperatorViews)\r\n                    {\r\n                        v.RemoveFromSuperview();\r\n                        v.Dispose();\r\n                    }\r\n                    _seperatorViews = null;\r\n                }\r\n\r\n                _seperatorViews = new UIView[Math.Max(items.Length - 1, 0)];\r\n                for (var i = 0; i < _seperatorViews.Length; i++)\r\n                {\r\n                    _seperatorViews[i] = new UIView { BackgroundColor = tableView.SeparatorColor };\r\n                    ContentView.Add(_seperatorViews[i]);\r\n                }\r\n            }\r\n\r\n            public override void LayoutSubviews()\r\n            {\r\n                base.LayoutSubviews();\r\n\r\n                if (_buttons == null)\r\n                    return;\r\n\r\n                var width = Bounds.Width;\r\n                var space = width / _buttons.Length;\r\n\r\n                for (var i = 0; i < _buttons.Length; i++)\r\n                {\r\n                    _buttons[i].Frame = new CGRect(i * space, 0, space - 1f, Bounds.Height);\r\n                    _buttons[i].LayoutSubviews();\r\n\r\n                    if (i != _buttons.Length - 1)\r\n                        _seperatorViews[i].Frame = new CGRect(_buttons[i].Frame.Right, 0, SeperatorWidth, Bounds.Height);\r\n                }\r\n            }\r\n        }\r\n\r\n\r\n        public class SplitButton : UIButton\r\n        {\r\n            private readonly UIImageView _image;\r\n            private readonly UILabel _text;\r\n\r\n            public string Text\r\n            {\r\n                get { return _text.Text; }\r\n                set { _text.Text = value; }\r\n            }\r\n\r\n            public UIImage Image\r\n            {\r\n                get { return _image.Image; }\r\n                set { _image.Image = value; }\r\n            }\r\n\r\n            public SplitButton(UIImage image, string text = null)\r\n            {\r\n                AutosizesSubviews = true;\r\n\r\n                _image = new UIImageView();\r\n                _image.Image = image;\r\n                this.Add(_image);\r\n\r\n                _text = new UILabel();\r\n                _text.TextColor = DefaulTextColor;\r\n                _text.Font = TextFont;\r\n                _text.Text = text ?? string.Empty;\r\n                _text.AdjustsFontSizeToFitWidth = true;\r\n                _text.MinimumScaleFactor = 0.7f;\r\n                this.Add(_text);\r\n            }\r\n\r\n            private static bool IsPad = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad;\r\n\r\n            public override void LayoutSubviews()\r\n            {\r\n                base.LayoutSubviews();\r\n\r\n                var offset = IsPad ? 18f : 16f;\r\n                var rightOffset = IsPad ? 16f : 18f;\r\n\r\n                var height = (this.Bounds.Height - 24f);\r\n                _image.Frame = new CGRect(offset, 12, height, height);\r\n\r\n                var textHeight = (int)Math.Ceiling(TextFont.LineHeight) + 1;\r\n                var textY = (this.Bounds.Height / 2) - (textHeight / 2);\r\n                _text.Frame = new CGRect(_image.Frame.Right + rightOffset, textY, (int)Math.Floor(this.Bounds.Width) - (_image.Frame.Right + rightOffset + _image.Frame.Left), textHeight);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/StringElement.cs",
    "content": "﻿using System;\r\nusing UIKit;\r\nusing Foundation;\r\nusing SDWebImage;\r\nusing System.Reactive.Subjects;\r\nusing System.Reactive.Linq;\r\n\r\nnamespace CodeHub.iOS.DialogElements\r\n{\r\n    public class ButtonElement : StringElement\r\n    {\r\n        public ButtonElement (string caption, string value, UIImage image = null) \r\n            : base (caption, value, UITableViewCellStyle.Value1) \r\n        {\r\n            Image = image;\r\n            Accessory = UITableViewCellAccessory.DisclosureIndicator;\r\n        }\r\n\r\n        public ButtonElement (string caption, UIImage image = null) \r\n            : this (caption, null, image)\r\n        {\r\n        }\r\n    }\r\n\r\n    public class StringElement : Element \r\n    {\r\n        public static UIColor DefaultTitleColor = UIColor.FromRGB(41, 41, 41);\r\n        public static UIColor DefaultDetailColor = UIColor.FromRGB(80, 80, 80);\r\n        public static UIColor BgColor = UIColor.White;\r\n\r\n        static NSString [] skey = { new NSString (\".1\"), new NSString (\".2\"), new NSString (\".3\"), new NSString (\".4\") };\r\n\r\n        public UITableViewCellStyle Style;\r\n        public UIFont Font;\r\n        public UIFont SubtitleFont;\r\n        public UIColor TextColor;\r\n        private UIImage _image;\r\n        private Uri _imageUri;\r\n        private string _value;\r\n        private UITableViewCellAccessory _accessory = UITableViewCellAccessory.DisclosureIndicator;\r\n        private readonly Subject<object> _tapped = new Subject<object>();\r\n        private UITableViewCellSelectionStyle _selectionStyle = UITableViewCellSelectionStyle.Default;\r\n\r\n        public IObservable<object> Clicked\r\n        {\r\n            get { return _tapped.AsObservable(); }\r\n        }\r\n\r\n        public UITableViewCellSelectionStyle SelectionStyle\r\n        {\r\n            get { return _selectionStyle; }\r\n            set\r\n            {\r\n                if (_selectionStyle == value)\r\n                    return;\r\n                \r\n                _selectionStyle = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null)\r\n                    cell.SelectionStyle = value;\r\n            }\r\n        }\r\n\r\n        private string _caption;\r\n        public string Caption\r\n        {\r\n            get { return _caption; }\r\n            set\r\n            {\r\n                if (_caption == value)\r\n                    return;\r\n\r\n                _caption = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null && cell.TextLabel != null)\r\n                    cell.TextLabel.Text = value ?? string.Empty;\r\n            }\r\n        }\r\n\r\n        public string Value\r\n        {\r\n            get { return _value; }\r\n            set\r\n            {\r\n                if (_value == value)\r\n                    return;\r\n                \r\n                _value = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null && cell.DetailTextLabel != null)\r\n                    cell.DetailTextLabel.Text = value ?? string.Empty;\r\n            }\r\n        }\r\n\r\n        public UITableViewCellAccessory Accessory\r\n        {\r\n            get { return _accessory; }\r\n            set\r\n            {\r\n                if (_accessory == value)\r\n                    return;\r\n                \r\n                _accessory = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null)\r\n                    cell.Accessory = value;\r\n            }\r\n        }\r\n\r\n        private int _lines;\r\n        public int Lines\r\n        {\r\n            get { return _lines; }\r\n            set\r\n            {\r\n                if (_lines == value)\r\n                    return;\r\n                \r\n                _lines = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null)\r\n                    cell.TextLabel.Lines = value;\r\n            }\r\n        }\r\n\r\n        private UILineBreakMode _lineBreakMode;\r\n        public UILineBreakMode LineBreakMode\r\n        {\r\n            get { return _lineBreakMode; }\r\n            set\r\n            {\r\n                if (_lineBreakMode == value)\r\n                    return;\r\n                \r\n                _lineBreakMode = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null)\r\n                    cell.TextLabel.LineBreakMode = value;\r\n            }\r\n        }\r\n\r\n        public UIColor ImageTintColor { get; set; }\r\n\r\n        public StringElement()\r\n        {\r\n            Font = UIFont.PreferredBody;\r\n            SubtitleFont = UIFont.PreferredSubheadline;\r\n            TextColor = DefaultTitleColor;\r\n        }\r\n\r\n        public StringElement (string caption)\r\n            : this()\r\n        {\r\n            Caption = caption;\r\n        }\r\n\r\n        public StringElement (string caption, UIImage image) \r\n            : this (caption) \r\n        {\r\n            Image = image;\r\n        }\r\n\r\n        public StringElement (string caption, string value) \r\n            : this (caption) \r\n        {\r\n            Style = UITableViewCellStyle.Value1;\r\n            Value = value;\r\n        }\r\n\r\n        public StringElement (string caption, string value, UITableViewCellStyle style)\r\n            : this (caption, value) \r\n        { \r\n            this.Style = style;\r\n        }\r\n\r\n        public StringElement (string caption, UITableViewCellStyle style)\r\n            : this (caption, null, style) \r\n        { \r\n        }\r\n\r\n        public UIImage Image {\r\n            get { return _image; }\r\n            set \r\n            {\r\n                _image = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null)\r\n                    cell.ImageView.Image = value;\r\n            }\r\n        }\r\n\r\n        // Loads the image from the specified uri (use this or Image)\r\n        public Uri ImageUri {\r\n            get { return _imageUri; }\r\n            set {\r\n                if (_imageUri == value)\r\n                    return;\r\n                \r\n                _imageUri = value;\r\n                var cell = GetActiveCell();\r\n                if (cell != null && value != null)\r\n                    cell.ImageView.SetImage(new NSUrl(value.AbsoluteUri));\r\n            }\r\n        }\r\n\r\n        protected virtual string GetKey (int style)\r\n        {\r\n            return skey [style];\r\n        }\r\n\r\n        protected virtual UITableViewCell CreateTableViewCell(UITableViewCellStyle style, string key)\r\n        {\r\n            return new UITableViewCell (style, key);\r\n        }\r\n\r\n        public override UITableViewCell GetCell (UITableView tv)\r\n        {\r\n            var key = GetKey ((int) Style);\r\n            var cell = tv.DequeueReusableCell(key) ?? CreateTableViewCell(Style, key);\r\n            return InitializeCell(cell);\r\n        }\r\n\r\n        protected virtual UITableViewCell InitializeCell(UITableViewCell cell)\r\n        {\r\n            cell.SelectionStyle = SelectionStyle;\r\n            cell.TextLabel.Text = Caption;\r\n            cell.TextLabel.TextColor = TextColor;\r\n            cell.ImageView.Image = Image;\r\n            cell.Accessory = Accessory;\r\n\r\n            if (ImageUri != null)\r\n                cell.ImageView.SetImage(new NSUrl(ImageUri.AbsoluteUri), Image);\r\n\r\n            if (cell.DetailTextLabel != null)\r\n            {\r\n                cell.DetailTextLabel.Text = Value ?? \"\";\r\n                cell.DetailTextLabel.TextColor = DefaultDetailColor;\r\n            }\r\n            return cell;\r\n        }\r\n\r\n        public override void Selected (UITableView tableView, NSIndexPath indexPath)\r\n        {\r\n            base.Selected(tableView, indexPath);\r\n            _tapped.OnNext(this);\r\n        }\r\n\r\n        public override bool Matches (string text)\r\n        {\r\n            var cap = Caption ?? string.Empty;\r\n            var val = Value ?? string.Empty;\r\n            return cap.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) != -1 || val.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) != -1;\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/DialogElements/UserElement.cs",
    "content": "using System;\r\nusing UIKit;\r\nusing CodeHub.iOS;\r\nusing CodeHub.Core.Utilities;\r\n\r\nnamespace CodeHub.iOS.DialogElements\n{\n    public class UserElement : StringElement\n    {\r\n        public UserElement(string username, string firstName, string lastName, GitHubAvatar avatar)\n            : base (username, string.Empty, UITableViewCellStyle.Subtitle)\n        {\n            var realName = firstName ?? \"\" + \" \" + (lastName ?? \"\");\n             if (!string.IsNullOrWhiteSpace(realName))\n                Value = realName;\n            Accessory = UITableViewCellAccessory.DisclosureIndicator;\r\n            Image = Images.Avatar;\n            ImageUri = avatar.ToUri(64);\r\n        }\r\n        \n        // We need to create our own cell so we can position the image view appropriately\n        protected override UITableViewCell CreateTableViewCell(UITableViewCellStyle style, string key)\n        {\r\n            return new PinnedImageTableViewCell(style, key);\r\n        }\n\n        /// <summary>\n        /// This class is to make sure the imageview is of a specific size... :(\n        /// </summary>\n        private class PinnedImageTableViewCell : UITableViewCell\n        {\n            public PinnedImageTableViewCell(UITableViewCellStyle style, string key) \n                : base(style, key) \n            { \r\n                this.SeparatorInset = new UIKit.UIEdgeInsets(0, 48f, 0, 0); \n                ImageView.ContentMode = UIViewContentMode.ScaleAspectFill;\n                ImageView.Layer.CornerRadius = 16f;\n                ImageView.Layer.MasksToBounds = true;\n//                ImageView.Layer.ShouldRasterize = true;\n//                ImageView.Layer.RasterizationScale = UIScreen.MainScreen.Scale;\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n                ImageView.Frame = new CoreGraphics.CGRect(6, 6, 32, 32);\n                TextLabel.Frame = new CoreGraphics.CGRect(48, TextLabel.Frame.Y, TextLabel.Frame.Width, TextLabel.Frame.Height);\n                if (DetailTextLabel != null)\n                    DetailTextLabel.Frame = new CoreGraphics.CGRect(48, DetailTextLabel.Frame.Y, DetailTextLabel.Frame.Width, DetailTextLabel.Frame.Height);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Entitlements.plist",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "CodeHub.iOS/Images/Images.cs",
    "content": "using UIKit;\nusing MonoTouch.UIKit;\n\nnamespace CodeHub.iOS\n{\n    public static class Images\n    {\n        public static UIImage LoginUserUnknown\n        {\n            get \n            {\n                var img = UIImage.FromBundle(\"UnknownUser\");\n                img.AccessibilityLabel = \"Unknown User\";\n                return img;\n            } \n        }\n\n        public static UIImage Avatar\n        {\n            get\n            {\n                var img = UIImage.FromBundle(\"Avatar\");\n                img.AccessibilityLabel = \"Avatar\";\n                return img;\n            }\n        }\n\n        public static UIImage DownChevron\n        {\n            get\n            {\n                var img = CreateTemplateFromAuto(\"Images/down_chevron\");\n                img.AccessibilityElementsHidden = true;\n                return img;\n            }\n        }\n\n        public static class Logos\n        {\n            public static UIImage DotComMascot { get { return UIImage.FromFile(\"Images/Logos/dotcom-mascot.png\"); } }\n            public static UIImage EnterpriseMascot { get { return UIImage.FromFile(\"Images/Logos/enterprise-mascot.png\"); } }\n        }\n\n        public static class Buttons\n        {\n            public static UIImage BlackButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Buttons/black_button\");\n                    img.AccessibilityElementsHidden = true;\n                    return img;\n                } \n            }\n\n            public static UIImage CheckButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Buttons/check\");\n                    img.AccessibilityLabel = \"Check\";\n                    return img;\n                } \n            }\n\n            public static UIImage BackButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Buttons/back\");\n                    img.AccessibilityLabel = \"Back\";\n                    return img;\n                } \n            }\n\n            public static UIImage ThreeLinesButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Buttons/three_lines\");\n                    img.AccessibilityLabel = \"Menu\";\n                    return img;\n                }\n            }\n\n            public static UIImage SortButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Buttons/sort\");\n                    img.AccessibilityLabel = \"Sort\";\n                    return img;\n                }\n            }\n        }\n\n        public static class Web\n        {\n            public static UIImage BackButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Web/back\");\n                    img.AccessibilityLabel = \"Back\";\n                    return img;\n                }\n            }\n\n            public static UIImage FowardButton\n            {\n                get\n                {\n                    var img = UIImageHelper.FromFileAuto(\"Images/Web/forward\");\n                    img.AccessibilityLabel = \"Forward\";\n                    return img;\n                }\n            }\n        }\n\n        private static UIImage CreateTemplateFromAuto(string path)\n        {\n            return UIImageHelper.FromFileAuto(path);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>Fabric</key>\n\t<dict>\n\t\t<key>APIKey</key>\n\t\t<string>64cbd285ce671bdff5629ee3d00e79e4ae834f39</string>\n\t\t<key>Kits</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>KitInfo</key>\n\t\t\t\t<dict/>\n\t\t\t\t<key>KitName</key>\n\t\t\t\t<string>Crashlytics</string>\n\t\t\t</dict>\n\t\t</array>\n\t</dict>\n\t<key>UIDeviceFamily</key>\n\t<array>\n\t\t<integer>1</integer>\n\t\t<integer>2</integer>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>MinimumOSVersion</key>\n\t<string>9.0</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>CodeHub</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.dillonbuchanan.codehub</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>2.19.1</string>\n\t<key>UIStatusBarTintParameters</key>\n\t<dict>\n\t\t<key>UINavigationBar</key>\n\t\t<dict>\n\t\t\t<key>Style</key>\n\t\t\t<string>UIBarStyleDefault</string>\n\t\t\t<key>Translucent</key>\n\t\t\t<false/>\n\t\t</dict>\n\t</dict>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n\t<key>UIPrerenderedIcon</key>\n\t<true/>\n\t<key>CFBundleURLTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleURLName</key>\n\t\t\t<string>com.dillonbuchanan.codehub</string>\n\t\t\t<key>CFBundleURLSchemes</key>\n\t\t\t<array>\n\t\t\t\t<string>codehub</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>CFBundleVersion</key>\n\t<string>2.19.1.1</string>\n\t<key>UILaunchStoryboardName</key>\n\t<string>Launch</string>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n\t<key>XSAppIconAssets</key>\n\t<string>Resources/Images.xcassets/AppIcons.appiconset</string>\n\t<key>UIAppFonts</key>\n\t<array>\n\t\t<string>octicons.ttf</string>\n\t</array>\n\t<key>UIStatusBarHidden</key>\n\t<true/>\n\t<key>CFBundleName</key>\n\t<string>CodeHub</string>\n\t<key>NSPhotoLibraryUsageDescription</key>\n\t<string>Photos can be uploaded to comments created within the app.</string>\n\t<key>NSCalendarsUsageDescription</key>\n\t<string>Calendar is never used within this app.</string>\n\t<key>NSPhotoLibraryAddUsageDescription</key>\n\t<string>Photos can be saved from readable content within the app.</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "CodeHub.iOS/Launch.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"12121\" systemVersion=\"16F73\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" colorMatched=\"YES\" initialViewController=\"5\">\n    <device id=\"retina4_7\" orientation=\"portrait\">\n        <adaptation id=\"fullscreen\"/>\n    </device>\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"12089\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"4\">\n            <objects>\n                <viewController id=\"5\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"2\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"3\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"6\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <subviews>\n                            <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" image=\"CodeHubLaunch.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"9\">\n                                <rect key=\"frame\" x=\"80.5\" y=\"194\" width=\"214\" height=\"279\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"width\" constant=\"214\" id=\"18\"/>\n                                    <constraint firstAttribute=\"height\" constant=\"279\" id=\"20\"/>\n                                </constraints>\n                            </imageView>\n                        </subviews>\n                        <color key=\"backgroundColor\" red=\"0.8666666666666667\" green=\"0.8666666666666667\" blue=\"0.8666666666666667\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <constraints>\n                            <constraint firstItem=\"9\" firstAttribute=\"centerY\" secondItem=\"6\" secondAttribute=\"centerY\" id=\"16\"/>\n                            <constraint firstItem=\"9\" firstAttribute=\"centerX\" secondItem=\"6\" secondAttribute=\"centerX\" id=\"17\"/>\n                        </constraints>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"7\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"420\" y=\"77\"/>\n        </scene>\n    </scenes>\n    <resources>\n        <image name=\"CodeHubLaunch.png\" width=\"320\" height=\"423\"/>\n    </resources>\n    <simulatedMetricsContainer key=\"defaultSimulatedMetrics\">\n        <simulatedStatusBarMetrics key=\"statusBar\"/>\n        <simulatedOrientationMetrics key=\"orientation\"/>\n        <simulatedScreenMetrics key=\"destination\" type=\"retina4_7.fullscreen\"/>\n    </simulatedMetricsContainer>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/LinkerPleaseInclude.cs",
    "content": "﻿using MvvmCross.Platform.IoC;\n\nnamespace CodeHub.iOS\n{\n    [Preserve]\n    public class LinkerPleaseInclude\n    {\n        public void Include(MvxPropertyInjector injector){\n            injector = new MvxPropertyInjector ();\n        } \n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/OcticonExtensions.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.IO;\nusing Foundation;\nusing CodeHub.iOS;\n\n// Analysis disable once CheckNamespace\nnamespace CodeHub\n{\n    public static class OcticonExtensions\n    {\n        private static readonly nfloat Scale;\n\n        static OcticonExtensions()\n        {\n            Scale = UIScreen.MainScreen.Scale;\n        }\n\n        public static UIImage ToImage(this Octicon @this, nfloat size, bool cache = true)\n        {\n            var cacheDir = NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.CachesDirectory, NSSearchPathDomain.User)[0].Path;\n\n            string extension = string.Empty;\n            if (Scale > 1 && Scale < 3)\n            {\n                extension = \"@2x\";\n            }\n            else if (Scale >= 3)\n            {\n                extension = \"@3x\";\n            }\n\n            var fileName = string.Format(\"octicon-{0}-{1}{2}.png\", (int)@this.CharacterCode, size, extension);\n            var combinedPath = Path.Combine(cacheDir, fileName);\n\n            if (File.Exists(combinedPath))\n            {\n                var img = cache ? UIImage.FromBundle(combinedPath) : UIImage.FromFile(combinedPath);\n                return img.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);\n            }\n            else\n            {\n                var img = Graphics.ImageFromFont(UIFont.FromName(\"octicons\", size), @this.CharacterCode, UIColor.Black);\n                if (img == null)\n                    return null;\n                var pngData = img.AsPNG();\n                pngData.Save(combinedPath, false);\n                return img.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);\n            }\n        }\n\n        public static UIImage ToImage(this Octicon @this, bool cache = true)\n        {\n            return @this.ToImage(24f, cache);\n        }\n\n        public static UIImage ToEmptyListImage(this Octicon @this)\n        {\n            return @this.ToImage(64f, false);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Properties/AssemblyInfo.cs",
    "content": "using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"CodeHub.iOS\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"CodeHub.iOS\")]\r\n[assembly: AssemblyCopyright(\"Copyright ©  2013\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components.  If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"c9df8982-398d-47f9-8866-dfb43e171801\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n//      Major Version\r\n//      Minor Version \r\n//      Build Number\r\n//      Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n"
  },
  {
    "path": "CodeHub.iOS/Resources/Images.xcassets/AppIcons.appiconset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"size\": \"20x20\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"size\": \"20x20\",\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-Small@2x.png\",\n      \"size\": \"29x29\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-Small@3x.png\",\n      \"size\": \"29x29\",\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-Small-40@2x.png\",\n      \"size\": \"40x40\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-Small-40@3x.png\",\n      \"size\": \"40x40\",\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-60@2x.png\",\n      \"size\": \"60x60\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"filename\": \"Icon-60@3x.png\",\n      \"size\": \"60x60\",\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"size\": \"20x20\",\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"size\": \"20x20\",\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-Small.png\",\n      \"size\": \"29x29\",\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-Small@2x.png\",\n      \"size\": \"29x29\",\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-Small-40.png\",\n      \"size\": \"40x40\",\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-Small-40@2x.png\",\n      \"size\": \"40x40\",\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-167.png\",\n      \"size\": \"83.5x83.5\",\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-76.png\",\n      \"size\": \"76x76\",\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"Icon-76@2x.png\",\n      \"size\": \"76x76\",\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"filename\": \"appstore.png\",\n      \"size\": \"1024x1024\",\n      \"scale\": \"1x\",\n      \"idiom\": \"ios-marketing\"\n    },\n    {\n      \"role\": \"notificationCenter\",\n      \"size\": \"24x24\",\n      \"subtype\": \"38mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"notificationCenter\",\n      \"size\": \"27.5x27.5\",\n      \"subtype\": \"42mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"companionSettings\",\n      \"size\": \"29x29\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"companionSettings\",\n      \"size\": \"29x29\",\n      \"scale\": \"3x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"appLauncher\",\n      \"size\": \"40x40\",\n      \"subtype\": \"38mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"longLook\",\n      \"size\": \"44x44\",\n      \"subtype\": \"42mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"quickLook\",\n      \"size\": \"86x86\",\n      \"subtype\": \"38mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"role\": \"quickLook\",\n      \"size\": \"98x98\",\n      \"subtype\": \"42mm\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"size\": \"16x16\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"16x16\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"32x32\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"32x32\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"128x128\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"128x128\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"256x256\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"256x256\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"512x512\",\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"size\": \"512x512\",\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\"\n  }\n}"
  },
  {
    "path": "CodeHub.iOS/Resources/Images.xcassets/Avatar.imageset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"idiom\": \"universal\"\n    },\n    {\n      \"filename\": \"avatar.png\",\n      \"scale\": \"1x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"filename\": \"avatar@2x.png\",\n      \"scale\": \"2x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"scale\": \"3x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"subtype\": \"retina4\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"idiom\": \"watch\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"screenWidth\": \"{130,145}\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"screenWidth\": \"{146,165}\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"idiom\": \"mac\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\"\n  }\n}"
  },
  {
    "path": "CodeHub.iOS/Resources/Images.xcassets/UnknownUser.imageset/Contents.json",
    "content": "{\n  \"images\": [\n    {\n      \"idiom\": \"universal\"\n    },\n    {\n      \"filename\": \"login_user_unknown.png\",\n      \"scale\": \"1x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"filename\": \"login_user_unknown@2x.png\",\n      \"scale\": \"2x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"scale\": \"3x\",\n      \"idiom\": \"universal\"\n    },\n    {\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"subtype\": \"retina4\",\n      \"scale\": \"2x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"scale\": \"3x\",\n      \"idiom\": \"iphone\"\n    },\n    {\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"ipad\"\n    },\n    {\n      \"idiom\": \"watch\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"screenWidth\": \"{130,145}\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"screenWidth\": \"{146,165}\",\n      \"scale\": \"2x\",\n      \"idiom\": \"watch\"\n    },\n    {\n      \"idiom\": \"mac\"\n    },\n    {\n      \"scale\": \"1x\",\n      \"idiom\": \"mac\"\n    },\n    {\n      \"scale\": \"2x\",\n      \"idiom\": \"mac\"\n    }\n  ],\n  \"info\": {\n    \"version\": 1,\n    \"author\": \"xcode\",\n    \"template-rendering-intent\": \"template\"\n  }\n}"
  },
  {
    "path": "CodeHub.iOS/Services/AlertDialogService.cs",
    "content": "\nusing System;\nusing CodeHub.Core.Services;\nusing UIKit;\nusing System.Threading.Tasks;\nusing Foundation;\nusing CoreGraphics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing BigTed;\n\nnamespace CodeHub.iOS.Services\n{\n    public class AlertDialogService : IAlertDialogService\n    {\n        public Task<bool> PromptYesNo(string title, string message)\n        {\n            var tcs = new TaskCompletionSource<bool>();\n            var alert = new UIAlertView {Title = title, Message = message};\n            alert.CancelButtonIndex = alert.AddButton(\"No\");\n            var ok = alert.AddButton(\"Yes\");\n            alert.Clicked += (sender, e) => tcs.TrySetResult(e.ButtonIndex == ok);\n            alert.Show();\n            return tcs.Task;\n        }\n\n        public Task Alert(string title, string message)\n        {\n            var tcs = new TaskCompletionSource<object>();\n            ShowAlert(title, message, () => tcs.TrySetResult(null));\n            return tcs.Task;\n        }\n\n        public static void ShowAlert(string title, string message, Action dismissed = null)\n        {\n            var window = new UIWindow(UIScreen.MainScreen.Bounds);\n            window.RootViewController = new UIViewController();\n\n            var alert = UIAlertController.Create(title, message, UIAlertControllerStyle.Alert);\n            alert.AddAction(UIAlertAction.Create(\"Ok\", UIAlertActionStyle.Default, x => {\n                dismissed?.Invoke();\n                alert.Dispose();\n                window.Dispose();\n            }));\n\n            var topWindow = UIApplication.SharedApplication.Windows.Last();\n            window.WindowLevel = topWindow.WindowLevel + 1;\n\n            window.MakeKeyAndVisible();\n            window.RootViewController.PresentViewController(alert, true, null);\n        }\n\n        public static void Share(string title = null, string body = null, string url = null, UIBarButtonItem barButtonItem = null)\n        {\n            try\n            {\n                var activityItems = new List<NSObject>();\n                if (body != null)\n                    activityItems.Add(new NSString(body));\n                if (url != null)\n                    activityItems.Add(new NSUrl(url));\n\n                UIActivity[] applicationActivities = null;\n                var activityController = new UIActivityViewController (activityItems.ToArray(), applicationActivities);\n\n                if (title != null)\n                activityController.SetValueForKey(new NSString(title), new NSString(\"subject\"));\n\n                if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) \n                {\n                    var window = UIApplication.SharedApplication.KeyWindow;\n                    var pop = new UIPopoverController (activityController);\n\n                    if (barButtonItem != null)\n                    {\n                        pop.PresentFromBarButtonItem(barButtonItem, UIPopoverArrowDirection.Any, true);\n                    }\n                    else\n                    {\n                        var rect = new CGRect(window.RootViewController.View.Frame.Width / 2, window.RootViewController.View.Frame.Height / 2, 0, 0);\n                        pop.PresentFromRect (rect, window.RootViewController.View, UIPopoverArrowDirection.Any, true);\n                    }\n                } \n                else \n                {\n                    var viewController = UIApplication.SharedApplication.KeyWindow.GetVisibleViewController();\n                    viewController.PresentViewController(activityController, true, null);\n                }\n            }\n            catch\n            {\n            }\n        }\n\n        public Task<string> PromptTextBox(string title, string message, string defaultValue, string okTitle)\n        {\n            var tcs = new TaskCompletionSource<string>();\n            var alert = new UIAlertView();\n            alert.Title = title;\n            alert.Message = message;\n            alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput;\n            var cancelButton = alert.AddButton(\"Cancel\");\n            var okButton = alert.AddButton(okTitle);\n            alert.CancelButtonIndex = cancelButton;\n            alert.GetTextField(0).Text = defaultValue;\n            alert.Clicked += (s, e) =>\n            {\n                if (e.ButtonIndex == okButton)\n                    tcs.SetResult(alert.GetTextField(0).Text);\n                else\n                    tcs.SetCanceled();\n            };\n            alert.Show();\n            return tcs.Task;\n        }\n\n        public static UIColor BackgroundTint;\n\n        public void Show(string text)\n        {\n            ProgressHUD.Shared.HudBackgroundColour = BackgroundTint;\n            BTProgressHUD.Show(text, maskType: ProgressHUD.MaskType.Gradient);\n            UIApplication.SharedApplication.BeginIgnoringInteractionEvents();\n        }\n\n        public void ShowSuccess(string text)\n        {\n            BTProgressHUD.ShowSuccessWithStatus(text);\n        }\n\n        public void ShowError(string text)\n        {\n            BTProgressHUD.ShowErrorWithStatus(text);\n        }\n\n        public void Hide()\n        {\n            BTProgressHUD.Dismiss();\n            UIApplication.SharedApplication.EndIgnoringInteractionEvents();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Services/FeaturesService.cs",
    "content": "using CodeHub.Core.Services;\nusing System.Threading.Tasks;\nusing UIKit;\nusing Plugin.Settings.Abstractions;\nusing Plugin.Settings;\n\nnamespace CodeHub.iOS.Services\n{\n    public class FeaturesService : IFeaturesService\n    {\n        private readonly ISettings _defaultValueService;\n        private readonly IInAppPurchaseService _inAppPurchaseService;\n   \n        public const string ProEdition = \"com.dillonbuchanan.codehub.pro\";\n        public const string EnterpriseEdition = \"com.dillonbuchanan.codehub.enterprise_support\";\n        public const string PushNotifications = \"com.dillonbuchanan.codehub.push\";\n\n        public FeaturesService(IInAppPurchaseService inAppPurchaseService)\n        {\n            _defaultValueService = CrossSettings.Current;\n            _inAppPurchaseService = inAppPurchaseService;\n        }\n\n        public bool IsProEnabled\n        {\n            get\n            {\n                return IsActivated(ProEdition);\n            }\n        }\n\n        public async Task ActivatePro()\n        {\n            await _inAppPurchaseService.PurchaseProduct(ProEdition);\n            ActivateUserNotifications();\n        }\n\n        public void ActivateProDirect()\n        {\n            _defaultValueService.AddOrUpdateValue(ProEdition, true);\n        }\n\n        public async Task RestorePro()\n        {\n            await _inAppPurchaseService.Restore();\n            ActivateUserNotifications();\n        }\n\n        private bool IsActivated(string id)\n        {\n            return _defaultValueService.GetValueOrDefault(id, false);\n        }\n\n        private void ActivateUserNotifications()\n        {\n            if (IsProEnabled)\n            {\n                var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;\n                appDelegate?.RegisterUserForNotifications();\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Services/InAppPurchaseService.cs",
    "content": "﻿using System;\nusing StoreKit;\nusing System.Threading.Tasks;\nusing Foundation;\nusing System.Collections.Generic;\nusing System.Reactive.Subjects;\nusing System.Linq;\nusing Splat;\nusing Plugin.Settings;\n\nnamespace CodeHub.iOS.Services\n{\n    public interface IInAppPurchaseService\n    {\n        Task<SKProductsResponse> RequestProductData(params string[] productIds);\n\n        Task Restore();\n\n        Task PurchaseProduct(string productId);\n\n        IObservable<Exception> ThrownExceptions { get; }\n    }\n\n    public class InAppPurchaseService : IInAppPurchaseService, IEnableLogger\n    {\n        private readonly TransactionObserver _observer;\n        private TaskCompletionSource<bool> _actionSource;\n        private TaskCompletionSource<bool> _restoreSource;\n        private readonly LinkedList<object> _productDataRequests = new LinkedList<object>();\n        private readonly ISubject<Exception> _errorSubject = new Subject<Exception>();\n\n        public IObservable<Exception> ThrownExceptions { get { return _errorSubject; } }\n\n        public InAppPurchaseService()\n        {\n            _observer = new TransactionObserver(this);\n            SKPaymentQueue.DefaultQueue.AddTransactionObserver(_observer);\n        }\n\n        public async Task<SKProductsResponse> RequestProductData (params string[] productIds)\n        {\n            var array = new NSString[productIds.Length];\n            for (var i = 0; i < productIds.Length; i++)\n                array[i] = new NSString(productIds[i]);\n\n            var tcs = new TaskCompletionSource<SKProductsResponse>();\n            _productDataRequests.AddLast(tcs);\n\n            try\n            {\n                var productIdentifiers = NSSet.MakeNSObjectSet<NSString>(array); //NSSet.MakeNSObjectSet<NSString>(array);​​​\n                var productsRequest = new SKProductsRequest(productIdentifiers);\n                productsRequest.ReceivedResponse += (sender, e) => tcs.SetResult(e.Response);\n                productsRequest.RequestFailed += (sender, e) => tcs.SetException(new Exception(e.Error.LocalizedDescription));\n                productsRequest.Start();\n                if (await Task.WhenAny(tcs.Task, Task.Delay(TimeSpan.FromSeconds(30))) != tcs.Task)\n                    throw new InvalidOperationException(\"Timeout waiting for Apple to respond\");\n                var ret = tcs.Task.Result;\n                productsRequest.Dispose();\n                return ret;\n            }\n            finally\n            {\n                _productDataRequests.Remove(tcs);\n            }\n        }\n\n        public static bool CanMakePayments()\n        {\n            return SKPaymentQueue.CanMakePayments;        \n        }\n\n        public Task Restore()\n        {\n            this.Log().Debug(\"Preparing to restore purchases\");\n            _restoreSource = new TaskCompletionSource<bool>();\n            SKPaymentQueue.DefaultQueue.RestoreCompletedTransactions();\n            return _restoreSource.Task;\n        }\n\n        public async Task PurchaseProduct(string productId)\n        {\n            this.Log().Debug(\"Preparing to purchase: \" + productId);\n            _actionSource = new TaskCompletionSource<bool>();\n            var payment = SKMutablePayment.PaymentWithProduct(productId);\n            SKPaymentQueue.DefaultQueue.AddPayment (payment);\n            await _actionSource.Task;\n        }\n\n        private void CompleteTransaction (SKPaymentTransaction transaction)\n        {\n            var productId = transaction?.Payment?.ProductIdentifier;\n            if (productId == null)\n                throw new Exception(\"Unable to complete transaction as iTunes returned an empty product identifier!\");\n\n            CrossSettings.Current.AddOrUpdateValue(productId, true);\n            _actionSource?.TrySetResult(true);\n        }\n\n        private void RestoreTransaction (SKPaymentTransaction transaction)\n        {\n            var productId = transaction?.Payment?.ProductIdentifier;\n            if (productId == null)\n                throw new Exception(\"Unable to restore transaction as iTunes returned an empty product identifier!\");\n\n            CrossSettings.Current.AddOrUpdateValue(productId, true);\n\n            if (productId == FeaturesService.EnterpriseEdition ||\n                productId == FeaturesService.PushNotifications)\n                Core.Settings.IsProEnabled = true;\n        }\n\n        private void FailedTransaction (SKPaymentTransaction transaction)\n        {\n            var errorString = transaction?.Error?.LocalizedDescription ?? \"Unable to process transaction!\";\n            _actionSource?.TrySetException(new Exception(errorString));\n        }\n\n        private void DeferedTransaction()\n        {\n            const string errorString = \"Parental controls are active. After approval, the purchase will be complete.\";\n            _actionSource?.TrySetException(new Exception(errorString));\n        }\n\n        private class TransactionObserver : SKPaymentTransactionObserver, IEnableLogger\n        {\n            private readonly InAppPurchaseService _inAppPurchases;\n\n            public TransactionObserver(InAppPurchaseService inAppPurchases)\n            {\n                _inAppPurchases = inAppPurchases;\n            }\n\n            public override void UpdatedTransactions(SKPaymentQueue queue, SKPaymentTransaction[] transactions)\n            {\n                foreach (var transaction in transactions.Where(x => x != null))\n                {\n                    this.Log().Debug(\"UpdatedTransactions: \" + transaction.TransactionState);\n\n                    try\n                    {\n                        switch (transaction.TransactionState)\n                        {\n                            case SKPaymentTransactionState.Purchased:\n                                _inAppPurchases.CompleteTransaction(transaction);\n                                SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);\n                                break;\n                            case SKPaymentTransactionState.Failed:\n                                _inAppPurchases.FailedTransaction(transaction);\n                                SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);\n                                break;\n                            case SKPaymentTransactionState.Restored:\n                                _inAppPurchases.RestoreTransaction(transaction);\n                                SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);\n                                break;\n                            case SKPaymentTransactionState.Deferred:\n                                _inAppPurchases.DeferedTransaction();\n                                SKPaymentQueue.DefaultQueue.FinishTransaction(transaction);\n                                break;\n                        }\n                    }\n                    catch (Exception e)\n                    {\n                        _inAppPurchases._errorSubject.OnNext(e);\n                    }\n                }\n            }\n\n            public override void RestoreCompletedTransactionsFinished(SKPaymentQueue queue)\n            {\n                this.Log().Debug(\"Payment queue restore complete\");\n                _inAppPurchases._restoreSource?.TrySetResult(true);\n            }\n\n            public override void RestoreCompletedTransactionsFailedWithError (SKPaymentQueue queue, NSError error)\n            {\n                this.Log().Debug(\"Restore completed with error: \" + error);\n\n                if (error.Code == 2)\n                {\n                    _inAppPurchases._restoreSource?.TrySetCanceled();\n                }\n                else\n                {\n                    var errorMessage = error.LocalizedDescription ?? \"Unable to restore purchase due to unknown reason.\";\n                    _inAppPurchases._restoreSource?.TrySetException(new Exception(errorMessage));\n                }\n            }\n        }\n    }\n\n    public static class SKProductExtension \n    {\n        public static string LocalizedPrice (this SKProduct product)\n        {\n            var formatter = new NSNumberFormatter ();\n            formatter.FormatterBehavior = NSNumberFormatterBehavior.Version_10_4;  \n            formatter.NumberStyle = NSNumberFormatterStyle.Currency;\n            formatter.Locale = product.PriceLocale;\n            var formattedString = formatter.StringFromNumber(product.Price);\n            return formattedString;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Services/MarkdownService.cs",
    "content": "using JavaScriptCore;\r\nusing Foundation;\r\nusing CodeHub.Core.Services;\r\nusing System.Threading.Tasks;\n\nnamespace CodeHub.iOS.Services\n{\n    public class MarkdownService : IMarkdownService\n    {\n        private readonly JSVirtualMachine _vm = new JSVirtualMachine();\n        private readonly JSContext _ctx;\n        private readonly JSValue _val;\n\n        public MarkdownService()\n        {\n            _ctx = new JSContext(_vm);\n            var script = System.IO.File.ReadAllText(\"WebResources/marked.js\", System.Text.Encoding.UTF8);\n            _ctx.EvaluateScript(script);\n            _val = _ctx[new NSString(\"marked\")];\n        }\n\n        public Task<string> Convert(string c)\n        {\n            if (string.IsNullOrEmpty(c))\n                return Task.FromResult(string.Empty);\r\n            return Task.Run(() => _val.Call(JSValue.From(c, _ctx)).ToString());\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Services/NetworkActivityService.cs",
    "content": "﻿using CodeHub.Core.Services;\nusing CodeHub.iOS.Utilities;\n\nnamespace CodeHub.iOS.Services\n{\n    public class NetworkActivityService : INetworkActivityService\n    {\n        public void PopNetworkActive()\n        {\n            NetworkActivity.PopNetworkActive();\n        }\n\n        public void PushNetworkActive()\n        {\n            NetworkActivity.PushNetworkActive();\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Services/PushNotificationsService.cs",
    "content": "using System;\nusing CodeHub.Core.Services;\nusing UIKit;\nusing System.Net.Http;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing MvvmCross.Platform;\nusing ObjCRuntime;\n\nnamespace CodeHub.iOS.Services\n{\n    public class PushNotificationsService : IPushNotificationsService\n    {\n        private const string RegisterUri = \"https://push.codehub-app.com/register\";\n        private const string DeregisterUri = \"https://push.codehub-app.com/unregister\";\n\n        public async Task Register()\n        {\n            if (Runtime.Arch == Arch.SIMULATOR)\n                return;\n\n            var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;\n            if (string.IsNullOrEmpty(appDelegate.DeviceToken))\n            {\n                appDelegate.RegisterUserForNotifications();\n                for (var i = 0; i < 5; i++)\n                {\n                    if (!string.IsNullOrEmpty(appDelegate.DeviceToken))\n                        break;\n                    await Task.Delay(TimeSpan.FromSeconds(1));\n                }\n            }\n\n            if (string.IsNullOrEmpty(appDelegate.DeviceToken))\n                throw new InvalidOperationException(\"Unable to activate push notifications. Please check your iOS notifications settings.\");\n\n            var applicationService = Mvx.Resolve<IApplicationService>();\n            var user = applicationService.Account;\n            if (user.IsEnterprise)\n                throw new InvalidOperationException(\"Push notifications are for GitHub.com accounts only!\");\n\n            var client = new HttpClient();\n            var content = new FormUrlEncodedContent(new[] \n            {\n                new KeyValuePair<string, string>(\"token\", appDelegate.DeviceToken),\n                new KeyValuePair<string, string>(\"user\", user.Username),\n                new KeyValuePair<string, string>(\"domain\", \"https://api.github.com\"),\n                new KeyValuePair<string, string>(\"oauth\", user.OAuth)\n            });\n\n            client.Timeout = new TimeSpan(0, 0, 30);\n            var response = await client.PostAsync(RegisterUri, content);\n            if (response.StatusCode != System.Net.HttpStatusCode.OK && response.StatusCode != System.Net.HttpStatusCode.Conflict)\n                throw new InvalidOperationException(\"Unable to register! Server returned a \" + response.StatusCode + \" status code\");\n        }\n\n        public async Task Deregister()\n        {\n            var del = (AppDelegate)UIApplication.SharedApplication.Delegate;\n\n            if (string.IsNullOrEmpty(del.DeviceToken))\n                return;\n\n            var user = Mvx.Resolve<IApplicationService>().Account;\n            if (user.IsEnterprise)\n                throw new InvalidOperationException(\"Push notifications are for GitHub.com accounts only!\");\n\n            var client = new HttpClient();\n            var content = new FormUrlEncodedContent(new[] \n            {\n                new KeyValuePair<string, string>(\"token\", del.DeviceToken),\n                new KeyValuePair<string, string>(\"oauth\", user.OAuth),\n                new KeyValuePair<string, string>(\"user\", user.Username),\n                new KeyValuePair<string, string>(\"domain\", \"https://api.github.com\"),\n            });\n\n            client.Timeout = new TimeSpan(0, 0, 30);\n            var response = await client.PostAsync(DeregisterUri, content);\n            if (response.StatusCode != System.Net.HttpStatusCode.NotFound && response.StatusCode != System.Net.HttpStatusCode.OK)\n                throw new InvalidOperationException(\"Unable to deregister! Server returned a \" + response.StatusCode + \" status code\");\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Setup.cs",
    "content": "// --------------------------------------------------------------------------------------------------------------------\n// <summary>\n//    Defines the Setup type.\n// </summary>\n// --------------------------------------------------------------------------------------------------------------------\n\nusing System.Collections.Generic;\nusing System.Reflection;\nusing UIKit;\nusing MvvmCross.iOS.Platform;\nusing MvvmCross.iOS.Views.Presenters;\nusing MvvmCross.Binding.BindingContext;\nusing MvvmCross.Platform.IoC;\nusing CodeHub.Core.ViewModels.App;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS\n{\n    using MvvmCross.Core.ViewModels;\n\n    /// <summary>\n    ///    Defines the Setup type.\n    /// </summary>\n    public class Setup : MvxIosSetup\n    {\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Setup\"/> class.\n        /// </summary>\n        /// <param name=\"applicationDelegate\">The application delegate.</param>\n        /// <param name=\"presenter\">The presenter.</param>\n        public Setup(MvxApplicationDelegate applicationDelegate, IMvxIosViewPresenter presenter)\n            : base(applicationDelegate, presenter)\n        {\n        }\n\n        protected override MvvmCross.Platform.Platform.IMvxTrace CreateDebugTrace()\n        {\n            #if DEBUG\n            return base.CreateDebugTrace();\n            #else\n            return new EmptyTrace();\n            #endif\n        }\n\n        protected override IEnumerable<Assembly> GetViewModelAssemblies()\n        {\n            var list = new List<Assembly>();\n            list.AddRange(base.GetViewModelAssemblies());\n            list.Add(typeof(StartupViewModel).Assembly);\n            return list.ToArray();\n        }\n\n        protected override void FillBindingNames(IMvxBindingNameRegistry obj)\n        {\n            base.FillBindingNames(obj);\n            obj.AddOrOverwrite(typeof(StringElement), \"Tapped\");\n            obj.AddOrOverwrite(typeof(UISegmentedControl), \"ValueChanged\");\n        }\n\n        /// <summary>\n        /// Creates the app.\n        /// </summary>\n        /// <returns>An instance of IMvxApplication</returns>\n        protected override IMvxApplication CreateApp()\n        {\n            this.CreatableTypes(typeof(Core.App).Assembly)\n                .EndingWith(\"Service\")\n                .AsInterfaces()\n                .RegisterAsLazySingleton();\n\n            this.CreatableTypes()\n                .EndingWith(\"Service\")\n                .AsInterfaces()\n                .RegisterAsLazySingleton();\n\n            return new Core.App();\n        }\n\n        private class EmptyTrace : MvvmCross.Platform.Platform.IMvxTrace\n        {\n            public void Trace(MvvmCross.Platform.Platform.MvxTraceLevel level, string tag, System.Func<string> message)\n            {\n            }\n            public void Trace(MvvmCross.Platform.Platform.MvxTraceLevel level, string tag, string message)\n            {\n            }\n            public void Trace(MvvmCross.Platform.Platform.MvxTraceLevel level, string tag, string message, params object[] args)\n            {\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/CommitCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.Utilities;\nusing ObjCRuntime;\nusing Humanizer;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class CommitCellView : UITableViewCell\n    {\n        public static readonly UINib Nib = UINib.FromName(\"CommitCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"CommitCellView\");\n        private static nfloat DefaultContentConstraintSize = 0.0f;\n\n        public CommitCellView()\n        {\n        }\n\n        public CommitCellView(IntPtr handle) \n            : base(handle)\n        {\n        }\n\n        public static CommitCellView Create()\n        {\n            var cell = new CommitCellView();\n            var views = NSBundle.MainBundle.LoadNib(\"CommitCellView\", cell, null);\n            return Runtime.GetNSObject( views.ValueAt(0) ) as CommitCellView;\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n\n            MainImageView.Layer.MasksToBounds = true;\n            MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f;\n            SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0);\n\n            TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor;\n            TimeLabel.TextColor = UIColor.Gray;\n            ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n            DefaultContentConstraintSize = ContentConstraint.Constant;\n        }\n\n        public void Set(string title, string description, DateTimeOffset time, GitHubAvatar avatar)\n        {\n            ContentConstraint.Constant = string.IsNullOrEmpty(description) ? 0f : DefaultContentConstraintSize;\n            TitleLabel.Text = title;\n            ContentLabel.Text = description;\n            TimeLabel.Text = time.Humanize();\n            MainImageView.SetAvatar(avatar);\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            ReleaseDesignerOutlets();\n            base.Dispose(disposing);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/CommitCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    [Register (\"CommitCellView\")]\n    partial class CommitCellView\n    {\n        [Outlet]\n        UIKit.NSLayoutConstraint ContentConstraint { get; set; }\n\n        [Outlet]\n        UIKit.UILabel ContentLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView MainImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TimeLabel { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TitleLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (ContentLabel != null) {\n                ContentLabel.Dispose ();\n                ContentLabel = null;\n            }\n\n            if (MainImageView != null) {\n                MainImageView.Dispose ();\n                MainImageView = null;\n            }\n\n            if (TimeLabel != null) {\n                TimeLabel.Dispose ();\n                TimeLabel = null;\n            }\n\n            if (TitleLabel != null) {\n                TitleLabel.Dispose ();\n                TitleLabel = null;\n            }\n\n            if (ContentConstraint != null) {\n                ContentConstraint.Dispose ();\n                ContentConstraint = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/CommitCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"default\" indentationWidth=\"10\" rowHeight=\"184\" id=\"cxk-wN-pdQ\" customClass=\"CommitCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"184\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"cxk-wN-pdQ\" id=\"YTl-1W-gDM\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"183\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"User Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"t8o-AX-aOj\">\n                        <rect key=\"frame\" x=\"48\" y=\"7\" width=\"264\" height=\"20\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"Time Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"KOS-3J-OAt\">\n                        <rect key=\"frame\" x=\"48\" y=\"28\" width=\"264\" height=\"15\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" verticalCompressionResistancePriority=\"1000\" text=\"Content\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"OkK-9y-U4D\">\n                        <rect key=\"frame\" x=\"48\" y=\"49\" width=\"264\" height=\"126\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleSubhead\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"QEc-1F-ogM\">\n                        <rect key=\"frame\" x=\"8\" y=\"8\" width=\"32\" height=\"32\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"32\" id=\"FDD-ZS-YQg\"/>\n                            <constraint firstAttribute=\"width\" constant=\"32\" id=\"b9S-L7-7cL\"/>\n                        </constraints>\n                    </imageView>\n                </subviews>\n                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                <constraints>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"8\" id=\"56b-yc-H0B\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"7\" id=\"DL8-YT-wOO\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"leading\" id=\"GLI-Pv-7pu\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"trailing\" constant=\"8\" id=\"Orf-4s-y46\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"trailing\" constant=\"8\" id=\"Xow-LE-tBp\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"top\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"bottom\" constant=\"6\" id=\"Z5t-DH-Uft\"/>\n                    <constraint firstAttribute=\"bottom\" secondItem=\"OkK-9y-U4D\" secondAttribute=\"bottom\" constant=\"8\" id=\"eeX-RN-QPu\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"leading\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"leading\" id=\"mAH-Sq-iyS\"/>\n                    <constraint firstItem=\"KOS-3J-OAt\" firstAttribute=\"top\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"bottom\" constant=\"1\" id=\"nsk-Cc-3Ma\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"trailing\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"trailing\" id=\"oiC-2I-L7F\"/>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leading\" constant=\"8\" id=\"qBH-3c-Ab3\"/>\n                    <constraint firstAttribute=\"bottom\" relation=\"greaterThanOrEqual\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"bottom\" constant=\"8\" id=\"upH-tV-rBV\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"trailing\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"trailing\" id=\"vhK-hi-jpc\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n            <connections>\n                <outlet property=\"ContentConstraint\" destination=\"Z5t-DH-Uft\" id=\"0B2-Cd-Gsi\"/>\n                <outlet property=\"ContentLabel\" destination=\"OkK-9y-U4D\" id=\"JHo-No-foG\"/>\n                <outlet property=\"MainImageView\" destination=\"QEc-1F-ogM\" id=\"hKO-Ko-teH\"/>\n                <outlet property=\"TimeLabel\" destination=\"KOS-3J-OAt\" id=\"1y1-le-85X\"/>\n                <outlet property=\"TitleLabel\" destination=\"t8o-AX-aOj\" id=\"tvX-cZ-BXq\"/>\n            </connections>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/FeedbackCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.ViewModels.App;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing SDWebImage;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class FeedbackCellView : ReactiveTableViewCell<FeedbackItemViewModel>\n    {\n        public static readonly UINib Nib = UINib.FromName(\"FeedbackCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"FeedbackCellView\");\n        private static nfloat DefaultContentConstraintSize = 0.0f;\n\n        public FeedbackCellView(IntPtr handle) \n            : base(handle)\n        {\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n\n            MainImageView.Layer.MasksToBounds = true;\n            MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f;\n            ContentView.Opaque = true;\n\n            SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0);\n            TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor;\n            DetailsLabel.TextColor = UIColor.Gray;\n            DefaultContentConstraintSize = DetailsConstraint.Constant;\n\n            this.WhenAnyValue(x => x.ViewModel)\n                .Where(x => x != null)\n                .Subscribe(x => {\n\t                TitleLabel.Text = x.Title;\n\t                DetailsLabel.Text = \"Created \" + x.CreatedString;\n\t                DetailsConstraint.Constant = string.IsNullOrEmpty(DetailsLabel.Text) ? 0f : DefaultContentConstraintSize;\n\n\t                if (string.IsNullOrEmpty(x.ImageUrl))\n\t                    MainImageView.Image = Images.LoginUserUnknown;\n\t                else\n\t                    MainImageView.SetImage(new NSUrl(x.ImageUrl), Images.LoginUserUnknown);\n\t            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/FeedbackCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n\t[Register (\"FeedbackCellView\")]\n\tpartial class FeedbackCellView\n\t{\n\t\t[Outlet]\n\t\tUIKit.NSLayoutConstraint DetailsConstraint { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UILabel DetailsLabel { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIImageView MainImageView { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UILabel TitleLabel { get; set; }\n\t\t\n\t\tvoid ReleaseDesignerOutlets ()\n\t\t{\n\t\t\tif (DetailsLabel != null) {\n\t\t\t\tDetailsLabel.Dispose ();\n\t\t\t\tDetailsLabel = null;\n\t\t\t}\n\n\t\t\tif (MainImageView != null) {\n\t\t\t\tMainImageView.Dispose ();\n\t\t\t\tMainImageView = null;\n\t\t\t}\n\n\t\t\tif (TitleLabel != null) {\n\t\t\t\tTitleLabel.Dispose ();\n\t\t\t\tTitleLabel = null;\n\t\t\t}\n\n\t\t\tif (DetailsConstraint != null) {\n\t\t\t\tDetailsConstraint.Dispose ();\n\t\t\t\tDetailsConstraint = null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/FeedbackCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"6245\" systemVersion=\"14E46\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"6238\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"default\" indentationWidth=\"10\" rowHeight=\"-382\" id=\"cxk-wN-pdQ\" customClass=\"FeedbackCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"53\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"cxk-wN-pdQ\" id=\"YTl-1W-gDM\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"52\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"252\" verticalCompressionResistancePriority=\"1000\" text=\"This is a really long labe\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"eQg-VW-aam\">\n                        <rect key=\"frame\" x=\"48\" y=\"8\" width=\"264\" height=\"19\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"999\" text=\"Time Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"JYP-m4-zSf\">\n                        <rect key=\"frame\" x=\"48\" y=\"28\" width=\"264\" height=\"16\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"16\" id=\"i6b-7c-4ty\"/>\n                        </constraints>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"1y1-84-CQE\">\n                        <rect key=\"frame\" x=\"8\" y=\"9\" width=\"32\" height=\"32\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"32\" id=\"6he-eF-tca\"/>\n                            <constraint firstAttribute=\"width\" constant=\"32\" id=\"SCD-1Z-Vao\"/>\n                        </constraints>\n                    </imageView>\n                </subviews>\n                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                <constraints>\n                    <constraint firstItem=\"eQg-VW-aam\" firstAttribute=\"trailing\" secondItem=\"JYP-m4-zSf\" secondAttribute=\"trailing\" id=\"BMZ-eC-V5Z\"/>\n                    <constraint firstItem=\"1y1-84-CQE\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leading\" constant=\"8\" id=\"RJS-AE-f2N\"/>\n                    <constraint firstItem=\"1y1-84-CQE\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"9\" id=\"Y7M-dv-XdC\"/>\n                    <constraint firstItem=\"eQg-VW-aam\" firstAttribute=\"leading\" secondItem=\"1y1-84-CQE\" secondAttribute=\"trailing\" constant=\"8\" id=\"Ycz-pd-rQb\"/>\n                    <constraint firstAttribute=\"bottom\" relation=\"greaterThanOrEqual\" secondItem=\"1y1-84-CQE\" secondAttribute=\"bottom\" constant=\"9\" id=\"amN-Dy-MVt\"/>\n                    <constraint firstAttribute=\"bottom\" secondItem=\"JYP-m4-zSf\" secondAttribute=\"bottom\" constant=\"8\" id=\"bhW-1x-aXg\"/>\n                    <constraint firstItem=\"eQg-VW-aam\" firstAttribute=\"leading\" secondItem=\"JYP-m4-zSf\" secondAttribute=\"leading\" id=\"kEe-4G-x3o\"/>\n                    <constraint firstItem=\"eQg-VW-aam\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"8\" id=\"rUF-tQ-IV2\"/>\n                    <constraint firstItem=\"JYP-m4-zSf\" firstAttribute=\"top\" secondItem=\"eQg-VW-aam\" secondAttribute=\"bottom\" constant=\"1\" id=\"sab-QH-Qph\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"eQg-VW-aam\" secondAttribute=\"trailing\" constant=\"8\" id=\"ujL-sW-YFg\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n            <connections>\n                <outlet property=\"DetailsConstraint\" destination=\"sab-QH-Qph\" id=\"Mmb-l0-6HT\"/>\n                <outlet property=\"DetailsLabel\" destination=\"JYP-m4-zSf\" id=\"8RG-RM-G0M\"/>\n                <outlet property=\"MainImageView\" destination=\"1y1-84-CQE\" id=\"umK-sX-jbS\"/>\n                <outlet property=\"TitleLabel\" destination=\"eQg-VW-aam\" id=\"oLt-fP-HsS\"/>\n            </connections>\n        </tableViewCell>\n    </objects>\n    <simulatedMetricsContainer key=\"defaultSimulatedMetrics\">\n        <simulatedStatusBarMetrics key=\"statusBar\"/>\n        <simulatedOrientationMetrics key=\"orientation\"/>\n        <simulatedScreenMetrics key=\"destination\" type=\"retina4\"/>\n    </simulatedMetricsContainer>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/GistCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.Core.ViewModels.Gists;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class GistCellView : ReactiveTableViewCell<GistItemViewModel>\n    {\n        public static readonly UINib Nib = UINib.FromName(\"GistCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"GistCellView\");\n        private static nfloat DefaultContentConstraintSize = 0.0f;\n\n        public GistCellView(IntPtr handle)\n            : base(handle)\n        {\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n\n            MainImageView.Layer.MasksToBounds = true;\n            MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f;\n\n            SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0);\n            TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor;\n            TimeLabel.TextColor = Theme.CurrentTheme.MainSubtitleColor;\n            ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n            DefaultContentConstraintSize = ContentConstraint.Constant;\n\n            this.WhenAnyValue(x => x.ViewModel)\n                .Where(x => x != null)\n                .Subscribe(x =>\n\t            {\n\t                TitleLabel.Text = x.Title;\n\t                ContentLabel.Text = x.Description;\n\t                TimeLabel.Text = x.UpdatedString;\n\t                ContentConstraint.Constant = string.IsNullOrEmpty(x.Description) ? 0f : DefaultContentConstraintSize;\n\t                MainImageView.SetAvatar(x.Avatar);\n\t            });\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            ReleaseDesignerOutlets();\n            base.Dispose(disposing);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/GistCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    [Register (\"GistCellView\")]\n    partial class GistCellView\n    {\n        [Outlet]\n        UIKit.NSLayoutConstraint ContentConstraint { get; set; }\n\n        [Outlet]\n        UIKit.UILabel ContentLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView MainImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TimeLabel { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TitleLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (ContentLabel != null) {\n                ContentLabel.Dispose ();\n                ContentLabel = null;\n            }\n\n            if (MainImageView != null) {\n                MainImageView.Dispose ();\n                MainImageView = null;\n            }\n\n            if (TimeLabel != null) {\n                TimeLabel.Dispose ();\n                TimeLabel = null;\n            }\n\n            if (TitleLabel != null) {\n                TitleLabel.Dispose ();\n                TitleLabel = null;\n            }\n\n            if (ContentConstraint != null) {\n                ContentConstraint.Dispose ();\n                ContentConstraint = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/GistCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"default\" indentationWidth=\"10\" rowHeight=\"131\" id=\"cxk-wN-pdQ\" customClass=\"GistCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"184\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"cxk-wN-pdQ\" id=\"YTl-1W-gDM\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"183\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"User Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"t8o-AX-aOj\">\n                        <rect key=\"frame\" x=\"48\" y=\"7\" width=\"264\" height=\"20\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"Time Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"KOS-3J-OAt\">\n                        <rect key=\"frame\" x=\"48\" y=\"28\" width=\"264\" height=\"15\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" misplaced=\"YES\" text=\"Content\" lineBreakMode=\"tailTruncation\" numberOfLines=\"4\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"OkK-9y-U4D\">\n                        <rect key=\"frame\" x=\"48\" y=\"158\" width=\"264\" height=\"17\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleSubhead\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"QEc-1F-ogM\">\n                        <rect key=\"frame\" x=\"8\" y=\"8\" width=\"32\" height=\"32\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"32\" id=\"FDD-ZS-YQg\"/>\n                            <constraint firstAttribute=\"width\" constant=\"32\" id=\"b9S-L7-7cL\"/>\n                        </constraints>\n                    </imageView>\n                </subviews>\n                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                <constraints>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"8\" id=\"56b-yc-H0B\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"7\" id=\"DL8-YT-wOO\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"leading\" id=\"GLI-Pv-7pu\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"trailing\" constant=\"8\" id=\"Orf-4s-y46\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"trailing\" constant=\"8\" id=\"Xow-LE-tBp\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"top\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"bottom\" constant=\"6\" id=\"Z5t-DH-Uft\"/>\n                    <constraint firstAttribute=\"bottom\" secondItem=\"OkK-9y-U4D\" secondAttribute=\"bottom\" constant=\"8\" id=\"eeX-RN-QPu\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"leading\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"leading\" id=\"mAH-Sq-iyS\"/>\n                    <constraint firstItem=\"KOS-3J-OAt\" firstAttribute=\"top\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"bottom\" constant=\"1\" id=\"nsk-Cc-3Ma\"/>\n                    <constraint firstItem=\"OkK-9y-U4D\" firstAttribute=\"trailing\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"trailing\" id=\"oiC-2I-L7F\"/>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leading\" constant=\"8\" id=\"qBH-3c-Ab3\"/>\n                    <constraint firstAttribute=\"bottom\" relation=\"greaterThanOrEqual\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"bottom\" constant=\"8\" id=\"upH-tV-rBV\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"trailing\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"trailing\" id=\"vhK-hi-jpc\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n            <connections>\n                <outlet property=\"ContentConstraint\" destination=\"Z5t-DH-Uft\" id=\"0B2-Cd-Gsi\"/>\n                <outlet property=\"ContentLabel\" destination=\"OkK-9y-U4D\" id=\"JHo-No-foG\"/>\n                <outlet property=\"MainImageView\" destination=\"QEc-1F-ogM\" id=\"hKO-Ko-teH\"/>\n                <outlet property=\"TimeLabel\" destination=\"KOS-3J-OAt\" id=\"1y1-le-85X\"/>\n                <outlet property=\"TitleLabel\" destination=\"t8o-AX-aOj\" id=\"tvX-cZ-BXq\"/>\n            </connections>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/IssueCellView.cs",
    "content": "using System;\nusing CoreGraphics;\nusing Foundation;\nusing ObjCRuntime;\nusing UIKit;\nusing Humanizer;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class IssueCellView : UITableViewCell\n    {\n        public static readonly NSString Key = new NSString(\"IssueCellView\");\n\n        public static IssueCellView Create()\n        {\n            var cell = new IssueCellView();\n            var views = NSBundle.MainBundle.LoadNib(\"IssueCellView\", cell, null);\n            cell = Runtime.GetNSObject( views.ValueAt(0) ) as IssueCellView;\n\n            if (cell == null)\n            {\n                Console.WriteLine(\"Null cell!\");\n            }\n            else\n            {\n                cell.Caption.TextColor = Theme.CurrentTheme.MainTitleColor;\n                cell.Number.TextColor = Theme.CurrentTheme.MainTitleColor;\n                cell.ContentView.AddSubview(new SeperatorIssues {Frame = new CGRect(65f, 5f, 1f, cell.Frame.Height - 10f)});\n                cell.Image1.Image = Octicon.Gear.ToImage(12);\n                cell.Image2.Image = Octicon.CommentDiscussion.ToImage(12);\n                cell.Image3.Image = Octicon.Person.ToImage(12);\n                cell.Image4.Image = Octicon.Pencil.ToImage(12);\n                cell.SeparatorInset = new UIEdgeInsets(0, 0, 0, 0);\n            }\n\n            return cell;\n        }\n\n        public override NSString ReuseIdentifier\n        {\n            get\n            {\n                return Key;\n            }\n        }\n\n        public IssueCellView()\n        {\n        }\n\n        public IssueCellView(IntPtr handle)\n            : base(handle)\n        {\n        }\n\n        public void Bind(string title, string status, string priority, string assigned, DateTimeOffset lastUpdated, string id, string kind)\n        {\n            Caption.Text = title;\n            Label1.Text = status;\n            Label2.Text = priority;\n            Label3.Text = assigned;\n            Label4.Text = lastUpdated.UtcDateTime.Humanize();\n            Number.Text = \"#\" + id;\n            IssueType.Text = kind;\n        }\n\n        private class SeperatorIssues : UIView\n        {\n            public SeperatorIssues()\n            {\n            }\n\n            public SeperatorIssues(IntPtr handle)\n                : base(handle)\n            {\n            }\n\n            public override void Draw(CGRect rect)\n            {\n                base.Draw(rect);\n\n                var context = UIGraphics.GetCurrentContext();\n                using (var cs = CGColorSpace.CreateDeviceRGB ())\n                {\n                    using (var gradient = new CGGradient (cs, new nfloat [] { 1f, 1f, 1f, 1.0f, \n                        0.7f, 0.7f, 0.7f, 1f, \n                        1f, 1f, 1.0f, 1.0f }, new nfloat [] {0, 0.5f, 1f}))\n                    {\n                        context.DrawLinearGradient(gradient, new CGPoint(0, 0), new CGPoint(0, rect.Height), 0);\n                    }\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/IssueCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by MonoDevelop to store outlets and\n// actions made in the Xcode designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\r\n\r\nusing Foundation;\r\n\r\nnamespace CodeHub.iOS.TableViewCells\n{\n    [Register (\"IssueCellView\")]\n    partial class IssueCellView\n    {\n        [Outlet]\n        UIKit.UILabel Caption { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Label1 { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView Image1 { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView Image2 { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Label2 { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView Image3 { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Label3 { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView Image4 { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Label4 { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Number { get; set; }\n\n        [Outlet]\n        UIKit.UILabel IssueType { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (Caption != null) {\n                Caption.Dispose ();\n                Caption = null;\n            }\n\n            if (Label1 != null) {\n                Label1.Dispose ();\n                Label1 = null;\n            }\n\n            if (Image1 != null) {\n                Image1.Dispose ();\n                Image1 = null;\n            }\n\n            if (Image2 != null) {\n                Image2.Dispose ();\n                Image2 = null;\n            }\n\n            if (Label2 != null) {\n                Label2.Dispose ();\n                Label2 = null;\n            }\n\n            if (Image3 != null) {\n                Image3.Dispose ();\n                Image3 = null;\n            }\n\n            if (Label3 != null) {\n                Label3.Dispose ();\n                Label3 = null;\n            }\n\n            if (Image4 != null) {\n                Image4.Dispose ();\n                Image4 = null;\n            }\n\n            if (Label4 != null) {\n                Label4.Dispose ();\n                Label4 = null;\n            }\n\n            if (Number != null) {\n                Number.Dispose ();\n                Number = null;\n            }\n\n            if (IssueType != null) {\n                IssueType.Dispose ();\n                IssueType = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/IssueCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"IssueCellView\">\n            <connections>\n                <outlet property=\"Caption\" destination=\"5\" id=\"18\"/>\n                <outlet property=\"Image1\" destination=\"6\" id=\"20\"/>\n                <outlet property=\"Image2\" destination=\"8\" id=\"21\"/>\n                <outlet property=\"Image3\" destination=\"14\" id=\"36\"/>\n                <outlet property=\"Image4\" destination=\"16\" id=\"26\"/>\n                <outlet property=\"IssueType\" destination=\"46\" id=\"48\"/>\n                <outlet property=\"Label1\" destination=\"7\" id=\"19\"/>\n                <outlet property=\"Label2\" destination=\"9\" id=\"22\"/>\n                <outlet property=\"Label3\" destination=\"15\" id=\"24\"/>\n                <outlet property=\"Label4\" destination=\"17\" id=\"27\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"blue\" indentationWidth=\"10\" reuseIdentifier=\"IssueCellView\" rowHeight=\"69\" id=\"4\" customClass=\"IssueCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"69\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" opaque=\"NO\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"4\" id=\"d9n-jM-3Aq\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"68\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"13\" adjustsFontSizeToFit=\"NO\" id=\"5\">\n                        <rect key=\"frame\" x=\"76\" y=\"5\" width=\"236\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"13\"/>\n                        <color key=\"textColor\" red=\"0.0\" green=\"0.25098040700000002\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" id=\"6\">\n                        <rect key=\"frame\" x=\"76\" y=\"30\" width=\"12\" height=\"12\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                    </imageView>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" adjustsFontSizeToFit=\"NO\" id=\"7\">\n                        <rect key=\"frame\" x=\"96\" y=\"25\" width=\"83\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"12\"/>\n                        <color key=\"textColor\" white=\"0.33333333333333331\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" id=\"8\">\n                        <rect key=\"frame\" x=\"189\" y=\"30\" width=\"12\" height=\"12\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                    </imageView>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" adjustsFontSizeToFit=\"NO\" id=\"9\">\n                        <rect key=\"frame\" x=\"209\" y=\"25\" width=\"83\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"12\"/>\n                        <color key=\"textColor\" white=\"0.33333333333333331\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" id=\"14\">\n                        <rect key=\"frame\" x=\"76\" y=\"48\" width=\"12\" height=\"12\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                    </imageView>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" adjustsFontSizeToFit=\"NO\" id=\"15\">\n                        <rect key=\"frame\" x=\"96\" y=\"43\" width=\"83\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"12\"/>\n                        <color key=\"textColor\" white=\"0.33333333333333331\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" id=\"16\">\n                        <rect key=\"frame\" x=\"189\" y=\"48\" width=\"12\" height=\"12\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                    </imageView>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" adjustsFontSizeToFit=\"NO\" id=\"17\">\n                        <rect key=\"frame\" x=\"209\" y=\"43\" width=\"83\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"12\"/>\n                        <color key=\"textColor\" white=\"0.33333333333333331\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"#2101\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" id=\"45\">\n                        <rect key=\"frame\" x=\"2\" y=\"5\" width=\"60\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"13\"/>\n                        <color key=\"textColor\" red=\"0.0\" green=\"0.25098039220000001\" blue=\"0.50196078430000002\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" text=\"Enhance\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" id=\"46\">\n                        <rect key=\"frame\" x=\"2\" y=\"25\" width=\"60\" height=\"21\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                        <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"12\"/>\n                        <color key=\"textColor\" white=\"0.33333333333333331\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <color key=\"highlightedColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </label>\n                </subviews>\n            </tableViewCellContentView>\n            <connections>\n                <outlet property=\"Caption\" destination=\"5\" id=\"37\"/>\n                <outlet property=\"Image1\" destination=\"6\" id=\"32\"/>\n                <outlet property=\"Image2\" destination=\"8\" id=\"33\"/>\n                <outlet property=\"Image3\" destination=\"14\" id=\"34\"/>\n                <outlet property=\"Image4\" destination=\"16\" id=\"35\"/>\n                <outlet property=\"IssueType\" destination=\"46\" id=\"51\"/>\n                <outlet property=\"Label1\" destination=\"7\" id=\"28\"/>\n                <outlet property=\"Label2\" destination=\"9\" id=\"29\"/>\n                <outlet property=\"Label3\" destination=\"15\" id=\"30\"/>\n                <outlet property=\"Label4\" destination=\"17\" id=\"31\"/>\n                <outlet property=\"Number\" destination=\"45\" id=\"49\"/>\n            </connections>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/MilestoneTableViewCell.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.iOS.Views;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public class MilestoneTableViewCell : UITableViewCell\n    {\n        public static readonly NSString Key = new NSString(\"MilestoneTableViewCell\");\n        private readonly MilestoneView _milestoneView;\n\n        public void Init(string title, int openIssues, int closedIssues, DateTimeOffset? dueDate)\n        {\n            _milestoneView.Init(title, openIssues, closedIssues, dueDate);\n        }\n\n        public override void SetSelected(bool selected, bool animated)\n        {\n            BackgroundColor = selected ? UIColor.FromWhiteAlpha(0.9f, 1.0f) : UIColor.White;\n        }\n\n        public override void SetHighlighted(bool highlighted, bool animated)\n        {\n            BackgroundColor = highlighted ? UIColor.FromWhiteAlpha(0.9f, 1.0f) : UIColor.White;\n        }\n\n        public override NSString ReuseIdentifier\n        {\n            get\n            {\n                return Key;\n            }\n        }\n\n        public MilestoneTableViewCell()\n            : base(new CGRect(0, 0, 320f, 80))\n        {\n            AutosizesSubviews = true;\n            ContentView.AutosizesSubviews = true;\n            SeparatorInset = UIEdgeInsets.Zero;\n\n            _milestoneView = new MilestoneView();\n            _milestoneView.Frame = this.Frame;\n            _milestoneView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n            ContentView.Add(_milestoneView);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/MultilinedCellView.cs",
    "content": "﻿using System;\nusing Foundation;\nusing UIKit;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class MultilinedCellView : UITableViewCell\n    {\n        public static readonly UINib Nib = UINib.FromName(\"MultilinedCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"MultilinedCellView\");\n\n        public string Caption\n        {\n            get { return CaptionLabel.Text; }\n            set { CaptionLabel.Text = value; }\n        }\n\n        public string Details\n        {\n            get { return DetailsLabel.Text; }\n            set { DetailsLabel.Text = value; }\n        }\n\n        public MultilinedCellView(IntPtr handle)\n            : base(handle)\n        {\n            SeparatorInset = UIEdgeInsets.Zero;\n            PreservesSuperviewLayoutMargins = false;\n            LayoutMargins = UIEdgeInsets.Zero;\n        }\n\n        public static MultilinedCellView Create()\n        {\n            var cell = (MultilinedCellView)Nib.Instantiate(null, null)[0];\n            cell.CaptionLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n            cell.DetailsLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n            return cell;\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n\n            ContentView.SetNeedsLayout();\n            ContentView.LayoutIfNeeded();\n\n            CaptionLabel.PreferredMaxLayoutWidth = CaptionLabel.Frame.Width;\n            DetailsLabel.PreferredMaxLayoutWidth = DetailsLabel.Frame.Width;\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n            CaptionLabel.TextColor = DetailsLabel.TextColor = UIColor.FromRGB(41, 41, 41);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/MultilinedCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    [Register (\"MultilinedCellView\")]\n    partial class MultilinedCellView\n    {\n        [Outlet]\n        UIKit.UILabel CaptionLabel { get; set; }\n\n        [Outlet]\n        UIKit.UILabel DetailsLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (CaptionLabel != null) {\n                CaptionLabel.Dispose ();\n                CaptionLabel = null;\n            }\n\n            if (DetailsLabel != null) {\n                DetailsLabel.Dispose ();\n                DetailsLabel = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/MultilinedCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n        <capability name=\"Constraints to layout margins\" minToolsVersion=\"6.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"default\" indentationWidth=\"10\" rowHeight=\"89\" id=\"cxk-wN-pdQ\" customClass=\"MultilinedCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"89\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" opaque=\"NO\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"cxk-wN-pdQ\" id=\"YTl-1W-gDM\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"88\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"4qJ-Rc-sPx\">\n                        <rect key=\"frame\" x=\"12\" y=\"12\" width=\"296\" height=\"20\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"999\" verticalCompressionResistancePriority=\"1000\" text=\"Label\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"ZKO-n8-IjA\">\n                        <rect key=\"frame\" x=\"12\" y=\"36\" width=\"296\" height=\"40\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleBody\"/>\n                        <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                </subviews>\n                <constraints>\n                    <constraint firstAttribute=\"trailingMargin\" secondItem=\"ZKO-n8-IjA\" secondAttribute=\"trailing\" constant=\"4\" id=\"2lb-4t-L5W\"/>\n                    <constraint firstAttribute=\"trailingMargin\" secondItem=\"4qJ-Rc-sPx\" secondAttribute=\"trailing\" constant=\"4\" id=\"3no-xg-7LC\"/>\n                    <constraint firstItem=\"ZKO-n8-IjA\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leadingMargin\" constant=\"4\" id=\"5ag-vE-hza\"/>\n                    <constraint firstItem=\"4qJ-Rc-sPx\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"topMargin\" constant=\"4\" id=\"GvZ-8r-vVp\"/>\n                    <constraint firstAttribute=\"bottomMargin\" secondItem=\"ZKO-n8-IjA\" secondAttribute=\"bottom\" constant=\"4\" id=\"XFU-Ve-e8C\"/>\n                    <constraint firstItem=\"4qJ-Rc-sPx\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leadingMargin\" constant=\"4\" id=\"XJJ-vl-v7T\"/>\n                    <constraint firstItem=\"ZKO-n8-IjA\" firstAttribute=\"top\" secondItem=\"4qJ-Rc-sPx\" secondAttribute=\"bottom\" constant=\"4\" id=\"s12-Y1-Yxe\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <connections>\n                <outlet property=\"CaptionLabel\" destination=\"4qJ-Rc-sPx\" id=\"gWY-MY-kx4\"/>\n                <outlet property=\"DetailsLabel\" destination=\"ZKO-n8-IjA\" id=\"0xj-qh-9sg\"/>\n            </connections>\n            <point key=\"canvasLocation\" x=\"296\" y=\"449.5\"/>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/NewsCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing System.Collections.Generic;\nusing CodeHub.iOS;\nusing SDWebImage;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class NewsCellView : UITableViewCell\n    {\n        public static readonly UINib Nib = UINib.FromName(\"NewsCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"NewsCellView\");\n\n        public class Link\n        {\n            public NSRange Range;\n            public Action Callback;\n            public int Id;\n        }\n\n        public NewsCellView(IntPtr handle) : base(handle)\n        {\n        }\n\n        class LabelDelegate : Xamarin.TTTAttributedLabel.TTTAttributedLabelDelegate {\n\n            private readonly List<Link> _links;\n            private readonly Action<NSUrl> _webLinkClicked;\n\n            public LabelDelegate(List<Link> links, Action<NSUrl> webLinkClicked)\n            {\n                _links = links;\n                _webLinkClicked = webLinkClicked;\n            }\n\n            public override void DidSelectLinkWithURL (Xamarin.TTTAttributedLabel.TTTAttributedLabel label, NSUrl url)\n            {\n                try\n                {\n                    if (url.ToString().StartsWith(\"http\", StringComparison.Ordinal))\n                    {\n                        if (_webLinkClicked != null)\n                            _webLinkClicked(url);\n                    }\n                    else\n                    {\n                        var i = Int32.Parse(url.ToString());\n                        _links[i].Callback();\n                    }\n                }\n                catch (Exception e)\n                {\n                    Console.WriteLine(\"Unable to callback on TTTAttributedLabel: {0}\", e.Message);\n                }\n            }\n        }\n\n        public void Set(Uri imgUrl, string time, UIImage actionImage, \n            NSMutableAttributedString header, NSMutableAttributedString body, \n            List<Link> headerLinks, List<Link> bodyLinks, Action<NSUrl> webLinkClicked, bool multilined)\n        {\n            if (imgUrl == null)\n                Image.Image = Images.Avatar;\n            else\n                Image.SetImage(new NSUrl(imgUrl.AbsoluteUri), Images.Avatar);\n            \n            Time.Text = time;\n            ActionImage.Image = actionImage;\n\n            if (header == null)\n                header = new NSMutableAttributedString();\n            if (body == null)\n                body = new NSMutableAttributedString();\n\n            Header.AttributedText = header;\n            Header.Delegate = new LabelDelegate(headerLinks, webLinkClicked);\n\n            Body.AttributedText = body;\n            Body.Hidden = body.Length == 0;\n            Body.Lines = multilined ? 0 : 4;\n            Body.Delegate = new LabelDelegate(bodyLinks, webLinkClicked);\n\n            foreach (var b in headerLinks)\n                Header.AddLinkToURL(new NSUrl(b.Id.ToString()), b.Range);\n\n            foreach (var b in bodyLinks)\n                Body.AddLinkToURL(new NSUrl(b.Id.ToString()), b.Range);\n\n            AdjustableConstraint.Constant = Body.Hidden ? 0f : 6f;\n\n            AccessibilityHint = header.Value;\n        }\n\n        public static NewsCellView Create()\n        {\n            var linkAttributes = new NSMutableDictionary();\n            linkAttributes.Add(UIStringAttributeKey.UnderlineStyle, NSNumber.FromBoolean(true));\n\n            var cell = (NewsCellView)Nib.Instantiate(null, null)[0];\n\n            cell.SeparatorInset = new UIEdgeInsets(0, 48f, 0, 0);\n            cell.Body.LinkAttributes = new NSDictionary();\n            cell.Body.ActiveLinkAttributes = linkAttributes;\n            cell.Body.Lines = 4;\n            cell.Body.LineBreakMode = UILineBreakMode.TailTruncation;\n            cell.Body.AccessibilityElementsHidden = true;\n\n            cell.Header.LinkAttributes = new NSDictionary();\n            cell.Header.ActiveLinkAttributes = linkAttributes;\n            cell.Header.Lines = 2;\n            cell.Header.LineBreakMode = UILineBreakMode.TailTruncation;\n\n            cell.Image.Layer.MasksToBounds = true;\n            cell.Image.Layer.CornerRadius = cell.Image.Frame.Height / 2;\n \n            cell.ActionImage.TintColor = cell.Time.TextColor;\n\n            return cell;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/NewsCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n\t[Register (\"NewsCellView\")]\n\tpartial class NewsCellView\n\t{\n\t\t[Outlet]\n\t\tUIKit.UIImageView ActionImage { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.NSLayoutConstraint AdjustableConstraint { get; set; }\n\n\t\t[Outlet]\n\t\tXamarin.TTTAttributedLabel.TTTAttributedLabel Body { get; set; }\n\n\t\t[Outlet]\n\t\tXamarin.TTTAttributedLabel.TTTAttributedLabel Header { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIImageView Image { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UILabel Time { get; set; }\n\t\t\n\t\tvoid ReleaseDesignerOutlets ()\n\t\t{\n\t\t\tif (ActionImage != null) {\n\t\t\t\tActionImage.Dispose ();\n\t\t\t\tActionImage = null;\n\t\t\t}\n\n\t\t\tif (Body != null) {\n\t\t\t\tBody.Dispose ();\n\t\t\t\tBody = null;\n\t\t\t}\n\n\t\t\tif (Header != null) {\n\t\t\t\tHeader.Dispose ();\n\t\t\t\tHeader = null;\n\t\t\t}\n\n\t\t\tif (Image != null) {\n\t\t\t\tImage.Dispose ();\n\t\t\t\tImage = null;\n\t\t\t}\n\n\t\t\tif (Time != null) {\n\t\t\t\tTime.Dispose ();\n\t\t\t\tTime = null;\n\t\t\t}\n\n\t\t\tif (AdjustableConstraint != null) {\n\t\t\t\tAdjustableConstraint.Dispose ();\n\t\t\t\tAdjustableConstraint = null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/NewsCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"10117\" systemVersion=\"15F34\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"10085\"/>\n        <capability name=\"Constraints to layout margins\" minToolsVersion=\"6.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"gray\" indentationWidth=\"10\" reuseIdentifier=\"NewsCellView\" rowHeight=\"106\" id=\"2\" customClass=\"NewsCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"106\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" opaque=\"NO\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"2\" id=\"UoJ-D7-3PN\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"105.5\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"NX7-8T-3y3\">\n                        <rect key=\"frame\" x=\"8\" y=\"30\" width=\"32\" height=\"32\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"32\" id=\"TvC-LE-4uO\"/>\n                            <constraint firstAttribute=\"height\" constant=\"32\" id=\"ecm-Jy-Sts\"/>\n                        </constraints>\n                    </imageView>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" verticalCompressionResistancePriority=\"1000\" text=\"This is what a bunch of text looks like right here\" lineBreakMode=\"clip\" numberOfLines=\"2\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"QpW-3s-LgQ\" customClass=\"UILabelWithLinks\">\n                        <rect key=\"frame\" x=\"48\" y=\"25\" width=\"264\" height=\"47\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" relation=\"greaterThanOrEqual\" priority=\"751\" constant=\"32\" id=\"nBu-SL-m7P\"/>\n                        </constraints>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleBody\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" text=\"3 years ago\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"hu1-pJ-zF3\">\n                        <rect key=\"frame\" x=\"48\" y=\"6\" width=\"264\" height=\"15\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <color key=\"textColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" misplaced=\"YES\" text=\"Whats good?\" lineBreakMode=\"clip\" numberOfLines=\"4\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"R9K-I1-WdV\" customClass=\"UILabelWithLinks\">\n                        <rect key=\"frame\" x=\"48\" y=\"80\" width=\"264\" height=\"15\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleSubhead\"/>\n                        <color key=\"textColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"QTS-HF-RsJ\">\n                        <rect key=\"frame\" x=\"24\" y=\"6\" width=\"16\" height=\"16\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"16\" id=\"6vW-ZK-aI3\"/>\n                            <constraint firstAttribute=\"width\" constant=\"16\" id=\"CJf-Ba-bFr\"/>\n                        </constraints>\n                    </imageView>\n                </subviews>\n                <constraints>\n                    <constraint firstItem=\"hu1-pJ-zF3\" firstAttribute=\"leading\" secondItem=\"QTS-HF-RsJ\" secondAttribute=\"trailing\" constant=\"8\" id=\"1Kw-hA-npU\"/>\n                    <constraint firstItem=\"QpW-3s-LgQ\" firstAttribute=\"trailing\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"trailingMargin\" id=\"3uy-jH-Kwc\"/>\n                    <constraint firstItem=\"NX7-8T-3y3\" firstAttribute=\"top\" secondItem=\"QTS-HF-RsJ\" secondAttribute=\"bottom\" constant=\"8\" id=\"6vC-D6-cFf\"/>\n                    <constraint firstItem=\"hu1-pJ-zF3\" firstAttribute=\"trailing\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"trailingMargin\" id=\"EwU-6V-0Vz\"/>\n                    <constraint firstItem=\"R9K-I1-WdV\" firstAttribute=\"top\" secondItem=\"QpW-3s-LgQ\" secondAttribute=\"bottom\" constant=\"6\" id=\"FHf-VO-r86\"/>\n                    <constraint firstItem=\"R9K-I1-WdV\" firstAttribute=\"leading\" secondItem=\"hu1-pJ-zF3\" secondAttribute=\"leading\" id=\"Gkb-Ch-kYR\"/>\n                    <constraint firstItem=\"QpW-3s-LgQ\" firstAttribute=\"top\" secondItem=\"hu1-pJ-zF3\" secondAttribute=\"bottom\" constant=\"4\" id=\"VFO-Rc-9LA\"/>\n                    <constraint firstItem=\"QTS-HF-RsJ\" firstAttribute=\"leading\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"leadingMargin\" constant=\"16\" id=\"WCI-SZ-kvF\"/>\n                    <constraint firstItem=\"QTS-HF-RsJ\" firstAttribute=\"top\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"topMargin\" constant=\"-2\" id=\"X0l-MK-H9k\"/>\n                    <constraint firstItem=\"R9K-I1-WdV\" firstAttribute=\"trailing\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"trailingMargin\" id=\"YRO-zc-LCy\"/>\n                    <constraint firstItem=\"NX7-8T-3y3\" firstAttribute=\"leading\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"leadingMargin\" id=\"ZFD-bd-JGk\"/>\n                    <constraint firstAttribute=\"bottomMargin\" relation=\"greaterThanOrEqual\" secondItem=\"NX7-8T-3y3\" secondAttribute=\"bottom\" id=\"dJt-sr-pFP\"/>\n                    <constraint firstItem=\"QpW-3s-LgQ\" firstAttribute=\"leading\" secondItem=\"hu1-pJ-zF3\" secondAttribute=\"leading\" id=\"g4h-vn-jy2\"/>\n                    <constraint firstItem=\"hu1-pJ-zF3\" firstAttribute=\"top\" secondItem=\"UoJ-D7-3PN\" secondAttribute=\"topMargin\" constant=\"-2\" id=\"hGb-98-xXK\"/>\n                    <constraint firstAttribute=\"bottomMargin\" secondItem=\"R9K-I1-WdV\" secondAttribute=\"bottom\" constant=\"2\" id=\"ilX-bJ-I2J\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <connections>\n                <outlet property=\"ActionImage\" destination=\"QTS-HF-RsJ\" id=\"RPu-pv-Guc\"/>\n                <outlet property=\"AdjustableConstraint\" destination=\"FHf-VO-r86\" id=\"swa-W4-bOm\"/>\n                <outlet property=\"Body\" destination=\"R9K-I1-WdV\" id=\"5oS-Qe-kB2\"/>\n                <outlet property=\"Header\" destination=\"QpW-3s-LgQ\" id=\"RKL-Jo-IRj\"/>\n                <outlet property=\"Image\" destination=\"NX7-8T-3y3\" id=\"CL0-mM-tM2\"/>\n                <outlet property=\"Time\" destination=\"hu1-pJ-zF3\" id=\"Htj-F1-Fff\"/>\n            </connections>\n            <point key=\"canvasLocation\" x=\"544\" y=\"419\"/>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/PullRequestCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.Utilities;\nusing ObjCRuntime;\nusing Humanizer;\n\nnamespace CodeHub.iOS.Cells\n{\n    public partial class PullRequestCellView : UITableViewCell\n    {\n        public static readonly UINib Nib = UINib.FromName(\"PullRequestCellView\", NSBundle.MainBundle);\n        public static readonly NSString Key = new NSString(\"PullRequestCellView\");\n\n        public PullRequestCellView()\n        {\n        }\n\n        public PullRequestCellView(IntPtr handle) \n            : base(handle)\n        {\n        }\n\n        public static PullRequestCellView Create()\n        {\n            var cell = new PullRequestCellView();\n            var views = NSBundle.MainBundle.LoadNib(\"PullRequestCellView\", cell, null);\n            return Runtime.GetNSObject( views.ValueAt(0) ) as PullRequestCellView;\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n\n            MainImageView.Layer.MasksToBounds = true;\n            MainImageView.Layer.CornerRadius = MainImageView.Frame.Height / 2f;\n            ContentView.Opaque = true;\n\n            SeparatorInset = new UIEdgeInsets(0, TitleLabel.Frame.Left, 0, 0);\n            TitleLabel.TextColor = Theme.CurrentTheme.MainTitleColor;\n            TimeLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n        }\n\n        public void Set(string title, DateTimeOffset time, GitHubAvatar avatar)\n        {\n            TitleLabel.Text = title;\n            TimeLabel.Text = time.Humanize();\n            MainImageView.SetAvatar(avatar);\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            ReleaseDesignerOutlets();\n            base.Dispose(disposing);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/PullRequestCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.Cells\n{\n    [Register (\"PullRequestCellView\")]\n    partial class PullRequestCellView\n    {\n        [Outlet]\n        UIKit.NSLayoutConstraint ContentConstraint { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView MainImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TimeLabel { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TitleLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (ContentConstraint != null) {\n                ContentConstraint.Dispose ();\n                ContentConstraint = null;\n            }\n\n            if (MainImageView != null) {\n                MainImageView.Dispose ();\n                MainImageView = null;\n            }\n\n            if (TimeLabel != null) {\n                TimeLabel.Dispose ();\n                TimeLabel = null;\n            }\n\n            if (TitleLabel != null) {\n                TitleLabel.Dispose ();\n                TitleLabel = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/PullRequestCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"default\" indentationWidth=\"10\" rowHeight=\"-25\" id=\"cxk-wN-pdQ\" customClass=\"PullRequestCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"50\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"cxk-wN-pdQ\" id=\"YTl-1W-gDM\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"49\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"750\" verticalCompressionResistancePriority=\"1000\" text=\"User Label\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"t8o-AX-aOj\">\n                        <rect key=\"frame\" x=\"48\" y=\"8\" width=\"264\" height=\"15\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"Time Label\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"KOS-3J-OAt\">\n                        <rect key=\"frame\" x=\"48\" y=\"25\" width=\"264\" height=\"16\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"16\" id=\"vs6-nF-6rF\"/>\n                        </constraints>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"QEc-1F-ogM\">\n                        <rect key=\"frame\" x=\"8\" y=\"8\" width=\"32\" height=\"32\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"height\" constant=\"32\" id=\"FDD-ZS-YQg\"/>\n                            <constraint firstAttribute=\"width\" constant=\"32\" id=\"b9S-L7-7cL\"/>\n                        </constraints>\n                    </imageView>\n                </subviews>\n                <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                <constraints>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"8\" id=\"56b-yc-H0B\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"top\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"top\" constant=\"8\" id=\"DL8-YT-wOO\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"leading\" id=\"GLI-Pv-7pu\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"trailing\" constant=\"8\" id=\"Orf-4s-y46\"/>\n                    <constraint firstItem=\"KOS-3J-OAt\" firstAttribute=\"top\" secondItem=\"t8o-AX-aOj\" secondAttribute=\"bottom\" constant=\"2\" id=\"Ruh-89-cU1\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"leading\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"trailing\" constant=\"8\" id=\"Xow-LE-tBp\"/>\n                    <constraint firstItem=\"QEc-1F-ogM\" firstAttribute=\"leading\" secondItem=\"YTl-1W-gDM\" secondAttribute=\"leading\" constant=\"8\" id=\"qBH-3c-Ab3\"/>\n                    <constraint firstAttribute=\"bottom\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"bottom\" constant=\"8\" id=\"svE-dk-HVm\"/>\n                    <constraint firstAttribute=\"bottom\" relation=\"greaterThanOrEqual\" secondItem=\"QEc-1F-ogM\" secondAttribute=\"bottom\" constant=\"8\" id=\"upH-tV-rBV\"/>\n                    <constraint firstItem=\"t8o-AX-aOj\" firstAttribute=\"trailing\" secondItem=\"KOS-3J-OAt\" secondAttribute=\"trailing\" id=\"vhK-hi-jpc\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n            <connections>\n                <outlet property=\"MainImageView\" destination=\"QEc-1F-ogM\" id=\"hKO-Ko-teH\"/>\n                <outlet property=\"TimeLabel\" destination=\"KOS-3J-OAt\" id=\"1y1-le-85X\"/>\n                <outlet property=\"TitleLabel\" destination=\"t8o-AX-aOj\" id=\"tvX-cZ-BXq\"/>\n            </connections>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/RepositoryCellView.cs",
    "content": "using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.ViewModels.Repositories;\nusing ReactiveUI;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    public partial class RepositoryCellView : ReactiveTableViewCell<RepositoryItemViewModel>\n    {\n        public static readonly UINib Nib = UINib.FromName(\"RepositoryCellView\", NSBundle.MainBundle);\n        public static NSString Key = new NSString(\"RepositoryCellView\");\n        private static nfloat DefaultConstraintSize = 0.0f;\n\n        public RepositoryCellView(IntPtr handle)\n            : base(handle)\n        {\n            SeparatorInset = new UIEdgeInsets(0, 56f, 0, 0);\n        }\n\n        public override void AwakeFromNib()\n        {\n            base.AwakeFromNib();\n\n            CaptionLabel.TextColor = Theme.CurrentTheme.MainTitleColor;\n            ContentLabel.TextColor = Theme.CurrentTheme.MainTextColor;\n\n            FollowersImageVIew.TintColor = FollowersLabel.TextColor;\n            ForksImageView.TintColor = ForksLabel.TextColor;\n            UserImageView.TintColor = UserLabel.TextColor;\n\n            FollowersImageVIew.Image = Octicon.Star.ToImage(FollowersImageVIew.Frame.Height);\n            ForksImageView.Image = Octicon.RepoForked.ToImage(ForksImageView.Frame.Height);\n            UserImageView.Image = Octicon.Person.ToImage(UserImageView.Frame.Height);\n\n            OwnerImageView.Layer.CornerRadius = OwnerImageView.Bounds.Height / 2f;\n            OwnerImageView.Layer.MasksToBounds = true;\n            OwnerImageView.ContentMode = UIViewContentMode.ScaleAspectFill;\n\n            DefaultConstraintSize = ContentConstraint.Constant;\n\n            this.WhenAnyValue(x => x.ViewModel)\n                .Where(x => x != null)\n                .Subscribe(x =>\n                {\n                    CaptionLabel.Text = x.Name;\n                    FollowersLabel.Text = x.Stars;\n                    ForksLabel.Text = x.Forks;\n                    ContentLabel.Hidden = string.IsNullOrEmpty(x.Description);\n                    ContentLabel.Text = x.Description ?? string.Empty;\n                    UserLabel.Hidden = !x.ShowOwner || string.IsNullOrEmpty(x.Owner);\n                    UserImageView.Hidden = UserLabel.Hidden;\n                    UserLabel.Text = x.Owner ?? string.Empty;\n                    ContentConstraint.Constant = string.IsNullOrEmpty(ContentLabel.Text) ? 0f : DefaultConstraintSize;\n                    OwnerImageView.SetAvatar(x.Avatar);\n                });\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            ReleaseDesignerOutlets();\n            base.Dispose(disposing);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/RepositoryCellView.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n    [Register(\"RepositoryCellView\")]\n    partial class RepositoryCellView\n    {\n        [Outlet]\n        UIKit.UILabel CaptionLabel { get; set; }\n\n        [Outlet]\n        UIKit.NSLayoutConstraint ContentConstraint { get; set; }\n\n        [Outlet]\n        UIKit.UILabel ContentLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView FollowersImageVIew { get; set; }\n\n        [Outlet]\n        UIKit.UILabel FollowersLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView ForksImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel ForksLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView OwnerImageView { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView UserImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel UserLabel { get; set; }\n\n        void ReleaseDesignerOutlets()\n        {\n            if (CaptionLabel != null)\n            {\n                CaptionLabel.Dispose();\n                CaptionLabel = null;\n            }\n\n            if (ContentLabel != null)\n            {\n                ContentLabel.Dispose();\n                ContentLabel = null;\n            }\n\n            if (FollowersImageVIew != null)\n            {\n                FollowersImageVIew.Dispose();\n                FollowersImageVIew = null;\n            }\n\n            if (FollowersLabel != null)\n            {\n                FollowersLabel.Dispose();\n                FollowersLabel = null;\n            }\n\n            if (ForksImageView != null)\n            {\n                ForksImageView.Dispose();\n                ForksImageView = null;\n            }\n\n            if (ForksLabel != null)\n            {\n                ForksLabel.Dispose();\n                ForksLabel = null;\n            }\n\n            if (OwnerImageView != null)\n            {\n                OwnerImageView.Dispose();\n                OwnerImageView = null;\n            }\n\n            if (UserImageView != null)\n            {\n                UserImageView.Dispose();\n                UserImageView = null;\n            }\n\n            if (UserLabel != null)\n            {\n                UserLabel.Dispose();\n                UserLabel = null;\n            }\n\n            if (ContentConstraint != null)\n            {\n                ContentConstraint.Dispose();\n                ContentConstraint = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/RepositoryCellView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"15400\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" colorMatched=\"YES\">\n    <device id=\"retina6_1\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15404\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"RepositoryCellView\"/>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <tableViewCell contentMode=\"scaleToFill\" selectionStyle=\"blue\" indentationWidth=\"10\" reuseIdentifier=\"RepositoryCellView\" rowHeight=\"312\" id=\"5\" customClass=\"RepositoryCellView\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"373\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <tableViewCellContentView key=\"contentView\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" tableViewCell=\"5\" id=\"ho5-JP-Lze\">\n                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"373\"/>\n                <autoresizingMask key=\"autoresizingMask\"/>\n                <subviews>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"This is a Repository\" lineBreakMode=\"tailTruncation\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"6\">\n                        <rect key=\"frame\" x=\"52\" y=\"8\" width=\"260\" height=\"20\"/>\n                        <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleHeadline\"/>\n                        <color key=\"textColor\" red=\"0.0\" green=\"0.25098040700000002\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <color key=\"highlightedColor\" red=\"0.0\" green=\"0.25098039220000001\" blue=\"0.50196078430000002\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <size key=\"shadowOffset\" width=\"1\" height=\"1\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" verticalHuggingPriority=\"1000\" horizontalCompressionResistancePriority=\"1000\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"7\">\n                        <rect key=\"frame\" x=\"52\" y=\"353\" width=\"12\" height=\"12\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" relation=\"greaterThanOrEqual\" constant=\"12\" id=\"EiR-ir-NOq\"/>\n                            <constraint firstAttribute=\"width\" constant=\"12\" id=\"U1w-to-2Yl\"/>\n                            <constraint firstAttribute=\"height\" relation=\"greaterThanOrEqual\" constant=\"12\" id=\"lLZ-bG-x5Z\"/>\n                            <constraint firstAttribute=\"height\" constant=\"12\" id=\"qfg-0W-CE6\"/>\n                        </constraints>\n                    </imageView>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" text=\"100\" lineBreakMode=\"tailTruncation\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8\">\n                        <rect key=\"frame\" x=\"72\" y=\"351\" width=\"42\" height=\"16\"/>\n                        <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"42\" id=\"rxY-w3-PgW\"/>\n                        </constraints>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <color key=\"textColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <color key=\"highlightedColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" verticalHuggingPriority=\"1000\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"30\">\n                        <rect key=\"frame\" x=\"122\" y=\"353\" width=\"12\" height=\"12\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"12\" id=\"8gb-oI-Pch\"/>\n                            <constraint firstAttribute=\"height\" constant=\"12\" id=\"HRp-vu-VmF\"/>\n                        </constraints>\n                    </imageView>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" verticalHuggingPriority=\"1000\" text=\"21\" lineBreakMode=\"tailTruncation\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"31\">\n                        <rect key=\"frame\" x=\"142\" y=\"351\" width=\"42\" height=\"16\"/>\n                        <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"42\" id=\"ubt-3C-Tyh\"/>\n                        </constraints>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <color key=\"textColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <color key=\"highlightedColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </label>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" verticalHuggingPriority=\"1000\" text=\"thedillonb\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"10\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"40\">\n                        <rect key=\"frame\" x=\"212\" y=\"351\" width=\"100\" height=\"16\"/>\n                        <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                        <color key=\"textColor\" red=\"0.5\" green=\"0.5\" blue=\"0.5\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <color key=\"highlightedColor\" red=\"0.50196081400000003\" green=\"0.50196081400000003\" blue=\"0.50196081400000003\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </label>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"43\">\n                        <rect key=\"frame\" x=\"8\" y=\"8\" width=\"36\" height=\"36\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"36\" id=\"9pe-Iy-9ES\"/>\n                            <constraint firstAttribute=\"width\" relation=\"greaterThanOrEqual\" constant=\"36\" id=\"Egi-1K-Osd\"/>\n                            <constraint firstAttribute=\"height\" relation=\"greaterThanOrEqual\" constant=\"36\" id=\"Igk-9I-g05\"/>\n                            <constraint firstAttribute=\"height\" constant=\"36\" id=\"lY0-6B-c8f\"/>\n                        </constraints>\n                    </imageView>\n                    <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" verticalHuggingPriority=\"1000\" horizontalCompressionResistancePriority=\"1000\" verticalCompressionResistancePriority=\"1000\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"46\">\n                        <rect key=\"frame\" x=\"192\" y=\"353\" width=\"12\" height=\"12\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"width\" constant=\"12\" id=\"NWq-wc-KPH\"/>\n                            <constraint firstAttribute=\"height\" constant=\"12\" id=\"tRc-t0-aFT\"/>\n                        </constraints>\n                    </imageView>\n                    <label clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" verticalHuggingPriority=\"751\" verticalCompressionResistancePriority=\"250\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" minimumFontSize=\"12\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"36\">\n                        <rect key=\"frame\" x=\"52\" y=\"32\" width=\"260\" height=\"313\"/>\n                        <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n                        <string key=\"text\">DbUp is a .NET library that helps you to deploy changes to SQL Server databases. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date.  </string>\n                        <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleSubhead\"/>\n                        <color key=\"textColor\" cocoaTouchSystemColor=\"darkTextColor\"/>\n                        <nil key=\"highlightedColor\"/>\n                    </label>\n                </subviews>\n                <constraints>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"40\" secondAttribute=\"trailing\" constant=\"8\" id=\"00Q-qe-BUF\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"leading\" secondItem=\"36\" secondAttribute=\"leading\" id=\"26G-T0-2HT\"/>\n                    <constraint firstItem=\"40\" firstAttribute=\"leading\" secondItem=\"46\" secondAttribute=\"trailing\" constant=\"8\" id=\"7j1-8R-6Mx\"/>\n                    <constraint firstAttribute=\"bottom\" relation=\"greaterThanOrEqual\" secondItem=\"43\" secondAttribute=\"bottom\" constant=\"8\" id=\"7qR-xu-Fdb\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"centerY\" secondItem=\"8\" secondAttribute=\"centerY\" id=\"7zd-0b-4Ab\"/>\n                    <constraint firstItem=\"46\" firstAttribute=\"leading\" secondItem=\"31\" secondAttribute=\"trailing\" constant=\"8\" id=\"FHk-eS-wAZ\"/>\n                    <constraint firstItem=\"43\" firstAttribute=\"top\" secondItem=\"ho5-JP-Lze\" secondAttribute=\"top\" constant=\"8\" id=\"I34-Eb-v1I\"/>\n                    <constraint firstItem=\"36\" firstAttribute=\"top\" secondItem=\"6\" secondAttribute=\"bottom\" constant=\"4\" id=\"KXW-MQ-1DX\"/>\n                    <constraint firstItem=\"6\" firstAttribute=\"top\" secondItem=\"ho5-JP-Lze\" secondAttribute=\"top\" constant=\"8\" id=\"NCm-z4-JYf\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"centerY\" secondItem=\"31\" secondAttribute=\"centerY\" id=\"R1e-2z-ni9\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"centerY\" secondItem=\"46\" secondAttribute=\"centerY\" id=\"Rhl-oz-Poq\"/>\n                    <constraint firstItem=\"30\" firstAttribute=\"leading\" secondItem=\"8\" secondAttribute=\"trailing\" constant=\"8\" id=\"UEK-at-WWu\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"6\" secondAttribute=\"trailing\" constant=\"8\" id=\"XiP-59-wz3\"/>\n                    <constraint firstAttribute=\"bottom\" secondItem=\"7\" secondAttribute=\"bottom\" constant=\"8\" id=\"fMe-fN-8a4\"/>\n                    <constraint firstItem=\"8\" firstAttribute=\"top\" secondItem=\"36\" secondAttribute=\"bottom\" constant=\"6\" id=\"fsf-Ai-caM\"/>\n                    <constraint firstItem=\"6\" firstAttribute=\"leading\" secondItem=\"43\" secondAttribute=\"trailing\" constant=\"8\" id=\"gvt-73-dnh\"/>\n                    <constraint firstItem=\"31\" firstAttribute=\"leading\" secondItem=\"30\" secondAttribute=\"trailing\" constant=\"8\" id=\"jNa-V5-yZD\"/>\n                    <constraint firstItem=\"8\" firstAttribute=\"leading\" secondItem=\"7\" secondAttribute=\"trailing\" constant=\"8\" id=\"l0Q-w9-IRZ\"/>\n                    <constraint firstAttribute=\"trailing\" secondItem=\"36\" secondAttribute=\"trailing\" constant=\"8\" id=\"lgg-J0-ubn\"/>\n                    <constraint firstItem=\"36\" firstAttribute=\"leading\" secondItem=\"43\" secondAttribute=\"trailing\" constant=\"8\" id=\"maQ-Rn-z7i\"/>\n                    <constraint firstItem=\"43\" firstAttribute=\"leading\" secondItem=\"ho5-JP-Lze\" secondAttribute=\"leading\" constant=\"8\" id=\"qhb-zF-AtN\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"centerY\" secondItem=\"30\" secondAttribute=\"centerY\" id=\"sfe-eJ-t6q\"/>\n                    <constraint firstItem=\"7\" firstAttribute=\"centerY\" secondItem=\"40\" secondAttribute=\"centerY\" id=\"z6p-KV-w9d\"/>\n                </constraints>\n            </tableViewCellContentView>\n            <connections>\n                <outlet property=\"CaptionLabel\" destination=\"6\" id=\"8BL-tx-QBf\"/>\n                <outlet property=\"ContentConstraint\" destination=\"KXW-MQ-1DX\" id=\"VBP-ab-3bJ\"/>\n                <outlet property=\"ContentLabel\" destination=\"36\" id=\"pvc-7n-dr7\"/>\n                <outlet property=\"FollowersImageVIew\" destination=\"7\" id=\"2eH-Rz-pth\"/>\n                <outlet property=\"FollowersLabel\" destination=\"8\" id=\"R8f-ZN-bZ4\"/>\n                <outlet property=\"ForksImageView\" destination=\"30\" id=\"E56-5V-EWY\"/>\n                <outlet property=\"ForksLabel\" destination=\"31\" id=\"d4i-CX-uuk\"/>\n                <outlet property=\"OwnerImageView\" destination=\"43\" id=\"m5b-9w-ZMB\"/>\n                <outlet property=\"UserImageView\" destination=\"46\" id=\"t8C-1W-Oex\"/>\n                <outlet property=\"UserLabel\" destination=\"40\" id=\"d3g-z3-eQS\"/>\n            </connections>\n            <point key=\"canvasLocation\" x=\"549.27536231884062\" y=\"378.01339285714283\"/>\n        </tableViewCell>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/TableViewCells/UserTableViewCell.cs",
    "content": "﻿using System;\nusing Foundation;\nusing UIKit;\nusing CodeHub.Core.ViewModels.Users;\nusing ReactiveUI;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.TableViewCells\n{\n\tpublic class UserTableViewCell : ReactiveTableViewCell<UserItemViewModel>\n\t{\n\t\tpublic static readonly NSString Key = new NSString(\"UserTableViewCell\");\n\t\tprivate const float ImageSpacing = 10f;\n        private static readonly CGRect ImageFrame = new CGRect(ImageSpacing, 6f, 32, 32);\n\n        public UserTableViewCell(IntPtr handle)\n\t\t\t: base(handle)\n\t\t{\n\t\t\tImageView.Layer.CornerRadius = ImageFrame.Height / 2f;\n\t\t\tImageView.Layer.MasksToBounds = true;\n\t\t\tImageView.ContentMode = UIViewContentMode.ScaleAspectFill;\n\t\t\tContentView.Opaque = true;\n\n            SeparatorInset = new UIEdgeInsets(0, ImageFrame.Right + ImageSpacing, 0, 0);\n\n\t\t\tthis.WhenActivated(d =>\n\t\t\t{\n                d(this.WhenAnyValue(x => x.ViewModel.Login).Subscribe(x => TextLabel.Text = x));\n\t\t\t\td(this.WhenAnyValue(x => x.ViewModel.Avatar).Subscribe(x => ImageView.SetAvatar(x)));\n\t\t\t});\n\t\t}\n\n\t\tpublic override void LayoutSubviews()\n\t\t{\n\t\t\tbase.LayoutSubviews();\n\t\t\tImageView.Frame = ImageFrame;\n\t\t\tTextLabel.Frame = new CGRect(ImageFrame.Right + ImageSpacing, TextLabel.Frame.Y,\n                                         TextLabel.Frame.Width, TextLabel.Frame.Height);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/DialogTableViewSource.cs",
    "content": "﻿using UIKit;\nusing Foundation;\nusing System;\nusing System.Reactive.Subjects;\nusing CoreGraphics;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n    public class DialogTableViewSource : UITableViewSource\n    {\n        private readonly RootElement _root;\n        private readonly Subject<CGPoint> _scrolledSubject = new Subject<CGPoint>();\n        private readonly Subject<Element> _selectedSubject = new Subject<Element>();\n\n        public IObservable<CGPoint> ScrolledObservable { get { return _scrolledSubject.AsObservable(); } }\n\n        public IObservable<Element> SelectedObservable { get { return _selectedSubject.AsObservable(); } }\n\n        public RootElement Root\n        {\n            get { return _root; }\n        }\n\n        #if DEBUG\n        ~DialogTableViewSource()\n        {\n            Console.WriteLine(\"Goodbye DialogTableViewSource\");\n        }\n        #endif\n\n        public DialogTableViewSource(UITableView container)\n        {\n            container.RowHeight = UITableView.AutomaticDimension;\n            _root = new RootElement(container);\n        }\n\n        public override nint RowsInSection(UITableView tableview, nint section)\n        {\n            return Root[(int)section].Count;\n        }\n\n        public override nint NumberOfSections(UITableView tableView)\n        {\n            return Root.Count;\n        }\n\n        public override string TitleForHeader(UITableView tableView, nint section)\n        {\n            return Root[(int)section].Header;\n        }\n\n        public override string TitleForFooter(UITableView tableView, nint section)\n        {\n            return Root[(int)section].Footer;\n        }\n\n        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n            return element.GetCell(tableView);\n        }\n\n        public override void RowDeselected(UITableView tableView, NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n            element.Deselected(tableView, indexPath);\n        }\n\n        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n            element.Selected(tableView, indexPath);\n            _selectedSubject.OnNext(element);\n        }\n\n        public override UIView GetViewForHeader(UITableView tableView, nint section)\n        {\n            var sectionElement = Root[(int)section];\n            return sectionElement.HeaderView;\n        }\n\n        public override nfloat GetHeightForHeader(UITableView tableView, nint section)\n        {\n            var sectionElement = Root[(int)section];\n            return sectionElement.HeaderView == null ? -1 : sectionElement.HeaderView.Frame.Height;\n        }\n\n        public override UIView GetViewForFooter(UITableView tableView, nint section)\n        {\n            var sectionElement = Root[(int)section];\n            return sectionElement.FooterView;\n        }\n\n        public override nfloat GetHeightForFooter(UITableView tableView, nint section)\n        {\n            var sectionElement = Root[(int)section];\n            return sectionElement.FooterView == null ? -1 : sectionElement.FooterView.Frame.Height;\n        }\n\n        public override void Scrolled(UIScrollView scrollView)\n        {\n            _scrolledSubject.OnNext(Root.TableView.ContentOffset);\n        }\n\n        public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n            var sizable = element as IElementSizing;\n            return sizable == null ? tableView.RowHeight : sizable.GetHeight(tableView, indexPath);\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/FeedbackTableViewSource.cs",
    "content": "﻿using ReactiveUI;\nusing CodeHub.iOS.TableViewCells;\nusing CodeHub.Core.ViewModels.App;\nusing UIKit;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n    public class FeedbackTableViewSource : ReactiveTableViewSource<FeedbackItemViewModel>\n    {\n        public FeedbackTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged<FeedbackItemViewModel> collection)\n            : base(tableView, collection, FeedbackCellView.Key, UITableView.AutomaticDimension, 69.0f)\n        {\n            tableView.RegisterNibForCellReuse(FeedbackCellView.Nib, FeedbackCellView.Key);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/GistTableViewSource.cs",
    "content": "﻿using ReactiveUI;\nusing CodeHub.Core.ViewModels.Gists;\nusing UIKit;\nusing CodeHub.iOS.TableViewCells;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n    public class GistTableViewSource : ReactiveTableViewSource<GistItemViewModel>\n    {\n        public GistTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged<GistItemViewModel> collection)\n            : base(tableView, collection, GistCellView.Key, UITableView.AutomaticDimension, 60f)\n        {\n            tableView.RegisterNibForCellReuse(GistCellView.Nib, GistCellView.Key);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/ReactiveTableViewSource.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Reactive.Subjects;\nusing System.Reactive;\nusing CodeHub.Core.ViewModels;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n    public abstract class ReactiveTableViewSource<TViewModel> : ReactiveUI.ReactiveTableViewSource<TViewModel>, IInformsEnd\n    {\n        private readonly Subject<Unit> _requestMoreSubject = new Subject<Unit>();\n        private readonly Subject<CGPoint> _scrollSubject = new Subject<CGPoint>();\n\n        public IObservable<CGPoint> DidScroll\n        {\n            get { return _scrollSubject.AsObservable(); }\n        }\n\n        public IObservable<Unit> RequestMore\n        {\n            get { return _requestMoreSubject; }\n        }\n\n        public override void Scrolled(UIScrollView scrollView)\n        {\n            _scrollSubject.OnNext(scrollView.ContentOffset);\n        }\n\n        ~ReactiveTableViewSource()\n        {\n            Console.WriteLine(\"Destorying \" + GetType().Name);\n        }\n\n        protected ReactiveTableViewSource(UITableView tableView, nfloat height, nfloat? heightHint = null)\n            : base(tableView)\n        {\n            tableView.RowHeight = height;\n            tableView.EstimatedRowHeight = heightHint ?? tableView.EstimatedRowHeight;\n        }\n\n        protected ReactiveTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged<TViewModel> collection,\n            Foundation.NSString cellKey, nfloat height, nfloat? heightHint = null, Action<UITableViewCell> initializeCellAction = null)\n            : base(tableView, collection, cellKey, (float)height, initializeCellAction)\n        {\n            tableView.RowHeight = height;\n            tableView.EstimatedRowHeight = heightHint ?? tableView.EstimatedRowHeight;\n        }\n\n        public override void WillDisplay(UITableView tableView, UITableViewCell cell, Foundation.NSIndexPath indexPath)\n        {\n            if (indexPath.Section == (NumberOfSections(tableView) - 1) &&\n                indexPath.Row == (RowsInSection(tableView, indexPath.Section) - 1))\n            {\n                // We need to skip an event loop to stay out of trouble\n                BeginInvokeOnMainThread(() => _requestMoreSubject.OnNext(Unit.Default));\n            }\n        }\n\n        public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath)\n        {\n            var item = ItemAt(indexPath) as ICanGoToViewModel;\n            item?.GoToCommand.ExecuteNow();\n\n            base.RowSelected(tableView, indexPath);\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            _requestMoreSubject.Dispose();\n            _scrollSubject.Dispose();\n            base.Dispose(disposing);\n        }\n    }\n\n    public interface IInformsEnd\n    {\n        IObservable<Unit> RequestMore { get; }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/RepositoryTableViewSource.cs",
    "content": "﻿using ReactiveUI;\nusing CodeHub.Core.ViewModels.Repositories;\nusing CodeHub.iOS.TableViewCells;\nusing System;\nusing UIKit;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n    public class RepositoryTableViewSource : ReactiveTableViewSource<RepositoryItemViewModel>\n    {\n        private readonly static nfloat _estimatedHeight = 100.0f;\n\n        public RepositoryTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged<RepositoryItemViewModel> collection)\n            : base(tableView, collection, RepositoryCellView.Key, UITableView.AutomaticDimension, _estimatedHeight)\n        {\n            tableView.RegisterNibForCellReuse(RepositoryCellView.Nib, RepositoryCellView.Key);\n        }\n\n        public RepositoryTableViewSource(UITableView tableView)\n            : base(tableView, UITableView.AutomaticDimension, _estimatedHeight)\n        {\n            tableView.RegisterNibForCellReuse(RepositoryCellView.Nib, RepositoryCellView.Key);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/TableViewSources/UserTableViewSource.cs",
    "content": "﻿using ReactiveUI;\nusing CodeHub.Core.ViewModels.Users;\nusing CodeHub.iOS.TableViewCells;\n\nnamespace CodeHub.iOS.TableViewSources\n{\n\tpublic class UserTableViewSource : ReactiveTableViewSource<UserItemViewModel>\n\t{\n\t\tpublic UserTableViewSource(UIKit.UITableView tableView, IReactiveNotifyCollectionChanged<UserItemViewModel> collection)\n\t\t\t: base(tableView, collection, UserTableViewCell.Key, 44)\n\t\t{\n\t\t\ttableView.RegisterClassForCellReuse(typeof(UserTableViewCell), UserTableViewCell.Key);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Theme.cs",
    "content": "using UIKit;\nusing CodeHub.iOS.Views;\nusing System;\n\nnamespace CodeHub.iOS\n{\n    public class Theme\n    {\n        public static Theme CurrentTheme { get; private set; }\n\n        private static UIImage CreateBackgroundImage(UIColor color)\n        {\n            UIGraphics.BeginImageContext(new CoreGraphics.CGSize(1, 1f));\n            color.SetFill();\n            UIGraphics.RectFill(new CoreGraphics.CGRect(0, 0, 1, 1));\n            var img = UIGraphics.GetImageFromCurrentImageContext();\n            UIGraphics.EndImageContext();\n            return img;\n        }\n\n        public static void Setup()\n        {\n            var theme = new Theme();\n            CurrentTheme = theme;\n\n            var primaryColor = Theme.CurrentTheme.PrimaryColor;\n            var iconColor = UIColor.FromRGB(0x5B, 0x61, 0x65);\n            var backgroundImg = CreateBackgroundImage(primaryColor);\n\n            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;\n            UINavigationBar.Appearance.TintColor = UIColor.White;\n            UINavigationBar.Appearance.SetBackgroundImage(backgroundImg, UIBarMetrics.Default);\n            UINavigationBar.Appearance.BarTintColor = primaryColor;\n            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f) });\n            CodeHub.iOS.Utilities.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);\n            CodeHub.iOS.Services.AlertDialogService.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);\n\n            UINavigationBar.Appearance.BackIndicatorImage = Images.Buttons.BackButton;\n            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = Images.Buttons.BackButton;\n\n            var version = new Version(UIDevice.CurrentDevice.SystemVersion);\n            if (version.Major < 11)\n            {\n                UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -System.nfloat.MaxValue), UIBarMetrics.LandscapePhone);\n                UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -System.nfloat.MaxValue), UIBarMetrics.Default);\n            }\n\n            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);\n            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;\n\n            // Composer Input Accessory Buttons\n            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = UIColor.FromRGB(50, 50, 50);\n\n            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);\n            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);\n            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font = UIFont.SystemFontOfSize(13f);\n\n            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);\n\n            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {TextColor = UIColor.White}, UIControlState.Normal);\n\n            UIImageView.AppearanceWhenContainedIn(typeof(UITableViewCell), typeof(MonoTouch.SlideoutNavigation.MainNavigationController)).TintColor = iconColor;\n\n            EmptyListView.DefaultColor = primaryColor;\n            LoadingIndicatorView.DefaultColor = primaryColor;\n        }\n\n        public UITextAttributes SegmentedControlText\n        {\n            get\n            {\n                return new UITextAttributes\n                { \n                    Font = UIFont.PreferredBody, \n                    TextColor = UIColor.FromRGB(87, 85, 85), \n                    TextShadowColor = UIColor.FromRGBA(255, 255, 255, 125), \n                    TextShadowOffset = new UIOffset(0, 1) \n                };\n            }\n        }\n\n        public UIColor ViewBackgroundColor { get { return UIColor.FromRGB(238, 238, 238); } }\n        public UIColor MainTitleColor { get { return UIColor.FromRGB(0x41, 0x83, 0xc4); } }\n        public UIColor MainSubtitleColor { get { return UIColor.FromRGB(81, 81, 81); } }\n        public UIColor MainTextColor { get { return UIColor.FromRGB(41, 41, 41); } }\n        public UIColor IssueTitleColor { get { return MainTitleColor; } }\n        public UIColor RepositoryTitleColor { get { return MainTitleColor; } }\n        public UIColor HeaderViewTitleColor { get { return MainTitleColor; } }\n        public UIColor HeaderViewDetailColor { get { return MainSubtitleColor; } }\n        public UIColor WebButtonTint { get { return UIColor.FromRGB(127, 125, 125); } }\n        public UIColor PrimaryColor { get { return UIColor.FromRGB(50, 50, 50); } }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/TouchViewPresenter.cs",
    "content": "using System;\nusing MvvmCross.Platform;\nusing MvvmCross.Core.ViewModels;\nusing UIKit;\nusing CodeHub.Core;\nusing MonoTouch.SlideoutNavigation;\nusing MvvmCross.iOS.Views.Presenters;\nusing MvvmCross.iOS.Views;\n\nnamespace CodeHub.iOS\n{\n    public class IosViewPresenter : MvxBaseIosViewPresenter\n    {\n        private readonly UIWindow _window;\n\n        public SlideoutNavigationController SlideoutNavigationController { get; set; }\n\n        public IosViewPresenter(UIWindow window)\n        {\n            _window = window;\n        }\n\n        public override void ChangePresentation(MvxPresentationHint hint)\n        {\n            if (hint is MvxClosePresentationHint)\n            {\n                var navController = SlideoutNavigationController.MainViewController as UINavigationController;\n                navController?.PopViewController(true);\n            }\n\n            base.ChangePresentation(hint);\n        }\n\n        public override void Show(MvxViewModelRequest request)\n        {\n            var viewCreator = Mvx.Resolve<IMvxIosViewCreator>();\n            var view = viewCreator.CreateView(request);\n            var uiView = view as UIViewController;\n\n            if (uiView == null)\n                throw new InvalidOperationException(\"Asking to show a view which is not a UIViewController!\");\n\n            if (uiView is IMvxModalIosView)\n            {\n                _window?.GetVisibleViewController()?.PresentViewController(uiView, true, null);\n                return;\n            }\n\n            if (request.PresentationValues != null && request.PresentationValues.ContainsKey(PresentationValues.SlideoutRootPresentation))\n            {\n                var openButton = new UIBarButtonItem { Image = Images.Buttons.ThreeLinesButton };\n                var mainNavigationController = new MainNavigationController(uiView, SlideoutNavigationController, openButton);\n                SlideoutNavigationController.SetMainViewController(mainNavigationController, true);\n            }\n            else\n            {\n                var navController = SlideoutNavigationController.MainViewController as UINavigationController;\n                navController?.PushViewController(uiView, true);\n            }\n        }\n\n        public override bool PresentModalViewController(UIViewController viewController, bool animated)\n        {\n            _window?.GetVisibleViewController()?.PresentViewController(viewController, true, null);\n            return true;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Transitions/SlideDownTransition.cs",
    "content": "using UIKit;\r\nusing CoreGraphics;\r\n\r\nnamespace CodeHub.iOS.Transitions\r\n{\r\n    public class SlideDownTransition : UIViewControllerTransitioningDelegate\r\n    {\r\n        private TransitionAnimator _animator;\r\n\r\n        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForPresentedController(UIViewController presented, UIViewController presenting, UIViewController source)\r\n        {\r\n            _animator = new TransitionAnimator();\r\n            _animator.Presenting = true;\r\n            return _animator;\r\n        }\r\n\r\n        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForDismissedController(UIViewController dismissed)\r\n        {\r\n            _animator = new TransitionAnimator();\r\n            return _animator;\r\n        }\r\n\r\n        private class TransitionAnimator : UIViewControllerAnimatedTransitioning\r\n        {\r\n            public bool Presenting;\r\n\r\n            public override double TransitionDuration(IUIViewControllerContextTransitioning transitionContext)\r\n            {\r\n                return 0.25f;\r\n            }\r\n\r\n            public override void AnimateTransition(IUIViewControllerContextTransitioning transitionContext)\r\n            {\r\n                var containerView = transitionContext.ContainerView;\r\n                var toVC = transitionContext.GetViewControllerForKey (UITransitionContext.ToViewControllerKey);\r\n                var fromVC = transitionContext.GetViewControllerForKey (UITransitionContext.FromViewControllerKey);\r\n\r\n                if (Presenting)\r\n                {\r\n                    fromVC.View.UserInteractionEnabled = false;\r\n\r\n                    containerView.AddSubview(fromVC.View);\r\n                    containerView.AddSubview(toVC.View);\r\n\r\n                    var endFrame = toVC.View.Frame;\r\n                    var frame = toVC.View.Frame;\r\n                    frame.Y = -frame.Height;\r\n                    toVC.View.Frame = frame;\r\n\r\n                    UIView.Animate(TransitionDuration(transitionContext), 0, UIViewAnimationOptions.CurveEaseInOut, () =>\r\n                    {\r\n                        toVC.View.Frame = endFrame;\r\n                    }, \r\n                        () =>\r\n                    {\r\n                        transitionContext.CompleteTransition(true);\r\n                    });\r\n                }\r\n                else\r\n                {\r\n                    toVC.View.UserInteractionEnabled = true;\r\n\r\n                    containerView.Add(toVC.View);\r\n                    containerView.Add(fromVC.View);\r\n\r\n                    var endFrame = fromVC.View.Frame;\r\n                    endFrame.Y = -endFrame.Height;\r\n\r\n                    UIView.Animate(TransitionDuration(transitionContext), 0, UIViewAnimationOptions.CurveEaseInOut, () =>\r\n                    {\r\n                        fromVC.View.Frame = endFrame;\r\n                    }, () =>\r\n                    {\r\n                        transitionContext.CompleteTransition(true);\r\n                    });\r\n                }\r\n            }\r\n\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "CodeHub.iOS/UrlRouterProvider.cs",
    "content": "using System;\nusing MvvmCross.Core.ViewModels;\nusing System.Text.RegularExpressions;\nusing System.Linq;\nusing System.Collections.Generic;\nusing MvvmCross.Platform;\nusing CodeHub.Core.Services;\nusing MvvmCross.Core.Views;\n\nnamespace CodeHub.iOS\n{\n    public static class UrlRouteProvider\n    {\n        private static Route[] Routes = {\n            //new Route(\"^gist.github.com/$\", typeof(CodeHub.Core.ViewModels.Gists.UserGistsViewModel)),\n            //new Route(\"^gist.github.com/(?<Username>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.Gists.UserGistsViewModel)),\n            new Route(\"^gist.github.com/(?<Username>[^/]*)/(?<Id>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.Gists.GistViewModel)),\n            //new Route(\"^[^/]*/stars/$\", typeof(CodeHub.Core.ViewModels.Repositories.RepositoriesStarredViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.User.UserViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.Repositories.RepositoryViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/pulls/$\", typeof(CodeHub.Core.ViewModels.PullRequests.PullRequestsViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/pull/(?<Id>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.PullRequests.PullRequestViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/issues/$\", typeof(CodeHub.Core.ViewModels.Issues.IssuesViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/commits/$\", typeof(CodeHub.Core.ViewModels.Changesets.CommitsViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/commits/(?<Node>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.Changesets.ChangesetViewModel)),\n            new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/issues/(?<Id>[^/]*)/$\", typeof(CodeHub.Core.ViewModels.Issues.IssueViewModel)),\n            //new Route(\"^[^/]*/(?<Username>[^/]*)/(?<Repository>[^/]*)/tree/(?<Branch>[^/]*)/(?<Path>.*)$\", typeof(CodeHub.Core.ViewModels.Source.SourceTreeViewModel)),\n        };\n\n        public static bool Handle(string path)\n        {\n            var viewDispatcher = Mvx.Resolve<IMvxViewDispatcher>();\n            var appService = Mvx.Resolve<IApplicationService>();\n            if (!path.EndsWith(\"/\", StringComparison.Ordinal))\n                path += \"/\";\n\n            foreach (var route in Routes)\n            {\n                var regex = new Regex(route.Path, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);\n                var match = regex.Match(path);\n                var groups = regex.GetGroupNames().Skip(1);\n\n                if (match.Success)\n                {\n                    var rec = new MvxViewModelRequest();\n                    rec.ViewModelType = route.ViewModelType;\n                    rec.ParameterValues = new Dictionary<string, string>();\n                    foreach (var group in groups)\n                        rec.ParameterValues.Add(group, match.Groups[group].Value);\n                    appService.SetUserActivationAction(() => viewDispatcher.ShowViewModel(rec));\n                    return true;\n                }\n            }\n\n            return false;\n        }\n\n\n        private class Route\n        {\n            public string Path { get; set; }\n            public Type ViewModelType { get; set; }\n\n            public Route(string path, Type viewModelType) \n            {\n                Path = path;\n                ViewModelType = viewModelType;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/EasyLayout.cs",
    "content": "﻿//\r\n// Copyright (c) 2013-2015 Frank A. Krueger\r\n// \r\n// Permission is hereby granted, free of charge, to any person obtaining a copy\r\n// of this software and associated documentation files (the \"Software\"), to deal\r\n// in the Software without restriction, including without limitation the rights\r\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n// copies of the Software, and to permit persons to whom the Software is\r\n// furnished to do so, subject to the following conditions:\r\n// \r\n// The above copyright notice and this permission notice shall be included in\r\n// all copies or substantial portions of the Software.\r\n// \r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n// THE SOFTWARE.\r\n//\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Linq.Expressions;\r\nusing System.Reflection;\r\n\r\nusing UIKit;\r\n\r\nnamespace CodeHub.iOS\r\n{\r\n    public static class Layout\r\n    {\r\n        /// <summary>\r\n        /// <para>Constrains the layout of subviews according to equations and\r\n        /// inequalities specified in <paramref name=\"constraints\"/>.  Issue\r\n        /// multiple constraints per call using the &amp;&amp; operator.</para>\r\n        /// <para>e.g. button.Frame.Left &gt;= text.Frame.Right + 22 &amp;&amp;\r\n        /// button.Frame.Width == View.Frame.Width * 0.42f</para>\r\n        /// </summary>\r\n        /// <param name=\"view\">The superview laying out the referenced subviews.</param>\r\n        /// <param name=\"constraints\">Constraint equations and inequalities.</param>\r\n        public static NSLayoutConstraint[] ConstrainLayout (this UIView view, Expression<Func<bool>> constraints, bool apply = true)\r\n        {\r\n            return ConstrainLayout (view, constraints, UILayoutPriority.Required, apply);\r\n        }\r\n\r\n        /// <summary>\r\n        /// <para>Constrains the layout of subviews according to equations and\r\n        /// inequalities specified in <paramref name=\"constraints\"/>.  Issue\r\n        /// multiple constraints per call using the &amp;&amp; operator.</para>\r\n        /// <para>e.g. button.Frame.Left &gt;= text.Frame.Right + 22 &amp;&amp;\r\n        /// button.Frame.Width == View.Frame.Width * 0.42f</para>\r\n        /// </summary>\r\n        /// <param name=\"view\">The superview laying out the referenced subviews.</param>\r\n        /// <param name=\"constraints\">Constraint equations and inequalities.</param>\r\n        /// <param name = \"priority\">The priority of the constraints</param>\r\n        public static NSLayoutConstraint[] ConstrainLayout (this UIView view, Expression<Func<bool>> constraints, UILayoutPriority priority, bool apply = true)\r\n        {\r\n            var body = constraints.Body;\r\n\r\n            var exprs = new List<BinaryExpression> ();\r\n            FindConstraints (body, exprs);\r\n\r\n            var layoutConstraints = exprs.Select (e => CompileConstraint (e, view)).ToArray ();\r\n\r\n            if (layoutConstraints.Length > 0) {\r\n                foreach (var c in layoutConstraints) {\r\n                    c.Priority = (float)priority;\r\n                }\r\n                if (apply)\r\n                    view.AddConstraints (layoutConstraints);\r\n            }\r\n\r\n            return layoutConstraints;\r\n        }\r\n\r\n        static NSLayoutConstraint CompileConstraint (BinaryExpression expr, UIView constrainedView)\r\n        {\r\n            var rel = NSLayoutRelation.Equal;\r\n            switch (expr.NodeType) {\r\n                case ExpressionType.Equal:\r\n                    rel = NSLayoutRelation.Equal;\r\n                    break;\r\n                case ExpressionType.LessThanOrEqual:\r\n                    rel = NSLayoutRelation.LessThanOrEqual;\r\n                    break;\r\n                case ExpressionType.GreaterThanOrEqual:\r\n                    rel = NSLayoutRelation.GreaterThanOrEqual;\r\n                    break;\r\n                default:\r\n                    throw new NotSupportedException (\"Not a valid relationship for a constrain.\");\r\n            }\r\n\r\n            var left = GetViewAndAttribute (expr.Left);\r\n            if (left.Item1 != constrainedView) {\r\n                left.Item1.TranslatesAutoresizingMaskIntoConstraints = false;\r\n            }\r\n\r\n            var right = GetRight (expr.Right);\r\n\r\n            return NSLayoutConstraint.Create (\r\n                left.Item1, left.Item2,\r\n                rel,\r\n                right.Item1, right.Item2,\r\n                right.Item3, right.Item4);\r\n        }\r\n\r\n        static Tuple<UIView, NSLayoutAttribute, float, float> GetRight (Expression expr)\r\n        {\r\n            var r = expr;\r\n\r\n            UIView view = null;\r\n            NSLayoutAttribute attr = NSLayoutAttribute.NoAttribute;\r\n            var mul = 1.0f;\r\n            var add = 0.0f;\r\n            var pos = true;\r\n\r\n            if (r.NodeType == ExpressionType.Add || r.NodeType == ExpressionType.Subtract) {\r\n                var rb = (BinaryExpression)r;\r\n                if (IsConstant (rb.Left)) {\r\n                    add = ConstantValue (rb.Left);\r\n                    if (r.NodeType == ExpressionType.Subtract) {\r\n                        pos = false;\r\n                    }\r\n                    r = rb.Right;\r\n                }\r\n                else if (IsConstant (rb.Right)) {\r\n                    add = ConstantValue (rb.Right);\r\n                    if (r.NodeType == ExpressionType.Subtract) {\r\n                        add = -add;\r\n                    }\r\n                    r = rb.Left;\r\n                }\r\n                else {\r\n                    throw new NotSupportedException (\"Addition only supports constants: \" + rb.Right.NodeType);\r\n                }\r\n            }\r\n\r\n            if (r.NodeType == ExpressionType.Multiply) {\r\n                var rb = (BinaryExpression)r;\r\n                if (IsConstant (rb.Left)) {\r\n                    mul = ConstantValue (rb.Left);\r\n                    r = rb.Right;\r\n                }\r\n                else if (IsConstant (rb.Right)) {\r\n                    mul = ConstantValue (rb.Right);\r\n                    r = rb.Left;\r\n                }\r\n                else {\r\n                    throw new NotSupportedException (\"Multiplication only supports constants.\");\r\n                }\r\n            }\r\n\r\n            if (IsConstant (r)) {\r\n                add = Convert.ToSingle (Eval (r));\r\n            } else if (r.NodeType == ExpressionType.MemberAccess || r.NodeType == ExpressionType.Call) {\r\n                var t = GetViewAndAttribute (r);\r\n                view = t.Item1;\r\n                attr = t.Item2;\r\n            } else {\r\n                throw new NotSupportedException (\"Unsupported layout expression node type \" + r.NodeType);\r\n            }\r\n\r\n            if (!pos)\r\n                mul = -mul;\r\n\r\n            return Tuple.Create (view, attr, mul, add);\r\n        }\r\n\r\n        static bool IsConstant (Expression expr)\r\n        {\r\n            if (expr.NodeType == ExpressionType.Constant)\r\n                return true;\r\n\r\n            if (expr.NodeType == ExpressionType.MemberAccess) {\r\n                var mexpr = (MemberExpression)expr;\r\n                var m = mexpr.Member;\r\n                if (m.MemberType == MemberTypes.Field) {\r\n                    return true;\r\n                }\r\n                return false;\r\n            }\r\n\r\n            if (expr.NodeType == ExpressionType.Convert) {\r\n                var cexpr = (UnaryExpression)expr;\r\n                return IsConstant (cexpr.Operand);\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        static float ConstantValue (Expression expr)\r\n        {\r\n            return Convert.ToSingle (Eval (expr));\r\n        }\r\n\r\n        static Tuple<UIView, NSLayoutAttribute> GetViewAndAttribute (Expression expr)\r\n        {\r\n            var attr = NSLayoutAttribute.NoAttribute;\r\n            MemberExpression frameExpr = null;\r\n\r\n            var fExpr = expr as MethodCallExpression;\r\n            if (fExpr != null) {\r\n                switch (fExpr.Method.Name) {\r\n                    case \"GetMidX\":\r\n                    case \"GetCenterX\":\r\n                        attr = NSLayoutAttribute.CenterX;\r\n                        break;\r\n                    case \"GetMidY\":\r\n                    case \"GetCenterY\":\r\n                        attr = NSLayoutAttribute.CenterY;\r\n                        break;\r\n                    case \"GetBaseline\":\r\n                        attr = NSLayoutAttribute.Baseline;\r\n                        break;\r\n                    default:\r\n                        throw new NotSupportedException (\"Method \" + fExpr.Method.Name + \" is not recognized.\");\r\n                }\r\n\r\n                frameExpr = fExpr.Arguments.FirstOrDefault () as MemberExpression;\r\n            }\r\n\r\n            if (attr == NSLayoutAttribute.NoAttribute) {\r\n                var memExpr = expr as MemberExpression;\r\n                if (memExpr == null)\r\n                    throw new NotSupportedException (\"Left hand side of a relation must be a member expression, instead it is \" + expr);\r\n\r\n                switch (memExpr.Member.Name) {\r\n                    case \"Width\":\r\n                        attr = NSLayoutAttribute.Width;\r\n                        break;\r\n                    case \"Height\":\r\n                        attr = NSLayoutAttribute.Height;\r\n                        break;\r\n                    case \"Left\":\r\n                    case \"X\":\r\n                        attr = NSLayoutAttribute.Left;\r\n                        break;\r\n                    case \"Top\":\r\n                    case \"Y\":\r\n                        attr = NSLayoutAttribute.Top;\r\n                        break;\r\n                    case \"Right\":\r\n                        attr = NSLayoutAttribute.Right;\r\n                        break;\r\n                    case \"Bottom\":\r\n                        attr = NSLayoutAttribute.Bottom;\r\n                        break;\r\n                    default:\r\n                        throw new NotSupportedException (\"Property \" + memExpr.Member.Name + \" is not recognized.\");\r\n                }\r\n\r\n                frameExpr = memExpr.Expression as MemberExpression;\r\n            }\r\n\r\n            if (frameExpr == null)\r\n                throw new NotSupportedException (\"Constraints should use the Frame or Bounds property of views.\");\r\n            var viewExpr = frameExpr.Expression;\r\n\r\n            var view = Eval (viewExpr) as UIView;\r\n            if (view == null)\r\n                throw new NotSupportedException (\"Constraints only apply to views.\");\r\n\r\n            return Tuple.Create (view, attr);\r\n        }\r\n\r\n        static object Eval (Expression expr)\r\n        {\r\n            if (expr.NodeType == ExpressionType.Constant) {\r\n                return ((ConstantExpression)expr).Value;\r\n            }\r\n\r\n            if (expr.NodeType == ExpressionType.MemberAccess) {\r\n                var mexpr = (MemberExpression)expr;\r\n                var m = mexpr.Member;\r\n                if (m.MemberType == MemberTypes.Field) {\r\n                    var f = (FieldInfo)m;\r\n                    var v = f.GetValue (Eval (mexpr.Expression));\r\n                    return v;\r\n                }\r\n            }\r\n\r\n            if (expr.NodeType == ExpressionType.Convert) {\r\n                var cexpr = (UnaryExpression)expr;\r\n                var op = Eval (cexpr.Operand);\r\n                if (cexpr.Method != null) {\r\n                    return cexpr.Method.Invoke (null, new[]{ op });\r\n                } else {\r\n                    return Convert.ChangeType (op, cexpr.Type);\r\n                }\r\n            }\r\n\r\n            return Expression.Lambda (expr).Compile ().DynamicInvoke ();\r\n        }\r\n\r\n        static void FindConstraints (Expression expr, List<BinaryExpression> constraintExprs)\r\n        {\r\n            var b = expr as BinaryExpression;\r\n            if (b == null)\r\n                return;\r\n\r\n            if (b.NodeType == ExpressionType.AndAlso) {\r\n                FindConstraints (b.Left, constraintExprs);\r\n                FindConstraints (b.Right, constraintExprs);\r\n            } else {\r\n                constraintExprs.Add (b);\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The baseline of the view whose frame is viewFrame. Use only when defining constraints.\r\n        /// </summary>\r\n        public static nfloat GetBaseline (this CoreGraphics.CGRect viewFrame)\r\n        {\r\n            return 0;\r\n        }\r\n\r\n        /// <summary>\r\n        /// The x coordinate of the center of the frame.\r\n        /// </summary>\r\n        public static nfloat GetCenterX (this CoreGraphics.CGRect viewFrame)\r\n        {\r\n            return viewFrame.X + viewFrame.Width / 2;\r\n        }\r\n\r\n        /// <summary>\r\n        /// The y coordinate of the center of the frame.\r\n        /// </summary>\r\n        public static nfloat GetCenterY (this CoreGraphics.CGRect viewFrame)\r\n        {\r\n            return viewFrame.Y + viewFrame.Height / 2;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "CodeHub.iOS/Utilities/Graphics.cs",
    "content": "using System;\nusing CoreGraphics;\nusing UIKit;\nusing Foundation;\n\nnamespace CodeHub.iOS\n{\n    public static class Graphics \n    {\n\n        public static UIImage ImageFromFont(UIFont font, char character, UIColor fillColor)\n        {\n            var s = new NSString(\"\" + character);\n            var stringSize = s.StringSize(font);\n            var maxSize = (nfloat)Math.Max(stringSize.Height, stringSize.Width);\n            var size = new CGSize(maxSize, maxSize);\n\n            UIGraphics.BeginImageContextWithOptions(size, false, 0f);\n            fillColor.SetFill();\n\n            var drawPoint = new CGPoint((size.Width / 2f) - (stringSize.Width / 2f),\n                (size.Height / 2f) - (stringSize.Height / 2f));\n            s.DrawString(drawPoint, font);\n\n            var img = UIGraphics.GetImageFromCurrentImageContext();\n            UIGraphics.EndImageContext();\n            return img;\n        }\n        \n        /// <summary>\n        ///    Creates a path for a rectangle with rounded corners\n        /// </summary>\n        /// <param name=\"rect\">\n        /// The <see cref=\"RectangleF\"/> rectangle bounds\n        /// </param>\n        /// <param name=\"radius\">\n        /// The <see cref=\"System.Single\"/> size of the rounded corners\n        /// </param>\n        /// <returns>\n        /// A <see cref=\"CGPath\"/> that can be used to stroke the rounded rectangle\n        /// </returns>\n        public static CGPath MakeRoundedRectPath (CGRect rect, float radius)\n        {\n            nfloat minx = rect.Left;\n            nfloat midx = rect.Left + (rect.Width)/2;\n            nfloat maxx = rect.Right;\n            nfloat miny = rect.Top;\n            nfloat midy = rect.Y+rect.Size.Height/2;\n            nfloat maxy = rect.Bottom;\n\n            var path = new CGPath ();\n            path.MoveToPoint (minx, midy);\n            path.AddArcToPoint (minx, miny, midx, miny, radius);\n            path.AddArcToPoint (maxx, miny, maxx, midy, radius);\n            path.AddArcToPoint (maxx, maxy, midx, maxy, radius);\n            path.AddArcToPoint (minx, maxy, minx, midy, radius);        \n            path.CloseSubpath ();\n            \n            return path;\n        }\n        \n        public static void FillRoundedRect (CGContext ctx, CGRect rect, float radius)\n        {\n                var p = Graphics.MakeRoundedRectPath (rect, radius);\n                ctx.AddPath (p);\n                ctx.FillPath ();\n        }\n\n        public static CGPath MakeRoundedPath (float size, float radius)\n        {\n            float hsize = size/2;\n            \n            var path = new CGPath ();\n            path.MoveToPoint (size, hsize);\n            path.AddArcToPoint (size, size, hsize, size, radius);\n            path.AddArcToPoint (0, size, 0, hsize, radius);\n            path.AddArcToPoint (0, 0, hsize, 0, radius);\n            path.AddArcToPoint (size, 0, size, hsize, radius);\n            path.CloseSubpath ();\n            \n            return path;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/Hud.cs",
    "content": "using BigTed;\nusing UIKit;\nusing System;\nusing System.Reactive.Disposables;\n\nnamespace CodeHub.iOS.Utilities\n{\n    public class Hud : IHud\n    {\n        public static UIColor BackgroundTint;\n        public Hud(UIView window)\n        {\n        }\n\n        public void Show(string text)\n        {\n            ProgressHUD.Shared.HudBackgroundColour = BackgroundTint;\n            BTProgressHUD.Show(text, maskType: ProgressHUD.MaskType.Gradient);\n        }\n\n        public static void ShowSuccess(string text)\n        {\n            ProgressHUD.Shared.HudBackgroundColour = BackgroundTint;\n            BTProgressHUD.ShowSuccessWithStatus(text);\n        }\n\n        public static void ShowFailure(string text)\n        {\n            ProgressHUD.Shared.HudBackgroundColour = BackgroundTint;\n            BTProgressHUD.ShowErrorWithStatus(text);\n        }\n\n        public void Hide()\n        {\n            BTProgressHUD.Dismiss();\n        }\n    }\n\n    public static class HudExtensions\n    {\n        public static IDisposable SubscribeStatus(this IObservable<bool> @this, string message)\n        {\n            var hud = new Hud(null);\n            var isShown = false;\n\n            var d = @this.Subscribe(x => {\n                if (x && !isShown)\n                    hud.Show(message);\n                else if (!x && isShown)\n                    hud.Hide();\n                isShown = x;\n            }, err => {\n                BTProgressHUD.ShowErrorWithStatus(err.Message);\n                isShown = false;\n            }, () => {\n                if (isShown)\n                    BTProgressHUD.Dismiss();\n            });\n\n            var d2 = Disposable.Create(() =>\n            {\n                if (isShown)\n                    BTProgressHUD.Dismiss();\n            });\n\n            return new CompositeDisposable(d, d2);\n        }\n\n        public static IDisposable Activate(this IHud hud, string text)\n        {\n            hud.Show(text);\n            return Disposable.Create(hud.Hide);\n        }\n    }\n\n    public interface IHud\n    {\n        void Show(string text);\n\n        void Hide();\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/NetworkActivity.cs",
    "content": "﻿using System;\r\nusing System.Reactive.Disposables;\nusing UIKit;\n\nnamespace CodeHub.iOS.Utilities\n{\n    public static class NetworkActivity\n    {\n        /// <summary>\n        ///   A shortcut to the main application\n        /// </summary>\n        public static UIApplication MainApp = UIApplication.SharedApplication;\n\n        //\n        // Since we are a multithreaded application and we could have many\n        // different outgoing network connections (api.twitter, images,\n        // searches) we need a centralized API to keep the network visibility\n        // indicator state\n        //\n        static readonly object NetworkLock = new object ();\n        static int _active;\n\n        public static void PushNetworkActive ()\n        {\n            lock (NetworkLock){\n                _active++;\n                MainApp.NetworkActivityIndicatorVisible = true;\n            }\n        }\n\n        public static void PopNetworkActive ()\n        {\n            lock (NetworkLock){\n                if (_active == 0)\n                    return;\n\n                _active--;\n                if (_active == 0)\n                    MainApp.NetworkActivityIndicatorVisible = false;\n            }\n        }\n\n        public static IDisposable ActivateNetwork()\n        {\n            PushNetworkActive();\n            return Disposable.Create(PopNetworkActive);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/ReactiveCommandExtensions.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Reactive.Linq;\nusing System.Reactive.Disposables;\nusing System.Reactive;\n\n// Analysis disable once CheckNamespace\nnamespace ReactiveUI\n{\n    public static class ReactiveCommandExtensions\n    {\n        public static IDisposable ToBarButtonItem(this IObservable<ReactiveCommand> @this, UIImage image, Action<UIBarButtonItem> assignment)\n        {\n            return ToBarButtonItem(@this, () => new UIBarButtonItem { Image = image }, assignment);\n        }\n\n        public static IDisposable ToBarButtonItem(this IObservable<ReactiveCommand> @this, UIBarButtonSystemItem systemItem, Action<UIBarButtonItem> assignment)\n        {\n            return ToBarButtonItem(@this, () => new UIBarButtonItem(systemItem), assignment);\n        }\n\n        public static IDisposable ToBarButtonItem(this IObservable<ReactiveCommand> @this, Func<UIBarButtonItem> creator, Action<UIBarButtonItem> assignment)\n        {\n            var unassignDisposable = Disposable.Create(() => assignment(null));\n            IDisposable recentEventDisposable = Disposable.Empty;\n\n            var mainDisposable = @this.Subscribe(x => {\n                recentEventDisposable?.Dispose();\n\n                var button = creator();\n                var canExecuteDisposable = x.CanExecute.Subscribe(t => button.Enabled = t);\n                var clickDisposable = Observable.FromEventPattern(t => button.Clicked += t, t => button.Clicked -= t)\n                    .Select(_ => Unit.Default)\n                    .InvokeCommand(x);\n\n                recentEventDisposable = new CompositeDisposable(clickDisposable, canExecuteDisposable);\n                assignment(button);\n            });\n\n            return new CompositeDisposable(mainDisposable, unassignDisposable, Disposable.Create(() => recentEventDisposable.Dispose()));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/ShaType.cs",
    "content": "﻿namespace CodeHub.iOS.Utilities\n{\n    public enum ShaType\n    {\n        Branch,\n        Tag,\n        Hash\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/UIImageExtensions.cs",
    "content": "using System;\r\nusing CoreGraphics;\r\nusing UIKit;\n\nnamespace MonoTouch.UIKit\n{\n    public static class UIImageHelper\n    {\n        /// <summary>\n        /// Load's an image via the FromFile.\n        /// Also checks to make sure it's on the main thread.\n        /// </summary>\n        /// <returns>The file auto.</returns>\n        /// <param name=\"filename\">Filename.</param>\n        /// <param name=\"extension\">Extension.</param>\n        public static UIImage FromFileAuto(string filename, string extension = \"png\")\n        {\n            UIImage img = null;\n            if (Foundation.NSThread.Current.IsMainThread)\n                img = LoadImageFromFile(filename, extension);\n            else\n            {\n                UIApplication.SharedApplication.InvokeOnMainThread(() => {\n                    img = LoadImageFromFile(filename, extension);\n                });\n            }\n\n            return img;\n        }\n\n        private static UIImage LoadImageFromFile(string filename, string extension = \"png\")\n        {\n            if (UIScreen.MainScreen.Scale > 1.0)\n            {\n                var file = filename + \"@2x.\" + extension;\n                return System.IO.File.Exists(file) ? UIImage.FromFile(file) : UIImage.FromFile(filename + \".\" + extension);\r\n            }\n            else\n            {\n                var file = filename + \".\" + extension;\n                return System.IO.File.Exists(file) ? UIImage.FromFile(file) : UIImage.FromFile(filename + \"@2x.\" + extension);\r\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/UIImageViewExtensions.cs",
    "content": "﻿using System;\r\nusing CodeHub.Core.Utilities;\r\nusing CodeHub.iOS;\r\nusing SDWebImage;\r\nusing Foundation;\r\n\r\n// Analysis disable once CheckNamespace\r\nnamespace UIKit\r\n{\r\n    public static class UIImageViewExtensions\r\n    {\r\n        public static void SetAvatar(this UIImageView @this, GitHubAvatar avatar, int? size = 64)\r\n        {\r\n            @this.Image = Images.Avatar;\r\n\r\n            if (avatar == null)\r\n                return;\r\n\r\n            var avatarUri = avatar.ToUri(size);\r\n            if (avatarUri != null)\r\n            {\r\n                @this.SetImage(new NSUrl(avatarUri.AbsoluteUri), Images.LoginUserUnknown, (img, err, type, imageUrl) => {\r\n                    if (img == null || err != null)\r\n                        return;\r\n\r\n                    if (type == SDImageCacheType.None)\r\n                    {\r\n                        @this.Image = Images.Avatar;\r\n                        @this.BeginInvokeOnMainThread(() =>\r\n                            UIView.Transition(@this, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve, () => @this.Image = img, null));\r\n                    }\r\n                });\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/UIKitExtensions.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing System.Reactive;\nusing Foundation;\nusing System.Linq;\nusing System.Reactive.Disposables;\n\n// Analysis disable once CheckNamespace\nnamespace UIKit\n{\n    public static class UIKitExtensions\n    {\n        public static IObservable<int> GetChangedObservable(this UISegmentedControl @this)\n        {\n            return Observable.FromEventPattern(t => @this.ValueChanged += t, t => @this.ValueChanged -= t).Select(_ => (int)@this.SelectedSegment);\n        }\n\n        public static IObservable<string> GetChangedObservable(this UITextField @this)\n        {\n            return Observable.FromEventPattern(t => @this.EditingChanged += t, t => @this.EditingChanged -= t).Select(_ => @this.Text);\n        }\n\n        public static IObservable<string> GetChangedObservable(this UITextView @this)\n        {\n            return Observable.FromEventPattern(t => @this.Changed += t, t => @this.Changed -= t).Select(_ => @this.Text);\n        }\n\n        public static IObservable<Unit> GetClickedObservable(this UIButton @this)\n        {\n            return Observable.FromEventPattern(t => @this.TouchUpInside += t, t => @this.TouchUpInside -= t).Select(_ => Unit.Default);\n        }\n\n        public static IObservable<UIBarButtonItem> GetClickedObservable(this UIBarButtonItem @this)\n        {\n            return Observable.FromEventPattern(t => @this.Clicked += t, t => @this.Clicked -= t).Select(_ => @this);\n        }\n\n        public static IObservable<Unit> GetChangedObservable(this UIRefreshControl @this)\n        {\n            return Observable.FromEventPattern(t => @this.ValueChanged += t, t => @this.ValueChanged -= t).Select(_ => Unit.Default);\n        }\n\n        public static IObservable<string> GetChangedObservable(this UISearchBar @this)\n        {\n            return Observable.FromEventPattern<UISearchBarTextChangedEventArgs>(t => @this.TextChanged += t, t => @this.TextChanged -= t).Select(_ => @this.Text);\n        }\n\n        public static IObservable<Unit> GetSearchObservable(this UISearchBar @this)\n        {\n            return Observable.FromEventPattern(t => @this.SearchButtonClicked += t, t => @this.SearchButtonClicked -= t).Select(_ => Unit.Default);\n        }\n\n        public static void SetLoading(this UIActivityIndicatorView @this, bool loading)\n        {\n            if (loading)\n                @this.StartAnimating();\n            else\n                @this.StopAnimating();\n        }\n\n        public static IDisposable DisableInteraction(this UIApplication application)\n        {\n            application.BeginIgnoringInteractionEvents();\n            return Disposable.Create(application.EndIgnoringInteractionEvents);\n        }\n\n        public static string GetVersion(this UIApplication _) \n        {\n            string shortVersion = string.Empty;\n            string bundleVersion = string.Empty;\n\n            try\n            {\n                shortVersion = NSBundle.MainBundle.InfoDictionary[\"CFBundleShortVersionString\"].ToString();\n            }\n            catch { }\n\n            try\n            {\n                bundleVersion = NSBundle.MainBundle.InfoDictionary[\"CFBundleVersion\"].ToString();\n            }\n            catch { }\n\n            if (string.Equals(shortVersion, bundleVersion))\n                return shortVersion;\n\n            return string.IsNullOrEmpty(bundleVersion) ? shortVersion : string.Format(\"{0} ({1})\", shortVersion, bundleVersion);\n        }\n\n        public static bool LastItemVisible(this UITableView tableView)\n        {\n            var paths = tableView.IndexPathsForVisibleRows;\n            var sections = tableView.NumberOfSections();\n            if (sections == 0)\n                return true;\n\n            var rows = tableView.NumberOfRowsInSection(sections - 1);\n            if (rows == 0)\n                return true;\n\n            var indexPath = NSIndexPath.FromItemSection(rows - 1, sections - 1);\n            return paths.Contains(indexPath);\n        }\n\n        public static void PushViewController(this UIViewController This, UIViewController view)\n            => This.NavigationController?.PushViewController(view, true);\n\n        public static void PresentModalViewController(this UIViewController This, UIViewController view)\n        {\n            view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            view.NavigationItem.LeftBarButtonItem.GetClickedObservable().Subscribe(\n                _ => This.DismissViewController(true, null));\n                \n            var navController = new UINavigationController(view);\n            This.PresentViewController(navController, true, null);\n        }\n    }\n\n    public static class UIFontExtensions\n    {\n        public static UIFont MakeBold(this UIFont font)\n        {\n            var descriptor = font.FontDescriptor.CreateWithTraits(UIFontDescriptorSymbolicTraits.Bold);\n            if (descriptor == null)\n                return font;\n\n            return UIFont.FromDescriptor(descriptor, font.PointSize);\n        }\n\n        public static UIFont MakeItalic(this UIFont font)\n        {\n            var descriptor = font.FontDescriptor.CreateWithTraits(UIFontDescriptorSymbolicTraits.Italic);\n            if (descriptor == null)\n                return font;\n            \n            return UIFont.FromDescriptor(descriptor, font.PointSize);\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/UIWindowExtensions.cs",
    "content": "﻿// Analysis disable once CheckNamespace\r\nnamespace UIKit\r\n{\r\n    public static class UIWindowExtensions\r\n    {\r\n        public static UIViewController GetVisibleViewController(this UIWindow @this)\r\n        {\r\n            var topViewController = @this.RootViewController;\r\n            while (topViewController.PresentedViewController != null)\r\n                topViewController = topViewController.PresentedViewController;\r\n            return topViewController;\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/Utilities/ViewControllerExtensions.cs",
    "content": "using System;\r\nusing System.Threading.Tasks;\r\nusing CodeHub.iOS.Services;\nusing UIKit;\r\n\r\nnamespace CodeHub.iOS.Utilities\n{\n    public static class ViewControllerExtensions\n    {\r\n        public static void ShowError(this UIViewController viewController, string title, Exception exception)\r\n        {\n            AlertDialogService.ShowAlert(title, exception.Message);\r\n        }\r\n\r\n        public static IHud CreateHud(this UIViewController controller)\r\n        {\r\n            return new Hud(controller.View);\r\n        }\r\n\r\n        public async static Task<T> DoWorkAsync<T>(this UIViewController controller, string workTitle, Func<Task<T>> work)\r\n        {\r\n            var hud = CreateHud(controller);\r\n            hud.Show(workTitle);\r\n\r\n            //Make sure the Toolbar is disabled too\r\n            if (controller.ToolbarItems != null)\r\n            {\r\n                foreach (var t in controller.ToolbarItems)\r\n                    t.Enabled = false;\r\n            }\r\n\r\n            try\r\n            {\r\n                NetworkActivity.PushNetworkActive();\r\n                return await work();\r\n            }\r\n            finally\r\n            {\r\n                NetworkActivity.PopNetworkActive();\r\n\r\n                hud.Hide();\r\n\r\n                //Enable all the toolbar items\r\n                if (controller.ToolbarItems != null)\r\n                {\r\n                    foreach (var t in controller.ToolbarItems)\r\n                        t.Enabled = true;\r\n                }\r\n            }\r\n        }\r\n\n        public async static Task DoWorkAsync(this UIViewController controller, string workTitle, Func<Task> work)\n        {\n            var hud = CreateHud(controller);\r\n            hud.Show(workTitle);\n\n            //Make sure the Toolbar is disabled too\n            if (controller.ToolbarItems != null)\n            {\n                foreach (var t in controller.ToolbarItems)\n                    t.Enabled = false;\n            }\n\n            try\n            {\r\n                NetworkActivity.PushNetworkActive();\r\n                await work();\n            }\n            finally\n            {\r\n                NetworkActivity.PopNetworkActive();\r\n\r\n                hud.Hide();\n\n                //Enable all the toolbar items\n                if (controller.ToolbarItems != null)\n                {\n                    foreach (var t in controller.ToolbarItems)\n                        t.Enabled = true;\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/AccountsViewController.cs",
    "content": "using CodeHub.Core.Services;\nusing UIKit;\nusing Foundation;\nusing System;\nusing CodeHub.Core.Data;\nusing CoreGraphics;\nusing CodeHub.iOS.DialogElements;\nusing System.Linq;\nusing ReactiveUI;\nusing CodeHub.Core.Messages;\nusing Splat;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.iOS.ViewControllers.Accounts\n{\n    public class AccountsViewController : DialogViewController\n    {\n        private readonly IAccountsService _accountsService = Locator.Current.GetService<IAccountsService>();\n        private readonly IApplicationService _applicationService = Locator.Current.GetService<IApplicationService>();\n\n        public AccountsViewController() : base(UITableViewStyle.Plain)\n        {\n            Title = \"Accounts\";\n\n            var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add);\n            NavigationItem.RightBarButtonItem = addButton;\n            OnActivation(d => d(addButton.GetClickedObservable().Subscribe(_ => AddAccount())));\n        }\n\n        private void AddAccount()\n        {\n            NavigationController.PushViewController(new NewAccountViewController(), true);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            TableView.RowHeight = 74;\n        }\n\n        private async Task SelectAccount(Account account)\n        {\n            await _accountsService.SetActiveAccount(account);\n            MessageBus.Current.SendMessage(new LogoutMessage());\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            var weakVm = new WeakReference<AccountsViewController>(this);\n            var accountSection = new Section();\n\n            var activeAccount = _accountsService.GetActiveAccount().Result;\n            accountSection.AddAll(_accountsService.GetAccounts().Result.Select(account =>\n            {\n                var isEqual = account.Id == activeAccount?.Id;\n                var t = new AccountElement(account, isEqual);\n                t.Tapped += () => weakVm.Get()?.SelectAccount(account);\n                return t;\n            }));\n            Root.Reset(accountSection);\n\n            SetCancelButton();\n        }\n\n        public override DialogViewController.Source CreateSizingSource()\n        {\n            return new EditSource(this);\n        }\n\n        private void Delete(Element element)\n        {\n            var accountElement = element as AccountElement;\n            if (accountElement == null)\n                return;\n\n            //Remove the designated username\n            _accountsService.Remove(accountElement.Account);\n            var activeAccount = _accountsService.GetActiveAccount().Result;\n\n            if (activeAccount != null && activeAccount.Equals(accountElement.Account))\n            {\n                _applicationService.DeactivateUser();   \n            }\n\n            SetCancelButton();\n        }\n\n        private void SetCancelButton()\n        {\n            if (NavigationItem.LeftBarButtonItem != null)\n            {\n                NavigationItem.LeftBarButtonItem.Enabled = Root.Sum(x => x.Elements.Count) > 0 && _applicationService.Account != null;\n            }\n        }\n\n        private class EditSource : DialogViewController.Source\n        {\n            public EditSource(AccountsViewController dvc) : base (dvc)\n            {\n            }\n\n            public override bool CanEditRow(UITableView tableView, NSIndexPath indexPath)\n            {\n                return true;\n            }\n\n            public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, NSIndexPath indexPath)\n            {\n                return UITableViewCellEditingStyle.Delete;\n            }\n\n            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)\n            {\n                if (indexPath == null)\n                    return;\n\n                switch (editingStyle)\n                {\n                    case UITableViewCellEditingStyle.Delete:\n                        var section = Container.Root[indexPath.Section];\n                        var element = section[indexPath.Row];\n                        section.Remove(element);\n                        (Container as AccountsViewController)?.Delete(element);\n                        break;\n                }\n            }\n        }\n\n        /// <summary>\n        /// An element that represents an account object\n        /// </summary>\n        protected class AccountElement : Element\n        {\n            public event Action Tapped;\n\n            private readonly bool _currentAccount;\n\n            public Account Account { get; private set; }\n\n            public AccountElement(Account account, bool currentAccount)\n            {\n                Account = account;\n                _currentAccount = currentAccount;\n            }\n\n            public override UITableViewCell GetCell(UITableView tv)\n            {\n                var cell = (tv.DequeueReusableCell(AccountCellView.Key) as AccountCellView) ?? new AccountCellView();\n                cell.Accessory = _currentAccount ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\n                cell.TextLabel.Text = Account.Username;\n                cell.DetailTextLabel.Text = Account.IsEnterprise ? Account.WebDomain : \"GitHub.com\";\n                cell.ImageView.TintColor = Theme.CurrentTheme.PrimaryColor;\n                cell.ImageView.SetAvatar(new CodeHub.Core.Utilities.GitHubAvatar(Account.AvatarUrl));\n                return cell;\n            }\n\n            public override void Selected (UITableView tableView, NSIndexPath indexPath)\n            {\n                base.Selected(tableView, indexPath);\n                Tapped?.Invoke();\n            }\n        }\n\n        public class AccountCellView : UITableViewCell\n        {\n            public static NSString Key = new NSString(\"ProfileCell\");\n\n\n            public AccountCellView()\n                : base(UITableViewCellStyle.Subtitle, Key)\n            {\n                ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n                ImageView.Layer.MinificationFilter = CoreAnimation.CALayer.FilterTrilinear;\n                ImageView.Layer.MasksToBounds = true;\n\n                TextLabel.TextColor = UIColor.FromWhiteAlpha(0.0f, 1f);\n                TextLabel.Font = UIFont.FromName(\"HelveticaNeue\", 17f);\n\n                DetailTextLabel.TextColor = UIColor.FromWhiteAlpha(0.1f, 1f);\n                DetailTextLabel.Font = UIFont.FromName(\"HelveticaNeue-Thin\", 14f);\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n\n                var imageSize = this.Bounds.Height - 30f;\n                ImageView.Layer.CornerRadius = imageSize / 2;\n                ImageView.Frame = new CGRect(15, 15, imageSize, imageSize);\n\n                var titlePoint = new CGPoint(ImageView.Frame.Right + 15f, 19f);\n                TextLabel.Frame = new CGRect(titlePoint.X, titlePoint.Y, this.ContentView.Bounds.Width - titlePoint.X - 10f, TextLabel.Font.LineHeight);\n                DetailTextLabel.Frame = new CGRect(titlePoint.X, TextLabel.Frame.Bottom, this.ContentView.Bounds.Width - titlePoint.X - 10f, DetailTextLabel.Font.LineHeight + 1);\n\n                SeparatorInset = new UIEdgeInsets(0, TextLabel.Frame.Left, 0, 0);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/AddAccountView.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"13529\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" colorMatched=\"YES\">\n    <device id=\"retina4_7\" orientation=\"portrait\">\n        <adaptation id=\"fullscreen\"/>\n    </device>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"13527\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"AddAccountView\">\n            <connections>\n                <outlet property=\"AuthenticationSelector\" destination=\"DV9-5H-ByQ\" id=\"d1P-3c-437\"/>\n                <outlet property=\"ContainerView\" destination=\"L4d-oX-MaS\" id=\"3JJ-0x-IYL\"/>\n                <outlet property=\"DescriptionLabel\" destination=\"TFn-T3-oRl\" id=\"gNs-QT-NpZ\"/>\n                <outlet property=\"Domain\" destination=\"31\" id=\"32\"/>\n                <outlet property=\"LoginButton\" destination=\"29\" id=\"30\"/>\n                <outlet property=\"Logo\" destination=\"15\" id=\"24\"/>\n                <outlet property=\"Password\" destination=\"5\" id=\"22\"/>\n                <outlet property=\"ScrollView\" destination=\"27\" id=\"28\"/>\n                <outlet property=\"StackView\" destination=\"q3t-2k-NE3\" id=\"9xK-pS-Csk\"/>\n                <outlet property=\"TokenTextField\" destination=\"vCn-Ld-C2W\" id=\"D5E-bZ-J48\"/>\n                <outlet property=\"User\" destination=\"4\" id=\"21\"/>\n                <outlet property=\"view\" destination=\"1\" id=\"3\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"1\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <view contentMode=\"scaleToFill\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"L4d-oX-MaS\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                    <subviews>\n                        <scrollView clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"scaleToFill\" showsHorizontalScrollIndicator=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"27\">\n                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                            <subviews>\n                                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"29\">\n                                    <rect key=\"frame\" x=\"87.5\" y=\"456\" width=\"200\" height=\"33\"/>\n                                    <constraints>\n                                        <constraint firstAttribute=\"height\" constant=\"33\" id=\"9UU-yW-ti2\"/>\n                                        <constraint firstAttribute=\"width\" constant=\"200\" id=\"TJs-WI-AmC\"/>\n                                    </constraints>\n                                    <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"14\"/>\n                                    <state key=\"normal\" title=\"Login!\">\n                                        <color key=\"titleColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                        <color key=\"titleShadowColor\" red=\"0.5\" green=\"0.5\" blue=\"0.5\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                    </state>\n                                </button>\n                                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"15\">\n                                    <rect key=\"frame\" x=\"97.5\" y=\"48\" width=\"180\" height=\"180\"/>\n                                    <constraints>\n                                        <constraint firstAttribute=\"height\" constant=\"180\" id=\"8ZM-rD-SMi\"/>\n                                        <constraint firstAttribute=\"width\" constant=\"180\" id=\"SHR-ic-7oP\"/>\n                                    </constraints>\n                                </imageView>\n                                <stackView opaque=\"NO\" contentMode=\"scaleToFill\" axis=\"vertical\" spacing=\"8\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"q3t-2k-NE3\">\n                                    <rect key=\"frame\" x=\"67\" y=\"260\" width=\"240\" height=\"180\"/>\n                                    <subviews>\n                                        <textField opaque=\"NO\" clipsSubviews=\"YES\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Domain\" minimumFontSize=\"17\" clearButtonMode=\"whileEditing\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"31\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"240\" height=\"30\"/>\n                                            <color key=\"backgroundColor\" red=\"0.23529411764705882\" green=\"0.23529411764705882\" blue=\"0.23529411764705882\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <constraints>\n                                                <constraint firstAttribute=\"width\" constant=\"240\" id=\"sUO-pP-yXT\"/>\n                                            </constraints>\n                                            <color key=\"textColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                            <textInputTraits key=\"textInputTraits\" autocorrectionType=\"no\" returnKeyType=\"next\"/>\n                                        </textField>\n                                        <segmentedControl opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"top\" segmentControlStyle=\"plain\" selectedSegmentIndex=\"0\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"DV9-5H-ByQ\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"38\" width=\"240\" height=\"29\"/>\n                                            <segments>\n                                                <segment title=\"Credentials\"/>\n                                                <segment title=\"Token\"/>\n                                            </segments>\n                                        </segmentedControl>\n                                        <textField opaque=\"NO\" clipsSubviews=\"YES\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Username\" minimumFontSize=\"17\" clearButtonMode=\"whileEditing\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"4\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"74\" width=\"240\" height=\"30\"/>\n                                            <color key=\"backgroundColor\" red=\"0.23529411759999999\" green=\"0.23529411759999999\" blue=\"0.23529411759999999\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"textColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                            <textInputTraits key=\"textInputTraits\" autocorrectionType=\"no\" returnKeyType=\"next\"/>\n                                        </textField>\n                                        <textField opaque=\"NO\" clipsSubviews=\"YES\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Password\" clearsOnBeginEditing=\"YES\" minimumFontSize=\"17\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"5\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"112\" width=\"240\" height=\"30\"/>\n                                            <color key=\"backgroundColor\" red=\"0.23529411759999999\" green=\"0.23529411759999999\" blue=\"0.23529411759999999\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"textColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                            <textInputTraits key=\"textInputTraits\" autocorrectionType=\"no\" returnKeyType=\"go\" secureTextEntry=\"YES\"/>\n                                        </textField>\n                                        <textField opaque=\"NO\" clipsSubviews=\"YES\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Token\" clearsOnBeginEditing=\"YES\" minimumFontSize=\"17\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"vCn-Ld-C2W\">\n                                            <rect key=\"frame\" x=\"0.0\" y=\"150\" width=\"240\" height=\"30\"/>\n                                            <color key=\"backgroundColor\" red=\"0.23529411759999999\" green=\"0.23529411759999999\" blue=\"0.23529411759999999\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <color key=\"textColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                                            <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                            <textInputTraits key=\"textInputTraits\" autocorrectionType=\"no\" returnKeyType=\"go\"/>\n                                        </textField>\n                                    </subviews>\n                                    <constraints>\n                                        <constraint firstAttribute=\"width\" constant=\"240\" id=\"xnF-h1-hMZ\"/>\n                                    </constraints>\n                                </stackView>\n                                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Label\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"TFn-T3-oRl\">\n                                    <rect key=\"frame\" x=\"67\" y=\"515\" width=\"240\" height=\"16\"/>\n                                    <fontDescription key=\"fontDescription\" style=\"UICTFontTextStyleFootnote\"/>\n                                    <nil key=\"textColor\"/>\n                                    <nil key=\"highlightedColor\"/>\n                                </label>\n                            </subviews>\n                            <constraints>\n                                <constraint firstItem=\"29\" firstAttribute=\"centerX\" secondItem=\"27\" secondAttribute=\"centerX\" id=\"0MD-9C-Nek\"/>\n                                <constraint firstItem=\"29\" firstAttribute=\"top\" secondItem=\"q3t-2k-NE3\" secondAttribute=\"bottom\" constant=\"16\" id=\"3WQ-qc-Lh8\"/>\n                                <constraint firstAttribute=\"bottom\" secondItem=\"TFn-T3-oRl\" secondAttribute=\"bottom\" constant=\"30\" id=\"G63-xu-K68\"/>\n                                <constraint firstItem=\"TFn-T3-oRl\" firstAttribute=\"leading\" secondItem=\"q3t-2k-NE3\" secondAttribute=\"leading\" id=\"LQR-66-2a7\"/>\n                                <constraint firstAttribute=\"trailing\" secondItem=\"29\" secondAttribute=\"trailing\" constant=\"15\" id=\"Mg4-Ne-n9C\"/>\n                                <constraint firstItem=\"q3t-2k-NE3\" firstAttribute=\"top\" secondItem=\"15\" secondAttribute=\"bottom\" constant=\"32\" id=\"PL6-yj-gYB\"/>\n                                <constraint firstItem=\"15\" firstAttribute=\"top\" secondItem=\"27\" secondAttribute=\"top\" constant=\"48\" id=\"YvU-yu-wSc\"/>\n                                <constraint firstItem=\"TFn-T3-oRl\" firstAttribute=\"top\" secondItem=\"29\" secondAttribute=\"bottom\" constant=\"26\" id=\"b6b-fx-loU\"/>\n                                <constraint firstItem=\"TFn-T3-oRl\" firstAttribute=\"trailing\" secondItem=\"q3t-2k-NE3\" secondAttribute=\"trailing\" id=\"hn9-Kb-rID\"/>\n                                <constraint firstItem=\"15\" firstAttribute=\"centerX\" secondItem=\"27\" secondAttribute=\"centerX\" id=\"rcY-OY-XgO\"/>\n                                <constraint firstItem=\"q3t-2k-NE3\" firstAttribute=\"centerX\" secondItem=\"27\" secondAttribute=\"centerX\" id=\"xKw-br-xbi\"/>\n                            </constraints>\n                        </scrollView>\n                    </subviews>\n                    <color key=\"backgroundColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"0.0\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    <constraints>\n                        <constraint firstItem=\"27\" firstAttribute=\"top\" secondItem=\"L4d-oX-MaS\" secondAttribute=\"top\" id=\"2x1-WV-qtK\"/>\n                        <constraint firstAttribute=\"trailing\" secondItem=\"27\" secondAttribute=\"trailing\" id=\"JFP-Qd-3aF\"/>\n                        <constraint firstAttribute=\"bottom\" secondItem=\"27\" secondAttribute=\"bottom\" id=\"ZFb-oB-CBx\"/>\n                        <constraint firstItem=\"27\" firstAttribute=\"leading\" secondItem=\"L4d-oX-MaS\" secondAttribute=\"leading\" id=\"bt4-Y7-W7A\"/>\n                    </constraints>\n                </view>\n            </subviews>\n            <constraints>\n                <constraint firstAttribute=\"bottom\" secondItem=\"L4d-oX-MaS\" secondAttribute=\"bottom\" id=\"199-YR-672\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"L4d-oX-MaS\" secondAttribute=\"trailing\" id=\"IZw-6k-b6s\"/>\n                <constraint firstItem=\"L4d-oX-MaS\" firstAttribute=\"top\" secondItem=\"1\" secondAttribute=\"top\" id=\"esx-Hh-Ev1\"/>\n                <constraint firstItem=\"L4d-oX-MaS\" firstAttribute=\"leading\" secondItem=\"1\" secondAttribute=\"leading\" id=\"iJm-7r-giI\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"269.5\" y=\"444.5\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/AddAccountViewController.cs",
    "content": "using CoreGraphics;\nusing CodeHub.Core.ViewModels.Accounts;\nusing Foundation;\nusing UIKit;\nusing CodeHub.iOS.Utilities;\nusing System;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.iOS.ViewControllers.Accounts\n{\n    public partial class AddAccountViewController : BaseViewController\n    {\n        private readonly UIColor ComponentTextColor = UIColor.White;\n        private readonly UIColor EnterpriseBackgroundColor = UIColor.FromRGB(50, 50, 50);\n        private readonly UIColor ComponentBackground = UIColor.FromRGB(0x3C, 0x3C, 0x3C);\n\n        public AddAccountViewModel ViewModel { get; } = new AddAccountViewModel();\n\n        public AddAccountViewController()\n            : base(\"AddAccountView\", null)\n        {\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem();\n\n            Title = \"Login\";\n\n            OnActivation(d =>\n            {\n                d(this.WhenAnyObservable(x => x.ViewModel.LoginCommand.IsExecuting)\n                  .SubscribeStatus(\"Logging in...\"));\n            });\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var scopes = string.Join(\", \", OctokitClientFactory.Scopes);\n            DescriptionLabel.Text = string.Format(\"The provided Personal Access Token must allow access to the following scopes: {0}\", scopes);\n            DescriptionLabel.TextColor = ComponentTextColor;\n\n            AuthenticationSelector.TintColor = ComponentTextColor.ColorWithAlpha(0.9f);\n\n            View.BackgroundColor = EnterpriseBackgroundColor;\n            Logo.Image = Images.Logos.EnterpriseMascot;\n\n            LoginButton.SetBackgroundImage(Images.Buttons.BlackButton.CreateResizableImage(new UIEdgeInsets(18, 18, 18, 18)), UIControlState.Normal);\n            LoginButton.Enabled = true;\n\n            //Set some generic shadowing\n            LoginButton.Layer.ShadowColor = UIColor.Black.CGColor;\n            LoginButton.Layer.ShadowOffset = new CGSize(0, 1);\n            LoginButton.Layer.ShadowOpacity = 0.2f;\n\n            var attributes = new UIStringAttributes {\n                ForegroundColor = UIColor.LightGray,\n            };\n\n            Domain.AttributedPlaceholder = new NSAttributedString(\"Domain\", attributes);\n            User.AttributedPlaceholder = new NSAttributedString(\"Username\", attributes);\n            Password.AttributedPlaceholder = new NSAttributedString(\"Password\", attributes);\n            TokenTextField.AttributedPlaceholder = new NSAttributedString(\"Token\", attributes);\n\n            foreach (var i in new [] { Domain, User, Password, TokenTextField })\n            {\n                i.Layer.BorderColor = UIColor.Black.CGColor;\n                i.Layer.BorderWidth = 1;\n                i.Layer.CornerRadius = 4;\n            }\n\n            SelectAuthenticationScheme(0);\n\n            Domain.ShouldReturn = delegate {\n                User.BecomeFirstResponder();\n                return true;\n            };\n\n            User.ShouldReturn = delegate {\n                Password.BecomeFirstResponder();\n                return true;\n            };\n\n            Password.ShouldReturn = delegate {\n                Password.ResignFirstResponder();\n                LoginButton.SendActionForControlEvents(UIControlEvent.TouchUpInside);\n                return true;\n            };\n\n            OnActivation(d =>\n            {\n                d(User.GetChangedObservable()\n                  .Subscribe(x => ViewModel.Username = x));\n                \n                d(Password.GetChangedObservable()\n                  .Subscribe(x => ViewModel.Password = x));\n                \n                d(Domain.GetChangedObservable()\n                  .Subscribe(x => ViewModel.Domain = x));\n\n                d(TokenTextField.GetChangedObservable()\n                  .Subscribe(x => ViewModel.Token = x));\n                \n                d(LoginButton.GetClickedObservable()\n                  .InvokeReactiveCommand(ViewModel.LoginCommand));\n\n                d(AuthenticationSelector.GetChangedObservable()\n                  .Do(x => ViewModel.TokenAuthentication = x == 1)\n                  .Subscribe(SelectAuthenticationScheme));\n\n                d(this.WhenAnyObservable(x => x.ViewModel.LoginCommand.CanExecute)\n                  .Subscribe(x => LoginButton.Enabled = x));\n\n                d(this.WhenAnyValue(x => x.ViewModel.TokenAuthentication)\n                  .Subscribe(x => AuthenticationSelector.SelectedSegment = x ? 1 : 0));\n            });\n        }\n\n        private void SelectAuthenticationScheme(int scheme)\n        {\n            UIView.Animate(0.3, () =>\n            {\n                if (scheme == 0)\n                {\n                    TokenTextField.Hidden = true;\n                    User.Hidden = false;\n                    Password.Hidden = false;\n                }\n                else\n                {\n                    TokenTextField.Hidden = false;\n                    User.Hidden = true;\n                    Password.Hidden = true;\n                }\n            });\n\n            UIView.Animate(0.3, 0, UIViewAnimationOptions.TransitionCrossDissolve,\n                           () => DescriptionLabel.Alpha = scheme == 0 ? 0 : 1, null);\n        }\n\n        NSObject _hideNotification, _showNotification;\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            _hideNotification = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, OnKeyboardHideNotification);\n            _showNotification = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillShowNotification, OnKeyboardNotification);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            NSNotificationCenter.DefaultCenter.RemoveObserver(_hideNotification);\n            NSNotificationCenter.DefaultCenter.RemoveObserver(_showNotification);\n        }\n\n        private void OnKeyboardHideNotification(NSNotification notification)\n        {\n            ScrollView.ContentInset = UIEdgeInsets.Zero;\n            ScrollView.ScrollIndicatorInsets = UIEdgeInsets.Zero;\n        }\n\n        private void OnKeyboardNotification (NSNotification notification)\n        {\n            var keyboardFrame = UIKeyboard.FrameEndFromNotification (notification);\n            var inset = new UIEdgeInsets(0, 0, keyboardFrame.Height, 0);\n            ScrollView.ContentInset = inset;\n            ScrollView.ScrollIndicatorInsets = inset;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/AddAccountViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Visual Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Accounts\n{\n\t[Register (\"AddAccountView\")]\n\tpartial class AddAccountViewController\n\t{\n\t\t[Outlet]\n\t\tUIKit.UISegmentedControl AuthenticationSelector { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIView ContainerView { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UILabel DescriptionLabel { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UITextField Domain { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIButton LoginButton { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIImageView Logo { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UITextField Password { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIScrollView ScrollView { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UIStackView StackView { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UITextField TokenTextField { get; set; }\n\n\t\t[Outlet]\n\t\tUIKit.UITextField User { get; set; }\n\t\t\n\t\tvoid ReleaseDesignerOutlets ()\n\t\t{\n\t\t\tif (ContainerView != null) {\n\t\t\t\tContainerView.Dispose ();\n\t\t\t\tContainerView = null;\n\t\t\t}\n\n\t\t\tif (Domain != null) {\n\t\t\t\tDomain.Dispose ();\n\t\t\t\tDomain = null;\n\t\t\t}\n\n\t\t\tif (LoginButton != null) {\n\t\t\t\tLoginButton.Dispose ();\n\t\t\t\tLoginButton = null;\n\t\t\t}\n\n\t\t\tif (Logo != null) {\n\t\t\t\tLogo.Dispose ();\n\t\t\t\tLogo = null;\n\t\t\t}\n\n\t\t\tif (Password != null) {\n\t\t\t\tPassword.Dispose ();\n\t\t\t\tPassword = null;\n\t\t\t}\n\n\t\t\tif (ScrollView != null) {\n\t\t\t\tScrollView.Dispose ();\n\t\t\t\tScrollView = null;\n\t\t\t}\n\n\t\t\tif (User != null) {\n\t\t\t\tUser.Dispose ();\n\t\t\t\tUser = null;\n\t\t\t}\n\n\t\t\tif (StackView != null) {\n\t\t\t\tStackView.Dispose ();\n\t\t\t\tStackView = null;\n\t\t\t}\n\n\t\t\tif (TokenTextField != null) {\n\t\t\t\tTokenTextField.Dispose ();\n\t\t\t\tTokenTextField = null;\n\t\t\t}\n\n\t\t\tif (AuthenticationSelector != null) {\n\t\t\t\tAuthenticationSelector.Dispose ();\n\t\t\t\tAuthenticationSelector = null;\n\t\t\t}\n\n\t\t\tif (DescriptionLabel != null) {\n\t\t\t\tDescriptionLabel.Dispose ();\n\t\t\t\tDescriptionLabel = null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/NewAccountViewController.cs",
    "content": "using System;\nusing CoreGraphics;\nusing UIKit;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.ViewControllers.Application;\nusing Splat;\n\nnamespace CodeHub.iOS.ViewControllers.Accounts\n{\n    public class NewAccountViewController : BaseViewController\n    {\n        private readonly IFeaturesService _featuresService;\n        private readonly UIColor DotComBackgroundColor = UIColor.FromRGB(239, 239, 244);\n        private readonly UIColor EnterpriseBackgroundColor = UIColor.FromRGB(50, 50, 50);\n\n        public NewAccountViewController(IFeaturesService featuresService = null)\n        {\n            _featuresService = featuresService ?? Locator.Current.GetService<IFeaturesService>();\n\n            Title = \"New Account\";\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var dotComButton = new AccountButton(\"GitHub.com\", Images.Logos.DotComMascot);\n            var enterpriseButton = new AccountButton(\"Enterprise\", Images.Logos.EnterpriseMascot);\n\n            dotComButton.BackgroundColor = DotComBackgroundColor;\n            dotComButton.Label.TextColor = EnterpriseBackgroundColor;\n            dotComButton.ImageView.TintColor = EnterpriseBackgroundColor;\n\n            enterpriseButton.BackgroundColor = EnterpriseBackgroundColor;\n            enterpriseButton.Label.TextColor = dotComButton.BackgroundColor;\n            enterpriseButton.ImageView.TintColor = dotComButton.BackgroundColor;\n\n            Add(dotComButton);\n            Add(enterpriseButton);\n\n            View.ConstrainLayout(() => \n                dotComButton.Frame.Top == View.Frame.Top &&\n                dotComButton.Frame.Left == View.Frame.Left &&\n                dotComButton.Frame.Right == View.Frame.Right &&\n                dotComButton.Frame.Bottom == View.Frame.GetMidY() &&\n\n                enterpriseButton.Frame.Top == dotComButton.Frame.Bottom &&\n                enterpriseButton.Frame.Left == View.Frame.Left &&\n                enterpriseButton.Frame.Right == View.Frame.Right &&\n                enterpriseButton.Frame.Bottom == View.Frame.Bottom);\n\n            OnActivation(d =>\n            {\n                d(dotComButton.GetClickedObservable().Subscribe(_ => DotComButtonTouch()));\n                d(enterpriseButton.GetClickedObservable().Subscribe(_ => EnterpriseButtonTouch()));\n            });\n        }\n\n        private void DotComButtonTouch ()\n        {\n            NavigationController.PushViewController(new OAuthLoginViewController(), true);\n        }\n\n        private void EnterpriseButtonTouch ()\n        {\n            if (_featuresService.IsProEnabled)\n            {\n                NavigationController.PushViewController(new AddAccountViewController(), true);\n            }\n            else\n            {\n                UpgradeViewController.Present(this);\n            }\n        }\n\n        private class AccountButton : UIButton\n        {\n            public UILabel Label { get; private set; }\n\n            public new UIImageView ImageView { get; private set; }\n\n            public AccountButton(string text, UIImage image)\n                : base(new CGRect(0, 0, 100, 100))\n            {\n                Label = new UILabel(new CGRect(0, 0, 100, 100));\n                Label.Text = text;\n                Label.TextAlignment = UITextAlignment.Center;\n                Add(Label);\n\n                ImageView = new UIImageView(new CGRect(0, 0, 100, 100));\n                ImageView.Image = image;\n                ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n                Add(ImageView);\n\n                this.ConstrainLayout(() => \n                    ImageView.Frame.Top == this.Frame.Top + 30f &&\n                    ImageView.Frame.Left == this.Frame.Left &&\n                    ImageView.Frame.Right == this.Frame.Right &&\n                    ImageView.Frame.Bottom == this.Frame.Bottom - 60f &&\n\n                    Label.Frame.Top == ImageView.Frame.Bottom + 10f &&\n                    Label.Frame.Left == this.Frame.Left &&\n                    Label.Frame.Right == this.Frame.Right &&\n                    Label.Frame.Height == 20);\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Accounts/OAuthLoginViewController.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.Accounts;\nusing CodeHub.iOS.Utilities;\nusing Foundation;\nusing WebKit;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.Services;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing System.Linq;\nusing ReactiveUI;\nusing Splat;\n\nnamespace CodeHub.iOS.ViewControllers.Accounts\n{\n    public class OAuthLoginViewController : BaseWebViewController\n    {\n        private readonly IAlertDialogService _alertDialogService;\n\n        private static readonly string OAuthWelcome = \n            \"In the following screen you will be prompted for your GitHub credentials. This is done through GitHub's OAuth portal, \" +\n            \"the recommended way to authenticate.\\n\\nCodeHub does not save your password. Instead, only the OAuth \" + \n            \"token is saved on the device which you may revoke at any time.\";\n\n        public OAuthLoginViewModel ViewModel { get; } = new OAuthLoginViewModel();\n\n        public OAuthLoginViewController(IAlertDialogService alertDialogService = null) \n            : base(true)\n        {\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            Title = \"Login\";\n\n            OnActivation(d =>\n            {\n                d(this.WhenAnyObservable(x => x.ViewModel.LoginCommand.IsExecuting)\n                      .SubscribeStatus(\"Logging in...\"));\n            });\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            LoadRequest();\n\n            if (!Core.Settings.HasSeenOAuthWelcome)\n            {\n                Appeared\n                    .Take(1)\n                    .Do(_ => Core.Settings.HasSeenOAuthWelcome = true)\n                    .Subscribe(_ => BlurredAlertView.Display(OAuthWelcome));\n            }\n        }\n\n        protected override bool ShouldStartLoad(WKWebView webView, WKNavigationAction navigationAction)\n        {\n            try\n            {\n                //We're being redirected to our redirect URL so we must have been successful\n                if (navigationAction.Request.Url.Host == \"dillonbuchanan.com\")\n                {\n                    var queryParameters = navigationAction.Request.Url.Query.Split('&');\n\n                    var code = queryParameters.FirstOrDefault(x => x.StartsWith(\"code=\", StringComparison.OrdinalIgnoreCase));\n                    var codeValue = code?.Replace(\"code=\", String.Empty);\n                    ViewModel.LoginCommand.ExecuteNow(codeValue);\n                    return false;\n                }\n    \n                if (navigationAction.Request.Url.AbsoluteString.StartsWith(\"https://github.com/join\"))\n                {\n                    _alertDialogService.Alert(\"Error\", \"Sorry, due to restrictions, creating GitHub accounts cannot be done in CodeHub.\");\n                    return false;\n                }\n\n                return base.ShouldStartLoad(webView, navigationAction);\n            }\n            catch \n            {\n                _alertDialogService.Alert(\"Error Logging in!\", \"CodeHub is unable to login you in due to an unexpected error. Please try again.\");\n                return false;\n            }\n        }\n\n        protected override void OnLoadError(NSError e)\n        {\n            base.OnLoadError(e);\n\n            //Frame interrupted error\n            if (e.Code == 102 || e.Code == -999) return;\n            AlertDialogService.ShowAlert(\"Error\", \"Unable to communicate with GitHub. \" + e.LocalizedDescription);\n        }\n\n        private void LoadRequest()\n        {\n            //Remove all cookies & cache\n            WKWebsiteDataStore.DefaultDataStore.RemoveDataOfTypes(WKWebsiteDataStore.AllWebsiteDataTypes, NSDate.FromTimeIntervalSince1970(0), \n                () => Web.LoadRequest(new NSUrlRequest(new NSUrl(ViewModel.LoginUrl))));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/EnterpriseSupportViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Reactive.Linq;\nusing MessageUI;\nusing CodeHub.Core.Services;\nusing Splat;\nusing Foundation;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class EnterpriseSupportViewController : BaseViewController\n    {\n        private static string CodeHubUrl = \"https://github.com/CodeHubApp/CodeHub\";\n\n        private readonly IAlertDialogService _alertDialogService;\n        private readonly UIColor ComponentColor = UIColor.FromWhiteAlpha(0.9f, 1f);\n        private NSLayoutConstraint[] _defaultConstraints;\n        private NSLayoutConstraint[] _landscapeConstraints;\n\n        public EnterpriseSupportViewController(IAlertDialogService alertDialogService = null)\n        {\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n\n            Appearing\n                .Select(_ => NavigationController)\n                .Where(x => x != null)\n                .Subscribe(x => x.NavigationBar.ShadowImage = new UIImage());\n        }\n\n        private void SubmitFeedback()\n        {\n            if (!MFMailComposeViewController.CanSendMail)\n            {\n                _alertDialogService.Alert(\n                    \"No Email Setup\",\n                    \"Looks like you don't have email setup on this device. \" +\n                    \"Add a mail provider and try again.\").ToBackground();\n            }\n            else\n            {\n                var ctrl = new MFMailComposeViewController();\n                ctrl.SetSubject(\"CodeHub Support\");\n                ctrl.SetToRecipients(new[] { \"codehubapp@gmail.com\" });\n                ctrl.Finished += (sender, e) => DismissViewController(true, () =>\n                {\n                    if (e.Result == MFMailComposeResult.Sent)\n                        _alertDialogService.Alert(\"Sent!\", \"Thanks for your feedback!\");\n                });\n                PresentViewController(ctrl, true, null);\n            }\n        }\n\n        private void GoToGitHub()\n        {\n            var viewController = new WebBrowserViewController(CodeHubUrl);\n            PresentViewController(viewController, true, null);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            View.BackgroundColor = UIColor.FromRGB(50, 50, 50);\n\n            var imageView = new UIImageView(Octicon.Heart.ToImage(256, false));\n            imageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n            imageView.TintColor = UIColor.White;\n            View.Add(imageView);\n\n            var label = new UILabel();\n            label.Text = \"Or\";\n            label.TextColor = ComponentColor;\n            label.TextAlignment = UITextAlignment.Center;\n            View.Add(label);\n\n            var webButton = new UIButton(UIButtonType.Custom);\n            webButton.SetTitle(\"CodeHub on GitHub\", UIControlState.Normal);\n            webButton.TouchUpInside += (sender, e) => GoToGitHub();\n\n            var button = new UIButton(UIButtonType.Custom);\n            button.SetTitle(\"Email Me!\", UIControlState.Normal);\n            button.TouchUpInside += (sender, e) => SubmitFeedback();\n\n            foreach (var b in new[] { webButton, button })\n            {\n                button.SetTitleColor(ComponentColor, UIControlState.Normal);\n                b.Font = UIFont.PreferredBody;\n                b.Layer.BorderColor = label.TextColor.CGColor;\n                b.Layer.BorderWidth = 1;\n                b.Layer.CornerRadius = 6f;\n                View.Add(b);\n            }\n\n            _defaultConstraints = View.ConstrainLayout(() =>\n                button.Frame.Width == 212 &&\n                button.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                button.Frame.Top == imageView.Frame.Bottom + 20f &&\n                button.Frame.Height == 44 &&\n\n                imageView.Frame.Width == 192 &&\n                imageView.Frame.Height == 192 &&\n                imageView.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                imageView.Frame.GetCenterY() == View.Frame.GetCenterY() - 96f &&\n\n                label.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                label.Frame.Top == button.Frame.Bottom + 10 &&\n                label.Frame.Width == 192 &&\n                label.Frame.Height == 44 &&\n\n                webButton.Frame.Width == button.Frame.Width &&\n                webButton.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                webButton.Frame.Top == label.Frame.Bottom + 10f &&\n                webButton.Frame.Height == 44);\n\n\n            _landscapeConstraints = View.ConstrainLayout(() =>\n                button.Frame.Width == 212 &&\n                button.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                button.Frame.Top == imageView.Frame.Bottom + 20f &&\n                button.Frame.Height == 44 &&\n\n                imageView.Frame.Width == 32 &&\n                imageView.Frame.Height == 32 &&\n                imageView.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                imageView.Frame.GetCenterY() == View.Frame.GetCenterY() - 96f &&\n\n                label.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                label.Frame.Top == button.Frame.Bottom + 10 &&\n                label.Frame.Width == 100 &&\n                label.Frame.Height == 44 &&\n\n                webButton.Frame.Width == button.Frame.Width &&\n                webButton.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                webButton.Frame.Top == label.Frame.Bottom + 10f &&\n                webButton.Frame.Height == 44,\n                false);\n        }\n\n        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)\n        {\n            base.WillRotate(toInterfaceOrientation, duration);\n\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\n            {\n                if (toInterfaceOrientation == UIInterfaceOrientation.Portrait || toInterfaceOrientation == UIInterfaceOrientation.PortraitUpsideDown)\n                {\n                    View.RemoveConstraints(_landscapeConstraints);\n                    View.AddConstraints(_defaultConstraints);\n                    View.SetNeedsUpdateConstraints();\n                    View.UpdateConstraintsIfNeeded();\n                }\n                else\n                {\n                    View.RemoveConstraints(_defaultConstraints);\n                    View.AddConstraints(_landscapeConstraints);\n                    View.SetNeedsUpdateConstraints();\n                    View.UpdateConstraintsIfNeeded();\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/FeedbackComposerViewController.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.App;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.TableViewSources;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing System.Reactive;\nusing CodeHub.iOS.Utilities;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class FeedbackComposerViewController : TableViewController\n    {\n        public FeedbackComposerViewModel ViewModel { get; } = new FeedbackComposerViewModel();\n\n        public FeedbackComposerViewController() : base(UITableViewStyle.Plain)\n        {\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)\n                ModalPresentationStyle = UIModalPresentationStyle.FormSheet;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var descriptionElement = new ExpandingInputElement(\"Description\");\n            descriptionElement.AccessoryView = x => new MarkdownAccessoryView(x);\n            var titleElement = new DummyInputElement(\"Title\");\n\n            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n            var cancelButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            NavigationItem.LeftBarButtonItem = cancelButton;\n            NavigationItem.RightBarButtonItem = saveButton;\n\n            var source = new DialogTableViewSource(TableView);\n            source.Root.Add(new Section { titleElement, descriptionElement });\n            TableView.Source = source;\n            TableView.TableFooterView = new UIView();\n\n            OnActivation(d => {\n                d(descriptionElement.Changed\n                  .Subscribe(x => ViewModel.Description = x));\n\n                d(this.WhenAnyValue(x => x.ViewModel.Title)\n                  .Subscribe(title => Title = title));\n\n                d(this.WhenAnyValue(x => x.ViewModel.Subject)\n                  .Subscribe(x => titleElement.Value = x));\n\n                d(this.WhenAnyValue(x => x.ViewModel.Description)\n                  .Subscribe(x => descriptionElement.Value = x));\n\n                d(titleElement.Changed.Subscribe(x => ViewModel.Subject = x));\n\n                d(cancelButton.GetClickedObservable()\n                  .Select(_ => Unit.Default)\n                  .InvokeReactiveCommand(ViewModel.DismissCommand));\n\n\t            d(this.WhenAnyObservable(x => x.ViewModel.DismissCommand)\n\t              .Where(x => x)\n                  .Subscribe(_ => DismissViewController(true, null)));\n\n                d(saveButton.GetClickedObservable()\n                  .Do(x => ResignFirstResponder())\n                  .Select(_ => Unit.Default)\n                  .InvokeReactiveCommand(ViewModel.SubmitCommand));\n\n                d(ViewModel.SubmitCommand\n                  .Subscribe(_ => DismissViewController(true, null)));\n\n                d(this.WhenAnyObservable(x => x.ViewModel.SubmitCommand.CanExecute)\n                  .Subscribe(x => saveButton.Enabled = x));\n\n                d(this.WhenAnyObservable(x => x.ViewModel.SubmitCommand.IsExecuting)\n                  .SubscribeStatus(\"Submitting feedback\"));\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/FeedbackViewController.cs",
    "content": "﻿using System;\r\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.App;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.iOS.Views;\nusing CodeHub.iOS.Views.Issues;\nusing CoreGraphics;\nusing ReactiveUI;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class FeedbackViewController : TableViewController \n    {\n        private readonly UISearchBar _repositorySearchBar = new UISearchBar(new CGRect(0, 0, 320, 44));\r\n\r\n        private readonly Lazy<UIView> _emptyView = new Lazy<UIView>((() =>\r\n            new EmptyListView(Octicon.IssueOpened.ToEmptyListImage(), \"There are no open issues.\")));\r\n\r\n        private readonly Lazy<UIView> _retryView;\r\n\n        public FeedbackViewModel ViewModel { get; } = new FeedbackViewModel();\n\n        public FeedbackViewController()\n            : base(UITableViewStyle.Plain)\n        {\r\n            _retryView = new Lazy<UIView>((() =>\r\n                new RetryListView(Octicon.IssueOpened.ToEmptyListImage(), \"Error loading feedback.\", LoadData)));\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\r\n\n            var tableViewSource = new FeedbackTableViewSource(TableView, ViewModel.Items);\r\n            TableView.Source = tableViewSource;\n\n            Appearing\n              .Take(1)\n              .Subscribe(_ => LoadData());\r\n\r\n            this.WhenActivated(d =>\r\n            {\r\n                d(this.WhenAnyValue(x => x.ViewModel.Title)\r\n                  .Subscribe(title => Title = title));\r\n\r\n                d(_repositorySearchBar.GetChangedObservable()\r\n                  .Subscribe(x => ViewModel.SearchKeyword = x));\r\n\r\n                d(ViewModel.WhenAnyValue(x => x.IsEmpty)\r\n                  .Where(x => x.HasValue)\r\n                  .Select(x => x.Value)\r\n                  .Subscribe(SetHasItems));\r\n\r\n                d(ViewModel.Items.Changed.Select(_ => Unit.Default)\r\n                  .StartWith(Unit.Default)\r\n                  .Select(_ => ViewModel.Items.Select(x => x.GoToCommand.Select(__ => x)))\r\n                  .Select(x => Observable.Merge(x))\r\n                  .Switch()\r\n                  .Select(x => new IssueView(x.RepositoryOwner, x.RepositoryName, x.IssueId))\r\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\r\n            });\r\n        }\n\n        private void LoadData()\n        {\r\n            if (_emptyView.IsValueCreated)\r\n                _emptyView.Value.RemoveFromSuperview();\r\n            if (_retryView.IsValueCreated)\r\n                _retryView.Value.RemoveFromSuperview();\r\n            \n            ViewModel.LoadCommand.Execute()\n                .Take(1)\n                .ObserveOn(RxApp.MainThreadScheduler)\r\n                .SubscribeError(setHasError);\n        }\n\n        private void setHasError(Exception error)\n        {\n            _retryView.Value.Alpha = 0;\n            _retryView.Value.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);\n            View.Add(_retryView.Value);\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => _retryView.Value.Alpha = 1, null);\n        }\r\n\r\n        private void SetHasItems(bool hasItems)\r\n        {\r\n            TableView.TableHeaderView = hasItems ? _repositorySearchBar : null;\r\n\r\n            if (!hasItems)\r\n            {\r\n                _emptyView.Value.Alpha = 0;\r\n                _emptyView.Value.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);\r\n                View.Add(_emptyView.Value);\r\n                UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\r\n                               () => _emptyView.Value.Alpha = 1, null);\r\n            }\r\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/MenuViewController.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.App;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.ViewControllers.Accounts;\nusing CodeHub.iOS.ViewControllers.Search;\nusing CodeHub.iOS.ViewControllers.Settings;\nusing CodeHub.iOS.Views;\nusing CoreGraphics;\nusing MvvmCross.Platform;\nusing Splat;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class MenuViewController : ViewModelDrivenDialogViewController\n    {\n        private readonly ProfileButton _profileButton = new ProfileButton();\n        private readonly UILabel _title;\n        private MenuElement _notifications;\n        private Section _favoriteRepoSection;\n\n        public new MenuViewModel ViewModel\n        {\n            get { return (MenuViewModel) base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        private static bool IsAccountEnterprise\n            => Locator.Current.GetService<IApplicationService>().Account?.IsEnterprise ?? false;\n\n        /// <summary>\n        /// Gets or sets the title.\n        /// </summary>\n        /// <value>The title.</value>\n        public override string Title {\n            get {\n                return _title == null ? base.Title : \" \" + _title.Text;\n            }\n            set {\n                if (_title != null)\n                    _title.Text = \" \" + value;\n                base.Title = value;\n            }\n        }\n\n        public MenuViewController()\n            : base(false, UITableViewStyle.Plain)\n        {\n            ViewModel = new MenuViewModel();\n            Appeared.Take(1).Subscribe(_ => PromptPushNotifications());\n\n            _title = new UILabel(new CGRect(0, 40, 320, 40));\n            _title.TextAlignment = UITextAlignment.Left;\n            _title.BackgroundColor = UIColor.Clear;\n            _title.Font = UIFont.SystemFontOfSize(16f);\n            _title.TextColor = UIColor.FromRGB(246, 246, 246);\n            NavigationItem.TitleView = _title;\n\n            OnActivation(d =>\n            {\n                d(_profileButton.GetClickedObservable().Subscribe(_ => ProfileButtonClicked()));\n            });\n        }\n\n        private static async Task PromptPushNotifications()\n        {\n            var appService = Mvx.Resolve<IApplicationService>();\n            if (IsAccountEnterprise)\n                return;\n\n            var featuresService = Mvx.Resolve<IFeaturesService>();\n            if (!featuresService.IsProEnabled)\n                return;\n\n            var alertDialogService = Mvx.Resolve<IAlertDialogService>();\n            var pushNotifications = Mvx.Resolve<IPushNotificationsService>();\n\n            if (appService.Account.IsPushNotificationsEnabled == null)\n            {\n                var result = await alertDialogService.PromptYesNo(\"Push Notifications\", \"Would you like to enable push notifications for this account?\");\n                var accountsService = Mvx.Resolve<IAccountsService>();\n                appService.Account.IsPushNotificationsEnabled = result;\n                await accountsService.Save(appService.Account);\n\n                if (result)\n                {\n                    pushNotifications.Register().ToBackground();\n                }\n\n            }\n            else if (appService.Account.IsPushNotificationsEnabled.Value)\n            {\n                pushNotifications.Register().ToBackground();\n            }\n        }\n\n\n        private void UpdateProfilePicture()\n        {\n            var size = new CGSize(32, 32);\n            if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft ||\n                UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight)\n            {\n                size = new CGSize(24, 24);\n            }\n\n            _profileButton.Frame = new CGRect(new CGPoint(0, 4), size);\n\n            NavigationItem.LeftBarButtonItem = new UIBarButtonItem(_profileButton);\n        }\n\n        private void CreateMenuRoot()\n        {\n            var username = ViewModel.Account.Username;\n            Title = username;\n            ICollection<Section> sections = new LinkedList<Section>();\n\n            sections.Add(new Section\n            {\n                new MenuElement(\"Profile\", () => ViewModel.GoToProfileCommand.Execute(null), Octicon.Person.ToImage()),\n                (_notifications = new MenuElement(\"Notifications\", () => ViewModel.GoToNotificationsCommand.Execute(null), Octicon.Inbox.ToImage()) { NotificationNumber = ViewModel.Notifications }),\n                new MenuElement(\"News\", () => ViewModel.GoToNewsCommand.Execute(null), Octicon.RadioTower.ToImage()),\n                new MenuElement(\"Issues\", () => ViewModel.GoToMyIssuesCommand.Execute(null), Octicon.IssueOpened.ToImage())\n            });\n\n            Uri avatarUri;\n            Uri.TryCreate(ViewModel.Account.AvatarUrl, UriKind.Absolute, out avatarUri);\n\n            var eventsSection = new Section { HeaderView = new MenuSectionView(\"Events\") };\n            eventsSection.Add(new MenuElement(username, () => ViewModel.GoToMyEvents.Execute(null), Octicon.Rss.ToImage(), avatarUri));\n            if (ViewModel.Organizations != null && ViewModel.Account.ShowOrganizationsInEvents)\n            {\n                foreach (var org in ViewModel.Organizations)\n                {\n                    Uri.TryCreate(org.AvatarUrl, UriKind.Absolute, out avatarUri);\n                    eventsSection.Add(new MenuElement(org.Login, () => ViewModel.GoToOrganizationEventsCommand.Execute(org.Login), Octicon.Rss.ToImage(), avatarUri));\n                }\n            }\n            sections.Add(eventsSection);\n\n            var repoSection = new Section() { HeaderView = new MenuSectionView(\"Repositories\") };\n            repoSection.Add(new MenuElement(\"Owned\", GoToOwnedRepositories, Octicon.Repo.ToImage()));\n            repoSection.Add(new MenuElement(\"Starred\", GoToStarredRepositories, Octicon.Star.ToImage()));\n            repoSection.Add(new MenuElement(\"Trending\", GoToTrendingRepositories, Octicon.Pulse.ToImage()));\n            repoSection.Add(new MenuElement(\"Search\", GoToSearch, Octicon.Search.ToImage()));\n            sections.Add(repoSection);\n            \n            if (ViewModel.PinnedRepositories.Any())\n            {\n                _favoriteRepoSection = new Section { HeaderView = new MenuSectionView(\"Favorite Repositories\") };\n                foreach (var pinnedRepository in ViewModel.PinnedRepositories)\n                {\n                    var element = new PinnedRepoElement(pinnedRepository);\n                    element.Clicked.Subscribe(_ => GoToRepository(pinnedRepository.Owner, pinnedRepository.Name));\n                    _favoriteRepoSection.Add(element);\n                }\n\n                sections.Add(_favoriteRepoSection);\n            }\n            else\n            {\n                _favoriteRepoSection = null;\n            }\n\n            var orgSection = new Section() { HeaderView = new MenuSectionView(\"Organizations\") };\n            if (ViewModel.Organizations != null && ViewModel.Account.ExpandOrganizations)\n            {\n                foreach (var org in ViewModel.Organizations)\n                {\n                    Uri.TryCreate(org.AvatarUrl, UriKind.Absolute, out avatarUri);\n                    orgSection.Add(new MenuElement(org.Login, () => ViewModel.GoToOrganizationCommand.Execute(org.Login), Images.Avatar, avatarUri));\n                }\n            }\n            else\n                orgSection.Add(new MenuElement(\"Organizations\", () => ViewModel.GoToOrganizationsCommand.Execute(null), Octicon.Organization.ToImage()));\n\n            //There should be atleast 1 thing...\n            if (orgSection.Elements.Count > 0)\n                sections.Add(orgSection);\n\n            var gistsSection = new Section() { HeaderView = new MenuSectionView(\"Gists\") };\n            gistsSection.Add(new MenuElement(\"My Gists\", GoToOwnedGists, Octicon.Gist.ToImage()));\n            gistsSection.Add(new MenuElement(\"Starred\", GoToStarredGists, Octicon.Star.ToImage()));\n            gistsSection.Add(new MenuElement(\"Public\", GoToPublicGists, Octicon.Globe.ToImage()));\n            sections.Add(gistsSection);\n\n            var infoSection = new Section() { HeaderView = new MenuSectionView(\"Info & Preferences\") };\n            sections.Add(infoSection);\n            infoSection.Add(new MenuElement(\"Settings\", GoToSettings, Octicon.Gear.ToImage()));\n\n            if (ViewModel.ShouldShowUpgrades)\n                infoSection.Add(new MenuElement(\"Upgrades\", GoToUpgrades, Octicon.Lock.ToImage()));\n            \n            infoSection.Add(new MenuElement(\"Feedback & Support\", GoToSupport, Octicon.CommentDiscussion.ToImage()));\n            infoSection.Add(new MenuElement(\"Accounts\", ProfileButtonClicked, Octicon.Person.ToImage()));\n\n            Root.Reset(sections);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            UpdateProfilePicture();\n            CreateMenuRoot();\n\n            // A user has been activated!\n            var appService = Mvx.Resolve<IApplicationService>();\n            appService.ActivationAction?.Invoke();\n            appService.ActivationAction = null;\n\n            #if DEBUG\n            GC.Collect();\n            GC.Collect();\n            GC.Collect();\n            #endif\n        }\n\n        private void GoToSearch()\n        {\n            var vc = new ExploreViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToSettings()\n        {\n            var vc = new SettingsViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToRepository(string owner, string name)\n        {\n            var vc = new Repositories.RepositoryViewController(owner, name);\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToSupport()\n        {\n            var vc = IsAccountEnterprise \n                ? (UIViewController)new EnterpriseSupportViewController() \n                : new SupportViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToOwnedRepositories()\n        {\n            var vc = Repositories.RepositoriesViewController.CreateMineViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToStarredRepositories()\n        {\n            var vc = Repositories.RepositoriesViewController.CreateStarredViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToTrendingRepositories()\n        {\n            var vc = new Repositories.TrendingRepositoriesViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToOwnedGists()\n        {\n            var username = ViewModel.Account.Username;\n            var vc = Gists.GistsViewController.CreateUserGistsViewController(username);\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToStarredGists()\n        {\n            var vc = Gists.GistsViewController.CreateStarredGistsViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToPublicGists()\n        {\n            var vc = Gists.GistsViewController.CreatePublicGistsViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        private void GoToUpgrades()\n        {\n            var vc = new UpgradeViewController();\n            NavigationController?.PushViewController(vc, true);\n        }\n\n        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            base.DidRotate(fromInterfaceOrientation);\n            UpdateProfilePicture();\n        }\n\n        private void ProfileButtonClicked()\n        {\n            var vc = new AccountsViewController();\n            vc.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            vc.NavigationItem.LeftBarButtonItem.Clicked += (sender, e) => DismissViewController(true, null);\n            PresentViewController(new ThemedNavigationController(vc), true, null);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.SeparatorInset = UIEdgeInsets.Zero;\n            TableView.SeparatorColor = UIColor.FromRGB(50, 50, 50);\n            TableView.TableFooterView = new UIView(new CGRect(0, 0, View.Bounds.Width, 0));\n            TableView.BackgroundColor = UIColor.FromRGB(34, 34, 34);\n            TableView.ScrollsToTop = false;\n\n            if (!string.IsNullOrEmpty(ViewModel.Account.AvatarUrl))\n                _profileButton.Uri = new Uri(ViewModel.Account.AvatarUrl);\n\n            ViewModel.Bind(x => x.Notifications).Subscribe(x =>\n            {\n                if (_notifications != null)\n                {\n                    _notifications.NotificationNumber = x;\n                }\n            });\n\n            ViewModel.Bind(x => x.Organizations).Subscribe(x => CreateMenuRoot());\n\n            ViewModel.LoadCommand.Execute(null);\n\n        }\n\n        private class PinnedRepoElement : MenuElement\n        {\n            public Core.Data.PinnedRepository PinnedRepo { get; private set; }\n\n            public PinnedRepoElement(Core.Data.PinnedRepository pinnedRepo)\n                : base(pinnedRepo.Name, null, Octicon.Repo.ToImage())\n            {\n                PinnedRepo = pinnedRepo;\n\n                // BUG FIX: App keeps getting relocated so the URLs become off\n                if (new [] { \"repository.png\", \"repository_fork.png\" }.Any(x => PinnedRepo.ImageUri.EndsWith(x, StringComparison.Ordinal)))\n                {\n                    ImageUri = new Uri(\"http://codehub-app.com/assets/repository_icon.png\");\n                }\n                else\n                {\n                    ImageUri = new Uri(PinnedRepo.ImageUri);\n                }\n            }\n        }\n\n        private void DeletePinnedRepo(PinnedRepoElement el)\n        {\n            ViewModel.DeletePinnedRepositoryCommand.Execute(el.PinnedRepo);\n\n            if (_favoriteRepoSection.Elements.Count == 1)\n            {\n                Root.Remove(_favoriteRepoSection);\n                _favoriteRepoSection = null;\n            }\n            else\n            {\n                _favoriteRepoSection.Remove(el);\n            }\n        }\n\n        public override DialogViewController.Source CreateSizingSource()\n        {\n            return new EditSource(this);\n        }\n\n        private class EditSource : Source\n        {\n            private readonly WeakReference<MenuViewController> _parent;\n            public EditSource(MenuViewController dvc) \n                : base (dvc)\n            {\n                _parent = new WeakReference<MenuViewController>(dvc);\n            }\n\n            public override bool CanEditRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                var view = _parent.Get();\n                if (view == null)\n                    return false;\n\n                if (view._favoriteRepoSection == null)\n                    return false;\n                if (view.Root[indexPath.Section] == view._favoriteRepoSection)\n                    return true;\n                return false;\n            }\n\n            public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                var view = _parent.Get();\n                if (view == null)\n                    return UITableViewCellEditingStyle.None;\n\n                if (view._favoriteRepoSection != null && view.Root[indexPath.Section] == view._favoriteRepoSection)\n                    return UITableViewCellEditingStyle.Delete;\n                return UITableViewCellEditingStyle.None;\n            }\n\n            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)\n            {\n                var view = _parent.Get();\n                if (view == null)\n                    return;\n                \n                switch (editingStyle)\n                {\n                    case UITableViewCellEditingStyle.Delete:\n                        var section = view.Root[indexPath.Section];\n                        var element = section[indexPath.Row];\n                        view.DeletePinnedRepo(element as PinnedRepoElement);\n                        break;\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/StartupViewController.cs",
    "content": "using System;\nusing UIKit;\nusing SDWebImage;\nusing Foundation;\nusing CodeHub.Core.ViewModels.App;\nusing MonoTouch.SlideoutNavigation;\nusing CodeHub.iOS.ViewControllers.Accounts;\nusing CodeHub.Core.Utilities;\nusing System.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class StartupViewController : BaseViewController\n    {\n        const float imageSize = 128f;\n\n        private UIImageView _imgView;\n        private UILabel _statusLabel;\n        private UIActivityIndicatorView _activityView;\n\n        public StartupViewModel ViewModel { get; } = new StartupViewModel();\n\n        public override void ViewWillLayoutSubviews()\n        {\n            base.ViewWillLayoutSubviews();\n\n            _imgView.Frame = new CoreGraphics.CGRect(View.Bounds.Width / 2 - imageSize / 2, View.Bounds.Height / 2 - imageSize / 2 - 30f, imageSize, imageSize);\n            _statusLabel.Frame = new CoreGraphics.CGRect(0, _imgView.Frame.Bottom + 10f, View.Bounds.Width, 20f);\n            _activityView.Center = new CoreGraphics.CGPoint(View.Bounds.Width / 2, _statusLabel.Frame.Bottom + 16f + 16F);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            View.AutosizesSubviews = true;\n\n            _imgView = new UIImageView();\n            _imgView.TintColor = Theme.CurrentTheme.PrimaryColor;\n            _imgView.Layer.CornerRadius = imageSize / 2;\n            _imgView.Layer.MasksToBounds = true;\n            Add(_imgView);\n\n            _statusLabel = new UILabel();\n            _statusLabel.TextAlignment = UITextAlignment.Center;\n            _statusLabel.Font = UIFont.FromName(\"HelveticaNeue\", 13f);\n            _statusLabel.TextColor = UIColor.FromWhiteAlpha(0.34f, 1f);\n            Add(_statusLabel);\n\n            _activityView = new UIActivityIndicatorView();\n            _activityView.Color = UIColor.FromRGB(0.33f, 0.33f, 0.33f);\n            Add(_activityView);\n\n            View.BackgroundColor = UIColor.FromRGB (221, 221, 221);\n\n            OnActivation(d =>\n            {\n                d(ViewModel.Bind(x => x.ImageUrl).Subscribe(UpdatedImage));\n                d(ViewModel.Bind(x => x.Status).Subscribe(x => _statusLabel.Text = x));\n                d(ViewModel.GoToMenu.Subscribe(_ => GoToMenu()));\n                d(ViewModel.GoToAccounts.Subscribe(_ => GoToAccounts()));\n                d(ViewModel.GoToNewAccount.Subscribe(_ => GoToNewAccount()));\n                d(ViewModel.Bind(x => x.IsLoggingIn).Subscribe(x =>\n                {\n                    if (x)\n                        _activityView.StartAnimating();\n                    else\n                        _activityView.StopAnimating();\n\n                    _activityView.Hidden = !x;\n                }));\n            });\n        }\n\n        private void GoToMenu()\n        {\n            var vc = new MenuViewController();\n            var slideoutController = new SlideoutNavigationController();\n            slideoutController.MenuViewController = new MenuNavigationController(vc, slideoutController);\n\n            var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate;\n            if (appDelegate != null)\n                appDelegate.Presenter.SlideoutNavigationController = slideoutController;\n            \n            var openButton = new UIBarButtonItem { Image = Images.Buttons.ThreeLinesButton };\n            var mainNavigationController = new MainNavigationController(GetInitialMenuViewController(), slideoutController, openButton);\n            slideoutController.SetMainViewController(mainNavigationController, false);\n\n            slideoutController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;\n            AppDelegate.Instance.TransitionToViewController(slideoutController);\n        }\n\n        private UIViewController GetInitialMenuViewController()\n        {\n            var username = ViewModel.Account.Username;\n            switch (ViewModel.Account.DefaultStartupView)\n            {\n                case \"Organizations\":\n                    return new Organizations.OrganizationsViewController(username);\n                case \"Trending Repositories\":\n                    return new Repositories.TrendingRepositoriesViewController();\n                case \"Explore Repositories\":\n                    return new Search.ExploreViewController();\n                case \"Owned Repositories\":\n                    return Repositories.RepositoriesViewController.CreateMineViewController();\n                case \"Starred Repositories\":\n                    return Repositories.RepositoriesViewController.CreateStarredViewController();\n                case \"Public Gists\":\n                    return Gists.GistsViewController.CreatePublicGistsViewController();\n                case \"Starred Gists\":\n                    return Gists.GistsViewController.CreateStarredGistsViewController();\n                case \"My Gists\":\n                    return Gists.GistsViewController.CreateUserGistsViewController(username);\n                case \"Profile\":\n                    return new Users.UserViewController(username);\n                case \"My Events\":\n                    return new Events.UserEventsViewController(username);\n                case \"My Issues\":\n                    return Views.Issues.MyIssuesView.Create();\n                case \"Notifications\":\n                    return Views.NotificationsView.Create();\n                default:\n                    return Events.NewsViewController.Create();\n                    \n            }\n        }\n\n        private void GoToNewAccount()\n        {\n            var vc = new NewAccountViewController();\n            var nav = new ThemedNavigationController(vc);\n            PresentViewController(nav, true, null);\n        }\n\n        private void GoToAccounts()\n        {\n            var vc = new AccountsViewController();\n            var nav = new ThemedNavigationController(vc);\n            PresentViewController(nav, true, null);\n        }\n\n        public void UpdatedImage(Uri uri)\n        {\n            if (uri == null)\n                AssignUnknownUserImage();\n            else\n            {\n                // Wipe out old avatars\n                var avatar = new GitHubAvatar(uri);\n                var avatarSizes = new [] { avatar.ToUri(), avatar.ToUri(64) };\n                foreach (var avatarUrl in avatarSizes.Select(x => new NSUrl(x.AbsoluteUri)) )\n                {\n                    var cacheKey = SDWebImageManager.SharedManager.CacheKey(avatarUrl);\n                    if (cacheKey != null)\n                        SDWebImageManager.SharedManager.ImageCache.RemoveImage(cacheKey);\n                }\n\n                _imgView.SetImage(new NSUrl(uri.AbsoluteUri), Images.LoginUserUnknown, (img, err, cache, _) => {\n                    _imgView.Image = Images.LoginUserUnknown;\n                    UIView.Transition(_imgView, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve , () => _imgView.Image = img, null);\n                });\n            }\n        }\n\n        private void AssignUnknownUserImage()\n        {\n            var img = Images.LoginUserUnknown;\n            _imgView.Image = img;\n            _imgView.TintColor = UIColor.FromWhiteAlpha(0.34f, 1f);\n        }\n\n\n        public override void ViewWillAppear(bool animated)\n        {\n            UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);\n            AssignUnknownUserImage();\n            _statusLabel.Text = \"\";\n\n            base.ViewWillAppear(animated);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Fade);\n        }\n\n        public override void ViewDidAppear(bool animated)\n        {\n            base.ViewDidAppear(animated);\n            ViewModel.StartupCommand.Execute(null);\n        }\n\n        public override bool ShouldAutorotate()\n        {\n            return true;\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            _imgView.Image = null;\n        }\n\n        public override UIStatusBarStyle PreferredStatusBarStyle()\n        {\n            return UIStatusBarStyle.Default;\n        }\n\n        public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()\n        {\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\n                return UIInterfaceOrientationMask.Portrait | UIInterfaceOrientationMask.PortraitUpsideDown;\n            return UIInterfaceOrientationMask.All;\n        }\n\n        public override void PresentViewController(UIViewController viewControllerToPresent, bool animated, Action completionHandler)\n        {\n            if (PresentedViewController != null)\n            {\n                PresentedViewController.PresentViewController(viewControllerToPresent, animated, completionHandler);\n            }\n            else\n            {\n                base.PresentViewController(viewControllerToPresent, animated, completionHandler);\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/SupportViewController.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.App;\nusing Humanizer;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive;\nusing CodeHub.iOS.ViewControllers.Repositories;\nusing MessageUI;\nusing CodeHub.Core.Services;\nusing Splat;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class SupportViewController : BaseDialogViewController\n    {\n        private readonly IAlertDialogService _alertDialogService = Locator.Current.GetService<IAlertDialogService>();\n\n        public SupportViewModel ViewModel { get; } = new SupportViewModel();\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var split = new SplitButtonElement();\n            var contributors = split.AddButton(\"Contributors\", \"-\");\n            var lastCommit = split.AddButton(\"Last Commit\", \"-\");\n\n            var openIssue = new BigButtonElement(\"Open an Issue on GitHub\", Octicon.Bug);\n            var sendEmail = new BigButtonElement(\"Email Support\", Octicon.Mail);\n            var openIssues = new BigButtonElement(\"Existing Issues\", Octicon.IssueOpened);\n\n            HeaderView.SubText = \"This app is the product of hard work and great suggestions! Thank you to all whom provide feedback!\";\n            HeaderView.Image = UIImage.FromBundle(\"AppIcons60x60\");\n\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = \"\" };\n\n            Root.Reset(\n                new Section { split },\n                new Section(null, \"Opening an issue on the GitHub project page is the fastest way to get a response.\") { openIssue, openIssues },\n                new Section(),\n                new Section(null, \"Emails are answered as quickly as possible but there is only one person answering them so expect a delay.\") { sendEmail });\n\n            OnActivation(d =>\n            {\n                d(openIssue.Clicked\n                  .Select(_ => new FeedbackComposerViewController())\n                  .Select(viewCtrl => new ThemedNavigationController(viewCtrl))\n                  .Subscribe(viewCtrl => PresentViewController(viewCtrl, true, null)));\n\n                d(sendEmail.Clicked.Subscribe(_ => SendEmail()));\n\n                d(this.WhenAnyValue(x => x.ViewModel.Title)\n                  .Subscribe(title => Title = title));\n\n                d(openIssues.Clicked\n                  .Subscribe(_ => this.PushViewController(new FeedbackViewController())));\n\n                d(HeaderView.Clicked.Subscribe(_ => GoToRepository()));\n\n                d(this.WhenAnyValue(x => x.ViewModel.Contributors)\n                  .Where(x => x.HasValue)\n                  .Subscribe(x => contributors.Text = (x.Value >= 100 ? \"100+\" : x.Value.ToString())));\n\n                d(this.WhenAnyValue(x => x.ViewModel.LastCommit)\n                  .Where(x => x.HasValue)\n                  .Subscribe(x => lastCommit.Text = x.Value.UtcDateTime.Humanize()));\n            });\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(ViewModel.LoadCommand);\n        }\n\n        private void SendEmail()\n        {\n            if (!MFMailComposeViewController.CanSendMail)\n            {\n                _alertDialogService.Alert(\n                    \"No Email Setup\",\n                    \"Looks like you don't have email setup on this device. \" +\n                    \"Add a mail provider and try again.\").ToBackground();\n            }\n            else\n            {\n                var ctrl = new MFMailComposeViewController();\n                ctrl.SetSubject(\"CodeHub Support\");\n                ctrl.SetToRecipients(new[] { \"codehubapp@gmail.com\" });\n                ctrl.Finished += (sender, e) => DismissViewController(true, () =>\n                {\n                    if (e.Result == MFMailComposeResult.Sent)\n                        _alertDialogService.Alert(\"Sent!\", \"Thanks for your feedback!\");\n                });\n                PresentViewController(ctrl, true, null);\n            }\n        }\n\n\n        private void GoToRepository()\n            => this.PushViewController(RepositoryViewController.CreateCodeHubViewController());\n\n        private class BigButtonElement : ButtonElement, IElementSizing\n        {\n            public BigButtonElement(string name, Octicon img) : base(name, img.ToImage()) { }\n            public nfloat GetHeight(UITableView tableView, Foundation.NSIndexPath indexPath) => 60f;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Application/UpgradeViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing Foundation;\nusing CodeHub.iOS.Services;\nusing System.Threading.Tasks;\nusing System.Linq;\nusing CodeHub.Core.Services;\nusing BigTed;\nusing System.Reactive.Disposables;\nusing CodeHub.WebViews;\nusing Splat;\n\nnamespace CodeHub.iOS.ViewControllers.Application\n{\n    public class UpgradeViewController : BaseWebViewController\n    {\n        private readonly IFeaturesService _featuresService \n            = Locator.Current.GetService<IFeaturesService>();\n        private readonly IInAppPurchaseService _inAppPurchaseService\n            = Locator.Current.GetService<IInAppPurchaseService>();\n        private UIActivityIndicatorView _activityView;\n\n        public UpgradeViewController() : base(false, false)\n        {\n            Title = \"Pro Upgrade\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            _activityView = new UIActivityIndicatorView\n            {\n                Color = Theme.CurrentTheme.PrimaryColor,\n                AutoresizingMask = UIViewAutoresizing.FlexibleWidth,\n            };\n            _activityView.Frame = new CoreGraphics.CGRect(0, 44, View.Frame.Width, 88f);\n\n            Load().ToBackground();\n        }\n\n        private async Task Load()\n        {\n            Web.UserInteractionEnabled = false;\n            Web.LoadHtmlString(\"\", NSBundle.MainBundle.BundleUrl);\n\n            _activityView.Alpha = 1;\n            _activityView.StartAnimating();\n            View.Add(_activityView);\n\n            try\n            {\n                var response = await _inAppPurchaseService\n                    .RequestProductData(FeaturesService.ProEdition)\n                    .WithTimeout(TimeSpan.FromSeconds(30));\n                \n                var productData = response.Products.FirstOrDefault();\n                var enabled = _featuresService.IsProEnabled;\n                var model = new UpgradeDetailsModel(productData?.LocalizedPrice(), enabled);\n                var viewModel = new UpgradeDetailsWebView { Model = model };\n                LoadContent(viewModel.GenerateString());\n            }\n            catch (Exception e)\n            {\n                AlertDialogService.ShowAlert(\"Error Loading Upgrades\", e.Message);\n            }\n            finally\n            {\n                Web.UserInteractionEnabled = true;\n\n                UIView.Animate(0.2f, 0, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseInOut,\n                    () => _activityView.Alpha = 0, () =>\n                    {\n                        _activityView.RemoveFromSuperview();\n                        _activityView.StopAnimating();\n                    });\n            }\n        }\n\n        protected override bool ShouldStartLoad(WebKit.WKWebView webView, WebKit.WKNavigationAction navigationAction)\n        {\n            var url = navigationAction.Request.Url;\n\n            if (url.Scheme.Equals(\"app\"))\n            {\n                var func = url.Host;\n\n                if (string.Equals(func, \"buy\", StringComparison.OrdinalIgnoreCase))\n                {\n                    Activate(_featuresService.ActivatePro).ToBackground();\n                }\n                else if (string.Equals(func, \"restore\", StringComparison.OrdinalIgnoreCase))\n                {\n                    Activate(_featuresService.RestorePro).ToBackground();\n                }\n\n                return false;\n            }\n\n            if (url.Scheme.Equals(\"mailto\", StringComparison.OrdinalIgnoreCase))\n            {\n                UIApplication.SharedApplication.OpenUrl(url);\n                return false;\n            }\n\n            if (url.Scheme.Equals(\"file\"))\n            {\n                return true;\n            }\n\n            if (url.Scheme.Equals(\"http\") || url.Scheme.Equals(\"https\"))\n            {\n                var view = new WebBrowserViewController(url.AbsoluteString);\n                PresentViewController(view, true, null);\n                return false;\n            }\n\n            return false;\n        }\n\n        private async Task Activate(Func<Task> activation)\n        {\n            try\n            {\n                BTProgressHUD.ShowContinuousProgress(\"Activating...\", ProgressHUD.MaskType.Gradient);\n                using (Disposable.Create(BTProgressHUD.Dismiss))\n                    await activation();\n                Load().ToBackground();\n            }\n            catch (Exception e)\n            {\n                AlertDialogService.ShowAlert(\"Error\", e.Message);\n            }\n        }\n\n        public static UpgradeViewController Present(UIViewController parent)\n        {\n            var vc = new UpgradeViewController();\n            var nav = new ThemedNavigationController(vc);\n\n            var navObj = new UIBarButtonItem(\n                UIBarButtonSystemItem.Cancel,\n                (_, __) => parent.DismissViewController(true, null));\n\n            vc.Appearing.Subscribe(_ => vc.NavigationItem.LeftBarButtonItem = navObj);\n            vc.Disappeared.Subscribe(_ => vc.NavigationItem.LeftBarButtonItem = null);\n\n            parent.PresentViewController(nav, true, null);\n            return vc;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/BaseDialogViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.Views;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class BaseDialogViewController : TableViewController\n    {\n        protected readonly SlideUpTitleView SlideUpTitle;\n        protected readonly ImageAndTitleHeaderView HeaderView;\n        private readonly UIView _backgroundHeaderView;\n        private DialogTableViewSource _dialogSource;\n\n        protected DialogTableViewSource DialogSource\n        {\n            get { return _dialogSource; }\n        }\n\n        protected RootElement Root{\n            get { return _dialogSource.Root; }\n        }\n\n        public override string Title\n        {\n            get\n            {\n                return base.Title;\n            }\n            set\n            {\n                HeaderView.Text = value;\n                SlideUpTitle.Text = value;\n                base.Title = value;\n                RefreshHeaderView();\n            }\n        }\n\n        public override UIRefreshControl RefreshControl\n        {\n            get { return base.RefreshControl; }\n            set\n            {\n                if (value != null) {\n                    value.TintColor = UIColor.White.ColorWithAlpha(0.8f);\n                }\n                base.RefreshControl = value;\n            }\n        }\n\n        protected BaseDialogViewController()\n            : base(UITableViewStyle.Grouped)\n        {\n            SlideUpTitle = new SlideUpTitleView(44f) { Offset = 100f };\n            NavigationItem.TitleView = SlideUpTitle;\n            HeaderView = new ImageAndTitleHeaderView();\n            _backgroundHeaderView = new UIView();\n\n            Appearing\n                .Where(x => ToolbarItems != null && NavigationController != null)\n                .Subscribe(x => NavigationController.SetToolbarHidden(false, x));\n            Disappearing\n                .Where(x => ToolbarItems != null && NavigationController != null)\n                .Subscribe(x => NavigationController.SetToolbarHidden(true, x));\n            Disappearing\n                .Where(_ => NavigationController != null)\n                .Subscribe(_ => NavigationController.NavigationBar.ShadowImage = null);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            HeaderView.BackgroundColor = NavigationController.NavigationBar.BarTintColor;\n            HeaderView.TextColor = NavigationController.NavigationBar.TintColor;\n            HeaderView.SubTextColor = NavigationController.NavigationBar.TintColor.ColorWithAlpha(0.8f);\n            (SlideUpTitle.Subviews[0] as UILabel).TextColor = HeaderView.TextColor;\n            _backgroundHeaderView.BackgroundColor = HeaderView.BackgroundColor;\n            TableView.TableHeaderView = HeaderView;\n        }\n\n        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            base.DidRotate(fromInterfaceOrientation);\n            TableView.BeginUpdates();\n            TableView.TableHeaderView = HeaderView;\n            TableView.EndUpdates();\n        }\n\n        protected virtual DialogTableViewSource CreateTableViewSource()\n        {\n            return new DialogTableViewSource(TableView);\n        }\n\n        protected void RefreshHeaderView(string text = null, string subtext = null)\n        {\n            HeaderView.Text = text ?? HeaderView.Text;\n            HeaderView.SubText = subtext ?? HeaderView.SubText;\n            TableView.TableHeaderView = HeaderView;\n            TableView.ReloadData();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            _dialogSource = CreateTableViewSource();\n\n            TableView.SectionHeaderHeight = 0;\n            TableView.Source = _dialogSource;\n\n            var frame = TableView.Bounds;\n            frame.Y = -frame.Size.Height;\n            _backgroundHeaderView.Frame = frame;\n            _backgroundHeaderView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            _backgroundHeaderView.Layer.ZPosition = -1f;\n            TableView.InsertSubview(_backgroundHeaderView, 0);\n\n            var scrollingObservable = _dialogSource.ScrolledObservable.Select(x => x.Y).StartWith(TableView.ContentOffset.Y);\n            var shadowObs = scrollingObservable.Where(x => x > 0 && NavigationController != null);\n            var shadowImgObs = scrollingObservable.Where(x => x <= 0).Where(_ => NavigationController != null)\n                .Where(_ => NavigationController.NavigationBar.ShadowImage == null);\n            var slideObs = scrollingObservable.Where(_ => SlideUpTitle != null);\n\n            OnActivation(d => {\n                d(shadowObs.Subscribe(_ => NavigationController.NavigationBar.ShadowImage = null));\n                d(shadowImgObs.Subscribe(_ => NavigationController.NavigationBar.ShadowImage = new UIImage()));\n                d(slideObs.Subscribe(x => SlideUpTitle.Offset = 108 + 28f - x));\n            });\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/BaseViewController.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing System.Reactive.Subjects;\nusing System.Reactive.Linq;\nusing Foundation;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class BaseViewController : ReactiveViewController, IActivatable\n    {\n        private readonly ISubject<bool> _appearingSubject = new Subject<bool>();\n        private readonly ISubject<bool> _appearedSubject = new Subject<bool>();\n        private readonly ISubject<bool> _disappearingSubject = new Subject<bool>();\n        private readonly ISubject<bool> _disappearedSubject = new Subject<bool>();\n        private readonly ISubject<Unit> _loadedSubject = new Subject<Unit>();\n\n#if DEBUG\n        ~BaseViewController()\n        {\n            Console.WriteLine(\"All done with \" + GetType().Name);\n        }\n#endif\n\n        public IObservable<Unit> Loaded => _loadedSubject.AsObservable();\n\n        public IObservable<bool> Appearing => _appearingSubject.AsObservable();\n\n        public IObservable<bool> Appeared => _appearedSubject.AsObservable();\n\n        public IObservable<bool> Disappearing => _disappearingSubject.AsObservable();\n\n        public IObservable<bool> Disappeared => _disappearedSubject.AsObservable();\n\n        public void OnActivation(Action<Action<IDisposable>> d)\n        {\n            this.WhenActivated(d);\n        }\n\n        protected BaseViewController()\n        {\n            CommonConstructor();\n        }\n\n        protected BaseViewController(string nib, NSBundle bundle)\n            : base(nib, bundle)\n        {\n            CommonConstructor();\n        }\n\n        private void CommonConstructor()\n        {\n            this.WhenActivated(_ => { });\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            _appearingSubject.OnNext(animated);\n        }\n\n        public override void ViewDidAppear(bool animated)\n        {\n            base.ViewDidAppear(animated);\n            _appearedSubject.OnNext(animated);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            _disappearingSubject.OnNext(animated);\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            _disappearedSubject.OnNext(animated);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            _loadedSubject.OnNext(Unit.Default);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/BaseWebViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing Foundation;\nusing WebKit;\nusing CodeHub.iOS.Utilities;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class BaseWebViewController : BaseViewController\n    {\n        protected UIBarButtonItem BackButton;\n        protected UIBarButtonItem RefreshButton;\n        protected UIBarButtonItem ForwardButton;\n\n        public WKWebView Web { get; private set; }\n        private readonly bool _navigationToolbar;\n        private readonly bool _showPageAsTitle;\n        private bool _networkActivity;\n   \n        protected virtual void GoBack()\n        {\n            Web.GoBack();\n        }\n\n        protected virtual void Refresh()\n        {\n            Web.Reload();\n        }\n\n        protected virtual void GoForward()\n        {\n            Web.GoForward();\n        }\n\n        protected BaseWebViewController()\n            : this(true, true)\n        {\n        }\n\n        protected BaseWebViewController(bool navigationToolbar, bool showPageAsTitle = false)\n        {\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = \"\" };\n\n            _navigationToolbar = navigationToolbar;\n            _showPageAsTitle = showPageAsTitle;\n\n            if (_navigationToolbar)\n            {\n                BackButton = new UIBarButtonItem { Image = Images.Web.BackButton, Enabled = false };\n                ForwardButton = new UIBarButtonItem { Image = Images.Web.FowardButton, Enabled = false };\n                RefreshButton = new UIBarButtonItem(UIBarButtonSystemItem.Refresh) { Enabled = false };\n\n                BackButton.TintColor = Theme.CurrentTheme.WebButtonTint;\n                ForwardButton.TintColor = Theme.CurrentTheme.WebButtonTint;\n                RefreshButton.TintColor = Theme.CurrentTheme.WebButtonTint;\n\n                OnActivation(d =>\n                {\n                    d(BackButton.GetClickedObservable().Subscribe(_ => GoBack()));\n                    d(ForwardButton.GetClickedObservable().Subscribe(_ => GoForward()));\n                    d(RefreshButton.GetClickedObservable().Subscribe(_ => Refresh()));\n                });\n            }\n\n            EdgesForExtendedLayout = UIRectEdge.None;\n        }\n\n        private class NavigationDelegate : WKNavigationDelegate\n        {\n            private readonly WeakReference<BaseWebViewController> _webView;\n\n            public NavigationDelegate(BaseWebViewController webView)\n            {\n                _webView = new WeakReference<BaseWebViewController>(webView);\n            }\n\n            public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)\n            {\n                _webView.Get()?.OnLoadFinished(null, EventArgs.Empty);\n            }\n\n            public override void DidStartProvisionalNavigation(WKWebView webView, WKNavigation navigation)\n            {\n                _webView.Get()?.OnLoadStarted(null, EventArgs.Empty);\n            }\n\n            public override void DidFailNavigation(WKWebView webView, WKNavigation navigation, NSError error)\n            {\n                _webView.Get()?.OnLoadError(error);\n            }\n\n            public override void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, Action<WKNavigationActionPolicy> decisionHandler)\n            {\n                var ret = _webView.Get()?.ShouldStartLoad(webView, navigationAction) ?? true;\n                decisionHandler(ret ? WKNavigationActionPolicy.Allow : WKNavigationActionPolicy.Cancel);\n            }\n        }\n\n        protected virtual bool ShouldStartLoad (WKWebView webView, WKNavigationAction navigationAction)\n        {\n            return true;\n        }\n\n        private void ActivateLoadingIndicator()\n        {\n            if (!_networkActivity)\n                NetworkActivity.PushNetworkActive();\n            _networkActivity = true;\n        }\n\n        private void DeactivateLoadingIndicator()\n        {\n            if (_networkActivity)\n                NetworkActivity.PopNetworkActive();\n            _networkActivity = false;\n        }\n\n        protected virtual void OnLoadError (NSError error)\n        {\n            if (BackButton != null)\n            {\n                BackButton.Enabled = Web.CanGoBack;\n                ForwardButton.Enabled = Web.CanGoForward;\n                RefreshButton.Enabled = true;\n            }\n        }\n\n        protected virtual void OnLoadStarted (object sender, EventArgs e)\n        {\n            ActivateLoadingIndicator();\n\n            if (RefreshButton != null)\n                RefreshButton.Enabled = false;\n        }\n\n        protected virtual void OnLoadFinished(object sender, EventArgs e)\n        {\n            DeactivateLoadingIndicator();\n\n            if (BackButton != null)\n            {\n                BackButton.Enabled = Web.CanGoBack;\n                ForwardButton.Enabled = Web.CanGoForward;\n                RefreshButton.Enabled = true;\n            }\n\n            if (_showPageAsTitle)\n            {\n                Web.EvaluateJavaScript(\"document.title\", (o, _) => {\n                    Title = o as NSString;\n                });\n            }\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(true, animated);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Web = new WKWebView(View.Bounds, new WKWebViewConfiguration());\n            Web.NavigationDelegate = new NavigationDelegate(this);\n            Add(Web);\n        }\n\n        public override void ViewWillLayoutSubviews()\n        {\n            base.ViewWillLayoutSubviews();\n            Web.Frame = View.Bounds;\n        }\n\n        protected static string JavaScriptStringEncode(string data)\n        {\n            return System.Web.HttpUtility.JavaScriptStringEncode(data);\n        }\n\n        protected static string UrlDecode(string data)\n        {\n            return System.Web.HttpUtility.UrlDecode(data);\n        }\n\n        protected string LoadFile(string path)\n        {\n            if (path == null)\n                return string.Empty;\n\n            var uri = Uri.EscapeUriString(\"file://\" + path) + \"#\" + Environment.TickCount;\n            InvokeOnMainThread(() => Web.LoadRequest(new NSUrlRequest(new NSUrl(uri))));\n            return uri;\n        }\n\n        protected void LoadContent(string content)\n        {\n            Web.LoadHtmlString(content, NSBundle.MainBundle.BundleUrl);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            var bounds = View.Bounds;\n            if (_navigationToolbar)\n                bounds.Height -= NavigationController.Toolbar.Frame.Height;\n            Web.Frame = bounds;\n\n            if (_navigationToolbar)\n            {\n                ToolbarItems = new []\n                { \n                    BackButton,\n                    new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 40f },\n                    ForwardButton,\n                    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),\n                    RefreshButton\n                };\n\n                BackButton.Enabled = Web.CanGoBack;\n                ForwardButton.Enabled = Web.CanGoForward;\n                RefreshButton.Enabled = !Web.IsLoading;\n            }   \n\n            if (_showPageAsTitle)\n            {\n                Web.EvaluateJavaScript(\"document.title\", (o, _) => {\n                    Title = o as NSString;\n                });\n            }\n\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(false, animated);\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n\n            if (_navigationToolbar)\n                ToolbarItems = null;\n        }\n\n        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            base.DidRotate(fromInterfaceOrientation);\n            Web.Frame = View.Bounds;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Composer.cs",
    "content": "using System;\r\nusing CoreGraphics;\r\nusing CodeHub.iOS.Views;\r\nusing Foundation;\r\nusing UIKit;\nusing System.Collections.Generic;\r\n\r\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class Composer : BaseViewController\n    {\r\n        public UIBarButtonItem SendItem;\n        public Action<string> ReturnAction;\n        protected readonly UITextView TextView;\n        protected UIView ScrollingToolbarView;\r\n        private UIImage _normalButtonImage;\r\n        private UIImage _pressedButtonImage;\n\n        public bool EnableSendButton\n        {\n            get { return SendItem.Enabled; }\n            set { SendItem.Enabled = value; }\n        }\n\n        public Composer () : base (null, null)\n        {\n            Title = \"New Comment\";\n            EdgesForExtendedLayout = UIRectEdge.None;\n\n            SendItem = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n            NavigationItem.RightBarButtonItem = SendItem;\n\n            TextView = new UITextView(new CGRect(CGPoint.Empty, View.Bounds.Size));\n            TextView.Font = UIFont.PreferredBody;\r\n            TextView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;\n\n            // Work around an Apple bug in the UITextView that crashes\n            if (ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.SIMULATOR)\n                TextView.AutocorrectionType = UITextAutocorrectionType.No;\n\n            View.AddSubview (TextView);\r\n\r\n            _normalButtonImage = ImageFromColor(UIColor.White);\r\n            _pressedButtonImage = ImageFromColor(UIColor.FromWhiteAlpha(0.0f, 0.4f));\r\n        }\r\n\r\n        private UIImage ImageFromColor(UIColor color)\r\n        {\r\n            UIGraphics.BeginImageContext(new CGSize(1, 1));\r\n            var context = UIGraphics.GetCurrentContext();\r\n            context.SetFillColor(color.CGColor);\r\n            context.FillRect(new CGRect(0, 0, 1, 1));\r\n            var image = UIGraphics.GetImageFromCurrentImageContext();\r\n            UIGraphics.EndImageContext();\r\n            return image;\r\n        }\r\n\r\n        public static UIButton CreateAccessoryButton(UIImage image, Action action)\r\n        {\r\n            var btn = CreateAccessoryButton(string.Empty, action);\r\n//            btn.AutosizesSubviews = true;\r\n            btn.SetImage(image, UIControlState.Normal);\r\n            btn.ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\r\n            btn.ImageEdgeInsets = new UIEdgeInsets(6, 6, 6, 6);\r\n\r\n//            var imageView = new UIImageView(image);\r\n//            imageView.Frame = new RectangleF(4, 4, 24, 24);\r\n//            imageView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\r\n//            btn.Add(imageView);\r\n            return btn;\r\n        }\r\n\n        public static UIButton CreateAccessoryButton(string title, Action action)\n        {\r\n            var fontSize = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 22 : 28f;\r\n\n            var btn = new UIButton(UIButtonType.System);\r\n            btn.Frame = new CGRect(0, 0, 32, 32);\r\n            btn.SetTitle(title, UIControlState.Normal);\n            btn.BackgroundColor = UIColor.White;\r\n            btn.Font = UIFont.SystemFontOfSize(fontSize);\r\n            btn.Layer.CornerRadius = 7f;\r\n            btn.Layer.MasksToBounds = true;\n            btn.AdjustsImageWhenHighlighted = false;\r\n            btn.TouchUpInside += (sender, e) => action();\r\n            return btn;\n        }\r\n\r\n        private float CalculateHeight(UIInterfaceOrientation orientation)\r\n        {\r\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\r\n                return 44;\r\n\r\n            // If  pad\r\n            if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown)\r\n                return 64;\r\n            return 88f;\r\n        }\r\n\r\n        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)\r\n        {\r\n            base.WillRotate(toInterfaceOrientation, duration);\r\n\r\n            if (TextView.InputAccessoryView != null)\r\n            {\r\n                UIView.Animate(duration, 0, UIViewAnimationOptions.BeginFromCurrentState, () =>\r\n                {\r\n                    var frame = TextView.InputAccessoryView.Frame;\r\n                    frame.Height = CalculateHeight(toInterfaceOrientation);\r\n                    TextView.InputAccessoryView.Frame = frame;\r\n                }, null);\r\n            }\r\n        }\n\n        public void SetAccesoryButtons(IEnumerable<UIButton> buttons)\n        {\r\n            foreach (var button in buttons)\r\n            {\r\n                button.SetBackgroundImage(_normalButtonImage, UIControlState.Normal);\r\n                button.SetBackgroundImage(_pressedButtonImage, UIControlState.Highlighted);\r\n            }\r\n\r\n            var height = CalculateHeight(UIApplication.SharedApplication.StatusBarOrientation);\n            ScrollingToolbarView = new ScrollingToolbarView(new CGRect(0, 0, View.Bounds.Width, height), buttons);\n            ScrollingToolbarView.BackgroundColor = UIColor.FromWhiteAlpha(0.7f, 1.0f);\n            TextView.InputAccessoryView = ScrollingToolbarView;\n        }\n\n        public string Text\n        {\n            get { return TextView.Text; }\n            set { TextView.Text = value; }\n        }\n\n        void KeyboardChange(NSNotification notification)\r\n        {\r\n            var nsValue = notification.UserInfo.ObjectForKey (UIKeyboard.FrameEndUserInfoKey) as NSValue;\r\n            if (nsValue == null) return;\r\n\r\n            var kbdBounds = nsValue.RectangleFValue;\r\n            var keyboard = View.Window.ConvertRectToView(kbdBounds, View);\r\n\r\n            UIView.Animate(\r\n                1.0f, 0, UIViewAnimationOptions.CurveEaseIn,\r\n                () => TextView.Frame = new CGRect(0, 0, View.Bounds.Width, keyboard.Top), null);\r\n        }\r\n\r\n        NSObject _hideNotification, _showNotification;\r\n        public override void ViewWillAppear (bool animated)\n        {\n            base.ViewWillAppear (animated);\r\n\n            _showNotification = NSNotificationCenter.DefaultCenter.AddObserver(\r\n                new NSString(\"UIKeyboardWillShowNotification\"), KeyboardChange);\r\n            \r\n            _hideNotification = NSNotificationCenter.DefaultCenter.AddObserver(\r\n                new NSString(\"UIKeyboardWillHideNotification\"), KeyboardChange);\r\n            \n            TextView.BecomeFirstResponder ();\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (_hideNotification != null)\r\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_hideNotification);\r\n            if (_showNotification != null)\r\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_showNotification);\n        }\r\n\r\n        public void PresentAsModal(UIViewController parent, Action<string> onSave, Action onClose = null)\r\n        {\n            onClose = onClose ?? new Action(() => parent.DismissViewController(true, null));\r\n\r\n            var closeButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\r\n            NavigationItem.LeftBarButtonItem = closeButton;\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(closeButton.GetClickedObservable()\r\n                  .Subscribe(_ => onClose?.Invoke()));\r\n\r\n                d(SendItem.GetClickedObservable()\r\n                  .Subscribe(_ => onSave?.Invoke(this.Text)));\n            });\r\n\r\n            var navigationController = new UINavigationController(this);\r\n            parent.PresentViewController(navigationController, true, null);\r\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/DialogViewController.cs",
    "content": "//\n// DialogViewController.cs: drives MonoTouch.Dialog\n//\n// Author:\n//   Miguel de Icaza\n//\n// Code to support pull-to-refresh based on Martin Bowling's TweetTableView\n// which is based in turn in EGOTableViewPullRefresh code which was created\n// by Devin Doty and is Copyrighted 2009 enormego and released under the\n// MIT X11 license\n//\nusing System;\nusing UIKit;\nusing CoreGraphics;\nusing System.Collections.Generic;\nusing Foundation;\nusing CodeHub.iOS.DialogElements;\nusing System.Linq;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    /// <summary>\n    ///   The DialogViewController is the main entry point to use MonoTouch.Dialog,\n    ///   it provides a simplified API to the UITableViewController.\n    /// </summary>\n    public class DialogViewController : TableViewController\n    {\n        private readonly Lazy<RootElement> _rootElement;\n        private UISearchBar _searchBar;\n        bool pushing;\n\n        public RootElement Root => _rootElement.Value;\n\n        public bool EnableSearch { get; set; }\n\n        public string SearchPlaceholder { get; set; }\n\n        public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            base.DidRotate (fromInterfaceOrientation);\n            ReloadData ();\n        }\n\n        Section [] originalSections;\n        Element [][] originalElements;\n\n        /// <summary>\n        /// Allows caller to programatically activate the search bar and start the search process\n        /// </summary>\n        public void StartSearch ()\n        {\n            if (originalSections != null)\n                return;\n\n            _searchBar.BecomeFirstResponder ();\n            CreateOriginals(Root);\n        }\n\n        private void CreateOriginals(RootElement root)\n        {\n            originalSections = root.Sections.ToArray ();\n            originalElements = new Element [originalSections.Length][];\n            for (int i = 0; i < originalSections.Length; i++)\n                originalElements [i] = originalSections [i].Elements.ToArray ();\n        }\n\n        /// <summary>\n        /// Allows the caller to programatically stop searching.\n        /// </summary>\n        public virtual void FinishSearch ()\n        {\n            if (originalSections == null)\n                return;\n\n            _searchBar.Text = \"\";\n\n            Root.Reset(originalSections);\n            originalSections = null;\n            originalElements = null;\n            _searchBar.ResignFirstResponder ();\n            ReloadData ();\n        }\n\n        public void PerformFilter (string text)\n        {\n            if (originalSections == null)\n                return;\n\n            var newSections = new List<Section> ();\n\n            for (int sidx = 0; sidx < originalSections.Length; sidx++){\n                Section newSection = null;\n                var section = originalSections [sidx];\n                Element [] elements = originalElements [sidx];\n\n                for (int eidx = 0; eidx < elements.Length; eidx++){\n                    if (elements [eidx].Matches (text)){\n                        if (newSection == null){\n                            newSection = new Section (section.Header, section.Footer){\n                                FooterView = section.FooterView,\n                                HeaderView = section.HeaderView\n                            };\n                            newSections.Add (newSection);\n                        }\n                        newSection.Add (elements [eidx]);\n                    }\n                }\n            }\n\n            Root.Reset(newSections);\n            ReloadData ();\n        }\n\n        public virtual void SearchButtonClicked (string text)\n        {\n            _searchBar.ResignFirstResponder();\n        }\n\n        protected class SearchDelegate : UISearchBarDelegate {\n            readonly WeakReference<DialogViewController> container;\n\n            public SearchDelegate (DialogViewController container)\n            {\n                this.container = new WeakReference<DialogViewController>(container);\n            }\n\n            public override void OnEditingStarted (UISearchBar searchBar)\n            {\n                searchBar.ShowsCancelButton = true;\n                container.Get()?.StartSearch ();\n            }\n\n            public override void OnEditingStopped (UISearchBar searchBar)\n            {\n                searchBar.ShowsCancelButton = false;\n                //container.FinishSearch ();\n            }\n\n            public override void TextChanged (UISearchBar searchBar, string searchText)\n            {\n                container.Get()?.PerformFilter (searchText ?? \"\");\n            }\n\n            public override void CancelButtonClicked (UISearchBar searchBar)\n            {\n                var r = container.Get();\n                searchBar.ShowsCancelButton = false;\n                if (r != null)\n                {\n                    r._searchBar.Text = \"\";\n                    r.FinishSearch();\n                }\n                searchBar.ResignFirstResponder ();\n            }\n\n            public override void SearchButtonClicked (UISearchBar searchBar)\n            {\n                container.Get()?.SearchButtonClicked (searchBar.Text);\n            }\n        }\n\n        protected virtual void DidScroll(CGPoint p)\n        {\n        }\n\n        public class Source : UITableViewSource {\n            private readonly WeakReference<DialogViewController> _container;\n\n            public RootElement Root => _container.Get()?.Root;\n\n            public DialogViewController Container\n            {\n                get { return _container.Get(); }\n            }\n\n            public Source (DialogViewController container)\n            {\n                _container = new WeakReference<DialogViewController>(container);\n            }\n\n            public override nint RowsInSection (UITableView tableview, nint section)\n            {\n                var s = Root?[(int)section];\n                var count = s?.Elements.Count;\n                return count ?? 0;\n            }\n\n            public override nint NumberOfSections (UITableView tableView)\n            {\n                return Root?.Count ?? 0;\n            }\n\n            public override string TitleForHeader (UITableView tableView, nint section)\n            {\n                return Root?[(int)section]?.Header;\n            }\n\n            public override string TitleForFooter (UITableView tableView, nint section)\n            {\n                return Root?[(int)section]?.Footer;\n            }\n\n            public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)\n            {\n                var section = Root?[indexPath.Section];\n                var element = section?[indexPath.Row];\n                return element?.GetCell (tableView);\n            }\n\n            public override void RowDeselected (UITableView tableView, NSIndexPath indexPath)\n            {\n                _container.Get()?.Deselected (indexPath);\n            }\n\n            public override void RowSelected (UITableView tableView, NSIndexPath indexPath)\n            {\n                _container.Get()?.Selected (indexPath);\n            }            \n\n            public override UIView GetViewForHeader (UITableView tableView, nint sectionIdx)\n            {\n                var section = Root?[(int)sectionIdx];\n                return section?.HeaderView;\n            }\n\n            public override nfloat GetHeightForHeader (UITableView tableView, nint sectionIdx)\n            {\n                var section = Root?[(int)sectionIdx];\n                return section?.HeaderView?.Frame.Height ?? -1;\n            }\n\n            public override UIView GetViewForFooter (UITableView tableView, nint sectionIdx)\n            {\n                var section = Root?[(int)sectionIdx];\n                return section?.FooterView;\n            }\n\n            public override nfloat GetHeightForFooter (UITableView tableView, nint sectionIdx)\n            {\n                var section = Root?[(int)sectionIdx];\n                return section?.FooterView?.Frame.Height ?? -1;\n            }\n\n            public override void Scrolled (UIScrollView scrollView)\n            {\n                _container.Get()?.DidScroll(Root.TableView.ContentOffset);\n            }\n\n            public override nfloat GetHeightForRow (UITableView tableView, NSIndexPath indexPath)\n            {\n                var section = Root?[indexPath.Section];\n                var element = section?[indexPath.Row];\n\n                var sizable = element as IElementSizing;\n                return sizable?.GetHeight(tableView, indexPath) ?? tableView.RowHeight;\n            }\n        }\n\n        protected virtual IUISearchBarDelegate CreateSearchDelegate()\n        {\n            return new SearchDelegate(this);\n        }\n\n        void SetupSearch ()\n        {\n            if (EnableSearch){\n                _searchBar = new UISearchBar (new CGRect (0, 0, TableView.Bounds.Width, 44)) {\n                    Delegate = CreateSearchDelegate()\n                };\n                if (SearchPlaceholder != null)\n                    _searchBar.Placeholder = this.SearchPlaceholder;\n                TableView.TableHeaderView = _searchBar;                    \n            } else {\n                // Does not work with current Monotouch, will work with 3.0\n                // tableView.TableHeaderView = null;\n            }\n        }\n\n        public virtual void Deselected (NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n\n            element.Deselected (TableView, indexPath);\n        }\n\n        public virtual void Selected (NSIndexPath indexPath)\n        {\n            var section = Root[indexPath.Section];\n            var element = section[indexPath.Row];\n\n            element.Selected (TableView, indexPath);\n        }\n\n        public virtual Source CreateSizingSource()\n        {\n            return new Source (this);\n        }\n\n\n        public override void LoadView ()\n        {\n            base.LoadView();\n            SetupSearch ();\n            TableView.Source = CreateSizingSource();\n        }\n\n        public override void ViewWillAppear (bool animated)\n        {\n            base.ViewWillAppear (animated);\n            NavigationItem.HidesBackButton = !pushing;\n            TableView.ReloadData ();\n        }\n\n        public bool Pushing {\n            get {\n                return pushing;\n            }\n            set {\n                pushing = value;\n                if (NavigationItem != null)\n                    NavigationItem.HidesBackButton = !pushing;\n            }\n        }\n\n        public void ReloadData ()\n        {\n            TableView.ReloadData();\n        }\n\n        public DialogViewController (UITableViewStyle style, bool pushing = true) \n            : base (style)\n        {\n            _rootElement = new Lazy<RootElement>(() => new RootElement(TableView));\n\n            EdgesForExtendedLayout = UIRectEdge.None;\n            SearchPlaceholder = \"Search\";\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = \"\" };\n            this.pushing = pushing;\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Events/BaseEventsViewController.cs",
    "content": "using System;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.Core.ViewModels.Events;\nusing GitHubSharp.Models;\nusing UIKit;\nusing System.Collections.Generic;\nusing CodeHub.Core.Utilities;\nusing CodeHub.iOS.ViewControllers.Source;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Events\n{\n    public abstract class BaseEventsViewController : ViewModelCollectionDrivenDialogViewController\n    {\n        public new BaseEventsViewModel ViewModel\n        {\n            get { return (BaseEventsViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        private static IDictionary<EventType, Octicon> _eventToImage \n        = new Dictionary<EventType, Octicon>\n        {\n            {EventType.Unknown, Octicon.Alert},\n            {EventType.Branch, Octicon.GitBranch},\n            {EventType.Comment, Octicon.Comment},\n            {EventType.Commit, Octicon.GitCommit},\n            {EventType.Delete, Octicon.Trashcan},\n            {EventType.Follow, Octicon.Person},\n            {EventType.Fork, Octicon.RepoForked},\n            {EventType.Gist, Octicon.Gist},\n            {EventType.Issue, Octicon.IssueOpened},\n            {EventType.Organization, Octicon.Organization},\n            {EventType.Public, Octicon.Globe},\n            {EventType.PullRequest, Octicon.GitPullRequest},\n            {EventType.Repository, Octicon.Repo},\n            {EventType.Star, Octicon.Star},\n            {EventType.Tag, Octicon.Tag},\n            {EventType.Wiki, Octicon.Pencil},\n        };\n\n        protected BaseEventsViewController()\n        {\n            Title = \"Events\";\n            EnableSearch = false;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            TableView.RowHeight = UITableView.AutomaticDimension;\n            TableView.EstimatedRowHeight = 64f;\n            BindCollection(ViewModel.Events, CreateElement);\n\n            this.OnActivation(d =>\n            {\n                d(ViewModel.GoToBranchCommand\n                  .Subscribe(branch =>\n                {\n                    var viewController = new SourceTreeViewController(\n                        branch.Item1.Owner, branch.Item1.Name, null, branch.Item2, Utilities.ShaType.Branch);\n                    this.PushViewController(viewController);\n                }));\n\n                d(ViewModel.GoToTagCommand\n                  .Subscribe(branch =>\n                  {\n                      var viewController = new SourceTreeViewController(\n                          branch.Item1.Owner, branch.Item1.Name, null, branch.Item2, Utilities.ShaType.Tag);\n                      this.PushViewController(viewController);\n                  }));\n            });\n        }\n\n        private static Element CreateElement(Tuple<EventModel, BaseEventsViewModel.EventBlock> e)\n        {\n            try\n            {\n                if (e.Item2 == null)\n                    return null;\n\n                var imgKey = ChooseImage(e.Item1);\n                var img = Octicon.Alert;\n                if (_eventToImage.ContainsKey(imgKey))\n                    img = _eventToImage[imgKey];\n                    \n                var avatar = e.Item1.Actor != null ? e.Item1.Actor.AvatarUrl : null;\n                var headerBlocks = new List<NewsFeedElement.TextBlock>();\n                foreach (var h in e.Item2.Header)\n                {\n                    Action act = null;\n                    var anchorBlock = h as BaseEventsViewModel.AnchorBlock;\n                    if (anchorBlock != null)\n                        act = anchorBlock.Tapped;\n                    headerBlocks.Add(new NewsFeedElement.TextBlock(h.Text, act));\n                }\n\n                var bodyBlocks = new List<NewsFeedElement.TextBlock>();\n                foreach (var h in e.Item2.Body)\n                {\n                    Action act = null;\n                    var anchorBlock = h as BaseEventsViewModel.AnchorBlock;\n                    if (anchorBlock != null)\n                        act = anchorBlock.Tapped;\n                    var block = new NewsFeedElement.TextBlock(h.Text, act);\n                    bodyBlocks.Add(block);\n                }\n\n                var weakTapped = new WeakReference<Action>(e.Item2.Tapped);\n                var githubAvatar = new GitHubAvatar(avatar).ToUri(64)?.AbsoluteUri;\n                return new NewsFeedElement(githubAvatar, e.Item1.CreatedAt, headerBlocks, bodyBlocks, img.ToImage(), () => weakTapped.Get()?.Invoke(), e.Item2.Multilined);\n            }\n            catch (Exception ex)\n            {\n                System.Diagnostics.Debug.WriteLine(\"Unable to add event: \" + ex.Message);\n                return null;\n            }\n        }\n\n        private static EventType ChooseImage(EventModel eventModel)\n        {\n            if (eventModel.PayloadObject is EventModel.CommitCommentEvent)\n                return EventType.Comment;\n\n            var createEvent = eventModel.PayloadObject as EventModel.CreateEvent;\n            if (createEvent != null)\n            {\n                var createModel = createEvent;\n                if (createModel.RefType.Equals(\"repository\"))\n                    return EventType.Repository;\n                if (createModel.RefType.Equals(\"branch\"))\n                    return EventType.Branch;\n                if (createModel.RefType.Equals(\"tag\"))\n                    return EventType.Tag;\n            }\n            else if (eventModel.PayloadObject is EventModel.DeleteEvent)\n                return EventType.Delete;\n            else if (eventModel.PayloadObject is EventModel.FollowEvent)\n                return EventType.Follow;\n            else if (eventModel.PayloadObject is EventModel.ForkEvent)\n                return EventType.Fork;\n            else if (eventModel.PayloadObject is EventModel.ForkApplyEvent)\n                return EventType.Fork;\n            else if (eventModel.PayloadObject is EventModel.GistEvent)\n                return EventType.Gist;\n            else if (eventModel.PayloadObject is EventModel.GollumEvent)\n                return EventType.Wiki;\n            else if (eventModel.PayloadObject is EventModel.IssueCommentEvent)\n                return EventType.Comment;\n            else if (eventModel.PayloadObject is EventModel.IssuesEvent)\n                return EventType.Issue;\n            else if (eventModel.PayloadObject is EventModel.MemberEvent)\n                return EventType.Organization;\n            else if (eventModel.PayloadObject is EventModel.PublicEvent)\n                return EventType.Public;\n            else if (eventModel.PayloadObject is EventModel.PullRequestEvent)\n                return EventType.PullRequest;\n            else if (eventModel.PayloadObject is EventModel.PullRequestReviewCommentEvent)\n                return EventType.Comment;\n            else if (eventModel.PayloadObject is EventModel.PushEvent)\n                return EventType.Commit;\n            else if (eventModel.PayloadObject is EventModel.TeamAddEvent)\n                return EventType.Organization;\n            else if (eventModel.PayloadObject is EventModel.WatchEvent)\n                return EventType.Star;\n            else if (eventModel.PayloadObject is EventModel.ReleaseEvent)\n                return EventType.Tag;\n            return EventType.Unknown;\n        }\n\n        public enum EventType\n        {\n            Unknown = 0,\n            Comment,\n            Repository,\n            Branch,\n            Tag,\n            Delete,\n            Follow,\n            Fork,\n            Gist,\n            Wiki,\n            Issue,\n            Organization,\n            Public,\n            PullRequest,\n            Star,\n            Commit\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Events/NewsViewController.cs",
    "content": "using CodeHub.Core.ViewModels.Events;\n\nnamespace CodeHub.iOS.ViewControllers.Events\n{\n    public class NewsViewController : BaseEventsViewController\n    {\n        public NewsViewController()\n        {\n            Title = \"News\";\n        }\n\n        public static NewsViewController Create()\n            => new NewsViewController { ViewModel = new NewsViewModel() };\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Events/OrganizationEventsViewController.cs",
    "content": "namespace CodeHub.iOS.ViewControllers.Events\n{\n    public class OrganizationEventsViewController : BaseEventsViewController\n    {\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Events/RepositoryEventsViewController.cs",
    "content": "using CodeHub.Core.ViewModels.Events;\n\nnamespace CodeHub.iOS.ViewControllers.Events\n{\n    public class RepositoryEventsViewController : BaseEventsViewController\n    {\n        public RepositoryEventsViewController()\n        {\n        }\n\n        public RepositoryEventsViewController(string username, string repository)\n        {\n            var viewModel = new RepositoryEventsViewModel();\n            viewModel.Init(new RepositoryEventsViewModel.NavObject\n            {\n                Username = username,\n                Repository = repository\n            });\n            ViewModel = viewModel;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Events/UserEventsViewController.cs",
    "content": "using CodeHub.Core.ViewModels.Events;\n\nnamespace CodeHub.iOS.ViewControllers.Events\n{\n    public class UserEventsViewController : BaseEventsViewController\n    {\n        public UserEventsViewController()\n        {\n        }\n\n        public UserEventsViewController(string username)\n        {\n            var viewModel = new UserEventsViewModel();\n            viewModel.Init(new UserEventsViewModel.NavObject { Username = username });\n            ViewModel = viewModel;\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/FilterViewController.cs",
    "content": "using System;\r\nusing System.Linq;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing UIKit;\r\nusing CodeHub.iOS.DialogElements;\r\nusing Humanizer;\r\n\r\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class FilterViewController : DialogViewController\n    {\n        protected FilterViewController()\n            : base(UITableViewStyle.Grouped)\n        {\n            Title = \"Filter & Sort\";\r\n\n            var cancel = NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            var save = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Save);\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(cancel.GetClickedObservable().Subscribe(_ => DismissViewController(true, null)));\r\n                d(save.GetClickedObservable().Subscribe(_ => {\r\n                    ApplyButtonPressed();\r\n                    DismissViewController(true, null); \r\n                }));\r\n            });\n        }\n\n        public abstract void ApplyButtonPressed();\n\n        public void CloseViewController()\n        {\n            DismissViewController(true, null);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            TableView.ReloadData();\n        }\n\n        public class EnumChoiceElement<T> : StringElement where T : struct, IConvertible\n        {\n            private T _value;\n\n            public new T Value\n            {\n                get { return _value; }\n                set\n                {\n                    _value = value;\n                    base.Value = ((Enum)Enum.ToObject(typeof(T), value)).Humanize();\n                }\n            }\n\n            public EnumChoiceElement(string title, T defaultVal)\n                : base(title, string.Empty, UITableViewCellStyle.Value1)\n            {\n                Accessory = UITableViewCellAccessory.DisclosureIndicator;\n                Value = defaultVal;\n            }\n        }\n\n        public EnumChoiceElement<T> CreateEnumElement<T>(string title, T value) where T : struct, IConvertible\n        {\n            var element = new EnumChoiceElement<T>(title, value);\n\n            element.Clicked.Subscribe(_ =>\r\n            {\n                var ctrl = new DialogViewController(UITableViewStyle.Grouped);\n                ctrl.Title = title;\n\n                var sec = new Section();\n                foreach (var x in Enum.GetValues(typeof(T)).Cast<Enum>())\r\n                {\r\n                    var e = new StringElement(x.Humanize())\r\n                    { \r\n                        Accessory = object.Equals(x, element.Value) ? \r\n                            UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None \r\n                    };\r\n                    e.Clicked.Subscribe(__ =>\r\n                    { \r\n                        element.Value = (T)Enum.ToObject(typeof(T), x); \r\n                        NavigationController.PopViewController(true);\r\n                    });\r\n\n                    sec.Add(e);\n                }\n                ctrl.Root.Reset(sec);\n                NavigationController.PushViewController(ctrl, true);\n            });\n            \n            return element;\n        }\n\n        public class MultipleChoiceElement<T> : StringElement\n        {\n            public T Obj;\n            public MultipleChoiceElement(string title, T obj)\n                : base(title, CreateCaptionForMultipleChoice(obj), UITableViewCellStyle.Value1)\n            {\n                Obj = obj;\n                Accessory = UITableViewCellAccessory.DisclosureIndicator;\n            }\n        }\n\n        protected MultipleChoiceElement<T> CreateMultipleChoiceElement<T>(string title, T o)\n        {\n            var element = new MultipleChoiceElement<T>(title, o);\n            element.Clicked.Subscribe(_ =>\n            {\n                var en = new MultipleChoiceViewController(element.Caption, o);\r\n                en.Disappearing.Subscribe(__ => {\n                    element.Value = CreateCaptionForMultipleChoice(o);\n                });\n                NavigationController.PushViewController(en, true);\n            });\n\n            return element;\n        }\n\n        private static string CreateCaptionForMultipleChoice<T>(T o)\n        {\n            var fields = o.GetType().GetFields();\n            var sb = new System.Text.StringBuilder();\n            int trueCounter = 0;\n            foreach (var f in fields)\n            {\n                if ((bool)f.GetValue(o))\n                {\n                    sb.Append(f.Name);\n                    sb.Append(\", \");\n                    trueCounter++;\n                }\n            }\n            var str = sb.ToString();\n            if (str.EndsWith(\", \"))\n                return trueCounter == fields.Length ? \"Any\" : str.Substring(0, str.Length - 2);\n            return \"None\";\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Filters/IssueMilestonesFilterViewController.cs",
    "content": "using System;\nusing GitHubSharp.Models;\nusing System.Linq;\nusing CodeHub.Core.ViewModels;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS.ViewControllers.Filters\n{\n    public class IssueMilestonesFilterViewController : DialogViewController\n    {\n        private readonly CollectionViewModel<MilestoneModel> _milestones = new CollectionViewModel<MilestoneModel>();\n        private string _username, _repository;\n\n        public Action<string, int?, string> MilestoneSelected;\n\n        public async override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            try\n            {\n                NetworkActivity.PushNetworkActive();\n                var app = MvvmCross.Platform.Mvx.Resolve<CodeHub.Core.Services.IApplicationService>();\n                await _milestones.SimpleCollectionLoad(app.Client.Users[_username].Repositories[_repository].Milestones.GetAll());\n            }\n            catch {\n            }\n            finally\n            {\n                NetworkActivity.PopNetworkActive();\n            }\n        }\n\n        public IssueMilestonesFilterViewController(string user, string repo, bool alreadySelected)\n            : base(UIKit.UITableViewStyle.Plain)\n        {\n            _username = user;\n            _repository = repo;\n            Title = \"Milestones\";\n            SearchPlaceholder = \"Search Milestones\";\n\n            var clearMilestone = new MilestoneModel { Title = \"Clear milestone filter\" };\n            var noMilestone = new MilestoneModel { Title = \"Issues with no milestone\" };\n            var withMilestone = new MilestoneModel { Title = \"Issues with milestone\" };\n\n            _milestones.CollectionChanged += (sender, e) => {\n                var items = _milestones.ToList();\n\n                items.Insert(0, noMilestone);\n                items.Insert(1, withMilestone);\n\n                if (alreadySelected)\n                    items.Insert(0, clearMilestone);\n\n                var sec = new Section();\n                foreach (var item in items)\n                {\n                    var x = item;\n                    var element = new StringElement(x.Title);\n                    element.Clicked.Subscribe(_ => {\n                        if (MilestoneSelected != null)\n                        {\n                            if (x == noMilestone)\n                                MilestoneSelected(x.Title, null, \"none\");\n                            else if (x == withMilestone)\n                                MilestoneSelected(x.Title, null, \"*\");\n                            else if (x == clearMilestone)\n                                MilestoneSelected(null, null, null);\n                            else\n                                MilestoneSelected(x.Title, x.Number, x.Number.ToString());\n                        }\n                    });\n                    sec.Add(element);\n                }\n\n                InvokeOnMainThread(() => Root.Reset(sec));\n            };\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Filters/IssuesFilterViewController.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.Core.ViewModels;\nusing CodeHub.Core.Filters;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS.ViewControllers.Filters\n{\n    public class IssuesFilterViewController : FilterViewController\n    {\n        private readonly IFilterableViewModel<IssuesFilterModel> _filterController;\n        private readonly string _user;\n        private readonly string _repo;\n        private IssuesFilterModel.MilestoneKeyValue _milestoneHolder;\n\n        private BooleanElement _open;\n        private StringElement _milestone;\n        private EntryElement _labels, _mentioned, _creator, _assignee;\n        private EnumChoiceElement<IssuesFilterModel.Sort> _sort;\n        private BooleanElement _asc;\n\n        public IssuesFilterViewController(string user, string repo, IFilterableViewModel<IssuesFilterModel> filterController)\n        {\n            _user = user;\n            _repo = repo;\n            _filterController = filterController;\n        }\n\n        public override void ApplyButtonPressed()\n        {\n            _filterController.ApplyFilter(CreateFilterModel());\n        }\n\n        private IssuesFilterModel CreateFilterModel()\n        {\n            var model = new IssuesFilterModel();\n            model.Open = _open.Value;\n            model.Labels = _labels.Value;\n            model.SortType = _sort.Value;\n            model.Ascending = _asc.Value;\n            model.Mentioned = _mentioned.Value;\n            model.Creator = _creator.Value;\n            model.Assignee = _assignee.Value;\n            model.Milestone = _milestoneHolder;\n            return model;\n        }\n\n        private void RefreshMilestone()\n        {\n            if (_milestoneHolder == null)\n                _milestone.Value = \"None\";\n            else\n                _milestone.Value = _milestoneHolder.Name;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            var model = _filterController.Filter.Clone();\n\n            var save = new StringElement(\"Save as Default\") { Accessory = UITableViewCellAccessory.None };\n            save.Clicked.Subscribe(_ =>\n            {\n                _filterController.ApplyFilter(CreateFilterModel(), true);\n                CloseViewController();\n            });\n\n            //Load the root\n            var root = new [] {\n                new Section(\"Filter\") {\n                    (_open = new BooleanElement(\"Open?\", model.Open)),\n                    (_labels = new EntryElement(\"Labels\", \"bug,ui,@user\", model.Labels) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),\n                    (_mentioned = new EntryElement(\"Mentioned\", \"User\", model.Mentioned) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),\n                    (_creator = new EntryElement(\"Creator\", \"User\", model.Creator) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),\n                    (_assignee = new EntryElement(\"Assignee\", \"User\", model.Assignee) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),\n                    (_milestone = new StringElement(\"Milestone\", \"None\", UITableViewCellStyle.Value1)),\n                },\n                new Section(\"Order By\") {\n                    (_sort = CreateEnumElement(\"Field\", model.SortType)),\n                    (_asc = new BooleanElement(\"Ascending\", model.Ascending))\n                },\n                new Section(string.Empty, \"Saving this filter as a default will save it only for this repository.\") {\n                    save\n                }\n            };\n\n            RefreshMilestone();\n\n            _milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;\n            _milestone.Clicked.Subscribe(_ => {\n                var ctrl = new IssueMilestonesFilterViewController(_user, _repo, _milestoneHolder != null);\n\n                ctrl.MilestoneSelected = (title, num, val) => {\n                    if (title == null && num == null && val == null)\n                        _milestoneHolder = null;\n                    else\n                        _milestoneHolder = new IssuesFilterModel.MilestoneKeyValue { Name = title, Value = val, IsMilestone = num.HasValue };\n                    RefreshMilestone();\n                    NavigationController.PopViewController(true);\n                };\n                NavigationController.PushViewController(ctrl, true);\n            });\n\n            Root.Reset(root);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Filters/MyIssuesFilterViewController.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.Core.ViewModels;\nusing CodeHub.Core.Filters;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS.ViewControllers.Filters\n{\n    public class MyIssuesFilterViewController : FilterViewController\n    {\n        private readonly IFilterableViewModel<MyIssuesFilterModel> _filterController;\n\n        private EnumChoiceElement<MyIssuesFilterModel.Filter> _filter;\n        private BooleanElement _open;\n        private EntryElement _labels;\n        private EnumChoiceElement<MyIssuesFilterModel.Sort> _sort;\n        private BooleanElement _asc;\n\n\n        public MyIssuesFilterViewController(IFilterableViewModel<MyIssuesFilterModel> filterController)\n        {\n            _filterController = filterController;\n        }\n\n        public override void ApplyButtonPressed()\n        {\n            _filterController.ApplyFilter(CreateFilterModel());\n        }\n\n        private MyIssuesFilterModel CreateFilterModel()\n        {\n            var model = new MyIssuesFilterModel();\n            model.FilterType = _filter.Value;\n            model.Open = _open.Value;\n            model.Labels = _labels.Value;\n            model.SortType = _sort.Value;\n            model.Ascending = _asc.Value;\n            return model;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            var model = _filterController.Filter.Clone();\n\n            var save = new StringElement(\"Save as Default\") { Accessory = UITableViewCellAccessory.None };\n            save.Clicked.Subscribe(_ =>\n            {\n                _filterController.ApplyFilter(CreateFilterModel(), true);\n                CloseViewController();\n            });\n\n            //Load the root\n            var sections = new [] {\n                new Section(\"Filter\") {\n                    (_filter = CreateEnumElement(\"Type\", model.FilterType)),\n                    (_open = new BooleanElement(\"Open?\", model.Open)),\n                    (_labels = new EntryElement(\"Labels\", \"bug,ui,@user\", model.Labels) { TextAlignment = UITextAlignment.Right, AutocorrectionType = UITextAutocorrectionType.No, AutocapitalizationType = UITextAutocapitalizationType.None }),\n                },\n                new Section(\"Order By\") {\n                    (_sort = CreateEnumElement(\"Field\", model.SortType)),\n                    (_asc = new BooleanElement(\"Ascending\", model.Ascending))\n                },\n                new Section() {\n                    save,\n                }\n            };\n\n            Root.Reset(sections);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistCreateViewController.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.Core.ViewModels.Gists;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.DialogElements;\nusing System.Collections.Generic;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing ReactiveUI;\n\nnamespace CodeHub.iOS.ViewControllers.Gists\n{\n    public class GistCreateViewController : DialogViewController\n    {\n        public GistCreateViewModel ViewModel { get; }\n\n        public GistCreateViewController() : base(UITableViewStyle.Grouped)\n        {\n            Title = \"Create Gist\";\n            ViewModel = new GistCreateViewModel();\n        }\n\n        public static GistCreateViewController Show(UIViewController parent)\n        {\n            var ctrl = new GistCreateViewController();\n            var weakVm = new WeakReference<GistCreateViewModel>(ctrl.ViewModel);\n            ctrl.ViewModel.SaveCommand.Subscribe(_ => parent.DismissViewController(true, null));\n            ctrl.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            ctrl.NavigationItem.LeftBarButtonItem.GetClickedObservable().Subscribe(_ => {\n                weakVm.Get()?.CancelCommand.Execute().Subscribe();\n                parent.DismissViewController(true, null);\n            });\n            parent.PresentViewController(new ThemedNavigationController(ctrl), true, null);\n            return ctrl;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.RowHeight = UITableView.AutomaticDimension;\n            TableView.EstimatedRowHeight = 44f;\n\n            var saveButton = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n\n            OnActivation(d =>\n            {\n                d(ViewModel.Bind(x => x.Description).Subscribe(_ => UpdateView()));\n                d(ViewModel.Bind(x => x.Files).Subscribe(_ => UpdateView()));\n                d(ViewModel.Bind(x => x.Public).Subscribe(_ => UpdateView()));\n                d(ViewModel.Bind(x => x.IsSaving).SubscribeStatus(\"Saving...\"));\n\n\t            d(saveButton.GetClickedObservable()\n                  .Select(_ => Unit.Default)\n\t              .InvokeReactiveCommand(ViewModel.SaveCommand));\n            });\n        }\n\n        int _gistFileCounter = 0;\n        private void AddFile()\n        {\n            var createController = new GistFileAddViewController();\n            createController.SaveCommand.Subscribe(_ => NavigationController.PopToViewController(this, true));\n            createController.Save = (name, content) => {\n                if (string.IsNullOrEmpty(name))\n                {\n                    //Keep trying until we get a valid filename\n                    while (true)\n                    {\n                        name = \"gistfile\" + (++_gistFileCounter) + \".txt\";\n                        if (ViewModel.Files.ContainsKey(name))\n                            continue;\n                        break;\n                    }\n                }\n\n                if (ViewModel.Files.ContainsKey(name))\n                    throw new InvalidOperationException(\"A filename by that type already exists\");\n                ViewModel.Files.Add(name, content);\n                ViewModel.Files = ViewModel.Files;\n            };\n\n            NavigationController.PushViewController(createController, true);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            UpdateView();\n        }\n\n        protected void UpdateView()\n        {\n            ICollection<Section> sections = new LinkedList<Section>();\n            var section = new Section();\n            sections.Add(section);\n\n            var desc = new MultilinedElement(\"Description\", ViewModel.Description);\n            desc.Clicked.Subscribe(_ => ChangeDescription());\n            section.Add(desc);\n\n            var pub = new BooleanElement(\"Public\", ViewModel.Public); \n            pub.Changed.Subscribe(x => ViewModel.Public = x);\n            section.Add(pub);\n\n            var fileSection = new Section();\n            sections.Add(fileSection);\n\n            foreach (var file in ViewModel.Files.Keys)\n            {\n                var key = file;\n                if (string.IsNullOrEmpty(ViewModel.Files[file]))\n                    continue;\n\n                var size = System.Text.Encoding.UTF8.GetByteCount(ViewModel.Files[file]);\n                var el = new StringElement(file, size + \" bytes\", UITableViewCellStyle.Subtitle) { Accessory = UITableViewCellAccessory.DisclosureIndicator };\n                el.Clicked.Subscribe(_ => {\n                    if (!ViewModel.Files.ContainsKey(key))\n                        return;\n                    var createController = new GistFileEditViewController { Filename = key, Content = ViewModel.Files[key] };\n                    createController.SaveCommand.Subscribe(__ => NavigationController.PopToViewController(this, true));\n                    createController.Save = (name, content) => {\n\n                        if (string.IsNullOrEmpty(name))\n                            throw new InvalidOperationException(\"Please enter a name for the file\");\n\n                        //If different name & exists somewhere else\n                        if (!name.Equals(key) && ViewModel.Files.ContainsKey(name))\n                            throw new InvalidOperationException(\"A filename by that type already exists\");\n\n                        ViewModel.Files.Remove(key);\n                        ViewModel.Files[name] = content;\n                        ViewModel.Files = ViewModel.Files; // Trigger refresh\n                    };\n\n                    NavigationController.PushViewController(createController, true);\n                });\n                fileSection.Add(el);\n            }\n\n            var add = new StringElement(\"Add New File\");\n            add.Clicked.Subscribe(_ => AddFile());\n            fileSection.Add(add);\n\n            Root.Reset(sections);\n        }\n\n        private void ChangeDescription()\n        {\n            var composer = new Composer\n            {\n                Title = \"Description\",\n                Text = ViewModel.Description\n            };\n\n            composer.PresentAsModal(this, text =>\n            {\n                ViewModel.Description = text;\n                this.DismissViewController(true, null);\n            });\n        }\n\n        public override DialogViewController.Source CreateSizingSource()\n        {\n            return new EditSource(this);\n        }\n\n        private void Delete(Element element)\n        {\n            var e = element as StringElement;\n            if (e != null)\n                ViewModel.Files.Remove(e.Caption);\n        }\n\n        private class EditSource : Source\n        {\n            public EditSource(GistCreateViewController dvc) \n                : base (dvc)\n            {\n            }\n\n            public override bool CanEditRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                return (indexPath.Section == 1 && indexPath.Row != ((Root?[1].Count ?? 0) - 1));\n            }\n\n            public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                if (indexPath.Section == 1 && indexPath.Row != ((Root?[1].Count ?? 0) - 1))\n                    return UITableViewCellEditingStyle.Delete;\n                return UITableViewCellEditingStyle.None;\n            }\n\n            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)\n            {\n                switch (editingStyle)\n                {\n                    case UITableViewCellEditingStyle.Delete:\n                        var section = Root?[indexPath.Section];\n                        var element = section?[indexPath.Row];\n                        (Container as GistCreateViewController)?.Delete(element);\n                        section?.Remove(element);\n                        break;\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistEditViewController.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing UIKit;\nusing System.Linq;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.DialogElements;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.ViewControllers.Gists;\nusing Octokit;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class GistEditViewController : DialogViewController\n    {\n        private GistUpdate _model;\n        public Action<Gist> Created;\n        private Gist _originalGist;\n\n        public GistEditViewController(Gist gist)\n            : base(UITableViewStyle.Grouped, true)\n        {\n            Title = \"Edit Gist\";\n            _originalGist = gist;\n\n            _model = new GistUpdate();\n            _model.Description = gist.Description;\n\n            if (gist.Files != null)\n                foreach (var f in gist.Files)\n                    _model.Files.Add(f.Key, new GistFileUpdate { Content = f.Value.Content });\n        }\n\n        private void Discard()\n        {\n            DismissViewController(true, null);\n        }\n\n        private async Task Save()\n        {\n            if (_model.Files.Count(x => x.Value != null) == 0)\n            {\n                AlertDialogService.ShowAlert(\"No Files\", \"You cannot modify a Gist without atleast one file\");\n                return;\n            }\n\n            var app = MvvmCross.Platform.Mvx.Resolve<Core.Services.IApplicationService>();\n            var hud = this.CreateHud();\n            NetworkActivity.PushNetworkActive();\n\n            try\n            {\n                hud.Show(\"Saving...\");\n                var newGist = await app.GitHubClient.Gist.Edit(_originalGist.Id, _model);\n                Created?.Invoke(newGist);\n                DismissViewController(true, null);\n            }\n            catch (Exception e)\n            {\n                AlertDialogService.ShowAlert(\"Error\", \"Unable to save gist: \" + e.Message);\n            }\n            finally\n            {\n                hud.Hide();\n                NetworkActivity.PopNetworkActive();\n            }\n        }\n\n        private bool IsDuplicateName(string name)\n        {\n            if (_model.Files.Count(x => x.Key.Equals(name) && x.Value != null) > 0)\n                return true;\n            return _model.Files.Count(x => x.Value != null && name.Equals(x.Value.NewFileName)) > 0;\n        }\n\n        int _gistFileCounter = 0;\n        private string GenerateName()\n        {\n            var name = string.Empty;\n            //Keep trying until we get a valid filename\n            while (true)\n            {\n                name = \"gistfile\" + (++_gistFileCounter) + \".txt\";\n                if (IsDuplicateName(name))\n                    continue;\n                break;\n            }\n            return name;\n        }\n\n        private void AddFile()\n        {\n            var createController = new GistFileAddViewController();\n            createController.SaveCommand.Subscribe(_ => NavigationController.PopToViewController(this, true));\n            createController.Save = (name, content) => {\n                if (string.IsNullOrEmpty(name))\n                    name = GenerateName();\n\n                if (IsDuplicateName(name))\n                    throw new InvalidOperationException(\"A filename by that type already exists\");\n                _model.Files[name] = new GistFileUpdate { Content = content };\n            };\n            NavigationController.PushViewController(createController, true);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.RowHeight = UITableView.AutomaticDimension;\n            TableView.EstimatedRowHeight = 44f;\n\n            var cancelButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n            NavigationItem.LeftBarButtonItem = cancelButton;\n            NavigationItem.RightBarButtonItem = saveButton;\n\n            OnActivation(d =>\n            {\n                d(cancelButton.GetClickedObservable().Subscribe(_ => Discard()));\n                d(saveButton.GetClickedObservable().Subscribe(_ => Save().ToBackground()));\n                d(_descriptionElement.Clicked.Subscribe(_ => ChangeDescription()));\n                d(_addFileElement.Clicked.Subscribe(_ => AddFile()));\n            });\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            UpdateView();\n        }\n\n        private readonly MultilinedElement _descriptionElement = new MultilinedElement(\"Description\");\n        private readonly StringElement _addFileElement = new StringElement(\"Add New File\");\n\n        protected void UpdateView()\n        {\n            ICollection<Section> sections = new LinkedList<Section>();\n            var section = new Section();\n            sections.Add(section);\n\n            _descriptionElement.Details = _model.Description;\n            section.Add(_descriptionElement);\n\n            var fileSection = new Section();\n            sections.Add(fileSection);\n\n            foreach (var file in _model.Files.Keys)\n            {\n                var key = file;\n                if (!_model.Files.ContainsKey(key) || _model.Files[file] == null || _model.Files[file].Content == null)\n                    continue;\n\n                var elName = key;\n                if (_model.Files[key].NewFileName != null)\n                    elName = _model.Files[key].NewFileName;\n\n                var el = new FileElement(elName, key, _model.Files[key]);\n                el.Clicked.Subscribe(MakeCallback(this, key));\n                fileSection.Add(el);\n            }\n\n            fileSection.Add(_addFileElement);\n            Root.Reset(sections);\n        }\n\n        private static Action<object> MakeCallback(GistEditViewController ctrl, string key)\n        {\n            var weakCtrl = new WeakReference<GistEditViewController>(ctrl);\n            return new Action<object>(_ =>\n            {\n                var model = weakCtrl.Get()?._model;\n                if (model == null || !model.Files.ContainsKey(key))\n                    return;\n\n                var originalGist = weakCtrl.Get()?._originalGist;\n\n                var createController = new GistFileEditViewController { Filename = key, Content = model.Files[key].Content };\n                createController.SaveCommand.Subscribe(__ => weakCtrl.Get()?.NavigationController.PopToViewController(weakCtrl.Get(), true));\n                createController.Save = (name, content) =>\n                {\n                    if (string.IsNullOrEmpty(name))\n                        throw new InvalidOperationException(\"Please enter a name for the file\");\n\n                    //If different name & exists somewhere else\n                    if (!name.Equals(key))\n                    if (weakCtrl.Get()?.IsDuplicateName(name) == true)\n                        throw new InvalidOperationException(\"A filename by that type already exists\");\n\n                    if (originalGist?.Files.ContainsKey(key) == true)\n                        model.Files[key] = new GistFileUpdate { Content = content, NewFileName = name };\n                    else\n                    {\n                        model.Files.Remove(key);\n                        model.Files[name] = new GistFileUpdate { Content = content };\n                    }\n                };\n\n                weakCtrl.Get()?.NavigationController.PushViewController(createController, true);\n            });\n        }\n\n        private void ChangeDescription()\n        {\n            var composer = new Composer\n            {\n                Title = \"Description\",\n                Text = _model.Description\n            };\n\n            composer.PresentAsModal(this, text =>\n            {\n                _model.Description = text;\n                this.DismissViewController(true, null);\n            });\n        }\n\n        public override DialogViewController.Source CreateSizingSource()\n        {\n            return new EditSource(this);\n        }\n\n        private void Delete(Element element, Section section)\n        {\n            var fileEl = element as FileElement;\n            if (fileEl == null)\n                return;\n\n            var key = fileEl.Key;\n            if (_originalGist.Files.ContainsKey(key))\n                _model.Files[key] = null;\n            else\n                _model.Files.Remove(key);\n\n            section.Remove(element);\n        }\n\n        private class FileElement : StringElement\n        {\n            public readonly GistFileUpdate File;\n            public readonly string Key;\n            public FileElement(string name, string key, GistFileUpdate file)\n                : base(name, String.Empty, UITableViewCellStyle.Subtitle)\n            {\n                File = file;\n                Key = key;\n                if (file.Content != null)\n                    Value = System.Text.Encoding.UTF8.GetByteCount(file.Content) + \" bytes\";\n            }\n        }\n\n        private class EditSource : Source\n        {\n            public EditSource(GistEditViewController dvc) \n                : base (dvc)\n            {\n            }\n\n            public override bool CanEditRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                return (indexPath.Section == 1 && indexPath.Row != ((Root?[1].Count ?? 0) - 1));\n            }\n\n            public override UITableViewCellEditingStyle EditingStyleForRow(UITableView tableView, Foundation.NSIndexPath indexPath)\n            {\n                if (indexPath.Section == 1 && indexPath.Row != ((Root?[1].Count ?? 0) - 1))\n                    return UITableViewCellEditingStyle.Delete;\n                return UITableViewCellEditingStyle.None;\n            }\n\n            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)\n            {\n                switch (editingStyle)\n                {\n                    case UITableViewCellEditingStyle.Delete:\n                        var section = Root?[indexPath.Section];\n                        var element = section?[indexPath.Row];\n                        (Container as GistEditViewController)?.Delete(element, section);\n                        break;\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistFileModifyViewController.cs",
    "content": "﻿using System;\nusing CodeHub.iOS.DialogElements;\nusing ReactiveUI;\nusing UIKit;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Services;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.iOS.ViewControllers.Gists\n{\n    public class GistFileEditViewController :  GistFileModifyViewController\n    {\n    }\n\n    public class GistFileAddViewController : GistFileModifyViewController\n    {\n    }\n\n    public abstract class GistFileModifyViewController : DialogViewController\n    {\n        public Action<string, string> Save;\n\n        private string _filename;\n        public string Filename\n        {\n            get { return _filename; }\n            set { this.RaiseAndSetIfChanged(ref _filename, value); }\n        }\n\n        private string _content;\n        public string Content\n        {\n            get { return _content; }\n            set { this.RaiseAndSetIfChanged(ref _content, value); }\n        }\n\n        public ReactiveCommand<Unit, Unit> SaveCommand { get; }\n\n        protected GistFileModifyViewController()\n            : base(UITableViewStyle.Plain)\n        {\n            SaveCommand = ReactiveCommand.CreateFromTask(t => {\n                if (String.IsNullOrEmpty(Content))\n                    throw new Exception(\"You cannot save a file without content!\");\n                Save?.Invoke(Filename, Content);\n                return Task.FromResult(Unit.Default);\n            });\n\n            SaveCommand.ThrownExceptions.Subscribe(x => AlertDialogService.ShowAlert(\"Error\", x.Message));\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n   \n            var titleElement = new DummyInputElement(\"Title\") { SpellChecking = false };\n            var contentElement = new ExpandingInputElement(\"Content\");\n\n            Root.Add(new Section { titleElement, contentElement });\n            TableView.TableFooterView = new UIView();\n\n            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n            NavigationItem.RightBarButtonItem = saveButton;\n\n            OnActivation(d =>\n            {\n                d(this.Bind(x => x.Filename, true).Subscribe(x =>\n                {\n                    Title = string.IsNullOrEmpty(x) ? \"Gist File\" : x;\n                    titleElement.Value = x;\n                }));\n\n                d(titleElement.Changed.Subscribe(x => Filename = x));\n\n                d(this.Bind(x => x.Content, true).Subscribe(x => contentElement.Value = x));\n\n                d(contentElement.Changed.Subscribe(x => Content = x));\n\n                d(SaveCommand.Subscribe(_ => ResignFirstResponder()));\n\n                d(saveButton.GetClickedObservable()\n                  .Select(_ => Unit.Default)\n                  .InvokeReactiveCommand(SaveCommand));\n\n                d(SaveCommand.IsExecuting\n                  .Subscribe(x => saveButton.Enabled = !x));\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistFileViewController.cs",
    "content": "using System;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.Services;\nusing CodeHub.WebViews;\nusing Foundation;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Gists\n{\n    public class GistFileViewController : BaseWebViewController\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly IAlertDialogService _alertDialogService;\n        private readonly string _gistId;\n        private readonly string _filename;\n\n        private Octokit.Gist _gist;\n        public Octokit.Gist Gist\n        {\n            get { return _gist; }\n            set { this.RaiseAndSetIfChanged(ref _gist, value); }\n        }\n\n        private string _contentSavePath;\n        public string ContentSavePath\n        {\n            get { return _contentSavePath; }\n            set { this.RaiseAndSetIfChanged(ref _contentSavePath, value); }\n        }\n\n        public GistFileViewController(\n            string gistId,\n            string filename,\n            Octokit.Gist gist = null,\n            IApplicationService applicationService = null,\n            IAlertDialogService alertDialogService = null,\n            IMessageService messageService = null)\n            : base(false)\n        {\n            _gistId = gistId;\n            _filename = filename;\n            _gist = gist;\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\n            messageService = messageService ?? Locator.Current.GetService<IMessageService>();\n\n            Title = System.IO.Path.GetFileName(filename);\n\n            var actionButton = new UIBarButtonItem(UIBarButtonSystemItem.Action) { Enabled = false };\n            NavigationItem.RightBarButtonItem = actionButton;\n\n            var loadCommand = ReactiveCommand.CreateFromTask(Load);\n\n            loadCommand\n                .ThrownExceptions\n                .Select(HandleLoadError)\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            this.OnActivation(d =>\n            {\n                d(this.WhenAnyValue(x => x.Gist)\n                  .Select(x => x != null)\n                  .Subscribe(x => actionButton.Enabled = x));\n\n                d(actionButton\n                  .GetClickedObservable()\n                  .Subscribe(CreateActionSheet));\n\n                d(loadCommand\n                  .IsExecuting\n                  .Subscribe(x => actionButton.Enabled = !x));\n            });\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(loadCommand);\n        }\n\n        private UserError HandleLoadError(Exception error)\n        {\n            LoadContent(\"\");\n            return new UserError(\"Unable to load selected file.\", error);\n        }\n\n        private async Task Load()\n        {\n            if (Gist == null)\n                Gist = await _applicationService.GitHubClient.Gist.Get(_gistId);\n\n            if (!Gist.Files.ContainsKey(_filename))\n                throw new Exception($\"This gist does not have a file named {_filename}.\");\n\n            var file = Gist.Files[_filename];\n            var isMarkdown = string.Equals(file.Language, \"Markdown\");\n\n            var filepath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), _filename);\n            System.IO.File.WriteAllText(filepath, file.Content, System.Text.Encoding.UTF8);\n            ContentSavePath = filepath;\n            await LoadSource(new Uri(\"file://\" + filepath), isMarkdown);\n        }\n\n        async Task LoadSource(Uri fileUri, bool isMarkdown)\n        {\n            var fontSize = (int)UIFont.PreferredSubheadline.PointSize;\n            var content = await Task.Run(() => System.IO.File.ReadAllText(fileUri.LocalPath, System.Text.Encoding.UTF8));\n            await LoadSource(content, fileUri.LocalPath, isMarkdown);\n        }\n\n        async Task LoadSource(string content, string filename, bool isMarkdown)\n        {\n            var fontSize = (int)UIFont.PreferredSubheadline.PointSize;\n\n            if (isMarkdown)\n            {\n                var markdownContent = await _applicationService.Client.Markdown.GetMarkdown(content);\n                var model = new MarkdownModel(markdownContent, fontSize);\n                var htmlContent = new MarkdownWebView { Model = model };\n                LoadContent(htmlContent.GenerateString());\n            }\n            else\n            {\n                var zoom = UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Phone;\n                var theme = _applicationService.Account.CodeEditTheme;\n                var model = new SyntaxHighlighterModel(content, theme, fontSize, zoom, file: filename);\n                var contentView = new SyntaxHighlighterWebView { Model = model };\n                LoadContent(contentView.GenerateString());\n            }\n        }\n\n        private void PresentOpenIn(UIBarButtonItem barButtonItem)\n        {\n            if (ContentSavePath == null)\n                return;\n\n            var ctrl = new UIDocumentInteractionController();\n            ctrl.Url = NSUrl.FromFilename(ContentSavePath);\n            ctrl.PresentOpenInMenu(barButtonItem, true);\n        }\n\n        private void Share(UIBarButtonItem barButtonItem)\n        {\n            var url = Gist?.HtmlUrl;\n            if (url == null)\n                return;\n\n            AlertDialogService.Share(\n                Title,\n                url: Gist?.HtmlUrl,\n                barButtonItem: barButtonItem);\n        }\n\n        private void ShowInBrowser()\n        {\n            var url = Gist?.HtmlUrl;\n            if (url == null)\n                return;\n\n            var viewController = new WebBrowserViewController(url);\n            PresentViewController(viewController, true, null);\n        }\n\n        private void CreateActionSheet(UIBarButtonItem barButtonItem)\n        {\n            var sheet = new UIActionSheet();\n            sheet.Dismissed += (sender, e) => sheet.Dispose();\n\n            var openButton = ContentSavePath != null ? sheet.AddButton(\"Open In\") : -1;\n            var shareButton = Gist?.HtmlUrl != null ? sheet.AddButton(\"Share\") : -1;\n            var showButton = Gist?.HtmlUrl != null ? sheet.AddButton(\"Show in GitHub\") : -1;\n            var cancelButton = sheet.AddButton(\"Cancel\");\n\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (sender, e) => BeginInvokeOnMainThread(() => {\n                try\n                {\n                    if (e.ButtonIndex == openButton)\n                        PresentOpenIn(barButtonItem);\n                    else if (e.ButtonIndex == shareButton)\n                        Share(barButtonItem);\n                    else if (e.ButtonIndex == showButton)\n                        ShowInBrowser();\n                }\n                catch\n                {\n                }\n            });\n\n            sheet.ShowFrom(barButtonItem, true);\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistViewController.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.Gists;\nusing UIKit;\nusing CodeHub.iOS.Utilities;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.Core.Services;\nusing MvvmCross.Platform;\nusing System.Collections.Generic;\nusing CodeHub.iOS.Services;\nusing System.Reactive.Linq;\nusing ReactiveUI;\nusing Octokit;\nusing Humanizer;\n\nnamespace CodeHub.iOS.ViewControllers.Gists\n{\n    public class GistViewController : PrettyDialogViewController\n    {\n        private SplitViewElement _splitRow1, _splitRow2;\n        private StringElement _ownerElement;\n        private SplitButtonElement _split;\n        private readonly IAlertDialogService _alertDialogService = Mvx.Resolve<IAlertDialogService>();\n\n        public new GistViewModel ViewModel\n        {\n            get { return (GistViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        public static GistViewController FromGist(Gist gist)\n        {\n            return new GistViewController\n            {\n                ViewModel = GistViewModel.FromGist(gist)\n            };\n        }\n\n        public GistViewController()\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Title = \"Gist\";\n\n            var editButton = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action);\n\n            HeaderView.SetImage(null, Images.Avatar);\n            HeaderView.Text = \"Gist #\" + ViewModel.Id;\n            HeaderView.SubImageView.TintColor = UIColor.FromRGB(243, 156, 18);\n\n            Appeared.Take(1)\n                .Select(_ => Observable.Timer(TimeSpan.FromSeconds(0.35f)).Take(1))\n                .Switch()\n                .Select(_ => ViewModel.Bind(x => x.IsStarred, true))\n                .Switch()\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Subscribe(x => HeaderView.SetSubImage(x ? Octicon.Star.ToImage() : null));\n\n            TableView.RowHeight = UITableView.AutomaticDimension;\n            TableView.EstimatedRowHeight = 44f;\n\n            _split = new SplitButtonElement();\n            var files = _split.AddButton(\"Files\", \"-\");\n            var comments = _split.AddButton(\"Comments\", \"-\");\n            var forks = _split.AddButton(\"Forks\", \"-\");\n\n            _splitRow1 = new SplitViewElement(Octicon.Lock.ToImage(), Octicon.Package.ToImage());\n            _splitRow2 = new SplitViewElement(Octicon.Calendar.ToImage(), Octicon.Star.ToImage());\n            _ownerElement = new StringElement(\"Owner\", string.Empty, UITableViewCellStyle.Value1) { \n                Image = Octicon.Person.ToImage(),\n                Accessory = UITableViewCellAccessory.DisclosureIndicator\n            };\n\n            OnActivation(d =>\n            {\n                d(editButton.GetClickedObservable().Subscribe(ShareButtonTap));\n                d(_ownerElement.Clicked.BindCommand(ViewModel.GoToUserCommand));\n\n                d(ViewModel.Bind(x => x.IsStarred, true).Subscribe(isStarred => _splitRow2.Button2.Text = isStarred ? \"Starred\" : \"Not Starred\"));\n\n                d(ViewModel.BindCollection(x => x.Comments, true).Subscribe(_ => RenderGist()));\n                d(HeaderView.Clicked.BindCommand(ViewModel.GoToUserCommand));\n\n                d(ViewModel.Bind(x => x.Gist, true).Where(x => x != null).Subscribe(gist =>\n                {\n                    var daysOld = gist.CreatedAt.TotalDaysAgo();\n\n                    _splitRow1.Button1.Text = gist.Public ? \"Public\" : \"Private\";\n                    _splitRow1.Button2.Text = (gist.History?.Count ?? 0) + \" Revisions\";\n                    _splitRow2.Button1.Text = daysOld == 0 ? \"Created today\" : \"day\".ToQuantity(daysOld) + \" old\";\n                    _ownerElement.Value = gist.Owner?.Login ?? \"Unknown\";\n                    files.Text = gist.Files?.Count.ToString() ?? \"-\";\n                    comments.Text = gist.Comments.ToString();\n                    forks.Text = gist.Forks?.Count.ToString() ?? \"-\";\n                    HeaderView.SubText = gist.Description;\n                    HeaderView.Text = gist.Files?.Select(x => x.Key).FirstOrDefault() ?? HeaderView.Text;\n                    HeaderView.SetImage(gist.Owner?.AvatarUrl, Images.Avatar);\n                    RenderGist();\n                    RefreshHeaderView();\n                }));\n            });\n        }\n\n        public void RenderGist()\n        {\n            if (ViewModel.Gist == null) return;\n            var model = ViewModel.Gist;\n\n            ICollection<Section> sections = new LinkedList<Section>();\n            sections.Add(new Section { _split });\n            sections.Add(new Section { _splitRow1, _splitRow2, _ownerElement });\n            var sec2 = new Section();\n            sections.Add(sec2);\n\n            var weakVm = new WeakReference<GistViewModel>(ViewModel);\n            foreach (var file in model.Files.Keys)\n            {\n                var sse = new ButtonElement(file, Octicon.FileCode.ToImage())\n                { \n                    LineBreakMode = UILineBreakMode.TailTruncation,\n                };\n\n                var fileSaved = file;\n                var gistFileModel = model.Files[fileSaved];\n                sse.Clicked.Subscribe(_ => GoToGist(gistFileModel));\n                sec2.Add(sse);\n            }\n\n            if (ViewModel.Comments.Items.Count > 0)\n            {\n                var sec3 = new Section(\"Comments\");\n                sec3.AddAll(ViewModel.Comments.Select(x => new CommentElement(x.User?.Login ?? \"Anonymous\", x.Body, x.CreatedAt, x.User?.AvatarUrl)));\n                sections.Add(sec3);\n            }\n\n            Root.Reset(sections);\n        }\n\n        private void GoToGist(GistFile model)\n        {\n            var viewCtrl = new GistFileViewController(\n                ViewModel.Gist.Id,\n                model.Filename,\n                ViewModel.Gist);\n\n            this.PushViewController(viewCtrl);\n        }\n\n        private async Task Fork()\n        {\n            try\n            {\n                await this.DoWorkAsync(\"Forking...\", ViewModel.ForkGist);\n            }\n            catch (Exception ex)\n            {\n                _alertDialogService.Alert(\"Error\", ex.Message).ToBackground();\n            }\n        }\n\n        private async Task Compose()\n        {\n            try\n            {\n                var app = Mvx.Resolve<IApplicationService>();\n                var data = await this.DoWorkAsync(\"Loading...\", () => app.GitHubClient.Gist.Get(ViewModel.Id));\n                var gistController = new GistEditViewController(data);\n                gistController.Created = editedGist => ViewModel.Gist = editedGist;\n                var navController = new UINavigationController(gistController);\n                PresentViewController(navController, true, null);\n            }\n            catch (Exception ex)\n            {\n                _alertDialogService.Alert(\"Error\", ex.Message).ToBackground();\n            }\n        }\n\n        void ShareButtonTap (object sender)\n        {\n            if (ViewModel.Gist == null)\n                return;\n\n            var app = Mvx.Resolve<IApplicationService>();\n            var isOwner = string.Equals(app.Account.Username, ViewModel.Gist?.Owner?.Login, StringComparison.OrdinalIgnoreCase);\n            var gist = ViewModel.Gist;\n\n            var sheet = new UIActionSheet();\n            var editButton = sheet.AddButton(isOwner ? \"Edit\" : \"Fork\");\n            var starButton = sheet.AddButton(ViewModel.IsStarred ? \"Unstar\" : \"Star\");\n            var shareButton = sheet.AddButton(\"Share\");\n            var showButton = sheet.AddButton(\"Show in GitHub\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.DismissWithClickedButtonIndex(cancelButton, true);\n            sheet.Dismissed += (s, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    try\n                    {\n                        if (e.ButtonIndex == shareButton)\n                        {\n                            AlertDialogService.Share(\n                                $\"Gist {gist.Files?.Select(x => x.Key).FirstOrDefault() ?? gist.Id}\",\n                                gist.Description,\n                                gist.HtmlUrl,\n                                sender as UIBarButtonItem);\n                        }\n                        else if (e.ButtonIndex == showButton)\n                            ViewModel.GoToHtmlUrlCommand.Execute(null);\n                        else if (e.ButtonIndex == starButton)\n                            ViewModel.ToggleStarCommand.Execute(null);\n                        else if (e.ButtonIndex == editButton)\n                            Compose().ToBackground();\n                    }\n                    catch\n                    {\n                    }\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowFromToolbar(NavigationController.Toolbar);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Gists/GistsViewController.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing CoreGraphics;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.Core.ViewModels.Gists;\nusing System.Reactive;\nusing Splat;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.iOS.ViewControllers.Gists\n{\n    public class GistsViewController : TableViewController\n    {\n        private readonly Lazy<UISearchBar> _repositorySearchBar\n            = new Lazy<UIKit.UISearchBar>(() => new UISearchBar(new CGRect(0, 0, 320, 44)));\n\n        private readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n\n        private readonly Lazy<UIView> emptyView = new Lazy<UIView>((() =>\n            new EmptyListView(Octicon.Gist.ToEmptyListImage(), \"There are no gists.\")));\n\n        public GistsViewModel ViewModel { get; }\n\n        public static GistsViewController CreatePublicGistsViewController()\n        {\n            var viewModel = GistsViewModel.CreatePublicGistsViewModel();\n            return new GistsViewController(viewModel)\n            {\n                Title = \"Public Gists\",\n                ShowSearchBar = false\n            };\n        }\n\n        public static GistsViewController CreateStarredGistsViewController()\n        {\n            var viewModel = GistsViewModel.CreateStarredGistsViewModel();\n            return new GistsViewController(viewModel) { Title = \"Starred Gists\" };\n        }\n\n        public static GistsViewController CreateUserGistsViewController(string username)\n        {\n            var applicationService = Locator.Current.GetService<IApplicationService>();\n            var mine = applicationService.Account.Username.ToLower().Equals(username.ToLower());\n\n            if (mine)\n            {\n                var viewModel = new CurrentUserGistsViewModel(username);\n                var vc = new GistsViewController(viewModel) { Title = \"My Gists\" };\n\n                var button = new UIBarButtonItem(UIBarButtonSystemItem.Add);\n                vc.NavigationItem.RightBarButtonItem = button;\n                vc.WhenActivated(d =>\n                {\n                    d(button.GetClickedObservable()\n                      .Subscribe(_ => GistCreateViewController.Show(vc)));\n                });\n\n                return vc;\n            }\n            else\n            {\n                var viewModel = GistsViewModel.CreateUserGistsViewModel(username);\n                var vc = new GistsViewController(viewModel) { Title = $\"{username}'s Gists\" };\n                return vc;\n            }\n        }\n\n        public bool ShowSearchBar { get; private set; } = true;\n\n        public GistsViewController(GistsViewModel viewModel)\n            : base(UITableViewStyle.Plain)\n        {\n            ViewModel = viewModel;\n            Title = \"Gists\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var tableViewSource = new GistTableViewSource(TableView, ViewModel.Items);\n            TableView.Source = tableViewSource;\n\n            Appearing\n                .Take(1)\n                .Select(_ => ViewModel.LoadCommand.Execute())\n                .Switch()\n                .Take(1)\n                .Catch(Observable.Return(false))\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Subscribe(SetItemsPresent);\n\n            this.WhenActivated(d =>\n            {\n                if (ShowSearchBar) {\n                    d(_repositorySearchBar.Value.GetChangedObservable()\n                        .Subscribe(x => ViewModel.SearchText = x));\n                }\n\n                d(ViewModel.ItemSelected\n                  .Select(x => GistViewController.FromGist(x.Gist))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.WhenAnyValue(x => x.HasMore)\n                  .Subscribe(x => TableView.TableFooterView = x ? _loading : null));\n\n                d(tableViewSource.RequestMore\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand\n                  .Select(_ => ViewModel.Items.Changed)\n                  .Switch()\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand.Merge(ViewModel.LoadMoreCommand)\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n            });\n        }\n\n        private void SetItemsPresent(bool hasItems)\n        {\n            if (ShowSearchBar)\n                TableView.TableHeaderView = hasItems ? _repositorySearchBar.Value : null;\n\n            TableView.SeparatorStyle = hasItems\n                ? UITableViewCellSeparatorStyle.SingleLine\n                : UITableViewCellSeparatorStyle.None;\n\n            if (hasItems)\n            {\n                TableView.BackgroundView = null;\n            }\n            else\n            {\n                emptyView.Value.Alpha = 0;\n                TableView.BackgroundView = emptyView.Value;\n                UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                               () => emptyView.Value.Alpha = 1, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/MarkdownComposerViewController.cs",
    "content": "using System;\nusing UIKit;\nusing CodeHub.Core.Services;\nusing Foundation;\nusing CodeHub.WebViews;\nusing WebKit;\nusing CodeHub.iOS.Views;\nusing ReactiveUI;\nusing System.Threading.Tasks;\nusing Splat;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class MarkdownComposerViewController : Composer\n    {\n        private readonly UISegmentedControl _viewSegment;\n        private readonly IMarkdownService _markdownService;\n        private WKWebView _previewView;\n\n        public MarkdownComposerViewController(IMarkdownService markdownService = null)\n        {\n            _markdownService = markdownService ?? Locator.Current.GetService<IMarkdownService>();\n\n            _viewSegment = new UISegmentedControl(new[] { \"Compose\", \"Preview\" })\n            {\n                SelectedSegment = 0\n            };\n\n            NavigationItem.TitleView = _viewSegment;\n\n            TextView.InputAccessoryView = new MarkdownAccessoryView(TextView);\n\n            this.WhenActivated(d =>\n            {\n                d(_viewSegment.GetChangedObservable()\n                  .Subscribe(_ => SegmentValueChanged()));\n            });\n        }\n\n        void SegmentValueChanged()\n        {\n            if (_viewSegment.SelectedSegment == 0)\n            {\n                if (_previewView != null)\n                {\n                    _previewView.RemoveFromSuperview();\n                    _previewView.Dispose();\n                    _previewView = null;\n                }\n\n                Add(TextView);\n                TextView.BecomeFirstResponder();\n            }\n            else\n            {\n                if (_previewView == null)\n                    _previewView = new WKWebView(this.View.Bounds, new WKWebViewConfiguration());\n\n                TextView.RemoveFromSuperview();\n                Add(_previewView);\n\n                LoadPreview(_previewView).ToBackground();\n            }\n        }\n\n        private async Task LoadPreview(WKWebView previewView)\n        {\n            var markdownText = await _markdownService.Convert(Text);\n            var model = new MarkdownModel(markdownText, (int)UIFont.PreferredSubheadline.PointSize);\n            var view = new MarkdownWebView { Model = model }.GenerateString();\n            previewView.LoadHtmlString(view, NSBundle.MainBundle.BundleUrl);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/MessageComposerViewController.cs",
    "content": "﻿using CoreGraphics;\nusing Foundation;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.Views;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class MessageComposerViewController : BaseViewController, IActivatable\n    {\n        private CGRect _keyboardBounds = CGRect.Empty;\n        private NSObject _keyboardHideObserver;\n        private NSObject _keyboardShowObserver;\n\n        public ExtendedUITextView TextView { get; }\n\n        public MessageComposerViewController()\n        {\n            EdgesForExtendedLayout = UIRectEdge.None;\n            TextView = new ExtendedUITextView();\n            TextView.Font = UIFont.PreferredBody;\n\n            // Work around an Apple bug in the UITextView that crashes\n            if (ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.SIMULATOR)\n                TextView.AutocorrectionType = UITextAutocorrectionType.No;\n\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = string.Empty };\n        }\n\n        public string Text\n        {\n            get { return TextView.Text; }\n            set\n            {\n                if (string.Equals(Text, value))\n                    return;\n\n                TextView.Text = value;\n                TextView.SelectedRange = new NSRange(0, 0);\n            }\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            View.BackgroundColor = UIColor.White;\n        }\n\n        public override void ViewDidLayoutSubviews()\n        {\n            base.ViewDidLayoutSubviews();\n            ResizeTextView();\n        }\n\n        void KeyboardWillShow (NSNotification notification)\n        {\n            var nsValue = notification.UserInfo.ObjectForKey (UIKeyboard.BoundsUserInfoKey) as NSValue;\n            if (nsValue == null) return;\n            _keyboardBounds = nsValue.RectangleFValue;\n            UIView.Animate(0.25f, 0, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseIn, ResizeTextView, null);\n        }\n\n        void KeyboardWillHide (NSNotification notification)\n        {\n            _keyboardBounds = CGRect.Empty;\n            UIView.Animate(0.2, 0, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseIn, ResizeTextView, null);\n        }\n\n        private void ResizeTextView()\n        {\n            TextView.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height - _keyboardBounds.Height);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            _keyboardShowObserver = NSNotificationCenter.DefaultCenter.AddObserver(new NSString(\"UIKeyboardWillShowNotification\"), KeyboardWillShow);\n            _keyboardHideObserver = NSNotificationCenter.DefaultCenter.AddObserver(new NSString(\"UIKeyboardWillHideNotification\"), KeyboardWillHide);\n            ResizeTextView();\n            Add(TextView);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            TextView.ResignFirstResponder();\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardHideObserver);\n            NSNotificationCenter.DefaultCenter.RemoveObserver(_keyboardShowObserver);\n            TextView.RemoveFromSuperview();\n        }\n\n        public override void ViewDidAppear(bool animated)\n        {\n            base.ViewDidAppear(animated);\n            TextView.BecomeFirstResponder();\n        }\n\n        private static float CalculateHeight(UIInterfaceOrientation orientation)\n        {\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\n                return 44;\n            if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown)\n                return 64;\n            return 88f;\n        }\n\n        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)\n        {\n            base.WillRotate(toInterfaceOrientation, duration);\n\n            if (TextView.InputAccessoryView != null)\n            {\n                UIView.Animate(duration, 0, UIViewAnimationOptions.BeginFromCurrentState, () =>\n                {\n                    var frame = TextView.InputAccessoryView.Frame;\n                    frame.Height = CalculateHeight(toInterfaceOrientation);\n                    TextView.InputAccessoryView.Frame = frame;\n                }, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/MultipleChoiceViewController.cs",
    "content": "using System;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing UIKit;\r\nusing CodeHub.iOS.DialogElements;\r\nusing System.Linq;\r\n\r\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class MultipleChoiceViewController : DialogViewController\n    {\n        private readonly object _obj;\n        \n        protected void OnValueSelected(System.Reflection.PropertyInfo field)\n        {\n            var r = Root[0].Elements.OfType<StringElement>().FirstOrDefault(x => x.Caption.Equals(field.Name));\n            if (r == null)\n                return;\n            var value = (bool)field.GetValue(_obj);\n            field.SetValue(_obj, !value);\n            r.Accessory = !value ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\n        }\n        \n        public MultipleChoiceViewController(string title, object obj)\n            : base (UITableViewStyle.Grouped)\n        {\n            _obj = obj;\n            Title = title;\n\n            var sec = new Section();\n            var fields = obj.GetType().GetProperties();\n            foreach (var s in fields)\n            {\n                var copy = s;\r\n                var accessory = (bool)s.GetValue(_obj) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\r\n                var e = new StringElement(s.Name) { Accessory = accessory };\r\n                e.Clicked.Subscribe(_ => OnValueSelected(copy));\n                sec.Add(e);\n            }\n            Root.Add(sec);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Organizations/OrganizationViewController.cs",
    "content": "using CodeHub.iOS.ViewControllers;\nusing CodeHub.Core.ViewModels.Organizations;\nusing UIKit;\nusing CoreGraphics;\nusing CodeHub.iOS.DialogElements;\nusing System;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.ViewControllers.Users;\nusing CodeHub.iOS.ViewControllers.Gists;\n\nnamespace CodeHub.iOS.ViewControllers.Organizations\n{\n    public class OrganizationViewController : PrettyDialogViewController\n    {\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var vm = (OrganizationViewModel) ViewModel;\n\n            HeaderView.SetImage(null, Images.Avatar);\n            Title = vm.Name;\n            HeaderView.Text = vm.Name;\n\n            var members = new StringElement(\"Members\", Octicon.Person.ToImage());\n            var teams = new StringElement(\"Teams\", Octicon.Organization.ToImage());\n            var followers = new StringElement(\"Followers\", Octicon.Heart.ToImage());\n            var events = new StringElement(\"Events\", Octicon.Rss.ToImage());\n            var repos = new StringElement(\"Repositories\", Octicon.Repo.ToImage());\n            var gists = new StringElement(\"Gists\", Octicon.Gist.ToImage());\n            Root.Reset(new Section(new UIView(new CGRect(0, 0, 0, 20f))) { members, teams }, new Section { events, followers }, new Section { repos, gists });\n\n            OnActivation(d =>\n            {\n                d(teams.Clicked.BindCommand(vm.GoToTeamsCommand));\n                d(events.Clicked.BindCommand(vm.GoToEventsCommand));\n\n                d(members.Clicked\n                  .Select(_ => UsersViewController.CreateOrganizationMembersViewController(vm.Name))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n                \n                d(followers.Clicked\n                  .Select(_ => UsersViewController.CreateFollowersViewController(vm.Name))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(repos.Clicked.Subscribe(_ => {\n                    var vc = Repositories.RepositoriesViewController.CreateOrganizationViewController(vm.Name);\n                    NavigationController?.PushViewController(vc, true);\n                }));\n\n                d(gists.Clicked\n                  .Select(x => GistsViewController.CreateUserGistsViewController(vm.Name))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(vm.Bind(x => x.Organization, true).Where(x => x != null).Subscribe(x =>\n                {\n                    HeaderView.SubText = string.IsNullOrWhiteSpace(x.Name) ? x.Login : x.Name;\n                    HeaderView.SetImage(x.AvatarUrl, Images.Avatar);\n                    RefreshHeaderView();\n                }));\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Organizations/OrganizationsViewController.cs",
    "content": "using CodeHub.Core.ViewModels.Organizations;\nusing CodeHub.iOS.DialogElements;\nusing System;\nusing UIKit;\nusing CodeHub.iOS.Views;\nusing CodeHub.Core.Utilities;\n\nnamespace CodeHub.iOS.ViewControllers.Organizations\n{\n    public class OrganizationsViewController : ViewModelCollectionDrivenDialogViewController\n    {\n        public OrganizationsViewController()\n        {\n            Title = \"Organizations\";\n            EmptyView = new Lazy<UIView>(() =>\n                new EmptyListView(Octicon.Organization.ToEmptyListImage(), \"There are no organizations.\"));\n        }\n\n        public OrganizationsViewController(string username) : this()\n        {\n            var viewModel = new OrganizationsViewModel();\n            viewModel.Init(new OrganizationsViewModel.NavObject { Username = username });\n            ViewModel = viewModel;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var vm = (OrganizationsViewModel) ViewModel;\n            var weakVm = new WeakReference<OrganizationsViewModel>(vm);\n            BindCollection(vm.Organizations, x =>\n            {\n                var avatar = new GitHubAvatar(x.AvatarUrl);\n                var e = new UserElement(x.Login, string.Empty, string.Empty, avatar);\n                e.Clicked.Subscribe(_ => weakVm.Get()?.GoToOrganizationCommand.Execute(x));\n                return e;\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Organizations/TeamsViewController.cs",
    "content": "﻿using System;\nusing CodeHub.Core.ViewModels.Organizations;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.ViewControllers.Users;\nusing CodeHub.iOS.Views;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Organizations\n{\n    public class TeamsViewController : ViewModelCollectionDrivenDialogViewController\n    {\n        public TeamsViewController()\n        {\n            Title = \"Teams\";\n            EmptyView = new Lazy<UIView>(() =>\n                new EmptyListView(Octicon.Organization.ToEmptyListImage(), \"There are no teams.\"));\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var vm = (TeamsViewModel)ViewModel;\n            var weakVm = new WeakReference<TeamsViewController>(this);\n\n            this.BindCollection(vm.Teams, x =>\n            {\n                var e = new StringElement(x.Name);\n                e.Clicked.Subscribe(_ => {\n                    var vc = UsersViewController.CreateTeamMembersViewController((int)x.Id);\n                    weakVm.Get()?.NavigationController.PushViewController(vc, true);\n                });\n                return e;\n            });\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/PullRequests/PullRequestDiffViewController.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.WebViews;\nusing Humanizer;\nusing Newtonsoft.Json;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\nusing WebKit;\n\nnamespace CodeHub.iOS.ViewControllers.PullRequests\n{\n    public class PullRequestDiffViewController : BaseWebViewController\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly INetworkActivityService _networkActivityService;\n        private readonly IMarkdownService _markdownService;\n        private readonly string _username;\n        private readonly string _repository;\n        private readonly int _pullRequestId;\n        private readonly string _path;\n        private readonly string _patch;\n        private readonly string _commit;\n\n        private readonly ReactiveList<Octokit.PullRequestReviewComment> _comments\n             = new ReactiveList<Octokit.PullRequestReviewComment>();\n\n        public PullRequestDiffViewController(\n            string username,\n            string repository,\n            int pullRequestId,\n            string path,\n            string patch,\n            string commit,\n            IApplicationService applicationService = null,\n            INetworkActivityService networkActivityService = null,\n            IMarkdownService markdownService = null)\n            : base(false)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _networkActivityService = networkActivityService ?? Locator.Current.GetService<INetworkActivityService>();\n            _markdownService = markdownService ?? Locator.Current.GetService<IMarkdownService>();\n            _username = username;\n            _repository = repository;\n            _pullRequestId = pullRequestId;\n            _path = path;\n            _patch = patch;\n            _commit = commit;\n\n            Title = string.IsNullOrEmpty(_path) ? \"Diff\" : System.IO.Path.GetFileName(_path);\n\n            var loadComments = ReactiveCommand.CreateFromTask(\n                _ => _applicationService.GitHubClient.PullRequest.ReviewComment.GetAll(_username, _repository, _pullRequestId));\n\n            loadComments\n                .ThrownExceptions\n                .Select(error => new UserError(\"Unable to load comments.\", error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            loadComments\n                .Subscribe(comments => _comments.Reset(comments));\n\n            var loadAll = ReactiveCommand.CreateCombined(new[] { loadComments });\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(loadAll);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Observable\n                .Return(Unit.Default)\n                .Merge(_comments.Changed.Select(_ => Unit.Default))\n                .Do(_ => Render().ToBackground())\n                .Subscribe();\n        }\n\n        private async Task Render()\n        {\n            var comments = new List<DiffCommentModel>();\n            foreach (var comment in _comments.Where(x => string.Equals(x.Path, _path)))\n            {\n                comments.Add(new DiffCommentModel\n                {\n                    Id = comment.Id,\n                    GroupId = comment.Id,\n                    Username = comment.User.Login,\n                    AvatarUrl = comment.User.AvatarUrl,\n                    LineTo = comment.Position,\n                    LineFrom = comment.Position,\n                    Body = await _markdownService.Convert(comment.Body),\n                    Date = comment.CreatedAt.Humanize()\n                });\n            }\n\n            var diffModel = new DiffModel(\n                _patch.Split('\\n'),\n                comments,\n                (int)UIFont.PreferredSubheadline.PointSize);\n\n            var diffView = new DiffWebView { Model = diffModel };\n            LoadContent(diffView.GenerateString());\n        }\n\n        private class JavascriptComment\n        {\n            public int PatchLine { get; set; }\n            public int FileLine { get; set; }\n        }\n\n        private class JavascriptReplyComment\n        {\n            public int Id { get; set; }\n        }\n\n        protected override bool ShouldStartLoad(WKWebView webView, WKNavigationAction navigationAction)\n        {\n            var url = navigationAction.Request.Url;\n            if (url.Scheme.Equals(\"app\"))\n            {\n                var func = url.Host;\n                if (func.Equals(\"comment\"))\n                {\n                    var commentModel = JsonConvert.DeserializeObject<JavascriptComment>(UrlDecode(url.Fragment));\n                    PromptForComment(commentModel);\n                }\n                else if (func.Equals(\"reply-to\"))\n                {\n                    var commentModel = JsonConvert.DeserializeObject<JavascriptReplyComment>(UrlDecode(url.Fragment));\n                    ShowReplyCommentComposer(commentModel.Id);\n                }\n\n                return false;\n            }\n\n            return base.ShouldStartLoad(webView, navigationAction);\n        }\n\n        private void PromptForComment(JavascriptComment model)\n        {\n            var title = \"Line \" + model.PatchLine;\n            var sheet = new UIActionSheet(title);\n            var addButton = sheet.AddButton(\"Add Comment\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (sender, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == addButton)\n                        ShowCommentComposer(model.FileLine);\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowInView(this.View);\n        }\n\n        private void ShowCommentComposer(int line)\n        {\n            ShowComposer(async text =>\n            {\n                var commentOptions = new Octokit.PullRequestReviewCommentCreate(text, _commit, _path, line);\n                var comment = await _applicationService.GitHubClient.PullRequest.ReviewComment.Create(\n                     _username, _repository, _pullRequestId, commentOptions);\n                _comments.Add(comment);\n            });\n        }\n\n        private void ShowReplyCommentComposer(int replyToId)\n        {\n            ShowComposer(async text =>\n            {\n                var commentOptions = new Octokit.PullRequestReviewCommentReplyCreate(text, replyToId);\n                var comment = await _applicationService.GitHubClient.PullRequest.ReviewComment.CreateReply(\n                     _username, _repository, _pullRequestId, commentOptions);\n                _comments.Add(comment);\n            });\n        }\n\n        private void ShowComposer(Func<string, Task> workFn)\n        {\n            var composer = new MarkdownComposerViewController();\n            composer.PresentAsModal(this, async text =>\n            {\n                var hud = composer.CreateHud();\n\n                using (UIApplication.SharedApplication.DisableInteraction())\n                using (_networkActivityService.ActivateNetwork())\n                using (hud.Activate(\"Commenting...\"))\n                {\n                    try\n                    {\n                        await workFn(text);\n                        composer.DismissViewController(true, null);\n                    }\n                    catch (Exception e)\n                    {\n                        AlertDialogService.ShowAlert(\"Unable to Comment\", e.Message);\n                    }\n                }\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/LanguagesViewController.cs",
    "content": "using System.Linq;\nusing UIKit;\nusing CodeHub.Core.Data;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive.Subjects;\nusing System;\nusing System.Reactive.Linq;\nusing Foundation;\nusing CodeHub.iOS.Utilities;\nusing System.Net;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    public class LanguagesViewController : DialogViewController\n    {\n        private readonly ISubject<Language> _languageSubject = new Subject<Language>();\n\n        public IObservable<Language> Language\n        {\n            get { return _languageSubject.AsObservable(); }\n        }\n\n        public Language SelectedLanguage { get; set; }\n\n        public LanguagesViewController()\n            : base(UITableViewStyle.Plain)\n        {\n            Title = \"Languages\";\n            EnableSearch = true;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            Load().ToBackground();\n        }\n\n        private async Task Load()\n        {\n            NetworkActivity.PushNetworkActive();\n\n            try\n            {\n                await LoadLanguages();\n            }\n            finally\n            {\n                NetworkActivity.PopNetworkActive();\n            }\n        }\n\n        private async Task LoadLanguages()\n        {\n            var lRepo = new LanguageRepository();\n            var langs = await lRepo.GetLanguages();\n\n            var sec = new Section();\n\n            langs.Insert(0, new Language(\"All Languages\", null));\n            sec.AddAll(langs.Select(x =>\n            {\n                var el = new StringElement(x.Name) { Accessory = UITableViewCellAccessory.None };\n                el.Clicked.Subscribe(_ => _languageSubject.OnNext(x));\n                return el;\n            }));\n\n            Root.Reset(sec);\n\n            if (SelectedLanguage != null)\n            {\n                var el = sec.Elements.OfType<StringElement>().FirstOrDefault(x => string.Equals(x.Caption, SelectedLanguage.Name));\n                if (el != null)\n                    el.Accessory = UITableViewCellAccessory.Checkmark;\n\n                var indexPath = el?.IndexPath;\n                if (indexPath != null)\n                    TableView.ScrollToRow(indexPath, UITableViewScrollPosition.Middle, false);\n            }\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/PrivateRepositoryViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing CodeHub.iOS.ViewControllers.Application;\nusing System.Reactive.Disposables;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    public partial class PrivateRepositoryViewController : BaseViewController\n    {\n        public PrivateRepositoryViewController() : base(\"PrivateRepositoryViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Button.BackgroundColor = UIColor.FromRGB(0x27, 0xae, 0x60);\n            Button.SetTitleColor(UIColor.White, UIControlState.Normal);\n            Button.Layer.CornerRadius = 6f;\n\n            OnActivation(d =>\n            {\n                d(Button.GetClickedObservable()\n                  .Subscribe(_ => UpgradeViewController.Present(this)));   \n            });\n        }\n    }\n\n    public static class PrivateRepositoryViewControllerExtensions\n    {\n        public static IDisposable ShowPrivateView(this UIViewController @this)\n        {\n            var vc = new PrivateRepositoryViewController();\n            vc.View.Frame = new CoreGraphics.CGRect(0, 0, @this.View.Bounds.Width, @this.View.Bounds.Height);\n            vc.View.AutoresizingMask = UIViewAutoresizing.All;\n\n            vc.View.Alpha = 0;\n            @this.View.Add(vc.View);\n            UIView.Animate(0.4, 0, UIViewAnimationOptions.CurveEaseIn, () => vc.View.Alpha = 1, null);\n            @this.AddChildViewController(vc);\n\n            vc.View.BackgroundColor = Theme.CurrentTheme.PrimaryColor;\n\n            if (@this.NavigationItem.RightBarButtonItem != null)\n                @this.NavigationItem.RightBarButtonItem.Enabled = false;\n\n            return Disposable.Create(() =>\n            {\n                vc.View.RemoveFromSuperview();\n                vc.RemoveFromParentViewController();\n            });\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/PrivateRepositoryViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    [Register (\"PrivateRepositoryViewController\")]\n    partial class PrivateRepositoryViewController\n    {\n        [Outlet]\n        UIKit.UIButton Button { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Description { get; set; }\n\n        [Outlet]\n        UIKit.UIImageView ImageView { get; set; }\n\n        [Outlet]\n        UIKit.UILabel Title { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (ImageView != null) {\n                ImageView.Dispose ();\n                ImageView = null;\n            }\n\n            if (Description != null) {\n                Description.Dispose ();\n                Description = null;\n            }\n\n            if (Button != null) {\n                Button.Dispose ();\n                Button = null;\n            }\n\n            if (Title != null) {\n                Title.Dispose ();\n                Title = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/PrivateRepositoryViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"PrivateRepositoryViewController\">\n            <connections>\n                <outlet property=\"Button\" destination=\"NqH-Hi-p4y\" id=\"blv-n2-AlS\"/>\n                <outlet property=\"Description\" destination=\"N07-18-8l1\" id=\"vce-vj-Rt0\"/>\n                <outlet property=\"ImageView\" destination=\"b9j-aA-s7h\" id=\"Her-Vm-Zz2\"/>\n                <outlet property=\"Title\" destination=\"IFp-WC-sJv\" id=\"kGC-di-71X\"/>\n                <outlet property=\"view\" destination=\"2\" id=\"RRd-Eg-VrN\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"2\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n            <subviews>\n                <scrollView clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"scaleToFill\" ambiguous=\"YES\" showsHorizontalScrollIndicator=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"R8Q-UR-00k\">\n                    <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                    <subviews>\n                        <view contentMode=\"scaleToFill\" misplaced=\"YES\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"d0P-2R-tXd\">\n                            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"454\"/>\n                            <subviews>\n                                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" image=\"CodeHubRound.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"b9j-aA-s7h\">\n                                    <rect key=\"frame\" x=\"210\" y=\"101\" width=\"180\" height=\"180\"/>\n                                    <constraints>\n                                        <constraint firstAttribute=\"width\" constant=\"180\" id=\"eZ8-fn-H4o\"/>\n                                        <constraint firstAttribute=\"height\" constant=\"180\" id=\"mjH-NF-HSz\"/>\n                                    </constraints>\n                                </imageView>\n                                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Go Pro!\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"30\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"IFp-WC-sJv\">\n                                    <rect key=\"frame\" x=\"10\" y=\"30\" width=\"580\" height=\"43\"/>\n                                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"36\"/>\n                                    <color key=\"textColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                                    <nil key=\"highlightedColor\"/>\n                                </label>\n                                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" horizontalCompressionResistancePriority=\"251\" verticalCompressionResistancePriority=\"1000\" misplaced=\"YES\" text=\"Private repositories are only available with CodeHub Pro. Click the button below for more details.\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"N07-18-8l1\">\n                                    <rect key=\"frame\" x=\"20\" y=\"319\" width=\"560\" height=\"56\"/>\n                                    <constraints>\n                                        <constraint firstAttribute=\"width\" constant=\"400\" id=\"66F-z2-11F\"/>\n                                        <constraint firstAttribute=\"width\" constant=\"400\" id=\"uiW-P3-O2a\"/>\n                                    </constraints>\n                                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"16\"/>\n                                    <color key=\"textColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                                    <nil key=\"highlightedColor\"/>\n                                    <variation key=\"default\">\n                                        <mask key=\"constraints\">\n                                            <exclude reference=\"66F-z2-11F\"/>\n                                            <exclude reference=\"uiW-P3-O2a\"/>\n                                        </mask>\n                                    </variation>\n                                    <variation key=\"heightClass=compact\" misplaced=\"YES\">\n                                        <rect key=\"frame\" x=\"20\" y=\"230\" width=\"560\" height=\"61\"/>\n                                    </variation>\n                                    <variation key=\"widthClass=regular\">\n                                        <mask key=\"constraints\">\n                                            <include reference=\"66F-z2-11F\"/>\n                                        </mask>\n                                    </variation>\n                                </label>\n                                <button opaque=\"NO\" contentMode=\"scaleToFill\" misplaced=\"YES\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"NqH-Hi-p4y\">\n                                    <rect key=\"frame\" x=\"200\" y=\"404\" width=\"200\" height=\"30\"/>\n                                    <constraints>\n                                        <constraint firstAttribute=\"width\" constant=\"200\" id=\"2sF-bQ-dgD\"/>\n                                    </constraints>\n                                    <state key=\"normal\" title=\"Upgrade To Pro\">\n                                        <color key=\"titleColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                                    </state>\n                                </button>\n                            </subviews>\n                            <color key=\"backgroundColor\" white=\"0.0\" alpha=\"0.0\" colorSpace=\"calibratedWhite\"/>\n                            <constraints>\n                                <constraint firstAttribute=\"bottom\" secondItem=\"NqH-Hi-p4y\" secondAttribute=\"bottom\" constant=\"20\" id=\"8Ma-wm-Icv\"/>\n                                <constraint firstAttribute=\"trailing\" secondItem=\"IFp-WC-sJv\" secondAttribute=\"trailing\" constant=\"10\" id=\"9oA-CW-5Rn\"/>\n                                <constraint firstItem=\"N07-18-8l1\" firstAttribute=\"leading\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"leading\" constant=\"20\" symbolic=\"YES\" id=\"G6S-W4-oDs\"/>\n                                <constraint firstItem=\"IFp-WC-sJv\" firstAttribute=\"top\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"top\" constant=\"30\" id=\"O86-TJ-Edu\"/>\n                                <constraint firstItem=\"N07-18-8l1\" firstAttribute=\"top\" secondItem=\"b9j-aA-s7h\" secondAttribute=\"bottom\" constant=\"38\" id=\"Osu-tn-kBQ\"/>\n                                <constraint firstItem=\"NqH-Hi-p4y\" firstAttribute=\"centerX\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"centerX\" id=\"S2J-mA-cL0\"/>\n                                <constraint firstItem=\"N07-18-8l1\" firstAttribute=\"centerX\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"centerX\" id=\"YSb-57-Io9\"/>\n                                <constraint firstItem=\"b9j-aA-s7h\" firstAttribute=\"centerX\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"centerX\" id=\"h5E-gw-2Va\"/>\n                                <constraint firstItem=\"IFp-WC-sJv\" firstAttribute=\"leading\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"leading\" constant=\"10\" id=\"jU0-wJ-MMA\"/>\n                                <constraint firstItem=\"NqH-Hi-p4y\" firstAttribute=\"top\" secondItem=\"N07-18-8l1\" secondAttribute=\"bottom\" constant=\"29\" id=\"kWW-Jf-bLm\"/>\n                                <constraint firstItem=\"N07-18-8l1\" firstAttribute=\"centerX\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"centerX\" id=\"pbR-Yu-wnf\"/>\n                                <constraint firstAttribute=\"trailing\" secondItem=\"N07-18-8l1\" secondAttribute=\"trailing\" constant=\"20\" symbolic=\"YES\" id=\"sqx-yv-Tsc\"/>\n                                <constraint firstItem=\"b9j-aA-s7h\" firstAttribute=\"top\" secondItem=\"IFp-WC-sJv\" secondAttribute=\"bottom\" constant=\"28\" id=\"zhc-VM-L4I\"/>\n                            </constraints>\n                            <variation key=\"default\">\n                                <mask key=\"constraints\">\n                                    <exclude reference=\"YSb-57-Io9\"/>\n                                    <exclude reference=\"pbR-Yu-wnf\"/>\n                                </mask>\n                            </variation>\n                            <variation key=\"widthClass=regular\">\n                                <mask key=\"constraints\">\n                                    <exclude reference=\"G6S-W4-oDs\"/>\n                                    <include reference=\"YSb-57-Io9\"/>\n                                    <exclude reference=\"sqx-yv-Tsc\"/>\n                                </mask>\n                            </variation>\n                        </view>\n                    </subviews>\n                    <constraints>\n                        <constraint firstAttribute=\"bottom\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"bottom\" id=\"I0a-bE-wJP\"/>\n                        <constraint firstItem=\"d0P-2R-tXd\" firstAttribute=\"top\" secondItem=\"R8Q-UR-00k\" secondAttribute=\"top\" id=\"bXx-ia-TaO\"/>\n                        <constraint firstAttribute=\"trailing\" secondItem=\"d0P-2R-tXd\" secondAttribute=\"trailing\" id=\"bhO-LT-DaX\"/>\n                        <constraint firstItem=\"d0P-2R-tXd\" firstAttribute=\"leading\" secondItem=\"R8Q-UR-00k\" secondAttribute=\"leading\" id=\"y1s-Nf-4PJ\"/>\n                    </constraints>\n                    <variation key=\"default\">\n                        <mask key=\"constraints\">\n                            <exclude reference=\"bhO-LT-DaX\"/>\n                        </mask>\n                    </variation>\n                    <variation key=\"widthClass=regular\" ambiguous=\"YES\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"800\" height=\"600\"/>\n                    </variation>\n                    <variation key=\"heightClass=compact-widthClass=compact\" ambiguous=\"YES\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"400\" height=\"400\"/>\n                    </variation>\n                    <variation key=\"heightClass=compact-widthClass=regular\" ambiguous=\"YES\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"800\" height=\"400\"/>\n                    </variation>\n                </scrollView>\n            </subviews>\n            <color key=\"backgroundColor\" red=\"0.19607843137254902\" green=\"0.19607843137254902\" blue=\"0.19607843137254902\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n            <constraints>\n                <constraint firstAttribute=\"trailing\" secondItem=\"R8Q-UR-00k\" secondAttribute=\"trailing\" id=\"Ea7-KG-g77\"/>\n                <constraint firstItem=\"R8Q-UR-00k\" firstAttribute=\"leading\" secondItem=\"2\" secondAttribute=\"leading\" id=\"FAq-QU-z7H\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"R8Q-UR-00k\" secondAttribute=\"bottom\" id=\"H28-Cr-211\"/>\n                <constraint firstItem=\"R8Q-UR-00k\" firstAttribute=\"top\" secondItem=\"2\" secondAttribute=\"top\" id=\"So5-pD-yLc\"/>\n                <constraint firstItem=\"d0P-2R-tXd\" firstAttribute=\"width\" secondItem=\"2\" secondAttribute=\"width\" id=\"xP8-Kg-zsz\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"365\" y=\"461\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"CodeHubRound.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/ReadmeViewController.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Concurrency;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.Views;\nusing CodeHub.WebViews;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    public class ReadmeViewController : BaseWebViewController\n    {\n        private static string LoadErrorMessage = \"Unable to load readme.\";\n        private readonly UIBarButtonItem _actionButton = new UIBarButtonItem(UIBarButtonSystemItem.Action);\n        private readonly IApplicationService _applicationService;\n        private readonly IMarkdownService _markdownService;\n        private readonly ObservableAsPropertyHelper<Octokit.Readme> _readme;\n        private readonly string _owner;\n        private readonly string _repository;\n\n        private Octokit.Readme Readme => _readme.Value;\n\n        public ReadmeViewController(\n            string owner,\n            string repository,\n            Octokit.Readme readme = null,\n            IApplicationService applicationService = null,\n            IMarkdownService markdownService = null)\n            : base(false, false)\n        {\n            _owner = owner;\n            _repository = repository;\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _markdownService = markdownService ?? Locator.Current.GetService<IMarkdownService>();\n\n            Title = \"Readme\";\n\n            var loadCommand = ReactiveCommand.CreateFromTask(() =>\n            {\n                if (readme != null)\n                    return Task.FromResult(readme);\n                return _applicationService.GitHubClient.Repository.Content.GetReadme(owner, repository);\n            });\n\n            loadCommand\n                .ThrownExceptions\n                .Do(_ => SetErrorView())\n                .Select(error => new UserError(LoadErrorMessage, error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            loadCommand\n                .ToProperty(this, x => x.Readme, out _readme);\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(loadCommand);\n\n            this.WhenAnyValue(x => x.Readme)\n                .Where(x => x != null)\n                .SelectMany(ConvertToWebView)\n                .Subscribe(LoadContent);\n\n            this.WhenAnyValue(x => x.Readme)\n                .Select(x => x != null)\n                .Subscribe(x => _actionButton.Enabled = x);\n\n            NavigationItem.RightBarButtonItem = _actionButton;\n\n            this.WhenActivated(d =>\n            {\n                d(_actionButton.GetClickedObservable()\n                  .Subscribe(ShareButtonPress));\n            });\n        }\n\n        private void SetErrorView()\n        {\n            var emptyListView = new EmptyListView(Octicon.GitBranch.ToEmptyListImage(), LoadErrorMessage)\n            {\n                Alpha = 0,\n                Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height)\n            };\n\n            View.Add(emptyListView);\n\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => emptyListView.Alpha = 1, null);\n        }\n\n        private async Task<string> ConvertToWebView(Octokit.Readme readme)\n        {\n            var content = await _markdownService.Convert(readme.Content);\n            var model = new MarkdownModel(content, (int)UIFont.PreferredSubheadline.PointSize);\n            return new MarkdownWebView { Model = model }.GenerateString();\n        }\n\n        protected override bool ShouldStartLoad(WebKit.WKWebView webView, WebKit.WKNavigationAction navigationAction)\n        {\n            if (!navigationAction.Request.Url.AbsoluteString.StartsWith(\"file://\", StringComparison.Ordinal))\n            {\n                var viewController = new WebBrowserViewController(navigationAction.Request.Url.AbsoluteString);\n                PresentViewController(viewController, true, null);\n                return false;\n            }\n\n            return base.ShouldStartLoad(webView, navigationAction);\n        }\n\n        private void ShareButtonPress(UIBarButtonItem barButtonItem)\n        {\n            var sheet = new UIActionSheet();\n            var shareButton = sheet.AddButton(\"Share\");\n            var showButton = sheet.AddButton(\"Show in GitHub\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n\n            sheet.Dismissed += (sender, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == showButton)\n                    {\n                        var viewController = new WebBrowserViewController(Readme.HtmlUrl);\n                        PresentViewController(viewController, true, null);\n                    }\n                    else if (e.ButtonIndex == shareButton)\n                    {\n                        AlertDialogService.Share(\n                            $\"{_owner}/{_repository} Readme\",\n                            url: Readme.HtmlUrl,\n                            barButtonItem: barButtonItem);\n                    }\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowFrom(barButtonItem, true);\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/RepositoriesViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.TableViewSources;\nusing CoreGraphics;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing CodeHub.Core.ViewModels.Repositories;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n\tpublic class RepositoriesViewController : TableViewController\n\t{\n\t\tprivate readonly UISearchBar _repositorySearchBar = new UISearchBar(new CGRect(0, 0, 320, 44));\n\t\tprivate readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n\n        private readonly Lazy<UIView> _emptyView = new Lazy<UIView>((() =>\n            new EmptyListView(Octicon.Repo.ToEmptyListImage(), \"There are no repositories.\")));\n\n        private readonly Lazy<UIView> _retryView;\n\n        public RepositoriesViewModel ViewModel { get; }\n\n        public static RepositoriesViewController CreateMineViewController()\n        {\n            var viewModel = RepositoriesViewModel.CreateMineViewModel();\n            return new RepositoriesViewController(viewModel);\n        }\n\n        public static RepositoriesViewController CreateUserViewController(string username)\n        {\n            var viewModel = RepositoriesViewModel.CreateUsersViewModel(username);\n            return new RepositoriesViewController(viewModel);\n        }\n\n        public static RepositoriesViewController CreateStarredViewController()\n        {\n            var viewModel = RepositoriesViewModel.CreateStarredViewModel();\n            return new RepositoriesViewController(viewModel) { Title = \"Starred\" };\n        }\n\n        public static RepositoriesViewController CreateWatchedViewController()\n        {\n            var viewModel = RepositoriesViewModel.CreateWatchedViewModel();\n            return new RepositoriesViewController(viewModel) { Title = \"Watched\" };\n        }\n\n        public static RepositoriesViewController CreateForkedViewController(string username, string repository)\n        {\n            var viewModel = RepositoriesViewModel.CreateForkedViewModel(username, repository);\n            return new RepositoriesViewController(viewModel) { Title = \"Forks\" };\n        }\n\n        public static RepositoriesViewController CreateOrganizationViewController(string org)\n        {\n            var viewModel = RepositoriesViewModel.CreateOrganizationViewModel(org);\n            return new RepositoriesViewController(viewModel);\n        }\n\n        public RepositoriesViewController(RepositoriesViewModel viewModel)\n\t\t\t: base(UITableViewStyle.Plain)\n\t\t{\n            ViewModel = viewModel;\n            Title = \"Repositories\";\n\n            _retryView = new Lazy<UIView>((() =>\n                new RetryListView(Octicon.Repo.ToEmptyListImage(), \"Error loading repositories.\", LoadData)));\n\t\t}\n\n\t\tpublic override void ViewDidLoad()\n\t\t{\n\t\t\tbase.ViewDidLoad();\n\n            var tableViewSource = new RepositoryTableViewSource(TableView, ViewModel.Items);\n            TableView.Source = tableViewSource;\n\n            Appearing\n                .Take(1)\n                .Subscribe(_ => LoadData());\n\n\t\t\tthis.WhenActivated(d =>\n\t\t\t{\n\t\t\t\td(_repositorySearchBar.GetChangedObservable()\n\t\t\t\t  .Subscribe(x => ViewModel.SearchText = x));\n\n\t\t\t\td(ViewModel.RepositoryItemSelected\n                  .Select(x => new RepositoryViewController(x.Owner, x.Name, x.Repository))\n\t\t\t\t  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.WhenAnyValue(x => x.HasMore)\n                  .Subscribe(x => TableView.TableFooterView = x ? _loading : null));\n\n                d(tableViewSource.RequestMore\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand\n                  .Select(_ => ViewModel.Items.Changed)\n                  .Switch()\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand.Merge(ViewModel.LoadMoreCommand)\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\t\t\t});\n\t\t}\n\n        private void LoadData()\n        {\n            if (_emptyView.IsValueCreated)\n                _emptyView.Value.RemoveFromSuperview();\n            if (_retryView.IsValueCreated)\n                _retryView.Value.RemoveFromSuperview();\n\n            ViewModel.LoadCommand.Execute()\n                .Take(1)\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Subscribe(SetHasItems, setHasError);\n        }\n\n        private void setHasError(Exception error)\n        {\n            _retryView.Value.Alpha = 0;\n            _retryView.Value.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);\n            View.Add(_retryView.Value);\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => _retryView.Value.Alpha = 1, null);\n        }\n\n        private void SetHasItems(bool hasItems)\n        {\n            TableView.TableHeaderView = hasItems ? _repositorySearchBar : null;\n\n            if (!hasItems)\n            {\n                _emptyView.Value.Alpha = 0;\n                _emptyView.Value.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);\n                View.Add(_emptyView.Value);\n                UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                               () => _emptyView.Value.Alpha = 1, null);\n            }\n        }\n\t}\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/RepositoryViewController.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.Repositories;\nusing UIKit;\nusing CodeHub.iOS.DialogElements;\nusing MvvmCross.Platform;\nusing CodeHub.Core.Services;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing ReactiveUI;\nusing CodeHub.iOS.Services;\nusing CodeHub.Core.Utilities;\nusing CodeHub.iOS.ViewControllers.Users;\nusing CodeHub.iOS.ViewControllers.Source;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.Views.Source;\nusing System.Linq;\nusing Humanizer;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    public class RepositoryViewController : PrettyDialogViewController\n    {\n        private readonly IFeaturesService _featuresService;\n        private IDisposable _privateView;\n\n        public new RepositoryViewModel ViewModel\n        {\n            get { return (RepositoryViewModel)base.ViewModel; }\n            protected set { base.ViewModel = value; }\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Title = ViewModel.RepositoryName;\n            HeaderView.SetImage(null, Images.Avatar);\n            HeaderView.Text = ViewModel.RepositoryName;\n            HeaderView.SubImageView.TintColor = UIColor.FromRGB(243, 156, 18);\n\n            Appeared.Take(1)\n                .Select(_ => Observable.Timer(TimeSpan.FromSeconds(0.35f)).Take(1))\n                .Switch()\n                .Select(_ => ViewModel.Bind(x => x.IsStarred, true).Where(x => x.HasValue))\n                .Switch()\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Subscribe(x => HeaderView.SetSubImage(x.Value ? Octicon.Star.ToImage() : null));\n\n            var actionButton = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action) { Enabled = false };\n\n            _split = new SplitButtonElement();\n            _stargazers = _split.AddButton(\"Stargazers\", \"-\");\n            _watchers = _split.AddButton(\"Watchers\", \"-\");\n            _forks = _split.AddButton(\"Forks\", \"-\");\n\n            OnActivation(d =>\n            {\n                d(_watchers.Clicked\n                  .Select(_ => ViewModel)\n                  .Select(x => UsersViewController.CreateWatchersViewController(x.Username, x.RepositoryName))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(_stargazers.Clicked\n                  .Select(_ => ViewModel)\n                  .Select(x => UsersViewController.CreateStargazersViewController(x.Username, x.RepositoryName))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(actionButton.GetClickedObservable().Subscribe(ShowExtraMenu));\n\n                d(_forks.Clicked.Subscribe(_ =>\n                {\n                    var vc = RepositoriesViewController.CreateForkedViewController(ViewModel.Username, ViewModel.RepositoryName);\n                    NavigationController?.PushViewController(vc, true);\n                }));\n\n                d(_eventsElement.Clicked.BindCommand(ViewModel.GoToEventsCommand));\n\n                d(_commitsElement.Clicked.Subscribe(_ => GoToCommits()));\n\n                d(_pullRequestsElement.Clicked.BindCommand(ViewModel.GoToPullRequestsCommand));\n                d(_sourceElement.Clicked.Subscribe(_ => GoToSourceCode()));\n\n                d(ViewModel.Bind(x => x.Branches, true).Subscribe(_ => Render()));\n                d(ViewModel.Bind(x => x.Readme, true).Subscribe(_ => Render()));\n\n                d(ViewModel.Bind(x => x.Repository)\n                  .Select(x => x?.Parent)\n                  .Where(x => x != null)\n                  .Subscribe(x => _forkElement.Value.Value = x.FullName));\n\n                d(_forkElement\n                  .Value.Clicked\n                  .Select(x => ViewModel.Repository?.Parent)\n                  .Subscribe(GoToForkedRepository));\n\n                d(_issuesElement.Value.Clicked.BindCommand(ViewModel.GoToIssuesCommand));\n                d(_readmeElement.Value.Clicked.Subscribe(_ => GoToReadme()));\n                d(_websiteElement.Value.Clicked.Select(x => ViewModel.Repository.Homepage).BindCommand(ViewModel.GoToUrlCommand));\n\n                d(HeaderView.Clicked.Merge(_ownerElement.Clicked.Select(_ => Unit.Default))\n                  .Select(_ => new UserViewController(ViewModel.Username, ViewModel.Repository.Owner))\n                  .Subscribe(x => this.PushViewController(x)));\n\n                d(ViewModel.Bind(x => x.Repository, true).Where(x => x != null).Subscribe(x =>\n                {\n                    if (x.Private && !_featuresService.IsProEnabled)\n                    {\n                        if (_privateView == null)\n                            _privateView = this.ShowPrivateView();\n                        actionButton.Enabled = false;\n                    }\n                    else\n                    {\n                        actionButton.Enabled = true;\n                        _privateView?.Dispose();\n                    }\n\n                    ViewModel.ImageUrl = x.Owner?.AvatarUrl;\n                    HeaderView.SubText = Emojis.FindAndReplace(x.Description);\n                    HeaderView.SetImage(x.Owner?.AvatarUrl, Images.Avatar);\n                    Render();\n                    RefreshHeaderView();\n                }));\n            });\n        }\n\n        private void ShowExtraMenu(UIBarButtonItem barButtonItem)\n        {\n            var repoModel = ViewModel.Repository;\n            if (repoModel == null || ViewModel.IsStarred == null || ViewModel.IsWatched == null)\n                return;\n\n            var sheet = new UIActionSheet();\n            var pinButton = sheet.AddButton(ViewModel.IsPinned ? \"Unpin from Slideout Menu\" : \"Pin to Slideout Menu\");\n            var starButton = sheet.AddButton(ViewModel.IsStarred.Value ? \"Unstar This Repo\" : \"Star This Repo\");\n            var watchButton = sheet.AddButton(ViewModel.IsWatched.Value ? \"Unwatch This Repo\" : \"Watch This Repo\");\n            var showButton = ViewModel?.Repository?.HtmlUrl != null ? sheet.AddButton(\"Show in GitHub\") : -1;\n            var shareButton = sheet.AddButton(\"Share\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (s, e) => {\n                // Pin to menu\n                if (e.ButtonIndex == pinButton)\n                {\n                    ViewModel.PinCommand.Execute(null);\n                }\n                else if (e.ButtonIndex == starButton)\n                {\n                    ViewModel.ToggleStarCommand.Execute(null);\n                }\n                else if (e.ButtonIndex == watchButton)\n                {\n                    ViewModel.ToggleWatchCommand.Execute(null);\n                }\n                else if (e.ButtonIndex == showButton)\n                {\n                    ViewModel.GoToHtmlUrlCommand.Execute(null);\n                }\n                else if (e.ButtonIndex == shareButton)\n                {\n                    AlertDialogService.Share(\n                        repoModel.FullName,\n                        repoModel.Description,\n                        repoModel.HtmlUrl,\n                        NavigationItem.RightBarButtonItem);\n                }\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowFrom(barButtonItem, true);\n        }\n\n        SplitViewElement _split1 = new SplitViewElement(Octicon.Lock.ToImage(), Octicon.Package.ToImage());\n        SplitViewElement _split2 = new SplitViewElement(Octicon.IssueOpened.ToImage(), Octicon.GitBranch.ToImage());\n        SplitViewElement _split3 = new SplitViewElement(Octicon.Calendar.ToImage(), Octicon.Tools.ToImage());\n        SplitButtonElement _split = new SplitButtonElement();\n        SplitButtonElement.Button _stargazers;\n        SplitButtonElement.Button _watchers;\n        SplitButtonElement.Button _forks;\n        private readonly StringElement _ownerElement = new StringElement(\"Owner\", string.Empty) { Image = Octicon.Person.ToImage() };\n        private readonly StringElement _eventsElement = new StringElement(\"Events\", Octicon.Rss.ToImage());\n        private readonly StringElement _commitsElement = new StringElement(\"Commits\", Octicon.GitCommit.ToImage());\n        private readonly StringElement _pullRequestsElement = new StringElement(\"Pull Requests\", Octicon.GitPullRequest.ToImage());\n        private readonly StringElement _sourceElement = new StringElement(\"Source\", Octicon.Code.ToImage());\n\n        private readonly Lazy<StringElement> _forkElement;\n        private readonly Lazy<StringElement> _issuesElement;\n        private readonly Lazy<StringElement> _readmeElement;\n        private readonly Lazy<StringElement> _websiteElement;\n\n        public static RepositoryViewController CreateCodeHubViewController()\n            => new RepositoryViewController(\"codehubapp\", \"codehub\");\n\n        public RepositoryViewController(Octokit.Repository repository)\n            : this(repository.Owner.Login, repository.Name, repository)\n        {\n        }\n\n        public RepositoryViewController(\n            string owner,\n            string repositoryName,\n            Octokit.Repository repository = null)\n            : this()\n        {\n            ViewModel = new RepositoryViewModel();\n            ViewModel.Init(new RepositoryViewModel.NavObject { Username = owner, Repository = repositoryName });\n            ViewModel.Repository = repository;\n        }\n\n        private void GoToSourceCode()\n        {\n            var defaultBranch = ViewModel.Repository?.DefaultBranch;\n            if (string.IsNullOrEmpty(defaultBranch))\n                return;\n\n            this.PushViewController(new SourceTreeViewController(\n                ViewModel.Username,\n                ViewModel.RepositoryName,\n                null,\n                defaultBranch,\n                ShaType.Branch));\n        }\n\n        private void GoToReadme()\n        {\n            this.PushViewController(\n                new ReadmeViewController(ViewModel.Username, ViewModel.RepositoryName, ViewModel.Readme));\n        }\n\n        private void GoToForkedRepository(Octokit.Repository repo)\n        {\n            if (repo == null)\n                return;\n\n            this.PushViewController(new RepositoryViewController(repo));\n        }\n\n        private void GoToCommits()\n        {\n            var owner = ViewModel.Username;\n            var repo = ViewModel.RepositoryName;\n            var branches = ViewModel.Branches;\n            if (branches?.Count == 1)\n            {\n                var viewController = new ChangesetsView(owner, repo, branches.First().Name);\n                this.PushViewController(viewController);\n            }\n            else\n            {\n                var viewController = new BranchesViewController(owner, repo, branches);\n                viewController.BranchSelected.Subscribe(\n                    branch => viewController.PushViewController(new ChangesetsView(owner, repo, branch.Name)));\n                this.PushViewController(viewController);\n            }\n        }\n\n        public RepositoryViewController()\n        {\n            _featuresService = Mvx.Resolve<IFeaturesService>();\n\n            _forkElement = new Lazy<StringElement>(() => new StringElement(\"Forked From\", string.Empty) { Image = Octicon.RepoForked.ToImage() });\n            _issuesElement = new Lazy<StringElement>(() => new StringElement(\"Issues\", Octicon.IssueOpened.ToImage()));\n            _readmeElement = new Lazy<StringElement>(() => new StringElement(\"Readme\", Octicon.Book.ToImage()));\n            _websiteElement = new Lazy<StringElement>(() => new StringElement(\"Website\", Octicon.Globe.ToImage()));\n        }\n\n        public void Render()\n        {\n            var model = ViewModel.Repository;\n            var branches = ViewModel.Branches?.Count ?? 0;\n            if (model == null)\n                return;\n\n            _stargazers.Text = model.StargazersCount.ToString();\n            _watchers.Text = model.SubscribersCount.ToString();\n            _forks.Text = model.ForksCount.ToString();\n\n            Title = model.Name;\n            ICollection<Section> sections = new LinkedList<Section>();\n\n            sections.Add(new Section { _split });\n            var sec1 = new Section();\n\n            _split1.Button1.Text = model.Private ? \"Private\" : \"Public\";\n            _split1.Button2.Text = model.Language ?? \"N/A\";\n            sec1.Add(_split1);\n\n            _split2.Button1.Text = \"Issue\".ToQuantity(model.OpenIssuesCount);\n            _split2.Button2.Text = \"Branch\".ToQuantity(branches);\n            sec1.Add(_split2);\n\n            _split3.Button1.Text = model.CreatedAt.ToString(\"MM/dd/yy\");\n            _split3.Button2.Text = model.Size.Kilobytes().ToString(\"#.#\");\n            sec1.Add(_split3);\n\n            _ownerElement.Value = model.Owner.Login;\n            sec1.Add(_ownerElement);\n\n            if (model.Parent != null)\n                sec1.Add(_forkElement.Value);\n\n            var sec2 = new Section { _eventsElement };\n\n            if (model.HasIssues)\n                sec2.Add(_issuesElement.Value);\n\n            if (ViewModel.Readme != null)\n                sec2.Add(_readmeElement.Value);\n\n            sections.Add(sec1);\n            sections.Add(sec2);\n            sections.Add(new Section { _commitsElement, _pullRequestsElement, _sourceElement });\n\n            if (!string.IsNullOrEmpty(model.Homepage))\n                sections.Add(new Section { _websiteElement.Value });\n\n            Root.Reset(sections);\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Repositories/TrendingRepositoriesViewController.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.Repositories;\nusing UIKit;\nusing System.Linq;\nusing CoreGraphics;\nusing CodeHub.iOS.Transitions;\nusing CodeHub.iOS.TableViewSources;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing System.Reactive;\nusing CodeHub.iOS.TableViewCells;\n\nnamespace CodeHub.iOS.ViewControllers.Repositories\n{\n    public class TrendingRepositoriesViewController : TableViewController\n    {\n        private readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n        private readonly TrendingTitleButton _trendingTitleButton = new TrendingTitleButton { Frame = new CGRect(0, 0, 200f, 32f) };\n\n        public RepositoriesTrendingViewModel ViewModel { get; } = new RepositoriesTrendingViewModel();\n\n        public TrendingRepositoriesViewController()\n            : base(UITableViewStyle.Plain)\n        {\n            NavigationItem.TitleView = _trendingTitleButton;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var tableViewSource = new RepositoryTableViewSource(TableView);\n            TableView.Source = tableViewSource;\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(ViewModel.LoadCommand);\n\n            this.WhenActivated(d =>\n            {\n                d(ViewModel.LoadCommand.IsExecuting\n                  .Subscribe(Loading));\n\n                d(_trendingTitleButton.GetClickedObservable()\n                  .Subscribe(_ => ShowLanguages()));\n\n                d(ViewModel.WhenAnyValue(x => x.SelectedLanguage)\n                  .Subscribe(x => _trendingTitleButton.Text = x.Name));\n\n                d(ViewModel.RepositoryItemSelected\n                  .Select(x => new RepositoryViewController(x.Owner, x.Name, x.Repository))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.WhenAnyValue(x => x.Items).Subscribe(items =>\n                {\n                    var sections = items.Select(item =>\n                    {\n                        var tsi = new TableSectionInformation<RepositoryItemViewModel, RepositoryCellView>(\n                            new ReactiveList<RepositoryItemViewModel>(item.Item2),\n                            RepositoryCellView.Key,\n                            (float)UITableView.AutomaticDimension);\n                        tsi.Header = new TableSectionHeader(() => CreateHeaderView(item.Item1), 26f);\n                        return tsi;\n                    });\n\n                    tableViewSource.Data = sections.ToList();\n                }));\n            });\n        }\n\n        private void ShowLanguages()\n        {\n            var vm = new WeakReference<RepositoriesTrendingViewModel>(ViewModel as RepositoriesTrendingViewModel);\n            var view = new LanguagesViewController();\n            view.SelectedLanguage = vm.Get()?.SelectedLanguage;\n            view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            view.NavigationItem.LeftBarButtonItem.GetClickedObservable().Subscribe(_ => DismissViewController(true, null));\n            view.Language.Subscribe(x => {\n                var viewModel = vm.Get();\n                if (viewModel != null)\n                    viewModel.SelectedLanguage = x;\n                DismissViewController(true, null);\n            });\n            var ctrlToPresent = new ThemedNavigationController(view);\n            ctrlToPresent.TransitioningDelegate = new SlideDownTransition();\n            PresentViewController(ctrlToPresent, true, null);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            if (NavigationController != null)\n            {\n                NavigationController.NavigationBar.ShadowImage = new UIImage();\n                _trendingTitleButton.TintColor = NavigationController.NavigationBar.TintColor;\n            }\n        }\n\n        private static UILabel CreateHeaderView(string name)\n        {\n            return new UILabel(new CGRect(0, 0, 320f, 26f)) \n            {\n                BackgroundColor = Theme.CurrentTheme.PrimaryColor,\n                Text = name,\n                Font = UIFont.BoldSystemFontOfSize(14f),\n                TextColor = UIColor.White,\n                TextAlignment = UITextAlignment.Center\n            };\n        }\n\n        private void Loading(bool searching)\n        {\n            _loading.SetLoading(searching);\n\n            if (searching)\n            {\n                TableView.TableFooterView = _loading;\n                TableView.BackgroundView = null;\n            }\n            else\n            {\n                TableView.TableFooterView = null;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Search/ExploreViewController.cs",
    "content": "using System;\nusing UIKit;\nusing System.Reactive.Linq;\nusing ReactiveUI;\n\nnamespace CodeHub.iOS.ViewControllers.Search\n{\n    public class ExploreViewController : BaseViewController\n    {\n        private readonly UISegmentedControl _viewSegment = new UISegmentedControl(new object[] { \"Repositories\", \"Users\" });\n\n        private Lazy<UIViewController> _repositoryViewController =\n            new Lazy<UIViewController>(() => new RepositoryExploreViewController());\n\n        private Lazy<UIViewController> _userViewController =\n            new Lazy<UIViewController>(() => new UserExploreViewController());\n\n        public ExploreViewController()\n        {\n            Title = \"Explore\";\n\n            _viewSegment.SelectedSegment = 0;\n            NavigationItem.TitleView = _viewSegment;\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = \"\" };\n\n            this.WhenActivated(d =>\n            {\n                d(_viewSegment.GetChangedObservable()\n                  .StartWith((int)_viewSegment.SelectedSegment)\n                  .Subscribe(HandleSegmentChange));\n            });\n        }\n\n        private void HandleSegmentChange(int segmentId)\n        {\n            foreach (var childViewController in ChildViewControllers)\n            {\n                childViewController.RemoveFromParentViewController();\n                childViewController.View.RemoveFromSuperview();\n            }\n\n            var newViewController = segmentId == 0 ? _repositoryViewController.Value : _userViewController.Value;\n            AddChildViewController(newViewController);\n\n            var newView = newViewController.View;\n            newView.Frame = View.Bounds;\n            newView.AutoresizingMask = UIViewAutoresizing.All;\n            View.AddSubview(newView);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Search/RepositoryExploreViewController.cs",
    "content": "using System;\nusing UIKit;\nusing ReactiveUI;\nusing CodeHub.iOS.TableViewSources;\nusing CoreGraphics;\nusing CodeHub.Core.ViewModels.Search;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.Views;\nusing CodeHub.iOS.ViewControllers.Repositories;\n\nnamespace CodeHub.iOS.ViewControllers.Search\n{\n    public class RepositoryExploreViewController : TableViewController\n    {\n        private readonly UISearchBar _repositorySearchBar = new UISearchBar(new CGRect(0, 0, 320, 44));\n        private readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n\n        private readonly Lazy<UIView> emptyView = new Lazy<UIView>((() =>\n            new EmptyListView(Octicon.Repo.ToEmptyListImage(), \"There are no repositories.\")));\n\n        public RepositoryExploreViewModel ViewModel { get; } = new RepositoryExploreViewModel();\n\n        public RepositoryExploreViewController()\n            : base(UITableViewStyle.Plain)\n        {\n            Title = \"Explore\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.TableHeaderView = _repositorySearchBar;\n            TableView.Source = new RepositoryTableViewSource(TableView, ViewModel.Items);\n\n            this.WhenActivated(d =>\n            {\n                d(_repositorySearchBar.GetChangedObservable()\n                  .Subscribe(x => ViewModel.SearchText = x));\n                \n                d(_repositorySearchBar.GetSearchObservable()\n                  .InvokeReactiveCommand(ViewModel.SearchCommand));\n\n                d(ViewModel.SearchCommand.IsExecuting\n                  .Subscribe(Searching));\n\n                d(ViewModel.RepositoryItemSelected\n                  .Select(x => new RepositoryViewController(x.Owner, x.Name, x.Repository))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.SearchCommand.Subscribe(_ => SearchComplete()));\n            });\n        }\n\n        private void SearchComplete()\n        {\n            if (ViewModel.Items.Count == 0)\n            {\n                TableView.BackgroundView = emptyView.Value;\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;\n            }\n            else\n            {\n                TableView.BackgroundView = null;\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;\n            }\n        }\n\n        private void Searching(bool searching)\n        {\n            _loading.SetLoading(searching);\n\n            if (searching)\n            {\n                TableView.TableFooterView = _loading;\n                TableView.BackgroundView = null;\n            }\n            else\n            {\n                TableView.TableFooterView = null;\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Search/UserExploreViewController.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.Search;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.iOS.ViewControllers.Users;\nusing CodeHub.iOS.Views;\nusing CoreGraphics;\nusing ReactiveUI;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Search\n{\n    public class UserExploreViewController : TableViewController\n    {\n        private readonly UISearchBar _searchBar = new UISearchBar(new CGRect(0, 0, 320, 44));\n        private readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n\n        private readonly Lazy<UIView> emptyView = new Lazy<UIView>((() =>\n            new EmptyListView(Octicon.Person.ToEmptyListImage(), \"There are no users.\")));\n\n        public UserExploreViewModel ViewModel { get; } = new UserExploreViewModel();\n\n        public UserExploreViewController()\n            : base(UITableViewStyle.Plain)\n        {\n            Title = \"Users\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.TableHeaderView = _searchBar;\n            TableView.Source = new UserTableViewSource(TableView, ViewModel.Items);\n\n            this.WhenActivated(d =>\n            {\n                d(_searchBar.GetChangedObservable()\n                  .Subscribe(x => ViewModel.SearchText = x));\n\n                d(_searchBar.GetSearchObservable()\n                  .InvokeReactiveCommand(ViewModel.SearchCommand));\n\n                d(ViewModel.SearchCommand.IsExecuting\n                  .Subscribe(Searching));\n\n                d(ViewModel.RepositoryItemSelected\n                  .Select(x => new UserViewController(x.User))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.SearchCommand.Subscribe(_ => SearchComplete()));\n            });\n        }\n\n        private void SearchComplete()\n        {\n            if (ViewModel.Items.Count == 0)\n            {\n                TableView.BackgroundView = emptyView.Value;\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;\n            }\n            else\n            {\n                TableView.BackgroundView = null;\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;\n            }\n        }\n\n        private void Searching(bool searching)\n        {\n            _loading.SetLoading(searching);\n\n            if (searching)\n            {\n                TableView.TableFooterView = _loading;\n                TableView.BackgroundView = null;\n            }\n            else\n            {\n                TableView.TableFooterView = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Settings/DefaultStartupViewController.cs",
    "content": "using System;\nusing UIKit;\nusing System.Linq;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.TableViewSources;\nusing Splat;\nusing CodeHub.Core.Services;\nusing System.Reactive.Linq;\nusing ReactiveUI;\n\nnamespace CodeHub.iOS.ViewControllers.Settings\n{\n    public class DefaultStartupViewController : TableViewController\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly Action _doneAction;\n\n        private static readonly string[] _items = {\n            \"News\",\n            \"Organizations\",\n            \"Trending Repositories\",\n            \"Explore Repositories\",\n            \"Owned Repositories\",\n            \"Starred Repositories\",\n            \"Public Gists\",\n            \"Starred Gists\",\n            \"My Gists\",\n            \"Profile\",\n            \"My Events\",\n            \"My Issues\",\n            \"Notifications\"\n        };\n\n        private string _selectedValue;\n        private string SelectedValue\n        {\n            get { return _selectedValue; }\n            set { this.RaiseAndSetIfChanged(ref _selectedValue, value); }\n        }\n\n        public DefaultStartupViewController(\n            Action doneAction,\n            IApplicationService applicationService = null)\n            : base(UITableViewStyle.Plain)\n        {\n            _doneAction = doneAction;\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            Title = \"Default Startup View\";\n            SelectedValue = _applicationService.Account.DefaultStartupView;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var source = new DialogTableViewSource(TableView);\n            TableView.Source = source;\n\n            this.WhenActivated(d =>\n            {\n                d(this.WhenAnyValue(x => x.SelectedValue)\n                  .Subscribe(_ => Render(source)));\n            });\n        }\n\n        private void Render(DialogTableViewSource tableViewSource)\n        {\n            var section = new Section();\n            section.Add(_items.Select(CreateElement));\n            tableViewSource.Root.Reset(section);\n        }\n\n        private Element CreateElement(string title)\n        {\n            var element = new StringElement(title);\n            element.Clicked.Select(_ => title).Subscribe(ElementSelected);\n            element.Accessory = string.Equals(title, SelectedValue)\n                ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\n            return element;\n        }\n\n        private void ElementSelected(string value)\n        {\n            SelectedValue = value;\n            _applicationService.Account.DefaultStartupView = value;\n            _applicationService.UpdateActiveAccount().ToBackground();\n            _doneAction();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Settings/SettingsViewController.cs",
    "content": "using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.ViewControllers.Application;\nusing CodeHub.iOS.ViewControllers.Repositories;\nusing Foundation;\nusing Humanizer;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Settings\n{\n    public class SettingsViewController : BaseDialogViewController\n    {\n        private static string RegisterNotificationsError = \"Unable to register for push notifications!\";\n        private readonly IFeaturesService _featuresService = Locator.Current.GetService<IFeaturesService>();\n        private readonly IApplicationService _applicationService = Locator.Current.GetService<IApplicationService>();\n        private readonly IAlertDialogService _alertDialogService = Locator.Current.GetService<IAlertDialogService>();\n        private readonly IPushNotificationsService _pushNotificationsService = Locator.Current.GetService<IPushNotificationsService>();\n        private readonly ReactiveCommand<bool, Unit> _registerPushNotifications;\n\n        public SettingsViewController()\n        {\n            Title = \"Settings\";\n\n            _registerPushNotifications = ReactiveCommand.CreateFromTask<bool>(RegisterPushNotifications);\n\n            _registerPushNotifications\n                .ThrownExceptions\n                .Select(error => new UserError(RegisterNotificationsError, error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            _registerPushNotifications.Subscribe(_ => CreateTable());\n\n            Appearing.Subscribe(_ => CreateTable());\n        }\n\n        private async Task RegisterPushNotifications(bool enabled)\n        {\n            if (!_featuresService.IsProEnabled)\n            {\n                var response = await _alertDialogService.PromptYesNo(\n                    \"Requires Activation\",\n                    \"Push notifications require activation. Would you like to go there now to activate push notifications?\");\n\n                if (response)\n                    UpgradeViewController.Present(this);\n\n                return;\n            }\n\n            if (enabled)\n                await _pushNotificationsService.Register();\n            else\n                await _pushNotificationsService.Deregister();\n\n            _applicationService.Account.IsPushNotificationsEnabled = enabled;\n            await _applicationService.UpdateActiveAccount();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            HeaderView.Image = Images.LoginUserUnknown;\n            HeaderView.SubText = \"Settings apply to this account only.\";\n\n            CreateTable();\n        }\n\n        private void CreateTable()\n        {\n            var currentAccount = _applicationService.Account;\n            var accountSection = new Section(\"Account\");\n\n            var showOrganizationsInEvents = new BooleanElement(\"Show Organizations in Events\", currentAccount.ShowOrganizationsInEvents);\n            showOrganizationsInEvents.Changed.Subscribe(x => {\n                currentAccount.ShowOrganizationsInEvents = x;\n                _applicationService.UpdateActiveAccount().ToBackground();\n            });\n\n            var showOrganizations = new BooleanElement(\"List Organizations in Menu\", currentAccount.ExpandOrganizations);\n            showOrganizations.Changed.Subscribe(x => { \n                currentAccount.ExpandOrganizations = x;\n                _applicationService.UpdateActiveAccount().ToBackground();\n            });\n\n            var repoDescriptions = new BooleanElement(\"Show Repo Descriptions\", currentAccount.ShowRepositoryDescriptionInList);\n            repoDescriptions.Changed.Subscribe(x => {\n                currentAccount.ShowRepositoryDescriptionInList = x;\n                _applicationService.UpdateActiveAccount().ToBackground();\n            });\n\n            var startupView = new StringElement(\n                \"Startup View\", _applicationService.Account.DefaultStartupView, UITableViewCellStyle.Value1)\n            { \n                Accessory = UITableViewCellAccessory.DisclosureIndicator,\n            };\n\n            startupView.Clicked.Subscribe(_ =>\n            {\n                var viewController = new DefaultStartupViewController(\n                    () => NavigationController.PopToViewController(this, true));\n                NavigationController.PushViewController(viewController, true);\n            });\n\n            var syntaxHighlighter = new ButtonElement(\n                \"Syntax Highlighter\",\n                _applicationService.Account.CodeEditTheme?.Humanize(LetterCasing.Title) ?? \"Default\");\n\n            syntaxHighlighter\n                .Clicked\n                .Select(_ => new SyntaxHighlighterViewController())\n                .Subscribe(vc => this.PushViewController(vc));\n\n            var pushNotifications = new BooleanElement(\n                \"Push Notifications\",\n                _applicationService.Account.IsPushNotificationsEnabled == true);\n\n            pushNotifications\n                .Changed\n                .InvokeReactiveCommand(_registerPushNotifications);\n\n            accountSection.Add(pushNotifications);\n       \n            var source = new StringElement(\"Source Code\");\n            source\n                .Clicked\n                .Select(_ => RepositoryViewController.CreateCodeHubViewController())\n                .Subscribe(vc => this.PushViewController(vc));\n                  \n            var follow = new StringElement(\"Follow On Twitter\");\n            follow\n                .Clicked\n                .Select(_ => new NSUrl(\"https://twitter.com/CodeHubapp\"))\n                .Subscribe(url => UIApplication.SharedApplication.OpenUrl(url));\n\n            var rate = new StringElement(\"Rate This App\");\n            rate\n                .Clicked\n                .Select(_ => new NSUrl(\"https://itunes.apple.com/us/app/codehub-github-for-ios/id707173885?mt=8\"))\n                .Subscribe(url => UIApplication.SharedApplication.OpenUrl(url));\n\n            var aboutSection = new Section(\"About\", \"Thank you for downloading. Enjoy!\")\n            {\n                source,\n                follow,\n                rate\n            };\n        \n            if (_featuresService.IsProEnabled)\n            {\n                var upgrades = new StringElement(\"Upgrades\");\n                upgrades.Clicked.Subscribe(_ => UpgradeViewController.Present(this));\n                aboutSection.Add(upgrades);\n            }\n\n            var appVersion = new StringElement(\"App Version\", UIApplication.SharedApplication.GetVersion())\n            { \n                Accessory = UITableViewCellAccessory.None,\n                SelectionStyle = UITableViewCellSelectionStyle.None\n            };\n\n            aboutSection.Add(appVersion);\n\n            var appearanceSection = new Section(\"Appearance\")\n            {\n                showOrganizationsInEvents,\n                showOrganizations,\n                repoDescriptions,\n                startupView,\n                syntaxHighlighter\n            };\n\n            Root.Reset(accountSection, appearanceSection, aboutSection);\n        }\n    }\n}\n\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Settings/SyntaxHighlightExample",
    "content": "﻿using System;\n\nnamespace SyntaxExample\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            string name; //Variable for storing string value\n\n            //Displaying message for entring value\n            Console.WriteLine(\"Please Enter Your Name\");\n\n            //Accepting and holding values in name variable\n            name = Console.ReadLine();\n\n            //Displaying Output\n            Console.WriteLine(\"Welcome {0} in your first csharp program\", name);\n\n            //Holding console screen\n            Console.ReadLine();\n        }\n    }\n}"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Settings/SyntaxHighlighterViewController.cs",
    "content": "﻿using System;\nusing ReactiveUI;\nusing UIKit;\nusing CoreGraphics;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Subjects;\nusing CodeHub.WebViews;\nusing System.Reflection;\nusing System.IO;\nusing Splat;\nusing CodeHub.Core.Services;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing System.Reactive.Threading.Tasks;\n\nnamespace CodeHub.iOS.ViewControllers.Settings\n{\n    public class SyntaxHighlighterViewController : BaseWebViewController\n    {\n        private static string LoadErrorMessage = \"Unable to load code example.\";\n        const string _resourceName = \"CodeHub.iOS.ViewControllers.Settings.SyntaxHighlightExample\";\n        private readonly UIPickerView _pickerView = new UIPickerView();\n        private readonly IApplicationService _applicationService;\n\n        private bool _isModified = false;\n\n        private string _selectedTheme;\n        public string SelectedTheme\n        {\n            get { return _selectedTheme; }\n            set { this.RaiseAndSetIfChanged(ref _selectedTheme, value); }\n        }\n\n        public SyntaxHighlighterViewController(\n            IApplicationService applicationService = null)\n            : base(false, false)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _pickerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            _pickerView.ShowSelectionIndicator = true;\n            _pickerView.BackgroundColor = UIColor.FromRGB(244, 244, 244);\n\n            Title = \"Syntax Highlighting\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            SelectedTheme = _applicationService.Account.CodeEditTheme ?? \"idea\";\n\n            var themes = Directory\n                .GetFiles(Path.Combine(\"WebResources\", \"styles\"))\n                .Where(x => x.EndsWith(\".css\", StringComparison.Ordinal))\n                .Select(x => Path.GetFileNameWithoutExtension(x))\n                .ToArray();\n\n            var model = new PickerModel(themes);\n            _pickerView.Model = model;\n\n            var selectedIndex = Array.IndexOf(themes, SelectedTheme);\n            if (selectedIndex >= 0 && selectedIndex < themes.Length)\n                _pickerView.Select(selectedIndex, 0, false);\n            Add(_pickerView);\n\n            var loadCommand = ReactiveCommand.CreateFromTask<string>(LoadTheme);\n\n            loadCommand\n                .ThrownExceptions\n                .Select(error => new UserError(LoadErrorMessage, error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            this.WhenAnyValue(x => x.SelectedTheme)\n                .InvokeReactiveCommand(loadCommand);\n\n            this.WhenAnyValue(x => x.SelectedTheme)\n                .Skip(1)\n                .Take(1)\n                .Subscribe(_ => _isModified = true);\n\n            OnActivation(d =>\n            {\n                d(model.SelectedObservable\n                  .Subscribe(x => SelectedTheme = x));\n            });\n\n            Disappearing\n                .Where(_ => _isModified)\n                .Select(_ => SelectedTheme)\n                .SelectMany(theme => SetSelectedTheme(theme).ToObservable())\n                .Subscribe(_ => {}, err => this.Log().ErrorException(\"Unable to save theme\", err));\n        }\n\n        private async Task LoadTheme(string theme)\n        {\n            var assembly = Assembly.GetExecutingAssembly();\n            using (var stream = assembly.GetManifestResourceStream(_resourceName))\n            using (var reader = new StreamReader(stream))\n            {\n                var content = await reader.ReadToEndAsync();\n                var zoom = UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Phone;\n                var model = new SyntaxHighlighterModel(\n                    content, theme ?? \"idea\", (int)UIFont.PreferredSubheadline.PointSize, zoom, lockWidth: true);\n                var razorView = new SyntaxHighlighterWebView { Model = model };\n                LoadContent(razorView.GenerateString());\n            }\n        }\n\n        private async Task SetSelectedTheme(string theme)\n        {\n            var account = _applicationService.Account;\n            account.CodeEditTheme = theme;\n            await _applicationService.UpdateActiveAccount();\n        }\n\n        public override void ViewWillLayoutSubviews()\n        {\n            base.ViewWillLayoutSubviews();\n            Web.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height - _pickerView.Frame.Height);\n            _pickerView.Frame = new CGRect(0, View.Bounds.Height - _pickerView.Frame.Height, View.Bounds.Width, _pickerView.Frame.Height);\n        }\n\n        private class PickerModel : UIPickerViewModel\n        {\n            private readonly string[] _values;\n            private readonly ISubject<string> _selectedSubject = new Subject<string>();\n\n            public IObservable<string> SelectedObservable => _selectedSubject.AsObservable();\n\n            public PickerModel(IEnumerable<string> values)\n            {\n                _values = values.ToArray();   \n            }\n\n            public override nint GetComponentCount(UIPickerView picker) => 1;\n\n            public override void Selected(UIPickerView picker, nint row, nint component) => _selectedSubject.OnNext(_values[row]);\n\n            public override nint GetRowsInComponent(UIPickerView picker, nint component) => _values.Length;\n\n            public override string GetTitle(UIPickerView picker, nint row, nint component) => _values[row];\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/AddSourceViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing CodeHub.iOS.Utilities;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.Core.Services;\nusing Splat;\nusing System.Reactive.Subjects;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class AddSourceViewController : TableViewController\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly string _username;\n        private readonly string _repository;\n        private readonly string _path;\n        private readonly string _branch;\n\n        private readonly DummyInputElement _titleElement;\n        private readonly ExpandingInputElement _descriptionElement;\n\n        private readonly ISubject<Octokit.RepositoryContentChangeSet> _successSubject\n            = new Subject<Octokit.RepositoryContentChangeSet>();\n\n        public IObservable<Octokit.RepositoryContentChangeSet> Success => _successSubject.AsObservable();\n\n        public AddSourceViewController(\n            string username,\n            string repository,\n            string path,\n            string branch,\n            IApplicationService applicationService = null)\n            : base(UITableViewStyle.Plain)\n        {\n            _username = username;\n            _repository = repository;\n            _path = path;\n            _branch = branch;\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            _titleElement = new DummyInputElement(\"Name\") { SpellChecking = false };\n            _descriptionElement = new ExpandingInputElement(\"Content\")\n            {\n                SpellChecking = false,\n                Font = UIFont.FromName(\"Courier\", UIFont.PreferredBody.PointSize)\n            };\n\n            EdgesForExtendedLayout = UIRectEdge.None;\n            Title = \"Add File\";\n\n            var commitButton = new UIBarButtonItem { Title = \"Commit\" };\n            NavigationItem.RightBarButtonItem = commitButton;\n\n            this.OnActivation(d =>\n            {\n                d(commitButton\n                  .GetClickedObservable()\n                  .Subscribe(_ => Commit()));\n\n                d(_titleElement\n                  .Changed\n                  .Select(x => x.Length != 0)\n                  .Subscribe(x => commitButton.Enabled = x));\n            });\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var source = new DialogTableViewSource(TableView);\n            source.Root.Add(new Section { _titleElement, _descriptionElement });\n            TableView.Source = source;\n            TableView.TableFooterView = new UIView();\n        }\n\n        private void Commit()\n        {\n            var content = _descriptionElement.Value;\n\n            var composer = new Composer\n            {\n                Title = \"Commit Message\",\n                Text = \"Create \" + _titleElement.Value\n            };\n\n            composer\n                .SendItem\n                .GetClickedObservable()\n                .Subscribe(_ => CommitThis(composer.Text).ToBackground());\n\n            this.PushViewController(composer);\n        }\n\n        private async Task CommitThis(string message)\n        {\n            var content = _descriptionElement.Value;\n            var name = _titleElement.Value;\n            var path = string.IsNullOrEmpty(_path) ? name : $\"{_path.TrimEnd('/')}/{name}\";\n            var hud = this.CreateHud();\n\n            try\n            {\n                hud.Show(\"Committing...\");\n                UIApplication.SharedApplication.BeginIgnoringInteractionEvents();\n                NetworkActivity.PushNetworkActive();\n\n                var encodedPath = path == null ? null : System.Net.WebUtility.UrlEncode(path);\n\n                var result = await _applicationService.GitHubClient.Repository.Content.CreateFile(\n                    _username, _repository, encodedPath, new Octokit.CreateFileRequest(message, content, _branch));\n\n                this.PresentingViewController?.DismissViewController(true, null);\n\n                _successSubject.OnNext(result);\n            }\n            catch (Octokit.ApiException ex)\n            {\n                var errorMessage = ex.Message;\n                if (ex.ApiError?.DocumentationUrl == \"https://developer.github.com/v3/repos/contents/#update-a-file\")\n                    errorMessage = \"A file with that name already exists!\";\n\n                AlertDialogService.ShowAlert(\"Error\", errorMessage);\n            }\n            catch (Exception ex)\n            {\n                AlertDialogService.ShowAlert(\"Error\", ex.Message);\n            }\n            finally\n            {\n                UIApplication.SharedApplication.EndIgnoringInteractionEvents();\n                NetworkActivity.PopNetworkActive();\n                hud.Hide();\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/BranchesAndTagsViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class BranchesAndTagsViewController : BaseViewController\n    {\n        private readonly UISegmentedControl _viewSegment = new UISegmentedControl(new object[] { \"Branches\", \"Tags\" });\n        private readonly BranchesViewController _branchesViewController;\n        private readonly TagsViewController _tagsViewController;\n\n        public IObservable<Octokit.Branch> BranchSelected => _branchesViewController.BranchSelected;\n        public IObservable<Octokit.RepositoryTag> TagSelected => _tagsViewController.TagSelected;\n\n        public enum SelectedView\n        {\n            Branches = 0,\n            Tags\n        }\n\n        public BranchesAndTagsViewController(\n            string username,\n            string repository,\n            SelectedView selectedView = SelectedView.Branches)\n        {\n            _branchesViewController = new BranchesViewController(username, repository);\n            _tagsViewController = new TagsViewController(username, repository);\n\n            OnActivation(d =>\n            {\n                d(_viewSegment\n                  .GetChangedObservable()\n                  .Subscribe(SegmentValueChanged));\n            });\n\n            Appearing\n                .Take(1)\n                .Select(_ => (int)selectedView)\n                .Do(x => _viewSegment.SelectedSegment = x)\n                .Do(SegmentValueChanged)\n                .Subscribe();\n\n            NavigationItem.TitleView = _viewSegment;\n        }\n\n        private void SegmentValueChanged(int id)\n        {\n            if (id == 0)\n            {\n                Title = \"Branches\";\n                AddTable(_branchesViewController);\n                RemoveIfLoaded(_tagsViewController);\n            }\n            else\n            {\n                Title = \"Tags\";\n                AddTable(_tagsViewController);\n                RemoveIfLoaded(_branchesViewController);\n            }\n        }\n\n        private void AddTable(UIViewController viewController)\n        {\n            viewController.View.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);\n            AddChildViewController(viewController);\n            Add(viewController.View);\n        }\n\n        private static void RemoveIfLoaded(UIViewController viewController)\n        {\n            viewController.RemoveFromParentViewController();\n            viewController.ViewIfLoaded?.RemoveFromSuperview();\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/BranchesViewController.cs",
    "content": "﻿using System;\nusing CodeHub.Core.Services;\nusing UIKit;\nusing Splat;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing CodeHub.iOS.DialogElements;\nusing System.Collections.Generic;\nusing CodeHub.Core;\nusing System.Linq;\nusing System.Reactive;\nusing CodeHub.iOS.Views;\nusing System.Threading.Tasks;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class BranchesViewController : DialogViewController\n    {\n        private static string LoadErrorMessage = \"Unable to load branches.\";\n        private readonly ISubject<Octokit.Branch> _branchSubject = new Subject<Octokit.Branch>();\n\n        public IObservable<Octokit.Branch> BranchSelected => _branchSubject.AsObservable();\n\n        private ReactiveCommand<Unit, IReadOnlyList<Octokit.Branch>> LoadBranches { get; }\n\n        public BranchesViewController(\n            string username,\n            string repository,\n            IReadOnlyList<Octokit.Branch> branches = null,\n            IApplicationService applicationService = null)\n            : base(UITableViewStyle.Plain)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            Title = \"Branches\";\n\n            LoadBranches = ReactiveCommand.CreateFromTask(() =>\n            {\n                if (branches != null)\n                    return Task.FromResult(branches);\n                return applicationService.GitHubClient.Repository.Branch.GetAll(username, repository);\n            });\n\n            LoadBranches\n                .ThrownExceptions\n                .Do(_ => SetErrorView())\n                .Select(error => new UserError(LoadErrorMessage, error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            LoadBranches\n                .Do(_ => TableView.TableFooterView = null)\n                .Subscribe(ItemsLoaded);\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .Do(_ => TableView.TableFooterView = new LoadingIndicatorView())\n                .InvokeReactiveCommand(LoadBranches);\n        }\n\n        private void SetErrorView()\n        {\n            var emptyListView = new EmptyListView(Octicon.GitBranch.ToEmptyListImage(), LoadErrorMessage)\n            {\n                Alpha = 0\n            };\n\n            TableView.TableFooterView = new UIView();\n            TableView.BackgroundView = emptyListView;\n\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => emptyListView.Alpha = 1, null);\n        }\n\n        private void ItemsLoaded(IEnumerable<Octokit.Branch> branches)\n        {\n            var items = branches.Select(CreateElement);\n            Root.Reset(new Section { items });\n        }\n\n        private Element CreateElement(Octokit.Branch branch)\n        {\n            var e = new StringElement(branch.Name);\n            e.Clicked.Subscribe(_ => _branchSubject.OnNext(branch));\n            return e;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/CommitDiffViewController.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.WebViews;\nusing Humanizer;\nusing Newtonsoft.Json;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\nusing WebKit;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class CommitDiffViewController : BaseWebViewController\n    {\n        private readonly IApplicationService _applicationService;\n        private readonly INetworkActivityService _networkActivityService;\n        private readonly IMarkdownService _markdownService;\n        private readonly string _username;\n        private readonly string _repository;\n        private readonly string _path;\n        private readonly string _patch;\n        private readonly string _commit;\n\n        private readonly ReactiveList<Octokit.CommitComment> _comments\n            = new ReactiveList<Octokit.CommitComment>();\n\n        public CommitDiffViewController(\n            string username,\n            string repository,\n            string commit,\n            string path,\n            string patch,\n            IApplicationService applicationService = null,\n            INetworkActivityService networkActivityService = null,\n            IMarkdownService markdownService = null)\n            : base(false)\n        {\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            _networkActivityService = networkActivityService ?? Locator.Current.GetService<INetworkActivityService>();\n            _markdownService = markdownService ?? Locator.Current.GetService<IMarkdownService>();\n            _username = username;\n            _repository = repository;\n            _path = path;\n            _patch = patch;\n            _commit = commit;\n\n            Title = string.IsNullOrEmpty(_path) ? \"Diff\" : System.IO.Path.GetFileName(_path);\n\n            var loadComments = ReactiveCommand.CreateFromTask(\n                _ => _applicationService.GitHubClient.Repository.Comment.GetAllForCommit(_username, _repository, _commit));\n\n            loadComments\n                .ThrownExceptions\n                .Select(error => new UserError(\"Unable to load comments.\", error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            loadComments\n                .Subscribe(comments => _comments.Reset(comments));\n\n            var loadAll = ReactiveCommand.CreateCombined(new[] { loadComments });\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .InvokeReactiveCommand(loadAll);\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Observable\n                .Return(Unit.Default)\n                .Merge(_comments.Changed.Select(_ => Unit.Default))\n                .Do(_ => Render())\n                .Subscribe();\n        }\n\n        private async Task Render()\n        {\n            var comments = new List<DiffCommentModel>();\n            foreach (var comment in _comments.Where(x => string.Equals(x.Path, _path)))\n            {\n                comments.Add(new DiffCommentModel\n                {\n                    Id = comment.Id,\n                    GroupId = comment.Id,\n                    Username = comment.User.Login,\n                    AvatarUrl = comment.User.AvatarUrl,\n                    LineTo = comment.Position,\n                    LineFrom = comment.Position,\n                    Body = await _markdownService.Convert(comment.Body),\n                    Date = comment.CreatedAt.Humanize()\n                });\n            }\n\n            var diffModel = new DiffModel(\n                _patch.Split('\\n'),\n                comments,\n                (int)UIFont.PreferredSubheadline.PointSize);\n\n            var diffView = new DiffWebView { Model = diffModel };\n            LoadContent(diffView.GenerateString());\n        }\n\n        private class JavascriptComment\n        {\n            public int PatchLine { get; set; }\n            public int FileLine { get; set; }\n        }\n\n        private class JavascriptReplyComment\n        {\n            public int Id { get; set; }\n        }\n\n        protected override bool ShouldStartLoad(WKWebView webView, WKNavigationAction navigationAction)\n        {\n            var url = navigationAction.Request.Url;\n            if (url.Scheme.Equals(\"app\"))\n            {\n                var func = url.Host;\n                if (func.Equals(\"comment\"))\n                {\n                    var commentModel = JsonConvert.DeserializeObject<JavascriptComment>(UrlDecode(url.Fragment));\n                    PromptForComment(commentModel);\n                }\n                else if (func.Equals(\"reply-to\"))\n                {\n                    var commentModel = JsonConvert.DeserializeObject<JavascriptReplyComment>(UrlDecode(url.Fragment));\n                    ShowCommentComposer(commentModel.Id);\n                }\n\n                return false;\n            }\n\n            return base.ShouldStartLoad(webView, navigationAction);\n        }\n\n        private void PromptForComment(JavascriptComment model)\n        {\n            var title = \"Line \" + model.PatchLine;\n            var sheet = new UIActionSheet(title);\n            var addButton = sheet.AddButton(\"Add Comment\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (sender, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == addButton)\n                        ShowCommentComposer(model.FileLine);\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowInView(this.View);\n        }\n\n        private void ShowCommentComposer(int line)\n        {\n            ShowComposer(async text =>\n            {\n                var commentOptions = new Octokit.NewCommitComment(text)\n                {\n                    Path = _path,\n                    Position = line\n                };\n\n                var comment = await _applicationService.GitHubClient.Repository.Comment.Create(\n                    _username, _repository, _commit, commentOptions);\n                _comments.Add(comment);\n            });\n        }\n\n        private void ShowComposer(Func<string, Task> workFn)\n        {\n            var composer = new MarkdownComposerViewController();\n            composer.PresentAsModal(this, async text =>\n            {\n                var hud = composer.CreateHud();\n\n                using (UIApplication.SharedApplication.DisableInteraction())\n                using (_networkActivityService.ActivateNetwork())\n                using (hud.Activate(\"Commenting...\"))\n                {\n                    try\n                    {\n                        await workFn(text);\n                        composer.DismissViewController(true, null);\n                    }\n                    catch (Exception e)\n                    {\n                        AlertDialogService.ShowAlert(\"Unable to Comment\", e.Message);\n                    }\n                }\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/FileSourceViewController.cs",
    "content": "﻿using System;\r\nusing System.Linq;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing System.Threading;\nusing System.Threading.Tasks;\r\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.Source;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.Views.Source;\nusing CodeHub.WebViews;\nusing Foundation;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class FileSourceViewController : BaseWebViewController\n    {\r\n        private static readonly string[] MarkdownExtensions = { \".markdown\", \".mdown\", \".mkdn\", \".md\", \".mkd\", \".mdwn\", \".mdtxt\", \".mdtext\", \".text\" };\r\n\r\n        private readonly IApplicationService _applicationService;\r\n        private readonly IAlertDialogService _alertDialogService;\n        private readonly string _username;\n        private readonly string _repository;\n        private readonly string _sha;\n        private readonly ShaType _shaType;\n        private readonly string _path;\n        private readonly bool _forceBinary;\r\n        private readonly bool _isMarkdown;\r\n        private IDisposable _messageBus;\r\n\r\n        private Octokit.RepositoryContent _content;\r\n        public Octokit.RepositoryContent Content\r\n        {\r\n            get { return _content; }\r\n            set { this.RaiseAndSetIfChanged(ref _content, value); }\r\n        }\r\n\r\n        private string _contentSavePath;\r\n        public string ContentSavePath\r\n        {\r\n            get { return _contentSavePath; }\r\n            set { this.RaiseAndSetIfChanged(ref _contentSavePath, value); }\r\n        }\r\n\r\n        private bool _canEdit;\r\n        public bool CanEdit\r\n        {\r\n            get { return _canEdit; }\r\n            set { this.RaiseAndSetIfChanged(ref _canEdit, value); }\r\n        }\r\n\n        public FileSourceViewController(\n            string username,\n            string repository,\n            string path,\n            string sha,\n            ShaType shaType,\r\n            bool forceBinary = false,\r\n            IApplicationService applicationService = null,\r\n            IAlertDialogService alertDialogService = null,\r\n            IMessageService messageService = null)\r\n            : base(false)\n        {\r\n            _username = username;\r\n            _repository = repository;\r\n            _path = path;\r\n            _sha = sha;\r\n            _shaType = shaType;\r\n            _forceBinary = forceBinary;\n            _applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\r\n            _alertDialogService = alertDialogService ?? Locator.Current.GetService<IAlertDialogService>();\r\n            messageService = messageService ?? Locator.Current.GetService<IMessageService>();\r\n\r\n            Title = System.IO.Path.GetFileName(path);\r\n\r\n            var extension = System.IO.Path.GetExtension(path);\r\n            _isMarkdown = MarkdownExtensions.Contains(extension);\r\n\r\n            var actionButton = new UIBarButtonItem(UIBarButtonSystemItem.Action) { Enabled = false };\r\n            NavigationItem.RightBarButtonItem = actionButton;\r\n\r\n            var loadCommand = ReactiveCommand.CreateFromTask(Load);\r\n\r\n            loadCommand\r\n                .ThrownExceptions\r\n                .Select(HandleLoadError)\r\n                .SelectMany(Interactions.Errors.Handle)\r\n                .Subscribe();\r\n\r\n            this.OnActivation(d =>\r\n            {\n                d(this.WhenAnyValue(x => x.Content)\r\n                  .Select(x => x != null)\r\n                  .Subscribe(x => actionButton.Enabled = x));\r\n\r\n                d(actionButton\r\n                  .GetClickedObservable()\r\n                  .Subscribe(CreateActionSheet));\r\n\r\n                d(loadCommand\r\n                  .IsExecuting\r\n                  .Subscribe(x => actionButton.Enabled = !x));\r\n            });\r\n\r\n            Appearing\r\n                .Take(1)\r\n                .Select(_ => Unit.Default)\r\n                .InvokeReactiveCommand(loadCommand);\r\n\r\n            _messageBus = messageService.Listen<Core.Messages.SourceEditMessage>(_ =>\r\n            {\n                Content = null;\r\n                loadCommand.ExecuteNow();\n            });\r\n        }\r\n\r\n        private UserError HandleLoadError(Exception error)\r\n        {\r\n            LoadContent(\"\");\r\n            return new UserError(\"Unable to load selected file.\", error);\r\n        }\r\n\r\n        private async Task Load(CancellationToken cancelToken)\r\n        {\r\n            CanEdit = false;\r\n\r\n            if (Content == null)\r\n            {\r\n                var encodedShaRef = System.Net.WebUtility.UrlEncode(_sha);\r\n                var encodedPath = _path == null ? null : Uri.EscapeDataString(_path);\r\n\n                var items = await _applicationService\n                    .GitHubClient.Repository.Content\n                    .GetAllContentsByRef(_username, _repository, encodedPath, encodedShaRef);\n                Content = items.First();\r\n            }\r\n\r\n            var repo = await _applicationService\r\n                .GitHubClient.Repository.Get(_username, _repository);\r\n\r\n            var fileName = System.IO.Path.GetFileName(Content.Name);\r\n            ContentSavePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), fileName);\r\n\r\n            var mime = string.Empty;\r\n            using (var stream = new System.IO.FileStream(ContentSavePath, System.IO.FileMode.Create, System.IO.FileAccess.Write))\r\n                mime = await _applicationService.Client.DownloadRawResource2(Content.GitUrl, stream) ?? string.Empty;\r\n\r\n            var isBinary = _forceBinary || !mime.Contains(\"charset\");\r\n            if (isBinary)\r\n            {\r\n                LoadFile(ContentSavePath);\r\n            }\r\n            else\r\n            {\r\n                CanEdit = repo.Permissions.Push && _shaType == ShaType.Branch; \r\n                await LoadSource(new Uri(\"file://\" + ContentSavePath), _isMarkdown);\r\n            }\r\n        }\r\n\r\n        private void EditSource()\r\n        {\r\n            var vc = new EditSourceView();\r\n            vc.ViewModel.Init(new EditSourceViewModel.NavObject { Path = _path, Branch = _sha, Username = _username, Repository = _repository });\r\n            vc.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\r\n            vc.NavigationItem.LeftBarButtonItem.Clicked += (sender, e) => DismissViewController(true, null);\r\n            PresentViewController(new ThemedNavigationController(vc), true, null);\r\n        }\n\n        async Task LoadSource(Uri fileUri, bool isMarkdown)\n        {\n            var fontSize = (int)UIFont.PreferredSubheadline.PointSize;\n            var content = await Task.Run(() => System.IO.File.ReadAllText(fileUri.LocalPath, System.Text.Encoding.UTF8));\r\n            await LoadSource(content, fileUri.LocalPath, isMarkdown);\n        }\r\n\r\n        async Task LoadSource(string content, string filename, bool isMarkdown)\r\n        {\r\n            var fontSize = (int)UIFont.PreferredSubheadline.PointSize;\r\n\r\n            if (isMarkdown)\r\n            {\r\n                var markdownContent = await _applicationService.Client.Markdown.GetMarkdown(content);\r\n                var model = new MarkdownModel(markdownContent, fontSize);\r\n                var htmlContent = new MarkdownWebView { Model = model };\r\n                LoadContent(htmlContent.GenerateString());\r\n            }\r\n            else\r\n            {\r\n                var zoom = UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Phone;\r\n                var theme = _applicationService.Account.CodeEditTheme;\r\n                var model = new SyntaxHighlighterModel(content, theme, fontSize, zoom, file: filename);\r\n                var contentView = new SyntaxHighlighterWebView { Model = model };\r\n                LoadContent(contentView.GenerateString());\r\n            }\r\n        }\r\n\r\n        private void PresentOpenIn(UIBarButtonItem barButtonItem)\r\n        {\r\n            if (ContentSavePath == null)\r\n                return;\r\n            \r\n            var ctrl = new UIDocumentInteractionController();\r\n            ctrl.Url = NSUrl.FromFilename(ContentSavePath);\r\n            ctrl.PresentOpenInMenu(barButtonItem, true);\r\n        }\r\n\r\n        private void Share(UIBarButtonItem barButtonItem)\r\n        {\r\n            var url = Content?.HtmlUrl;\r\n            if (url == null)\r\n                return;\r\n\r\n            AlertDialogService.Share(\r\n                Title,\r\n                url: Content?.HtmlUrl,\r\n                barButtonItem: barButtonItem);\r\n        }\r\n\r\n        private void ShowInBrowser()\r\n        {\r\n            var url = Content?.HtmlUrl;\r\n            if (url == null)\r\n                return;\n\n            var viewController = new WebBrowserViewController(url);\r\n            PresentViewController(viewController, true, null);\r\n        }\r\n\r\n        private void CreateActionSheet(UIBarButtonItem barButtonItem)\r\n        {\r\n            var sheet = new UIActionSheet();\r\n            sheet.Dismissed += (sender, e) => sheet.Dispose();\r\n\r\n            var editButton = CanEdit ? sheet.AddButton(\"Edit\") : -1;\r\n            var openButton = ContentSavePath != null ? sheet.AddButton(\"Open In\") : -1;\r\n            var shareButton = Content?.HtmlUrl != null ? sheet.AddButton(\"Share\") : -1;\r\n            var showButton = Content?.HtmlUrl != null ? sheet.AddButton(\"Show in GitHub\") : -1;\r\n            var cancelButton = sheet.AddButton(\"Cancel\");\r\n\r\n            sheet.CancelButtonIndex = cancelButton;\r\n            sheet.Dismissed += (sender, e) => BeginInvokeOnMainThread(() => {\r\n                try\r\n                {\n                    if (e.ButtonIndex == editButton)\n                        EditSource();\n                    if (e.ButtonIndex == openButton)\r\n                        PresentOpenIn(barButtonItem);\n                    else if (e.ButtonIndex == shareButton)\n                        Share(barButtonItem);\n                    else if (e.ButtonIndex == showButton)\n                        ShowInBrowser();\r\n                }\r\n                catch\r\n                {\r\n                }\r\n            });\r\n\r\n            sheet.ShowFrom(barButtonItem, true);\r\n        }\r\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/SourceTreeViewController.cs",
    "content": "﻿using System;\nusing System.Reactive.Linq;\nusing CodeHub.Core;\nusing CodeHub.Core.Services;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.Views;\nusing ReactiveUI;\nusing Splat;\nusing UIKit;\nusing System.Linq;\nusing System.Collections.Generic;\nusing CodeHub.Core.Utils;\nusing CodeHub.iOS.Utilities;\nusing Humanizer;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class SourceTreeViewController : DialogViewController\n    {\n        private static string LoadErrorMessage = \"Unable to load source tree.\";\n        private readonly SourceTitleView _titleView = new SourceTitleView();\n        private bool _branchSelectorShowsBranches = true;\n        private readonly string _username;\n        private readonly string _repository;\n        private readonly string _path;\n        private string _sha;\n\n        private readonly ReactiveCommand<Unit, Unit> _addFileCommand;\n        private readonly ReactiveCommand<string, IReadOnlyList<Octokit.RepositoryContent>> _loadContents;\n\n        private bool _canAddFile;\n        private bool CanAddFile\n        {\n            get { return _canAddFile; }\n            set { this.RaiseAndSetIfChanged(ref _canAddFile, value); }\n        }\n\n        private ShaType _shaType;\n        private ShaType ShaType\n        {\n            get { return _shaType; }\n            set { this.RaiseAndSetIfChanged(ref _shaType, value); }\n        }\n\n        public SourceTreeViewController(\n            string username,\n            string repository,\n            string path,\n            string sha,\n            ShaType shaType,\n            IApplicationService applicationService = null,\n            IFeaturesService featuresService = null)\n            : base(style: UITableViewStyle.Plain)\n        {\n            _username = username;\n            _repository = repository;\n            _path = path;\n            _sha = sha;\n            _shaType = shaType;\n\n            _addFileCommand = ReactiveCommand.Create(\n                ShowAddSource, \n                this.WhenAnyValue(x => x.CanAddFile, x => x.ShaType)\n                    .Select(x => x.Item1 && x.Item2 == ShaType.Branch));\n\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n            featuresService = featuresService ?? Locator.Current.GetService<IFeaturesService>();\n\n            _loadContents = ReactiveCommand.CreateFromTask(async (string shaRef) =>\n            {\n                if (ShaType == ShaType.Branch)\n                {\n                    var repo = await applicationService.GitHubClient.Repository.Get(username, repository);\n                    CanAddFile = repo.Permissions.Push;\n                }\n                else\n                {\n                    CanAddFile = false;\n                }\n\n                var encodedShaRef = System.Web.HttpUtility.UrlEncode(shaRef);\n\n                if (string.IsNullOrEmpty(path))\n                {\n                    return await applicationService\n                        .GitHubClient.Repository.Content\n                        .GetAllContentsByRef(username, repository, encodedShaRef);\n                }\n\n                var encodedPath = path == null ? null : Uri.EscapeDataString(path);\n\n                return await applicationService\n                    .GitHubClient.Repository.Content\n                    .GetAllContentsByRef(username, repository, encodedPath, encodedShaRef);\n            });\n\n            var addFileButton = new UIBarButtonItem(UIBarButtonSystemItem.Add);\n            NavigationItem.RightBarButtonItem = addFileButton;\n\n            _loadContents\n                .ThrownExceptions\n                .Do(_ => SetErrorView())\n                .Select(HandleLoadError)\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            OnActivation(d =>\n            {\n                d(_titleView\n                  .GetClickedObservable()\n                  .Subscribe(_ => ShowBranchSelector()));\n\n                d(_addFileCommand\n                  .CanExecute\n                  .Subscribe(x => addFileButton.Enabled = x));\n\n                d(addFileButton\n                  .GetClickedObservable()\n                  .Select(_ => Unit.Default)\n                  .InvokeReactiveCommand(_addFileCommand));\n            });\n\n            Appearing\n                .Select(_ => _sha)\n                .Where(x => !string.IsNullOrEmpty(x))\n                .DistinctUntilChanged()\n                .Do(_ => SetLoading(true))\n                .InvokeReactiveCommand(_loadContents);\n\n            _loadContents\n                .Do(_ => SetLoading(false))\n                .Subscribe(SetElements);\n\n            NavigationItem.TitleView = _titleView;\n        }\n\n        private void SetLoading(bool isLoading)\n        {\n            Root.Reset();\n            TableView.BackgroundView = null;\n            TableView.TableFooterView = isLoading ? new LoadingIndicatorView() : null;\n        }\n\n        private void SetErrorView()\n        {\n            var emptyListView = new EmptyListView(Octicon.Code.ToEmptyListImage(), LoadErrorMessage)\n            {\n                Alpha = 0\n            };\n\n            TableView.TableFooterView = new UIView();\n            TableView.BackgroundView = emptyListView;\n\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => emptyListView.Alpha = 1, null);\n        }\n\n        private UserError HandleLoadError(Exception error)\n        {\n            Root.Reset();\n\n            var apiException = error as Octokit.ApiException;\n            if (apiException?.StatusCode == System.Net.HttpStatusCode.NotFound)\n                return new UserError($\"The current directory does not exist under the selected Git reference ({_sha})\");\n\n            return new UserError(LoadErrorMessage, error);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            _titleView.SubText = ShaType == ShaType.Hash\n                ? _sha.Substring(0, Math.Min(_sha.Length, 7))\n                : _sha;\n\n            if (string.IsNullOrEmpty(_path))\n                _titleView.Text = _repository;\n            else\n            {\n                var path = _path.TrimEnd('/');\n                _titleView.Text = path.Substring(path.LastIndexOf('/') + 1);\n            }\n        }\n\n        private void SetElements(IEnumerable<Octokit.RepositoryContent> items)\n        {\n            var elements = items\n                .OrderByDescending(x => x.Type.Value != Octokit.ContentType.File || \n                                   (x.Type.Value == Octokit.ContentType.File && x.DownloadUrl == null))\n                .ThenBy(x => x.Name)\n                .Select(CreateElement);\n            \n            Root.Reset(new Section { elements });\n        }\n\n        private void ShowBranchSelector()\n        {\n            var view = _branchSelectorShowsBranches\n                ? BranchesAndTagsViewController.SelectedView.Branches\n                : BranchesAndTagsViewController.SelectedView.Tags;\n\n            var viewController = new BranchesAndTagsViewController(_username, _repository, view);\n\n            viewController.TagSelected.Take(1).Subscribe(tag =>\n            {\n                _sha = tag.Name;\n                ShaType = ShaType.Tag;\n                _branchSelectorShowsBranches = false;\n                this.DismissViewController(true, null);\n            });\n\n            viewController.BranchSelected.Take(1).Subscribe(branch =>\n            {\n                _sha = branch.Name;\n                ShaType = ShaType.Branch;\n                _branchSelectorShowsBranches = true;\n                this.DismissViewController(true, null);\n            });\n\n            this.PresentModalViewController(viewController);\n        }\n\n        private void GoToSourceTree(Octokit.RepositoryContent content)\n        {\n            this.PushViewController(new SourceTreeViewController(\n                _username, _repository, content.Path, _sha, ShaType));\n        }\n\n        private void GoToSubModule(Octokit.RepositoryContent content)\n        {\n            if (content == null)\n                return;\n\n            var gitUrl = content.GitUrl;\n            if (string.IsNullOrEmpty(gitUrl))\n                return;\n\n            var repoDelimIndex = gitUrl.IndexOf(\"/repos/\", StringComparison.Ordinal);\n            if (repoDelimIndex < 0 || repoDelimIndex + 7 > gitUrl.Length)\n                return;\n\n            var nameAndSlug = gitUrl.Substring(repoDelimIndex + 7);\n            var indexOfGit = nameAndSlug.LastIndexOf(\"/git\", StringComparison.Ordinal);\n            indexOfGit = indexOfGit < 0 ? 0 : indexOfGit;\n\n            var repoId = RepositoryIdentifier.FromFullName(nameAndSlug.Substring(0, indexOfGit));\n            if (repoId == null)\n                return;\n\n            var sha = gitUrl.Substring(gitUrl.LastIndexOf(\"/\", StringComparison.Ordinal) + 1);\n\n            this.PushViewController(new SourceTreeViewController(\n                repoId.Owner, repoId.Name, null, sha, ShaType.Hash));\n        }\n\n        private void GoToFile(Octokit.RepositoryContent content)\n        {\n            var viewController = new FileSourceViewController(\n                _username, _repository, content.Path, _sha, ShaType)\n            {\n                Content = content\n            };\n\n            this.PushViewController(viewController);\n        }\n\n        private void ShowAddSource()\n        {\n            var viewController = new AddSourceViewController(\n                _username, _repository, _path, _sha);\n\n            viewController\n                .Success\n                .Select(_ => _sha)\n                .InvokeReactiveCommand(_loadContents);\n\n            this.PresentModalViewController(viewController);\n        }\n\n        private Element CreateElement(Octokit.RepositoryContent content)\n        {\n            var weakRef = new WeakReference<SourceTreeViewController>(this);\n\n            if (content.Type == Octokit.ContentType.Dir)\n            {\n                var e = new StringElement(content.Name, Octicon.FileDirectory.ToImage());\n                e.Clicked.Subscribe(_ => weakRef.Get()?.GoToSourceTree(content));\n                return e;\n            }\n\n            if (content.Type == Octokit.ContentType.File)\n            {\n                if (content.DownloadUrl != null)\n                {\n                    var e = new StringElement(content.Name, Octicon.FileCode.ToImage());\n                    e.Style = UITableViewCellStyle.Subtitle;\n                    e.Value = content.Size.Bytes().ToString(\"#.#\");\n                    e.Clicked.Subscribe(_ => weakRef.Get()?.GoToFile(content));\n                    return e;\n                }\n                else\n                {\n                    var e = new StringElement(content.Name, Octicon.FileSubmodule.ToImage());\n                    e.Clicked.Subscribe(_ => weakRef.Get()?.GoToSubModule(content));\n                    return e;\n                }\n            }\n\n            return new StringElement(content.Name) { Image = Octicon.FileMedia.ToImage() };\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Source/TagsViewController.cs",
    "content": "﻿using System;\nusing CodeHub.Core.Services;\nusing UIKit;\nusing Splat;\nusing ReactiveUI;\nusing System.Reactive.Linq;\nusing System.Reactive.Subjects;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.Core;\nusing System.Reactive;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CodeHub.iOS.Views;\n\nnamespace CodeHub.iOS.ViewControllers.Source\n{\n    public class TagsViewController : DialogViewController\n    {\n        private static string LoadErrorMessage = \"Unable to load tags.\";\n        private readonly ISubject<Octokit.RepositoryTag> _tagSubject = new Subject<Octokit.RepositoryTag>();\n\n        public IObservable<Octokit.RepositoryTag> TagSelected => _tagSubject.AsObservable();\n\n        public TagsViewController(\n            string username,\n            string repository,\n            IApplicationService applicationService = null)\n            : base(UITableViewStyle.Plain)\n        {\n            applicationService = applicationService ?? Locator.Current.GetService<IApplicationService>();\n\n            var loadTags = ReactiveCommand.CreateFromTask(\n                () => applicationService.GitHubClient.Repository.GetAllTags(username, repository));\n\n            loadTags\n                .ThrownExceptions\n                .Do(_ => SetErrorView())\n                .Select(error => new UserError(LoadErrorMessage, error))\n                .SelectMany(Interactions.Errors.Handle)\n                .Subscribe();\n\n            loadTags\n                .Do(_ => TableView.TableFooterView = null)\n                .Subscribe(ItemsLoaded);\n\n            Appearing\n                .Take(1)\n                .Select(_ => Unit.Default)\n                .Do(_ => TableView.TableFooterView = new LoadingIndicatorView())\n                .InvokeReactiveCommand(loadTags);\n        }\n\n        private void SetErrorView()\n        {\n            var emptyListView = new EmptyListView(Octicon.Tag.ToEmptyListImage(), LoadErrorMessage)\n            {\n                Alpha = 0\n            };\n\n            TableView.TableFooterView = new UIView();\n            TableView.BackgroundView = emptyListView;\n\n            UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                           () => emptyListView.Alpha = 1, null);\n        }\n\n        private void ItemsLoaded(IEnumerable<Octokit.RepositoryTag> tags)\n        {\n            var items = tags.Select(CreateElement);\n            Root.Reset(new Section { items });\n        }\n\n        private Element CreateElement(Octokit.RepositoryTag tag)\n        {\n            var e = new StringElement(tag.Name);\n            e.Clicked.Subscribe(_ => _tagSubject.OnNext(tag));\n            return e;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/TableViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing CoreGraphics;\nusing Foundation;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class TableViewController : BaseViewController\n    {\n        private readonly Lazy<UITableView> _tableView;\n        private UIRefreshControl _refreshControl;\n\n        public UITableView TableView => _tableView.Value;\n\n        public bool ClearSelectionOnAppear { get; set; } = true;\n\n        public virtual UIRefreshControl RefreshControl\n        {\n            get { return _refreshControl; }\n            set\n            {\n                _refreshControl?.RemoveFromSuperview();\n                _refreshControl = value;\n\n                if (_refreshControl != null)\n                    TableView.AddSubview(_refreshControl);\n            }\n        }\n\n        public TableViewController(UITableViewStyle style)\n        {\n            _tableView = new Lazy<UITableView>(() => new UITableView(CGRect.Empty, style));\n\n            NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = string.Empty };\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.Frame = View.Bounds;\n            TableView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin;\n            TableView.AutosizesSubviews = true;\n            TableView.CellLayoutMarginsFollowReadableWidth = false;\n            TableView.EstimatedSectionFooterHeight = 0;\n            TableView.EstimatedSectionHeaderHeight = 0;\n            Add(TableView);\n        }\n\n        NSObject _hideNotification, _showNotification;\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            _hideNotification = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, OnKeyboardHideNotification);\n            _showNotification = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillShowNotification, OnKeyboardNotification);\n\n            var index = TableView.IndexPathForSelectedRow;\n            if (ClearSelectionOnAppear && index != null)\n                TableView.DeselectRow(index, true);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n\n            View.EndEditing(true);\n            \n            if (_hideNotification != null)\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_hideNotification);\n            if (_showNotification != null)\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_showNotification);\n        }\n\n        private void OnKeyboardHideNotification(NSNotification notification)\n        {\n            TableView.ContentInset = UIEdgeInsets.Zero;\n            TableView.ScrollIndicatorInsets = UIEdgeInsets.Zero;\n        }\n\n        private void OnKeyboardNotification (NSNotification notification)\n        {\n            var keyboardFrame = UIKeyboard.FrameEndFromNotification (notification);\n            var inset = new UIEdgeInsets(0, 0, keyboardFrame.Height, 0);\n            TableView.ContentInset = inset;\n            TableView.ScrollIndicatorInsets = inset;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/ThemedNavigationController.cs",
    "content": "﻿using UIKit;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class ThemedNavigationController : UINavigationController\n    {\n        public ThemedNavigationController(UIViewController ctrl)\n            : base(ctrl)\n        {\n            ModalPresentationStyle = ctrl.ModalPresentationStyle;\n            ModalTransitionStyle = ctrl.ModalTransitionStyle;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Users/UserViewController.cs",
    "content": "using CodeHub.iOS.ViewControllers;\nusing CodeHub.Core.ViewModels.User;\nusing UIKit;\nusing System;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.ViewControllers.Gists;\n\nnamespace CodeHub.iOS.ViewControllers.Users\n{\n    public class UserViewController : PrettyDialogViewController\n    {\n        private readonly Lazy<UIBarButtonItem> _actionButton;\n\n        public new UserViewModel ViewModel\n        {\n            get { return (UserViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        public UserViewController(string username, Octokit.User user = null)\n            : this()\n        {\n            ViewModel = new UserViewModel();\n            ViewModel.Init(new UserViewModel.NavObject { Username = username });\n            ViewModel.User = user;\n        }\n\n        public UserViewController(Octokit.User user)\n            : this(user.Login, user)\n        {\n        }\n\n        public UserViewController()\n        {\n            _actionButton = new Lazy<UIBarButtonItem>(() =>\n                new UIBarButtonItem(UIBarButtonSystemItem.Action, (s, e) => ShowExtraMenu()));\n        }\n            \n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            HeaderView.SetImage(null, Images.Avatar);\n            HeaderView.Text = ViewModel.Username;\n\n            var split = new SplitButtonElement();\n            var followers = split.AddButton(\"Followers\", \"-\");\n            var following = split.AddButton(\"Following\", \"-\");\n\n            var events = new StringElement(\"Events\", Octicon.Rss.ToImage());\n            var organizations = new StringElement(\"Organizations\", Octicon.Organization.ToImage());\n            var repos = new StringElement(\"Repositories\", Octicon.Repo.ToImage());\n            var gists = new StringElement(\"Gists\", Octicon.Gist.ToImage());\n            Root.Add(new [] { new Section { split }, new Section { events, organizations, repos, gists } });\n\n            ViewModel.Bind(x => x.User).Subscribe(x => {\n                followers.Text = x?.Followers.ToString() ?? \"-\";\n                following.Text = x?.Following.ToString() ?? \"-\";\n                HeaderView.SubText = string.IsNullOrWhiteSpace(x?.Name) ? null : x.Name;\n                HeaderView.SetImage(x?.AvatarUrl, Images.Avatar);\n                RefreshHeaderView();\n            });\n\n            OnActivation(d =>\n            {\n                d(followers.Clicked\n                  .Select(x => UsersViewController.CreateFollowersViewController(ViewModel.Username))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(following.Clicked\n                  .Select(x => UsersViewController.CreateFollowingViewController(ViewModel.Username))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n               \n                d(events.Clicked.BindCommand(ViewModel.GoToEventsCommand));\n                d(organizations.Clicked.BindCommand(ViewModel.GoToOrganizationsCommand));\n\n                d(gists.Clicked\n                  .Select(x => GistsViewController.CreateUserGistsViewController(ViewModel.Username))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.Bind(x => x.Title, true).Subscribe(x => Title = x));\n\n                d(repos.Clicked.Subscribe(_ =>\n                {\n                    var vc = Repositories.RepositoriesViewController.CreateUserViewController(ViewModel.Username);\n                    NavigationController?.PushViewController(vc, true);\n                }));\n            });\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            if (!ViewModel.IsLoggedInUser)\n                NavigationItem.RightBarButtonItem = _actionButton.Value;\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            NavigationItem.RightBarButtonItem = null;\n        }\n\n        private void ShowExtraMenu()\n        {\n            var sheet = new UIActionSheet();\n            var followButton = sheet.AddButton(ViewModel.IsFollowing ? \"Unfollow\" : \"Follow\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (s, e) => {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == followButton)\n                    {\n                        ViewModel.ToggleFollowingCommand.Execute(null);\n                    }\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowInView(this.View);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Users/UsersViewController.cs",
    "content": "﻿using System;\nusing System.Reactive;\nusing System.Reactive.Linq;\nusing CodeHub.Core.ViewModels.Users;\nusing CodeHub.iOS.TableViewSources;\nusing CodeHub.iOS.Views;\nusing CoreGraphics;\nusing ReactiveUI;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Users\n{\n    public class UsersViewController : TableViewController\n    {\n        private readonly UISearchBar _repositorySearchBar = new UISearchBar(new CGRect(0, 0, 320, 44));\n        private readonly LoadingIndicatorView _loading = new LoadingIndicatorView();\n\n        private readonly Lazy<UIView> emptyView = new Lazy<UIView>((() =>\n            new EmptyListView(Octicon.Person.ToEmptyListImage(), \"There are no users.\")));\n\n        public UsersViewModel ViewModel { get; }\n\n        public static UsersViewController CreateWatchersViewController(string owner, string name)\n        {\n            var viewModel = UsersViewModel.CreateWatchersViewModel(owner, name);\n            return new UsersViewController(viewModel) { Title = \"Watchers\" };\n        }\n\n        public static UsersViewController CreateFollowersViewController(string username)\n        {\n            var viewModel = UsersViewModel.CreateFollowersViewModel(username);\n            return new UsersViewController(viewModel) { Title = \"Followers\" };\n        }\n\n        public static UsersViewController CreateFollowingViewController(string username)\n        {\n            var viewModel = UsersViewModel.CreateFollowingViewModel(username);\n            return new UsersViewController(viewModel) { Title = \"Following\" };\n        }\n\n        public static UsersViewController CreateOrganizationMembersViewController(string organization)\n        {\n            var viewModel = UsersViewModel.CreateOrgMembersViewModel(organization);\n            return new UsersViewController(viewModel) { Title = \"Members\" };\n        }\n\n        public static UsersViewController CreateStargazersViewController(string username, string repository)\n        {\n            var viewModel = UsersViewModel.CreateStargazersViewModel(username, repository);\n            return new UsersViewController(viewModel) { Title = \"Stargazers\" };\n        }\n\n        public static UsersViewController CreateTeamMembersViewController(int id)\n        {\n            var viewModel = UsersViewModel.CreateTeamMembersViewModel(id);\n            return new UsersViewController(viewModel) { Title = \"Members\" };\n        }\n\n        public static UsersViewController CreateCollaboratorsViewController(string username, string repository)\n        {\n            var viewModel = UsersViewModel.CreateCollaboratorsViewModel(username, repository);\n            return new UsersViewController(viewModel) { Title = \"Collaborators\" };\n        }\n\n        public UsersViewController(UsersViewModel viewModel)\n            : base(UITableViewStyle.Plain)\n        {\n            ViewModel = viewModel;\n            Title = \"Users\";\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var tableViewSource = new UserTableViewSource(TableView, ViewModel.Items);\n            TableView.Source = tableViewSource;\n\n            Appearing\n                .Take(1)\n                .Select(_ => ViewModel.LoadCommand.Execute())\n                .Switch()\n                .Take(1)\n                .Catch(Observable.Return(false))\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Subscribe(SetItemsPresent);\n\n            this.WhenActivated(d =>\n            {\n                d(_repositorySearchBar.GetChangedObservable()\n                  .Subscribe(x => ViewModel.SearchText = x));\n\n                d(ViewModel.ItemSelected\n                  .Select(x => new UserViewController(x.User))\n                  .Subscribe(x => NavigationController.PushViewController(x, true)));\n\n                d(ViewModel.WhenAnyValue(x => x.HasMore)\n                  .Subscribe(x => TableView.TableFooterView = x ? _loading : null));\n\n                d(tableViewSource.RequestMore\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand\n                  .Select(_ => ViewModel.Items.Changed)\n                  .Switch()\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n\n                d(ViewModel.LoadCommand.Merge(ViewModel.LoadMoreCommand)\n                  .Select(_ => Unit.Default)\n                  .Throttle(TimeSpan.FromMilliseconds(100), RxApp.MainThreadScheduler)\n                  .Where(_ => TableView.LastItemVisible())\n                  .InvokeReactiveCommand(ViewModel.LoadMoreCommand));\n            });\n        }\n\n        private void SetItemsPresent(bool hasItems)\n        {\n            TableView.TableHeaderView = hasItems ? _repositorySearchBar : null;\n            TableView.SeparatorStyle = hasItems \n                ? UITableViewCellSeparatorStyle.SingleLine \n                : UITableViewCellSeparatorStyle.None;\n\n            if (hasItems)\n            {\n                TableView.BackgroundView = null;\n            }\n            else\n            {\n                emptyView.Value.Alpha = 0;\n                TableView.BackgroundView = emptyView.Value;\n                UIView.Animate(0.8, 0, UIViewAnimationOptions.CurveEaseIn,\n                               () => emptyView.Value.Alpha = 1, null);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/ViewModelCollectionDrivenDialogViewController.cs",
    "content": "using System;\nusing System.Linq;\nusing CodeHub.Core.ViewModels;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.ViewControllers;\nusing UIKit;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.DialogElements;\nusing Foundation;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class ViewModelCollectionDrivenDialogViewController : ViewModelDrivenDialogViewController\n    {\n        private static NSObject _dumb = new NSObject();\n\n        public Lazy<UIView> EmptyView { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the class.\n        /// </summary>\n        /// <param name='push'>True if navigation controller should push, false if otherwise</param>\n        protected ViewModelCollectionDrivenDialogViewController(bool push = true)\n            : base(push, UITableViewStyle.Plain)\n        {\n            EnableSearch = true;\n        }\n\n        protected void BindCollection<TElement>(CollectionViewModel<TElement> viewModel, \n                                                Func<TElement, Element> element, bool activateNow = false)\n        {\n            var weakVm = new WeakReference<CollectionViewModel<TElement>>(viewModel);\n            var weakRoot = new WeakReference<RootElement>(Root);\n\n            Action updateDel = () =>\n            {\n                try\n                {\n                    IEnumerable<TElement> items = viewModel.Items;\n                    var filterFn = viewModel.FilteringFunction;\n                    if (filterFn != null)\n                        items = filterFn(items);\n\n                    var sortFn = viewModel.SortingFunction;\n                    if (sortFn != null)\n                        items = sortFn(items);\n\n                    var groupingFn = viewModel.GroupingFunction;\n                    IEnumerable<IGrouping<string, TElement>> groupedItems = null;\n                    if (groupingFn != null)\n                        groupedItems = groupingFn(items);\n\n                    ICollection<Section> newSections;\n                    if (groupedItems == null)\n                        newSections = RenderList(items, element, weakVm.Get()?.MoreItems);\n                    else\n                        newSections = RenderGroupedItems(groupedItems, element, weakVm.Get()?.MoreItems);\n\n                    CreateEmptyHandler(newSections.Sum(s => s.Elements.Count) == 0);\n                    weakRoot.Get()?.Reset(newSections);\n                }\n                catch\n                {\n                }\n            };\n\n            viewModel.Bind(x => x.GroupingFunction).Subscribe(_ => updateDel());\n            viewModel.Bind(x => x.FilteringFunction).Subscribe(_ => updateDel());\n            viewModel.Bind(x => x.SortingFunction).Subscribe(_ => updateDel());\n\n            //The CollectionViewModel binds all of the collection events from the observablecollection + more\n            //So just listen to it.\n            viewModel.CollectionChanged += (sender, e) => _dumb.InvokeOnMainThread(updateDel);\n\n            if (activateNow)\n                updateDel();\n        }\n\n        private void CreateEmptyHandler(bool x)\n        {\n            if (EmptyView == null)\n            {\n                return;\n            }\n            if (x)\n            {\n                if (!EmptyView.IsValueCreated)\n                {\n                    EmptyView.Value.Alpha = 0f;\n                    TableView.AddSubview(EmptyView.Value);\n                }\n\n                EmptyView.Value.UserInteractionEnabled = true;\n                EmptyView.Value.Frame = new CGRect(0, 0, TableView.Bounds.Width, TableView.Bounds.Height);\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;\n                TableView.BringSubviewToFront(EmptyView.Value);\n                if (TableView.TableHeaderView != null)\n                    TableView.TableHeaderView.Hidden = true;\n                UIView.Animate(0.2f, 0f, UIViewAnimationOptions.AllowUserInteraction | UIViewAnimationOptions.CurveEaseIn | UIViewAnimationOptions.BeginFromCurrentState,\n                    () => EmptyView.Value.Alpha = 1.0f, null);\n            }\n            else if (EmptyView.IsValueCreated)\n            {\n                EmptyView.Value.UserInteractionEnabled = false;\n                if (TableView.TableHeaderView != null)\n                    TableView.TableHeaderView.Hidden = false;\n                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;\n                UIView.Animate(0.1f, 0f, UIViewAnimationOptions.AllowUserInteraction | UIViewAnimationOptions.CurveEaseIn | UIViewAnimationOptions.BeginFromCurrentState,\n                    () => EmptyView.Value.Alpha = 0f, null);\n            }\n        }\n\n        protected ICollection<Section> RenderList<T>(IEnumerable<T> items, Func<T, Element> select, Action moreAction)\n        {\n            items = items ?? Enumerable.Empty<T>();\n            var sec = new Section();\n            sec.AddAll(items.Select(item =>\n            {\n                try\n                {\n                    return @select(item);\n                }\n                catch\n                {\n                    return null;\n                }\n            }).Where(x => x != null));\n\n            return RenderSections(new [] { sec }, moreAction);\n        }\n\n        protected virtual Section CreateSection(string text)\n        {\n            return new Section(text);\n        }\n\n        protected ICollection<Section> RenderGroupedItems<T>(IEnumerable<IGrouping<string, T>> items, Func<T, Element> select, Action moreAction)\n        {\n            var sections = new List<Section>();\n\n            if (items != null)\n            {\n                foreach (var grp in items.ToList())\n                {\n                    try\n                    {\n                        var sec = CreateSection(grp.Key);\n                        foreach (var element in grp.Select(select).Where(element => element != null))\n                            sec.Add(element);\n\n                        if (sec.Elements.Count > 0)\n                            sections.Add(sec);\n                    }\n                    catch \n                    {\n                    }\n                }\n            }\n\n            return RenderSections(sections, moreAction);\n        }\n\n        private static ICollection<Section> RenderSections(IEnumerable<Section> sections, Action moreAction)\n        {\n            var weakAction = new WeakReference<Action>(moreAction);\n            ICollection<Section> newSections = new LinkedList<Section>(sections);\n\n            if (moreAction != null)\n            {\n                var loadMore = new PaginateElement(\"Load More\", \"Loading...\") { AutoLoadOnVisible = true };\n                newSections.Add(new Section { loadMore });\n                loadMore.Tapped += async (obj) =>\n                {\n                    try\n                    {\n                        NetworkActivity.PushNetworkActive();\n\n                        var a = weakAction.Get();\n                        if (a != null)\n                            await Task.Run(a);\n\n                        var root = loadMore.GetRootElement();\n                        root?.Remove(loadMore.Section, UITableViewRowAnimation.Fade);\n                    }\n                    catch (Exception e)\n                    {\n                        AlertDialogService.ShowAlert(\"Unable to load more!\", e.Message);\n                    }\n                    finally\n                    {\n                        NetworkActivity.PopNetworkActive();\n                    }\n\n                };    \n            }\n\n            return newSections;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/ViewModelDrivenDialogViewController.cs",
    "content": "using System;\nusing MvvmCross.Core.ViewModels;\nusing CodeHub.iOS.ViewControllers;\nusing UIKit;\nusing CodeHub.Core.ViewModels;\nusing CodeHub.iOS.Views;\nusing MvvmCross.Platform.iOS.Views;\nusing MvvmCross.iOS.Views;\nusing MvvmCross.Binding.BindingContext;\nusing MvvmCross.Platform.Core;\nusing CodeHub.iOS.Utilities;\nusing System.Linq;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public abstract class PrettyDialogViewController : ViewModelDrivenDialogViewController\n    {\n        protected readonly SlideUpTitleView SlideUpTitle;\n        protected readonly ImageAndTitleHeaderView HeaderView;\n        private readonly UIView _backgroundHeaderView;\n\n        public override string Title\n        {\n            get\n            {\n                return base.Title;\n            }\n            set\n            {\n                HeaderView.Text = value;\n                SlideUpTitle.Text = value;\n                base.Title = value;\n                RefreshHeaderView();\n            }\n        }\n\n        protected PrettyDialogViewController()\n        {\n            HeaderView = new ImageAndTitleHeaderView();\n            SlideUpTitle = new SlideUpTitleView(44f) { Offset = 100f };\n            NavigationItem.TitleView = SlideUpTitle;\n            _backgroundHeaderView = new UIView();\n        }\n\n        public override UIRefreshControl RefreshControl\n        {\n            get { return base.RefreshControl; }\n            set\n            {\n                if (value != null)\n                    value.TintColor = UIColor.White;\n                base.RefreshControl = value;\n            }\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            NavigationController.NavigationBar.ShadowImage = new UIImage();\n            HeaderView.BackgroundColor = NavigationController.NavigationBar.BarTintColor;\n            HeaderView.TextColor = NavigationController.NavigationBar.TintColor;\n            HeaderView.SubTextColor = NavigationController.NavigationBar.TintColor.ColorWithAlpha(0.8f);\n            _backgroundHeaderView.BackgroundColor = HeaderView.BackgroundColor;\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (NavigationController != null)\n                NavigationController.NavigationBar.ShadowImage = null;\n        }\n\n        protected void RefreshHeaderView()\n        {\n            TableView.TableHeaderView = HeaderView;\n            TableView.ReloadData();\n        }\n\n        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            base.DidRotate(fromInterfaceOrientation);\n            TableView.BeginUpdates();\n            TableView.TableHeaderView = HeaderView;\n            TableView.EndUpdates();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.TableHeaderView = HeaderView;\n            TableView.SectionHeaderHeight = 0;\n\n            var frame = TableView.Bounds;\n            frame.Y = -frame.Size.Height;\n            _backgroundHeaderView.Frame = frame;\n            _backgroundHeaderView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            _backgroundHeaderView.Layer.ZPosition = -1f;\n            TableView.InsertSubview(_backgroundHeaderView, 0);\n        }\n\n        protected override void DidScroll(CoreGraphics.CGPoint p)\n        {\n            if (NavigationController == null)\n                return;\n\n            if (p.Y > 0)\n                NavigationController.NavigationBar.ShadowImage = null;\n            if (p.Y <= 0 && NavigationController.NavigationBar.ShadowImage == null)\n                NavigationController.NavigationBar.ShadowImage = new UIImage();\n            SlideUpTitle.Offset = 108 + 28 - p.Y;\n        }\n    }\n\n    public abstract class ViewModelDrivenDialogViewController : DialogViewController, IMvxIosView, IMvxEventSourceViewController\n    {\n        private bool _manualRefreshRequested;\n  \n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            ViewDidLoadCalled.Raise(this);\n\n            var loadableViewModel = ViewModel as LoadableViewModel;\n            if (loadableViewModel != null)\n            {\n                RefreshControl = new UIRefreshControl();\n                OnActivation(d =>\n                {\n                    d(loadableViewModel.Bind(x => x.IsLoading, true).Subscribe(x =>\n                    {\n                        if (x)\n                        {\n                            NetworkActivity.PushNetworkActive();\n                            RefreshControl.BeginRefreshing();\n\n                            if (!_manualRefreshRequested)\n                            {\n                                UIView.Animate(0.25, 0f, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseOut,\n                                    () => TableView.ContentOffset = new CoreGraphics.CGPoint(0, -RefreshControl.Frame.Height), null);\n                            }\n\n                            foreach (var t in (ToolbarItems ?? Enumerable.Empty<UIBarButtonItem>()))\n                                t.Enabled = false;\n                        }\n                        else\n                        {\n                            NetworkActivity.PopNetworkActive();\n\n                            if (RefreshControl.Refreshing)\n                            {\n                                // Stupid bug...\n                                BeginInvokeOnMainThread(() =>\n                                {\n                                    UIView.Animate(0.25, 0.0, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseOut,\n                                        () => TableView.ContentOffset = new CoreGraphics.CGPoint(0, 0), null);\n                                    RefreshControl.EndRefreshing(); \n                                });\n                            }\n\n                            foreach (var t in (ToolbarItems ?? Enumerable.Empty<UIBarButtonItem>()))\n                                t.Enabled = true;\n\n                            _manualRefreshRequested = false;\n                        }\n                    }));\n                });\n            }\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the class.\n        /// </summary>\n        protected ViewModelDrivenDialogViewController(bool push = true, UITableViewStyle style = UITableViewStyle.Grouped)\n            : base(style, push)\n        {\n            this.AdaptForBinding();\n        }\n\n        private void HandleRefreshRequested(object sender, EventArgs e)\n        {\n            var loadableViewModel = ViewModel as LoadableViewModel;\n            if (loadableViewModel != null)\n            {\n                _manualRefreshRequested = true;\n                loadableViewModel.LoadCommand.Execute(true);\n            }\n        }\n\n        bool _isLoaded = false;\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            ViewWillAppearCalled.Raise(this, animated);\n\n            if (!_isLoaded)\n            {\n                var loadableViewModel = ViewModel as LoadableViewModel;\n                if (loadableViewModel != null)\n                    loadableViewModel.LoadCommand.Execute(false);\n                _isLoaded = true;\n            }\n\n            if (RefreshControl != null)\n                RefreshControl.ValueChanged += HandleRefreshRequested;\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            ViewWillDisappearCalled.Raise(this, animated);\n        }\n\n        public object DataContext\n        {\n            get { return BindingContext.DataContext; }\n            set { BindingContext.DataContext = value; }\n        }\n\n        public IMvxViewModel ViewModel\n        {\n            get { return DataContext as IMvxViewModel;  }\n            set { DataContext = value; }\n        }\n\n        public IMvxBindingContext BindingContext { get; set; }\n\n        public MvxViewModelRequest Request { get; set; }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            ViewDidDisappearCalled.Raise(this, animated);\n\n            if (RefreshControl != null)\n                RefreshControl.ValueChanged -= HandleRefreshRequested;\n        }\n\n        public override void ViewDidAppear(bool animated)\n        {\n            base.ViewDidAppear(animated);\n            ViewDidAppearCalled.Raise(this, animated);\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing)\n            {\n                DisposeCalled.Raise(this);\n            }\n            base.Dispose(disposing);\n        }\n\n        public override void ViewDidLayoutSubviews()\n        {\n            base.ViewDidLayoutSubviews();\n            ViewDidLayoutSubviewsCalled.Raise(this);\n        }\n\n        public event EventHandler DisposeCalled;\n        public event EventHandler ViewDidLoadCalled;\n        public event EventHandler<MvxValueEventArgs<bool>> ViewWillAppearCalled;\n        public event EventHandler<MvxValueEventArgs<bool>> ViewDidAppearCalled;\n        public event EventHandler<MvxValueEventArgs<bool>> ViewDidDisappearCalled;\n        public event EventHandler<MvxValueEventArgs<bool>> ViewWillDisappearCalled;\n        public event EventHandler ViewDidLayoutSubviewsCalled;\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/AboutViewController.cs",
    "content": "﻿namespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class AboutViewController : BaseViewController\n    {\n        public AboutViewController()\n            : base(\"AboutViewController\", null)\n        {\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/AboutViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"AboutViewController\")]\n    partial class AboutViewController\n    {\n        \n        void ReleaseDesignerOutlets ()\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/AboutViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"AboutViewController\">\n            <connections>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"Dni-8h-PeX\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" misplaced=\"YES\" text=\"Hello!\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"6LD-jI-9EX\">\n                    <rect key=\"frame\" x=\"26\" y=\"48\" width=\"268\" height=\"62\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"62\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Welcome to CodeHub, the most advanced GitHub client for iOS! Before you begin, there's a few things you should know.\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"q47-Vo-o6H\">\n                    <rect key=\"frame\" x=\"26\" y=\"402\" width=\"268\" height=\"80\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"17\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" misplaced=\"YES\" image=\"CodeHubRound.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"1Kv-xl-h37\">\n                    <rect key=\"frame\" x=\"56\" y=\"142\" width=\"208\" height=\"228\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"YEc-jm-KWj\"/>\n                    </constraints>\n                </imageView>\n            </subviews>\n            <constraints>\n                <constraint firstItem=\"6LD-jI-9EX\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"48\" id=\"BLn-b9-vbe\"/>\n                <constraint firstItem=\"1Kv-xl-h37\" firstAttribute=\"trailing\" secondItem=\"q47-Vo-o6H\" secondAttribute=\"trailing\" constant=\"-30\" id=\"Ede-CD-Zgp\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"q47-Vo-o6H\" secondAttribute=\"bottom\" constant=\"86\" id=\"Yy9-7i-n0J\"/>\n                <constraint firstItem=\"1Kv-xl-h37\" firstAttribute=\"leading\" secondItem=\"q47-Vo-o6H\" secondAttribute=\"leading\" constant=\"30\" id=\"c60-tq-0ky\"/>\n                <constraint firstItem=\"6LD-jI-9EX\" firstAttribute=\"leading\" secondItem=\"1Kv-xl-h37\" secondAttribute=\"leading\" constant=\"-30\" id=\"d17-Vp-aKN\"/>\n                <constraint firstItem=\"6LD-jI-9EX\" firstAttribute=\"trailing\" secondItem=\"1Kv-xl-h37\" secondAttribute=\"trailing\" constant=\"30\" id=\"eGR-SN-dcA\"/>\n                <constraint firstItem=\"1Kv-xl-h37\" firstAttribute=\"top\" secondItem=\"6LD-jI-9EX\" secondAttribute=\"bottom\" constant=\"32\" id=\"sDG-wF-qqv\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"1Kv-xl-h37\" secondAttribute=\"centerX\" id=\"vYG-Nq-w4F\"/>\n                <constraint firstItem=\"q47-Vo-o6H\" firstAttribute=\"top\" secondItem=\"1Kv-xl-h37\" secondAttribute=\"bottom\" constant=\"32\" id=\"xOZ-CR-CBf\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"66\" y=\"91\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"CodeHubRound.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/CardPageViewController.cs",
    "content": "﻿using UIKit;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class CardPageViewController : BaseViewController\n    {\n        private readonly UIViewController _viewController;\n\n        public CardPageViewController(UIViewController viewController)\n            : base(\"CardPageViewController\", null)\n        {\n            _viewController = viewController;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            _viewController.View.Frame = new CoreGraphics.CGRect(0, 0, ContentView.Frame.Width, ContentView.Frame.Height);\n            _viewController.View.AutoresizingMask = UIViewAutoresizing.All;\n            AddChildViewController(_viewController);\n\n            ContentView.Layer.CornerRadius = 12f;\n            ContentView.Layer.MasksToBounds = true;\n            ContentView.Add(_viewController.View);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/CardPageViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"CardPageViewController\")]\n    partial class CardPageViewController\n    {\n        [Outlet]\n        UIKit.UIView ContentView { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (ContentView != null) {\n                ContentView.Dispose ();\n                ContentView = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/CardPageViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9531\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"CardPageViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"contentView\" destination=\"hhx-q8-WgW\" id=\"EV8-bc-g43\"/>\n                <outlet property=\"view\" destination=\"HvQ-Sg-MG6\" id=\"aAP-9j-fjP\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"HvQ-Sg-MG6\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n            <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n            <subviews>\n                <view contentMode=\"scaleToFill\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"hhx-q8-WgW\">\n                    <rect key=\"frame\" x=\"140\" y=\"30\" width=\"320\" height=\"540\"/>\n                    <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" relation=\"lessThanOrEqual\" constant=\"540\" id=\"KsC-fd-k96\"/>\n                        <constraint firstAttribute=\"width\" relation=\"lessThanOrEqual\" constant=\"320\" id=\"Ur3-mF-gHV\"/>\n                    </constraints>\n                    <variation key=\"heightClass=regular\" misplaced=\"YES\">\n                        <rect key=\"frame\" x=\"141\" y=\"130\" width=\"320\" height=\"540\"/>\n                    </variation>\n                </view>\n            </subviews>\n            <color key=\"backgroundColor\" red=\"0.19607843137254902\" green=\"0.19607843137254902\" blue=\"0.19607843137254902\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n            <constraints>\n                <constraint firstItem=\"hhx-q8-WgW\" firstAttribute=\"centerY\" secondItem=\"HvQ-Sg-MG6\" secondAttribute=\"centerY\" id=\"5AW-ub-58A\"/>\n                <constraint firstItem=\"hhx-q8-WgW\" firstAttribute=\"leading\" secondItem=\"HvQ-Sg-MG6\" secondAttribute=\"leading\" priority=\"750\" constant=\"10\" id=\"AVm-bS-6gB\"/>\n                <constraint firstItem=\"hhx-q8-WgW\" firstAttribute=\"centerX\" secondItem=\"HvQ-Sg-MG6\" secondAttribute=\"centerX\" id=\"Boa-JM-hwC\"/>\n                <constraint firstAttribute=\"trailing\" secondItem=\"hhx-q8-WgW\" secondAttribute=\"trailing\" priority=\"750\" constant=\"10\" id=\"hi6-BC-5Xf\"/>\n                <constraint firstItem=\"hhx-q8-WgW\" firstAttribute=\"top\" secondItem=\"HvQ-Sg-MG6\" secondAttribute=\"top\" priority=\"750\" constant=\"10\" id=\"l3j-MR-mNd\">\n                    <variation key=\"heightClass=compact-widthClass=compact\" constant=\"10\"/>\n                </constraint>\n                <constraint firstAttribute=\"bottom\" secondItem=\"hhx-q8-WgW\" secondAttribute=\"bottom\" priority=\"750\" constant=\"10\" id=\"rzD-tp-3G3\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"36\" y=\"24\"/>\n        </view>\n    </objects>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/FeedbackViewController.cs",
    "content": "﻿using UIKit;\nusing System;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class FeedbackViewController : BaseViewController\n    {\n        public FeedbackViewController()\n            : base(\"FeedbackViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            GitHubButton.BackgroundColor = UIColor.FromRGB(0x7f, 0x8c, 0x8d);\n            GitHubButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            GitHubButton.Layer.CornerRadius = 6f;\n\n            OnActivation(d =>\n            {\n                d(GitHubButton.GetClickedObservable()\n                  .Subscribe(_ => ShowWebPage(\"https://github.com/codehubapp/codehub\")));\n            });\n        }\n\n        private void ShowWebPage(string url)\n        {\n            var view = new WebBrowserViewController(url);\n            PresentViewController(view, true, null);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/FeedbackViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Visual Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n\t[Register (\"FeedbackViewController\")]\n\tpartial class FeedbackViewController\n\t{\n\t\t[Outlet]\n\t\tUIKit.UIButton GitHubButton { get; set; }\n\t\t\n\t\tvoid ReleaseDesignerOutlets ()\n\t\t{\n\t\t\tif (GitHubButton != null) {\n\t\t\t\tGitHubButton.Dispose ();\n\t\t\t\tGitHubButton = null;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/FeedbackViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"12121\" systemVersion=\"16F73\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" colorMatched=\"YES\">\n    <device id=\"retina4_7\" orientation=\"portrait\">\n        <adaptation id=\"fullscreen\"/>\n    </device>\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"12089\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"FeedbackViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"GitHubButton\" destination=\"zHz-pv-YiY\" id=\"kZ6-YY-9nz\"/>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"TUC-Dh-oEH\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Feedback Welcome!\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Qnq-co-ogv\">\n                    <rect key=\"frame\" x=\"53.5\" y=\"30\" width=\"268\" height=\"90\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"38\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"eSV-qX-yAZ\">\n                    <rect key=\"frame\" x=\"53.5\" y=\"494.5\" width=\"268\" height=\"99.5\"/>\n                    <string key=\"text\">App reviews are great, but direct feedback is better! Reach out to us via the GitHub project. Your feedback helps create a better experience!</string>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"17\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" image=\"Feedback.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"6dn-z9-JDQ\">\n                    <rect key=\"frame\" x=\"83.5\" y=\"152\" width=\"208\" height=\"310.5\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"FWd-B8-xLa\"/>\n                    </constraints>\n                </imageView>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"zHz-pv-YiY\">\n                    <rect key=\"frame\" x=\"53.5\" y=\"617\" width=\"268\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.49803921568627452\" green=\"0.5490196078431373\" blue=\"0.55294117647058827\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"XpR-sE-M5P\"/>\n                    </constraints>\n                    <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    <state key=\"normal\" title=\"GitHub Project\">\n                        <color key=\"titleShadowColor\" red=\"0.5\" green=\"0.5\" blue=\"0.5\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                    </state>\n                </button>\n            </subviews>\n            <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n            <constraints>\n                <constraint firstItem=\"Qnq-co-ogv\" firstAttribute=\"trailing\" secondItem=\"6dn-z9-JDQ\" secondAttribute=\"trailing\" constant=\"30\" id=\"1bu-Ac-QED\"/>\n                <constraint firstItem=\"eSV-qX-yAZ\" firstAttribute=\"top\" secondItem=\"6dn-z9-JDQ\" secondAttribute=\"bottom\" constant=\"32\" id=\"Anu-Rz-guU\"/>\n                <constraint firstItem=\"6dn-z9-JDQ\" firstAttribute=\"top\" secondItem=\"Qnq-co-ogv\" secondAttribute=\"bottom\" constant=\"32\" id=\"C3P-kS-m9B\"/>\n                <constraint firstItem=\"zHz-pv-YiY\" firstAttribute=\"leading\" secondItem=\"eSV-qX-yAZ\" secondAttribute=\"leading\" id=\"DQu-3C-bna\"/>\n                <constraint firstItem=\"6dn-z9-JDQ\" firstAttribute=\"trailing\" secondItem=\"eSV-qX-yAZ\" secondAttribute=\"trailing\" constant=\"-30\" id=\"KlG-ta-U0h\"/>\n                <constraint firstItem=\"Qnq-co-ogv\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"30\" id=\"MtE-ys-tbN\"/>\n                <constraint firstItem=\"6dn-z9-JDQ\" firstAttribute=\"leading\" secondItem=\"eSV-qX-yAZ\" secondAttribute=\"leading\" constant=\"30\" id=\"OPi-8k-CjZ\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"zHz-pv-YiY\" secondAttribute=\"bottom\" constant=\"14\" id=\"PQH-7U-7HI\"/>\n                <constraint firstItem=\"zHz-pv-YiY\" firstAttribute=\"trailing\" secondItem=\"eSV-qX-yAZ\" secondAttribute=\"trailing\" id=\"Rqy-oc-wn9\"/>\n                <constraint firstItem=\"zHz-pv-YiY\" firstAttribute=\"top\" secondItem=\"eSV-qX-yAZ\" secondAttribute=\"bottom\" constant=\"23\" id=\"s24-I2-Nur\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"6dn-z9-JDQ\" secondAttribute=\"centerX\" id=\"y4x-Nr-dqL\"/>\n                <constraint firstItem=\"Qnq-co-ogv\" firstAttribute=\"leading\" secondItem=\"6dn-z9-JDQ\" secondAttribute=\"leading\" constant=\"-30\" id=\"z2m-WQ-4rd\"/>\n            </constraints>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"Feedback.png\" width=\"512\" height=\"512\"/>\n    </resources>\n    <simulatedMetricsContainer key=\"defaultSimulatedMetrics\">\n        <simulatedStatusBarMetrics key=\"statusBar\"/>\n        <simulatedOrientationMetrics key=\"orientation\"/>\n        <simulatedScreenMetrics key=\"destination\" type=\"retina4_7.fullscreen\"/>\n    </simulatedMetricsContainer>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/GoProViewController.cs",
    "content": "﻿using UIKit;\nusing System;\nusing CodeHub.iOS.ViewControllers.Application;\nusing MvvmCross.Platform;\nusing CodeHub.Core.Services;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class GoProViewController : BaseViewController\n    {\n        public GoProViewController()\n            : base(\"GoProViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TellMeMoreButton.BackgroundColor = UIColor.FromRGB(0x27, 0xae, 0x60);\n            TellMeMoreButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            TellMeMoreButton.Layer.CornerRadius = 6f;\n\n            OnActivation(d => d(TellMeMoreButton.GetClickedObservable().Subscribe(_ => TellMeMore())));\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            var features = Mvx.Resolve<IFeaturesService>();\n            if (features.IsProEnabled)\n            {\n                TitleLabel.Text = \"Pro Enabled!\";\n                DescriptionLabel.Text = \"Thank you for your continued support! The following Pro features have been activated for your device:\\n\\n• Private Repositories\\n• Enterprise Support\\n• Push Notifications\";\n            }\n        }\n\n        private void TellMeMore()\n        {\n            var view = new UpgradeViewController();\n            view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel);\n            view.NavigationItem.LeftBarButtonItem.GetClickedObservable().Subscribe(_ => DismissViewController(true, null));\n            PresentViewController(new ThemedNavigationController(view), true, null);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/GoProViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"GoProViewController\")]\n    partial class GoProViewController\n    {\n        [Outlet]\n        UIKit.UILabel DescriptionLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIButton TellMeMoreButton { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TitleLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (DescriptionLabel != null) {\n                DescriptionLabel.Dispose ();\n                DescriptionLabel = null;\n            }\n\n            if (TitleLabel != null) {\n                TitleLabel.Dispose ();\n                TitleLabel = null;\n            }\n\n            if (TellMeMoreButton != null) {\n                TellMeMoreButton.Dispose ();\n                TellMeMoreButton = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/GoProViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"GoProViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"DescriptionLabel\" destination=\"Ty1-92-mG8\" id=\"qLq-2B-Lef\"/>\n                <outlet property=\"TellMeMoreButton\" destination=\"iIP-BS-WFU\" id=\"8Qf-09-PSE\"/>\n                <outlet property=\"TitleLabel\" destination=\"s3B-Is-I3O\" id=\"fqn-Su-jEa\"/>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"lvv-1r-sOy\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" image=\"Briefcase.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"t2i-oA-TFo\">\n                    <rect key=\"frame\" x=\"56\" y=\"111\" width=\"208\" height=\"222\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"0U8-Z1-An9\"/>\n                    </constraints>\n                </imageView>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Go Pro!\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"s3B-Is-I3O\">\n                    <rect key=\"frame\" x=\"26\" y=\"36\" width=\"268\" height=\"57\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"48\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"iIP-BS-WFU\">\n                    <rect key=\"frame\" x=\"26\" y=\"518\" width=\"268\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.15294117647058825\" green=\"0.68235294117647061\" blue=\"0.37647058823529411\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"mX3-rd-1nk\"/>\n                    </constraints>\n                    <color key=\"tintColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    <state key=\"normal\" title=\"Tell Me More\">\n                        <color key=\"titleShadowColor\" white=\"0.5\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </state>\n                </button>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Ty1-92-mG8\">\n                    <rect key=\"frame\" x=\"26\" y=\"363\" width=\"268\" height=\"131\"/>\n                    <string key=\"text\">CodeHub is free for all Open Source projects. Go Pro if you're looking for these features:\n\n• Private Repositories\n• Enterprise Support\n• Push Notifications</string>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"16\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"trailing\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"trailing\" id=\"14L-w8-S0U\"/>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"top\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"bottom\" constant=\"24\" id=\"1iZ-dq-pGQ\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"trailing\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"trailing\" constant=\"30\" id=\"3Yw-68-HyA\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"leading\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"leading\" constant=\"30\" id=\"4B3-ZA-IoS\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"leading\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"leading\" constant=\"-30\" id=\"6IE-eo-asm\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"s3B-Is-I3O\" secondAttribute=\"centerX\" id=\"9VS-Ea-fCh\"/>\n                <constraint firstItem=\"Ty1-92-mG8\" firstAttribute=\"top\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"bottom\" constant=\"30\" id=\"L4L-0y-T63\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"36\" id=\"N2Z-l5-8At\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"trailing\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"trailing\" constant=\"-30\" id=\"PYA-EK-jRN\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"top\" secondItem=\"s3B-Is-I3O\" secondAttribute=\"bottom\" constant=\"18\" id=\"XPl-KB-6QL\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"iIP-BS-WFU\" secondAttribute=\"bottom\" constant=\"14\" id=\"fi0-GP-LAS\"/>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"leading\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"leading\" id=\"yNv-hn-p8n\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"70\" y=\"414\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"Briefcase.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/OrgViewController.cs",
    "content": "﻿using UIKit;\nusing System;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class OrgViewController : BaseViewController\n    {\n        public OrgViewController()\n            : base(\"OrgViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TellMeMoreButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            TellMeMoreButton.Layer.CornerRadius = 6f;\n\n            OnActivation(d => d(TellMeMoreButton.GetClickedObservable().Subscribe(_ => TellMeMore())));\n        }\n\n        private void TellMeMore()\n        {\n            const string url = \"https://help.github.com/articles/about-third-party-application-restrictions/\";\n            var view = new WebBrowserViewController(url);\n            PresentViewController(view, true, null);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/OrgViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"OrgViewController\")]\n    partial class OrgViewController\n    {\n        [Outlet]\n        UIKit.UILabel DescriptionLabel { get; set; }\n\n        [Outlet]\n        UIKit.UIButton TellMeMoreButton { get; set; }\n\n        [Outlet]\n        UIKit.UILabel TitleLabel { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (DescriptionLabel != null) {\n                DescriptionLabel.Dispose ();\n                DescriptionLabel = null;\n            }\n\n            if (TitleLabel != null) {\n                TitleLabel.Dispose ();\n                TitleLabel = null;\n            }\n\n            if (TellMeMoreButton != null) {\n                TellMeMoreButton.Dispose ();\n                TellMeMoreButton = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/OrgViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"OrgViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"DescriptionLabel\" destination=\"Ty1-92-mG8\" id=\"qLq-2B-Lef\"/>\n                <outlet property=\"TellMeMoreButton\" destination=\"iIP-BS-WFU\" id=\"8Qf-09-PSE\"/>\n                <outlet property=\"TitleLabel\" destination=\"s3B-Is-I3O\" id=\"fqn-Su-jEa\"/>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"lvv-1r-sOy\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" image=\"Organizations.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"t2i-oA-TFo\">\n                    <rect key=\"frame\" x=\"56\" y=\"144\" width=\"208\" height=\"220\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"0U8-Z1-An9\"/>\n                    </constraints>\n                </imageView>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Organization Access\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"s3B-Is-I3O\">\n                    <rect key=\"frame\" x=\"26\" y=\"36\" width=\"268\" height=\"90\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"38\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"iIP-BS-WFU\">\n                    <rect key=\"frame\" x=\"26\" y=\"518\" width=\"268\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.16078431372549018\" green=\"0.50196078431372548\" blue=\"0.72549019607843135\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"mX3-rd-1nk\"/>\n                    </constraints>\n                    <color key=\"tintColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    <state key=\"normal\" title=\"About Organization Access\">\n                        <color key=\"titleShadowColor\" white=\"0.5\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </state>\n                </button>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Ty1-92-mG8\">\n                    <rect key=\"frame\" x=\"26\" y=\"394\" width=\"268\" height=\"100\"/>\n                    <string key=\"text\">Organizations are supported in CodeHub! However, your organization may be set to prevent 3rd party access, like CodeHub, from accessing it!</string>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"17\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"trailing\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"trailing\" id=\"14L-w8-S0U\"/>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"top\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"bottom\" constant=\"24\" id=\"1iZ-dq-pGQ\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"trailing\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"trailing\" constant=\"30\" id=\"3Yw-68-HyA\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"leading\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"leading\" constant=\"30\" id=\"4B3-ZA-IoS\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"leading\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"leading\" constant=\"-30\" id=\"6IE-eo-asm\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"s3B-Is-I3O\" secondAttribute=\"centerX\" id=\"9VS-Ea-fCh\"/>\n                <constraint firstItem=\"Ty1-92-mG8\" firstAttribute=\"top\" secondItem=\"t2i-oA-TFo\" secondAttribute=\"bottom\" constant=\"30\" id=\"L4L-0y-T63\"/>\n                <constraint firstItem=\"s3B-Is-I3O\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"36\" id=\"N2Z-l5-8At\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"trailing\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"trailing\" constant=\"-30\" id=\"PYA-EK-jRN\"/>\n                <constraint firstItem=\"t2i-oA-TFo\" firstAttribute=\"top\" secondItem=\"s3B-Is-I3O\" secondAttribute=\"bottom\" constant=\"18\" id=\"XPl-KB-6QL\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"iIP-BS-WFU\" secondAttribute=\"bottom\" constant=\"14\" id=\"fi0-GP-LAS\"/>\n                <constraint firstItem=\"iIP-BS-WFU\" firstAttribute=\"leading\" secondItem=\"Ty1-92-mG8\" secondAttribute=\"leading\" id=\"yNv-hn-p8n\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"70\" y=\"414\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"Organizations.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/PromoteViewController.cs",
    "content": "﻿using UIKit;\nusing System;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class PromoteViewController : BaseViewController\n    {\n        private bool _shouldWatch;\n        private bool _shouldStar;\n\n        public PromoteViewController()\n            : base(\"PromoteViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            StarButton.BackgroundColor = UIColor.FromRGB(0x2c, 0x3e, 0x50);\n            StarButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            StarButton.Layer.CornerRadius = 6f;\n\n            WatchButton.BackgroundColor = UIColor.FromRGB(0x7f, 0x8c, 0x8d);\n            WatchButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            WatchButton.Layer.CornerRadius = 6f;\n\n            OnActivation(d => {\n                d(WatchButton.GetClickedObservable().Subscribe(_ => WatchCodeHub()));\n                d(StarButton.GetClickedObservable().Subscribe(_ => StarCodeHub()));\n            });\n        }\n\n        private void StarCodeHub()\n        {\n            _shouldStar = !_shouldStar;\n            Core.Settings.ShouldStar = _shouldStar;\n            var color = _shouldStar ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x2c, 0x3e, 0x50);\n            StarButton.SetTitle(_shouldStar ? \"Good Choice!\" : \"Star\", UIControlState.Normal);\n            UIView.Animate(0.3f, () => StarButton.BackgroundColor = color);\n            Alert();\n        }\n\n        private void WatchCodeHub()\n        {\n            _shouldWatch = !_shouldWatch;\n            Core.Settings.ShouldWatch = _shouldWatch;\n            var color = _shouldWatch ? UIColor.FromRGB(0xbd, 0xc3, 0xc7) : UIColor.FromRGB(0x7f, 0x8c, 0x8d);\n            WatchButton.SetTitle(_shouldWatch ? \"Very Nice!\" : \"Watch\", UIControlState.Normal);\n            UIView.Animate(0.3f, () => WatchButton.BackgroundColor = color);\n            Alert();\n        }\n\n        private bool _hasAlerted;\n        private void Alert()\n        {\n            if (_hasAlerted)\n                return;\n            _hasAlerted = true;\n\n            var alert = UIAlertController.Create(\"Awesome!\", \"When you login to your account I will make the changes! Thanks for helping create a better CodeHub!\", UIAlertControllerStyle.Alert);\n            alert.AddAction(UIAlertAction.Create(\"Ok\", UIAlertActionStyle.Default, x => {}));\n            PresentViewController(alert, true, null);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/PromoteViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"PromoteViewController\")]\n    partial class PromoteViewController\n    {\n        [Outlet]\n        UIKit.UIButton StarButton { get; set; }\n\n        [Outlet]\n        UIKit.UIButton WatchButton { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (StarButton != null) {\n                StarButton.Dispose ();\n                StarButton = null;\n            }\n\n            if (WatchButton != null) {\n                WatchButton.Dispose ();\n                WatchButton = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/PromoteViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"PromoteViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"StarButton\" destination=\"cqn-XI-n8i\" id=\"ZLh-1l-bLe\"/>\n                <outlet property=\"WatchButton\" destination=\"dDc-Hi-PBv\" id=\"b1r-Ru-Sln\"/>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"8ni-OP-gkb\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"CodeHub is Open Source\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"sKf-IJ-I1L\">\n                    <rect key=\"frame\" x=\"26\" y=\"29\" width=\"268\" height=\"90\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"38\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"uYD-GH-LjN\">\n                    <rect key=\"frame\" x=\"26\" y=\"395\" width=\"268\" height=\"100\"/>\n                    <string key=\"text\">Help create a better app! Everything about CodeHub can be found on its GitHub repository. Stay in the loop by starring or watching the repository.</string>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"17\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" image=\"Heart.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"cFk-We-LgK\">\n                    <rect key=\"frame\" x=\"56\" y=\"151\" width=\"208\" height=\"212\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"cdb-uk-Gxu\"/>\n                    </constraints>\n                </imageView>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"dDc-Hi-PBv\">\n                    <rect key=\"frame\" x=\"174\" y=\"518\" width=\"120\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.49803921568627452\" green=\"0.5490196078431373\" blue=\"0.55294117647058827\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"KkL-HI-R3J\"/>\n                        <constraint firstAttribute=\"width\" constant=\"120\" id=\"bet-Cd-30p\"/>\n                    </constraints>\n                    <color key=\"tintColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    <state key=\"normal\" title=\"Watch\">\n                        <color key=\"titleShadowColor\" white=\"0.5\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </state>\n                </button>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"cqn-XI-n8i\">\n                    <rect key=\"frame\" x=\"26\" y=\"518\" width=\"120\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.17254901960784313\" green=\"0.24313725490196078\" blue=\"0.31372549019607843\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"K7c-rO-WB9\"/>\n                        <constraint firstAttribute=\"width\" constant=\"120\" id=\"Twf-IM-yJt\"/>\n                    </constraints>\n                    <color key=\"tintColor\" white=\"1\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    <state key=\"normal\" title=\"Star\">\n                        <color key=\"titleShadowColor\" white=\"0.5\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </state>\n                </button>\n            </subviews>\n            <constraints>\n                <constraint firstItem=\"sKf-IJ-I1L\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"29\" id=\"917-Ag-i21\"/>\n                <constraint firstItem=\"cqn-XI-n8i\" firstAttribute=\"top\" secondItem=\"uYD-GH-LjN\" secondAttribute=\"bottom\" constant=\"23\" id=\"EAc-hi-RCU\"/>\n                <constraint firstItem=\"uYD-GH-LjN\" firstAttribute=\"top\" secondItem=\"cFk-We-LgK\" secondAttribute=\"bottom\" constant=\"32\" id=\"GJa-qd-A9Q\"/>\n                <constraint firstItem=\"cFk-We-LgK\" firstAttribute=\"top\" secondItem=\"sKf-IJ-I1L\" secondAttribute=\"bottom\" constant=\"32\" id=\"HGL-h6-xvA\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"cqn-XI-n8i\" secondAttribute=\"bottom\" constant=\"14\" id=\"Jzx-ri-mMU\"/>\n                <constraint firstItem=\"cqn-XI-n8i\" firstAttribute=\"leading\" secondItem=\"uYD-GH-LjN\" secondAttribute=\"leading\" id=\"KIY-Hm-iye\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"cFk-We-LgK\" secondAttribute=\"centerX\" id=\"Na4-jw-K8m\"/>\n                <constraint firstItem=\"cFk-We-LgK\" firstAttribute=\"leading\" secondItem=\"uYD-GH-LjN\" secondAttribute=\"leading\" constant=\"30\" id=\"b3Z-Vm-AcF\"/>\n                <constraint firstItem=\"dDc-Hi-PBv\" firstAttribute=\"top\" secondItem=\"uYD-GH-LjN\" secondAttribute=\"bottom\" constant=\"23\" id=\"dPf-dI-x89\"/>\n                <constraint firstItem=\"sKf-IJ-I1L\" firstAttribute=\"trailing\" secondItem=\"cFk-We-LgK\" secondAttribute=\"trailing\" constant=\"30\" id=\"gym-Uj-bus\"/>\n                <constraint firstItem=\"cFk-We-LgK\" firstAttribute=\"trailing\" secondItem=\"uYD-GH-LjN\" secondAttribute=\"trailing\" constant=\"-30\" id=\"kJe-rf-AFQ\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"dDc-Hi-PBv\" secondAttribute=\"bottom\" constant=\"14\" id=\"vf9-Wr-zm7\"/>\n                <constraint firstItem=\"uYD-GH-LjN\" firstAttribute=\"trailing\" secondItem=\"dDc-Hi-PBv\" secondAttribute=\"trailing\" id=\"wCG-V9-96X\"/>\n                <constraint firstItem=\"sKf-IJ-I1L\" firstAttribute=\"leading\" secondItem=\"cFk-We-LgK\" secondAttribute=\"leading\" constant=\"-30\" id=\"ygn-Ak-YZI\"/>\n            </constraints>\n            <simulatedScreenMetrics key=\"simulatedDestinationMetrics\" type=\"retina4\"/>\n            <point key=\"canvasLocation\" x=\"-46\" y=\"404\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"Heart.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/WelcomePageViewController.cs",
    "content": "﻿using System;\nusing UIKit;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public class WelcomePageViewController : BaseViewController\n    {\n        private readonly CardPageViewController[] _pages;\n        private readonly UIButton _nextButton = new UIButton(UIButtonType.Custom);\n        private readonly WelcomeViewController _welcomeViewController = new WelcomeViewController();\n        private readonly UIPageViewController _welcomePageController = \n            new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal);\n        \n        public event Action WantsToDimiss;\n\n        protected void OnWantsToDismiss() => WantsToDimiss?.Invoke();\n\n        private IEnumerable<UIViewController> GetPages()\n        {\n            yield return new AboutViewController();\n            yield return new PromoteViewController();\n            yield return new OrgViewController();\n            yield return new GoProViewController();\n            yield return new FeedbackViewController();\n            yield return _welcomeViewController;\n        }\n\n        public WelcomePageViewController()\n        {\n            _pages = GetPages().Select(x => new CardPageViewController(x)).ToArray();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            View.BackgroundColor = Theme.CurrentTheme.PrimaryColor;\n\n            _welcomePageController.DataSource = new PageDataSource(_pages);\n            _welcomePageController.SetViewControllers(new [] { _pages[0] }, UIPageViewControllerNavigationDirection.Forward, true, null);\n            _welcomePageController.View.Frame = new CoreGraphics.CGRect(0, 0, View.Frame.Width, View.Frame.Height);\n            _welcomePageController.View.AutoresizingMask = UIViewAutoresizing.All;\n            AddChildViewController(_welcomePageController);\n            Add(_welcomePageController.View);\n\n            _nextButton.SetTitle(\"Next\", UIControlState.Normal);\n            _nextButton.TintColor = UIColor.White;\n            _nextButton.TitleLabel.Font = UIFont.SystemFontOfSize(14f);\n            _nextButton.Frame = new CoreGraphics.CGRect(View.Frame.Width - 50f, View.Frame.Height - 28f, 40f, 20f);\n            _nextButton.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin;\n            Add(_nextButton);\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n            _nextButton.TouchUpInside += GoToNext;\n            _welcomePageController.WillTransition += WillTransition;\n            _welcomeViewController.WantsToDimiss += OnWantsToDismiss;\n\n            UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Fade);\n        }\n\n        public override void ViewDidDisappear(bool animated)\n        {\n            base.ViewDidDisappear(animated);\n            _nextButton.TouchUpInside -= GoToNext;\n            _welcomePageController.WillTransition -= WillTransition;\n            _welcomeViewController.WantsToDimiss -= OnWantsToDismiss;\n        }\n\n        private void Transition(UIViewController e)\n        {\n            var isLast = _pages.Last() == e;\n            //nextButton.Enabled = !isLast;\n            UIView.Transition(_nextButton, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve, \n                () => _nextButton.SetTitle(isLast ? \"Done\" : \"Next\", UIControlState.Normal), null);\n        }\n\n        private void WillTransition(object sender, UIPageViewControllerTransitionEventArgs args)\n        {\n            Transition(args.PendingViewControllers[0]);\n        }\n\n        private void GoToNext(object sender, EventArgs args)\n        {\n            var currentViewController = _welcomePageController.ViewControllers[0];\n            var nextViewController = _welcomePageController.DataSource.GetNextViewController(_welcomePageController, currentViewController);\n            if (nextViewController != null)\n            {\n                Transition(nextViewController);\n                _welcomePageController.SetViewControllers(new [] { nextViewController }, UIPageViewControllerNavigationDirection.Forward, true, null);\n            }\n            else\n            {\n                OnWantsToDismiss();\n            }\n        }\n\n        public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()\n        {\n            return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone \n                ? UIInterfaceOrientationMask.Portrait : UIInterfaceOrientationMask.All;\n        }\n\n        public override bool ShouldAutorotate()\n        {\n            return UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Phone;\n        }\n            \n        private class PageDataSource : UIPageViewControllerDataSource\n        {\n            private readonly IList<UIViewController> _pages;\n\n            public PageDataSource(IEnumerable<UIViewController> pages)\n            {\n                _pages = pages.ToList();\n            }\n\n            public override nint GetPresentationCount(UIPageViewController pageViewController)\n            {\n                return _pages.Count;\n            }\n\n            public override nint GetPresentationIndex(UIPageViewController pageViewController)\n            {\n                return _pages.IndexOf(pageViewController.ViewControllers[0]);\n            }\n\n            public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController)\n            {\n                var index = _pages.IndexOf(referenceViewController);\n                return index == (_pages.Count - 1) ? null : _pages[index + 1];\n            }\n\n            public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController)\n            {\n                var index = _pages.IndexOf(referenceViewController);\n                return index == 0 ? null : _pages[index - 1];\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/WelcomeViewController.cs",
    "content": "﻿using UIKit;\nusing System;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    public partial class WelcomeViewController : BaseViewController\n    {\n        public event Action WantsToDimiss;\n\n        public WelcomeViewController()\n            : base(\"WelcomeViewController\", null)\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            GoButton.BackgroundColor = UIColor.FromRGB(0x29, 0x80, 0xb9);\n            GoButton.SetTitleColor(UIColor.White, UIControlState.Normal);\n            GoButton.Layer.CornerRadius = 6f;\n            OnActivation(d => d(GoButton.GetClickedObservable().Subscribe(_ => WantsToDimiss?.Invoke())));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/WelcomeViewController.designer.cs",
    "content": "// WARNING\n//\n// This file has been generated automatically by Xamarin Studio to store outlets and\n// actions made in the UI designer. If it is removed, they will be lost.\n// Manual changes to this file may not be handled correctly.\n//\nusing Foundation;\nusing System.CodeDom.Compiler;\n\nnamespace CodeHub.iOS.ViewControllers.Walkthrough\n{\n    [Register (\"WelcomeViewController\")]\n    partial class WelcomeViewController\n    {\n        [Outlet]\n        UIKit.UIButton GoButton { get; set; }\n        \n        void ReleaseDesignerOutlets ()\n        {\n            if (GoButton != null) {\n                GoButton.Dispose ();\n                GoButton = null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/Walkthrough/WelcomeViewController.xib",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" version=\"3.0\" toolsVersion=\"9531\" systemVersion=\"15B42\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"9529\"/>\n    </dependencies>\n    <objects>\n        <placeholder placeholderIdentifier=\"IBFilesOwner\" id=\"-1\" userLabel=\"File's Owner\" customClass=\"WelcomeViewController\" customModule=\"CodeHub_iOS\" customModuleProvider=\"target\">\n            <connections>\n                <outlet property=\"GoButton\" destination=\"lbP-eZ-6en\" id=\"neo-eL-vCm\"/>\n                <outlet property=\"view\" destination=\"iN0-l3-epB\" id=\"hbL-K6-q1y\"/>\n            </connections>\n        </placeholder>\n        <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"-2\" customClass=\"UIResponder\"/>\n        <view contentMode=\"scaleToFill\" id=\"iN0-l3-epB\">\n            <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"320\" height=\"568\"/>\n            <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n            <subviews>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Let's go!\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"m7g-R1-Mep\">\n                    <rect key=\"frame\" x=\"26\" y=\"48\" width=\"268\" height=\"62\"/>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue-Thin\" family=\"Helvetica Neue\" pointSize=\"52\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n                <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"roundedRect\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"lbP-eZ-6en\">\n                    <rect key=\"frame\" x=\"26\" y=\"518\" width=\"268\" height=\"36\"/>\n                    <color key=\"backgroundColor\" red=\"0.16078431372549018\" green=\"0.50196078431372548\" blue=\"0.72549019607843135\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"height\" constant=\"36\" id=\"iKT-qy-bX0\"/>\n                    </constraints>\n                    <color key=\"tintColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <state key=\"normal\" title=\"Start using CodeHub!\">\n                        <color key=\"titleColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                        <color key=\"titleShadowColor\" white=\"0.5\" alpha=\"1\" colorSpace=\"calibratedWhite\"/>\n                    </state>\n                </button>\n                <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFit\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" verticalCompressionResistancePriority=\"250\" image=\"Rocket.png\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"WMt-Ze-9kX\">\n                    <rect key=\"frame\" x=\"56\" y=\"142\" width=\"208\" height=\"240\"/>\n                    <constraints>\n                        <constraint firstAttribute=\"width\" constant=\"208\" id=\"QQI-91-mYE\"/>\n                    </constraints>\n                </imageView>\n                <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Rcc-Qm-yeD\">\n                    <rect key=\"frame\" x=\"26\" y=\"430\" width=\"268\" height=\"40\"/>\n                    <string key=\"text\">Thanks for your time.\n Enjoy using CodeHub!</string>\n                    <fontDescription key=\"fontDescription\" name=\"HelveticaNeue\" family=\"Helvetica Neue\" pointSize=\"17\"/>\n                    <color key=\"textColor\" red=\"0.086274509799999996\" green=\"0.086274509799999996\" blue=\"0.086274509799999996\" alpha=\"1\" colorSpace=\"calibratedRGB\"/>\n                    <nil key=\"highlightedColor\"/>\n                </label>\n            </subviews>\n            <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n            <constraints>\n                <constraint firstAttribute=\"centerX\" secondItem=\"lbP-eZ-6en\" secondAttribute=\"centerX\" id=\"2Xs-Nb-7yg\"/>\n                <constraint firstItem=\"Rcc-Qm-yeD\" firstAttribute=\"top\" secondItem=\"WMt-Ze-9kX\" secondAttribute=\"bottom\" constant=\"48\" id=\"5qR-Tg-LfS\"/>\n                <constraint firstItem=\"WMt-Ze-9kX\" firstAttribute=\"leading\" secondItem=\"Rcc-Qm-yeD\" secondAttribute=\"leading\" constant=\"30\" id=\"AD2-jL-Pt0\"/>\n                <constraint firstAttribute=\"centerX\" secondItem=\"m7g-R1-Mep\" secondAttribute=\"centerX\" id=\"EEB-rf-fUP\"/>\n                <constraint firstItem=\"lbP-eZ-6en\" firstAttribute=\"trailing\" secondItem=\"Rcc-Qm-yeD\" secondAttribute=\"trailing\" id=\"Q6K-HA-L4i\"/>\n                <constraint firstItem=\"m7g-R1-Mep\" firstAttribute=\"trailing\" secondItem=\"WMt-Ze-9kX\" secondAttribute=\"trailing\" constant=\"30\" id=\"Qhi-ty-FB9\"/>\n                <constraint firstAttribute=\"bottom\" secondItem=\"lbP-eZ-6en\" secondAttribute=\"bottom\" constant=\"14\" id=\"bKq-hY-ffm\"/>\n                <constraint firstItem=\"lbP-eZ-6en\" firstAttribute=\"top\" secondItem=\"Rcc-Qm-yeD\" secondAttribute=\"bottom\" constant=\"48\" id=\"d84-En-94g\"/>\n                <constraint firstItem=\"lbP-eZ-6en\" firstAttribute=\"leading\" secondItem=\"Rcc-Qm-yeD\" secondAttribute=\"leading\" id=\"dN0-JV-ncw\"/>\n                <constraint firstItem=\"WMt-Ze-9kX\" firstAttribute=\"top\" secondItem=\"m7g-R1-Mep\" secondAttribute=\"bottom\" constant=\"32\" id=\"eJq-lI-ZPW\"/>\n                <constraint firstItem=\"m7g-R1-Mep\" firstAttribute=\"top\" secondItem=\"iN0-l3-epB\" secondAttribute=\"top\" constant=\"48\" id=\"gJj-f0-LF5\"/>\n                <constraint firstItem=\"WMt-Ze-9kX\" firstAttribute=\"trailing\" secondItem=\"Rcc-Qm-yeD\" secondAttribute=\"trailing\" constant=\"-30\" id=\"lo9-XN-7wT\"/>\n                <constraint firstItem=\"m7g-R1-Mep\" firstAttribute=\"leading\" secondItem=\"WMt-Ze-9kX\" secondAttribute=\"leading\" constant=\"-30\" id=\"ria-yU-M9y\"/>\n            </constraints>\n            <point key=\"canvasLocation\" x=\"186\" y=\"361\"/>\n        </view>\n    </objects>\n    <resources>\n        <image name=\"Rocket.png\" width=\"512\" height=\"512\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "CodeHub.iOS/ViewControllers/WebBrowserViewController.cs",
    "content": "﻿using CodeHub.Core.ViewModels;\nusing CodeHub.iOS.Services;\nusing Foundation;\nusing MvvmCross.iOS.Views;\nusing UIKit;\n\nnamespace CodeHub.iOS.ViewControllers\n{\n    public class WebBrowserViewController : MvxViewController, IMvxModalIosView\n    {\n        void HandleAction()\n        {\n\n        }\n\n        private UIStatusBarStyle _statusBarStyle;\n\n        public WebBrowserViewController()\n        {\n        }\n\n        public WebBrowserViewController(string url)\n        {\n            var vm = new WebBrowserViewModel();\n            vm.Init(new WebBrowserViewModel.NavObject { Url = url });\n            ViewModel = vm;\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            _statusBarStyle = UIApplication.SharedApplication.StatusBarStyle;\n            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.Default, animated);\n\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\n            {\n                if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft ||\n                    UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight)\n                {\n                    UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Slide);\n                }\n            }\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            UIApplication.SharedApplication.SetStatusBarStyle(_statusBarStyle, animated);\n            UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Slide);\n        }\n\n        public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration)\n        {\n            base.WillRotate(toInterfaceOrientation, duration);\n\n            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)\n            {\n\n                if (toInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft ||\n                    toInterfaceOrientation == UIInterfaceOrientation.LandscapeRight)\n                {\n                    UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Slide);\n                }\n                else\n                {\n                    UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Slide);\n                }\n            }\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n            var vm = ViewModel as WebBrowserViewModel;\n\n            System.Uri uri;\n            if (!System.Uri.TryCreate(vm.Url, System.UriKind.Absolute, out uri))\n            {\n                AlertDialogService.ShowAlert(\"Error\", \"Unable to display webpage as the provided link (\" + vm.Url + \") was invalid\");\n            }\n            else\n            {\n                var safariBrowser = new SafariServices.SFSafariViewController(new NSUrl(vm.Url));\n                safariBrowser.View.Frame = View.Bounds;\n                safariBrowser.View.AutoresizingMask = UIViewAutoresizing.All;\n                AddChildViewController(safariBrowser);\n                Add(safariBrowser.View);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Views/AddRemoveView.cs",
    "content": "using System;\r\nusing UIKit;\r\nusing Foundation;\r\nusing CodeHub.iOS;\r\n\r\nnamespace CodeHub.iOS.Views\n{\n    public class AddRemoveView : UIView\n    {\n        public int? Added { get; set; }\n\n        public int? Removed { get; set; }\n\n        public AddRemoveView()\n        {\n            BackgroundColor = UIColor.Clear;\n        }\n\n        public AddRemoveView(IntPtr ptr)\n            : base(ptr)\n        {\n            BackgroundColor = UIColor.Clear;\n        }\n\n        public override void Draw(CoreGraphics.CGRect rect)\n        {\n            base.Draw(rect);\n\n            var width = rect.Width / 2f - 1f;\n            var addedRect = new CoreGraphics.CGRect(0, 0, width, rect.Height);\n            var removedRect = new CoreGraphics.CGRect(rect.Width / 2f + 1f, 0, width, rect.Height);\n\n            var context = UIGraphics.GetCurrentContext();\n            context.SaveState();\n            context.SetFillColor(UIColor.FromRGB(204, 255, 204).CGColor);\n            context.AddPath(Graphics.MakeRoundedRectPath(addedRect, 5));\n            context.FillPath();\n\n            context.SetFillColor(UIColor.FromRGB(255, 221, 221).CGColor);\n            context.AddPath(Graphics.MakeRoundedRectPath(removedRect, 5));\n            context.FillPath();\n\n            context.RestoreState();\n\n            UIColor.FromRGB(57, 152, 57).SetColor();\n            var stringRect = addedRect;\n            stringRect.Y += 1f;\n            string addedString = (Added == null) ? \"-\" : \"+\" + Added.Value;\n            new NSString(addedString).DrawString(stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);\n\n            UIColor.FromRGB(0xcc, 0x33, 0x33).SetColor();\n            stringRect = removedRect;\n            stringRect.Y += 1f;\n            string removedString = (Removed == null) ? \"-\" : \"-\" + Removed.Value;\n            new NSString(removedString).DrawString(stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/BlurredAlertView.cs",
    "content": "﻿using System;\nusing UIKit;\nusing CoreGraphics;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.Views\n{\n    public class BlurredAlertView : UIViewController\n    {\n        private readonly UILabel _label;\n        private readonly UIButton _button;\n\n        public static void Display(string text, Action dismissed = null)\n        {\n            var window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window;\n\n            var alertView = new BlurredAlertView(text);\n            var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark);\n            var blurView = new UIVisualEffectView(blur);\n            blurView.Frame = new CGRect(0, 0, window.Frame.Width, window.Frame.Height);\n            blurView.AutoresizingMask = UIViewAutoresizing.All;\n\n            blurView.ContentView.Add(alertView.View);\n            blurView.Alpha = 0;\n            blurView.AutoresizingMask = UIViewAutoresizing.All;\n            window.Add(blurView);\n\n            UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 1, null);\n\n            alertView._button.GetClickedObservable().Take(1).Subscribe(_ => {\n                UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 0, () => {\n                    blurView.RemoveFromSuperview();\n                    alertView.View.RemoveFromSuperview();\n                    dismissed?.Invoke();\n                });\n            });\n        }\n\n        private BlurredAlertView(string text)\n        {\n            _label = new UILabel();\n            _label.Lines = 0;\n            _label.Text = text;\n            _label.Font = UIFont.PreferredHeadline;\n            _label.TextAlignment = UITextAlignment.Center;\n            _label.TextColor = UIColor.White;\n\n            _button = new UIButton(UIButtonType.Custom);\n\n            var buttonLabel = new UILabel();\n            buttonLabel.Text = \"Ok\";\n            buttonLabel.Font = UIFont.PreferredBody.MakeBold();\n            buttonLabel.TextColor = UIColor.White;\n            buttonLabel.SizeToFit();\n            buttonLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;\n\n            _button.Add(buttonLabel);\n\n            _button.Layer.BorderColor = UIColor.White.CGColor;\n            _button.Layer.BorderWidth = 1f;\n            _button.Layer.CornerRadius = 6f;\n            _button.Layer.MasksToBounds = true;\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            View.BackgroundColor = UIColor.Clear;\n\n            Add(_label);\n            Add(_button);\n\n            View.ConstrainLayout(() => \n                _label.Frame.Width <= 360f &&\n                _label.Frame.Left >= View.Frame.Left + 20f &&\n                _label.Frame.Right <= View.Frame.Right - 20f &&\n                _label.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                _label.Frame.GetCenterY() == View.Frame.GetCenterY() - 30f &&\n\n                _button.Frame.Width == 140f &&\n                _button.Frame.Height == 44f &&\n                _button.Frame.GetCenterX() == View.Frame.GetCenterX() &&\n                _button.Frame.Top == _label.Frame.Bottom + 30f\n            );\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ButtonAccessoryView.cs",
    "content": "using System;\nusing UIKit;\nusing CoreGraphics;\nusing System.Collections.Generic;\n\nnamespace CodeHub.iOS.Views\n{\n    public class ButtonAccessoryView : UIView\n    {\n        private readonly ScrollingToolbarView _scrollingToolBar;\n\n        public ButtonAccessoryView(IEnumerable<UIButton> buttons)\n        {\n            Frame = new CGRect(0, 0, 320f, 44f);\n\n            var normalButtonImage = ImageFromColor(UIColor.White);\n            var pressedButtonImage = ImageFromColor(UIColor.FromWhiteAlpha(0.0f, 0.4f));\n\n            foreach (var button in buttons)\n            {\n                button.SetBackgroundImage(normalButtonImage, UIControlState.Normal);\n                button.SetBackgroundImage(pressedButtonImage, UIControlState.Highlighted);\n            }\n\n            _scrollingToolBar = new ScrollingToolbarView(new CGRect(0, 0, Bounds.Width, Bounds.Height), buttons);\n            _scrollingToolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n            _scrollingToolBar.BackgroundColor = UIColor.FromWhiteAlpha(0.84f, 1.0f);\n            Add(_scrollingToolBar);\n        }\n\n        public static UIButton CreateAccessoryButton(UIImage image, Action action)\n        {\n            var btn = CreateAccessoryButton(string.Empty, action);\n            btn.SetImage(image, UIControlState.Normal);\n            btn.ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n            btn.ImageEdgeInsets = new UIEdgeInsets(6, 6, 6, 6);\n            return btn;\n        }\n\n        public static UIButton CreateAccessoryButton(string title, Action action)\n        {\n            var fontSize = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 22 : 28f;\n            var btn = new UIButton(UIButtonType.System);\n            btn.Frame = new CGRect(0, 0, 26, 32);\n            btn.SetTitle(title, UIControlState.Normal);\n            btn.BackgroundColor = UIColor.White;\n            btn.Font = UIFont.BoldSystemFontOfSize(fontSize);\n            btn.Layer.CornerRadius = 7f;\n            btn.Layer.MasksToBounds = true;\n            btn.AdjustsImageWhenHighlighted = false;\n            btn.TouchUpInside += (sender, e) => action();\n            return btn;\n        }\n\n\n        private static UIImage ImageFromColor(UIColor color)\n        {\n            UIGraphics.BeginImageContext(new CGSize(1, 1));\n            var context = UIGraphics.GetCurrentContext();\n            context.SetFillColor(color.CGColor);\n            context.FillRect(new CGRect(0, 0, 1, 1));\n            var image = UIGraphics.GetImageFromCurrentImageContext();\n            UIGraphics.EndImageContext();\n            return image;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Views/EmptyListView.cs",
    "content": "﻿using UIKit;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.Views\n{\n    public class EmptyListView : UIView\n    {\n        public static UIColor DefaultColor = UIColor.Black;\n\n        public UIImageView ImageView { get; }\n\n        public UILabel Title { get; }\n\n        public EmptyListView(UIImage image, string emptyText)\n            : base(new CGRect(0, 0, 320f, 480f * 2f))\n        {\n            AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n\n            ImageView = new UIImageView();\n            Title = new UILabel();\n\n            ImageView.Frame = new CGRect(0, 0, 64f, 64f);\n            ImageView.TintColor = DefaultColor;\n            ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n            ImageView.Image = image;\n            Add(ImageView);\n\n            Title.Frame = new CGRect(0, 0, 256f, 20f);\n            Title.Text = emptyText;\n            Title.TextAlignment = UITextAlignment.Center;\n            Title.Font = UIFont.PreferredHeadline;\n            Title.TextColor = DefaultColor;\n            Add(Title);\n\n            BackgroundColor = UIColor.White;\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n            ImageView.Center = new CGPoint(Frame.Width / 2f, (Frame.Height / 2f) - (ImageView.Frame.Height / 2f));\n            Title.Center = new CGPoint(Frame.Width / 2f, ImageView.Frame.Bottom + 30f);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ExtendedUITextView.cs",
    "content": "﻿using UIKit;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.Views\n{\n    public class ExtendedUITextView : UITextView\n    {\n        private readonly UILabel _placeholderView = new UILabel();\n\n        public override string Text\n        {\n            get\n            {\n                return base.Text;\n            }\n            set\n            {\n                base.Text = value;\n                _placeholderView.Hidden = Text.Length > 0;\n            }\n        }\n\n        public override UIFont Font\n        {\n            get\n            {\n                return base.Font;\n            }\n            set\n            {\n                base.Font = value;\n                _placeholderView.Font = value;\n            }\n        }\n\n        public string Placeholder\n        {\n            get { return _placeholderView.Text; }\n            set { _placeholderView.Text = value; }\n        }\n\n        public ExtendedUITextView()\n        {\n            _placeholderView.TextColor = UIColor.FromWhiteAlpha(0.702f, 1.0f);\n            _placeholderView.Frame = new CGRect(5, 8, 300f, 20f);\n            _placeholderView.UserInteractionEnabled = false;\n            _placeholderView.Font = UIFont.PreferredBody;\n            _placeholderView.Hidden = Text.Length > 0;\n            this.Add(_placeholderView);\n\n            this.Changed += (sender, e) =>\n                _placeholderView.Hidden = !string.IsNullOrEmpty(Text);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ImageAndTitleHeaderView.cs",
    "content": "﻿using System;\r\nusing UIKit;\r\nusing CoreGraphics;\r\nusing SDWebImage;\r\nusing Foundation;\r\nusing System.Reactive.Subjects;\r\nusing System.Reactive;\r\nusing System.Reactive.Linq;\r\n\r\nnamespace CodeHub.iOS.Views\r\n{\r\n    public class ImageAndTitleHeaderView : UIView\r\n    {\r\n        private readonly ISubject<Unit> _clickedSubject = new Subject<Unit>();\r\n        private readonly UIImageView _imageView;\r\n        private readonly UILabel _label;\r\n        private readonly UILabel _label2;\r\n        private readonly UIView _seperatorView;\r\n        private readonly UIView _subView;\r\n        private readonly UIImageView _subImageView;\r\n\r\n        private const float SubImageAppearTime = 0.25f;\r\n\r\n        public UIButton ImageButton { get; private set; }\r\n\r\n        public IObservable<Unit> Clicked\r\n        {\r\n            get { return _clickedSubject.AsObservable(); }\r\n        }\r\n\r\n        public UIImageView SubImageView\r\n        {\r\n            get { return _subImageView; }\r\n        }\r\n\r\n        public UIImage Image\r\n        {\r\n            get { return _imageView.Image; }\r\n            set { _imageView.Image = value; }\r\n        }\r\n\r\n        public string Text\r\n        {\r\n            get { return _label.Text; }\r\n            set \r\n            { \r\n                _label.Text = value; \r\n                this.SetNeedsLayout();\r\n                this.LayoutIfNeeded();\r\n            }\r\n        }\r\n\r\n        public UIColor TextColor\r\n        {\r\n            get { return _label.TextColor; }\r\n            set\r\n            {\r\n                _label.TextColor = value;\r\n            }\r\n        }\r\n\r\n        public string SubText\r\n        {\r\n            get { return _label2.Text; }\r\n            set\r\n            {\r\n                if (!string.IsNullOrEmpty(value))\r\n                    _label2.Hidden = false;\r\n                _label2.Text = value;\r\n                this.SetNeedsLayout();\r\n                this.LayoutIfNeeded();\r\n            }\r\n        }\r\n\r\n        public UIColor SubTextColor\r\n        {\r\n            get { return _label2.TextColor; }\r\n            set\r\n            {\r\n                _label2.TextColor = value;\r\n            }\r\n        }\r\n\r\n        public bool EnableSeperator\r\n        {\r\n            get\r\n            {\r\n                return !_seperatorView.Hidden;\r\n            }\r\n            set\r\n            {\r\n                _seperatorView.Hidden = !value;\r\n            }\r\n        }\r\n\r\n        public UIColor SeperatorColor\r\n        {\r\n            get\r\n            {\r\n                return _seperatorView.BackgroundColor;\r\n            }\r\n            set\r\n            {\r\n                _seperatorView.BackgroundColor = value;\r\n            }\r\n        }\r\n\r\n        public bool RoundedImage\r\n        {\r\n            get { return _imageView.Layer.CornerRadius > 0; }\r\n            set\r\n            {\r\n                if (value)\r\n                {\r\n                    _imageView.Layer.CornerRadius = _imageView.Frame.Width / 2f;\r\n                    _imageView.Layer.MasksToBounds = true;\r\n                }\r\n                else\r\n                {\r\n                    _imageView.Layer.MasksToBounds = false;\r\n                    _imageView.Layer.CornerRadius = 0;\r\n                }\r\n            }\r\n        }\r\n\r\n        public UIColor ImageTint\r\n        {\r\n            get { return _imageView.TintColor; }\r\n            set { _imageView.TintColor = value; }\r\n        }\r\n\r\n        public ImageAndTitleHeaderView()\r\n            : base(new CGRect(0, 0, 320f, 100f))\r\n        {\r\n            ImageButton = new UIButton();\r\n            ImageButton.Frame = new CGRect(0, 0, 80, 80);\r\n            ImageButton.TouchUpInside += MakeHandler(this);\r\n            Add(ImageButton);\r\n\r\n            _imageView = new UIImageView();\r\n            _imageView.Frame = new CGRect(0, 0, 80, 80);\r\n            _imageView.BackgroundColor = UIColor.White;\r\n            _imageView.Layer.BorderWidth = 2f;\r\n            _imageView.Layer.BorderColor = UIColor.White.CGColor;\r\n            ImageButton.Add(_imageView);\r\n\r\n            _label = new UILabel();\r\n            _label.TextAlignment = UITextAlignment.Center;\r\n            _label.Lines = 0;\r\n            _label.Font = UIFont.PreferredHeadline;\r\n            Add(_label);\r\n\r\n            _label2 = new UILabel();\r\n            _label2.Hidden = true;\r\n            _label2.TextAlignment = UITextAlignment.Center;\r\n            _label2.Font = UIFont.PreferredSubheadline;\r\n            _label2.Lines = 0;\r\n            Add(_label2);\r\n\r\n            _seperatorView = new UIView();\r\n            _seperatorView.BackgroundColor = UIColor.FromWhiteAlpha(214.0f / 255.0f, 1.0f);\r\n            Add(_seperatorView);\r\n\r\n            _subView = new UIView();\r\n            _subView.Frame = new CGRect(56, 56, 22, 22);\r\n            _subView.Layer.CornerRadius = 10f;\r\n            _subView.Layer.MasksToBounds = true;\r\n            _subView.BackgroundColor = UIColor.White;\r\n            _subView.Hidden = true;\r\n            ImageButton.Add(_subView);\r\n\r\n            _subImageView = new UIImageView(new CGRect(0, 0, _subView.Frame.Width - 4f, _subView.Frame.Height - 4f));\r\n            _subImageView.Center = new CGPoint(11f, 11f);\r\n            _subView.Add(_subImageView);\r\n\r\n            EnableSeperator = false;\r\n            RoundedImage = true;\r\n        }\r\n\r\n        public static EventHandler MakeHandler(ImageAndTitleHeaderView view)\r\n        {\r\n            var weakRef = new WeakReference<ImageAndTitleHeaderView>(view);\r\n            return new EventHandler((s, e) => weakRef.Get()._clickedSubject.OnNext(Unit.Default));\r\n        }\r\n\r\n        public void SetImage(string imageUri, UIImage placeholder)\r\n        {\r\n            if (imageUri == null)\r\n                _imageView.Image = placeholder;\r\n            else\r\n            {\r\n                try\r\n                {\r\n                    _imageView.SetImage(new NSUrl(imageUri), placeholder, (image, error, cacheType, imageUrl) => {\r\n                        if (image != null && error == null)\r\n                            UIView.Transition(_imageView, 0.35f, UIViewAnimationOptions.TransitionCrossDissolve, () => _imageView.Image = image, null);\r\n                    });\r\n                }\r\n                catch\r\n                {\r\n                    _imageView.Image = placeholder;\r\n                }\r\n            }\r\n        }\r\n\r\n        public void SetSubImage(UIImage image)\r\n        {\r\n            if (image == null && _subImageView.Image != null)\r\n            {\r\n                UIView.Animate(SubImageAppearTime, 0, UIViewAnimationOptions.CurveEaseIn, () => \r\n                    _subView.Transform = CGAffineTransform.MakeScale(0.01f, 0.01f), () =>\r\n                {\r\n                    _subView.Hidden = true;\r\n                    _subImageView.Image = null;\r\n                });\r\n            }\r\n            else if (image != null && _subImageView.Image != null)\r\n            {\r\n                UIView.Animate(SubImageAppearTime, 0, UIViewAnimationOptions.TransitionCrossDissolve, () => \r\n                    _subImageView.Image = image, null);\r\n            }\r\n            else if (image != null && _subImageView.Image == null)\r\n            {\r\n                _subView.Transform = CGAffineTransform.MakeScale(0.01f, 0.01f);\r\n                _subView.Hidden = false;\r\n                _subImageView.Image = image;\r\n                UIView.Animate(SubImageAppearTime, 0, UIViewAnimationOptions.CurveEaseIn, () => \r\n                    _subView.Transform = CGAffineTransform.MakeIdentity(), null);\r\n            }\r\n        }\r\n\r\n        public override void LayoutSubviews()\r\n        {\r\n            base.LayoutSubviews();\r\n\r\n            ImageButton.Center = new CGPoint(Bounds.Width / 2, 15 + ImageButton.Frame.Height / 2);\r\n\r\n            _label.Frame = new CGRect(20, ImageButton.Frame.Bottom + 10f, Bounds.Width - 40, Bounds.Height - (ImageButton.Frame.Bottom + 5f));\r\n            _label.SizeToFit();\r\n            _label.Frame = new CGRect(20, ImageButton.Frame.Bottom + 10f, Bounds.Width - 40, _label.Frame.Height);\r\n\r\n            _label2.Frame = new CGRect(20, _label.Frame.Bottom + 2f, Bounds.Width - 40f, _label2.Font.LineHeight + 2f);\r\n            _label2.SizeToFit();\r\n            _label2.Frame = new CGRect(20, _label.Frame.Bottom + 2f, Bounds.Width - 40f, _label2.Frame.Height);\r\n\r\n            var bottom = _label2.Hidden == false? _label2.Frame.Bottom : _label.Frame.Bottom;\r\n            var f = Frame;\r\n            f.Height = bottom + 15f;\r\n            Frame = f;\r\n\r\n            _seperatorView.Frame = new CGRect(0, Frame.Height - 0.5f, Frame.Width, 0.5f);\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/BaseIssuesView.cs",
    "content": "using CodeHub.iOS.ViewControllers;\r\nusing GitHubSharp.Models;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing CodeHub.iOS.DialogElements;\r\nusing System;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\n{\n    public abstract class BaseIssuesView : ViewModelCollectionDrivenDialogViewController\n    {\r\n        public new IBaseIssuesViewModel ViewModel\r\n        {\r\n            get { return (IBaseIssuesViewModel)base.ViewModel; }\r\n            set { base.ViewModel = value; }\r\n        }\r\n\n        protected BaseIssuesView()\n        {\n            Title = \"Issues\";\n        }\r\n\n        protected IssueElement CreateElement(IssueModel x)\n        {\r\n            var weakVm = new WeakReference<IBaseIssuesViewModel>(ViewModel);\r\n            var isPullRequest = x.PullRequest != null && !(string.IsNullOrEmpty(x.PullRequest.HtmlUrl));\r\n            var assigned = x.Assignee != null ? x.Assignee.Login : \"unassigned\";\n            var kind = isPullRequest ? \"Pull\" : \"Issue\";\n            var commentString = x.Comments == 1 ? \"1 comment\" : x.Comments + \" comments\";\n            var el = new IssueElement(x.Number.ToString(), x.Title, assigned, x.State, commentString, kind, x.UpdatedAt);\n            el.Tapped += () => weakVm.Get()?.GoToIssueCommand.Execute(x);\n            return el;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueAddView.cs",
    "content": "using System;\nusing CodeHub.iOS.ViewControllers;\nusing CodeHub.Core.ViewModels.Issues;\nusing UIKit;\nusing System.Linq;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.DialogElements;\n\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssueAddView : ViewModelDrivenDialogViewController\n    {\n        public IssueAddView()\n        {\n            Title = \"New Issue\";\n        }\n        \n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            TableView.RowHeight = UITableView.AutomaticDimension;\n            TableView.EstimatedRowHeight = 44f;\n\n            var vm = (IssueAddViewModel)ViewModel;\n            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n            NavigationItem.RightBarButtonItem = saveButton;\n\n            var title = new EntryElement(\"Title\", string.Empty, string.Empty);\n            var assignedTo = new StringElement(\"Responsible\", \"Unassigned\", UITableViewCellStyle.Value1);\n            var milestone = new StringElement(\"Milestone\", \"None\", UITableViewCellStyle.Value1);\n            var labels = new StringElement(\"Labels\", \"None\", UITableViewCellStyle.Value1);\n            var content = new MultilinedElement(\"Description\");\n\n            Root.Reset(new Section { title, assignedTo, milestone, labels }, new Section { content });\n\n            OnActivation(d =>\n            {\n                d(vm.Bind(x => x.IssueTitle, true).Subscribe(x => title.Value = x));\n                d(title.Changed.Subscribe(x => vm.IssueTitle = x));\n\n                d(vm.Bind(x => x.Content, true).Subscribe(x => content.Details = x));\n                d(labels.Clicked.Subscribe(_ => vm.GoToLabelsCommand.Execute(null)));\n                d(milestone.Clicked.Subscribe(_ => vm.GoToMilestonesCommand.Execute(null)));\n                d(assignedTo.Clicked.Subscribe(_ => vm.GoToAssigneeCommand.Execute(null)));\n                d(vm.Bind(x => x.IsSaving).SubscribeStatus(\"Saving...\"));\n\n                d(vm.Bind(x => x.AssignedTo, true).Subscribe(x => {\n                    assignedTo.Value = x == null ? \"Unassigned\" : x.Login;\n                }));\n\n                d(vm.Bind(x => x.Milestone, true).Subscribe(x => {\n                    milestone.Value = x == null ? \"None\" : x.Title;\n                }));\n\n                d(vm.BindCollection(x => x.Labels, true).Subscribe(_ => {\n                    labels.Value = vm.Labels.Items.Count == 0 ? \"None\" : string.Join(\", \", vm.Labels.Items.Select(i => i.Name));\n                }));\n\n                d(saveButton.GetClickedObservable().Subscribe(_ => {\n                    View.EndEditing(true);\n                    vm.SaveCommand.Execute(null);\n                }));\n\n                d(content.Clicked.Subscribe(_ => {\n                    var composer = new MarkdownComposerViewController\n                    {\n                        Title = \"Issue Description\",\n                        Text = content.Details\n                    };\n\n                    composer.PresentAsModal(this, text =>\n                    {\n                        vm.Content = text;\n                        this.DismissViewController(true, null);\n                    });\n                }));\n            });\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueAssignedToView.cs",
    "content": "using System;\r\nusing System.Linq;\r\nusing CodeHub.iOS.DialogElements;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing UIKit;\r\nusing CodeHub.iOS.Utilities;\r\nusing CodeHub.Core.Utilities;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssueAssignedToView : ViewModelCollectionDrivenDialogViewController\n    {\r\n        public IssueAssignedToView()\r\n        {\r\n            Title = \"Assignees\";\r\n            EmptyView = new Lazy<UIView>(() =>\r\n                new EmptyListView(Octicon.Person.ToEmptyListImage(), \"There are no assignees.\"));\r\n        }\r\n\n        public override void ViewDidLoad()\r\n        {\r\n            base.ViewDidLoad();\r\n\r\n            var vm = (IssueAssignedToViewModel)ViewModel;\r\n            BindCollection(vm.Users, x =>\r\n            {\r\n                var avatar = new GitHubAvatar(x.AvatarUrl);\r\n                var el = new UserElement(x.Login, string.Empty, string.Empty, avatar);\r\n                el.Clicked.Subscribe(_ => {\r\n                    if (vm.SelectedUser != null && string.Equals(vm.SelectedUser.Login, x.Login))\r\n                        vm.SelectedUser = null;\r\n                    else\r\n                        vm.SelectedUser = x;\r\n                });\r\n\r\n                if (vm.SelectedUser != null && string.Equals(vm.SelectedUser.Login, x.Login, StringComparison.OrdinalIgnoreCase))\r\n                    el.Accessory = UITableViewCellAccessory.Checkmark;\r\n                else\r\n                    el.Accessory = UITableViewCellAccessory.None;\r\n                return el;\r\n            });\r\n\r\n            vm.Bind(x => x.SelectedUser).Subscribe(x =>\r\n            {\r\n                if (Root.Count == 0)\r\n                    return;\r\n                foreach (var m in Root[0].Elements.Cast<UserElement>())\r\n                    m.Accessory = (x != null && string.Equals(vm.SelectedUser.Login, m.Caption, StringComparison.OrdinalIgnoreCase)) ? \r\n                                     UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\r\n            });\r\n\r\n            vm.Bind(x => x.IsSaving).SubscribeStatus(\"Saving...\");\r\n        }\r\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueEditView.cs",
    "content": "using System;\r\nusing System.Linq;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing UIKit;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing CodeHub.iOS.Utilities;\r\nusing CodeHub.iOS.DialogElements;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\r\n{\r\n    public class IssueEditView : ViewModelDrivenDialogViewController\r\n    {\r\n        public IssueEditView()\r\n        {\r\n            Title = \"Edit Issue\";\r\n        }\r\n\r\n        public override void ViewDidLoad()\r\n        {\r\n            base.ViewDidLoad();\r\n\r\n            TableView.RowHeight = UITableView.AutomaticDimension;\r\n            TableView.EstimatedRowHeight = 44f;\r\n\r\n            var vm = (IssueEditViewModel)ViewModel;\r\n\r\n            var saveButton = new UIBarButtonItem(UIBarButtonSystemItem.Save);\r\n            NavigationItem.RightBarButtonItem = saveButton;\r\n\r\n            var title = new EntryElement(\"Title\", string.Empty, string.Empty);\r\n            var assignedTo = new StringElement(\"Responsible\", \"Unassigned\", UITableViewCellStyle.Value1);\r\n            var milestone = new StringElement(\"Milestone\", \"None\", UITableViewCellStyle.Value1);\r\n            var labels = new StringElement(\"Labels\", \"None\", UITableViewCellStyle.Value1);\r\n            var content = new MultilinedElement(\"Description\");\r\n            var state = new BooleanElement(\"Open\", true);\r\n\r\n            Root.Reset(new Section { title, assignedTo, milestone, labels }, new Section { state }, new Section { content });\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(vm.Bind(x => x.IssueTitle, true).Subscribe(x => title.Value = x));\r\n                d(title.Changed.Subscribe(x => vm.IssueTitle = x));\r\n\r\n                d(assignedTo.Clicked.BindCommand(vm.GoToAssigneeCommand));\r\n                d(milestone.Clicked.BindCommand(vm.GoToMilestonesCommand));\r\n                d(labels.Clicked.BindCommand(vm.GoToLabelsCommand));\r\n\r\n                d(vm.Bind(x => x.IsOpen, true).Subscribe(x => state.Value = x));\r\n                d(vm.Bind(x => x.IsSaving).SubscribeStatus(\"Updating...\"));\r\n\r\n                d(state.Changed.Subscribe(x => vm.IsOpen = x));\r\n                d(vm.Bind(x => x.Content, true).Subscribe(x => content.Details = x));\r\n\r\n                d(vm.Bind(x => x.AssignedTo, true).Subscribe(x => {\r\n                    assignedTo.Value = x == null ? \"Unassigned\" : x.Login;\r\n                }));\r\n\r\n                d(vm.Bind(x => x.Milestone, true).Subscribe(x => {\r\n                    milestone.Value = x == null ? \"None\" : x.Title;\r\n                }));\r\n\r\n                d(vm.BindCollection(x => x.Labels, true).Subscribe(x => {\r\n                    labels.Value = vm.Labels.Items.Count == 0 ? \"None\" : string.Join(\", \", vm.Labels.Items.Select(i => i.Name));\r\n                }));\r\n\r\n                d(saveButton.GetClickedObservable().Subscribe(_ => {\r\n                    View.EndEditing(true);\r\n                    vm.SaveCommand.Execute(null);\r\n                }));\r\n\r\n                d(content.Clicked.Subscribe(_ => {\r\n                    var composer = new MarkdownComposerViewController\r\n                    {\r\n                        Title = \"Issue Description\",\r\n                        Text = content.Details\r\n                    };\r\n\r\n                    composer.PresentAsModal(this, text =>\r\n                    {\r\n                        vm.Content = text;\r\n                        this.DismissViewController(true, null);\r\n                    });\r\n                }));\r\n            });\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueLabelsView.cs",
    "content": "using System;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing System.Linq;\r\nusing UIKit;\r\nusing CodeHub.iOS.Utilities;\r\nusing CodeHub.iOS.DialogElements;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssueLabelsView : ViewModelCollectionDrivenDialogViewController\n    {\r\n        public IssueLabelsView()\r\n        {\r\n            EnableSearch = false;\r\n            Title = \"Labels\";\r\n          \r\n            EmptyView = new Lazy<UIView>(() =>\r\n                new EmptyListView(Octicon.Tag.ToEmptyListImage(), \"There are no labels.\"));\r\n        }\r\n\n        public override void ViewDidLoad()\r\n        {\r\n            base.ViewDidLoad();\r\n\r\n            var vm = (IssueLabelsViewModel)ViewModel;\r\n            NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Buttons.BackButton, UIBarButtonItemStyle.Plain, (s, e) => vm.SaveLabelChoices.Execute(null));\r\n\r\n            BindCollection(vm.Labels, x => \r\n            {\r\n                var e = new LabelElement(x.Name, x.Color);\r\n                e.Clicked.Subscribe(_ =>\r\n                {\r\n                    if (e.Accessory == UITableViewCellAccessory.Checkmark)\r\n                        vm.SelectedLabels.Items.Remove(x);\r\n                    else\r\n                        vm.SelectedLabels.Items.Add(x);\r\n                });\r\n\r\n                e.Accessory = vm.SelectedLabels.Contains(x) ? \r\n                               UITableViewCellAccessory.Checkmark : \r\n                               UITableViewCellAccessory.None;\r\n                return e;\r\n            });\r\n\r\n            vm.BindCollection(x => x.SelectedLabels, true).Subscribe(_ =>\r\n            {\r\n                if (Root.Count == 0)\r\n                    return;\r\n\r\n                var elements = Root[0].Elements;\r\n                foreach (var el in elements.Cast<LabelElement>())\r\n                {\r\n                    var element = el;\r\n                    el.Accessory = vm.SelectedLabels.Any(y => string.Equals(y.Name, element.Name, System.StringComparison.OrdinalIgnoreCase)) ? \r\n                                   UITableViewCellAccessory.Checkmark : \r\n                                   UITableViewCellAccessory.None;\r\n                }\r\n            });\r\n\r\n            vm.Bind(x => x.IsSaving).SubscribeStatus(\"Saving...\");\r\n        }\r\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueMilestonesView.cs",
    "content": "using System;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing System.Linq;\r\nusing UIKit;\r\nusing CodeHub.iOS.Utilities;\r\nusing CodeHub.iOS.DialogElements;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssueMilestonesView : ViewModelCollectionDrivenDialogViewController\n    {\r\n        public IssueMilestonesView()\r\n        {\r\n            Title = \"Milestones\";\r\n            EnableSearch = false;\r\n\r\n            EmptyView = new Lazy<UIView>(() =>\r\n                new EmptyListView(Octicon.Milestone.ToEmptyListImage(), \"There are no milestones.\"));\r\n        }\r\n\r\n        public override void ViewDidLoad()\r\n        {\r\n            base.ViewDidLoad();\r\n\r\n            TableView.RowHeight = 80f;\r\n            TableView.SeparatorInset = new UIEdgeInsets(0, 0, 0, 0);\r\n\r\n            var vm = (IssueMilestonesViewModel)ViewModel;\r\n            BindCollection(vm.Milestones, x => {\r\n                var e = new MilestoneElement(x.Number, x.Title, x.OpenIssues, x.ClosedIssues, x.DueOn);\r\n                e.Tapped += () => {\r\n                    if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number)\r\n                        vm.SelectedMilestone = null;\r\n                    else\r\n                        vm.SelectedMilestone = x;\r\n                };\r\n                if (vm.SelectedMilestone != null && vm.SelectedMilestone.Number == x.Number)\r\n                    e.Accessory = UITableViewCellAccessory.Checkmark;\r\n                return e;\r\n            });\r\n\r\n            vm.Bind(x => x.SelectedMilestone).Subscribe(x =>\r\n            {\r\n                if (Root.Count == 0)\r\n                    return;\r\n                foreach (var m in Root[0].Elements.Cast<MilestoneElement>())\r\n                    m.Accessory = (x != null && m.Number == x.Number) ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None;\r\n            });\r\n\r\n            vm.Bind(x => x.IsSaving).SubscribeStatus(\"Saving...\");\r\n        }\r\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssueView.cs",
    "content": "using System;\nusing CodeHub.Core.ViewModels.Issues;\nusing UIKit;\nusing CodeHub.iOS.ViewControllers;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.DialogElements;\nusing System.Linq;\nusing System.Collections.Generic;\nusing Humanizer;\nusing CodeHub.iOS.ViewControllers.Repositories;\nusing CodeHub.iOS.Services;\nusing System.Reactive.Linq;\nusing ReactiveUI;\nusing CodeHub.WebViews;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing Splat;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssueView : PrettyDialogViewController\n    {\n        private readonly IMarkdownService _markdownService = Locator.Current.GetService<IMarkdownService>();\n        private readonly HtmlElement _descriptionElement = new HtmlElement(\"description\");\n        private readonly HtmlElement _commentsElement = new HtmlElement(\"comments\");\n        private StringElement _milestoneElement;\n        private StringElement _assigneeElement;\n        private StringElement _labelsElement;\n        private StringElement _addCommentElement;\n        private SplitButtonElement _split = new SplitButtonElement();\n        private SplitButtonElement.Button _splitButton1;\n        private SplitButtonElement.Button _splitButton2;\n\n        public new IssueViewModel ViewModel\n        {\n            get { return (IssueViewModel) base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        public IssueView(string owner, string repository, int id)\n            : this()\n        {\n            ViewModel = new IssueViewModel();\n            ViewModel.Init(new IssueViewModel.NavObject { Username = owner, Repository = repository, Id = id });\n        }\n\n        public IssueView()\n        {\n        }\n\n        protected override void DidScroll(CoreGraphics.CGPoint p)\n        {\n            base.DidScroll(p);\n\n            _descriptionElement.SetLayout();\n            _commentsElement.SetLayout();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            _splitButton1 = _split.AddButton(\"Comments\", \"-\");\n            _splitButton2 = _split.AddButton(\"Participants\", \"-\");\n\n            Title = \"Issue #\" + ViewModel.Id;\n            HeaderView.SetImage(null, Images.Avatar);\n            HeaderView.Text = Title;\n\n            Appeared.Take(1)\n                .Select(_ => Observable.Timer(TimeSpan.FromSeconds(0.2f)))\n                .Switch()\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Select(_ => ViewModel.Bind(x => x.IsClosed, true).Where(x => x.HasValue).Select(x => x.Value))\n                .Switch()\n                .Subscribe(x => \n                {\n                    HeaderView.SubImageView.TintColor = x ? UIColor.FromRGB(0xbd, 0x2c, 0) : UIColor.FromRGB(0x6c, 0xc6, 0x44);\n                    HeaderView.SetSubImage((x ? Octicon.IssueClosed :Octicon.IssueOpened).ToImage());\n                });\n\n            _milestoneElement = new StringElement(\"Milestone\", \"No Milestone\", UITableViewCellStyle.Value1) {Image = Octicon.Milestone.ToImage() };\n            _assigneeElement = new StringElement(\"Assigned\", \"Unassigned\", UITableViewCellStyle.Value1) {Image = Octicon.Person.ToImage() };\n            _labelsElement = new StringElement(\"Labels\", \"None\", UITableViewCellStyle.Value1) {Image = Octicon.Tag.ToImage() };\n            _addCommentElement = new StringElement(\"Add Comment\") { Image = Octicon.Pencil.ToImage() };\n\n            var actionButton = new UIBarButtonItem(UIBarButtonSystemItem.Action) { Enabled = false };\n            NavigationItem.RightBarButtonItem = actionButton;\n\n            ViewModel.Bind(x => x.IsModifying).SubscribeStatus(\"Loading...\");\n\n            ViewModel.Bind(x => x.Issue).Subscribe(x =>\n            {\n                _assigneeElement.Value = x.Assignee != null ? x.Assignee.Login : \"Unassigned\";\n                _milestoneElement.Value = x.Milestone != null ? x.Milestone.Title : \"No Milestone\";\n                _labelsElement.Value = x.Labels.Count == 0 ? \"None\" : string.Join(\", \", x.Labels.Select(i => i.Name));\n\n                HeaderView.Text = x.Title;\n                HeaderView.SubText = \"Updated \" + x.UpdatedAt.Humanize();\n                HeaderView.SetImage(x.User?.AvatarUrl, Images.Avatar);\n                RefreshHeaderView();\n\n                Render();\n            });\n\n            ViewModel.Bind(x => x.MarkdownDescription).Subscribe(description =>\n            {\n                var model = new MarkdownModel(description, (int)UIFont.PreferredSubheadline.PointSize, true);\n                var markdown = new MarkdownWebView { Model = model };\n                var html = markdown.GenerateString();\n                _descriptionElement.SetValue(string.IsNullOrEmpty(description) ? null : html);\n                Render();\n            });\n\n            ViewModel\n                .Bind(x => x.Comments)\n                .Select(_ => Unit.Default)\n                .Merge(ViewModel.Bind(x => x.Events).Select(_ => Unit.Default))\n                .Subscribe(_ => RenderComments().ToBackground());\n\n            ViewModel\n                .Bind(x => x.Participants)\n                .Subscribe(x => _splitButton2.Text = x.HasValue ? x.Value.ToString() : \"-\");\n\n            ViewModel\n                .Bind(x => x.ShouldShowPro)\n                .Where(x => x)\n                .Subscribe(x => this.ShowPrivateView());\n\n            OnActivation(d =>\n            {\n                d(_milestoneElement.Clicked.BindCommand(ViewModel.GoToMilestoneCommand));\n                d(_assigneeElement.Clicked.BindCommand(ViewModel.GoToAssigneeCommand));\n                d(_labelsElement.Clicked.BindCommand(ViewModel.GoToLabelsCommand));\n                d(_addCommentElement.Clicked.Subscribe(_ => AddCommentTapped()));\n                d(_descriptionElement.UrlRequested.BindCommand(ViewModel.GoToUrlCommand));\n                d(_commentsElement.UrlRequested.BindCommand(ViewModel.GoToUrlCommand));\n                d(actionButton.GetClickedObservable().Subscribe(ShowExtraMenu));\n                d(HeaderView.Clicked.BindCommand(ViewModel.GoToOwner));\n\n                d(ViewModel.Bind(x => x.IsCollaborator, true).Subscribe(x => {\n                    foreach (var i in new [] { _assigneeElement, _milestoneElement, _labelsElement })\n                        i.Accessory = x ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;\n                }));\n\n                d(ViewModel.Bind(x => x.IsLoading).Subscribe(x => actionButton.Enabled = !x));\n            });\n        }\n\n        private static string CreateEventBody(string eventType, string commitId)\n        {\n            commitId = commitId ?? string.Empty;\n            var smallCommit = commitId;\n            if (string.IsNullOrEmpty(smallCommit))\n                smallCommit = \"Unknown\";\n            else if (smallCommit.Length > 7)\n                smallCommit = commitId.Substring(0, 7);\n\n            if (eventType == \"closed\")\n                return \"<p><span class=\\\"label label-danger\\\">Closed</span> this issue.</p>\";\n            if (eventType == \"reopened\")\n                return \"<p><span class=\\\"label label-success\\\">Reopened</span> this issue.</p>\";\n            if (eventType == \"merged\")\n                return \"<p><span class=\\\"label label-info\\\">Merged</span> commit \" + smallCommit + \"</p>\";\n            if (eventType == \"referenced\")\n                return \"<p><span class=\\\"label label-default\\\">Referenced</span> commit \" + smallCommit + \"</p>\";\n            return string.Empty;\n        }\n\n        public async Task RenderComments()\n        {\n            var comments = new List<Comment>();\n\n            foreach (var x in ViewModel.Comments)\n            {\n                var body = await _markdownService.Convert(x.Body);\n                comments.Add(new Comment(x.User.AvatarUrl, x.User.Login, body, x.CreatedAt));\n            }\n\n            var events = ViewModel\n                .Events\n                .Select(x => new Comment(x.Actor?.AvatarUrl, x.Actor?.Login, CreateEventBody(x.Event.StringValue, x.CommitId), x.CreatedAt));\n\n            var items = comments\n                .Concat(events)\n                .Where(x => !string.IsNullOrEmpty(x.Body))\n                .OrderBy(x => x.Date)\n                .ToList();\n            \n            var commentModel = new CommentsModel(comments, (int)UIFont.PreferredSubheadline.PointSize);\n            var razorView = new CommentsWebView { Model = commentModel };\n            var html = razorView.GenerateString();\n\n            InvokeOnMainThread(() => {\n                _commentsElement.SetValue(!comments.Any() ? null : html);\n                Render();\n            });\n        }\n\n        protected virtual void Render()\n        {\n            //Wait for the issue to load\n            if (ViewModel.Issue == null)\n                return;\n\n            _splitButton1.Text = ViewModel.Issue.Comments.ToString();\n\n            ICollection<Section> sections = new LinkedList<Section>();\n            sections.Add(new Section { _split });\n\n            var secDetails = new Section();\n            if (_descriptionElement.HasValue)\n                secDetails.Add(_descriptionElement);\n\n            secDetails.Add(_assigneeElement);\n            secDetails.Add(_milestoneElement);\n            secDetails.Add(_labelsElement);\n            sections.Add(secDetails);\n\n            var commentsSection = new Section();\n            if (_commentsElement.HasValue)\n                commentsSection.Add(_commentsElement);\n            commentsSection.Add(_addCommentElement);\n            sections.Add(commentsSection);\n\n            Root.Reset(sections);\n        }\n\n        void AddCommentTapped()\n        {\n            var composer = new MarkdownComposerViewController();\n            composer.PresentAsModal(this, async text =>\n            {\n                UIApplication.SharedApplication.BeginIgnoringInteractionEvents();\n\n                var hud = this.CreateHud();\n                hud.Show(\"Posting Comment...\");\n                if (await ViewModel.AddComment(text))\n                    this.DismissViewController(true, null);\n                hud.Hide();\n\n                UIApplication.SharedApplication.EndIgnoringInteractionEvents();\n            });\n        }\n\n        public override UIView InputAccessoryView\n        {\n            get\n            {\n                var u = new UIView(new CoreGraphics.CGRect(0, 0, 320f, 27)) { BackgroundColor = UIColor.White };\n                return u;\n            }\n        }\n\n        private void ShowExtraMenu(UIBarButtonItem item)\n        {\n            if (ViewModel.Issue == null)\n                return;\n\n            var issue = ViewModel.Issue;\n\n            var sheet = new UIActionSheet();\n            var editButton = ViewModel.IsCollaborator ? sheet.AddButton(\"Edit\") : -1;\n            var openButton = ViewModel.IsCollaborator ? sheet.AddButton(ViewModel.Issue.State == \"open\" ? \"Close\" : \"Open\") : -1;\n            var commentButton = sheet.AddButton(\"Comment\");\n            var shareButton = sheet.AddButton(\"Share\");\n            var showButton = sheet.AddButton(\"Show in GitHub\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (s, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == editButton)\n                        ViewModel.GoToEditCommand.Execute(null);\n                    else if (e.ButtonIndex == openButton)\n                        ViewModel.ToggleStateCommand.Execute(null);\n                    else if (e.ButtonIndex == shareButton)\n                    {\n                        AlertDialogService.Share(\n                            Title,\n                            issue.Body,\n                            issue.HtmlUrl,\n                            NavigationItem.RightBarButtonItem);\n                    }\n                    else if (e.ButtonIndex == showButton)\n                        ViewModel.GoToUrlCommand.Execute(ViewModel.Issue.HtmlUrl);\n                    else if (e.ButtonIndex == commentButton)\n                        AddCommentTapped();\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowFrom(item, true);\n        }\n\n        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)\n        {\n            Task.WhenAll(_descriptionElement.ForceResize(), _commentsElement.ForceResize())\n                .ToBackground(() => Root.Reload(new [] { _commentsElement, _descriptionElement }));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/IssuesView.cs",
    "content": "using System;\r\nusing MvvmCross.Platform;\r\nusing CodeHub.Core.Filters;\r\nusing CodeHub.Core.Services;\r\nusing CodeHub.Core.ViewModels.Issues;\r\nusing UIKit;\r\nusing CodeHub.iOS.ViewControllers.Filters;\r\n\r\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class IssuesView : BaseIssuesView\n    {\n        private UISegmentedControl _viewSegment;\n        private UIBarButtonItem _segmentBarButton;\n\n        public new IssuesViewModel ViewModel\n        {\n            get { return (IssuesViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        public override void ViewDidLoad()\n        {\r\n            var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add);\r\n            NavigationItem.RightBarButtonItem = addButton;\r\n\n            base.ViewDidLoad();\n\n            _viewSegment = new CustomUISegmentedControl(new [] { \"Open\", \"Closed\", \"Mine\", \"Custom\" }, 3);\n            _segmentBarButton = new UIBarButtonItem(_viewSegment);\n            _segmentBarButton.Width = View.Frame.Width - 10f;\n            ToolbarItems = new [] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), _segmentBarButton, new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) };\r\n            BindCollection(ViewModel.Issues, CreateElement);\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(addButton.GetClickedObservable().BindCommand(ViewModel.GoToNewIssueCommand));\r\n            });\r\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(false, animated);\n            base.ViewWillAppear(animated);\n\n            //Before we select which one, make sure we detach the event handler or silly things will happen\n            _viewSegment.ValueChanged -= SegmentValueChanged;\r\n\r\n            var application = Mvx.Resolve<IApplicationService>();\n\n            //Select which one is currently selected\n            if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateOpenFilter()))\n                _viewSegment.SelectedSegment = 0;\n            else if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateClosedFilter()))\n                _viewSegment.SelectedSegment = 1;\r\n            else if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateMineFilter(application.Account.Username)))\n                _viewSegment.SelectedSegment = 2;\n            else\n                _viewSegment.SelectedSegment = 3;\n\n            _viewSegment.ValueChanged += SegmentValueChanged;\n        }\n\n        void SegmentValueChanged (object sender, EventArgs e)\n        {\r\n            var application = Mvx.Resolve<IApplicationService>();\r\n\r\n            // If there is searching going on. Finish it.\r\n            FinishSearch();\n\n            if (_viewSegment.SelectedSegment == 0)\n            {\n                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateOpenFilter(), true);\n            }\n            else if (_viewSegment.SelectedSegment == 1)\n            {\n                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateClosedFilter(), true);\n            }\n            else if (_viewSegment.SelectedSegment == 2)\n            {\r\n                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateMineFilter(application.Account.Username), true);\n            }\n            else if (_viewSegment.SelectedSegment == 3)\n            {\r\n                var filter = new IssuesFilterViewController(ViewModel.Username, ViewModel.Repository, ViewModel.Issues);\r\n                var nav = new UINavigationController(filter);\r\n                PresentViewController(nav, true, null);\n            }\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(true, animated);\n        }\r\n\r\n        public override void ViewDidDisappear(bool animated)\r\n        {\r\n            base.ViewDidDisappear(animated);\r\n            _viewSegment.ValueChanged -= SegmentValueChanged;\r\n        }\r\n\r\n        private class CustomUISegmentedControl : UISegmentedControl\r\n        {\r\n            readonly int _multipleTouchIndex;\r\n            public CustomUISegmentedControl(object[] args, int multipleTouchIndex)\r\n                : base(args)\r\n            {\r\n                this._multipleTouchIndex = multipleTouchIndex;\r\n            }\r\n\r\n            public override void TouchesEnded(Foundation.NSSet touches, UIEvent evt)\r\n            {\r\n                var previousSelected = SelectedSegment;\r\n                base.TouchesEnded(touches, evt);\r\n                if (previousSelected == SelectedSegment && SelectedSegment == _multipleTouchIndex)\r\n                    SendActionForControlEvents(UIControlEvent.ValueChanged);\r\n            }\r\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Issues/MyIssuesView.cs",
    "content": "using CodeHub.Core.ViewModels.Issues;\nusing UIKit;\nusing System;\n\nnamespace CodeHub.iOS.Views.Issues\n{\n    public class MyIssuesView : BaseIssuesView\n    {\n        private readonly UISegmentedControl _viewSegment = new UISegmentedControl(new object[] { \"Open\", \"Closed\", \"Custom\" });\n        private UIBarButtonItem _segmentBarButton;\n\n        public static MyIssuesView Create()\n            => new MyIssuesView { ViewModel = new MyIssuesViewModel() };\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            _segmentBarButton = new UIBarButtonItem(_viewSegment);\n            _segmentBarButton.Width = View.Frame.Width - 10f;\n            ToolbarItems = new [] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), _segmentBarButton, new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) };\n            var vm = (MyIssuesViewModel)ViewModel;\n            var weakVm = new WeakReference<MyIssuesViewModel>(vm);\n\n            vm.Bind(x => x.SelectedFilter).Subscribe(x =>\n            {\n                var goodVm = weakVm.Get();\n\n                if (x == 2 && goodVm != null)\n                {\n                    var filter = new ViewControllers.Filters.MyIssuesFilterViewController(goodVm.Issues);\n                    var nav = new UINavigationController(filter);\n                    PresentViewController(nav, true, null);\n                }\n\n                // If there is searching going on. Finish it.\n                FinishSearch();\n            });\n\n            this.BindCollection(vm.Issues, CreateElement);\n\n            OnActivation(d =>\n            {\n                d(vm.Bind(x => x.SelectedFilter, true).Subscribe(x => _viewSegment.SelectedSegment = (nint)x));\n                d(_viewSegment.GetChangedObservable().Subscribe(x => vm.SelectedFilter = x));\n            });\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(false, animated);\n            base.ViewWillAppear(animated);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(true, animated);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/LoadingIndicatorView.cs",
    "content": "﻿using UIKit;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.Views\n{\n    public sealed class LoadingIndicatorView : UIActivityIndicatorView\n    {\n        public static UIColor DefaultColor;\n\n        public LoadingIndicatorView(bool active = true)\n            : base(UIActivityIndicatorViewStyle.White)\n        {\n            if (active)\n                StartAnimating();\n\n            Frame = new CGRect(0, 0, 320f, 88f);\n            Color = DefaultColor;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/MarkdownAccessoryView.cs",
    "content": "using UIKit;\nusing System.Collections.Generic;\nusing System.Reactive.Linq;\nusing System;\nusing ReactiveUI;\nusing CodeHub.Core.ViewModels;\n\nnamespace CodeHub.iOS.Views\n{\n    public class MarkdownAccessoryView : ButtonAccessoryView\n    {\n        public MarkdownAccessoryView(UITextView controller)\n            : base(CreateButtons(controller))\n        {\n        }\n\n        private static IEnumerable<UIButton> CreateButtons(UITextView controller)\n        {\n            var pictureImage = Octicon.FileMedia.ToImage(64);\n            var linkImage = Octicon.Link.ToImage(64);\n            var photoImage = Octicon.DeviceCamera.ToImage(64);\n\n            var vm = new MarkdownAccessoryViewModel();\n\n            return new []\n            {\n                CreateAccessoryButton(\"@\", () => controller.InsertText(\"@\")),\n                CreateAccessoryButton(\"#\", () => controller.InsertText(\"#\")),\n                CreateAccessoryButton(\"*\", () => controller.InsertText(\"*\")),\n                CreateAccessoryButton(\"`\", () => controller.InsertText(\"`\")),\n                CreateAccessoryButton(pictureImage, () => {\n                    var range = controller.SelectedRange;\n                    controller.InsertText(\"![]()\");\n                    controller.SelectedRange = new Foundation.NSRange(range.Location + 4, 0);\n                }),\n\n                CreateAccessoryButton(photoImage, () => \n                  vm.PostToImgurCommand.Execute()\n\t                .Catch(Observable.Empty<string>())\n                    .ObserveOn(RxApp.MainThreadScheduler)\n                    .Subscribe(x => controller.InsertText(\"![Image](\" + x + \")\"))),\n\n                CreateAccessoryButton(linkImage, () => {\n                    var range = controller.SelectedRange;\n                    controller.InsertText(\"[]()\");\n                    controller.SelectedRange = new Foundation.NSRange(range.Location + 1, 0);\n                }),\n                CreateAccessoryButton(\"~\", () => controller.InsertText(\"~\")),\n                CreateAccessoryButton(\"=\", () => controller.InsertText(\"=\")),\n                CreateAccessoryButton(\"-\", () => controller.InsertText(\"-\")),\n                CreateAccessoryButton(\"+\", () => controller.InsertText(\"+\")),\n                CreateAccessoryButton(\"_\", () => controller.InsertText(\"_\")),\n                CreateAccessoryButton(\"[\", () => controller.InsertText(\"[\")),\n                CreateAccessoryButton(\"]\", () => controller.InsertText(\"]\")),\n                CreateAccessoryButton(\"<\", () => controller.InsertText(\"<\")),\n                CreateAccessoryButton(\">\", () => controller.InsertText(\">\")),\n            };\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/MenuSectionView.cs",
    "content": "using CoreGraphics;\r\nusing UIKit;\r\n\r\nnamespace CodeHub.iOS.Views\n{\n    public sealed class MenuSectionView : UIView\r\n    {\r\n        public MenuSectionView(string caption)\n            : base(new CGRect(0, 0, 320, 27))\n        {\n            this.BackgroundColor = UIColor.FromRGB(50, 50, 50);\n\n            var label = new UILabel(); \n            label.BackgroundColor = UIColor.Clear;\n            label.Opaque = false; \n            label.TextColor = UIColor.FromRGB(171, 171, 171); \n            label.Font =  UIFont.BoldSystemFontOfSize(12.5f);\n            label.Frame = new CGRect(8,1,200,23); \n            label.Text = caption; \n            this.Add(label); \n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/MilestoneView.cs",
    "content": "using System;\nusing UIKit;\nusing CoreGraphics;\n\nnamespace CodeHub.iOS.Views\n{\n    public class MilestoneView : UIView\n    {\n        private readonly UILabel _titleLabel;\n        private readonly UILabel _openClosedLabel;\n        private readonly UILabel _dueLabel;\n        private readonly ProgressBarView _progressView;\n\n        public void Init(string title, int openIssues, int closedIssues, DateTimeOffset? dueDate)\n        {\n            _titleLabel.Text = title;\n            _openClosedLabel.Text = string.Format(\"{0} closed - {1} open\", closedIssues, openIssues);\n\n            var totalIssues = closedIssues + openIssues;\n            var percentage = totalIssues == 0 ? 0 : ((float)closedIssues / totalIssues);\n            _progressView.Percentage = (int)Math.Ceiling(percentage * 100);\n            if (dueDate.HasValue)\n            {\n                var remainingDays = (int)Math.Ceiling((dueDate.Value - DateTimeOffset.Now).TotalDays);\n                if (remainingDays == 0)\n                    _dueLabel.Text = \"Due Today\";\n                else if (remainingDays > 0)\n                    _dueLabel.Text = \"Due in \" + remainingDays + \" days\";\n                else if (remainingDays < 0)\n                    _dueLabel.Text = \"Overdue \" + Math.Abs(remainingDays) + \" days\";\n            }\n            else\n                _dueLabel.Text = \"No Due Date\";\n        }\n\n        public MilestoneView()\n            : base(new CGRect(0, 0, 320f, 80))\n        {\n            AutosizesSubviews = true;\n\n            _titleLabel = new UILabel();\n            _titleLabel.Frame = new CGRect(10f, 10, Frame.Width - 20f, 18f);\n            _titleLabel.Font = UIFont.BoldSystemFontOfSize(16f);\n            _titleLabel.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            Add(_titleLabel);\n\n            _openClosedLabel = new UILabel();\n            _openClosedLabel.Frame = new CGRect(10f, _titleLabel.Frame.Bottom + 1f, 150f, 12f);\n            _openClosedLabel.AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin;\n            _openClosedLabel.Font = UIFont.SystemFontOfSize(11f);\n            Add(_openClosedLabel);\n\n            _dueLabel = new UILabel();\n            _dueLabel.Frame = new CGRect(Frame.Width - 150f, _titleLabel.Frame.Bottom + 1f, 150f - 10f, 12f);\n            _dueLabel.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin;\n            _dueLabel.TextAlignment = UITextAlignment.Right;\n            _dueLabel.TextColor = UIColor.DarkGray;\n            _dueLabel.Font = UIFont.SystemFontOfSize(11f);\n            Add(_dueLabel);\n\n            _progressView = new ProgressBarView();\n            _progressView.Frame = new CGRect(10f, _openClosedLabel.Frame.Bottom + 9f, Frame.Width - 20f, 20f);\n            _progressView.Layer.MasksToBounds = true;\n            _progressView.Layer.CornerRadius = 4f;\n            _progressView.BackgroundColor = UIColor.Gray;\n            _progressView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            Add(_progressView);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/NotificationsView.cs",
    "content": "using System;\nusing CodeHub.iOS.ViewControllers;\nusing UIKit;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.Core.ViewModels.Notifications;\nusing Humanizer;\nusing CodeHub.iOS.DialogElements;\nusing System.Reactive.Linq;\n\nnamespace CodeHub.iOS.Views\n{\n    public class NotificationsView : ViewModelCollectionDrivenDialogViewController\n    {\n        private readonly UISegmentedControl _viewSegment;\n        private readonly UIBarButtonItem _segmentBarButton;\n\n        public static NotificationsView Create()\n            => new NotificationsView { ViewModel = new NotificationsViewModel() };\n\n        public NotificationsView()\n        {\n            _viewSegment = new UISegmentedControl(new object[] { \"Unread\", \"Participating\", \"All\" });\n            _segmentBarButton = new UIBarButtonItem(_viewSegment);\n\n            EmptyView = new Lazy<UIView>(() =>\n                new EmptyListView(Octicon.Inbox.ToEmptyListImage(), \"No new notifications.\"));\n        }\n\n        public override void ViewDidLoad()\n        {\n            Title = \"Notifications\";\n\n            base.ViewDidLoad();\n\n            _segmentBarButton.Width = View.Frame.Width - 10f;\n            ToolbarItems = new [] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), _segmentBarButton, new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) };\n\n            var checkButton = new UIBarButtonItem { Image = Images.Buttons.CheckButton };\n            NavigationItem.RightBarButtonItem = checkButton;\n\n            var vm = (NotificationsViewModel)ViewModel;\n            var weakVm = new WeakReference<NotificationsViewModel>(vm);\n\n            BindCollection(vm.Notifications, x =>\n            {\n                if (!DateTimeOffset.TryParse(x.UpdatedAt, out DateTimeOffset dt))\n                    dt = DateTimeOffset.Now;\n\n                var el = new StringElement(x.Subject.Title, dt.Humanize(), UITableViewCellStyle.Subtitle) { Accessory = UITableViewCellAccessory.DisclosureIndicator };\n\n                var subject = x.Subject.Type.ToLower();\n                if (subject.Equals(\"issue\"))\n                    el.Image = Octicon.IssueOpened.ToImage();\n                else if (subject.Equals(\"pullrequest\"))\n                    el.Image = Octicon.GitPullRequest.ToImage();\n                else if (subject.Equals(\"commit\"))\n                    el.Image = Octicon.GitCommit.ToImage();\n                else if (subject.Equals(\"release\"))\n                    el.Image = Octicon.Tag.ToImage();\n                else\n                    el.Image = Octicon.Alert.ToImage();\n\n                el.Clicked.Subscribe(MakeCallback(weakVm, x));\n                return el;\n            });\n\n            var o = Observable.FromEventPattern(t => vm.ReadAllCommand.CanExecuteChanged += t, t => vm.ReadAllCommand.CanExecuteChanged -= t);\n\n            OnActivation(d =>\n            {\n                d(checkButton.GetClickedObservable().BindCommand(vm.ReadAllCommand));\n                d(vm.Bind(x => x.IsMarking).SubscribeStatus(\"Marking...\"));\n                d(vm.Bind(x => x.ShownIndex, true).Subscribe(x => _viewSegment.SelectedSegment = (nint)x));\n                d(_viewSegment.GetChangedObservable().Subscribe(x => vm.ShownIndex = x));\n                d(o.Subscribe(_ => NavigationItem.RightBarButtonItem.Enabled = vm.ReadAllCommand.CanExecute(null)));\n            });\n        }\n\n        private static Action<object> MakeCallback(WeakReference<NotificationsViewModel> weakVm, Octokit.Notification model)\n        {\n            return new Action<object>(_ => weakVm.Get()?.GoToNotificationCommand.Execute(model));\n        }\n\n        protected override Section CreateSection(string text)\n        {\n            return new Section(new MarkReadSection(text, this, _viewSegment.SelectedSegment != 2));\n        }\n\n        private class MarkReadSection : UITableViewHeaderFooterView\n        {\n            readonly UIButton _button;\n            public MarkReadSection(string text, NotificationsView parent, bool button)\n                : base(new CoreGraphics.CGRect(0, 0, 320, 28f))\n            {\n                var weakVm = new WeakReference<NotificationsViewModel>(parent.ViewModel as NotificationsViewModel);\n                TextLabel.Text = text;\n\n                if (button)\n                {\n                    _button = new UIButton(UIButtonType.RoundedRect);\n                    _button.SetImage(Images.Buttons.CheckButton, UIControlState.Normal);\n                    //_button.Frame = new System.Drawing.RectangleF(320f - 42f, 1f, 26f, 26f);\n                    _button.TintColor = UIColor.FromRGB(50, 50, 50);\n                    _button.TouchUpInside += (sender, e) => weakVm.Get()?.ReadRepositoriesCommand.Execute(text);\n                    Add(_button);\n                }\n            }\n\n            public override void LayoutSubviews()\n            {\n                base.LayoutSubviews();\n\n                if (_button != null)\n                    _button.Frame = new CoreGraphics.CGRect(Frame.Width - 42f, 1, 26, 26);\n            }\n        }\n\n        public override void ViewWillAppear(bool animated)\n        {\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(false, animated);\n            base.ViewWillAppear(animated);\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            if (ToolbarItems != null)\n                NavigationController.SetToolbarHidden(true, animated);\n            base.ViewWillDisappear(animated);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ProfileButton.cs",
    "content": "using System;\nusing UIKit;\nusing CoreGraphics;\nusing CodeHub.iOS;\nusing SDWebImage;\nusing Foundation;\n\nnamespace CodeHub.iOS.Views\n{\n    public class ProfileButton : UIButton\n    {\n        private readonly UIImageView _imageView;\n        private Uri _uri;\n\n        public Uri Uri\n        {\n            get {\n                return _uri;\n            }\n            set {\n                _uri = value;\n                if (value == null)\n                    _imageView.Image = Images.Avatar;\n                else\n                    _imageView.SetImage(new NSUrl(value.AbsoluteUri), Images.Avatar);\n            }\n        }\n\n        public ProfileButton()\n        {\n            this.AutosizesSubviews = true;\n\n            _imageView = new UIImageView(new CGRect(new CGPoint(0, 0), this.Frame.Size));\n            _imageView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n            _imageView.Layer.MasksToBounds = true;\n\n            Add(_imageView);\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n            _imageView.Layer.CornerRadius = Frame.Width / 2;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ProgressBarView.cs",
    "content": "using UIKit;\nusing CoreGraphics;\nusing System;\n\nnamespace CodeHub.iOS.Views\n{\n    public class ProgressBarView : UIView\n    {\n        private readonly ProgressBarIndicator _indicator;\n        private readonly UILabel _label;\n\n        private int _percentage;\n\n        public int Percentage\n        {\n            get { return _percentage; }\n            set\n            {\n                _percentage = value;\n                _label.Text = value + \"%\";\n                SetNeedsLayout();\n            }\n        }\n\n        public ProgressBarView()\n            : base(new CGRect(0, 0, 320, 20))\n        {\n            AutosizesSubviews = true;\n\n            _indicator = new ProgressBarIndicator();\n            _indicator.Frame = new CGRect(0, 0, 0, Frame.Height);\n            _indicator.BackgroundColor = UIColor.FromRGB(0x65, 0xBD, 0x10);\n            Add(_indicator);\n\n            _label = new UILabel();\n            _label.Frame = new CGRect(10f, 1f, Frame.Width - 20f, Frame.Height - 2f);\n            _label.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;\n            _label.BackgroundColor = UIColor.Clear;\n            _label.UserInteractionEnabled = false;\n            _label.Font = UIFont.BoldSystemFontOfSize(15f);\n            _label.TextColor = UIColor.White;\n            Add(_label);\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n            _indicator.Frame = new CGRect(0, 0, Bounds.Width * (Percentage / 100f), Bounds.Height);\n        }\n\n        private class ProgressBarIndicator : UIView\n        {\n            public ProgressBarIndicator()\n            {\n                //UserInteractionEnabled = false;\n                BackgroundColor = UIColor.FromRGB(0x65, 0xBD, 0x10);\n            }\n\n            public override void Draw(CGRect rect)\n            {\n                base.Draw(rect);\n\n                var context = UIGraphics.GetCurrentContext();\n                var colorSpace = CGColorSpace.CreateDeviceRGB();\n                nfloat[] locations = { 0, 1 };\n\n                CGColor[] colors =\n                {\n                    UIColor.FromRGB(0x8D, 0xCF, 0x16).CGColor,\n                    UIColor.FromRGB(0x65, 0xBD, 0x10).CGColor,\n                };\n\n                var gradiend = new CGGradient(colorSpace, colors, locations);\n                context.DrawLinearGradient(gradiend, new CGPoint(0, 0), new CGPoint(0, rect.Size.Height), CGGradientDrawingOptions.DrawsBeforeStartLocation);\n                gradiend.Dispose();\n                colorSpace.Dispose();\n            }\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/PullRequests/PullRequestCommitsView.cs",
    "content": "using CodeHub.iOS.Views.Source;\n\nnamespace CodeHub.iOS.Views.PullRequests\n{\n    public class PullRequestCommitsView : CommitsView\n    {\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/PullRequests/PullRequestFilesView.cs",
    "content": "using CodeHub.iOS.ViewControllers;\r\nusing CodeHub.Core.ViewModels.PullRequests;\r\nusing UIKit;\r\nusing System;\r\nusing CodeHub.iOS.DialogElements;\r\nusing CodeHub.iOS.ViewControllers.Source;\nusing CodeHub.iOS.ViewControllers.PullRequests;\n\nnamespace CodeHub.iOS.Views.PullRequests\n{\n    public class PullRequestFilesView : ViewModelCollectionDrivenDialogViewController\n    {\r\n        public new PullRequestFilesViewModel ViewModel\r\n        {\r\n            get { return (PullRequestFilesViewModel)base.ViewModel; }\r\n            set { base.ViewModel = value; }\r\n        }\r\n\r\n        public PullRequestFilesView()\r\n        {\r\n            Title = \"Files\";\r\n            EmptyView = new Lazy<UIView>(() =>\r\n                new EmptyListView(Octicon.FileCode.ToEmptyListImage(), \"There are no files.\"));\r\n        }\r\n\n        public override void ViewDidLoad()\r\n        {\r\n            base.ViewDidLoad();\r\n\r\n            var weakVm = new WeakReference<PullRequestFilesViewModel>(ViewModel);\r\n            var weakVc = new WeakReference<PullRequestFilesView>(this);\r\n            BindCollection(ViewModel.Files, x =>\r\n            {\r\n                var name = x.Filename.Substring(x.Filename.LastIndexOf(\"/\", StringComparison.Ordinal) + 1);\r\n                var el = new StringElement(name, x.Status, UITableViewCellStyle.Subtitle);\r\n                el.Image = Octicon.FileCode.ToImage();\r\n                el.Accessory = UITableViewCellAccessory.DisclosureIndicator;\r\n                el.Clicked.Subscribe(_ => weakVc.Get()?.GoToFile(x));\r\n                return el;\r\n            });\r\n        }\r\n\r\n        private void GoToFile(GitHubSharp.Models.CommitModel.CommitFileModel file)\r\n        {\r\n            if (file.Patch == null)\r\n            {\n                var viewController = new FileSourceViewController(\n                    ViewModel.Username, ViewModel.Repository, file.Filename, ViewModel.Sha, Utilities.ShaType.Hash);\n                this.PushViewController(viewController);\r\n            }\r\n            else\r\n            {\r\n                var viewController = new PullRequestDiffViewController(\r\n                    ViewModel.Username, ViewModel.Repository, (int)ViewModel.PullRequestId, file.Filename,\r\n                    file.Patch, ViewModel.Sha);\r\n                this.PushViewController(viewController);\r\n            }\r\n        }\r\n\r\n        public override DialogViewController.Source CreateSizingSource()\n        {\n            return new CustomSource(this);\n        }\n    \n        private class CustomSource : DialogViewController.Source\n        {\n            public CustomSource(PullRequestFilesView parent)\n                : base(parent)\n            {\n            }\r\n\r\n            public override void WillDisplayHeaderView(UITableView tableView, UIView headerView, nint section)\r\n            {\r\n                var x = headerView as UITableViewHeaderFooterView;\r\n                if (x != null)\r\n                {\r\n                    x.TextLabel.LineBreakMode = UILineBreakMode.HeadTruncation;\r\n                }\r\n            }\n        }\n    }\n}\n\n\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/PullRequests/PullRequestView.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reactive.Linq;\nusing System.Threading.Tasks;\nusing CodeHub.Core.Services;\nusing CodeHub.Core.ViewModels.PullRequests;\nusing CodeHub.iOS.DialogElements;\nusing CodeHub.iOS.Services;\nusing CodeHub.iOS.Utilities;\nusing CodeHub.iOS.ViewControllers;\nusing CodeHub.iOS.ViewControllers.Repositories;\nusing CodeHub.WebViews;\nusing Humanizer;\nusing ReactiveUI;\nusing UIKit;\nusing Splat;\nusing System.Reactive;\n\nnamespace CodeHub.iOS.Views.PullRequests\n{\n    public class PullRequestView : PrettyDialogViewController\n    {\n        private readonly IMarkdownService _markdownService = Locator.Current.GetService<IMarkdownService>();\n        private readonly HtmlElement _descriptionElement = new HtmlElement(\"description\");\n        private readonly HtmlElement _commentsElement = new HtmlElement(\"comments\");\n        private readonly SplitViewElement _split1 = new SplitViewElement(Octicon.Gear.ToImage(), Octicon.GitMerge.ToImage());\n        private readonly SplitViewElement _split2 = new SplitViewElement(Octicon.Person.ToImage(), Octicon.Calendar.ToImage());\n        private StringElement _milestoneElement;\n        private StringElement _assigneeElement;\n        private StringElement _labelsElement;\n        private StringElement _addCommentElement;\n\n        public new PullRequestViewModel ViewModel\n        {\n            get { return (PullRequestViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        protected override void DidScroll(CoreGraphics.CGPoint p)\n        {\n            base.DidScroll(p);\n\n            _descriptionElement.SetLayout();\n            _commentsElement.SetLayout();\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            Title = \"Pull Request #\" + ViewModel.Id;\n            HeaderView.SetImage(null, Images.Avatar);\n            HeaderView.Text = Title;\n\n            Appeared.Take(1)\n                .Select(_ => Observable.Timer(TimeSpan.FromSeconds(0.2f)))\n                .Switch()\n                .ObserveOn(RxApp.MainThreadScheduler)\n                .Select(_ => ViewModel.Bind(x => x.IsClosed, true).Where(x => x.HasValue).Select(x => x.Value))\n                .Switch()\n                .Subscribe(x => \n                {\n                    HeaderView.SubImageView.TintColor = x ? UIColor.FromRGB(0xbd, 0x2c, 0) : UIColor.FromRGB(0x6c, 0xc6, 0x44);\n                    HeaderView.SetSubImage((x ? Octicon.IssueClosed :Octicon.IssueOpened).ToImage());\n                });\n\n            _milestoneElement = new StringElement(\"Milestone\", \"No Milestone\", UITableViewCellStyle.Value1) { Image = Octicon.Milestone.ToImage() };\n            _assigneeElement = new StringElement(\"Assigned\", \"Unassigned\", UITableViewCellStyle.Value1) { Image = Octicon.Person.ToImage() };\n            _labelsElement = new StringElement(\"Labels\", \"None\", UITableViewCellStyle.Value1) { Image = Octicon.Tag.ToImage() };\n            _addCommentElement = new StringElement(\"Add Comment\") { Image = Octicon.Pencil.ToImage() };\n\n            ViewModel.Bind(x => x.PullRequest).Subscribe(x =>\n            {\n                var merged = (x.Merged != null && x.Merged.Value);\n                _split1.Button1.Text = x.State;\n                _split1.Button2.Text = merged ? \"Merged\" : \"Not Merged\";\n                _split2.Button1.Text = x.User.Login;\n                _split2.Button2.Text = x.CreatedAt.ToString(\"MM/dd/yy\");\n\n                HeaderView.Text = x.Title ?? Title;\n                HeaderView.SubText = \"Updated \" + x.UpdatedAt.Humanize();\n                HeaderView.SetImage(x.User?.AvatarUrl, Images.Avatar);\n                RefreshHeaderView();\n                Render();\n            });\n\n            ViewModel.Bind(x => x.MarkdownDescription).Subscribe(description =>\n            {\n                var model = new MarkdownModel(description, (int)UIFont.PreferredSubheadline.PointSize, true);\n                var markdown = new MarkdownWebView { Model = model };\n                var html = markdown.GenerateString();\n                _descriptionElement.SetValue(string.IsNullOrEmpty(description) ? null : html);\n                Render();\n            });\n\n            var actionButton = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action) { Enabled = false };\n\n            ViewModel.Bind(x => x.IsLoading).Subscribe(x =>\n            {\n                if (!x)\n                {\n                    actionButton.Enabled = ViewModel.PullRequest != null;\n                }\n            });\n\n            ViewModel.Bind(x => x.ShouldShowPro).Subscribe(x => {\n                if (x) this.ShowPrivateView();\n            });\n\n            ViewModel.Bind(x => x.CanPush).Subscribe(_ => Render());\n \n\n            ViewModel.GoToLabelsCommand.CanExecuteChanged += (sender, e) =>\n            {\n                _labelsElement.Accessory = ViewModel.GoToLabelsCommand.CanExecute(null) ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;\n            };\n            ViewModel.GoToAssigneeCommand.CanExecuteChanged += (sender, e) =>\n            {\n                _assigneeElement.Accessory = ViewModel.GoToAssigneeCommand.CanExecute(null) ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;\n            };\n            ViewModel.GoToMilestoneCommand.CanExecuteChanged += (sender, e) =>\n            {\n                _milestoneElement.Accessory = ViewModel.GoToMilestoneCommand.CanExecute(null) ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;\n            };\n\n            ViewModel\n                .Bind(x => x.Comments)\n                .Select(_ => Unit.Default)\n                .Merge(ViewModel.Bind(x => x.Events).Select(_ => Unit.Default))\n                .Subscribe(_ => RenderComments().ToBackground());\n\n            OnActivation(d =>\n            {\n                d(_milestoneElement.Clicked.BindCommand(ViewModel.GoToMilestoneCommand));\n                d(_assigneeElement.Clicked.BindCommand(ViewModel.GoToAssigneeCommand));\n                d(_labelsElement.Clicked.BindCommand(ViewModel.GoToLabelsCommand));\n                d(_addCommentElement.Clicked.Subscribe(_ => AddCommentTapped()));\n                d(_descriptionElement.UrlRequested.BindCommand(ViewModel.GoToUrlCommand));\n                d(_commentsElement.UrlRequested.BindCommand(ViewModel.GoToUrlCommand));\n                d(actionButton.GetClickedObservable().Subscribe(_ => ShowExtraMenu()));\n                d(HeaderView.Clicked.BindCommand(ViewModel.GoToOwner));\n\n                d(ViewModel.Bind(x => x.IsModifying).SubscribeStatus(\"Loading...\"));\n\n                d(ViewModel.Bind(x => x.Issue, true).Where(x => x != null).Subscribe(x =>\n                {\n                    _assigneeElement.Value = x.Assignee != null ? x.Assignee.Login : \"Unassigned\";\n                    _milestoneElement.Value = x.Milestone != null ? x.Milestone.Title : \"No Milestone\";\n                    _labelsElement.Value = x.Labels.Count == 0 ? \"None\" : string.Join(\", \", x.Labels.Select(i => i.Name));\n                    Render();\n                }));\n            });\n        }\n\n        private static string CreateEventBody(string eventType, string commitId)\n        {\n            commitId = commitId ?? string.Empty;\n            var smallCommit = commitId;\n            if (string.IsNullOrEmpty(smallCommit))\n                smallCommit = \"Unknown\";\n            else if (smallCommit.Length > 7)\n                smallCommit = commitId.Substring(0, 7);\n\n            if (eventType == \"closed\")\n                return \"<p><span class=\\\"label label-danger\\\">Closed</span> this pull request.</p>\";\n            if (eventType == \"reopened\")\n                return \"<p><span class=\\\"label label-success\\\">Reopened</span> this pull request.</p>\";\n            if (eventType == \"merged\")\n                return \"<p><span class=\\\"label label-info\\\">Merged</span> commit \" + smallCommit + \"</p>\";\n            if (eventType == \"referenced\")\n                return \"<p><span class=\\\"label label-default\\\">Referenced</span> commit \" + smallCommit + \"</p>\";\n            return string.Empty;\n        }\n\n        public async Task RenderComments()\n        {\n            var comments = new List<Comment>();\n            foreach (var x in ViewModel.Comments)\n            {\n                var body = await _markdownService.Convert(x.Body);\n                comments.Add(new Comment(x.User.AvatarUrl, x.User.Login, body, x.CreatedAt));\n            }\n\n            var events = ViewModel\n                .Events\n                .Select(x => new Comment(x.Actor.AvatarUrl, x.Actor.Login, CreateEventBody(x.Event.StringValue, x.CommitId), x.CreatedAt));\n\n            var items = comments\n                .Concat(events)\n                .Where(x => !string.IsNullOrEmpty(x.Body))\n                .OrderBy(x => x.Date)\n                .ToList();\n            \n            var commentModel = new CommentsModel(items, (int)UIFont.PreferredSubheadline.PointSize);\n            var razorView = new CommentsWebView { Model = commentModel };\n            var html = razorView.GenerateString();\n\n            InvokeOnMainThread(() => {\n                _commentsElement.SetValue(!comments.Any() ? null : html);\n                Render();\n            });\n        }\n\n        void AddCommentTapped()\n        {\n            var composer = new MarkdownComposerViewController();\n            composer.PresentAsModal(this, async text =>\n            {\n                using (UIApplication.SharedApplication.DisableInteraction())\n                {\n                    var hud = this.CreateHud();\n                    hud.Show(\"Posting Comment...\");\n                    if (await ViewModel.AddComment(text))\n                        this.DismissViewController(true, null);\n                    hud.Hide();\n                }\n            });\n        }\n\n        public override UIView InputAccessoryView\n        {\n            get\n            {\n                var u = new UIView(new CoreGraphics.CGRect(0, 0, 320f, 27)) { BackgroundColor = UIColor.White };\n                return u;\n            }\n        }\n\n        private void ShowExtraMenu()\n        {\n            if (ViewModel.PullRequest == null)\n                return;\n\n            var pullRequest = ViewModel.PullRequest;\n\n            var sheet = new UIActionSheet();\n            var editButton = ViewModel.GoToEditCommand.CanExecute(null) ? sheet.AddButton(\"Edit\") : -1;\n            var openButton = ViewModel.IsCollaborator ? sheet.AddButton(ViewModel.PullRequest.State == \"open\" ? \"Close\" : \"Open\") : -1;\n            var commentButton = sheet.AddButton(\"Comment\");\n            var shareButton = !string.IsNullOrEmpty(ViewModel.PullRequest?.HtmlUrl) ? sheet.AddButton(\"Share\") : -1;\n            var showButton = sheet.AddButton(\"Show in GitHub\");\n            var cancelButton = sheet.AddButton(\"Cancel\");\n            sheet.CancelButtonIndex = cancelButton;\n            sheet.Dismissed += (s, e) =>\n            {\n                BeginInvokeOnMainThread(() =>\n                {\n                    if (e.ButtonIndex == editButton)\n                        ViewModel.GoToEditCommand.Execute(null);\n                    else if (e.ButtonIndex == openButton)\n                        ViewModel.ToggleStateCommand.Execute(null);\n                    else if (e.ButtonIndex == shareButton)\n                    {\n                        AlertDialogService.Share(\n                            Title,\n                            pullRequest.Body,\n                            pullRequest.HtmlUrl,\n                            NavigationItem.RightBarButtonItem);\n                    }\n                    else if (e.ButtonIndex == showButton)\n                        ViewModel.GoToUrlCommand.Execute(ViewModel.PullRequest.HtmlUrl);\n                    else if (e.ButtonIndex == commentButton)\n                        AddCommentTapped();\n                });\n\n                sheet.Dispose();\n            };\n\n            sheet.ShowInView(View);\n        }\n\n        private void Render()\n        {\n            //Wait for the issue to load\n            if (ViewModel.PullRequest == null)\n                return;\n\n            var additions = ViewModel.PullRequest?.Additions ?? 0;\n            var deletions = ViewModel.PullRequest?.Deletions ?? 0;\n            var changes = ViewModel.PullRequest?.ChangedFiles ?? 0;\n\n            var split = new SplitButtonElement();\n            split.AddButton(\"Additions\", additions.ToString());\n            split.AddButton(\"Deletions\", deletions.ToString());\n            split.AddButton(\"Changes\", changes.ToString());\n\n            ICollection<Section> sections = new LinkedList<Section>();\n            sections.Add(new Section { split });\n\n            var secDetails = new Section();\n            if (_descriptionElement.HasValue)\n                secDetails.Add(_descriptionElement);\n\n            secDetails.Add(_split1);\n            secDetails.Add(_split2);\n\n            foreach (var i in new [] { _assigneeElement, _milestoneElement, _labelsElement })\n                i.Accessory = ViewModel.IsCollaborator ? UITableViewCellAccessory.DisclosureIndicator : UITableViewCellAccessory.None;\n\n            secDetails.Add(_assigneeElement);\n            secDetails.Add(_milestoneElement);\n            secDetails.Add(_labelsElement);\n            sections.Add(secDetails);\n\n            var commits = new StringElement(\"Commits\", Octicon.GitCommit.ToImage());\n            commits.Clicked.Subscribe(_ => ViewModel.GoToCommitsCommand.Execute(null));\n\n            var files = new StringElement(\"Files\", Octicon.FileCode.ToImage());\n            files.Clicked.Subscribe(_ => ViewModel.GoToFilesCommand.Execute(null));\n\n            sections.Add(new Section { commits, files });\n\n            var isClosed = string.Equals(ViewModel.PullRequest.State, \"closed\", StringComparison.OrdinalIgnoreCase);\n            var isMerged = ViewModel.PullRequest.Merged.GetValueOrDefault();\n\n            if (ViewModel.CanPush && !isClosed && !isMerged)\n            {\n                Action mergeAction = async () =>\n                {\n                    try\n                    {\n                        await this.DoWorkAsync(\"Merging...\", ViewModel.Merge);\n                    }\n                    catch (Exception e)\n                    {\n                        AlertDialogService.ShowAlert(\"Unable to Merge\", e.Message);\n                    }\n                };\n\n                StringElement el;\n                if (!ViewModel.PullRequest.Mergeable.HasValue || ViewModel.PullRequest.Mergeable.Value)\n                {\n                    el = new StringElement(\"Merge This Pull Request!\", Octicon.GitMerge.ToImage());\n                    el.Clicked.Subscribe(_ => mergeAction());\n                }\n                else\n                {\n                    el = new StringElement(\"Merge Conflicted!\", Octicon.GitMerge.ToImage());\n                    el.Accessory = UITableViewCellAccessory.None;\n                }\n\n                sections.Add(new Section { el });\n            }\n\n            var commentsSection = new Section();\n            if (_commentsElement.HasValue)\n                commentsSection.Add(_commentsElement);\n            commentsSection.Add(_addCommentElement);\n            sections.Add(commentsSection);\n\n            Root.Reset(sections);\n\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/PullRequests/PullRequestsView.cs",
    "content": "using CodeHub.iOS.ViewControllers;\r\nusing CodeHub.Core.ViewModels.PullRequests;\r\nusing UIKit;\r\nusing CodeHub.iOS.DialogElements;\r\nusing System;\r\nusing GitHubSharp.Models;\r\n\r\nnamespace CodeHub.iOS.Views.PullRequests\n{\n    public class PullRequestsView : ViewModelCollectionDrivenDialogViewController\n    {\n        private readonly UISegmentedControl _viewSegment;\n \r\n        public PullRequestsView()\r\n        {\r\n            Title = \"Pull Requests\";\r\n\r\n            EmptyView = new Lazy<UIView>(() =>\r\n                new EmptyListView(Octicon.GitPullRequest.ToImage(64f), \"There are no pull requests.\")); \r\n\r\n            _viewSegment = new UISegmentedControl(new object[] { \"Open\", \"Closed\" });\r\n            NavigationItem.TitleView = _viewSegment;\r\n        }\n\n        public override void ViewDidLoad()\n        {\r\n            base.ViewDidLoad();\r\n\r\n            TableView.EstimatedRowHeight = 64f;\r\n            TableView.RowHeight = UITableView.AutomaticDimension;\r\n\r\n            var vm = (PullRequestsViewModel)ViewModel;\n            var weakVm = new WeakReference<PullRequestsViewModel>(vm);\n            BindCollection(vm.PullRequests, s => new PullRequestElement(s, MakeCallback(weakVm, s)));\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(vm.Bind(x => x.SelectedFilter, true).Subscribe(x => _viewSegment.SelectedSegment = (nint)x));\r\n                d(_viewSegment.GetChangedObservable().Subscribe(x => vm.SelectedFilter = x));\r\n            });\r\n        }\r\n\r\n        private static Action MakeCallback(WeakReference<PullRequestsViewModel> weakVm, PullRequestModel model)\r\n        {\r\n            return new Action(() => weakVm.Get()?.GoToPullRequestCommand.Execute(model));\r\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/RetryListView.cs",
    "content": "﻿using UIKit;\nusing CoreGraphics;\nusing System;\n\nnamespace CodeHub.iOS.Views\n{\n\tpublic class RetryListView : UIView\n\t{\n\t\tpublic static UIColor DefaultColor = UIColor.Black;\n\n\t\tpublic UIImageView ImageView { get; }\n\n\t\tpublic UILabel Title { get; }\n\n        public UIButton Button { get; }\n\n        public RetryListView(UIImage image, string text, Action retryAction)\n\t\t\t: base(new CGRect(0, 0, 320f, 480f * 2f))\n\t\t{\n\t\t\tAutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n\n\t\t\tImageView = new UIImageView();\n\t\t\tTitle = new UILabel();\n            Button = new UIButton(UIButtonType.Custom);\n            \n\t\t\tImageView.Frame = new CGRect(0, 0, 64f, 64f);\n\t\t\tImageView.TintColor = DefaultColor;\n\t\t\tImageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n\t\t\tImageView.Image = image;\n\t\t\tAdd(ImageView);\n\n\t\t\tTitle.Frame = new CGRect(0, 0, 256f, 20f);\n\t\t\tTitle.Text = text;\n\t\t\tTitle.TextAlignment = UITextAlignment.Center;\n\t\t\tTitle.Font = UIFont.PreferredHeadline;\n\t\t\tTitle.TextColor = DefaultColor;\n\t\t\tAdd(Title);\n\n            var buttonLabel = new UILabel();\n            buttonLabel.Text = \"Retry\";\n            buttonLabel.Font = UIFont.PreferredBody.MakeBold();\n            buttonLabel.TextColor = DefaultColor;\n            buttonLabel.SizeToFit();\n            buttonLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;\n\n            Button.Add(buttonLabel);\n\n            Button.Frame = new CGRect(0, 0, 96, 32);\n            Button.Layer.BorderColor = DefaultColor.CGColor;\n            Button.Layer.BorderWidth = 1f;\n            Button.Layer.CornerRadius = 6f;\n            Button.Layer.MasksToBounds = true;\n            Button.GetClickedObservable().Subscribe(_ => retryAction());\n\n            Add(Button);\n\n\t\t\tBackgroundColor = UIColor.White;\n\t\t}\n\n\t\tpublic override void LayoutSubviews()\n\t\t{\n\t\t\tbase.LayoutSubviews();\n\t\t\tImageView.Center = new CGPoint(Frame.Width / 2f, (Frame.Height / 2f) - (ImageView.Frame.Height / 2f) - 42);\n            Title.Center = new CGPoint(Frame.Width / 2f, ImageView.Frame.Bottom + 30f);\n\t\t\tButton.Center = new CGPoint(Frame.Width / 2f, Title.Frame.Bottom + 40f);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/ScrollingToolbarView.cs",
    "content": "using UIKit;\nusing CoreGraphics;\nusing System.Collections.Generic;\nusing System;\n\nnamespace CodeHub.iOS.Views\n{\n    public class ScrollingToolbarView : UIView\n    {\n        private readonly static float XPADDING;\n        private readonly static float XOFFSET;\n        private readonly UIScrollView _scrollView;\n        private readonly IEnumerable<UIButton> _buttons;\n\n        static ScrollingToolbarView()\n        {\n            XPADDING = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 10 : 15f;\n            XOFFSET = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 5 : 10;\n        }\n\n        public ScrollingToolbarView(CGRect rect, IEnumerable<UIButton> buttons)\n            : base(rect)\n        {\n            _buttons = buttons;\n            this.AutosizesSubviews = true;\n            _scrollView = new UIScrollView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));\n            _scrollView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n            _scrollView.UserInteractionEnabled = true;\n            _scrollView.ExclusiveTouch = true;\n            _scrollView.CanCancelContentTouches = true;\n            _scrollView.DelaysContentTouches = true;\n            _scrollView.ShowsHorizontalScrollIndicator = false;\n            _scrollView.ShowsVerticalScrollIndicator = false;\n\n            var line = new UIView(new CGRect(0, 0, rect.Width, 0.5f));\n            line.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleBottomMargin;\n            line.BackgroundColor = UIColor.DarkGray;\n            Add(line);\n\n            foreach (var button in buttons)\n                _scrollView.Add(button);\n\n            Add(_scrollView);\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n\n            foreach (var button in _buttons)\n                button.SizeToFit();\n\n            nfloat left = -6f;\n            foreach (var button in _buttons)\n            {\n                var frame = button.Frame;\n                frame.X = XPADDING + left;\n                frame.Y = 5f;\n                frame.Height = Bounds.Height - 10f;\n\n                if (frame.Width < frame.Height)\n                {\n                    if (frame.Height - frame.Width < XOFFSET)\n                        frame.Width = frame.Height + XPADDING;\n                    else\n                        frame.Width = frame.Height;\n                }\n                else\n                {\n                    frame.Width = frame.Width + XPADDING;\n                }\n\n                button.Frame = frame;\n                left = button.Frame.Right;\n            }\n\n            _scrollView.ContentSize = new CGSize(left + XPADDING, this.Frame.Height);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/SlideUpTitleView.cs",
    "content": "﻿using UIKit;\r\nusing CoreGraphics;\r\nusing System;\r\n\r\nnamespace CodeHub.iOS.Views\r\n{\r\n    public class SlideUpTitleView : UIView\r\n    {\r\n        private readonly UILabel _label;\r\n\r\n        public string Text\r\n        {\r\n            get { return _label.Text; }\r\n            set \r\n            { \r\n                _label.Text = value;\r\n                SetNeedsLayout();\r\n\r\n                if (Superview != null)\r\n                    Superview.SetNeedsLayout();\r\n            }\r\n        }\r\n\r\n        public nfloat Offset\r\n        {\r\n            get { return _label.Frame.Y; }\r\n            set\r\n            {\r\n                if (value < 0)\r\n                    value = 0;\r\n                var f = _label.Frame;\r\n                f.Y = value;\r\n                _label.Frame = f;\r\n            }\r\n        }\r\n\r\n        private static nfloat GetWidth() => UIScreen.MainScreen.Bounds.Width - 180;\r\n\r\n        public SlideUpTitleView(float height)\r\n            : base(new CGRect(0, 0, GetWidth(), height))\r\n        {\r\n            AutoresizingMask = UIViewAutoresizing.FlexibleHeight;\r\n\r\n            _label = new UILabel(Bounds);\r\n            _label.Font = UIFont.SystemFontOfSize(18f);\r\n            _label.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;\r\n            _label.TextAlignment = UITextAlignment.Center;\r\n            _label.LineBreakMode = UILineBreakMode.TailTruncation;\r\n            _label.TextColor = UIColor.White;\r\n            Add(_label);\r\n\r\n            Layer.MasksToBounds = true;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "CodeHub.iOS/Views/Source/ChangesetView.cs",
    "content": "using System;\r\nusing CodeHub.iOS.ViewControllers;\r\nusing UIKit;\r\nusing CodeHub.iOS.Utilities;\r\nusing System.Linq;\r\nusing Foundation;\r\nusing CodeHub.Core.ViewModels.Changesets;\r\nusing CodeHub.iOS.DialogElements;\r\nusing Humanizer;\r\nusing CodeHub.iOS.Services;\r\nusing CodeHub.iOS.ViewControllers.Repositories;\r\nusing System.Collections.Generic;\r\nusing System.Reactive.Linq;\r\nusing CodeHub.iOS.ViewControllers.Source;\n\nnamespace CodeHub.iOS.Views.Source\n{\n    public class ChangesetView : PrettyDialogViewController\n    {\r\n        public new ChangesetViewModel ViewModel\n        {\n            get { return (ChangesetViewModel)base.ViewModel; }\n            set { base.ViewModel = value; }\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\r\n\r\n            TableView.RowHeight = UITableView.AutomaticDimension;\r\n            TableView.EstimatedRowHeight = 44f;\r\n\r\n            var actionButton = new UIBarButtonItem(UIBarButtonSystemItem.Action);\r\n\r\n            HeaderView.SetImage(null, Images.Avatar);\r\n            HeaderView.Text = Title;\r\n            TableView.RowHeight = UITableView.AutomaticDimension;\r\n            TableView.EstimatedRowHeight = 44f;\r\n\r\n            ViewModel.Bind(x => x.Changeset).Subscribe(x =>\n            {\r\n                var msg = x.Commit.Message ?? string.Empty;\r\n                msg = msg.Split('\\n')[0];\r\n                HeaderView.Text = msg.Split('\\n')[0];\r\n                HeaderView.SubText = \"Commited \" + (ViewModel.Changeset?.Commit?.Committer?.Date ?? DateTimeOffset.Now).Humanize();\r\n                HeaderView.SetImage(x.Author?.AvatarUrl, Images.Avatar);\r\n                RefreshHeaderView();\r\n            });\r\n\n            ViewModel.Bind(x => x.Changeset).Subscribe(_ => Render());\r\n            ViewModel.BindCollection(x => x.Comments).Subscribe(_ => Render());\r\n            ViewModel.Bind(x => x.ShouldShowPro).Where(x => x).Subscribe(_ => this.ShowPrivateView());\r\n\r\n            OnActivation(d =>\r\n            {\r\n                d(HeaderView.Clicked.BindCommand(ViewModel.GoToOwner));\r\n                d(ViewModel.Bind(x => x.Title).Subscribe(x => Title = x));\r\n                d(actionButton.GetClickedObservable().Subscribe(_ => ShowExtraMenu()));\r\n            });\r\n        }\r\n\r\n        private void FileClicked(GitHubSharp.Models.CommitModel.CommitFileModel file)\r\n        {\r\n            if (file.Patch == null)\r\n            {\r\n                var viewController = new FileSourceViewController(\r\n                    ViewModel.User, ViewModel.Repository, file.Filename,\r\n                    ViewModel.Changeset.Sha, ShaType.Hash);\r\n\r\n                this.PushViewController(viewController);\r\n            }\r\n            else\r\n            {\r\n                var viewController = new CommitDiffViewController(\r\n                    ViewModel.User, ViewModel.Repository, ViewModel.Changeset.Sha,\r\n                    file.Filename, file.Patch);\r\n\r\n                this.PushViewController(viewController);\r\n            }\r\n        }\n\n        public void Render()\n        {\n            var commitModel = ViewModel.Changeset;\n            if (commitModel == null)\n                return;\r\n\r\n            var weakReference = new WeakReference<ChangesetView>(this);\r\n\r\n            ICollection<Section> sections = new LinkedList<Section>();\r\n\r\n            var additions = ViewModel.Changeset.Stats?.Additions ?? 0;\r\n            var deletions = ViewModel.Changeset.Stats?.Deletions ?? 0;\r\n\r\n            var split = new SplitButtonElement();\r\n            split.AddButton(\"Additions\", additions.ToString());\r\n            split.AddButton(\"Deletions\", deletions.ToString());\r\n            split.AddButton(\"Parents\", ViewModel.Changeset.Parents.Count().ToString());\r\n\n            var headerSection = new Section() { split };\n            sections.Add(headerSection);\n\n            var detailSection = new Section();\n            sections.Add(detailSection);\n\n            var user = \"Unknown\";\n            if (commitModel.Commit.Author != null)\n                user = commitModel.Commit.Author.Name;\n            if (commitModel.Commit.Committer != null)\n                user = commitModel.Commit.Committer.Name;\n\n            detailSection.Add(new MultilinedElement(user, commitModel.Commit.Message));\n\n            if (ViewModel.ShowRepository)\n            {\n                var repo = new StringElement(ViewModel.Repository)\n                {\n                    Accessory = UITableViewCellAccessory.DisclosureIndicator,\n                    Lines = 1,\n                    Font = UIFont.PreferredSubheadline,\n                    TextColor = StringElement.DefaultDetailColor,\n                    Image = Octicon.Repo.ToImage()\n                };\r\n                repo.Clicked.Subscribe(_ => ViewModel.GoToRepositoryCommand.Execute(null));\n                detailSection.Add(repo);\n            }\r\n\r\n            var paths = commitModel.Files.GroupBy(y =>\n            {\r\n                var filename = \"/\" + y.Filename;\r\n                return filename.Substring(0, filename.LastIndexOf(\"/\", System.StringComparison.Ordinal) + 1);\r\n            }).OrderBy(y => y.Key);\r\n\r\n            foreach (var p in paths)\r\n            {\r\n                var fileSection = new Section(p.Key);\r\n                foreach (var x in p)\r\n                {\r\n                    var y = x;\r\n                    var file = x.Filename.Substring(x.Filename.LastIndexOf('/') + 1);\r\n                    var sse = new ChangesetElement(file, x.Status, x.Additions, x.Deletions);\r\n                    sse.Clicked.Subscribe(_ => weakReference.Get()?.FileClicked(y));\r\n                    fileSection.Add(sse);\r\n                }\r\n                sections.Add(fileSection);\r\n            }\n            //\n            //            var fileSection = new Section();\n            //            commitModel.Files.ForEach(x => {\n            //                var file = x.Filename.Substring(x.Filename.LastIndexOf('/') + 1);\n            //                var sse = new ChangesetElement(file, x.Status, x.Additions, x.Deletions);\n            //                sse.Tapped += () => ViewModel.GoToFileCommand.Execute(x);\n            //                fileSection.Add(sse);\n            //            });\n\n            //            if (fileSection.Elements.Count > 0)\n            //                root.Add(fileSection);\n            //\n\n            var commentSection = new Section();\n            foreach (var comment in ViewModel.Comments)\n            {\n                //The path should be empty to indicate it's a comment on the entire commit, not a specific file\n                if (!string.IsNullOrEmpty(comment.Path))\n                    continue;\n\n                commentSection.Add(new CommentElement(comment.User.Login, comment.Body, comment.CreatedAt, comment.User.AvatarUrl));\n            }\r\n\r\n            if (commentSection.Elements.Count > 0)\r\n                sections.Add(commentSection);\r\n\r\n            var addComment = new StringElement(\"Add Comment\") { Image = Octicon.Pencil.ToImage() };\n            addComment.Clicked.Subscribe(_ => AddCommentTapped());\r\n            sections.Add(new Section { addComment });\n            Root.Reset(sections);\n        }\n\n        void AddCommentTapped()\n        {\n            var composer = new MarkdownComposerViewController();\n            composer.PresentAsModal(this, async text =>\r\n            {\r\n                var hud = composer.CreateHud();\r\n                \r\n                using (UIApplication.SharedApplication.DisableInteraction())\r\n                using (NetworkActivity.ActivateNetwork())\r\n                using (hud.Activate(\"Commenting...\"))\r\n                {\r\n                    try\r\n                    {\n                        await ViewModel.AddComment(text);\n                        composer.DismissViewController(true, null);\r\n                    }\r\n                    catch (Exception e)\r\n                    {\r\n                        AlertDialogService.ShowAlert(\"Unable to post comment!\", e.Message);\r\n                    }\r\n                }\r\n            });\n        }\r\n\r\n        private void ShowExtraMenu()\r\n        {\r\n            var changeset = ViewModel.Changeset;\r\n            if (changeset == null)\r\n                return;\r\n\r\n            var sheet = new UIActionSheet();\r\n            var addComment = sheet.AddButton(\"Add Comment\");\r\n            var copySha = sheet.AddButton(\"Copy Sha\");\r\n            var shareButton = sheet.AddButton(\"Share\");\r\n            //var showButton = sheet.AddButton(\"Show in GitHub\");\r\n            var cancelButton = sheet.AddButton(\"Cancel\");\r\n            sheet.CancelButtonIndex = cancelButton;\r\n            sheet.Dismissed += (s, e) =>\r\n            {\r\n                BeginInvokeOnMainThread(() =>\r\n                {\r\n                    try\r\n                    {\r\n                        // Pin to menu\r\n                        if (e.ButtonIndex == addComment)\r\n                        {\r\n                            AddCommentTapped();\r\n                        }\r\n                        else if (e.ButtonIndex == copySha)\r\n                        {\r\n                            UIPasteboard.General.String = ViewModel.Changeset.Sha;\r\n                        }\r\n                        else if (e.ButtonIndex == shareButton)\r\n                        {\r\n                            var item = new NSUrl(ViewModel.Changeset.Url);\r\n                            var activityItems = new Foundation.NSObject[] { item };\r\n                            UIActivity[] applicationActivities = null;\r\n                            var activityController = new UIActivityViewController(activityItems, applicationActivities);\r\n                            PresentViewController(activityController, true, null);\r\n                        }\r\n                        //                else if (e.ButtonIndex == showButton)\r\n                        //                {\r\n                        //                    ViewModel.GoToHtmlUrlCommand.Execute(null);\r\n                        //                }\r\n                    }\r\n                    catch\r\n                    {\r\n                    }\r\n                });\r\n\r\n                sheet.Dispose();\r\n            };\r\n\r\n            sheet.ShowInView(this.View);\r\n        }\r\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Source/ChangesetsView.cs",
    "content": "using CodeHub.Core.ViewModels.Changesets;\n\nnamespace CodeHub.iOS.Views.Source\n{\n    public class ChangesetsView : CommitsView\n    {\n        public ChangesetsView()\n            : base()\n        {\n        }\n\n        public ChangesetsView(string owner, string repository, string branch)\n            : base()\n        {\n            var viewModel = new ChangesetsViewModel();\n            viewModel.Init(new ChangesetsViewModel.NavObject\n            {\n                Username = owner,\n                Repository = repository,\n                Branch = branch\n            });\n\n            ViewModel = viewModel;\n        }\n    }\n}\n"
  },
  {
    "path": "CodeHub.iOS/Views/Source/CommitsView.cs",
    "content": "using CodeHub.iOS.ViewControllers;\nusing CodeHub.Core.ViewModels.Changesets;\nusing CodeHub.iOS.DialogElements;\nusing UIKit;\nusing CodeHub.iOS.ViewControllers.Repositories;\nusing System;\nusing System.Reactive.Linq;\nusing GitHubSharp.Models;\n\nnamespace CodeHub.iOS.Views.Source\n{\n    public abstract class CommitsView : ViewModelCollectionDrivenDialogViewController\n    {\n        public override void ViewDidLoad()\n        {\n            Title = \"Commits\";\n\n            base.ViewDidLoad();\n\n            TableView.EstimatedRowHeight = 64f;\n            TableView.RowHeight = UITableView.AutomaticDimension;\n\n            var vm = (CommitsViewModel) ViewModel;\n            var weakVm = new WeakReference<CommitsViewModel>(vm);\n            BindCollection(vm.Commits, x => new CommitElement(x, MakeCallback(weakVm, x)));\n\n            vm.Bind(x => x.ShouldShowPro)\n                .Where(x => x)\n                .Take(1)\n                .Subscribe(_ => this.ShowPrivateView());\n        }\n\n        private static Action MakeCallback(WeakReference<CommitsViewModel> weakVm, CommitModel model)\n        {\n            return new Action(() => weakVm.Get()?.GoToChangesetCommand.Execute(model));\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/Source/EditSourceView.cs",
    "content": "using System;\nusing CodeHub.iOS.ViewControllers;\nusing CodeHub.Core.ViewModels.Source;\nusing UIKit;\nusing CoreGraphics;\nusing Foundation;\nusing CodeHub.iOS.Utilities;\nusing System.Threading.Tasks;\nusing CodeHub.iOS.Services;\n\nnamespace CodeHub.iOS.Views.Source\n{\n    public class EditSourceView : BaseViewController\n    {\n        private readonly UITextView _textView;\n\n        public EditSourceViewModel ViewModel { get; }\n    \n        public EditSourceView()\n        {\n            ViewModel = new EditSourceViewModel();\n            EdgesForExtendedLayout = UIRectEdge.None;\n            Title = \"Edit\";\n\n            _textView = new UITextView {\n                Font = UIFont.FromName(\"Courier\", UIFont.PreferredBody.PointSize),\n                SpellCheckingType = UITextSpellCheckingType.No,\n                AutocorrectionType = UITextAutocorrectionType.No,\n                AutocapitalizationType = UITextAutocapitalizationType.None,\n                AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight \n            };\n        }\n      \n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            var saveButton = NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Save);\n\n            _textView.Frame = new CGRect(CGPoint.Empty, View.Bounds.Size);\n            View.AddSubview(_textView);\n\n            OnActivation(d =>\n            {\n                d(saveButton.GetClickedObservable().Subscribe(_ => Commit()));\n                d(ViewModel.Bind(x => x.Text).Subscribe(x => {\n                    _textView.Text = x;\n                    _textView.SelectedRange = new NSRange(0, 0);\n                }));\n            });\n\n            ViewModel.LoadCommand.Execute(null);\n        }\n\n        private void Commit()\n        {\n            var content = _textView.Text;\n\n            var composer = new Composer\n            {\n                Title = \"Commit Message\",\n                Text = \"Update \" + ViewModel.Path.Substring(ViewModel.Path.LastIndexOf('/') + 1)\n            };\n\n            composer.PresentAsModal(this, text => CommitThis(content, text).ToBackground());\n        }\n\n        /// <summary>\n        /// Need another function because Xamarin generates an Invalid IL if used inline above\n        /// </summary>\n        private async Task CommitThis(string content, string message)\n        {\n            try\n            {\n                UIApplication.SharedApplication.BeginIgnoringInteractionEvents();\n                await this.DoWorkAsync(\"Commiting...\", () => ViewModel.Commit(content, message));\n                this.PresentingViewController?.DismissViewController(true, null);\n            }\n            catch (Exception ex)\n            {\n                AlertDialogService.ShowAlert(\"Error\", ex.Message);\n            }\n            finally\n            {\n                UIApplication.SharedApplication.EndIgnoringInteractionEvents();\n            }\n        }\n\n        void KeyboardChange(NSNotification notification)\n        {\n            var nsValue = notification.UserInfo.ObjectForKey(UIKeyboard.FrameEndUserInfoKey) as NSValue;\n            if (nsValue == null) return;\n\n            var kbdBounds = nsValue.RectangleFValue;\n            var keyboard = View.Window.ConvertRectToView(kbdBounds, View);\n\n            UIView.Animate(\n                1.0f, 0, UIViewAnimationOptions.CurveEaseIn,\n                () => _textView.Frame = new CGRect(0, 0, View.Bounds.Width, keyboard.Top), null);\n        }\n\n        NSObject _hideNotification, _showNotification;\n        public override void ViewWillAppear(bool animated)\n        {\n            base.ViewWillAppear(animated);\n\n            _showNotification = NSNotificationCenter.DefaultCenter.AddObserver(\n                new NSString(\"UIKeyboardWillShowNotification\"), KeyboardChange);\n\n            _hideNotification = NSNotificationCenter.DefaultCenter.AddObserver(\n                new NSString(\"UIKeyboardWillHideNotification\"), KeyboardChange);\n\n            _textView.BecomeFirstResponder();\n        }\n\n        public override void ViewWillDisappear(bool animated)\n        {\n            base.ViewWillDisappear(animated);\n            if (_hideNotification != null)\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_hideNotification);\n            if (_showNotification != null)\n                NSNotificationCenter.DefaultCenter.RemoveObserver(_showNotification);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/SourceTitleView.cs",
    "content": "﻿using UIKit;\n\nnamespace CodeHub.iOS.Views\n{\n    public sealed class SourceTitleView : UIButton\n    {\n        private readonly UILabel _label = new UILabel();\n        private readonly UILabel _subLabel = new UILabel();\n        private readonly UIImageView _imageView;\n\n        public string Text\n        {\n            get { return _label.Text; }\n            set\n            {\n                _label.Text = value;\n                SetNeedsLayout();\n            }\n        }\n\n        public string SubText\n        {\n            get { return _subLabel.Text; }\n            set\n            {\n                _subLabel.Text = value;\n                SetNeedsLayout();\n            }\n        }\n\n        public override UIColor TintColor\n        {\n            get\n            {\n                return base.TintColor;\n            }\n            set\n            {\n                _label.TextColor = value;\n                _subLabel.TextColor = value;\n                _imageView.TintColor = value;\n                base.TintColor = value;\n            }\n        }\n\n        public SourceTitleView()\n            : base(new CoreGraphics.CGRect(0, 0, 200, 44f))\n        {\n            AutosizesSubviews = true;\n\n            _label.TextAlignment = UITextAlignment.Center;\n            _label.LineBreakMode = UILineBreakMode.TailTruncation;\n            _label.Lines = 1;\n            Add(_label);\n\n            _subLabel.TextAlignment = UITextAlignment.Center;\n            _subLabel.LineBreakMode = UILineBreakMode.TailTruncation;\n            _subLabel.Lines = 1;\n            Add(_subLabel);\n\n            _imageView = new UIImageView();\n            _imageView.Image = Images.DownChevron.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);\n            _imageView.Frame = new CoreGraphics.CGRect(0, 0, 8f, 8f);\n            Add(_imageView);\n\n            TintColor = UINavigationBar.Appearance.TintColor;\n            AutoresizingMask = UIViewAutoresizing.All;\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n\n            var small = Frame.Height < 44f;\n            var halfHeight = Frame.Height / 2 - 3f;\n\n            _label.Font = UIFont.SystemFontOfSize(small ? 14f : 18f);\n            _label.SizeToFit();\n            var labelFrame = _label.Frame;\n            labelFrame.Height = _label.Frame.Height > halfHeight ? halfHeight : _label.Frame.Height;\n            labelFrame.Width = labelFrame.Width >= Frame.Width ? Frame.Width - 16f : labelFrame.Width;\n            _label.Frame = labelFrame;\n            _label.Center = new CoreGraphics.CGPoint(Frame.Width / 2f, _label.Frame.Height / 2f + (small ? 2f : 3f));\n\n            _subLabel.Font = UIFont.SystemFontOfSize(small ? 10f : 12f);\n            _subLabel.SizeToFit();\n            var subLabelFrame = _subLabel.Frame;\n            subLabelFrame.Height = _subLabel.Frame.Height > halfHeight ? halfHeight : _subLabel.Frame.Height;\n            subLabelFrame.Width = _subLabel.Frame.Width >= Frame.Width ? Frame.Width - 16f : subLabelFrame.Width;\n            _subLabel.Frame = subLabelFrame;\n            _subLabel.Center = new CoreGraphics.CGPoint(Frame.Width / 2f, _label.Frame.Bottom + (_subLabel.Frame.Height / 2) + 2f);\n\n            _imageView.Center = new CoreGraphics.CGPoint(_subLabel.Frame.Right + 8f, _subLabel.Center.Y);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/TrendingTitleButton.cs",
    "content": "using UIKit;\n\nnamespace CodeHub.iOS.Views\n{\n    public class TrendingTitleButton : UIButton\n    {\n        private readonly UILabel _label;\n        private readonly UIImageView _imageView;\n\n        public string Text\n        {\n            get { return _label.Text; }\n            set \n            { \n                _label.Text = value;\n                SetNeedsLayout();\n            }\n        }\n\n        public override UIColor TintColor\n        {\n            get\n            {\n                return base.TintColor;\n            }\n            set\n            {\n                _label.TextColor = value; \n                _imageView.TintColor = value;\n                base.TintColor = value;\n            }\n        }\n\n        public TrendingTitleButton()\n        {\n            _label = new UILabel();\n            _label.TextAlignment = UITextAlignment.Center;\n            Add(_label);\n\n            _imageView = new UIImageView();\n            _imageView.Frame = new CoreGraphics.CGRect(0, 0, 12, 12);\n            _imageView.Image = Images.DownChevron.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);\n            Add(_imageView);\n        }\n\n        public override void LayoutSubviews()\n        {\n            base.LayoutSubviews();\n\n            _label.SizeToFit();\n            _label.Center = new CoreGraphics.CGPoint(Frame.Width / 2f, Frame.Height / 2f);\n            _imageView.Center = new CoreGraphics.CGPoint(_label.Frame.Right + 12f, Frame.Height / 2f);\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/Views/UILabelWithLinks.cs",
    "content": "using Foundation;\nusing System;\n\nnamespace CodeHub.iOS.Views\n{\n    [Register(\"UILabelWithLinks\")]\n    public class UILabelWithLinks : Xamarin.TTTAttributedLabel.TTTAttributedLabel\n    {\n        public UILabelWithLinks(IntPtr ptr)\n            : base(ptr)\n        {\n        }\n\n        public UILabelWithLinks(NSCoder coder)\n            : base(coder)\n        {\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/highlight-LICENSE",
    "content": "Copyright (c) 2006, Ivan Sagalaev\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n    * Neither the name of highlight.js nor the names of its contributors \n      may be used to endorse or promote products derived from this software \n      without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/highlight-line-numbers-LICENSE",
    "content": "﻿The MIT License (MIT)\n\nCopyright (c) 2017 Yauheni Pakala\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "CodeHub.iOS/WebResources/highlight.pack.js",
    "content": "/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */\n!function(e){var n=\"object\"==typeof window&&window||\"object\"==typeof self&&self;\"undefined\"!=typeof exports?e(exports):n&&(n.hljs=e({}),\"function\"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+\" \";if(o+=e.parentNode?e.parentNode.className:\"\",t=B.exec(o))return w(t[1])?t[1]:\"no-highlight\";for(o=o.split(/\\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:\"start\",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:\"stop\",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:\"start\"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return\" \"+e.nodeName+'=\"'+n(e.value).replace('\"',\"&quot;\")+'\"'}s+=\"<\"+t(e)+E.map.call(e.attributes,r).join(\"\")+\">\"}function u(e){s+=\"</\"+t(e)+\">\"}function c(e){(\"start\"===e.event?o:u)(e.node)}for(var l=0,s=\"\",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else\"start\"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),\"m\"+(e.cI?\"i\":\"\")+(r?\"g\":\"\"))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(\" \").forEach(function(e){var t=e.split(\"|\");o[t[0]]=[n,t[1]?Number(t[1]):1]})};\"string\"==typeof a.k?u(\"keyword\",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\\w+/,!0),i&&(a.bK&&(a.b=\"\\\\b(\"+a.bK.split(\" \").join(\"|\")+\")\\\\b\"),a.b||(a.b=/\\B|\\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\\B|\\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||\"\",a.eW&&i.tE&&(a.tE+=(a.e?\"|\":\"\")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l(\"self\"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?\"\\\\.?(\"+e.b+\")\\\\.?\":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join(\"|\"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?\"\":I.classPrefix,i='<span class=\"'+a,o=t?\"\":C;return i+=e+'\">',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a=\"\",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e=\"string\"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=\"\"}function v(e){L+=e.cN?p(e.cN,\"\",!0):\"\",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,\"\"),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme \"'+n+'\" for mode \"'+(E.cN||\"<unnamed>\")+'\"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: \"'+e+'\"');s(N);var R,E=i||N,x={},L=\"\";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,\"\",!0)+L);var k=\"\",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf(\"Illegal\"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&\"\\n\"===e?\"<br>\":I.tabReplace?n.replace(/\\t/g,I.tabReplace):\"\"}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\\bhljs\\b/)||a.push(\"hljs\"),-1===e.indexOf(r)&&a.push(r),a.join(\" \").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),n.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll(\"pre code\");E.forEach.call(e,d)}}function m(){addEventListener(\"DOMContentLoaded\",v,!1),addEventListener(\"load\",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||\"\").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\\blang(?:uage)?-([\\w-]+)\\b/i,M=/((^(<[^>]+>|\\t|)+|(?:\\n)))/gm,C=\"</span>\",I={classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR=\"[a-zA-Z]\\\\w*\",e.UIR=\"[a-zA-Z_]\\\\w*\",e.NR=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",e.CNR=\"(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",e.BNR=\"\\\\b(0b[01]+)\",e.RSR=\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",e.BE={b:\"\\\\\\\\[\\\\s\\\\S]\",r:0},e.ASM={cN:\"string\",b:\"'\",e:\"'\",i:\"\\\\n\",c:[e.BE]},e.QSM={cN:\"string\",b:'\"',e:'\"',i:\"\\\\n\",c:[e.BE]},e.PWM={b:/\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/},e.C=function(n,t,r){var a=e.inherit({cN:\"comment\",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:\"doctag\",b:\"(?:TODO|FIXME|NOTE|BUG|XXX):\",r:0}),a},e.CLCM=e.C(\"//\",\"$\"),e.CBCM=e.C(\"/\\\\*\",\"\\\\*/\"),e.HCM=e.C(\"#\",\"$\"),e.NM={cN:\"number\",b:e.NR,r:0},e.CNM={cN:\"number\",b:e.CNR,r:0},e.BNM={cN:\"number\",b:e.BNR,r:0},e.CSSNM={cN:\"number\",b:e.NR+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",r:0},e.RM={cN:\"regexp\",b:/\\//,e:/\\/[gimuy]*/,i:/\\n/,c:[e.BE,{b:/\\[/,e:/\\]/,r:0,c:[e.BE]}]},e.TM={cN:\"title\",b:e.IR,r:0},e.UTM={cN:\"title\",b:e.UIR,r:0},e.METHOD_GUARD={b:\"\\\\.\\\\s*\"+e.UIR,r:0},e});hljs.registerLanguage(\"apache\",function(e){var r={cN:\"number\",b:\"[\\\\$%]\\\\d+\"};return{aliases:[\"apacheconf\"],cI:!0,c:[e.HCM,{cN:\"section\",b:\"</?\",e:\">\"},{cN:\"attribute\",b:/\\w+/,r:0,k:{nomarkup:\"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername\"},starts:{e:/$/,r:0,k:{literal:\"on off all\"},c:[{cN:\"meta\",b:\"\\\\s\\\\[\",e:\"\\\\]$\"},{cN:\"variable\",b:\"[\\\\$%]\\\\{\",e:\"\\\\}\",c:[\"self\",r]},r,e.QSM]}}],i:/\\S/}});hljs.registerLanguage(\"fsharp\",function(e){var t={b:\"<\",e:\">\",c:[e.inherit(e.TM,{b:/'[a-zA-Z0-9_]+/})]};return{aliases:[\"fs\"],k:\"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield\",i:/\\/\\*/,c:[{cN:\"keyword\",b:/\\b(yield|return|let|do)!/},{cN:\"string\",b:'@\"',e:'\"',c:[{b:'\"\"'}]},{cN:\"string\",b:'\"\"\"',e:'\"\"\"'},e.C(\"\\\\(\\\\*\",\"\\\\*\\\\)\"),{cN:\"class\",bK:\"type\",e:\"\\\\(|=|$\",eE:!0,c:[e.UTM,t]},{cN:\"meta\",b:\"\\\\[<\",e:\">\\\\]\",r:10},{cN:\"symbol\",b:\"\\\\B('[A-Za-z])\\\\b\",c:[e.BE]},e.CLCM,e.inherit(e.QSM,{i:null}),e.CNM]}});hljs.registerLanguage(\"d\",function(e){var t={keyword:\"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__\",built_in:\"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring\",literal:\"false null true\"},r=\"(0|[1-9][\\\\d_]*)\",a=\"(0|[1-9][\\\\d_]*|\\\\d[\\\\d_]*|[\\\\d_]+?\\\\d)\",i=\"0[bB][01_]+\",n=\"([\\\\da-fA-F][\\\\da-fA-F_]*|_[\\\\da-fA-F][\\\\da-fA-F_]*)\",_=\"0[xX]\"+n,c=\"([eE][+-]?\"+a+\")\",d=\"(\"+a+\"(\\\\.\\\\d*|\"+c+\")|\\\\d+\\\\.\"+a+a+\"|\\\\.\"+r+c+\"?)\",o=\"(0[xX](\"+n+\"\\\\.\"+n+\"|\\\\.?\"+n+\")[pP][+-]?\"+a+\")\",s=\"(\"+r+\"|\"+i+\"|\"+_+\")\",l=\"(\"+o+\"|\"+d+\")\",u=\"\\\\\\\\(['\\\"\\\\?\\\\\\\\abfnrtv]|u[\\\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\\\dA-Fa-f]{2}|U[\\\\dA-Fa-f]{8})|&[a-zA-Z\\\\d]{2,};\",b={cN:\"number\",b:\"\\\\b\"+s+\"(L|u|U|Lu|LU|uL|UL)?\",r:0},f={cN:\"number\",b:\"\\\\b(\"+l+\"([fF]|L|i|[fF]i|Li)?|\"+s+\"(i|[fF]i|Li))\",r:0},g={cN:\"string\",b:\"'(\"+u+\"|.)\",e:\"'\",i:\".\"},h={b:u,r:0},p={cN:\"string\",b:'\"',c:[h],e:'\"[cwd]?'},m={cN:\"string\",b:'[rq]\"',e:'\"[cwd]?',r:5},w={cN:\"string\",b:\"`\",e:\"`[cwd]?\"},N={cN:\"string\",b:'x\"[\\\\da-fA-F\\\\s\\\\n\\\\r]*\"[cwd]?',r:10},A={cN:\"string\",b:'q\"\\\\{',e:'\\\\}\"'},F={cN:\"meta\",b:\"^#!\",e:\"$\",r:5},y={cN:\"meta\",b:\"#(line)\",e:\"$\",r:5},L={cN:\"keyword\",b:\"@[a-zA-Z_][a-zA-Z_\\\\d]*\"},v=e.C(\"\\\\/\\\\+\",\"\\\\+\\\\/\",{c:[\"self\"],r:10});return{l:e.UIR,k:t,c:[e.CLCM,e.CBCM,v,N,p,m,w,A,f,b,g,F,y,L]}});hljs.registerLanguage(\"go\",function(e){var t={keyword:\"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune\",literal:\"true false iota nil\",built_in:\"append cap close complex copy imag len make new panic print println real recover delete\"};return{aliases:[\"golang\"],k:t,i:\"</\",c:[e.CLCM,e.CBCM,{cN:\"string\",v:[e.QSM,{b:\"'\",e:\"[^\\\\\\\\]'\"},{b:\"`\",e:\"`\"}]},{cN:\"number\",v:[{b:e.CNR+\"[dflsi]\",r:1},e.CNM]},{b:/:=/},{cN:\"function\",bK:\"func\",e:/\\s*\\{/,eE:!0,c:[e.TM,{cN:\"params\",b:/\\(/,e:/\\)/,k:t,i:/[\"']/}]}]}});hljs.registerLanguage(\"elm\",function(e){var i={v:[e.C(\"--\",\"$\"),e.C(\"{-\",\"-}\",{c:[\"self\"]})]},t={cN:\"type\",b:\"\\\\b[A-Z][\\\\w']*\",r:0},c={b:\"\\\\(\",e:\"\\\\)\",i:'\"',c:[{cN:\"type\",b:\"\\\\b[A-Z][\\\\w]*(\\\\((\\\\.\\\\.|,|\\\\w+)\\\\))?\"},i]},n={b:\"{\",e:\"}\",c:c.c};return{k:\"let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription\",c:[{bK:\"port effect module\",e:\"exposing\",k:\"port effect module where command subscription exposing\",c:[c,i],i:\"\\\\W\\\\.|;\"},{b:\"import\",e:\"$\",k:\"import as exposing\",c:[c,i],i:\"\\\\W\\\\.|;\"},{b:\"type\",e:\"$\",k:\"type alias\",c:[t,c,n,i]},{bK:\"infix infixl infixr\",e:\"$\",c:[e.CNM,i]},{b:\"port\",e:\"$\",k:\"port\",c:[i]},e.QSM,e.CNM,t,e.inherit(e.TM,{b:\"^[_a-z][\\\\w']*\"}),i,{b:\"->|<-\"}],i:/;/}});hljs.registerLanguage(\"xml\",function(s){var e=\"[A-Za-z0-9\\\\._:-]+\",t={eW:!0,i:/</,r:0,c:[{cN:\"attr\",b:e,r:0},{b:/=\\s*/,r:0,c:[{cN:\"string\",endsParent:!0,v:[{b:/\"/,e:/\"/},{b:/'/,e:/'/},{b:/[^\\s\"'=<>`]+/}]}]}]};return{aliases:[\"html\",\"xhtml\",\"rss\",\"atom\",\"xjb\",\"xsd\",\"xsl\",\"plist\"],cI:!0,c:[{cN:\"meta\",b:\"<!DOCTYPE\",e:\">\",r:10,c:[{b:\"\\\\[\",e:\"\\\\]\"}]},s.C(\"<!--\",\"-->\",{r:10}),{b:\"<\\\\!\\\\[CDATA\\\\[\",e:\"\\\\]\\\\]>\",r:10},{b:/<\\?(php)?/,e:/\\?>/,sL:\"php\",c:[{b:\"/\\\\*\",e:\"\\\\*/\",skip:!0}]},{cN:\"tag\",b:\"<style(?=\\\\s|>|$)\",e:\">\",k:{name:\"style\"},c:[t],starts:{e:\"</style>\",rE:!0,sL:[\"css\",\"xml\"]}},{cN:\"tag\",b:\"<script(?=\\\\s|>|$)\",e:\">\",k:{name:\"script\"},c:[t],starts:{e:\"</script>\",rE:!0,sL:[\"actionscript\",\"javascript\",\"handlebars\",\"xml\"]}},{cN:\"meta\",v:[{b:/<\\?xml/,e:/\\?>/,r:10},{b:/<\\?\\w+/,e:/\\?>/}]},{cN:\"tag\",b:\"</?\",e:\"/?>\",c:[{cN:\"name\",b:/[^\\/><\\s]+/,r:0},t]}]}});hljs.registerLanguage(\"markdown\",function(e){return{aliases:[\"md\",\"mkdown\",\"mkd\"],c:[{cN:\"section\",v:[{b:\"^#{1,6}\",e:\"$\"},{b:\"^.+?\\\\n[=-]{2,}$\"}]},{b:\"<\",e:\">\",sL:\"xml\",r:0},{cN:\"bullet\",b:\"^([*+-]|(\\\\d+\\\\.))\\\\s+\"},{cN:\"strong\",b:\"[*_]{2}.+?[*_]{2}\"},{cN:\"emphasis\",v:[{b:\"\\\\*.+?\\\\*\"},{b:\"_.+?_\",r:0}]},{cN:\"quote\",b:\"^>\\\\s+\",e:\"$\"},{cN:\"code\",v:[{b:\"^```w*s*$\",e:\"^```s*$\"},{b:\"`.+?`\"},{b:\"^( {4}|\t)\",e:\"$\",r:0}]},{b:\"^[-\\\\*]{3,}\",e:\"$\"},{b:\"\\\\[.+?\\\\][\\\\(\\\\[].*?[\\\\)\\\\]]\",rB:!0,c:[{cN:\"string\",b:\"\\\\[\",e:\"\\\\]\",eB:!0,rE:!0,r:0},{cN:\"link\",b:\"\\\\]\\\\(\",e:\"\\\\)\",eB:!0,eE:!0},{cN:\"symbol\",b:\"\\\\]\\\\[\",e:\"\\\\]\",eB:!0,eE:!0}],r:10},{b:/^\\[[^\\n]+\\]:/,rB:!0,c:[{cN:\"symbol\",b:/\\[/,e:/\\]/,eB:!0,eE:!0},{cN:\"link\",b:/:\\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage(\"dart\",function(e){var t={cN:\"subst\",b:\"\\\\$\\\\{\",e:\"}\",k:\"true false null this is new super\"},r={cN:\"string\",v:[{b:\"r'''\",e:\"'''\"},{b:'r\"\"\"',e:'\"\"\"'},{b:\"r'\",e:\"'\",i:\"\\\\n\"},{b:'r\"',e:'\"',i:\"\\\\n\"},{b:\"'''\",e:\"'''\",c:[e.BE,t]},{b:'\"\"\"',e:'\"\"\"',c:[e.BE,t]},{b:\"'\",e:\"'\",i:\"\\\\n\",c:[e.BE,t]},{b:'\"',e:'\"',i:\"\\\\n\",c:[e.BE,t]}]};t.c=[e.CNM,r];var n={keyword:\"assert async await break case catch class const continue default do else enum extends false final finally for if in is new null rethrow return super switch sync this throw true try var void while with yield abstract as dynamic export external factory get implements import library operator part set static typedef\",built_in:\"print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num document window querySelector querySelectorAll Element ElementList\"};return{k:n,c:[r,e.C(\"/\\\\*\\\\*\",\"\\\\*/\",{sL:\"markdown\"}),e.C(\"///\",\"$\",{sL:\"markdown\"}),e.CLCM,e.CBCM,{cN:\"class\",bK:\"class interface\",e:\"{\",eE:!0,c:[{bK:\"extends implements\"},e.UTM]},e.CNM,{cN:\"meta\",b:\"@[A-Za-z]+\"},{b:\"=>\"}]}});hljs.registerLanguage(\"cmake\",function(e){return{aliases:[\"cmake.in\"],cI:!0,k:{keyword:\"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or equal less greater strless strgreater strequal matches\"},c:[{cN:\"variable\",b:\"\\\\${\",e:\"}\"},e.HCM,e.QSM,e.NM]}});hljs.registerLanguage(\"bash\",function(e){var t={cN:\"variable\",v:[{b:/\\$[\\w\\d#@][\\w\\d_]*/},{b:/\\$\\{(.*?)}/}]},s={cN:\"string\",b:/\"/,e:/\"/,c:[e.BE,t,{cN:\"variable\",b:/\\$\\(/,e:/\\)/,c:[e.BE]}]},a={cN:\"string\",b:/'/,e:/'/};return{aliases:[\"sh\",\"zsh\"],l:/\\b-?[a-z\\._]+\\b/,k:{keyword:\"if then else elif fi for while in do done case esac function\",literal:\"true false\",built_in:\"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp\",_:\"-ne -eq -lt -gt -f -d -e -s -l -a\"},c:[{cN:\"meta\",b:/^#![^\\n]+sh\\s*$/,r:10},{cN:\"function\",b:/\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,rB:!0,c:[e.inherit(e.TM,{b:/\\w[\\w\\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage(\"shell\",function(s){return{aliases:[\"console\"],c:[{cN:\"meta\",b:\"^\\\\s{0,3}[\\\\w\\\\d\\\\[\\\\]()@-]*[>%$#]\",starts:{e:\"$\",sL:\"bash\"}}]}});hljs.registerLanguage(\"erlang\",function(e){var r=\"[a-z'][a-zA-Z0-9_']*\",c=\"(\"+r+\":\"+r+\"|\"+r+\")\",b={keyword:\"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor\",literal:\"false true\"},i=e.C(\"%\",\"$\"),n={cN:\"number\",b:\"\\\\b(\\\\d+#[a-fA-F0-9]+|\\\\d+(\\\\.\\\\d+)?([eE][-+]?\\\\d+)?)\",r:0},a={b:\"fun\\\\s+\"+r+\"/\\\\d+\"},d={b:c+\"\\\\(\",e:\"\\\\)\",rB:!0,r:0,c:[{b:c,r:0},{b:\"\\\\(\",e:\"\\\\)\",eW:!0,rE:!0,r:0}]},o={b:\"{\",e:\"}\",r:0},t={b:\"\\\\b_([A-Z][A-Za-z0-9_]*)?\",r:0},f={b:\"[A-Z][a-zA-Z0-9_]*\",r:0},l={b:\"#\"+e.UIR,r:0,rB:!0,c:[{b:\"#\"+e.UIR,r:0},{b:\"{\",e:\"}\",r:0}]},s={bK:\"fun receive if try case\",e:\"end\",k:b};s.c=[i,a,e.inherit(e.ASM,{cN:\"\"}),s,d,e.QSM,n,o,t,f,l];var u=[i,a,s,d,e.QSM,n,o,t,f,l];d.c[1].c=u,o.c=u,l.c[1].c=u;var h={cN:\"params\",b:\"\\\\(\",e:\"\\\\)\",c:u};return{aliases:[\"erl\"],k:b,i:\"(</|\\\\*=|\\\\+=|-=|/\\\\*|\\\\*/|\\\\(\\\\*|\\\\*\\\\))\",c:[{cN:\"function\",b:\"^\"+r+\"\\\\s*\\\\(\",e:\"->\",rB:!0,i:\"\\\\(|#|//|/\\\\*|\\\\\\\\|:|;\",c:[h,e.inherit(e.TM,{b:r})],starts:{e:\";|\\\\.\",k:b,c:u}},i,{b:\"^-\",e:\"\\\\.\",r:0,eE:!0,rB:!0,l:\"-\"+e.IR,k:\"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec\",c:[h]},n,e.QSM,l,t,f,o,{b:/\\.$/}]}});hljs.registerLanguage(\"dos\",function(e){var r=e.C(/^\\s*@?rem\\b/,/$/,{r:10}),t={cN:\"symbol\",b:\"^\\\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\\\s+label)\",r:0};return{aliases:[\"bat\",\"cmd\"],cI:!0,i:/\\/\\*/,k:{keyword:\"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq\",built_in:\"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del\"},c:[{cN:\"variable\",b:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{cN:\"function\",b:t.b,e:\"goto:eof\",c:[e.inherit(e.TM,{b:\"([_a-zA-Z]\\\\w*\\\\.)*([_a-zA-Z]\\\\w*:)?[_a-zA-Z]\\\\w*\"}),r]},{cN:\"number\",b:\"\\\\b\\\\d+\",r:0},r]}});hljs.registerLanguage(\"javascript\",function(e){var r=\"[A-Za-z$_][0-9A-Za-z$_]*\",t={keyword:\"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise\"},a={cN:\"number\",v:[{b:\"\\\\b(0[bB][01]+)\"},{b:\"\\\\b(0[oO][0-7]+)\"},{b:e.CNR}],r:0},n={cN:\"subst\",b:\"\\\\$\\\\{\",e:\"\\\\}\",k:t,c:[]},c={cN:\"string\",b:\"`\",e:\"`\",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:[\"js\",\"jsx\"],k:t,c:[{cN:\"meta\",r:10,b:/^\\s*['\"]use (strict|asm)['\"]/},{cN:\"meta\",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\\s*/,r:0,c:[{b:r+\"\\\\s*:\",rB:!0,r:0,c:[{cN:\"attr\",b:r,r:0}]}]},{b:\"(\"+e.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[e.CLCM,e.CBCM,e.RM,{cN:\"function\",b:\"(\\\\(.*?\\\\)|\"+r+\")\\\\s*=>\",rB:!0,e:\"\\\\s*=>\",c:[{cN:\"params\",v:[{b:r},{b:/\\(\\s*\\)/},{b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\\/\\w+|\\w+\\/)>/,sL:\"xml\",c:[{b:/<\\w+\\s*\\/>/,skip:!0},{b:/<\\w+/,e:/(\\/\\w+|\\w+\\/)>/,skip:!0,c:[{b:/<\\w+\\s*\\/>/,skip:!0},\"self\"]}]}],r:0},{cN:\"function\",bK:\"function\",e:/\\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,c:s}],i:/\\[|%/},{b:/\\$[(.]/},e.METHOD_GUARD,{cN:\"class\",bK:\"class\",e:/[{;=]/,eE:!0,i:/[:\"\\[\\]]/,c:[{bK:\"extends\"},e.UTM]},{bK:\"constructor\",e:/\\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage(\"puppet\",function(e){var s={keyword:\"and case default else elsif false if in import enherits node or true undef unless main settings $string \",literal:\"alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted\",built_in:\"architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version\"},r=e.C(\"#\",\"$\"),a=\"([A-Za-z_]|::)(\\\\w|::)*\",i=e.inherit(e.TM,{b:a}),o={cN:\"variable\",b:\"\\\\$\"+a},t={cN:\"string\",c:[e.BE,o],v:[{b:/'/,e:/'/},{b:/\"/,e:/\"/}]};return{aliases:[\"pp\"],c:[r,o,t,{bK:\"class\",e:\"\\\\{|;\",i:/=/,c:[i,r]},{bK:\"define\",e:/\\{/,c:[{cN:\"section\",b:e.IR,endsParent:!0}]},{b:e.IR+\"\\\\s+\\\\{\",rB:!0,e:/\\S/,c:[{cN:\"keyword\",b:e.IR},{b:/\\{/,e:/\\}/,k:s,r:0,c:[t,r,{b:\"[a-zA-Z_]+\\\\s*=>\",rB:!0,e:\"=>\",c:[{cN:\"attr\",b:e.IR}]},{cN:\"number\",b:\"(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b\",r:0},o]}],r:0}]}});hljs.registerLanguage(\"typescript\",function(e){var r={keyword:\"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise\"};return{aliases:[\"ts\"],k:r,c:[{cN:\"meta\",b:/^\\s*['\"]use strict['\"]/},e.ASM,e.QSM,{cN:\"string\",b:\"`\",e:\"`\",c:[e.BE,{cN:\"subst\",b:\"\\\\$\\\\{\",e:\"\\\\}\"}]},e.CLCM,e.CBCM,{cN:\"number\",v:[{b:\"\\\\b(0[bB][01]+)\"},{b:\"\\\\b(0[oO][0-7]+)\"},{b:e.CNR}],r:0},{b:\"(\"+e.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[e.CLCM,e.CBCM,e.RM,{cN:\"function\",b:\"(\\\\(.*?\\\\)|\"+e.IR+\")\\\\s*=>\",rB:!0,e:\"\\\\s*=>\",c:[{cN:\"params\",v:[{b:e.IR},{b:/\\(\\s*\\)/},{b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:r,c:[\"self\",e.CLCM,e.CBCM]}]}]}],r:0},{cN:\"function\",b:\"function\",e:/[\\{;]/,eE:!0,k:r,c:[\"self\",e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:r,c:[e.CLCM,e.CBCM],i:/[\"'\\(]/}],i:/%/,r:0},{bK:\"constructor\",e:/\\{/,eE:!0,c:[\"self\",{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:r,c:[e.CLCM,e.CBCM],i:/[\"'\\(]/}]},{b:/module\\./,k:{built_in:\"module\"},r:0},{bK:\"module\",e:/\\{/,eE:!0},{bK:\"interface\",e:/\\{/,eE:!0,k:\"interface extends\"},{b:/\\$[(.]/},{b:\"\\\\.\"+e.IR,r:0},{cN:\"meta\",b:\"@[A-Za-z]+\"}]}});hljs.registerLanguage(\"ini\",function(e){var b={cN:\"string\",c:[e.BE],v:[{b:\"'''\",e:\"'''\",r:10},{b:'\"\"\"',e:'\"\"\"',r:10},{b:'\"',e:'\"'},{b:\"'\",e:\"'\"}]};return{aliases:[\"toml\"],cI:!0,i:/\\S/,c:[e.C(\";\",\"$\"),e.HCM,{cN:\"section\",b:/^\\s*\\[+/,e:/\\]+/},{b:/^[a-z0-9\\[\\]_-]+\\s*=\\s*/,e:\"$\",rB:!0,c:[{cN:\"attr\",b:/[a-z0-9\\[\\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:\"literal\",b:/\\bon|off|true|false|yes|no\\b/},{cN:\"variable\",v:[{b:/\\$[\\w\\d\"][\\w\\d_]*/},{b:/\\$\\{(.*?)}/}]},b,{cN:\"number\",b:/([\\+\\-]+)?[\\d]+_[\\d_]+/},e.NM]}]}]}});hljs.registerLanguage(\"coffeescript\",function(e){var c={keyword:\"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not\",literal:\"true false null undefined yes no on off\",built_in:\"npm require console print module global window document\"},n=\"[A-Za-z$_][0-9A-Za-z$_]*\",r={cN:\"subst\",b:/#\\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:\"(\\\\s*/)?\",r:0}}),{cN:\"string\",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/\"\"\"/,e:/\"\"\"/,c:[e.BE,r]},{b:/\"/,e:/\"/,c:[e.BE,r]}]},{cN:\"regexp\",v:[{b:\"///\",e:\"///\",c:[r,e.HCM]},{b:\"//[gim]*\",r:0},{b:/\\/(?![ *])(\\\\\\/|.)*?\\/[gim]*(?=\\W|$)/}]},{b:\"@\"+n},{sL:\"javascript\",eB:!0,eE:!0,v:[{b:\"```\",e:\"```\"},{b:\"`\",e:\"`\"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t=\"(\\\\(.*\\\\))?\\\\s*\\\\B[-=]>\",o={cN:\"params\",b:\"\\\\([^\\\\(]\",rB:!0,c:[{b:/\\(/,e:/\\)/,k:c,c:[\"self\"].concat(i)}]};return{aliases:[\"coffee\",\"cson\",\"iced\"],k:c,i:/\\/\\*/,c:i.concat([e.C(\"###\",\"###\"),e.HCM,{cN:\"function\",b:\"^\\\\s*\"+n+\"\\\\s*=\\\\s*\"+t,e:\"[-=]>\",rB:!0,c:[s,o]},{b:/[:\\(,=]\\s*/,r:0,c:[{cN:\"function\",b:t,e:\"[-=]>\",rB:!0,c:[o]}]},{cN:\"class\",bK:\"class\",e:\"$\",i:/[:=\"\\[\\]]/,c:[{bK:\"extends\",eW:!0,i:/[:=\"\\[\\]]/,c:[s]},s]},{b:n+\":\",e:\":\",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage(\"lisp\",function(b){var e=\"[a-zA-Z_\\\\-\\\\+\\\\*\\\\/\\\\<\\\\=\\\\>\\\\&\\\\#][a-zA-Z0-9_\\\\-\\\\+\\\\*\\\\/\\\\<\\\\=\\\\>\\\\&\\\\#!]*\",c=\"\\\\|[^]*?\\\\|\",r=\"(\\\\-|\\\\+)?\\\\d+(\\\\.\\\\d+|\\\\/\\\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\\\+|\\\\-)?\\\\d+)?\",a={cN:\"meta\",b:\"^#!\",e:\"$\"},l={cN:\"literal\",b:\"\\\\b(t{1}|nil)\\\\b\"},n={cN:\"number\",v:[{b:r,r:0},{b:\"#(b|B)[0-1]+(/[0-1]+)?\"},{b:\"#(o|O)[0-7]+(/[0-7]+)?\"},{b:\"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?\"},{b:\"#(c|C)\\\\(\"+r+\" +\"+r,e:\"\\\\)\"}]},i=b.inherit(b.QSM,{i:null}),t=b.C(\";\",\"$\",{r:0}),s={b:\"\\\\*\",e:\"\\\\*\"},u={cN:\"symbol\",b:\"[:&]\"+e},d={b:e,r:0},f={b:c},m={b:\"\\\\(\",e:\"\\\\)\",c:[\"self\",l,i,n,d]},o={c:[n,i,s,u,m,d],v:[{b:\"['`]\\\\(\",e:\"\\\\)\"},{b:\"\\\\(quote \",e:\"\\\\)\",k:{name:\"quote\"}},{b:\"'\"+c}]},v={v:[{b:\"'\"+e},{b:\"#'\"+e+\"(::\"+e+\")*\"}]},N={b:\"\\\\(\\\\s*\",e:\"\\\\)\"},A={eW:!0,r:0};return N.c=[{cN:\"name\",v:[{b:e},{b:c}]},A],A.c=[o,v,N,l,n,i,t,s,u,f,d],{i:/\\S/,c:[n,a,l,i,t,o,v,N,d]}});hljs.registerLanguage(\"ruby\",function(e){var b=\"[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?\",r={keyword:\"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor\",literal:\"true false nil\"},c={cN:\"doctag\",b:\"@[A-Za-z]+\"},a={b:\"#<\",e:\">\"},s=[e.C(\"#\",\"$\",{c:[c]}),e.C(\"^\\\\=begin\",\"^\\\\=end\",{c:[c],r:10}),e.C(\"^__END__\",\"\\\\n$\")],n={cN:\"subst\",b:\"#\\\\{\",e:\"}\",k:r},t={cN:\"string\",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/\"/,e:/\"/},{b:/`/,e:/`/},{b:\"%[qQwWx]?\\\\(\",e:\"\\\\)\"},{b:\"%[qQwWx]?\\\\[\",e:\"\\\\]\"},{b:\"%[qQwWx]?{\",e:\"}\"},{b:\"%[qQwWx]?<\",e:\">\"},{b:\"%[qQwWx]?/\",e:\"/\"},{b:\"%[qQwWx]?%\",e:\"%\"},{b:\"%[qQwWx]?-\",e:\"-\"},{b:\"%[qQwWx]?\\\\|\",e:\"\\\\|\"},{b:/\\B\\?(\\\\\\d{1,3}|\\\\x[A-Fa-f0-9]{1,2}|\\\\u[A-Fa-f0-9]{4}|\\\\?\\S)\\b/},{b:/<<(-?)\\w+$/,e:/^\\s*\\w+$/}]},i={cN:\"params\",b:\"\\\\(\",e:\"\\\\)\",endsParent:!0,k:r},d=[t,a,{cN:\"class\",bK:\"class module\",e:\"$|;\",i:/=/,c:[e.inherit(e.TM,{b:\"[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?\"}),{b:\"<\\\\s*\",c:[{b:\"(\"+e.IR+\"::)?\"+e.IR}]}].concat(s)},{cN:\"function\",bK:\"def\",e:\"$|;\",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+\"::\"},{cN:\"symbol\",b:e.UIR+\"(\\\\!|\\\\?)?:\",r:0},{cN:\"symbol\",b:\":(?!\\\\s)\",c:[t,{b:b}],r:0},{cN:\"number\",b:\"(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b\",r:0},{b:\"(\\\\$\\\\W)|((\\\\$|\\\\@\\\\@?)(\\\\w+))\"},{cN:\"params\",b:/\\|/,e:/\\|/,k:r},{b:\"(\"+e.RSR+\"|unless)\\\\s*\",k:\"unless\",c:[a,{cN:\"regexp\",c:[e.BE,n],i:/\\n/,v:[{b:\"/\",e:\"/[a-z]*\"},{b:\"%r{\",e:\"}[a-z]*\"},{b:\"%r\\\\(\",e:\"\\\\)[a-z]*\"},{b:\"%r!\",e:\"![a-z]*\"},{b:\"%r\\\\[\",e:\"\\\\][a-z]*\"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l=\"[>?]>\",o=\"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\",u=\"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d(p\\\\d+)?[^>]+>\",w=[{b:/^\\s*=>/,starts:{e:\"$\",c:d}},{cN:\"meta\",b:\"^(\"+l+\"|\"+o+\"|\"+u+\")\",starts:{e:\"$\",c:d}}];return{aliases:[\"rb\",\"gemspec\",\"podspec\",\"thor\",\"irb\"],k:r,i:/\\/\\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage(\"handlebars\",function(e){var a={\"builtin-name\":\"each in with if else unless bindattr action collection debugger log outlet template unbound view yield\"};return{aliases:[\"hbs\",\"html.hbs\",\"html.handlebars\"],cI:!0,sL:\"xml\",c:[e.C(\"{{!(--)?\",\"(--)?}}\"),{cN:\"template-tag\",b:/\\{\\{[#\\/]/,e:/\\}\\}/,c:[{cN:\"name\",b:/[a-zA-Z\\.-]+/,k:a,starts:{eW:!0,r:0,c:[e.QSM]}}]},{cN:\"template-variable\",b:/\\{\\{/,e:/\\}\\}/,k:a}]}});hljs.registerLanguage(\"swift\",function(e){var i={keyword:\"__COLUMN__ __FILE__ __FUNCTION__ __LINE__ as as! as? associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false fileprivate final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating open operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet\",literal:\"true false nil\",built_in:\"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip\"},t={cN:\"type\",b:\"\\\\b[A-Z][\\\\wÀ-ʸ']*\",r:0},n=e.C(\"/\\\\*\",\"\\\\*/\",{c:[\"self\"]}),r={cN:\"subst\",b:/\\\\\\(/,e:\"\\\\)\",k:i,c:[]},a={cN:\"number\",b:\"\\\\b([\\\\d_]+(\\\\.[\\\\deE_]+)?|0x[a-fA-F0-9_]+(\\\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\\\b\",r:0},o=e.inherit(e.QSM,{c:[r,e.BE]});return r.c=[a],{k:i,c:[o,e.CLCM,n,t,a,{cN:\"function\",bK:\"func\",e:\"{\",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{b:/</,e:/>/},{cN:\"params\",b:/\\(/,e:/\\)/,endsParent:!0,k:i,c:[\"self\",a,o,e.CBCM,{b:\":\"}],i:/[\"']/}],i:/\\[|%/},{cN:\"class\",bK:\"struct protocol class extension enum\",k:i,e:\"\\\\{\",eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})]},{cN:\"meta\",b:\"(@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain)\"},{bK:\"import\",e:/$/,c:[e.CLCM,n]}]}});hljs.registerLanguage(\"sql\",function(e){var t=e.C(\"--\",\"$\");return{cI:!0,i:/[<>{}*#]/,c:[{bK:\"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment\",e:/;/,eW:!0,l:/[\\w\\.]+/,k:{keyword:\"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek\",literal:\"true false null\",built_in:\"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void\"},c:[{cN:\"string\",b:\"'\",e:\"'\",c:[e.BE,{b:\"''\"}]},{cN:\"string\",b:'\"',e:'\"',c:[e.BE,{b:'\"\"'}]},{cN:\"string\",b:\"`\",e:\"`\",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage(\"scss\",function(e){var t=\"[a-zA-Z-][a-zA-Z0-9_-]*\",i={cN:\"variable\",b:\"(\\\\$\"+t+\")\\\\b\"},r={cN:\"number\",b:\"#[0-9A-Fa-f]+\"};({cN:\"attribute\",b:\"[A-Z\\\\_\\\\.\\\\-]+\",e:\":\",eE:!0,i:\"[^\\\\s]\",starts:{eW:!0,eE:!0,c:[r,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:\"meta\",b:\"!important\"}]}});return{cI:!0,i:\"[=/|']\",c:[e.CLCM,e.CBCM,{cN:\"selector-id\",b:\"\\\\#[A-Za-z0-9_-]+\",r:0},{cN:\"selector-class\",b:\"\\\\.[A-Za-z0-9_-]+\",r:0},{cN:\"selector-attr\",b:\"\\\\[\",e:\"\\\\]\",i:\"$\"},{cN:\"selector-tag\",b:\"\\\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\\\b\",r:0},{b:\":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)\"},{b:\"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)\"},i,{cN:\"attribute\",b:\"\\\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\\\b\",i:\"[^\\\\s]\"},{b:\"\\\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\\\b\"},{b:\":\",e:\";\",c:[i,r,e.CSSNM,e.QSM,e.ASM,{cN:\"meta\",b:\"!important\"}]},{b:\"@\",e:\"[{;]\",k:\"mixin include extend for if else each while charset import debug media page content font-face namespace warn\",c:[i,e.QSM,e.ASM,r,e.CSSNM,{b:\"\\\\s[A-Za-z0-9_.-]+\",r:0}]}]}});hljs.registerLanguage(\"java\",function(e){var a=\"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*\",t=a+\"(<\"+a+\"(\\\\s*,\\\\s*\"+a+\")*>)?\",r=\"false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do\",s=\"\\\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+)(\\\\.([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+))?|\\\\.([\\\\d]+[\\\\d_]+[\\\\d]+|[\\\\d]+))([eE][-+]?\\\\d+)?)[lLfF]?\",c={cN:\"number\",b:s,r:0};return{aliases:[\"jsp\"],k:r,i:/<\\/|#/,c:[e.C(\"/\\\\*\\\\*\",\"\\\\*/\",{r:0,c:[{b:/\\w+@/,r:0},{cN:\"doctag\",b:\"@[A-Za-z]+\"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:\"class\",bK:\"class interface\",e:/[{;=]/,eE:!0,k:\"class interface\",i:/[:\"\\[\\]]/,c:[{bK:\"extends implements\"},e.UTM]},{bK:\"new throw return else\",r:0},{cN:\"function\",b:\"(\"+t+\"\\\\s+)+\"+e.UIR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+\"\\\\s*\\\\(\",rB:!0,r:0,c:[e.UTM]},{cN:\"params\",b:/\\(/,e:/\\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:\"meta\",b:\"@[A-Za-z]+\"}]}});hljs.registerLanguage(\"http\",function(e){var t=\"HTTP/[0-9\\\\.]+\";return{aliases:[\"https\"],i:\"\\\\S\",c:[{b:\"^\"+t,e:\"$\",c:[{cN:\"number\",b:\"\\\\b\\\\d{3}\\\\b\"}]},{b:\"^[A-Z]+ (.*?) \"+t+\"$\",rB:!0,e:\"$\",c:[{cN:\"string\",b:\" \",e:\" \",eB:!0,eE:!0},{b:t},{cN:\"keyword\",b:\"[A-Z]+\"}]},{cN:\"attribute\",b:\"^\\\\w\",e:\": \",eE:!0,i:\"\\\\n|\\\\s|=\",starts:{e:\"$\",r:0}},{b:\"\\\\n\\\\n\",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage(\"perl\",function(e){var t=\"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when\",r={cN:\"subst\",b:\"[$@]\\\\{\",e:\"\\\\}\",k:t},s={b:\"->{\",e:\"}\"},n={v:[{b:/\\$\\d/},{b:/[\\$%@](\\^\\w\\b|#\\w+(::\\w+)*|{\\w+}|\\w+(::\\w*)*)/},{b:/[\\$%@][^\\s\\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C(\"^\\\\=\\\\w\",\"\\\\=cut\",{eW:!0}),s,{cN:\"string\",c:i,v:[{b:\"q[qwxr]?\\\\s*\\\\(\",e:\"\\\\)\",r:5},{b:\"q[qwxr]?\\\\s*\\\\[\",e:\"\\\\]\",r:5},{b:\"q[qwxr]?\\\\s*\\\\{\",e:\"\\\\}\",r:5},{b:\"q[qwxr]?\\\\s*\\\\|\",e:\"\\\\|\",r:5},{b:\"q[qwxr]?\\\\s*\\\\<\",e:\"\\\\>\",r:5},{b:\"qw\\\\s+q\",e:\"q\",r:5},{b:\"'\",e:\"'\",c:[e.BE]},{b:'\"',e:'\"'},{b:\"`\",e:\"`\",c:[e.BE]},{b:\"{\\\\w+}\",c:[],r:0},{b:\"-?\\\\w+\\\\s*\\\\=\\\\>\",c:[],r:0}]},{cN:\"number\",b:\"(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b\",r:0},{b:\"(\\\\/\\\\/|\"+e.RSR+\"|\\\\b(split|return|print|reverse|grep)\\\\b)\\\\s*\",k:\"split return print reverse grep\",r:0,c:[e.HCM,{cN:\"regexp\",b:\"(s|tr|y)/(\\\\\\\\.|[^/])*/(\\\\\\\\.|[^/])*/[a-z]*\",r:10},{cN:\"regexp\",b:\"(m|qr)?/\",e:\"/[a-z]*\",c:[e.BE],r:0}]},{cN:\"function\",bK:\"sub\",e:\"(\\\\s*\\\\(.*?\\\\))?[;{]\",eE:!0,r:5,c:[e.TM]},{b:\"-\\\\w\\\\b\",r:0},{b:\"^__DATA__$\",e:\"^__END__$\",sL:\"mojolicious\",c:[{b:\"^@@.*\",e:\"$\",cN:\"comment\"}]}];return r.c=o,s.c=o,{aliases:[\"pl\",\"pm\"],l:/[\\w\\.]+/,k:t,c:o}});hljs.registerLanguage(\"ocaml\",function(e){return{aliases:[\"ml\"],k:{keyword:\"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value\",built_in:\"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref\",literal:\"true false\"},i:/\\/\\/|>>/,l:\"[a-z_]\\\\w*!?\",c:[{cN:\"literal\",b:\"\\\\[(\\\\|\\\\|)?\\\\]|\\\\(\\\\)\",r:0},e.C(\"\\\\(\\\\*\",\"\\\\*\\\\)\",{c:[\"self\"]}),{cN:\"symbol\",b:\"'[A-Za-z_](?!')[\\\\w']*\"},{cN:\"type\",b:\"`[A-Z][\\\\w']*\"},{cN:\"type\",b:\"\\\\b[A-Z][\\\\w']*\",r:0},{b:\"[a-z_]\\\\w*'[\\\\w']*\",r:0},e.inherit(e.ASM,{cN:\"string\",r:0}),e.inherit(e.QSM,{i:null}),{cN:\"number\",b:\"\\\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)\",r:0},{b:/[-=]>/}]}});hljs.registerLanguage(\"erb\",function(e){return{sL:\"xml\",c:[e.C(\"<%#\",\"%>\"),{b:\"<%[%=-]?\",e:\"[%-]?%>\",sL:\"ruby\",eB:!0,eE:!0}]}});hljs.registerLanguage(\"cpp\",function(t){var e={cN:\"keyword\",b:\"\\\\b[a-z\\\\d_]*_t\\\\b\"},r={cN:\"string\",v:[{b:'(u8?|U)?L?\"',e:'\"',i:\"\\\\n\",c:[t.BE]},{b:'(u8?|U)?R\"',e:'\"',c:[t.BE]},{b:\"'\\\\\\\\?.\",e:\"'\",i:\".\"}]},s={cN:\"number\",v:[{b:\"\\\\b(0b[01']+)\"},{b:\"(-?)\\\\b([\\\\d']+(\\\\.[\\\\d']*)?|\\\\.[\\\\d']+)(u|U|l|L|ul|UL|f|F|b|B)\"},{b:\"(-?)(\\\\b0[xX][a-fA-F0-9']+|(\\\\b[\\\\d']+(\\\\.[\\\\d']*)?|\\\\.[\\\\d']+)([eE][-+]?[\\\\d']+)?)\"}],r:0},i={cN:\"meta\",b:/#\\s*[a-z]+\\b/,e:/$/,k:{\"meta-keyword\":\"if else elif endif define undef warning error line pragma ifdef ifndef include\"},c:[{b:/\\\\\\n/,r:0},t.inherit(r,{cN:\"meta-string\"}),{cN:\"meta-string\",b:/<[^\\n>]*>/,e:/$/,i:\"\\\\n\"},t.CLCM,t.CBCM]},a=t.IR+\"\\\\s*\\\\(\",c={keyword:\"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not\",built_in:\"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr\",literal:\"true false nullptr NULL\"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:[\"c\",\"cc\",\"h\",\"c++\",\"h++\",\"hpp\"],k:c,i:\"</\",c:n.concat([i,{b:\"\\\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<\",e:\">\",k:c,c:[\"self\",e]},{b:t.IR+\"::\",k:c},{v:[{b:/=/,e:/;/},{b:/\\(/,e:/\\)/},{bK:\"new throw return else\",e:/;/}],k:c,c:n.concat([{b:/\\(/,e:/\\)/,k:c,c:n.concat([\"self\"]),r:0}]),r:0},{cN:\"function\",b:\"(\"+t.IR+\"[\\\\*&\\\\s]+)+\"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\\w\\s\\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]},{cN:\"class\",bK:\"class struct\",e:/[{;:]/,c:[{b:/</,e:/>/,c:[\"self\"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage(\"kotlin\",function(e){var t={keyword:\"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit initinterface annotation data sealed internal infix operator out by constructor super trait volatile transient native default\",built_in:\"Byte Short Char Int Long Boolean Float Double Void Unit Nothing\",literal:\"true false null\"},r={cN:\"keyword\",b:/\\b(break|continue|return|this)\\b/,starts:{c:[{cN:\"symbol\",b:/@\\w+/}]}},i={cN:\"symbol\",b:e.UIR+\"@\"},n={cN:\"subst\",b:\"\\\\${\",e:\"}\",c:[e.ASM,e.CNM]},a={cN:\"variable\",b:\"\\\\$\"+e.UIR},c={cN:\"string\",v:[{b:'\"\"\"',e:'\"\"\"',c:[a,n]},{b:\"'\",e:\"'\",i:/\\n/,c:[e.BE]},{b:'\"',e:'\"',i:/\\n/,c:[e.BE,a,n]}]},s={cN:\"meta\",b:\"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*\"+e.UIR+\")?\"},o={cN:\"meta\",b:\"@\"+e.UIR,c:[{b:/\\(/,e:/\\)/,c:[e.inherit(c,{cN:\"meta-string\"})]}]};return{k:t,c:[e.C(\"/\\\\*\\\\*\",\"\\\\*/\",{r:0,c:[{cN:\"doctag\",b:\"@[A-Za-z]+\"}]}),e.CLCM,e.CBCM,r,i,s,o,{cN:\"function\",bK:\"fun\",e:\"[(]|$\",rB:!0,eE:!0,k:t,i:/fun\\s+(<.*>)?[^\\s\\(]+(\\s+[^\\s\\(]+)\\s*=/,r:5,c:[{b:e.UIR+\"\\\\s*\\\\(\",rB:!0,r:0,c:[e.UTM]},{cN:\"type\",b:/</,e:/>/,k:\"reified\",r:0},{cN:\"params\",b:/\\(/,e:/\\)/,endsParent:!0,k:t,r:0,c:[{b:/:/,e:/[=,\\/]/,eW:!0,c:[{cN:\"type\",b:e.UIR},e.CLCM,e.CBCM],r:0},e.CLCM,e.CBCM,s,o,c,e.CNM]},e.CBCM]},{cN:\"class\",bK:\"class interface trait\",e:/[:\\{(]|$/,eE:!0,i:\"extends implements\",c:[{bK:\"public protected internal private constructor\"},e.UTM,{cN:\"type\",b:/</,e:/>/,eB:!0,eE:!0,r:0},{cN:\"type\",b:/[,:]\\s*/,e:/[<\\(,]|$/,eB:!0,rE:!0},s,o]},c,{cN:\"meta\",b:\"^#!/usr/bin/env\",e:\"$\",i:\"\\n\"},e.CNM]}});hljs.registerLanguage(\"dockerfile\",function(e){return{aliases:[\"docker\"],cI:!0,k:\"from maintainer expose env arg user onbuild stopsignal\",c:[e.HCM,e.ASM,e.QSM,e.NM,{bK:\"run cmd entrypoint volume add copy workdir label healthcheck shell\",starts:{e:/[^\\\\]\\n/,sL:\"bash\"}}],i:\"</\"}});hljs.registerLanguage(\"crystal\",function(e){function b(e,b){var r=[{b:e,e:b}];return r[0].c=r,r}var r=\"(_[uif](8|16|32|64))?\",c=\"[a-zA-Z_]\\\\w*[!?=]?\",i=\"!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",n=\"[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\][=?]?\",s={keyword:\"abstract alias as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__\",literal:\"false nil true\"},t={cN:\"subst\",b:\"#{\",e:\"}\",k:s},a={cN:\"template-variable\",v:[{b:\"\\\\{\\\\{\",e:\"\\\\}\\\\}\"},{b:\"\\\\{%\",e:\"%\\\\}\"}],k:s},l={cN:\"string\",c:[e.BE,t],v:[{b:/'/,e:/'/},{b:/\"/,e:/\"/},{b:/`/,e:/`/},{b:\"%w?\\\\(\",e:\"\\\\)\",c:b(\"\\\\(\",\"\\\\)\")},{b:\"%w?\\\\[\",e:\"\\\\]\",c:b(\"\\\\[\",\"\\\\]\")},{b:\"%w?{\",e:\"}\",c:b(\"{\",\"}\")},{b:\"%w?<\",e:\">\",c:b(\"<\",\">\")},{b:\"%w?/\",e:\"/\"},{b:\"%w?%\",e:\"%\"},{b:\"%w?-\",e:\"-\"},{b:\"%w?\\\\|\",e:\"\\\\|\"},{b:/<<-\\w+$/,e:/^\\s*\\w+$/}],r:0},u={cN:\"string\",v:[{b:\"%q\\\\(\",e:\"\\\\)\",c:b(\"\\\\(\",\"\\\\)\")},{b:\"%q\\\\[\",e:\"\\\\]\",c:b(\"\\\\[\",\"\\\\]\")},{b:\"%q{\",e:\"}\",c:b(\"{\",\"}\")},{b:\"%q<\",e:\">\",c:b(\"<\",\">\")},{b:\"%q/\",e:\"/\"},{b:\"%q%\",e:\"%\"},{b:\"%q-\",e:\"-\"},{b:\"%q\\\\|\",e:\"\\\\|\"},{b:/<<-'\\w+'$/,e:/^\\s*\\w+$/}],r:0},_={b:\"(\"+i+\")\\\\s*\",c:[{cN:\"regexp\",c:[e.BE,t],v:[{b:\"//[a-z]*\",r:0},{b:\"/\",e:\"/[a-z]*\"},{b:\"%r\\\\(\",e:\"\\\\)\",c:b(\"\\\\(\",\"\\\\)\")},{b:\"%r\\\\[\",e:\"\\\\]\",c:b(\"\\\\[\",\"\\\\]\")},{b:\"%r{\",e:\"}\",c:b(\"{\",\"}\")},{b:\"%r<\",e:\">\",c:b(\"<\",\">\")},{b:\"%r/\",e:\"/\"},{b:\"%r%\",e:\"%\"},{b:\"%r-\",e:\"-\"},{b:\"%r\\\\|\",e:\"\\\\|\"}]}],r:0},o={cN:\"regexp\",c:[e.BE,t],v:[{b:\"%r\\\\(\",e:\"\\\\)\",c:b(\"\\\\(\",\"\\\\)\")},{b:\"%r\\\\[\",e:\"\\\\]\",c:b(\"\\\\[\",\"\\\\]\")},{b:\"%r{\",e:\"}\",c:b(\"{\",\"}\")},{b:\"%r<\",e:\">\",c:b(\"<\",\">\")},{b:\"%r/\",e:\"/\"},{b:\"%r%\",e:\"%\"},{b:\"%r-\",e:\"-\"},{b:\"%r\\\\|\",e:\"\\\\|\"}],r:0},w={cN:\"meta\",b:\"@\\\\[\",e:\"\\\\]\",c:[e.inherit(e.QSM,{cN:\"meta-string\"})]},f=[a,l,u,_,o,w,e.HCM,{cN:\"class\",bK:\"class module struct\",e:\"$|;\",i:/=/,c:[e.HCM,e.inherit(e.TM,{b:\"[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?\"}),{b:\"<\"}]},{cN:\"class\",bK:\"lib enum union\",e:\"$|;\",i:/=/,c:[e.HCM,e.inherit(e.TM,{b:\"[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?\"})],r:10},{cN:\"function\",bK:\"def\",e:/\\B\\b/,c:[e.inherit(e.TM,{b:n,endsParent:!0})]},{cN:\"function\",bK:\"fun macro\",e:/\\B\\b/,c:[e.inherit(e.TM,{b:n,endsParent:!0})],r:5},{cN:\"symbol\",b:e.UIR+\"(\\\\!|\\\\?)?:\",r:0},{cN:\"symbol\",b:\":\",c:[l,{b:n}],r:0},{cN:\"number\",v:[{b:\"\\\\b0b([01_]*[01])\"+r},{b:\"\\\\b0o([0-7_]*[0-7])\"+r},{b:\"\\\\b0x([A-Fa-f0-9_]*[A-Fa-f0-9])\"+r},{b:\"\\\\b(([0-9][0-9_]*[0-9]|[0-9])(\\\\.[0-9_]*[0-9])?([eE][+-]?[0-9_]*[0-9])?)\"+r}],r:0}];return t.c=f,a.c=f.slice(1),{aliases:[\"cr\"],l:c,k:s,c:f}});hljs.registerLanguage(\"json\",function(e){var i={literal:\"true false null\"},n=[e.QSM,e.CNM],r={e:\",\",eW:!0,eE:!0,c:n,k:i},t={b:\"{\",e:\"}\",c:[{cN:\"attr\",b:/\"/,e:/\"/,c:[e.BE],i:\"\\\\n\"},e.inherit(r,{b:/:/})],i:\"\\\\S\"},c={b:\"\\\\[\",e:\"\\\\]\",c:[e.inherit(r)],i:\"\\\\S\"};return n.splice(n.length,0,t,c),{c:n,k:i,i:\"\\\\S\"}});hljs.registerLanguage(\"clojure\",function(e){var t={\"builtin-name\":\"def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize\"},r=\"a-zA-Z_\\\\-!.?+*=<>&#'\",n=\"[\"+r+\"][\"+r+\"0-9/;:]*\",a=\"[-+]?\\\\d+(\\\\.\\\\d+)?\",o={b:n,r:0},s={cN:\"number\",b:a,r:0},c=e.inherit(e.QSM,{i:null}),i=e.C(\";\",\"$\",{r:0}),d={cN:\"literal\",b:/\\b(true|false|nil)\\b/},l={b:\"[\\\\[\\\\{]\",e:\"[\\\\]\\\\}]\"},m={cN:\"comment\",b:\"\\\\^\"+n},p=e.C(\"\\\\^\\\\{\",\"\\\\}\"),u={cN:\"symbol\",b:\"[:]{1,2}\"+n},f={b:\"\\\\(\",e:\"\\\\)\"},h={eW:!0,r:0},y={k:t,l:n,cN:\"name\",b:n,starts:h},b=[f,c,m,p,i,u,l,s,d,o];return f.c=[e.C(\"comment\",\"\"),y,h],h.c=b,l.c=b,p.c=[l],{aliases:[\"clj\"],i:/\\S/,c:[f,c,m,p,i,u,l,s,d]}});hljs.registerLanguage(\"cs\",function(e){var i={keyword:\"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield\",literal:\"null false true\"},t={cN:\"string\",b:'@\"',e:'\"',c:[{b:'\"\"'}]},r=e.inherit(t,{i:/\\n/}),a={cN:\"subst\",b:\"{\",e:\"}\",k:i},c=e.inherit(a,{i:/\\n/}),n={cN:\"string\",b:/\\$\"/,e:'\"',i:/\\n/,c:[{b:\"{{\"},{b:\"}}\"},e.BE,c]},s={cN:\"string\",b:/\\$@\"/,e:'\"',c:[{b:\"{{\"},{b:\"}}\"},{b:'\"\"'},a]},o=e.inherit(s,{i:/\\n/,c:[{b:\"{{\"},{b:\"}}\"},{b:'\"\"'},c]});a.c=[s,n,t,e.ASM,e.QSM,e.CNM,e.CBCM],c.c=[o,n,r,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\\n/})];var l={v:[s,n,t,e.ASM,e.QSM]},b=e.IR+\"(<\"+e.IR+\"(\\\\s*,\\\\s*\"+e.IR+\")*>)?(\\\\[\\\\])?\";return{aliases:[\"csharp\"],k:i,i:/::/,c:[e.C(\"///\",\"$\",{rB:!0,c:[{cN:\"doctag\",v:[{b:\"///\",r:0},{b:\"<!--|-->\"},{b:\"</?\",e:\">\"}]}]}),e.CLCM,e.CBCM,{cN:\"meta\",b:\"#\",e:\"$\",k:{\"meta-keyword\":\"if else elif endif define undef warning error line region endregion pragma checksum\"}},l,e.CNM,{bK:\"class interface\",e:/[{;=]/,i:/[^\\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:\"namespace\",e:/[{;=]/,i:/[^\\s:]/,c:[e.inherit(e.TM,{b:\"[a-zA-Z](\\\\.?\\\\w)*\"}),e.CLCM,e.CBCM]},{cN:\"meta\",b:\"^\\\\s*\\\\[\",eB:!0,e:\"\\\\]\",eE:!0,c:[{cN:\"meta-string\",b:/\"/,e:/\"/}]},{bK:\"new return throw await else\",r:0},{cN:\"function\",b:\"(\"+b+\"\\\\s+)+\"+e.IR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+\"\\\\s*\\\\(\",rB:!0,c:[e.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage(\"haskell\",function(e){var i={v:[e.C(\"--\",\"$\"),e.C(\"{-\",\"-}\",{c:[\"self\"]})]},a={cN:\"meta\",b:\"{-#\",e:\"#-}\"},l={cN:\"meta\",b:\"^#\",e:\"$\"},c={cN:\"type\",b:\"\\\\b[A-Z][\\\\w']*\",r:0},n={b:\"\\\\(\",e:\"\\\\)\",i:'\"',c:[a,l,{cN:\"type\",b:\"\\\\b[A-Z][\\\\w]*(\\\\((\\\\.\\\\.|,|\\\\w+)\\\\))?\"},e.inherit(e.TM,{b:\"[_a-z][\\\\w']*\"}),i]},s={b:\"{\",e:\"}\",c:n.c};return{aliases:[\"hs\"],k:\"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec\",c:[{bK:\"module\",e:\"where\",k:\"module where\",c:[n,i],i:\"\\\\W\\\\.|;\"},{b:\"\\\\bimport\\\\b\",e:\"$\",k:\"import qualified as hiding\",c:[n,i],i:\"\\\\W\\\\.|;\"},{cN:\"class\",b:\"^(\\\\s*)?(class|instance)\\\\b\",e:\"where\",k:\"class family instance where\",c:[c,n,i]},{cN:\"class\",b:\"\\\\b(data|(new)?type)\\\\b\",e:\"$\",k:\"data family type newtype deriving\",c:[a,c,n,s,i]},{bK:\"default\",e:\"$\",c:[c,n,i]},{bK:\"infix infixl infixr\",e:\"$\",c:[e.CNM,i]},{b:\"\\\\bforeign\\\\b\",e:\"$\",k:\"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe\",c:[c,e.QSM,i]},{cN:\"meta\",b:\"#!\\\\/usr\\\\/bin\\\\/env runhaskell\",e:\"$\"},a,l,e.QSM,e.CNM,c,e.inherit(e.TM,{b:\"^[_a-z][\\\\w']*\"}),i,{b:\"->|<-\"}]}});hljs.registerLanguage(\"nginx\",function(e){var r={cN:\"variable\",v:[{b:/\\$\\d+/},{b:/\\$\\{/,e:/}/},{b:\"[\\\\$\\\\@]\"+e.UIR}]},b={eW:!0,l:\"[a-z/_]+\",k:{literal:\"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll\"},r:0,i:\"=>\",c:[e.HCM,{cN:\"string\",c:[e.BE,r],v:[{b:/\"/,e:/\"/},{b:/'/,e:/'/}]},{b:\"([a-z]+):/\",e:\"\\\\s\",eW:!0,eE:!0,c:[r]},{cN:\"regexp\",c:[e.BE,r],v:[{b:\"\\\\s\\\\^\",e:\"\\\\s|{|;\",rE:!0},{b:\"~\\\\*?\\\\s+\",e:\"\\\\s|{|;\",rE:!0},{b:\"\\\\*(\\\\.[a-z\\\\-]+)+\"},{b:\"([a-z\\\\-]+\\\\.)+\\\\*\"}]},{cN:\"number\",b:\"\\\\b\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}(:\\\\d{1,5})?\\\\b\"},{cN:\"number\",b:\"\\\\b\\\\d+[kKmMgGdshdwy]*\\\\b\",r:0},r]};return{aliases:[\"nginxconf\"],c:[e.HCM,{b:e.UIR+\"\\\\s+{\",rB:!0,e:\"{\",c:[{cN:\"section\",b:e.UIR}],r:0},{b:e.UIR+\"\\\\s\",e:\";|{\",rB:!0,c:[{cN:\"attribute\",b:e.UIR,starts:b}],r:0}],i:\"[^\\\\s\\\\}]\"}});hljs.registerLanguage(\"basic\",function(E){return{cI:!0,i:\"^.\",l:\"[a-zA-Z][a-zA-Z0-9_$%!#]*\",k:{keyword:\"ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF|0 THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR\"},c:[E.QSM,E.C(\"REM\",\"$\",{r:10}),E.C(\"'\",\"$\",{r:0}),{cN:\"symbol\",b:\"^[0-9]+ \",r:10},{cN:\"number\",b:\"\\\\b([0-9]+[0-9edED.]*[#!]?)\",r:0},{cN:\"number\",b:\"(&[hH][0-9a-fA-F]{1,4})\"},{cN:\"number\",b:\"(&[oO][0-7]{1,6})\"}]}});hljs.registerLanguage(\"groovy\",function(e){return{k:{literal:\"true false null\",keyword:\"byte short char int long boolean float double void def as in assert trait super this abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof\"},c:[e.C(\"/\\\\*\\\\*\",\"\\\\*/\",{r:0,c:[{b:/\\w+@/,r:0},{cN:\"doctag\",b:\"@[A-Za-z]+\"}]}),e.CLCM,e.CBCM,{cN:\"string\",b:'\"\"\"',e:'\"\"\"'},{cN:\"string\",b:\"'''\",e:\"'''\"},{cN:\"string\",b:\"\\\\$/\",e:\"/\\\\$\",r:10},e.ASM,{cN:\"regexp\",b:/~?\\/[^\\/\\n]+\\//,c:[e.BE]},e.QSM,{cN:\"meta\",b:\"^#!/usr/bin/env\",e:\"$\",i:\"\\n\"},e.BNM,{cN:\"class\",bK:\"class interface trait enum\",e:\"{\",i:\":\",c:[{bK:\"extends implements\"},e.UTM]},e.CNM,{cN:\"meta\",b:\"@[A-Za-z]+\"},{cN:\"string\",b:/[^\\?]{0}[A-Za-z0-9_$]+ *:/},{b:/\\?/,e:/\\:/},{cN:\"symbol\",b:\"^\\\\s*[A-Za-z0-9_$]+:\",r:0}],i:/#|<\\//}});hljs.registerLanguage(\"rust\",function(e){var t=\"([ui](8|16|32|64|128|size)|f(32|64))?\",r=\"alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self Self sizeof static struct super trait true type typeof unsafe unsized use virtual while where yield move default\",n=\"drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!\";return{aliases:[\"rs\"],k:{keyword:r,literal:\"true false Some None Ok Err\",built_in:n},l:e.IR+\"!?\",i:\"</\",c:[e.CLCM,e.C(\"/\\\\*\",\"\\\\*/\",{c:[\"self\"]}),e.inherit(e.QSM,{b:/b?\"/,i:null}),{cN:\"string\",v:[{b:/r(#*)\"(.|\\n)*?\"\\1(?!#)/},{b:/b?'\\\\?(x\\w{2}|u\\w{4}|U\\w{8}|.)'/}]},{cN:\"symbol\",b:/'[a-zA-Z_][a-zA-Z0-9_]*/},{cN:\"number\",v:[{b:\"\\\\b0b([01_]+)\"+t},{b:\"\\\\b0o([0-7_]+)\"+t},{b:\"\\\\b0x([A-Fa-f0-9_]+)\"+t},{b:\"\\\\b(\\\\d[\\\\d_]*(\\\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)\"+t}],r:0},{cN:\"function\",bK:\"fn\",e:\"(\\\\(|<)\",eE:!0,c:[e.UTM]},{cN:\"meta\",b:\"#\\\\!?\\\\[\",e:\"\\\\]\",c:[{cN:\"meta-string\",b:/\"/,e:/\"/}]},{cN:\"class\",bK:\"type\",e:\";\",c:[e.inherit(e.UTM,{endsParent:!0})],i:\"\\\\S\"},{cN:\"class\",bK:\"trait enum struct union\",e:\"{\",c:[e.inherit(e.UTM,{endsParent:!0})],i:\"[\\\\w\\\\d]\"},{b:e.IR+\"::\",k:{built_in:n}},{b:\"->\"}]}});hljs.registerLanguage(\"css\",function(e){var c=\"[a-zA-Z-][a-zA-Z0-9_-]*\",t={b:/[A-Z\\_\\.\\-]+\\s*:/,rB:!0,e:\";\",eW:!0,c:[{cN:\"attribute\",b:/\\S/,e:\":\",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\\w-]+\\(/,rB:!0,c:[{cN:\"built_in\",b:/[\\w-]+/},{b:/\\(/,e:/\\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:\"number\",b:\"#[0-9A-Fa-f]+\"},{cN:\"meta\",b:\"!important\"}]}}]};return{cI:!0,i:/[=\\/|'\\$]/,c:[e.CBCM,{cN:\"selector-id\",b:/#[A-Za-z0-9_-]+/},{cN:\"selector-class\",b:/\\.[A-Za-z0-9_-]+/},{cN:\"selector-attr\",b:/\\[/,e:/\\]/,i:\"$\"},{cN:\"selector-pseudo\",b:/:(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+/},{b:\"@(font-face|page)\",l:\"[a-z-]+\",k:\"font-face page\"},{b:\"@\",e:\"[{;]\",i:/:/,c:[{cN:\"keyword\",b:/\\w+/},{b:/\\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:\"selector-tag\",b:c,r:0},{b:\"{\",e:\"}\",i:/\\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage(\"python\",function(e){var r={keyword:\"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False\",built_in:\"Ellipsis NotImplemented\"},b={cN:\"meta\",b:/^(>>>|\\.\\.\\.) /},c={cN:\"subst\",b:/\\{/,e:/\\}/,k:r,i:/#/},a={cN:\"string\",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[b],r:10},{b:/(u|b)?r?\"\"\"/,e:/\"\"\"/,c:[b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[b,c]},{b:/(fr|rf|f)\"\"\"/,e:/\"\"\"/,c:[b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)\"/,e:/\"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)\"/,e:/\"/},{b:/(fr|rf|f)'/,e:/'/,c:[c]},{b:/(fr|rf|f)\"/,e:/\"/,c:[c]},e.ASM,e.QSM]},s={cN:\"number\",r:0,v:[{b:e.BNR+\"[lLjJ]?\"},{b:\"\\\\b(0o[0-7]+)[lLjJ]?\"},{b:e.CNR+\"[lLjJ]?\"}]},i={cN:\"params\",b:/\\(/,e:/\\)/,c:[\"self\",b,s,a]};return c.c=[a,s,b],{aliases:[\"py\",\"gyp\"],k:r,i:/(<\\/|->|\\?)|=>/,c:[b,s,a,e.HCM,{v:[{cN:\"function\",bK:\"def\"},{cN:\"class\",bK:\"class\"}],e:/:/,i:/[${=;\\n,]/,c:[e.UTM,i,{b:/->/,eW:!0,k:\"None\"}]},{cN:\"meta\",b:/^[\\t ]*@/,e:/$/},{b:/\\b(print|exec)\\(/}]}});hljs.registerLanguage(\"objectivec\",function(e){var t={cN:\"built_in\",b:\"\\\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\\\w+\"},_={keyword:\"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN\",literal:\"false true FALSE TRUE nil YES NO NULL\",built_in:\"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once\"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n=\"@interface @class @protocol @implementation\";return{aliases:[\"mm\",\"objc\",\"obj-c\"],k:_,l:i,i:\"</\",c:[t,e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:\"string\",v:[{b:'@\"',e:'\"',i:\"\\\\n\",c:[e.BE]},{b:\"'\",e:\"[^\\\\\\\\]'\",i:\"[^\\\\\\\\][^']\"}]},{cN:\"meta\",b:\"#\",e:\"$\",c:[{cN:\"meta-string\",v:[{b:'\"',e:'\"'},{b:\"<\",e:\">\"}]}]},{cN:\"class\",b:\"(\"+n.split(\" \").join(\"|\")+\")\\\\b\",e:\"({|$)\",eE:!0,k:n,l:i,c:[e.UTM]},{b:\"\\\\.\"+e.UIR,r:0}]}});hljs.registerLanguage(\"r\",function(e){var r=\"([a-zA-Z]|\\\\.[a-zA-Z.])[a-zA-Z0-9._]*\";return{c:[e.HCM,{b:r,l:r,k:{keyword:\"function if in break next repeat else for return switch while try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...\",literal:\"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10\"},r:0},{cN:\"number\",b:\"0[xX][0-9a-fA-F]+[Li]?\\\\b\",r:0},{cN:\"number\",b:\"\\\\d+(?:[eE][+\\\\-]?\\\\d*)?L\\\\b\",r:0},{cN:\"number\",b:\"\\\\d+\\\\.(?!\\\\d)(?:i\\\\b)?\",r:0},{cN:\"number\",b:\"\\\\d+(?:\\\\.\\\\d*)?(?:[eE][+\\\\-]?\\\\d*)?i?\\\\b\",r:0},{cN:\"number\",b:\"\\\\.\\\\d+(?:[eE][+\\\\-]?\\\\d*)?i?\\\\b\",r:0},{b:\"`\",e:\"`\",r:0},{cN:\"string\",c:[e.BE],v:[{b:'\"',e:'\"'},{b:\"'\",e:\"'\"}]}]}});hljs.registerLanguage(\"lua\",function(e){var t=\"\\\\[=*\\\\[\",a=\"\\\\]=*\\\\]\",r={b:t,e:a,c:[\"self\"]},n=[e.C(\"--(?!\"+t+\")\",\"$\"),e.C(\"--\"+t,a,{c:[r],r:10})];return{l:e.UIR,k:{literal:\"true false nil\",keyword:\"and break do else elseif end for goto if in local not or repeat return then until while\",built_in:\"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstringmodule next pairs pcall print rawequal rawget rawset require select setfenvsetmetatable tonumber tostring type unpack xpcall arg selfcoroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove\"},c:n.concat([{cN:\"function\",bK:\"function\",e:\"\\\\)\",c:[e.inherit(e.TM,{b:\"([_a-zA-Z]\\\\w*\\\\.)*([_a-zA-Z]\\\\w*:)?[_a-zA-Z]\\\\w*\"}),{cN:\"params\",b:\"\\\\(\",eW:!0,c:n}].concat(n)},e.CNM,e.ASM,e.QSM,{cN:\"string\",b:t,e:a,c:[r],r:5}])}});hljs.registerLanguage(\"awk\",function(e){var r={cN:\"variable\",v:[{b:/\\$[\\w\\d#@][\\w\\d_]*/},{b:/\\$\\{(.*?)}/}]},b=\"BEGIN END if else while do for in break continue delete next nextfile function func exit|10\",n={cN:\"string\",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,r:10},{b:/(u|b)?r?\"\"\"/,e:/\"\"\"/,r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)\"/,e:/\"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)\"/,e:/\"/},e.ASM,e.QSM]};return{k:{keyword:b},c:[r,n,e.RM,e.HCM,e.NM]}});hljs.registerLanguage(\"php\",function(e){var c={b:\"\\\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*\"},i={cN:\"meta\",b:/<\\?(php)?|\\?>/},t={cN:\"string\",c:[e.BE,i],v:[{b:'b\"',e:'\"'},{b:\"b'\",e:\"'\"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:[\"php3\",\"php4\",\"php5\",\"php6\"],cI:!0,k:\"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally\",c:[e.HCM,e.C(\"//\",\"$\",{c:[i]}),e.C(\"/\\\\*\",\"\\\\*/\",{c:[{cN:\"doctag\",b:\"@[A-Za-z]+\"}]}),e.C(\"__halt_compiler.+?;\",!1,{eW:!0,k:\"__halt_compiler\",l:e.UIR}),{cN:\"string\",b:/<<<['\"]?\\w+['\"]?$/,e:/^\\w+;?$/,c:[e.BE,{cN:\"subst\",v:[{b:/\\$\\w+/},{b:/\\{\\$/,e:/\\}/}]}]},i,{cN:\"keyword\",b:/\\$this\\b/},c,{b:/(::|->)+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/},{cN:\"function\",bK:\"function\",e:/[;{]/,eE:!0,i:\"\\\\$|\\\\[|%\",c:[e.UTM,{cN:\"params\",b:\"\\\\(\",e:\"\\\\)\",c:[\"self\",c,e.CBCM,t,a]}]},{cN:\"class\",bK:\"class interface\",e:\"{\",eE:!0,i:/[:\\(\\$\"]/,c:[{bK:\"extends implements\"},e.UTM]},{bK:\"namespace\",e:\";\",i:/[\\.']/,c:[e.UTM]},{bK:\"use\",e:\";\",c:[e.UTM]},{b:\"=>\"},t,a]}});hljs.registerLanguage(\"diff\",function(e){return{aliases:[\"patch\"],c:[{cN:\"meta\",r:10,v:[{b:/^@@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +@@$/},{b:/^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$/},{b:/^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$/}]},{cN:\"comment\",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\\-{3}/,e:/$/},{b:/^\\*{3} /,e:/$/},{b:/^\\+{3}/,e:/$/},{b:/\\*{5}/,e:/\\*{5}$/}]},{cN:\"addition\",b:\"^\\\\+\",e:\"$\"},{cN:\"deletion\",b:\"^\\\\-\",e:\"$\"},{cN:\"addition\",b:\"^\\\\!\",e:\"$\"}]}});hljs.registerLanguage(\"cal\",function(e){var r=\"div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var\",t=\"false true\",c=[e.CLCM,e.C(/\\{/,/\\}/,{r:0}),e.C(/\\(\\*/,/\\*\\)/,{r:10})],n={cN:\"string\",b:/'/,e:/'/,c:[{b:/''/}]},o={cN:\"string\",b:/(#\\d+)+/},a={cN:\"number\",b:\"\\\\b\\\\d+(\\\\.\\\\d+)?(DT|D|T)\",r:0},i={cN:\"string\",b:'\"',e:'\"'},d={cN:\"function\",bK:\"procedure\",e:/[:;]/,k:\"procedure|10\",c:[e.TM,{cN:\"params\",b:/\\(/,e:/\\)/,k:r,c:[n,o]}].concat(c)},s={cN:\"class\",b:\"OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\\\d+) ([^\\\\r\\\\n]+)\",rB:!0,c:[e.TM,d]};return{cI:!0,k:{keyword:r,literal:t},i:/\\/\\*/,c:[n,o,a,i,e.NM,s,d]}});hljs.registerLanguage(\"makefile\",function(e){var i={cN:\"variable\",v:[{b:\"\\\\$\\\\(\"+e.UIR+\"\\\\)\",c:[e.BE]},{b:/\\$[@%<?\\^\\+\\*]/}]},r={cN:\"string\",b:/\"/,e:/\"/,c:[e.BE,i]},a={cN:\"variable\",b:/\\$\\([\\w-]+\\s/,e:/\\)/,k:{built_in:\"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value\"},c:[i]},n={b:\"^\"+e.UIR+\"\\\\s*[:+?]?=\",i:\"\\\\n\",rB:!0,c:[{b:\"^\"+e.UIR,e:\"[:+?]?=\",eE:!0}]},t={cN:\"meta\",b:/^\\.PHONY:/,e:/$/,k:{\"meta-keyword\":\".PHONY\"},l:/[\\.\\w]+/},l={cN:\"section\",b:/^[^\\s]+:/,e:/$/,c:[i]};return{aliases:[\"mk\",\"mak\"],k:\"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath\",l:/[\\w-]+/,c:[e.HCM,i,r,a,n,t,l]}});"
  },
  {
    "path": "CodeHub.iOS/WebResources/marked.js",
    "content": "﻿/**\n * marked - a markdown parser\n * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)\n * https://github.com/chjj/marked\n */\n(function(){var block={newline:/^\\n+/,code:/^( {4}[^\\n]+\\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\\n+|$)/,heading:/^ *(#{1,6}) *([^\\n]+?) *#* *(?:\\n+|$)/,nptable:noop,lheading:/^([^\\n]+)\\n *(=|-){2,} *(?:\\n+|$)/,blockquote:/^( *>[^\\n]+(\\n(?!def)[^\\n]+)*\\n*)+/,list:/^( *)(bull) [\\s\\S]+?(?:hr|def|\\n{2,}(?! )(?!\\1bull )\\n*|\\s*$)/,html:/^ *(?:comment *(?:\\n|\\s*$)|closed *(?:\\n{2,}|\\s*$)|closing *(?:\\n{2,}|\\s*$))/,def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +[\"(]([^\\n]+)[\")])? *(?:\\n+|$)/,table:noop,paragraph:/^((?:[^\\n]+\\n?(?!hr|heading|lheading|blockquote|tag|def))+)\\n*/,text:/^[^\\n]+/};block.bullet=/(?:[*+-]|\\d+\\.)/;block.item=/^( *)(bull) [^\\n]*(?:\\n(?!\\1bull )[^\\n]*)*/;block.item=replace(block.item,\"gm\")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)(\"hr\",\"\\\\n+(?=\\\\1?(?:[-*_] *){3,}(?:\\\\n+|$))\")(\"def\",\"\\\\n+(?=\"+block.def.source+\")\")();block.blockquote=replace(block.blockquote)(\"def\",block.def)();block._tag=\"(?!(?:\"+\"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code\"+\"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo\"+\"|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:/|[^\\\\w\\\\s@]*@)\\\\b\";block.html=replace(block.html)(\"comment\",/<!--[\\s\\S]*?-->/)(\"closed\",/<(tag)[\\s\\S]+?<\\/\\1>/)(\"closing\",/<tag(?:\"[^\"]*\"|'[^']*'|[^'\">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)(\"hr\",block.hr)(\"heading\",block.heading)(\"lheading\",block.lheading)(\"blockquote\",block.blockquote)(\"tag\",\"<\"+block._tag)(\"def\",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \\.]*(\\S+)? *\\n([\\s\\S]*?)\\s*\\1 *(?:\\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\\n]+?) *#* *(?:\\n+|$)/});block.gfm.paragraph=replace(block.paragraph)(\"(?!\",\"(?!\"+block.gfm.fences.source.replace(\"\\\\1\",\"\\\\2\")+\"|\"+block.list.source.replace(\"\\\\1\",\"\\\\3\")+\"|\")();block.tables=merge({},block.gfm,{nptable:/^ *(\\S.*\\|.*)\\n *([-:]+ *\\|[-| :]*)\\n((?:.*\\|.*(?:\\n|$))*)\\n*/,table:/^ *\\|(.+)\\n *\\|( *[-:]+[-| :]*)\\n((?: *\\|.*(?:\\n|$))*)\\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\\r\\n|\\r/g,\"\\n\").replace(/\\t/g,\"    \").replace(/\\u00a0/g,\" \").replace(/\\u2424/g,\"\\n\");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,\"\"),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:\"space\"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,\"\");this.tokens.push({type:\"code\",text:!this.options.pedantic?cap.replace(/\\n+$/,\"\"):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"code\",lang:cap[2],text:cap[3]||\"\"});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"heading\",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:\"table\",header:cap[1].replace(/^ *| *\\| *$/g,\"\").split(/ *\\| */),align:cap[2].replace(/^ *|\\| *$/g,\"\").split(/ *\\| */),cells:cap[3].replace(/\\n$/,\"\").split(\"\\n\")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]=\"right\"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]=\"center\"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]=\"left\"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"heading\",depth:cap[2]===\"=\"?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"hr\"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"blockquote_start\"});cap=cap[0].replace(/^ *> ?/gm,\"\");this.token(cap,top,true);this.tokens.push({type:\"blockquote_end\"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:\"list_start\",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\\d+\\.) +/,\"\");if(~item.indexOf(\"\\n \")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp(\"^ {1,\"+space+\"}\",\"gm\"),\"\"):item.replace(/^ {1,4}/gm,\"\")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join(\"\\n\")+src;i=l-1}}loose=next||/\\n\\n(?!\\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)===\"\\n\";if(!loose)loose=next}this.tokens.push({type:loose?\"loose_item_start\":\"list_item_start\"});this.token(item,false,bq);this.tokens.push({type:\"list_item_end\"})}this.tokens.push({type:\"list_end\"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?\"paragraph\":\"html\",pre:!this.options.sanitizer&&(cap[1]===\"pre\"||cap[1]===\"script\"||cap[1]===\"style\"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:\"table\",header:cap[1].replace(/^ *| *\\| *$/g,\"\").split(/ *\\| */),align:cap[2].replace(/^ *|\\| *$/g,\"\").split(/ *\\| */),cells:cap[3].replace(/(?: *\\| *)?\\n$/,\"\").split(\"\\n\")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]=\"right\"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]=\"center\"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]=\"left\"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\\| *| *\\| *$/g,\"\").split(/ *\\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:\"paragraph\",text:cap[1].charAt(cap[1].length-1)===\"\\n\"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:\"text\",text:cap[0]});continue}if(src){throw new Error(\"Infinite loop on byte: \"+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\\\([\\\\`*{}\\[\\]()#+\\-.!_>])/,autolink:/^<([^ >]+(@|:\\/)[^ >]+)>/,url:noop,tag:/^<!--[\\s\\S]*?-->|^<\\/?\\w+(?:\"[^\"]*\"|'[^']*'|[^'\">])*?>/,link:/^!?\\[(inside)\\]\\(href\\)/,reflink:/^!?\\[(inside)\\]\\s*\\[([^\\]]*)\\]/,nolink:/^!?\\[((?:\\[[^\\]]*\\]|[^\\[\\]])*)\\]/,strong:/^__([\\s\\S]+?)__(?!_)|^\\*\\*([\\s\\S]+?)\\*\\*(?!\\*)/,em:/^\\b_((?:[^_]|__)+?)_\\b|^\\*((?:\\*\\*|[\\s\\S])+?)\\*(?!\\*)/,code:/^(`+)\\s*([\\s\\S]*?[^`])\\s*\\1(?!`)/,br:/^ {2,}\\n(?!\\s*$)/,del:noop,text:/^[\\s\\S]+?(?=[\\\\<!\\[_*`]| {2,}\\n|$)/};inline._inside=/(?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*/;inline._href=/\\s*<?([\\s\\S]*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*/;inline.link=replace(inline.link)(\"inside\",inline._inside)(\"href\",inline._href)();inline.reflink=replace(inline.reflink)(\"inside\",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\\S)([\\s\\S]*?\\S)__(?!_)|^\\*\\*(?=\\S)([\\s\\S]*?\\S)\\*\\*(?!\\*)/,em:/^_(?=\\S)([\\s\\S]*?\\S)_(?!_)|^\\*(?=\\S)([\\s\\S]*?\\S)\\*(?!\\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)(\"])\",\"~|])\")(),url:/^(https?:\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])/,del:/^~~(?=\\S)([\\s\\S]*?\\S)~~/,text:replace(inline.text)(\"]|\",\"~]|\")(\"|\",\"|https?://|\")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)(\"{2,}\",\"*\")(),text:replace(inline.gfm.text)(\"{2,}\",\"*\")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error(\"Tokens array requires a `links` property.\")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out=\"\",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]===\"@\"){text=cap[1].charAt(6)===\":\"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle(\"mailto:\")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\\s+/g,\" \");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error(\"Infinite loop on byte: \"+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!==\"!\"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,\"—\").replace(/--/g,\"–\").replace(/(^|[-\\u2014/(\\[{\"\\s])'/g,\"$1‘\").replace(/'/g,\"’\").replace(/(^|[-\\u2014/(\\[{\\u2018\\s])\"/g,\"$1“\").replace(/\"/g,\"”\").replace(/\\.{3}/g,\"…\")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out=\"\",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch=\"x\"+ch.toString(16)}out+=\"&#\"+ch+\";\"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return\"<pre><code>\"+(escaped?code:escape(code,true))+\"\\n</code></pre>\"}return'<pre><code class=\"'+this.options.langPrefix+escape(lang,true)+'\">'+(escaped?code:escape(code,true))+\"\\n</code></pre>\\n\"};Renderer.prototype.blockquote=function(quote){return\"<blockquote>\\n\"+quote+\"</blockquote>\\n\"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return\"<h\"+level+' id=\"'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\\w]+/g,\"-\")+'\">'+text+\"</h\"+level+\">\\n\"};Renderer.prototype.hr=function(){return this.options.xhtml?\"<hr/>\\n\":\"<hr>\\n\"};Renderer.prototype.list=function(body,ordered){var type=ordered?\"ol\":\"ul\";return\"<\"+type+\">\\n\"+body+\"</\"+type+\">\\n\"};Renderer.prototype.listitem=function(text){return\"<li>\"+text+\"</li>\\n\"};Renderer.prototype.paragraph=function(text){return\"<p>\"+text+\"</p>\\n\"};Renderer.prototype.table=function(header,body){return\"<table>\\n\"+\"<thead>\\n\"+header+\"</thead>\\n\"+\"<tbody>\\n\"+body+\"</tbody>\\n\"+\"</table>\\n\"};Renderer.prototype.tablerow=function(content){return\"<tr>\\n\"+content+\"</tr>\\n\"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?\"th\":\"td\";var tag=flags.align?\"<\"+type+' style=\"text-align:'+flags.align+'\">':\"<\"+type+\">\";return tag+content+\"</\"+type+\">\\n\"};Renderer.prototype.strong=function(text){return\"<strong>\"+text+\"</strong>\"};Renderer.prototype.em=function(text){return\"<em>\"+text+\"</em>\"};Renderer.prototype.codespan=function(text){return\"<code>\"+text+\"</code>\"};Renderer.prototype.br=function(){return this.options.xhtml?\"<br/>\":\"<br>\"};Renderer.prototype.del=function(text){return\"<del>\"+text+\"</del>\"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\\w:]/g,\"\").toLowerCase()}catch(e){return\"\"}if(prot.indexOf(\"javascript:\")===0||prot.indexOf(\"vbscript:\")===0){return\"\"}}var out='<a href=\"'+href+'\"';if(title){out+=' title=\"'+title+'\"'}out+=\">\"+text+\"</a>\";return out};Renderer.prototype.image=function(href,title,text){var out='<img src=\"'+href+'\" alt=\"'+text+'\"';if(title){out+=' title=\"'+title+'\"'}out+=this.options.xhtml?\"/>\":\">\";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out=\"\";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type===\"text\"){body+=\"\\n\"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case\"space\":{return\"\"}case\"hr\":{return this.renderer.hr()}case\"heading\":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case\"code\":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case\"table\":{var header=\"\",body=\"\",i,row,cell,flags,j;cell=\"\";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell=\"\";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case\"blockquote_start\":{var body=\"\";while(this.next().type!==\"blockquote_end\"){body+=this.tok()}return this.renderer.blockquote(body)}case\"list_start\":{var body=\"\",ordered=this.token.ordered;while(this.next().type!==\"list_end\"){body+=this.tok()}return this.renderer.list(body,ordered)}case\"list_item_start\":{var body=\"\";while(this.next().type!==\"list_item_end\"){body+=this.token.type===\"text\"?this.parseText():this.tok()}return this.renderer.listitem(body)}case\"loose_item_start\":{var body=\"\";while(this.next().type!==\"list_item_end\"){body+=this.tok()}return this.renderer.listitem(body)}case\"html\":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case\"paragraph\":{return this.renderer.paragraph(this.inline.output(this.token.text))}case\"text\":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\\w+;)/g:/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\")}function unescape(html){return html.replace(/&([#\\w]+);/g,function(_,n){n=n.toLowerCase();if(n===\"colon\")return\":\";if(n.charAt(0)===\"#\"){return n.charAt(1)===\"x\"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return\"\"})}function replace(regex,opt){regex=regex.source;opt=opt||\"\";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\\[])\\^/g,\"$1\");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt===\"function\"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!==\"code\"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+=\"\\nPlease report this to https://github.com/chjj/marked.\";if((opt||marked.defaults).silent){return\"<p>An error occured:</p><pre>\"+escape(e.message+\"\",true)+\"</pre>\"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:\"lang-\",smartypants:false,headerPrefix:\"\",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!==\"undefined\"&&typeof exports===\"object\"){module.exports=marked}else if(typeof define===\"function\"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!==\"undefined\"?window:global)}());"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/agate.css",
    "content": "/*!\n * Agate by Taufik Nurrohman <https://github.com/tovic>\n * ----------------------------------------------------\n *\n * #ade5fc\n * #a2fca2\n * #c6b4f0\n * #d36363\n * #fcc28c\n * #fc9b9b\n * #ffa\n * #fff\n * #333\n * #62c8f3\n * #888\n *\n */\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #333;\n  color: white;\n}\n\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-code,\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-tag {\n  color: #62c8f3;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ade5fc;\n}\n\n.hljs-string,\n.hljs-bullet {\n  color: #a2fca2;\n}\n\n.hljs-type,\n.hljs-title,\n.hljs-section,\n.hljs-attribute,\n.hljs-quote,\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #ffa;\n}\n\n.hljs-number,\n.hljs-symbol,\n.hljs-bullet {\n  color: #d36363;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal {\n  color: #fcc28c;\n}\n\n.hljs-comment,\n.hljs-deletion,\n.hljs-code {\n  color: #888;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #c6b4f0;\n}\n\n.hljs-meta {\n  color: #fc9b9b;\n}\n\n.hljs-deletion {\n  background-color: #fc9b9b;\n  color: #333;\n}\n\n.hljs-addition {\n  background-color: #a2fca2;\n  color: #333;\n}\n\n.hljs a {\n  color: inherit;\n}\n\n.hljs a:focus,\n.hljs a:hover {\n  color: inherit;\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/androidstudio.css",
    "content": "/*\nDate: 24 Fev 2015\nAuthor: Pedro Oliveira <kanytu@gmail . com>\n*/\n\n.hljs {\n  color: #a9b7c6;\n  background: #282b2e;\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-symbol,\n.hljs-bullet {\n  color: #6897BB;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-deletion {\n  color: #cc7832;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-link {\n  color: #629755;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #808080;\n}\n\n.hljs-meta {\n  color: #bbb529;\n}\n\n.hljs-string,\n.hljs-attribute,\n.hljs-addition {\n  color: #6A8759;\n}\n\n.hljs-section,\n.hljs-title,\n.hljs-type {\n  color: #ffc66d;\n}\n\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #e8bf6a;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/arduino-light.css",
    "content": "/*\n\nArduino® Light Theme - Stefania Mellai <s.mellai@arduino.cc>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #FFFFFF;\n}\n\n.hljs,\n.hljs-subst {\n  color: #434f54;\n}\n\n.hljs-keyword,\n.hljs-attribute,\n.hljs-selector-tag,\n.hljs-doctag,\n.hljs-name {\n  color: #00979D;\n}\n\n.hljs-built_in,\n.hljs-literal,\n.hljs-bullet,\n.hljs-code,\n.hljs-addition {\n  color: #D35400;\n}\n\n.hljs-regexp,\n.hljs-symbol,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-link,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #00979D;\n}\n\n.hljs-type,\n.hljs-string,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-quote,\n.hljs-template-tag,\n.hljs-deletion {\n  color: #005C5F;\n}\n\n.hljs-title,\n.hljs-section {\n  color: #880000;\n  font-weight: bold;\n}\n\n.hljs-comment {\n  color: rgba(149,165,166,.8);\n}\n\n.hljs-meta-keyword {\n  color: #728E00;\n}\n\n.hljs-meta {\n  color: #728E00;\n  color: #434f54;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-function {\n  color: #728E00;\n}\n\n.hljs-number {\n  color: #8A7B52;  \n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/arta.css",
    "content": "/*\nDate: 17.V.2011\nAuthor: pumbur <pumbur@pumbur.net>\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #222;\n}\n\n.hljs,\n.hljs-subst {\n  color: #aaa;\n}\n\n.hljs-section {\n  color: #fff;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-meta {\n  color: #444;\n}\n\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-regexp {\n  color: #ffcc33;\n}\n\n.hljs-number,\n.hljs-addition {\n  color: #00cc66;\n}\n\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-link {\n  color: #32aaee;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #6644aa;\n}\n\n.hljs-title,\n.hljs-variable,\n.hljs-deletion,\n.hljs-template-tag {\n  color: #bb1166;\n}\n\n.hljs-section,\n.hljs-doctag,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/ascetic.css",
    "content": "/*\n\nOriginal style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: white;\n  color: black;\n}\n\n.hljs-string,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-section,\n.hljs-addition,\n.hljs-attribute,\n.hljs-link {\n  color: #888;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-meta,\n.hljs-deletion {\n  color: #ccc;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-section,\n.hljs-name,\n.hljs-type,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-cave-dark.css",
    "content": "/* Base16 Atelier Cave Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Cave Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #7e7887;\n}\n\n/* Atelier-Cave Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-regexp,\n.hljs-link,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #be4678;\n}\n\n/* Atelier-Cave Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #aa573c;\n}\n\n/* Atelier-Cave Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #2a9292;\n}\n\n/* Atelier-Cave Blue */\n.hljs-title,\n.hljs-section {\n  color: #576ddb;\n}\n\n/* Atelier-Cave Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #955ae7;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #19171c;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #be4678;\n}\n\n.hljs-addition {\n  background-color: #2a9292;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #19171c;\n  color: #8b8792;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-cave-light.css",
    "content": "/* Base16 Atelier Cave Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Cave Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #655f6d;\n}\n\n/* Atelier-Cave Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #be4678;\n}\n\n/* Atelier-Cave Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #aa573c;\n}\n\n/* Atelier-Cave Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #2a9292;\n}\n\n/* Atelier-Cave Blue */\n.hljs-title,\n.hljs-section {\n  color: #576ddb;\n}\n\n/* Atelier-Cave Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #955ae7;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #19171c;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #be4678;\n}\n\n.hljs-addition {\n  background-color: #2a9292;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #efecf4;\n  color: #585260;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-dune-dark.css",
    "content": "/* Base16 Atelier Dune Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Dune Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #999580;\n}\n\n/* Atelier-Dune Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #d73737;\n}\n\n/* Atelier-Dune Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #b65611;\n}\n\n/* Atelier-Dune Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #60ac39;\n}\n\n/* Atelier-Dune Blue */\n.hljs-title,\n.hljs-section {\n  color: #6684e1;\n}\n\n/* Atelier-Dune Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #b854d4;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #20201d;\n  color: #a6a28c;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-dune-light.css",
    "content": "/* Base16 Atelier Dune Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Dune Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #7d7a68;\n}\n\n/* Atelier-Dune Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #d73737;\n}\n\n/* Atelier-Dune Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #b65611;\n}\n\n/* Atelier-Dune Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #60ac39;\n}\n\n/* Atelier-Dune Blue */\n.hljs-title,\n.hljs-section {\n  color: #6684e1;\n}\n\n/* Atelier-Dune Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #b854d4;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #fefbec;\n  color: #6e6b5e;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-estuary-dark.css",
    "content": "/* Base16 Atelier Estuary Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Estuary Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #878573;\n}\n\n/* Atelier-Estuary Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ba6236;\n}\n\n/* Atelier-Estuary Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #ae7313;\n}\n\n/* Atelier-Estuary Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #7d9726;\n}\n\n/* Atelier-Estuary Blue */\n.hljs-title,\n.hljs-section {\n  color: #36a166;\n}\n\n/* Atelier-Estuary Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #5f9182;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #22221b;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #ba6236;\n}\n\n.hljs-addition {\n  background-color: #7d9726;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #22221b;\n  color: #929181;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-estuary-light.css",
    "content": "/* Base16 Atelier Estuary Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Estuary Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #6c6b5a;\n}\n\n/* Atelier-Estuary Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ba6236;\n}\n\n/* Atelier-Estuary Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #ae7313;\n}\n\n/* Atelier-Estuary Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #7d9726;\n}\n\n/* Atelier-Estuary Blue */\n.hljs-title,\n.hljs-section {\n  color: #36a166;\n}\n\n/* Atelier-Estuary Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #5f9182;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #22221b;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #ba6236;\n}\n\n.hljs-addition {\n  background-color: #7d9726;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f4f3ec;\n  color: #5f5e4e;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-forest-dark.css",
    "content": "/* Base16 Atelier Forest Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Forest Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #9c9491;\n}\n\n/* Atelier-Forest Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #f22c40;\n}\n\n/* Atelier-Forest Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #df5320;\n}\n\n/* Atelier-Forest Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #7b9726;\n}\n\n/* Atelier-Forest Blue */\n.hljs-title,\n.hljs-section {\n  color: #407ee7;\n}\n\n/* Atelier-Forest Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6666ea;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #1b1918;\n  color: #a8a19f;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-forest-light.css",
    "content": "/* Base16 Atelier Forest Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Forest Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #766e6b;\n}\n\n/* Atelier-Forest Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #f22c40;\n}\n\n/* Atelier-Forest Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #df5320;\n}\n\n/* Atelier-Forest Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #7b9726;\n}\n\n/* Atelier-Forest Blue */\n.hljs-title,\n.hljs-section {\n  color: #407ee7;\n}\n\n/* Atelier-Forest Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6666ea;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f1efee;\n  color: #68615e;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-heath-dark.css",
    "content": "/* Base16 Atelier Heath Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Heath Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #9e8f9e;\n}\n\n/* Atelier-Heath Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ca402b;\n}\n\n/* Atelier-Heath Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #a65926;\n}\n\n/* Atelier-Heath Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #918b3b;\n}\n\n/* Atelier-Heath Blue */\n.hljs-title,\n.hljs-section {\n  color: #516aec;\n}\n\n/* Atelier-Heath Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #7b59c0;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #1b181b;\n  color: #ab9bab;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-heath-light.css",
    "content": "/* Base16 Atelier Heath Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Heath Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #776977;\n}\n\n/* Atelier-Heath Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ca402b;\n}\n\n/* Atelier-Heath Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #a65926;\n}\n\n/* Atelier-Heath Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #918b3b;\n}\n\n/* Atelier-Heath Blue */\n.hljs-title,\n.hljs-section {\n  color: #516aec;\n}\n\n/* Atelier-Heath Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #7b59c0;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f7f3f7;\n  color: #695d69;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-lakeside-dark.css",
    "content": "/* Base16 Atelier Lakeside Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Lakeside Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #7195a8;\n}\n\n/* Atelier-Lakeside Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #d22d72;\n}\n\n/* Atelier-Lakeside Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #935c25;\n}\n\n/* Atelier-Lakeside Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #568c3b;\n}\n\n/* Atelier-Lakeside Blue */\n.hljs-title,\n.hljs-section {\n  color: #257fad;\n}\n\n/* Atelier-Lakeside Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6b6bb8;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #161b1d;\n  color: #7ea2b4;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-lakeside-light.css",
    "content": "/* Base16 Atelier Lakeside Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Lakeside Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #5a7b8c;\n}\n\n/* Atelier-Lakeside Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #d22d72;\n}\n\n/* Atelier-Lakeside Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #935c25;\n}\n\n/* Atelier-Lakeside Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #568c3b;\n}\n\n/* Atelier-Lakeside Blue */\n.hljs-title,\n.hljs-section {\n  color: #257fad;\n}\n\n/* Atelier-Lakeside Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6b6bb8;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #ebf8ff;\n  color: #516d7b;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-plateau-dark.css",
    "content": "/* Base16 Atelier Plateau Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Plateau Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #7e7777;\n}\n\n/* Atelier-Plateau Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ca4949;\n}\n\n/* Atelier-Plateau Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #b45a3c;\n}\n\n/* Atelier-Plateau Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #4b8b8b;\n}\n\n/* Atelier-Plateau Blue */\n.hljs-title,\n.hljs-section {\n  color: #7272ca;\n}\n\n/* Atelier-Plateau Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #8464c4;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #1b1818;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #ca4949;\n}\n\n.hljs-addition {\n  background-color: #4b8b8b;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #1b1818;\n  color: #8a8585;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-plateau-light.css",
    "content": "/* Base16 Atelier Plateau Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Plateau Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #655d5d;\n}\n\n/* Atelier-Plateau Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #ca4949;\n}\n\n/* Atelier-Plateau Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #b45a3c;\n}\n\n/* Atelier-Plateau Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #4b8b8b;\n}\n\n/* Atelier-Plateau Blue */\n.hljs-title,\n.hljs-section {\n  color: #7272ca;\n}\n\n/* Atelier-Plateau Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #8464c4;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #1b1818;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #ca4949;\n}\n\n.hljs-addition {\n  background-color: #4b8b8b;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f4ecec;\n  color: #585050;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-savanna-dark.css",
    "content": "/* Base16 Atelier Savanna Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Savanna Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #78877d;\n}\n\n/* Atelier-Savanna Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #b16139;\n}\n\n/* Atelier-Savanna Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #9f713c;\n}\n\n/* Atelier-Savanna Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #489963;\n}\n\n/* Atelier-Savanna Blue */\n.hljs-title,\n.hljs-section {\n  color: #478c90;\n}\n\n/* Atelier-Savanna Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #55859b;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #171c19;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #b16139;\n}\n\n.hljs-addition {\n  background-color: #489963;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #171c19;\n  color: #87928a;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-savanna-light.css",
    "content": "/* Base16 Atelier Savanna Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Savanna Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #5f6d64;\n}\n\n/* Atelier-Savanna Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #b16139;\n}\n\n/* Atelier-Savanna Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #9f713c;\n}\n\n/* Atelier-Savanna Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #489963;\n}\n\n/* Atelier-Savanna Blue */\n.hljs-title,\n.hljs-section {\n  color: #478c90;\n}\n\n/* Atelier-Savanna Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #55859b;\n}\n\n.hljs-deletion,\n.hljs-addition {\n  color: #171c19;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #b16139;\n}\n\n.hljs-addition {\n  background-color: #489963;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #ecf4ee;\n  color: #526057;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-seaside-dark.css",
    "content": "/* Base16 Atelier Seaside Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Seaside Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #809980;\n}\n\n/* Atelier-Seaside Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #e6193c;\n}\n\n/* Atelier-Seaside Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #87711d;\n}\n\n/* Atelier-Seaside Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #29a329;\n}\n\n/* Atelier-Seaside Blue */\n.hljs-title,\n.hljs-section {\n  color: #3d62f5;\n}\n\n/* Atelier-Seaside Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #ad2bee;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #131513;\n  color: #8ca68c;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-seaside-light.css",
    "content": "/* Base16 Atelier Seaside Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Seaside Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #687d68;\n}\n\n/* Atelier-Seaside Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #e6193c;\n}\n\n/* Atelier-Seaside Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #87711d;\n}\n\n/* Atelier-Seaside Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #29a329;\n}\n\n/* Atelier-Seaside Blue */\n.hljs-title,\n.hljs-section {\n  color: #3d62f5;\n}\n\n/* Atelier-Seaside Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #ad2bee;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f4fbf4;\n  color: #5e6e5e;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-sulphurpool-dark.css",
    "content": "/* Base16 Atelier Sulphurpool Dark - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Sulphurpool Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #898ea4;\n}\n\n/* Atelier-Sulphurpool Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #c94922;\n}\n\n/* Atelier-Sulphurpool Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #c76b29;\n}\n\n/* Atelier-Sulphurpool Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #ac9739;\n}\n\n/* Atelier-Sulphurpool Blue */\n.hljs-title,\n.hljs-section {\n  color: #3d8fd1;\n}\n\n/* Atelier-Sulphurpool Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6679cc;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #202746;\n  color: #979db4;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atelier-sulphurpool-light.css",
    "content": "/* Base16 Atelier Sulphurpool Light - Theme */\n/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */\n/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */\n\n/* Atelier-Sulphurpool Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #6b7394;\n}\n\n/* Atelier-Sulphurpool Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-regexp,\n.hljs-link,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #c94922;\n}\n\n/* Atelier-Sulphurpool Orange */\n.hljs-number,\n.hljs-meta,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #c76b29;\n}\n\n/* Atelier-Sulphurpool Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet {\n  color: #ac9739;\n}\n\n/* Atelier-Sulphurpool Blue */\n.hljs-title,\n.hljs-section {\n  color: #3d8fd1;\n}\n\n/* Atelier-Sulphurpool Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #6679cc;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #f5f7ff;\n  color: #5e6687;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atom-one-dark.css",
    "content": "/*\n\nAtom One Dark by Daniel Gamage\nOriginal One Dark Syntax theme from https://github.com/atom/one-dark-syntax\n\nbase:    #282c34\nmono-1:  #abb2bf\nmono-2:  #818896\nmono-3:  #5c6370\nhue-1:   #56b6c2\nhue-2:   #61aeee\nhue-3:   #c678dd\nhue-4:   #98c379\nhue-5:   #e06c75\nhue-5-2: #be5046\nhue-6:   #d19a66\nhue-6-2: #e6c07b\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #abb2bf;\n  background: #282c34;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #5c6370;\n  font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n  color: #c678dd;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n  color: #e06c75;\n}\n\n.hljs-literal {\n  color: #56b6c2;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n  color: #98c379;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n  color: #e6c07b;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n  color: #d19a66;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n  color: #61aeee;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-link {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/atom-one-light.css",
    "content": "/*\n\nAtom One Light by Daniel Gamage\nOriginal One Light Syntax theme from https://github.com/atom/one-light-syntax\n\nbase:    #fafafa\nmono-1:  #383a42\nmono-2:  #686b77\nmono-3:  #a0a1a7\nhue-1:   #0184bb\nhue-2:   #4078f2\nhue-3:   #a626a4\nhue-4:   #50a14f\nhue-5:   #e45649\nhue-5-2: #c91243\nhue-6:   #986801\nhue-6-2: #c18401\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #383a42;\n  background: #fafafa;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #a0a1a7;\n  font-style: italic;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-formula {\n  color: #a626a4;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-selector-tag,\n.hljs-deletion,\n.hljs-subst {\n  color: #e45649;\n}\n\n.hljs-literal {\n  color: #0184bb;\n}\n\n.hljs-string,\n.hljs-regexp,\n.hljs-addition,\n.hljs-attribute,\n.hljs-meta-string {\n  color: #50a14f;\n}\n\n.hljs-built_in,\n.hljs-class .hljs-title {\n  color: #c18401;\n}\n\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-type,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-number {\n  color: #986801;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-meta,\n.hljs-selector-id,\n.hljs-title {\n  color: #4078f2;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-link {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/brown-paper.css",
    "content": "/*\n\nBrown Paper style from goldblog.com.ua (c) Zaripov Yura <yur4ik7@ukr.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background:#b7a68e url(./brown-papersq.png);\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal {\n  color:#005599;\n  font-weight:bold;\n}\n\n.hljs,\n.hljs-subst {\n  color: #363c69;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-attribute,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-built_in,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-link,\n.hljs-name {\n  color: #2c009f;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-meta,\n.hljs-deletion {\n  color: #802022;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/codepen-embed.css",
    "content": "/*\n  codepen.io Embed Theme\n  Author: Justin Perry <http://github.com/ourmaninamsterdam>\n  Original theme - https://github.com/chriskempson/tomorrow-theme\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #222;\n  color: #fff;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #777;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-regexp,\n.hljs-meta,\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-params,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-deletion {\n  color: #ab875d;\n}\n\n.hljs-section,\n.hljs-title,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-type,\n.hljs-attribute {\n  color: #9b869b;\n}\n\n.hljs-string,\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-addition {\n  color: #8f9c6c;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/color-brewer.css",
    "content": "/*\n\nColorbrewer theme\nOriginal: https://github.com/mbostock/colorbrewer-theme (c) Mike Bostock <mike@ocks.org>\nPorted by Fabrício Tavares de Oliveira\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #fff;\n}\n\n.hljs,\n.hljs-subst {\n  color: #000;\n}\n\n.hljs-string,\n.hljs-meta,\n.hljs-symbol,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition {\n  color: #756bb1;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #636363;\n}\n\n.hljs-number,\n.hljs-regexp,\n.hljs-literal,\n.hljs-bullet,\n.hljs-link {\n  color: #31a354;\n}\n\n.hljs-deletion,\n.hljs-variable {\n  color: #88f;\n}\n\n\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-title,\n.hljs-section,\n.hljs-built_in,\n.hljs-doctag,\n.hljs-type,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-strong {\n  color: #3182bd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-attribute {\n  color: #e6550d;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/darcula.css",
    "content": "/*\n\nDarcula color scheme from the JetBrains family of IDEs\n\n*/\n\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #2b2b2b;\n}\n\n.hljs {\n  color: #bababa;\n}\n\n.hljs-strong,\n.hljs-emphasis {\n  color: #a8a8a2;\n}\n\n.hljs-bullet,\n.hljs-quote,\n.hljs-link,\n.hljs-number,\n.hljs-regexp,\n.hljs-literal {\n  color: #6896ba;\n}\n\n.hljs-code,\n.hljs-selector-class {\n  color: #a6e22e;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-section,\n.hljs-attribute,\n.hljs-name,\n.hljs-variable {\n  color: #cb7832;\n}\n\n.hljs-params {\n  color: #b9b9b9;\n}\n\n.hljs-string {\n  color: #6a8759;\n}\n\n.hljs-subst,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-symbol,\n.hljs-selector-id,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition {\n  color: #e0c46c;\n}\n\n.hljs-comment,\n.hljs-deletion,\n.hljs-meta {\n  color: #7f7f7f;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/dark.css",
    "content": "/*\n\nDark style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #444;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-section,\n.hljs-link {\n  color: white;\n}\n\n.hljs,\n.hljs-subst {\n  color: #ddd;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-name,\n.hljs-type,\n.hljs-attribute,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-built_in,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #d88;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion,\n.hljs-meta {\n  color: #777;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-title,\n.hljs-section,\n.hljs-doctag,\n.hljs-type,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/darkula.css",
    "content": "/*\n  Deprecated due to a typo in the name and left here for compatibility purpose only.\n  Please use darcula.css instead.\n*/\n\n@import url('darcula.css');\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/default.css",
    "content": "/*\n\nOriginal highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #F0F0F0;\n}\n\n\n/* Base color: saturation 0; */\n\n.hljs,\n.hljs-subst {\n  color: #444;\n}\n\n.hljs-comment {\n  color: #888888;\n}\n\n.hljs-keyword,\n.hljs-attribute,\n.hljs-selector-tag,\n.hljs-meta-keyword,\n.hljs-doctag,\n.hljs-name {\n  font-weight: bold;\n}\n\n\n/* User color: hue: 0 */\n\n.hljs-type,\n.hljs-string,\n.hljs-number,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-quote,\n.hljs-template-tag,\n.hljs-deletion {\n  color: #880000;\n}\n\n.hljs-title,\n.hljs-section {\n  color: #880000;\n  font-weight: bold;\n}\n\n.hljs-regexp,\n.hljs-symbol,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-link,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #BC6060;\n}\n\n\n/* Language color: hue: 90; */\n\n.hljs-literal {\n  color: #78A960;\n}\n\n.hljs-built_in,\n.hljs-bullet,\n.hljs-code,\n.hljs-addition {\n  color: #397300;\n}\n\n\n/* Meta color: hue: 200 */\n\n.hljs-meta {\n  color: #1f7199;\n}\n\n.hljs-meta-string {\n  color: #4d99bf;\n}\n\n\n/* Misc effects */\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/docco.css",
    "content": "/*\nDocco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #000;\n  background: #f8f8ff;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #408080;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-subst {\n  color: #954121;\n}\n\n.hljs-number {\n  color: #40a070;\n}\n\n.hljs-string,\n.hljs-doctag {\n  color: #219161;\n}\n\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-section,\n.hljs-type {\n  color: #19469d;\n}\n\n.hljs-params {\n  color: #00f;\n}\n\n.hljs-title {\n  color: #458;\n  font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n  color: #000080;\n  font-weight: normal;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #008080;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #b68;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n  color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #0086b3;\n}\n\n.hljs-meta {\n  color: #999;\n  font-weight: bold;\n}\n\n.hljs-deletion {\n  background: #fdd;\n}\n\n.hljs-addition {\n  background: #dfd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/dracula.css",
    "content": "/*\n\nDracula Theme v1.2.0\n\nhttps://github.com/zenorocha/dracula-theme\n\nCopyright 2015, All rights reserved\n\nCode licensed under the MIT license\nhttp://zenorocha.mit-license.org\n\n@author Éverton Ribeiro <nuxlli@gmail.com>\n@author Zeno Rocha <hi@zenorocha.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #282a36;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-section,\n.hljs-link {\n  color: #8be9fd;\n}\n\n.hljs-function .hljs-keyword {\n  color: #ff79c6;\n}\n\n.hljs,\n.hljs-subst {\n  color: #f8f8f2;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-name,\n.hljs-type,\n.hljs-attribute,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #f1fa8c;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion,\n.hljs-meta {\n  color: #6272a4;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-title,\n.hljs-section,\n.hljs-doctag,\n.hljs-type,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/far.css",
    "content": "/*\n\nFAR Style (c) MajestiC <majestic2k@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #000080;\n}\n\n.hljs,\n.hljs-subst {\n  color: #0ff;\n}\n\n.hljs-string,\n.hljs-attribute,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition {\n  color: #ff0;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-section,\n.hljs-type,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-variable {\n  color: #fff;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-doctag,\n.hljs-deletion {\n  color: #888;\n}\n\n.hljs-number,\n.hljs-regexp,\n.hljs-literal,\n.hljs-link {\n  color: #0f0;\n}\n\n.hljs-meta {\n  color: #008080;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-title,\n.hljs-section,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/foundation.css",
    "content": "/*\nDescription: Foundation 4 docs style for highlight.js\nAuthor: Dan Allen <dan.j.allen@gmail.com>\nWebsite: http://foundation.zurb.com/docs/\nVersion: 1.0\nDate: 2013-04-02\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #eee; color: black;\n}\n\n.hljs-link,\n.hljs-emphasis,\n.hljs-attribute,\n.hljs-addition {\n  color: #070;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong,\n.hljs-string,\n.hljs-deletion {\n  color: #d14;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-quote,\n.hljs-comment {\n  color: #998;\n  font-style: italic;\n}\n\n.hljs-section,\n.hljs-title {\n  color: #900;\n}\n\n.hljs-class .hljs-title,\n.hljs-type {\n  color: #458;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #336699;\n}\n\n.hljs-bullet {\n  color: #997700;\n}\n\n.hljs-meta {\n  color: #3344bb;\n}\n\n.hljs-code,\n.hljs-number,\n.hljs-literal,\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #099;\n}\n\n.hljs-regexp {\n  background-color: #fff0ff;\n  color: #880088;\n}\n\n.hljs-symbol {\n  color: #990073;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #007700;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/github-gist.css",
    "content": "/**\n * GitHub Gist Theme\n * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro\n */\n\n.hljs {\n  display: block;\n  background: white;\n  padding: 0.5em;\n  color: #333333;\n  overflow-x: auto;\n}\n\n.hljs-comment,\n.hljs-meta {\n  color: #969896;\n}\n\n.hljs-string,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-strong,\n.hljs-emphasis,\n.hljs-quote {\n  color: #df5000;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-type {\n  color: #a71d5d;\n}\n\n.hljs-literal,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-attribute {\n  color: #0086b3;\n}\n\n.hljs-section,\n.hljs-name {\n  color: #63a35c;\n}\n\n.hljs-tag {\n  color: #333333;\n}\n\n.hljs-title,\n.hljs-attr,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #795da3;\n}\n\n.hljs-addition {\n  color: #55a532;\n  background-color: #eaffea;\n}\n\n.hljs-deletion {\n  color: #bd2c00;\n  background-color: #ffecec;\n}\n\n.hljs-link {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/github.css",
    "content": "/*\n\ngithub.com style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #333;\n  background: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #998;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n  color: #333;\n  font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag .hljs-attr {\n  color: #008080;\n}\n\n.hljs-string,\n.hljs-doctag {\n  color: #d14;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n  color: #900;\n  font-weight: bold;\n}\n\n.hljs-subst {\n  font-weight: normal;\n}\n\n.hljs-type,\n.hljs-class .hljs-title {\n  color: #458;\n  font-weight: bold;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-attribute {\n  color: #000080;\n  font-weight: normal;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #009926;\n}\n\n.hljs-symbol,\n.hljs-bullet {\n  color: #990073;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #0086b3;\n}\n\n.hljs-meta {\n  color: #999;\n  font-weight: bold;\n}\n\n.hljs-deletion {\n  background: #fdd;\n}\n\n.hljs-addition {\n  background: #dfd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/googlecode.css",
    "content": "/*\n\nGoogle Code style (c) Aahan Krish <geekpanth3r@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: white;\n  color: black;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #800;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-section,\n.hljs-title,\n.hljs-name {\n  color: #008;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #660;\n}\n\n.hljs-string,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-regexp {\n  color: #080;\n}\n\n.hljs-literal,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-meta,\n.hljs-number,\n.hljs-link {\n  color: #066;\n}\n\n.hljs-title,\n.hljs-doctag,\n.hljs-type,\n.hljs-attr,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-params {\n  color: #606;\n}\n\n.hljs-attribute,\n.hljs-subst {\n  color: #000;\n}\n\n.hljs-formula {\n  background-color: #eee;\n  font-style: italic;\n}\n\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #9B703F\n}\n\n.hljs-addition {\n  background-color: #baeeba;\n}\n\n.hljs-deletion {\n  background-color: #ffc8bd;\n}\n\n.hljs-doctag,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/grayscale.css",
    "content": "/*\n\ngrayscale style (c) MY Sun <simonmysun@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #333;\n  background: #fff;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #777;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-subst {\n  color: #333;\n  font-weight: bold;\n}\n\n.hljs-number,\n.hljs-literal {\n  color: #777;\n}\n\n.hljs-string,\n.hljs-doctag,\n.hljs-formula {\n  color: #333;\n  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) repeat;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-selector-id {\n  color: #000;\n  font-weight: bold;\n}\n\n.hljs-subst {\n  font-weight: normal;\n}\n\n.hljs-class .hljs-title,\n.hljs-type,\n.hljs-name {\n  color: #333;\n  font-weight: bold;\n}\n\n.hljs-tag {\n  color: #333;\n}\n\n.hljs-regexp {\n    color: #333;\n    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) repeat;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link {\n  color: #000;\n  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) repeat;\n}\n\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #000;\n  text-decoration: underline;\n}\n\n.hljs-meta {\n  color: #999;\n  font-weight: bold;\n}\n\n.hljs-deletion {\n  color: #fff;\n  background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) repeat;\n}\n\n.hljs-addition {\n  color: #000;\n  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) repeat;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/gruvbox-dark.css",
    "content": "/*\n\nGruvbox style (dark) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #282828;\n}\n\n.hljs,\n.hljs-subst {\n  color: #ebdbb2;\n}\n\n/* Gruvbox Red */\n.hljs-deletion,\n.hljs-formula,\n.hljs-keyword,\n.hljs-link,\n.hljs-selector-tag {\n  color: #fb4934;\n}\n\n/* Gruvbox Blue */\n.hljs-built_in,\n.hljs-emphasis,\n.hljs-name,\n.hljs-quote,\n.hljs-strong,\n.hljs-title,\n.hljs-variable {\n  color: #83a598;\n}\n\n/* Gruvbox Yellow */\n.hljs-attr,\n.hljs-params,\n.hljs-template-tag,\n.hljs-type {\n  color: #fabd2f;\n}\n\n/* Gruvbox Purple */\n.hljs-builtin-name,\n.hljs-doctag,\n.hljs-literal,\n.hljs-number {\n  color: #8f3f71;\n}\n\n/* Gruvbox Orange */\n.hljs-code,\n.hljs-meta,\n.hljs-regexp,\n.hljs-selector-id,\n.hljs-template-variable {\n  color: #fe8019;\n}\n\n/* Gruvbox Green */\n.hljs-addition,\n.hljs-meta-string,\n.hljs-section,\n.hljs-selector-attr,\n.hljs-selector-class,\n.hljs-string,\n.hljs-symbol {\n  color: #b8bb26;\n}\n\n/* Gruvbox Aqua */\n.hljs-attribute,\n.hljs-bullet,\n.hljs-class,\n.hljs-function,\n.hljs-function .hljs-keyword,\n.hljs-meta-keyword,\n.hljs-selector-pseudo,\n.hljs-tag {\n  color: #8ec07c;\n}\n\n/* Gruvbox Gray */\n.hljs-comment {\n  color: #928374;\n}\n\n/* Gruvbox Purple */\n.hljs-link_label,\n.hljs-literal,\n.hljs-number {\n  color: #d3869b;\n}\n\n.hljs-comment,\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-section,\n.hljs-strong,\n.hljs-tag {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/gruvbox-light.css",
    "content": "/*\n\nGruvbox style (light) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #fbf1c7;\n}\n\n.hljs,\n.hljs-subst {\n  color: #3c3836;\n}\n\n/* Gruvbox Red */\n.hljs-deletion,\n.hljs-formula,\n.hljs-keyword,\n.hljs-link,\n.hljs-selector-tag {\n  color: #9d0006;\n}\n\n/* Gruvbox Blue */\n.hljs-built_in,\n.hljs-emphasis,\n.hljs-name,\n.hljs-quote,\n.hljs-strong,\n.hljs-title,\n.hljs-variable {\n  color: #076678;\n}\n\n/* Gruvbox Yellow */\n.hljs-attr,\n.hljs-params,\n.hljs-template-tag,\n.hljs-type {\n  color: #b57614;\n}\n\n/* Gruvbox Purple */\n.hljs-builtin-name,\n.hljs-doctag,\n.hljs-literal,\n.hljs-number {\n  color: #8f3f71;\n}\n\n/* Gruvbox Orange */\n.hljs-code,\n.hljs-meta,\n.hljs-regexp,\n.hljs-selector-id,\n.hljs-template-variable {\n  color: #af3a03;\n}\n\n/* Gruvbox Green */\n.hljs-addition,\n.hljs-meta-string,\n.hljs-section,\n.hljs-selector-attr,\n.hljs-selector-class,\n.hljs-string,\n.hljs-symbol {\n  color: #79740e;\n}\n\n/* Gruvbox Aqua */\n.hljs-attribute,\n.hljs-bullet,\n.hljs-class,\n.hljs-function,\n.hljs-function .hljs-keyword,\n.hljs-meta-keyword,\n.hljs-selector-pseudo,\n.hljs-tag {\n  color: #427b58;\n}\n\n/* Gruvbox Gray */\n.hljs-comment {\n  color: #928374;\n}\n\n/* Gruvbox Purple */\n.hljs-link_label,\n.hljs-literal,\n.hljs-number {\n  color: #8f3f71;\n}\n\n.hljs-comment,\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-section,\n.hljs-strong,\n.hljs-tag {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/hopscotch.css",
    "content": "/*\n * Hopscotch\n * by Jan T. Sott\n * https://github.com/idleberg/Hopscotch\n *\n * This work is licensed under the Creative Commons CC0 1.0 Universal License\n */\n\n/* Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #989498;\n}\n\n/* Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-link,\n.hljs-deletion {\n  color: #dd464c;\n}\n\n/* Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params {\n  color: #fd8b19;\n}\n\n/* Yellow */\n.hljs-class .hljs-title {\n  color: #fdcc59;\n}\n\n/* Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #8fc13e;\n}\n\n/* Aqua */\n.hljs-meta {\n  color: #149b93;\n}\n\n/* Blue */\n.hljs-function,\n.hljs-section,\n.hljs-title {\n  color: #1290bf;\n}\n\n/* Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #c85e7c;\n}\n\n.hljs {\n  display: block;\n  background: #322931;\n  color: #b9b5b8;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/hybrid.css",
    "content": "/*\n\nvim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid)\n\n*/\n\n/*background color*/\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #1d1f21;\n}\n\n/*selection color*/\n.hljs::selection,\n.hljs span::selection {\n  background: #373b41;\n}\n\n.hljs::-moz-selection,\n.hljs span::-moz-selection {\n  background: #373b41;\n}\n\n/*foreground color*/\n.hljs {\n  color: #c5c8c6;\n}\n\n/*color: fg_yellow*/\n.hljs-title,\n.hljs-name {\n  color: #f0c674;\n}\n\n/*color: fg_comment*/\n.hljs-comment,\n.hljs-meta,\n.hljs-meta .hljs-keyword {\n  color: #707880;\n}\n\n/*color: fg_red*/\n.hljs-number,\n.hljs-symbol,\n.hljs-literal,\n.hljs-deletion,\n.hljs-link {\n color: #cc6666\n}\n\n/*color: fg_green*/\n.hljs-string,\n.hljs-doctag,\n.hljs-addition,\n.hljs-regexp,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #b5bd68;\n}\n\n/*color: fg_purple*/\n.hljs-attribute,\n.hljs-code,\n.hljs-selector-id {\n color: #b294bb;\n}\n\n/*color: fg_blue*/\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-bullet,\n.hljs-tag {\n color: #81a2be;\n}\n\n/*color: fg_aqua*/\n.hljs-subst,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #8abeb7;\n}\n\n/*color: fg_orange*/\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-quote,\n.hljs-section,\n.hljs-selector-class {\n  color: #de935f;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/idea.css",
    "content": "/*\n\nIntellij Idea-like styling (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #000;\n  background: #fff;\n}\n\n.hljs-subst,\n.hljs-title {\n  font-weight: normal;\n  color: #000;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #808080;\n  font-style: italic;\n}\n\n.hljs-meta {\n  color: #808000;\n}\n\n.hljs-tag {\n  background: #efefef;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-literal,\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-type,\n.hljs-selector-id,\n.hljs-selector-class {\n  font-weight: bold;\n  color: #000080;\n}\n\n.hljs-attribute,\n.hljs-number,\n.hljs-regexp,\n.hljs-link {\n  font-weight: bold;\n  color: #0000ff;\n}\n\n.hljs-number,\n.hljs-regexp,\n.hljs-link {\n  font-weight: normal;\n}\n\n.hljs-string {\n  color: #008000;\n  font-weight: bold;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-formula {\n  color: #000;\n  background: #d0eded;\n  font-style: italic;\n}\n\n.hljs-doctag {\n  text-decoration: underline;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #660e7a;\n}\n\n.hljs-addition {\n  background: #baeeba;\n}\n\n.hljs-deletion {\n  background: #ffc8bd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/ir-black.css",
    "content": "/*\n  IR_Black style (c) Vasily Mikhailitchenko <vaskas@programica.ru>\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #000;\n  color: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-meta {\n  color: #7c7c7c;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-tag,\n.hljs-name {\n  color: #96cbfe;\n}\n\n.hljs-attribute,\n.hljs-selector-id {\n  color: #ffffb6;\n}\n\n.hljs-string,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-addition {\n  color: #a8ff60;\n}\n\n.hljs-subst {\n  color: #daefa3;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #e9c062;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-doctag {\n  color: #ffffb6;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-literal {\n  color: #c6c5fe;\n}\n\n.hljs-number,\n.hljs-deletion {\n  color:#ff73fd;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/kimbie.dark.css",
    "content": "/*\n    Name:     Kimbie (dark)\n    Author:   Jan T. Sott\n    License:  Creative Commons Attribution-ShareAlike 4.0 Unported License\n    URL:      https://github.com/idleberg/Kimbie-highlight.js\n*/\n\n/* Kimbie Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #d6baad;\n}\n\n/* Kimbie Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-meta {\n  color: #dc3958;\n}\n\n/* Kimbie Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-deletion,\n.hljs-link {\n  color: #f79a32;\n}\n\n/* Kimbie Yellow */\n.hljs-title,\n.hljs-section,\n.hljs-attribute {\n  color: #f06431;\n}\n\n/* Kimbie Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #889b4a;\n}\n\n/* Kimbie Purple */\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-function {\n  color: #98676a;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #221a0f;\n  color: #d3af86;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/kimbie.light.css",
    "content": "/*\n    Name:     Kimbie (light)\n    Author:   Jan T. Sott\n    License:  Creative Commons Attribution-ShareAlike 4.0 Unported License\n    URL:      https://github.com/idleberg/Kimbie-highlight.js\n*/\n\n/* Kimbie Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #a57a4c;\n}\n\n/* Kimbie Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-meta {\n  color: #dc3958;\n}\n\n/* Kimbie Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-deletion,\n.hljs-link {\n  color: #f79a32;\n}\n\n/* Kimbie Yellow */\n.hljs-title,\n.hljs-section,\n.hljs-attribute {\n  color: #f06431;\n}\n\n/* Kimbie Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #889b4a;\n}\n\n/* Kimbie Purple */\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-function {\n  color: #98676a;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #fbebd4;\n  color: #84613d;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/magula.css",
    "content": "/*\nDescription: Magula style for highligh.js\nAuthor: Ruslan Keba <rukeba@gmail.com>\nWebsite: http://rukeba.com/\nVersion: 1.0\nDate: 2009-01-03\nMusic: Aphex Twin / Xtal\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background-color: #f4f4f4;\n}\n\n.hljs,\n.hljs-subst {\n  color: black;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-attribute,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #050;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #777;\n}\n\n.hljs-number,\n.hljs-regexp,\n.hljs-literal,\n.hljs-type,\n.hljs-link {\n  color: #800;\n}\n\n.hljs-deletion,\n.hljs-meta {\n  color: #00e;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-built_in,\n.hljs-tag,\n.hljs-name {\n  font-weight: bold;\n  color: navy;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/mono-blue.css",
    "content": "/*\n  Five-color theme from a single blue hue.\n*/\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #eaeef3;\n}\n\n.hljs {\n  color: #00193a;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-title,\n.hljs-section,\n.hljs-doctag,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-comment {\n  color: #738191;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-section,\n.hljs-built_in,\n.hljs-literal,\n.hljs-type,\n.hljs-addition,\n.hljs-tag,\n.hljs-quote,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #0048ab;\n}\n\n.hljs-meta,\n.hljs-subst,\n.hljs-symbol,\n.hljs-regexp,\n.hljs-attribute,\n.hljs-deletion,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-link,\n.hljs-bullet {\n  color: #4c81c9;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/monokai-sublime.css",
    "content": "/*\n\nMonokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #23241f;\n}\n\n.hljs,\n.hljs-tag,\n.hljs-subst {\n  color: #f8f8f2;\n}\n\n.hljs-strong,\n.hljs-emphasis {\n  color: #a8a8a2;\n}\n\n.hljs-bullet,\n.hljs-quote,\n.hljs-number,\n.hljs-regexp,\n.hljs-literal,\n.hljs-link {\n  color: #ae81ff;\n}\n\n.hljs-code,\n.hljs-title,\n.hljs-section,\n.hljs-selector-class {\n  color: #a6e22e;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-name,\n.hljs-attr {\n  color: #f92672;\n}\n\n.hljs-symbol,\n.hljs-attribute {\n  color: #66d9ef;\n}\n\n.hljs-params,\n.hljs-class .hljs-title {\n  color: #f8f8f2;\n}\n\n.hljs-string,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-selector-id,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-variable {\n  color: #e6db74;\n}\n\n.hljs-comment,\n.hljs-deletion,\n.hljs-meta {\n  color: #75715e;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/monokai.css",
    "content": "/*\nMonokai style - ported by Luigi Maselli - http://grigio.org\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #272822; color: #ddd;\n}\n\n.hljs-tag,\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-strong,\n.hljs-name {\n  color: #f92672;\n}\n\n.hljs-code {\n  color: #66d9ef;\n}\n\n.hljs-class .hljs-title {\n  color: white;\n}\n\n.hljs-attribute,\n.hljs-symbol,\n.hljs-regexp,\n.hljs-link {\n  color: #bf79db;\n}\n\n.hljs-string,\n.hljs-bullet,\n.hljs-subst,\n.hljs-title,\n.hljs-section,\n.hljs-emphasis,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #a6e22e;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion,\n.hljs-meta {\n  color: #75715e;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-selector-id {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/obsidian.css",
    "content": "/**\n * Obsidian style\n * ported by Alexander Marenin (http://github.com/ioncreature)\n */\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #282b2e;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-selector-id {\n  color: #93c763;\n}\n\n.hljs-number {\n  color: #ffcd22;\n}\n\n.hljs {\n  color: #e0e2e4;\n}\n\n.hljs-attribute {\n  color: #668bb0;\n}\n\n.hljs-code,\n.hljs-class .hljs-title,\n.hljs-section {\n  color: white;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #d39745;\n}\n\n.hljs-meta {\n  color: #557182;\n}\n\n.hljs-tag,\n.hljs-name,\n.hljs-bullet,\n.hljs-subst,\n.hljs-emphasis,\n.hljs-type,\n.hljs-built_in,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable {\n  color: #8cbbad;\n}\n\n.hljs-string,\n.hljs-symbol {\n  color: #ec7600;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion {\n  color: #818e96;\n}\n\n.hljs-selector-class {\n  color: #A082BD\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/ocean.css",
    "content": "/* Ocean Dark Theme */\n/* https://github.com/gavsiu */\n/* Original theme - https://github.com/chriskempson/base16 */\n\n/* Ocean Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #65737e;\n}\n\n/* Ocean Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #bf616a;\n}\n\n/* Ocean Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #d08770;\n}\n\n/* Ocean Yellow */\n.hljs-attribute {\n  color: #ebcb8b;\n}\n\n/* Ocean Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #a3be8c;\n}\n\n/* Ocean Blue */\n.hljs-title,\n.hljs-section {\n  color: #8fa1b3;\n}\n\n/* Ocean Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #b48ead;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #2b303b;\n  color: #c0c5ce;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/paraiso-dark.css",
    "content": "/*\n    Paraíso (dark)\n    Created by Jan T. Sott (http://github.com/idleberg)\n    Inspired by the art of Rubens LP (http://www.rubenslp.com.br)\n*/\n\n/* Paraíso Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #8d8687;\n}\n\n/* Paraíso Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-link,\n.hljs-meta {\n  color: #ef6155;\n}\n\n/* Paraíso Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-deletion {\n  color: #f99b15;\n}\n\n/* Paraíso Yellow */\n.hljs-title,\n.hljs-section,\n.hljs-attribute {\n  color: #fec418;\n}\n\n/* Paraíso Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #48b685;\n}\n\n/* Paraíso Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #815ba4;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #2f1e2e;\n  color: #a39e9b;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/paraiso-light.css",
    "content": "/*\n    Paraíso (light)\n    Created by Jan T. Sott (http://github.com/idleberg)\n    Inspired by the art of Rubens LP (http://www.rubenslp.com.br)\n*/\n\n/* Paraíso Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #776e71;\n}\n\n/* Paraíso Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-link,\n.hljs-meta {\n  color: #ef6155;\n}\n\n/* Paraíso Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-deletion {\n  color: #f99b15;\n}\n\n/* Paraíso Yellow */\n.hljs-title,\n.hljs-section,\n.hljs-attribute {\n  color: #fec418;\n}\n\n/* Paraíso Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #48b685;\n}\n\n/* Paraíso Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #815ba4;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #e7e9db;\n  color: #4f424c;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/pojoaque.css",
    "content": "/*\n\nPojoaque Style by Jason Tate\nhttp://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html\nBased on Solarized Style from http://ethanschoonover.com/solarized\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  color: #dccf8f;\n  background: url(./pojoaque.jpg) repeat scroll left top #181914;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #586e75;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-addition {\n  color: #b64926;\n}\n\n.hljs-number,\n.hljs-string,\n.hljs-doctag,\n.hljs-regexp {\n  color: #468966;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-built_in,\n.hljs-name {\n  color: #ffb03b;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-class .hljs-title,\n.hljs-type,\n.hljs-tag {\n  color: #b58900;\n}\n\n.hljs-attribute {\n  color: #b89859;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link,\n.hljs-subst,\n.hljs-meta {\n  color: #cb4b16;\n}\n\n.hljs-deletion {\n  color: #dc322f;\n}\n\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #d3a60c;\n}\n\n.hljs-formula {\n  background: #073642;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/purebasic.css",
    "content": "/*\n\nPureBASIC native IDE style ( version 1.0 - April 2016 )\n\nby Tristano Ajmone <tajmone@gmail.com>\n\nPublic Domain\n\nNOTE_1:\tPureBASIC code syntax highlighting only applies the following classes:\n\t\t\t.hljs-comment\n\t\t\t.hljs-function\n\t\t\t.hljs-keywords\n\t\t\t.hljs-string\n\t\t\t.hljs-symbol\n\n\t\tOther classes are added here for the benefit of styling other languages with the look and feel of PureBASIC native IDE style.\n\t\tIf you need to customize a stylesheet for PureBASIC only, remove all non-relevant classes -- PureBASIC-related classes are followed by\n\t\ta \"--- used for PureBASIC ... ---\" comment on same line.\n\nNOTE_2:\tColor names provided in comments were derived using \"Name that Color\" online tool:\n\t\t\thttp://chir.ag/projects/name-that-color\n*/\n\n.hljs { /* Common set of rules required by highlight.js (don'r remove!) */\n\tdisplay: block;\n\toverflow-x: auto;\n\tpadding: 0.5em;\n\tbackground: #FFFFDF; /* Half and Half (approx.) */\n/* --- Uncomment to add PureBASIC native IDE styled font!\n\tfont-family: Consolas;\n*/\n}\n\n.hljs, /* --- used for PureBASIC base color --- */\n.hljs-type,  /* --- used for PureBASIC Procedures return type --- */\n.hljs-function, /* --- used for wrapping PureBASIC Procedures definitions --- */\n.hljs-name,\n.hljs-number,\n.hljs-attr,\n.hljs-params,\n.hljs-subst {\n\tcolor: #000000; /* Black */\n}\n\n.hljs-comment, /* --- used for PureBASIC Comments --- */\n.hljs-regexp,\n.hljs-section,\n.hljs-selector-pseudo,\n.hljs-addition {\n\tcolor: #00AAAA; /* Persian Green (approx.) */\n}\n\n.hljs-title, /* --- used for PureBASIC Procedures Names --- */\n.hljs-tag,\n.hljs-variable,\n.hljs-code  {\n\tcolor: #006666; /* Blue Stone (approx.) */\n}\n\n.hljs-keyword, /* --- used for PureBASIC Keywords --- */\n.hljs-class,\n.hljs-meta-keyword,\n.hljs-selector-class,\n.hljs-built_in,\n.hljs-builtin-name {\n\tcolor: #006666; /* Blue Stone (approx.) */\n\tfont-weight: bold;\n}\n\n.hljs-string, /* --- used for PureBASIC Strings --- */\n.hljs-selector-attr {\n\tcolor: #0080FF; /* Azure Radiance (approx.) */\n}\n\n.hljs-symbol, /* --- used for PureBASIC Constants --- */\n.hljs-link,\n.hljs-deletion,\n.hljs-attribute {\n\tcolor: #924B72; /* Cannon Pink (approx.) */\n}\n\n.hljs-meta,\n.hljs-literal,\n.hljs-selector-id {\n\tcolor: #924B72; /* Cannon Pink (approx.) */\n\tfont-weight: bold;\n}\n\n.hljs-strong,\n.hljs-name {\n\tfont-weight: bold;\n}\n\n.hljs-emphasis {\n\tfont-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/qtcreator_dark.css",
    "content": "/*\n\nQt Creator dark color scheme\n\n*/\n\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #000000;\n}\n\n.hljs,\n.hljs-subst,\n.hljs-tag,\n.hljs-title {\n  color: #aaaaaa;\n}\n\n.hljs-strong,\n.hljs-emphasis {\n  color: #a8a8a2;\n}\n\n.hljs-bullet,\n.hljs-quote,\n.hljs-number,\n.hljs-regexp,\n.hljs-literal {\n  color: #ff55ff;\n}\n\n.hljs-code\n.hljs-selector-class {\n  color: #aaaaff;\n}\n\n.hljs-emphasis,\n.hljs-stronge,\n.hljs-type {\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-function,\n.hljs-section,\n.hljs-symbol,\n.hljs-name {\n  color: #ffff55;\n}\n\n.hljs-attribute {\n  color: #ff5555;\n}\n\n.hljs-variable,\n.hljs-params,\n.hljs-class .hljs-title {\n  color: #8888ff;\n}\n\n.hljs-string,\n.hljs-selector-id,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition,\n.hljs-link {\n  color: #ff55ff;\n}\n\n.hljs-comment,\n.hljs-meta,\n.hljs-deletion {\n  color: #55ffff;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/qtcreator_light.css",
    "content": "/*\n\nQt Creator light color scheme\n\n*/\n\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #ffffff;\n}\n\n.hljs,\n.hljs-subst,\n.hljs-tag,\n.hljs-title {\n  color: #000000;\n}\n\n.hljs-strong,\n.hljs-emphasis {\n  color: #000000;\n}\n\n.hljs-bullet,\n.hljs-quote,\n.hljs-number,\n.hljs-regexp,\n.hljs-literal {\n  color: #000080;\n}\n\n.hljs-code\n.hljs-selector-class {\n  color: #800080;\n}\n\n.hljs-emphasis,\n.hljs-stronge,\n.hljs-type {\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-function,\n.hljs-section,\n.hljs-symbol,\n.hljs-name {\n  color: #808000;\n}\n\n.hljs-attribute {\n  color: #800000;\n}\n\n.hljs-variable,\n.hljs-params,\n.hljs-class .hljs-title {\n  color: #0055AF;\n}\n\n.hljs-string,\n.hljs-selector-id,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-type,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-addition,\n.hljs-link {\n  color: #008000;\n}\n\n.hljs-comment,\n.hljs-meta,\n.hljs-deletion {\n  color: #008000;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/railscasts.css",
    "content": "/*\n\nRailscasts-like style (c) Visoft, Inc. (Damien White)\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #232323;\n  color: #e6e1dc;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #bc9458;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #c26230;\n}\n\n.hljs-string,\n.hljs-number,\n.hljs-regexp,\n.hljs-variable,\n.hljs-template-variable {\n  color: #a5c261;\n}\n\n.hljs-subst {\n  color: #519f50;\n}\n\n.hljs-tag,\n.hljs-name {\n  color: #e8bf6a;\n}\n\n.hljs-type {\n  color: #da4939;\n}\n\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-attr,\n.hljs-link {\n  color: #6d9cbe;\n}\n\n.hljs-params {\n  color: #d0d0ff;\n}\n\n.hljs-attribute {\n  color: #cda869;\n}\n\n.hljs-meta {\n  color: #9b859d;\n}\n\n.hljs-title,\n.hljs-section {\n  color: #ffc66d;\n}\n\n.hljs-addition {\n  background-color: #144212;\n  color: #e6e1dc;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #600;\n  color: #e6e1dc;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-selector-class {\n  color: #9b703f;\n}\n\n.hljs-selector-id {\n  color: #8b98ab;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-link {\n  text-decoration: underline;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/rainbow.css",
    "content": "/*\n\nStyle with support for rainbow parens\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #474949;\n  color: #d1d9e1;\n}\n\n\n.hljs-comment,\n.hljs-quote {\n  color: #969896;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-type,\n.hljs-addition {\n  color: #cc99cc;\n}\n\n.hljs-number,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #f99157;\n}\n\n.hljs-string,\n.hljs-doctag,\n.hljs-regexp {\n  color: #8abeb7;\n}\n\n.hljs-title,\n.hljs-name,\n.hljs-section,\n.hljs-built_in {\n  color: #b5bd68;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-selector-id,\n.hljs-class .hljs-title {\n   color: #ffcc66;\n}\n\n.hljs-section,\n.hljs-name,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-subst,\n.hljs-meta,\n.hljs-link {\n  color: #f99157;\n}\n\n.hljs-deletion {\n  color: #dc322f;\n}\n\n.hljs-formula {\n  background: #eee8d5;\n}\n\n.hljs-attr,\n.hljs-attribute {\n  color: #81a2be;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/routeros.css",
    "content": "/*\n\n highlight.js style for Microtik RouterOS script\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #F0F0F0;\n}\n\n/* Base color: saturation 0; */\n\n.hljs,\n.hljs-subst {\n  color: #444;\n}\n\n.hljs-comment {\n  color: #888888;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-meta-keyword,\n.hljs-doctag,\n.hljs-name {\n  font-weight: bold;\n}\n\n.hljs-attribute {\n  color: #0E9A00;\n}    \n\n.hljs-function {\n  color: #99069A;\n}\n\n.hljs-builtin-name {\n  color: #99069A;\n}\n\n/* User color: hue: 0 */\n\n.hljs-type,\n.hljs-string,\n.hljs-number,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-quote,\n.hljs-template-tag,\n.hljs-deletion {\n  color: #880000;\n}\n\n.hljs-title,\n.hljs-section {\n  color: #880000;\n  font-weight: bold;\n}\n\n.hljs-regexp,\n.hljs-symbol,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-link,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #BC6060;\n}\n\n\n/* Language color: hue: 90; */\n\n.hljs-literal {\n  color: #78A960;\n}\n\n.hljs-built_in,\n.hljs-bullet,\n.hljs-code,\n.hljs-addition {\n  color: #0C9A9A;\n}\n\n\n/* Meta color: hue: 200 */\n\n.hljs-meta {\n  color: #1f7199;\n}\n\n.hljs-meta-string {\n  color: #4d99bf;\n}\n\n\n/* Misc effects */\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/school-book.css",
    "content": "/*\n\nSchool Book style from goldblog.com.ua (c) Zaripov Yura <yur4ik7@ukr.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 15px 0.5em 0.5em 30px;\n  font-size: 11px;\n  line-height:16px;\n}\n\npre{\n  background:#f6f6ae url(./school-book.png);\n  border-top: solid 2px #d2e8b9;\n  border-bottom: solid 1px #d2e8b9;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal {\n  color:#005599;\n  font-weight:bold;\n}\n\n.hljs,\n.hljs-subst {\n  color: #3e5915;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-attribute,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-link {\n  color: #2c009f;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion,\n.hljs-meta {\n  color: #e60415;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-name,\n.hljs-selector-id,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/solarized-dark.css",
    "content": "/*\n\nOrginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #002b36;\n  color: #839496;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #586e75;\n}\n\n/* Solarized Green */\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-addition {\n  color: #859900;\n}\n\n/* Solarized Cyan */\n.hljs-number,\n.hljs-string,\n.hljs-meta .hljs-meta-string,\n.hljs-literal,\n.hljs-doctag,\n.hljs-regexp {\n  color: #2aa198;\n}\n\n/* Solarized Blue */\n.hljs-title,\n.hljs-section,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #268bd2;\n}\n\n/* Solarized Yellow */\n.hljs-attribute,\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-class .hljs-title,\n.hljs-type {\n  color: #b58900;\n}\n\n/* Solarized Orange */\n.hljs-symbol,\n.hljs-bullet,\n.hljs-subst,\n.hljs-meta,\n.hljs-meta .hljs-keyword,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-link {\n  color: #cb4b16;\n}\n\n/* Solarized Red */\n.hljs-built_in,\n.hljs-deletion {\n  color: #dc322f;\n}\n\n.hljs-formula {\n  background: #073642;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/solarized-light.css",
    "content": "/*\n\nOrginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #fdf6e3;\n  color: #657b83;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #93a1a1;\n}\n\n/* Solarized Green */\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-addition {\n  color: #859900;\n}\n\n/* Solarized Cyan */\n.hljs-number,\n.hljs-string,\n.hljs-meta .hljs-meta-string,\n.hljs-literal,\n.hljs-doctag,\n.hljs-regexp {\n  color: #2aa198;\n}\n\n/* Solarized Blue */\n.hljs-title,\n.hljs-section,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #268bd2;\n}\n\n/* Solarized Yellow */\n.hljs-attribute,\n.hljs-attr,\n.hljs-variable,\n.hljs-template-variable,\n.hljs-class .hljs-title,\n.hljs-type {\n  color: #b58900;\n}\n\n/* Solarized Orange */\n.hljs-symbol,\n.hljs-bullet,\n.hljs-subst,\n.hljs-meta,\n.hljs-meta .hljs-keyword,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-link {\n  color: #cb4b16;\n}\n\n/* Solarized Red */\n.hljs-built_in,\n.hljs-deletion {\n  color: #dc322f;\n}\n\n.hljs-formula {\n  background: #eee8d5;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/sunburst.css",
    "content": "/*\n\nSunburst-like style (c) Vasily Polovnyov <vast@whiteants.net>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #000;\n  color: #f8f8f8;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #aeaeae;\n  font-style: italic;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-type {\n  color: #e28964;\n}\n\n.hljs-string {\n  color: #65b042;\n}\n\n.hljs-subst {\n  color: #daefa3;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #e9c062;\n}\n\n.hljs-title,\n.hljs-section,\n.hljs-tag,\n.hljs-name {\n  color: #89bdff;\n}\n\n.hljs-class .hljs-title,\n.hljs-doctag {\n  text-decoration: underline;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-number {\n  color: #3387cc;\n}\n\n.hljs-params,\n.hljs-variable,\n.hljs-template-variable {\n  color: #3e87e3;\n}\n\n.hljs-attribute {\n  color: #cda869;\n}\n\n.hljs-meta {\n  color: #8996a8;\n}\n\n.hljs-formula {\n  background-color: #0e2231;\n  color: #f8f8f8;\n  font-style: italic;\n}\n\n.hljs-addition {\n  background-color: #253b22;\n  color: #f8f8f8;\n}\n\n.hljs-deletion {\n  background-color: #420e09;\n  color: #f8f8f8;\n}\n\n.hljs-selector-class {\n  color: #9b703f;\n}\n\n.hljs-selector-id {\n  color: #8b98ab;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/tomorrow-night-blue.css",
    "content": "/* Tomorrow Night Blue Theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #7285b7;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #ff9da4;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #ffc58f;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n  color: #ffeead;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #d1f1a9;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n  color: #bbdaff;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #ebbbff;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #002451;\n  color: white;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/tomorrow-night-bright.css",
    "content": "/* Tomorrow Night Bright Theme */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #969896;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #d54e53;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #e78c45;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n  color: #e7c547;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #b9ca4a;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n  color: #7aa6da;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #c397d8;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: black;\n  color: #eaeaea;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/tomorrow-night-eighties.css",
    "content": "/* Tomorrow Night Eighties Theme */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #999999;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #f2777a;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #f99157;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n  color: #ffcc66;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #99cc99;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n  color: #6699cc;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #cc99cc;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #2d2d2d;\n  color: #cccccc;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/tomorrow-night.css",
    "content": "/* Tomorrow Night Theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #969896;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #cc6666;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #de935f;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n  color: #f0c674;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #b5bd68;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n  color: #81a2be;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #b294bb;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: #1d1f21;\n  color: #c5c8c6;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/tomorrow.css",
    "content": "/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n  color: #8e908c;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n  color: #c82829;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n  color: #f5871f;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n  color: #eab700;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n  color: #718c00;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n  color: #4271ae;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n  color: #8959a8;\n}\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  background: white;\n  color: #4d4d4c;\n  padding: 0.5em;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/vs.css",
    "content": "/*\n\nVisual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>\n\n*/\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: white;\n  color: black;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-variable {\n  color: #008000;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-built_in,\n.hljs-name,\n.hljs-tag {\n  color: #00f;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-section,\n.hljs-attribute,\n.hljs-literal,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-type,\n.hljs-addition {\n  color: #a31515;\n}\n\n.hljs-deletion,\n.hljs-selector-attr,\n.hljs-selector-pseudo,\n.hljs-meta {\n  color: #2b91af;\n}\n\n.hljs-doctag {\n  color: #808080;\n}\n\n.hljs-attr {\n  color: #f00;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link {\n  color: #00b0e8;\n}\n\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/vs2015.css",
    "content": "/*\n * Visual Studio 2015 dark style\n * Author: Nicolas LLOBERA <nllobera@gmail.com>\n */\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #1E1E1E;\n  color: #DCDCDC;\n}\n\n.hljs-keyword,\n.hljs-literal,\n.hljs-symbol,\n.hljs-name {\n  color: #569CD6;\n}\n.hljs-link {\n  color: #569CD6;\n  text-decoration: underline;\n}\n\n.hljs-built_in,\n.hljs-type {\n  color: #4EC9B0;\n}\n\n.hljs-number,\n.hljs-class {\n  color: #B8D7A3;\n}\n\n.hljs-string,\n.hljs-meta-string {\n  color: #D69D85;\n}\n\n.hljs-regexp,\n.hljs-template-tag {\n  color: #9A5334;\n}\n\n.hljs-subst,\n.hljs-function,\n.hljs-title,\n.hljs-params,\n.hljs-formula {\n  color: #DCDCDC;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #57A64A;\n  font-style: italic;\n}\n\n.hljs-doctag {\n  color: #608B4E;\n}\n\n.hljs-meta,\n.hljs-meta-keyword,\n.hljs-tag {\n  color: #9B9B9B;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #BD63C5;\n}\n\n.hljs-attr,\n.hljs-attribute,\n.hljs-builtin-name {\n  color: #9CDCFE;\n}\n\n.hljs-section {\n  color: gold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n/*.hljs-code {\n  font-family:'Monospace';\n}*/\n\n.hljs-bullet,\n.hljs-selector-tag,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-selector-attr,\n.hljs-selector-pseudo {\n  color: #D7BA7D;\n}\n\n.hljs-addition {\n  background-color: #144212;\n  display: inline-block;\n  width: 100%;\n}\n\n.hljs-deletion {\n  background-color: #600;\n  display: inline-block;\n  width: 100%;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/xcode.css",
    "content": "/*\n\nXCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #fff;\n  color: black;\n}\n\n.hljs-comment,\n.hljs-quote {\n  color: #006a00;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal {\n  color: #aa0d91;\n}\n\n.hljs-name {\n  color: #008;\n}\n\n.hljs-variable,\n.hljs-template-variable {\n  color: #660;\n}\n\n.hljs-string {\n  color: #c41a16;\n}\n\n.hljs-regexp,\n.hljs-link {\n  color: #080;\n}\n\n.hljs-title,\n.hljs-tag,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-number,\n.hljs-meta {\n  color: #1c00cf;\n}\n\n.hljs-section,\n.hljs-class .hljs-title,\n.hljs-type,\n.hljs-attr,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-params {\n  color: #5c2699;\n}\n\n.hljs-attribute,\n.hljs-subst {\n  color: #000;\n}\n\n.hljs-formula {\n  background-color: #eee;\n  font-style: italic;\n}\n\n.hljs-addition {\n  background-color: #baeeba;\n}\n\n.hljs-deletion {\n  background-color: #ffc8bd;\n}\n\n.hljs-selector-id,\n.hljs-selector-class {\n  color: #9b703f;\n}\n\n.hljs-doctag,\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/xt256.css",
    "content": "\n/*\n  xt256.css\n\n  Contact: initbar [at] protonmail [dot] ch\n         : github.com/initbar\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  color: #eaeaea;\n  background: #000;\n  padding: 0.5;\n}\n\n.hljs-subst {\n  color: #eaeaea;\n}\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n\n.hljs-builtin-name,\n.hljs-type {\n  color: #eaeaea;\n}\n\n.hljs-params {\n  color: #da0000;\n}\n\n.hljs-literal,\n.hljs-number,\n.hljs-name {\n  color: #ff0000;\n  font-weight: bolder;\n}\n\n.hljs-comment {\n  color: #969896;\n}\n\n.hljs-selector-id,\n.hljs-quote {\n  color: #00ffff;\n}\n\n.hljs-template-variable,\n.hljs-variable,\n.hljs-title {\n  color: #00ffff;\n  font-weight: bold;\n}\n\n.hljs-selector-class,\n.hljs-keyword,\n.hljs-symbol {\n  color: #fff000;\n}\n\n.hljs-string,\n.hljs-bullet {\n  color: #00ff00;\n}\n\n.hljs-tag,\n.hljs-section {\n  color: #000fff;\n}\n\n.hljs-selector-tag {\n  color: #000fff;\n  font-weight: bold;\n}\n\n.hljs-attribute,\n.hljs-built_in,\n.hljs-regexp,\n.hljs-link {\n  color: #ff00ff;\n}\n\n.hljs-meta {\n  color: #fff;\n  font-weight: bolder;\n}\n"
  },
  {
    "path": "CodeHub.iOS/WebResources/styles/zenburn.css",
    "content": "/*\n\nZenburn style from voldmar.ru (c) Vladimir Epifanov <voldmar@voldmar.ru>\nbased on dark.css by Ivan Sagalaev\n\n*/\n\n.hljs {\n  display: block;\n  overflow-x: auto;\n  padding: 0.5em;\n  background: #3f3f3f;\n  color: #dcdcdc;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-tag {\n  color: #e3ceab;\n}\n\n.hljs-template-tag {\n  color: #dcdcdc;\n}\n\n.hljs-number {\n  color: #8cd0d3;\n}\n\n.hljs-variable,\n.hljs-template-variable,\n.hljs-attribute {\n  color: #efdcbc;\n}\n\n.hljs-literal {\n  color: #efefaf;\n}\n\n.hljs-subst {\n  color: #8f8f8f;\n}\n\n.hljs-title,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-section,\n.hljs-type {\n  color: #efef8f;\n}\n\n.hljs-symbol,\n.hljs-bullet,\n.hljs-link {\n  color: #dca3a3;\n}\n\n.hljs-deletion,\n.hljs-string,\n.hljs-built_in,\n.hljs-builtin-name {\n  color: #cc9393;\n}\n\n.hljs-addition,\n.hljs-comment,\n.hljs-quote,\n.hljs-meta {\n  color: #7f9f7f;\n}\n\n\n.hljs-emphasis {\n  font-style: italic;\n}\n\n.hljs-strong {\n  font-weight: bold;\n}\n"
  },
  {
    "path": "CodeHub.iOS/XCallback/XCallbackProvider.cs",
    "content": "using System;\nusing MvvmCross.Platform;\nusing CodeHub.Core.Services;\nusing System.Collections.Generic;\nusing UIKit;\nusing Foundation;\nusing System.Reactive.Linq;\nusing CodeHub.iOS.ViewControllers.Gists;\n\nnamespace CodeHub.iOS.XCallback\n{\n    public static class XCallbackProvider\n    {\n        public static bool Handle(XCallbackQuery query)\n        {\n            var appService = Mvx.Resolve<IApplicationService>();\n\n            if (query.Url == \"/gist/create\")\n            {\n                var description = query.Parameters.ContainsKey(\"description\") ? query.Parameters[\"description\"] : null;\n                var isPublic = query.Parameters.ContainsKey(\"public\") && bool.Parse(query.Parameters[\"public\"]);\n                var files = new Dictionary<string, string>();\n\n                var fileCounter = 0;\n                foreach (var param in query.Parameters)\n                {\n                    if (param.Key.StartsWith(\"file\", StringComparison.Ordinal))\n                        files.Add(\"gistfile\" + (++fileCounter) + \".txt\", param.Value);\n                }\n\n                appService.SetUserActivationAction(() => {\n                    var app = UIApplication.SharedApplication.Delegate as AppDelegate;\n                    var ctrl = app?.Window?.GetVisibleViewController();\n                    if (ctrl == null)\n                        return;\n                    \n                    var view = GistCreateViewController.Show(ctrl);\n                    view.ViewModel.Description = description;\n                    view.ViewModel.Public = isPublic;\n                    view.ViewModel.Files = files;\n\n                    view.ViewModel.SaveCommand.Take(1).Subscribe(x => {\n                        var msg = new Dictionary<string, string> { { \"id\", x.Id } };\n                        UIApplication.SharedApplication.OpenUrl(new NSUrl(query.ExpandSuccessUrl(msg)));\n                    });\n\n                    view.ViewModel.CancelCommand.Take(1).Subscribe(_ => {\n                        UIApplication.SharedApplication.OpenUrl(new NSUrl(query.CancelUrl));\n                    });\n                });\n\n                return true;\n            }\n\n            return false;\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/XCallback/XCallbackQuery.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Linq;\n\nnamespace CodeHub.iOS.XCallback\n{\n    public class XCallbackQuery\n    {\n        public string SuccessUrl { get; private set; }\n        public string ErrorUrl { get; private set; }\n        public string CancelUrl { get; private set; }\n        public string Url { get; private set; }\n        public IDictionary<string, string> Parameters { get; private set; }\n\n        public XCallbackQuery(string urlString)\n        {\n            var uri = new Uri(urlString);\n            Url = uri.AbsolutePath;\n            Parameters = new Dictionary<string, string>();\n            var query = System.Web.HttpUtility.ParseQueryString(uri.Query);\n            foreach (string key in query.Keys)\n            {\n                if (key == null)\n                    continue;\n\n                if (string.Equals(\"x-success\", key, StringComparison.OrdinalIgnoreCase))\n                    SuccessUrl = query[key];\n                else if (string.Equals(\"x-error\", key, StringComparison.OrdinalIgnoreCase))\n                    ErrorUrl = query[key];\n                else if (string.Equals(\"x-cancel\", key, StringComparison.OrdinalIgnoreCase))\n                    CancelUrl = query[key];\n                else\n                    Parameters.Add(key, query[key]);\n            }\n        }\n\n        public string ExpandErrorUrl(int errorCode, string errorMessage)\n        {\n            return string.Format(ErrorUrl + \"?errorCode={0}&errorMessage={1}\", errorCode.ToString(), Uri.EscapeDataString(errorMessage));\n        }\n\n        public string ExpandSuccessUrl(IDictionary<string, string> parameters)\n        {\n            var sb = new StringBuilder();\n            sb.Append(SuccessUrl);\n            sb.Append(\"?\");\n            sb.Append(string.Join(\"&\", parameters.Select(x => x.Key + \"=\" + Uri.EscapeDataString(x.Value))));\n            return sb.ToString();\n        }\n    }\n}\n\n"
  },
  {
    "path": "CodeHub.iOS/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"akavache\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"akavache.core\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"akavache.sqlite3\" version=\"5.0.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"BTProgressHUD\" version=\"1.2.0.6\" targetFramework=\"xamarinios10\" />\n  <package id=\"GitHubClient\" version=\"1.0.15\" targetFramework=\"xamarinios10\" />\n  <package id=\"Humanizer.Core\" version=\"2.2.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.AppCenter\" version=\"1.5.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.AppCenter.Analytics\" version=\"1.5.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.AppCenter.Crashes\" version=\"1.5.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.Bcl\" version=\"1.1.10\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.Bcl.Build\" version=\"1.0.21\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.CSharp\" version=\"4.4.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"Microsoft.NETCore.Platforms\" version=\"2.0.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"MonoTouch.SlideoutNavigation\" version=\"1.0.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Binding\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Core\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"MvvmCross.Platform\" version=\"4.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"NETStandard.Library\" version=\"2.0.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"Newtonsoft.Json\" version=\"10.0.3\" targetFramework=\"xamarinios10\" />\n  <package id=\"Octokit\" version=\"0.29.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"PCLStorage\" version=\"1.0.2\" targetFramework=\"xamarinios10\" />\n  <package id=\"Plugin.Permissions\" version=\"2.2.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"reactiveui\" version=\"7.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"reactiveui-core\" version=\"7.4.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Core\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Interfaces\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Linq\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-Main\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Rx-PlatformServices\" version=\"2.2.5\" targetFramework=\"xamarinios10\" />\n  <package id=\"Splat\" version=\"1.6.2\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCL.raw_basic\" version=\"0.8.6\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.bundle_e_sqlite3\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.core\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.lib.e_sqlite3.ios_unified.static\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"SQLitePCLRaw.provider.internal.ios_unified\" version=\"1.1.9\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.ComponentModel.TypeConverter\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Runtime.Serialization.Formatters\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Runtime.Serialization.Primitives\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"System.Xml.XmlDocument\" version=\"4.3.0\" targetFramework=\"xamarinios10\" />\n  <package id=\"Xam.Plugin.Media\" version=\"3.1.3\" targetFramework=\"xamarinios10\" />\n  <package id=\"Xam.Plugins.Settings\" version=\"3.1.1\" targetFramework=\"xamarinios10\" />\n  <package id=\"Xamarin.SDWebImage\" version=\"3.7.5\" targetFramework=\"xamarinios10\" />\n</packages>"
  },
  {
    "path": "CodeHub.iOS.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 2012\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CodeHub.iOS\", \"CodeHub.iOS\\CodeHub.iOS.csproj\", \"{B061316A-F386-4FE2-93B7-555584234FF8}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CodeHub.Core\", \"CodeHub.Core\\CodeHub.Core.csproj\", \"{B7970173-9022-466B-B57A-7AB1E1F3145F}\"\r\nEndProject\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CodeHub\", \"CodeHub\\CodeHub.csproj\", \"{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tAdHoc|Any CPU = AdHoc|Any CPU\r\n\t\tAd-Hoc|Any CPU = Ad-Hoc|Any CPU\r\n\t\tAdHoc|iPhone = AdHoc|iPhone\r\n\t\tAd-Hoc|iPhone = Ad-Hoc|iPhone\r\n\t\tAdHoc|iPhoneSimulator = AdHoc|iPhoneSimulator\r\n\t\tAd-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator\r\n\t\tAdHoc|Mixed Platforms = AdHoc|Mixed Platforms\r\n\t\tAd-Hoc|Mixed Platforms = Ad-Hoc|Mixed Platforms\r\n\t\tAppStore|Any CPU = AppStore|Any CPU\r\n\t\tAppStore|iPhone = AppStore|iPhone\r\n\t\tAppStore|iPhoneSimulator = AppStore|iPhoneSimulator\r\n\t\tAppStore|Mixed Platforms = AppStore|Mixed Platforms\r\n\t\tDebug|Any CPU = Debug|Any CPU\r\n\t\tDebug|iPhone = Debug|iPhone\r\n\t\tDebug|iPhoneSimulator = Debug|iPhoneSimulator\r\n\t\tDebug|Mixed Platforms = Debug|Mixed Platforms\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\t\tRelease|iPhone = Release|iPhone\r\n\t\tRelease|iPhoneSimulator = Release|iPhoneSimulator\r\n\t\tRelease|Mixed Platforms = Release|Mixed Platforms\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|Any CPU.ActiveCfg = Ad-Hoc|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|Any CPU.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|Any CPU.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|iPhone.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|iPhone.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|Mixed Platforms.ActiveCfg = Ad-Hoc|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AdHoc|Mixed Platforms.Build.0 = Ad-Hoc|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|Any CPU.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|Any CPU.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|iPhone.ActiveCfg = AppStore|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|iPhone.Build.0 = AppStore|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|Mixed Platforms.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.AppStore|Mixed Platforms.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|iPhone.ActiveCfg = Debug|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|iPhone.Build.0 = Debug|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|Mixed Platforms.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Debug|Mixed Platforms.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|Any CPU.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|Any CPU.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|iPhone.ActiveCfg = Release|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|iPhone.Build.0 = Release|iPhone\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|Mixed Platforms.ActiveCfg = Debug|iPhoneSimulator\r\n\t\t{B061316A-F386-4FE2-93B7-555584234FF8}.Release|Mixed Platforms.Build.0 = Debug|iPhoneSimulator\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|iPhone.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|iPhone.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|Mixed Platforms.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AdHoc|Mixed Platforms.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|iPhone.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|iPhone.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\r\n\t\t{B7970173-9022-466B-B57A-7AB1E1F3145F}.Release|Mixed Platforms.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|iPhone.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|iPhone.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AdHoc|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|iPhone.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|iPhone.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|Any CPU.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|iPhone.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|iPhone.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\r\n\t\t{B01CF3C6-51DF-4CAE-A07C-E4BC907833D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU\r\n\tEndGlobalSection\r\n\tGlobalSection(MonoDevelopProperties) = preSolution\r\n\t\tPolicies = $0\r\n\t\t$0.DotNetNamingPolicy = $1\r\n\t\t$1.DirectoryNamespaceAssociation = PrefixedHierarchical\r\n\t\t$0.TextStylePolicy = $2\r\n\t\t$2.inheritsSet = null\r\n\t\t$2.inheritsScope = text/plain\r\n\t\t$2.scope = application/javascript\r\n\t\t$2.FileWidth = 120\r\n\t\t$0.TextStylePolicy = $3\r\n\t\t$3.scope = text/x-csharp\r\n\t\t$3.FileWidth = 160\r\n\t\t$3.TabsToSpaces = True\r\n\t\t$0.CSharpFormattingPolicy = $4\r\n\t\t$4.IndentSwitchBody = True\r\n\t\t$4.PropertyBraceStyle = NextLine\r\n\t\t$4.PropertyGetBraceStyle = NextLine\r\n\t\t$4.PropertySetBraceStyle = NextLine\r\n\t\t$4.EventBraceStyle = NextLine\r\n\t\t$4.EventAddBraceStyle = NextLine\r\n\t\t$4.EventRemoveBraceStyle = NextLine\r\n\t\t$4.StatementBraceStyle = NextLine\r\n\t\t$4.ElseNewLinePlacement = NewLine\r\n\t\t$4.CatchNewLinePlacement = NewLine\r\n\t\t$4.FinallyNewLinePlacement = NewLine\r\n\t\t$4.WhileNewLinePlacement = DoNotCare\r\n\t\t$4.ArrayInitializerWrapping = DoNotChange\r\n\t\t$4.ArrayInitializerBraceStyle = NextLine\r\n\t\t$4.BeforeMethodDeclarationParentheses = False\r\n\t\t$4.BeforeMethodCallParentheses = False\r\n\t\t$4.BeforeConstructorDeclarationParentheses = False\r\n\t\t$4.NewLineBeforeConstructorInitializerColon = NewLine\r\n\t\t$4.NewLineAfterConstructorInitializerColon = SameLine\r\n\t\t$4.BeforeDelegateDeclarationParentheses = False\r\n\t\t$4.NewParentheses = False\r\n\t\t$4.SpacesBeforeBrackets = False\r\n\t\t$4.scope = text/x-csharp\r\n\t\t$0.TextStylePolicy = $5\r\n\t\t$5.scope = text/plain\r\n\t\t$5.TabsToSpaces = True\r\n\t\t$0.TextStylePolicy = $6\r\n\t\t$6.inheritsSet = null\r\n\t\t$6.scope = application/xml\r\n\t\t$0.XmlFormattingPolicy = $7\r\n\t\t$7.scope = application/xml\r\n\t\t$0.TextStylePolicy = $8\r\n\t\t$8.inheritsSet = null\r\n\t\t$8.scope = text/html\r\n\t\t$0.TextStylePolicy = $9\r\n\t\t$9.inheritsSet = null\r\n\t\t$9.scope = text/css\r\n\t\t$0.TextStylePolicy = $10\r\n\t\t$10.scope = text/x-cshtml\r\n\t\t$10.FileWidth = 80\r\n\t\t$10.TabsToSpaces = True\r\n\t\t$10.TabWidth = 2\r\n\t\t$10.IndentWidth = 2\r\n\t\t$0.StandardHeader = $11\r\n\t\t$0.NameConventionPolicy = $12\r\n\t\t$12.Rules = $13\r\n\t\t$13.NamingRule = $14\r\n\t\t$14.Name = Type Parameters\r\n\t\t$14.AffectedEntity = TypeParameter\r\n\t\t$14.VisibilityMask = VisibilityMask\r\n\t\t$14.NamingStyle = PascalCase\r\n\t\t$14.IncludeInstanceMembers = True\r\n\t\t$14.IncludeStaticEntities = True\r\n\t\t$14.RequiredPrefixes = $15\r\n\t\t$15.String = T\r\n\t\t$14.RequiredSuffixes = $16\r\n\t\t$16.String = Exception\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "PRIVATE-POLICY.md",
    "content": "# Private Policy\n\nLast Updated: July 26, 2016\n\nThis document informs you of the policies regarding the collection, use and disclosure of Personal Information I, Dillon Buchanan (the \"Owner\" or \"I\"), receive from users of CodeHub (the \"App\").\n\nI, the Owner, use your Personal Information only for providing and improving the App. By using the App, you agree to the collection and use of information in accordance with this policy.\n\n## Information Collection And Use\n\nThe following describes the collection and use of data collected by the App.\n\n### Error Logging\n\nTo reduce the number of crashes and error conditions the App will report stack traces to an AWS account owned and \nmaintained by the Owner. The data extracted from the devices include the following:\n\n- Error Message\n- Error Stack Trace\n- Application Version\n- iOS Version\n- Programming Method Name\n- Terminal Error flag\n- App Name\n- App Navigation Path\n\nThe above are mostly self explanitory except for `App Navigation Path`. `App Navigation Path` refers to the internal App views that was navigated until the crash occurred.\n\nNo personal information is extracted during this process.\n\n### Push Notifiation GitHub User\n\nFor users of the App's push notification feature, the user's OAuth token will be sent to a secure virtual private server maintained and operated by the Owner.\nUpon recipt of the OAuth token, the user's name will be requested and their GitHub Notifications will be polled at a regular interval to generate the necessary push notifications - no other personal information is requested during this process.\n\nAt any time a user may disable push notifications from within the App and the OAuth token and username will be permanently deleted from the VPS instance. \nIn addition, deleting the App or revoking the GitHub OAuth token granted to the App will remove the user's name and OAuth token from the VPS instance.\n\n## Information Sharing\n\nUser information is not shared with any entity.\n\n## Security\n\nThe security of your Personal Information is important, but remember that no method of\ntransmission over the Internet, or method of electronic storage, is 100% secure. While I strive to\nuse commercially acceptable means to protect your Personal Information, I cannot guarantee its\nabsolute security.\n\n## Changes To This Privacy Policy\n\nThis Privacy Policy is effective as of July 26, 2016 and will remain in effect except with respect to any\nchanges in its provisions in the future, which will be in effect immediately after being posted on this\npage.\n\nWe reserve the right to update or change our Privacy Policy at any time and you should check this\nPrivacy Policy periodically. Your continued use of the Service after we post any modifications to the\nPrivacy Policy on this page will constitute your acknowledgment of the modifications and your\nconsent to abide and be bound by the modified Privacy Policy.\n\nIf we make any material changes to this Privacy Policy, we will notify you either through the email\naddress you have provided us, or by placing a prominent notice on our website.\n\n## Contact\n\nIf you have any questions about this Privacy Policy, please contact the Owner.\n\n\n\n\n\n\n\n"
  },
  {
    "path": "README.md",
    "content": "<a href=\"http://codehub-app.com/\"><img alt=\"CodeHub\" src=\"https://raw.githubusercontent.com/thedillonb/CodeHub/gh-pages/assets/CodeHubTitle.jpg\" width=\"100%\"></a>\n\n[![Gitter](https://badges.gitter.im/thedillonb/CodeHub.svg)](https://gitter.im/thedillonb/CodeHub?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\n\nCodeHub is the best way to browse and maintain your GitHub repositories on any iPhone, iPod Touch, and iPad device! Keep an eye on your projects with the ability to view everything from pull requests to commenting on individual file diffs in the latest change set. CodeHub brings GitHub to your finger tips in a sleek and efficient design. \n\nFollow the project on twitter: [@CodeHubApp](http://www.twitter.com/CodeHubApp)<br />\nFeature requests can be made on [GitHub](https://github.com/CodeHubApp/CodeHub/issues)<br />\nAdditional information can be found on the [project's webpage](http://codehub-app.com/)\n\n## Screenshots\n\n\n<img alt=\"Repository View\" src=\"https://raw.github.com/thedillonb/CodeHub/master/Screenshots/Image1.jpg\" width=\"240\">&nbsp;<img alt=\"Slideout\" src=\"https://raw.github.com/thedillonb/CodeHub/master/Screenshots/Image2.jpg\" width=\"240\">&nbsp;<img alt=\"Repositories\" src=\"https://raw.github.com/thedillonb/CodeHub/master/Screenshots/Image3.jpg\" width=\"240\">&nbsp;<img alt=\"Issues\" src=\"https://raw.github.com/thedillonb/CodeHub/master/Screenshots/Image4.jpg\" width=\"240\">&nbsp;<img alt=\"Gists\" src=\"https://raw.github.com/thedillonb/CodeHub/master/Screenshots/Image5.jpg\" width=\"240\">\n\n## Contributing\n\nContributions are absolutely welcome! The project is built on [Xamarin](https://www.xamarin.com/), a free C# framework for iOS applications. You'll need to download this to build the project.  \n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Troubleshooting\n\n### I Can't Find My Organization\n\nCodeHub can see all organizations *if they are granted access*. GitHub, by default, disables [third-party access](https://help.github.com/articles/about-third-party-application-restrictions/) for new organizations. Because of this, CodeHub has no knowledge that those organizations even exist. GitHub keeps that information from the app. There are several ways to correct this. If you own the organization follow [these instructions](https://help.github.com/articles/enabling-third-party-application-restrictions-for-your-organization/). If you do not own the organization you can request access for CodeHub by following [these instructions](https://help.github.com/articles/requesting-organization-approval-for-third-party-applications/).\n\n### I Can't Find My Repository\n\nIf these repositories belong to an organization then your problem is most likely due to the issue above. Please consult it for a remedy.\n\nIf they do not belong to an organization then something is not right. Please file a ticket.'\n\n### I need help!\n\nTry the [Gitter](https://gitter.im/thedillonb/CodeHub) channel.\n\n## Credits\n\nA lot of thanks to many who contribute to open-source projects. The following were instrumental to building this app:\n\n* [Json.NET](http://www.newtonsoft.com/json)\n* [ReactiveUI](https://github.com/reactiveui/ReactiveUI)\n* [MVVMCross](https://github.com/MvvmCross/MvvmCross)\n* [Marked.js](https://github.com/chjj/marked)\n\n"
  }
]