├── docs
├── CNAME
├── _config.yml
├── assets
│ └── css
│ │ └── style.scss
├── snippets.md
├── _layouts
│ └── default.html
└── README.md
├── _config.yml
├── parser
├── testdata
│ ├── packages
│ │ ├── one.go
│ │ └── one_test.go
│ ├── files
│ │ ├── file.go
│ │ └── file2.go
│ ├── otherpackage
│ │ └── struct.go
│ ├── types
│ │ ├── consts.go
│ │ ├── interfaces.go
│ │ ├── structs.go
│ │ ├── funcs.go
│ │ └── vars.go
│ └── samepackage
│ │ └── main.go
├── consts_test.go
├── interfaces_test.go
├── parser_test.go
├── structs_test.go
├── vars_test.go
├── different_package_test.go
├── funcs_test.go
├── importer.go
└── parser.go
├── query
├── README.md
├── model_test.go
├── query_test.go
└── query.go
├── source
├── testdata
│ └── source.go
├── README.md
├── goget_test.go
├── default
│ └── source.go
├── goget.go
├── source_test.go
└── source.go
├── editor
├── static
│ ├── js
│ │ └── app.js
│ ├── lib
│ │ ├── themes
│ │ │ └── default
│ │ │ │ └── assets
│ │ │ │ ├── fonts
│ │ │ │ ├── icons.eot
│ │ │ │ ├── icons.otf
│ │ │ │ ├── icons.ttf
│ │ │ │ ├── icons.woff
│ │ │ │ └── icons.woff2
│ │ │ │ └── images
│ │ │ │ └── flags.png
│ │ ├── e-clipboard.v1.5.16.min.js
│ │ └── d-riot+compiler.v3.0.5.min.js
│ ├── css
│ │ └── app.css
│ └── tags
│ │ ├── codebox.tag
│ │ └── editor.tag
├── app.yaml
├── routes.go
├── README.md
├── templates
│ ├── editor
│ │ └── content.tpl.html
│ └── layout.tpl.html
├── code
│ ├── default-template.tpl
│ └── default-source.go
├── build.sh
├── main.go
├── templates.go
├── preview.go
├── way_test.go
└── way.go
├── internal
└── version
│ └── version.go
├── model
├── README.md
└── model.go
├── render
├── testdata
│ └── types
│ │ ├── consts.go
│ │ ├── vars.go
│ │ ├── interfaces.go
│ │ ├── structs.go
│ │ └── funcs.go
├── render_test.go
├── funcs_test.go
└── render.go
├── tutorial
├── greeter
│ └── greeter.go
└── templates
│ └── methods.tpl
├── .travis.yml
├── examples
└── mocking
│ ├── greeter.go
│ ├── templates
│ └── mock.tpl
│ └── greeter_mock.go
├── .gitignore
├── tool
├── tool_test.go
└── tool.go
├── README.md
├── main.go
└── LICENSE
/docs/CNAME:
--------------------------------------------------------------------------------
1 | codeform.in
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
2 | gems:
3 | - jekyll-sitemap
--------------------------------------------------------------------------------
/parser/testdata/packages/one.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | func init() {}
4 |
--------------------------------------------------------------------------------
/docs/assets/css/style.scss:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 | @import "{{ site.theme }}";
5 |
--------------------------------------------------------------------------------
/parser/testdata/packages/one_test.go:
--------------------------------------------------------------------------------
1 | package pkgname_test
2 |
3 | func init() {}
4 |
--------------------------------------------------------------------------------
/parser/testdata/files/file.go:
--------------------------------------------------------------------------------
1 | package files
2 |
3 | type Struct struct {
4 | Field string
5 | }
6 |
7 | var egg int = 1
8 |
--------------------------------------------------------------------------------
/query/README.md:
--------------------------------------------------------------------------------
1 | # Codeform Querying
2 |
3 | The `query` package allows you to select specific items from `model.Code` by name.
4 |
--------------------------------------------------------------------------------
/source/testdata/source.go:
--------------------------------------------------------------------------------
1 | package test
2 |
3 | import "log"
4 |
5 | func init() {
6 | log.Println("This is a local source file.")
7 | }
8 |
--------------------------------------------------------------------------------
/editor/static/js/app.js:
--------------------------------------------------------------------------------
1 | var app = riot.observable()
2 |
3 | app.counter = 1;
4 |
5 | app.uniqueValue = function() {
6 | return app.counter++
7 | }
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/fonts/icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/fonts/icons.eot
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/fonts/icons.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/fonts/icons.otf
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/fonts/icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/fonts/icons.ttf
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/fonts/icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/fonts/icons.woff
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/fonts/icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/fonts/icons.woff2
--------------------------------------------------------------------------------
/editor/static/lib/themes/default/assets/images/flags.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matryer/codeform/HEAD/editor/static/lib/themes/default/assets/images/flags.png
--------------------------------------------------------------------------------
/parser/testdata/otherpackage/struct.go:
--------------------------------------------------------------------------------
1 | package otherpackage
2 |
3 | // ExternalStruct is an exported structure used for testing.
4 | type ExternalStruct struct {
5 | Field int
6 | }
7 |
--------------------------------------------------------------------------------
/internal/version/version.go:
--------------------------------------------------------------------------------
1 | // Package version holds the version number of the codeform project.
2 | package version
3 |
4 | // Current is the current version.
5 | const Current = "0.6.4"
6 |
--------------------------------------------------------------------------------
/parser/testdata/files/file2.go:
--------------------------------------------------------------------------------
1 | package files
2 |
3 | // this file should be ignored because only file.go is
4 | // specified in the test.
5 |
6 | type Struct2 struct{}
7 |
8 | var nope int
9 |
--------------------------------------------------------------------------------
/model/README.md:
--------------------------------------------------------------------------------
1 | # Codeform Model
2 |
3 | The Model represents the source code for entire Go projects.
4 |
5 | * View the [Model API documentation](https://godoc.org/github.com/matryer/codeform/model)
--------------------------------------------------------------------------------
/editor/app.yaml:
--------------------------------------------------------------------------------
1 | application: codeformapp
2 | version: 1
3 | runtime: go
4 | api_version: go1
5 |
6 | handlers:
7 | - url: /static
8 | static_dir: static
9 | - url: /.*
10 | script: _go_app
11 |
--------------------------------------------------------------------------------
/parser/testdata/types/consts.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | const pi float64 = 3.14
4 |
5 | const constantName string = "codeform"
6 |
7 | const (
8 | c1 int = iota
9 | c2
10 | c3
11 | c4
12 | )
13 |
--------------------------------------------------------------------------------
/render/testdata/types/consts.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | const pi float64 = 3.14
4 |
5 | const constantName string = "codeform"
6 |
7 | const (
8 | c1 int = iota
9 | c2
10 | c3
11 | c4
12 | )
13 |
--------------------------------------------------------------------------------
/tutorial/greeter/greeter.go:
--------------------------------------------------------------------------------
1 | package greeter
2 |
3 | type Greeter interface {
4 | Greet(name string) (string, error)
5 | Reset()
6 | }
7 |
8 | type Signoff interface {
9 | Signoff(name string) string
10 | }
11 |
--------------------------------------------------------------------------------
/tutorial/templates/methods.tpl:
--------------------------------------------------------------------------------
1 | {{- range .Packages }}
2 | {{- range .Interfaces }}{{ $interface := . }}
3 | {{- range .Methods }}
4 | {{ $interface.Name }}.{{ .Name }}{{ . | Signature }}
5 | {{- end }}
6 | {{- end }}
7 | {{- end }}
8 |
--------------------------------------------------------------------------------
/parser/testdata/samepackage/main.go:
--------------------------------------------------------------------------------
1 | package samepackage
2 |
3 | import (
4 | "github.com/matryer/codeform/parser/testdata/otherpackage"
5 | )
6 |
7 | // Something refers to an external type.
8 | func Something(val *otherpackage.ExternalStruct) {}
9 |
--------------------------------------------------------------------------------
/parser/testdata/types/interfaces.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | type Interface1 interface{}
4 |
5 | type Interface2 interface {
6 | Method1()
7 | Method2()
8 | }
9 |
10 | type Interface3 interface {
11 | TheMethod(arg1, arg2 string) error
12 | }
13 |
--------------------------------------------------------------------------------
/render/testdata/types/vars.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | var number int
4 |
5 | var name string
6 |
7 | var (
8 | var1 int
9 | var2 string
10 | var3 bool
11 | )
12 |
13 | var preset int = 123
14 |
15 | var channel chan []byte
16 |
17 | var amap map[string]int
18 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | sudo: false
4 |
5 | go:
6 | - 1.6.x
7 | - 1.7.x
8 | - 1.8.x
9 | - tip
10 |
11 | before_install:
12 | - go get github.com/golang/lint/golint
13 |
14 | before_script:
15 | - go vet ./...
16 | - golint ./...
17 |
18 | script:
19 | - go test -v ./...
20 |
--------------------------------------------------------------------------------
/editor/routes.go:
--------------------------------------------------------------------------------
1 | package editor
2 |
3 | func routes(r *Router) {
4 | r.HandleFunc("POST", "/preview", previewHandler)
5 | r.HandleFunc("GET", "/default-source", defaultSourceHandler)
6 | r.HandleFunc("GET", "/default-template", defaultTemplateHandler)
7 | r.Handle("GET", "/", templateHandler("editor"))
8 | }
9 |
--------------------------------------------------------------------------------
/render/testdata/types/interfaces.go:
--------------------------------------------------------------------------------
1 | package pkgname
2 |
3 | type Interface1 interface{}
4 |
5 | type Person interface {
6 | Greet(name string) (string, error)
7 | ShakeHand(level int) error
8 | Whisper(messages ...string)
9 | }
10 |
11 | type Interface3 interface {
12 | TheMethod(arg1, arg2 string) error
13 | }
14 |
--------------------------------------------------------------------------------
/examples/mocking/greeter.go:
--------------------------------------------------------------------------------
1 | package mocking
2 |
3 | //go:generate codeform -src . -out ./greeter_mock.go -templatesrc ./templates/mock.tpl -interface Greeter,Signoff
4 |
5 | type Greeter interface {
6 | Greet(name string) (string, error)
7 | Reset()
8 | }
9 |
10 | type Signoff interface {
11 | Signoff(name string) string
12 | }
13 |
--------------------------------------------------------------------------------
/editor/README.md:
--------------------------------------------------------------------------------
1 | # Codeform editor
2 |
3 | The editor is a Google App Engine app. To run it, download the
4 | [Google App Engine SDK for Go](https://cloud.google.com/appengine/docs/go/download) and
5 | in a terminal, run `goapp serve`.
6 |
7 | NOTE: This might change to the `gcloud` command soon - if you find this has happened, please
8 | submit a PR correcting this notice.
--------------------------------------------------------------------------------
/editor/templates/editor/content.tpl.html:
--------------------------------------------------------------------------------
1 | {{ define "title" }}Codeform Editor{{ end }}
2 | {{ define "content" }}
3 |
{{ site.description | default: site.github.project_tagline }}
23 | 24 |
29 | Online Editor
30 |
31 | Templates repo
32 |
33 | Data Model documentation
34 |
35 | Template helpers
36 |
66 | Source code will be used to render the preview - must be valid Go code 67 |
68 |]/.test(e)&&(e=e.replace(Xt,function(e){return n.push(e),""})),e=e.trim().replace(/\s+/g," "),n.length&&(e=e.replace(/\u0002/g,function(){return n.shift()}))}return t.compact&&(e=e.replace(Qt,"><$1")),be(e,r).replace(tr,"")}function Ce(e,t,r){return Array.isArray(t)?(r=t,t={}):(r||(r=[]),t||(t={})),r._bp=bt.array(t.brackets),we(ve(e),t,r)}function Oe(e){function t(e,t,r){for(t.lastIndex=0;r=t.exec(e);)"/"!==r[0][0]||r[1]||r[2]||(e=u.leftContext+" "+u.rightContext,t.lastIndex=r[3]+1);return e}function r(e,t){var r,n=1;for(t.lastIndex=0;n&&(r=t.exec(e));)"{"===r[0]?++n:"}"===r[0]&&--n;return n?e.length:t.lastIndex}var n,i,o,a,s=[],u=RegExp;for(~e.indexOf("/")&&(e=t(e,lr));n=e.match(ur);)s.push(u.leftContext),e=u.rightContext,o=r(e,cr),a=n[1],i=!/^(?:if|while|for|switch|catch|function)$/.test(a),a=i?n[0].replace(a,"this."+a+" = function"):n[0],s.push(a,e.slice(0,o)),e=e.slice(o),i&&!/^\s*.\s*bind\b/.test(e)&&s.push(".bind(this)");return s.length?s.join("")+e:e}function _e(e,t,r,n,i){if(!/\S/.test(e))return"";r||(r=t.type);var o=t.parser||r&&Dt._req("js."+r,!0)||Oe;return o(e,n,i).replace(/\r\n?/g,"\n").replace(tr,"")}function Ee(e,t,r,n){return"string"==typeof t&&(n=r,r=t,t={}),r&&"object"==typeof r&&(n=r,r=""),n||(n={}),_e(e,t||{},r,n.parserOptions,n.url)}function Ne(e,t){var r=":scope";return t.replace(pr,function(t,n,i){return i?(i=i.replace(/[^,]+/g,function(t){var n=t.trim();return 0===n.indexOf(e)?t:n&&"from"!==n&&"to"!==n&&"%"!==n.slice(-1)?n=n.indexOf(r)<0?e+" "+n+',[data-is="'+e+'"] '+n:n.replace(r,e)+","+n.replace(r,'[data-is="'+e+'"]'):t}),n?n+" "+i:i):t})}function je(e,t,r,n){if(n=n||{},r&&"css"!==r){var i=Dt._req("css."+r,!0);e=i(t,e,n.parserOpts||{},n.url)}return e=e.replace(bt.R_MLCOMMS,"").replace(/\s+/g," ").trim(),t&&(e=Ne(t,e)),e}function Se(e,t,r){return t&&"object"==typeof t?(r=t,t=""):r||(r={}),je(e,r.tagName,t,r)}function Te(e,t){return e?(e=sr+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+sr,t&&~e.indexOf("\n")?e.replace(/\n/g,"\\n"):e):"''"}function Le(e,t,r,n,i,o,a){var s=a.debug?",\n ":", ",u="});";return i&&"\n"!==i.slice(-1)&&(u="\n"+u),o+"riot.tag2('"+e+sr+s+Te(t,1)+s+Te(r)+s+Te(n)+", function(opts) {\n"+i+u}function Ae(e){if(/<[-\w]/.test(e))for(var t,r=e.lastIndexOf("<"),n=e.length;~r;){if(t=e.slice(r,n).match(dr))return r+=t.index+t[0].length,t=e.slice(0,r),"<-/>\n"===t.slice(-5)&&(t=t.slice(0,-5)),[t,e.slice(r)];n=r,r=e.lastIndexOf("<",r-1)}return["",e]}function Re(e){if(e){var t=e.match(fr);if(t=t&&(t[2]||t[3]))return t.replace("text/","")}return""}function Me(e,t){if(e){var r=e.match(RegExp("\\s"+t+hr,"i"));if(r=r&&r[1])return/^['"]/.test(r)?r.slice(1,-1):r}return""}function Ie(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function ke(e){var t=Ie(Me(e,"options"));return t?JSON.parse(t):null}function $e(e,t,r,n){var i=Re(r),o=Me(r,"src"),a=Ut({},t.parserOptions.js);return!o&&_e(e,t,i,Ut(a,ke(r)),n)}function Fe(e,t,r,n,i){var o=Ut({},t.parserOptions.style),a={parserOpts:Ut(o,ke(r)),url:n};return je(e,i,Re(r)||t.style,a)}function Pe(e,t,r,n){var i=Dt._req("html."+r,!0);return i(e,n,t)}function He(e,t,r){var n,i=[],o={template:{},js:{},style:{}};t||(t={}),t.parserOptions=Ut(o,t.parserOptions||{}),n=t.exclude?function(e){return t.exclude.indexOf(e)<0}:function(){return 1},r||(r="");var a=bt.array(t.brackets);return t.template&&(e=Pe(e,r,t.template,t.parserOptions.template)),e=ve(e).replace(gr,function(e,o,s,u,c,l){var p="",f="",h="",d="",g=[];if(g._bp=a,s=s.toLowerCase(),u=u&&n("attribs")?be(xe(ye(u,t,g),g),g):"",(c||(c=l))&&/\S/.test(c))if(l)n("html")&&(h=we(l,t,g));else{c=c.replace(RegExp("^"+o,"gm"),""),c=c.replace(vr,function(e,i,o){return n("css")&&(f+=(f?" ":"")+Fe(o,t,i,r,s)),""}),c=c.replace(mr,function(e,i,o){if(n("js")){var a=$e(o,t,i,r);a&&(p+=(p?"\n":"")+a)}return""});var m=Ae(c.replace(tr,""));n("html")&&(h=we(m[0],t,g)),n("js")&&(c=_e(m[1],t,null,null,r),c&&(p+=(p?"\n":"")+c),p=p.replace(er,function(e){return d+=e.trim()+"\n",""}))}return p=/\S/.test(p)?p.replace(/\n{3,}/g,"\n\n"):"",t.entities?(i.push({tagName:s,html:h,css:f,attribs:u,js:p,imports:d}),""):Le(s,h,f,u,p,d,t)}),t.entities?i:e}function Be(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&(200===n.status||!n.status&&n.responseText.length)&&t(n.responseText,r,e)},n.open("GET",e,!0),n.send("")}function ze(e,t){if(typeof e===Je){var r=d("script"),n=document.documentElement;t&&(e+="\n//# sourceURL="+t+".js"),r.text=e,n.appendChild(r),n.removeChild(r)}}function De(e,t){function r(){vt.trigger("ready"),xt=!0,e&&e()}function n(e,t,n){var i=yr.compile(e,t,n);ze(i,n),--o||r()}var i=l('script[type="riot/tag"]'),o=i.length;if(o)for(var a=0;a1?/{[\S\s]*?}/:v[4],t),t[5]=r(e.length>3?/\\({|})/g:v[5],t),t[6]=r(v[6],t),t[7]=RegExp("\\\\("+t[3]+")|([[({])|("+t[3]+")|"+f,c),t[8]=e,t}function i(e){return e instanceof RegExp?s(e):y[e]}function o(e){(e||(e=m))!==y[8]&&(y=n(e),s=e===m?t:r,y[9]=s(v[9])),x=e}function a(e){var t;e=e||{},t=e.brackets,Object.defineProperty(e,"brackets",{set:o,get:function(){return x},enumerable:!0}),u=e,o(t)}var s,u,c="g",l=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,p=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'/g,f=p.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?(\/)[gim]*/.source,h=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),d=/(?=[[\]()*+?.^$|])/g,g={"(":RegExp("([()])|"+f,c),"[":RegExp("([[\\]])|"+f,c),"{":RegExp("([{}])|"+f,c)},m="{ }",v=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+f,c),m,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],x=e,y=[];return i.split=function(e,t,r){function n(e){t||a?c.push(e&&e.replace(r[5],"$1")):c.push(e)}function i(e,t,r){var n,i=g[t];for(i.lastIndex=r,r=1;(n=i.exec(e))&&(!n[1]||(n[1]===t?++r:--r)););return r?e.length:i.lastIndex}r||(r=y);var o,a,s,u,c=[],l=r[6];for(a=s=l.lastIndex=0;o=l.exec(e);){if(u=o.index,a){if(o[2]){l.lastIndex=i(e,o[2],l.lastIndex);continue}if(!o[3])continue}o[1]||(n(e.slice(s,u)),s=l.lastIndex,l=r[6+(a^=1)],l.lastIndex=s)}return e&&s tag",t.riotData.tagName.toLowerCase()),console.error(t))}function r(e){var t=n(e);return"try{return "!==t.slice(0,11)&&(t="return "+t),new Function("E",t+";")}function n(e){var t,r=[],n=bt.split(e.replace(l,'"'),1);if(n.length>2||n[0]){var o,a,s=[];for(o=a=0;o2&&!t?s+(r.push(e)-1)+"~":e}).replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var i,a=[],l=0;e&&(i=e.match(u))&&!i.index;){var p,h,d=/,|([[{(])|$/g;for(e=RegExp.rightContext,p=i[2]?r[i[2]].slice(1,-1).trim().replace(/\s+/g," "):i[1];h=(i=d.exec(e))[1];)n(h,d);h=e.slice(0,i.index),e=RegExp.rightContext,a[l++]=o(h,1,p)}e=l?l>1?"["+a.join(",")+'].join(" ").trim()':a[0]:o(e,t)}return e}function o(e,t,r){var n;return e=e.replace(d,function(e,t,r,i,o){return r&&(i=n?0:i+e.length,"this"!==r&&"global"!==r&&"window"!==r?(e=t+'("'+r+h+r,i&&(n="."===(o=o[i])||"("===o||"["===o)):i&&(n=!g.test(o.slice(i)))),e}),n&&(e="try{return "+e+"}catch(e){E(e,this)}"),r?e=(n?"function(){"+e+"}.call(this)":"("+e+")")+'?"'+r+'":""':t&&(e="function(v){"+(n?e.replace("return ","v="):"v=("+e+")")+';return v||v===0?v:""}.call(this)'),e}var a={};e.hasExpr=bt.hasExpr,e.loopKeys=bt.loopKeys,e.clearCache=function(){a={}},e.errorHandler=null;var s=String.fromCharCode(8279),u=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,c=RegExp(bt.S_QBLOCKS,"g"),l=/\u2057/g,p=/\u2057(\d+)~/g,f={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g},h='"in this?this:'+("object"!=typeof window?"global":"window")+").",d=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,g=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;return e.version=bt.version="v3.0.1",e}(),Ct=Object.freeze({each:O,contains:_,toCamel:E,startsWith:N,defineProperty:j,extend:S}),Ot=function(e){e=e||{};var t={},r=Array.prototype.slice;return Object.defineProperties(e,{on:{value:function(r,n){return"function"==typeof n&&(t[r]=t[r]||[]).push(n),e},enumerable:!1,writable:!1,configurable:!1},off:{value:function(r,n){if("*"!=r||n)if(n)for(var i,o=t[r],a=0;i=o&&o[a];++a)i==n&&o.splice(a--,1);else delete t[r];else t={};return e},enumerable:!1,writable:!1,configurable:!1},one:{value:function(t,r){function n(){e.off(t,n),r.apply(e,arguments)}return e.on(t,n)},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(n){var i,o,a,s=arguments,u=arguments.length-1,c=new Array(u);for(a=0;a|>([\S\s]*?)<\/yield\s*>|>)/gi,Tt=/]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,Lt=/ |>([\S\s]*?)<\/yield\s*>)/gi,At={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},Rt=pt&&pt<10?it:ot,Mt="div",It={},kt=It[Ke]={},$t=0,Ft=0,Pt=Object.freeze({getTag:te,inheritFrom:re,moveChildTag:ne,initChildTag:ie,getImmediateCustomParentTag:oe,unmountAll:ae,getTagName:se,cleanUpData:ue,arrayishAdd:ce,arrayishRemove:le,isInStub:pe,mountTo:fe,makeVirtual:he,moveVirtual:de,selectTags:ge}),Ht=Object.create(bt.settings),Bt={tmpl:wt,brackets:bt,styleManager:yt,vdom:Ge,styleNode:yt.styleNode,dom:ht,check:ft,misc:Ct,tags:Pt},zt=Object.freeze({settings:Ht,util:Bt,observable:Ot,Tag:G,tag:Z,tag2:K,mount:Q,mixin:W,update:J,unregister:X}),Dt=function(e){function t(t){var r=e[t];if(r)return r;throw new Error('Parser "'+t+'" not loaded.')}function r(e){var t=e.split(".");if(2!==t.length)throw new Error("Bad format for parsers._req");var r=o[t[0]][t[1]];if(r)return r;throw new Error('Parser "'+e+'" not found.')}function n(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function i(e,r,i,o){return i=n({pretty:!0,filename:o,doctype:"html"},i),t(e).render(r,i)}var o={};return o.html={jade:function(e,t,r){return console.log('DEPRECATION WARNING: jade was renamed "pug" - The jade parser will be removed in riot@3.0.0!'),i("jade",e,t,r)},pug:function(e,t,r){return i("pug",e,t,r)}},o.css={less:function(e,r,i,o){var a;return i=n({sync:!0,syncImport:!0,filename:o},i),t("less").render(r,i,function(e,t){if(e)throw e;a=t.css}),a}},o.js={es6:function(e,r,i){return t("babel").transform(e,n({filename:i},r)).code},buble:function(e,r,i){return r=n({source:i,modules:!1},r),t("buble").transform(e,r).code},coffee:function(e,r){return t("CoffeeScript").compile(e,n({bare:!0},r))},livescript:function(e,r){return t("livescript").compile(e,n({bare:!0,header:!1},r))},typescript:function(e,r){return t("typescript")(e,r)},none:function(e){return e}},o.js.javascript=o.js.none,o.js.coffeescript=o.js.coffee,o._req=r,o.utils={extend:n},o}(window||global),Ut=Dt.utils.extend,Vt=/"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source,qt=bt.R_STRINGS.source,Gt=/ *([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,Zt=RegExp(//.source+"|"+Vt,"g"),Kt=/<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^"'\/>]*(?:(?:"[^"]*"|'[^']*'|\/[^>])[^'"\/>]*)*)|\s*)(\/?)>/g,Qt=/>[ \t]+<(-?[A-Za-z]|\/[-A-Za-z])/g,Wt=["style","src","d","value"],Jt=/^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,Xt=/]*|"[^"]*")*)?>([\S\s]+?)<\/pre\s*>/gi,Yt=/^"(?:number|date(?:time)?|time|month|email|color)\b/i,er=/^\s*import(?:(?:\s|[^\s'"])*)['|"].*\n?/gm,tr=/[ \t]+$/gm,rr=me(/@#\d/,"x01"),nr=me(/@#(\d+)/g,"x01"),ir="#",or="⁗",ar='"',sr="'",ur=/^[ \t]*([$_A-Za-z][$\w]*)\s*\([^()]*\)\s*{/m,cr=RegExp("[{}]|"+bt.S_QBLOCKS,"g"),lr=RegExp(bt.R_MLCOMMS.source+"|//[^\r\n]*|"+bt.S_QBLOCKS,"g"),pr=RegExp("([{}]|^)[; ]*((?:[^@ ;{}][^{}]*)?[^@ ;{}:] ?)(?={)|"+Vt,"g"),fr=/\stype\s*=\s*(?:(['"])(.+?)\1|(\S+))/i,hr="\\s*=\\s*("+qt+"|{[^}]+}|\\S+)",dr=/\/>\n|^<(?:\/?-?[A-Za-z][-\w\xA0-\xFF]*\s*|-?[A-Za-z][-\w\xA0-\xFF]*\s+[-\w:\xA0-\xFF][\S\s]*?)>\n/,gr=RegExp(/^([ \t]*)<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^'"\/>]+(?:(?:@|\/[^>])[^'"\/>]*)*)|\s*)?(?:\/>|>[ \t]*\n?([\S\s]*)^\1<\/\2\s*>|>(.*)<\/\2\s*>)/.source.replace("@",qt),"gim"),mr=/